()
| 125 | } |
| 126 | |
| 127 | function newSessionId(): string { |
| 128 | const cryptoApi = (globalThis as { crypto?: Crypto }).crypto; |
| 129 | if (cryptoApi !== undefined && typeof cryptoApi.randomUUID === 'function') { |
| 130 | return cryptoApi.randomUUID().slice(0, 8); |
| 131 | } |
| 132 | return Math.random().toString(16).slice(2, 10); |
| 133 | } |
| 134 | |
| 135 | export function installUiLog(options: InstallUiLogOptions = {}): UiLogHandle { |
| 136 | const target = options.target ?? window; |