{"version":3,"sources":["../src/core/factories/RehydrationFactory.ts","../src/core/abstracts/AbstractApiData.ts","../src/core/abstracts/AbstractService.ts","../src/client/JsonApiClient.ts","../src/core/abstracts/ClientAbstractService.ts","../src/core/registry/ModuleRegistrar.ts","../src/core/registry/ModuleRegistry.ts","../src/core/endpoint/EndpointCreator.ts","../src/core/fields/FieldSelector.ts","../src/core/utils/rehydrate.ts","../src/utils/cn.ts","../src/utils/compose-refs.ts","../src/utils/use-mobile.tsx","../src/utils/date-formatter.ts","../src/utils/exists.ts","../src/utils/table-options.ts","../src/utils/schemas/user.object.schema.ts","../src/utils/schemas/entity.object.schema.ts","../src/utils/getInitials.ts","../src/utils/isRemoteImageSrc.ts","../src/utils/italian-validators.ts","../src/utils/blocknote-diff.util.ts","../src/utils/blocknote-word-diff-renderer.util.ts","../src/utils/icons.tsx","../src/utils/toast.ts","../src/permissions/types.ts","../src/permissions/check.ts","../src/features/auth/data/totp-authenticator.ts","../src/features/auth/totp-authenticator.module.ts","../src/features/auth/data/totp-setup.ts","../src/features/auth/totp-setup.module.ts","../src/features/auth/data/totp-verify.ts","../src/features/auth/totp-verify.module.ts","../src/features/auth/data/totp-verify-login.ts","../src/features/auth/totp-verify-login.module.ts","../src/features/auth/data/passkey.ts","../src/features/auth/passkey.module.ts","../src/features/auth/data/passkey-registration-options.ts","../src/features/auth/passkey-registration-options.module.ts","../src/features/auth/data/passkey-registration-verify.ts","../src/features/auth/passkey-registration-verify.module.ts","../src/features/auth/data/passkey-rename.ts","../src/features/auth/passkey-rename.module.ts","../src/features/auth/data/passkey-verify-login.ts","../src/features/auth/passkey-verify-login.module.ts","../src/features/auth/data/passkey-authentication-options.ts","../src/features/auth/passkey-authentication-options.module.ts","../src/features/auth/data/two-factor-enable.ts","../src/features/auth/two-factor-enable.module.ts","../src/features/auth/data/two-factor-challenge.ts","../src/features/auth/two-factor-challenge.module.ts","../src/features/auth/data/backup-code-verify.ts","../src/features/auth/backup-code-verify.module.ts","../src/features/auth/config.ts","../src/features/auth/data/auth.ts","../src/features/auth/data/auth.service.ts","../src/features/auth/data/two-factor-status.ts","../src/features/auth/data/two-factor.service.ts","../src/features/auth/enums/AuthComponent.ts","../src/features/auth/auth.module.ts","../src/features/auth/two-factor-status.module.ts","../src/features/billing/data/billing.service.ts","../src/features/billing/data/Billing.ts","../src/features/billing/modules/billing.module.ts","../src/features/billing/stripe-customer/data/payment-method.ts","../src/features/billing/stripe-customer/data/stripe-customer.ts","../src/features/billing/stripe-customer/data/stripe-customer.service.ts","../src/features/billing/stripe-customer/stripe-customer.module.ts","../src/features/billing/stripe-customer/stripe-payment-method.module.ts","../src/features/billing/stripe-invoice/data/stripe-invoice.ts","../src/features/billing/stripe-invoice/data/stripe-invoice.interface.ts","../src/features/billing/stripe-invoice/data/stripe-invoice.service.ts","../src/features/billing/stripe-invoice/stripe-invoice.module.ts","../src/features/billing/stripe-price/data/stripe-price.ts","../src/features/billing/stripe-price/data/stripe-price.fields.ts","../src/features/billing/stripe-price/data/stripe-price.service.ts","../src/features/billing/stripe-price/stripe-price.module.ts","../src/features/billing/stripe-product/data/stripe-product.ts","../src/features/billing/stripe-product/data/stripe-product.fields.ts","../src/features/billing/stripe-product/data/stripe-product.service.ts","../src/features/billing/stripe-product/stripe-product.module.ts","../src/features/billing/stripe-subscription/data/stripe-subscription.ts","../src/features/billing/stripe-subscription/data/stripe-subscription.interface.ts","../src/features/billing/stripe-subscription/data/stripe-subscription.service.ts","../src/features/billing/stripe-subscription/stripe-subscription.module.ts","../src/features/billing/stripe-usage/data/stripe-usage.ts","../src/features/billing/stripe-usage/data/stripe-usage.service.ts","../src/features/billing/stripe-usage/stripe-usage.module.ts","../src/features/billing/stripe-promotion-code/data/stripe-promotion-code.service.ts","../src/features/billing/stripe-promotion-code/data/stripe-promotion-code.ts","../src/features/billing/stripe-promotion-code/stripe-promotion-code.module.ts","../src/features/ai-connection/data/ai-connection.ts","../src/features/ai-connection/data/ai-connection.fields.ts","../src/features/ai-connection/data/ai-connection.service.ts","../src/features/ai-connection/ai-connection.module.ts","../src/features/company/company.module.ts","../src/features/company/data/company.ts","../src/features/company/data/company.fields.ts","../src/features/company/data/company.service.ts","../src/features/company/data/entity-ai-status.ts","../src/features/content/data/content.ts","../src/features/content/data/content.fields.ts","../src/features/content/data/content.service.ts","../src/features/content/content.module.ts","../src/features/how-to/HowToModule.ts","../src/features/how-to/data/HowTo.ts","../src/features/how-to/data/HowToFields.ts","../src/features/how-to/data/HowToService.ts","../src/features/assistant/AssistantModule.ts","../src/features/assistant/data/Assistant.ts","../src/features/assistant-message/data/AssistantMessage.ts","../src/features/assistant/utils/resolveReferenceableModules.ts","../src/features/assistant/data/AssistantService.ts","../src/features/assistant-message/AssistantMessageModule.ts","../src/features/assistant-message/data/AssistantMessageService.ts","../src/features/assistant-action/AssistantActionModule.ts","../src/features/assistant-action/data/AssistantAction.ts","../src/features/assistant-action/data/AssistantActionService.ts","../src/features/chunk/ChunkModule.ts","../src/features/chunk/data/Chunk.ts","../src/features/feature/data/feature.ts","../src/features/feature/data/feature.service.ts","../src/features/feature/feature.module.ts","../src/features/module/data/module.ts","../src/features/module/module.module.ts","../src/features/notification/data/notification.ts","../src/features/notification/data/notification.fields.ts","../src/features/notification/data/notification.service.ts","../src/features/notification/notification.module.ts","../src/features/push/data/push.ts","../src/features/push/data/push.service.ts","../src/features/push/push.module.ts","../src/features/role/data/role.ts","../src/features/role/data/role.fields.ts","../src/features/role/data/role.service.ts","../src/features/role/role.module.ts","../src/features/s3/data/s3.ts","../src/features/s3/s3.module.ts","../src/features/s3/data/s3.service.ts","../src/features/user/data/user.ts","../src/features/user/data/user.fields.ts","../src/features/user/data/user.service.ts","../src/features/user/data/user.storage.ts","../src/features/user/author.module.ts","../src/features/user/user.module.ts","../src/features/oauth/data/oauth.ts","../src/features/oauth/oauth.module.ts","../src/features/oauth/data/oauth.service.ts","../src/features/oauth/interfaces/oauth.interface.ts","../src/features/waitlist/data/Waitlist.ts","../src/features/waitlist/data/WaitlistService.ts","../src/features/waitlist/data/waitlist-stats.ts","../src/features/waitlist/waitlist.module.ts","../src/features/waitlist/waitlist-stats.module.ts","../src/features/rbac/data/PermissionMapping.ts","../src/features/rbac/data/ModulePaths.ts","../src/features/rbac/data/RbacMatrixModel.ts","../src/features/rbac/rbac.module.ts","../src/features/referral/data/ReferralStats.ts","../src/features/referral/data/ReferralService.ts","../src/features/referral/referral.module.ts","../src/features/referral/referral-stats.module.ts","../src/features/tokenusage/data/tokenusage-admin-breakdown.ts","../src/features/tokenusage/data/tokenusage-admin-summary.ts","../src/features/tokenusage/data/tokenusage-admin-timeline.ts","../src/features/tokenusage/tokenusage-admin.module.ts","../src/features/tokenusage/data/tokenusage-report-breakdown.ts","../src/features/tokenusage/data/tokenusage-report-summary.ts","../src/features/tokenusage/data/tokenusage-report-timeline.ts","../src/features/tokenusage/tokenusage.modules.ts","../src/features/tokenusage/lib/config.ts","../src/features/audit-log/data/audit-log.ts","../src/features/audit-log/data/audit-log.service.ts","../src/features/audit-log/audit-log.module.ts"],"sourcesContent":["import { ApiDataInterface } from \"../interfaces/ApiDataInterface\";\nimport { ApiRequestDataTypeInterface } from \"../interfaces/ApiRequestDataTypeInterface\";\nimport { JsonApiHydratedDataInterface } from \"../interfaces/JsonApiHydratedDataInterface\";\nimport { DataClassRegistry } from \"../registry/DataClassRegistry\";\n\nexport class RehydrationFactory {\n  public static rehydrate<T extends ApiDataInterface>(\n    classKey: ApiRequestDataTypeInterface,\n    data: JsonApiHydratedDataInterface,\n  ): T {\n    const factoryClass = DataClassRegistry.get(classKey);\n\n    const instance = new factoryClass();\n    return instance.rehydrate(data) as T;\n  }\n\n  public static rehydrateList<T extends ApiDataInterface>(\n    classKey: ApiRequestDataTypeInterface,\n    data: JsonApiHydratedDataInterface[],\n  ): T[] {\n    const factoryClass = DataClassRegistry.get(classKey);\n\n    const response = data.map((item: JsonApiHydratedDataInterface) => {\n      const instance = new factoryClass();\n      return instance.rehydrate(item) as T;\n    });\n\n    return response;\n  }\n}\n","import { RehydrationFactory } from \"../factories/RehydrationFactory\";\nimport { ApiDataInterface } from \"../interfaces/ApiDataInterface\";\nimport { ApiRequestDataTypeInterface } from \"../interfaces/ApiRequestDataTypeInterface\";\nimport { JsonApiHydratedDataInterface } from \"../interfaces/JsonApiHydratedDataInterface\";\n\nexport abstract class AbstractApiData implements ApiDataInterface {\n  static identifierFields: string[] = [\"name\"];\n\n  get identifier(): string {\n    const fields = (this.constructor as typeof AbstractApiData).identifierFields;\n    return fields\n      .map((field) => this._jsonApi?.attributes?.[field])\n      .filter((v) => v != null && v !== \"\")\n      .join(\" \");\n  }\n\n  protected _jsonApi?: any;\n  protected _included?: any[];\n\n  protected _id?: string;\n  protected _type?: string;\n  protected _createdAt?: Date;\n  protected _updatedAt?: Date;\n\n  protected _self?: string;\n\n  get type(): string {\n    if (!this._type) throw new Error(\"Type is not set.\");\n    return this._type;\n  }\n\n  get id(): string {\n    if (!this._id) throw new Error(\"Id is not set.\");\n    return this._id;\n  }\n\n  get self(): string | undefined {\n    return this._self;\n  }\n\n  get createdAt(): Date {\n    return this._createdAt ?? new Date();\n  }\n\n  get updatedAt(): Date {\n    return this._updatedAt ?? new Date();\n  }\n\n  get included(): any[] {\n    return this._included ?? [];\n  }\n\n  get jsonApi(): any {\n    return this._jsonApi;\n  }\n\n  ingestJsonApi(_data: JsonApiHydratedDataInterface): void {}\n\n  generateApiUrl(_params?: any): string {\n    throw new Error(\"Method not implemented.\");\n  }\n\n  createJsonApi(_data?: any): any {\n    throw new Error(\"Method not implemented.\");\n  }\n\n  protected _readIncluded<T extends ApiDataInterface>(\n    data: JsonApiHydratedDataInterface,\n    type: string,\n    dataType: ApiRequestDataTypeInterface,\n  ): T | T[] | undefined {\n    if (\n      data.included === undefined ||\n      data.included.length === 0 ||\n      data.jsonApi.relationships === undefined ||\n      data.jsonApi.relationships[type] === undefined ||\n      data.jsonApi.relationships[type].data === undefined\n    ) {\n      return undefined;\n    }\n\n    if (Array.isArray(data.jsonApi.relationships[type].data)) {\n      const response: T[] = data.jsonApi.relationships[type].data.map((jsonApiData: any) => {\n        const includedData = data.included.find(\n          (includedData: any) => includedData.id === jsonApiData.id && includedData.type === jsonApiData.type,\n        );\n\n        if (includedData === undefined) return undefined;\n\n        return RehydrationFactory.rehydrate(dataType, {\n          jsonApi: includedData,\n          included: data.included,\n        }) as T;\n      });\n\n      return response.filter((item: T | undefined) => item !== undefined) as T[];\n    }\n\n    const includedData = data.included.find(\n      (includedData: any) =>\n        includedData.id === data.jsonApi.relationships[type].data.id &&\n        includedData.type === data.jsonApi.relationships[type].data.type,\n    );\n\n    if (includedData === undefined && data.allData !== undefined) {\n      // Try to find in allData as a fallback\n      const fallbackData = data.allData.find(\n        (includedData: any) =>\n          includedData.id === data.jsonApi.relationships[type].data.id &&\n          includedData.type === data.jsonApi.relationships[type].data.type,\n      );\n      if (fallbackData !== undefined) {\n        return RehydrationFactory.rehydrate(dataType, {\n          jsonApi: fallbackData,\n          included: data.included,\n        }) as T;\n      }\n    }\n\n    if (includedData === undefined) return undefined;\n\n    return RehydrationFactory.rehydrate(dataType, {\n      jsonApi: includedData,\n      included: data.included,\n    }) as T;\n  }\n\n  /**\n   * Read included relationships with polymorphic type resolution.\n   * Determines the correct model class based on the JSON:API type in included data.\n   */\n  protected _readIncludedPolymorphic<T extends ApiDataInterface>(\n    data: JsonApiHydratedDataInterface,\n    relationshipKey: string,\n    candidateModules: ApiRequestDataTypeInterface[],\n  ): T | T[] | undefined {\n    // Validate relationship exists\n    if (!data.included?.length || !data.jsonApi.relationships?.[relationshipKey]?.data) {\n      return undefined;\n    }\n\n    const relData = data.jsonApi.relationships[relationshipKey].data;\n\n    // Build lookup map: JSON:API type -> module\n    const typeToModule = new Map<string, ApiRequestDataTypeInterface>();\n    for (const mod of candidateModules) {\n      typeToModule.set(mod.name, mod);\n    }\n\n    if (Array.isArray(relData)) {\n      // Many relationship\n      const result: T[] = [];\n      for (const item of relData) {\n        const includedItem = data.included.find((inc: any) => inc.id === item.id && inc.type === item.type);\n        if (!includedItem) continue;\n\n        // Resolve module by JSON:API type\n        const module = typeToModule.get(includedItem.type);\n        if (!module) continue;\n\n        result.push(\n          RehydrationFactory.rehydrate(module, {\n            jsonApi: includedItem,\n            included: data.included,\n          }) as T,\n        );\n      }\n      return result.length > 0 ? result : undefined;\n    }\n\n    // Single relationship\n    const includedItem = data.included.find((inc: any) => inc.id === relData.id && inc.type === relData.type);\n    if (!includedItem) return undefined;\n\n    const module = typeToModule.get(includedItem.type);\n    if (!module) return undefined;\n\n    return RehydrationFactory.rehydrate(module, {\n      jsonApi: includedItem,\n      included: data.included,\n    }) as T;\n  }\n\n  /**\n   * Read included relationship data and augment with relationship meta properties.\n   * Handles both single relationships (one-to-one) and array relationships (one-to-many).\n   *\n   * For single relationships: meta is read from `relationships[type].meta`\n   * For array relationships: per-item meta is read from `relationships[type].data[].meta`\n   *\n   * @param data - Hydrated JSON:API data\n   * @param type - Relationship type key (e.g., \"guide\", \"persons\")\n   * @param dataType - Module reference for rehydration\n   * @returns Related object(s) augmented with meta properties, or undefined\n   */\n  protected _readIncludedWithMeta<T extends ApiDataInterface, M extends Record<string, any>>(\n    data: JsonApiHydratedDataInterface,\n    type: string,\n    dataType: ApiRequestDataTypeInterface,\n  ): (T & M) | (T & M)[] | undefined {\n    // Check if relationship exists\n    if (\n      data.included === undefined ||\n      data.included.length === 0 ||\n      data.jsonApi.relationships === undefined ||\n      data.jsonApi.relationships[type] === undefined ||\n      data.jsonApi.relationships[type].data === undefined\n    ) {\n      return undefined;\n    }\n\n    const relationshipData = data.jsonApi.relationships[type].data;\n\n    // Handle array relationships with per-item meta\n    if (Array.isArray(relationshipData)) {\n      const result: (T & M)[] = [];\n\n      for (const item of relationshipData) {\n        const includedData = data.included.find((inc: any) => inc.id === item.id && inc.type === item.type);\n\n        if (!includedData) continue;\n\n        const entity = RehydrationFactory.rehydrate(dataType, {\n          jsonApi: includedData,\n          included: data.included,\n        }) as T;\n\n        // Merge per-item meta from relationships[type].data[].meta\n        if (item.meta) {\n          Object.assign(entity, item.meta);\n        }\n\n        result.push(entity as T & M);\n      }\n\n      return result;\n    }\n\n    // Handle single relationship\n    const includedData = data.included.find(\n      (inc: any) => inc.id === relationshipData.id && inc.type === relationshipData.type,\n    );\n\n    if (!includedData) {\n      // Try to find in allData as a fallback\n      if (data.allData !== undefined) {\n        const fallbackData = data.allData.find(\n          (inc: any) => inc.id === relationshipData.id && inc.type === relationshipData.type,\n        );\n        if (fallbackData) {\n          const entity = RehydrationFactory.rehydrate(dataType, {\n            jsonApi: fallbackData,\n            included: data.included,\n          }) as T;\n\n          // Merge relationship-level meta for single relationships\n          const relationshipMeta = data.jsonApi.relationships[type].meta;\n          if (relationshipMeta) {\n            Object.assign(entity, relationshipMeta);\n          }\n          return entity as T & M;\n        }\n      }\n      return undefined;\n    }\n\n    const entity = RehydrationFactory.rehydrate(dataType, {\n      jsonApi: includedData,\n      included: data.included,\n    }) as T;\n\n    // Merge relationship-level meta for single relationships\n    const relationshipMeta = data.jsonApi.relationships[type].meta;\n    if (relationshipMeta) {\n      Object.assign(entity, relationshipMeta);\n    }\n\n    return entity as T & M;\n  }\n\n  dehydrate(): JsonApiHydratedDataInterface {\n    return {\n      jsonApi: this._jsonApi,\n      included: this._included ?? [],\n    };\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    this._jsonApi = data.jsonApi;\n    this._included = data.included;\n\n    this._type = this._jsonApi.type;\n    this._id = this._jsonApi.id;\n    this._createdAt = this._jsonApi.meta?.createdAt !== undefined ? new Date(this._jsonApi.meta.createdAt) : undefined;\n    this._updatedAt = this._jsonApi.meta?.updatedAt !== undefined ? new Date(this._jsonApi.meta.updatedAt) : undefined;\n\n    this._self = this._jsonApi.links?.self ?? undefined;\n\n    return this;\n  }\n}\n","import { ApiRequestDataTypeInterface } from \"../interfaces/ApiRequestDataTypeInterface\";\nimport { ApiResponseInterface } from \"../interfaces/ApiResponseInterface\";\n\nexport enum HttpMethod {\n  GET = \"GET\",\n  POST = \"POST\",\n  PUT = \"PUT\",\n  PATCH = \"PATCH\",\n  DELETE = \"DELETE\",\n}\n\nexport interface NextRef {\n  next?: string;\n}\n\nexport interface PreviousRef {\n  previous?: string;\n}\n\nexport interface SelfRef {\n  self?: string;\n}\n\nexport interface TotalRef {\n  total?: number;\n}\n\n// Store the last total from any API call - accessible by hooks\nlet lastApiTotal: number | undefined = undefined;\n\nexport function getLastApiTotal(): number | undefined {\n  return lastApiTotal;\n}\n\nexport function clearLastApiTotal(): void {\n  lastApiTotal = undefined;\n}\n\n// Store the last full top-level `meta` object from any list API call - accessible by\n// hooks that need aggregate meta beyond `total` (e.g. per-list counts). Same\n// module-global design as lastApiTotal above.\nlet lastApiMeta: Record<string, any> | undefined = undefined;\n\nexport function getLastApiMeta(): Record<string, any> | undefined {\n  return lastApiMeta;\n}\n\nexport function clearLastApiMeta(): void {\n  lastApiMeta = undefined;\n}\n\nlet globalErrorHandler: ((status: number, message: string) => void) | null = null;\n\n/**\n * Set a global error handler for API errors (client-side only).\n * This handler will be called instead of throwing errors.\n */\nexport function setGlobalErrorHandler(handler: (status: number, message: string) => void) {\n  globalErrorHandler = handler;\n}\n\n/**\n * Get the current global error handler.\n */\nexport function getGlobalErrorHandler(): ((status: number, message: string) => void) | null {\n  return globalErrorHandler;\n}\n\n/**\n * Abstract base class for services that interact with the JSON:API.\n * Extend this class to create feature-specific services.\n */\nexport abstract class AbstractService {\n  /**\n   * Extract locale from client-side URL pathname\n   * URL structure: /{locale}/route-path (e.g., /it/accounts)\n   * Fallback chain: URL locale → navigator.language → \"en\"\n   */\n  private static getClientLocale(): string {\n    if (typeof window === \"undefined\") {\n      return \"en\"; // Server-side fallback\n    }\n\n    // Extract locale from URL pathname (first segment after leading slash)\n    const pathSegments = window.location.pathname.split(\"/\").filter(Boolean);\n    const urlLocale = pathSegments[0];\n\n    // Validate against supported locales (currently only \"en\")\n    const supportedLocales = [\"en\"];\n    if (urlLocale && supportedLocales.includes(urlLocale)) {\n      return urlLocale;\n    }\n\n    // Fallback to navigator language\n    const navigatorLocale = navigator.language.split(\"-\")[0];\n    if (navigatorLocale && supportedLocales.includes(navigatorLocale)) {\n      return navigatorLocale;\n    }\n\n    // Final fallback\n    return \"en\";\n  }\n\n  static async next<T>(params: {\n    type: ApiRequestDataTypeInterface;\n    endpoint: string;\n    next?: NextRef;\n    previous?: PreviousRef;\n    self?: SelfRef;\n    total?: TotalRef;\n  }): Promise<T> {\n    return await this.callApi<T>({\n      method: HttpMethod.GET,\n      type: params.type,\n      endpoint: params.endpoint,\n      next: params.next,\n      previous: params.previous,\n      self: params.self,\n      total: params.total,\n    });\n  }\n\n  /**\n   * Fetch the previous page of results.\n   */\n  static async previous<T>(params: {\n    type: ApiRequestDataTypeInterface;\n    endpoint: string;\n    next?: NextRef;\n    previous?: PreviousRef;\n    self?: SelfRef;\n    total?: TotalRef;\n  }): Promise<T> {\n    return await this.callApi<T>({\n      method: HttpMethod.GET,\n      type: params.type,\n      endpoint: params.endpoint,\n      next: params.next,\n      previous: params.previous,\n      self: params.self,\n      total: params.total,\n    });\n  }\n\n  /**\n   * Make an API call with automatic environment detection and error handling.\n   */\n  protected static async callApi<T>(params: {\n    type: ApiRequestDataTypeInterface;\n    method: HttpMethod;\n    endpoint: string;\n    companyId?: string;\n    input?: any;\n    overridesJsonApiCreation?: boolean;\n    next?: NextRef;\n    previous?: PreviousRef;\n    self?: SelfRef;\n    total?: TotalRef;\n    responseType?: ApiRequestDataTypeInterface;\n    files?: { [key: string]: File | Blob } | File | Blob;\n    token?: string;\n    suppressGlobalError?: boolean;\n    /**\n     * Per-call override of the API base URL. When omitted, the existing global\n     * `NEXT_PUBLIC_API_URL` (or `configureJsonApi({ apiUrl })`) resolution is used —\n     * fully backward compatible. Ignored when `endpoint` starts with \"http\" (passthrough).\n     */\n    baseUrl?: string;\n  }): Promise<T> {\n    // Dynamic import to avoid bundling issues\n    const { JsonApiGet, JsonApiPost, JsonApiPut, JsonApiPatch, JsonApiDelete } =\n      await import(\"../../unified/JsonApiRequest\");\n\n    let apiResponse: ApiResponseInterface;\n\n    // Get language based on environment\n    let language = \"en\";\n    if (typeof window === \"undefined\") {\n      const { getLocale } = await import(\"next-intl/server\");\n      language = (await getLocale()) ?? \"en\";\n    } else {\n      // Client-side: extract locale from URL pathname\n      language = this.getClientLocale();\n    }\n\n    switch (params.method) {\n      case HttpMethod.GET:\n        apiResponse = await JsonApiGet({\n          classKey: params.type,\n          endpoint: params.endpoint,\n          companyId: params.companyId,\n          language: language,\n          token: params.token,\n          baseUrl: params.baseUrl,\n        });\n        break;\n      case HttpMethod.POST:\n        apiResponse = await JsonApiPost({\n          classKey: params.type,\n          endpoint: params.endpoint,\n          companyId: params.companyId,\n          body: params.input,\n          overridesJsonApiCreation: params.overridesJsonApiCreation,\n          language: language,\n          responseType: params.responseType,\n          files: params.files,\n          token: params.token,\n          baseUrl: params.baseUrl,\n        });\n        break;\n      case HttpMethod.PUT:\n        apiResponse = await JsonApiPut({\n          classKey: params.type,\n          endpoint: params.endpoint,\n          companyId: params.companyId,\n          body: params.input,\n          language: language,\n          responseType: params.responseType,\n          files: params.files,\n          token: params.token,\n          baseUrl: params.baseUrl,\n        });\n        break;\n      case HttpMethod.PATCH:\n        apiResponse = await JsonApiPatch({\n          classKey: params.type,\n          endpoint: params.endpoint,\n          companyId: params.companyId,\n          body: params.input,\n          overridesJsonApiCreation: params.overridesJsonApiCreation,\n          language: language,\n          responseType: params.responseType,\n          files: params.files,\n          token: params.token,\n          baseUrl: params.baseUrl,\n        });\n        break;\n      case HttpMethod.DELETE:\n        apiResponse = await JsonApiDelete({\n          classKey: params.type,\n          endpoint: params.endpoint,\n          companyId: params.companyId,\n          language: language,\n          responseType: params.responseType,\n          token: params.token,\n          baseUrl: params.baseUrl,\n        });\n        break;\n      default:\n        throw new Error(\"Method not found\");\n    }\n\n    if (!apiResponse.ok) {\n      if (globalErrorHandler && typeof window !== \"undefined\" && !params.suppressGlobalError) {\n        globalErrorHandler(apiResponse.response, apiResponse.error);\n        return undefined as any;\n      } else {\n        const error = new Error(`${apiResponse.response}:${apiResponse.error}`) as any;\n        error.status = apiResponse.response;\n        error.digest = `HTTP_${apiResponse.response}`;\n        error.body = apiResponse.raw;\n        throw error;\n      }\n    }\n\n    if (apiResponse.next && params.next) params.next.next = apiResponse.next;\n    if (apiResponse.prev && params.previous) params.previous.previous = apiResponse.prev;\n    if (apiResponse.self && params.self) params.self.self = apiResponse.self;\n    // Always store total for hooks to access, and also populate ref if provided\n    if (apiResponse.meta?.total !== undefined) {\n      lastApiTotal = apiResponse.meta.total;\n      if (params.total) params.total.total = apiResponse.meta.total;\n    }\n    // Store the full top-level meta too, so hooks can read aggregates beyond `total`.\n    lastApiMeta = apiResponse.meta;\n\n    return apiResponse.data as T;\n  }\n\n  /**\n   * Make an API call and return both data and meta from the response.\n   */\n  protected static async callApiWithMeta<T>(params: {\n    type: ApiRequestDataTypeInterface;\n    method: HttpMethod;\n    endpoint: string;\n    companyId?: string;\n    input?: any;\n    overridesJsonApiCreation?: boolean;\n    responseType?: ApiRequestDataTypeInterface;\n    files?: { [key: string]: File | Blob } | File | Blob;\n    suppressGlobalError?: boolean;\n  }): Promise<{ data: T; meta?: Record<string, any> }> {\n    // Dynamic import to avoid bundling issues\n    const { JsonApiGet, JsonApiPost, JsonApiPut, JsonApiPatch, JsonApiDelete } =\n      await import(\"../../unified/JsonApiRequest\");\n\n    let apiResponse: ApiResponseInterface;\n\n    // Get language based on environment\n    let language = \"en\";\n    if (typeof window === \"undefined\") {\n      const { getLocale } = await import(\"next-intl/server\");\n      language = (await getLocale()) ?? \"en\";\n    } else {\n      // Client-side: extract locale from URL pathname\n      language = this.getClientLocale();\n    }\n\n    switch (params.method) {\n      case HttpMethod.GET:\n        apiResponse = await JsonApiGet({\n          classKey: params.type,\n          endpoint: params.endpoint,\n          companyId: params.companyId,\n          language: language,\n        });\n        break;\n      case HttpMethod.POST:\n        apiResponse = await JsonApiPost({\n          classKey: params.type,\n          endpoint: params.endpoint,\n          companyId: params.companyId,\n          body: params.input,\n          overridesJsonApiCreation: params.overridesJsonApiCreation,\n          language: language,\n          responseType: params.responseType,\n          files: params.files,\n        });\n        break;\n      case HttpMethod.PUT:\n        apiResponse = await JsonApiPut({\n          classKey: params.type,\n          endpoint: params.endpoint,\n          companyId: params.companyId,\n          body: params.input,\n          language: language,\n          responseType: params.responseType,\n          files: params.files,\n        });\n        break;\n      case HttpMethod.PATCH:\n        apiResponse = await JsonApiPatch({\n          classKey: params.type,\n          endpoint: params.endpoint,\n          companyId: params.companyId,\n          body: params.input,\n          overridesJsonApiCreation: params.overridesJsonApiCreation,\n          language: language,\n          responseType: params.responseType,\n          files: params.files,\n        });\n        break;\n      case HttpMethod.DELETE:\n        apiResponse = await JsonApiDelete({\n          classKey: params.type,\n          endpoint: params.endpoint,\n          companyId: params.companyId,\n          language: language,\n          responseType: params.responseType,\n        });\n        break;\n      default:\n        throw new Error(\"Method not found\");\n    }\n\n    if (!apiResponse.ok) {\n      if (globalErrorHandler && typeof window !== \"undefined\" && !params.suppressGlobalError) {\n        globalErrorHandler(apiResponse.response, apiResponse.error);\n        return { data: undefined as any, meta: undefined };\n      } else {\n        const error = new Error(`${apiResponse.response}:${apiResponse.error}`) as any;\n        error.status = apiResponse.response;\n        error.digest = `HTTP_${apiResponse.response}`;\n        error.body = apiResponse.raw;\n        throw error;\n      }\n    }\n\n    return {\n      data: apiResponse.data as T,\n      meta: apiResponse.meta,\n    };\n  }\n\n  /**\n   * Get raw JSON:API response data without deserialization.\n   */\n  protected static async getRawData(params: {\n    type: ApiRequestDataTypeInterface;\n    method: HttpMethod;\n    endpoint: string;\n    companyId?: string;\n    baseUrl?: string;\n    suppressGlobalError?: boolean;\n  }): Promise<any> {\n    const { JsonApiGet } = await import(\"../../unified/JsonApiRequest\");\n\n    let language = \"en\";\n\n    if (typeof window === \"undefined\") {\n      const { getLocale } = await import(\"next-intl/server\");\n      language = (await getLocale()) ?? \"en\";\n    } else {\n      // Client-side: extract locale from URL pathname\n      language = this.getClientLocale();\n    }\n\n    const apiResponse: ApiResponseInterface = await JsonApiGet({\n      classKey: params.type,\n      endpoint: params.endpoint,\n      companyId: params.companyId,\n      baseUrl: params.baseUrl,\n      language: language,\n    });\n\n    if (!apiResponse.ok) {\n      if (globalErrorHandler && typeof window !== \"undefined\" && !params.suppressGlobalError) {\n        globalErrorHandler(apiResponse.response, apiResponse.error);\n        return undefined as any;\n      } else {\n        const error = new Error(`${apiResponse.response}:${apiResponse.error}`) as any;\n        error.status = apiResponse.response;\n        error.digest = `HTTP_${apiResponse.response}`;\n        error.body = apiResponse.raw;\n        throw error;\n      }\n    }\n\n    return apiResponse.raw;\n  }\n}\n","\"use client\";\n\nimport { ENV } from \"../core/env\";\nimport { JsonApiDataFactory } from \"../core/factories/JsonApiDataFactory\";\nimport { ApiRequestDataTypeInterface } from \"../core/interfaces/ApiRequestDataTypeInterface\";\nimport { ApiResponseInterface } from \"../core/interfaces/ApiResponseInterface\";\nimport { setBootstrapper } from \"../core/registry/bootstrapStore\";\nimport { translateResponse } from \"../core/utils/translateResponse\";\nimport { ModuleWithPermissions } from \"../permissions/types\";\nimport { directFetch } from \"./request\";\nimport { getClientToken } from \"./token\";\n\n// Config storage for client contexts\nlet _clientConfig: {\n  apiUrl: string;\n  appUrl?: string;\n  trackablePages?: ModuleWithPermissions[];\n  bootstrapper?: () => void;\n  additionalHeaders?: Record<string, string>;\n} | null = null;\n\n/**\n * Configure the JSON:API client for browser contexts.\n * Call this in your client-side initialization or use JsonApiProvider.\n */\nexport function configureClientJsonApi(config: {\n  apiUrl: string;\n  appUrl?: string;\n  trackablePages?: ModuleWithPermissions[];\n  bootstrapper?: () => void;\n  additionalHeaders?: Record<string, string>;\n}): void {\n  _clientConfig = config;\n  if (config.bootstrapper) {\n    setBootstrapper(config.bootstrapper);\n    config.bootstrapper();\n  }\n}\n\nexport function getClientApiUrl(): string {\n  if (_clientConfig?.apiUrl) {\n    return _clientConfig.apiUrl;\n  }\n  const envUrl = ENV.API_URL;\n  if (!envUrl) {\n    throw new Error(\n      \"API URL not configured. Use configureClientJsonApi() or set NEXT_PUBLIC_API_URL environment variable.\",\n    );\n  }\n  return envUrl;\n}\n\nexport function getClientAppUrl(): string {\n  if (_clientConfig?.appUrl) {\n    return _clientConfig.appUrl;\n  }\n  const envUrl = ENV.APP_URL;\n  if (!envUrl) {\n    throw new Error(\n      \"App URL not configured. Use configureClientJsonApi({ appUrl }) or set NEXT_PUBLIC_ADDRESS environment variable.\",\n    );\n  }\n  return envUrl.trim().replace(/\\/+$/, \"\");\n}\n\nexport function getClientTrackablePages(): ModuleWithPermissions[] {\n  return _clientConfig?.trackablePages ?? [];\n}\n\nfunction runClientBootstrapper(): void {\n  if (_clientConfig?.bootstrapper) {\n    _clientConfig.bootstrapper();\n  }\n}\n\n/**\n * Resolve the final request URL for an endpoint (client-side variant of `buildUrl`\n * in `unified/JsonApiRequest.ts` — kept in lockstep with it).\n *\n * - `endpoint` starting with \"http\" is always passed through unchanged (existing behaviour).\n * - Otherwise, an explicit `baseUrl` (per-call override) takes precedence over the global\n *   `getClientApiUrl()` resolution. Omitting `baseUrl` preserves today's behaviour exactly.\n */\nexport function buildClientUrl(endpoint: string, baseUrl?: string): string {\n  if (endpoint.startsWith(\"http\")) return endpoint;\n  const apiUrl = baseUrl ?? getClientApiUrl();\n  return `${apiUrl}${endpoint}`;\n}\n\nexport async function ClientJsonApiGet(params: {\n  classKey: ApiRequestDataTypeInterface;\n  endpoint: string;\n  companyId?: string;\n  language: string;\n  baseUrl?: string;\n}): Promise<ApiResponseInterface> {\n  runClientBootstrapper();\n  const token = await getClientToken();\n\n  const apiResponse = await directFetch({\n    method: \"GET\",\n    url: buildClientUrl(params.endpoint, params.baseUrl),\n    token,\n    companyId: params.companyId,\n    language: params.language,\n    additionalHeaders: _clientConfig?.additionalHeaders,\n  });\n\n  return translateResponse({\n    classKey: params.classKey,\n    apiResponse,\n    companyId: params.companyId,\n    language: params.language,\n    paginationHandler: async (endpoint: string) =>\n      ClientJsonApiGet({\n        classKey: params.classKey,\n        endpoint,\n        companyId: params.companyId,\n        language: params.language,\n        baseUrl: params.baseUrl,\n      }),\n  });\n}\n\nexport async function ClientJsonApiPost(params: {\n  classKey: ApiRequestDataTypeInterface;\n  endpoint: string;\n  companyId?: string;\n  body?: any;\n  overridesJsonApiCreation?: boolean;\n  files?: { [key: string]: File | Blob } | File | Blob;\n  language: string;\n  responseType?: ApiRequestDataTypeInterface;\n  baseUrl?: string;\n}): Promise<ApiResponseInterface> {\n  runClientBootstrapper();\n  const token = await getClientToken();\n\n  let body = params.body;\n  if (!body) {\n    body = {};\n  } else if (params.overridesJsonApiCreation !== true) {\n    body = JsonApiDataFactory.create(params.classKey, body);\n  }\n\n  const apiResponse = await directFetch({\n    method: \"POST\",\n    url: buildClientUrl(params.endpoint, params.baseUrl),\n    token,\n    body,\n    files: params.files,\n    companyId: params.companyId,\n    language: params.language,\n    additionalHeaders: _clientConfig?.additionalHeaders,\n  });\n\n  return translateResponse({\n    classKey: params.responseType ?? params.classKey,\n    apiResponse,\n    companyId: params.companyId,\n    language: params.language,\n  });\n}\n\nexport async function ClientJsonApiPut(params: {\n  classKey: ApiRequestDataTypeInterface;\n  endpoint: string;\n  companyId?: string;\n  body?: any;\n  files?: { [key: string]: File | Blob } | File | Blob;\n  language: string;\n  responseType?: ApiRequestDataTypeInterface;\n  baseUrl?: string;\n}): Promise<ApiResponseInterface> {\n  runClientBootstrapper();\n  const token = await getClientToken();\n\n  let body = params.body;\n  if (!body) {\n    body = {};\n  } else {\n    body = JsonApiDataFactory.create(params.classKey, body);\n  }\n\n  const apiResponse = await directFetch({\n    method: \"PUT\",\n    url: buildClientUrl(params.endpoint, params.baseUrl),\n    token,\n    body,\n    files: params.files,\n    companyId: params.companyId,\n    language: params.language,\n    additionalHeaders: _clientConfig?.additionalHeaders,\n  });\n\n  return translateResponse({\n    classKey: params.responseType ?? params.classKey,\n    apiResponse,\n    companyId: params.companyId,\n    language: params.language,\n  });\n}\n\nexport async function ClientJsonApiPatch(params: {\n  classKey: ApiRequestDataTypeInterface;\n  endpoint: string;\n  companyId?: string;\n  body?: any;\n  files?: { [key: string]: File | Blob } | File | Blob;\n  overridesJsonApiCreation?: boolean;\n  responseType?: ApiRequestDataTypeInterface;\n  language: string;\n  baseUrl?: string;\n}): Promise<ApiResponseInterface> {\n  runClientBootstrapper();\n  const token = await getClientToken();\n\n  let body = params.body;\n  if (!body) {\n    body = {};\n  } else if (params.overridesJsonApiCreation !== true) {\n    body = JsonApiDataFactory.create(params.classKey, body);\n  }\n\n  const apiResponse = await directFetch({\n    method: \"PATCH\",\n    url: buildClientUrl(params.endpoint, params.baseUrl),\n    token,\n    body,\n    files: params.files,\n    companyId: params.companyId,\n    language: params.language,\n    additionalHeaders: _clientConfig?.additionalHeaders,\n  });\n\n  return translateResponse({\n    classKey: params.responseType ?? params.classKey,\n    apiResponse,\n    companyId: params.companyId,\n    language: params.language,\n  });\n}\n\nexport async function ClientJsonApiDelete(params: {\n  classKey: ApiRequestDataTypeInterface;\n  endpoint: string;\n  companyId?: string;\n  language: string;\n  responseType?: ApiRequestDataTypeInterface;\n  baseUrl?: string;\n}): Promise<ApiResponseInterface> {\n  runClientBootstrapper();\n  const token = await getClientToken();\n\n  const apiResponse = await directFetch({\n    method: \"DELETE\",\n    url: buildClientUrl(params.endpoint, params.baseUrl),\n    token,\n    companyId: params.companyId,\n    language: params.language,\n    additionalHeaders: _clientConfig?.additionalHeaders,\n  });\n\n  return translateResponse({\n    classKey: params.responseType ?? params.classKey,\n    apiResponse,\n    companyId: params.companyId,\n    language: params.language,\n  });\n}\n","\"use client\";\n\nimport { ApiRequestDataTypeInterface } from \"../interfaces/ApiRequestDataTypeInterface\";\nimport { ApiResponseInterface } from \"../interfaces/ApiResponseInterface\";\nimport {\n  ClientJsonApiGet,\n  ClientJsonApiPost,\n  ClientJsonApiPut,\n  ClientJsonApiPatch,\n  ClientJsonApiDelete,\n} from \"../../client/JsonApiClient\";\n// Duplicated to avoid importing from AbstractService which pulls in server code\n// These are exported so client services can import them from here instead of core\nexport enum ClientHttpMethod {\n  GET = \"GET\",\n  POST = \"POST\",\n  PUT = \"PUT\",\n  PATCH = \"PATCH\",\n  DELETE = \"DELETE\",\n}\n\nexport interface ClientNextRef {\n  next?: string;\n}\n\nexport interface ClientPreviousRef {\n  previous?: string;\n}\n\nexport interface ClientSelfRef {\n  self?: string;\n}\n\nexport interface ClientTotalRef {\n  total?: number;\n}\n\nlet globalErrorHandler: ((status: number, message: string) => void) | null = null;\n\n/**\n * Set a global error handler for API errors (client-side only).\n * This handler will be called instead of throwing errors.\n */\nexport function setClientGlobalErrorHandler(handler: (status: number, message: string) => void) {\n  globalErrorHandler = handler;\n}\n\n/**\n * Get the current global error handler.\n */\nexport function getClientGlobalErrorHandler(): ((status: number, message: string) => void) | null {\n  return globalErrorHandler;\n}\n\n/**\n * Client-side abstract base class for services that interact with the JSON:API.\n * Use this for client components.\n */\nexport abstract class ClientAbstractService {\n  /**\n   * Extract locale from client-side URL pathname\n   * URL structure: /{locale}/route-path (e.g., /it/accounts)\n   * Fallback chain: URL locale → navigator.language → \"en\"\n   */\n  private static getClientLocale(): string {\n    if (typeof window === \"undefined\") {\n      return \"en\"; // Should not happen in client service\n    }\n\n    // Extract locale from URL pathname (first segment after leading slash)\n    const pathSegments = window.location.pathname.split(\"/\").filter(Boolean);\n    const urlLocale = pathSegments[0];\n\n    // Validate against supported locales (currently only \"en\")\n    const supportedLocales = [\"en\"];\n    if (urlLocale && supportedLocales.includes(urlLocale)) {\n      return urlLocale;\n    }\n\n    // Fallback to navigator language\n    const navigatorLocale = navigator.language.split(\"-\")[0];\n    if (navigatorLocale && supportedLocales.includes(navigatorLocale)) {\n      return navigatorLocale;\n    }\n\n    // Final fallback\n    return \"en\";\n  }\n\n  /**\n   * Fetch the next page of results.\n   */\n  static async next<T>(params: {\n    type: ApiRequestDataTypeInterface;\n    endpoint: string;\n    next?: ClientNextRef;\n    previous?: ClientPreviousRef;\n    self?: ClientSelfRef;\n    total?: ClientTotalRef;\n  }): Promise<T> {\n    return await this.callApi<T>({\n      method: ClientHttpMethod.GET,\n      type: params.type,\n      endpoint: params.endpoint,\n      next: params.next,\n      previous: params.previous,\n      self: params.self,\n      total: params.total,\n    });\n  }\n\n  /**\n   * Fetch the previous page of results.\n   */\n  static async previous<T>(params: {\n    type: ApiRequestDataTypeInterface;\n    endpoint: string;\n    next?: ClientNextRef;\n    previous?: ClientPreviousRef;\n    self?: ClientSelfRef;\n    total?: ClientTotalRef;\n  }): Promise<T> {\n    return await this.callApi<T>({\n      method: ClientHttpMethod.GET,\n      type: params.type,\n      endpoint: params.endpoint,\n      next: params.next,\n      previous: params.previous,\n      self: params.self,\n      total: params.total,\n    });\n  }\n\n  /**\n   * Make a client-side API call.\n   */\n  protected static async callApi<T>(params: {\n    type: ApiRequestDataTypeInterface;\n    method: ClientHttpMethod;\n    endpoint: string;\n    companyId?: string;\n    input?: any;\n    overridesJsonApiCreation?: boolean;\n    next?: ClientNextRef;\n    previous?: ClientPreviousRef;\n    self?: ClientSelfRef;\n    total?: ClientTotalRef;\n    responseType?: ApiRequestDataTypeInterface;\n    files?: { [key: string]: File | Blob } | File | Blob;\n    /**\n     * Per-call override of the API base URL (mirrors `AbstractService.callApi`'s `baseUrl`).\n     * Omitted => existing global `NEXT_PUBLIC_API_URL` resolution, unchanged.\n     */\n    baseUrl?: string;\n  }): Promise<T> {\n    let apiResponse: ApiResponseInterface;\n\n    // Client-side: extract locale from URL pathname\n    const language = this.getClientLocale();\n\n    switch (params.method) {\n      case ClientHttpMethod.GET:\n        apiResponse = await ClientJsonApiGet({\n          classKey: params.type,\n          endpoint: params.endpoint,\n          companyId: params.companyId,\n          language: language,\n          baseUrl: params.baseUrl,\n        });\n        break;\n      case ClientHttpMethod.POST:\n        apiResponse = await ClientJsonApiPost({\n          classKey: params.type,\n          endpoint: params.endpoint,\n          companyId: params.companyId,\n          body: params.input,\n          overridesJsonApiCreation: params.overridesJsonApiCreation,\n          language: language,\n          responseType: params.responseType,\n          files: params.files,\n          baseUrl: params.baseUrl,\n        });\n        break;\n      case ClientHttpMethod.PUT:\n        apiResponse = await ClientJsonApiPut({\n          classKey: params.type,\n          endpoint: params.endpoint,\n          companyId: params.companyId,\n          body: params.input,\n          language: language,\n          responseType: params.responseType,\n          files: params.files,\n          baseUrl: params.baseUrl,\n        });\n        break;\n      case ClientHttpMethod.PATCH:\n        apiResponse = await ClientJsonApiPatch({\n          classKey: params.type,\n          endpoint: params.endpoint,\n          companyId: params.companyId,\n          body: params.input,\n          overridesJsonApiCreation: params.overridesJsonApiCreation,\n          language: language,\n          responseType: params.responseType,\n          files: params.files,\n          baseUrl: params.baseUrl,\n        });\n        break;\n      case ClientHttpMethod.DELETE:\n        apiResponse = await ClientJsonApiDelete({\n          classKey: params.type,\n          endpoint: params.endpoint,\n          companyId: params.companyId,\n          language: language,\n          responseType: params.responseType,\n          baseUrl: params.baseUrl,\n        });\n        break;\n      default:\n        throw new Error(\"Method not found\");\n    }\n\n    if (!apiResponse.ok) {\n      if (globalErrorHandler) {\n        globalErrorHandler(apiResponse.response, apiResponse.error);\n        return undefined as any;\n      } else {\n        const error = new Error(`${apiResponse.response}:${apiResponse.error}`) as any;\n        error.status = apiResponse.response;\n        error.digest = `HTTP_${apiResponse.response}`;\n        error.body = apiResponse.raw;\n        throw error;\n      }\n    }\n\n    if (apiResponse.next && params.next) params.next.next = apiResponse.next;\n    if (apiResponse.prev && params.previous) params.previous.previous = apiResponse.prev;\n    if (apiResponse.self && params.self) params.self.self = apiResponse.self;\n    if (apiResponse.meta?.total !== undefined && params.total) params.total.total = apiResponse.meta.total;\n\n    return apiResponse.data as T;\n  }\n\n  /**\n   * Get raw JSON:API response data without deserialization.\n   */\n  protected static async getRawData(params: {\n    type: ApiRequestDataTypeInterface;\n    method: ClientHttpMethod;\n    endpoint: string;\n    companyId?: string;\n  }): Promise<any> {\n    const language = this.getClientLocale();\n\n    const apiResponse: ApiResponseInterface = await ClientJsonApiGet({\n      classKey: params.type,\n      endpoint: params.endpoint,\n      companyId: params.companyId,\n      language: language,\n    });\n\n    if (!apiResponse.ok) {\n      if (globalErrorHandler) {\n        globalErrorHandler(apiResponse.response, apiResponse.error);\n        return undefined as any;\n      } else {\n        const error = new Error(`${apiResponse.response}:${apiResponse.error}`) as any;\n        error.status = apiResponse.response;\n        error.digest = `HTTP_${apiResponse.response}`;\n        error.body = apiResponse.raw;\n        throw error;\n      }\n    }\n\n    return apiResponse.raw;\n  }\n}\n","import { ApiRequestDataTypeInterface } from \"../interfaces/ApiRequestDataTypeInterface\";\nimport { DataClassRegistry } from \"./DataClassRegistry\";\n\n/**\n * Helper class to bootstrap the registry from a Modules-style class.\n * This supports the pattern where modules are defined as static getters.\n */\nexport class ModuleRegistrar {\n  private static _isBootstrapped = false;\n\n  /**\n   * Bootstrap the registry from a Modules class.\n   * Automatically detects static getters and registers their models.\n   *\n   * @param modulesClass - The Modules class with static getters\n   */\n  static bootstrap<T extends object>(modulesClass: T): void {\n    if (this._isBootstrapped) return;\n\n    const data = Object.getOwnPropertyNames(modulesClass)\n      .filter((key) => {\n        const descriptor = Object.getOwnPropertyDescriptor(modulesClass, key);\n        return descriptor && typeof descriptor.get === \"function\";\n      })\n      .map((key) => (modulesClass as any)[key] as ApiRequestDataTypeInterface);\n\n    data.forEach((item) => {\n      if (item && item.model) {\n        DataClassRegistry.registerObjectClass(item, item.model);\n      }\n    });\n\n    this._isBootstrapped = true;\n  }\n\n  /**\n   * Reset the bootstrapped state. Useful for testing.\n   */\n  static reset(): void {\n    this._isBootstrapped = false;\n    DataClassRegistry.clear();\n  }\n}\n","import { ModuleWithPermissions } from \"../../permissions/types\";\nimport { ApiRequestDataTypeInterface } from \"../interfaces/ApiRequestDataTypeInterface\";\nimport { hasBootstrapper, tryBootstrap } from \"./bootstrapStore\";\n\n// Foundation module types - defined by LIBRARY\nexport interface FoundationModuleDefinitions {\n  S3: ModuleWithPermissions;\n  Auth: ModuleWithPermissions;\n  User: ModuleWithPermissions;\n  Author: ModuleWithPermissions;\n  Company: ModuleWithPermissions;\n  Role: ModuleWithPermissions;\n  Notification: ModuleWithPermissions;\n  Push: ModuleWithPermissions;\n  Feature: ModuleWithPermissions;\n  Module: ModuleWithPermissions;\n  Content: ModuleWithPermissions;\n  HowTo: ModuleWithPermissions;\n  Assistant: ModuleWithPermissions;\n  AssistantMessage: ModuleWithPermissions;\n  AssistantAction: ModuleWithPermissions;\n  Chunk: ModuleWithPermissions;\n  // Billing modules - READ: all users, UPDATE: CompanyAdministrator, ADMIN: Administrator\n  Billing: ModuleWithPermissions;\n  StripeCustomer: ModuleWithPermissions;\n  StripePaymentMethod: ModuleWithPermissions;\n  StripeSubscription: ModuleWithPermissions;\n  StripeInvoice: ModuleWithPermissions;\n  StripeProduct: ModuleWithPermissions;\n  StripePrice: ModuleWithPermissions;\n  StripeUsage: ModuleWithPermissions;\n  StripePromotionCode: ModuleWithPermissions;\n  // AI connection administration\n  AiConnection: ModuleWithPermissions;\n  // OAuth modules\n  OAuth: ModuleWithPermissions;\n  // Waitlist modules\n  Waitlist: ModuleWithPermissions;\n  WaitlistStats: ModuleWithPermissions;\n  // Referral modules\n  Referral: ModuleWithPermissions;\n  ReferralStats: ModuleWithPermissions;\n  // Two-factor authentication modules\n  TotpAuthenticator: ModuleWithPermissions;\n  TotpSetup: ModuleWithPermissions;\n  TotpVerify: ModuleWithPermissions;\n  TotpVerifyLogin: ModuleWithPermissions;\n  Passkey: ModuleWithPermissions;\n  PasskeyRegistrationOptions: ModuleWithPermissions;\n  PasskeyRegistrationVerify: ModuleWithPermissions;\n  PasskeyRename: ModuleWithPermissions;\n  PasskeyVerifyLogin: ModuleWithPermissions;\n  PasskeyAuthenticationOptions: ModuleWithPermissions;\n  TwoFactorEnable: ModuleWithPermissions;\n  TwoFactorChallenge: ModuleWithPermissions;\n  TwoFactorStatus: ModuleWithPermissions;\n  BackupCodeVerify: ModuleWithPermissions;\n  // RBAC modules\n  PermissionMapping: ModuleWithPermissions;\n  ModulePaths: ModuleWithPermissions;\n  RbacMatrix: ModuleWithPermissions;\n  // Audit modules\n  AuditLog: ModuleWithPermissions;\n  // Administrative token-usage reporting modules\n  TokenUsageAdminSummary: ModuleWithPermissions;\n  TokenUsageAdminTimeline: ModuleWithPermissions;\n  TokenUsageAdminBreakdown: ModuleWithPermissions;\n  // Self-service token-usage reporting modules\n  TokenUsageReportSummary: ModuleWithPermissions;\n  TokenUsageReportTimeline: ModuleWithPermissions;\n  TokenUsageReportBreakdown: ModuleWithPermissions;\n}\n\n// App-specific modules - apps will augment this interface ONLY\n\nexport interface AppModuleDefinitions {}\n\n// Combined type for full autocompletion\nexport type ModuleDefinitions = FoundationModuleDefinitions & AppModuleDefinitions;\n\n// Symbol key to avoid conflicts with other globals\nconst MODULES_KEY = Symbol.for(\"nextjs-jsonapi:modules\");\n\n// Use globalThis to persist module registry across HMR reloads\nconst globalStore = globalThis as unknown as {\n  [MODULES_KEY]?: Map<string, ApiRequestDataTypeInterface>;\n};\n\n// Initialize global modules map if not set\nif (!globalStore[MODULES_KEY]) {\n  globalStore[MODULES_KEY] = new Map();\n}\n\nclass ModuleRegistryClass {\n  private get _modules(): Map<string, ApiRequestDataTypeInterface> {\n    return globalStore[MODULES_KEY]!;\n  }\n\n  register<K extends string>(name: K, module: ApiRequestDataTypeInterface): void {\n    this._modules.set(name, module);\n  }\n\n  get<K extends keyof ModuleDefinitions>(name: K): ModuleDefinitions[K] {\n    let module = this._modules.get(name as string);\n\n    // Self-healing: if module not found, try bootstrapping first\n    if (!module) {\n      const didBootstrap = tryBootstrap();\n      if (didBootstrap) {\n        // Retry after bootstrap\n        module = this._modules.get(name as string);\n      }\n    }\n\n    if (!module) {\n      // Provide helpful error message based on state\n      const hint = hasBootstrapper()\n        ? \"Bootstrap was called but module still not found. Check module registration.\"\n        : \"No bootstrapper registered. Ensure configureJsonApi({ bootstrapper }) is called before accessing modules.\";\n      throw new Error(`Module \"${String(name)}\" not registered. ${hint}`);\n    }\n\n    return module as ModuleDefinitions[K];\n  }\n\n  findByName(moduleName: string): ModuleWithPermissions {\n    // Self-healing: try bootstrap if registry is empty\n    if (this._modules.size === 0) {\n      tryBootstrap();\n    }\n\n    // Search by module's name property (e.g., \"topics\", \"articles\")\n    for (const module of this._modules.values()) {\n      if ((module as ModuleWithPermissions).name === moduleName) {\n        return module as ModuleWithPermissions;\n      }\n    }\n    throw new Error(`Module not found: ${moduleName}`);\n  }\n\n  getAllPageUrls(): { id: string; text: string }[] {\n    if (this._modules.size === 0) {\n      tryBootstrap();\n    }\n\n    const seen = new Set<string>();\n    const result: { id: string; text: string }[] = [];\n    for (const [key, module] of this._modules.entries()) {\n      const m = module as ModuleWithPermissions;\n      if (m.pageUrl && !seen.has(m.pageUrl)) {\n        seen.add(m.pageUrl);\n        result.push({ id: m.pageUrl, text: key });\n        result.push({ id: `${m.pageUrl}/:id`, text: `${key} (detail)` });\n      }\n    }\n    return result.sort((a, b) => a.text.localeCompare(b.text));\n  }\n\n  findByModelName(modelName: string): ModuleWithPermissions {\n    // Direct lookup by registry key (e.g., \"Article\", \"Document\")\n    let module = this._modules.get(modelName);\n\n    // Self-healing: if not found, try bootstrapping\n    if (!module) {\n      const didBootstrap = tryBootstrap();\n      if (didBootstrap) {\n        module = this._modules.get(modelName);\n      }\n    }\n\n    if (!module) {\n      throw new Error(`Module not found for model: ${modelName}`);\n    }\n    return module as ModuleWithPermissions;\n  }\n\n  findByFeature(feature: string): ModuleWithPermissions[] {\n    const response: ModuleWithPermissions[] = [];\n\n    for (const module of this._modules.values()) {\n      const m = module as ModuleWithPermissions;\n      if (m.feature === feature) {\n        response.push(m);\n      }\n    }\n\n    return response;\n  }\n\n  getAll(): ApiRequestDataTypeInterface[] {\n    if (this._modules.size === 0) {\n      tryBootstrap();\n    }\n    return Array.from(this._modules.values());\n  }\n}\n\nexport const ModuleRegistry = new ModuleRegistryClass();\n\n// Proxy object for Modules.X syntax with autocompletion\nexport const Modules = new Proxy({} as ModuleDefinitions, {\n  get(_, prop: string) {\n    if (prop === \"findByName\") {\n      return (name: string) => ModuleRegistry.findByName(name);\n    }\n    if (prop === \"findByModelName\") {\n      return (name: string) => ModuleRegistry.findByModelName(name);\n    }\n    if (prop === \"findByFeature\") {\n      return (feature: string) => ModuleRegistry.findByFeature(feature);\n    }\n    return ModuleRegistry.get(prop as keyof ModuleDefinitions);\n  },\n}) as ModuleDefinitions & {\n  findByName: (name: string) => ModuleWithPermissions;\n  findByModelName: (name: string) => ModuleWithPermissions;\n  findByFeature: (feature: string) => ModuleWithPermissions[];\n};\n","import { FieldSelector } from \"../fields/FieldSelector\";\nimport { ApiRequestDataTypeInterface } from \"../interfaces/ApiRequestDataTypeInterface\";\n\nexport type EndpointQuery = {\n  endpoint: ApiRequestDataTypeInterface | string;\n  id?: string;\n  childEndpoint?: ApiRequestDataTypeInterface | string;\n  childId?: string;\n  additionalParams?: { key: string; value: string | string[] }[];\n};\n\nexport class EndpointCreator {\n  private _endpoint: EndpointQuery;\n\n  constructor(params: {\n    endpoint: ApiRequestDataTypeInterface | string;\n    id?: string;\n    childEndpoint?: ApiRequestDataTypeInterface | string;\n    childId?: string;\n    additionalParams?: { key: string; value: string }[];\n  }) {\n    this._endpoint = {\n      endpoint: params.endpoint,\n      id: params.id,\n      childEndpoint: params.childEndpoint,\n      childId: params.childId,\n      additionalParams: params.additionalParams ?? [],\n    };\n  }\n\n  endpoint(value: ApiRequestDataTypeInterface | string): EndpointCreator {\n    this._endpoint.endpoint = value;\n    return this;\n  }\n\n  id(value: string): EndpointCreator {\n    this._endpoint.id = value;\n    return this;\n  }\n\n  childEndpoint(value: ApiRequestDataTypeInterface | string): EndpointCreator {\n    this._endpoint.childEndpoint = value;\n    return this;\n  }\n\n  childId(value: string): EndpointCreator {\n    this._endpoint.childId = value;\n    return this;\n  }\n\n  set additionalParams(value: { key: string; value: string }[]) {\n    this._endpoint.additionalParams = value;\n  }\n\n  addAdditionalParam(key: string, value: string | string[]): EndpointCreator {\n    if (!this._endpoint.additionalParams) this._endpoint.additionalParams = [];\n    this._endpoint.additionalParams.push({ key, value });\n    return this;\n  }\n\n  limitToType(selectors: string[]): this {\n    this.addAdditionalParam(`include`, selectors.join(\",\"));\n    return this;\n  }\n\n  limitToFields(selectors: FieldSelector<any>[]): this {\n    if (selectors.length === 0) return this;\n\n    selectors.forEach((selector) => {\n      const fieldString = selector.fields.join(\",\");\n      this.addAdditionalParam(`fields[${selector.type}]`, fieldString);\n    });\n\n    return this;\n  }\n\n  generate(): string {\n    let additionalParams = \"\";\n    if (this._endpoint.additionalParams) {\n      additionalParams = this._endpoint.additionalParams.map((param) => `${param.key}=${param.value}`).join(\"&\");\n    }\n\n    let response = ``;\n    response += `${\n      typeof this._endpoint.endpoint === \"string\" ? this._endpoint.endpoint : this._endpoint.endpoint.name\n    }`;\n    if (this._endpoint.id) response += `/${this._endpoint.id}`;\n    if (this._endpoint.childEndpoint) {\n      response += `/${\n        typeof this._endpoint.childEndpoint === \"string\"\n          ? this._endpoint.childEndpoint\n          : this._endpoint.childEndpoint.name\n      }`;\n    }\n    if (this._endpoint.childId) response += `/${this._endpoint.childId}`;\n    if (additionalParams) response += `?${additionalParams}`;\n\n    return response;\n  }\n}\n","export type GetterKeys<T> = {\n  [K in keyof T]: T[K] extends () => any ? never : K;\n}[keyof T];\n\nexport type FieldSelector<T> = {\n  type: string;\n  fields: ReadonlyArray<GetterKeys<T>>;\n};\n\nexport function createJsonApiInclusion<T>(dataType: string, fields: ReadonlyArray<GetterKeys<T>>): FieldSelector<T> {\n  return {\n    type: dataType,\n    fields,\n  };\n}\n","import { ApiDataInterface } from \"../interfaces/ApiDataInterface\";\nimport { ApiRequestDataTypeInterface } from \"../interfaces/ApiRequestDataTypeInterface\";\nimport { JsonApiHydratedDataInterface } from \"../interfaces/JsonApiHydratedDataInterface\";\nimport { RehydrationFactory } from \"../factories/RehydrationFactory\";\n\n/**\n * Rehydrate a single dehydrated object back into its typed class instance.\n */\nexport function rehydrate<T extends ApiDataInterface>(\n  classKey: ApiRequestDataTypeInterface,\n  data: JsonApiHydratedDataInterface,\n): T {\n  return RehydrationFactory.rehydrate(classKey, data) as T;\n}\n\n/**\n * Rehydrate a list of dehydrated objects back into typed class instances.\n */\nexport function rehydrateList<T extends ApiDataInterface>(\n  classKey: ApiRequestDataTypeInterface,\n  data: JsonApiHydratedDataInterface[],\n): T[] {\n  return RehydrationFactory.rehydrateList(classKey, data) as T[];\n}\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n","import * as React from \"react\";\n\ntype PossibleRef<T> = React.Ref<T> | undefined;\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef<T>(ref: PossibleRef<T>, value: T) {\n  if (typeof ref === \"function\") {\n    return ref(value);\n  }\n\n  if (ref !== null && ref !== undefined) {\n    ref.current = value;\n  }\n}\n\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n  return (node) => {\n    let hasCleanup = false;\n    const cleanups = refs.map((ref) => {\n      const cleanup = setRef(ref, node);\n      if (!hasCleanup && typeof cleanup === \"function\") {\n        hasCleanup = true;\n      }\n      return cleanup;\n    });\n\n    // React <19 will log an error to the console if a callback ref returns a\n    // value. We don't use ref cleanups internally so this will only happen if a\n    // user's ref callback returns a value, which we only expect if they are\n    // using the cleanup functionality added in React 19.\n    if (hasCleanup) {\n      return () => {\n        for (let i = 0; i < cleanups.length; i++) {\n          const cleanup = cleanups[i];\n          if (typeof cleanup === \"function\") {\n            cleanup();\n          } else {\n            setRef(refs[i], null);\n          }\n        }\n      };\n    }\n  };\n}\n\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */\nfunction useComposedRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n  return React.useCallback(composeRefs(...refs), refs);\n}\n\nexport { composeRefs, useComposedRefs };\n","\"use client\";\n\nimport * as React from \"react\";\n\nexport const MOBILE_BREAKPOINT = 768;\nexport const VIEWPORT_COOKIE_NAME = \"viewport_mobile\";\n\n/**\n * The viewport context is keyed on a globalThis Symbol so that tsup's\n * multi-entry `splitting: true` build cannot produce two distinct context\n * objects. If it did, the ViewportProvider (built into the `contexts` entry)\n * and this hook (built into the `core` entry) would silently miss each other:\n * the hook would read `undefined`, fall back to the legacy path, and the\n * mobile-layout flash would return with nothing failing loudly.\n *\n * THIS MODULE IS SERVER-REACHABLE. `core` is deliberately absent from\n * tsup.config.ts's `clientEntries` list, so `dist/core/*` gets NO \"use client\"\n * banner — that is what lets `apps/web/src/instrumentation.ts` import\n * jsonapi.config -> Bootstrapper -> `@carlonicora/nextjs-jsonapi/core` at\n * server startup. Two rules follow, both load-bearing:\n *\n * 1. React is imported as a NAMESPACE. A named\n *    `import { createContext } from \"react\"` makes Turbopack statically refuse\n *    the module: \"You're importing a module that depends on `createContext`\n *    into a React Server Component module.\"\n * 2. Creation is LAZY, never at module scope. On the server React resolves to\n *    the vendored RSC build, which omits `createContext` entirely\n *    (\"createContext is not a function\" — crashes the dev server at boot).\n *\n * `useIsMobile` only ever runs inside a Client Component render, so calling the\n * accessor from there is safe. The PROVIDER must not live here — it is rendered\n * by the server layouts, so it needs a real \"use client\" boundary and therefore\n * lives in `contexts/ViewportContext.tsx`.\n */\nconst VIEWPORT_CONTEXT_KEY = Symbol.for(\"nextjs-jsonapi:viewportContext\");\n\nconst globalStore = globalThis as unknown as {\n  [VIEWPORT_CONTEXT_KEY]?: React.Context<boolean | undefined>;\n};\n\n/** Returns the process-wide viewport context, creating it on first use. */\nexport function getViewportContext(): React.Context<boolean | undefined> {\n  if (globalStore[VIEWPORT_CONTEXT_KEY] === undefined) {\n    globalStore[VIEWPORT_CONTEXT_KEY] = React.createContext<boolean | undefined>(undefined);\n  }\n  return globalStore[VIEWPORT_CONTEXT_KEY]!;\n}\n\n/** @internal — consumed by contexts/ViewportContext.tsx */\nexport function measureViewport(): boolean {\n  return window.innerWidth < MOBILE_BREAKPOINT;\n}\n\n/** @internal — consumed by contexts/ViewportContext.tsx */\nexport function persistViewport(isMobile: boolean): void {\n  document.cookie = `${VIEWPORT_COOKIE_NAME}=${isMobile ? \"1\" : \"0\"}; path=/; max-age=31536000; samesite=lax`;\n}\n\n/** @internal — consumed by contexts/ViewportContext.tsx */\nexport function subscribeViewport(onChange: () => void): () => void {\n  const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);\n  onChange();\n  mql.addEventListener(\"change\", onChange);\n  return () => mql.removeEventListener(\"change\", onChange);\n}\n\nexport function useIsMobile(): boolean {\n  const seeded = React.useContext(getViewportContext());\n  const [legacy, setLegacy] = React.useState<boolean>(false);\n\n  React.useEffect(() => {\n    // A provider owns the value; never run the legacy measurement alongside it.\n    if (seeded !== undefined) return;\n    return subscribeViewport(() => setLegacy(measureViewport()));\n  }, [seeded]);\n\n  return seeded ?? legacy;\n}\n","type FormatOption = \"date\" | \"time\" | \"dateTime\" | \"timeSince\" | \"default\";\n\n/**\n * Format a `Date` as `YYYY-MM-DD` using the value's local-time components.\n *\n * Use for JSON:API attributes whose backend field type is `\"date\"` (calendar\n * date with no time component). `JSON.stringify(new Date(...))` would call\n * `.toISOString()`, which UTC-shifts and can lose a day west of UTC; this\n * helper avoids that by emitting the local-date components verbatim.\n *\n * For `\"datetime\"` fields use `.toISOString()` instead — those represent an\n * instant in time and the UTC shift is correct.\n */\nexport const formatLocalDate = (d: Date): string => {\n  const year = d.getFullYear();\n  const month = String(d.getMonth() + 1).padStart(2, \"0\");\n  const day = String(d.getDate()).padStart(2, \"0\");\n  return `${year}-${month}-${day}`;\n};\n\nexport const formatDate = (eventDate: Date, formatOption: FormatOption, locale: string = \"en-GB\"): string => {\n  const formatPart = (date: Date, options: Intl.DateTimeFormatOptions): string =>\n    new Intl.DateTimeFormat(locale, options).format(date);\n\n  const now = new Date();\n  const diff = now.getTime() - eventDate.getTime();\n\n  if (formatOption === \"default\") {\n    if (diff < 24 * 60 * 60 * 1000) formatOption = \"timeSince\";\n    else formatOption = \"dateTime\";\n  }\n\n  if (formatOption === \"timeSince\") {\n    const seconds = Math.floor(diff / 1000);\n    const minutes = Math.floor(seconds / 60);\n    const hours = Math.floor(minutes / 60);\n    const days = Math.floor(hours / 24);\n\n    if (days > 0) return `${days} days ago`;\n    if (hours > 0) return `${hours} hours ago`;\n    if (minutes > 0) return `${minutes} minutes ago`;\n    return `${seconds} seconds ago`;\n  }\n\n  // Define formatting options\n  const dateOptions: Intl.DateTimeFormatOptions = {\n    year: \"numeric\",\n    month: \"2-digit\",\n    day: \"2-digit\",\n  };\n  const timeOptions: Intl.DateTimeFormatOptions = {\n    hour: \"2-digit\",\n    minute: \"2-digit\",\n  };\n\n  // Format based on the option\n  switch (formatOption) {\n    case \"date\":\n      return formatPart(eventDate, dateOptions);\n    case \"time\":\n      return formatPart(eventDate, timeOptions);\n    case \"dateTime\":\n      return `${formatPart(eventDate, dateOptions)} ${formatPart(eventDate, timeOptions)}`;\n    default:\n      throw new Error(\"Invalid format option\");\n  }\n};\n\nexport type { FormatOption };\n","export const exists = <T>(itemOrArray: T | T[] | null | undefined): boolean => {\n  if (!itemOrArray) return false;\n  if (Array.isArray(itemOrArray)) {\n    return itemOrArray.length > 0;\n  }\n  return true;\n};\n","import { Action, ModuleWithPermissions } from \"../permissions\";\nimport { cloneElement, createElement, Fragment, ReactElement } from \"react\";\n\nexport class TableOptions {\n  private _components: ReactElement<any>[];\n  private _hasPermissionToModule: <M extends ModuleWithPermissions>(params: {\n    module: M;\n    action: Action;\n    data?: any;\n  }) => boolean;\n\n  constructor(\n    hasPermissionToModule: <M extends ModuleWithPermissions>(params: {\n      module: M;\n      action: Action;\n      data?: any;\n    }) => boolean,\n  ) {\n    this._hasPermissionToModule = hasPermissionToModule;\n    this._components = [];\n  }\n\n  addOption<M extends ModuleWithPermissions>(component: ReactElement<any> | null, module?: M, action?: Action): void {\n    if (!component || (module && action && !this._hasPermissionToModule({ module, action }))) return;\n    this._components.push(component);\n  }\n\n  getComponents(): ReactElement<any>[] {\n    return this._components;\n  }\n\n  getOptions(): ReactElement<any> | null {\n    if (this._components.length === 0) return null;\n\n    const response: ReactElement<any>[] = this._components.map((option, index) =>\n      cloneElement(option, { key: option.key ?? index }),\n    );\n\n    return createElement(Fragment, {}, response);\n  }\n}\n\nexport function getTableOptions(params: {\n  hasPermissionToModule: <M extends ModuleWithPermissions>(params: {\n    module: M;\n    action: Action;\n    data?: any;\n  }) => boolean;\n  options: { component: ReactElement<any> | null; module?: ModuleWithPermissions; action?: Action }[];\n}): ReactElement<any> | null {\n  const tableOptions = new TableOptions(params.hasPermissionToModule);\n  params.options.forEach((option) => tableOptions.addOption(option.component, option.module, option.action));\n  return tableOptions.getOptions();\n}\n\nexport function getTableComponents(params: {\n  hasPermissionToModule: <M extends ModuleWithPermissions>(params: {\n    module: M;\n    action: Action;\n    data?: any;\n  }) => boolean;\n  options: { component: ReactElement<any> | null; module?: ModuleWithPermissions; action?: Action }[];\n}): ReactElement<any>[] {\n  const tableOptions = new TableOptions(params.hasPermissionToModule);\n  params.options.forEach((option) => tableOptions.addOption(option.component, option.module, option.action));\n  return tableOptions.getComponents();\n}\n","import { z } from \"zod\";\n\nexport const userObjectSchema = z.object({\n  id: z.string(),\n  name: z.string(),\n  avatar: z.string().optional(),\n});\n\nexport type UserObject = z.infer<typeof userObjectSchema>;\n","import { z } from \"zod\";\n\nexport const entityObjectSchema = z.object({\n  id: z.uuidv4(),\n  name: z.string(),\n});\n\nexport type EntityObject = z.infer<typeof entityObjectSchema>;\n","export function getInitials(name: string): string;\nexport function getInitials(firstName: string, lastName: string): string;\nexport function getInitials(firstOrName: string, lastName?: string): string {\n  if (lastName !== undefined) {\n    const first = firstOrName?.trim()?.[0] ?? \"\";\n    const last = lastName?.trim()?.[0] ?? \"\";\n    if (first && last) return (first + last).toUpperCase();\n    return (firstOrName || lastName || \"\").slice(0, 2).toUpperCase();\n  }\n\n  const words = firstOrName.trim().split(/\\s+/);\n  if (words.length >= 2) {\n    return (words[0][0] + words[1][0]).toUpperCase();\n  }\n  return firstOrName.slice(0, 2).toUpperCase();\n}\n","/**\n * True when an image src is an absolute remote URL.\n *\n * `next/image` THROWS when it is given an absolute URL whose hostname is not\n * listed in `images.remotePatterns`, which takes down the whole page through\n * the nearest error boundary. Avatars can come from OAuth providers\n * (Discord, Google, ...), so their hostname is user-controlled and can never\n * be reliably enumerated in config. Pass `unoptimized` for these srcs.\n *\n * `blob:` and `data:` srcs are excluded: `next/image` already marks those\n * unoptimized on its own.\n */\nexport function isRemoteImageSrc(src?: string | null): boolean {\n  if (!src) return false;\n  return src.startsWith(\"http://\") || src.startsWith(\"https://\");\n}\n","import CodiceFiscale from \"codice-fiscale-js\";\n\nexport function validatePartitaIva(partitaIva: string): boolean {\n  if (!partitaIva || typeof partitaIva !== \"string\") {\n    return false;\n  }\n\n  const cleaned = partitaIva.replace(/\\s/g, \"\");\n\n  if (!/^\\d{11}$/.test(cleaned)) {\n    return false;\n  }\n\n  const digits = cleaned.split(\"\").map(Number);\n\n  const oddSum = digits[0] + digits[2] + digits[4] + digits[6] + digits[8] + digits[10];\n\n  let evenSum = 0;\n  for (let i = 1; i < 10; i += 2) {\n    let doubled = digits[i] * 2;\n    if (doubled > 9) {\n      doubled -= 9;\n    }\n    evenSum += doubled;\n  }\n\n  const totalSum = oddSum + evenSum;\n\n  return totalSum % 10 === 0;\n}\n\nexport type CodiceFiscaleValidationOptions = {\n  /** When true, a valid Partita IVA is also accepted as a valid value. */\n  allowPartitaIva?: boolean;\n};\n\nexport function validateCodiceFiscale(codiceFiscale: string, options?: CodiceFiscaleValidationOptions): boolean {\n  if (!codiceFiscale || typeof codiceFiscale !== \"string\") {\n    return false;\n  }\n\n  const cleaned = codiceFiscale.replace(/\\s/g, \"\").toUpperCase();\n\n  try {\n    if (CodiceFiscale.check(cleaned)) {\n      return true;\n    }\n  } catch (error) {\n    // fall through to the optional Partita IVA check\n  }\n\n  return options?.allowPartitaIva === true && validatePartitaIva(cleaned);\n}\n\nexport function validateItalianTaxCode(\n  value: string,\n  type: \"partitaIva\" | \"codiceFiscale\",\n  options?: CodiceFiscaleValidationOptions,\n): boolean {\n  if (!value || typeof value !== \"string\") {\n    return false;\n  }\n\n  switch (type) {\n    case \"partitaIva\":\n      return validatePartitaIva(value);\n    case \"codiceFiscale\":\n      return validateCodiceFiscale(value, options);\n    default:\n      return false;\n  }\n}\n\nexport function formatPartitaIva(partitaIva: string): string {\n  if (!partitaIva) return \"\";\n\n  const cleaned = partitaIva.replace(/\\s/g, \"\");\n  if (/^\\d{11}$/.test(cleaned)) {\n    return `${cleaned.substring(0, 7)} ${cleaned.substring(7, 10)} ${cleaned.substring(10)}`;\n  }\n  return partitaIva;\n}\n\nexport function formatCodiceFiscale(codiceFiscale: string): string {\n  if (!codiceFiscale) return \"\";\n\n  const cleaned = codiceFiscale.replace(/\\s/g, \"\").toUpperCase();\n  if (/^[A-Z0-9]{16}$/.test(cleaned)) {\n    return `${cleaned.substring(0, 6)} ${cleaned.substring(6, 11)} ${cleaned.substring(11, 15)} ${cleaned.substring(15)}`;\n  }\n  return codiceFiscale;\n}\n","import { PartialBlock } from \"@blocknote/core\";\nimport { v4 } from \"uuid\";\n\nexport interface WordDiff {\n  type: \"added\" | \"removed\" | \"unchanged\";\n  text: string;\n  diffId: string;\n  accepted?: boolean;\n  rejected?: boolean;\n}\n\nexport interface DiffBlock {\n  id?: string;\n  type?: string;\n  props?: any;\n  content?: any;\n  children?: DiffBlock[];\n  diffType?: \"added\" | \"removed\" | \"modified\" | \"unchanged\";\n  originalContent?: any;\n  diffId?: string;\n  wordDiffs?: WordDiff[];\n  accepted?: boolean;\n  rejected?: boolean;\n}\n\nexport interface DiffResult {\n  blocks: DiffBlock[];\n  hasChanges: boolean;\n}\n\nexport interface BlockDiffOptions {\n  ignoreIds?: boolean;\n  compareContent?: boolean;\n  similarityThreshold?: number;\n}\n\n/**\n * BlockNote Diff Utility\n * Implements a sophisticated diff algorithm for BlockNote document structures\n */\nexport class BlockNoteDiffUtil {\n  private static readonly DEFAULT_OPTIONS: BlockDiffOptions = {\n    ignoreIds: false,\n    compareContent: true,\n    similarityThreshold: 0.8,\n  };\n\n  /**\n   * Compare two BlockNote documents and return diff result\n   */\n  static diff(\n    originalBlocks: PartialBlock[] = [],\n    newBlocks: PartialBlock[] = [],\n    options: BlockDiffOptions = {},\n  ): DiffResult {\n    const opts = { ...this.DEFAULT_OPTIONS, ...options };\n\n    // Create a map for efficient lookups\n    const originalMap = new Map<string, PartialBlock>();\n    const newMap = new Map<string, PartialBlock>();\n\n    // Build maps based on block IDs\n    originalBlocks.forEach((block) => {\n      if (block.id) {\n        originalMap.set(block.id, block);\n      }\n    });\n\n    newBlocks.forEach((block) => {\n      if (block.id) {\n        newMap.set(block.id, block);\n      }\n    });\n\n    const diffBlocks: DiffBlock[] = [];\n    const processedNewIds = new Set<string>();\n\n    // Process original blocks to find removed and modified blocks\n    for (const originalBlock of originalBlocks) {\n      const blockId = originalBlock.id;\n\n      // Generate ID if missing\n      const processId = blockId || v4();\n      const newBlock = blockId ? newMap.get(blockId) : null;\n\n      if (!newBlock) {\n        // Block was removed\n        const removedBlock: DiffBlock = {\n          ...originalBlock,\n          id: processId,\n          diffType: \"removed\",\n          diffId: `removed-${processId}`,\n        };\n        diffBlocks.push(removedBlock);\n      } else {\n        // Block exists in both, check for modifications\n        if (blockId) {\n          processedNewIds.add(blockId);\n        }\n\n        if (this.areBlocksEqual(originalBlock, newBlock, opts)) {\n          // Block is unchanged\n          const unchangedBlock: DiffBlock = {\n            ...newBlock,\n            diffType: \"unchanged\",\n          };\n          diffBlocks.push(unchangedBlock);\n        } else {\n          // Block was modified - perform word-level diff\n          const wordDiffs = this.generateWordDiffs(originalBlock.content, newBlock.content, processId);\n          const modifiedBlock: DiffBlock = {\n            ...newBlock,\n            diffType: \"modified\",\n            originalContent: originalBlock.content as any,\n            diffId: `modified-${processId}`,\n            wordDiffs: wordDiffs,\n          };\n          diffBlocks.push(modifiedBlock);\n        }\n      }\n    }\n\n    // Process new blocks to find added blocks\n    for (const newBlock of newBlocks) {\n      const blockId = newBlock.id;\n\n      // Skip if block was already processed (has ID and was found in original)\n      if (blockId && processedNewIds.has(blockId)) continue;\n\n      // This is a new block (either no ID or ID not found in original)\n      const generatedId = blockId || v4();\n      const addedBlock: DiffBlock = {\n        ...newBlock,\n        id: generatedId,\n        diffType: \"added\",\n        diffId: `added-${generatedId}`,\n      };\n      diffBlocks.push(addedBlock);\n    }\n\n    // Sort blocks to maintain original order as much as possible\n    const sortedDiffBlocks = this.sortDiffBlocks(diffBlocks, originalBlocks, newBlocks);\n\n    return {\n      blocks: sortedDiffBlocks,\n      hasChanges: sortedDiffBlocks.some((block) => block.diffType !== \"unchanged\"),\n    };\n  }\n\n  /**\n   * Compare two blocks for equality\n   */\n  private static areBlocksEqual(block1: PartialBlock, block2: PartialBlock, options: BlockDiffOptions): boolean {\n    // Compare block type\n    if (block1.type !== block2.type) {\n      return false;\n    }\n\n    // Compare props (excluding diffType specific props)\n    if (!this.deepEqual(block1.props, block2.props)) {\n      return false;\n    }\n\n    // Compare content if enabled\n    if (options.compareContent) {\n      if (!this.deepEqual(block1.content, block2.content)) {\n        return false;\n      }\n    }\n\n    // Compare children recursively\n    const children1 = block1.children || [];\n    const children2 = block2.children || [];\n\n    if (children1.length !== children2.length) {\n      return false;\n    }\n\n    for (let i = 0; i < children1.length; i++) {\n      if (!this.areBlocksEqual(children1[i], children2[i], options)) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  /**\n   * Deep equality comparison for objects\n   */\n  private static deepEqual(obj1: any, obj2: any): boolean {\n    if (obj1 === obj2) return true;\n\n    if (obj1 == null || obj2 == null) return obj1 === obj2;\n\n    if (typeof obj1 !== typeof obj2) return false;\n\n    if (typeof obj1 !== \"object\") return obj1 === obj2;\n\n    if (Array.isArray(obj1) !== Array.isArray(obj2)) return false;\n\n    if (Array.isArray(obj1)) {\n      if (obj1.length !== obj2.length) return false;\n      for (let i = 0; i < obj1.length; i++) {\n        if (!this.deepEqual(obj1[i], obj2[i])) return false;\n      }\n      return true;\n    }\n\n    const keys1 = Object.keys(obj1);\n    const keys2 = Object.keys(obj2);\n\n    if (keys1.length !== keys2.length) return false;\n\n    for (const key of keys1) {\n      if (!keys2.includes(key)) return false;\n      if (!this.deepEqual(obj1[key], obj2[key])) return false;\n    }\n\n    return true;\n  }\n\n  /**\n   * Sort diff blocks to maintain logical order\n   */\n  private static sortDiffBlocks(\n    diffBlocks: DiffBlock[],\n    originalBlocks: PartialBlock[],\n    newBlocks: PartialBlock[],\n  ): DiffBlock[] {\n    // Create position maps\n    const originalPositions = new Map<string, number>();\n    const newPositions = new Map<string, number>();\n\n    originalBlocks.forEach((block, index) => {\n      if (block.id) {\n        originalPositions.set(block.id, index);\n      }\n    });\n\n    newBlocks.forEach((block, index) => {\n      if (block.id) {\n        newPositions.set(block.id, index);\n      }\n    });\n\n    return diffBlocks.sort((a, b) => {\n      const aId = a.id;\n      const bId = b.id;\n\n      if (!aId || !bId) return 0;\n\n      // Prioritize by new positions, fallback to original positions\n      const aPos = newPositions.get(aId) ?? originalPositions.get(aId) ?? Infinity;\n      const bPos = newPositions.get(bId) ?? originalPositions.get(bId) ?? Infinity;\n\n      return aPos - bPos;\n    });\n  }\n\n  /**\n   * Calculate similarity between two text contents\n   */\n  private static calculateSimilarity(content1: any[], content2: any[]): number {\n    if (!content1 || !content2) return 0;\n\n    const text1 = this.extractTextFromContent(content1);\n    const text2 = this.extractTextFromContent(content2);\n\n    if (text1 === text2) return 1;\n    if (!text1 || !text2) return 0;\n\n    // Simple Levenshtein distance-based similarity\n    const maxLength = Math.max(text1.length, text2.length);\n    const distance = this.levenshteinDistance(text1, text2);\n\n    return 1 - distance / maxLength;\n  }\n\n  /**\n   * Extract plain text from BlockNote content array\n   */\n  private static extractTextFromContent(content: any[]): string {\n    if (!Array.isArray(content)) return \"\";\n\n    return content\n      .map((item) => {\n        if (item.type === \"text\") {\n          return item.text || \"\";\n        }\n        return \"\";\n      })\n      .join(\"\");\n  }\n\n  /**\n   * Calculate Levenshtein distance between two strings\n   */\n  private static levenshteinDistance(str1: string, str2: string): number {\n    const matrix = Array(str2.length + 1)\n      .fill(null)\n      .map(() => Array(str1.length + 1).fill(null));\n\n    for (let i = 0; i <= str1.length; i++) {\n      matrix[0][i] = i;\n    }\n\n    for (let j = 0; j <= str2.length; j++) {\n      matrix[j][0] = j;\n    }\n\n    for (let j = 1; j <= str2.length; j++) {\n      for (let i = 1; i <= str1.length; i++) {\n        const substitutionCost = str1[i - 1] === str2[j - 1] ? 0 : 1;\n        matrix[j][i] = Math.min(\n          matrix[j][i - 1] + 1, // deletion\n          matrix[j - 1][i] + 1, // insertion\n          matrix[j - 1][i - 1] + substitutionCost, // substitution\n        );\n      }\n    }\n\n    return matrix[str2.length][str1.length];\n  }\n\n  /**\n   * Generate word-level diffs between two content arrays\n   */\n  static generateWordDiffs(originalContent: any, newContent: any, blockId: string): WordDiff[] {\n    const originalText = this.extractTextFromContent(originalContent || []);\n    const newText = this.extractTextFromContent(newContent || []);\n\n    if (!originalText && !newText) return [];\n    if (!originalText) {\n      return newText\n        .split(/\\s+/)\n        .filter((word) => word.trim())\n        .map((word, index) => ({\n          type: \"added\" as const,\n          text: word,\n          diffId: `${blockId}-add-${index}`,\n          accepted: false,\n          rejected: false,\n        }));\n    }\n    if (!newText) {\n      return originalText\n        .split(/\\s+/)\n        .filter((word) => word.trim())\n        .map((word, index) => ({\n          type: \"removed\" as const,\n          text: word,\n          diffId: `${blockId}-remove-${index}`,\n          accepted: false,\n          rejected: false,\n        }));\n    }\n\n    return this.diffWords(originalText, newText, blockId);\n  }\n\n  /**\n   * Perform word-level diff using word-only approach (no space tokenization)\n   */\n  private static diffWords(text1: string, text2: string, blockId: string): WordDiff[] {\n    const words1 = text1.split(/\\s+/).filter((word) => word.length > 0);\n    const words2 = text2.split(/\\s+/).filter((word) => word.length > 0);\n\n    const diffs = this.myersDiff(words1, words2);\n\n    // Consolidate adjacent changes to reduce fragmentation\n    const consolidatedDiffs = this.consolidateAdjacentChanges(diffs);\n\n    const result: WordDiff[] = [];\n    let diffIndex = 0;\n\n    for (let i = 0; i < consolidatedDiffs.length; i++) {\n      const diff = consolidatedDiffs[i];\n      const isLastDiff = i === consolidatedDiffs.length - 1;\n\n      switch (diff.type) {\n        case \"equal\":\n          result.push({\n            type: \"unchanged\",\n            text: diff.value,\n            diffId: `${blockId}-unchanged-${diffIndex++}`,\n            accepted: true,\n            rejected: false,\n          });\n\n          // Add space after word if not the last diff\n          if (!isLastDiff) {\n            result.push({\n              type: \"unchanged\",\n              text: \" \",\n              diffId: `${blockId}-space-${diffIndex++}`,\n              accepted: true,\n              rejected: false,\n            });\n          }\n          break;\n\n        case \"delete\":\n          // Check if this is a consolidated change or regular change\n          if ((diff as any).consolidated) {\n            // This is a consolidated deletion - check if next is consolidated insertion\n            const nextDiff = i + 1 < consolidatedDiffs.length ? consolidatedDiffs[i + 1] : null;\n            const isConsolidatedReplacement = nextDiff && nextDiff.type === \"insert\" && (nextDiff as any).consolidated;\n\n            if (isConsolidatedReplacement) {\n              // Use single shared diff ID for the entire consolidated change\n              const replacementId = `${blockId}-replace-${diffIndex++}`;\n\n              // Add the removed text\n              result.push({\n                type: \"removed\",\n                text: diff.value,\n                diffId: replacementId,\n                accepted: false,\n                rejected: false,\n              });\n\n              // Add the new text with same diff ID\n              result.push({\n                type: \"added\",\n                text: nextDiff.value,\n                diffId: replacementId,\n                accepted: false,\n                rejected: false,\n              });\n\n              // Skip the next insert since we handled it\n              i++;\n\n              // Add space after replacement if not the last\n              if (i < consolidatedDiffs.length - 1) {\n                result.push({\n                  type: \"unchanged\",\n                  text: \" \",\n                  diffId: `${blockId}-space-${diffIndex++}`,\n                  accepted: true,\n                  rejected: false,\n                });\n              }\n            } else {\n              // Consolidated deletion without replacement\n              result.push({\n                type: \"removed\",\n                text: diff.value,\n                diffId: `${blockId}-remove-${diffIndex++}`,\n                accepted: false,\n                rejected: false,\n              });\n\n              // Add space after deletion if not the last\n              if (!isLastDiff) {\n                result.push({\n                  type: \"unchanged\",\n                  text: \" \",\n                  diffId: `${blockId}-space-${diffIndex++}`,\n                  accepted: true,\n                  rejected: false,\n                });\n              }\n            }\n          } else {\n            // Regular single-word processing\n            const nextDiff = i + 1 < consolidatedDiffs.length ? consolidatedDiffs[i + 1] : null;\n            const isReplacement =\n              nextDiff && nextDiff.type === \"insert\" && this.areWordsSimilar(diff.value, nextDiff.value);\n\n            if (isReplacement) {\n              // Use single shared diff ID for both operations\n              const replacementId = `${blockId}-replace-${diffIndex++}`;\n\n              // Add the removed word\n              result.push({\n                type: \"removed\",\n                text: diff.value,\n                diffId: replacementId,\n                accepted: false,\n                rejected: false,\n              });\n\n              // Add the new word with same diff ID (no space between them)\n              result.push({\n                type: \"added\",\n                text: nextDiff.value,\n                diffId: replacementId,\n                accepted: false,\n                rejected: false,\n              });\n\n              // Skip the next insert since we handled it\n              i++;\n\n              // Add space after replacement if not the last\n              if (i < consolidatedDiffs.length - 1) {\n                result.push({\n                  type: \"unchanged\",\n                  text: \" \",\n                  diffId: `${blockId}-space-${diffIndex++}`,\n                  accepted: true,\n                  rejected: false,\n                });\n              }\n            } else {\n              // Regular deletion\n              result.push({\n                type: \"removed\",\n                text: diff.value,\n                diffId: `${blockId}-remove-${diffIndex++}`,\n                accepted: false,\n                rejected: false,\n              });\n\n              // Add space after deletion if not the last\n              if (!isLastDiff) {\n                result.push({\n                  type: \"unchanged\",\n                  text: \" \",\n                  diffId: `${blockId}-space-${diffIndex++}`,\n                  accepted: true,\n                  rejected: false,\n                });\n              }\n            }\n          }\n          break;\n\n        case \"insert\":\n          // Only handle if not already processed as part of replacement or consolidation\n          if ((diff as any).consolidated) {\n            // This should have been handled in the delete case above\n            const prevDiff = i > 0 ? consolidatedDiffs[i - 1] : null;\n            const wasProcessedAsConsolidatedReplacement =\n              prevDiff && prevDiff.type === \"delete\" && (prevDiff as any).consolidated;\n\n            if (!wasProcessedAsConsolidatedReplacement) {\n              // Standalone consolidated insertion\n              result.push({\n                type: \"added\",\n                text: diff.value,\n                diffId: `${blockId}-add-${diffIndex++}`,\n                accepted: false,\n                rejected: false,\n              });\n\n              // Add space after insertion if not the last\n              if (!isLastDiff) {\n                result.push({\n                  type: \"unchanged\",\n                  text: \" \",\n                  diffId: `${blockId}-space-${diffIndex++}`,\n                  accepted: true,\n                  rejected: false,\n                });\n              }\n            }\n          } else {\n            // Regular single-word processing\n            const prevDiff = i > 0 ? consolidatedDiffs[i - 1] : null;\n            const wasProcessedAsReplacement =\n              prevDiff && prevDiff.type === \"delete\" && this.areWordsSimilar(prevDiff.value, diff.value);\n\n            if (!wasProcessedAsReplacement) {\n              result.push({\n                type: \"added\",\n                text: diff.value,\n                diffId: `${blockId}-add-${diffIndex++}`,\n                accepted: false,\n                rejected: false,\n              });\n\n              // Add space after insertion if not the last\n              if (!isLastDiff) {\n                result.push({\n                  type: \"unchanged\",\n                  text: \" \",\n                  diffId: `${blockId}-space-${diffIndex++}`,\n                  accepted: true,\n                  rejected: false,\n                });\n              }\n            }\n          }\n          break;\n      }\n    }\n\n    return result;\n  } /**\n   * Improved diff algorithm that better handles word insertions\n   * Uses a combination of LCS and heuristics to minimize false changes\n   */\n  private static myersDiff(a: string[], b: string[]): Array<{ type: \"equal\" | \"delete\" | \"insert\"; value: string }> {\n    if (a.length === 0) {\n      return b.map((value) => ({ type: \"insert\" as const, value }));\n    }\n    if (b.length === 0) {\n      return a.map((value) => ({ type: \"delete\" as const, value }));\n    }\n\n    // Use dynamic programming for optimal diff\n    const dp = this.computeEditScript(a, b);\n    return this.reconstructDiff(a, b, dp);\n  }\n\n  /**\n   * Compute edit script using dynamic programming\n   */\n  private static computeEditScript(a: string[], b: string[]): number[][] {\n    const m = a.length;\n    const n = b.length;\n    const dp: number[][] = Array(m + 1)\n      .fill(null)\n      .map(() => Array(n + 1).fill(0));\n\n    // Initialize base cases\n    for (let i = 0; i <= m; i++) dp[i][0] = i;\n    for (let j = 0; j <= n; j++) dp[0][j] = j;\n\n    // Fill the DP table\n    for (let i = 1; i <= m; i++) {\n      for (let j = 1; j <= n; j++) {\n        if (a[i - 1] === b[j - 1]) {\n          dp[i][j] = dp[i - 1][j - 1]; // No operation needed\n        } else {\n          dp[i][j] =\n            1 +\n            Math.min(\n              dp[i - 1][j], // Delete from a\n              dp[i][j - 1], // Insert into a\n              dp[i - 1][j - 1], // Replace\n            );\n        }\n      }\n    }\n\n    return dp;\n  }\n\n  /**\n   * Reconstruct the actual diff from the DP table\n   */\n  private static reconstructDiff(\n    a: string[],\n    b: string[],\n    dp: number[][],\n  ): Array<{ type: \"equal\" | \"delete\" | \"insert\"; value: string; sharedDiffId?: boolean }> {\n    const result: Array<{ type: \"equal\" | \"delete\" | \"insert\"; value: string; sharedDiffId?: boolean }> = [];\n    let i = a.length;\n    let j = b.length;\n\n    while (i > 0 || j > 0) {\n      if (i > 0 && j > 0 && a[i - 1] === b[j - 1]) {\n        // Equal\n        result.unshift({ type: \"equal\", value: a[i - 1] });\n        i--;\n        j--;\n      } else {\n        // Determine the best operation with preference for insert/delete over replace\n        const deleteCost = i > 0 ? dp[i - 1][j] : Infinity;\n        const insertCost = j > 0 ? dp[i][j - 1] : Infinity;\n        const replaceCost = i > 0 && j > 0 ? dp[i - 1][j - 1] : Infinity;\n\n        const minCost = Math.min(deleteCost, insertCost, replaceCost);\n\n        // Prefer insertions and deletions over replacements when costs are equal\n        if (minCost === insertCost && j > 0) {\n          // Insert\n          result.unshift({ type: \"insert\", value: b[j - 1] });\n          j--;\n        } else if (minCost === deleteCost && i > 0) {\n          // Delete\n          result.unshift({ type: \"delete\", value: a[i - 1] });\n          i--;\n        } else if (minCost === replaceCost && i > 0 && j > 0) {\n          // Only use replace for similar words, otherwise prefer separate operations\n          if (this.areWordsSimilar(a[i - 1], b[j - 1])) {\n            // Similar words - treat as replacement with shared diffId\n            result.unshift({ type: \"insert\", value: b[j - 1], sharedDiffId: true });\n            result.unshift({ type: \"delete\", value: a[i - 1], sharedDiffId: true });\n            i--;\n            j--;\n          } else {\n            // Different words - prefer insert over delete when costs are equal\n            result.unshift({ type: \"insert\", value: b[j - 1] });\n            j--;\n          }\n        }\n      }\n    }\n\n    return result;\n  }\n\n  /**\n   * Consolidate adjacent changes to reduce fragmentation\n   * e.g., if we have: delete \"Key\", insert \"Key!\", delete \"Challenges\"\n   * We can consolidate this into: replace [\"Key\", \"Challenges\"] with [\"Key!\"]\n   */\n  private static consolidateAdjacentChanges(\n    diffs: Array<{ type: \"equal\" | \"delete\" | \"insert\"; value: string }>,\n  ): Array<{ type: \"equal\" | \"delete\" | \"insert\"; value: string; consolidated?: boolean }> {\n    const result = [];\n    let i = 0;\n\n    while (i < diffs.length) {\n      const current = diffs[i];\n\n      if (current.type === \"equal\") {\n        result.push(current);\n        i++;\n        continue;\n      }\n\n      // Look for patterns of adjacent changes that can be consolidated\n      const changeSequence = [];\n      let j = i;\n\n      // Collect adjacent non-equal changes\n      while (j < diffs.length && diffs[j].type !== \"equal\") {\n        changeSequence.push(diffs[j]);\n        j++;\n      }\n\n      if (changeSequence.length <= 1) {\n        // Single change, no consolidation needed\n        result.push(current);\n        i++;\n        continue;\n      }\n\n      // Check if we should consolidate this sequence\n      const shouldConsolidate = this.shouldConsolidateChanges(\n        changeSequence as Array<{ type: \"delete\" | \"insert\"; value: string }>,\n      );\n\n      if (shouldConsolidate) {\n        // Create consolidated changes\n        const deletedWords = changeSequence.filter((c) => c.type === \"delete\").map((c) => c.value);\n        const insertedWords = changeSequence.filter((c) => c.type === \"insert\").map((c) => c.value);\n\n        if (deletedWords.length > 0) {\n          result.push({\n            type: \"delete\" as const,\n            value: deletedWords.join(\" \"),\n            consolidated: true,\n          });\n        }\n\n        if (insertedWords.length > 0) {\n          result.push({\n            type: \"insert\" as const,\n            value: insertedWords.join(\" \"),\n            consolidated: true,\n          });\n        }\n      } else {\n        // Don't consolidate, add individual changes\n        changeSequence.forEach((change) => result.push(change));\n      }\n\n      i = j;\n    }\n\n    return result;\n  }\n\n  /**\n   * Determine if a sequence of changes should be consolidated\n   */\n  private static shouldConsolidateChanges(changes: Array<{ type: \"delete\" | \"insert\"; value: string }>): boolean {\n    // Consolidate if we have both deletions and insertions in the same sequence\n    const hasDeletes = changes.some((c) => c.type === \"delete\");\n    const hasInserts = changes.some((c) => c.type === \"insert\");\n\n    // Only consolidate if we have both types of changes (replacements/modifications)\n    // Pure additions or pure deletions are fine as separate changes\n    return hasDeletes && hasInserts;\n  }\n\n  /**\n   * Check if two words are similar enough to be considered a replacement\n   */\n  private static areWordsSimilar(word1: string, word2: string): boolean {\n    // If words are exactly the same, they're similar\n    if (word1 === word2) return true;\n\n    // Consider words similar if they share more than 70% of their characters\n    const maxLen = Math.max(word1.length, word2.length);\n    const minLen = Math.min(word1.length, word2.length);\n\n    // If one word is much longer than the other, they're not similar\n    if (maxLen > minLen * 2) {\n      return false;\n    }\n\n    // Special case: if one word is just the other plus punctuation, treat as separate changes\n    // e.g., \"Key\" and \"Key!\" should not be considered similar for replacement\n    const word1Clean = word1.replace(/[^\\w]/g, \"\");\n    const word2Clean = word2.replace(/[^\\w]/g, \"\");\n\n    if (word1Clean === word2Clean && word1 !== word2) {\n      // One word is just the other with added punctuation - don't treat as replacement\n      return false;\n    }\n\n    // Calculate character overlap using Levenshtein distance\n    const distance = this.levenshteinDistance(word1, word2);\n    const similarity = 1 - distance / maxLen;\n\n    return similarity > 0.7; // Increased threshold to be more conservative\n  }\n}\n","import { PartialBlock } from \"@blocknote/core\";\nimport { v4 } from \"uuid\";\nimport { DiffBlock, WordDiff } from \"./blocknote-diff.util\";\n\nexport class BlockNoteWordDiffRendererUtil {\n  static renderWordDiffs(\n    diffBlocks: DiffBlock[],\n    onAcceptChange?: (diffId: string) => void,\n    onRejectChange?: (diffId: string) => void,\n    acceptedChanges?: Set<string>,\n    rejectedChanges?: Set<string>,\n  ): PartialBlock[] {\n    if (acceptedChanges || rejectedChanges) {\n      diffBlocks = this.updateWordDiffStates(diffBlocks, acceptedChanges, rejectedChanges);\n    }\n    return diffBlocks.map((block) => this.renderDiffBlock(block, onAcceptChange, onRejectChange));\n  }\n\n  private static updateWordDiffStates(\n    diffBlocks: DiffBlock[],\n    acceptedChanges?: Set<string>,\n    rejectedChanges?: Set<string>,\n  ): DiffBlock[] {\n    return diffBlocks.map((block) => {\n      const updatedBlock = { ...block };\n\n      if (updatedBlock.diffId) {\n        updatedBlock.accepted = acceptedChanges?.has(updatedBlock.diffId) || false;\n        updatedBlock.rejected = rejectedChanges?.has(updatedBlock.diffId) || false;\n      }\n\n      if (updatedBlock.wordDiffs) {\n        updatedBlock.wordDiffs = updatedBlock.wordDiffs.map((wordDiff) => ({\n          ...wordDiff,\n          accepted: acceptedChanges?.has(wordDiff.diffId) || false,\n          rejected: rejectedChanges?.has(wordDiff.diffId) || false,\n        }));\n      }\n\n      if (updatedBlock.children) {\n        updatedBlock.children = this.updateWordDiffStates(\n          updatedBlock.children as DiffBlock[],\n          acceptedChanges,\n          rejectedChanges,\n        );\n      }\n\n      return updatedBlock;\n    });\n  }\n\n  private static renderDiffBlock(\n    block: DiffBlock,\n    onAcceptChange?: (diffId: string) => void,\n    onRejectChange?: (diffId: string) => void,\n  ): PartialBlock {\n    if (block.diffType === \"modified\" && block.wordDiffs) {\n      return this.renderWordLevelDiff(block, onAcceptChange, onRejectChange);\n    }\n\n    if (block.diffType === \"added\" || block.diffType === \"removed\") {\n      return this.renderBlockLevelDiff(block, onAcceptChange, onRejectChange);\n    }\n\n    const baseBlock: PartialBlock = {\n      id: block.id || v4(),\n      type: (block.type as any) || \"paragraph\",\n      props: this.getBlockProps(block),\n      content: Array.isArray(block.content) ? block.content : [],\n      children: block.children?.map((child) =>\n        this.renderDiffBlock(child as DiffBlock, onAcceptChange, onRejectChange),\n      ),\n    };\n\n    return baseBlock;\n  }\n\n  private static renderBlockLevelDiff(\n    block: DiffBlock,\n    onAcceptChange?: (diffId: string) => void,\n    onRejectChange?: (diffId: string) => void,\n  ): PartialBlock {\n    if (!block.diffId) {\n      return {\n        id: block.id || v4(),\n        type: (block.type as any) || \"paragraph\",\n        props: block.props || {},\n        content: Array.isArray(block.content) ? block.content : [],\n        children: block.children?.map((child) =>\n          this.renderDiffBlock(child as DiffBlock, onAcceptChange, onRejectChange),\n        ),\n      };\n    }\n\n    const blockAccepted = block.accepted || false;\n    const blockRejected = block.rejected || false;\n\n    let content = Array.isArray(block.content) ? [...block.content] : [];\n\n    if (block.diffType === \"added\") {\n      if (blockRejected) {\n        return {\n          id: block.id || v4(),\n          type: \"paragraph\",\n          props: {},\n          content: [],\n          children: [],\n        };\n      } else if (!blockAccepted) {\n        content = content.map((item: any) => ({\n          ...item,\n          styles: { ...item.styles, bold: true },\n        }));\n\n        content.push({\n          type: \"diffActions\",\n          props: { diffIds: block.diffId },\n        });\n      }\n    } else if (block.diffType === \"removed\") {\n      if (blockAccepted) {\n        return {\n          id: block.id || v4(),\n          type: \"paragraph\",\n          props: {},\n          content: [],\n          children: [],\n        };\n      } else if (!blockRejected) {\n        content = content.map((item: any) => ({\n          ...item,\n          styles: { ...item.styles, strike: true },\n        }));\n\n        content.push({\n          type: \"diffActions\",\n          props: { diffIds: block.diffId },\n        });\n      }\n    }\n\n    const baseBlock: PartialBlock = {\n      id: block.id || v4(),\n      type: (block.type as any) || \"paragraph\",\n      props: this.getBlockProps(block),\n      content: content,\n      children: block.children?.map((child) =>\n        this.renderDiffBlock(child as DiffBlock, onAcceptChange, onRejectChange),\n      ),\n    };\n\n    return baseBlock;\n  }\n\n  private static renderWordLevelDiff(\n    block: DiffBlock,\n    onAcceptChange?: (diffId: string) => void,\n    onRejectChange?: (diffId: string) => void,\n  ): PartialBlock {\n    if (!block.wordDiffs) {\n      return {\n        id: block.id || v4(),\n        type: (block.type as any) || \"paragraph\",\n        props: block.props || {},\n        content: Array.isArray(block.content) ? block.content : [],\n        children: [],\n      };\n    }\n\n    const content = this.groupAndRenderWordDiffs(block.wordDiffs);\n\n    return {\n      id: block.id || v4(),\n      type: (block.type as any) || \"paragraph\",\n      props: block.props || {},\n      content: Array.isArray(content) ? content : [],\n      children:\n        block.children?.map((child) => this.renderDiffBlock(child as DiffBlock, onAcceptChange, onRejectChange)) || [],\n    };\n  }\n\n  private static groupAndRenderWordDiffs(wordDiffs: WordDiff[]): any[] {\n    const content: any[] = [];\n\n    for (let i = 0; i < wordDiffs.length; i++) {\n      const wordDiff = wordDiffs[i];\n\n      const isLastOfGroup = this.isLastDiffInGroup(wordDiffs, i);\n\n      const textContent = this.createTextContent(wordDiff, isLastOfGroup);\n      if (textContent) {\n        if (Array.isArray(textContent)) {\n          content.push(...textContent);\n        } else {\n          content.push(textContent);\n        }\n      }\n    }\n\n    const cleanedContent = this.cleanupSpaces(content);\n\n    return cleanedContent;\n  }\n\n  private static cleanupSpaces(content: any[]): any[] {\n    const filtered = content.filter((item) => item !== null && item !== undefined);\n\n    const cleaned: any[] = [];\n\n    for (let i = 0; i < filtered.length; i++) {\n      const current = filtered[i];\n\n      if (current.type === \"text\" && current.text === \" \") {\n        const lastItem = cleaned[cleaned.length - 1];\n\n        if (\n          i === 0 ||\n          i === filtered.length - 1 ||\n          (lastItem && lastItem.type === \"text\" && lastItem.text === \" \") ||\n          (lastItem && lastItem.type === \"diffActions\")\n        ) {\n          continue;\n        }\n      }\n\n      if (current.type === \"diffActions\") {\n        const nextItem = i + 1 < filtered.length ? filtered[i + 1] : null;\n\n        cleaned.push(current);\n\n        if (nextItem && nextItem.type === \"text\" && nextItem.text !== \" \" && nextItem.type !== \"diffActions\") {\n          cleaned.push({\n            type: \"text\",\n            text: \" \",\n            styles: {},\n          });\n        }\n\n        continue;\n      }\n\n      cleaned.push(current);\n    }\n\n    return cleaned;\n  }\n\n  private static isLastDiffInGroup(wordDiffs: WordDiff[], currentIndex: number): boolean {\n    const currentDiff = wordDiffs[currentIndex];\n\n    if (currentDiff.type === \"unchanged\") {\n      return false;\n    }\n\n    for (let i = currentIndex + 1; i < wordDiffs.length; i++) {\n      const nextDiff = wordDiffs[i];\n\n      if (nextDiff.diffId === currentDiff.diffId && (nextDiff.type === \"added\" || nextDiff.type === \"removed\")) {\n        return false;\n      }\n\n      if (nextDiff.type !== \"unchanged\" && nextDiff.diffId !== currentDiff.diffId) {\n        break;\n      }\n    }\n\n    return true;\n  }\n\n  private static createTextContent(wordDiff: WordDiff, isLastOfGroup?: boolean): any[] | any {\n    switch (wordDiff.type) {\n      case \"added\":\n        if (wordDiff.accepted) {\n          return {\n            type: \"text\",\n            text: wordDiff.text,\n            styles: {},\n          };\n        } else if (wordDiff.rejected) {\n          return null;\n        } else {\n          if (wordDiff.text.trim() === \"\") {\n            return {\n              type: \"text\",\n              text: wordDiff.text,\n              styles: { backgroundColor: \"#dcfce7\" },\n            };\n          } else {\n            const baseContent = {\n              type: \"text\",\n              text: wordDiff.text,\n              styles: { bold: true },\n            };\n\n            if (isLastOfGroup) {\n              return [\n                baseContent,\n                {\n                  type: \"diffActions\",\n                  props: { diffIds: wordDiff.diffId },\n                },\n              ];\n            } else {\n              return baseContent;\n            }\n          }\n        }\n\n      case \"removed\":\n        if (wordDiff.accepted) {\n          return null;\n        } else if (wordDiff.rejected) {\n          return {\n            type: \"text\",\n            text: wordDiff.text,\n            styles: {},\n          };\n        } else {\n          if (wordDiff.text.trim() === \"\") {\n            return {\n              type: \"text\",\n              text: wordDiff.text,\n              styles: { strike: true },\n            };\n          } else {\n            const baseContent = {\n              type: \"text\",\n              text: wordDiff.text,\n              styles: { strike: true },\n            };\n\n            if (isLastOfGroup) {\n              return [\n                baseContent,\n                {\n                  type: \"diffActions\",\n                  props: { diffIds: wordDiff.diffId },\n                },\n              ];\n            } else {\n              return baseContent;\n            }\n          }\n        }\n\n      case \"unchanged\":\n      default:\n        return {\n          type: \"text\",\n          text: wordDiff.text,\n          styles: {},\n        };\n    }\n  }\n\n  private static getBlockProps(block: DiffBlock): any {\n    const baseProps = block.props || {};\n\n    return baseProps;\n  }\n\n  static generateChangeSummary(diffBlocks: DiffBlock[]): {\n    totalWords: number;\n    addedWords: number;\n    removedWords: number;\n    acceptedChanges: number;\n    rejectedChanges: number;\n    pendingChanges: number;\n  } {\n    let totalWords = 0;\n    let addedWords = 0;\n    let removedWords = 0;\n    let acceptedChanges = 0;\n    let rejectedChanges = 0;\n    let pendingChanges = 0;\n\n    const processBlock = (block: DiffBlock) => {\n      if (block.wordDiffs) {\n        block.wordDiffs.forEach((wordDiff) => {\n          totalWords++;\n\n          if (wordDiff.type === \"added\") {\n            addedWords++;\n          } else if (wordDiff.type === \"removed\") {\n            removedWords++;\n          }\n\n          if (wordDiff.accepted) {\n            acceptedChanges++;\n          } else if (wordDiff.rejected) {\n            rejectedChanges++;\n          } else if (wordDiff.type !== \"unchanged\") {\n            pendingChanges++;\n          }\n        });\n      }\n\n      if (block.children) {\n        block.children.forEach((child) => processBlock(child as DiffBlock));\n      }\n    };\n\n    diffBlocks.forEach(processBlock);\n\n    return {\n      totalWords,\n      addedWords,\n      removedWords,\n      acceptedChanges,\n      rejectedChanges,\n      pendingChanges,\n    };\n  }\n}\n","import { LucideIcon } from \"lucide-react\";\nimport { ReactNode } from \"react\";\nimport { ApiDataInterface, Modules } from \"../core\";\nimport { ContentInterface } from \"../features/content/data/content.interface\";\nimport { ModuleWithPermissions } from \"../permissions\";\nimport { cn } from \"./cn\";\n\nexport const getIconByModule = (params: { module: ModuleWithPermissions; className?: string }): ReactNode => {\n  const IconComponent = getLucideIconByModule({ module: params.module });\n  if (!IconComponent) return null;\n  return <IconComponent className={cn(``, params.className)} />;\n};\n\nexport const getIcon = (params: { element: ApiDataInterface; className?: string }): ReactNode => {\n  const IconComponent = getLucideIcon({ element: params.element });\n  if (!IconComponent) return null;\n  return <IconComponent className={cn(``, params.className)} />;\n};\n\nexport const getIconByModuleName = (params: { name: string; className?: string }): ReactNode => {\n  return getIconByModule({ module: Modules.findByModelName(params.name), className: params.className });\n};\n\nexport const getLucideIcon = (params: { element: ApiDataInterface }): LucideIcon | null => {\n  if (params.element.type === \"contents\") {\n    const contentType = (params.element as ContentInterface).contentType;\n    if (!contentType) return null;\n    return getLucideIconByModule({ module: Modules.findByModelName(contentType) });\n  }\n\n  return getLucideIconByModule({ module: Modules.findByName(params.element.type) });\n};\n\nexport const getLucideIconByModule = (params: { module: ModuleWithPermissions }): LucideIcon | null => {\n  return params.module.icon ?? null;\n};\n\nexport const getLucideIconByModuleName = (params: { name: string }): LucideIcon | null => {\n  return getLucideIconByModule({ module: Modules.findByModelName(params.name) });\n};\n","import { toast as sonnerToast, type ExternalToast } from \"sonner\";\nimport type { ReactElement, JSXElementConstructor, ReactNode } from \"react\";\n\nexport type ToastOptions = {\n  description?: ReactNode;\n  duration?: number;\n  id?: string;\n  onDismiss?: () => void;\n  action?: ExternalToast[\"action\"];\n  dismissible?: boolean;\n};\n\n/** Standard toast - neutral/white */\nexport function showToast(message: string, options?: ToastOptions) {\n  return sonnerToast(message, options as ExternalToast);\n}\n\n/** Error toast - destructive red */\nexport function showError(message: string, options?: ToastOptions) {\n  return sonnerToast.error(message, options as ExternalToast);\n}\n\n/** Dismiss toast(s) */\nexport function dismissToast(toastId?: string | number) {\n  return sonnerToast.dismiss(toastId);\n}\n\n/** Custom toast - ONLY for complex UI like upload progress */\nexport function showCustomToast(\n  render: (id: string | number) => ReactElement<unknown, string | JSXElementConstructor<unknown>>,\n  options?: {\n    id?: string | number;\n    duration?: number;\n    dismissible?: boolean;\n    onDismiss?: () => void;\n  },\n) {\n  return sonnerToast.custom(render, options);\n}\n","import { LucideIcon } from \"lucide-react\";\nimport { ApiRequestDataTypeInterface } from \"../core/interfaces/ApiRequestDataTypeInterface\";\nimport { FieldSelector } from \"../core/fields/FieldSelector\";\n\n/**\n * Permission actions\n */\nexport enum Action {\n  Read = \"read\",\n  Create = \"create\",\n  Update = \"update\",\n  Delete = \"delete\",\n}\n\n/**\n * Generic permission check type.\n * Can be a boolean or a function that checks permissions dynamically.\n * @template T - The data type being checked\n * @template U - The user type (defaults to PermissionUser)\n */\nexport type PermissionCheck<T, U = PermissionUser> = boolean | ((user?: U | string, data?: T) => boolean);\n\n/**\n * Page URL configuration for modules\n */\nexport type PageUrl = {\n  pageUrl?: string;\n};\n\n/**\n * Module permission definition wrapper\n */\nexport type ModulePermissionDefinition<T> = {\n  interface: T;\n};\n\n/**\n * Base module definition\n */\nexport type ModuleDefinition = {\n  pageUrl?: string;\n  name: string;\n  model: any;\n  feature?: string;\n  moduleId?: string;\n};\n\n/**\n * Permission configuration for a module.\n * Can be a boolean (allow/deny all) or a string path for dynamic checks.\n */\nexport interface PermissionConfig {\n  create: boolean | string;\n  read: boolean | string;\n  update: boolean | string;\n  delete: boolean | string;\n}\n\n/**\n * Generic interface for a module that has permissions.\n * Apps should ensure their Module class implements this.\n */\nexport interface PermissionModule {\n  id: string;\n  permissions: PermissionConfig;\n}\n\n/**\n * Generic interface for a user that has modules with permissions.\n * Apps should ensure their User class implements this.\n */\nexport interface PermissionUser {\n  id: string;\n  modules: PermissionModule[];\n}\n\n/**\n * Module definition with permissions - extends ApiRequestDataTypeInterface\n */\nexport type ModuleWithPermissions = ApiRequestDataTypeInterface & {\n  pageUrl?: string;\n  feature?: string;\n  moduleId?: string;\n  icon?: LucideIcon;\n  inclusions?: Record<\n    string,\n    {\n      types?: string[];\n      fields?: FieldSelector<any>[];\n      include?: string[];\n    }\n  >;\n};\n\n/**\n * Factory type for creating module definitions\n */\nexport type ModuleFactory = (params: {\n  pageUrl?: string;\n  name: string;\n  cache?: string | \"days\" | \"default\" | \"hours\" | \"max\" | \"minutes\" | \"seconds\" | \"weeks\";\n  model: any;\n  feature?: string;\n  moduleId?: string;\n  icon?: LucideIcon;\n  identifier?: string[];\n  inclusions?: Record<\n    string,\n    {\n      types?: string[];\n      fields?: FieldSelector<any>[];\n      include?: string[];\n    }\n  >;\n}) => ModuleWithPermissions;\n","import { Action, ModuleWithPermissions, PermissionModule, PermissionUser } from \"./types\";\n\n/**\n * Check if a user has permission to perform an action on a module.\n *\n * @param module - The module to check permissions for\n * @param action - The action to check (read, create, update, delete)\n * @param user - The user with their modules and permissions\n * @param data - Optional data object for path-based permission checks\n */\nexport function checkPermissions<T extends PermissionUser>(params: {\n  module: ModuleWithPermissions;\n  action: Action;\n  user: T;\n  data?: any;\n}): boolean {\n  const selectedModule = params.user.modules.find((module: PermissionModule) => module.id === params.module.moduleId);\n\n  if (!selectedModule) return false;\n  const permissionConfig = selectedModule.permissions[params.action];\n\n  if (!permissionConfig) return false;\n  if (typeof permissionConfig === \"boolean\") return permissionConfig as boolean;\n\n  if (!params.data) return true;\n\n  try {\n    const singlePermissionConfig = permissionConfig.split(\"|\").map((p) => p.trim());\n\n    for (const path of singlePermissionConfig) {\n      if (getValueFromPath(params.data, path, params.user.id)) return true;\n    }\n    return false;\n  } catch {\n    if (typeof permissionConfig === \"string\") {\n      return getValueFromPath(params.data, permissionConfig, params.user.id);\n    }\n  }\n\n  return false;\n}\n\n/**\n * Check permissions from server context where user object is not fully available.\n *\n * @param module - The module to check permissions for\n * @param action - The action to check\n * @param userId - The user's ID\n * @param selectedModule - The selected module with its permissions\n * @param data - Optional data object for path-based permission checks\n */\nexport function checkPermissionsFromServer(params: {\n  module: ModuleWithPermissions;\n  action: Action;\n  userId: string;\n  selectedModule?: PermissionModule;\n  data?: any;\n}): boolean {\n  if (!params.selectedModule) return false;\n  const permissionConfig = params.selectedModule.permissions[params.action];\n\n  if (!permissionConfig) return false;\n  if (typeof permissionConfig === \"boolean\") return permissionConfig as boolean;\n\n  if (!params.data) return true;\n\n  try {\n    const singlePermissionConfig = permissionConfig.split(\"|\").map((p) => p.trim());\n\n    for (const path of singlePermissionConfig) {\n      if (getValueFromPath(params.data, path, params.userId)) return true;\n    }\n    return false;\n  } catch {\n    if (typeof permissionConfig === \"string\") {\n      return getValueFromPath(params.data, permissionConfig, params.userId);\n    }\n  }\n\n  return false;\n}\n\n/**\n * Traverse an object path and check if the value matches the user ID.\n * Handles nested objects, arrays, and various data structures.\n */\nexport function getValueFromPath(obj: any, path: string, userId: string): any {\n  const parts = path.split(\".\");\n  let current = obj;\n\n  for (const part of parts) {\n    if (!current) return false;\n\n    if (Array.isArray(current)) {\n      let found = false;\n      for (const item of current) {\n        const result = getValueFromPath(item, parts.slice(parts.indexOf(part)).join(\".\"), userId);\n        if (result === userId || result === true) {\n          found = true;\n          break;\n        }\n      }\n      return found;\n    } else if (current[part] !== undefined) {\n      current = current[part];\n    } else {\n      return false;\n    }\n  }\n\n  if (Array.isArray(current)) {\n    // If final value is an array, check if any element has id matching userId\n    return current.some((item: any) => {\n      if (typeof item === \"object\" && item.id !== undefined) {\n        return item.id.toString() === userId;\n      }\n      return item.toString() === userId;\n    });\n  }\n\n  // Direct comparison for primitive values or objects with id\n  if (typeof current === \"object\" && current.id !== undefined) {\n    return current.id.toString() === userId;\n  }\n\n  return current.toString() === userId;\n}\n","import { AbstractApiData, JsonApiHydratedDataInterface } from \"../../../core\";\nimport { TotpAuthenticatorInterface } from \"./totp-authenticator.interface\";\n\nexport class TotpAuthenticator extends AbstractApiData implements TotpAuthenticatorInterface {\n  private _name: string = \"\";\n  private _verified: boolean = false;\n  private _lastUsedAt?: Date;\n\n  get name(): string {\n    return this._name;\n  }\n\n  get verified(): boolean {\n    return this._verified;\n  }\n\n  get lastUsedAt(): Date | undefined {\n    return this._lastUsedAt;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n    this._name = data.jsonApi.attributes.name ?? \"\";\n    this._verified = data.jsonApi.attributes.verified ?? false;\n    this._lastUsedAt = data.jsonApi.attributes.lastUsedAt ? new Date(data.jsonApi.attributes.lastUsedAt) : undefined;\n    return this;\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { TotpAuthenticator } from \"./data/totp-authenticator\";\n\nexport const TotpAuthenticatorModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"totp-authenticators\",\n    pageUrl: \"/totp-authenticators\",\n    model: TotpAuthenticator,\n  });\n","import { AbstractApiData, JsonApiHydratedDataInterface } from \"../../../core\";\nimport { TotpSetupInterface } from \"./totp-setup.interface\";\n\nexport type TotpSetupInput = {\n  id: string;\n  name: string;\n  accountName: string;\n};\n\nexport class TotpSetup extends AbstractApiData implements TotpSetupInterface {\n  private _qrCodeUri: string = \"\";\n  private _secret: string = \"\";\n  private _authenticatorId: string = \"\";\n\n  get qrCodeUri(): string {\n    return this._qrCodeUri;\n  }\n\n  get secret(): string {\n    return this._secret;\n  }\n\n  get authenticatorId(): string {\n    return this._authenticatorId;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n    this._qrCodeUri = data.jsonApi.attributes.qrCodeUri ?? \"\";\n    this._secret = data.jsonApi.attributes.secret ?? \"\";\n    // authenticatorId is the entity ID, not an attribute\n    this._authenticatorId = data.jsonApi.id ?? \"\";\n    return this;\n  }\n\n  createJsonApi(data: TotpSetupInput) {\n    return {\n      data: {\n        type: \"totp-authenticators\",\n        id: data.id,\n        attributes: {\n          name: data.name,\n          accountName: data.accountName,\n        },\n      },\n    };\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { TotpSetup } from \"./data/totp-setup\";\n\nexport const TotpSetupModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"totp-setup\",\n    pageUrl: \"/totp-setup\",\n    model: TotpSetup,\n  });\n","import { AbstractApiData } from \"../../../core\";\n\nexport type TotpVerifyInput = {\n  id: string;\n  authenticatorId: string;\n  code: string;\n};\n\nexport class TotpVerify extends AbstractApiData {\n  createJsonApi(data: TotpVerifyInput) {\n    return {\n      data: {\n        type: \"totp-authenticators\",\n        id: data.id,\n        attributes: {\n          authenticatorId: data.authenticatorId,\n          code: data.code,\n        },\n      },\n    };\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { TotpVerify } from \"./data/totp-verify\";\n\nexport const TotpVerifyModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"totp-verify\",\n    pageUrl: \"/totp-verify\",\n    model: TotpVerify,\n  });\n","import { AbstractApiData } from \"../../../core\";\n\nexport type TotpVerifyLoginInput = {\n  id: string;\n  code: string;\n};\n\nexport class TotpVerifyLogin extends AbstractApiData {\n  createJsonApi(data: TotpVerifyLoginInput) {\n    return {\n      data: {\n        type: \"totp-authenticators\",\n        id: data.id,\n        attributes: {\n          code: data.code,\n        },\n      },\n    };\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { TotpVerifyLogin } from \"./data/totp-verify-login\";\n\nexport const TotpVerifyLoginModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"totp-verify-login\",\n    pageUrl: \"/totp-verify-login\",\n    model: TotpVerifyLogin,\n  });\n","import { AbstractApiData, JsonApiHydratedDataInterface } from \"../../../core\";\nimport { PasskeyInterface } from \"./passkey.interface\";\n\nexport class Passkey extends AbstractApiData implements PasskeyInterface {\n  private _name: string = \"\";\n  private _credentialId: string = \"\";\n  private _deviceType: string = \"\";\n  private _backedUp: boolean = false;\n  private _lastUsedAt?: Date;\n\n  get name(): string {\n    return this._name;\n  }\n\n  get credentialId(): string {\n    return this._credentialId;\n  }\n\n  get deviceType(): string {\n    return this._deviceType;\n  }\n\n  get backedUp(): boolean {\n    return this._backedUp;\n  }\n\n  get lastUsedAt(): Date | undefined {\n    return this._lastUsedAt;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n    this._name = data.jsonApi.attributes.name ?? \"\";\n    this._credentialId = data.jsonApi.attributes.credentialId ?? \"\";\n    this._deviceType = data.jsonApi.attributes.deviceType ?? \"\";\n    this._backedUp = data.jsonApi.attributes.backedUp ?? false;\n    this._lastUsedAt = data.jsonApi.attributes.lastUsedAt ? new Date(data.jsonApi.attributes.lastUsedAt) : undefined;\n    return this;\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { Passkey } from \"./data/passkey\";\n\nexport const PasskeyModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"passkeys\",\n    pageUrl: \"/passkeys\",\n    model: Passkey,\n  });\n","import { PublicKeyCredentialCreationOptionsJSON } from \"@simplewebauthn/browser\";\nimport { AbstractApiData, JsonApiHydratedDataInterface } from \"../../../core\";\n\nexport type PasskeyRegistrationOptionsInput = {\n  id: string;\n  userName: string;\n  userDisplayName?: string;\n};\n\nexport interface PasskeyRegistrationOptionsInterface {\n  pendingId: string;\n  options: PublicKeyCredentialCreationOptionsJSON;\n}\n\nexport class PasskeyRegistrationOptions extends AbstractApiData implements PasskeyRegistrationOptionsInterface {\n  private _pendingId: string = \"\";\n  private _options: PublicKeyCredentialCreationOptionsJSON = {} as PublicKeyCredentialCreationOptionsJSON;\n\n  get pendingId(): string {\n    return this._pendingId;\n  }\n\n  get options(): PublicKeyCredentialCreationOptionsJSON {\n    return this._options;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n    this._pendingId = data.jsonApi.attributes.pendingId ?? this.id;\n    this._options = data.jsonApi.attributes.options ?? {};\n    return this;\n  }\n\n  createJsonApi(data: PasskeyRegistrationOptionsInput) {\n    return {\n      data: {\n        type: \"passkeys\",\n        id: data.id,\n        attributes: {\n          userName: data.userName,\n          userDisplayName: data.userDisplayName,\n        },\n      },\n    };\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { PasskeyRegistrationOptions } from \"./data/passkey-registration-options\";\n\nexport const PasskeyRegistrationOptionsModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"passkey-registration-options\",\n    pageUrl: \"/passkeys\",\n    model: PasskeyRegistrationOptions,\n  });\n","import { RegistrationResponseJSON } from \"@simplewebauthn/browser\";\nimport { AbstractApiData, JsonApiHydratedDataInterface } from \"../../../core\";\nimport { PasskeyInterface } from \"./passkey.interface\";\n\nexport type PasskeyRegistrationVerifyInput = {\n  id: string;\n  pendingId: string;\n  name: string;\n  response: RegistrationResponseJSON;\n};\n\nexport class PasskeyRegistrationVerify extends AbstractApiData implements PasskeyInterface {\n  private _name: string = \"\";\n  private _credentialId: string = \"\";\n  private _deviceType: string = \"\";\n  private _backedUp: boolean = false;\n  private _lastUsedAt?: Date;\n\n  get name(): string {\n    return this._name;\n  }\n\n  get credentialId(): string {\n    return this._credentialId;\n  }\n\n  get deviceType(): string {\n    return this._deviceType;\n  }\n\n  get backedUp(): boolean {\n    return this._backedUp;\n  }\n\n  get lastUsedAt(): Date | undefined {\n    return this._lastUsedAt;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n    this._name = data.jsonApi.attributes.name ?? \"\";\n    this._credentialId = data.jsonApi.attributes.credentialId ?? \"\";\n    this._deviceType = data.jsonApi.attributes.deviceType ?? \"\";\n    this._backedUp = data.jsonApi.attributes.backedUp ?? false;\n    this._lastUsedAt = data.jsonApi.attributes.lastUsedAt ? new Date(data.jsonApi.attributes.lastUsedAt) : undefined;\n    return this;\n  }\n\n  createJsonApi(data: PasskeyRegistrationVerifyInput) {\n    return {\n      data: {\n        type: \"passkeys\",\n        id: data.id,\n        attributes: {\n          pendingId: data.pendingId,\n          name: data.name,\n          response: data.response,\n        },\n      },\n    };\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { PasskeyRegistrationVerify } from \"./data/passkey-registration-verify\";\n\nexport const PasskeyRegistrationVerifyModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"passkey-registration-verify\",\n    pageUrl: \"/passkeys\",\n    model: PasskeyRegistrationVerify,\n  });\n","import { AbstractApiData } from \"../../../core\";\n\nexport type PasskeyRenameInput = {\n  id: string;\n  name: string;\n};\n\nexport class PasskeyRename extends AbstractApiData {\n  createJsonApi(data: PasskeyRenameInput) {\n    return {\n      data: {\n        type: \"passkeys\",\n        id: data.id,\n        attributes: {\n          name: data.name,\n        },\n      },\n    };\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { PasskeyRename } from \"./data/passkey-rename\";\n\nexport const PasskeyRenameModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"passkey-rename\",\n    pageUrl: \"/passkeys-rename\",\n    model: PasskeyRename,\n  });\n","import { AuthenticationResponseJSON } from \"@simplewebauthn/browser\";\nimport { AbstractApiData } from \"../../../core\";\n\nexport type PasskeyVerifyLoginInput = {\n  id: string;\n  pendingId: string;\n  response: AuthenticationResponseJSON;\n};\n\nexport class PasskeyVerifyLogin extends AbstractApiData {\n  createJsonApi(data: PasskeyVerifyLoginInput) {\n    return {\n      data: {\n        type: \"passkeys\",\n        id: data.id,\n        attributes: {\n          pendingId: data.pendingId,\n          response: data.response,\n        },\n      },\n    };\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { PasskeyVerifyLogin } from \"./data/passkey-verify-login\";\n\nexport const PasskeyVerifyLoginModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"passkey-verify-login\",\n    pageUrl: \"/passkeys\",\n    model: PasskeyVerifyLogin,\n  });\n","import { PublicKeyCredentialRequestOptionsJSON } from \"@simplewebauthn/browser\";\nimport { AbstractApiData, JsonApiHydratedDataInterface } from \"../../../core\";\nimport { PasskeyAuthenticationOptionsInterface } from \"./passkey-authentication-options.interface\";\n\nexport type PasskeyAuthenticationOptionsInput = {\n  id: string;\n};\n\nexport class PasskeyAuthenticationOptions extends AbstractApiData implements PasskeyAuthenticationOptionsInterface {\n  private _pendingId: string = \"\";\n  private _options: PublicKeyCredentialRequestOptionsJSON = {} as PublicKeyCredentialRequestOptionsJSON;\n\n  get pendingId(): string {\n    return this._pendingId;\n  }\n\n  get options(): PublicKeyCredentialRequestOptionsJSON {\n    return this._options;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n    this._pendingId = data.jsonApi.attributes.pendingId ?? this.id ?? \"\";\n    this._options = data.jsonApi.attributes.options ?? {};\n    return this;\n  }\n\n  createJsonApi(data: PasskeyAuthenticationOptionsInput) {\n    return {\n      data: {\n        type: \"passkey-authentication-options\",\n        id: data.id,\n        attributes: {},\n      },\n    };\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { PasskeyAuthenticationOptions } from \"./data/passkey-authentication-options\";\n\nexport const PasskeyAuthenticationOptionsModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"passkey-authentication-options\",\n    pageUrl: \"/passkeys\",\n    model: PasskeyAuthenticationOptions,\n  });\n","import { AbstractApiData } from \"../../../core\";\n\nexport type TwoFactorEnableInput = {\n  id: string;\n  preferredMethod: \"totp\" | \"passkey\";\n};\n\nexport class TwoFactorEnable extends AbstractApiData {\n  createJsonApi(data: TwoFactorEnableInput) {\n    return {\n      data: {\n        type: \"two-factor-configs\",\n        id: data.id,\n        attributes: {\n          preferredMethod: data.preferredMethod,\n        },\n      },\n    };\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { TwoFactorEnable } from \"./data/two-factor-enable\";\n\nexport const TwoFactorEnableModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"two-factor-enable\",\n    pageUrl: \"/two-factor-enable\",\n    model: TwoFactorEnable,\n  });\n","import { AbstractApiData, JsonApiHydratedDataInterface } from \"../../../core\";\nimport { TwoFactorChallengeInterface } from \"./two-factor-challenge.interface\";\n\nexport type TwoFactorChallengeInput = {\n  id: string;\n  method: \"totp\" | \"passkey\" | \"backup\";\n};\n\nexport class TwoFactorChallenge extends AbstractApiData implements TwoFactorChallengeInterface {\n  private _pendingToken: string = \"\";\n  private _availableMethods: (\"totp\" | \"passkey\" | \"backup\")[] = [];\n  private _expiresAt: Date = new Date();\n\n  get pendingToken(): string {\n    return this._pendingToken;\n  }\n\n  get availableMethods(): (\"totp\" | \"passkey\" | \"backup\")[] {\n    return this._availableMethods;\n  }\n\n  get expiresAt(): Date {\n    return this._expiresAt;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n    this._pendingToken = data.jsonApi.attributes.pendingToken ?? \"\";\n    this._availableMethods = data.jsonApi.attributes.availableMethods ?? [];\n    this._expiresAt = data.jsonApi.attributes.expiresAt ? new Date(data.jsonApi.attributes.expiresAt) : new Date();\n    return this;\n  }\n\n  createJsonApi(data: TwoFactorChallengeInput) {\n    return {\n      data: {\n        type: \"two-factor-configs\",\n        id: data.id,\n        attributes: {\n          method: data.method,\n        },\n      },\n    };\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { TwoFactorChallenge } from \"./data/two-factor-challenge\";\n\nexport const TwoFactorChallengeModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"two-factor-challenge\",\n    pageUrl: \"/two-factor-challenge\",\n    model: TwoFactorChallenge,\n  });\n","import { AbstractApiData } from \"../../../core\";\n\nexport type BackupCodeVerifyInput = {\n  id: string;\n  code: string;\n};\n\nexport class BackupCodeVerify extends AbstractApiData {\n  createJsonApi(data: BackupCodeVerifyInput) {\n    return {\n      data: {\n        type: \"backup-codes\",\n        id: data.id,\n        attributes: {\n          code: data.code,\n        },\n      },\n    };\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { BackupCodeVerify } from \"./data/backup-code-verify\";\n\nexport const BackupCodeVerifyModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"backup-codes\",\n    pageUrl: \"/backup-codes\",\n    model: BackupCodeVerify,\n  });\n","/**\n * Token parameters for authentication cookie management\n */\nexport interface TokenParams {\n  token?: string;\n  refreshToken?: string;\n  userId?: string;\n  companyId?: string;\n  roles?: string[];\n  features?: string[];\n  modules?: {\n    id: string;\n    permissions: {\n      create: boolean | string;\n      read: boolean | string;\n      update: boolean | string;\n      delete: boolean | string;\n    };\n  }[];\n}\n\n/**\n * Token handler interface for dependency injection\n * Apps must provide implementations of these functions via configureAuth()\n */\nexport interface TokenHandler {\n  updateToken: (params: TokenParams) => Promise<void>;\n  removeToken: () => Promise<void>;\n}\n\n// Private storage for the injected token handler\nlet _tokenHandler: TokenHandler | null = null;\n\n/**\n * Configure authentication token handling\n * Call this at app startup to provide Server Actions for cookie management\n *\n * @example\n * ```typescript\n * import { configureAuth } from \"@carlonicora/nextjs-jsonapi\";\n * import { updateToken, removeToken } from \"@/features/auth/utils/AuthCookies\";\n *\n * configureAuth({ updateToken, removeToken });\n * ```\n */\nexport function configureAuth(handler: TokenHandler): void {\n  _tokenHandler = handler;\n}\n\n/**\n * Internal getter for AuthService to access the token handler\n * @internal\n */\nexport function getTokenHandler(): TokenHandler | null {\n  return _tokenHandler;\n}\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { UserInterface } from \"../../user/data/user.interface\";\nimport { AuthInput, AuthInterface } from \"./auth.interface\";\n\nexport class Auth extends AbstractApiData implements AuthInterface {\n  private _token?: string;\n  private _refreshToken?: string;\n  private _user?: UserInterface;\n\n  get token(): string {\n    if (!this._token) throw new Error(\"Token is not defined\");\n    return this._token;\n  }\n\n  get refreshToken(): string {\n    if (!this._refreshToken) throw new Error(\"Refresh token is not defined\");\n    return this._refreshToken;\n  }\n\n  get user(): UserInterface {\n    if (!this._user) throw new Error(\"User is not defined\");\n    return this._user;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._token = data.jsonApi.attributes.token ?? undefined;\n    this._refreshToken = data.jsonApi.attributes.refreshToken ?? undefined;\n\n    this._user = this._readIncluded(data, \"user\", Modules.User) as UserInterface;\n\n    return this;\n  }\n\n  createJsonApi(data: AuthInput) {\n    const response: any = {\n      data: {\n        type: Modules.Auth.name,\n        attributes: {},\n      },\n    };\n\n    if (data.id) response.data.id = data.id;\n    if (data.email !== undefined) response.data.attributes.email = data.email;\n    if (data.name !== undefined) response.data.attributes.name = data.name;\n    if (data.companyName !== undefined) response.data.attributes.companyName = data.companyName;\n    if (data.password !== undefined) response.data.attributes.password = data.password;\n    if (data.termsAcceptedAt !== undefined) response.data.attributes.termsAcceptedAt = data.termsAcceptedAt;\n    if (data.marketingConsent !== undefined) response.data.attributes.marketingConsent = data.marketingConsent;\n    if (data.marketingConsentAt !== undefined) response.data.attributes.marketingConsentAt = data.marketingConsentAt;\n    if (data.inviteCode !== undefined) response.data.attributes.inviteCode = data.inviteCode;\n    if (data.referralCode !== undefined) response.data.attributes.referralCode = data.referralCode;\n\n    return response;\n  }\n}\n","import { AuthInput, AuthInterface } from \".\";\nimport {\n  AbstractService,\n  ApiResponseInterface,\n  EndpointCreator,\n  HttpMethod,\n  JsonApiHydratedDataInterface,\n  Modules,\n  rehydrate,\n} from \"../../../core\";\nimport { JsonApiDelete, JsonApiGet, JsonApiPost } from \"../../../unified\";\nimport { UserInterface } from \"../../user\";\nimport { getTokenHandler } from \"../config\";\nimport { TwoFactorChallengeInterface } from \"./two-factor-challenge.interface\";\n\nexport class AuthService extends AbstractService {\n  static async login(params: {\n    email: string;\n    password: string;\n    language?: string;\n  }): Promise<UserInterface | TwoFactorChallengeInterface> {\n    const language = params.language || \"en-US\";\n\n    const apiResponse: ApiResponseInterface = await JsonApiPost({\n      classKey: Modules.Auth,\n      endpoint: new EndpointCreator({ endpoint: Modules.Auth, id: \"login\" }).generate(),\n      body: { email: params.email, password: params.password } as AuthInput,\n      language: language,\n    });\n\n    if (!apiResponse.ok) throw new Error(apiResponse.error);\n\n    // POLYMORPHIC RESPONSE: Login can return EITHER Auth OR TwoFactorChallenge\n    // translateResponse used Modules.Auth for rehydration, but backend may return different type\n    // Check raw response type and manually rehydrate with correct module if needed\n    if (apiResponse.raw?.data?.type === \"two-factor-challenge\") {\n      const challenge = rehydrate<TwoFactorChallengeInterface>(Modules.TwoFactorChallenge, {\n        jsonApi: apiResponse.raw.data,\n        included: apiResponse.raw.included ?? [],\n      });\n      return challenge;\n    }\n\n    // Normal auth response\n    const auth = apiResponse.data as AuthInterface;\n\n    // Use injected token handler if configured\n    const handler = getTokenHandler();\n    if (handler) {\n      await handler.updateToken({\n        token: auth.token,\n        refreshToken: auth.refreshToken,\n        userId: auth.user.id,\n        companyId: auth.user.company?.id,\n        roles: auth.user.roles.map((role) => role.id),\n        features: auth.user.company?.features?.map((feature) => feature.id) ?? [],\n        modules: auth.user.modules.map((module) => ({\n          id: module.id,\n          permissions: module.permissions,\n        })),\n      });\n    }\n\n    return auth.user;\n  }\n\n  static async logout(params?: { language?: string }): Promise<void> {\n    const language = params?.language || \"en-US\";\n\n    await JsonApiDelete({\n      classKey: Modules.Auth,\n      endpoint: new EndpointCreator({ endpoint: Modules.Auth }).generate(),\n      language: language,\n    });\n\n    // Use injected token handler if configured\n    const handler = getTokenHandler();\n    if (handler) {\n      await handler.removeToken();\n    }\n  }\n\n  static async initialiseForgotPassword(params: { email: string; language?: string }): Promise<void> {\n    const language = params.language || \"en-US\";\n\n    const response: ApiResponseInterface = await JsonApiPost({\n      classKey: Modules.Auth,\n      endpoint: new EndpointCreator({ endpoint: Modules.Auth, id: \"forgot\" }).generate(),\n      body: { email: params.email } as AuthInput,\n      language: language,\n    });\n\n    if (!response.ok) {\n      throw new Error(response.error);\n    }\n  }\n\n  static async register(params: AuthInput): Promise<void> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.Auth, id: \"register\" });\n\n    await this.callApi({\n      type: Modules.Auth,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n      input: params,\n    });\n  }\n\n  static async activate(params: { activationCode: string }): Promise<void> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.Auth,\n      id: \"activate\",\n      childEndpoint: params.activationCode,\n    });\n\n    await this.callApi({ type: Modules.Auth, method: HttpMethod.POST, endpoint: endpoint.generate() });\n  }\n\n  static async validateCode(params: { code: string; language?: string }): Promise<void> {\n    const language = params.language || \"en-US\";\n\n    const apiResponse: ApiResponseInterface = await JsonApiGet({\n      classKey: Modules.Auth,\n      endpoint: new EndpointCreator({ endpoint: Modules.Auth, id: \"validate\", childEndpoint: params.code }).generate(),\n      language: language,\n    });\n\n    if (!apiResponse.ok) throw new Error(apiResponse.error);\n  }\n\n  static async resetPassword(params: { code: string; password: string }): Promise<void> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.Auth, id: \"reset\", childEndpoint: params.code });\n\n    const input: AuthInput = { password: params.password };\n\n    await this.callApi({ type: Modules.Auth, method: HttpMethod.POST, endpoint: endpoint.generate(), input: input });\n  }\n\n  static async acceptInvitation(params: { code: string; password: string }): Promise<void> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.Auth, id: \"invitation\", childEndpoint: params.code });\n\n    const input: AuthInput = { password: params.password };\n\n    await this.callApi({ type: Modules.Auth, method: HttpMethod.POST, endpoint: endpoint.generate(), input: input });\n  }\n\n  static async findToken(params: { tokenCode: string }): Promise<AuthInterface> {\n    return await this.callApi<AuthInterface>({\n      type: Modules.Auth,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({ endpoint: Modules.Auth }).addAdditionalParam(\"code\", params.tokenCode).generate(),\n    });\n  }\n\n  static async saveToken(params: { dehydratedAuth: JsonApiHydratedDataInterface }): Promise<void> {\n    const auth: AuthInterface = rehydrate(Modules.Auth, params.dehydratedAuth) as AuthInterface;\n\n    const handler = getTokenHandler();\n    if (handler) {\n      await handler.updateToken({\n        token: auth.token,\n        refreshToken: auth.refreshToken,\n        userId: auth.user.id,\n        companyId: auth.user.company?.id,\n        roles: auth.user.roles.map((role) => role.id),\n        features: auth.user.company?.features?.map((feature) => feature.id) ?? [],\n        modules: auth.user.modules.map((module) => ({\n          id: module.id,\n          permissions: module.permissions,\n        })),\n      });\n    }\n  }\n\n  static async completeOAuthRegistration(params: {\n    pendingId: string;\n    termsAcceptedAt: string;\n    marketingConsent: boolean;\n    marketingConsentAt: string | null;\n  }): Promise<{ code: string }> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.Auth, id: \"oauth\", childEndpoint: \"complete\" });\n\n    const response: ApiResponseInterface = await JsonApiPost({\n      classKey: Modules.Auth,\n      endpoint: endpoint.generate(),\n      body: params,\n      overridesJsonApiCreation: true,\n      language: \"en\",\n    });\n\n    if (!response.ok) throw new Error(response.error);\n\n    return response.data as unknown as { code: string };\n  }\n}\n","import { AbstractApiData, JsonApiHydratedDataInterface } from \"../../../core\";\nimport { TwoFactorStatusInterface } from \"./two-factor-status.interface\";\nimport { TotpAuthenticatorInterface } from \"./totp-authenticator.interface\";\nimport { PasskeyInterface } from \"./passkey.interface\";\n\nexport class TwoFactorStatus extends AbstractApiData implements TwoFactorStatusInterface {\n  private _isEnabled: boolean = false;\n  private _preferredMethod?: \"totp\" | \"passkey\";\n  private _totpAuthenticators: TotpAuthenticatorInterface[] = [];\n  private _passkeys: PasskeyInterface[] = [];\n  private _backupCodesCount: number = 0;\n\n  get isEnabled(): boolean {\n    return this._isEnabled;\n  }\n\n  get preferredMethod(): \"totp\" | \"passkey\" | undefined {\n    return this._preferredMethod;\n  }\n\n  get totpAuthenticators(): TotpAuthenticatorInterface[] {\n    return this._totpAuthenticators;\n  }\n\n  get passkeys(): PasskeyInterface[] {\n    return this._passkeys;\n  }\n\n  get backupCodesCount(): number {\n    return this._backupCodesCount;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n    this._isEnabled = data.jsonApi.attributes.isEnabled ?? false;\n    this._preferredMethod = data.jsonApi.attributes.preferredMethod;\n    this._backupCodesCount = data.jsonApi.attributes.backupCodesCount ?? 0;\n    return this;\n  }\n}\n","import { AuthenticationResponseJSON, RegistrationResponseJSON } from \"@simplewebauthn/browser\";\nimport { AbstractService, EndpointCreator, HttpMethod, Modules } from \"../../../core\";\nimport { getTokenHandler } from \"../config\";\nimport { AuthInterface } from \"./auth.interface\";\nimport { PasskeyInterface } from \"./passkey.interface\";\nimport { PasskeyAuthenticationOptionsInterface } from \"./passkey-authentication-options.interface\";\nimport { PasskeyRegistrationOptionsInterface } from \"./passkey-registration-options\";\nimport { TotpAuthenticatorInterface } from \"./totp-authenticator.interface\";\nimport { TotpSetupInterface } from \"./totp-setup.interface\";\nimport { TwoFactorChallengeInterface } from \"./two-factor-challenge.interface\";\nimport { TwoFactorStatusInterface } from \"./two-factor-status.interface\";\n\nexport class TwoFactorService extends AbstractService {\n  // ============================================================\n  // Status\n  // ============================================================\n\n  static async getStatus(): Promise<TwoFactorStatusInterface> {\n    return this.callApi<TwoFactorStatusInterface>({\n      type: Modules.TwoFactorStatus,\n      method: HttpMethod.GET,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Auth,\n        id: \"two-factor\",\n        childEndpoint: \"status\",\n      }).generate(),\n    });\n  }\n\n  static async enable(params: { id: string; preferredMethod: \"totp\" | \"passkey\" }): Promise<void> {\n    await this.callApi({\n      type: Modules.TwoFactorEnable,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Auth,\n        id: \"two-factor\",\n        childEndpoint: \"enable\",\n      }).generate(),\n      input: params,\n    });\n  }\n\n  static async disable(params: { code: string }): Promise<void> {\n    await this.callApi({\n      type: Modules.Auth,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Auth,\n        id: \"two-factor\",\n        childEndpoint: \"disable\",\n      }).generate(),\n      input: { code: params.code },\n    });\n  }\n\n  // ============================================================\n  // TOTP\n  // ============================================================\n\n  static async setupTotp(params: { id: string; name: string; accountName: string }): Promise<TotpSetupInterface> {\n    return this.callApi<TotpSetupInterface>({\n      type: Modules.TotpSetup,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Auth,\n        id: \"totp\",\n        childEndpoint: \"setup\",\n      }).generate(),\n      input: params,\n    });\n  }\n\n  static async verifyTotpSetup(params: { id: string; authenticatorId: string; code: string }): Promise<void> {\n    await this.callApi({\n      type: Modules.TotpVerify,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Auth,\n        id: \"totp\",\n        childEndpoint: \"verify-setup\",\n      }).generate(),\n      input: params,\n    });\n  }\n\n  static async listTotpAuthenticators(): Promise<TotpAuthenticatorInterface[]> {\n    return this.callApi<TotpAuthenticatorInterface[]>({\n      type: Modules.TotpAuthenticator,\n      method: HttpMethod.GET,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Auth,\n        id: \"totp\",\n        childEndpoint: \"authenticators\",\n      }).generate(),\n    });\n  }\n\n  static async deleteTotpAuthenticator(params: { id: string }): Promise<void> {\n    await this.callApi({\n      type: Modules.Auth,\n      method: HttpMethod.DELETE,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Auth,\n        id: \"totp\",\n        childEndpoint: \"authenticators\",\n        childId: params.id,\n      }).generate(),\n    });\n  }\n\n  // ============================================================\n  // Passkeys\n  // ============================================================\n\n  static async getPasskeyRegistrationOptions(params: {\n    id: string;\n    userName: string;\n    userDisplayName?: string;\n  }): Promise<PasskeyRegistrationOptionsInterface> {\n    return this.callApi<PasskeyRegistrationOptionsInterface>({\n      type: Modules.PasskeyRegistrationOptions,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Auth,\n        id: \"passkey\",\n        childEndpoint: \"register\",\n        childId: \"options\",\n      }).generate(),\n      input: params,\n    });\n  }\n\n  static async verifyPasskeyRegistration(params: {\n    id: string;\n    pendingId: string;\n    name: string;\n    response: RegistrationResponseJSON;\n  }): Promise<PasskeyInterface> {\n    return this.callApi<PasskeyInterface>({\n      type: Modules.PasskeyRegistrationVerify,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Auth,\n        id: \"passkey\",\n        childEndpoint: \"register\",\n        childId: \"verify\",\n      }).generate(),\n      input: params,\n    });\n  }\n\n  static async listPasskeys(): Promise<PasskeyInterface[]> {\n    return this.callApi<PasskeyInterface[]>({\n      type: Modules.Passkey,\n      method: HttpMethod.GET,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Auth,\n        id: \"passkeys\",\n      }).generate(),\n    });\n  }\n\n  static async deletePasskey(params: { id: string }): Promise<void> {\n    await this.callApi({\n      type: Modules.Auth,\n      method: HttpMethod.DELETE,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Auth,\n        id: \"passkeys\",\n        childEndpoint: params.id,\n      }).generate(),\n    });\n  }\n\n  static async renamePasskey(params: { id: string; name: string }): Promise<PasskeyInterface> {\n    return this.callApi<PasskeyInterface>({\n      type: Modules.PasskeyRename,\n      method: HttpMethod.PATCH,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Auth,\n        id: \"passkeys\",\n        childEndpoint: params.id,\n      }).generate(),\n      input: { id: params.id, name: params.name },\n    });\n  }\n\n  // ============================================================\n  // Backup Codes\n  // ============================================================\n\n  static async generateBackupCodes(): Promise<string[]> {\n    const response = await this.callApi<{ codes: string[] }>({\n      type: Modules.Auth,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Auth,\n        id: \"backup-codes\",\n        childEndpoint: \"generate\",\n      }).generate(),\n    });\n    return response.codes;\n  }\n\n  static async getBackupCodesCount(): Promise<number> {\n    const response = await this.callApi<{ count: number }>({\n      type: Modules.Auth,\n      method: HttpMethod.GET,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Auth,\n        id: \"backup-codes\",\n        childEndpoint: \"count\",\n      }).generate(),\n    });\n    return response.count;\n  }\n\n  // ============================================================\n  // Login 2FA Verification\n  // ============================================================\n\n  private static async handleSuccessfulAuth(auth: AuthInterface): Promise<AuthInterface> {\n    const handler = getTokenHandler();\n    if (handler) {\n      await handler.updateToken({\n        token: auth.token,\n        refreshToken: auth.refreshToken,\n        userId: auth.user.id,\n        companyId: auth.user.company?.id,\n        roles: auth.user.roles.map((role) => role.id),\n        features: auth.user.company?.features?.map((feature) => feature.id) ?? [],\n        modules: auth.user.modules.map((module) => ({\n          id: module.id,\n          permissions: module.permissions,\n        })),\n      });\n    }\n\n    return auth;\n  }\n\n  static async getChallenge(params: {\n    id: string;\n    pendingToken: string;\n    method: \"totp\" | \"passkey\" | \"backup\";\n  }): Promise<TwoFactorChallengeInterface> {\n    return this.callApi<TwoFactorChallengeInterface>({\n      type: Modules.TwoFactorChallenge,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Auth,\n        id: \"two-factor\",\n        childEndpoint: \"challenge\",\n      }).generate(),\n      input: { id: params.id, method: params.method },\n    });\n  }\n\n  static async verifyTotp(params: { id: string; pendingToken: string; code: string }): Promise<AuthInterface> {\n    const auth = await this.callApi<AuthInterface>({\n      type: Modules.TotpVerifyLogin, // Request: { type: \"totp-authenticators\", attributes: { code } }\n      responseType: Modules.Auth, // Response: Auth with user relationship\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Auth,\n        id: \"two-factor\",\n        childEndpoint: \"verify\",\n        childId: \"totp\",\n      }).generate(),\n      input: { id: params.id, code: params.code },\n      token: params.pendingToken,\n    });\n\n    return this.handleSuccessfulAuth(auth);\n  }\n\n  static async getPasskeyAuthOptions(params: { pendingToken: string }): Promise<PasskeyAuthenticationOptionsInterface> {\n    return this.callApi<PasskeyAuthenticationOptionsInterface>({\n      type: Modules.PasskeyAuthenticationOptions,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Auth,\n        id: \"two-factor\",\n        childEndpoint: \"verify/passkey\",\n        childId: \"options\",\n      }).generate(),\n      token: params.pendingToken,\n    });\n  }\n\n  static async verifyPasskey(params: {\n    id: string;\n    pendingToken: string;\n    pendingId: string;\n    credential: AuthenticationResponseJSON;\n  }): Promise<AuthInterface> {\n    const auth = await this.callApi<AuthInterface>({\n      type: Modules.PasskeyVerifyLogin, // Request: passkey verification format\n      responseType: Modules.Auth, // Response: Auth with user relationship\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Auth,\n        id: \"two-factor\",\n        childEndpoint: \"verify\",\n        childId: \"passkey\",\n      }).generate(),\n      input: { id: params.id, pendingId: params.pendingId, response: params.credential },\n      token: params.pendingToken,\n    });\n\n    return this.handleSuccessfulAuth(auth);\n  }\n\n  static async verifyBackupCode(params: { id: string; pendingToken: string; code: string }): Promise<AuthInterface> {\n    const auth = await this.callApi<AuthInterface>({\n      type: Modules.BackupCodeVerify, // Request: backup code verification format\n      responseType: Modules.Auth, // Response: Auth with user relationship\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Auth,\n        id: \"two-factor\",\n        childEndpoint: \"verify\",\n        childId: \"backup\",\n      }).generate(),\n      input: { id: params.id, code: params.code },\n      token: params.pendingToken,\n    });\n\n    return this.handleSuccessfulAuth(auth);\n  }\n}\n","export enum AuthComponent {\n  Login,\n  ForgotPassword,\n  ResetPassword,\n  ActivateAccount,\n  AcceptInvitation,\n  Register,\n  Landing,\n  TwoFactorChallenge = \"2fa_challenge\",\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { Auth } from \".\";\n\nexport const AuthModule = (factory: ModuleFactory) =>\n  factory({\n    pageUrl: \"/auth\",\n    name: \"auth\",\n    model: Auth,\n  });\n","import { ModuleFactory } from \"../../permissions\";\nimport { TwoFactorStatus } from \"./data/two-factor-status\";\n\nexport const TwoFactorStatusModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"two-factor-status\",\n    pageUrl: \"/two-factor-status\",\n    model: TwoFactorStatus,\n  });\n","import { AbstractService, EndpointCreator, HttpMethod, Modules, NextRef, PreviousRef } from \"../../../core\";\n\n// Import from new sub-modules for backwards compatibility re-exports\nimport { MeterInterface, MeterSummaryInterface } from \"../stripe-usage/data/stripe-usage.interface\";\n\n/**\n * Legacy billing service - only contains meter methods\n * @deprecated Use StripeUsageService for meter methods, StripeInvoiceService for invoices,\n * StripeCustomerService for payment methods\n */\nexport class BillingService extends AbstractService {\n  // ============================================================================\n  // Meter Methods (kept here for backwards compatibility)\n  // ============================================================================\n\n  /**\n   * List all available usage meters\n   * @deprecated Use StripeUsageService.listMeters() instead\n   */\n  static async listMeters(params?: { next?: NextRef; prev?: PreviousRef }): Promise<MeterInterface[]> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeUsage,\n      childEndpoint: \"meters\",\n    });\n\n    return this.callApi({\n      type: Modules.StripeUsage,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params?.next,\n      previous: params?.prev,\n    });\n  }\n\n  /**\n   * Get meter summaries for a specific time period\n   * @deprecated Use StripeUsageService.getMeterSummaries() instead\n   */\n  static async getMeterSummaries(params: {\n    meterId: string;\n    startTime: Date;\n    endTime: Date;\n  }): Promise<MeterSummaryInterface[]> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeUsage,\n      childEndpoint: `meters/${params.meterId}/summaries`,\n    });\n\n    endpoint.addAdditionalParam(\"startTime\", params.startTime.toISOString());\n    endpoint.addAdditionalParam(\"endTime\", params.endTime.toISOString());\n\n    return this.callApi({\n      type: Modules.StripeUsage,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n    });\n  }\n}\n","import { AbstractApiData, JsonApiHydratedDataInterface } from \"../../../core\";\n\n/**\n * Billing is a namespace module used for permissions and non-entity endpoints.\n * It doesn't correspond to a specific backend entity but provides routing for\n * meter-related endpoints and permission checks.\n */\nexport class Billing extends AbstractApiData {\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n    return this;\n  }\n\n  createJsonApi(_data?: any): any {\n    throw new Error(\"Billing is a namespace module and cannot be created\");\n  }\n}\n","import { ModuleFactory } from \"../../../permissions\";\nimport { Billing } from \"../data/Billing\";\n\nexport const BillingModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"billing\",\n    pageUrl: \"/billing\",\n    model: Billing,\n    moduleId: \"3266b307-5a9a-46f9-b78d-631f672f8735\",\n  });\n","import { AbstractApiData, JsonApiHydratedDataInterface } from \"../../../../core\";\nimport { PaymentMethodInterface } from \"./payment-method.interface\";\n\n/**\n * PaymentMethod class for JSON:API rehydration\n *\n * Transforms flat JSON:API attributes into the nested PaymentMethodInterface structure\n * expected by the frontend components.\n */\nexport class PaymentMethod extends AbstractApiData implements PaymentMethodInterface {\n  private _paymentType?: string;\n  private _card?: {\n    brand: string;\n    last4: string;\n    expMonth: number;\n    expYear: number;\n  };\n  private _billingDetails?: {\n    name?: string;\n    email?: string;\n    phone?: string;\n    address?: {\n      city?: string;\n      country?: string;\n      line1?: string;\n      line2?: string;\n      postalCode?: string;\n      state?: string;\n    };\n  };\n\n  get type(): string {\n    if (!this._paymentType) throw new Error(\"type is not defined\");\n    return this._paymentType;\n  }\n\n  get card():\n    | {\n        brand: string;\n        last4: string;\n        expMonth: number;\n        expYear: number;\n      }\n    | undefined {\n    return this._card;\n  }\n\n  get billingDetails():\n    | {\n        name?: string;\n        email?: string;\n        phone?: string;\n        address?: {\n          city?: string;\n          country?: string;\n          line1?: string;\n          line2?: string;\n          postalCode?: string;\n          state?: string;\n        };\n      }\n    | undefined {\n    return this._billingDetails;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    const attrs = data.jsonApi.attributes;\n\n    this._paymentType = attrs.type;\n\n    // Build card object from flat attributes\n    if (attrs.brand || attrs.last4 || attrs.expMonth || attrs.expYear) {\n      this._card = {\n        brand: attrs.brand,\n        last4: attrs.last4,\n        expMonth: attrs.expMonth,\n        expYear: attrs.expYear,\n      };\n    }\n\n    // Build billingDetails object from flat attributes\n    const hasAddress =\n      attrs.billingAddressCity ||\n      attrs.billingAddressCountry ||\n      attrs.billingAddressLine1 ||\n      attrs.billingAddressLine2 ||\n      attrs.billingAddressPostalCode ||\n      attrs.billingAddressState;\n\n    const hasBillingDetails = attrs.billingName || attrs.billingEmail || attrs.billingPhone || hasAddress;\n\n    if (hasBillingDetails) {\n      this._billingDetails = {\n        name: attrs.billingName ?? undefined,\n        email: attrs.billingEmail ?? undefined,\n        phone: attrs.billingPhone ?? undefined,\n      };\n\n      if (hasAddress) {\n        this._billingDetails.address = {\n          city: attrs.billingAddressCity ?? undefined,\n          country: attrs.billingAddressCountry ?? undefined,\n          line1: attrs.billingAddressLine1 ?? undefined,\n          line2: attrs.billingAddressLine2 ?? undefined,\n          postalCode: attrs.billingAddressPostalCode ?? undefined,\n          state: attrs.billingAddressState ?? undefined,\n        };\n      }\n    }\n\n    return this;\n  }\n\n  createJsonApi(_data?: any): any {\n    throw new Error(\"PaymentMethod is managed by Stripe and cannot be created directly\");\n  }\n}\n","import { AbstractApiData, JsonApiHydratedDataInterface } from \"../../../../core\";\nimport { StripeCustomerInterface } from \"./stripe-customer.interface\";\n\nexport class StripeCustomer extends AbstractApiData implements StripeCustomerInterface {\n  private _stripeCustomerId?: string;\n  private _email?: string;\n  private _name?: string;\n  private _defaultPaymentMethodId?: string;\n  private _currency?: string;\n  private _balance?: number;\n  private _delinquent: boolean = false;\n  private _metadata?: Record<string, any>;\n\n  get stripeCustomerId(): string {\n    if (!this._stripeCustomerId) throw new Error(\"stripeCustomerId is not defined\");\n    return this._stripeCustomerId;\n  }\n\n  get email(): string | undefined {\n    return this._email;\n  }\n\n  get name(): string | undefined {\n    return this._name;\n  }\n\n  get defaultPaymentMethodId(): string | undefined {\n    return this._defaultPaymentMethodId;\n  }\n\n  get currency(): string | undefined {\n    return this._currency;\n  }\n\n  get balance(): number | undefined {\n    return this._balance;\n  }\n\n  get delinquent(): boolean {\n    return this._delinquent;\n  }\n\n  get metadata(): Record<string, any> | undefined {\n    return this._metadata;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._stripeCustomerId = data.jsonApi.attributes.stripeCustomerId;\n    this._email = data.jsonApi.attributes.email;\n    this._name = data.jsonApi.attributes.name;\n    this._defaultPaymentMethodId = data.jsonApi.attributes.defaultPaymentMethodId;\n    this._currency = data.jsonApi.attributes.currency;\n    this._balance = data.jsonApi.attributes.balance;\n    this._delinquent = data.jsonApi.attributes.delinquent ?? false;\n\n    // Parse metadata if it's a string (backend stores as JSON string)\n    this._metadata = data.jsonApi.attributes.metadata\n      ? typeof data.jsonApi.attributes.metadata === \"string\"\n        ? JSON.parse(data.jsonApi.attributes.metadata)\n        : data.jsonApi.attributes.metadata\n      : undefined;\n\n    return this;\n  }\n\n  createJsonApi(_data?: any): any {\n    throw new Error(\"BillingCustomer is managed by Stripe and cannot be created directly\");\n  }\n}\n","import { AbstractService, EndpointCreator, HttpMethod, Modules, NextRef, PreviousRef } from \"../../../../core\";\nimport { PaymentMethodInterface } from \"./payment-method.interface\";\nimport { StripeCustomerInterface } from \"./stripe-customer.interface\";\n\n/**\n * Customer-facing billing service for managing subscriptions, payments, and usage\n */\nexport class StripeCustomerService extends AbstractService {\n  // ============================================================================\n  // Customer Methods\n  // ============================================================================\n\n  /**\n   * Get the current user's billing customer record\n   */\n  static async getCustomer(): Promise<StripeCustomerInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeCustomer,\n    });\n\n    return this.callApi<StripeCustomerInterface>({\n      type: Modules.StripeCustomer,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  /**\n   * Create a billing customer for the current user\n   */\n  static async createCustomer(): Promise<StripeCustomerInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeCustomer,\n    });\n\n    return this.callApi<StripeCustomerInterface>({\n      type: Modules.StripeCustomer,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  /**\n   * Create a setup intent for adding payment methods\n   */\n  static async createSetupIntent(): Promise<{ clientSecret: string }> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.Billing,\n      childEndpoint: \"setup-intent\",\n    });\n\n    return this.callApi({\n      type: Modules.Billing,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  /**\n   * Create a Stripe customer portal session URL\n   */\n  static async createPortalSession(): Promise<{ url: string }> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.Billing,\n      childEndpoint: \"customers/portal-session\",\n    });\n\n    return this.callApi({\n      type: Modules.Billing,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  // ============================================================================\n  // Payment Method Methods\n  // ============================================================================\n\n  /**\n   * List all payment methods for the current user\n   */\n  static async listPaymentMethods(params?: { next?: NextRef; prev?: PreviousRef }): Promise<PaymentMethodInterface[]> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeCustomer,\n      childEndpoint: \"payment-methods\",\n    });\n\n    return this.callApi({\n      type: Modules.StripePaymentMethod,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params?.next,\n      previous: params?.prev,\n    });\n  }\n\n  /**\n   * Set the default payment method for the current user\n   */\n  static async setDefaultPaymentMethod(params: { paymentMethodId: string }): Promise<StripeCustomerInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeCustomer,\n      childEndpoint: `payment-methods/${params.paymentMethodId}/default`,\n    });\n\n    return this.callApi<StripeCustomerInterface>({\n      type: Modules.StripeCustomer,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  /**\n   * Remove a payment method\n   */\n  static async removePaymentMethod(params: { paymentMethodId: string }): Promise<void> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeCustomer,\n      childEndpoint: `payment-methods/${params.paymentMethodId}`,\n    });\n\n    await this.callApi({\n      type: Modules.StripeCustomer,\n      method: HttpMethod.DELETE,\n      endpoint: endpoint.generate(),\n    });\n  }\n}\n","import { ModuleFactory } from \"../../../permissions\";\nimport { StripeCustomer } from \"./data\";\n\nexport const StripeCustomerModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"stripe-customers\",\n    pageUrl: \"/stripe-customers\",\n    model: StripeCustomer,\n    moduleId: \"25a80cb3-bf18-47fd-963a-639212519920\",\n  });\n","import { ModuleFactory } from \"../../../permissions\";\nimport { PaymentMethod } from \"./data/payment-method\";\n\nexport const StripePaymentMethodModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"stripe-payment-methods\",\n    pageUrl: \"/stripe-payment-methods\",\n    model: PaymentMethod,\n    moduleId: \"e8f7d6c5-b4a3-4928-8170-1f2e3d4c5b6a\",\n  });\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules, StripeSubscriptionInterface } from \"../../../../core\";\nimport { InvoiceStatus, StripeInvoiceInterface } from \"./stripe-invoice.interface\";\n\nexport class StripeInvoice extends AbstractApiData implements StripeInvoiceInterface {\n  private _stripeInvoiceId?: string;\n  private _stripeInvoiceNumber?: string;\n  private _customerId?: string;\n  private _subscriptionId?: string;\n  private _subscription?: StripeSubscriptionInterface;\n  private _status?: InvoiceStatus;\n  private _amountDue?: number;\n  private _amountPaid?: number;\n  private _amountRemaining?: number;\n  private _subtotal?: number;\n  private _total?: number;\n  private _tax?: number;\n  private _currency?: string;\n  private _periodStart?: Date;\n  private _periodEnd?: Date;\n  private _dueDate?: Date;\n  private _paidAt?: Date;\n  private _attemptCount: number = 0;\n  private _attempted: boolean = false;\n  private _stripeHostedInvoiceUrl?: string;\n  private _stripePdfUrl?: string;\n  private _paid: boolean = false;\n  private _metadata?: Record<string, any>;\n\n  get stripeInvoiceId(): string {\n    if (!this._stripeInvoiceId) throw new Error(\"stripeInvoiceId is not defined\");\n    return this._stripeInvoiceId;\n  }\n\n  get stripeInvoiceNumber(): string | undefined {\n    return this._stripeInvoiceNumber;\n  }\n\n  get customerId(): string | undefined {\n    return this._customerId;\n  }\n\n  get subscriptionId(): string | undefined {\n    return this._subscriptionId;\n  }\n\n  get subscription(): StripeSubscriptionInterface | undefined {\n    return this._subscription;\n  }\n\n  get status(): InvoiceStatus {\n    if (!this._status) throw new Error(\"status is not defined\");\n    return this._status;\n  }\n\n  get amountDue(): number {\n    if (this._amountDue === undefined) throw new Error(\"amountDue is not defined\");\n    return this._amountDue;\n  }\n\n  get amountPaid(): number {\n    if (this._amountPaid === undefined) throw new Error(\"amountPaid is not defined\");\n    return this._amountPaid;\n  }\n\n  get amountRemaining(): number {\n    if (this._amountRemaining === undefined) throw new Error(\"amountRemaining is not defined\");\n    return this._amountRemaining;\n  }\n\n  get subtotal(): number {\n    if (this._subtotal === undefined) throw new Error(\"subtotal is not defined\");\n    return this._subtotal;\n  }\n\n  get total(): number {\n    if (this._total === undefined) throw new Error(\"total is not defined\");\n    return this._total;\n  }\n\n  get tax(): number | undefined {\n    return this._tax;\n  }\n\n  get currency(): string {\n    if (!this._currency) throw new Error(\"currency is not defined\");\n    return this._currency;\n  }\n\n  get periodStart(): Date {\n    if (!this._periodStart) throw new Error(\"periodStart is not defined\");\n    return this._periodStart;\n  }\n\n  get periodEnd(): Date {\n    if (!this._periodEnd) throw new Error(\"periodEnd is not defined\");\n    return this._periodEnd;\n  }\n\n  get dueDate(): Date | undefined {\n    return this._dueDate;\n  }\n\n  get paidAt(): Date | undefined {\n    return this._paidAt;\n  }\n\n  get attemptCount(): number {\n    return this._attemptCount;\n  }\n\n  get attempted(): boolean {\n    return this._attempted;\n  }\n\n  get stripeHostedInvoiceUrl(): string | undefined {\n    return this._stripeHostedInvoiceUrl;\n  }\n\n  get stripePdfUrl(): string | undefined {\n    return this._stripePdfUrl;\n  }\n\n  get paid(): boolean {\n    return this._paid;\n  }\n\n  get metadata(): Record<string, any> | undefined {\n    return this._metadata;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._stripeInvoiceId = data.jsonApi.attributes.stripeInvoiceId;\n    this._stripeInvoiceNumber = data.jsonApi.attributes.stripeInvoiceNumber;\n    this._customerId = data.jsonApi.attributes.customerId;\n    this._subscriptionId = data.jsonApi.attributes.subscriptionId;\n    this._status = data.jsonApi.attributes.status;\n    this._amountDue = data.jsonApi.attributes.amountDue;\n    this._amountPaid = data.jsonApi.attributes.amountPaid;\n    this._amountRemaining = data.jsonApi.attributes.amountRemaining;\n    this._subtotal = data.jsonApi.attributes.subtotal;\n    this._total = data.jsonApi.attributes.total;\n    this._tax = data.jsonApi.attributes.tax;\n    this._currency = data.jsonApi.attributes.currency;\n\n    this._periodStart = data.jsonApi.attributes.periodStart ? new Date(data.jsonApi.attributes.periodStart) : undefined;\n    this._periodEnd = data.jsonApi.attributes.periodEnd ? new Date(data.jsonApi.attributes.periodEnd) : undefined;\n    this._dueDate = data.jsonApi.attributes.dueDate ? new Date(data.jsonApi.attributes.dueDate) : undefined;\n    this._paidAt = data.jsonApi.attributes.paidAt ? new Date(data.jsonApi.attributes.paidAt) : undefined;\n\n    this._attemptCount = data.jsonApi.attributes.attemptCount ?? 0;\n    this._attempted = data.jsonApi.attributes.attempted ?? false;\n    this._stripeHostedInvoiceUrl = data.jsonApi.attributes.stripeHostedInvoiceUrl;\n    this._stripePdfUrl = data.jsonApi.attributes.stripePdfUrl;\n    this._paid = data.jsonApi.attributes.paid ?? false;\n\n    this._metadata = data.jsonApi.attributes.metadata\n      ? typeof data.jsonApi.attributes.metadata === \"string\"\n        ? JSON.parse(data.jsonApi.attributes.metadata)\n        : data.jsonApi.attributes.metadata\n      : undefined;\n\n    // Hydrate subscription relationship\n    this._subscription = this._readIncluded(\n      data,\n      \"subscription\",\n      Modules.StripeSubscription,\n    ) as StripeSubscriptionInterface;\n\n    return this;\n  }\n\n  createJsonApi(_data?: any): any {\n    throw new Error(\"Invoice is managed by Stripe and cannot be created directly\");\n  }\n}\n","import { ApiDataInterface, StripeSubscriptionInterface } from \"../../../../core\";\n\n// ============================================================================\n// Invoice Enums\n// ============================================================================\n\nexport enum InvoiceStatus {\n  DRAFT = \"draft\",\n  OPEN = \"open\",\n  PAID = \"paid\",\n  UNCOLLECTIBLE = \"uncollectible\",\n  VOID = \"void\",\n}\n\n// ============================================================================\n// Invoice Interfaces\n// ============================================================================\n\nexport interface StripeInvoiceInterface extends ApiDataInterface {\n  get stripeInvoiceId(): string;\n  get stripeInvoiceNumber(): string | undefined;\n  get customerId(): string | undefined;\n  get subscriptionId(): string | undefined;\n  get subscription(): StripeSubscriptionInterface | undefined;\n  get status(): InvoiceStatus;\n  get amountDue(): number;\n  get amountPaid(): number;\n  get amountRemaining(): number;\n  get subtotal(): number;\n  get total(): number;\n  get tax(): number | undefined;\n  get currency(): string;\n  get periodStart(): Date;\n  get periodEnd(): Date;\n  get dueDate(): Date | undefined;\n  get paidAt(): Date | undefined;\n  get attemptCount(): number;\n  get attempted(): boolean;\n  get stripeHostedInvoiceUrl(): string | undefined;\n  get stripePdfUrl(): string | undefined;\n  get paid(): boolean;\n  get metadata(): Record<string, any> | undefined;\n}\n\n// ============================================================================\n// Proration Preview Interfaces\n// ============================================================================\n\nexport interface ProrationPreviewInterface {\n  amountDue: number;\n  currency: string;\n  immediateCharge: number;\n  prorationDate: Date;\n  lineItems: ProrationLineItem[];\n  isTrialUpgrade?: boolean;\n}\n\nexport interface ProrationLineItem {\n  description: string;\n  amount: number;\n  proration: boolean;\n  period: {\n    start: Date;\n    end: Date;\n  };\n}\n","import { AbstractService, EndpointCreator, HttpMethod, Modules, NextRef, PreviousRef } from \"../../../../core\";\nimport { StripeInvoiceInterface } from \"./stripe-invoice.interface\";\n\n/**\n * Service for managing Stripe invoices\n */\nexport class StripeInvoiceService extends AbstractService {\n  /**\n   * List all invoices for the current user\n   */\n  static async listInvoices(params?: {\n    status?: string;\n    next?: NextRef;\n    prev?: PreviousRef;\n  }): Promise<StripeInvoiceInterface[]> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeInvoice,\n    });\n\n    if (params?.status) {\n      endpoint.addAdditionalParam(\"status\", params.status);\n    }\n\n    return this.callApi({\n      type: Modules.StripeInvoice,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params?.next,\n      previous: params?.prev,\n    });\n  }\n\n  /**\n   * Get a specific invoice by ID\n   */\n  static async getInvoice(params: { invoiceId: string }): Promise<StripeInvoiceInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeInvoice,\n      id: params.invoiceId,\n    });\n\n    return this.callApi<StripeInvoiceInterface>({\n      type: Modules.StripeInvoice,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  /**\n   * Get the upcoming invoice for the current user\n   */\n  static async getUpcomingInvoice(): Promise<StripeInvoiceInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeInvoice,\n      id: \"upcoming\",\n    });\n\n    return this.callApi<StripeInvoiceInterface>({\n      type: Modules.StripeInvoice,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n    });\n  }\n}\n","import { ModuleFactory } from \"../../../permissions\";\nimport { StripeInvoice } from \"./data/stripe-invoice\";\n\nexport const StripeInvoiceModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"stripe-invoices\",\n    pageUrl: \"/stripe-invoices\",\n    model: StripeInvoice,\n    moduleId: \"37c73b8b-d3b1-4e5e-8fcb-a66d8ecfc05b\",\n  });\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../../core\";\nimport { StripeProductInterface } from \"../../stripe-product\";\nimport { FeatureInterface } from \"../../../feature\";\nimport { PriceRecurring, StripePriceInput, StripePriceInterface } from \"./stripe-price.interface\";\n\nexport class StripePrice extends AbstractApiData implements StripePriceInterface {\n  private _stripePriceId?: string;\n  private _productId?: string;\n  private _product?: StripeProductInterface;\n  private _active: boolean = true;\n  private _currency?: string;\n  private _unitAmount?: number;\n  private _recurring?: PriceRecurring;\n  private _priceType?: \"one_time\" | \"recurring\";\n  private _nickname?: string;\n  private _lookupKey?: string;\n  private _metadata?: Record<string, any>;\n  private _description?: string;\n  private _features?: string[];\n  private _token?: number;\n  private _isTrial?: boolean;\n  private _priceFeatures: FeatureInterface[] = []; // Platform Feature entities\n\n  get stripePriceId(): string {\n    if (!this._stripePriceId) throw new Error(\"stripePriceId is not defined\");\n    return this._stripePriceId;\n  }\n\n  get productId(): string {\n    if (!this._productId) throw new Error(\"productId is not defined\");\n    return this._productId;\n  }\n\n  get product(): StripeProductInterface | undefined {\n    return this._product;\n  }\n\n  get active(): boolean {\n    return this._active;\n  }\n\n  get currency(): string {\n    if (!this._currency) throw new Error(\"currency is not defined\");\n    return this._currency;\n  }\n\n  get unitAmount(): number | undefined {\n    return this._unitAmount;\n  }\n\n  get recurring(): PriceRecurring | undefined {\n    return this._recurring;\n  }\n\n  get priceType(): \"one_time\" | \"recurring\" {\n    if (!this._priceType) throw new Error(\"priceType is not defined\");\n    return this._priceType;\n  }\n\n  get nickname(): string | undefined {\n    return this._nickname;\n  }\n\n  get lookupKey(): string | undefined {\n    return this._lookupKey;\n  }\n\n  get metadata(): Record<string, any> | undefined {\n    return this._metadata;\n  }\n\n  get description(): string | undefined {\n    return this._description;\n  }\n\n  get features(): string[] | undefined {\n    return this._features;\n  }\n\n  get token(): number | undefined {\n    return this._token;\n  }\n\n  get isTrial(): boolean | undefined {\n    return this._isTrial;\n  }\n\n  get priceFeatures(): FeatureInterface[] {\n    return this._priceFeatures;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._stripePriceId = data.jsonApi.attributes.stripePriceId;\n    this._productId = data.jsonApi.attributes.productId;\n    this._active = data.jsonApi.attributes.active ?? true;\n    this._currency = data.jsonApi.attributes.currency;\n    this._unitAmount = data.jsonApi.attributes.unitAmount;\n    this._priceType = data.jsonApi.attributes.priceType;\n\n    // Construct recurring object from flat attributes\n    if (data.jsonApi.attributes.recurringInterval) {\n      this._recurring = {\n        interval: data.jsonApi.attributes.recurringInterval,\n        intervalCount: data.jsonApi.attributes.recurringIntervalCount ?? 1,\n        usageType: data.jsonApi.attributes.recurringUsageType,\n      };\n    }\n\n    this._nickname = data.jsonApi.attributes.nickname;\n    this._lookupKey = data.jsonApi.attributes.lookupKey;\n\n    this._metadata = data.jsonApi.attributes.metadata\n      ? typeof data.jsonApi.attributes.metadata === \"string\"\n        ? JSON.parse(data.jsonApi.attributes.metadata)\n        : data.jsonApi.attributes.metadata\n      : undefined;\n\n    this._description = data.jsonApi.attributes.description;\n    this._features = data.jsonApi.attributes.features\n      ? typeof data.jsonApi.attributes.features === \"string\"\n        ? JSON.parse(data.jsonApi.attributes.features)\n        : data.jsonApi.attributes.features\n      : undefined;\n\n    this._token = data.jsonApi.attributes.token;\n    this._isTrial = data.jsonApi.attributes.isTrial;\n\n    // Hydrate product relationship\n    this._product = this._readIncluded(data, \"product\", Modules.StripeProduct) as StripeProductInterface;\n\n    // Hydrate feature relationship (JSON:API key is \"features\")\n    this._priceFeatures = this._readIncluded(data, \"features\", Modules.Feature) as FeatureInterface[];\n\n    return this;\n  }\n\n  createJsonApi(data: StripePriceInput): any {\n    const response: any = {\n      data: {\n        type: Modules.StripePrice.name,\n        id: data.id,\n        attributes: {},\n      },\n    };\n\n    if (\"productId\" in data && data.productId) {\n      response.data.attributes.productId = data.productId;\n    }\n    if (\"currency\" in data && data.currency) {\n      response.data.attributes.currency = data.currency;\n    }\n    if (\"unitAmount\" in data && data.unitAmount !== undefined) {\n      response.data.attributes.unitAmount = data.unitAmount;\n    }\n    if (\"active\" in data && data.active !== undefined) {\n      response.data.attributes.active = data.active;\n    }\n    if (\"nickname\" in data && data.nickname !== undefined) {\n      response.data.attributes.nickname = data.nickname;\n    }\n    if (\"metadata\" in data && data.metadata) {\n      response.data.attributes.metadata = data.metadata;\n    }\n    if (\"recurring\" in data && data.recurring) {\n      response.data.attributes.recurring = data.recurring;\n    }\n    if (\"description\" in data && data.description !== undefined) {\n      response.data.attributes.description = data.description;\n    }\n    if (\"features\" in data && data.features !== undefined) {\n      response.data.attributes.features = JSON.stringify(data.features);\n    }\n    if (\"token\" in data && data.token !== undefined) {\n      response.data.attributes.token = data.token;\n    }\n    if (\"isTrial\" in data && data.isTrial !== undefined) {\n      response.data.attributes.isTrial = data.isTrial;\n    }\n\n    // Convert featureIds to JSON:API relationships format\n    if (data.featureIds && data.featureIds.length > 0) {\n      response.data.relationships = response.data.relationships || {};\n      response.data.relationships.features = data.featureIds.map((id) => ({\n        type: Modules.Feature.name,\n        id,\n      }));\n    }\n\n    return response;\n  }\n}\n","export enum StripePriceFields {\n  stripePriceId = \"stripePriceId\",\n  nickname = \"nickname\",\n  amount = \"amount\",\n  interval = \"interval\",\n  token = \"token\",\n  status = \"status\",\n}\n","import { AbstractService, EndpointCreator, HttpMethod, Modules, NextRef, PreviousRef } from \"../../../../core\";\nimport { StripePriceInput, StripePriceInterface } from \"./stripe-price.interface\";\n\n/**\n * Admin billing service for managing products and prices\n */\nexport class StripePriceService extends AbstractService {\n  /**\n   * List all prices (admin)\n   */\n  static async listPrices(params?: {\n    productId?: string;\n    active?: boolean;\n    next?: NextRef;\n    prev?: PreviousRef;\n  }): Promise<StripePriceInterface[]> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripePrice,\n    });\n\n    if (params?.productId) {\n      endpoint.addAdditionalParam(\"productId\", params.productId);\n    }\n    if (params?.active !== undefined) {\n      endpoint.addAdditionalParam(\"active\", params.active.toString());\n    }\n\n    return this.callApi({\n      type: Modules.StripePrice,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params?.next,\n      previous: params?.prev,\n    });\n  }\n\n  /**\n   * Get a specific price by ID (admin)\n   */\n  static async getPrice(params: { id: string }): Promise<StripePriceInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripePrice,\n      id: params.id,\n    });\n\n    return this.callApi<StripePriceInterface>({\n      type: Modules.StripePrice,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  /**\n   * Create a new price (admin)\n   */\n  static async createPrice(params: StripePriceInput): Promise<StripePriceInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripePrice,\n    });\n\n    return this.callApi<StripePriceInterface>({\n      type: Modules.StripePrice,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n      input: params,\n    });\n  }\n\n  /**\n   * Update an existing price (admin)\n   */\n  static async updatePrice(params: StripePriceInput): Promise<StripePriceInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripePrice,\n      id: params.id,\n    });\n\n    return this.callApi<StripePriceInterface>({\n      type: Modules.StripePrice,\n      method: HttpMethod.PUT,\n      endpoint: endpoint.generate(),\n      input: params,\n    });\n  }\n\n  /**\n   * Archive a price (admin)\n   *\n   * Sets the price as inactive. Archived prices cannot be used for new subscriptions.\n   */\n  static async archivePrice(params: { id: string }): Promise<void> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripePrice,\n      id: params.id,\n      childEndpoint: \"archive\",\n    });\n\n    await this.callApi({\n      type: Modules.StripePrice,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  /**\n   * Reactivate a price (admin)\n   *\n   * Sets the price as active. Active prices can be used for new subscriptions.\n   */\n  static async reactivatePrice(params: { id: string }): Promise<void> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripePrice,\n      id: params.id,\n      childEndpoint: \"archive\",\n    });\n\n    await this.callApi({\n      type: Modules.StripePrice,\n      method: HttpMethod.DELETE,\n      endpoint: endpoint.generate(),\n    });\n  }\n}\n","import { ModuleFactory } from \"../../../permissions\";\nimport { StripePrice } from \"./data/stripe-price\";\n\nexport const StripePriceModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"stripe-prices\",\n    // The administration route this entity is served at. `name` above stays the\n    // API endpoint; this drives generateUrl / rewriteUrl / EditorSheet\n    // navigation, so it must match the real Next.js route or RoundPageContainer\n    // rewrites the URL to a 404 on the first tab change.\n    pageUrl: \"/administration/prices\",\n    model: StripePrice,\n    moduleId: \"a7d3e5f1-8c9b-4a2e-b6d7-3f1c8e9a4b5d\",\n  });\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules, StripePriceInterface } from \"../../../../core\";\nimport { StripeProductInput, StripeProductInterface } from \"./stripe-product.interface\";\n\nexport class StripeProduct extends AbstractApiData implements StripeProductInterface {\n  private _stripeProductId?: string;\n  private _name?: string;\n  private _description?: string;\n  private _active: boolean = true;\n  private _metadata?: Record<string, any>;\n\n  private _stripePrices: StripePriceInterface[] = [];\n\n  get stripeProductId(): string {\n    if (!this._stripeProductId) throw new Error(\"stripeProductId is not defined\");\n    return this._stripeProductId;\n  }\n\n  get name(): string {\n    if (!this._name) throw new Error(\"name is not defined\");\n    return this._name;\n  }\n\n  get description(): string | undefined {\n    return this._description;\n  }\n\n  get active(): boolean {\n    return this._active;\n  }\n\n  get metadata(): Record<string, any> | undefined {\n    return this._metadata;\n  }\n\n  get stripePrices(): StripePriceInterface[] {\n    return this._stripePrices ?? [];\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._stripeProductId = data.jsonApi.attributes.stripeProductId;\n    this._name = data.jsonApi.attributes.name;\n    this._description = data.jsonApi.attributes.description;\n    this._active = data.jsonApi.attributes.active ?? true;\n\n    this._metadata = data.jsonApi.attributes.metadata\n      ? typeof data.jsonApi.attributes.metadata === \"string\"\n        ? JSON.parse(data.jsonApi.attributes.metadata)\n        : data.jsonApi.attributes.metadata\n      : undefined;\n\n    this._stripePrices = this._readIncluded(data, \"stripePrices\", Modules.StripePrice) as StripePriceInterface[];\n\n    return this;\n  }\n\n  createJsonApi(data: StripeProductInput): any {\n    const response: any = {\n      data: {\n        type: Modules.StripeProduct.name,\n        id: data.id,\n        attributes: {},\n      },\n    };\n\n    if (data.name) response.data.attributes.name = data.name;\n    if (data.description !== undefined) response.data.attributes.description = data.description;\n    if (data.active !== undefined) response.data.attributes.active = data.active;\n    if (data.metadata) response.data.attributes.metadata = data.metadata;\n\n    return response;\n  }\n}\n","export enum StripeProductFields {\n  stripeProductId = \"stripeProductId\",\n  name = \"name\",\n  status = \"status\",\n  prices = \"prices\",\n}\n","import { AbstractService, EndpointCreator, HttpMethod, Modules, NextRef, PreviousRef } from \"../../../../core\";\nimport { StripeProductInput, StripeProductInterface } from \"./stripe-product.interface\";\n\nexport class StripeProductService extends AbstractService {\n  /**\n   * List all products (admin)\n   */\n  static async listProducts(params?: {\n    active?: boolean;\n    next?: NextRef;\n    prev?: PreviousRef;\n  }): Promise<StripeProductInterface[]> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeProduct,\n    });\n\n    if (params?.active !== undefined) {\n      endpoint.addAdditionalParam(\"active\", params.active.toString());\n    }\n\n    return this.callApi({\n      type: Modules.StripeProduct,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params?.next,\n      previous: params?.prev,\n    });\n  }\n\n  /**\n   * Get a specific product by ID (admin)\n   */\n  static async getProduct(params: { id: string }): Promise<StripeProductInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeProduct,\n      id: params.id,\n    });\n\n    return this.callApi<StripeProductInterface>({\n      type: Modules.StripeProduct,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  /**\n   * Create a new product (admin)\n   */\n  static async createProduct(params: StripeProductInput): Promise<StripeProductInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeProduct,\n    });\n\n    return this.callApi<StripeProductInterface>({\n      type: Modules.StripeProduct,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n      input: params,\n    });\n  }\n\n  /**\n   * Update an existing product (admin)\n   */\n  static async updateProduct(params: StripeProductInput): Promise<StripeProductInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeProduct,\n      id: params.id,\n    });\n\n    return this.callApi<StripeProductInterface>({\n      type: Modules.StripeProduct,\n      method: HttpMethod.PUT,\n      endpoint: endpoint.generate(),\n      input: params,\n    });\n  }\n\n  /**\n   * Archive a product (admin)\n   */\n  static async archiveProduct(params: { id: string }): Promise<StripeProductInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeProduct,\n      id: params.id,\n      childEndpoint: \"archive\",\n    });\n\n    return this.callApi<StripeProductInterface>({\n      type: Modules.StripeProduct,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  /**\n   * Reactivate a product (admin) - sets active to true\n   */\n  static async reactivateProduct(params: { id: string }): Promise<StripeProductInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeProduct,\n      id: params.id,\n      childEndpoint: \"archive\",\n    });\n\n    return this.callApi<StripeProductInterface>({\n      type: Modules.StripeProduct,\n      method: HttpMethod.DELETE,\n      endpoint: endpoint.generate(),\n    });\n  }\n}\n","import { ModuleFactory } from \"../../../permissions\";\nimport { StripeProduct } from \"./data\";\n\nexport const StripeProductModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"stripe-products\",\n    // The administration route this entity is served at. `name` above stays the\n    // API endpoint; this drives generateUrl / rewriteUrl / EditorSheet\n    // navigation, so it must match the real Next.js route or RoundPageContainer\n    // rewrites the URL to a 404 on the first tab change.\n    pageUrl: \"/administration/products\",\n    model: StripeProduct,\n    moduleId: \"f8c4a1e9-3b2d-4f7a-9e5c-1d8a6b3c9f2e\",\n  });\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../../core\";\nimport { StripePriceInterface } from \"../../stripe-price\";\nimport {\n  StripeSubscriptionInput,\n  StripeSubscriptionInterface,\n  SubscriptionStatus,\n} from \"./stripe-subscription.interface\";\n\nexport class StripeSubscription extends AbstractApiData implements StripeSubscriptionInterface {\n  private _stripeSubscriptionId?: string;\n  private _status?: SubscriptionStatus;\n  private _currentPeriodStart?: Date;\n  private _currentPeriodEnd?: Date;\n  private _cancelAtPeriodEnd: boolean = false;\n  private _canceledAt?: Date;\n  private _trialStart?: Date;\n  private _trialEnd?: Date;\n  private _price?: StripePriceInterface;\n\n  get stripeSubscriptionId(): string {\n    if (!this._stripeSubscriptionId) throw new Error(\"stripeSubscriptionId is not defined\");\n    return this._stripeSubscriptionId;\n  }\n\n  get status(): SubscriptionStatus {\n    if (!this._status) throw new Error(\"status is not defined\");\n    return this._status;\n  }\n\n  get currentPeriodStart(): Date {\n    if (!this._currentPeriodStart) throw new Error(\"currentPeriodStart is not defined\");\n    return this._currentPeriodStart;\n  }\n\n  get currentPeriodEnd(): Date {\n    if (!this._currentPeriodEnd) throw new Error(\"currentPeriodEnd is not defined\");\n    return this._currentPeriodEnd;\n  }\n\n  get cancelAtPeriodEnd(): boolean {\n    return this._cancelAtPeriodEnd;\n  }\n\n  get canceledAt(): Date | undefined {\n    return this._canceledAt;\n  }\n\n  get trialStart(): Date | undefined {\n    return this._trialStart;\n  }\n\n  get trialEnd(): Date | undefined {\n    return this._trialEnd;\n  }\n\n  get price(): StripePriceInterface | undefined {\n    return this._price;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._stripeSubscriptionId = data.jsonApi.attributes.stripeSubscriptionId;\n    this._status = data.jsonApi.attributes.status;\n\n    this._currentPeriodStart = data.jsonApi.attributes.currentPeriodStart\n      ? new Date(data.jsonApi.attributes.currentPeriodStart)\n      : undefined;\n    this._currentPeriodEnd = data.jsonApi.attributes.currentPeriodEnd\n      ? new Date(data.jsonApi.attributes.currentPeriodEnd)\n      : undefined;\n\n    this._cancelAtPeriodEnd = data.jsonApi.attributes.cancelAtPeriodEnd ?? false;\n    this._canceledAt = data.jsonApi.attributes.canceledAt ? new Date(data.jsonApi.attributes.canceledAt) : undefined;\n\n    this._trialStart = data.jsonApi.attributes.trialStart ? new Date(data.jsonApi.attributes.trialStart) : undefined;\n    this._trialEnd = data.jsonApi.attributes.trialEnd ? new Date(data.jsonApi.attributes.trialEnd) : undefined;\n\n    // Hydrate price relationship\n    this._price = this._readIncluded(data, \"price\", Modules.StripePrice) as StripePriceInterface;\n\n    return this;\n  }\n\n  createJsonApi(data: StripeSubscriptionInput): any {\n    const response: any = {\n      data: {\n        type: Modules.StripeSubscription.name,\n        id: data.id,\n        attributes: {},\n      },\n    };\n\n    // CREATE: priceId goes to relationships\n    if (data.priceId) {\n      response.data.relationships = {\n        stripePrice: {\n          data: {\n            type: Modules.StripePrice.name,\n            id: data.priceId,\n          },\n        },\n      };\n    }\n\n    // CHANGE-PLAN: newPriceId goes to attributes.priceId\n    if (data.newPriceId) {\n      response.data.attributes.priceId = data.newPriceId;\n    }\n\n    // CANCEL: cancelImmediately goes to attributes\n    if (data.cancelImmediately !== undefined) {\n      response.data.attributes.cancelImmediately = data.cancelImmediately;\n    }\n\n    // Shared optional fields\n    if (data.quantity !== undefined) {\n      response.data.attributes.quantity = data.quantity;\n    }\n\n    if (data.trialPeriodDays !== undefined) {\n      response.data.attributes.trialPeriodDays = data.trialPeriodDays;\n    }\n\n    if (data.paymentMethodId) {\n      response.data.attributes.paymentMethodId = data.paymentMethodId;\n    }\n\n    if (data.metadata) {\n      response.data.attributes.metadata = data.metadata;\n    }\n\n    if (data.promotionCode) {\n      response.data.attributes.promotionCode = data.promotionCode;\n    }\n    return response;\n  }\n}\n","// ============================================================================\n// Subscription Enums\n// ============================================================================\n\nimport { ApiDataInterface, StripePriceInterface } from \"../../../../core\";\n\nexport enum SubscriptionStatus {\n  ACTIVE = \"active\",\n  PAST_DUE = \"past_due\",\n  UNPAID = \"unpaid\",\n  CANCELED = \"canceled\",\n  INCOMPLETE = \"incomplete\",\n  INCOMPLETE_EXPIRED = \"incomplete_expired\",\n  TRIALING = \"trialing\",\n  PAUSED = \"paused\",\n}\n\n// ============================================================================\n// Subscription Interfaces\n// ============================================================================\n\nexport interface StripeSubscriptionInterface extends ApiDataInterface {\n  get stripeSubscriptionId(): string;\n  get status(): SubscriptionStatus;\n  get currentPeriodStart(): Date;\n  get currentPeriodEnd(): Date;\n  get cancelAtPeriodEnd(): boolean;\n  get canceledAt(): Date | undefined;\n  get trialStart(): Date | undefined;\n  get trialEnd(): Date | undefined;\n  get price(): StripePriceInterface | undefined;\n}\n\n// ============================================================================\n// Subscription Input DTOs\n// ============================================================================\n\nexport type StripeSubscriptionInput = {\n  id: string;\n  // For CREATE - goes to relationships.stripePrice\n  priceId?: string;\n  // For CHANGE-PLAN - goes to attributes.priceId\n  newPriceId?: string;\n  // For CANCEL - goes to attributes.cancelImmediately\n  cancelImmediately?: boolean;\n  // Shared optional fields\n  quantity?: number;\n  trialPeriodDays?: number;\n  paymentMethodId?: string;\n  metadata?: Record<string, any>;\n  // For CREATE and CHANGE-PLAN - optional promotion code\n  promotionCode?: string;\n};\n\n// ============================================================================\n// Subscription Response Types (for SCA payment confirmation)\n// ============================================================================\n\nexport interface StripeSubscriptionCreateMeta {\n  clientSecret: string | null;\n  paymentIntentId: string | null;\n  requiresAction: boolean;\n}\n\nexport interface StripeSubscriptionCreateResponse {\n  subscription: StripeSubscriptionInterface;\n  meta: StripeSubscriptionCreateMeta;\n}\n","import { AbstractService, EndpointCreator, HttpMethod, Modules, NextRef, PreviousRef } from \"../../../../core\";\nimport { ProrationPreviewInterface } from \"../../stripe-invoice/data/stripe-invoice.interface\";\nimport {\n  StripeSubscriptionCreateMeta,\n  StripeSubscriptionCreateResponse,\n  StripeSubscriptionInput,\n  StripeSubscriptionInterface,\n} from \"./stripe-subscription.interface\";\n\n/**\n * Customer-facing billing service for managing subscriptions, payments, and usage\n */\nexport class StripeSubscriptionService extends AbstractService {\n  // ============================================================================\n  // Subscription Methods\n  // ============================================================================\n\n  /**\n   * List all subscriptions for the current user\n   */\n  static async listSubscriptions(params?: {\n    next?: NextRef;\n    prev?: PreviousRef;\n  }): Promise<StripeSubscriptionInterface[]> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeSubscription,\n    });\n\n    return this.callApi({\n      type: Modules.StripeSubscription,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params?.next,\n      previous: params?.prev,\n    });\n  }\n\n  /**\n   * Get a specific subscription by ID\n   */\n  static async getSubscription(params: { subscriptionId: string }): Promise<StripeSubscriptionInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeSubscription,\n      id: params.subscriptionId,\n    });\n\n    return this.callApi<StripeSubscriptionInterface>({\n      type: Modules.StripeSubscription,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  /**\n   * Create a new subscription\n   * Returns subscription data along with meta containing SCA payment confirmation details\n   */\n  static async createSubscription(params: StripeSubscriptionInput): Promise<StripeSubscriptionCreateResponse> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeSubscription,\n    });\n\n    const result = await this.callApiWithMeta<StripeSubscriptionInterface>({\n      type: Modules.StripeSubscription,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n      input: params,\n    });\n\n    return {\n      subscription: result.data,\n      meta: (result.meta as StripeSubscriptionCreateMeta) ?? {\n        clientSecret: null,\n        paymentIntentId: null,\n        requiresAction: false,\n      },\n    };\n  }\n\n  /**\n   * Change the plan of an existing subscription\n   */\n  static async changePlan(params: StripeSubscriptionInput): Promise<StripeSubscriptionInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeSubscription,\n      id: params.id,\n      childEndpoint: \"change-plan\",\n    });\n\n    return this.callApi<StripeSubscriptionInterface>({\n      type: Modules.StripeSubscription,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n      input: params,\n    });\n  }\n\n  /**\n   * Get a proration preview for a plan change\n   */\n  static async getProrationPreview(params: {\n    subscriptionId: string;\n    newPriceId: string;\n    quantity?: number;\n  }): Promise<ProrationPreviewInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeSubscription,\n      id: params.subscriptionId,\n      childEndpoint: \"proration-preview\",\n    });\n\n    endpoint.addAdditionalParam(\"priceId\", params.newPriceId);\n    if (params.quantity) {\n      endpoint.addAdditionalParam(\"quantity\", params.quantity.toString());\n    }\n\n    return this.callApi({\n      type: Modules.StripeSubscription,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  /**\n   * Cancel a subscription\n   */\n  static async cancelSubscription(params: StripeSubscriptionInput): Promise<StripeSubscriptionInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeSubscription,\n      id: params.id,\n      childEndpoint: \"cancel\",\n    });\n\n    return this.callApi<StripeSubscriptionInterface>({\n      type: Modules.StripeSubscription,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n      input: params,\n    });\n  }\n\n  /**\n   * Pause a subscription\n   */\n  static async pauseSubscription(params: { subscriptionId: string }): Promise<StripeSubscriptionInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeSubscription,\n      id: params.subscriptionId,\n      childEndpoint: \"pause\",\n    });\n\n    return this.callApi<StripeSubscriptionInterface>({\n      type: Modules.StripeSubscription,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  /**\n   * Resume a paused subscription\n   */\n  static async resumeSubscription(params: { subscriptionId: string }): Promise<StripeSubscriptionInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeSubscription,\n      id: params.subscriptionId,\n      childEndpoint: \"resume\",\n    });\n\n    return this.callApi<StripeSubscriptionInterface>({\n      type: Modules.StripeSubscription,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  /**\n   * Sync a subscription with the latest data from Stripe\n   * This is useful after payment confirmation to get the updated status\n   */\n  static async syncSubscription(params: { subscriptionId: string }): Promise<StripeSubscriptionInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeSubscription,\n      id: params.subscriptionId,\n      childEndpoint: \"sync\",\n    });\n\n    return this.callApi<StripeSubscriptionInterface>({\n      type: Modules.StripeSubscription,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n    });\n  }\n}\n","import { ModuleFactory } from \"../../../permissions\";\nimport { StripeSubscription } from \"./data\";\n\nexport const StripeSubscriptionModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"stripe-subscriptions\",\n    pageUrl: \"/stripe-subscriptions\",\n    model: StripeSubscription,\n    moduleId: \"5e8797ef-650b-4dd5-ac79-a2e530a6c7ba\",\n  });\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../../core\";\nimport { ReportUsageInput, StripeUsageInterface } from \"./stripe-usage.interface\";\n\nexport class StripeUsage extends AbstractApiData implements StripeUsageInterface {\n  private _subscriptionId?: string;\n  private _meterId?: string;\n  private _meterEventName?: string;\n  private _stripeEventId?: string;\n  private _quantity?: number;\n  private _timestamp?: Date;\n\n  get subscriptionId(): string {\n    if (!this._subscriptionId) throw new Error(\"subscriptionId is not defined\");\n    return this._subscriptionId;\n  }\n\n  get meterId(): string {\n    if (!this._meterId) throw new Error(\"meterId is not defined\");\n    return this._meterId;\n  }\n\n  get meterEventName(): string {\n    if (!this._meterEventName) throw new Error(\"meterEventName is not defined\");\n    return this._meterEventName;\n  }\n\n  get stripeEventId(): string {\n    if (!this._stripeEventId) throw new Error(\"stripeEventId is not defined\");\n    return this._stripeEventId;\n  }\n\n  get quantity(): number {\n    if (this._quantity === undefined) throw new Error(\"quantity is not defined\");\n    return this._quantity;\n  }\n\n  get timestamp(): Date | undefined {\n    return this._timestamp;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._subscriptionId = data.jsonApi.attributes.subscriptionId;\n    this._meterId = data.jsonApi.attributes.meterId;\n    this._meterEventName = data.jsonApi.attributes.meterEventName;\n    this._stripeEventId = data.jsonApi.attributes.stripeEventId;\n    this._quantity = data.jsonApi.attributes.quantity;\n    this._timestamp = data.jsonApi.attributes.timestamp ? new Date(data.jsonApi.attributes.timestamp) : undefined;\n\n    return this;\n  }\n\n  createJsonApi(data: ReportUsageInput): any {\n    const response: any = {\n      data: {\n        type: Modules.StripeUsage.name,\n        attributes: {\n          subscriptionItemId: data.subscriptionItemId,\n          quantity: data.quantity,\n        },\n      },\n    };\n\n    if (data.timestamp !== undefined) response.data.attributes.timestamp = data.timestamp;\n    if (data.action !== undefined) response.data.attributes.action = data.action;\n\n    return response;\n  }\n}\n","import { AbstractService, EndpointCreator, HttpMethod, Modules, NextRef, PreviousRef } from \"../../../../core\";\nimport {\n  MeterInterface,\n  MeterSummaryInterface,\n  ReportUsageInput,\n  StripeUsageInterface,\n  UsageSummaryInterface,\n} from \"./stripe-usage.interface\";\n\n/**\n * Service for managing Stripe usage tracking\n */\nexport class StripeUsageService extends AbstractService {\n  // ============================================================================\n  // Meter Methods\n  // ============================================================================\n\n  /**\n   * List all available usage meters\n   */\n  static async listMeters(params?: { next?: NextRef; prev?: PreviousRef }): Promise<MeterInterface[]> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeUsage,\n      childEndpoint: \"meters\",\n    });\n\n    return this.callApi({\n      type: Modules.StripeUsage,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params?.next,\n      previous: params?.prev,\n    });\n  }\n\n  /**\n   * Get meter summaries for a specific time period\n   */\n  static async getMeterSummaries(params: {\n    meterId: string;\n    startTime: Date;\n    endTime: Date;\n  }): Promise<MeterSummaryInterface[]> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeUsage,\n      childEndpoint: `meters/${params.meterId}/summaries`,\n    });\n\n    endpoint.addAdditionalParam(\"startTime\", params.startTime.toISOString());\n    endpoint.addAdditionalParam(\"endTime\", params.endTime.toISOString());\n\n    return this.callApi({\n      type: Modules.StripeUsage,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  // ============================================================================\n  // Usage Record Methods\n  // ============================================================================\n\n  /**\n   * Report usage for a subscription item\n   */\n  static async reportUsage(params: ReportUsageInput): Promise<StripeUsageInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeUsage,\n    });\n\n    return this.callApi<StripeUsageInterface>({\n      type: Modules.StripeUsage,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n      input: params,\n    });\n  }\n\n  /**\n   * List usage records for a subscription item\n   */\n  static async listUsageRecords(params: {\n    subscriptionItemId: string;\n    next?: NextRef;\n    prev?: PreviousRef;\n  }): Promise<StripeUsageInterface[]> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeUsage,\n    });\n\n    endpoint.addAdditionalParam(\"subscriptionItemId\", params.subscriptionItemId);\n\n    return this.callApi({\n      type: Modules.StripeUsage,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params?.next,\n      previous: params?.prev,\n    });\n  }\n\n  /**\n   * Get usage summary for a subscription item\n   */\n  static async getUsageSummary(params: {\n    subscriptionItemId: string;\n    start?: Date;\n    end?: Date;\n  }): Promise<UsageSummaryInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.StripeUsage,\n      childEndpoint: \"summary\",\n    });\n\n    endpoint.addAdditionalParam(\"subscriptionItemId\", params.subscriptionItemId);\n    if (params.start) {\n      endpoint.addAdditionalParam(\"start\", params.start.toISOString());\n    }\n    if (params.end) {\n      endpoint.addAdditionalParam(\"end\", params.end.toISOString());\n    }\n\n    return this.callApi({\n      type: Modules.StripeUsage,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n    });\n  }\n}\n","import { ModuleFactory } from \"../../../permissions\";\nimport { StripeUsage } from \"./data/stripe-usage\";\n\nexport const StripeUsageModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"stripe-usage-records\",\n    pageUrl: \"/stripe-usage-records\",\n    model: StripeUsage,\n    moduleId: \"c2e9f4a6-1d7b-4e3a-8f5c-9b2d6a1e7f3c\",\n  });\n","import { Modules } from \"../../../../core\";\nimport { JsonApiPost } from \"../../../../unified/JsonApiRequest\";\nimport { PromotionCodeValidationResult } from \"./stripe-promotion-code.interface\";\nimport { StripePromotionCode } from \"./stripe-promotion-code\";\n\nconst STRIPE_PROMOTION_CODE_ENDPOINT = \"stripe-promotion-codes\";\n\n/**\n * Service for validating Stripe promotion codes\n */\nexport class StripePromotionCodeService {\n  /**\n   * Validate a promotion code against Stripe\n   *\n   * @param params.code - The promotion code to validate (e.g., \"SAVE20\")\n   * @param params.stripePriceId - Optional price ID to check product restrictions\n   * @param params.language - Language code for the request\n   * @returns Validation result with discount details if valid\n   */\n  static async validatePromotionCode(params: {\n    code: string;\n    stripePriceId?: string;\n    language?: string;\n  }): Promise<PromotionCodeValidationResult> {\n    const response = await JsonApiPost({\n      classKey: Modules.StripePromotionCode,\n      endpoint: `${STRIPE_PROMOTION_CODE_ENDPOINT}/validate`,\n      body: {\n        data: {\n          type: STRIPE_PROMOTION_CODE_ENDPOINT,\n          attributes: {\n            code: params.code,\n            stripePriceId: params.stripePriceId,\n          },\n        },\n      },\n      overridesJsonApiCreation: true,\n      language: params.language ?? \"en\",\n    });\n\n    if (!response.ok) {\n      return {\n        valid: false,\n        code: params.code,\n        errorMessage: response.error || \"Failed to validate promotion code\",\n      };\n    }\n\n    // The response is hydrated as a StripePromotionCode model\n    const data = response.data as StripePromotionCode;\n\n    return {\n      valid: data.valid,\n      promotionCodeId: data.promotionCodeId,\n      code: data.code,\n      discountType: data.discountType,\n      discountValue: data.discountValue,\n      currency: data.currency,\n      duration: data.duration,\n      durationInMonths: data.durationInMonths,\n      errorMessage: data.errorMessage,\n    };\n  }\n}\n","import { AbstractApiData, JsonApiHydratedDataInterface } from \"../../../../core\";\nimport { PromotionCodeValidationResult } from \"./stripe-promotion-code.interface\";\n\nexport class StripePromotionCode extends AbstractApiData implements PromotionCodeValidationResult {\n  private _valid: boolean = false;\n  private _promotionCodeId?: string;\n  private _code: string = \"\";\n  private _discountType?: \"percent_off\" | \"amount_off\";\n  private _discountValue?: number;\n  private _currency?: string;\n  private _duration?: \"forever\" | \"once\" | \"repeating\";\n  private _durationInMonths?: number;\n  private _errorMessage?: string;\n\n  get valid(): boolean {\n    return this._valid;\n  }\n\n  get promotionCodeId(): string | undefined {\n    return this._promotionCodeId;\n  }\n\n  get code(): string {\n    return this._code;\n  }\n\n  get discountType(): \"percent_off\" | \"amount_off\" | undefined {\n    return this._discountType;\n  }\n\n  get discountValue(): number | undefined {\n    return this._discountValue;\n  }\n\n  get currency(): string | undefined {\n    return this._currency;\n  }\n\n  get duration(): \"forever\" | \"once\" | \"repeating\" | undefined {\n    return this._duration;\n  }\n\n  get durationInMonths(): number | undefined {\n    return this._durationInMonths;\n  }\n\n  get errorMessage(): string | undefined {\n    return this._errorMessage;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._valid = data.jsonApi.attributes.valid ?? false;\n    this._promotionCodeId = data.jsonApi.attributes.promotionCodeId;\n    this._code = data.jsonApi.attributes.code ?? \"\";\n    this._discountType = data.jsonApi.attributes.discountType;\n    this._discountValue = data.jsonApi.attributes.discountValue;\n    this._currency = data.jsonApi.attributes.currency;\n    this._duration = data.jsonApi.attributes.duration;\n    this._durationInMonths = data.jsonApi.attributes.durationInMonths;\n    this._errorMessage = data.jsonApi.attributes.errorMessage;\n\n    return this;\n  }\n}\n","import { ModuleFactory } from \"../../../permissions\";\nimport { StripePromotionCode } from \"./data/stripe-promotion-code\";\n\nexport const StripePromotionCodeModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"stripe-promotion-codes\",\n    pageUrl: \"/stripe-promotion-codes\",\n    model: StripePromotionCode,\n    moduleId: \"b8e4f6a2-9d0c-5b3f-c7e8-4g2d9f0a5c6e\",\n  });\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { AiConnectionInput, AiConnectionInterface } from \"./ai-connection.interface\";\n\nexport class AiConnection extends AbstractApiData implements AiConnectionInterface {\n  private _name?: string;\n  private _connectionType?: string;\n  private _provider?: string;\n  private _position?: number;\n  private _enabled?: boolean;\n  private _model?: string;\n  private _url?: string;\n  private _region?: string;\n  private _instance?: string;\n  private _apiVersion?: string;\n  private _allowFallbacks?: boolean;\n  private _reasoningEffort?: string;\n  private _maxOutputTokens?: number;\n  private _dimensions?: number;\n  private _inputCostPer1MTokens?: number;\n  private _outputCostPer1MTokens?: number;\n  private _cachedInputCostPer1MTokens?: number;\n  private _costPerMinute?: number;\n  private _costPerPage?: number;\n  private _directUrl?: string;\n  private _language?: string;\n  private _directFormat?: string;\n  private _directProvider?: string;\n  private _hasApiKey?: boolean;\n  private _hasGoogleCredentials?: boolean;\n  private _companyId?: string;\n\n  get name(): string {\n    return this._name ?? \"\";\n  }\n\n  get connectionType(): string {\n    return this._connectionType ?? \"\";\n  }\n\n  get provider(): string {\n    return this._provider ?? \"\";\n  }\n\n  get position(): number {\n    return this._position ?? 0;\n  }\n\n  get enabled(): boolean {\n    return this._enabled ?? true;\n  }\n\n  get model(): string | undefined {\n    return this._model;\n  }\n\n  get url(): string | undefined {\n    return this._url;\n  }\n\n  get region(): string | undefined {\n    return this._region;\n  }\n\n  get instance(): string | undefined {\n    return this._instance;\n  }\n\n  get apiVersion(): string | undefined {\n    return this._apiVersion;\n  }\n\n  get allowFallbacks(): boolean | undefined {\n    return this._allowFallbacks;\n  }\n\n  get reasoningEffort(): string | undefined {\n    return this._reasoningEffort;\n  }\n\n  get maxOutputTokens(): number | undefined {\n    return this._maxOutputTokens;\n  }\n\n  get dimensions(): number | undefined {\n    return this._dimensions;\n  }\n\n  get inputCostPer1MTokens(): number | undefined {\n    return this._inputCostPer1MTokens;\n  }\n\n  get outputCostPer1MTokens(): number | undefined {\n    return this._outputCostPer1MTokens;\n  }\n\n  get cachedInputCostPer1MTokens(): number | undefined {\n    return this._cachedInputCostPer1MTokens;\n  }\n\n  get costPerMinute(): number | undefined {\n    return this._costPerMinute;\n  }\n\n  get costPerPage(): number | undefined {\n    return this._costPerPage;\n  }\n\n  get directUrl(): string | undefined {\n    return this._directUrl;\n  }\n\n  get language(): string | undefined {\n    return this._language;\n  }\n\n  get directFormat(): string | undefined {\n    return this._directFormat;\n  }\n\n  get directProvider(): string | undefined {\n    return this._directProvider;\n  }\n\n  get hasApiKey(): boolean {\n    return this._hasApiKey ?? false;\n  }\n\n  get hasGoogleCredentials(): boolean {\n    return this._hasGoogleCredentials ?? false;\n  }\n\n  get companyId(): string | undefined {\n    return this._companyId;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    const attributes = data.jsonApi.attributes ?? {};\n\n    this._name = attributes.name;\n    this._connectionType = attributes.connectionType;\n    this._provider = attributes.provider;\n    this._position = attributes.position;\n    this._enabled = attributes.enabled;\n    this._model = attributes.model;\n    this._url = attributes.url;\n    this._region = attributes.region;\n    this._instance = attributes.instance;\n    this._apiVersion = attributes.apiVersion;\n    this._allowFallbacks = attributes.allowFallbacks;\n    this._reasoningEffort = attributes.reasoningEffort;\n    this._maxOutputTokens = attributes.maxOutputTokens;\n    this._dimensions = attributes.dimensions;\n    this._inputCostPer1MTokens = attributes.inputCostPer1MTokens;\n    this._outputCostPer1MTokens = attributes.outputCostPer1MTokens;\n    this._cachedInputCostPer1MTokens = attributes.cachedInputCostPer1MTokens;\n    this._costPerMinute = attributes.costPerMinute;\n    this._costPerPage = attributes.costPerPage;\n    this._directUrl = attributes.directUrl;\n    this._language = attributes.language;\n    this._directFormat = attributes.directFormat;\n    this._directProvider = attributes.directProvider;\n    this._hasApiKey = attributes.hasApiKey;\n    this._hasGoogleCredentials = attributes.hasGoogleCredentials;\n    this._companyId = attributes.companyId;\n\n    return this;\n  }\n\n  createJsonApi(data: AiConnectionInput): any {\n    const response: any = {\n      data: {\n        type: Modules.AiConnection.name,\n        id: data.id,\n        attributes: {},\n        relationships: {},\n      },\n      included: [],\n    };\n\n    const setIfDefined = (key: keyof AiConnectionInput) => {\n      if (data[key] !== undefined) response.data.attributes[key] = data[key];\n    };\n\n    (\n      [\n        \"name\",\n        \"connectionType\",\n        \"provider\",\n        \"position\",\n        \"enabled\",\n        \"model\",\n        \"url\",\n        \"region\",\n        \"instance\",\n        \"apiVersion\",\n        \"allowFallbacks\",\n        \"reasoningEffort\",\n        \"maxOutputTokens\",\n        \"dimensions\",\n        \"inputCostPer1MTokens\",\n        \"outputCostPer1MTokens\",\n        \"cachedInputCostPer1MTokens\",\n        \"costPerMinute\",\n        \"costPerPage\",\n        \"directUrl\",\n        \"language\",\n        \"directFormat\",\n        \"directProvider\",\n      ] as const\n    ).forEach(setIfDefined);\n\n    // Secrets: an empty string means \"keep the stored value\" — omit it from the\n    // payload entirely so the backend never overwrites what it already holds.\n    if (data.apiKey) response.data.attributes.apiKey = data.apiKey;\n    if (data.googleCredentialsBase64) {\n      response.data.attributes.googleCredentialsBase64 = data.googleCredentialsBase64;\n    }\n\n    // Scope is chosen at creation and immutable thereafter.\n    if (data.companyId) {\n      response.data.relationships.company = {\n        data: { type: Modules.Company.name, id: data.companyId },\n      };\n    }\n\n    return response;\n  }\n\n  /**\n   * Body for POST /ai-connections/reorder. A dedicated model method so the\n   * service never constructs a JSON:API payload itself — the sanctioned pairing\n   * for `overridesJsonApiCreation`.\n   */\n  createReorderJsonApi(params: { ids: string[] }): any {\n    return {\n      data: {\n        type: Modules.AiConnection.name,\n        ids: params.ids,\n      },\n    };\n  }\n}\n","export enum AiConnectionFields {\n  name = \"name\",\n  provider = \"provider\",\n  model = \"model\",\n  enabled = \"enabled\",\n}\n","import { AbstractService, EndpointCreator, HttpMethod, Modules } from \"../../../core\";\nimport { AiConnection } from \"./ai-connection\";\nimport {\n  AiConnectionEnvDefaults,\n  AiConnectionInput,\n  AiConnectionInterface,\n  AiProviderRegistry,\n} from \"./ai-connection.interface\";\n\nexport class AiConnectionService extends AbstractService {\n  /**\n   * Full list plus the editor meta in one round-trip: the list endpoint carries\n   * the provider registry and the `.env` defaults as top-level JSON:API `meta`.\n   */\n  static async listConnections(): Promise<{\n    connections: AiConnectionInterface[];\n    providerRegistry: AiProviderRegistry;\n    envDefaults: AiConnectionEnvDefaults;\n  }> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.AiConnection });\n    endpoint.addAdditionalParam(\"fetchAll\", \"true\");\n\n    const { data, meta } = await this.callApiWithMeta<AiConnectionInterface[]>({\n      type: Modules.AiConnection,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n    });\n\n    return {\n      connections: data ?? [],\n      providerRegistry: (meta?.providerRegistry ?? {}) as AiProviderRegistry,\n      envDefaults: (meta?.envDefaults ?? {}) as AiConnectionEnvDefaults,\n    };\n  }\n\n  /**\n   * Create a connection. The optional `companyId` fixes its scope forever.\n   */\n  static async create(params: AiConnectionInput): Promise<AiConnectionInterface> {\n    return this.callApi<AiConnectionInterface>({\n      type: Modules.AiConnection,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({ endpoint: Modules.AiConnection }).generate(),\n      input: params,\n    });\n  }\n\n  /**\n   * Update a connection. Blank/omitted secrets keep the stored values.\n   */\n  static async update(params: AiConnectionInput): Promise<AiConnectionInterface> {\n    return this.callApi<AiConnectionInterface>({\n      type: Modules.AiConnection,\n      method: HttpMethod.PUT,\n      endpoint: new EndpointCreator({ endpoint: Modules.AiConnection, id: params.id }).generate(),\n      input: params,\n    });\n  }\n\n  /**\n   * Delete a connection.\n   */\n  static async delete(params: { id: string }): Promise<void> {\n    await this.callApi({\n      type: Modules.AiConnection,\n      method: HttpMethod.DELETE,\n      endpoint: new EndpointCreator({ endpoint: Modules.AiConnection, id: params.id }).generate(),\n    });\n  }\n\n  /**\n   * Reorder one chain: the ordered id list is renumbered 0..n-1 server-side.\n   * Dedicated model method + `overridesJsonApiCreation` — the sanctioned\n   * pairing, never a hand-built payload here.\n   */\n  static async reorder(params: { ids: string[] }): Promise<void> {\n    const model = new AiConnection();\n\n    await this.callApi({\n      type: Modules.AiConnection,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.AiConnection,\n        childEndpoint: \"reorder\",\n      }).generate(),\n      input: model.createReorderJsonApi({ ids: params.ids }),\n      overridesJsonApiCreation: true, // OK — the model method provides the structure\n    });\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { AiConnection } from \"./data\";\n\nexport const AiConnectionModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"ai-connections\",\n    // The administration route this entity is served at. `name` above stays the\n    // API endpoint; this drives generateUrl / rewriteUrl / EditorSheet\n    // navigation, so it must match the real Next.js route or RoundPageContainer\n    // rewrites the URL to a 404 on the first tab change.\n    pageUrl: \"/administration/ai-connections\",\n    model: AiConnection,\n    moduleId: \"7d3f2b8a-91c4-4e6d-a5f0-2c9b8e4d1a37\",\n  });\n","import { Building2Icon } from \"lucide-react\";\nimport { Company } from \".\";\nimport { ModuleFactory } from \"../../permissions\";\n\nexport const CompanyModule = (factory: ModuleFactory) =>\n  factory({\n    pageUrl: \"/companies\",\n    name: \"companies\",\n    model: Company,\n    moduleId: \"f9e77c8f-bfd1-4fd4-80b0-e1d891ab7113\",\n    icon: Building2Icon,\n  });\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { FeatureInterface } from \"../../feature\";\nimport { ModuleInterface } from \"../../module\";\nimport { CompanyInput, CompanyInterface } from \"./company.interface\";\n\nexport class Company extends AbstractApiData implements CompanyInterface {\n  private _name?: string;\n  private _logo?: string;\n  private _logoUrl?: string;\n  private _configurations?: any;\n\n  private _isActiveSubscription: boolean = false;\n\n  private _monthlyCredits: number = 0;\n  private _availableMonthlyCredits: number = 0;\n  private _availableExtraCredits: number = 0;\n  private _aiEnabled?: boolean;\n\n  private _features?: FeatureInterface[];\n  private _modules?: ModuleInterface[];\n\n  private _legal_address?: string;\n  private _street_number?: string;\n  private _street?: string;\n  private _city?: string;\n  private _province?: string;\n  private _region?: string;\n  private _postcode?: string;\n  private _country?: string;\n  private _country_code?: string;\n  private _fiscal_data?: string;\n\n  get name(): string {\n    if (this._name === undefined) throw new Error(\"Name is not defined\");\n    return this._name;\n  }\n\n  get logo(): string | undefined {\n    return this._logo;\n  }\n\n  get logoUrl(): string | undefined {\n    return this._logoUrl;\n  }\n\n  get isActiveSubscription(): boolean {\n    return this._isActiveSubscription ?? false;\n  }\n\n  get monthlyCredits(): number {\n    return this._monthlyCredits ?? 0;\n  }\n\n  get availableMonthlyCredits(): number {\n    return this._availableMonthlyCredits ?? 0;\n  }\n\n  get availableExtraCredits(): number {\n    return this._availableExtraCredits ?? 0;\n  }\n\n  get aiEnabled(): boolean {\n    return this._aiEnabled ?? true;\n  }\n\n  get features(): FeatureInterface[] {\n    return this._features ?? [];\n  }\n\n  get modules(): ModuleInterface[] {\n    return this._modules ?? [];\n  }\n\n  get configurations(): any | undefined {\n    return this._configurations;\n  }\n\n  get legal_address(): string | undefined {\n    return this._legal_address;\n  }\n\n  get street_number(): string | undefined {\n    return this._street_number;\n  }\n\n  get street(): string | undefined {\n    return this._street;\n  }\n\n  get city(): string | undefined {\n    return this._city;\n  }\n\n  get province(): string | undefined {\n    return this._province;\n  }\n\n  get region(): string | undefined {\n    return this._region;\n  }\n\n  get postcode(): string | undefined {\n    return this._postcode;\n  }\n\n  get country(): string | undefined {\n    return this._country;\n  }\n\n  get country_code(): string | undefined {\n    return this._country_code;\n  }\n\n  get fiscal_data(): string | undefined {\n    return this._fiscal_data;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._name = data.jsonApi.attributes.name;\n    this._configurations = data.jsonApi.attributes.configurations\n      ? JSON.parse(data.jsonApi.attributes.configurations)\n      : undefined;\n    this._logo = data.jsonApi.attributes.logo;\n    this._logoUrl = data.jsonApi.attributes.logoUrl;\n    this._isActiveSubscription = data.jsonApi.attributes.isActiveSubscription ?? false;\n    this._monthlyCredits = data.jsonApi.attributes.monthlyCredits ?? 0;\n    this._availableMonthlyCredits = data.jsonApi.attributes.availableMonthlyCredits ?? 0;\n    this._availableExtraCredits = data.jsonApi.attributes.availableExtraCredits ?? 0;\n    this._aiEnabled = data.jsonApi.attributes.aiEnabled ?? true;\n\n    this._legal_address = data.jsonApi.attributes.legal_address;\n    this._street_number = data.jsonApi.attributes.street_number;\n    this._street = data.jsonApi.attributes.street;\n    this._city = data.jsonApi.attributes.city;\n    this._province = data.jsonApi.attributes.province;\n    this._region = data.jsonApi.attributes.region;\n    this._postcode = data.jsonApi.attributes.postcode;\n    this._country = data.jsonApi.attributes.country;\n    this._country_code = data.jsonApi.attributes.country_code;\n    this._fiscal_data = data.jsonApi.attributes.fiscal_data;\n\n    this._features = this._readIncluded<FeatureInterface>(data, \"features\", Modules.Feature) as FeatureInterface[];\n    this._modules = this._readIncluded<ModuleInterface>(data, \"modules\", Modules.Module) as ModuleInterface[];\n\n    return this;\n  }\n\n  createJsonApi(data: CompanyInput) {\n    const response: any = {\n      data: {\n        type: Modules.Company.name,\n        id: data.id,\n        attributes: {},\n        meta: {},\n        relationships: {},\n      },\n      included: [],\n    };\n\n    if (data.name) response.data.attributes.name = data.name;\n    if (data.configurations) response.data.attributes.configurations = JSON.stringify(data.configurations);\n    if (data.logo) response.data.attributes.logo = data.logo;\n    if (data.monthlyCredits !== undefined) response.data.attributes.monthlyCredits = data.monthlyCredits;\n    if (data.availableMonthlyCredits !== undefined)\n      response.data.attributes.availableMonthlyCredits = data.availableMonthlyCredits;\n    if (data.availableExtraCredits !== undefined)\n      response.data.attributes.availableExtraCredits = data.availableExtraCredits;\n    if (data.aiEnabled !== undefined) response.data.attributes.aiEnabled = data.aiEnabled;\n\n    if (data.legal_address !== undefined) response.data.attributes.legal_address = data.legal_address;\n    if (data.street_number !== undefined) response.data.attributes.street_number = data.street_number;\n    if (data.street !== undefined) response.data.attributes.street = data.street;\n    if (data.city !== undefined) response.data.attributes.city = data.city;\n    if (data.province !== undefined) response.data.attributes.province = data.province;\n    if (data.region !== undefined) response.data.attributes.region = data.region;\n    if (data.postcode !== undefined) response.data.attributes.postcode = data.postcode;\n    if (data.country !== undefined) response.data.attributes.country = data.country;\n    if (data.country_code !== undefined) response.data.attributes.country_code = data.country_code;\n    if (data.fiscal_data !== undefined) response.data.attributes.fiscal_data = data.fiscal_data;\n\n    if (data.featureIds && data.featureIds.length > 0) {\n      response.data.relationships.features = {\n        data: data.featureIds.map((featureId) => ({\n          type: Modules.Feature.name,\n          id: featureId,\n        })),\n      };\n    }\n\n    if (data.moduleIds && data.moduleIds.length > 0) {\n      response.data.relationships.modules = {\n        data: data.moduleIds.map((moduleId) => ({\n          type: Modules.Module.name,\n          id: moduleId,\n        })),\n      };\n    }\n\n    return response;\n  }\n}\n","export enum CompanyFields {\n  companyId = \"companyId\",\n  name = \"name\",\n  createdAt = \"createdAt\",\n  updatedAt = \"updatedAt\",\n}\n","import { AbstractService, EndpointCreator, HttpMethod, Modules, NextRef } from \"../../../core\";\nimport { CompanyInput, CompanyInterface } from \"./company.interface\";\n\nexport class CompanyService extends AbstractService {\n  static async findOne(params: { companyId: string }): Promise<CompanyInterface> {\n    return this.callApi<CompanyInterface>({\n      type: Modules.Company,\n      method: HttpMethod.GET,\n      endpoint: new EndpointCreator({ endpoint: Modules.Company, id: params.companyId }).generate(),\n    });\n  }\n\n  static async findMany(params: { search?: string; next?: NextRef }): Promise<CompanyInterface[]> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.Company });\n\n    if (params.search) endpoint.addAdditionalParam(\"search\", params.search);\n\n    return this.callApi<CompanyInterface[]>({\n      type: Modules.Company,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params.next,\n    });\n  }\n\n  static async delete(params: { companyId: string }): Promise<void> {\n    await this.callApi({\n      type: Modules.Company,\n      method: HttpMethod.DELETE,\n      endpoint: new EndpointCreator({ endpoint: Modules.Company, id: params.companyId }).generate(),\n    });\n  }\n\n  static async selfDelete(params: { companyId: string }): Promise<void> {\n    await this.callApi({\n      type: Modules.Company,\n      method: HttpMethod.DELETE,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Company,\n        id: params.companyId,\n        childEndpoint: \"self-delete\",\n      }).generate(),\n    });\n  }\n\n  static async create(params: CompanyInput): Promise<CompanyInterface> {\n    return this.callApi({\n      type: Modules.Company,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({ endpoint: Modules.Company }).generate(),\n      input: params,\n    });\n  }\n\n  static async update(params: CompanyInput): Promise<CompanyInterface> {\n    return this.callApi({\n      type: Modules.Company,\n      method: HttpMethod.PUT,\n      endpoint: new EndpointCreator({ endpoint: Modules.Company, id: params.id }).generate(),\n      input: params,\n    });\n  }\n\n  static async updateConfigurations(params: CompanyInput): Promise<CompanyInterface> {\n    return this.callApi({\n      type: Modules.Company,\n      method: HttpMethod.PUT,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Company,\n        id: params.id,\n        childEndpoint: \"configurations\",\n      }).generate(),\n      input: params,\n    });\n  }\n\n  static async activateLicense(params: CompanyInput): Promise<CompanyInterface> {\n    return this.callApi({\n      type: Modules.Company,\n      method: HttpMethod.PUT,\n      endpoint: new EndpointCreator({ endpoint: Modules.Company, id: params.id, childEndpoint: \"license\" }).generate(),\n      input: params,\n    });\n  }\n}\n","// Frontend mirror of the backend `EntityAiStatus` enum (apps/api). Keep the\n// exact const-object + type shape and PascalCase values in sync with the\n// backend — this is the shared contract for credit-gated AI processing state.\nexport const EntityAiStatus = {\n  Pending: \"Pending\",\n  Summarising: \"Summarising\",\n  Completed: \"Completed\",\n  Failed: \"Failed\",\n  PendingCredits: \"PendingCredits\",\n  Discarded: \"Discarded\",\n} as const;\n\nexport type EntityAiStatus = (typeof EntityAiStatus)[keyof typeof EntityAiStatus];\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { SearchResultInterface } from \"../../search/interfaces/search.result.interface\";\nimport { UserInterface } from \"../../user\";\nimport { ContentInput, ContentInterface } from \"./content.interface\";\n\nexport class Content extends AbstractApiData implements ContentInterface, SearchResultInterface {\n  private _contentType?: string;\n\n  private _name?: string;\n  private _abstract?: string;\n  private _tldr?: string;\n  private _aiStatus?: string;\n  private _relevance?: number;\n\n  private _author?: UserInterface;\n  private _editors?: UserInterface[];\n\n  get searchResult(): string {\n    return this._name ?? \"\";\n  }\n\n  get contentType(): string | undefined {\n    return this._contentType;\n  }\n\n  get name(): string {\n    if (this._name === undefined) throw new Error(\"JsonApi error: content name is missing\");\n    return this._name;\n  }\n\n  get abstract(): string | undefined {\n    return this._abstract;\n  }\n\n  get tldr(): string | undefined {\n    return this._tldr;\n  }\n\n  get aiStatus(): string {\n    return this._aiStatus ?? \"\";\n  }\n\n  get relevance(): number | undefined {\n    return this._relevance;\n  }\n\n  get author(): UserInterface {\n    if (this._author === undefined) throw new Error(\"JsonApi error: document author is missing\");\n    return this._author;\n  }\n\n  get editors(): UserInterface[] {\n    return this._editors ?? [];\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._contentType = data.jsonApi.meta.contentType;\n\n    this._name = data.jsonApi.attributes.name;\n    this._abstract = data.jsonApi.attributes.abstract;\n    this._tldr = data.jsonApi.attributes.tldr;\n    this._aiStatus = data.jsonApi.meta.aiStatus;\n    this._relevance = data.jsonApi.meta.relevance;\n\n    this._author = this._readIncluded(data, \"author\", Modules.User) as UserInterface;\n    this._editors = this._readIncluded(data, \"editors\", Modules.User) as UserInterface[];\n\n    return this;\n  }\n\n  protected addContentInput(response: any, data: ContentInput) {\n    if (data.name) response.data.attributes.name = data.name;\n\n    if (data.authorId) {\n      response.data.relationships.author = {\n        data: {\n          type: Modules.User.name,\n          id: data.authorId,\n        },\n      };\n    }\n  }\n}\n","export enum ContentFields {\n  contentId = \"contentId\",\n\n  name = \"name\",\n  relevance = \"relevance\",\n\n  authors = \"authors\",\n\n  createdAt = \"createdAt\",\n  updatedAt = \"updatedAt\",\n}\n","import { AbstractService, EndpointCreator, HttpMethod, Modules, NextRef, PreviousRef } from \"../../../core\";\nimport { ContentInterface } from \"./content.interface\";\n\nexport class ContentService extends AbstractService {\n  static async findMany(params: {\n    contentIds?: string[];\n    search?: string;\n    fetchAll?: boolean;\n    next?: NextRef;\n    prev?: PreviousRef;\n  }): Promise<ContentInterface[]> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.Content });\n\n    if (params.contentIds) {\n      endpoint.addAdditionalParam(\"contentIds\", params.contentIds.join(\",\"));\n      endpoint.addAdditionalParam(\"fetchAll\", \"true\");\n    } else {\n      if (params.fetchAll) endpoint.addAdditionalParam(\"fetchAll\", \"true\");\n      if (params.search) endpoint.addAdditionalParam(\"search\", params.search);\n    }\n    if (Modules.Content.inclusions?.lists?.fields) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);\n    if (Modules.Content.inclusions?.lists?.types) endpoint.limitToType(Modules.Content.inclusions.lists.types);\n\n    return this.callApi({\n      type: Modules.Content,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params.next,\n    });\n  }\n\n  static async findRelevant(params: { id: string; next?: NextRef; prev?: PreviousRef }): Promise<ContentInterface[]> {\n    const endpoint: EndpointCreator = new EndpointCreator({\n      endpoint: Modules.Content,\n      id: params.id,\n      childEndpoint: \"relevance\",\n    });\n\n    if (Modules.Content.inclusions?.lists?.fields) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);\n    if (Modules.Content.inclusions?.lists?.types) endpoint.limitToType(Modules.Content.inclusions.lists.types);\n\n    return this.callApi<ContentInterface[]>({\n      type: Modules.Content,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params.next,\n    });\n  }\n\n  static async findManyByAuthor(params: {\n    userId: string;\n    search?: string;\n    fetchAll?: boolean;\n    next?: NextRef;\n    prev?: PreviousRef;\n  }): Promise<ContentInterface[]> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.Author,\n      id: params.userId,\n      childEndpoint: Modules.Content,\n    });\n\n    if (params.fetchAll) endpoint.addAdditionalParam(\"fetchAll\", \"true\");\n    if (params.search) endpoint.addAdditionalParam(\"search\", params.search);\n    if (Modules.Content.inclusions?.lists?.fields) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);\n    if (Modules.Content.inclusions?.lists?.types) endpoint.limitToType(Modules.Content.inclusions.lists.types);\n\n    return this.callApi({\n      type: Modules.Content,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params.next,\n    });\n  }\n}\n","import { createJsonApiInclusion } from \"../../core\";\nimport { ModuleFactory } from \"../../permissions\";\nimport { Content } from \".\";\n\nexport const ContentModule = (factory: ModuleFactory) =>\n  factory({\n    pageUrl: \"/contents\",\n    name: \"contents\",\n    model: Content,\n    inclusions: {\n      lists: {\n        fields: [\n          createJsonApiInclusion(\"content\", [`name`, `tldr`, `abstract`, `aiStatus`, `relevance`]),\n          createJsonApiInclusion(\"users\", [`name`, `avatar`]),\n          createJsonApiInclusion(\"topics\", [`name`]),\n          createJsonApiInclusion(\"expertises\", [`name`]),\n        ],\n      },\n    },\n  });\n","import { LifeBuoyIcon } from \"lucide-react\";\nimport { createJsonApiInclusion } from \"../../core\";\nimport { ModuleFactory } from \"../../permissions\";\nimport { HowTo } from \"./data/HowTo\";\n\nexport const HowToModule = (factory: ModuleFactory) =>\n  factory({\n    moduleId: \"6f975207-0df3-4c0d-b541-ed5dc04487b2\",\n    pageUrl: \"/administration/howtos\",\n    name: \"howtos\",\n    model: HowTo,\n    icon: LifeBuoyIcon,\n    inclusions: {\n      lists: {\n        fields: [\n          createJsonApiInclusion(\"howtos\", [\n            \"name\",\n            \"description\",\n            \"pages\",\n            \"howToType\",\n            \"slug\",\n            \"order\",\n            \"summary\",\n            \"tags\",\n            \"contextualKeys\",\n            \"draft\",\n          ]),\n        ],\n      },\n    },\n  });\n","import { JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { Content } from \"../../content/data/content\";\nimport { HowToInput, HowToInterface } from \"./HowToInterface\";\n\nexport class HowTo extends Content implements HowToInterface {\n  private _description?: any;\n  private _pages?: string;\n  private _howToType?: string;\n  private _slug?: string;\n  private _order?: number;\n  private _summary?: string;\n  private _tags?: string[];\n  private _contextualKeys?: string[];\n  private _draft?: boolean;\n\n  /**\n   * Parse pages from backend JSON string (handles legacy single string + JSON array)\n   */\n  static parsePagesFromString(pagesStr?: string): string[] {\n    if (!pagesStr) return [];\n    try {\n      const parsed = JSON.parse(pagesStr);\n      return Array.isArray(parsed) ? parsed : [pagesStr];\n    } catch {\n      // Legacy: treat as single page if not valid JSON\n      return pagesStr ? [pagesStr] : [];\n    }\n  }\n\n  /**\n   * Serialize pages array to JSON string for backend\n   */\n  static serializePagesToString(pages: string[]): string | undefined {\n    const filtered = pages.filter((p) => p.trim());\n    return filtered.length > 0 ? JSON.stringify(filtered) : undefined;\n  }\n\n  get description(): any {\n    return this._description;\n  }\n\n  get pages(): string | undefined {\n    return this._pages;\n  }\n\n  get howToType(): string | undefined {\n    return this._howToType;\n  }\n\n  get slug(): string | undefined {\n    return this._slug;\n  }\n\n  get order(): number | undefined {\n    return this._order;\n  }\n\n  get summary(): string | undefined {\n    return this._summary;\n  }\n\n  get tags(): string[] {\n    return this._tags ?? [];\n  }\n\n  get contextualKeys(): string[] {\n    return this._contextualKeys ?? [];\n  }\n\n  get draft(): boolean {\n    return this._draft ?? false;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    const rawDescription = data.jsonApi.attributes.description;\n    if (rawDescription === undefined || rawDescription === null || rawDescription === \"\") {\n      this._description = undefined;\n    } else if (typeof rawDescription === \"string\") {\n      try {\n        this._description = JSON.parse(rawDescription);\n      } catch {\n        // Help-content HowTos store plain-text summaries; admin-created HowTos\n        // store JSON-stringified BlockNote docs. Fall back to the raw string\n        // rather than crashing rehydration for the plain-text case.\n        this._description = rawDescription;\n      }\n    } else {\n      this._description = rawDescription;\n    }\n    this._pages = data.jsonApi.attributes.pages;\n    this._howToType = data.jsonApi.attributes.howToType;\n    this._slug = data.jsonApi.attributes.slug;\n    this._order = data.jsonApi.attributes.order;\n    this._summary = data.jsonApi.attributes.summary;\n    this._tags = data.jsonApi.attributes.tags ?? [];\n    this._contextualKeys = data.jsonApi.attributes.contextualKeys ?? [];\n    this._draft = data.jsonApi.attributes.draft ?? false;\n\n    return this;\n  }\n\n  createJsonApi(data: HowToInput) {\n    const response: any = {\n      data: {\n        type: Modules.HowTo.name,\n        id: data.id,\n        attributes: {},\n        meta: {},\n        relationships: {},\n      },\n      included: [],\n    };\n\n    super.addContentInput(response, data);\n\n    if (data.description !== undefined) response.data.attributes.description = JSON.stringify(data.description);\n    if (data.pages !== undefined) response.data.attributes.pages = data.pages;\n    if (data.howToType !== undefined) response.data.attributes.howToType = data.howToType;\n    if (data.slug !== undefined) response.data.attributes.slug = data.slug;\n    if (data.order !== undefined) response.data.attributes.order = data.order;\n    if (data.summary !== undefined) response.data.attributes.summary = data.summary;\n    if (data.tags !== undefined) response.data.attributes.tags = data.tags;\n    if (data.contextualKeys !== undefined) response.data.attributes.contextualKeys = data.contextualKeys;\n    if (data.draft !== undefined) response.data.attributes.draft = data.draft;\n\n    return response;\n  }\n}\n","export enum HowToFields {\n  howToId = \"howToId\",\n\n  name = \"name\",\n  description = \"description\",\n  pages = \"pages\",\n\n  createdAt = \"createdAt\",\n  updatedAt = \"updatedAt\",\n}\n","import { AbstractService, EndpointCreator, HttpMethod, Modules, NextRef, PreviousRef } from \"../../../core\";\nimport { HowToInput, HowToInterface } from \"./HowToInterface\";\n\nexport class HowToService extends AbstractService {\n  static async findOne(params: { id: string }): Promise<HowToInterface> {\n    return this.callApi<HowToInterface>({\n      type: Modules.HowTo,\n      method: HttpMethod.GET,\n      endpoint: new EndpointCreator({ endpoint: Modules.HowTo, id: params.id }).generate(),\n    });\n  }\n\n  static async findMany(\n    params: {\n      search?: string;\n      fetchAll?: boolean;\n      next?: NextRef;\n      prev?: PreviousRef;\n    } = {},\n  ): Promise<HowToInterface[]> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.HowTo });\n\n    if (params.fetchAll) endpoint.addAdditionalParam(\"fetchAll\", \"true\");\n    if (params.search) endpoint.addAdditionalParam(\"search\", params.search);\n    if (Modules.HowTo.inclusions?.lists?.fields) endpoint.limitToFields(Modules.HowTo.inclusions.lists.fields);\n    if (Modules.HowTo.inclusions?.lists?.types) endpoint.limitToType(Modules.HowTo.inclusions.lists.types);\n\n    return this.callApi({\n      type: Modules.HowTo,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params.next,\n    });\n  }\n\n  static async create(params: HowToInput): Promise<HowToInterface> {\n    return this.callApi({\n      type: Modules.HowTo,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({ endpoint: Modules.HowTo }).generate(),\n      input: params,\n    });\n  }\n\n  static async update(params: HowToInput): Promise<HowToInterface> {\n    return this.callApi({\n      type: Modules.HowTo,\n      method: HttpMethod.PUT,\n      endpoint: new EndpointCreator({ endpoint: Modules.HowTo, id: params.id }).generate(),\n      input: params,\n    });\n  }\n\n  static async delete(params: { howToId: string }): Promise<void> {\n    await this.callApi({\n      type: Modules.HowTo,\n      method: HttpMethod.DELETE,\n      endpoint: new EndpointCreator({ endpoint: Modules.HowTo, id: params.howToId }).generate(),\n    });\n  }\n\n  static async findPublished(params: { howToType?: string } = {}): Promise<HowToInterface[]> {\n    const endpoint = new EndpointCreator({ endpoint: `public/${Modules.HowTo.name}` });\n    if (params.howToType) endpoint.addAdditionalParam(\"type\", params.howToType);\n    return this.callApi({\n      type: Modules.HowTo,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  static async findPublishedArticle(params: { howToType: string; slug: string }): Promise<HowToInterface> {\n    return this.callApi<HowToInterface>({\n      type: Modules.HowTo,\n      method: HttpMethod.GET,\n      endpoint: new EndpointCreator({\n        endpoint: `public/${Modules.HowTo.name}`,\n        id: params.howToType,\n        childEndpoint: params.slug,\n      }).generate(),\n    });\n  }\n\n  static async findRelated(params: { howToType: string; slug: string }): Promise<HowToInterface[]> {\n    return this.callApi({\n      type: Modules.HowTo,\n      method: HttpMethod.GET,\n      endpoint: new EndpointCreator({\n        endpoint: `public/${Modules.HowTo.name}`,\n        id: params.howToType,\n        childEndpoint: params.slug,\n        childId: \"related\",\n      }).generate(),\n    });\n  }\n\n  static async addRelated(params: { howToId: string; relatedId: string }): Promise<HowToInterface> {\n    return this.callApi<HowToInterface>({\n      type: Modules.HowTo,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.HowTo,\n        id: params.howToId,\n        childEndpoint: \"related\",\n        childId: params.relatedId,\n      }).generate(),\n    });\n  }\n\n  static async removeRelated(params: { howToId: string; relatedId: string }): Promise<void> {\n    await this.callApi({\n      type: Modules.HowTo,\n      method: HttpMethod.DELETE,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.HowTo,\n        id: params.howToId,\n        childEndpoint: \"related\",\n        childId: params.relatedId,\n      }).generate(),\n    });\n  }\n}\n","import { BotIcon } from \"lucide-react\";\nimport { createJsonApiInclusion } from \"../../core\";\nimport { ModuleFactory } from \"../../permissions\";\nimport { Assistant } from \"./data/Assistant\";\n\nexport const AssistantModule = (factory: ModuleFactory) =>\n  factory({\n    pageUrl: \"/assistants\",\n    name: \"assistants\",\n    model: Assistant,\n    moduleId: \"2b39fd68-6a41-4f73-a2d0-4c8e8e3f9a42\",\n    icon: BotIcon,\n    identifier: [\"title\"],\n    inclusions: {\n      lists: {\n        fields: [createJsonApiInclusion(\"assistants\", [`title`])],\n      },\n    },\n  });\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { AssistantInput, AssistantInterface } from \"./AssistantInterface\";\n\nexport class Assistant extends AbstractApiData implements AssistantInterface {\n  private _title?: string;\n  private _messageCount?: number;\n  private _engine?: string;\n  private _boundContentType?: string;\n  private _boundContentId?: string;\n\n  get title(): string {\n    return this._title ?? \"\";\n  }\n\n  get messageCount(): number {\n    return this._messageCount ?? 0;\n  }\n\n  get engine(): string | undefined {\n    return this._engine;\n  }\n\n  get boundContentType(): string | undefined {\n    return this._boundContentType;\n  }\n\n  get boundContentId(): string | undefined {\n    return this._boundContentId;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n    this._title = data.jsonApi.attributes?.title;\n    this._engine = data.jsonApi.attributes?.engine;\n    const fromMeta = data.jsonApi.meta?.messageCount;\n    const fromAttrs = data.jsonApi.attributes?.messageCount;\n    this._messageCount = typeof fromMeta === \"number\" ? fromMeta : typeof fromAttrs === \"number\" ? fromAttrs : 0;\n    // Read the linkage pointer directly instead of `_readIncluded`: the bound\n    // resource is not side-loaded on this endpoint and only its {type, id} is\n    // needed to know which scope the thread belongs to.\n    const contentLinkage = data.jsonApi.relationships?.content?.data;\n    const boundContent = Array.isArray(contentLinkage) ? contentLinkage[0] : contentLinkage;\n    this._boundContentType = boundContent?.type;\n    this._boundContentId = boundContent?.id;\n    return this;\n  }\n\n  createJsonApi(data: AssistantInput) {\n    return {\n      data: {\n        type: Modules.Assistant.name,\n        attributes: {\n          // narr8 convention for BlockNote-backed fields: the document travels\n          // as a JSON string in the entity's own string attribute, exactly as\n          // Npc.description does (`JSON.stringify` out, `JSON.parse` back).\n          // The server detects the shape and derives the stored markdown.\n          content: data.contentBlocks !== undefined ? JSON.stringify(data.contentBlocks) : data.firstMessage,\n          ...(data.title !== undefined ? { title: data.title } : {}),\n          ...(data.howToMode !== undefined ? { howToMode: data.howToMode } : {}),\n          ...(data.limitToHowToId !== undefined ? { limitToHowToId: data.limitToHowToId } : {}),\n        },\n        ...(data.boundContent !== undefined\n          ? {\n              relationships: {\n                content: { data: { type: data.boundContent.type, id: data.boundContent.id } },\n              },\n            }\n          : {}),\n      },\n      included: [],\n    };\n  }\n}\n","import { v4 as uuidv4 } from \"uuid\";\nimport { AbstractApiData, ApiDataInterface, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport {\n  AssistantMessageInput,\n  AssistantMessageInterface,\n  AssistantMessageRole,\n  AssistantMessageType,\n} from \"./AssistantMessageInterface\";\nimport { resolveReferenceableModules } from \"../../assistant/utils/resolveReferenceableModules\";\nimport { ChunkInterface, ChunkRelationshipMeta } from \"../../chunk/data/ChunkInterface\";\n\nexport class AssistantMessage extends AbstractApiData implements AssistantMessageInterface {\n  private _role?: AssistantMessageRole;\n  private _content?: string;\n  private _position?: number;\n  private _suggestedQuestions?: string[];\n  private _inputTokens?: number;\n  private _outputTokens?: number;\n  private _references?: ApiDataInterface[];\n  private _citations?: (ChunkInterface & ChunkRelationshipMeta)[];\n  private _isOptimistic = false;\n  private _messageType?: AssistantMessageType;\n  private _actionId?: string;\n\n  get role(): AssistantMessageRole {\n    return this._role ?? \"assistant\";\n  }\n\n  get content(): string {\n    return this._content ?? \"\";\n  }\n\n  get position(): number {\n    return this._position ?? 0;\n  }\n\n  get suggestedQuestions(): string[] {\n    return this._suggestedQuestions ?? [];\n  }\n\n  get inputTokens(): number | undefined {\n    return this._inputTokens;\n  }\n\n  get outputTokens(): number | undefined {\n    return this._outputTokens;\n  }\n\n  get references(): ApiDataInterface[] {\n    return this._references ?? [];\n  }\n\n  get citations(): (ChunkInterface & ChunkRelationshipMeta)[] {\n    return this._citations ?? [];\n  }\n\n  get isOptimistic(): boolean {\n    return this._isOptimistic;\n  }\n\n  get messageType(): AssistantMessageType {\n    return this._messageType ?? \"text\";\n  }\n\n  get actionId(): string | undefined {\n    return this._actionId;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n    const attrs = data.jsonApi.attributes ?? {};\n    this._role = attrs.role as AssistantMessageRole | undefined;\n    this._content = attrs.content;\n    this._position = typeof attrs.position === \"number\" ? attrs.position : Number(attrs.position ?? 0);\n    this._suggestedQuestions = Array.isArray(attrs.suggestedQuestions) ? attrs.suggestedQuestions : [];\n    this._inputTokens = attrs.inputTokens;\n    this._outputTokens = attrs.outputTokens;\n    this._messageType = attrs.messageType as AssistantMessageType | undefined;\n    // The AssistantAction module is app-registered, so only the raw\n    // relationship id is exposed (no hydration of the included resource here).\n    const actionRelationship = data.jsonApi.relationships?.action?.data;\n    this._actionId = Array.isArray(actionRelationship) ? actionRelationship[0]?.id : actionRelationship?.id;\n    const refs = this._readIncludedPolymorphic<ApiDataInterface>(data, \"references\", resolveReferenceableModules());\n    this._references = Array.isArray(refs) ? refs : refs ? [refs] : [];\n    if (data.jsonApi.relationships?.citations?.data) {\n      const citations = this._readIncludedWithMeta<ChunkInterface, ChunkRelationshipMeta>(\n        data,\n        \"citations\",\n        Modules.Chunk,\n      );\n      this._citations = Array.isArray(citations)\n        ? (citations as (ChunkInterface & ChunkRelationshipMeta)[])\n        : citations\n          ? [citations as ChunkInterface & ChunkRelationshipMeta]\n          : [];\n    } else {\n      this._citations = [];\n    }\n    return this;\n  }\n\n  createJsonApi(data: AssistantMessageInput) {\n    return {\n      data: {\n        type: Modules.AssistantMessage.name,\n        id: data.id,\n        attributes: {\n          role: data.role,\n          content: data.content,\n          position: data.position,\n        },\n        relationships: {\n          assistant: {\n            data: { type: Modules.Assistant.name, id: data.assistantId },\n          },\n        },\n      },\n      included: [],\n    };\n  }\n\n  /**\n   * JSON:API envelope for POST /assistants/:id/assistant-messages.\n   * Different from `createJsonApi` (which expects a full message with role/position/assistant ref);\n   * the append-to-thread endpoint derives those server-side, so we only send `content` and\n   * the optional retrieval-mode flags.\n   */\n  createAppendMessageJsonApi(params: {\n    content: string;\n    howToMode?: boolean;\n    limitToHowToId?: string;\n    contentBlocks?: unknown[];\n  }) {\n    return {\n      data: {\n        type: Modules.AssistantMessage.name,\n        attributes: {\n          // narr8 convention for BlockNote-backed fields: the document travels\n          // as a JSON string in the field's own string attribute (see\n          // Npc.description). The server detects the shape and derives the\n          // stored markdown from it.\n          content: params.contentBlocks !== undefined ? JSON.stringify(params.contentBlocks) : params.content,\n          ...(params.howToMode !== undefined ? { howToMode: params.howToMode } : {}),\n          ...(params.limitToHowToId !== undefined ? { limitToHowToId: params.limitToHowToId } : {}),\n        },\n      },\n    };\n  }\n\n  static buildOptimistic(params: { content: string; position: number; assistantId?: string }): AssistantMessage {\n    const msg = new AssistantMessage();\n    const jsonApi: Record<string, unknown> = {\n      id: uuidv4(),\n      type: Modules.AssistantMessage.name,\n      attributes: {\n        role: \"user\",\n        content: params.content,\n        position: params.position,\n      },\n    };\n    if (params.assistantId) {\n      jsonApi.relationships = {\n        assistant: { data: { type: Modules.Assistant.name, id: params.assistantId } },\n      };\n    }\n    msg.rehydrate({ jsonApi: jsonApi as any, included: [] });\n    msg._isOptimistic = true;\n    return msg;\n  }\n}\n","import type { ApiRequestDataTypeInterface } from \"../../../core/interfaces/ApiRequestDataTypeInterface\";\nimport { ModuleRegistry } from \"../../../core/registry/ModuleRegistry\";\n\n/**\n * Returns every registered Module whose model class has a non-empty `identifierFields`\n * (so `entity.identifier` produces a meaningful string). Lazy — reads at call time so\n * modules registered after import-time are picked up.\n */\nexport function resolveReferenceableModules(): ApiRequestDataTypeInterface[] {\n  return ModuleRegistry.getAll().filter((m) => {\n    const cls = m.model as any;\n    return cls && Array.isArray(cls.identifierFields) && cls.identifierFields.length > 0;\n  });\n}\n","import { AbstractService, EndpointCreator, HttpMethod, Modules } from \"../../../core\";\nimport { AssistantMessage } from \"../../assistant-message/data/AssistantMessage\";\nimport { AssistantMessageInterface } from \"../../assistant-message/data/AssistantMessageInterface\";\nimport { AssistantInput, AssistantInterface } from \"./AssistantInterface\";\n\nexport class AssistantService extends AbstractService {\n  static async findOne(params: { id: string }): Promise<AssistantInterface> {\n    return this.callApi<AssistantInterface>({\n      type: Modules.Assistant,\n      method: HttpMethod.GET,\n      endpoint: new EndpointCreator({ endpoint: Modules.Assistant, id: params.id }).generate(),\n    });\n  }\n\n  /**\n   * Lists threads. `boundType`/`boundId` narrow the list to the threads bound\n   * to one resource (e.g. a campaign), so a scoped surface never shows the\n   * user's unrelated threads.\n   */\n  static async findMany(\n    params: { fetchAll?: boolean; boundType?: string; boundId?: string } = {},\n  ): Promise<AssistantInterface[]> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.Assistant });\n    if (params.fetchAll) endpoint.addAdditionalParam(\"fetchAll\", \"true\");\n    if (params.boundType) endpoint.addAdditionalParam(\"boundType\", params.boundType);\n    if (params.boundId) endpoint.addAdditionalParam(\"boundId\", params.boundId);\n    return this.callApi({\n      type: Modules.Assistant,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  static async create(params: AssistantInput): Promise<AssistantInterface> {\n    return this.callApi({\n      type: Modules.Assistant,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({ endpoint: Modules.Assistant }).generate(),\n      input: params,\n    });\n  }\n\n  /**\n   * Creates an assistant whose first turn runs on the operator engine\n   * (durable checkpointing + approval gates). Mirrors `create()` against the\n   * standalone operator module's create route (`POST operator`).\n   */\n  static async createOperator(params: AssistantInput): Promise<AssistantInterface> {\n    return this.callApi({\n      type: Modules.Assistant,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({ endpoint: \"operator\" }).generate(),\n      input: params,\n    });\n  }\n\n  /**\n   * Sends a new user message to an existing assistant thread. The agent turn\n   * runs synchronously; the response is a two-element list: [user, assistant].\n   *\n   * Uses the dedicated AssistantMessage.createAppendMessageJsonApi method to\n   * build the JSON:API envelope; this is the architecture-compliant pairing\n   * with `overridesJsonApiCreation: true`.\n   */\n  static async appendMessage(params: {\n    assistantId: string;\n    content: string;\n    howToMode?: boolean;\n    limitToHowToId?: string;\n    /** BlockNote document. Serialised by the model into `content`; never its own attribute. */\n    contentBlocks?: unknown[];\n  }): Promise<AssistantMessageInterface[]> {\n    const message = new AssistantMessage();\n    return this.callApi<AssistantMessageInterface[]>({\n      type: Modules.AssistantMessage,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Assistant,\n        id: params.assistantId,\n        childEndpoint: Modules.AssistantMessage,\n      }).generate(),\n      input: message.createAppendMessageJsonApi({\n        content: params.content,\n        howToMode: params.howToMode,\n        limitToHowToId: params.limitToHowToId,\n        contentBlocks: params.contentBlocks,\n      }),\n      overridesJsonApiCreation: true,\n    });\n  }\n\n  /**\n   * Operator-engine variant of `appendMessage()`. Targets\n   * `POST operator/:assistantId/assistant-messages`; the turn may freeze on a\n   * destructive tool call, in which case the returned list ends with an\n   * `approval-request` assistant message linked to a pending AssistantAction.\n   */\n  static async appendMessageOperator(params: {\n    assistantId: string;\n    content: string;\n    /** BlockNote document. Serialised by the model into `content`; never its own attribute. */\n    contentBlocks?: unknown[];\n  }): Promise<AssistantMessageInterface[]> {\n    const message = new AssistantMessage();\n    return this.callApi<AssistantMessageInterface[]>({\n      type: Modules.AssistantMessage,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({\n        endpoint: \"operator\",\n        id: params.assistantId,\n        childEndpoint: Modules.AssistantMessage,\n      }).generate(),\n      input: message.createAppendMessageJsonApi({\n        content: params.content,\n        contentBlocks: params.contentBlocks,\n      }),\n      overridesJsonApiCreation: true,\n    });\n  }\n\n  static async rename(params: { id: string; title: string }): Promise<void> {\n    await this.callApi({\n      type: Modules.Assistant,\n      method: HttpMethod.PATCH,\n      endpoint: new EndpointCreator({ endpoint: Modules.Assistant, id: params.id }).generate(),\n      input: {\n        data: {\n          type: Modules.Assistant.name,\n          id: params.id,\n          attributes: { title: params.title },\n        },\n      },\n      overridesJsonApiCreation: true,\n    });\n  }\n\n  static async delete(params: { id: string }): Promise<void> {\n    await this.callApi({\n      type: Modules.Assistant,\n      method: HttpMethod.DELETE,\n      endpoint: new EndpointCreator({ endpoint: Modules.Assistant, id: params.id }).generate(),\n    });\n  }\n}\n","import { MessageSquareIcon } from \"lucide-react\";\nimport { createJsonApiInclusion } from \"../../core\";\nimport { ModuleFactory } from \"../../permissions\";\nimport { AssistantMessage } from \"./data/AssistantMessage\";\n\nexport const AssistantMessageModule = (factory: ModuleFactory) =>\n  factory({\n    pageUrl: \"/assistant-messages\",\n    name: \"assistant-messages\",\n    model: AssistantMessage,\n    moduleId: \"5b2e10e4-3a01-4a59-9f0f-3c4a6c6a8e11\",\n    icon: MessageSquareIcon,\n    inclusions: {\n      lists: {\n        types: [`references`, `citations`, `citations.source`, `citations.source.author`],\n        fields: [\n          createJsonApiInclusion(\"assistant-messages\", [\n            `role`,\n            `content`,\n            `position`,\n            `suggestedQuestions`,\n            `inputTokens`,\n            `outputTokens`,\n            `messageType`,\n            `references`,\n            `citations`,\n            `action`,\n          ]),\n          createJsonApiInclusion(\"chunks\", [`content`, `nodeId`, `nodeType`, `imagePath`, `source`]),\n          createJsonApiInclusion(\"users\", [`name`, `avatar`]),\n        ],\n      },\n    },\n  });\n","import { AbstractService, EndpointCreator, HttpMethod, Modules, NextRef } from \"../../../core\";\nimport { AssistantMessageInterface } from \"./AssistantMessageInterface\";\n\nexport class AssistantMessageService extends AbstractService {\n  static async findByAssistant(params: { assistantId: string; next?: NextRef }): Promise<AssistantMessageInterface[]> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.Assistant,\n      id: params.assistantId,\n      childEndpoint: Modules.AssistantMessage,\n    });\n    if (Modules.AssistantMessage.inclusions?.lists?.fields)\n      endpoint.limitToFields(Modules.AssistantMessage.inclusions.lists.fields);\n    if (Modules.AssistantMessage.inclusions?.lists?.types)\n      endpoint.limitToType(Modules.AssistantMessage.inclusions.lists.types);\n    return this.callApi({\n      type: Modules.AssistantMessage,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params.next,\n    });\n  }\n\n  static async findOne(params: { id: string }): Promise<AssistantMessageInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.AssistantMessage,\n      id: params.id,\n    });\n    if (Modules.AssistantMessage.inclusions?.lists?.fields)\n      endpoint.limitToFields(Modules.AssistantMessage.inclusions.lists.fields);\n    if (Modules.AssistantMessage.inclusions?.lists?.types)\n      endpoint.limitToType(Modules.AssistantMessage.inclusions.lists.types);\n    return this.callApi<AssistantMessageInterface>({\n      type: Modules.AssistantMessage,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  static async delete(params: { id: string }): Promise<void> {\n    await this.callApi({\n      type: Modules.AssistantMessage,\n      method: HttpMethod.DELETE,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.AssistantMessage,\n        id: params.id,\n      }).generate(),\n    });\n  }\n}\n","import { ShieldCheckIcon } from \"lucide-react\";\nimport { ModuleFactory } from \"../../permissions\";\nimport { AssistantAction } from \"./data/AssistantAction\";\n\nexport const AssistantActionModule = (factory: ModuleFactory) =>\n  factory({\n    pageUrl: \"/assistant-actions\",\n    name: \"assistant-actions\",\n    model: AssistantAction,\n    identifier: [\"summary\"],\n    moduleId: \"e3c27517-bac0-43cb-adff-cc20c4210c12\",\n    icon: ShieldCheckIcon,\n  });\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { AssistantActionInput, AssistantActionInterface, AssistantActionStatus } from \"./AssistantActionInterface\";\n\nexport class AssistantAction extends AbstractApiData implements AssistantActionInterface {\n  private _status?: AssistantActionStatus;\n  private _toolName?: string;\n  private _summary?: string;\n  private _resolvedAt?: Date;\n  private _expiresAt?: Date;\n\n  get status(): AssistantActionStatus {\n    // Fail-safe: a missing status must never render actionable Approve/Deny buttons, so default to the non-actionable \"expired\".\n    return this._status ?? \"expired\";\n  }\n\n  get toolName(): string {\n    return this._toolName ?? \"\";\n  }\n\n  get summary(): string {\n    return this._summary ?? \"\";\n  }\n\n  get resolvedAt(): Date | undefined {\n    return this._resolvedAt;\n  }\n\n  get expiresAt(): Date | undefined {\n    return this._expiresAt;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._status = data.jsonApi.attributes.status;\n    this._toolName = data.jsonApi.attributes.toolName;\n    this._summary = data.jsonApi.attributes.summary;\n    this._resolvedAt = data.jsonApi.attributes.resolvedAt ? new Date(data.jsonApi.attributes.resolvedAt) : undefined;\n    this._expiresAt = data.jsonApi.attributes.expiresAt ? new Date(data.jsonApi.attributes.expiresAt) : undefined;\n\n    return this;\n  }\n\n  /**\n   * Minimal payload (id only): the frontend never POSTs assistant actions —\n   * approve/deny are body-less POSTs handled by AssistantActionService.\n   */\n  createJsonApi(data: AssistantActionInput) {\n    return {\n      data: {\n        type: Modules.AssistantAction.name,\n        id: data.id,\n        attributes: {},\n      },\n      included: [],\n    };\n  }\n}\n","import { AbstractService, EndpointCreator, HttpMethod, Modules } from \"../../../core\";\nimport { AssistantMessageInterface } from \"../../assistant-message/data/AssistantMessageInterface\";\nimport { AssistantActionInterface } from \"./AssistantActionInterface\";\n\nexport class AssistantActionService extends AbstractService {\n  /**\n   * GET single assistant action by ID\n   */\n  static async findOne(params: { id: string }): Promise<AssistantActionInterface> {\n    return this.callApi<AssistantActionInterface>({\n      type: Modules.AssistantAction,\n      method: HttpMethod.GET,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.AssistantAction,\n        id: params.id,\n      }).generate(),\n    });\n  }\n\n  /**\n   * POST (body-less) approve action — resumes the paused run and\n   * returns the resumed assistant message.\n   */\n  static async approve(params: { id: string }): Promise<AssistantMessageInterface> {\n    return this.callApi<AssistantMessageInterface>({\n      type: Modules.AssistantMessage,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.AssistantAction,\n        id: params.id,\n        childEndpoint: \"approve\",\n      }).generate(),\n    });\n  }\n\n  /**\n   * POST (body-less) deny action — resumes the paused run with a denial and\n   * returns the resumed assistant message.\n   */\n  static async deny(params: { id: string }): Promise<AssistantMessageInterface> {\n    return this.callApi<AssistantMessageInterface>({\n      type: Modules.AssistantMessage,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.AssistantAction,\n        id: params.id,\n        childEndpoint: \"deny\",\n      }).generate(),\n    });\n  }\n}\n","import { FileTextIcon } from \"lucide-react\";\nimport { createJsonApiInclusion } from \"../../core\";\nimport { ModuleFactory } from \"../../permissions\";\nimport { Chunk } from \"./data/Chunk\";\n\nexport const ChunkModule = (factory: ModuleFactory) =>\n  factory({\n    pageUrl: \"/chunks\",\n    name: \"chunks\",\n    model: Chunk,\n    moduleId: \"9b1c2f64-7ea3-4df5-8b2a-91b6a8d0e3a4\",\n    icon: FileTextIcon,\n    inclusions: {\n      lists: {\n        fields: [createJsonApiInclusion<Chunk>(\"chunks\", [\"content\", \"nodeId\", \"nodeType\", \"imagePath\", \"source\"])],\n      },\n    },\n  });\n","import { AbstractApiData, ApiDataInterface, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { resolveReferenceableModules } from \"../../assistant/utils/resolveReferenceableModules\";\nimport { ChunkInterface } from \"./ChunkInterface\";\n\nexport class Chunk extends AbstractApiData implements ChunkInterface {\n  private _content?: string;\n  private _nodeId?: string;\n  private _nodeType?: string;\n  private _imagePath?: string;\n  private _source?: ApiDataInterface;\n\n  get content(): string {\n    return this._content ?? \"\";\n  }\n  get nodeId(): string | undefined {\n    return this._nodeId;\n  }\n  get nodeType(): string | undefined {\n    return this._nodeType;\n  }\n  get imagePath(): string | undefined {\n    return this._imagePath;\n  }\n  get source(): ApiDataInterface | undefined {\n    return this._source;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n    const attrs = data.jsonApi.attributes ?? {};\n    const meta = data.jsonApi.meta ?? {};\n    this._content = attrs.content;\n    this._nodeId = meta.nodeId ?? attrs.nodeId;\n    this._nodeType = meta.nodeType ?? attrs.nodeType;\n    this._imagePath = attrs.imagePath;\n\n    const src = this._readIncludedPolymorphic<ApiDataInterface>(data, \"source\", resolveReferenceableModules());\n    this._source = Array.isArray(src) ? src[0] : src;\n    return this;\n  }\n\n  createJsonApi() {\n    // Chunks are read-only from the assistant context. Provide a minimal stub.\n    return {\n      data: { type: Modules.Chunk.name, id: this.id, attributes: {}, relationships: {} },\n      included: [],\n    };\n  }\n}\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { ModuleInterface } from \"../../module\";\nimport { FeatureInterface } from \"./feature.interface\";\n\nexport class Feature extends AbstractApiData implements FeatureInterface {\n  private _name?: string;\n  private _isCore?: boolean;\n\n  private _modules: ModuleInterface[] = [];\n\n  get name(): string {\n    return this._name ?? \"\";\n  }\n\n  get isCore(): boolean {\n    return this._isCore == true ? true : false;\n  }\n\n  get modules(): ModuleInterface[] {\n    return this._modules;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._name = data.jsonApi.attributes.name;\n    this._isCore = data.jsonApi.attributes.isCore ?? false;\n\n    this._modules = this._readIncluded(data, `modules`, Modules.Module) as ModuleInterface[];\n\n    return this;\n  }\n}\n","import { AbstractService, EndpointCreator, HttpMethod, Modules, NextRef } from \"../../../core\";\nimport { FeatureInterface } from \"./feature.interface\";\n\nexport class FeatureService extends AbstractService {\n  static async findMany(params: { companyId?: string; search?: string; next?: NextRef }): Promise<FeatureInterface[]> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.Feature });\n\n    if (params.companyId) endpoint.endpoint(Modules.Company).id(params.companyId).childEndpoint(Modules.Feature);\n\n    if (params.search) endpoint.addAdditionalParam(\"search\", params.search);\n\n    return this.callApi<FeatureInterface[]>({\n      type: Modules.Feature,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params.next,\n    });\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { Feature } from \"./data/feature\";\n\nexport const FeatureModule = (factory: ModuleFactory) =>\n  factory({\n    pageUrl: \"/features\",\n    name: \"features\",\n    model: Feature,\n    moduleId: \"025fdd23-2803-4360-9fd9-eaa3612c2e23\",\n  });\n","import { AbstractApiData, JsonApiHydratedDataInterface } from \"../../../core\";\nimport { ModuleInterface } from \"./module.interface\";\n\nexport class Module extends AbstractApiData implements ModuleInterface {\n  private _name?: string;\n  private _permissions?: {\n    create: boolean | string;\n    read: boolean | string;\n    update: boolean | string;\n    delete: boolean | string;\n  };\n\n  get name(): string {\n    if (!this._name) throw new Error(\"Name is not defined\");\n    return this._name ?? \"\";\n  }\n\n  get permissions(): {\n    create: boolean | string;\n    read: boolean | string;\n    update: boolean | string;\n    delete: boolean | string;\n  } {\n    if (!this._permissions) throw new Error(\"Permissions is not defined\");\n    return this._permissions;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._name = data.jsonApi.attributes.name;\n    this._permissions = data.jsonApi.meta.permissions;\n\n    return this;\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { Module } from \"./data\";\n\nexport const ModuleModule = (factory: ModuleFactory) =>\n  factory({\n    pageUrl: \"/modules\",\n    name: \"modules\",\n    model: Module,\n    moduleId: \"25ffd868-8341-4ca7-963b-6e1c56b03b1d\",\n  });\n","import { AbstractApiData, ApiDataInterface, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { NotificationInput, NotificationInterface } from \"./notification.interface\";\n\nexport class Notification extends AbstractApiData implements NotificationInterface {\n  private _notificationType?: string;\n  private _isRead?: boolean;\n  private _message?: string;\n  private _actionUrl?: string;\n\n  private _actor?: ApiDataInterface;\n  private _subject?: ApiDataInterface;\n\n  get notificationType(): string {\n    if (this._notificationType === undefined) throw new Error(\"notificationType is not set\");\n    return this._notificationType;\n  }\n\n  get isRead(): boolean {\n    return this._isRead === undefined ? false : this._isRead;\n  }\n\n  get message(): string | undefined {\n    return this._message;\n  }\n\n  get actionUrl(): string | undefined {\n    return this._actionUrl;\n  }\n\n  get actor(): ApiDataInterface | undefined {\n    return this._actor;\n  }\n\n  get subject(): ApiDataInterface | undefined {\n    return this._subject;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._notificationType = data.jsonApi.attributes.notificationType;\n    this._isRead = data.jsonApi.attributes.isRead;\n    this._message = data.jsonApi.attributes.message;\n    this._actionUrl = data.jsonApi.attributes.actionUrl;\n\n    const rels = (data.jsonApi.relationships ?? {}) as Record<string, { data?: { type: string; id: string } }>;\n\n    const actorType = rels.actor?.data?.type;\n    this._actor = actorType\n      ? (this._readIncluded(data, \"actor\", Modules.findByName(actorType)) as ApiDataInterface)\n      : undefined;\n\n    const subjectName = Object.keys(rels).find((name) => name !== \"actor\" && rels[name]?.data?.type);\n    const subjectType = subjectName ? rels[subjectName]?.data?.type : undefined;\n    this._subject =\n      subjectName && subjectType\n        ? (this._readIncluded(data, subjectName, Modules.findByName(subjectType)) as ApiDataInterface)\n        : undefined;\n\n    return this;\n  }\n\n  createJsonApi(data: NotificationInput) {\n    const response: any = {\n      data: {\n        type: Modules.Notification.name,\n        id: data.id,\n        attributes: {\n          isRead: data.isRead,\n        },\n        meta: {},\n        relationships: {},\n      },\n      included: [],\n    };\n\n    return response;\n  }\n}\n","export enum NotificationFields {\n  notificationId = \"notificationId\",\n\n  name = \"name\",\n\n  createdAt = \"createdAt\",\n  updatedAt = \"updatedAt\",\n}\n","import { AbstractService, EndpointCreator, HttpMethod, Modules, NextRef } from \"../../../core\";\nimport { NotificationInterface } from \"./notification.interface\";\n\nexport class NotificationService extends AbstractService {\n  static async findMany(params: { isArchived?: boolean; next?: NextRef }): Promise<NotificationInterface[]> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.Notification });\n\n    if (params.isArchived) endpoint.addAdditionalParam(\"isArchived\", \"true\");\n\n    return this.callApi<NotificationInterface[]>({\n      type: Modules.Notification,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params.next,\n    });\n  }\n\n  static async markAsRead(params: { data: any }): Promise<void> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.Notification });\n    await this.callApi({\n      type: Modules.Notification,\n      method: HttpMethod.PATCH,\n      endpoint: endpoint.generate(),\n      input: params.data,\n      overridesJsonApiCreation: true,\n    });\n  }\n\n  static async archive(params: { id: string }): Promise<void> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.Notification, id: params.id, childEndpoint: \"archive\" });\n\n    await this.callApi({ type: Modules.Notification, method: HttpMethod.POST, endpoint: endpoint.generate() });\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { Notification } from \"./data/notification\";\n\nexport const NotificationModule = (factory: ModuleFactory) =>\n  factory({\n    pageUrl: \"/notifications\",\n    name: \"notifications\",\n    model: Notification,\n    moduleId: \"9259d704-c670-4e77-a3a1-a728ffc5be3d\",\n  });\n","import { AbstractApiData, Modules } from \"../../../core\";\nimport { PushInput, PushInterface } from \"./push.interface\";\n\nexport class Push extends AbstractApiData implements PushInterface {\n  createJsonApi(data: PushInput) {\n    const response: any = {\n      data: {\n        type: Modules.Push.name,\n        attributes: {\n          key: data.key,\n        },\n      },\n      included: [],\n    };\n\n    return response;\n  }\n}\n","import { AbstractService, HttpMethod } from \"../../../core\";\nimport { EndpointCreator } from \"../../../core\";\nimport { Modules } from \"../../../core\";\n\nexport class PushService extends AbstractService {\n  static async register(params: { data: any }): Promise<void> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.Push });\n\n    await this.callApi({\n      type: Modules.Push,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n      input: params.data,\n      overridesJsonApiCreation: true,\n    });\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { Push } from \"./data/push\";\n\nexport const PushModule = (factory: ModuleFactory) =>\n  factory({\n    pageUrl: \"/push\",\n    name: \"push\",\n    model: Push,\n    moduleId: \"\",\n  });\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { FeatureInterface } from \"../../feature\";\nimport { RoleInput, RoleInterface } from \"./role.interface\";\n\nexport class Role extends AbstractApiData implements RoleInterface {\n  private _name?: string;\n  private _description?: string;\n  private _isSelectable?: boolean;\n\n  private _requiredFeature?: FeatureInterface;\n\n  get name(): string {\n    if (!this._name) throw new Error(\"Name is not defined\");\n    return this._name;\n  }\n\n  get description(): string {\n    return this._description ?? \"\";\n  }\n\n  get isSelectable(): boolean {\n    return this._isSelectable ?? false;\n  }\n\n  get requiredFeature(): FeatureInterface | undefined {\n    return this._requiredFeature;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._name = data.jsonApi.attributes.name ?? undefined;\n    this._description = data.jsonApi.attributes.description ?? undefined;\n    this._isSelectable = data.jsonApi.attributes.isSelectable ?? undefined;\n\n    this._requiredFeature = this._readIncluded<FeatureInterface>(\n      data,\n      \"requiredFeature\",\n      Modules.Feature,\n    ) as FeatureInterface;\n\n    return this;\n  }\n\n  createJsonApi(data: RoleInput) {\n    const response: any = {\n      data: {\n        type: Modules.Role.name,\n        id: data.id,\n        attributes: {\n          name: data.name,\n        },\n        meta: {},\n      },\n      included: [],\n    };\n\n    if (data.description !== undefined) response.data.attributes.description = data.description;\n\n    return response;\n  }\n}\n","export enum RoleFields {\n  roleId = \"roleId\",\n  name = \"name\",\n  description = \"description\",\n\n  createdAt = \"createdAt\",\n  updatedAt = \"updatedAt\",\n}\n","import { AbstractService, EndpointCreator, HttpMethod, Modules, NextRef, PreviousRef } from \"../../../core\";\nimport { RoleInput, RoleInterface } from \"./role.interface\";\n\nexport class RoleService extends AbstractService {\n  static async findById(params: { roleId: string }): Promise<RoleInterface> {\n    return this.callApi<RoleInterface>({\n      type: Modules.Role,\n      method: HttpMethod.GET,\n      endpoint: new EndpointCreator({ endpoint: Modules.Role, id: params.roleId }).generate(),\n    });\n  }\n\n  static async findAllRoles(params: { search?: string; next?: NextRef }): Promise<RoleInterface[]> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.Role });\n\n    if (params.search) endpoint.addAdditionalParam(\"search\", params.search);\n\n    return this.callApi({\n      type: Modules.Role,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params.next,\n    });\n  }\n\n  static async findAllRolesByUser(params: {\n    userId: string;\n    search?: string;\n    next?: NextRef;\n    prev?: PreviousRef;\n  }): Promise<RoleInterface[]> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.User, id: params.userId, childEndpoint: Modules.Role });\n\n    if (params.search) endpoint.addAdditionalParam(\"search\", params.search);\n\n    return this.callApi({\n      type: Modules.Role,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params.next,\n    });\n  }\n\n  static async findAllRolesUserNotIn(params: {\n    userId: string;\n    search?: string;\n    next?: NextRef;\n    prev?: PreviousRef;\n  }): Promise<RoleInterface[]> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.User,\n      id: params.userId,\n      childEndpoint: Modules.Role,\n    }).addAdditionalParam(\"userNotIn\", \"true\");\n\n    if (params.search) endpoint.addAdditionalParam(\"search\", params.search);\n\n    return this.callApi({\n      type: Modules.Role,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params.next,\n    });\n  }\n\n  static async addUserToRole(params: { userId: string; roleId: string }): Promise<void> {\n    this.callApi<RoleInterface>({\n      type: Modules.Role,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Role,\n        id: params.roleId,\n        childEndpoint: Modules.User,\n        childId: params.userId,\n      }).generate(),\n    });\n  }\n\n  static async removeUserFromRole(params: { userId: string; roleId: string }): Promise<void> {\n    this.callApi<RoleInterface>({\n      type: Modules.Role,\n      method: HttpMethod.DELETE,\n      endpoint: new EndpointCreator({\n        endpoint: Modules.Role,\n        id: params.roleId,\n        childEndpoint: Modules.User,\n        childId: params.userId,\n      }).generate(),\n    });\n  }\n\n  static async create(params: { roleId: string; name: string; description?: string }): Promise<RoleInterface> {\n    return this.callApi<RoleInterface>({\n      type: Modules.Role,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({ endpoint: Modules.Role }).generate(),\n      input: { id: params.roleId, name: params.name, description: params.description } as RoleInput,\n    });\n  }\n\n  static async update(params: { roleId: string; name: string; description?: string }): Promise<RoleInterface> {\n    return this.callApi<RoleInterface>({\n      type: Modules.Role,\n      method: HttpMethod.PUT,\n      endpoint: new EndpointCreator({ endpoint: Modules.Role, id: params.roleId }).generate(),\n      input: { id: params.roleId, name: params.name, description: params.description } as RoleInput,\n    });\n  }\n\n  static async delete(params: { roleId: string }): Promise<RoleInterface> {\n    return this.callApi<RoleInterface>({\n      type: Modules.Role,\n      method: HttpMethod.DELETE,\n      endpoint: new EndpointCreator({ endpoint: Modules.Role, id: params.roleId }).generate(),\n    });\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { Role } from \"./data/role\";\n\nexport const RoleModule = (factory: ModuleFactory) =>\n  factory({\n    pageUrl: \"/roles\",\n    name: \"roles\",\n    model: Role,\n    moduleId: \"9f6416e6-7b9b-4e1a-a99f-833191eca8a9\",\n  });\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { S3Input, S3Interface } from \"./s3.interface\";\n\nexport class S3 extends AbstractApiData implements S3Interface {\n  private _url?: string;\n  private _storageType?: string;\n  private _contentType?: string;\n  private _blobType?: string;\n  private _acl?: string;\n\n  get url(): string {\n    if (!this._url) throw new Error(\"Image URL is not set.\");\n    return this._url;\n  }\n\n  get headers(): Record<string, string> {\n    const headers: Record<string, string> = {};\n\n    if (this._contentType) {\n      headers[\"Content-Type\"] = this._contentType;\n    }\n\n    if (this._blobType) {\n      headers[\"x-ms-blob-type\"] = this._blobType;\n    }\n\n    if (this._acl) {\n      headers[\"x-amz-acl\"] = this._acl;\n    }\n\n    return headers;\n  }\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._url = data.jsonApi.attributes.url ?? undefined;\n    this._storageType = data.jsonApi.attributes.storageType ?? undefined;\n    this._contentType = data.jsonApi.attributes.contentType ?? undefined;\n    this._blobType = data.jsonApi.attributes.blobType ?? undefined;\n    this._acl = data.jsonApi.attributes.acl ?? undefined;\n\n    return this;\n  }\n\n  createJsonApi(data: S3Input) {\n    const response: any = {\n      data: {\n        type: Modules.S3.name,\n        attributes: {\n          key: data.key,\n        },\n      },\n      included: [],\n    };\n\n    if (data.contentType) response.data.attributes.contentType = data.contentType;\n\n    return response;\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { S3 } from \"./data/s3\";\n\nexport const S3Module = (factory: ModuleFactory) =>\n  factory({\n    pageUrl: \"/s3\",\n    name: \"s3\",\n    model: S3,\n    moduleId: \"db41ba46-e171-4324-8845-99353eba8568\",\n  });\n","import { AbstractService, EndpointCreator, HttpMethod, Modules } from \"../../../core\";\nimport { S3Interface } from \"./s3.interface\";\n\nexport class S3Service extends AbstractService {\n  static async getPreSignedUrl(params: { key: string; contentType: string; isPublic?: boolean }): Promise<S3Interface> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.S3 })\n      .addAdditionalParam(\"key\", params.key)\n      .addAdditionalParam(\"contentType\", params.contentType);\n\n    if (params.isPublic) endpoint.addAdditionalParam(\"isPublic\", \"true\");\n\n    return this.callApi<S3Interface>({ type: Modules.S3, method: HttpMethod.GET, endpoint: endpoint.generate() });\n  }\n\n  static async getSignedUrl(params: { key: string; isPublic?: boolean }): Promise<S3Interface> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.S3, id: \"sign\" }).addAdditionalParam(\"key\", params.key);\n\n    if (params.isPublic) endpoint.addAdditionalParam(\"isPublic\", \"true\");\n\n    return this.callApi<S3Interface>({ type: Modules.S3, method: HttpMethod.GET, endpoint: endpoint.generate() });\n  }\n\n  static async deleteFile(params: { key: string }): Promise<void> {\n    this.callApi<S3Interface>({\n      type: Modules.S3,\n      method: HttpMethod.DELETE,\n      endpoint: new EndpointCreator({ endpoint: Modules.S3 }).addAdditionalParam(\"key\", params.key).generate(),\n    });\n  }\n}\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { CompanyInterface } from \"../../company/data/company.interface\";\nimport { ModuleInterface } from \"../../module\";\nimport { RoleInterface } from \"../../role\";\nimport { SearchResultInterface } from \"../../search\";\nimport { UserInput, UserInterface } from \"./user.interface\";\n\nexport class User extends AbstractApiData implements UserInterface, SearchResultInterface {\n  private _name?: string;\n  private _email?: string;\n  private _title?: string;\n  private _bio?: string;\n  private _avatar?: string;\n  private _avatarUrl?: string;\n  private _phone?: string;\n  private _rate?: number;\n\n  private _isActivated?: boolean;\n  private _isDeleted?: boolean;\n  private _twoFactorEnabled: boolean = false;\n  private _lastLogin?: Date;\n\n  private _relevance?: number;\n\n  private _roles: RoleInterface[] = [];\n  private _company?: CompanyInterface;\n  private _modules: ModuleInterface[] = [];\n\n  get searchResult(): string {\n    return this._name ?? \"\";\n  }\n\n  get name(): string {\n    return this._name ?? \"\";\n  }\n\n  get email(): string {\n    return this._email ?? \"\";\n  }\n\n  get title(): string {\n    return this._title ?? \"\";\n  }\n\n  get bio(): string {\n    return this._bio ?? \"\";\n  }\n\n  get avatar(): string | undefined {\n    return this._avatar;\n  }\n\n  get avatarUrl(): string | undefined {\n    return this._avatarUrl;\n  }\n\n  get phone(): string | undefined {\n    return this._phone;\n  }\n\n  get rate(): number | undefined {\n    return this._rate;\n  }\n\n  get relevance(): number | undefined {\n    return this._relevance;\n  }\n\n  get isActivated(): boolean {\n    return this._isActivated ?? false;\n  }\n\n  get isDeleted(): boolean {\n    return this._isDeleted ?? false;\n  }\n\n  get twoFactorEnabled(): boolean {\n    return this._twoFactorEnabled;\n  }\n\n  get lastLogin(): Date | undefined {\n    return this._lastLogin;\n  }\n\n  get roles(): RoleInterface[] {\n    return this._roles;\n  }\n\n  get company(): CompanyInterface | undefined {\n    return this._company;\n  }\n\n  get modules(): ModuleInterface[] {\n    return this._modules;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._name = data.jsonApi.attributes.name;\n    this._email = data.jsonApi.attributes.email;\n    this._title = data.jsonApi.attributes.title;\n    this._bio = data.jsonApi.attributes.bio;\n    this._phone = data.jsonApi.attributes.phone;\n    this._rate = data.jsonApi.attributes.rate;\n\n    this._avatar = data.jsonApi.attributes.avatar;\n    this._avatarUrl = data.jsonApi.attributes.avatarUrl;\n\n    this._isActivated = data.jsonApi.meta.isActive;\n    this._isDeleted = data.jsonApi.meta.isDeleted;\n    this._twoFactorEnabled = data.jsonApi.attributes.twoFactorEnabled ?? false;\n    this._lastLogin = data.jsonApi.meta.lastLogin ? new Date(data.jsonApi.meta.lastLogin) : undefined;\n\n    this._relevance = data.jsonApi.meta.relevance;\n\n    this._roles = this._readIncluded(data, \"roles\", Modules.Role) as RoleInterface[];\n    this._company = this._readIncluded(data, \"company\", Modules.Company) as CompanyInterface;\n    this._modules = this._readIncluded(data, \"modules\", Modules.Module) as ModuleInterface[];\n\n    return this;\n  }\n\n  createJsonApi(data: UserInput) {\n    const response: any = {\n      data: {\n        type: Modules.User.name,\n        id: data.id,\n        attributes: {},\n        meta: {},\n        relationships: {},\n      },\n      included: [],\n    };\n\n    if (data.name !== undefined) response.data.attributes.name = data.name;\n    if (data.email !== undefined) response.data.attributes.email = data.email;\n    if (data.title !== undefined) response.data.attributes.title = data.title;\n    if (data.bio !== undefined) response.data.attributes.bio = data.bio;\n    if (data.phone !== undefined) response.data.attributes.phone = data.phone;\n    if (data.password !== undefined) response.data.attributes.password = data.password;\n    if (data.sendInvitationEmail) response.data.attributes.sendInvitationEmail = true;\n    if (data.adminCreated) response.data.attributes.adminCreated = true;\n    if (data.avatar !== undefined) response.data.attributes.avatar = data.avatar;\n    if (data.rate !== undefined) response.data.attributes.rate = data.rate;\n\n    if (data.roleIds) {\n      response.data.relationships.roles = {\n        data: data.roleIds.map((roleId) => ({\n          type: Modules.Role.name,\n          id: roleId,\n        })),\n      };\n    }\n\n    if (data.companyId) {\n      response.data.relationships.company = {\n        data: {\n          type: Modules.Company.name,\n          id: data.companyId,\n        },\n      };\n    }\n\n    return response;\n  }\n}\n","export enum UserFields {\n  userId = \"userId\",\n  name = \"name\",\n  email = \"email\",\n  company = \"company\",\n  relevance = \"relevance\",\n  createdAt = \"createdAt\",\n  updatedAt = \"updatedAt\",\n}\n","import { AbstractService, EndpointCreator, HttpMethod, Modules, NextRef, PreviousRef } from \"../../../core\";\nimport { UserInput, UserInterface } from \"./user.interface\";\n\nexport class UserService extends AbstractService {\n  static async findFullUser(): Promise<UserInterface> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.User, id: \"me\", childEndpoint: \"full\" });\n\n    return this.callApi<UserInterface>({\n      type: Modules.User,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  static async findById(params: { userId: string }): Promise<UserInterface> {\n    return this.callApi<UserInterface>({\n      type: Modules.User,\n      method: HttpMethod.GET,\n      endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.userId }).generate(),\n    });\n  }\n\n  static async findByEmail(params: { email: string }): Promise<UserInterface> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.User, id: \"email\", childEndpoint: params.email });\n\n    return this.callApi<UserInterface>({ type: Modules.User, method: HttpMethod.GET, endpoint: endpoint.generate() });\n  }\n\n  static async findMany(params: {\n    roleId?: string;\n    search?: string;\n    fetchAll?: boolean;\n    includeDeleted?: boolean;\n    next?: NextRef;\n    prev?: PreviousRef;\n  }): Promise<UserInterface[]> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.User });\n\n    if (params.roleId) endpoint.addAdditionalParam(\"roleId\", params.roleId);\n\n    if (params.includeDeleted) endpoint.addAdditionalParam(\"includeDeleted\", \"true\");\n    if (params.fetchAll) endpoint.addAdditionalParam(\"fetchAll\", \"true\");\n    if (params.search) endpoint.addAdditionalParam(\"search\", params.search);\n\n    return this.callApi({\n      type: Modules.User,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params.next,\n    });\n  }\n\n  static async findManyByContentIds(params: {\n    contentIds: string[];\n    search?: string;\n    next?: NextRef;\n    prev?: PreviousRef;\n  }): Promise<UserInterface[]> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.User });\n\n    endpoint.addAdditionalParam(\"contentIds\", params.contentIds.map((id) => id).join(\",\"));\n    endpoint.addAdditionalParam(\"includeDeleted\", \"true\");\n    endpoint.addAdditionalParam(\"fetchAll\", \"true\");\n    if (params.search) endpoint.addAdditionalParam(\"search\", params.search);\n\n    return this.callApi({\n      type: Modules.User,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params.next,\n    });\n  }\n\n  static async findRelevant(params: { id: string; next?: NextRef; prev?: PreviousRef }): Promise<UserInterface[]> {\n    const endpoint: EndpointCreator = new EndpointCreator({\n      endpoint: Modules.Content,\n      id: params.id,\n      childEndpoint: \"user-relevance\",\n    });\n\n    if (Modules.User.inclusions?.lists?.fields) endpoint.limitToFields(Modules.User.inclusions.lists.fields);\n    if (Modules.User.inclusions?.lists?.types) endpoint.limitToType(Modules.User.inclusions.lists.types);\n\n    return this.callApi<UserInterface[]>({\n      type: Modules.User,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params.next,\n    });\n  }\n\n  static async findManyForAmin(params: {\n    companyId?: string;\n    search?: string;\n    next?: NextRef;\n    prev?: PreviousRef;\n  }): Promise<UserInterface[]> {\n    if (!params.companyId) return [];\n\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.Company,\n      id: params.companyId,\n      childEndpoint: Modules.User,\n    });\n\n    if (params.search) endpoint.addAdditionalParam(\"search\", params.search);\n\n    return this.callApi({\n      type: Modules.User,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params.next,\n      previous: params.prev,\n    });\n  }\n\n  static async findAllUsers(params: {\n    companyId: string;\n    search?: string;\n    limitToRoles?: string[];\n    isDeleted?: boolean;\n    next?: NextRef;\n    prev?: PreviousRef;\n  }): Promise<UserInterface[]> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.Company,\n      id: params.companyId,\n      childEndpoint: Modules.User,\n    });\n\n    if (params.search) endpoint.addAdditionalParam(\"search\", params.search);\n    if (params.isDeleted) endpoint.addAdditionalParam(\"isDeleted\", \"true\");\n    if (params.limitToRoles && params.limitToRoles.length > 0)\n      endpoint.addAdditionalParam(\"limitToRoles\", params.limitToRoles.join(\",\"));\n\n    return this.callApi({\n      type: Modules.User,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params.next,\n    });\n  }\n\n  static async findAllUsersByRole(params: {\n    roleId: string;\n    search?: string;\n    next?: NextRef;\n    prev?: PreviousRef;\n  }): Promise<UserInterface[]> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.Role, id: params.roleId, childEndpoint: Modules.User });\n\n    if (params.search) endpoint.addAdditionalParam(\"search\", params.search);\n\n    return this.callApi({\n      type: Modules.User,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params.next,\n    });\n  }\n\n  static async findAllUsersNotInRole(params: {\n    roleId: string;\n    search?: string;\n    next?: NextRef;\n    prev?: PreviousRef;\n  }): Promise<UserInterface[]> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.Role,\n      id: params.roleId,\n      childEndpoint: Modules.User,\n    }).addAdditionalParam(\"notInRole\", \"true\");\n\n    if (params.search) endpoint.addAdditionalParam(\"search\", params.search);\n\n    return this.callApi({\n      type: Modules.User,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params.next,\n    });\n  }\n\n  static async create(params: UserInput): Promise<UserInterface> {\n    return this.callApi({\n      type: Modules.User,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({ endpoint: Modules.User }).generate(),\n      companyId: params.companyId,\n      input: params,\n    });\n  }\n\n  static async reactivate(params: { userId: string }): Promise<UserInterface> {\n    return this.callApi({\n      type: Modules.User,\n      method: HttpMethod.PATCH,\n      endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.userId }).generate(),\n    });\n  }\n\n  static async sendInvitation(params: { userId: string; companyId?: string }): Promise<void> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.User,\n      id: params.userId,\n      childEndpoint: \"send-invitation-email\",\n    });\n\n    if (params.companyId) endpoint.addAdditionalParam(\"companyId\", params.companyId);\n\n    this.callApi({\n      type: Modules.User,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  static async update(params: UserInput): Promise<UserInterface> {\n    return this.callApi({\n      type: Modules.User,\n      method: HttpMethod.PUT,\n      endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.id }).generate(),\n      companyId: params.companyId,\n      input: params,\n    });\n  }\n\n  static async patch(params: { id: string } & Partial<Omit<UserInput, \"id\">>): Promise<UserInterface> {\n    return this.callApi({\n      type: Modules.User,\n      method: HttpMethod.PATCH,\n      endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.id }).generate(),\n      input: params,\n    });\n  }\n\n  static async patchAvatar(params: { id: string; avatar: string }): Promise<UserInterface> {\n    return this.callApi({\n      type: Modules.User,\n      method: HttpMethod.PATCH,\n      endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.id, childEndpoint: \"avatar\" }).generate(),\n      input: params,\n    });\n  }\n\n  static async patchRate(params: UserInput): Promise<UserInterface> {\n    return this.callApi({\n      type: Modules.User,\n      method: HttpMethod.PATCH,\n      endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.id, childEndpoint: \"rates\" }).generate(),\n      companyId: params.companyId,\n      input: params,\n    });\n  }\n\n  static async delete(params: { userId: string; companyId: string }): Promise<void> {\n    await this.callApi({\n      type: Modules.User,\n      method: HttpMethod.DELETE,\n      endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.userId }).generate(),\n      companyId: params.companyId,\n    });\n  }\n}\n","/**\n * localStorage key backing the `CurrentUserProvider` atom.\n *\n * Owned by this library, not by the apps that consume it: `<Logout />` clears\n * it on every sign-out. Kept in its own module so both the provider that writes\n * it and the component that clears it can reference the same constant without\n * importing each other.\n */\nexport const CURRENT_USER_STORAGE_KEY = \"user\";\n","import { ModuleFactory } from \"../../permissions\";\nimport { User } from \"./data\";\n\nexport const AuthorModule = (factory: ModuleFactory) =>\n  factory({\n    pageUrl: \"/authors\",\n    name: \"authors\",\n    model: User,\n    moduleId: \"04cfc677-0fd2-4f5e-adf4-2483a00c0277\",\n  });\n","import { UsersIcon } from \"lucide-react\";\nimport { createJsonApiInclusion } from \"../../core\";\nimport { ModuleFactory } from \"../../permissions\";\nimport { User } from \"./data/user\";\n\nexport const UserModule = (factory: ModuleFactory) =>\n  factory({\n    pageUrl: \"/users\",\n    name: \"users\",\n    model: User,\n    moduleId: \"04cfc677-0fd2-4f5e-adf4-2483a00c0277\",\n    icon: UsersIcon,\n    inclusions: {\n      lists: {\n        fields: [\n          createJsonApiInclusion(\"users\", [`name`, `email`, `avatar`, `title`]),\n          createJsonApiInclusion(\"usertopics\", [`level`]),\n          createJsonApiInclusion(\"userexpertises\", [`level`]),\n          createJsonApiInclusion(\"topics\", [`name`]),\n        ],\n      },\n    },\n  });\n","import { AbstractApiData, JsonApiHydratedDataInterface } from \"../../../core\";\nimport { OAuthClientInput, OAuthClientInterface } from \"../interfaces/oauth.interface\";\n\n/**\n * OAuth client data model\n * Represents a registered OAuth application that can request access tokens\n */\nexport class OAuthClient extends AbstractApiData implements OAuthClientInterface {\n  private _clientId?: string;\n  private _name?: string;\n  private _description?: string;\n  private _redirectUris: string[] = [];\n  private _allowedScopes: string[] = [];\n  private _allowedGrantTypes: string[] = [];\n  private _isConfidential: boolean = true;\n  private _isActive: boolean = true;\n\n  get clientId(): string {\n    return this._clientId ?? this.id;\n  }\n\n  get name(): string {\n    if (!this._name) throw new Error(\"Name is not defined\");\n    return this._name;\n  }\n\n  get description(): string | undefined {\n    return this._description;\n  }\n\n  get redirectUris(): string[] {\n    return this._redirectUris;\n  }\n\n  get allowedScopes(): string[] {\n    return this._allowedScopes;\n  }\n\n  get allowedGrantTypes(): string[] {\n    return this._allowedGrantTypes;\n  }\n\n  get isConfidential(): boolean {\n    return this._isConfidential;\n  }\n\n  get isActive(): boolean {\n    return this._isActive;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    const attrs = data.jsonApi.attributes || {};\n\n    this._clientId = attrs.clientId ?? this._id;\n    this._name = attrs.name;\n    this._description = attrs.description;\n    this._redirectUris = attrs.redirectUris ?? [];\n    this._allowedScopes = attrs.allowedScopes ?? [];\n    this._allowedGrantTypes = attrs.allowedGrantTypes ?? [];\n    this._isConfidential = attrs.isConfidential ?? true;\n    this._isActive = attrs.isActive ?? true;\n\n    return this;\n  }\n\n  createJsonApi(data: OAuthClientInput) {\n    const response: any = {\n      data: {\n        type: \"oauth-clients\",\n        attributes: {},\n      },\n    };\n\n    if (data.id) response.data.id = data.id;\n    if (data.name !== undefined) response.data.attributes.name = data.name;\n    if (data.description !== undefined) response.data.attributes.description = data.description;\n    if (data.redirectUris !== undefined) response.data.attributes.redirectUris = data.redirectUris;\n    if (data.allowedScopes !== undefined) response.data.attributes.allowedScopes = data.allowedScopes;\n    if (data.allowedGrantTypes !== undefined) response.data.attributes.allowedGrantTypes = data.allowedGrantTypes;\n    if (data.isConfidential !== undefined) response.data.attributes.isConfidential = data.isConfidential;\n    if (data.isActive !== undefined) response.data.attributes.isActive = data.isActive;\n\n    return response;\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { OAuthClient } from \"./data/oauth\";\n\nexport const OAuthModule = (factory: ModuleFactory) =>\n  factory({\n    pageUrl: \"/oauth\",\n    name: \"oauth-clients\",\n    model: OAuthClient,\n  });\n","import { AbstractService, EndpointCreator, HttpMethod, Modules, NextRef } from \"../../../core\";\nimport {\n  OAuthClientCreateRequest,\n  OAuthClientCreateResponse,\n  OAuthClientInput,\n  OAuthClientInterface,\n  OAuthConsentInfo,\n  OAuthConsentRequest,\n} from \"../interfaces/oauth.interface\";\n\n/**\n * Service for OAuth client management and authorization consent flow.\n *\n * Client Management endpoints:\n * - GET /oauth/clients - List all clients for current user\n * - GET /oauth/clients/:clientId - Get single client\n * - POST /oauth/clients - Create new client (returns secret once)\n * - PATCH /oauth/clients/:clientId - Update client\n * - DELETE /oauth/clients/:clientId - Delete client\n * - POST /oauth/clients/:clientId/regenerate-secret - Regenerate client secret\n *\n * Consent Flow endpoints:\n * - GET /oauth/authorize/info - Get client info for consent screen\n * - POST /oauth/authorize/approve - Approve authorization\n * - POST /oauth/authorize/deny - Deny authorization\n */\nexport class OAuthService extends AbstractService {\n  // ==========================================\n  // CLIENT MANAGEMENT\n  // ==========================================\n\n  /**\n   * List all OAuth clients for the current user\n   */\n  static async listClients(params?: { next?: NextRef }): Promise<OAuthClientInterface[]> {\n    return this.callApi<OAuthClientInterface[]>({\n      type: Modules.OAuth,\n      method: HttpMethod.GET,\n      endpoint: new EndpointCreator({ endpoint: \"oauth/clients\" }).generate(),\n      next: params?.next,\n    });\n  }\n\n  /**\n   * Get a single OAuth client by ID\n   */\n  static async getClient(params: { clientId: string }): Promise<OAuthClientInterface> {\n    return this.callApi<OAuthClientInterface>({\n      type: Modules.OAuth,\n      method: HttpMethod.GET,\n      endpoint: new EndpointCreator({ endpoint: \"oauth/clients\", id: params.clientId }).generate(),\n    });\n  }\n\n  /**\n   * Create a new OAuth client\n   * @returns The created client AND the client secret (shown only once!)\n   */\n  static async createClient(data: OAuthClientCreateRequest): Promise<OAuthClientCreateResponse> {\n    const result = await this.callApiWithMeta<OAuthClientInterface>({\n      type: Modules.OAuth,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({ endpoint: \"oauth/clients\" }).generate(),\n      input: data,\n    });\n\n    return {\n      client: result.data,\n      clientSecret: result.meta?.clientSecret as string | undefined,\n    };\n  }\n\n  /**\n   * Update an existing OAuth client\n   */\n  static async updateClient(params: {\n    clientId: string;\n    data: Partial<OAuthClientInput>;\n  }): Promise<OAuthClientInterface> {\n    return this.callApi<OAuthClientInterface>({\n      type: Modules.OAuth,\n      method: HttpMethod.PATCH,\n      endpoint: new EndpointCreator({ endpoint: \"oauth/clients\", id: params.clientId }).generate(),\n      input: { id: params.clientId, ...params.data },\n    });\n  }\n\n  /**\n   * Delete an OAuth client\n   */\n  static async deleteClient(params: { clientId: string }): Promise<void> {\n    await this.callApi({\n      type: Modules.OAuth,\n      method: HttpMethod.DELETE,\n      endpoint: new EndpointCreator({ endpoint: \"oauth/clients\", id: params.clientId }).generate(),\n    });\n  }\n\n  /**\n   * Regenerate the client secret\n   * @returns The new client secret (shown only once!)\n   */\n  static async regenerateSecret(params: { clientId: string }): Promise<{ clientSecret: string }> {\n    const result = await this.callApiWithMeta<OAuthClientInterface>({\n      type: Modules.OAuth,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({\n        endpoint: \"oauth/clients\",\n        id: params.clientId,\n        childEndpoint: \"regenerate-secret\",\n      }).generate(),\n    });\n\n    return {\n      clientSecret: result.meta?.clientSecret as string,\n    };\n  }\n\n  // ==========================================\n  // CONSENT FLOW\n  // ==========================================\n\n  /**\n   * Get client information for the consent screen\n   * Called when user is redirected to /oauth/authorize\n   */\n  static async getAuthorizationInfo(params: OAuthConsentRequest): Promise<OAuthConsentInfo> {\n    const endpoint = new EndpointCreator({ endpoint: \"oauth/authorize/info\" });\n\n    // Add query parameters\n    endpoint.addAdditionalParam(\"client_id\", params.clientId);\n    endpoint.addAdditionalParam(\"redirect_uri\", params.redirectUri);\n    if (params.scope) endpoint.addAdditionalParam(\"scope\", params.scope);\n    if (params.state) endpoint.addAdditionalParam(\"state\", params.state);\n    if (params.codeChallenge) endpoint.addAdditionalParam(\"code_challenge\", params.codeChallenge);\n    if (params.codeChallengeMethod) endpoint.addAdditionalParam(\"code_challenge_method\", params.codeChallengeMethod);\n\n    return this.callApi<OAuthConsentInfo>({\n      type: Modules.OAuth,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  /**\n   * Approve the authorization request\n   * @returns Redirect URL with authorization code\n   */\n  static async approveAuthorization(params: OAuthConsentRequest): Promise<{ redirectUrl: string }> {\n    const result = await this.callApiWithMeta<unknown>({\n      type: Modules.OAuth,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({ endpoint: \"oauth/authorize/approve\" }).generate(),\n      input: {\n        client_id: params.clientId,\n        redirect_uri: params.redirectUri,\n        scope: params.scope,\n        state: params.state,\n        code_challenge: params.codeChallenge,\n        code_challenge_method: params.codeChallengeMethod,\n      },\n      overridesJsonApiCreation: true,\n    });\n\n    return {\n      redirectUrl: result.meta?.redirectUrl as string,\n    };\n  }\n\n  /**\n   * Deny the authorization request\n   * @returns Redirect URL with error=access_denied\n   */\n  static async denyAuthorization(params: OAuthConsentRequest): Promise<{ redirectUrl: string }> {\n    const result = await this.callApiWithMeta<unknown>({\n      type: Modules.OAuth,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({ endpoint: \"oauth/authorize/deny\" }).generate(),\n      input: {\n        client_id: params.clientId,\n        redirect_uri: params.redirectUri,\n        state: params.state,\n      },\n      overridesJsonApiCreation: true,\n    });\n\n    return {\n      redirectUrl: result.meta?.redirectUrl as string,\n    };\n  }\n}\n","import { ApiDataInterface } from \"../../../core\";\n\n/**\n * OAuth client application interface\n * Represents a registered OAuth application that can request access tokens\n */\nexport interface OAuthClientInterface extends ApiDataInterface {\n  /** The public client identifier (UUID format) */\n  get clientId(): string;\n  /** Human-readable application name */\n  get name(): string;\n  /** Optional description of the application */\n  get description(): string | undefined;\n  /** Array of allowed redirect URIs (exact match validation) */\n  get redirectUris(): string[];\n  /** Array of scopes this client can request */\n  get allowedScopes(): string[];\n  /** Supported grant types (authorization_code, client_credentials, refresh_token) */\n  get allowedGrantTypes(): string[];\n  /** True for server-side apps (can keep secret secure), false for mobile/desktop apps */\n  get isConfidential(): boolean;\n  /** Whether the client is currently active */\n  get isActive(): boolean;\n  /** When the client was created */\n  get createdAt(): Date;\n  /** When the client was last updated */\n  get updatedAt(): Date;\n}\n\n/**\n * Input type for OAuth client CRUD operations\n */\nexport type OAuthClientInput = {\n  id?: string;\n  name?: string;\n  description?: string;\n  redirectUris?: string[];\n  allowedScopes?: string[];\n  allowedGrantTypes?: string[];\n  isConfidential?: boolean;\n  isActive?: boolean;\n};\n\n/**\n * Request body for creating a new OAuth client\n */\nexport interface OAuthClientCreateRequest {\n  /** Required: Human-readable application name */\n  name: string;\n  /** Optional: Description of the application */\n  description?: string;\n  /** Required: At least one redirect URI */\n  redirectUris: string[];\n  /** Required: Array of scopes the client needs */\n  allowedScopes: string[];\n  /** Optional: Grant types (defaults to authorization_code + refresh_token) */\n  allowedGrantTypes?: string[];\n  /** Required: Whether this is a confidential client */\n  isConfidential: boolean;\n}\n\n/**\n * Response when creating a client (includes one-time secret)\n */\nexport interface OAuthClientCreateResponse {\n  client: OAuthClientInterface;\n  /** Only returned on creation - must be saved immediately */\n  clientSecret?: string;\n}\n\n/**\n * Parameters for the OAuth authorization consent flow\n * Passed via URL query parameters to the consent page\n */\nexport interface OAuthConsentRequest {\n  /** The client_id requesting authorization */\n  clientId: string;\n  /** Where to redirect after authorization */\n  redirectUri: string;\n  /**\n   * Space-separated list of requested scopes. Optional per RFC 6749 §3.3 —\n   * when omitted, the authorization server defaults to the client's\n   * registered scopes (MCP clients like Claude Code omit it).\n   */\n  scope?: string;\n  /** CSRF protection token (passed back on redirect) */\n  state?: string;\n  /** PKCE code challenge (required for public clients) */\n  codeChallenge?: string;\n  /** PKCE method: 'S256' (recommended) or 'plain' */\n  codeChallengeMethod?: string;\n}\n\n/**\n * Scope information for display in consent screen\n */\nexport interface OAuthScopeInfo {\n  /** The scope identifier (e.g., 'photographs:read') */\n  scope: string;\n  /** Human-readable scope name */\n  name: string;\n  /** Description of what this scope allows */\n  description: string;\n  /** Optional icon identifier */\n  icon?: string;\n}\n\n/**\n * Client info returned for consent screen display\n */\nexport interface OAuthConsentInfo {\n  client: OAuthClientInterface;\n  scopes: OAuthScopeInfo[];\n}\n\n/**\n * Default scope display configuration\n * Maps scope identifiers to human-readable info\n */\nexport const OAUTH_SCOPE_DISPLAY: Record<string, OAuthScopeInfo> = {\n  read: {\n    scope: \"read\",\n    name: \"Read Access\",\n    description: \"Read access to your data\",\n    icon: \"eye\",\n  },\n  write: {\n    scope: \"write\",\n    name: \"Write Access\",\n    description: \"Write access to your data\",\n    icon: \"pencil\",\n  },\n  \"photographs:read\": {\n    scope: \"photographs:read\",\n    name: \"View Photographs\",\n    description: \"Access and download your photo library\",\n    icon: \"image\",\n  },\n  \"photographs:write\": {\n    scope: \"photographs:write\",\n    name: \"Upload Photographs\",\n    description: \"Add new photos to your rolls\",\n    icon: \"upload\",\n  },\n  \"rolls:read\": {\n    scope: \"rolls:read\",\n    name: \"View Rolls\",\n    description: \"See your film rolls and collections\",\n    icon: \"film\",\n  },\n  \"rolls:write\": {\n    scope: \"rolls:write\",\n    name: \"Manage Rolls\",\n    description: \"Create and modify film rolls\",\n    icon: \"folder-plus\",\n  },\n  profile: {\n    scope: \"profile\",\n    name: \"View Profile\",\n    description: \"Access your name and email\",\n    icon: \"user\",\n  },\n  admin: {\n    scope: \"admin\",\n    name: \"Administrative Access\",\n    description: \"Full administrative access to your account\",\n    icon: \"shield\",\n  },\n};\n\n/**\n * Available scopes list for the scope selector\n */\nexport const AVAILABLE_OAUTH_SCOPES: OAuthScopeInfo[] = Object.values(OAUTH_SCOPE_DISPLAY);\n\n/**\n * Default grant types for new clients\n */\nexport const DEFAULT_GRANT_TYPES = [\"authorization_code\", \"refresh_token\"];\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { WaitlistInput, WaitlistInterface, WaitlistStatus } from \"./WaitlistInterface\";\n\nexport class Waitlist extends AbstractApiData implements WaitlistInterface {\n  private _email?: string;\n  private _gdprConsent: boolean = false;\n  private _gdprConsentAt?: string;\n  private _marketingConsent?: boolean;\n  private _marketingConsentAt?: string;\n  private _questionnaire?: string;\n  private _status: WaitlistStatus = \"pending\";\n  private _confirmedAt?: string;\n  private _invitedAt?: string;\n  private _registeredAt?: string;\n\n  get email(): string {\n    return this._email ?? \"\";\n  }\n\n  get gdprConsent(): boolean {\n    return this._gdprConsent;\n  }\n\n  get gdprConsentAt(): string {\n    return this._gdprConsentAt ?? \"\";\n  }\n\n  get marketingConsent(): boolean | undefined {\n    return this._marketingConsent;\n  }\n\n  get marketingConsentAt(): string | undefined {\n    return this._marketingConsentAt;\n  }\n\n  get questionnaire(): string | undefined {\n    return this._questionnaire;\n  }\n\n  get status(): WaitlistStatus {\n    return this._status;\n  }\n\n  get confirmedAt(): string | undefined {\n    return this._confirmedAt;\n  }\n\n  get invitedAt(): string | undefined {\n    return this._invitedAt;\n  }\n\n  get registeredAt(): string | undefined {\n    return this._registeredAt;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._email = data.jsonApi.attributes.email;\n    this._gdprConsent = data.jsonApi.attributes.gdprConsent;\n    this._gdprConsentAt = data.jsonApi.attributes.gdprConsentAt;\n    this._marketingConsent = data.jsonApi.attributes.marketingConsent;\n    this._marketingConsentAt = data.jsonApi.attributes.marketingConsentAt;\n    this._questionnaire = data.jsonApi.attributes.questionnaire;\n    this._status = data.jsonApi.attributes.status;\n    this._confirmedAt = data.jsonApi.attributes.confirmedAt;\n    this._invitedAt = data.jsonApi.attributes.invitedAt;\n    this._registeredAt = data.jsonApi.attributes.registeredAt;\n\n    return this;\n  }\n\n  createJsonApi(data: WaitlistInput) {\n    const response: any = {\n      data: {\n        type: Modules.Waitlist.name,\n        id: data.id,\n        attributes: {\n          email: data.email,\n          gdprConsent: data.gdprConsent,\n          gdprConsentAt: data.gdprConsentAt,\n        },\n        meta: {},\n        relationships: {},\n      },\n      included: [],\n    };\n\n    if (data.marketingConsent !== undefined) {\n      response.data.attributes.marketingConsent = data.marketingConsent;\n    }\n\n    if (data.marketingConsentAt !== undefined) {\n      response.data.attributes.marketingConsentAt = data.marketingConsentAt;\n    }\n\n    // JSON.stringify questionnaire for backend storage\n    if (data.questionnaire !== undefined) {\n      response.data.attributes.questionnaire = JSON.stringify(data.questionnaire);\n    }\n\n    return response;\n  }\n}\n","import { AbstractService, EndpointCreator, HttpMethod, Modules, NextRef, PreviousRef } from \"../../../core\";\nimport { InviteValidation, WaitlistInput, WaitlistInterface } from \"./WaitlistInterface\";\nimport { WaitlistStatsInterface } from \"./waitlist-stats.interface\";\n\nexport class WaitlistService extends AbstractService {\n  /**\n   * Submit to waitlist (public)\n   * Uses Waitlist.createJsonApi() to transform WaitlistInput to JSON:API format\n   */\n  static async submit(params: WaitlistInput): Promise<WaitlistInterface> {\n    return this.callApi<WaitlistInterface>({\n      type: Modules.Waitlist,\n      method: HttpMethod.POST,\n      endpoint: new EndpointCreator({ endpoint: Modules.Waitlist }).generate(),\n      input: params,\n    });\n  }\n\n  /**\n   * Confirm email (public)\n   */\n  static async confirm(code: string): Promise<WaitlistInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.Waitlist,\n      childEndpoint: \"confirm\",\n      childId: code,\n    });\n\n    return this.callApi<WaitlistInterface>({\n      type: Modules.Waitlist,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  /**\n   * List all waitlist entries (admin)\n   * Uses cursor-based pagination with NextRef/PreviousRef\n   */\n  static async findMany(params?: {\n    status?: string;\n    search?: string;\n    fetchAll?: boolean;\n    next?: NextRef;\n    prev?: PreviousRef;\n  }): Promise<WaitlistInterface[]> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.Waitlist });\n\n    if (params?.status) endpoint.addAdditionalParam(\"status\", params.status);\n    if (params?.search) endpoint.addAdditionalParam(\"search\", params.search);\n    if (params?.fetchAll) endpoint.addAdditionalParam(\"fetchAll\", \"true\");\n\n    return this.callApi<WaitlistInterface[]>({\n      type: Modules.Waitlist,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params?.next,\n      previous: params?.prev,\n    });\n  }\n\n  /**\n   * Send invite (admin)\n   */\n  static async invite(id: string): Promise<WaitlistInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.Waitlist,\n      id,\n      childEndpoint: \"invite\",\n    });\n\n    return this.callApi<WaitlistInterface>({\n      type: Modules.Waitlist,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  /**\n   * Batch invite (admin)\n   * Non-standard batch operation - uses custom JSON:API format\n   */\n  static async inviteBatch(ids: string[]): Promise<{ invited: number; failed: number }> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.Waitlist,\n      childEndpoint: \"invite-batch\",\n    });\n\n    return this.callApi({\n      type: Modules.Waitlist,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n      input: {\n        data: {\n          type: \"waitlist-batch-invites\",\n          attributes: { ids },\n        },\n      },\n      overridesJsonApiCreation: true,\n    });\n  }\n\n  /**\n   * Get statistics (admin)\n   */\n  static async getStats(): Promise<WaitlistStatsInterface> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.WaitlistStats,\n    });\n\n    return this.callApi<WaitlistStatsInterface>({\n      type: Modules.WaitlistStats,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  /**\n   * Validate invite code (public) - calls auth endpoint\n   */\n  static async validateInvite(code: string): Promise<InviteValidation | null> {\n    try {\n      const endpoint = new EndpointCreator({\n        endpoint: Modules.Waitlist,\n        childEndpoint: \"invite\",\n        childId: code,\n      });\n\n      const response = await this.callApiWithMeta<any>({\n        type: Modules.Auth,\n        method: HttpMethod.GET,\n        endpoint: endpoint.generate(),\n      });\n\n      // Response structure: data._jsonApi.attributes contains the actual values\n      const attributes = response.data?._jsonApi?.attributes;\n\n      return {\n        email: attributes?.email,\n        valid: attributes?.valid ?? false,\n      };\n    } catch (_error) {\n      return null;\n    }\n  }\n}\n","import { AbstractApiData, JsonApiHydratedDataInterface } from \"../../../core\";\nimport { WaitlistStatsInterface } from \"./waitlist-stats.interface\";\n\nexport class WaitlistStats extends AbstractApiData implements WaitlistStatsInterface {\n  private _pending: number = 0;\n  private _confirmed: number = 0;\n  private _invited: number = 0;\n  private _registered: number = 0;\n  private _total: number = 0;\n\n  get pending(): number {\n    return this._pending;\n  }\n\n  get confirmed(): number {\n    return this._confirmed;\n  }\n\n  get invited(): number {\n    return this._invited;\n  }\n\n  get registered(): number {\n    return this._registered;\n  }\n\n  get total(): number {\n    return this._total;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    const attrs = data.jsonApi.attributes;\n    this._pending = attrs.pending ?? 0;\n    this._confirmed = attrs.confirmed ?? 0;\n    this._invited = attrs.invited ?? 0;\n    this._registered = attrs.registered ?? 0;\n    this._total = attrs.total ?? 0;\n\n    return this;\n  }\n\n  createJsonApi(_data?: any): any {\n    throw new Error(\"WaitlistStats is read-only and cannot be created\");\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { Waitlist } from \"./data/Waitlist\";\n\nexport const WaitlistModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"waitlists\",\n    pageUrl: \"/waitlists\",\n    model: Waitlist,\n  });\n","import { ModuleFactory } from \"../../permissions\";\nimport { WaitlistStats } from \"./data/waitlist-stats\";\n\nexport const WaitlistStatsModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"waitlist-stats\",\n    pageUrl: \"/waitlist-stats\",\n    model: WaitlistStats,\n  });\n","import { AbstractApiData, JsonApiHydratedDataInterface } from \"../../../core\";\nimport { PermissionMappingInterface } from \"./PermissionMappingInterface\";\n\nexport class PermissionMapping extends AbstractApiData implements PermissionMappingInterface {\n  private _roleId?: string;\n  private _moduleId?: string;\n  private _permissions?: {\n    create?: boolean | string;\n    read?: boolean | string;\n    update?: boolean | string;\n    delete?: boolean | string;\n  };\n\n  get roleId(): string {\n    if (!this._roleId) throw new Error(\"JsonApi error: permission mapping roleId is missing\");\n    return this._roleId;\n  }\n\n  get moduleId(): string {\n    if (!this._moduleId) throw new Error(\"JsonApi error: permission mapping moduleId is missing\");\n    return this._moduleId;\n  }\n\n  get permissions(): {\n    create?: boolean | string;\n    read?: boolean | string;\n    update?: boolean | string;\n    delete?: boolean | string;\n  } {\n    if (!this._permissions) throw new Error(\"JsonApi error: permission mapping permissions is missing\");\n    return this._permissions;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._roleId = data.jsonApi.attributes.roleId;\n    this._moduleId = data.jsonApi.attributes.moduleId;\n    this._permissions = data.jsonApi.meta?.permissions;\n\n    return this;\n  }\n}\n","import { AbstractApiData, JsonApiHydratedDataInterface } from \"../../../core\";\nimport { ModulePathsInterface } from \"./ModulePathsInterface\";\n\nexport class ModulePaths extends AbstractApiData implements ModulePathsInterface {\n  private _moduleId?: string;\n  private _paths?: string[];\n\n  get moduleId(): string {\n    if (!this._moduleId) throw new Error(\"JsonApi error: module paths moduleId is missing\");\n    return this._moduleId;\n  }\n\n  get paths(): string[] {\n    return this._paths ?? [];\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._moduleId = data.jsonApi.attributes.moduleId;\n    this._paths = data.jsonApi.attributes.paths;\n\n    return this;\n  }\n}\n","import { AbstractApiData, JsonApiHydratedDataInterface } from \"../../../core\";\nimport type { RbacMatrix } from \"./RbacTypes\";\n\n/**\n * Input shape accepted by `RbacMatrixModel.createJsonApi()` for a PUT request\n * to the dev matrix endpoint.\n */\nexport interface RbacMatrixInput {\n  matrix: RbacMatrix;\n  roleNames: Record<string, string>;\n  moduleNames: Record<string, string>;\n  outputPath: string;\n}\n\n/**\n * Frontend model for the dev-only `rbac-matrix` JSON:API resource.\n *\n * Backend contract (see `rbac-dev.controller.ts`):\n *  - `GET /_dev/rbac/matrix` → `{ data: { type: \"rbac-matrix\", id: \"singleton\",\n *      attributes: { matrix } } }`\n *  - `PUT /_dev/rbac/matrix` body: `{ data: { type: \"rbac-matrix\", attributes:\n *      { matrix, roleNames, moduleNames, outputPath } } }`\n *    → `{ data: { type: \"rbac-matrix\", id: \"singleton\", attributes: { bytesWritten, path } } }`\n *\n * The resource is a singleton (`id: \"singleton\"`) so there is no collection\n * listing; the \"read\" and \"write\" shapes share a single model with optional\n * fields populated depending on which endpoint produced the response.\n */\nexport class RbacMatrixModel extends AbstractApiData {\n  private _matrix?: RbacMatrix;\n  private _modulePaths?: Record<string, readonly string[]>;\n  private _bytesWritten?: number;\n  private _path?: string;\n\n  /** The RBAC matrix object (populated after a GET). */\n  get matrix(): RbacMatrix | undefined {\n    return this._matrix;\n  }\n\n  /**\n   * UUID-keyed map of each module's known BFS relationship paths (populated\n   * after a GET). Fed to the permission picker as scope suggestions.\n   */\n  get modulePaths(): Record<string, readonly string[]> | undefined {\n    return this._modulePaths;\n  }\n\n  /** Bytes written to the permissions.ts file (populated after a PUT). */\n  get bytesWritten(): number | undefined {\n    return this._bytesWritten;\n  }\n\n  /** Resolved absolute output path (populated after a PUT). */\n  get path(): string | undefined {\n    return this._path;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    const attrs = data.jsonApi.attributes ?? {};\n    this._matrix = attrs.matrix;\n    this._modulePaths = attrs.modulePaths;\n    this._bytesWritten = attrs.bytesWritten;\n    this._path = attrs.path;\n\n    return this;\n  }\n\n  createJsonApi(data: RbacMatrixInput): any {\n    return {\n      data: {\n        type: \"rbac-matrix\",\n        id: \"singleton\",\n        attributes: {\n          matrix: data.matrix,\n          roleNames: data.roleNames,\n          moduleNames: data.moduleNames,\n          outputPath: data.outputPath,\n        },\n      },\n    };\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { PermissionMapping } from \"./data/PermissionMapping\";\nimport { ModulePaths } from \"./data/ModulePaths\";\nimport { RbacMatrixModel } from \"./data/RbacMatrixModel\";\n\nexport const PermissionMappingModule = (factory: ModuleFactory) =>\n  factory({\n    pageUrl: \"/rbac/permission-mappings\",\n    name: \"rbac/permission-mappings\",\n    model: PermissionMapping,\n    moduleId: \"f3aef019-c75f-4ca8-a9b5-a7495d901fc8\",\n  });\n\nexport const ModulePathsModule = (factory: ModuleFactory) =>\n  factory({\n    pageUrl: \"/rbac/module-paths\",\n    name: \"rbac/module-paths\",\n    model: ModulePaths,\n    moduleId: \"f4fb3f01-a947-4c2e-89c8-354a518cdb13\",\n  });\n\n/**\n * Dev-only matrix module. The `name` is the URL path of the dev singleton\n * endpoint (`GET|PUT _dev/rbac/matrix`), NOT a plural resource collection.\n * This module is only useful when the backend is running with `devMode: true`\n * on `RbacModule.register`.\n */\nexport const RbacMatrixModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"_dev/rbac/matrix\",\n    model: RbacMatrixModel,\n  });\n","import { AbstractApiData } from \"../../../core\";\nimport { JsonApiHydratedDataInterface } from \"../../../core/interfaces/JsonApiHydratedDataInterface\";\nimport { ReferralStatsInterface } from \"../interfaces\";\n\nexport class ReferralStats extends AbstractApiData implements ReferralStatsInterface {\n  private _referralCode?: string;\n  private _completedReferrals?: number;\n  private _totalTokensEarned?: number;\n\n  get referralCode(): string {\n    return this._referralCode ?? \"\";\n  }\n  get completedReferrals(): number {\n    return this._completedReferrals ?? 0;\n  }\n  get totalTokensEarned(): number {\n    return this._totalTokensEarned ?? 0;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n    this._referralCode = data.jsonApi.attributes.referralCode;\n    this._completedReferrals = data.jsonApi.attributes.completedReferrals;\n    this._totalTokensEarned = data.jsonApi.attributes.totalTokensEarned;\n    return this;\n  }\n\n  createJsonApi() {\n    return {};\n  }\n}\n","import { AbstractService, HttpMethod } from \"../../../core\";\nimport { EndpointCreator } from \"../../../core\";\nimport { Modules } from \"../../../core\";\n\nimport { ReferralStatsInterface } from \"../interfaces\";\n\nexport class ReferralService extends AbstractService {\n  /**\n   * Get referral stats for the current company.\n   * Returns deserialized attributes from JSON:API response.\n   */\n  static async getMyReferralStats(): Promise<ReferralStatsInterface> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.Referral, id: \"stats\" });\n\n    return this.callApi<ReferralStatsInterface>({\n      type: Modules.ReferralStats,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n    });\n  }\n\n  /**\n   * Send a referral invitation email.\n   * Uses overridesJsonApiCreation since the endpoint accepts a simple JSON body, not JSON:API format.\n   * Returns 204 No Content on success.\n   */\n  static async sendReferralEmail(email: string): Promise<void> {\n    const endpoint = new EndpointCreator({ endpoint: Modules.Referral, id: \"invite\" });\n\n    await this.callApi<void>({\n      type: Modules.Referral,\n      method: HttpMethod.POST,\n      endpoint: endpoint.generate(),\n      input: { email },\n      overridesJsonApiCreation: true,\n    });\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { ReferralService } from \"./data/ReferralService\";\n\nexport const ReferralModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"referrals\",\n    pageUrl: \"/referrals\",\n    model: ReferralService,\n  });\n","import { ModuleFactory } from \"../../permissions\";\nimport { ReferralStats } from \"./data/ReferralStats\";\n\nexport const ReferralStatsModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"referral-stats\",\n    pageUrl: \"/referral-stats\",\n    model: ReferralStats,\n  });\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { TokenUsageAdminBreakdownInterface } from \"./tokenusage-admin-breakdown.interface\";\nimport { TokenUsageAdminBreakdownInput } from \"./tokenusage-admin.types\";\n\n/**\n * One ranked row of a breakdown. The same shape serves all three dimensions —\n * company, user and operation — which is why the three \"by-X\" views collapse\n * into a single `breakdown?dimension=` call.\n *\n * `activeUsers` / `monthlyCredits` / `availableMonthlyCredits` are populated only\n * for `dimension=company`; they are absent on user and operation rows.\n */\nexport class TokenUsageAdminBreakdown extends AbstractApiData implements TokenUsageAdminBreakdownInterface {\n  private _label: string = \"\";\n  private _sublabel?: string;\n  private _cost: number = 0;\n  private _credits: number = 0;\n  private _tokensIn: number = 0;\n  private _tokensOut: number = 0;\n  private _cached: number = 0;\n  private _calls: number = 0;\n  private _activeUsers?: number;\n  private _monthlyCredits?: number;\n  private _availableMonthlyCredits?: number;\n\n  get label(): string {\n    return this._label;\n  }\n\n  get sublabel(): string | undefined {\n    return this._sublabel;\n  }\n\n  get cost(): number {\n    return this._cost;\n  }\n\n  get credits(): number {\n    return this._credits;\n  }\n\n  get tokensIn(): number {\n    return this._tokensIn;\n  }\n\n  get tokensOut(): number {\n    return this._tokensOut;\n  }\n\n  get cached(): number {\n    return this._cached;\n  }\n\n  get calls(): number {\n    return this._calls;\n  }\n\n  get activeUsers(): number | undefined {\n    return this._activeUsers;\n  }\n\n  get monthlyCredits(): number | undefined {\n    return this._monthlyCredits;\n  }\n\n  get availableMonthlyCredits(): number | undefined {\n    return this._availableMonthlyCredits;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    const attrs = data.jsonApi.attributes;\n    this._label = attrs.label ?? \"\";\n    this._sublabel = attrs.sublabel ?? undefined;\n    this._cost = attrs.cost ?? 0;\n    this._credits = attrs.credits ?? 0;\n    this._tokensIn = attrs.tokensIn ?? 0;\n    this._tokensOut = attrs.tokensOut ?? 0;\n    this._cached = attrs.cached ?? 0;\n    this._calls = attrs.calls ?? 0;\n    this._activeUsers = attrs.activeUsers ?? undefined;\n    this._monthlyCredits = attrs.monthlyCredits ?? undefined;\n    this._availableMonthlyCredits = attrs.availableMonthlyCredits ?? undefined;\n\n    return this;\n  }\n\n  createJsonApi(data: TokenUsageAdminBreakdownInput) {\n    const response: any = {\n      data: {\n        type: Modules.TokenUsageAdminBreakdown.name,\n        id: data.id,\n        attributes: {},\n        relationships: {},\n      },\n      included: [],\n    };\n\n    if (data.label !== undefined) response.data.attributes.label = data.label;\n    if (data.sublabel !== undefined) response.data.attributes.sublabel = data.sublabel;\n    if (data.cost !== undefined) response.data.attributes.cost = data.cost;\n    if (data.credits !== undefined) response.data.attributes.credits = data.credits;\n    if (data.tokensIn !== undefined) response.data.attributes.tokensIn = data.tokensIn;\n    if (data.tokensOut !== undefined) response.data.attributes.tokensOut = data.tokensOut;\n    if (data.cached !== undefined) response.data.attributes.cached = data.cached;\n    if (data.calls !== undefined) response.data.attributes.calls = data.calls;\n    if (data.activeUsers !== undefined) response.data.attributes.activeUsers = data.activeUsers;\n    if (data.monthlyCredits !== undefined) response.data.attributes.monthlyCredits = data.monthlyCredits;\n    if (data.availableMonthlyCredits !== undefined)\n      response.data.attributes.availableMonthlyCredits = data.availableMonthlyCredits;\n\n    return response;\n  }\n}\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { TokenUsageAdminSummaryInterface } from \"./tokenusage-admin-summary.interface\";\nimport { TokenUsageAdminSummaryInput } from \"./tokenusage-admin.types\";\n\n/**\n * One row of the administrative summary: a cost centre observed over one time\n * window. Six rows are returned per request — scope crossed with window — so the\n * KPI tiles can render a value and its delta without a second call.\n */\nexport class TokenUsageAdminSummary extends AbstractApiData implements TokenUsageAdminSummaryInterface {\n  private _scope: string = \"\";\n  private _window: string = \"\";\n  private _cost: number = 0;\n  private _credits: number = 0;\n  private _tokensIn: number = 0;\n  private _tokensOut: number = 0;\n  private _cached: number = 0;\n  private _calls: number = 0;\n\n  get scope(): string {\n    return this._scope;\n  }\n\n  get window(): string {\n    return this._window;\n  }\n\n  get cost(): number {\n    return this._cost;\n  }\n\n  get credits(): number {\n    return this._credits;\n  }\n\n  get tokensIn(): number {\n    return this._tokensIn;\n  }\n\n  get tokensOut(): number {\n    return this._tokensOut;\n  }\n\n  get cached(): number {\n    return this._cached;\n  }\n\n  get calls(): number {\n    return this._calls;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    const attrs = data.jsonApi.attributes;\n    this._scope = attrs.scope ?? \"\";\n    this._window = attrs.window ?? \"\";\n    this._cost = attrs.cost ?? 0;\n    this._credits = attrs.credits ?? 0;\n    this._tokensIn = attrs.tokensIn ?? 0;\n    this._tokensOut = attrs.tokensOut ?? 0;\n    this._cached = attrs.cached ?? 0;\n    this._calls = attrs.calls ?? 0;\n\n    return this;\n  }\n\n  createJsonApi(data: TokenUsageAdminSummaryInput) {\n    const response: any = {\n      data: {\n        type: Modules.TokenUsageAdminSummary.name,\n        id: data.id,\n        attributes: {},\n        relationships: {},\n      },\n      included: [],\n    };\n\n    if (data.scope !== undefined) response.data.attributes.scope = data.scope;\n    if (data.window !== undefined) response.data.attributes.window = data.window;\n    if (data.cost !== undefined) response.data.attributes.cost = data.cost;\n    if (data.credits !== undefined) response.data.attributes.credits = data.credits;\n    if (data.tokensIn !== undefined) response.data.attributes.tokensIn = data.tokensIn;\n    if (data.tokensOut !== undefined) response.data.attributes.tokensOut = data.tokensOut;\n    if (data.cached !== undefined) response.data.attributes.cached = data.cached;\n    if (data.calls !== undefined) response.data.attributes.calls = data.calls;\n\n    return response;\n  }\n}\n","import { AbstractApiData, formatLocalDate, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { TokenUsageAdminTimelineInterface } from \"./tokenusage-admin-timeline.interface\";\nimport { TokenUsageAdminTimelineInput } from \"./tokenusage-admin.types\";\n\n/**\n * One (bucket, series) cell of the usage-over-time chart. Rows arrive flat; the\n * chart pivots them into stacked columns.\n */\nexport class TokenUsageAdminTimeline extends AbstractApiData implements TokenUsageAdminTimelineInterface {\n  private _bucket: Date = new Date(0);\n  private _series: string = \"\";\n  private _cost: number = 0;\n  private _credits: number = 0;\n  private _tokensIn: number = 0;\n  private _tokensOut: number = 0;\n  private _cached: number = 0;\n  private _calls: number = 0;\n\n  get bucket(): Date {\n    return this._bucket;\n  }\n\n  get series(): string {\n    return this._series;\n  }\n\n  get cost(): number {\n    return this._cost;\n  }\n\n  get credits(): number {\n    return this._credits;\n  }\n\n  get tokensIn(): number {\n    return this._tokensIn;\n  }\n\n  get tokensOut(): number {\n    return this._tokensOut;\n  }\n\n  get cached(): number {\n    return this._cached;\n  }\n\n  get calls(): number {\n    return this._calls;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    const attrs = data.jsonApi.attributes;\n    // Wire format is \"YYYY-MM-DD\"; the interface promises a Date.\n    this._bucket = attrs.bucket ? new Date(attrs.bucket) : new Date(0);\n    this._series = attrs.series ?? \"\";\n    this._cost = attrs.cost ?? 0;\n    this._credits = attrs.credits ?? 0;\n    this._tokensIn = attrs.tokensIn ?? 0;\n    this._tokensOut = attrs.tokensOut ?? 0;\n    this._cached = attrs.cached ?? 0;\n    this._calls = attrs.calls ?? 0;\n\n    return this;\n  }\n\n  createJsonApi(data: TokenUsageAdminTimelineInput) {\n    const response: any = {\n      data: {\n        type: Modules.TokenUsageAdminTimeline.name,\n        id: data.id,\n        attributes: {},\n        relationships: {},\n      },\n      included: [],\n    };\n\n    // `bucket` is type: \"date\" on the backend descriptor. formatLocalDate is\n    // mandatory — passing the raw Date lets JSON.stringify call .toISOString(),\n    // which UTC-shifts and can move the bucket a day. Imported from the package\n    // core, never reimplemented inline.\n    if (data.bucket !== undefined) response.data.attributes.bucket = formatLocalDate(data.bucket);\n    if (data.series !== undefined) response.data.attributes.series = data.series;\n    if (data.cost !== undefined) response.data.attributes.cost = data.cost;\n    if (data.credits !== undefined) response.data.attributes.credits = data.credits;\n    if (data.tokensIn !== undefined) response.data.attributes.tokensIn = data.tokensIn;\n    if (data.tokensOut !== undefined) response.data.attributes.tokensOut = data.tokensOut;\n    if (data.cached !== undefined) response.data.attributes.cached = data.cached;\n    if (data.calls !== undefined) response.data.attributes.calls = data.calls;\n\n    return response;\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { TokenUsageAdminBreakdown } from \"./data/tokenusage-admin-breakdown\";\nimport { TokenUsageAdminSummary } from \"./data/tokenusage-admin-summary\";\nimport { TokenUsageAdminTimeline } from \"./data/tokenusage-admin-timeline\";\n\n/**\n * Read-only reporting resources behind the administrative token-usage page.\n * `name` is the endpoint path EndpointCreator builds URLs from; there is no\n * pageUrl because these are not navigable resources.\n *\n * Distinct from the consuming app's own TokenUsage module (name \"tokenusages\",\n * pageUrl \"/tokenusage\") — that one is an AppModuleDefinitions entry the package\n * cannot reference, which is why these three exist.\n *\n * PREFER `tokenUsageModules(factory)` from `./tokenusage.modules` — it returns\n * these three plus the three self-service report modules as one spreadable\n * object. These individual factories are kept for backward compatibility.\n */\nexport const TokenUsageAdminSummaryModule = (factory: ModuleFactory) =>\n  factory({ name: \"tokenusages/administration/summary\", model: TokenUsageAdminSummary });\n\nexport const TokenUsageAdminTimelineModule = (factory: ModuleFactory) =>\n  factory({ name: \"tokenusages/administration/timeline\", model: TokenUsageAdminTimeline });\n\nexport const TokenUsageAdminBreakdownModule = (factory: ModuleFactory) =>\n  factory({ name: \"tokenusages/administration/breakdown\", model: TokenUsageAdminBreakdown });\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { TokenUsageReportBreakdownInterface } from \"./tokenusage-report-breakdown.interface\";\nimport { TokenUsageReportBreakdownInput } from \"./tokenusage-report.types\";\n\n/**\n * One ranked row of a self-service breakdown. The same shape serves both\n * dimensions — operation and target — which is why the two \"by-X\" panels\n * collapse into a single `breakdown?dimension=` call.\n *\n * Deliberately narrower than the administrative row: no `activeUsers`,\n * `monthlyCredits` or `availableMonthlyCredits`, which are company-fleet\n * figures a single company has no business seeing.\n */\nexport class TokenUsageReportBreakdown extends AbstractApiData implements TokenUsageReportBreakdownInterface {\n  private _label: string = \"\";\n  private _sublabel?: string;\n  private _cost: number = 0;\n  private _credits: number = 0;\n  private _tokensIn: number = 0;\n  private _tokensOut: number = 0;\n  private _cached: number = 0;\n  private _calls: number = 0;\n\n  get label(): string {\n    return this._label;\n  }\n\n  get sublabel(): string | undefined {\n    return this._sublabel;\n  }\n\n  get cost(): number {\n    return this._cost;\n  }\n\n  get credits(): number {\n    return this._credits;\n  }\n\n  get tokensIn(): number {\n    return this._tokensIn;\n  }\n\n  get tokensOut(): number {\n    return this._tokensOut;\n  }\n\n  get cached(): number {\n    return this._cached;\n  }\n\n  get calls(): number {\n    return this._calls;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    const attrs = data.jsonApi.attributes;\n    this._label = attrs.label ?? \"\";\n    this._sublabel = attrs.sublabel ?? undefined;\n    this._cost = attrs.cost ?? 0;\n    this._credits = attrs.credits ?? 0;\n    this._tokensIn = attrs.tokensIn ?? 0;\n    this._tokensOut = attrs.tokensOut ?? 0;\n    this._cached = attrs.cached ?? 0;\n    this._calls = attrs.calls ?? 0;\n\n    return this;\n  }\n\n  createJsonApi(data: TokenUsageReportBreakdownInput) {\n    const response: any = {\n      data: {\n        type: Modules.TokenUsageReportBreakdown.name,\n        id: data.id,\n        attributes: {},\n        relationships: {},\n      },\n      included: [],\n    };\n\n    if (data.label !== undefined) response.data.attributes.label = data.label;\n    if (data.sublabel !== undefined) response.data.attributes.sublabel = data.sublabel;\n    if (data.cost !== undefined) response.data.attributes.cost = data.cost;\n    if (data.credits !== undefined) response.data.attributes.credits = data.credits;\n    if (data.tokensIn !== undefined) response.data.attributes.tokensIn = data.tokensIn;\n    if (data.tokensOut !== undefined) response.data.attributes.tokensOut = data.tokensOut;\n    if (data.cached !== undefined) response.data.attributes.cached = data.cached;\n    if (data.calls !== undefined) response.data.attributes.calls = data.calls;\n\n    return response;\n  }\n}\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { TokenUsageReportSummaryInterface } from \"./tokenusage-report-summary.interface\";\nimport { TokenUsageReportSummaryInput } from \"./tokenusage-report.types\";\n\n/**\n * One row of the self-service summary: the caller's own company observed over\n * one time window. Two rows are returned per request — \"current\" and the\n * equal-length \"previous\" span — so the KPI tiles can render a value and its\n * delta without a second call.\n *\n * There is no `scope` here: a company only ever sees itself, so the\n * customer/platform split that the administrative summary carries is absent.\n */\nexport class TokenUsageReportSummary extends AbstractApiData implements TokenUsageReportSummaryInterface {\n  private _window: string = \"\";\n  private _cost: number = 0;\n  private _credits: number = 0;\n  private _tokensIn: number = 0;\n  private _tokensOut: number = 0;\n  private _cached: number = 0;\n  private _calls: number = 0;\n\n  get window(): string {\n    return this._window;\n  }\n\n  get cost(): number {\n    return this._cost;\n  }\n\n  get credits(): number {\n    return this._credits;\n  }\n\n  get tokensIn(): number {\n    return this._tokensIn;\n  }\n\n  get tokensOut(): number {\n    return this._tokensOut;\n  }\n\n  get cached(): number {\n    return this._cached;\n  }\n\n  get calls(): number {\n    return this._calls;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    const attrs = data.jsonApi.attributes;\n    this._window = attrs.window ?? \"\";\n    this._cost = attrs.cost ?? 0;\n    this._credits = attrs.credits ?? 0;\n    this._tokensIn = attrs.tokensIn ?? 0;\n    this._tokensOut = attrs.tokensOut ?? 0;\n    this._cached = attrs.cached ?? 0;\n    this._calls = attrs.calls ?? 0;\n\n    return this;\n  }\n\n  createJsonApi(data: TokenUsageReportSummaryInput) {\n    const response: any = {\n      data: {\n        type: Modules.TokenUsageReportSummary.name,\n        id: data.id,\n        attributes: {},\n        relationships: {},\n      },\n      included: [],\n    };\n\n    if (data.window !== undefined) response.data.attributes.window = data.window;\n    if (data.cost !== undefined) response.data.attributes.cost = data.cost;\n    if (data.credits !== undefined) response.data.attributes.credits = data.credits;\n    if (data.tokensIn !== undefined) response.data.attributes.tokensIn = data.tokensIn;\n    if (data.tokensOut !== undefined) response.data.attributes.tokensOut = data.tokensOut;\n    if (data.cached !== undefined) response.data.attributes.cached = data.cached;\n    if (data.calls !== undefined) response.data.attributes.calls = data.calls;\n\n    return response;\n  }\n}\n","import { AbstractApiData, formatLocalDate, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { TokenUsageReportTimelineInterface } from \"./tokenusage-report-timeline.interface\";\nimport { TokenUsageReportTimelineInput } from \"./tokenusage-report.types\";\n\n/**\n * One (bucket, series) cell of the self-service usage-over-time chart. Rows\n * arrive flat; the chart pivots them into stacked columns.\n */\nexport class TokenUsageReportTimeline extends AbstractApiData implements TokenUsageReportTimelineInterface {\n  private _bucket: Date = new Date(0);\n  private _series: string = \"\";\n  private _cost: number = 0;\n  private _credits: number = 0;\n  private _tokensIn: number = 0;\n  private _tokensOut: number = 0;\n  private _cached: number = 0;\n  private _calls: number = 0;\n\n  get bucket(): Date {\n    return this._bucket;\n  }\n\n  get series(): string {\n    return this._series;\n  }\n\n  get cost(): number {\n    return this._cost;\n  }\n\n  get credits(): number {\n    return this._credits;\n  }\n\n  get tokensIn(): number {\n    return this._tokensIn;\n  }\n\n  get tokensOut(): number {\n    return this._tokensOut;\n  }\n\n  get cached(): number {\n    return this._cached;\n  }\n\n  get calls(): number {\n    return this._calls;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    const attrs = data.jsonApi.attributes;\n    // Wire format is \"YYYY-MM-DD\"; the interface promises a Date.\n    this._bucket = attrs.bucket ? new Date(attrs.bucket) : new Date(0);\n    this._series = attrs.series ?? \"\";\n    this._cost = attrs.cost ?? 0;\n    this._credits = attrs.credits ?? 0;\n    this._tokensIn = attrs.tokensIn ?? 0;\n    this._tokensOut = attrs.tokensOut ?? 0;\n    this._cached = attrs.cached ?? 0;\n    this._calls = attrs.calls ?? 0;\n\n    return this;\n  }\n\n  createJsonApi(data: TokenUsageReportTimelineInput) {\n    const response: any = {\n      data: {\n        type: Modules.TokenUsageReportTimeline.name,\n        id: data.id,\n        attributes: {},\n        relationships: {},\n      },\n      included: [],\n    };\n\n    // `bucket` is type: \"date\" on the backend descriptor. formatLocalDate is\n    // mandatory — passing the raw Date lets JSON.stringify call .toISOString(),\n    // which UTC-shifts and can move the bucket a day. Imported from the package\n    // core, never reimplemented inline.\n    if (data.bucket !== undefined) response.data.attributes.bucket = formatLocalDate(data.bucket);\n    if (data.series !== undefined) response.data.attributes.series = data.series;\n    if (data.cost !== undefined) response.data.attributes.cost = data.cost;\n    if (data.credits !== undefined) response.data.attributes.credits = data.credits;\n    if (data.tokensIn !== undefined) response.data.attributes.tokensIn = data.tokensIn;\n    if (data.tokensOut !== undefined) response.data.attributes.tokensOut = data.tokensOut;\n    if (data.cached !== undefined) response.data.attributes.cached = data.cached;\n    if (data.calls !== undefined) response.data.attributes.calls = data.calls;\n\n    return response;\n  }\n}\n","import { ModuleFactory, ModuleWithPermissions } from \"../../permissions\";\nimport { TokenUsageAdminBreakdown } from \"./data/tokenusage-admin-breakdown\";\nimport { TokenUsageAdminSummary } from \"./data/tokenusage-admin-summary\";\nimport { TokenUsageAdminTimeline } from \"./data/tokenusage-admin-timeline\";\nimport { TokenUsageReportBreakdown } from \"./data/tokenusage-report-breakdown\";\nimport { TokenUsageReportSummary } from \"./data/tokenusage-report-summary\";\nimport { TokenUsageReportTimeline } from \"./data/tokenusage-report-timeline\";\n\n/**\n * Every read-only reporting resource behind the two token-usage pages, as one\n * object a consuming app spreads into its `allModules`.\n *\n * A bundle rather than six separate factories because registration is the APP'S\n * job — `allModules` is also the source of `AllModuleDefinitions` and what\n * `DataClassRegistry.bootstrap()` reads, so the package cannot self-register.\n * Six names is six chances to forget one, and a forgotten name is not a compile\n * error: `FoundationModuleDefinitions` declares them all, so `Modules.X`\n * typechecks and is `undefined` at runtime. One spread cannot be partially done.\n *\n * `name` is the endpoint path EndpointCreator builds URLs from. None has a\n * pageUrl — these are not navigable resources.\n *\n * The return type is the six named keys, NOT `Record<string,\n * ModuleWithPermissions>`: the consuming app derives `AllModuleDefinitions`\n * from `typeof allModules`, so spreading an index-signature type in would give\n * that object a string index signature and make every `Modules.<anything>`\n * lookup typecheck. `satisfies` keeps the constraint without widening.\n */\nexport const tokenUsageModules = (factory: ModuleFactory) =>\n  ({\n    TokenUsageAdminSummary: factory({ name: \"tokenusages/administration/summary\", model: TokenUsageAdminSummary }),\n    TokenUsageAdminTimeline: factory({ name: \"tokenusages/administration/timeline\", model: TokenUsageAdminTimeline }),\n    TokenUsageAdminBreakdown: factory({\n      name: \"tokenusages/administration/breakdown\",\n      model: TokenUsageAdminBreakdown,\n    }),\n    TokenUsageReportSummary: factory({ name: \"tokenusages/reports/summary\", model: TokenUsageReportSummary }),\n    TokenUsageReportTimeline: factory({ name: \"tokenusages/reports/timeline\", model: TokenUsageReportTimeline }),\n    TokenUsageReportBreakdown: factory({ name: \"tokenusages/reports/breakdown\", model: TokenUsageReportBreakdown }),\n  }) satisfies Record<string, ModuleWithPermissions>;\n","/**\n * The currency the token-usage surfaces render monetary values in.\n *\n * The package cannot infer this: the figures come from whatever per-million-token\n * rates the consuming app configured, and those are denominated in whatever\n * currency that app buys inference in — EUR for one consumer, USD for another\n * whose rates are OpenRouter list prices. So the app declares it once at\n * bootstrap, next to configureJsonApi().\n *\n * EUR is the default purely for backward compatibility: the previous\n * implementation hard-coded a euro sign, so an app that never calls this keeps\n * rendering exactly what it rendered before.\n */\nlet currency = \"EUR\";\n\nexport function configureTokenUsage(config: { currency: string }): void {\n  currency = config.currency;\n}\n\nexport function getTokenUsageCurrency(): string {\n  return currency;\n}\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules, UserInterface } from \"../../../core\";\nimport { AuditLogInterface } from \"./audit-log.interface\";\n\nexport class AuditLog extends AbstractApiData implements AuditLogInterface {\n  private _kind: \"audit\" | \"comment\" = \"audit\";\n  private _action?: string;\n  private _fieldName?: string;\n  private _oldValue?: string;\n  private _newValue?: string;\n  private _content?: string;\n  private _annotationId?: string;\n  private _user?: UserInterface;\n\n  get kind(): \"audit\" | \"comment\" {\n    return this._kind;\n  }\n\n  get action(): string | undefined {\n    return this._action;\n  }\n\n  get fieldName(): string | undefined {\n    return this._fieldName;\n  }\n\n  get oldValue(): string | undefined {\n    return this._oldValue;\n  }\n\n  get newValue(): string | undefined {\n    return this._newValue;\n  }\n\n  get content(): string | undefined {\n    return this._content;\n  }\n\n  get annotationId(): string | undefined {\n    return this._annotationId;\n  }\n\n  get user(): UserInterface | undefined {\n    return this._user;\n  }\n\n  rehydrate(data: JsonApiHydratedDataInterface): this {\n    super.rehydrate(data);\n\n    this._kind = data.jsonApi.attributes.kind ?? \"audit\";\n    this._action = data.jsonApi.attributes.action ?? undefined;\n    this._fieldName = data.jsonApi.attributes.fieldName ?? undefined;\n    this._oldValue = data.jsonApi.attributes.oldValue ?? undefined;\n    this._newValue = data.jsonApi.attributes.newValue ?? undefined;\n    this._content = data.jsonApi.attributes.content ?? undefined;\n    this._annotationId = data.jsonApi.attributes.annotationId ?? undefined;\n\n    this._user = this._readIncluded(data, \"user\", Modules.User) as UserInterface | undefined;\n\n    return this;\n  }\n\n  createJsonApi(): any {\n    throw new Error(\"AuditLog is read-only\");\n  }\n}\n","import { AbstractService, EndpointCreator, HttpMethod, Modules, NextRef } from \"../../../core\";\nimport { AuditLogInterface } from \"./audit-log.interface\";\n\nexport class AuditLogService extends AbstractService {\n  static async findActivityByEntity(params: {\n    entityType: string;\n    entityId: string;\n    next?: NextRef;\n  }): Promise<AuditLogInterface[]> {\n    const endpoint = new EndpointCreator({\n      endpoint: Modules.AuditLog,\n      id: \"activity\",\n      childEndpoint: params.entityType,\n      childId: params.entityId,\n    });\n\n    return this.callApi({\n      type: Modules.AuditLog,\n      method: HttpMethod.GET,\n      endpoint: endpoint.generate(),\n      next: params.next,\n    });\n  }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { AuditLog } from \"./data\";\n\nexport const AuditLogModule = (factory: ModuleFactory) =>\n  factory({\n    name: \"audit-logs\",\n    pageUrl: \"/audit-logs\",\n    model: AuditLog,\n    moduleId: \"b7e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ACjD,SAAK,aAAa,KAAK,QAAQ,WAAW,aAAa;AACvD,SAAK,YAAY,KAAK,QAAQ,WAAW,YAAY;AACrD,SAAK,YAAY,KAAK,QAAQ,WAAW,YAAY;AACrD,SAAK,WAAW,KAAK,QAAQ,WAAW,WAAW;AACnD,SAAK,gBAAgB,KAAK,QAAQ,WAAW,gBAAgB;AAE7D,SAAK,QAAQ,KAAK,cAAc,MAAM,QAAQ,QAAQ,IAAI;AAE1D,WAAO;AAAA,EACT;AAAA,EAEA,gBAAqB;AACnB,UAAM,IAAI,MAAM,uBAAuB;AAAA,EACzC;AACF;;;AC7DO,IAAM,kBAAN,cAA8B,gBAAgB;AAAA,EAHrD,OAGqD;AAAA;AAAA;AAAA,EACnD,aAAa,qBAAqB,QAID;AAC/B,UAAM,WAAW,IAAI,gBAAgB;AAAA,MACnC,UAAU,QAAQ;AAAA,MAClB,IAAI;AAAA,MACJ,eAAe,OAAO;AAAA,MACtB,SAAS,OAAO;AAAA,IAClB,CAAC;AAED,WAAO,KAAK,QAAQ;AAAA,MAClB,MAAM,QAAQ;AAAA,MACd;AAAA,MACA,UAAU,SAAS,SAAS;AAAA,MAC5B,MAAM,OAAO;AAAA,IACf,CAAC;AAAA,EACH;AACF;;;ACpBO,IAAM,iBAAiB,wBAAC,YAC7B,QAAQ;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AACZ,CAAC,GAN2B;","names":["includedData","includedItem","module","entity","relationshipMeta","HttpMethod","JsonApiGet","JsonApiPost","JsonApiDelete","ClientHttpMethod","globalErrorHandler","React","globalStore","z","v4","v4","Action","AuthComponent","InvoiceStatus","StripePriceFields","StripeProductFields","SubscriptionStatus","AiConnectionFields","CompanyFields","ContentFields","HowToFields","NotificationFields","RoleFields","UserFields"]}