(container: HTMLElement)
| 33 | } |
| 34 | |
| 35 | function target(container: HTMLElement): Target | undefined { |
| 36 | if (typeof document === "undefined") return |
| 37 | |
| 38 | const review = container.closest("[data-component='session-review']") |
| 39 | if (review instanceof HTMLElement) { |
| 40 | const root = scrollRoot(container) ?? review |
| 41 | const content = review.querySelector("[data-slot='session-review-container']") |
| 42 | return { |
| 43 | key: review, |
| 44 | root, |
| 45 | content: content instanceof HTMLElement ? content : undefined, |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | const root = scrollRoot(container) |
| 50 | if (root) { |
| 51 | const content = root.querySelector("[role='log']") |
| 52 | return { |
| 53 | key: root, |
| 54 | root, |
| 55 | content: content instanceof HTMLElement ? content : undefined, |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | return { |
| 60 | key: document, |
| 61 | root: document, |
| 62 | content: undefined, |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | export function acquireVirtualizer(container: HTMLElement) { |
| 67 | const resolved = target(container) |
no test coverage detected