{"version":3,"file":"VoiceWave.mjs","names":[],"sources":["../../../../../src/plugins/AIComponents/VoiceVisualization/VoiceWave.tsx"],"sourcesContent":["import clsx from 'clsx';\n\nimport { createWaveRenderer, waveContains } from './renderers/waveRenderer';\nimport type { VoiceVisualizationProps } from './types';\nimport { VoiceVisualizationView } from './VoiceVisualizationView';\n\nconst createRenderer = (canvas: HTMLCanvasElement) => {\n  const ctx = canvas.getContext('2d');\n  return ctx ? createWaveRenderer(ctx) : null;\n};\n\nexport type VoiceWaveProps = VoiceVisualizationProps;\n\n/**\n * A voice agent as a single string, flat at its ends, carrying a wave packet that erupts with\n * speech while its colors flow along it. Tapping the string ripples it from the touch, and so\n * does a hovering mouse or pen.\n *\n * It has no size of its own and draws in the middle of the box it is given, about 80% as wide as\n * its shorter side, so give it a square or a wide box.\n */\nexport const VoiceWave = ({ className, ...props }: VoiceWaveProps) => (\n  <VoiceVisualizationView\n    className={clsx('str-chat__ai-voice-wave', className)}\n    contains={waveContains}\n    createRenderer={createRenderer}\n    // The thin line stays crisp at the screen's own density, up to 3x as on iOS.\n    maxPixelRatio={3}\n    rendererKey='wave'\n    {...props}\n  />\n);\n"],"mappings":";;;;;AAMA,IAAM,kBAAkB,WAA8B;CACpD,MAAM,MAAM,OAAO,WAAW,IAAI;CAClC,OAAO,MAAM,mBAAmB,GAAG,IAAI;AACzC;;;;;;;;;AAYA,IAAa,aAAa,EAAE,WAAW,GAAG,YACxC,oBAAC,wBAAD;CACE,WAAW,KAAK,2BAA2B,SAAS;CACpD,UAAU;CACM;CAEhB,eAAe;CACf,aAAY;CACZ,GAAI;AACL,CAAA"}