{"version":3,"file":"ewidget-utils.umd.cjs","names":[],"sources":["../src/AlleoMic.ts","../src/UiDetails.ts","../src/ExtraHTMLContent.ts","../src/ProtectedUrlProxy.ts","../src/EmbedWidgetMessenger.ts","../src/AlleoEwidgetUtils.ts"],"sourcesContent":["import type { EmbedWidgetMessenger } from './EmbedWidgetMessenger'\nimport type { EmbedWidgetMessageEvent } from './CommunicationStructure'\n\n/** Maximum allowed audio chunk duration in milliseconds. */\nexport const MIC_MAX_TIMESLICE_MS = 200\n\n/** Default chunk duration if the caller does not provide one. */\nexport const MIC_DEFAULT_TIMESLICE_MS = 100\n\n/**\n * Options passed to {@link AlleoMic.start} to request capture parameters from the parent.\n */\nexport type MicStartOptions = {\n /**\n * Requested audio chunk size in milliseconds.\n * Clamped to the range `[20, 200]`. Defaults to `100`.\n */\n timeslice?: number\n /**\n * Preferred container/codec mime type for the audio chunks\n * (e.g. `'audio/webm;codecs=opus'`, `'audio/mp4'`). The parent widget\n * may fall back to its supported default.\n */\n mimeType?: string\n /** Preferred sample rate in Hz (e.g. `48000`, `16000`). The parent may ignore this. */\n sampleRate?: number\n /** Preferred audio bitrate in bits per second. The parent may ignore this. */\n audioBitsPerSecond?: number\n}\n\n/**\n * Payload delivered with the `micStarted` message from the parent.\n */\nexport type MicStartedPayload = {\n /** The MIME type the parent will use for audio chunks. */\n mimeType: string\n /** Optional sample rate in Hz conveyed by the parent. */\n sampleRate?: number\n /** The effective timeslice in milliseconds used by the parent. */\n timeslice: number\n}\n\n/**\n * Payload delivered with a `micError` message when the parent reports a microphone-related error.\n */\nexport type MicErrorPayload = {\n /** Human-readable error message. */\n error: string\n}\n\ntype IncomingChunk = {\n data: ArrayBuffer\n mimeType: string\n}\n\ntype CaptureCapableMediaElement = HTMLMediaElement & {\n captureStream?: () => MediaStream\n mozCaptureStream?: () => MediaStream\n}\n\n/**\n * `alleo.mic` — microphone access bridge.\n *\n * The iframe is sandboxed and cannot call `navigator.mediaDevices.getUserMedia()`\n * itself. This class delegates capture to the parent Alleo widget over\n * `postMessage`. The parent records the microphone, slices the stream into\n * short audio chunks (≤ 200 ms each) and forwards them back to the iframe.\n *\n * The chunks are reassembled into a live `MediaStream` using a hidden\n * `