Free & Open-Source Invoice Generator - No Sign-Up, No Ads, Instant PDF Export, 100% In-Browser, and Fully Customizable Templates.
TypeScript fintechinvoiceinvoice-generatorinvoice-pdfinvoice-templateinvoicesnextjsopen-sourcequotesreactreact-pdf-rendererself-hostedshadcn-uitailwindcsstypescript
feat: upgrade to Next.js 15, React 19, Sentry 10, oxc, oxfmt + perf optimizations (#258)
Vlad Sazonau0b041e74fda6
diff --git a/.agents/skills/typescript-advanced-types/SKILL.md b/.agents/skills/typescript-advanced-types/SKILL.mdnew file mode 100644index 0000000..5057af7--- /dev/null+++ b/.agents/skills/typescript-advanced-types/SKILL.md@@ -0,0 +1,318 @@+---+name: typescript-advanced-types+description: Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex type logic, creating reusable type utilities, or ensuring compile-time type safety in TypeScript projects.+---++# TypeScript Advanced Types++Comprehensive guidance for mastering TypeScript's advanced type system including generics, conditional types, mapped types, template literal types, and utility types for building robust, type-safe applications.++## When to Use This Skill++- Building type-safe libraries or frameworks+- Creating reusable generic components+- Implementing complex type inference logic+- Designing type-safe API clients+- Building form validation systems+- Creating strongly-typed configuration objects+- Implementing type-safe state management+- Migrating JavaScript codebases to TypeScript++## Core Concepts++### 1. Generics++**Purpose:** Create reusable, type-flexible components while maintaining type safety.++**Basic Generic Function:**++```typescript+function identity<T>(value: T): T {+ return value;+}++const num = identity<number>(42); // Type: number+const str = identity<string>("hello"); // Type: string+const auto = identity(true); // Type inferred: boolean+```++**Generic Constraints:**++```typescript+interface HasLength {+ length: number;+}++function logLength<T extends HasLength>(item: T): T {+ console.log(item.length);+ return item;+}++logLength("hello"); // OK: string has length+logLength([1, 2, 3]); // OK: array has length+logLength({ length: 10 }); // OK: object has length+// logLength(42); // Error: number has no length+```++**Multiple Type Parameters:**++```typescript+function merge<T, U>(obj1: T, obj2: U): T & U {+ return { ...obj1, ...obj2 };+}++const merged = merge({ name: "John" }, { age: 30 });+// Type: { name: string } & { age: number }+```++### 2. Conditional Types++**Purpose:** Create types that depend on conditions, enabling sophisticated type logic.++**Basic Conditional Type:**++```typescript+type IsString<T> = T extends string ? true : false;++type A = IsString<string>; // true+type B = IsString<number>; // false+```++**Extracting Return Types:**++```typescript+type ReturnType<T> = T extends (...args: any[]) => infer R ? R : never;++function getUser() {+ return { id: 1, name: "John" };+}++type User = ReturnType<typeof getUser>;+// Type: { id: number; name: string; }+```++**Distributive Conditional Types:**++```typescript+type ToArray<T> = T extends any ? T[] : never;++type StrOrNumArray = ToArray<string | number>;+// Type: string[] | number[]+```++**Nested Conditions:**++```typescript+type TypeName<T> = T extends string+ ? "string"+ : T extends number+ ? "number"+ : T extends boolean+ ? "boolean"+ : T extends undefined+ ? "undefined"+ : T extends Function+ ? "function"+ : "object";++type T1 = TypeName<string>; // "string"+type T2 = TypeName<() => void>; // "function"+```++### 3. Mapped Types++**Purpose:** Transform existing types by iterating over their properties.++**Basic Mapped Type:**++```typescript+type Readonly<T> = {+ readonly [P in keyof T]: T[P];+};++interface User {+ id: number;+ name: string;+}++type ReadonlyUser = Readonly<User>;+// Type: { readonly id: number; readonly name: string; }+```++**Optional Properties:**++```typescript+type Partial<T> = {+ [P in keyof T]?: T[P];+};++type PartialUser = Partial<User>;+// Type: { id?: number; name?: string; }+```++**Key Remapping:**++```typescript+type Getters<T> = {+ [K in keyof T as `get${Capitalize<string & K>}`]: () => T[K];+};++interface Person {+ name: string;+ age: number;+}++type PersonGetters = Getters<Person>;+// Type: { getName: () => string; getAge: () => number; }+```++**Filtering Properties:**++```typescript+type PickByType<T, U> = {+ [K in keyof T as T[K] extends U ? K : never]: T[K];+};++interface Mixed {+ id: number;+ name: string;+ age: number;+ active: boolean;+}++type OnlyNumbers = PickByType<Mixed, number>;+// Type: { id: number; age: number; }+```++### 4. Template Literal Types++**Purpose:** Create string-based types with pattern matching and transformation.++**Basic Template Literal:**++```typescript+type EventName = "click" | "focus" | "blur";+type EventHandler = `on${Capitalize<EventName>}`;+// Type: "onClick" | "onFocus" | "onBlur"+```++**String Manipulation:**++```typescript+type UppercaseGreeting = Uppercase<"hello">; // "HELLO"+type LowercaseGreeting = Lowercase<"HELLO">; // "hello"+type CapitalizedName = Capitalize<"john">; // "John"+type UncapitalizedName = Uncapitalize<"John">; // "john"+```++**Path Building:**++```typescript+type Path<T> = T extends object+ ? {+ [K in keyof T]: K extends string ? `${K}` | `${K}.${Path<T[K]>}` : never;+ }[keyof T]+ : never;++interface Config {+ server: {+ host: string;+ port: number;+ };+ database: {+ url: string;+ };+}++type ConfigPath = Path<Config>;+// Type: "server" | "database" | "server.host" | "server.port" | "database.url"+```++### 5. Utility Types++**Built-in Utility Types:**++```typescript+// Partial<T> - Make all properties optional+type PartialUser = Partial<User>;++// Required<T> - Make all properties required+type RequiredUser = Required<PartialUser>;++// Readonly<T> - Make all properties readonly+type ReadonlyUser = Readonly<User>;++// Pick<T, K> - Select specific properties+type UserName = Pick<User, "name" | "email">;++// Omit<T, K> - Remove specific properties+type UserWithoutPassword = Omit<User, "password">;++// Exclude<T, U> - Exclude types from union+type T1 = Exclude<"a" | "b" | "c", "a">; // "b" | "c"++// Extract<T, U> - Extract types from union+type T2 = Extract<"a" | "b" | "c", "a" | "b">; // "a" | "b"++// NonNullable<T> - Exclude null and undefined+type T3 = NonNullable<string | null | undefined>; // string++// Record<K, T> - Create object type with keys K and values T+type PageInfo = Record<"home" | "about", { title: string }>;+```++## Detailed worked examples and patterns++Detailed sections (starting with `## Advanced Patterns`) live in `references/details.md`. Read that file when the navigation summary above is insufficient.++## Best Practices++1. **Use `unknown` over `any`**: Enforce type checking+2. **Prefer `interface` for object shapes**: Better error messages+3. **Use `type` for unions and complex types**: More flexible+4. **Leverage type inference**: Let TypeScript infer when possible+5. **Create helper types**: Build reusable type utilities+6. **Use const assertions**: Preserve literal types+7. **Avoid type assertions**: Use type guards instead+8. **Document complex types**: Add JSDoc comments+9. **Use strict mode**: Enable all strict compiler options+10. **Test your types**: Use type tests to verify type behavior++## Type Testing++```typescript+// Type assertion tests+type AssertEqual<T, U> = [T] extends [U]+ ? [U] extends [T]+ ? true+ : false+ : false;++type Test1 = AssertEqual<string, string>; // true+type Test2 = AssertEqual<string, number>; // false+type Test3 = AssertEqual<string | number, string>; // false++// Expect error helper+type ExpectError<T extends never> = T;++// Example usage+type ShouldError = ExpectError<AssertEqual<string, number>>;+```++## Common Pitfalls++1. **Over-using `any`**: Defeats the purpose of TypeScript+2. **Ignoring strict null checks**: Can lead to runtime errors+3. **Too complex types**: Can slow down compilation+4. **Not using discriminated unions**: Misses type narrowing opportunities+5. **Forgetting readonly modifiers**: Allows unintended mutations+6. **Circular type references**: Can cause compiler errors+7. **Not handling edge cases**: Like empty arrays or null values++## Performance Considerations++- Avoid deeply nested conditional types+- Use simple types when possible+- Cache complex type computations+- Limit recursion depth in recursive types+- Use build tools to skip type checking in productiondiff --git a/.agents/skills/typescript-advanced-types/references/details.md b/.agents/skills/typescript-advanced-types/references/details.mdnew file mode 100644index 0000000..6b1b9a1--- /dev/null+++ b/.agents/skills/typescript-advanced-types/references/details.md@@ -0,0 +1,404 @@+# typescript-advanced-types — detailed worked examples++## Advanced Patterns++### Pattern 1: Type-Safe Event Emitter++```typescript+type EventMap = {+ "user:created": { id: string; name: string };+ "user:updated": { id: string };+ "user:deleted": { id: string };+};++class TypedEventEmitter<T extends Record<string, any>> {+ private listeners: {+ [K in keyof T]?: Array<(data: T[K]) => void>;+ } = {};++ on<K extends keyof T>(event: K, callback: (data: T[K]) => void): void {+ if (!this.listeners[event]) {+ this.listeners[event] = [];+ }+ this.listeners[event]!.push(callback);+ }++ emit<K extends keyof T>(event: K, data: T[K]): void {+ const callbacks = this.listeners[event];+ if (callbacks) {+ callbacks.forEach((callback) => callback(data));+ }+ }+}++const emitter = new TypedEventEmitter<EventMap>();++emitter.on("user:created", (data) => {+ console.log(data.id, data.name); // Type-safe!+});++emitter.emit("user:created", { id: "1", name: "John" });+// emitter.emit("user:created", { id: "1" }); // Error: missing 'name'+```++### Pattern 2: Type-Safe API Client++```typescript+type HTTPMethod = "GET" | "POST" | "PUT" | "DELETE";++type EndpointConfig = {+ "/users": {+ GET: { response: User[] };+ POST: { body: { name: string; email: string }; response: User };+ };+ "/users/:id": {+ GET: { params: { id: string }; response: User };+ PUT: { params: { id: string }; body: Partial<User>; response: User };+ DELETE: { params: { id: string }; response: void };+ };+};++type ExtractParams<T> = T extends { params: infer P } ? P : never;+type ExtractBody<T> = T extends { body: infer B } ? B : never;+type ExtractResponse<T> = T extends { response: infer R } ? R : never;++class APIClient<Config extends Record<string, Record<HTTPMethod, any>>> {+ async request<Path extends keyof Config, Method extends keyof Config[Path]>(+ path: Path,+ method: Method,+ ...[options]: ExtractParams<Config[Path][Method]> extends never+ ? ExtractBody<Config[Path][Method]> extends never+ ? []+ : [{ body: ExtractBody<Config[Path][Method]> }]+ : [+ {+ params: ExtractParams<Config[Path][Method]>;+ body?: ExtractBody<Config[Path][Method]>;+ },+ ]+ ): Promise<ExtractResponse<Config[Path][Method]>> {+ // Implementation here+ return {} as any;+ }+}++const api = new APIClient<EndpointConfig>();++// Type-safe API calls+const users = await api.request("/users", "GET");+// Type: User[]++const newUser = await api.request("/users", "POST", {+ body: { name: "John", email: "[email protected]" },+});+// Type: User++const user = await api.request("/users/:id", "GET", {+ params: { id: "123" },+});+// Type: User+```++### Pattern 3: Builder Pattern with Type Safety++```typescript+type BuilderState<T> = {+ [K in keyof T]: T[K] | undefined;+};++type RequiredKeys<T> = {+ [K in keyof T]-?: {} extends Pick<T, K> ? never : K;+}[keyof T];++type OptionalKeys<T> = {+ [K in keyof T]-?: {} extends Pick<T, K> ? K : never;+}[keyof T];++type IsComplete<T, S> =+ RequiredKeys<T> extends keyof S+ ? S[RequiredKeys<T>] extends undefined+ ? false+ : true+ : false;++class Builder<T, S extends BuilderState<T> = {}> {+ private state: S = {} as S;++ set<K extends keyof T>(key: K, value: T[K]): Builder<T, S & Record<K, T[K]>> {+ this.state[key] = value;+ return this as any;+ }++ build(this: IsComplete<T, S> extends true ? this : never): T {+ return this.state as T;+ }+}++interface User {+ id: string;+ name: string;+ email: string;+ age?: number;+}++const builder = new Builder<User>();++const user = builder+ .set("id", "1")+ .set("name", "John")+ .set("email", "[email protected]")+ .build(); // OK: all required fields set++// const incomplete = builder+// .set("id", "1")+// .build(); // Error: missing required fields+```++### Pattern 4: Deep Readonly/Partial++```typescript+type DeepReadonly<T> = {+ readonly [P in keyof T]: T[P] extends object+ ? T[P] extends Function+ ? T[P]+ : DeepReadonly<T[P]>+ : T[P];+};++type DeepPartial<T> = {+ [P in keyof T]?: T[P] extends object+ ? T[P] extends Array<infer U>+ ? Array<DeepPartial<U>>+ : DeepPartial<T[P]>+ : T[P];+};++interface Config {+ server: {+ host: string;+ port: number;+ ssl: {+ enabled: boolean;+ cert: string;+ };+ };+ database: {+ url: string;+ pool: {+ min: number;+ max: number;+ };+ };+}++type ReadonlyConfig = DeepReadonly<Config>;+// All nested properties are readonly++type PartialConfig = DeepPartial<Config>;+// All nested properties are optional+```++### Pattern 5: Type-Safe Form Validation++```typescript+type ValidationRule<T> = {+ validate: (value: T) => boolean;+ message: string;+};++type FieldValidation<T> = {+ [K in keyof T]?: ValidationRule<T[K]>[];+};++type ValidationErrors<T> = {+ [K in keyof T]?: string[];+};++class FormValidator<T extends Record<string, any>> {+ constructor(private rules: FieldValidation<T>) {}++ validate(data: T): ValidationErrors<T> | null {+ const errors: ValidationErrors<T> = {};+ let hasErrors = false;++ for (const key in this.rules) {+ const fieldRules = this.rules[key];+ const value = data[key];++ if (fieldRules) {+ const fieldErrors: string[] = [];++ for (const rule of fieldRules) {+ if (!rule.validate(value)) {+ fieldErrors.push(rule.message);+ }+ }++ if (fieldErrors.length > 0) {+ errors[key] = fieldErrors;+ hasErrors = true;+ }+ }+ }++ return hasErrors ? errors : null;+ }+}++interface LoginForm {+ email: string;+ password: string;+}++const validator = new FormValidator<LoginForm>({+ email: [+ {+ validate: (v) => v.includes("@"),+ message: "Email must contain @",+ },+ {+ validate: (v) => v.length > 0,+ message: "Email is required",+ },+ ],+ password: [+ {+ validate: (v) => v.length >= 8,+ message: "Password must be at least 8 characters",+ },+ ],+});++const errors = validator.validate({+ email: "invalid",+ password: "short",+});+// Type: { email?: string[]; password?: string[]; } | null+```++### Pattern 6: Discriminated Unions++```typescript+type Success<T> = {+ status: "success";+ data: T;+};++type Error = {+ status: "error";+ error: string;+};++type Loading = {+ status: "loading";+};++type AsyncState<T> = Success<T> | Error | Loading;++function handleState<T>(state: AsyncState<T>): void {+ switch (state.status) {+ case "success":+ console.log(state.data); // Type: T+ break;+ case "error":+ console.log(state.error); // Type: string+ break;+ case "loading":+ console.log("Loading...");+ break;+ }+}++// Type-safe state machine+type State =+ | { type: "idle" }+ | { type: "fetching"; requestId: string }+ | { type: "success"; data: any }+ | { type: "error"; error: Error };++type Event =+ | { type: "FETCH"; requestId: string }+ | { type: "SUCCESS"; data: any }+ | { type: "ERROR"; error: Error }+ | { type: "RESET" };++function reducer(state: State, event: Event): State {+ switch (state.type) {+ case "idle":+ return event.type === "FETCH"+ ? { type: "fetching", requestId: event.requestId }+ : state;+ case "fetching":+ if (event.type === "SUCCESS") {+ return { type: "success", data: event.data };+ }+ if (event.type === "ERROR") {+ return { type: "error", error: event.error };+ }+ return state;+ case "success":+ case "error":+ return event.type === "RESET" ? { type: "idle" } : state;+ }+}+```++## Type Inference Techniques++### 1. Infer Keyword++```typescript+// Extract array element type+type ElementType<T> = T extends (infer U)[] ? U : never;++type NumArray = number[];+type Num = ElementType<NumArray>; // number++// Extract promise type+type PromiseType<T> = T extends Promise<infer U> ? U : never;++type AsyncNum = PromiseType<Promise<number>>; // number++// Extract function parameters+type Parameters<T> = T extends (...args: infer P) => any ? P : never;++function foo(a: string, b: number) {}+type FooParams = Parameters<typeof foo>; // [string, number]+```++### 2. Type Guards++```typescript+function isString(value: unknown): value is string {+ return typeof value === "string";+}++function isArrayOf<T>(+ value: unknown,+ guard: (item: unknown) => item is T,+): value is T[] {+ return Array.isArray(value) && value.every(guard);+}++const data: unknown = ["a", "b", "c"];++if (isArrayOf(data, isString)) {+ data.forEach((s) => s.toUpperCase()); // Type: string[]+}+```++### 3. Assertion Functions++```typescript+function assertIsString(value: unknown): asserts value is string {+ if (typeof value !== "string") {+ throw new Error("Not a string");+ }+}++function processValue(value: unknown) {+ assertIsString(value);+ // value is now typed as string+ console.log(value.toUpperCase());+}+```diff --git a/.agents/skills/vercel-react-best-practices/AGENTS.md b/.agents/skills/vercel-react-best-practices/AGENTS.mdindex 55f6420..5d02dc3 100644--- a/.agents/skills/vercel-react-best-practices/AGENTS.md+++ b/.agents/skills/vercel-react-best-practices/AGENTS.md@@ -2399,7 +2399,7 @@ Apply `content-visibility: auto` to defer off-screen rendering.```tsxfunction MessageList({ messages }: { messages: Message[] }) {return (- <div className="h-screen overflow-y-auto">+ <div className="overflow-y-auto h-screen">{messages.map((msg) => (<div key={msg.id} className="message-item"><Avatar user={msg.author} />@@ -2423,7 +2423,7 @@ Extract static JSX outside components to avoid re-creation.```tsxfunction LoadingSkeleton() {- return <div className="h-20 animate-pulse bg-gray-200" />;+ return <div className="animate-pulse h-20 bg-gray-200" />;}function Container() {@@ -2434,7 +2434,7 @@ function Container() {**Correct: reuses same element**```tsx-const loadingSkeleton = <div className="h-20 animate-pulse bg-gray-200" />;+const loadingSkeleton = <div className="animate-pulse h-20 bg-gray-200" />;function Container() {return <div>{loading && loadingSkeleton}</div>;diff --git a/.agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md b/.agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.mdindex 1aebfab..e0d284d 100644--- a/.agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md+++ b/.agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md@@ -23,7 +23,7 @@ Apply `content-visibility: auto` to defer off-screen rendering.```tsxfunction MessageList({ messages }: { messages: Message[] }) {return (- <div className="h-screen overflow-y-auto">+ <div className="overflow-y-auto h-screen">{messages.map((msg) => (<div key={msg.id} className="message-item"><Avatar user={msg.author} />diff --git a/.agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md b/.agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.mdindex fea1751..55373a5 100644--- a/.agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md+++ b/.agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md@@ -13,7 +13,7 @@ Extract static JSX outside components to avoid re-creation.```tsxfunction LoadingSkeleton() {- return <div className="h-20 animate-pulse bg-gray-200" />;+ return <div className="animate-pulse h-20 bg-gray-200" />;}function Container() {@@ -24,7 +24,7 @@ function Container() {**Correct (reuses same element):**```tsx-const loadingSkeleton = <div className="h-20 animate-pulse bg-gray-200" />;+const loadingSkeleton = <div className="animate-pulse h-20 bg-gray-200" />;function Container() {return <div>{loading && loadingSkeleton}</div>;diff --git a/.claude/skills/caveman b/.claude/skills/cavemannew file mode 120000index 0000000..9016aac--- /dev/null+++ b/.claude/skills/caveman@@ -0,0 +1 @@+../../.agents/skills/caveman\ No newline at end of filediff --git a/.claude/skills/changelog-maintenance b/.claude/skills/changelog-maintenancenew file mode 120000index 0000000..dfdb0d1--- /dev/null+++ b/.claude/skills/changelog-maintenance@@ -0,0 +1 @@+../../.agents/skills/changelog-maintenance\ No newline at end of filediff --git a/.claude/skills/competitive-landscape b/.claude/skills/competitive-landscapenew file mode 120000index 0000000..6e3197c--- /dev/null+++ b/.claude/skills/competitive-landscape@@ -0,0 +1 @@+../../.agents/skills/competitive-landscape\ No newline at end of filediff --git a/.claude/skills/competitor-analysis b/.claude/skills/competitor-analysisnew file mode 120000index 0000000..b0b1005--- /dev/null+++ b/.claude/skills/competitor-analysis@@ -0,0 +1 @@+../../.agents/skills/competitor-analysis\ No newline at end of filediff --git a/.claude/skills/emil-design-eng b/.claude/skills/emil-design-engnew file mode 120000index 0000000..0f0ee98--- /dev/null+++ b/.claude/skills/emil-design-eng@@ -0,0 +1 @@+../../.agents/skills/emil-design-eng\ No newline at end of filediff --git a/.claude/skills/frontend-design b/.claude/skills/frontend-designnew file mode 120000index 0000000..712f694--- /dev/null+++ b/.claude/skills/frontend-design@@ -0,0 +1 @@+../../.agents/skills/frontend-design\ No newline at end of filediff --git a/.claude/skills/keyword-clustering b/.claude/skills/keyword-clusteringnew file mode 120000index 0000000..f212420--- /dev/null+++ b/.claude/skills/keyword-clustering@@ -0,0 +1 @@+../../.agents/skills/keyword-clustering\ No newline at end of filediff --git a/.claude/skills/keyword-research b/.claude/skills/keyword-researchnew file mode 120000index 0000000..671cddc--- /dev/null+++ b/.claude/skills/keyword-research@@ -0,0 +1 @@+../../.agents/skills/keyword-research\ No newline at end of filediff --git a/.claude/skills/link-prospecting b/.claude/skills/link-prospectingnew file mode 120000index 0000000..3668858--- /dev/null+++ b/.claude/skills/link-prospecting@@ -0,0 +1 @@+../../.agents/skills/link-prospecting\ No newline at end of filediff --git a/.claude/skills/make-interfaces-feel-better b/.claude/skills/make-interfaces-feel-betternew file mode 120000index 0000000..d97f371--- /dev/null+++ b/.claude/skills/make-interfaces-feel-better@@ -0,0 +1 @@+../../.agents/skills/make-interfaces-feel-better\ No newline at end of filediff --git a/.claude/skills/merge-ready b/.claude/skills/merge-readynew file mode 120000index 0000000..1e7a1f9--- /dev/null+++ b/.claude/skills/merge-ready@@ -0,0 +1 @@+../../.agents/skills/merge-ready\ No newline at end of filediff --git a/.claude/skills/openseo-release-notes b/.claude/skills/openseo-release-notesnew file mode 120000index 0000000..01b3f90--- /dev/null+++ b/.claude/skills/openseo-release-notes@@ -0,0 +1 @@+../../.agents/skills/openseo-release-notes\ No newline at end of filediff --git a/.claude/skills/programmatic-seo b/.claude/skills/programmatic-seonew file mode 120000index 0000000..ab5acd4--- /dev/null+++ b/.claude/skills/programmatic-seo@@ -0,0 +1 @@+../../.agents/skills/programmatic-seo\ No newline at end of filediff --git a/.claude/skills/seo-audit b/.claude/skills/seo-auditnew file mode 120000index 0000000..e89ca8b--- /dev/null+++ b/.claude/skills/seo-audit@@ -0,0 +1 @@+../../.agents/skills/seo-audit\ No newline at end of filediff --git a/.claude/skills/seo-coach b/.claude/skills/seo-coachnew file mode 120000index 0000000..0521f08--- /dev/null+++ b/.claude/skills/seo-coach@@ -0,0 +1 @@+../../.agents/skills/seo-coach\ No newline at end of filediff --git a/.claude/skills/seo-project-setup b/.claude/skills/seo-project-setupnew file mode 120000index 0000000..b7b8747--- /dev/null+++ b/.claude/skills/seo-project-setup@@ -0,0 +1 @@+../../.agents/skills/seo-project-setup\ No newline at end of filediff --git a/.claude/skills/trigger-authoring-chat-agent b/.claude/skills/trigger-authoring-chat-agentnew file mode 120000index 0000000..13978fc--- /dev/null+++ b/.claude/skills/trigger-authoring-chat-agent@@ -0,0 +1 @@+../../.cursor/skills/trigger-authoring-chat-agent\ No newline at end of filediff --git a/.claude/skills/trigger-authoring-tasks b/.claude/skills/trigger-authoring-tasksnew file mode 120000index 0000000..5684073--- /dev/null+++ b/.claude/skills/trigger-authoring-tasks@@ -0,0 +1 @@+../../.cursor/skills/trigger-authoring-tasks\ No newline at end of filediff --git a/.claude/skills/trigger-cost-savings b/.claude/skills/trigger-cost-savingsnew file mode 120000index 0000000..324f7d5--- /dev/null+++ b/.claude/skills/trigger-cost-savings@@ -0,0 +1 @@+../../.cursor/skills/trigger-cost-savings\ No newline at end of filediff --git a/.claude/skills/trigger-getting-started b/.claude/skills/trigger-getting-startednew file mode 120000index 0000000..f5cde7c--- /dev/null+++ b/.claude/skills/trigger-getting-started@@ -0,0 +1 @@+../../.cursor/skills/trigger-getting-started\ No newline at end of filediff --git a/.claude/skills/typescript-advanced-types b/.claude/skills/typescript-advanced-typesnew file mode 120000index 0000000..4d2e523--- /dev/null+++ b/.claude/skills/typescript-advanced-types@@ -0,0 +1 @@+../../.agents/skills/typescript-advanced-types\ No newline at end of filediff --git a/.claude/skills/vercel-composition-patterns b/.claude/skills/vercel-composition-patternsnew file mode 120000index 0000000..55a19e8--- /dev/null+++ b/.claude/skills/vercel-composition-patterns@@ -0,0 +1 @@+../../.agents/skills/vercel-composition-patterns\ No newline at end of filediff --git a/.claude/skills/vercel-react-best-practices b/.claude/skills/vercel-react-best-practicesnew file mode 120000index 0000000..e567923--- /dev/null+++ b/.claude/skills/vercel-react-best-practices@@ -0,0 +1 @@+../../.agents/skills/vercel-react-best-practices\ No newline at end of filediff --git a/.claude/skills/vercel-react-view-transitions b/.claude/skills/vercel-react-view-transitionsnew file mode 120000index 0000000..78a3222--- /dev/null+++ b/.claude/skills/vercel-react-view-transitions@@ -0,0 +1 @@+../../.agents/skills/vercel-react-view-transitions\ No newline at end of filediff --git a/.claude/skills/web-design-guidelines b/.claude/skills/web-design-guidelinesnew file mode 120000index 0000000..886b26d--- /dev/null+++ b/.claude/skills/web-design-guidelines@@ -0,0 +1 @@+../../.agents/skills/web-design-guidelines\ No newline at end of filediff --git a/.claude/skills/writing-guidelines b/.claude/skills/writing-guidelinesnew file mode 120000index 0000000..af8c378--- /dev/null+++ b/.claude/skills/writing-guidelines@@ -0,0 +1 @@+../../.agents/skills/writing-guidelines\ No newline at end of filediff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.ymlindex 64e4498..c2aeaee 100644--- a/.github/workflows/e2e.yml+++ b/.github/workflows/e2e.yml@@ -20,7 +20,7 @@ jobs:name: Run e2e tests via ${{ github.event_name == 'deployment_status' && 'Vercel deployment' }}timeout-minutes: 50# we use macos-latest because I am using mac os locally and generating snapshots (screenshots) for the PDF tests locally, so we need to use the same OS on the CI. https://docs.github.com/en/actions/how-tos/write-workflows/choose-where-workflows-run/choose-the-runner-for-a-job#choosing-github-hosted-runners- runs-on: macos-latest+ runs-on: macos-14env:TZ: Europe/Warsaw # we use Europe/Warsaw timezone for consistent date handling across local machines and CIsteps:@@ -55,14 +55,23 @@ jobs:run: sfw pnpm install --frozen-lockfile # firewall to block malicious packages from being installed https://docs.socket.dev/docs/socket-firewall-overview- name: 📦 Install Playwright browser binaries & OS dependencies- run: pnpm exec playwright install chromium webkit --with-deps+ run: pnpm exec playwright install chromium webkit firefox --with-deps- name: 🎭 Run Playwright testsid: playwrightenv:BASE_URL: ${{ github.event_name == 'deployment_status' && github.event.deployment_status.environment_url }}- SENTRY_ENABLED: false- NEXT_PUBLIC_SENTRY_ENABLED: false+ # NOTE: Sentry cannot be switched off from here. These tests drive a real+ # Vercel preview deployment, which runs with its own env vars — anything set+ # on this step only reaches the Playwright process. The browser SDK is opted+ # out inside the app instead: `playwright.config.ts` seeds the+ # `sentry.disabled` localStorage key. Server and edge events caused by a run+ # are still reported.+ #+ # Needed by the /api/generate-invoice/preview e2e snapshots. Must match the+ # AUTH_TOKEN of the deployment under test. The preview tests fail when it is+ # unset so CI cannot pass without exercising the authenticated endpoint.+ AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}continue-on-error: true# https://playwright.dev/docs/test-reporters#line-reporterrun: pnpm exec playwright test --reporter=html,list@@ -76,20 +85,21 @@ jobs:if-no-files-found: ignoreretention-days: 1+ # `deployment_status` has no PR in its payload, and `github.ref_name` is empty+ # for this event, so we look the PR up by the deployed commit SHA instead.- name: 🔍 Get PR URLid: pr-urlif: always()env:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}GH_REPOSITORY: ${{ github.repository }}- GH_REPOSITORY_OWNER: ${{ github.repository_owner }}- GH_REF_NAME: ${{ github.ref_name }}+ GH_SHA: ${{ github.event.deployment.sha }}run: |- PR_URL=$(curl -s \+ PR_URL=$(curl -sf \-H "Authorization: Bearer $GITHUB_TOKEN" \-H "Accept: application/vnd.github+json" \- "https://api.github.com/repos/$GH_REPOSITORY/pulls?head=$GH_REPOSITORY_OWNER:$GH_REF_NAME" \- | jq -r '.[0].html_url // empty')+ "https://api.github.com/repos/$GH_REPOSITORY/commits/$GH_SHA/pulls" \+ | jq -r '.[0].html_url // empty' || true)echo "pr_url=$PR_URL" >> "$GITHUB_OUTPUT"- name: 📧 Send emaildiff --git a/.github/workflows/knip.yml b/.github/workflows/knip.ymlindex d8f8aec..a702ebc 100644--- a/.github/workflows/knip.yml+++ b/.github/workflows/knip.yml@@ -7,7 +7,6 @@ on:permissions:contents: read- pull-requests: readjobs:knip:@@ -45,22 +44,6 @@ jobs:continue-on-error: truerun: pnpm knip- - name: 🔍 Get PR URL- if: steps.knip.outcome == 'failure'- id: pr-url- env:- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}- GH_REPOSITORY: ${{ github.repository }}- GH_REPOSITORY_OWNER: ${{ github.repository_owner }}- GH_REF_NAME: ${{ github.ref_name }}- run: |- PR_URL=$(curl -s \- -H "Authorization: Bearer $GITHUB_TOKEN" \- -H "Accept: application/vnd.github+json" \- "https://api.github.com/repos/$GH_REPOSITORY/pulls?head=$GH_REPOSITORY_OWNER:$GH_REF_NAME" \- | jq -r '.[0].html_url // empty')- echo "pr_url=$PR_URL" >> "$GITHUB_OUTPUT"-- name: 📧 Send emailif: steps.knip.outcome == 'failure'# https://github.com/dawidd6/action-send-mail@@ -78,7 +61,7 @@ jobs:For more details, please check:- GitHub Actions run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}- ${{ steps.pr-url.outputs.pr_url && format('- Pull Request: {0}', steps.pr-url.outputs.pr_url) }}+ ${{ github.event.pull_request.html_url && format('- Pull Request: {0}', github.event.pull_request.html_url) }}- name: ❌ Mark workflow failed on Knip failureif: steps.knip.outcome == 'failure'diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.ymlindex 7aa9a45..bcd5d12 100644--- a/.github/workflows/lint.yml+++ b/.github/workflows/lint.yml@@ -1,4 +1,4 @@-name: 🧹 ESLint+name: 🧹 Oxlinton:push:branches: [main]@@ -7,11 +7,10 @@ on:permissions:contents: read- pull-requests: readjobs:lint:- name: Run linting+ name: Run linting and format checktimeout-minutes: 5runs-on: ubuntu-lateststeps:@@ -43,26 +42,21 @@ jobs:- name: 🔎 Run lintingid: lintcontinue-on-error: true- run: pnpm eslint .-- - name: 🔍 Get PR URL- if: steps.lint.outcome == 'failure'- id: pr-url+ # `--format=github` turns findings into inline PR annotations.+ # Type-aware rules run too (see `options.typeAware` in .oxlintrc.json).env:- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}- GH_REPOSITORY: ${{ github.repository }}- GH_REPOSITORY_OWNER: ${{ github.repository_owner }}- GH_REF_NAME: ${{ github.ref_name }}- run: |- PR_URL=$(curl -s \- -H "Authorization: Bearer $GITHUB_TOKEN" \- -H "Accept: application/vnd.github+json" \- "https://api.github.com/repos/$GH_REPOSITORY/pulls?head=$GH_REPOSITORY_OWNER:$GH_REF_NAME" \- | jq -r '.[0].html_url // empty')- echo "pr_url=$PR_URL" >> "$GITHUB_OUTPUT"+ # `next typegen` loads next.config.mjs, which validates src/env.ts.+ # Runtime secrets are not needed (and not available) for linting.+ SKIP_ENV_VALIDATION: "true"+ run: pnpm lint --format=github --quiet++ - name: 💅 Check formatting+ id: format+ continue-on-error: true+ run: pnpm format:check- name: 📧 Send email- if: steps.lint.outcome == 'failure'+ if: steps.lint.outcome == 'failure' || steps.format.outcome == 'failure'# https://github.com/dawidd6/action-send-mailuses: dawidd6/action-send-mail@d38f3f7cd391cdebfe0d38efc3998b935e951c4f # v16with:@@ -72,14 +66,17 @@ jobs:to: ${{ secrets.EMAIL_USERNAME }}username: ${{ secrets.EMAIL_USERNAME }}password: ${{ secrets.EMAIL_PASSWORD }}- subject: ❌ Linting Failed for ${{ github.repository }}+ subject: "❌ ${{ steps.lint.outcome == 'failure' && (steps.format.outcome == 'failure' && 'Linting and formatting failed' || 'Linting failed') || 'Formatting failed' }} for ${{ github.repository }}"body: |- Linting for ${{ github.repository }} has failed.+ Linting or formatting for ${{ github.repository }} has failed.++ - 🔎 Lint (oxlint): ${{ steps.lint.outcome == 'failure' && '❌ failed' || '✅ passed' }}+ - 💅 Format (oxfmt): ${{ steps.format.outcome == 'failure' && '❌ failed' || '✅ passed' }}For more details, please check:- GitHub Actions run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}- ${{ steps.pr-url.outputs.pr_url && format('- Pull Request: {0}', steps.pr-url.outputs.pr_url) }}+ ${{ github.event.pull_request.html_url && format('- Pull Request: {0}', github.event.pull_request.html_url) }}- - name: ❌ Mark workflow failed on Linting failure- if: steps.lint.outcome == 'failure'+ - name: ❌ Mark workflow failed on linting or formatting failure+ if: steps.lint.outcome == 'failure' || steps.format.outcome == 'failure'run: exit 1diff --git a/.github/workflows/pnpm-policy.yml b/.github/workflows/pnpm-policy.ymlindex ea64ee0..91932ae 100644--- a/.github/workflows/pnpm-policy.yml+++ b/.github/workflows/pnpm-policy.yml@@ -7,7 +7,6 @@ on:permissions:contents: read- pull-requests: readjobs:pnpm-policy:@@ -68,23 +67,6 @@ jobs:verify_config minimum-release-age 7200verify_config block-exotic-subdeps true- verify_config trust-policy no-downgrade-- - name: 🔍 Get PR URL- if: steps.pnpm-policy.outcome == 'failure'- id: pr-url- env:- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}- GH_REPOSITORY: ${{ github.repository }}- GH_REPOSITORY_OWNER: ${{ github.repository_owner }}- GH_REF_NAME: ${{ github.ref_name }}- run: |- PR_URL=$(curl -s \- -H "Authorization: Bearer $GITHUB_TOKEN" \- -H "Accept: application/vnd.github+json" \- "https://api.github.com/repos/$GH_REPOSITORY/pulls?head=$GH_REPOSITORY_OWNER:$GH_REF_NAME" \- | jq -r '.[0].html_url // empty')- echo "pr_url=$PR_URL" >> "$GITHUB_OUTPUT"- name: 📧 Send emailif: steps.pnpm-policy.outcome == 'failure'@@ -103,7 +85,7 @@ jobs:For more details, please check:- GitHub Actions run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}- ${{ steps.pr-url.outputs.pr_url && format('- Pull Request: {0}', steps.pr-url.outputs.pr_url) }}+ ${{ github.event.pull_request.html_url && format('- Pull Request: {0}', github.event.pull_request.html_url) }}- name: ❌ Mark workflow failed on pnpm policy failureif: steps.pnpm-policy.outcome == 'failure'diff --git a/.github/workflows/type-check.yml b/.github/workflows/type-check.ymlindex 901a38d..12a6f39 100644--- a/.github/workflows/type-check.yml+++ b/.github/workflows/type-check.yml@@ -7,7 +7,6 @@ on:permissions:contents: read- pull-requests: readjobs:type-check:@@ -43,23 +42,11 @@ jobs:- name: 🔍 Run type checkid: type-checkcontinue-on-error: true- run: pnpm type-check:go-- - name: 🔍 Get PR URL- if: steps.type-check.outcome == 'failure'- id: pr-urlenv:- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}- GH_REPOSITORY: ${{ github.repository }}- GH_REPOSITORY_OWNER: ${{ github.repository_owner }}- GH_REF_NAME: ${{ github.ref_name }}- run: |- PR_URL=$(curl -s \- -H "Authorization: Bearer $GITHUB_TOKEN" \- -H "Accept: application/vnd.github+json" \- "https://api.github.com/repos/$GH_REPOSITORY/pulls?head=$GH_REPOSITORY_OWNER:$GH_REF_NAME" \- | jq -r '.[0].html_url // empty')- echo "pr_url=$PR_URL" >> "$GITHUB_OUTPUT"+ # `next typegen` loads next.config.mjs, which validates src/env.ts.+ # Runtime secrets are not needed (and not available) for type checking.+ SKIP_ENV_VALIDATION: "true"+ run: pnpm type-check- name: 📧 Send emailif: steps.type-check.outcome == 'failure'@@ -78,7 +65,7 @@ jobs:For more details, please check:- GitHub Actions run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}- ${{ steps.pr-url.outputs.pr_url && format('- Pull Request: {0}', steps.pr-url.outputs.pr_url) }}+ ${{ github.event.pull_request.html_url && format('- Pull Request: {0}', github.event.pull_request.html_url) }}- name: ❌ Mark workflow failed on Type Check failureif: steps.type-check.outcome == 'failure'diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.ymlindex 52fcf03..f5a4f1b 100644--- a/.github/workflows/unit-tests.yml+++ b/.github/workflows/unit-tests.yml@@ -7,7 +7,6 @@ on:permissions:contents: read- pull-requests: readjobs:unit-tests:@@ -45,22 +44,6 @@ jobs:run: pnpm vitest run --reporter=verbosecontinue-on-error: true- - name: 🔍 Get PR URL- if: steps.vitest.outcome == 'failure'- id: pr-url- env:- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}- GH_REPOSITORY: ${{ github.repository }}- GH_REPOSITORY_OWNER: ${{ github.repository_owner }}- GH_REF_NAME: ${{ github.ref_name }}- run: |- PR_URL=$(curl -s \- -H "Authorization: Bearer $GITHUB_TOKEN" \- -H "Accept: application/vnd.github+json" \- "https://api.github.com/repos/$GH_REPOSITORY/pulls?head=$GH_REPOSITORY_OWNER:$GH_REF_NAME" \- | jq -r '.[0].html_url // empty')- echo "pr_url=$PR_URL" >> "$GITHUB_OUTPUT"-- name: 📧 Send emailif: steps.vitest.outcome == 'failure'# https://github.com/dawidd6/action-send-mail@@ -78,7 +61,7 @@ jobs:For more details, please check:- GitHub Actions run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}- ${{ steps.pr-url.outputs.pr_url && format('- Pull Request: {0}', steps.pr-url.outputs.pr_url) }}+ ${{ github.event.pull_request.html_url && format('- Pull Request: {0}', github.event.pull_request.html_url) }}- name: ❌ Mark workflow failed on Unit Tests failureif: steps.vitest.outcome == 'failure'diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.ymlindex f645ce7..6c05b22 100644--- a/.github/workflows/zizmor.yml+++ b/.github/workflows/zizmor.yml@@ -31,22 +31,6 @@ jobs:env:GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}- - name: 🔍 Get PR URL- if: steps.zizmor.outcome == 'failure'- id: pr-url- env:- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}- GH_REPOSITORY: ${{ github.repository }}- GH_REPOSITORY_OWNER: ${{ github.repository_owner }}- GH_REF_NAME: ${{ github.ref_name }}- run: |- PR_URL=$(curl -s \- -H "Authorization: Bearer $GITHUB_TOKEN" \- -H "Accept: application/vnd.github+json" \- "https://api.github.com/repos/$GH_REPOSITORY/pulls?head=$GH_REPOSITORY_OWNER:$GH_REF_NAME" \- | jq -r '.[0].html_url // empty')- echo "pr_url=$PR_URL" >> "$GITHUB_OUTPUT"-- name: 📧 Send emailif: steps.zizmor.outcome == 'failure'# https://github.com/dawidd6/action-send-mail@@ -64,7 +48,7 @@ jobs:For more details, please check:- GitHub Actions run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}- ${{ steps.pr-url.outputs.pr_url && format('- Pull Request: {0}', steps.pr-url.outputs.pr_url) }}+ ${{ github.event.pull_request.html_url && format('- Pull Request: {0}', github.event.pull_request.html_url) }}- name: ❌ Mark workflow failed on zizmor failureif: steps.zizmor.outcome == 'failure'diff --git a/.gitignore b/.gitignoreindex 0f0d404..4aa9350 100644--- a/.gitignore+++ b/.gitignore@@ -47,8 +47,8 @@ node_modules//playwright-output//playwright-test-downloads/-# eslint-.eslintcache+# oxlint / oxfmt+.oxlintcache# i18nmessages/en.d.json.tsdiff --git a/.husky/pre-commit b/.husky/commit-msgsimilarity index 100%rename from .husky/pre-commitrename to .husky/commit-msgdiff --git a/.npmrc b/.npmrcindex 7a610f9..0040761 100644--- a/.npmrc+++ b/.npmrc@@ -6,5 +6,8 @@ save-exact=true# https://pnpm.io/settings#minimumreleaseageminimum-release-age=7200 # 5 days++# packages exempt from the minimum-release-age wait above+# https://pnpm.io/settings#minimumreleaseageexclude+minimum-release-age-exclude[]=block-exotic-subdeps=true-trust-policy=no-downgrade\ No newline at end of filediff --git a/.oxfmtrc.json b/.oxfmtrc.jsonnew file mode 100644index 0000000..81b52e1--- /dev/null+++ b/.oxfmtrc.json@@ -0,0 +1,24 @@+// Generated with `oxfmt --migrate=prettier` from the old `.prettierrc.js` and+// `.prettierignore`. Comments are allowed here (oxfmt parses JSONC).+{+ "$schema": "./node_modules/oxfmt/configuration_schema.json",+ "trailingComma": "all",+ "singleQuote": false,+ "semi": true,+ "arrowParens": "always",+ "bracketSpacing": true,+ "endOfLine": "lf",+ "printWidth": 80,+ "tabWidth": 2,+ "useTabs": false,+ // oxfmt has Tailwind class sorting built in, replacing prettier-plugin-tailwindcss.+ // Point it at the v3 config explicitly - autodiscovery only looks for+ // `tailwind.config.js`, and ours is TypeScript.+ "sortTailwindcss": {+ "config": "./tailwind.config.ts",+ "functions": ["cn", "cva", "clsx"]+ },+ "sortPackageJson": true,+ "sortImports": true,+ "ignorePatterns": ["messages/en.d.json.ts", "pnpm-lock.yaml"]+}diff --git a/.oxlintrc.json b/.oxlintrc.jsonnew file mode 100644index 0000000..a760a4d--- /dev/null+++ b/.oxlintrc.json@@ -0,0 +1,441 @@+// Lint config for oxlint (JSONC - comments are allowed).+//+// Instead of listing every rule (what `npx @oxlint/migrate` generated), we lean on+// oxlint's rule categories, the way the old eslint config leaned on `extends`:+// correctness -> error, suspicious + pedantic -> warn, everything else -> off.+// Only the deviations are spelled out below. Type-aware rules (the old tseslint+// `*TypeChecked` configs) come from `options.typeAware` + the `oxlint-tsgolint` dep.+//+// Still missing vs. the old eslint config: `@typescript-eslint/prefer-optional-chain`+// (oxlint nursery only). `react/jsx-no-leaked-render` is back as a JS plugin, see the+// last override.+{+ "$schema": "./node_modules/oxlint/configuration_schema.json",+ "plugins": [+ "react",+ "nextjs",+ "jsx-a11y",+ "import",+ "typescript",+ "unicorn",+ "oxc"+ ],+ "categories": {+ "correctness": "error",+ "suspicious": "warn",+ "pedantic": "warn"+ },+ "options": {+ "typeAware": true,+ // was `linterOptions.reportUnusedDisableDirectives` in eslint.config.mjs+ "reportUnusedDisableDirectives": "warn"+ },+ "env": { "builtin": true, "browser": true, "node": true },+ "settings": { "react": { "version": "19.2" } },+ "ignorePatterns": [+ ".next/**",+ "out/**",+ "build/**",+ "next-env.d.ts",+ "playwright-output/**",+ ".trigger/**"+ ],+ "rules": {+ "oxc/approx-constant": "error",+ "oxc/bad-bitwise-operator": "error",+ "oxc/bad-char-at-comparison": "error",+ "oxc/bad-comparison-sequence": "error",+ "oxc/bad-min-max-func": "error",+ "oxc/bad-object-literal-comparison": "error",+ "oxc/bad-replace-all-arg": "error",+ "oxc/const-comparisons": "error",+ "oxc/double-comparisons": "error",+ "oxc/misrefactored-assign-op": "error",+ "oxc/missing-throw": "error",+ "oxc/number-arg-out-of-range": "error",+ "oxc/uninvoked-array-callback": "error",+ // --- project rules, carried over from eslint.config.mjs ---+ "no-console": ["warn", { "allow": ["error", "info", "warn"] }],+ "no-restricted-imports": [+ "error",+ {+ "paths": [+ {+ "name": "@react-pdf/renderer",+ "message": "Please use **@react-pdf/renderer/lib/react-pdf.browser** instead. Check https://github.com/diegomura/react-pdf/issues/2890#issuecomment-2443831013 for more details."+ },+ { "name": "node:process", "message": "Please use @/env.ts instead." },+ { "name": "process", "message": "Please use @/env.ts instead." }+ ]+ }+ ],+ // `localStorage` is not safe to touch directly in the browsers we ship to: iOS+ // in-app webviews (Telegram, Instagram, Facebook) expose it as `null`, so an+ // unguarded `localStorage.getItem` throws `TypeError: null is not an object`, and+ // Safari with cookies blocked throws on the property access itself. The helpers in+ // `@/lib/safe-local-storage` return a value instead of throwing, which also stops a+ // failed read/write from skipping the code that follows it inside a `try` block.+ // Two rules because they see different syntax: `no-restricted-globals` catches the+ // bare `localStorage`, `no-restricted-properties` catches `window.localStorage`.+ "no-restricted-globals": [+ "error",+ {+ "name": "localStorage",+ "message": "Please use **getAppStorageItem / setAppStorageItem** from @/app/(app)/utils/app-local-storage instead - direct access throws in iOS in-app webviews and in Safari with cookies blocked, and those only accept a key declared in LOCAL_STORAGE_KEYS. To branch on availability during render, use **useIsLocalStorageAvailable** from @/lib/use-is-local-storage-available."+ }+ ],+ "no-restricted-properties": [+ "error",+ {+ "object": "window",+ "property": "localStorage",+ "message": "Please use **getAppStorageItem / setAppStorageItem** from @/app/(app)/utils/app-local-storage instead - direct access throws in iOS in-app webviews and in Safari with cookies blocked, and those only accept a key declared in LOCAL_STORAGE_KEYS. To branch on availability during render, use **useIsLocalStorageAvailable** from @/lib/use-is-local-storage-available."+ },+ {+ "object": "globalThis",+ "property": "localStorage",+ "message": "Please use **getAppStorageItem / setAppStorageItem** from @/app/(app)/utils/app-local-storage instead - direct access throws in iOS in-app webviews and in Safari with cookies blocked, and those only accept a key declared in LOCAL_STORAGE_KEYS. To branch on availability during render, use **useIsLocalStorageAvailable** from @/lib/use-is-local-storage-available."+ }+ ],+ "no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],+ // one import statement per module - `preferInline` folds a separate+ // `import type { X }` back into the value import as `{ type X }`, which is+ // the style `typescript/consistent-type-imports` below already enforces+ "import/no-duplicates": ["error", { "preferInline": true }],+ "no-var": "error",+ "no-useless-catch": "error",+ "prefer-const": "error",+ "typescript/no-explicit-any": "error",+ "typescript/no-empty-object-type": "error",+ "typescript/no-misused-promises": [+ "error",+ { "checksVoidReturn": { "attributes": false } }+ ],+ "typescript/consistent-type-imports": [+ "error",+ { "prefer": "type-imports", "fixStyle": "inline-type-imports" }+ ],+ // always use a block body for arrow functions+ "arrow-body-style": ["warn", "always"],+ // keep `return await` - it keeps the caller's frame on the async stack, so+ // failures carry a useful stack trace+ "typescript/return-await": ["warn", "always"],++ // --- rules the eslint config had that live outside the categories above ---+ "jsx-a11y/alt-text": ["warn", { "elements": ["img"], "img": ["Image"] }],+ "import/no-anonymous-default-export": "warn",+ "no-empty-function": "error",+ "prefer-rest-params": "error",+ "prefer-spread": "error",+ "react/unsupported-syntax": "warn",+ "typescript/adjacent-overload-signatures": "error",+ "typescript/ban-tslint-comment": "error",+ "typescript/class-literal-property-style": "error",+ "typescript/consistent-generic-constructors": "error",+ "typescript/consistent-type-assertions": "error",+ "typescript/dot-notation": "error",+ "typescript/no-inferrable-types": "error",+ "typescript/no-namespace": "error",+ "typescript/no-require-imports": "error",+ "typescript/prefer-find": "error",+ "typescript/prefer-for-of": "error",+ "typescript/prefer-function-type": "error",+ "typescript/prefer-regexp-exec": "error",+ "typescript/prefer-string-starts-ends-with": "error",+ "unicorn/catch-error-name": "error",+ "unicorn/consistent-empty-array-spread": "error",+ "unicorn/consistent-function-scoping": "error",+ "unicorn/no-abusive-eslint-disable": "error",+ "unicorn/no-hex-escape": "error",+ "unicorn/no-invalid-fetch-options": "error",+ "unicorn/no-magic-array-flat-depth": "error",+ "unicorn/no-typeof-undefined": "error",+ "unicorn/no-unnecessary-slice-end": "error",+ "unicorn/no-useless-promise-resolve-reject": "error",+ "unicorn/no-useless-spread": "error",+ "unicorn/numeric-separators-style": "error",+ "unicorn/prefer-array-flat-map": "error",+ "unicorn/prefer-array-index-of": "error",+ "unicorn/prefer-array-some": "error",+ "unicorn/prefer-at": "error",+ "unicorn/prefer-dom-node-append": "error",+ "unicorn/prefer-import-meta-properties": "error",+ "unicorn/prefer-native-coercion-functions": "error",+ "unicorn/prefer-node-protocol": "error",+ "unicorn/prefer-number-properties": "error",+ "unicorn/prefer-optional-catch-binding": "error",+ "unicorn/prefer-set-size": "error",+ "unicorn/prefer-single-call": "error",+ "unicorn/prefer-string-raw": "error",+ "unicorn/prefer-string-replace-all": "error",+ "unicorn/prefer-string-slice": "error",+ "unicorn/prefer-structured-clone": "error",+ "unicorn/prefer-top-level-await": "error",+ "unicorn/text-encoding-identifier-case": "error",++ // render props and next-intl `t.rich` chunk formatters are functions passed+ // as props, not components defined during render - that is what this option is for+ "react/no-unstable-nested-components": ["error", { "allowAsProps": true }],+ // our two iframes are a YouTube embed and the blob-url PDF preview; both need+ // scripts + same-origin, so a `sandbox` attribute would either be a no-op or+ // break rendering+ "react/iframe-missing-sandbox": "off",+ // we always spread into a new array before sorting/reversing, so nothing is+ // mutated; `toSorted`/`toReversed` are ES2023 and above our browser floor+ "unicorn/no-array-sort": "off",+ "unicorn/no-array-reverse": "off",++ // --- the react-hooks rules, at the severities next/core-web-vitals used ---+ "react/rules-of-hooks": "error",+ "react/exhaustive-deps": "warn",++ // --- opinions we don't share (none of these were enabled under eslint) ---+ "max-lines": "off",+ "max-lines-per-function": "off",+ "no-inline-comments": "off",+ "no-negated-condition": "off",+ "no-shadow": "off",+ "no-underscore-dangle": "off",+ "no-warning-comments": "off",+ "require-await": "off",+ "require-unicode-regexp": "off",+ "import/max-dependencies": "off",+ "import/no-unassigned-import": "off",+ "jsx-a11y/prefer-tag-over-role": "off",+ "nextjs/no-img-element": "off",+ "react/jsx-no-target-blank": "off",+ "react/jsx-no-useless-fragment": "off",+ "react/react-in-jsx-scope": "off",+ "unicorn/no-negated-condition": "off",+ "unicorn/no-useless-undefined": "off",+ "typescript/consistent-return": "off",+ "typescript/no-confusing-void-expression": "off",+ "typescript/no-unsafe-type-assertion": "off",+ "typescript/prefer-nullish-coalescing": "off",+ "typescript/prefer-readonly-parameter-types": "off",+ "typescript/require-await": "off",+ "typescript/strict-boolean-expressions": "off",+ "typescript/strict-void-return": "off",+ "typescript/unbound-method": "off",+ "typescript/no-useless-default-assignment": "off",++ // --- real findings we haven't worked through yet: keep them visible as+ // --- warnings instead of failing the build (mostly a11y + react-hooks v7)+ "jsx-a11y/click-events-have-key-events": "warn",+ "jsx-a11y/control-has-associated-label": "warn",+ "jsx-a11y/html-has-lang": "warn",+ "jsx-a11y/label-has-associated-control": "warn",+ "jsx-a11y/lang": "warn",+ "jsx-a11y/no-static-element-interactions": "warn",+ "jsx-a11y/role-has-required-aria-props": "warn",+ "import/namespace": "warn",+ "react/incompatible-library": "warn",+ "react/preserve-manual-memoization": "warn",+ "react/refs": "warn",+ "react/set-state-in-effect": "warn",+ "unicorn/no-new-array": "warn",+ "typescript/no-deprecated": "warn"+ },+ "overrides": [+ {+ // The one file allowed to touch `localStorage` directly: it is the wrapper the+ // `no-restricted-globals` / `no-restricted-properties` rules above point everyone+ // else at.+ "files": ["src/lib/safe-local-storage.ts"],+ "rules": {+ "no-restricted-globals": "off",+ "no-restricted-properties": "off"+ }+ },+ {+ // Config files are not in tsconfig, so every import comes back as `any`+ // and the type-aware rules just shout. eslint only ran tseslint on ts/tsx.+ "files": ["**/*.{js,cjs,mjs}"],+ "rules": {+ "typescript/no-unsafe-argument": "off",+ "typescript/no-unsafe-assignment": "off",+ "typescript/no-unsafe-call": "off",+ "typescript/no-unsafe-member-access": "off",+ "typescript/no-unsafe-return": "off",+ "typescript/restrict-template-expressions": "off"+ }+ },+ {+ // oxlint's `react/display-name` flags `React.memo(SomeImportedComponent)`,+ // which eslint-plugin-react does not. Our shadcn primitives re-export Radix+ // components that way, so the rule only produces noise here.+ "files": ["src/components/ui/**"],+ "rules": { "react/display-name": "off" }+ },+ {+ "files": ["src/**/*.ts", "src/**/*.tsx"],+ "jsPlugins": ["eslint-plugin-react-you-might-not-need-an-effect"],+ // JS plugin rules have to be listed one by one - oxlint cannot read an+ // eslint plugin's own `recommended` config. This is the plugin's full set.+ "rules": {+ "react-you-might-not-need-an-effect/no-adjust-state-on-prop-change": "warn",+ "react-you-might-not-need-an-effect/no-chain-state-updates": "warn",+ "react-you-might-not-need-an-effect/no-derived-state": "warn",+ "react-you-might-not-need-an-effect/no-event-handler": "warn",+ "react-you-might-not-need-an-effect/no-external-store-subscription": "warn",+ "react-you-might-not-need-an-effect/no-initialize-state": "warn",+ "react-you-might-not-need-an-effect/no-pass-data-to-parent": "warn",+ "react-you-might-not-need-an-effect/no-pass-live-state-to-parent": "warn",+ "react-you-might-not-need-an-effect/no-reset-all-state-on-prop-change": "warn"+ }+ },+ {+ "files": ["e2e/**"],+ "jsPlugins": ["eslint-plugin-playwright"],+ // `playwright/flat-recommended`, expanded (see the note above).+ "rules": {+ "no-empty-pattern": "off", // playwright fixtures destructure `{}`+ // `localStorage` inside `page.evaluate` runs in the browser under test, which+ // is exactly where we want to read what the app actually persisted+ "no-restricted-globals": "off",+ "no-restricted-properties": "off",+ "playwright/consistent-spacing-between-blocks": "warn",+ "playwright/expect-expect": "warn",+ "playwright/max-nested-describe": "warn",+ "playwright/missing-playwright-await": "error",+ "playwright/no-conditional-expect": "warn",+ "playwright/no-conditional-in-test": "warn",+ "playwright/no-duplicate-hooks": "warn",+ "playwright/no-duplicate-slow": "warn",+ "playwright/no-element-handle": "warn",+ "playwright/no-eval": "warn",+ "playwright/no-focused-test": "error",+ "playwright/no-force-option": "warn",+ "playwright/no-nested-step": "warn",+ "playwright/no-networkidle": "error",+ "playwright/no-page-pause": "warn",+ "playwright/no-skipped-test": "warn",+ "playwright/no-standalone-expect": "error",+ "playwright/no-unnecessary-assertions": "error",+ "playwright/no-unsafe-references": "error",+ "playwright/no-unused-locators": "error",+ "playwright/no-useless-await": "warn",+ "playwright/no-useless-not": "warn",+ "playwright/no-wait-for-navigation": "error",+ "playwright/no-wait-for-selector": "warn",+ "playwright/no-wait-for-timeout": "warn",+ "playwright/prefer-hooks-in-order": "warn",+ "playwright/prefer-hooks-on-top": "warn",+ "playwright/prefer-locator": "warn",+ "playwright/prefer-to-have-count": "warn",+ "playwright/prefer-to-have-length": "warn",+ "playwright/prefer-web-first-assertions": "error",+ "playwright/valid-describe-callback": "error",+ "playwright/valid-expect": "error",+ "playwright/valid-expect-in-promise": "error",+ "playwright/valid-test-tags": "error",+ "playwright/valid-title": "error"+ }+ },+ {+ // Vitest unit tests. `@vitest/eslint-plugin` is ported natively into+ // oxlint, so this needs no `jsPlugins` entry (and no extra dependency)+ // the way the playwright block above does.+ "files": ["src/**/*.test.ts", "src/**/*.test.tsx"],+ "plugins": ["vitest"],+ "rules": {+ // tests seed and assert on the real store, and stub it to simulate the+ // browsers the helper exists for+ "no-restricted-globals": "off",+ "no-restricted-properties": "off",+ // the categories at the top of this file now also pull in vitest's+ // correctness rules; this one wants an explicit type parameter on+ // every `vi.fn()` (68 call sites) - not a fight worth having.+ "vitest/require-mock-type-parameters": "off",+ // recommended set+ "vitest/expect-expect": [+ "error",+ {+ // some tests assert through local `assertX(...)` helpers+ // (e.g. `assertValidPdfBuffer`) rather than a bare `expect`.+ "assertFunctionNames": [+ "expect",+ "expectTypeOf",+ "assert",+ "assertType",+ "assert*"+ ]+ }+ ],+ "vitest/no-identical-title": "error",+ "vitest/no-commented-out-tests": "warn",+ "vitest/valid-describe-callback": "error",+ "vitest/valid-expect": "error",+ "vitest/valid-expect-in-promise": "error",+ "vitest/valid-title": "error",+ "vitest/require-local-test-context-for-concurrent-snapshots": "error",+ "vitest/no-import-node-test": "error",+ // things that silently skip or weaken a test in CI+ "vitest/no-focused-tests": "error",+ "vitest/no-standalone-expect": "error",+ // warn, not error: the tests lean on+ // `expect(result.success).toBe(true); if (result.success) { ... }` to+ // narrow zod `safeParse` results, which trips this and+ // `no-conditional-in-test`.+ "vitest/no-conditional-expect": "warn",+ "vitest/no-disabled-tests": "warn",+ "vitest/no-test-prefixes": "warn",+ "vitest/no-test-return-statement": "warn",+ "vitest/no-conditional-in-test": "warn",+ "vitest/no-duplicate-hooks": "warn",+ "vitest/no-interpolation-in-snapshots": "warn",+ "vitest/no-mocks-import": "warn",+ "vitest/require-to-throw-message": "warn",+ "vitest/max-nested-describe": "warn",+ // house style: `it(...)` everywhere, globals imported from "vitest"+ // (vitest.config.ts does not set `globals: true`)+ "vitest/consistent-test-it": [+ "warn",+ {+ "fn": "it"+ }+ ],+ "vitest/prefer-importing-vitest-globals": "error",+ // matcher / mock sharpening+ "vitest/no-alias-methods": "warn",+ "vitest/prefer-to-be": "warn",+ "vitest/prefer-to-be-object": "warn",+ // off on purpose: `toBe(true)`/`toBe(false)` is a stricter assertion+ // than `toBeTruthy()`/`toBeFalsy()`, and the tests use it deliberately.+ "vitest/prefer-to-be-truthy": "off",+ "vitest/prefer-to-be-falsy": "off",+ "vitest/prefer-to-contain": "warn",+ "vitest/prefer-to-have-length": "warn",+ "vitest/prefer-comparison-matcher": "warn",+ "vitest/prefer-equality-matcher": "warn",+ "vitest/prefer-called-with": "warn",+ "vitest/prefer-to-have-been-called-times": "warn",+ "vitest/prefer-mock-promise-shorthand": "warn",+ "vitest/prefer-spy-on": "warn",+ "vitest/prefer-each": "warn",+ "vitest/prefer-todo": "warn",+ "vitest/prefer-hooks-in-order": "warn",+ "vitest/prefer-hooks-on-top": "warn"+ }+ },+ {+ // `jsx-no-leaked-render` has no oxlint equivalent (see the header note),+ // so it comes from `eslint-plugin-react` as a JS plugin. It has to be+ // aliased - the bare plugin would claim the `react/` namespace that+ // oxlint's own react plugin already owns, and oxlint rejects that.+ "files": ["src/**/*.tsx"],+ "jsPlugins": [+ { "name": "eslint-react", "specifier": "eslint-plugin-react" }+ ],+ "rules": {+ // `{count && <X />}` renders a literal `0` when count is 0. Require the+ // explicit `{count ? <X /> : null}` form; "coerce" (`{!!count && ...}`)+ // is deliberately left out of `validStrategies`.+ "eslint-react/jsx-no-leaked-render": [+ "warn",+ { "validStrategies": ["ternary"] }+ ]+ }+ }+ ]+}diff --git a/.prettierignore b/.prettierignoredeleted file mode 100644index a149105..0000000--- a/.prettierignore+++ /dev/null@@ -1,4 +0,0 @@-# i18n-messages/en.d.json.ts--pnpm-lock.yaml\ No newline at end of filediff --git a/.prettierrc.js b/.prettierrc.jsdeleted file mode 100644index b6049d4..0000000--- a/.prettierrc.js+++ /dev/null@@ -1,17 +0,0 @@-/** @type {import('prettier').Config} */-/** @typedef {import("@ianvs/prettier-plugin-sort-imports").PluginConfig} SortImportsConfig*/--const config = {- trailingComma: "all",- singleQuote: false,- semi: true,- arrowParens: "always",- bracketSpacing: true,- endOfLine: "lf",- printWidth: 80,- tabWidth: 2,- useTabs: false,- plugins: [require.resolve("prettier-plugin-tailwindcss")],-};--module.exports = config;diff --git a/.vscode/extensions.json b/.vscode/extensions.jsonindex 1e3c05c..61fd88b 100644--- a/.vscode/extensions.json+++ b/.vscode/extensions.json@@ -1,5 +1,7 @@{"recommendations": [+ // oxlint + oxfmt language server (linting, quick fixes, format on save)+ "oxc.oxc-vscode","bradlc.vscode-tailwindcss","yoavbls.pretty-ts-errors","usernamehw.errorlens",diff --git a/.vscode/settings.json b/.vscode/settings.jsonindex 29f8790..7e138f7 100644--- a/.vscode/settings.json+++ b/.vscode/settings.json@@ -1,5 +1,13 @@{"css.validate": false,+ // oxfmt via the Oxc extension (`oxc.oxc-vscode`). The extension shells out to+ // the local `oxfmt` binary, so it picks up .oxfmtrc.json automatically.+ "editor.defaultFormatter": "oxc.oxc-vscode",+ "editor.formatOnSave": true,+ "oxc.lint.run": "onSave",+ "[json]": { "editor.defaultFormatter": "oxc.oxc-vscode" },+ "[jsonc]": { "editor.defaultFormatter": "oxc.oxc-vscode" },+ "[yaml]": { "editor.defaultFormatter": "oxc.oxc-vscode" },"editor.inlayHints.enabled": "on","typescript.inlayHints.parameterNames.enabled": "all","typescript.preferences.importModuleSpecifier": "non-relative",diff --git a/CLAUDE.md b/CLAUDE.mdnew file mode 100644index 0000000..9b6d71d--- /dev/null+++ b/CLAUDE.md@@ -0,0 +1,128 @@+# CLAUDE.md++This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.++## Project++EasyInvoicePDF — a free, browser-only invoice generator (Next.js App Router). Invoice data never leaves the browser: it lives in React state, is persisted to `localStorage`, and is rendered to PDF client-side with `@react-pdf/renderer`. The only server-side PDF path is the private `/api/generate-invoice` route the author uses for their own monthly invoice.++Package manager is **pnpm** (pinned via corepack). `save-exact=true` and a 5-day `minimum-release-age` are set in `.npmrc`, so add dependencies with exact versions.++## Working agreements++**Never commit and never stage.** Do not run `git commit`, `git add`, or `git stage` — not even when the task is finished and every check is green. Leave the work in the working tree and report what changed; the user reviews and shapes their own commits. Committing also fires the heavy husky pre-commit hook, which rewrites files via `oxfmt`.++**Follow the repo's own guidelines and skills.** Before writing code, load what applies:++- `.cursor/rules/*.mdc` — always-on coding, error-handling and testing conventions (summarized under [Conventions](#conventions), but read the source when in doubt).+- `.cursor/skills/trigger-*` — Trigger.dev playbooks (`trigger-authoring-tasks`, `trigger-getting-started`, `trigger-authoring-chat-agent`, `trigger-cost-savings`); required reading before touching anything in `src/trigger/` or `trigger.config.ts`.+- `.agents/skills/` — task-scoped playbooks, vendored by the `skills-lock.json` sync tool. The ones that come up most here: `vercel-react-best-practices` and `vercel-composition-patterns` (React/Next work), `frontend-design`, `make-interfaces-feel-better`, `emil-design-eng` and `web-design-guidelines` (UI), `changelog-maintenance` (changelog entries), `writing-guidelines` (docs and prose), the `seo-*` skills (landing pages and metadata).++Claude Code only discovers skills under `.claude/skills/`, so both directories are symlinked into it — that is what makes them invocable by name with the Skill tool. Re-run this after the sync tool adds a skill (idempotent; the CLI follows symlinked skill dirs):++```bash+mkdir -p .claude/skills && for src in .agents/skills .cursor/skills; do for d in "$src"/*/; do s=$(basename "$d"); [ -f "$d/SKILL.md" ] && ln -sfn "../../$src/$s" ".claude/skills/$s"; done; done+```++## Commands++```bash+pnpm dev # next dev --turbopack, port 3000+pnpm build # never run while a dev server is up (shared .next)+pnpm type-check # next typegen + tsc --noEmit+pnpm type-check:fast # oxlint --type-check (faster, tsgolint)+pnpm lint # oxlint --type-aware (replaces eslint)+pnpm format # oxfmt (replaces prettier)+pnpm knip # unused files/exports/deps+pnpm vitest --run # unit tests, dir is ./src+pnpm e2e # Playwright, needs a server on BASE_URL (default localhost:3000)+```++Single tests:++```bash+pnpm vitest --run src/utils/__tests__/url-compression.test.ts -t "round trips"+```++```bash+pnpm e2e e2e/invoice-form.test.ts --project="Desktop Chrome" -g "adds an item"+```++**Run as few e2e tests as possible.** The full suite is slow (CI budgets 50 minutes across four browser projects) and most of that time is spent generating and rasterizing PDFs. Always narrow to the file you touched, and add `--project="Desktop Chrome"` plus `-g "<test name>"` on top of it. Run the whole suite only when a change is broad enough to warrant it, or when the user asks.++The pre-commit hook (`lint-staged.config.js`) runs `type-check:fast`, `lint`, `zizmor`, `knip`, `vitest --run` and `format` on _any_ staged change, so keep all of those green.++`SKIP_ENV_VALIDATION=true` is only for `type-check`/`lint` in CI — never set it for `next dev` or `next build`; `next.config.mjs` imports `src/env.ts` on purpose so a missing env var fails the build.++## Architecture++### Invoice data flow++`src/app/schema/index.ts` (~1450 lines) is the single source of truth: zod schemas plus every supported currency, language, date format and template, and the `localStorage` key constants. Everything downstream (form, PDF templates, share links, API route) derives its types from it.++1. `src/app/(app)/page.client.tsx` owns `invoiceDataState`. On mount it hydrates from `?data=` (shared link) or `localStorage`, validating with `invoiceSchema`.+2. `src/app/(app)/components/invoice-form/` is a `react-hook-form` form resolved against `invoiceSchema`. Changes are debounced (`DEBOUNCE_TIMEOUT = 500ms`) before being pushed up and written to `localStorage` — e2e helpers wait on this debounce.+3. `InvoicePdfInstanceProvider` (`src/app/(app)/contexts/invoice-pdf-instance-context.tsx`) renders the PDF **once** via `usePDF` and shares the blob/URL with the desktop preview, the mobile viewer and the download link. Do not add a second `usePDF`/`<PDFViewer>`/`<BlobProvider>` on the page — react-pdf's module-level listener registry makes every instance re-render on any commit (flicker + duplicate work).+4. Sharing: `src/utils/url-compression.ts` remaps long JSON keys to one-character keys, then `lz-string` encodes it into `?data=`. Adding a schema field means adding it to `INVOICE_KEY_COMPRESSION_MAP` (the map is type-checked against the schema keys).++Use `zodResolverForOutput` (`src/lib/zod-resolver-for-output.ts`) instead of `zodResolver` — form state is typed on the schema's _output_ type.++### PDF templates++Two templates under `src/app/(app)/components/invoice-templates/`: `invoice-pdf-default-template/` and `invoice-pdf-stripe-template/`, selected by `invoiceData.template`. A change to one usually needs the mirrored change in the other, plus new snapshots.++- Always import from `@react-pdf/renderer/lib/react-pdf.browser`, never `@react-pdf/renderer` (lint-enforced).+- Fonts are self-hosted and registered per template via `INVOICE_PDF_FONTS` in `src/config.ts`; `src` must stay an absolute URL.+- `@react-pdf/renderer` and `react-pdf` versions are pinned deliberately — see the memory notes and `pnpm-workspace.yaml` before touching them.++### fontkit patch (do not remove)++`patches/[email protected]` fixes dropped leading characters in generated PDFs (`"Cobrar de"` → `"obrar de"`). The version is baked into the patch filename, so **bumping fontkit silently drops the fix**. `patches/README.md` has the full root cause, and `src/app/(app)/components/invoice-templates/__tests__/fontkit-glyph-cache-patch.test.ts` fails if the patch is not actually applied to the resolved copy.++### i18n — two separate systems++- **UI/marketing copy**: `next-intl`, messages in `messages/*.json`, locale-prefixed routes under `src/app/[locale]/` (`src/middleware.ts` matches only those). The locale matcher is a static literal — keep it in sync with `SUPPORTED_LANGUAGES`.+- **PDF content**: a hand-rolled catalog, `src/app/(app)/pdf-i18n-translations/pdf-translations.ts`, validated against `pdf-translations-schema.ts`. Some entries are functions (e.g. `vatAmount({ customTaxLabel })`) so tax labels can be customized per invoice.++`next.config.mjs` validates both — every `messages/*.json` against `src/app/schema/i18n-schema.ts` and the PDF catalog against its schema — and `process.exit(1)`s on failure, so a missing translation key breaks `dev` and `build`.++### Routing groups++- `src/app/(app)/` — the invoice generator itself, served at `/`.+- `src/app/(seo-landings)/` — data-driven landing pages; content lives in `seo-landing-definitions.ts` and pages are built by `seo-landing-route.tsx`. Add a slug to `SEO_LANDING_SLUGS` plus a directory, don't hand-write the page.+- `src/app/[locale]/` — the localized `/about` page and catch-all.+- `src/app/changelog/` — MDX posts in `content/`, rendered via `@next/mdx`.+- `src/app/api/generate-invoice/` — Bearer-token + Upstash rate-limited route that renders a PDF server-side, emails it (Resend) and uploads it to Google Drive. Scheduled by the Trigger.dev task in `src/trigger/monthly-recurring-invoice.ts`.++## Testing++- Unit tests (vitest) live in `__tests__/` folders next to the code, `dir: ./src`. Node is the default environment; DOM tests opt in with a `// @vitest-environment happy-dom` first line.+- E2E (Playwright) is in `e2e/`. There is **no `webServer`** — start `pnpm dev` (or point `BASE_URL` at a deployment) first.+- PDF assertions download the file and rasterize it with `pdfjs-dist` (`e2e/utils/render-pdf-on-canvas.ts`, `e2e/utils/pdf-download.ts`); snapshots are compared only on the Desktop Chrome project and were generated on macOS, which is why CI uses `macos-14`. Timezone is forced to `Europe/Warsaw` everywhere.+- Import `test` from `e2e/utils/extended-playwright-test.ts` (gives a per-test `downloadDir` fixture); it must stay exported under the name `test` for the Playwright lint plugin.+- If e2e is flaky locally, use `pnpm e2e:not-flaky` (2 workers).+- Prefer a unit test over an e2e test whenever the behaviour can be covered in `src/` — e2e runs are expensive, see [Commands](#commands).++## Conventions++From `.cursor/rules/` (all apply here):++- TypeScript everywhere; prefer interfaces over type aliases; no enums (`as const` objects); no classes; `function` keyword for pure functions.+- Named exports for components; lowercase-dashed directory names; file order: exported component, subcomponents, helpers, static content, types.+- Prefer ternaries over `&&` in JSX. Minimize `use client`, `useEffect`, `setState` — but note the app shell is inherently client-heavy because the PDF renders in the browser.+- Model expected errors as return values, use guard clauses, zod for all validation.+- `console.log` is lint-banned (`console.error/info/warn` allowed); `process`/`node:process` imports are banned — use `@/env`.+- Reference material and known upstream bugs are collected in `KNOWLEDGE-BASE.md`.++Beyond `.cursor/rules/`:++- **Take a single object argument, not positional ones.** Any function with more than one parameter destructures an object:++ ```ts+ // yes+ formatDateWithLocale({ date, selectedDateFormat, language });+ // no+ formatDateWithLocale(date, selectedDateFormat, language);+ ```++ Call sites say what each value means without opening the signature, two same-typed parameters can't be swapped by accident, and adding a parameter doesn't touch every caller. Type the object as a named `interface` above the function and document each field with a doc comment on the property rather than `@param` tags — see `src/app/(app)/utils/format-date-with-locale.ts`. One-parameter functions stay positional.diff --git a/KNOWLEDGE-BASE.md b/KNOWLEDGE-BASE.mdindex b37764c..ef3c2a3 100644--- a/KNOWLEDGE-BASE.md+++ b/KNOWLEDGE-BASE.md@@ -5,6 +5,7 @@ useful stuff:react-pdf/renderer quirks:- https://github.com/diegomura/react-pdf/issues/774#issuecomment-560069810 (Preventing other elements from crashing into a fixed footer)+- PDFs used to lose the first character of labels ("Cobrar de" -> "obrar de"), mostly in PT/ES, cleared by a page reload. It is a fontkit bug, not a react-pdf one: rendering an accented (composite) glyph caches its base letter without codePoints, and the font object is shared across every render on the page. Upstream: https://github.com/foliojs/fontkit/issues/154 (open since 2018). Fixed locally by `patches/[email protected]` - see `patches/README.md` before touching or upgrading fontkit.react-pdf quirks (non-desktop pdf viewer):@@ -12,6 +13,7 @@ react-pdf quirks (non-desktop pdf viewer):issues to follow:+- https://github.com/foliojs/fontkit/issues/154 (glyph cache drops codePoints - we carry `patches/[email protected]` until this ships)- https://github.com/microsoft/playwright/issues/13873- https://github.com/microsoft/playwright/issues/19253- https://github.com/wojtekmaj/react-pdf/issues/2026diff --git a/css.d.ts b/css.d.tsnew file mode 100644index 0000000..9d15209--- /dev/null+++ b/css.d.ts@@ -0,0 +1,5 @@+// TypeScript 6 reports TS2882 for side-effect imports of modules that carry no+// type declarations. Next.js ships declarations for `*.module.css` but not for+// plain global stylesheets, which we import in `src/app/layout.tsx` (our own+// `globals.css` plus react-pdf's annotation/text layer styles).+declare module "*.css";diff --git a/e2e/about.test.ts b/e2e/about.test.tsindex 78001ed..211306f 100644--- a/e2e/about.test.ts+++ b/e2e/about.test.ts@@ -1,9 +1,11 @@/* eslint-disable playwright/no-conditional-expect *//* eslint-disable playwright/no-conditional-in-test */-import { GITHUB_URL, TWITTER_URL, VIDEO_DEMO_FALLBACK_IMG } from "@/config";-import { LANGUAGE_TO_NATIVE_LABEL, SUPPORTED_LANGUAGES } from "@/app/schema";+import { expect, test } from "@playwright/test";+import { LANGUAGE_TO_NATIVE_LABEL, SUPPORTED_LANGUAGES } from "@/app/schema";+import { GITHUB_URL, TWITTER_URL, VIDEO_DEMO_FALLBACK_IMG } from "@/config";+test.describe("About page", () => {test("should display about page content in English", async ({page,@@ -83,8 +85,17 @@ test.describe("About page", () => {await expect(goToAppButton).toBeVisible();await expect(goToAppButton).toHaveAttribute("href", "/?template=default");+ // The about page streams behind a `loading.tsx` Suspense boundary. While+ // React reveals the boundary, the streamed copy of the content is still+ // sitting in the `<div hidden>` it arrived in, so a bare `#hero` /+ // `#features` / `#faq` briefly matches two elements and trips strict mode.+ // Every section below is therefore looked up under the `main` role (a+ // hidden subtree is not part of the accessibility tree) and filtered to+ // the visible match, so the streamed copy is never the one we assert on.+ const main = page.getByRole("main");+// Check Hero section- const heroSection = page.locator("#hero");+ const heroSection = main.locator("#hero").filter({ visible: true });await expect(heroSection).toBeVisible();await expect(@@ -105,13 +116,12 @@ test.describe("About page", () => {await expect(video).toBeVisible();await expect(video).toHaveAttribute("poster", VIDEO_DEMO_FALLBACK_IMG);- await expect(video).toHaveAttribute("muted");await expect(video).toHaveAttribute("loop");await expect(video).toHaveAttribute("playsinline");await expect(video).toHaveAttribute("preload", "none");// Check Features section- const featuresSection = page.locator("#features");+ const featuresSection = main.locator("#features").filter({ visible: true });await expect(featuresSection).toBeVisible();await expect(@@ -129,7 +139,7 @@ test.describe("About page", () => {).toBeVisible();// check FAQ section- const faqSection = page.locator("#faq");+ const faqSection = main.locator("#faq").filter({ visible: true });await expect(faqSection).toBeVisible();await expect(@@ -274,8 +284,10 @@ test.describe("About page", () => {});await expect(goToAppButton).toBeVisible();+ const main = page.getByRole("main");+// Check Hero section in French- const heroSection = page.locator("#hero");+ const heroSection = main.locator("#hero").filter({ visible: true });await expect(heroSection).toBeVisible();await expect(@@ -293,7 +305,7 @@ test.describe("About page", () => {).toBeVisible();// Check Features section in French- const featuresSection = page.locator("#features");+ const featuresSection = main.locator("#features").filter({ visible: true });await expect(featuresSection).toBeVisible();await expect(@@ -360,8 +372,10 @@ test.describe("About page", () => {});await expect(goToAppButton).toBeVisible();+ const main = page.getByRole("main");+// Check Hero section in German- const heroSection = page.locator("#hero");+ const heroSection = main.locator("#hero").filter({ visible: true });await expect(heroSection).toBeVisible();await expect(@@ -379,7 +393,7 @@ test.describe("About page", () => {).toBeVisible();// Check Features section in German- const featuresSection = page.locator("#features");+ const featuresSection = main.locator("#features").filter({ visible: true });await expect(featuresSection).toBeVisible();await expect(diff --git a/e2e/api-routes.test.ts b/e2e/api-routes.test.tsnew file mode 100644index 0000000..8b323f6--- /dev/null+++ b/e2e/api-routes.test.ts@@ -0,0 +1,49 @@+import { expect, test } from "@playwright/test";++/**+ * `GET /api/generate-invoice` generates the monthly invoice, emails it and uploads+ * it to Google Drive, so it is guarded by a bearer token. We only test the+ * **rejected** paths here — the happy path has real side effects (emails, uploads)+ * and is covered by unit tests instead.+ */+test.describe("Generate invoice API route", () => {+ // this is a plain HTTP test, no need to run it once per browser project+ test.beforeEach(({}, testInfo) => {+ // eslint-disable-next-line playwright/no-skipped-test -- HTTP only test, Desktop Chrome only+ test.skip(+ testInfo.project.name !== "Desktop Chrome",+ "API route test does not depend on the browser",+ );+ });++ test("responds with 401 when the Authorization header is missing", async ({+ request,+ }) => {+ const response = await request.get("/api/generate-invoice");++ expect(response.status()).toBe(401);+ expect(await response.text()).toBe("Unauthorized");+ });++ test("responds with 401 when the bearer token is wrong", async ({+ request,+ }) => {+ const response = await request.get("/api/generate-invoice", {+ headers: { Authorization: "Bearer definitely-not-the-auth-token" },+ });++ expect(response.status()).toBe(401);+ expect(await response.text()).toBe("Unauthorized");+ });++ test("responds with 401 for a non-bearer Authorization header", async ({+ request,+ }) => {+ const response = await request.get("/api/generate-invoice", {+ headers: { Authorization: "Basic dXNlcjpwYXNz" },+ });++ expect(response.status()).toBe(401);+ expect(await response.text()).toBe("Unauthorized");+ });+});diff --git a/e2e/buyer.test.ts b/e2e/buyer.test.tsdeleted file mode 100644index ca523bc..0000000--- a/e2e/buyer.test.ts+++ /dev/null@@ -1,1104 +0,0 @@-import { DEFAULT_BUYER_DATA } from "@/app/constants";-import { type BuyerData } from "@/app/schema";-import { expect, test } from "@playwright/test";--test.describe("Buyer management", () => {- test.beforeEach(async ({ page }) => {- await page.goto("/?template=default");- await expect(page).toHaveURL("/?template=default");- });-- test("create/edit buyer", async ({ page }) => {- // Open buyer management dialog- await page.getByRole("button", { name: "New Buyer" }).click();-- // Fill in all buyer details- const TEST_BUYER_DATA = {- name: "New Test Client",- address: "456 Client Avenue\nClient City, 54321\nClient Country",-- vatNoFieldIsVisible: true,- vatNo: "987654321",- vatNoLabelText: "Tax Number",-- email: "[email protected]",- emailFieldIsVisible: true,-- notesFieldIsVisible: true,- notes: "This is a test note",- } as const satisfies BuyerData;-- /*- * TEST BUYER MANAGEMENT DIALOG FORM- */- const manageBuyerDialog = page.getByTestId(`manage-buyer-dialog`);-- // Verify "Pre-fill with values from the current invoice form" switch is visible- const prefillSwitch = manageBuyerDialog.getByRole("switch", {- name: `Pre-fill with values from the current invoice form`,- });- await expect(prefillSwitch).toBeVisible();- await expect(prefillSwitch).not.toBeChecked();-- // Verify the label is visible- await expect(- manageBuyerDialog.getByLabel(- "Pre-fill with values from the current invoice form",- ),- ).toBeVisible();-- // Fill in form fields- await manageBuyerDialog- .getByRole("textbox", { name: "Name" })- .fill(TEST_BUYER_DATA.name);- await manageBuyerDialog- .getByRole("textbox", { name: "Address" })- .fill(TEST_BUYER_DATA.address);-- // Fill TAX Number fieldset (Label and Value)- const vatNumberFieldset = manageBuyerDialog.getByRole("group", {- name: "Buyer Tax Number",- });-- await vatNumberFieldset- .getByRole("textbox", { name: "Label" })- .fill(TEST_BUYER_DATA.vatNoLabelText);-- await vatNumberFieldset- .getByRole("textbox", { name: "Value" })- .fill(TEST_BUYER_DATA.vatNo);-- await manageBuyerDialog- .getByRole("textbox", { name: "Email" })- .fill(TEST_BUYER_DATA.email);-- const emailSwitchInDialogForm = manageBuyerDialog.getByRole("switch", {- name: `Show the 'Email' field in the PDF`,- });-- // Verify Email visibility switch is checked by default- await expect(emailSwitchInDialogForm).toBeChecked();-- // Toggle Email visibility switch- await emailSwitchInDialogForm.click();-- await expect(emailSwitchInDialogForm).not.toBeChecked();-- const taxNumberSwitchInDialogForm = manageBuyerDialog.getByRole("switch", {- name: `Show the 'Tax Number' field in the PDF`,- });-- // Verify VAT visibility switch is checked by default- await expect(taxNumberSwitchInDialogForm).toBeChecked();-- // Toggle VAT visibility switch- await taxNumberSwitchInDialogForm.click();-- await expect(taxNumberSwitchInDialogForm).not.toBeChecked();-- // Fill in notes field- await manageBuyerDialog- .getByRole("textbox", { name: "Notes" })- .fill(TEST_BUYER_DATA.notes);-- const notesSwitchInDialogForm = manageBuyerDialog.getByRole("switch", {- name: `Show the 'Notes' field in the PDF`,- });-- // Verify notes visibility switch is CHECKED by default- await expect(notesSwitchInDialogForm).toBeChecked();-- // Verify "Apply to Current Invoice" switch is checked by default- await expect(- manageBuyerDialog.getByRole("switch", {- name: "Apply to Current Invoice",- }),- ).toBeChecked();-- // Cancel button is shown- await expect(- manageBuyerDialog.getByRole("button", { name: "Cancel" }),- ).toBeVisible();-- // Save buyer- await manageBuyerDialog.getByRole("button", { name: "Save Buyer" }).click();-- // Verify success toast message is visible- await expect(- page.getByText("Buyer added and applied to invoice", { exact: true }),- ).toBeVisible();-- // Verify buyer data is actually saved in localStorage- const storedData = (await page.evaluate(() => {- return localStorage.getItem("EASY_INVOICE_PDF_BUYERS");- })) as string;- expect(storedData).toBeTruthy();-- const parsedData = JSON.parse(storedData) as BuyerData[];-- expect(parsedData[0]).toMatchObject({- name: TEST_BUYER_DATA.name,- address: TEST_BUYER_DATA.address,-- vatNo: TEST_BUYER_DATA.vatNo,- vatNoLabelText: TEST_BUYER_DATA.vatNoLabelText,- vatNoFieldIsVisible: false,-- email: TEST_BUYER_DATA.email,- emailFieldIsVisible: false,-- notes: TEST_BUYER_DATA.notes,- notesFieldIsVisible: true,- } satisfies BuyerData);-- /*- * TEST SAVED DETAILS IN INVOICE FORM AFTER SAVING BUYER- */-- // Verify all saved details in the Buyer Information section form- const buyerForm = page.getByTestId(`buyer-information-section`);-- // Verify the locked banner is visible with correct text- const buyerLockedBanner = buyerForm.getByTestId("buyer-locked-banner");- await expect(buyerLockedBanner).toBeVisible();- await expect(buyerLockedBanner).toContainText(- "To modify buyer details, click the Edit buyer button (pencil icon) next to the dropdown above.",- );-- const nameInput = buyerForm.getByRole("textbox", {- name: "Name (Required)",- });-- // Buyer Name- await expect(nameInput).toHaveValue(TEST_BUYER_DATA.name);-- // Buyer Address- await expect(- buyerForm.getByRole("textbox", { name: "Address (Required)" }),- ).toHaveValue(TEST_BUYER_DATA.address);-- // Buyer VAT Number- const buyerVatFieldset = buyerForm.getByRole("group", {- name: "Buyer Tax Number",- });-- await expect(- buyerVatFieldset.getByRole("textbox", { name: "Label" }),- ).toHaveValue(TEST_BUYER_DATA.vatNoLabelText);-- await expect(- buyerVatFieldset.getByRole("textbox", { name: "Value" }),- ).toHaveValue(TEST_BUYER_DATA.vatNo);-- const vatNumberSwitchNotInDialog = buyerForm.getByTestId(- `buyerVatNoFieldIsVisible`,- );- // Verify VAT Number switch is not checked as we toggled it off- await expect(vatNumberSwitchNotInDialog).not.toBeChecked();- await expect(vatNumberSwitchNotInDialog).toBeDisabled();-- // Buyer Email- await expect(buyerForm.getByRole("textbox", { name: "Email" })).toHaveValue(- TEST_BUYER_DATA.email,- );-- const emailSwitchNotInDialog = buyerForm.getByRole("switch", {- name: `Show the 'Email' field in the PDF`,- });- // Verify Email switch is not checked as we toggled it off- await expect(emailSwitchNotInDialog).not.toBeChecked();- await expect(emailSwitchNotInDialog).toBeDisabled();-- // Buyer Notes- await expect(buyerForm.getByRole("textbox", { name: "Notes" })).toHaveValue(- TEST_BUYER_DATA.notes,- );-- const notesSwitchNotInDialog = buyerForm.getByTestId(- `buyerNotesInvoiceFormFieldVisibilitySwitch`,- );- await expect(notesSwitchNotInDialog).toBeChecked();- await expect(notesSwitchNotInDialog).toBeDisabled();-- // Verify the buyer is selected in dropdown- await expect(- buyerForm- .getByRole("combobox", { name: "Select Buyer" })- .locator("option:checked"),- ).toHaveText(TEST_BUYER_DATA.name);-- /*- * TEST EDIT FUNCTIONALITY IN BUYER MANAGEMENT DIALOG- */-- await buyerForm.getByRole("button", { name: "Edit buyer" }).click();-- // Verify all fields are populated in edit dialog- await expect(- manageBuyerDialog.getByRole("textbox", { name: "Name" }),- ).toHaveValue(TEST_BUYER_DATA.name);- await expect(- manageBuyerDialog.getByRole("textbox", { name: "Address" }),- ).toHaveValue(TEST_BUYER_DATA.address);-- await expect(- manageBuyerDialog- .getByRole("group", { name: "Buyer Tax Number" })- .getByRole("textbox", { name: "Label" }),- ).toHaveValue(TEST_BUYER_DATA.vatNoLabelText);-- await expect(- manageBuyerDialog- .getByRole("group", { name: "Buyer Tax Number" })- .getByRole("textbox", { name: "Value" }),- ).toHaveValue(TEST_BUYER_DATA.vatNo);-- await expect(- manageBuyerDialog.getByRole("textbox", { name: "Email" }),- ).toHaveValue(TEST_BUYER_DATA.email);-- // Verify email visibility switch state persisted in edit dialog- await expect(emailSwitchInDialogForm).not.toBeChecked();-- // Verify visibility switch state persisted in edit dialog- await expect(taxNumberSwitchInDialogForm).not.toBeChecked();-- // Verify notes text- await expect(- manageBuyerDialog.getByRole("textbox", { name: "Notes" }),- ).toHaveValue(TEST_BUYER_DATA.notes);-- // Verify notes visibility switch is checked-- await expect(notesSwitchInDialogForm).toHaveRole("switch");- await expect(notesSwitchInDialogForm).toHaveAccessibleName(- `Show the 'Notes' field in the PDF`,- );-- await expect(notesSwitchInDialogForm).toBeChecked();- await expect(notesSwitchInDialogForm).toBeEnabled();-- // Update some data in edit mode- const updatedName = "Updated Client Corp";-- await manageBuyerDialog- .getByRole("textbox", { name: "Name" })- .fill(updatedName);-- // Re-enable Email visibility- await emailSwitchInDialogForm.click();-- // Re-enable VAT visibility- await taxNumberSwitchInDialogForm.click();-- // Uncheck notes visibility switch in edit dialog- await notesSwitchInDialogForm.click();-- // Save updated buyer- await manageBuyerDialog.getByRole("button", { name: "Save Buyer" }).click();-- // Verify success toast for update- await expect(- page.getByText("Buyer updated successfully", { exact: true }),- ).toBeVisible();-- // Verify buyer is selected in dropdown- await expect(- buyerForm- .getByRole("combobox", { name: "Select Buyer" })- .locator("option:checked"),- ).toHaveText(updatedName);-- /*- * TEST UPDATED INFORMATION IN INVOICE FORM AFTER UPDATING BUYER IN DIALOG- */-- // Verify updated information is displayed- await expect(buyerForm.getByRole("textbox", { name: "Name" })).toHaveValue(- updatedName,- );-- // Verify Email visibility is now enabled- await expect(emailSwitchNotInDialog).toBeChecked();-- // Verify VAT visibility is now enabled- await expect(- buyerForm.getByTestId(`buyerVatNoFieldIsVisible`),- ).toBeChecked();-- // Verify notes visibility switch is unchecked- await expect(notesSwitchNotInDialog).not.toBeChecked();- });-- test("add buyer without applying to invoice", async ({ page }) => {- await page.getByRole("button", { name: "New Buyer" }).click();-- const TEST_BUYER_DATA = {- name: "Unapplied Test Client",- address: "99 Unapplied Avenue",- email: "[email protected]",- emailFieldIsVisible: true,-- vatNoFieldIsVisible: true,- vatNo: "VAT999",- vatNoLabelText: "Tax Number",-- notesFieldIsVisible: true,- notes: "",- } as const satisfies BuyerData;-- const manageBuyerDialog = page.getByTestId(`manage-buyer-dialog`);-- await manageBuyerDialog- .getByRole("textbox", { name: "Name" })- .fill(TEST_BUYER_DATA.name);- await manageBuyerDialog- .getByRole("textbox", { name: "Address" })- .fill(TEST_BUYER_DATA.address);- await manageBuyerDialog- .getByRole("textbox", { name: "Email" })- .fill(TEST_BUYER_DATA.email);-- // Uncheck "Apply to Current Invoice" switch- const applyToInvoiceSwitch = manageBuyerDialog.getByRole("switch", {- name: "Apply to Current Invoice",- });- await expect(applyToInvoiceSwitch).toBeChecked();- await applyToInvoiceSwitch.click();- await expect(applyToInvoiceSwitch).not.toBeChecked();-- await manageBuyerDialog.getByRole("button", { name: "Save Buyer" }).click();-- // Verify "Buyer added successfully" toast (NOT "applied to invoice")- await expect(- page.getByText("Buyer added successfully", { exact: true }),- ).toBeVisible();-- const buyerForm = page.getByTestId(`buyer-information-section`);-- // Verify buyer is not selected in dropdown- await expect(- buyerForm- .getByRole("combobox", { name: "Select Buyer" })- .locator("option:checked"),- ).toHaveText("No buyer selected (default)");-- // Buyer should appear in dropdown options but not be selected- await expect(- buyerForm.getByRole("combobox", { name: "Select Buyer" }),- ).toBeVisible();-- await expect(- buyerForm.getByRole("combobox", { name: "Select Buyer" }),- ).toHaveValue("");-- // Form fields should still contain default values (buyer was not applied)- await expect(buyerForm.getByRole("textbox", { name: "Name" })).toHaveValue(- DEFAULT_BUYER_DATA.name,- );- await expect(- buyerForm.getByRole("textbox", { name: "Address" }),- ).toHaveValue(DEFAULT_BUYER_DATA.address);- await expect(buyerForm.getByRole("textbox", { name: "Email" })).toHaveValue(- DEFAULT_BUYER_DATA.email,- );- });-- test("switch and restore buyer via dropdown", async ({ page }) => {- // Add a buyer with "Apply to Current Invoice" checked (default)- await page.getByRole("button", { name: "New Buyer" }).click();-- const TEST_BUYER_DATA = {- name: "Dropdown Test Client",- address: "42 Dropdown Boulevard",- email: "[email protected]",- emailFieldIsVisible: true,-- vatNoFieldIsVisible: true,- vatNo: "VAT-DROP-001",- vatNoLabelText: "Tax Number",-- notesFieldIsVisible: true,- notes: "",- } as const satisfies BuyerData;-- const manageBuyerDialog = page.getByTestId(`manage-buyer-dialog`);-- await manageBuyerDialog- .getByRole("textbox", { name: "Name" })- .fill(TEST_BUYER_DATA.name);- await manageBuyerDialog- .getByRole("textbox", { name: "Address" })- .fill(TEST_BUYER_DATA.address);- await manageBuyerDialog- .getByRole("textbox", { name: "Email" })- .fill(TEST_BUYER_DATA.email);-- await manageBuyerDialog.getByRole("button", { name: "Save Buyer" }).click();-- await expect(- page.getByText("Buyer added and applied to invoice", { exact: true }),- ).toBeVisible();-- const buyerForm = page.getByTestId(`buyer-information-section`);- const buyerDropdown = buyerForm.getByRole("combobox", {- name: "Select Buyer",- });-- // Buyer is currently selected in dropdown- await expect(buyerDropdown.locator("option:checked")).toHaveText(- TEST_BUYER_DATA.name,- );-- // Verify locked banner is visible when buyer is selected- await expect(buyerForm.getByTestId("buyer-locked-banner")).toBeVisible();-- // Restore to default by selecting the empty option- await buyerDropdown.selectOption("");-- // Verify "Buyer restored to default" toast- await expect(- page.getByText("Buyer restored to default", { exact: true }),- ).toBeVisible();-- // Verify buyer is not selected in dropdown- await expect(buyerDropdown.locator("option:checked")).toHaveText(- "No buyer selected (default)",- );-- // Verify locked banner is hidden after deselecting buyer- await expect(buyerForm.getByTestId("buyer-locked-banner")).toBeHidden();-- // Verify form reset to default values- await expect(buyerForm.getByRole("textbox", { name: "Name" })).toHaveValue(- DEFAULT_BUYER_DATA.name,- );- await expect(- buyerForm.getByRole("textbox", { name: "Address" }),- ).toHaveValue(DEFAULT_BUYER_DATA.address);- await expect(buyerForm.getByRole("textbox", { name: "Email" })).toHaveValue(- DEFAULT_BUYER_DATA.email,- );-- // Reselect the saved buyer from the dropdown- await buyerDropdown.selectOption({ label: TEST_BUYER_DATA.name });-- // Verify `Buyer "${name}" applied to invoice` toast- await expect(- page.getByText(`Buyer "${TEST_BUYER_DATA.name}" applied to invoice`, {- exact: true,- }),- ).toBeVisible();-- // Verify buyer is selected in dropdown- await expect(buyerDropdown.locator("option:checked")).toHaveText(- TEST_BUYER_DATA.name,- );-- // Verify locked banner is visible again after reselecting buyer- await expect(buyerForm.getByTestId("buyer-locked-banner")).toBeVisible();-- // Verify form fields are populated with the buyer's data- await expect(buyerForm.getByRole("textbox", { name: "Name" })).toHaveValue(- TEST_BUYER_DATA.name,- );- await expect(- buyerForm.getByRole("textbox", { name: "Address" }),- ).toHaveValue(TEST_BUYER_DATA.address);- await expect(buyerForm.getByRole("textbox", { name: "Email" })).toHaveValue(- TEST_BUYER_DATA.email,- );- });-- test("delete buyer", async ({ page }) => {- // First add a buyer- await page.getByRole("button", { name: "New Buyer" }).click();-- const testData = {- name: "Test Delete Buyer",- address: "456 Delete Avenue",- email: "[email protected]",- emailFieldIsVisible: true,-- vatNoFieldIsVisible: true,- vatNo: "123456789",- vatNoLabelText: "VAT Number",-- notesFieldIsVisible: true,- notes: "This is a test note",- } as const satisfies BuyerData;-- const manageBuyerDialog = page.getByTestId(`manage-buyer-dialog`);-- // Fill in basic buyer details- await manageBuyerDialog- .getByRole("textbox", { name: "Name" })- .fill(testData.name);- await manageBuyerDialog- .getByRole("textbox", { name: "Address" })- .fill(testData.address);- await manageBuyerDialog- .getByRole("textbox", { name: "Email" })- .fill(testData.email);-- // Save buyer- await manageBuyerDialog.getByRole("button", { name: "Save Buyer" }).click();-- // Verify buyer was added- const buyerForm = page.getByTestId(`buyer-information-section`);- await expect(- buyerForm.getByRole("combobox", { name: "Select Buyer" }),- ).toContainText(testData.name);-- // Click delete button- await buyerForm.getByRole("button", { name: "Delete buyer" }).click();-- // Verify delete confirmation dialog appears- await expect(page.getByRole("alertdialog")).toBeVisible();- await expect(- page.getByText(- `Are you sure you want to delete "${testData.name}" buyer?`,- ),- ).toBeVisible();-- // Cancel button is shown- await expect(page.getByRole("button", { name: "Cancel" })).toBeVisible();-- // Click cancel button- await page.getByRole("button", { name: "Cancel" }).click();-- // Verify dialog is closed- await expect(page.getByRole("alertdialog")).toBeHidden();-- // Click delete button once again to open the dialog- await buyerForm.getByRole("button", { name: "Delete buyer" }).click();-- // Verify delete confirmation dialog appears- await expect(page.getByRole("alertdialog")).toBeVisible();- await expect(- page.getByText(- `Are you sure you want to delete "${testData.name}" buyer?`,- ),- ).toBeVisible();-- // Confirm deletion- await page.getByRole("button", { name: "Delete" }).click();-- // Verify success message- await expect(- page.getByText("Buyer deleted successfully", { exact: true }),- ).toBeVisible();-- // Verify buyer is removed from dropdown- // because we have only one buyer, dropdown will be completely hidden- await expect(- buyerForm.getByRole("combobox", { name: "Select Buyer" }),- ).toBeHidden();-- // Verify "New Buyer" button is visible after deletion- const newBuyerButton = buyerForm.getByRole("button", { name: "New Buyer" });-- await expect(newBuyerButton).toBeVisible();- await expect(newBuyerButton).toBeEnabled();-- // Verify form is reset to default values- await expect(buyerForm.getByRole("textbox", { name: "Name" })).toHaveValue(- DEFAULT_BUYER_DATA.name,- );-- await expect(- buyerForm.getByRole("textbox", { name: "Address" }),- ).toHaveValue(DEFAULT_BUYER_DATA.address);-- await expect(buyerForm.getByRole("textbox", { name: "Email" })).toHaveValue(- DEFAULT_BUYER_DATA.email,- );-- await expect(- buyerForm- .getByRole("group", { name: "Buyer Tax Number" })- .getByRole("textbox", { name: "Value" }),- ).toHaveValue(DEFAULT_BUYER_DATA.vatNo);- });-- test("switches reset to defaults after dialog close and reopen", async ({- page,- }) => {- await page.getByRole("button", { name: "New Buyer" }).click();-- const manageBuyerDialog = page.getByTestId("manage-buyer-dialog");- const prefillSwitch = manageBuyerDialog.getByRole("switch", {- name: "Pre-fill with values from the current invoice form",- });- const applyToInvoiceSwitch = manageBuyerDialog.getByRole("switch", {- name: "Apply to Current Invoice",- });-- // Pre-fill switch defaults to off; toggle it on- await expect(prefillSwitch).not.toBeChecked();- await prefillSwitch.click();- await expect(prefillSwitch).toBeChecked();-- // "Apply to Current Invoice" switch defaults to on; toggle it off- await expect(applyToInvoiceSwitch).toBeChecked();- await applyToInvoiceSwitch.click();- await expect(applyToInvoiceSwitch).not.toBeChecked();-- // Close the dialog via Cancel- await manageBuyerDialog.getByRole("button", { name: "Cancel" }).click();- await expect(manageBuyerDialog).toBeHidden();-- // Reopen the dialog- await page.getByRole("button", { name: "New Buyer" }).click();- await expect(manageBuyerDialog).toBeVisible();-- // Both switches must have reset to their defaults and form must be empty- await expect(prefillSwitch).not.toBeChecked();- await expect(applyToInvoiceSwitch).toBeChecked();- await expect(- manageBuyerDialog.getByRole("textbox", { name: "Name" }),- ).toHaveValue("");- });-- test.describe("discard changes confirmation", () => {- test("clean form - Cancel closes without confirm", async ({ page }) => {- await page.getByRole("button", { name: "New Buyer" }).click();-- const manageBuyerDialog = page.getByTestId("manage-buyer-dialog");- await expect(manageBuyerDialog).toBeVisible();-- await manageBuyerDialog.getByRole("button", { name: "Cancel" }).click();-- await expect(manageBuyerDialog).toBeHidden();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeHidden();- });-- test("clean form - X button closes without confirm", async ({ page }) => {- await page.getByRole("button", { name: "New Buyer" }).click();-- const manageBuyerDialog = page.getByTestId("manage-buyer-dialog");- await expect(manageBuyerDialog).toBeVisible();-- await manageBuyerDialog.getByRole("button", { name: "Close" }).click();-- await expect(manageBuyerDialog).toBeHidden();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");-- await expect(confirmDialog).toBeHidden();- });-- test("dirty form - Cancel - accept discards changes and closes", async ({- page,- }) => {- await page.getByRole("button", { name: "New Buyer" }).click();-- const manageBuyerDialog = page.getByTestId("manage-buyer-dialog");- await manageBuyerDialog- .getByRole("textbox", { name: "Name" })- .fill("Unsaved Buyer");-- await manageBuyerDialog.getByRole("button", { name: "Cancel" }).click();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeVisible();-- await expect(- confirmDialog.getByText("Discard changes to buyer?"),- ).toBeVisible();-- await expect(- confirmDialog.getByText("You have unsaved changes. They will be lost."),- ).toBeVisible();-- await expect(- confirmDialog.getByRole("button", { name: "Keep editing" }),- ).toBeVisible();-- await confirmDialog- .getByRole("button", { name: "Discard changes" })- .click();-- await expect(confirmDialog).toBeHidden();- await expect(manageBuyerDialog).toBeHidden();- });-- test("dirty form - Cancel - dismiss keeps dialog open with values intact", async ({- page,- }) => {- await page.getByRole("button", { name: "New Buyer" }).click();-- const manageBuyerDialog = page.getByTestId("manage-buyer-dialog");- const nameInput = manageBuyerDialog.getByRole("textbox", {- name: "Name",- });- await nameInput.fill("Unsaved Buyer");-- await manageBuyerDialog.getByRole("button", { name: "Cancel" }).click();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeVisible();-- await confirmDialog.getByRole("button", { name: "Keep editing" }).click();-- await expect(confirmDialog).toBeHidden();-- await expect(manageBuyerDialog).toBeVisible();- await expect(nameInput).toHaveValue("Unsaved Buyer");- });-- test("dirty form - X button - accept discards changes and closes", async ({- page,- }) => {- await page.getByRole("button", { name: "New Buyer" }).click();-- const manageBuyerDialog = page.getByTestId("manage-buyer-dialog");- await manageBuyerDialog- .getByRole("textbox", { name: "Name" })- .fill("Unsaved Buyer");-- await manageBuyerDialog.getByRole("button", { name: "Close" }).click();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeVisible();-- await confirmDialog- .getByRole("button", { name: "Discard changes" })- .click();-- await expect(confirmDialog).toBeHidden();- await expect(manageBuyerDialog).toBeHidden();- });-- test("dirty form - Escape - accept discards changes and closes", async ({- page,- }) => {- await page.getByRole("button", { name: "New Buyer" }).click();-- const manageBuyerDialog = page.getByTestId("manage-buyer-dialog");- await manageBuyerDialog- .getByRole("textbox", { name: "Name" })- .fill("Unsaved Buyer");-- await page.keyboard.press("Escape");-- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeVisible();- await confirmDialog- .getByRole("button", { name: "Discard changes" })- .click();-- await expect(confirmDialog).toBeHidden();- await expect(manageBuyerDialog).toBeHidden();- });- });-- test.describe("pre-fill switch dirty guard", () => {- test("toggling switch ON with dirty form shows confirm dialog", async ({- page,- }) => {- await page.getByRole("button", { name: "New Buyer" }).click();-- // Dirty the form- const manageBuyerDialog = page.getByTestId("manage-buyer-dialog");- await manageBuyerDialog- .getByRole("textbox", { name: "Name" })- .fill("Draft Buyer");-- const prefillSwitch = manageBuyerDialog.getByRole("switch", {- name: "Pre-fill with values from the current invoice form",- });- await expect(prefillSwitch).not.toBeChecked();-- await prefillSwitch.click();-- // Verify confirm dialog is shown- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeVisible();-- // Switch has not changed yet — still OFF while dialog is open- await expect(- page.getByTestId("manage-buyer-dialog").getByRole("switch", {- name: "Pre-fill with values from the current invoice form",- includeHidden: true, // dialog is still open, but on one level deeper- }),- ).not.toBeChecked();-- // Dialog is still open- await expect(manageBuyerDialog).toBeVisible();- });-- test("toggling switch ON with dirty form - confirm applies pre-fill and clears draft", async ({- page,- }) => {- await page.getByRole("button", { name: "New Buyer" }).click();-- const manageBuyerDialog = page.getByTestId("manage-buyer-dialog");- const nameInput = manageBuyerDialog.getByRole("textbox", {- name: "Name",- });- await nameInput.fill("Draft Buyer");-- const prefillSwitch = manageBuyerDialog.getByRole("switch", {- name: "Pre-fill with values from the current invoice form",- });- await prefillSwitch.click();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeVisible();-- await confirmDialog- .getByRole("button", { name: "Discard changes" })- .click();-- await expect(confirmDialog).toBeHidden();-- // Switch is now ON- await expect(prefillSwitch).toBeChecked();-- // Dialog remains open (we only reset the form, not close the dialog)- await expect(manageBuyerDialog).toBeVisible();-- // Draft text is gone — form was reset with pre-fill values- await expect(nameInput).not.toHaveValue("Draft Buyer");- await expect(nameInput).toHaveValue(DEFAULT_BUYER_DATA.name);- });-- test("toggling switch ON with dirty form - Keep editing preserves draft and switch stays OFF", async ({- page,- }) => {- await page.getByRole("button", { name: "New Buyer" }).click();-- const manageBuyerDialog = page.getByTestId("manage-buyer-dialog");- const nameInput = manageBuyerDialog.getByRole("textbox", {- name: "Name",- });- await nameInput.fill("Draft Buyer");-- const prefillSwitch = manageBuyerDialog.getByRole("switch", {- name: "Pre-fill with values from the current invoice form",- });- await prefillSwitch.click();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeVisible();-- await confirmDialog.getByRole("button", { name: "Keep editing" }).click();-- await expect(confirmDialog).toBeHidden();-- // Switch remains OFF — the toggle was cancelled- await expect(prefillSwitch).not.toBeChecked();-- // Dialog still open with draft intact- await expect(manageBuyerDialog).toBeVisible();- await expect(nameInput).toHaveValue("Draft Buyer");- });-- test("toggling switch OFF (while ON + dirty) shows confirm dialog", async ({- page,- }) => {- await page.getByRole("button", { name: "New Buyer" }).click();-- const manageBuyerDialog = page.getByTestId("manage-buyer-dialog");- const prefillSwitch = manageBuyerDialog.getByRole("switch", {- name: "Pre-fill with values from the current invoice form",- });-- // Enable pre-fill while form is clean- await prefillSwitch.click();- await expect(prefillSwitch).toBeChecked();-- // Dirty the form- await manageBuyerDialog- .getByRole("textbox", { name: "Name" })- .fill("Edited after pre-fill");-- // Toggle switch OFF while dirty- await prefillSwitch.click();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeVisible();-- // Switch remains ON while dialog is open- await expect(- page.getByTestId("manage-buyer-dialog").getByRole("switch", {- name: "Pre-fill with values from the current invoice form",- includeHidden: true, // dialog is still open, but on one level deeper- }),- ).toBeChecked();- });-- test("toggling switch OFF with dirty form - confirm resets to empty form", async ({- page,- }) => {- await page.getByRole("button", { name: "New Buyer" }).click();-- const manageBuyerDialog = page.getByTestId("manage-buyer-dialog");- const prefillSwitch = manageBuyerDialog.getByRole("switch", {- name: "Pre-fill with values from the current invoice form",- });- const nameInput = manageBuyerDialog.getByRole("textbox", {- name: "Name",- });-- // Enable pre-fill while form is clean- await prefillSwitch.click();- await expect(prefillSwitch).toBeChecked();-- // Dirty the form- await nameInput.fill("Edited after pre-fill");-- // Toggle switch OFF while dirty- await prefillSwitch.click();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeVisible();-- await confirmDialog- .getByRole("button", { name: "Discard changes" })- .click();-- await expect(confirmDialog).toBeHidden();-- // Switch is now OFF- await expect(prefillSwitch).not.toBeChecked();-- // Dialog remains open- await expect(manageBuyerDialog).toBeVisible();-- // Form was reset to empty (no pre-fill values, no edited text)- await expect(nameInput).toHaveValue("");- });-- test("toggling switch OFF with dirty form - Keep editing preserves draft and switch stays ON", async ({- page,- }) => {- await page.getByRole("button", { name: "New Buyer" }).click();-- const manageBuyerDialog = page.getByTestId("manage-buyer-dialog");- const prefillSwitch = manageBuyerDialog.getByRole("switch", {- name: "Pre-fill with values from the current invoice form",- });- const nameInput = manageBuyerDialog.getByRole("textbox", {- name: "Name",- });-- // Enable pre-fill while form is clean- await prefillSwitch.click();- await expect(prefillSwitch).toBeChecked();-- // Dirty the form- await nameInput.fill("Edited after pre-fill");-- // Toggle switch OFF while dirty- await prefillSwitch.click();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeVisible();-- await confirmDialog.getByRole("button", { name: "Keep editing" }).click();-- await expect(confirmDialog).toBeHidden();-- // Switch remains ON- await expect(prefillSwitch).toBeChecked();-- // Dialog still open with draft intact- await expect(manageBuyerDialog).toBeVisible();- await expect(nameInput).toHaveValue("Edited after pre-fill");- });- });-- test("trims whitespace from name and other fields before saving", async ({- page,- }) => {- await page.getByRole("button", { name: "New Buyer" }).click();-- const manageBuyerDialog = page.getByTestId("manage-buyer-dialog");-- await manageBuyerDialog- .getByRole("textbox", { name: "Name" })- .fill(" Globex Corp ");- await manageBuyerDialog- .getByRole("textbox", { name: "Address" })- .fill(" 99 Client Ave ");- await manageBuyerDialog- .getByRole("textbox", { name: "Email" })- .fill(" [email protected] ");-- await manageBuyerDialog.getByRole("button", { name: "Save Buyer" }).click();-- await expect(- page.getByText("Buyer added and applied to invoice", { exact: true }),- ).toBeVisible();-- const storedData = (await page.evaluate(() =>- localStorage.getItem("EASY_INVOICE_PDF_BUYERS"),- )) as string;- const parsedData = JSON.parse(storedData) as BuyerData[];-- expect(parsedData).toHaveLength(1);- expect(parsedData[0].name).toBe("Globex Corp");- expect(parsedData[0].address).toBe("99 Client Ave");- expect(parsedData[0].email).toBe("[email protected]");- });-- test("rejects whitespace-padded name that duplicates an existing buyer", async ({- page,- }) => {- await page.addInitScript(() => {- const buyers = [- {- id: "existing-buyer-id",- name: "Globex Corp",- address: "1 Client Road",- email: "",- emailFieldIsVisible: true,- vatNo: "",- vatNoLabelText: "Tax Number",- vatNoFieldIsVisible: true,- notes: "",- notesFieldIsVisible: true,- },- ];- localStorage.setItem("EASY_INVOICE_PDF_BUYERS", JSON.stringify(buyers));- });-- await page.goto("/?template=default");- await expect(page).toHaveURL("/?template=default");-- await page.getByRole("button", { name: "New Buyer" }).click();-- const manageBuyerDialog = page.getByTestId("manage-buyer-dialog");-- await manageBuyerDialog- .getByRole("textbox", { name: "Name" })- .fill(" Globex Corp ");- await manageBuyerDialog- .getByRole("textbox", { name: "Address" })- .fill("2 Avenue");-- await manageBuyerDialog.getByRole("button", { name: "Save Buyer" }).click();-- await expect(- manageBuyerDialog.getByText("A buyer with this name already exists", {- exact: true,- }),- ).toBeVisible();-- // Dialog should remain open- await expect(manageBuyerDialog).toBeVisible();-- // Only the pre-seeded buyer should exist in localStorage- const storedData = (await page.evaluate(() =>- localStorage.getItem("EASY_INVOICE_PDF_BUYERS"),- )) as string;- const parsedData = JSON.parse(storedData) as BuyerData[];-- expect(parsedData).toHaveLength(1);- expect(parsedData[0].name).toBe("Globex Corp");- });-});diff --git a/e2e/default-invoice-template/default-invoice-template.test.ts b/e2e/default-invoice-template/default-invoice-template.test.tsindex 6c1676b..bd6d714 100644--- a/e2e/default-invoice-template/default-invoice-template.test.ts+++ b/e2e/default-invoice-template/default-invoice-template.test.ts@@ -1,15 +1,15 @@-import { INITIAL_INVOICE_DATA } from "@/app/constants";import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";-import fs from "node:fs";-import path from "node:path";-import { uploadLogoFile } from "../stripe-invoice-template/utils";+import { INITIAL_INVOICE_DATA } from "@/app/constants";+import { uploadLogoFile } from "../stripe-invoice-template/utils";// IMPORTANT: we use custom extended test fixture that provides a temporary download directory for each testimport { test, expect } from "../utils/extended-playwright-test";import {- renderPdfOnCanvas,- renderMultiPagePdfOnCanvas,-} from "../utils/render-pdf-on-canvas";+ expectPdfScreenshot,+ fillDebugNotes,+ getDownloadPdfLink,+ waitForPdfRegeneration,+} from "../utils/pdf-download";test.describe("Default Invoice Template", () => {test.beforeEach(async ({ page }) => {@@ -20,126 +20,27 @@ test.describe("Default Invoice Template", () => {await expect(page).toHaveURL("/?template=default");});- test("downloads PDF in English and verifies content", async ({- page,- browserName,- downloadDir,- }) => {- const downloadPdfEnglishButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });- // Wait for download button to be visible and enabled- await expect(downloadPdfEnglishButton).toBeVisible();- await expect(downloadPdfEnglishButton).toBeEnabled();-- // Click the download button and wait for download- const [download] = await Promise.all([- page.waitForEvent("download"),- downloadPdfEnglishButton.click(),- ]);-- // Get the suggested filename- const suggestedFilename = download.suggestedFilename();-- // save the file to temporary directory- const pdfFilePath = path.join(- downloadDir,- `${browserName}-${suggestedFilename}`,- );-- await download.saveAs(pdfFilePath);-- // Convert to absolute path and use proper file URL format- const absolutePath = path.resolve(pdfFilePath);- await expect.poll(() => fs.existsSync(absolutePath)).toBe(true);-- /**- * Render the PDF on a canvas and take a screenshot of it- */-- const pdfBytes = fs.readFileSync(absolutePath);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, pdfBytes);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "downloads-PDF-in-English.png",- );-- // navigate back to the previous page- await page.goto("/");- await expect(page).toHaveURL("/?template=default");-- /**- * Switch to Stripe template and download PDF in English with Stripe template- */- await page- .getByRole("combobox", { name: "Invoice Template" })- .selectOption("stripe");-- await page.waitForURL("/?template=stripe");- // Verify that the Stripe template is selected- const templateSelect = page.getByRole("combobox", {- name: "Invoice Template",- });- await expect(templateSelect).toHaveValue("stripe");-- // Wait for the download button to be visible and enabled for Stripe template- const downloadPdfStripeButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- await expect(downloadPdfStripeButton).toBeVisible();- await expect(downloadPdfStripeButton).toBeEnabled();-- // Click the download button and wait for download- const [stripeDownload] = await Promise.all([- page.waitForEvent("download"),- downloadPdfStripeButton.click(),- ]);-- // Get the suggested filename- const stripeSuggestedFilename = stripeDownload.suggestedFilename();-- // save the file to temporary directory- const stripePdfFilePath = path.join(- downloadDir,- `${browserName}-stripe-${stripeSuggestedFilename}`,- );-- await stripeDownload.saveAs(stripePdfFilePath);-- // Convert to absolute path and use proper file URL format- const stripeAbsolutePath = path.resolve(stripePdfFilePath);- await expect.poll(() => fs.existsSync(stripeAbsolutePath)).toBe(true);-- /**- * RENDER PDF ON CANVAS AND TAKE SCREENSHOT OF IT- */-- const stripePdfBytes = fs.readFileSync(stripeAbsolutePath);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, stripePdfBytes);+ test(+ "downloads PDF in English and verifies content",+ {+ // client side PDF generation + download is the most engine sensitive path+ // we have, so it is part of the Gecko smoke run+ tag: "@firefox-smoke",+ },+ async ({ page, browserName, downloadDir }) => {+ const { suggestedFilename, numPages } = await expectPdfScreenshot(page, {+ downloadDir,+ browserName,+ name: "downloads-PDF-in-English.png",+ });- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );+ // the file name contains the PDF language and the invoice number+ expect(suggestedFilename).toBe("invoice-EN-1-12-2025.pdf");- await expect(page.locator("canvas")).toHaveScreenshot(- `downloads-PDF-in-English-stripe-template.png`,- );- });+ // the default invoice fits on a single page+ expect(numPages).toBe(1);+ },+ );test("downloads PDF in Polish and verifies content", async ({page,@@ -147,17 +48,19 @@ test.describe("Default Invoice Template", () => {downloadDir,}, testInfo) => {// Switch to Polish- await page- .getByRole("combobox", { name: "Invoice PDF Language" })- .selectOption("pl");-- // we wait until this button is visible and enabled, that means that the PDF preview has been regenerated- const downloadPdfPolishButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,+ const languageSelect = page.getByRole("combobox", {+ name: "Invoice PDF Language",});- await expect(downloadPdfPolishButton).toBeVisible();- await expect(downloadPdfPolishButton).toBeEnabled();+ await languageSelect.selectOption("pl");+ await expect(languageSelect).toHaveValue("pl");++ // the invoice number label follows the selected language+ await expect(+ page+ .getByRole("group", { name: "Invoice Number" })+ .getByRole("textbox", { name: "Label" }),+ ).toHaveValue(`${INVOICE_PDF_TRANSLATIONS.pl.invoiceNumber}:`);const invoiceItemsSection = page.getByTestId("invoice-items-section");@@ -206,13 +109,6 @@ test.describe("Default Invoice Template", () => {const finalSection = page.getByTestId(`final-section`);- // for better debugging screenshots, we fill in the notes field with a test note =)- await finalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(- `Test: downloads PDF in Polish and verifies content (${testInfo.project.name})`,- );-// Check that the total is correct (should be 3,300.00)const totalTextbox = page.getByRole("textbox", { name: "Total" });await expect(totalTextbox).toHaveValue("3,300.00");@@ -257,130 +153,12 @@ test.describe("Default Invoice Template", () => {});await personAuthorizedToIssueNameInput.fill("Adam Smith");- // wait, because we update pdf on debounce timeout- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- // Click the download button and wait for download- const [download] = await Promise.all([- page.waitForEvent("download"),- downloadPdfPolishButton.click(),- ]);-- // Get the suggested filename- const suggestedFilename = download.suggestedFilename();-- // save the file to temporary directory- const pdfFilePath = path.join(+ await expectPdfScreenshot(page, {downloadDir,- `${browserName}-${suggestedFilename}`,- );-- await download.saveAs(pdfFilePath);-- // Convert to absolute path and use proper file URL format- const absolutePath = path.resolve(pdfFilePath);- await expect.poll(() => fs.existsSync(absolutePath)).toBe(true);-- /**- * RENDER PDF ON CANVAS AND TAKE SCREENSHOT OF IT- */-- const pdfBytes = fs.readFileSync(absolutePath);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, pdfBytes);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "downloads-PDF-in-Polish.png",- );-- // navigate back to the previous page- await page.goto("/");- await expect(page).toHaveURL("/?template=default");-- /**- * Switch to Stripe template and download PDF in Polish with Stripe template- */- await page- .getByRole("combobox", { name: "Invoice Template" })- .selectOption("stripe");-- await page.waitForURL("/?template=stripe");- // Verify that the Stripe template is selected- const templateSelect = page.getByRole("combobox", {- name: "Invoice Template",- });- await expect(templateSelect).toHaveValue("stripe");-- const notesFinalSection = page.getByTestId(`final-section`);-- // for better debugging screenshots, we fill in the notes field with a test note =)- await notesFinalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(- `Test: downloads PDF in Polish and verifies content with Stripe template (${testInfo.project.name})`,- );-- // wait for debounce timeout- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- // Wait for the download button to be visible and enabled for Stripe template- const downloadPdfStripeButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,+ browserName,+ name: "downloads-PDF-in-Polish.png",+ notes: `Test: downloads PDF in Polish and verifies content (${testInfo.project.name})`,});-- await expect(downloadPdfStripeButton).toBeVisible();- await expect(downloadPdfStripeButton).toBeEnabled();-- // Click the download button and wait for download- const [stripeDownload] = await Promise.all([- page.waitForEvent("download"),- downloadPdfStripeButton.click(),- ]);-- // Get the suggested filename- const stripeSuggestedFilename = stripeDownload.suggestedFilename();-- // save the file to temporary directory- const stripePdfFilePath = path.join(- downloadDir,- `${browserName}-stripe-${stripeSuggestedFilename}`,- );-- await stripeDownload.saveAs(stripePdfFilePath);-- // Convert to absolute path and use proper file URL format- const stripeAbsolutePath = path.resolve(stripePdfFilePath);- await expect.poll(() => fs.existsSync(stripeAbsolutePath)).toBe(true);-- /**- * RENDER PDF ON CANVAS AND TAKE SCREENSHOT OF IT- */-- const stripePdfBytes = fs.readFileSync(stripeAbsolutePath);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, stripePdfBytes);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- `downloads-PDF-in-Polish-stripe-template.png`,- );});test("update pdf when invoice data changes", async ({@@ -405,9 +183,12 @@ test.describe("Default Invoice Template", () => {await expect(page.locator('input[name="currency"]')).toHaveValue("GBP");// Switch to another date format- await page- .getByRole("combobox", { name: "Date format" })- .selectOption(DATE_FORMAT);+ const dateFormatSelect = page.getByRole("combobox", {+ name: "Date format",+ });++ await dateFormatSelect.selectOption(DATE_FORMAT);+ await expect(dateFormatSelect).toHaveValue(DATE_FORMAT);await page.getByRole("textbox", { name: "Header Notes" })@@ -422,33 +203,32 @@ test.describe("Default Invoice Template", () => {.getByRole("textbox", { name: "Name" }).fill("PLAYWRIGHT SELLER TEST");- // Toggle VAT Number visibility off- await sellerSection- .getByRole("switch", {+ // Toggle VAT Number, Account Number and SWIFT/BIC visibility off, so they are+ // left out of the generated PDF+ const sellerHiddenFieldSwitches = [+ sellerSection.getByRole("switch", {name: `Show the 'Seller Tax Number' Field in the PDF`,- })- .click();-- // Toggle Account Number visibility off- await sellerSection- .getByRole("switch", {+ }),+ sellerSection.getByRole("switch", {name: `Show the 'Account Number' Field in the PDF`,- })- .click();-- // Toggle SWIFT visibility off- await sellerSection- .getByRole("switch", {+ }),+ sellerSection.getByRole("switch", {name: `Show the 'SWIFT/BIC' Field in the PDF`,- })- .click();+ }),+ ];++ for (const fieldSwitch of sellerHiddenFieldSwitches) {+ await expect(fieldSwitch).toBeChecked();+ await fieldSwitch.click();+ await expect(fieldSwitch).not.toBeChecked();+ }// update notesawait sellerSection.getByRole("textbox", { name: "Notes" }).fill("PLAYWRIGHT SELLER NOTES TEST");- // Toggle notes visibility on+ // seller notes are shown in the PDF by defaultconst sellerNotesSwitch = sellerSection.getByTestId(`sellerNotesInvoiceFormFieldVisibilitySwitch`,);@@ -480,7 +260,7 @@ test.describe("Default Invoice Template", () => {.getByRole("textbox", { name: "Notes" }).fill("PLAYWRIGHT BUYER NOTES TEST");- // Toggle notes visibility on+ // buyer notes are shown in the PDF by defaultconst buyerNotesSwitch = buyerSection.getByTestId(`buyerNotesInvoiceFormFieldVisibilitySwitch`,);@@ -503,177 +283,49 @@ test.describe("Default Invoice Template", () => {.fill("1000");// Toggle VAT Table Summary visibility off- await page- .getByRole("switch", { name: `Show "VAT Table Summary" in the PDF` })- .click();-- const notesFinalSection = page.getByTestId(`final-section`);-- // for better debugging screenshots, we fill in the notes field with a test note =)- await notesFinalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(- `Test: update pdf when invoice data changes (${testInfo.project.name})`,- );-- // Wait for PDF preview to regenerate after invoice data changes (debounce timeout)- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- const downloadPdfEnglishButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,+ const vatTableSummarySwitch = page.getByRole("switch", {+ name: `Show "VAT Table Summary" in the PDF`,});- await expect(downloadPdfEnglishButton).toBeVisible();- await expect(downloadPdfEnglishButton).toBeEnabled();-- // Click the download button and wait for download- const [download] = await Promise.all([- page.waitForEvent("download"),- downloadPdfEnglishButton.click(),- ]);+ await expect(vatTableSummarySwitch).toBeChecked();+ await vatTableSummarySwitch.click();+ await expect(vatTableSummarySwitch).not.toBeChecked();- // Get the suggested filename- const suggestedFilename = download.suggestedFilename();-- // save the file to temporary directory- const pdfFilePath = path.join(+ await expectPdfScreenshot(page, {downloadDir,- `${browserName}-${suggestedFilename}`,- );-- await download.saveAs(pdfFilePath);-- // Convert to absolute path and use proper file URL format- const absolutePath = path.resolve(pdfFilePath);- await expect.poll(() => fs.existsSync(absolutePath)).toBe(true);-- /**- * RENDER PDF ON CANVAS AND TAKE SCREENSHOT OF IT- */-- const pdfBytes = fs.readFileSync(absolutePath);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, pdfBytes);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- `update-pdf-when-invoice-data-changes.png`,- );-- // navigate back to the previous page- await page.goto("/");- await expect(page).toHaveURL("/?template=default");-- // Wait for the download button to be ready after navigation- const newDownloadPdfButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });- await expect(newDownloadPdfButton).toBeVisible();- await expect(newDownloadPdfButton).toBeEnabled();-- /**- * Switch to Stripe template and download PDF in English with Stripe template- */- await page- .getByRole("combobox", { name: "Invoice Template" })- .selectOption("stripe");-- await page.waitForURL("/?template=stripe");-- // Verify that the Stripe template is selected- const templateSelect = page.getByRole("combobox", {- name: "Invoice Template",- });- await expect(templateSelect).toHaveValue("stripe");-- // for better debugging screenshots, we fill in the notes field with a test note =)- await notesFinalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(- `Test: update pdf when invoice data changes with Stripe template (${testInfo.project.name})`,- );-- // wait for debounce timeout- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- const downloadPdfStripeButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,+ browserName,+ name: "update-pdf-when-invoice-data-changes.png",+ notes: `Test: update pdf when invoice data changes (${testInfo.project.name})`,});-- await expect(downloadPdfStripeButton).toBeVisible();-- // Click the download button and wait for download- const [stripeDownload] = await Promise.all([- page.waitForEvent("download"),- downloadPdfStripeButton.click(),- ]);-- // Get the suggested filename- const stripeSuggestedFilename = stripeDownload.suggestedFilename();-- // save the file to temporary directory- const stripePdfFilePath = path.join(- downloadDir,- `${browserName}-stripe-${stripeSuggestedFilename}`,- );-- await stripeDownload.saveAs(stripePdfFilePath);-- // Convert to absolute path and use proper file URL format- const stripeAbsolutePath = path.resolve(stripePdfFilePath);- await expect.poll(() => fs.existsSync(stripeAbsolutePath)).toBe(true);-- const stripePdfBytes = fs.readFileSync(stripeAbsolutePath);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, stripePdfBytes);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- `update-pdf-when-invoice-data-changes-stripe-template.png`,- );});test("completes full invoice flow on mobile: tabs navigation, form editing and PDF download in French", async ({page,browserName,downloadDir,+ isMobile,}, testInfo) => {- // Set mobile viewport- await page.setViewportSize({ width: 375, height: 667 });+ // this flow is about the mobile UI (tabs), so it runs on the mobile projects+ // (Mobile Chrome and Mobile Safari) instead of on the desktop one+ // eslint-disable-next-line playwright/no-skipped-test -- mobile UI flow, mobile projects only+ test.skip(!isMobile, "mobile only flow, runs on the mobile projects");// Verify tabs are visible in mobile viewawait expect(page.getByRole("tab", { name: "Edit Invoice" })).toBeVisible();await expect(page.getByRole("tab", { name: "Preview PDF" })).toBeVisible();// Download button in English is visible and enabled- const downloadPdfButtonEnglish = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });- // Wait for download button to be visible- await expect(downloadPdfButtonEnglish).toBeVisible();- // Wait for download button to be enabled- await expect(downloadPdfButtonEnglish).toBeEnabled();+ const downloadPdfButton = getDownloadPdfLink(page);+ await expect(downloadPdfButton).toBeVisible();+ await expect(downloadPdfButton).toBeEnabled();// Switch to French- await page- .getByRole("combobox", { name: "Invoice PDF Language" })- .selectOption("fr");+ const languageSelect = page.getByRole("combobox", {+ name: "Invoice PDF Language",+ });++ await languageSelect.selectOption("fr");+ await expect(languageSelect).toHaveValue("fr");// Switch currency to GBP via comboboxconst mobileCurrencyCombobox = page.getByRole("combobox", {@@ -704,15 +356,6 @@ test.describe("Default Invoice Template", () => {await invoiceNumberLabelInput.fill(INVOICE_NUMBER_LABEL);await invoiceNumberValueInput.fill("2/05-2024");- const finalSection = page.getByTestId("final-section");-- // for better debugging screenshots, we fill in the notes field with a test note =)- await finalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(- `Test: completes full invoice flow on mobile: tabs navigation, form editing and PDF download in French (${testInfo.project.name})`,- );-// Fill in seller informationconst sellerSection = page.getByTestId("seller-information-section");await sellerSection@@ -737,113 +380,86 @@ test.describe("Default Invoice Template", () => {name: "Tax Settings",});+ // the VAT field is labelled "TVA" in French, so finding it proves the form+ // switched languageawait taxSettingsFieldset.getByRole("textbox", { name: "TVA Rate", exact: true }).fill("23");- // wait for debounce timeout- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);+ const MOBILE_FLOW_NOTES = `Test: completes full invoice flow on mobile: tabs navigation, form editing and PDF download in French (${testInfo.project.name})`;- // we wait until this button is visible and enabled, that means that the PDF preview has been regenerated- const downloadPdfFrenchBtn = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });- // Wait for download button to be visible and enabled- await expect(downloadPdfFrenchBtn).toBeVisible();- await expect(downloadPdfFrenchBtn).toBeEnabled();+ // the notes field is part of the form, so we fill it while the "Edit Invoice"+ // tab is still open+ await fillDebugNotes(page, MOBILE_FLOW_NOTES);// Switch to preview tab- await page.getByRole("tab", { name: "Preview PDF" }).click();+ const previewTab = page.getByRole("tab", { name: "Preview PDF" });+ const editInvoiceTab = page.getByRole("tab", { name: "Edit Invoice" });- // Verify preview tab is selected+ await previewTab.click();++ // Verify preview tab is selected. We assert on the tabs (which are always+ // rendered) instead of the inactive tab panel, which is unmounted while the+ // other tab is open+ await expect(previewTab).toHaveAttribute("aria-selected", "true");+ await expect(editInvoiceTab).toHaveAttribute("aria-selected", "false");await expect(page.getByRole("tabpanel", { name: "Preview PDF" }),).toBeVisible();- await expect(- page.getByRole("tabpanel", { name: "Edit Invoice" }),- ).toBeHidden();-- // Click the download button and wait for download- const [download] = await Promise.all([- page.waitForEvent("download"),- downloadPdfFrenchBtn.click(),- ]);- // Get the suggested filename- const suggestedFilename = download.suggestedFilename();-- // save the file to temporary directory- const pdfFilePath = path.join(+ const { suggestedFilename } = await expectPdfScreenshot(page, {downloadDir,- `${browserName}-${suggestedFilename}`,- );-- await download.saveAs(pdfFilePath);-- const downloadPdfToast = page.getByTestId("download-pdf-toast");-- // Verify toast appears after download- await expect(downloadPdfToast).toBeVisible();-- await expect(- downloadPdfToast.getByRole("link", { name: "Star on GitHub" }),- ).toBeVisible();-- await expect(downloadPdfToast.getByTestId("toast-cta-btn")).toBeVisible();-- // Convert to absolute path and use proper file URL format- const absolutePath = path.resolve(pdfFilePath);-- await expect.poll(() => fs.existsSync(absolutePath)).toBe(true);-- /**- * RENDER PDF ON CANVAS AND TAKE SCREENSHOT OF IT- */-- const pdfBytes = fs.readFileSync(absolutePath);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, pdfBytes);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );+ browserName,+ name: "completes-full-invoice-flow-on-mobile.png",+ // this test only runs on the mobile projects, so both of them keep a baseline+ snapshotProject: ["Mobile Chrome", "Mobile Safari"],+ afterDownload: async () => {+ const downloadPdfToast = page.getByTestId("download-pdf-toast");++ // Verify toast appears after download+ await expect(downloadPdfToast).toBeVisible();++ await expect(+ downloadPdfToast.getByRole("link", { name: "Star on GitHub" }),+ ).toBeVisible();++ await expect(+ downloadPdfToast.getByTestId("toast-cta-btn"),+ ).toBeVisible();+ },+ });- await expect(page.locator("canvas")).toHaveScreenshot(- `completes-full-invoice-flow-on-mobile.png`,- );+ // the file name carries the selected PDF language and the invoice number we+ // typed above (slashes become dashes)+ expect(suggestedFilename).toBe("invoice-FR-2-05-2024.pdf");// Navigate back to the previous pageawait page.goto("/");await expect(page).toHaveURL("/?template=default");- // Set mobile viewport again- await page.setViewportSize({ width: 375, height: 667 });-// Switch back to form tab- await page.getByRole("tab", { name: "Edit Invoice" }).click();+ await editInvoiceTab.click();// Verify form tab is selected and data persists+ await expect(editInvoiceTab).toHaveAttribute("aria-selected", "true");+ await expect(previewTab).toHaveAttribute("aria-selected", "false");await expect(page.getByRole("tabpanel", { name: "Edit Invoice" }),).toBeVisible();- await expect(- page.getByRole("tabpanel", { name: "Preview PDF" }),- ).toBeHidden();// Verify form data persistsawait expect(invoiceNumberLabelInput).toHaveValue(INVOICE_NUMBER_LABEL);await expect(invoiceNumberValueInput).toHaveValue("2/05-2024");+ // the PDF language and the currency are part of that data too+ await expect(languageSelect).toHaveValue("fr");+ await expect(page.locator('input[name="currency"]')).toHaveValue("GBP");+await expect(- finalSection.getByRole("textbox", { name: "Notes", exact: true }),- ).toHaveValue(- `Test: completes full invoice flow on mobile: tabs navigation, form editing and PDF download in French (${testInfo.project.name})`,- );+ page+ .getByTestId("final-section")+ .getByRole("textbox", { name: "Notes", exact: true }),+ ).toHaveValue(MOBILE_FLOW_NOTES);// Verify seller information persistsawait expect(@@ -865,12 +481,8 @@ test.describe("Default Invoice Template", () => {}),).toHaveValue("50");- const newTaxSettingsFieldset = invoiceItemsSection.getByRole("group", {- name: "Tax Settings",- });-await expect(- newTaxSettingsFieldset.getByRole("textbox", {+ taxSettingsFieldset.getByRole("textbox", {name: "TVA Rate",exact: true,}),@@ -895,90 +507,11 @@ test.describe("Default Invoice Template", () => {exact: true,}),).toHaveValue("184.50");-- /**- * Switch to Stripe template and download PDF in English with Stripe template- */- await page- .getByRole("combobox", { name: "Invoice Template" })- .selectOption("stripe");-- await page.waitForURL("/?template=stripe");- // Verify that the Stripe template is selected- const templateSelect = page.getByRole("combobox", {- name: "Invoice Template",- });- await expect(templateSelect).toHaveValue("stripe");- await expect(invoiceNumberLabelInput).toHaveValue(- INVOICE_PDF_TRANSLATIONS.fr.stripe.invoice,- );-- const newFinalSection = page.getByTestId(`final-section`);-- // for better debugging screenshots, we fill in the notes field with a test note =)- await newFinalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(- `Test: completes full invoice flow on mobile: tabs navigation, form editing and PDF download in French with Stripe template (${testInfo.project.name})`,- );-- // wait for debounce timeout- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- const downloadPdfStripeButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- await expect(downloadPdfStripeButton).toBeVisible();-- // Click the download button and wait for download- const [stripeDownload] = await Promise.all([- page.waitForEvent("download"),- downloadPdfStripeButton.click(),- ]);-- // Get the suggested filename- const stripeSuggestedFilename = stripeDownload.suggestedFilename();-- // save the file to temporary directory- const stripePdfFilePath = path.join(- downloadDir,- `${browserName}-stripe-${stripeSuggestedFilename}`,- );-- await stripeDownload.saveAs(stripePdfFilePath);-- // Convert to absolute path and use proper file URL format- const stripeAbsolutePath = path.resolve(stripePdfFilePath);- await expect.poll(() => fs.existsSync(stripeAbsolutePath)).toBe(true);-- /**- * RENDER PDF ON CANVAS AND TAKE SCREENSHOT OF IT- */-- const stripePdfBytes = fs.readFileSync(stripeAbsolutePath);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, stripePdfBytes);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- `completes-full-invoice-flow-on-mobile-stripe-template.png`,- );- });+ });test("should display and persist invoice number in different languages", async ({page,- downloadDir,- browserName,- }, testInfo) => {+ }) => {const generalInfoSection = page.getByTestId("general-information-section");const invoiceNumberFieldset = generalInfoSection.getByRole("group", {@@ -1032,39 +565,29 @@ test.describe("Default Invoice Template", () => {// check that the reset to default format button is hiddenawait expect(resetToDefaultFormatButton).toBeHidden();- // fill once again the invoice number- await invoiceNumberLabelInput.fill("Faktura TEST:");-- // Switch currency to CHF via comboboxconst currencyCombobox2 = page.getByRole("combobox", { name: "Currency" });- await currencyCombobox2.click();- await page.getByRole("option", { name: /^CHF\s/ }).click();- await expect(currencyCombobox2).toContainText("CHF");- // check that value is saved in the hidden input- await expect(page.locator('input[name="currency"]')).toHaveValue("CHF");+ // the form is written to localStorage by the same debounced callback that+ // regenerates the PDF, so waiting for the new PDF also means the form data we+ // just changed is persisted and will survive the reload below+ await waitForPdfRegeneration(page, async () => {+ // fill once again the invoice number+ await invoiceNumberLabelInput.fill("Faktura TEST:");- const notesFinalSection = page.getByTestId(`final-section`);- // for better debugging screenshots, we fill in the notes field with a test note =)- await notesFinalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(- `Test: should display and persist invoice number in different languages (${testInfo.project.name})`,- );+ // Switch currency to CHF via combobox+ await currencyCombobox2.click();+ await page.getByRole("option", { name: /^CHF\s/ }).click();+ await expect(currencyCombobox2).toContainText("CHF");- // we wait until this button is visible and enabled, that means that the PDF preview has been regenerated- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);+ // check that value is saved in the hidden input+ await expect(page.locator('input[name="currency"]')).toHaveValue("CHF");+ });// we reload the page to test that the invoice number is persisted after page reloadawait page.reload();// Verify that the download PDF button is visible after page reload- const downloadPdfPlButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- await expect(downloadPdfPlButton).toBeVisible();+ await expect(getDownloadPdfLink(page)).toBeVisible();const newInvoiceNumberLabelInput = invoiceNumberFieldset.getByRole("textbox",@@ -1108,65 +631,9 @@ test.describe("Default Invoice Template", () => {// check that value is saved in the hidden inputawait expect(page.locator('input[name="currency"]')).toHaveValue("CHF");- // wait for debounce timeout- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- // we wait until this button is visible and enabled, that means that the PDF preview has been regenerated- const downloadPdfPtButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- await expect(downloadPdfPtButton).toBeVisible();- await expect(downloadPdfPtButton).toBeEnabled();-- // Click the download button and wait for download- const [download] = await Promise.all([- page.waitForEvent("download"),- downloadPdfPtButton.click(),- ]);-- // Get the suggested filename- const suggestedFilename = download.suggestedFilename();-- // save the file to temporary directory- const pdfFilePath = path.join(- downloadDir,- `${browserName}-${suggestedFilename}`,- );-- await download.saveAs(pdfFilePath);-- // Convert to absolute path and use proper file URL format- const absolutePath = path.resolve(pdfFilePath);- await expect.poll(() => fs.existsSync(absolutePath)).toBe(true);-- /**- * RENDER PDF ON CANVAS AND TAKE SCREENSHOT OF IT- */-- const pdfBytes = fs.readFileSync(absolutePath);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, pdfBytes);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- `should-display-and-persist-invoice-number-in-different-languages.png`,- );-- // navigate back to the previous page- await page.goto("/");- await expect(page).toHaveURL("/?template=default");-/**- * Switch to Stripe template and download PDF in English with Stripe template+ * Switch to the Stripe template to verify that the invoice number label+ * follows the template specific translations*/await page.getByRole("combobox", { name: "Invoice Template" })@@ -1196,397 +663,12 @@ test.describe("Default Invoice Template", () => {await newInvoiceNumberLabelInput.fill("Fatura CUSTOM LABEL N°:");- // Currency should be CHF after navigating back to the previous page+ // Currency is kept when the template changesconst currencyCombobox3 = page.getByRole("combobox", { name: "Currency" });await expect(currencyCombobox3).toContainText("CHF");// check that value is saved in the hidden inputawait expect(page.locator('input[name="currency"]')).toHaveValue("CHF");-- const newNotesFinalSection = page.getByTestId(`final-section`);-- // for better debugging screenshots, we fill in the notes field with a test note =)- await newNotesFinalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(- `Test: should display and persist invoice number in different languages with Stripe template (${testInfo.project.name})`,- );-- // wait for debounce timeout- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- const downloadPdfStripeButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- await expect(downloadPdfStripeButton).toBeVisible();-- // Click the download button and wait for download- const [stripeDownload] = await Promise.all([- page.waitForEvent("download"),- downloadPdfStripeButton.click(),- ]);-- // Get the suggested filename- const stripeSuggestedFilename = stripeDownload.suggestedFilename();-- // save the file to temporary directory- const stripePdfFilePath = path.join(- downloadDir,- `${browserName}-stripe-${stripeSuggestedFilename}`,- );-- await stripeDownload.saveAs(stripePdfFilePath);-- // Convert to absolute path and use proper file URL format- const stripeAbsolutePath = path.resolve(stripePdfFilePath);- await expect.poll(() => fs.existsSync(stripeAbsolutePath)).toBe(true);-- /**- * RENDER PDF ON CANVAS AND TAKE SCREENSHOT OF IT- */-- const stripePdfBytes = fs.readFileSync(stripeAbsolutePath);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, stripePdfBytes);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- `should-display-and-persist-invoice-number-in-different-languages-stripe-template.png`,- );- });-- test("displays QR code in PDF when QR code data is provided", async ({- page,- browserName,- downloadDir,- }, testInfo) => {- const QR_CODE_TEST_DATA = {- data: "https://easyinvoicepdf.com",- description: "QR Code Description",- } as const satisfies {- data: string;- description: string;- };-- // verify that we are on the default template- await expect(page).toHaveURL("/?template=default");-- const finalSection = page.getByTestId("final-section");-- const qrCodeFieldset = finalSection.getByRole("group", {- name: "QR Code",- });- await expect(qrCodeFieldset).toBeVisible();-- // Verify that "Show QR Code in PDF" switch is on by default- const showQrCodeSwitch = qrCodeFieldset.getByRole("switch", {- name: "Show QR Code in PDF",- });- await expect(showQrCodeSwitch).toBeVisible();- await expect(showQrCodeSwitch).toBeEnabled();- await expect(showQrCodeSwitch).toBeChecked();-- // Fill in the QR code data field- await qrCodeFieldset- .getByRole("textbox", { name: "Data" })- .fill(QR_CODE_TEST_DATA.data);-- // Fill in the QR code description field- await qrCodeFieldset- .getByRole("textbox", { name: "Description (optional)" })- .fill(QR_CODE_TEST_DATA.description);-- // for better debugging screenshots, we fill in the notes field with a test note =)- await finalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(`Test: ${testInfo.title} (${testInfo.project.name})`);-- // Wait for debounce timeout- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- const downloadPdfEnglishButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- await expect(downloadPdfEnglishButton).toBeVisible();- await expect(downloadPdfEnglishButton).toBeEnabled();-- // Click the download button and wait for download- const [download] = await Promise.all([- page.waitForEvent("download"),- downloadPdfEnglishButton.click(),- ]);-- // Get the suggested filename- const suggestedFilename = download.suggestedFilename();-- // save the file to temporary directory- const pdfFilePath = path.join(- downloadDir,- `${browserName}-${suggestedFilename}`,- );-- await download.saveAs(pdfFilePath);-- // Convert to absolute path and use proper file URL format- const absolutePath = path.resolve(pdfFilePath);- await expect.poll(() => fs.existsSync(absolutePath)).toBe(true);-- /**- * Render the PDF on a canvas and take a screenshot of it- */- const pdfBytes = fs.readFileSync(absolutePath);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, pdfBytes);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "displays-qr-code-in-pdf-default-template.png",- );-- /**- * TURN OFF QR CODE IN PDF AND DOWNLOAD PDF AGAIN- */-- // navigate back to the previous page- await page.goto("/");- await expect(page).toHaveURL("/?template=default");-- // verify that we are on the default template- await expect(page).toHaveURL("/?template=default");-- const newFinalSection = page.getByTestId("final-section");-- const newQrCodeFieldset = newFinalSection.getByRole("group", {- name: "QR Code",- });- await expect(newQrCodeFieldset).toBeVisible();-- // Verify that "Show QR Code in PDF" switch is on by default- const newShowQrCodeSwitch = newQrCodeFieldset.getByRole("switch", {- name: "Show QR Code in PDF",- });-- await expect(newShowQrCodeSwitch).toBeVisible();- await expect(newShowQrCodeSwitch).toBeEnabled();- await expect(newShowQrCodeSwitch).toBeChecked();-- // toggle the switch off- await newShowQrCodeSwitch.click();-- // verify that the switch is off- await expect(newShowQrCodeSwitch).not.toBeChecked();-- // Verify QR Code Data field retains its value after toggling visibility off- const newQrCodeDataTextarea = newQrCodeFieldset.getByRole("textbox", {- name: "Data",- });- await expect(newQrCodeDataTextarea).toBeVisible();- await expect(newQrCodeDataTextarea).toHaveValue(QR_CODE_TEST_DATA.data);-- // Verify QR Code Description field retains its value after toggling visibility off- const newQrCodeDescriptionTextarea = newQrCodeFieldset.getByRole(- "textbox",- {- name: "Description (optional)",- },- );- await expect(newQrCodeDescriptionTextarea).toBeVisible();- await expect(newQrCodeDescriptionTextarea).toHaveValue(- QR_CODE_TEST_DATA.description,- );-- // for better debugging screenshots, we fill in the notes field with a test note =)- await newFinalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(- `Test: ${testInfo.title} - QR code hidden in PDF (${testInfo.project.name})`,- );-- // wait for debounce timeout- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- const newDownloadPdfEnglishButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- // Download the PDF again- const [downloadPdfWithoutQrCode] = await Promise.all([- page.waitForEvent("download"),- newDownloadPdfEnglishButton.click(),- ]);-- // Get the suggested filename- const suggestedFilenameWithoutQrCode =- downloadPdfWithoutQrCode.suggestedFilename();-- // save the file to temporary directory- const pdfFilePath2 = path.join(- downloadDir,- `${browserName}-${suggestedFilenameWithoutQrCode}`,- );-- await downloadPdfWithoutQrCode.saveAs(pdfFilePath2);-- /**- * Render the PDF on a canvas and take a screenshot to verify QR code is not displayed- */- const pdfBytesWithoutQrCode = fs.readFileSync(pdfFilePath2);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, pdfBytesWithoutQrCode);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "qr-code-hidden-in-pdf-default-template.png",- );- });-- test("generates multi-page PDF when invoice has many items", async ({- page,- browserName,- downloadDir,- }, testInfo) => {- // Verify we're on the default template- await expect(page).toHaveURL("/?template=default");-- const invoiceItemsSection = page.getByTestId("invoice-items-section");-- // Update tax label for the first item- const firstItemFieldset = invoiceItemsSection.getByRole("group", {- name: "Item 1",- });-- const firstItemTaxSettingsFieldset = firstItemFieldset.getByRole("group", {- name: "Tax Settings",- });-- await firstItemTaxSettingsFieldset- .getByRole("textbox", { name: "Tax Label" })- .fill("Sales Tax");-- // Add additional invoice items to trigger multiple-page PDF- for (let i = 0; i < 17; i++) {- await invoiceItemsSection- .getByRole("button", { name: "Add invoice item" })- .click();-- // Fill minimal required fields for the new item- const itemFieldset = invoiceItemsSection.getByRole("group", {- name: `Item ${i + 2}`, // Item numbers start at 1- });-- await itemFieldset- .getByRole("textbox", { name: "Name" })- .fill(- `Item ${i + 2}. Some long item name that should be wrapped to the next line. Some long item name that should be wrapped to the next line. Some long item name that should be wrapped to the next line.`,- );-- // Set VAT to 10% for each item- const taxSettingsFieldset = itemFieldset.getByRole("group", {- name: "Tax Settings",- });-- // Use different tax rates: 10%, 20%, or 50%- const taxRate =- // eslint-disable-next-line playwright/no-conditional-in-test- (i + 2) % 3 === 0 ? "50" : (i + 2) % 2 === 0 ? "20" : "10";-- await taxSettingsFieldset- .getByRole("textbox", { name: "Sales Tax Rate", exact: true })- .fill(taxRate);-- await itemFieldset- .getByRole("spinbutton", {- name: "Net Price (Rate or Unit Price)",- })- .fill(`${1000 * (i + 1)}`);- }-- const finalSection = page.getByTestId("final-section");-- // for better debugging screenshots, we fill in the notes field with a test note- await finalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(- `Test: generates multi-page PDF when invoice has many items (${testInfo.project.name})`,- );-- // Wait for PDF preview to regenerate after invoice data changes (debounce timeout)- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- const downloadPdfEnglishButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- await expect(downloadPdfEnglishButton).toBeVisible();- await expect(downloadPdfEnglishButton).toBeEnabled();-- // Click the download button and wait for download- const [download] = await Promise.all([- page.waitForEvent("download"),- downloadPdfEnglishButton.click(),- ]);-- // Get the suggested filename- const suggestedFilename = download.suggestedFilename();-- // save the file to temporary directory- const pdfFilePath = path.join(- downloadDir,- `${browserName}-${suggestedFilename}`,- );-- await download.saveAs(pdfFilePath);-- // Convert to absolute path and use proper file URL format- const absolutePath = path.resolve(pdfFilePath);- await expect.poll(() => fs.existsSync(absolutePath)).toBe(true);-- /**- * RENDER ALL PDF PAGES ON A SINGLE CANVAS AND TAKE SCREENSHOT- */-- const pdfBytes = fs.readFileSync(absolutePath);-- await page.goto("about:blank");-- await renderMultiPagePdfOnCanvas(page, pdfBytes);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "default-template-multi-pages.png",- );});test("generates PDF with logo when using default template", async ({@@ -1599,63 +681,28 @@ test.describe("Default Invoice Template", () => {const generalInfoSection = page.getByTestId("general-information-section");// Upload a valid logo- await uploadLogoFile(page);-- // Verify logo preview is visible- await expect(page.getByText("Logo uploaded successfully!")).toBeVisible();- await expect(- generalInfoSection.getByAltText("Company logo preview"),- ).toBeVisible();- await expect(- generalInfoSection.getByText(- "Logo uploaded successfully. Click the X to remove it.",- ),- ).toBeVisible();-- // Wait for debounce timeout- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(800);-- const downloadPDFButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- await expect(downloadPDFButton).toBeVisible();- await expect(downloadPDFButton).toBeEnabled();-- // Click the download button and wait for download- const [download] = await Promise.all([- page.waitForEvent("download"),- downloadPDFButton.click(),- ]);-- const suggestedFilename = download.suggestedFilename();-- const pdfFilePath = path.join(+ await waitForPdfRegeneration(page, async () => {+ await uploadLogoFile(page);++ // Verify logo preview is visible+ await expect(page.getByText("Logo uploaded successfully!")).toBeVisible();+ await expect(+ generalInfoSection.getByAltText("Company logo preview"),+ ).toBeVisible();+ await expect(+ generalInfoSection.getByText(+ "Logo uploaded successfully. Click the X to remove it.",+ ),+ ).toBeVisible();+ });++ const { suggestedFilename } = await expectPdfScreenshot(page, {downloadDir,- `${browserName}-${suggestedFilename}`,- );-- await download.saveAs(pdfFilePath);-- const absolutePath = path.resolve(pdfFilePath);- await expect.poll(() => fs.existsSync(absolutePath)).toBe(true);-- const pdfBytes = fs.readFileSync(absolutePath);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, pdfBytes);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );+ browserName,+ name: "pdf-with-logo-default-template.png",+ });- await expect(page.locator("canvas")).toHaveScreenshot(- "pdf-with-logo-default-template.png",- );+ expect(suggestedFilename).toBe("invoice-EN-1-12-2025.pdf");/*** VERIFY LOGO PERSISTS AFTER NAVIGATING BACK TO DEFAULT TEMPLATE@@ -1689,470 +736,13 @@ test.describe("Default Invoice Template", () => {newGeneralInfoSection.getByAltText("Company logo preview"),).toBeVisible();- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(800);-// Download PDF with Stripe template + logo- const stripeDownloadPDFButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- await expect(stripeDownloadPDFButton).toBeVisible();- await expect(stripeDownloadPDFButton).toBeEnabled();-- const [stripeDownload] = await Promise.all([- page.waitForEvent("download"),- stripeDownloadPDFButton.click(),- ]);-- const stripeSuggestedFilename = stripeDownload.suggestedFilename();-- const stripePdfFilePath = path.join(- downloadDir,- `${browserName}-stripe-${stripeSuggestedFilename}`,- );-- await stripeDownload.saveAs(stripePdfFilePath);-- const stripeAbsolutePath = path.resolve(stripePdfFilePath);- await expect.poll(() => fs.existsSync(stripeAbsolutePath)).toBe(true);-- const stripePdfBytes = fs.readFileSync(stripeAbsolutePath);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, stripePdfBytes);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "pdf-with-logo-stripe-template-after-switch.png",- );- });-- test("toggles seller and buyer email visibility in PDF", async ({- page,- browserName,- downloadDir,- }, testInfo) => {- await expect(page).toHaveURL("/?template=default");-- /*- * PHASE 1: Fill inline form with email switch OFF -> PDF screenshot (emails hidden)- */-- const sellerSection = page.getByTestId("seller-information-section");- const buyerSection = page.getByTestId("buyer-information-section");-- // Fill seller fields inline (no saved seller selected, so switch is enabled)- await sellerSection- .getByRole("textbox", { name: "Name (Required)" })- .fill("Email Visibility Test Seller");-- await sellerSection- .getByRole("textbox", { name: "Address (Required)" })- .fill("123 Seller Street\nSeller City, 10001");-- await sellerSection- .getByRole("textbox", { name: "Email" })- .fill("[email protected]");-- // Toggle seller email switch OFF via inline form- const sellerEmailSwitch = sellerSection.getByRole("switch", {- name: "Show the 'Email' field in the PDF",- });- await expect(sellerEmailSwitch).toBeChecked();- await sellerEmailSwitch.click();- await expect(sellerEmailSwitch).not.toBeChecked();-- // Fill buyer fields inline (no saved buyer selected, so switch is enabled)- await buyerSection- .getByRole("textbox", { name: "Name (Required)" })- .fill("Email Visibility Test Buyer");-- await buyerSection- .getByRole("textbox", { name: "Address (Required)" })- .fill("456 Buyer Avenue\nBuyer City, 20002");-- await buyerSection- .getByRole("textbox", { name: "Email" })- .fill("[email protected]");-- // Toggle buyer email switch OFF via inline form- const buyerEmailSwitch = buyerSection.getByRole("switch", {- name: "Show the 'Email' field in the PDF",- });- await expect(buyerEmailSwitch).toBeChecked();- await buyerEmailSwitch.click();- await expect(buyerEmailSwitch).not.toBeChecked();-- const finalSection = page.getByTestId("final-section");- await finalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(- `Test: ${testInfo.title} - emails hidden (${testInfo.project.name})`,- );-- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- const downloadPdfButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });- await expect(downloadPdfButton).toBeVisible();- await expect(downloadPdfButton).toBeEnabled();-- // Download PDF with emails hidden (toggled off via inline form)- const [download] = await Promise.all([- page.waitForEvent("download"),- downloadPdfButton.click(),- ]);-- const pdfFilePath = path.join(- downloadDir,- `${browserName}-${download.suggestedFilename()}`,- );- await download.saveAs(pdfFilePath);-- const absolutePath = path.resolve(pdfFilePath);- await expect.poll(() => fs.existsSync(absolutePath)).toBe(true);-- const pdfBytes = fs.readFileSync(absolutePath);- await page.goto("about:blank");- await renderPdfOnCanvas(page, pdfBytes);- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "email-hidden-in-pdf-default-template.png",- );-- /*- * PHASE 2: Save seller/buyer via dialog with email ON -> PDF screenshot (emails visible)- */-- await page.goto("/?template=default");- await expect(page).toHaveURL("/?template=default");-- // Create seller via dialog with email visible- await page.getByRole("button", { name: "New Seller" }).click();-- const manageSellerDialog = page.getByTestId("manage-seller-dialog");-- await manageSellerDialog- .getByRole("textbox", { name: "Name (Required)" })- .fill("Email Visibility Test Seller");-- await manageSellerDialog- .getByRole("textbox", { name: "Address (Required)" })- .fill("123 Seller Street\nSeller City, 10001");-- await manageSellerDialog- .getByRole("textbox", { name: "Email" })- .fill("[email protected]");-- // Verify email visibility switch is checked by default in dialog- const sellerEmailSwitchInDialog = manageSellerDialog.getByRole("switch", {- name: "Show the 'Email' field in the PDF",- });- await expect(sellerEmailSwitchInDialog).toBeVisible();- await expect(sellerEmailSwitchInDialog).toBeChecked();-- await manageSellerDialog- .getByRole("button", { name: "Save Seller" })- .click();-- await expect(manageSellerDialog).toBeHidden();-- await expect(- page.getByText("Seller added and applied to invoice", { exact: true }),- ).toBeVisible();-- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- // Create buyer via dialog with email visible- await page.getByRole("button", { name: "New Buyer" }).click();-- const manageBuyerDialog = page.getByTestId("manage-buyer-dialog");-- await manageBuyerDialog- .getByRole("textbox", { name: "Name (Required)" })- .fill("Email Visibility Test Buyer");-- await manageBuyerDialog- .getByRole("textbox", { name: "Address (Required)" })- .fill("456 Buyer Avenue\nBuyer City, 20002");-- await manageBuyerDialog- .getByRole("textbox", { name: "Email" })- .fill("[email protected]");-- // Verify email visibility switch is checked by default in dialog- const buyerEmailSwitchInDialog = manageBuyerDialog.getByRole("switch", {- name: "Show the 'Email' field in the PDF",- });- await expect(buyerEmailSwitchInDialog).toBeVisible();- await expect(buyerEmailSwitchInDialog).toBeChecked();-- await manageBuyerDialog.getByRole("button", { name: "Save Buyer" }).click();-- await expect(manageBuyerDialog).toBeHidden();-- await expect(- page.getByText("Buyer added and applied to invoice", { exact: true }),- ).toBeVisible();-- const newFinalSection = page.getByTestId("final-section");- await newFinalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(- `Test: ${testInfo.title} - emails visible (${testInfo.project.name})`,- );-- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- const newDownloadPdfButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });- await expect(newDownloadPdfButton).toBeVisible();- await expect(newDownloadPdfButton).toBeEnabled();-- // Download PDF with emails visible (saved via dialog)- const [downloadVisible] = await Promise.all([- page.waitForEvent("download"),- newDownloadPdfButton.click(),- ]);-- const visiblePdfFilePath = path.join(- downloadDir,- `${browserName}-visible-${downloadVisible.suggestedFilename()}`,- );- await downloadVisible.saveAs(visiblePdfFilePath);-- const visibleAbsolutePath = path.resolve(visiblePdfFilePath);- await expect.poll(() => fs.existsSync(visibleAbsolutePath)).toBe(true);-- const visiblePdfBytes = fs.readFileSync(visibleAbsolutePath);- await page.goto("about:blank");- await renderPdfOnCanvas(page, visiblePdfBytes);- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "email-visible-in-pdf-default-template.png",- );- });-- test("displays service period in PDF when enabled and hides it when toggled off", async ({- page,- browserName,- downloadDir,- }, testInfo) => {- const SERVICE_PERIOD_TEST_DATA = {- start: "2025-12-14",- end: "2025-12-20",- } as const;-- const CUSTOM_SERVICE_PERIOD_LABEL = "Billing period";-- await expect(page).toHaveURL("/?template=default");-- const generalInfoSection = page.getByTestId("general-information-section");- const servicePeriodFieldset = generalInfoSection.getByRole("group", {- name: "Service period",- });- await expect(servicePeriodFieldset).toBeVisible();-- const servicePeriodLabelInput = servicePeriodFieldset.getByRole("textbox", {- name: "Service period PDF label",- });- await expect(servicePeriodLabelInput).toHaveValue(- INVOICE_PDF_TRANSLATIONS.en.servicePeriod,- );-- const servicePeriodSwitch = servicePeriodFieldset.getByRole("switch", {- name: 'Show the "Service period" (Service period start and end) field in the PDF',- });-- // Service period start and end dates- await servicePeriodFieldset- .getByRole("textbox", { name: "Service period start" })- .fill(SERVICE_PERIOD_TEST_DATA.start);-- await servicePeriodFieldset- .getByRole("textbox", { name: "Service period end" })- .fill(SERVICE_PERIOD_TEST_DATA.end);-- // Custom service period label- await servicePeriodLabelInput.fill(CUSTOM_SERVICE_PERIOD_LABEL);-- await expect(servicePeriodLabelInput).toHaveValue(- CUSTOM_SERVICE_PERIOD_LABEL,- );-- // Check that the reset helper is displayed- await expect(- servicePeriodFieldset.getByRole("button", {- name: 'Reset to default ("Service period")',- }),- ).toBeVisible();-- await expect(- servicePeriodFieldset.getByRole("textbox", {- name: "Service period start",- }),- ).toHaveValue(SERVICE_PERIOD_TEST_DATA.start);- await expect(- servicePeriodFieldset.getByRole("textbox", {- name: "Service period end",- }),- ).toHaveValue(SERVICE_PERIOD_TEST_DATA.end);- await expect(servicePeriodSwitch).toBeChecked();-- const finalSection = page.getByTestId("final-section");- await finalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(`Test: ${testInfo.title} (${testInfo.project.name})`);-- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- const downloadPdfEnglishButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- await expect(downloadPdfEnglishButton).toBeVisible();- await expect(downloadPdfEnglishButton).toBeEnabled();-- const [download] = await Promise.all([- page.waitForEvent("download"),- downloadPdfEnglishButton.click(),- ]);-- const pdfFilePath = path.join(+ await expectPdfScreenshot(page, {downloadDir,- `${browserName}-${download.suggestedFilename()}`,- );-- await download.saveAs(pdfFilePath);-- const absolutePath = path.resolve(pdfFilePath);- await expect.poll(() => fs.existsSync(absolutePath)).toBe(true);-- const pdfBytes = fs.readFileSync(absolutePath);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, pdfBytes);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "displays-service-period-in-pdf-default-template.png",- );-- await page.goto("/");- await expect(page).toHaveURL("/?template=default");-- const newGeneralInfoSection = page.getByTestId(- "general-information-section",- );- const newServicePeriodFieldset = newGeneralInfoSection.getByRole("group", {- name: "Service period",+ browserName,+ filePrefix: "stripe-",+ name: "pdf-with-logo-stripe-template-after-switch.png",});- await expect(newServicePeriodFieldset).toBeVisible();-- const newServicePeriodSwitch = newServicePeriodFieldset.getByRole(- "switch",- {- name: 'Show the "Service period" (Service period start and end) field in the PDF',- },- );-- await expect(newServicePeriodSwitch).toBeChecked();-- await expect(- newServicePeriodFieldset.getByRole("textbox", {- name: "Service period PDF label",- }),- ).toHaveValue(CUSTOM_SERVICE_PERIOD_LABEL);-- await newServicePeriodSwitch.click();- await expect(newServicePeriodSwitch).not.toBeChecked();-- await expect(- newServicePeriodFieldset.getByRole("textbox", {- name: "Service period start",- }),- ).toHaveValue(SERVICE_PERIOD_TEST_DATA.start);- await expect(- newServicePeriodFieldset.getByRole("textbox", {- name: "Service period end",- }),- ).toHaveValue(SERVICE_PERIOD_TEST_DATA.end);- await expect(- newServicePeriodFieldset.getByRole("textbox", {- name: "Service period PDF label",- }),- ).toHaveValue(CUSTOM_SERVICE_PERIOD_LABEL);-- const newFinalSection = page.getByTestId("final-section");- await newFinalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(- `Test: ${testInfo.title} - service period hidden in PDF (${testInfo.project.name})`,- );-- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- const newDownloadPdfEnglishButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- const [downloadWithoutServicePeriod] = await Promise.all([- page.waitForEvent("download"),- newDownloadPdfEnglishButton.click(),- ]);-- const pdfFilePath2 = path.join(- downloadDir,- `${browserName}-${downloadWithoutServicePeriod.suggestedFilename()}`,- );-- await downloadWithoutServicePeriod.saveAs(pdfFilePath2);-- const pdfBytesWithoutServicePeriod = fs.readFileSync(pdfFilePath2);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, pdfBytesWithoutServicePeriod);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "service-period-hidden-in-pdf-default-template.png",- );});test("displays date of sales in PDF when enabled and hides it when toggled off", async ({@@ -2198,51 +788,12 @@ test.describe("Default Invoice Template", () => {await expect(dateOfServiceSwitch).toBeChecked();- const finalSection = page.getByTestId("final-section");- await finalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(`Test: ${testInfo.title} (${testInfo.project.name})`);-- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- const downloadPdfEnglishButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- await expect(downloadPdfEnglishButton).toBeVisible();- await expect(downloadPdfEnglishButton).toBeEnabled();-- const [download] = await Promise.all([- page.waitForEvent("download"),- downloadPdfEnglishButton.click(),- ]);-- const pdfFilePath = path.join(+ await expectPdfScreenshot(page, {downloadDir,- `${browserName}-${download.suggestedFilename()}`,- );-- await download.saveAs(pdfFilePath);-- const absolutePath = path.resolve(pdfFilePath);- await expect.poll(() => fs.existsSync(absolutePath)).toBe(true);-- const pdfBytes = fs.readFileSync(absolutePath);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, pdfBytes);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "date-of-sales-visible-in-pdf-default-template.png",- );+ browserName,+ name: "date-of-sales-visible-in-pdf-default-template.png",+ notes: `Test: ${testInfo.title} (${testInfo.project.name})`,+ });await page.goto("/");await expect(page).toHaveURL("/?template=default");@@ -2281,46 +832,11 @@ test.describe("Default Invoice Template", () => {CUSTOM_DATE_OF_SALES_LABEL,);- const newFinalSection = page.getByTestId("final-section");- await newFinalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(- `Test: ${testInfo.title} - date of sales hidden in PDF (${testInfo.project.name})`,- );-- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- const newDownloadPdfEnglishButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- const [downloadWithoutDateOfSales] = await Promise.all([- page.waitForEvent("download"),- newDownloadPdfEnglishButton.click(),- ]);-- const pdfFilePath2 = path.join(+ await expectPdfScreenshot(page, {downloadDir,- `${browserName}-${downloadWithoutDateOfSales.suggestedFilename()}`,- );-- await downloadWithoutDateOfSales.saveAs(pdfFilePath2);-- const pdfBytesWithoutDateOfSales = fs.readFileSync(pdfFilePath2);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, pdfBytesWithoutDateOfSales);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "date-of-sales-hidden-in-pdf-default-template.png",- );+ browserName,+ name: "date-of-sales-hidden-in-pdf-default-template.png",+ notes: `Test: ${testInfo.title} - date of sales hidden in PDF (${testInfo.project.name})`,+ });});});diff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/completes-full-invoice-flow-on-mobile-Desktop-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/completes-full-invoice-flow-on-mobile-Desktop-Chrome-darwin.pngdeleted file mode 100644index 9f89aa7..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/completes-full-invoice-flow-on-mobile-Desktop-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/completes-full-invoice-flow-on-mobile-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/completes-full-invoice-flow-on-mobile-Mobile-Chrome-darwin.pngindex 69f49b3..ea43dae 100644Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/completes-full-invoice-flow-on-mobile-Mobile-Chrome-darwin.png and b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/completes-full-invoice-flow-on-mobile-Mobile-Chrome-darwin.png differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/completes-full-invoice-flow-on-mobile-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/completes-full-invoice-flow-on-mobile-Mobile-Safari-darwin.pngindex 77da71f..b251114 100644Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/completes-full-invoice-flow-on-mobile-Mobile-Safari-darwin.png and b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/completes-full-invoice-flow-on-mobile-Mobile-Safari-darwin.png differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/completes-full-invoice-flow-on-mobile-stripe-template-Desktop-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/completes-full-invoice-flow-on-mobile-stripe-template-Desktop-Chrome-darwin.pngdeleted file mode 100644index c902a9c..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/completes-full-invoice-flow-on-mobile-stripe-template-Desktop-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/completes-full-invoice-flow-on-mobile-stripe-template-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/completes-full-invoice-flow-on-mobile-stripe-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index 790db77..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/completes-full-invoice-flow-on-mobile-stripe-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/completes-full-invoice-flow-on-mobile-stripe-template-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/completes-full-invoice-flow-on-mobile-stripe-template-Mobile-Safari-darwin.pngdeleted file mode 100644index 1b3ea4d..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/completes-full-invoice-flow-on-mobile-stripe-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/date-of-sales-hidden-in-pdf-default-template-Desktop-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/date-of-sales-hidden-in-pdf-default-template-Desktop-Chrome-darwin.pngindex dd504fb..e82a10e 100644Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/date-of-sales-hidden-in-pdf-default-template-Desktop-Chrome-darwin.png and b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/date-of-sales-hidden-in-pdf-default-template-Desktop-Chrome-darwin.png differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/date-of-sales-hidden-in-pdf-default-template-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/date-of-sales-hidden-in-pdf-default-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index 5d9b1cc..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/date-of-sales-hidden-in-pdf-default-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/date-of-sales-hidden-in-pdf-default-template-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/date-of-sales-hidden-in-pdf-default-template-Mobile-Safari-darwin.pngdeleted file mode 100644index 6aa7baf..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/date-of-sales-hidden-in-pdf-default-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/date-of-sales-visible-in-pdf-default-template-Desktop-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/date-of-sales-visible-in-pdf-default-template-Desktop-Chrome-darwin.pngindex e12cf33..59b3128 100644Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/date-of-sales-visible-in-pdf-default-template-Desktop-Chrome-darwin.png and b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/date-of-sales-visible-in-pdf-default-template-Desktop-Chrome-darwin.png differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/date-of-sales-visible-in-pdf-default-template-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/date-of-sales-visible-in-pdf-default-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index eb0a5b5..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/date-of-sales-visible-in-pdf-default-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/date-of-sales-visible-in-pdf-default-template-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/date-of-sales-visible-in-pdf-default-template-Mobile-Safari-darwin.pngdeleted file mode 100644index ceba97d..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/date-of-sales-visible-in-pdf-default-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/default-template-multi-pages-Desktop-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/default-template-multi-pages-Desktop-Chrome-darwin.pngdeleted file mode 100644index 1d65f46..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/default-template-multi-pages-Desktop-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/default-template-multi-pages-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/default-template-multi-pages-Mobile-Chrome-darwin.pngdeleted file mode 100644index d02a899..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/default-template-multi-pages-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/default-template-multi-pages-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/default-template-multi-pages-Mobile-Safari-darwin.pngdeleted file mode 100644index 1c32df4..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/default-template-multi-pages-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/displays-qr-code-in-pdf-default-template-Desktop-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/displays-qr-code-in-pdf-default-template-Desktop-Chrome-darwin.pngdeleted file mode 100644index bbeb677..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/displays-qr-code-in-pdf-default-template-Desktop-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/displays-qr-code-in-pdf-default-template-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/displays-qr-code-in-pdf-default-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index a7b8b43..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/displays-qr-code-in-pdf-default-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/displays-qr-code-in-pdf-default-template-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/displays-qr-code-in-pdf-default-template-Mobile-Safari-darwin.pngdeleted file mode 100644index 2cde4fd..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/displays-qr-code-in-pdf-default-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/displays-service-period-in-pdf-default-template-Desktop-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/displays-service-period-in-pdf-default-template-Desktop-Chrome-darwin.pngdeleted file mode 100644index 450f71d..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/displays-service-period-in-pdf-default-template-Desktop-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/displays-service-period-in-pdf-default-template-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/displays-service-period-in-pdf-default-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index ff32d49..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/displays-service-period-in-pdf-default-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/displays-service-period-in-pdf-default-template-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/displays-service-period-in-pdf-default-template-Mobile-Safari-darwin.pngdeleted file mode 100644index f6f021b..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/displays-service-period-in-pdf-default-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-English-Desktop-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-English-Desktop-Chrome-darwin.pngindex 4fabfd9..f81bc4c 100644Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-English-Desktop-Chrome-darwin.png and b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-English-Desktop-Chrome-darwin.png differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-English-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-English-Mobile-Chrome-darwin.pngdeleted file mode 100644index 1463b24..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-English-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-English-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-English-Mobile-Safari-darwin.pngdeleted file mode 100644index 6d6e88c..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-English-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-English-stripe-template-Desktop-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-English-stripe-template-Desktop-Chrome-darwin.pngdeleted file mode 100644index ba4672d..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-English-stripe-template-Desktop-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-English-stripe-template-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-English-stripe-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index ba4672d..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-English-stripe-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-English-stripe-template-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-English-stripe-template-Mobile-Safari-darwin.pngdeleted file mode 100644index 569440e..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-English-stripe-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-Polish-Desktop-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-Polish-Desktop-Chrome-darwin.pngindex 5677ccc..b90b445 100644Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-Polish-Desktop-Chrome-darwin.png and b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-Polish-Desktop-Chrome-darwin.png differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-Polish-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-Polish-Mobile-Chrome-darwin.pngdeleted file mode 100644index 94b51d7..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-Polish-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-Polish-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-Polish-Mobile-Safari-darwin.pngdeleted file mode 100644index cc5a523..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-Polish-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-Polish-stripe-template-Desktop-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-Polish-stripe-template-Desktop-Chrome-darwin.pngdeleted file mode 100644index c174bd8..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-Polish-stripe-template-Desktop-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-Polish-stripe-template-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-Polish-stripe-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index 6ec130b..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-Polish-stripe-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-Polish-stripe-template-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-Polish-stripe-template-Mobile-Safari-darwin.pngdeleted file mode 100644index 8cc6dc3..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/downloads-PDF-in-Polish-stripe-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/email-hidden-in-pdf-default-template-Desktop-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/email-hidden-in-pdf-default-template-Desktop-Chrome-darwin.pngdeleted file mode 100644index 506033c..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/email-hidden-in-pdf-default-template-Desktop-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/email-hidden-in-pdf-default-template-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/email-hidden-in-pdf-default-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index 2ca28c6..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/email-hidden-in-pdf-default-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/email-hidden-in-pdf-default-template-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/email-hidden-in-pdf-default-template-Mobile-Safari-darwin.pngdeleted file mode 100644index a761362..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/email-hidden-in-pdf-default-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/email-visible-in-pdf-default-template-Desktop-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/email-visible-in-pdf-default-template-Desktop-Chrome-darwin.pngdeleted file mode 100644index da6ac60..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/email-visible-in-pdf-default-template-Desktop-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/email-visible-in-pdf-default-template-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/email-visible-in-pdf-default-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index 9c604eb..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/email-visible-in-pdf-default-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/email-visible-in-pdf-default-template-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/email-visible-in-pdf-default-template-Mobile-Safari-darwin.pngdeleted file mode 100644index 7c2ced4..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/email-visible-in-pdf-default-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/pdf-with-logo-default-template-Desktop-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/pdf-with-logo-default-template-Desktop-Chrome-darwin.pngindex 6798c7b..c73791b 100644Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/pdf-with-logo-default-template-Desktop-Chrome-darwin.png and b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/pdf-with-logo-default-template-Desktop-Chrome-darwin.png differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/pdf-with-logo-default-template-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/pdf-with-logo-default-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index 80c9f11..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/pdf-with-logo-default-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/pdf-with-logo-default-template-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/pdf-with-logo-default-template-Mobile-Safari-darwin.pngdeleted file mode 100644index a8d9edf..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/pdf-with-logo-default-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/pdf-with-logo-stripe-template-after-switch-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/pdf-with-logo-stripe-template-after-switch-Mobile-Chrome-darwin.pngdeleted file mode 100644index e07c78d..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/pdf-with-logo-stripe-template-after-switch-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/pdf-with-logo-stripe-template-after-switch-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/pdf-with-logo-stripe-template-after-switch-Mobile-Safari-darwin.pngdeleted file mode 100644index e6fac2d..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/pdf-with-logo-stripe-template-after-switch-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/qr-code-hidden-in-pdf-default-template-Desktop-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/qr-code-hidden-in-pdf-default-template-Desktop-Chrome-darwin.pngdeleted file mode 100644index c90570d..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/qr-code-hidden-in-pdf-default-template-Desktop-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/qr-code-hidden-in-pdf-default-template-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/qr-code-hidden-in-pdf-default-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index 101fb58..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/qr-code-hidden-in-pdf-default-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/qr-code-hidden-in-pdf-default-template-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/qr-code-hidden-in-pdf-default-template-Mobile-Safari-darwin.pngdeleted file mode 100644index a548bb3..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/qr-code-hidden-in-pdf-default-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/service-period-hidden-in-pdf-default-template-Desktop-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/service-period-hidden-in-pdf-default-template-Desktop-Chrome-darwin.pngdeleted file mode 100644index 4327f89..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/service-period-hidden-in-pdf-default-template-Desktop-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/service-period-hidden-in-pdf-default-template-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/service-period-hidden-in-pdf-default-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index 8d8056d..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/service-period-hidden-in-pdf-default-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/service-period-hidden-in-pdf-default-template-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/service-period-hidden-in-pdf-default-template-Mobile-Safari-darwin.pngdeleted file mode 100644index 43a2fa0..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/service-period-hidden-in-pdf-default-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/should-display-and-persist-invoice-number-in-different-languages-Desktop-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/should-display-and-persist-invoice-number-in-different-languages-Desktop-Chrome-darwin.pngdeleted file mode 100644index 49e78be..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/should-display-and-persist-invoice-number-in-different-languages-Desktop-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/should-display-and-persist-invoice-number-in-different-languages-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/should-display-and-persist-invoice-number-in-different-languages-Mobile-Chrome-darwin.pngdeleted file mode 100644index 79a2a24..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/should-display-and-persist-invoice-number-in-different-languages-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/should-display-and-persist-invoice-number-in-different-languages-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/should-display-and-persist-invoice-number-in-different-languages-Mobile-Safari-darwin.pngdeleted file mode 100644index 2505b2e..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/should-display-and-persist-invoice-number-in-different-languages-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/should-display-and-persist-invoice-number-in-different-languages-stripe-template-Desktop-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/should-display-and-persist-invoice-number-in-different-languages-stripe-template-Desktop-Chrome-darwin.pngdeleted file mode 100644index ce24a14..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/should-display-and-persist-invoice-number-in-different-languages-stripe-template-Desktop-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/should-display-and-persist-invoice-number-in-different-languages-stripe-template-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/should-display-and-persist-invoice-number-in-different-languages-stripe-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index 33b550f..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/should-display-and-persist-invoice-number-in-different-languages-stripe-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/should-display-and-persist-invoice-number-in-different-languages-stripe-template-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/should-display-and-persist-invoice-number-in-different-languages-stripe-template-Mobile-Safari-darwin.pngdeleted file mode 100644index 9943585..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/should-display-and-persist-invoice-number-in-different-languages-stripe-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/update-pdf-when-invoice-data-changes-Desktop-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/update-pdf-when-invoice-data-changes-Desktop-Chrome-darwin.pngindex f90192c..f301f2c 100644Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/update-pdf-when-invoice-data-changes-Desktop-Chrome-darwin.png and b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/update-pdf-when-invoice-data-changes-Desktop-Chrome-darwin.png differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/update-pdf-when-invoice-data-changes-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/update-pdf-when-invoice-data-changes-Mobile-Chrome-darwin.pngdeleted file mode 100644index e4048e3..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/update-pdf-when-invoice-data-changes-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/update-pdf-when-invoice-data-changes-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/update-pdf-when-invoice-data-changes-Mobile-Safari-darwin.pngdeleted file mode 100644index a6cc192..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/update-pdf-when-invoice-data-changes-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/update-pdf-when-invoice-data-changes-stripe-template-Desktop-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/update-pdf-when-invoice-data-changes-stripe-template-Desktop-Chrome-darwin.pngdeleted file mode 100644index 2fe178b..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/update-pdf-when-invoice-data-changes-stripe-template-Desktop-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/update-pdf-when-invoice-data-changes-stripe-template-Mobile-Chrome-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/update-pdf-when-invoice-data-changes-stripe-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index 67af013..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/update-pdf-when-invoice-data-changes-stripe-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/update-pdf-when-invoice-data-changes-stripe-template-Mobile-Safari-darwin.png b/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/update-pdf-when-invoice-data-changes-stripe-template-Mobile-Safari-darwin.pngdeleted file mode 100644index 79ffbab..0000000Binary files a/e2e/default-invoice-template/default-invoice-template.test.ts-snapshots/update-pdf-when-invoice-data-changes-stripe-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/fixtures/app-logo.jpg b/e2e/fixtures/app-logo.jpgnew file mode 100644index 0000000..6c5ca8cBinary files /dev/null and b/e2e/fixtures/app-logo.jpg differdiff --git a/e2e/fixtures/app-logo.webp b/e2e/fixtures/app-logo.webpnew file mode 100644index 0000000..cc79628Binary files /dev/null and b/e2e/fixtures/app-logo.webp differdiff --git a/e2e/founder.test.ts b/e2e/founder.test.tsnew file mode 100644index 0000000..b6c23a7--- /dev/null+++ b/e2e/founder.test.ts@@ -0,0 +1,58 @@+import { expect, test } from "@playwright/test";++import { LINKEDIN_URL, TWITTER_URL } from "@/config";++test.describe("Founder page", () => {+ test("renders the founder page and its links", async ({ page }) => {+ const response = await page.goto("/founder");++ expect(response?.status()).toBe(200);+ await expect(page).toHaveURL("/founder");++ // Heading and tagline+ await expect(+ page.getByRole("heading", { name: "Vlad Sazonau", level: 1 }),+ ).toBeVisible();+ await expect(+ page.getByText("Software Engineer & Design Enthusiast"),+ ).toBeVisible();++ // Avatar (the page one, the footer has a smaller avatar with the same alt text)+ await expect(page.getByAltText("Vlad Sazonau").first()).toBeVisible();++ // Social links (the links are labelled with aria-label)+ const socialLinks = [+ { name: "Visit website", href: "https://vladsazon.com" },+ { name: "Visit Twitter", href: TWITTER_URL },+ { name: "Visit LinkedIn", href: LINKEDIN_URL },+ // the personal GitHub profile, not the repository+ { name: "Visit GitHub", href: "https://github.com/VladSez" },+ ] as const;++ for (const { name, href } of socialLinks) {+ const link = page.getByRole("link", { name, exact: true });++ await expect(link).toBeVisible();+ await expect(link).toHaveAttribute("href", href);+ await expect(link).toHaveAttribute("target", "_blank");+ }+ });++ test("is reachable from the footer link", async ({ page }) => {+ await page.goto("/en/about");++ const footerFounderLink = page+ .getByRole("contentinfo")+ .getByTestId("footer-social-links")+ .getByRole("link", { name: "Founder", exact: true });++ await expect(footerFounderLink).toBeVisible();++ await footerFounderLink.click();++ await expect(page).toHaveURL("/founder");+ await expect(+ page.getByRole("heading", { name: "Vlad Sazonau", level: 1 }),+ ).toBeVisible();+ });+});diff --git a/e2e/generate-invoice-link.test.ts b/e2e/generate-invoice-link.test.tsindex 0ddcd48..6931e72 100644--- a/e2e/generate-invoice-link.test.ts+++ b/e2e/generate-invoice-link.test.ts@@ -1,6 +1,7 @@-import type { BuyerData, SellerData } from "@/app/schema";import { expect, test } from "@playwright/test";+import type { BuyerData, SellerData } from "@/app/schema";+const TEST_SELLER_DATA = {name: "TEST SELLER COMPANY",address: "123 Test St",@@ -44,281 +45,305 @@ test.describe("Generate Invoice Link (Get link)", () => {await expect(page).toHaveURL("/?template=default");});- test("can share invoice and data is persisted in new tab", async ({- page,- context,- }) => {- // Verify shared invoice badge is NOT visible before sharing- await expect(page.getByTestId("shared-invoice-badge")).toBeHidden();-- // Fill in some test data- const invoiceNumberFieldset = page.getByRole("group", {- name: "Invoice Number",- });-- const invoiceNumberValueField = invoiceNumberFieldset.getByRole("textbox", {- name: "Value",- });-- await invoiceNumberValueField.fill("SHARE-TEST-001");-- const finalSection = page.getByTestId(`final-section`);-- await finalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill("Test note for sharing");-- // Fill in seller information- const sellerSection = page.getByTestId("seller-information-section");- await sellerSection- .getByRole("textbox", { name: "Name" })- .fill(TEST_SELLER_DATA.name);- await sellerSection- .getByRole("textbox", { name: "Address" })- .fill(TEST_SELLER_DATA.address);- await sellerSection- .getByRole("textbox", { name: "Email" })- .fill(TEST_SELLER_DATA.email);-- // fill in seller tax number- const sellerVatNumberFieldset = sellerSection.getByRole("group", {- name: "Seller Tax Number",- });+ test(+ "can share invoice and data is persisted in new tab",+ {+ // the URL encoded/compressed invoice state round trip, a likely place for a+ // Gecko vs Chromium divergence to hide+ tag: "@firefox-smoke",+ },+ async ({ page, context }) => {+ // Verify shared invoice badge is NOT visible before sharing+ await expect(page.getByTestId("shared-invoice-badge")).toBeHidden();++ // Fill in some test data+ const invoiceNumberFieldset = page.getByRole("group", {+ name: "Invoice Number",+ });- await sellerVatNumberFieldset- .getByRole("textbox", { name: "Label" })- .fill(TEST_SELLER_DATA.vatNoLabelText);+ const invoiceNumberValueField = invoiceNumberFieldset.getByRole(+ "textbox",+ {+ name: "Value",+ },+ );- await sellerVatNumberFieldset- .getByRole("textbox", { name: "Value" })- .fill(TEST_SELLER_DATA.vatNo);+ await invoiceNumberValueField.fill("SHARE-TEST-001");- // Fill in buyer information- const buyerSection = page.getByTestId("buyer-information-section");- await buyerSection- .getByRole("textbox", { name: "Name" })- .fill(TEST_BUYER_DATA.name);- await buyerSection- .getByRole("textbox", { name: "Address" })- .fill(TEST_BUYER_DATA.address);- await buyerSection- .getByRole("textbox", { name: "Email" })- .fill(TEST_BUYER_DATA.email);+ const finalSection = page.getByTestId(`final-section`);- // fill in buyer tax number- const buyerVatNumberFieldset = buyerSection.getByRole("group", {- name: "Buyer Tax Number",- });+ await finalSection+ .getByRole("textbox", { name: "Notes", exact: true })+ .fill("Test note for sharing");- await buyerVatNumberFieldset- .getByRole("textbox", { name: "Label" })- .fill(TEST_BUYER_DATA.vatNoLabelText);+ // Fill in seller information+ const sellerSection = page.getByTestId("seller-information-section");+ await sellerSection+ .getByRole("textbox", { name: "Name" })+ .fill(TEST_SELLER_DATA.name);+ await sellerSection+ .getByRole("textbox", { name: "Address" })+ .fill(TEST_SELLER_DATA.address);+ await sellerSection+ .getByRole("textbox", { name: "Email" })+ .fill(TEST_SELLER_DATA.email);++ // fill in seller tax number+ const sellerVatNumberFieldset = sellerSection.getByRole("group", {+ name: "Seller Tax Number",+ });- await buyerVatNumberFieldset- .getByRole("textbox", { name: "Value" })- .fill(TEST_BUYER_DATA.vatNo);+ await sellerVatNumberFieldset+ .getByRole("textbox", { name: "Label" })+ .fill(TEST_SELLER_DATA.vatNoLabelText);- // Fill in an invoice item- const invoiceItemsSection = page.getByTestId("invoice-items-section");+ await sellerVatNumberFieldset+ .getByRole("textbox", { name: "Value" })+ .fill(TEST_SELLER_DATA.vatNo);- await invoiceItemsSection- .getByRole("spinbutton", { name: "Amount (Quantity)" })- .fill("5");+ // Fill in buyer information+ const buyerSection = page.getByTestId("buyer-information-section");+ await buyerSection+ .getByRole("textbox", { name: "Name" })+ .fill(TEST_BUYER_DATA.name);+ await buyerSection+ .getByRole("textbox", { name: "Address" })+ .fill(TEST_BUYER_DATA.address);+ await buyerSection+ .getByRole("textbox", { name: "Email" })+ .fill(TEST_BUYER_DATA.email);++ // fill in buyer tax number+ const buyerVatNumberFieldset = buyerSection.getByRole("group", {+ name: "Buyer Tax Number",+ });- await invoiceItemsSection- .getByRole("spinbutton", {- name: "Net Price (Rate or Unit Price)",- })- .fill("100");+ await buyerVatNumberFieldset+ .getByRole("textbox", { name: "Label" })+ .fill(TEST_BUYER_DATA.vatNoLabelText);- const taxSettingsFieldset = invoiceItemsSection.getByRole("group", {- name: "Tax Settings",- });+ await buyerVatNumberFieldset+ .getByRole("textbox", { name: "Value" })+ .fill(TEST_BUYER_DATA.vatNo);- // Update the Tax Settings "Tax Label" field to a new value (e.g., "Custom VAT")- await taxSettingsFieldset- .getByRole("textbox", { name: "Tax Label" })- .fill("Custom VAT");+ // Fill in an invoice item+ const invoiceItemsSection = page.getByTestId("invoice-items-section");- await taxSettingsFieldset- .getByRole("textbox", { name: "VAT Rate" })- .fill("23");+ await invoiceItemsSection+ .getByRole("spinbutton", { name: "Amount (Quantity)" })+ .fill("5");- // check total- const totalField = finalSection.getByRole("textbox", {- name: "Total",- exact: true,- });- await expect(totalField).toHaveValue("615.00");+ await invoiceItemsSection+ .getByRole("spinbutton", {+ name: "Net Price (Rate or Unit Price)",+ })+ .fill("100");- // check QR code data field- const qrCodeFieldset = finalSection.getByRole("group", {- name: "QR Code",- });+ const taxSettingsFieldset = invoiceItemsSection.getByRole("group", {+ name: "Tax Settings",+ });- // check QR code data field- const qrCodeDataField = qrCodeFieldset.getByRole("textbox", {- name: "Data",- });+ // Update the Tax Settings "Tax Label" field to a new value (e.g., "Custom VAT")+ await taxSettingsFieldset+ .getByRole("textbox", { name: "Tax Label" })+ .fill("Custom VAT");- await qrCodeDataField.fill("https://easyinvoicepdf.com");+ await taxSettingsFieldset+ .getByRole("textbox", { name: "VAT Rate" })+ .fill("23");- // check QR code description field- const qrCodeDescriptionField = qrCodeFieldset.getByRole("textbox", {- name: "Description (optional)",- });+ // check total+ const totalField = finalSection.getByRole("textbox", {+ name: "Total",+ exact: true,+ });+ await expect(totalField).toHaveValue("615.00");- await qrCodeDescriptionField.fill("QR Code TEST Description");+ // check QR code data field+ const qrCodeFieldset = finalSection.getByRole("group", {+ name: "QR Code",+ });- // wait for debounce timeout- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);+ // check QR code data field+ const qrCodeDataField = qrCodeFieldset.getByRole("textbox", {+ name: "Data",+ });- // Generate share link- await page.getByRole("button", { name: "Get link" }).click();+ await qrCodeDataField.fill("https://easyinvoicepdf.com");- // Wait for URL to update with share data- await page.waitForURL((url) => url.searchParams.has("data"));+ // check QR code description field+ const qrCodeDescriptionField = qrCodeFieldset.getByRole("textbox", {+ name: "Description (optional)",+ });- // Get the current URL which should now contain the share data- const sharedUrl = page.url();- expect(sharedUrl).toContain("?template=default&data=");+ await qrCodeDescriptionField.fill("QR Code TEST Description");- // Open URL in new tab- const newPage = await context.newPage();- await newPage.goto(sharedUrl);+ // wait for debounce timeout+ // eslint-disable-next-line playwright/no-wait-for-timeout+ await page.waitForTimeout(700);- // Verify the URL contains the shared invoice data- await expect(newPage).toHaveURL(/\?template=default&data=/);+ // Generate share link+ await page.getByRole("button", { name: "Get link" }).click();- // Get elements from the new page context- const newInvoiceNumberFieldset = newPage.getByRole("group", {- name: "Invoice Number",- });+ // Wait for URL to update with share data+ await page.waitForURL((url) => {+ return url.searchParams.has("data");+ });- /* VERIFY DATA IS LOADED IN NEW TAB */+ // Get the current URL which should now contain the share data+ const sharedUrl = page.url();+ expect(sharedUrl).toContain("?template=default&data=");- await expect(- newInvoiceNumberFieldset.getByRole("textbox", { name: "Value" }),- ).toHaveValue("SHARE-TEST-001");+ // Open URL in new tab+ const newPage = await context.newPage();+ await newPage.goto(sharedUrl);- const newPageFinalSection = newPage.getByTestId(`final-section`);+ // Verify the URL contains the shared invoice data+ await expect(newPage).toHaveURL(/\?template=default&data=/);- await expect(- newPageFinalSection.getByRole("textbox", { name: "Notes", exact: true }),- ).toHaveValue("Test note for sharing");+ // Get elements from the new page context+ const newInvoiceNumberFieldset = newPage.getByRole("group", {+ name: "Invoice Number",+ });- // Verify seller information- const newSellerSection = newPage.getByTestId("seller-information-section");+ /* VERIFY DATA IS LOADED IN NEW TAB */- await expect(- newSellerSection.getByRole("textbox", { name: "Name" }),- ).toHaveValue(TEST_SELLER_DATA.name);+ await expect(+ newInvoiceNumberFieldset.getByRole("textbox", { name: "Value" }),+ ).toHaveValue("SHARE-TEST-001");- await expect(- newSellerSection.getByRole("textbox", { name: "Address" }),- ).toHaveValue(TEST_SELLER_DATA.address);+ const newPageFinalSection = newPage.getByTestId(`final-section`);- await expect(- newSellerSection.getByRole("textbox", { name: "Email" }),- ).toHaveValue(TEST_SELLER_DATA.email);+ await expect(+ newPageFinalSection.getByRole("textbox", {+ name: "Notes",+ exact: true,+ }),+ ).toHaveValue("Test note for sharing");- // Verify seller tax number- const newSellerVatNumberFieldset = newSellerSection.getByRole("group", {- name: "Seller Tax Number",- });+ // Verify seller information+ const newSellerSection = newPage.getByTestId(+ "seller-information-section",+ );- await expect(- newSellerVatNumberFieldset.getByRole("textbox", { name: "Label" }),- ).toHaveValue(TEST_SELLER_DATA.vatNoLabelText);+ await expect(+ newSellerSection.getByRole("textbox", { name: "Name" }),+ ).toHaveValue(TEST_SELLER_DATA.name);- await expect(- newSellerVatNumberFieldset.getByRole("textbox", { name: "Value" }),- ).toHaveValue(TEST_SELLER_DATA.vatNo);+ await expect(+ newSellerSection.getByRole("textbox", { name: "Address" }),+ ).toHaveValue(TEST_SELLER_DATA.address);- // Verify buyer information- const newBuyerSection = newPage.getByTestId("buyer-information-section");+ await expect(+ newSellerSection.getByRole("textbox", { name: "Email" }),+ ).toHaveValue(TEST_SELLER_DATA.email);- await expect(- newBuyerSection.getByRole("textbox", { name: "Name" }),- ).toHaveValue(TEST_BUYER_DATA.name);+ // Verify seller tax number+ const newSellerVatNumberFieldset = newSellerSection.getByRole("group", {+ name: "Seller Tax Number",+ });- await expect(- newBuyerSection.getByRole("textbox", { name: "Address" }),- ).toHaveValue(TEST_BUYER_DATA.address);+ await expect(+ newSellerVatNumberFieldset.getByRole("textbox", { name: "Label" }),+ ).toHaveValue(TEST_SELLER_DATA.vatNoLabelText);- await expect(- newBuyerSection.getByRole("textbox", { name: "Email" }),- ).toHaveValue(TEST_BUYER_DATA.email);+ await expect(+ newSellerVatNumberFieldset.getByRole("textbox", { name: "Value" }),+ ).toHaveValue(TEST_SELLER_DATA.vatNo);- // Verify buyer tax number- const newBuyerVatNumberFieldset = newBuyerSection.getByRole("group", {- name: "Buyer Tax Number",- });+ // Verify buyer information+ const newBuyerSection = newPage.getByTestId("buyer-information-section");- await expect(- newBuyerVatNumberFieldset.getByRole("textbox", { name: "Label" }),- ).toHaveValue(TEST_BUYER_DATA.vatNoLabelText);+ await expect(+ newBuyerSection.getByRole("textbox", { name: "Name" }),+ ).toHaveValue(TEST_BUYER_DATA.name);- await expect(- newBuyerVatNumberFieldset.getByRole("textbox", { name: "Value" }),- ).toHaveValue(TEST_BUYER_DATA.vatNo);+ await expect(+ newBuyerSection.getByRole("textbox", { name: "Address" }),+ ).toHaveValue(TEST_BUYER_DATA.address);- // Verify invoice item- const newInvoiceItemsSection = newPage.getByTestId("invoice-items-section");+ await expect(+ newBuyerSection.getByRole("textbox", { name: "Email" }),+ ).toHaveValue(TEST_BUYER_DATA.email);- await expect(- newInvoiceItemsSection.getByRole("spinbutton", {- name: "Amount (Quantity)",- }),- ).toHaveValue("5");- await expect(- newInvoiceItemsSection.getByRole("spinbutton", {- name: "Net Price (Rate or Unit Price)",- }),- ).toHaveValue("100");+ // Verify buyer tax number+ const newBuyerVatNumberFieldset = newBuyerSection.getByRole("group", {+ name: "Buyer Tax Number",+ });- const newTaxSettingsFieldset = newInvoiceItemsSection.getByRole("group", {- name: "Tax Settings",- });- await expect(- newTaxSettingsFieldset.getByRole("textbox", { name: "Tax Label" }),- ).toHaveValue("Custom VAT");+ await expect(+ newBuyerVatNumberFieldset.getByRole("textbox", { name: "Label" }),+ ).toHaveValue(TEST_BUYER_DATA.vatNoLabelText);- await expect(- newTaxSettingsFieldset.getByRole("textbox", { name: "Custom VAT Rate" }),- ).toHaveValue("23");+ await expect(+ newBuyerVatNumberFieldset.getByRole("textbox", { name: "Value" }),+ ).toHaveValue(TEST_BUYER_DATA.vatNo);- const newFinalSection = newPage.getByTestId(`final-section`);+ // Verify invoice item+ const newInvoiceItemsSection = newPage.getByTestId(+ "invoice-items-section",+ );- await expect(- newFinalSection.getByRole("textbox", {- name: "Total",- exact: true,- }),- ).toHaveValue("615.00");+ await expect(+ newInvoiceItemsSection.getByRole("spinbutton", {+ name: "Amount (Quantity)",+ }),+ ).toHaveValue("5");+ await expect(+ newInvoiceItemsSection.getByRole("spinbutton", {+ name: "Net Price (Rate or Unit Price)",+ }),+ ).toHaveValue("100");- // Verify QR code data field- const newQrCodeDataField = newPageFinalSection.getByRole("textbox", {- name: "Data",- });- await expect(newQrCodeDataField).toHaveValue("https://easyinvoicepdf.com");+ const newTaxSettingsFieldset = newInvoiceItemsSection.getByRole("group", {+ name: "Tax Settings",+ });+ await expect(+ newTaxSettingsFieldset.getByRole("textbox", { name: "Tax Label" }),+ ).toHaveValue("Custom VAT");++ await expect(+ newTaxSettingsFieldset.getByRole("textbox", {+ name: "Custom VAT Rate",+ }),+ ).toHaveValue("23");++ const newFinalSection = newPage.getByTestId(`final-section`);++ await expect(+ newFinalSection.getByRole("textbox", {+ name: "Total",+ exact: true,+ }),+ ).toHaveValue("615.00");++ // Verify QR code data field+ const newQrCodeDataField = newPageFinalSection.getByRole("textbox", {+ name: "Data",+ });+ await expect(newQrCodeDataField).toHaveValue(+ "https://easyinvoicepdf.com",+ );- // Verify QR code description field- const newQrCodeDescriptionField = newPageFinalSection.getByRole("textbox", {- name: "Description (optional)",- });+ // Verify QR code description field+ const newQrCodeDescriptionField = newPageFinalSection.getByRole(+ "textbox",+ {+ name: "Description (optional)",+ },+ );- await expect(newQrCodeDescriptionField).toHaveValue(- "QR Code TEST Description",- );+ await expect(newQrCodeDescriptionField).toHaveValue(+ "QR Code TEST Description",+ );- // Verify shared invoice badge is visible on the new page- const sharedInvoiceBadge = newPage.getByTestId("shared-invoice-badge");+ // Verify shared invoice badge is visible on the new page+ const sharedInvoiceBadge = newPage.getByTestId("shared-invoice-badge");- await expect(sharedInvoiceBadge).toBeVisible();- await expect(sharedInvoiceBadge).toHaveText("Shared invoice");- });+ await expect(sharedInvoiceBadge).toBeVisible();+ await expect(sharedInvoiceBadge).toHaveText("Shared invoice");+ },+ );test("shows error notification when invoice link is broken", async ({page,@@ -665,7 +690,9 @@ test.describe("Generate Invoice Link (Get link)", () => {).toBeVisible();// Wait for URL to update with share data- await page.waitForURL((url) => url.searchParams.has("data"));+ await page.waitForURL((url) => {+ return url.searchParams.has("data");+ });// Get the current URL which should now contain the share dataconst sharedUrl = page.url();diff --git a/e2e/how-it-works.test.ts b/e2e/how-it-works.test.tsindex f8900fb..b87f2aa 100644--- a/e2e/how-it-works.test.ts+++ b/e2e/how-it-works.test.ts@@ -1,3 +1,5 @@+import { expect, test } from "@playwright/test";+import {DISCORD_COMMUNITY_URL,REDDIT_COMMUNITY_URL,@@ -5,7 +7,6 @@ import {YOUTUBE_VIDEO_HOW_TO_ADD_BUYER,YOUTUBE_VIDEO_HOW_TO_ADD_SELLER,} from "@/config";-import { expect, test } from "@playwright/test";test.describe("How it works page", () => {test("should display page content and video tutorials", async ({ page }) => {diff --git a/e2e/invoice-form.test.ts b/e2e/invoice-form.test.tsindex 7ca51e8..b52994b 100644--- a/e2e/invoice-form.test.ts+++ b/e2e/invoice-form.test.ts@@ -1,3 +1,7 @@+import { expect, test } from "@playwright/test";+import dayjs from "dayjs";++import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";import {ACCORDION_STATE_LOCAL_STORAGE_KEY,CURRENCY_SYMBOLS,@@ -11,10 +15,6 @@ import {type AccordionState,type InvoiceData,} from "@/app/schema";-import { expect, test } from "@playwright/test";-import dayjs from "dayjs";-import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";-import { INITIAL_INVOICE_DATA } from "../src/app/constants";import {DISCORD_COMMUNITY_URL,GITHUB_URL,@@ -24,6 +24,8 @@ import {YOUTUBE_VIDEO_HOW_TO_ADD_SELLER,} from "@/config";+import { INITIAL_INVOICE_DATA } from "../src/app/constants";+test.describe("Invoice Generator Page", () => {test.beforeEach(async ({ page }) => {await page.goto("/?template=default");@@ -246,6 +248,106 @@ test.describe("Invoice Generator Page", () => {await expect(termsOfServiceLinkDesktop).toHaveAttribute("href", "/tos");});+ test("keeps a form edit made right before switching to the preview tab", async ({+ page,+ isMobile,+ }) => {+ // the tabs only exist in the mobile layout+ // eslint-disable-next-line playwright/no-skipped-test -- mobile UI flow, mobile projects only+ test.skip(!isMobile, "mobile only flow, runs on the mobile projects");++ const NEW_INVOICE_NUMBER = "QUICK-TAB-SWITCH/2026";++ const invoiceNumberValueInput = page+ .getByRole("group", { name: "Invoice Number" })+ .getByRole("textbox", { name: "Value" });++ await expect(invoiceNumberValueInput).toHaveValue(+ INITIAL_INVOICE_DATA.invoiceNumberObject.value,+ );++ // The form saves itself to localStorage (and regenerates the PDF) on a debounce, so+ // leaving the tab right after typing used to unmount the form mid debounce and drop+ // the edit. No wait between the two actions on purpose: the switch has to happen+ // inside the debounce window for this to test anything.+ await invoiceNumberValueInput.fill(NEW_INVOICE_NUMBER);+ await page.getByRole("tab", { name: "Preview PDF" }).click();++ await expect(+ page.getByRole("tab", { name: "Preview PDF" }),+ ).toHaveAttribute("aria-selected", "true");++ // the pending save still lands, even though the form tab is closed by now+ await expect+ .poll(async () => {+ const storedData = await page.evaluate((key) => {+ return localStorage.getItem(key);+ }, PDF_DATA_LOCAL_STORAGE_KEY);++ return storedData+ ? (JSON.parse(storedData) as InvoiceData).invoiceNumberObject?.value+ : null;+ })+ .toBe(NEW_INVOICE_NUMBER);++ // and the edit is still there when the user comes back to the form+ await page.getByRole("tab", { name: "Edit Invoice" }).click();++ await expect(invoiceNumberValueInput).toHaveValue(NEW_INVOICE_NUMBER);+ });++ test("commits a pending form edit when leaving the form tab", async ({+ page,+ isMobile,+ }) => {+ // the tabs only exist in the mobile layout+ // eslint-disable-next-line playwright/no-skipped-test -- mobile UI flow, mobile projects only+ test.skip(!isMobile, "mobile only flow, runs on the mobile projects");++ const NEW_INVOICE_NUMBER = "FLUSHED-ON-TAB-SWITCH/2026";++ const readStoredInvoice = () => {+ return page.evaluate((key) => {+ return String(localStorage.getItem(key));+ }, PDF_DATA_LOCAL_STORAGE_KEY);+ };++ // Pausing the clock takes the 500ms debounce out of the picture entirely: it can no+ // longer fire on its own, so anything that reaches localStorage below got there+ // because leaving the form tab flushed it. `install()` alone is not enough, the fake+ // clock keeps ticking until it is paused.+ await page.clock.install();+ await page.goto("/?template=default");++ // pause ahead of where the page's fake clock already is: `pauseAt` fast forwards to+ // the given time and rejects a target that is already in the past, so the margin has+ // to outlast the round trip that reads the clock (100ms did not, once the suite ran+ // its workers in parallel). It also has to stay under the app's own idle timers, so+ // the jump does not fire them - the earliest of those is the changelog popup at+ // 1500ms.+ const CLOCK_PAUSE_MARGIN = 1000;++ const pageTime = await page.evaluate(() => {+ return Date.now();+ });++ await page.clock.pauseAt(new Date(pageTime + CLOCK_PAUSE_MARGIN));++ const invoiceNumberValueInput = page+ .getByRole("group", { name: "Invoice Number" })+ .getByRole("textbox", { name: "Value" });++ await invoiceNumberValueInput.fill(NEW_INVOICE_NUMBER);++ // the debounce is frozen, so nothing has been written yet+ expect(await readStoredInvoice()).not.toContain(NEW_INVOICE_NUMBER);++ await page.getByRole("tab", { name: "Preview PDF" }).click();++ // ...and switching tabs commits it right away instead of waiting out the debounce+ await expect.poll(readStoredInvoice).toContain(NEW_INVOICE_NUMBER);+ });+test("displays initial form state correctly", async ({ page }) => {// **CHECK GENERAL INFORMATION SECTION**const generalInfoSection = page.getByTestId(`general-information-section`);@@ -788,7 +890,9 @@ test.describe("Invoice Generator Page", () => {).toBeVisible();await expect(- page.getByText('Are you sure you want to delete the invoice item "#2"?'),+ page.getByText(+ 'Are you sure you want to delete the invoice item "TEST INVOICE ITEM"?',+ ),).toBeVisible();// --- Test cancel flow first ---@@ -802,7 +906,9 @@ test.describe("Invoice Generator Page", () => {).toBeHidden();await expect(- page.getByText('Are you sure you want to delete the invoice item "#2"?'),+ page.getByText(+ 'Are you sure you want to delete the invoice item "TEST INVOICE ITEM"?',+ ),).toBeHidden();// Item should still be present@@ -1028,69 +1134,79 @@ test.describe("Invoice Generator Page", () => {await expect(page.getByLabel("Notifications alt+T")).toBeHidden();});- test("persists data in local storage", async ({ page }) => {- // Fill in some data- const invoiceNumberFieldset = page.getByRole("group", {- name: "Invoice Number",- });-- const invoiceNumberValueField = invoiceNumberFieldset.getByRole("textbox", {- name: "Value",- });+ test(+ "persists data in local storage",+ {+ // form state -> localStorage -> rehydrate on reload, verified on Gecko too+ tag: "@firefox-smoke",+ },+ async ({ page }) => {+ // Fill in some data+ const invoiceNumberFieldset = page.getByRole("group", {+ name: "Invoice Number",+ });++ const invoiceNumberValueField = invoiceNumberFieldset.getByRole(+ "textbox",+ {+ name: "Value",+ },+ );- await invoiceNumberValueField.fill("TEST/2024");+ await invoiceNumberValueField.fill("TEST/2024");- const finalSection = page.getByTestId(`final-section`);+ const finalSection = page.getByTestId(`final-section`);- await finalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill("Test note");+ await finalSection+ .getByRole("textbox", { name: "Notes", exact: true })+ .fill("Test note");- // Check that "Invoice last updated:" text is displayed after filling in the data- await expect(- page.getByText("Invoice last updated:", { exact: false }),- ).toBeVisible();+ // Check that "Invoice last updated:" text is displayed after filling in the data+ await expect(+ page.getByText("Invoice last updated:", { exact: false }),+ ).toBeVisible();- // Wait a moment for any debounced localStorage updates- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(500);+ // Wait a moment for any debounced localStorage updates+ // eslint-disable-next-line playwright/no-wait-for-timeout+ await page.waitForTimeout(500);- // Verify data is actually saved in localStorage- const storedData = (await page.evaluate((key) => {- return localStorage.getItem(key);- }, PDF_DATA_LOCAL_STORAGE_KEY)) as string;+ // Verify data is actually saved in localStorage+ const storedData = (await page.evaluate((key) => {+ return localStorage.getItem(key);+ }, PDF_DATA_LOCAL_STORAGE_KEY)) as string;- expect(storedData).toBeTruthy();+ expect(storedData).toBeTruthy();- const parsedData = JSON.parse(storedData) as InvoiceData;- expect(parsedData).toMatchObject({- invoiceNumberObject: {- label: "Invoice No. of:",- value: "TEST/2024",- },- notes: "Test note",- } satisfies Pick<InvoiceData, "notes" | "invoiceNumberObject">);+ const parsedData = JSON.parse(storedData) as InvoiceData;+ expect(parsedData).toMatchObject({+ invoiceNumberObject: {+ label: "Invoice No. of:",+ value: "TEST/2024",+ },+ notes: "Test note",+ } satisfies Pick<InvoiceData, "notes" | "invoiceNumberObject">);- // Reload page- await page.reload();+ // Reload page+ await page.reload();- // Check if data persists in UI- const invoiceNumberFieldset2 = page.getByRole("group", {- name: "Invoice Number",- });+ // Check if data persists in UI+ const invoiceNumberFieldset2 = page.getByRole("group", {+ name: "Invoice Number",+ });- const invoiceNumberValueField2 = invoiceNumberFieldset2.getByRole(- "textbox",- {- name: "Value",- },- );- await expect(invoiceNumberValueField2).toHaveValue("TEST/2024");+ const invoiceNumberValueField2 = invoiceNumberFieldset2.getByRole(+ "textbox",+ {+ name: "Value",+ },+ );+ await expect(invoiceNumberValueField2).toHaveValue("TEST/2024");- await expect(- finalSection.getByRole("textbox", { name: "Notes", exact: true }),- ).toHaveValue("Test note");- });+ await expect(+ finalSection.getByRole("textbox", { name: "Notes", exact: true }),+ ).toHaveValue("Test note");+ },+ );test("handles currency switching", async ({ page }) => {const invoiceItemsSection = page.getByTestId(`invoice-items-section`);diff --git a/e2e/invoice-templates-common/shared-template-features.test.ts b/e2e/invoice-templates-common/shared-template-features.test.tsnew file mode 100644index 0000000..3676d5b--- /dev/null+++ b/e2e/invoice-templates-common/shared-template-features.test.ts@@ -0,0 +1,661 @@+import type { Locator, Page } from "@playwright/test";++import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import type { SupportedTemplates } from "@/app/schema";++// IMPORTANT: we use custom extended test fixture that provides a temporary download directory for each test+import { expect, test } from "../utils/extended-playwright-test";+import {+ expectPdfScreenshot,+ waitForPdfRegeneration,+} from "../utils/pdf-download";++/**+ * Features that behave the same way in **both** invoice templates.+ *+ * Every test in this file runs once per template, so that we don't have to keep+ * two near-identical copies of the same test in+ * `default-invoice-template.test.ts` and `stripe-invoice-template.test.ts`.+ *+ * Template specific behaviour lives in the per-template test files.+ */+const TEMPLATES = [+ "default",+ "stripe",+] as const satisfies readonly SupportedTemplates[];++type Template = (typeof TEMPLATES)[number];++/**+ * Selects the given template. The app starts on the default template, so this is+ * a no-op check for it and a template switch for the Stripe one.+ */+async function selectTemplate(page: Page, template: Template) {+ if (template !== "default") {+ await page+ .getByRole("combobox", { name: "Invoice Template" })+ .selectOption(template);+ }++ await page.waitForURL(`/?template=${template}`);+ await expect(page).toHaveURL(`/?template=${template}`);+}++/**+ * The "Service period"/"Date of sales" PDF label inputs only exist for the default+ * template — the Stripe PDF template does not print these labels at all.+ */+async function expectServicePeriodPdfLabels(+ servicePeriodFieldset: Locator,+ template: Template,+ expectedServicePeriodLabel: string,+) {+ const servicePeriodLabelInput = servicePeriodFieldset.getByRole("textbox", {+ name: "Service period PDF label",+ });++ if (template === "default") {+ await expect(servicePeriodLabelInput).toHaveValue(+ expectedServicePeriodLabel,+ );+ return;+ }++ await expect(servicePeriodLabelInput).toBeHidden();+ await expect(+ servicePeriodFieldset.getByRole("textbox", {+ name: "Date of sales PDF label",+ }),+ ).toBeHidden();+}++/**+ * Sets a custom "Service period" PDF label (default template only) and verifies+ * that the "reset to default" helper shows up.+ */+async function fillCustomServicePeriodPdfLabel(+ servicePeriodFieldset: Locator,+ template: Template,+ customLabel: string,+) {+ if (template !== "default") {+ return;+ }++ const servicePeriodLabelInput = servicePeriodFieldset.getByRole("textbox", {+ name: "Service period PDF label",+ });++ await servicePeriodLabelInput.fill(customLabel);+ await expect(servicePeriodLabelInput).toHaveValue(customLabel);++ // Check that the reset helper is displayed+ await expect(+ servicePeriodFieldset.getByRole("button", {+ name: 'Reset to default ("Service period")',+ }),+ ).toBeVisible();+}++async function expectCustomServicePeriodPdfLabel(+ servicePeriodFieldset: Locator,+ template: Template,+ customLabel: string,+) {+ if (template !== "default") {+ return;+ }++ await expect(+ servicePeriodFieldset.getByRole("textbox", {+ name: "Service period PDF label",+ }),+ ).toHaveValue(customLabel);+}++/**+ * Renames the tax label of the first invoice item (default template only, the+ * Stripe template always uses the built-in VAT label).+ */+async function fillFirstItemTaxLabel(+ invoiceItemsSection: Locator,+ taxLabel: string | null,+) {+ if (!taxLabel) {+ return;+ }++ const firstItemTaxSettingsFieldset = invoiceItemsSection+ .getByRole("group", { name: "Item 1" })+ .getByRole("group", { name: "Tax Settings" });++ await firstItemTaxSettingsFieldset+ .getByRole("textbox", { name: "Tax Label" })+ .fill(taxLabel);+}++/**+ * The two templates lay out items differently, so each one uses its own item+ * data to exercise its layout: the default template checks a custom tax label+ * and long wrapping names, the Stripe one mixes short and long descriptions.+ */+const MULTI_PAGE_ITEMS = {+ default: {+ taxLabel: "Sales Tax",+ taxRateFieldName: "Sales Tax Rate",+ itemName: (itemNumber: number) => {+ return `Item ${itemNumber}. Some long item name that should be wrapped to the next line. Some long item name that should be wrapped to the next line. Some long item name that should be wrapped to the next line.`;+ },+ netPrice: (itemNumber: number) => {+ return `${1000 * (itemNumber - 1)}`;+ },+ },+ stripe: {+ taxLabel: null,+ taxRateFieldName: "VAT Rate",+ // Add longer descriptions only to odd-numbered items to test mixed content layout+ // This verifies that the PDF template handles varying text lengths correctly+ // and maintains proper spacing between short and long item descriptions+ itemName: (itemNumber: number) => {+ return itemNumber % 2 === 1+ ? `Item ${itemNumber} - Professional consulting services including detailed analysis, comprehensive reporting, and ongoing support for enterprise-level implementations`+ : `Item ${itemNumber}`;+ },+ netPrice: (itemNumber: number) => {+ return `${100 * (itemNumber - 1)}`;+ },+ },+} as const satisfies Record<Template, unknown>;++/**+ * Test titles are also used to build the debug notes that end up in the+ * generated PDFs, so they are kept in constants to keep the notes (and therefore+ * the PDF screenshots) stable when the test title gains the template suffix.+ */+const QR_CODE_TITLE = "displays QR code in PDF when QR code data is provided";+const SERVICE_PERIOD_TITLE =+ "displays service period in PDF when enabled and hides it when toggled off";+const MULTI_PAGE_TITLE = "generates multi-page PDF when invoice has many items";+const EMAIL_VISIBILITY_TITLE =+ "toggles seller and buyer email visibility in PDF";++test.describe("Invoice Template shared features", () => {+ test.beforeEach(async ({ page }) => {+ // we set the system time to a fixed date, so that the invoice number and other dates are consistent across tests+ await page.clock.setSystemTime(new Date("2025-12-17T00:00:00Z"));++ await page.goto("/?template=default");+ await expect(page).toHaveURL("/?template=default");+ });++ for (const template of TEMPLATES) {+ test(`${QR_CODE_TITLE} (${template} template)`, async ({+ page,+ browserName,+ downloadDir,+ }, testInfo) => {+ const QR_CODE_TEST_DATA = {+ data: "https://easyinvoicepdf.com",+ description: "QR Code Description",+ } as const satisfies {+ data: string;+ description: string;+ };++ await selectTemplate(page, template);++ const finalSection = page.getByTestId("final-section");++ const qrCodeFieldset = finalSection.getByRole("group", {+ name: "QR Code",+ });+ await expect(qrCodeFieldset).toBeVisible();++ // Verify that "Show QR Code in PDF" switch is on by default+ const showQrCodeSwitch = qrCodeFieldset.getByRole("switch", {+ name: "Show QR Code in PDF",+ });+ await expect(showQrCodeSwitch).toBeVisible();+ await expect(showQrCodeSwitch).toBeEnabled();+ await expect(showQrCodeSwitch).toBeChecked();++ // Verify QR Code Data field is empty by default+ const qrCodeDataTextarea = qrCodeFieldset.getByRole("textbox", {+ name: "Data",+ });+ await expect(qrCodeDataTextarea).toBeVisible();+ await expect(qrCodeDataTextarea).toHaveValue("");++ // Fill in the QR code data field+ await qrCodeDataTextarea.fill(QR_CODE_TEST_DATA.data);++ // Verify QR Code Description field is empty by default+ const qrCodeDescriptionTextarea = qrCodeFieldset.getByRole("textbox", {+ name: "Description (optional)",+ });+ await expect(qrCodeDescriptionTextarea).toBeVisible();+ await expect(qrCodeDescriptionTextarea).toHaveValue("");++ // Fill in the QR code description field+ await qrCodeDescriptionTextarea.fill(QR_CODE_TEST_DATA.description);++ await expectPdfScreenshot(page, {+ downloadDir,+ browserName,+ name: `displays-qr-code-in-pdf-${template}-template.png`,+ notes: `Test: ${QR_CODE_TITLE} (${testInfo.project.name})`,+ });++ /**+ * TURN OFF QR CODE IN PDF AND DOWNLOAD PDF AGAIN+ */++ // navigate back to the previous page+ await page.goto("/");+ await expect(page).toHaveURL(`/?template=${template}`);++ const newFinalSection = page.getByTestId("final-section");++ const newQrCodeFieldset = newFinalSection.getByRole("group", {+ name: "QR Code",+ });+ await expect(newQrCodeFieldset).toBeVisible();++ // Verify that "Show QR Code in PDF" switch is on by default+ const newShowQrCodeSwitch = newQrCodeFieldset.getByRole("switch", {+ name: "Show QR Code in PDF",+ });++ await expect(newShowQrCodeSwitch).toBeVisible();+ await expect(newShowQrCodeSwitch).toBeEnabled();+ await expect(newShowQrCodeSwitch).toBeChecked();++ // toggle the switch off+ await newShowQrCodeSwitch.click();++ // verify that the switch is off+ await expect(newShowQrCodeSwitch).not.toBeChecked();++ // Verify QR Code Data field retains its value after toggling visibility off+ const newQrCodeDataTextarea = newQrCodeFieldset.getByRole("textbox", {+ name: "Data",+ });+ await expect(newQrCodeDataTextarea).toBeVisible();+ await expect(newQrCodeDataTextarea).toHaveValue(QR_CODE_TEST_DATA.data);++ // Verify QR Code Description field retains its value after toggling visibility off+ const newQrCodeDescriptionTextarea = newQrCodeFieldset.getByRole(+ "textbox",+ {+ name: "Description (optional)",+ },+ );+ await expect(newQrCodeDescriptionTextarea).toBeVisible();+ await expect(newQrCodeDescriptionTextarea).toHaveValue(+ QR_CODE_TEST_DATA.description,+ );++ await expectPdfScreenshot(page, {+ downloadDir,+ browserName,+ name: `qr-code-hidden-in-pdf-${template}-template.png`,+ notes: `Test: ${QR_CODE_TITLE} - QR code hidden in PDF (${testInfo.project.name})`,+ });+ });++ test(`${SERVICE_PERIOD_TITLE} (${template} template)`, async ({+ page,+ browserName,+ downloadDir,+ }, testInfo) => {+ const SERVICE_PERIOD_TEST_DATA = {+ start: "2025-12-14",+ end: "2025-12-20",+ } as const;++ const CUSTOM_SERVICE_PERIOD_LABEL = "Billing period";++ await selectTemplate(page, template);++ const generalInfoSection = page.getByTestId(+ "general-information-section",+ );+ const servicePeriodFieldset = generalInfoSection.getByRole("group", {+ name: "Service period",+ });+ await expect(servicePeriodFieldset).toBeVisible();++ await expectServicePeriodPdfLabels(+ servicePeriodFieldset,+ template,+ INVOICE_PDF_TRANSLATIONS.en.servicePeriod,+ );++ const servicePeriodSwitch = servicePeriodFieldset.getByRole("switch", {+ name: 'Show the "Service period" (Service period start and end) field in the PDF',+ });++ // Service period start and end dates+ await servicePeriodFieldset+ .getByRole("textbox", { name: "Service period start" })+ .fill(SERVICE_PERIOD_TEST_DATA.start);++ await servicePeriodFieldset+ .getByRole("textbox", { name: "Service period end" })+ .fill(SERVICE_PERIOD_TEST_DATA.end);++ // Custom service period label+ await fillCustomServicePeriodPdfLabel(+ servicePeriodFieldset,+ template,+ CUSTOM_SERVICE_PERIOD_LABEL,+ );++ await expect(+ servicePeriodFieldset.getByRole("textbox", {+ name: "Service period start",+ }),+ ).toHaveValue(SERVICE_PERIOD_TEST_DATA.start);+ await expect(+ servicePeriodFieldset.getByRole("textbox", {+ name: "Service period end",+ }),+ ).toHaveValue(SERVICE_PERIOD_TEST_DATA.end);+ await expect(servicePeriodSwitch).toBeChecked();++ await expectPdfScreenshot(page, {+ downloadDir,+ browserName,+ name: `displays-service-period-in-pdf-${template}-template.png`,+ notes: `Test: ${SERVICE_PERIOD_TITLE} (${testInfo.project.name})`,+ });++ await page.goto("/");+ await expect(page).toHaveURL(`/?template=${template}`);++ const newGeneralInfoSection = page.getByTestId(+ "general-information-section",+ );+ const newServicePeriodFieldset = newGeneralInfoSection.getByRole(+ "group",+ {+ name: "Service period",+ },+ );+ await expect(newServicePeriodFieldset).toBeVisible();++ const newServicePeriodSwitch = newServicePeriodFieldset.getByRole(+ "switch",+ {+ name: 'Show the "Service period" (Service period start and end) field in the PDF',+ },+ );++ await expect(newServicePeriodSwitch).toBeChecked();++ // the custom PDF label survives a page reload+ await expectCustomServicePeriodPdfLabel(+ newServicePeriodFieldset,+ template,+ CUSTOM_SERVICE_PERIOD_LABEL,+ );++ await newServicePeriodSwitch.click();+ await expect(newServicePeriodSwitch).not.toBeChecked();++ // the service period dates (and label) are kept when the field is hidden from the PDF+ await expect(+ newServicePeriodFieldset.getByRole("textbox", {+ name: "Service period start",+ }),+ ).toHaveValue(SERVICE_PERIOD_TEST_DATA.start);+ await expect(+ newServicePeriodFieldset.getByRole("textbox", {+ name: "Service period end",+ }),+ ).toHaveValue(SERVICE_PERIOD_TEST_DATA.end);++ await expectCustomServicePeriodPdfLabel(+ newServicePeriodFieldset,+ template,+ CUSTOM_SERVICE_PERIOD_LABEL,+ );++ await expectPdfScreenshot(page, {+ downloadDir,+ browserName,+ name: `service-period-hidden-in-pdf-${template}-template.png`,+ notes: `Test: ${SERVICE_PERIOD_TITLE} - service period hidden in PDF (${testInfo.project.name})`,+ });+ });++ test(`${MULTI_PAGE_TITLE} (${template} template)`, async ({+ page,+ browserName,+ downloadDir,+ }, testInfo) => {+ const itemsConfig = MULTI_PAGE_ITEMS[template];++ await selectTemplate(page, template);++ const invoiceItemsSection = page.getByTestId("invoice-items-section");++ // Update tax label for the first item+ await fillFirstItemTaxLabel(invoiceItemsSection, itemsConfig.taxLabel);++ // Add additional invoice items to trigger multiple-page PDF+ for (let i = 0; i < 17; i++) {+ await invoiceItemsSection+ .getByRole("button", { name: "Add invoice item" })+ .click();++ // Item numbers start at 1+ const itemNumber = i + 2;++ // Fill minimal required fields for the new item+ const itemFieldset = invoiceItemsSection.getByRole("group", {+ name: `Item ${itemNumber}`,+ });++ await itemFieldset+ .getByRole("textbox", { name: "Name" })+ .fill(itemsConfig.itemName(itemNumber));++ // Set the tax rate for each item+ const taxSettingsFieldset = itemFieldset.getByRole("group", {+ name: "Tax Settings",+ });++ // Use different tax rates: 10%, 20%, or 50%+ const taxRate =+ // eslint-disable-next-line playwright/no-conditional-in-test+ itemNumber % 3 === 0 ? "50" : itemNumber % 2 === 0 ? "20" : "10";++ await taxSettingsFieldset+ .getByRole("textbox", {+ name: itemsConfig.taxRateFieldName,+ exact: true,+ })+ .fill(taxRate);++ await itemFieldset+ .getByRole("spinbutton", {+ name: "Net Price (Rate or Unit Price)",+ })+ .fill(itemsConfig.netPrice(itemNumber));+ }++ /**+ * RENDER ALL PDF PAGES ON A SINGLE CANVAS AND TAKE SCREENSHOT+ */+ const { numPages } = await expectPdfScreenshot(page, {+ downloadDir,+ browserName,+ name: `${template}-template-multi-pages.png`,+ notes: `Test: ${MULTI_PAGE_TITLE} (${testInfo.project.name})`,+ allPages: true,+ });++ // 18 items do not fit on a single page+ expect(numPages).toBe(3);+ });++ test(`${EMAIL_VISIBILITY_TITLE} (${template} template)`, async ({+ page,+ browserName,+ downloadDir,+ }, testInfo) => {+ await selectTemplate(page, template);++ /*+ * PHASE 1: Fill inline form with email switch OFF -> PDF screenshot (emails hidden)+ */++ const sellerSection = page.getByTestId("seller-information-section");+ const buyerSection = page.getByTestId("buyer-information-section");++ // Fill seller fields inline (no saved seller selected, so switch is enabled)+ await sellerSection+ .getByRole("textbox", { name: "Name (Required)" })+ .fill("Email Visibility Test Seller");++ await sellerSection+ .getByRole("textbox", { name: "Address (Required)" })+ .fill("123 Seller Street\nSeller City, 10001");++ await sellerSection+ .getByRole("textbox", { name: "Email" })+ .fill("[email protected]");++ // Toggle seller email switch OFF via inline form+ const sellerEmailSwitch = sellerSection.getByRole("switch", {+ name: "Show the 'Email' field in the PDF",+ });+ await expect(sellerEmailSwitch).toBeChecked();+ await sellerEmailSwitch.click();+ await expect(sellerEmailSwitch).not.toBeChecked();++ // Fill buyer fields inline (no saved buyer selected, so switch is enabled)+ await buyerSection+ .getByRole("textbox", { name: "Name (Required)" })+ .fill("Email Visibility Test Buyer");++ await buyerSection+ .getByRole("textbox", { name: "Address (Required)" })+ .fill("456 Buyer Avenue\nBuyer City, 20002");++ await buyerSection+ .getByRole("textbox", { name: "Email" })+ .fill("[email protected]");++ // Toggle buyer email switch OFF via inline form+ const buyerEmailSwitch = buyerSection.getByRole("switch", {+ name: "Show the 'Email' field in the PDF",+ });+ await expect(buyerEmailSwitch).toBeChecked();+ await buyerEmailSwitch.click();+ await expect(buyerEmailSwitch).not.toBeChecked();++ // Download PDF with emails hidden (toggled off via inline form)+ await expectPdfScreenshot(page, {+ downloadDir,+ browserName,+ name: `email-hidden-in-pdf-${template}-template.png`,+ notes: `Test: ${EMAIL_VISIBILITY_TITLE} - emails hidden (${testInfo.project.name})`,+ });++ /*+ * PHASE 2: Save seller/buyer via dialog with email ON -> PDF screenshot (emails visible)+ */++ await page.goto("/");+ await expect(page).toHaveURL(`/?template=${template}`);++ // Create seller via dialog with email visible+ await waitForPdfRegeneration(page, async () => {+ await page.getByRole("button", { name: "New Seller" }).click();++ const manageSellerDialog = page.getByTestId("manage-seller-dialog");++ await manageSellerDialog+ .getByRole("textbox", { name: "Name (Required)" })+ .fill("Email Visibility Test Seller");++ await manageSellerDialog+ .getByRole("textbox", { name: "Address (Required)" })+ .fill("123 Seller Street\nSeller City, 10001");++ await manageSellerDialog+ .getByRole("textbox", { name: "Email" })+ .fill("[email protected]");++ // Verify email visibility switch is checked by default in dialog+ const sellerEmailSwitchInDialog = manageSellerDialog.getByRole(+ "switch",+ {+ name: "Show the 'Email' field in the PDF",+ },+ );+ await expect(sellerEmailSwitchInDialog).toBeVisible();+ await expect(sellerEmailSwitchInDialog).toBeChecked();++ await manageSellerDialog+ .getByRole("button", { name: "Save Seller" })+ .click();++ await expect(manageSellerDialog).toBeHidden();++ await expect(+ page.getByText("Seller added and applied to invoice", {+ exact: true,+ }),+ ).toBeVisible();+ });++ // Create buyer via dialog with email visible+ await waitForPdfRegeneration(page, async () => {+ await page.getByRole("button", { name: "New Buyer" }).click();++ const manageBuyerDialog = page.getByTestId("manage-buyer-dialog");++ await manageBuyerDialog+ .getByRole("textbox", { name: "Name (Required)" })+ .fill("Email Visibility Test Buyer");++ await manageBuyerDialog+ .getByRole("textbox", { name: "Address (Required)" })+ .fill("456 Buyer Avenue\nBuyer City, 20002");++ await manageBuyerDialog+ .getByRole("textbox", { name: "Email" })+ .fill("[email protected]");++ // Verify email visibility switch is checked by default in dialog+ const buyerEmailSwitchInDialog = manageBuyerDialog.getByRole("switch", {+ name: "Show the 'Email' field in the PDF",+ });+ await expect(buyerEmailSwitchInDialog).toBeVisible();+ await expect(buyerEmailSwitchInDialog).toBeChecked();++ await manageBuyerDialog+ .getByRole("button", { name: "Save Buyer" })+ .click();++ await expect(manageBuyerDialog).toBeHidden();++ await expect(+ page.getByText("Buyer added and applied to invoice", { exact: true }),+ ).toBeVisible();+ });++ // Download PDF with emails visible (saved via dialog)+ await expectPdfScreenshot(page, {+ downloadDir,+ browserName,+ filePrefix: "visible-",+ name: `email-visible-in-pdf-${template}-template.png`,+ notes: `Test: ${EMAIL_VISIBILITY_TITLE} - emails visible (${testInfo.project.name})`,+ });+ });+ }+});diff --git a/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/default-template-multi-pages-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/default-template-multi-pages-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..7521cabBinary files /dev/null and b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/default-template-multi-pages-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/displays-qr-code-in-pdf-default-template-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/displays-qr-code-in-pdf-default-template-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..b17dde3Binary files /dev/null and b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/displays-qr-code-in-pdf-default-template-Desktop-Chrome-darwin.png differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/displays-qr-code-in-pdf-stripe-template-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/displays-qr-code-in-pdf-stripe-template-Desktop-Chrome-darwin.pngsimilarity index 100%rename from e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/displays-qr-code-in-pdf-stripe-template-Desktop-Chrome-darwin.pngrename to e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/displays-qr-code-in-pdf-stripe-template-Desktop-Chrome-darwin.pngdiff --git a/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/displays-service-period-in-pdf-default-template-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/displays-service-period-in-pdf-default-template-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..df779c8Binary files /dev/null and b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/displays-service-period-in-pdf-default-template-Desktop-Chrome-darwin.png differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/displays-service-period-in-pdf-stripe-template-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/displays-service-period-in-pdf-stripe-template-Desktop-Chrome-darwin.pngsimilarity index 100%rename from e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/displays-service-period-in-pdf-stripe-template-Desktop-Chrome-darwin.pngrename to e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/displays-service-period-in-pdf-stripe-template-Desktop-Chrome-darwin.pngdiff --git a/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/email-hidden-in-pdf-default-template-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/email-hidden-in-pdf-default-template-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..cac9762Binary files /dev/null and b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/email-hidden-in-pdf-default-template-Desktop-Chrome-darwin.png differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/email-hidden-in-pdf-stripe-template-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/email-hidden-in-pdf-stripe-template-Desktop-Chrome-darwin.pngsimilarity index 100%rename from e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/email-hidden-in-pdf-stripe-template-Desktop-Chrome-darwin.pngrename to e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/email-hidden-in-pdf-stripe-template-Desktop-Chrome-darwin.pngdiff --git a/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/email-visible-in-pdf-default-template-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/email-visible-in-pdf-default-template-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..3ae95d2Binary files /dev/null and b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/email-visible-in-pdf-default-template-Desktop-Chrome-darwin.png differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/email-visible-in-pdf-stripe-template-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/email-visible-in-pdf-stripe-template-Desktop-Chrome-darwin.pngsimilarity index 100%rename from e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/email-visible-in-pdf-stripe-template-Desktop-Chrome-darwin.pngrename to e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/email-visible-in-pdf-stripe-template-Desktop-Chrome-darwin.pngdiff --git a/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/qr-code-hidden-in-pdf-default-template-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/qr-code-hidden-in-pdf-default-template-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..1d27d2eBinary files /dev/null and b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/qr-code-hidden-in-pdf-default-template-Desktop-Chrome-darwin.png differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/qr-code-hidden-in-pdf-stripe-template-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/qr-code-hidden-in-pdf-stripe-template-Desktop-Chrome-darwin.pngsimilarity index 100%rename from e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/qr-code-hidden-in-pdf-stripe-template-Desktop-Chrome-darwin.pngrename to e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/qr-code-hidden-in-pdf-stripe-template-Desktop-Chrome-darwin.pngdiff --git a/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/service-period-hidden-in-pdf-default-template-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/service-period-hidden-in-pdf-default-template-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..3bbc040Binary files /dev/null and b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/service-period-hidden-in-pdf-default-template-Desktop-Chrome-darwin.png differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/service-period-hidden-in-pdf-stripe-template-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/service-period-hidden-in-pdf-stripe-template-Desktop-Chrome-darwin.pngsimilarity index 100%rename from e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/service-period-hidden-in-pdf-stripe-template-Desktop-Chrome-darwin.pngrename to e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/service-period-hidden-in-pdf-stripe-template-Desktop-Chrome-darwin.pngdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/stripe-template-multi-pages-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/stripe-template-multi-pages-Desktop-Chrome-darwin.pngsimilarity index 100%rename from e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/stripe-template-multi-pages-Desktop-Chrome-darwin.pngrename to e2e/invoice-templates-common/shared-template-features.test.ts-snapshots/stripe-template-multi-pages-Desktop-Chrome-darwin.pngdiff --git a/e2e/invoice-templates-common/template-languages.test.ts b/e2e/invoice-templates-common/template-languages.test.tsnew file mode 100644index 0000000..2e4d50c--- /dev/null+++ b/e2e/invoice-templates-common/template-languages.test.ts@@ -0,0 +1,236 @@+import type { Page } from "@playwright/test";++import {+ getDefaultInvoiceNumberLabel,+ INVOICE_PDF_TRANSLATIONS,+} from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import {+ CURRENCY_SYMBOLS,+ CURRENCY_TO_LABEL,+ LANGUAGE_TO_LABEL,+ SUPPORTED_LANGUAGES,+ type SupportedCurrencies,+ type SupportedLanguages,+ type SupportedTemplates,+} from "@/app/schema";++// IMPORTANT: we use custom extended test fixture that provides a temporary download directory for each test+import { expect, test } from "../utils/extended-playwright-test";+import { expectPdfScreenshot } from "../utils/pdf-download";++const TEMPLATES = [+ "default",+ "stripe",+] as const satisfies readonly SupportedTemplates[];++type Template = (typeof TEMPLATES)[number];++/**+ * Each supported PDF language is paired with a currency that is realistic for that language,+ * so that every screenshot also covers currency formatting (symbol, position, thousand separators)+ * for the selected language.+ */+const LANGUAGE_TO_CURRENCY = {+ en: "USD",+ pl: "PLN",+ de: "EUR",+ es: "MXN",+ pt: "BRL",+ ru: "RUB",+ uk: "UAH",+ fr: "CHF",+ it: "EUR",+ nl: "EUR",+} as const satisfies Record<SupportedLanguages, SupportedCurrencies>;++const PDF_LANGUAGE_CASES = [+ ...SUPPORTED_LANGUAGES.map((language) => {+ return {+ language,+ currency: LANGUAGE_TO_CURRENCY[language],+ };+ }),+ // JPY is a zero-decimal currency, so it formats amounts (and converts them to+ // words) differently from every currency above+ { language: "en", currency: "JPY" },+] as const satisfies readonly {+ language: SupportedLanguages;+ currency: SupportedCurrencies;+}[];++const INVOICE_ITEM = {+ name: "Invoice Item TEST",+ quantity: "3",+ netPrice: "1234.56",+ // 3 * 1234.56+ total: "3,703.68",+} as const;++async function selectTemplate(page: Page, template: Template) {+ if (template !== "default") {+ await page+ .getByRole("combobox", { name: "Invoice Template" })+ .selectOption(template);+ }++ await page.waitForURL(`/?template=${template}`);+ await expect(page).toHaveURL(`/?template=${template}`);+}++/**+ * The default template prints the invoice number label, the Stripe one prints its+ * own (shorter) heading — both come from the same per-language translations.+ */+async function expectTranslatedInvoiceNumberLabel(+ page: Page,+ template: Template,+ language: SupportedLanguages,+) {+ const invoiceNumberLabelInput = page+ .getByTestId("general-information-section")+ .getByRole("group", { name: "Invoice Number" })+ .getByRole("textbox", { name: "Label" });++ await expect(invoiceNumberLabelInput).toHaveValue(+ getDefaultInvoiceNumberLabel(language, template),+ );+}++/**+ * Screenshots of the generated PDF for **every** supported PDF language, in both+ * templates.+ *+ * For every language we switch the language (and the currency along with it),+ * download the generated PDF, render it on a canvas and take a screenshot of it.+ */+test.describe("Invoice Template PDF languages", () => {+ test.beforeEach(async ({ page }, testInfo) => {+ // eslint-disable-next-line playwright/no-skipped-test -- PDF language snapshots are Desktop Chrome only+ test.skip(+ testInfo.project.name !== "Desktop Chrome",+ "PDF language snapshots are Desktop Chrome only",+ );++ // we set the system time to a fixed date, so that the invoice number and other dates are consistent across tests+ await page.clock.setSystemTime(new Date("2025-12-17T00:00:00Z"));++ await page.goto("/?template=default");+ await expect(page).toHaveURL("/?template=default");+ });++ for (const template of TEMPLATES) {+ for (const { language, currency } of PDF_LANGUAGE_CASES) {+ const languageLabel = LANGUAGE_TO_LABEL[language];++ // Example for USD: "USD $ US Dollar"+ const currencyOptionLabel =+ `${currency} ${CURRENCY_SYMBOLS[currency]} ${CURRENCY_TO_LABEL[currency]}`.trim();++ test(`generates ${template} template PDF in ${languageLabel} (${language}) with ${currency} currency`, async ({+ page,+ browserName,+ downloadDir,+ }, testInfo) => {+ await selectTemplate(page, template);++ const generalInfoSection = page.getByTestId(+ "general-information-section",+ );++ /** SWITCH PDF LANGUAGE */++ const languageSelect = generalInfoSection.getByRole("combobox", {+ name: "Invoice PDF Language",+ });++ await languageSelect.selectOption(language);+ await expect(languageSelect).toHaveValue(language);++ // the invoice number label is translated when the language changes+ await expectTranslatedInvoiceNumberLabel(page, template, language);++ /** SWITCH CURRENCY (currency changes together with the language) */++ const currencyCombobox = generalInfoSection.getByRole("combobox", {+ name: "Currency",+ });++ await currencyCombobox.click();++ // we search for the currency, because the list of currencies is long+ await page.getByPlaceholder("Search currency...").fill(currency);++ await page.getByRole("option", { name: currencyOptionLabel }).click();++ await expect(currencyCombobox).toContainText(currencyOptionLabel);++ // check that value is saved in the hidden input+ await expect(page.locator('input[name="currency"]')).toHaveValue(+ currency,+ );++ /** FILL IN THE INVOICE ITEM, so that the PDF contains non zero amounts formatted in the selected currency */++ const invoiceItemsSection = page.getByTestId("invoice-items-section");++ await invoiceItemsSection+ .getByRole("textbox", { name: "Name" })+ .fill(INVOICE_ITEM.name);++ await invoiceItemsSection+ .getByRole("spinbutton", { name: "Amount (Quantity)", exact: true })+ .fill(INVOICE_ITEM.quantity);++ await invoiceItemsSection+ .getByRole("spinbutton", {+ name: "Net Price (Rate or Unit Price)",+ exact: true,+ })+ .fill(INVOICE_ITEM.netPrice);++ // Check that the total is correct+ await expect(page.getByRole("textbox", { name: "Total" })).toHaveValue(+ INVOICE_ITEM.total,+ );++ const { suggestedFilename } = await expectPdfScreenshot(page, {+ downloadDir,+ browserName,+ name: `${template}-template-pdf-${language}-${currency}.png`,+ notes: `Test: PDF in ${languageLabel} (${language}) with ${currency} currency (${testInfo.project.name})`,+ });++ // the downloaded file is named after the PDF language and the invoice number+ expect(suggestedFilename).toBe(+ `invoice-${language.toUpperCase()}-1-12-2025.pdf`,+ );+ });+ }+ }+});++/**+ * Sanity check for the translations the tests above assert against, so that a+ * broken translation lookup does not silently make every assertion pass.+ */+test.describe("PDF language test data", () => {+ test.beforeEach(({}, testInfo) => {+ // eslint-disable-next-line playwright/no-skipped-test -- PDF language test data is Desktop Chrome only+ test.skip(+ testInfo.project.name !== "Desktop Chrome",+ "PDF language test data is Desktop Chrome only",+ );+ });++ test("default invoice number labels come from the language translations", () => {+ for (const language of SUPPORTED_LANGUAGES) {+ expect(getDefaultInvoiceNumberLabel(language, "default")).toBe(+ `${INVOICE_PDF_TRANSLATIONS[language].invoiceNumber}:`,+ );++ expect(getDefaultInvoiceNumberLabel(language, "stripe")).toBe(+ INVOICE_PDF_TRANSLATIONS[language].stripe.invoice,+ );+ }+ });+});diff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-de-EUR-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-de-EUR-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..2e10663Binary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-de-EUR-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-en-JPY-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-en-JPY-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..dcc11c1Binary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-en-JPY-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-en-USD-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-en-USD-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..daccd0bBinary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-en-USD-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-es-MXN-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-es-MXN-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..ca036fbBinary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-es-MXN-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-fr-CHF-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-fr-CHF-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..dd6a8eeBinary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-fr-CHF-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-it-EUR-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-it-EUR-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..5671d47Binary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-it-EUR-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-nl-EUR-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-nl-EUR-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..852bb9fBinary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-nl-EUR-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-pl-PLN-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-pl-PLN-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..cb31e28Binary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-pl-PLN-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-pt-BRL-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-pt-BRL-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..7bcb4ebBinary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-pt-BRL-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-ru-RUB-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-ru-RUB-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..51fb722Binary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-ru-RUB-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-uk-UAH-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-uk-UAH-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..3f5c0b2Binary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/default-template-pdf-uk-UAH-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-de-EUR-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-de-EUR-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..a88d4aaBinary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-de-EUR-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-en-JPY-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-en-JPY-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..755df14Binary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-en-JPY-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-en-USD-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-en-USD-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..8311b2eBinary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-en-USD-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-es-MXN-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-es-MXN-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..e018b28Binary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-es-MXN-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-fr-CHF-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-fr-CHF-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..35fa294Binary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-fr-CHF-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-it-EUR-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-it-EUR-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..6125841Binary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-it-EUR-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-nl-EUR-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-nl-EUR-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..c7bc140Binary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-nl-EUR-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-pl-PLN-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-pl-PLN-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..501a46fBinary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-pl-PLN-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-pt-BRL-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-pt-BRL-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..0a6990cBinary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-pt-BRL-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-ru-RUB-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-ru-RUB-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..622d983Binary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-ru-RUB-Desktop-Chrome-darwin.png differdiff --git a/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-uk-UAH-Desktop-Chrome-darwin.png b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-uk-UAH-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..7da4728Binary files /dev/null and b/e2e/invoice-templates-common/template-languages.test.ts-snapshots/stripe-template-pdf-uk-UAH-Desktop-Chrome-darwin.png differdiff --git a/e2e/locales.test.ts b/e2e/locales.test.tsnew file mode 100644index 0000000..dbba744--- /dev/null+++ b/e2e/locales.test.ts@@ -0,0 +1,64 @@+import fs from "node:fs";+import path from "node:path";++import { expect, test } from "@playwright/test";++import { SUPPORTED_LANGUAGES } from "@/app/schema";++/**+ * The app ships a translation file per supported language (`messages/<locale>.json`)+ * and serves a localized about page for each of them (`localePrefix: "always"`).+ *+ * These are smoke tests: they don't check every string, they check that **every**+ * locale is actually wired up — the page is served and the translations of that+ * locale (not the English fallback) are rendered.+ *+ * NOTE: `<html lang>` is hardcoded to "en" in the root layout, so it is not+ * asserted here.+ */+type Messages = { About: { tagline: string } };++function readMessages(locale: string): Messages {+ const messagesPath = path.join(__dirname, `../messages/${locale}.json`);++ return JSON.parse(fs.readFileSync(messagesPath, "utf8")) as Messages;+}++test.describe("Localized about page", () => {+ // the localized pages are server rendered, the result does not depend on the+ // browser, so we don't re-run the whole locale matrix on every project+ test.beforeEach(({}, testInfo) => {+ // eslint-disable-next-line playwright/no-skipped-test -- locale smoke tests are Desktop Chrome only+ test.skip(+ testInfo.project.name !== "Desktop Chrome",+ "Locale smoke tests are Desktop Chrome only",+ );+ });++ for (const locale of SUPPORTED_LANGUAGES) {+ test(`serves /${locale}/about with ${locale} translations`, async ({+ page,+ }) => {+ const messages = readMessages(locale);++ // every locale must have the tagline we assert on below+ expect(messages.About.tagline).toBeTruthy();++ const response = await page.goto(`/${locale}/about`);++ expect(response?.status()).toBe(200);+ await expect(page).toHaveURL(`/${locale}/about`);++ // the page renders this locale's translations, not the English fallback+ await expect(+ page.getByText(messages.About.tagline, { exact: true }).first(),+ ).toBeVisible();+ });+ }++ test("an unsupported locale is not served", async ({ page }) => {+ const response = await page.goto("/xx/about");++ expect(response?.status()).toBe(404);+ });+});diff --git a/e2e/pdf-generation-error.test.ts b/e2e/pdf-generation-error.test.tsnew file mode 100644index 0000000..d5645da--- /dev/null+++ b/e2e/pdf-generation-error.test.ts@@ -0,0 +1,83 @@+import { expect, test } from "@playwright/test";++import { BUG_REPORT_URL, CONTACT_SUPPORT_EMAIL } from "@/config";++import { getDownloadPdfLink } from "./utils/pdf-download";++/**+ * The PDF is rendered in the browser with react-pdf, which downloads the invoice+ * fonts over the network. If those requests fail the PDF cannot be generated, and+ * the app has to tell the user instead of silently rendering nothing.+ *+ * Blocking the font requests is the closest deterministic simulation of that+ * failure (a CDN outage or an offline user).+ */+test.describe("PDF generation errors", () => {+ /**+ * Before each test, intercept all network requests for .ttf font files+ * (which are required for rendering the PDF) and abort them.+ * This simulates a situation where the necessary fonts cannot be loaded+ * (e.g., a CDN outage or being offline), forcing the PDF generation to fail.+ */+ test.beforeEach(async ({ page }) => {+ await page.route("**/*.ttf", (route) => {+ return route.abort();+ });+ });++ test("shows the error toast with recovery steps when the PDF cannot be generated", async ({+ page,+ }) => {+ await page.goto("/?template=default");++ // sonner renders the toast into a list item, we scope to it so the+ // assertions below cannot pass on text found elsewhere on the page+ const errorToast = page+ .getByRole("listitem")+ .filter({ hasText: "Error Generating PDF Document" });++ await expect(errorToast).toBeVisible();++ // the toast tells the user what to do next+ await expect(errorToast).toContainText("Reload the page");+ await expect(errorToast).toContainText(+ "Try using a different browser (Chrome or Firefox recommended)",+ );++ await expect(+ errorToast.getByRole("link", { name: CONTACT_SUPPORT_EMAIL }),+ ).toHaveAttribute("href", `mailto:${CONTACT_SUPPORT_EMAIL}`);++ await expect(+ errorToast.getByRole("link", { name: "submit a bug report" }),+ ).toHaveAttribute("href", BUG_REPORT_URL);+ });++ test("clicking download when no PDF is available explains why", async ({+ page,+ }) => {+ await page.goto("/?template=default");++ // wait for the failure to surface before clicking download+ await expect(page.getByText("Error Generating PDF Document")).toBeVisible();++ const downloadPdfLink = getDownloadPdfLink(page);++ // there is no generated file to point at+ await expect(downloadPdfLink).toHaveAttribute("href", "#");++ await downloadPdfLink.click();++ await expect(+ page.getByText(+ "File not available. Please try again in different browser.",+ ),+ ).toBeVisible();+ });++ test("the Stripe template surfaces the same error", async ({ page }) => {+ await page.goto("/?template=stripe");++ await expect(page.getByText("Error Generating PDF Document")).toBeVisible();+ });+});diff --git a/e2e/seller-buyer-management.test.ts b/e2e/seller-buyer-management.test.tsnew file mode 100644index 0000000..c26a14e--- /dev/null+++ b/e2e/seller-buyer-management.test.ts@@ -0,0 +1,1292 @@+import { expect, test, type Locator, type Page } from "@playwright/test";++import { DEFAULT_BUYER_DATA, DEFAULT_SELLER_DATA } from "@/app/constants";+import {+ BUYERS_LOCAL_STORAGE_KEY,+ SELLERS_LOCAL_STORAGE_KEY,+ type BuyerData,+ type SellerData,+} from "@/app/schema";++/**+ * Sellers and buyers are managed through the same UI: a "New <party>" dialog, a+ * dropdown to switch between saved parties, an edit/delete pair of buttons and a+ * mirrored read-only section in the invoice form.+ *+ * Every test in this file therefore runs once per party. The **only** real+ * difference between the two is that a seller also has bank details (account+ * number + SWIFT/BIC), which is handled by the `*BankDetails*` helpers below.+ */+const PARTIES = ["seller", "buyer"] as const;++type Party = (typeof PARTIES)[number];++const PARTY_CONFIG = {+ seller: {+ /** Capitalized party name, as used in buttons and toasts ("New Seller") */+ label: "Seller",+ storageKey: SELLERS_LOCAL_STORAGE_KEY,+ defaults: DEFAULT_SELLER_DATA,+ },+ buyer: {+ label: "Buyer",+ storageKey: BUYERS_LOCAL_STORAGE_KEY,+ defaults: DEFAULT_BUYER_DATA,+ },+} as const satisfies Record<+ Party,+ { label: string; storageKey: string; defaults: SellerData | BuyerData }+>;++/** Bank details only exist for sellers */+const BANK_DETAILS = {+ seller: {+ accountNumber: "1234-5678-9012-3456",+ swiftBic: "TESTBICX",+ },+ buyer: null,+} as const satisfies Record<+ Party,+ { accountNumber: string; swiftBic: string } | null+>;++const PARTY_TEST_DATA = {+ seller: {+ name: "New Test Company",+ address: "123 Test Street\nTest City, 12345\nTest Country",+ vatNo: "123456789",+ vatNoLabelText: "Tax Number",+ email: "[email protected]",+ notes: "This is a SELLER test note",+ },+ buyer: {+ name: "New Test Client",+ address: "456 Client Avenue\nClient City, 54321\nClient Country",+ vatNo: "987654321",+ vatNoLabelText: "Tax Number",+ email: "[email protected]",+ notes: "This is a BUYER test note",+ },+} as const satisfies Record<+ Party,+ {+ name: string;+ address: string;+ vatNo: string;+ vatNoLabelText: string;+ email: string;+ notes: string;+ }+>;++function getManagePartyDialog(page: Page, party: Party): Locator {+ return page.getByTestId(`manage-${party}-dialog`);+}++function getPartyForm(page: Page, party: Party): Locator {+ return page.getByTestId(`${party}-information-section`);+}++function getPartyDropdown(page: Page, party: Party): Locator {+ return getPartyForm(page, party).getByRole("combobox", {+ name: `Select ${PARTY_CONFIG[party].label}`,+ });+}++async function openNewPartyDialog(page: Page, party: Party) {+ await page+ .getByRole("button", { name: `New ${PARTY_CONFIG[party].label}` })+ .click();++ await expect(getManagePartyDialog(page, party)).toBeVisible();+}++async function savePartyDialog(page: Page, party: Party) {+ await getManagePartyDialog(page, party)+ .getByRole("button", { name: `Save ${PARTY_CONFIG[party].label}` })+ .click();+}++/**+ * Reads the stored party data (seller or buyer) from the browser's localStorage.+ * This function retrieves the data for the specified party (using the configured storage key),+ * asserts that data exists, and parses the JSON into an array of SellerData or BuyerData objects.+ */+async function readStoredParties(page: Page, party: Party) {+ const storedData = (await page.evaluate((key) => {+ return localStorage.getItem(key);+ }, PARTY_CONFIG[party].storageKey)) as string;++ expect(storedData).toBeTruthy();++ return JSON.parse(storedData) as (SellerData | BuyerData)[];+}++/** Fills the seller-only bank details; a no-op for buyers */+async function fillBankDetails(dialog: Locator, party: Party) {+ const bankDetails = BANK_DETAILS[party];++ if (!bankDetails) {+ return;+ }++ await dialog+ .getByRole("textbox", { name: "Account Number" })+ .fill(bankDetails.accountNumber);+ await dialog+ .getByRole("textbox", { name: "SWIFT/BIC" })+ .fill(bankDetails.swiftBic);+}++/** Hides the seller-only bank details from the PDF; a no-op for buyers */+async function toggleBankDetailsOff(dialog: Locator, party: Party) {+ if (!BANK_DETAILS[party]) {+ return;+ }++ const accountNumberSwitch = dialog.getByRole("switch", {+ name: `Show the 'Account Number' field in the PDF`,+ });+ const swiftBicSwitch = dialog.getByRole("switch", {+ name: `Show the 'SWIFT/BIC' field in the PDF`,+ });++ await expect(accountNumberSwitch).toBeChecked();+ await accountNumberSwitch.click();+ await expect(accountNumberSwitch).not.toBeChecked();++ await expect(swiftBicSwitch).toBeChecked();+ await swiftBicSwitch.click();+ await expect(swiftBicSwitch).not.toBeChecked();+}++async function expectBankDetailsInDialog(dialog: Locator, party: Party) {+ const bankDetails = BANK_DETAILS[party];++ if (!bankDetails) {+ return;+ }++ await expect(+ dialog.getByRole("textbox", { name: "Account Number" }),+ ).toHaveValue(bankDetails.accountNumber);+ await expect(dialog.getByRole("textbox", { name: "SWIFT/BIC" })).toHaveValue(+ bankDetails.swiftBic,+ );++ await expect(+ dialog.getByRole("switch", {+ name: `Show the 'Account Number' field in the PDF`,+ }),+ ).not.toBeChecked();+ await expect(+ dialog.getByRole("switch", {+ name: `Show the 'SWIFT/BIC' field in the PDF`,+ }),+ ).not.toBeChecked();+}++/**+ * Verifies the seller-only bank details in the (read-only) invoice form section;+ * a no-op for buyers.+ */+async function expectBankDetailsInForm(form: Locator, party: Party) {+ const bankDetails = BANK_DETAILS[party];++ if (!bankDetails) {+ return;+ }++ await expect(+ form.getByRole("textbox", { name: "Account Number" }),+ ).toHaveValue(bankDetails.accountNumber);++ const accountNumberSwitch = form.getByTestId(+ `${party}AccountNumberFieldIsVisible`,+ );+ await expect(accountNumberSwitch).not.toBeChecked();+ await expect(accountNumberSwitch).toBeDisabled();++ await expect(form.getByRole("textbox", { name: "SWIFT/BIC" })).toHaveValue(+ bankDetails.swiftBic,+ );++ const swiftBicSwitch = form.getByTestId(`${party}SwiftBicFieldIsVisible`);+ await expect(swiftBicSwitch).not.toBeChecked();+ await expect(swiftBicSwitch).toBeDisabled();+}++async function expectStoredBankDetails(+ storedParty: SellerData | BuyerData,+ party: Party,+) {+ const bankDetails = BANK_DETAILS[party];++ if (!bankDetails) {+ return;+ }++ expect(storedParty).toMatchObject({+ accountNumber: bankDetails.accountNumber,+ accountNumberFieldIsVisible: false,+ swiftBic: bankDetails.swiftBic,+ swiftBicFieldIsVisible: false,+ });+}++/**+ * Verifies the party defaults are restored in the invoice form (used after+ * deleting a party or restoring the form to its defaults).+ */+async function expectFormResetToDefaults(form: Locator, party: Party) {+ const defaults = PARTY_CONFIG[party].defaults;++ await expect(form.getByRole("textbox", { name: "Name" })).toHaveValue(+ defaults.name,+ );+ await expect(form.getByRole("textbox", { name: "Address" })).toHaveValue(+ defaults.address,+ );+ await expect(form.getByRole("textbox", { name: "Email" })).toHaveValue(+ defaults.email,+ );+}++for (const party of PARTIES) {+ const { label, storageKey, defaults } = PARTY_CONFIG[party];+ const testData = PARTY_TEST_DATA[party];++ test.describe(`${label} management`, () => {+ test.beforeEach(async ({ page }) => {+ await page.goto("/?template=default");++ await expect(page).toHaveURL("/?template=default");+ });++ test(`create/edit ${party}`, async ({ page }) => {+ // Open party management dialog+ await openNewPartyDialog(page, party);++ const manageDialog = getManagePartyDialog(page, party);++ // Verify "Pre-fill with values from the current invoice form" switch is visible+ const prefillSwitch = manageDialog.getByRole("switch", {+ name: `Pre-fill with values from the current invoice form`,+ });+ await expect(prefillSwitch).toBeVisible();+ await expect(prefillSwitch).not.toBeChecked();++ // Verify the label is visible+ await expect(+ manageDialog.getByLabel(+ "Pre-fill with values from the current invoice form",+ ),+ ).toBeVisible();++ /*+ * TEST PARTY MANAGEMENT DIALOG FORM+ */++ // Fill in form fields+ await manageDialog+ .getByRole("textbox", { name: "Name" })+ .fill(testData.name);++ await manageDialog+ .getByRole("textbox", { name: "Address" })+ .fill(testData.address);++ // Fill Tax Number fieldset (Label and Value)+ const vatNumberFieldset = manageDialog.getByRole("group", {+ name: `${label} Tax Number`,+ });++ await vatNumberFieldset+ .getByRole("textbox", { name: "Label" })+ .fill(testData.vatNoLabelText);++ await vatNumberFieldset+ .getByRole("textbox", { name: "Value" })+ .fill(testData.vatNo);++ await manageDialog+ .getByRole("textbox", { name: "Email" })+ .fill(testData.email);++ // sellers also have bank details+ await fillBankDetails(manageDialog, party);++ const emailSwitchInDialogForm = manageDialog.getByRole("switch", {+ name: `Show the 'Email' field in the PDF`,+ });++ const taxNumberSwitchInDialogForm = manageDialog.getByRole("switch", {+ name: `Show the 'Tax Number' field in the PDF`,+ });++ // Verify visibility switches are checked by default+ await expect(emailSwitchInDialogForm).toBeChecked();+ await expect(taxNumberSwitchInDialogForm).toBeChecked();++ // Toggle Email visibility switch+ await emailSwitchInDialogForm.click();+ await expect(emailSwitchInDialogForm).not.toBeChecked();++ // Toggle Tax Number visibility switch+ await taxNumberSwitchInDialogForm.click();+ await expect(taxNumberSwitchInDialogForm).not.toBeChecked();++ // Toggle the seller-only bank detail switches+ await toggleBankDetailsOff(manageDialog, party);++ // Fill in notes field+ await manageDialog+ .getByRole("textbox", { name: "Notes" })+ .fill(testData.notes);++ const notesSwitchInDialogForm = manageDialog.getByTestId(+ `${party}NotesDialogFieldVisibilitySwitch`,+ );++ await expect(notesSwitchInDialogForm).toHaveRole("switch");++ // Verify notes visibility switch is CHECKED by default+ await expect(notesSwitchInDialogForm).toBeChecked();++ // Verify "Apply to Current Invoice" switch is checked by default+ await expect(+ manageDialog.getByRole("switch", {+ name: "Apply to Current Invoice",+ }),+ ).toBeChecked();++ // Cancel button is shown+ await expect(+ manageDialog.getByRole("button", { name: "Cancel" }),+ ).toBeVisible();++ // Save party+ await savePartyDialog(page, party);++ // Verify success toast message is visible+ await expect(+ page.getByText(`${label} added and applied to invoice`, {+ exact: true,+ }),+ ).toBeVisible();++ // Verify party data is actually saved in localStorage+ const storedParties = await readStoredParties(page, party);++ expect(storedParties[0]).toMatchObject({+ name: testData.name,+ address: testData.address,++ vatNo: testData.vatNo,+ vatNoLabelText: testData.vatNoLabelText,+ vatNoFieldIsVisible: false,++ email: testData.email,+ emailFieldIsVisible: false,++ notes: testData.notes,+ notesFieldIsVisible: true,+ });++ await expectStoredBankDetails(storedParties[0], party);++ /*+ * TEST SAVED DETAILS IN INVOICE FORM AFTER SAVING PARTY IN DIALOG+ */++ const partyForm = getPartyForm(page, party);+ const partyDropdown = getPartyDropdown(page, party);++ // Verify the party is selected in dropdown+ await expect(partyDropdown.locator("option:checked")).toHaveText(+ testData.name,+ );++ // Verify the locked banner is visible with correct text+ const lockedBanner = partyForm.getByTestId(`${party}-locked-banner`);+ await expect(lockedBanner).toBeVisible();+ await expect(lockedBanner).toContainText(+ `To modify ${party} details, click the Edit ${party} button (pencil icon) next to the dropdown above.`,+ );++ // Name+ await expect(+ partyForm.getByRole("textbox", { name: "Name (Required)" }),+ ).toHaveValue(testData.name);++ // Address+ await expect(+ partyForm.getByRole("textbox", { name: "Address (Required)" }),+ ).toHaveValue(testData.address);++ // Tax Number+ const partyVatFieldset = partyForm.getByRole("group", {+ name: `${label} Tax Number`,+ });++ await expect(+ partyVatFieldset.getByRole("textbox", { name: "Label" }),+ ).toHaveValue(testData.vatNoLabelText);++ await expect(+ partyVatFieldset.getByRole("textbox", { name: "Value" }),+ ).toHaveValue(testData.vatNo);++ const vatNumberSwitchNotInDialog = partyForm.getByTestId(+ `${party}VatNoFieldIsVisible`,+ );+ // Verify Tax Number switch is not checked as we toggled it off+ await expect(vatNumberSwitchNotInDialog).not.toBeChecked();+ await expect(vatNumberSwitchNotInDialog).toBeDisabled();++ await expect(+ partyForm.getByRole("textbox", { name: "Email" }),+ ).toHaveValue(testData.email);++ const emailSwitchNotInDialog = partyForm.getByRole("switch", {+ name: `Show the 'Email' field in the PDF`,+ });+ // Verify Email switch is not checked as we toggled it off+ await expect(emailSwitchNotInDialog).not.toBeChecked();+ await expect(emailSwitchNotInDialog).toBeDisabled();++ // Bank details (sellers only)+ await expectBankDetailsInForm(partyForm, party);++ // Notes+ await expect(+ partyForm.getByRole("textbox", { name: "Notes" }),+ ).toHaveValue(testData.notes);++ const notesSwitchNotInDialog = partyForm.getByTestId(+ `${party}NotesInvoiceFormFieldVisibilitySwitch`,+ );+ await expect(notesSwitchNotInDialog).toBeChecked();+ await expect(notesSwitchNotInDialog).toBeDisabled();++ /*+ * TEST EDIT FUNCTIONALITY IN PARTY MANAGEMENT DIALOG+ */++ await partyForm.getByRole("button", { name: `Edit ${party}` }).click();++ // Verify all fields are populated in edit dialog+ await expect(+ manageDialog.getByRole("textbox", { name: "Name" }),+ ).toHaveValue(testData.name);+ await expect(+ manageDialog.getByRole("textbox", { name: "Address" }),+ ).toHaveValue(testData.address);++ await expect(+ manageDialog+ .getByRole("group", { name: `${label} Tax Number` })+ .getByRole("textbox", { name: "Label" }),+ ).toHaveValue(testData.vatNoLabelText);++ await expect(+ manageDialog+ .getByRole("group", { name: `${label} Tax Number` })+ .getByRole("textbox", { name: "Value" }),+ ).toHaveValue(testData.vatNo);++ await expect(+ manageDialog.getByRole("textbox", { name: "Email" }),+ ).toHaveValue(testData.email);++ // Verify visibility switches state persisted in edit dialog+ await expect(emailSwitchInDialogForm).not.toBeChecked();+ await expect(taxNumberSwitchInDialogForm).not.toBeChecked();++ await expectBankDetailsInDialog(manageDialog, party);++ // Verify notes text+ await expect(+ manageDialog.getByRole("textbox", { name: "Notes" }),+ ).toHaveValue(testData.notes);++ // Verify notes visibility switch is checked+ await expect(notesSwitchInDialogForm).toBeChecked();+ await expect(notesSwitchInDialogForm).toBeEnabled();++ /*+ * TEST UPDATING THE PARTY IN EDIT MODE+ */++ const updatedName = `Updated ${label} Corp`;++ await manageDialog+ .getByRole("textbox", { name: "Name" })+ .fill(updatedName);++ // Re-enable Email visibility+ await emailSwitchInDialogForm.click();++ // Re-enable Tax Number visibility+ await taxNumberSwitchInDialogForm.click();++ // Uncheck notes visibility switch in edit dialog+ await notesSwitchInDialogForm.click();++ // Save updated party+ await savePartyDialog(page, party);++ // Verify success toast for update+ await expect(+ page.getByText(`${label} updated successfully`, { exact: true }),+ ).toBeVisible();++ // Verify party is selected in dropdown with its new name+ await expect(partyDropdown.locator("option:checked")).toHaveText(+ updatedName,+ );++ /*+ * TEST UPDATED INFORMATION IN INVOICE FORM AFTER UPDATING PARTY IN DIALOG+ */++ await expect(+ partyForm.getByRole("textbox", { name: "Name" }),+ ).toHaveValue(updatedName);++ // Verify Email visibility is now enabled+ await expect(emailSwitchNotInDialog).toBeChecked();++ // Verify Tax Number visibility is now enabled+ await expect(vatNumberSwitchNotInDialog).toBeChecked();++ // Verify notes visibility switch is unchecked+ await expect(notesSwitchNotInDialog).not.toBeChecked();+ });++ test(`add ${party} without applying to invoice`, async ({ page }) => {+ await openNewPartyDialog(page, party);++ const manageDialog = getManagePartyDialog(page, party);++ const unappliedName = `Unapplied Test ${label}`;++ await manageDialog+ .getByRole("textbox", { name: "Name" })+ .fill(unappliedName);+ await manageDialog+ .getByRole("textbox", { name: "Address" })+ .fill("99 Unapplied Street");+ await manageDialog+ .getByRole("textbox", { name: "Email" })+ .fill(`unapplied@${party}.com`);++ // Uncheck "Apply to Current Invoice" switch+ const applyToInvoiceSwitch = manageDialog.getByRole("switch", {+ name: "Apply to Current Invoice",+ });++ await expect(applyToInvoiceSwitch).toBeChecked();+ await applyToInvoiceSwitch.click();+ await expect(applyToInvoiceSwitch).not.toBeChecked();++ await savePartyDialog(page, party);++ // Verify "<Party> added successfully" toast (NOT "applied to invoice")+ await expect(+ page.getByText(`${label} added successfully`, { exact: true }),+ ).toBeVisible();++ const partyForm = getPartyForm(page, party);+ const partyDropdown = getPartyDropdown(page, party);++ // Party should appear in dropdown options but not be selected+ await expect(partyDropdown).toBeVisible();++ await expect(partyDropdown.locator("option:checked")).toHaveText(+ `No ${party} selected (default)`,+ );++ // Form fields should still contain default values (party was not applied)+ await expectFormResetToDefaults(partyForm, party);+ });++ test(`switch and restore ${party} via dropdown`, async ({ page }) => {+ // Add a party with "Apply to Current Invoice" checked (default)+ await openNewPartyDialog(page, party);++ const manageDialog = getManagePartyDialog(page, party);++ const dropdownPartyName = `Dropdown Test ${label}`;+ const dropdownPartyAddress = "42 Dropdown Lane";+ const dropdownPartyEmail = `dropdown@${party}.com`;++ await manageDialog+ .getByRole("textbox", { name: "Name" })+ .fill(dropdownPartyName);+ await manageDialog+ .getByRole("textbox", { name: "Address" })+ .fill(dropdownPartyAddress);+ await manageDialog+ .getByRole("textbox", { name: "Email" })+ .fill(dropdownPartyEmail);++ await savePartyDialog(page, party);++ await expect(+ page.getByText(`${label} added and applied to invoice`, {+ exact: true,+ }),+ ).toBeVisible();++ const partyForm = getPartyForm(page, party);+ const partyDropdown = getPartyDropdown(page, party);++ // Party is currently selected in dropdown+ await expect(partyDropdown.locator("option:checked")).toHaveText(+ dropdownPartyName,+ );++ // Verify locked banner is visible when a party is selected+ await expect(+ partyForm.getByTestId(`${party}-locked-banner`),+ ).toBeVisible();++ // Restore to default by selecting the empty option+ await partyDropdown.selectOption("");++ // Verify "<Party> restored to default" toast+ await expect(+ page.getByText(`${label} restored to default`, { exact: true }),+ ).toBeVisible();++ // Verify party is not selected in dropdown+ await expect(partyDropdown.locator("option:checked")).toHaveText(+ `No ${party} selected (default)`,+ );++ // Verify locked banner is hidden after deselecting the party+ await expect(+ partyForm.getByTestId(`${party}-locked-banner`),+ ).toBeHidden();++ // Verify form reset to default values+ await expectFormResetToDefaults(partyForm, party);++ // Reselect the saved party from the dropdown+ await partyDropdown.selectOption({ label: dropdownPartyName });++ // Verify `<Party> "${name}" applied to invoice` toast+ await expect(+ page.getByText(`${label} "${dropdownPartyName}" applied to invoice`, {+ exact: true,+ }),+ ).toBeVisible();++ // Verify party is selected in dropdown+ await expect(partyDropdown.locator("option:checked")).toHaveText(+ dropdownPartyName,+ );++ // Verify locked banner is visible again after reselecting the party+ await expect(+ partyForm.getByTestId(`${party}-locked-banner`),+ ).toBeVisible();++ // Verify form fields are populated with the party's data+ await expect(+ partyForm.getByRole("textbox", { name: "Name" }),+ ).toHaveValue(dropdownPartyName);+ await expect(+ partyForm.getByRole("textbox", { name: "Address" }),+ ).toHaveValue(dropdownPartyAddress);+ await expect(+ partyForm.getByRole("textbox", { name: "Email" }),+ ).toHaveValue(dropdownPartyEmail);+ });++ test(`delete ${party}`, async ({ page }) => {+ // First add a party+ await openNewPartyDialog(page, party);++ const manageDialog = getManagePartyDialog(page, party);++ const deletePartyName = `Test Delete ${label}`;++ await manageDialog+ .getByRole("textbox", { name: "Name" })+ .fill(deletePartyName);+ await manageDialog+ .getByRole("textbox", { name: "Address" })+ .fill("123 Delete Street");+ await manageDialog+ .getByRole("textbox", { name: "Email" })+ .fill("[email protected]");++ await savePartyDialog(page, party);++ // Verify party was added+ const partyForm = getPartyForm(page, party);+ const partyDropdown = getPartyDropdown(page, party);++ await expect(partyDropdown.locator("option:checked")).toHaveText(+ deletePartyName,+ );++ // Click delete button+ await partyForm.getByRole("button", { name: `Delete ${party}` }).click();++ // Verify delete confirmation dialog appears+ await expect(page.getByRole("alertdialog")).toBeVisible();++ // Cancel button is shown+ await expect(page.getByRole("button", { name: "Cancel" })).toBeVisible();++ // Click cancel button+ await page.getByRole("button", { name: "Cancel" }).click();++ // Verify dialog is closed+ await expect(page.getByRole("alertdialog")).toBeHidden();++ // Click delete button once again to open the dialog+ await partyForm.getByRole("button", { name: `Delete ${party}` }).click();++ // Verify delete confirmation dialog appears+ await expect(page.getByRole("alertdialog")).toBeVisible();++ await expect(+ page.getByText(+ `Are you sure you want to delete "${deletePartyName}" ${party}?`,+ ),+ ).toBeVisible();++ // Confirm deletion+ await page.getByRole("button", { name: "Delete" }).click();++ // Verify success message+ await expect(+ page.getByText(`${label} deleted successfully`, { exact: true }),+ ).toBeVisible();++ // Verify party is removed from dropdown+ // because we have only one party, dropdown will be completely hidden+ await expect(+ partyForm.getByRole("combobox", { name: `Select ${label}` }),+ ).toBeHidden();++ // Verify "New <Party>" button is visible after deletion+ const newPartyButton = partyForm.getByRole("button", {+ name: `New ${label}`,+ });++ await expect(newPartyButton).toBeVisible();+ await expect(newPartyButton).toBeEnabled();++ // Verify form is reset to default values+ await expectFormResetToDefaults(partyForm, party);++ await expect(+ partyForm+ .getByRole("group", { name: `${label} Tax Number` })+ .getByRole("textbox", { name: "Label" }),+ ).toHaveValue(defaults.vatNoLabelText);++ await expect(+ partyForm+ .getByRole("group", { name: `${label} Tax Number` })+ .getByRole("textbox", { name: "Value" }),+ ).toHaveValue(defaults.vatNo);+ });++ test(`switches reset to defaults after dialog close and reopen`, async ({+ page,+ }) => {+ await openNewPartyDialog(page, party);++ const manageDialog = getManagePartyDialog(page, party);+ const prefillSwitch = manageDialog.getByRole("switch", {+ name: "Pre-fill with values from the current invoice form",+ });+ const applyToInvoiceSwitch = manageDialog.getByRole("switch", {+ name: "Apply to Current Invoice",+ });++ // Pre-fill switch defaults to off; toggle it on+ await expect(prefillSwitch).not.toBeChecked();+ await prefillSwitch.click();+ await expect(prefillSwitch).toBeChecked();++ // "Apply to Current Invoice" switch defaults to on; toggle it off+ await expect(applyToInvoiceSwitch).toBeChecked();+ await applyToInvoiceSwitch.click();+ await expect(applyToInvoiceSwitch).not.toBeChecked();++ // Close the dialog via Cancel+ await manageDialog.getByRole("button", { name: "Cancel" }).click();+ await expect(manageDialog).toBeHidden();++ // Reopen the dialog+ await openNewPartyDialog(page, party);++ // Both switches must have reset to their defaults and form must be empty+ await expect(prefillSwitch).not.toBeChecked();+ await expect(applyToInvoiceSwitch).toBeChecked();+ await expect(+ manageDialog.getByRole("textbox", { name: "Name" }),+ ).toHaveValue("");+ });++ test.describe("discard changes confirmation", () => {+ test("clean form - Cancel closes without confirm", async ({ page }) => {+ await openNewPartyDialog(page, party);++ const manageDialog = getManagePartyDialog(page, party);++ await manageDialog.getByRole("button", { name: "Cancel" }).click();++ await expect(manageDialog).toBeHidden();++ await expect(page.getByTestId("confirm-discard-dialog")).toBeHidden();+ });++ test("clean form - X button closes without confirm", async ({ page }) => {+ await openNewPartyDialog(page, party);++ const manageDialog = getManagePartyDialog(page, party);++ await manageDialog.getByRole("button", { name: "Close" }).click();++ await expect(manageDialog).toBeHidden();++ await expect(page.getByTestId("confirm-discard-dialog")).toBeHidden();+ });++ test("dirty form - Cancel - accept discards changes and closes", async ({+ page,+ }) => {+ await openNewPartyDialog(page, party);++ const manageDialog = getManagePartyDialog(page, party);+ await manageDialog+ .getByRole("textbox", { name: "Name" })+ .fill(`Unsaved ${label}`);++ await manageDialog.getByRole("button", { name: "Cancel" }).click();++ const confirmDialog = page.getByTestId("confirm-discard-dialog");++ await expect(confirmDialog).toBeVisible();+ await expect(+ confirmDialog.getByText(`Discard changes to ${party}?`),+ ).toBeVisible();++ await expect(+ confirmDialog.getByText(+ "You have unsaved changes. They will be lost.",+ ),+ ).toBeVisible();++ await expect(+ confirmDialog.getByRole("button", { name: "Discard changes" }),+ ).toBeVisible();++ await confirmDialog+ .getByRole("button", { name: "Discard changes" })+ .click();++ await expect(confirmDialog).toBeHidden();+ await expect(manageDialog).toBeHidden();+ });++ test("dirty form - Cancel - dismiss keeps dialog open with values intact", async ({+ page,+ }) => {+ await openNewPartyDialog(page, party);++ const manageDialog = getManagePartyDialog(page, party);+ const nameInput = manageDialog.getByRole("textbox", {+ name: "Name",+ });+ await nameInput.fill(`Unsaved ${label}`);++ await manageDialog.getByRole("button", { name: "Cancel" }).click();++ const confirmDialog = page.getByTestId("confirm-discard-dialog");++ await expect(confirmDialog).toBeVisible();++ await confirmDialog+ .getByRole("button", { name: "Keep editing" })+ .click();++ await expect(confirmDialog).toBeHidden();++ await expect(manageDialog).toBeVisible();+ await expect(nameInput).toHaveValue(`Unsaved ${label}`);+ });++ test("dirty form - X button - accept discards changes and closes", async ({+ page,+ }) => {+ await openNewPartyDialog(page, party);++ const manageDialog = getManagePartyDialog(page, party);+ await manageDialog+ .getByRole("textbox", { name: "Name" })+ .fill(`Unsaved ${label}`);++ await manageDialog.getByRole("button", { name: "Close" }).click();++ const confirmDialog = page.getByTestId("confirm-discard-dialog");+ await expect(confirmDialog).toBeVisible();+ await confirmDialog+ .getByRole("button", { name: "Discard changes" })+ .click();++ await expect(confirmDialog).toBeHidden();+ await expect(manageDialog).toBeHidden();+ });++ test("dirty form - Escape - accept discards changes and closes", async ({+ page,+ }) => {+ await openNewPartyDialog(page, party);++ const manageDialog = getManagePartyDialog(page, party);+ await manageDialog+ .getByRole("textbox", { name: "Name" })+ .fill(`Unsaved ${label}`);++ await page.keyboard.press("Escape");++ const confirmDialog = page.getByTestId("confirm-discard-dialog");+ await expect(confirmDialog).toBeVisible();+ await confirmDialog+ .getByRole("button", { name: "Discard changes" })+ .click();++ await expect(confirmDialog).toBeHidden();+ await expect(manageDialog).toBeHidden();+ });+ });++ test.describe("pre-fill switch dirty guard", () => {+ test("toggling switch ON with dirty form shows confirm dialog", async ({+ page,+ }) => {+ await openNewPartyDialog(page, party);++ const manageDialog = getManagePartyDialog(page, party);+ await manageDialog+ .getByRole("textbox", { name: "Name" })+ .fill(`Draft ${label}`);++ const prefillSwitch = manageDialog.getByRole("switch", {+ name: "Pre-fill with values from the current invoice form",+ });+ await expect(prefillSwitch).not.toBeChecked();++ await prefillSwitch.click();++ const confirmDialog = page.getByTestId("confirm-discard-dialog");+ await expect(confirmDialog).toBeVisible();++ // Switch has not changed yet — still OFF while dialog is open+ await expect(+ getManagePartyDialog(page, party).getByRole("switch", {+ name: "Pre-fill with values from the current invoice form",+ includeHidden: true, // dialog is still open, but on one level deeper+ }),+ ).not.toBeChecked();++ // Dialog is still open+ await expect(manageDialog).toBeVisible();+ });++ test("toggling switch ON with dirty form - confirm applies pre-fill and clears draft", async ({+ page,+ }) => {+ await openNewPartyDialog(page, party);++ const manageDialog = getManagePartyDialog(page, party);++ // Dirty the form+ const nameInput = manageDialog.getByRole("textbox", {+ name: "Name",+ });+ await nameInput.fill(`Draft ${label}`);++ const prefillSwitch = manageDialog.getByRole("switch", {+ name: "Pre-fill with values from the current invoice form",+ });+ await prefillSwitch.click();++ const confirmDialog = page.getByTestId("confirm-discard-dialog");+ await expect(confirmDialog).toBeVisible();++ await confirmDialog+ .getByRole("button", { name: "Discard changes" })+ .click();++ await expect(confirmDialog).toBeHidden();++ // Switch is now ON+ await expect(prefillSwitch).toBeChecked();++ // Dialog remains open (we only reset the form, not close the dialog)+ await expect(manageDialog).toBeVisible();++ // Draft text is gone — form was reset with pre-fill values+ await expect(nameInput).not.toHaveValue(`Draft ${label}`);+ await expect(nameInput).toHaveValue(defaults.name);+ });++ test("toggling switch ON with dirty form - Keep editing preserves draft and switch stays OFF", async ({+ page,+ }) => {+ await openNewPartyDialog(page, party);++ const manageDialog = getManagePartyDialog(page, party);+ const nameInput = manageDialog.getByRole("textbox", {+ name: "Name",+ });+ await nameInput.fill(`Draft ${label}`);++ const prefillSwitch = manageDialog.getByRole("switch", {+ name: "Pre-fill with values from the current invoice form",+ });+ await prefillSwitch.click();++ const confirmDialog = page.getByTestId("confirm-discard-dialog");+ await expect(confirmDialog).toBeVisible();++ await confirmDialog+ .getByRole("button", { name: "Keep editing" })+ .click();++ await expect(confirmDialog).toBeHidden();++ // Switch remains OFF — the toggle was cancelled+ await expect(prefillSwitch).not.toBeChecked();++ // Dialog still open with draft intact+ await expect(manageDialog).toBeVisible();+ await expect(nameInput).toHaveValue(`Draft ${label}`);+ });++ test("toggling switch OFF (while ON + dirty) shows confirm dialog", async ({+ page,+ }) => {+ await openNewPartyDialog(page, party);++ const manageDialog = getManagePartyDialog(page, party);+ const prefillSwitch = manageDialog.getByRole("switch", {+ name: "Pre-fill with values from the current invoice form",+ });++ // Enable pre-fill while form is clean+ await prefillSwitch.click();+ await expect(prefillSwitch).toBeChecked();++ // Dirty the form+ await manageDialog+ .getByRole("textbox", { name: "Name" })+ .fill("Edited after pre-fill");++ // Toggle switch OFF while dirty+ await prefillSwitch.click();++ const confirmDialog = page.getByTestId("confirm-discard-dialog");+ await expect(confirmDialog).toBeVisible();++ // Switch remains ON while dialog is open+ await expect(+ getManagePartyDialog(page, party).getByRole("switch", {+ name: "Pre-fill with values from the current invoice form",+ includeHidden: true, // dialog is still open, but on one level deeper+ }),+ ).toBeChecked();+ });++ test("toggling switch OFF with dirty form - confirm resets to empty form", async ({+ page,+ }) => {+ await openNewPartyDialog(page, party);++ const manageDialog = getManagePartyDialog(page, party);+ const prefillSwitch = manageDialog.getByRole("switch", {+ name: "Pre-fill with values from the current invoice form",+ });+ const nameInput = manageDialog.getByRole("textbox", {+ name: "Name",+ });++ // Enable pre-fill while form is clean+ await prefillSwitch.click();+ await expect(prefillSwitch).toBeChecked();++ // Dirty the form+ await nameInput.fill("Edited after pre-fill");++ // Toggle switch OFF while dirty+ await prefillSwitch.click();++ const confirmDialog = page.getByTestId("confirm-discard-dialog");+ await expect(confirmDialog).toBeVisible();++ await confirmDialog+ .getByRole("button", { name: "Discard changes" })+ .click();++ await expect(confirmDialog).toBeHidden();++ // Switch is now OFF+ await expect(prefillSwitch).not.toBeChecked();++ // Dialog remains open+ await expect(manageDialog).toBeVisible();++ // Form was reset to empty (no pre-fill values, no edited text)+ await expect(nameInput).toHaveValue("");+ });++ test("toggling switch OFF with dirty form - Keep editing preserves draft and switch stays ON", async ({+ page,+ }) => {+ await openNewPartyDialog(page, party);++ const manageDialog = getManagePartyDialog(page, party);+ const prefillSwitch = manageDialog.getByRole("switch", {+ name: "Pre-fill with values from the current invoice form",+ });+ const nameInput = manageDialog.getByRole("textbox", {+ name: "Name",+ });++ // Enable pre-fill while form is clean+ await prefillSwitch.click();+ await expect(prefillSwitch).toBeChecked();++ // Dirty the form+ await nameInput.fill("Edited after pre-fill");++ // Toggle switch OFF while dirty+ await prefillSwitch.click();++ const confirmDialog = page.getByTestId("confirm-discard-dialog");+ await expect(confirmDialog).toBeVisible();++ await confirmDialog+ .getByRole("button", { name: "Keep editing" })+ .click();++ await expect(confirmDialog).toBeHidden();++ // Switch remains ON+ await expect(prefillSwitch).toBeChecked();++ // Dialog still open with draft intact+ await expect(manageDialog).toBeVisible();+ await expect(nameInput).toHaveValue("Edited after pre-fill");+ });+ });++ test("trims whitespace from name and other fields before saving", async ({+ page,+ }) => {+ await openNewPartyDialog(page, party);++ const manageDialog = getManagePartyDialog(page, party);++ await manageDialog+ .getByRole("textbox", { name: "Name" })+ .fill(" Acme Corp ");+ await manageDialog+ .getByRole("textbox", { name: "Address" })+ .fill(" 123 Main St ");+ await manageDialog+ .getByRole("textbox", { name: "Email" })+ .fill(" [email protected] ");++ await savePartyDialog(page, party);++ await expect(+ page.getByText(`${label} added and applied to invoice`, {+ exact: true,+ }),+ ).toBeVisible();++ const storedParties = await readStoredParties(page, party);++ expect(storedParties).toHaveLength(1);+ expect(storedParties[0].name).toBe("Acme Corp");+ expect(storedParties[0].address).toBe("123 Main St");+ expect(storedParties[0].email).toBe("[email protected]");+ });++ test(`rejects whitespace-padded name that duplicates an existing ${party}`, async ({+ page,+ }) => {+ await page.addInitScript(+ ({ key, existingParty }) => {+ localStorage.setItem(key, JSON.stringify([existingParty]));+ },+ {+ key: storageKey,+ existingParty: {+ id: `existing-${party}-id`,+ name: "Acme Corp",+ address: "1 Road",+ email: "",+ emailFieldIsVisible: true,+ vatNo: "",+ vatNoLabelText: "Tax Number",+ vatNoFieldIsVisible: true,+ notes: "",+ notesFieldIsVisible: true,+ ...(BANK_DETAILS[party]+ ? {+ accountNumber: "",+ accountNumberFieldIsVisible: true,+ swiftBic: "",+ swiftBicFieldIsVisible: true,+ }+ : {}),+ },+ },+ );++ await page.goto("/?template=default");+ await expect(page).toHaveURL("/?template=default");++ await openNewPartyDialog(page, party);++ const manageDialog = getManagePartyDialog(page, party);++ await manageDialog+ .getByRole("textbox", { name: "Name" })+ .fill(" Acme Corp ");+ await manageDialog+ .getByRole("textbox", { name: "Address" })+ .fill("2 Avenue");++ await savePartyDialog(page, party);++ await expect(+ manageDialog.getByText(`A ${party} with this name already exists`, {+ exact: true,+ }),+ ).toBeVisible();++ // Dialog should remain open+ await expect(manageDialog).toBeVisible();++ // Only the pre-seeded party should exist in localStorage+ const storedParties = await readStoredParties(page, party);++ expect(storedParties).toHaveLength(1);+ expect(storedParties[0].name).toBe("Acme Corp");+ });+ });+}diff --git a/e2e/seller.test.ts b/e2e/seller.test.tsdeleted file mode 100644index 1604f8b..0000000--- a/e2e/seller.test.ts+++ /dev/null@@ -1,1169 +0,0 @@-import { DEFAULT_SELLER_DATA } from "@/app/constants";-import { type SellerData } from "@/app/schema";-import { expect, test } from "@playwright/test";--test.describe("Seller management", () => {- test.beforeEach(async ({ page }) => {- await page.goto("/?template=default");-- await expect(page).toHaveURL("/?template=default");- });-- test("create/edit seller", async ({ page }) => {- // Open seller management dialog- await page.getByRole("button", { name: "New Seller" }).click();-- // Fill in all seller details- const TEST_SELLER_DATA = {- name: "New Test Company",- address: "123 Test Street\nTest City, 12345\nTest Country",-- vatNoFieldIsVisible: true,- vatNo: "123456789",- vatNoLabelText: "Tax Number",-- email: "[email protected]",- emailFieldIsVisible: true,-- accountNumberFieldIsVisible: true,- accountNumber: "1234-5678-9012-3456",-- swiftBicFieldIsVisible: true,- swiftBic: "TESTBICX",-- notesFieldIsVisible: true,- notes: "This is a SELLER test note",- } as const satisfies SellerData;-- const manageSellerDialog = page.getByTestId(`manage-seller-dialog`);-- // Verify "Pre-fill with values from the current invoice form" switch is visible- const prefillSwitch = manageSellerDialog.getByRole("switch", {- name: `Pre-fill with values from the current invoice form`,- });- await expect(prefillSwitch).toBeVisible();- await expect(prefillSwitch).not.toBeChecked();-- // Verify the label is visible- await expect(- manageSellerDialog.getByLabel(- "Pre-fill with values from the current invoice form",- ),- ).toBeVisible();-- /*- * TEST SELLER MANAGEMENT DIALOG FORM- */-- // Fill in form fields- await manageSellerDialog- .getByRole("textbox", { name: "Name" })- .fill(TEST_SELLER_DATA.name);-- await manageSellerDialog- .getByRole("textbox", { name: "Address" })- .fill(TEST_SELLER_DATA.address);-- // Fill Tax Number fieldset (Label and Value)- const vatNumberFieldset = manageSellerDialog.getByRole("group", {- name: "Seller Tax Number",- });-- await vatNumberFieldset- .getByRole("textbox", { name: "Label" })- .fill(TEST_SELLER_DATA.vatNoLabelText);-- await vatNumberFieldset- .getByRole("textbox", { name: "Value" })- .fill(TEST_SELLER_DATA.vatNo);-- await manageSellerDialog- .getByRole("textbox", { name: "Email" })- .fill(TEST_SELLER_DATA.email);- await manageSellerDialog- .getByRole("textbox", { name: "Account Number" })- .fill(TEST_SELLER_DATA.accountNumber);- await manageSellerDialog- .getByRole("textbox", { name: "SWIFT/BIC" })- .fill(TEST_SELLER_DATA.swiftBic);-- const emailSwitchInDialogForm = manageSellerDialog.getByRole("switch", {- name: `Show the 'Email' field in the PDF`,- });-- const taxNumberSwitchInDialogForm = manageSellerDialog.getByRole("switch", {- name: `Show the 'Tax Number' field in the PDF`,- });-- const accountNumberSwitchInDialogForm = manageSellerDialog.getByRole(- "switch",- {- name: `Show the 'Account Number' field in the PDF`,- },- );- const swiftBicSwitchInDialogForm = manageSellerDialog.getByRole("switch", {- name: `Show the 'SWIFT/BIC' field in the PDF`,- });-- // Verify all switches are checked by default- await expect(emailSwitchInDialogForm).toBeChecked();- await expect(taxNumberSwitchInDialogForm).toBeChecked();- await expect(accountNumberSwitchInDialogForm).toBeChecked();- await expect(swiftBicSwitchInDialogForm).toBeChecked();-- // Toggle Email visibility switch- await emailSwitchInDialogForm.click();-- await expect(emailSwitchInDialogForm).not.toBeChecked();-- // Toggle some visibility switches- await accountNumberSwitchInDialogForm.click(); // Toggle Account Number visibility-- await expect(accountNumberSwitchInDialogForm).not.toBeChecked();- await swiftBicSwitchInDialogForm.click(); // Toggle SWIFT/BIC visibility-- await expect(swiftBicSwitchInDialogForm).not.toBeChecked();-- // Fill in notes field- await manageSellerDialog- .getByRole("textbox", { name: "Notes" })- .fill(TEST_SELLER_DATA.notes);-- const notesSellerSwitch = manageSellerDialog.getByTestId(- `sellerNotesDialogFieldVisibilitySwitch`,- );-- await expect(notesSellerSwitch).toHaveRole("switch");-- // Verify notes visibility switch is CHECKED by default- await expect(notesSellerSwitch).toBeChecked();-- // Verify "Apply to Current Invoice" switch is checked by default- await expect(- manageSellerDialog.getByRole("switch", {- name: "Apply to Current Invoice",- }),- ).toBeChecked();-- // Cancel button is shown- await expect(- manageSellerDialog.getByRole("button", { name: "Cancel" }),- ).toBeVisible();-- // Save seller- await manageSellerDialog- .getByRole("button", { name: "Save Seller" })- .click();-- // Verify seller data is actually saved in localStorage- const storedData = (await page.evaluate(() => {- return localStorage.getItem("EASY_INVOICE_PDF_SELLERS");- })) as string;- expect(storedData).toBeTruthy();-- const parsedData = JSON.parse(storedData) as SellerData[];-- expect(parsedData[0]).toMatchObject({- name: TEST_SELLER_DATA.name,- address: TEST_SELLER_DATA.address,-- vatNo: TEST_SELLER_DATA.vatNo,- vatNoFieldIsVisible: TEST_SELLER_DATA.vatNoFieldIsVisible,- vatNoLabelText: TEST_SELLER_DATA.vatNoLabelText,-- email: TEST_SELLER_DATA.email,- emailFieldIsVisible: false,-- accountNumber: TEST_SELLER_DATA.accountNumber,- accountNumberFieldIsVisible: false,-- swiftBic: TEST_SELLER_DATA.swiftBic,- swiftBicFieldIsVisible: false,-- notes: TEST_SELLER_DATA.notes,- notesFieldIsVisible: true,- } satisfies SellerData);-- // Verify success toast message is visible- await expect(- page.getByText("Seller added and applied to invoice", { exact: true }),- ).toBeVisible();-- /*- * TEST SAVED DETAILS IN INVOICE FORM AFTER SAVING SELLER IN DIALOG- */-- // Verify all saved details in the Seller Information section form- const sellerForm = page.getByTestId(`seller-information-section`);-- // Verify the seller appears in the dropdown- const sellerDropdown = sellerForm.getByRole("combobox", {- name: "Select Seller",- });-- // Verify the seller is selected in dropdown- await expect(sellerDropdown.locator("option:checked")).toHaveText(- TEST_SELLER_DATA.name,- );-- // Verify the locked banner is visible with correct text- const sellerLockedBanner = sellerForm.getByTestId("seller-locked-banner");- await expect(sellerLockedBanner).toBeVisible();- await expect(sellerLockedBanner).toContainText(- "To modify seller details, click the Edit seller button (pencil icon) next to the dropdown above.",- );-- // Seller Name- await expect(- sellerForm.getByRole("textbox", { name: "Name (Required)" }),- ).toHaveValue(TEST_SELLER_DATA.name);-- // Seller Address- await expect(- sellerForm.getByRole("textbox", { name: "Address (Required)" }),- ).toHaveValue(TEST_SELLER_DATA.address);-- // Seller Tax Number- const sellerVatFieldset = sellerForm.getByRole("group", {- name: "Seller Tax Number",- });-- await expect(- sellerVatFieldset.getByRole("textbox", { name: "Label" }),- ).toHaveValue(TEST_SELLER_DATA.vatNoLabelText);-- await expect(- sellerVatFieldset.getByRole("textbox", { name: "Value" }),- ).toHaveValue(TEST_SELLER_DATA.vatNo);-- const vatNumberSwitch = sellerForm.getByTestId(`sellerVatNoFieldIsVisible`);- // Verify VAT Number switch is visible- await expect(vatNumberSwitch).toBeChecked();- await expect(vatNumberSwitch).toBeDisabled();-- // Seller Email- await expect(- sellerForm.getByRole("textbox", { name: "Email" }),- ).toHaveValue(TEST_SELLER_DATA.email);-- const emailSwitchNotInDialog = sellerForm.getByRole("switch", {- name: `Show the 'Email' field in the PDF`,- });- // Verify Email switch is not checked as we toggled it off- await expect(emailSwitchNotInDialog).not.toBeChecked();- await expect(emailSwitchNotInDialog).toBeDisabled();-- // Seller Account Number- await expect(- sellerForm.getByRole("textbox", { name: "Account Number" }),- ).toHaveValue(TEST_SELLER_DATA.accountNumber);-- const accountNumberSwitchNotInDialog = sellerForm.getByTestId(- `sellerAccountNumberFieldIsVisible`,- );- // Verify Account Number switch is visible- await expect(accountNumberSwitchNotInDialog).not.toBeChecked();- await expect(accountNumberSwitchNotInDialog).toBeDisabled();-- // Seller SWIFT/BIC- await expect(- sellerForm.getByRole("textbox", { name: "SWIFT/BIC" }),- ).toHaveValue(TEST_SELLER_DATA.swiftBic);-- const swiftBicSwitchNotInDialog = sellerForm.getByTestId(- `sellerSwiftBicFieldIsVisible`,- );- // Verify SWIFT/BIC switch is visible- await expect(swiftBicSwitchNotInDialog).not.toBeChecked();- await expect(swiftBicSwitchNotInDialog).toBeDisabled();-- // Seller Notes- await expect(- sellerForm.getByRole("textbox", { name: "Notes" }),- ).toHaveValue(TEST_SELLER_DATA.notes);-- const notesSwitch = sellerForm.getByTestId(- `sellerNotesInvoiceFormFieldVisibilitySwitch`,- );- // Verify Notes switch is visible- await expect(notesSwitch).toBeChecked();- await expect(notesSwitch).toBeDisabled();-- // Verify the seller appears in the dropdown- await expect(- sellerForm.getByRole("combobox", { name: "Select Seller" }),- ).toContainText(TEST_SELLER_DATA.name);-- // Test edit functionality- await sellerForm.getByRole("button", { name: "Edit seller" }).click();-- /*- * TEST EDIT FUNCTIONALITY IN SELLER MANAGEMENT DIALOG- */-- // Verify all fields are populated in edit dialog- await expect(- manageSellerDialog.getByRole("textbox", { name: "Name" }),- ).toHaveValue(TEST_SELLER_DATA.name);- await expect(- manageSellerDialog.getByRole("textbox", { name: "Address" }),- ).toHaveValue(TEST_SELLER_DATA.address);-- await expect(- manageSellerDialog- .getByRole("group", { name: "Seller Tax Number" })- .getByRole("textbox", { name: "Label" }),- ).toHaveValue(TEST_SELLER_DATA.vatNoLabelText);-- await expect(- manageSellerDialog- .getByRole("group", { name: "Seller Tax Number" })- .getByRole("textbox", { name: "Value" }),- ).toHaveValue(TEST_SELLER_DATA.vatNo);-- await expect(- manageSellerDialog.getByRole("textbox", { name: "Email" }),- ).toHaveValue(TEST_SELLER_DATA.email);- await expect(- manageSellerDialog.getByRole("textbox", { name: "Account Number" }),- ).toHaveValue(TEST_SELLER_DATA.accountNumber);- await expect(- manageSellerDialog.getByRole("textbox", { name: "SWIFT/BIC" }),- ).toHaveValue(TEST_SELLER_DATA.swiftBic);-- // Verify visibility switches state persisted in edit dialog- await expect(emailSwitchInDialogForm).not.toBeChecked();- await expect(taxNumberSwitchInDialogForm).toBeChecked();- await expect(accountNumberSwitchInDialogForm).not.toBeChecked();- await expect(swiftBicSwitchInDialogForm).not.toBeChecked();-- // Verify notes text- await expect(- manageSellerDialog.getByRole("textbox", { name: "Notes" }),- ).toHaveValue(TEST_SELLER_DATA.notes);-- // Verify notes visibility switch is checked- const notesManageSellerDialogFormSwitch = manageSellerDialog.getByTestId(- `sellerNotesDialogFieldVisibilitySwitch`,- );-- await expect(notesManageSellerDialogFormSwitch).toBeChecked();- await expect(notesManageSellerDialogFormSwitch).toBeEnabled();- });-- test("add seller without applying to invoice", async ({ page }) => {- await page.getByRole("button", { name: "New Seller" }).click();-- const TEST_SELLER_DATA = {- name: "Unapplied Test Seller",- address: "99 Unapplied Street",- email: "[email protected]",- emailFieldIsVisible: true,-- vatNoFieldIsVisible: true,- vatNo: "VAT999",- vatNoLabelText: "Tax Number",-- accountNumberFieldIsVisible: true,- accountNumber: "ACCT-999",-- swiftBicFieldIsVisible: true,- swiftBic: "SWIFT999",-- notesFieldIsVisible: true,- notes: "",- } as const satisfies SellerData;-- const manageSellerDialog = page.getByTestId(`manage-seller-dialog`);-- await manageSellerDialog- .getByRole("textbox", { name: "Name" })- .fill(TEST_SELLER_DATA.name);- await manageSellerDialog- .getByRole("textbox", { name: "Address" })- .fill(TEST_SELLER_DATA.address);- await manageSellerDialog- .getByRole("textbox", { name: "Email" })- .fill(TEST_SELLER_DATA.email);-- // Uncheck "Apply to Current Invoice" switch- const applyToInvoiceSwitch = manageSellerDialog.getByRole("switch", {- name: "Apply to Current Invoice",- });-- await expect(applyToInvoiceSwitch).toBeChecked();- await applyToInvoiceSwitch.click();- await expect(applyToInvoiceSwitch).not.toBeChecked();-- await manageSellerDialog- .getByRole("button", { name: "Save Seller" })- .click();-- // Verify "Seller added successfully" toast (NOT "applied to invoice")- await expect(- page.getByText("Seller added successfully", { exact: true }),- ).toBeVisible();-- const sellerForm = page.getByTestId(`seller-information-section`);-- const sellerDropdown = sellerForm.getByRole("combobox", {- name: "Select Seller",- });-- // Seller should appear in dropdown options but not be selected- await expect(sellerDropdown).toBeVisible();-- // Verify the seller is not selected in dropdown- await expect(sellerDropdown.locator("option:checked")).toHaveText(- "No seller selected (default)",- );-- // Form fields should still contain default values (seller was not applied)- await expect(sellerForm.getByRole("textbox", { name: "Name" })).toHaveValue(- DEFAULT_SELLER_DATA.name,- );- await expect(- sellerForm.getByRole("textbox", { name: "Address" }),- ).toHaveValue(DEFAULT_SELLER_DATA.address);- await expect(- sellerForm.getByRole("textbox", { name: "Email" }),- ).toHaveValue(DEFAULT_SELLER_DATA.email);- });-- test("switch and restore seller via dropdown", async ({ page }) => {- // Add a seller with "Apply to Current Invoice" checked (default)- await page.getByRole("button", { name: "New Seller" }).click();-- const TEST_SELLER_DATA = {- name: "Dropdown Test Seller",- address: "42 Dropdown Lane",- email: "[email protected]",- emailFieldIsVisible: true,-- vatNoFieldIsVisible: true,- vatNo: "VAT-DROP-001",- vatNoLabelText: "Tax Number",-- accountNumberFieldIsVisible: true,- accountNumber: "ACCT-DROP-001",-- swiftBicFieldIsVisible: true,- swiftBic: "SWIFTDROP",-- notesFieldIsVisible: true,- notes: "",- } as const satisfies SellerData;-- const manageSellerDialog = page.getByTestId(`manage-seller-dialog`);-- await manageSellerDialog- .getByRole("textbox", { name: "Name" })- .fill(TEST_SELLER_DATA.name);- await manageSellerDialog- .getByRole("textbox", { name: "Address" })- .fill(TEST_SELLER_DATA.address);- await manageSellerDialog- .getByRole("textbox", { name: "Email" })- .fill(TEST_SELLER_DATA.email);-- await manageSellerDialog- .getByRole("button", { name: "Save Seller" })- .click();-- await expect(- page.getByText("Seller added and applied to invoice", { exact: true }),- ).toBeVisible();-- const sellerForm = page.getByTestId(`seller-information-section`);- const sellerDropdown = sellerForm.getByRole("combobox", {- name: "Select Seller",- });-- // Seller is currently selected in dropdown- await expect(sellerDropdown.locator("option:checked")).toHaveText(- TEST_SELLER_DATA.name,- );-- // Verify locked banner is visible when seller is selected- await expect(sellerForm.getByTestId("seller-locked-banner")).toBeVisible();-- // Restore to default by selecting the empty option- await sellerDropdown.selectOption("");-- // Verify "Seller restored to default" toast- await expect(- page.getByText("Seller restored to default", { exact: true }),- ).toBeVisible();-- // Verify seller is not selected in dropdown- await expect(sellerDropdown.locator("option:checked")).toHaveText(- "No seller selected (default)",- );-- // Verify locked banner is hidden after deselecting seller- await expect(sellerForm.getByTestId("seller-locked-banner")).toBeHidden();-- // Verify form reset to default values- await expect(sellerForm.getByRole("textbox", { name: "Name" })).toHaveValue(- DEFAULT_SELLER_DATA.name,- );- await expect(- sellerForm.getByRole("textbox", { name: "Address" }),- ).toHaveValue(DEFAULT_SELLER_DATA.address);- await expect(- sellerForm.getByRole("textbox", { name: "Email" }),- ).toHaveValue(DEFAULT_SELLER_DATA.email);-- // Reselect the saved seller from the dropdown- await sellerDropdown.selectOption({ label: TEST_SELLER_DATA.name });-- // Verify `Seller "${name}" applied to invoice` toast- await expect(- page.getByText(`Seller "${TEST_SELLER_DATA.name}" applied to invoice`, {- exact: true,- }),- ).toBeVisible();-- // Verify seller is selected in dropdown- await expect(sellerDropdown.locator("option:checked")).toHaveText(- TEST_SELLER_DATA.name,- );-- // Verify locked banner is visible again after reselecting seller- await expect(sellerForm.getByTestId("seller-locked-banner")).toBeVisible();-- // Verify form fields are populated with the seller's data- await expect(sellerForm.getByRole("textbox", { name: "Name" })).toHaveValue(- TEST_SELLER_DATA.name,- );- await expect(- sellerForm.getByRole("textbox", { name: "Address" }),- ).toHaveValue(TEST_SELLER_DATA.address);- await expect(- sellerForm.getByRole("textbox", { name: "Email" }),- ).toHaveValue(TEST_SELLER_DATA.email);- });-- test("delete seller", async ({ page }) => {- // First add a seller- await page.getByRole("button", { name: "New Seller" }).click();-- const testData = {- name: "Test Delete Seller",- address: "123 Delete Street",- email: "[email protected]",- emailFieldIsVisible: true,-- vatNoFieldIsVisible: true,- vatNo: "123456789",- vatNoLabelText: "Tax Number",-- accountNumberFieldIsVisible: true,- accountNumber: "123456789",-- swiftBicFieldIsVisible: true,- swiftBic: "123456789",-- notesFieldIsVisible: true,- notes: "This is a test note",- } as const satisfies SellerData;-- const manageSellerDialog = page.getByTestId(`manage-seller-dialog`);-- // Fill in basic seller details- await manageSellerDialog- .getByRole("textbox", { name: "Name" })- .fill(testData.name);- await manageSellerDialog- .getByRole("textbox", { name: "Address" })- .fill(testData.address);- await manageSellerDialog- .getByRole("textbox", { name: "Email" })- .fill(testData.email);-- // Save seller- await manageSellerDialog- .getByRole("button", { name: "Save Seller" })- .click();-- // Verify seller was added- const sellerForm = page.getByTestId(`seller-information-section`);-- const sellerDropdown = sellerForm.getByRole("combobox", {- name: "Select Seller",- });-- await expect(sellerDropdown.locator("option:checked")).toHaveText(- testData.name,- );-- // Click delete button- await sellerForm.getByRole("button", { name: "Delete seller" }).click();-- // Verify delete confirmation dialog appears- await expect(page.getByRole("alertdialog")).toBeVisible();-- // Cancel button is shown- await expect(page.getByRole("button", { name: "Cancel" })).toBeVisible();-- // Click cancel button- await page.getByRole("button", { name: "Cancel" }).click();-- // Verify dialog is closed- await expect(page.getByRole("alertdialog")).toBeHidden();-- // Click delete button once again to open the dialog- await sellerForm.getByRole("button", { name: "Delete seller" }).click();-- // Verify delete confirmation dialog appears- await expect(page.getByRole("alertdialog")).toBeVisible();-- await expect(- page.getByText(- `Are you sure you want to delete "${testData.name}" seller?`,- ),- ).toBeVisible();-- // Confirm deletion- await page.getByRole("button", { name: "Delete" }).click();-- // Verify success message- await expect(- page.getByText("Seller deleted successfully", { exact: true }),- ).toBeVisible();-- // Verify seller is removed from dropdown- // because we have only one seller, dropdown will be completely hidden- await expect(- sellerForm.getByRole("combobox", { name: "Select Seller" }),- ).toBeHidden();-- // Verify "New Seller" button is visible after deletion- const newSellerButton = sellerForm.getByRole("button", {- name: "New Seller",- });-- await expect(newSellerButton).toBeVisible();- await expect(newSellerButton).toBeEnabled();-- // Verify form is reset to default values- await expect(sellerForm.getByRole("textbox", { name: "Name" })).toHaveValue(- DEFAULT_SELLER_DATA.name,- );- await expect(- sellerForm.getByRole("textbox", { name: "Address" }),- ).toHaveValue(DEFAULT_SELLER_DATA.address);-- await expect(- sellerForm.getByRole("textbox", { name: "Email" }),- ).toHaveValue(DEFAULT_SELLER_DATA.email);-- await expect(- sellerForm- .getByRole("group", { name: "Seller Tax Number" })- .getByRole("textbox", { name: "Label" }),- ).toHaveValue(DEFAULT_SELLER_DATA.vatNoLabelText);-- await expect(- sellerForm- .getByRole("group", { name: "Seller Tax Number" })- .getByRole("textbox", { name: "Value" }),- ).toHaveValue(DEFAULT_SELLER_DATA.vatNo);-- await expect(- sellerForm.getByRole("textbox", { name: "Account Number" }),- ).toHaveValue(DEFAULT_SELLER_DATA.accountNumber);-- await expect(- sellerForm.getByRole("textbox", { name: "SWIFT/BIC" }),- ).toHaveValue(DEFAULT_SELLER_DATA.swiftBic);- });-- test("switches reset to defaults after dialog close and reopen", async ({- page,- }) => {- await page.getByRole("button", { name: "New Seller" }).click();-- const manageSellerDialog = page.getByTestId("manage-seller-dialog");- const prefillSwitch = manageSellerDialog.getByRole("switch", {- name: "Pre-fill with values from the current invoice form",- });- const applyToInvoiceSwitch = manageSellerDialog.getByRole("switch", {- name: "Apply to Current Invoice",- });-- // Pre-fill switch defaults to off; toggle it on- await expect(prefillSwitch).not.toBeChecked();- await prefillSwitch.click();- await expect(prefillSwitch).toBeChecked();-- // "Apply to Current Invoice" switch defaults to on; toggle it off- await expect(applyToInvoiceSwitch).toBeChecked();- await applyToInvoiceSwitch.click();- await expect(applyToInvoiceSwitch).not.toBeChecked();-- // Close the dialog via Cancel- await manageSellerDialog.getByRole("button", { name: "Cancel" }).click();- await expect(manageSellerDialog).toBeHidden();-- // Reopen the dialog- await page.getByRole("button", { name: "New Seller" }).click();- await expect(manageSellerDialog).toBeVisible();-- // Both switches must have reset to their defaults and form must be empty- await expect(prefillSwitch).not.toBeChecked();- await expect(applyToInvoiceSwitch).toBeChecked();- await expect(- manageSellerDialog.getByRole("textbox", { name: "Name" }),- ).toHaveValue("");- });-- test.describe("discard changes confirmation", () => {- test("clean form - Cancel closes without confirm", async ({ page }) => {- await page.getByRole("button", { name: "New Seller" }).click();-- const manageSellerDialog = page.getByTestId("manage-seller-dialog");- await expect(manageSellerDialog).toBeVisible();-- await manageSellerDialog.getByRole("button", { name: "Cancel" }).click();-- await expect(manageSellerDialog).toBeHidden();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeHidden();- });-- test("clean form - X button closes without confirm", async ({ page }) => {- await page.getByRole("button", { name: "New Seller" }).click();-- const manageSellerDialog = page.getByTestId("manage-seller-dialog");- await expect(manageSellerDialog).toBeVisible();-- await manageSellerDialog.getByRole("button", { name: "Close" }).click();-- await expect(manageSellerDialog).toBeHidden();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeHidden();- });-- test("dirty form - Cancel - accept discards changes and closes", async ({- page,- }) => {- await page.getByRole("button", { name: "New Seller" }).click();-- const manageSellerDialog = page.getByTestId("manage-seller-dialog");- await manageSellerDialog- .getByRole("textbox", { name: "Name" })- .fill("Unsaved Seller");-- await manageSellerDialog.getByRole("button", { name: "Cancel" }).click();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");-- await expect(confirmDialog).toBeVisible();- await expect(- confirmDialog.getByText("Discard changes to seller?"),- ).toBeVisible();-- await expect(- confirmDialog.getByText("You have unsaved changes. They will be lost."),- ).toBeVisible();-- await expect(- confirmDialog.getByRole("button", { name: "Discard changes" }),- ).toBeVisible();-- await confirmDialog- .getByRole("button", { name: "Discard changes" })- .click();-- await expect(confirmDialog).toBeHidden();- await expect(manageSellerDialog).toBeHidden();- });-- test("dirty form - Cancel - dismiss keeps dialog open with values intact", async ({- page,- }) => {- await page.getByRole("button", { name: "New Seller" }).click();-- const manageSellerDialog = page.getByTestId("manage-seller-dialog");- const nameInput = manageSellerDialog.getByRole("textbox", {- name: "Name",- });- await nameInput.fill("Unsaved Seller");-- await manageSellerDialog.getByRole("button", { name: "Cancel" }).click();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");-- await expect(confirmDialog).toBeVisible();-- await confirmDialog.getByRole("button", { name: "Keep editing" }).click();-- await expect(confirmDialog).toBeHidden();-- await expect(manageSellerDialog).toBeVisible();- await expect(nameInput).toHaveValue("Unsaved Seller");- });-- test("dirty form - X button - accept discards changes and closes", async ({- page,- }) => {- await page.getByRole("button", { name: "New Seller" }).click();-- const manageSellerDialog = page.getByTestId("manage-seller-dialog");- await manageSellerDialog- .getByRole("textbox", { name: "Name" })- .fill("Unsaved Seller");-- await manageSellerDialog.getByRole("button", { name: "Close" }).click();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeVisible();- await confirmDialog- .getByRole("button", { name: "Discard changes" })- .click();-- await expect(confirmDialog).toBeHidden();- await expect(manageSellerDialog).toBeHidden();- });-- test("dirty form - Escape - accept discards changes and closes", async ({- page,- }) => {- await page.getByRole("button", { name: "New Seller" }).click();-- const manageSellerDialog = page.getByTestId("manage-seller-dialog");- await manageSellerDialog- .getByRole("textbox", { name: "Name" })- .fill("Unsaved Seller");-- await page.keyboard.press("Escape");-- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeVisible();- await confirmDialog- .getByRole("button", { name: "Discard changes" })- .click();-- await expect(confirmDialog).toBeHidden();- await expect(manageSellerDialog).toBeHidden();- });- });-- test.describe("pre-fill switch dirty guard", () => {- test("toggling switch ON with dirty form shows confirm dialog", async ({- page,- }) => {- await page.getByRole("button", { name: "New Seller" }).click();-- const manageSellerDialog = page.getByTestId("manage-seller-dialog");- await manageSellerDialog- .getByRole("textbox", { name: "Name" })- .fill("Draft Seller");-- const prefillSwitch = manageSellerDialog.getByRole("switch", {- name: "Pre-fill with values from the current invoice form",- });- await expect(prefillSwitch).not.toBeChecked();-- await prefillSwitch.click();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeVisible();-- // Switch has not changed yet — still OFF while dialog is open- await expect(- page.getByTestId("manage-seller-dialog").getByRole("switch", {- name: "Pre-fill with values from the current invoice form",- includeHidden: true, // dialog is still open, but on one level deeper- }),- ).not.toBeChecked();-- // Dialog is still open- await expect(manageSellerDialog).toBeVisible();- });-- test("toggling switch ON with dirty form - confirm applies pre-fill and clears draft", async ({- page,- }) => {- await page.getByRole("button", { name: "New Seller" }).click();-- const manageSellerDialog = page.getByTestId("manage-seller-dialog");-- // Dirty the form- const nameInput = manageSellerDialog.getByRole("textbox", {- name: "Name",- });- await nameInput.fill("Draft Seller");-- const prefillSwitch = manageSellerDialog.getByRole("switch", {- name: "Pre-fill with values from the current invoice form",- });- await prefillSwitch.click();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeVisible();-- await confirmDialog- .getByRole("button", { name: "Discard changes" })- .click();-- await expect(confirmDialog).toBeHidden();-- // Switch is now ON- await expect(prefillSwitch).toBeChecked();-- // Dialog remains open (we only reset the form, not close the dialog)- await expect(manageSellerDialog).toBeVisible();-- // Draft text is gone — form was reset with pre-fill values- await expect(nameInput).not.toHaveValue("Draft Seller");- await expect(nameInput).toHaveValue(DEFAULT_SELLER_DATA.name);- });-- test("toggling switch ON with dirty form - Keep editing preserves draft and switch stays OFF", async ({- page,- }) => {- await page.getByRole("button", { name: "New Seller" }).click();-- const manageSellerDialog = page.getByTestId("manage-seller-dialog");- const nameInput = manageSellerDialog.getByRole("textbox", {- name: "Name",- });- await nameInput.fill("Draft Seller");-- const prefillSwitch = manageSellerDialog.getByRole("switch", {- name: "Pre-fill with values from the current invoice form",- });- await prefillSwitch.click();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeVisible();-- await confirmDialog.getByRole("button", { name: "Keep editing" }).click();-- await expect(confirmDialog).toBeHidden();-- // Switch remains OFF — the toggle was cancelled- await expect(prefillSwitch).not.toBeChecked();-- // Dialog still open with draft intact- await expect(manageSellerDialog).toBeVisible();- await expect(nameInput).toHaveValue("Draft Seller");- });-- test("toggling switch OFF (while ON + dirty) shows confirm dialog", async ({- page,- }) => {- await page.getByRole("button", { name: "New Seller" }).click();-- const manageSellerDialog = page.getByTestId("manage-seller-dialog");- const prefillSwitch = manageSellerDialog.getByRole("switch", {- name: "Pre-fill with values from the current invoice form",- });-- // Enable pre-fill while form is clean- await prefillSwitch.click();- await expect(prefillSwitch).toBeChecked();-- // Dirty the form- await manageSellerDialog- .getByRole("textbox", { name: "Name" })- .fill("Edited after pre-fill");-- // Toggle switch OFF while dirty- await prefillSwitch.click();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeVisible();-- // Switch remains ON while dialog is open- await expect(- page.getByTestId("manage-seller-dialog").getByRole("switch", {- name: "Pre-fill with values from the current invoice form",- includeHidden: true, // dialog is still open, but on one level deeper- }),- ).toBeChecked();- });-- test("toggling switch OFF with dirty form - confirm resets to empty form", async ({- page,- }) => {- await page.getByRole("button", { name: "New Seller" }).click();-- const manageSellerDialog = page.getByTestId("manage-seller-dialog");- const prefillSwitch = manageSellerDialog.getByRole("switch", {- name: "Pre-fill with values from the current invoice form",- });- const nameInput = manageSellerDialog.getByRole("textbox", {- name: "Name",- });-- // Enable pre-fill while form is clean- await prefillSwitch.click();- await expect(prefillSwitch).toBeChecked();-- // Dirty the form- await nameInput.fill("Edited after pre-fill");-- // Toggle switch OFF while dirty- await prefillSwitch.click();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeVisible();-- await confirmDialog- .getByRole("button", { name: "Discard changes" })- .click();-- await expect(confirmDialog).toBeHidden();-- // Switch is now OFF- await expect(prefillSwitch).not.toBeChecked();-- // Dialog remains open- await expect(manageSellerDialog).toBeVisible();-- // Form was reset to empty (no pre-fill values, no edited text)- await expect(nameInput).toHaveValue("");- });-- test("toggling switch OFF with dirty form - Keep editing preserves draft and switch stays ON", async ({- page,- }) => {- await page.getByRole("button", { name: "New Seller" }).click();-- const manageSellerDialog = page.getByTestId("manage-seller-dialog");- const prefillSwitch = manageSellerDialog.getByRole("switch", {- name: "Pre-fill with values from the current invoice form",- });- const nameInput = manageSellerDialog.getByRole("textbox", {- name: "Name",- });-- // Enable pre-fill while form is clean- await prefillSwitch.click();- await expect(prefillSwitch).toBeChecked();-- // Dirty the form- await nameInput.fill("Edited after pre-fill");-- // Toggle switch OFF while dirty- await prefillSwitch.click();-- const confirmDialog = page.getByTestId("confirm-discard-dialog");- await expect(confirmDialog).toBeVisible();-- await confirmDialog.getByRole("button", { name: "Keep editing" }).click();-- await expect(confirmDialog).toBeHidden();-- // Switch remains ON- await expect(prefillSwitch).toBeChecked();-- // Dialog still open with draft intact- await expect(manageSellerDialog).toBeVisible();- await expect(nameInput).toHaveValue("Edited after pre-fill");- });- });-- test("trims whitespace from name and other fields before saving", async ({- page,- }) => {- await page.getByRole("button", { name: "New Seller" }).click();-- const manageSellerDialog = page.getByTestId("manage-seller-dialog");-- await manageSellerDialog- .getByRole("textbox", { name: "Name" })- .fill(" Acme Corp ");- await manageSellerDialog- .getByRole("textbox", { name: "Address" })- .fill(" 123 Main St ");- await manageSellerDialog- .getByRole("textbox", { name: "Email" })- .fill(" [email protected] ");-- await manageSellerDialog- .getByRole("button", { name: "Save Seller" })- .click();-- await expect(- page.getByText("Seller added and applied to invoice", { exact: true }),- ).toBeVisible();-- const storedData = (await page.evaluate(() =>- localStorage.getItem("EASY_INVOICE_PDF_SELLERS"),- )) as string;- const parsedData = JSON.parse(storedData) as SellerData[];-- expect(parsedData).toHaveLength(1);- expect(parsedData[0].name).toBe("Acme Corp");- expect(parsedData[0].address).toBe("123 Main St");- expect(parsedData[0].email).toBe("[email protected]");- });-- test("rejects whitespace-padded name that duplicates an existing seller", async ({- page,- }) => {- await page.addInitScript(() => {- const sellers = [- {- id: "existing-seller-id",- name: "Acme Corp",- address: "1 Road",- email: "",- emailFieldIsVisible: true,- vatNo: "",- vatNoLabelText: "Tax Number",- vatNoFieldIsVisible: true,- accountNumber: "",- accountNumberFieldIsVisible: true,- swiftBic: "",- swiftBicFieldIsVisible: true,- notes: "",- notesFieldIsVisible: true,- },- ];- localStorage.setItem("EASY_INVOICE_PDF_SELLERS", JSON.stringify(sellers));- });-- await page.goto("/?template=default");- await expect(page).toHaveURL("/?template=default");-- await page.getByRole("button", { name: "New Seller" }).click();-- const manageSellerDialog = page.getByTestId("manage-seller-dialog");-- await manageSellerDialog- .getByRole("textbox", { name: "Name" })- .fill(" Acme Corp ");- await manageSellerDialog- .getByRole("textbox", { name: "Address" })- .fill("2 Avenue");-- await manageSellerDialog- .getByRole("button", { name: "Save Seller" })- .click();-- await expect(- manageSellerDialog.getByText("A seller with this name already exists", {- exact: true,- }),- ).toBeVisible();-- // Dialog should remain open- await expect(manageSellerDialog).toBeVisible();-- // Only the pre-seeded seller should exist in localStorage- const storedData = (await page.evaluate(() =>- localStorage.getItem("EASY_INVOICE_PDF_SELLERS"),- )) as string;- const parsedData = JSON.parse(storedData) as SellerData[];-- expect(parsedData).toHaveLength(1);- expect(parsedData[0].name).toBe("Acme Corp");- });-});diff --git a/e2e/seo-landings.test.ts b/e2e/seo-landings.test.tsindex 6c6db1b..6f2d7db 100644--- a/e2e/seo-landings.test.ts+++ b/e2e/seo-landings.test.ts@@ -1,8 +1,9 @@+import { expect, test } from "@playwright/test";+import {SEO_LANDING_DEFINITIONS,type SeoLandingSlug,} from "@/app/(seo-landings)/seo-landing-definitions";-import { expect, test } from "@playwright/test";const SLUGS = Object.keys(SEO_LANDING_DEFINITIONS) as SeoLandingSlug[];diff --git a/e2e/server-render-pdf/render-server-pdf.mjs b/e2e/server-render-pdf/render-server-pdf.mjsnew file mode 100644index 0000000..d16aeee--- /dev/null+++ b/e2e/server-render-pdf/render-server-pdf.mjs@@ -0,0 +1,49 @@+// Renders one server-side invoice PDF and writes the raw bytes to stdout.+//+// Spawned by server-render-pdf.test.ts. This has to be a separate process:+// Playwright compiles JSX with its own factory (elements come out as+// `{ __pw_type, ... }`), which @react-pdf's reconciler cannot render, so the+// PDF can never be built inside a Playwright worker.+//+// Usage: node e2e/server-render-pdf/render-server-pdf.mjs <en|pl> > invoice.pdf++import path from "node:path";++import { createJiti } from "jiti";+import React from "react";++// The snapshot fixture is fully hardcoded, so no real secrets are needed here —+// this only stops `@/env` from throwing on import (CI has no .env.local).+process.env.SKIP_ENV_VALIDATION ??= "true";++// jiti compiles JSX with the classic runtime, which expects a global `React`.+globalThis.React = React;++const language = process.argv[2];++if (language !== "en" && language !== "pl") {+ throw new Error(`Expected language "en" or "pl", received: ${language}`);+}++const repoRoot = path.resolve(import.meta.dirname, "../..");++const jiti = createJiti(import.meta.url, {+ alias: { "@": path.join(repoRoot, "src") },+ interopDefault: true,+ jsx: true,+});++const { renderInvoicePdfBuffer, getPolishInvoiceRealData } = await jiti.import(+ "@/app/api/generate-invoice/render-pdf-on-server",+);++const { SERVER_PDF_MOCK_INVOICE_DATA } = await jiti.import(+ "@/app/api/generate-invoice/__tests__/server-pdf-fixture",+);++const invoiceData =+ language === "pl"+ ? getPolishInvoiceRealData(SERVER_PDF_MOCK_INVOICE_DATA)+ : SERVER_PDF_MOCK_INVOICE_DATA;++process.stdout.write(await renderInvoicePdfBuffer({ invoiceData }));diff --git a/e2e/server-render-pdf/server-render-pdf.test.ts b/e2e/server-render-pdf/server-render-pdf.test.tsindex 6de670e..dcb31d0 100644--- a/e2e/server-render-pdf/server-render-pdf.test.ts+++ b/e2e/server-render-pdf/server-render-pdf.test.ts@@ -1,65 +1,39 @@import { spawnSync } from "node:child_process";-import fs from "node:fs";-import os from "node:os";import path from "node:path";import { test, expect } from "@playwright/test";+import { renderPdfOnCanvas } from "../utils/render-pdf-on-canvas";-// IMPORTANT - we use spawnServerPdfRender() to generate server-side PDF files for visual regression testing+const RENDER_SCRIPT = path.join(__dirname, "render-server-pdf.mjs");++const LANGUAGES = [+ { code: "en", label: "English" },+ { code: "pl", label: "Polish" },+] as const;+/**- * Spawn child process to render invoice PDF on server, for a given language.- *- * Uses Vitest to run export-server-pdf.test.ts, which writes PDF to temp file.+ * Renders the invoice PDF through the same `renderInvoicePdfBuffer()` the+ * `/api/generate-invoice` route uses, and returns the raw PDF bytes.*- * Returns Buffer of generated PDF. Always deletes temp file before returning or throwing.+ * Runs in a child process because Playwright's JSX transform is incompatible+ * with @react-pdf — see the comment at the top of render-server-pdf.mjs.*- * Throws error if process fails or PDF not created.+ * Throws if the child process fails, surfacing its stderr.*/-function spawnServerPdfRender(language: "en" | "pl"): Buffer {- // Generate unique temp file path- const tmpFile = path.join(- os.tmpdir(),- `server-pdf-${language}-${process.pid}-${Date.now()}.pdf`,- );-- try {- // Run vitest test that generates PDF, passing env vars for output and language- const result = spawnSync(- "pnpm",- [- "vitest",- "run",- "src/app/api/generate-invoice/__tests__/export-server-pdf.test.ts",- ],- {- cwd: process.cwd(),- env: {- ...process.env,- PDF_EXPORT_PATH: tmpFile, // test will write PDF here- PDF_EXPORT_LANG: language, // test will use this language- },- stdio: "pipe",- encoding: "utf-8",- },- );-- // If test failed, throw error with stdout/stderr for debugging- if (result.status !== 0) {- throw new Error(- `Server PDF render failed (${language}):\n${result.stdout}\n${result.stderr}`,- );- }-- // Check that temp PDF file was created- if (!fs.existsSync(tmpFile)) {- throw new Error(`Server PDF file was not created: ${tmpFile}`);- }+function renderServerPdf(language: "en" | "pl"): Buffer {+ // No `encoding` option on purpose: stdout stays a Buffer of raw PDF bytes.+ const result = spawnSync(process.execPath, [RENDER_SCRIPT, language], {+ maxBuffer: 32 * 1024 * 1024,+ });- return fs.readFileSync(tmpFile);- } finally {- fs.rmSync(tmpFile, { force: true });+ if (result.status !== 0) {+ throw new Error(+ `Server PDF render failed (${language}):\n${result.stderr.toString()}`,+ );}++ return result.stdout;}test.describe("Server-side PDF rendering", () => {@@ -73,37 +47,103 @@ test.describe("Server-side PDF rendering", () => {);});- test("renders English server PDF on canvas", async ({ page }) => {- const buffer = spawnServerPdfRender("en");+ for (const { code, label } of LANGUAGES) {+ test(`renders ${label} server PDF on canvas`, async ({ page }) => {+ const pdf = renderServerPdf(code);- await page.goto("about:blank");- await renderPdfOnCanvas(page, new Uint8Array(buffer));+ // Check that the PDF buffer starts with the standard PDF file signature+ expect(pdf.subarray(0, 5).toString("ascii")).toBe("%PDF-");- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );+ await page.goto("about:blank");+ await renderPdfOnCanvas(page, new Uint8Array(pdf));- await expect(page.locator("canvas")).toHaveScreenshot(- "server-en-invoice.png",- );- });+ await page.waitForFunction(() => {+ return (window as unknown as { __PDF_RENDERED__: boolean })+ .__PDF_RENDERED__;+ });- test("renders Polish server PDF on canvas", async ({ page }) => {- const buffer = spawnServerPdfRender("pl");+ await expect(page.locator("canvas")).toHaveScreenshot(+ `server-${code}-invoice.png`,+ );+ });+ }+});- await page.goto("about:blank");- await renderPdfOnCanvas(page, new Uint8Array(buffer));+test.describe("GET /api/generate-invoice/preview", () => {+ test("rejects a request without a valid bearer token", async ({+ request,+ }) => {+ const response = await request.get("/api/generate-invoice/preview", {+ headers: { Authorization: "Bearer not-the-real-token" },+ });- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );+ expect(response.status()).toBe(401);+ });- await expect(page.locator("canvas")).toHaveScreenshot(- "server-pl-invoice.png",- );+ // Safe to snapshot into a public repo: the endpoint renders only the fictional+ // SAMPLE_INVOICE_DATA, never the real env-driven invoice. Its fixed dates and+ // invoice number are also what keep these baselines stable over time.+ test.describe("returns a real PDF over HTTP", () => {+ test.describe.configure({ mode: "serial" });++ test.beforeEach(({}, testInfo) => {+ /* eslint-disable playwright/no-skipped-test -- snapshots are Desktop Chrome only, and the endpoint needs a token */+ test.skip(+ testInfo.project.name !== "Desktop Chrome",+ "Server PDF snapshots are Desktop Chrome only",+ );+ /* eslint-enable playwright/no-skipped-test */++ if (!process.env.AUTH_TOKEN) {+ throw new Error(+ "AUTH_TOKEN is not set — cannot call the authenticated preview endpoint",+ );+ }+ });++ for (const { code, label } of LANGUAGES) {+ test(`serves a ${label} invoice PDF matching the snapshot`, async ({+ page,+ request,+ }) => {+ const response = await request.get("/api/generate-invoice/preview", {+ headers: { Authorization: `Bearer ${process.env.AUTH_TOKEN}` },+ params: { lang: code },+ });++ expect(response.status()).toBe(200);+ expect(response.headers()["content-type"]).toBe("application/pdf");++ const pdf = await response.body();+ expect(pdf.subarray(0, 5).toString("ascii")).toBe("%PDF-");++ await page.goto("about:blank");+ await renderPdfOnCanvas(page, new Uint8Array(pdf));++ await page.waitForFunction(() => {+ return (window as unknown as { __PDF_RENDERED__: boolean })+ .__PDF_RENDERED__;+ });++ await expect(page.locator("canvas")).toHaveScreenshot(+ `preview-endpoint-${code}-invoice.png`,+ );+ });+ }+ });+});++test.describe("GET /api/generate-invoice", () => {+ // Only the auth guard is exercised over HTTP: it rejects before the route+ // renders anything, so no Telegram message / Drive upload / email is sent.+ test("rejects a request without a valid bearer token", async ({+ request,+ }) => {+ const response = await request.get("/api/generate-invoice", {+ headers: { Authorization: "Bearer not-the-real-token" },+ });++ expect(response.status()).toBe(401);+ expect(await response.text()).toBe("Unauthorized");});});diff --git a/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/preview-endpoint-en-invoice-Desktop-Chrome-darwin.png b/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/preview-endpoint-en-invoice-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..2420ee4Binary files /dev/null and b/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/preview-endpoint-en-invoice-Desktop-Chrome-darwin.png differdiff --git a/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/preview-endpoint-pl-invoice-Desktop-Chrome-darwin.png b/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/preview-endpoint-pl-invoice-Desktop-Chrome-darwin.pngnew file mode 100644index 0000000..b602317Binary files /dev/null and b/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/preview-endpoint-pl-invoice-Desktop-Chrome-darwin.png differdiff --git a/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/server-en-invoice-Desktop-Chrome-darwin.png b/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/server-en-invoice-Desktop-Chrome-darwin.pngindex c453be9..ad305ee 100644Binary files a/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/server-en-invoice-Desktop-Chrome-darwin.png and b/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/server-en-invoice-Desktop-Chrome-darwin.png differdiff --git a/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/server-pl-invoice-Desktop-Chrome-darwin.png b/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/server-pl-invoice-Desktop-Chrome-darwin.pngindex aa56be2..64fe897 100644Binary files a/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/server-pl-invoice-Desktop-Chrome-darwin.png and b/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/server-pl-invoice-Desktop-Chrome-darwin.png differdiff --git a/e2e/static-assets.test.ts b/e2e/static-assets.test.tsindex a09db39..bcce790 100644--- a/e2e/static-assets.test.ts+++ b/e2e/static-assets.test.ts@@ -1,3 +1,5 @@+import { expect, test } from "@playwright/test";+import {INVOICE_PDF_FONTS,MARKETING_FEATURES_CARDS,@@ -5,7 +7,6 @@ import {VIDEO_DEMO_FALLBACK_IMG,VIDEO_DEMO_URL,} from "@/config";-import { expect, test } from "@playwright/test";test.describe("Static assets (fonts, images, videos) should be accessible", () => {test("should load static assets successfully", async ({ page }) => {diff --git a/e2e/stripe-invoice-template/share-logic.test.ts b/e2e/stripe-invoice-template/share-logic.test.tsindex e1abfb5..1f095a0 100644--- a/e2e/stripe-invoice-template/share-logic.test.ts+++ b/e2e/stripe-invoice-template/share-logic.test.ts@@ -1,5 +1,8 @@-import { PDF_DATA_LOCAL_STORAGE_KEY, type InvoiceData } from "@/app/schema";import { expect, test } from "@playwright/test";++import { PDF_DATA_LOCAL_STORAGE_KEY, type InvoiceData } from "@/app/schema";++import { waitForPdfRegeneration } from "../utils/pdf-download";import { uploadLogoFile } from "./utils";test.describe("Stripe Invoice Sharing Logic", () => {@@ -34,7 +37,9 @@ test.describe("Stripe Invoice Sharing Logic", () => {await shareButton.click();// Verify URL contains shared data- await page.waitForURL((url) => url.searchParams.has("data"));+ await page.waitForURL((url) => {+ return url.searchParams.has("data");+ });const url = page.url();expect(url).toContain(`?template=stripe&data=`);@@ -160,11 +165,9 @@ test.describe("Stripe Invoice Sharing Logic", () => {.selectOption("stripe");// Upload logo- await uploadLogoFile(page);-- // Wait debounce timeout- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);+ await waitForPdfRegeneration(page, async () => {+ await uploadLogoFile(page);+ });const generalInfoSection = page.getByTestId("general-information-section");await expect(@@ -205,7 +208,9 @@ test.describe("Stripe Invoice Sharing Logic", () => {).toBeVisible();// verify URL contains data parameter- await page.waitForURL((url) => url.searchParams.has("data"));+ await page.waitForURL((url) => {+ return url.searchParams.has("data");+ });const url = page.url();expect(url).toContain(`?template=stripe&data=`);@@ -286,20 +291,18 @@ test.describe("Stripe Invoice Sharing Logic", () => {// Verify share button is disabledawait expect(shareButton).toHaveAttribute("data-disabled", "true");- // Wait a moment for any debounced localStorage updates- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- // Verify data is actually saved in localStorage- const storedData = (await page.evaluate((key) => {- return localStorage.getItem(key);- }, PDF_DATA_LOCAL_STORAGE_KEY)) as string;-- expect(storedData).toBeTruthy();+ // Verify the logo is actually saved in localStorage (it is written with a debounce)+ await expect+ .poll(async () => {+ const storedData = await page.evaluate((key) => {+ return localStorage.getItem(key);+ }, PDF_DATA_LOCAL_STORAGE_KEY);- const parsedData = JSON.parse(storedData) as InvoiceData;-- expect(parsedData.logo).toBeTruthy();+ return storedData+ ? Boolean((JSON.parse(storedData) as InvoiceData).logo)+ : false;+ })+ .toBe(true);// Reload the pageawait page.reload();@@ -320,13 +323,18 @@ test.describe("Stripe Invoice Sharing Logic", () => {test("sharing functionality works correctly in mobile view (mobile UI is a bit different)", async ({page,- }) => {+ }, testInfo) => {+ // the mobile sharing UI is what this test is about, so we run it on a real+ // mobile project instead of re-running the same flow on every project+ // eslint-disable-next-line playwright/no-skipped-test -- mobile UI flow, Mobile Chrome only+ test.skip(+ testInfo.project.name !== "Mobile Chrome",+ "mobile only flow, runs on the Mobile Chrome project",+ );+// Verify default template is selected by defaultawait expect(page).toHaveURL("/?template=default");- // Set mobile viewport- await page.setViewportSize({ width: 375, height: 667 });-// Verify share button is visible and enabled in mobileconst shareButton = page.getByRole("button", {name: "Get link",@@ -340,11 +348,9 @@ test.describe("Stripe Invoice Sharing Logic", () => {.selectOption("stripe");// Upload logo- await uploadLogoFile(page);-- // Wait for logo to be uploaded- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);+ await waitForPdfRegeneration(page, async () => {+ await uploadLogoFile(page);+ });// Verify share button is disabled in mobile view tooawait expect(shareButton).toHaveAttribute("data-disabled", "true");@@ -390,9 +396,8 @@ test.describe("Stripe Invoice Sharing Logic", () => {// Clear the Net Price field to trigger "Net price is required" validation errorawait netPriceInput.clear();- // Wait for debounce timeout so form validation runs and invoiceFormHasErrors becomes true- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);+ // the rendered validation error tells us that the form validation has run+ await expect(page.getByText("Net price is required")).toBeVisible();// Click share button — should show error toast because form has validation errorsconst shareButton = page.getByRole("button", {@@ -411,9 +416,8 @@ test.describe("Stripe Invoice Sharing Logic", () => {// Fill back the Net Price with a valid valueawait netPriceInput.fill("100");- // Wait for debounce timeout so form validation passes and invoiceFormHasErrors resets to false- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);+ // the validation error disappears once the form is valid again+ await expect(page.getByText("Net price is required")).toBeHidden();// Click share button again — should succeed this timeawait shareButton.click();@@ -429,7 +433,9 @@ test.describe("Stripe Invoice Sharing Logic", () => {).toBeVisible();// Verify link was generated: URL should contain data param- await page.waitForURL((url) => url.searchParams.has("data"));+ await page.waitForURL((url) => {+ return url.searchParams.has("data");+ });const url = page.url();expect(url).toContain("?template=stripe&data=");diff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts b/e2e/stripe-invoice-template/stripe-invoice-template.test.tsindex 8f6f18e..cbfddfc 100644--- a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts+++ b/e2e/stripe-invoice-template/stripe-invoice-template.test.ts@@ -1,21 +1,19 @@+import { INITIAL_INVOICE_DATA } from "@/app/constants";import {DEFAULT_DATE_FORMAT,PDF_DATA_LOCAL_STORAGE_KEY,STRIPE_DEFAULT_DATE_FORMAT,type InvoiceData,} from "@/app/schema";-import { INITIAL_INVOICE_DATA } from "@/app/constants";-import fs from "node:fs";-import path from "node:path";-import { uploadLogoFile } from "./utils";+import { STATIC_ASSETS_URL } from "@/config";// IMPORTANT: we use custom extended test fixture that provides a temporary download directory for each testimport { expect, test } from "../utils/extended-playwright-test";import {- renderPdfOnCanvas,- renderMultiPagePdfOnCanvas,-} from "../utils/render-pdf-on-canvas";-import { STATIC_ASSETS_URL } from "@/config";+ expectPdfScreenshot,+ waitForPdfRegeneration,+} from "../utils/pdf-download";+import { LOGO_FIXTURE_FORMATS, uploadLogoFile } from "./utils";test.describe("Stripe Invoice Template", () => {test.beforeEach(async ({ page }) => {@@ -201,21 +199,11 @@ test.describe("Stripe Invoice Template", () => {.getByRole("combobox", { name: "Invoice Template" }).selectOption("stripe");- // Create a mock file input event with invalid file type- await page.evaluate(() => {- const fileInput = document.querySelector(- "#logoUpload",- ) as HTMLInputElement;- if (fileInput) {- // Create a mock file with invalid type- const file = new File(["test"], "test.txt", { type: "text/plain" });- const dataTransfer = new DataTransfer();- dataTransfer.items.add(file);- fileInput.files = dataTransfer.files;-- // Trigger change event- fileInput.dispatchEvent(new Event("change", { bubbles: true }));- }+ // Upload a file that is not an image+ await page.locator("#logoUpload").setInputFiles({+ name: "test.txt",+ mimeType: "text/plain",+ buffer: Buffer.from("test"),});// Should show error toast@@ -232,24 +220,11 @@ test.describe("Stripe Invoice Template", () => {.getByRole("combobox", { name: "Invoice Template" }).selectOption("stripe");- // Create a mock file input event with large file- await page.evaluate(() => {- const fileInput = document.querySelector(- "#logoUpload",- ) as HTMLInputElement;- if (fileInput) {- // Create a mock file that's too large (4MB)- const largeContent = new Array(4 * 1024 * 1024).fill("a").join("");- const file = new File([largeContent], "large-image.png", {- type: "image/png",- });- const dataTransfer = new DataTransfer();- dataTransfer.items.add(file);- fileInput.files = dataTransfer.files;-- // Trigger change event- fileInput.dispatchEvent(new Event("change", { bubbles: true }));- }+ // Upload an image that is over the 3MB limit+ await page.locator("#logoUpload").setInputFiles({+ name: "large-image.png",+ mimeType: "image/png",+ buffer: Buffer.alloc(4 * 1024 * 1024, "a"),});// Should show error toast@@ -258,42 +233,60 @@ test.describe("Stripe Invoice Template", () => {).toBeVisible();});- test("successfully uploads valid image and shows preview", async ({- page,- }) => {- // Switch to Stripe template to show logo upload- await page- .getByRole("combobox", { name: "Invoice Template" })- .selectOption("stripe");+ // the UI promises "JPEG, PNG or WebP", so every accepted format is exercised+ for (const format of LOGO_FIXTURE_FORMATS) {+ test(`successfully uploads a valid ${format.toUpperCase()} image and shows preview`, async ({+ page,+ }) => {+ // Switch to Stripe template to show logo upload+ await page+ .getByRole("combobox", { name: "Invoice Template" })+ .selectOption("stripe");++ const generalInfoSection = page.getByTestId(+ "general-information-section",+ );- const generalInfoSection = page.getByTestId("general-information-section");+ // Upload a valid small image (the logo is saved with the form debounce)+ await waitForPdfRegeneration(page, async () => {+ await uploadLogoFile(page, format);++ // Should show success toast+ await expect(+ page.getByText("Logo uploaded successfully!"),+ ).toBeVisible();++ // Should show logo preview+ await expect(+ generalInfoSection.getByAltText("Company logo preview"),+ ).toBeVisible();+ await expect(+ generalInfoSection.getByText(+ "Logo uploaded successfully. Click the X to remove it.",+ ),+ ).toBeVisible();+ });- // Upload a valid small image- await uploadLogoFile(page);+ // Should show remove button+ await expect(+ generalInfoSection.getByRole("button", { name: "Remove logo" }),+ ).toBeVisible();- // Should show success toast- await expect(page.getByText("Logo uploaded successfully!")).toBeVisible();+ // Upload area should be hidden+ await expect(+ generalInfoSection.getByText("Click to upload your company logo"),+ ).toBeHidden();- // Should show logo preview- await expect(- generalInfoSection.getByAltText("Company logo preview"),- ).toBeVisible();- await expect(- generalInfoSection.getByText(- "Logo uploaded successfully. Click the X to remove it.",- ),- ).toBeVisible();+ // the uploaded logo is stored as a data URL of the uploaded format+ const storedData = (await page.evaluate((key) => {+ return localStorage.getItem(key);+ }, PDF_DATA_LOCAL_STORAGE_KEY)) as string;- // Should show remove button- await expect(- generalInfoSection.getByRole("button", { name: "Remove logo" }),- ).toBeVisible();+ const parsedData = JSON.parse(storedData) as InvoiceData;- // Upload area should be hidden- await expect(- generalInfoSection.getByText("Click to upload your company logo"),- ).toBeHidden();- });+ expect(parsedData.logo).toContain("data:image/");+ });+ }test("can remove uploaded logo", async ({ page }) => {// Switch to Stripe template and upload logo first@@ -316,17 +309,15 @@ test.describe("Stripe Invoice Template", () => {),).toBeVisible();- // Wait debounce timeout- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(800);-// Click remove button- await generalInfoSection- .getByRole("button", { name: "Remove logo" })- .click();+ await waitForPdfRegeneration(page, async () => {+ await generalInfoSection+ .getByRole("button", { name: "Remove logo" })+ .click();- // Should show success toast- await expect(page.getByText("Logo removed successfully!")).toBeVisible();+ // Should show success toast+ await expect(page.getByText("Logo removed successfully!")).toBeVisible();+ });// Logo preview should be hiddenawait expect(@@ -339,32 +330,49 @@ test.describe("Stripe Invoice Template", () => {).toBeVisible();});- test("validates payment URL format", async ({ page }) => {+ test("validates the payment link URL", async ({ page }) => {// Switch to Stripe templateawait page.getByRole("combobox", { name: "Invoice Template" }).selectOption("stripe");+ await expect(page).toHaveURL("/?template=stripe");+const generalInfoSection = page.getByTestId("general-information-section");const paymentUrlInput = generalInfoSection.getByRole("textbox", {name: "Payment Link URL",});- // Try invalid URL+ // Something that is not a URL at allawait paymentUrlInput.fill("not-a-valid-url");- await paymentUrlInput.blur();- // Check for validation error (this would depend on your validation implementation)- // The actual validation error checking would depend on how your form validation works+ await expect(+ generalInfoSection.getByText("Please enter a valid URL or leave empty"),+ ).toBeVisible();++ // A valid URL, but not an https one+ await paymentUrlInput.fill("http://buy.stripe.com/test_payment_link");- // Try valid URL+ await expect(+ generalInfoSection.getByText("URL must start with https://"),+ ).toBeVisible();++ // A valid https URL clears the errorawait paymentUrlInput.fill("https://buy.stripe.com/test_payment_link");- await paymentUrlInput.blur();- // Should not show error for valid URL- await expect(paymentUrlInput).toHaveValue(- "https://buy.stripe.com/test_payment_link",- );+ await expect(+ generalInfoSection.getByText("URL must start with https://"),+ ).toBeHidden();+ await expect(+ generalInfoSection.getByText("Please enter a valid URL or leave empty"),+ ).toBeHidden();++ // the field is optional, so an empty value is valid as well+ await paymentUrlInput.fill("");++ await expect(+ generalInfoSection.getByText("Please enter a valid URL or leave empty"),+ ).toBeHidden();});test("persists logo and payment URL in localStorage", async ({ page }) => {@@ -384,24 +392,22 @@ test.describe("Stripe Invoice Template", () => {.fill("https://buy.stripe.com/test_payment_link");// Upload logo- await uploadLogoFile(page);+ await waitForPdfRegeneration(page, async () => {+ await uploadLogoFile(page);- // Wait for logo to be uploaded and PDF to regenerate- await expect(page.getByText("Logo uploaded successfully!")).toBeVisible();-- // Should show logo preview- await expect(- generalInfoSection.getByAltText("Company logo preview"),- ).toBeVisible();- await expect(- generalInfoSection.getByText(- "Logo uploaded successfully. Click the X to remove it.",- ),- ).toBeVisible();+ // Wait for logo to be uploaded and PDF to regenerate+ await expect(page.getByText("Logo uploaded successfully!")).toBeVisible();- // Wait debounce timeout- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(800);+ // Should show logo preview+ await expect(+ generalInfoSection.getByAltText("Company logo preview"),+ ).toBeVisible();+ await expect(+ generalInfoSection.getByText(+ "Logo uploaded successfully. Click the X to remove it.",+ ),+ ).toBeVisible();+ });// Verify data is actually saved in localStorageconst storedData = (await page.evaluate((key) => {@@ -788,12 +794,10 @@ test.describe("Stripe Invoice Template", () => {name: "VAT Rate",exact: true,});- await vatInput.clear();- await vatInput.fill("20");-- // Wait debounce timeout- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);+ await waitForPdfRegeneration(page, async () => {+ await vatInput.clear();+ await vatInput.fill("20");+ });// Switch to Stripe templateawait page@@ -832,52 +836,11 @@ test.describe("Stripe Invoice Template", () => {expect(parsedData.dateFormat).toBe(STRIPE_DEFAULT_DATE_FORMAT);// Generate PDF to verify Tax column is visible- const downloadPDFButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- await expect(downloadPDFButton).toBeVisible();-- // Click the download button and wait for download- const [download] = await Promise.all([- page.waitForEvent("download"),- downloadPDFButton.click(),- ]);-- // Get the suggested filename- const suggestedFilename = download.suggestedFilename();-- // save the file to temporary directory- const pdfFilePath = path.join(+ await expectPdfScreenshot(page, {downloadDir,- `${browserName}-${suggestedFilename}`,- );-- await download.saveAs(pdfFilePath);-- // Convert to absolute path and use proper file URL format- const absolutePath = path.resolve(pdfFilePath);- await expect.poll(() => fs.existsSync(absolutePath)).toBe(true);-- /**- * Render the PDF on a canvas and take a screenshot of it- */-- const pdfBytes = fs.readFileSync(absolutePath);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, pdfBytes);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "automatically-sets-date-format-when-switching-to-Stripe-template.png",- );+ browserName,+ name: "automatically-sets-date-format-when-switching-to-Stripe-template.png",+ });// navigate back to the previous pageawait page.goto("/");@@ -956,13 +919,11 @@ test.describe("Stripe Invoice Template", () => {).toBeVisible();// Add payment URL- await generalInfoSection- .getByRole("textbox", { name: "Payment Link URL" })- .fill("https://buy.stripe.com/test_payment_link");-- // Wait a moment for any debounced localStorage updates- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(800);+ await waitForPdfRegeneration(page, async () => {+ await generalInfoSection+ .getByRole("textbox", { name: "Payment Link URL" })+ .fill("https://buy.stripe.com/test_payment_link");+ });// Verify data is actually saved in localStorageconst storedData = (await page.evaluate((key) => {@@ -974,804 +935,14 @@ test.describe("Stripe Invoice Template", () => {const parsedData = JSON.parse(storedData) as InvoiceData;expect(parsedData.logo).toBeTruthy();-- const downloadPDFButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- await expect(downloadPDFButton).toBeVisible();- await expect(downloadPDFButton).toBeEnabled();-- // Click the download button and wait for download- const [download] = await Promise.all([- page.waitForEvent("download"),- downloadPDFButton.click(),- ]);-- // Get the suggested filename- const suggestedFilename = download.suggestedFilename();-- // save the file to temporary directory- const pdfFilePath = path.join(- downloadDir,- `${browserName}-${suggestedFilename}`,- );-- await download.saveAs(pdfFilePath);-- // Convert to absolute path and use proper file URL format- const absolutePath = path.resolve(pdfFilePath);- await expect.poll(() => fs.existsSync(absolutePath)).toBe(true);-- /**- * Render the PDF on a canvas and take a screenshot of it- */-- const pdfBytes = fs.readFileSync(absolutePath);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, pdfBytes);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "pdf-with-logo-and-payment-url-when-using-stripe-template.png",- );- });-- test("displays QR code in PDF when QR code data is provided", async ({- page,- browserName,- downloadDir,- }, testInfo) => {- const QR_CODE_TEST_DATA = {- data: "https://easyinvoicepdf.com",- description: "QR Code Description",- } as const satisfies {- data: string;- description: string;- };-- // Switch to Stripe template- await page- .getByRole("combobox", { name: "Invoice Template" })- .selectOption("stripe");-- await page.waitForURL("/?template=stripe");-- const finalSection = page.getByTestId("final-section");-- const qrCodeFieldset = finalSection.getByRole("group", {- name: "QR Code",- });- await expect(qrCodeFieldset).toBeVisible();-- // Verify that "Show QR Code in PDF" switch is on by default- const showQrCodeSwitch = qrCodeFieldset.getByRole("switch", {- name: "Show QR Code in PDF",- });- await expect(showQrCodeSwitch).toBeVisible();- await expect(showQrCodeSwitch).toBeEnabled();- await expect(showQrCodeSwitch).toBeChecked();-- // Verify QR Code Data field is empty by default- const qrCodeDataTextarea = qrCodeFieldset.getByRole("textbox", {- name: "Data",- });- await expect(qrCodeDataTextarea).toBeVisible();- await expect(qrCodeDataTextarea).toHaveValue("");-- // Fill in the QR code data field- await qrCodeDataTextarea.fill(QR_CODE_TEST_DATA.data);-- // Verify QR Code Description field is empty by default- const qrCodeDescriptionTextarea = qrCodeFieldset.getByRole("textbox", {- name: "Description (optional)",- });- await expect(qrCodeDescriptionTextarea).toBeVisible();- await expect(qrCodeDescriptionTextarea).toHaveValue("");-- // Fill in the QR code description field- await qrCodeDescriptionTextarea.fill(QR_CODE_TEST_DATA.description);-- // for better debugging screenshots, we fill in the notes field with a test note =)- await finalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(`Test: ${testInfo.title} (${testInfo.project.name})`);-- // Wait for debounce timeout- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- const downloadPdfEnglishButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- await expect(downloadPdfEnglishButton).toBeVisible();- await expect(downloadPdfEnglishButton).toBeEnabled();-- // Click the download button and wait for download- const [download] = await Promise.all([- page.waitForEvent("download"),- downloadPdfEnglishButton.click(),- ]);-- // Get the suggested filename- const suggestedFilename = download.suggestedFilename();-- // save the file to temporary directory- const pdfFilePath = path.join(- downloadDir,- `${browserName}-${suggestedFilename}`,- );-- await download.saveAs(pdfFilePath);-- // Convert to absolute path and use proper file URL format- const absolutePath = path.resolve(pdfFilePath);- await expect.poll(() => fs.existsSync(absolutePath)).toBe(true);-- /**- * Render the PDF on a canvas and take a screenshot of it- */- const pdfBytes = fs.readFileSync(absolutePath);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, pdfBytes);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "displays-qr-code-in-pdf-stripe-template.png",- );-- /**- * TURN OFF QR CODE IN PDF AND DOWNLOAD PDF AGAIN- */-- // navigate back to the previous page- await page.goto("/");-- // verify that we are on the STRIPE template- await expect(page).toHaveURL("/?template=stripe");-- const newFinalSection = page.getByTestId("final-section");-- const newQrCodeFieldset = newFinalSection.getByRole("group", {- name: "QR Code",- });- await expect(newQrCodeFieldset).toBeVisible();-- // Verify that "Show QR Code in PDF" switch is on by default- const newShowQrCodeSwitch = newQrCodeFieldset.getByRole("switch", {- name: "Show QR Code in PDF",- });-- await expect(newShowQrCodeSwitch).toBeVisible();- await expect(newShowQrCodeSwitch).toBeEnabled();- await expect(newShowQrCodeSwitch).toBeChecked();-- // toggle the switch off- await newShowQrCodeSwitch.click();-- // verify that the switch is off- await expect(newShowQrCodeSwitch).not.toBeChecked();-- // Verify QR Code Data field retains its value after toggling off- const newQrCodeDataTextarea = newQrCodeFieldset.getByRole("textbox", {- name: "Data",- });- await expect(newQrCodeDataTextarea).toBeVisible();- await expect(newQrCodeDataTextarea).toHaveValue(QR_CODE_TEST_DATA.data);-- // Verify QR Code Description field retains its value after toggling off- const newQrCodeDescriptionTextarea = newQrCodeFieldset.getByRole(- "textbox",- {- name: "Description (optional)",- },- );- await expect(newQrCodeDescriptionTextarea).toBeVisible();- await expect(newQrCodeDescriptionTextarea).toHaveValue(- QR_CODE_TEST_DATA.description,- );-- // for better debugging screenshots, we fill in the notes field with a test note =)- await newFinalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(- `Test: ${testInfo.title} - QR code hidden in PDF (${testInfo.project.name})`,- );-- // wait for debounce timeout- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- const newDownloadPdfEnglishButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- // Download the PDF again- const [downloadPdfWithoutQrCode] = await Promise.all([- page.waitForEvent("download"),- newDownloadPdfEnglishButton.click(),- ]);-- // Get the suggested filename- const suggestedFilenameWithoutQrCode =- downloadPdfWithoutQrCode.suggestedFilename();-- // save the file to temporary directory- const pdfFilePath2 = path.join(- downloadDir,- `${browserName}-${suggestedFilenameWithoutQrCode}`,- );-- await downloadPdfWithoutQrCode.saveAs(pdfFilePath2);-- /**- * Render the PDF on a canvas and take a screenshot to verify QR code is not displayed- */- const pdfBytesWithoutQrCode = fs.readFileSync(pdfFilePath2);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, pdfBytesWithoutQrCode);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "qr-code-hidden-in-pdf-stripe-template.png",- );- });-- test("displays service period in PDF when enabled and hides it when toggled off", async ({- page,- browserName,- downloadDir,- }, testInfo) => {- const SERVICE_PERIOD_TEST_DATA = {- start: "2025-12-14",- end: "2025-12-20",- } as const;-- await page- .getByRole("combobox", { name: "Invoice Template" })- .selectOption("stripe");-- await page.waitForURL("/?template=stripe");- await expect(page).toHaveURL("/?template=stripe");-- const generalInfoSection = page.getByTestId("general-information-section");- const servicePeriodFieldset = generalInfoSection.getByRole("group", {- name: "Service period",- });- await expect(servicePeriodFieldset).toBeVisible();-- // these fields are hidden by default for the STRIPE template (we don't show them on stripe pdf template)- await expect(- servicePeriodFieldset.getByRole("textbox", {- name: "Service period PDF label",- }),- ).toBeHidden();-- await expect(- servicePeriodFieldset.getByRole("textbox", {- name: "Date of sales PDF label",- }),- ).toBeHidden();-- const servicePeriodSwitch = servicePeriodFieldset.getByRole("switch", {- name: 'Show the "Service period" (Service period start and end) field in the PDF',- });-- await servicePeriodFieldset- .getByRole("textbox", { name: "Service period start" })- .fill(SERVICE_PERIOD_TEST_DATA.start);-- await servicePeriodFieldset- .getByRole("textbox", { name: "Service period end" })- .fill(SERVICE_PERIOD_TEST_DATA.end);-- await expect(- servicePeriodFieldset.getByRole("textbox", {- name: "Service period start",- }),- ).toHaveValue(SERVICE_PERIOD_TEST_DATA.start);- await expect(- servicePeriodFieldset.getByRole("textbox", {- name: "Service period end",- }),- ).toHaveValue(SERVICE_PERIOD_TEST_DATA.end);- await expect(servicePeriodSwitch).toBeChecked();-- const finalSection = page.getByTestId("final-section");- await finalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(`Test: ${testInfo.title} (${testInfo.project.name})`);-- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- const downloadPdfEnglishButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- await expect(downloadPdfEnglishButton).toBeVisible();- await expect(downloadPdfEnglishButton).toBeEnabled();-- const [download] = await Promise.all([- page.waitForEvent("download"),- downloadPdfEnglishButton.click(),- ]);-- const pdfFilePath = path.join(- downloadDir,- `${browserName}-${download.suggestedFilename()}`,- );-- await download.saveAs(pdfFilePath);-- const absolutePath = path.resolve(pdfFilePath);- await expect.poll(() => fs.existsSync(absolutePath)).toBe(true);-- const pdfBytes = fs.readFileSync(absolutePath);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, pdfBytes);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "displays-service-period-in-pdf-stripe-template.png",- );-- await page.goto("/");- await expect(page).toHaveURL("/?template=stripe");-- const newGeneralInfoSection = page.getByTestId(- "general-information-section",- );- const newServicePeriodFieldset = newGeneralInfoSection.getByRole("group", {- name: "Service period",- });- await expect(newServicePeriodFieldset).toBeVisible();-- const newServicePeriodSwitch = newServicePeriodFieldset.getByRole(- "switch",- {- name: 'Show the "Service period" (Service period start and end) field in the PDF',- },- );-- await expect(newServicePeriodSwitch).toBeChecked();-- await newServicePeriodSwitch.click();- await expect(newServicePeriodSwitch).not.toBeChecked();-- await expect(- newServicePeriodFieldset.getByRole("textbox", {- name: "Service period start",- }),- ).toHaveValue(SERVICE_PERIOD_TEST_DATA.start);- await expect(- newServicePeriodFieldset.getByRole("textbox", {- name: "Service period end",- }),- ).toHaveValue(SERVICE_PERIOD_TEST_DATA.end);-- const newFinalSection = page.getByTestId("final-section");- await newFinalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(- `Test: ${testInfo.title} - service period hidden in PDF (${testInfo.project.name})`,- );-- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- const newDownloadPdfEnglishButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- const [downloadWithoutServicePeriod] = await Promise.all([- page.waitForEvent("download"),- newDownloadPdfEnglishButton.click(),- ]);-- const pdfFilePath2 = path.join(- downloadDir,- `${browserName}-${downloadWithoutServicePeriod.suggestedFilename()}`,- );-- await downloadWithoutServicePeriod.saveAs(pdfFilePath2);-- const pdfBytesWithoutServicePeriod = fs.readFileSync(pdfFilePath2);-- await page.goto("about:blank");-- await renderPdfOnCanvas(page, pdfBytesWithoutServicePeriod);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "service-period-hidden-in-pdf-stripe-template.png",- );- });-- test("generates multi-page PDF when invoice has many items", async ({- page,- browserName,- downloadDir,- }, testInfo) => {- // Switch to Stripe template- await page- .getByRole("combobox", { name: "Invoice Template" })- .selectOption("stripe");-- // Wait for URL to be updated- await page.waitForURL("/?template=stripe");-- // Verify we're on the Stripe template- await expect(page).toHaveURL("/?template=stripe");-- const invoiceItemsSection = page.getByTestId("invoice-items-section");-- // Add additional invoice items to trigger 2-page PDF- for (let i = 0; i < 17; i++) {- await invoiceItemsSection- .getByRole("button", { name: "Add invoice item" })- .click();-- // Fill minimal required fields for the new item- const itemFieldset = invoiceItemsSection.getByRole("group", {- name: `Item ${i + 2}`, // Item numbers start at 1- });-- // Add longer descriptions only to odd-numbered items to test mixed content layout- // This verifies that the PDF template handles varying text lengths correctly- // and maintains proper spacing between short and long item descriptions- const itemName =- // eslint-disable-next-line playwright/no-conditional-in-test- (i + 2) % 2 === 1- ? `Item ${i + 2} - Professional consulting services including detailed analysis, comprehensive reporting, and ongoing support for enterprise-level implementations`- : `Item ${i + 2}`;-- await itemFieldset.getByRole("textbox", { name: "Name" }).fill(itemName);-- // Set VAT to 10% for each item- const taxSettingsFieldset = itemFieldset.getByRole("group", {- name: "Tax Settings",- });-- // Use different tax rates: 10%, 20%, or 50%- const taxRate =- // eslint-disable-next-line playwright/no-conditional-in-test- (i + 2) % 3 === 0 ? "50" : (i + 2) % 2 === 0 ? "20" : "10";-- await taxSettingsFieldset- .getByRole("textbox", { name: "VAT Rate", exact: true })- .fill(taxRate);-- await itemFieldset- .getByRole("spinbutton", {- name: "Net Price (Rate or Unit Price)",- })- .fill(`${100 * (i + 1)}`);- }-- const finalSection = page.getByTestId("final-section");-- // for better debugging screenshots, we fill in the notes field with a test note- await finalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(- `Test: generates multi-page PDF when invoice has many items (${testInfo.project.name})`,- );-- // Wait for PDF preview to regenerate after invoice data changes (debounce timeout)- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- const downloadPdfEnglishButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });-- await expect(downloadPdfEnglishButton).toBeVisible();- await expect(downloadPdfEnglishButton).toBeEnabled();-- // Click the download button and wait for download- const [download] = await Promise.all([- page.waitForEvent("download"),- downloadPdfEnglishButton.click(),- ]);-- // Get the suggested filename- const suggestedFilename = download.suggestedFilename();-- // save the file to temporary directory- const pdfFilePath = path.join(- downloadDir,- `${browserName}-${suggestedFilename}`,- );-- await download.saveAs(pdfFilePath);-- // Convert to absolute path and use proper file URL format- const absolutePath = path.resolve(pdfFilePath);- await expect.poll(() => fs.existsSync(absolutePath)).toBe(true);-- /**- * RENDER ALL PDF PAGES ON A SINGLE CANVAS AND TAKE SCREENSHOT- */-- const pdfBytes = fs.readFileSync(absolutePath);-- await page.goto("about:blank");-- await renderMultiPagePdfOnCanvas(page, pdfBytes);-- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "stripe-template-multi-pages.png",+ expect(parsedData.stripePayOnlineUrl).toBe(+ "https://buy.stripe.com/test_payment_link",);- });-- test("toggles seller and buyer email visibility in PDF", async ({- page,- browserName,- downloadDir,- }, testInfo) => {- await expect(page).toHaveURL("/?template=default");-- // Switch to Stripe template- await page- .getByRole("combobox", { name: "Invoice Template" })- .selectOption("stripe");-- await expect(page).toHaveURL("/?template=stripe");-- /*- * PHASE 1: Fill inline form with email switch OFF -> PDF screenshot (emails hidden)- */-- const sellerSection = page.getByTestId("seller-information-section");- const buyerSection = page.getByTestId("buyer-information-section");-- // Fill seller fields inline (no saved seller selected, so switch is enabled)- await sellerSection- .getByRole("textbox", { name: "Name (Required)" })- .fill("Email Visibility Test Seller");- await sellerSection- .getByRole("textbox", { name: "Address (Required)" })- .fill("123 Seller Street\nSeller City, 10001");-- await sellerSection- .getByRole("textbox", { name: "Email" })- .fill("[email protected]");-- // Toggle seller email switch OFF via inline form- const sellerEmailSwitch = sellerSection.getByRole("switch", {- name: "Show the 'Email' field in the PDF",- });- await expect(sellerEmailSwitch).toBeChecked();- await sellerEmailSwitch.click();- await expect(sellerEmailSwitch).not.toBeChecked();-- // Fill buyer fields inline (no saved buyer selected, so switch is enabled)- await buyerSection- .getByRole("textbox", { name: "Name (Required)" })- .fill("Email Visibility Test Buyer");-- await buyerSection- .getByRole("textbox", { name: "Address (Required)" })- .fill("456 Buyer Avenue\nBuyer City, 20002");-- await buyerSection- .getByRole("textbox", { name: "Email" })- .fill("[email protected]");-- // Toggle buyer email switch OFF via inline form- const buyerEmailSwitch = buyerSection.getByRole("switch", {- name: "Show the 'Email' field in the PDF",- });- await expect(buyerEmailSwitch).toBeChecked();- await buyerEmailSwitch.click();- await expect(buyerEmailSwitch).not.toBeChecked();-- const finalSection = page.getByTestId("final-section");- await finalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(- `Test: ${testInfo.title} - emails hidden (${testInfo.project.name})`,- );-- // wait for debounce timeout- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- const downloadPdfButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });- await expect(downloadPdfButton).toBeVisible();- await expect(downloadPdfButton).toBeEnabled();-- // Download PDF with emails hidden (toggled off via inline form)- const [download] = await Promise.all([- page.waitForEvent("download"),- downloadPdfButton.click(),- ]);-- const pdfFilePath = path.join(+ await expectPdfScreenshot(page, {downloadDir,- `${browserName}-${download.suggestedFilename()}`,- );- await download.saveAs(pdfFilePath);-- const absolutePath = path.resolve(pdfFilePath);- await expect.poll(() => fs.existsSync(absolutePath)).toBe(true);-- const pdfBytes = fs.readFileSync(absolutePath);- await page.goto("about:blank");- await renderPdfOnCanvas(page, pdfBytes);- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "email-hidden-in-pdf-stripe-template.png",- );-- /*- * PHASE 2: Save seller/buyer via dialog with email ON -> PDF screenshot (emails visible)- */-- await page.goto("/");- await expect(page).toHaveURL("/?template=stripe");-- // Create seller via dialog with email visible- await page.getByRole("button", { name: "New Seller" }).click();-- const manageSellerDialog = page.getByTestId("manage-seller-dialog");-- await manageSellerDialog- .getByRole("textbox", { name: "Name (Required)" })- .fill("Email Visibility Test Seller");-- await manageSellerDialog- .getByRole("textbox", { name: "Address (Required)" })- .fill("123 Seller Street\nSeller City, 10001");-- await manageSellerDialog- .getByRole("textbox", { name: "Email" })- .fill("[email protected]");-- // Verify email visibility switch is checked by default in dialog- const sellerEmailSwitchInDialog = manageSellerDialog.getByRole("switch", {- name: "Show the 'Email' field in the PDF",+ browserName,+ name: "pdf-with-logo-and-payment-url-when-using-stripe-template.png",});- await expect(sellerEmailSwitchInDialog).toBeVisible();- await expect(sellerEmailSwitchInDialog).toBeChecked();-- await manageSellerDialog- .getByRole("button", { name: "Save Seller" })- .click();-- await expect(manageSellerDialog).toBeHidden();-- await expect(- page.getByText("Seller added and applied to invoice", { exact: true }),- ).toBeVisible();-- // wait for debounce timeout- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- // Create buyer via dialog with email visible- await page.getByRole("button", { name: "New Buyer" }).click();-- const manageBuyerDialog = page.getByTestId("manage-buyer-dialog");-- await manageBuyerDialog- .getByRole("textbox", { name: "Name (Required)" })- .fill("Email Visibility Test Buyer");-- await manageBuyerDialog- .getByRole("textbox", { name: "Address (Required)" })- .fill("456 Buyer Avenue\nBuyer City, 20002");-- await manageBuyerDialog- .getByRole("textbox", { name: "Email" })- .fill("[email protected]");-- // Verify email visibility switch is checked by default in dialog- const buyerEmailSwitchInDialog = manageBuyerDialog.getByRole("switch", {- name: "Show the 'Email' field in the PDF",- });- await expect(buyerEmailSwitchInDialog).toBeVisible();- await expect(buyerEmailSwitchInDialog).toBeChecked();-- await manageBuyerDialog.getByRole("button", { name: "Save Buyer" }).click();-- await expect(manageBuyerDialog).toBeHidden();-- await expect(- page.getByText("Buyer added and applied to invoice", { exact: true }),- ).toBeVisible();-- const newFinalSection = page.getByTestId("final-section");- await newFinalSection- .getByRole("textbox", { name: "Notes", exact: true })- .fill(- `Test: ${testInfo.title} - emails visible (${testInfo.project.name})`,- );-- // eslint-disable-next-line playwright/no-wait-for-timeout- await page.waitForTimeout(700);-- const newDownloadPdfButton = page.getByRole("link", {- name: /^(Download PDF|Download PDF in .+)$/,- });- await expect(newDownloadPdfButton).toBeVisible();- await expect(newDownloadPdfButton).toBeEnabled();-- // Download PDF with emails visible (saved via dialog)- const [downloadVisible] = await Promise.all([- page.waitForEvent("download"),- newDownloadPdfButton.click(),- ]);-- const visiblePdfFilePath = path.join(- downloadDir,- `${browserName}-visible-${downloadVisible.suggestedFilename()}`,- );- await downloadVisible.saveAs(visiblePdfFilePath);-- const visibleAbsolutePath = path.resolve(visiblePdfFilePath);- await expect.poll(() => fs.existsSync(visibleAbsolutePath)).toBe(true);-- const visiblePdfBytes = fs.readFileSync(visibleAbsolutePath);- await page.goto("about:blank");- await renderPdfOnCanvas(page, visiblePdfBytes);- await page.waitForFunction(- () =>- (window as unknown as { __PDF_RENDERED__: boolean })- .__PDF_RENDERED__ === true,- );-- await expect(page.locator("canvas")).toHaveScreenshot(- "email-visible-in-pdf-stripe-template.png",- );});});diff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/automatically-sets-date-format-when-switching-to-Stripe-template-Mobile-Chrome-darwin.png b/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/automatically-sets-date-format-when-switching-to-Stripe-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index 46eb53d..0000000Binary files a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/automatically-sets-date-format-when-switching-to-Stripe-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/automatically-sets-date-format-when-switching-to-Stripe-template-Mobile-Safari-darwin.png b/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/automatically-sets-date-format-when-switching-to-Stripe-template-Mobile-Safari-darwin.pngdeleted file mode 100644index 3e8a963..0000000Binary files a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/automatically-sets-date-format-when-switching-to-Stripe-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/displays-qr-code-in-pdf-stripe-template-Mobile-Chrome-darwin.png b/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/displays-qr-code-in-pdf-stripe-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index 2de1247..0000000Binary files a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/displays-qr-code-in-pdf-stripe-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/displays-qr-code-in-pdf-stripe-template-Mobile-Safari-darwin.png b/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/displays-qr-code-in-pdf-stripe-template-Mobile-Safari-darwin.pngdeleted file mode 100644index 3f436d1..0000000Binary files a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/displays-qr-code-in-pdf-stripe-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/displays-service-period-in-pdf-stripe-template-Mobile-Chrome-darwin.png b/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/displays-service-period-in-pdf-stripe-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index 35a9ca4..0000000Binary files a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/displays-service-period-in-pdf-stripe-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/displays-service-period-in-pdf-stripe-template-Mobile-Safari-darwin.png b/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/displays-service-period-in-pdf-stripe-template-Mobile-Safari-darwin.pngdeleted file mode 100644index 3af6b54..0000000Binary files a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/displays-service-period-in-pdf-stripe-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/email-hidden-in-pdf-stripe-template-Mobile-Chrome-darwin.png b/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/email-hidden-in-pdf-stripe-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index 5ef6609..0000000Binary files a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/email-hidden-in-pdf-stripe-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/email-hidden-in-pdf-stripe-template-Mobile-Safari-darwin.png b/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/email-hidden-in-pdf-stripe-template-Mobile-Safari-darwin.pngdeleted file mode 100644index 22c9d3e..0000000Binary files a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/email-hidden-in-pdf-stripe-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/email-visible-in-pdf-stripe-template-Mobile-Chrome-darwin.png b/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/email-visible-in-pdf-stripe-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index 20a042f..0000000Binary files a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/email-visible-in-pdf-stripe-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/email-visible-in-pdf-stripe-template-Mobile-Safari-darwin.png b/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/email-visible-in-pdf-stripe-template-Mobile-Safari-darwin.pngdeleted file mode 100644index 87c40ee..0000000Binary files a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/email-visible-in-pdf-stripe-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/pdf-with-logo-and-payment-url-when-using-stripe-template-Mobile-Chrome-darwin.png b/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/pdf-with-logo-and-payment-url-when-using-stripe-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index c6d3a86..0000000Binary files a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/pdf-with-logo-and-payment-url-when-using-stripe-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/pdf-with-logo-and-payment-url-when-using-stripe-template-Mobile-Safari-darwin.png b/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/pdf-with-logo-and-payment-url-when-using-stripe-template-Mobile-Safari-darwin.pngdeleted file mode 100644index 8e15d55..0000000Binary files a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/pdf-with-logo-and-payment-url-when-using-stripe-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/qr-code-hidden-in-pdf-stripe-template-Mobile-Chrome-darwin.png b/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/qr-code-hidden-in-pdf-stripe-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index 5838004..0000000Binary files a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/qr-code-hidden-in-pdf-stripe-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/qr-code-hidden-in-pdf-stripe-template-Mobile-Safari-darwin.png b/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/qr-code-hidden-in-pdf-stripe-template-Mobile-Safari-darwin.pngdeleted file mode 100644index 0baaafe..0000000Binary files a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/qr-code-hidden-in-pdf-stripe-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/service-period-hidden-in-pdf-stripe-template-Mobile-Chrome-darwin.png b/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/service-period-hidden-in-pdf-stripe-template-Mobile-Chrome-darwin.pngdeleted file mode 100644index 67d02e2..0000000Binary files a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/service-period-hidden-in-pdf-stripe-template-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/service-period-hidden-in-pdf-stripe-template-Mobile-Safari-darwin.png b/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/service-period-hidden-in-pdf-stripe-template-Mobile-Safari-darwin.pngdeleted file mode 100644index 2c74376..0000000Binary files a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/service-period-hidden-in-pdf-stripe-template-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/stripe-template-multi-pages-Mobile-Chrome-darwin.png b/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/stripe-template-multi-pages-Mobile-Chrome-darwin.pngdeleted file mode 100644index 516f70b..0000000Binary files a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/stripe-template-multi-pages-Mobile-Chrome-darwin.png and /dev/null differdiff --git a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/stripe-template-multi-pages-Mobile-Safari-darwin.png b/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/stripe-template-multi-pages-Mobile-Safari-darwin.pngdeleted file mode 100644index 841ed42..0000000Binary files a/e2e/stripe-invoice-template/stripe-invoice-template.test.ts-snapshots/stripe-template-multi-pages-Mobile-Safari-darwin.png and /dev/null differdiff --git a/e2e/stripe-invoice-template/utils.ts b/e2e/stripe-invoice-template/utils.tsindex ed0bbbc..776d32f 100644--- a/e2e/stripe-invoice-template/utils.ts+++ b/e2e/stripe-invoice-template/utils.ts@@ -1,8 +1,23 @@import path from "node:path";+import type { Page } from "@playwright/test";-const LOGO_FIXTURE_PATH = path.join(__dirname, "../fixtures/app-logo.png");+/**+ * The UI accepts JPEG, PNG and WebP logos, so we ship a fixture per format.+ */+export const LOGO_FIXTURE_FORMATS = ["png", "jpg", "webp"] as const;++type LogoFixtureFormat = (typeof LOGO_FIXTURE_FORMATS)[number];++export async function uploadLogoFile(+ page: Page,+ format: LogoFixtureFormat = "png",+) {+ const logoFixturePath = path.join(+ __dirname,+ `../fixtures/app-logo.${format}`,+ );-export async function uploadLogoFile(page: Page) {- await page.setInputFiles("#logoUpload", LOGO_FIXTURE_PATH);+ // eslint-disable-next-line playwright/prefer-locator+ await page.setInputFiles("#logoUpload", logoFixturePath);}diff --git a/e2e/utils/extended-playwright-test.ts b/e2e/utils/extended-playwright-test.tsindex 132ce74..01cff32 100644--- a/e2e/utils/extended-playwright-test.ts+++ b/e2e/utils/extended-playwright-test.ts@@ -1,6 +1,7 @@import fs from "node:fs";import os from "node:os";import path from "node:path";+import { test as base } from "@playwright/test";/**diff --git a/e2e/utils/pdf-download.ts b/e2e/utils/pdf-download.tsnew file mode 100644index 0000000..b9fefce--- /dev/null+++ b/e2e/utils/pdf-download.ts@@ -0,0 +1,258 @@+import fs from "node:fs";+import path from "node:path";++import { expect, test, type Locator, type Page } from "@playwright/test";++import {+ renderMultiPagePdfOnCanvas,+ renderPdfOnCanvas,+} from "./render-pdf-on-canvas";++/**+ * The label of the download button changes with the selected PDF language+ * (e.g. "Download PDF" / "Download PDF in Polish"), so we always match both.+ */+const DOWNLOAD_PDF_LINK_NAME = /^(Download PDF|Download PDF in .+)$/;++/**+ * The invoice form is debounced: every form change is written to localStorage and+ * re-renders the PDF only after `DEBOUNCE_TIMEOUT` (500ms, see the invoice form)+ * has elapsed. We wait for that debounce plus a bit of slack for the PDF render.+ */+const PDF_DEBOUNCE_TIMEOUT = 700;++export function getDownloadPdfLink(page: Page): Locator {+ return page.getByRole("link", { name: DOWNLOAD_PDF_LINK_NAME });+}++/**+ * Runs a form change and waits for the PDF to be regenerated with it.+ *+ * The invoice form is debounced, so a form change is only written to localStorage+ * and rendered into the PDF once the debounce has elapsed — everything that reads+ * the PDF (or reloads the page) has to wait for it first.+ */+export async function waitForPdfRegeneration(+ page: Page,+ action: () => Promise<void>,+) {+ await action();++ // wait for the debounce timeout, so that the PDF is regenerated (and the form+ // data is saved to localStorage) before the test continues+ // eslint-disable-next-line playwright/no-wait-for-timeout+ await page.waitForTimeout(PDF_DEBOUNCE_TIMEOUT);++ // the download link being ready means the regenerated PDF is available+ const downloadPdfLink = getDownloadPdfLink(page);++ await expect(downloadPdfLink).toBeVisible();+ await expect(downloadPdfLink).toBeEnabled();+}++/**+ * Fills the notes field with a test note, so that the PDF screenshots are easier+ * to debug (you can tell which test produced a screenshot just by looking at it),+ * and waits until the PDF has been regenerated with it.+ */+export async function fillDebugNotes(page: Page, notes: string) {+ await waitForPdfRegeneration(page, async () => {+ await page+ .getByTestId("final-section")+ .getByRole("textbox", { name: "Notes", exact: true })+ .fill(notes);+ });+}++/**+ * Clicks the download button and saves the downloaded PDF to the temporary+ * download directory provided by the extended test fixture.+ */+async function downloadPdf(+ page: Page,+ {+ downloadDir,+ browserName,+ filePrefix = "",+ }: { downloadDir: string; browserName: string; filePrefix?: string },+) {+ const downloadPdfLink = getDownloadPdfLink(page);++ await expect(downloadPdfLink).toBeVisible();+ await expect(downloadPdfLink).toBeEnabled();++ const [download] = await Promise.all([+ page.waitForEvent("download"),+ downloadPdfLink.click(),+ ]);++ const suggestedFilename = download.suggestedFilename();++ const pdfFilePath = path.join(+ downloadDir,+ `${browserName}-${filePrefix}${suggestedFilename}`,+ );++ await download.saveAs(pdfFilePath);++ const absolutePath = path.resolve(pdfFilePath);+ await expect+ .poll(() => {+ return fs.existsSync(absolutePath);+ })+ .toBe(true);++ return {+ suggestedFilename,+ pdfBytes: fs.readFileSync(absolutePath),+ };+}++/**+ * The project the PDF **screenshots** are compared on.+ *+ * The screenshot is a canvas that pdf.js rasterizes at a fixed size, so running it+ * on every project compared the same PDF re-rendered by a different rasterizer+ * (WebKit vs Chromium), not our app. The parts that *are* browser and device+ * specific — generating the PDF and downloading it — still run on every project,+ * see {@link expectValidPdfFile}.+ */+const DEFAULT_SNAPSHOT_PROJECT = "Desktop Chrome";++/**+ * Asserts the downloaded file is a complete PDF document.+ *+ * This runs on **every** project: it is what verifies that PDF generation and the+ * download itself work in that browser/device, without depending on how the+ * browser rasterizes the result.+ */+function expectValidPdfFile(pdfBytes: Buffer) {+ // PDF magic bytes+ expect(pdfBytes.subarray(0, 5).toString("latin1")).toBe("%PDF-");++ // the end-of-file marker means we got the whole document, not a truncated download+ expect(pdfBytes.subarray(-1024).toString("latin1")).toContain("%%EOF");++ // a generated invoice is tens of kilobytes, an empty document would not be+ expect(pdfBytes.byteLength).toBeGreaterThan(1000);+}++/**+ * Reads the number of pages from the PDF page tree (`/Count N`), which react-pdf+ * writes uncompressed. Lets us assert the page count on every project, without+ * rendering the document.+ */+function getPdfPageCount(pdfBytes: Buffer) {+ const counts = [+ ...pdfBytes.toString("latin1").matchAll(/\/Count (\d+)/g),+ ].map((match) => {+ return Number(match[1]);+ });++ expect(counts.length).toBeGreaterThan(0);++ // nested page tree nodes each carry a count, the root holds the total+ return Math.max(...counts);+}++/**+ * Downloads the currently previewed PDF, renders it on a canvas and compares it+ * against the stored screenshot.+ *+ * The most **reliable** way (cross-browser and cross-platform) to screenshot a PDF+ * is to render it on a canvas, see {@link renderPdfOnCanvas}.+ *+ * - `notes` fills the notes field before downloading (for easier debugging of the+ * screenshots) and waits until the PDF is regenerated with it.+ * - `allPages` stacks **every** page of the PDF on a single canvas instead of+ * screenshotting only the first one.+ * - `snapshotProject` overrides which project(s) compare the screenshot, for tests+ * that only run on the mobile projects.+ *+ * Every project downloads the PDF and asserts it is a complete document; only+ * {@link DEFAULT_SNAPSHOT_PROJECT} compares the rendered screenshot.+ *+ * Returns the suggested filename of the download and the number of pages of the+ * generated PDF, so that tests can assert on them.+ */+export async function expectPdfScreenshot(+ page: Page,+ {+ downloadDir,+ browserName,+ name,+ notes,+ filePrefix,+ allPages = false,+ afterDownload,+ snapshotProject = DEFAULT_SNAPSHOT_PROJECT,+ }: {+ downloadDir: string;+ browserName: string;+ /** Screenshot name, e.g. `displays-qr-code-in-pdf-default-template.png` */+ name: string;+ notes?: string;+ filePrefix?: string;+ allPages?: boolean;+ /** Runs right after the download finished, while the app is still open */+ afterDownload?: () => Promise<void>;+ snapshotProject?: string | string[];+ },+) {+ if (notes) {+ await fillDebugNotes(page, notes);+ }++ const { pdfBytes, suggestedFilename } = await downloadPdf(page, {+ downloadDir,+ browserName,+ filePrefix,+ });++ await afterDownload?.();++ /**+ * EVERY PROJECT: verify the browser generated a complete PDF and downloaded it+ */+ expectValidPdfFile(pdfBytes);++ const numPages = getPdfPageCount(pdfBytes);++ // the visual comparison only runs on the snapshot project(s), see DEFAULT_SNAPSHOT_PROJECT+ const snapshotProjects = Array.isArray(snapshotProject)+ ? snapshotProject+ : [snapshotProject];++ if (!snapshotProjects.includes(test.info().project.name)) {+ return { suggestedFilename, numPages };+ }++ /**+ * RENDER PDF ON CANVAS AND TAKE SCREENSHOT OF IT+ */++ await page.goto("about:blank");++ if (allPages) {+ await renderMultiPagePdfOnCanvas(page, pdfBytes);+ } else {+ await renderPdfOnCanvas(page, pdfBytes);+ }++ await page.waitForFunction(() => {+ return (window as unknown as { __PDF_RENDERED__: boolean })+ .__PDF_RENDERED__;+ });++ await expect(page.locator("canvas")).toHaveScreenshot(name);++ // cross check the page count we read from the raw PDF against what pdf.js parsed+ const renderedPageCount = await page.evaluate(() => {+ return (window as unknown as { __PDF_PAGE_COUNT__: number })+ .__PDF_PAGE_COUNT__;+ });++ expect(renderedPageCount).toBe(numPages);++ return { suggestedFilename, numPages };+}diff --git a/e2e/utils/render-pdf-on-canvas.ts b/e2e/utils/render-pdf-on-canvas.tsindex c537b54..e6060f7 100644--- a/e2e/utils/render-pdf-on-canvas.ts+++ b/e2e/utils/render-pdf-on-canvas.ts@@ -49,6 +49,7 @@ export async function renderPdfOnCanvas(page: Page, pdfBytes: Uint8Array) {await page.render({ canvasContext: ctx, viewport }).promise+ window.__PDF_PAGE_COUNT__ = pdf.numPageswindow.__PDF_RENDERED__ = true</script></body>@@ -132,6 +133,7 @@ export async function renderMultiPagePdfOnCanvas(currentX += viewport.width + pageGap}+ window.__PDF_PAGE_COUNT__ = numPageswindow.__PDF_RENDERED__ = true</script></body>diff --git a/eslint.config.mjs b/eslint.config.mjsdeleted file mode 100644index 6a12efa..0000000--- a/eslint.config.mjs+++ /dev/null@@ -1,103 +0,0 @@-// @ts-check-import { FlatCompat } from "@eslint/eslintrc";-import tseslint from "typescript-eslint";-import playwright from "eslint-plugin-playwright";-import youMightNotNeedAnEffect from "eslint-plugin-react-you-might-not-need-an-effect";--const compat = new FlatCompat({- baseDirectory: import.meta.dirname,-});--export default tseslint.config(- {- ignores: [".next", "playwright-output", ".trigger"],- },- // next config- ...compat.extends("next/core-web-vitals"),- {- files: ["**/*.ts", "**/*.tsx"],- extends: [- ...tseslint.configs.recommended,- ...tseslint.configs.recommendedTypeChecked,- ...tseslint.configs.stylisticTypeChecked,- ],- rules: {- "@typescript-eslint/array-type": "off",- "@typescript-eslint/consistent-type-definitions": "off",- "@typescript-eslint/consistent-type-imports": [- "warn",- { prefer: "type-imports", fixStyle: "inline-type-imports" },- ],- "@typescript-eslint/no-unused-vars": [- "error",- { argsIgnorePattern: "^_" },- ],- "@typescript-eslint/require-await": "off",- "@typescript-eslint/no-misused-promises": [- "error",- { checksVoidReturn: { attributes: false } },- ],- "@typescript-eslint/prefer-nullish-coalescing": "off",- "@typescript-eslint/unbound-method": "off",- "@typescript-eslint/consistent-indexed-object-style": "off",- "@typescript-eslint/non-nullable-type-assertion-style": "off",- "no-restricted-imports": [- "error",- {- paths: [- {- // https://github.com/diegomura/react-pdf/issues/2890#issuecomment-2443831013- name: "@react-pdf/renderer",- message:- "Please use @react-pdf/renderer/lib/react-pdf.browser instead. Check https://github.com/diegomura/react-pdf/issues/2890#issuecomment-2443831013 for more details.",- },- {- name: "node:process",- message: "Please use @/env.ts instead.",- },- {- name: "process",- message: "Please use @/env.ts instead.",- },- ],- },- ],- "@next/next/no-img-element": "off",- "react/jsx-no-leaked-render": "warn",- },- },- {- rules: {- "no-console": ["warn", { allow: ["error"] }],- },- },- {- files: ["src/**/*.ts", "src/**/*.tsx"],- plugins: {- "react-you-might-not-need-an-effect": youMightNotNeedAnEffect,- },- rules: {- "react-you-might-not-need-an-effect/you-might-not-need-an-effect": "warn",- },- },- // Playwright config for e2e tests only- {- ...playwright.configs["flat/recommended"],- files: ["e2e/**"],- rules: {- ...playwright.configs["flat/recommended"].rules,- // Customize Playwright rules- // ...- },- },- {- linterOptions: {- reportUnusedDisableDirectives: true,- },- languageOptions: {- parserOptions: {- projectService: true,- },- },- },-);diff --git a/global.ts b/global.tsindex 0f34f57..a187294 100644--- a/global.ts+++ b/global.ts@@ -1,5 +1,6 @@-import { type routing } from "@/i18n/routing";import type formats from "@/i18n/request";+import { type routing } from "@/i18n/routing";+import type EnMessages from "./messages/en.json";type Locale = (typeof routing.locales)[number];@@ -13,3 +14,7 @@ declare module "next-intl" {Formats: Formats;}}++declare module "mdx/types.js" {+ export import JSX = React.JSX;+}diff --git a/knip.ts b/knip.tsindex 72fd456..2516eb4 100644--- a/knip.ts+++ b/knip.ts@@ -3,19 +3,26 @@ import type { KnipConfig } from "knip";// https://knip.dev/reference/configuration#_topconst config: KnipConfig = {// Trigger.dev entry points (https://trigger.dev/docs/config/config-file)- entry: ["trigger.config.ts", "src/trigger/monthly-recurring-invoice.ts"],+ entry: [+ "trigger.config.ts",+ "src/trigger/monthly-recurring-invoice.ts",+ // spawned as a child process by e2e/server-render-pdf/server-render-pdf.test.ts+ "e2e/server-render-pdf/render-server-pdf.mjs",+ ],ignoreDependencies: ["shadcn","@radix-ui/react-separator","@types/ua-parser-js",- "eslint-plugin-react-hooks","file-saver","jszip",- "@next/eslint-plugin-next","@types/file-saver",- "eslint-config-next",- "@ianvs/prettier-plugin-sort-imports",- "pdfjs-dist",+ // loaded by oxlint through `jsPlugins` in .oxlintrc.json, never imported+ "eslint-plugin-playwright",+ "eslint-plugin-react",+ "eslint-plugin-react-you-might-not-need-an-effect",+ // Sentry resolves these directly when instrumenting Next.js in development.+ "import-in-the-middle",+ "require-in-the-middle",],ignore: ["src/app/**/invoice-pdf-download-multiple-languages.tsx",@@ -24,7 +31,7 @@ const config: KnipConfig = {"src/i18n/**/*","src/app/schema/**/*","src/app/changelog/content/**/*",- "src/app/(app)/pdf-i18n-translations/pdf-translations.ts",+ "src/app/(app)/pdf-i18n-translations/pdf-translations-schema.ts",],includeEntryExports: true,// ignore tagsdiff --git a/lint-staged.config.js b/lint-staged.config.jsindex 6c5f5a3..9d699da 100644--- a/lint-staged.config.js+++ b/lint-staged.config.js@@ -1,12 +1,14 @@module.exports = {- // Run type-check, lint, security check, knip, prettify, and vitest on all changes to files+ // Run type-check, lint, security check, knip, format, and vitest on all changes to files// https://github.com/okonet/lint-staged- "*": () => [- `pnpm run type-check:go`,- `pnpm run lint`,- `pnpm run check-github-actions-security`, // zizmor is used to check the security of the GitHub Actions workflows https://docs.zizmor.sh/- `pnpm run knip`,- `pnpm run vitest --run --reporter=verbose`,- `pnpm run prettify --write`,- ],+ "*": () => {+ return [+ `pnpm run type-check:fast`,+ `pnpm run lint`,+ `pnpm run check-github-actions-security`, // zizmor is used to check the security of the GitHub Actions workflows https://docs.zizmor.sh/+ `pnpm run knip`,+ `pnpm run vitest --run --reporter=verbose`,+ `pnpm run format`,+ ];+ },};diff --git a/next.config.mjs b/next.config.mjsindex 13b9789..487a5f0 100644--- a/next.config.mjs+++ b/next.config.mjs@@ -1,41 +1,43 @@// @ts-check-import { withSentryConfig } from "@sentry/nextjs";-import createNextIntlPlugin from "next-intl/plugin";+import fs from "node:fs";+import path from "node:path";+import createMDX from "@next/mdx";+import { withSentryConfig } from "@sentry/nextjs";import { createJiti } from "jiti";-import remarkGfm from "remark-gfm";--import path from "node:path";-import { fileURLToPath } from "node:url";-import fs from "node:fs";+import createNextIntlPlugin from "next-intl/plugin";-const loadTsFileViaJiti = createJiti(fileURLToPath(import.meta.url));+const loadTsFileViaJiti = createJiti(import.meta.filename);-// Import ENV file here to validate during build. Using jiti@^1 we can import .ts files :)-loadTsFileViaJiti("./src/env");+// Import ENV file here to validate during build. jiti lets us import .ts files :)+// (jiti v2 deprecated the callable form in favour of `.import()`)+await loadTsFileViaJiti.import("./src/env");// Validate all i18n files, that are used to translate the /about pageasync function validatei18nAndInvoicePDFTranslationFiles() {// Validates our custom translations object against the schema, that is used to translate PDF fields, invoice items table, etc.try {- // Import the translations schema using jiti+ // Import the translations schema and catalog using jiti// @ts-ignore- const { invoicePDFtranslationsSchema, INVOICE_PDF_TRANSLATIONS } =- await loadTsFileViaJiti.import(- "./src/app/(app)/pdf-i18n-translations/pdf-translations.ts",- );+ const { invoicePDFTranslationsSchema } = await loadTsFileViaJiti.import(+ "./src/app/(app)/pdf-i18n-translations/pdf-translations-schema.ts",+ );+ // @ts-ignore+ const { INVOICE_PDF_TRANSLATIONS } = await loadTsFileViaJiti.import(+ "./src/app/(app)/pdf-i18n-translations/pdf-translations.ts",+ );- const result = invoicePDFtranslationsSchema.safeParse(+ const result = invoicePDFTranslationsSchema.safeParse(INVOICE_PDF_TRANSLATIONS,);if (!result.success) {- console.error("❌ Invalid translations:", result.error.message);+ console.error("❌ Invalid PDF translations:", result.error.message);process.exit(1);}} catch (error) {- console.error("❌ Error validating translations:", error);+ console.error("❌ Error validating PDF translations:", error);process.exit(1);}@@ -48,9 +50,9 @@ async function validatei18nAndInvoicePDFTranslationFiles() {);// Validate messages- const is18nJSONMessageFiles = fs- .readdirSync(messagesDir)- .filter((file) => file.endsWith(".json"));+ const is18nJSONMessageFiles = fs.readdirSync(messagesDir).filter((file) => {+ return file.endsWith(".json");+ });const validationPromises = is18nJSONMessageFiles.map(async (file) => {try {@@ -83,11 +85,12 @@ async function validatei18nAndInvoicePDFTranslationFiles() {const results = await Promise.allSettled(validationPromises);- const hasErrors = results.some(- (result) =>+ const hasErrors = results.some((result) => {+ return (result.status === "rejected" ||- (result.status === "fulfilled" && !result.value.success),- );+ (result.status === "fulfilled" && !result.value.success)+ );+ });if (hasErrors) {results.forEach((result) => {@@ -106,7 +109,9 @@ async function validatei18nAndInvoicePDFTranslationFiles() {}}-// Since the function is now async, we need to handle it properly+// Deliberately not awaited at the top level: validation runs alongside the rest of+// the config evaluation instead of blocking it, and failures exit the process below.+// oxlint-disable-next-line unicorn/prefer-top-level-awaitvalidatei18nAndInvoicePDFTranslationFiles().catch((error) => {console.error("❌ Fatal error during validation:", error);process.exit(1);@@ -122,7 +127,9 @@ const withMDX = createMDX({// Add markdown plugins here, as desiredextension: /\.mdx?$/,options: {- remarkPlugins: [remarkGfm],+ // Plugins must be referenced by name (not imported) so Turbopack can+ // serialize the loader options and resolve them itself.+ remarkPlugins: [["remark-gfm"]],rehypePlugins: [],},});@@ -131,12 +138,6 @@ const withMDX = createMDX({const nextConfig = {// Configure the file extensions that Next.js should handlepageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx"],- typescript: {- ignoreBuildErrors: true,- },- eslint: {- ignoreDuringBuilds: true,- },compiler: {removeConsole: process.env.VERCEL_ENV === "production",},@@ -186,9 +187,16 @@ export default withSentryConfig(withNextIntl(withMDX(nextConfig)), {// Upload a larger set of source maps for prettier stack traces (increases build time)widenClientFileUpload: true,- // Automatically annotate React components to show their full name in breadcrumbs and session replay- reactComponentAnnotation: {- enabled: true,+ webpack: {+ // Automatically annotate React components to show their full name in breadcrumbs and session replay+ reactComponentAnnotation: {+ enabled: true,+ },++ treeshake: {+ // Automatically tree-shake Sentry logger statements to reduce bundle size+ removeDebugLogging: true,+ },},// Uncomment to route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.@@ -196,7 +204,4 @@ export default withSentryConfig(withNextIntl(withMDX(nextConfig)), {// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-// side errors will fail.// tunnelRoute: "/monitoring",-- // Automatically tree-shake Sentry logger statements to reduce bundle size- disableLogger: true,});diff --git a/package.json b/package.jsonindex c7fac69..55552dd 100644--- a/package.json+++ b/package.json@@ -2,19 +2,31 @@"name": "easy-invoice-pdf","version": "1.0.3","private": true,- "packageManager": "[email protected]+sha512.1c67b3b359b2d408119ba1ed289f34b8fc3c6873412bec6fd264fbdc82489e510fcbecb9ce9d22dae7f3b76269d8441046014bdca53b9979cd7a561ad631b800",- "author": "Vlad Sazonau (https://vladsazon.com)",- "homepage": "https://easyinvoicepdf.com","description": "Free and open-source invoice generator. No sign up, no ads, instant PDF download.",+ "keywords": [+ "easyinvoicepdf",+ "free",+ "invoice",+ "invoice generator",+ "invoice pdf",+ "online invoice",+ "open source",+ "pdf",+ "pdf invoice template",+ "professional invoice"+ ],+ "homepage": "https://easyinvoicepdf.com",+ "author": "Vlad Sazonau (https://vladsazon.com)","scripts": {- "dev": "next dev",+ "dev": "next dev --turbopack","build": "next build","start": "next start",- "type-check": "tsc --noEmit --diagnostics",- "type-check:go": "tsgo --diagnostics",- "lint": "pnpm eslint . --cache",- "lint:fix": "pnpm eslint . --fix",- "prettify": "prettier --write --cache '**/*.{ts?(x),json,js,mjs,yml,yaml,md}'",+ "type-check": "next typegen && tsc --noEmit --diagnostics",+ "type-check:fast": "next typegen && oxlint . --type-check --quiet",+ "lint": "next typegen && oxlint . --type-aware",+ "lint:fix": "oxlint . --fix",+ "format": "oxfmt .",+ "format:check": "oxfmt --check .","knip": "knip","update-deps": "pnpm upgrade --interactive --latest -rLi --config.minimum-release-age=7200","vitest": "vitest --reporter=verbose",@@ -38,10 +50,10 @@"trigger:deploy": "pnpm dlx trigger.dev deploy"},"dependencies": {- "@hookform/resolvers": "3.9.0",+ "@hookform/resolvers": "5.9.1","@mdx-js/loader": "3.1.0","@mdx-js/react": "3.1.0",- "@next/mdx": "15.3.3",+ "@next/mdx": "15.5.23","@radix-ui/react-accordion": "1.2.3","@radix-ui/react-alert-dialog": "1.1.6","@radix-ui/react-dialog": "1.1.6",@@ -53,8 +65,8 @@"@radix-ui/react-switch": "1.1.3","@radix-ui/react-tabs": "1.1.3","@radix-ui/react-tooltip": "1.1.8",- "@react-pdf/renderer": "4.3.0",- "@sentry/nextjs": "9.3.0",+ "@react-pdf/renderer": "4.6.1",+ "@sentry/nextjs": "10.70.0","@t3-oss/env-nextjs": "0.13.4","@tailwindcss/typography": "0.5.16","@trigger.dev/sdk": "4.5.6",@@ -71,76 +83,63 @@"dayjs": "1.11.13","embla-carousel-auto-scroll": "8.6.0","embla-carousel-react": "8.6.0",- "eslint-plugin-react-hooks": "5.2.0","file-saver": "2.0.5","googleapis": "148.0.0",+ "import-in-the-middle": "3.3.3","jiti": "2.4.2","jszip": "3.10.1","lucide-react": "0.477.0","lz-string": "1.5.0","motion": "12.38.0","n2words": "1.21.0",- "next": "14.2.15",- "next-intl": "4.0.2",+ "next": "15.5.24",+ "next-intl": "4.13.7",+ "pdfjs-dist": "5.4.296","qrcode": "1.5.4",- "react": "18.3.1",- "react-dom": "18.3.1",- "react-hook-form": "7.53.1",+ "react": "19.2.8",+ "react-dom": "19.2.8",+ "react-hook-form": "7.86.0","react-intersection-observer": "9.16.0",- "react-pdf": "9.2.1",+ "react-pdf": "10.4.1","remark-gfm": "4.0.1",+ "require-in-the-middle": "8.0.1","resend": "4.2.0","sonner": "1.7.4","tailwind-merge": "2.6.0","tailwindcss-animate": "1.0.7","ua-parser-js": "2.0.3","use-debounce": "10.0.4",- "zod": "3.24.4"+ "zod": "4.5.4"},"devDependencies": {- "@eslint/eslintrc": "3.3.1",- "@next/eslint-plugin-next": "15.2.3","@playwright/test": "1.60.0","@testing-library/jest-dom": "6.9.1","@testing-library/react": "16.3.2","@testing-library/user-event": "14.6.1","@types/file-saver": "2.0.7","@types/node": "22.8.1",- "@types/react": "18.3.12",- "@types/react-dom": "18.3.1",- "@typescript/native-preview": "7.0.0-dev.20260217.1",+ "@types/react": "19.2.18",+ "@types/react-dom": "19.2.4","actions-up": "1.14.2","autoprefixer": "10.4.21","dotenv": "17.2.3",- "eslint": "9.33.0",- "eslint-config-next": "15.2.3",- "eslint-plugin-playwright": "2.2.0",- "eslint-plugin-react-you-might-not-need-an-effect": "0.0.39",+ "eslint-plugin-playwright": "2.11.0",+ "eslint-plugin-react": "7.37.5",+ "eslint-plugin-react-you-might-not-need-an-effect": "1.0.2","happy-dom": "20.10.6","husky": "9.1.7","knip": "5.85.0","lint-staged": "15.5.0",+ "oxfmt": "0.64.0",+ "oxlint": "1.79.0",+ "oxlint-tsgolint": "7.0.2001","postcss": "8.5.3",- "prettier": "3.5.3",- "prettier-plugin-tailwindcss": "0.6.11","react-email": "4.0.4","schema-dts": "1.1.5","shadcn": "3.2.1","tailwindcss": "3.4.14",- "typescript": "5.9.3",- "typescript-eslint": "8.56.0",+ "typescript": "6.0.3","vitest": "3.2.4"},- "keywords": [- "invoice",- "pdf",- "invoice generator",- "open source",- "free",- "invoice pdf",- "professional invoice",- "online invoice",- "pdf invoice template",- "easyinvoicepdf"- ]+ "packageManager": "[email protected]+sha512.1c67b3b359b2d408119ba1ed289f34b8fc3c6873412bec6fd264fbdc82489e510fcbecb9ce9d22dae7f3b76269d8441046014bdca53b9979cd7a561ad631b800"}diff --git a/patches/README.md b/patches/README.mdnew file mode 100644index 0000000..ae3bb55--- /dev/null+++ b/patches/README.md@@ -0,0 +1,154 @@+# Why `[email protected]` exists++**Upstream issue:** [foliojs/fontkit#154](https://github.com/foliojs/fontkit/issues/154)+— reported February 2018, still open, still present in 2.0.4 (latest).+[#248](https://github.com/foliojs/fontkit/issues/248) looks like the same root+cause reported from the `getGlyph(gid)` side.++**Symptom.** Switching the invoice template and then the PDF language in quick+succession produced PDFs with the first one or two characters of labels missing:++| expected | rendered |+| ----------------- | ---------------- |+| `Fatura` | `atura` |+| `Data de emissão` | `ata de emissão` |+| `agosto 25, 2026` | `osto 25, 2026` |+| `Cobrar de` | `obrar de` |+| `Valor vencido` | `alor vencido` |++It hit Portuguese and Spanish far more than English, was intermittent, and a+page reload always cleared it. It affected both the preview **and** the+downloaded file, so it was never a viewer problem.++## Root cause++fontkit caches `Glyph` objects keyed by glyph id **only**, and bakes the+character(s) that glyph came from in at first creation:++```js+getGlyph(glyph, characters = []) {+ if (!this._glyphs[glyph]) { /* ...new Glyph(glyph, characters, this) */ }+ return this._glyphs[glyph] || null; // `characters` ignored when already cached+}+```++Whoever creates a glyph first wins, and not every caller passes the characters.+Accented letters are **composite glyphs**: `ã` is drawn as `a` plus a tilde.+Decomposing one calls `this._font.getGlyph(component.glyphID)` with **no**+characters, so rendering `ã ç é ó` caches the base letters `a c e o` with an+empty `codePoints`.++`@react-pdf/font` keeps the parsed font in a module-level store+(`FontSource.data`), shared by every render on the page. So one Portuguese+render poisons the cache and **every later render in that session is corrupt**+— which is exactly why reloading "fixed" it.++Downstream, two things then go wrong:++- `encodeGlyphs` only writes the `ToUnicode` entry from `glyph.codePoints`, so+ affected glyphs get no entry and extract as control characters+ (`a` → `U+0001`, `e` → `U+0005`, `o` → `U+000A`).+- `textkit` derives `stringIndices` from `codePoints`, so runs misalign and+ leading glyphs are dropped from the output.++This is **not** specific to Inter — Open Sans behaves identically, as does any+font that builds accented letters as composites (i.e. essentially all of them).+It is also not specific to a `@react-pdf/renderer` version: 4.3.0 and 4.9.0 both+depend on fontkit 2.0.4 and both are affected. Older setups were not immune,+just less likely to hit the triggering render order.++## What the patch does++**Evicts** a glyph that was cached without codePoints, so the next call — the one+that does know them — rebuilds it:++```js+if (+ characters.length > 0 &&+ this._glyphs[glyph] &&+ this._glyphs[glyph].codePoints.length === 0+) {+ this._glyphs[glyph] = null;+}+```++Repairing `codePoints` in place (the other fix suggested upstream) is **not+enough**. The `Glyph` constructor derives two fields from them:++```js+this.isMark = this.codePoints.length > 0 && this.codePoints.every(isMark);+this.isLigature = this.codePoints.length > 1;+```++Decomposition caches the accent components too, not just the base letters, so a+patched-in-place mark glyph keeps `isMark: false` — and `isMark` drives GPOS mark+attachment, i.e. where the accent gets positioned. Measured on Inter after+decomposing `ç ã é ó`:++| | U+0303 tilde | U+0327 cedilla | U+0308 diaeresis (not a component — control) |+| ---------------------- | ----------------------- | ----------------------- | -------------------------------------------- |+| unpatched | `isMark=false cp=[]` | `isMark=false cp=[]` | `isMark=true cp=[776]` |+| repair in place | `isMark=false cp=[771]` | `isMark=false cp=[807]` | `isMark=true cp=[776]` |+| **evict (this patch)** | `isMark=true cp=[771]` | `isMark=true cp=[807]` | `isMark=true cp=[776]` |++Approach suggested by @mauricedoepke in+https://github.com/foliojs/fontkit/issues/154#issuecomment-4187174366.++## Automated guard++`src/app/(app)/components/invoice-templates/__tests__/fontkit-glyph-cache-patch.test.ts`+fails if the patch stops being applied. It resolves the exact fontkit instance+`@react-pdf/renderer` renders with, and reproduces the poisoning against a real+TTF that ships with `pdfjs-dist` (no committed asset, no network).++It asserts the patch's _contents_, not its path, because pnpm can recreate the+`[email protected]_patch_hash=…` directory with unpatched files. That assertion also+pins the eviction approach. The `isMark` regression above is **not** covered+behaviourally: it needs a font with combining marks and none ship with our+dependencies (the Liberation family in `pdfjs-dist` has none).++## Reproducing / verifying++```js+import fk from "fontkit";+const font = fk.create(fs.readFileSync("Inter-Medium.ttf"));+for (const ch of ["ã", "ç", "é", "ó"])+ font.glyphForCodePoint(ch.codePointAt(0)).path;+// unpatched: a c e o now all have codePoints: []+["a", "c", "e", "o"].map(+ (ch) => font._glyphs[font.glyphForCodePoint(ch.codePointAt(0)).id].codePoints,+);+```++End to end: render a PDF, poison the cache as above, render again and extract+the text with pdf.js. Unpatched the second render yields `4g "tur"` for+`Fatura`; patched it stays `6g "Fatura"`.++## Maintenance++- The patch is applied automatically by `pnpm install` (including+ `--frozen-lockfile` in CI). It is pnpm-specific — npm/yarn would ignore it.+- **Upgrading fontkit silently drops the fix.** The version is part of the patch+ name, so a bump means the patch no longer applies and the bug returns. Re-make+ it with `pnpm patch fontkit@<new-version>`.+- `pnpm patch-commit` has been observed reverting `package.json`. Check your+ dependency versions after running it.+- If you hand-delete anything under `node_modules/.pnpm`, pnpm can recreate the+ `[email protected]_patch_hash=…` directory **without** the patch content. The+ directory name is not proof. Check the copy that is actually _resolved_, not a+ glob — re-patching also leaves+ stale `patch_hash` directories behind, so a glob can match copies nothing uses:++ ```bash+ node -e "const{createRequire:c}=require('module');const r=c(process.cwd()+'/package.json');const f=c(r.resolve('@react-pdf/renderer/package.json')).resolve('@react-pdf/font/package.json');const k=c(f).resolve('fontkit');console.log(k,require('fs').readFileSync(k,'utf8').includes('this._glyphs[glyph] = null'))"+ ```++ `true` means patched; `false` means run `pnpm install --force`. The regression+ test asserts exactly this.++- Once [foliojs/fontkit#154](https://github.com/foliojs/fontkit/issues/154) ships+ a fix, drop this patch, the `patchedDependencies` entry in+ `pnpm-workspace.yaml`, and the regression test.++The underlying defect is fontkit's composite-glyph decomposition calling+`getGlyph(id)` without codePoints.diff --git a/patches/[email protected] b/patches/[email protected]new file mode 100644index 0000000..3fce465--- /dev/null+++ b/patches/[email protected]@@ -0,0 +1,48 @@+diff --git a/dist/browser-module.mjs b/dist/browser-module.mjs+index 4d0a389de8a3db767f1fef99ed186790431aa844..1dec1342d6a370d8497bbdf1237575064771cebe 100644+--- a/dist/browser-module.mjs++++ b/dist/browser-module.mjs+@@ -12668,6 +12668,7 @@ class $4c1709dee528ea76$export$2e2bcd8739ae039 {+ * @param {number[]} characters+ * @return {Glyph}+ */ getGlyph(glyph, characters = []) {++ if (characters.length > 0 && this._glyphs[glyph] && this._glyphs[glyph].codePoints.length === 0) { this._glyphs[glyph] = null; }+ if (!this._glyphs[glyph]) {+ if (this.directory.tables.sbix) this._glyphs[glyph] = new (0, $25d8f049c222084c$export$2e2bcd8739ae039)(glyph, characters, this);+ else if (this.directory.tables.COLR && this.directory.tables.CPAL) this._glyphs[glyph] = new (0, $0d411f0165859681$export$2e2bcd8739ae039)(glyph, characters, this);+diff --git a/dist/browser.cjs b/dist/browser.cjs+index a5fa901b5608575f84390e3ef0474a7789e8269a..8bb429dd566808b596da6ba730952755bf4152e7 100644+--- a/dist/browser.cjs++++ b/dist/browser.cjs+@@ -12685,6 +12685,7 @@ class $0a8ef2660a6ce4b6$export$2e2bcd8739ae039 {+ * @param {number[]} characters+ * @return {Glyph}+ */ getGlyph(glyph, characters = []) {++ if (characters.length > 0 && this._glyphs[glyph] && this._glyphs[glyph].codePoints.length === 0) { this._glyphs[glyph] = null; }+ if (!this._glyphs[glyph]) {+ if (this.directory.tables.sbix) this._glyphs[glyph] = new (0, $55855d6d316b015e$export$2e2bcd8739ae039)(glyph, characters, this);+ else if (this.directory.tables.COLR && this.directory.tables.CPAL) this._glyphs[glyph] = new (0, $42d9dbd2de9ee2d8$export$2e2bcd8739ae039)(glyph, characters, this);+diff --git a/dist/main.cjs b/dist/main.cjs+index 851b2d2bbcae17e91f9f2468f61112ee2dc8fbd8..5adcdafc15ea82aad9ebe451c27e125fbf652f37 100644+--- a/dist/main.cjs++++ b/dist/main.cjs+@@ -12706,6 +12706,7 @@ class $0a8ef2660a6ce4b6$export$2e2bcd8739ae039 {+ * @param {number[]} characters+ * @return {Glyph}+ */ getGlyph(glyph, characters = []) {++ if (characters.length > 0 && this._glyphs[glyph] && this._glyphs[glyph].codePoints.length === 0) { this._glyphs[glyph] = null; }+ if (!this._glyphs[glyph]) {+ if (this.directory.tables.sbix) this._glyphs[glyph] = new (0, $55855d6d316b015e$export$2e2bcd8739ae039)(glyph, characters, this);+ else if (this.directory.tables.COLR && this.directory.tables.CPAL) this._glyphs[glyph] = new (0, $42d9dbd2de9ee2d8$export$2e2bcd8739ae039)(glyph, characters, this);+diff --git a/dist/module.mjs b/dist/module.mjs+index fde88fc3f23e6fff533da842186fee8402cbcde1..d429a765280923848a38c24e59caa59a3e94d9af 100644+--- a/dist/module.mjs++++ b/dist/module.mjs+@@ -12689,6 +12689,7 @@ class $4c1709dee528ea76$export$2e2bcd8739ae039 {+ * @param {number[]} characters+ * @return {Glyph}+ */ getGlyph(glyph, characters = []) {++ if (characters.length > 0 && this._glyphs[glyph] && this._glyphs[glyph].codePoints.length === 0) { this._glyphs[glyph] = null; }+ if (!this._glyphs[glyph]) {+ if (this.directory.tables.sbix) this._glyphs[glyph] = new (0, $25d8f049c222084c$export$2e2bcd8739ae039)(glyph, characters, this);+ else if (this.directory.tables.COLR && this.directory.tables.CPAL) this._glyphs[glyph] = new (0, $0d411f0165859681$export$2e2bcd8739ae039)(glyph, characters, this);diff --git a/playwright.config.ts b/playwright.config.tsindex c6d236c..b0a5a61 100644--- a/playwright.config.ts+++ b/playwright.config.ts@@ -1,7 +1,13 @@-import { defineConfig, devices } from "@playwright/test";+import path from "node:path";+import {+ defineConfig,+ devices,+ type PlaywrightTestOptions,+} from "@playwright/test";import dotenv from "dotenv";-import path from "node:path";++import { SENTRY_E2E_DISABLED_STORAGE_KEY } from "./src/lib/sentry/sentry-e2e-flags";/*** Read environment variables from file.@@ -18,6 +24,33 @@ const BASE_URL = process.env.BASE_URL ?? `http://localhost:${PORT}`;// @ts-expect-error - NODE_ENV is not defined in the environment variablesconst isLocal = process.env.NODE_ENV === "local";+/**+ * Analytics and error reporting are switched off for every project.+ *+ * The suite runs against a real preview deployment, which has Sentry enabled like+ * production does, so an env var on the CI job cannot tell e2e traffic apart from a+ * human browsing the same URL — the browser has to say so itself. `sentry.disabled` is+ * read by `src/instrumentation-client.ts` before the SDK starts up.+ */+const STORAGE_STATE = {+ cookies: [],+ origins: [+ {+ origin: BASE_URL,+ localStorage: [+ {+ name: "umami.disabled",+ value: "1",+ },+ {+ name: SENTRY_E2E_DISABLED_STORAGE_KEY,+ value: "1",+ },+ ],+ },+ ],+} as const satisfies PlaywrightTestOptions["storageState"];+/*** See https://playwright.dev/docs/test-configuration.*/@@ -76,27 +109,34 @@ export default defineConfig({launchOptions: {args: ["--disable-font-subpixel-positioning", "--disable-lcd-text"],},- // Set localStorage to disable umami analytics- storageState: {- cookies: [],- origins: [- {- origin: BASE_URL,- localStorage: [- {- name: "umami.disabled",- value: "1",- },- ],- },- ],- },+ storageState: STORAGE_STATE,+ },+ },+ /**+ * Gecko smoke coverage.+ *+ * `Mobile Safari` already covers WebKit, so Firefox is the only engine we+ * would otherwise never run. It is scoped with `grep` to the handful of+ * tests tagged `@firefox-smoke` (the riskiest engine-sensitive paths:+ * client side PDF generation + download, localStorage persistence and the+ * shared invoice URL round trip) instead of the full suite.+ *+ * NOTE: no `channel` and no `launchOptions.args` here - those are Chromium+ * only. Clipboard permissions are omitted too, Firefox rejects+ * `clipboard-read`/`clipboard-write`.+ *+ * Visual snapshots are never compared on this project, see+ * DEFAULT_SNAPSHOT_PROJECT in `e2e/utils/pdf-download.ts`, so it needs no+ * screenshot baselines of its own.+ */+ {+ name: "Desktop Firefox",+ grep: /@firefox-smoke/,+ use: {+ ...devices["Desktop Firefox"],+ storageState: STORAGE_STATE,},},- // {- // name: "webkit",- // use: { ...devices["Desktop Safari"] },- // },// /* Test against mobile viewports. */{@@ -109,21 +149,7 @@ export default defineConfig({launchOptions: {args: ["--disable-font-subpixel-positioning", "--disable-lcd-text"],},- // Set localStorage to disable umami analytics- storageState: {- cookies: [],- origins: [- {- origin: BASE_URL,- localStorage: [- {- name: "umami.disabled",- value: "1",- },- ],- },- ],- },+ storageState: STORAGE_STATE,},},{@@ -135,21 +161,7 @@ export default defineConfig({launchOptions: {args: ["--disable-font-subpixel-positioning", "--disable-lcd-text"],},- // Set localStorage to disable umami analytics- storageState: {- cookies: [],- origins: [- {- origin: BASE_URL,- localStorage: [- {- name: "umami.disabled",- value: "1",- },- ],- },- ],- },+ storageState: STORAGE_STATE,},},diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 7d68764..c980ec9 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -4,70 +4,90 @@ settings:autoInstallPeers: trueexcludeLinksFromLockfile: false+overrides:+ '@react-pdf/fns': 3.1.3+ '@react-pdf/font': 4.0.10+ '@react-pdf/image': 3.1.1+ '@react-pdf/layout': 4.7.1+ '@react-pdf/pdfkit': 6.0.1+ '@react-pdf/primitives': 4.3.0+ '@react-pdf/reconciler': 2.0.0+ '@react-pdf/render': 4.6.1+ '@react-pdf/renderer': 4.6.1+ '@react-pdf/stylesheet': 6.2.3+ '@react-pdf/svg': 1.1.0+ '@react-pdf/textkit': 6.4.1+ '@react-pdf/types': 2.11.3++patchedDependencies:+ hash: 4578e940c13ce12f50c2ef0959a1b481d0a98f719932548b9b6bcbfd3832f9bd+ path: patches/[email protected]+importers:.:dependencies:'@hookform/resolvers':- specifier: 3.9.0- version: 3.9.0([email protected]([email protected]))+ specifier: 5.9.1+ version: 5.9.1([email protected]([email protected]))([email protected])([email protected])([email protected]([email protected]))([email protected])'@mdx-js/loader':specifier: 3.1.0- version: 3.1.0([email protected])([email protected])+ version: 3.1.0([email protected])([email protected])'@mdx-js/react':specifier: 3.1.0- version: 3.1.0(@types/[email protected])([email protected])+ version: 3.1.0(@types/[email protected])([email protected])'@next/mdx':- specifier: 15.3.3- version: 15.3.3(@mdx-js/[email protected]([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))+ specifier: 15.5.23+ version: 15.5.23(@mdx-js/[email protected]([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))'@radix-ui/react-accordion':specifier: 1.2.3- version: 1.2.3(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ version: 1.2.3(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-alert-dialog':specifier: 1.1.6- version: 1.1.6(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ version: 1.1.6(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-dialog':specifier: 1.1.6- version: 1.1.6(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ version: 1.1.6(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-dropdown-menu':specifier: 2.1.6- version: 2.1.6(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ version: 2.1.6(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-label':specifier: 2.1.2- version: 2.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ version: 2.1.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-popover':specifier: 1.1.6- version: 1.1.6(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ version: 1.1.6(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-separator':specifier: 1.1.2- version: 1.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ version: 1.1.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-slot':specifier: 1.1.2- version: 1.1.2(@types/[email protected])([email protected])+ version: 1.1.2(@types/[email protected])([email protected])'@radix-ui/react-switch':specifier: 1.1.3- version: 1.1.3(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ version: 1.1.3(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-tabs':specifier: 1.1.3- version: 1.1.3(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ version: 1.1.3(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-tooltip':specifier: 1.1.8- version: 1.1.8(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ version: 1.1.8(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@react-pdf/renderer':- specifier: 4.3.0- version: 4.3.0([email protected])+ specifier: 4.6.1+ version: 4.6.1([email protected])'@sentry/nextjs':- specifier: 9.3.0- version: 9.3.0(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected])+ specifier: 10.70.0+ version: 10.70.0(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected])'@t3-oss/env-nextjs':specifier: 0.13.4'@tailwindcss/typography':specifier: 0.5.16version: 0.5.16([email protected])'@trigger.dev/sdk':specifier: 4.5.6- version: 4.5.6([email protected])([email protected])+ version: 4.5.6([email protected])([email protected])'@types/mdx':specifier: 2.0.13version: 2.0.13@@ -88,7 +108,7 @@ importers:version: 3.5.1'@vercel/speed-insights':specifier: 1.2.0- version: 1.2.0([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])+ version: 1.2.0([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])class-variance-authority:specifier: 0.7.1version: 0.7.1@@ -97,7 +117,7 @@ importers:version: 2.1.1cmdk:specifier: 1.0.0- version: 1.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ version: 1.0.0(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])dayjs:specifier: 1.11.13version: 1.11.13@@ -106,16 +126,16 @@ importers:version: 8.6.0([email protected])embla-carousel-react:specifier: 8.6.0- version: 8.6.0([email protected])- eslint-plugin-react-hooks:- specifier: 5.2.0- version: 5.2.0([email protected]([email protected]))+ version: 8.6.0([email protected])file-saver:specifier: 2.0.5version: 2.0.5googleapis:specifier: 148.0.0version: 148.0.0+ import-in-the-middle:+ specifier: 3.3.3+ version: 3.3.3jiti:specifier: 2.4.2version: 2.4.2@@ -124,49 +144,55 @@ importers:version: 3.10.1lucide-react:specifier: 0.477.0- version: 0.477.0([email protected])+ version: 0.477.0([email protected])lz-string:specifier: 1.5.0version: 1.5.0motion:specifier: 12.38.0n2words:specifier: 1.21.0version: 1.21.0next:- specifier: 14.2.15- version: 14.2.15(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected])+ specifier: 15.5.24+ version: 15.5.24(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected])next-intl:- specifier: 4.0.2- version: 4.0.2([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected])+ specifier: 4.13.7+ version: 4.13.7([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected])+ pdfjs-dist:+ specifier: 5.4.296+ version: 5.4.296qrcode:specifier: 1.5.4version: 1.5.4react:- specifier: 18.3.1- version: 18.3.1+ specifier: 19.2.8+ version: 19.2.8react-dom:- specifier: 18.3.1- version: 18.3.1([email protected])+ specifier: 19.2.8+ version: 19.2.8([email protected])react-hook-form:- specifier: 7.53.1- version: 7.53.1([email protected])+ specifier: 7.86.0+ version: 7.86.0([email protected])react-intersection-observer:specifier: 9.16.0react-pdf:- specifier: 9.2.1+ specifier: 10.4.1+ version: 10.4.1(@types/[email protected])([email protected]([email protected]))([email protected])remark-gfm:specifier: 4.0.1version: 4.0.1+ require-in-the-middle:+ specifier: 8.0.1+ version: 8.0.1resend:specifier: 4.2.0sonner:specifier: 1.7.4tailwind-merge:specifier: 2.6.0version: 2.6.0@@ -178,17 +204,11 @@ importers:version: 2.0.3use-debounce:specifier: 10.0.4- version: 10.0.4([email protected])+ version: 10.0.4([email protected])zod:- specifier: 3.24.4- version: 3.24.4+ specifier: 4.5.4+ version: 4.5.4devDependencies:- '@eslint/eslintrc':- specifier: 3.3.1- version: 3.3.1- '@next/eslint-plugin-next':- specifier: 15.2.3- version: 15.2.3'@playwright/test':specifier: 1.60.0version: 1.60.0@@ -197,7 +217,7 @@ importers:version: 6.9.1'@testing-library/react':specifier: 16.3.2- version: 16.3.2(@testing-library/[email protected])(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ version: 16.3.2(@testing-library/[email protected])(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@testing-library/user-event':specifier: 14.6.1version: 14.6.1(@testing-library/[email protected])@@ -208,14 +228,11 @@ importers:specifier: 22.8.1version: 22.8.1'@types/react':- specifier: 18.3.12- version: 18.3.12+ specifier: 19.2.18+ version: 19.2.18'@types/react-dom':- specifier: 18.3.1- version: 18.3.1- '@typescript/native-preview':- specifier: 7.0.0-dev.20260217.1- version: 7.0.0-dev.20260217.1+ specifier: 19.2.4+ version: 19.2.4(@types/[email protected])actions-up:specifier: 1.14.2version: 1.14.2@@ -225,18 +242,15 @@ importers:dotenv:specifier: 17.2.3version: 17.2.3- eslint:- specifier: 9.33.0- version: 9.33.0([email protected])- eslint-config-next:- specifier: 15.2.3eslint-plugin-playwright:- specifier: 2.2.0- version: 2.2.0([email protected]([email protected]))+ specifier: 2.11.0+ version: 2.11.0([email protected]([email protected]))+ eslint-plugin-react:+ specifier: 7.37.5+ version: 7.37.5([email protected]([email protected]))eslint-plugin-react-you-might-not-need-an-effect:- specifier: 0.0.39- version: 0.0.39([email protected]([email protected]))+ specifier: 1.0.2+ version: 1.0.2([email protected]([email protected]))happy-dom:specifier: 20.10.6version: 20.10.6@@ -245,40 +259,40 @@ importers:version: 9.1.7knip:specifier: 5.85.0- version: 5.85.0(@types/[email protected])([email protected])+ version: 5.85.0(@types/[email protected])([email protected])lint-staged:specifier: 15.5.0version: 15.5.0+ oxfmt:+ specifier: 0.64.0+ version: 0.64.0+ oxlint:+ specifier: 1.79.0+ version: 1.79.0([email protected])+ oxlint-tsgolint:+ specifier: 7.0.2001+ version: 7.0.2001postcss:specifier: 8.5.3version: 8.5.3- prettier:- specifier: 3.5.3- version: 3.5.3- prettier-plugin-tailwindcss:- specifier: 0.6.11- version: 0.6.11([email protected])react-email:specifier: 4.0.4- version: 4.0.4(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected])+ version: 4.0.4(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected])schema-dts:specifier: 1.1.5version: 1.1.5shadcn:specifier: 3.2.1- version: 3.2.1(@types/[email protected])([email protected])+ version: 3.2.1(@types/[email protected])([email protected])tailwindcss:specifier: 3.4.14version: 3.4.14typescript:- specifier: 5.9.3- version: 5.9.3- typescript-eslint:- specifier: 8.56.0+ specifier: 6.0.3+ version: 6.0.3vitest:specifier: 3.2.4- version: 3.2.4(@types/[email protected])(@types/[email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected]))([email protected])([email protected])([email protected])+ version: 3.2.4(@types/[email protected])(@types/[email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected]))([email protected])([email protected])([email protected])packages:@@ -297,6 +311,17 @@ packages:resolution: {integrity: sha512-9q/yCljni37pkMr4sPrI3G4jqdIk074+iukc5aFJl7kmDCCsiJrbZ6zKxnES1Gwg+i9RcDZwvktl23puGslmvA==}hasBin: true+ '@apm-js-collab/[email protected]':+ resolution: {integrity: sha512-nAfOeZPSUAQvJa1iFT/5oCrTm5YQhMMrfCNthNnaXHZiOQhu1KGuLoIx7HtbAi3wfwaBYLaICPIeenIaEwcXIg==}+ engines: {node: '>=18.0.0'}++ '@apm-js-collab/[email protected]':+ resolution: {integrity: sha512-u1Hb6bHjWtkSpiprwVP6YaHC1DTN4RAU3zYkUDUe7WMnJwdyU1pwTL9dFKiSJB9IiLue/EQovmyx6xhU7FFtAQ==}+ hasBin: true++ '@apm-js-collab/[email protected]':+ resolution: {integrity: sha512-mTvWz9rnQwx1U3h0XPTHaX7bgfkpipLLTQyjlC2cdhQpQEuoLT0AGzoydeoq2NxfEVv6fWOOETcSbb2nptleyw==}+'@ark/[email protected]':resolution: {integrity: sha512-c2UQdKgP2eqqDArfBqQIJppxJHvNNXuQPeuSPlDML4rjw+f1cu0qAlzOG4b8ujgm9ctIDWwhpyw6gjG5ledIVQ==}@@ -311,18 +336,10 @@ packages:resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==}engines: {node: '>=6.9.0'}- '@babel/[email protected]':- resolution: {integrity: sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ==}- engines: {node: '>=6.9.0'}-'@babel/[email protected]':resolution: {integrity: sha512-60X7qkglvrap8mn1lh2ebxXdZYtUcpd7gsmy9kLaBJ4i/WdY8PqTSdxyA8qraikqKQK5C1KRBKXqznrVapyNaw==}engines: {node: '>=6.9.0'}- '@babel/[email protected]':- resolution: {integrity: sha512-lWBYIrF7qK5+GjY5Uy+/hEgp8OJWOD/rpy74GplYRhEauvbHDeFB8t5hPOZxCZ0Oxf4Cc36tK51/l3ymJysrKw==}- engines: {node: '>=6.9.0'}-'@babel/[email protected]':resolution: {integrity: sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ==}engines: {node: '>=6.9.0'}@@ -339,10 +356,6 @@ packages:resolution: {integrity: sha512-fXSwMQqitTGeHLBC08Eq5yXz2m37E4pJX1qAU1+2cNedz/ifv/bVXft90VeSav5nFO61EcNgwr0aJxbyPaWBPg==}engines: {node: '>=6.9.0'}- '@babel/[email protected]':- resolution: {integrity: sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA==}- engines: {node: '>=6.9.0'}-'@babel/[email protected]':resolution: {integrity: sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==}engines: {node: '>=6.9.0'}@@ -361,20 +374,10 @@ packages:resolution: {integrity: sha512-E5chM8eWjTp/aNoVpcbfM7mLxu9XGLWYise2eBKGQomAk/Mb4XoxyqXTZbuTohbsl8EKqdlMhnDI2CCLfcs9wA==}engines: {node: '>=6.9.0'}- '@babel/[email protected]':- resolution: {integrity: sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==}- engines: {node: '>=6.9.0'}-'@babel/[email protected]':resolution: {integrity: sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==}engines: {node: '>=6.9.0'}- '@babel/[email protected]':- resolution: {integrity: sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==}- engines: {node: '>=6.9.0'}- peerDependencies:- '@babel/core': ^7.0.0-'@babel/[email protected]':resolution: {integrity: sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==}engines: {node: '>=6.9.0'}@@ -415,18 +418,10 @@ packages:resolution: {integrity: sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==}engines: {node: '>=6.9.0'}- '@babel/[email protected]':- resolution: {integrity: sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==}- engines: {node: '>=6.9.0'}-'@babel/[email protected]':resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==}engines: {node: '>=6.9.0'}- '@babel/[email protected]':- resolution: {integrity: sha512-Mz/4+y8udxBKdmzt/UjPACs4G3j5SshJJEFFKxlCGPydG4JAHXxjWjAwjd09tf6oINvl1VfMJo+nB7H2YKQ0dA==}- engines: {node: '>=6.9.0'}-'@babel/[email protected]':resolution: {integrity: sha512-PTNtvUQihsAsDHMOP5pfobP8C6CM4JWXmP8DrEIt46c3r2bf87Ua1zoqevsMo9g+tWDwgWrFP5EIxuBx5RudAw==}engines: {node: '>=6.9.0'}@@ -474,10 +469,6 @@ packages:resolution: {integrity: sha512-9Vrcx5ZW6UwK5tvqsj0nGpp/XzqthkT0dqIc9g1AdtygFToNtTF67XzYS//dm+SAK9cp3B9R4ZO/46p63SCjlQ==}engines: {node: '>=6.9.0'}- '@babel/[email protected]':- resolution: {integrity: sha512-ZYW7L+pL8ahU5fXmNbPF+iZFHCv5scFak7MZ9bwaRPLUhHh7QQEMjZUg0HevihoqCM5iSYHN61EyCoZvqC+bxg==}- engines: {node: '>=6.9.0'}-'@babel/[email protected]':resolution: {integrity: sha512-7w4kZYHneL3A6NP2nxzHvT3HCZ7puDZZjFMqDpBPECub79sTtSO5CGXDkKrTQq8ksAwfD/XI2MRFX23njdDaIQ==}engines: {node: '>=6.9.0'}@@ -512,9 +503,6 @@ packages:'@electric-sql/[email protected]':resolution: {integrity: sha512-LtPAfeMxXRiYS0hyDQ5hue2PjljUiK9stvzsVyVb4nwxWQxfOWTSF42bHTs/o5i3x1T4kAQ7mwHpxa4A+f8X7Q==}- '@emnapi/[email protected]':- resolution: {integrity: sha512-XsLw1dEOpkSX/WucdqUhPWP7hDxSvZiY+fsUC14h+FtQ2Ifni4znbBt8punRX+Uj2JG/uDb8nEHVKvrVlvdZ5Q==}-'@emnapi/[email protected]':resolution: {integrity: sha512-AvT9QFpxK0Zd8J0jopedNm+w/2fIzvtPKPjqyw9jwvBaReTTqPBk9Hixaz7KbjimP+QNz605/XnjFcDAL2pqBg==}@@ -524,9 +512,6 @@ packages:'@emnapi/[email protected]':resolution: {integrity: sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==}- '@emnapi/[email protected]':- resolution: {integrity: sha512-PJR+bOmMOPH8AtcTGAyYNiuJ3/Fcoj2XN/gBEWzDIKh254XO+mM9XoXHk5GNEhodxeMznbg7BlRojVbKN+gC6g==}-'@emnapi/[email protected]':resolution: {integrity: sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==}@@ -680,53 +665,35 @@ packages:cpu: [x64]os: [win32]- '@eslint-community/[email protected]':- resolution: {integrity: sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==}- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}- peerDependencies:- eslint: ^6.0.0 || ^7.0.0 || >=8.0.0-'@eslint-community/[email protected]':resolution: {integrity: sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==}engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}peerDependencies:eslint: ^6.0.0 || ^7.0.0 || >=8.0.0- '@eslint-community/[email protected]':- resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==}- engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}-'@eslint-community/[email protected]':resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==}engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}- '@eslint/[email protected]':- resolution: {integrity: sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}-- '@eslint/[email protected]':- resolution: {integrity: sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}-- '@eslint/[email protected]':- resolution: {integrity: sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}+ '@eslint/[email protected]':+ resolution: {integrity: sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==}+ engines: {node: ^20.19.0 || ^22.13.0 || >=24}- '@eslint/[email protected]':- resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}+ '@eslint/[email protected]':+ resolution: {integrity: sha512-DObd/KKUsU+FaFv4PLxSRenpXfQWmPXXP3pPZ6/K1PCrMu2vQpMDMuQe/BqYeoLcz8ro0bVDF1RxOJgfVEdhUw==}+ engines: {node: ^20.19.0 || ^22.13.0 || >=24}- '@eslint/[email protected]':- resolution: {integrity: sha512-5K1/mKhWaMfreBGJTwval43JJmkip0RmM+3+IuqupeSKNC/Th2Kc7ucaq5ovTSra/OOKB9c58CGSz3QMVbWt0A==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}+ '@eslint/[email protected]':+ resolution: {integrity: sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==}+ engines: {node: ^20.19.0 || ^22.13.0 || >=24}- '@eslint/[email protected]':- resolution: {integrity: sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}+ '@eslint/[email protected]':+ resolution: {integrity: sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==}+ engines: {node: ^20.19.0 || ^22.13.0 || >=24}- '@eslint/[email protected]':- resolution: {integrity: sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}+ '@eslint/[email protected]':+ resolution: {integrity: sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==}+ engines: {node: ^20.19.0 || ^22.13.0 || >=24}'@floating-ui/[email protected]':resolution: {integrity: sha512-uMXCuQ3BItDUbAMhIXw7UPXRfAlOAvZzdK9BWpE60MCn+Svt3aLn9jsPTi/WNGlRUu2uI0v5S7JiIUsbsvh3fw==}@@ -743,32 +710,99 @@ packages:'@floating-ui/[email protected]':resolution: {integrity: sha512-MDWhGtE+eHw5JW7lq4qhc5yRLS11ERl1c7Z6Xd0a58DozHES6EnNNwUWbMiG4J9Cgj053Bhk8zvlhFYKVhULwg==}- '@formatjs/[email protected]':- resolution: {integrity: sha512-qrycXDeaORzIqNhBOx0btnhpD1c+/qFIHAN9znofuMJX6QBwtbrmlpWfD4oiUUD2vJUOIYFA/gYtg2KAMGG7sA==}+ '@formatjs/[email protected]':+ resolution: {integrity: sha512-zXfhLpvA6T7+efdt9JLbBwZ00tT7NsBMDVnDu8rpHeNNv8KfRZAMo2gkG0k9lK/Nzc//3kJ9pImsfuJxk3KhUA==}- '@formatjs/[email protected]':- resolution: {integrity: sha512-Yabmi9nSvyOMrlSeGGWDiH7rf3a7sIwplbvo/dlz9WCIjzIQAfy1RMf4S0X3yG724n5Ghu2GmEl5NJIV6O9sZQ==}+ '@formatjs/[email protected]':+ resolution: {integrity: sha512-cN9jhVqT7u0K9tix43fhjoUwL0nazyW6zsNIXs2QdPADr+nurPfYyssUiMqcSCGlPcCiqnYVxgSn7zBSuI+5Bg==}- '@formatjs/[email protected]':- resolution: {integrity: sha512-AfiMi5NOSo2TQImsYAg8UYddsNJ/vUEv/HaNqiFjnI3ZFfWihUtD5QtuX6kHl8+H+d3qvnE/3HZrfzgdWpsLNA==}+ '@formatjs/[email protected]':+ resolution: {integrity: sha512-j8cUmOJzVgkHuS0QiQ6ga76UIoLOFSAMWhs7aZJztH3aAdCOAE6vpC8KVvFB4cU10ON0y2/5oOVmPJ43s2lTwA==}- '@formatjs/[email protected]':- resolution: {integrity: sha512-i4q4V4qslThK4Ig8SxyD76cp3+QJ3sAqr7f6q9VVfeGtxG9OhiAk3y9XF6Q41OymsKzsGQ6OQQoJNY4/lI8TcQ==}-- '@formatjs/[email protected]':- resolution: {integrity: sha512-af3qATX+m4Rnd9+wHcjJ4w2ijq+rAVP3CCinJQvFv1kgSu1W6jypUmvleJxcewdxmutM8dmIRZFxO/IQBZmP2Q==}-- '@formatjs/[email protected]':- resolution: {integrity: sha512-ePEgLgVCqi2BBFnTMWPfIghu6FkbZnnBVhO2sSxvLfrdFw7wCHAHiDoM2h4NRgjbaY7+B7HgOLZGkK187pZTZg==}+ '@formatjs/[email protected]':+ resolution: {integrity: sha512-kHEAFOkeJSPNi7c5PaKaRjxcBrJwzzt81ifUu+8uve1EDW/VJl83KsxmqgqNZLzcFEhSliZGvx3+pk/RH0IOmg==}'@google-cloud/[email protected]':resolution: {integrity: sha512-1TUx3KdaU3cN7nfCdNf+UVqA/PSX29Cjcox3fZZBtINlRrXVTmUkQnCKv2MbBUbCopbK4olAT1IHl76uZyCiVA==}engines: {node: '>=14.0.0'}- '@hookform/[email protected]':- resolution: {integrity: sha512-bU0Gr4EepJ/EQsH/IwEzYLsT/PEj5C0ynLQ4m+GSHS+xKH4TfSelhluTgOaoc4kA5s7eCsQbM4wvZLzELmWzUg==}- peerDependencies:- react-hook-form: ^7.0.0+ '@hookform/[email protected]':+ resolution: {integrity: sha512-7b7vsbraJxKgjVSA1Nur9tLwj539WGJUBLA7QNvXnFoT2pM5Z7G+6rlukk4B2/QrTZy6huRtH6wKeESPKuIr6w==}+ peerDependencies:+ '@sinclair/typebox': '>=0.25.24'+ '@standard-schema/spec': ^1.0.0+ '@typeschema/main': '>=0.13.7'+ '@vinejs/vine': ^2.0.0 || ^3.0.0 || ^4.0.0+ ajv: ^8.12.0+ ajv-errors: ^3.0.0+ ajv-formats: ^2.1.1+ arktype: ^2.0.0+ ata-validator: ^1.2.0+ class-transformer: '>=0.4.0'+ class-validator: '>=0.12.0'+ computed-types: ^1.0.0+ effect: ^3.10.3+ fluentvalidation-ts: ^3.0.0+ fp-ts: ^2.7.0+ io-ts: ^2.0.0+ joi: ^17.0.0 || ^18.0.0+ nope-validator: '>=0.12.0'+ react-hook-form: ^7.55.0+ superstruct: '>=0.12.0'+ typanion: ^3.3.2+ valibot: '>=0.31.0 || ^1.0.0-beta.4 || ^1.0.0-rc'+ vest: '>=6.0.0'+ yup: ^1.0.0+ zod: ^3.25.0 || ^4.0.0+ peerDependenciesMeta:+ '@sinclair/typebox':+ optional: true+ '@standard-schema/spec':+ optional: true+ '@typeschema/main':+ optional: true+ '@vinejs/vine':+ optional: true+ ajv:+ optional: true+ ajv-errors:+ optional: true+ ajv-formats:+ optional: true+ arktype:+ optional: true+ ata-validator:+ optional: true+ class-transformer:+ optional: true+ class-validator:+ optional: true+ computed-types:+ optional: true+ effect:+ optional: true+ fluentvalidation-ts:+ optional: true+ fp-ts:+ optional: true+ io-ts:+ optional: true+ joi:+ optional: true+ nope-validator:+ optional: true+ superstruct:+ optional: true+ typanion:+ optional: true+ valibot:+ optional: true+ vest:+ optional: true+ yup:+ optional: true+ zod:+ optional: true'@humanfs/[email protected]':resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==}@@ -790,64 +824,138 @@ packages:resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==}engines: {node: '>=18.18'}+ '@img/[email protected]':+ resolution: {integrity: sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==}+ engines: {node: '>=18'}+'@img/[email protected]':resolution: {integrity: sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==}engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}cpu: [arm64]os: [darwin]+ '@img/[email protected]':+ resolution: {integrity: sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==}+ engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ cpu: [arm64]+ os: [darwin]+'@img/[email protected]':resolution: {integrity: sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==}engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}cpu: [x64]os: [darwin]+ '@img/[email protected]':+ resolution: {integrity: sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==}+ engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ cpu: [x64]+ os: [darwin]+'@img/[email protected]':resolution: {integrity: sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==}cpu: [arm64]os: [darwin]+ '@img/[email protected]':+ resolution: {integrity: sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==}+ cpu: [arm64]+ os: [darwin]+'@img/[email protected]':resolution: {integrity: sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==}cpu: [x64]os: [darwin]+ '@img/[email protected]':+ resolution: {integrity: sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==}+ cpu: [x64]+ os: [darwin]+'@img/[email protected]':resolution: {integrity: sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==}cpu: [arm64]os: [linux]libc: [glibc]+ '@img/[email protected]':+ resolution: {integrity: sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==}+ cpu: [arm64]+ os: [linux]+ libc: [glibc]+'@img/[email protected]':resolution: {integrity: sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==}cpu: [arm]os: [linux]libc: [glibc]+ '@img/[email protected]':+ resolution: {integrity: sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==}+ cpu: [arm]+ os: [linux]+ libc: [glibc]++ '@img/[email protected]':+ resolution: {integrity: sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==}+ cpu: [ppc64]+ os: [linux]+ libc: [glibc]++ '@img/[email protected]':+ resolution: {integrity: sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==}+ cpu: [riscv64]+ os: [linux]+ libc: [glibc]+'@img/[email protected]':resolution: {integrity: sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==}cpu: [s390x]os: [linux]libc: [glibc]+ '@img/[email protected]':+ resolution: {integrity: sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==}+ cpu: [s390x]+ os: [linux]+ libc: [glibc]+'@img/[email protected]':resolution: {integrity: sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==}cpu: [x64]os: [linux]libc: [glibc]+ '@img/[email protected]':+ resolution: {integrity: sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==}+ cpu: [x64]+ os: [linux]+ libc: [glibc]+'@img/[email protected]':resolution: {integrity: sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==}cpu: [arm64]os: [linux]libc: [musl]+ '@img/[email protected]':+ resolution: {integrity: sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==}+ cpu: [arm64]+ os: [linux]+ libc: [musl]+'@img/[email protected]':resolution: {integrity: sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==}cpu: [x64]os: [linux]libc: [musl]+ '@img/[email protected]':+ resolution: {integrity: sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==}+ cpu: [x64]+ os: [linux]+ libc: [musl]+'@img/[email protected]':resolution: {integrity: sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==}engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}@@ -855,6 +963,13 @@ packages:os: [linux]libc: [glibc]+ '@img/[email protected]':+ resolution: {integrity: sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==}+ engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ cpu: [arm64]+ os: [linux]+ libc: [glibc]+'@img/[email protected]':resolution: {integrity: sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==}engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}@@ -862,6 +977,27 @@ packages:os: [linux]libc: [glibc]+ '@img/[email protected]':+ resolution: {integrity: sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==}+ engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ cpu: [arm]+ os: [linux]+ libc: [glibc]++ '@img/[email protected]':+ resolution: {integrity: sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==}+ engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ cpu: [ppc64]+ os: [linux]+ libc: [glibc]++ '@img/[email protected]':+ resolution: {integrity: sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==}+ engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ cpu: [riscv64]+ os: [linux]+ libc: [glibc]+'@img/[email protected]':resolution: {integrity: sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==}engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}@@ -869,6 +1005,13 @@ packages:os: [linux]libc: [glibc]+ '@img/[email protected]':+ resolution: {integrity: sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==}+ engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ cpu: [s390x]+ os: [linux]+ libc: [glibc]+'@img/[email protected]':resolution: {integrity: sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==}engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}@@ -876,6 +1019,13 @@ packages:os: [linux]libc: [glibc]+ '@img/[email protected]':+ resolution: {integrity: sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==}+ engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ cpu: [x64]+ os: [linux]+ libc: [glibc]+'@img/[email protected]':resolution: {integrity: sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==}engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}@@ -883,6 +1033,13 @@ packages:os: [linux]libc: [musl]+ '@img/[email protected]':+ resolution: {integrity: sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==}+ engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ cpu: [arm64]+ os: [linux]+ libc: [musl]+'@img/[email protected]':resolution: {integrity: sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==}engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}@@ -890,23 +1047,53 @@ packages:os: [linux]libc: [musl]+ '@img/[email protected]':+ resolution: {integrity: sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==}+ engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ cpu: [x64]+ os: [linux]+ libc: [musl]+'@img/[email protected]':resolution: {integrity: sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==}engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}cpu: [wasm32]+ '@img/[email protected]':+ resolution: {integrity: sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==}+ engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ cpu: [wasm32]++ '@img/[email protected]':+ resolution: {integrity: sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==}+ engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ cpu: [arm64]+ os: [win32]+'@img/[email protected]':resolution: {integrity: sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==}engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}cpu: [ia32]os: [win32]+ '@img/[email protected]':+ resolution: {integrity: sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==}+ engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ cpu: [ia32]+ os: [win32]+'@img/[email protected]':resolution: {integrity: sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==}engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}cpu: [x64]os: [win32]+ '@img/[email protected]':+ resolution: {integrity: sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==}+ engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ cpu: [x64]+ os: [win32]+'@inquirer/[email protected]':resolution: {integrity: sha512-j1a5VstaK5KQy8Mu8cHmuQvN1Zc62TbLhjJxwHvKPPKEoowSF6h/0UdOpA9DNdWZ+9Inq73+puRq1df6OJ8Sag==}engines: {node: '>=18'}@@ -938,14 +1125,6 @@ packages:'@types/node':optional: true- '@isaacs/[email protected]':- resolution: {integrity: sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==}- engines: {node: 20 || >=22}-- '@isaacs/[email protected]':- resolution: {integrity: sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==}- engines: {node: 20 || >=22}-'@isaacs/[email protected]':resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==}engines: {node: '>=12'}@@ -963,6 +1142,9 @@ packages:'@jridgewell/[email protected]':resolution: {integrity: sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==}+ '@jridgewell/[email protected]':+ resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==}+'@jridgewell/[email protected]':resolution: {integrity: sha512-uw6guiW/gcAGPDhLmd77/6lW8QLeiV5RUTsAX46Db6oLhGaVj4lhnPwb184s1bkc8kdVg/+h988dro8GRDpmYQ==}@@ -997,23 +1179,99 @@ packages:resolution: {integrity: sha512-bndDP83naYYkfayr/qhBHMhk0YGwS1iv6vaEGcr0SQbO0IZtbOPqjKjds/WcG+bJA+1T5vCx6kprKOzn5Bg+Vw==}engines: {node: '>=18'}- '@napi-rs/[email protected]':- resolution: {integrity: sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==}+ '@napi-rs/[email protected]':+ resolution: {integrity: sha512-hjhCKhntPv9+t4ckHymdx0phYNcVW+GKQR6Lzw2zE+pOVjOplSmtx9nNNknTjbEDLcuLZqA1y8ufKg1XfgftzQ==}+ engines: {node: '>= 10'}+ cpu: [arm64]+ os: [android]++ '@napi-rs/[email protected]':+ resolution: {integrity: sha512-2PcswRaC7Ly645DGt88///zuFDhJxJYdKAs1uU3mfk1atYkXufgcgLfBpk6Tm12nCQBaNt1wpybuPZ4qOhTo8A==}+ engines: {node: '>= 10'}+ cpu: [arm64]+ os: [darwin]++ '@napi-rs/[email protected]':+ resolution: {integrity: sha512-ePNZtj7pNIva/siZMg+HmbeozkIjqUIYdoymH8HaA3qK7LfzFN4WMBM8G6HQ9ZC+H3+Dnn5pqtiXpgLykaPOhw==}+ engines: {node: '>= 10'}+ cpu: [x64]+ os: [darwin]++ '@napi-rs/[email protected]':+ resolution: {integrity: sha512-d5cDB48oWFGU8/XPhUOFAlySgb/VAu7D+s8fi55K1Pcfg8aPplHWqMgibhVLU8ky7Pyg/fuiVLz4Nf3JrSTuUA==}+ engines: {node: '>= 10'}+ cpu: [arm]+ os: [linux]++ '@napi-rs/[email protected]':+ resolution: {integrity: sha512-rDxgxRu69RvDlX/bh9o22DxLsGr8EqsNgotL9+RwQE1S0b0cqeatqsw6aW45mukm0B42DIAaAacKaYQ8cqS1nw==}+ engines: {node: '>= 10'}+ cpu: [arm64]+ os: [linux]+ libc: [glibc]++ '@napi-rs/[email protected]':+ resolution: {integrity: sha512-K3mDW66N+xT2/V439u1alFANiBUjdEx2gLiNYnCmUsva5jZMxWTjafBYwTzYK+EMFMHrUoabuU+T1BIP5CgbYQ==}+ engines: {node: '>= 10'}+ cpu: [arm64]+ os: [linux]+ libc: [musl]++ '@napi-rs/[email protected]':+ resolution: {integrity: sha512-mooqUBTIsccZpnoQC4NgrC1v6C1vof39etLNMnBwCY+p0gajWJvAHLGQ6g/gGyS5YrpDW+GefSN4+Cvcr08UWw==}+ engines: {node: '>= 10'}+ cpu: [riscv64]+ os: [linux]+ libc: [glibc]++ '@napi-rs/[email protected]':+ resolution: {integrity: sha512-1eCvkDCazm7FFhsT7DfGOdSaHgZVK3bt/dSBl5EWHOWmnz+I7j8tPseJqqD81NF+MH21jKUK4wQSDjN0mdhnTg==}+ engines: {node: '>= 10'}+ cpu: [x64]+ os: [linux]+ libc: [glibc]++ '@napi-rs/[email protected]':+ resolution: {integrity: sha512-20arT6lnI19S68qNlii73TSEDbECNgzMz2EpldC1V3mZFuRkeujXkcebRk0LRJe9SEUAooYiLokfMViY8IX7yA==}+ engines: {node: '>= 10'}+ cpu: [x64]+ os: [linux]+ libc: [musl]++ '@napi-rs/[email protected]':+ resolution: {integrity: sha512-DZFFT1wIAg37LJw37yhMRFfjATd3vTQzjZ1Yki8u2vhO6Hi5VE6BVaGQ1aaDu7xb4iMErz+9EOwjpS7xcxFeBw==}+ engines: {node: '>= 10'}+ cpu: [arm64]+ os: [win32]++ '@napi-rs/[email protected]':+ resolution: {integrity: sha512-MyT1j3mHC2+Lu4pBi9mKyMJhtP6U7k7EldY7sj/uS5gJA65gTXt8MefJQXLJo5d/vZbuWmfxzkEUNc/urV3pHA==}+ engines: {node: '>= 10'}+ cpu: [x64]+ os: [win32]++ '@napi-rs/[email protected]':+ resolution: {integrity: sha512-xglYA6q3XO5P3BNJYxVZ1IV7DLVjp1Py6nwag88YntrS+3vKHyYcMqXVS4ZztJmwz2uGvz1FWhI/4LgbR5uQDA==}+ engines: {node: '>= 10'}++ '@napi-rs/[email protected]':+ resolution: {integrity: sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==}+ engines: {node: ^22.20 || ^24.12 || >=25}+ cpu: [x64]+ os: [linux]+ libc: [glibc]'@napi-rs/[email protected]':resolution: {integrity: sha512-p64ah1M1ld8xjWv3qbvFwHiFVWrq1yFvV4f7w+mzaqiR4IlSgkqhcRdHwsGgomwzBH51sRY4NEowLxnaBjcW/A==}- '@next/[email protected]':- resolution: {integrity: sha512-S1qaj25Wru2dUpcIZMjxeMVSwkt8BK4dmWHHiBuRstcIyOsMapqT4A4jSB6onvqeygkSSmOkyny9VVx8JIGamQ==}-'@next/[email protected]':resolution: {integrity: sha512-a26KnbW9DFEUsSxAxKBORR/uD9THoYoKbkpFywMN/AFvboTt94b8+g/07T8J6ACsdLag8/PDU60ov4rPxRAixw==}- '@next/[email protected]':- resolution: {integrity: sha512-eNSOIMJtjs+dp4Ms1tB1PPPJUQHP3uZK+OQ7iFY9qXpGO6ojT6imCL+KcUOqE/GXGidWbBZJzYdgAdPHqeCEPA==}+ '@next/[email protected]':+ resolution: {integrity: sha512-mBDF7T0XKZjs9SpUAl0buizVO+O02ULjOvWX8o/AZo/5AGw/UAS1Zzcylmd4pqbftzmKQi+L/nB4jgBYKEAl5Q==}- '@next/[email protected]':- resolution: {integrity: sha512-kJI7E/353vsoGa2usU/P36gDSA0iVc9xqJFFiPgLrSgWlivkANTRXjrnNVmVpHZ6ETmiZP52fMuKwmT9/FSmNQ==}+ '@next/[email protected]':+ resolution: {integrity: sha512-k3Xuve1X9w5B5lcOcR9wkLJrfTkx6F+zZsR1cO5v8AqFxZ1bBv4Hc/45l/eUPMEZ7tfg1eAtQ2fvV8qcaQPMzQ==}peerDependencies:'@mdx-js/loader': '>=0.15.0''@mdx-js/react': '>=0.15.0'@@ -1023,22 +1281,16 @@ packages:'@mdx-js/react':optional: true- '@next/[email protected]':- resolution: {integrity: sha512-Rvh7KU9hOUBnZ9TJ28n2Oa7dD9cvDBKua9IKx7cfQQ0GoYUwg9ig31O2oMwH3wm+pE3IkAQ67ZobPfEgurPZIA==}- engines: {node: '>= 10'}- cpu: [arm64]- os: [darwin]-'@next/[email protected]':resolution: {integrity: sha512-uaBhA8aLbXLqwjnsHSkxs353WrRgQgiFjduDpc7YXEU0B54IKx3vU+cxQlYwPCyC8uYEEX7THhtQQsfHnvv8dw==}engines: {node: '>= 10'}cpu: [arm64]os: [darwin]- '@next/[email protected]':- resolution: {integrity: sha512-5TGyjFcf8ampZP3e+FyCax5zFVHi+Oe7sZyaKOngsqyaNEpOgkKB3sqmymkZfowy3ufGA/tUgDPPxpQx931lHg==}+ '@next/[email protected]':+ resolution: {integrity: sha512-AGdNLvxZNY6eR2iSnV+6wUa8CiHTMr4F7g3uHH7fT4ICIJBE00R9u4tzN/Vuwsw0cOi8MTD2HJcTCb6siMH88Q==}engines: {node: '>= 10'}- cpu: [x64]+ cpu: [arm64]os: [darwin]'@next/[email protected]':@@ -1047,12 +1299,11 @@ packages:cpu: [x64]os: [darwin]- '@next/[email protected]':- resolution: {integrity: sha512-3Bwv4oc08ONiQ3FiOLKT72Q+ndEMyLNsc/D3qnLMbtUYTQAmkx9E/JRu0DBpHxNddBmNT5hxz1mYBphJ3mfrrw==}+ '@next/[email protected]':+ resolution: {integrity: sha512-9HrQajBMmGcrrrvDfRimiCrbAPh3E6uHJmwBovYr6Yrmi9p9PZqI876BrXX280wICh3o2XwUlp4blkB0NNBqFg==}engines: {node: '>= 10'}- cpu: [arm64]- os: [linux]- libc: [glibc]+ cpu: [x64]+ os: [darwin]'@next/[email protected]':resolution: {integrity: sha512-50ibWdn2RuFFkOEUmo9NCcQbbV9ViQOrUfG48zHBCONciHjaUKtHcYFiCwBVuzD08fzvzkWuuZkd4AqbvKO7UQ==}@@ -1061,12 +1312,12 @@ packages:os: [linux]libc: [glibc]- '@next/[email protected]':- resolution: {integrity: sha512-k5xf/tg1FBv/M4CMd8S+JL3uV9BnnRmoe7F+GWC3DxkTCD9aewFRH1s5rJ1zkzDa+Do4zyN8qD0N8c84Hu96FQ==}+ '@next/[email protected]':+ resolution: {integrity: sha512-rl9LSfE75si0WT3cDgdUC1XYCKS+TgxC+/IjitmeycrAG18X/plIP1/vy8dd/HPycYcIvE688PD7FuvEAiEAew==}engines: {node: '>= 10'}cpu: [arm64]os: [linux]- libc: [musl]+ libc: [glibc]'@next/[email protected]':resolution: {integrity: sha512-2gAPA7P652D3HzR4cLyAuVYwYqjG0mt/3pHSWTCyKZq/N/dJcUAEoNQMyUmwTZWCJRKofB+JPuDVP2aD8w2J6Q==}@@ -1075,12 +1326,12 @@ packages:os: [linux]libc: [musl]- '@next/[email protected]':- resolution: {integrity: sha512-kE6q38hbrRbKEkkVn62reLXhThLRh6/TvgSP56GkFNhU22TbIrQDEMrO7j0IcQHcew2wfykq8lZyHFabz0oBrA==}+ '@next/[email protected]':+ resolution: {integrity: sha512-TlNAnpsjxSF3aAUtqnfmtXXf8m9sIDBlmF3c7bTAlnshUYu2U0OxN2uf5d0gcFwqHVEdivJNBcCaqNOwPGNimw==}engines: {node: '>= 10'}- cpu: [x64]+ cpu: [arm64]os: [linux]- libc: [glibc]+ libc: [musl]'@next/[email protected]':resolution: {integrity: sha512-ODSKvrdMgAJOVU4qElflYy1KSZRM3M45JVbeZu42TINCMG3anp7YCBn80RkISV6bhzKwcUqLBAmOiWkaGtBA9w==}@@ -1089,12 +1340,12 @@ packages:os: [linux]libc: [glibc]- '@next/[email protected]':- resolution: {integrity: sha512-PZ5YE9ouy/IdO7QVJeIcyLn/Rc4ml9M2G4y3kCM9MNf1YKvFY4heg3pVa/jQbMro+tP6yc4G2o9LjAz1zxD7tQ==}+ '@next/[email protected]':+ resolution: {integrity: sha512-7dwtlhr0SLndqTG1z9ncRkbJswDZiKWlxzFyXDvJ2RDZRDRHp8zyMJ4D9UH/FgnQeXxxB6gZy2pMcIUoNKQ4pA==}engines: {node: '>= 10'}cpu: [x64]os: [linux]- libc: [musl]+ libc: [glibc]'@next/[email protected]':resolution: {integrity: sha512-ZR9kLwCWrlYxwEoytqPi1jhPd1TlsSJWAc+H/CJHmHkf2nD92MQpSRIURR1iNgA/kuFSdxB8xIPt4p/T78kwsg==}@@ -1103,32 +1354,33 @@ packages:os: [linux]libc: [musl]- '@next/[email protected]':- resolution: {integrity: sha512-2raR16703kBvYEQD9HNLyb0/394yfqzmIeyp2nDzcPV4yPjqNUG3ohX6jX00WryXz6s1FXpVhsCo3i+g4RUX+g==}+ '@next/[email protected]':+ resolution: {integrity: sha512-kGZxM+WhkYs0276lFrMkj7PRtXT3Btp6cwvfSO/cCVLxJJttB5Ccnl2niaCgUja8HgSbEVnMHpg3FJWoOJ9e/g==}engines: {node: '>= 10'}- cpu: [arm64]- os: [win32]-+ cpu: [x64]+ os: [linux]+ libc: [musl]+'@next/[email protected]':resolution: {integrity: sha512-+G2FrDcfm2YDbhDiObDU/qPriWeiz/9cRR0yMWJeTLGGX6/x8oryO3tt7HhodA1vZ8r2ddJPCjtLcpaVl7TE2Q==}engines: {node: '>= 10'}cpu: [arm64]os: [win32]- '@next/[email protected]':- resolution: {integrity: sha512-fyTE8cklgkyR1p03kJa5zXEaZ9El+kDNM5A+66+8evQS5e/6v0Gk28LqA0Jet8gKSOyP+OTm/tJHzMlGdQerdQ==}+ '@next/[email protected]':+ resolution: {integrity: sha512-jBDDkZ/qKAqkWivWDMkJSXUzbzV0QKRBKJjEHUAvSB97Hzw7NLzJ6yV56Lts/wjir7s4P31GYgpbS6ZL+hasAA==}engines: {node: '>= 10'}- cpu: [ia32]+ cpu: [arm64]os: [win32]- '@next/[email protected]':- resolution: {integrity: sha512-SzqGbsLsP9OwKNUG9nekShTwhj6JSB9ZLMWQ8g1gG6hdE5gQLncbnbymrwy2yVmH9nikSLYRYxYMFu78Ggp7/g==}+ '@next/[email protected]':+ resolution: {integrity: sha512-gHYS9tc+G2W0ZC8rBL+H6RdtXIyk40uLiaos0yj5US85FNhbFEndMA2nW3z47nzOWiSvXTZ5kBClc3rD0zJg0w==}engines: {node: '>= 10'}cpu: [x64]os: [win32]- '@next/[email protected]':- resolution: {integrity: sha512-gHYS9tc+G2W0ZC8rBL+H6RdtXIyk40uLiaos0yj5US85FNhbFEndMA2nW3z47nzOWiSvXTZ5kBClc3rD0zJg0w==}+ '@next/[email protected]':+ resolution: {integrity: sha512-JqtwjvvorjacQ0spgjmUJoxySoYgPwdT1sFdQ0/zmW4iMlP2hjYlCoJIyS7o6Epb4Fug8eco3HXFoBDUCDeH7Q==}engines: {node: '>= 10'}cpu: [x64]os: [win32]@@ -1157,10 +1409,6 @@ packages:resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==}engines: {node: '>= 8'}- '@nolyfill/[email protected]':- resolution: {integrity: sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==}- engines: {node: '>=12.4.0'}-'@open-draft/[email protected]':resolution: {integrity: sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==}@@ -1174,33 +1422,23 @@ packages:resolution: {integrity: sha512-fmEWp5kXlGEc3i/lR698Hz41DfGyN4Tbe4g7L1AxSc7fF8Xeh/FQ9Quqpa9dVA413Q1Ad43QOLzU4JoXgbFPWw==}engines: {node: '>=8.0.0'}- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-uIX52NnTM0iBh84MShlpouI7UKqkZ7MrUszTmaypHBu4r7NofznSnQRfJ+uUeDtQDj6w8eFGg5KBLDAwAPz1+A==}- engines: {node: '>=14'}-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==}+ '@opentelemetry/[email protected]':+ resolution: {integrity: sha512-CmVa4ImJ+ynfrPMNaAXHET6Bhb44SwzmfyVJFq9ni2jgXJR/l7C6gfVFddNmHP+ZOkP9cf4f9DBe68qVLTHc9w==}engines: {node: '>=8.0.0'}'@opentelemetry/[email protected]':resolution: {integrity: sha512-gLyJlPHPZYdAk1JENA9LeHejZe1Ti77/pTeFm/nMXmQH/HFZlcS/O2XJB+L8fkbrNSqhdtlvjBVjxwUYanNH5Q==}engines: {node: '>=8.0.0'}- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-s5vvxXPVdjqS3kTLKMeBMvop9hbWkwzBpu+mUO2M7sZtlkyDJGwFe33wRKnbaYDo8ExRVBIIdwIGrqpxHuKttA==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': '>=1.0.0 <1.10.0'-'@opentelemetry/[email protected]':resolution: {integrity: sha512-OPFBYuXEn1E4ja3Y6eeA7O+ZnLBNcXTV5Cgsn1VaqBZ6hC5FnpZPLBNme1LJY8ZtF4aOujPKFoeWN4ik487KuQ==}engines: {node: ^18.19.0 || >=20.6.0}peerDependencies:'@opentelemetry/api': '>=1.0.0 <1.10.0'- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-OOCM2C/QIURhJMuKaekP3TRBxBKxG/TWWA0TL2J6nXUtDnuCtccy49LUJF8xPFXMX+0LMcxFpCo8M9cGY1W6rQ==}- engines: {node: '>=14'}+ '@opentelemetry/[email protected]':+ resolution: {integrity: sha512-/wNZ8twnEQQA4HoHu22+vcsdru6pWPWxW+7w+FlxT6Id7PE/WIbZmVKkte+PF72e0F2dnImFeHD2syyE1Mw6MQ==}+ engines: {node: ^18.19.0 || >=20.6.0}peerDependencies:'@opentelemetry/api': '>=1.0.0 <1.10.0'@@ -1234,153 +1472,15 @@ packages:peerDependencies:'@opentelemetry/api': ^1.3.0- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-AyXVnlCf/xV3K/rNumzKxZqsULyITJH6OVLiW6730JPRqWA7Zc9bvYoVNpN6iOpTU8CasH34SU/ksVJmObFibQ==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-ht7YGWQuV5BopMcw5Q2hXn3I8eG8TH0J/kc/GMcW4CuNTgiP6wCu44BOnucJWL3CmFWaRHI//vWyAhaC8BwePw==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-K/qU4CjnzOpNkkKO4DfCLSQshejRNAJtd4esgigo/50nxCB6XCyi1dhAblUHM9jG5dRm8eu0FB+t87nIo99LYQ==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-QNXPTWteDclR2B4pDFpz0TNghgB33UMjUt14B+BZPmtH1MwUFAfLHBaP5If0Z5NZC+jaH8oF2glgYjrmhZWmSw==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-arSp97Y4D2NWogoXRb8CzFK3W2ooVdvqRRtQDljFt9uC3zI6OuShgey6CVFC0JxT1iGjkAr1r4PDz23mWrFULQ==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-6g0FhB3B9UobAR60BGTcXg4IHZ6aaYJzp0Ki5FhnxyAPt8Ns+9SSvgcrnsN2eGmk3RWG5vYycUGOEApycQL24A==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-M6qGYsp1cURtvVLGDrPPZemMFEbuMmCXgQYTReC/IbimV5sGrLBjB+/hANUpRZjX67nGLdKSVLZuQQAiNz+sww==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-EGQRWMGqwiuVma8ZLAZnExQ7sBvbOx0N/AE/nlafISPs8S+QtXX+Viy6dcQwVWwYHQPAcuY3bFt3xgoAwb4ZNQ==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-7Ehow/7Wp3aoyCrZwQpU7a2CnoMq0XhIcioFuKjBb0PLYfBfmTsFTUyatlHu0fRxhwcRsSQRTvEhmZu8CppBpQ==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-1Uz5iJ9ZAlFOiPuwYg29Bf7bJJc/GeoeJIFKJYQf67nTVKFe8RHbEtxgkOmK4UGZNHKXcpW4P8cWBYzBn1USpg==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-OtFGSN+kgk/aoKgdkKQnBsQFDiG8WdCxu+UrHr0bXScdAmtSzLSraLo7wFIb25RVHfRWvzI5kZomqJYEg/l1iA==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-OtjaKs8H7oysfErajdYr1yuWSjMAectT7Dwr+axIoZqT9lmEOkD/H/3rgAs8h/NIuEi2imSXD+vL4MZtOuJfqQ==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-U4dQxkNhvPexffjEmGwCq68FuftFK15JgUF05y/HlK3M6W/G2iEaACIfXdSnwVNe9Qh0sPfw8LbOPxrWzGWGMQ==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-l/c+Z9F86cOiPJUllUCt09v+kICKvT+Vg1vOAJHtHPsJIzurGayucfCMq2acd/A/yxeNWunl9d9eqZ0G+XiI6A==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-5MPkYCvG2yw7WONEjYj5lr5JFehTobW7wX+ZUFy81oF2lr9IPfZk9qO+FTaM0bGEiymwfLwKe6jE15nHn1nmHg==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-1xmAqOtRUQGR7QfJFfGV/M2kC7wmI2WgZdpru8hJl3S0r4hW0n3OQpEHlSGXJAaNFyvT+ilnwkT+g5L4ljHR6g==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-3kINtW1LUTPkiXFRSSBmva1SXzS/72we/jL22N+BnF3DFcoewkdkHPYOIdAAk9gSicJ4d5Ojtt1/HeibEc5OQg==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-h6Ad60FjCYdJZ5DTz1Lk2VmQsShiViKe0G7sYikb0GHI0NVvApp2XQNRHNjEMz87roFttGPLHOYVPlfy+yVIhQ==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-TKp4hQ8iKQsY7vnp/j0yJJ4ZsP109Ht6l4RHTj0lNEG1TfgTrIH5vJMbgmoYXWzNHAqBH2e7fncN12p3BP8LFg==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-QxgjSrxyWZc7Vk+qGSfsejPVFL1AgAJdSBMYZdDUbwg730D09ub3PXScB9d04vIqPriZ+0dqzjmQx0yWKiCi2Q==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-UMqleEoabYMsWoTkqyt9WAzXwZ4BlFZHO40wr3d5ZvtjKCHlD4YXLm+6OLCeIi/HkX7EXvQaz8gtAwkwwSEvcQ==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-5Cuy/nj0HBaH+ZJ4leuD7RjgvA844aY2WW+B5uLcWtxGjRZl3MNLuxnNg5DYWZNPO+NafSSnra0q49KWAHsKBg==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.3.0-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-rkOGikPEyRpMCmNu9AQuV5dtRlDmJp2dK5sw8roVshAGoB6hH/3QjDtRhdwd75SsJwgynWUNRUYe0wAkTo16tQ==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.7.0-'@opentelemetry/[email protected]':resolution: {integrity: sha512-mIZil8Es+sYDK5m+DQiwAwF57F14TF2YlEqvIjZ/RQWcxDBwRGsKfdK2Tv65OU9meQKCMzSIFS9mxAcnAb6Bkg==}engines: {node: ^18.19.0 || >=20.6.0}peerDependencies:'@opentelemetry/api': ^1.3.0- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-BdBGhQBh8IjZ2oIIX6F2/Q3LKm/FDDKi6ccYKcBTeilh6SNdNKveDOLk73BkSJjQLJk6qe4Yh+hHw1UPhCDdrg==}- engines: {node: '>=14'}+ '@opentelemetry/[email protected]':+ resolution: {integrity: sha512-xQx3E2WxP1mDvKzxLxX+CTCtNLa560YJZ3087qYHerl2YmiKpv7AH+dAy7vmx+eVrZ5BwhfWUAVoKOoxCNHcpw==}+ engines: {node: ^18.19.0 || >=20.6.0}peerDependencies:'@opentelemetry/api': ^1.3.0@@ -1396,15 +1496,11 @@ packages:peerDependencies:'@opentelemetry/api': ^1.3.0- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-faYX1N0gpLhej/6nyp6bgRjzAKXn5GOEMYY7YhciSfCoITAktLUtQ36d24QEWNA1/WA1y6qQunCe0OhHRkVl9g==}- engines: {node: '>=14'}-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-5UxZqiAgLYGFjS4s9qm5mBVo433u+dSPUFWVWXmLAD4wB65oMCoXaJP1KJa9DIYYMeHu3z4BZcStG3LC593cWA==}- engines: {node: '>=14'}+ '@opentelemetry/[email protected]':+ resolution: {integrity: sha512-q6MMm2zhggzsHVNbabYwut+a6nbuQQe3URUoxaojM/8K1IBfwwPzvxIjNi2/lI1TFe+fMHMW9MWhrtDLEXEnkA==}+ engines: {node: ^18.19.0 || >=20.6.0}peerDependencies:- '@opentelemetry/api': '>=1.0.0 <1.10.0'+ '@opentelemetry/api': '>=1.3.0 <1.10.0''@opentelemetry/[email protected]':resolution: {integrity: sha512-DeT6KKolmC4e/dRQvMQ/RwlnzhaqeiFOXY5ngoOPJ07GgVVKxZOg9EcrNZb5aTzUn+iCrJldAgOfQm1O/QfPAQ==}@@ -1424,11 +1520,11 @@ packages:peerDependencies:'@opentelemetry/api': '>=1.9.0 <1.10.0'- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-jVPgBbH1gCy2Lb7X0AVQ8XAfgg0pJ4nvl8/IiQA6nxOsPvS+0zMJaFSs2ltXe0J6C8dqjcnpyqINDJmU30+uOg==}- engines: {node: '>=14'}+ '@opentelemetry/[email protected]':+ resolution: {integrity: sha512-GuYQQT7QD2EeO8lcZLRQzcbOyhqAzL+6WWTKTU9mSUBYBazkEDl+VrQcXQhbB08OWM9anD1aHleVadzulpOaUQ==}+ engines: {node: ^18.19.0 || >=20.6.0}peerDependencies:- '@opentelemetry/api': '>=1.0.0 <1.10.0'+ '@opentelemetry/api': '>=1.3.0 <1.10.0''@opentelemetry/[email protected]':resolution: {integrity: sha512-NAYIlsF8MPUsKqJMiDQJTMPOmlbawC1Iz/omMLygZ1C9am8fTKYjTaI+OZM+WTY3t3Glo0wnOg/6/pac6RGPPw==}@@ -1442,24 +1538,16 @@ packages:peerDependencies:'@opentelemetry/api': '>=1.0.0 <1.10.0'- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA==}- engines: {node: '>=14'}-- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-4VlGgo32k2EQ2wcCY3vEU28A0O13aOtHz3Xt2/2U5FAh9EfhD6t6DqL5Z6yAnRCntbTFDU4YfbpyzSlHNWycPw==}- engines: {node: '>=14'}+ '@opentelemetry/[email protected]':+ resolution: {integrity: sha512-MfQGq3GRmTh5fM/y+OjaO0vj6+luCB1XO2gfXCalKCfgKw0eHL++sm75DNweC6ohlp+aFvACqeE0fYayqdRaoQ==}+ engines: {node: ^18.19.0 || >=20.6.0}+ peerDependencies:+ '@opentelemetry/api': '>=1.3.0 <1.10.0''@opentelemetry/[email protected]':resolution: {integrity: sha512-/UhIkaZgPutTFmQ7RnIJGgDXZmtEJ7Dvi86xNTFWcnRxVRNk/aotsqDJYeEvDP+FSMB2SdW+pQzNMcWP0rwuNA==}engines: {node: '>=14'}- '@opentelemetry/[email protected]':- resolution: {integrity: sha512-nSDlnHSqzC3pXn/wZEZVLuAuJ1MYMXPBwtv2qAbCa3847SaHItdE7SzUq/Jtb0KZmh1zfAbNi3AAMjztTT4Ugg==}- engines: {node: '>=14'}- peerDependencies:- '@opentelemetry/api': ^1.1.0-'@oxc-resolver/[email protected]':resolution: {integrity: sha512-aUs47y+xyXHUKlbhqHUjBABjvycq6YSD7bpxSW7vplUmdzAlJ93yXY6ZR0c1o1x5A/QKbENCvs3+NlY8IpIVzg==}cpu: [arm]@@ -1568,114 +1656,465 @@ packages:cpu: [x64]os: [win32]- '@pkgjs/[email protected]':- resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}- engines: {node: '>=14'}+ '@oxfmt/[email protected]':+ resolution: {integrity: sha512-o6uzh/jTOQeAY5TdkAeXdqv7MBRcPxiRA08zrcBtkKj5cSu/FMu0Hl7Q6Fi1KCKyCWZ6lJVjBzdsJvsKltUsGQ==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [arm]+ os: [android]- '@playwright/[email protected]':- resolution: {integrity: sha512-O71yZIbAh/PxDMNGns37GHBIfrVkEVyn+AXyIa5dOTfb4/xNvRWV+Vv/NMbNCtODB/pO7vLlF2OTmMVLhmr7Ag==}- engines: {node: '>=18'}- hasBin: true+ '@oxfmt/[email protected]':+ resolution: {integrity: sha512-jRGSUeeP7p3Gynw2YaCVtjBIA6ZxY6bEB/ES5i54OhqmRTyuVg7ZgstEtzgq6GOAJd+2QZ5pvf+bFfmW5Mp9cw==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [arm64]+ os: [android]- '@prisma/[email protected]':- resolution: {integrity: sha512-1SeN0IvMp5zm3RLJnEr+Zn67WDqUIPP1lF/PkLbi/X64vsnFyItcXNRBrYr0/sI2qLcH9iNzJUhyd3emdGizaQ==}- peerDependencies:- '@opentelemetry/api': ^1.8+ '@oxfmt/[email protected]':+ resolution: {integrity: sha512-JINwtU2lW7nOFSqi+H2qplipNUqah9Gc1jgGmB82kTD4UnZrZIVxCJ9qEmFiKfjNq27gYLFhrUb0to86aCwMjw==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [arm64]+ os: [darwin]- '@protobuf-ts/[email protected]':- resolution: {integrity: sha512-KuDaT1IfHkugM2pyz+FwiY80ejWrkH1pAtOBOZFuR6SXEFTsnb/jiQWQ1rCIrcKx2BtyxnxW6BWwsVSA/Ie+WQ==}+ '@oxfmt/[email protected]':+ resolution: {integrity: sha512-gCmuswrgrOSajV4HCRFkVCGIruPq8bjYuPYgSE2WQB3mD6XrdyZ3JMSRZCkQ8zCxOyGWriBo6QoZ5nmMHQ1BfA==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [x64]+ os: [darwin]- '@radix-ui/[email protected]':- resolution: {integrity: sha512-yQ8oGX2GVsEYMWGxcovu1uGWPCxV5BFfeeYxqPmuAzUyLT9qmaMXSAhXpb0WrspIeqYzdJpkh2vHModJPgRIaw==}+ '@oxfmt/[email protected]':+ resolution: {integrity: sha512-Ab8g7a38pT0MMImjh7anRSTve6buWBIlcXIFBYa5xl4s6UxEgKSc2xOOhbGtLwvXnEi2PsEDGoJh3oUU7xkehQ==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [x64]+ os: [freebsd]- '@radix-ui/[email protected]':- resolution: {integrity: sha512-SJ31y+Q/zAyShtXJc8x83i9TYdbAfHZ++tUZnvjJJqFjzsdUnKsxPL6IEtBlxKkU7yzer//GQtZSV4GbldL3YA==}+ '@oxfmt/[email protected]':+ resolution: {integrity: sha512-BgvS3CoQ+Xy2deoZqEN8JVKabcCZi2RxA3yant8G9OAv9KuPJ9TCjHkqigzdHUVwErZxEP5d2bzLIEyKYyBDLg==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [arm]+ os: [linux]- '@radix-ui/[email protected]':- resolution: {integrity: sha512-RIQ15mrcvqIkDARJeERSuXSry2N8uYnxkdDetpfmalT/+0ntOXLkFOsh9iwlAsCv+qcmhZjbdJogIm6WBa6c4A==}- peerDependencies:- '@types/react': '*'- '@types/react-dom': '*'- react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc- react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc- peerDependenciesMeta:- '@types/react':- optional: true- '@types/react-dom':- optional: true+ '@oxfmt/[email protected]':+ resolution: {integrity: sha512-QXpNxwoMj0YvnceCNZadNSden3bIcnvjn/sDp/rwZhRoZoZYGpHvtPyhGsdJz9uvT9GkaMW7SsLddurU56dt8w==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [arm]+ os: [linux]- '@radix-ui/[email protected]':- resolution: {integrity: sha512-p4XnPqgej8sZAAReCAKgz1REYZEBLR8hU9Pg27wFnCWIMc8g1ccCs0FjBcy05V15VTu8pAePw/VDYeOm/uZ6yQ==}- peerDependencies:- '@types/react': '*'- '@types/react-dom': '*'- react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc- react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc- peerDependenciesMeta:- '@types/react':- optional: true- '@types/react-dom':- optional: true+ '@oxfmt/[email protected]':+ resolution: {integrity: sha512-BBgH3I1ppDsI5pZ4Pdhw0ceYxwVCfbU/bZEBCeZ6caRS9x0ZabErxubP7riGUn11PXZBhe8DYdjkDKP1FlVQ5w==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [arm64]+ os: [linux]+ libc: [glibc]- '@radix-ui/[email protected]':- resolution: {integrity: sha512-G+KcpzXHq24iH0uGG/pF8LyzpFJYGD4RfLjCIBfGdSLXvjLHST31RUiRVrupIBMvIppMgSzQ6l66iAxl03tdlg==}- peerDependencies:- '@types/react': '*'- '@types/react-dom': '*'- react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc- react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc- peerDependenciesMeta:- '@types/react':- optional: true- '@types/react-dom':- optional: true+ '@oxfmt/[email protected]':+ resolution: {integrity: sha512-v19HSjC/BGXdt26qEvKZtwAHgGmQ2Agcap2kQP+KIqoRZqivVzYth3ui2dJA1i+6/fjpjga85lIOaJJjQ/bOOw==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [arm64]+ os: [linux]+ libc: [musl]- '@radix-ui/[email protected]':- resolution: {integrity: sha512-jFSerheto1X03MUC0g6R7LedNW9EEGWdg9W1+MlpkMLwGkgkbUXLPBH/KIuWKXUoeYRVY11llqbTBDzuLg7qrw==}- peerDependencies:- '@types/react': '*'- '@types/react-dom': '*'- react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc- react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc- peerDependenciesMeta:- '@types/react':- optional: true- '@types/react-dom':- optional: true+ '@oxfmt/[email protected]':+ resolution: {integrity: sha512-PElLnOo4xFTBZrxPhgTIj0eHqZXwEBQoNWtb7facUV170T0B0FRET0iNbb3LUeLWTybkUW+vsdyv4ihOdyXGyw==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [ppc64]+ os: [linux]+ libc: [glibc]- '@radix-ui/[email protected]':- resolution: {integrity: sha512-9z54IEKRxIa9VityapoEYMuByaG42iSy1ZXlY2KcuLSEtq8x4987/N6m15ppoMffgZX72gER2uHe1D9Y6Unlcw==}- peerDependencies:- '@types/react': '*'- '@types/react-dom': '*'- react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc- react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc- peerDependenciesMeta:- '@types/react':- optional: true- '@types/react-dom':- optional: true+ '@oxfmt/[email protected]':+ resolution: {integrity: sha512-Qzsg15n4F5CH+MorcRW4MkAEMiLzXmeG+DiDSbP/bBTqCmWOH3K9DHryNrve+JHlV0txS+B6Z9P5Xz+cmWeL+g==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [riscv64]+ os: [linux]+ libc: [glibc]- '@radix-ui/[email protected]':- resolution: {integrity: sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==}- peerDependencies:- '@types/react': '*'- react: ^16.8 || ^17.0 || ^18.0- peerDependenciesMeta:- '@types/react':- optional: true+ '@oxfmt/[email protected]':+ resolution: {integrity: sha512-/GZ358wnQ/Ez4UVnCcZIi56JkY0sOdZ+B108pqXKqZz3jLS59F4KEAB1Qv3fRlObrFEk+3L2vUQ/xoPx+3vjXw==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [riscv64]+ os: [linux]+ libc: [musl]- '@radix-ui/[email protected]':- resolution: {integrity: sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw==}- peerDependencies:- '@types/react': '*'- react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc- peerDependenciesMeta:- '@types/react':- optional: true+ '@oxfmt/[email protected]':+ resolution: {integrity: sha512-/C9We3DXegowfLXtVCYHeNiU9azwCDr5cQkEtCVlc74vyn+lLQSPApJ1CZmxAduqeq/Oi3gQ+IVptyhCaTMtkQ==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [s390x]+ os: [linux]+ libc: [glibc]- '@radix-ui/[email protected]':- resolution: {integrity: sha512-ebbrdFoYTcuZ0v4wG5tedGnp9tzcV8awzsxYph7gXUyvnNLuTIcCk1q17JEbnVhXAKG9oX3KtchwiMIAYp9NLg==}+ '@oxfmt/[email protected]':+ resolution: {integrity: sha512-91KM2CeRWscIEHlj1NsW2WSnzGeq1Ehq+39bfDowTdkn+fcvK/x4Y1RcyqT7glyBjZio0ldkeCG6Usj3v7ASog==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [x64]+ os: [linux]+ libc: [glibc]++ '@oxfmt/[email protected]':+ resolution: {integrity: sha512-gw7uEk9I+7zoT1EYLra1eWArIzNcz8e3jkv+Noo2+o2T7wPvsNSQbfoa4DSfZlvn1i6mJ05RiZ4/omaXPDNhQg==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [x64]+ os: [linux]+ libc: [musl]++ '@oxfmt/[email protected]':+ resolution: {integrity: sha512-HYHFf616FHSPSO07c09mjmXBfQ73wIVM3m0txOiooa5XZkGoxFd6B14PVj0LB0DXIqJ6wAO/dDR/NX/5UUaqnw==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [arm64]+ os: [openharmony]++ '@oxfmt/[email protected]':+ resolution: {integrity: sha512-uQjFp081IZSWD6VAofX2iO2z01awAdHmfC+NrieWIPKrT2hZKQDyq/U18M7ifC0sm0Wz8aHY/p6+FDYIzs/CrQ==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [arm64]+ os: [win32]++ '@oxfmt/[email protected]':+ resolution: {integrity: sha512-lNM6byTAQ881jugzFu8juJTbNRgsUTlswMA6pJmwi1XDvmIqnnb49lcUAs5gz94fCJLrVN+/X3s3jOKqx23WIQ==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [ia32]+ os: [win32]++ '@oxfmt/[email protected]':+ resolution: {integrity: sha512-BtmbtL/QjMtF1a6C3CqoDluH2IfB6fJt62E+B9RFfUPtFk4Iz9PFS6+y/SzzOvSxc7aUk2Kphwg7Dh8lMbwu6g==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [x64]+ os: [win32]++ '@oxlint-tsgolint/[email protected]':+ resolution: {integrity: sha512-CUJEdbSZ54+Xy9OXqOhWLTKZKV0BBiV7C2i/ygyVmXtkUNXx5YCzN8DpSSshTAKktoL7S+tnQ/ftFG/i7X896w==}+ cpu: [arm64]+ os: [darwin]++ '@oxlint-tsgolint/[email protected]':+ resolution: {integrity: sha512-pXfBb5BqONCcgrXQNUZWXgiYmRSWJzd97S8i41VVOh6ut0tyo+cJ5FKFpczDHxiVNfj/3e7c9B4MtztNdpIVCw==}+ cpu: [x64]+ os: [darwin]++ '@oxlint-tsgolint/[email protected]':+ resolution: {integrity: sha512-roP7zujb/QDPzDwEKsFFpzNHHy91/Y7oX9vQXk78ekyZtcQj1QXDIMH33gjDdHBfRl4K9pZ36xhRgrP4Zr+R8A==}+ cpu: [arm64]+ os: [linux]++ '@oxlint-tsgolint/[email protected]':+ resolution: {integrity: sha512-UDezNqdECVmngu2TPnjaS1YoAmcTaBoI5lV9vk3VahBxoi+I5r9k3iJTT7qZoYWOXTD/7T7bNcwRgrocR6BscQ==}+ cpu: [x64]+ os: [linux]++ '@oxlint-tsgolint/[email protected]':+ resolution: {integrity: sha512-uJZhqB6pdXLuN+AD1F5082byyQti/NPmJA77GtcFlmT2HzRelqbNls3SaIqxpjdFgvSBF9g0yOKGBkGFg7kX8Q==}+ cpu: [arm64]+ os: [win32]++ '@oxlint-tsgolint/[email protected]':+ resolution: {integrity: sha512-FkDRm8hx9OwzGQqyWG1tO5QrTLRApff9DzSgpz9QZau37BR8d1VYKOxMLGf6shPZntJFoTwIIJYT68VndYDCog==}+ cpu: [x64]+ os: [win32]++ '@oxlint/[email protected]':+ resolution: {integrity: sha512-TebFaaMklO/RXzTv7PucaCq9l3X6D1gA+C8H6K4njtjFOV+zWE9MKLpulcJZN9bzytbUbQIY0mZuz12nQ5Kv4Q==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [arm]+ os: [android]++ '@oxlint/[email protected]':+ resolution: {integrity: sha512-KqqnOtAVgNsPPF0YSodkFZA1O80jcKoCZCTu3bgsszxA+MrMP9TLzfXitKjEj1FmrPprKDMdRDMmY3weESO9sg==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [arm64]+ os: [android]++ '@oxlint/[email protected]':+ resolution: {integrity: sha512-BVC2nsMzqQzRDPc5RhixkZ+m1p7iH4bxRRvqkbwDXX0PlQKm1BPy8J8cRjnAFafOq2QzI+BfO3vE8w2GZ3CBag==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [arm64]+ os: [darwin]++ '@oxlint/[email protected]':+ resolution: {integrity: sha512-p6Lm+snmhGuLKL1+CpCV8L6ijkE/qJzK2H2jG9+eKJT0n31RbY4FLsdhexekgP3bLpw4Kgde+9DZuDZQ4yIInA==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [x64]+ os: [darwin]++ '@oxlint/[email protected]':+ resolution: {integrity: sha512-qDMm0dXZnoHyRqSL4N4xUq82T4sqK5cbKSjvd/dF/YbMUXc2R1wEPf+vmA5S0qUmi0nwXfNbjXBtZaIqzQLIMg==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [x64]+ os: [freebsd]++ '@oxlint/[email protected]':+ resolution: {integrity: sha512-2od7s0nuKPzqyUZAWk9KkCyGg7eI9dwFPZg+20lB15fKFkVZ0c9ZFxqPfiBAyDTlTkh9stPI0t+JlPCqMbItVA==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [arm]+ os: [linux]++ '@oxlint/[email protected]':+ resolution: {integrity: sha512-ZOQUjkzDnvlhSE3+tWC3YXx94MMl+sYMlwH+u1+YGApGHOJP/YAc8ZBRFOXZ6eOBmxtXAWuS/fBcdZr8qqNO1A==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [arm]+ os: [linux]++ '@oxlint/[email protected]':+ resolution: {integrity: sha512-lu158FR4nGqGeRS3BQvtG85wRgU/Fy4MD5Cxp1hzJXizGiLo6u2742wJSCDKh8cFcZntvX7fcxlq4mMmfryH1g==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [arm64]+ os: [linux]+ libc: [glibc]++ '@oxlint/[email protected]':+ resolution: {integrity: sha512-mbpKQeE2aflTjddaHK7MP8KP/OFbUM++lt5M635ENM8IyIdK0jm2t9pb+2v9mVVIvhF6TqA4l7F79Pll1mi+uw==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [arm64]+ os: [linux]+ libc: [musl]++ '@oxlint/[email protected]':+ resolution: {integrity: sha512-WpGNua7gaxaHnpSDeog2ji8IDHn/QLPl9LPzwkR/FvVv58vT5BcXjRXnU+wbu3N75cpeha8CdC7ho/U2OIsB4g==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [ppc64]+ os: [linux]+ libc: [glibc]++ '@oxlint/[email protected]':+ resolution: {integrity: sha512-tK1E93A5LVzISg4ngpKJnfTs7EqtIUceGI7MQ4GyDjJiLi8wPCkEyKlj2xkyKWZ1yzkDJyLHTBJ5/iFWRdnJvg==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [riscv64]+ os: [linux]+ libc: [glibc]++ '@oxlint/[email protected]':+ resolution: {integrity: sha512-qhQvUIrngXivA2A9pQ+xPCychztn/5qUv7yS3gDwXv3w7Rag+eTeeXWmRyx+t7XsW5x6LuY/8AsTq36UgFIblg==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [riscv64]+ os: [linux]+ libc: [musl]++ '@oxlint/[email protected]':+ resolution: {integrity: sha512-sv6AaVgU/eE6u+6WFiQVDcPPwTxP6IJMSB9k701W2r/r6Tx465e8vPvVyRxquNH4Vy6KwRNu90mVbxXJN8+5gg==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [s390x]+ os: [linux]+ libc: [glibc]++ '@oxlint/[email protected]':+ resolution: {integrity: sha512-iFZL02deziHslb3jEX9KdqlAkYoo4fGyotchKDzdfK1f5mxlIBeiQeHhvK3iFpuEJSB4ma/qeFn9oxPiwnhUPQ==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [x64]+ os: [linux]+ libc: [glibc]++ '@oxlint/[email protected]':+ resolution: {integrity: sha512-3DtZR2raqObnh7wXZoFYFd0Fw7skBvcb3f7A+/lkEiDuh8hrE6vv9b/62Qxao1a9/OeHLw/FcXlXzgsW9wTRFg==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [x64]+ os: [linux]+ libc: [musl]++ '@oxlint/[email protected]':+ resolution: {integrity: sha512-Oatt4GuA1WJkqzk2ozx4HrWROOi7opV3AKDw/U8qDIqeTqzsjn5K2x3REJMNjU3/KU/Bkq96Zi3CknaiDTaC/Q==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [arm64]+ os: [openharmony]++ '@oxlint/[email protected]':+ resolution: {integrity: sha512-NAgZr9Qp8nIA9rpo0JEvwiabTF/2UVqBNnupBG9X4kxXcQoScJUTi+qHhvabb9s/thgj5wQ4XcIaJvb+ZMgoKw==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [arm64]+ os: [win32]++ '@oxlint/[email protected]':+ resolution: {integrity: sha512-+KyXjIvcpaXmWW/j9NNY5yWjrIVxaX18VyIheQy3jwc2GSYgpCr7MGI/HxIGQ/shAL5IWEKbhsqoMpAO5Stiog==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [ia32]+ os: [win32]++ '@oxlint/[email protected]':+ resolution: {integrity: sha512-mEelcCMMBS57sIXh2veGMNy+pQwuGtcMxHxGIZWQ5Ba9pJ5jCCUFOZB9E2JhBaxGsURe+WGe0zJp4RVre52gpQ==}+ engines: {node: ^20.19.0 || >=22.12.0}+ cpu: [x64]+ os: [win32]++ '@parcel/[email protected]':+ resolution: {integrity: sha512-trgpLSCKRC/huFjXX/Smh+0sWe4+YtKfktIToiMl59ghz7z+qkH6kMvNnUbLyRs9N11t8l4svSCs1+5B3rOAhA==}+ engines: {node: '>= 10.0.0'}+ cpu: [arm64]+ os: [android]++ '@parcel/[email protected]':+ resolution: {integrity: sha512-Y3QV0gl7Q1zbfueunkWIERICbEojQFCgpyG7YqOGNFLsckXyI1xu9mAIUpKY9QBYzBtSkN8dBPwd3yiAO9ovMw==}+ engines: {node: '>= 10.0.0'}+ cpu: [arm64]+ os: [darwin]++ '@parcel/[email protected]':+ resolution: {integrity: sha512-Ohv6OpzhUfKYD7Beb8kDvG0jbIxORCYY1JRdZnaBtnjjkJxgD7ZVL0nw2sCYd0yTMKTvz3nnTnOF3cDifK+kvw==}+ engines: {node: '>= 10.0.0'}+ cpu: [x64]+ os: [darwin]++ '@parcel/[email protected]':+ resolution: {integrity: sha512-5HmXvDgs8VK+74jF9y9/2FE3/OnlcKmc56tjmSrEuZjpSZOGL+fvAu+HKJBdPs9uwoP2hE6TlSUpXZ/C5jUFmQ==}+ engines: {node: '>= 10.0.0'}+ cpu: [x64]+ os: [freebsd]++ '@parcel/[email protected]':+ resolution: {integrity: sha512-Ps/hui3A+vMbjdqlqAowK2ZL8+BO8dBjxeWXj6npTBs3jx4wWmbPpaLuqwrQrSqIVMCnpWo238bJ1U37GhQOYg==}+ engines: {node: '>= 10.0.0'}+ cpu: [arm]+ os: [linux]+ libc: [glibc]++ '@parcel/[email protected]':+ resolution: {integrity: sha512-9c6AUHgHoG+IY88MRIHupztQiQnrbqHYQjkM2btA+Bf/wQnQMuiD0Wfk1EVv3TlNT3x41uU71rn6E4xh/+zvkw==}+ engines: {node: '>= 10.0.0'}+ cpu: [arm]+ os: [linux]+ libc: [musl]++ '@parcel/[email protected]':+ resolution: {integrity: sha512-yHRqS2owEXe6Hic9z6Mh1ECsCd+ODVOGvZDyciqRd21+v+o+DnXMOrw50DSpIG2sb8GPEaPPmfeCAWKPJdq46g==}+ engines: {node: '>= 10.0.0'}+ cpu: [arm64]+ os: [linux]+ libc: [glibc]++ '@parcel/[email protected]':+ resolution: {integrity: sha512-WhB2e/V7rqdHHWZusBSPuy5Ei8S6lSz6FE5TKKQz5h3a0O+C+mhY7vxU9b/stqvMb8beLnPY82ZrFTLKs+SrKA==}+ engines: {node: '>= 10.0.0'}+ cpu: [arm64]+ os: [linux]+ libc: [musl]++ '@parcel/[email protected]':+ resolution: {integrity: sha512-ulGE6x6Oz6iAwg75T8YQSoguBWasniIbX+QWpaYPcCnDOpdWX3k+4xbEYPZVLxOuoJI+svJJPD3sEj8G7lrQ3A==}+ engines: {node: '>= 10.0.0'}+ cpu: [x64]+ os: [linux]+ libc: [glibc]++ '@parcel/[email protected]':+ resolution: {integrity: sha512-tkBYKt7YQrjIJWYDnto2YgO8MRkjlMTSNoRHzsXinBqbLdeOM3L32wPZJvIZxqaLMfSlS/4sUjH/6STVP/XDLw==}+ engines: {node: '>= 10.0.0'}+ cpu: [x64]+ os: [linux]+ libc: [musl]++ '@parcel/[email protected]':+ resolution: {integrity: sha512-gIZAP23jaHjGWasY/TY6yL7NHFClf0Ga7FN+iINvk+KN94rhm94lYZhFsbYFNcA04/onvGD9kKmiJLJB2HbNwQ==}+ engines: {node: '>= 10.0.0'}+ cpu: [arm64]+ os: [win32]++ '@parcel/[email protected]':+ resolution: {integrity: sha512-cA+/pXV2YkfxlIcXOQ5fSWqAzzPyD78/x5qbK/I0vUkrlYHA8TIz+MXjAbGouguKVSI4bOmkTSJ1/poVSsgt+A==}+ engines: {node: '>= 10.0.0'}+ cpu: [x64]+ os: [win32]++ '@parcel/[email protected]':+ resolution: {integrity: sha512-7FNeNl8NCE7aINx7WXiKQrPYZWC/hvrTsmk6zmxbI7LTXE7hVek/n8AfVgpe2y82zl3w0HvCHN0bVKMBoJcC0w==}+ engines: {node: '>= 10.0.0'}++ '@pkgjs/[email protected]':+ resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}+ engines: {node: '>=14'}++ '@playwright/[email protected]':+ resolution: {integrity: sha512-O71yZIbAh/PxDMNGns37GHBIfrVkEVyn+AXyIa5dOTfb4/xNvRWV+Vv/NMbNCtODB/pO7vLlF2OTmMVLhmr7Ag==}+ engines: {node: '>=18'}+ hasBin: true++ '@protobuf-ts/[email protected]':+ resolution: {integrity: sha512-KuDaT1IfHkugM2pyz+FwiY80ejWrkH1pAtOBOZFuR6SXEFTsnb/jiQWQ1rCIrcKx2BtyxnxW6BWwsVSA/Ie+WQ==}++ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-yQ8oGX2GVsEYMWGxcovu1uGWPCxV5BFfeeYxqPmuAzUyLT9qmaMXSAhXpb0WrspIeqYzdJpkh2vHModJPgRIaw==}++ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-SJ31y+Q/zAyShtXJc8x83i9TYdbAfHZ++tUZnvjJJqFjzsdUnKsxPL6IEtBlxKkU7yzer//GQtZSV4GbldL3YA==}++ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-RIQ15mrcvqIkDARJeERSuXSry2N8uYnxkdDetpfmalT/+0ntOXLkFOsh9iwlAsCv+qcmhZjbdJogIm6WBa6c4A==}+ peerDependencies:+ '@types/react': '*'+ '@types/react-dom': '*'+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc+ peerDependenciesMeta:+ '@types/react':+ optional: true+ '@types/react-dom':+ optional: true++ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-p4XnPqgej8sZAAReCAKgz1REYZEBLR8hU9Pg27wFnCWIMc8g1ccCs0FjBcy05V15VTu8pAePw/VDYeOm/uZ6yQ==}+ peerDependencies:+ '@types/react': '*'+ '@types/react-dom': '*'+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc+ peerDependenciesMeta:+ '@types/react':+ optional: true+ '@types/react-dom':+ optional: true++ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-G+KcpzXHq24iH0uGG/pF8LyzpFJYGD4RfLjCIBfGdSLXvjLHST31RUiRVrupIBMvIppMgSzQ6l66iAxl03tdlg==}+ peerDependencies:+ '@types/react': '*'+ '@types/react-dom': '*'+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc+ peerDependenciesMeta:+ '@types/react':+ optional: true+ '@types/react-dom':+ optional: true++ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-jFSerheto1X03MUC0g6R7LedNW9EEGWdg9W1+MlpkMLwGkgkbUXLPBH/KIuWKXUoeYRVY11llqbTBDzuLg7qrw==}+ peerDependencies:+ '@types/react': '*'+ '@types/react-dom': '*'+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc+ peerDependenciesMeta:+ '@types/react':+ optional: true+ '@types/react-dom':+ optional: true++ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-9z54IEKRxIa9VityapoEYMuByaG42iSy1ZXlY2KcuLSEtq8x4987/N6m15ppoMffgZX72gER2uHe1D9Y6Unlcw==}+ peerDependencies:+ '@types/react': '*'+ '@types/react-dom': '*'+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc+ peerDependenciesMeta:+ '@types/react':+ optional: true+ '@types/react-dom':+ optional: true++ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==}+ peerDependencies:+ '@types/react': '*'+ react: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true++ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw==}+ peerDependencies:+ '@types/react': '*'+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc+ peerDependenciesMeta:+ '@types/react':+ optional: true++ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-ebbrdFoYTcuZ0v4wG5tedGnp9tzcV8awzsxYph7gXUyvnNLuTIcCk1q17JEbnVhXAKG9oX3KtchwiMIAYp9NLg==}peerDependencies:'@types/react': '*'react: ^16.8 || ^17.0 || ^18.0@@ -2163,48 +2602,48 @@ packages:react: ^18.0 || ^19.0 || ^19.0.0-rcreact-dom: ^18.0 || ^19.0 || ^19.0.0-rc- '@react-pdf/[email protected]':- resolution: {integrity: sha512-qTKGUf0iAMGg2+OsUcp9ffKnKi41RukM/zYIWMDJ4hRVYSr89Q7e3wSDW/Koqx3ea3Uy/z3h2y3wPX6Bdfxk6g==}-- '@react-pdf/[email protected]':- resolution: {integrity: sha512-/dAWu7Y2RD1RxarDZ9SkYPHgBYOhmcDnet4W/qN/m8k+A2Hr3ja54GymSR7GGxWBtxjKtNauVKrTa9LS1n8WUw==}+ '@react-pdf/[email protected]':+ resolution: {integrity: sha512-0I7pApDr1/RLAKbizuLy/IHTEa93LSPy/bEwYniboC3Xqnp6Od8xFJKbKEzGw2wh/5zKFFwl00g4t9RwgIMc3w==}- '@react-pdf/[email protected]':- resolution: {integrity: sha512-lvP5ryzYM3wpbO9bvqLZYwEr5XBDX9jcaRICvtnoRqdJOo7PRrMnmB4MMScyb+Xw10mGeIubZAAomNAG5ONQZQ==}+ '@react-pdf/[email protected]':+ resolution: {integrity: sha512-8Bg7PvtjFumVY8RnIpkbgLIwX3ZlMjrQemGl+sVz1Mx/hi8o8Bj+M9jVCWFaNXLbKAA06YxOlAMhfLEPT1+GLg==}- '@react-pdf/[email protected]':- resolution: {integrity: sha512-Aq+Cc6JYausWLoks2FvHe3PwK9cTuvksB2uJ0AnkKJEUtQbvCq8eCRb1bjbbwIji9OzFRTTzZij7LzkpKHjIeA==}+ '@react-pdf/[email protected]':+ resolution: {integrity: sha512-pbeb2qUs+lDZsvNpWSjoVkAm10WjXsoYd5jIB3utqkfWwwMkh3qo2Iz4By08AptAcRINPXaG6ICT3zsrXBMb6A==}- '@react-pdf/[email protected]':- resolution: {integrity: sha512-k+Lsuq8vTwWsCqTp+CCB4+2N+sOTFrzwGA7aw3H9ix/PDWR9QksbmNg0YkzGbLAPI6CeawmiLHcf4trZ5ecLPQ==}+ '@react-pdf/[email protected]':+ resolution: {integrity: sha512-Aa6hqB2+ytvxkGgWpxFb8PyMKndXW38bOrpdZq6fjtwYRkgDQlG3mng9paqoY+qQl5A2XiHpiNiXFEphGlVAhA==}- '@react-pdf/[email protected]':- resolution: {integrity: sha512-eSJnEItZ37WPt6Qv5pncQDxLJRK15eaRwPT+gZoujP548CodenOVp49GST8XJvKMFt9YqIBzGBV/j9AgrOQzVA==}+ '@react-pdf/[email protected]':+ resolution: {integrity: sha512-emZdaG6L/T+QP9rO4n7LAe3lbVXOy4X/C1UpgbCLxDJXsHiYBuZ8unPBv4/Tdte5hPm/Xc2KT1JEL74RSHE/Fw==}- '@react-pdf/[email protected]':- resolution: {integrity: sha512-IuhxYls1luJb7NUWy6q5avb1XrNaVj9bTNI40U9qGRuS6n7Hje/8H8Qi99Z9UKFV74bBP3DOf3L1wV2qZVgVrQ==}+ '@react-pdf/[email protected]':+ resolution: {integrity: sha512-nYXoZ36pvwNzbc54+DbL8RCn15jU7woJ9D/svnh5tpUXekJ+CbI4mZLo6boSv24CvJgychOu6h7gxX03B4ps0A==}- '@react-pdf/[email protected]':- resolution: {integrity: sha512-oTQDiR/t4Z/Guxac88IavpU2UgN7eR0RMI9DRKvKnvPz2DUasGjXfChAdMqDNmJJxxV26mMy9xQOUV2UU5/okg==}+ '@react-pdf/[email protected]':+ resolution: {integrity: sha512-7zaPRujpbHSmCpIrZ+b9HSTJHthcVZzX0Wx7RzvQGsGBUbHP4p6s5itXrAIOuQuPvDepoHGNOvf6xUuMVvdoyw==}peerDependencies:react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0- '@react-pdf/[email protected]':- resolution: {integrity: sha512-MdWfWaqO6d7SZD75TZ2z5L35V+cHpyA43YNRlJNG0RJ7/MeVGDQv12y/BXOJgonZKkeEGdzM3EpAt9/g4E22WA==}+ '@react-pdf/[email protected]':+ resolution: {integrity: sha512-jDPxvtrdETDd+pujEPvCWCiBasZxqf9IDEQUYyD9SiFEaP/FoTLh0sCGTJMG3tlzSPi/jM5Hqduop0RMVlMisg==}- '@react-pdf/[email protected]':- resolution: {integrity: sha512-28gpA69fU9ZQrDzmd5xMJa1bDf8t0PT3ApUKBl2PUpoE/x4JlvCB5X66nMXrfFrgF2EZrA72zWQAkvbg7TE8zw==}+ '@react-pdf/[email protected]':+ resolution: {integrity: sha512-RfTdt/T+wKGS+BFBgytXDM2UpgcPWWBF73uzK76ISHVLkGyJUil3gg1bidExep89KSzn/gMTW1VgW8+ga+2ADw==}peerDependencies:react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0- '@react-pdf/[email protected]':- resolution: {integrity: sha512-BGZ2sYNUp38VJUegjva/jsri3iiRGnVNjWI+G9dTwAvLNOmwFvSJzqaCsEnqQ/DW5mrTBk/577FhDY7pv6AidA==}+ '@react-pdf/[email protected]':+ resolution: {integrity: sha512-To5bbdM5KyOwkY+GqWdZSq6TlgBe+tQc/r00H1gF6RnqucMfkriRRgqXbYNlH2+RBOg5jltq7IhYARyyuge+1g==}- '@react-pdf/[email protected]':- resolution: {integrity: sha512-fDt19KWaJRK/n2AaFoVm31hgGmpygmTV7LsHGJNGZkgzXcFyLsx+XUl63DTDPH3iqxj3xUX128t104GtOz8tTw==}+ '@react-pdf/[email protected]':+ resolution: {integrity: sha512-cTIHXiz9x1HrbfqzfxfZP3FRdDwUXG77QWF6Fb5MP/lV3ONxR+g0Z3hwtBatCS9HeGBQCpxX/Lzb8wHE+co1PA==}- '@react-pdf/[email protected]':- resolution: {integrity: sha512-ckj80vZLlvl9oYrQ4tovEaqKWP3O06Eb1D48/jQWbdwz1Yh7Y9v1cEmwlP8ET+a1Whp8xfdM0xduMexkuPANCQ==}+ '@react-pdf/[email protected]':+ resolution: {integrity: sha512-wjQu/f1pKxyC2iRPJrnIm4Sc0tEmofsWtHdiyHP4NUlfN9uX4l7yVihPDWUWfoVPWB1QnTOTAIKv1vqRlGgoSg==}++ '@react-pdf/[email protected]':+ resolution: {integrity: sha512-/3jG6KUOsSERDDmz2zq+pLI2NcHqupzYtLP+hEnO39FgzWUpAnD44eJdoDtARkoqX/Yhahu4Luu8N6XK9u0/pw==}'@rollup/[email protected]':resolution: {integrity: sha512-+tNWdlWKbpB3WgBN7ijjYkq9X5uhjmcvyjEght4NmH5fAU++zfQzAJ6wumLS+dNcvwEZhKx2Z+skY8m7v0wGSA==}@@ -2229,55 +2668,121 @@ packages:cpu: [arm]os: [android]+ '@rollup/[email protected]':+ resolution: {integrity: sha512-RrPokAb7dmbxFoeO3TloqHyOjgye8RkBhSqmp4aJMIex4c9r46ZstPnleDQOq1t46VOVjwIuwNogIqbodV1Vvg==}+ cpu: [arm]+ os: [android]+'@rollup/[email protected]':resolution: {integrity: sha512-yDvqx3lWlcugozax3DItKJI5j05B0d4Kvnjx+5mwiUpWramVvmAByYigMplaoAQ3pvdprGCTCE03eduqE/8mPQ==}cpu: [arm64]os: [android]+ '@rollup/[email protected]':+ resolution: {integrity: sha512-JKuJc+pnpks2pjy7L/N3v/cAkZxYlnmuZoD840ldbMI5KDbC4iO9NKwPKYdjYFCMAIIlBzYSFHxIJVYzRo2/8A==}+ cpu: [arm64]+ os: [android]+'@rollup/[email protected]':resolution: {integrity: sha512-2KOU574vD3gzcPSjxO0eyR5iWlnxxtmW1F5CkNOHmMlueKNCQkxR6+ekgWyVnz6zaZihpUNkGxjsYrkTJKhkaw==}cpu: [arm64]os: [darwin]+ '@rollup/[email protected]':+ resolution: {integrity: sha512-krw5uS2STmvJ02x0uTXHbqQNuz+9eZ1iw+qXk9dmW2gvV4jV7O2hEoOnuhFrpOPiel1mBFtqbxYZZtC46hXLOw==}+ cpu: [arm64]+ os: [darwin]+'@rollup/[email protected]':resolution: {integrity: sha512-gE5ACNSxHcEZyP2BA9TuTakfZvULEW4YAOtxl/A/YDbIir/wPKukde0BNPlnBiP88ecaN4BJI2TtAd+HKuZPQQ==}cpu: [x64]os: [darwin]+ '@rollup/[email protected]':+ resolution: {integrity: sha512-wsTxtgApb4PrOsNJIm0FZ1h3WvCC+k9uxLJ4ad75hgoS4NiRes2SoJFlDAyMwiUY8IssDqGcHbXuN0sx1tfF1A==}+ cpu: [x64]+ os: [darwin]+'@rollup/[email protected]':resolution: {integrity: sha512-GSxU6r5HnWij7FoSo7cZg3l5GPg4HFLkzsFFh0N/b16q5buW1NAWuCJ+HMtIdUEi6XF0qH+hN0TEd78laRp7Dg==}cpu: [arm64]os: [freebsd]+ '@rollup/[email protected]':+ resolution: {integrity: sha512-GUOnQlyZe3yAXhWOtOMsn5Qkrv5E5mZXa0thbARWi5Ei2szlVXJFQhddZ4HbAzh8q92w5twp+CQvs/eFanz9YQ==}+ cpu: [arm64]+ os: [freebsd]+'@rollup/[email protected]':resolution: {integrity: sha512-KGiGKGDg8qLRyOWmk6IeiHJzsN/OYxO6nSbT0Vj4MwjS2XQy/5emsmtoqLAabqrohbgLWJ5GV3s/ljdrIr8Qjg==}cpu: [x64]os: [freebsd]+ '@rollup/[email protected]':+ resolution: {integrity: sha512-/Y7f3QuxjzPKsjA/rfEDa3+0vXqyjmJ50Ln8dPpCmWkKTrUoWHG1cWhTqaAMLob2m2nESWuC7yGrREz019Ztqg==}+ cpu: [x64]+ os: [freebsd]+'@rollup/[email protected]':resolution: {integrity: sha512-46OzWeqEVQyX3N2/QdiU/CMXYDH/lSHpgfBkuhl3igpZiaB3ZIfSjKuOnybFVBQzjsLwkus2mjaESy8H41SzvA==}cpu: [arm]os: [linux]libc: [glibc]+ '@rollup/[email protected]':+ resolution: {integrity: sha512-81wiiX3v7aqy+T+bT61TJ78yJjRquqFFTTbAPt08imfQQzkPIW8t6aJbkTagtCCrXMNc9D66+geqlK7ydLPNqA==}+ cpu: [arm]+ os: [linux]+ libc: [glibc]+'@rollup/[email protected]':resolution: {integrity: sha512-lfgW3KtQP4YauqdPpcUZHPcqQXmTmH4nYU0cplNeW583CMkAGjtImw4PKli09NFi2iQgChk4e9erkwlfYem6Lg==}cpu: [arm]os: [linux]libc: [musl]+ '@rollup/[email protected]':+ resolution: {integrity: sha512-9kmDIvNZqdoHOBZgNtpTBeLWYO/LVipM3H/j62P8848/l/VPEQL6N3uxU9pvP1oZAsXyC2MEnFP3ovRjo7WYNQ==}+ cpu: [arm]+ os: [linux]+ libc: [musl]+'@rollup/[email protected]':resolution: {integrity: sha512-nn8mEyzMbdEJzT7cwxgObuwviMx6kPRxzYiOl6o/o+ChQq23gfdlZcUNnt89lPhhz3BYsZ72rp0rxNqBSfqlqw==}cpu: [arm64]os: [linux]libc: [glibc]+ '@rollup/[email protected]':+ resolution: {integrity: sha512-CcnXHWnXg69g+DX5VWL3FHts3qMRN2uVEHX+BZvGLdd07/gXkn3ePjYtO1LDJvxkGKVHMclKBRa1QUTH+6toYQ==}+ cpu: [arm64]+ os: [linux]+ libc: [glibc]+'@rollup/[email protected]':resolution: {integrity: sha512-l+QK99je2zUKGd31Gh+45c4pGDAqZSuWQiuRFCdHYC2CSiO47qUWsCcenrI6p22hvHZrDje9QjwSMAFL3iwXwQ==}cpu: [arm64]os: [linux]libc: [musl]+ '@rollup/[email protected]':+ resolution: {integrity: sha512-iFOibiHnTRuhrWLlRsOQFdZJJIa7S8OwkneJr4ocALP16u5yk6lWLINFwhHaEqBFMsKDUZofLkGos7+CPzGB3g==}+ cpu: [arm64]+ os: [linux]+ libc: [musl]++ '@rollup/[email protected]':+ resolution: {integrity: sha512-XnWYMI7euHlb5a871xPja+Gm7DRCFU+FGRrtS2sMq9N8FvqtpagUy6gD4YOemC5MRk9xbh8+jYMEJbigFQwsgA==}+ cpu: [loong64]+ os: [linux]+ libc: [glibc]++ '@rollup/[email protected]':+ resolution: {integrity: sha512-qGDAlO0U8xedCcsdRm9oaoQY8DAx/QT7uIxJWhCdx0ceIWX783UC9QSYkdpzAe29wNiVfp24+bZdQmn49o45SQ==}+ cpu: [loong64]+ os: [linux]+ libc: [musl]+'@rollup/[email protected]':resolution: {integrity: sha512-WbnJaxPv1gPIm6S8O/Wg+wfE/OzGSXlBMbOe4ie+zMyykMOeqmgD1BhPxZQuDqwUN+0T/xOFtL2RUWBspnZj3w==}cpu: [loong64]@@ -2290,56 +2795,122 @@ packages:os: [linux]libc: [glibc]+ '@rollup/[email protected]':+ resolution: {integrity: sha512-ru4H6ezD7ysA5EiEK6qkkaEb4modH8CTej6kUy/gQi20u3kB3G7Zn8snXXkeJSCOFKG/rbPPtM/+9Wgas1961w==}+ cpu: [ppc64]+ os: [linux]+ libc: [glibc]++ '@rollup/[email protected]':+ resolution: {integrity: sha512-2W4MO5WQVJnbJaZdvDb9rhBDuFU1nKIepPFpJUBsTh2k1YY2g+ODViaWuyOAjQ5cOP7NvrvLzt3wvHOoiAvc7w==}+ cpu: [ppc64]+ os: [linux]+ libc: [musl]+'@rollup/[email protected]':resolution: {integrity: sha512-TWrZb6GF5jsEKG7T1IHwlLMDRy2f3DPqYldmIhnA2DVqvvhY2Ai184vZGgahRrg8k9UBWoSlHv+suRfTN7Ua4A==}cpu: [riscv64]os: [linux]libc: [glibc]+ '@rollup/[email protected]':+ resolution: {integrity: sha512-+fxjfuoAmVMCYV5QyjoIpu0cp5DOiOTeqYFk1AVaxGr+/ravWLX89XfQmptsoWcaVy/TGf2hexzbUOrCQIL1CQ==}+ cpu: [riscv64]+ os: [linux]+ libc: [glibc]+'@rollup/[email protected]':resolution: {integrity: sha512-ieQljaZKuJpmWvd8gW87ZmSFwid6AxMDk5bhONJ57U8zT77zpZ/TPKkU9HpnnFrM4zsgr4kiGuzbIbZTGi7u9A==}cpu: [riscv64]os: [linux]libc: [musl]+ '@rollup/[email protected]':+ resolution: {integrity: sha512-jTn8JfHGL4djjFxPuM06LmNUJDsst2jeVlsd9OmIH6zc5sC9K6rIuO4YajXatLUpBmBKl6b35ro1QZocLi+tcA==}+ cpu: [riscv64]+ os: [linux]+ libc: [musl]+'@rollup/[email protected]':resolution: {integrity: sha512-/L3pW48SxrWAlVsKCN0dGLB2bi8Nv8pr5S5ocSM+S0XCn5RCVCXqi8GVtHFsOBBCSeR+u9brV2zno5+mg3S4Aw==}cpu: [s390x]os: [linux]libc: [glibc]+ '@rollup/[email protected]':+ resolution: {integrity: sha512-oCJCJL4pXsoDcP2QZ+JVlPTIRc6266zsIaeJJsWImmF7HO0W8nb6HuSgZlMWxJwaPf8ehbSw8yo0EUw925hKsA==}+ cpu: [s390x]+ os: [linux]+ libc: [glibc]+'@rollup/[email protected]':resolution: {integrity: sha512-XMLeKjyH8NsEDCRptf6LO8lJk23o9wvB+dJwcXMaH6ZQbbkHu2dbGIUindbMtRN6ux1xKi16iXWu6q9mu7gDhQ==}cpu: [x64]os: [linux]libc: [glibc]+ '@rollup/[email protected]':+ resolution: {integrity: sha512-W69hukhZ3KKNRCaMIEzKvcFye42hh0FE1+YoYaf5+Ikacuftoco6yO/xouz0hc5d5W/s3yBro5jRiuEE/Q5vUw==}+ cpu: [x64]+ os: [linux]+ libc: [glibc]+'@rollup/[email protected]':resolution: {integrity: sha512-m/P7LycHZTvSQeXhFmgmdqEiTqSV80zn6xHaQ1JSqwCtD1YGtwEK515Qmy9DcB2HK4dOUVypQxvhVSy06cJPEg==}cpu: [x64]os: [linux]libc: [musl]+ '@rollup/[email protected]':+ resolution: {integrity: sha512-qiXbGG2jkjXhzXpsFZSR2Xpb8DN/UaxYsbb/STbuR/6fpaDgRmmaq1B/LmtF2wQFOFOSsK2jdE0RZ3a0zHn4QA==}+ cpu: [x64]+ os: [linux]+ libc: [musl]++ '@rollup/[email protected]':+ resolution: {integrity: sha512-nWeM//hxv8mIo6jD7Hu4o48DVmV9pbV6gsKaWU+4NFyqHoPKwrkRiZGLKUhOBk8qNmDmpwFtPKg80Bo/Tn4xiQ==}+ cpu: [x64]+ os: [openbsd]++ '@rollup/[email protected]':+ resolution: {integrity: sha512-s62SQ/vgsRSvMwDkOEfTqfgASF0f26ZNaQuTA6Aok5lrikf89yI2W0gFHvZb2Jpgc6N8JnOKZgCK2iciO3CsxQ==}+ cpu: [arm64]+ os: [openharmony]+'@rollup/[email protected]':resolution: {integrity: sha512-4yodtcOrFHpbomJGVEqZ8fzD4kfBeCbpsUy5Pqk4RluXOdsWdjLnjhiKy2w3qzcASWd04fp52Xz7JKarVJ5BTg==}cpu: [arm64]os: [win32]+ '@rollup/[email protected]':+ resolution: {integrity: sha512-J6wGf8TVGbXJq+HH+ttTvrcfNKPbuZecV6KT1B8I18BC5IURUh5kl4Yl5OEP5eFIUoI5BWxCsyYMhFsDx8kekw==}+ cpu: [arm64]+ os: [win32]+'@rollup/[email protected]':resolution: {integrity: sha512-tmazCrAsKzdkXssEc65zIE1oC6xPHwfy9d5Ta25SRCDOZS+I6RypVVShWALNuU9bxIfGA0aqrmzlzoM5wO5SPQ==}cpu: [ia32]os: [win32]+ '@rollup/[email protected]':+ resolution: {integrity: sha512-zmfrQd/0wu6oJs8Vq8KwY/YtsKSsLtKe/HwAP4Wqy8LhWjeT55fHRAkOhYQ12wI3ayS4Tt12d5CDRD7N96SAYQ==}+ cpu: [ia32]+ os: [win32]++ '@rollup/[email protected]':+ resolution: {integrity: sha512-qPzHqdj9rfUD+w79dtE07zi/kFwKyCJqplp5K5ygeLTp7jLpAoc16OAH39HSmRC9UpozaecsleI8uAdEj6v2yw==}+ cpu: [x64]+ os: [win32]+'@rollup/[email protected]':resolution: {integrity: sha512-h1J+Yzjo/X+0EAvR2kIXJDuTuyT7drc+t2ALY0nIcGPbTatNOf0VWdhEA2Z4AAjv6X1NJV7SYo5oCTYRJhSlVA==}cpu: [x64]os: [win32]- '@rtsao/[email protected]':- resolution: {integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==}-- '@rushstack/[email protected]':- resolution: {integrity: sha512-5EwMtOqvJMMa3HbmxLlF74e+3/HhwBTMcvt3nqVJgGCozO6hzIPOBlwm8mGVNR9SN2IJpxSnlxczyDjcn7qIyw==}+ '@rollup/[email protected]':+ resolution: {integrity: sha512-zD6NdeWEByGE9QF9vCrlJ5YQB4oq9q91kPZS37Jwj5hOkvR1lTBSpsKhKDw4IJtbQ35LsTS1HD9DZYGKIshU1Q==}+ cpu: [x64]+ os: [win32]'@s2-dev/[email protected]':resolution: {integrity: sha512-dtm+oFHVE8szINwOUoNQdx9xpGSJOrcAEvsxspPFvomjYKGnmhIRmU4OX8o6kxcPoiK76S1tPeU0smjZdmOngA==}@@ -2353,127 +2924,261 @@ packages:'@selderee/[email protected]':resolution: {integrity: sha512-P33hHGdldxGabLFjPPpaTxVolMrzrcegejx+0GxjrIb9Zv48D8yAIA/QTDR2dFl7Uz7urX8aX6+5bCZslr+gWQ==}- '@sentry-internal/[email protected]':- resolution: {integrity: sha512-G3z4HCUyb5nJe03EPUhWjnaHqMDt4mOTFJDNha3DGoB51lMYojpQI1Qo1u6bY4qkWVSO1c+HqOU0RVsXoAchtQ==}+ '@sentry/[email protected]':+ resolution: {integrity: sha512-p4q8gn8wcFqZGP/s2MnJCAAd8fTikaU6A0mM97RDHQgStcrYiaS0Sc5zUNfb1V+UOLPuvdEdL6MwyxfzjYJQTA==}+ engines: {node: '>= 18'}++ '@sentry/[email protected]':+ resolution: {integrity: sha512-IvjhafF5NFXrPCg5EHbAPGDwIhHxgUcLlHTklZ3DAdA6ky88BJYMfevbcnOEmgavf4nylhCaquRUFNB5+szj+A==}engines: {node: '>=18'}- '@sentry-internal/[email protected]':- resolution: {integrity: sha512-LQmIbQaATlN5QEwCD2Xt+7VKfwfR5W3dbn0jdF1x4hQFE/srdnOj60xMz/mj3tP5BxV552xJniGsyZ8lXHDb2A==}+ '@sentry/[email protected]':+ resolution: {integrity: sha512-IK6+J+8H06tZe+A8L37TT5ZxxwNtyQatW8zl5RYYJ/e9CsjrM8fPi8I1OT7uquTw8UtjqFHt7bEef/Vy63ksPg==}engines: {node: '>=18'}- '@sentry-internal/[email protected]':- resolution: {integrity: sha512-MhDMJeRGa55a0D541+OzTFMWwbabthhDGbAL90/NpappfyeBbAiktmCNl0BFTZuRbCGrC2m1LLCqHegCVKW4fQ==}+ '@sentry/[email protected]':+ resolution: {integrity: sha512-L5T60sWdAI3qWwdg3Ptwek/0TY59PERrxyqp4XMUkroayQvGd9r5dIW9Q1kSeXX9iJ442nXbFZKAOyCKV4Z13Q==}+ engines: {node: '>= 18'}++ '@sentry/[email protected]':+ resolution: {integrity: sha512-M+a32VOZVeTUxF+QecQ+OHYj8hb5FeppKwwWpTQ9cfS6ixgoNUK7/B7NhB2XbfxE3F1BcGvOxyS+AB+fvPfSRQ==}+ engines: {node: '>= 18'}+ peerDependencies:+ rollup: '>=3.2.0'+ webpack: '>=5.0.0'+ peerDependenciesMeta:+ rollup:+ optional: true+ webpack:+ optional: true++ '@sentry/[email protected]':+ resolution: {integrity: sha512-udAVvcyfNa0R+95GvPz/+43/N3TC0TYKdkQ7D7jhPSzbcMc7l2fxRNN5yB3UpCA5fWFnW4toeaqwDBhb/Wh3LA==}+ engines: {node: '>=10'}+ os: [darwin]++ '@sentry/[email protected]':+ resolution: {integrity: sha512-q8mEcNNmeXMy5i+jWT30TVpH7LcP4HD21CD5XRSPAd/a912HF6EpK0ybf/1USO14WOhoXbAGi9txwaWabSe33g==}+ engines: {node: '>=10'}+ cpu: [arm64]+ os: [linux, freebsd, android]++ '@sentry/[email protected]':+ resolution: {integrity: sha512-pD0LAt5PcUzAinBwvDqc66x9+2CabHEv486yP0gRjWO7SakbaxmfVq/EXd8VLq/Tzi39LAu422UYK1lpW3MILw==}+ engines: {node: '>=10'}+ cpu: [arm]+ os: [linux, freebsd, android]++ '@sentry/[email protected]':+ resolution: {integrity: sha512-q8vNJi1eOV/4vxAFWBsEwLHoSYapaZHIf4j76KJGJXFKTkEbsjCOOsKbwUIBTQQhRgV4DFWh3ryfsPS/que4Kg==}+ engines: {node: '>=10'}+ cpu: [x86, ia32]+ os: [linux, freebsd, android]++ '@sentry/[email protected]':+ resolution: {integrity: sha512-DZu956Mhi3ZRjTBe1WdbGV46ldVbA8d2rgp/fh51GsI25zjBHah4wZnPTSzpc+YqxU6pJpg579B/r3jrIK530Q==}+ engines: {node: '>=10'}+ cpu: [x64]+ os: [linux, freebsd, android]++ '@sentry/[email protected]':+ resolution: {integrity: sha512-nj0Ff/kmAB73EPDhR8B4O9r+NUHK5GkPCkGWC+kXVemqAJWL5jcJ5KdxG0l/S0z6RoEoltID8/43/B+TaMlT7A==}+ engines: {node: '>=10'}+ cpu: [arm64]+ os: [win32]++ '@sentry/[email protected]':+ resolution: {integrity: sha512-WNZiDzPbgsEMQWq4avsQ391v/xWKJDIWWWo9GYl+N/w5qcYKkoDW7wQG7T9FasI6ENn68phChTOAPXXxbfAdOg==}+ engines: {node: '>=10'}+ cpu: [x86, ia32]+ os: [win32]++ '@sentry/[email protected]':+ resolution: {integrity: sha512-R35WJ17oF4D2eqI1DR2sQQqr0fjRTt5xoP16WrTu91XM2lndRMFsnjh+/GttbxapLCBNlrjzia99MJ0PZHZpgA==}+ engines: {node: '>=10'}+ cpu: [x64]+ os: [win32]++ '@sentry/[email protected]':+ resolution: {integrity: sha512-baBcNPLLfUi9WuL+Tpri9BFaAdvugZIKelC5X0tt0Zdy+K0K+PCVSrnNmwMWU/HyaF/SEv6b6UHnXIdqanBlcg==}+ engines: {node: '>= 10'}+ hasBin: true++ '@sentry/[email protected]':+ resolution: {integrity: sha512-fO9PLmHdVURcSPUpWCItWAtgKiMwGdJHbovoSEyLplX5sxs2ugvI4CBPTrkkgqhObnZOD0CnWBKDzSVQYBKEyQ==}+ engines: {node: '>=14'}++ '@sentry/[email protected]':+ resolution: {integrity: sha512-ozhCTDqg89oB4XmWfAwuHshABpvT7AkRpaPnogopPfMAaI61G1t8EKCJ4W7aum8JSBonlfyjPCyW5oYZFm0KvA==}engines: {node: '>=18'}- '@sentry-internal/[email protected]':- resolution: {integrity: sha512-ZkH+Gahn89JygpuiFn26ZgAqJXHtnr+HjfQ2ONOFoWQHNH6X5wk75UTma55aYk1d8VcBPFoU6WjFhZoQ55SV1g==}+ '@sentry/[email protected]':+ resolution: {integrity: sha512-6VQn2ETJjHkk4QQDdx/587/JDfXsk3yBTLZ3UZOMtBVrkmwgk+1FJZ8ULJ3ud1xZcuh2icunIkc7tGVv2axdnw==}engines: {node: '>=18'}- '@sentry/[email protected]':- resolution: {integrity: sha512-5h2WXRJ6swKA0TwxHHryC8M2QyOfS9QhTAL6ElPfkEYe9HhJieXmxsDpyspbqAa26ccnCUcmwE5vL34jAjt4sQ==}- engines: {node: '>= 14'}+ '@sentry/[email protected]':+ resolution: {integrity: sha512-HL6hoEARpdL/NH3uIQ/O9BczP5P3QLSWerQgv8C4/vZl3JPQOWmFsJEN0F8/dU4+OFqlPz3P52InZjaYO3MA+w==}+ engines: {node: '>=18'}+ peerDependencies:+ next: ^13.2.0 || ^14.0 || ^15.0.0-rc.0 || ^16.0.0-0- '@sentry/[email protected]':- resolution: {integrity: sha512-yPwWWQo/hpN63p0NGmk/Dd1Fx5CQRWNMfuV7dtfPBtg3vRjDecA9OLyK29AqK5h3Fl8FuJOyOqB87CvtXUqh5g==}+ '@sentry/[email protected]':+ resolution: {integrity: sha512-oPOEVVNxv5WHtckx2i06Wi9FLWyvOg/1DUeX732jZ4iqT2nupINaMH4nF4f4kSvUThFnxkFSRQxwqOxgzMKhKA==}engines: {node: '>=18'}+ peerDependencies:+ '@opentelemetry/api': ^1.9.0+ '@opentelemetry/core': ^1.30.1 || ^2.1.0+ '@opentelemetry/exporter-trace-otlp-http': '>=0.57.0 <1'+ '@opentelemetry/instrumentation': '>=0.57.1 <1'+ '@opentelemetry/sdk-trace-base': ^1.30.1 || ^2.1.0+ peerDependenciesMeta:+ '@opentelemetry/api':+ optional: true+ '@opentelemetry/core':+ optional: true+ '@opentelemetry/exporter-trace-otlp-http':+ optional: true+ '@opentelemetry/instrumentation':+ optional: true+ '@opentelemetry/sdk-trace-base':+ optional: true- '@sentry/[email protected]':- resolution: {integrity: sha512-lqOCvmOPzKiQenIMhmm5/mwCntwFy0dPZbVD28Dnr3MXpT1rIBg1HXjfnqQWFlMRbL9haSsWiY/TQyR/6b30YA==}- engines: {node: '>= 14'}+ '@sentry/[email protected]':+ resolution: {integrity: sha512-SPOOVxmKTVIEtqvOKkQT163e/pOwucjS7OPsCHyRs8sFR4nfBNu0EThplyqnvqd5BWBMTPH6WTBQfo+QWHV+HA==}+ engines: {node: '>=18'}++ '@sentry/[email protected]':+ resolution: {integrity: sha512-UNV/2tqypcUK6FDzerAsFJn1Km/c4VZCYkUZDNbnV5S0cwAq2BYKMo4M5vovaLDBQlxA+Wk9ovbxi5wYjjl9fw==}+ engines: {node: '>=18'}+ peerDependencies:+ '@opentelemetry/api': ^1.9.0+ '@opentelemetry/core': ^1.30.1 || ^2.1.0+ '@opentelemetry/sdk-trace-base': ^1.30.1 || ^2.1.0++ '@sentry/[email protected]':+ resolution: {integrity: sha512-j1d/4hvoaUVKs5GRrfmwUCkiEmkfaeHsk+xgausZlzg5YvmwpF+gyevBLNP26GFEH7nyHXW4l8dbbo0eNieJmw==}+ engines: {node: '>=18'}+ peerDependencies:+ react: ^16.14.0 || 17.x || 18.x || 19.x++ '@sentry/[email protected]':+ resolution: {integrity: sha512-irzpw22bK5CF3jbecDa0gBUcfjv7tgeUoLAvtIfeHOP5ajmf3o4Cp99a9RQqkfgvkcMeRZBUwE91SQhp6Ank+w==}+ engines: {node: '>=18'}++ '@sentry/[email protected]':+ resolution: {integrity: sha512-xMnSGzJn9Xd29rYd32lkx/gFW+5mtgqADJ2FiZvis0MBGZuDlNRwPn0/Cs1xA3JNXKV3NGfhdmmvs90w4dHSmw==}+ engines: {node: '>=18'}++ '@sentry/[email protected]':+ resolution: {integrity: sha512-rzegZjMFFgCp3o+N8+XU13rfSvz4B+f8rU0ijBGrQcHdMNyfsFDTu1UTm262JofmrV2u+s+D0u0vFTnqtOGkbA==}+ engines: {node: '>=18'}++ '@sentry/[email protected]':+ resolution: {integrity: sha512-RJgatvWPLq7fm8tTiwH8oQ0TyHPzn4kr9kXFjqTsUsbnVyfZm4/jZ88V0vP05y/GHh/WjLQAGNqOajR9scduZA==}+ engines: {node: '>=18'}++ '@sentry/[email protected]':+ resolution: {integrity: sha512-J3a0BvUZ75Qxy+v/Ap3Hx4ZEcSjlPHZ/jDtxdRhXQCyNeEb8xq0uUBTI9VLtGk2eNeNucOxOEJ5ngqdNjnEH/A==}+ engines: {node: '>= 18'}+ peerDependencies:+ webpack: '>=5.0.0'++ '@sindresorhus/[email protected]':+ resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==}+ engines: {node: '>=18'}++ '@socket.io/[email protected]':+ resolution: {integrity: sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==}- '@sentry/[email protected]':- resolution: {integrity: sha512-7pS3pu/SuhE6jOn3wptstAg6B5nUP878O6s+2svT7b5fKNfYUi/6NPK6dAveh2Ca0rwVq40TO4YFJabWMgTpdQ==}+ '@standard-schema/[email protected]':+ resolution: {integrity: sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==}++ '@swc/[email protected]':+ resolution: {integrity: sha512-GsoMtan3ojGGMGFbl31mmRu5ctZ56re8grGE8mO/OHJ8O+JRkzod02fe7X6ZQ8JvamA3imkEkx/h3u+vsOgPgA==}engines: {node: '>=10'}+ cpu: [arm64]os: [darwin]- '@sentry/[email protected]':- resolution: {integrity: sha512-EzYCEnnENBnS5kpNW+2dBcrPZn1MVfywh2joGVQZTpmgDL5YFJ59VOd+K0XuEwqgFI8BSNI14KXZ75s4DD1/Vw==}+ '@swc/[email protected]':+ resolution: {integrity: sha512-leTi7Rx3KF4zcC637iqWgk9SoV8VXAD8ppQYXsep63px5A/UftOcxLN1pmr8Z1si/YvX90ompP/rHgpYkgwXWg==}engines: {node: '>=10'}- cpu: [arm64]- os: [linux, freebsd]+ cpu: [x64]+ os: [darwin]- '@sentry/[email protected]':- resolution: {integrity: sha512-wNUvquD6qjOCczvuBGf9OiD29nuQ6yf8zzfyPJa5Bdx1QXuteKsKb6HBrMwuIR3liyuu0duzHd+H/+p1n541Hg==}+ '@swc/[email protected]':+ resolution: {integrity: sha512-hBqHuoWKKIsKmDBn9qVeWqj5GWZhtlcczVaqQmNRXsDfq+voR5CxKRfamA367QjJXtceYuliLFfEL8QsskRM2g==}engines: {node: '>=10'}cpu: [arm]- os: [linux, freebsd]+ os: [linux]- '@sentry/[email protected]':- resolution: {integrity: sha512-urpQCWrdYnSAsZY3udttuMV88wTJzKZL10xsrp7sjD/Hd+O6qSLVLkxebIlxts70jMLLFHYrQ2bkRg5kKuX6Fg==}+ '@swc/[email protected]':+ resolution: {integrity: sha512-TBxvRz+B4K205TWHHZxWVxkC2RFNP/Mz3PNcECBos5PsKwxjg3QSJzdoebr0VCf0Bfh8HOPldKxAP/8XkFe9gA==}engines: {node: '>=10'}- cpu: [x86, ia32]- os: [linux, freebsd]+ cpu: [arm64]+ os: [linux]+ libc: [glibc]++ '@swc/[email protected]':+ resolution: {integrity: sha512-3Yu3Uq/VgytqsPjTMbkPU1ExADytbdWbruJYhA584E9jrpE2Ki+R6VVPoZCeAVk1Cb7QxcRTgblw6bSa6a/R+w==}+ engines: {node: '>=10'}+ cpu: [arm64]+ os: [linux]+ libc: [musl]- '@sentry/[email protected]':- resolution: {integrity: sha512-ZqpYwHXAaK4MMEFlyaLYr6mJTmpy9qP6n30jGhLTW7kHKS3s6GPLCSlNmIfeClrInEt0963fM633ZRnXa04VPw==}+ '@swc/[email protected]':+ resolution: {integrity: sha512-wfdMi5IaOaNtmh2/6geRoxIdNfqylUZFdtzTKS655y1axWfIWyx7As74vv0wVdjeCIZ3WmCI9odDd4rUttXOSQ==}+ engines: {node: '>=10'}+ cpu: [ppc64]+ os: [linux]+ libc: [glibc]++ '@swc/[email protected]':+ resolution: {integrity: sha512-3hHYBY0yx8Ez7GMRrkhXHQzMdR5IZA6Wq5Ee4svlgwvSECLpnAJ9+0AimEGUFDvuLwE7nV/2+PYe8+Nm4rvNcQ==}+ engines: {node: '>=10'}+ cpu: [s390x]+ os: [linux]+ libc: [glibc]++ '@swc/[email protected]':+ resolution: {integrity: sha512-TjfhjgP/jGCfFHYC3JQPhJA1HwErbIJ9JfREDc1KNkvY6P0LodCgKVIlQ5deeTbkG7ih3bF5PHJLuLpaZjdRyQ==}+ engines: {node: '>=10'}+ cpu: [x64]+ os: [linux]+ libc: [glibc]++ '@swc/[email protected]':+ resolution: {integrity: sha512-CQpS8Ge/avfjZd0UEwG/sds83Uu32deQXcV1Jo3jD0mmvQQqtYAjpsDZXugmheeAwmt+YIuoVtVHro8LMYHqsQ==}engines: {node: '>=10'}cpu: [x64]- os: [linux, freebsd]+ os: [linux]+ libc: [musl]++ '@swc/[email protected]':+ resolution: {integrity: sha512-0W8IKHsUTYiT7G2RqtOoVWk+89yzZikIiDUb/sCK6BmQDBhN91hQSfyUtW12jhEWLzYgcfmisfsZrmZE+84U1A==}+ engines: {node: '>=10'}+ cpu: [arm64]+ os: [win32]- '@sentry/[email protected]':- resolution: {integrity: sha512-AuRimCeVsx99DIOr9cwdYBHk39tlmAuPDdy2r16iNzY0InXs4xOys4gGzM7N4vlFQvFkzuc778Su0HkfasgprA==}+ '@swc/[email protected]':+ resolution: {integrity: sha512-ZIp49d2Z4/ka2jO9otOg4hDvTdPmp86kVOgS2M5FCPI7eKKZ1W0boxWn+8XeZrfERtFGW0AlMRm4JhlJa7l3NA==}engines: {node: '>=10'}- cpu: [x86, ia32]+ cpu: [ia32]os: [win32]- '@sentry/[email protected]':- resolution: {integrity: sha512-6JcPvXGye61+wPp0xdzfc2YLE/Dcud8JdaK8VxLM3b/8+Em7E+UyliDu3uF8+YGUqizY5JYTd3fs17DC8DZhLw==}+ '@swc/[email protected]':+ resolution: {integrity: sha512-2h8Iek95vnixkBRCo+H8p09+Q5ll2NgSMFrWTy0iKt7+/t+8/T5mBpiT6c0ZxSS7wcWjwZ9sGZkK70tTSYHdDw==}engines: {node: '>=10'}cpu: [x64]os: [win32]- '@sentry/[email protected]':- resolution: {integrity: sha512-0GVmDiTV7R1492wkVY4bGcfC0fSmRmQjuxaaPI8CIV9B2VP9pBVCUizi1mevXaaE4I3fM60LI+XYrKFEneuVog==}- engines: {node: '>= 10'}- hasBin: true-- '@sentry/[email protected]':- resolution: {integrity: sha512-SxQ4z7wTkfguvYb2ctNEMU9kVAbhl9ymfjhLnrvtygTwL5soLqAKdco/lX/4P9K9Osgb2Dl6urQWRl+AhzKVbQ==}- engines: {node: '>=18'}-- '@sentry/[email protected]':- resolution: {integrity: sha512-t4kSVX6B+ECmZxyiUjawzdZ9CQlaJA30Hctlxps76QMussmFyKhlmrT9L4+wGRllytCE3cUpryRYdy8SyIpSvg==}- engines: {node: '>=18'}- peerDependencies:- next: ^13.2.0 || ^14.0 || ^15.0.0-rc.0-- '@sentry/[email protected]':- resolution: {integrity: sha512-XzphoVImlKh+wjeKYSaZlH4aQVuw8I63RH6juCktMBKnjTfR9aZkHWeiFc4YghHU2jPXjKTKvGFRkU45xIGr1g==}- engines: {node: '>=18'}-- '@sentry/[email protected]':- resolution: {integrity: sha512-kvHj0n0Gk5H482dU6UH+UrccMBPqbjYadwNdb61kMNy5H/xkFcCDKZ8wm3TawlnuiPxzzf4orofiR6Pn/IW6uA==}- engines: {node: '>=18'}- peerDependencies:- '@opentelemetry/api': ^1.9.0- '@opentelemetry/context-async-hooks': ^1.30.1- '@opentelemetry/core': ^1.30.1- '@opentelemetry/instrumentation': ^0.57.1- '@opentelemetry/sdk-trace-base': ^1.30.1- '@opentelemetry/semantic-conventions': ^1.28.0-- '@sentry/[email protected]':- resolution: {integrity: sha512-/ruDHBHLDXmZoEHNCSjdekZr9+0pbOC5+BY1oABGoDXRISGyoenOBtAsX8TsaC9oJYhr16yKDFlYxzzQRhxDyg==}- engines: {node: '>=18'}- peerDependencies:- react: ^16.14.0 || 17.x || 18.x || 19.x-- '@sentry/[email protected]':- resolution: {integrity: sha512-zqtd5L2sn4yGdxvMDEHUI6+7blkO305w2ATPz06jwChS6oCKoSHZfrLPZygChKhk9bzM1D6IWg/3uyGdntfj/A==}- engines: {node: '>=18'}-- '@sentry/[email protected]':- resolution: {integrity: sha512-BTG1m+5c3PcuzjUphB7vQESo91VdT8FT+Ngzbf58OOTtiMDEJ35FtJX1ww36QE7G6vlSpdT/NyZKsY6t+mgJfg==}- engines: {node: '>= 14'}+ '@swc/[email protected]':+ resolution: {integrity: sha512-FbsO5JcfOjfH38W/rohBRBweJeERsAuIP4f377lmkmxTcq9exjtx4SkRuZY5CdfhR2CBVwDIJegBpJDffwNsOg==}+ engines: {node: '>=10'}peerDependencies:- webpack: '>=4.40.0'-- '@sindresorhus/[email protected]':- resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==}- engines: {node: '>=18'}-- '@socket.io/[email protected]':- resolution: {integrity: sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==}+ '@swc/helpers': '>=0.5.17'+ peerDependenciesMeta:+ '@swc/helpers':+ optional: true'@swc/[email protected]':resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==}@@ -2481,8 +3186,8 @@ packages:'@swc/[email protected]':resolution: {integrity: sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==}- '@swc/[email protected]':- resolution: {integrity: sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==}+ '@swc/[email protected]':+ resolution: {integrity: sha512-V6Mnml8v09QALx6K0elJ7o9K/MkVDtW3t6L+7Ou/JcWtb3xwId2AH4FeOceySd2JaO87IMw4+6vSZxLm34LPbw==}'@t3-oss/[email protected]':resolution: {integrity: sha512-zVOiYO0+CF7EnBScz8s0O5JnJLPTU0lrUi8qhKXfIxIJXvI/jcppSiXXsEJwfB4A6XZawY/Wg/EQGKANi/aPmQ==}@@ -2570,9 +3275,6 @@ packages:'@ts-morph/[email protected]':resolution: {integrity: sha512-Wf29UqxWDpc+i61k3oIOzcUfQt79PIT9y/MWfAGlrkjg6lBC1hwDECLXPVJAhWjiGbfBCxZd65F/LIZF3+jeJQ==}- '@tybys/[email protected]':- resolution: {integrity: sha512-VyyPYFlOMNylG45GoAe0xDoLwWuowvf92F9kySqzYh8vmYm7D2u4iUJKa1tOUpS70Ku13ASrOkS4ScXFsTaCNQ==}-'@tybys/[email protected]':resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==}@@ -2582,9 +3284,6 @@ packages:'@types/[email protected]':resolution: {integrity: sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==}- '@types/[email protected]':- resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==}-'@types/[email protected]':resolution: {integrity: sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==}@@ -2606,6 +3305,9 @@ packages:'@types/[email protected]':resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==}+ '@types/[email protected]':+ resolution: {integrity: sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==}+'@types/[email protected]':resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==}@@ -2615,6 +3317,9 @@ packages:'@types/[email protected]':resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==}+ '@types/[email protected]':+ resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==}+'@types/[email protected]':resolution: {integrity: sha512-dNKVfHd/jk0SkR/exKGj2ggkB45MAkzvWCaqLUUgkyjITkGNzH8H+yUwr+BLJUBjZOe9w8X3wgmXhZDRg1ED6A==}@@ -2624,9 +3329,6 @@ packages:'@types/[email protected]':resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}- '@types/[email protected]':- resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==}-'@types/[email protected]':resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==}@@ -2636,42 +3338,26 @@ packages:'@types/[email protected]':resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==}- '@types/[email protected]':- resolution: {integrity: sha512-DSLCOXhkvfS5WNNPbfn2KdICAmk8lLc+/PNvnPnF7gOdMZCxopXduqv0OQ13y/yA/zXTSikZZqVgybUxOEg6YQ==}-'@types/[email protected]':resolution: {integrity: sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA==}'@types/[email protected]':resolution: {integrity: sha512-k6Gi8Yyo8EtrNtkHXutUu2corfDf9su95VYVP10aGYMMROM6SAItZi0w1XszA6RtWTHSVp5OeFof37w0IEqCQg==}- '@types/[email protected]':- resolution: {integrity: sha512-TaAUE5rq2VQYxab5Ts7WZhKNmuN78Q6PiFonTDdpbx8a1H0M1vhy3rhiMjl+e2iHmogyMw7jZF4FrE6eJUy5HQ==}-- '@types/[email protected]':- resolution: {integrity: sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==}-- '@types/[email protected]':- resolution: {integrity: sha512-hCZTSvwbzWGvhqxp/RqVqwU999pBf2vp7hzIjiYOsl8wqOmUxkQ6ddw1cV3l8811+kdUFus/q4d1Y3E3SyEifA==}-'@types/[email protected]':resolution: {integrity: sha512-te7NQcV2BOvdj2b1hCAHzAoMNuj65kNBMz0KBaxM6c3VGBOhU0dURQKOtH8CFNI/dsKkwlv32p26qYQTWoB5bw==}- '@types/[email protected]':- resolution: {integrity: sha512-qW1Mfv8taImTthu4KoXgDfLuk4bydU6Q/TkADnDWWHwi4NX4BR+LWfTp2sVmTqRrsHvyDDTelgelxJ+SsejKKQ==}-- '@types/[email protected]':- resolution: {integrity: sha512-D2wOSq/d6Agt28q7rSI3jhU7G6aiuzljDGZ2hTZHIkrTLUI+AF3WMeKkEZ9nN2fkBAlcktT6vcZjDFiIhMYEQw==}+ '@types/[email protected]':+ resolution: {integrity: sha512-Bsc+QHgp+P/F02XDzNCY9jnZNCUuLki36KT7VKrTXXLdHf+vHMNZnW1rVu5DNW/rCK+fya3DATySbLM4yhtKUw==}+ peerDependencies:+ '@types/react': ^19.2.0- '@types/[email protected]':- resolution: {integrity: sha512-UE7oxhQLLd9gub6JKIAhDq06T0F6FnztwMNRvYgjeQSBeMc1ZG/tA47EwfduvkuQS8apbkM/lpLpWsaCeYsXVg==}+ '@types/[email protected]':+ resolution: {integrity: sha512-AnzbBERsrLKtk2XSfTbYRLjQPdy116Sty4q+T+Bp3IC4l6jNBvreVPAHmpq9qhXQM7CXZPjLVmGMw9sy+hxQ3w==}'@types/[email protected]':resolution: {integrity: sha512-xMAgYwceFhRA2zY+XbEA7mxYbA093wdiW8Vu6gZPGWy9cmOyU9XesH1tNcEWsKFd5Vzrqx5T3D38PWx1FIIXkA==}- '@types/[email protected]':- resolution: {integrity: sha512-KHPsfX/FoVbUGbyYvk1q9MMQHLPeRZhRJZdO45Q4YjvFkv4hMNghCWTvy7rdKessBsmtz4euWCWAB6/tVpI1Iw==}-'@types/[email protected]':resolution: {integrity: sha512-P/oDfpofrdtF5xw433SPALpdSchtJmY7nsJItf8h3KXqOslkbySh8zq4dSWXH2oTjRvJ5PczVEoCZPow6GicLg==}@@ -2687,269 +3373,9 @@ packages:'@types/[email protected]':resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==}- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-w/EboPlBwnmOBtRbiOvzjD+wdiZdgFeo17lkltrtn7X37vagKKWJABvyfsJXTlHe6XBzugmYgd4A4nW+k8Mixw==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- '@typescript-eslint/parser': ^8.40.0- eslint: ^8.57.0 || ^9.0.0- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-lRyPDLzNCuae71A3t9NEINBiTn7swyOhvUj3MyUOxb8x6g6vPEFoOU+ZRmGMusNC3X3YMhqMIX7i8ShqhT74Pw==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- '@typescript-eslint/parser': ^8.56.0- eslint: ^8.57.0 || ^9.0.0 || ^10.0.0- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-jCNyAuXx8dr5KJMkecGmZ8KI61KBUhkCob+SD+C+I5+Y1FWI2Y3QmY4/cxMCC5WAsZqoEtEETVhUiUMIGCf6Bw==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- eslint: ^8.57.0 || ^9.0.0- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-IgSWvLobTDOjnaxAfDTIHaECbkNlAlKv2j5SjpB2v7QHKv1FIfjwMy8FsDbVfDX/KjmCmYICcw7uGaXLhtsLNg==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- eslint: ^8.57.0 || ^9.0.0 || ^10.0.0- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-/A89vz7Wf5DEXsGVvcGdYKbVM9F7DyFXj52lNYUDS1L9yJfqjW/fIp5PgMuEJL/KeqVTe2QSbXAGUZljDUpArw==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-M3rnyL1vIQOMeWxTWIW096/TtVP+8W3p/XnaFflhmcFp+U4zlxUxWj4XwNs6HbDeTtN4yun0GNTTDBw/SvufKg==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-y9ObStCcdCiZKzwqsE8CcpyuVMwRouJbbSrNuThDpv16dFAj429IkM6LNb1dZ2m7hK5fHyzNcErZf7CEeKXR4w==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-7UiO/XwMHquH+ZzfVCfUNkIXlp/yQjjnlYUyYz7pfvlK3/EyyN6BK+emDmGNyQLBtLGaYrTAI6KOw8tFucWL2w==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-jtMytmUaG9d/9kqSl/W3E3xaWESo4hFDxAIHGVW/WKKtQhesnRIJSAJO6XckluuJ6KDB5woD1EiqknriCtAmcw==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-bSJoIIt4o3lKXD3xmDh9chZcjCz5Lk8xS7Rxn+6l5/pKrDpkCwtQNQQwZ2qRPk7TkUYhrq3WPIHXOXlbXP0itg==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-eE60cK4KzAc6ZrzlJnflXdrMqOBaugeukWICO2rB0KNvwdIMaEaYiywwHMzA1qFpTxrLhN9Lp4E/00EgWcD3Ow==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- eslint: ^8.57.0 || ^9.0.0- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-qX2L3HWOU2nuDs6GzglBeuFXviDODreS58tLY/BALPC7iu3Fa+J7EOTwnX9PdNBxUI7Uh0ntP0YWGnxCkXzmfA==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- eslint: ^8.57.0 || ^9.0.0 || ^10.0.0- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-ETdbFlgbAmXHyFPwqUIYrfc12ArvpBhEVgGAxVYSwli26dn8Ko+lIo4Su9vI9ykTZdJn+vJprs/0eZU0YMAEQg==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-DBsLPs3GsWhX5HylbP9HNG15U0bnwut55Lx12bHB9MpXxQ+R5GC8MwQe+N1UFXxAeQDvEsEDY6ZYwX03K7Z6HQ==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-k1z9+GJReVVOkc1WfVKs1vBrR5MIKKbdAjDTPvIK3L8De6KbFfPFt6BKpdkdk7rZS2GtC/m6yI5MYX+UsuvVYQ==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-ex1nTUMWrseMltXUHmR2GAQ4d+WjkZCT4f+4bVsps8QEdh0vlBsaCokKTPlnqBFqqGaxilDNJG7b8dolW2m43Q==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-Cgzi2MXSZyAUOY+BFwGs17s7ad/7L+gKt6Y8rAVVWS+7o6wrjeFN4nVfTpbE25MNcxyJ+iYUXflbs2xR9h4UBg==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- eslint: ^8.57.0 || ^9.0.0- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-RZ3Qsmi2nFGsS+n+kjLAYDPVlrzf7UhTffrDIKr+h2yzAlYP/y5ZulU0yeDEPItos2Ph46JAL5P/On3pe7kDIQ==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- eslint: ^8.57.0 || ^9.0.0 || ^10.0.0- typescript: '>=4.8.4 <6.0.0'-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-8CZ47QwalyRjsypfwnbI3hKy5gJDPmrkLjkgMxhi0+DZZ2QNx2naS6/hWoVYUHU7LU2zleF68V9miaVZvhFfTA==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}-- '@typescript-eslint/[email protected]':- resolution: {integrity: sha512-q+SL+b+05Ud6LbEE35qe4A99P+htKTKVbyiNEe45eCbJFyh/HVK9QXwlrbz+Q4L8SOW4roxSVwXYj4DMBT7Ieg==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}-- '@typescript/[email protected]':- resolution: {integrity: sha512-Mj8Mh+aTaGWURK65VuMxyOBhy+9OfXCHCL63zJPr/PqTNKub+GgGpGYKfSlbDBkqkB8UgURlI2CDRUoyOfvufQ==}- cpu: [arm64]- os: [darwin]-- '@typescript/[email protected]':- resolution: {integrity: sha512-txn4CJ7/zj+WcSdDL5nshs9he7M0DF5qZBU5glWAJP+uIZmRSyuxDoWZqtjrzmX+vs5IOzyKgYcDsBYFkjybwA==}- cpu: [x64]- os: [darwin]-- '@typescript/[email protected]':- resolution: {integrity: sha512-aGCr3/g1ktJ+IRjLEWTdNmG3H2iwPWt9tBu7spRnIIvDcdlEHFf8NQ2Mwn3n54bVnXAN5nYxZmM7WEYYfNvD6w==}- cpu: [arm64]- os: [linux]-- '@typescript/[email protected]':- resolution: {integrity: sha512-gw+O550PhazyzsAi/oq1xztMM1PWSXtxq38tN15e/dRh0BXOt0bDUoEgIzFD0L5OkmiOlEIknROqvAVNa4QH3g==}- cpu: [arm]- os: [linux]-- '@typescript/[email protected]':- resolution: {integrity: sha512-KAE4W+5VVRagA+xI6AxCSMVx2zb+8t15lMcB1cH5rIU2ZpnYa8K2ZXpSRMZGKNIFzcg6tKF9RyZvh4zMwZDnkQ==}- cpu: [x64]- os: [linux]-- '@typescript/[email protected]':- resolution: {integrity: sha512-KUYWl+0tYShKoFKp0BAxECmLClT7qnhN5UEW9tsSih9tDka//qnQcWFx452Rw3fiQCqXjkntgwFFXrrvltQMpQ==}- cpu: [arm64]- os: [win32]-- '@typescript/[email protected]':- resolution: {integrity: sha512-bje8xm+b0q3OSCY01/MZdDBnVISURunL9rCAob8pAu8qtRMvKYGWUsYwTH+fXGUViPAmdlafFd2E82K9VJYmHA==}- cpu: [x64]- os: [win32]-- '@typescript/[email protected]':- resolution: {integrity: sha512-czUniBl1MsempdDkeDwfKThhHkeQzyLxn2aVcsCTSk2Ys84M8yy2eRdUZQrufwLL1Etcz+bv3SvZbBMcnPk/Ig==}- hasBin: true-'@ungap/[email protected]':resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==}- '@unrs/[email protected]':- resolution: {integrity: sha512-ppLRUgHVaGRWUx0R0Ut06Mjo9gBaBkg3v/8AxusGLhsIotbBLuRk51rAzqLC8gq6NyyAojEXglNjzf6R948DNw==}- cpu: [arm]- os: [android]-- '@unrs/[email protected]':- resolution: {integrity: sha512-lCxkVtb4wp1v+EoN+HjIG9cIIzPkX5OtM03pQYkG+U5O/wL53LC4QbIeazgiKqluGeVEeBlZahHalCaBvU1a2g==}- cpu: [arm64]- os: [android]-- '@unrs/[email protected]':- resolution: {integrity: sha512-gPVA1UjRu1Y/IsB/dQEsp2V1pm44Of6+LWvbLc9SDk1c2KhhDRDBUkQCYVWe6f26uJb3fOK8saWMgtX8IrMk3g==}- cpu: [arm64]- os: [darwin]-- '@unrs/[email protected]':- resolution: {integrity: sha512-cFzP7rWKd3lZaCsDze07QX1SC24lO8mPty9vdP+YVa3MGdVgPmFc59317b2ioXtgCMKGiCLxJ4HQs62oz6GfRQ==}- cpu: [x64]- os: [darwin]-- '@unrs/[email protected]':- resolution: {integrity: sha512-fqtGgak3zX4DCB6PFpsH5+Kmt/8CIi4Bry4rb1ho6Av2QHTREM+47y282Uqiu3ZRF5IQioJQ5qWRV6jduA+iGw==}- cpu: [x64]- os: [freebsd]-- '@unrs/[email protected]':- resolution: {integrity: sha512-u92mvlcYtp9MRKmP+ZvMmtPN34+/3lMHlyMj7wXJDeXxuM0Vgzz0+PPJNsro1m3IZPYChIkn944wW8TYgGKFHw==}- cpu: [arm]- os: [linux]-- '@unrs/[email protected]':- resolution: {integrity: sha512-cINaoY2z7LVCrfHkIcmvj7osTOtm6VVT16b5oQdS4beibX2SYBwgYLmqhBjA1t51CarSaBuX5YNsWLjsqfW5Cw==}- cpu: [arm]- os: [linux]-- '@unrs/[email protected]':- resolution: {integrity: sha512-34gw7PjDGB9JgePJEmhEqBhWvCiiWCuXsL9hYphDF7crW7UgI05gyBAi6MF58uGcMOiOqSJ2ybEeCvHcq0BCmQ==}- cpu: [arm64]- os: [linux]- libc: [glibc]-- '@unrs/[email protected]':- resolution: {integrity: sha512-RyMIx6Uf53hhOtJDIamSbTskA99sPHS96wxVE/bJtePJJtpdKGXO1wY90oRdXuYOGOTuqjT8ACccMc4K6QmT3w==}- cpu: [arm64]- os: [linux]- libc: [musl]-- '@unrs/[email protected]':- resolution: {integrity: sha512-D8Vae74A4/a+mZH0FbOkFJL9DSK2R6TFPC9M+jCWYia/q2einCubX10pecpDiTmkJVUH+y8K3BZClycD8nCShA==}- cpu: [ppc64]- os: [linux]- libc: [glibc]-- '@unrs/[email protected]':- resolution: {integrity: sha512-frxL4OrzOWVVsOc96+V3aqTIQl1O2TjgExV4EKgRY09AJ9leZpEg8Ak9phadbuX0BA4k8U5qtvMSQQGGmaJqcQ==}- cpu: [riscv64]- os: [linux]- libc: [glibc]-- '@unrs/[email protected]':- resolution: {integrity: sha512-mJ5vuDaIZ+l/acv01sHoXfpnyrNKOk/3aDoEdLO/Xtn9HuZlDD6jKxHlkN8ZhWyLJsRBxfv9GYM2utQ1SChKew==}- cpu: [riscv64]- os: [linux]- libc: [musl]-- '@unrs/[email protected]':- resolution: {integrity: sha512-kELo8ebBVtb9sA7rMe1Cph4QHreByhaZ2QEADd9NzIQsYNQpt9UkM9iqr2lhGr5afh885d/cB5QeTXSbZHTYPg==}- cpu: [s390x]- os: [linux]- libc: [glibc]-- '@unrs/[email protected]':- resolution: {integrity: sha512-C3ZAHugKgovV5YvAMsxhq0gtXuwESUKc5MhEtjBpLoHPLYM+iuwSj3lflFwK3DPm68660rZ7G8BMcwSro7hD5w==}- cpu: [x64]- os: [linux]- libc: [glibc]-- '@unrs/[email protected]':- resolution: {integrity: sha512-rV0YSoyhK2nZ4vEswT/QwqzqQXw5I6CjoaYMOX0TqBlWhojUf8P94mvI7nuJTeaCkkds3QE4+zS8Ko+GdXuZtA==}- cpu: [x64]- os: [linux]- libc: [musl]-- '@unrs/[email protected]':- resolution: {integrity: sha512-5u4RkfxJm+Ng7IWgkzi3qrFOvLvQYnPBmjmZQ8+szTK/b31fQCnleNl1GgEt7nIsZRIf5PLhPwT0WM+q45x/UQ==}- engines: {node: '>=14.0.0'}- cpu: [wasm32]-- '@unrs/[email protected]':- resolution: {integrity: sha512-nRcz5Il4ln0kMhfL8S3hLkxI85BXs3o8EYoattsJNdsX4YUU89iOkVn7g0VHSRxFuVMdM4Q1jEpIId1Ihim/Uw==}- cpu: [arm64]- os: [win32]-- '@unrs/[email protected]':- resolution: {integrity: sha512-DCEI6t5i1NmAZp6pFonpD5m7i6aFrpofcp4LA2i8IIq60Jyo28hamKBxNrZcyOwVOZkgsRp9O2sXWBWP8MnvIQ==}- cpu: [ia32]- os: [win32]-- '@unrs/[email protected]':- resolution: {integrity: sha512-lrW200hZdbfRtztbygyaq/6jP6AKE8qQN2KvPcJ+x7wiD038YtnYtZ82IMNJ69GJibV7bwL3y9FgK+5w/pYt6g==}- cpu: [x64]- os: [win32]-'@upstash/[email protected]':resolution: {integrity: sha512-7qJHGxpQgQr9/vmeS1PktEwvNAF7TI4iJDi8Pu2CFZ9YUGHZH4fOP5TfYlZ4aVxfopnELiE4BS4FBjyK7V1/xQ==}engines: {node: '>=16.0.0'}@@ -3089,11 +3515,6 @@ packages:resolution: {integrity: sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==}engines: {node: '>= 0.6'}- resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==}- peerDependencies:- acorn: ^8-resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}peerDependencies:@@ -3104,6 +3525,11 @@ packages:engines: {node: '>=0.4.0'}hasBin: true+ resolution: {integrity: sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==}+ engines: {node: '>=0.4.0'}+ hasBin: true+resolution: {integrity: sha512-yQHZAU4UkWegGY2vmgg1TYAoKQDFPX5NUAI57P0BXhgB6wDGBNVhgBuXUkid8mxVviF8OMVr4yxMvax2nnY0Cw==}engines: {node: ^18.0.0 || >=20.0.0}@@ -3133,6 +3559,9 @@ packages:resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}+ resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==}+resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==}@@ -3211,10 +3640,6 @@ packages:resolution: {integrity: sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==}engines: {node: '>= 0.4'}- resolution: {integrity: sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==}- engines: {node: '>= 0.4'}-resolution: {integrity: sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==}engines: {node: '>= 0.4'}@@ -3235,9 +3660,6 @@ packages:resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==}engines: {node: '>=12'}- resolution: {integrity: sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==}-resolution: {integrity: sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg==}engines: {node: '>=4'}@@ -3264,20 +3686,16 @@ packages:resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==}engines: {node: '>= 0.4'}- resolution: {integrity: sha512-Xm7bpRXnDSX2YE2YFfBk2FnF0ep6tmG7xPh8iHee8MIcrgq762Nkce856dYtJYLkuIoYZvGfTs/PbZhideTcEg==}- engines: {node: '>=4'}-- resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==}- engines: {node: '>= 0.4'}-resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==}resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}+ resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==}+ engines: {node: 18 || 20 || >=22}+resolution: {integrity: sha512-3XSA2cR/h/73EzlXXdU6YNycmYI7+kicTxks4eJg2g39biHR84slg2+des+p7iHYhbRg/udIS4TD53WabcOUkw==}engines: {node: '>= 0.4'}@@ -3309,12 +3727,16 @@ packages:resolution: {integrity: sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==}engines: {node: '>=18'}- resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==}+ resolution: {integrity: sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==}resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==}+ resolution: {integrity: sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==}+ engines: {node: 20 || >=22}+resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}engines: {node: '>=8'}@@ -3322,9 +3744,6 @@ packages:resolution: {integrity: sha512-oTKjJdShmDuGW94SyyaoQvAjf30dZaHnjJ8uAF+u2/vGJkJbJPJAT1gDiOJP5v1Zb6f9KEyW/1HpuaWIXtGHPg==}- resolution: {integrity: sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==}-resolution: {integrity: sha512-0si2SJK3ooGzIawRu61ZdPCO1IncZwS8IzuX73sPZsXW6EQ/w/DAfPyKI8l1ETTCr2MnvqWitmlCUxgdul45jA==}engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}@@ -3363,8 +3782,8 @@ packages:resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==}engines: {node: '>= 0.4'}- resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==}+ resolution: {integrity: sha512-a/hy+pNsFUTR+Iz8TCJvXudKVLAnz/DyeSUo10I5yvFDQJBFU2s9uqQpoSrJlroHUKoKqzg+epxyP9lqFdzfBQ==}engines: {node: '>= 0.4'}@@ -3386,10 +3805,6 @@ packages:resolution: {integrity: sha512-e4QKw/O2Kavj2VQTKZWrwzkt3IxOmIlU6ajRb6LP64LHpBo1J67k2Hi4Vu/TgJWsNtynurfS0uK3MaUTCPfu5Q==}- resolution: {integrity: sha512-ej1sPFR5+0YWtaVp6S1N1FVz69TQCqmrkGeRvQxZeAB1nAIcjNTHVwrZtYtWFFBmQsF40/uDLehsW5KuYC99mg==}- engines: {node: ^18.12.0 || >= 20.9.0}-resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==}@@ -3397,10 +3812,6 @@ packages:resolution: {integrity: sha512-5nFxhUrX0PqtyogoYOA8IPswy5sZFTOsBFl/9bNsmDLgsxYTzSZQJDPppDnZPTQbzSEm0hqGjWPzRemQCYbD6A==}engines: {node: '>=18'}- resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==}- engines: {node: '>=8'}-resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}engines: {node: '>=10'}@@ -3433,16 +3844,10 @@ packages:resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==}engines: {node: '>= 14.16.0'}- resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==}-resolution: {integrity: sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==}engines: {node: '>=6.0'}- resolution: {integrity: sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==}-resolution: {integrity: sha512-4bHTS2YuzUvtoLjdy+98ykbNB5jS0+07EvFNXerqZQJ89F7DI6ET7OQo/HJuW6K0aVsKA9hj9/RVb2kQVOrPDQ==}@@ -3510,9 +3915,17 @@ packages:resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}+ resolution: {integrity: sha512-p2FdgwVx1a9yWBHP2wI0VgShkDpgN4kZISkxdNipGBJWpa5G6b04OINlVWCyJj0JmfvcPrgqt95E9k8yvaOJFg==}+ engines: {node: '>=12.20'}+resolution: {integrity: sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==}+ resolution: {integrity: sha512-Bb6Cq8oq0IjDOe8wJmi4JeNn763Xs9cfrBcaylK1tPypWzyoy2G3l90v9k64kjphl/ZJjPIShFztenRomi8WTg==}+ engines: {node: '>=18'}+resolution: {integrity: sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==}engines: {node: '>=12.5.0'}@@ -3610,11 +4023,8 @@ packages:engines: {node: '>=4'}hasBin: true- resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==}-- resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==}+ resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==}resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==}@@ -3639,14 +4049,6 @@ packages:resolution: {integrity: sha512-xRetU6gL1VJbs85Mc4FoEGSjQxzpdxRyFhe3lmWFyy2EzydIcD4xzUvRJMD+NPDfMwKNhxa3PvsIOU32luIWeA==}engines: {node: '>=18'}- resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}- peerDependencies:- supports-color: '*'- peerDependenciesMeta:- supports-color:- optional: true-resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==}engines: {node: '>=6.0'}@@ -3678,16 +4080,9 @@ packages:resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==}engines: {node: '>=0.10.0'}- resolution: {integrity: sha512-8vDa8Qxvr/+d94hSh5P3IJwI5t8/c0KsMp+g8bNw9cY2icONa5aPfvKeieW1WlG0WQYwwhJ7mjui2xtiePQSXw==}-resolution: {integrity: sha512-c6fcElNV6ShtZXmsgNgFFV5tVX2PaV4g+MOAkb8eXHvn6sryJBrZa9r0zV6+dtTyoCKxtDy5tyQ5ZwQuidtd+Q==}- resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==}- engines: {node: '>=10'}-resolution: {integrity: sha512-HGFtf8yhuhGhqO07SV79tRp+br4MnbdjeVxotpn1QBl30pcLLCQjX5b2295ll0fv8RKDKsmWYrl05usHM9CewQ==}peerDependencies:@@ -3700,10 +4095,6 @@ packages:resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==}engines: {node: '>=6'}- resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==}- engines: {node: '>=4.0.0'}-resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==}@@ -3737,8 +4128,8 @@ packages:resolution: {integrity: sha512-lgdERlL3u0aUdHocoouzT10d9I89VVhk0qNRmll7mXdGfJT1/wqZ2ZLA4oJAjeACPY5fT1wsbq2AT+GkuInsow==}- resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==}+ resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==}engines: {node: '>=8'}@@ -3794,6 +4185,10 @@ packages:resolution: {integrity: sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w==}engines: {node: '>=12'}+ resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==}+ engines: {node: '>=12'}+resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==}engines: {node: '>= 0.4'}@@ -3832,6 +4227,9 @@ packages:resolution: {integrity: sha512-SjWyZBHJPbqxHOzckOfo8lHisEaJWmwd23XppYFYVh10bU66/Pn5tkVkbkCMZVdbUE5eTCI2nD8OyIP4Z+uwkA==}+ resolution: {integrity: sha512-LRlerrMYoIDrT6jgpeZ2YYl/L8EulRTt5hQcYjy5AInh7HWXKimpqx68aknBFpGL2+/IcogTcaydJEgaTmOpDg==}+resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==}@@ -3845,9 +4243,6 @@ packages:resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==}engines: {node: '>= 0.8'}- resolution: {integrity: sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==}-resolution: {integrity: sha512-GeZeeRjpD2qf49cZQ0Wvh/8NJNfeXkXXcoGh+F77oEAgo9gUHwT1fCRxSNU+YEEaysOJTnsFHmM5oAcPy4ntvQ==}@@ -3890,8 +4285,12 @@ packages:resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==}- resolution: {integrity: sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==}+ resolution: {integrity: sha512-6PMWXpdhshVvFp+FoWYs1EvG1Nj0tvk0dZM+XcK0xMEM1czRVcP6ohqPWHy6qPagSpC8j4+p89WXlT+xXJs/fg==}+ engines: {node: '>= 0.4'}++ resolution: {integrity: sha512-2FpH9Q5i2RRwyEP1AylXe6nYLR5OhaJTZwmlcP0dL/+JCbgg7yyEo/sEK6HeGZRf3dFpWwThaRHVApXSkW3xeg==}engines: {node: '>= 0.4'}@@ -3902,8 +4301,8 @@ packages:resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==}engines: {node: '>= 0.4'}- resolution: {integrity: sha512-uDn+FE1yrDzyC0pCo961B2IHbdM8y/ACZsKD4dG6WqrjV53BADjwa7D+1aom2rsNVfLyDgU/eigvlJGJ08OQ4w==}+ resolution: {integrity: sha512-c/A0P0oxkACDc+cKWw8evLXK83oBKgn0qPOqCYT4x9uolpCIJAcYvJC9QYKNDRPsTeGyCrQ326jrvgZWdCdK5Q==}engines: {node: '>= 0.4'}@@ -3916,6 +4315,10 @@ packages:resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==}engines: {node: '>= 0.4'}+ resolution: {integrity: sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==}+ engines: {node: '>= 0.4'}+resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==}engines: {node: '>= 0.4'}@@ -3924,8 +4327,8 @@ packages:resolution: {integrity: sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==}engines: {node: '>= 0.4'}- resolution: {integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==}+ resolution: {integrity: sha512-yPDz7wqpg1/mmHLmS3tcfTfbw5f1eryXvyghYBffGdERwe+mV7ZcWzTR8LR17Kvqt3qfPurjlonmnq3MKXIOXw==}engines: {node: '>= 0.4'}@@ -3954,85 +4357,17 @@ packages:resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==}engines: {node: '>=12'}- resolution: {integrity: sha512-VDQwbajhNMFmrhLWVyUXCqsGPN+zz5G8Ys/QwFubfsxTIrkqdx3N3x3QPW+pERz8bzGPP0IgEm8cNbZcd8PFRQ==}- peerDependencies:- eslint: ^7.23.0 || ^8.0.0 || ^9.0.0- typescript: '>=3.3.1'- peerDependenciesMeta:- typescript:- optional: true-- resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==}-- resolution: {integrity: sha512-A1rHYb06zjMGAxdLSkN2fXPBwuSaQ0iO5M/hdyS0Ajj1VBaRp0sPD3dn1FhME3c/JluGFbwSxyCfqdSbtQLAHQ==}- engines: {node: ^14.18.0 || >=16.0.0}- peerDependencies:- eslint: '*'- eslint-plugin-import: '*'- eslint-plugin-import-x: '*'- peerDependenciesMeta:- eslint-plugin-import:- optional: true- eslint-plugin-import-x:- optional: true-- resolution: {integrity: sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw==}- engines: {node: '>=4'}- peerDependencies:- '@typescript-eslint/parser': '*'- eslint: '*'- eslint-import-resolver-node: '*'- eslint-import-resolver-typescript: '*'- eslint-import-resolver-webpack: '*'- peerDependenciesMeta:- '@typescript-eslint/parser':- optional: true- eslint:- optional: true- eslint-import-resolver-node:- optional: true- eslint-import-resolver-typescript:- optional: true- eslint-import-resolver-webpack:- optional: true-- resolution: {integrity: sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==}- engines: {node: '>=4'}- peerDependencies:- '@typescript-eslint/parser': '*'- eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9- peerDependenciesMeta:- '@typescript-eslint/parser':- optional: true-- resolution: {integrity: sha512-scB3nz4WmG75pV8+3eRUQOHZlNSUhFNq37xnpgRkCCELU3XMvXAxLk1eqWWyE22Ki4Q01Fnsw9BA3cJHDPgn2Q==}- engines: {node: '>=4.0'}- peerDependencies:- eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9-- resolution: {integrity: sha512-qSQpAw7RcSzE3zPp8FMGkthaCWovHZ/BsXtpmnGax9vQLIovlh1bsZHEa2+j2lv9DWhnyeLM/qZmp7ffQZfQvg==}- engines: {node: '>=16.6.0'}+ resolution: {integrity: sha512-zOIEYyv1TSn2izXkyg/yj0LXc4YBQI6pl3xIFWwMCcXt/dgQCz8dBqXiXFMoM3xc/GqZThAtaGYo8aPu/vBd+Q==}+ engines: {node: '>=16.9.0'}peerDependencies:eslint: '>=8.40.0'- resolution: {integrity: sha512-+f15FfK64YQwZdJNELETdn5ibXEUQmW1DZL6KXhNnc2heoy/sg9VJJeT7n8TlMWouzWqSWavFkIhHyIbIAEapg==}- engines: {node: '>=10'}- peerDependencies:- eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0-- resolution: {integrity: sha512-jOknh8c7kVan2W1eES+Po2jAkmW98e/ltF01qw9fpSDMockGWo0MvSzzgSUuBN/Dl1eHN9F0pc6/AgTACmOqbw==}+ resolution: {integrity: sha512-HgYol2zhH3KbnW9Q4FY/FcIINbsYVL6rwQESChqBC2s9SLWtw1wg05+J7SCrr3BfQpNY2ReYhf8xjpd2JhKJOQ==}engines: {node: '>=14.0.0'}peerDependencies:- eslint: '>=7.0.0'+ eslint: '>=8.40.0'resolution: {integrity: sha512-Qteup0SqU15kdocexFNAJMvCJEfa2xUKNV4CC1xsVMrIIqEy3SQ/rqyxCWNzfrd3/ldy6HMlD2e0JDVpDg2qIA==}@@ -4044,35 +4379,21 @@ packages:resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==}engines: {node: '>=8.0.0'}- resolution: {integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}-- resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==}- engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0}- peerDependencies:- eslint: '>=5'-- resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==}- engines: {node: '>=10'}+ resolution: {integrity: sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==}+ engines: {node: ^20.19.0 || ^22.13.0 || >=24}resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==}engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}- resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}-resolution: {integrity: sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==}engines: {node: ^20.19.0 || ^22.13.0 || >=24}- resolution: {integrity: sha512-TS9bTNIryDzStCpJN93aC5VRSW3uTx9sClUn4B87pwiCaJh220otoI0X8mJKr+VcPtniMdN8GKjlwgWGUv5ZKA==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}+ resolution: {integrity: sha512-wqA7W2jbsC/BnV9Iv1UZpKVFkO1AdNoSmYW8NWG4HNOBbkAMvIqDZ27pI2f07dqn583NcIC44ckjAcOXDL1QbQ==}+ engines: {node: ^20.19.0 || ^22.13.0 || >=24}hasBin: truepeerDependencies:jiti: '*'@@ -4080,17 +4401,17 @@ packages:jiti:optional: true- resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}+ resolution: {integrity: sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==}+ engines: {node: ^20.19.0 || ^22.13.0 || >=24}resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==}engines: {node: '>=4'}hasBin: true- resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==}+ resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==}engines: {node: '>=0.10'}@@ -4167,10 +4488,6 @@ packages:resolution: {integrity: sha512-jpWzZ1ZhwUmeWRhS7Qv3mhpOhLfwI+uAX4e5fOcXqwMR7EcJ0pj2kV1CVzHVMX/LphnKWD3LObjZCoJ71lKpHw==}engines: {node: ^18.19.0 || >=20.5.0}- resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==}- engines: {node: '>=6'}-resolution: {integrity: sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA==}engines: {node: '>=12.0.0'}@@ -4194,10 +4511,6 @@ packages:resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}- resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==}- engines: {node: '>=8.6.0'}-resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==}engines: {node: '>=8.6.0'}@@ -4238,6 +4551,9 @@ packages:resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==}engines: {node: ^12.20 || >= 14.13}+ resolution: {integrity: sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==}+resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==}engines: {node: '>=18'}@@ -4296,9 +4612,6 @@ packages:resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==}engines: {node: '>=12.20.0'}- resolution: {integrity: sha512-alTFZZQDKMporBH77856pXgzhEzaUVmLCDk+egLgIgHst3Tpndzz8MnKe+GzRJRfvVdn69HhpW7cmXzvtLvJAw==}-resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==}engines: {node: '>= 0.6'}@@ -4324,16 +4637,10 @@ packages:resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==}engines: {node: '>= 0.8'}- resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==}-resolution: {integrity: sha512-eXvGGwZ5CL17ZSwHWd3bbgk7UUpF6IFHtP57NYYakPvHOs8GDgDe5KJI36jIJzDkJ6eJjuzRA8eBQb6SkKue0g==}engines: {node: '>=14.14'}- resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}-resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}@@ -4347,8 +4654,8 @@ packages:resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==}- resolution: {integrity: sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==}+ resolution: {integrity: sha512-jObKIik1P2QjPHP5nz5BaOtUlfgS0fWo8IUByNXkM+o+02sJOi94em77GwJKQSJ3gfPHdgzLNrHc1uokV4P/ew==}engines: {node: '>= 0.4'}@@ -4368,6 +4675,10 @@ packages:resolution: {integrity: sha512-a4tiq7E0/5fTjxPAaH4jpjkSv/uCaU2p5KC6HVGrvl0cDjA8iBZv4vv1gyzlmK0ZUKqwpOyQMKzZQe3lTit77A==}engines: {node: '>=14'}+ resolution: {integrity: sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==}+ engines: {node: '>= 0.4'}+resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==}engines: {node: '>=6.9.0'}@@ -4415,9 +4726,6 @@ packages:resolution: {integrity: sha512-auHyJ4AgMz7vgS8Hp3N6HXSmlMdUyhSUrfBF16w153rxtLIEOE+HGqaBppczZvnHLqQJfiHotCYpNhl0lUROFQ==}- resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==}-resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}engines: {node: '>= 6'}@@ -4438,20 +4746,20 @@ packages:resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==}hasBin: true- resolution: {integrity: sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==}- engines: {node: '>=16 || 14 >=14.17'}+ resolution: {integrity: sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==}+ engines: {node: 18 || 20 || >=22}resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==}engines: {node: '>=4'}- resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==}- engines: {node: '>=8'}+ resolution: {integrity: sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==}+ engines: {node: '>=18'}- resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==}+ resolution: {integrity: sha512-Z2I8hM+PbJDXQDq3Icgpzv+mPdwr68iZUU9d5WW4FuXfDUQfkZaZuvjMv42/5crNyw154+9+VWXbYrUgDXbxNw==}engines: {node: '>=18'}@@ -4481,9 +4789,6 @@ packages:resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}- resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==}-resolution: {integrity: sha512-mS1lbMsxgQj6hge1XZ6p7GPhbrtFwUFYi3wRzXAC/FmYnyXMTvvI3td3rjmQ2u8ewXueaSvRPWaEcgVVOT9Jnw==}engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0}@@ -4523,6 +4828,10 @@ packages:resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}engines: {node: '>= 0.4'}+ resolution: {integrity: sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==}+ engines: {node: '>= 0.4'}+resolution: {integrity: sha512-48+B/rJWAp0jamNbAAf9M7Uf//UVqAoMmgXhBdxTDJLGKY+LRnZ99qcG+Qjl5HfMpYNzS5v4EAwVEF34LeAj7w==}@@ -4535,9 +4844,6 @@ packages:resolution: {integrity: sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ==}- resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==}-resolution: {integrity: sha512-K6GVpucS5wFf44X0h2bLVRDsycgJmf9FF2elg+CrqD8GcFU8c6vYhgXn8NjUkFCwj+xDFb70qgLbTUm6sxwPmA==}@@ -4583,8 +4889,8 @@ packages:engines: {node: '>=18'}hasBin: true- resolution: {integrity: sha512-fXHXcGFTXOvZTSkPJuGOQf5Lv5T/R2itiiCVPg9LxAje5D00O0pP83yJShFq5V89Ly//Gt6acj7z8pbBr34stw==}+ resolution: {integrity: sha512-XtqmnT+b9n5MX+MsqluFAVTIenbtC25iskW0Z+jLd+awfhA+ZbWKWQMIvLJccGoa2bM1R6juWJ27cZxIFOmkWw==}resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}@@ -4594,6 +4900,9 @@ packages:resolution: {integrity: sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==}engines: {node: '>=0.10.0'}+ resolution: {integrity: sha512-X9gLFtipsP4HHbmy9urh+palImTR9P6lyhvmgbP6iym8i0IwhcsS4Z6KMjkEoCU6O16OJT5JIZkd8xfDROYo/A==}+resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}@@ -4601,10 +4910,6 @@ packages:resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==}engines: {node: '>= 4'}- resolution: {integrity: sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==}- engines: {node: '>= 4'}-resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==}@@ -4612,11 +4917,8 @@ packages:resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==}engines: {node: '>=6'}- resolution: {integrity: sha512-k2V9wNm9B+ysuelDTHjI9d5KPc4l8zAZTGqj+pcynvWkypZd857ryzN8jNC7Pg2YZXNMJcHRPpaDyCBbNyVRpA==}-- resolution: {integrity: sha512-v4+k+PLt4z6g2ydEcXhfinTJxfgKJDWOW0v0GZNA5n2qToHFObpH4nGLhJdwnXnX4T14oREx/M62dS9GkpmSbQ==}+ resolution: {integrity: sha512-AiohS3H80sXO6owEltjGX+glb7qXaDhBoJb9XcQVH4UI207xu/bDLUcadVKp7Qe576reg9yr/PXZjV5qx8gfbA==}engines: {node: '>=18'}@@ -4630,9 +4932,6 @@ packages:resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}- resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==}-resolution: {integrity: sha512-0aO8FkhNZlj/ZIbNi7Lxxr12obT7cL1moPfE4tg1LkX7LlLfC6DeX4l2ZEud1ukP9jNQyNnfzQVqwbwmAATY4Q==}@@ -4640,8 +4939,8 @@ packages:resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==}engines: {node: '>= 0.4'}- resolution: {integrity: sha512-UmdmHUmp5CIKKjSoE10la5yfU+AYJAaiYLsodbjL4lji83JNvgOQUjGaGhGrpFCb0Uh7sl7qfP1IyILa8Z40ug==}+ resolution: {integrity: sha512-9f2VD1HFuxUvMw0RxsaP8WmMns6JRTnsNB/zghTFrp11ZktiXWwVDeZBPQchBKEmo+Gx/ZhxI7Qht7YglFD4PA==}resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==}@@ -4679,9 +4978,6 @@ packages:resolution: {integrity: sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==}engines: {node: '>= 0.4'}- resolution: {integrity: sha512-gNCGbnnnnFAUGKeZ9PdbyeGYJqewpmc2aKHUEMO5nQPWU9lOmv7jcmQIv+qHD8fXW6W7qfuCwX4rY9LNRjXrkQ==}-resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==}engines: {node: '>= 0.4'}@@ -4690,6 +4986,10 @@ packages:resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==}engines: {node: '>= 0.4'}+ resolution: {integrity: sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==}+ engines: {node: '>= 0.4'}+resolution: {integrity: sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==}engines: {node: '>= 0.4'}@@ -4701,6 +5001,10 @@ packages:resolution: {integrity: sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==}+ resolution: {integrity: sha512-+XSoyS05OdBbhFuELhgTCpFNHkpBOJqtsZfUFFpe5QTw+9Sjbh8zitxhQkYAo6wV7e1Vb8cAPvpCk9jGam/82g==}+ engines: {node: '>= 0.4'}+resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}engines: {node: '>=0.10.0'}@@ -4721,8 +5025,8 @@ packages:resolution: {integrity: sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==}engines: {node: '>=18'}- resolution: {integrity: sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==}+ resolution: {integrity: sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==}engines: {node: '>= 0.4'}@@ -4889,6 +5193,9 @@ packages:resolution: {integrity: sha512-s+3Al/p9g32Iq+oqXxkW//7jk2Vig6FF1CFqzVXoTUXt2qz89YWbL+OwS17NFYEvxC35n0FKeGO2LGYSxeM2Gg==}+ resolution: {integrity: sha512-qR0HB5uP6wCuRMrWPTrkMaev7MJZwJuuw4fnwAzRgP4J4/F8RwtodOKpGp4XpqsLBFzzgqIO42efFAyz2Et6KQ==}+resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}@@ -4926,10 +5233,6 @@ packages:resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==}- resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==}- hasBin: true-resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==}engines: {node: '>=6'}@@ -4970,13 +5273,6 @@ packages:'@types/node': '>=18'typescript: '>=5.0.4 <7'- resolution: {integrity: sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==}-- resolution: {integrity: sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==}- engines: {node: '>=0.10'}-resolution: {integrity: sha512-y+SqErxb8h7nE/fiEX07jsbuhrpO9lL8eca7/Y1nuWV2moNlXhyd59iDGcRf6moVyDMbmTNzL40SUyrFU/yDpg==}@@ -5056,6 +5352,10 @@ packages:resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==}+ resolution: {integrity: sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==}+ engines: {node: 20 || >=22}+resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==}@@ -5071,15 +5371,14 @@ packages:resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==}- resolution: {integrity: sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==}- engines: {node: '>=12'}+ resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==}- resolution: {integrity: sha512-GCXh3bq/WuMbS+Ky4JBPW1hYTOU+znU+Q5m9Pu+pI8EoUqIHk9+tviOKC6/qhHh8C4/As3tzJ69IF32kdz85ww==}+ resolution: {integrity: sha512-3SEQqTpV9oqVsIWqAcmDuaNeo7yBO3tqPtqGRcKkEo0lrzD3wqbKG9mkxO65KoOgXqj+zH2phJ2LiAsdzlogSw==}- resolution: {integrity: sha512-iDwf7mA03WPiR8QxvcVHmVWEPfMY1RZXerDVNCRYW7dUr2ppH3J58Rwb39/WG39yTZdRSxr3x+2v22tvI0VEvA==}+ resolution: {integrity: sha512-G/hncXrl4Qt7mauJEXSg3AcdYzmpkIITTNl5I+rH9sog5Yw0kK6vseJjCaPfOXqOqQuPUP89Rkhfz5kPS8ijtw==}resolution: {integrity: sha512-o5vL7aDWatOTX8LzaS1WMoaoxIiLRQJuIKKe2wAw6IeULDHaqbiqiggmx+pKvZDb1Sj+pE46Sn1T7lCqfFtg1Q==}@@ -5151,8 +5450,8 @@ packages:resolution: {integrity: sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==}engines: {node: '>=18'}- resolution: {integrity: sha512-nqXPXbso+1dcKDpPCXvwZyJILz+vSLqGGOnDrYHQYE+B8n9JTCekVLC65AfCpR4ggVyA/45Y0iR9LDyS2iI+zA==}+ resolution: {integrity: sha512-3+B21mYK2IqUWnd2EivABLT7ueDhb0b8/dGK8LoFQPrU61YITeCMn14F7y7qZafWNZhUEKb24cJdiT5Wxs3prg==}peerDependencies:'@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0peerDependenciesMeta:@@ -5166,6 +5465,10 @@ packages:resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}engines: {node: '>= 8'}+ resolution: {integrity: sha512-Sz8FzjzI0kN13GK/6MVEsVzMZEPvOhnmmI1lU5+/1cGOiK3QUahntrNNtdVeihrO7t9JpoH75iMNXg6R6uWflQ==}+ engines: {node: '>=18.0.0'}+resolution: {integrity: sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==}@@ -5303,10 +5606,6 @@ packages:resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==}engines: {node: '>=18'}- resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==}- engines: {node: '>=10'}-resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==}engines: {node: '>=4'}@@ -5314,16 +5613,12 @@ packages:resolution: {integrity: sha512-oxdmJ9cL+xV72h0xYxp4tP2d5/fTBpP45H8DIOn9pASuF8a3IYTf+25fMGDYGiWW+MFsuog6KD6nfmhZJQ+uUw==}- resolution: {integrity: sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==}- engines: {node: 20 || >=22}-- resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}+ resolution: {integrity: sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==}+ engines: {node: 18 || 20 || >=22}- resolution: {integrity: sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==}- engines: {node: '>=16 || 14 >=14.17'}+ resolution: {integrity: sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==}resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==}@@ -5332,19 +5627,13 @@ packages:resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}- resolution: {integrity: sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==}- engines: {node: '>=8'}-resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==}engines: {node: '>=16 || 14 >=14.17'}- resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==}-- resolution: {integrity: sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==}+ resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==}+ engines: {node: '>=16 || 14 >=14.17'}resolution: {integrity: sha512-EGWKgxALGMgzvxYF1UyGTy0HXX/2vHLkw6+NvDKW2jypWbHpjQuj4UMcqQWXHERJhVGKikolT06G3bcKe4fi7w==}@@ -5406,14 +5695,6 @@ packages:resolution: {integrity: sha512-Zt/AmG6qRU3e+WnzGGLuMCEAO/dAu45stNbHY223tUxldaDAeE+FxSPsd9Q+j+paejmm0ZbrNVs5Sraqy3dRxA==}- resolution: {integrity: sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==}-- resolution: {integrity: sha512-uTp172LLXSxuSYHv/kou+f6KW3SMppU9ivthaVTXian9sOt3XM/zHYHpRZiLgQoxeWfYUnslNWQHF1+G71xcow==}- engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0}- hasBin: true-resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}@@ -5428,41 +5709,48 @@ packages:resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==}- resolution: {integrity: sha512-3cKVflwdrqxCOvAL+DtGN68qR802i0PEj0dttkAD5IK5XxOjugQs4yU8aSakvPMbkOrhEJ+89z5lG2EAqi7Gkw==}+ resolution: {integrity: sha512-MxOUMGKncc/D6rofu0O80I6Ebr3gqlH8XiEb0Uu5TZmX7DqY3NVHs70Uy4bvtgWmHeDwsra6KU8EBtfRVGRv7Q==}++ resolution: {integrity: sha512-j7KnGWt4Ih6TnW1x714R8bX3H+DYP25fqLTYTfUzAFXh0Od57WuQYM/Sf58yalvIXhE6y8sBYHlrCFmr0jPy3g==}peerDependencies:- next: ^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0+ next: ^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0react: ^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 || ^19.0.0- typescript: ^5.0.0+ typescript: '*'peerDependenciesMeta:typescript:optional: true- resolution: {integrity: sha512-h9ctmOokpoDphRvMGnwOJAedT6zKhwqyZML9mDtspgf4Rh3Pn7UTYKqePNoDvhsWBAO5GoPNYshnAUGIazVGmw==}- engines: {node: '>=18.17.0'}+ resolution: {integrity: sha512-x6eDkZxk2rPpu46E1ZVUWIBhYCLszmUY6fvHBFcbzJ9dD+qRX6vcHusaqqDlnY+VngKzKbAiG2iRCkPbmi8f7w==}+ engines: {node: ^18.18.0 || ^19.8.0 || >= 20.0.0}+ deprecated: This version has a security vulnerability. Please upgrade to a patched version. See https://nextjs.org/blog/CVE-2025-66478 for more details.hasBin: truepeerDependencies:'@opentelemetry/api': ^1.1.0'@playwright/test': ^1.41.2- react: ^18.2.0- react-dom: ^18.2.0+ babel-plugin-react-compiler: '*'+ react: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0+ react-dom: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0sass: ^1.3.0peerDependenciesMeta:'@opentelemetry/api':optional: true'@playwright/test':optional: true+ babel-plugin-react-compiler:+ optional: truesass:optional: true- resolution: {integrity: sha512-x6eDkZxk2rPpu46E1ZVUWIBhYCLszmUY6fvHBFcbzJ9dD+qRX6vcHusaqqDlnY+VngKzKbAiG2iRCkPbmi8f7w==}+ resolution: {integrity: sha512-Y+xn8EQCoC3ZbsFPyzE+tE8XOdrWeUdUF7NeXbmg9DsgAxl5UYxlsrvgVESHTyTGigoTa1bCUrxn70F5bqt0Gw==}engines: {node: ^18.18.0 || ^19.8.0 || >= 20.0.0}hasBin: truepeerDependencies:'@opentelemetry/api': ^1.1.0- '@playwright/test': ^1.41.2+ '@playwright/test': ^1.51.1babel-plugin-react-compiler: '*'react: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0react-dom: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0@@ -5477,10 +5765,6 @@ packages:sass:optional: true- resolution: {integrity: sha512-zsFhmbkAzwhTft6nd3VxcG0cvJsT70rL+BIGHWVq5fi6MwGrHwzqKaxXE+Hl2GmnGItnDKPPkO5/LQqjVkIdFg==}- engines: {node: '>=10'}-resolution: {integrity: sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==}@@ -5489,6 +5773,10 @@ packages:engines: {node: '>=10.5.0'}deprecated: Use your platform's native DOMException instead+ resolution: {integrity: sha512-kXs9Go0cah0qHVV2v389IXQLdLCeE1xfFtjOAF+iobu0OIoG1pje8At2vMHyaPMiPMnG/LWP50twML21eMcAag==}+ engines: {node: '>= 0.4'}+resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==}engines: {node: 4.x || >=6.0.0}@@ -5560,10 +5848,6 @@ packages:resolution: {integrity: sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==}engines: {node: '>= 0.4'}- resolution: {integrity: sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==}- engines: {node: '>= 0.4'}-resolution: {integrity: sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==}engines: {node: '>= 0.4'}@@ -5602,13 +5886,43 @@ packages:resolution: {integrity: sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==}- resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==}+ resolution: {integrity: sha512-19YVAg7T+WTrxggPukVq7DjTv6+PJ867TmhCvBsYwmbFCsZd344rq2Ld1p0wo8f8Qrrhgp82c6FJRqdXWtSEhg==}engines: {node: '>= 0.4'}resolution: {integrity: sha512-qE/CIg/spwrTBFt5aKmwe3ifeDdLfA2NESN30E42X/lII5ClF8V7Wt6WIJhcGZjp0/Q+nQ+9vgxGk//xZNX2hg==}+ resolution: {integrity: sha512-XZ4GFBN/PLbXKq+0zrgpQfPKYuJlUuj+nzZJY7UpIbFMNyefNLCdN9EwViycNqnYcv0wrn0jXcQLlqJp8RCKBg==}+ engines: {node: ^20.19.0 || >=22.12.0}+ hasBin: true+ peerDependencies:+ svelte: ^5.0.0+ vite-plus: '*'+ peerDependenciesMeta:+ svelte:+ optional: true+ vite-plus:+ optional: true++ resolution: {integrity: sha512-KjK/XLcXr1DSyonKhsuFqJRiuKqcyG9j3LJ8nkOsrLzGvodBPqzHOKauy10asLMDI0sUpvb+1sxlzff3udZvfg==}+ hasBin: true++ resolution: {integrity: sha512-hVJ9hq9m2unPS+Of4eJJgCPdIeCC+3DHEUX3tkmrPJr3OK2hz7PhXwgC+ZP71ZcYu8cCDEtQrqLxWNvxBppBVg==}+ engines: {node: ^20.19.0 || >=22.12.0}+ hasBin: true+ peerDependencies:+ oxlint-tsgolint: '>=7.0.2001'+ vite-plus: '*'+ peerDependenciesMeta:+ oxlint-tsgolint:+ optional: true+ vite-plus:+ optional: true+resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==}engines: {node: '>=6'}@@ -5688,16 +6002,16 @@ packages:resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==}engines: {node: '>=16 || 14 >=14.18'}+ resolution: {integrity: sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==}+ engines: {node: 18 || 20 || >=22}+resolution: {integrity: sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==}resolution: {integrity: sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==}- resolution: {integrity: sha512-+vnG6S4dYcYxZd+CZxzXCNKdELYZSKfohrk98yajCo1PtRoDgCTrrwOvK1GT0UoAdVszagDVllQc0U1vaX4NUQ==}- engines: {node: '>=6'}-resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==}@@ -5705,24 +6019,13 @@ packages:resolution: {integrity: sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==}engines: {node: '>= 14.16'}- resolution: {integrity: sha512-IHZsA4T7YElCKNNXtiLgqScw4zPd3pG9do8UrznC757gMd7UPeHSL2qwNNMJo4r79fl8oj1Xx+1nh2YkzdMpLQ==}- engines: {node: '>=18'}+ resolution: {integrity: sha512-DlOzet0HO7OEnmUmB6wWGJrrdvbyJKftI1bhMitK7O2N8W2gc757yyYBbINy9IDafXAV9wmKr9t7xsTaNKRG5Q==}+ engines: {node: '>=20.16.0 || >=22.3.0'}resolution: {integrity: sha512-XIxfHpEuSJbITd1H3EeQwpcZbTLHc+VVr8ANI9t5sit565tsI4/xK3KWTUFE2e6QiangUkh3B0jihzmGnNrRsQ==}- resolution: {integrity: sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==}- engines: {node: '>=4.0.0'}-- resolution: {integrity: sha512-gjTHWGYWsEgy9MsY0Gp6ZJxV24IjDqdpTW7Eh0x+WfJLFsm/TJx1MzL6T0D88mBvkpxotCQ6TwW6N+Kko7lhgQ==}-- resolution: {integrity: sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==}- engines: {node: '>=4'}-resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}@@ -5734,6 +6037,10 @@ packages:resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==}engines: {node: '>=12'}+ resolution: {integrity: sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==}+ engines: {node: '>=12'}+resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==}engines: {node: '>=0.10'}@@ -5761,10 +6068,16 @@ packages:engines: {node: '>=18'}hasBin: true+ resolution: {integrity: sha512-GdzJuUMc6ZSpxFJWVxtOH1bzYHym+TOnveqUjb+VJIbZWbZzyiRGFiKhbiielfpYbgMlhHVhsJ0FTazfuRFkMA==}+resolution: {integrity: sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==}engines: {node: '>=10.13.0'}+ resolution: {integrity: sha512-NdTrKgh0oO7+y+RFX8KKhOB438x/j94UGXEFzl/7pHH0JjWSn42iJ9tgmPksIO6n1JKDHmNDcejPJfKspljB9g==}+resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==}engines: {node: '>= 0.4'}@@ -5822,96 +6135,15 @@ packages:resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==}engines: {node: ^10 || ^12 || >=14}- resolution: {integrity: sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==}- engines: {node: '>=4'}-- resolution: {integrity: sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==}- engines: {node: '>=0.10.0'}-- resolution: {integrity: sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==}- engines: {node: '>=0.10.0'}-- resolution: {integrity: sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==}- engines: {node: '>=0.10.0'}-- resolution: {integrity: sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==}- engines: {node: '>=10'}- hasBin: true-resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}engines: {node: '>= 0.8.0'}- resolution: {integrity: sha512-YxaYSIvZPAqhrrEpRtonnrXdghZg1irNg4qrjboCXrpybLWVs55cW2N3juhspVJiO0JBvYJT8SYsJpc8OQSnsA==}- engines: {node: '>=14.21.3'}- peerDependencies:- '@ianvs/prettier-plugin-sort-imports': '*'- '@prettier/plugin-pug': '*'- '@shopify/prettier-plugin-liquid': '*'- '@trivago/prettier-plugin-sort-imports': '*'- '@zackad/prettier-plugin-twig': '*'- prettier: ^3.0- prettier-plugin-astro: '*'- prettier-plugin-css-order: '*'- prettier-plugin-import-sort: '*'- prettier-plugin-jsdoc: '*'- prettier-plugin-marko: '*'- prettier-plugin-multiline-arrays: '*'- prettier-plugin-organize-attributes: '*'- prettier-plugin-organize-imports: '*'- prettier-plugin-sort-imports: '*'- prettier-plugin-style-order: '*'- prettier-plugin-svelte: '*'- peerDependenciesMeta:- '@ianvs/prettier-plugin-sort-imports':- optional: true- '@prettier/plugin-pug':- optional: true- '@shopify/prettier-plugin-liquid':- optional: true- '@trivago/prettier-plugin-sort-imports':- optional: true- '@zackad/prettier-plugin-twig':- optional: true- prettier-plugin-astro:- optional: true- prettier-plugin-css-order:- optional: true- prettier-plugin-import-sort:- optional: true- prettier-plugin-jsdoc:- optional: true- prettier-plugin-marko:- optional: true- prettier-plugin-multiline-arrays:- optional: true- prettier-plugin-organize-attributes:- optional: true- prettier-plugin-organize-imports:- optional: true- prettier-plugin-sort-imports:- optional: true- prettier-plugin-style-order:- optional: true- prettier-plugin-svelte:- optional: true-resolution: {integrity: sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==}engines: {node: '>=14'}hasBin: true- resolution: {integrity: sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==}- engines: {node: '>=14'}- hasBin: true-resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==}engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}@@ -5948,9 +6180,6 @@ packages:resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}- resolution: {integrity: sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==}-resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}engines: {node: '>=6'}@@ -5981,22 +6210,18 @@ packages:resolution: {integrity: sha512-9G8cA+tuMS75+6G/TzW8OtLzmBDMo8p1JRxN5AZ+LAp8uxGA8V8GZm4GQ4/N5QNQEnLmg6SS7wyuSmbKepiKqA==}engines: {node: '>= 0.10'}- resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==}- hasBin: true-- resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==}+ resolution: {integrity: sha512-rVprimfGBG3DR+Tq0IQG2DT5PxKth1WIGDmj5yPmlzr4YBe7uyE+Du4oVqTDXZSHGGGXRtTJEGSSePyQCMBglQ==}peerDependencies:- react: ^18.3.1+ react: ^19.2.8resolution: {integrity: sha512-W+fdztx6qafK5xCYhKg1R/F0mQJHd+ubYTBk9FJMOqoEcgn7n/myPbPSKDWuGt/hYrvurCHs4DBNhj47sgecGA==}engines: {node: '>=18.0.0'}hasBin: true- resolution: {integrity: sha512-6aiQeBda4zjcuaugWvim9WsGqisoUk+etmFEsSUMm451/Ic8L/UAb7sRtMj3V+Hdzm6mMjU1VhiSzYUZeBm0Vg==}+ resolution: {integrity: sha512-4kbWJrh5jPZt1+YqVcXcGKffGcXV/XVbozknLh0Yjh0KhpoAkus21TAQhzRYqNwFkkObmnSvRlZZ3GT+ehoIrA==}engines: {node: '>=18.0.0'}peerDependencies:react: ^16.8.0 || ^17 || ^18 || ^19@@ -6016,8 +6241,8 @@ packages:resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==}- resolution: {integrity: sha512-AJt0lAIkItWEZRA5d/mO+Om4nPCuTiQ0saA+qItO967DTjmGjnhmF+Bi2tL286mOTfBlF5CyLzJ35KTMaDoH+A==}+ resolution: {integrity: sha512-kS/35staVCBqS29verTQJQZXw7RfsRCPO3fdJoW1KXylcv7A9dw6DZ3vJXC2w+bIBgLw5FN4pOFvKSQtkQhPfA==}peerDependencies:'@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0@@ -6069,8 +6294,8 @@ packages:'@types/react':optional: true- resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==}+ resolution: {integrity: sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw==}engines: {node: '>=0.10.0'}@@ -6148,10 +6373,6 @@ packages:resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}engines: {node: '>=0.10.0'}- resolution: {integrity: sha512-gAZ+kLqBdHarXB64XpAe2VCjB7rIRv+mU8tfRWziHRJ5umKsIHN2tLLv6EtMw7WCdP19S0ERVMldNvxYCHnhSQ==}- engines: {node: '>=8.6.0'}-resolution: {integrity: sha512-QT7FVMXfWOYFbeRBF6nu+I6tr2Tf3u0q8RIEjNob/heKY/nh7drD/k7eeMFmSQgnTtCzLDcCu/XEnpW2wk4xCQ==}engines: {node: '>=9.3.0 || >=8.10.0 <9.0.0'}@@ -6175,12 +6396,9 @@ packages:engines: {node: '>= 0.4'}hasBin: true- resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==}- hasBin: true-- resolution: {integrity: sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==}+ resolution: {integrity: sha512-tqt+NBWwyaMgw3zDsnygx4CByWjQEJHOPMdslYhppaQSJUtL/D4JO9CcBBlhPoI8lz9oJIDXkwXfhF4aWqP8xQ==}+ engines: {node: '>= 0.4'}hasBin: true@@ -6201,16 +6419,16 @@ packages:resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==}- resolution: {integrity: sha512-GVsDdsbJzzy4S/v3dqWPJ7EfvZJfCHiDqe80IyrF59LYuP+e6U1LJoUqeuqRbwAWoMNoXivMNeNAOf5E22VA1w==}- engines: {node: '>=14.18.0', npm: '>=8.0.0'}- hasBin: true-resolution: {integrity: sha512-HqMFpUbWlf/tvcxBFNKnJyzc7Lk+XO3FGc3pbNBLqEbOz0gPLRgcrlS3UF4MfUrVlstOaP/q0kM6GVvi+LrLRg==}engines: {node: '>=18.0.0', npm: '>=8.0.0'}hasBin: true+ resolution: {integrity: sha512-RXOqwaPsBGjMNMa4sQjDjHieHEZDFoj/Rdr46l2MU5DfEs16wHJPC2RPTPHWhNl+M3aI472LLqFkFKut4SblOg==}+ engines: {node: '>=18.0.0', npm: '>=8.0.0'}+ hasBin: true+resolution: {integrity: sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==}engines: {node: '>= 18'}@@ -6221,8 +6439,8 @@ packages:resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}- resolution: {integrity: sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==}+ resolution: {integrity: sha512-wtZlHyOje6OZTGqAoaDKxFkgRtkF9CnHAVnCHKfuj200wAgL+bSJhdsCD2l0Qx/2ekEXjPWcyKkfGb5CPboslg==}engines: {node: '>=0.4'}@@ -6242,12 +6460,12 @@ packages:resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}- resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==}-resolution: {integrity: sha512-pFwF6H1XrSdYYNLfOcGlM28/j8CGLu8IvdrxqhjWULe2bPcKiKW4CV+OWqR/9fT52mywx65l7ysNkjLKBda7eA==}+ resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==}+resolution: {integrity: sha512-RJr9EaCmsLzBX2NDiO5Z3ux2BVosNZN5jo0gWgsyKvxKIUL5R3swNvoorulAeL9kLB0iTSX7V6aokhla2m7xbg==}@@ -6258,15 +6476,13 @@ packages:resolution: {integrity: sha512-5TF+l7p4+OsnP8BCCvSyZiSPc4x4//p5uPwK8TCnVPJYRmU2aYKMpOXvw8zM5a5JvuuCGN1jmsMwuU2W02ukfA==}+ resolution: {integrity: sha512-xXR3KGeoxTNWPD4aBvL5NUpMTT7WMANr3EWnaS190QVkY52lqqcVRD7Q05UVbBhiWDGWMlJEUam9m7uFFGVScw==}+resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==}hasBin: true- resolution: {integrity: sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==}- engines: {node: '>=10'}- hasBin: true-resolution: {integrity: sha512-rkVq3IXh+4FDGch+KwzX3aV9W3kO54GyEgpvBzSyctDA6Xtd7RJQV1xmXbeQp5v7+VzLOfVqiutSE6GICgPFvg==}engines: {node: '>=10'}@@ -6312,6 +6528,10 @@ packages:resolution: {integrity: sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==}engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ resolution: {integrity: sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==}+ engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}engines: {node: '>=8'}@@ -6320,9 +6540,6 @@ packages:resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}engines: {node: '>=8'}- resolution: {integrity: sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==}-resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==}engines: {node: '>= 0.4'}@@ -6349,12 +6566,6 @@ packages:resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==}engines: {node: '>=14'}- resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==}-- resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==}-resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==}@@ -6419,9 +6630,6 @@ packages:resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==}- resolution: {integrity: sha512-+L3ccpzibovGXFK+Ap/f8LOS0ahMrHTf3xu7mMLSpEGU0EO9ucaysSylKo9eRDFNhWve/y275iPmIZ4z39a9iA==}-resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}@@ -6471,10 +6679,6 @@ packages:resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==}engines: {node: '>=18'}- resolution: {integrity: sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg==}- engines: {node: '>= 0.4'}-resolution: {integrity: sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==}engines: {node: '>= 0.4'}@@ -6482,12 +6686,12 @@ packages:resolution: {integrity: sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==}- resolution: {integrity: sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==}+ resolution: {integrity: sha512-PwvK7BU+CMTJGYQCTZb5RWXIML92lftJLhQz1tBzgKiqGxJaMlBAa48POXaNAC2s4y8jr3EFqrkF9+44neS46w==}engines: {node: '>= 0.4'}- resolution: {integrity: sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==}+ resolution: {integrity: sha512-2+3aDAOmPTmuFwjDnmJG2ctEkQKVki7vOSqaxkv42Mowj1V6PnvuwFCRrR5lChUux1TBskPjfkeTOhqczDMxTw==}engines: {node: '>= 0.4'}@@ -6535,14 +6739,6 @@ packages:resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==}engines: {node: '>=8'}- resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==}- engines: {node: '>=0.10.0'}-- resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}- engines: {node: '>=8'}-resolution: {integrity: sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw==}engines: {node: '>=14.16'}@@ -6556,19 +6752,6 @@ packages:resolution: {integrity: sha512-G4qppLgKu/k6FwRpHiGiKPaPTFcG3g4wNVX/Qsfu+RqQM30E7Tyu/TEgxcL9PNLF5pdRLwQdE3YKKf+KF2Dzlw==}- resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==}- engines: {node: '>= 12.0.0'}- peerDependencies:- '@babel/core': '*'- babel-plugin-macros: '*'- react: '>= 16.8.0 || 17.x.x || ^18.0.0-0'- peerDependenciesMeta:- '@babel/core':- optional: true- babel-plugin-macros:- optional: true-resolution: {integrity: sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==}engines: {node: '>= 12.0.0'}@@ -6625,13 +6808,6 @@ packages:resolution: {integrity: sha512-Re10+NauLTMCudc7T5WLFLAwDhQ0JWdrMK+9B2M8zR5hRExKmsRDCBA7/aV/pNJFltmBFO5BAMlQFi/vq3nKOg==}engines: {node: '>=6'}- resolution: {integrity: sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==}-- resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==}- engines: {node: '>=6'}-resolution: {integrity: sha512-+G0LLgjjo9BZX2MfdvPfH+MKLCrxlXSYec5DaPYP1fe6Iyhf0/fSmJ0bFiZ1F8BT6cGXl2LpltQptzjXKWEkKA==}@@ -6682,14 +6858,14 @@ packages:resolution: {integrity: sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==}engines: {node: '>=12.0.0'}- resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==}- engines: {node: '>=12.0.0'}-resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==}engines: {node: ^18.0.0 || >=20.0.0}+ resolution: {integrity: sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw==}+ engines: {node: ^20.0.0 || >=22.0.0}+resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==}engines: {node: '>=14.0.0'}@@ -6726,18 +6902,6 @@ packages:resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==}- resolution: {integrity: sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==}- engines: {node: '>=18.12'}- peerDependencies:- typescript: '>=4.8.4'-- resolution: {integrity: sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==}- engines: {node: '>=18.12'}- peerDependencies:- typescript: '>=4.8.4'-resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==}@@ -6747,9 +6911,6 @@ packages:resolution: {integrity: sha512-nFRqW0ttu/2o6XTXsHiVZWJBCOaxhVqZLg7dgs3coZNsCMPXPfwz+zPHAQA+70fNnVJLAPg1EgGIqK9Q84tvAw==}- resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==}-resolution: {integrity: sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==}engines: {node: '>=6'}@@ -6762,17 +6923,10 @@ packages:engines: {node: '>=18.0.0'}hasBin: true- resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==}-resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}engines: {node: '>= 0.8.0'}- resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==}- engines: {node: '>=10'}-resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==}engines: {node: '>=10'}@@ -6801,19 +6955,12 @@ packages:resolution: {integrity: sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==}engines: {node: '>= 0.4'}- resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==}+ resolution: {integrity: sha512-phPGCwqr2+Qo0fwniCE8e4pKnGu/yFb5nD5Y8bf0EEeiI5GklnACYA9GFy/DrAeRrKHXvHn+1SUsOWgJp6RO+g==}engines: {node: '>= 0.4'}- resolution: {integrity: sha512-c7toRLrotJ9oixgdW7liukZpsnq5CZ7PuKztubGYlNppuTqhIoWfhgHo/7EU0v06gS2l/x0i2NEFK1qMIf0rIg==}- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- peerDependencies:- eslint: ^8.57.0 || ^9.0.0 || ^10.0.0- typescript: '>=4.8.4 <6.0.0'-- resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==}+ resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==}engines: {node: '>=14.17'}hasBin: true@@ -6877,12 +7024,6 @@ packages:resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==}engines: {node: '>= 0.8'}- resolution: {integrity: sha512-aqrHaVBWW1JVKBHmGo33T5TxeL0qWzfvjWokObHA9bYmN7eNDkwOxmLjhioHl9878qDFMAaT51XNroRyuz7WxA==}-- resolution: {integrity: sha512-bSjt9pjaEBnNiGgc9rUiHGKv5l4/TGzDmYw3RhnkJGtLhbnnA/5qJj7x3dNDCRx/PJxu774LlH8lCOlB4hEfKg==}-resolution: {integrity: sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==}hasBin: true@@ -6911,8 +7052,8 @@ packages:peerDependencies:react: '*'- resolution: {integrity: sha512-6RAP/5KJMRzLMLS25/BVh2u09cRK8S6HRGc1RnZvqR547qAKZCpjYylOqMPU9eNIirAiKoGmsoUPa7JrlaA/yg==}+ resolution: {integrity: sha512-vWapep/2GESovKEmkxaG1Bkt6AWwANCWrM4kwOYbMmvQ4IsBGJFx9l66h8DNCcU0jSOzNtSFyRXFcYvgAak/Cg==}peerDependencies:react: ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 || ^19.0.0@@ -7045,9 +7186,6 @@ packages:resolution: {integrity: sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==}engines: {node: '>=10.13.0'}- resolution: {integrity: sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==}-resolution: {integrity: sha512-UFynvx+gM44Gv9qFgj0acCQK2VE1CtdfwFdimkapco3hlPCJ/zeq73n2yVKimVbtm+TnApIugGhLJnkU6gjYXA==}engines: {node: '>=10.13.0'}@@ -7080,8 +7218,8 @@ packages:resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==}- resolution: {integrity: sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==}+ resolution: {integrity: sha512-fvO4ExWMFsqyhG3AiPAObMuY1lxaqgYcxbc49CNdWDDECOJNgQyvsOWVwbZc+qf3rzRtxojBK+CMEv0Ld5CYpw==}engines: {node: '>= 0.4'}@@ -7150,10 +7288,6 @@ packages:resolution: {integrity: sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==}engines: {node: '>=0.4.0'}- resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}- engines: {node: '>=0.4'}-resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==}@@ -7224,14 +7358,11 @@ packages:peerDependencies:zod: ^3.18.0- resolution: {integrity: sha512-OdqJE9UDRPwWsrHjLN2F8bPxvwJBK22EHLWtanu0LSYr5YqzsaaW3RMgmjwr8Rypg5k+meEJdSPXJZXE/yqOMg==}-resolution: {integrity: sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==}- resolution: {integrity: sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==}+ resolution: {integrity: sha512-sC95tT5iHHH9gtpj6A81kh+NEaRAUFN+qlUPDUbRfOMvNf5QCBqsb3WgvnpVtK5Y+4UfA6KqufotuTvMGiTlsA==}resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==}@@ -7254,6 +7385,30 @@ snapshots:package-manager-detector: 1.3.0tinyexec: 1.0.1+ '@apm-js-collab/[email protected]':+ dependencies:+ '@apm-js-collab/code-transformer': 0.18.1+ es-module-lexer: 2.3.0+ magic-string: 0.30.21+ module-details-from-path: 1.0.4++ '@apm-js-collab/[email protected]':+ dependencies:+ '@types/estree': 1.0.9+ astring: 1.9.0+ esquery: 1.7.0+ meriyah: 6.1.4+ semifies: 1.0.0+ source-map: 0.6.1++ '@apm-js-collab/[email protected]':+ dependencies:+ '@apm-js-collab/code-transformer': 0.18.1+ debug: 4.4.3+ module-details-from-path: 1.0.4+ transitivePeerDependencies:+ - supports-color+'@ark/[email protected]':dependencies:'@ark/util': 0.46.0@@ -7272,30 +7427,8 @@ snapshots:js-tokens: 4.0.0picocolors: 1.1.1- '@babel/[email protected]': {}-'@babel/[email protected]': {}- '@babel/[email protected]':- dependencies:- '@ampproject/remapping': 2.3.0- '@babel/code-frame': 7.26.2- '@babel/generator': 7.26.9- '@babel/helper-compilation-targets': 7.26.5- '@babel/helper-module-transforms': 7.26.0(@babel/[email protected])- '@babel/helpers': 7.26.9- '@babel/parser': 7.26.9- '@babel/template': 7.26.9- '@babel/traverse': 7.26.9- '@babel/types': 7.26.9- convert-source-map: 2.0.0- debug: 4.4.3- gensync: 1.0.0-beta.2- json5: 2.2.3- semver: 6.3.1- transitivePeerDependencies:- - supports-color-'@babel/[email protected]':dependencies:'@ampproject/remapping': 2.3.0@@ -7336,14 +7469,6 @@ snapshots:dependencies:'@babel/types': 7.28.2- '@babel/[email protected]':- dependencies:- '@babel/compat-data': 7.26.8- '@babel/helper-validator-option': 7.25.9- browserslist: 4.25.2- lru-cache: 5.1.1- semver: 6.3.1-'@babel/[email protected]':dependencies:'@babel/compat-data': 7.28.0@@ -7374,13 +7499,6 @@ snapshots:transitivePeerDependencies:- supports-color- '@babel/[email protected]':- dependencies:- '@babel/traverse': 7.26.9- '@babel/types': 7.26.9- transitivePeerDependencies:- - supports-color-'@babel/[email protected]':dependencies:'@babel/traverse': 7.28.3@@ -7388,15 +7506,6 @@ snapshots:transitivePeerDependencies:- supports-color- '@babel/[email protected](@babel/[email protected])':- dependencies:- '@babel/core': 7.26.9- '@babel/helper-module-imports': 7.25.9- '@babel/helper-validator-identifier': 7.25.9- '@babel/traverse': 7.26.9- transitivePeerDependencies:- - supports-color-'@babel/[email protected](@babel/[email protected])':dependencies:'@babel/core': 7.28.3@@ -7436,15 +7545,8 @@ snapshots:'@babel/[email protected]': {}- '@babel/[email protected]': {}-'@babel/[email protected]': {}- '@babel/[email protected]':- dependencies:- '@babel/template': 7.26.9- '@babel/types': 7.26.9-'@babel/[email protected]':dependencies:'@babel/template': 7.27.2@@ -7484,29 +7586,17 @@ snapshots:'@babel/[email protected]':dependencies:- '@babel/code-frame': 7.26.2- '@babel/parser': 7.26.9- '@babel/types': 7.26.9-- '@babel/[email protected]':- dependencies:- '@babel/code-frame': 7.27.1- '@babel/parser': 7.28.3- '@babel/types': 7.28.2-- '@babel/[email protected]':- dependencies:- '@babel/code-frame': 7.26.2- '@babel/generator': 7.26.9- '@babel/parser': 7.26.9- '@babel/template': 7.26.9- '@babel/types': 7.26.9- debug: 4.4.3- globals: 11.12.0- transitivePeerDependencies:- - supports-color+ '@babel/code-frame': 7.26.2+ '@babel/parser': 7.26.9+ '@babel/types': 7.26.9++ '@babel/[email protected]':+ dependencies:+ '@babel/code-frame': 7.27.1+ '@babel/parser': 7.28.3+ '@babel/types': 7.28.2- '@babel/[email protected]':+ '@babel/[email protected]':dependencies:'@babel/code-frame': 7.26.2'@babel/generator': 7.26.9@@ -7572,12 +7662,6 @@ snapshots:optionalDependencies:'@rollup/rollup-darwin-arm64': 4.41.0- '@emnapi/[email protected]':- dependencies:- '@emnapi/wasi-threads': 1.0.4- tslib: 2.8.1- optional: true-'@emnapi/[email protected]':dependencies:'@emnapi/wasi-threads': 1.1.0@@ -7594,11 +7678,6 @@ snapshots:tslib: 2.8.1optional: true- '@emnapi/[email protected]':- dependencies:- tslib: 2.8.1- optional: true-'@emnapi/[email protected]':dependencies:tslib: 2.8.1@@ -7679,55 +7758,34 @@ snapshots:'@esbuild/[email protected]':optional: true- dependencies:- eslint: 9.33.0([email protected])- eslint-visitor-keys: 3.4.3-dependencies:- eslint: 9.33.0([email protected])+ eslint: 10.8.1([email protected])eslint-visitor-keys: 3.4.3- '@eslint-community/[email protected]': {}-'@eslint-community/[email protected]': {}- '@eslint/[email protected]':+ '@eslint/[email protected]':dependencies:- '@eslint/object-schema': 2.1.6+ '@eslint/object-schema': 3.0.5debug: 4.4.3- minimatch: 3.1.2+ minimatch: 10.2.6transitivePeerDependencies:- supports-color- '@eslint/[email protected]': {}-- '@eslint/[email protected]':+ '@eslint/[email protected]':dependencies:- '@types/json-schema': 7.0.15+ '@eslint/core': 1.2.1- '@eslint/[email protected]':+ '@eslint/[email protected]':dependencies:- ajv: 6.12.6- debug: 4.4.1- espree: 10.4.0- globals: 14.0.0- ignore: 5.3.2- import-fresh: 3.3.0- js-yaml: 4.1.0- minimatch: 3.1.2- strip-json-comments: 3.1.1- transitivePeerDependencies:- - supports-color-- '@eslint/[email protected]': {}+ '@types/json-schema': 7.0.15- '@eslint/[email protected]': {}+ '@eslint/[email protected]': {}- '@eslint/[email protected]':+ '@eslint/[email protected]':dependencies:- '@eslint/core': 0.15.2+ '@eslint/core': 1.2.1levn: 0.4.1'@floating-ui/[email protected]':@@ -7739,49 +7797,37 @@ snapshots:'@floating-ui/core': 1.6.9'@floating-ui/utils': 0.2.9dependencies:'@floating-ui/dom': 1.6.13- react: 18.3.1- react-dom: 18.3.1([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])'@floating-ui/[email protected]': {}- '@formatjs/[email protected]':- dependencies:- '@formatjs/fast-memoize': 2.2.7- '@formatjs/intl-localematcher': 0.6.1- decimal.js: 10.5.0- tslib: 2.8.1-- '@formatjs/[email protected]':- dependencies:- tslib: 2.8.1-- '@formatjs/[email protected]':- dependencies:- '@formatjs/ecma402-abstract': 2.3.4- '@formatjs/icu-skeleton-parser': 1.8.14- tslib: 2.8.1+ '@formatjs/[email protected]': {}- '@formatjs/[email protected]':+ '@formatjs/[email protected]':dependencies:- '@formatjs/ecma402-abstract': 2.3.4- tslib: 2.8.1+ '@formatjs/icu-skeleton-parser': 2.1.11- '@formatjs/[email protected]':- dependencies:- tslib: 2.8.1+ '@formatjs/[email protected]': {}- '@formatjs/[email protected]':+ '@formatjs/[email protected]':dependencies:- tslib: 2.8.1+ '@formatjs/fast-memoize': 3.1.7'@google-cloud/[email protected]': {}+ '@hookform/[email protected]([email protected]([email protected]))([email protected])([email protected])([email protected]([email protected]))([email protected])':dependencies:- react-hook-form: 7.53.1([email protected])+ '@standard-schema/utils': 0.3.0+ react-hook-form: 7.86.0([email protected])+ optionalDependencies:+ ajv: 8.17.1+ ajv-formats: 2.1.1([email protected])+ arktype: 2.1.20+ zod: 4.5.4'@humanfs/[email protected]': {}@@ -7796,81 +7842,178 @@ snapshots:'@humanwhocodes/[email protected]': {}+ '@img/[email protected]':+ optional: true+'@img/[email protected]':optionalDependencies:'@img/sharp-libvips-darwin-arm64': 1.0.4optional: true+ '@img/[email protected]':+ optionalDependencies:+ '@img/sharp-libvips-darwin-arm64': 1.2.4+ optional: true+'@img/[email protected]':optionalDependencies:'@img/sharp-libvips-darwin-x64': 1.0.4optional: true+ '@img/[email protected]':+ optionalDependencies:+ '@img/sharp-libvips-darwin-x64': 1.2.4+ optional: true+'@img/[email protected]':optional: true+ '@img/[email protected]':+ optional: true+'@img/[email protected]':optional: true+ '@img/[email protected]':+ optional: true+'@img/[email protected]':optional: true+ '@img/[email protected]':+ optional: true+'@img/[email protected]':optional: true+ '@img/[email protected]':+ optional: true++ '@img/[email protected]':+ optional: true++ '@img/[email protected]':+ optional: true+'@img/[email protected]':optional: true+ '@img/[email protected]':+ optional: true+'@img/[email protected]':optional: true+ '@img/[email protected]':+ optional: true+'@img/[email protected]':optional: true+ '@img/[email protected]':+ optional: true+'@img/[email protected]':optional: true+ '@img/[email protected]':+ optional: true+'@img/[email protected]':optionalDependencies:'@img/sharp-libvips-linux-arm64': 1.0.4optional: true+ '@img/[email protected]':+ optionalDependencies:+ '@img/sharp-libvips-linux-arm64': 1.2.4+ optional: true+'@img/[email protected]':optionalDependencies:'@img/sharp-libvips-linux-arm': 1.0.5optional: true+ '@img/[email protected]':+ optionalDependencies:+ '@img/sharp-libvips-linux-arm': 1.2.4+ optional: true++ '@img/[email protected]':+ optionalDependencies:+ '@img/sharp-libvips-linux-ppc64': 1.2.4+ optional: true++ '@img/[email protected]':+ optionalDependencies:+ '@img/sharp-libvips-linux-riscv64': 1.2.4+ optional: true+'@img/[email protected]':optionalDependencies:'@img/sharp-libvips-linux-s390x': 1.0.4optional: true+ '@img/[email protected]':+ optionalDependencies:+ '@img/sharp-libvips-linux-s390x': 1.2.4+ optional: true+'@img/[email protected]':optionalDependencies:'@img/sharp-libvips-linux-x64': 1.0.4optional: true+ '@img/[email protected]':+ optionalDependencies:+ '@img/sharp-libvips-linux-x64': 1.2.4+ optional: true+'@img/[email protected]':optionalDependencies:'@img/sharp-libvips-linuxmusl-arm64': 1.0.4optional: true+ '@img/[email protected]':+ optionalDependencies:+ '@img/sharp-libvips-linuxmusl-arm64': 1.2.4+ optional: true+'@img/[email protected]':optionalDependencies:'@img/sharp-libvips-linuxmusl-x64': 1.0.4optional: true+ '@img/[email protected]':+ optionalDependencies:+ '@img/sharp-libvips-linuxmusl-x64': 1.2.4+ optional: true+'@img/[email protected]':dependencies:'@emnapi/runtime': 1.4.5optional: true+ '@img/[email protected]':+ dependencies:+ '@emnapi/runtime': 1.8.1+ optional: true++ '@img/[email protected]':+ optional: true+'@img/[email protected]':optional: true+ '@img/[email protected]':+ optional: true+'@img/[email protected]':optional: true+ '@img/[email protected]':+ optional: true+'@inquirer/[email protected](@types/[email protected])':dependencies:'@inquirer/core': 10.2.0(@types/[email protected])@@ -7897,12 +8040,6 @@ snapshots:optionalDependencies:'@types/node': 22.8.1- '@isaacs/[email protected]': {}-- '@isaacs/[email protected]':- dependencies:- '@isaacs/balanced-match': 4.0.1-'@isaacs/[email protected]':dependencies:string-width: 5.1.2@@ -7926,6 +8063,8 @@ snapshots:'@jridgewell/[email protected]': {}+ '@jridgewell/[email protected]': {}+'@jridgewell/[email protected]':dependencies:'@jridgewell/resolve-uri': 3.1.2@@ -7933,9 +8072,9 @@ snapshots:'@jsonhero/[email protected]': {}dependencies:- '@mdx-js/mdx': 3.1.0([email protected])+ '@mdx-js/mdx': 3.1.0([email protected])source-map: 0.7.4optionalDependencies:webpack: 5.98.0@@ -7943,7 +8082,7 @@ snapshots:- acorn- supports-color- '@mdx-js/[email protected]([email protected])':+ '@mdx-js/[email protected]([email protected])':dependencies:'@types/estree': 1.0.8'@types/estree-jsx': 1.0.5@@ -7957,7 +8096,7 @@ snapshots:hast-util-to-jsx-runtime: 2.3.6markdown-extensions: 2.0.0recma-build-jsx: 1.0.0- recma-jsx: 1.0.0([email protected])+ recma-jsx: 1.0.0([email protected])recma-stringify: 1.0.0rehype-recma: 1.0.0remark-mdx: 3.1.0@@ -7973,11 +8112,11 @@ snapshots:- acorn- supports-colordependencies:'@types/mdx': 2.0.13- '@types/react': 18.3.12- react: 18.3.1+ '@types/react': 19.2.18+ react: 19.2.8'@microsoft/[email protected]': {}@@ -7993,8 +8132,8 @@ snapshots:express-rate-limit: 7.5.1([email protected])pkce-challenge: 5.0.0raw-body: 3.0.1- zod: 3.24.4- zod-to-json-schema: 3.24.6([email protected])+ zod: 3.25.76+ zod-to-json-schema: 3.24.6([email protected])transitivePeerDependencies:- supports-color@@ -8007,11 +8146,55 @@ snapshots:outvariant: 1.4.3strict-event-emitter: 0.5.1- '@napi-rs/[email protected]':- dependencies:- '@emnapi/core': 1.4.5- '@emnapi/runtime': 1.4.5- '@tybys/wasm-util': 0.10.0+ '@napi-rs/[email protected]':+ optional: true++ '@napi-rs/[email protected]':+ optional: true++ '@napi-rs/[email protected]':+ optional: true++ '@napi-rs/[email protected]':+ optional: true++ '@napi-rs/[email protected]':+ optional: true++ '@napi-rs/[email protected]':+ optional: true++ '@napi-rs/[email protected]':+ optional: true++ '@napi-rs/[email protected]':+ optional: true++ '@napi-rs/[email protected]':+ optional: true++ '@napi-rs/[email protected]':+ optional: true++ '@napi-rs/[email protected]':+ optional: true++ '@napi-rs/[email protected]':+ optionalDependencies:+ '@napi-rs/canvas-android-arm64': 0.1.100+ '@napi-rs/canvas-darwin-arm64': 0.1.100+ '@napi-rs/canvas-darwin-x64': 0.1.100+ '@napi-rs/canvas-linux-arm-gnueabihf': 0.1.100+ '@napi-rs/canvas-linux-arm64-gnu': 0.1.100+ '@napi-rs/canvas-linux-arm64-musl': 0.1.100+ '@napi-rs/canvas-linux-riscv64-gnu': 0.1.100+ '@napi-rs/canvas-linux-x64-gnu': 0.1.100+ '@napi-rs/canvas-linux-x64-musl': 0.1.100+ '@napi-rs/canvas-win32-arm64-msvc': 0.1.100+ '@napi-rs/canvas-win32-x64-msvc': 0.1.100+ optional: true++ '@napi-rs/[email protected]':optional: true'@napi-rs/[email protected]':@@ -8021,70 +8204,63 @@ snapshots:'@tybys/wasm-util': 0.10.1optional: true- '@next/[email protected]': {}-'@next/[email protected]': {}- '@next/[email protected]':- dependencies:- fast-glob: 3.3.1+ '@next/[email protected]': {}- '@next/[email protected](@mdx-js/[email protected]([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))':+ '@next/[email protected](@mdx-js/[email protected]([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))':dependencies:source-map: 0.7.4optionalDependencies:- '@mdx-js/loader': 3.1.0([email protected])([email protected])- '@mdx-js/react': 3.1.0(@types/[email protected])([email protected])-- '@next/[email protected]':- optional: true+ '@mdx-js/loader': 3.1.0([email protected])([email protected])+ '@mdx-js/react': 3.1.0(@types/[email protected])([email protected])'@next/[email protected]':optional: true- '@next/[email protected]':+ '@next/[email protected]':optional: true'@next/[email protected]':optional: true- '@next/[email protected]':+ '@next/[email protected]':optional: true'@next/[email protected]':optional: true- '@next/[email protected]':+ '@next/[email protected]':optional: true'@next/[email protected]':optional: true- '@next/[email protected]':+ '@next/[email protected]':optional: true'@next/[email protected]':optional: true- '@next/[email protected]':+ '@next/[email protected]':optional: true'@next/[email protected]':optional: true- '@next/[email protected]':+ '@next/[email protected]':optional: true'@next/[email protected]':optional: true- '@next/[email protected]':+ '@next/[email protected]':optional: true- '@next/[email protected]':+ '@next/[email protected]':optional: true- '@next/[email protected]':+ '@next/[email protected]':optional: true'@noble/[email protected]': {}@@ -8107,8 +8283,6 @@ snapshots:'@nodelib/fs.scandir': 2.1.5fastq: 1.17.1- '@nolyfill/[email protected]': {}-'@open-draft/[email protected]': {}'@open-draft/[email protected]':@@ -8122,282 +8296,73 @@ snapshots:dependencies:'@opentelemetry/api': 1.9.1- '@opentelemetry/[email protected]':- dependencies:- '@opentelemetry/api': 1.9.0-- '@opentelemetry/[email protected]': {}-- '@opentelemetry/[email protected]': {}-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.0-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.1-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/semantic-conventions': 1.28.0-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.1- '@opentelemetry/semantic-conventions': 1.41.1-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.1- '@opentelemetry/api-logs': 0.218.0- '@opentelemetry/core': 2.7.1(@opentelemetry/[email protected])- '@opentelemetry/otlp-exporter-base': 0.218.0(@opentelemetry/[email protected])- '@opentelemetry/otlp-transformer': 0.218.0(@opentelemetry/[email protected])- '@opentelemetry/sdk-logs': 0.218.0(@opentelemetry/[email protected])-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.1- '@opentelemetry/core': 2.7.1(@opentelemetry/[email protected])- '@opentelemetry/otlp-exporter-base': 0.218.0(@opentelemetry/[email protected])- '@opentelemetry/otlp-transformer': 0.218.0(@opentelemetry/[email protected])- '@opentelemetry/resources': 2.7.1(@opentelemetry/[email protected])- '@opentelemetry/sdk-metrics': 2.7.1(@opentelemetry/[email protected])-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.1- '@opentelemetry/core': 2.7.1(@opentelemetry/[email protected])- '@opentelemetry/otlp-exporter-base': 0.218.0(@opentelemetry/[email protected])- '@opentelemetry/otlp-transformer': 0.218.0(@opentelemetry/[email protected])- '@opentelemetry/resources': 2.7.1(@opentelemetry/[email protected])- '@opentelemetry/sdk-trace-base': 2.7.1(@opentelemetry/[email protected])-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.1- systeminformation: 5.31.13-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/core': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- '@opentelemetry/semantic-conventions': 1.30.0- transitivePeerDependencies:- - supports-color-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/core': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- '@opentelemetry/semantic-conventions': 1.30.0- '@types/connect': 3.4.38- transitivePeerDependencies:- - supports-color-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- transitivePeerDependencies:- - supports-color-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/core': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- '@opentelemetry/semantic-conventions': 1.30.0- transitivePeerDependencies:- - supports-color-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/core': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- '@opentelemetry/semantic-conventions': 1.30.0- transitivePeerDependencies:- - supports-color-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/core': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- transitivePeerDependencies:- - supports-color-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- transitivePeerDependencies:- - supports-color-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- transitivePeerDependencies:- - supports-color-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/core': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- '@opentelemetry/semantic-conventions': 1.30.0- transitivePeerDependencies:- - supports-color-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/core': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- '@opentelemetry/semantic-conventions': 1.28.0- forwarded-parse: 2.1.2- semver: 7.7.4- transitivePeerDependencies:- - supports-color-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- '@opentelemetry/redis-common': 0.36.2- '@opentelemetry/semantic-conventions': 1.30.0- transitivePeerDependencies:- - supports-color-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- '@opentelemetry/semantic-conventions': 1.30.0- transitivePeerDependencies:- - supports-color-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- '@opentelemetry/semantic-conventions': 1.30.0- transitivePeerDependencies:- - supports-color-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/core': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- '@opentelemetry/semantic-conventions': 1.30.0- transitivePeerDependencies:- - supports-color-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':+ '@opentelemetry/[email protected]':dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- transitivePeerDependencies:- - supports-color+ '@opentelemetry/api': 1.9.1- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- '@opentelemetry/semantic-conventions': 1.30.0- transitivePeerDependencies:- - supports-color+ '@opentelemetry/[email protected]': {}- '@opentelemetry/[email protected](@opentelemetry/[email protected])':+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/core': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- '@opentelemetry/semantic-conventions': 1.30.0- transitivePeerDependencies:- - supports-color+ '@opentelemetry/api': 1.9.1- '@opentelemetry/[email protected](@opentelemetry/[email protected])':+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- '@opentelemetry/semantic-conventions': 1.30.0- '@opentelemetry/sql-common': 0.40.1(@opentelemetry/[email protected])- transitivePeerDependencies:- - supports-color+ '@opentelemetry/api': 1.9.1+ '@opentelemetry/semantic-conventions': 1.41.1- '@opentelemetry/[email protected](@opentelemetry/[email protected])':+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- '@opentelemetry/semantic-conventions': 1.30.0- '@types/mysql': 2.15.26- transitivePeerDependencies:- - supports-color+ '@opentelemetry/api': 1.9.1+ '@opentelemetry/semantic-conventions': 1.41.1- '@opentelemetry/[email protected](@opentelemetry/[email protected])':+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/core': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- '@opentelemetry/semantic-conventions': 1.30.0- '@opentelemetry/sql-common': 0.40.1(@opentelemetry/[email protected])- '@types/pg': 8.6.1- '@types/pg-pool': 2.0.6- transitivePeerDependencies:- - supports-color+ '@opentelemetry/api': 1.9.1+ '@opentelemetry/api-logs': 0.218.0+ '@opentelemetry/core': 2.7.1(@opentelemetry/[email protected])+ '@opentelemetry/otlp-exporter-base': 0.218.0(@opentelemetry/[email protected])+ '@opentelemetry/otlp-transformer': 0.218.0(@opentelemetry/[email protected])+ '@opentelemetry/sdk-logs': 0.218.0(@opentelemetry/[email protected])- '@opentelemetry/[email protected](@opentelemetry/[email protected])':+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- '@opentelemetry/redis-common': 0.36.2- '@opentelemetry/semantic-conventions': 1.30.0- transitivePeerDependencies:- - supports-color+ '@opentelemetry/api': 1.9.1+ '@opentelemetry/core': 2.7.1(@opentelemetry/[email protected])+ '@opentelemetry/otlp-exporter-base': 0.218.0(@opentelemetry/[email protected])+ '@opentelemetry/otlp-transformer': 0.218.0(@opentelemetry/[email protected])+ '@opentelemetry/resources': 2.7.1(@opentelemetry/[email protected])+ '@opentelemetry/sdk-metrics': 2.7.1(@opentelemetry/[email protected])- '@opentelemetry/[email protected](@opentelemetry/[email protected])':+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- '@opentelemetry/semantic-conventions': 1.30.0- '@types/tedious': 4.0.14- transitivePeerDependencies:- - supports-color+ '@opentelemetry/api': 1.9.1+ '@opentelemetry/core': 2.7.1(@opentelemetry/[email protected])+ '@opentelemetry/otlp-exporter-base': 0.218.0(@opentelemetry/[email protected])+ '@opentelemetry/otlp-transformer': 0.218.0(@opentelemetry/[email protected])+ '@opentelemetry/resources': 2.7.1(@opentelemetry/[email protected])+ '@opentelemetry/sdk-trace-base': 2.7.1(@opentelemetry/[email protected])- '@opentelemetry/[email protected](@opentelemetry/[email protected])':+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/core': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- transitivePeerDependencies:- - supports-color+ '@opentelemetry/api': 1.9.1+ systeminformation: 5.31.13'@opentelemetry/[email protected](@opentelemetry/[email protected])':dependencies:'@opentelemetry/api': 1.9.1'@opentelemetry/api-logs': 0.218.0- import-in-the-middle: 3.3.0+ import-in-the-middle: 3.3.3require-in-the-middle: 8.0.1transitivePeerDependencies:- supports-color- '@opentelemetry/[email protected](@opentelemetry/[email protected])':+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/api-logs': 0.57.2- '@types/shimmer': 1.2.0- import-in-the-middle: 1.13.1- require-in-the-middle: 7.5.2- semver: 7.7.4- shimmer: 1.2.1+ '@opentelemetry/api': 1.9.1+ '@opentelemetry/api-logs': 0.220.0+ import-in-the-middle: 3.3.3+ require-in-the-middle: 8.0.1transitivePeerDependencies:- supports-color@@ -8417,13 +8382,11 @@ snapshots:'@opentelemetry/sdk-metrics': 2.7.1(@opentelemetry/[email protected])'@opentelemetry/sdk-trace-base': 2.7.1(@opentelemetry/[email protected])- '@opentelemetry/[email protected]': {}-- '@opentelemetry/[email protected](@opentelemetry/[email protected])':+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/core': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/semantic-conventions': 1.28.0+ '@opentelemetry/api': 1.9.1+ '@opentelemetry/core': 2.10.0(@opentelemetry/[email protected])+ '@opentelemetry/semantic-conventions': 1.41.1'@opentelemetry/[email protected](@opentelemetry/[email protected])':dependencies:@@ -8445,12 +8408,13 @@ snapshots:'@opentelemetry/core': 2.7.1(@opentelemetry/[email protected])'@opentelemetry/resources': 2.7.1(@opentelemetry/[email protected])- '@opentelemetry/[email protected](@opentelemetry/[email protected])':+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/core': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/resources': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/semantic-conventions': 1.28.0+ '@opentelemetry/api': 1.9.1+ '@opentelemetry/core': 2.10.0(@opentelemetry/[email protected])+ '@opentelemetry/resources': 2.10.0(@opentelemetry/[email protected])+ '@opentelemetry/sdk-trace': 2.10.0(@opentelemetry/[email protected])+ '@opentelemetry/semantic-conventions': 1.41.1'@opentelemetry/[email protected](@opentelemetry/[email protected])':dependencies:@@ -8466,17 +8430,15 @@ snapshots:'@opentelemetry/core': 2.7.1(@opentelemetry/[email protected])'@opentelemetry/sdk-trace-base': 2.7.1(@opentelemetry/[email protected])- '@opentelemetry/[email protected]': {}-- '@opentelemetry/[email protected]': {}+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':+ dependencies:+ '@opentelemetry/api': 1.9.1+ '@opentelemetry/core': 2.10.0(@opentelemetry/[email protected])+ '@opentelemetry/resources': 2.10.0(@opentelemetry/[email protected])+ '@opentelemetry/semantic-conventions': 1.41.1'@opentelemetry/[email protected]': {}- '@opentelemetry/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/core': 1.30.1(@opentelemetry/[email protected])-'@oxc-resolver/[email protected]':optional: true@@ -8539,6 +8501,194 @@ snapshots:'@oxc-resolver/[email protected]':optional: true+ '@oxfmt/[email protected]':+ optional: true++ '@oxfmt/[email protected]':+ optional: true++ '@oxfmt/[email protected]':+ optional: true++ '@oxfmt/[email protected]':+ optional: true++ '@oxfmt/[email protected]':+ optional: true++ '@oxfmt/[email protected]':+ optional: true++ '@oxfmt/[email protected]':+ optional: true++ '@oxfmt/[email protected]':+ optional: true++ '@oxfmt/[email protected]':+ optional: true++ '@oxfmt/[email protected]':+ optional: true++ '@oxfmt/[email protected]':+ optional: true++ '@oxfmt/[email protected]':+ optional: true++ '@oxfmt/[email protected]':+ optional: true++ '@oxfmt/[email protected]':+ optional: true++ '@oxfmt/[email protected]':+ optional: true++ '@oxfmt/[email protected]':+ optional: true++ '@oxfmt/[email protected]':+ optional: true++ '@oxfmt/[email protected]':+ optional: true++ '@oxfmt/[email protected]':+ optional: true++ '@oxlint-tsgolint/[email protected]':+ optional: true++ '@oxlint-tsgolint/[email protected]':+ optional: true++ '@oxlint-tsgolint/[email protected]':+ optional: true++ '@oxlint-tsgolint/[email protected]':+ optional: true++ '@oxlint-tsgolint/[email protected]':+ optional: true++ '@oxlint-tsgolint/[email protected]':+ optional: true++ '@oxlint/[email protected]':+ optional: true++ '@oxlint/[email protected]':+ optional: true++ '@oxlint/[email protected]':+ optional: true++ '@oxlint/[email protected]':+ optional: true++ '@oxlint/[email protected]':+ optional: true++ '@oxlint/[email protected]':+ optional: true++ '@oxlint/[email protected]':+ optional: true++ '@oxlint/[email protected]':+ optional: true++ '@oxlint/[email protected]':+ optional: true++ '@oxlint/[email protected]':+ optional: true++ '@oxlint/[email protected]':+ optional: true++ '@oxlint/[email protected]':+ optional: true++ '@oxlint/[email protected]':+ optional: true++ '@oxlint/[email protected]':+ optional: true++ '@oxlint/[email protected]':+ optional: true++ '@oxlint/[email protected]':+ optional: true++ '@oxlint/[email protected]':+ optional: true++ '@oxlint/[email protected]':+ optional: true++ '@oxlint/[email protected]':+ optional: true++ '@parcel/[email protected]':+ optional: true++ '@parcel/[email protected]':+ optional: true++ '@parcel/[email protected]':+ optional: true++ '@parcel/[email protected]':+ optional: true++ '@parcel/[email protected]':+ optional: true++ '@parcel/[email protected]':+ optional: true++ '@parcel/[email protected]':+ optional: true++ '@parcel/[email protected]':+ optional: true++ '@parcel/[email protected]':+ optional: true++ '@parcel/[email protected]':+ optional: true++ '@parcel/[email protected]':+ optional: true++ '@parcel/[email protected]':+ optional: true++ '@parcel/[email protected]':+ dependencies:+ detect-libc: 2.1.2+ is-glob: 4.0.3+ node-addon-api: 7.1.1+ picomatch: 4.0.5+ optionalDependencies:+ '@parcel/watcher-android-arm64': 2.6.0+ '@parcel/watcher-darwin-arm64': 2.6.0+ '@parcel/watcher-darwin-x64': 2.6.0+ '@parcel/watcher-freebsd-x64': 2.6.0+ '@parcel/watcher-linux-arm-glibc': 2.6.0+ '@parcel/watcher-linux-arm-musl': 2.6.0+ '@parcel/watcher-linux-arm64-glibc': 2.6.0+ '@parcel/watcher-linux-arm64-musl': 2.6.0+ '@parcel/watcher-linux-x64-glibc': 2.6.0+ '@parcel/watcher-linux-x64-musl': 2.6.0+ '@parcel/watcher-win32-arm64': 2.6.0+ '@parcel/watcher-win32-x64': 2.6.0+'@pkgjs/[email protected]':optional: true@@ -8546,13 +8696,6 @@ snapshots:dependencies:playwright: 1.60.0- '@prisma/[email protected](@opentelemetry/[email protected])':- dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- transitivePeerDependencies:- - supports-color-'@protobuf-ts/[email protected]': {}'@radix-ui/[email protected]':@@ -8561,751 +8704,824 @@ snapshots:'@radix-ui/[email protected]': {}- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@radix-ui/primitive': 1.1.1- '@radix-ui/react-collapsible': 1.1.3(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-collection': 1.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-direction': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])- optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1-- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/react-collapsible': 1.1.3(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-collection': 1.1.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-direction': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])+ optionalDependencies:+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])++ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@radix-ui/primitive': 1.1.1- '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-dialog': 1.1.6(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-slot': 1.1.2(@types/[email protected])([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-dialog': 1.1.6(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-slot': 1.1.2(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:- '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@radix-ui/primitive': 1.1.1- '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-presence': 1.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-use-layout-effect': 1.1.0(@types/[email protected])([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-presence': 1.1.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-use-layout-effect': 1.1.0(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:- '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-slot': 1.1.2(@types/[email protected])([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-slot': 1.1.2(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])dependencies:'@babel/runtime': 7.26.9- react: 18.3.1+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:- react: 18.3.1+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:'@babel/runtime': 7.26.9- react: 18.3.1+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:- react: 18.3.1+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@babel/runtime': 7.26.9'@radix-ui/primitive': 1.0.1- '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])- '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])- '@radix-ui/react-dismissable-layer': 1.0.5(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-focus-guards': 1.0.1(@types/[email protected])([email protected])- '@radix-ui/react-focus-scope': 1.0.4(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-id': 1.0.1(@types/[email protected])([email protected])- '@radix-ui/react-portal': 1.0.4(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-presence': 1.0.1(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-slot': 1.0.2(@types/[email protected])([email protected])- '@radix-ui/react-use-controllable-state': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-dismissable-layer': 1.0.5(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-focus-guards': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-focus-scope': 1.0.4(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-id': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-portal': 1.0.4(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-presence': 1.0.1(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-slot': 1.0.2(@types/[email protected])([email protected])+ '@radix-ui/react-use-controllable-state': 1.0.1(@types/[email protected])([email protected])aria-hidden: 1.2.4- react: 18.3.1- react-dom: 18.3.1([email protected])- react-remove-scroll: 2.5.5(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])+ react-remove-scroll: 2.5.5(@types/[email protected])([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@radix-ui/primitive': 1.1.1- '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-dismissable-layer': 1.1.5(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-focus-guards': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-focus-scope': 1.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-portal': 1.1.4(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-presence': 1.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-slot': 1.1.2(@types/[email protected])([email protected])- '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-dismissable-layer': 1.1.5(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-focus-guards': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-focus-scope': 1.1.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-portal': 1.1.4(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-presence': 1.1.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-slot': 1.1.2(@types/[email protected])([email protected])+ '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])aria-hidden: 1.2.4- react: 18.3.1- react-dom: 18.3.1([email protected])- react-remove-scroll: 2.6.3(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])+ react-remove-scroll: 2.6.3(@types/[email protected])([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])dependencies:- react: 18.3.1+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@babel/runtime': 7.26.9'@radix-ui/primitive': 1.0.1- '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])- '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])- '@radix-ui/react-use-escape-keydown': 1.0.3(@types/[email protected])([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-use-escape-keydown': 1.0.3(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@radix-ui/primitive': 1.1.1- '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-use-escape-keydown': 1.1.0(@types/[email protected])([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-use-escape-keydown': 1.1.0(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@radix-ui/primitive': 1.1.1- '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-menu': 2.1.6(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-menu': 2.1.6(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])dependencies:'@babel/runtime': 7.26.9- react: 18.3.1+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:- react: 18.3.1+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@babel/runtime': 7.26.9- '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])- '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:- '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])dependencies:'@babel/runtime': 7.26.9- '@radix-ui/react-use-layout-effect': 1.0.1(@types/[email protected])([email protected])- react: 18.3.1+ '@radix-ui/react-use-layout-effect': 1.0.1(@types/[email protected])([email protected])+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:- '@radix-ui/react-use-layout-effect': 1.1.0(@types/[email protected])([email protected])- react: 18.3.1+ '@radix-ui/react-use-layout-effect': 1.1.0(@types/[email protected])([email protected])+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:- '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@radix-ui/primitive': 1.1.1- '@radix-ui/react-collection': 1.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-direction': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-dismissable-layer': 1.1.5(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-focus-guards': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-focus-scope': 1.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-popper': 1.2.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-portal': 1.1.4(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-presence': 1.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-roving-focus': 1.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-slot': 1.1.2(@types/[email protected])([email protected])- '@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-collection': 1.1.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-direction': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-dismissable-layer': 1.1.5(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-focus-guards': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-focus-scope': 1.1.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-popper': 1.2.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-portal': 1.1.4(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-presence': 1.1.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-roving-focus': 1.1.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-slot': 1.1.2(@types/[email protected])([email protected])+ '@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])aria-hidden: 1.2.4- react: 18.3.1- react-dom: 18.3.1([email protected])- react-remove-scroll: 2.6.3(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])+ react-remove-scroll: 2.6.3(@types/[email protected])([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@radix-ui/primitive': 1.1.1- '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-dismissable-layer': 1.1.5(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-focus-guards': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-focus-scope': 1.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-popper': 1.2.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-portal': 1.1.4(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-presence': 1.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-slot': 1.1.2(@types/[email protected])([email protected])- '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-dismissable-layer': 1.1.5(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-focus-guards': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-focus-scope': 1.1.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-popper': 1.2.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-portal': 1.1.4(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-presence': 1.1.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-slot': 1.1.2(@types/[email protected])([email protected])+ '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])aria-hidden: 1.2.4- react: 18.3.1- react-dom: 18.3.1([email protected])- react-remove-scroll: 2.6.3(@types/[email protected])([email protected])- optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1-- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':- dependencies:- '@radix-ui/react-arrow': 1.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-use-layout-effect': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-use-rect': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-use-size': 1.1.0(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])+ react-remove-scroll: 2.6.3(@types/[email protected])([email protected])+ optionalDependencies:+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])++ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':+ dependencies:+ '@radix-ui/react-arrow': 1.1.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-use-layout-effect': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-use-rect': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-use-size': 1.1.0(@types/[email protected])([email protected])'@radix-ui/rect': 1.1.0- react: 18.3.1- react-dom: 18.3.1([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@babel/runtime': 7.26.9- '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:- '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-use-layout-effect': 1.1.0(@types/[email protected])([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-use-layout-effect': 1.1.0(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@babel/runtime': 7.26.9- '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])- '@radix-ui/react-use-layout-effect': 1.0.1(@types/[email protected])([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-use-layout-effect': 1.0.1(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:- '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-use-layout-effect': 1.1.0(@types/[email protected])([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-use-layout-effect': 1.1.0(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@babel/runtime': 7.26.9- '@radix-ui/react-slot': 1.0.2(@types/[email protected])([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-slot': 1.0.2(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:- '@radix-ui/react-slot': 1.1.2(@types/[email protected])([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-slot': 1.1.2(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@radix-ui/primitive': 1.1.1- '@radix-ui/react-collection': 1.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-direction': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-collection': 1.1.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-direction': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:- '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])dependencies:'@babel/runtime': 7.26.9- '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])- react: 18.3.1+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:- '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])- react: 18.3.1+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@radix-ui/primitive': 1.1.1- '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-use-previous': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-use-size': 1.1.0(@types/[email protected])([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-use-previous': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-use-size': 1.1.0(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@radix-ui/primitive': 1.1.1- '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-direction': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-presence': 1.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-roving-focus': 1.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-direction': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-presence': 1.1.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-roving-focus': 1.1.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@radix-ui/primitive': 1.1.1- '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])- '@radix-ui/react-dismissable-layer': 1.1.5(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-popper': 1.2.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-portal': 1.1.4(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-presence': 1.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-slot': 1.1.2(@types/[email protected])([email protected])- '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])- '@radix-ui/react-visually-hidden': 1.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])- optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1-+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-dismissable-layer': 1.1.5(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-popper': 1.2.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-portal': 1.1.4(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-presence': 1.1.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-slot': 1.1.2(@types/[email protected])([email protected])+ '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-visually-hidden': 1.1.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])+ optionalDependencies:+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])+dependencies:'@babel/runtime': 7.26.9- react: 18.3.1+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:- react: 18.3.1+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:'@babel/runtime': 7.26.9- '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])- react: 18.3.1+ '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:- '@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])- react: 18.3.1+ '@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:'@babel/runtime': 7.26.9- '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])- react: 18.3.1+ '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:- '@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])- react: 18.3.1+ '@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:'@babel/runtime': 7.26.9- react: 18.3.1+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:- react: 18.3.1+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:- react: 18.3.1+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:'@radix-ui/rect': 1.1.0- react: 18.3.1+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:- '@radix-ui/react-use-layout-effect': 1.1.0(@types/[email protected])([email protected])- react: 18.3.1+ '@radix-ui/react-use-layout-effect': 1.1.0(@types/[email protected])([email protected])+ react: 19.2.8optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18- '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:- '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])'@radix-ui/[email protected]': {}dependencies:html-to-text: 9.0.5prettier: 3.4.2- react: 18.3.1- react-dom: 18.3.1([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])react-promise-suspense: 0.3.4- '@react-pdf/[email protected]': {}+ '@react-pdf/[email protected]': {}- '@react-pdf/[email protected]':+ '@react-pdf/[email protected]':dependencies:- '@react-pdf/pdfkit': 4.0.3- '@react-pdf/types': 2.9.0- fontkit: 2.0.4+ '@react-pdf/pdfkit': 6.0.1+ '@react-pdf/types': 2.11.3+ fontkit: 2.0.4(patch_hash=4578e940c13ce12f50c2ef0959a1b481d0a98f719932548b9b6bcbfd3832f9bd)is-url: 1.2.4- '@react-pdf/[email protected]':+ '@react-pdf/[email protected]':dependencies:- '@react-pdf/png-js': 3.0.0+ '@react-pdf/svg': 1.1.0jay-peg: 1.1.1+ png-js: 2.0.0- '@react-pdf/[email protected]':+ '@react-pdf/[email protected]':dependencies:- '@react-pdf/fns': 3.1.2- '@react-pdf/image': 3.0.3- '@react-pdf/primitives': 4.1.1- '@react-pdf/stylesheet': 6.1.0- '@react-pdf/textkit': 6.0.0- '@react-pdf/types': 2.9.0- emoji-regex: 10.4.0+ '@react-pdf/fns': 3.1.3+ '@react-pdf/image': 3.1.1+ '@react-pdf/primitives': 4.3.0+ '@react-pdf/stylesheet': 6.2.3+ '@react-pdf/textkit': 6.4.1+ '@react-pdf/types': 2.11.3+ emoji-regex-xs: 1.0.0queue: 6.0.2yoga-layout: 3.2.1- '@react-pdf/[email protected]':+ '@react-pdf/[email protected]':dependencies:'@babel/runtime': 7.26.9- '@react-pdf/png-js': 3.0.0- browserify-zlib: 0.2.0- crypto-js: 4.2.0- fontkit: 2.0.4- jay-peg: 1.1.1+ '@noble/ciphers': 1.3.0+ '@noble/hashes': 1.8.0+ fflate: 0.8.3+ fontkit: 2.0.4(patch_hash=4578e940c13ce12f50c2ef0959a1b481d0a98f719932548b9b6bcbfd3832f9bd)+ js-md5: 0.8.3linebreak: 1.1.0+ png-js: 2.0.0vite-compatible-readable-stream: 3.6.1- '@react-pdf/[email protected]':- dependencies:- browserify-zlib: 0.2.0-- '@react-pdf/[email protected]': {}+ '@react-pdf/[email protected]': {}- '@react-pdf/[email protected]([email protected])':+ '@react-pdf/[email protected]([email protected])':dependencies:object-assign: 4.1.1- react: 18.3.1+ react: 19.2.8scheduler: 0.25.0-rc-603e6108-20241029- '@react-pdf/[email protected]':+ '@react-pdf/[email protected]':dependencies:'@babel/runtime': 7.26.9- '@react-pdf/fns': 3.1.2- '@react-pdf/primitives': 4.1.1- '@react-pdf/textkit': 6.0.0- '@react-pdf/types': 2.9.0+ '@react-pdf/fns': 3.1.3+ '@react-pdf/primitives': 4.3.0+ '@react-pdf/textkit': 6.4.1+ '@react-pdf/types': 2.11.3abs-svg-path: 0.1.1- color-string: 1.9.1+ color-string: 2.1.4normalize-svg-path: 1.1.0parse-svg-path: 0.1.2svg-arc-to-cubic-bezier: 3.2.0- '@react-pdf/[email protected]([email protected])':+ '@react-pdf/[email protected]([email protected])':dependencies:'@babel/runtime': 7.26.9- '@react-pdf/fns': 3.1.2- '@react-pdf/font': 4.0.2- '@react-pdf/layout': 4.4.0- '@react-pdf/pdfkit': 4.0.3- '@react-pdf/primitives': 4.1.1- '@react-pdf/reconciler': 1.1.4([email protected])- '@react-pdf/render': 4.3.0- '@react-pdf/types': 2.9.0+ '@react-pdf/fns': 3.1.3+ '@react-pdf/font': 4.0.10+ '@react-pdf/layout': 4.7.1+ '@react-pdf/pdfkit': 6.0.1+ '@react-pdf/primitives': 4.3.0+ '@react-pdf/reconciler': 2.0.0([email protected])+ '@react-pdf/render': 4.6.1+ '@react-pdf/types': 2.11.3events: 3.3.0object-assign: 4.1.1prop-types: 15.8.1queue: 6.0.2- react: 18.3.1+ react: 19.2.8- '@react-pdf/[email protected]':+ '@react-pdf/[email protected]':dependencies:- '@react-pdf/fns': 3.1.2- '@react-pdf/types': 2.9.0- color-string: 1.9.1+ '@react-pdf/fns': 3.1.3+ '@react-pdf/types': 2.11.3+ color-string: 2.1.4hsl-to-hex: 1.0.0media-engine: 1.0.3postcss-value-parser: 4.2.0- '@react-pdf/[email protected]':+ '@react-pdf/[email protected]':dependencies:- '@react-pdf/fns': 3.1.2+ '@react-pdf/primitives': 4.3.0++ '@react-pdf/[email protected]':+ dependencies:+ '@react-pdf/fns': 3.1.3bidi-js: 1.0.3- hyphen: 1.10.6+ hyphen: 1.6.6unicode-properties: 1.4.1- '@react-pdf/[email protected]':+ '@react-pdf/[email protected]':dependencies:- '@react-pdf/font': 4.0.2- '@react-pdf/primitives': 4.1.1- '@react-pdf/stylesheet': 6.1.0+ '@react-pdf/font': 4.0.10+ '@react-pdf/primitives': 4.3.0+ '@react-pdf/stylesheet': 6.2.3- '@rollup/[email protected]([email protected])':+ '@rollup/[email protected]([email protected])':dependencies:- '@rollup/pluginutils': 5.1.4([email protected])+ '@rollup/pluginutils': 5.1.4([email protected])commondir: 1.0.1estree-walker: 2.0.2- fdir: 6.4.4([email protected])+ fdir: 6.5.0([email protected])is-reference: 1.2.1magic-string: 0.30.17picomatch: 4.0.3optionalDependencies:- rollup: 3.29.5+ rollup: 4.62.4- '@rollup/[email protected]([email protected])':+ '@rollup/[email protected]([email protected])':dependencies:'@types/estree': 1.0.8estree-walker: 2.0.2picomatch: 4.0.3optionalDependencies:- rollup: 3.29.5+ rollup: 4.62.4'@rollup/[email protected]':optional: true+ '@rollup/[email protected]':+ optional: true+'@rollup/[email protected]':optional: true+ '@rollup/[email protected]':+ optional: true+'@rollup/[email protected]':optional: true+ '@rollup/[email protected]':+ optional: true+'@rollup/[email protected]':optional: true+ '@rollup/[email protected]':+ optional: true+'@rollup/[email protected]':optional: true+ '@rollup/[email protected]':+ optional: true+'@rollup/[email protected]':optional: true+ '@rollup/[email protected]':+ optional: true+'@rollup/[email protected]':optional: true+ '@rollup/[email protected]':+ optional: true+'@rollup/[email protected]':optional: true+ '@rollup/[email protected]':+ optional: true+'@rollup/[email protected]':optional: true+ '@rollup/[email protected]':+ optional: true+'@rollup/[email protected]':optional: true+ '@rollup/[email protected]':+ optional: true++ '@rollup/[email protected]':+ optional: true++ '@rollup/[email protected]':+ optional: true+'@rollup/[email protected]':optional: true'@rollup/[email protected]':optional: true+ '@rollup/[email protected]':+ optional: true++ '@rollup/[email protected]':+ optional: true+'@rollup/[email protected]':optional: true+ '@rollup/[email protected]':+ optional: true+'@rollup/[email protected]':optional: true+ '@rollup/[email protected]':+ optional: true+'@rollup/[email protected]':optional: true+ '@rollup/[email protected]':+ optional: true+'@rollup/[email protected]':optional: true+ '@rollup/[email protected]':+ optional: true+'@rollup/[email protected]':optional: true+ '@rollup/[email protected]':+ optional: true++ '@rollup/[email protected]':+ optional: true++ '@rollup/[email protected]':+ optional: true+'@rollup/[email protected]':optional: true+ '@rollup/[email protected]':+ optional: true+'@rollup/[email protected]':optional: true- '@rollup/[email protected]':+ '@rollup/[email protected]':+ optional: true++ '@rollup/[email protected]':optional: true- '@rtsao/[email protected]': {}+ '@rollup/[email protected]':+ optional: true- '@rushstack/[email protected]': {}+ '@rollup/[email protected]':+ optional: true'@s2-dev/[email protected]':dependencies:@@ -9323,70 +9539,76 @@ snapshots:domhandler: 5.0.3selderee: 0.11.0- '@sentry-internal/[email protected]':- dependencies:- '@sentry/core': 9.3.0-- '@sentry-internal/[email protected]':- dependencies:- '@sentry/core': 9.3.0+ '@sentry/[email protected]': {}- '@sentry-internal/[email protected]':+ '@sentry/[email protected]':dependencies:- '@sentry-internal/replay': 9.3.0- '@sentry/core': 9.3.0+ '@sentry/conventions': 0.16.0+ '@sentry/core': 10.70.0- '@sentry-internal/[email protected]':+ '@sentry/[email protected]':dependencies:- '@sentry-internal/browser-utils': 9.3.0- '@sentry/core': 9.3.0-- '@sentry/[email protected]': {}+ '@sentry/browser-utils': 10.70.0+ '@sentry/conventions': 0.16.0+ '@sentry/core': 10.70.0+ '@sentry/feedback': 10.70.0+ '@sentry/replay': 10.70.0+ '@sentry/replay-canvas': 10.70.0- '@sentry/[email protected]':+ '@sentry/[email protected]':dependencies:- '@sentry-internal/browser-utils': 9.3.0- '@sentry-internal/feedback': 9.3.0- '@sentry-internal/replay': 9.3.0- '@sentry-internal/replay-canvas': 9.3.0- '@sentry/core': 9.3.0+ '@babel/core': 7.28.3+ '@sentry/babel-plugin-component-annotate': 5.3.0+ '@sentry/cli': 2.58.6+ dotenv: 16.4.7+ find-up: 5.0.0+ glob: 13.0.6+ magic-string: 0.30.17+ transitivePeerDependencies:+ - encoding+ - supports-color- '@sentry/[email protected]':dependencies:- '@babel/core': 7.26.9- '@sentry/babel-plugin-component-annotate': 3.1.2- '@sentry/cli': 2.41.1- dotenv: 16.4.7+ '@babel/core': 7.28.3+ '@sentry/cli': 2.58.6+ '@sentry/core': 10.70.0+ dotenv: 17.4.2find-up: 5.0.0- glob: 9.3.5- magic-string: 0.30.8- unplugin: 1.0.1+ glob: 13.0.6+ magic-string: 0.30.17+ optionalDependencies:+ rollup: 4.62.4+ webpack: 5.98.0transitivePeerDependencies:- encoding- supports-color- '@sentry/[email protected]':+ '@sentry/[email protected]':+ optional: true++ '@sentry/[email protected]':optional: true- '@sentry/[email protected]':+ '@sentry/[email protected]':optional: true- '@sentry/[email protected]':+ '@sentry/[email protected]':optional: true- '@sentry/[email protected]':+ '@sentry/[email protected]':optional: true- '@sentry/[email protected]':+ '@sentry/[email protected]':optional: true- '@sentry/[email protected]':+ '@sentry/[email protected]':optional: true- '@sentry/[email protected]':+ '@sentry/[email protected]':optional: true- '@sentry/[email protected]':+ '@sentry/[email protected]':dependencies:https-proxy-agent: 5.0.1node-fetch: 2.7.0@@ -9394,155 +9616,215 @@ snapshots:proxy-from-env: 1.1.0which: 2.0.2optionalDependencies:- '@sentry/cli-darwin': 2.41.1- '@sentry/cli-linux-arm': 2.41.1- '@sentry/cli-linux-arm64': 2.41.1- '@sentry/cli-linux-i686': 2.41.1- '@sentry/cli-linux-x64': 2.41.1- '@sentry/cli-win32-i686': 2.41.1- '@sentry/cli-win32-x64': 2.41.1+ '@sentry/cli-darwin': 2.58.6+ '@sentry/cli-linux-arm': 2.58.6+ '@sentry/cli-linux-arm64': 2.58.6+ '@sentry/cli-linux-i686': 2.58.6+ '@sentry/cli-linux-x64': 2.58.6+ '@sentry/cli-win32-arm64': 2.58.6+ '@sentry/cli-win32-i686': 2.58.6+ '@sentry/cli-win32-x64': 2.58.6transitivePeerDependencies:- encoding- supports-color- '@sentry/[email protected]': {}-- '@sentry/[email protected](@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected])':- dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/semantic-conventions': 1.30.0- '@rollup/plugin-commonjs': 28.0.1([email protected])- '@sentry-internal/browser-utils': 9.3.0- '@sentry/core': 9.3.0- '@sentry/node': 9.3.0- '@sentry/opentelemetry': 9.3.0(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected])- '@sentry/react': 9.3.0([email protected])- '@sentry/vercel-edge': 9.3.0- '@sentry/webpack-plugin': 3.1.2([email protected])- chalk: 3.0.0- next: 14.2.15(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected])- resolve: 1.22.8- rollup: 3.29.5+ '@sentry/[email protected]': {}++ '@sentry/[email protected]':+ dependencies:+ '@sentry/conventions': 0.16.0++ '@sentry/[email protected]':+ dependencies:+ '@sentry/core': 10.70.0++ '@sentry/[email protected](@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected])':+ dependencies:+ '@opentelemetry/api': 1.9.1+ '@rollup/plugin-commonjs': 28.0.1([email protected])+ '@sentry/browser-utils': 10.70.0+ '@sentry/bundler-plugin-core': 5.3.0+ '@sentry/conventions': 0.16.0+ '@sentry/core': 10.70.0+ '@sentry/node': 10.70.0(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))+ '@sentry/opentelemetry': 10.70.0(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))+ '@sentry/react': 10.70.0([email protected])+ '@sentry/server-utils': 10.70.0+ '@sentry/vercel-edge': 10.70.0+ '@sentry/webpack-plugin': 5.4.0([email protected])([email protected])+ next: 15.5.24(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected])+ rollup: 4.62.4stacktrace-parser: 0.1.11transitivePeerDependencies:- - '@opentelemetry/context-async-hooks'- '@opentelemetry/core'- - '@opentelemetry/instrumentation'+ - '@opentelemetry/exporter-trace-otlp-http'- '@opentelemetry/sdk-trace-base'- encoding- react- supports-color- webpack- '@sentry/[email protected]':- dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/context-async-hooks': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/core': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-amqplib': 0.46.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-connect': 0.43.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-dataloader': 0.16.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-express': 0.47.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-fastify': 0.44.2(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-fs': 0.19.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-generic-pool': 0.43.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-graphql': 0.47.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-hapi': 0.45.2(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-http': 0.57.2(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-ioredis': 0.47.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-kafkajs': 0.7.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-knex': 0.44.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-koa': 0.47.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-lru-memoizer': 0.44.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-mongodb': 0.52.0(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-mongoose': 0.46.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-mysql': 0.45.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-mysql2': 0.45.2(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-pg': 0.51.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-redis-4': 0.46.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-tedious': 0.18.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation-undici': 0.10.1(@opentelemetry/[email protected])- '@opentelemetry/resources': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/sdk-trace-base': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/semantic-conventions': 1.30.0- '@prisma/instrumentation': 6.4.1(@opentelemetry/[email protected])- '@sentry/core': 9.3.0- '@sentry/opentelemetry': 9.3.0(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected])- import-in-the-middle: 1.13.1+ '@sentry/[email protected](@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))':+ dependencies:+ '@sentry/conventions': 0.16.0+ '@sentry/core': 10.70.0+ '@sentry/opentelemetry': 10.70.0(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))+ import-in-the-middle: 3.3.3+ optionalDependencies:+ '@opentelemetry/api': 1.9.1+ '@opentelemetry/core': 2.10.0(@opentelemetry/[email protected])+ '@opentelemetry/exporter-trace-otlp-http': 0.218.0(@opentelemetry/[email protected])+ '@opentelemetry/instrumentation': 0.220.0(@opentelemetry/[email protected])+ '@opentelemetry/sdk-trace-base': 2.10.0(@opentelemetry/[email protected])++ '@sentry/[email protected](@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))':+ dependencies:+ '@opentelemetry/api': 1.9.1+ '@opentelemetry/instrumentation': 0.220.0(@opentelemetry/[email protected])+ '@opentelemetry/sdk-trace-base': 2.10.0(@opentelemetry/[email protected])+ '@sentry/conventions': 0.16.0+ '@sentry/core': 10.70.0+ '@sentry/node-core': 10.70.0(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))+ '@sentry/opentelemetry': 10.70.0(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))+ '@sentry/server-utils': 10.70.0+ import-in-the-middle: 3.3.3transitivePeerDependencies:+ - '@opentelemetry/core'+ - '@opentelemetry/exporter-trace-otlp-http'- supports-color- '@sentry/[email protected](@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected])':+ '@sentry/[email protected](@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))':+ dependencies:+ '@opentelemetry/api': 1.9.1+ '@opentelemetry/core': 2.10.0(@opentelemetry/[email protected])+ '@opentelemetry/sdk-trace-base': 2.10.0(@opentelemetry/[email protected])+ '@sentry/conventions': 0.16.0+ '@sentry/core': 10.70.0++ '@sentry/[email protected]([email protected])':dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/context-async-hooks': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/core': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation': 0.57.2(@opentelemetry/[email protected])- '@opentelemetry/sdk-trace-base': 1.30.1(@opentelemetry/[email protected])- '@opentelemetry/semantic-conventions': 1.30.0- '@sentry/core': 9.3.0+ '@sentry/browser': 10.70.0+ '@sentry/conventions': 0.16.0+ '@sentry/core': 10.70.0+ react: 19.2.8- '@sentry/[email protected](@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected])':+ '@sentry/[email protected]':dependencies:- '@opentelemetry/api': 1.9.0- '@opentelemetry/context-async-hooks': 2.7.1(@opentelemetry/[email protected])- '@opentelemetry/core': 2.7.1(@opentelemetry/[email protected])- '@opentelemetry/instrumentation': 0.218.0(@opentelemetry/[email protected])- '@opentelemetry/sdk-trace-base': 2.7.1(@opentelemetry/[email protected])- '@opentelemetry/semantic-conventions': 1.30.0- '@sentry/core': 9.3.0+ '@sentry/core': 10.70.0+ '@sentry/replay': 10.70.0++ '@sentry/[email protected]':+ dependencies:+ '@sentry/browser-utils': 10.70.0+ '@sentry/core': 10.70.0- '@sentry/[email protected]([email protected])':+ '@sentry/[email protected]':dependencies:- '@sentry/browser': 9.3.0- '@sentry/core': 9.3.0- hoist-non-react-statics: 3.3.2- react: 18.3.1+ '@apm-js-collab/code-transformer-bundler-plugins': 0.7.4+ '@apm-js-collab/tracing-hooks': 0.13.0+ '@sentry/conventions': 0.16.0+ '@sentry/core': 10.70.0+ meriyah: 6.1.4+ transitivePeerDependencies:+ - supports-color- '@sentry/[email protected]':+ '@sentry/[email protected]':dependencies:- '@opentelemetry/api': 1.9.0- '@sentry/core': 9.3.0+ '@opentelemetry/api': 1.9.1+ '@sentry/core': 10.70.0- '@sentry/[email protected]([email protected])':dependencies:- '@sentry/bundler-plugin-core': 3.1.2- unplugin: 1.0.1- uuid: 9.0.1+ '@sentry/bundler-plugins': 10.70.0([email protected])([email protected])webpack: 5.98.0transitivePeerDependencies:- encoding+ - rollup- supports-color'@sindresorhus/[email protected]': {}'@socket.io/[email protected]': {}+ '@standard-schema/[email protected]': {}++ '@swc/[email protected]':+ optional: true++ '@swc/[email protected]':+ optional: true++ '@swc/[email protected]':+ optional: true++ '@swc/[email protected]':+ optional: true++ '@swc/[email protected]':+ optional: true++ '@swc/[email protected]':+ optional: true++ '@swc/[email protected]':+ optional: true++ '@swc/[email protected]':+ optional: true++ '@swc/[email protected]':+ optional: true++ '@swc/[email protected]':+ optional: true++ '@swc/[email protected]':+ optional: true++ '@swc/[email protected]':+ optional: true++ '@swc/[email protected]':+ dependencies:+ '@swc/counter': 0.1.3+ '@swc/types': 0.1.28+ optionalDependencies:+ '@swc/core-darwin-arm64': 1.15.47+ '@swc/core-darwin-x64': 1.15.47+ '@swc/core-linux-arm-gnueabihf': 1.15.47+ '@swc/core-linux-arm64-gnu': 1.15.47+ '@swc/core-linux-arm64-musl': 1.15.47+ '@swc/core-linux-ppc64-gnu': 1.15.47+ '@swc/core-linux-s390x-gnu': 1.15.47+ '@swc/core-linux-x64-gnu': 1.15.47+ '@swc/core-linux-x64-musl': 1.15.47+ '@swc/core-win32-arm64-msvc': 1.15.47+ '@swc/core-win32-ia32-msvc': 1.15.47+ '@swc/core-win32-x64-msvc': 1.15.47+'@swc/[email protected]': {}'@swc/[email protected]':dependencies:tslib: 2.8.1- '@swc/[email protected]':+ '@swc/[email protected]':dependencies:'@swc/counter': 0.1.3- tslib: 2.8.1dependencies:arktype: 2.1.20optionalDependencies:- typescript: 5.9.3- zod: 3.24.4+ typescript: 6.0.3+ zod: 4.5.4dependencies:optionalDependencies:- typescript: 5.9.3- zod: 3.24.4+ typescript: 6.0.3+ zod: 4.5.4transitivePeerDependencies:- arktype@@ -9574,15 +9856,15 @@ snapshots:picocolors: 1.1.1redent: 3.0.0- '@testing-library/[email protected](@testing-library/[email protected])(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@testing-library/[email protected](@testing-library/[email protected])(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@babel/runtime': 7.26.9'@testing-library/dom': 10.4.1- react: 18.3.1- react-dom: 18.3.1([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])optionalDependencies:- '@types/react': 18.3.12- '@types/react-dom': 18.3.1+ '@types/react': 19.2.18+ '@types/react-dom': 19.2.4(@types/[email protected])'@testing-library/[email protected](@testing-library/[email protected])':dependencies:@@ -9622,444 +9904,140 @@ snapshots:std-env: 3.9.0tinyexec: 0.3.2uncrypto: 0.1.3- zod: 3.25.76- zod-error: 1.5.0- zod-validation-error: 1.5.0([email protected])- transitivePeerDependencies:- - bufferutil- - supports-color- - utf-8-validate-- dependencies:- '@opentelemetry/api': 1.9.1- '@opentelemetry/semantic-conventions': 1.41.1- '@trigger.dev/core': 4.5.6- chalk: 5.4.1- cronstrue: 2.59.0- debug: 4.4.3- evt: 2.5.9- slug: 6.1.0- ulid: 2.4.0- uncrypto: 0.1.3- ws: 8.21.0- zod: 3.24.4- optionalDependencies:- react: 18.3.1- transitivePeerDependencies:- - bufferutil- - supports-color- - utf-8-validate-- '@ts-morph/[email protected]':- dependencies:- fast-glob: 3.3.3- minimatch: 10.0.3- path-browserify: 1.0.1-- '@tybys/[email protected]':- dependencies:- tslib: 2.8.1- optional: true-- '@tybys/[email protected]':- dependencies:- tslib: 2.8.1- optional: true-- '@types/[email protected]': {}-- '@types/[email protected]':- dependencies:- '@types/deep-eql': 4.0.2-- '@types/[email protected]':- dependencies:- '@types/node': 22.8.1-- '@types/[email protected]': {}-- '@types/[email protected]': {}-- '@types/[email protected]':- dependencies:- '@types/node': 22.8.1-- '@types/[email protected]':- dependencies:- '@types/ms': 2.1.0-- '@types/[email protected]': {}-- '@types/[email protected]':- dependencies:- '@types/eslint': 9.6.1- '@types/estree': 1.0.8-- '@types/[email protected]':- dependencies:- '@types/estree': 1.0.8- '@types/json-schema': 7.0.15-- '@types/[email protected]':- dependencies:- '@types/estree': 1.0.8-- '@types/[email protected]': {}-- '@types/[email protected]': {}-- '@types/[email protected]': {}-- '@types/[email protected]':- dependencies:- '@types/unist': 3.0.3-- '@types/[email protected]': {}-- '@types/[email protected]': {}-- '@types/[email protected]':- dependencies:- '@types/unist': 3.0.3-- '@types/[email protected]': {}-- '@types/[email protected]': {}-- '@types/[email protected]':- dependencies:- '@types/node': 22.8.1-- '@types/[email protected]':- dependencies:- '@types/node': 22.8.1- form-data: 4.0.2-- '@types/[email protected]':- dependencies:- undici-types: 6.19.8-- '@types/[email protected]':- dependencies:- '@types/pg': 8.6.1-- '@types/[email protected]':- dependencies:- '@types/node': 22.8.1- pg-protocol: 1.7.1- pg-types: 2.2.0-- '@types/[email protected]': {}-- '@types/[email protected]':- dependencies:- '@types/node': 22.8.1-- '@types/[email protected]':- dependencies:- '@types/react': 18.3.12-- '@types/[email protected]':- dependencies:- '@types/prop-types': 15.7.13- csstype: 3.1.3-- '@types/[email protected]': {}-- '@types/[email protected]': {}-- '@types/[email protected]':- dependencies:- '@types/node': 22.8.1-- '@types/[email protected]': {}-- '@types/[email protected]': {}-- '@types/[email protected]': {}-- '@types/[email protected]': {}-- '@types/[email protected]':- dependencies:- '@types/node': 22.8.1-- '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])':- dependencies:- '@eslint-community/regexpp': 4.12.1- '@typescript-eslint/scope-manager': 8.40.0- '@typescript-eslint/visitor-keys': 8.40.0- eslint: 9.33.0([email protected])- graphemer: 1.4.0- ignore: 7.0.5- natural-compare: 1.4.0- ts-api-utils: 2.1.0([email protected])- typescript: 5.9.3- transitivePeerDependencies:- - supports-color-- '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])':- dependencies:- '@eslint-community/regexpp': 4.12.2- '@typescript-eslint/scope-manager': 8.56.0- '@typescript-eslint/visitor-keys': 8.56.0- eslint: 9.33.0([email protected])- ignore: 7.0.5- natural-compare: 1.4.0- ts-api-utils: 2.4.0([email protected])- typescript: 5.9.3- transitivePeerDependencies:- - supports-color-- dependencies:- '@typescript-eslint/scope-manager': 8.40.0- '@typescript-eslint/types': 8.40.0- '@typescript-eslint/typescript-estree': 8.40.0([email protected])- '@typescript-eslint/visitor-keys': 8.40.0- debug: 4.4.3- eslint: 9.33.0([email protected])- typescript: 5.9.3- transitivePeerDependencies:- - supports-color-- dependencies:- '@typescript-eslint/scope-manager': 8.56.0- '@typescript-eslint/types': 8.56.0- '@typescript-eslint/typescript-estree': 8.56.0([email protected])- '@typescript-eslint/visitor-keys': 8.56.0- debug: 4.4.3- eslint: 9.33.0([email protected])- typescript: 5.9.3- transitivePeerDependencies:- - supports-color-- '@typescript-eslint/[email protected]([email protected])':- dependencies:- '@typescript-eslint/tsconfig-utils': 8.40.0([email protected])- '@typescript-eslint/types': 8.40.0- debug: 4.4.3- typescript: 5.9.3- transitivePeerDependencies:- - supports-color-- '@typescript-eslint/[email protected]([email protected])':- dependencies:- '@typescript-eslint/tsconfig-utils': 8.56.0([email protected])- '@typescript-eslint/types': 8.56.0- debug: 4.4.3- typescript: 5.9.3- transitivePeerDependencies:- - supports-color-- '@typescript-eslint/[email protected]':- dependencies:- '@typescript-eslint/types': 8.40.0- '@typescript-eslint/visitor-keys': 8.40.0-- '@typescript-eslint/[email protected]':- dependencies:- '@typescript-eslint/types': 8.56.0- '@typescript-eslint/visitor-keys': 8.56.0-- '@typescript-eslint/[email protected]([email protected])':- dependencies:- typescript: 5.9.3-- '@typescript-eslint/[email protected]([email protected])':- dependencies:- typescript: 5.9.3-- dependencies:- '@typescript-eslint/types': 8.40.0- '@typescript-eslint/typescript-estree': 8.40.0([email protected])- debug: 4.4.3- eslint: 9.33.0([email protected])- ts-api-utils: 2.1.0([email protected])- typescript: 5.9.3+ zod: 3.25.76+ zod-error: 1.5.0+ zod-validation-error: 1.5.0([email protected])transitivePeerDependencies:+ - bufferutil- supports-color+ - utf-8-validatedependencies:- '@typescript-eslint/types': 8.56.0- '@typescript-eslint/typescript-estree': 8.56.0([email protected])+ '@opentelemetry/api': 1.9.1+ '@opentelemetry/semantic-conventions': 1.41.1+ '@trigger.dev/core': 4.5.6+ chalk: 5.4.1+ cronstrue: 2.59.0debug: 4.4.3- eslint: 9.33.0([email protected])- ts-api-utils: 2.4.0([email protected])- typescript: 5.9.3+ evt: 2.5.9+ slug: 6.1.0+ ulid: 2.4.0+ uncrypto: 0.1.3+ ws: 8.21.0+ zod: 4.5.4+ optionalDependencies:+ react: 19.2.8transitivePeerDependencies:+ - bufferutil- supports-color+ - utf-8-validate- '@typescript-eslint/[email protected]': {}-- '@typescript-eslint/[email protected]': {}-- '@typescript-eslint/[email protected]([email protected])':+ '@ts-morph/[email protected]':dependencies:- '@typescript-eslint/project-service': 8.40.0([email protected])- '@typescript-eslint/tsconfig-utils': 8.40.0([email protected])- '@typescript-eslint/types': 8.40.0- '@typescript-eslint/visitor-keys': 8.40.0- debug: 4.4.3fast-glob: 3.3.3- is-glob: 4.0.3- minimatch: 9.0.5- semver: 7.7.4- ts-api-utils: 2.1.0([email protected])- typescript: 5.9.3- transitivePeerDependencies:- - supports-color+ minimatch: 10.2.6+ path-browserify: 1.0.1- '@typescript-eslint/[email protected]([email protected])':+ '@tybys/[email protected]':dependencies:- '@typescript-eslint/project-service': 8.56.0([email protected])- '@typescript-eslint/tsconfig-utils': 8.56.0([email protected])- '@typescript-eslint/types': 8.56.0- '@typescript-eslint/visitor-keys': 8.56.0- debug: 4.4.3- minimatch: 9.0.5- semver: 7.7.4- tinyglobby: 0.2.15- ts-api-utils: 2.4.0([email protected])- typescript: 5.9.3- transitivePeerDependencies:- - supports-color+ tslib: 2.8.1+ optional: true- dependencies:- '@eslint-community/eslint-utils': 4.7.0([email protected]([email protected]))- '@typescript-eslint/scope-manager': 8.40.0- '@typescript-eslint/types': 8.40.0- '@typescript-eslint/typescript-estree': 8.40.0([email protected])- eslint: 9.33.0([email protected])- typescript: 5.9.3- transitivePeerDependencies:- - supports-color+ '@types/[email protected]': {}+ '@types/[email protected]':dependencies:- '@eslint-community/eslint-utils': 4.9.1([email protected]([email protected]))- '@typescript-eslint/scope-manager': 8.56.0- '@typescript-eslint/types': 8.56.0- '@typescript-eslint/typescript-estree': 8.56.0([email protected])- eslint: 9.33.0([email protected])- typescript: 5.9.3- transitivePeerDependencies:- - supports-color+ '@types/deep-eql': 4.0.2++ '@types/[email protected]': {}- '@typescript-eslint/[email protected]':+ '@types/[email protected]': {}++ '@types/[email protected]':dependencies:- '@typescript-eslint/types': 8.40.0- eslint-visitor-keys: 4.2.1+ '@types/node': 22.8.1- '@typescript-eslint/[email protected]':+ '@types/[email protected]':dependencies:- '@typescript-eslint/types': 8.56.0- eslint-visitor-keys: 5.0.1+ '@types/ms': 2.1.0- '@typescript/[email protected]':- optional: true+ '@types/[email protected]': {}- '@typescript/[email protected]':- optional: true+ '@types/[email protected]':+ dependencies:+ '@types/eslint': 9.6.1+ '@types/estree': 1.0.9- '@typescript/[email protected]':- optional: true+ '@types/[email protected]':+ dependencies:+ '@types/estree': 1.0.9+ '@types/json-schema': 7.0.15- '@typescript/[email protected]':- optional: true+ '@types/[email protected]': {}- '@typescript/[email protected]':- optional: true+ '@types/[email protected]':+ dependencies:+ '@types/estree': 1.0.8- '@typescript/[email protected]':- optional: true+ '@types/[email protected]': {}- '@typescript/[email protected]':- optional: true+ '@types/[email protected]': {}- '@typescript/[email protected]':- optionalDependencies:- '@typescript/native-preview-darwin-arm64': 7.0.0-dev.20260217.1- '@typescript/native-preview-darwin-x64': 7.0.0-dev.20260217.1- '@typescript/native-preview-linux-arm': 7.0.0-dev.20260217.1- '@typescript/native-preview-linux-arm64': 7.0.0-dev.20260217.1- '@typescript/native-preview-linux-x64': 7.0.0-dev.20260217.1- '@typescript/native-preview-win32-arm64': 7.0.0-dev.20260217.1- '@typescript/native-preview-win32-x64': 7.0.0-dev.20260217.1+ '@types/[email protected]': {}- '@ungap/[email protected]': {}+ '@types/[email protected]': {}- '@unrs/[email protected]':- optional: true+ '@types/[email protected]':+ dependencies:+ '@types/unist': 3.0.3- '@unrs/[email protected]':- optional: true+ '@types/[email protected]': {}- '@unrs/[email protected]':- optional: true+ '@types/[email protected]':+ dependencies:+ '@types/unist': 3.0.3- '@unrs/[email protected]':- optional: true+ '@types/[email protected]': {}- '@unrs/[email protected]':- optional: true+ '@types/[email protected]': {}- '@unrs/[email protected]':- optional: true+ '@types/[email protected]':+ dependencies:+ '@types/node': 22.8.1+ form-data: 4.0.2- '@unrs/[email protected]':- optional: true+ '@types/[email protected]':+ dependencies:+ undici-types: 6.19.8- '@unrs/[email protected]':- optional: true+ '@types/[email protected]':+ dependencies:+ '@types/node': 22.8.1- '@unrs/[email protected]':- optional: true+ '@types/[email protected](@types/[email protected])':+ dependencies:+ '@types/react': 19.2.18- '@unrs/[email protected]':- optional: true+ '@types/[email protected]':+ dependencies:+ csstype: 3.2.3- '@unrs/[email protected]':- optional: true+ '@types/[email protected]': {}- '@unrs/[email protected]':- optional: true+ '@types/[email protected]': {}- '@unrs/[email protected]':- optional: true+ '@types/[email protected]': {}- '@unrs/[email protected]':- optional: true+ '@types/[email protected]': {}- '@unrs/[email protected]':- optional: true+ '@types/[email protected]': {}- '@unrs/[email protected]':+ '@types/[email protected]':dependencies:- '@napi-rs/wasm-runtime': 0.2.12- optional: true-- '@unrs/[email protected]':- optional: true-- '@unrs/[email protected]':- optional: true+ '@types/node': 22.8.1- '@unrs/[email protected]':- optional: true+ '@ungap/[email protected]': {}'@upstash/[email protected]':dependencies:@@ -10080,10 +10058,10 @@ snapshots:'@vercel/[email protected]': {}- '@vercel/[email protected]([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])':+ '@vercel/[email protected]([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])':optionalDependencies:- next: 14.2.15(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected])- react: 18.3.1+ next: 15.5.24(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected])+ react: 19.2.8'@vitest/[email protected]':dependencies:@@ -10093,13 +10071,13 @@ snapshots:chai: 5.2.1tinyrainbow: 2.0.0- '@vitest/[email protected]([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))':+ '@vitest/[email protected]([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))':dependencies:'@vitest/spy': 3.2.4estree-walker: 3.0.3magic-string: 0.30.17optionalDependencies:- msw: 2.11.1(@types/[email protected])([email protected])+ msw: 2.11.1(@types/[email protected])([email protected])vite: 6.3.5(@types/[email protected])([email protected])([email protected])([email protected])([email protected])'@vitest/[email protected]':@@ -10220,16 +10198,18 @@ snapshots:mime-types: 3.0.1negotiator: 1.0.0dependencies:acorn: 8.15.0dependencies:- acorn: 8.15.0+ acorn: 8.18.0+ [email protected]: {}+dependencies:cac: 7.0.0@@ -10263,6 +10243,13 @@ snapshots:json-schema-traverse: 0.4.1uri-js: 4.4.1+ dependencies:+ fast-deep-equal: 3.1.3+ fast-json-stable-stringify: 2.1.0+ json-schema-traverse: 0.4.1+ uri-js: 4.4.1+dependencies:fast-deep-equal: 3.1.3@@ -10327,10 +10314,10 @@ snapshots:dependencies:- call-bind: 1.0.8+ call-bind: 1.0.9call-bound: 1.0.4define-properties: 1.2.1- es-abstract: 1.24.0+ es-abstract: 1.24.2es-object-atoms: 1.1.1get-intrinsic: 1.3.0is-string: 1.1.1@@ -10338,59 +10325,47 @@ snapshots:dependencies:- call-bind: 1.0.8- define-properties: 1.2.1- es-abstract: 1.24.0- es-errors: 1.3.0- es-object-atoms: 1.1.1- es-shim-unscopables: 1.1.0-- dependencies:- call-bind: 1.0.8- call-bound: 1.0.4+ call-bind: 1.0.9define-properties: 1.2.1- es-abstract: 1.24.0+ es-abstract: 1.24.2es-errors: 1.3.0es-object-atoms: 1.1.1es-shim-unscopables: 1.1.0dependencies:- call-bind: 1.0.8+ call-bind: 1.0.9define-properties: 1.2.1- es-abstract: 1.24.0+ es-abstract: 1.24.2es-shim-unscopables: 1.1.0dependencies:- call-bind: 1.0.8+ call-bind: 1.0.9define-properties: 1.2.1- es-abstract: 1.24.0+ es-abstract: 1.24.2es-shim-unscopables: 1.1.0dependencies:- call-bind: 1.0.8+ call-bind: 1.0.9define-properties: 1.2.1- es-abstract: 1.24.0+ es-abstract: 1.24.2es-errors: 1.3.0es-shim-unscopables: 1.1.0dependencies:array-buffer-byte-length: 1.0.2- call-bind: 1.0.8+ call-bind: 1.0.9define-properties: 1.2.1- es-abstract: 1.24.0+ es-abstract: 1.24.2es-errors: 1.3.0get-intrinsic: 1.3.0is-array-buffer: 3.0.5- [email protected]: {}-dependencies:tslib: 2.8.1@@ -10415,14 +10390,12 @@ snapshots:dependencies:possible-typed-array-names: 1.1.0- [email protected]: {}-- [email protected]: {}-+ [email protected]: {}+@@ -10459,7 +10432,7 @@ snapshots:transitivePeerDependencies:- supports-colordependencies:balanced-match: 1.0.2concat-map: 0.0.1@@ -10468,6 +10441,10 @@ snapshots:dependencies:balanced-match: 1.0.2+ dependencies:+ balanced-match: 4.0.4+dependencies:fill-range: 7.1.1@@ -10476,10 +10453,6 @@ snapshots:dependencies:base64-js: 1.5.1- dependencies:- pako: 1.0.11-dependencies:caniuse-lite: 1.0.30001733@@ -10515,7 +10488,7 @@ snapshots:es-errors: 1.3.0function-bind: 1.1.2dependencies:call-bind-apply-helpers: 1.0.2es-define-property: 1.0.1@@ -10535,12 +10508,6 @@ snapshots:- dependencies:- node-addon-api: 7.1.1- prebuild-install: 7.1.3- optional: true-@@ -10551,11 +10518,6 @@ snapshots:loupe: 3.2.0pathval: 2.0.1- dependencies:- ansi-styles: 4.3.0- supports-color: 7.2.0-dependencies:ansi-styles: 4.3.0@@ -10589,13 +10551,8 @@ snapshots:dependencies:readdirp: 4.1.2- optional: true-- [email protected]: {}-@@ -10639,12 +10596,12 @@ snapshots:- [email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected]):+ [email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected]):dependencies:- '@radix-ui/react-dialog': 1.0.5(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])- react: 18.3.1- react-dom: 18.3.1([email protected])+ '@radix-ui/react-dialog': 1.0.5(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])transitivePeerDependencies:- '@types/react'- '@types/react-dom'@@ -10659,10 +10616,17 @@ snapshots:+ [email protected]: {}+dependencies:color-name: 1.1.4simple-swizzle: 0.2.2+ optional: true++ dependencies:+ color-name: 2.1.1dependencies:@@ -10713,14 +10677,14 @@ snapshots:object-assign: 4.1.1vary: 1.1.2dependencies:env-paths: 2.2.1import-fresh: 3.3.0js-yaml: 4.1.0parse-json: 5.2.0optionalDependencies:- typescript: 5.9.3+ typescript: 6.0.3@@ -10736,9 +10700,7 @@ snapshots:- [email protected]: {}-- [email protected]: {}+ [email protected]: {}@@ -10764,10 +10726,6 @@ snapshots:- dependencies:- ms: 2.1.3-dependencies:ms: 2.1.3@@ -10782,24 +10740,14 @@ snapshots:- [email protected]: {}-dependencies:character-entities: 2.0.2- dependencies:- mimic-response: 3.1.0- optional: true-- optional: true-@@ -10828,8 +10776,7 @@ snapshots:- optional: true+ [email protected]: {}@@ -10877,6 +10824,8 @@ snapshots:+ [email protected]: {}+dependencies:call-bind-apply-helpers: 1.0.2@@ -10904,11 +10853,11 @@ snapshots:dependencies:embla-carousel: 8.6.0dependencies:embla-carousel: 8.6.0embla-carousel-reactive-utils: 8.6.0([email protected])- react: 18.3.1+ react: 19.2.8dependencies:@@ -10916,6 +10865,8 @@ snapshots:+ [email protected]: {}+@@ -10924,11 +10875,6 @@ snapshots:- dependencies:- once: 1.4.0- optional: true-dependencies:'@socket.io/component-emitter': 3.1.2@@ -10998,12 +10944,19 @@ snapshots:dependencies:is-arrayish: 0.2.1+ dependencies:+ es-errors: 1.3.0+ es-object-atoms: 1.1.2+ is-callable: 1.2.7+ object-inspect: 1.13.4+dependencies:array-buffer-byte-length: 1.0.2arraybuffer.prototype.slice: 1.0.4available-typed-arrays: 1.0.7- call-bind: 1.0.8+ call-bind: 1.0.9call-bound: 1.0.4data-view-buffer: 1.0.2data-view-byte-length: 1.0.2@@ -11012,8 +10965,8 @@ snapshots:es-errors: 1.3.0es-object-atoms: 1.1.1es-set-tostringtag: 2.1.0- es-to-primitive: 1.3.0- function.prototype.name: 1.1.8+ es-to-primitive: 1.3.4+ function.prototype.name: 1.2.0get-intrinsic: 1.3.0get-proto: 1.0.1get-symbol-description: 1.1.0@@ -11038,33 +10991,33 @@ snapshots:object-inspect: 1.13.4object-keys: 1.1.1object.assign: 4.1.7- own-keys: 1.0.1+ own-keys: 1.0.2regexp.prototype.flags: 1.5.4- safe-array-concat: 1.1.3+ safe-array-concat: 1.1.4safe-push-apply: 1.0.0safe-regex-test: 1.1.0set-proto: 1.0.0stop-iteration-iterator: 1.1.0- string.prototype.trim: 1.2.10- string.prototype.trimend: 1.0.9+ string.prototype.trim: 1.2.11+ string.prototype.trimend: 1.0.10string.prototype.trimstart: 1.0.8typed-array-buffer: 1.0.3typed-array-byte-length: 1.0.3typed-array-byte-offset: 1.0.4- typed-array-length: 1.0.7+ typed-array-length: 1.0.8unbox-primitive: 1.1.0- which-typed-array: 1.1.19+ which-typed-array: 1.1.22dependencies:- call-bind: 1.0.8+ call-bind: 1.0.9call-bound: 1.0.4define-properties: 1.2.1- es-abstract: 1.24.0+ es-abstract: 1.24.2es-errors: 1.3.0es-set-tostringtag: 2.1.0function-bind: 1.1.2@@ -11076,7 +11029,7 @@ snapshots:has-symbols: 1.1.0internal-slot: 1.1.0iterator.prototype: 1.1.5- safe-array-concat: 1.1.3+ math-intrinsics: 1.1.0@@ -11086,6 +11039,10 @@ snapshots:dependencies:es-errors: 1.3.0+ dependencies:+ es-errors: 1.3.0+dependencies:es-errors: 1.3.0@@ -11097,8 +11054,11 @@ snapshots:dependencies:hasown: 2.0.2dependencies:+ es-abstract-get: 1.0.0+ es-define-property: 1.0.1+ es-errors: 1.3.0is-callable: 1.2.7is-date-object: 1.1.0is-symbol: 1.1.1@@ -11153,139 +11113,34 @@ snapshots:- dependencies:- '@next/eslint-plugin-next': 15.2.3- '@rushstack/eslint-patch': 1.12.0- '@typescript-eslint/eslint-plugin': 8.40.0(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])- eslint: 9.33.0([email protected])- eslint-import-resolver-node: 0.3.9- eslint-import-resolver-typescript: 3.10.1([email protected])([email protected]([email protected]))- eslint-plugin-import: 2.32.0(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))- eslint-plugin-jsx-a11y: 6.10.2([email protected]([email protected]))- eslint-plugin-react: 7.37.5([email protected]([email protected]))- eslint-plugin-react-hooks: 5.2.0([email protected]([email protected]))- optionalDependencies:- typescript: 5.9.3- transitivePeerDependencies:- - eslint-import-resolver-webpack- - eslint-plugin-import-x- - supports-color-- dependencies:- debug: 3.2.7- is-core-module: 2.16.1- resolve: 1.22.10- transitivePeerDependencies:- - supports-color-- dependencies:- '@nolyfill/is-core-module': 1.0.39- debug: 4.4.3- eslint: 9.33.0([email protected])- get-tsconfig: 4.10.1- is-bun-module: 2.0.0- stable-hash: 0.0.5- tinyglobby: 0.2.14- unrs-resolver: 1.11.1- optionalDependencies:- eslint-plugin-import: 2.32.0(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))- transitivePeerDependencies:- - supports-color-- [email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected]([email protected])):- dependencies:- debug: 3.2.7- optionalDependencies:- eslint: 9.33.0([email protected])- eslint-import-resolver-node: 0.3.9- transitivePeerDependencies:- - supports-color-- [email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected])):- dependencies:- '@rtsao/scc': 1.1.0- array-includes: 3.1.9- array.prototype.findlastindex: 1.2.6- array.prototype.flat: 1.3.3- array.prototype.flatmap: 1.3.3- debug: 3.2.7- doctrine: 2.1.0- eslint: 9.33.0([email protected])- eslint-import-resolver-node: 0.3.9- eslint-module-utils: 2.12.1(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected]([email protected]))- hasown: 2.0.2- is-core-module: 2.16.1- is-glob: 4.0.3- minimatch: 3.1.2- object.fromentries: 2.0.8- object.groupby: 1.0.3- object.values: 1.2.1- semver: 6.3.1- string.prototype.trimend: 1.0.9- tsconfig-paths: 3.15.0- optionalDependencies:- transitivePeerDependencies:- - eslint-import-resolver-typescript- - eslint-import-resolver-webpack- - supports-color-- dependencies:- aria-query: 5.3.2- array-includes: 3.1.9- array.prototype.flatmap: 1.3.3- ast-types-flow: 0.0.8- axe-core: 4.10.3- axobject-query: 4.1.0- damerau-levenshtein: 1.0.8- emoji-regex: 9.2.2- eslint: 9.33.0([email protected])- hasown: 2.0.2- jsx-ast-utils: 3.3.5- language-tags: 1.0.9- minimatch: 3.1.2- object.fromentries: 2.0.8- safe-regex-test: 1.1.0- string.prototype.includes: 2.0.1-- dependencies:- eslint: 9.33.0([email protected])- globals: 13.24.0-dependencies:- eslint: 9.33.0([email protected])+ eslint: 10.8.1([email protected])+ globals: 17.11.0dependencies:- eslint: 9.33.0([email protected])- eslint-utils: 3.0.0([email protected]([email protected]))+ eslint: 10.8.1([email protected])+ globals: 16.5.0dependencies:array-includes: 3.1.9array.prototype.findlast: 1.2.5array.prototype.flatmap: 1.3.3array.prototype.tosorted: 1.1.4doctrine: 2.1.0- es-iterator-helpers: 1.2.1- eslint: 9.33.0([email protected])+ es-iterator-helpers: 1.4.0+ eslint: 10.8.1([email protected])estraverse: 5.3.0hasown: 2.0.2jsx-ast-utils: 3.3.5- minimatch: 3.1.2+ minimatch: 3.1.5object.entries: 1.1.9object.fromentries: 2.0.8object.values: 1.2.1prop-types: 15.8.1- resolve: 2.0.0-next.5+ resolve: 2.0.0-next.7semver: 6.3.1string.prototype.matchall: 4.0.12string.prototype.repeat: 1.0.0@@ -11295,48 +11150,37 @@ snapshots:esrecurse: 4.3.0estraverse: 4.3.0dependencies:+ '@types/esrecurse': 4.3.1+ '@types/estree': 1.0.9esrecurse: 4.3.0estraverse: 5.3.0- dependencies:- eslint: 9.33.0([email protected])- eslint-visitor-keys: 2.1.0-- [email protected]: {}-- [email protected]: {}-dependencies:- '@eslint-community/eslint-utils': 4.7.0([email protected]([email protected]))- '@eslint-community/regexpp': 4.12.1- '@eslint/config-array': 0.21.0- '@eslint/config-helpers': 0.3.1- '@eslint/core': 0.15.2- '@eslint/eslintrc': 3.3.1- '@eslint/js': 9.33.0- '@eslint/plugin-kit': 0.3.5+ '@eslint-community/eslint-utils': 4.9.1([email protected]([email protected]))+ '@eslint-community/regexpp': 4.12.2+ '@eslint/config-array': 0.23.5+ '@eslint/config-helpers': 0.7.0+ '@eslint/core': 1.2.1+ '@eslint/plugin-kit': 0.7.2'@humanfs/node': 0.16.6'@humanwhocodes/module-importer': 1.0.1'@humanwhocodes/retry': 0.4.3- '@types/estree': 1.0.8- '@types/json-schema': 7.0.15- ajv: 6.12.6- chalk: 4.1.2+ '@types/estree': 1.0.9+ ajv: 6.15.0cross-spawn: 7.0.6- debug: 4.4.1+ debug: 4.4.3escape-string-regexp: 4.0.0- eslint-scope: 8.4.0- eslint-visitor-keys: 4.2.1- espree: 10.4.0- esquery: 1.6.0+ eslint-scope: 9.1.2+ eslint-visitor-keys: 5.0.1+ espree: 11.2.0+ esquery: 1.7.0esutils: 2.0.3fast-deep-equal: 3.1.3file-entry-cache: 8.0.0@@ -11346,8 +11190,7 @@ snapshots:imurmurhash: 0.1.4is-glob: 4.0.3json-stable-stringify-without-jsonify: 1.0.1- lodash.merge: 4.6.2- minimatch: 3.1.2+ minimatch: 10.2.6natural-compare: 1.4.0optionator: 0.9.4optionalDependencies:@@ -11355,15 +11198,15 @@ snapshots:transitivePeerDependencies:- supports-colordependencies:- acorn: 8.15.0- acorn-jsx: 5.3.2([email protected])- eslint-visitor-keys: 4.2.1+ acorn: 8.18.0+ acorn-jsx: 5.3.2([email protected])+ eslint-visitor-keys: 5.0.1dependencies:estraverse: 5.3.0@@ -11377,7 +11220,7 @@ snapshots:dependencies:- '@types/estree': 1.0.8+ '@types/estree': 1.0.9dependencies:@@ -11469,9 +11312,6 @@ snapshots:strip-final-newline: 4.0.0yoctocolors: 2.1.2- optional: true-@@ -11516,14 +11356,6 @@ snapshots:- dependencies:- '@nodelib/fs.stat': 2.0.5- '@nodelib/fs.walk': 1.2.8- glob-parent: 5.1.2- merge2: 1.4.1- micromatch: 4.0.8-dependencies:'@nodelib/fs.stat': 2.0.5@@ -11559,6 +11391,8 @@ snapshots:node-domexception: 1.0.0web-streams-polyfill: 3.3.3+ [email protected]: {}+dependencies:is-unicode-supported: 2.1.0@@ -11601,7 +11435,7 @@ snapshots:+ [email protected](patch_hash=4578e940c13ce12f50c2ef0959a1b481d0a98f719932548b9b6bcbfd3832f9bd):dependencies:'@swc/helpers': 0.5.15brotli: 1.3.3@@ -11637,34 +11471,27 @@ snapshots:dependencies:fetch-blob: 3.2.0- [email protected]: {}-dependencies:motion-dom: 12.38.0motion-utils: 12.36.0tslib: 2.8.1optionalDependencies:- react: 18.3.1- react-dom: 18.3.1([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])- optional: true-dependencies:graceful-fs: 4.2.11jsonfile: 6.2.0universalify: 2.0.1- [email protected]: {}-optional: true@@ -11673,14 +11500,17 @@ snapshots:dependencies:- call-bind: 1.0.8+ call-bind: 1.0.9call-bound: 1.0.4- define-properties: 1.2.1+ es-define-property: 1.0.1+ es-errors: 1.3.0functions-have-names: 1.2.3- hasown: 2.0.2+ has-property-descriptors: 1.0.2+ hasown: 2.0.4is-callable: 1.2.7+ is-document.all: 1.0.0@@ -11708,6 +11538,8 @@ snapshots:- encoding- supports-color+ [email protected]: {}+@@ -11754,8 +11586,6 @@ snapshots:dependencies:resolve-pkg-maps: 1.0.0-optional: true@@ -11785,20 +11615,17 @@ snapshots:package-json-from-dist: 1.0.1path-scurry: 1.11.1dependencies:- fs.realpath: 1.0.0- minimatch: 8.0.4- minipass: 4.2.8- path-scurry: 1.11.1+ minimatch: 10.2.6+ minipass: 7.1.3+ path-scurry: 2.0.2- dependencies:- type-fest: 0.20.2+ [email protected]: {}- [email protected]: {}+ [email protected]: {}dependencies:@@ -11843,8 +11670,6 @@ snapshots:- [email protected]: {}-@@ -11890,9 +11715,13 @@ snapshots:dependencies:function-bind: 1.1.2+ dependencies:+ function-bind: 1.1.2+dependencies:- '@types/estree': 1.0.8+ '@types/estree': 1.0.9'@types/estree-jsx': 1.0.5'@types/hast': 3.0.4comma-separated-tokens: 2.0.3@@ -11937,10 +11766,6 @@ snapshots:- dependencies:- react-is: 16.13.1-dependencies:hsl-to-rgb-for-reals: 1.1.1@@ -11994,7 +11819,7 @@ snapshots:- [email protected]: {}+ [email protected]: {}dependencies:@@ -12004,12 +11829,14 @@ snapshots:dependencies:safer-buffer: 2.1.2+ dependencies:+ '@formatjs/icu-messageformat-parser': 3.5.17+- [email protected]: {}-@@ -12017,14 +11844,7 @@ snapshots:parent-module: 1.0.1resolve-from: 4.0.0- dependencies:- acorn: 8.15.0- acorn-import-attributes: 1.9.5([email protected])- cjs-module-lexer: 1.4.3- module-details-from-path: 1.0.3-dependencies:cjs-module-lexer: 2.2.0es-module-lexer: 2.3.0@@ -12036,9 +11856,6 @@ snapshots:- optional: true-@@ -12047,12 +11864,10 @@ snapshots:hasown: 2.0.2side-channel: 1.1.0dependencies:- '@formatjs/ecma402-abstract': 2.3.4- '@formatjs/fast-memoize': 2.2.7- '@formatjs/icu-messageformat-parser': 2.11.2- tslib: 2.8.1+ '@formatjs/fast-memoize': 3.1.7+ '@formatjs/icu-messageformat-parser': 3.5.17@@ -12065,13 +11880,14 @@ snapshots:dependencies:- call-bind: 1.0.8+ call-bind: 1.0.9call-bound: 1.0.4get-intrinsic: 1.3.0- [email protected]: {}+ optional: truedependencies:@@ -12094,16 +11910,16 @@ snapshots:call-bound: 1.0.4has-tostringtag: 1.0.2- dependencies:- semver: 7.7.4-dependencies:hasown: 2.0.2+ dependencies:+ hasown: 2.0.4+dependencies:call-bound: 1.0.4@@ -12117,6 +11933,10 @@ snapshots:+ dependencies:+ call-bound: 1.0.4+@@ -12131,9 +11951,10 @@ snapshots:dependencies:get-east-asian-width: 1.3.0dependencies:call-bound: 1.0.4+ generator-function: 2.0.1get-proto: 1.0.1has-tostringtag: 1.0.2safe-regex-test: 1.1.0@@ -12207,7 +12028,7 @@ snapshots:dependencies:- which-typed-array: 1.1.19+ which-typed-array: 1.1.22@@ -12275,6 +12096,8 @@ snapshots:+ [email protected]: {}+@@ -12303,10 +12126,6 @@ snapshots:- dependencies:- minimist: 1.2.8-@@ -12348,7 +12167,7 @@ snapshots:dependencies:'@nodelib/fs.walk': 1.2.8'@types/node': 22.8.1@@ -12362,14 +12181,8 @@ snapshots:picomatch: 4.0.3smol-toml: 1.6.0strip-json-comments: 5.0.3- typescript: 5.9.3- zod: 4.3.6-- [email protected]: {}-- dependencies:- language-subtag-registry: 0.3.23+ typescript: 6.0.3+ zod: 4.5.4@@ -12461,13 +12274,15 @@ snapshots:+ [email protected]: {}+dependencies:yallist: 3.1.1dependencies:- react: 18.3.1+ react: 19.2.8@@ -12475,13 +12290,13 @@ snapshots:dependencies:'@jridgewell/sourcemap-codec': 1.5.4dependencies:- '@jridgewell/sourcemap-codec': 1.5.4+ '@jridgewell/sourcemap-codec': 1.5.5- [email protected]: {}+ [email protected]: {}- [email protected]: {}+ [email protected]: {}@@ -12658,14 +12473,16 @@ snapshots:- [email protected](@types/[email protected]):+ [email protected](@types/[email protected]):optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18+ [email protected]: {}+dependencies:decode-named-character-reference: 1.2.0@@ -12745,7 +12562,7 @@ snapshots:dependencies:- '@types/estree': 1.0.8+ '@types/estree': 1.0.9devlop: 1.1.0micromark-factory-mdx-expression: 2.0.3micromark-factory-space: 2.0.1@@ -12756,7 +12573,7 @@ snapshots:dependencies:- '@types/estree': 1.0.8+ '@types/estree': 1.0.9devlop: 1.1.0estree-util-is-identifier-name: 3.0.0micromark-factory-mdx-expression: 2.0.3@@ -12773,7 +12590,7 @@ snapshots:dependencies:- '@types/estree': 1.0.8+ '@types/estree': 1.0.9devlop: 1.1.0micromark-core-commonmark: 2.0.3micromark-util-character: 2.1.1@@ -12809,7 +12626,7 @@ snapshots:dependencies:- '@types/estree': 1.0.8+ '@types/estree': 1.0.9devlop: 1.1.0micromark-factory-space: 2.0.1micromark-util-character: 2.1.1@@ -12873,7 +12690,7 @@ snapshots:dependencies:- '@types/estree': 1.0.8+ '@types/estree': 1.0.9'@types/unist': 3.0.3devlop: 1.1.0estree-util-visit: 2.0.0@@ -12953,24 +12770,17 @@ snapshots:- optional: true-- dependencies:- '@isaacs/brace-expansion': 5.0.0-dependencies:- brace-expansion: 1.1.11+ brace-expansion: 5.0.9dependencies:- brace-expansion: 2.0.1+ brace-expansion: 1.1.18dependencies:@@ -12978,14 +12788,9 @@ snapshots:- [email protected]: {}-- optional: true-- [email protected]: {}+ [email protected]: {}@@ -12995,17 +12800,17 @@ snapshots:dependencies:tslib: 2.8.1optionalDependencies:- react: 18.3.1- react-dom: 18.3.1([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])dependencies:'@bundled-es-modules/cookie': 2.0.1'@bundled-es-modules/statuses': 1.0.1@@ -13026,7 +12831,7 @@ snapshots:type-fest: 4.41.0yargs: 17.7.2optionalDependencies:- typescript: 5.9.3+ typescript: 6.0.3transitivePeerDependencies:- '@types/node'@@ -13048,11 +12853,6 @@ snapshots:dependencies:picocolors: 1.1.1- optional: true-- [email protected]: {}-@@ -13061,44 +12861,26 @@ snapshots:- [email protected]([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected]):+ [email protected]: {}++ [email protected]([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected]):dependencies:- '@formatjs/intl-localematcher': 0.5.10+ '@formatjs/intl-localematcher': 0.8.13+ '@parcel/watcher': 2.6.0+ '@swc/core': 1.15.47+ icu-minify: 4.13.7negotiator: 1.0.0- next: 14.2.15(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected])- react: 18.3.1- use-intl: 4.0.2([email protected])+ next: 15.5.24(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected])+ next-intl-swc-plugin-extractor: 4.13.7+ po-parser: 2.2.0+ react: 19.2.8+ use-intl: 4.13.7([email protected])optionalDependencies:- typescript: 5.9.3-- [email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]):- dependencies:- '@next/env': 14.2.15- '@swc/helpers': 0.5.5- busboy: 1.6.0- caniuse-lite: 1.0.30001733- graceful-fs: 4.2.11- postcss: 8.4.31- react: 18.3.1- react-dom: 18.3.1([email protected])- styled-jsx: 5.1.1(@babel/[email protected])([email protected])- optionalDependencies:- '@next/swc-darwin-arm64': 14.2.15- '@next/swc-darwin-x64': 14.2.15- '@next/swc-linux-arm64-gnu': 14.2.15- '@next/swc-linux-arm64-musl': 14.2.15- '@next/swc-linux-x64-gnu': 14.2.15- '@next/swc-linux-x64-musl': 14.2.15- '@next/swc-win32-arm64-msvc': 14.2.15- '@next/swc-win32-ia32-msvc': 14.2.15- '@next/swc-win32-x64-msvc': 14.2.15- '@opentelemetry/api': 1.9.1- '@playwright/test': 1.60.0+ typescript: 6.0.3transitivePeerDependencies:- - '@babel/core'- - babel-plugin-macros+ - '@swc/helpers'- [email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]):+ [email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]):dependencies:'@next/env': 15.2.3'@swc/counter': 0.1.3@@ -13106,9 +12888,9 @@ snapshots:busboy: 1.6.0caniuse-lite: 1.0.30001733postcss: 8.4.31- react: 18.3.1- react-dom: 18.3.1([email protected])- styled-jsx: 5.1.6(@babel/[email protected])([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])+ styled-jsx: 5.1.6(@babel/[email protected])([email protected])optionalDependencies:'@next/swc-darwin-arm64': 15.2.3'@next/swc-darwin-x64': 15.2.3@@ -13125,16 +12907,42 @@ snapshots:- '@babel/core'- babel-plugin-macros+ [email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]):dependencies:- semver: 7.7.4- optional: true+ '@next/env': 15.5.24+ '@swc/helpers': 0.5.15+ caniuse-lite: 1.0.30001733+ postcss: 8.4.31+ react: 19.2.8+ react-dom: 19.2.8([email protected])+ styled-jsx: 5.1.6(@babel/[email protected])([email protected])+ optionalDependencies:+ '@next/swc-darwin-arm64': 15.5.24+ '@next/swc-darwin-x64': 15.5.24+ '@next/swc-linux-arm64-gnu': 15.5.24+ '@next/swc-linux-arm64-musl': 15.5.24+ '@next/swc-linux-x64-gnu': 15.5.24+ '@next/swc-linux-x64-musl': 15.5.24+ '@next/swc-win32-arm64-msvc': 15.5.24+ '@next/swc-win32-x64-msvc': 15.5.24+ '@opentelemetry/api': 1.9.1+ '@playwright/test': 1.60.0+ sharp: 0.34.5+ transitivePeerDependencies:+ - '@babel/core'+ - babel-plugin-macros- optional: true+ [email protected]: {}+ dependencies:+ array.prototype.flatmap: 1.3.3+ es-errors: 1.3.0+ object.entries: 1.1.9+ semver: 6.3.1+dependencies:whatwg-url: 5.0.0@@ -13180,7 +12988,7 @@ snapshots:dependencies:- call-bind: 1.0.8+ call-bind: 1.0.9call-bound: 1.0.4define-properties: 1.2.1es-object-atoms: 1.1.1@@ -13189,27 +12997,21 @@ snapshots:dependencies:- call-bind: 1.0.8+ call-bind: 1.0.9call-bound: 1.0.4define-properties: 1.2.1es-object-atoms: 1.1.1dependencies:- call-bind: 1.0.8+ call-bind: 1.0.9define-properties: 1.2.1- es-abstract: 1.24.0+ es-abstract: 1.24.2es-object-atoms: 1.1.1- dependencies:- call-bind: 1.0.8- define-properties: 1.2.1- es-abstract: 1.24.0-dependencies:- call-bind: 1.0.8+ call-bind: 1.0.9call-bound: 1.0.4define-properties: 1.2.1es-object-atoms: 1.1.1@@ -13269,8 +13071,9 @@ snapshots:dependencies:+ call-bound: 1.0.4get-intrinsic: 1.3.0object-keys: 1.1.1safe-push-apply: 1.0.0@@ -13298,6 +13101,62 @@ snapshots:'@oxc-resolver/binding-win32-ia32-msvc': 11.19.1'@oxc-resolver/binding-win32-x64-msvc': 11.19.1+ dependencies:+ tinypool: 2.1.0+ optionalDependencies:+ '@oxfmt/binding-android-arm-eabi': 0.64.0+ '@oxfmt/binding-android-arm64': 0.64.0+ '@oxfmt/binding-darwin-arm64': 0.64.0+ '@oxfmt/binding-darwin-x64': 0.64.0+ '@oxfmt/binding-freebsd-x64': 0.64.0+ '@oxfmt/binding-linux-arm-gnueabihf': 0.64.0+ '@oxfmt/binding-linux-arm-musleabihf': 0.64.0+ '@oxfmt/binding-linux-arm64-gnu': 0.64.0+ '@oxfmt/binding-linux-arm64-musl': 0.64.0+ '@oxfmt/binding-linux-ppc64-gnu': 0.64.0+ '@oxfmt/binding-linux-riscv64-gnu': 0.64.0+ '@oxfmt/binding-linux-riscv64-musl': 0.64.0+ '@oxfmt/binding-linux-s390x-gnu': 0.64.0+ '@oxfmt/binding-linux-x64-gnu': 0.64.0+ '@oxfmt/binding-linux-x64-musl': 0.64.0+ '@oxfmt/binding-openharmony-arm64': 0.64.0+ '@oxfmt/binding-win32-arm64-msvc': 0.64.0+ '@oxfmt/binding-win32-ia32-msvc': 0.64.0+ '@oxfmt/binding-win32-x64-msvc': 0.64.0++ optionalDependencies:+ '@oxlint-tsgolint/darwin-arm64': 7.0.2001+ '@oxlint-tsgolint/darwin-x64': 7.0.2001+ '@oxlint-tsgolint/linux-arm64': 7.0.2001+ '@oxlint-tsgolint/linux-x64': 7.0.2001+ '@oxlint-tsgolint/win32-arm64': 7.0.2001+ '@oxlint-tsgolint/win32-x64': 7.0.2001++ optionalDependencies:+ '@oxlint/binding-android-arm-eabi': 1.79.0+ '@oxlint/binding-android-arm64': 1.79.0+ '@oxlint/binding-darwin-arm64': 1.79.0+ '@oxlint/binding-darwin-x64': 1.79.0+ '@oxlint/binding-freebsd-x64': 1.79.0+ '@oxlint/binding-linux-arm-gnueabihf': 1.79.0+ '@oxlint/binding-linux-arm-musleabihf': 1.79.0+ '@oxlint/binding-linux-arm64-gnu': 1.79.0+ '@oxlint/binding-linux-arm64-musl': 1.79.0+ '@oxlint/binding-linux-ppc64-gnu': 1.79.0+ '@oxlint/binding-linux-riscv64-gnu': 1.79.0+ '@oxlint/binding-linux-riscv64-musl': 1.79.0+ '@oxlint/binding-linux-s390x-gnu': 1.79.0+ '@oxlint/binding-linux-x64-gnu': 1.79.0+ '@oxlint/binding-linux-x64-musl': 1.79.0+ '@oxlint/binding-openharmony-arm64': 1.79.0+ '@oxlint/binding-win32-arm64-msvc': 1.79.0+ '@oxlint/binding-win32-ia32-msvc': 1.79.0+ '@oxlint/binding-win32-x64-msvc': 1.79.0+ oxlint-tsgolint: 7.0.2001+dependencies:p-try: 2.2.0@@ -13371,42 +13230,33 @@ snapshots:lru-cache: 10.4.3minipass: 7.1.2+ dependencies:+ lru-cache: 11.5.2+ minipass: 7.1.3+- optional: true-optionalDependencies:- canvas: 3.2.1- path2d: 0.2.2+ '@napi-rs/canvas': 0.1.100- [email protected]: {}-- [email protected]: {}-- dependencies:- pg-int8: 1.0.1- postgres-array: 2.0.0- postgres-bytea: 1.0.0- postgres-date: 1.0.7- postgres-interval: 1.2.0-+ [email protected]: {}+@@ -13423,8 +13273,14 @@ snapshots:optionalDependencies:fsevents: 2.3.2+ dependencies:+ fflate: 0.8.3++ [email protected]: {}+@@ -13481,42 +13337,10 @@ snapshots:picocolors: 1.1.1source-map-js: 1.2.1- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- xtend: 4.0.2-- dependencies:- detect-libc: 2.0.3- expand-template: 2.0.3- github-from-package: 0.0.0- minimist: 1.2.8- mkdirp-classic: 0.5.3- napi-build-utils: 2.0.0- node-abi: 3.85.0- pump: 3.0.3- rc: 1.2.8- simple-get: 4.0.1- tar-fs: 2.1.4- tunnel-agent: 0.6.0- optional: true-- dependencies:- prettier: 3.5.3-- [email protected]: {}-dependencies:ansi-regex: 5.0.1@@ -13556,12 +13380,6 @@ snapshots:- dependencies:- end-of-stream: 1.4.5- once: 1.4.0- optional: true-@@ -13593,21 +13411,12 @@ snapshots:iconv-lite: 0.7.0unpipe: 1.0.0dependencies:- deep-extend: 0.6.0- ini: 1.3.8- minimist: 1.2.8- strip-json-comments: 2.0.1- optional: true-- dependencies:- loose-envify: 1.4.0- react: 18.3.1- scheduler: 0.23.2+ react: 19.2.8+ scheduler: 0.27.0- [email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]):+ [email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]):dependencies:'@babel/parser': 7.24.5'@babel/traverse': 7.25.6@@ -13619,7 +13428,7 @@ snapshots:glob: 10.3.4log-symbols: 4.1.0mime-types: 2.1.35- next: 15.2.3(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected])+ next: 15.2.3(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected])normalize-path: 3.0.0ora: 5.4.1socket.io: 4.8.1@@ -13636,80 +13445,78 @@ snapshots:- supports-color- utf-8-validatedependencies:- react: 18.3.1+ react: 19.2.8dependencies:- react: 18.3.1+ react: 19.2.8optionalDependencies:- react-dom: 18.3.1([email protected])+ react-dom: 19.2.8([email protected])- [email protected](@types/[email protected])([email protected]([email protected]))([email protected]):+ [email protected](@types/[email protected])([email protected]([email protected]))([email protected]):dependencies:clsx: 2.1.1dequal: 2.0.3- make-cancellable-promise: 1.3.2- make-event-props: 1.6.2- merge-refs: 1.3.0(@types/[email protected])- pdfjs-dist: 4.8.69- react: 18.3.1- react-dom: 18.3.1([email protected])+ make-cancellable-promise: 2.0.0+ make-event-props: 2.0.0+ merge-refs: 2.0.0(@types/[email protected])+ pdfjs-dist: 5.4.296+ react: 19.2.8+ react-dom: 19.2.8([email protected])tiny-invariant: 1.3.3warning: 4.0.3optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:fast-deep-equal: 2.0.1dependencies:- react: 18.3.1- react-style-singleton: 2.2.3(@types/[email protected])([email protected])+ react: 19.2.8+ react-style-singleton: 2.2.3(@types/[email protected])([email protected])tslib: 2.8.1optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:- react: 18.3.1- react-remove-scroll-bar: 2.3.8(@types/[email protected])([email protected])- react-style-singleton: 2.2.3(@types/[email protected])([email protected])+ react: 19.2.8+ react-remove-scroll-bar: 2.3.8(@types/[email protected])([email protected])+ react-style-singleton: 2.2.3(@types/[email protected])([email protected])tslib: 2.8.1- use-callback-ref: 1.3.3(@types/[email protected])([email protected])- use-sidecar: 1.1.3(@types/[email protected])([email protected])+ use-callback-ref: 1.3.3(@types/[email protected])([email protected])+ use-sidecar: 1.1.3(@types/[email protected])([email protected])optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:- react: 18.3.1- react-remove-scroll-bar: 2.3.8(@types/[email protected])([email protected])- react-style-singleton: 2.2.3(@types/[email protected])([email protected])+ react: 19.2.8+ react-remove-scroll-bar: 2.3.8(@types/[email protected])([email protected])+ react-style-singleton: 2.2.3(@types/[email protected])([email protected])tslib: 2.8.1- use-callback-ref: 1.3.3(@types/[email protected])([email protected])- use-sidecar: 1.1.3(@types/[email protected])([email protected])+ use-callback-ref: 1.3.3(@types/[email protected])([email protected])+ use-sidecar: 1.1.3(@types/[email protected])([email protected])optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:get-nonce: 1.0.1- react: 18.3.1+ react: 19.2.8tslib: 2.8.1optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18- dependencies:- loose-envify: 1.4.0+ [email protected]: {}dependencies:@@ -13751,9 +13558,9 @@ snapshots:estree-util-build-jsx: 3.0.1vfile: 6.0.3dependencies:- acorn-jsx: 5.3.2([email protected])+ acorn-jsx: 5.3.2([email protected])estree-util-to-js: 2.0.0recma-parse: 1.0.0recma-stringify: 1.0.0@@ -13763,7 +13570,7 @@ snapshots:dependencies:- '@types/estree': 1.0.8+ '@types/estree': 1.0.9esast-util-from-js: 2.0.1unified: 11.0.5vfile: 6.0.3@@ -13782,9 +13589,9 @@ snapshots:dependencies:- call-bind: 1.0.8+ call-bind: 1.0.9define-properties: 1.2.1- es-abstract: 1.24.0+ es-abstract: 1.24.2es-errors: 1.3.0es-object-atoms: 1.1.1get-intrinsic: 1.3.0@@ -13795,7 +13602,7 @@ snapshots:dependencies:- call-bind: 1.0.8+ call-bind: 1.0.9define-properties: 1.2.1es-errors: 1.3.0get-proto: 1.0.1@@ -13855,14 +13662,6 @@ snapshots:- dependencies:- debug: 4.4.3- module-details-from-path: 1.0.3- resolve: 1.22.10- transitivePeerDependencies:- - supports-color-dependencies:debug: 4.4.3@@ -13872,16 +13671,17 @@ snapshots:dependencies:transitivePeerDependencies:- react- react-dom- [email protected]: {}+ optional: truedependencies:@@ -13889,15 +13689,12 @@ snapshots:path-parse: 1.0.7supports-preserve-symlinks-flag: 1.0.0- dependencies:- is-core-module: 2.16.1- path-parse: 1.0.7- supports-preserve-symlinks-flag: 1.0.0-dependencies:- is-core-module: 2.16.1+ es-errors: 1.3.0+ is-core-module: 2.16.2+ node-exports-info: 1.6.2+ object-keys: 1.1.1path-parse: 1.0.7supports-preserve-symlinks-flag: 1.0.0@@ -13917,10 +13714,6 @@ snapshots:- optionalDependencies:- fsevents: 2.3.3-dependencies:'@types/estree': 1.0.7@@ -13947,6 +13740,38 @@ snapshots:'@rollup/rollup-win32-x64-msvc': 4.41.0fsevents: 2.3.3+ dependencies:+ '@types/estree': 1.0.9+ 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.3+dependencies:debug: 4.4.3@@ -13965,9 +13790,9 @@ snapshots:dependencies:queue-microtask: 1.2.3dependencies:- call-bind: 1.0.8+ call-bind: 1.0.9call-bound: 1.0.4get-intrinsic: 1.3.0has-symbols: 1.1.0@@ -13990,12 +13815,10 @@ snapshots:- dependencies:- loose-envify: 1.4.0-+ [email protected]: {}+@@ -14009,9 +13832,9 @@ snapshots:dependencies:parseley: 0.12.1- [email protected]: {}+ [email protected]: {}- [email protected]: {}+ [email protected]: {}@@ -14072,7 +13895,7 @@ snapshots:dependencies:'@antfu/ni': 25.0.0'@babel/core': 7.28.3@@ -14081,7 +13904,7 @@ snapshots:'@dotenvx/dotenvx': 1.49.0'@modelcontextprotocol/sdk': 1.17.5commander: 14.0.0- cosmiconfig: 9.0.0([email protected])+ cosmiconfig: 9.0.0([email protected])dedent: 1.7.0deepmerge: 4.3.1diff: 8.0.2@@ -14091,7 +13914,7 @@ snapshots:fuzzysort: 3.1.0https-proxy-agent: 7.0.6kleur: 4.1.5- msw: 2.11.1(@types/[email protected])([email protected])+ msw: 2.11.1(@types/[email protected])([email protected])node-fetch: 3.3.2ora: 8.2.0postcss: 8.5.6@@ -14100,8 +13923,8 @@ snapshots:stringify-object: 5.0.0ts-morph: 26.0.0tsconfig-paths: 4.2.0- zod: 3.24.4- zod-to-json-schema: 3.24.6([email protected])+ zod: 3.25.76+ zod-to-json-schema: 3.24.6([email protected])transitivePeerDependencies:- '@types/node'- babel-plugin-macros@@ -14111,8 +13934,8 @@ snapshots:dependencies:color: 4.2.3- detect-libc: 2.0.3- semver: 7.7.4+ detect-libc: 2.1.2+ semver: 7.8.1optionalDependencies:'@img/sharp-darwin-arm64': 0.33.5'@img/sharp-darwin-x64': 0.33.5@@ -14135,14 +13958,44 @@ snapshots:'@img/sharp-win32-x64': 0.33.5optional: true+ dependencies:+ '@img/colour': 1.1.0+ detect-libc: 2.1.2+ semver: 7.8.1+ optionalDependencies:+ '@img/sharp-darwin-arm64': 0.34.5+ '@img/sharp-darwin-x64': 0.34.5+ '@img/sharp-libvips-darwin-arm64': 1.2.4+ '@img/sharp-libvips-darwin-x64': 1.2.4+ '@img/sharp-libvips-linux-arm': 1.2.4+ '@img/sharp-libvips-linux-arm64': 1.2.4+ '@img/sharp-libvips-linux-ppc64': 1.2.4+ '@img/sharp-libvips-linux-riscv64': 1.2.4+ '@img/sharp-libvips-linux-s390x': 1.2.4+ '@img/sharp-libvips-linux-x64': 1.2.4+ '@img/sharp-libvips-linuxmusl-arm64': 1.2.4+ '@img/sharp-libvips-linuxmusl-x64': 1.2.4+ '@img/sharp-linux-arm': 0.34.5+ '@img/sharp-linux-arm64': 0.34.5+ '@img/sharp-linux-ppc64': 0.34.5+ '@img/sharp-linux-riscv64': 0.34.5+ '@img/sharp-linux-s390x': 0.34.5+ '@img/sharp-linux-x64': 0.34.5+ '@img/sharp-linuxmusl-arm64': 0.34.5+ '@img/sharp-linuxmusl-x64': 0.34.5+ '@img/sharp-wasm32': 0.34.5+ '@img/sharp-win32-arm64': 0.34.5+ '@img/sharp-win32-ia32': 0.34.5+ '@img/sharp-win32-x64': 0.34.5+ optional: true+dependencies:shebang-regex: 3.0.0- [email protected]: {}-dependencies:es-errors: 1.3.0@@ -14177,19 +14030,10 @@ snapshots:- optional: true-- dependencies:- decompress-response: 6.0.0- once: 1.4.0- simple-concat: 1.0.1- optional: true-dependencies:is-arrayish: 0.3.2+ optional: true@@ -14262,10 +14106,10 @@ snapshots:- supports-color- utf-8-validatedependencies:- react: 18.3.1- react-dom: 18.3.1([email protected])+ react: 19.2.8+ react-dom: 19.2.8([email protected])@@ -14280,8 +14124,6 @@ snapshots:- [email protected]: {}-@@ -14325,18 +14167,12 @@ snapshots:get-east-asian-width: 1.3.0strip-ansi: 7.1.0- dependencies:- call-bind: 1.0.8- define-properties: 1.2.1- es-abstract: 1.24.0-dependencies:- call-bind: 1.0.8+ call-bind: 1.0.9call-bound: 1.0.4define-properties: 1.2.1- es-abstract: 1.24.0+ es-abstract: 1.24.2es-errors: 1.3.0es-object-atoms: 1.1.1get-intrinsic: 1.3.0@@ -14350,28 +14186,29 @@ snapshots:dependencies:define-properties: 1.2.1- es-abstract: 1.24.0+ es-abstract: 1.24.2dependencies:- call-bind: 1.0.8+ call-bind: 1.0.9call-bound: 1.0.4define-data-property: 1.1.4define-properties: 1.2.1- es-abstract: 1.24.0- es-object-atoms: 1.1.1+ es-abstract: 1.24.2+ es-object-atoms: 1.1.2has-property-descriptors: 1.0.2+ safe-regex-test: 1.1.0dependencies:- call-bind: 1.0.8+ call-bind: 1.0.9call-bound: 1.0.4define-properties: 1.2.1- es-object-atoms: 1.1.1+ es-object-atoms: 1.1.2dependencies:- call-bind: 1.0.8+ call-bind: 1.0.9define-properties: 1.2.1es-object-atoms: 1.1.1@@ -14414,11 +14251,6 @@ snapshots:dependencies:min-indent: 1.0.1- optional: true-- [email protected]: {}-@@ -14433,19 +14265,12 @@ snapshots:dependencies:inline-style-parser: 0.2.4- dependencies:- client-only: 0.0.1- react: 18.3.1- optionalDependencies:- '@babel/core': 7.26.9-dependencies:client-only: 0.0.1- react: 18.3.1+ react: 19.2.8optionalDependencies:- '@babel/core': 7.26.9+ '@babel/core': 7.28.3dependencies:@@ -14506,23 +14331,6 @@ snapshots:- dependencies:- chownr: 1.1.4- mkdirp-classic: 0.5.3- pump: 3.0.3- tar-stream: 2.2.0- optional: true-- dependencies:- bl: 4.1.0- end-of-stream: 1.4.5- fs-constants: 1.0.0- inherits: 2.0.4- readable-stream: 3.6.2- optional: true-dependencies:bintrees: 1.0.2@@ -14539,7 +14347,7 @@ snapshots:dependencies:'@jridgewell/source-map': 0.3.10- acorn: 8.15.0+ acorn: 8.18.0commander: 2.20.3source-map-support: 0.5.21@@ -14566,13 +14374,10 @@ snapshots:fdir: 6.4.4([email protected])picomatch: 4.0.3- dependencies:- fdir: 6.5.0([email protected])- picomatch: 4.0.3-+ [email protected]: {}+@@ -14599,14 +14404,6 @@ snapshots:- dependencies:- typescript: 5.9.3-- dependencies:- typescript: 5.9.3-@@ -14616,13 +14413,6 @@ snapshots:- dependencies:- '@types/json5': 0.0.29- json5: 1.0.2- minimist: 1.2.8- strip-bom: 3.0.0-dependencies:json5: 2.2.3@@ -14639,17 +14429,10 @@ snapshots:fsevents: 2.3.3optional: true- dependencies:- safe-buffer: 5.2.1- optional: true-dependencies:prelude-ls: 1.2.1- [email protected]: {}-@@ -14670,7 +14453,7 @@ snapshots:dependencies:- call-bind: 1.0.8+ call-bind: 1.0.9for-each: 0.3.5gopd: 1.2.0has-proto: 1.2.0@@ -14679,34 +14462,23 @@ snapshots:dependencies:available-typed-arrays: 1.0.7- call-bind: 1.0.8+ call-bind: 1.0.9for-each: 0.3.5gopd: 1.2.0has-proto: 1.2.0is-typed-array: 1.1.15reflect.getprototypeof: 1.0.10dependencies:- call-bind: 1.0.8+ call-bind: 1.0.9for-each: 0.3.5gopd: 1.2.0is-typed-array: 1.1.15possible-typed-array-names: 1.1.0reflect.getprototypeof: 1.0.10- dependencies:- '@typescript-eslint/eslint-plugin': 8.56.0(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])- '@typescript-eslint/typescript-estree': 8.56.0([email protected])- eslint: 9.33.0([email protected])- typescript: 5.9.3- transitivePeerDependencies:- - supports-color-- [email protected]: {}+ [email protected]: {}@@ -14786,37 +14558,6 @@ snapshots:- dependencies:- acorn: 8.15.0- chokidar: 3.6.0- webpack-sources: 3.3.3- webpack-virtual-modules: 0.5.0-- dependencies:- napi-postinstall: 0.3.3- optionalDependencies:- '@unrs/resolver-binding-android-arm-eabi': 1.11.1- '@unrs/resolver-binding-android-arm64': 1.11.1- '@unrs/resolver-binding-darwin-arm64': 1.11.1- '@unrs/resolver-binding-darwin-x64': 1.11.1- '@unrs/resolver-binding-freebsd-x64': 1.11.1- '@unrs/resolver-binding-linux-arm-gnueabihf': 1.11.1- '@unrs/resolver-binding-linux-arm-musleabihf': 1.11.1- '@unrs/resolver-binding-linux-arm64-gnu': 1.11.1- '@unrs/resolver-binding-linux-arm64-musl': 1.11.1- '@unrs/resolver-binding-linux-ppc64-gnu': 1.11.1- '@unrs/resolver-binding-linux-riscv64-gnu': 1.11.1- '@unrs/resolver-binding-linux-riscv64-musl': 1.11.1- '@unrs/resolver-binding-linux-s390x-gnu': 1.11.1- '@unrs/resolver-binding-linux-x64-gnu': 1.11.1- '@unrs/resolver-binding-linux-x64-musl': 1.11.1- '@unrs/resolver-binding-wasm32-wasi': 1.11.1- '@unrs/resolver-binding-win32-arm64-msvc': 1.11.1- '@unrs/resolver-binding-win32-ia32-msvc': 1.11.1- '@unrs/resolver-binding-win32-x64-msvc': 1.11.1-dependencies:browserslist: 4.25.2@@ -14829,31 +14570,32 @@ snapshots:dependencies:- react: 18.3.1+ react: 19.2.8tslib: 2.8.1optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18dependencies:- react: 18.3.1+ react: 19.2.8dependencies:- '@formatjs/fast-memoize': 2.2.7+ '@formatjs/fast-memoize': 3.1.7'@schummar/icu-type-parser': 1.21.5- intl-messageformat: 10.7.16- react: 18.3.1+ icu-minify: 4.13.7+ intl-messageformat: 11.2.14+ react: 19.2.8dependencies:detect-node-es: 1.1.0- react: 18.3.1+ react: 19.2.8tslib: 2.8.1optionalDependencies:- '@types/react': 18.3.12+ '@types/react': 19.2.18@@ -14914,11 +14656,11 @@ snapshots:tsx: 4.19.4yaml: 2.9.0- [email protected](@types/[email protected])(@types/[email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected]))([email protected])([email protected])([email protected]):+ [email protected](@types/[email protected])(@types/[email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected]))([email protected])([email protected])([email protected]):dependencies:'@types/chai': 5.2.2'@vitest/expect': 3.2.4- '@vitest/mocker': 3.2.4([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))+ '@vitest/mocker': 3.2.4([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))'@vitest/pretty-format': 3.2.4'@vitest/runner': 3.2.4'@vitest/snapshot': 3.2.4@@ -14978,16 +14720,14 @@ snapshots:- [email protected]: {}-dependencies:'@types/eslint-scope': 3.7.7- '@types/estree': 1.0.8+ '@types/estree': 1.0.9'@webassemblyjs/ast': 1.14.1'@webassemblyjs/wasm-edit': 1.14.1'@webassemblyjs/wasm-parser': 1.14.1- acorn: 8.15.0+ acorn: 8.18.0browserslist: 4.25.2chrome-trace-event: 1.0.4enhanced-resolve: 5.18.3@@ -15028,18 +14768,18 @@ snapshots:dependencies:call-bound: 1.0.4- function.prototype.name: 1.1.8+ function.prototype.name: 1.2.0has-tostringtag: 1.0.2is-async-function: 2.1.1is-date-object: 1.1.0is-finalizationregistry: 1.1.1- is-generator-function: 1.1.0+ is-generator-function: 1.1.2is-regex: 1.2.1is-weakref: 1.1.1isarray: 2.0.5which-boxed-primitive: 1.1.1which-collection: 1.0.2- which-typed-array: 1.1.19+ which-typed-array: 1.1.22dependencies:@@ -15050,10 +14790,10 @@ snapshots:dependencies:available-typed-arrays: 1.0.7- call-bind: 1.0.8+ call-bind: 1.0.9call-bound: 1.0.4for-each: 0.3.5get-proto: 1.0.1@@ -15107,8 +14847,6 @@ snapshots:- [email protected]: {}-@@ -15162,20 +14900,18 @@ snapshots:dependencies:- zod: 3.24.4+ zod: 3.25.76dependencies:- zod: 3.24.4+ zod: 3.25.76dependencies:zod: 3.25.76- [email protected]: {}-- [email protected]: {}+ [email protected]: {}diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yamlnew file mode 100644index 0000000..44074a8--- /dev/null+++ b/pnpm-workspace.yaml@@ -0,0 +1,57 @@+# fontkit 2.0.4 drops characters from generated PDFs. Rendering an accented+# letter (ã ç é ó) poisons a cache inside the font object, and because+# @react-pdf shares that object across every render in a page session, later+# PDFs come out with the first character of labels missing ("Cobrar de" renders+# as "obrar de") until the page is reloaded.+#+# Upstream issue (open since 2018, not fixed):+# https://github.com/foliojs/fontkit/issues/154+# The approach we use - evicting the cache entry rather than repairing it:+# https://github.com/foliojs/fontkit/issues/154#issuecomment-4187174366+#+# The patch is the fix. Do NOT remove it, and do not bump fontkit without+# re-making it - the version is pinned into the patch name, so an upgrade+# silently drops the fix and the bug comes back. Drop it only once the upstream+# issue is released.+#+# Full write-up, including how to reproduce and verify: patches/README.md+patchedDependencies:+ [email protected]: patches/[email protected]++# @react-pdf/renderer is held at 4.6.1, and its whole sub-tree is pinned here.+# This block is not arbitrary — do not loosen it to carets, and do not let a+# dependency update touch @react-pdf/* without re-reading this comment.+#+# Two independent reasons:+#+# 1. The 4.9.x line depends on the UNSCOPED `pdfkit`, which loads its 14 built-in+# fonts through a Node subpath imports map declared in its own package.json+# (`require('#standard-fonts/Helvetica')`). Vercel's runtime resolver does not+# honour `imports` maps, so every server-side render dies with+# MODULE_NOT_FOUND on the deployment while working fine in `next dev`.+# 4.6.1 uses `@react-pdf/pdfkit` instead, which has no such map.+#+# 2. 4.6.1 declares its own sub-packages with caret ranges, so a fresh install+# resolves them from the 4.9.x line. @react-pdf/[email protected] switched to the+# unscoped pdfkit and stopped calling registerStdFonts(), so every render dies+# with `Standard font "Helvetica" is not registered`. The versions below are+# the exact tree 4.6.1 shipped with (resolved at its publish date).+#+# 4.6.1 is also the newest release still on the old layout stack ([email protected] ++# [email protected]); 4.7.0 moves to [email protected]. Downgrading below 4.3.2 is not an+# option: those releases predate @react-pdf/[email protected] and cannot run on+# React 19.2.+overrides:+ "@react-pdf/fns": "3.1.3"+ "@react-pdf/font": "4.0.10"+ "@react-pdf/image": "3.1.1"+ "@react-pdf/layout": "4.7.1"+ "@react-pdf/pdfkit": "6.0.1"+ "@react-pdf/primitives": "4.3.0"+ "@react-pdf/reconciler": "2.0.0"+ "@react-pdf/render": "4.6.1"+ "@react-pdf/renderer": "4.6.1"+ "@react-pdf/stylesheet": "6.2.3"+ "@react-pdf/svg": "1.1.0"+ "@react-pdf/textkit": "6.4.1"+ "@react-pdf/types": "2.11.3"diff --git a/sentry.client.config.ts b/sentry.client.config.tsdeleted file mode 100644index eb0097e..0000000--- a/sentry.client.config.ts+++ /dev/null@@ -1,46 +0,0 @@-// This file configures the initialization of Sentry on the client.-// The config you add here will be used whenever a users loads a page in their browser.-// https://docs.sentry.io/platforms/javascript/guides/nextjs/--import * as Sentry from "@sentry/nextjs";--import {- scrubSensitiveUrlParamsBeforeBreadcrumb,- scrubSensitiveUrlParamsFromEvent,-} from "@/lib/sentry/scrub-sensitive-url-params";--const isCI = process.env.CI === "true";--// Check if we're on a Vercel preview deployment, we want to run only on prod domain-const isVercelPreview =- typeof window !== "undefined" &&- window.location.hostname.includes(".vercel.app");--// This is the client config, so we need to check the NEXT_PUBLIC_SENTRY_ENABLED environment variable-const isSentryEnabled =- process.env.NEXT_PUBLIC_SENTRY_ENABLED === "true" &&- !isCI &&- !isVercelPreview;--if (isSentryEnabled) {- Sentry.init({- dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,- enabled: isSentryEnabled,-- // Adjust sampling in production for better performance/cost balance- tracesSampleRate: 0.15, // Sample 15% of transactions-- // Recommended production settings- debug: false,-- // Privacy: the invoice data lives in the `?data=` query param, redact it in- // every URL we report (request url, referrer, breadcrumbs, spans)- beforeSend: scrubSensitiveUrlParamsFromEvent,- beforeSendTransaction: scrubSensitiveUrlParamsFromEvent,- beforeBreadcrumb: scrubSensitiveUrlParamsBeforeBreadcrumb,-- // Performance settings- replaysSessionSampleRate: 0.1, // Sample 10% of sessions- replaysOnErrorSampleRate: 1.0, // But capture all sessions with errors- });-}diff --git a/sentry.edge.config.ts b/sentry.edge.config.tsindex 5ae40a0..4293b6f 100644--- a/sentry.edge.config.ts+++ b/sentry.edge.config.ts@@ -6,33 +6,19 @@import * as Sentry from "@sentry/nextjs";import {- scrubSensitiveUrlParamsBeforeBreadcrumb,- scrubSensitiveUrlParamsFromEvent,-} from "@/lib/sentry/scrub-sensitive-url-params";--const isCI = process.env.CI === "true";--const isSentryEnabled = process.env.SENTRY_ENABLED === "true" && !isCI;--if (isSentryEnabled) {- Sentry.init({- dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,- enabled: isSentryEnabled,-- // Adjust sampling in production for better performance/cost balance- tracesSampleRate: 0.15, // Sample 15% of transactions-- // Recommended production settings- debug: false,-- // Privacy: the invoice data lives in the `?data=` query param, redact it in- // every URL we report (request url, referrer, breadcrumbs, spans)- beforeSend: scrubSensitiveUrlParamsFromEvent,- beforeSendTransaction: scrubSensitiveUrlParamsFromEvent,- beforeBreadcrumb: scrubSensitiveUrlParamsBeforeBreadcrumb,-- // Performance settings- replaysSessionSampleRate: 0.1, // Sample 10% of sessions- replaysOnErrorSampleRate: 1.0, // But capture all sessions with errors- });+ isSentryEnabled,+ logSentryEnabledLocally,+ SENTRY_SHARED_INIT_OPTIONS,+} from "@/lib/sentry/sentry-init-options";++// Opt-in via `SENTRY_ENABLED`, on every deployment and locally — see `isSentryEnabled`.+if (+ isSentryEnabled({+ enabledFlag: process.env.SENTRY_ENABLED,+ ci: process.env.CI,+ })+) {+ Sentry.init(SENTRY_SHARED_INIT_OPTIONS);++ logSentryEnabledLocally("edge");}diff --git a/sentry.server.config.ts b/sentry.server.config.tsindex fe240b4..d15775e 100644--- a/sentry.server.config.ts+++ b/sentry.server.config.ts@@ -5,33 +5,19 @@import * as Sentry from "@sentry/nextjs";import {- scrubSensitiveUrlParamsBeforeBreadcrumb,- scrubSensitiveUrlParamsFromEvent,-} from "@/lib/sentry/scrub-sensitive-url-params";--const isCI = process.env.CI === "true";--const isSentryEnabled = process.env.SENTRY_ENABLED === "true" && !isCI;--if (isSentryEnabled) {- Sentry.init({- dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,- enabled: isSentryEnabled,-- // Adjust sampling in production for better performance/cost balance- tracesSampleRate: 0.15, // Sample 15% of transactions-- // Recommended production settings- debug: false,-- // Privacy: the invoice data lives in the `?data=` query param, redact it in- // every URL we report (request url, referrer, breadcrumbs, spans)- beforeSend: scrubSensitiveUrlParamsFromEvent,- beforeSendTransaction: scrubSensitiveUrlParamsFromEvent,- beforeBreadcrumb: scrubSensitiveUrlParamsBeforeBreadcrumb,-- // Performance settings- replaysSessionSampleRate: 0.1, // Sample 10% of sessions- replaysOnErrorSampleRate: 1.0, // But capture all sessions with errors- });+ isSentryEnabled,+ logSentryEnabledLocally,+ SENTRY_SHARED_INIT_OPTIONS,+} from "@/lib/sentry/sentry-init-options";++// Opt-in via `SENTRY_ENABLED`, on every deployment and locally — see `isSentryEnabled`.+if (+ isSentryEnabled({+ enabledFlag: process.env.SENTRY_ENABLED,+ ci: process.env.CI,+ })+) {+ Sentry.init(SENTRY_SHARED_INIT_OPTIONS);++ logSentryEnabledLocally("server");}diff --git a/skills-lock.json b/skills-lock.jsonindex 8c2f277..096a971 100644--- a/skills-lock.json+++ b/skills-lock.json@@ -99,6 +99,12 @@"skillPath": ".agents/skills/seo-project-setup/SKILL.md","computedHash": "5872bc785e0ab88674a5787f70da513ecf487b6778acbbf99c35f6a8ff59fc99"},+ "typescript-advanced-types": {+ "source": "wshobson/agents",+ "sourceType": "github",+ "skillPath": "plugins/javascript-typescript/skills/typescript-advanced-types/SKILL.md",+ "computedHash": "8cbf2bf600f392d7260e476e3202932a876e2281cda3b15a8b6a5a43f383252d"+ },"vercel-composition-patterns": {"source": "vercel-labs/agent-skills","sourceType": "github",diff --git a/src/actions/fetch-github-stars.ts b/src/actions/fetch-github-stars.tsindex 19a95f8..64ba3d5 100644--- a/src/actions/fetch-github-stars.ts+++ b/src/actions/fetch-github-stars.ts@@ -1,9 +1,9 @@"use server";-import { env } from "@/env";--import { cache } from "react";import * as Sentry from "@sentry/nextjs";+import { cache } from "react";++import { env } from "@/env";/*** Fetches the current star count for the GitHub repository.diff --git a/src/app/(app)/components/__tests__/invoice-pdf-download-link.test.tsx b/src/app/(app)/components/__tests__/invoice-pdf-download-link.test.tsxindex 1ca4e2d..2ed7df2 100644--- a/src/app/(app)/components/__tests__/invoice-pdf-download-link.test.tsx+++ b/src/app/(app)/components/__tests__/invoice-pdf-download-link.test.tsx@@ -1,12 +1,5 @@// @vitest-environment happy-dom-import { getInitialInvoiceData } from "@/app/constants";-import { CTAToastProvider } from "@/app/(app)/contexts/cta-toast-context";-import { CTA_TOAST_TIMEOUT } from "@/app/(app)/components/cta-toasts";-import { DeviceContextProvider } from "@/contexts/device-context";-import type { InvoiceData } from "@/app/schema";-import { TooltipProvider } from "@/components/ui/tooltip";-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";import {cleanup,fireEvent,@@ -15,6 +8,29 @@ import {within,} from "@testing-library/react";import userEvent from "@testing-library/user-event";+import { toast } from "sonner";+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";++import {+ CTA_TOAST_TIMEOUT,+ showCTAToast,+} from "@/app/(app)/components/cta-toasts";+import { CTAToastProvider } from "@/app/(app)/contexts/cta-toast-context";+import { InvoicePdfInstanceProvider } from "@/app/(app)/contexts/invoice-pdf-instance-context";+import { updateAppMetadata } from "@/app/(app)/utils/get-app-metadata";+import { getInitialInvoiceData } from "@/app/constants";+import { CTA_TOAST_STORAGE_KEY, type InvoiceData } from "@/app/schema";+import { TooltipProvider } from "@/components/ui/tooltip";+import { DeviceContextProvider } from "@/contexts/device-context";+import { haptic } from "@/lib/haptic";+import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";+import { isTelegramInAppBrowser } from "@/utils/is-telegram-in-app-browser";++import {+ InvoicePDFDownloadLink,+ LOADING_BUTTON_TEXT,+} from "../invoice-pdf-download-link";+import "@testing-library/jest-dom/vitest";const { mockUpdatePdfInstance, mockPdfStateRef, resetMockPdfState } =@@ -45,68 +61,71 @@ vi.mock("@react-pdf/renderer/lib/react-pdf.browser", async (importOriginal) => {return {...(actual as object),- usePDF: () => [mockPdfStateRef.current, mockUpdatePdfInstance],+ usePDF: () => {+ return [mockPdfStateRef.current, mockUpdatePdfInstance];+ },};});-vi.mock("@/lib/umami-analytics-track-event", () => ({- umamiTrackEvent: vi.fn(),-}));+vi.mock("@/lib/umami-analytics-track-event", () => {+ return {+ umamiTrackEvent: vi.fn(),+ };+});-vi.mock("@sentry/nextjs", () => ({- captureException: vi.fn(),-}));+vi.mock("@sentry/nextjs", () => {+ return {+ captureException: vi.fn(),+ };+});-vi.mock("@/utils/is-telegram-in-app-browser", () => ({- isTelegramInAppBrowser: vi.fn(() => false),-}));+vi.mock("@/utils/is-telegram-in-app-browser", () => {+ return {+ isTelegramInAppBrowser: vi.fn(() => {+ return false;+ }),+ };+});-vi.mock("@/app/(app)/utils/get-app-metadata", () => ({- updateAppMetadata: vi.fn(),-}));+vi.mock("@/app/(app)/utils/get-app-metadata", () => {+ return {+ updateAppMetadata: vi.fn(),+ };+});vi.mock("@/app/(app)/components/cta-toasts", async () => {const actual = await vi.importActual("@/app/(app)/components/cta-toasts");return {...(actual as object),- showRandomCTAToast: vi.fn(),+ showCTAToast: vi.fn(),};});-vi.mock("@/lib/haptic", () => ({- haptic: vi.fn(),-}));--vi.mock("@/components/ui/toasts/error-generating-pdf-toast", () => ({- ErrorGeneratingPdfToast: vi.fn(),-}));+vi.mock("@/lib/haptic", () => {+ return {+ haptic: vi.fn(),+ };+});-vi.mock("sonner", () => ({- toast: Object.assign(vi.fn(), {- error: vi.fn(),- info: vi.fn(),- dismiss: vi.fn(),- }),-}));+vi.mock("@/components/ui/toasts/error-generating-pdf-toast", () => {+ return {+ ErrorGeneratingPdfToast: vi.fn(),+ };+});-import {- InvoicePDFDownloadLink,- LOADING_BUTTON_TEXT,-} from "../invoice-pdf-download-link";-import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";-import * as Sentry from "@sentry/nextjs";-import { isTelegramInAppBrowser } from "@/utils/is-telegram-in-app-browser";-import { updateAppMetadata } from "@/app/(app)/utils/get-app-metadata";-import { showRandomCTAToast } from "@/app/(app)/components/cta-toasts";-import { haptic } from "@/lib/haptic";-import { ErrorGeneratingPdfToast } from "@/components/ui/toasts/error-generating-pdf-toast";-import { toast } from "sonner";+vi.mock("sonner", () => {+ return {+ toast: Object.assign(vi.fn(), {+ error: vi.fn(),+ info: vi.fn(),+ dismiss: vi.fn(),+ }),+ };+});interface RenderOptions {invoiceData?: InvoiceData;- errorWhileGeneratingPdfIsShown?: boolean;- setErrorWhileGeneratingPdfIsShown?: (error: boolean) => void;qrCodeDataUrl?: string;isMobile?: boolean;inAppInfo?: { isInApp: boolean; name: string | null };@@ -114,8 +133,6 @@ interface RenderOptions {function renderInvoicePDFDownloadLink({invoiceData = getInitialInvoiceData(),- errorWhileGeneratingPdfIsShown = false,- setErrorWhileGeneratingPdfIsShown = vi.fn(),qrCodeDataUrl = "data:image/png;base64,abc",isMobile = false,inAppInfo = { isInApp: false, name: null },@@ -129,15 +146,16 @@ function renderInvoicePDFDownloadLink({inAppInfo={inAppInfo}><CTAToastProvider>- <InvoicePDFDownloadLink+ {/* The download link reads the PDF from the shared instance, so it needs the provider */}+ <InvoicePdfInstanceProviderinvoiceData={invoiceData}- errorWhileGeneratingPdfIsShown={errorWhileGeneratingPdfIsShown}- setErrorWhileGeneratingPdfIsShown={- setErrorWhileGeneratingPdfIsShown- }qrCodeDataUrl={qrCodeDataUrl}- isMobile={isMobile}- />+ >+ <InvoicePDFDownloadLink+ invoiceData={invoiceData}+ isMobile={isMobile}+ />+ </InvoicePdfInstanceProvider></CTAToastProvider></DeviceContextProvider></TooltipProvider>,@@ -152,6 +170,8 @@ describe("InvoicePDFDownloadLink", () => {beforeEach(() => {vi.clearAllMocks();resetMockPdfState();+ // the CTA toast cooldown is persisted, so it has to be cleared between tests+ localStorage.clear();vi.mocked(isTelegramInAppBrowser).mockReturnValue(false);});@@ -229,7 +249,47 @@ describe("InvoicePDFDownloadLink", () => {await vi.advanceTimersByTimeAsync(CTA_TOAST_TIMEOUT);- expect(showRandomCTAToast).toHaveBeenCalledTimes(1);+ expect(showCTAToast).toHaveBeenCalledTimes(1);+ });++ it("should not show the CTA toast again while the cooldown is active", async () => {+ vi.useFakeTimers();++ // pretend a CTA toast was shown a minute ago+ localStorage.setItem(CTA_TOAST_STORAGE_KEY, String(Date.now() - 60_000));++ renderInvoicePDFDownloadLink();++ fireEvent.click(getDownloadLink());++ // the download itself still goes through+ expect(umamiTrackEvent).toHaveBeenCalledWith("download_invoice", {+ data: {+ invoice_template: "default",+ },+ });++ await vi.advanceTimersByTimeAsync(CTA_TOAST_TIMEOUT);++ expect(showCTAToast).not.toHaveBeenCalled();+ });++ it("should show the CTA toast again once the cooldown has expired", async () => {+ vi.useFakeTimers();++ // the cooldown is 24 hours, so a toast shown two days ago no longer suppresses it+ localStorage.setItem(+ CTA_TOAST_STORAGE_KEY,+ String(Date.now() - 2 * 24 * 60 * 60 * 1000),+ );++ renderInvoicePDFDownloadLink();++ fireEvent.click(getDownloadLink());++ await vi.advanceTimersByTimeAsync(CTA_TOAST_TIMEOUT);++ expect(showCTAToast).toHaveBeenCalledTimes(1);});it("should show error toast when url is missing on click", async () => {@@ -290,41 +350,26 @@ describe("InvoicePDFDownloadLink", () => {expect(umamiTrackEvent).not.toHaveBeenCalled();});- it("should show in-app browser info toast on mount", () => {- renderInvoicePDFDownloadLink({- inAppInfo: { isInApp: true, name: "Facebook" },- });-- expect(toast.info).toHaveBeenCalledWith(- "In-App Browser Detected",- expect.objectContaining({- id: "in-app-browser-toast",- }),- );- });-- it("should show error generating PDF toast when PDF error occurs", () => {- const setErrorWhileGeneratingPdfIsShown = vi.fn();- const pdfError = new Error("PDF generation failed");+ it("should not track a download when the PDF failed to generate", async () => {+ const user = userEvent.setup();mockPdfStateRef.current = {loading: false,- url: null,- error: pdfError,+ url: "blob:http://localhost/fake-pdf",+ error: new Error("PDF generation failed"),};- renderInvoicePDFDownloadLink({- errorWhileGeneratingPdfIsShown: false,- setErrorWhileGeneratingPdfIsShown,- });+ renderInvoicePDFDownloadLink();++ await user.click(getDownloadLink());- expect(ErrorGeneratingPdfToast).toHaveBeenCalledTimes(1);- expect(setErrorWhileGeneratingPdfIsShown).toHaveBeenCalledWith(true);- expect(umamiTrackEvent).toHaveBeenCalledWith(- "error_generating_document_link",- { data: { error: pdfError } },+ // the provider reports the failure itself, the button just must not count it+ // as a download+ expect(umamiTrackEvent).not.toHaveBeenCalledWith(+ "download_invoice",+ expect.anything(),);- expect(Sentry.captureException).toHaveBeenCalledWith(pdfError);+ expect(haptic).not.toHaveBeenCalled();});it("should show responsibility tooltip on hover", async () => {diff --git a/src/app/(app)/components/changelog-update-popup.tsx b/src/app/(app)/components/changelog-update-popup.tsxindex 0e72128..76c1348 100644--- a/src/app/(app)/components/changelog-update-popup.tsx+++ b/src/app/(app)/components/changelog-update-popup.tsx@@ -1,20 +1,17 @@"use client";-import type { ChangelogSummary } from "@/app/changelog/utils";-import { Button } from "@/components/ui/button";+import { XIcon } from "lucide-react";+import Link from "next/link";+import { useEffect } from "react";+import type { AppUpdatePopupVariant } from "@/app/(app)/hooks/use-changelog-update-popup";+import { Button } from "@/components/ui/button";import { DISCORD_COMMUNITY_URL, REDDIT_COMMUNITY_URL } from "@/config";-import { markChangelogAsSeen } from "@/app/(app)/utils/changelog-seen-storage";-import { markWelcomePopupSeen } from "@/app/(app)/utils/welcome-popup-seen-storage";import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";import { cn } from "@/lib/utils";-import { XIcon } from "lucide-react";-import Link from "next/link";-import { useCallback, useEffect } from "react";interface ChangelogUpdatePopupProps {variant: AppUpdatePopupVariant;- latestChangelog: ChangelogSummary | null;isOpen: boolean;onDismiss: () => void;onHowItWorksClick?: () => void;@@ -78,21 +75,10 @@ const POPUP_CONTENT = {export function ChangelogUpdatePopup({variant,- latestChangelog,isOpen,onDismiss,onHowItWorksClick,}: ChangelogUpdatePopupProps) {- const markSeenAndDismiss = useCallback(() => {- if (variant === "welcome") {- markWelcomePopupSeen();- } else if (latestChangelog) {- markChangelogAsSeen(latestChangelog.slug);- }-- onDismiss();- }, [latestChangelog, onDismiss, variant]);-useEffect(() => {if (!isOpen) {return;@@ -100,7 +86,7 @@ export function ChangelogUpdatePopup({const handleKeyDown = (event: KeyboardEvent) => {if (event.key === "Escape") {- markSeenAndDismiss();+ onDismiss();}};@@ -109,7 +95,7 @@ export function ChangelogUpdatePopup({return () => {window.removeEventListener("keydown", handleKeyDown);};- }, [isOpen, markSeenAndDismiss]);+ }, [isOpen, onDismiss]);if (!isOpen) {return null;@@ -138,7 +124,7 @@ export function ChangelogUpdatePopup({data-testid="changelog-update-close"onClick={() => {umamiTrackEvent(`${analyticsPrefix}-dismissed`);- markSeenAndDismiss();+ onDismiss();}}variant="ghost"size="icon"@@ -163,7 +149,7 @@ export function ChangelogUpdatePopup({data-testid={content.continueTestId}onClick={() => {umamiTrackEvent(`${analyticsPrefix}-continue`);- markSeenAndDismiss();+ onDismiss();}}>Continue@@ -177,7 +163,7 @@ export function ChangelogUpdatePopup({data-testid={content.secondaryTestId}onClick={() => {umamiTrackEvent(`${analyticsPrefix}-how-it-works`);- markSeenAndDismiss();+ onDismiss();onHowItWorksClick?.();}}>@@ -195,7 +181,7 @@ export function ChangelogUpdatePopup({href="/changelog"onClick={() => {umamiTrackEvent(`${analyticsPrefix}-link`);- markSeenAndDismiss();+ onDismiss();}}>New featuresdiff --git a/src/app/(app)/components/cta-toasts/index.tsx b/src/app/(app)/components/cta-toasts/index.tsxindex fea23b3..f6fcb48 100644--- a/src/app/(app)/components/cta-toasts/index.tsx+++ b/src/app/(app)/components/cta-toasts/index.tsx@@ -1,10 +1,10 @@-import { Button } from "@/components/ui/button";-import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";-import { GiftIcon, Heart, Star, XIcon } from "lucide-react";+import { GiftIcon, XIcon } from "lucide-react";+import { toast as sonnerToast } from "sonner";import { GithubIcon } from "@/components/etc/github-logo";+import { Button } from "@/components/ui/button";import { DISCORD_FEEDBACK_URL, GITHUB_URL } from "@/config";-import { toast as sonnerToast } from "sonner";+import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";interface ToastProps {id: string | number;@@ -12,47 +12,11 @@ interface ToastProps {description: string;}-/**- * Renders a premium donation toast- */-function customPremiumToast(toast: ToastProps) {- // dismiss any existing toasts- sonnerToast.dismiss();-- return sonnerToast.custom(- (id) => (- <PremiumDonationToast- id={id}- title={toast.title}- description={toast.description}- />- ),- {- duration: Infinity,- },- );-}--/**- * Renders a default donation toast- */-function customDefaultToast(toast: ToastProps) {- // dismiss any existing toasts- sonnerToast.dismiss();-- return sonnerToast.custom(- (id) => (- <DefaultDonationToast- id={id}- title={toast.title}- description={toast.description}- />- ),- {- duration: Infinity,- },- );-}+const CTA_TOAST = {+ title: "Support Open Source",+ description:+ "Your contribution helps me maintain and improve this open-source project for everyone! 🚀",+} as const;const SonnerCloseButton = (props: React.ButtonHTMLAttributes<HTMLButtonElement>,@@ -80,7 +44,11 @@ function PremiumDonationToast(props: ToastProps) {data-testid="download-pdf-toast">{/* Close button - styled like default Sonner toast */}- <SonnerCloseButton onClick={() => sonnerToast.dismiss(id)} />+ <SonnerCloseButton+ onClick={() => {+ return sonnerToast.dismiss(id);+ }}+ /><div className="relative"><div className="mb-2 flex items-center gap-2">@@ -143,108 +111,30 @@ function PremiumDonationToast(props: ToastProps) {);}-function DefaultDonationToast(props: ToastProps) {- const { title, description, id } = props;-- return (- <div- className="flex w-full items-start gap-3 rounded-lg border border-indigo-200 bg-gradient-to-br from-indigo-50 via-white to-purple-50 p-4 shadow-xl lg:max-w-md"- data-testid="download-pdf-toast"- >- {/* Close button - styled like default Sonner toast */}- <SonnerCloseButton onClick={() => sonnerToast.dismiss(id)} />-- <div className="flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-pink-500 to-purple-600">- <Heart className="h-5 w-5 fill-current text-white" />- </div>- <div className="min-w-0 flex-1">- <div className="mb-1 flex items-center gap-2">- <p className="text-sm font-semibold text-gray-900">{title}</p>- </div>- <p className="mb-3 text-xs leading-relaxed text-gray-600">- {description}- </p>- <div className="flex items-end justify-end gap-2">- <Button- size="sm"- className="group h-8 max-w-[150px] bg-gray-900 px-3 text-xs font-medium text-white transition-all duration-200 hover:bg-gray-800"- asChild- >- <a- href={GITHUB_URL}- target="_blank"- rel="noopener noreferrer"- onClick={() => {- umamiTrackEvent("gh_star_btn_click_download_pdf_toast_default");-- sonnerToast.dismiss(id);- }}- >- <Star className="mr-1 size-3.5 fill-yellow-300 text-yellow-300" />- Star on GitHub- </a>- </Button>- <Button- size="sm"- className="h-8 max-w-[150px] flex-1 border border-gray-300 bg-gray-100 text-xs text-gray-900 transition-all duration-200 hover:bg-gray-200"- variant="secondary"- asChild- data-testid="toast-cta-btn"- >- <a- href={DISCORD_FEEDBACK_URL}- target="_blank"- rel="noopener noreferrer"- onClick={() => {- umamiTrackEvent(- "feedback_btn_click_download_pdf_toast_default",- );+/**+ * Shows the donation CTA toast. Triggered only after the user downloads a PDF.+ */+export const showCTAToast = () => {+ // dismiss any existing toasts+ sonnerToast.dismiss();- sonnerToast.dismiss(id);- }}- >- Share Feedback- </a>- </Button>- </div>- </div>- </div>+ return sonnerToast.custom(+ (id) => {+ return (+ <PremiumDonationToast+ id={id}+ title={CTA_TOAST.title}+ description={CTA_TOAST.description}+ />+ );+ },+ {+ duration: Infinity,+ },);-}--const CTA_TOASTS = [- {- id: "premium-donation-toast-client-page",- title: "Support Open Source",- description:- "Your contribution helps me maintain and improve this open-source project for everyone! 🚀",- show: customPremiumToast,- },- {- id: "default-donation-toast-client-page",- title: "Like this open-source project?",- description:- "Help me keep this free tool running! Your support enables me to add new features and maintain the service. 🙏",- show: customDefaultToast,- },-] as const satisfies {- id: string;- title: string;- description: string;- show: (toast: ToastProps) => void;-}[];--export const showRandomCTAToast = () => {- const variant = CTA_TOASTS[Math.floor(Math.random() * CTA_TOASTS.length)];-- variant.show({- id: variant.id,- title: variant.title,- description: variant.description,- });};/*** Slight delay to prevent the toast from appearing too quickly*/-export const CTA_TOAST_TIMEOUT = 2_500; // in ms+export const CTA_TOAST_TIMEOUT = 2500; // in msdiff --git a/src/app/(app)/components/how-it-works-video-dialog.tsx b/src/app/(app)/components/how-it-works-video-dialog.tsxindex 5a8e3cc..d03dd28 100644--- a/src/app/(app)/components/how-it-works-video-dialog.tsx+++ b/src/app/(app)/components/how-it-works-video-dialog.tsx@@ -9,7 +9,6 @@ import {DialogTitle,} from "@/components/ui/dialog";import { HOW_IT_WORKS_VIDEOS } from "@/config";-import { useEffect, useState } from "react";interface HowItWorksVideoDialogProps {open: boolean;@@ -25,17 +24,6 @@ export function HowItWorksVideoDialog({open,onOpenChange,}: HowItWorksVideoDialogProps) {- const [resetKey, setResetKey] = useState(0);-- // Reset video iframe when dialog opens by incrementing a key.- // This forces the HowItWorksVideos component to re-mount and reload video.- // eslint-disable-next-line react-you-might-not-need-an-effect/you-might-not-need-an-effect- useEffect(() => {- if (open) {- setResetKey((key) => key + 1);- }- }, [open]);-const activeVideo = HOW_IT_WORKS_VIDEOS[0];return (@@ -47,7 +35,9 @@ export function HowItWorksVideoDialog({</DialogHeader><HowItWorksVideos- resetKey={resetKey}+ // Radix keeps the dialog content mounted after it closes, so remount the+ // player on every open: it starts from `initialVideoId` with a fresh iframe+ key={String(open)}initialVideoId={DEFAULT_VIDEO_ID}showIframe={open}className="gap-0"diff --git a/src/app/(app)/components/how-it-works-videos.tsx b/src/app/(app)/components/how-it-works-videos.tsxindex 3ba17b0..d64b9bd 100644--- a/src/app/(app)/components/how-it-works-videos.tsx+++ b/src/app/(app)/components/how-it-works-videos.tsx@@ -1,5 +1,8 @@"use client";+import { useSearchParams } from "next/navigation";+import { useState } from "react";+import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";import {DISCORD_COMMUNITY_URL,@@ -8,14 +11,16 @@ import {} from "@/config";import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";import { cn } from "@/lib/utils";-import { useSearchParams } from "next/navigation";-import { useEffect, useState } from "react";type HowItWorksVideoId = (typeof HOW_IT_WORKS_VIDEOS)[number]["id"];const DEFAULT_VIDEO_ID = HOW_IT_WORKS_VIDEOS[0].id;-const VALID_VIDEO_IDS = new Set(HOW_IT_WORKS_VIDEOS.map((video) => video.id));+const VALID_VIDEO_IDS = new Set(+ HOW_IT_WORKS_VIDEOS.map((video) => {+ return video.id;+ }),+);function isValidVideoId(value: string | null): value is HowItWorksVideoId {return value !== null && VALID_VIDEO_IDS.has(value as HowItWorksVideoId);@@ -23,7 +28,6 @@ function isValidVideoId(value: string | null): value is HowItWorksVideoId {interface HowItWorksVideosProps {initialVideoId?: HowItWorksVideoId;- resetKey?: string | number;showIframe?: boolean;className?: string;/** Overrides the active video title in the heading. */@@ -41,7 +45,6 @@ interface HowItWorksVideosProps {*/export function HowItWorksVideos({initialVideoId,- resetKey,showIframe = true,className,title,@@ -53,37 +56,37 @@ export function HowItWorksVideos({const searchParams = useSearchParams();const videoParam = searchParams.get("video");- const resolvedInitialId = isValidVideoId(videoParam)- ? videoParam- : (initialVideoId ?? DEFAULT_VIDEO_ID);-- const [activeVideoId, setActiveVideoId] =- useState<HowItWorksVideoId>(resolvedInitialId);-- // Reset activeVideoId when resetKey changes, e.g. after dialog open/close.- // If initialVideoId provided, use it, otherwise fallback to default.- // eslint-disable-next-line react-you-might-not-need-an-effect/you-might-not-need-an-effect- useEffect(() => {- if (resetKey !== undefined) {- setActiveVideoId(initialVideoId ?? DEFAULT_VIDEO_ID);- }- }, [resetKey, initialVideoId]);-- // Sync active tab with ?video query param in URL.- // If videoParam is valid, update activeVideoId state.- useEffect(() => {- if (isValidVideoId(videoParam)) {- setActiveVideoId(videoParam);- }- }, [videoParam]);+ const paramVideoId = isValidVideoId(videoParam) ? videoParam : null;++ // The tab the user picked, if any. Everything else about the active video is+ // derived, so there is nothing to keep in sync with an effect.+ const [selectedVideoId, setSelectedVideoId] =+ useState<HowItWorksVideoId | null>(null);++ // A ?video= deep link wins over an earlier tab click: the "Watch tutorial"+ // links on /how-it-works navigate without remounting this component.+ const [lastParamVideoId, setLastParamVideoId] = useState(paramVideoId);++ // This block checks if the `video` query parameter in the URL (`paramVideoId`)+ // has changed compared to what we last saw (`lastParamVideoId`). If it has changed,+ // we update `lastParamVideoId` to the new value, and reset `selectedVideoId` to null.+ // This means that the tab selection should now follow the new value from the URL.+ if (paramVideoId !== lastParamVideoId) {+ setLastParamVideoId(paramVideoId);+ setSelectedVideoId(null);+ }++ const activeVideoId =+ selectedVideoId ?? paramVideoId ?? initialVideoId ?? DEFAULT_VIDEO_ID;const activeVideo =- HOW_IT_WORKS_VIDEOS.find((video) => video.id === activeVideoId) ??- HOW_IT_WORKS_VIDEOS[0];+ HOW_IT_WORKS_VIDEOS.find((video) => {+ return video.id === activeVideoId;+ }) ?? HOW_IT_WORKS_VIDEOS[0];function handleTabChange(value: string) {const videoId = value as HowItWorksVideoId;- setActiveVideoId(videoId);+ setSelectedVideoId(videoId);umamiTrackEvent(`how-it-works-video-tab-${value}`);onVideoChange?.(videoId);}@@ -116,17 +119,19 @@ export function HowItWorksVideos({<div className="-mx-4 overflow-x-auto px-4 [scrollbar-width:none] sm:mx-0 sm:overflow-visible sm:px-0 [&::-webkit-scrollbar]:hidden"><Tabs value={activeVideoId} onValueChange={handleTabChange}><TabsList className="inline-flex h-auto w-max min-w-full justify-center gap-0.5 sm:min-w-0 sm:gap-1">- {HOW_IT_WORKS_VIDEOS.map((video) => (- <TabsTrigger- key={video.id}- value={video.id}- className="shrink-0 whitespace-nowrap px-2.5 py-1 text-xs sm:px-3 sm:py-1.5 sm:text-sm"- data-testid={`how-it-works-tab-${video.id}`}- >- <span className="sm:hidden">{video.tabLabelShort}</span>- <span className="hidden sm:inline">{video.tabLabel}</span>- </TabsTrigger>- ))}+ {HOW_IT_WORKS_VIDEOS.map((video) => {+ return (+ <TabsTrigger+ key={video.id}+ value={video.id}+ className="shrink-0 whitespace-nowrap px-2.5 py-1 text-xs sm:px-3 sm:py-1.5 sm:text-sm"+ data-testid={`how-it-works-tab-${video.id}`}+ >+ <span className="sm:hidden">{video.tabLabelShort}</span>+ <span className="hidden sm:inline">{video.tabLabel}</span>+ </TabsTrigger>+ );+ })}</TabsList></Tabs></div>@@ -155,7 +160,9 @@ export function HowItWorksVideos({rel="noopener noreferrer"className="font-semibold text-slate-800 underline decoration-slate-400 underline-offset-2 transition-colors hover:text-slate-950 hover:decoration-slate-500"data-testid="how-it-works-discord"- onClick={() => umamiTrackEvent("how-it-works-discord-click")}+ onClick={() => {+ return umamiTrackEvent("how-it-works-discord-click");+ }}>Discord</a>{" "}@@ -166,7 +173,9 @@ export function HowItWorksVideos({rel="noopener noreferrer"className="font-semibold text-slate-800 underline decoration-slate-400 underline-offset-2 transition-colors hover:text-slate-950 hover:decoration-slate-500"data-testid="how-it-works-reddit"- onClick={() => umamiTrackEvent("how-it-works-reddit-click")}+ onClick={() => {+ return umamiTrackEvent("how-it-works-reddit-click");+ }}></a>{" "}diff --git a/src/app/(app)/components/index.tsx b/src/app/(app)/components/index.tsxindex fb8c6ea..d2b4e5c 100644--- a/src/app/(app)/components/index.tsx+++ b/src/app/(app)/components/index.tsx@@ -1,11 +1,3 @@-import { InvoicePdfTemplate } from "@/app/(app)/components/invoice-templates/invoice-pdf-default-template";-import { StripeInvoicePdfTemplate } from "@/app/(app)/components/invoice-templates/invoice-pdf-stripe-template";-import type { InvoiceData, MobileTabsValues } from "@/app/schema";-import { DEFAULT_MOBILE_TAB, MOBILE_TABS_VALUES } from "@/app/schema";-import { Button } from "@/components/ui/button";-import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";-import { CustomTooltip } from "@/components/ui/tooltip";-import { cn } from "@/lib/utils";import dayjs from "dayjs";import {AlertCircleIcon,@@ -14,112 +6,90 @@ import {PencilIcon,} from "lucide-react";import dynamic from "next/dynamic";-import Link from "next/link";-import type { Dispatch, SetStateAction } from "react";+import { useRef, useState, type RefObject } from "react";++import {+ type InvoiceData,+ type MobileTabsValues,+ DEFAULT_MOBILE_TAB,+ MOBILE_TABS_VALUES,+} from "@/app/schema";+import { Button } from "@/components/ui/button";+import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";+import { CustomTooltip } from "@/components/ui/tooltip";+import { cn } from "@/lib/utils";+import { getAppMetadata, updateAppMetadata } from "../utils/get-app-metadata";import { InvoiceForm } from "./invoice-form";-import { InvoicePDFDownloadLink } from "./invoice-pdf-download-link";import { MobileFormScrollContainer } from "./mobile-form-scroll-container";-const DesktopPDFViewerModuleLoading = () => (- <div className="flex h-[580px] w-full items-center justify-center border border-gray-200 bg-gray-200 lg:h-[620px] 2xl:h-[700px]">- <div className="text-center">- <div className="mx-auto mb-4 h-8 w-8 animate-spin rounded-full border-4 border-blue-500 border-t-transparent" />- <p className="text-gray-600">Loading PDF viewer...</p>+const DesktopPDFViewerModuleLoading = () => {+ return (+ <div className="flex h-[580px] w-full items-center justify-center border border-gray-200 bg-gray-200 lg:h-[620px] 2xl:h-[700px]">+ <div className="text-center">+ <div className="mx-auto mb-4 h-8 w-8 animate-spin rounded-full border-4 border-blue-500 border-t-transparent" />+ <p className="text-gray-600">Loading PDF viewer...</p>+ </div></div>- </div>-);+ );+};-const MobileInvoicePDFViewerModuleLoading = () => (- <div className="flex h-[520px] w-[650px] items-center justify-center border border-gray-200 bg-gray-200 lg:h-[620px] 2xl:h-[700px]">- <div className="text-center">- <div className="mx-auto mb-4 h-8 w-8 animate-spin rounded-full border-4 border-blue-500 border-t-transparent" />- <p className="text-gray-600">Loading PDF viewer...</p>+const MobileInvoicePDFViewerModuleLoading = () => {+ return (+ <div className="flex h-[520px] w-[650px] items-center justify-center border border-gray-200 bg-gray-200 lg:h-[620px] 2xl:h-[700px]">+ <div className="text-center">+ <div className="mx-auto mb-4 h-8 w-8 animate-spin rounded-full border-4 border-blue-500 border-t-transparent" />+ <p className="text-gray-600">Loading PDF viewer...</p>+ </div></div>- </div>-);+ );+};const DesktopInvoicePDFViewer = dynamic(- () =>- import("./invoice-pdf-preview/desktop-pdf-viewer").then(- (mod) => mod.DesktopInvoicePDFViewer,- ),+ () => {+ return import("./invoice-pdf-preview/desktop-pdf-viewer").then((mod) => {+ return mod.DesktopInvoicePDFViewer;+ });+ },{ssr: false,- loading: () => <DesktopPDFViewerModuleLoading />,+ loading: () => {+ return <DesktopPDFViewerModuleLoading />;+ },},);const MobileInvoicePDFViewer = dynamic(- () =>- import("./invoice-pdf-preview/mobile-pdf-viewer").then(- (mod) => mod.MobileInvoicePDFViewer,- ),+ () => {+ return import("./invoice-pdf-preview/mobile-pdf-viewer").then((mod) => {+ return mod.MobileInvoicePDFViewer;+ });+ },{ssr: false,- loading: () => <MobileInvoicePDFViewerModuleLoading />,+ loading: () => {+ return <MobileInvoicePDFViewerModuleLoading />;+ },},);-const PdfViewer = ({- invoiceData,- errorWhileGeneratingPdfIsShown,- isMobile,- qrCodeDataUrl,-}: {- invoiceData: InvoiceData;- errorWhileGeneratingPdfIsShown: boolean;- isMobile: boolean;- qrCodeDataUrl: string;-}) => {- // Render the appropriate template based on the selected template- const renderTemplate = () => {- switch (invoiceData.template) {- case "stripe":- return (- <StripeInvoicePdfTemplate- invoiceData={invoiceData}- qrCodeDataUrl={qrCodeDataUrl}- />- );- case "default":- default:- return (- <InvoicePdfTemplate- invoiceData={invoiceData}- qrCodeDataUrl={qrCodeDataUrl}- />- );- }- };-+const PdfViewer = ({ isMobile }: { isMobile: boolean }) => {+ // Both viewers read the single PDF generated by `InvoicePdfInstanceProvider`.+ //// Use Mobile PDF viewer for:// 1. Mobile devices// 2. Any in-app browser/WebView environment (new logic for platforms like X.com, LinkedIn, etc.)// This is due to limitations of the standard PDF viewer in these environments// https://github.com/diegomura/react-pdf/issues/714if (isMobile) {- return (- <MobileInvoicePDFViewer- invoiceData={invoiceData}- qrCodeDataUrl={qrCodeDataUrl}- />- );+ return <MobileInvoicePDFViewer />;}- const template = renderTemplate();-// Normal version for standard desktop browsers- return (- <DesktopInvoicePDFViewer- errorWhileGeneratingPdfIsShown={errorWhileGeneratingPdfIsShown}- >- {template}- </DesktopInvoicePDFViewer>- );+ return <DesktopInvoicePDFViewer />;};const TAB_INVOICE_FORM = MOBILE_TABS_VALUES[0];@@ -149,21 +119,15 @@ export function InvoiceClientPage({handleInvoiceDataChange,handleShareInvoice,isMobile,- errorWhileGeneratingPdfIsShown,- setErrorWhileGeneratingPdfIsShown,canShareInvoice,- qrCodeDataUrl,- setInvoiceFormHasErrors,+ currentInvoiceFormDataRef,}: {invoiceDataState: InvoiceData;handleInvoiceDataChange: (invoiceData: InvoiceData) => void;handleShareInvoice: () => void;isMobile: boolean;- errorWhileGeneratingPdfIsShown: boolean;- setErrorWhileGeneratingPdfIsShown: (error: boolean) => void;canShareInvoice: boolean;- qrCodeDataUrl: string;- setInvoiceFormHasErrors: Dispatch<SetStateAction<boolean>>;+ currentInvoiceFormDataRef: RefObject<(() => InvoiceData | null) | null>;}) {const appMetadata = getAppMetadata();@@ -176,16 +140,66 @@ export function InvoiceClientPage({const defaultMobileTab =appMetadata?.lastVisitedMobileTab || DEFAULT_MOBILE_TAB;+ const [activeMobileTab, setActiveMobileTab] =+ useState<MobileTabsValues>(defaultMobileTab);++ // Tabs whose panel has been opened at least once. Radix unmounts the panel of the+ // inactive tab, and both panels lose something real when that happens:+ //+ // - the preview threw away the rendered document, so `react-pdf` parsed and rasterized+ // the very same PDF again (with its loading spinner in between) on every switch back+ // - the form cancelled the debounced save that `InvoiceForm` schedules 500ms after a+ // keystroke, so an edit followed by a quick tab switch was silently lost+ //+ // Once a panel has been opened we keep it mounted and hide it with CSS instead. Panels+ // stay lazy until their first visit, so the preview costs nothing for a user who never+ // opens it.+ const [openedMobileTabs, setOpenedMobileTabs] = useState<MobileTabsValues[]>(+ () => {+ return [defaultMobileTab];+ },+ );++ /**+ * Determines if a given mobile tab should remain mounted.+ *+ * This is useful for maintaining state or performance optimizations where certain tabs+ * should not be unmounted when inactive, such as when using libraries that unmount inactive panels by default.+ */+ const keepMounted = (tab: MobileTabsValues) => {+ // `forceMount` only accepts `true | undefined`, `false` would still force the mount+ return openedMobileTabs.includes(tab) || undefined;+ };++ /**+ * Filled in by `InvoiceForm`. The form only writes an edit through after a 500ms+ * debounce, so leaving for the preview would otherwise show the previous version of the+ * invoice for a moment.+ */+ const flushPendingFormChangesRef = useRef<(() => void) | null>(null);+return (<>{isMobile ? (<div><Tabs- defaultValue={defaultMobileTab}+ value={activeMobileTab}className="w-full"onValueChange={(value) => {const newValue = value as MobileTabsValues;+ // commit whatever was typed just before the switch, so the preview opens on+ // the current invoice instead of catching up half a second later+ flushPendingFormChangesRef.current?.();++ setActiveMobileTab(newValue);++ setOpenedMobileTabs((current) => {+ return current.includes(newValue)+ ? current+ : [...current, newValue];+ });+// update the last visited mobile tab in the app metadataupdateAppMetadata((current) => {return {@@ -195,116 +209,152 @@ export function InvoiceClientPage({});}}>- <TabsList className="w-full">- <TabsTrigger value={TAB_INVOICE_FORM} className="flex-1">- <span className="flex items-center gap-1">- <PencilIcon className="h-4 w-4" />- Edit Invoice- </span>- </TabsTrigger>- <TabsTrigger value={TAB_INVOICE_PREVIEW} className="flex-1">- <span className="flex items-center gap-1">- <FileTextIcon className="h-4 w-4" />- Preview PDF- </span>- </TabsTrigger>- </TabsList>- <TabsContent value={TAB_INVOICE_FORM} className="mt-1">+ <TabsContent+ value={TAB_INVOICE_FORM}+ forceMount={keepMounted(TAB_INVOICE_FORM)}+ className="mt-1 data-[state=inactive]:hidden"+ ><MobileFormScrollContainer className="h-[520px] overflow-auto rounded-lg border-b px-3 shadow-sm"><InvoiceForminvoiceData={invoiceDataState}handleInvoiceDataChange={handleInvoiceDataChange}isMobile- setInvoiceFormHasErrors={setInvoiceFormHasErrors}+ currentInvoiceFormDataRef={currentInvoiceFormDataRef}+ flushPendingChangesRef={flushPendingFormChangesRef}/></MobileFormScrollContainer></TabsContent>- <TabsContent value={TAB_INVOICE_PREVIEW} className="mt-1">+ <TabsContent+ value={TAB_INVOICE_PREVIEW}+ // `forceMount` keeps the panel in the tree, but it also stops Radix from+ // hiding it, so the inactive state is hidden with CSS here instead+ forceMount={keepMounted(TAB_INVOICE_PREVIEW)}+ className="mt-1 data-[state=inactive]:hidden"+ ><div className="flex h-[520px] w-full items-center justify-center">- <PdfViewer- invoiceData={invoiceDataState}- errorWhileGeneratingPdfIsShown={- errorWhileGeneratingPdfIsShown- }- isMobile={isMobile}- qrCodeDataUrl={qrCodeDataUrl}- />+ <PdfViewer isMobile={isMobile} /></div></TabsContent>- </Tabs>- <div className="sticky bottom-0 z-50 mt-2 flex flex-col items-center justify-center gap-3 rounded-lg border border-t border-gray-200 bg-white px-3 py-3 shadow-[0_-4px_6px_-1px_rgba(0,0,0,0.1),0_-2px_4px_-2px_rgba(0,0,0,0.05)]">- <CustomTooltip- className={cn(!canShareInvoice && "bg-red-50")}- trigger={- <Button- data-disabled={!canShareInvoice} // for better UX than 'disabled'- onClick={handleShareInvoice}- variant="outline"- className={cn("mx-2 w-full")}+ <div className="sticky bottom-0 z-50 flex flex-col items-center justify-center gap-3 rounded-lg border border-t border-gray-200 bg-white px-3 py-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] shadow-[0_-4px_6px_-1px_rgba(0,0,0,0.1),0_-2px_4px_-2px_rgba(0,0,0,0.05)]">+ {/*+ The switch lives in the dock rather than at the top of the page, so it sits+ in the same thumb zone as the two buttons it belongs with.++ Styled after HeroUI's tabs: a pill-shaped track and a single indicator that+ slides between the two tabs, instead of a background that appears on the+ active trigger. The indicator is a plain element Radix never sees — with+ exactly two equal-width tabs it is half the track wide and moves by its own+ width, so there are no magic offsets to keep in sync.+ */}+ {/*+ `gap-0` matters: the base `TabsList` spaces its triggers by 8px, which would+ make each one 4px narrower than the indicator and leave the pill sitting+ slightly off its label. With no gap, a trigger and the indicator are both+ exactly half the track minus the 4px inset.+ */}+ <TabsList className="relative h-10 w-full gap-0 rounded-full bg-slate-200 p-1">+ <span+ aria-hidden="true"+ className={cn(+ "pointer-events-none absolute inset-y-1 left-1 w-[calc(50%-0.25rem)] rounded-full bg-white",+ "shadow-[0_2px_4px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.06),0_0_1px_rgba(0,0,0,0.06)]",+ "transition-transform duration-300 [transition-timing-function:cubic-bezier(0.32,0.72,0,1)] motion-reduce:transition-none",+ activeMobileTab === TAB_INVOICE_PREVIEW &&+ "translate-x-full",+ )}+ />+ <TabsTrigger+ value={TAB_INVOICE_FORM}+ // `bg-transparent` and `shadow-none` are load-bearing: without them the+ // trigger paints its own white pill on top of the sliding indicator+ className="z-10 flex-1 rounded-full text-slate-600 hover:bg-transparent hover:text-slate-900 data-[state=active]:bg-transparent data-[state=active]:text-slate-900 data-[state=active]:shadow-none"+ data-testid="edit-invoice-tab">- <LinkIcon className="mr-1.5 size-4" />- Get link- </Button>- }- content={- canShareInvoice ? (- <div className="flex items-center gap-3 p-2">- <div className="space-y-1">- <p className="text-sm font-semibold text-slate-900">- Share Invoice Online- </p>- <p className="text-pretty text-xs leading-relaxed text-slate-700">- Generate a link to share this invoice with your clients.- They can view and download it directly from their- browser.- </p>- </div>- </div>- ) : (- <div- data-testid="share-invoice-tooltip-content"- className="flex items-center gap-3 bg-red-50 p-3"+ <span className="flex items-center gap-1">+ <PencilIcon className="h-4 w-4" />+ Edit Invoice+ </span>+ </TabsTrigger>+ <TabsTrigger+ value={TAB_INVOICE_PREVIEW}+ className="z-10 flex-1 rounded-full text-slate-600 hover:bg-transparent hover:text-slate-900 data-[state=active]:bg-transparent data-[state=active]:text-slate-900 data-[state=active]:shadow-none"+ data-testid="preview-pdf-tab"+ >+ <span className="flex items-center gap-1">+ <FileTextIcon className="h-4 w-4" />+ Preview PDF+ </span>+ </TabsTrigger>+ </TabsList>+ <CustomTooltip+ className={cn(!canShareInvoice && "bg-red-50")}+ trigger={+ <Button+ data-disabled={!canShareInvoice} // for better UX than 'disabled'+ onClick={handleShareInvoice}+ variant="outline"+ className={cn("mx-2 w-full")}>- <AlertCircleIcon className="h-5 w-5 flex-shrink-0 fill-red-600 text-white" />- <div className="space-y-1">- <p className="text-sm font-semibold text-red-800">- Unable to Share Invoice- </p>- <p className="text-pretty text-xs leading-relaxed text-red-700">- Invoices with logos cannot be shared. Please remove the- logo to generate a shareable link. You can still- download the invoice as PDF and share it.- </p>+ <LinkIcon className="mr-1.5 size-4" />+ Get link+ </Button>+ }+ content={+ canShareInvoice ? (+ <div className="flex items-center gap-3 p-2">+ <div className="space-y-1">+ <p className="text-sm font-semibold text-slate-900">+ Share Invoice Online+ </p>+ <p className="text-pretty text-xs leading-relaxed text-slate-700">+ Generate a link to share this invoice with your+ clients. They can view and download it directly from+ their browser.+ </p>+ </div></div>- </div>- )- }- />- <InvoicePDFDownloadLink- invoiceData={invoiceDataState}- errorWhileGeneratingPdfIsShown={errorWhileGeneratingPdfIsShown}- setErrorWhileGeneratingPdfIsShown={- setErrorWhileGeneratingPdfIsShown- }- qrCodeDataUrl={qrCodeDataUrl}- isMobile={isMobile}- />- </div>+ ) : (+ <div+ data-testid="share-invoice-tooltip-content"+ className="flex items-center gap-3 bg-red-50 p-3"+ >+ <AlertCircleIcon className="h-5 w-5 flex-shrink-0 fill-red-600 text-white" />+ <div className="space-y-1">+ <p className="text-sm font-semibold text-red-800">+ Unable to Share Invoice+ </p>+ <p className="text-pretty text-xs leading-relaxed text-red-700">+ Invoices with logos cannot be shared. Please remove+ the logo to generate a shareable link. You can still+ download the invoice as PDF and share it.+ </p>+ </div>+ </div>+ )+ }+ />+ <InvoicePDFDownloadLink+ invoiceData={invoiceDataState}+ isMobile={isMobile}+ />+ </div>+ </Tabs>{/** Mobile version */}<div className="relative mx-2 mt-2 flex flex-wrap items-center justify-center gap-x-2 gap-y-1 text-center text-xs text-zinc-700 duration-500 animate-in fade-in slide-in-from-bottom-2">- <LocalStorageNotice />{invoiceLastUpdatedAtFormatted ? (<>- <span- className="hidden h-3 w-px bg-zinc-400 min-[453px]:block"- aria-hidden="true"- />- <span>+ <span data-testid="mobile-invoice-last-updated"><span className="font-semibold">Invoice last updated:</span>{" "}{invoiceLastUpdatedAtFormatted}</span></>) : null}+ {/* Separator */}+ <span+ className="hidden h-3 w-px bg-zinc-400 min-[453px]:block"+ aria-hidden="true"+ />+ <LocalStorageNotice /></div><div@@ -348,7 +398,7 @@ export function InvoiceClientPage({<InvoiceForminvoiceData={invoiceDataState}handleInvoiceDataChange={handleInvoiceDataChange}- setInvoiceFormHasErrors={setInvoiceFormHasErrors}+ currentInvoiceFormDataRef={currentInvoiceFormDataRef}/></div>@@ -384,7 +434,7 @@ export function InvoiceClientPage({className="hidden h-3 w-px bg-zinc-400 sm:block"aria-hidden="true"/>- <span>+ <span data-testid="desktop-invoice-last-updated"><span className="font-semibold">Invoice last updated:</span>{" "}@@ -394,12 +444,7 @@ export function InvoiceClientPage({) : null}</div></div>- <PdfViewer- invoiceData={invoiceDataState}- errorWhileGeneratingPdfIsShown={errorWhileGeneratingPdfIsShown}- isMobile={false}- qrCodeDataUrl={qrCodeDataUrl}- />+ <PdfViewer isMobile={false} /><divclassName="absolute -bottom-6 right-0 text-right text-xs text-zinc-800"data-testid="desktop-terms-of-service-link"diff --git a/src/app/(app)/components/invoice-form/__tests__/form-errors-to-toast.test.tsx b/src/app/(app)/components/invoice-form/__tests__/form-errors-to-toast.test.tsxindex f07e574..f4481d4 100644--- a/src/app/(app)/components/invoice-form/__tests__/form-errors-to-toast.test.tsx+++ b/src/app/(app)/components/invoice-form/__tests__/form-errors-to-toast.test.tsx@@ -1,19 +1,23 @@// @vitest-environment happy-dom-import type { InvoiceData } from "@/app/schema";-import type { FieldErrors } from "react-hook-form";-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";import { render, screen } from "@testing-library/react";import type { ReactElement } from "react";+import type { FieldErrors } from "react-hook-form";+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";++import type { InvoiceData } from "@/app/schema";import "@testing-library/jest-dom/vitest";-vi.mock("sonner", () => ({- toast: Object.assign(vi.fn(), {- error: vi.fn(),- }),-}));+vi.mock("sonner", () => {+ return {+ toast: Object.assign(vi.fn(), {+ error: vi.fn(),+ }),+ };+});import { toast } from "sonner";+import { formErrorsToToast } from "../utils/form-errors-to-toast";function renderToastContent(content: unknown) {diff --git a/src/app/(app)/components/invoice-form/__tests__/local-storage-unavailable.test.tsx b/src/app/(app)/components/invoice-form/__tests__/local-storage-unavailable.test.tsxnew file mode 100644index 0000000..1eaf3b9--- /dev/null+++ b/src/app/(app)/components/invoice-form/__tests__/local-storage-unavailable.test.tsx@@ -0,0 +1,149 @@+// @vitest-environment happy-dom++import { cleanup, fireEvent, render, screen } from "@testing-library/react";+import {+ afterAll,+ afterEach,+ beforeAll,+ describe,+ expect,+ it,+ vi,+} from "vitest";++import { getInitialInvoiceData } from "@/app/constants";+import { TooltipProvider } from "@/components/ui/tooltip";+import "@testing-library/jest-dom/vitest";++vi.mock("sonner", () => {+ return {+ toast: {+ success: vi.fn(),+ error: vi.fn(),+ warning: vi.fn(),+ dismiss: vi.fn(),+ },+ };+});++vi.mock("@sentry/nextjs", () => {+ return { captureException: vi.fn() };+});++vi.mock("@/lib/umami-analytics-track-event", () => {+ return { umamiTrackEvent: vi.fn() };+});++vi.mock("@/hooks/use-media-query", () => {+ return {+ useIsDesktop: () => {+ return true;+ },+ };+});++import { InvoiceForm } from "../index";++/**+ * iOS in-app webviews (Telegram, Instagram, Facebook) expose `localStorage` as `null`.+ * Reading it unguarded throws+ * `TypeError: null is not an object (evaluating 'localStorage.getItem')`.+ */+function makeLocalStorageNull() {+ Object.defineProperty(window, "localStorage", {+ configurable: true,+ get() {+ return null;+ },+ });+}++const realLocalStorage = Object.getOwnPropertyDescriptor(+ window,+ "localStorage",+);++const NOTES = "Thanks for your business";++describe("InvoiceForm when localStorage is unavailable", () => {+ beforeAll(() => {+ vi.useFakeTimers({ shouldAdvanceTime: true });+ });++ afterEach(() => {+ cleanup();+ if (realLocalStorage) {+ Object.defineProperty(window, "localStorage", realLocalStorage);+ }+ vi.clearAllMocks();+ });++ afterAll(() => {+ vi.useRealTimers();+ });++ it("still renders the form instead of crashing", () => {+ makeLocalStorageNull();++ expect(() => {+ render(+ <TooltipProvider delayDuration={0}>+ <InvoiceForm+ invoiceData={getInitialInvoiceData()}+ handleInvoiceDataChange={vi.fn()}+ />+ </TooltipProvider>,+ );+ }).not.toThrow();++ expect(screen.getByTestId("final-section")).toBeInTheDocument();+ });++ it("still propagates form edits to the parent so the PDF keeps regenerating", async () => {+ makeLocalStorageNull();++ const handleInvoiceDataChange = vi.fn();++ render(+ <TooltipProvider delayDuration={0}>+ <InvoiceForm+ invoiceData={getInitialInvoiceData()}+ handleInvoiceDataChange={handleInvoiceDataChange}+ />+ </TooltipProvider>,+ );++ fireEvent.change(screen.getByTestId("notes"), {+ target: { value: NOTES },+ });++ await vi.advanceTimersByTimeAsync(1000);++ expect(handleInvoiceDataChange).toHaveBeenCalledWith(+ expect.objectContaining({ notes: NOTES }),+ );+ });++ it("propagates form edits to the parent when localStorage works (control)", async () => {+ const handleInvoiceDataChange = vi.fn();++ render(+ <TooltipProvider delayDuration={0}>+ <InvoiceForm+ invoiceData={getInitialInvoiceData()}+ handleInvoiceDataChange={handleInvoiceDataChange}+ />+ </TooltipProvider>,+ );++ fireEvent.change(screen.getByTestId("notes"), {+ target: { value: NOTES },+ });++ await vi.advanceTimersByTimeAsync(1000);++ expect(handleInvoiceDataChange).toHaveBeenCalledWith(+ expect.objectContaining({ notes: NOTES }),+ );+ });+});diff --git a/src/app/(app)/components/invoice-form/__tests__/payment-due-helpers.test.tsx b/src/app/(app)/components/invoice-form/__tests__/payment-due-helpers.test.tsxnew file mode 100644index 0000000..b12634c--- /dev/null+++ b/src/app/(app)/components/invoice-form/__tests__/payment-due-helpers.test.tsx@@ -0,0 +1,180 @@+// @vitest-environment happy-dom++import { cleanup, render, screen } from "@testing-library/react";+import {+ afterAll,+ afterEach,+ beforeAll,+ describe,+ expect,+ it,+ vi,+} from "vitest";++import { getInitialInvoiceData } from "@/app/constants";+import type { InvoiceData, SupportedLanguages } from "@/app/schema";+import { TooltipProvider } from "@/components/ui/tooltip";+import "@testing-library/jest-dom/vitest";++vi.mock("sonner", () => {+ return {+ toast: {+ success: vi.fn(),+ error: vi.fn(),+ warning: vi.fn(),+ },+ };+});++vi.mock("@sentry/nextjs", () => {+ return {+ captureException: vi.fn(),+ };+});++vi.mock("@/lib/umami-analytics-track-event", () => {+ return {+ umamiTrackEvent: vi.fn(),+ };+});++vi.mock("@/hooks/use-media-query", () => {+ return {+ useIsDesktop: () => {+ return true;+ },+ };+});++import { InvoiceForm } from "../index";++/** Frozen "now" for the whole suite: 15 September 2026. */+const NOW = new Date("2026-09-15T10:00:00.000Z");++const DATE_OF_ISSUE = "2026-09-15";++interface RenderOptions {+ language?: SupportedLanguages;+ dateFormat?: InvoiceData["dateFormat"];+ paymentDue: string;+}++function renderInvoiceForm({+ language = "en",+ dateFormat = "MMMM D, YYYY",+ paymentDue,+}: RenderOptions) {+ const invoiceData: InvoiceData = {+ ...getInitialInvoiceData(),+ language,+ dateFormat,+ dateOfIssue: DATE_OF_ISSUE,+ paymentDue,+ };++ return render(+ <TooltipProvider delayDuration={0}>+ <InvoiceForm+ invoiceData={invoiceData}+ handleInvoiceDataChange={vi.fn()}+ />+ </TooltipProvider>,+ );+}++function getSetPaymentDueButton() {+ return screen.getByRole("button", { name: /set payment due date to/i });+}++describe("payment due helper texts", () => {+ beforeAll(() => {+ vi.useFakeTimers({ shouldAdvanceTime: true });+ vi.setSystemTime(NOW);+ });++ afterEach(() => {+ cleanup();+ localStorage.clear();+ vi.clearAllMocks();+ });++ afterAll(() => {+ vi.useRealTimers();+ });++ it("is hidden when the payment due date is already 14 days after the issue date", () => {+ renderInvoiceForm({ paymentDue: "2026-09-29" });++ expect(+ screen.queryByRole("button", { name: /set payment due date to/i }),+ ).not.toBeInTheDocument();+ });++ describe('"Set payment due date to <date>"', () => {+ it("renders the suggested date in English by default", () => {+ renderInvoiceForm({ language: "en", paymentDue: "2026-09-20" });++ expect(getSetPaymentDueButton()).toHaveTextContent(+ "Set payment due date to September 29, 2026 (14 days from issue date)",+ );+ });++ it.each([+ ["pl", "wrzesień 29, 2026"],+ ["de", "September 29, 2026"],+ ["es", "septiembre 29, 2026"],+ ["pt", "setembro 29, 2026"],+ ["ru", "сентябрь 29, 2026"],+ ["uk", "вересень 29, 2026"],+ ["fr", "septembre 29, 2026"],+ ["it", "settembre 29, 2026"],+ ["nl", "september 29, 2026"],+ ] as const)(+ "renders the suggested date in the invoice PDF language (%s)",+ (language, expectedDate) => {+ renderInvoiceForm({ language, paymentDue: "2026-09-20" });++ expect(getSetPaymentDueButton()).toHaveTextContent(+ `Set payment due date to ${expectedDate} (14 days from issue date)`,+ );+ },+ );++ it("honours the selected date format on top of the language", () => {+ renderInvoiceForm({+ language: "pl",+ dateFormat: "D MMM YYYY",+ paymentDue: "2026-09-20",+ });++ expect(getSetPaymentDueButton()).toHaveTextContent(+ "Set payment due date to 29 wrz 2026 (14 days from issue date)",+ );+ });+ });++ describe('"Payment due date is before date of issue"', () => {+ it("renders the date of issue in the invoice PDF language", () => {+ renderInvoiceForm({ language: "fr", paymentDue: "2026-09-01" });++ expect(+ screen.getByText(+ /Payment due date is before date of issue \(septembre 15, 2026\)/,+ ),+ ).toBeVisible();+ expect(getSetPaymentDueButton()).toHaveTextContent(+ "Set payment due date to septembre 29, 2026 (14 days from issue date)",+ );+ });++ it("renders the date of issue in English by default", () => {+ renderInvoiceForm({ language: "en", paymentDue: "2026-09-01" });++ expect(+ screen.getByText(+ /Payment due date is before date of issue \(September 15, 2026\)/,+ ),+ ).toBeVisible();+ });+ });+});diff --git a/src/app/(app)/components/invoice-form/index.tsx b/src/app/(app)/components/invoice-form/index.tsxindex 7adf389..500f254 100644--- a/src/app/(app)/components/invoice-form/index.tsx+++ b/src/app/(app)/components/invoice-form/index.tsx@@ -1,5 +1,18 @@"use client";+import * as Sentry from "@sentry/nextjs";+import dayjs from "dayjs";+import { memo, useCallback, useEffect, useState, type RefObject } from "react";+import { Controller, useFieldArray, useForm, useWatch } from "react-hook-form";+import { toast } from "sonner";+import { useDebouncedCallback } from "use-debounce";++import {+ getAppStorageItem,+ setAppStorageItem,+} from "@/app/(app)/utils/app-local-storage";+import { formatDateWithLocale } from "@/app/(app)/utils/format-date-with-locale";+import { updateAppMetadata } from "@/app/(app)/utils/get-app-metadata";import {ACCORDION_STATE_LOCAL_STORAGE_KEY,accordionSchema,@@ -25,37 +38,30 @@ import { Switch } from "@/components/ui/switch";import { Textarea } from "@/components/ui/textarea";import { CustomTooltip } from "@/components/ui/tooltip";import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";+import { zodResolverForOutput } from "@/lib/zod-resolver-for-output";import type { NonReadonly, Prettify } from "@/types";-import { calculateInvoiceTotal } from "./utils/calculate-invoice-total";-import { calculateItemTotals } from "./utils/calculate-item-totals";-import { formErrorsToToast } from "./utils/form-errors-to-toast";-import { hasAnyItemTotalsChanged } from "./utils/has-item-totals-changed";-import { parseValidatedInvoiceItems } from "./utils/validated-invoice-items";--import { zodResolver } from "@hookform/resolvers/zod";-import * as Sentry from "@sentry/nextjs";-import dayjs from "dayjs";-import {- memo,- useCallback,- useEffect,- useState,- type Dispatch,- type SetStateAction,-} from "react";-import { Controller, useFieldArray, useForm, useWatch } from "react-hook-form";-import { toast } from "sonner";-import { useDebouncedCallback } from "use-debounce";-import { updateAppMetadata } from "@/app/(app)/utils/get-app-metadata";import { AlertIcon, ErrorMessage } from "./common";import { BuyerInformation } from "./sections/buyer-information";import { GeneralInformation } from "./sections/general-information";import { InvoiceItems } from "./sections/invoice-items";import { SellerInformation } from "./sections/seller-information";+import { calculateInvoiceTotal } from "./utils/calculate-invoice-total";+import { calculateItemTotals } from "./utils/calculate-item-totals";+import { formErrorsToToast } from "./utils/form-errors-to-toast";+import { hasAnyItemTotalsChanged } from "./utils/has-item-totals-changed";+import { parseValidatedInvoiceItems } from "./utils/validated-invoice-items";+/**+ * Time in milliseconds to debounce updates in the invoice form,+ * e.g. for delayed applying of changes before persisting/syncing.+ */const DEBOUNCE_TIMEOUT = 500;+/**+ * Default values for the invoice form's accordion sections.+ * These correspond to the different sections of the form that can be expanded or collapsed.+ */const DEFAULT_ACCORDION_VALUES = ["general","seller",@@ -74,17 +80,28 @@ interface InvoiceFormProps {invoiceData: InvoiceData;handleInvoiceDataChange: (updatedData: InvoiceData) => void;isMobile?: boolean;- setInvoiceFormHasErrors: Dispatch<SetStateAction<boolean>>;+ /**+ * Filled in with a getter returning the form's current values, or `null` when the form+ * has validation errors. The parent only needs this when the user clicks "Get link", so+ * it asks at that moment rather than mirroring form state into its own render.+ */+ currentInvoiceFormDataRef?: RefObject<(() => InvoiceData | null) | null>;+ /**+ * Filled in with a function that commits a pending (debounced) edit immediately, so the+ * parent can flush the form before the user's attention moves elsewhere.+ */+ flushPendingChangesRef?: RefObject<(() => void) | null>;}export const InvoiceForm = memo(function InvoiceForm({invoiceData,handleInvoiceDataChange,isMobile = false,- setInvoiceFormHasErrors,+ currentInvoiceFormDataRef,+ flushPendingChangesRef,}: InvoiceFormProps) {const form = useForm<InvoiceData>({- resolver: zodResolver(invoiceSchema),+ resolver: zodResolverForOutput(invoiceSchema),defaultValues: invoiceData,mode: "onChange",});@@ -115,6 +132,19 @@ export const InvoiceForm = memo(function InvoiceForm({dayjs(paymentDue).isAfter(dayjs(dateOfIssue).add(14, "days")) ||dayjs(paymentDue).isSame(dayjs(dateOfIssue).add(14, "days"));+ // Helper texts quote dates back to the user, so they are formatted the way the+ // PDF will render them: the invoice's date format AND its language.+ const formattedDateOfIssue = formatDateWithLocale({+ date: dateOfIssue,+ selectedDateFormat,+ language,+ });+ const formattedSuggestedPaymentDue = formatDateWithLocale({+ date: dayjs(dateOfIssue).add(14, "days"),+ selectedDateFormat,+ language,+ });+const { fields, append } = useFieldArray({control,name: "items",@@ -131,16 +161,16 @@ export const InvoiceForm = memo(function InvoiceForm({const validatedItemsResult = parseValidatedInvoiceItems(invoiceItems);if (!validatedItemsResult.success) {+ // Not reported to Sentry on purpose: this branch is the expected state while+ // someone is still typing (a cleared amount field, a half-entered VAT), so it+ // fires constantly and says nothing about a broken app.console.error("Invalid items:", validatedItemsResult.error);- Sentry.captureException(validatedItemsResult.error);-return;}const total = calculateInvoiceTotal(invoiceItems);- // eslint-disable-next-line no-consoleconsole.info("[useEffect] recalculating totals because invoice items changed",{@@ -161,7 +191,9 @@ export const InvoiceForm = memo(function InvoiceForm({// Only update if there are actual changesconst updatedItems = invoiceItems- .map(calculateItemTotals)+ .map((item) => {+ return calculateItemTotals(item);+ }).filter(Boolean) as InvoiceItemData[];// Batch updates@@ -174,7 +206,9 @@ export const InvoiceForm = memo(function InvoiceForm({// top level of componentconst debouncedShowFormErrorsToast = useDebouncedCallback(- () => formErrorsToToast({ errors, isMobile }),+ () => {+ return formErrorsToToast({ errors, isMobile });+ },isMobile ? 3000 : 1000,);@@ -187,8 +221,6 @@ export const InvoiceForm = memo(function InvoiceForm({toast.dismiss("invalid-invoice-url-error-toast");toast.dismiss("unable-to-share-invoice-form-errors-toast");- setInvoiceFormHasErrors(false);-// TODO: double check if we need this code, because we already save to local storage in the page.client.tsx (parent component) (line: 267) useEffect "Save to localStorage whenever data changes on form update"try {// trigger form validations@@ -199,8 +231,6 @@ export const InvoiceForm = memo(function InvoiceForm({// Debounce error toast to avoid showing too fastdebouncedShowFormErrorsToast();- setInvoiceFormHasErrors(true);-return;}@@ -208,12 +238,19 @@ export const InvoiceForm = memo(function InvoiceForm({const stringifiedData = JSON.stringify(validatedData);- localStorage.setItem(PDF_DATA_LOCAL_STORAGE_KEY, stringifiedData);+ // Persisting is best-effort and must never gate `onSubmit`: when storage is+ // unavailable (an iOS in-app webview exposes `localStorage` as `null`) an+ // unguarded write threw here, so the edit never reached the parent and the PDF+ // preview stayed frozen on the previous version for the whole session.+ setAppStorageItem({+ key: PDF_DATA_LOCAL_STORAGE_KEY,+ value: stringifiedData,+ });// pass the updated data to the parent component, to update the invoice data state (use state hook)onSubmit(validatedData);} catch (error) {- console.error("Error saving to local storage:", error);+ console.error("Error regenerating invoice from form change:", error);Sentry.captureException(error);}@@ -222,17 +259,74 @@ export const InvoiceForm = memo(function InvoiceForm({DEBOUNCE_TIMEOUT,);+ // Let the parent read the form at click time: both whether it is valid, and what is+ // currently in it.+ //+ // Both used to lag by DEBOUNCE_TIMEOUT. The validity flag was pushed up from inside+ // debouncedRegeneratePdfOnFormChange, and the data the parent shares is only committed+ // on that same debounce. `mode: "onChange"` renders the inline error immediately, so+ // for those 500ms the user could see "Net price is required" and still have "Get link"+ // produce a link for an invalid invoice, and a click just after any edit shared the+ // pre-edit snapshot. Reading on demand cannot go stale, and the answer is only ever+ // needed in an event handler — never during render.+ //+ // `formState.errors` covers both validation paths: onChange populates it per field, and+ // the debounced trigger(undefined) fills in fields the user never touched.+ useEffect(() => {+ if (!currentInvoiceFormDataRef) {+ return;+ }++ // This function allows the parent component to access the current state of the invoice form data.+ // It checks if there are any validation errors in the form (via formState.errors).+ // If errors exist, it returns null, indicating the form data is not currently valid.+ // Otherwise, it returns the current form values.+ currentInvoiceFormDataRef.current = () => {+ if (Object.keys(form.formState.errors).length > 0) {+ // There are validation errors; signal invalid data to the parent.+ return null;+ }+ // No validation errors; provide the current form values to the parent.+ return form.getValues();+ };++ return () => {+ currentInvoiceFormDataRef.current = null;+ };+ }, [form, currentInvoiceFormDataRef]);+// IMPORTANT// TODO: rewrite to subscribe()? https://react-hook-form.com/docs/useform/subscribe// subscribe to form changes to regenerate pdf on every input changeuseEffect(() => {+ // oxlint-disable-next-line react/incompatible-libraryconst subscription = watch((value) => {void debouncedRegeneratePdfOnFormChange(value as unknown as InvoiceData);});- return () => subscription.unsubscribe();+ return () => {+ return subscription.unsubscribe();+ };}, [debouncedRegeneratePdfOnFormChange, watch]);+ // Hands the parent a way to commit a pending edit right away instead of waiting out the+ // debounce. The mobile tabs use it when the user leaves the form for the PDF preview, so+ // the preview shows what was just typed instead of the previous version for half a second.+ useEffect(() => {+ if (!flushPendingChangesRef) {+ return;+ }++ flushPendingChangesRef.current = () => {+ // a no-op when nothing is pending+ void debouncedRegeneratePdfOnFormChange.flush();+ };++ return () => {+ flushPendingChangesRef.current = null;+ };+ }, [debouncedRegeneratePdfOnFormChange, flushPendingChangesRef]);+const template = useWatch({ control, name: "template" });const taxLabelText = useWatch({ control, name: "taxLabelText" }) || "VAT";@@ -245,7 +339,9 @@ export const InvoiceForm = memo(function InvoiceForm({(index: number) => {setValue("items",- invoiceItems.filter((_, i) => i !== index),+ invoiceItems.filter((_, i) => {+ return i !== index;+ }),{shouldValidate: true,shouldTouch: true,@@ -290,9 +386,7 @@ export const InvoiceForm = memo(function InvoiceForm({>(() => {// Try to load from localStoragetry {- const savedState = localStorage.getItem(- ACCORDION_STATE_LOCAL_STORAGE_KEY,- );+ const savedState = getAppStorageItem(ACCORDION_STATE_LOCAL_STORAGE_KEY);if (savedState) {const parsedState = JSON.parse(savedState) as AccordionState;@@ -301,8 +395,12 @@ export const InvoiceForm = memo(function InvoiceForm({if (validatedState.success) {const arrayOfOpenSections = Object.entries(validatedState.data)- .filter(([_, isOpen]) => isOpen)- .map(([section]) => section) as Prettify<AccordionKeys>;+ .filter(([_, isOpen]) => {+ return isOpen;+ })+ .map(([section]) => {+ return section;+ }) as Prettify<AccordionKeys>;return arrayOfOpenSections;}@@ -332,10 +430,10 @@ export const InvoiceForm = memo(function InvoiceForm({invoiceItems: value.includes(ACCORDION_ITEMS),});- localStorage.setItem(- ACCORDION_STATE_LOCAL_STORAGE_KEY,- JSON.stringify(stateToSave),- );+ setAppStorageItem({+ key: ACCORDION_STATE_LOCAL_STORAGE_KEY,+ value: JSON.stringify(stateToSave),+ });} catch (error) {console.error("Error saving accordion state:", error);@@ -453,17 +551,19 @@ export const InvoiceForm = memo(function InvoiceForm({<Controllername="total"control={control}- render={({ field }) => (- <ReadOnlyMoneyInput- {...field}- id={`total`}- currency={currency}- value={field.value.toLocaleString("en-US", {- minimumFractionDigits: 2,- maximumFractionDigits: 2,- })}- />- )}+ render={({ field }) => {+ return (+ <ReadOnlyMoneyInput+ {...field}+ id={`total`}+ currency={currency}+ value={field.value.toLocaleString("en-US", {+ minimumFractionDigits: 2,+ maximumFractionDigits: 2,+ })}+ />+ );+ }}/></div>{errors.total ? (@@ -477,7 +577,7 @@ export const InvoiceForm = memo(function InvoiceForm({</div>{/* Payment Method (Only show for default template) */}- {template === "default" && (+ {template === "default" ? (<div><div className="relative mb-2 mt-6 flex items-center justify-between"><Label htmlFor={`paymentMethod`} className="">@@ -489,16 +589,18 @@ export const InvoiceForm = memo(function InvoiceForm({<Controllername={`paymentMethodFieldIsVisible`}control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id={`paymentMethodFieldIsVisible`}- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- data-testid="paymentMethodFieldIsVisible"- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id={`paymentMethodFieldIsVisible`}+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ data-testid="paymentMethodFieldIsVisible"+ />+ );+ }}/><CustomTooltiptrigger={@@ -514,20 +616,22 @@ export const InvoiceForm = memo(function InvoiceForm({<Controllername="paymentMethod"control={control}- render={({ field }) => (- <Input- {...field}- id={`paymentMethod`}- type="text"- className="mt-1"- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ id={`paymentMethod`}+ type="text"+ className="mt-1"+ />+ );+ }}/>{errors.paymentMethod ? (<ErrorMessage>{errors.paymentMethod.message}</ErrorMessage>) : null}</div>- )}+ ) : null}{/* Payment Due */}<div>@@ -538,9 +642,16 @@ export const InvoiceForm = memo(function InvoiceForm({<Controllername="paymentDue"control={control}- render={({ field }) => (- <Input {...field} id={`paymentDue`} type="date" className="" />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ id={`paymentDue`}+ type="date"+ className=""+ />+ );+ }}/>{errors.paymentDue ? (<ErrorMessage>{errors.paymentDue.message}</ErrorMessage>@@ -552,7 +663,7 @@ export const InvoiceForm = memo(function InvoiceForm({<span className="flex items-center text-balance text-amber-800"><AlertIcon />Payment due date is before date of issue (- {dayjs(dateOfIssue).format(selectedDateFormat)})+ {formattedDateOfIssue})</span><ButtonHelperonClick={() => {@@ -564,11 +675,8 @@ export const InvoiceForm = memo(function InvoiceForm({}}><span className="text-pretty">- Set payment due date to{" "}- {dayjs(dateOfIssue)- .add(14, "days")- .format(selectedDateFormat)}{" "}- (14 days from issue date)+ Set payment due date to {formattedSuggestedPaymentDue} (14+ days from issue date)</span></ButtonHelper></InputHelperMessage>@@ -590,11 +698,8 @@ export const InvoiceForm = memo(function InvoiceForm({}}><span className="text-pretty">- Set payment due date to{" "}- {dayjs(dateOfIssue)- .add(14, "days")- .format(selectedDateFormat)}{" "}- (14 days from issue date)+ Set payment due date to {formattedSuggestedPaymentDue} (14+ days from issue date)</span></ButtonHelper></InputHelperMessage>@@ -614,15 +719,17 @@ export const InvoiceForm = memo(function InvoiceForm({<Controllername={`notesFieldIsVisible`}control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id={`notesFieldIsVisible`}- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id={`notesFieldIsVisible`}+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ />+ );+ }}/><CustomTooltiptrigger={@@ -635,15 +742,17 @@ export const InvoiceForm = memo(function InvoiceForm({<Controllername="notes"control={control}- render={({ field }) => (- <Textarea- {...field}- id={`notes`}- rows={3}- className=""- data-testid="notes"- />- )}+ render={({ field }) => {+ return (+ <Textarea+ {...field}+ id={`notes`}+ rows={3}+ className=""+ data-testid="notes"+ />+ );+ }}/>{errors?.notes ? (<ErrorMessage>{errors?.notes?.message}</ErrorMessage>@@ -662,16 +771,18 @@ export const InvoiceForm = memo(function InvoiceForm({<Controllername={`qrCodeIsVisible`}control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id={`qrCodeIsVisible`}- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- aria-label="Show QR Code in PDF"- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id={`qrCodeIsVisible`}+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ aria-label="Show QR Code in PDF"+ />+ );+ }}/><CustomTooltiptrigger={<Label htmlFor={`qrCodeIsVisible`}>Show in PDF</Label>}@@ -689,15 +800,17 @@ export const InvoiceForm = memo(function InvoiceForm({<Controllername="qrCodeData"control={control}- render={({ field }) => (- <Input- {...field}- id={`qrCodeData`}- type="text"- placeholder="Enter URL or text to encode"- data-testid="qrCodeData"- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ id={`qrCodeData`}+ type="text"+ placeholder="Enter URL or text to encode"+ data-testid="qrCodeData"+ />+ );+ }}/><InputHelperMessage>Enter any text or URL to generate a QR code. The QR code will@@ -716,15 +829,17 @@ export const InvoiceForm = memo(function InvoiceForm({<Controllername="qrCodeDescription"control={control}- render={({ field }) => (- <Input- {...field}- id={`qrCodeDescription`}- type="text"- placeholder="Enter a description for the QR code"- data-testid="qrCodeDescription"- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ id={`qrCodeDescription`}+ type="text"+ placeholder="Enter a description for the QR code"+ data-testid="qrCodeDescription"+ />+ );+ }}/><InputHelperMessage>Optional text that will be displayed below the QR code in the@@ -740,7 +855,7 @@ export const InvoiceForm = memo(function InvoiceForm({{/*Stripe template doesn't have these fields*/}- {invoiceData.template === "default" && (+ {invoiceData.template === "default" ? (<><fieldset className="rounded-md border px-4 pb-4"><legend className="text-base font-semibold lg:text-lg">@@ -752,16 +867,18 @@ export const InvoiceForm = memo(function InvoiceForm({<Controllername="personAuthorizedToReceiveFieldIsVisible"control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id="personAuthorizedToReceiveFieldIsVisible"- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- aria-label="Show Person Authorized to Receive in PDF"- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id="personAuthorizedToReceiveFieldIsVisible"+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ aria-label="Show Person Authorized to Receive in PDF"+ />+ );+ }}/><CustomTooltiptrigger={@@ -784,15 +901,17 @@ export const InvoiceForm = memo(function InvoiceForm({<Controllername="personAuthorizedToReceiveName"control={control}- render={({ field }) => (- <Input- {...field}- id="personAuthorizedToReceiveName"- type="text"- placeholder="Enter name of person authorized to receive"- data-testid="personAuthorizedToReceiveName"- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ id="personAuthorizedToReceiveName"+ type="text"+ placeholder="Enter name of person authorized to receive"+ data-testid="personAuthorizedToReceiveName"+ />+ );+ }}/><InputHelperMessage>Name displayed above the signature line in the PDF.@@ -815,16 +934,18 @@ export const InvoiceForm = memo(function InvoiceForm({<Controllername="personAuthorizedToIssueFieldIsVisible"control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id="personAuthorizedToIssueFieldIsVisible"- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- aria-label="Show Person Authorized to Issue in PDF"- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id="personAuthorizedToIssueFieldIsVisible"+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ aria-label="Show Person Authorized to Issue in PDF"+ />+ );+ }}/><CustomTooltiptrigger={@@ -847,15 +968,17 @@ export const InvoiceForm = memo(function InvoiceForm({<Controllername="personAuthorizedToIssueName"control={control}- render={({ field }) => (- <Input- {...field}- id="personAuthorizedToIssueName"- type="text"- placeholder="Enter name of person authorized to issue"- data-testid="personAuthorizedToIssueName"- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ id="personAuthorizedToIssueName"+ type="text"+ placeholder="Enter name of person authorized to issue"+ data-testid="personAuthorizedToIssueName"+ />+ );+ }}/><InputHelperMessage>Name displayed above the signature line in the PDF.@@ -868,7 +991,7 @@ export const InvoiceForm = memo(function InvoiceForm({</div></fieldset></>- )}+ ) : null}</div></form>);diff --git a/src/app/(app)/components/invoice-form/sections/__tests__/general-information.test.tsx b/src/app/(app)/components/invoice-form/sections/__tests__/general-information.test.tsxnew file mode 100644index 0000000..15936e6--- /dev/null+++ b/src/app/(app)/components/invoice-form/sections/__tests__/general-information.test.tsx@@ -0,0 +1,224 @@+// @vitest-environment happy-dom++import { cleanup, render, screen } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import { useForm, useWatch } from "react-hook-form";+import {+ afterAll,+ afterEach,+ beforeAll,+ describe,+ expect,+ it,+ vi,+} from "vitest";++import { getInitialInvoiceData } from "@/app/constants";+import type { InvoiceData, SupportedLanguages } from "@/app/schema";+import { TooltipProvider } from "@/components/ui/tooltip";+import "@testing-library/jest-dom/vitest";++vi.mock("sonner", () => {+ return {+ toast: {+ success: vi.fn(),+ error: vi.fn(),+ },+ };+});++vi.mock("@/hooks/use-media-query", () => {+ return {+ useIsDesktop: () => {+ return true;+ },+ };+});++import { GeneralInformation } from "../general-information";++/** Frozen "now" for the whole suite: 15 September 2026. */+const NOW = new Date("2026-09-15T10:00:00.000Z");++/** A date of issue in the past, so the "not today" helper is rendered. */+const STALE_DATE_OF_ISSUE = "2026-06-10";++interface HarnessProps {+ language?: SupportedLanguages;+ dateFormat?: InvoiceData["dateFormat"];+ dateOfIssue?: string;+}++function GeneralInformationHarness({+ language = "en",+ dateFormat = "MMMM D, YYYY",+ dateOfIssue = STALE_DATE_OF_ISSUE,+}: HarnessProps) {+ const { control, setValue } = useForm<InvoiceData>({+ defaultValues: {+ ...getInitialInvoiceData(),+ language,+ dateFormat,+ dateOfIssue,+ },+ });++ // The real parent feeds the live form value back in, so the helper texts react+ // to `setValue` the same way they do in the app.+ const currentDateOfIssue = useWatch({ control, name: "dateOfIssue" });+ const currentPaymentDue = useWatch({ control, name: "paymentDue" });++ return (+ <TooltipProvider delayDuration={0}>+ <GeneralInformation+ control={control}+ errors={{}}+ setValue={setValue}+ dateOfIssue={currentDateOfIssue}+ isMobile={false}+ />+ <output data-testid="payment-due-readout">{currentPaymentDue}</output>+ </TooltipProvider>+ );+}++function renderGeneralInformation(props: HarnessProps = {}) {+ return render(<GeneralInformationHarness {...props} />);+}++function getSetDateOfIssueToTodayButton() {+ return screen.getByRole("button", { name: /set date of issue to today/i });+}++describe("GeneralInformation date helper texts", () => {+ beforeAll(() => {+ vi.useFakeTimers({ shouldAdvanceTime: true });+ vi.setSystemTime(NOW);+ });++ afterEach(() => {+ cleanup();+ vi.clearAllMocks();+ });++ afterAll(() => {+ vi.useRealTimers();+ });++ describe('"Set date of issue to today"', () => {+ it("is hidden when the date of issue is already today", () => {+ renderGeneralInformation({ dateOfIssue: "2026-09-15" });++ expect(+ screen.queryByRole("button", { name: /set date of issue to today/i }),+ ).not.toBeInTheDocument();+ });++ it("renders today in English by default", () => {+ renderGeneralInformation({ language: "en" });++ expect(getSetDateOfIssueToTodayButton()).toHaveTextContent(+ "Set date of issue to today (September 15, 2026)",+ );+ });++ it.each([+ ["pl", "wrzesień 15, 2026"],+ ["de", "September 15, 2026"],+ ["es", "septiembre 15, 2026"],+ ["pt", "setembro 15, 2026"],+ ["ru", "сентябрь 15, 2026"],+ ["uk", "вересень 15, 2026"],+ ["fr", "septembre 15, 2026"],+ ["it", "settembre 15, 2026"],+ ["nl", "september 15, 2026"],+ ] as const)(+ "renders today in the invoice PDF language (%s)",+ (language, expectedDate) => {+ renderGeneralInformation({ language });++ expect(getSetDateOfIssueToTodayButton()).toHaveTextContent(+ `Set date of issue to today (${expectedDate})`,+ );+ },+ );++ it("honours the selected date format on top of the language", () => {+ renderGeneralInformation({ language: "pl", dateFormat: "D MMM YYYY" });++ expect(getSetDateOfIssueToTodayButton()).toHaveTextContent(+ "Set date of issue to today (15 wrz 2026)",+ );+ });++ it("leaves a numeric date format identical across languages", () => {+ renderGeneralInformation({ language: "ru", dateFormat: "YYYY-MM-DD" });++ expect(getSetDateOfIssueToTodayButton()).toHaveTextContent(+ "Set date of issue to today (2026-09-15)",+ );+ });++ it("sets the date of issue and the payment due date when clicked", async () => {+ const user = userEvent.setup({ advanceTimers: vi.advanceTimersByTime });++ renderGeneralInformation();++ await user.click(getSetDateOfIssueToTodayButton());++ expect(screen.getByLabelText("Date of Issue")).toHaveValue("2026-09-15");+ expect(screen.getByTestId("payment-due-readout")).toHaveTextContent(+ "2026-09-29",+ );+ expect(+ screen.queryByRole("button", { name: /set date of issue to today/i }),+ ).not.toBeInTheDocument();+ });+ });++ describe("date format preview", () => {+ it("previews each format in English by default", () => {+ renderGeneralInformation({ language: "en" });++ expect(+ screen.getByRole("option", {+ name: "MMMM D, YYYY (September 15, 2026)",+ }),+ ).toBeInTheDocument();+ });++ it("previews each format in the invoice PDF language", () => {+ renderGeneralInformation({ language: "fr" });++ expect(+ screen.getByRole("option", {+ name: "MMMM D, YYYY (septembre 15, 2026)",+ }),+ ).toBeInTheDocument();+ expect(+ screen.getByRole("option", { name: "D MMM YYYY (15 sept. 2026)" }),+ ).toBeInTheDocument();+ });++ it("previews a numeric format identically in every language", () => {+ renderGeneralInformation({ language: "uk" });++ expect(+ screen.getByRole("option", {+ name: "YYYY-MM-DD (2026-09-15) (default)",+ }),+ ).toBeInTheDocument();+ });+ });++ describe("stale dates banner", () => {+ it("renders the banner with dates in the invoice PDF language", () => {+ renderGeneralInformation({ language: "it" });++ const banner = screen.getByTestId("out-of-date-dates-helper");++ expect(banner).toBeVisible();+ expect(banner).toHaveTextContent("settembre 15, 2026");+ });+ });+});diff --git a/src/app/(app)/components/invoice-form/sections/__tests__/invoice-items.test.tsx b/src/app/(app)/components/invoice-form/sections/__tests__/invoice-items.test.tsxindex 9972b26..e86690d 100644--- a/src/app/(app)/components/invoice-form/sections/__tests__/invoice-items.test.tsx+++ b/src/app/(app)/components/invoice-form/sections/__tests__/invoice-items.test.tsx@@ -1,9 +1,5 @@// @vitest-environment happy-dom-import { getInitialInvoiceData } from "@/app/constants";-import type { InvoiceData } from "@/app/schema";-import { TooltipProvider } from "@/components/ui/tooltip";-import { MOCK_INVOICE_ITEM_DATA } from "@/utils/__tests__/data";import { cleanup, render, screen, within } from "@testing-library/react";import userEvent from "@testing-library/user-event";import { useMemo } from "react";@@ -14,14 +10,22 @@ import {useForm,} from "react-hook-form";import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";++import { getInitialInvoiceData } from "@/app/constants";+import type * as InvoiceSchema from "@/app/schema";+import type { InvoiceData } from "@/app/schema";+import { TooltipProvider } from "@/components/ui/tooltip";+import { MOCK_INVOICE_ITEM_DATA } from "@/utils/__tests__/data";import "@testing-library/jest-dom/vitest";-const { MOCK_MAX_INVOICE_ITEMS } = vi.hoisted(() => ({- MOCK_MAX_INVOICE_ITEMS: 3,-}));+const { MOCK_MAX_INVOICE_ITEMS } = vi.hoisted(() => {+ return {+ MOCK_MAX_INVOICE_ITEMS: 3,+ };+});vi.mock("@/app/schema", async (importOriginal) => {- const actual = await importOriginal<typeof import("@/app/schema")>();+ const actual = await importOriginal<typeof InvoiceSchema>();return {...actual,@@ -29,15 +33,22 @@ vi.mock("@/app/schema", async (importOriginal) => {};});-vi.mock("@/lib/umami-analytics-track-event", () => ({- umamiTrackEvent: vi.fn(),-}));+vi.mock("@/lib/umami-analytics-track-event", () => {+ return {+ umamiTrackEvent: vi.fn(),+ };+});-vi.mock("@/hooks/use-media-query", () => ({- useIsDesktop: () => true,-}));+vi.mock("@/hooks/use-media-query", () => {+ return {+ useIsDesktop: () => {+ return true;+ },+ };+});import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";+import { InvoiceItems } from "../invoice-items";interface InvoiceItemsTestHarnessProps {@@ -51,23 +62,26 @@ function InvoiceItemsTestHarness({append = vi.fn(),onRemove = vi.fn(),}: InvoiceItemsTestHarnessProps) {- const invoiceData = useMemo(- () => ({+ const invoiceData = useMemo(() => {+ return {...getInitialInvoiceData(),- items: Array.from({ length: itemCount }, () => ({- ...MOCK_INVOICE_ITEM_DATA,- })),- }),- [itemCount],- );+ items: Array.from({ length: itemCount }, () => {+ return {+ ...MOCK_INVOICE_ITEM_DATA,+ };+ }),+ };+ }, [itemCount]);const { control } = useForm<InvoiceData>({defaultValues: invoiceData,});- const fields = Array.from({ length: itemCount }, (_, index) => ({- id: `item-${index}`,- })) as FieldArrayWithId<InvoiceData, "items", "id">[];+ const fields = Array.from({ length: itemCount }, (_, index) => {+ return {+ id: `item-${index}`,+ };+ }) as FieldArrayWithId<InvoiceData, "items">[];return (<TooltipProvider delayDuration={0}>diff --git a/src/app/(app)/components/invoice-form/sections/buyer-information.tsx b/src/app/(app)/components/invoice-form/sections/buyer-information.tsxindex 2ccde88..ec72600 100644--- a/src/app/(app)/components/invoice-form/sections/buyer-information.tsx+++ b/src/app/(app)/components/invoice-form/sections/buyer-information.tsx@@ -1,9 +1,17 @@"use client";+import { Info } from "lucide-react";+import { memo, useState } from "react";+import {+ type Control,+ Controller,+ type FieldErrors,+ type UseFormSetValue,+} from "react-hook-form";+import { inputErrorClassName } from "@/app/(app)/components/invoice-form/common";-import { type BuyerData, type InvoiceData } from "@/app/schema";-import { cn } from "@/lib/utils";import { BuyerManagement } from "@/app/(app)/components/invoice-form/sections/components/buyer/buyer-management";+import { type BuyerData, type InvoiceData } from "@/app/schema";import { AccordionContent } from "@/components/ui/accordion";import { Input } from "@/components/ui/input";import { InputHelperMessage } from "@/components/ui/input-helper-message";@@ -11,14 +19,7 @@ import { Label } from "@/components/ui/label";import { Switch } from "@/components/ui/switch";import { Textarea } from "@/components/ui/textarea";import { CustomTooltip } from "@/components/ui/tooltip";-import { Info } from "lucide-react";-import { memo, useState } from "react";-import {- type Control,- Controller,- type FieldErrors,- type UseFormSetValue,-} from "react-hook-form";+import { cn } from "@/lib/utils";const ErrorMessage = ({ children }: { children: React.ReactNode }) => {return <p className="mt-1 text-xs text-red-600">{children}</p>;@@ -89,14 +90,16 @@ export const BuyerInformation = memo(function BuyerInformation({<Controllername="buyer.name"control={control}- render={({ field }) => (- <Textarea- {...field}- id="buyerName"- rows={3}- className={inputErrorClassName(!!errors.buyer?.name)}- />- )}+ render={({ field }) => {+ return (+ <Textarea+ {...field}+ id="buyerName"+ rows={3}+ className={inputErrorClassName(!!errors.buyer?.name)}+ />+ );+ }}/>{errors.buyer?.name ? (<ErrorMessage>{errors.buyer.name.message}</ErrorMessage>@@ -110,14 +113,16 @@ export const BuyerInformation = memo(function BuyerInformation({<Controllername="buyer.address"control={control}- render={({ field }) => (- <Textarea- {...field}- id="buyerAddress"- rows={3}- className={inputErrorClassName(!!errors.buyer?.address)}- />- )}+ render={({ field }) => {+ return (+ <Textarea+ {...field}+ id="buyerAddress"+ rows={3}+ className={inputErrorClassName(!!errors.buyer?.address)}+ />+ );+ }}/>{errors.buyer?.address ? (<ErrorMessage>{errors.buyer.address.message}</ErrorMessage>@@ -135,17 +140,19 @@ export const BuyerInformation = memo(function BuyerInformation({<Controllername="buyer.vatNoFieldIsVisible"control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id="buyerVatNoFieldIsVisible"- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- data-testid="buyerVatNoFieldIsVisible"- aria-label="Show the 'Buyer Tax Number' Field in the PDF"- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id="buyerVatNoFieldIsVisible"+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ data-testid="buyerVatNoFieldIsVisible"+ aria-label="Show the 'Buyer Tax Number' Field in the PDF"+ />+ );+ }}/><CustomTooltiptrigger={@@ -168,29 +175,31 @@ export const BuyerInformation = memo(function BuyerInformation({<Controllername="buyer.vatNoLabelText"control={control}- render={({ field }) => (- <Input- {...field}- type="text"- id="buyerVatNoLabel"- placeholder="Enter Tax number label"- className={cn(- "mt-1 block w-full",- inputErrorClassName(!!errors.buyer?.vatNoLabelText),- )}- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ type="text"+ id="buyerVatNoLabel"+ placeholder="Enter Tax number label"+ className={cn(+ "mt-1 block w-full",+ inputErrorClassName(!!errors.buyer?.vatNoLabelText),+ )}+ />+ );+ }}/>{errors.buyer?.vatNoLabelText ? (<ErrorMessage>{errors.buyer.vatNoLabelText.message}</ErrorMessage>) : null}- {!errors.buyer?.vatNoLabelText && (+ {!errors.buyer?.vatNoLabelText ? (<InputHelperMessage>Set a custom label (e.g. VAT no, Tax no, etc.)</InputHelperMessage>- )}+ ) : null}</div><div>@@ -198,18 +207,20 @@ export const BuyerInformation = memo(function BuyerInformation({<Controllername="buyer.vatNo"control={control}- render={({ field }) => (- <Input- {...field}- id="buyerVatNo"- type="text"- placeholder="Enter Tax number value"- className={cn(- "mt-1 block w-full",- inputErrorClassName(!!errors.buyer?.vatNo),- )}- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ id="buyerVatNo"+ type="text"+ placeholder="Enter Tax number value"+ className={cn(+ "mt-1 block w-full",+ inputErrorClassName(!!errors.buyer?.vatNo),+ )}+ />+ );+ }}/>{errors.buyer?.vatNo ? (<ErrorMessage>{errors.buyer.vatNo.message}</ErrorMessage>@@ -228,17 +239,19 @@ export const BuyerInformation = memo(function BuyerInformation({<Controllername="buyer.emailFieldIsVisible"control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id="buyerEmailFieldIsVisible"- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- data-testid="buyerEmailFieldIsVisible"- aria-label="Show the 'Email' field in the PDF"- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id="buyerEmailFieldIsVisible"+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ data-testid="buyerEmailFieldIsVisible"+ aria-label="Show the 'Email' field in the PDF"+ />+ );+ }}/><CustomTooltiptrigger={@@ -255,14 +268,16 @@ export const BuyerInformation = memo(function BuyerInformation({<Controllername="buyer.email"control={control}- render={({ field }) => (- <Input- {...field}- id="buyerEmail"- type="email"- className={inputErrorClassName(!!errors.buyer?.email)}- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ id="buyerEmail"+ type="email"+ className={inputErrorClassName(!!errors.buyer?.email)}+ />+ );+ }}/>{errors.buyer?.email ? (<ErrorMessage>{errors.buyer.email.message}</ErrorMessage>@@ -278,17 +293,19 @@ export const BuyerInformation = memo(function BuyerInformation({<Controllername="buyer.notesFieldIsVisible"control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id="buyerNotesFieldIsVisible"- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- data-testid="buyerNotesInvoiceFormFieldVisibilitySwitch"- aria-label="Show the 'Notes' field in the PDF"- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id="buyerNotesFieldIsVisible"+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ data-testid="buyerNotesInvoiceFormFieldVisibilitySwitch"+ aria-label="Show the 'Notes' field in the PDF"+ />+ );+ }}/><CustomTooltiptrigger={@@ -306,14 +323,16 @@ export const BuyerInformation = memo(function BuyerInformation({<Controllername="buyer.notes"control={control}- render={({ field }) => (- <Textarea- {...field}- id="buyerNotes"- rows={3}- className={inputErrorClassName(!!errors.buyer?.notes)}- />- )}+ render={({ field }) => {+ return (+ <Textarea+ {...field}+ id="buyerNotes"+ rows={3}+ className={inputErrorClassName(!!errors.buyer?.notes)}+ />+ );+ }}/>{errors.buyer?.notes ? (<ErrorMessage>{errors.buyer.notes.message}</ErrorMessage>diff --git a/src/app/(app)/components/invoice-form/sections/components/__tests__/stale-dates-banner.test.tsx b/src/app/(app)/components/invoice-form/sections/components/__tests__/stale-dates-banner.test.tsxnew file mode 100644index 0000000..5905d00--- /dev/null+++ b/src/app/(app)/components/invoice-form/sections/components/__tests__/stale-dates-banner.test.tsx@@ -0,0 +1,248 @@+// @vitest-environment happy-dom++import { cleanup, render, screen, within } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import {+ afterAll,+ afterEach,+ beforeAll,+ describe,+ expect,+ it,+ vi,+} from "vitest";++import type { InvoiceData, SupportedLanguages } from "@/app/schema";+import "@testing-library/jest-dom/vitest";++vi.mock("sonner", () => {+ return {+ toast: {+ success: vi.fn(),+ },+ };+});++import { StaleDatesBanner } from "../stale-dates-banner";++/** Frozen "now" for the whole suite: 15 September 2026, mid-month. */+const NOW = new Date("2026-09-15T10:00:00.000Z");++/** Every date below is stale relative to {@link NOW}. */+const STALE_PROPS = {+ dateOfIssue: "2026-06-10",+ dateOfService: "2026-06-30",+ dateOfServiceStart: "2026-06-01",+ invoiceNumberValue: "1/06-2026",+ // Not 14 days after the date of issue, so it counts as stale too.+ paymentDue: "2026-06-20",+ selectedDateFormat: "MMMM D, YYYY",+ isMobile: false,+};++function renderBanner({+ language = "en",+ setValue = vi.fn(),+ ...overrides+}: {+ language?: SupportedLanguages;+ setValue?: ReturnType<typeof vi.fn>;+} & Partial<typeof STALE_PROPS> = {}) {+ return render(+ <StaleDatesBanner+ {...STALE_PROPS}+ {...overrides}+ language={language}+ setValue={+ setValue as unknown as Parameters<+ typeof StaleDatesBanner+ >[0]["setValue"]+ }+ />,+ );+}++function getBanner() {+ return screen.getByTestId("out-of-date-dates-helper");+}++/** Field labels of the rendered rows, in DOM order. */+function getRowLabels() {+ return within(getBanner())+ .getAllByRole("row")+ .slice(1) // drop the header row+ .map((row) => {+ return within(row).getAllByRole("cell")[0].textContent;+ });+}++function getRow(label: string) {+ const cell = within(getBanner()).getByRole("cell", { name: label });+ const row = cell.closest("tr");++ if (!row) {+ throw new Error(`No row found for "${label}"`);+ }++ return row;+}++describe("StaleDatesBanner", () => {+ beforeAll(() => {+ vi.useFakeTimers({ shouldAdvanceTime: true });+ vi.setSystemTime(NOW);+ });++ afterEach(() => {+ cleanup();+ vi.clearAllMocks();+ });++ afterAll(() => {+ vi.useRealTimers();+ });++ it("lists every stale field, in the same order as the form", () => {+ renderBanner();++ expect(+ within(getBanner()).getByText("5 fields are out of date"),+ ).toBeVisible();++ // The banner walks the invoice in the same order as the fields do, and+ // service period start has to come above service period end so the two read+ // as a range rather than backwards.+ expect(getRowLabels()).toEqual([+ "Invoice number",+ "Date of issue",+ "Service period start",+ "Service period end",+ "Payment due",+ ]);+ });++ it("keeps service period start above service period end when they are the only stale fields", () => {+ renderBanner({+ dateOfIssue: "2026-09-15",+ paymentDue: "2026-09-29",+ invoiceNumberValue: "1/09-2026",+ dateOfServiceStart: "2026-08-31",+ dateOfService: "2026-08-31",+ });++ expect(getRowLabels()).toEqual([+ "Service period start",+ "Service period end",+ ]);+ });++ it("only lists the fields that are actually stale", () => {+ renderBanner({+ dateOfIssue: "2026-09-15",+ dateOfServiceStart: "2026-09-01",+ dateOfService: "2026-09-30",+ invoiceNumberValue: "1/09-2026",+ paymentDue: "2026-06-24",+ });++ expect(+ within(getBanner()).getByText("1 field is out of date"),+ ).toBeVisible();+ expect(getRow("Payment due")).toBeInTheDocument();+ expect(+ within(getBanner()).queryByRole("cell", { name: "Date of issue" }),+ ).not.toBeInTheDocument();+ });++ it("falls back to a placeholder when a date is not set", () => {+ renderBanner({ paymentDue: "" });++ expect(within(getRow("Payment due")).getByText("(not set)")).toBeVisible();+ });++ describe("localised dates", () => {+ it("renders both the old and the suggested date in English", () => {+ renderBanner({ language: "en" });++ const row = getRow("Date of issue");++ expect(within(row).getByText("June 10, 2026")).toBeVisible();+ expect(within(row).getByText("September 15, 2026")).toBeVisible();+ });++ it("renders both the old and the suggested date in the invoice PDF language", () => {+ renderBanner({ language: "fr" });++ const row = getRow("Date of issue");++ expect(within(row).getByText("juin 10, 2026")).toBeVisible();+ expect(within(row).getByText("septembre 15, 2026")).toBeVisible();+ });++ it.each([+ ["pl", "wrzesień 30, 2026"],+ ["de", "September 30, 2026"],+ ["es", "septiembre 30, 2026"],+ ["ru", "сентябрь 30, 2026"],+ ["uk", "вересень 30, 2026"],+ ["it", "settembre 30, 2026"],+ ["nl", "september 30, 2026"],+ ["pt", "setembro 30, 2026"],+ ] as const)(+ "renders the end-of-month suggestion in %s",+ (language, expected) => {+ renderBanner({ language });++ expect(+ within(getRow("Service period end")).getByText(expected),+ ).toBeVisible();+ },+ );++ it("respects the selected date format on top of the language", () => {+ renderBanner({ language: "pl", selectedDateFormat: "D MMM YYYY" });++ expect(+ within(getRow("Date of issue")).getByText("15 wrz 2026"),+ ).toBeVisible();+ });++ it("leaves a numeric date format identical across languages", () => {+ renderBanner({ language: "ru", selectedDateFormat: "YYYY-MM-DD" });++ expect(+ within(getRow("Date of issue")).getByText("2026-09-15"),+ ).toBeVisible();+ });++ it("keeps the invoice number suggestion language-independent", () => {+ renderBanner({ language: "ru" });++ expect(+ within(getRow("Invoice number")).getByText("1/09-2026"),+ ).toBeVisible();+ });+ });++ it("updates every stale date to the current month when clicked", async () => {+ const user = userEvent.setup({ advanceTimers: vi.advanceTimersByTime });+ const setValue = vi.fn();++ renderBanner({ setValue });++ await user.click(screen.getByRole("button", { name: /update all dates/i }));++ const calls = Object.fromEntries(setValue.mock.calls) as Record<+ keyof InvoiceData | "invoiceNumberObject.value",+ string+ >;++ expect(calls).toEqual({+ dateOfServiceStart: "2026-09-01",+ dateOfService: "2026-09-30",+ dateOfIssue: "2026-09-15",+ "invoiceNumberObject.value": "1/09-2026",+ paymentDue: "2026-09-29",+ });+ });+});diff --git a/src/app/(app)/components/invoice-form/sections/components/buyer/buyer-dialog.tsx b/src/app/(app)/components/invoice-form/sections/components/buyer/buyer-dialog.tsxindex bdd6f6c..dcbaceb 100644--- a/src/app/(app)/components/invoice-form/sections/components/buyer/buyer-dialog.tsx+++ b/src/app/(app)/components/invoice-form/sections/components/buyer/buyer-dialog.tsx@@ -1,3 +1,18 @@+import * as Sentry from "@sentry/nextjs";+import { useState } from "react";+import { useForm } from "react-hook-form";+import { toast } from "sonner";++import { useConfirmDiscard } from "@/app/(app)/components/invoice-form/sections/hooks/use-confirm-discard";+import {+ getAppStorageItem,+ setAppStorageItem,+} from "@/app/(app)/utils/app-local-storage";+import {+ BUYERS_LOCAL_STORAGE_KEY,+ buyerSchema,+ type BuyerData,+} from "@/app/schema";import { Button } from "@/components/ui/button";import {Dialog,@@ -7,12 +22,6 @@ import {DialogHeader,DialogTitle,} from "@/components/ui/dialog";-import { Input } from "@/components/ui/input";-import { Label } from "@/components/ui/label";-import { Textarea } from "@/components/ui/textarea";-import { buyerSchema, type BuyerData } from "@/app/schema";-import { useForm } from "react-hook-form";-import { zodResolver } from "@hookform/resolvers/zod";import {Form,FormControl,@@ -21,18 +30,32 @@ import {FormLabel,FormMessage,} from "@/components/ui/form";+import { Input } from "@/components/ui/input";+import { Label } from "@/components/ui/label";import { Switch } from "@/components/ui/switch";+import { Textarea } from "@/components/ui/textarea";import { CustomTooltip } from "@/components/ui/tooltip";-import { toast } from "sonner";-import { ConfirmDiscardDialog } from "../confirm-discard-dialog";-import { BUYERS_LOCAL_STORAGE_KEY } from "./buyer-management";-import { useState, useEffect } from "react";-import * as Sentry from "@sentry/nextjs";+import { zodResolverForOutput } from "@/lib/zod-resolver-for-output";+import { InputHelperMessage } from "../../../../../../../components/ui/input-helper-message";-import { useConfirmDiscard } from "@/app/(app)/components/invoice-form/sections/hooks/use-confirm-discard";+import { ConfirmDiscardDialog } from "../confirm-discard-dialog";const BUYER_FORM_ID = "buyer-form";+/** The buyer form with nothing filled in yet */+const EMPTY_BUYER_FORM_VALUES = {+ id: "",+ name: "",+ address: "",+ vatNo: "",+ vatNoLabelText: "VAT no",+ email: "",+ emailFieldIsVisible: true,+ vatNoFieldIsVisible: true,+ notes: "",+ notesFieldIsVisible: true,+} as const satisfies BuyerData;+interface BuyerDialogProps {isOpen: boolean;onClose: React.Dispatch<React.SetStateAction<boolean>>;@@ -71,7 +94,7 @@ export function BuyerDialog({formValues,}: BuyerDialogProps) {const form = useForm<BuyerData>({- resolver: zodResolver(buyerSchema),+ resolver: zodResolverForOutput(buyerSchema),defaultValues: {id: initialData?.id ?? "",name: initialData?.name ?? "",@@ -109,67 +132,73 @@ export function BuyerDialog({>(null);/**- * Synchronizes form values based on the "Use current invoice data" switch state.+ * Resets the dialog form to the buyer it was opened with, or to an empty+ * form when adding a new one.*- * When creating a new buyer (not in edit mode):- * - If switch is ON: Populates the form with current invoice buyer data (formValues)- * to allow users to save the current invoice's buyer information as a new saved buyer.- * - If switch is OFF: Resets the form to empty/default values or initialData- * to allow users to enter completely new buyer information from scratch.+ * `form.reset()` with no arguments cannot be used for this: react-hook-form treats+ * the values of the last `reset(values)` call as the new defaults, so after a+ * pre-fill it would restore the pre-filled values instead of clearing them.+ */+ function resetFormToInitialValues() {+ form.reset(initialData ?? EMPTY_BUYER_FORM_VALUES);+ }++ /**+ * Applies the "Use current invoice data" switch to the dialog form.*- * This effect does not run in edit mode to prevent overwriting the buyer being edited.+ * Switch ON: fills the form with the current invoice buyer data, so the invoice's+ * buyer can be saved as a new buyer.+ * Switch OFF: clears the form back to the initial (or empty) buyer.+ *+ * Leaves the form alone in edit mode, so the buyer being edited is never overwritten.*/- useEffect(() => {- // Switch is ON: Pre-fill form with current invoice buyer data- if (shouldApplyInlineFormValues && formValues && !isEditMode) {- form.reset({- ...form.getValues(),- ...formValues,- });+ function applyPrefillSwitch(newValue: boolean) {+ setShouldApplyInlineFormValues(newValue);++ if (isEditMode) {+ return;}- // Switch is OFF: Reset form to empty state or initial data- else if (!shouldApplyInlineFormValues && !isEditMode) {- form.reset(- initialData ?? {- id: "",- name: "",- address: "",- vatNo: "",- vatNoLabelText: "VAT no",- email: "",- emailFieldIsVisible: true,- vatNoFieldIsVisible: true,- notes: "",- notesFieldIsVisible: true,- },- );+ // Switch is ON: pre-fill the form with the current invoice buyer data+ if (newValue) {+ if (formValues) {+ form.reset({+ ...form.getValues(),+ ...formValues,+ });+ }+ return;}- }, [shouldApplyInlineFormValues, formValues, initialData, isEditMode, form]);++ // Switch is OFF: reset the form to the initial data, or to an empty form+ resetFormToInitialValues();+ }/*** Guards the pre-fill switch toggle against dirty form state.** When the form has unsaved changes, opens the ConfirmDiscardDialog before- * applying the switch change. Only updates shouldApplyFormValues (and thus- * triggers form.reset via the effect above) after the user confirms discard.+ * applying the switch change. Only applies the switch after the user confirms+ * discard.*/function handlePrefillSwitchToggle(newValue: boolean) {if (isDirty) {- setPendingDiscardAction(- () => () => setShouldApplyInlineFormValues(newValue),- );+ setPendingDiscardAction(() => {+ return () => {+ return applyPrefillSwitch(newValue);+ };+ });setIsConfirmDiscardDialogOpen(true);return;}- setShouldApplyInlineFormValues(newValue);+ applyPrefillSwitch(newValue);}/*** Closes the buyer dialog and resets the form to its default state.*/function closeDialog() {- form.reset();+ resetFormToInitialValues();// by default, we don't want to apply the inline form values to the dialog formsetShouldApplyInlineFormValues(false);@@ -184,7 +213,7 @@ export function BuyerDialog({// **RUNNING SOME VALIDATIONS FIRST**// Get existing buyers or initialize empty array- const buyers = localStorage.getItem(BUYERS_LOCAL_STORAGE_KEY);+ const buyers = getAppStorageItem(BUYERS_LOCAL_STORAGE_KEY);const existingBuyers: unknown = buyers ? JSON.parse(buyers) : [];const rawBuyers = Array.isArray(existingBuyers) ? existingBuyers : [];@@ -216,17 +245,16 @@ export function BuyerDialog({// If we had invalid buyers, save the valid buyers back to localStorageif (hadInvalidBuyers) {- localStorage.setItem(- BUYERS_LOCAL_STORAGE_KEY,- JSON.stringify(validBuyers),- );+ setAppStorageItem({+ key: BUYERS_LOCAL_STORAGE_KEY,+ value: JSON.stringify(validBuyers),+ });}// Validate buyer data against existing buyers- const isDuplicateName = validBuyers.some(- (buyer: BuyerData) =>- buyer.name === formValues.name && buyer.id !== formValues.id,- );+ const isDuplicateName = validBuyers.some((buyer: BuyerData) => {+ return buyer.name === formValues.name && buyer.id !== formValues.id;+ });if (isDuplicateName) {form.setError("name", {@@ -277,7 +305,9 @@ export function BuyerDialog({// If there are unsaved changes (isDirty), opens the confirmation dialog.// Otherwise, closes the dialog immediately.if (isDirty) {- setPendingDiscardAction(() => closeDialog);+ setPendingDiscardAction(() => {+ return closeDialog;+ });setIsConfirmDiscardDialogOpen(true);return;}@@ -302,7 +332,7 @@ export function BuyerDialog({<div className="overflow-y-auto px-6 py-4">{/* Add Use Current Form Values switch */}- {!isEditMode && (+ {!isEditMode ? (<div className="mb-4"><div className="flex items-center gap-2"><Switch@@ -323,7 +353,7 @@ export function BuyerDialog({entered in your current invoice form.</span></div>- )}+ ) : null}<Form {...form}><form@@ -334,37 +364,41 @@ export function BuyerDialog({<FormFieldcontrol={form.control}name="name"- render={({ field }) => (- <FormItem>- <FormLabel>Name (Required)</FormLabel>- <FormControl>- <Textarea- {...field}- rows={3}- placeholder="Enter buyer name"- />- </FormControl>- <FormMessage />- </FormItem>- )}+ render={({ field }) => {+ return (+ <FormItem>+ <FormLabel>Name (Required)</FormLabel>+ <FormControl>+ <Textarea+ {...field}+ rows={3}+ placeholder="Enter buyer name"+ />+ </FormControl>+ <FormMessage />+ </FormItem>+ );+ }}/><FormFieldcontrol={form.control}name="address"- render={({ field }) => (- <FormItem>- <FormLabel>Address (Required)</FormLabel>- <FormControl>- <Textarea- {...field}- rows={3}- placeholder="Enter buyer address"- />- </FormControl>- <FormMessage />- </FormItem>- )}+ render={({ field }) => {+ return (+ <FormItem>+ <FormLabel>Address (Required)</FormLabel>+ <FormControl>+ <Textarea+ {...field}+ rows={3}+ placeholder="Enter buyer address"+ />+ </FormControl>+ <FormMessage />+ </FormItem>+ );+ }}/>{/* Tax Number */}@@ -379,27 +413,29 @@ export function BuyerDialog({<FormFieldcontrol={form.control}name="vatNoFieldIsVisible"- render={({ field }) => (- <FormItem>- <div className="flex items-center gap-2">- <Switch- checked={field.value}- onCheckedChange={field.onChange}- id="vatNoFieldIsVisible"- aria-label={`Show the 'Tax Number' field in the PDF`}- />- <CustomTooltip- trigger={- <Label htmlFor="vatNoFieldIsVisible">- Show in PDF- </Label>- }- content='Show the "Tax Number" field in the PDF'- className="z-[1000]"- />- </div>- </FormItem>- )}+ render={({ field }) => {+ return (+ <FormItem>+ <div className="flex items-center gap-2">+ <Switch+ checked={field.value}+ onCheckedChange={field.onChange}+ id="vatNoFieldIsVisible"+ aria-label={`Show the 'Tax Number' field in the PDF`}+ />+ <CustomTooltip+ trigger={+ <Label htmlFor="vatNoFieldIsVisible">+ Show in PDF+ </Label>+ }+ content='Show the "Tax Number" field in the PDF'+ className="z-[1000]"+ />+ </div>+ </FormItem>+ );+ }}/></div></div>@@ -408,46 +444,50 @@ export function BuyerDialog({<FormFieldcontrol={form.control}name="vatNoLabelText"- render={({ field }) => (- <FormItem>- <FormLabel>Label</FormLabel>- <FormControl>- <Input- {...field}- placeholder="Enter Tax number label"- />- </FormControl>-- {form.formState.errors.vatNoLabelText ? (- <FormMessage>- {form.formState.errors.vatNoLabelText.message}- </FormMessage>- ) : null}-- {!form.formState.errors.vatNoLabelText && (- <InputHelperMessage>- Set a custom label (e.g. VAT no, Tax no, etc.)- </InputHelperMessage>- )}- </FormItem>- )}+ render={({ field }) => {+ return (+ <FormItem>+ <FormLabel>Label</FormLabel>+ <FormControl>+ <Input+ {...field}+ placeholder="Enter Tax number label"+ />+ </FormControl>++ {form.formState.errors.vatNoLabelText ? (+ <FormMessage>+ {form.formState.errors.vatNoLabelText.message}+ </FormMessage>+ ) : null}++ {!form.formState.errors.vatNoLabelText ? (+ <InputHelperMessage>+ Set a custom label (e.g. VAT no, Tax no, etc.)+ </InputHelperMessage>+ ) : null}+ </FormItem>+ );+ }}/><FormFieldcontrol={form.control}name="vatNo"- render={({ field }) => (- <FormItem>- <FormLabel>Value</FormLabel>- <FormControl>- <Input- {...field}- placeholder="Enter Tax number value"- />- </FormControl>- <FormMessage />- </FormItem>- )}+ render={({ field }) => {+ return (+ <FormItem>+ <FormLabel>Value</FormLabel>+ <FormControl>+ <Input+ {...field}+ placeholder="Enter Tax number value"+ />+ </FormControl>+ <FormMessage />+ </FormItem>+ );+ }}/></div></fieldset>@@ -457,49 +497,53 @@ export function BuyerDialog({<FormFieldcontrol={form.control}name="email"- render={({ field }) => (- <FormItem>- <FormLabel className="mb-2 font-medium">- </FormLabel>- <FormControl>- <Input- {...field}- type="email"- placeholder="[email protected]"- />- </FormControl>- <FormMessage />- </FormItem>- )}+ render={({ field }) => {+ return (+ <FormItem>+ <FormLabel className="mb-2 font-medium">+ </FormLabel>+ <FormControl>+ <Input+ {...field}+ type="email"+ placeholder="[email protected]"+ />+ </FormControl>+ <FormMessage />+ </FormItem>+ );+ }}/><FormFieldcontrol={form.control}name="emailFieldIsVisible"- render={({ field }) => (- <FormItem>- <div className="flex items-center gap-2">- <FormControl>- <Switch- checked={field.value}- onCheckedChange={field.onChange}- id="emailFieldIsVisible"- data-testid={`buyerEmailDialogFieldVisibilitySwitch`}- aria-label={`Show the 'Email' field in the PDF`}+ render={({ field }) => {+ return (+ <FormItem>+ <div className="flex items-center gap-2">+ <FormControl>+ <Switch+ checked={field.value}+ onCheckedChange={field.onChange}+ id="emailFieldIsVisible"+ data-testid={`buyerEmailDialogFieldVisibilitySwitch`}+ aria-label={`Show the 'Email' field in the PDF`}+ />+ </FormControl>+ <CustomTooltip+ trigger={+ <Label htmlFor="emailFieldIsVisible">+ Show Buyer Email in PDF+ </Label>+ }+ content='Show the "Email" field in the PDF'+ className="z-[1000]"/>- </FormControl>- <CustomTooltip- trigger={- <Label htmlFor="emailFieldIsVisible">- Show Buyer Email in PDF- </Label>- }- content='Show the "Email" field in the PDF'- className="z-[1000]"- />- </div>- </FormItem>- )}+ </div>+ </FormItem>+ );+ }}/></div>@@ -508,57 +552,61 @@ export function BuyerDialog({<FormFieldcontrol={form.control}name="notes"- render={({ field }) => (- <FormItem>- <FormLabel className="mb-2 font-medium">- Notes- </FormLabel>- <FormControl>- <Textarea- {...field}- rows={3}- placeholder="Enter notes (max 750 characters)"- maxLength={750}- />- </FormControl>- <FormMessage />- </FormItem>- )}+ render={({ field }) => {+ return (+ <FormItem>+ <FormLabel className="mb-2 font-medium">+ Notes+ </FormLabel>+ <FormControl>+ <Textarea+ {...field}+ rows={3}+ placeholder="Enter notes (max 750 characters)"+ maxLength={750}+ />+ </FormControl>+ <FormMessage />+ </FormItem>+ );+ }}/><FormFieldcontrol={form.control}name="notesFieldIsVisible"- render={({ field }) => (- <FormItem>- <div className="flex items-center gap-2">- <FormControl>- <Switch- checked={field.value}- onCheckedChange={field.onChange}- id="notes-field-visibility"- data-testid={`buyerNotesDialogFieldVisibilitySwitch`}- aria-label={`Show the 'Notes' field in the PDF`}+ render={({ field }) => {+ return (+ <FormItem>+ <div className="flex items-center gap-2">+ <FormControl>+ <Switch+ checked={field.value}+ onCheckedChange={field.onChange}+ id="notes-field-visibility"+ data-testid={`buyerNotesDialogFieldVisibilitySwitch`}+ aria-label={`Show the 'Notes' field in the PDF`}+ />+ </FormControl>+ <CustomTooltip+ trigger={+ <Label htmlFor="notes-field-visibility">+ Show Buyer Notes in PDF+ </Label>+ }+ content="Show the notes field in the PDF"+ className="z-[1000]"/>- </FormControl>- <CustomTooltip- trigger={- <Label htmlFor="notes-field-visibility">- Show Buyer Notes in PDF- </Label>- }- content="Show the notes field in the PDF"- className="z-[1000]"- />- </div>- </FormItem>- )}+ </div>+ </FormItem>+ );+ }}/></div></form></Form>{/* Apply to Current Invoice switch remains at bottom */}- {!isEditMode && (+ {!isEditMode ? (<div className="mt-4 flex flex-col gap-1 border-t pt-4"><div className="flex items-center gap-2"><Switch@@ -579,7 +627,7 @@ export function BuyerDialog({generated PDF.</span></div>- )}+ ) : null}</div><DialogFooter className="border-border border-t px-6 py-4"><Button@@ -590,7 +638,9 @@ export function BuyerDialog({// If there are unsaved changes (isDirty), opens the confirmation dialog.// Otherwise, closes the dialog immediately.if (isDirty) {- setPendingDiscardAction(() => closeDialog);+ setPendingDiscardAction(() => {+ return closeDialog;+ });setIsConfirmDiscardDialogOpen(true);return;}diff --git a/src/app/(app)/components/invoice-form/sections/components/buyer/buyer-management.tsx b/src/app/(app)/components/invoice-form/sections/components/buyer/buyer-management.tsxindex 1798097..0d7a06e 100644--- a/src/app/(app)/components/invoice-form/sections/components/buyer/buyer-management.tsx+++ b/src/app/(app)/components/invoice-form/sections/components/buyer/buyer-management.tsx@@ -1,9 +1,20 @@+import * as Sentry from "@sentry/nextjs";import { Plus, Trash2, Pencil, AlertCircleIcon } from "lucide-react";import { useId, useState, useEffect } from "react";-import { CustomTooltip } from "@/components/ui/tooltip";-import { SelectNative } from "@/components/ui/select-native";-import { Button } from "@/components/ui/button";-import { BuyerDialog } from "./buyer-dialog";+import type { UseFormSetValue } from "react-hook-form";+import { toast } from "sonner";++import {+ getAppStorageItem,+ setAppStorageItem,+} from "@/app/(app)/utils/app-local-storage";+import { DEFAULT_BUYER_DATA } from "@/app/constants";+import {+ BUYERS_LOCAL_STORAGE_KEY,+ buyerSchema,+ type InvoiceData,+ type BuyerData,+} from "@/app/schema";import {AlertDialog,AlertDialogAction,@@ -14,17 +25,15 @@ import {AlertDialogHeader,AlertDialogTitle,} from "@/components/ui/alert-dialog";-import type { UseFormSetValue } from "react-hook-form";-import { buyerSchema, type InvoiceData, type BuyerData } from "@/app/schema";-import { toast } from "sonner";-import { cn } from "@/lib/utils";+import { Button } from "@/components/ui/button";import { Label } from "@/components/ui/label";-import { isLocalStorageAvailable } from "@/lib/check-local-storage";+import { SelectNative } from "@/components/ui/select-native";+import { CustomTooltip } from "@/components/ui/tooltip";import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";-import * as Sentry from "@sentry/nextjs";-import { DEFAULT_BUYER_DATA } from "@/app/constants";+import { useIsLocalStorageAvailable } from "@/lib/use-is-local-storage-available";+import { cn } from "@/lib/utils";-export const BUYERS_LOCAL_STORAGE_KEY = "EASY_INVOICE_PDF_BUYERS";+import { BuyerDialog } from "./buyer-dialog";interface BuyerManagementProps {setValue: UseFormSetValue<InvoiceData>;@@ -76,12 +85,14 @@ export function BuyerManagement({const buyerSelectId = useId();+ const isLocalStorageAvailable = useIsLocalStorageAvailable();+const isEditMode = Boolean(editingBuyer);// Load buyers from localStorage on component mountuseEffect(() => {try {- const savedBuyers = localStorage.getItem(BUYERS_LOCAL_STORAGE_KEY);+ const savedBuyers = getAppStorageItem(BUYERS_LOCAL_STORAGE_KEY);const parsedBuyers: unknown = savedBuyers ? JSON.parse(savedBuyers) : [];const rawBuyers = Array.isArray(parsedBuyers) ? parsedBuyers : [];@@ -117,16 +128,17 @@ export function BuyerManagement({),);- localStorage.setItem(- BUYERS_LOCAL_STORAGE_KEY,- JSON.stringify(validBuyers),- );+ setAppStorageItem({+ key: BUYERS_LOCAL_STORAGE_KEY,+ value: JSON.stringify(validBuyers),+ });}const selectedBuyer = validBuyers.find((buyer: BuyerData) => {return buyer?.id === invoiceData?.buyer?.id;});+ // oxlint-disable-next-line react/set-state-in-effect react-you-might-not-need-an-effect/no-adjust-state-on-prop-change -- localStorage is an external system: the saved buyers cannot be derived during render, they have to be read after mountsetBuyersSelectOptions(validBuyers);setSelectedBuyerId(selectedBuyer?.id ?? "");} catch (error) {@@ -151,7 +163,22 @@ export function BuyerManagement({const newBuyers = [...buyersSelectOptions, newBuyerWithId];// Save to localStorage- localStorage.setItem(BUYERS_LOCAL_STORAGE_KEY, JSON.stringify(newBuyers));+ const persisted = setAppStorageItem({+ key: BUYERS_LOCAL_STORAGE_KEY,+ value: JSON.stringify(newBuyers),+ });++ // Nothing to show the user later if the list could not be saved, so stop here+ // rather than reporting a success the next page load would contradict.+ if (!persisted) {+ showBuyerStorageErrorToast({+ message: "Failed to add buyer",+ id: "add_buyer_error_toast",+ isMobile,+ });++ return;+ }// Update the buyers statesetBuyersSelectOptions(newBuyers);@@ -192,14 +219,24 @@ export function BuyerManagement({// Update buyers when editedconst handleBuyerEdit = (editedBuyer: BuyerData) => {try {- const updatedBuyers = buyersSelectOptions.map((buyer) =>- buyer.id === editedBuyer.id ? editedBuyer : buyer,- );+ const updatedBuyers = buyersSelectOptions.map((buyer) => {+ return buyer.id === editedBuyer.id ? editedBuyer : buyer;+ });- localStorage.setItem(- BUYERS_LOCAL_STORAGE_KEY,- JSON.stringify(updatedBuyers),- );+ const persisted = setAppStorageItem({+ key: BUYERS_LOCAL_STORAGE_KEY,+ value: JSON.stringify(updatedBuyers),+ });++ if (!persisted) {+ showBuyerStorageErrorToast({+ message: "Failed to edit buyer",+ id: "edit_buyer_error_toast",+ isMobile,+ });++ return;+ }setBuyersSelectOptions(updatedBuyers);setValue("buyer", editedBuyer);@@ -234,9 +271,9 @@ export function BuyerManagement({if (id) {setSelectedBuyerId(id);- const selectedBuyer = buyersSelectOptions.find(- (buyer) => buyer.id === id,- );+ const selectedBuyer = buyersSelectOptions.find((buyer) => {+ return buyer.id === id;+ });if (selectedBuyer) {setValue("buyer", selectedBuyer);@@ -264,17 +301,26 @@ export function BuyerManagement({const handleDeleteBuyer = () => {try {- setBuyersSelectOptions((prevBuyers) => {- const updatedBuyers = prevBuyers.filter(- (buyer) => buyer.id !== selectedBuyerId,- );+ const updatedBuyers = buyersSelectOptions.filter((buyer) => {+ return buyer.id !== selectedBuyerId;+ });- localStorage.setItem(- BUYERS_LOCAL_STORAGE_KEY,- JSON.stringify(updatedBuyers),- );- return updatedBuyers;+ const persisted = setAppStorageItem({+ key: BUYERS_LOCAL_STORAGE_KEY,+ value: JSON.stringify(updatedBuyers),});++ if (!persisted) {+ showBuyerStorageErrorToast({+ message: "Failed to delete buyer",+ id: "delete_buyer_error_toast",+ isMobile,+ });++ return;+ }++ setBuyersSelectOptions(updatedBuyers);// Clear the selected buyer indexsetSelectedBuyerId("");// Clear the buyer from the form if it was selected@@ -305,9 +351,9 @@ export function BuyerManagement({}};- const activeBuyer = buyersSelectOptions.find(- (buyer) => buyer.id === selectedBuyerId,- );+ const activeBuyer = buyersSelectOptions.find((buyer) => {+ return buyer.id === selectedBuyerId;+ });const hasBuyers = buyersSelectOptions.length > 0;@@ -340,11 +386,13 @@ export function BuyerManagement({title={activeBuyer?.name}><option value="">No buyer selected (default)</option>- {buyersSelectOptions.map((buyer) => (- <option key={buyer.id} value={buyer.id}>- {buyer.name}- </option>- ))}+ {buyersSelectOptions.map((buyer) => {+ return (+ <option key={buyer.id} value={buyer.id}>+ {buyer.name}+ </option>+ );+ })}</SelectNative>{selectedBuyerId ? (@@ -505,3 +553,31 @@ export function BuyerManagement({</>);}++interface ShowBuyerStorageErrorToastOptions {+ /** What the user was trying to do, e.g. "Failed to add buyer". */+ message: string;+ /** Stable toast id, so repeated failures replace each other instead of stacking. */+ id: string;+ /** Mobile shows toasts at the top, desktop at the bottom right. */+ isMobile: boolean;+}++/**+ * Tells the user their buyer list could not be saved.+ *+ * A rejected write is not an application error — it is a full or disabled store — so it+ * is surfaced to the user and deliberately not reported to Sentry.+ */+function showBuyerStorageErrorToast({+ message,+ id,+ isMobile,+}: ShowBuyerStorageErrorToastOptions) {+ toast.error(message, {+ id,+ description: "Please try again",+ closeButton: true,+ position: isMobile ? "top-center" : "bottom-right",+ });+}diff --git a/src/app/(app)/components/invoice-form/sections/components/seller/__tests__/seller-management-storage.test.tsx b/src/app/(app)/components/invoice-form/sections/components/seller/__tests__/seller-management-storage.test.tsxnew file mode 100644index 0000000..170b848--- /dev/null+++ b/src/app/(app)/components/invoice-form/sections/components/seller/__tests__/seller-management-storage.test.tsx@@ -0,0 +1,112 @@+// @vitest-environment happy-dom++import { cleanup, render, screen } from "@testing-library/react";+import { afterEach, describe, expect, it, vi } from "vitest";++import { getInitialInvoiceData } from "@/app/constants";+import { TooltipProvider } from "@/components/ui/tooltip";+import "@testing-library/jest-dom/vitest";++vi.mock("sonner", () => {+ return {+ toast: {+ success: vi.fn(),+ error: vi.fn(),+ dismiss: vi.fn(),+ },+ };+});++vi.mock("@sentry/nextjs", () => {+ return { captureException: vi.fn() };+});++vi.mock("@/lib/umami-analytics-track-event", () => {+ return { umamiTrackEvent: vi.fn() };+});++const originalDescriptor = Object.getOwnPropertyDescriptor(+ window,+ "localStorage",+);++/** iOS in-app webviews (Telegram, Instagram, Facebook) expose `localStorage` as `null`. */+function makeLocalStorageNull() {+ Object.defineProperty(window, "localStorage", {+ configurable: true,+ get() {+ return null;+ },+ });+}++/**+ * A fresh module graph per test: the availability probe memoizes its answer for the+ * lifetime of the module, exactly as it does for the lifetime of a page load.+ */+async function importFreshSellerManagement() {+ vi.resetModules();++ const { SellerManagement } = await import("../seller-management");++ return SellerManagement;+}++afterEach(() => {+ cleanup();++ if (originalDescriptor) {+ Object.defineProperty(window, "localStorage", originalDescriptor);+ }++ vi.clearAllMocks();+});++interface RenderSellerManagementOptions {+ /** The component under test, imported fresh so it probes the current storage stub. */+ SellerManagement: Awaited<ReturnType<typeof importFreshSellerManagement>>;+}++function renderSellerManagement({+ SellerManagement,+}: RenderSellerManagementOptions) {+ return render(+ <TooltipProvider delayDuration={0}>+ <SellerManagement+ setValue={vi.fn()}+ invoiceData={getInitialInvoiceData()}+ selectedSellerId=""+ setSelectedSellerId={vi.fn()}+ isMobile={false}+ />+ </TooltipProvider>,+ );+}++describe("SellerManagement when localStorage is unavailable", () => {+ it("renders instead of crashing, and marks 'New Seller' unavailable", async () => {+ makeLocalStorageNull();++ const SellerManagement = await importFreshSellerManagement();++ expect(() => {+ return renderSellerManagement({ SellerManagement });+ }).not.toThrow();++ expect(screen.getByRole("button", { name: /new seller/i })).toHaveAttribute(+ "aria-disabled",+ "true",+ );+ });++ it("leaves 'New Seller' enabled when storage works", async () => {+ const SellerManagement = await importFreshSellerManagement();++ renderSellerManagement({ SellerManagement });++ expect(screen.getByRole("button", { name: /new seller/i })).toHaveAttribute(+ "aria-disabled",+ "false",+ );+ });+});diff --git a/src/app/(app)/components/invoice-form/sections/components/seller/seller-dialog.tsx b/src/app/(app)/components/invoice-form/sections/components/seller/seller-dialog.tsxindex 6b11eb9..75c97de 100644--- a/src/app/(app)/components/invoice-form/sections/components/seller/seller-dialog.tsx+++ b/src/app/(app)/components/invoice-form/sections/components/seller/seller-dialog.tsx@@ -1,4 +1,18 @@-import { sellerSchema, type SellerData } from "@/app/schema";+import * as Sentry from "@sentry/nextjs";+import { useState } from "react";+import { useForm } from "react-hook-form";+import { toast } from "sonner";++import { useConfirmDiscard } from "@/app/(app)/components/invoice-form/sections/hooks/use-confirm-discard";+import {+ getAppStorageItem,+ setAppStorageItem,+} from "@/app/(app)/utils/app-local-storage";+import {+ SELLERS_LOCAL_STORAGE_KEY,+ sellerSchema,+ type SellerData,+} from "@/app/schema";import { Button } from "@/components/ui/button";import {Dialog,@@ -21,18 +35,31 @@ import { Label } from "@/components/ui/label";import { Switch } from "@/components/ui/switch";import { Textarea } from "@/components/ui/textarea";import { CustomTooltip } from "@/components/ui/tooltip";-import { zodResolver } from "@hookform/resolvers/zod";-import * as Sentry from "@sentry/nextjs";-import { useEffect, useState } from "react";-import { useForm } from "react-hook-form";-import { toast } from "sonner";-import { ConfirmDiscardDialog } from "../confirm-discard-dialog";-import { SELLERS_LOCAL_STORAGE_KEY } from "./seller-management";+import { zodResolverForOutput } from "@/lib/zod-resolver-for-output";+import { InputHelperMessage } from "../../../../../../../components/ui/input-helper-message";-import { useConfirmDiscard } from "@/app/(app)/components/invoice-form/sections/hooks/use-confirm-discard";+import { ConfirmDiscardDialog } from "../confirm-discard-dialog";const SELLER_FORM_ID = "seller-form";+/** The seller form with nothing filled in yet */+const EMPTY_SELLER_FORM_VALUES = {+ id: "",+ name: "",+ address: "",+ vatNo: "",+ vatNoLabelText: "VAT no",+ email: "",+ emailFieldIsVisible: true,+ accountNumber: "",+ swiftBic: "",+ vatNoFieldIsVisible: true,+ accountNumberFieldIsVisible: true,+ swiftBicFieldIsVisible: true,+ notes: "",+ notesFieldIsVisible: true,+} satisfies SellerData;+interface SellerDialogProps {isOpen: boolean;onClose: React.Dispatch<React.SetStateAction<boolean>>;@@ -74,7 +101,7 @@ export function SellerDialog({formValues,}: SellerDialogProps) {const form = useForm<SellerData>({- resolver: zodResolver(sellerSchema),+ resolver: zodResolverForOutput(sellerSchema),defaultValues: {id: initialData?.id ?? "",name: initialData?.name ?? "",@@ -116,62 +143,74 @@ export function SellerDialog({(() => void) | null>(null);- // Effect to update form values when switch is toggled- useEffect(() => {- // if the switch is on and we have form values, we want to apply the form values to the form- if (shouldApplyInlineFormValues && formValues && !isEditMode) {- form.reset({- ...form.getValues(),- ...formValues,- });+ /**+ * Resets the dialog form to the seller it was opened with, or to an empty+ * form when adding a new one.+ *+ * `form.reset()` with no arguments cannot be used for this: react-hook-form treats+ * the values of the last `reset(values)` call as the new defaults, so after a+ * pre-fill it would restore the pre-filled values instead of clearing them.+ */+ function resetFormToInitialValues() {+ form.reset(initialData ?? EMPTY_SELLER_FORM_VALUES);+ }++ /**+ * Applies the pre-fill switch to the dialog form.+ *+ * Switch ON: fills the form with the values from the current invoice form, so the+ * invoice's seller can be saved as a new seller.+ * Switch OFF: clears the form back to the initial (or empty) seller.+ *+ * Leaves the form alone in edit mode, so the seller being edited is never overwritten.+ */+ function applyPrefillSwitch(newValue: boolean) {+ setShouldApplyInlineFormValues(newValue);++ if (isEditMode) {+ return;}- // if the switch is off and we have initial data, we want to apply the initial data to the form- else if (!shouldApplyInlineFormValues && !isEditMode) {- form.reset(- initialData ?? {- id: "",- name: "",- address: "",- vatNo: "",- vatNoLabelText: "VAT no",- email: "",- emailFieldIsVisible: true,- accountNumber: "",- swiftBic: "",- vatNoFieldIsVisible: true,- accountNumberFieldIsVisible: true,- swiftBicFieldIsVisible: true,- notes: "",- notesFieldIsVisible: true,- },- );+ // Switch is ON: pre-fill the form with the current invoice seller data+ if (newValue) {+ if (formValues) {+ form.reset({+ ...form.getValues(),+ ...formValues,+ });+ }+ return;}- }, [shouldApplyInlineFormValues, formValues, initialData, isEditMode, form]);++ // Switch is OFF: reset the form to the initial data, or to an empty form+ resetFormToInitialValues();+ }/*** Guards the pre-fill switch toggle against dirty form state.** When the form has unsaved changes, opens the ConfirmDiscardDialog before- * applying the switch change. Only updates shouldApplyFormValues (and thus- * triggers form.reset via the effect above) after the user confirms discard.+ * applying the switch change. Only applies the switch after the user confirms+ * discard.*/function handlePrefillSwitchToggle(newValue: boolean) {if (isDirty) {- setPendingDiscardAction(- () => () => setShouldApplyInlineFormValues(newValue),- );+ setPendingDiscardAction(() => {+ return () => {+ return applyPrefillSwitch(newValue);+ };+ });setIsConfirmDiscardDialogOpen(true);return;}- setShouldApplyInlineFormValues(newValue);+ applyPrefillSwitch(newValue);}/*** Closes the seller dialog and resets the form to its default state.*/function closeDialog() {- form.reset();+ resetFormToInitialValues();// by default, we don't want to apply the inline form values to the dialog formsetShouldApplyInlineFormValues(false);@@ -186,7 +225,7 @@ export function SellerDialog({// **RUNNING SOME VALIDATIONS FIRST**// Get existing sellers or initialize empty array- const sellers = localStorage.getItem(SELLERS_LOCAL_STORAGE_KEY);+ const sellers = getAppStorageItem(SELLERS_LOCAL_STORAGE_KEY);const existingSellers: unknown = sellers ? JSON.parse(sellers) : [];const rawSellers = Array.isArray(existingSellers) ? existingSellers : [];@@ -217,19 +256,18 @@ export function SellerDialog({// If we had invalid sellers, save the valid sellers back to localStorageif (hadInvalidSellers) {- localStorage.setItem(- SELLERS_LOCAL_STORAGE_KEY,- JSON.stringify(validSellers),- );+ setAppStorageItem({+ key: SELLERS_LOCAL_STORAGE_KEY,+ value: JSON.stringify(validSellers),+ });}// we don't need to validate the name if we are editing an existing seller// Validate seller data against existing sellers- const isDuplicateName = validSellers.some(- (seller: SellerData) =>- seller.name === formValues.name && seller.id !== formValues.id,- );+ const isDuplicateName = validSellers.some((seller: SellerData) => {+ return seller.name === formValues.name && seller.id !== formValues.id;+ });if (isDuplicateName) {form.setError("name", {@@ -283,7 +321,9 @@ export function SellerDialog({// If there are unsaved changes (isDirty), opens the confirmation dialog.// Otherwise, closes the dialog immediately.if (isDirty) {- setPendingDiscardAction(() => closeDialog);+ setPendingDiscardAction(() => {+ return closeDialog;+ });setIsConfirmDiscardDialogOpen(true);return;}@@ -308,7 +348,7 @@ export function SellerDialog({<div className="overflow-y-auto px-6 py-4">{/* Show Use Current Form Values switch only when creating new seller */}- {!isEditMode && (+ {!isEditMode ? (<div className="mb-4"><div className="flex items-center gap-2"><Switch@@ -329,7 +369,7 @@ export function SellerDialog({entered in your current invoice form.</span></div>- )}+ ) : null}<Form {...form}><form@@ -340,37 +380,41 @@ export function SellerDialog({<FormFieldcontrol={form.control}name="name"- render={({ field }) => (- <FormItem>- <FormLabel>Name (Required)</FormLabel>- <FormControl>- <Textarea- {...field}- rows={3}- placeholder="Enter seller name"- />- </FormControl>- <FormMessage />- </FormItem>- )}+ render={({ field }) => {+ return (+ <FormItem>+ <FormLabel>Name (Required)</FormLabel>+ <FormControl>+ <Textarea+ {...field}+ rows={3}+ placeholder="Enter seller name"+ />+ </FormControl>+ <FormMessage />+ </FormItem>+ );+ }}/><FormFieldcontrol={form.control}name="address"- render={({ field }) => (- <FormItem>- <FormLabel>Address (Required)</FormLabel>- <FormControl>- <Textarea- {...field}- rows={3}- placeholder="Enter seller address"- />- </FormControl>- <FormMessage />- </FormItem>- )}+ render={({ field }) => {+ return (+ <FormItem>+ <FormLabel>Address (Required)</FormLabel>+ <FormControl>+ <Textarea+ {...field}+ rows={3}+ placeholder="Enter seller address"+ />+ </FormControl>+ <FormMessage />+ </FormItem>+ );+ }}/><fieldset className="rounded-md border px-4 pb-4">@@ -384,27 +428,29 @@ export function SellerDialog({<FormFieldcontrol={form.control}name="vatNoFieldIsVisible"- render={({ field }) => (- <FormItem>- <div className="flex items-center gap-2">- <Switch- checked={field.value}- onCheckedChange={field.onChange}- id="vatNoFieldIsVisible"- aria-label={`Show the 'Tax Number' field in the PDF`}- />- <CustomTooltip- trigger={- <Label htmlFor="vatNoFieldIsVisible">- Show in PDF- </Label>- }- content='Show the "Tax Number" field in the PDF'- className="z-[1000]"- />- </div>- </FormItem>- )}+ render={({ field }) => {+ return (+ <FormItem>+ <div className="flex items-center gap-2">+ <Switch+ checked={field.value}+ onCheckedChange={field.onChange}+ id="vatNoFieldIsVisible"+ aria-label={`Show the 'Tax Number' field in the PDF`}+ />+ <CustomTooltip+ trigger={+ <Label htmlFor="vatNoFieldIsVisible">+ Show in PDF+ </Label>+ }+ content='Show the "Tax Number" field in the PDF'+ className="z-[1000]"+ />+ </div>+ </FormItem>+ );+ }}/></div></div>@@ -413,45 +459,49 @@ export function SellerDialog({<FormFieldcontrol={form.control}name="vatNoLabelText"- render={({ field }) => (- <FormItem>- <FormLabel>Label</FormLabel>- <FormControl>- <Input- {...field}- placeholder="Enter Tax number label"- />- </FormControl>- {form.formState.errors.vatNoLabelText ? (- <FormMessage>- {form.formState.errors.vatNoLabelText.message}- </FormMessage>- ) : null}-- {!form.formState.errors.vatNoLabelText && (- <InputHelperMessage>- Set a custom label (e.g. VAT no, Tax no, etc.)- </InputHelperMessage>- )}- </FormItem>- )}+ render={({ field }) => {+ return (+ <FormItem>+ <FormLabel>Label</FormLabel>+ <FormControl>+ <Input+ {...field}+ placeholder="Enter Tax number label"+ />+ </FormControl>+ {form.formState.errors.vatNoLabelText ? (+ <FormMessage>+ {form.formState.errors.vatNoLabelText.message}+ </FormMessage>+ ) : null}++ {!form.formState.errors.vatNoLabelText ? (+ <InputHelperMessage>+ Set a custom label (e.g. VAT no, Tax no, etc.)+ </InputHelperMessage>+ ) : null}+ </FormItem>+ );+ }}/><FormFieldcontrol={form.control}name="vatNo"- render={({ field }) => (- <FormItem>- <FormLabel>Value</FormLabel>- <FormControl>- <Input- {...field}- placeholder="Enter Tax number value"- />- </FormControl>- <FormMessage />- </FormItem>- )}+ render={({ field }) => {+ return (+ <FormItem>+ <FormLabel>Value</FormLabel>+ <FormControl>+ <Input+ {...field}+ placeholder="Enter Tax number value"+ />+ </FormControl>+ <FormMessage />+ </FormItem>+ );+ }}/></div></fieldset>@@ -461,49 +511,53 @@ export function SellerDialog({<FormFieldcontrol={form.control}name="email"- render={({ field }) => (- <FormItem>- <FormLabel className="mb-2 font-medium">- </FormLabel>- <FormControl>- <Input- {...field}- type="email"- placeholder="[email protected]"- />- </FormControl>- <FormMessage />- </FormItem>- )}+ render={({ field }) => {+ return (+ <FormItem>+ <FormLabel className="mb-2 font-medium">+ </FormLabel>+ <FormControl>+ <Input+ {...field}+ type="email"+ placeholder="[email protected]"+ />+ </FormControl>+ <FormMessage />+ </FormItem>+ );+ }}/><FormFieldcontrol={form.control}name="emailFieldIsVisible"- render={({ field }) => (- <FormItem>- <div className="flex items-center gap-2">- <FormControl>- <Switch- checked={field.value}- onCheckedChange={field.onChange}- id="emailFieldIsVisible"- data-testid={`sellerEmailDialogFieldVisibilitySwitch`}- aria-label={`Show the 'Email' field in the PDF`}+ render={({ field }) => {+ return (+ <FormItem>+ <div className="flex items-center gap-2">+ <FormControl>+ <Switch+ checked={field.value}+ onCheckedChange={field.onChange}+ id="emailFieldIsVisible"+ data-testid={`sellerEmailDialogFieldVisibilitySwitch`}+ aria-label={`Show the 'Email' field in the PDF`}+ />+ </FormControl>+ <CustomTooltip+ trigger={+ <Label htmlFor="emailFieldIsVisible">+ Show Seller Email in PDF+ </Label>+ }+ content='Show the "Email" field in the PDF'+ className="z-[1000]"/>- </FormControl>- <CustomTooltip- trigger={- <Label htmlFor="emailFieldIsVisible">- Show Seller Email in PDF- </Label>- }- content='Show the "Email" field in the PDF'- className="z-[1000]"- />- </div>- </FormItem>- )}+ </div>+ </FormItem>+ );+ }}/></div>@@ -512,46 +566,50 @@ export function SellerDialog({<FormFieldcontrol={form.control}name="accountNumber"- render={({ field }) => (- <FormItem>- <FormLabel className="mb-2 font-medium">- Account Number- </FormLabel>- <FormControl>- <Textarea- {...field}- rows={3}- placeholder="Enter account number"- />- </FormControl>- <FormMessage />- </FormItem>- )}+ render={({ field }) => {+ return (+ <FormItem>+ <FormLabel className="mb-2 font-medium">+ Account Number+ </FormLabel>+ <FormControl>+ <Textarea+ {...field}+ rows={3}+ placeholder="Enter account number"+ />+ </FormControl>+ <FormMessage />+ </FormItem>+ );+ }}/><FormFieldcontrol={form.control}name="accountNumberFieldIsVisible"- render={({ field }) => (- <FormItem>- <div className="flex items-center gap-2">- <Switch- checked={field.value}- onCheckedChange={field.onChange}- id="accountNumberFieldIsVisible"- aria-label={`Show the 'Account Number' field in the PDF`}- />- <CustomTooltip- trigger={- <Label htmlFor="accountNumberFieldIsVisible">- Show Seller Account Number in PDF- </Label>- }- content='Show the "Account Number" field in the PDF'- className="z-[1000]"- />- </div>- </FormItem>- )}+ render={({ field }) => {+ return (+ <FormItem>+ <div className="flex items-center gap-2">+ <Switch+ checked={field.value}+ onCheckedChange={field.onChange}+ id="accountNumberFieldIsVisible"+ aria-label={`Show the 'Account Number' field in the PDF`}+ />+ <CustomTooltip+ trigger={+ <Label htmlFor="accountNumberFieldIsVisible">+ Show Seller Account Number in PDF+ </Label>+ }+ content='Show the "Account Number" field in the PDF'+ className="z-[1000]"+ />+ </div>+ </FormItem>+ );+ }}/></div>@@ -560,46 +618,50 @@ export function SellerDialog({<FormFieldcontrol={form.control}name="swiftBic"- render={({ field }) => (- <FormItem>- <FormLabel className="mb-2 font-medium">- SWIFT/BIC- </FormLabel>- <FormControl>- <Textarea- {...field}- rows={3}- placeholder="Enter SWIFT/BIC code"- />- </FormControl>- <FormMessage />- </FormItem>- )}+ render={({ field }) => {+ return (+ <FormItem>+ <FormLabel className="mb-2 font-medium">+ SWIFT/BIC+ </FormLabel>+ <FormControl>+ <Textarea+ {...field}+ rows={3}+ placeholder="Enter SWIFT/BIC code"+ />+ </FormControl>+ <FormMessage />+ </FormItem>+ );+ }}/><FormFieldcontrol={form.control}name="swiftBicFieldIsVisible"- render={({ field }) => (- <FormItem>- <div className="flex items-center gap-2">- <Switch- checked={field.value}- onCheckedChange={field.onChange}- id="swiftBicFieldIsVisible"- aria-label={`Show the 'SWIFT/BIC' field in the PDF`}- />- <CustomTooltip- trigger={- <Label htmlFor="swiftBicFieldIsVisible">- Show Seller SWIFT/BIC in PDF- </Label>- }- content='Show the "SWIFT/BIC" field in the PDF'- className="z-[1000]"- />- </div>- </FormItem>- )}+ render={({ field }) => {+ return (+ <FormItem>+ <div className="flex items-center gap-2">+ <Switch+ checked={field.value}+ onCheckedChange={field.onChange}+ id="swiftBicFieldIsVisible"+ aria-label={`Show the 'SWIFT/BIC' field in the PDF`}+ />+ <CustomTooltip+ trigger={+ <Label htmlFor="swiftBicFieldIsVisible">+ Show Seller SWIFT/BIC in PDF+ </Label>+ }+ content='Show the "SWIFT/BIC" field in the PDF'+ className="z-[1000]"+ />+ </div>+ </FormItem>+ );+ }}/></div>@@ -608,57 +670,61 @@ export function SellerDialog({<FormFieldcontrol={form.control}name="notes"- render={({ field }) => (- <FormItem>- <FormLabel className="mb-2 font-medium">- Notes- </FormLabel>- <FormControl>- <Textarea- {...field}- rows={3}- placeholder="Enter notes (max 750 characters)"- maxLength={750}- />- </FormControl>- <FormMessage />- </FormItem>- )}+ render={({ field }) => {+ return (+ <FormItem>+ <FormLabel className="mb-2 font-medium">+ Notes+ </FormLabel>+ <FormControl>+ <Textarea+ {...field}+ rows={3}+ placeholder="Enter notes (max 750 characters)"+ maxLength={750}+ />+ </FormControl>+ <FormMessage />+ </FormItem>+ );+ }}/><FormFieldcontrol={form.control}name="notesFieldIsVisible"- render={({ field }) => (- <FormItem>- <div className="flex items-center gap-2">- <FormControl>- <Switch- checked={field.value}- onCheckedChange={field.onChange}- id="notes-field-visibility"- data-testid={`sellerNotesDialogFieldVisibilitySwitch`}- aria-label={`Show the 'Notes' field in the PDF`}+ render={({ field }) => {+ return (+ <FormItem>+ <div className="flex items-center gap-2">+ <FormControl>+ <Switch+ checked={field.value}+ onCheckedChange={field.onChange}+ id="notes-field-visibility"+ data-testid={`sellerNotesDialogFieldVisibilitySwitch`}+ aria-label={`Show the 'Notes' field in the PDF`}+ />+ </FormControl>+ <CustomTooltip+ trigger={+ <Label htmlFor="notes-field-visibility">+ Show Seller Notes in PDF+ </Label>+ }+ content="Show the notes field in the PDF"+ className="z-[1000]"/>- </FormControl>- <CustomTooltip- trigger={- <Label htmlFor="notes-field-visibility">- Show Seller Notes in PDF- </Label>- }- content="Show the notes field in the PDF"- className="z-[1000]"- />- </div>- </FormItem>- )}+ </div>+ </FormItem>+ );+ }}/></div></form></Form>{/* Apply to Current Invoice switch remains at the bottom */}- {!isEditMode && (+ {!isEditMode ? (<div className="mt-4 flex flex-col gap-1 border-t pt-4"><div className="flex items-center gap-2"><Switch@@ -679,7 +745,7 @@ export function SellerDialog({generated PDF.</span></div>- )}+ ) : null}</div><DialogFooter className="border-border border-t px-6 py-4"><Button@@ -690,7 +756,9 @@ export function SellerDialog({// If there are unsaved changes (isDirty), opens the confirmation dialog.// Otherwise, closes the dialog immediately.if (isDirty) {- setPendingDiscardAction(() => closeDialog);+ setPendingDiscardAction(() => {+ return closeDialog;+ });setIsConfirmDiscardDialogOpen(true);return;}diff --git a/src/app/(app)/components/invoice-form/sections/components/seller/seller-management.tsx b/src/app/(app)/components/invoice-form/sections/components/seller/seller-management.tsxindex fc059b1..b8aa254 100644--- a/src/app/(app)/components/invoice-form/sections/components/seller/seller-management.tsx+++ b/src/app/(app)/components/invoice-form/sections/components/seller/seller-management.tsx@@ -1,5 +1,5 @@+import * as Sentry from "@sentry/nextjs";import { Plus, Trash2, Pencil, AlertCircleIcon } from "lucide-react";-import {useId,useState,@@ -7,9 +7,21 @@ import {type Dispatch,type SetStateAction,} from "react";-import { CustomTooltip } from "@/components/ui/tooltip";-import { SelectNative } from "@/components/ui/select-native";-import { Button } from "@/components/ui/button";+import type { UseFormSetValue } from "react-hook-form";+import { toast } from "sonner";++import { SellerDialog } from "@/app/(app)/components/invoice-form/sections/components/seller/seller-dialog";+import {+ getAppStorageItem,+ setAppStorageItem,+} from "@/app/(app)/utils/app-local-storage";+import { DEFAULT_SELLER_DATA } from "@/app/constants";+import {+ SELLERS_LOCAL_STORAGE_KEY,+ sellerSchema,+ type InvoiceData,+ type SellerData,+} from "@/app/schema";import {AlertDialog,AlertDialogAction,@@ -20,18 +32,13 @@ import {AlertDialogHeader,AlertDialogTitle,} from "@/components/ui/alert-dialog";-import type { UseFormSetValue } from "react-hook-form";-import { sellerSchema, type InvoiceData, type SellerData } from "@/app/schema";-import { toast } from "sonner";-import { cn } from "@/lib/utils";+import { Button } from "@/components/ui/button";import { Label } from "@/components/ui/label";-import { isLocalStorageAvailable } from "@/lib/check-local-storage";+import { SelectNative } from "@/components/ui/select-native";+import { CustomTooltip } from "@/components/ui/tooltip";import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";-import * as Sentry from "@sentry/nextjs";-import { DEFAULT_SELLER_DATA } from "@/app/constants";-import { SellerDialog } from "@/app/(app)/components/invoice-form/sections/components/seller/seller-dialog";--export const SELLERS_LOCAL_STORAGE_KEY = "EASY_INVOICE_PDF_SELLERS";+import { useIsLocalStorageAvailable } from "@/lib/use-is-local-storage-available";+import { cn } from "@/lib/utils";interface SellerManagementProps {setValue: UseFormSetValue<InvoiceData>;@@ -83,12 +90,14 @@ export function SellerManagement({const sellerSelectId = useId();+ const isLocalStorageAvailable = useIsLocalStorageAvailable();+const isEditMode = Boolean(editingSeller);// Load sellers from localStorage on component mountuseEffect(() => {try {- const savedSellers = localStorage.getItem(SELLERS_LOCAL_STORAGE_KEY);+ const savedSellers = getAppStorageItem(SELLERS_LOCAL_STORAGE_KEY);const parsedSellers: unknown = savedSellers? JSON.parse(savedSellers): [];@@ -126,16 +135,17 @@ export function SellerManagement({),);- localStorage.setItem(- SELLERS_LOCAL_STORAGE_KEY,- JSON.stringify(validSellers),- );+ setAppStorageItem({+ key: SELLERS_LOCAL_STORAGE_KEY,+ value: JSON.stringify(validSellers),+ });}const selectedSeller = validSellers.find((seller: SellerData) => {return seller?.id === invoiceData?.seller?.id;});+ // oxlint-disable-next-line react/set-state-in-effect react-you-might-not-need-an-effect/no-adjust-state-on-prop-change -- localStorage is an external system: the saved sellers cannot be derived during render, they have to be read after mountsetSellersSelectOptions(validSellers);setSelectedSellerId(selectedSeller?.id ?? "");} catch (error) {@@ -162,10 +172,22 @@ export function SellerManagement({const newSellers = [...sellersSelectOptions, newSellerWithId];// Save to localStorage- localStorage.setItem(- SELLERS_LOCAL_STORAGE_KEY,- JSON.stringify(newSellers),- );+ const persisted = setAppStorageItem({+ key: SELLERS_LOCAL_STORAGE_KEY,+ value: JSON.stringify(newSellers),+ });++ // Nothing to show the user later if the list could not be saved, so stop here+ // rather than reporting a success the next page load would contradict.+ if (!persisted) {+ showSellerStorageErrorToast({+ message: "Failed to add seller",+ id: "add_seller_error_toast",+ isMobile,+ });++ return;+ }// Update the sellers statesetSellersSelectOptions(newSellers);@@ -206,14 +228,24 @@ export function SellerManagement({// Update sellers when editedconst handleSellerEdit = (editedSeller: SellerData) => {try {- const updatedSellers = sellersSelectOptions.map((seller) =>- seller.id === editedSeller.id ? editedSeller : seller,- );+ const updatedSellers = sellersSelectOptions.map((seller) => {+ return seller.id === editedSeller.id ? editedSeller : seller;+ });- localStorage.setItem(- SELLERS_LOCAL_STORAGE_KEY,- JSON.stringify(updatedSellers),- );+ const persisted = setAppStorageItem({+ key: SELLERS_LOCAL_STORAGE_KEY,+ value: JSON.stringify(updatedSellers),+ });++ if (!persisted) {+ showSellerStorageErrorToast({+ message: "Failed to edit seller",+ id: "edit_seller_error_toast",+ isMobile,+ });++ return;+ }setSellersSelectOptions(updatedSellers);setValue("seller", editedSeller);@@ -248,9 +280,9 @@ export function SellerManagement({if (id) {setSelectedSellerId(id);- const selectedSeller = sellersSelectOptions.find(- (seller) => seller.id === id,- );+ const selectedSeller = sellersSelectOptions.find((seller) => {+ return seller.id === id;+ });if (selectedSeller) {setValue("seller", selectedSeller);@@ -278,17 +310,26 @@ export function SellerManagement({const handleDeleteSeller = () => {try {- setSellersSelectOptions((prevSellers) => {- const updatedSellers = prevSellers.filter(- (seller) => seller.id !== selectedSellerId,- );+ const updatedSellers = sellersSelectOptions.filter((seller) => {+ return seller.id !== selectedSellerId;+ });- localStorage.setItem(- SELLERS_LOCAL_STORAGE_KEY,- JSON.stringify(updatedSellers),- );- return updatedSellers;+ const persisted = setAppStorageItem({+ key: SELLERS_LOCAL_STORAGE_KEY,+ value: JSON.stringify(updatedSellers),});++ if (!persisted) {+ showSellerStorageErrorToast({+ message: "Failed to delete seller",+ id: "delete_seller_error_toast",+ isMobile,+ });++ return;+ }++ setSellersSelectOptions(updatedSellers);// Clear the selected seller indexsetSelectedSellerId("");// Clear the seller from the form if it was selected@@ -319,9 +360,9 @@ export function SellerManagement({}};- const activeSeller = sellersSelectOptions.find(- (seller) => seller.id === selectedSellerId,- );+ const activeSeller = sellersSelectOptions.find((seller) => {+ return seller.id === selectedSellerId;+ });const hasSellers = sellersSelectOptions.length > 0;@@ -354,11 +395,13 @@ export function SellerManagement({title={activeSeller?.name}><option value="">No seller selected (default)</option>- {sellersSelectOptions.map((seller) => (- <option key={seller.id} value={seller.id}>- {seller.name}- </option>- ))}+ {sellersSelectOptions.map((seller) => {+ return (+ <option key={seller.id} value={seller.id}>+ {seller.name}+ </option>+ );+ })}</SelectNative>{selectedSellerId ? (@@ -522,3 +565,31 @@ export function SellerManagement({</>);}++interface ShowSellerStorageErrorToastOptions {+ /** What the user was trying to do, e.g. "Failed to add seller". */+ message: string;+ /** Stable toast id, so repeated failures replace each other instead of stacking. */+ id: string;+ /** Mobile shows toasts at the top, desktop at the bottom right. */+ isMobile: boolean;+}++/**+ * Tells the user their seller list could not be saved.+ *+ * A rejected write is not an application error — it is a full or disabled store — so it+ * is surfaced to the user and deliberately not reported to Sentry.+ */+function showSellerStorageErrorToast({+ message,+ id,+ isMobile,+}: ShowSellerStorageErrorToastOptions) {+ toast.error(message, {+ id,+ description: "Please try again",+ closeButton: true,+ position: isMobile ? "top-center" : "bottom-right",+ });+}diff --git a/src/app/(app)/components/invoice-form/sections/components/stale-dates-banner.tsx b/src/app/(app)/components/invoice-form/sections/components/stale-dates-banner.tsxnew file mode 100644index 0000000..61ea816--- /dev/null+++ b/src/app/(app)/components/invoice-form/sections/components/stale-dates-banner.tsx@@ -0,0 +1,231 @@+import dayjs from "dayjs";+import { AlertTriangle, RefreshCw } from "lucide-react";+import type { UseFormSetValue } from "react-hook-form";+import { toast } from "sonner";++import { formatDateWithLocale } from "@/app/(app)/utils/format-date-with-locale";+import {+ getCurrentMonthAndYear,+ isServicePeriodStartInCurrentMonth,+} from "@/app/(app)/utils/format-service-period";+import type { InvoiceData, SupportedLanguages } from "@/app/schema";+import { Button } from "@/components/ui/button";++interface StaleDatesBannerProps {+ dateOfIssue: string;+ dateOfService: string;+ dateOfServiceStart: string;+ invoiceNumberValue: string;+ paymentDue: string;+ selectedDateFormat: string;+ /** Invoice PDF language — the dates in the banner are formatted in it. */+ language: SupportedLanguages;+ setValue: UseFormSetValue<InvoiceData>;+ isMobile: boolean;+}++interface StaleItem {+ label: string;+ oldValue: string;+ newValue: string;+ hint: string;+}++/**+ * Displays a helper (banner) component that detects and allows updating stale invoice dates.+ *+ * This component checks if the invoice dates (date of issue, service period start/end,+ * payment due) and invoice number are outdated compared to the current date. If any are stale,+ * it displays a banner with a table showing the old vs new values and provides a button to update all dates at once.+ *+ * Dates are rendered in the invoice PDF's language, so the preview of the change+ * matches what the generated PDF will say.+ */+export function StaleDatesBanner({+ dateOfIssue,+ dateOfService,+ dateOfServiceStart,+ invoiceNumberValue,+ paymentDue,+ selectedDateFormat,+ language,+ setValue,+ isMobile,+}: StaleDatesBannerProps) {+ const formatDate = (date: dayjs.ConfigType) => {+ return formatDateWithLocale({ date, selectedDateFormat, language });+ };++ const isDateOfIssueStale = !dayjs(dateOfIssue).isSame(dayjs(), "day");+ const isDateOfServiceStale = !dayjs(dateOfService).isSame(+ dayjs().endOf("month"),+ "day",+ );+ const isDateOfServiceStartStale =+ !!dateOfServiceStart &&+ !isServicePeriodStartInCurrentMonth(dateOfServiceStart);+ const currentMonthAndYear = getCurrentMonthAndYear();+ const extractedMonthYear = /(\d{2}-\d{4})/.exec(invoiceNumberValue)?.[1];+ const isInvoiceNumberStale = extractedMonthYear !== currentMonthAndYear;++ /**+ * Checks if the payment due date is stale (outdated).+ * A payment due date is considered stale if:+ * - It's not set (empty/undefined), OR+ * - It doesn't match the expected date (14 days after the date of issue)+ */+ const isPaymentDueStale =+ !paymentDue ||+ !dayjs(paymentDue).isSame(dayjs(dateOfIssue).add(14, "days"), "day");++ const targetToday = formatDate(dayjs());+ const targetEndOfMonth = formatDate(dayjs().endOf("month"));+ const targetStartOfMonth = formatDate(dayjs().startOf("month"));+ const targetPaymentDue = formatDate(dayjs().add(14, "days"));++ const targetInvoiceNumber = `1/${currentMonthAndYear}`;++ const fallbackValue = "(not set)";++ /**+ * Array of items to check for staleness, in the order they are listed in the+ * banner. That order mirrors the form itself — invoice number, date of issue,+ * service period start, service period end, payment due — so scanning the+ * banner and scanning the fields walk the invoice the same way, and the+ * service period reads as a range rather than backwards.+ *+ * Each item is either false (not stale) or an object containing:+ * - label: Display name of the field+ * - oldValue: Current/outdated value+ * - newValue: Suggested updated value+ * - hint: Description of what the new value represents+ */+ const ITEMS: (boolean | StaleItem)[] = [+ isInvoiceNumberStale && {+ label: "Invoice number",+ oldValue: invoiceNumberValue ? invoiceNumberValue : fallbackValue,+ newValue: targetInvoiceNumber,+ hint: "current month",+ },+ isDateOfIssueStale && {+ label: "Date of issue",+ oldValue: dateOfIssue ? formatDate(dateOfIssue) : fallbackValue,+ newValue: targetToday,+ hint: "today",+ },+ isDateOfServiceStartStale && {+ label: "Service period start",+ oldValue: dateOfServiceStart+ ? formatDate(dateOfServiceStart)+ : fallbackValue,+ newValue: targetStartOfMonth,+ hint: "start of current month",+ },+ isDateOfServiceStale && {+ label: "Service period end",+ oldValue: dateOfService ? formatDate(dateOfService) : fallbackValue,+ newValue: targetEndOfMonth,+ hint: "end of current month",+ },+ isPaymentDueStale && {+ label: "Payment due",+ oldValue: paymentDue ? formatDate(paymentDue) : fallbackValue,+ newValue: targetPaymentDue,+ hint: "date of issue + 14 days",+ },+ ];++ const staleItems = ITEMS.filter(Boolean) as StaleItem[];++ return (+ <div+ className="rounded-md border border-amber-200 bg-amber-50/90 px-3 py-4 shadow-sm shadow-amber-200/50 duration-300 animate-in fade-in slide-in-from-bottom-2"+ role="region"+ aria-live="polite"+ data-testid="out-of-date-dates-helper"+ >+ <div className="mb-3 flex items-center gap-1.5 text-xs font-medium text-amber-800">+ <AlertTriangle className="size-3.5 shrink-0 text-amber-600" />+ <span>+ {staleItems.length}{" "}+ {staleItems.length === 1 ? "field is" : "fields are"} out of date+ </span>+ </div>++ <table className="w-full border-collapse overflow-hidden rounded border border-amber-300 text-xs">+ <thead>+ <tr className="border-b border-amber-300 bg-amber-100/60 text-left text-amber-800">+ <th className="w-[65px] max-w-[65px] px-2.5 py-1.5 font-semibold">+ Field+ </th>+ <th className="px-2.5 py-1.5 font-semibold">Change</th>+ </tr>+ </thead>++ <tbody>+ {staleItems.map((item) => {+ return (+ <tr+ key={item.label}+ className="border-b border-amber-300 last:border-b-0"+ >+ <td className="w-[65px] max-w-[65px] px-2.5 py-1.5 text-amber-800">+ {item.label}+ </td>++ <td className="text-pretty px-2.5 py-1.5 pr-0">+ <span className="bg-red-100 text-amber-800 line-through decoration-amber-700/50">+ {item.oldValue}+ </span>+ <span className="mx-1 text-amber-700">→</span>+ <span className="bg-green-200 font-semibold text-green-800">+ {item.newValue}+ </span>+ {item.hint ? (+ <span className="ml-1 font-normal text-green-700">+ ({item.hint})+ </span>+ ) : null}+ </td>+ </tr>+ );+ })}+ </tbody>+ </table>++ <Button+ type="button"+ size="sm"+ className="mt-3.5 gap-1.5 bg-amber-600 text-white shadow-sm hover:bg-amber-600/95"+ onClick={() => {+ const today = dayjs().format("YYYY-MM-DD");++ const firstDayOfCurrentMonth = dayjs()+ .startOf("month")+ .format("YYYY-MM-DD");+ const lastDayOfCurrentMonth = dayjs()+ .endOf("month")+ .format("YYYY-MM-DD");++ setValue("dateOfServiceStart", firstDayOfCurrentMonth);+ setValue("dateOfService", lastDayOfCurrentMonth);+ setValue("dateOfIssue", today);+ setValue("invoiceNumberObject.value", targetInvoiceNumber);++ const newPaymentDue = dayjs(today)+ .add(14, "days")+ .format("YYYY-MM-DD");++ setValue("paymentDue", newPaymentDue);++ toast.success("All dates updated successfully", {+ position: isMobile ? "top-center" : "bottom-right",+ });+ }}+ >+ <RefreshCw className="size-3.5" />+ Update All Dates+ </Button>+ </div>+ );+}diff --git a/src/app/(app)/components/invoice-form/sections/general-information.tsx b/src/app/(app)/components/invoice-form/sections/general-information.tsxindex c27078e..259f707 100644--- a/src/app/(app)/components/invoice-form/sections/general-information.tsx+++ b/src/app/(app)/components/invoice-form/sections/general-information.tsx@@ -1,3 +1,15 @@+import dayjs from "dayjs";+import { InfoIcon, Upload, X } from "lucide-react";+import { memo, useCallback, useRef } from "react";+import {+ type Control,+ Controller,+ type FieldErrors,+ type UseFormSetValue,+ useWatch,+} from "react-hook-form";+import { toast } from "sonner";+import {AlertIcon,ErrorMessage,@@ -7,7 +19,9 @@ import {getDefaultInvoiceNumberLabel,INVOICE_PDF_TRANSLATIONS,} from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import { formatTodayWithLocale } from "@/app/(app)/utils/format-date-with-locale";import {+ getCurrentMonthAndYear,isFirstDayOfMonth,isServicePeriodStartInCurrentMonth,} from "@/app/(app)/utils/format-service-period";@@ -22,7 +36,6 @@ import {TEMPLATE_TO_LABEL,} from "@/app/schema";import { CurrencyCombobox } from "@/components/currency-combobox";-import { Button } from "@/components/ui/button";import { ButtonHelper } from "@/components/ui/button-helper";import { Input } from "@/components/ui/input";import { InputHelperMessage } from "@/components/ui/input-helper-message";@@ -32,19 +45,9 @@ import { Switch } from "@/components/ui/switch";import { Textarea } from "@/components/ui/textarea";import { CustomTooltip } from "@/components/ui/tooltip";import { cn } from "@/lib/utils";-import dayjs from "dayjs";-import { AlertTriangle, InfoIcon, RefreshCw, Upload, X } from "lucide-react";-import { memo, useCallback, useRef } from "react";-import {- type Control,- Controller,- type FieldErrors,- type UseFormSetValue,- useWatch,-} from "react-hook-form";-import { toast } from "sonner";-const CURRENT_MONTH_AND_YEAR = dayjs().format("MM-YYYY");+import { convertFileToBase64, validateImageSize } from "../utils/logo-upload";+import { StaleDatesBanner } from "./components/stale-dates-banner";interface GeneralInformationProps {control: Control<InvoiceData>;@@ -125,7 +128,7 @@ export const GeneralInformation = memo(function GeneralInformation({)?.[1];const isInvoiceNumberInCurrentMonth =- extractInvoiceMonthAndYear === CURRENT_MONTH_AND_YEAR;+ extractInvoiceMonthAndYear === getCurrentMonthAndYear();// Logo upload handlersconst handleLogoUpload = useCallback(@@ -210,62 +213,67 @@ export const GeneralInformation = memo(function GeneralInformation({<Controllername="template"control={control}- render={({ field }) => (- <SelectNative- {...field}- id={`template`}- className={cn("block", inputErrorClassName(!!errors.template))}- onChange={(e) => {- const newTemplate =- e.target.value === "stripe" ? "stripe" : "default";-- field.onChange(e);-- // When the user changes the invoice template, automatically update the invoice number label- // so it matches the default convention for the selected template and current language.- setValue(- "invoiceNumberObject.label",- getDefaultInvoiceNumberLabel(language, newTemplate),- );+ render={({ field }) => {+ return (+ <SelectNative+ {...field}+ id={`template`}+ className={cn(+ "block",+ inputErrorClassName(!!errors.template),+ )}+ onChange={(e) => {+ const newTemplate =+ e.target.value === "stripe" ? "stripe" : "default";- // Handles template-specific form updates for better UX+ field.onChange(e);- if (newTemplate === "stripe") {- // Set date format to "MMMM D, YYYY" when template is Stripe- setValue("dateFormat", STRIPE_DEFAULT_DATE_FORMAT);+ // When the user changes the invoice template, automatically update the invoice number label+ // so it matches the default convention for the selected template and current language.+ setValue(+ "invoiceNumberObject.label",+ getDefaultInvoiceNumberLabel(language, newTemplate),+ );- // Set unit field to be HIDDEN by default for Stripe template (matches stripe template behaviour)- setValue("items.0.unitFieldIsVisible", false);+ // Handles template-specific form updates for better UX- // Set service period field to be VISIBLE for Stripe template (for backwards compatibility)- setValue("servicePeriodFieldIsVisible", true);- } else {- // DEFAULT TEMPLATE+ if (newTemplate === "stripe") {+ // Set date format to "MMMM D, YYYY" when template is Stripe+ setValue("dateFormat", STRIPE_DEFAULT_DATE_FORMAT);- // Clear Stripe-specific fields when not using Stripe template- if (errors.stripePayOnlineUrl) {- setValue("stripePayOnlineUrl", "");- }+ // Set unit field to be HIDDEN by default for Stripe template (matches stripe template behaviour)+ setValue("items.0.unitFieldIsVisible", false);- // Set date format to "YYYY-MM-DD" when template is default- setValue("dateFormat", DEFAULT_DATE_FORMAT);+ // Set service period field to be VISIBLE for Stripe template (for backwards compatibility)+ setValue("servicePeriodFieldIsVisible", true);+ } else {+ // DEFAULT TEMPLATE- // Set unit field to be VISIBLE for default template- setValue("items.0.unitFieldIsVisible", true);- }- }}- >- {SUPPORTED_TEMPLATES.map((template) => {- const templateLabel = TEMPLATE_TO_LABEL[template];+ // Clear Stripe-specific fields when not using Stripe template+ if (errors.stripePayOnlineUrl) {+ setValue("stripePayOnlineUrl", "");+ }- return (- <option key={template} value={template}>- {templateLabel}- </option>- );- })}- </SelectNative>- )}+ // Set date format to "YYYY-MM-DD" when template is default+ setValue("dateFormat", DEFAULT_DATE_FORMAT);++ // Set unit field to be VISIBLE for default template+ setValue("items.0.unitFieldIsVisible", true);+ }+ }}+ >+ {SUPPORTED_TEMPLATES.map((template) => {+ const templateLabel = TEMPLATE_TO_LABEL[template];++ return (+ <option key={template} value={template}>+ {templateLabel}+ </option>+ );+ })}+ </SelectNative>+ );+ }}/>{errors.template ? (<ErrorMessage>{errors.template.message}</ErrorMessage>@@ -284,72 +292,78 @@ export const GeneralInformation = memo(function GeneralInformation({<Controllername="language"control={control}- render={({ field }) => (- <SelectNative- {...field}- id={`language`}- className={cn("block", inputErrorClassName(!!errors.language))}- onChange={(e) => {- field.onChange(e);+ render={({ field }) => {+ return (+ <SelectNative+ {...field}+ id={`language`}+ className={cn(+ "block",+ inputErrorClassName(!!errors.language),+ )}+ onChange={(e) => {+ field.onChange(e);- // IMPORTANT: for BETTER USER EXPERIENCE, when switching language, we update the invoice number and labels to the new language+ // IMPORTANT: for BETTER USER EXPERIENCE, when switching language, we update the invoice number and labels to the new language- // Update INVOICE NUMBER and LABELS when language changes- const newLanguage = e.target- .value as keyof typeof INVOICE_PDF_TRANSLATIONS;+ // Update INVOICE NUMBER and LABELS when language changes+ const newLanguage = e.target+ .value as keyof typeof INVOICE_PDF_TRANSLATIONS;- // we need to keep the invoice number suffix (e.g. 1/MM-YYYY) for better user experience, when switching language- setValue(- "invoiceNumberObject.label",- getDefaultInvoiceNumberLabel(newLanguage, template),- );- setValue("invoiceNumberObject.value", invoiceNumberValue);+ // we need to keep the invoice number suffix (e.g. 1/MM-YYYY) for better user experience, when switching language+ setValue(+ "invoiceNumberObject.label",+ getDefaultInvoiceNumberLabel(newLanguage, template),+ );+ setValue("invoiceNumberObject.value", invoiceNumberValue);- // Update SELLER VAT NO (Account Number) LABEL TEXT when language changes- setValue(- "seller.vatNoLabelText",- INVOICE_PDF_TRANSLATIONS[newLanguage].seller.vatNo,- );+ // Update SELLER VAT NO (Account Number) LABEL TEXT when language changes+ setValue(+ "seller.vatNoLabelText",+ INVOICE_PDF_TRANSLATIONS[newLanguage].seller.vatNo,+ );- // Update BUYER VAT NO (Account Number) LABEL TEXT when language changes- setValue(- "buyer.vatNoLabelText",- INVOICE_PDF_TRANSLATIONS[newLanguage].buyer.vatNo,- );+ // Update BUYER VAT NO (Account Number) LABEL TEXT when language changes+ setValue(+ "buyer.vatNoLabelText",+ INVOICE_PDF_TRANSLATIONS[newLanguage].buyer.vatNo,+ );- const newTranslation =- INVOICE_PDF_TRANSLATIONS[newLanguage].invoiceItemsTable.vat;+ const newTranslation =+ INVOICE_PDF_TRANSLATIONS[newLanguage].invoiceItemsTable+ .vat;- // Update TAX LABEL TEXT (VAT/GST/etc.) when language changes- // This ensures the tax column header in the invoice items table- // displays the correct translation for the selected language- setValue("taxLabelText", newTranslation);+ // Update TAX LABEL TEXT (VAT/GST/etc.) when language changes+ // This ensures the tax column header in the invoice items table+ // displays the correct translation for the selected language+ setValue("taxLabelText", newTranslation);- setValue(- "servicePeriodLabelText",- INVOICE_PDF_TRANSLATIONS[newLanguage].servicePeriod,- );- setValue(- "dateOfServiceLabelText",- INVOICE_PDF_TRANSLATIONS[newLanguage].dateOfService,- );- }}- >- {SUPPORTED_LANGUAGES.map((lang) => {- const languageName = LANGUAGE_TO_LABEL[lang];+ setValue(+ "servicePeriodLabelText",+ INVOICE_PDF_TRANSLATIONS[newLanguage].servicePeriod,+ );+ setValue(+ "dateOfServiceLabelText",+ INVOICE_PDF_TRANSLATIONS[newLanguage].dateOfService,+ );+ }}+ >+ {SUPPORTED_LANGUAGES.map((lang) => {+ const languageName = LANGUAGE_TO_LABEL[lang];- if (!languageName) {- return null;- }+ if (!languageName) {+ return null;+ }- return (- <option key={lang} value={lang}>- {languageName}- </option>- );- })}- </SelectNative>- )}+ return (+ <option key={lang} value={lang}>+ {languageName}+ </option>+ );+ })}+ </SelectNative>+ );+ }}/>{errors.language ? (<ErrorMessage>{errors.language.message}</ErrorMessage>@@ -368,14 +382,16 @@ export const GeneralInformation = memo(function GeneralInformation({<Controllername="currency"control={control}- render={({ field }) => (- <CurrencyCombobox- id={`currency`}- value={field.value}- onChange={field.onChange}- hasError={!!errors.currency}- />- )}+ render={({ field }) => {+ return (+ <CurrencyCombobox+ id={`currency`}+ value={field.value}+ onChange={field.onChange}+ hasError={!!errors.currency}+ />+ );+ }}/>{errors.currency ? (<ErrorMessage>{errors.currency.message}</ErrorMessage>@@ -394,27 +410,32 @@ export const GeneralInformation = memo(function GeneralInformation({<Controllername="dateFormat"control={control}- render={({ field }) => (- <SelectNative- {...field}- id={`dateFormat`}- className={cn(- "block",- inputErrorClassName(!!errors.dateFormat),- )}- >- {SUPPORTED_DATE_FORMATS.map((format) => {- const preview = dayjs().locale(language).format(format);- const isDefault = format === DEFAULT_DATE_FORMAT;-- return (- <option key={format} value={format}>- {format} ({preview}) {isDefault ? "(default)" : ""}- </option>- );- })}- </SelectNative>- )}+ render={({ field }) => {+ return (+ <SelectNative+ {...field}+ id={`dateFormat`}+ className={cn(+ "block",+ inputErrorClassName(!!errors.dateFormat),+ )}+ >+ {SUPPORTED_DATE_FORMATS.map((format) => {+ const preview = formatTodayWithLocale({+ selectedDateFormat: format,+ language,+ });+ const isDefault = format === DEFAULT_DATE_FORMAT;++ return (+ <option key={format} value={format}>+ {format} ({preview}) {isDefault ? "(default)" : ""}+ </option>+ );+ })}+ </SelectNative>+ );+ }}/>{errors.dateFormat ? (@@ -437,18 +458,22 @@ export const GeneralInformation = memo(function GeneralInformation({<Controllername="invoiceNumberObject.label"control={control}- render={({ field }) => (- <Input- {...field}- type="text"- id="invoiceNumberLabel"- placeholder="Enter invoice number label"- className={cn(- "mt-1 block w-full",- inputErrorClassName(!!errors.invoiceNumberObject?.label),- )}- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ type="text"+ id="invoiceNumberLabel"+ placeholder="Enter invoice number label"+ className={cn(+ "mt-1 block w-full",+ inputErrorClassName(+ !!errors.invoiceNumberObject?.label,+ ),+ )}+ />+ );+ }}/>{errors.invoiceNumberObject?.label ? (<ErrorMessage>@@ -456,20 +481,20 @@ export const GeneralInformation = memo(function GeneralInformation({</ErrorMessage>) : null}{!isDefaultInvoiceNumberLabel &&- !errors.invoiceNumberObject?.label && (- <InputHelperMessage>- <ButtonHelper- onClick={() => {- setValue(- "invoiceNumberObject.label",- defaultInvoiceNumberLabel,- );- }}- >- Reset to default ("{defaultInvoiceNumberLabel}")- </ButtonHelper>- </InputHelperMessage>- )}+ !errors.invoiceNumberObject?.label ? (+ <InputHelperMessage>+ <ButtonHelper+ onClick={() => {+ setValue(+ "invoiceNumberObject.label",+ defaultInvoiceNumberLabel,+ );+ }}+ >+ Reset to default ("{defaultInvoiceNumberLabel}")+ </ButtonHelper>+ </InputHelperMessage>+ ) : null}</div><div>@@ -477,18 +502,22 @@ export const GeneralInformation = memo(function GeneralInformation({<Controllername="invoiceNumberObject.value"control={control}- render={({ field }) => (- <Input- {...field}- type="text"- id="invoiceNumberValue"- placeholder="Enter invoice number value"- className={cn(- "mt-1 block w-full",- inputErrorClassName(!!errors.invoiceNumberObject?.value),- )}- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ type="text"+ id="invoiceNumberValue"+ placeholder="Enter invoice number value"+ className={cn(+ "mt-1 block w-full",+ inputErrorClassName(+ !!errors.invoiceNumberObject?.value,+ ),+ )}+ />+ );+ }}/>{errors.invoiceNumberObject?.value ? (<ErrorMessage>@@ -497,14 +526,14 @@ export const GeneralInformation = memo(function GeneralInformation({) : null}{!isInvoiceNumberInCurrentMonth &&- !errors.invoiceNumberObject?.value && (- <InputHelperMessage>- <span className="flex items-center text-amber-800">- <AlertIcon />- Invoice number does not match current month- </span>- </InputHelperMessage>- )}+ !errors.invoiceNumberObject?.value ? (+ <InputHelperMessage>+ <span className="flex items-center text-amber-800">+ <AlertIcon />+ Invoice number does not match current month+ </span>+ </InputHelperMessage>+ ) : null}</div></div></fieldset>@@ -517,27 +546,29 @@ export const GeneralInformation = memo(function GeneralInformation({<Controllername="dateOfIssue"control={control}- render={({ field }) => (- <Input- {...field}- type="date"- id={`dateOfIssue`}- className={inputErrorClassName(!!errors.dateOfIssue)}- onChange={(e) => {- field.onChange(e);-- const newDate = e.target.value;-- // Automatically update payment due date to 14 days after the new date of issue for better UX- if (newDate) {- setValue(- "paymentDue",- dayjs(newDate).add(14, "days").format("YYYY-MM-DD"),- );- }- }}- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ type="date"+ id={`dateOfIssue`}+ className={inputErrorClassName(!!errors.dateOfIssue)}+ onChange={(e) => {+ field.onChange(e);++ const newDate = e.target.value;++ // Automatically update payment due date to 14 days after the new date of issue for better UX+ if (newDate) {+ setValue(+ "paymentDue",+ dayjs(newDate).add(14, "days").format("YYYY-MM-DD"),+ );+ }+ }}+ />+ );+ }}/>{errors.dateOfIssue ? (<ErrorMessage>{errors.dateOfIssue.message}</ErrorMessage>@@ -561,7 +592,7 @@ export const GeneralInformation = memo(function GeneralInformation({><span className="text-pretty">Set date of issue to today (- {dayjs().format(selectedDateFormat)})+ {formatTodayWithLocale({ selectedDateFormat, language })})</span></ButtonHelper></InputHelperMessage>@@ -579,17 +610,19 @@ export const GeneralInformation = memo(function GeneralInformation({<Controllername="servicePeriodFieldIsVisible"control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id="servicePeriodFieldIsVisible"- data-testid="servicePeriodFieldIsVisible"- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- aria-label='Show the "Service period" (Service period start and end) field in the PDF'- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id="servicePeriodFieldIsVisible"+ data-testid="servicePeriodFieldIsVisible"+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ aria-label='Show the "Service period" (Service period start and end) field in the PDF'+ />+ );+ }}/><CustomTooltiptrigger={@@ -611,27 +644,31 @@ export const GeneralInformation = memo(function GeneralInformation({<Controllername="dateOfServiceStart"control={control}- render={({ field }) => (- <Input- {...field}- type="date"- id="dateOfServiceStart"- className={inputErrorClassName(!!errors.dateOfServiceStart)}- onChange={(e) => {- field.onChange(e);-- const newServicePeriodStartDate = e.target.value;-- // auto-show "Service period" in PDF when start date is not first day of its month- if (- newServicePeriodStartDate &&- !isFirstDayOfMonth(newServicePeriodStartDate)- ) {- setValue("servicePeriodFieldIsVisible", true);- }- }}- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ type="date"+ id="dateOfServiceStart"+ className={inputErrorClassName(+ !!errors.dateOfServiceStart,+ )}+ onChange={(e) => {+ field.onChange(e);++ const newServicePeriodStartDate = e.target.value;++ // auto-show "Service period" in PDF when start date is not first day of its month+ if (+ newServicePeriodStartDate &&+ !isFirstDayOfMonth(newServicePeriodStartDate)+ ) {+ setValue("servicePeriodFieldIsVisible", true);+ }+ }}+ />+ );+ }}/>{errors.dateOfServiceStart ? (<ErrorMessage>{errors.dateOfServiceStart.message}</ErrorMessage>@@ -674,14 +711,16 @@ export const GeneralInformation = memo(function GeneralInformation({<Controllername="dateOfService"control={control}- render={({ field }) => (- <Input- {...field}- type="date"- id="dateOfService"- className={inputErrorClassName(!!errors.dateOfService)}- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ type="date"+ id="dateOfService"+ className={inputErrorClassName(!!errors.dateOfService)}+ />+ );+ }}/>{errors.dateOfService ? (<ErrorMessage>{errors.dateOfService.message}</ErrorMessage>@@ -708,18 +747,20 @@ export const GeneralInformation = memo(function GeneralInformation({<Controllername="servicePeriodLabelText"control={control}- render={({ field }) => (- <Textarea- {...field}- id="servicePeriodLabelText"- rows={2}- placeholder="Enter service period PDF label"- className={cn(- "mt-1 block w-full",- inputErrorClassName(!!errors.servicePeriodLabelText),- )}- />- )}+ render={({ field }) => {+ return (+ <Textarea+ {...field}+ id="servicePeriodLabelText"+ rows={2}+ placeholder="Enter service period PDF label"+ className={cn(+ "mt-1 block w-full",+ inputErrorClassName(!!errors.servicePeriodLabelText),+ )}+ />+ );+ }}/>{errors.servicePeriodLabelText ? (<ErrorMessage>@@ -751,17 +792,19 @@ export const GeneralInformation = memo(function GeneralInformation({<Controllername="dateOfServiceFieldIsVisible"control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id="dateOfServiceFieldIsVisible"- data-testid="dateOfServiceFieldIsVisible"- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- aria-label='Show the "Date of sales/of executing the service" field in the PDF'- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id="dateOfServiceFieldIsVisible"+ data-testid="dateOfServiceFieldIsVisible"+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ aria-label='Show the "Date of sales/of executing the service" field in the PDF'+ />+ );+ }}/><CustomTooltiptrigger={@@ -776,18 +819,20 @@ export const GeneralInformation = memo(function GeneralInformation({<Controllername="dateOfServiceLabelText"control={control}- render={({ field }) => (- <Textarea- {...field}- id="dateOfServiceLabelText"- rows={2}- placeholder="Enter date of sales (Service period end) PDF label"- className={cn(- "block w-full",- inputErrorClassName(!!errors.dateOfServiceLabelText),- )}- />- )}+ render={({ field }) => {+ return (+ <Textarea+ {...field}+ id="dateOfServiceLabelText"+ rows={2}+ placeholder="Enter date of sales (Service period end) PDF label"+ className={cn(+ "block w-full",+ inputErrorClassName(!!errors.dateOfServiceLabelText),+ )}+ />+ );+ }}/>{errors.dateOfServiceLabelText ? (<ErrorMessage>@@ -822,6 +867,7 @@ export const GeneralInformation = memo(function GeneralInformation({invoiceNumberValue={invoiceNumberValue ?? ""}paymentDue={paymentDue ?? ""}selectedDateFormat={selectedDateFormat ?? DEFAULT_DATE_FORMAT}+ language={language}setValue={setValue}isMobile={isMobile}/>@@ -839,16 +885,18 @@ export const GeneralInformation = memo(function GeneralInformation({<Controllername={`invoiceTypeFieldIsVisible`}control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id={`invoiceTypeFieldIsVisible`}- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- aria-label={`Show the "Header Notes" Field in the PDF`}- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id={`invoiceTypeFieldIsVisible`}+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ aria-label={`Show the "Header Notes" Field in the PDF`}+ />+ );+ }}/><CustomTooltiptrigger={@@ -864,15 +912,17 @@ export const GeneralInformation = memo(function GeneralInformation({<Controllername="invoiceType"control={control}- render={({ field }) => (- <Textarea- {...field}- id={`invoiceType`}- rows={2}- className={inputErrorClassName(!!errors.invoiceType)}- placeholder="Enter header notes"- />- )}+ render={({ field }) => {+ return (+ <Textarea+ {...field}+ id={`invoiceType`}+ rows={2}+ className={inputErrorClassName(!!errors.invoiceType)}+ placeholder="Enter header notes"+ />+ );+ }}/>{errors.invoiceType ? (<ErrorMessage>{errors.invoiceType.message}</ErrorMessage>@@ -939,7 +989,7 @@ export const GeneralInformation = memo(function GeneralInformation({</div>{/* Pay Online URL - Only for Stripe template */}- {template === "stripe" && (+ {template === "stripe" ? (<div className=""><Label htmlFor={`stripePayOnlineUrl`} className="">Payment Link URL@@ -948,17 +998,19 @@ export const GeneralInformation = memo(function GeneralInformation({<Controllername="stripePayOnlineUrl"control={control}- render={({ field }) => (- <Input- {...field}- id={`stripePayOnlineUrl`}- type="url"- className={cn(- "mt-1",- inputErrorClassName(!!errors.stripePayOnlineUrl),- )}- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ id={`stripePayOnlineUrl`}+ type="url"+ className={cn(+ "mt-1",+ inputErrorClassName(!!errors.stripePayOnlineUrl),+ )}+ />+ );+ }}/>{errors.stripePayOnlineUrl ? (<ErrorMessage>{errors.stripePayOnlineUrl.message}</ErrorMessage>@@ -969,245 +1021,8 @@ export const GeneralInformation = memo(function GeneralInformation({</InputHelperMessage>)}</div>- )}+ ) : null}</div></div>);});--interface OutOfDateDatesHelperProps {- dateOfIssue: string;- dateOfService: string;- dateOfServiceStart: string;- invoiceNumberValue: string;- paymentDue: string;- selectedDateFormat: string;- setValue: UseFormSetValue<InvoiceData>;- isMobile: boolean;-}--/**- * Displays a helper (banner) component that detects and allows updating stale invoice dates.- *- * This component checks if the invoice dates (date of issue, service period start/end,- * payment due) and invoice number are outdated compared to the current date. If any are stale,- * it displays a banner with a table showing the old vs new values and provides a button to update all dates at once.- */-function StaleDatesBanner({- dateOfIssue,- dateOfService,- dateOfServiceStart,- invoiceNumberValue,- paymentDue,- selectedDateFormat,- setValue,- isMobile,-}: OutOfDateDatesHelperProps) {- const formatDate = (date: string) =>- dayjs(date).locale("en").format(selectedDateFormat);-- const isDateOfIssueStale = !dayjs(dateOfIssue).isSame(dayjs(), "day");- const isDateOfServiceStale = !dayjs(dateOfService).isSame(- dayjs().endOf("month"),- "day",- );- const isDateOfServiceStartStale =- !!dateOfServiceStart &&- !isServicePeriodStartInCurrentMonth(dateOfServiceStart);- const extractedMonthYear = /(\d{2}-\d{4})/.exec(invoiceNumberValue)?.[1];- const isInvoiceNumberStale = extractedMonthYear !== CURRENT_MONTH_AND_YEAR;-- /**- * Checks if the payment due date is stale (outdated).- * A payment due date is considered stale if:- * - It's not set (empty/undefined), OR- * - It doesn't match the expected date (14 days after the date of issue)- */- const isPaymentDueStale =- !paymentDue ||- !dayjs(paymentDue).isSame(dayjs(dateOfIssue).add(14, "days"), "day");-- const targetToday = dayjs().locale("en").format(selectedDateFormat);- const targetEndOfMonth = dayjs()- .locale("en")- .endOf("month")- .format(selectedDateFormat);- const targetStartOfMonth = dayjs()- .locale("en")- .startOf("month")- .format(selectedDateFormat);- const targetPaymentDue = dayjs()- .locale("en")- .add(14, "days")- .format(selectedDateFormat);-- const targetInvoiceNumber = `1/${CURRENT_MONTH_AND_YEAR}`;-- const fallbackValue = "(not set)";-- /**- * Array of items to check for staleness.- * Each item is either false (not stale) or an object containing:- * - label: Display name of the field- * - oldValue: Current/outdated value- * - newValue: Suggested updated value- * - hint: Description of what the new value represents- */- const ITEMS: (- | boolean- | {- label: string;- oldValue: string;- newValue: string;- hint: string;- }- )[] = [- isDateOfIssueStale && {- label: "Date of issue",- oldValue: dateOfIssue ? formatDate(dateOfIssue) : fallbackValue,- newValue: targetToday,- hint: "today",- },- isDateOfServiceStale && {- label: "Service period end",- oldValue: dateOfService ? formatDate(dateOfService) : fallbackValue,- newValue: targetEndOfMonth,- hint: "end of current month",- },- isDateOfServiceStartStale && {- label: "Service period start",- oldValue: dateOfServiceStart- ? formatDate(dateOfServiceStart)- : fallbackValue,- newValue: targetStartOfMonth,- hint: "start of current month",- },- isInvoiceNumberStale && {- label: "Invoice number",- oldValue: invoiceNumberValue ? invoiceNumberValue : fallbackValue,- newValue: targetInvoiceNumber,- hint: "current month",- },- isPaymentDueStale && {- label: "Payment due",- oldValue: paymentDue ? formatDate(paymentDue) : fallbackValue,- newValue: targetPaymentDue,- hint: "date of issue + 14 days",- },- ];-- const staleItems = ITEMS.filter(Boolean) as {- label: string;- oldValue: string;- newValue: string;- hint: string;- }[];-- return (- <div- className="rounded-md border border-amber-200 bg-amber-50/90 px-3 py-4 shadow-sm shadow-amber-200/50 duration-300 animate-in fade-in slide-in-from-bottom-2"- role="region"- aria-live="polite"- data-testid="out-of-date-dates-helper"- >- <div className="mb-3 flex items-center gap-1.5 text-xs font-medium text-amber-800">- <AlertTriangle className="size-3.5 shrink-0 text-amber-600" />- <span>- {staleItems.length}{" "}- {staleItems.length === 1 ? "field is" : "fields are"} out of date- </span>- </div>-- <table className="w-full border-collapse overflow-hidden rounded border border-amber-300 text-xs">- <thead>- <tr className="border-b border-amber-300 bg-amber-100/60 text-left text-amber-800">- <th className="w-[65px] max-w-[65px] px-2.5 py-1.5 font-semibold">- Field- </th>- <th className="px-2.5 py-1.5 font-semibold">Change</th>- </tr>- </thead>-- <tbody>- {staleItems.map((item) => (- <tr- key={item.label}- className="border-b border-amber-300 last:border-b-0"- >- <td className="w-[65px] max-w-[65px] px-2.5 py-1.5 text-amber-800">- {item.label}- </td>-- <td className="text-pretty px-2.5 py-1.5 pr-0">- <span className="bg-red-100 text-amber-800 line-through decoration-amber-700/50">- {item.oldValue}- </span>- <span className="mx-1 text-amber-700">→</span>- <span className="bg-green-200 font-semibold text-green-800">- {item.newValue}- </span>- {item.hint ? (- <span className="ml-1 font-normal text-green-700">- ({item.hint})- </span>- ) : null}- </td>- </tr>- ))}- </tbody>- </table>-- <Button- type="button"- size="sm"- className="mt-3.5 gap-1.5 bg-amber-600 text-white shadow-sm hover:bg-amber-600/95"- onClick={() => {- const today = dayjs().format("YYYY-MM-DD");-- const firstDayOfCurrentMonth = dayjs()- .startOf("month")- .format("YYYY-MM-DD");- const lastDayOfCurrentMonth = dayjs()- .endOf("month")- .format("YYYY-MM-DD");-- setValue("dateOfServiceStart", firstDayOfCurrentMonth);- setValue("dateOfService", lastDayOfCurrentMonth);- setValue("dateOfIssue", today);- setValue("invoiceNumberObject.value", targetInvoiceNumber);-- const newPaymentDue = dayjs(today)- .add(14, "days")- .format("YYYY-MM-DD");-- setValue("paymentDue", newPaymentDue);-- toast.success("All dates updated successfully", {- position: isMobile ? "top-center" : "bottom-right",- });- }}- >- <RefreshCw className="size-3.5" />- Update All Dates- </Button>- </div>- );-}--// Logo helper functions-const validateImageSize = (file: File): Promise<boolean> => {- return new Promise((resolve) => {- const maxSize = 3 * 1024 * 1024; // 3MB in bytes-- resolve(file.size <= maxSize);- });-};--const convertFileToBase64 = (file: File): Promise<string> => {- return new Promise((resolve, reject) => {- const reader = new FileReader();- reader.onload = () => resolve(reader.result as string);- reader.onerror = reject;- reader.readAsDataURL(file);- });-};diff --git a/src/app/(app)/components/invoice-form/sections/invoice-items.tsx b/src/app/(app)/components/invoice-form/sections/invoice-items.tsxindex 0f75d21..b05f472 100644--- a/src/app/(app)/components/invoice-form/sections/invoice-items.tsx+++ b/src/app/(app)/components/invoice-form/sections/invoice-items.tsx@@ -1,12 +1,4 @@-import { inputErrorClassName } from "@/app/(app)/components/invoice-form/common";-import {- type InvoiceData,- type SupportedCurrencies,- type SupportedLanguages,-} from "@/app/schema";-import { cn } from "@/lib/utils";-import { Label } from "@/components/ui/label";-import { Switch } from "@/components/ui/switch";+import { Plus, Trash2 } from "lucide-react";import { memo, useState } from "react";import {type Control,@@ -16,19 +8,15 @@ import {type UseFieldArrayAppend,} from "react-hook-form";-import { Input } from "@/components/ui/input";-import { InputHelperMessage } from "@/components/ui/input-helper-message";-import { MoneyInput, ReadOnlyMoneyInput } from "@/components/ui/money-input";-import { Textarea } from "@/components/ui/textarea";-import { CustomTooltip } from "@/components/ui/tooltip";-import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";-import { Plus, Trash2 } from "lucide-react";-import { Legend } from "@/components/legend";+import { inputErrorClassName } from "@/app/(app)/components/invoice-form/common";+import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";import {- getAmountInWords,- getNumberFractionalPart,-} from "@/utils/invoice.utils";-import { Button } from "@/components/ui/button";+ type InvoiceData,+ type SupportedCurrencies,+ type SupportedLanguages,+ MAX_INVOICE_ITEMS,+} from "@/app/schema";+import { Legend } from "@/components/legend";import {AlertDialog,AlertDialogAction,@@ -39,8 +27,20 @@ import {AlertDialogHeader,AlertDialogTitle,} from "@/components/ui/alert-dialog";-import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";-import { MAX_INVOICE_ITEMS } from "@/app/schema";+import { Button } from "@/components/ui/button";+import { Input } from "@/components/ui/input";+import { InputHelperMessage } from "@/components/ui/input-helper-message";+import { Label } from "@/components/ui/label";+import { MoneyInput, ReadOnlyMoneyInput } from "@/components/ui/money-input";+import { Switch } from "@/components/ui/switch";+import { Textarea } from "@/components/ui/textarea";+import { CustomTooltip } from "@/components/ui/tooltip";+import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";+import { cn } from "@/lib/utils";+import {+ getAmountInWords,+ getNumberFractionalPart,+} from "@/utils/invoice.utils";const ErrorMessage = ({ children }: { children: React.ReactNode }) => {return <p className="mt-1 text-xs text-red-600">{children}</p>;@@ -48,7 +48,7 @@ const ErrorMessage = ({ children }: { children: React.ReactNode }) => {interface InvoiceItemsSettingsProps {control: Control<InvoiceData>;- fields: FieldArrayWithId<InvoiceData, "items", "id">[];+ fields: FieldArrayWithId<InvoiceData, "items">[];handleRemoveInvoiceItem: (index: number) => void;append: UseFieldArrayAppend<InvoiceData, "items">;errors: FieldErrors<InvoiceData>;@@ -92,7 +92,9 @@ export const InvoiceItems = memo(function InvoiceItems({trigger={<buttontype="button"- onClick={() => setDeleteItemIndex(index)}+ onClick={() => {+ return setDeleteItemIndex(index);+ }}className="flex items-center justify-center rounded-full bg-red-600 p-2 transition-colors hover:bg-red-700 active:scale-[98%] active:transition-transform"><span className="sr-only">@@ -120,16 +122,18 @@ export const InvoiceItems = memo(function InvoiceItems({<Controllername={`items.${index}.nameFieldIsVisible`}control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id={`itemNameFieldIsVisible${index}`}- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- aria-label={`Show the 'Name of Goods/Service' Column in the PDF for item ${index + 1}`}- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id={`itemNameFieldIsVisible${index}`}+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ aria-label={`Show the 'Name of Goods/Service' Column in the PDF for item ${index + 1}`}+ />+ );+ }}/><CustomTooltiptrigger={@@ -147,16 +151,18 @@ export const InvoiceItems = memo(function InvoiceItems({<Controllername={`items.${index}.name`}control={control}- render={({ field }) => (- <Textarea- {...field}- rows={4}- id={`itemName${index}`}- className={inputErrorClassName(- !!errors.items?.[index]?.name,- )}- />- )}+ render={({ field }) => {+ return (+ <Textarea+ {...field}+ rows={4}+ id={`itemName${index}`}+ className={inputErrorClassName(+ !!errors.items?.[index]?.name,+ )}+ />+ );+ }}/>{errors.items?.[index]?.name ? (<ErrorMessage>@@ -166,7 +172,7 @@ export const InvoiceItems = memo(function InvoiceItems({</div>{/* Invoice Item Type of GTU - Only show for default template */}- {template === "default" && (+ {template === "default" ? (<div><div className="mb-2 flex items-center justify-between"><Label htmlFor={`itemTypeOfGTU${index}`} className="">@@ -181,16 +187,18 @@ export const InvoiceItems = memo(function InvoiceItems({control={control}render={({field: { value, onChange, ...field },- }) => (- <Switch- {...field}- id={`itemTypeOfGTUFieldIsVisible${index}`}- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- aria-label={`Show the 'Type of GTU' Column in the PDF for item ${index + 1}`}- />- )}+ }) => {+ return (+ <Switch+ {...field}+ id={`itemTypeOfGTUFieldIsVisible${index}`}+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ aria-label={`Show the 'Type of GTU' Column in the PDF for item ${index + 1}`}+ />+ );+ }}/><CustomTooltiptrigger={@@ -210,16 +218,18 @@ export const InvoiceItems = memo(function InvoiceItems({<Controllername={`items.${index}.typeOfGTU`}control={control}- render={({ field }) => (- <Input- {...field}- id={`itemTypeOfGTU${index}`}- className={inputErrorClassName(- !!errors.items?.[index]?.typeOfGTU,- )}- type="text"- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ id={`itemTypeOfGTU${index}`}+ className={inputErrorClassName(+ !!errors.items?.[index]?.typeOfGTU,+ )}+ type="text"+ />+ );+ }}/>{errors.items?.[index]?.typeOfGTU ? (<ErrorMessage>@@ -227,7 +237,7 @@ export const InvoiceItems = memo(function InvoiceItems({</ErrorMessage>) : null}</div>- )}+ ) : null}{/* Invoice Item Amount */}<div>@@ -242,16 +252,18 @@ export const InvoiceItems = memo(function InvoiceItems({<Controllername={`items.${index}.amountFieldIsVisible`}control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id={`itemAmountFieldIsVisible${index}`}- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- aria-label={`Show the 'Amount' Column in the PDF for item ${index + 1}`}- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id={`itemAmountFieldIsVisible${index}`}+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ aria-label={`Show the 'Amount' Column in the PDF for item ${index + 1}`}+ />+ );+ }}/><CustomTooltiptrigger={@@ -270,6 +282,7 @@ export const InvoiceItems = memo(function InvoiceItems({name={`items.${index}.amount`}control={control}render={({ field }) => {+ // oxlint-disable-next-line typescript/no-unnecessary-type-conversion -- `<Input type="number">` gives back a string at runtime, the schema type says numberconst fieldValueNumber = Number(field.value) || 0;const previewFormattedValue =fieldValueNumber.toLocaleString("en-US", {@@ -289,11 +302,11 @@ export const InvoiceItems = memo(function InvoiceItems({!!errors.items?.[index]?.amount,)}/>- {!errors.items?.[index]?.amount && (+ {!errors.items?.[index]?.amount ? (<InputHelperMessage>Preview: {previewFormattedValue}</InputHelperMessage>- )}+ ) : null}</>);}}@@ -318,16 +331,18 @@ export const InvoiceItems = memo(function InvoiceItems({<Controllername={`items.${index}.unitFieldIsVisible`}control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id={`itemUnitFieldIsVisible${index}`}- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- aria-label={`Show the 'Unit' Column in the PDF for item ${index + 1}`}- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id={`itemUnitFieldIsVisible${index}`}+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ aria-label={`Show the 'Unit' Column in the PDF for item ${index + 1}`}+ />+ );+ }}/><CustomTooltiptrigger={@@ -345,16 +360,18 @@ export const InvoiceItems = memo(function InvoiceItems({<Controllername={`items.${index}.unit`}control={control}- render={({ field }) => (- <Input- {...field}- id={`itemUnit${index}`}- type="text"- className={inputErrorClassName(- !!errors.items?.[index]?.unit,- )}- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ id={`itemUnit${index}`}+ type="text"+ className={inputErrorClassName(+ !!errors.items?.[index]?.unit,+ )}+ />+ );+ }}/>{errors.items?.[index]?.unit ? (<ErrorMessage>@@ -376,16 +393,18 @@ export const InvoiceItems = memo(function InvoiceItems({<Controllername={`items.${index}.netPriceFieldIsVisible`}control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id={`itemNetPriceFieldIsVisible${index}`}- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- aria-label={`Show the 'Net Price' Column in the PDF for item ${index + 1}`}- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id={`itemNetPriceFieldIsVisible${index}`}+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ aria-label={`Show the 'Net Price' Column in the PDF for item ${index + 1}`}+ />+ );+ }}/><CustomTooltiptrigger={@@ -405,6 +424,7 @@ export const InvoiceItems = memo(function InvoiceItems({name={`items.${index}.netPrice`}control={control}render={({ field }) => {+ // oxlint-disable-next-line typescript/no-unnecessary-type-conversion -- `<Input type="number">` gives back a string at runtime, the schema type says numberconst fieldValueNumber = Number(field.value) || 0;const previewFormattedValue =@@ -440,13 +460,13 @@ export const InvoiceItems = memo(function InvoiceItems({)}dataTestId={`itemNetPrice${index}`}/>- {!errors.items?.[index]?.netPrice && (+ {!errors.items?.[index]?.netPrice ? (<InputHelperMessage>Preview: {previewFormattedValue} ({previewAmountInWords} {currency}{" "}{previewNumberFractionalPart}/100)</InputHelperMessage>- )}+ ) : null}</div>);}}@@ -471,16 +491,18 @@ export const InvoiceItems = memo(function InvoiceItems({<Controllername={`items.${index}.vatFieldIsVisible`}control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id={`itemVatFieldIsVisible${index}`}- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- aria-label={`Show the '${taxLabelText}' Column in the PDF for item ${index + 1}`}- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id={`itemVatFieldIsVisible${index}`}+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ aria-label={`Show the '${taxLabelText}' Column in the PDF for item ${index + 1}`}+ />+ );+ }}/><CustomTooltiptrigger={@@ -499,29 +521,31 @@ export const InvoiceItems = memo(function InvoiceItems({<Controllername="taxLabelText"control={control}- render={({ field }) => (- <Input- {...field}- type="text"- id="taxLabelText"- placeholder="Enter tax label (e.g., VAT, Tax, GST, Sales Tax)"- className={cn(- "mt-1 block w-full",- inputErrorClassName(!!errors.taxLabelText),- )}- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ type="text"+ id="taxLabelText"+ placeholder="Enter tax label (e.g., VAT, Tax, GST, Sales Tax)"+ className={cn(+ "mt-1 block w-full",+ inputErrorClassName(!!errors.taxLabelText),+ )}+ />+ );+ }}/>{errors.taxLabelText ? (<ErrorMessage>{errors.taxLabelText.message}</ErrorMessage>) : null}- {!errors.taxLabelText && (+ {!errors.taxLabelText ? (<InputHelperMessage>Customize the tax label on your invoice (e.g., VAT, SalesTax, IVA). Default:{" "}{INVOICE_PDF_TRANSLATIONS[language].invoiceItemsTable.vat}</InputHelperMessage>- )}+ ) : null}</div><div data-testid={`itemVat${index}`} className="mt-4"><div className="mb-2 flex items-center justify-between">@@ -534,16 +558,18 @@ export const InvoiceItems = memo(function InvoiceItems({<Controllername={`items.${index}.vat`}control={control}- render={({ field }) => (- <Input- {...field}- id={`itemVat${index}`}- type="text"- className={inputErrorClassName(- !!errors.items?.[index]?.vat,- )}- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ id={`itemVat${index}`}+ type="text"+ className={inputErrorClassName(+ !!errors.items?.[index]?.vat,+ )}+ />+ );+ }}/>{errors.items?.[index]?.vat ? (@@ -571,16 +597,18 @@ export const InvoiceItems = memo(function InvoiceItems({<Controllername={`items.${index}.netAmountFieldIsVisible`}control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id={`itemNetAmountFieldIsVisible${index}`}- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- aria-label={`Show the 'Net Amount' Column in the PDF for item ${index + 1}`}- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id={`itemNetAmountFieldIsVisible${index}`}+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ aria-label={`Show the 'Net Amount' Column in the PDF for item ${index + 1}`}+ />+ );+ }}/><CustomTooltiptrigger={@@ -643,16 +671,18 @@ export const InvoiceItems = memo(function InvoiceItems({<Controllername={`items.${index}.vatAmountFieldIsVisible`}control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id={`itemVatAmountFieldIsVisible${index}`}- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- aria-label={`Show the '${taxLabelText} Amount' Column in the PDF for item ${index + 1}`}- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id={`itemVatAmountFieldIsVisible${index}`}+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ aria-label={`Show the '${taxLabelText} Amount' Column in the PDF for item ${index + 1}`}+ />+ );+ }}/><CustomTooltiptrigger={@@ -716,16 +746,18 @@ export const InvoiceItems = memo(function InvoiceItems({<Controllername={`items.${index}.preTaxAmountFieldIsVisible`}control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id={`itemPreTaxAmountFieldIsVisible${index}`}- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- aria-label={`Show the 'Pre-tax Amount' Column in the PDF for item ${index + 1}`}- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id={`itemPreTaxAmountFieldIsVisible${index}`}+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ aria-label={`Show the 'Pre-tax Amount' Column in the PDF for item ${index + 1}`}+ />+ );+ }}/><CustomTooltiptrigger={@@ -825,7 +857,7 @@ export const InvoiceItems = memo(function InvoiceItems({/>{/** we only want to show "Show Number Column" and "Show Tax Table Summary" settings for default template */}- {template === "default" && (+ {template === "default" ? (<div className="mt-6 space-y-4 rounded-md border p-4">{/* Show Number column on PDF switch */}<div className="relative flex items-center justify-between gap-2">@@ -839,15 +871,17 @@ export const InvoiceItems = memo(function InvoiceItems({<Controllername={`items.0.invoiceItemNumberIsVisible`}control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id={`itemInvoiceItemNumberIsVisible0`}- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id={`itemInvoiceItemNumberIsVisible0`}+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ />+ );+ }}/></div>@@ -863,19 +897,21 @@ export const InvoiceItems = memo(function InvoiceItems({<Controllername={`vatTableSummaryIsVisible`}control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id={`vatTableSummaryIsVisible`}- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id={`vatTableSummaryIsVisible`}+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ />+ );+ }}/></div></div>- )}+ ) : null}<DeleteInvoiceItemConfirmationDialogdeleteItemIndex={deleteItemIndex}diff --git a/src/app/(app)/components/invoice-form/sections/seller-information.tsx b/src/app/(app)/components/invoice-form/sections/seller-information.tsxindex e539108..a89be90 100644--- a/src/app/(app)/components/invoice-form/sections/seller-information.tsx+++ b/src/app/(app)/components/invoice-form/sections/seller-information.tsx@@ -1,6 +1,14 @@+import { Info } from "lucide-react";+import { memo, useState } from "react";+import {+ type Control,+ Controller,+ type FieldErrors,+ type UseFormSetValue,+} from "react-hook-form";+import { inputErrorClassName } from "@/app/(app)/components/invoice-form/common";import { SellerManagement } from "@/app/(app)/components/invoice-form/sections/components/seller/seller-management";-import { cn } from "@/lib/utils";import { type InvoiceData, type SellerData } from "@/app/schema";import { AccordionContent } from "@/components/ui/accordion";import { Input } from "@/components/ui/input";@@ -9,14 +17,7 @@ import { Label } from "@/components/ui/label";import { Switch } from "@/components/ui/switch";import { Textarea } from "@/components/ui/textarea";import { CustomTooltip } from "@/components/ui/tooltip";-import { Info } from "lucide-react";-import { memo, useState } from "react";-import {- type Control,- Controller,- type FieldErrors,- type UseFormSetValue,-} from "react-hook-form";+import { cn } from "@/lib/utils";const ErrorMessage = ({ children }: { children: React.ReactNode }) => {return <p className="mt-1 text-xs text-red-600">{children}</p>;@@ -91,14 +92,16 @@ export const SellerInformation = memo(function SellerInformation({<Controllername="seller.name"control={control}- render={({ field }) => (- <Textarea- {...field}- id="sellerName"- rows={3}- className={inputErrorClassName(!!errors.seller?.name)}- />- )}+ render={({ field }) => {+ return (+ <Textarea+ {...field}+ id="sellerName"+ rows={3}+ className={inputErrorClassName(!!errors.seller?.name)}+ />+ );+ }}/>{errors.seller?.name ? (<ErrorMessage>{errors.seller.name.message}</ErrorMessage>@@ -112,14 +115,16 @@ export const SellerInformation = memo(function SellerInformation({<Controllername="seller.address"control={control}- render={({ field }) => (- <Textarea- {...field}- id="sellerAddress"- rows={3}- className={inputErrorClassName(!!errors.seller?.address)}- />- )}+ render={({ field }) => {+ return (+ <Textarea+ {...field}+ id="sellerAddress"+ rows={3}+ className={inputErrorClassName(!!errors.seller?.address)}+ />+ );+ }}/>{errors.seller?.address ? (<ErrorMessage>{errors.seller.address.message}</ErrorMessage>@@ -137,17 +142,19 @@ export const SellerInformation = memo(function SellerInformation({<Controllername="seller.vatNoFieldIsVisible"control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id="sellerVatNoFieldIsVisible"- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- data-testid="sellerVatNoFieldIsVisible"- aria-label="Show the 'Seller Tax Number' Field in the PDF"- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id="sellerVatNoFieldIsVisible"+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ data-testid="sellerVatNoFieldIsVisible"+ aria-label="Show the 'Seller Tax Number' Field in the PDF"+ />+ );+ }}/><CustomTooltiptrigger={@@ -170,29 +177,33 @@ export const SellerInformation = memo(function SellerInformation({<Controllername="seller.vatNoLabelText"control={control}- render={({ field }) => (- <Input- {...field}- type="text"- id="sellerVatNoLabel"- placeholder="Enter Tax number label"- className={cn(- "mt-1 block w-full",- inputErrorClassName(!!errors.seller?.vatNoLabelText),- )}- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ type="text"+ id="sellerVatNoLabel"+ placeholder="Enter Tax number label"+ className={cn(+ "mt-1 block w-full",+ inputErrorClassName(+ !!errors.seller?.vatNoLabelText,+ ),+ )}+ />+ );+ }}/>{errors.seller?.vatNoLabelText ? (<ErrorMessage>{errors.seller.vatNoLabelText.message}</ErrorMessage>) : null}- {!errors.seller?.vatNoLabelText && (+ {!errors.seller?.vatNoLabelText ? (<InputHelperMessage>Set a custom label (e.g. VAT no, Tax no, etc.)</InputHelperMessage>- )}+ ) : null}</div><div>@@ -200,18 +211,20 @@ export const SellerInformation = memo(function SellerInformation({<Controllername="seller.vatNo"control={control}- render={({ field }) => (- <Input- {...field}- id="sellerVatNo"- type="text"- placeholder="Enter Tax number value"- className={cn(- "mt-1 block w-full",- inputErrorClassName(!!errors.seller?.vatNo),- )}- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ id="sellerVatNo"+ type="text"+ placeholder="Enter Tax number value"+ className={cn(+ "mt-1 block w-full",+ inputErrorClassName(!!errors.seller?.vatNo),+ )}+ />+ );+ }}/>{errors.seller?.vatNo ? (<ErrorMessage>{errors.seller.vatNo.message}</ErrorMessage>@@ -230,17 +243,19 @@ export const SellerInformation = memo(function SellerInformation({<Controllername="seller.emailFieldIsVisible"control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id="sellerEmailFieldIsVisible"- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- data-testid="sellerEmailFieldIsVisible"- aria-label="Show the 'Email' field in the PDF"- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id="sellerEmailFieldIsVisible"+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ data-testid="sellerEmailFieldIsVisible"+ aria-label="Show the 'Email' field in the PDF"+ />+ );+ }}/><CustomTooltiptrigger={@@ -259,14 +274,16 @@ export const SellerInformation = memo(function SellerInformation({<Controllername="seller.email"control={control}- render={({ field }) => (- <Input- {...field}- id="sellerEmail"- type="email"- className={inputErrorClassName(!!errors.seller?.email)}- />- )}+ render={({ field }) => {+ return (+ <Input+ {...field}+ id="sellerEmail"+ type="email"+ className={inputErrorClassName(!!errors.seller?.email)}+ />+ );+ }}/>{errors.seller?.email ? (<ErrorMessage>{errors.seller.email.message}</ErrorMessage>@@ -282,17 +299,19 @@ export const SellerInformation = memo(function SellerInformation({<Controllername="seller.accountNumberFieldIsVisible"control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id="sellerAccountNumberFieldIsVisible"- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- data-testid="sellerAccountNumberFieldIsVisible"- aria-label="Show the 'Account Number' Field in the PDF"- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id="sellerAccountNumberFieldIsVisible"+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ data-testid="sellerAccountNumberFieldIsVisible"+ aria-label="Show the 'Account Number' Field in the PDF"+ />+ );+ }}/><CustomTooltiptrigger={@@ -311,16 +330,18 @@ export const SellerInformation = memo(function SellerInformation({<Controllername="seller.accountNumber"control={control}- render={({ field }) => (- <Textarea- {...field}- id="sellerAccountNumber"- rows={3}- className={inputErrorClassName(- !!errors.seller?.accountNumber,- )}- />- )}+ render={({ field }) => {+ return (+ <Textarea+ {...field}+ id="sellerAccountNumber"+ rows={3}+ className={inputErrorClassName(+ !!errors.seller?.accountNumber,+ )}+ />+ );+ }}/>{errors.seller?.accountNumber ? (<ErrorMessage>{errors.seller.accountNumber.message}</ErrorMessage>@@ -336,17 +357,19 @@ export const SellerInformation = memo(function SellerInformation({<Controllername="seller.swiftBicFieldIsVisible"control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id="sellerSwiftBicFieldIsVisible"- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- data-testid="sellerSwiftBicFieldIsVisible"- aria-label="Show the 'SWIFT/BIC' Field in the PDF"- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id="sellerSwiftBicFieldIsVisible"+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ data-testid="sellerSwiftBicFieldIsVisible"+ aria-label="Show the 'SWIFT/BIC' Field in the PDF"+ />+ );+ }}/><CustomTooltiptrigger={@@ -366,14 +389,16 @@ export const SellerInformation = memo(function SellerInformation({<Controllername="seller.swiftBic"control={control}- render={({ field }) => (- <Textarea- {...field}- id="sellerSwiftBic"- rows={3}- className={inputErrorClassName(!!errors.seller?.swiftBic)}- />- )}+ render={({ field }) => {+ return (+ <Textarea+ {...field}+ id="sellerSwiftBic"+ rows={3}+ className={inputErrorClassName(!!errors.seller?.swiftBic)}+ />+ );+ }}/>{errors.seller?.swiftBic ? (<ErrorMessage>{errors.seller.swiftBic.message}</ErrorMessage>@@ -388,17 +413,19 @@ export const SellerInformation = memo(function SellerInformation({<Controllername="seller.notesFieldIsVisible"control={control}- render={({ field: { value, onChange, ...field } }) => (- <Switch- {...field}- id="sellerNotesFieldIsVisible"- checked={value}- onCheckedChange={onChange}- className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"- data-testid="sellerNotesInvoiceFormFieldVisibilitySwitch"- aria-label="Show the 'Notes' field in the PDF"- />- )}+ render={({ field: { value, onChange, ...field } }) => {+ return (+ <Switch+ {...field}+ id="sellerNotesFieldIsVisible"+ checked={value}+ onCheckedChange={onChange}+ className="h-5 w-8 [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-3 rtl:[&_span]:data-[state=checked]:-translate-x-3"+ data-testid="sellerNotesInvoiceFormFieldVisibilitySwitch"+ aria-label="Show the 'Notes' field in the PDF"+ />+ );+ }}/><CustomTooltiptrigger={@@ -418,14 +445,16 @@ export const SellerInformation = memo(function SellerInformation({<Controllername="seller.notes"control={control}- render={({ field }) => (- <Textarea- {...field}- id="sellerNotes"- rows={3}- className={inputErrorClassName(!!errors.seller?.notes)}- />- )}+ render={({ field }) => {+ return (+ <Textarea+ {...field}+ id="sellerNotes"+ rows={3}+ className={inputErrorClassName(!!errors.seller?.notes)}+ />+ );+ }}/>{errors.seller?.notes ? (<ErrorMessage>{errors.seller.notes.message}</ErrorMessage>diff --git a/src/app/(app)/components/invoice-form/__tests__/calculate-invoice-total.test.ts b/src/app/(app)/components/invoice-form/utils/__tests__/calculate-invoice-total.test.tssimilarity index 74%rename from src/app/(app)/components/invoice-form/__tests__/calculate-invoice-total.test.tsrename to src/app/(app)/components/invoice-form/utils/__tests__/calculate-invoice-total.test.tsindex 3b626d7..625177e 100644--- a/src/app/(app)/components/invoice-form/__tests__/calculate-invoice-total.test.ts+++ b/src/app/(app)/components/invoice-form/utils/__tests__/calculate-invoice-total.test.ts@@ -1,11 +1,13 @@import { describe, expect, it } from "vitest";+import type { InvoiceItemData } from "@/app/schema";import { MOCK_INVOICE_ITEM_DATA } from "@/utils/__tests__/data";+import {calculateInvoiceTotal,getSafeNumber,-} from "../utils/calculate-invoice-total";-import { parseValidatedInvoiceItems } from "../utils/validated-invoice-items";+} from "../calculate-invoice-total";+import { parseValidatedInvoiceItems } from "../validated-invoice-items";function createItem(overrides: Partial<InvoiceItemData> = {}): InvoiceItemData {return {@@ -113,29 +115,34 @@ describe("calculateInvoiceTotal", () => {).toBe(75.5);});- // `z.coerce.number().nonnegative()` accepts Infinity, so these reach- // `calculateInvoiceTotal` through the real parse path and are the cases that- // `getSafeNumber` actually exists to handle.- it("treats a non-finite preTaxAmount that passed validation as 0", () => {+ // As of zod v4 `z.coerce.number()` rejects non-finite values, so the parse+ // path no longer lets `Infinity` through.+ it("rejects a non-finite preTaxAmount at the parse step", () => {expect(- calculateInvoiceTotal(- createValidatedItems([- createItem({ preTaxAmount: 100 }),- createItem({ preTaxAmount: Number.POSITIVE_INFINITY }),- ]),- ),- ).toBe(100);+ parseValidatedInvoiceItems([+ createItem({ preTaxAmount: Number.POSITIVE_INFINITY }),+ ]).success,+ ).toBe(false);++ // an overflowing numeric string coerces to Infinity, so it is rejected too+ expect(+ parseValidatedInvoiceItems([+ createItem({ preTaxAmount: "1e999" as unknown as number }),+ ]).success,+ ).toBe(false);});- it("treats an overflowing numeric string as 0", () => {- const validatedItems = createValidatedItems([- createItem({ preTaxAmount: 100 }),- createItem({ preTaxAmount: "1e999" as unknown as number }),- ]);+ // The totals effect passes raw, unvalidated `useWatch` items straight in, so+ // a non-finite amount still reaches the sum without ever being parsed. That+ // is what `getSafeNumber`'s finiteness guard exists for.+ it("treats a non-finite preTaxAmount in raw form values as 0", () => {+ const rawFormItems = [+ { preTaxAmount: 100 },+ { preTaxAmount: Number.POSITIVE_INFINITY },+ { preTaxAmount: "1e999" },+ ] as unknown as ReadonlyArray<Pick<InvoiceItemData, "preTaxAmount">>;- // the string overflows to Infinity during coercion, not to a parse error- expect(validatedItems[1].preTaxAmount).toBe(Number.POSITIVE_INFINITY);- expect(calculateInvoiceTotal(validatedItems)).toBe(100);+ expect(calculateInvoiceTotal(rawFormItems)).toBe(100);});it("coerces string preTaxAmount when raw form values reach it", () => {@@ -150,13 +157,15 @@ describe("calculateInvoiceTotal", () => {// Without coercion, `0 + "10"` becomes `"010"`, then string concat continues// and `.toFixed` throws: TypeError: f.reduce(...).toFixed is not a function- expect(() =>- Number(+ expect(() => {+ return Number(rawFormItems- .reduce((sum, item) => sum + item.preTaxAmount, 0)+ .reduce((sum, item) => {+ return sum + item.preTaxAmount;+ }, 0).toFixed(2),- ),- ).toThrow(TypeError);+ );+ }).toThrow(TypeError);expect(calculateInvoiceTotal(rawFormItems)).toBe(30);});diff --git a/src/app/(app)/components/invoice-form/__tests__/calculate-item-totals.test.ts b/src/app/(app)/components/invoice-form/utils/__tests__/calculate-item-totals.test.tssimilarity index 99%rename from src/app/(app)/components/invoice-form/__tests__/calculate-item-totals.test.tsrename to src/app/(app)/components/invoice-form/utils/__tests__/calculate-item-totals.test.tsindex c94a093..6e2a107 100644--- a/src/app/(app)/components/invoice-form/__tests__/calculate-item-totals.test.ts+++ b/src/app/(app)/components/invoice-form/utils/__tests__/calculate-item-totals.test.ts@@ -1,7 +1,9 @@import { describe, it, expect } from "vitest";+import type { InvoiceItemData } from "@/app/schema";import { MOCK_INVOICE_ITEM_DATA } from "@/utils/__tests__/data";-import { calculateItemTotals } from "../utils/calculate-item-totals";++import { calculateItemTotals } from "../calculate-item-totals";function createItem(overrides: Partial<InvoiceItemData> = {}): InvoiceItemData {return {diff --git a/src/app/(app)/components/invoice-form/__tests__/has-item-totals-changed.test.ts b/src/app/(app)/components/invoice-form/utils/__tests__/has-item-totals-changed.test.tssimilarity index 96%rename from src/app/(app)/components/invoice-form/__tests__/has-item-totals-changed.test.tsrename to src/app/(app)/components/invoice-form/utils/__tests__/has-item-totals-changed.test.tsindex 9328b67..d2d23d7 100644--- a/src/app/(app)/components/invoice-form/__tests__/has-item-totals-changed.test.ts+++ b/src/app/(app)/components/invoice-form/utils/__tests__/has-item-totals-changed.test.ts@@ -1,11 +1,13 @@import { describe, it, expect } from "vitest";+import type { InvoiceItemData } from "@/app/schema";import { MOCK_INVOICE_ITEM_DATA } from "@/utils/__tests__/data";+import {hasAnyItemTotalsChanged,hasItemTotalsChanged,-} from "../utils/has-item-totals-changed";-import { parseValidatedInvoiceItems } from "../utils/validated-invoice-items";+} from "../has-item-totals-changed";+import { parseValidatedInvoiceItems } from "../validated-invoice-items";function createItem(overrides: Partial<InvoiceItemData> = {}) {return {diff --git a/src/app/(app)/components/invoice-form/utils/__tests__/logo-upload.test.ts b/src/app/(app)/components/invoice-form/utils/__tests__/logo-upload.test.tsnew file mode 100644index 0000000..dfe0f7f--- /dev/null+++ b/src/app/(app)/components/invoice-form/utils/__tests__/logo-upload.test.ts@@ -0,0 +1,112 @@+// @vitest-environment happy-dom++import { afterEach, describe, expect, it, vi } from "vitest";++import {+ convertFileToBase64,+ MAX_LOGO_SIZE_IN_BYTES,+ validateImageSize,+} from "../logo-upload";++/**+ * Build a File of an exact byte length without allocating it.+ *+ * `validateImageSize` only ever reads `.size`, and the boundary cases are+ * megabytes wide, so a stubbed size keeps the tests cheap and exact.+ */+function createFileOfSize(sizeInBytes: number): File {+ const file = new File([], "logo.png", { type: "image/png" });++ Object.defineProperty(file, "size", { value: sizeInBytes });++ return file;+}++describe("MAX_LOGO_SIZE_IN_BYTES", () => {+ it("is 3MB, matching the limit shown to the user in the upload field", () => {+ expect(MAX_LOGO_SIZE_IN_BYTES).toBe(3_145_728);+ });+});++describe("validateImageSize", () => {+ it("accepts a file comfortably under the limit", async () => {+ await expect(validateImageSize(createFileOfSize(1024))).resolves.toBe(true);+ });++ it("accepts an empty file", async () => {+ await expect(validateImageSize(createFileOfSize(0))).resolves.toBe(true);+ });++ it("accepts a file exactly on the limit", async () => {+ await expect(+ validateImageSize(createFileOfSize(MAX_LOGO_SIZE_IN_BYTES)),+ ).resolves.toBe(true);+ });++ it("rejects a file one byte over the limit", async () => {+ await expect(+ validateImageSize(createFileOfSize(MAX_LOGO_SIZE_IN_BYTES + 1)),+ ).resolves.toBe(false);+ });++ it("rejects a file far over the limit", async () => {+ await expect(+ validateImageSize(createFileOfSize(MAX_LOGO_SIZE_IN_BYTES * 10)),+ ).resolves.toBe(false);+ });+});++describe("convertFileToBase64", () => {+ afterEach(() => {+ vi.unstubAllGlobals();+ });++ it("resolves a data URL carrying the file's MIME type", async () => {+ const file = new File(["hello"], "logo.png", { type: "image/png" });++ const result = await convertFileToBase64(file);++ expect(result).toBe(`data:image/png;base64,${btoa("hello")}`);+ });++ it("round trips the file contents", async () => {+ const contents = "some file contents";+ const file = new File([contents], "logo.webp", { type: "image/webp" });++ const result = await convertFileToBase64(file);+ const [, base64] = result.split(",");++ expect(result.startsWith("data:image/webp;base64,")).toBe(true);+ expect(atob(base64)).toBe(contents);+ });++ it("handles an empty file", async () => {+ const file = new File([], "logo.jpg", { type: "image/jpeg" });++ await expect(convertFileToBase64(file)).resolves.toBe(+ "data:image/jpeg;base64,",+ );+ });++ it("rejects when the file cannot be read", async () => {+ const error = new Event("error");++ // happy-dom's FileReader never fails on an in-memory File, so the failure+ // path is exercised with a stand-in that only ever errors.+ class FailingFileReader extends EventTarget {+ result = null;++ readAsDataURL() {+ queueMicrotask(() => {+ return this.dispatchEvent(error);+ });+ }+ }++ vi.stubGlobal("FileReader", FailingFileReader);++ const file = new File(["hello"], "logo.png", { type: "image/png" });++ await expect(convertFileToBase64(file)).rejects.toBe(error);+ });+});diff --git a/src/app/(app)/components/invoice-form/__tests__/validated-invoice-items.test.ts b/src/app/(app)/components/invoice-form/utils/__tests__/validated-invoice-items.test.tssimilarity index 82%rename from src/app/(app)/components/invoice-form/__tests__/validated-invoice-items.test.tsrename to src/app/(app)/components/invoice-form/utils/__tests__/validated-invoice-items.test.tsindex 3ee05f8..bb7c0a0 100644--- a/src/app/(app)/components/invoice-form/__tests__/validated-invoice-items.test.ts+++ b/src/app/(app)/components/invoice-form/utils/__tests__/validated-invoice-items.test.ts@@ -1,7 +1,9 @@-import { describe, expect, it } from "vitest";+import { assert, describe, expect, it } from "vitest";+import type { InvoiceItemData } from "@/app/schema";import { MOCK_INVOICE_ITEM_DATA } from "@/utils/__tests__/data";-import { parseValidatedInvoiceItems } from "../utils/validated-invoice-items";++import { parseValidatedInvoiceItems } from "../validated-invoice-items";function createItem(overrides: Partial<InvoiceItemData> = {}): InvoiceItemData {return {@@ -14,11 +16,9 @@ describe("parseValidatedInvoiceItems", () => {it("accepts items that pass invoiceItemSchema", () => {const result = parseValidatedInvoiceItems([createItem()]);- expect(result.success).toBe(true);-- if (!result.success) {- return;- }+ // `assert` both fails the test and narrows the safeParse union, so the+ // assertions below need no `if (!result.success) return` guard.+ assert(result.success);expect(result.data[0].preTaxAmount).toBe(MOCK_INVOICE_ITEM_DATA.preTaxAmount,@@ -30,11 +30,7 @@ describe("parseValidatedInvoiceItems", () => {createItem({ preTaxAmount: "247.23" as unknown as number }),]);- expect(result.success).toBe(true);-- if (!result.success) {- return;- }+ assert(result.success);expect(result.data[0].preTaxAmount).toBe(247.23);});diff --git a/src/app/(app)/components/invoice-form/utils/calculate-invoice-total.ts b/src/app/(app)/components/invoice-form/utils/calculate-invoice-total.tsindex 75f956b..3096eb0 100644--- a/src/app/(app)/components/invoice-form/utils/calculate-invoice-total.ts+++ b/src/app/(app)/components/invoice-form/utils/calculate-invoice-total.ts@@ -10,10 +10,11 @@ import type { InvoiceItemData } from "@/app/schema";* but never writes coerced values back into it, so a `useWatch` result can* still hold `"10"`. Summing that concatenates (`0 + "10"` -> `"010"`) and* then throws on `.toFixed`.- * - `z.coerce.number().nonnegative()` accepts `Infinity`, so a literal- * `Infinity` or an overflowing numeric string like `"1e999"` survives- * validation. Summing those renders the invoice total as "Infinity"; a- * non-finite amount contributes 0 instead so the form stays usable.+ * - A literal `Infinity`, or an overflowing numeric string like `"1e999"`, can+ * sit in form state. Zod rejects non-finite values, but this runs on raw+ * `useWatch` items that were never parsed, so nothing has filtered them out.+ * Summing those renders the invoice total as "Infinity"; a non-finite amount+ * contributes 0 instead so the form stays usable.*/export function getSafeNumber(value: unknown) {const number = Number(value ?? 0);@@ -31,7 +32,9 @@ export function calculateInvoiceTotal() {return Number(items- .reduce((sum, item) => sum + getSafeNumber(item.preTaxAmount), 0)+ .reduce((sum, item) => {+ return sum + getSafeNumber(item.preTaxAmount);+ }, 0).toFixed(2),);}diff --git a/src/app/(app)/components/invoice-form/utils/calculate-item-totals.ts b/src/app/(app)/components/invoice-form/utils/calculate-item-totals.tsindex cb3ceee..6820bfc 100644--- a/src/app/(app)/components/invoice-form/utils/calculate-item-totals.ts+++ b/src/app/(app)/components/invoice-form/utils/calculate-item-totals.ts@@ -15,7 +15,9 @@ export function calculateItemTotals(): InvoiceItemData | null {if (!item) return null;+ // oxlint-disable-next-line typescript/no-unnecessary-type-conversion -- form inputs and shared URLs can hand these over as strings, the schema type says numberconst amount = Number(item.amount) || 0;+ // oxlint-disable-next-line typescript/no-unnecessary-type-conversion -- same as aboveconst netPrice = Number(item.netPrice) || 0;const calculatedNetAmount = amount * netPrice;const formattedNetAmount = Number(calculatedNetAmount.toFixed(2));diff --git a/src/app/(app)/components/invoice-form/utils/form-errors-to-toast.tsx b/src/app/(app)/components/invoice-form/utils/form-errors-to-toast.tsxindex 28b7475..2f062d9 100644--- a/src/app/(app)/components/invoice-form/utils/form-errors-to-toast.tsx+++ b/src/app/(app)/components/invoice-form/utils/form-errors-to-toast.tsx@@ -1,7 +1,8 @@-import type { InvoiceData } from "@/app/schema";import type { FieldErrors } from "react-hook-form";import { toast } from "sonner";+import type { InvoiceData } from "@/app/schema";+/*** Show toast listing form validation errors.*@@ -34,15 +35,20 @@ export function formErrorsToToast({}if (Array.isArray(error)) {- return error.map((item, index) =>- Object.entries(+ return error.map((item, index) => {+ return Object.entries(item as { [key: string]: { message?: string } },- ).map(([fieldName, fieldError]) => (- <li key={`${key}.${index}.${fieldName}`} className="text-sm">- {fieldError?.message || "Unknown error"}- </li>- )),- );+ ).map(([fieldName, fieldError]) => {+ return (+ <li+ key={`${key}.${index}.${fieldName}`}+ className="text-sm"+ >+ {fieldError?.message || "Unknown error"}+ </li>+ );+ });+ });}if (error && typeof error === "object") {diff --git a/src/app/(app)/components/invoice-form/utils/has-item-totals-changed.ts b/src/app/(app)/components/invoice-form/utils/has-item-totals-changed.tsindex c24f36d..ebdc454 100644--- a/src/app/(app)/components/invoice-form/utils/has-item-totals-changed.ts+++ b/src/app/(app)/components/invoice-form/utils/has-item-totals-changed.ts@@ -1,4 +1,5 @@import type { InvoiceItemData } from "@/app/schema";+import { calculateItemTotals } from "./calculate-item-totals";/**@@ -29,5 +30,7 @@ export function hasItemTotalsChanged(item: InvoiceItemData): boolean {export function hasAnyItemTotalsChanged(items: ReadonlyArray<InvoiceItemData>,): boolean {- return items.some(hasItemTotalsChanged);+ return items.some((item) => {+ return hasItemTotalsChanged(item);+ });}diff --git a/src/app/(app)/components/invoice-form/utils/logo-upload.ts b/src/app/(app)/components/invoice-form/utils/logo-upload.tsnew file mode 100644index 0000000..c5e0c70--- /dev/null+++ b/src/app/(app)/components/invoice-form/utils/logo-upload.ts@@ -0,0 +1,38 @@+/**+ * Largest company logo we accept, in bytes.+ *+ * The logo is stored inside the invoice itself (base64, in `localStorage` and in+ * the `?data=` share link), so its size is a hard budget rather than a cosmetic+ * limit.+ */+export const MAX_LOGO_SIZE_IN_BYTES = 3 * 1024 * 1024; // 3MB in bytes++/**+ * Check that a logo file is within {@link MAX_LOGO_SIZE_IN_BYTES}.+ *+ * @param file - The file the user picked.+ * @returns True when the file is at most 3MB.+ */+export function validateImageSize(file: File): Promise<boolean> {+ return new Promise((resolve) => {+ resolve(file.size <= MAX_LOGO_SIZE_IN_BYTES);+ });+}++/**+ * Read a logo file as a base64 `data:` URL, the form the invoice stores it in.+ *+ * @param file - The file the user picked.+ * @returns The file as a `data:<mime>;base64,<...>` string.+ * @throws Rejects with the `FileReader` error event when the file cannot be read.+ */+export function convertFileToBase64(file: File): Promise<string> {+ return new Promise((resolve, reject) => {+ const reader = new FileReader();+ reader.addEventListener("load", () => {+ return resolve(reader.result as string);+ });+ reader.addEventListener("error", reject);+ reader.readAsDataURL(file);+ });+}diff --git a/src/app/(app)/components/invoice-form/utils/validated-invoice-items.ts b/src/app/(app)/components/invoice-form/utils/validated-invoice-items.tsindex 0a32878..26f2c0e 100644--- a/src/app/(app)/components/invoice-form/utils/validated-invoice-items.ts+++ b/src/app/(app)/components/invoice-form/utils/validated-invoice-items.ts@@ -1,6 +1,7 @@-import { invoiceItemSchema } from "@/app/schema";import { z } from "zod";+import { invoiceItemSchema } from "@/app/schema";+const invoiceItemsSchema = z.array(invoiceItemSchema);/**diff --git a/src/app/(app)/components/invoice-page-header.tsx b/src/app/(app)/components/invoice-page-header.tsxindex ccaf055..602a231 100644--- a/src/app/(app)/components/invoice-page-header.tsx+++ b/src/app/(app)/components/invoice-page-header.tsx@@ -1,26 +1,26 @@"use client";-import { type InvoiceData } from "@/app/schema";-import { ProjectLogo } from "@/components/etc/project-logo";-import { Button } from "@/components/ui/button";-import { HowItWorksVideoDialog } from "@/app/(app)/components/how-it-works-video-dialog";-import { CustomTooltip } from "@/components/ui/tooltip";+import { AlertCircleIcon, LinkIcon } from "lucide-react";+import { useState } from "react";+import { HowItWorksVideoDialog } from "@/app/(app)/components/how-it-works-video-dialog";import { InvoicePDFDownloadLink } from "@/app/(app)/components/invoice-pdf-download-link";import { ProjectLogoDescription } from "@/app/(components)/project-logo-description";+import { type InvoiceData } from "@/app/schema";import { GithubIcon } from "@/components/etc/github-logo";+import { ProjectLogo } from "@/components/etc/project-logo";+import { Button } from "@/components/ui/button";+import { CustomTooltip } from "@/components/ui/tooltip";import { DISCORD_COMMUNITY_URL, GITHUB_URL } from "@/config";import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";import { cn } from "@/lib/utils";-import { AlertCircleIcon, LinkIcon } from "lucide-react";-import { useState } from "react";/*** Header component for the invoice page.** Displays the project logo, description, and action buttons including:* - Share invoice button (with conditional rendering based on shareability)- * - Download PDF button with error handling+ * - Download PDF button* @returns The rendered invoice page header with logo, description, and action buttons*/export function InvoicePageHeader({@@ -28,9 +28,6 @@ export function InvoicePageHeader({handleShareInvoice,isDesktop,invoiceDataState,- errorWhileGeneratingPdfIsShown,- setErrorWhileGeneratingPdfIsShown,- qrCodeDataUrl,isMobile,isSharedInvoice,}: {@@ -38,9 +35,6 @@ export function InvoicePageHeader({handleShareInvoice: () => void;isDesktop: boolean;invoiceDataState: InvoiceData;- errorWhileGeneratingPdfIsShown: boolean;- setErrorWhileGeneratingPdfIsShown: (value: boolean) => void;- qrCodeDataUrl: string;isMobile: boolean;isSharedInvoice: boolean;}) {@@ -137,11 +131,6 @@ export function InvoicePageHeader({/><InvoicePDFDownloadLinkinvoiceData={invoiceDataState}- errorWhileGeneratingPdfIsShown={errorWhileGeneratingPdfIsShown}- setErrorWhileGeneratingPdfIsShown={- setErrorWhileGeneratingPdfIsShown- }- qrCodeDataUrl={qrCodeDataUrl}isMobile={isMobile}/></>diff --git a/src/app/(app)/components/invoice-pdf-download-link.tsx b/src/app/(app)/components/invoice-pdf-download-link.tsxindex 01dee28..f1a369b 100644--- a/src/app/(app)/components/invoice-pdf-download-link.tsx+++ b/src/app/(app)/components/invoice-pdf-download-link.tsx@@ -1,27 +1,24 @@-import { InvoicePdfTemplate } from "@/app/(app)/components/invoice-templates/invoice-pdf-default-template";-import { StripeInvoicePdfTemplate } from "@/app/(app)/components/invoice-templates/invoice-pdf-stripe-template";+import dayjs from "dayjs";+import { DownloadIcon, Loader2 } from "lucide-react";+import { useCallback, useEffect, useState } from "react";+import { toast } from "sonner";++import { useInvoicePdfInstance } from "@/app/(app)/contexts/invoice-pdf-instance-context";import {LANGUAGE_TO_LABEL,type InvoiceData,type SupportedLanguages,} from "@/app/schema";-import { ErrorGeneratingPdfToast } from "@/components/ui/toasts/error-generating-pdf-toast";-import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";-import { cn } from "@/lib/utils";-import { usePDF } from "@react-pdf/renderer/lib/react-pdf.browser";-import * as Sentry from "@sentry/nextjs";-import dayjs from "dayjs";-import { DownloadIcon, Loader2 } from "lucide-react";-import { useCallback, useEffect, useMemo, useState } from "react";-import { toast } from "sonner";-import { CustomTooltip } from "@/components/ui/tooltip";import { useDeviceContext } from "@/contexts/device-context";+import { haptic } from "@/lib/haptic";+import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";+import { cn } from "@/lib/utils";import { isTelegramInAppBrowser } from "@/utils/is-telegram-in-app-browser";-import { updateAppMetadata } from "../utils/get-app-metadata";+import { useCTAToast } from "../contexts/cta-toast-context";-import { CTA_TOAST_TIMEOUT, showRandomCTAToast } from "./cta-toasts";-import { haptic } from "@/lib/haptic";+import { updateAppMetadata } from "../utils/get-app-metadata";+import { CTA_TOAST_TIMEOUT, showCTAToast } from "./cta-toasts";const LOADING_BUTTON_TIMEOUT = 400;export const LOADING_BUTTON_TEXT = "Generating Document...";@@ -57,25 +54,18 @@ const ButtonContent = ({export function InvoicePDFDownloadLink({invoiceData,- errorWhileGeneratingPdfIsShown,- setErrorWhileGeneratingPdfIsShown,- qrCodeDataUrl,isMobile,}: {invoiceData: InvoiceData;- errorWhileGeneratingPdfIsShown: boolean;- setErrorWhileGeneratingPdfIsShown: (error: boolean) => void;- qrCodeDataUrl: string;isMobile: boolean;}) {const { inAppInfo } = useDeviceContext();- const { markCTAActionTriggered } = useCTAToast();+ const { hasTriggeredCTAAction, markCTAActionTriggered } = useCTAToast();- const [{ loading: pdfLoading, url, error }, updatePdfInstance] = usePDF();+ // The very same PDF the preview shows, generated once by `InvoicePdfInstanceProvider`+ const { loading: pdfLoading, url, error } = useInvoicePdfInstance();const [isLoading, setIsLoading] = useState(false);- const [inAppBrowserToastShown, setInAppBrowserToastShown] = useState(false);-const isTelegramPreviewBrowser = isTelegramInAppBrowser();const handleDownloadPDFClick = useCallback(@@ -132,19 +122,25 @@ export function InvoicePDFDownloadLink({},});- updateAppMetadata((current) => ({- ...current,- invoiceDownloadCount: (current?.invoiceDownloadCount ?? 0) + 1,- }));+ updateAppMetadata((current) => {+ return {+ ...current,+ invoiceDownloadCount: (current?.invoiceDownloadCount ?? 0) + 1,+ };+ });// close all other toasts (if any)toast.dismiss();- markCTAActionTriggered();+ // downloading the PDF is the only thing that shows the CTA toast, and it+ // is shown at most once every 24 hours (cooldown lives in `useCTAToast`)+ if (!hasTriggeredCTAAction) {+ markCTAActionTriggered();- setTimeout(() => {- showRandomCTAToast();- }, CTA_TOAST_TIMEOUT);+ setTimeout(() => {+ showCTAToast();+ }, CTA_TOAST_TIMEOUT);+ }}},[@@ -156,103 +152,38 @@ export function InvoicePDFDownloadLink({error,isMobile,invoiceData.template,+ hasTriggeredCTAAction,markCTAActionTriggered,],);- // Memoize static values- const filename = useMemo(() => {- const invoiceNumberValue = invoiceData?.invoiceNumberObject?.value;+ const invoiceNumberValue = invoiceData?.invoiceNumberObject?.value;- // Replace all slashes with dashes (e.g. 01/2025 -> 01-2025)- const formattedInvoiceNumber = invoiceNumberValue- ? invoiceNumberValue?.replace(/\//g, "-")- : dayjs().format("MM-YYYY"); // Fallback to current month and year if no invoice number+ // Replace all slashes with dashes (e.g. 01/2025 -> 01-2025)+ const formattedInvoiceNumber = invoiceNumberValue+ ? invoiceNumberValue?.replaceAll("/", "-")+ : dayjs().format("MM-YYYY"); // Fallback to current month and year if no invoice number- const name = `invoice-${invoiceData?.language?.toUpperCase()}-${formattedInvoiceNumber}.pdf`;-- return name;- }, [invoiceData?.language, invoiceData?.invoiceNumberObject]);-- const PdfDocument = useMemo(() => {- switch (invoiceData.template) {- case "stripe":- return (- <StripeInvoicePdfTemplate- invoiceData={invoiceData}- qrCodeDataUrl={qrCodeDataUrl}- />- );- case "default":- default:- return (- <InvoicePdfTemplate- invoiceData={invoiceData}- qrCodeDataUrl={qrCodeDataUrl}- />- );- }- }, [invoiceData, qrCodeDataUrl]);-- // Handle PDF updates- useEffect(() => {- updatePdfInstance(PdfDocument);- }, [PdfDocument, updatePdfInstance]);+ const filename = `invoice-${invoiceData?.language?.toUpperCase()}-${formattedInvoiceNumber}.pdf`;// Handle loading state (for better UX)useEffect(() => {if (!pdfLoading) {- const timer = setTimeout(- () => setIsLoading(false),- LOADING_BUTTON_TIMEOUT,- );- return () => clearTimeout(timer);- }- setIsLoading(true);- }, [pdfLoading]);-- // Handle errors- useEffect(() => {- if (error && !errorWhileGeneratingPdfIsShown) {- ErrorGeneratingPdfToast();- setErrorWhileGeneratingPdfIsShown(true);+ const timer = setTimeout(() => {+ return setIsLoading(false);+ }, LOADING_BUTTON_TIMEOUT);- umamiTrackEvent("error_generating_document_link", { data: { error } });- Sentry.captureException(error);+ return () => {+ return clearTimeout(timer);+ };}- }, [- error,- errorWhileGeneratingPdfIsShown,- setErrorWhileGeneratingPdfIsShown,- ]);+ // oxlint-disable-next-line react/set-state-in-effect -- `pdfLoading` comes from the shared PDF instance, and the button holds its loading state for `LOADING_BUTTON_TIMEOUT` after it clears; there is no event here to derive this from+ setIsLoading(true);- // Show a toast if the user is in an in-app browser- useEffect(() => {- if (- (inAppInfo?.isInApp || isTelegramPreviewBrowser) &&- !inAppBrowserToastShown- ) {- toast.info("In-App Browser Detected", {- description: (- <p>- For the best experience, please open this page in{" "}- <span className="font-bold">Chrome</span> or{" "}- <span className="font-bold">Safari</span> browser.- </p>- ),- id: "in-app-browser-toast", // To prevent duplicate toasts- duration: Infinity,- icon: "⚠️",- position: isMobile ? "top-center" : "bottom-right",- });- setInAppBrowserToastShown(true);- }- }, [- inAppInfo?.isInApp,- inAppBrowserToastShown,- isTelegramPreviewBrowser,- isMobile,- ]);+ // it's ok to return here+ // oxlint-disable-next-line no-useless-return+ return;+ }, [pdfLoading]);return (<CustomTooltipdiff --git a/src/app/(app)/components/invoice-pdf-download-multiple-languages.tsx b/src/app/(app)/components/invoice-pdf-download-multiple-languages.tsxindex d4f83b0..fd55226 100644--- a/src/app/(app)/components/invoice-pdf-download-multiple-languages.tsx+++ b/src/app/(app)/components/invoice-pdf-download-multiple-languages.tsx@@ -1,20 +1,20 @@"use client";-import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";import { pdf } from "@react-pdf/renderer/lib/react-pdf.browser";import { saveAs } from "file-saver";import JSZip from "jszip";+import { useState } from "react";import { toast } from "sonner";++import { InvoicePdfTemplate } from "@/app/(app)/components/invoice-templates/invoice-pdf-default-template";import {LANGUAGE_TO_LABEL,SUPPORTED_LANGUAGES,type InvoiceData,type SupportedLanguages,} from "@/app/schema";-import { InvoicePdfTemplate } from "@/app/(app)/components/invoice-templates/invoice-pdf-default-template";-import { MultiSelect } from "@/components/ui/multi-select";-import { useEffect, useState } from "react";+import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";const SUPPORTED_LANGUAGES_OPTIONS = SUPPORTED_LANGUAGES.map((language) => {return {@@ -41,11 +41,15 @@ export function InvoicePDFDownloadMultipleLanguages({SupportedLanguages[]>([language]);- useEffect(() => {- if (language) {- setSelectedLanguages([language]);- }- }, [language]);+ // Reset the selection to the invoice language whenever the invoice language+ // changes. Adjusting state during render (instead of in an effect) avoids the+ // extra render pass that would otherwise show the stale selection first.+ // https://react.dev/learn/you-might-not-need-an-effect#adjusting-some-state-when-a-prop-changes+ const [previousLanguage, setPreviousLanguage] = useState(language);+ if (language && language !== previousLanguage) {+ setPreviousLanguage(language);+ setSelectedLanguages([language]);+ }const generateAndZipPDFs = async (selectedLanguages: SupportedLanguages[],@@ -116,9 +120,13 @@ export function InvoicePDFDownloadMultipleLanguages({placeholder="Download PDF"variant="inverted"maxCount={3}- handleDownload={() =>- generateAndZipPDFs(selectedLanguages.map((lang) => lang))- }+ handleDownload={() => {+ return generateAndZipPDFs(+ selectedLanguages.map((lang) => {+ return lang;+ }),+ );+ }}/></>);diff --git a/src/app/(app)/components/invoice-pdf-preview/desktop-pdf-viewer.tsx b/src/app/(app)/components/invoice-pdf-preview/desktop-pdf-viewer.tsxindex d645657..d645276 100644--- a/src/app/(app)/components/invoice-pdf-preview/desktop-pdf-viewer.tsx+++ b/src/app/(app)/components/invoice-pdf-preview/desktop-pdf-viewer.tsx@@ -1,16 +1,12 @@"use client";-import { PDFViewer } from "@react-pdf/renderer/lib/react-pdf.browser";+import { useInvoicePdfInstance } from "@/app/(app)/contexts/invoice-pdf-instance-context";import { BUG_REPORT_URL } from "@/config";-export function DesktopInvoicePDFViewer({- children,- errorWhileGeneratingPdfIsShown,-}: {- children: React.ReactNode;- errorWhileGeneratingPdfIsShown: boolean;-}) {- if (errorWhileGeneratingPdfIsShown) {+export function DesktopInvoicePDFViewer() {+ const { url, error } = useInvoicePdfInstance();++ if (error) {return (<div className="flex h-[580px] w-full items-center justify-center border border-gray-200 bg-gray-200 lg:h-[620px] 2xl:h-[700px]"><div className="text-center">@@ -34,15 +30,16 @@ export function DesktopInvoicePDFViewer({);}+ // This is what react-pdf's own `<PDFViewer>` renders, minus its built-in `usePDF()` call.+ // We render the iframe ourselves so the PDF can come from the single shared instance,+ // see `InvoicePdfInstanceProvider` for why having a second instance here was a problem.return (- <PDFViewer+ <iframe+ src={url ? `${url}#toolbar=1` : undefined}width="100%"className="mb-4 h-full w-full"title="Invoice PDF Viewer"data-testid="pdf-preview"- >- {/* @ts-expect-error PR with fix?: https://github.com/diegomura/react-pdf/pull/2888 */}- {children}- </PDFViewer>+ />);}diff --git a/src/app/(app)/components/invoice-pdf-preview/mobile-pdf-viewer.tsx b/src/app/(app)/components/invoice-pdf-preview/mobile-pdf-viewer.tsxindex afdd73f..a8ace65 100644--- a/src/app/(app)/components/invoice-pdf-preview/mobile-pdf-viewer.tsx+++ b/src/app/(app)/components/invoice-pdf-preview/mobile-pdf-viewer.tsx@@ -1,13 +1,9 @@-import type { InvoiceData } from "@/app/schema";-import { BlobProvider } from "@react-pdf/renderer/lib/react-pdf.browser";+import * as Sentry from "@sentry/nextjs";+import { useState } from "react";import { Document, Page } from "react-pdf";-import { InvoicePdfTemplate } from "@/app/(app)/components/invoice-templates/invoice-pdf-default-template";-import { StripeInvoicePdfTemplate } from "@/app/(app)/components/invoice-templates/invoice-pdf-stripe-template";-+import { useInvoicePdfInstance } from "@/app/(app)/contexts/invoice-pdf-instance-context";import { BUG_REPORT_URL } from "@/config";-import * as Sentry from "@sentry/nextjs";-import { useMemo, useState } from "react";// This import registers the PDF.js worker globally so that react-pdf can render PDFs in the browser.// https://github.com/wojtekmaj/react-pdf/issues/1824#issuecomment-2266150831@@ -23,84 +19,122 @@ import "pdfjs-dist/build/pdf.worker.min.mjs";** **PDF viewer we use on mobile devices:** https://github.com/wojtekmaj/react-pdf*/-export const MobileInvoicePDFViewer = ({- invoiceData,- qrCodeDataUrl,-}: {- invoiceData: InvoiceData;- qrCodeDataUrl: string;-}) => {+export const MobileInvoicePDFViewer = () => {const [key, setKey] = useState(0);const [numPages, setNumPages] = useState(0);- const memoizedInvoicePdfTemplate = useMemo(() => {- switch (invoiceData.template) {- case "stripe":- return (- <StripeInvoicePdfTemplate- invoiceData={invoiceData}- qrCodeDataUrl={qrCodeDataUrl}- />- );- case "default":- default:- return (- <InvoicePdfTemplate- invoiceData={invoiceData}- qrCodeDataUrl={qrCodeDataUrl}- />- );- }- }, [invoiceData, qrCodeDataUrl]);+ // The PDF itself is generated once by `InvoicePdfInstanceProvider` and shared with the+ // download button, we only turn the resulting blob URL into a scrollable preview here.+ //+ // `loading` is deliberately not read: while a new version is generated `usePDF` keeps+ // serving the previous `url`, so we keep the document we already have on screen. Reacting+ // to `loading` would unmount it on every edit of the form, and that costs a full re-parse+ // (plus a spinner) even when the viewer sits in the closed tab.+ const { url, error } = useInvoicePdfInstance();// On mobile, we need to use the 'react-pdf' (https://github.com/wojtekmaj/react-pdf) to generate a PDF preview// This is because the PDF viewer is not supported on Android Chrome devices// https://github.com/diegomura/react-pdf/issues/714- return (- <BlobProvider document={memoizedInvoicePdfTemplate}>- {({ url, loading, error }) => {- if (error) {- return (- <div className="flex h-[520px] w-[650px] items-center justify-center border border-gray-200 bg-gray-200 lg:h-[620px] 2xl:h-[700px]">- <div className="text-center">- <p className="text-red-600">Error generating PDF preview</p>- <p className="mx-6 mt-2 text-balance text-sm text-gray-600">- Something went wrong.- <br /> Please try refreshing the page or using the{" "}- <span className="font-bold">Chrome</span> browser. If the- issue persists, please fill a bug report{" "}- <a- href={BUG_REPORT_URL}- className="underline"- target="_blank"- rel="noopener noreferrer"- >- here.- </a>- </p>- </div>- </div>- );- }+ if (error) {+ return (+ <div className="flex h-[520px] w-[650px] items-center justify-center border border-gray-200 bg-gray-200 lg:h-[620px] 2xl:h-[700px]">+ <div className="text-center">+ <p className="text-red-600">Error generating PDF preview</p>+ <p className="mx-6 mt-2 text-balance text-sm text-gray-600">+ Something went wrong.+ <br /> Please try refreshing the page or using the{" "}+ <span className="font-bold">Chrome</span> browser. If the issue+ persists, please fill a bug report{" "}+ <a+ href={BUG_REPORT_URL}+ className="underline"+ target="_blank"+ rel="noopener noreferrer"+ >+ here.+ </a>+ </p>+ </div>+ </div>+ );+ }- if (loading || !url) {- return (- <div className="flex h-[520px] w-[650px] items-center justify-center border border-gray-200 bg-gray-200 lg:h-[620px] 2xl:h-[700px]">- <div className="text-center">- <div className="mx-auto mb-4 h-8 w-8 animate-spin rounded-full border-4 border-blue-500 border-t-transparent" />- <p className="text-gray-600">Loading PDF viewer...</p>- </div>- </div>- );- }+ // Only the very first render has nothing to show at all+ if (!url) {+ return (+ <div className="flex h-[520px] w-[650px] items-center justify-center border border-gray-200 bg-gray-200 lg:h-[620px] 2xl:h-[700px]">+ <div className="text-center">+ <div className="mx-auto mb-4 h-8 w-8 animate-spin rounded-full border-4 border-blue-500 border-t-transparent" />+ <p className="text-gray-600">Loading PDF viewer...</p>+ </div>+ </div>+ );+ }++ // https://github.com/wojtekmaj/react-pdf+ return (+ <Document+ // we use a key to force a re-render of the PDF viewer in case of error+ key={key}+ file={url}+ noData={+ <div className="flex h-[520px] w-full items-center justify-center border border-gray-200 bg-gray-200 lg:h-[620px] 2xl:h-[700px]">+ <div className="text-center">+ <p className="text-gray-600">No PDF file found</p>+ </div>+ </div>+ }+ className="h-[520px] w-[650px] overflow-auto border border-slate-100 lg:h-[620px] 2xl:h-[700px]"+ loading={+ <div className="flex h-[520px] w-full items-center justify-center border border-gray-200 bg-gray-200 lg:h-[620px] 2xl:h-[700px]">+ <div className="text-center">+ <div className="mx-auto mb-4 h-8 w-8 animate-spin rounded-full border-4 border-blue-500 border-t-transparent" />+ <p className="text-gray-600">Loading PDF viewer...</p>+ </div>+ </div>+ }+ onLoadSuccess={({ numPages }) => {+ // to render the correct number of pages in the PDF viewer+ setNumPages(numPages);+ }}+ onLoadError={(error) => {+ console.error(error);- // https://github.com/wojtekmaj/react-pdf+ // Force a re-render of the PDF viewer to try to recover from error+ setKey((prev) => {+ return prev + 1;+ });+ }}+ error={+ <div className="flex h-[520px] w-full items-center justify-center border border-gray-200 bg-gray-200 lg:h-[620px] 2xl:h-[700px]">+ <div className="text-center">+ <p className="text-balance text-red-600">+ Error generating PDF preview. Please refresh the page or use a+ different browser. If the issue persists, please file a{" "}+ <a+ href="https://pdfinvoicegenerator.userjot.com/board/bugs?cursor=1&order=top&limit=10"+ target="_blank"+ rel="noopener noreferrer"+ className="text-blue-600 underline hover:text-blue-800"+ >+ bug report+ </a>+ .+ </p>+ </div>+ </div>+ }+ >+ {Array.from({ length: numPages }, (_, index) => {return (- <Document- // we use a key to force a re-render of the PDF viewer in case of error- key={key}- file={url || ""}- className="h-[520px] w-[650px] overflow-auto border border-slate-100 lg:h-[620px] 2xl:h-[700px]"+ <Page+ key={`page-${index + 1}`}+ // we add some space between pages to make it easier to see the page break+ className={+ index < numPages - 1 ? "border-b-[15px] border-gray-200" : ""+ }+ pageNumber={index + 1}+ error={"Something went wrong"}loading={<div className="flex h-[520px] w-full items-center justify-center border border-gray-200 bg-gray-200 lg:h-[620px] 2xl:h-[700px]"><div className="text-center">@@ -109,63 +143,14 @@ export const MobileInvoicePDFViewer = ({</div></div>}- onLoadSuccess={({ numPages }) => {- // to render the correct number of pages in the PDF viewer- setNumPages(numPages);- }}onLoadError={(error) => {- console.error(error);-- // Force a re-render of the PDF viewer to try to recover from error- setKey((prev) => prev + 1);+ Sentry.captureException(error);}}- error={- <div className="flex h-[520px] w-full items-center justify-center border border-gray-200 bg-gray-200 lg:h-[620px] 2xl:h-[700px]">- <div className="text-center">- <p className="text-balance text-red-600">- Error generating PDF preview. Please refresh the page or use- a different browser. If the issue persists, please file a{" "}- <a- href="https://pdfinvoicegenerator.userjot.com/board/bugs?cursor=1&order=top&limit=10"- target="_blank"- rel="noopener noreferrer"- className="text-blue-600 underline hover:text-blue-800"- >- bug report- </a>- .- </p>- </div>- </div>- }- >- {Array.from({ length: numPages }, (_, index) => (- <Page- key={`page-${index + 1}`}- // we add some space between pages to make it easier to see the page break- className={- index < numPages - 1 ? "border-b-[15px] border-gray-200" : ""- }- pageNumber={index + 1}- error={"Something went wrong"}- loading={- <div className="flex h-[520px] w-full items-center justify-center border border-gray-200 bg-gray-200 lg:h-[620px] 2xl:h-[700px]">- <div className="text-center">- <div className="mx-auto mb-4 h-8 w-8 animate-spin rounded-full border-4 border-blue-500 border-t-transparent" />- <p className="text-gray-600">Loading PDF viewer...</p>- </div>- </div>- }- onLoadError={(error) => {- Sentry.captureException(error);- }}- height={450}- width={650}- />- ))}- </Document>+ height={450}+ width={650}+ />);- }}- </BlobProvider>+ })}+ </Document>);};diff --git a/src/app/(app)/components/invoice-templates/__tests__/fontkit-glyph-cache-patch.test.ts b/src/app/(app)/components/invoice-templates/__tests__/fontkit-glyph-cache-patch.test.tsnew file mode 100644index 0000000..f326926--- /dev/null+++ b/src/app/(app)/components/invoice-templates/__tests__/fontkit-glyph-cache-patch.test.ts@@ -0,0 +1,193 @@+import fs from "node:fs";+import { createRequire } from "node:module";+import path from "node:path";++import { describe, expect, it } from "vitest";++/**+ * Regression test for `patches/[email protected]`.+ *+ * fontkit caches Glyph objects keyed by glyph id and bakes the characters they+ * came from in at first creation. Accented letters are composite glyphs, and+ * decomposing one looks its components up *without* characters - so rendering+ * `ã ç é ó` used to cache the base letters `a c e o` with an empty `codePoints`.+ *+ * `@react-pdf/font` keeps the parsed font in a module-level store shared by+ * every render on the page, so one such render corrupted all later ones: the+ * PDF lost the ToUnicode entries for those glyphs and dropped them from the+ * output, which is how `Cobrar de` ended up rendering as `obrar de`.+ *+ * The patch evicts such a glyph so the next lookup rebuilds it. Eviction rather+ * than repairing `codePoints` in place, because the Glyph constructor derives+ * `isMark` and `isLigature` from them - patching the array leaves those stale,+ * and `isMark` drives GPOS mark attachment.+ *+ * This test fails if the patch stops being applied - which can happen silently,+ * e.g. after a fontkit upgrade or a half-broken `node_modules`.+ *+ * Upstream issue: https://github.com/foliojs/fontkit/issues/154 (open since 2018).+ * Eviction approach: https://github.com/foliojs/fontkit/issues/154#issuecomment-4187174366+ *+ * See `patches/README.md`. Delete this test once the upstream fix ships.+ */++/** Resolve the very fontkit instance `@react-pdf/renderer` renders with. */+const resolveAppFontkit = async () => {+ const require = createRequire(import.meta.url);++ const rendererPkg = require.resolve("@react-pdf/renderer/package.json");+ const fontPkg = createRequire(rendererPkg).resolve(+ "@react-pdf/font/package.json",+ );+ const fontkitEntry = createRequire(fontPkg).resolve("fontkit");++ const imported: unknown = await import(fontkitEntry);+ const fontkit = ((imported as { default?: unknown }).default ?? imported) as {+ create: (data: Uint8Array) => FontkitFont;+ };++ return { fontkit, fontkitEntry };+};++interface FontkitGlyph {+ id: number;+ codePoints: number[];+ path: unknown;+}++interface FontkitFont {+ glyphForCodePoint: (codePoint: number) => FontkitGlyph;+ layout: (+ text: string,+ features?: unknown,+ script?: unknown,+ language?: unknown,+ direction?: string,+ ) => { glyphs: FontkitGlyph[] };+ _glyphs: Record<number, FontkitGlyph | undefined>;+}++/**+ * A real TrueType font with composite accented glyphs. It ships with+ * `pdfjs-dist` (a direct dependency), so the test needs no committed asset and+ * no network.+ */+const loadTestFont = (fontkit: { create: (d: Uint8Array) => FontkitFont }) => {+ const require = createRequire(import.meta.url);+ const pdfjsEntry = require.resolve("pdfjs-dist/legacy/build/pdf.mjs");+ const fontPath = path.join(+ pdfjsEntry,+ "../../../standard_fonts/LiberationSans-Regular.ttf",+ );++ if (!fs.existsSync(fontPath)) {+ throw new Error(+ `Test font not found at ${fontPath}. If pdfjs-dist changed its layout, point this test at another TTF with composite glyphs.`,+ );+ }++ return fontkit.create(new Uint8Array(fs.readFileSync(fontPath)));+};++/** The accented characters whose components are the letters that got corrupted */+const COMPOSITE_CHARS = ["ã", "ç", "é", "ó"] as const;+const BASE_LETTERS = ["a", "c", "e", "o"] as const;++/** Force fontkit to decompose a composite glyph, which is what poisons the cache */+const decomposeCompositeGlyphs = (font: FontkitFont) => {+ for (const char of COMPOSITE_CHARS) {+ const glyph = font.glyphForCodePoint(char.codePointAt(0) as number);++ // reading `path` runs _getContours(), which resolves the components+ void glyph.path;+ }+};++/** A glyph with no codePoints loses its ToUnicode entry and gets dropped */+const hasCodePoints = (glyph: FontkitGlyph) => {+ return (glyph.codePoints ?? []).length > 0;+};++const codePointsOfCachedGlyph = (font: FontkitFont, letter: string) => {+ const id = font.glyphForCodePoint(letter.codePointAt(0) as number).id;++ return font._glyphs[id]?.codePoints;+};++describe("fontkit glyph cache patch", () => {+ it("is applied to the fontkit that @react-pdf renders with", async () => {+ const { fontkitEntry } = await resolveAppFontkit();+ const source = fs.readFileSync(fontkitEntry, "utf8");++ // Deliberately checks the file *contents*, not the path: pnpm can recreate+ // the `[email protected]_patch_hash=...` directory with unpatched contents, so+ // the directory name proves nothing.+ //+ // It also pins the *approach*. An earlier version of this patch repaired+ // `codePoints` in place, which leaves the constructor-derived `isMark` and+ // `isLigature` stale; only eviction rebuilds them. That difference is not+ // covered behaviourally below because it needs a font with combining marks+ // and none ship with our dependencies - see patches/README.md.+ expect(+ source,+ `fontkit at ${fontkitEntry} does not contain the patch. Run \`pnpm install --force\`.`,+ ).toContain("this._glyphs[glyph] = null");+ });++ it("maps base letters to their codePoints on a clean font", async () => {+ const { fontkit } = await resolveAppFontkit();+ const font = loadTestFont(fontkit);++ // Guards the premise of the test below: if this font ever stopped mapping+ // these letters, the regression test would pass for the wrong reason.+ for (const letter of BASE_LETTERS) {+ expect(codePointsOfCachedGlyph(font, letter)).toEqual([+ letter.codePointAt(0),+ ]);+ }+ });++ it("keeps codePoints on base letters first created by composite decomposition", async () => {+ const { fontkit } = await resolveAppFontkit();+ // A FRESH font: the poisoning only happens when a base letter's very first+ // cache entry comes from decomposing a composite. Touching the letters+ // beforehand (as the previous test does) populates the cache correctly and+ // defuses the bug, so this must be its own font instance.+ const font = loadTestFont(fontkit);++ decomposeCompositeGlyphs(font);++ // without the patch these all come back as []+ for (const letter of BASE_LETTERS) {+ expect(+ codePointsOfCachedGlyph(font, letter),+ `"${letter}" lost its codePoints after composite decomposition - the fontkit patch is not in effect`,+ ).toEqual([letter.codePointAt(0)]);+ }+ });++ it("still lays out text with complete codePoints after decomposition", async () => {+ const { fontkit } = await resolveAppFontkit();+ const font = loadTestFont(fontkit);++ decomposeCompositeGlyphs(font);++ // "Data de emissao" is the label that lost its D in the reported bug+ const { glyphs } = font.layout(+ "Data de emissao",+ undefined,+ undefined,+ undefined,+ "ltr",+ );++ const withoutCodePoints = glyphs.filter((glyph) => {+ return !hasCodePoints(glyph);+ });++ expect(+ withoutCodePoints,+ "glyphs without codePoints lose their ToUnicode entry and get dropped from the PDF",+ ).toHaveLength(0);+ });+});diff --git a/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/index.tsx b/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/index.tsxindex 12fe300..d5e0430 100644--- a/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/index.tsx+++ b/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/index.tsx@@ -1,12 +1,14 @@-import { type InvoiceData } from "@/app/schema";-import { INVOICE_PDF_FONTS } from "@/config";import {Document,Font,Page,StyleSheet,+ type Styles,} from "@react-pdf/renderer/lib/react-pdf.browser";-import { memo } from "react";++import { type InvoiceData } from "@/app/schema";+import { INVOICE_PDF_FONTS } from "@/config";+import { InvoiceBody } from "./invoice-body";// Open sans seems to be working fine with EN and PL@@ -187,10 +189,10 @@ export const PDF_DEFAULT_TEMPLATE_STYLES = StyleSheet.create({justifyContent: "space-between",alignItems: "center",},-} as const);+} as const satisfies Styles);// Memoize the PDF Document component-export const InvoicePdfTemplate = memo(function InvoicePdfTemplate({+export function InvoicePdfTemplate({invoiceData,qrCodeDataUrl,}: {@@ -202,7 +204,8 @@ export const InvoicePdfTemplate = memo(function InvoicePdfTemplate({const invoiceNumberValue = invoiceData?.invoiceNumberObject?.value;const invoiceNumber = `${invoiceNumberLabel} ${invoiceNumberValue}`;- const invoiceDocTitle = `${invoiceNumber} | Created with https://easyinvoicepdf.com`;+ const invoiceDocTitle =+ `${invoiceNumber} | Created with https://easyinvoicepdf.com` as const;return (<Document title={invoiceDocTitle}>@@ -215,4 +218,4 @@ export const InvoicePdfTemplate = memo(function InvoicePdfTemplate({</Page></Document>);-});+}diff --git a/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-body.tsx b/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-body.tsxindex 4cb4106..dc5aa0a 100644--- a/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-body.tsx+++ b/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-body.tsx@@ -1,6 +1,11 @@-import { type InvoiceData } from "@/app/schema";-import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";import { Text, View } from "@react-pdf/renderer/lib/react-pdf.browser";+import dayjs from "dayjs";++import { InvoiceQRCode } from "@/app/(app)/components/invoice-templates/common/invoice-qr-code";+import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import { type InvoiceData } from "@/app/schema";++import type { PDF_DEFAULT_TEMPLATE_STYLES } from ".";import { InvoiceFooter } from "./invoice-footer";import { InvoiceHeader } from "./invoice-header";import { InvoiceItemsTable } from "./invoice-items-table";@@ -8,10 +13,6 @@ import { InvoicePaymentInfo } from "./invoice-payment-info";import { InvoicePaymentTotals } from "./invoice-payment-totals";import { InvoiceSellerBuyerInfo } from "./invoice-seller-buyer-info";import { InvoiceVATSummaryTable } from "./invoice-vat-summary-table";-import type { PDF_DEFAULT_TEMPLATE_STYLES } from ".";-import { InvoiceQRCode } from "@/app/(app)/components/invoice-templates/common/invoice-qr-code";--import dayjs from "dayjs";import "dayjs/locale/en";import "dayjs/locale/pl";import "dayjs/locale/de";diff --git a/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-footer.tsx b/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-footer.tsxindex d8ca2ee..80e5559 100644--- a/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-footer.tsx+++ b/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-footer.tsx@@ -1,10 +1,12 @@-import { type InvoiceData } from "@/app/schema";-import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";-import { PROD_WEBSITE_URL } from "@/config";import { Link, Text, View } from "@react-pdf/renderer/lib/react-pdf.browser";import dayjs from "dayjs";-import { formatCurrency } from "../../../utils/format-currency";++import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import { type InvoiceData } from "@/app/schema";+import { PROD_WEBSITE_URL } from "@/config";+import type { PDF_DEFAULT_TEMPLATE_STYLES } from ".";+import { formatCurrency } from "../../../utils/format-currency";export function InvoiceFooter({invoiceData,@@ -56,9 +58,9 @@ export function InvoiceFooter({</View><Textstyle={[styles.fontSize8]}- render={({ pageNumber, totalPages }) =>- `${t.stripe.page} ${pageNumber} ${t.stripe.of} ${totalPages}`- }+ render={({ pageNumber, totalPages }) => {+ return `${t.stripe.page} ${pageNumber} ${t.stripe.of} ${totalPages}`;+ }}/></View></View>diff --git a/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-header.tsx b/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-header.tsxindex da5b4d4..89bcde3 100644--- a/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-header.tsx+++ b/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-header.tsx@@ -1,5 +1,4 @@import { Image, Text, View } from "@react-pdf/renderer/lib/react-pdf.browser";-import { type InvoiceData } from "@/app/schema";import dayjs from "dayjs";import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";@@ -7,6 +6,8 @@ import {formatDateOfServiceEnd,formatServicePeriodRange,} from "@/app/(app)/utils/format-service-period";+import { type InvoiceData } from "@/app/schema";+import type { PDF_DEFAULT_TEMPLATE_STYLES } from ".";function HeaderDates({diff --git a/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-items-table.tsx b/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-items-table.tsxindex 8778b36..12809bd 100644--- a/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-items-table.tsx+++ b/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-items-table.tsx@@ -1,6 +1,8 @@import { Text, View } from "@react-pdf/renderer/lib/react-pdf.browser";-import type { InvoiceData } from "@/app/schema";+import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import type { InvoiceData } from "@/app/schema";+import type { PDF_DEFAULT_TEMPLATE_STYLES } from ".";export function InvoiceItemsTable({@@ -53,7 +55,7 @@ export function InvoiceItemsTable({return (<View style={{ marginBottom: 5, marginTop: 14 }}><View style={styles.table}>- {/*+ {/*START: Table header row with columns*/}<View style={[styles.tableRow, { borderTopWidth: 1 }]} fixed>@@ -77,6 +79,9 @@ export function InvoiceItemsTable({{isTypeOfGTUFieldVisible ? (<View style={[styles.tableCol, styles.colGTU, styles.center]}><Text style={styles.tableCellBold}>+ {/* .split("") is used for long text like "Type of Goods/Service" to wrap it in a new line+ https://github.com/diegomura/react-pdf/issues/2243#issuecomment-1778554041+ */}{t.invoiceItemsTable.typeOfGTU.split("")}</Text></View>@@ -86,7 +91,6 @@ export function InvoiceItemsTable({{isAmountFieldVisible ? (<View style={[styles.tableCol, styles.colAmount, styles.center]}><Text style={[styles.tableCellBold]}>- {/* https://github.com/diegomura/react-pdf/issues/2243#issuecomment-1778554041 */}{t.invoiceItemsTable.amount.split("")}</Text></View>@@ -140,11 +144,11 @@ export function InvoiceItemsTable({</View>) : null}</View>- {/*+ {/*END: Table header columns*/}- {/*+ {/*START: Table body rows*/}{invoiceData?.items.map((item, index) => {@@ -332,33 +336,28 @@ export function InvoiceItemsTable({</View>);})}- {/*+ {/*END: Table body rows*/}- {/*+ {/*START: Table footer*/}<View style={styles.tableRow} wrap={false} minPresenceAhead={60}>- {/* Empty cells */}- <View style={[styles.tableCol, { borderRight: 0 }]}></View>-- <View style={[styles.tableCol, { borderRight: 0 }]}></View>-- <View style={[styles.tableCol, { borderRight: 0 }]}></View>-- <View style={[styles.tableCol, { borderRight: 0 }]}></View>-- <View style={[styles.tableCol, { borderRight: 0 }]}></View>-- <View style={[styles.tableCol, { borderRight: 0 }]}></View>-- <View style={[styles.tableCol, { borderRight: 0 }]}></View>-- <View style={[styles.tableCol, { borderRight: 0 }]}></View>-- <View style={[styles.tableCol, { borderRight: 0 }]}></View>-+ {/* This section renders the table footer row that displays the total/sum for the invoice,+ with the first nine columns as empty.+ View components serving as placeholders to align the sum to the final column. */}+ <View style={[styles.tableCol, { borderRightWidth: 0 }]}></View>+ <View style={[styles.tableCol, { borderRightWidth: 0 }]}></View>+ <View style={[styles.tableCol, { borderRightWidth: 0 }]}></View>+ <View style={[styles.tableCol, { borderRightWidth: 0 }]}></View>+ <View style={[styles.tableCol, { borderRightWidth: 0 }]}></View>+ <View style={[styles.tableCol, { borderRightWidth: 0 }]}></View>+ <View style={[styles.tableCol, { borderRightWidth: 0 }]}></View>+ <View style={[styles.tableCol, { borderRightWidth: 0 }]}></View>+ <View style={[styles.tableCol, { borderRightWidth: 0 }]}></View>++ {/* The last cell spans the remaining width and contains the sum label and value */}<View style={[styles.tableCol, { width: "100%" }]}><Textstyle={[@@ -371,6 +370,7 @@ export function InvoiceItemsTable({},]}>+ {/* Renders the sum label (e.g., "Total:") followed by the formatted total */}{t.invoiceItemsTable.sum}:{" "}<Text style={[styles.boldText, styles.fontSize8]}>{formattedInvoiceTotal}@@ -378,8 +378,8 @@ export function InvoiceItemsTable({</Text></View></View>- {/*- END: Table footer+ {/*+ END: Table footer row*/}</View></View>diff --git a/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-payment-info.tsx b/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-payment-info.tsxindex 63d6169..32f4ec1 100644--- a/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-payment-info.tsx+++ b/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-payment-info.tsx@@ -1,8 +1,9 @@import { Text, View } from "@react-pdf/renderer/lib/react-pdf.browser";-import type { InvoiceData } from "@/app/schema";import dayjs from "dayjs";import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import type { InvoiceData } from "@/app/schema";+import type { PDF_DEFAULT_TEMPLATE_STYLES } from ".";/**diff --git a/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-payment-totals.tsx b/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-payment-totals.tsxindex 359f184..404a31d 100644--- a/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-payment-totals.tsx+++ b/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-payment-totals.tsx@@ -1,11 +1,12 @@import { View, Text } from "@react-pdf/renderer/lib/react-pdf.browser";-import type { InvoiceData } from "@/app/schema";import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import type { InvoiceData } from "@/app/schema";import {getAmountInWords,getNumberFractionalPart,} from "@/utils/invoice.utils";+import type { PDF_DEFAULT_TEMPLATE_STYLES } from ".";/**diff --git a/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-seller-buyer-info.tsx b/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-seller-buyer-info.tsxindex ff4817f..582007a 100644--- a/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-seller-buyer-info.tsx+++ b/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-seller-buyer-info.tsx@@ -1,6 +1,8 @@import { Text, View } from "@react-pdf/renderer/lib/react-pdf.browser";-import type { InvoiceData } from "@/app/schema";+import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import type { InvoiceData } from "@/app/schema";+import type { PDF_DEFAULT_TEMPLATE_STYLES } from ".";export function InvoiceSellerBuyerInfo({diff --git a/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-vat-summary-table.tsx b/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-vat-summary-table.tsxindex 86390d1..b2be61d 100644--- a/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-vat-summary-table.tsx+++ b/src/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-vat-summary-table.tsx@@ -1,6 +1,8 @@import { Text, View } from "@react-pdf/renderer/lib/react-pdf.browser";-import type { InvoiceData } from "@/app/schema";+import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import type { InvoiceData } from "@/app/schema";+import type { PDF_DEFAULT_TEMPLATE_STYLES } from ".";export function InvoiceVATSummaryTable({@@ -32,13 +34,16 @@ export function InvoiceVATSummaryTable({const sortedItems = [...(invoiceData?.items ?? [])].sort((a, b) => {// Handle cases where either value is a string (NP or OO)- const isAString = isNaN(Number(a.vat));- const isBString = isNaN(Number(b.vat));+ const isAString = Number.isNaN(Number(a.vat));+ const isBString = Number.isNaN(Number(b.vat));- if (isAString && isBString) {- if (typeof a.vat === "string" && typeof b.vat === "string") {- return a.vat.localeCompare(b.vat);- }+ if (+ isAString &&+ isBString &&+ typeof a.vat === "string" &&+ typeof b.vat === "string"+ ) {+ return a.vat.localeCompare(b.vat);}if (isAString) return 1; // Strings go last@@ -48,10 +53,9 @@ export function InvoiceVATSummaryTable({return Number(b.vat) - Number(a.vat);});- const totalNetAmount = sortedItems.reduce(- (acc, item) => acc + item.netAmount,- 0,- );+ const totalNetAmount = sortedItems.reduce((acc, item) => {+ return acc + item.netAmount;+ }, 0);const formattedTotalNetAmount = totalNetAmount.toLocaleString("en-US", {minimumFractionDigits: 2,@@ -59,10 +63,9 @@ export function InvoiceVATSummaryTable({}).replaceAll(",", " ");- const totalVATAmount = sortedItems.reduce(- (acc, item) => acc + item.vatAmount,- 0,- );+ const totalVATAmount = sortedItems.reduce((acc, item) => {+ return acc + item.vatAmount;+ }, 0);const formattedTotalVATAmount = totalVATAmount.toLocaleString("en-US", {minimumFractionDigits: 2,@@ -72,7 +75,7 @@ export function InvoiceVATSummaryTable({return (<View style={[styles.table, { width: "100%" }]}>- {/*+ {/*START: Table header row (top of the VAT summary table)*/}<View style={[styles.tableRow, { borderTopWidth: 1 }]} fixed>@@ -89,11 +92,11 @@ export function InvoiceVATSummaryTable({<Text style={styles.tableCellBold}>{preTaxColumnLabel}</Text></View></View>- {/*+ {/*END: Table header row*/}- {/*+ {/*START: Table body rows*/}{sortedItems?.map((item, index) => {@@ -143,7 +146,7 @@ export function InvoiceVATSummaryTable({{ textAlign: "right", marginRight: 2 },]}>- {isNaN(Number(item.vat)) ? item.vat : `${item.vat}%`}+ {Number.isNaN(Number(item.vat)) ? item.vat : `${item.vat}%`}</Text></View>{/* Net */}@@ -182,11 +185,11 @@ export function InvoiceVATSummaryTable({</View>);})}- {/*+ {/*END: Table body rows*/}- {/*+ {/*START: Total row (bottom of the VAT summary table)*/}<View style={styles.tableRow}>@@ -222,7 +225,7 @@ export function InvoiceVATSummaryTable({</Text></View></View>- {/*+ {/*END: Total row*/}</View>diff --git a/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/index.tsx b/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/index.tsxindex 2f73ac5..ac3fa6e 100644--- a/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/index.tsx+++ b/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/index.tsx@@ -1,6 +1,5 @@"use client";-import { type InvoiceData } from "@/app/schema";import {Document,Font,@@ -10,8 +9,13 @@ import {View,type Styles,} from "@react-pdf/renderer/lib/react-pdf.browser";+import dayjs from "dayjs";++import { InvoiceQRCode } from "@/app/(app)/components/invoice-templates/common/invoice-qr-code";+import { formatCurrency } from "@/app/(app)/utils/format-currency";+import { type InvoiceData } from "@/app/schema";+import { INVOICE_PDF_FONTS } from "@/config";-import { memo } from "react";import { StripeDueAmount } from "./stripe-due-amount";import { StripeFooter } from "./stripe-footer";import { StripeInvoiceHeader } from "./stripe-invoice-header";@@ -19,21 +23,17 @@ import { StripeInvoiceInfo } from "./stripe-invoice-info";import { StripeItemsTable } from "./stripe-items-table";import { StripeSellerBuyerInfo } from "./stripe-seller-buyer-info";import { StripeVatSummaryTableTotals } from "./stripe-totals";-import { formatCurrency } from "@/app/(app)/utils/format-currency";-import { INVOICE_PDF_FONTS } from "@/config";-import "dayjs/locale/en";-import "dayjs/locale/pl";import "dayjs/locale/de";+import "dayjs/locale/en";import "dayjs/locale/es";-import "dayjs/locale/pt";-import "dayjs/locale/ru";-import "dayjs/locale/uk";import "dayjs/locale/fr";import "dayjs/locale/it";import "dayjs/locale/nl";-import dayjs from "dayjs";-import { InvoiceQRCode } from "@/app/(app)/components/invoice-templates/common/invoice-qr-code";+import "dayjs/locale/pl";+import "dayjs/locale/pt";+import "dayjs/locale/ru";+import "dayjs/locale/uk";const fontFamily = "Inter";@@ -215,7 +215,7 @@ export const STRIPE_TEMPLATE_STYLES = StyleSheet.create({},} as const satisfies Styles);-export const StripeInvoicePdfTemplate = memo(function StripeInvoicePdfTemplate({+export function StripeInvoicePdfTemplate({invoiceData,qrCodeDataUrl,}: {@@ -229,7 +229,9 @@ export const StripeInvoicePdfTemplate = memo(function StripeInvoicePdfTemplate({const invoiceNumberValue = invoiceData?.invoiceNumberObject?.value;const invoiceNumber = `${invoiceNumberValue}`;- const invoiceDocTitle = `Invoice ${invoiceNumber} | Created with https://easyinvoicepdf.com`;++ const invoiceDocTitle =+ `Invoice ${invoiceNumber} | Created with https://easyinvoicepdf.com` as const;const formattedInvoiceTotal = formatCurrency({amount: invoiceData?.total,@@ -326,4 +328,4 @@ export const StripeInvoicePdfTemplate = memo(function StripeInvoicePdfTemplate({</Page></Document>);-});+}diff --git a/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-due-amount.tsx b/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-due-amount.tsxindex acc66ff..73a63d7 100644--- a/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-due-amount.tsx+++ b/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-due-amount.tsx@@ -1,9 +1,10 @@import { Text, View, Link } from "@react-pdf/renderer/lib/react-pdf.browser";-import { type InvoiceData } from "@/app/schema";+import dayjs from "dayjs";+import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";-import type { STRIPE_TEMPLATE_STYLES } from ".";+import { type InvoiceData } from "@/app/schema";-import dayjs from "dayjs";+import type { STRIPE_TEMPLATE_STYLES } from ".";import "dayjs/locale/en";import "dayjs/locale/pl";import "dayjs/locale/de";diff --git a/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-footer.tsx b/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-footer.tsxindex 9d12c00..71ec87b 100644--- a/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-footer.tsx+++ b/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-footer.tsx@@ -1,8 +1,9 @@import { Link, Text, View } from "@react-pdf/renderer/lib/react-pdf.browser";-import { type InvoiceData } from "@/app/schema";+import dayjs from "dayjs";+import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import { type InvoiceData } from "@/app/schema";import { PROD_WEBSITE_URL } from "@/config";-import dayjs from "dayjs";import type { STRIPE_TEMPLATE_STYLES } from ".";@@ -51,9 +52,9 @@ export function StripeFooter({</View><Textstyle={[styles.fontSize8]}- render={({ pageNumber, totalPages }) =>- `${t.stripe.page} ${pageNumber} ${t.stripe.of} ${totalPages}`- }+ render={({ pageNumber, totalPages }) => {+ return `${t.stripe.page} ${pageNumber} ${t.stripe.of} ${totalPages}`;+ }}/></View></View>diff --git a/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-invoice-header.tsx b/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-invoice-header.tsxindex de0b060..b9c69fa 100644--- a/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-invoice-header.tsx+++ b/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-invoice-header.tsx@@ -1,6 +1,8 @@import { Image, Text, View } from "@react-pdf/renderer/lib/react-pdf.browser";-import { type InvoiceData } from "@/app/schema";+import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import { type InvoiceData } from "@/app/schema";+import type { STRIPE_TEMPLATE_STYLES } from ".";export function StripeInvoiceHeader({diff --git a/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-invoice-info.tsx b/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-invoice-info.tsxindex 1c195fd..686d310 100644--- a/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-invoice-info.tsx+++ b/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-invoice-info.tsx@@ -1,8 +1,9 @@import { Text, View } from "@react-pdf/renderer/lib/react-pdf.browser";-import { type InvoiceData } from "@/app/schema";import dayjs from "dayjs";import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import { type InvoiceData } from "@/app/schema";+import type { STRIPE_TEMPLATE_STYLES } from ".";export function StripeInvoiceInfo({diff --git a/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-items-table.tsx b/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-items-table.tsxindex dd96293..0350088 100644--- a/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-items-table.tsx+++ b/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-items-table.tsx@@ -1,11 +1,11 @@-import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";-import { formatServicePeriodRange } from "@/app/(app)/utils/format-service-period";-import { formatCurrency } from "@/app/(app)/utils/format-currency";-import type { InvoiceData } from "@/app/schema";import { Text, View } from "@react-pdf/renderer/lib/react-pdf.browser";import dayjs from "dayjs";import type { STRIPE_TEMPLATE_STYLES } from "@/app/(app)/components/invoice-templates/invoice-pdf-stripe-template";+import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import { formatCurrency } from "@/app/(app)/utils/format-currency";+import { formatServicePeriodRange } from "@/app/(app)/utils/format-service-period";+import type { InvoiceData } from "@/app/schema";import "dayjs/locale/de";import "dayjs/locale/en";diff --git a/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-seller-buyer-info.tsx b/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-seller-buyer-info.tsxindex 8c42bc5..8d3b637 100644--- a/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-seller-buyer-info.tsx+++ b/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-seller-buyer-info.tsx@@ -1,6 +1,8 @@import { Text, View } from "@react-pdf/renderer/lib/react-pdf.browser";-import type { InvoiceData } from "@/app/schema";+import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import type { InvoiceData } from "@/app/schema";+import type { STRIPE_TEMPLATE_STYLES } from ".";export function StripeSellerBuyerInfo({diff --git a/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-totals.tsx b/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-totals.tsxindex 51b793b..3ca97b3 100644--- a/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-totals.tsx+++ b/src/app/(app)/components/invoice-templates/invoice-pdf-stripe-template/stripe-totals.tsx@@ -1,9 +1,9 @@import { Text, View } from "@react-pdf/renderer/lib/react-pdf.browser";-import { type InvoiceData } from "@/app/schema";-import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";-import { formatCurrency } from "@/app/(app)/utils/format-currency";import type { STRIPE_TEMPLATE_STYLES } from "@/app/(app)/components/invoice-templates/invoice-pdf-stripe-template";+import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import { formatCurrency } from "@/app/(app)/utils/format-currency";+import { type InvoiceData } from "@/app/schema";/*** Subtotal, total excluding tax, VAT, total and amount due fields@@ -22,10 +22,9 @@ export function StripeVatSummaryTableTotals({const taxLabelText = invoiceData.taxLabelText || "VAT";// Calculate subtotal (sum of all items)- const subtotal = invoiceData.items.reduce(- (sum, item) => sum + item.netAmount,- 0,- );+ const subtotal = invoiceData.items.reduce((sum, item) => {+ return sum + item.netAmount;+ }, 0);const formattedSubtotal = formatCurrency({amount: subtotal,currency: invoiceData.currency,@@ -39,9 +38,9 @@ export function StripeVatSummaryTableTotals({});// Check if any items have numeric VAT values (not "NP" or "OO")- const hasNumericVat = invoiceData.items.some(- (item) => typeof item.vat === "number",- );+ const hasNumericVat = invoiceData.items.some((item) => {+ return typeof item.vat === "number";+ });// we use .reverse() to mimic stripe behaviorconst vatRows = [...(invoiceData?.items ?? [])].reverse();diff --git a/src/app/(app)/contexts/__tests__/invoice-pdf-instance-context.test.tsx b/src/app/(app)/contexts/__tests__/invoice-pdf-instance-context.test.tsxnew file mode 100644index 0000000..58f136a--- /dev/null+++ b/src/app/(app)/contexts/__tests__/invoice-pdf-instance-context.test.tsx@@ -0,0 +1,130 @@+// @vitest-environment happy-dom++import { render } from "@testing-library/react";+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";++import { getInitialInvoiceData } from "@/app/constants";++interface MockPdfState {+ loading: boolean;+ url: string | null;+ error: Error | null;+}++const { mockPdfStateRef } = vi.hoisted(() => {+ const mockPdfStateRef: { current: MockPdfState } = {+ current: {+ loading: false,+ url: "blob:http://localhost/fake-pdf",+ error: null,+ },+ };++ return { mockPdfStateRef };+});++vi.mock("@react-pdf/renderer/lib/react-pdf.browser", async (importOriginal) => {+ const actual = await importOriginal();++ return {+ ...(actual as object),+ usePDF: () => {+ return [mockPdfStateRef.current, vi.fn()];+ },+ };+});++vi.mock("@/components/ui/toasts/error-generating-pdf-toast", () => {+ return {+ ErrorGeneratingPdfToast: vi.fn(),+ };+});++vi.mock("@/lib/umami-analytics-track-event", () => {+ return {+ umamiTrackEvent: vi.fn(),+ };+});++vi.mock("@sentry/nextjs", () => {+ return {+ captureException: vi.fn(),+ };+});++import * as Sentry from "@sentry/nextjs";++import { ErrorGeneratingPdfToast } from "@/components/ui/toasts/error-generating-pdf-toast";+import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";++import { InvoicePdfInstanceProvider } from "../invoice-pdf-instance-context";++function renderProvider() {+ return render(+ <InvoicePdfInstanceProvider+ invoiceData={getInitialInvoiceData()}+ qrCodeDataUrl="data:image/png;base64,abc"+ >+ <p>preview</p>+ </InvoicePdfInstanceProvider>,+ );+}++describe("InvoicePdfInstanceProvider", () => {+ beforeEach(() => {+ vi.clearAllMocks();++ mockPdfStateRef.current = {+ loading: false,+ url: "blob:http://localhost/fake-pdf",+ error: null,+ };+ });++ afterEach(() => {+ vi.restoreAllMocks();+ });++ it("should report a failed PDF generation to the user, analytics and Sentry", () => {+ const pdfError = new Error("PDF generation failed");++ mockPdfStateRef.current = { loading: false, url: null, error: pdfError };++ renderProvider();++ expect(ErrorGeneratingPdfToast).toHaveBeenCalledTimes(1);+ expect(umamiTrackEvent).toHaveBeenCalledWith(+ "error_generating_document_link",+ { data: { error: pdfError } },+ );+ expect(Sentry.captureException).toHaveBeenCalledWith(pdfError);+ });++ it("should report the same failure only once", () => {+ mockPdfStateRef.current = {+ loading: false,+ url: null,+ error: new Error("PDF generation failed"),+ };++ const { rerender } = renderProvider();++ rerender(+ <InvoicePdfInstanceProvider+ invoiceData={getInitialInvoiceData()}+ qrCodeDataUrl="data:image/png;base64,abc"+ >+ <p>preview</p>+ </InvoicePdfInstanceProvider>,+ );++ expect(ErrorGeneratingPdfToast).toHaveBeenCalledTimes(1);+ });++ it("should stay quiet when the PDF generates successfully", () => {+ renderProvider();++ expect(ErrorGeneratingPdfToast).not.toHaveBeenCalled();+ expect(Sentry.captureException).not.toHaveBeenCalled();+ });+});diff --git a/src/app/(app)/contexts/cta-toast-context.tsx b/src/app/(app)/contexts/cta-toast-context.tsxindex 2956c38..e876d11 100644--- a/src/app/(app)/contexts/cta-toast-context.tsx+++ b/src/app/(app)/contexts/cta-toast-context.tsx@@ -2,36 +2,35 @@import { createContext, useContext, useState, useCallback } from "react";-const CTA_TOAST_STORAGE_KEY = "EASY_INVOICE_CTA_LAST_SHOWN_AT";-const CTA_TOAST_COOLDOWN_MS = 7 * 24 * 60 * 60 * 1000; // 7 days+import {+ getAppStorageItem,+ setAppStorageItem,+} from "@/app/(app)/utils/app-local-storage";+import { CTA_TOAST_STORAGE_KEY } from "@/app/schema";++const CTA_TOAST_COOLDOWN_MS = 24 * 60 * 60 * 1000; // 1 dayfunction isCTAToastInCooldown() {- try {- const stored = localStorage.getItem(CTA_TOAST_STORAGE_KEY);- if (!stored) return false;+ const stored = getAppStorageItem(CTA_TOAST_STORAGE_KEY);- // if the timestamp is older than 7 days, return false- return Date.now() - Number(stored) < CTA_TOAST_COOLDOWN_MS;- } catch {- return false;- }+ if (!stored) return false;++ // if the timestamp is older than a day, return false+ return Date.now() - Number(stored) < CTA_TOAST_COOLDOWN_MS;}function setCTAToastShownTimestamp() {- try {- localStorage.setItem(CTA_TOAST_STORAGE_KEY, String(Date.now()));- } catch {}+ setAppStorageItem({+ key: CTA_TOAST_STORAGE_KEY,+ value: String(Date.now()),+ });}interface CTAToastContextValue {- /** Whether a CTA toast was shown within the last 7 days (persisted in localStorage) */+ /** Whether a CTA toast was shown within the last 24 hours (persisted in localStorage) */hasTriggeredCTAAction: boolean;/** Mark that a CTA toast was shown — persists timestamp to localStorage */markCTAActionTriggered: () => void;- /** Number of meaningful interactions (form updates) this session (used to determine if we should show CTA toast) */- interactionCount: number;- /** Increment the interaction counter (call on each form update/pdf re-render) - used to determine if we should show CTA toast */- incrementInteractionCount: () => void;}const CTAToastContext = createContext<CTAToastContextValue | undefined>(@@ -39,27 +38,20 @@ const CTAToastContext = createContext<CTAToastContextValue | undefined>();export function CTAToastProvider({ children }: { children: React.ReactNode }) {- const [hasTriggeredCTAAction, setHasTriggeredCTAAction] = useState(() =>- isCTAToastInCooldown(),- );- const [interactionCount, setInteractionCount] = useState(0);+ const [hasTriggeredCTAAction, setHasTriggeredCTAAction] = useState(() => {+ return isCTAToastInCooldown();+ });const markCTAActionTriggered = useCallback(() => {setCTAToastShownTimestamp();setHasTriggeredCTAAction(true);}, []);- const incrementInteractionCount = useCallback(() => {- setInteractionCount((prevCount) => prevCount + 1);- }, []);-return (<CTAToastContext.Providervalue={{hasTriggeredCTAAction,markCTAActionTriggered,- interactionCount,- incrementInteractionCount,}}>{children}diff --git a/src/app/(app)/contexts/invoice-pdf-instance-context.tsx b/src/app/(app)/contexts/invoice-pdf-instance-context.tsxnew file mode 100644index 0000000..dfc5da1--- /dev/null+++ b/src/app/(app)/contexts/invoice-pdf-instance-context.tsx@@ -0,0 +1,129 @@+"use client";++import { usePDF } from "@react-pdf/renderer/lib/react-pdf.browser";+import * as Sentry from "@sentry/nextjs";+import { createContext, useContext, useEffect, useMemo, useRef } from "react";++import { InvoicePdfTemplate } from "@/app/(app)/components/invoice-templates/invoice-pdf-default-template";+import { StripeInvoicePdfTemplate } from "@/app/(app)/components/invoice-templates/invoice-pdf-stripe-template";+import type { InvoiceData } from "@/app/schema";+import { ErrorGeneratingPdfToast } from "@/components/ui/toasts/error-generating-pdf-toast";+import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";++/** The state of the single PDF render that every consumer on the page shares */+interface InvoicePdfInstance {+ /** `true` while a new version of the PDF is being generated */+ loading: boolean;+ /** Blob URL of the latest generated PDF (used by the preview iframe and the download link) */+ url: string | null;+ /** The latest generated PDF itself */+ blob: Blob | null;+ error: string | null;+}++const InvoicePdfInstanceContext = createContext<InvoicePdfInstance | undefined>(+ undefined,+);++// Render the appropriate template based on the selected template+const renderTemplate = (invoiceData: InvoiceData, qrCodeDataUrl: string) => {+ switch (invoiceData.template) {+ case "stripe":+ return (+ <StripeInvoicePdfTemplate+ invoiceData={invoiceData}+ qrCodeDataUrl={qrCodeDataUrl}+ />+ );+ // listed explicitly so `switch-exhaustiveness-check` covers the union;+ // `default` also catches anything unexpected at runtime+ // oxlint-disable-next-line unicorn/no-useless-switch-case+ case "default":+ default:+ return (+ <InvoicePdfTemplate+ invoiceData={invoiceData}+ qrCodeDataUrl={qrCodeDataUrl}+ />+ );+ }+};++/**+ * Generates the invoice PDF once and shares the result with everything that needs it:+ * the desktop preview, the mobile preview and the "Download PDF" button.+ *+ * `@react-pdf/renderer` keeps its `change` listeners in a module level registry, which means+ * every `usePDF()` / `<PDFViewer>` / `<BlobProvider>` on the page is notified whenever *any*+ * of the others commits. While the preview and the download button each owned an instance,+ * a single invoice edit made both of them render the very same PDF twice - and the preview+ * iframe visibly flickered as its blob URL was swapped for an identical one. Sharing one+ * instance removes the flicker and halves the rendering work.+ */+export function InvoicePdfInstanceProvider({+ invoiceData,+ qrCodeDataUrl,+ children,+}: {+ invoiceData: InvoiceData;+ qrCodeDataUrl: string;+ children: React.ReactNode;+}) {+ const [instance, updatePdfInstance] = usePDF();++ const { error } = instance;++ // Guards the error report so a failure is only announced once. A ref, not state:+ // nothing in the render output depends on it.+ const errorReportedRef = useRef(false);++ // Keep the identity of the document stable, otherwise every re-render of this provider+ // would regenerate an identical PDF (see the effect below, which is keyed on it).+ const pdfDocument = useMemo(() => {+ return renderTemplate(invoiceData, qrCodeDataUrl);+ }, [invoiceData, qrCodeDataUrl]);++ useEffect(() => {+ updatePdfInstance(pdfDocument);+ }, [pdfDocument, updatePdfInstance]);++ // Reporting the failure belongs next to the `usePDF()` call that produced it: every+ // consumer reads the same error, so reporting it from one of them would tie the toast+ // and the Sentry event to whichever consumer happens to be mounted.+ useEffect(() => {+ if (!error || errorReportedRef.current) {+ return;+ }++ errorReportedRef.current = true;++ ErrorGeneratingPdfToast();++ umamiTrackEvent("error_generating_document_link", { data: { error } });++ Sentry.captureException(error);+ }, [error]);++ return (+ <InvoicePdfInstanceContext.Provider value={instance}>+ {children}+ </InvoicePdfInstanceContext.Provider>+ );+}++/**+ * Custom React hook to consume the PDF instance context for invoices.+ *+ * Must be used within an {@link InvoicePdfInstanceProvider}. Throws an error if used outside the provider.+ */+export function useInvoicePdfInstance() {+ const context = useContext(InvoicePdfInstanceContext);++ if (context === undefined) {+ throw new Error(+ "useInvoicePdfInstance must be used within an InvoicePdfInstanceProvider",+ );+ }++ return context;+}diff --git a/src/app/(app)/error.tsx b/src/app/(app)/error.tsxindex 59c0b8b..a2714b3 100644--- a/src/app/(app)/error.tsx+++ b/src/app/(app)/error.tsx@@ -1,6 +1,16 @@"use client"; // Error boundaries must be Client Components-import { Button } from "@/components/ui/button";+import * as Sentry from "@sentry/nextjs";+import { useEffect } from "react";+import { toast } from "sonner";++import { setAppStorageItem } from "@/app/(app)/utils/app-local-storage";+import { DEFAULT_METADATA } from "@/app/(app)/utils/get-app-metadata";+import {+ METADATA_LOCAL_STORAGE_KEY,+ PDF_DATA_LOCAL_STORAGE_KEY,+} from "@/app/schema";+import { ErrorMessage } from "@/components/etc/error-message";import {AlertDialog,AlertDialogAction,@@ -12,18 +22,11 @@ import {AlertDialogTitle,AlertDialogTrigger,} from "@/components/ui/alert-dialog";-import { useEffect } from "react";-import { toast } from "sonner";-import { getInitialInvoiceData } from "../constants";-import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";-import * as Sentry from "@sentry/nextjs";-import { ErrorMessage } from "@/components/etc/error-message";-import {- METADATA_LOCAL_STORAGE_KEY,- PDF_DATA_LOCAL_STORAGE_KEY,-} from "@/app/schema";+import { Button } from "@/components/ui/button";import { BUG_REPORT_URL } from "@/config";-import { DEFAULT_METADATA } from "@/app/(app)/utils/get-app-metadata";+import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";++import { getInitialInvoiceData } from "../constants";export default function Error({error,@@ -95,15 +98,18 @@ export default function Error({<AlertDialogActiononClick={() => {try {- localStorage.setItem(- PDF_DATA_LOCAL_STORAGE_KEY,- JSON.stringify(getInitialInvoiceData()),- );+ // Best effort: a store that rejects writes cannot be holding the+ // data that broke the app either, and `reset()` below is what gets+ // the user off this error screen — it must not be skipped.+ setAppStorageItem({+ key: PDF_DATA_LOCAL_STORAGE_KEY,+ value: JSON.stringify(getInitialInvoiceData()),+ });- localStorage.setItem(- METADATA_LOCAL_STORAGE_KEY,- JSON.stringify(DEFAULT_METADATA),- );+ setAppStorageItem({+ key: METADATA_LOCAL_STORAGE_KEY,+ value: JSON.stringify(DEFAULT_METADATA),+ });reset();diff --git a/src/app/(app)/home-json-ld.tsx b/src/app/(app)/home-json-ld.tsxindex 0217afd..53768d8 100644--- a/src/app/(app)/home-json-ld.tsx+++ b/src/app/(app)/home-json-ld.tsx@@ -1,8 +1,8 @@-import { PROD_WEBSITE_URL } from "@/config";import type { Graph } from "schema-dts";-import { JsonLdScript } from "@/lib/seo/render-json-ld";+import { PROD_WEBSITE_URL } from "@/config";import { JSON_LD_IDS } from "@/lib/seo/json-ld-ids";+import { JsonLdScript } from "@/lib/seo/render-json-ld";import {buildFullWebSite,buildOrganization,diff --git a/src/app/(app)/hooks/__tests__/use-changelog-update-popup.test.ts b/src/app/(app)/hooks/__tests__/use-changelog-update-popup.test.tsindex 5fba831..ac98829 100644--- a/src/app/(app)/hooks/__tests__/use-changelog-update-popup.test.ts+++ b/src/app/(app)/hooks/__tests__/use-changelog-update-popup.test.ts@@ -1,19 +1,33 @@// @vitest-environment happy-dom-import type { ChangelogSummary } from "@/app/changelog/utils";-import { shouldShowChangelogPopup } from "@/app/(app)/utils/changelog-seen-storage";-import { hasSeenWelcomePopup } from "@/app/(app)/utils/welcome-popup-seen-storage";import { act, renderHook } from "@testing-library/react";import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";++import {+ markChangelogAsSeen,+ shouldShowChangelogPopup,+} from "@/app/(app)/utils/changelog-seen-storage";+import {+ hasSeenWelcomePopup,+ markWelcomePopupSeen,+} from "@/app/(app)/utils/welcome-popup-seen-storage";+import type { ChangelogSummary } from "@/app/changelog/utils";+import { useChangelogUpdatePopup } from "../use-changelog-update-popup";-vi.mock("@/app/(app)/utils/welcome-popup-seen-storage", () => ({- hasSeenWelcomePopup: vi.fn(),-}));+vi.mock("@/app/(app)/utils/welcome-popup-seen-storage", () => {+ return {+ hasSeenWelcomePopup: vi.fn(),+ markWelcomePopupSeen: vi.fn(),+ };+});-vi.mock("@/app/(app)/utils/changelog-seen-storage", () => ({- shouldShowChangelogPopup: vi.fn(),-}));+vi.mock("@/app/(app)/utils/changelog-seen-storage", () => {+ return {+ shouldShowChangelogPopup: vi.fn(),+ markChangelogAsSeen: vi.fn(),+ };+});const latestChangelog: ChangelogSummary = {slug: "v1-0-3",@@ -30,14 +44,14 @@ function renderChangelogPopupHook(isMobile: boolean;}> = {},) {- return renderHook(() =>- useChangelogUpdatePopup({+ return renderHook(() => {+ return useChangelogUpdatePopup({latestChangelog: null,isViewingSharedInvoice: false,isMobile: false,...overrides,- }),- );+ });+ });}describe("useChangelogUpdatePopup", () => {@@ -56,30 +70,31 @@ describe("useChangelogUpdatePopup", () => {const { result } = renderChangelogPopupHook();expect(result.current.isOpen).toBe(false);- expect(result.current.variant).toBe(null);+ expect(result.current.variant).toBeNull();act(() => {- vi.advanceTimersByTime(1_500);+ vi.advanceTimersByTime(1500);});expect(result.current.isOpen).toBe(true);expect(result.current.variant).toBe("welcome");- expect(result.current.latestChangelog).toBe(null);+ expect(markWelcomePopupSeen).toHaveBeenCalledTimes(1);});it("should not show changelog in same session after welcome was shown", () => {const { result, rerender } = renderHook(- ({ latest }) =>- useChangelogUpdatePopup({+ ({ latest }) => {+ return useChangelogUpdatePopup({latestChangelog: latest,isViewingSharedInvoice: false,isMobile: false,- }),+ });+ },{ initialProps: { latest: null as ChangelogSummary | null } },);act(() => {- vi.advanceTimersByTime(1_500);+ vi.advanceTimersByTime(1500);});expect(result.current.variant).toBe("welcome");@@ -93,11 +108,42 @@ describe("useChangelogUpdatePopup", () => {rerender({ latest: latestChangelog });act(() => {- vi.advanceTimersByTime(1_500);+ vi.advanceTimersByTime(1500);});expect(result.current.isOpen).toBe(false);- expect(result.current.variant).toBe(null);+ expect(markChangelogAsSeen).not.toHaveBeenCalled();+ });++ it("should keep the welcome popup shown when props change while it is open", () => {+ const { result, rerender } = renderHook(+ ({ latest }) => {+ return useChangelogUpdatePopup({+ latestChangelog: latest,+ isViewingSharedInvoice: false,+ isMobile: false,+ });+ },+ { initialProps: { latest: null as ChangelogSummary | null } },+ );++ act(() => {+ vi.advanceTimersByTime(1500);+ });++ expect(result.current.variant).toBe("welcome");++ // Welcome was marked as seen on show, so a re-resolve would wrongly hide it+ vi.mocked(hasSeenWelcomePopup).mockReturnValue(true);++ rerender({ latest: latestChangelog });++ act(() => {+ vi.advanceTimersByTime(1500);+ });++ expect(result.current.isOpen).toBe(true);+ expect(result.current.variant).toBe("welcome");});it("should show changelog popup on a return visit", () => {@@ -106,12 +152,12 @@ describe("useChangelogUpdatePopup", () => {const { result } = renderChangelogPopupHook({ latestChangelog });act(() => {- vi.advanceTimersByTime(1_500);+ vi.advanceTimersByTime(1500);});expect(result.current.isOpen).toBe(true);expect(result.current.variant).toBe("changelog");- expect(result.current.latestChangelog).toEqual(latestChangelog);+ expect(markChangelogAsSeen).toHaveBeenCalledWith(latestChangelog.slug);});it("should show changelog popup when latest changelog slug changes", () => {@@ -131,36 +177,51 @@ describe("useChangelogUpdatePopup", () => {version: "1.0.4",};- vi.mocked(shouldShowChangelogPopup).mockImplementation(- (slug) => slug === newChangelog.slug,- );+ vi.mocked(shouldShowChangelogPopup).mockImplementation((slug) => {+ return slug === newChangelog.slug;+ });const { result, rerender } = renderHook(- ({ latest }) =>- useChangelogUpdatePopup({+ ({ latest }) => {+ return useChangelogUpdatePopup({latestChangelog: latest,isViewingSharedInvoice: false,isMobile: false,- }),+ });+ },{ initialProps: { latest: previousChangelog } },);act(() => {- vi.advanceTimersByTime(1_500);+ vi.advanceTimersByTime(1500);});expect(result.current.isOpen).toBe(false);- expect(result.current.variant).toBe(null);+ expect(result.current.variant).toBeNull();rerender({ latest: newChangelog });act(() => {- vi.advanceTimersByTime(1_500);+ vi.advanceTimersByTime(1500);});expect(result.current.isOpen).toBe(true);expect(result.current.variant).toBe("changelog");- expect(result.current.latestChangelog).toEqual(newChangelog);+ expect(markChangelogAsSeen).toHaveBeenCalledWith(newChangelog.slug);+ });++ it("should mark popup as seen even when it is never interacted with", () => {+ vi.mocked(hasSeenWelcomePopup).mockReturnValue(true);++ const { unmount } = renderChangelogPopupHook({ latestChangelog });++ act(() => {+ vi.advanceTimersByTime(1500);+ });++ unmount();++ expect(markChangelogAsSeen).toHaveBeenCalledWith(latestChangelog.slug);});it("should not show popup when changelog was already seen", () => {@@ -170,22 +231,22 @@ describe("useChangelogUpdatePopup", () => {const { result } = renderChangelogPopupHook({ latestChangelog });act(() => {- vi.advanceTimersByTime(1_500);+ vi.advanceTimersByTime(1500);});expect(result.current.isOpen).toBe(false);- expect(result.current.variant).toBe(null);+ expect(result.current.variant).toBeNull();});it("should not show popup on mobile", () => {const { result } = renderChangelogPopupHook({ isMobile: true });act(() => {- vi.advanceTimersByTime(1_500);+ vi.advanceTimersByTime(1500);});expect(result.current.isOpen).toBe(false);- expect(result.current.variant).toBe(null);+ expect(result.current.variant).toBeNull();});it("should not show popup when viewing a shared invoice", () => {@@ -195,18 +256,18 @@ describe("useChangelogUpdatePopup", () => {});act(() => {- vi.advanceTimersByTime(1_500);+ vi.advanceTimersByTime(1500);});expect(result.current.isOpen).toBe(false);- expect(result.current.variant).toBe(null);+ expect(result.current.variant).toBeNull();});it("should close popup when dismissed", () => {const { result } = renderChangelogPopupHook();act(() => {- vi.advanceTimersByTime(1_500);+ vi.advanceTimersByTime(1500);});expect(result.current.isOpen).toBe(true);diff --git a/src/app/(app)/hooks/__tests__/use-in-app-browser-notice.test.tsx b/src/app/(app)/hooks/__tests__/use-in-app-browser-notice.test.tsxnew file mode 100644index 0000000..bd5f7b6--- /dev/null+++ b/src/app/(app)/hooks/__tests__/use-in-app-browser-notice.test.tsx@@ -0,0 +1,108 @@+// @vitest-environment happy-dom++import { renderHook } from "@testing-library/react";+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";++import { DeviceContextProvider } from "@/contexts/device-context";+import type { InAppInfo } from "@/lib/check-device.server";+import { isTelegramInAppBrowser } from "@/utils/is-telegram-in-app-browser";++import { useInAppBrowserNotice } from "../use-in-app-browser-notice";++vi.mock("sonner", () => {+ return {+ toast: Object.assign(vi.fn(), { info: vi.fn() }),+ };+});++vi.mock("@/utils/is-telegram-in-app-browser", () => {+ return {+ isTelegramInAppBrowser: vi.fn(() => {+ return false;+ }),+ };+});++import { toast } from "sonner";++function renderInAppBrowserNotice({+ inAppInfo = { isInApp: false, name: null },+ isDesktop = true,+}: { inAppInfo?: InAppInfo; isDesktop?: boolean } = {}) {+ return renderHook(+ () => {+ return useInAppBrowserNotice();+ },+ {+ wrapper: ({ children }) => {+ return (+ <DeviceContextProvider+ isDesktop={isDesktop}+ isAndroid={false}+ isMobile={!isDesktop}+ inAppInfo={inAppInfo}+ >+ {children}+ </DeviceContextProvider>+ );+ },+ },+ );+}++describe("useInAppBrowserNotice", () => {+ beforeEach(() => {+ vi.clearAllMocks();+ vi.mocked(isTelegramInAppBrowser).mockReturnValue(false);+ });++ afterEach(() => {+ vi.restoreAllMocks();+ });++ it("should warn the user when the page runs inside an in-app browser", () => {+ renderInAppBrowserNotice({+ inAppInfo: { isInApp: true, name: "Facebook" },+ });++ expect(toast.info).toHaveBeenCalledWith(+ "In-App Browser Detected",+ expect.objectContaining({+ id: "in-app-browser-toast",+ position: "bottom-right",+ }),+ );+ });++ it("should warn the user inside the Telegram preview browser", () => {+ vi.mocked(isTelegramInAppBrowser).mockReturnValue(true);++ renderInAppBrowserNotice({ isDesktop: false });++ expect(toast.info).toHaveBeenCalledWith(+ "In-App Browser Detected",+ expect.objectContaining({+ id: "in-app-browser-toast",+ // mobile gets the toast out of the way of the sticky download bar+ position: "top-center",+ }),+ );+ });++ it("should warn only once, no matter how often the page re-renders", () => {+ const { rerender } = renderInAppBrowserNotice({+ inAppInfo: { isInApp: true, name: "Facebook" },+ });++ rerender();+ rerender();++ expect(toast.info).toHaveBeenCalledTimes(1);+ });++ it("should stay quiet in a normal browser", () => {+ renderInAppBrowserNotice();++ expect(toast.info).not.toHaveBeenCalled();+ });+});diff --git a/src/app/(app)/hooks/__tests__/use-show-random-cta-toast.test.ts b/src/app/(app)/hooks/__tests__/use-show-random-cta-toast.test.tsdeleted file mode 100644index 2c2d347..0000000--- a/src/app/(app)/hooks/__tests__/use-show-random-cta-toast.test.ts+++ /dev/null@@ -1,208 +0,0 @@-// @vitest-environment happy-dom--import { act, renderHook } from "@testing-library/react";-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";-import { showRandomCTAToast } from "../../components/cta-toasts";-import { useCTAToast } from "../../contexts/cta-toast-context";-import { useShowRandomCTAToastOnIdle } from "../use-show-random-cta-toast";--vi.mock("../../components/cta-toasts", () => ({- showRandomCTAToast: vi.fn(),-}));--vi.mock("../../contexts/cta-toast-context", () => ({- useCTAToast: vi.fn(),-}));--const MIN_TIME_ON_PAGE = 7_000;-const IDLE_TIME = 5_000;--interface CTAToastState {- hasTriggeredCTAAction: boolean;- interactionCount: number;-}--function renderIdleToastHook(initialState: Partial<CTAToastState> = {}) {- const markCTAActionTriggered = vi.fn();- const state: CTAToastState = {- hasTriggeredCTAAction: false,- interactionCount: 0,- ...initialState,- };-- vi.mocked(useCTAToast).mockImplementation(() => ({- hasTriggeredCTAAction: state.hasTriggeredCTAAction,- markCTAActionTriggered,- interactionCount: state.interactionCount,- incrementInteractionCount: vi.fn(),- }));-- const hook = renderHook(() => useShowRandomCTAToastOnIdle());-- return {- ...hook,- markCTAActionTriggered,- setInteractionCount(count: number) {- state.interactionCount = count;- hook.rerender();- },- setHasTriggeredCTAAction(value: boolean) {- state.hasTriggeredCTAAction = value;- hook.rerender();- },- };-}--describe("useShowRandomCTAToastOnIdle", () => {- beforeEach(() => {- vi.useFakeTimers();- });-- afterEach(() => {- vi.useRealTimers();- vi.clearAllMocks();- });-- it("should show toast after min time on page, enough interactions, and idle period", () => {- const { markCTAActionTriggered, setInteractionCount } =- renderIdleToastHook();-- act(() => {- vi.advanceTimersByTime(MIN_TIME_ON_PAGE);- });-- setInteractionCount(3);-- act(() => {- vi.advanceTimersByTime(IDLE_TIME);- });-- expect(showRandomCTAToast).toHaveBeenCalledTimes(1);- expect(markCTAActionTriggered).toHaveBeenCalledTimes(1);- });-- it("should not show toast when user has fewer than 3 interactions", () => {- const { setInteractionCount } = renderIdleToastHook();-- act(() => {- vi.advanceTimersByTime(MIN_TIME_ON_PAGE);- });-- setInteractionCount(2);-- act(() => {- vi.advanceTimersByTime(IDLE_TIME);- });-- expect(showRandomCTAToast).not.toHaveBeenCalled();- });-- it("should not show toast when CTA action was already triggered this session", () => {- renderIdleToastHook({- hasTriggeredCTAAction: true,- interactionCount: 3,- });-- act(() => {- vi.advanceTimersByTime(MIN_TIME_ON_PAGE + IDLE_TIME);- });-- expect(showRandomCTAToast).not.toHaveBeenCalled();- });-- it("should not show toast when idle period ends before min time on page elapses", () => {- const { setInteractionCount } = renderIdleToastHook();-- setInteractionCount(3);-- act(() => {- vi.advanceTimersByTime(IDLE_TIME);- });-- expect(showRandomCTAToast).not.toHaveBeenCalled();-- act(() => {- vi.advanceTimersByTime(MIN_TIME_ON_PAGE - IDLE_TIME);- });-- expect(showRandomCTAToast).not.toHaveBeenCalled();- });-- it("should show toast after min time elapses if user becomes idle again", () => {- const { markCTAActionTriggered, setInteractionCount } =- renderIdleToastHook();-- setInteractionCount(3);-- act(() => {- vi.advanceTimersByTime(IDLE_TIME);- });-- expect(showRandomCTAToast).not.toHaveBeenCalled();-- act(() => {- vi.advanceTimersByTime(MIN_TIME_ON_PAGE - IDLE_TIME);- });-- setInteractionCount(4);-- act(() => {- vi.advanceTimersByTime(IDLE_TIME);- });-- expect(showRandomCTAToast).toHaveBeenCalledTimes(1);- expect(markCTAActionTriggered).toHaveBeenCalledTimes(1);- });-- it("should reset idle timer when interaction count changes", () => {- const { setInteractionCount } = renderIdleToastHook();-- act(() => {- vi.advanceTimersByTime(MIN_TIME_ON_PAGE);- });-- setInteractionCount(3);-- act(() => {- vi.advanceTimersByTime(IDLE_TIME - 1_000);- });-- setInteractionCount(4);-- act(() => {- vi.advanceTimersByTime(IDLE_TIME - 1_000);- });-- expect(showRandomCTAToast).not.toHaveBeenCalled();-- act(() => {- vi.advanceTimersByTime(1_000);- });-- expect(showRandomCTAToast).toHaveBeenCalledTimes(1);- });-- it("should only show toast once", () => {- const { setInteractionCount } = renderIdleToastHook();-- act(() => {- vi.advanceTimersByTime(MIN_TIME_ON_PAGE);- });-- setInteractionCount(3);-- act(() => {- vi.advanceTimersByTime(IDLE_TIME);- });-- expect(showRandomCTAToast).toHaveBeenCalledTimes(1);-- setInteractionCount(5);-- act(() => {- vi.advanceTimersByTime(IDLE_TIME);- });-- expect(showRandomCTAToast).toHaveBeenCalledTimes(1);- });-});diff --git a/src/app/(app)/hooks/use-changelog-update-popup.ts b/src/app/(app)/hooks/use-changelog-update-popup.tsindex 86028ca..8a93cc8 100644--- a/src/app/(app)/hooks/use-changelog-update-popup.ts+++ b/src/app/(app)/hooks/use-changelog-update-popup.ts@@ -1,12 +1,19 @@"use client";-import type { ChangelogSummary } from "@/app/changelog/utils";-import { shouldShowChangelogPopup } from "@/app/(app)/utils/changelog-seen-storage";-import { hasSeenWelcomePopup } from "@/app/(app)/utils/welcome-popup-seen-storage";import { useCallback, useEffect, useRef, useState } from "react";+import {+ markChangelogAsSeen,+ shouldShowChangelogPopup,+} from "@/app/(app)/utils/changelog-seen-storage";+import {+ hasSeenWelcomePopup,+ markWelcomePopupSeen,+} from "@/app/(app)/utils/welcome-popup-seen-storage";+import type { ChangelogSummary } from "@/app/changelog/utils";+/** Wait before showing so the page can settle first */-const SHOW_DELAY_MS = 1_500;+const SHOW_DELAY_MS = 1500;export type AppUpdatePopupVariant = "welcome" | "changelog";@@ -20,21 +27,15 @@ interface UseChangelogUpdatePopupResult {isOpen: boolean;dismiss: () => void;variant: AppUpdatePopupVariant | null;- latestChangelog: ChangelogSummary | null;}function resolvePopupVariant(latestChangelog: ChangelogSummary | null,- skipChangelogThisSession: boolean,): AppUpdatePopupVariant | null {if (!hasSeenWelcomePopup()) {return "welcome";}- if (skipChangelogThisSession) {- return null;- }-if (latestChangelog && shouldShowChangelogPopup(latestChangelog.slug)) {return "changelog";}@@ -48,59 +49,59 @@ function resolvePopupVariant(* Shows welcome popup on first visit, then changelog popup when a new* changelog version is unseen. Never shows on mobile or when viewing a* shared invoice.+ *+ * A popup is marked as seen the moment it is shown, so each one appears only+ * once per browser - whether or not the user interacts with it. At most one+ * popup is shown per visit, so a first-time visitor gets the welcome popup now+ * and the changelog popup on their next visit.*/export function useChangelogUpdatePopup({latestChangelog,isViewingSharedInvoice,isMobile,}: UseChangelogUpdatePopupOptions): UseChangelogUpdatePopupResult {- const [isOpen, setIsOpen] = useState(false);- const [variant, setVariant] = useState<AppUpdatePopupVariant | null>(null);- const [isMounted, setIsMounted] = useState(false);- /** Blocks changelog popup in same session after welcome was shown */- const skipChangelogThisSessionRef = useRef(false);+ /** The popup the timer below decided to show, if any */+ const [shownVariant, setShownVariant] =+ useState<AppUpdatePopupVariant | null>(null);+ const [isDismissed, setIsDismissed] = useState(false);+ /** At most one popup per visit, so a shown popup is never re-resolved */+ const hasShownPopupRef = useRef(false);const dismiss = useCallback(() => {- setIsOpen(false);+ setIsDismissed(true);}, []);useEffect(() => {- // Never show popup on mobile- if (isMobile) {- setIsMounted(false);- setIsOpen(false);- setVariant(null);+ // Never show popup on mobile or when viewing a shared invoice+ if (isMobile || isViewingSharedInvoice) {return;}- // Never show popup if viewing a shared invoice- if (isViewingSharedInvoice) {+ // A popup shown earlier this visit stays put: re-resolving would hide it+ // again, since showing it already marked it as seen+ if (hasShownPopupRef.current) {return;}- // Determine which popup (welcome/changelog) to show, if any- const nextVariant = resolvePopupVariant(- latestChangelog,- skipChangelogThisSessionRef.current,- );-- // If no popup needed, reset state and exit- if (!nextVariant) {- setIsMounted(false);- setIsOpen(false);- setVariant(null);- return;- }-- // Delay showing the popup for a nicer UX+ // Delay showing the popup for a nicer UX. Which popup (welcome/changelog) to+ // show is decided when the timer fires, so the decision reflects what the user+ // has seen by then.const timer = window.setTimeout(() => {+ const nextVariant = resolvePopupVariant(latestChangelog);++ // Mark as seen on show, not on dismiss: the user got their one look at it+ // even if they navigate away without touching itif (nextVariant === "welcome") {- skipChangelogThisSessionRef.current = true;+ markWelcomePopupSeen();+ } else if (nextVariant === "changelog" && latestChangelog) {+ markChangelogAsSeen(latestChangelog.slug);}- setVariant(nextVariant);- setIsMounted(true);- setIsOpen(true);+ if (nextVariant) {+ hasShownPopupRef.current = true;+ }++ setShownVariant(nextVariant);}, SHOW_DELAY_MS);// Cleanup timeout if dependencies change/unmount@@ -109,10 +110,13 @@ export function useChangelogUpdatePopup({};}, [isMobile, isViewingSharedInvoice, latestChangelog]);+ // Switching to a mobile viewport hides an already shown popup, so this is+ // derived rather than stored+ const variant = isMobile ? null : shownVariant;+return {- isOpen: isOpen && isMounted,+ isOpen: variant !== null && !isDismissed,dismiss,variant,- latestChangelog: variant === "changelog" ? latestChangelog : null,};}diff --git a/src/app/(app)/hooks/use-in-app-browser-notice.tsx b/src/app/(app)/hooks/use-in-app-browser-notice.tsxnew file mode 100644index 0000000..aadadaf--- /dev/null+++ b/src/app/(app)/hooks/use-in-app-browser-notice.tsx@@ -0,0 +1,51 @@+"use client";++import { useEffect, useRef } from "react";+import { toast } from "sonner";++import { useDeviceContext } from "@/contexts/device-context";+import { isTelegramInAppBrowser } from "@/utils/is-telegram-in-app-browser";++/**+ * Warns the user once when the page is opened inside an in-app browser / WebView+ * (Instagram, X, LinkedIn, Telegram, ...), where downloads are blocked.+ *+ * The notice is about the page as a whole, so it belongs here and not on the download+ * button: that button is rendered from two places (the desktop header and the mobile+ * bottom bar), and the warning is just as relevant when neither of them is on screen.+ */+export function useInAppBrowserNotice() {+ const { inAppInfo, isDesktop } = useDeviceContext();+ const isMobile = !isDesktop;++ // Guards the toast so it only shows once per mount. A ref, not state: nothing+ // in the render output depends on it.+ const noticeShownRef = useRef(false);++ useEffect(() => {+ if (noticeShownRef.current) {+ return;+ }++ // `isTelegramInAppBrowser` reads `window`, so it has to run on the client+ if (!inAppInfo?.isInApp && !isTelegramInAppBrowser()) {+ return;+ }++ noticeShownRef.current = true;++ toast.info("In-App Browser Detected", {+ description: (+ <p>+ For the best experience, please open this page in{" "}+ <span className="font-bold">Chrome</span> or{" "}+ <span className="font-bold">Safari</span> browser.+ </p>+ ),+ id: "in-app-browser-toast", // To prevent duplicate toasts+ duration: Infinity,+ icon: "⚠️",+ position: isMobile ? "top-center" : "bottom-right",+ });+ }, [inAppInfo?.isInApp, isMobile]);+}diff --git a/src/app/(app)/hooks/use-show-random-cta-toast.tsx b/src/app/(app)/hooks/use-show-random-cta-toast.tsxdeleted file mode 100644index a57f576..0000000--- a/src/app/(app)/hooks/use-show-random-cta-toast.tsx+++ /dev/null@@ -1,61 +0,0 @@-"use client";--import { useEffect, useRef } from "react";-import { showRandomCTAToast } from "../components/cta-toasts";-import { useCTAToast } from "../contexts/cta-toast-context";--const MIN_TIME_ON_PAGE = 7_000; // in ms-const IDLE_TIME = 5_000; // in ms--/** One interaction = one form update (PDF re-render) */-const MIN_INTERACTIONS = 3;--/**- * Shows a CTA toast after the user has been idle, but only if they haven't- * triggered a CTA-eligible action (PDF download or link generation) this session.- *- * - User stays on page Xs (MIN_TIME_ON_PAGE) -> we consider them "present".- * - 3+ form updates -> we consider them engaged.- * - Once they stop updating for X seconds (IDLE_TIME) -> if engaged, toast appears.- */-export function useShowRandomCTAToastOnIdle() {- const { hasTriggeredCTAAction, markCTAActionTriggered, interactionCount } =- useCTAToast();-- const triggeredRef = useRef(false);- const hasMinTimeElapsedRef = useRef(false);-- // Min time on page — runs once, independent of interactions- useEffect(() => {- if (hasTriggeredCTAAction || triggeredRef.current) return;-- const timer = setTimeout(() => {- hasMinTimeElapsedRef.current = true;- }, MIN_TIME_ON_PAGE);-- return () => clearTimeout(timer);- }, [hasTriggeredCTAAction]);-- // Idle detection — resets on every form update (interactionCount change)- useEffect(() => {- // Skip if CTA already triggered this session or toast already shown- if (hasTriggeredCTAAction || triggeredRef.current) return;- // Skip if user hasn't engaged enough with the form yet- if (interactionCount < MIN_INTERACTIONS) return;-- // Start idle timer — triggers toast after IDLE_TIME of inactivity- const idleTimer = setTimeout(() => {- // Verify both conditions still met: minimum time elapsed AND not already triggered- if (!hasMinTimeElapsedRef.current || triggeredRef.current) return;-- // Mark as triggered to prevent duplicate toasts- triggeredRef.current = true;-- // Show the toast and mark action as triggered- showRandomCTAToast();- markCTAActionTriggered();- }, IDLE_TIME);-- return () => clearTimeout(idleTimer);- }, [interactionCount, hasTriggeredCTAAction, markCTAActionTriggered]);-}diff --git a/src/app/(app)/loading.tsx b/src/app/(app)/loading.tsxindex 109c826..9516201 100644--- a/src/app/(app)/loading.tsx+++ b/src/app/(app)/loading.tsx@@ -74,18 +74,25 @@ function LoadingHeader() {function MobileEditorLoading() {return (<div className="min-h-[814px] lg:hidden">- <div className="flex h-10 w-full items-center gap-2 rounded-md bg-slate-200 p-1">- <Skeleton className="h-7 flex-1 bg-white" />- <Skeleton className="h-7 flex-1 bg-slate-300" />- </div>-<div className="mx-3">- <div className="mt-3 h-[520px] overflow-hidden rounded-lg border px-4 shadow-sm">+ <div className="mt-1 h-[520px] overflow-hidden rounded-lg border px-4 shadow-sm"><FormLoadingContent /></div></div>- <div className="sticky bottom-0 z-50 mt-2 flex h-[108px] flex-col items-center justify-center gap-3 rounded-lg border border-t border-gray-200 bg-white px-3 py-3">+ {/*+ Mirrors the dock in `InvoiceClientPage`: the Edit / Preview switch sits inside it,+ above the two buttons, as a pill track with the indicator on the active tab.+ */}+ <div className="sticky bottom-0 z-50 mt-2 flex flex-col items-center justify-center gap-3 rounded-lg border border-t border-gray-200 bg-white px-3 py-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]">+ <div className="flex h-10 w-full items-center rounded-full bg-slate-200 p-1">+ <div className="flex h-8 flex-1 items-center justify-center rounded-full bg-white shadow-[0_2px_4px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.06),0_0_1px_rgba(0,0,0,0.06)]">+ <Skeleton className="h-3 w-[86px] bg-slate-200" />+ </div>+ <div className="flex h-8 flex-1 items-center justify-center">+ <Skeleton className="h-3 w-[86px] bg-slate-300" />+ </div>+ </div><Skeleton className="h-9 w-full bg-slate-100" /><Skeleton className="h-9 w-full bg-slate-100" /></div>@@ -134,13 +141,15 @@ function FormLoadingContent() {<Skeleton className="h-6 w-[190px]" /><Skeleton className="size-6 shrink-0 rounded-full" /></div>- {Array.from({ length: 4 }).map((_, index) => (- <div key={index} className="space-y-2">- <Skeleton className="h-3 w-28" />- <Skeleton className="h-9 w-full bg-slate-100" />- <Skeleton className="h-2.5 w-4/5" />- </div>- ))}+ {Array.from({ length: 4 }).map((_, index) => {+ return (+ <div key={index} className="space-y-2">+ <Skeleton className="h-3 w-28" />+ <Skeleton className="h-9 w-full bg-slate-100" />+ <Skeleton className="h-2.5 w-4/5" />+ </div>+ );+ })}<div className="rounded-md border border-slate-200 p-4"><Skeleton className="mb-4 h-5 w-36" /><div className="space-y-3">diff --git a/src/app/(app)/page.client.tsx b/src/app/(app)/page.client.tsxindex 4f20376..ba06921 100644--- a/src/app/(app)/page.client.tsx+++ b/src/app/(app)/page.client.tsx@@ -1,53 +1,56 @@"use client";-import { getInitialInvoiceData } from "@/app/constants";+import * as Sentry from "@sentry/nextjs";import {- invoiceSchema,- METADATA_LOCAL_STORAGE_KEY,- PDF_DATA_LOCAL_STORAGE_KEY,- SUPPORTED_TEMPLATES,- type InvoiceData,-} from "@/app/schema";-import { TooltipProvider } from "@/components/ui/tooltip";-import { useDeviceContext } from "@/contexts/device-context";-import { useRouter } from "next/navigation";+ compressToEncodedURIComponent,+ decompressFromEncodedURIComponent,+} from "lz-string";+import { useRouter, useSearchParams } from "next/navigation";+import { useCallback, useEffect, useRef, useState } from "react";+import { toast } from "sonner";+import { z } from "zod";import { InvoicePageHeader } from "@/app/(app)/components/invoice-page-header";+import { InvoicePdfInstanceProvider } from "@/app/(app)/contexts/invoice-pdf-instance-context";+import { InvoicePageLoadingSkeleton } from "@/app/(app)/loading";+import {+ getAppStorageItem,+ setAppStorageItem,+} from "@/app/(app)/utils/app-local-storage";import {DEFAULT_METADATA,getAppMetadata,updateAppMetadata,} from "@/app/(app)/utils/get-app-metadata";import { Footer } from "@/app/(components)/footer";+import type { ChangelogSummary } from "@/app/changelog/utils";+import { getInitialInvoiceData } from "@/app/constants";+import {+ invoiceSchema,+ METADATA_LOCAL_STORAGE_KEY,+ PDF_DATA_LOCAL_STORAGE_KEY,+ SUPPORTED_TEMPLATES,+ type InvoiceData,+} from "@/app/schema";import { GitHubStarCTA } from "@/components/github-star-cta";import { Button } from "@/components/ui/button";+import { TooltipProvider } from "@/components/ui/tooltip";+import { useDeviceContext } from "@/contexts/device-context";import { haptic } from "@/lib/haptic";import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";import {compressInvoiceData,decompressInvoiceData,} from "@/utils/url-compression";-import * as Sentry from "@sentry/nextjs";-import {- compressToEncodedURIComponent,- decompressFromEncodedURIComponent,-} from "lz-string";-import { useSearchParams } from "next/navigation";-import { useCallback, useEffect, useRef, useState } from "react";-import { toast } from "sonner";-import { z } from "zod";+import { InvoiceClientPage } from "./components";import { ChangelogUpdatePopup } from "./components/changelog-update-popup";import { HowItWorksVideoDialog } from "./components/how-it-works-video-dialog";-import { showRandomCTAToast } from "./components/cta-toasts";-import { useCTAToast } from "./contexts/cta-toast-context";import { useChangelogUpdatePopup } from "./hooks/use-changelog-update-popup";-import { useShowRandomCTAToastOnIdle } from "./hooks/use-show-random-cta-toast";-import type { ChangelogSummary } from "@/app/changelog/utils";+import { useInAppBrowserNotice } from "./hooks/use-in-app-browser-notice";import { generateQrCodeDataUrl } from "./utils/generate-qr-code-data-url";import { handleInvoiceNumberBreakingChange } from "./utils/invoice-number-breaking-change";import { selectInvoiceTemplate } from "./utils/select-invoice-template";-import { InvoicePageLoadingSkeleton } from "@/app/(app)/loading";// TODO: enable later when PRO version is released, this is PRO FEATURE =)// import { InvoicePDFDownloadMultipleLanguages } from "./components/invoice-pdf-download-multiple-languages";@@ -62,7 +65,6 @@ import { InvoicePageLoadingSkeleton } from "@/app/(app)/loading";* - Invoice data state management and updates* - PDF generation and download functionality* - Share invoice functionality with URL generation- * - CTA toast notifications for user engagement* - Error handling and user feedback** @returns The rendered invoice application page with form, preview, and controls@@ -77,8 +79,6 @@ export function AppPageClient({const router = useRouter();const searchParams = useSearchParams();- const { markCTAActionTriggered, incrementInteractionCount } = useCTAToast();-const urlTemplateSearchParam = searchParams.get("template");// Validate template parameter with zod@@ -90,6 +90,9 @@ export function AppPageClient({const { isDesktop, isUADesktop } = useDeviceContext();const isMobile = !isDesktop;+ // Warns the user when they are inside an in-app browser, where downloads are blocked+ useInAppBrowserNotice();+/*** State for storing the current invoice data.*@@ -104,9 +107,6 @@ export function AppPageClient({null,);- const [errorWhileGeneratingPdfIsShown, setErrorWhileGeneratingPdfIsShown] =- useState(false);-const canShareInvoice = !invoiceDataState?.logo;const [qrCodeDataUrl, setQrCodeDataUrl] = useState("");@@ -120,7 +120,6 @@ export function AppPageClient({isOpen: isChangelogPopupOpen,dismiss: dismissChangelogPopup,variant: changelogPopupVariant,- latestChangelog: changelogForPopup,} = useChangelogUpdatePopup({latestChangelog,isViewingSharedInvoice,@@ -129,11 +128,23 @@ export function AppPageClient({const [isHowItWorksDialogOpen, setIsHowItWorksDialogOpen] = useState(false);- const [invoiceFormHasErrors, setInvoiceFormHasErrors] = useState(false);+ /**+ * Reads the invoice form at click time: its current values, or `null` when it has+ * validation errors. A ref rather than state, because the answer is only needed inside+ * handleShareInvoice — mirroring it into render would re-render the page (and the PDF)+ * on every keystroke that flips validity, and could answer with a stale value.+ */+ const currentInvoiceFormDataRef = useRef<(() => InvoiceData | null) | null>(+ null,+ );// Refs to track original URL invoice dataconst originalUrlInvoiceDataRef = useRef<InvoiceData | null>(null);+ // Tracks whether the invoice data has already been initialized (from URL or localStorage).+ // Initialization must happen exactly once per page load, see the effect below for details.+ const hasInitializedInvoiceDataRef = useRef(false);+// Generate QR code data URL when qrCodeData changesuseEffect(() => {// Flag to detect if the component is still mounted and effect is active@@ -172,12 +183,6 @@ export function AppPageClient({};}, [invoiceDataState?.qrCodeData, invoiceDataState?.qrCodeIsVisible]);- // Only show CTA toast on idle in non-CI environments- if (!process.env.CI) {- // eslint-disable-next-line react-hooks/rules-of-hooks- useShowRandomCTAToastOnIdle();- }-// Helper function to load from localStorageconst loadFromLocalStorage = useCallback(() => {try {@@ -185,13 +190,13 @@ export function AppPageClient({// add metadata with default values if missing for all usersif (!appMetadata) {- localStorage.setItem(- METADATA_LOCAL_STORAGE_KEY,- JSON.stringify(DEFAULT_METADATA),- );+ setAppStorageItem({+ key: METADATA_LOCAL_STORAGE_KEY,+ value: JSON.stringify(DEFAULT_METADATA),+ });}- const savedData = localStorage.getItem(PDF_DATA_LOCAL_STORAGE_KEY);+ const savedData = getAppStorageItem(PDF_DATA_LOCAL_STORAGE_KEY);if (savedData) {const json: unknown = JSON.parse(savedData);@@ -207,14 +212,12 @@ export function AppPageClient({: parsedData;setInvoiceDataState(selectedInvoiceData);+ } else if (templateValidation.success) {+ // if no data in local storage and template is in url, set initial data with template from url+ setInvoiceDataState(getInitialInvoiceData(templateValidation.data));} else {- if (templateValidation.success) {- // if no data in local storage and template is in url, set initial data with template from url- setInvoiceDataState(getInitialInvoiceData(templateValidation.data));- } else {- // if no data in local storage, set initial data- setInvoiceDataState(getInitialInvoiceData());- }+ // if no data in local storage, set initial data+ setInvoiceDataState(getInitialInvoiceData());}} catch (error) {console.error("Failed to load saved invoice data:", error);@@ -247,6 +250,21 @@ export function AppPageClient({// Initialize data from URL (via shared invoice link) or localStorage on page loaduseEffect(() => {+ // Run only once per page load.+ //+ // This effect depends on `searchParams`, and the app rewrites the URL with+ // `router.replace` on its own (e.g. to keep ?template= in sync, or to add ?data=+ // when a share link is generated). Without this guard, every one of those rewrites+ // re-ran the initialization, re-read localStorage and called `setInvoiceDataState`+ // with a brand new (but identical) object. That extra state update makes react-pdf+ // regenerate the very same PDF a second time, which shows up as a visible flicker /+ // double render in the preview when the user switches the invoice template.+ if (hasInitializedInvoiceDataRef.current) {+ return;+ }++ hasInitializedInvoiceDataRef.current = true;+const compressedInvoiceDataInUrl = searchParams.get("data");const urlTemplateSearchParam = searchParams.get("template");@@ -258,7 +276,7 @@ export function AppPageClient({// first try to load from url i.e. if user has shared invoice linkif (compressedInvoiceDataInUrl) {- console.log("[useEffect] [initialize invoice data from ** URL **]");+ console.warn("[useEffect] [initialize invoice data from ** URL **]");try {const decompressedData = decompressFromEncodedURIComponent(@@ -277,7 +295,7 @@ export function AppPageClient({const validatedDataFromURL = invoiceSchema.parse(updatedJson);- console.log(+ console.warn("[useEffect] [initialize invoice data from ** URL **] validatedDataFromURL",validatedDataFromURL,);@@ -299,10 +317,10 @@ export function AppPageClient({// add metadata with default values if missing for all usersif (!appMetadata) {- localStorage.setItem(- METADATA_LOCAL_STORAGE_KEY,- JSON.stringify(DEFAULT_METADATA),- );+ setAppStorageItem({+ key: METADATA_LOCAL_STORAGE_KEY,+ value: JSON.stringify(DEFAULT_METADATA),+ });}} catch (error) {console.error(@@ -340,14 +358,14 @@ export function AppPageClient({</Button></div>),- duration: 20000,+ duration: 20_000,closeButton: true,});Sentry.captureException(error);}} else {- console.log(+ console.warn("[useEffect] [initialize invoice data from ** LOCAL STORAGE **]",);@@ -361,12 +379,19 @@ export function AppPageClient({* If missing, adds it based on the current invoice data state.*/useEffect(() => {- // Only run if we have invoice data and no template in URL+ // Only run if we have invoice data and no template in URL.+ //+ // `no-event-handler` wants this written where the invoice data is set, but `router.replace`+ // is dropped when it is called from the initialization effect while the App Router is still+ // mounting -- under load the shared-link e2e tests then sit on a URL that never grows its+ // `?template=`. Reacting to `invoiceDataState` defers the call by one render, which is what+ // makes it land.+ // oxlint-disable-next-line react-you-might-not-need-an-effect/no-event-handlerif (!invoiceDataState || searchParams.get("template")) {return;}- console.log("[useEffect] [add missing template to URL]", {+ console.warn("[useEffect] [add missing template to URL]", {template: invoiceDataState.template,});@@ -386,7 +411,7 @@ export function AppPageClient({*/const checkForInvoiceChanges = useCallback((currentData: InvoiceData) => {- console.log("[checkForInvoiceChanges]", currentData.template, {+ console.warn("[checkForInvoiceChanges]", currentData.template, {originalUrlInvoiceDataRef: originalUrlInvoiceDataRef.current,});@@ -395,7 +420,7 @@ export function AppPageClient({// Skip if no original URL data or no data in urlif (!originalUrlInvoiceDataRef.current || !urlData) {- console.log("[checkForInvoiceChanges] skipping");+ console.warn("[checkForInvoiceChanges] skipping");return;}@@ -406,7 +431,7 @@ export function AppPageClient({JSON.stringify(currentData);if (invoiceHasChanged) {- console.log("[checkForInvoiceChanges] invoice has changed");+ console.warn("[checkForInvoiceChanges] invoice has changed");toast.info(<div className="space-y-2">@@ -453,10 +478,10 @@ export function AppPageClient({**/const handleInvoiceDataChange = (updatedData: InvoiceData) => {- console.log("[handleInvoiceDataChange]");+ console.warn("[handleInvoiceDataChange]");if (isInvoiceUrlCorrupted) {- console.log("[handleInvoiceDataChange] clearing url due to corruption");+ console.warn("[handleInvoiceDataChange] clearing url due to corruption");/** CLEAR URL IN CASE OF CORRUPTED INVOICE URL (i.e. "/?data=") for better UX and consistency */@@ -497,21 +522,18 @@ export function AppPageClient({setInvoiceDataState(updatedData);checkForInvoiceChanges(updatedData);- // this is used to show CTA toast- incrementInteractionCount();-const currentTemplate = searchParams.get("template");// update the url with the new templateif (currentTemplate !== updatedData.template) {- console.log("[handleInvoiceDataChange] update url with new template", {+ console.warn("[handleInvoiceDataChange] update url with new template", {currentTemplate,updatedDataTemplate: updatedData.template,});router.replace(`/?template=${updatedData.template}`, { scroll: false });} else {- console.log("[handleInvoiceDataChange] invoice template did not change");+ console.warn("[handleInvoiceDataChange] invoice template did not change");}};@@ -535,8 +557,17 @@ export function AppPageClient({return;}+ // Read the form directly rather than trusting `invoiceDataState`, which only catches+ // up on the DEBOUNCE_TIMEOUT commit: a click inside that window would otherwise share+ // the pre-edit snapshot, and the edit landing a moment later would strip ?data= again+ // via checkForInvoiceChanges. Falls back to `invoiceDataState` when the form is not+ // mounted (mobile opens on the preview tab), where the tab switch has already flushed.+ const currentInvoiceData = currentInvoiceFormDataRef.current+ ? currentInvoiceFormDataRef.current()+ : invoiceDataState;+// prevent sharing invoice if there are form errors- if (invoiceFormHasErrors) {+ if (!currentInvoiceData) {toast.error("Unable to Share Invoice", {id: "unable-to-share-invoice-form-errors-toast",duration: 6000,@@ -553,9 +584,9 @@ export function AppPageClient({}// if invoice data state is valid, generate the shareable link and update the url- if (invoiceDataState) {+ if (currentInvoiceData) {try {- const newInvoiceDataValidated = invoiceSchema.parse(invoiceDataState);+ const newInvoiceDataValidated = invoiceSchema.parse(currentInvoiceData);// trigger haptic feedback on mobile deviceshaptic();@@ -588,11 +619,17 @@ export function AppPageClient({}const currentParams = new URLSearchParams(searchParams.toString());- currentParams.set("template", invoiceDataState.template);+ currentParams.set("template", newInvoiceDataValidated.template);currentParams.set("data", compressedData);router.replace(`?${currentParams.toString()}`, { scroll: false });+ // Remember the invoice that was just shared, so later edits are detected and the+ // "Invoice Updated" toast is shown. Previously this ref was (re)populated as a+ // side effect of the initialization effect re-running on the ?data= URL change,+ // which no longer happens now that initialization runs once per page load.+ originalUrlInvoiceDataRef.current = newInvoiceDataValidated;+// Construct full URL with locale and compressed dataconst newGeneratedLinkFullUrl = `${window.location.origin}/?${currentParams.toString()}`;@@ -619,40 +656,37 @@ export function AppPageClient({.then(() => {umamiTrackEvent("share_invoice_link_mobile");- updateAppMetadata((current) => ({- ...current,- invoiceSharedCount: (current?.invoiceSharedCount ?? 0) + 1,- }));+ updateAppMetadata((current) => {+ return {+ ...current,+ invoiceSharedCount: (current?.invoiceSharedCount ?? 0) + 1,+ };+ });// dismiss other toasts when navigator.share is successful (for better UX)setTimeout(() => {toast.dismiss();- }, 1_500);-- // show CTA toast after x seconds- setTimeout(() => {- showRandomCTAToast();- }, 2_500);+ }, 1500);})- .catch((err) => {+ .catch((error) => {console.error("[handleShareInvoice] failed to share invoice:",- err,+ error,);// dismiss all other toasts for better UXtoast.dismiss();// Only show error if it's not an abort error (user cancelled the share)- if (err instanceof Error && err?.name !== "AbortError") {+ if (error instanceof Error && error?.name !== "AbortError") {toast.error("Failed to share invoice", {id: "failed-to-share-invoice-error-toast",description: `Please try again or copy the link manually from the address bar`,position: isMobile ? "top-center" : "bottom-right",- duration: 5_000,+ duration: 5000,});- Sentry.captureException(err);+ Sentry.captureException(error);}});} catch (shareError) {@@ -678,27 +712,22 @@ export function AppPageClient({</p>),position: isMobile ? "top-center" : "bottom-right",- duration: 5_000,+ duration: 5000,});umamiTrackEvent("share_invoice_link");- updateAppMetadata((current) => ({- ...current,- invoiceSharedCount: (current?.invoiceSharedCount ?? 0) + 1,- }));-- // show CTA toast after x seconds (after invoice link notification is shown)- setTimeout(() => {- showRandomCTAToast();- }, 5_500);+ updateAppMetadata((current) => {+ return {+ ...current,+ invoiceSharedCount: (current?.invoiceSharedCount ?? 0) + 1,+ };+ });})- .catch((err) => {- Sentry.captureException(err);+ .catch((error) => {+ Sentry.captureException(error);});}-- markCTAActionTriggered();} catch (error) {console.error("Failed to share invoice:", error);toast.error("Failed to generate shareable link", {@@ -717,46 +746,43 @@ export function AppPageClient({return (<TooltipProvider delayDuration={0}>- <div className="flex flex-col items-center justify-start bg-gray-100 pb-4 sm:p-4 md:justify-center lg:min-h-screen">- <div className="w-full max-w-[62rem] bg-white p-3 shadow-lg sm:mb-0 sm:rounded-lg sm:p-6 sm:pb-1 min-[1400px]:max-w-7xl 2xl:max-w-[1480px]">- <InvoicePageHeader- canShareInvoice={canShareInvoice}- handleShareInvoice={handleShareInvoice}- isDesktop={isDesktop}- invoiceDataState={invoiceDataState}- errorWhileGeneratingPdfIsShown={errorWhileGeneratingPdfIsShown}- setErrorWhileGeneratingPdfIsShown={- setErrorWhileGeneratingPdfIsShown- }- qrCodeDataUrl={qrCodeDataUrl}- isMobile={isMobile}- isSharedInvoice={isViewingSharedInvoice}- />- <div className="grid grid-cols-1 gap-4 lg:grid-cols-12">- <InvoiceClientPage- invoiceDataState={invoiceDataState}- handleInvoiceDataChange={handleInvoiceDataChange}+ {/* Generates the invoice PDF once and shares it with the preview and the download button */}+ <InvoicePdfInstanceProvider+ invoiceData={invoiceDataState}+ qrCodeDataUrl={qrCodeDataUrl}+ >+ <div className="flex flex-col items-center justify-start bg-gray-100 pb-4 sm:p-4 md:justify-center lg:min-h-screen">+ <div className="w-full max-w-[62rem] bg-white p-3 shadow-lg sm:mb-0 sm:rounded-lg sm:p-6 sm:pb-1 min-[1400px]:max-w-7xl 2xl:max-w-[1480px]">+ <InvoicePageHeader+ canShareInvoice={canShareInvoice}handleShareInvoice={handleShareInvoice}+ isDesktop={isDesktop}+ invoiceDataState={invoiceDataState}isMobile={isMobile}- errorWhileGeneratingPdfIsShown={errorWhileGeneratingPdfIsShown}- setErrorWhileGeneratingPdfIsShown={- setErrorWhileGeneratingPdfIsShown- }- canShareInvoice={canShareInvoice}- qrCodeDataUrl={qrCodeDataUrl}- setInvoiceFormHasErrors={setInvoiceFormHasErrors}+ isSharedInvoice={isViewingSharedInvoice}/>+ <div className="grid grid-cols-1 gap-4 lg:grid-cols-12">+ <InvoiceClientPage+ invoiceDataState={invoiceDataState}+ handleInvoiceDataChange={handleInvoiceDataChange}+ handleShareInvoice={handleShareInvoice}+ isMobile={isMobile}+ canShareInvoice={canShareInvoice}+ currentInvoiceFormDataRef={currentInvoiceFormDataRef}+ />+ </div></div></div>- </div>+ </InvoicePdfInstanceProvider><Footer />{changelogPopupVariant ? (<ChangelogUpdatePopupvariant={changelogPopupVariant}- latestChangelog={changelogForPopup}isOpen={isChangelogPopupOpen}onDismiss={dismissChangelogPopup}- onHowItWorksClick={() => setIsHowItWorksDialogOpen(true)}+ onHowItWorksClick={() => {+ return setIsHowItWorksDialogOpen(true);+ }}/>) : null}<HowItWorksVideoDialogdiff --git a/src/app/(app)/page.tsx b/src/app/(app)/page.tsxindex c21856f..d06faf3 100644--- a/src/app/(app)/page.tsx+++ b/src/app/(app)/page.tsx@@ -1,12 +1,14 @@+import * as Sentry from "@sentry/nextjs";import type { Metadata } from "next";-import { AppPageClient } from "./page.client";-import { APP_URL, STATIC_ASSETS_URL, TWITTER_CREATOR } from "@/config";+import { fetchGithubStars } from "@/actions/fetch-github-stars";import { getLatestChangelogSummary } from "@/app/changelog/utils";+import { APP_URL, STATIC_ASSETS_URL, TWITTER_CREATOR } from "@/config";+import { computeIndexingFlags } from "@/lib/seo/indexing-utils";+import { CTAToastProvider } from "./contexts/cta-toast-context";import { HomeJsonLd } from "./home-json-ld";-import { computeIndexingFlags } from "@/lib/seo/indexing-utils";-import * as Sentry from "@sentry/nextjs";+import { AppPageClient } from "./page.client";const APP_PAGE_DESCRIPTION ="Create professional PDF invoices online for free. Customize invoice templates, add your logo, download instantly, and send invoices without signup.";@@ -131,10 +133,12 @@ function resolveAppPageRobots(export async function generateMetadata({searchParams,}: {- searchParams: { [key: string]: string | string[] | undefined };+ searchParams: Promise<{ [key: string]: string | string[] | undefined }>;}): Promise<Metadata> {- const { shouldIndex } = computeIndexingFlags(searchParams);- const isStripeTemplate = Boolean(searchParams?.template === "stripe");+ const resolvedSearchParams = await searchParams;++ const { shouldIndex } = computeIndexingFlags(resolvedSearchParams);+ const isStripeTemplate = resolvedSearchParams?.template === "stripe";const templateMetadata = buildTemplateMetadata(isStripeTemplate ? STRIPE_TEMPLATE_META : DEFAULT_TEMPLATE_META,@@ -151,9 +155,9 @@ export async function generateMetadata({export default async function AppPage({searchParams,}: {- searchParams: { [key: string]: string | string[] | undefined };+ searchParams: Promise<{ [key: string]: string | string[] | undefined }>;}) {- const { shouldIndex } = computeIndexingFlags(searchParams);+ const { shouldIndex } = computeIndexingFlags(await searchParams);const [githubStarsCount, latestChangelog] = await Promise.all([fetchGithubStars(),diff --git a/src/app/(app)/pdf-i18n-translations/pdf-translations-schema.ts b/src/app/(app)/pdf-i18n-translations/pdf-translations-schema.tsnew file mode 100644index 0000000..4d568ed--- /dev/null+++ b/src/app/(app)/pdf-i18n-translations/pdf-translations-schema.ts@@ -0,0 +1,187 @@+import { z } from "zod";++import { SUPPORTED_LANGUAGES } from "../../schema/index";++const customTaxLabelInputSchema = z+ .object({+ customTaxLabel: z.string(),+ })+ .strict();++/**+ * Zod schema for a function that takes an object with a customTaxLabel string property+ * and returns a string. Used to validate custom i18n label functions.+ */+const functionCustomTaxLabelInputSchema = z.function({+ input: [customTaxLabelInputSchema],+ output: z.string(),+});++// Schema for seller translations+const sellerTranslationSchema = z+ .object({+ name: z.string(),+ vatNo: z.string(),+ email: z.string(),+ accountNumber: z.string(),+ swiftBic: z.string(),+ })+ .strict();++// Schema for buyer translations+const buyerTranslationSchema = z+ .object({+ name: z.string(),+ vatNo: z.string(),+ email: z.string(),+ })+ .strict();++// Schema for invoice items table translations+const invoiceItemsTableTranslationSchema = z+ .object({+ no: z.string(),+ nameOfGoodsService: z.string(),+ typeOfGTU: z.string(),+ amount: z.string(),+ unit: z.string(),+ /**+ * You can pass a custom text for the net price label. i.e. for i18n+ * @example+ * netPrice: ({ customTaxLabel: string }) => {+ * return `Цена без ${customTaxLabel || "НДС"}`;+ * }+ */+ netPrice: functionCustomTaxLabelInputSchema,+ vat: z.string(),+ /**+ * You can pass a custom text for the net amount label. i.e. for i18n+ * @example+ * netAmount: ({ customTaxLabel: string }) => {+ * return `Сумма без ${customTaxLabel || "НДС"}`;+ * }+ */+ netAmount: functionCustomTaxLabelInputSchema,+ /**+ * You can pass a custom text for the VAT amount label. i.e. for i18n+ * @example+ * vatAmount: ({ customTaxLabel: string }) => {+ * return `${customTaxLabel || "VAT"} Amount`;+ * }+ */+ vatAmount: functionCustomTaxLabelInputSchema,+ /**+ * You can pass a custom text for the pre-tax amount label. i.e. for i18n+ * @example+ * preTaxAmount: ({ customTaxLabel: string }) => {+ * return `Сумма с ${customTaxLabel || "НДС"}`;+ * }+ */+ preTaxAmount: functionCustomTaxLabelInputSchema,+ sum: z.string(),+ })+ .strict();++// Schema for payment info translations+const paymentInfoTranslationSchema = z+ .object({+ paymentMethod: z.string(),+ paymentDate: z.string(),+ })+ .strict();++// Schema for VAT summary table translations+const vatSummaryTableTranslationSchema = z+ .object({+ /**+ * You can pass a custom text for the VAT rate label. i.e. for i18n+ * @example+ * vatRate: ({ customTaxLabel: string }) => {+ * return `Ставка ${customTaxLabel || "НДС"}`;+ * }+ */+ vatRate: functionCustomTaxLabelInputSchema,+ /**+ * You can pass a custom text for the net label. i.e. for i18n+ * @example+ * net: ({ customTaxLabel: string }) => {+ * return `Без ${customTaxLabel || "НДС"}`;+ * }+ */+ net: functionCustomTaxLabelInputSchema,+ vat: z.string(),+ /**+ * You can pass a custom text for the pre-tax label. i.e. for i18n+ * @example+ * preTax: ({ customTaxLabel: string }) => {+ * return `С ${customTaxLabel || "НДС"}`;+ * }+ */+ preTax: functionCustomTaxLabelInputSchema,+ total: z.string(),+ })+ .strict();++// Schema for payment totals translations+const paymentTotalsTranslationSchema = z+ .object({+ toPay: z.string(),+ paid: z.string(),+ leftToPay: z.string(),+ amountInWords: z.string(),+ })+ .strict();++// Schema for Stripe-specific translations+const stripeTranslationSchema = z+ .object({+ invoice: z.string(),+ invoiceNumber: z.string(),+ dateOfIssue: z.string(),+ dateDue: z.string(),+ servicePeriod: z.string(),+ billTo: z.string(),+ due: z.string(),+ payOnline: z.string(),+ description: z.string(),+ qty: z.string(),+ unit: z.string(),+ unitPrice: z.string(),+ amount: z.string(),+ tax: z.string(),+ subtotal: z.string(),+ totalExcludingTax: z.string(),+ total: z.string(),+ amountDue: z.string(),+ page: z.string(),+ of: z.string(),+ })+ .strict();++export const translationSchema = z+ .object({+ invoiceNumber: z.string(),+ dateOfIssue: z.string(),+ dateOfService: z.string(),+ servicePeriod: z.string(),+ invoiceType: z.string(),+ seller: sellerTranslationSchema,+ buyer: buyerTranslationSchema,+ invoiceItemsTable: invoiceItemsTableTranslationSchema,+ paymentInfo: paymentInfoTranslationSchema,+ vatSummaryTable: vatSummaryTableTranslationSchema,+ paymentTotals: paymentTotalsTranslationSchema,+ personAuthorizedToReceive: z.string(),+ personAuthorizedToIssue: z.string(),+ createdWith: z.string(),+ stripe: stripeTranslationSchema,+ })+ .strict();++/** Schema for the complete PDF translation catalog. */+export const invoicePDFTranslationsSchema = z.record(+ z.enum(SUPPORTED_LANGUAGES),+ translationSchema,+);++export type TranslationSchema = z.infer<typeof translationSchema>;diff --git a/src/app/(app)/pdf-i18n-translations/pdf-translations.ts b/src/app/(app)/pdf-i18n-translations/pdf-translations.tsindex 08a34f5..a1c7f85 100644--- a/src/app/(app)/pdf-i18n-translations/pdf-translations.ts+++ b/src/app/(app)/pdf-i18n-translations/pdf-translations.ts@@ -1,216 +1,8 @@-import { z } from "zod";import {- SUPPORTED_LANGUAGES,type SupportedLanguages,type SupportedTemplates,} from "../../schema/index";--// Schema for seller translations-const sellerTranslationSchema = z- .object({- name: z.string(),- vatNo: z.string(),- email: z.string(),- accountNumber: z.string(),- swiftBic: z.string(),- })- .strict();--// Schema for buyer translations-const buyerTranslationSchema = z- .object({- name: z.string(),- vatNo: z.string(),- email: z.string(),- })- .strict();--// Schema for invoice items table translations-const invoiceItemsTableTranslationSchema = z- .object({- no: z.string(),- nameOfGoodsService: z.string(),- typeOfGTU: z.string(),- amount: z.string(),- unit: z.string(),- /**- * You can pass a custom text for the net price label. i.e. for i18n- * @example- * netPrice: ({ customTaxLabel: string }) => {- * return `Цена без ${customTaxLabel || "НДС"}`;- * }- */- netPrice: z- .function()- .args(z.object({ customTaxLabel: z.string() }))- .returns(z.string()),- vat: z.string(),- /**- * You can pass a custom text for the net amount label. i.e. for i18n- * @example- * netAmount: ({ customTaxLabel: string }) => {- * return `Сумма без ${customTaxLabel || "НДС"}`;- * }- */- netAmount: z- .function()- .args(z.object({ customTaxLabel: z.string() }))- .returns(z.string()),- /**- * You can pass a custom text for the VAT amount label. i.e. for i18n- * @example- * vatAmount: ({ customTaxLabel: string }) => {- * return `${customTaxLabel || "VAT"} Amount`;- * }- */- vatAmount: z- .function()- .args(z.object({ customTaxLabel: z.string() }))- .returns(z.string()),- /**- * You can pass a custom text for the pre-tax amount label. i.e. for i18n- * @example- * preTaxAmount: ({ customTaxLabel: string }) => {- * return `Сумма с ${customTaxLabel || "НДС"}`;- * }- */- preTaxAmount: z- .function()- .args(z.object({ customTaxLabel: z.string() }))- .returns(z.string()),- sum: z.string(),- })- .strict();--// Schema for payment info translations-const paymentInfoTranslationSchema = z- .object({- paymentMethod: z.string(),- paymentDate: z.string(),- })- .strict();--// Schema for VAT summary table translations-const vatSummaryTableTranslationSchema = z- .object({- /**- * You can pass a custom text for the VAT rate label. i.e. for i18n- * @example- * vatRate: ({ customTaxLabel: string }) => {- * return `Ставка ${customTaxLabel || "НДС"}`;- * }- */- vatRate: z- .function()- .args(z.object({ customTaxLabel: z.string() }))- .returns(z.string()),- /**- * You can pass a custom text for the net label. i.e. for i18n- * @example- * net: ({ customTaxLabel: string }) => {- * return `Без ${customTaxLabel || "НДС"}`;- * }- */- net: z- .function()- .args(z.object({ customTaxLabel: z.string() }))- .returns(z.string()),- vat: z.string(),- /**- * You can pass a custom text for the pre-tax label. i.e. for i18n- * @example- * preTax: ({ customTaxLabel: string }) => {- * return `С ${customTaxLabel || "НДС"}`;- * }- */- preTax: z- .function()- .args(z.object({ customTaxLabel: z.string() }))- .returns(z.string()),- total: z.string(),- })- .strict();--// Schema for payment totals translations-const paymentTotalsTranslationSchema = z- .object({- toPay: z.string(),- paid: z.string(),- leftToPay: z.string(),- amountInWords: z.string(),- })- .strict();--// Schema for Stripe-specific translations-const stripeTranslationSchema = z- .object({- invoice: z.string(),- invoiceNumber: z.string(),- dateOfIssue: z.string(),- dateDue: z.string(),- servicePeriod: z.string(),- billTo: z.string(),- due: z.string(),- payOnline: z.string(),- description: z.string(),- qty: z.string(),- unit: z.string(),- unitPrice: z.string(),- amount: z.string(),- tax: z.string(),- subtotal: z.string(),- totalExcludingTax: z.string(),- total: z.string(),- amountDue: z.string(),- page: z.string(),- of: z.string(),- })- .strict();--// Main translation schema-export const translationSchema = z- .object({- invoiceNumber: z.string(),- dateOfIssue: z.string(),- dateOfService: z.string(),- servicePeriod: z.string(),- invoiceType: z.string(),- seller: sellerTranslationSchema,- buyer: buyerTranslationSchema,- invoiceItemsTable: invoiceItemsTableTranslationSchema,- paymentInfo: paymentInfoTranslationSchema,- vatSummaryTable: vatSummaryTableTranslationSchema,- paymentTotals: paymentTotalsTranslationSchema,- personAuthorizedToReceive: z.string(),- personAuthorizedToIssue: z.string(),- createdWith: z.string(),- stripe: stripeTranslationSchema,- })- .strict();--/**- * Creates a map of language to schema- * @example- {- en: translationSchema,- pl: translationSchema,- de: translationSchema,- ...etc- }- */-const languageToSchemaMap = Object.fromEntries(- SUPPORTED_LANGUAGES.map((lang) => [lang, translationSchema]),-);-/**- *Schema for all translations- **/-export const invoicePDFtranslationsSchema = z.object(languageToSchemaMap);--// Type for a single language translation-type TranslationSchema = z.infer<typeof translationSchema>;--// Type for all translations-// export type TranslationsSchema = z.infer<typeof invoicePDFtranslationsSchema>;+import type { TranslationSchema } from "./pdf-translations-schema";export const INVOICE_PDF_TRANSLATIONS = {en: {diff --git a/src/app/(app)/utils/__tests__/format-date-with-locale.test.ts b/src/app/(app)/utils/__tests__/format-date-with-locale.test.tsnew file mode 100644index 0000000..568e980--- /dev/null+++ b/src/app/(app)/utils/__tests__/format-date-with-locale.test.ts@@ -0,0 +1,116 @@+import dayjs from "dayjs";+import { describe, expect, it } from "vitest";++import {+ formatDateWithLocale,+ formatTodayWithLocale,+} from "@/app/(app)/utils/format-date-with-locale";+import { SUPPORTED_LANGUAGES, type SupportedLanguages } from "@/app/schema";++const DATE = "2026-09-01";++/**+ * Expected rendering of {@link DATE} with the `MMMM D, YYYY` format in every+ * supported language. Typed as an exhaustive record, so adding a language to+ * `SUPPORTED_LANGUAGES` without registering its dayjs locale fails to compile here.+ */+const EXPECTED_LONG_DATE: Record<SupportedLanguages, string> = {+ en: "September 1, 2026",+ pl: "wrzesień 1, 2026",+ de: "September 1, 2026",+ es: "septiembre 1, 2026",+ pt: "setembro 1, 2026",+ ru: "сентябрь 1, 2026",+ uk: "вересень 1, 2026",+ fr: "septembre 1, 2026",+ it: "settembre 1, 2026",+ nl: "september 1, 2026",+};++describe("formatDateWithLocale", () => {+ it.each(SUPPORTED_LANGUAGES)(+ "formats a date in %s, so the locale is actually registered",+ (language) => {+ expect(+ formatDateWithLocale({+ date: DATE,+ selectedDateFormat: "MMMM D, YYYY",+ language,+ }),+ ).toBe(EXPECTED_LONG_DATE[language]);+ },+ );++ it("renders month names differently per language", () => {+ // Guards against the silent dayjs fallback: an unregistered locale keeps the+ // previous one, which would make every language render identically.+ const rendered = SUPPORTED_LANGUAGES.map((language) => {+ return formatDateWithLocale({+ date: DATE,+ selectedDateFormat: "D MMM YYYY",+ language,+ });+ });++ // "es"/"nl" both render "1 sep 2026", so the set is smaller than the list —+ // what matters is that we are not down to a single shared rendering.+ expect(new Set(rendered).size).toBeGreaterThan(1);+ });++ it("leaves numeric formats untouched across languages", () => {+ for (const language of SUPPORTED_LANGUAGES) {+ expect(+ formatDateWithLocale({+ date: DATE,+ selectedDateFormat: "YYYY-MM-DD",+ language,+ }),+ ).toBe(DATE);+ }+ });++ it("accepts a Dayjs instance as well as a string", () => {+ expect(+ formatDateWithLocale({+ date: dayjs(DATE).add(14, "days"),+ selectedDateFormat: "YYYY-MM-DD",+ language: "fr",+ }),+ ).toBe("2026-09-15");+ });++ it("does not change the global dayjs locale", () => {+ const globalLocaleBefore = dayjs.locale();++ formatDateWithLocale({+ date: DATE,+ selectedDateFormat: "MMMM D, YYYY",+ language: "pl",+ });++ expect(dayjs.locale()).toBe(globalLocaleBefore);+ expect(dayjs(DATE).format("MMMM")).toBe("September");+ });+});++describe("formatTodayWithLocale", () => {+ it("formats today in the given language", () => {+ const today = dayjs();++ expect(+ formatTodayWithLocale({+ selectedDateFormat: "MMMM D, YYYY",+ language: "it",+ }),+ ).toBe(today.locale("it").format("MMMM D, YYYY"));+ });++ it("uses today and not some other date", () => {+ expect(+ formatTodayWithLocale({+ selectedDateFormat: "YYYY-MM-DD",+ language: "en",+ }),+ ).toBe(dayjs().format("YYYY-MM-DD"));+ });+});diff --git a/src/app/(app)/utils/__tests__/format-service-period.test.ts b/src/app/(app)/utils/__tests__/format-service-period.test.tsindex a18cc0d..b367e36 100644--- a/src/app/(app)/utils/__tests__/format-service-period.test.ts+++ b/src/app/(app)/utils/__tests__/format-service-period.test.ts@@ -3,6 +3,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";import {formatDateOfServiceEnd,formatServicePeriodRange,+ getCurrentMonthAndYear,getServicePeriod,isFirstDayOfMonth,isServicePeriodStartInCurrentMonth,@@ -97,4 +98,36 @@ describe("format-service-period", () => {expect(result).toBe("2025-06-14 – 2025-06-20");});});++ describe("getCurrentMonthAndYear", () => {+ beforeEach(() => {+ vi.useFakeTimers();+ });++ afterEach(() => {+ vi.useRealTimers();+ });++ it("should zero-pad single digit months", () => {+ vi.setSystemTime(new Date("2025-06-15T12:00:00Z"));++ expect(getCurrentMonthAndYear()).toBe("06-2025");+ });++ it("should not pad double digit months", () => {+ vi.setSystemTime(new Date("2025-12-31T12:00:00Z"));++ expect(getCurrentMonthAndYear()).toBe("12-2025");+ });++ it("should be recomputed on every call, so a tab open past the month boundary rolls over", () => {+ vi.setSystemTime(new Date("2025-12-31T12:00:00Z"));+ const beforeRollover = getCurrentMonthAndYear();++ vi.setSystemTime(new Date("2026-01-01T12:00:00Z"));++ expect(beforeRollover).toBe("12-2025");+ expect(getCurrentMonthAndYear()).toBe("01-2026");+ });+ });});diff --git a/src/app/(app)/utils/__tests__/invoice-number-breaking-change.test.ts b/src/app/(app)/utils/__tests__/invoice-number-breaking-change.test.tsindex c2b343e..4a5f65e 100644--- a/src/app/(app)/utils/__tests__/invoice-number-breaking-change.test.ts+++ b/src/app/(app)/utils/__tests__/invoice-number-breaking-change.test.ts@@ -1,12 +1,16 @@import { describe, it, expect, vi, beforeEach } from "vitest";-import { handleInvoiceNumberBreakingChange } from "../invoice-number-breaking-change";-import { SUPPORTED_LANGUAGES, type InvoiceData } from "@/app/schema";+import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import { SUPPORTED_LANGUAGES, type InvoiceData } from "@/app/schema";++import { handleInvoiceNumberBreakingChange } from "../invoice-number-breaking-change";// Mock the umami tracking function-vi.mock("@/lib/umami-analytics-track-event", () => ({- umamiTrackEvent: vi.fn(),-}));+vi.mock("@/lib/umami-analytics-track-event", () => {+ return {+ umamiTrackEvent: vi.fn(),+ };+});import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";@@ -163,7 +167,10 @@ describe("handleInvoiceNumberBreakingChange", () => {},});- expect(consoleSpy).toHaveBeenCalled();+ expect(consoleSpy).toHaveBeenCalledWith(+ "Invalid invoice language:",+ expect.any(Object),+ );expect(umamiTrackEvent).toHaveBeenCalledWith("breaking_change_detected");consoleSpy.mockRestore();@@ -230,14 +237,14 @@ describe("handleInvoiceNumberBreakingChange", () => {it("should return unchanged when input is null", () => {const result = handleInvoiceNumberBreakingChange(null);- expect(result).toBe(null);+ expect(result).toBeNull();expect(umamiTrackEvent).not.toHaveBeenCalled();});it("should return unchanged when input is undefined", () => {const result = handleInvoiceNumberBreakingChange(undefined);- expect(result).toBe(undefined);+ expect(result).toBeUndefined();expect(umamiTrackEvent).not.toHaveBeenCalled();});@@ -320,7 +327,7 @@ describe("handleInvoiceNumberBreakingChange", () => {const result = handleInvoiceNumberBreakingChange(input);expect((result as InvoiceData).invoiceNumberObject?.value).toBe(- "INV/2024\\001-#@!",+ String.raw`INV/2024\001-#@!`,);});@@ -353,20 +360,19 @@ describe("handleInvoiceNumberBreakingChange", () => {const result = handleInvoiceNumberBreakingChange(input);expect(typeof result).toBe("object");- expect(result).not.toBe(null);+ expect(result).not.toBeNull();++ // `handleInvoiceNumberBreakingChange` takes and returns `unknown`, so the+ // shape has to be asserted rather than narrowed with an `if`.+ const resultObject = result as Record<string, unknown>;- if (typeof result === "object" && result !== null) {- expect("invoiceNumberObject" in result).toBe(true);- expect("invoiceNumber" in result).toBe(false);+ expect("invoiceNumberObject" in resultObject).toBe(true);+ expect("invoiceNumber" in resultObject).toBe(false);- if ("invoiceNumberObject" in result) {- const invoiceNumberObject = (result as unknown as InvoiceData)- .invoiceNumberObject;+ const { invoiceNumberObject } = result as InvoiceData;- expect(typeof invoiceNumberObject?.label).toBe("string");- expect(typeof invoiceNumberObject?.value).toBe("string");- }- }+ expect(typeof invoiceNumberObject?.label).toBe("string");+ expect(typeof invoiceNumberObject?.value).toBe("string");});});});diff --git a/src/app/(app)/utils/__tests__/select-invoice-template.test.ts b/src/app/(app)/utils/__tests__/select-invoice-template.test.tsindex c6eae3a..c7f42eb 100644--- a/src/app/(app)/utils/__tests__/select-invoice-template.test.ts+++ b/src/app/(app)/utils/__tests__/select-invoice-template.test.ts@@ -1,10 +1,12 @@import { describe, it, expect } from "vitest";-import { getInitialInvoiceData, INITIAL_INVOICE_DATA } from "@/app/constants";+import {getDefaultInvoiceNumberLabel,INVOICE_PDF_TRANSLATIONS,} from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import { getInitialInvoiceData, INITIAL_INVOICE_DATA } from "@/app/constants";import type { InvoiceData } from "@/app/schema";+import { selectInvoiceTemplate } from "../select-invoice-template";describe("selectInvoiceTemplate", () => {diff --git a/src/app/(app)/utils/app-local-storage.ts b/src/app/(app)/utils/app-local-storage.tsnew file mode 100644index 0000000..22aab6d--- /dev/null+++ b/src/app/(app)/utils/app-local-storage.ts@@ -0,0 +1,42 @@+"use client";++import type { LocalStorageKey } from "@/app/schema";+import {+ safeLocalStorageGetItem,+ safeLocalStorageSetItem,+} from "@/lib/safe-local-storage";++/**+ * `localStorage` accessors restricted to the keys the app actually owns.+ *+ * These are the ones app code should reach for. The helpers in `@/lib/safe-local-storage`+ * they wrap are deliberately key-agnostic — that module knows nothing about invoices, so+ * it stays testable on its own — and this layer adds the part that is app knowledge:+ * only a key listed in `LOCAL_STORAGE_KEYS` can be read or written, so a typo, or a key+ * invented in one feature and never written down, does not compile.+ *+ * Failure handling is inherited unchanged: neither function throws, a read of an+ * unavailable store is indistinguishable from an unset key (`null`), and a write reports+ * whether it landed.+ */+export function getAppStorageItem(key: LocalStorageKey): string | null {+ return safeLocalStorageGetItem(key);+}++interface SetAppStorageItemOptions {+ /** The key to write to. Must be one of the app's declared keys. */+ key: LocalStorageKey;+ /** The value to persist. Serialize non-strings before calling. */+ value: string;+}++/**+ * @returns `true` when the value was persisted, `false` when storage was unavailable or+ * the write was rejected (private mode, quota exceeded).+ */+export function setAppStorageItem({+ key,+ value,+}: SetAppStorageItemOptions): boolean {+ return safeLocalStorageSetItem({ key, value });+}diff --git a/src/app/(app)/utils/changelog-seen-storage.ts b/src/app/(app)/utils/changelog-seen-storage.tsindex ac0f799..654d29c 100644--- a/src/app/(app)/utils/changelog-seen-storage.ts+++ b/src/app/(app)/utils/changelog-seen-storage.ts@@ -1,31 +1,28 @@"use client";-import { isLocalStorageAvailable } from "@/lib/check-local-storage";--const CHANGELOG_SEEN_STORAGE_KEY = "EASY_INVOICE_LAST_SEEN_CHANGELOG_SLUG";-+import {+ getAppStorageItem,+ setAppStorageItem,+} from "@/app/(app)/utils/app-local-storage";+import { CHANGELOG_SEEN_STORAGE_KEY } from "@/app/schema";++/**+ * Retrieves the last seen changelog slug from localStorage.+ */function getLastSeenChangelogSlug(): string | null {- if (!isLocalStorageAvailable) {- return null;- }-- try {- return localStorage.getItem(CHANGELOG_SEEN_STORAGE_KEY);- } catch {- return null;- }+ return getAppStorageItem(CHANGELOG_SEEN_STORAGE_KEY);}+/**+ * Marks the provided changelog slug as seen by storing it in localStorage.+ */export function markChangelogAsSeen(slug: string): void {- if (!isLocalStorageAvailable) {- return;- }-- try {- localStorage.setItem(CHANGELOG_SEEN_STORAGE_KEY, slug);- } catch {}+ setAppStorageItem({ key: CHANGELOG_SEEN_STORAGE_KEY, value: slug });}+/**+ * Determines whether the changelog popup should be shown based on the latest changelog slug.+ */export function shouldShowChangelogPopup(latestSlug: string): boolean {const lastSeenSlug = getLastSeenChangelogSlug();diff --git a/src/app/(app)/utils/format-currency.tsx b/src/app/(app)/utils/format-currency.tsxindex 7e080c0..c91dc5d 100644--- a/src/app/(app)/utils/format-currency.tsx+++ b/src/app/(app)/utils/format-currency.tsx@@ -1,6 +1,7 @@-import type { SupportedCurrencies, SupportedLanguages } from "@/app/schema";import * as Sentry from "@sentry/nextjs";+import type { SupportedCurrencies, SupportedLanguages } from "@/app/schema";+export function formatCurrency({amount,currency,diff --git a/src/app/(app)/utils/format-date-with-locale.ts b/src/app/(app)/utils/format-date-with-locale.tsnew file mode 100644index 0000000..baa04cc--- /dev/null+++ b/src/app/(app)/utils/format-date-with-locale.ts@@ -0,0 +1,58 @@+import dayjs from "dayjs";++import type { SupportedLanguages } from "@/app/schema";++// dayjs ships every locale as a side-effect module that registers itself on the+// dayjs singleton. `.locale("fr")` on an unregistered locale is a silent no-op+// (the date keeps the previous locale), so every language we support has to be+// imported here. This is the single place that does it for the invoice form.+import "dayjs/locale/de";+import "dayjs/locale/en";+import "dayjs/locale/es";+import "dayjs/locale/fr";+import "dayjs/locale/it";+import "dayjs/locale/nl";+import "dayjs/locale/pl";+import "dayjs/locale/pt";+import "dayjs/locale/ru";+import "dayjs/locale/uk";++interface FormatDateWithLocaleArgs {+ /** Any dayjs-parsable date (ISO string, Date, Dayjs, ...). */+ date: dayjs.ConfigType;+ /** A dayjs format token string, i.e. the invoice's `dateFormat`. */+ selectedDateFormat: string;+ /** The invoice PDF language the date should be rendered in. */+ language: SupportedLanguages;+}++/**+ * Format a date in the invoice PDF's language.+ *+ * Form helper texts must read the same way as the generated PDF, so they have to+ * use the invoice's `language` and not the ambient dayjs locale. The locale is+ * applied per instance (`dayjs().locale(...)`) rather than globally+ * (`dayjs.locale(...)`), so formatting one date never changes how the rest of the+ * app formats its own.+ *+ * @returns The formatted date string.+ */+export function formatDateWithLocale({+ date,+ selectedDateFormat,+ language,+}: FormatDateWithLocaleArgs): string {+ return dayjs(date).locale(language).format(selectedDateFormat);+}++/**+ * Format today's date in the invoice PDF's language.+ *+ * @returns Today, formatted.+ */+export function formatTodayWithLocale({+ selectedDateFormat,+ language,+}: Omit<FormatDateWithLocaleArgs, "date">): string {+ return formatDateWithLocale({ date: dayjs(), selectedDateFormat, language });+}diff --git a/src/app/(app)/utils/format-service-period.ts b/src/app/(app)/utils/format-service-period.tsindex f552250..6521a78 100644--- a/src/app/(app)/utils/format-service-period.ts+++ b/src/app/(app)/utils/format-service-period.ts@@ -1,6 +1,7 @@-import type { InvoiceData } from "@/app/schema";import dayjs from "dayjs";+import type { InvoiceData } from "@/app/schema";+interface ServicePeriod {start: dayjs.Dayjs;end: dayjs.Dayjs;@@ -69,3 +70,13 @@ export function formatServicePeriodRange(return `${start.format(invoiceData.dateFormat)} – ${end.format(invoiceData.dateFormat)}`;}++/**+ * Current month and year in the `MM-YYYY` shape invoice numbers use (e.g. `04-2025`).+ * Computed on call rather than at module load, so a long-lived tab (and a test with+ * mocked timers) sees the month it is actually in.+ * @returns The current month and year, `MM-YYYY`.+ */+export function getCurrentMonthAndYear(): string {+ return dayjs().format("MM-YYYY");+}diff --git a/src/app/(app)/utils/get-app-metadata.tsx b/src/app/(app)/utils/get-app-metadata.tsxindex 3c57023..d0dfb34 100644--- a/src/app/(app)/utils/get-app-metadata.tsx+++ b/src/app/(app)/utils/get-app-metadata.tsx@@ -1,5 +1,12 @@"use client";+import * as Sentry from "@sentry/nextjs";+import dayjs from "dayjs";++import {+ getAppStorageItem,+ setAppStorageItem,+} from "@/app/(app)/utils/app-local-storage";import {METADATA_LOCAL_STORAGE_KEY,metadataSchema,@@ -8,8 +15,6 @@ import {type Metadata,DEFAULT_MOBILE_TAB,} from "@/app/schema";-import * as Sentry from "@sentry/nextjs";-import dayjs from "dayjs";export const DEFAULT_METADATA = {appVersion: APP_VERSION,@@ -37,7 +42,7 @@ export const DEFAULT_METADATA = {*/export function getAppMetadata() {try {- const metadata = localStorage.getItem(METADATA_LOCAL_STORAGE_KEY);+ const metadata = getAppStorageItem(METADATA_LOCAL_STORAGE_KEY);if (!metadata) return null;@@ -102,10 +107,10 @@ export function updateAppMetadata(updater: (current: Metadata) => Metadata) {console.error("[updateAppMetadata] Validation error:", parsed.error);// reset the metadata to default if validation fails, we want to fail silently and not block the app- localStorage.setItem(- METADATA_LOCAL_STORAGE_KEY,- JSON.stringify(DEFAULT_METADATA),- );+ setAppStorageItem({+ key: METADATA_LOCAL_STORAGE_KEY,+ value: JSON.stringify(DEFAULT_METADATA),+ });Sentry.captureException(parsed.error);@@ -113,10 +118,10 @@ export function updateAppMetadata(updater: (current: Metadata) => Metadata) {}// save the updated metadata to local storage- localStorage.setItem(- METADATA_LOCAL_STORAGE_KEY,- JSON.stringify(parsed.data),- );+ setAppStorageItem({+ key: METADATA_LOCAL_STORAGE_KEY,+ value: JSON.stringify(parsed.data),+ });} catch (error) {console.error("[updateAppMetadata] Failed to save metadata:", error);Sentry.captureException(error);diff --git a/src/app/(app)/utils/invoice-number-breaking-change.ts b/src/app/(app)/utils/invoice-number-breaking-change.tsindex 5e797d4..7c58496 100644--- a/src/app/(app)/utils/invoice-number-breaking-change.ts+++ b/src/app/(app)/utils/invoice-number-breaking-change.ts@@ -1,8 +1,8 @@-import { SUPPORTED_LANGUAGES } from "@/app/schema";-import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import { z } from "zod";+import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import { SUPPORTED_LANGUAGES } from "@/app/schema";import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";-import { z } from "zod";/*** This function handles the breaking change of the invoice number field.diff --git a/src/app/(app)/utils/select-invoice-template.ts b/src/app/(app)/utils/select-invoice-template.tsindex 43e2f62..81f7ac9 100644--- a/src/app/(app)/utils/select-invoice-template.ts+++ b/src/app/(app)/utils/select-invoice-template.ts@@ -22,9 +22,12 @@ export function selectInvoiceTemplate(// to ignore this field. Treat either template's translated value as a default// so those drafts receive the correct heading without changing custom text.const hasKnownDefaultInvoiceNumberLabel = SUPPORTED_TEMPLATES.some(- (supportedTemplate) =>- invoiceNumberObject?.label ===- getDefaultInvoiceNumberLabel(invoiceData.language, supportedTemplate),+ (supportedTemplate) => {+ return (+ invoiceNumberObject?.label ===+ getDefaultInvoiceNumberLabel(invoiceData.language, supportedTemplate)+ );+ },);if (!invoiceNumberObject || !hasKnownDefaultInvoiceNumberLabel) {diff --git a/src/app/(app)/utils/welcome-popup-seen-storage.ts b/src/app/(app)/utils/welcome-popup-seen-storage.tsindex 981fe8d..bf919ad 100644--- a/src/app/(app)/utils/welcome-popup-seen-storage.ts+++ b/src/app/(app)/utils/welcome-popup-seen-storage.ts@@ -1,35 +1,23 @@"use client";-import { isLocalStorageAvailable } from "@/lib/check-local-storage";--const WELCOME_POPUP_SEEN_STORAGE_KEY = "EASY_INVOICE_WELCOME_POPUP_SEEN";+import {+ getAppStorageItem,+ setAppStorageItem,+} from "@/app/(app)/utils/app-local-storage";+import { WELCOME_POPUP_SEEN_STORAGE_KEY } from "@/app/schema";const WELCOME_POPUP_SEEN_VALUE = "v1";export function hasSeenWelcomePopup() {- if (!isLocalStorageAvailable) {- return false;- }-- try {- return (- localStorage.getItem(WELCOME_POPUP_SEEN_STORAGE_KEY) ===- WELCOME_POPUP_SEEN_VALUE- );- } catch {- return false;- }+ return (+ getAppStorageItem(WELCOME_POPUP_SEEN_STORAGE_KEY) ===+ WELCOME_POPUP_SEEN_VALUE+ );}export function markWelcomePopupSeen() {- if (!isLocalStorageAvailable) {- return;- }-- try {- localStorage.setItem(- WELCOME_POPUP_SEEN_STORAGE_KEY,- WELCOME_POPUP_SEEN_VALUE,- );- } catch {}+ setAppStorageItem({+ key: WELCOME_POPUP_SEEN_STORAGE_KEY,+ value: WELCOME_POPUP_SEEN_VALUE,+ });}diff --git a/src/app/(components)/footer-launch-badges.tsx b/src/app/(components)/footer-launch-badges.tsxindex 01ff8fc..485f243 100644--- a/src/app/(components)/footer-launch-badges.tsx+++ b/src/app/(components)/footer-launch-badges.tsx@@ -14,13 +14,13 @@ import {* Renders launch/featured badges in footer: Startup Fame, LaunchPanda, Tiny Startups, etc.*/export function FooterLaunchBadges() {- const [autoScrollPlugin] = useState(() =>- AutoScroll({+ const [autoScrollPlugin] = useState(() => {+ return AutoScroll({playOnInit: true,speed: 0.35,stopOnInteraction: false,- }),- );+ });+ });return (<Carousel@@ -145,6 +145,7 @@ export function FooterLaunchBadges() {<ahref="https://buildhop.io/discover/easyinvoicepdf-54735f67-1b04-4e01-a1ca-6ec6e716de5f"target="_blank"+ aria-label="Trending on BuildHop: EasyInvoicePDF"rel="noopener noreferrer"title="Trending on BuildHop: EasyInvoicePDF">@@ -253,6 +254,7 @@ export function FooterLaunchBadges() {<ahref="https://www.tinystartups.com/startup/easyinvoicepdf"target="_blank"+ aria-label="Launched on Tiny Startups: EasyInvoicePDF"rel="noopener"style={{display: "inline-flex",diff --git a/src/app/(components)/footer.tsx b/src/app/(components)/footer.tsxindex 45ea354..3207ca8 100644--- a/src/app/(components)/footer.tsx+++ b/src/app/(components)/footer.tsx@@ -1,3 +1,5 @@+import Link from "next/link";+/* eslint-disable @next/next/no-html-link-for-pages */import { FooterLaunchBadges } from "@/app/(components)/footer-launch-badges";import { SEO_FOOTER_SOLUTION_LINKS } from "@/app/(seo-landings)/seo-landing-footer-links";@@ -10,7 +12,6 @@ import {REDDIT_COMMUNITY_URL,TWITTER_URL,} from "@/config";-import Link from "next/link";interface FooterProps {links?: React.ReactNode;@@ -105,16 +106,18 @@ export function Footer({ links, translations }: FooterProps) {{aboutHeading}</h3><ul className="grid grid-cols-2 gap-x-6 gap-y-2">- {SUPPORTED_LANGUAGES.map((lang) => (- <li key={lang}>- <Link- href={`/${lang}/about`}- className="text-sm text-slate-500 hover:text-slate-900"- >- {LANGUAGE_TO_NATIVE_LABEL[lang]}- </Link>- </li>- ))}+ {SUPPORTED_LANGUAGES.map((lang) => {+ return (+ <li key={lang}>+ <Link+ href={`/${lang}/about`}+ className="text-sm text-slate-500 hover:text-slate-900"+ >+ {LANGUAGE_TO_NATIVE_LABEL[lang]}+ </Link>+ </li>+ );+ })}</ul></div><div className="space-y-5" data-testid="footer-solutions-links">@@ -122,16 +125,18 @@ export function Footer({ links, translations }: FooterProps) {{solutionsHeading}</h3><ul className="space-y-2">- {SEO_FOOTER_SOLUTION_LINKS.map(({ slug, label }) => (- <li key={slug}>- <Link- href={`/${slug}`}- className="text-sm text-slate-500 hover:text-slate-900"- >- {label}- </Link>- </li>- ))}+ {SEO_FOOTER_SOLUTION_LINKS.map(({ slug, label }) => {+ return (+ <li key={slug}>+ <Link+ href={`/${slug}`}+ className="text-sm text-slate-500 hover:text-slate-900"+ >+ {label}+ </Link>+ </li>+ );+ })}</ul></div></div>@@ -217,19 +222,21 @@ export function FooterLinkGroup({{heading}</p><ul className="space-y-2">- {links.map((link) => (- <li key={`${heading}-${link.label}`}>- <Link- href={link.href}- className={FOOTER_LINK_CLASSNAME}- {...(link.external- ? { target: "_blank", rel: "noopener noreferrer" }- : {})}- >- {link.label}- </Link>- </li>- ))}+ {links.map((link) => {+ return (+ <li key={`${heading}-${link.label}`}>+ <Link+ href={link.href}+ className={FOOTER_LINK_CLASSNAME}+ {...(link.external+ ? { target: "_blank", rel: "noopener noreferrer" }+ : {})}+ >+ {link.label}+ </Link>+ </li>+ );+ })}</ul></div>);diff --git a/src/app/(components)/header/animated-go-to-app-btn.tsx b/src/app/(components)/header/animated-go-to-app-btn.tsxindex ffdcb38..25729e0 100644--- a/src/app/(components)/header/animated-go-to-app-btn.tsx+++ b/src/app/(components)/header/animated-go-to-app-btn.tsx@@ -1,9 +1,10 @@"use client";-import { Button } from "@/components/ui/button";import { ArrowRightIcon } from "lucide-react";import Link from "next/link";+import { Button } from "@/components/ui/button";+export function BlackAnimatedGoToAppBtn({children,}: {diff --git a/src/app/(components)/header/go-to-app-button-cta.tsx b/src/app/(components)/header/go-to-app-button-cta.tsxindex 43d180f..08b76eb 100644--- a/src/app/(components)/header/go-to-app-button-cta.tsx+++ b/src/app/(components)/header/go-to-app-button-cta.tsx@@ -1,8 +1,9 @@-import { Button } from "@/components/ui/button";-import { cn } from "@/lib/utils";import { ArrowRight } from "lucide-react";import Link from "next/link";+import { Button } from "@/components/ui/button";+import { cn } from "@/lib/utils";+export function GoToAppButton({className,children,diff --git a/src/app/(components)/header/header.client.tsx b/src/app/(components)/header/header.client.tsxindex 4f4d7c8..9a66dbe 100644--- a/src/app/(components)/header/header.client.tsx+++ b/src/app/(components)/header/header.client.tsx@@ -1,19 +1,21 @@"use client";+import { StarIcon } from "lucide-react";+import Link from "next/link";+import { useState } from "react";++import type { HeaderProps } from "@/app/(components)/header";import { BlackAnimatedGoToAppBtn } from "@/app/(components)/header/animated-go-to-app-btn";import { GithubIcon } from "@/components/etc/github-logo";import { Button } from "@/components/ui/button";import { GITHUB_URL } from "@/config";import { cn } from "@/lib/utils";-import Link from "next/link";-import { useState } from "react";+import { githubStarCountFormatter } from "@/utils/number-formatter";+import { LanguageSwitcher } from "./language-switcher";import { Logo } from "./logo";import { MobileMenuPanel } from "./mobile-menu";import { MorphingMenuIcon } from "./morphing-menu-icon";-import { StarIcon } from "lucide-react";-import type { HeaderProps } from "@/app/(components)/header";-import { githubStarCountFormatter } from "@/utils/number-formatter";const desktopNavLinkClass ="rounded-md text-slate-800 px-3 py-1.5 text-sm font-medium hover:bg-slate-100 hover:text-black active:scale-[0.97] transition-all duration-300";@@ -107,12 +109,12 @@ export function HeaderClient({{/* Language switcher -- desktop only */}<div className="hidden min-w-[36px] lg:block">- {!hideLanguageSwitcher && (+ {!hideLanguageSwitcher ? (<LanguageSwitcherlocale={locale}buttonText={translations.switchLanguageText}/>- )}+ ) : null}</div>{/* CTA button */}@@ -132,7 +134,9 @@ export function HeaderClient({{...(!isMobileMenuOpen? { "aria-haspopup": "dialog" as const }: {})}- onClick={() => setIsMobileMenuOpen(!isMobileMenuOpen)}+ onClick={() => {+ return setIsMobileMenuOpen(!isMobileMenuOpen);+ }}><MorphingMenuIconisOpen={isMobileMenuOpen}diff --git a/src/app/(components)/header/index.tsx b/src/app/(components)/header/index.tsxindex 04187ef..c893d42 100644--- a/src/app/(components)/header/index.tsx+++ b/src/app/(components)/header/index.tsx@@ -1,6 +1,7 @@+import type { Locale } from "next-intl";+import { fetchGithubStars } from "@/actions/fetch-github-stars";import { HeaderClient } from "@/app/(components)/header/header.client";-import type { Locale } from "next-intl";export interface HeaderProps {locale: Locale;diff --git a/src/app/(components)/header/language-switcher.tsx b/src/app/(components)/header/language-switcher.tsxindex 8e790dc..5ea1bd3 100644--- a/src/app/(components)/header/language-switcher.tsx+++ b/src/app/(components)/header/language-switcher.tsx@@ -1,10 +1,10 @@"use client";-import { LANGUAGE_TO_NATIVE_LABEL } from "@/app/schema";-import { usePathname, useRouter } from "@/i18n/navigation";import { GlobeIcon } from "lucide-react";import type { Locale } from "next-intl";import { useTransition } from "react";++import { LANGUAGE_TO_NATIVE_LABEL } from "@/app/schema";import { Button } from "@/components/ui/button";import {DropdownMenu,@@ -18,6 +18,7 @@ import {TooltipProvider,TooltipTrigger,} from "@/components/ui/tooltip";+import { usePathname, useRouter } from "@/i18n/navigation";import { cn } from "@/lib/utils";const MAP_LOCALE_TO_LANGUAGE = LANGUAGE_TO_NATIVE_LABEL satisfies Record<diff --git a/src/app/(components)/header/logo.tsx b/src/app/(components)/header/logo.tsxindex 6b71a00..b45203a 100644--- a/src/app/(components)/header/logo.tsx+++ b/src/app/(components)/header/logo.tsx@@ -1,5 +1,5 @@-import { FinalProjectLogo } from "@/components/etc/final-project-logo";import { ProjectLogoDescription } from "@/app/(components)/project-logo-description";+import { FinalProjectLogo } from "@/components/etc/final-project-logo";import { cn } from "@/lib/utils";export function Logo({diff --git a/src/app/(components)/header/mobile-menu.tsx b/src/app/(components)/header/mobile-menu.tsxindex 7139ca8..b6f80e1 100644--- a/src/app/(components)/header/mobile-menu.tsx+++ b/src/app/(components)/header/mobile-menu.tsx@@ -1,18 +1,20 @@"use client";-import { GithubIcon } from "@/components/etc/github-logo";-import { Button } from "@/components/ui/button";-import { cn } from "@/lib/utils";import { ArrowRightIcon, StarIcon } from "lucide-react";import type { Locale } from "next-intl";import Link from "next/link";import { usePathname } from "next/navigation";-import { useEffect, useId, useRef } from "react";-import { LanguageSwitcher } from "./language-switcher";-import { GITHUB_URL } from "@/config";+import { useEffect, useId } from "react";+import type { HeaderProps } from "@/app/(components)/header";+import { GithubIcon } from "@/components/etc/github-logo";+import { Button } from "@/components/ui/button";+import { GITHUB_URL } from "@/config";+import { cn } from "@/lib/utils";import { githubStarCountFormatter } from "@/utils/number-formatter";+import { LanguageSwitcher } from "./language-switcher";+interface MobileMenuSharedProps {locale: Locale;translations: HeaderProps["translations"];@@ -58,19 +60,20 @@ export function MobileMenuPanel({const isTosActive = pathname === "/tos";const isHomeActive = pathname === `/${locale}/about`;- const onOpenChangeRef = useRef(onOpenChange);- onOpenChangeRef.current = onOpenChange;-// close mobile menu when escape key is presseduseEffect(() => {function onKeyDown(e: KeyboardEvent) {- if (e.key === "Escape") onOpenChangeRef.current(false);+ if (e.key === "Escape") onOpenChange(false);}window.addEventListener("keydown", onKeyDown);- return () => window.removeEventListener("keydown", onKeyDown);- }, []);-- const close = () => onOpenChange(false);+ return () => {+ return window.removeEventListener("keydown", onKeyDown);+ };+ }, [onOpenChange]);++ const close = () => {+ return onOpenChange(false);+ };return (<divdiff --git a/src/app/(components)/header/morphing-menu-icon.tsx b/src/app/(components)/header/morphing-menu-icon.tsxindex de84737..66295f0 100644--- a/src/app/(components)/header/morphing-menu-icon.tsx+++ b/src/app/(components)/header/morphing-menu-icon.tsx@@ -1,8 +1,9 @@"use client";-import { cn } from "@/lib/utils";import { motion, useReducedMotion, type Transition } from "motion/react";+import { cn } from "@/lib/utils";+const lineTransition = {type: "tween",duration: 0.2,diff --git a/src/app/(seo-landings)/__tests__/build-seo-landing-json-ld.test.ts b/src/app/(seo-landings)/__tests__/build-seo-landing-json-ld.test.tsindex 5eb614b..5ae43dc 100644--- a/src/app/(seo-landings)/__tests__/build-seo-landing-json-ld.test.ts+++ b/src/app/(seo-landings)/__tests__/build-seo-landing-json-ld.test.ts@@ -1,14 +1,16 @@import { describe, expect, it } from "vitest";+import { JSON_LD_IDS } from "@/lib/seo/json-ld-ids";+import { buildSeoLandingJsonLd } from "../build-seo-landing-json-ld";import { SEO_LANDING_DEFINITIONS } from "../seo-landing-definitions";-import { JSON_LD_IDS } from "@/lib/seo/json-ld-ids";describe("buildSeoLandingJsonLd", () => {it("links no-login page mainEntity to FAQPage with account and pricing questions first", () => {const definition = SEO_LANDING_DEFINITIONS["invoice-generator-no-login"];const graph = buildSeoLandingJsonLd(definition);- const parsed = JSON.parse(JSON.stringify(graph)) as {+ const serializedGraph = JSON.stringify(graph);+ const parsed = JSON.parse(serializedGraph) as {"@graph": Array<Record<string, unknown>>;};const webPage = parsed["@graph"][0];@@ -36,7 +38,8 @@ describe("buildSeoLandingJsonLd", () => {it("adds SoftwareApplication mainEntity for open-source landing", () => {const definition = SEO_LANDING_DEFINITIONS["open-source-invoice-generator"];const graph = buildSeoLandingJsonLd(definition);- const parsed = JSON.parse(JSON.stringify(graph)) as {+ const serializedGraph = JSON.stringify(graph);+ const parsed = JSON.parse(serializedGraph) as {"@graph": Array<Record<string, unknown>>;};const webPage = parsed["@graph"][0];diff --git a/src/app/(seo-landings)/build-seo-landing-json-ld.ts b/src/app/(seo-landings)/build-seo-landing-json-ld.tsindex ea6baca..409b393 100644--- a/src/app/(seo-landings)/build-seo-landing-json-ld.ts+++ b/src/app/(seo-landings)/build-seo-landing-json-ld.ts@@ -1,6 +1,6 @@-import { GITHUB_URL, PROD_WEBSITE_URL } from "@/config";import type { Graph } from "schema-dts";+import { GITHUB_URL, PROD_WEBSITE_URL } from "@/config";import { buildBreadcrumbList } from "@/lib/seo/breadcrumb";import {JSON_LD_IDS,@@ -45,14 +45,16 @@ export function buildSeoLandingJsonLd(const isOpenSourceLanding =definition.slug === "open-source-invoice-generator";- const faqEntities = definition.faq.map((item) => ({- "@type": "Question" as const,- name: item.question,- acceptedAnswer: {- "@type": "Answer" as const,- text: item.answer,- },- }));+ const faqEntities = definition.faq.map((item) => {+ return {+ "@type": "Question" as const,+ name: item.question,+ acceptedAnswer: {+ "@type": "Answer" as const,+ text: item.answer,+ },+ };+ });const webPage = {"@type": "WebPage" as const,diff --git a/src/app/(seo-landings)/components/seo-landing-shell.tsx b/src/app/(seo-landings)/components/seo-landing-shell.tsxindex fad131f..e3348f3 100644--- a/src/app/(seo-landings)/components/seo-landing-shell.tsx+++ b/src/app/(seo-landings)/components/seo-landing-shell.tsx@@ -1,7 +1,13 @@+import Link from "next/link";+import { Footer } from "@/app/(components)/footer";+import { Header } from "@/app/(components)/header";import { BlackGoToAppButton } from "@/app/(components)/header/go-to-app-button-cta";+import { StickySeoCta } from "@/app/(seo-landings)/components/sticky-seo-cta";+import { GithubIcon } from "@/components/etc/github-logo";+import { Button } from "@/components/ui/button";+import { FaqAccordion, FaqAccordionItem } from "@/components/ui/faq-accordion";import { GITHUB_URL } from "@/config";-import Link from "next/link";import {type ComparisonTable,@@ -9,11 +15,6 @@ import {type SeoSection,} from "../seo-landing-definitions";import { SeoLandingJsonLd } from "./seo-landing-json-ld";-import { StickySeoCta } from "@/app/(seo-landings)/components/sticky-seo-cta";-import { Button } from "@/components/ui/button";-import { FaqAccordion, FaqAccordionItem } from "@/components/ui/faq-accordion";-import { GithubIcon } from "@/components/etc/github-logo";-import { Header } from "@/app/(components)/header";interface SeoLandingShellProps {definition: SeoLandingDefinition;@@ -81,7 +82,7 @@ export function SeoLandingShell({ definition }: SeoLandingShellProps) {</a></div>) : null}- {definition.hero.bullets.length ? (+ {definition.hero.bullets.length > 0 ? (<div className="mt-3 text-pretty"><p className="text-sm text-stone-900">{definition.hero.bullets.join(", ")}@@ -133,14 +134,16 @@ export function SeoLandingShell({ definition }: SeoLandingShellProps) {FAQ</h2><FaqAccordion>- {definition.faq.map((item) => (- <FaqAccordionItem- key={item.question}- question={item.question}- >- {item.answer}- </FaqAccordionItem>- ))}+ {definition.faq.map((item) => {+ return (+ <FaqAccordionItem+ key={item.question}+ question={item.question}+ >+ {item.answer}+ </FaqAccordionItem>+ );+ })}</FaqAccordion></section>@@ -189,21 +192,25 @@ function SeoSectionBlock({ section, id }: { section: SeoSection; id: number }) {{section.lead}</p>) : null}- {section.paragraphs?.map((paragraph, index) => (- <p- key={`${section.title}-p-${index}`}- className="mt-4 max-w-3xl text-pretty text-lg leading-relaxed text-slate-800"- >- {paragraph}- </p>- ))}+ {section.paragraphs?.map((paragraph, index) => {+ return (+ <p+ key={`${section.title}-p-${index}`}+ className="mt-4 max-w-3xl text-pretty text-lg leading-relaxed text-slate-800"+ >+ {paragraph}+ </p>+ );+ })}{section.bullets?.length ? (<ul className="mt-4 max-w-3xl list-disc space-y-2 pl-6 text-base text-slate-800">- {section.bullets.map((item) => (- <li key={item} className="text-pretty">- {item}- </li>- ))}+ {section.bullets.map((item) => {+ return (+ <li key={item} className="text-pretty">+ {item}+ </li>+ );+ })}</ul>) : null}</section>@@ -234,25 +241,27 @@ function SeoComparisonTable({ table }: { table: ComparisonTable }) {</tr></thead><tbody>- {table.rows.map((row) => (- <tr- key={row.feature}- className="border-b border-slate-100 last:border-0"- >- <th- scope="row"- className="px-3 py-2 font-medium text-slate-900 md:px-4 md:py-3"+ {table.rows.map((row) => {+ return (+ <tr+ key={row.feature}+ className="border-b border-slate-100 last:border-0">- {row.feature}- </th>- <td className="px-3 py-2 text-slate-700 md:px-4 md:py-3">- {row.thisTool}- </td>- <td className="px-3 py-2 text-slate-700 md:px-4 md:py-3">- {row.other}- </td>- </tr>- ))}+ <th+ scope="row"+ className="px-3 py-2 font-medium text-slate-900 md:px-4 md:py-3"+ >+ {row.feature}+ </th>+ <td className="px-3 py-2 text-slate-700 md:px-4 md:py-3">+ {row.thisTool}+ </td>+ <td className="px-3 py-2 text-slate-700 md:px-4 md:py-3">+ {row.other}+ </td>+ </tr>+ );+ })}</tbody></table></div>diff --git a/src/app/(seo-landings)/components/sticky-seo-cta.tsx b/src/app/(seo-landings)/components/sticky-seo-cta.tsxindex d0af637..81d7e3d 100644--- a/src/app/(seo-landings)/components/sticky-seo-cta.tsx+++ b/src/app/(seo-landings)/components/sticky-seo-cta.tsx@@ -1,9 +1,10 @@"use client";+import Link from "next/link";+import { Button } from "@/components/ui/button";import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";import { cn } from "@/lib/utils";-import Link from "next/link";/*** Sticky CTA component displayed at bottom of SEO landing pages.diff --git a/src/app/(seo-landings)/invoice-generator-no-login/page.tsx b/src/app/(seo-landings)/invoice-generator-no-login/page.tsxindex 6b97282..2a098c8 100644--- a/src/app/(seo-landings)/invoice-generator-no-login/page.tsx+++ b/src/app/(seo-landings)/invoice-generator-no-login/page.tsx@@ -5,8 +5,9 @@ import {export const dynamic = "force-static";-export const generateMetadata = () =>- buildSeoLandingMetadata("invoice-generator-no-login");+export const generateMetadata = () => {+ return buildSeoLandingMetadata("invoice-generator-no-login");+};export default function InvoiceGeneratorNoLoginPage() {return <SeoLandingRoutePage slug="invoice-generator-no-login" />;diff --git a/src/app/(seo-landings)/invoice-template-pdf/page.tsx b/src/app/(seo-landings)/invoice-template-pdf/page.tsxindex a7f3e83..e71860f 100644--- a/src/app/(seo-landings)/invoice-template-pdf/page.tsx+++ b/src/app/(seo-landings)/invoice-template-pdf/page.tsx@@ -5,8 +5,9 @@ import {export const dynamic = "force-static";-export const generateMetadata = () =>- buildSeoLandingMetadata("invoice-template-pdf");+export const generateMetadata = () => {+ return buildSeoLandingMetadata("invoice-template-pdf");+};export default function InvoiceTemplatePdfPage() {return <SeoLandingRoutePage slug="invoice-template-pdf" />;diff --git a/src/app/(seo-landings)/open-source-invoice-generator/page.tsx b/src/app/(seo-landings)/open-source-invoice-generator/page.tsxindex 77643eb..2a199ef 100644--- a/src/app/(seo-landings)/open-source-invoice-generator/page.tsx+++ b/src/app/(seo-landings)/open-source-invoice-generator/page.tsx@@ -5,8 +5,9 @@ import {export const dynamic = "force-static";-export const generateMetadata = () =>- buildSeoLandingMetadata("open-source-invoice-generator");+export const generateMetadata = () => {+ return buildSeoLandingMetadata("open-source-invoice-generator");+};export default function OpenSourceInvoiceGeneratorPage() {return <SeoLandingRoutePage slug="open-source-invoice-generator" />;diff --git a/src/app/(seo-landings)/seo-landing-route.tsx b/src/app/(seo-landings)/seo-landing-route.tsxindex 5bfa7b1..0b87e95 100644--- a/src/app/(seo-landings)/seo-landing-route.tsx+++ b/src/app/(seo-landings)/seo-landing-route.tsx@@ -1,10 +1,11 @@+import type { Metadata } from "next";+import { SeoLandingShell } from "@/app/(seo-landings)/components/seo-landing-shell";import {SEO_LANDING_DEFINITIONS,type SeoLandingSlug,} from "@/app/(seo-landings)/seo-landing-definitions";import { APP_URL, STATIC_ASSETS_URL, TWITTER_CREATOR } from "@/config";-import type { Metadata } from "next";export function buildSeoLandingMetadata(slug: SeoLandingSlug): Metadata {const definition = SEO_LANDING_DEFINITIONS[slug];diff --git a/src/app/(seo-landings)/stripe-invoice-alternative/page.tsx b/src/app/(seo-landings)/stripe-invoice-alternative/page.tsxindex 16b758e..ddd62d0 100644--- a/src/app/(seo-landings)/stripe-invoice-alternative/page.tsx+++ b/src/app/(seo-landings)/stripe-invoice-alternative/page.tsx@@ -5,8 +5,9 @@ import {export const dynamic = "force-static";-export const generateMetadata = () =>- buildSeoLandingMetadata("stripe-invoice-alternative");+export const generateMetadata = () => {+ return buildSeoLandingMetadata("stripe-invoice-alternative");+};export default function StripeInvoiceAlternativePage() {return <SeoLandingRoutePage slug="stripe-invoice-alternative" />;diff --git a/src/app/[locale]/about/__tests__/about-json-ld-graph.test.ts b/src/app/[locale]/about/__tests__/about-json-ld-graph.test.tsindex 0464705..6d0880e 100644--- a/src/app/[locale]/about/__tests__/about-json-ld-graph.test.ts+++ b/src/app/[locale]/about/__tests__/about-json-ld-graph.test.ts@@ -1,6 +1,7 @@+import { describe, expect, it } from "vitest";+import enMessages from "../../../../../messages/en.json";import plMessages from "../../../../../messages/pl.json";-import { describe, expect, it } from "vitest";import { buildAboutJsonLdGraph } from "../about-json-ld-graph";describe("buildAboutJsonLdGraph", () => {@@ -10,7 +11,8 @@ describe("buildAboutJsonLdGraph", () => {"pl","https://easyinvoicepdf.com",);- const parsed = JSON.parse(JSON.stringify(graph)) as {+ const serializedGraph = JSON.stringify(graph);+ const parsed = JSON.parse(serializedGraph) as {"@graph": Array<Record<string, unknown>>;};@@ -55,7 +57,7 @@ describe("buildAboutJsonLdGraph", () => {const mainEntity = faqPage.mainEntity as { name: string }[];expect(Array.isArray(mainEntity)).toBe(true);- expect(mainEntity.length).toBe(9);+ expect(mainEntity).toHaveLength(9);expect(mainEntity[0].name).toBe(plMessages.FAQ.items.whatIs.question);});@@ -65,7 +67,8 @@ describe("buildAboutJsonLdGraph", () => {"en","https://easyinvoicepdf.com",);- const parsed = JSON.parse(JSON.stringify(graph)) as {+ const serializedGraph = JSON.stringify(graph);+ const parsed = JSON.parse(serializedGraph) as {"@graph": Array<Record<string, unknown>>;};@@ -89,6 +92,6 @@ describe("buildAboutJsonLdGraph", () => {const mainEntity = faqPage.mainEntity as { name: string }[];expect(Array.isArray(mainEntity)).toBe(true);- expect(mainEntity.length).toBe(9);+ expect(mainEntity).toHaveLength(9);});});diff --git a/src/app/[locale]/about/about-json-ld-graph.ts b/src/app/[locale]/about/about-json-ld-graph.tsindex 4eb5b20..c241a15 100644--- a/src/app/[locale]/about/about-json-ld-graph.ts+++ b/src/app/[locale]/about/about-json-ld-graph.ts@@ -1,8 +1,7 @@-import { PROD_WEBSITE_URL } from "@/config";import type { Locale } from "next-intl";-import type Messages from "../../../../messages/en.json";import type { Graph } from "schema-dts";+import { PROD_WEBSITE_URL } from "@/config";import { buildBreadcrumbList } from "@/lib/seo/breadcrumb";import {JSON_LD_IDS,@@ -10,11 +9,11 @@ import {pageFaqId,pageWebPageId,} from "@/lib/seo/json-ld-ids";+import { toSchemaLanguage } from "@/lib/seo/locale-utils";+import type Messages from "../../../../messages/en.json";import { ABOUT_FAQ_ITEM_KEYS } from "./about-faq-item-keys";-import { toSchemaLanguage } from "@/lib/seo/locale-utils";-/*** Builds a JSON-LD graph for the about page with schema.org structured data.* Includes WebPage, FAQPage, and BreadcrumbList schemas.diff --git a/src/app/[locale]/about/about-json-ld.tsx b/src/app/[locale]/about/about-json-ld.tsxindex 48dedd7..2621f84 100644--- a/src/app/[locale]/about/about-json-ld.tsx+++ b/src/app/[locale]/about/about-json-ld.tsx@@ -1,8 +1,10 @@-import type Messages from "../../../../messages/en.json";import type { Locale } from "next-intl";-import { buildAboutJsonLdGraph } from "./about-json-ld-graph";+import { JsonLdScript } from "@/lib/seo/render-json-ld";+import type Messages from "../../../../messages/en.json";+import { buildAboutJsonLdGraph } from "./about-json-ld-graph";+/*** Renders a JSON-LD script tag for the about page with structured schema.org data.* Loads locale-specific messages and builds a graph containing WebPage and FAQPage schemas.@@ -12,7 +14,9 @@ import { JsonLdScript } from "@/lib/seo/render-json-ld";*/export async function AboutJsonLd({ locale }: { locale: Locale }) {const messages = await import(`../../../../messages/${locale}.json`).then(- (module: { default: typeof Messages }) => module.default,+ (module: { default: typeof Messages }) => {+ return module.default;+ },);const graph = buildAboutJsonLdGraph(messages, locale);diff --git a/src/app/[locale]/about/components/about-footer.tsx b/src/app/[locale]/about/components/about-footer.tsxindex 0ba7319..d1043f5 100644--- a/src/app/[locale]/about/components/about-footer.tsx+++ b/src/app/[locale]/about/components/about-footer.tsx@@ -1,3 +1,6 @@+import { useLocale, useTranslations } from "next-intl";+import Link from "next/link";+import { Footer, FooterLinkGroup } from "@/app/(components)/footer";import {DISCORD_COMMUNITY_URL,@@ -5,8 +8,6 @@ import {PRODUCT_TWITTER_URL,REDDIT_COMMUNITY_URL,} from "@/config";-import { useLocale, useTranslations } from "next-intl";-import Link from "next/link";/*** Footer of the about page.@@ -26,15 +27,19 @@ export function AboutFooter() {aboutHeading: t("footer.headings.about"),solutionsHeading: t("footer.headings.solutions"),footerDescription: t.rich("footer.description", {- br: () => <br />,- tosLink: (chunks) => (- <Link- href="/tos"- className="text-slate-700 underline hover:text-slate-900"- >- {chunks}- </Link>- ),+ br: () => {+ return <br />;+ },+ tosLink: (chunks) => {+ return (+ <Link+ href="/tos"+ className="text-slate-700 underline hover:text-slate-900"+ >+ {chunks}+ </Link>+ );+ },}),footerCreatedBy: t("footer.createdBy"),resources: t("footer.links.resources"),diff --git a/src/app/[locale]/about/components/features-carousel.tsx b/src/app/[locale]/about/components/features-carousel.tsxindex 59e2b11..43af3a6 100644--- a/src/app/[locale]/about/components/features-carousel.tsx+++ b/src/app/[locale]/about/components/features-carousel.tsx@@ -1,7 +1,7 @@"use client";import { ChevronLeft, ChevronRight } from "lucide-react";-import { useCallback, useEffect, useState } from "react";+import { useCallback, useState, useSyncExternalStore } from "react";import {Carousel,@@ -10,6 +10,7 @@ import {type CarouselApi,} from "@/components/ui/carousel";import { cn } from "@/lib/utils";+import { FeatureCard, type FeatureCardProps } from "./feature-card";interface FeaturesCarouselProps {@@ -22,6 +23,11 @@ interface FeaturesCarouselProps {};}+/** Used while embla has no api yet: there is nothing to unsubscribe from */+const noop = () => {+ return undefined;+};+/*** Carousel with the marketing feature demos: one card per view on mobile,* two per view from `lg` up (same as the grid it replaced).@@ -33,26 +39,45 @@ export function FeaturesCarousel({translations,}: FeaturesCarouselProps) {const [api, setApi] = useState<CarouselApi>();- const [selectedIndex, setSelectedIndex] = useState(0);- useEffect(() => {- if (!api) return;+ // The embla instance owns the selected slide, so read it straight from the+ // carousel rather than mirroring it into state. `setApi` re-renders once the+ // instance exists, which is when the snapshot below starts returning it.+ const subscribeToSelectedIndex = useCallback(+ (onStoreChange: () => void) => {+ // there is nothing to subscribe to until embla hands over its api+ if (!api) {+ return noop;+ }- function syncSelectedIndex(carouselApi: CarouselApi) {- if (carouselApi) setSelectedIndex(carouselApi.selectedScrollSnap());- }+ api.on("select", onStoreChange);+ api.on("reInit", onStoreChange);- syncSelectedIndex(api);- api.on("select", syncSelectedIndex);- api.on("reInit", syncSelectedIndex);+ return () => {+ api.off("select", onStoreChange);+ api.off("reInit", onStoreChange);+ };+ },+ [api],+ );- return () => {- api.off("select", syncSelectedIndex);- api.off("reInit", syncSelectedIndex);- };- }, [api]);+ const selectedIndex = useSyncExternalStore(+ subscribeToSelectedIndex,+ () => {+ return api?.selectedScrollSnap() ?? 0;+ },+ // the carousel only exists on the client, so the first slide is always selected on the server+ () => {+ return 0;+ },+ );- const scrollTo = useCallback((index: number) => api?.scrollTo(index), [api]);+ const scrollTo = useCallback(+ (index: number) => {+ return api?.scrollTo(index);+ },+ [api],+ );return (<Carousel@@ -70,19 +95,21 @@ export function FeaturesCarousel({Cards stretch to the tallest one at every breakpoint, so swiping never changesthe height of the carousel. */}<CarouselContent className="-ml-6 -mr-2 items-stretch sm:-ml-4 sm:mr-0 lg:-ml-6 xl:-ml-10">- {features.map((feature) => (- <CarouselItem- key={feature.translationKey}- // one card per view on mobile, two from `lg` up. Mobile takes the full- // width so the demo video is as large as it can be; the arrows and dots- // below carry the "there is more" affordance that the peeking card did.- // The `pl-4` that `CarouselItem` hardcodes is the gutter between cards; the- // track's `-ml-6` pulls it off-screen so it only shows while scrolling- className="basis-full sm:basis-[70%] md:basis-[55%] lg:basis-1/2 lg:pl-6 xl:pl-10"- >- <FeatureCard {...feature} />- </CarouselItem>- ))}+ {features.map((feature) => {+ return (+ <CarouselItem+ key={feature.translationKey}+ // one card per view on mobile, two from `lg` up. Mobile takes the full+ // width so the demo video is as large as it can be; the arrows and dots+ // below carry the "there is more" affordance that the peeking card did.+ // The `pl-4` that `CarouselItem` hardcodes is the gutter between cards; the+ // track's `-ml-6` pulls it off-screen so it only shows while scrolling+ className="basis-full sm:basis-[70%] md:basis-[55%] lg:basis-1/2 lg:pl-6 xl:pl-10"+ >+ <FeatureCard {...feature} />+ </CarouselItem>+ );+ })}</CarouselContent>{/* Controls: previous/next arrows and one dot per feature */}@@ -90,38 +117,46 @@ export function FeaturesCarousel({<buttontype="button"aria-label={translations.previousFeature}- onClick={() => api?.scrollPrev()}+ onClick={() => {+ return api?.scrollPrev();+ }}className={arrowButtonClassName}><ChevronLeft className="size-5" aria-hidden="true" /></button><div role="group" className="flex items-center gap-2">- {features.map((feature, index) => (- <button- key={feature.translationKey}- type="button"- // the feature title keeps the label localized, unlike a hardcoded "Go to slide N"- aria-label={feature.title}- aria-current={index === selectedIndex}- onClick={() => scrollTo(index)}- className="rounded-full p-1.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-900 focus-visible:ring-offset-2"- >- <span- aria-hidden="true"- className={cn(- "block size-2 rounded-full bg-slate-300 transition-colors",- index === selectedIndex && "bg-slate-900",- )}- />- </button>- ))}+ {features.map((feature, index) => {+ return (+ <button+ key={feature.translationKey}+ type="button"+ // the feature title keeps the label localized, unlike a hardcoded "Go to slide N"+ aria-label={feature.title}+ aria-current={index === selectedIndex}+ onClick={() => {+ return scrollTo(index);+ }}+ className="rounded-full p-1.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-900 focus-visible:ring-offset-2"+ >+ <span+ aria-hidden="true"+ className={cn(+ "block size-2 rounded-full bg-slate-300 transition-colors",+ index === selectedIndex && "bg-slate-900",+ )}+ />+ </button>+ );+ })}</div><buttontype="button"aria-label={translations.nextFeature}- onClick={() => api?.scrollNext()}+ onClick={() => {+ return api?.scrollNext();+ }}className={arrowButtonClassName}><ChevronRight className="size-5" aria-hidden="true" />diff --git a/src/app/[locale]/about/layout.tsx b/src/app/[locale]/about/layout.tsxindex 5979f8a..d76e041 100644--- a/src/app/[locale]/about/layout.tsx+++ b/src/app/[locale]/about/layout.tsx@@ -1,34 +1,42 @@+import type { Metadata } from "next";import { hasLocale, type Locale } from "next-intl";+import { setRequestLocale } from "next-intl/server";import { notFound } from "next/navigation";++import { APP_URL, STATIC_ASSETS_URL, TWITTER_CREATOR } from "@/config";import { routing } from "@/i18n/routing";-import { setRequestLocale } from "next-intl/server";-import type { Metadata } from "next";+import { OPEN_GRAPH_LOCALE_BY_LOCALE } from "@/lib/seo/locale-utils";+import type EnMessages from "../../../../messages/en.json";-import { APP_URL, STATIC_ASSETS_URL, TWITTER_CREATOR } from "@/config";import { AboutJsonLd } from "./about-json-ld";-import { OPEN_GRAPH_LOCALE_BY_LOCALE } from "@/lib/seo/locale-utils";-// Add metadata to make sure search engines can index the page+// Next.js types dynamic segments as `string`, so we narrow to `Locale` belowexport async function generateMetadata({params,-}: {- params: { locale: Locale };-}): Promise<Metadata> {+}: Pick<LayoutProps<"/[locale]/about">, "params">): Promise<Metadata> {+ const { locale } = await params;++ if (!hasLocale(routing.locales, locale)) {+ notFound();+ }+try {// Load the messages for the requested locale- const messages = await import(- `../../../../messages/${params.locale}.json`- ).then((module: { default: typeof EnMessages }) => module.default);+ const messages = await import(`../../../../messages/${locale}.json`).then(+ (module: { default: typeof EnMessages }) => {+ return module.default;+ },+ );return {title: messages.Metadata.about.title,description: messages.Metadata.about.description,keywords: messages.Metadata.about.keywords,alternates: {- canonical: `${APP_URL}/${params.locale}/about`,+ canonical: `${APP_URL}/${locale}/about`,types: {- "text/markdown": `${APP_URL}/${params.locale}/about.md`,+ "text/markdown": `${APP_URL}/${locale}/about.md`,},languages: {// @ts-expect-error - x-default is not a valid locale@@ -49,10 +57,10 @@ export async function generateMetadata({title: messages.Metadata.about.title,description: messages.Metadata.about.description,siteName: messages.Metadata.about.siteName,- locale: OPEN_GRAPH_LOCALE_BY_LOCALE[params.locale],+ locale: OPEN_GRAPH_LOCALE_BY_LOCALE[locale],alternateLocale: Object.values(OPEN_GRAPH_LOCALE_BY_LOCALE),type: "website",- url: `${APP_URL}/${params.locale}/about`,+ url: `${APP_URL}/${locale}/about`,images: [{url: `${STATIC_ASSETS_URL}/easy-invoice-opengraph-image.png?v=1755773879597`,@@ -94,15 +102,13 @@ export async function generateMetadata({}}+// Next.js types dynamic segments as `string`, so we narrow to `Locale` belowexport default async function AboutLocaleLayout({children,params,-}: {- children: React.ReactNode;- params: { locale: Locale };-}) {+}: LayoutProps<"/[locale]/about">) {// Ensure that the incoming `locale` is valid- const { locale } = params;+ const { locale } = await params;if (!hasLocale(routing.locales, locale)) {notFound();diff --git a/src/app/[locale]/about/loading.tsx b/src/app/[locale]/about/loading.tsxindex cf2e770..457eccf 100644--- a/src/app/[locale]/about/loading.tsx+++ b/src/app/[locale]/about/loading.tsx@@ -1,5 +1,5 @@-import { AboutFooter } from "@/app/[locale]/about/components/about-footer";import { HeaderSkeleton } from "@/app/(components)/header/header-skeleton";+import { AboutFooter } from "@/app/[locale]/about/components/about-footer";import { Skeleton } from "@/components/ui/skeleton";import { cn } from "@/lib/utils";@@ -175,14 +175,16 @@ function FeaturesSectionSkeleton() {<div className="pt-10 sm:px-4 lg:px-0"><div className="overflow-hidden p-2"><div className="-ml-6 -mr-2 flex items-stretch sm:-ml-4 sm:mr-0 lg:-ml-6 xl:-ml-10">- {Array.from({ length: 2 }).map((_, index) => (- <div- key={index}- className="min-w-0 shrink-0 grow-0 basis-full pl-4 sm:basis-[70%] md:basis-[55%] lg:basis-1/2 lg:pl-6 xl:pl-10"- >- <FeatureCardSkeleton />- </div>- ))}+ {Array.from({ length: 2 }).map((_, index) => {+ return (+ <div+ key={index}+ className="min-w-0 shrink-0 grow-0 basis-full pl-4 sm:basis-[70%] md:basis-[55%] lg:basis-1/2 lg:pl-6 xl:pl-10"+ >+ <FeatureCardSkeleton />+ </div>+ );+ })}</div></div>@@ -190,11 +192,13 @@ function FeaturesSectionSkeleton() {<div className="flex items-center justify-center gap-2 pt-6 lg:gap-4"><Skeleton className="size-10 shrink-0 rounded-full" /><div className="flex items-center gap-2">- {Array.from({ length: 6 }).map((_, index) => (- <div key={index} className="p-1.5">- <Skeleton className="size-2 rounded-full" />- </div>- ))}+ {Array.from({ length: 6 }).map((_, index) => {+ return (+ <div key={index} className="p-1.5">+ <Skeleton className="size-2 rounded-full" />+ </div>+ );+ })}</div><Skeleton className="size-10 shrink-0 rounded-full" /></div>@@ -311,31 +315,35 @@ function FaqSectionSkeleton() {<div className="mx-auto mt-14 max-w-3xl"><div className="space-y-2">- {FAQ_QUESTION_RUNS.map((runs, index) => (- <div- key={index}- className="border-b border-dashed border-stone-300 last:border-b-0"- >- <div className="flex items-center justify-between gap-2 py-3">- {/* Question: one `text-base` line box per run that fits */}- <div className="flex flex-wrap gap-x-1">- {runs.map((width) => (- <div- key={width}- className={cn(- "flex h-6 max-w-full shrink-0 items-center",- width,- )}- >- <Skeleton className="h-3.5 w-full" />- </div>- ))}+ {FAQ_QUESTION_RUNS.map((runs, index) => {+ return (+ <div+ key={index}+ className="border-b border-dashed border-stone-300 last:border-b-0"+ >+ <div className="flex items-center justify-between gap-2 py-3">+ {/* Question: one `text-base` line box per run that fits */}+ <div className="flex flex-wrap gap-x-1">+ {runs.map((width) => {+ return (+ <div+ key={width}+ className={cn(+ "flex h-6 max-w-full shrink-0 items-center",+ width,+ )}+ >+ <Skeleton className="h-3.5 w-full" />+ </div>+ );+ })}+ </div>+ {/* The plus icon that expands the answer */}+ <Skeleton className="size-5 shrink-0 rounded-md" /></div>- {/* The plus icon that expands the answer */}- <Skeleton className="size-5 shrink-0 rounded-md" /></div>- </div>- ))}+ );+ })}</div></div></div>diff --git a/src/app/[locale]/about/page.tsx b/src/app/[locale]/about/page.tsxindex 684ef3f..f47bbc9 100644--- a/src/app/[locale]/about/page.tsx+++ b/src/app/[locale]/about/page.tsx@@ -1,11 +1,21 @@-import { GithubIcon } from "@/components/etc/github-logo";+import { hasLocale, useTranslations } from "next-intl";+import { setRequestLocale } from "next-intl/server";+import Link from "next/link";+import { notFound } from "next/navigation";+import { use } from "react";++import { type HeaderProps, Header } from "@/app/(components)/header";import {BlackGoToAppButton,GoToAppButton,} from "@/app/(components)/header/go-to-app-button-cta";+import { ABOUT_FAQ_ITEM_KEYS } from "@/app/[locale]/about/about-faq-item-keys";+import { AboutFooter } from "@/app/[locale]/about/components/about-footer";+import { FeaturesCarousel } from "@/app/[locale]/about/components/features-carousel";+import { GithubStarCtaMarketingPageBody } from "@/app/[locale]/about/components/github-star-cta-body";+import { GithubIcon } from "@/components/etc/github-logo";import { Button } from "@/components/ui/button";import { FaqAccordion, FaqAccordionItem } from "@/components/ui/faq-accordion";-import { TooltipProvider } from "@/components/ui/tooltip";import { AutoPlayVideo } from "@/components/video";import {@@ -15,22 +25,21 @@ import {VIDEO_DEMO_URL,} from "@/config";import { routing } from "@/i18n/routing";-import { useTranslations, type Locale } from "next-intl";-import { setRequestLocale } from "next-intl/server";-import Link from "next/link";-import { ABOUT_FAQ_ITEM_KEYS } from "@/app/[locale]/about/about-faq-item-keys";-import { GithubStarCtaMarketingPageBody } from "@/app/[locale]/about/components/github-star-cta-body";-import { FeaturesCarousel } from "@/app/[locale]/about/components/features-carousel";-import { AboutFooter } from "@/app/[locale]/about/components/about-footer";-import { type HeaderProps, Header } from "@/app/(components)/header";// statically generate the pages for all localesexport function generateStaticParams() {- return routing.locales.map((locale) => ({ locale }));+ return routing.locales.map((locale) => {+ return { locale };+ });}-export default function AboutPage({ params }: { params: { locale: Locale } }) {- const { locale } = params;+// Next.js types dynamic segments as `string`, so we narrow to `Locale` below+export default function AboutPage({ params }: PageProps<"/[locale]/about">) {+ const { locale } = use(params);++ if (!hasLocale(routing.locales, locale)) {+ notFound();+ }// Enables static rendering to prevent an error: https://nextjs.org/docs/messages/dynamic-server-errorsetRequestLocale(locale);@@ -219,14 +228,16 @@ function HeroSection() {function FeaturesSection() {const t = useTranslations("About");- const features = MARKETING_FEATURES_CARDS.map((feature) => ({- translationKey: feature.translationKey,- videoSrc: feature.videoSrc,- videoFallbackImg: feature.videoFallbackImg,- videoDescription: feature.videoDescription,- title: t(`features.items.${feature.translationKey}.title`),- description: t(`features.items.${feature.translationKey}.description`),- }));+ const features = MARKETING_FEATURES_CARDS.map((feature) => {+ return {+ translationKey: feature.translationKey,+ videoSrc: feature.videoSrc,+ videoFallbackImg: feature.videoFallbackImg,+ videoDescription: feature.videoDescription,+ title: t(`features.items.${feature.translationKey}.title`),+ description: t(`features.items.${feature.translationKey}.description`),+ };+ });return (<section@@ -287,15 +298,17 @@ function FaqSection() {</div><div className="mx-auto mt-14 max-w-3xl"><FaqAccordion>- {ABOUT_FAQ_ITEM_KEYS.map((translationKey) => (- <FaqAccordionItem- key={translationKey}- question={t(`items.${translationKey}.question`)}- className="border-stone-300 bg-white"- >- {t(`items.${translationKey}.answer`)}- </FaqAccordionItem>- ))}+ {ABOUT_FAQ_ITEM_KEYS.map((translationKey) => {+ return (+ <FaqAccordionItem+ key={translationKey}+ question={t(`items.${translationKey}.question`)}+ className="border-stone-300 bg-white"+ >+ {t(`items.${translationKey}.answer`)}+ </FaqAccordionItem>+ );+ })}</FaqAccordion></div></div>diff --git a/src/app/[locale]/error.tsx b/src/app/[locale]/error.tsxindex 18cccc2..83d1a06 100644--- a/src/app/[locale]/error.tsx+++ b/src/app/[locale]/error.tsx@@ -1,11 +1,12 @@"use client";-import { useEffect } from "react";import * as Sentry from "@sentry/nextjs";-import { Button } from "@/components/ui/button";-import { ErrorMessage } from "@/components/etc/error-message";-import { toast } from "sonner";import Link from "next/link";+import { useEffect } from "react";+import { toast } from "sonner";++import { ErrorMessage } from "@/components/etc/error-message";+import { Button } from "@/components/ui/button";type Props = {error: Error;diff --git a/src/app/api/generate-invoice/__tests__/export-server-pdf.test.ts b/src/app/api/generate-invoice/__tests__/export-server-pdf.test.tsdeleted file mode 100644index 3abb2c0..0000000--- a/src/app/api/generate-invoice/__tests__/export-server-pdf.test.ts+++ /dev/null@@ -1,68 +0,0 @@-// @vitest-environment node--import fs from "node:fs";--import { describe, expect, it, vi } from "vitest";--import { SERVER_PDF_MOCK_INVOICE_DATA } from "./pdf-test-utils";--import {- getPolishInvoiceRealData,- renderInvoicePdfBuffer,-} from "../render-pdf-on-server";--vi.mock("@/env", () => ({- env: {- AUTH_TOKEN: "test-auth-token",- RESEND_API_KEY: "re_test_123",- UPSTASH_REDIS_REST_URL: "https://redis.test",- UPSTASH_REDIS_REST_TOKEN: "redis-token",- TELEGRAM_BOT_TOKEN: "telegram-token",- TELEGRAM_CHAT_ID: "telegram-chat-id",- SELLER_NAME: "Test Seller",- SELLER_ADDRESS: "Seller Address",- SELLER_VAT_NO: "SELLER-VAT",- SELLER_EMAIL: "[email protected]",- SELLER_ACCOUNT_NUMBER: "123456789",- SELLER_SWIFT_BIC: "TESTBIC",- BUYER_NAME: "Test Buyer",- BUYER_ADDRESS: "Buyer Address",- BUYER_VAT_NO: "BUYER-VAT",- BUYER_EMAIL: "[email protected]",- INVOICE_NET_PRICE: "1000",- INVOICE_EMAIL_RECIPIENT: "[email protected]",- INVOICE_EMAIL_COMPANY_TO: "[email protected]",- GOOGLE_DRIVE_PARENT_FOLDER_ID: "folder-123",- GOOGLE_DRIVE_CLIENT_EMAIL: "[email protected]",- GOOGLE_DRIVE_PRIVATE_KEY: "private-key",- GITHUB_TOKEN: "github-token",- NEXT_PUBLIC_SENTRY_DSN: "https://sentry.test",- },-}));--const exportPath = process.env.PDF_EXPORT_PATH;-const exportLanguage = process.env.PDF_EXPORT_LANG === "pl" ? "pl" : "en";--// IMPORTANT: we use this test to write out PDF buffer to disk for visual regression testing that is used in e2e/server-render-pdf.test.ts-/**- * Export server PDF test needed for end-to-end visual regression.- *- * e2e/server-render-pdf.test.ts spawns this test (in a child process)- * to generate actual server-side PDF files, enabling snapshot comparison- * of rendered invoices in Playwright. Not run during normal CI test suite.- *- * **ONLY PURPOSE**: write out PDF buffer to disk as e2e artifact.- */-describe.skipIf(!exportPath)("export server PDF for e2e", () => {- it("writes PDF buffer to disk", async () => {- const invoiceData =- exportLanguage === "pl"- ? getPolishInvoiceRealData(SERVER_PDF_MOCK_INVOICE_DATA)- : SERVER_PDF_MOCK_INVOICE_DATA;-- const buffer = await renderInvoicePdfBuffer({ invoiceData });-- expect(buffer.byteLength).toBeGreaterThan(0);- fs.writeFileSync(exportPath!, buffer);- });-});diff --git a/src/app/api/generate-invoice/__tests__/generate-invoice.test.ts b/src/app/api/generate-invoice/__tests__/generate-invoice.test.tsindex 46d743c..87091a9 100644--- a/src/app/api/generate-invoice/__tests__/generate-invoice.test.ts+++ b/src/app/api/generate-invoice/__tests__/generate-invoice.test.ts@@ -1,12 +1,14 @@+import type { Attachment } from "resend";import { describe, it, expect, vi } from "vitest";++import { MOCK_INVOICE_DATA } from "@/utils/__tests__/data";+import {generateInvoice,type GenerateInvoiceDeps,type GenerateInvoiceInput,type GenerateInvoiceReport,} from "../generate-invoice";-import { MOCK_INVOICE_DATA } from "@/utils/__tests__/data";-import type { Attachment } from "resend";// No vi.mock() here — all external boundaries are injected via deps.@@ -136,6 +138,43 @@ describe("generateInvoice", () => {);});+ it("should use Warsaw time for date-based output", async () => {+ vi.useFakeTimers({ toFake: ["Date"] });+ vi.setSystemTime(new Date("2026-08-31T22:30:00.000Z"));++ try {+ const deps = buildDeps();+ await generateInvoice(deps, {+ ...MOCK_INPUT,+ englishInvoiceData: {+ ...MOCK_INPUT.englishInvoiceData,+ invoiceNumberObject: {+ label: "Invoice Number",+ value: "",+ },+ },+ });++ expect(deps.createOrFindInvoiceFolder).toHaveBeenCalledWith(+ expect.objectContaining({ month: "09", year: "2026" }),+ );+ expect(deps.uploadFile).toHaveBeenCalledWith(+ expect.objectContaining({ fileName: "invoice-EN-09-2026.pdf" }),+ );++ const telegramCall = vi.mocked(deps.sendTelegramMessage).mock+ .calls[0][0];+ expect(telegramCall.message).toContain("Invoices for September 2026");+ expect(telegramCall.message).toContain("Date: *September 1, 2026*");++ const emailCall = vi.mocked(deps.sendEmail).mock.calls[0][0];+ expect(emailCall.subject).toBe("📝 Invoices for September 2026");+ expect(emailCall.html).toContain("Date: <b>September 1, 2026</b>");+ } finally {+ vi.useRealTimers();+ }+ });+it("should send Telegram notification with 2 file attachments", async () => {const deps = buildDeps();await generateInvoice(deps, MOCK_INPUT);@@ -181,7 +220,7 @@ describe("generateInvoice", () => {const uploadCalls = vi.mocked(deps.uploadFile).mock.invocationCallOrder;// Last uploadFile() invocation (want to ensure all uploads precede notifications)- const lastUploadOrder = uploadCalls[uploadCalls.length - 1];+ const lastUploadOrder = uploadCalls.at(-1)!;// Get call order numbers for the first sendTelegramMessage and sendEmail callsconst telegramOrder = vi.mocked(deps.sendTelegramMessage).mock@@ -646,7 +685,7 @@ describe("generateInvoice", () => {await generateInvoice(deps, MOCK_INPUT);const formattedNumber =- MOCK_INVOICE_DATA.invoiceNumberObject.value.replace(/\//g, "-");+ MOCK_INVOICE_DATA.invoiceNumberObject.value.replaceAll("/", "-");for (const call of vi.mocked(deps.uploadFile).mock.calls) {expect(call[0].fileName).toContain(formattedNumber);diff --git a/src/app/api/generate-invoice/__tests__/pdf-test-utils.ts b/src/app/api/generate-invoice/__tests__/pdf-test-utils.tsindex 961f6b7..f932912 100644--- a/src/app/api/generate-invoice/__tests__/pdf-test-utils.ts+++ b/src/app/api/generate-invoice/__tests__/pdf-test-utils.ts@@ -1,50 +1,25 @@import { createRequire } from "node:module";import { pathToFileURL } from "node:url";-import type { InvoiceData } from "@/app/schema";-import { MOCK_INVOICE_DATA } from "@/utils/__tests__/data";-import { pdfjs } from "react-pdf";+// https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#which-browsersenvironments-are-supported+import * as pdfjs from "pdfjs-dist/legacy/build/pdf.mjs";import { expect } from "vitest";+// Use PDF.js' legacy build in Node. PDF.js uses this build in its official+// Node examples and currently lists Node.js support under the legacy build.++// Re-exported so vitest suites keep a single import site. The fixture itself lives in a+// vitest-free module so the Playwright e2e suite can import it without pulling in pdfjs/vitest.+export { SERVER_PDF_MOCK_INVOICE_DATA } from "./server-pdf-fixture";+const require = createRequire(import.meta.url);pdfjs.GlobalWorkerOptions.workerSrc = pathToFileURL(- require.resolve("pdfjs-dist/build/pdf.worker.mjs"),+ require.resolve("pdfjs-dist/legacy/build/pdf.worker.mjs"),).href;-/** Invoice fixture for render-pdf-on-server.test.tsx — no logo. */-export const SERVER_PDF_MOCK_INVOICE_DATA = {- ...MOCK_INVOICE_DATA,- logo: "",- invoiceType: "Reverse Charge",- notes:- "Test PDF for server-side rendering using <InvoicePdfTemplateToRenderOnBackend/> in src/app/api/generate-invoice/render-pdf-on-server.tsx. Used to validate server PDF generation.",- items: MOCK_INVOICE_DATA.items.map((item) => ({- ...item,- typeOfGTUFieldIsVisible: false,- invoiceItemNumberIsVisible: true,- name: "Software Development",- nameFieldIsVisible: true,- amount: 1,- amountFieldIsVisible: true,- unit: "service",- unitFieldIsVisible: true,- netPrice: 10000,- netPriceFieldIsVisible: true,- vat: "NP",- vatFieldIsVisible: true,- netAmount: 10000,- netAmountFieldIsVisible: true,- vatAmount: 0,- vatAmountFieldIsVisible: true,- preTaxAmount: 10000,- preTaxAmountFieldIsVisible: true,- })),- total: 10000,-} satisfies InvoiceData;-export function assertValidPdfBuffer(buffer: Buffer) {- expect(buffer.byteLength).toBeGreaterThan(1_000);+ expect(buffer.byteLength).toBeGreaterThan(1000);expect(buffer.subarray(0, 5).toString("ascii")).toBe("%PDF-");expect(buffer.toString("ascii")).toContain("%%EOF");}@@ -58,5 +33,9 @@ export async function extractPdfText(buffer: Buffer): Promise<string> {const page = await doc.getPage(1);const content = await page.getTextContent();- return content.items.map((item) => ("str" in item ? item.str : "")).join(" ");+ return content.items+ .map((item) => {+ return "str" in item ? item.str : "";+ })+ .join(" ");}diff --git a/src/app/api/generate-invoice/__tests__/preview-route.test.ts b/src/app/api/generate-invoice/__tests__/preview-route.test.tsnew file mode 100644index 0000000..e34680e--- /dev/null+++ b/src/app/api/generate-invoice/__tests__/preview-route.test.ts@@ -0,0 +1,157 @@+// @vitest-environment node++import { NextRequest } from "next/server";+import { describe, it, expect, vi } from "vitest";++import { SAMPLE_INVOICE_DATA } from "../sample-invoice-data";+import { assertValidPdfBuffer, extractPdfText } from "./pdf-test-utils";+import { TEST_ENV } from "./test-env";++/**+ * Tests for GET /api/generate-invoice/preview.+ *+ * Note what is NOT mocked here: Google Drive, Resend and Telegram. The preview+ * route does not import them at all, which is exactly the property that makes it+ * safe to call from an e2e test. If someone adds a side-effecting import to that+ * route, this file starts making real network calls — treat that as the alarm.+ */++// Real PDF rendering (font fetch + @react-pdf layout) takes seconds on a cold+// worker, and several suites do it in parallel — the 5s default is too tight.+vi.setConfig({ testTimeout: 30_000, hookTimeout: 30_000 });++vi.mock("@/env", async () => {+ // dynamic import: vi.mock factories are hoisted above the static imports+ const { TEST_ENV } = await import("./test-env");+ return { env: TEST_ENV };+});++vi.mock("@/lib/rate-limit", () => {+ return {+ ipLimiter: {+ limit: async () => {+ return { success: true };+ },+ },+ };+});++function createRequest({+ authToken = TEST_ENV.AUTH_TOKEN,+ searchParams = {},+}: {+ authToken?: string;+ searchParams?: Record<string, string>;+} = {}) {+ // No server is involved: the route is invoked directly as GET(request) below.+ // NextRequest just needs an absolute URL to construct, and the route only reads+ // searchParams + headers — never the host. The e2e test in+ // e2e/server-render-pdf/ is the one that calls the real deployment, and it uses+ // a relative path against Playwright's baseURL (the Vercel URL in CI).+ const url = new URL("http://localhost:3000/api/generate-invoice/preview");++ for (const [key, value] of Object.entries(searchParams)) {+ url.searchParams.set(key, value);+ }++ return new NextRequest(url, {+ headers: new Headers({ Authorization: `Bearer ${authToken}` }),+ });+}++describe("GET /api/generate-invoice/preview", () => {+ describe("guards", () => {+ it("should return 401 when the bearer token is wrong", async () => {+ const { GET } = await import("../preview/route");+ const response = await GET(createRequest({ authToken: "wrong-token" }));++ expect(response.status).toBe(401);+ expect(await response.text()).toBe("Unauthorized");+ });++ it("should return 400 for an unsupported language", async () => {+ const { GET } = await import("../preview/route");+ const response = await GET(+ createRequest({ searchParams: { lang: "de" } }),+ );++ expect(response.status).toBe(400);++ const body = (await response.json()) as { error: string };+ expect(body.error).toContain('Unsupported lang "de"');+ });+ });++ describe("PDF response", () => {+ it("should serve a valid PDF with the right headers", async () => {+ const { GET } = await import("../preview/route");+ const response = await GET(+ createRequest({ searchParams: { lang: "en" } }),+ );++ expect(response.status).toBe(200);+ expect(response.headers.get("Content-Type")).toBe("application/pdf");+ expect(response.headers.get("Content-Disposition")).toContain(+ 'filename="invoice-preview-en.pdf"',+ );++ assertValidPdfBuffer(Buffer.from(await response.arrayBuffer()));+ });++ it("should render the fictional sample invoice", async () => {+ const { GET } = await import("../preview/route");+ const response = await GET(+ createRequest({ searchParams: { lang: "en" } }),+ );+ const text = await extractPdfText(+ Buffer.from(await response.arrayBuffer()),+ );++ expect(text).toContain(SAMPLE_INVOICE_DATA.seller.name);+ expect(text).toContain(SAMPLE_INVOICE_DATA.buyer.name);+ expect(text).toContain(SAMPLE_INVOICE_DATA.invoiceNumberObject.value);+ });++ it("should NOT leak any env-driven invoice data", async () => {+ // Regression guard: the committed e2e snapshots render this endpoint's+ // output, so if it ever starts reading env again, real seller/buyer+ // details (VAT no, bank account, SWIFT) would be published to a public repo.+ const { GET } = await import("../preview/route");+ const response = await GET(+ createRequest({ searchParams: { lang: "en" } }),+ );+ const text = await extractPdfText(+ Buffer.from(await response.arrayBuffer()),+ );++ const envInvoiceValues = [+ TEST_ENV.SELLER_NAME,+ TEST_ENV.SELLER_ADDRESS,+ TEST_ENV.SELLER_VAT_NO,+ TEST_ENV.SELLER_EMAIL,+ TEST_ENV.SELLER_ACCOUNT_NUMBER,+ TEST_ENV.SELLER_SWIFT_BIC,+ TEST_ENV.BUYER_NAME,+ TEST_ENV.BUYER_VAT_NO,+ TEST_ENV.BUYER_EMAIL,+ ];++ for (const value of envInvoiceValues) {+ expect(text).not.toContain(value);+ }+ });++ it("should serve Polish content when lang=pl", async () => {+ const { GET } = await import("../preview/route");+ const response = await GET(+ createRequest({ searchParams: { lang: "pl" } }),+ );+ const text = await extractPdfText(+ Buffer.from(await response.arrayBuffer()),+ );++ expect(text).toContain("Odwrotne obciążenie");+ expect(text).toContain("NIP");+ });+ });+});diff --git a/src/app/api/generate-invoice/__tests__/render-pdf-on-server.test.tsx b/src/app/api/generate-invoice/__tests__/render-pdf-on-server.test.tsxindex ab4df3e..2a603ba 100644--- a/src/app/api/generate-invoice/__tests__/render-pdf-on-server.test.tsx+++ b/src/app/api/generate-invoice/__tests__/render-pdf-on-server.test.tsx@@ -1,8 +1,9 @@// @vitest-environment node-import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";import { describe, expect, it, vi } from "vitest";+import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";+import {getPolishInvoiceRealData,renderInvoicePdfBuffer,@@ -13,34 +14,15 @@ import {SERVER_PDF_MOCK_INVOICE_DATA,} from "./pdf-test-utils";-vi.mock("@/env", () => ({- env: {- AUTH_TOKEN: "test-auth-token",- RESEND_API_KEY: "re_test_123",- UPSTASH_REDIS_REST_URL: "https://redis.test",- UPSTASH_REDIS_REST_TOKEN: "redis-token",- TELEGRAM_BOT_TOKEN: "telegram-token",- TELEGRAM_CHAT_ID: "telegram-chat-id",- SELLER_NAME: "Test Seller",- SELLER_ADDRESS: "Seller Address",- SELLER_VAT_NO: "SELLER-VAT",- SELLER_EMAIL: "[email protected]",- SELLER_ACCOUNT_NUMBER: "123456789",- SELLER_SWIFT_BIC: "TESTBIC",- BUYER_NAME: "Test Buyer",- BUYER_ADDRESS: "Buyer Address",- BUYER_VAT_NO: "BUYER-VAT",- BUYER_EMAIL: "[email protected]",- INVOICE_NET_PRICE: "1000",- INVOICE_EMAIL_RECIPIENT: "[email protected]",- INVOICE_EMAIL_COMPANY_TO: "[email protected]",- GOOGLE_DRIVE_PARENT_FOLDER_ID: "folder-123",- GOOGLE_DRIVE_CLIENT_EMAIL: "[email protected]",- GOOGLE_DRIVE_PRIVATE_KEY: "private-key",- GITHUB_TOKEN: "github-token",- NEXT_PUBLIC_SENTRY_DSN: "https://sentry.test",- },-}));+// Real PDF rendering (font fetch + @react-pdf layout) takes seconds on a cold+// worker, and several suites do it in parallel — the 5s default is too tight.+vi.setConfig({ testTimeout: 30_000, hookTimeout: 30_000 });++vi.mock("@/env", async () => {+ // dynamic import: vi.mock factories are hoisted above the static imports+ const { TEST_ENV } = await import("./test-env");+ return { env: TEST_ENV };+});describe("renderInvoicePdfBuffer", () => {it("should produce a valid English PDF buffer", async () => {diff --git a/src/app/api/generate-invoice/__tests__/route-integration.test.ts b/src/app/api/generate-invoice/__tests__/route-integration.test.tsnew file mode 100644index 0000000..91b8562--- /dev/null+++ b/src/app/api/generate-invoice/__tests__/route-integration.test.ts@@ -0,0 +1,234 @@+// @vitest-environment node++import { NextRequest } from "next/server";+import { describe, it, expect, vi, beforeAll } from "vitest";++import { assertValidPdfBuffer, extractPdfText } from "./pdf-test-utils";+import { TEST_ENV } from "./test-env";++/**+ * Integration test for GET /api/generate-invoice.+ *+ * route.test.ts mocks `runProductionGenerateMonthlyInvoice` and only covers the+ * HTTP layer; generate-invoice.test.ts injects its own fake deps. Neither one+ * ever executes run-production-generate-invoice.ts, which is where the env vars+ * are mapped to invoice data and wired into the deps object.+ *+ * This test runs that file for real — route -> runProductionGenerateMonthlyInvoice+ * -> generateInvoice -> renderInvoicePdfBuffer — stubbing only the outermost I/O+ * (Google Drive, Telegram, Resend, Upstash). It is what catches a swapped EN/PL+ * renderer or an invoice emailed to the wrong address; no other test would.+ *+ * NOTE: real rendering fetches Open Sans from static.easyinvoicepdf.com, so this+ * test needs network access (same as render-pdf-on-server.test.tsx).+ */++const uploadedToDrive: Array<{ fileName: string; fileContent: Buffer }> = [];+const telegramMessages: Array<{+ message: string;+ files?: Array<{ filename: string; buffer: Buffer }>;+}> = [];+const sentEmails: Array<{+ to: string;+ attachments: Array<{ filename: string; content: Buffer }>;+}> = [];++// Real PDF rendering (font fetch + @react-pdf layout) takes seconds on a cold+// worker, and several suites do it in parallel — the 5s default is too tight.+vi.setConfig({ testTimeout: 30_000, hookTimeout: 30_000 });++vi.mock("@/env", async () => {+ // dynamic import: vi.mock factories are hoisted above the static imports+ const { TEST_ENV } = await import("./test-env");+ return { env: TEST_ENV };+});++vi.mock("@/lib/rate-limit", () => {+ return {+ ipLimiter: {+ limit: async () => {+ return { success: true };+ },+ },+ };+});++vi.mock("@/lib/google-drive", () => {+ return {+ initializeGoogleDrive: async () => {+ return {} as never;+ },+ createOrFindInvoiceFolder: async () => {+ return {+ folderToUploadInvoices: {+ id: "folder-abc",+ webViewLink: "https://drive.google.com/folder-abc",+ },+ googleDriveFolderPath: "2026/08",+ };+ },+ uploadFile: async (args: { fileName: string; fileContent: Buffer }) => {+ uploadedToDrive.push({+ fileName: args.fileName,+ fileContent: args.fileContent,+ });+ return { id: "file-1" };+ },+ };+});++vi.mock("@/lib/telegram", () => {+ return {+ sendTelegramMessage: async (args: {+ message: string;+ files?: Array<{ filename: string; buffer: Buffer }>;+ }) => {+ telegramMessages.push(args);+ return { success: true };+ },+ };+});++vi.mock("@/lib/resend", () => {+ return {+ resend: {+ emails: {+ send: async (args: {+ to: string;+ attachments: Array<{ filename: string; content: Buffer }>;+ }) => {+ sentEmails.push(args);+ return { data: { id: "email-1" }, error: null };+ },+ },+ },+ };+});++/** Body of the single route call made in the surrounding `beforeAll`. */+let responseBody: { message?: string; report: Record<string, unknown> };++/**+ * Clears the captured I/O, calls the real route once, and records its body.+ *+ * Runs in `beforeAll` rather than `beforeEach`: the assertions below only read+ * captured state, so rendering the PDFs once per scenario is enough.+ */+async function callRoute(searchParams: Record<string, string>) {+ uploadedToDrive.length = 0;+ telegramMessages.length = 0;+ sentEmails.length = 0;++ // the route falls back to VERCEL_ENV when a flag is absent; every call here+ // passes both flags explicitly, but keep the environment neutral regardless+ delete process.env.VERCEL_ENV;++ const url = new URL("http://localhost:3000/api/generate-invoice");++ for (const [key, value] of Object.entries(searchParams)) {+ url.searchParams.set(key, value);+ }++ const { GET } = await import("../route");+ const response = await GET(+ new NextRequest(url, {+ headers: new Headers({ Authorization: `Bearer ${TEST_ENV.AUTH_TOKEN}` }),+ }),+ );++ // guard the shared setup so a failure here is not reported as an unrelated+ // assertion failure in every test below+ expect(response.status).toBe(200);++ responseBody = (await response.json()) as typeof responseBody;+}++/** Finds a captured Drive upload by language, failing loudly if absent. */+function getUploadedPdf(language: "EN" | "PL") {+ const upload = uploadedToDrive.find((file) => {+ return file.fileName.startsWith(`invoice-${language}-`);+ });++ if (!upload) {+ throw new Error(+ `No ${language} upload found. Got: ${uploadedToDrive+ .map((file) => {+ return file.fileName;+ })+ .join(", ")}`,+ );+ }++ return upload;+}++describe("GET /api/generate-invoice — full pipeline integration", () => {+ describe("with email and Google Drive enabled", () => {+ beforeAll(async () => {+ await callRoute({ sendEmail: "true", uploadToGoogleDrive: "true" });+ });++ it("should upload one valid English PDF and one valid Polish PDF", () => {+ expect(uploadedToDrive).toHaveLength(2);++ assertValidPdfBuffer(getUploadedPdf("EN").fileContent);+ assertValidPdfBuffer(getUploadedPdf("PL").fileContent);+ });++ it("should embed the real English invoice content in the uploaded PDF", async () => {+ const text = await extractPdfText(getUploadedPdf("EN").fileContent);++ expect(text).toContain(TEST_ENV.SELLER_NAME);+ expect(text).toContain(TEST_ENV.BUYER_NAME);+ expect(text).toContain("Software Development");+ expect(text).toContain("Reverse Charge");+ });++ it("should embed the real Polish invoice content in the uploaded PDF", async () => {+ const text = await extractPdfText(getUploadedPdf("PL").fileContent);++ expect(text).toContain(TEST_ENV.SELLER_NAME);+ expect(text).toContain("Odwrotne obciążenie");+ expect(text).toContain("NIP");+ });++ it("should email both PDFs to the configured recipient", () => {+ expect(sentEmails).toHaveLength(1);+ expect(sentEmails[0].to).toBe(TEST_ENV.INVOICE_EMAIL_RECIPIENT);++ const attachments = sentEmails[0].attachments;+ expect(attachments).toHaveLength(2);++ for (const attachment of attachments) {+ expect(attachment.filename).toMatch(/^invoice-(EN|PL)-.+\.pdf$/);+ assertValidPdfBuffer(Buffer.from(attachment.content));+ }+ });+ });++ describe("dry run (sendEmail=false, uploadToGoogleDrive=false)", () => {+ beforeAll(async () => {+ await callRoute({ sendEmail: "false", uploadToGoogleDrive: "false" });+ });++ it("should still render both PDFs but skip Drive and email", () => {+ expect(responseBody.report).toMatchObject({+ invoiceENgeneratedSuccessfully: true,+ invoicePLgeneratedSuccessfully: true,+ savedToGoogleDrive: false,+ notifiedByEmail: false,+ });++ expect(uploadedToDrive).toHaveLength(0);+ expect(sentEmails).toHaveLength(0);+ });++ it("should STILL send a Telegram message with both PDFs attached", () => {+ // Documents current behaviour: Telegram is unconditional, so even a+ // fully-flagged-off dry run posts a real message in production.+ expect(telegramMessages).toHaveLength(1);+ expect(telegramMessages[0].files).toHaveLength(2);+ expect(telegramMessages[0].message).toContain("Test mode warning");+ });+ });+});diff --git a/src/app/api/generate-invoice/__tests__/route.test.ts b/src/app/api/generate-invoice/__tests__/route.test.tsindex a8db146..1a3e435 100644--- a/src/app/api/generate-invoice/__tests__/route.test.ts+++ b/src/app/api/generate-invoice/__tests__/route.test.ts@@ -1,5 +1,6 @@-import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";import { NextRequest } from "next/server";+import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";+import type {GenerateInvoiceResult,GenerateInvoiceReport,@@ -29,19 +30,31 @@ const MOCK_ENV = {const mockRunProduction = vi.fn();const mockIpLimiterLimit = vi.fn();-vi.mock("@/env", () => ({ env: { ...MOCK_ENV } }));+vi.mock("@/env", () => {+ return { env: { ...MOCK_ENV } };+});-vi.mock("../run-production-generate-invoice", () => ({- runProductionGenerateMonthlyInvoice: (...args: unknown[]) =>- mockRunProduction(...args) as unknown as Promise<GenerateInvoiceResult>,-}));+vi.mock("../run-production-generate-invoice", () => {+ return {+ runProductionGenerateMonthlyInvoice: (...args: unknown[]) => {+ return mockRunProduction(+ ...args,+ ) as unknown as Promise<GenerateInvoiceResult>;+ },+ };+});-vi.mock("@/lib/rate-limit", () => ({- ipLimiter: {- limit: (...args: unknown[]) =>- mockIpLimiterLimit(...args) as unknown as Promise<{ success: boolean }>,- },-}));+vi.mock("@/lib/rate-limit", () => {+ return {+ ipLimiter: {+ limit: (...args: unknown[]) => {+ return mockIpLimiterLimit(...args) as unknown as Promise<{+ success: boolean;+ }>;+ },+ },+ };+});function createRequest({authToken,diff --git a/src/app/api/generate-invoice/__tests__/server-pdf-fixture.ts b/src/app/api/generate-invoice/__tests__/server-pdf-fixture.tsnew file mode 100644index 0000000..c262334--- /dev/null+++ b/src/app/api/generate-invoice/__tests__/server-pdf-fixture.ts@@ -0,0 +1,35 @@+import type { InvoiceData } from "@/app/schema";+import { MOCK_INVOICE_DATA } from "@/utils/__tests__/data";++/** Invoice fixture for render-pdf-on-server.test.tsx — no logo. */+export const SERVER_PDF_MOCK_INVOICE_DATA = {+ ...MOCK_INVOICE_DATA,+ logo: "",+ invoiceType: "Reverse Charge",+ notes:+ "Test PDF for server-side rendering using <InvoicePdfTemplateToRenderOnBackend/> in src/app/api/generate-invoice/render-pdf-on-server.tsx. Used to validate server PDF generation.",+ items: MOCK_INVOICE_DATA.items.map((item) => {+ return {+ ...item,+ typeOfGTUFieldIsVisible: false,+ invoiceItemNumberIsVisible: true,+ name: "Software Development",+ nameFieldIsVisible: true,+ amount: 1,+ amountFieldIsVisible: true,+ unit: "service",+ unitFieldIsVisible: true,+ netPrice: 10_000,+ netPriceFieldIsVisible: true,+ vat: "NP",+ vatFieldIsVisible: true,+ netAmount: 10_000,+ netAmountFieldIsVisible: true,+ vatAmount: 0,+ vatAmountFieldIsVisible: true,+ preTaxAmount: 10_000,+ preTaxAmountFieldIsVisible: true,+ };+ }),+ total: 10_000,+} satisfies InvoiceData;diff --git a/src/app/api/generate-invoice/__tests__/test-env.ts b/src/app/api/generate-invoice/__tests__/test-env.tsnew file mode 100644index 0000000..5b8bd4f--- /dev/null+++ b/src/app/api/generate-invoice/__tests__/test-env.ts@@ -0,0 +1,32 @@+/**+ * Fake `@/env` values shared by the generate-invoice test suites.+ *+ * Tests that render real PDFs assert on these values (seller/buyer names,+ * net price), so keep them stable — changing one changes those assertions.+ */+export const TEST_ENV = {+ AUTH_TOKEN: "test-auth-token",+ RESEND_API_KEY: "re_test_123",+ UPSTASH_REDIS_REST_URL: "https://redis.test",+ UPSTASH_REDIS_REST_TOKEN: "redis-token",+ TELEGRAM_BOT_TOKEN: "telegram-token",+ TELEGRAM_CHAT_ID: "telegram-chat-id",+ SELLER_NAME: "Test Seller",+ SELLER_ADDRESS: "Seller Address",+ SELLER_VAT_NO: "SELLER-VAT",+ SELLER_EMAIL: "[email protected]",+ SELLER_ACCOUNT_NUMBER: "123456789",+ SELLER_SWIFT_BIC: "TESTBIC",+ BUYER_NAME: "Test Buyer",+ BUYER_ADDRESS: "Buyer Address",+ BUYER_VAT_NO: "BUYER-VAT",+ BUYER_EMAIL: "[email protected]",+ INVOICE_NET_PRICE: "1000",+ INVOICE_EMAIL_RECIPIENT: "[email protected]",+ INVOICE_EMAIL_COMPANY_TO: "[email protected]",+ GOOGLE_DRIVE_PARENT_FOLDER_ID: "folder-123",+ GOOGLE_DRIVE_CLIENT_EMAIL: "[email protected]",+ GOOGLE_DRIVE_PRIVATE_KEY: "private-key",+ GITHUB_TOKEN: "github-token",+ NEXT_PUBLIC_SENTRY_DSN: "https://sentry.test",+} as const;diff --git a/src/app/api/generate-invoice/generate-invoice.ts b/src/app/api/generate-invoice/generate-invoice.tsindex bd4fbc8..2c9420e 100644--- a/src/app/api/generate-invoice/generate-invoice.ts+++ b/src/app/api/generate-invoice/generate-invoice.ts@@ -1,11 +1,19 @@-import { invoiceSchema, type InvoiceData } from "@/app/schema";-import type { InvoiceFolderResult } from "@/lib/google-drive";-import { compressInvoiceData } from "@/utils/url-compression";import dayjs from "dayjs";+import timezone from "dayjs/plugin/timezone";+import utc from "dayjs/plugin/utc";import type { drive_v3 } from "googleapis";import { compressToEncodedURIComponent } from "lz-string";import type { Attachment, CreateEmailResponse } from "resend";+import { invoiceSchema, type InvoiceData } from "@/app/schema";+import type { InvoiceFolderResult } from "@/lib/google-drive";+import { compressInvoiceData } from "@/utils/url-compression";++dayjs.extend(utc);+dayjs.extend(timezone);++const WARSAW_TIME_ZONE = "Europe/Warsaw";+/*** Formats milliseconds into a human-readable duration string.* @param ms - Duration in milliseconds@@ -154,6 +162,7 @@ export async function generateInvoice(input: GenerateInvoiceInput,): Promise<GenerateInvoiceResult> {const startTime = performance.now();+ const warsawNow = dayjs().tz(WARSAW_TIME_ZONE);const {renderEnInvoice,@@ -181,26 +190,30 @@ export async function generateInvoice(const renderedInvoices = await Promise.allSettled([renderEnInvoice()- .then((buf) => ({ language: "en", document: buf }))- .catch((err) => {+ .then((buf) => {+ return { language: "en", document: buf };+ })+ .catch((error) => {console.error("[generate-invoice] Error during `renderToBuffer` for ENGLISH invoice:",- err,+ error,);- throw err;+ throw error;}),renderPlInvoice()- .then((buf) => ({ language: "pl", document: buf }))- .catch((err) => {+ .then((buf) => {+ return { language: "pl", document: buf };+ })+ .catch((error) => {console.error("[generate-invoice] Error during `renderToBuffer` for POLISH invoice:",- err,+ error,);- throw err;+ throw error;}),]);- console.log(+ console.info("[generate-invoice] PDF rendering completed in",formatDuration(performance.now() - renderStartTime),);@@ -229,8 +242,8 @@ export async function generateInvoice(const invoiceNumber =englishInvoiceData?.invoiceNumberObject?.value?.trim() || "";const formattedInvoiceNumber = invoiceNumber- ? invoiceNumber.replace(/\//g, "-")- : dayjs().format("MM-YYYY");+ ? invoiceNumber.replaceAll("/", "-")+ : warsawNow.format("MM-YYYY");const attachments = fulfilledInvoices.map((doc) => {const fileName = `invoice-${doc.language.toUpperCase()}-${formattedInvoiceNumber}.pdf`;@@ -242,7 +255,7 @@ export async function generateInvoice(});// Guard: if every render failed, there is nothing to upload or send.- if (!attachments.length) {+ if (attachments.length === 0) {return {ok: false,kind: "no_attachments",@@ -266,7 +279,7 @@ export async function generateInvoice(const compressedData = compressToEncodedURIComponent(compressedJson);const invoiceUrl = `https://easyinvoicepdf.com/?template=${newInvoiceDataValidated.template}&data=${compressedData}`;- const monthAndYear = dayjs().format("MMMM YYYY");+ const monthAndYear = warsawNow.format("MMMM YYYY");const invoiceNumberValue = englishInvoiceData?.invoiceNumberObject?.value;// ─── Step 3: Upload PDFs to Google Drive ─────────────────────────────────@@ -279,8 +292,8 @@ export async function generateInvoice(// Authenticate, then resolve (or create) the month/year folder in Drive.const googleDrive = await initializeGoogleDrive();- const currentMonth = dayjs().format("MM");- const currentYear = dayjs().format("YYYY");+ const currentMonth = warsawNow.format("MM");+ const currentYear = warsawNow.format("YYYY");const folderResult = await createOrFindInvoiceFolder({googleDrive,@@ -300,23 +313,25 @@ export async function generateInvoice(const uploadStartTime = performance.now();const uploadResults = await Promise.allSettled(- attachments.map((attachment) =>- uploadFile({+ attachments.map((attachment) => {+ return uploadFile({googleDrive,fileName: attachment.filename,fileContent: Buffer.from(attachment.content),folderId: folderToUploadInvoices.id,- }),- ),+ });+ }),);- console.log(+ console.info("[generate-invoice] PDF uploading to Google Drive completed in",formatDuration(performance.now() - uploadStartTime),);const failedUploads = uploadResults.filter(- (r): r is PromiseRejectedResult => r.status === "rejected",+ (r): r is PromiseRejectedResult => {+ return r.status === "rejected";+ },);if (failedUploads.length > 0) {@@ -340,14 +355,14 @@ export async function generateInvoice(}savedToGoogleDrive = true;- } catch (err) {- console.error("[generate-invoice] Google Drive setup failed:", err);+ } catch (error) {+ console.error("[generate-invoice] Google Drive setup failed:", error);return {ok: false,kind: "upload_failed",error: `[generate-invoice] Failed to initialize Google Drive: ${- err instanceof Error ? err.message : "Unknown error"+ error instanceof Error ? error.message : "Unknown error"}`,report: {invoiceENgeneratedSuccessfully,@@ -385,7 +400,9 @@ export async function generateInvoice(const testModeWarningBlock =testModeWarnings.length > 0? `\n\n⚠️⚠️⚠️ *Test mode warning:* ⚠️⚠️⚠️\n\n${testModeWarnings- .map((w) => `- ${w}`)+ .map((w) => {+ return `- ${w}`;+ }).join("\n")}\n\n⚠️⚠️⚠️ *Test mode warning ends here* ⚠️⚠️⚠️\n\n`: "";@@ -409,7 +426,7 @@ export async function generateInvoice(message: `${testModeWarningBlock}📝 *Invoices for ${monthAndYear}*Invoice No. of: *${invoiceNumberValue}*-Date: *${dayjs().format("MMMM D, YYYY")}*+Date: *${warsawNow.format("MMMM D, YYYY")}*The generated invoices are included in the attachments. Please check them carefully.@@ -423,10 +440,12 @@ Have a nice day!Best regards,EasyInvoicePDF.com`,- files: attachments.map((attachment) => ({- filename: attachment.filename,- buffer: Buffer.from(attachment.content),- })),+ files: attachments.map((attachment) => {+ return {+ filename: attachment.filename,+ buffer: Buffer.from(attachment.content),+ };+ }),}),];@@ -438,7 +457,7 @@ EasyInvoicePDF.com`,subject: `📝 Invoices for ${monthAndYear}`,html: `${emailGoogleDriveWarningHtml}<p>Hello,</p><span>Invoice No. of: <b>${invoiceNumberValue}</b><br/>- Date: <b>${dayjs().format("MMMM D, YYYY")}</b>+ Date: <b>${warsawNow.format("MMMM D, YYYY")}</b><br/><br/>@@ -470,7 +489,7 @@ EasyInvoicePDF.com`,const notificationResults = await Promise.allSettled(notifications);- console.log(+ console.info("[generate-invoice] Notifications sending completed in",formatDuration(performance.now() - notificationStartTime),);@@ -482,7 +501,9 @@ EasyInvoicePDF.com`,: false;const failedNotifications = notificationResults.filter(- (r): r is PromiseRejectedResult => r.status === "rejected",+ (r): r is PromiseRejectedResult => {+ return r.status === "rejected";+ },);if (failedNotifications.length > 0) {diff --git a/src/app/api/generate-invoice/preview/route.tsx b/src/app/api/generate-invoice/preview/route.tsxnew file mode 100644index 0000000..9e09522--- /dev/null+++ b/src/app/api/generate-invoice/preview/route.tsx@@ -0,0 +1,97 @@+import { NextResponse, type NextRequest } from "next/server";++import { env } from "@/env";+import { ipLimiter } from "@/lib/rate-limit";++import {+ getPolishInvoiceRealData,+ renderInvoicePdfBuffer,+} from "../render-pdf-on-server";+import { SAMPLE_INVOICE_DATA } from "../sample-invoice-data";++export const dynamic = "force-dynamic";++// maxTimeout for the serverless function on vercel (30 seconds), max timeout is 300 seconds (5 minutes) atm per their docs+// https://vercel.com/docs/functions/configuring-functions/duration+export const maxDuration = 30;++const PREVIEW_LANGUAGES = ["en", "pl"] as const;++type PreviewLanguage = (typeof PREVIEW_LANGUAGES)[number];++function isPreviewLanguage(value: string): value is PreviewLanguage {+ return (PREVIEW_LANGUAGES as readonly string[]).includes(value);+}++/**+ * Renders the invoice PDF template and returns it directly, sending nothing.+ *+ * Two properties are load-bearing — keep both:+ *+ * 1. It renders SAMPLE_INVOICE_DATA only. The real seller/buyer details in env+ * (VAT no, bank account, SWIFT) are never reachable from here, so the output+ * is safe to store, share, and commit — the e2e visual snapshots do exactly+ * that. Never wire `getEnglishInvoiceRealData()` into this route.+ *+ * 2. It imports only `render-pdf-on-server`. There is no Google Drive / Resend /+ * Telegram anywhere in its module graph, so it cannot produce a side-effect+ * even if the flags on the main `/api/generate-invoice` route change.+ *+ * The sample invoice has fixed dates and a fixed invoice number, so the response+ * is byte-stable over time — which is what makes the committed snapshots work.+ *+ * Query params:+ * - `lang` — "en" (default) or "pl".+ */+export async function GET(req: NextRequest) {+ try {+ // checked before the rate limiter so unauthorized calls cannot burn quota+ if (req.headers.get("Authorization") !== `Bearer ${env.AUTH_TOKEN}`) {+ return new NextResponse("Unauthorized", { status: 401 });+ }++ const ip = req.headers.get("x-forwarded-for") ?? "127.0.0.1";+ const rateLimitResult = await ipLimiter.limit(ip);++ if (!rateLimitResult.success) {+ console.error(`Rate limit exceeded for IP: ${ip}`);+ return NextResponse.json(+ { error: "Too many requests." },+ { status: 429 },+ );+ }++ const langParam = req.nextUrl.searchParams.get("lang") ?? "en";++ if (!isPreviewLanguage(langParam)) {+ return NextResponse.json(+ {+ error: `Unsupported lang "${langParam}". Expected one of: ${PREVIEW_LANGUAGES.join(", ")}`,+ },+ { status: 400 },+ );+ }++ const invoiceData =+ langParam === "pl"+ ? getPolishInvoiceRealData(SAMPLE_INVOICE_DATA)+ : SAMPLE_INVOICE_DATA;++ const pdf = await renderInvoicePdfBuffer({ invoiceData });++ return new NextResponse(new Uint8Array(pdf), {+ status: 200,+ headers: {+ "Content-Type": "application/pdf",+ "Content-Disposition": `inline; filename="invoice-preview-${langParam}.pdf"`,+ "Cache-Control": "no-store",+ },+ });+ } catch (error) {+ console.error("[generate-invoice/preview] Error in route:", error);+ return NextResponse.json(+ { error: "[generate-invoice/preview] Failed to render invoice preview" },+ { status: 500 },+ );+ }+}diff --git a/src/app/api/generate-invoice/render-pdf-on-server.tsx b/src/app/api/generate-invoice/render-pdf-on-server.tsxindex 1430af2..59b2736 100644--- a/src/app/api/generate-invoice/render-pdf-on-server.tsx+++ b/src/app/api/generate-invoice/render-pdf-on-server.tsx@@ -1,3 +1,8 @@+// IMPORTANT: it's fine to use this import directly on server side+// eslint-disable-next-line no-restricted-imports+import { Document, Font, Page, renderToBuffer } from "@react-pdf/renderer";+import dayjs from "dayjs";+import { PDF_DEFAULT_TEMPLATE_STYLES } from "@/app/(app)/components/invoice-templates/invoice-pdf-default-template";import { InvoiceBody } from "@/app/(app)/components/invoice-templates/invoice-pdf-default-template/invoice-body";import { INVOICE_PDF_TRANSLATIONS } from "@/app/(app)/pdf-i18n-translations/pdf-translations";@@ -5,11 +10,6 @@ import { getInvoiceDefaultNumberValue } from "@/app/constants";import { type InvoiceData, type SupportedLanguages } from "@/app/schema";import { INVOICE_PDF_FONTS } from "@/config";import { env } from "@/env";-import dayjs from "dayjs";--// IMPORTANT: it's fine to use this import directly on server side-// eslint-disable-next-line no-restricted-imports-import { Document, Font, Page, renderToBuffer } from "@react-pdf/renderer";// Open sans seems to be working fine with EN and PLconst fontFamily = "Open Sans";diff --git a/src/app/api/generate-invoice/route.tsx b/src/app/api/generate-invoice/route.tsxindex 1a4ac1f..988b317 100644--- a/src/app/api/generate-invoice/route.tsx+++ b/src/app/api/generate-invoice/route.tsx@@ -2,6 +2,7 @@ import { NextResponse, type NextRequest } from "next/server";import { env } from "@/env";import { ipLimiter } from "@/lib/rate-limit";+import { runProductionGenerateMonthlyInvoice } from "./run-production-generate-invoice";export const dynamic = "force-dynamic";@@ -50,8 +51,7 @@ export async function GET(req: NextRequest) {shouldUploadToGoogleDrive,});- // eslint-disable-next-line no-console- console.log("[generate-invoice] Report:", result.report);+ console.info("[generate-invoice] Report:", result.report);if (!result.ok) {const status = result.kind === "no_attachments" ? 400 : 500;diff --git a/src/app/api/generate-invoice/run-production-generate-invoice.ts b/src/app/api/generate-invoice/run-production-generate-invoice.tsindex 02ffd6c..223662d 100644--- a/src/app/api/generate-invoice/run-production-generate-invoice.ts+++ b/src/app/api/generate-invoice/run-production-generate-invoice.ts@@ -24,16 +24,20 @@ function buildGenerateInvoiceDeps(polishInvoiceData: InvoiceData,): GenerateInvoiceDeps {return {- renderEnInvoice: () =>- renderInvoicePdfBuffer({ invoiceData: englishInvoiceData }),- renderPlInvoice: () =>- renderInvoicePdfBuffer({ invoiceData: polishInvoiceData }),+ renderEnInvoice: () => {+ return renderInvoicePdfBuffer({ invoiceData: englishInvoiceData });+ },+ renderPlInvoice: () => {+ return renderInvoicePdfBuffer({ invoiceData: polishInvoiceData });+ },initializeGoogleDrive,createOrFindInvoiceFolder,uploadFile,sendTelegramMessage,- sendEmail: (args) => resend.emails.send(args),+ sendEmail: (args) => {+ return resend.emails.send(args);+ },};}@@ -52,7 +56,7 @@ export async function runProductionGenerateMonthlyInvoice(options: {const englishInvoiceData = getEnglishInvoiceRealData();const polishInvoiceData = getPolishInvoiceRealData(englishInvoiceData);- return generateInvoice(+ return await generateInvoice(buildGenerateInvoiceDeps(englishInvoiceData, polishInvoiceData),{shouldSendEmail: options.shouldSendEmail,diff --git a/src/app/api/generate-invoice/sample-invoice-data.ts b/src/app/api/generate-invoice/sample-invoice-data.tsnew file mode 100644index 0000000..5356bd6--- /dev/null+++ b/src/app/api/generate-invoice/sample-invoice-data.ts@@ -0,0 +1,112 @@+import { type InvoiceData } from "@/app/schema";++/**+ * A fully hardcoded, obviously-fake invoice used by `/api/generate-invoice/preview?sample=true`.+ *+ * IMPORTANT: this exists so tests never render the real seller/buyer data that+ * `getEnglishInvoiceRealData()` reads from env. The e2e visual snapshots are+ * committed to the repo, so anything they render is public — keep every value+ * here fictional, and never reference `env` from this file.+ *+ * Every date and the invoice number are fixed, which is what makes the committed+ * snapshot stable over time.+ */+export const SAMPLE_INVOICE_DATA = {+ language: "en",+ dateFormat: "YYYY-MM-DD",+ currency: "EUR",++ invoiceNumberObject: {+ label: "Invoice No. of:",+ value: "1/01-2026",+ },++ dateOfIssue: "2026-01-15",+ dateOfServiceStart: "2026-01-01",+ dateOfService: "2026-01-31",+ paymentDue: "2026-01-31",++ servicePeriodFieldIsVisible: false,+ dateOfServiceFieldIsVisible: true,+ servicePeriodLabelText: "Service period",+ dateOfServiceLabelText: "Date of sales/of executing the service",++ invoiceType: "Reverse Charge",+ invoiceTypeFieldIsVisible: true,++ seller: {+ name: "Sample Seller Ltd.",+ address: "1 Example Street, 00-001 Sampletown",++ vatNo: "PL0000000000",+ vatNoLabelText: "VAT no",+ vatNoFieldIsVisible: true,++ email: "[email protected]",+ emailFieldIsVisible: true,++ accountNumber: "PL00 0000 0000 0000 0000 0000 0000",+ accountNumberFieldIsVisible: true,++ swiftBic: "EXAMPLEBIC",+ swiftBicFieldIsVisible: true,++ notesFieldIsVisible: true,+ },+ buyer: {+ name: "Sample Buyer B.V.",+ address: "2 Placeholder Avenue, 1000 AA Exampleburg",++ vatNo: "NL000000000B00",+ vatNoLabelText: "VAT no",+ vatNoFieldIsVisible: true,++ email: "[email protected]",+ emailFieldIsVisible: true,+ notesFieldIsVisible: true,+ },++ items: [+ {+ invoiceItemNumberIsVisible: true,+ name: "Software Development",+ nameFieldIsVisible: true,+ typeOfGTU: "",+ typeOfGTUFieldIsVisible: false,+ amount: 1,+ amountFieldIsVisible: true,+ unit: "service",+ unitFieldIsVisible: true,+ netPrice: 1000,+ netPriceFieldIsVisible: true,+ vat: "NP",+ vatFieldIsVisible: true,+ netAmount: 1000,+ netAmountFieldIsVisible: true,+ vatAmount: 0,+ vatAmountFieldIsVisible: true,+ preTaxAmount: 1000,+ preTaxAmountFieldIsVisible: true,+ },+ ],+ total: 1000,+ vatTableSummaryIsVisible: true,++ paymentMethod: "wire transfer",+ paymentMethodFieldIsVisible: true,++ notes: "Reverse charge",+ notesFieldIsVisible: true,++ qrCodeData: "",+ qrCodeDescription: "",+ qrCodeIsVisible: true,++ personAuthorizedToReceiveName: "",+ personAuthorizedToReceiveFieldIsVisible: true,+ personAuthorizedToIssueName: "",+ personAuthorizedToIssueFieldIsVisible: true,++ template: "default",+ taxLabelText: "VAT",+} as const satisfies InvoiceData;diff --git a/src/app/api/telegram-webhook/__tests__/route.test.ts b/src/app/api/telegram-webhook/__tests__/route.test.tsindex e8cdb6c..aa65acf 100644--- a/src/app/api/telegram-webhook/__tests__/route.test.ts+++ b/src/app/api/telegram-webhook/__tests__/route.test.ts@@ -1,12 +1,13 @@-import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";import { NextRequest } from "next/server";+import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";+import type {GenerateInvoiceResult,GenerateInvoiceReport,} from "@/app/api/generate-invoice/generate-invoice";-const ALLOWED_CHAT_ID = 12345;-const CHAT_ID = 67890;+const ALLOWED_CHAT_ID = 12_345;+const CHAT_ID = 67_890;const MOCK_REPORT = {invoiceENgeneratedSuccessfully: true,@@ -29,30 +30,46 @@ const mockClearQueuedJob = vi.fn();const waitUntilPromises: Promise<unknown>[] = [];-vi.mock("@/env", () => ({ env: { ...MOCK_ENV } }));+vi.mock("@/env", () => {+ return { env: { ...MOCK_ENV } };+});-vi.mock("@vercel/functions", () => ({- waitUntil: (promise: Promise<unknown>) => {- waitUntilPromises.push(promise);- },-}));+vi.mock("@vercel/functions", () => {+ return {+ waitUntil: (promise: Promise<unknown>) => {+ waitUntilPromises.push(promise);+ },+ };+});-vi.mock("@/app/api/generate-invoice/run-production-generate-invoice", () => ({- runProductionGenerateMonthlyInvoice: (...args: unknown[]) =>- mockRunProduction(...args) as unknown as Promise<GenerateInvoiceResult>,-}));+vi.mock("@/app/api/generate-invoice/run-production-generate-invoice", () => {+ return {+ runProductionGenerateMonthlyInvoice: (...args: unknown[]) => {+ return mockRunProduction(+ ...args,+ ) as unknown as Promise<GenerateInvoiceResult>;+ },+ };+});-vi.mock("@/lib/telegram", () => ({- sendTelegramMessage: (...args: unknown[]) =>- mockSendTelegramMessage(...args) as unknown as Promise<void>,-}));+vi.mock("@/lib/telegram", () => {+ return {+ sendTelegramMessage: (...args: unknown[]) => {+ return mockSendTelegramMessage(...args) as unknown as Promise<void>;+ },+ };+});-vi.mock("@/app/api/telegram-webhook/lib/telegram-queue", () => ({- queueInvoiceGeneration: (...args: unknown[]) =>- mockQueueInvoiceGeneration(...args) as unknown as Promise<boolean>,- clearQueuedJob: (...args: unknown[]) =>- mockClearQueuedJob(...args) as unknown as Promise<void>,-}));+vi.mock("@/app/api/telegram-webhook/lib/telegram-queue", () => {+ return {+ queueInvoiceGeneration: (...args: unknown[]) => {+ return mockQueueInvoiceGeneration(...args) as unknown as Promise<boolean>;+ },+ clearQueuedJob: (...args: unknown[]) => {+ return mockClearQueuedJob(...args) as unknown as Promise<void>;+ },+ };+});function createValidUpdate({senderId = ALLOWED_CHAT_ID,@@ -155,7 +172,7 @@ describe("POST /api/telegram-webhook — HTTP layer", () => {it("should return 200 and notify when sender is unauthorized", async () => {const { POST } = await import("../route");const response = await POST(- createRequest(createValidUpdate({ senderId: 99999 })),+ createRequest(createValidUpdate({ senderId: 99_999 })),);expect(response.status).toBe(200);diff --git a/src/app/api/telegram-webhook/route.ts b/src/app/api/telegram-webhook/route.tsindex dc2e180..fb046d2 100644--- a/src/app/api/telegram-webhook/route.ts+++ b/src/app/api/telegram-webhook/route.ts@@ -1,3 +1,6 @@+import { waitUntil } from "@vercel/functions";+import { NextResponse, type NextRequest } from "next/server";+import { runProductionGenerateMonthlyInvoice } from "@/app/api/generate-invoice/run-production-generate-invoice";import {clearQueuedJob,@@ -7,9 +10,6 @@ import { telegramUpdateSchema } from "@/app/api/telegram-webhook/schema/telegramimport { env } from "@/env";import { sendTelegramMessage } from "@/lib/telegram";-import { waitUntil } from "@vercel/functions";-import { NextResponse, type NextRequest } from "next/server";-export const dynamic = "force-dynamic";// serverless function can run for max 30 seconds@@ -31,7 +31,7 @@ export async function POST(req: NextRequest) {if (!parseResult.success) {console.error("[telegram-webhook] Invalid webhook payload:",- parseResult.error.errors,+ parseResult.error.issues,);await sendTelegramMessage({@@ -47,7 +47,7 @@ export async function POST(req: NextRequest) {const update = parseResult.data;const senderChatId = update.message.from.id;- const allowedChatId = parseInt(env.TELEGRAM_CHAT_ID, 10);+ const allowedChatId = Number(env.TELEGRAM_CHAT_ID);if (senderChatId !== allowedChatId) {console.error(@@ -130,8 +130,7 @@ async function handleInvoiceGenerate({ chatId }: { chatId: number }) {shouldUploadToGoogleDrive: isProduction,});- // eslint-disable-next-line no-console- console.log("[telegram-webhook] Report:", result.report);+ console.info("[telegram-webhook] Report:", result.report);if (!result.ok) {console.error(@@ -154,8 +153,8 @@ async function handleInvoiceGenerate({ chatId }: { chatId: number }) {await sendTelegramMessage({message: `🚨 Error: ${error instanceof Error ? error.message : "Unknown error"}`,});- } catch (e) {- console.error("[telegram-webhook] Failed to send error message:", e);+ } catch (error) {+ console.error("[telegram-webhook] Failed to send error message:", error);}} finally {await clearQueuedJob(chatId);diff --git a/src/app/api/telegram-webhook/schema/telegram-schema.test.ts b/src/app/api/telegram-webhook/schema/telegram-schema.test.tsindex 2fe6553..c625c12 100644--- a/src/app/api/telegram-webhook/schema/telegram-schema.test.ts+++ b/src/app/api/telegram-webhook/schema/telegram-schema.test.ts@@ -1,63 +1,58 @@import { describe, it, expect } from "vitest";+import { telegramUpdateSchema } from "./telegram-schema";describe("Telegram Schema Validation", () => {describe("telegramUpdateSchema", () => {it("should validate a valid Telegram update", () => {const validUpdate = {- update_id: 123456789,+ update_id: 123_456_789,message: {message_id: 1,from: {- id: 987654321,+ id: 987_654_321,is_bot: false,first_name: "John",},chat: {- id: 987654321,+ id: 987_654_321,type: "private",},- date: 1234567890,+ date: 1_234_567_890,text: "/generate",},} as const;- const result = telegramUpdateSchema.safeParse(validUpdate);-- expect(result.success).toBe(true);+ // `parse` throws on an invalid update, so the test still fails loudly+ // without an `if (result.success)` guard around the assertions.+ const parsed = telegramUpdateSchema.parse(validUpdate);- if (result.success) {- expect(result.data.update_id).toBe(123456789);- expect(result.data.message?.text).toBe("/generate");- }+ expect(parsed.update_id).toBe(123_456_789);+ expect(parsed.message?.text).toBe("/generate");});it("should validate message without entities", () => {const updateWithoutEntities = {- update_id: 123456789,+ update_id: 123_456_789,message: {message_id: 1,from: {- id: 987654321,+ id: 987_654_321,is_bot: false,first_name: "John",},chat: {- id: 987654321,+ id: 987_654_321,type: "private",},- date: 1234567890,+ date: 1_234_567_890,text: "/generate",},} as const;- const result = telegramUpdateSchema.safeParse(updateWithoutEntities);-- expect(result.success).toBe(true);+ const parsed = telegramUpdateSchema.parse(updateWithoutEntities);- if (result.success) {- expect(result.data.message?.entities).toBeUndefined();- }+ expect(parsed.message?.entities).toBeUndefined();});it("should reject update with missing update_id", () => {@@ -65,15 +60,15 @@ describe("Telegram Schema Validation", () => {message: {message_id: 1,from: {- id: 987654321,+ id: 987_654_321,is_bot: false,first_name: "John",},chat: {- id: 987654321,+ id: 987_654_321,type: "private",},- date: 1234567890,+ date: 1_234_567_890,text: "/generate",},} as const;@@ -85,7 +80,7 @@ describe("Telegram Schema Validation", () => {it("should reject update with missing message", () => {const updateWithoutMessage = {- update_id: 123456789,+ update_id: 123_456_789,} as const;const result = telegramUpdateSchema.safeParse(updateWithoutMessage);@@ -95,7 +90,7 @@ describe("Telegram Schema Validation", () => {it("should reject update with invalid from object", () => {const invalidUpdate = {- update_id: 123456789,+ update_id: 123_456_789,message: {message_id: 1,from: {@@ -104,10 +99,10 @@ describe("Telegram Schema Validation", () => {first_name: "John",},chat: {- id: 987654321,+ id: 987_654_321,type: "private",},- date: 1234567890,+ date: 1_234_567_890,text: "/generate",},} as const;@@ -118,19 +113,19 @@ describe("Telegram Schema Validation", () => {it("should reject update with extra unknown fields", () => {const updateWithExtra = {- update_id: 123456789,+ update_id: 123_456_789,message: {message_id: 1,from: {- id: 987654321,+ id: 987_654_321,is_bot: false,first_name: "John",},chat: {- id: 987654321,+ id: 987_654_321,type: "private",},- date: 1234567890,+ date: 1_234_567_890,text: "/generate",},extra_field: "should fail",@@ -142,19 +137,19 @@ describe("Telegram Schema Validation", () => {it("should validate update with entities", () => {const updateWithEntities = {- update_id: 123456789,+ update_id: 123_456_789,message: {message_id: 1,from: {- id: 987654321,+ id: 987_654_321,is_bot: false,first_name: "John",},chat: {- id: 987654321,+ id: 987_654_321,type: "private",},- date: 1234567890,+ date: 1_234_567_890,text: "/generate",entities: [{@@ -166,31 +161,27 @@ describe("Telegram Schema Validation", () => {},} as const;- const result = telegramUpdateSchema.safeParse(updateWithEntities);+ const parsed = telegramUpdateSchema.parse(updateWithEntities);- expect(result.success).toBe(true);-- if (result.success) {- expect(result.data.message?.entities).toHaveLength(1);- expect(result.data.message?.entities?.[0].type).toBe("bot_command");- }+ expect(parsed.message?.entities).toHaveLength(1);+ expect(parsed.message?.entities?.[0].type).toBe("bot_command");});it("should reject message with text other than '/generate'", () => {const updateWithInvalidCommand = {- update_id: 123456789,+ update_id: 123_456_789,message: {message_id: 1,from: {- id: 987654321,+ id: 987_654_321,is_bot: false,first_name: "John",},chat: {- id: 987654321,+ id: 987_654_321,type: "private",},- date: 1234567890,+ date: 1_234_567_890,text: "/start",},} as const;@@ -201,19 +192,19 @@ describe("Telegram Schema Validation", () => {it("should reject message with empty text", () => {const updateWithEmptyText = {- update_id: 123456789,+ update_id: 123_456_789,message: {message_id: 1,from: {- id: 987654321,+ id: 987_654_321,is_bot: false,first_name: "John",},chat: {- id: 987654321,+ id: 987_654_321,type: "private",},- date: 1234567890,+ date: 1_234_567_890,text: "",},} as const;@@ -224,30 +215,26 @@ describe("Telegram Schema Validation", () => {it("should accept message with exactly '/generate' text", () => {const updateWithGenerateCommand = {- update_id: 123456789,+ update_id: 123_456_789,message: {message_id: 1,from: {- id: 987654321,+ id: 987_654_321,is_bot: false,first_name: "John",},chat: {- id: 987654321,+ id: 987_654_321,type: "private",},- date: 1234567890,+ date: 1_234_567_890,text: "/generate",},} as const;- const result = telegramUpdateSchema.safeParse(updateWithGenerateCommand);-- expect(result.success).toBe(true);+ const parsed = telegramUpdateSchema.parse(updateWithGenerateCommand);- if (result.success) {- expect(result.data.message?.text).toBe("/generate");- }+ expect(parsed.message?.text).toBe("/generate");});});});diff --git a/src/app/api/telegram-webhook/schema/telegram-schema.ts b/src/app/api/telegram-webhook/schema/telegram-schema.tsindex b811e7c..c1848b3 100644--- a/src/app/api/telegram-webhook/schema/telegram-schema.ts+++ b/src/app/api/telegram-webhook/schema/telegram-schema.ts@@ -16,9 +16,14 @@ const telegramMessageSchema = ztext: z.string().min(1, "Text cannot be empty")- .refine((val) => val === "/generate", {- message: "Only '/generate' command is supported",- })+ .refine(+ (val) => {+ return val === "/generate";+ },+ {+ message: "Only '/generate' command is supported",+ },+ ).optional(),entities: z.array(diff --git a/src/app/changelog/[slug]/page.tsx b/src/app/changelog/[slug]/page.tsxindex d9bfb8a..6db75e1 100644--- a/src/app/changelog/[slug]/page.tsx+++ b/src/app/changelog/[slug]/page.tsx@@ -1,9 +1,9 @@-import {- APP_URL,- PERSONAL_WEBSITE_URL,- STATIC_ASSETS_URL,- TWITTER_CREATOR,-} from "@/config";+import { ArrowLeftIcon, ArrowRightIcon } from "lucide-react";+import type { Metadata } from "next";+import Link from "next/link";+import { notFound } from "next/navigation";+import { Suspense } from "react";+import {formatChangelogDate,getChangelogEntry,@@ -11,19 +11,19 @@ import {getNextChangelogEntry,getPreviousChangelogEntry,} from "@/app/changelog/utils";-import { ArrowLeftIcon, ArrowRightIcon } from "lucide-react";-import type { Metadata } from "next";-import Link from "next/link";-import { notFound } from "next/navigation";-import { Suspense } from "react";-import { ChangelogAuthorByline } from "../components/changelog-author-byline";+import {+ APP_URL,+ PERSONAL_WEBSITE_URL,+ STATIC_ASSETS_URL,+ TWITTER_CREATOR,+} from "@/config";+import { ChangelogPostJsonLd } from "../changelog-post-json-ld";+import { ChangelogAuthorByline } from "../components/changelog-author-byline";import { ChangelogVersionBadgeLink } from "../components/changelog-version-badge-link";import { DateTime } from "../components/date-time";-interface ChangelogPageProps {- params: Promise<{ slug: string }>;-}+type ChangelogPageProps = PageProps<"/changelog/[slug]">;// generateStaticParams() runs at build time by Next.js for dynamic route ([slug]) with static generation// Purpose: pre-generate all possible changelog/[slug] pages@@ -32,9 +32,11 @@ interface ChangelogPageProps {// Next.js builds all these routes statically for SEO, fast load, etc.export async function generateStaticParams() {const entries = await getChangelogEntries();- return entries.map((entry) => ({- slug: entry.slug,- }));+ return entries.map((entry) => {+ return {+ slug: entry.slug,+ };+ });}// Generate metadata for each changelog entry@@ -51,7 +53,7 @@ export async function generateMetadata({const formattedDate = formatChangelogDate(entry.metadata.date);return {- title: `${entry.metadata.title || `Update ${formattedDate}`}`,+ title: entry.metadata.title || `Update ${formattedDate}`,description: entry.metadata.description,authors: [{ name: "Vlad Sazonau", url: PERSONAL_WEBSITE_URL }],alternates: {@@ -68,7 +70,7 @@ export async function generateMetadata({"easy invoice pdf changelog",],openGraph: {- title: `${entry.metadata.title || `Update ${formattedDate}`}`,+ title: entry.metadata.title || `Update ${formattedDate}`,description: entry.metadata.description,type: "article",publishedTime: entry.metadata.date,@@ -167,6 +169,7 @@ export default async function ChangelogEntryPage({{/* Twitter/X share */}<atarget="_blank"+ aria-label="Share this update on X"rel="noopener noreferrer"className="transition-all hover:scale-110"href={`https://twitter.com/intent/tweet?text=${encodeURIComponent(@@ -190,6 +193,7 @@ export default async function ChangelogEntryPage({{/* LinkedIn share */}<atarget="_blank"+ aria-label="Share this update on LinkedIn"rel="noopener noreferrer"className="transition-all hover:scale-110"href={`http://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(@@ -212,6 +216,7 @@ export default async function ChangelogEntryPage({{/* Facebook share */}<atarget="_blank"+ aria-label="Share this update on Facebook"rel="noopener noreferrer"className="transition-all hover:scale-110"href={`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(@@ -235,6 +240,7 @@ export default async function ChangelogEntryPage({{/* Hacker News share */}<atarget="_blank"+ aria-label="Share this update on Hacker News"rel="noopener noreferrer"className="transition-all hover:scale-110"href={`https://news.ycombinator.com/submitlink?u=${encodeURIComponent(diff --git a/src/app/changelog/build-changelog-json-ld.ts b/src/app/changelog/build-changelog-json-ld.tsindex fcc1be8..9f48d47 100644--- a/src/app/changelog/build-changelog-json-ld.ts+++ b/src/app/changelog/build-changelog-json-ld.ts@@ -1,6 +1,6 @@-import { PROD_WEBSITE_URL } from "@/config";import type { Graph } from "schema-dts";+import { PROD_WEBSITE_URL } from "@/config";import { buildBreadcrumbList } from "@/lib/seo/breadcrumb";import {JSON_LD_IDS,diff --git a/src/app/changelog/changelog-index-json-ld.tsx b/src/app/changelog/changelog-index-json-ld.tsxindex 87b8ad6..f1bb17e 100644--- a/src/app/changelog/changelog-index-json-ld.tsx+++ b/src/app/changelog/changelog-index-json-ld.tsx@@ -1,7 +1,8 @@-import { getLatestChangelogSummary } from "./utils";-import { buildChangelogIndexJsonLdGraph } from "./build-changelog-json-ld";import { JsonLdScript } from "@/lib/seo/render-json-ld";+import { buildChangelogIndexJsonLdGraph } from "./build-changelog-json-ld";+import { getLatestChangelogSummary } from "./utils";+export async function ChangelogIndexJsonLd() {const latest = await getLatestChangelogSummary().catch((error) => {console.error(diff --git a/src/app/changelog/changelog-post-json-ld.tsx b/src/app/changelog/changelog-post-json-ld.tsxindex a8c653c..8278529 100644--- a/src/app/changelog/changelog-post-json-ld.tsx+++ b/src/app/changelog/changelog-post-json-ld.tsx@@ -1,7 +1,8 @@-import type { ChangelogEntry } from "./utils";-import { buildChangelogPostJsonLdGraph } from "./build-changelog-json-ld";import { JsonLdScript } from "@/lib/seo/render-json-ld";+import { buildChangelogPostJsonLdGraph } from "./build-changelog-json-ld";+import type { ChangelogEntry } from "./utils";+interface ChangelogPostJsonLdProps {entry: ChangelogEntry;}diff --git a/src/app/changelog/layout.tsx b/src/app/changelog/layout.tsxindex 30add1a..91a7240 100644--- a/src/app/changelog/layout.tsx+++ b/src/app/changelog/layout.tsx@@ -1,16 +1,18 @@-import { Header } from "@/app/(components)/header";+import type { Metadata } from "next";+import { Footer } from "@/app/(components)/footer";+import { Header } from "@/app/(components)/header";import {PERSONAL_WEBSITE_URL,STATIC_ASSETS_URL,TWITTER_CREATOR,} from "@/config";-import type { Metadata } from "next";-import { ChangelogIndexJsonLd } from "./changelog-index-json-ld";+import {CHANGELOG_INDEX_DESCRIPTION,CHANGELOG_INDEX_TITLE,} from "./build-changelog-json-ld";+import { ChangelogIndexJsonLd } from "./changelog-index-json-ld";// Enable static generation for changelog layoutexport const dynamic = "force-static";diff --git a/src/app/changelog/loading.tsx b/src/app/changelog/loading.tsxindex c27f81a..61ecf22 100644--- a/src/app/changelog/loading.tsx+++ b/src/app/changelog/loading.tsx@@ -12,50 +12,57 @@ export default function Loading() {{/* Timeline Grid */}<div className="border-slate-200 sm:border-t"><div className="mx-auto max-w-6xl border-slate-200 px-4 dark:border-gray-700 sm:px-12 xl:border-x">- {Array.from({ length: 3 }).map((_, i) => (- <div key={i} className="grid pb-20 pt-4 sm:pt-12 md:grid-cols-4">- {/* Date column - desktop */}- <div className="sticky top-28 hidden self-start md:col-span-1 md:mt-[6px] md:block">- <div className="h-4 w-28 animate-pulse rounded bg-gray-200 dark:bg-gray-700" />- </div>+ {Array.from({ length: 3 }).map((_, i) => {+ return (+ <div+ key={i}+ className="grid pb-20 pt-4 sm:pt-12 md:grid-cols-4"+ >+ {/* Date column - desktop */}+ <div className="sticky top-28 hidden self-start md:col-span-1 md:mt-[6px] md:block">+ <div className="h-4 w-28 animate-pulse rounded bg-gray-200 dark:bg-gray-700" />+ </div>- {/* Content column */}- <div className="flex flex-col md:col-span-3">- {/* Date - mobile */}- <div className="mb-3 h-4 w-28 animate-pulse rounded bg-gray-200 dark:bg-gray-700 md:hidden" />+ {/* Content column */}+ <div className="flex flex-col md:col-span-3">+ {/* Date - mobile */}+ <div className="mb-3 h-4 w-28 animate-pulse rounded bg-gray-200 dark:bg-gray-700 md:hidden" />- {/* Title */}- <div className="mt-2 h-7 w-3/4 animate-pulse rounded bg-gray-200 dark:bg-gray-700 sm:mt-0" />+ {/* Title */}+ <div className="mt-2 h-7 w-3/4 animate-pulse rounded bg-gray-200 dark:bg-gray-700 sm:mt-0" />- {/* Version badge */}- <div className="mt-2 h-5 w-16 animate-pulse rounded-full bg-gray-200 dark:bg-gray-700" />+ {/* Version badge */}+ <div className="mt-2 h-5 w-16 animate-pulse rounded-full bg-gray-200 dark:bg-gray-700" />- {/* Author byline */}- <div className="mb-2 mt-4 flex items-center gap-2">- <div className="h-6 w-6 animate-pulse rounded-full bg-gray-200 dark:bg-gray-700" />- <div className="h-4 w-24 animate-pulse rounded bg-gray-200 dark:bg-gray-700" />- </div>+ {/* Author byline */}+ <div className="mb-2 mt-4 flex items-center gap-2">+ <div className="h-6 w-6 animate-pulse rounded-full bg-gray-200 dark:bg-gray-700" />+ <div className="h-4 w-24 animate-pulse rounded bg-gray-200 dark:bg-gray-700" />+ </div>- {/* Article content */}- <div className="space-y-3">- <div className="h-4 w-full animate-pulse rounded bg-gray-200 dark:bg-gray-700" />- <div className="h-4 w-5/6 animate-pulse rounded bg-gray-200 dark:bg-gray-700" />- <div className="h-4 w-4/6 animate-pulse rounded bg-gray-200 dark:bg-gray-700" />- <div className="mt-4 space-y-2 pl-4">- {Array.from({ length: 4 }).map((_, j) => (- <div- key={j}- className="h-4 animate-pulse rounded bg-gray-200 dark:bg-gray-700"- style={{ width: `${80 - j * 8}%` }}- />- ))}+ {/* Article content */}+ <div className="space-y-3">+ <div className="h-4 w-full animate-pulse rounded bg-gray-200 dark:bg-gray-700" />+ <div className="h-4 w-5/6 animate-pulse rounded bg-gray-200 dark:bg-gray-700" />+ <div className="h-4 w-4/6 animate-pulse rounded bg-gray-200 dark:bg-gray-700" />+ <div className="mt-4 space-y-2 pl-4">+ {Array.from({ length: 4 }).map((_, j) => {+ return (+ <div+ key={j}+ className="h-4 animate-pulse rounded bg-gray-200 dark:bg-gray-700"+ style={{ width: `${80 - j * 8}%` }}+ />+ );+ })}+ </div>+ <div className="h-4 w-full animate-pulse rounded bg-gray-200 dark:bg-gray-700" />+ <div className="h-4 w-3/4 animate-pulse rounded bg-gray-200 dark:bg-gray-700" /></div>- <div className="h-4 w-full animate-pulse rounded bg-gray-200 dark:bg-gray-700" />- <div className="h-4 w-3/4 animate-pulse rounded bg-gray-200 dark:bg-gray-700" /></div></div>- </div>- ))}+ );+ })}</div></div></div>diff --git a/src/app/changelog/page.tsx b/src/app/changelog/page.tsxindex aa14628..98ca096 100644--- a/src/app/changelog/page.tsx+++ b/src/app/changelog/page.tsx@@ -1,11 +1,13 @@+import Link from "next/link";+import { notFound } from "next/navigation";+import { Suspense } from "react";+import {formatChangelogDate,getChangelogEntries,type ChangelogEntry,} from "@/app/changelog/utils";-import Link from "next/link";-import { notFound } from "next/navigation";-import { Suspense } from "react";+import { ChangelogAuthorByline } from "./components/changelog-author-byline";import { ChangelogVersionBadgeLink } from "./components/changelog-version-badge-link";import { DateTime } from "./components/date-time";@@ -50,9 +52,9 @@ export default async function ChangelogPage() {{/* Timeline Grid */}<div className="border-slate-200 sm:border-t"><div className="mx-auto max-w-6xl border-slate-200 px-4 dark:border-gray-700 sm:px-12 xl:border-x">- {entries.map((entry) => (- <ChangelogEntryCard key={entry.slug} entry={entry} />- ))}+ {entries.map((entry) => {+ return <ChangelogEntryCard key={entry.slug} entry={entry} />;+ })}</div></div></div>diff --git a/src/app/changelog/utils.ts b/src/app/changelog/utils.tsindex 5539303..8965974 100644--- a/src/app/changelog/utils.ts+++ b/src/app/changelog/utils.ts@@ -1,8 +1,10 @@-import { GITHUB_URL } from "@/config";-import { readdir } from "fs/promises";-import { join } from "path";+import { readdir } from "node:fs/promises";+import { join } from "node:path";+import { z } from "zod";+import { GITHUB_URL } from "@/config";+export interface ChangelogSummary {slug: string;title: string;@@ -51,7 +53,7 @@ export interface ChangelogEntry {const changelogEntryMetadataSchema = z.object({title: z.string().min(1, "Title is required"),description: z.string().min(1, "Description is required"),- date: z.string().date(),+ date: z.iso.date(),version: z.string().optional(),type: z.enum(["major", "minor", "patch"]).optional(),});@@ -90,7 +92,9 @@ async function getChangelogFiles(): Promise<string[]> {"content",);const files = await readdir(changelogDir);- return files.filter((file) => file.endsWith(".mdx"));+ return files.filter((file) => {+ return file.endsWith(".mdx");+ });} catch (error) {console.error("Failed to read changelog directory:", error);return [];@@ -122,7 +126,7 @@ async function importChangelogFile(filename: string) {if (error instanceof z.ZodError) {console.error(`Invalid metadata in changelog file ${filename}:`,- error.errors,+ error.issues,);return null;}@@ -159,10 +163,7 @@ export async function getChangelogEntries(): Promise<ChangelogEntry[]> {}const { slug, module } = imported;- const { metadata, default: Component } = module as {- metadata: ChangelogMetadata;- default: React.ComponentType;- };+ const { metadata, default: Component } = module;entries.push({slug,@@ -175,10 +176,11 @@ export async function getChangelogEntries(): Promise<ChangelogEntry[]> {}// Sort by date (newest first)- return entries.sort(- (a, b) =>- new Date(b.metadata.date).getTime() - new Date(a.metadata.date).getTime(),- );+ return entries.sort((a, b) => {+ return (+ new Date(b.metadata.date).getTime() - new Date(a.metadata.date).getTime()+ );+ });}/**@@ -188,7 +190,9 @@ export async function getChangelogEntry(slug: string,): Promise<ChangelogEntry | null> {const files = await getChangelogFiles();- const filename = files.find((file) => filenameToSlug(file) === slug);+ const filename = files.find((file) => {+ return filenameToSlug(file) === slug;+ });if (!filename) {return null;@@ -200,10 +204,7 @@ export async function getChangelogEntry(}const { module } = imported;- const { metadata, default: Component } = module as {- metadata: ChangelogMetadata;- default: React.ComponentType;- };+ const { metadata, default: Component } = module;return {slug,@@ -233,9 +234,9 @@ export async function getNextChangelogEntry(currentSlug: string,): Promise<ChangelogEntry | null> {const allEntries = await getChangelogEntries();- const currentIndex = allEntries.findIndex(- (entry) => entry.slug === currentSlug,- );+ const currentIndex = allEntries.findIndex((entry) => {+ return entry.slug === currentSlug;+ });// If current entry is not found or is the first one (newest), return nullif (currentIndex === -1 || currentIndex === 0) {@@ -253,9 +254,9 @@ export async function getPreviousChangelogEntry(currentSlug: string,): Promise<ChangelogEntry | null> {const allEntries = await getChangelogEntries();- const currentIndex = allEntries.findIndex(- (entry) => entry.slug === currentSlug,- );+ const currentIndex = allEntries.findIndex((entry) => {+ return entry.slug === currentSlug;+ });// If current entry is not found or is the last one (oldest), return nullif (currentIndex === -1 || currentIndex === allEntries.length - 1) {diff --git a/src/app/constants/index.ts b/src/app/constants/index.tsindex 02139c3..6d10d80 100644--- a/src/app/constants/index.ts+++ b/src/app/constants/index.ts@@ -1,3 +1,9 @@+import dayjs from "dayjs";++import {+ getDefaultInvoiceNumberLabel,+ INVOICE_PDF_TRANSLATIONS,+} from "../(app)/pdf-i18n-translations/pdf-translations";import {SUPPORTED_CURRENCIES,SUPPORTED_LANGUAGES,@@ -8,11 +14,6 @@ import {type SellerData,type BuyerData,} from "../schema";-import {- getDefaultInvoiceNumberLabel,- INVOICE_PDF_TRANSLATIONS,-} from "../(app)/pdf-i18n-translations/pdf-translations";-import dayjs from "dayjs";/*** Current date in YYYY-MM-DD formatdiff --git a/src/app/founder/build-founder-json-ld.ts b/src/app/founder/build-founder-json-ld.tsindex 05086b4..27a99fd 100644--- a/src/app/founder/build-founder-json-ld.ts+++ b/src/app/founder/build-founder-json-ld.ts@@ -1,6 +1,6 @@-import { PROD_WEBSITE_URL } from "@/config";import type { Graph } from "schema-dts";+import { PROD_WEBSITE_URL } from "@/config";import { buildBreadcrumbList } from "@/lib/seo/breadcrumb";import {JSON_LD_IDS,diff --git a/src/app/founder/founder-json-ld.tsx b/src/app/founder/founder-json-ld.tsxindex bbabd47..7d1e93e 100644--- a/src/app/founder/founder-json-ld.tsx+++ b/src/app/founder/founder-json-ld.tsx@@ -1,6 +1,7 @@-import { buildFounderJsonLdGraph } from "./build-founder-json-ld";import { JsonLdScript } from "@/lib/seo/render-json-ld";+import { buildFounderJsonLdGraph } from "./build-founder-json-ld";+export function FounderJsonLd() {return <JsonLdScript id="json-ld-founder" data={buildFounderJsonLdGraph()} />;}diff --git a/src/app/founder/layout.tsx b/src/app/founder/layout.tsxindex 4db06ff..cb09d96 100644--- a/src/app/founder/layout.tsx+++ b/src/app/founder/layout.tsx@@ -1,3 +1,5 @@+import type { Metadata } from "next";+import { Footer } from "@/app/(components)/footer";import { Header } from "@/app/(components)/header";import {@@ -10,7 +12,7 @@ import {FOUNDER_PAGE_TITLE,FOUNDER_PAGE_URL,} from "@/lib/seo/site-entities";-import type { Metadata } from "next";+import { FounderJsonLd } from "./founder-json-ld";export const dynamic = "force-static";diff --git a/src/app/founder/page.tsx b/src/app/founder/page.tsxindex 6161887..5365122 100644--- a/src/app/founder/page.tsx+++ b/src/app/founder/page.tsx@@ -1,12 +1,13 @@"use client";+import Link from "next/link";+import {AnimatedDiv,blockEnterSpring,} from "@/app/founder/components/animated-div";import { AnimatedSignature } from "@/app/founder/components/animated-signature";import { LINKEDIN_URL, TWITTER_URL } from "@/config";-import Link from "next/link";export default function ContactPage() {return (diff --git a/src/app/global-error.tsx b/src/app/global-error.tsxindex 9388e06..4f9c8a9 100644--- a/src/app/global-error.tsx+++ b/src/app/global-error.tsx@@ -14,7 +14,7 @@ export default function GlobalError({}, [error]);return (- <html>+ <html lang="en"><body>{/* `NextError` is the default Next.js error page component. Its typedefinition requires a `statusCode` prop. However, since the App Routerdiff --git a/src/app/how-it-works/build-how-it-works-json-ld.test.ts b/src/app/how-it-works/build-how-it-works-json-ld.test.tsindex c56cb63..bffbb1f 100644--- a/src/app/how-it-works/build-how-it-works-json-ld.test.ts+++ b/src/app/how-it-works/build-how-it-works-json-ld.test.ts@@ -6,13 +6,14 @@ import { buildHowItWorksJsonLd } from "./build-how-it-works-json-ld";describe("buildHowItWorksJsonLd", () => {it("includes Google's required video rich-result fields for every tutorial", () => {- const graph = JSON.parse(JSON.stringify(buildHowItWorksJsonLd())) as {+ const serializedGraph = JSON.stringify(buildHowItWorksJsonLd());+ const graph = JSON.parse(serializedGraph) as {"@graph": Array<Record<string, unknown>>;};- const webPage = graph["@graph"].find(- (node) => node["@type"] === "WebPage",- ) as {+ const webPage = graph["@graph"].find((node) => {+ return node["@type"] === "WebPage";+ }) as {mainEntity: {itemListElement: Array<{item: {diff --git a/src/app/how-it-works/build-how-it-works-json-ld.ts b/src/app/how-it-works/build-how-it-works-json-ld.tsindex 93a19a3..8dee5ea 100644--- a/src/app/how-it-works/build-how-it-works-json-ld.ts+++ b/src/app/how-it-works/build-how-it-works-json-ld.ts@@ -1,6 +1,6 @@-import { PROD_WEBSITE_URL, HOW_IT_WORKS_VIDEOS } from "@/config";import type { Graph } from "schema-dts";+import { PROD_WEBSITE_URL, HOW_IT_WORKS_VIDEOS } from "@/config";import { buildBreadcrumbList } from "@/lib/seo/breadcrumb";import {JSON_LD_IDS,@@ -16,25 +16,27 @@ const PAGE_DESCRIPTION =export function buildHowItWorksJsonLd(baseUrl = PROD_WEBSITE_URL): Graph {const pageUrl = `${baseUrl}/how-it-works`;- const videoItems = HOW_IT_WORKS_VIDEOS.map((video, index) => ({- "@type": "ListItem" as const,- position: index + 1,- item: {- "@type": "VideoObject" as const,- name: video.title,- description: video.description,- uploadDate: video.uploadDate,- thumbnailUrl: video.thumbnailUrl,- embedUrl: video.embedUrl,- contentUrl: video.watchUrl,- url: `${pageUrl}#${video.id}`,- publisher: {- "@type": "Organization" as const,- name: "EasyInvoicePDF",- url: baseUrl,+ const videoItems = HOW_IT_WORKS_VIDEOS.map((video, index) => {+ return {+ "@type": "ListItem" as const,+ position: index + 1,+ item: {+ "@type": "VideoObject" as const,+ name: video.title,+ description: video.description,+ uploadDate: video.uploadDate,+ thumbnailUrl: video.thumbnailUrl,+ embedUrl: video.embedUrl,+ contentUrl: video.watchUrl,+ url: `${pageUrl}#${video.id}`,+ publisher: {+ "@type": "Organization" as const,+ name: "EasyInvoicePDF",+ url: baseUrl,+ },},- },- }));+ };+ });return {"@context": "https://schema.org",diff --git a/src/app/how-it-works/how-it-works-json-ld.tsx b/src/app/how-it-works/how-it-works-json-ld.tsxindex c18c60a..1947071 100644--- a/src/app/how-it-works/how-it-works-json-ld.tsx+++ b/src/app/how-it-works/how-it-works-json-ld.tsx@@ -1,6 +1,7 @@-import { buildHowItWorksJsonLd } from "./build-how-it-works-json-ld";import { JsonLdScript } from "@/lib/seo/render-json-ld";+import { buildHowItWorksJsonLd } from "./build-how-it-works-json-ld";+export function HowItWorksJsonLd() {return (<JsonLdScript id="json-ld-how-it-works" data={buildHowItWorksJsonLd()} />diff --git a/src/app/how-it-works/layout.tsx b/src/app/how-it-works/layout.tsxindex 9e6c0fd..ed407ff 100644--- a/src/app/how-it-works/layout.tsx+++ b/src/app/how-it-works/layout.tsx@@ -1,3 +1,5 @@+import type { Metadata } from "next";+import { Footer } from "@/app/(components)/footer";import { Header } from "@/app/(components)/header";import {@@ -5,7 +7,7 @@ import {STATIC_ASSETS_URL,TWITTER_CREATOR,} from "@/config";-import type { Metadata } from "next";+import { HowItWorksJsonLd } from "./how-it-works-json-ld";export const dynamic = "force-static";diff --git a/src/app/how-it-works/page.tsx b/src/app/how-it-works/page.tsxindex b069ab0..79935ca 100644--- a/src/app/how-it-works/page.tsx+++ b/src/app/how-it-works/page.tsx@@ -1,10 +1,11 @@-import { HowItWorksVideos } from "@/app/(app)/components/how-it-works-videos";-import { HOW_IT_WORKS_VIDEOS } from "@/config";-import { cn } from "@/lib/utils";import { ArrowRightIcon } from "lucide-react";import Link from "next/link";import { Suspense } from "react";+import { HowItWorksVideos } from "@/app/(app)/components/how-it-works-videos";+import { HOW_IT_WORKS_VIDEOS } from "@/config";+import { cn } from "@/lib/utils";+export const dynamic = "force-static";const linkClassName =@@ -67,33 +68,35 @@ export default function HowItWorksPage() {All tutorials</h2><ul className="mt-6 space-y-8">- {HOW_IT_WORKS_VIDEOS.map((video) => (- <li key={video.id}>- <section id={video.id}>- <h3 className="text-xl font-semibold text-gray-900">- {video.title}- </h3>- <p className="mt-2 text-gray-600">{video.description}</p>- <p className="mt-3">- <Link- href={`/how-it-works?video=${video.id}`}- className={cn(linkClassName)}- >- Watch tutorial- </Link>- {" · "}- <a- href={video.watchUrl}- target="_blank"- rel="noopener noreferrer"- className={cn(linkClassName)}- >- Watch on YouTube- </a>- </p>- </section>- </li>- ))}+ {HOW_IT_WORKS_VIDEOS.map((video) => {+ return (+ <li key={video.id}>+ <section id={video.id}>+ <h3 className="text-xl font-semibold text-gray-900">+ {video.title}+ </h3>+ <p className="mt-2 text-gray-600">{video.description}</p>+ <p className="mt-3">+ <Link+ href={`/how-it-works?video=${video.id}`}+ className={cn(linkClassName)}+ >+ Watch tutorial+ </Link>+ {" · "}+ <a+ href={video.watchUrl}+ target="_blank"+ rel="noopener noreferrer"+ className={cn(linkClassName)}+ >+ Watch on YouTube+ </a>+ </p>+ </section>+ </li>+ );+ })}</ul></section>diff --git a/src/app/layout.tsx b/src/app/layout.tsxindex 7c7a41f..0598c71 100644--- a/src/app/layout.tsx+++ b/src/app/layout.tsx@@ -1,20 +1,18 @@-import { DeviceContextProvider } from "@/contexts/device-context";-import { checkDeviceUserAgent } from "@/lib/check-device.server";-import { NextIntlClientProvider } from "next-intl";-import { ResponsiveIndicator } from "@/components/dev/responsive-indicator";-import { SpeedInsights } from "@vercel/speed-insights/next";import type { Metadata, Viewport } from "next";+import { NextIntlClientProvider } from "next-intl";import Script from "next/script";-import { Toaster } from "sonner";+import { ResponsiveIndicator } from "@/components/dev/responsive-indicator";+import { SentryIndicator } from "@/components/dev/sentry-indicator";import { PERSONAL_WEBSITE_URL, STATIC_ASSETS_URL } from "@/config";+import { DeviceContextProvider } from "@/contexts/device-context";+import { checkDeviceUserAgent } from "@/lib/check-device.server";import { JsonLdScript } from "@/lib/seo/render-json-ld";import { buildSiteWideJsonLdGraph } from "@/lib/seo/site-entities";import "./globals.css";-import "react-pdf/dist/Page/AnnotationLayer.css";import "react-pdf/dist/Page/TextLayer.css";@@ -96,10 +94,14 @@ export default async function RootLayout({<Toaster visibleToasts={1} richColors closeButton />{/* show responsive indicator(tailwind breakpoint) for debugging responsive designs */}{process.env.NODE_ENV === "development" ? (- <ResponsiveIndicator />+ <>+ <ResponsiveIndicator />+ {/* only renders while the browser Sentry SDK is actually live */}+ <SentryIndicator />+ </>) : null}{/* should only be enabled in production */}- {process.env.VERCEL_ENV === "production" && (+ {process.env.VERCEL_ENV === "production" ? (<><SpeedInsightssampleRate={0.3} // send only x% of the requests to Speed Insights (for cost-saving)@@ -112,7 +114,7 @@ export default async function RootLayout({defer/></>- )}+ ) : null}<JsonLdScript id="site-wide-json-ld" data={siteWideJsonLd} /></NextIntlClientProvider></DeviceContextProvider>diff --git a/src/app/robots.ts b/src/app/robots.tsindex 29c3a0f..1d58c57 100644--- a/src/app/robots.ts+++ b/src/app/robots.ts@@ -1,5 +1,7 @@-import { APP_URL } from "@/config";import { type MetadataRoute } from "next";++import { APP_URL } from "@/config";+import { SUPPORTED_LANGUAGES } from "./schema";export default function robots(): MetadataRoute.Robots {@@ -11,7 +13,9 @@ export default function robots(): MetadataRoute.Robots {// Allow main app page (now at /)"/",// Allow about pages in all languages- ...SUPPORTED_LANGUAGES.map((locale) => `/${locale}/about`),+ ...SUPPORTED_LANGUAGES.map((locale) => {+ return `/${locale}/about`;+ }),// Allow template parameter URLs"/?template=*",// Allow changelog pagesdiff --git a/src/app/schema/__tests__/max-invoice-items.test.ts b/src/app/schema/__tests__/max-invoice-items.test.tsindex 364bfc5..be3cb05 100644--- a/src/app/schema/__tests__/max-invoice-items.test.ts+++ b/src/app/schema/__tests__/max-invoice-items.test.ts@@ -1,4 +1,5 @@-import { describe, expect, it } from "vitest";+import { assert, describe, expect, it } from "vitest";+import { MAX_INVOICE_ITEMS, invoiceSchema } from "@/app/schema";import {MOCK_INVOICE_DATA,@@ -8,9 +9,11 @@ import {function createInvoiceWithItemCount(itemCount: number) {return {...MOCK_INVOICE_DATA,- items: Array.from({ length: itemCount }, () => ({- ...MOCK_INVOICE_ITEM_DATA,- })),+ items: Array.from({ length: itemCount }, () => {+ return {+ ...MOCK_INVOICE_ITEM_DATA,+ };+ }),};}@@ -28,11 +31,8 @@ describe("invoiceSchema max invoice items", () => {createInvoiceWithItemCount(MAX_INVOICE_ITEMS + 1),);- expect(result.success).toBe(false);-- if (result.success) {- return;- }+ // `assert` fails the test and narrows the safeParse union in one step+ assert(!result.success);expect(result.error.issues).toEqual(expect.arrayContaining([diff --git a/src/app/schema/index.ts b/src/app/schema/index.tsindex 75ab771..5731156 100644--- a/src/app/schema/index.ts+++ b/src/app/schema/index.ts@@ -1,5 +1,5 @@-import { z } from "zod";import dayjs from "dayjs";+import { z } from "zod";export const SUPPORTED_CURRENCIES = [// Top currencies (pinned)@@ -638,13 +638,17 @@ export interface CurrencyComboboxGroup {items: CurrencyComboboxItem[];}-export const CURRENCY_COMBOBOX_GROUPS = CURRENCY_GROUPS.map((group) => ({- value: group.label,- items: group.currencies.map((code) => ({- code,- searchLabel: `${code} ${CURRENCY_SYMBOLS[code]} ${CURRENCY_TO_LABEL[code]}`,- })),-})) satisfies CurrencyComboboxGroup[];+export const CURRENCY_COMBOBOX_GROUPS = CURRENCY_GROUPS.map((group) => {+ return {+ value: group.label,+ items: group.currencies.map((code) => {+ return {+ code,+ searchLabel: `${code} ${CURRENCY_SYMBOLS[code]} ${CURRENCY_TO_LABEL[code]}`,+ };+ }),+ };+}) satisfies CurrencyComboboxGroup[];export const SUPPORTED_TEMPLATES = ["default", "stripe"] as const;@@ -769,16 +773,31 @@ export const invoiceItemSchema = z.object({amount: z.any()- .refine((val) => val !== "", {- message: "Amount is required",- })+ .refine(+ (val) => {+ return val !== "";+ },+ {+ message: "Amount is required",+ },+ ).transform(Number)- .refine((val) => val >= 0, {- message: "Amount must be >= 0",- })- .refine((val) => val <= 999_999.99, {- message: "Amount must not exceed 999 999.99",- }),+ .refine(+ (val) => {+ return val >= 0;+ },+ {+ message: "Amount must be >= 0",+ },+ )+ .refine(+ (val) => {+ return val <= 999_999.99;+ },+ {+ message: "Amount must not exceed 999 999.99",+ },+ ),amountFieldIsVisible: z.boolean().default(true),unit: z.string().trim().optional(),@@ -786,16 +805,31 @@ export const invoiceItemSchema = z.object({netPrice: z.any()- .refine((val) => val !== "", {- message: "Net price is required",- })+ .refine(+ (val) => {+ return val !== "";+ },+ {+ message: "Net price is required",+ },+ ).transform(Number)- .refine((val) => val >= 0, {- message: "Net price must be >= 0",- })- .refine((val) => val <= 1_000_000_000, {- message: "Net price must not exceed 1 billion",- }),+ .refine(+ (val) => {+ return val >= 0;+ },+ {+ message: "Net price must be >= 0",+ },+ )+ .refine(+ (val) => {+ return val <= 1_000_000_000;+ },+ {+ message: "Net price must not exceed 1 billion",+ },+ ),netPriceFieldIsVisible: z.boolean().default(true),// Tax rate. Accepts numbers 0-100 or any text string (i.e. NP, OO, etc)@@ -808,7 +842,7 @@ export const invoiceItemSchema = z.object({// z.preprocess runs before Zod does any validation, parsing, or type checking on the schema it wraps.(raw) => {// Handle null/undefined by returning empty string for validation- if (raw == null) return "";+ if (raw === null || raw === undefined) return "";// Trim whitespace from string inputs, pass through other types as-isconst val = typeof raw === "string" ? raw.trim() : raw;@@ -843,10 +877,11 @@ export const invoiceItemSchema = z.object({),],{- errorMap: () => ({- message:- "Tax rate is required. Enter a number (0-100) or any text (i.e. NP, OO, etc).",- }),+ // zod v4 replaced `errorMap` with `error`, which returns the message+ // string directly instead of a `{ message }` object.+ error: () => {+ return "Tax rate is required. Enter a number (0-100) or any text (i.e. NP, OO, etc).";+ },},),)@@ -913,9 +948,14 @@ export const sellerSchema = z.object({email: z.string().trim()- .refine((val) => val === "" || z.string().email().safeParse(val).success, {- message: "Invalid email address",- })+ .refine(+ (val) => {+ return val === "" || z.email().safeParse(val).success;+ },+ {+ message: "Invalid email address",+ },+ ).optional(),emailFieldIsVisible: z.boolean().default(true),@@ -943,6 +983,8 @@ export const sellerSchema = z.object({export type SellerData = z.infer<typeof sellerSchema>;+export const SELLERS_LOCAL_STORAGE_KEY = "EASY_INVOICE_PDF_SELLERS";+export const buyerSchema = z.object({id: z.string().optional(),@@ -975,9 +1017,14 @@ export const buyerSchema = z.object({email: z.string().trim()- .refine((val) => val === "" || z.string().email().safeParse(val).success, {- message: "Invalid email address",- })+ .refine(+ (val) => {+ return val === "" || z.email().safeParse(val).success;+ },+ {+ message: "Invalid email address",+ },+ ).optional(),emailFieldIsVisible: z.boolean().default(true),@@ -991,6 +1038,8 @@ export const buyerSchema = z.object({export type BuyerData = z.infer<typeof buyerSchema>;+export const BUYERS_LOCAL_STORAGE_KEY = "EASY_INVOICE_PDF_BUYERS";+/*** Invoice object schema (without cross-field transforms)*@@ -1202,17 +1251,15 @@ export const invoiceObjectSchema = z.object({stripePayOnlineUrl: z.string().trim() // Remove whitespace- .transform((val) => val) // Pass through value+ .transform((val) => {+ return val;+ }) // Pass through value.pipe(z.union([z.literal(""), // Allow empty string- z- .string()- .url("Please enter a valid URL or leave empty")- .refine(- (url) => url.startsWith("https://"),- "URL must start with https://",- ), // Validate HTTPS URL format+ z.url("Please enter a valid URL or leave empty").refine((url) => {+ return url.startsWith("https://");+ }, "URL must start with https://"), // Validate HTTPS URL format]),).optional()@@ -1273,21 +1320,23 @@ export const invoiceObjectSchema = z.object({* This schema is used to validate the invoice data*/export const invoiceSchema = invoiceObjectSchema- .transform((data) => ({- ...data,- // Ensure dateOfServiceStart is trimmed and defaults to first day of- // month containing dateOfService if not set- dateOfServiceStart:- data.dateOfServiceStart?.trim() ||- dayjs(data.dateOfService).startOf("month").format("YYYY-MM-DD"),- }))+ .transform((data) => {+ return {+ ...data,+ // Ensure dateOfServiceStart is trimmed and defaults to first day of+ // month containing dateOfService if not set+ dateOfServiceStart:+ data.dateOfServiceStart?.trim() ||+ dayjs(data.dateOfService).startOf("month").format("YYYY-MM-DD"),+ };+ }).superRefine((data, ctx) => {// Custom validation: dateOfServiceStart must not be after dateOfServiceif (dayjs(data.dateOfServiceStart).isAfter(dayjs(data.dateOfService), "day")) {ctx.addIssue({- code: z.ZodIssueCode.custom,+ code: "custom",message: "Service period start must be on or before the end date",path: ["dateOfServiceStart"],});@@ -1334,12 +1383,11 @@ export const metadataSchema = z.object({/** the schema (zod) version of the app's data model */schemaVersion: z.string().default(SCHEMA_VERSION),/** when the invoice was created (i.e. invoice is first created) */- invoiceCreatedAt: z- .string()- .datetime()- .default(() => dayjs().toISOString()),+ invoiceCreatedAt: z.iso.datetime().default(() => {+ return dayjs().toISOString();+ }),/** when the invoice was last updated (i.e. invoice is regenerated) */- invoiceLastUpdatedAt: z.string().datetime().optional(),+ invoiceLastUpdatedAt: z.iso.datetime().optional(),/** the last visited mobile tab (for better UX) */lastVisitedMobileTab: z@@ -1357,6 +1405,63 @@ export type Metadata = z.infer<typeof metadataSchema>;export const METADATA_LOCAL_STORAGE_KEY = "EASY_INVOICE_METADATA";+// __________________________________________________________+// Local storage keys+// __________________________________________________________++/**+ * Remembers that the user has already seen the welcome popup. The value is a version+ * marker, so bumping it shows the popup again.+ */+export const WELCOME_POPUP_SEEN_STORAGE_KEY = "EASY_INVOICE_WELCOME_POPUP_SEEN";++/** The slug of the newest changelog entry the user has seen. */+export const CHANGELOG_SEEN_STORAGE_KEY =+ "EASY_INVOICE_LAST_SEEN_CHANGELOG_SLUG";++/** When the CTA toast was last shown, as an epoch-milliseconds string. */+export const CTA_TOAST_STORAGE_KEY = "EASY_INVOICE_CTA_LAST_SHOWN_AT";++/**+ * Every key the app is allowed to write to `localStorage`.+ *+ * The keys themselves are declared next to whatever describes their contents (the+ * invoice, seller and metadata schemas above); this is the one list of all of them, and+ * it is what `getAppStorageItem` / `setAppStorageItem` accept. Anything persisted by the+ * app belongs here, so that "what do we store, and can two features collide?" has a+ * single answer.+ */+export const LOCAL_STORAGE_KEYS = [+ PDF_DATA_LOCAL_STORAGE_KEY,+ METADATA_LOCAL_STORAGE_KEY,+ ACCORDION_STATE_LOCAL_STORAGE_KEY,+ SELLERS_LOCAL_STORAGE_KEY,+ BUYERS_LOCAL_STORAGE_KEY,+ WELCOME_POPUP_SEEN_STORAGE_KEY,+ CHANGELOG_SEEN_STORAGE_KEY,+ CTA_TOAST_STORAGE_KEY,+] as const;++export type LocalStorageKey = (typeof LOCAL_STORAGE_KEYS)[number];++// __________________________________________________________+// Validate that local storage keys are unique+// __________________________________________________________++// Two features sharing a key would silently overwrite each other's data, and the union+// type above cannot catch it - a duplicate literal collapses into the same member.+const uniqueLocalStorageKeys = new Set<string>(LOCAL_STORAGE_KEYS);++if (uniqueLocalStorageKeys.size !== LOCAL_STORAGE_KEYS.length) {+ const duplicates = LOCAL_STORAGE_KEYS.filter((key, index) => {+ return LOCAL_STORAGE_KEYS.indexOf(key) !== index;+ });++ throw new Error(+ `LOCAL_STORAGE_KEYS contains duplicate entries: ${duplicates.join(", ")}`,+ );+}+// __________________________________________________________// Validate that currencies are unique// __________________________________________________________@@ -1364,9 +1469,9 @@ export const METADATA_LOCAL_STORAGE_KEY = "EASY_INVOICE_METADATA";const uniqueCurrencies = new Set(SUPPORTED_CURRENCIES);if (uniqueCurrencies.size !== SUPPORTED_CURRENCIES.length) {- const duplicates = SUPPORTED_CURRENCIES.filter(- (currency, index) => SUPPORTED_CURRENCIES.indexOf(currency) !== index,- );+ const duplicates = SUPPORTED_CURRENCIES.filter((currency, index) => {+ return SUPPORTED_CURRENCIES.indexOf(currency) !== index;+ });const currencyFullNames = duplicates.map((currency) => {const currencyFullName = CURRENCY_TO_LABEL[currency];@@ -1380,23 +1485,25 @@ if (uniqueCurrencies.size !== SUPPORTED_CURRENCIES.length) {}// Validate that all supported currencies are in exactly one group-const currenciesInGroups = CURRENCY_GROUPS.flatMap((g) => g.currencies);+const currenciesInGroups = CURRENCY_GROUPS.flatMap((g) => {+ return g.currencies;+});const currenciesInGroupsSet = new Set(currenciesInGroups);// Check for duplicates within groupsif (currenciesInGroupsSet.size !== currenciesInGroups.length) {- const duplicates = currenciesInGroups.filter(- (currency, index) => currenciesInGroups.indexOf(currency) !== index,- );+ const duplicates = currenciesInGroups.filter((currency, index) => {+ return currenciesInGroups.indexOf(currency) !== index;+ });throw new Error(`CURRENCY_GROUPS contains duplicate entries: ${duplicates.join(", ")}`,);}// Check for missing currencies-const missingCurrencies = SUPPORTED_CURRENCIES.filter(- (c) => !currenciesInGroupsSet.has(c),-);+const missingCurrencies = SUPPORTED_CURRENCIES.filter((c) => {+ return !currenciesInGroupsSet.has(c);+});if (missingCurrencies.length > 0) {throw new Error(`CURRENCY_GROUPS is missing currencies: ${missingCurrencies.join(", ")}`,diff --git a/src/app/sitemap.ts b/src/app/sitemap.tsindex 77fde70..b980209 100644--- a/src/app/sitemap.ts+++ b/src/app/sitemap.ts@@ -1,8 +1,10 @@-import { APP_URL } from "@/config";-import { SEO_LANDING_SLUGS } from "@/app/(seo-landings)/seo-landing-definitions";import { type MetadataRoute } from "next";-import { SUPPORTED_LANGUAGES } from "./schema";++import { SEO_LANDING_SLUGS } from "@/app/(seo-landings)/seo-landing-definitions";+import { APP_URL } from "@/config";+import { getChangelogEntries } from "./changelog/utils";+import { SUPPORTED_LANGUAGES } from "./schema";export default async function sitemap(): Promise<MetadataRoute.Sitemap> {const lastModified = new Date();@@ -25,12 +27,14 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {priority: 1,},// About pages in all languages- ...SUPPORTED_LANGUAGES.map((locale) => ({- url: `${APP_URL}/${locale}/about`,- lastModified,- changeFrequency: "weekly" as const,- priority: 1,- })),+ ...SUPPORTED_LANGUAGES.map((locale) => {+ return {+ url: `${APP_URL}/${locale}/about`,+ lastModified,+ changeFrequency: "weekly" as const,+ priority: 1,+ };+ }),// Changelog page{url: `${APP_URL}/changelog`,@@ -71,12 +75,14 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {priority: 0.5,},// Programmatic SEO landing pages- ...SEO_LANDING_SLUGS.map((slug) => ({- url: `${APP_URL}/${slug}`,- lastModified,- changeFrequency: "weekly" as const,- priority: 1,- })),+ ...SEO_LANDING_SLUGS.map((slug) => {+ return {+ url: `${APP_URL}/${slug}`,+ lastModified,+ changeFrequency: "weekly" as const,+ priority: 1,+ };+ }),// llms.txt{url: `${APP_URL}/llms.txt`,diff --git a/src/app/tos/layout.tsx b/src/app/tos/layout.tsxindex 331e487..6b34313 100644--- a/src/app/tos/layout.tsx+++ b/src/app/tos/layout.tsx@@ -1,3 +1,5 @@+import type { Metadata } from "next";+import { Footer } from "@/app/(components)/footer";import { Header } from "@/app/(components)/header";import {@@ -5,7 +7,6 @@ import {STATIC_ASSETS_URL,TWITTER_CREATOR,} from "@/config";-import type { Metadata } from "next";export const dynamic = "force-static";diff --git a/src/app/tos/loading.tsx b/src/app/tos/loading.tsxindex 97b5169..1a0aa10 100644--- a/src/app/tos/loading.tsx+++ b/src/app/tos/loading.tsx@@ -9,28 +9,32 @@ export default function Loading() {<div className="h-4 w-48 animate-pulse rounded bg-gray-200 dark:bg-gray-700" />{/* Sections */}- {Array.from({ length: 8 }).map((_, i) => (- <div key={i} className="space-y-4">- <div className="h-px w-full bg-gray-200 dark:bg-gray-700" />- <div className="h-6 w-40 animate-pulse rounded bg-gray-200 dark:bg-gray-700" />- <div className="space-y-2">- <div className="h-4 w-full animate-pulse rounded bg-gray-200 dark:bg-gray-700" />- <div className="h-4 w-5/6 animate-pulse rounded bg-gray-200 dark:bg-gray-700" />- <div className="h-4 w-4/6 animate-pulse rounded bg-gray-200 dark:bg-gray-700" />- </div>- {i % 2 === 0 && (- <div className="space-y-2 pl-4">- {Array.from({ length: 3 }).map((_, j) => (- <div- key={j}- className="h-4 animate-pulse rounded bg-gray-200 dark:bg-gray-700"- style={{ width: `${75 + j * 5}%` }}- />- ))}+ {Array.from({ length: 8 }).map((_, i) => {+ return (+ <div key={i} className="space-y-4">+ <div className="h-px w-full bg-gray-200 dark:bg-gray-700" />+ <div className="h-6 w-40 animate-pulse rounded bg-gray-200 dark:bg-gray-700" />+ <div className="space-y-2">+ <div className="h-4 w-full animate-pulse rounded bg-gray-200 dark:bg-gray-700" />+ <div className="h-4 w-5/6 animate-pulse rounded bg-gray-200 dark:bg-gray-700" />+ <div className="h-4 w-4/6 animate-pulse rounded bg-gray-200 dark:bg-gray-700" /></div>- )}- </div>- ))}+ {i % 2 === 0 ? (+ <div className="space-y-2 pl-4">+ {Array.from({ length: 3 }).map((_, j) => {+ return (+ <div+ key={j}+ className="h-4 animate-pulse rounded bg-gray-200 dark:bg-gray-700"+ style={{ width: `${75 + j * 5}%` }}+ />+ );+ })}+ </div>+ ) : null}+ </div>+ );+ })}</div></div></div>diff --git a/src/components/__tests__/github-star-cta.test.tsx b/src/components/__tests__/github-star-cta.test.tsxindex e96a95f..6b38f60 100644--- a/src/components/__tests__/github-star-cta.test.tsx+++ b/src/components/__tests__/github-star-cta.test.tsx@@ -1,17 +1,20 @@// @vitest-environment happy-dom-import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";import { cleanup, render, screen, within } from "@testing-library/react";import userEvent from "@testing-library/user-event";+import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";import "@testing-library/jest-dom/vitest";import { GITHUB_URL } from "@/config";+import { GitHubStarCTA } from "../github-star-cta";import { TooltipProvider } from "../ui/tooltip";-vi.mock("@/lib/umami-analytics-track-event", () => ({- umamiTrackEvent: vi.fn(),-}));+vi.mock("@/lib/umami-analytics-track-event", () => {+ return {+ umamiTrackEvent: vi.fn(),+ };+});import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";@@ -87,7 +90,7 @@ describe("GitHubStarCTA", () => {});it("should show lowercase formatted star count when count is over 10k", () => {- const githubStarsCount = 15000;+ const githubStarsCount = 15_000;renderGitHubStarCTA(githubStarsCount);diff --git a/src/components/currency-combobox.tsx b/src/components/currency-combobox.tsxindex 3a188d9..7ba20e3 100644--- a/src/components/currency-combobox.tsx+++ b/src/components/currency-combobox.tsx@@ -1,5 +1,8 @@"use client";+import { CheckIcon, ChevronsUpDownIcon } from "lucide-react";+import { Fragment, useCallback, useEffect, useRef, useState } from "react";+import {CURRENCY_COMBOBOX_GROUPS,CURRENCY_SYMBOLS,@@ -21,8 +24,6 @@ import {PopoverTrigger,} from "@/components/ui/popover";import { cn } from "@/lib/utils";-import { CheckIcon, ChevronsUpDownIcon } from "lucide-react";-import { Fragment, useCallback, useEffect, useRef, useState } from "react";/*** Currency Combobox component@@ -60,6 +61,7 @@ export function CurrencyCombobox({* Dependencies: Runs on changes to `open` or `value`.*/useEffect(() => {+ // oxlint-disable-next-line react-you-might-not-need-an-effect/no-event-handlerif (!open || !value) return;requestAnimationFrame(() => {@@ -115,6 +117,7 @@ export function CurrencyCombobox({variant="outline"role="combobox"aria-expanded={open}+ aria-controls={`${id}-listbox`}className={cn("w-full !scale-100 justify-between rounded-md border border-gray-300 bg-white pl-3 pr-2 text-sm font-normal text-slate-950 shadow-sm shadow-black/5 !outline-none transition-all hover:bg-slate-100/80 focus-visible:!border-2 focus-visible:!border-indigo-600 focus-visible:!ring-2 focus-visible:!ring-indigo-200 focus-visible:!ring-opacity-50 focus-visible:!ring-offset-1",hasError && "border-red-500",@@ -139,6 +142,7 @@ export function CurrencyCombobox({</Button></PopoverTrigger><PopoverContent+ id={`${id}-listbox`}className="w-full min-w-[var(--radix-popper-anchor-width)] border border-slate-300 p-0"align="start">diff --git a/src/components/dev/responsive-indicator.tsx b/src/components/dev/responsive-indicator.tsxindex 46f2b60..dd39a4a 100644--- a/src/components/dev/responsive-indicator.tsx+++ b/src/components/dev/responsive-indicator.tsx@@ -1,6 +1,9 @@"use client";import { useEffect, useState } from "react";+import { useDebouncedCallback } from "use-debounce";++const RESIZE_DEBOUNCE_MS = 100;/*** **Development-only** utility component that displays the current viewport width and Tailwind breakpoint.@@ -10,15 +13,28 @@ import { useEffect, useState } from "react";* Only renders on client side after hydration to avoid width mismatch errors.*/export function ResponsiveIndicator() {+ // there is no viewport on the server, so the width stays 0 through the server+ // and hydration renders - the indicator is unrendered until the effect below+ // reads the real width on the client, which is what avoids the mismatchconst [width, setWidth] = useState(0);const [hidden, setHidden] = useState(false);+ // resize fires on every frame of a drag - debouncing keeps React from+ // re-rendering the indicator dozens of times per second+ const handleResize = useDebouncedCallback(() => {+ return setWidth(window.innerWidth);+ }, RESIZE_DEBOUNCE_MS);+useEffect(() => {- const update = () => setWidth(window.innerWidth);- update();- window.addEventListener("resize", update);- return () => window.removeEventListener("resize", update);- }, []);+ // oxlint-disable-next-line react/set-state-in-effect -- the viewport is an external system: there is no width to derive during render, it has to be read after mount+ setWidth(window.innerWidth);++ window.addEventListener("resize", handleResize);+ return () => {+ handleResize.cancel();+ return window.removeEventListener("resize", handleResize);+ };+ }, [handleResize]);if (width === 0 || hidden) return null;@@ -36,8 +52,11 @@ export function ResponsiveIndicator() {: "XS";return (- <div- onClick={() => setHidden(true)}+ <button+ type="button"+ onClick={() => {+ return setHidden(true);+ }}className="fixed left-2 top-2 z-[9999] flex cursor-pointer items-center gap-1 rounded-md bg-blue-600/90 px-2 py-1 font-mono text-xs text-white shadow-lg duration-300 animate-in fade-in slide-in-from-left-2"data-info="responsive-indicator"title="Click to hide"@@ -45,6 +64,6 @@ export function ResponsiveIndicator() {<span className="font-bold">{breakpoint}</span><span className="text-blue-200">|</span><span>{width}px</span>- </div>+ </button>);}diff --git a/src/components/dev/sentry-indicator.tsx b/src/components/dev/sentry-indicator.tsxnew file mode 100644index 0000000..164c159--- /dev/null+++ b/src/components/dev/sentry-indicator.tsx@@ -0,0 +1,65 @@+"use client";++import * as Sentry from "@sentry/nextjs";+import { useState, useSyncExternalStore } from "react";++/**+ * `Sentry.isInitialized()` is decided once, at client startup, and never changes+ * afterwards — there is nothing to subscribe to. The store exists only to defer the+ * read to the client: the server render has no browser SDK, so reading it during+ * render would be a hydration mismatch.+ */+function subscribeToNothing() {+ return unsubscribeFromNothing;+}++function unsubscribeFromNothing() {+ // nothing to clean up+}++function getIsSentryInitialized() {+ return Sentry.isInitialized();+}++function getServerSnapshot() {+ return false;+}++/**+ * **Development-only** badge shown while the browser Sentry SDK is live.+ *+ * An enabled SDK is invisible until something turns up in the dashboard, so it is easy+ * to forget the flag is on and spend the afternoon posting your own debugging noise to+ * the project. Sits under {@link ResponsiveIndicator} and hides on click, same as it.+ */+export function SentryIndicator() {+ const isSentryInitialized = useSyncExternalStore(+ subscribeToNothing,+ getIsSentryInitialized,+ getServerSnapshot,+ );++ const [hidden, setHidden] = useState(false);++ if (!isSentryInitialized || hidden) return null;++ return (+ <button+ type="button"+ onClick={() => {+ return setHidden(true);+ }}+ className="fixed left-2 top-10 z-[9999] flex cursor-pointer items-center gap-1 rounded-md bg-[#362d59]/90 px-2 py-1 font-mono text-xs text-white shadow-lg duration-300 animate-in fade-in slide-in-from-left-2"+ data-info="sentry-indicator"+ title={`Sentry is ON: errors from this session go to your Sentry project. Set NEXT_PUBLIC_SENTRY_ENABLED="false" in .env.local to stop. Click to hide.`}+ >+ <span+ className="size-1.5 shrink-0 animate-pulse rounded-full bg-red-400"+ aria-hidden="true"+ />+ <span className="font-bold">SENTRY</span>+ <span className="text-purple-300">|</span>+ <span>ON</span>+ </button>+ );+}diff --git a/src/components/github-star-cta.tsx b/src/components/github-star-cta.tsxindex 5619b2e..1814997 100644--- a/src/components/github-star-cta.tsx+++ b/src/components/github-star-cta.tsx@@ -1,22 +1,24 @@"use client";+import { Star } from "lucide-react";+import { GITHUB_URL } from "@/config";import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";-import { Star } from "lucide-react";+import { cn } from "@/lib/utils";+import { githubStarCountFormatter } from "@/utils/number-formatter";+import { GithubIcon } from "./etc/github-logo";import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";-import { githubStarCountFormatter } from "@/utils/number-formatter";-import { cn } from "@/lib/utils";++const handleStarClick = () => {+ umamiTrackEvent("github_star_cta_clicked");+};export function GitHubStarCTA({githubStarsCount = 0,}: {githubStarsCount: number;}) {- const handleStarClick = () => {- umamiTrackEvent("github_star_cta_clicked");- };-const gitHubStarCountFormatted = githubStarCountFormatter.format(githubStarsCount).toLowerCase();diff --git a/src/components/ui/accordion.tsx b/src/components/ui/accordion.tsxindex 7ab31d5..0976a04 100644--- a/src/components/ui/accordion.tsx+++ b/src/components/ui/accordion.tsx@@ -1,63 +1,70 @@"use client";-import * as React from "react";import * as AccordionPrimitive from "@radix-ui/react-accordion";import { ChevronDown } from "lucide-react";+import * as React from "react";import { cn } from "@/lib/utils";+import { CustomTooltip } from "./tooltip";const Accordion = AccordionPrimitive.Root;const AccordionItem = React.forwardRef<- React.ElementRef<typeof AccordionPrimitive.Item>,+ React.ComponentRef<typeof AccordionPrimitive.Item>,React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>->(({ className, ...props }, ref) => (- <AccordionPrimitive.Item- ref={ref}- className={cn("border-b", className)}- {...props}- />-));+>(({ className, ...props }, ref) => {+ return (+ <AccordionPrimitive.Item+ ref={ref}+ className={cn("border-b", className)}+ {...props}+ />+ );+});AccordionItem.displayName = "AccordionItem";const AccordionTrigger = React.forwardRef<- React.ElementRef<typeof AccordionPrimitive.Trigger>,+ React.ComponentRef<typeof AccordionPrimitive.Trigger>,React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>->(({ className, children, ...props }, ref) => (- <AccordionPrimitive.Header className="flex">- <AccordionPrimitive.Trigger- ref={ref}- className={cn(- "group flex flex-1 items-center justify-between py-4 font-medium transition-all",- className,- )}- {...props}- >- {children}- <CustomTooltip- trigger={- <ChevronDown className="size-6 shrink-0 rounded-full bg-gray-200/70 p-1 transition-all duration-200 group-hover:bg-gray-200 group-data-[state=open]:rotate-180" />- }- content="Expand/Collapse Section"- />- </AccordionPrimitive.Trigger>- </AccordionPrimitive.Header>-));+>(({ className, children, ...props }, ref) => {+ return (+ <AccordionPrimitive.Header className="flex">+ <AccordionPrimitive.Trigger+ ref={ref}+ className={cn(+ "group flex flex-1 items-center justify-between py-4 font-medium transition-all",+ className,+ )}+ {...props}+ >+ {children}+ <CustomTooltip+ trigger={+ <ChevronDown className="size-6 shrink-0 rounded-full bg-gray-200/70 p-1 transition-all duration-200 group-hover:bg-gray-200 group-data-[state=open]:rotate-180" />+ }+ content="Expand/Collapse Section"+ />+ </AccordionPrimitive.Trigger>+ </AccordionPrimitive.Header>+ );+});AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;const AccordionContent = React.forwardRef<- React.ElementRef<typeof AccordionPrimitive.Content>,+ React.ComponentRef<typeof AccordionPrimitive.Content>,React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>->(({ className, children, ...props }, ref) => (- <AccordionPrimitive.Content- ref={ref}- className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"- {...props}- >- <div className={cn("pb-4 pt-0", className)}>{children}</div>- </AccordionPrimitive.Content>-));+>(({ className, children, ...props }, ref) => {+ return (+ <AccordionPrimitive.Content+ ref={ref}+ className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"+ {...props}+ >+ <div className={cn("pb-4 pt-0", className)}>{children}</div>+ </AccordionPrimitive.Content>+ );+});AccordionContent.displayName = AccordionPrimitive.Content.displayName;diff --git a/src/components/ui/alert-dialog.tsx b/src/components/ui/alert-dialog.tsxindex b446927..7e8831c 100644--- a/src/components/ui/alert-dialog.tsx+++ b/src/components/ui/alert-dialog.tsx@@ -3,8 +3,8 @@import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";import * as React from "react";-import { cn } from "@/lib/utils";import { buttonVariants } from "@/components/ui/button";+import { cn } from "@/lib/utils";const AlertDialog = AlertDialogPrimitive.Root;@@ -13,117 +13,133 @@ const AlertDialogTrigger = AlertDialogPrimitive.Trigger;const AlertDialogPortal = AlertDialogPrimitive.Portal;const AlertDialogOverlay = React.forwardRef<- React.ElementRef<typeof AlertDialogPrimitive.Overlay>,+ React.ComponentRef<typeof AlertDialogPrimitive.Overlay>,React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>->(({ className, ...props }, ref) => (- <AlertDialogPrimitive.Overlay- className={cn(- "fixed inset-0 z-[200] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",- className,- )}- {...props}- ref={ref}- />-));-AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;--const AlertDialogContent = React.forwardRef<- React.ElementRef<typeof AlertDialogPrimitive.Content>,- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>->(({ className, ...props }, ref) => (- <AlertDialogPortal>- <AlertDialogOverlay />- <AlertDialogPrimitive.Content- ref={ref}+>(({ className, ...props }, ref) => {+ return (+ <AlertDialogPrimitive.OverlayclassName={cn(- "fixed left-1/2 top-1/2 z-[200] grid max-h-[calc(100%-4rem)] w-full -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto border border-slate-200 bg-white p-6 shadow-lg shadow-black/5 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] dark:border-slate-800 dark:bg-slate-950 sm:max-w-[400px] sm:rounded-xl",+ "fixed inset-0 z-[200] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",className,)}{...props}+ ref={ref}/>- </AlertDialogPortal>-));+ );+});+AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;++const AlertDialogContent = React.forwardRef<+ React.ComponentRef<typeof AlertDialogPrimitive.Content>,+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>+>(({ className, ...props }, ref) => {+ return (+ <AlertDialogPortal>+ <AlertDialogOverlay />+ <AlertDialogPrimitive.Content+ ref={ref}+ className={cn(+ "fixed left-1/2 top-1/2 z-[200] grid max-h-[calc(100%-4rem)] w-full -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto border border-slate-200 bg-white p-6 shadow-lg shadow-black/5 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] dark:border-slate-800 dark:bg-slate-950 sm:max-w-[400px] sm:rounded-xl",+ className,+ )}+ {...props}+ />+ </AlertDialogPortal>+ );+});AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;const AlertDialogHeader = ({className,...props-}: React.HTMLAttributes<HTMLDivElement>) => (- <div- className={cn(- "flex flex-col space-y-1 text-center sm:text-left",- className,- )}- {...props}- />-);+}: React.HTMLAttributes<HTMLDivElement>) => {+ return (+ <div+ className={cn(+ "flex flex-col space-y-1 text-center sm:text-left",+ className,+ )}+ {...props}+ />+ );+};AlertDialogHeader.displayName = "AlertDialogHeader";const AlertDialogFooter = ({className,...props-}: React.HTMLAttributes<HTMLDivElement>) => (- <div- className={cn(- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-3",- className,- )}- {...props}- />-);+}: React.HTMLAttributes<HTMLDivElement>) => {+ return (+ <div+ className={cn(+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-3",+ className,+ )}+ {...props}+ />+ );+};AlertDialogFooter.displayName = "AlertDialogFooter";const AlertDialogTitle = React.forwardRef<- React.ElementRef<typeof AlertDialogPrimitive.Title>,+ React.ComponentRef<typeof AlertDialogPrimitive.Title>,React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>->(({ className, ...props }, ref) => (- <AlertDialogPrimitive.Title- ref={ref}- className={cn("text-lg font-semibold", className)}- {...props}- />-));+>(({ className, ...props }, ref) => {+ return (+ <AlertDialogPrimitive.Title+ ref={ref}+ className={cn("text-lg font-semibold", className)}+ {...props}+ />+ );+});AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;const AlertDialogDescription = React.forwardRef<- React.ElementRef<typeof AlertDialogPrimitive.Description>,+ React.ComponentRef<typeof AlertDialogPrimitive.Description>,React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>->(({ className, ...props }, ref) => (- <AlertDialogPrimitive.Description- ref={ref}- className={cn("text-sm text-slate-500 dark:text-slate-400", className)}- {...props}- />-));+>(({ className, ...props }, ref) => {+ return (+ <AlertDialogPrimitive.Description+ ref={ref}+ className={cn("text-sm text-slate-500 dark:text-slate-400", className)}+ {...props}+ />+ );+});AlertDialogDescription.displayName =AlertDialogPrimitive.Description.displayName;const AlertDialogAction = React.forwardRef<- React.ElementRef<typeof AlertDialogPrimitive.Action>,+ React.ComponentRef<typeof AlertDialogPrimitive.Action>,React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>->(({ className, ...props }, ref) => (- <AlertDialogPrimitive.Action- ref={ref}- className={cn(buttonVariants(), className)}- {...props}- />-));+>(({ className, ...props }, ref) => {+ return (+ <AlertDialogPrimitive.Action+ ref={ref}+ className={cn(buttonVariants(), className)}+ {...props}+ />+ );+});AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;const AlertDialogCancel = React.forwardRef<- React.ElementRef<typeof AlertDialogPrimitive.Cancel>,+ React.ComponentRef<typeof AlertDialogPrimitive.Cancel>,React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>->(({ className, ...props }, ref) => (- <AlertDialogPrimitive.Cancel- ref={ref}- className={cn(- buttonVariants({ variant: "outline" }),- "mt-2 sm:mt-0",- className,- )}- {...props}- />-));+>(({ className, ...props }, ref) => {+ return (+ <AlertDialogPrimitive.Cancel+ ref={ref}+ className={cn(+ buttonVariants({ variant: "outline" }),+ "mt-2 sm:mt-0",+ className,+ )}+ {...props}+ />+ );+});AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;export {diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsxindex 3aa69f7..73f2c2b 100644--- a/src/components/ui/badge.tsx+++ b/src/components/ui/badge.tsx@@ -1,5 +1,5 @@-import * as React from "react";import { cva, type VariantProps } from "class-variance-authority";+import * as React from "react";import { cn } from "@/lib/utils";@@ -24,7 +24,8 @@ const badgeVariants = cva();export interface BadgeProps- extends React.HTMLAttributes<HTMLDivElement>,+ extends+ React.HTMLAttributes<HTMLDivElement>,VariantProps<typeof badgeVariants> {}function Badge({ className, variant, ...props }: BadgeProps) {diff --git a/src/components/ui/button-helper.tsx b/src/components/ui/button-helper.tsxindex 7ae1dd8..7a908ec 100644--- a/src/components/ui/button-helper.tsx+++ b/src/components/ui/button-helper.tsx@@ -1,5 +1,5 @@-import { cn } from "@/lib/utils";import { Button } from "@/components/ui/button";+import { cn } from "@/lib/utils";export const ButtonHelper = ({children,diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsxindex edbabbb..c2f37d3 100644--- a/src/components/ui/button.tsx+++ b/src/components/ui/button.tsx@@ -5,7 +5,7 @@ import * as React from "react";import { cn } from "@/lib/utils";const buttonVariants = cva(- "inline-flex items-center justify-center whitespace-nowrap rounded-lg text-sm font-medium transition-colors outline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring/70 disabled:opacity-50 disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:shrink-0 [&[data-disabled=true]]:opacity-50 active:scale-[98%] active:transition-transform",+ "inline-flex items-center justify-center whitespace-nowrap rounded-lg text-sm font-medium outline-offset-2 transition-colors focus-visible:outline focus-visible:outline-2 active:scale-[98%] active:transition-transform disabled:cursor-not-allowed disabled:opacity-50 [&[data-disabled=true]]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants: {variant: {@@ -36,7 +36,8 @@ const buttonVariants = cva();export interface ButtonProps- extends React.ButtonHTMLAttributes<HTMLButtonElement>,+ extends+ React.ButtonHTMLAttributes<HTMLButtonElement>,VariantProps<typeof buttonVariants> {asChild?: boolean;}diff --git a/src/components/ui/carousel.tsx b/src/components/ui/carousel.tsxindex 0398bb1..1ef6a22 100644--- a/src/components/ui/carousel.tsx+++ b/src/components/ui/carousel.tsx@@ -1,10 +1,11 @@+// oxlint-disable react-you-might-not-need-an-effect/no-pass-data-to-parent react-you-might-not-need-an-effect/no-event-handler react/set-state-in-effect"use client";-import { ArrowLeft, ArrowRight } from "lucide-react";-import * as React from "react";import useEmblaCarousel, {type UseEmblaCarouselType,} from "embla-carousel-react";+import { ArrowLeft, ArrowRight } from "lucide-react";+import * as React from "react";import { Button } from "@/components/ui/button";import { cn } from "@/lib/utils";@@ -75,8 +76,12 @@ const Carousel = React.forwardRef<setCanScrollNext(carouselApi.canScrollNext());}, []);- const scrollPrev = React.useCallback(() => api?.scrollPrev(), [api]);- const scrollNext = React.useCallback(() => api?.scrollNext(), [api]);+ const scrollPrev = React.useCallback(() => {+ return api?.scrollPrev();+ }, [api]);+ const scrollNext = React.useCallback(() => {+ return api?.scrollNext();+ }, [api]);const handleKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLDivElement>) => {diff --git a/src/components/ui/command.tsx b/src/components/ui/command.tsxindex d7955a1..fb4aebb 100644--- a/src/components/ui/command.tsx+++ b/src/components/ui/command.tsx@@ -1,26 +1,28 @@"use client";-import * as React from "react";import { type DialogProps } from "@radix-ui/react-dialog";import { Command as CommandPrimitive } from "cmdk";import { Search } from "lucide-react";+import * as React from "react";-import { cn } from "@/lib/utils";import { Dialog, DialogContent } from "@/components/ui/dialog";+import { cn } from "@/lib/utils";const Command = React.forwardRef<- React.ElementRef<typeof CommandPrimitive>,+ React.ComponentRef<typeof CommandPrimitive>,React.ComponentPropsWithoutRef<typeof CommandPrimitive>->(({ className, ...props }, ref) => (- <CommandPrimitive- ref={ref}- className={cn(- "flex h-full w-full flex-col overflow-hidden rounded-md bg-white text-slate-950 dark:bg-slate-950 dark:text-slate-50",- className,- )}- {...props}- />-));+>(({ className, ...props }, ref) => {+ return (+ <CommandPrimitive+ ref={ref}+ className={cn(+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-white text-slate-950 dark:bg-slate-950 dark:text-slate-50",+ className,+ )}+ {...props}+ />+ );+});Command.displayName = CommandPrimitive.displayName;const CommandDialog = ({ children, ...props }: DialogProps) => {@@ -36,91 +38,106 @@ const CommandDialog = ({ children, ...props }: DialogProps) => {};const CommandInput = React.forwardRef<- React.ElementRef<typeof CommandPrimitive.Input>,+ React.ComponentRef<typeof CommandPrimitive.Input>,React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>->(({ className, ...props }, ref) => (- <div className="flex items-center border-b px-3" cmdk-input-wrapper="">- <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />- <CommandPrimitive.Input+>(({ className, ...props }, ref) => {+ return (+ <div className="flex items-center border-b px-3" cmdk-input-wrapper="">+ <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />+ <CommandPrimitive.Input+ ref={ref}+ className={cn(+ "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-slate-500 disabled:cursor-not-allowed disabled:opacity-50 dark:placeholder:text-slate-400",+ className,+ )}+ {...props}+ />+ </div>+ );+});++CommandInput.displayName = CommandPrimitive.Input.displayName;++const CommandList = React.forwardRef<+ React.ComponentRef<typeof CommandPrimitive.List>,+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>+>(({ className, ...props }, ref) => {+ return (+ <CommandPrimitive.Listref={ref}className={cn(- "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-slate-500 disabled:cursor-not-allowed disabled:opacity-50 dark:placeholder:text-slate-400",+ "max-h-[300px] overflow-y-auto overflow-x-hidden",className,)}{...props}/>- </div>-));--CommandInput.displayName = CommandPrimitive.Input.displayName;--const CommandList = React.forwardRef<- React.ElementRef<typeof CommandPrimitive.List>,- React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>->(({ className, ...props }, ref) => (- <CommandPrimitive.List- ref={ref}- className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}- {...props}- />-));+ );+});CommandList.displayName = CommandPrimitive.List.displayName;const CommandEmpty = React.forwardRef<- React.ElementRef<typeof CommandPrimitive.Empty>,+ React.ComponentRef<typeof CommandPrimitive.Empty>,React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>->((props, ref) => (- <CommandPrimitive.Empty- ref={ref}- className="py-6 text-center text-sm"- {...props}- />-));+>((props, ref) => {+ return (+ <CommandPrimitive.Empty+ ref={ref}+ className="py-6 text-center text-sm"+ {...props}+ />+ );+});CommandEmpty.displayName = CommandPrimitive.Empty.displayName;const CommandGroup = React.forwardRef<- React.ElementRef<typeof CommandPrimitive.Group>,+ React.ComponentRef<typeof CommandPrimitive.Group>,React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>->(({ className, ...props }, ref) => (- <CommandPrimitive.Group- ref={ref}- className={cn(- "overflow-hidden p-1 text-slate-950 dark:text-slate-50 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-slate-500 dark:[&_[cmdk-group-heading]]:text-slate-400",- className,- )}- {...props}- />-));+>(({ className, ...props }, ref) => {+ return (+ <CommandPrimitive.Group+ ref={ref}+ className={cn(+ "overflow-hidden p-1 text-slate-950 dark:text-slate-50 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-slate-500 dark:[&_[cmdk-group-heading]]:text-slate-400",+ className,+ )}+ {...props}+ />+ );+});CommandGroup.displayName = CommandPrimitive.Group.displayName;const CommandSeparator = React.forwardRef<- React.ElementRef<typeof CommandPrimitive.Separator>,+ React.ComponentRef<typeof CommandPrimitive.Separator>,React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>->(({ className, ...props }, ref) => (- <CommandPrimitive.Separator- ref={ref}- className={cn("-mx-1 h-px bg-slate-200 dark:bg-slate-800", className)}- {...props}- />-));+>(({ className, ...props }, ref) => {+ return (+ <CommandPrimitive.Separator+ ref={ref}+ className={cn("-mx-1 h-px bg-slate-200 dark:bg-slate-800", className)}+ {...props}+ />+ );+});CommandSeparator.displayName = CommandPrimitive.Separator.displayName;const CommandItem = React.forwardRef<- React.ElementRef<typeof CommandPrimitive.Item>,+ React.ComponentRef<typeof CommandPrimitive.Item>,React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>->(({ className, ...props }, ref) => (- <CommandPrimitive.Item- ref={ref}- className={cn(- "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-slate-100 data-[selected=true]:text-slate-900 data-[disabled=true]:opacity-50 dark:data-[selected='true']:bg-slate-800 dark:data-[selected=true]:text-slate-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",- className,- )}- {...props}- />-));+>(({ className, ...props }, ref) => {+ return (+ <CommandPrimitive.Item+ ref={ref}+ className={cn(+ "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-slate-100 data-[selected=true]:text-slate-900 data-[disabled=true]:opacity-50 dark:data-[selected='true']:bg-slate-800 dark:data-[selected=true]:text-slate-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",+ className,+ )}+ {...props}+ />+ );+});CommandItem.displayName = CommandPrimitive.Item.displayName;diff --git a/src/components/ui/dialog.tsx b/src/components/ui/dialog.tsxindex 143ac87..a7463a9 100644--- a/src/components/ui/dialog.tsx+++ b/src/components/ui/dialog.tsx@@ -15,101 +15,113 @@ const DialogPortal = DialogPrimitive.Portal;const DialogClose = DialogPrimitive.Close;const DialogOverlay = React.forwardRef<- React.ElementRef<typeof DialogPrimitive.Overlay>,+ React.ComponentRef<typeof DialogPrimitive.Overlay>,React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>->(({ className, ...props }, ref) => (- <DialogPrimitive.Overlay- ref={ref}- className={cn(- "fixed inset-0 z-[101] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",- className,- )}- {...props}- />-));-DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;--const DialogContent = React.forwardRef<- React.ElementRef<typeof DialogPrimitive.Content>,- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>->(({ className, children, ...props }, ref) => (- <DialogPortal>- <DialogOverlay />- <DialogPrimitive.Content+>(({ className, ...props }, ref) => {+ return (+ <DialogPrimitive.Overlayref={ref}className={cn(- "fixed left-1/2 top-1/2 z-[101] grid max-h-[calc(100%-4rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-xl border border-slate-200 bg-white p-6 shadow-lg shadow-black/5 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] dark:border-slate-800 dark:bg-slate-950 sm:max-w-[400px] sm:rounded-xl",+ "fixed inset-0 z-[101] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",className,)}{...props}- >- {children}- <DialogPrimitive.Close- className="focus-visible:outline-ring/70 group absolute right-3 top-3 flex size-7 items-center justify-center rounded-lg outline-offset-2 transition-colors focus-visible:outline focus-visible:outline-2 disabled:pointer-events-none"- title="Close"+ />+ );+});+DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;++const DialogContent = React.forwardRef<+ React.ComponentRef<typeof DialogPrimitive.Content>,+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>+>(({ className, children, ...props }, ref) => {+ return (+ <DialogPortal>+ <DialogOverlay />+ <DialogPrimitive.Content+ ref={ref}+ className={cn(+ "fixed left-1/2 top-1/2 z-[101] grid max-h-[calc(100%-4rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-xl border border-slate-200 bg-white p-6 shadow-lg shadow-black/5 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] dark:border-slate-800 dark:bg-slate-950 sm:max-w-[400px] sm:rounded-xl",+ className,+ )}+ {...props}>- <X- size={18}- strokeWidth={2}- className="opacity-60 transition-opacity group-hover:opacity-100"- />- <span className="sr-only">Close</span>- </DialogPrimitive.Close>- </DialogPrimitive.Content>- </DialogPortal>-));+ {children}+ <DialogPrimitive.Close+ className="focus-visible:outline-ring/70 group absolute right-3 top-3 flex size-7 items-center justify-center rounded-lg outline-offset-2 transition-colors focus-visible:outline focus-visible:outline-2 disabled:pointer-events-none"+ title="Close"+ >+ <X+ size={18}+ strokeWidth={2}+ className="opacity-60 transition-opacity group-hover:opacity-100"+ />+ <span className="sr-only">Close</span>+ </DialogPrimitive.Close>+ </DialogPrimitive.Content>+ </DialogPortal>+ );+});DialogContent.displayName = DialogPrimitive.Content.displayName;const DialogHeader = ({className,...props-}: React.HTMLAttributes<HTMLDivElement>) => (- <div- className={cn(- "flex flex-col space-y-1.5 text-center sm:text-left",- className,- )}- {...props}- />-);+}: React.HTMLAttributes<HTMLDivElement>) => {+ return (+ <div+ className={cn(+ "flex flex-col space-y-1.5 text-center sm:text-left",+ className,+ )}+ {...props}+ />+ );+};DialogHeader.displayName = "DialogHeader";const DialogFooter = ({className,...props-}: React.HTMLAttributes<HTMLDivElement>) => (- <div- className={cn(- "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:gap-3",- className,- )}- {...props}- />-);+}: React.HTMLAttributes<HTMLDivElement>) => {+ return (+ <div+ className={cn(+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:gap-3",+ className,+ )}+ {...props}+ />+ );+};DialogFooter.displayName = "DialogFooter";const DialogTitle = React.forwardRef<- React.ElementRef<typeof DialogPrimitive.Title>,+ React.ComponentRef<typeof DialogPrimitive.Title>,React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>->(({ className, ...props }, ref) => (- <DialogPrimitive.Title- ref={ref}- className={cn("text-lg font-semibold tracking-tight", className)}- {...props}- />-));+>(({ className, ...props }, ref) => {+ return (+ <DialogPrimitive.Title+ ref={ref}+ className={cn("text-lg font-semibold tracking-tight", className)}+ {...props}+ />+ );+});DialogTitle.displayName = DialogPrimitive.Title.displayName;const DialogDescription = React.forwardRef<- React.ElementRef<typeof DialogPrimitive.Description>,+ React.ComponentRef<typeof DialogPrimitive.Description>,React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>->(({ className, ...props }, ref) => (- <DialogPrimitive.Description- ref={ref}- className={cn("text-sm text-slate-500 dark:text-slate-400", className)}- {...props}- />-));+>(({ className, ...props }, ref) => {+ return (+ <DialogPrimitive.Description+ ref={ref}+ className={cn("text-sm text-slate-500 dark:text-slate-400", className)}+ {...props}+ />+ );+});DialogDescription.displayName = DialogPrimitive.Description.displayName;export {diff --git a/src/components/ui/dropdown-menu.tsx b/src/components/ui/dropdown-menu.tsxindex ea9f6da..2a02c3d 100644--- a/src/components/ui/dropdown-menu.tsx+++ b/src/components/ui/dropdown-menu.tsx@@ -1,8 +1,8 @@"use client";-import * as React from "react";import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";+import * as React from "react";import { cn } from "@/lib/utils";diff --git a/src/components/ui/form.tsx b/src/components/ui/form.tsxindex 6c68d77..c7e417c 100644--- a/src/components/ui/form.tsx+++ b/src/components/ui/form.tsx@@ -1,8 +1,8 @@"use client";-import * as React from "react";import type * as LabelPrimitive from "@radix-ui/react-label";import { Slot } from "@radix-ui/react-slot";+import * as React from "react";import {Controller,type ControllerProps,@@ -12,8 +12,8 @@ import {useFormContext,} from "react-hook-form";-import { cn } from "@/lib/utils";import { Label } from "@/components/ui/label";+import { cn } from "@/lib/utils";const Form = FormProvider;@@ -87,7 +87,7 @@ const FormItem = React.forwardRef<FormItem.displayName = "FormItem";const FormLabel = React.forwardRef<- React.ElementRef<typeof LabelPrimitive.Root>,+ React.ComponentRef<typeof LabelPrimitive.Root>,React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>>(({ className, ...props }, ref) => {const { error, formItemId } = useFormField();@@ -104,7 +104,7 @@ const FormLabel = React.forwardRef<FormLabel.displayName = "FormLabel";const FormControl = React.forwardRef<- React.ElementRef<typeof Slot>,+ React.ComponentRef<typeof Slot>,React.ComponentPropsWithoutRef<typeof Slot>>(({ ...props }, ref) => {const { error, formItemId, formDescriptionId, formMessageId } =@@ -115,9 +115,7 @@ const FormControl = React.forwardRef<ref={ref}id={formItemId}aria-describedby={- !error- ? `${formDescriptionId}`- : `${formDescriptionId} ${formMessageId}`+ !error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}aria-invalid={!!error}{...props}diff --git a/src/components/ui/input.tsx b/src/components/ui/input.tsxindex 23470b8..6f9e3af 100644--- a/src/components/ui/input.tsx+++ b/src/components/ui/input.tsx@@ -1,6 +1,7 @@-import { cn } from "@/lib/utils";import * as React from "react";+import { cn } from "@/lib/utils";+const Input = React.memo(React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(({ className, type, ...props }, ref) => {diff --git a/src/components/ui/label.tsx b/src/components/ui/label.tsxindex 86d3190..afeb3c8 100644--- a/src/components/ui/label.tsx+++ b/src/components/ui/label.tsx@@ -8,16 +8,19 @@ const Label = React.memo(React.forwardRef<HTMLLabelElement,React.LabelHTMLAttributes<HTMLLabelElement>- >(({ className, ...props }, ref) => (- <label- ref={ref}- className={cn(- "block text-pretty text-xs font-medium text-gray-900 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:text-slate-50",- className,- )}- {...props}- />- )),+ >(({ className, ...props }, ref) => {+ return (+ // oxlint-disable-next-line jsx-a11y/label-has-associated-control -- primitive wrapper; callers pass `htmlFor`+ <label+ ref={ref}+ className={cn(+ "block text-pretty text-xs font-medium text-gray-900 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:text-slate-50",+ className,+ )}+ {...props}+ />+ );+ }),);Label.displayName = "Label";diff --git a/src/components/ui/money-input.tsx b/src/components/ui/money-input.tsxindex 81de0a1..876ab47 100644--- a/src/components/ui/money-input.tsx+++ b/src/components/ui/money-input.tsx@@ -1,5 +1,5 @@import * as React from "react";-import { Input } from "./input";+import {CURRENCY_SYMBOLS,SUPPORTED_CURRENCIES,@@ -8,6 +8,8 @@ import {} from "@/app/schema";import { cn } from "@/lib/utils";+import { Input } from "./input";+function getCurrencyPadding(currencySymbol: CurrencySymbols) {if (!currencySymbol) return "ps-3";diff --git a/src/components/ui/multi-select.tsx b/src/components/ui/multi-select.tsxindex d4ca7c8..2ab4b94 100644--- a/src/components/ui/multi-select.tsx+++ b/src/components/ui/multi-select.tsx@@ -1,18 +1,12 @@// src/components/multi-select.tsx-import * as React from "react";import { cva, type VariantProps } from "class-variance-authority";import { CheckIcon, XCircle, ChevronDown } from "lucide-react";+import * as React from "react";-import { cn } from "@/lib/utils";-import { Separator } from "@/components/ui/separator";-import { Button } from "@/components/ui/button";+import { LANGUAGE_TO_LABEL, type SupportedLanguages } from "@/app/schema";import { Badge } from "@/components/ui/badge";-import {- Popover,- PopoverContent,- PopoverTrigger,-} from "@/components/ui/popover";+import { Button } from "@/components/ui/button";import {Command,CommandEmpty,@@ -22,8 +16,14 @@ import {CommandList,CommandSeparator,} from "@/components/ui/command";-import { LANGUAGE_TO_LABEL } from "@/app/schema";-import type { SupportedLanguages } from "@/app/schema";+import {+ Popover,+ PopoverContent,+ PopoverTrigger,+} from "@/components/ui/popover";+import { Separator } from "@/components/ui/separator";+import { cn } from "@/lib/utils";+import { CustomTooltip } from "./tooltip";/**@@ -31,16 +31,16 @@ import { CustomTooltip } from "./tooltip";* Uses class-variance-authority (cva) to define different styles based on "variant" prop.*/const multiSelectVariants = cva(- "m-1 transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300",+ "m-1 transition delay-150 duration-300 ease-in-out hover:-translate-y-1 hover:scale-110",{variants: {variant: {default:- "border-foreground/10 text-foreground bg-card hover:bg-card/80",+ "border-foreground/10 bg-card hover:bg-card/80 text-foreground",secondary:"border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:- "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",+ "bg-destructive text-destructive-foreground hover:bg-destructive/80 border-transparent",inverted: "inverted",},},@@ -54,7 +54,8 @@ const multiSelectVariants = cva(* Props for MultiSelect component*/interface MultiSelectProps- extends React.ButtonHTMLAttributes<HTMLButtonElement>,+ extends+ React.ButtonHTMLAttributes<HTMLButtonElement>,VariantProps<typeof multiSelectVariants> {/*** An array of option objects to be displayed in the multi-select component.@@ -172,7 +173,9 @@ export const MultiSelect = React.forwardRef<const toggleOption = (option: SupportedLanguages) => {const newSelectedValues = selectedLanguages.includes(option)- ? selectedLanguages.filter((value) => value !== option)+ ? selectedLanguages.filter((value) => {+ return value !== option;+ }): [...selectedLanguages, option];setSelectedLanguages(newSelectedValues);onValueChange(newSelectedValues);@@ -184,7 +187,9 @@ export const MultiSelect = React.forwardRef<};const handleTogglePopover = () => {- setIsPopoverOpen((prev) => !prev);+ setIsPopoverOpen((prev) => {+ return !prev;+ });};const clearExtraOptions = () => {@@ -245,7 +250,7 @@ export const MultiSelect = React.forwardRef<</React.Fragment>);})}- {selectedLanguages.length > maxCount && (+ {selectedLanguages.length > maxCount ? (<BadgeclassName={cn("border-foreground/1 bg-transparent text-foreground hover:bg-transparent",@@ -261,7 +266,7 @@ export const MultiSelect = React.forwardRef<}}/></Badge>- )}+ ) : null}</div></div></Button>@@ -288,7 +293,9 @@ export const MultiSelect = React.forwardRef<<PopoverContentclassName="w-auto p-0"align="start"- onEscapeKeyDown={() => setIsPopoverOpen(false)}+ onEscapeKeyDown={() => {+ return setIsPopoverOpen(false);+ }}><Command><CommandInput@@ -305,9 +312,9 @@ export const MultiSelect = React.forwardRef<return (<CommandItemkey={option.value}- onSelect={() =>- toggleOption(option.value as SupportedLanguages)- }+ onSelect={() => {+ return toggleOption(option.value as SupportedLanguages);+ }}className="cursor-pointer"><div@@ -331,7 +338,7 @@ export const MultiSelect = React.forwardRef<<CommandSeparator /><CommandGroup><div className="flex items-center justify-between gap-1">- {selectedLanguages.length > 0 && (+ {selectedLanguages.length > 0 ? (<><CommandItemonSelect={handleClear}@@ -353,15 +360,17 @@ export const MultiSelect = React.forwardRef<Download</CommandItem></>- )}- {selectedLanguages.length === 0 && (+ ) : null}+ {selectedLanguages.length === 0 ? (<CommandItem- onSelect={() => setIsPopoverOpen(false)}+ onSelect={() => {+ return setIsPopoverOpen(false);+ }}className="max-w-full flex-1 cursor-pointer justify-center">Close</CommandItem>- )}+ ) : null}</div></CommandGroup></CommandList>diff --git a/src/components/ui/popover.tsx b/src/components/ui/popover.tsxindex 4b5d4d3..9b009af 100644--- a/src/components/ui/popover.tsx+++ b/src/components/ui/popover.tsx@@ -1,7 +1,7 @@"use client";-import * as React from "react";import * as PopoverPrimitive from "@radix-ui/react-popover";+import * as React from "react";import { cn } from "@/lib/utils";@@ -10,22 +10,24 @@ const Popover = PopoverPrimitive.Root;const PopoverTrigger = PopoverPrimitive.Trigger;const PopoverContent = React.forwardRef<- React.ElementRef<typeof PopoverPrimitive.Content>,+ React.ComponentRef<typeof PopoverPrimitive.Content>,React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>->(({ className, align = "center", sideOffset = 4, ...props }, ref) => (- <PopoverPrimitive.Portal>- <PopoverPrimitive.Content- ref={ref}- align={align}- sideOffset={sideOffset}- className={cn(- "z-50 w-72 rounded-md border border-slate-200 bg-white p-4 text-slate-950 shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-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 dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50",- className,- )}- {...props}- />- </PopoverPrimitive.Portal>-));+>(({ className, align = "center", sideOffset = 4, ...props }, ref) => {+ return (+ <PopoverPrimitive.Portal>+ <PopoverPrimitive.Content+ ref={ref}+ align={align}+ sideOffset={sideOffset}+ className={cn(+ "z-50 w-72 rounded-md border border-slate-200 bg-white p-4 text-slate-950 shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-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 dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50",+ className,+ )}+ {...props}+ />+ </PopoverPrimitive.Portal>+ );+});PopoverContent.displayName = PopoverPrimitive.Content.displayName;export { Popover, PopoverTrigger, PopoverContent };diff --git a/src/components/ui/select-native.tsx b/src/components/ui/select-native.tsxindex 36302d3..ee2be63 100644--- a/src/components/ui/select-native.tsx+++ b/src/components/ui/select-native.tsx@@ -1,9 +1,9 @@-import { cn } from "@/lib/utils";import { ChevronDown } from "lucide-react";import * as React from "react";-export interface SelectPropsNative- extends React.SelectHTMLAttributes<HTMLSelectElement> {+import { cn } from "@/lib/utils";++export interface SelectPropsNative extends React.SelectHTMLAttributes<HTMLSelectElement> {children: React.ReactNode;}@@ -28,11 +28,11 @@ const SelectNative = React.forwardRef<HTMLSelectElement, SelectPropsNative>(>{children}</select>- {!props.multiple && (+ {!props.multiple ? (<span className="pointer-events-none absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center text-slate-500/80 peer-disabled:opacity-50 dark:text-slate-400/80"><ChevronDown size={16} strokeWidth={2} aria-hidden="true" /></span>- )}+ ) : null}</div>);},diff --git a/src/components/ui/separator.tsx b/src/components/ui/separator.tsxindex d52497a..225c8db 100644--- a/src/components/ui/separator.tsx+++ b/src/components/ui/separator.tsx@@ -1,30 +1,32 @@"use client";-import * as React from "react";import * as SeparatorPrimitive from "@radix-ui/react-separator";+import * as React from "react";import { cn } from "@/lib/utils";const Separator = React.forwardRef<- React.ElementRef<typeof SeparatorPrimitive.Root>,+ React.ComponentRef<typeof SeparatorPrimitive.Root>,React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>>(({ className, orientation = "horizontal", decorative = true, ...props },ref,- ) => (- <SeparatorPrimitive.Root- ref={ref}- decorative={decorative}- orientation={orientation}- className={cn(- "shrink-0 bg-slate-200 dark:bg-slate-800",- orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",- className,- )}- {...props}- />- ),+ ) => {+ return (+ <SeparatorPrimitive.Root+ ref={ref}+ decorative={decorative}+ orientation={orientation}+ className={cn(+ "shrink-0 bg-slate-200 dark:bg-slate-800",+ orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",+ className,+ )}+ {...props}+ />+ );+ },);Separator.displayName = SeparatorPrimitive.Root.displayName;diff --git a/src/components/ui/switch.tsx b/src/components/ui/switch.tsxindex 432b8fc..08446ea 100644--- a/src/components/ui/switch.tsx+++ b/src/components/ui/switch.tsx@@ -10,24 +10,26 @@ import { cn } from "@/lib/utils";*/const Switch = React.memo(React.forwardRef<- React.ElementRef<typeof SwitchPrimitives.Root>,+ React.ComponentRef<typeof SwitchPrimitives.Root>,React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>- >(({ className, ...props }, ref) => (- <SwitchPrimitives.Root- className={cn(- "focus-visible:outline-ring/70 peer inline-flex h-6 w-10 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent outline-offset-2 transition-colors focus-visible:outline focus-visible:outline-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=unchecked]:bg-slate-200 dark:data-[state=checked]:bg-slate-50 dark:data-[state=unchecked]:bg-slate-800",- className,- )}- {...props}- ref={ref}- >- <SwitchPrimitives.Thumb+ >(({ className, ...props }, ref) => {+ return (+ <SwitchPrimitives.RootclassName={cn(- "pointer-events-none block size-5 rounded-full bg-white shadow-sm shadow-black/5 ring-0 transition-transform duration-300 [transition-timing-function:cubic-bezier(0.16,1,0.3,1)] data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0 dark:bg-slate-950 rtl:data-[state=checked]:-translate-x-4",+ "focus-visible:outline-ring/70 peer inline-flex h-6 w-10 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent outline-offset-2 transition-colors focus-visible:outline focus-visible:outline-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=unchecked]:bg-slate-200 dark:data-[state=checked]:bg-slate-50 dark:data-[state=unchecked]:bg-slate-800",+ className,)}- />- </SwitchPrimitives.Root>- )),+ {...props}+ ref={ref}+ >+ <SwitchPrimitives.Thumb+ className={cn(+ "pointer-events-none block size-5 rounded-full bg-white shadow-sm shadow-black/5 ring-0 transition-transform duration-300 [transition-timing-function:cubic-bezier(0.16,1,0.3,1)] data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0 dark:bg-slate-950 rtl:data-[state=checked]:-translate-x-4",+ )}+ />+ </SwitchPrimitives.Root>+ );+ }),);Switch.displayName = SwitchPrimitives.Root.displayName;diff --git a/src/components/ui/toasts/error-generating-pdf-toast.tsx b/src/components/ui/toasts/error-generating-pdf-toast.tsxindex 4c165b0..474acc2 100644--- a/src/components/ui/toasts/error-generating-pdf-toast.tsx+++ b/src/components/ui/toasts/error-generating-pdf-toast.tsx@@ -1,6 +1,11 @@-import { BUG_REPORT_URL, CONTACT_SUPPORT_EMAIL } from "@/config";import { toast } from "sonner";+import { BUG_REPORT_URL, CONTACT_SUPPORT_EMAIL } from "@/config";++/**+ * Displays a toast notification indicating an error occurred while generating a PDF document.+ * Provides troubleshooting steps and contact options for support/bug report.+ */export function ErrorGeneratingPdfToast() {return toast.error(<span>diff --git a/src/components/ui/tooltip.tsx b/src/components/ui/tooltip.tsxindex 4f61626..199a7e4 100644--- a/src/components/ui/tooltip.tsx+++ b/src/components/ui/tooltip.tsx@@ -24,28 +24,30 @@ const TooltipTrigger = React.memo(TooltipPrimitive.Trigger);const TooltipContent = React.memo(React.forwardRef<- React.ElementRef<typeof TooltipPrimitive.Content>,+ React.ComponentRef<typeof TooltipPrimitive.Content>,React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {showArrow?: boolean;}- >(({ className, sideOffset = 4, showArrow = false, ...props }, ref) => (- <TooltipPrimitive.Portal>- <TooltipPrimitive.Content- ref={ref}- sideOffset={sideOffset}- className={cn(- "relative isolate z-[100] max-w-[280px] rounded-lg border border-slate-200 bg-white px-3 py-1.5 text-sm text-slate-950 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-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 dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50",- className,- )}- {...props}- >- {props.children}- {showArrow ? (- <TooltipPrimitive.Arrow className="my-px border-slate-200 fill-white drop-shadow-[0_1px_0_hsl(var(--border))]" />- ) : null}- </TooltipPrimitive.Content>- </TooltipPrimitive.Portal>- )),+ >(({ className, sideOffset = 4, showArrow = false, ...props }, ref) => {+ return (+ <TooltipPrimitive.Portal>+ <TooltipPrimitive.Content+ ref={ref}+ sideOffset={sideOffset}+ className={cn(+ "relative isolate z-[100] max-w-[280px] rounded-lg border border-slate-200 bg-white px-3 py-1.5 text-sm text-slate-950 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-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 dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50",+ className,+ )}+ {...props}+ >+ {props.children}+ {showArrow ? (+ <TooltipPrimitive.Arrow className="my-px border-slate-200 fill-white drop-shadow-[0_1px_0_hsl(var(--border))]" />+ ) : null}+ </TooltipPrimitive.Content>+ </TooltipPrimitive.Portal>+ );+ }),);TooltipContent.displayName = TooltipPrimitive.Content.displayName;@@ -77,8 +79,12 @@ const CustomTooltip = React.memo(const usePopover = popoverOnMobile && !isDesktop;// Memoize both trigger and content- const memoizedTrigger = React.useMemo(() => trigger, [trigger]);- const memoizedContent = React.useMemo(() => content, [content]);+ const memoizedTrigger = React.useMemo(() => {+ return trigger;+ }, [trigger]);+ const memoizedContent = React.useMemo(() => {+ return content;+ }, [content]);if (usePopover) {return (diff --git a/src/components/video.tsx b/src/components/video.tsxindex c92b824..a163a7c 100644--- a/src/components/video.tsx+++ b/src/components/video.tsx@@ -1,9 +1,10 @@"use client";+import { Play } from "lucide-react";import { useEffect, useId, useRef, useState } from "react";import { useInView } from "react-intersection-observer";+import { cn } from "@/lib/utils";-import { Play } from "lucide-react";interface SharedVideoProps extends React.ComponentPropsWithRef<"div"> {src: string;@@ -83,6 +84,7 @@ export function AutoPlayVideo({// - If in viewport and not paused, play the video// - If out of viewport, pause to save resourcesuseEffect(() => {+ // oxlint-disable-next-line react-you-might-not-need-an-effect/no-event-handler -- there is no event to hang this on: `inView` comes from an IntersectionObserver and `srcAdded` tells us the <source> is in the DOM, both of which have to be synchronised with the <video> elementif (!srcAdded) return;if (paused) pauseVideo();@@ -103,7 +105,9 @@ export function AutoPlayVideo({}video.addEventListener("click", handleClick);- return () => video.removeEventListener("click", handleClick);+ return () => {+ return video.removeEventListener("click", handleClick);+ };// eslint-disable-next-line react-hooks/exhaustive-deps}, []);@@ -185,13 +189,17 @@ export function ManualPlayVideo({// Effect: Pauses video when it scrolls out of view// This prevents videos from playing audio/consuming resources when not visible- // Only triggers when video is currently playing to avoid unnecessary operations+ // Pausing an already paused video is a no-op, so this does not check `isPlaying`useEffect(() => {- if (!inView && isPlaying) {- videoRef.current?.pause();- setIsPlaying(false);+ if (inView) {+ return;}- }, [inView, isPlaying]);++ videoRef.current?.pause();++ // oxlint-disable-next-line react/set-state-in-effect -- the <video> element is an external system and `inView` comes from an IntersectionObserver; there is no event here to update this from+ setIsPlaying(false);+ }, [inView]);// Effect: Ensures only one video plays at a time across the page// When any video starts playing, it dispatches a "video-play" event with its unique ID.@@ -211,7 +219,9 @@ export function ManualPlayVideo({window.addEventListener("video-play", handler);// Cleanup: remove listener when component unmounts- return () => window.removeEventListener("video-play", handler);+ return () => {+ return window.removeEventListener("video-play", handler);+ };}, [videoId]);// Handler: Called when user clicks the play button@@ -257,7 +267,7 @@ export function ManualPlayVideo({><source src={src} type="video/mp4" /></video>- {/*+ {/*Play button overlay - only shown when video is not playing*/}{!isPlaying ? (diff --git a/src/contexts/device-context.tsx b/src/contexts/device-context.tsxindex 4511689..5708ddb 100644--- a/src/contexts/device-context.tsx+++ b/src/contexts/device-context.tsx@@ -1,8 +1,9 @@"use client";+import { createContext, useContext, useEffect, useState } from "react";+import { useIsDesktop } from "@/hooks/use-media-query";import type { InAppInfo } from "@/lib/check-device.server";-import { createContext, useContext, useEffect, useState } from "react";interface DeviceContextType {isDesktop: boolean;@@ -48,6 +49,7 @@ export function DeviceContextProvider({*/useEffect(() => {if (isMediaQueryDesktop !== undefined) {+ // eslint-disable-next-line react-hooks/set-state-in-effect, react-you-might-not-need-an-effect/no-derived-statesetIsDesktopClient(isMediaQueryDesktop);}}, [isMediaQueryDesktop]);diff --git a/src/env.ts b/src/env.tsindex d2cb18f..1a41bb7 100644--- a/src/env.ts+++ b/src/env.ts@@ -16,21 +16,21 @@ export const env = createEnv({SELLER_NAME: z.string(),SELLER_ADDRESS: z.string(),SELLER_VAT_NO: z.string(),- SELLER_EMAIL: z.string().email(),+ SELLER_EMAIL: z.email(),SELLER_ACCOUNT_NUMBER: z.string(),SELLER_SWIFT_BIC: z.string(),BUYER_NAME: z.string(),BUYER_ADDRESS: z.string(),BUYER_VAT_NO: z.string(),- BUYER_EMAIL: z.string().email(),+ BUYER_EMAIL: z.email(),INVOICE_NET_PRICE: z.string(),- INVOICE_EMAIL_RECIPIENT: z.string().email(),- INVOICE_EMAIL_COMPANY_TO: z.string().email(),+ INVOICE_EMAIL_RECIPIENT: z.email(),+ INVOICE_EMAIL_COMPANY_TO: z.email(),GOOGLE_DRIVE_PARENT_FOLDER_ID: z.string(),- GOOGLE_DRIVE_CLIENT_EMAIL: z.string().email(),+ GOOGLE_DRIVE_CLIENT_EMAIL: z.email(),GOOGLE_DRIVE_PRIVATE_KEY: z.string(),GITHUB_TOKEN: z.string(),@@ -74,5 +74,9 @@ export const env = createEnv({GITHUB_TOKEN: process.env.GITHUB_TOKEN,},+ // `next typegen` (used by `pnpm type-check` and `pnpm lint`) loads next.config.mjs,+ // which imports this file. CI runs those jobs without runtime secrets, so they set+ // SKIP_ENV_VALIDATION=true. Never set it for `next build` / `next dev`.+ skipValidation: !!process.env.SKIP_ENV_VALIDATION,// emptyStringAsUndefined: true,});diff --git a/src/hooks/use-media-query.tsx b/src/hooks/use-media-query.tsxindex 1bfe1e2..6e5f815 100644--- a/src/hooks/use-media-query.tsx+++ b/src/hooks/use-media-query.tsx@@ -16,11 +16,18 @@ function attachMediaListener() {try {query.addEventListener("change", callback);- return () => query.removeEventListener("change", callback);- // eslint-disable-next-line @typescript-eslint/no-unused-vars- } catch (e: unknown) {+ return () => {+ return query.removeEventListener("change", callback);+ };+ } catch {+ // deprecated on purpose: this is the fallback path for Safari <= Catalina,+ // which has no `addEventListener` on MediaQueryList (see the note above)+ // oxlint-disable-next-line typescript/no-deprecatedquery.addListener(callback);- return () => query.removeListener(callback);+ return () => {+ // oxlint-disable-next-line typescript/no-deprecated+ return query.removeListener(callback);+ };}}@@ -39,10 +46,11 @@ function getInitialValue(query: string, initialValue?: boolean) {function useMediaQuery(query: string,initialValue?: boolean,- { getInitialValueInEffect }: UseMediaQueryOptions = {- getInitialValueInEffect: true,- },+ options?: UseMediaQueryOptions,) {+ const { getInitialValueInEffect } = options ?? {+ getInitialValueInEffect: true,+ };const [matches, setMatches] = useState(getInitialValueInEffect ? initialValue : getInitialValue(query),);@@ -52,9 +60,9 @@ function useMediaQuery(if ("matchMedia" in window) {queryRef.current = window.matchMedia(query);setMatches(queryRef.current.matches);- return attachMediaListener(queryRef.current, (event) =>- setMatches(event.matches),- );+ return attachMediaListener(queryRef.current, (event) => {+ return setMatches(event.matches);+ });}return undefined;diff --git a/src/i18n/navigation.ts b/src/i18n/navigation.tsindex e7a18ea..16c2c39 100644--- a/src/i18n/navigation.ts+++ b/src/i18n/navigation.ts@@ -1,4 +1,5 @@import { createNavigation } from "next-intl/navigation";+import { routing } from "./routing";// Lightweight wrappers around Next.js' navigationdiff --git a/src/i18n/request.ts b/src/i18n/request.tsindex 91dd6bf..c9824df 100644--- a/src/i18n/request.ts+++ b/src/i18n/request.ts@@ -1,7 +1,8 @@-import { getRequestConfig } from "next-intl/server";import { hasLocale } from "next-intl";-import { routing } from "./routing";+import { getRequestConfig } from "next-intl/server";+import type EnMessages from "../../messages/en.json";+import { routing } from "./routing";export default getRequestConfig(async ({ requestLocale }) => {try {@@ -13,7 +14,9 @@ export default getRequestConfig(async ({ requestLocale }) => {: routing.defaultLocale;const messages = await import(`../../messages/${locale}.json`).then(- (module: { default: typeof EnMessages }) => module.default,+ (module: { default: typeof EnMessages }) => {+ return module.default;+ },);return {diff --git a/src/i18n/routing.ts b/src/i18n/routing.tsindex 013b173..42fa6f1 100644--- a/src/i18n/routing.ts+++ b/src/i18n/routing.ts@@ -1,4 +1,5 @@import { defineRouting } from "next-intl/routing";+import { SUPPORTED_LANGUAGES } from "@/app/schema";const defaultLocaleEN = SUPPORTED_LANGUAGES[0];diff --git a/src/instrumentation-client.ts b/src/instrumentation-client.tsnew file mode 100644index 0000000..c21bb95--- /dev/null+++ b/src/instrumentation-client.ts@@ -0,0 +1,42 @@+// This file configures the initialization of Sentry on the client.+// The config you add here will be used whenever a user loads a page in their browser.+// https://docs.sentry.io/platforms/javascript/guides/nextjs/+// https://nextjs.org/docs/app/api-reference/file-conventions/instrumentation-client++import * as Sentry from "@sentry/nextjs";++import { safeLocalStorageGetItem } from "@/lib/safe-local-storage";+import { SENTRY_E2E_DISABLED_STORAGE_KEY } from "@/lib/sentry/sentry-e2e-flags";+import {+ isSentryEnabled,+ logSentryEnabledLocally,+ SENTRY_SHARED_INIT_OPTIONS,+} from "@/lib/sentry/sentry-init-options";++// The Playwright projects seed this key before the first page script runs, so an e2e+// run never boots the SDK (and never burns replay/transaction quota).+const isDisabledByE2eTests =+ safeLocalStorageGetItem(SENTRY_E2E_DISABLED_STORAGE_KEY) === "1";++// Opt-in via `NEXT_PUBLIC_SENTRY_ENABLED`, on every deployment and locally.+if (+ !isDisabledByE2eTests &&+ isSentryEnabled({ enabledFlag: process.env.NEXT_PUBLIC_SENTRY_ENABLED })+) {+ Sentry.init({+ ...SENTRY_SHARED_INIT_OPTIONS,++ // Session Replay is browser-only+ replaysSessionSampleRate: 0.1, // Sample 10% of sessions+ replaysOnErrorSampleRate: 1.0, // But capture all sessions with errors+ });++ logSentryEnabledLocally("browser");+}++// Required by Sentry to instrument client-side router navigations (App Router).+// https://docs.sentry.io/platforms/javascript/guides/nextjs/#step-3-capture-react-render-errors+// @sentry/nextjs ships separate client/server entrypoints and the import resolver+// reads the server one; this export only exists in the browser build.+// oxlint-disable-next-line import/namespace+export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;diff --git a/src/lib/__tests__/is-local-storage-available.test.ts b/src/lib/__tests__/is-local-storage-available.test.tsnew file mode 100644index 0000000..abb61c2--- /dev/null+++ b/src/lib/__tests__/is-local-storage-available.test.ts@@ -0,0 +1,120 @@+// @vitest-environment happy-dom++import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";++const originalDescriptor = Object.getOwnPropertyDescriptor(+ window,+ "localStorage",+);++/** Replaces `window.localStorage` with whatever a hostile environment hands us. */+function stubLocalStorage(get: () => unknown) {+ Object.defineProperty(window, "localStorage", { configurable: true, get });+}++/**+ * The probe memoizes its answer for the lifetime of the module, so every test needs a+ * fresh copy to probe the storage it just stubbed.+ */+async function importFreshProbe() {+ vi.resetModules();++ const { isLocalStorageAvailable } = await import("../safe-local-storage");++ return isLocalStorageAvailable;+}++beforeEach(() => {+ localStorage.clear();+});++afterEach(() => {+ if (originalDescriptor) {+ Object.defineProperty(window, "localStorage", originalDescriptor);+ }+});++describe("isLocalStorageAvailable", () => {+ it("is true for a working store", async () => {+ const isLocalStorageAvailable = await importFreshProbe();++ expect(isLocalStorageAvailable()).toBe(true);+ });++ it("leaves no probe key behind", async () => {+ const isLocalStorageAvailable = await importFreshProbe();++ isLocalStorageAvailable();++ expect(localStorage).toHaveLength(0);+ });++ it("is false when localStorage is null (iOS in-app webview)", async () => {+ stubLocalStorage(() => {+ return null;+ });++ const isLocalStorageAvailable = await importFreshProbe();++ expect(isLocalStorageAvailable()).toBe(false);+ });++ it("is false when the store accepts reads but rejects every write", async () => {+ stubLocalStorage(() => {+ return {+ length: 0,+ getItem() {+ return null;+ },+ setItem() {+ throw new DOMException("Quota exceeded.", "QuotaExceededError");+ },+ };+ });++ const isLocalStorageAvailable = await importFreshProbe();++ expect(isLocalStorageAvailable()).toBe(false);+ });++ it("is true for a full store that already holds data, since the user can free space", async () => {+ stubLocalStorage(() => {+ return {+ length: 3,+ getItem() {+ return null;+ },+ setItem() {+ throw new DOMException("Quota exceeded.", "QuotaExceededError");+ },+ };+ });++ const isLocalStorageAvailable = await importFreshProbe();++ expect(isLocalStorageAvailable()).toBe(true);+ });++ it("probes only once", async () => {+ const setItem = vi.fn();++ stubLocalStorage(() => {+ return {+ length: 0,+ getItem() {+ return null;+ },+ setItem,+ removeItem: vi.fn(),+ };+ });++ const isLocalStorageAvailable = await importFreshProbe();++ isLocalStorageAvailable();+ isLocalStorageAvailable();+ isLocalStorageAvailable();++ expect(setItem).toHaveBeenCalledTimes(1);+ });+});diff --git a/src/lib/__tests__/safe-local-storage.test.ts b/src/lib/__tests__/safe-local-storage.test.tsnew file mode 100644index 0000000..2aa4341--- /dev/null+++ b/src/lib/__tests__/safe-local-storage.test.ts@@ -0,0 +1,98 @@+// @vitest-environment happy-dom++import { afterEach, describe, expect, it } from "vitest";++import {+ safeLocalStorageGetItem,+ safeLocalStorageSetItem,+} from "../safe-local-storage";++const KEY = "TEST_KEY";++const originalDescriptor = Object.getOwnPropertyDescriptor(+ window,+ "localStorage",+);++/** Replaces `window.localStorage` with whatever a hostile environment hands us. */+function stubLocalStorage(get: () => unknown) {+ Object.defineProperty(window, "localStorage", { configurable: true, get });+}++afterEach(() => {+ if (originalDescriptor) {+ Object.defineProperty(window, "localStorage", originalDescriptor);+ } else {+ // @ts-expect-error -- removing the stub falls back to the prototype getter+ delete window.localStorage;+ }++ localStorage.clear();+});++describe("safeLocalStorageGetItem", () => {+ it("reads a stored value", () => {+ localStorage.setItem(KEY, "stored");++ expect(safeLocalStorageGetItem(KEY)).toBe("stored");+ });++ it("returns null for an unset key", () => {+ expect(safeLocalStorageGetItem(KEY)).toBeNull();+ });++ it("returns null when localStorage is null (iOS in-app webview)", () => {+ stubLocalStorage(() => {+ return null;+ });++ expect(safeLocalStorageGetItem(KEY)).toBeNull();+ });++ it("returns null when the property access throws (Safari, cookies blocked)", () => {+ stubLocalStorage(() => {+ throw new DOMException("The operation is insecure.", "SecurityError");+ });++ expect(safeLocalStorageGetItem(KEY)).toBeNull();+ });++ it("returns null when getItem itself throws", () => {+ stubLocalStorage(() => {+ return {+ getItem() {+ throw new Error("nope");+ },+ };+ });++ expect(safeLocalStorageGetItem(KEY)).toBeNull();+ });+});++describe("safeLocalStorageSetItem", () => {+ it("persists a value and reports success", () => {+ expect(safeLocalStorageSetItem({ key: KEY, value: "written" })).toBe(true);+ expect(localStorage.getItem(KEY)).toBe("written");+ });++ it("reports failure when localStorage is null", () => {+ stubLocalStorage(() => {+ return null;+ });++ expect(safeLocalStorageSetItem({ key: KEY, value: "written" })).toBe(false);+ });++ it("reports failure when the write is rejected (quota exceeded)", () => {+ stubLocalStorage(() => {+ return {+ setItem() {+ throw new DOMException("Quota exceeded.", "QuotaExceededError");+ },+ };+ });++ expect(safeLocalStorageSetItem({ key: KEY, value: "written" })).toBe(false);+ });+});diff --git a/src/lib/__tests__/use-is-local-storage-available.test.tsx b/src/lib/__tests__/use-is-local-storage-available.test.tsxnew file mode 100644index 0000000..ce93c92--- /dev/null+++ b/src/lib/__tests__/use-is-local-storage-available.test.tsx@@ -0,0 +1,94 @@+// @vitest-environment happy-dom++import { afterEach, describe, expect, it, vi } from "vitest";++// Tells React that `act` is safe to use here, the way @testing-library/react would.+(+ globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }+).IS_REACT_ACT_ENVIRONMENT = true;++const originalDescriptor = Object.getOwnPropertyDescriptor(+ window,+ "localStorage",+);++/** iOS in-app webviews (Telegram, Instagram, Facebook) expose `localStorage` as `null`. */+function makeLocalStorageNull() {+ Object.defineProperty(window, "localStorage", {+ configurable: true,+ get() {+ return null;+ },+ });+}++/**+ * A fresh module graph per test: the probe memoizes its answer, and React must be the+ * same copy for the hook and for the renderer that runs it.+ */+async function importFreshReact() {+ vi.resetModules();++ const [{ act }, { hydrateRoot }, { renderToString }, hookModule] =+ await Promise.all([+ import("react"),+ import("react-dom/client"),+ import("react-dom/server"),+ import("../use-is-local-storage-available"),+ ]);++ function StorageStatus() {+ return hookModule.useIsLocalStorageAvailable() ? (+ <p>available</p>+ ) : (+ <p>unavailable</p>+ );+ }++ return { act, hydrateRoot, renderToString, StorageStatus };+}++afterEach(() => {+ if (originalDescriptor) {+ Object.defineProperty(window, "localStorage", originalDescriptor);+ }+});++describe("useIsLocalStorageAvailable", () => {+ it("renders optimistically on the server, where storage cannot be probed", async () => {+ const { renderToString, StorageStatus } = await importFreshReact();++ expect(renderToString(<StorageStatus />)).toContain("available");+ });++ it("hydrates the server markup without a mismatch, then reports the real answer", async () => {+ const { act, hydrateRoot, renderToString, StorageStatus } =+ await importFreshReact();++ // The markup the server produced, before the browser was known to be hostile.+ const serverMarkup = renderToString(<StorageStatus />);++ makeLocalStorageNull();++ const container = document.createElement("div");+ container.innerHTML = serverMarkup;+ document.body.append(container);++ const consoleError = vi.spyOn(console, "error").mockImplementation(vi.fn());+ const onRecoverableError = vi.fn();++ await act(async () => {+ hydrateRoot(container, <StorageStatus />, { onRecoverableError });+ });++ // A hydration mismatch is reported through both channels; neither fired.+ expect(onRecoverableError).not.toHaveBeenCalled();+ expect(consoleError).not.toHaveBeenCalled();++ // Storage really is unusable, so the answer flips right after hydration.+ expect(container.textContent).toBe("unavailable");++ consoleError.mockRestore();+ container.remove();+ });+});diff --git a/src/lib/check-device.server.ts b/src/lib/check-device.server.tsindex e3821f5..62116f8 100644--- a/src/lib/check-device.server.ts+++ b/src/lib/check-device.server.ts@@ -8,7 +8,7 @@ export interface InAppInfo {name: string | null;}-type HeadersList = ReturnType<typeof headers>;+type HeadersList = Awaited<ReturnType<typeof headers>>;/*** Simplified in-app browser detection with detailed app identification@@ -30,64 +30,100 @@ function detectInAppBrowser(ua: string, headers: HeadersList) {const headerDetectors = [{name: "Instagram",- test: () => xRequestedWith.includes("com.instagram.android"),+ test: () => {+ return xRequestedWith.includes("com.instagram.android");+ },},{name: "Facebook",- test: () => xRequestedWith.includes("com.facebook.katana"),+ test: () => {+ return xRequestedWith.includes("com.facebook.katana");+ },},{name: "Facebook Messenger",- test: () => xRequestedWith.includes("com.facebook.orca"),+ test: () => {+ return xRequestedWith.includes("com.facebook.orca");+ },},{name: "Twitter/X",- test: () => xRequestedWith.includes("com.twitter.android"),+ test: () => {+ return xRequestedWith.includes("com.twitter.android");+ },},{name: "TikTok",- test: () =>- xRequestedWith.includes("com.zhiliaoapp.musically") ||- xRequestedWith.includes("com.ss.android.ugc.trill"),+ test: () => {+ return (+ xRequestedWith.includes("com.zhiliaoapp.musically") ||+ xRequestedWith.includes("com.ss.android.ugc.trill")+ );+ },+ },+ {+ name: "WhatsApp",+ test: () => {+ return xRequestedWith.includes("com.whatsapp");+ },+ },+ {+ name: "WeChat",+ test: () => {+ return xRequestedWith.includes("com.tencent.mm");+ },},- { name: "WhatsApp", test: () => xRequestedWith.includes("com.whatsapp") },- { name: "WeChat", test: () => xRequestedWith.includes("com.tencent.mm") },{name: "LINE",- test: () => xRequestedWith.includes("jp.naver.line.android"),+ test: () => {+ return xRequestedWith.includes("jp.naver.line.android");+ },},{name: "Telegram",- test: () =>- xRequestedWith.includes("org.telegram.messenger") ||- xRequestedWith.includes("org.telegram.plus") ||- xRequestedWith.includes("org.telegram.btelegram") ||- xRequestedWith.includes("org.thunderdog.challegram") ||- xRequestedWith.includes("nekox.messenger") ||- xRequestedWith.includes("org.telegram.mdgram") ||- xRequestedWith.includes("it.owlgram.android"),+ test: () => {+ return (+ xRequestedWith.includes("org.telegram.messenger") ||+ xRequestedWith.includes("org.telegram.plus") ||+ xRequestedWith.includes("org.telegram.btelegram") ||+ xRequestedWith.includes("org.thunderdog.challegram") ||+ xRequestedWith.includes("nekox.messenger") ||+ xRequestedWith.includes("org.telegram.mdgram") ||+ xRequestedWith.includes("it.owlgram.android")+ );+ },},{name: "Gmail",- test: () => xRequestedWith.includes("com.google.android.gm"),+ test: () => {+ return xRequestedWith.includes("com.google.android.gm");+ },},{name: "Google App",- test: () =>- xRequestedWith.includes("com.google.android.googlequicksearchbox"),+ test: () => {+ return xRequestedWith.includes(+ "com.google.android.googlequicksearchbox",+ );+ },},{name: "Chrome Custom Tab",- test: () =>- xRequestedWith.includes("com.android.chrome") ||- xRequestedWith.includes("com.chrome.beta") ||- xRequestedWith.includes("com.chrome.canary") ||- xRequestedWith.includes("com.chrome.dev") ||- xRequestedWith.includes("org.chromium.chrome"),+ test: () => {+ return (+ xRequestedWith.includes("com.android.chrome") ||+ xRequestedWith.includes("com.chrome.beta") ||+ xRequestedWith.includes("com.chrome.canary") ||+ xRequestedWith.includes("com.chrome.dev") ||+ xRequestedWith.includes("org.chromium.chrome")+ );+ },},{name: "LinkedIn",- test: () => xRequestedWith.includes("com.linkedin.android"),+ test: () => {+ return xRequestedWith.includes("com.linkedin.android");+ },},];@@ -104,67 +140,161 @@ function detectInAppBrowser(ua: string, headers: HeadersList) {const uaDetectors = [{name: "Facebook",- test: () => has("fbav") || has("fban") || has("fb_iab"),+ test: () => {+ return has("fbav") || has("fban") || has("fb_iab");+ },+ },+ {+ name: "Instagram",+ test: () => {+ return has("instagram");+ },},- { name: "Instagram", test: () => has("instagram") },{name: "Facebook Messenger",- test: () =>+ test: () => {// iOS Messenger: [FBAN/MessengerForiOS;- has("fban/messengerforio") ||- has("messengerforio") ||- // Android Messenger: [FB_IAB/MESSENGER;- has("fb_iab/messenger") ||- // Fallback patterns- (has("messenger") && (has("fban") || has("fb_iab"))),+ return (+ has("fban/messengerforio") ||+ has("messengerforio") ||+ // Android Messenger: [FB_IAB/MESSENGER;+ has("fb_iab/messenger") ||+ // Fallback patterns+ (has("messenger") && (has("fban") || has("fb_iab")))+ );+ },+ },+ {+ name: "WhatsApp",+ test: () => {+ return has("whatsapp");+ },},- { name: "WhatsApp", test: () => has("whatsapp") },{name: "Telegram",- test: () =>- has("telegram") ||- has("tgwebview") ||- has("telegrambot-like") ||- has("tgbot") ||- has("telegram-") ||- // Bot user agents- has("telegrambot") ||- // Version-specific patterns- has("telegram/") ||- // iOS specific patterns- (ios() && (has("telegram") || has("tg/"))) ||- // Android specific patterns- (has("android") && has("tg")),- },- { name: "Twitter/X", test: () => has("twitter") || has("x-client") },- { name: "LinkedIn", test: () => has("linkedinapp") },- { name: "Pinterest", test: () => has("pinterest") },- { name: "Reddit", test: () => has("reddit") },- { name: "Snapchat", test: () => has("snapchat") },- { name: "TikTok", test: () => has("tiktok") || has("com.zhiliaoapp") },- { name: "WeChat", test: () => has("micromessenger") },- { name: "LINE", test: () => has("line/") },- { name: "QQ", test: () => has("qq/") },- { name: "Gmail", test: () => has("gmail") },- { name: "Google App", test: () => has("gsa/") || has("googleapp") },- { name: "Discord", test: () => has("discord") },- { name: "YouTube", test: () => has("youtube") },- { name: "Android WebView", test: () => has("wv") && has("android") },+ test: () => {+ return (+ has("telegram") ||+ has("tgwebview") ||+ has("telegrambot-like") ||+ has("tgbot") ||+ has("telegram-") ||+ // Bot user agents+ has("telegrambot") ||+ // Version-specific patterns+ has("telegram/") ||+ // iOS specific patterns+ (ios() && (has("telegram") || has("tg/"))) ||+ // Android specific patterns+ (has("android") && has("tg"))+ );+ },+ },+ {+ name: "Twitter/X",+ test: () => {+ return has("twitter") || has("x-client");+ },+ },+ {+ name: "LinkedIn",+ test: () => {+ return has("linkedinapp");+ },+ },+ {+ name: "Pinterest",+ test: () => {+ return has("pinterest");+ },+ },+ {+ name: "Reddit",+ test: () => {+ return has("reddit");+ },+ },+ {+ name: "Snapchat",+ test: () => {+ return has("snapchat");+ },+ },+ {+ name: "TikTok",+ test: () => {+ return has("tiktok") || has("com.zhiliaoapp");+ },+ },+ {+ name: "WeChat",+ test: () => {+ return has("micromessenger");+ },+ },+ {+ name: "LINE",+ test: () => {+ return has("line/");+ },+ },+ {+ name: "QQ",+ test: () => {+ return has("qq/");+ },+ },+ {+ name: "Gmail",+ test: () => {+ return has("gmail");+ },+ },+ {+ name: "Google App",+ test: () => {+ return has("gsa/") || has("googleapp");+ },+ },+ {+ name: "Discord",+ test: () => {+ return has("discord");+ },+ },+ {+ name: "YouTube",+ test: () => {+ return has("youtube");+ },+ },+ {+ name: "Android WebView",+ test: () => {+ return has("wv") && has("android");+ },+ },{name: "iOS WebView",- test: () =>- ios() &&- has("applewebkit") &&- !has("safari") &&- !has("crios") &&- !has("fxios") &&- !has("edgios"),+ test: () => {+ return (+ ios() &&+ has("applewebkit") &&+ !has("safari") &&+ !has("crios") &&+ !has("fxios") &&+ !has("edgios")+ );+ },},{name: "Generic WebView",- test: () =>- (has("android") && has("webview")) ||- (has("mobile safari") && !has("safari")),+ test: () => {+ return (+ (has("android") && has("webview")) ||+ (has("mobile safari") && !has("safari"))+ );+ },},];@@ -186,12 +316,12 @@ function detectInAppBrowser(ua: string, headers: HeadersList) {*/export const checkDeviceUserAgent = async () => {if (typeof process === "undefined") {- throw new Error(+ throw new TypeError("[Server method] you are importing a server-only module outside of server",);}- const headersList = headers();+ const headersList = await headers();const ua = headersList.get("user-agent");const parser = new UAParser(ua || "");diff --git a/src/lib/check-local-storage.ts b/src/lib/check-local-storage.tsdeleted file mode 100644index 76f9eb2..0000000--- a/src/lib/check-local-storage.ts+++ /dev/null@@ -1,29 +0,0 @@-"use client";--/**- * https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API#testing_for_availability- */-function storageAvailable(type: "localStorage" | "sessionStorage") {- let storage;- try {- storage = window[type];- const x = "__storage_test__";- storage.setItem(x, x);- storage.removeItem(x);-- return true;- } catch (e) {- return (- e instanceof DOMException &&- e.name === "QuotaExceededError" &&- // acknowledge QuotaExceededError only if there's something already stored- storage &&- storage.length !== 0- );- }-}--/**- * Check if localStorage is available- */-export const isLocalStorageAvailable = storageAvailable("localStorage");diff --git a/src/lib/google-drive.ts b/src/lib/google-drive.tsindex 8eb359f..6166f13 100644--- a/src/lib/google-drive.ts+++ b/src/lib/google-drive.ts@@ -1,9 +1,10 @@-import { env } from "@/env";-import type { drive_v3 } from "googleapis";-import { google } from "googleapis";import { Readable } from "node:stream";++import { type drive_v3, google } from "googleapis";import { z } from "zod";+import { env } from "@/env";+type GoogleDriveFile = drive_v3.Schema$File;export interface DriveFolderRef {@@ -52,7 +53,10 @@ export async function initializeGoogleDrive() {return cachedDrive;}- const googlePrivateKey = env.GOOGLE_DRIVE_PRIVATE_KEY.replace(/\\n/g, "\n");+ const googlePrivateKey = env.GOOGLE_DRIVE_PRIVATE_KEY.replaceAll(+ String.raw`\n`,+ "\n",+ );const auth = new google.auth.GoogleAuth({credentials: {@@ -95,7 +99,9 @@ async function createFolder(* @param {Buffer} buffer - The input buffer containing file data* @returns {Readable} A readable stream created from the buffer using Node's Readable.from()*/-const bufferToStream = (buffer: Buffer): Readable => Readable.from(buffer);+const bufferToStream = (buffer: Buffer): Readable => {+ return Readable.from(buffer);+};export async function uploadFile({googleDrive,@@ -184,8 +190,7 @@ export async function createOrFindInvoiceFolder({// if the month folder already exists, use itmonthFolder = monthFolderResponse.data.files[0];- // eslint-disable-next-line no-console- console.log(+ console.info("\n\n________month folder already exists, using it: ",monthFolder,{ monthFolderName, yearFolderName },@@ -238,8 +243,7 @@ export async function createOrFindInvoiceFolder({const googleDriveFolderPath = `/${yearFolder.name}/${monthFolder.name}/${folderToUploadInvoices.name}`;- // eslint-disable-next-line no-console- console.log(+ console.info("\n\n________invoice to upload Google Drive folder path: ",googleDriveFolderPath,"\n\n",diff --git a/src/lib/haptic.ts b/src/lib/haptic.tsindex 42b1371..0db49e5 100644--- a/src/lib/haptic.ts+++ b/src/lib/haptic.ts@@ -44,13 +44,13 @@ export function haptic(pattern: number | number[] = 50) {const input = document.createElement("input");input.type = "checkbox";input.setAttribute("switch", "");- label.appendChild(input);+ label.append(input);try {- document.head.appendChild(label);+ document.head.append(label);label.click();} finally {- document.head.removeChild(label);+ label.remove();}} catch {}}diff --git a/src/lib/rate-limit.ts b/src/lib/rate-limit.tsindex 6f70ffd..a853246 100644--- a/src/lib/rate-limit.ts+++ b/src/lib/rate-limit.ts@@ -1,4 +1,5 @@import { Ratelimit } from "@upstash/ratelimit";+import { redis } from "./redis";/**@@ -15,7 +16,9 @@ export const ipLimiter =process.env.NODE_ENV === "development"? {// in development mode, we don't want to rate limit- limit: async () => ({ success: true }),+ limit: async () => {+ return { success: true };+ },}: new Ratelimit({redis,diff --git a/src/lib/redis.ts b/src/lib/redis.tsindex 202016e..f2b606e 100644--- a/src/lib/redis.ts+++ b/src/lib/redis.ts@@ -1,6 +1,7 @@-import { env } from "@/env";import { Redis } from "@upstash/redis";+import { env } from "@/env";+/*** Redis client instance for Upstash Redis.* Provides async key-value storage for queue management and caching.diff --git a/src/lib/resend.ts b/src/lib/resend.tsindex 10be544..a8b7708 100644--- a/src/lib/resend.ts+++ b/src/lib/resend.ts@@ -1,4 +1,5 @@-import { env } from "@/env";import { Resend } from "resend";+import { env } from "@/env";+export const resend = new Resend(env.RESEND_API_KEY);diff --git a/src/lib/safe-local-storage.ts b/src/lib/safe-local-storage.tsnew file mode 100644index 0000000..9840072--- /dev/null+++ b/src/lib/safe-local-storage.ts@@ -0,0 +1,131 @@+"use client";++/**+ * Resolves `localStorage`, or `null` when it cannot be used.+ *+ * `localStorage` is not guaranteed to exist, even in a real browser:+ * - iOS in-app webviews (Telegram, Instagram, Facebook) expose it as `null`, so an+ * unguarded read throws+ * `TypeError: null is not an object (evaluating 'localStorage.getItem')`.+ * - Safari with "Block all cookies" throws a `SecurityError` on the property access.+ * - It does not exist while a client component is server-rendered.+ *+ * Resolved on every call rather than once at module scope: a module-scope probe runs+ * during SSR, where storage is always unavailable, and would bake that answer into the+ * first client render.+ */+function getLocalStorage(): Storage | null {+ try {+ if (typeof window === "undefined") {+ return null;+ }++ const storage: Storage | null = window.localStorage;++ return storage;+ } catch {+ return null;+ }+}++/**+ * Reads a key from `localStorage`. Never throws.+ *+ * @returns the stored string, or `null` when storage is unavailable or the key is unset.+ */+export function safeLocalStorageGetItem(key: string): string | null {+ const storage = getLocalStorage();++ if (!storage) {+ return null;+ }++ try {+ return storage.getItem(key);+ } catch {+ return null;+ }+}++interface SafeLocalStorageSetItemOptions {+ /** The `localStorage` key to write to. */+ key: string;+ /** The value to persist. */+ value: string;+}++/**+ * Writes a key to `localStorage`. Never throws.+ *+ * @returns `true` when the value was persisted, `false` when storage was unavailable or+ * the write was rejected (private mode, quota exceeded).+ */+export function safeLocalStorageSetItem({+ key,+ value,+}: SafeLocalStorageSetItemOptions): boolean {+ const storage = getLocalStorage();++ if (!storage) {+ return false;+ }++ try {+ storage.setItem(key, value);++ return true;+ } catch {+ return false;+ }+}++/**+ * Cached answer of the availability probe, so the write/remove round trip only runs once+ * per page load. Never populated on the server: `null` there means "not probed yet"+ * rather than "unavailable", so the client is free to probe for real after hydration.+ */+let cachedAvailability: boolean | null = null;++/**+ * Whether `localStorage` can actually be written to, probed with a write/remove round+ * trip — the read-only checks above cannot tell a working store from one that accepts+ * `getItem` but rejects every write (Safari private mode used to do exactly that).+ *+ * Always `false` on the server. Prefer `useIsLocalStorageAvailable` when the answer+ * decides what to render, so the server and the hydrating client agree.+ *+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API#testing_for_availability+ */+export function isLocalStorageAvailable(): boolean {+ if (cachedAvailability !== null) {+ return cachedAvailability;+ }++ const storage = getLocalStorage();++ if (!storage) {+ return false;+ }++ const probeKey = "__storage_test__";++ let available: boolean;++ try {+ storage.setItem(probeKey, probeKey);+ storage.removeItem(probeKey);++ available = true;+ } catch (error) {+ // A full store still counts as available, as long as something is already in it —+ // the user can free space, and everything we persist is small.+ available =+ error instanceof DOMException &&+ error.name === "QuotaExceededError" &&+ storage.length > 0;+ }++ cachedAvailability = available;++ return available;+}diff --git a/src/lib/sentry/__tests__/sentry-init-options.test.ts b/src/lib/sentry/__tests__/sentry-init-options.test.tsnew file mode 100644index 0000000..d927392--- /dev/null+++ b/src/lib/sentry/__tests__/sentry-init-options.test.ts@@ -0,0 +1,27 @@+import { describe, expect, it } from "vitest";++import { isSentryEnabled } from "../sentry-init-options";++describe("isSentryEnabled", () => {+ it("reports when the flag is opted in", () => {+ expect(isSentryEnabled({ enabledFlag: "true", ci: undefined })).toBe(true);+ });++ it("stays silent when the flag is not opted in", () => {+ expect(isSentryEnabled({ enabledFlag: undefined, ci: undefined })).toBe(+ false,+ );++ expect(isSentryEnabled({ enabledFlag: "false", ci: undefined })).toBe(+ false,+ );+ });++ it("stays silent in CI", () => {+ expect(isSentryEnabled({ enabledFlag: "true", ci: "true" })).toBe(false);+ });++ it("reports when `ci` is omitted, as the browser does", () => {+ expect(isSentryEnabled({ enabledFlag: "true" })).toBe(true);+ });+});diff --git a/src/lib/sentry/scrub-sensitive-url-params.ts b/src/lib/sentry/scrub-sensitive-url-params.tsindex d5aae6d..bee2388 100644--- a/src/lib/sentry/scrub-sensitive-url-params.ts+++ b/src/lib/sentry/scrub-sensitive-url-params.ts@@ -48,9 +48,9 @@ function scrubQueryString(queryString: string) {const params = new URLSearchParams(rawQuery);- const hasSensitiveParam = SENSITIVE_QUERY_PARAMS.some((param) =>- params.has(param),- );+ const hasSensitiveParam = SENSITIVE_QUERY_PARAMS.some((param) => {+ return params.has(param);+ });if (!hasSensitiveParam) {return queryString;diff --git a/src/lib/sentry/sentry-e2e-flags.ts b/src/lib/sentry/sentry-e2e-flags.tsnew file mode 100644index 0000000..9d60093--- /dev/null+++ b/src/lib/sentry/sentry-e2e-flags.ts@@ -0,0 +1,26 @@+/**+ * How an e2e run tells the app not to report to Sentry.+ *+ * The suite drives a real preview deployment, which has Sentry enabled exactly like+ * production does, so no env var on the CI job can tell e2e traffic apart from a human+ * browsing the same URL — the browser has to say so itself.+ *+ * Kept in its own dependency-free module: `playwright.config.ts` imports it directly,+ * and it must not drag the Sentry SDK or the `@/` alias into that config.+ */++/**+ * `localStorage` key read by `src/instrumentation-client.ts` before the browser SDK+ * starts up, set by every project in `playwright.config.ts`. Mirrors how the same+ * config switches off umami with `umami.disabled`.+ *+ * Written by the test runner and only read by us, so it deliberately stays out of+ * `LOCAL_STORAGE_KEYS` — the app itself never persists it.+ *+ * Browser-only by design. Marking the requests themselves (an `x-e2e-test` header via+ * Playwright's `extraHTTPHeaders`) was tried and reverted: those headers ride on+ * cross-origin requests too, and the custom header made the cdnjs `pdf.js` import in+ * `e2e/utils/render-pdf-on-canvas.ts` fail CORS preflight, breaking every PDF snapshot+ * test. Server and edge events from an e2e run are therefore still reported.+ */+export const SENTRY_E2E_DISABLED_STORAGE_KEY = "sentry.disabled";diff --git a/src/lib/sentry/sentry-init-options.ts b/src/lib/sentry/sentry-init-options.tsnew file mode 100644index 0000000..b670368--- /dev/null+++ b/src/lib/sentry/sentry-init-options.ts@@ -0,0 +1,125 @@+import {+ scrubSensitiveUrlParamsBeforeBreadcrumb,+ scrubSensitiveUrlParamsFromEvent,+} from "@/lib/sentry/scrub-sensitive-url-params";++interface IsSentryEnabledArgs {+ /**+ * The opt-in flag: `SENTRY_ENABLED` on the server/edge,+ * `NEXT_PUBLIC_SENTRY_ENABLED` in the browser.+ */+ enabledFlag: string | undefined;+ /**+ * `CI`, so a server started inside a CI job never reports. Omitted in the browser:+ * Next only inlines `NEXT_PUBLIC_*` into the client bundle, so reading it there+ * would always be `undefined` anyway.+ */+ ci?: string | undefined;+}++/**+ * Decides whether Sentry should start up at all.+ *+ * Deliberately env-agnostic: production and preview deployments both report, and the+ * flag in `.env.local` is what turns reporting on for local development. Browser+ * traffic from the e2e suite is excluded separately (the suite runs against a preview+ * deployment, so no env var can tell it apart from a human browsing that same+ * deployment) — see `@/lib/sentry/sentry-e2e-flags`.+ */+export function isSentryEnabled({ enabledFlag, ci }: IsSentryEnabledArgs) {+ if (enabledFlag !== "true") {+ return false;+ }++ if (ci === "true") {+ return false;+ }++ return true;+}++/**+ * Which flag turns each runtime on, so the startup line below names the one to flip.+ */+const SENTRY_ENABLED_FLAG_BY_RUNTIME = {+ browser: "NEXT_PUBLIC_SENTRY_ENABLED",+ server: "SENTRY_ENABLED",+ edge: "SENTRY_ENABLED",+} as const;++type SentryRuntime = keyof typeof SENTRY_ENABLED_FLAG_BY_RUNTIME;++/**+ * Terminal styling, built from the escape's char code rather than a literal escape+ * byte, which is invisible in an editor and easily mangled by tooling.+ */+const ESCAPE = String.fromCodePoint(27);+/** Bold white on red, to read as a warning rather than as a status line. */+const ANSI_BADGE = `${ESCAPE}[1;97;41m`;+/** Bold yellow, for the message that follows the badge. */+const ANSI_MESSAGE = `${ESCAPE}[1;93m`;+const ANSI_RESET = `${ESCAPE}[0m`;++/**+ * Announces, once per runtime startup, that this session reports to Sentry.+ *+ * An enabled SDK is otherwise invisible until something turns up in the dashboard,+ * which makes it easy to forget the flag is on and to mistake real local errors for+ * production noise. Deliberately loud — warning level, warning signs, red badge —+ * because a quiet grey line is exactly what gets scrolled past.+ *+ * Local only: `NODE_ENV` is "production" in every deployed build, where the line would+ * be pure log spam on each cold start (and `next.config.mjs` strips `console` there+ * anyway).+ */+export function logSentryEnabledLocally(runtime: SentryRuntime) {+ if (process.env.NODE_ENV === "production") {+ return;+ }++ const flag = SENTRY_ENABLED_FLAG_BY_RUNTIME[runtime];+ const detail = `${runtime} SDK is on: errors from this session go to your real Sentry project. Set ${flag}="false" in .env.local to stop.`;++ // `%c` styling is a browser-console feature, the terminal would print it literally.+ //+ // Note the level differs by runtime, and deliberately so: `console.warn` here is+ // swallowed in the edge runtime (the server line prints, the edge one silently does+ // not), while in the browser it is what buys the native yellow warning row. The ANSI+ // badge below is loud enough on its own.+ if (typeof window === "undefined") {+ console.info(+ `${ANSI_BADGE} 🚨 SENTRY ON 🚨 ${ANSI_RESET}${ANSI_MESSAGE} ⚠️ ${detail} ${ANSI_RESET}`,+ );++ return;+ }++ // two `%c` segments so the badge and the message keep their own background and read+ // as one continuous banner+ console.warn(+ `%c 🚨 SENTRY ON 🚨 %c ⚠️ ${detail} `,+ "background:#b91c1c;color:#fff;font-weight:800;font-size:13px;padding:5px 8px;border-radius:4px 0 0 4px",+ "background:#fde68a;color:#7c2d12;font-weight:700;font-size:13px;padding:5px 8px;border-radius:0 4px 4px 0",+ );+}++/**+ * `Sentry.init()` options shared by the browser, server and edge runtimes.+ *+ * Runtime-specific options (Session Replay is browser-only, for example) stay in+ * the config file they belong to.+ */+export const SENTRY_SHARED_INIT_OPTIONS = {+ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,++ // Sample % of transactions: performance/cost balance for a production deploy.+ tracesSampleRate: 0.2,++ debug: false,++ // Privacy: the invoice data lives in the `?data=` query param, redact it in+ // every URL we report (request url, referrer, breadcrumbs, spans)+ beforeSend: scrubSensitiveUrlParamsFromEvent,+ beforeSendTransaction: scrubSensitiveUrlParamsFromEvent,+ beforeBreadcrumb: scrubSensitiveUrlParamsBeforeBreadcrumb,+} as const;diff --git a/src/lib/seo/__tests__/changelog-json-ld.test.ts b/src/lib/seo/__tests__/changelog-json-ld.test.tsindex c8bc5a5..fc0cbc5 100644--- a/src/lib/seo/__tests__/changelog-json-ld.test.ts+++ b/src/lib/seo/__tests__/changelog-json-ld.test.ts@@ -9,7 +9,8 @@ import { JSON_LD_IDS } from "../json-ld-ids";describe("buildChangelogIndexJsonLdGraph", () => {it("includes CollectionPage, Blog, Organization, and BreadcrumbList", () => {const graph = buildChangelogIndexJsonLdGraph("2026-01-15");- const parsed = JSON.parse(JSON.stringify(graph)) as {+ const serializedGraph = JSON.stringify(graph);+ const parsed = JSON.parse(serializedGraph) as {"@graph": Array<Record<string, unknown>>;};const nodes = parsed["@graph"];@@ -41,7 +42,8 @@ describe("buildChangelogIndexJsonLdGraph", () => {it("should omit dateModified when latestDateModified is null", () => {const graph = buildChangelogIndexJsonLdGraph(null);- const parsed = JSON.parse(JSON.stringify(graph)) as {+ const serializedGraph = JSON.stringify(graph);+ const parsed = JSON.parse(serializedGraph) as {"@graph": Array<Record<string, unknown>>;};const blog = parsed["@graph"][1];@@ -64,10 +66,13 @@ describe("buildChangelogPostJsonLdGraph", () => {date: "2026-02-01",version: "1.0.0",},- Component: () => null,+ Component: () => {+ return null;+ },});- const parsed = JSON.parse(JSON.stringify(graph)) as {+ const serializedGraph = JSON.stringify(graph);+ const parsed = JSON.parse(serializedGraph) as {"@graph": Array<Record<string, unknown>>;};const blogPosting = parsed["@graph"][1];@@ -94,10 +99,13 @@ describe("buildChangelogPostJsonLdGraph", () => {date: "2026-02-01",version: "1.0.0",},- Component: () => null,+ Component: () => {+ return null;+ },});- const parsed = JSON.parse(JSON.stringify(graph)) as {+ const serializedGraph = JSON.stringify(graph);+ const parsed = JSON.parse(serializedGraph) as {"@graph": Array<Record<string, unknown>>;};const webPage = parsed["@graph"][0];diff --git a/src/lib/seo/__tests__/founder-json-ld.test.ts b/src/lib/seo/__tests__/founder-json-ld.test.tsindex 1f3d4b3..af8cd63 100644--- a/src/lib/seo/__tests__/founder-json-ld.test.ts+++ b/src/lib/seo/__tests__/founder-json-ld.test.ts@@ -6,7 +6,8 @@ import { JSON_LD_IDS } from "../json-ld-ids";describe("buildFounderJsonLdGraph", () => {it("includes Person entity and ProfilePage with mainEntity pointing to person", () => {const graph = buildFounderJsonLdGraph();- const parsed = JSON.parse(JSON.stringify(graph)) as {+ const serializedGraph = JSON.stringify(graph);+ const parsed = JSON.parse(serializedGraph) as {"@graph": Array<Record<string, unknown>>;};diff --git a/src/lib/seo/__tests__/home-json-ld.test.ts b/src/lib/seo/__tests__/home-json-ld.test.tsindex 50015d0..9385c51 100644--- a/src/lib/seo/__tests__/home-json-ld.test.ts+++ b/src/lib/seo/__tests__/home-json-ld.test.ts@@ -6,27 +6,28 @@ import { JSON_LD_IDS } from "../json-ld-ids";describe("buildHomeJsonLdGraph", () => {it("includes full WebSite, Organization, WebApplication, site nav, and WebPage linked by @id", () => {const graph = buildHomeJsonLdGraph();- const parsed = JSON.parse(JSON.stringify(graph)) as {+ const serializedGraph = JSON.stringify(graph);+ const parsed = JSON.parse(serializedGraph) as {"@graph": Array<Record<string, unknown>>;};expect(parsed["@graph"]).toHaveLength(5);- const webSite = parsed["@graph"].find(- (node) => node["@type"] === "WebSite",- );- const organization = parsed["@graph"].find(- (node) => node["@type"] === "Organization",- );- const webApplication = parsed["@graph"].find(- (node) => node["@type"] === "WebApplication",- );- const siteNavigation = parsed["@graph"].find(- (node) => node["@type"] === "ItemList",- );- const webPage = parsed["@graph"].find(- (node) => node["@type"] === "WebPage",- );+ const webSite = parsed["@graph"].find((node) => {+ return node["@type"] === "WebSite";+ });+ const organization = parsed["@graph"].find((node) => {+ return node["@type"] === "Organization";+ });+ const webApplication = parsed["@graph"].find((node) => {+ return node["@type"] === "WebApplication";+ });+ const siteNavigation = parsed["@graph"].find((node) => {+ return node["@type"] === "ItemList";+ });+ const webPage = parsed["@graph"].find((node) => {+ return node["@type"] === "WebPage";+ });expect(webSite).toMatchObject({"@id": JSON_LD_IDS.website,diff --git a/src/lib/seo/__tests__/llms-markdown-pages.test.ts b/src/lib/seo/__tests__/llms-markdown-pages.test.tsindex 54244ff..f59f6f9 100644--- a/src/lib/seo/__tests__/llms-markdown-pages.test.ts+++ b/src/lib/seo/__tests__/llms-markdown-pages.test.ts@@ -1,6 +1,7 @@import { readFileSync } from "node:fs";import { resolve } from "node:path";-import { describe, expect, it } from "vitest";++import { assert, describe, expect, it } from "vitest";import { z } from "zod";const MARKDOWN_PATHS = [@@ -31,10 +32,9 @@ const UPDATE_DATE_LABELS = {nl: "Laatst bijgewerkt",} as const;-const UPDATE_DATE_SCHEMA = z- .string()- .date()- .transform((value) => new Date(`${value}T00:00:00.000Z`));+const UPDATE_DATE_SCHEMA = z.iso.date().transform((value) => {+ return new Date(`${value}T00:00:00.000Z`);+});function readPublicFile(path: string) {return readFileSync(resolve(process.cwd(), "public", path), "utf8");@@ -65,7 +65,7 @@ function extractUpdateDate(content: string, path: string) {const locale = pathLocale in UPDATE_DATE_LABELS ? pathLocale : "en";const label = UPDATE_DATE_LABELS[locale as keyof typeof UPDATE_DATE_LABELS];- const escapedLabel = label.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");+ const escapedLabel = label.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`);const match = new RegExp(`^>\\s*${escapedLabel}\\s*:\\s*(\\S+)\\s*$`,@@ -89,15 +89,14 @@ describe("LLM-facing Markdown pages", () => {).not.toBeNull();const updatedAt = UPDATE_DATE_SCHEMA.safeParse(updateDate);- expect(+ assert(updatedAt.success,`expected a valid YYYY-MM-DD calendar date, got ${updateDate}`,- ).toBe(true);- if (!updatedAt.success) return;+ );expect(updatedAt.data.getTime()).toBeLessThanOrEqual(Date.now());- expect(content.length).toBeGreaterThan(1_000);+ expect(content.length).toBeGreaterThan(1000);});it("rejects content without the localized update date field", () => {@@ -115,7 +114,9 @@ describe("LLM-facing Markdown pages", () => {const linkedPaths = [...llmsTxt.matchAll(/https:\/\/easyinvoicepdf\.com\/(\S+?\.md)/g),- ].map((match) => match[1]);+ ].map((match) => {+ return match[1];+ });expect(new Set(linkedPaths)).toEqual(new Set(MARKDOWN_PATHS));});diff --git a/src/lib/seo/breadcrumb.ts b/src/lib/seo/breadcrumb.tsindex f2bc27f..edf7d8a 100644--- a/src/lib/seo/breadcrumb.ts+++ b/src/lib/seo/breadcrumb.ts@@ -15,11 +15,13 @@ export function buildBreadcrumbList(return {"@type": "BreadcrumbList","@id": pageBreadcrumbId(pageUrl),- itemListElement: items.map((crumb, index) => ({- "@type": "ListItem" as const,- position: index + 1,- name: crumb.name,- ...(crumb.item ? { item: crumb.item } : {}),- })),+ itemListElement: items.map((crumb, index) => {+ return {+ "@type": "ListItem" as const,+ position: index + 1,+ name: crumb.name,+ ...(crumb.item ? { item: crumb.item } : {}),+ };+ }),};}diff --git a/src/lib/umami-analytics-track-event.tsx b/src/lib/umami-analytics-track-event.tsxindex 7e6c341..15da1a3 100644--- a/src/lib/umami-analytics-track-event.tsx+++ b/src/lib/umami-analytics-track-event.tsx@@ -1,7 +1,7 @@"use client";-import { z } from "zod";import * as Sentry from "@sentry/nextjs";+import { z } from "zod";interface UmamiEventData {[key: string]: string | number | boolean | undefined;@@ -40,7 +40,7 @@ export const umamiTrackEvent = (Sentry.captureException(error);if (error instanceof z.ZodError) {- console.error("Invalid event name:", error.errors[0].message);+ console.error("Invalid event name:", error.issues[0].message);return;}}diff --git a/src/lib/use-is-local-storage-available.ts b/src/lib/use-is-local-storage-available.tsnew file mode 100644index 0000000..daf694f--- /dev/null+++ b/src/lib/use-is-local-storage-available.ts@@ -0,0 +1,46 @@+"use client";++import { useSyncExternalStore } from "react";++import { isLocalStorageAvailable } from "@/lib/safe-local-storage";++function unsubscribe() {+ // nothing to tear down+}++/**+ * Availability never changes within a page load, so there is nothing to subscribe to.+ * Both functions live at module scope because `useSyncExternalStore` re-subscribes+ * whenever the identity of `subscribe` changes.+ */+function subscribe() {+ return unsubscribe;+}++/**+ * Optimistic answer for the server render and for the hydrating client render, which+ * must produce identical markup.+ *+ * `true` is the right guess: storage works for almost everyone, and this way the rare+ * user without it sees the warning appear right after hydration instead of everyone else+ * seeing it flash away.+ */+function getServerSnapshot() {+ return true;+}++/**+ * Whether `localStorage` can be written to, safe to branch on during render.+ *+ * The probe cannot run while a client component is server-rendered — `window` does not+ * exist there — so the answer arrives only after hydration. `useSyncExternalStore` makes+ * that explicit: React renders the server snapshot on both sides, then re-renders with+ * the real answer, instead of the two disagreeing and tripping a hydration mismatch.+ */+export function useIsLocalStorageAvailable(): boolean {+ return useSyncExternalStore(+ subscribe,+ isLocalStorageAvailable,+ getServerSnapshot,+ );+}diff --git a/src/lib/zod-resolver-for-output.ts b/src/lib/zod-resolver-for-output.tsnew file mode 100644index 0000000..68fbbd2--- /dev/null+++ b/src/lib/zod-resolver-for-output.ts@@ -0,0 +1,27 @@+import { zodResolver } from "@hookform/resolvers/zod";+import type { FieldValues, Resolver } from "react-hook-form";+import type { z } from "zod";++/**+ * `zodResolver` for a form whose state is typed on the schema's **output** type.+ *+ * Since @hookform/resolvers v5 the resolver is typed on the schema's *input*+ * type. For our schemas that is a poor description of the actual form state:+ * `.default()` makes fields optional that the form always populates, and+ * `z.coerce.number()` widens its input to `unknown` in zod v4, which would+ * erase the type of every calculated amount field (`total`, `netAmount`,+ * `vatAmount`, `preTaxAmount`) across the whole form tree.+ *+ * Our forms are seeded with fully-populated `defaultValues` of the output type+ * and every component reads and writes that shape, so the output type is the+ * accurate description. This bridges the resolver's generics to it; the runtime+ * behaviour is exactly that of a plain `zodResolver` call.+ */+export function zodResolverForOutput<TOutput extends FieldValues, TInput>(+ schema: z.ZodType<TOutput, TInput>,+): Resolver<TOutput> {+ // Re-declares the schema as one whose input is also `TOutput` - that is the+ // bridge described above, and it is what makes the resolver line up with a+ // `useForm<TOutput>`.+ return zodResolver(schema as unknown as z.ZodType<TOutput, TOutput>);+}diff --git a/src/mdx-components.tsx b/src/mdx-components.tsxindex 0248dfe..e3e7ecd 100644--- a/src/mdx-components.tsx+++ b/src/mdx-components.tsx@@ -28,65 +28,79 @@ export function useMDXComponents(components: MDXComponents): MDXComponents {},// Enhanced code block styling- pre: ({ children, ...props }) => (- <pre- {...props}- className="overflow-x-auto rounded-lg border border-gray-200 bg-gray-50 p-4 text-sm dark:border-gray-700 dark:bg-gray-800"- >- {children}- </pre>- ),+ pre: ({ children, ...props }) => {+ return (+ <pre+ {...props}+ className="overflow-x-auto rounded-lg border border-gray-200 bg-gray-50 p-4 text-sm dark:border-gray-700 dark:bg-gray-800"+ >+ {children}+ </pre>+ );+ },// Enhanced inline code styling- code: ({ children, ...props }) => (- <code- {...props}- className="rounded bg-gray-100 px-1.5 py-0.5 font-mono text-sm text-gray-800 dark:bg-gray-800 dark:text-gray-200"- >- {children}- </code>- ),+ code: ({ children, ...props }) => {+ return (+ <code+ {...props}+ className="rounded bg-gray-100 px-1.5 py-0.5 font-mono text-sm text-gray-800 dark:bg-gray-800 dark:text-gray-200"+ >+ {children}+ </code>+ );+ },// Custom blockquote with accent color- blockquote: ({ children, ...props }) => (- <blockquote- {...props}- className="border-l-4 border-blue-500 bg-blue-50 py-2 pl-6 italic dark:bg-blue-950/20"- >- {children}- </blockquote>- ),+ blockquote: ({ children, ...props }) => {+ return (+ <blockquote+ {...props}+ className="border-l-4 border-blue-500 bg-blue-50 py-2 pl-6 italic dark:bg-blue-950/20"+ >+ {children}+ </blockquote>+ );+ },// Enhanced image styling with responsive design- img: ({ alt, src, ...props }) => (- <img- {...props}- src={src}- alt={alt}- height={450}- width={840}- className="aspect-auto rounded-lg border border-gray-200 bg-slate-300 shadow-sm dark:border-gray-700"- style={{ maxWidth: "100%", height: "auto" }}- />- ),+ img: ({ alt, src, ...props }) => {+ return (+ <img+ {...props}+ src={src}+ alt={alt}+ height={450}+ width={840}+ className="aspect-auto rounded-lg border border-gray-200 bg-slate-300 shadow-sm dark:border-gray-700"+ style={{ maxWidth: "100%", height: "auto" }}+ />+ );+ },- table: ({ children, ...props }) => (- <table {...props} className="w-full border-collapse border">- {children}- </table>- ),+ table: ({ children, ...props }) => {+ return (+ <table {...props} className="w-full border-collapse border">+ {children}+ </table>+ );+ },- th: ({ children, ...props }) => (- <th {...props} className="border p-2 text-center">- {children}- </th>- ),+ th: ({ children, ...props }) => {+ return (+ <th {...props} className="border p-2 text-center">+ {children}+ </th>+ );+ },- td: ({ children, ...props }) => (- <td {...props} className="border p-2">- {children}- </td>- ),+ td: ({ children, ...props }) => {+ return (+ <td {...props} className="border p-2">+ {children}+ </td>+ );+ },// Override any default components as needed...components,diff --git a/src/middleware.ts b/src/middleware.tsnew file mode 100644index 0000000..6c6ee5c--- /dev/null+++ b/src/middleware.ts@@ -0,0 +1,23 @@+import createMiddleware from "next-intl/middleware";++import { routing } from "@/i18n/routing";++/**+ * Resolves the locale before any layout renders.+ *+ * Without this, next-intl falls back to `setRequestLocale()`, whose value does+ * not reach `getRequestConfig()` on Next.js 15 — every `[locale]` route then+ * renders in the default locale. Static rendering hides it (the `/[locale]/about`+ * pages are prerendered per locale), so it only shows up on dynamic renders,+ * i.e. `next dev`.+ */+export default createMiddleware(routing);++export const config = {+ // Only locale-prefixed routes; `/`, `/changelog`, `/tos`, `/founder`,+ // `/api/*` and assets are untouched.+ //+ // Next.js requires a static literal here, so this list cannot be derived from+ // `routing.locales` — keep it in sync with SUPPORTED_LANGUAGES.+ matcher: ["/(en|pl|de|es|pt|ru|uk|fr|it|nl)/:path*"],+};diff --git a/src/trigger/__tests__/monthly-recurring-invoice.test.ts b/src/trigger/__tests__/monthly-recurring-invoice.test.tsindex 654aa53..b63a6b2 100644--- a/src/trigger/__tests__/monthly-recurring-invoice.test.ts+++ b/src/trigger/__tests__/monthly-recurring-invoice.test.ts@@ -24,21 +24,27 @@ type TaskConfig = {let runMonthlyRecurringInvoice: TaskRun | undefined;let monthlyRecurringInvoiceRetry: TaskConfig["retry"];-vi.mock("@trigger.dev/sdk", () => ({- logger: {- log: (...args: unknown[]) => mockLoggerLog(...args) as void,- },- wait: {- until: (...args: unknown[]) => mockWaitUntil(...args) as void,- },- schedules: {- task: (config: TaskConfig) => {- runMonthlyRecurringInvoice = config.run;- monthlyRecurringInvoiceRetry = config.retry;- return { id: "monthly-recurring-invoice" };+vi.mock("@trigger.dev/sdk", () => {+ return {+ logger: {+ log: (...args: unknown[]) => {+ return mockLoggerLog(...args) as void;+ },},- },-}));+ wait: {+ until: (...args: unknown[]) => {+ return mockWaitUntil(...args) as void;+ },+ },+ schedules: {+ task: (config: TaskConfig) => {+ runMonthlyRecurringInvoice = config.run;+ monthlyRecurringInvoiceRetry = config.retry;+ return { id: "monthly-recurring-invoice" };+ },+ },+ };+});// Saturday/Sunday on the 10th, Warsaw wall time (weekday checks only; hour matches warsaw-time.test.ts payloads).const SATURDAY_JAN_10_2026 = new Date("2026-01-10T12:00:00Z");@@ -72,7 +78,9 @@ function mockFetchResponse({return vi.fn().mockResolvedValue({ok,status,- text: () => Promise.resolve(body),+ text: () => {+ return Promise.resolve(body);+ },});}diff --git a/src/trigger/__tests__/warsaw-time.test.ts b/src/trigger/__tests__/warsaw-time.test.tsindex 9d2dd8e..6453321 100644--- a/src/trigger/__tests__/warsaw-time.test.ts+++ b/src/trigger/__tests__/warsaw-time.test.ts@@ -1,4 +1,5 @@import { describe, it, expect } from "vitest";+import { getNextMondayInWarsaw, getWarsawWeekday } from "../warsaw-time";// The instants below are the actual moments the schedule fires:diff --git a/src/trigger/warsaw-time.ts b/src/trigger/warsaw-time.tsindex 8c8b7b5..ff62f37 100644--- a/src/trigger/warsaw-time.ts+++ b/src/trigger/warsaw-time.ts@@ -57,8 +57,13 @@ function getWarsawDateParts(date: Date): {day: "2-digit",}).formatToParts(date);- const getPart = (type: Intl.DateTimeFormatPartTypes) =>- Number(parts.find((part) => part.type === type)?.value);+ const getPart = (type: Intl.DateTimeFormatPartTypes) => {+ return Number(+ parts.find((part) => {+ return part.type === type;+ })?.value,+ );+ };return {year: getPart("year"),@@ -104,8 +109,13 @@ function getWarsawOffsetMs(date: Date): number {hour12: false,}).formatToParts(date);- const getPart = (type: Intl.DateTimeFormatPartTypes) =>- Number(parts.find((part) => part.type === type)?.value);+ const getPart = (type: Intl.DateTimeFormatPartTypes) => {+ return Number(+ parts.find((part) => {+ return part.type === type;+ })?.value,+ );+ };const asUtc = Date.UTC(getPart("year"),diff --git a/src/types.ts b/src/types.tsindex 5e5dae0..fc2cce6 100644--- a/src/types.ts+++ b/src/types.ts@@ -1,5 +1,8 @@export type Prettify<T> = {[K in keyof T]: T[K];+ // `& {}` is what flattens the mapped type into a single readable object in+ // editor tooltips - that is the whole point of Prettify+ // oxlint-disable-next-line typescript/ban-types} & {};export type NonReadonly<T> = {diff --git a/src/utils/__tests__/url-compression.test.ts b/src/utils/__tests__/url-compression.test.tsindex 38967ea..6f80e35 100644--- a/src/utils/__tests__/url-compression.test.ts+++ b/src/utils/__tests__/url-compression.test.ts@@ -1,9 +1,5 @@import { describe, it, expect } from "vitest";-import {- compressInvoiceData,- decompressInvoiceData,- INVOICE_KEY_COMPRESSION_MAP,-} from "../url-compression";+import {type InvoiceData,type InvoiceItemData,@@ -14,8 +10,36 @@ import {buyerSchema,invoiceItemSchema,} from "@/app/schema";++import {+ compressInvoiceData,+ decompressInvoiceData,+ INVOICE_KEY_COMPRESSION_MAP,+} from "../url-compression";import { MOCK_INVOICE_DATA, MOCK_INVOICE_ITEM_DATA } from "./data";+// Extract all keys recursively from the mock data. Declared at module scope so its+// recursion guards are not conditionals inside `it`.+function getAllKeys(obj: unknown, keySet = new Set<string>()): Set<string> {+ if (obj === null || typeof obj !== "object") {+ return keySet;+ }++ if (Array.isArray(obj)) {+ obj.forEach((item) => {+ return getAllKeys(item, keySet);+ });+ return keySet;+ }++ Object.keys(obj).forEach((key) => {+ keySet.add(key);+ getAllKeys(obj[key as keyof typeof obj], keySet);+ });++ return keySet;+}+describe("URL Compression Utilities", () => {describe("compressInvoiceData", () => {it("should compress invoice data by remapping keys to shorter identifiers", () => {@@ -419,9 +443,7 @@ describe("URL Compression Utilities", () => {notes: undefined,};- const compressedData = compressInvoiceData(- dataWithUndefined as unknown as InvoiceData,- );+ const compressedData = compressInvoiceData(dataWithUndefined);const decompressedData = decompressInvoiceData(compressedData);expect(decompressedData.invoiceNumberObject).toBeUndefined();@@ -467,9 +489,7 @@ describe("URL Compression Utilities", () => {],};- const compressedData = compressInvoiceData(- complexData as unknown as InvoiceData,- );+ const compressedData = compressInvoiceData(complexData);const decompressedData = decompressInvoiceData(compressedData);expect(decompressedData).toEqual(complexData);@@ -494,7 +514,7 @@ describe("URL Compression Utilities", () => {const compressedNull = compressInvoiceData(null as unknown as InvoiceData,);- expect(compressedNull).toBe(null);+ expect(compressedNull).toBeNull();});it("should maintain data types after compression/decompression", () => {@@ -557,79 +577,31 @@ describe("URL Compression Utilities", () => {...invoiceItemKeys,];- // Check that each key exists in INVOICE_KEY_COMPRESSION_MAP- const missingKeys: string[] = [];-- allKeys.forEach((key) => {- if (!(key in INVOICE_KEY_COMPRESSION_MAP)) {- missingKeys.push(key);- }+ // Check that each key exists in INVOICE_KEY_COMPRESSION_MAP.+ // A failure prints the missing keys, so no extra logging is needed.+ const missingKeys = allKeys.filter((key) => {+ return !(key in INVOICE_KEY_COMPRESSION_MAP);});expect(missingKeys).toEqual([]);-- if (missingKeys.length > 0) {- console.log(- "Missing keys in INVOICE_KEY_COMPRESSION_MAP:",- missingKeys,- );- }});it("should not have duplicate compressed values in INVOICE_KEY_COMPRESSION_MAP", () => {const compressedValues = Object.values(INVOICE_KEY_COMPRESSION_MAP);- const uniqueValues = Array.from(new Set(compressedValues));-- expect(compressedValues).toHaveLength(uniqueValues.length);+ const duplicates = compressedValues.filter((value, index) => {+ return compressedValues.indexOf(value) !== index;+ });- if (compressedValues.length !== uniqueValues.length) {- const duplicates = compressedValues.filter(- (value, index) => compressedValues.indexOf(value) !== index,- );- console.log("Duplicate compressed values:", duplicates);- }+ expect(duplicates).toEqual([]);});it("should have a INVOICE_KEY_COMPRESSION_MAP entry for every key used in MOCK_INVOICE_DATA", () => {- // Extract all keys recursively from the mock data- function getAllKeys(- obj: unknown,- keySet = new Set<string>(),- ): Set<string> {- if (obj === null || typeof obj !== "object") {- return keySet;- }-- if (Array.isArray(obj)) {- obj.forEach((item) => getAllKeys(item, keySet));- return keySet;- }-- Object.keys(obj).forEach((key) => {- keySet.add(key);- getAllKeys(obj[key as keyof typeof obj], keySet);- });-- return keySet;- }-const allKeysInMockData = getAllKeys(MOCK_INVOICE_DATA);- const missingKeys: string[] = [];-- allKeysInMockData.forEach((key) => {- if (!(key in INVOICE_KEY_COMPRESSION_MAP)) {- missingKeys.push(key);- }+ const missingKeys = Array.from(allKeysInMockData).filter((key) => {+ return !(key in INVOICE_KEY_COMPRESSION_MAP);});expect(missingKeys).toStrictEqual([]);-- if (missingKeys.length > 0) {- console.log(- "Keys in MOCK_INVOICE_DATA missing from INVOICE_KEY_COMPRESSION_MAP:",- missingKeys,- );- }});});});@@ -651,12 +623,14 @@ describe("URL Compression Utilities", () => {it("should demonstrate compression effectiveness with multiple items", () => {const largeInvoiceData = {...MOCK_INVOICE_DATA,- items: Array.from({ length: 10 }, (_, index) => ({- ...MOCK_INVOICE_ITEM_DATA,- name: `Product ${index + 1}`,- amount: index + 1,- netPrice: (index + 1) * 10.5,- })),+ items: Array.from({ length: 10 }, (_, index) => {+ return {+ ...MOCK_INVOICE_ITEM_DATA,+ name: `Product ${index + 1}`,+ amount: index + 1,+ netPrice: (index + 1) * 10.5,+ };+ }),};const originalJson = JSON.stringify(largeInvoiceData);@@ -671,9 +645,9 @@ describe("URL Compression Utilities", () => {expect(reductionRatio).toBeGreaterThan(0.25);// Log the size reduction for visibility- console.log(`Original size: ${originalJson.length} characters`);- console.log(`Compressed size: ${compressedJson.length} characters`);- console.log(`Size reduction: ${(reductionRatio * 100).toFixed(1)}%`);+ console.info(`Original size: ${originalJson.length} characters`);+ console.info(`Compressed size: ${compressedJson.length} characters`);+ console.info(`Size reduction: ${(reductionRatio * 100).toFixed(1)}%`);});});});diff --git a/src/utils/invoice.utils.ts b/src/utils/invoice.utils.tsindex ead194f..4830213 100644--- a/src/utils/invoice.utils.ts+++ b/src/utils/invoice.utils.ts@@ -1,10 +1,11 @@-import { SUPPORTED_LANGUAGES, type SupportedLanguages } from "@/app/schema";-import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";import * as Sentry from "@sentry/nextjs";import n2words from "n2words";import { toast } from "sonner";import { z } from "zod";+import { SUPPORTED_LANGUAGES, type SupportedLanguages } from "@/app/schema";+import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";+/*** Get the amount in words (e.g. 123.45 -> "one hundred twenty-three and 45/100 dollars")* @param amount - The amount to convert to words@@ -18,9 +19,10 @@ export function getAmountInWords({amount: number;language: SupportedLanguages;}) {+ // zod v4's `z.number()` rejects non-finite values on its own, so the old+ // `.finite()` call is no longer needed.const amountSchema = z.number()- .finite().nonnegative("Amount must be non-negative").transform(Math.floor);@@ -75,7 +77,7 @@ export function getAmountInWords({* @returns The fractional part of the total*/export function getNumberFractionalPart(total = 0) {- const schema = z.number().finite().nonnegative("Amount must be non-negative");+ const schema = z.number().nonnegative("Amount must be non-negative");const parsedTotal = schema.safeParse(total);diff --git a/src/utils/url-compression.ts b/src/utils/url-compression.tsindex ee8714c..8a24412 100644--- a/src/utils/url-compression.ts+++ b/src/utils/url-compression.ts@@ -120,10 +120,9 @@ export const INVOICE_KEY_COMPRESSION_MAP = {* Reverse mapping for decompression*/const REVERSE_KEY_MAP = Object.fromEntries(- Object.entries(INVOICE_KEY_COMPRESSION_MAP).map(([key, value]) => [- value,- key,- ]),+ Object.entries(INVOICE_KEY_COMPRESSION_MAP).map(([key, value]) => {+ return [value, key];+ }),) as Record<string, keyof typeof INVOICE_KEY_COMPRESSION_MAP>;/**@@ -152,7 +151,9 @@ function remapKeys<T>(}if (Array.isArray(obj)) {- return obj.map(remapKeys) as T extends Record<string, unknown>+ return obj.map((item: unknown) => {+ return remapKeys(item);+ }) as T extends Record<string, unknown>? Record<string, unknown>: T extends unknown[]? unknown[]@@ -202,7 +203,9 @@ function restoreKeys<T>(}if (Array.isArray(obj)) {- return obj.map(restoreKeys) as T extends Record<string, unknown>+ return obj.map((item: unknown) => {+ return restoreKeys(item);+ }) as T extends Record<string, unknown>? Record<string, unknown>: T extends unknown[]? unknown[]diff --git a/tailwind.config.ts b/tailwind.config.tsindex 513b9f7..d345c4d 100644--- a/tailwind.config.ts+++ b/tailwind.config.ts@@ -107,7 +107,8 @@ const config: Config = {},},},- // eslint-disable-next-line @typescript-eslint/no-require-imports+ // tailwind v3 resolves plugins through CJS `require`+ // oxlint-disable-next-line typescript/no-require-importsplugins: [require("tailwindcss-animate"), require("@tailwindcss/typography")],};export default config;diff --git a/trigger.config.ts b/trigger.config.tsindex a983d7d..fac8cdc 100644--- a/trigger.config.ts+++ b/trigger.config.ts@@ -18,7 +18,7 @@ export default defineConfig({default: {maxAttempts: 3,minTimeoutInMs: 1000,- maxTimeoutInMs: 10000,+ maxTimeoutInMs: 10_000,factor: 2,randomize: true,},diff --git a/tsconfig.json b/tsconfig.jsonindex 1855e96..d620610 100644--- a/tsconfig.json+++ b/tsconfig.json@@ -13,6 +13,7 @@"jsx": "preserve","incremental": true,"allowArbitraryExtensions": true,+ "noImplicitReturns": true,"plugins": [{"name": "next"diff --git a/vitest.config.ts b/vitest.config.tsindex b47b31b..8923e14 100644--- a/vitest.config.ts+++ b/vitest.config.ts@@ -1,6 +1,7 @@-import { defineConfig } from "vitest/config";import path from "node:path";+import { defineConfig } from "vitest/config";+export default defineConfig({esbuild: {jsx: "automatic",