{"version":3,"file":"client.mjs","names":[],"sources":["../../src/next/client.ts"],"sourcesContent":["'use client'\n\nimport { useEffect } from 'react'\nimport type { TransportConfig } from '../types'\nimport { initLog, log, setIdentity, clearIdentity } from '../runtime/client/log'\n\nexport { log, setIdentity, clearIdentity } from '../runtime/client/log'\n\nexport interface MxllogProviderProps {\n  /**\n   * Service name for client-side logs.\n   * @default 'client'\n   */\n  service?: string\n\n  /**\n   * Enable pretty printing in the browser console.\n   * @default true\n   */\n  pretty?: boolean\n\n  /**\n   * Transport configuration for sending client logs to the server.\n   */\n  transport?: TransportConfig\n\n  /**\n   * Enable or disable client-side logging.\n   * @default true\n   */\n  enabled?: boolean\n\n  /**\n   * Enable or disable browser console output.\n   * When false, logs are suppressed in the browser DevTools console\n   * but still sent to the server via transport (if enabled).\n   * @default true\n   */\n  console?: boolean\n\n  children: React.ReactNode\n}\n\n/**\n * React provider that initializes mxllog client-side logging.\n * Place this in your root layout to enable client logging throughout your app.\n *\n * @example\n * ```tsx\n * // app/layout.tsx\n * import { MxllogProvider } from '@safaricom-mxl/log/next/client'\n *\n * export default function Layout({ children }) {\n *   return (\n *     <MxllogProvider service=\"my-app\" transport={{ enabled: true }}>\n *       {children}\n *     </MxllogProvider>\n *   )\n * }\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function MxllogProvider({ service, pretty, transport, enabled, console: consoleOutput, children }: MxllogProviderProps) {\n  useEffect(() => {\n    initLog({\n      enabled,\n      console: consoleOutput,\n      pretty,\n      service,\n      transport,\n    })\n  }, [enabled, consoleOutput, pretty, service, transport])\n\n  return children\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA8DA,SAAgB,eAAe,EAAE,SAAS,QAAQ,WAAW,SAAS,SAAS,eAAe,YAAiC;AAC7H,iBAAgB;AACd,UAAQ;GACN;GACA,SAAS;GACT;GACA;GACA;GACD,CAAC;IACD;EAAC;EAAS;EAAe;EAAQ;EAAS;EAAU,CAAC;AAExD,QAAO"}