@bazza-ui/react 0.1.0-canary.5 → 0.1.0-canary.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/{ListboxStore-DPqpLlAL.d.ts → ListboxStore-Be-isU6l.d.ts} +43 -3
  2. package/dist/{ListboxStore-BtcTXpzi.d.cts → ListboxStore-DcAFvpEj.d.cts} +43 -3
  3. package/dist/adapters/index.d.cts +1 -1
  4. package/dist/adapters/index.d.ts +1 -1
  5. package/dist/chunk-2D2HREBK.js +2 -0
  6. package/dist/chunk-2D2HREBK.js.map +1 -0
  7. package/dist/chunk-5T5B5SPR.cjs +2 -0
  8. package/dist/chunk-5T5B5SPR.cjs.map +1 -0
  9. package/dist/chunk-KO3DXT3Y.js +2 -0
  10. package/dist/chunk-KO3DXT3Y.js.map +1 -0
  11. package/dist/chunk-SF7X2BUT.cjs +2 -0
  12. package/dist/chunk-SF7X2BUT.cjs.map +1 -0
  13. package/dist/chunk-URLK26NV.cjs +2 -0
  14. package/dist/{chunk-JSPKF52O.cjs.map → chunk-URLK26NV.cjs.map} +1 -1
  15. package/dist/chunk-ZPRKUVIC.js +2 -0
  16. package/dist/chunk-ZPRKUVIC.js.map +1 -0
  17. package/dist/combobox/index.cjs +1 -1
  18. package/dist/combobox/index.cjs.map +1 -1
  19. package/dist/combobox/index.d.cts +27 -23
  20. package/dist/combobox/index.d.ts +27 -23
  21. package/dist/combobox/index.js +1 -1
  22. package/dist/combobox/index.js.map +1 -1
  23. package/dist/{command-score-YjNr3ZWi.d.cts → command-score-CEqnuMqW.d.cts} +1 -1
  24. package/dist/{command-score-Dgo3ZS3Z.d.ts → command-score-JZy7Snbk.d.ts} +1 -1
  25. package/dist/{data-surface-wC_Jb6Rh.d.ts → context-Dhm4Zi3l.d.ts} +10 -69
  26. package/dist/{data-surface-CvJ9KHPs.d.cts → context-Drjy6Y10.d.cts} +10 -69
  27. package/dist/context-menu/index.cjs +1 -1
  28. package/dist/context-menu/index.cjs.map +1 -1
  29. package/dist/context-menu/index.d.cts +14 -12
  30. package/dist/context-menu/index.d.ts +14 -12
  31. package/dist/context-menu/index.js +1 -1
  32. package/dist/context-menu/index.js.map +1 -1
  33. package/dist/dropdown-menu/index.cjs +1 -1
  34. package/dist/dropdown-menu/index.cjs.map +1 -1
  35. package/dist/dropdown-menu/index.d.cts +14 -12
  36. package/dist/dropdown-menu/index.d.ts +14 -12
  37. package/dist/dropdown-menu/index.js +1 -1
  38. package/dist/dropdown-menu/index.js.map +1 -1
  39. package/dist/internal/listbox/index.cjs +1 -1
  40. package/dist/internal/listbox/index.d.cts +3 -3
  41. package/dist/internal/listbox/index.d.ts +3 -3
  42. package/dist/internal/listbox/index.js +1 -1
  43. package/dist/internal/popup-menu/index.cjs +1 -1
  44. package/dist/internal/popup-menu/index.cjs.map +1 -1
  45. package/dist/internal/popup-menu/index.d.cts +9 -9
  46. package/dist/internal/popup-menu/index.d.ts +9 -9
  47. package/dist/internal/popup-menu/index.js +1 -1
  48. package/dist/items-B6HeFO_8.d.cts +37 -0
  49. package/dist/items-B6HeFO_8.d.ts +37 -0
  50. package/dist/select/index.cjs +1 -1
  51. package/dist/select/index.cjs.map +1 -1
  52. package/dist/select/index.d.cts +72 -36
  53. package/dist/select/index.d.ts +72 -36
  54. package/dist/select/index.js +1 -1
  55. package/dist/select/index.js.map +1 -1
  56. package/dist/{separator-C9c1Jo6A.d.ts → separator-BncOmTUq.d.ts} +18 -13
  57. package/dist/{separator-BzYYn73e.d.cts → separator-DACt2Z4S.d.cts} +18 -13
  58. package/dist/{types-M2vBIhdB.d.ts → types-BtG9pIR2.d.ts} +6 -51
  59. package/dist/{types-Cggz7pEl.d.cts → types-w3v6Vp8X.d.cts} +6 -51
  60. package/dist/video-player/index.cjs +2 -2
  61. package/dist/video-player/index.d.cts +6 -5
  62. package/dist/video-player/index.d.ts +6 -5
  63. package/dist/video-player/index.js +2 -2
  64. package/dist/video-player/index.js.map +1 -1
  65. package/package.json +3 -3
  66. package/dist/chunk-AVZ64JQ3.js +0 -2
  67. package/dist/chunk-AVZ64JQ3.js.map +0 -1
  68. package/dist/chunk-BGJJC6GX.cjs +0 -2
  69. package/dist/chunk-BGJJC6GX.cjs.map +0 -1
  70. package/dist/chunk-FWWOE2SW.cjs +0 -2
  71. package/dist/chunk-FWWOE2SW.cjs.map +0 -1
  72. package/dist/chunk-JSPKF52O.cjs +0 -2
  73. package/dist/chunk-KWGD24VS.js +0 -2
  74. package/dist/chunk-KWGD24VS.js.map +0 -1
  75. package/dist/chunk-WKAPAKUL.js +0 -2
  76. package/dist/chunk-WKAPAKUL.js.map +0 -1
  77. package/dist/item-equality-B6TbXlBT.d.cts +0 -7
  78. package/dist/item-equality-B6TbXlBT.d.ts +0 -7
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { P as PopupMenuOpenChangeReason, H as HighlightChangeEventDetails, C as ChangeEventDetails, G as GenericEventDetails } from './events-BPr8sRGH.js';
3
- import { b as ListboxStore, V as VirtualItem, F as FilterFn, S as SearchNormalizer } from './ListboxStore-DPqpLlAL.js';
4
- import { G as GetQualifiedRowIdFn } from './types-M2vBIhdB.js';
3
+ import { b as ListboxStore, V as VirtualItem, F as FilterFn, S as SearchNormalizer } from './ListboxStore-Be-isU6l.js';
4
+ import { G as GetQualifiedRowIdFn, aq as DataSurfaceProps } from './types-BtG9pIR2.js';
5
5
  import { ReactStore } from '@base-ui/utils/store';
6
6
  import { PopoverArrowProps, Popover, PopoverBackdropProps, PopoverPopupProps, PopoverPortalProps } from '@base-ui/react/popover';
7
7
  import { a as ComponentRenderFn, C as ComponentProps } from './types-DT4FOOa2.js';
@@ -309,7 +309,7 @@ interface PopupMenuArrowProps extends PopoverArrowProps {
309
309
  * Must be rendered inside `Popup`.
310
310
  * Renders a `<div>` element.
311
311
  */
312
- declare const PopupMenuArrow: React.ForwardRefExoticComponent<PopupMenuArrowProps & React.RefAttributes<HTMLDivElement>>;
312
+ declare const PopupMenuArrow: React.ForwardRefExoticComponent<Omit<PopupMenuArrowProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
313
313
  declare namespace PopupMenuArrow {
314
314
  type Props = PopupMenuArrowProps;
315
315
  type State = Popover.Arrow.State;
@@ -339,7 +339,7 @@ interface PopupMenuBackdropProps extends PopoverBackdropProps {
339
339
  *
340
340
  * Renders a `<div>` element with `pointer-events: none`.
341
341
  */
342
- declare const PopupMenuBackdrop: React.ForwardRefExoticComponent<PopupMenuBackdropProps & React.RefAttributes<HTMLDivElement>>;
342
+ declare const PopupMenuBackdrop: React.ForwardRefExoticComponent<Omit<PopupMenuBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
343
343
  declare namespace PopupMenuBackdrop {
344
344
  type Props = PopupMenuBackdropProps;
345
345
  type State = Popover.Backdrop.State;
@@ -385,7 +385,7 @@ interface PopupMenuPopupProps extends Omit<PopoverPopupProps, 'className' | 'ren
385
385
  *
386
386
  * Renders a `<div>` element.
387
387
  */
388
- declare const PopupMenuPopup: React.ForwardRefExoticComponent<PopupMenuPopupProps & React.RefAttributes<HTMLDivElement>>;
388
+ declare const PopupMenuPopup: React.ForwardRefExoticComponent<Omit<PopupMenuPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
389
389
  declare namespace PopupMenuPopup {
390
390
  type Props = PopupMenuPopupProps;
391
391
  type State = PopupMenuPopupState;
@@ -397,7 +397,7 @@ interface PopupMenuPortalProps extends PopoverPortalProps {
397
397
  * A portal element that moves the popup to a different part of the DOM.
398
398
  * By default, the portal element is appended to `<body>`.
399
399
  */
400
- declare const PopupMenuPortal: React.ForwardRefExoticComponent<PopoverPortalProps & React.RefAttributes<HTMLDivElement>>;
400
+ declare const PopupMenuPortal: React.ForwardRefExoticComponent<Omit<PopoverPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
401
401
  declare namespace PopupMenuPortal {
402
402
  type Props = PopoverPortalProps;
403
403
  type State = Popover.Portal.State;
@@ -502,7 +502,7 @@ interface PopupMenuListChildrenState {
502
502
  }
503
503
  interface PopupMenuListState extends Record<string, unknown> {
504
504
  }
505
- interface PopupMenuListProps extends Omit<ComponentProps<'div', PopupMenuList.State>, 'children'> {
505
+ interface PopupMenuListProps extends Omit<ComponentProps<'div', PopupMenuList.State>, 'children' | 'content'> {
506
506
  /**
507
507
  * Content to render inside the list.
508
508
  * Can be a render function that receives the current search state.
@@ -525,12 +525,12 @@ interface PopupMenuListProps extends Omit<ComponentProps<'div', PopupMenuList.St
525
525
  * Only used when `measureRowWidth` is true.
526
526
  */
527
527
  maxRowWidth?: number;
528
+ /**
529
+ * Ref to the element that owns the list's scroll position.
530
+ * Use when the semantic list is rendered inside another scroll container.
531
+ */
532
+ scrollContainerRef?: React.RefObject<HTMLElement | null>;
528
533
  }
529
- /**
530
- * Container for popup menu items.
531
- * Supports render props for accessing search state.
532
- * Renders a `<div>` element with role="listbox".
533
- */
534
534
  declare const PopupMenuList: React.ForwardRefExoticComponent<Omit<PopupMenuList.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
535
535
  declare namespace PopupMenuList {
536
536
  type State = PopupMenuListState;
@@ -609,7 +609,7 @@ declare namespace PopupMenuScrollDownArrow {
609
609
 
610
610
  interface PopupMenuSurfaceState extends Record<string, unknown> {
611
611
  }
612
- interface PopupMenuSurfaceProps extends ComponentProps<'div', PopupMenuSurface.State> {
612
+ interface PopupMenuSurfaceProps extends Omit<ComponentProps<'div', PopupMenuSurface.State>, 'content'>, DataSurfaceProps {
613
613
  /**
614
614
  * Filter function for matching items against search query.
615
615
  * Returns a score between 0 and 1 (0 = no match, > 0 = match).
@@ -656,6 +656,11 @@ interface PopupMenuSurfaceProps extends ComponentProps<'div', PopupMenuSurface.S
656
656
  * @default true
657
657
  */
658
658
  clearSearchOnClose?: boolean | 'after-exit';
659
+ /**
660
+ * Whether to reset the list scroll position when the search query changes.
661
+ * @default true
662
+ */
663
+ resetScrollOnSearch?: boolean;
659
664
  /**
660
665
  * Whether to skip auto-focusing the input/list when this surface becomes the focus owner.
661
666
  * Useful for Combobox where the input is outside the popup and should retain focus.
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { P as PopupMenuOpenChangeReason, H as HighlightChangeEventDetails, C as ChangeEventDetails, G as GenericEventDetails } from './events-BPr8sRGH.cjs';
3
- import { b as ListboxStore, V as VirtualItem, F as FilterFn, S as SearchNormalizer } from './ListboxStore-BtcTXpzi.cjs';
4
- import { G as GetQualifiedRowIdFn } from './types-Cggz7pEl.cjs';
3
+ import { b as ListboxStore, V as VirtualItem, F as FilterFn, S as SearchNormalizer } from './ListboxStore-DcAFvpEj.cjs';
4
+ import { G as GetQualifiedRowIdFn, aq as DataSurfaceProps } from './types-w3v6Vp8X.cjs';
5
5
  import { ReactStore } from '@base-ui/utils/store';
6
6
  import { PopoverArrowProps, Popover, PopoverBackdropProps, PopoverPopupProps, PopoverPortalProps } from '@base-ui/react/popover';
7
7
  import { a as ComponentRenderFn, C as ComponentProps } from './types-DT4FOOa2.cjs';
@@ -309,7 +309,7 @@ interface PopupMenuArrowProps extends PopoverArrowProps {
309
309
  * Must be rendered inside `Popup`.
310
310
  * Renders a `<div>` element.
311
311
  */
312
- declare const PopupMenuArrow: React.ForwardRefExoticComponent<PopupMenuArrowProps & React.RefAttributes<HTMLDivElement>>;
312
+ declare const PopupMenuArrow: React.ForwardRefExoticComponent<Omit<PopupMenuArrowProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
313
313
  declare namespace PopupMenuArrow {
314
314
  type Props = PopupMenuArrowProps;
315
315
  type State = Popover.Arrow.State;
@@ -339,7 +339,7 @@ interface PopupMenuBackdropProps extends PopoverBackdropProps {
339
339
  *
340
340
  * Renders a `<div>` element with `pointer-events: none`.
341
341
  */
342
- declare const PopupMenuBackdrop: React.ForwardRefExoticComponent<PopupMenuBackdropProps & React.RefAttributes<HTMLDivElement>>;
342
+ declare const PopupMenuBackdrop: React.ForwardRefExoticComponent<Omit<PopupMenuBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
343
343
  declare namespace PopupMenuBackdrop {
344
344
  type Props = PopupMenuBackdropProps;
345
345
  type State = Popover.Backdrop.State;
@@ -385,7 +385,7 @@ interface PopupMenuPopupProps extends Omit<PopoverPopupProps, 'className' | 'ren
385
385
  *
386
386
  * Renders a `<div>` element.
387
387
  */
388
- declare const PopupMenuPopup: React.ForwardRefExoticComponent<PopupMenuPopupProps & React.RefAttributes<HTMLDivElement>>;
388
+ declare const PopupMenuPopup: React.ForwardRefExoticComponent<Omit<PopupMenuPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
389
389
  declare namespace PopupMenuPopup {
390
390
  type Props = PopupMenuPopupProps;
391
391
  type State = PopupMenuPopupState;
@@ -397,7 +397,7 @@ interface PopupMenuPortalProps extends PopoverPortalProps {
397
397
  * A portal element that moves the popup to a different part of the DOM.
398
398
  * By default, the portal element is appended to `<body>`.
399
399
  */
400
- declare const PopupMenuPortal: React.ForwardRefExoticComponent<PopoverPortalProps & React.RefAttributes<HTMLDivElement>>;
400
+ declare const PopupMenuPortal: React.ForwardRefExoticComponent<Omit<PopoverPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
401
401
  declare namespace PopupMenuPortal {
402
402
  type Props = PopoverPortalProps;
403
403
  type State = Popover.Portal.State;
@@ -502,7 +502,7 @@ interface PopupMenuListChildrenState {
502
502
  }
503
503
  interface PopupMenuListState extends Record<string, unknown> {
504
504
  }
505
- interface PopupMenuListProps extends Omit<ComponentProps<'div', PopupMenuList.State>, 'children'> {
505
+ interface PopupMenuListProps extends Omit<ComponentProps<'div', PopupMenuList.State>, 'children' | 'content'> {
506
506
  /**
507
507
  * Content to render inside the list.
508
508
  * Can be a render function that receives the current search state.
@@ -525,12 +525,12 @@ interface PopupMenuListProps extends Omit<ComponentProps<'div', PopupMenuList.St
525
525
  * Only used when `measureRowWidth` is true.
526
526
  */
527
527
  maxRowWidth?: number;
528
+ /**
529
+ * Ref to the element that owns the list's scroll position.
530
+ * Use when the semantic list is rendered inside another scroll container.
531
+ */
532
+ scrollContainerRef?: React.RefObject<HTMLElement | null>;
528
533
  }
529
- /**
530
- * Container for popup menu items.
531
- * Supports render props for accessing search state.
532
- * Renders a `<div>` element with role="listbox".
533
- */
534
534
  declare const PopupMenuList: React.ForwardRefExoticComponent<Omit<PopupMenuList.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
535
535
  declare namespace PopupMenuList {
536
536
  type State = PopupMenuListState;
@@ -609,7 +609,7 @@ declare namespace PopupMenuScrollDownArrow {
609
609
 
610
610
  interface PopupMenuSurfaceState extends Record<string, unknown> {
611
611
  }
612
- interface PopupMenuSurfaceProps extends ComponentProps<'div', PopupMenuSurface.State> {
612
+ interface PopupMenuSurfaceProps extends Omit<ComponentProps<'div', PopupMenuSurface.State>, 'content'>, DataSurfaceProps {
613
613
  /**
614
614
  * Filter function for matching items against search query.
615
615
  * Returns a score between 0 and 1 (0 = no match, > 0 = match).
@@ -656,6 +656,11 @@ interface PopupMenuSurfaceProps extends ComponentProps<'div', PopupMenuSurface.S
656
656
  * @default true
657
657
  */
658
658
  clearSearchOnClose?: boolean | 'after-exit';
659
+ /**
660
+ * Whether to reset the list scroll position when the search query changes.
661
+ * @default true
662
+ */
663
+ resetScrollOnSearch?: boolean;
659
664
  /**
660
665
  * Whether to skip auto-focusing the input/list when this surface becomes the focus owner.
661
666
  * Useful for Combobox where the input is outside the popup and should retain focus.
@@ -1433,6 +1433,11 @@ interface DataSurfaceProps {
1433
1433
  * - `'after-exit'`: clear after exit animation completes
1434
1434
  */
1435
1435
  clearSearchOnClose?: boolean | 'after-exit';
1436
+ /**
1437
+ * Whether to reset the list scroll position when the search query changes.
1438
+ * @default true
1439
+ */
1440
+ resetScrollOnSearch?: boolean;
1436
1441
  /**
1437
1442
  * Function to generate qualified IDs for row items.
1438
1443
  * Called for each item when rendering to produce IDs for:
@@ -1470,55 +1475,5 @@ interface DataListChildrenState {
1470
1475
  /** Aggregate async loading state across all menus */
1471
1476
  async: AsyncState;
1472
1477
  }
1473
- /**
1474
- * Props for the DataList component.
1475
- */
1476
- interface DataListProps {
1477
- /**
1478
- * Render function for the list content.
1479
- * Receives the current state and returns JSX.
1480
- */
1481
- children: (state: DataListChildrenState) => React.ReactNode;
1482
- /** Accessible label for the listbox */
1483
- label?: string;
1484
- /** Additional class name */
1485
- className?: string;
1486
- /** Additional styles */
1487
- style?: React.CSSProperties;
1488
- /**
1489
- * When true, measures row widths and applies `--row-width` CSS variable.
1490
- * Keeps the list at the maximum width seen while scrolling.
1491
- * Useful for virtualized lists where content width varies.
1492
- * @default true
1493
- */
1494
- measureRowWidth?: boolean;
1495
- /**
1496
- * Maximum width cap for row measurement (in pixels).
1497
- * Only used when `measureRowWidth` is true.
1498
- */
1499
- maxRowWidth?: number;
1500
- }
1501
- /**
1502
- * State passed to the DataSubpages render function.
1503
- */
1504
- interface DataSubpagesChildrenState {
1505
- /** All subpage content nodes discovered in the current content tree. */
1506
- subpages: DisplaySubpageNode[];
1507
- /**
1508
- * Function to render a subpage content node.
1509
- * Calls the node's `renderContent` callback with page context and child renderer.
1510
- */
1511
- renderSubpageContent: (subpage: DisplaySubpageNode) => React.ReactNode;
1512
- }
1513
- /**
1514
- * Props for the DataSubpages component.
1515
- */
1516
- interface DataSubpagesProps {
1517
- /**
1518
- * Optional render function.
1519
- * If omitted, all subpage contents are rendered by default.
1520
- */
1521
- children?: (state: DataSubpagesChildrenState) => React.ReactNode;
1522
- }
1523
1478
 
1524
- export { type ItemRenderProps as $, type AsyncLoaderConfig as A, type BreadcrumbNode as B, type CheckboxItemDef as C, type CheckboxItemRenderParams as D, type CheckboxItemRenderProps as E, type DataListChildrenState as F, type GetQualifiedRowIdFn as G, type DataListProps as H, type DataSubpagesChildrenState as I, type DataSubpagesProps as J, type DataSurfaceProps as K, type DeepSearchConfig as L, type DisplayGroupNode as M, type DisplayNode as N, type DisplayRadioGroupNode as O, PopupMenuCheckboxItem as P, type DisplayRowNode as Q, type DisplaySeparatorNode as R, type DisplaySubpageNode as S, type GroupBehavior as T, type GroupDef as U, type GroupRenderContext as V, type GroupRenderParams as W, type IncludeInDeepSearch as X, type InitialQueryBehavior as Y, type ItemDef as Z, type ItemRenderParams as _, PopupMenuItem as a, type LoaderComponentProps as a0, type NodeDef as a1, type QueryAsyncNodesConfig as a2, type QueryDependentLoaderConfig as a3, type RadioGroupBehavior as a4, type RadioGroupDef as a5, type RadioGroupRenderParams as a6, type RadioGroupRenderProps as a7, type RadioItemDef as a8, type RadioItemRenderParams as a9, type RadioItemRenderProps as aa, type RowRenderContext as ab, type ScoredNode as ac, type SeparatorDef as ad, type SeparatorRenderParams as ae, type StaticAsyncNodesConfig as af, type StaticLoaderConfig as ag, type SubmenuDef as ah, type SubmenuRenderParams as ai, type SubmenuRenderProps as aj, type SubpageContentRenderParams as ak, type SubpageDef as al, type SubpageTriggerRenderParams as am, type SubpageTriggerRenderProps as an, defineRadioGroup as ao, isDisplayGroupNode as ap, isDisplayRadioGroupNode as aq, isDisplayRowNode as ar, isDisplaySeparatorNode as as, type GetQualifiedRowIdContext as at, PopupMenuRadioGroup as b, PopupMenuRadioItem as c, PopupMenuSubmenuTrigger as d, PopupMenuSubpageTrigger as e, type PopupMenuCheckboxItemProps as f, type PopupMenuCheckboxItemState as g, type PopupMenuItemProps as h, type PopupMenuItemState as i, type PopupMenuRadioGroupProps as j, type PopupMenuRadioGroupState as k, type PopupMenuRadioItemProps as l, type PopupMenuRadioItemState as m, type PopupMenuSubmenuTriggerProps as n, type PopupMenuSubmenuTriggerState as o, type PopupMenuSubpageTriggerProps as p, type PopupMenuSubpageTriggerState as q, type AsyncLoaderFetchStatus as r, type AsyncLoaderLoadingPhase as s, type AsyncLoaderResult as t, type AsyncLoaderSource as u, type AsyncLoaderStatus as v, type AsyncNodesConfig as w, type AsyncRenderState as x, type AsyncResultBehavior as y, type AsyncState as z };
1479
+ export { type QueryDependentLoaderConfig as $, type AsyncLoaderConfig as A, type BreadcrumbNode as B, type CheckboxItemDef as C, type CheckboxItemRenderParams as D, type CheckboxItemRenderProps as E, type DataListChildrenState as F, type GetQualifiedRowIdFn as G, type DeepSearchConfig as H, type DisplayGroupNode as I, type DisplayNode as J, type DisplayRadioGroupNode as K, type DisplayRowNode as L, type DisplaySeparatorNode as M, type DisplaySubpageNode as N, type GroupBehavior as O, PopupMenuCheckboxItem as P, type GroupDef as Q, type GroupRenderContext as R, type GroupRenderParams as S, type IncludeInDeepSearch as T, type InitialQueryBehavior as U, type ItemDef as V, type ItemRenderParams as W, type ItemRenderProps as X, type LoaderComponentProps as Y, type NodeDef as Z, type QueryAsyncNodesConfig as _, PopupMenuItem as a, type RadioGroupBehavior as a0, type RadioGroupDef as a1, type RadioGroupRenderParams as a2, type RadioGroupRenderProps as a3, type RadioItemDef as a4, type RadioItemRenderParams as a5, type RadioItemRenderProps as a6, type RowRenderContext as a7, type ScoredNode as a8, type SeparatorDef as a9, type SeparatorRenderParams as aa, type StaticAsyncNodesConfig as ab, type StaticLoaderConfig as ac, type SubmenuDef as ad, type SubmenuRenderParams as ae, type SubmenuRenderProps as af, type SubpageContentRenderParams as ag, type SubpageDef as ah, type SubpageTriggerRenderParams as ai, type SubpageTriggerRenderProps as aj, defineRadioGroup as ak, isDisplayGroupNode as al, isDisplayRadioGroupNode as am, isDisplayRowNode as an, isDisplaySeparatorNode as ao, type GetQualifiedRowIdContext as ap, type DataSurfaceProps as aq, PopupMenuRadioGroup as b, PopupMenuRadioItem as c, PopupMenuSubmenuTrigger as d, PopupMenuSubpageTrigger as e, type PopupMenuCheckboxItemProps as f, type PopupMenuCheckboxItemState as g, type PopupMenuItemProps as h, type PopupMenuItemState as i, type PopupMenuRadioGroupProps as j, type PopupMenuRadioGroupState as k, type PopupMenuRadioItemProps as l, type PopupMenuRadioItemState as m, type PopupMenuSubmenuTriggerProps as n, type PopupMenuSubmenuTriggerState as o, type PopupMenuSubpageTriggerProps as p, type PopupMenuSubpageTriggerState as q, type AsyncLoaderFetchStatus as r, type AsyncLoaderLoadingPhase as s, type AsyncLoaderResult as t, type AsyncLoaderSource as u, type AsyncLoaderStatus as v, type AsyncNodesConfig as w, type AsyncRenderState as x, type AsyncResultBehavior as y, type AsyncState as z };
@@ -1433,6 +1433,11 @@ interface DataSurfaceProps {
1433
1433
  * - `'after-exit'`: clear after exit animation completes
1434
1434
  */
1435
1435
  clearSearchOnClose?: boolean | 'after-exit';
1436
+ /**
1437
+ * Whether to reset the list scroll position when the search query changes.
1438
+ * @default true
1439
+ */
1440
+ resetScrollOnSearch?: boolean;
1436
1441
  /**
1437
1442
  * Function to generate qualified IDs for row items.
1438
1443
  * Called for each item when rendering to produce IDs for:
@@ -1470,55 +1475,5 @@ interface DataListChildrenState {
1470
1475
  /** Aggregate async loading state across all menus */
1471
1476
  async: AsyncState;
1472
1477
  }
1473
- /**
1474
- * Props for the DataList component.
1475
- */
1476
- interface DataListProps {
1477
- /**
1478
- * Render function for the list content.
1479
- * Receives the current state and returns JSX.
1480
- */
1481
- children: (state: DataListChildrenState) => React.ReactNode;
1482
- /** Accessible label for the listbox */
1483
- label?: string;
1484
- /** Additional class name */
1485
- className?: string;
1486
- /** Additional styles */
1487
- style?: React.CSSProperties;
1488
- /**
1489
- * When true, measures row widths and applies `--row-width` CSS variable.
1490
- * Keeps the list at the maximum width seen while scrolling.
1491
- * Useful for virtualized lists where content width varies.
1492
- * @default true
1493
- */
1494
- measureRowWidth?: boolean;
1495
- /**
1496
- * Maximum width cap for row measurement (in pixels).
1497
- * Only used when `measureRowWidth` is true.
1498
- */
1499
- maxRowWidth?: number;
1500
- }
1501
- /**
1502
- * State passed to the DataSubpages render function.
1503
- */
1504
- interface DataSubpagesChildrenState {
1505
- /** All subpage content nodes discovered in the current content tree. */
1506
- subpages: DisplaySubpageNode[];
1507
- /**
1508
- * Function to render a subpage content node.
1509
- * Calls the node's `renderContent` callback with page context and child renderer.
1510
- */
1511
- renderSubpageContent: (subpage: DisplaySubpageNode) => React.ReactNode;
1512
- }
1513
- /**
1514
- * Props for the DataSubpages component.
1515
- */
1516
- interface DataSubpagesProps {
1517
- /**
1518
- * Optional render function.
1519
- * If omitted, all subpage contents are rendered by default.
1520
- */
1521
- children?: (state: DataSubpagesChildrenState) => React.ReactNode;
1522
- }
1523
1478
 
1524
- export { type ItemRenderProps as $, type AsyncLoaderConfig as A, type BreadcrumbNode as B, type CheckboxItemDef as C, type CheckboxItemRenderParams as D, type CheckboxItemRenderProps as E, type DataListChildrenState as F, type GetQualifiedRowIdFn as G, type DataListProps as H, type DataSubpagesChildrenState as I, type DataSubpagesProps as J, type DataSurfaceProps as K, type DeepSearchConfig as L, type DisplayGroupNode as M, type DisplayNode as N, type DisplayRadioGroupNode as O, PopupMenuCheckboxItem as P, type DisplayRowNode as Q, type DisplaySeparatorNode as R, type DisplaySubpageNode as S, type GroupBehavior as T, type GroupDef as U, type GroupRenderContext as V, type GroupRenderParams as W, type IncludeInDeepSearch as X, type InitialQueryBehavior as Y, type ItemDef as Z, type ItemRenderParams as _, PopupMenuItem as a, type LoaderComponentProps as a0, type NodeDef as a1, type QueryAsyncNodesConfig as a2, type QueryDependentLoaderConfig as a3, type RadioGroupBehavior as a4, type RadioGroupDef as a5, type RadioGroupRenderParams as a6, type RadioGroupRenderProps as a7, type RadioItemDef as a8, type RadioItemRenderParams as a9, type RadioItemRenderProps as aa, type RowRenderContext as ab, type ScoredNode as ac, type SeparatorDef as ad, type SeparatorRenderParams as ae, type StaticAsyncNodesConfig as af, type StaticLoaderConfig as ag, type SubmenuDef as ah, type SubmenuRenderParams as ai, type SubmenuRenderProps as aj, type SubpageContentRenderParams as ak, type SubpageDef as al, type SubpageTriggerRenderParams as am, type SubpageTriggerRenderProps as an, defineRadioGroup as ao, isDisplayGroupNode as ap, isDisplayRadioGroupNode as aq, isDisplayRowNode as ar, isDisplaySeparatorNode as as, type GetQualifiedRowIdContext as at, PopupMenuRadioGroup as b, PopupMenuRadioItem as c, PopupMenuSubmenuTrigger as d, PopupMenuSubpageTrigger as e, type PopupMenuCheckboxItemProps as f, type PopupMenuCheckboxItemState as g, type PopupMenuItemProps as h, type PopupMenuItemState as i, type PopupMenuRadioGroupProps as j, type PopupMenuRadioGroupState as k, type PopupMenuRadioItemProps as l, type PopupMenuRadioItemState as m, type PopupMenuSubmenuTriggerProps as n, type PopupMenuSubmenuTriggerState as o, type PopupMenuSubpageTriggerProps as p, type PopupMenuSubpageTriggerState as q, type AsyncLoaderFetchStatus as r, type AsyncLoaderLoadingPhase as s, type AsyncLoaderResult as t, type AsyncLoaderSource as u, type AsyncLoaderStatus as v, type AsyncNodesConfig as w, type AsyncRenderState as x, type AsyncResultBehavior as y, type AsyncState as z };
1479
+ export { type QueryDependentLoaderConfig as $, type AsyncLoaderConfig as A, type BreadcrumbNode as B, type CheckboxItemDef as C, type CheckboxItemRenderParams as D, type CheckboxItemRenderProps as E, type DataListChildrenState as F, type GetQualifiedRowIdFn as G, type DeepSearchConfig as H, type DisplayGroupNode as I, type DisplayNode as J, type DisplayRadioGroupNode as K, type DisplayRowNode as L, type DisplaySeparatorNode as M, type DisplaySubpageNode as N, type GroupBehavior as O, PopupMenuCheckboxItem as P, type GroupDef as Q, type GroupRenderContext as R, type GroupRenderParams as S, type IncludeInDeepSearch as T, type InitialQueryBehavior as U, type ItemDef as V, type ItemRenderParams as W, type ItemRenderProps as X, type LoaderComponentProps as Y, type NodeDef as Z, type QueryAsyncNodesConfig as _, PopupMenuItem as a, type RadioGroupBehavior as a0, type RadioGroupDef as a1, type RadioGroupRenderParams as a2, type RadioGroupRenderProps as a3, type RadioItemDef as a4, type RadioItemRenderParams as a5, type RadioItemRenderProps as a6, type RowRenderContext as a7, type ScoredNode as a8, type SeparatorDef as a9, type SeparatorRenderParams as aa, type StaticAsyncNodesConfig as ab, type StaticLoaderConfig as ac, type SubmenuDef as ad, type SubmenuRenderParams as ae, type SubmenuRenderProps as af, type SubpageContentRenderParams as ag, type SubpageDef as ah, type SubpageTriggerRenderParams as ai, type SubpageTriggerRenderProps as aj, defineRadioGroup as ak, isDisplayGroupNode as al, isDisplayRadioGroupNode as am, isDisplayRowNode as an, isDisplaySeparatorNode as ao, type GetQualifiedRowIdContext as ap, type DataSurfaceProps as aq, PopupMenuRadioGroup as b, PopupMenuRadioItem as c, PopupMenuSubmenuTrigger as d, PopupMenuSubpageTrigger as e, type PopupMenuCheckboxItemProps as f, type PopupMenuCheckboxItemState as g, type PopupMenuItemProps as h, type PopupMenuItemState as i, type PopupMenuRadioGroupProps as j, type PopupMenuRadioGroupState as k, type PopupMenuRadioItemProps as l, type PopupMenuRadioItemState as m, type PopupMenuSubmenuTriggerProps as n, type PopupMenuSubmenuTriggerState as o, type PopupMenuSubpageTriggerProps as p, type PopupMenuSubpageTriggerState as q, type AsyncLoaderFetchStatus as r, type AsyncLoaderLoadingPhase as s, type AsyncLoaderResult as t, type AsyncLoaderSource as u, type AsyncLoaderStatus as v, type AsyncNodesConfig as w, type AsyncRenderState as x, type AsyncResultBehavior as y, type AsyncState as z };
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkM4G6J7DPcjs = require('../chunk-M4G6J7DP.cjs');var _react = require('react'); var Le = _interopRequireWildcard(_react); var He = _interopRequireWildcard(_react); var or = _interopRequireWildcard(_react); var ir = _interopRequireWildcard(_react); var at = _interopRequireWildcard(_react); var pe = _interopRequireWildcard(_react); var Y = _interopRequireWildcard(_react); var le = _interopRequireWildcard(_react); var dr = _interopRequireWildcard(_react); var Fe = _interopRequireWildcard(_react); var ue = _interopRequireWildcard(_react); var Pr = _interopRequireWildcard(_react); var Rr = _interopRequireWildcard(_react); var st = _interopRequireWildcard(_react); var Qe = _interopRequireWildcard(_react); var $e = _interopRequireWildcard(_react); var ct = _interopRequireWildcard(_react); var d = _interopRequireWildcard(_react); var je = _interopRequireWildcard(_react); var R = _interopRequireWildcard(_react); var F = _interopRequireWildcard(_react); var et = _interopRequireWildcard(_react); var K = _interopRequireWildcard(_react); var ce = _interopRequireWildcard(_react); var O = _interopRequireWildcard(_react);var ot=Le.createContext(null);function P(c){let e=Le.useContext(ot);if(!e)throw new Error(`<VideoPlayer.${c}> must be used within <VideoPlayer.Root>`);return e}function ie(){return P("useVideoPlayer")}var _r={};_chunkM4G6J7DPcjs.a.call(void 0, _r,{BufferedIndicator:()=>rr,Captions:()=>ar,CaptionsButton:()=>sr,CaptionsDataAttributes:()=>Ie,CaptionsMenu:()=>lr,CaptionsMenuItem:()=>Oe,Controls:()=>ur,ControlsDataAttributes:()=>Ae,FullscreenButton:()=>cr,MuteButton:()=>pr,Overlay:()=>fr,OverlayDataAttributes:()=>We,PictureInPictureButton:()=>mr,PlayButton:()=>yr,PlaybackRateButton:()=>Sr,PlaybackRateMenu:()=>br,PlaybackRateMenuItem:()=>lt,Portal:()=>kr,Poster:()=>gr,QualityMenu:()=>vr,QualityMenuItem:()=>dt,Root:()=>hr,RootDataAttributes:()=>Ne,SeekSlider:()=>Er,SeekSliderBuffered:()=>Hr,SeekSliderControl:()=>Br,SeekSliderCssVars:()=>Ke,SeekSliderDataAttributes:()=>qe,SeekSliderHover:()=>Dr,SeekSliderPreviewThumb:()=>Ir,SeekSliderPreviewThumbDataAttributes:()=>Xe,SeekSliderPreviewTooltip:()=>fe,SeekSliderPreviewTooltipPopup:()=>ze,SeekSliderPreviewTooltipPortal:()=>Ye,SeekSliderPreviewTooltipPositioner:()=>Ge,SeekSliderProgress:()=>wr,SeekSliderThumb:()=>Lr,SeekSliderTrack:()=>Vr,Thumbnail:()=>Or,ThumbnailDataAttributes:()=>Je,TimeDisplay:()=>Ar,TimeDisplayDataAttributes:()=>Ze,Track:()=>Wr,Video:()=>Fr,VolumeSlider:()=>Qr,VolumeSliderControl:()=>$r,VolumeSliderCssVars:()=>tt,VolumeSliderDataAttributes:()=>rt,VolumeSliderRange:()=>jr,VolumeSliderThumb:()=>Ur,VolumeSliderTrack:()=>Nr,useTransitionStatus:()=>G,useVideoPlayer:()=>ie});var _jsxruntime = require('react/jsx-runtime');var rr=He.forwardRef(function(e,t){let{render:s,...u}=e,n=P("BufferedIndicator"),o=He.useMemo(()=>{if(!n.buffered||n.buffered.length===0)return 0;for(let i=0;i<n.buffered.length;i++)if(n.buffered.start(i)<=n.currentTime&&n.currentTime<=n.buffered.end(i))return n.buffered.end(i);return n.buffered.end(0)},[n.buffered,n.currentTime]),a=n.duration>0?o/n.duration*100:0,r={buffered:n.buffered,duration:n.duration,bufferedPercentage:a,bufferedEnd:o},l={"--buffered-percentage":`${a}%`,"--buffered-end":o,...u.style},p={ref:t,style:l,"aria-hidden":!0};return s?s(p,r):_jsxruntime.jsx.call(void 0, "div",{ref:t,"aria-hidden":"true",...u,style:l})});var Ie=(e=>(e.active="data-active",e))(Ie||{});var ar=or.forwardRef(function(e,t){let{render:s,children:u,...n}=e,a=P("Captions").activeCues,r=a.map(f=>f.text).join(`
2
- `),l=a.length>0,p={active:l,cueText:r,cues:a},i={ref:t,"aria-live":"polite","aria-atomic":!0,role:"status",style:{pointerEvents:"none"},"data-active":l||void 0};return s?s(i,p):u?_jsxruntime.jsx.call(void 0, "div",{...i,...n,children:u}):_jsxruntime.jsx.call(void 0, "div",{...i,...n,children:r})});var _mergeprops = require('@base-ui/react/merge-props');function E(c,e){return _mergeprops.mergeProps.call(void 0, c,nn(e))}function nn(c){let e={...c};for(let t in e){let s=e[t];on(t,s)&&(e[t]=(u,...n)=>(_mergeprops.makeEventPreventable.call(void 0, u),s(u,...n)))}return e}function on(c,e){return c.charCodeAt(0)===111&&c.charCodeAt(1)===110&&c.charCodeAt(2)>=65&&c.charCodeAt(2)<=90&&typeof e=="function"}var sr=ir.forwardRef(function(e,t){let{render:s,...u}=e,n=P("CaptionsButton"),o=n.registeredTracks.length>0,a=n.activeTextTrack!==null,r={active:a,available:o,trackCount:n.registeredTracks.length},l=E({ref:t,type:"button","aria-label":a?"Disable captions":"Enable captions","aria-pressed":a,disabled:!o,"data-active":a||void 0,"data-available":o||void 0,onClick(){if(a)n.setTextTrack(null);else if(n.registeredTracks.length>0){let p=n.registeredTracks[0];_optionalChain([p, 'optionalAccess', _2 => _2.textTrack])&&n.setTextTrack(p.textTrack)}}},u);return s?s(l,r):_jsxruntime.jsx.call(void 0, "button",{...l,...u})});var lr=at.forwardRef(function(e,t){let{render:s,children:u,...n}=e,o=P("CaptionsMenu"),a={registeredTracks:o.registeredTracks,activeTextTrack:o.activeTextTrack},r={ref:t,role:"menu","aria-label":"Captions","data-active":o.activeTextTrack!==null||void 0};return s?s(r,a):_jsxruntime.jsx.call(void 0, "div",{...r,...n,children:_nullishCoalesce(u, () => (_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, Oe,{track:null,children:"Off"}),o.registeredTracks.map(l=>_jsxruntime.jsx.call(void 0, Oe,{track:l.textTrack,children:l.label},l.id))]})))})}),Oe=at.forwardRef(function(e,t){let{track:s,children:u,...n}=e,o=P("CaptionsMenuItem"),a=o.activeTextTrack===s,r=E({ref:t,type:"button",role:"menuitemradio","aria-checked":a,"data-active":a||void 0,onClick(){o.setTextTrack(s)}},n);return _jsxruntime.jsx.call(void 0, "button",{...r,children:u})});var Ae=(r=>(r.open="data-open",r.closed="data-closed",r.idle="data-idle",r.playing="data-playing",r.paused="data-paused",r.ended="data-ended",r.startingStyle="data-starting-style",r.endingStyle="data-ending-style",r))(Ae||{});function un(c){let e=[...c.getAnimations(),...Array.from(c.querySelectorAll("*")).flatMap(t=>t.getAnimations())];return e.length===0?Promise.resolve():Promise.all(e.map(t=>t.finished)).then(()=>{}).catch(()=>{})}function G(c){let{open:e,keepMounted:t=!1}=c,[s,u]=Y.useState(e||t),[n,o]=Y.useState(e?"starting":void 0),a=Y.useRef(null),r=Y.useRef(!1);return Y.useEffect(()=>{if(e){r.current=!1,u(!0),o("starting");let l=requestAnimationFrame(()=>{requestAnimationFrame(()=>{o(void 0)})});return()=>cancelAnimationFrame(l)}},[e]),Y.useEffect(()=>{if(!e&&s&&!r.current){o("ending");let l=a.current;if(!l){o(void 0),t||u(!1);return}r.current=!0;let p=requestAnimationFrame(()=>{requestAnimationFrame(()=>{un(l).then(()=>{r.current&&(r.current=!1,o(void 0),t||u(!1))})})});return()=>{cancelAnimationFrame(p)}}},[e,s,t]),Y.useEffect(()=>{t&&!s&&!e&&u(!0)},[t,s,e]),{mounted:s||t,transitionStatus:n,elementRef:a}}var ur=pe.forwardRef(function(e,t){let{idleTimeout:s,keepMounted:u=!1,render:n,children:o,...a}=e,r=P("Controls"),p=(_nullishCoalesce(s, () => (r.idleTimeout)))===0||!r.idle,{mounted:i,transitionStatus:f,elementRef:b}=G({open:p,keepMounted:u}),S=pe.useCallback(L=>{b.current=L,typeof t=="function"?t(L):t&&(t.current=L)},[t,b]),{onClick:T,...y}=a,x=pe.useCallback(L=>{L.stopPropagation(),_optionalChain([T, 'optionalCall', _3 => _3(L)])},[T]),v={open:p,idle:r.idle,playing:r.playing,paused:r.paused,ended:r.ended},k={ref:S,onClick:x,"data-open":p||void 0,"data-closed":!p||void 0,"data-idle":r.idle||void 0,"data-playing":r.playing||void 0,"data-paused":r.paused||void 0,"data-ended":r.ended||void 0,"data-starting-style":f==="starting"||void 0,"data-ending-style":f==="ending"||void 0};return i?n?n(k,v):_jsxruntime.jsx.call(void 0, "div",{...k,...y,children:o}):null});var cr=le.forwardRef(function(e,t){let{render:s,children:u,...n}=e,o=P("FullscreenButton"),[a,r]=le.useState(!1);le.useEffect(()=>{r("fullscreenEnabled"in document&&document.fullscreenEnabled)},[]);let l={fullscreen:o.fullscreen,supported:a},p=E({ref:t,type:"button","aria-label":o.fullscreen?"Exit fullscreen":"Enter fullscreen","aria-pressed":o.fullscreen,disabled:!a,"data-fullscreen":o.fullscreen||void 0,"data-supported":a||void 0,onClick(){o.toggleFullscreen()}},n);return s?s(p,l):_jsxruntime.jsx.call(void 0, "button",{...p,...n,children:u})});var pr=dr.forwardRef(function(e,t){let{render:s,...u}=e,n=P("MuteButton"),o={muted:n.muted,volume:n.volume},a=n.volume,r=n.muted,l=a===0||r,p=a>0&&!r,i=!r&&a>0&&a<.5,f=!r&&a>=.5,b=E({ref:t,type:"button","aria-label":n.muted?"Unmute":"Mute","aria-pressed":n.muted,"data-muted":r||void 0,"data-volume-off":l||void 0,"data-volume-on":p||void 0,"data-volume-low":i||void 0,"data-volume-high":f||void 0,onClick(){n.toggleMute()}},u);return s?s(b,o):_jsxruntime.jsx.call(void 0, "button",{...b,...u})});var We=(i=>(i.open="data-open",i.closed="data-closed",i.playing="data-playing",i.paused="data-paused",i.ended="data-ended",i.waiting="data-waiting",i.seeking="data-seeking",i.fullscreen="data-fullscreen",i.pip="data-pip",i.startingStyle="data-starting-style",i.endingStyle="data-ending-style",i))(We||{});var fr=Fe.forwardRef(function(e,t){let{idleTimeout:s,keepMounted:u=!1,render:n,children:o,...a}=e,r=P("Overlay"),p=(_nullishCoalesce(s, () => (r.idleTimeout)))===0||!r.idle,{mounted:i,transitionStatus:f,elementRef:b}=G({open:p,keepMounted:u}),S=Fe.useCallback(x=>{b.current=x,typeof t=="function"?t(x):t&&(t.current=x)},[t,b]),T={playing:r.playing,paused:r.paused,ended:r.ended,waiting:r.waiting,seeking:r.seeking,fullscreen:r.fullscreen,pictureInPicture:r.pictureInPicture,open:p},y=E({ref:S,onClick(){r.toggle()},"data-playing":r.playing||void 0,"data-paused":r.paused||void 0,"data-ended":r.ended||void 0,"data-waiting":r.waiting||void 0,"data-seeking":r.seeking||void 0,"data-fullscreen":r.fullscreen||void 0,"data-pip":r.pictureInPicture||void 0,"data-open":p||void 0,"data-closed":!p||void 0,"data-starting-style":f==="starting"||void 0,"data-ending-style":f==="ending"||void 0},a);return i?n?n(y,T):_jsxruntime.jsx.call(void 0, "div",{...y,...a,children:o}):null});var mr=ue.forwardRef(function(e,t){let{render:s,...u}=e,n=P("PictureInPictureButton"),[o,a]=ue.useState(!1);ue.useEffect(()=>{a("pictureInPictureEnabled"in document&&document.pictureInPictureEnabled)},[]);let r={pictureInPicture:n.pictureInPicture,supported:o},l=E({ref:t,type:"button","aria-label":n.pictureInPicture?"Exit picture-in-picture":"Enter picture-in-picture","aria-pressed":n.pictureInPicture,disabled:!o,"data-pip":n.pictureInPicture||void 0,"data-supported":o||void 0,onClick(){n.togglePictureInPicture()}},u);return s?s(l,r):_jsxruntime.jsx.call(void 0, "button",{...l,...u})});var yr=Pr.forwardRef(function(e,t){let{render:s,children:u,...n}=e,o=P("PlayButton"),a={playing:o.playing,paused:o.paused,ended:o.ended,waiting:o.waiting},r=E({ref:t,type:"button","aria-label":o.playing?"Pause":"Play","data-playing":o.playing||void 0,"data-paused":o.paused||void 0,"data-ended":o.ended||void 0,"data-waiting":o.waiting||void 0,onClick(){o.toggle()}},n);return s?s(r,a):_jsxruntime.jsx.call(void 0, "button",{...r,...n,children:u})});var yn=[.25,.5,.75,1,1.25,1.5,1.75,2],Sr=Rr.forwardRef(function(e,t){let{rates:s=yn,render:u,children:n,...o}=e,a=P("PlaybackRateButton"),r={playbackRate:a.playbackRate,rates:s},l=E({ref:t,type:"button","aria-label":`Playback speed: ${a.playbackRate}x`,"data-rate":a.playbackRate,onClick(){let p=s.indexOf(a.playbackRate),i=_nullishCoalesce(_nullishCoalesce(s[(p+1)%s.length], () => (s[0])), () => (a.playbackRate));a.setPlaybackRate(i)}},o);return u?u(l,r):_jsxruntime.jsx.call(void 0, "button",{...l,...o,children:_nullishCoalesce(n, () => (`${a.playbackRate}x`))})});var Sn=[.25,.5,.75,1,1.25,1.5,1.75,2],br=st.forwardRef(function(e,t){let{rates:s=Sn,render:u,children:n,...o}=e,a=P("PlaybackRateMenu"),r={playbackRate:a.playbackRate,rates:s},l={ref:t,role:"menu","aria-label":"Playback speed","data-rate":a.playbackRate};return u?u(l,r):_jsxruntime.jsx.call(void 0, "div",{...l,...o,children:_nullishCoalesce(n, () => (s.map(p=>_jsxruntime.jsx.call(void 0, lt,{rate:p},p))))})}),lt=st.forwardRef(function(e,t){let{rate:s,children:u,...n}=e,o=P("PlaybackRateMenuItem"),a=o.playbackRate===s,r=E({ref:t,type:"button",role:"menuitemradio","aria-checked":a,"data-active":a||void 0,onClick(){o.setPlaybackRate(s)}},n);return _jsxruntime.jsx.call(void 0, "button",{...r,children:_nullishCoalesce(u, () => (`${s}x`))})});var _reactdom = require('react-dom'); var Cr = _interopRequireWildcard(_reactdom);function kr(c){let{children:e,container:t}=c,[s,u]=Qe.useState(!1);if(Qe.useEffect(()=>(u(!0),()=>u(!1)),[]),!s)return null;let n=_nullishCoalesce(t, () => ((typeof document<"u"?document.body:null)));return n?_reactdom.createPortal.call(void 0, e,n):null}var gr=$e.forwardRef(function(e,t){let{keepMounted:s=!1,render:u,children:n,...o}=e,a=P("Poster"),r=!a.canPlay,l=a.canPlay,{mounted:p,transitionStatus:i,elementRef:f}=G({open:r,keepMounted:s}),b=kn(t,f),S={loading:r,loaded:l,transitionStatus:i},T={ref:b,"aria-hidden":!0,"data-loading":r||void 0,"data-loaded":l||void 0,"data-starting-style":i==="starting"||void 0,"data-ending-style":i==="ending"||void 0};return p?u?u(T,S):_jsxruntime.jsx.call(void 0, "div",{...T,...o,children:n}):null});function kn(...c){return $e.useCallback(e=>{for(let t of c)typeof t=="function"?t(e):t!=null&&(t.current=e)},c)}var vr=ct.forwardRef(function(e,t){let{render:s,children:u,...n}=e,o=P("QualityMenu"),a={qualities:o.qualities,activeQuality:o.activeQuality},r={ref:t,role:"menu","aria-label":"Video quality","data-quality":_nullishCoalesce(_optionalChain([o, 'access', _4 => _4.activeQuality, 'optionalAccess', _5 => _5.label]), () => (void 0))};return s?s(r,a):_jsxruntime.jsx.call(void 0, "div",{...r,...n,children:_nullishCoalesce(u, () => (o.qualities.map(l=>_jsxruntime.jsx.call(void 0, dt,{quality:l,children:l.label},l.label))))})}),dt=ct.forwardRef(function(e,t){let{quality:s,children:u,...n}=e,o=P("QualityMenuItem"),a=_optionalChain([o, 'access', _6 => _6.activeQuality, 'optionalAccess', _7 => _7.label])===s.label,r=E({ref:t,type:"button",role:"menuitemradio","aria-checked":a,"data-active":a||void 0,onClick(){o.setQuality(s)}},n);return _jsxruntime.jsx.call(void 0, "button",{...r,children:u})});var Ne=(l=>(l.playing="data-playing",l.paused="data-paused",l.ended="data-ended",l.waiting="data-waiting",l.seeking="data-seeking",l.fullscreen="data-fullscreen",l.pip="data-pip",l.muted="data-muted",l.idle="data-idle",l))(Ne||{});function vn(c,e){return!(c instanceof HTMLElement)||c instanceof HTMLInputElement&&c.type==="range"&&e===" "?!1:c.tagName==="INPUT"||c.tagName==="TEXTAREA"||c.isContentEditable}function Tn(c){return c==="ArrowRight"||c==="ArrowLeft"}function Tr(c,e){let t=ie(),s=je.useRef(t);s.current=t,je.useEffect(()=>{if(e==="none")return;let u=a=>{if(vn(a.target,a.key))return;let r=s.current;switch(a.key){case" ":a.preventDefault(),r.toggle();break;case"f":case"F":a.preventDefault(),r.toggleFullscreen();break;case"ArrowUp":a.preventDefault(),r.setVolume(Math.min(r.volume+.1,1));break;case"ArrowDown":a.preventDefault(),r.setVolume(Math.max(r.volume-.1,0));break;case"ArrowRight":a.preventDefault(),r.beginSeekInteraction(),r.seek(Math.min(r.currentTime+5,r.duration));break;case"ArrowLeft":a.preventDefault(),r.beginSeekInteraction(),r.seek(Math.max(r.currentTime-5,0));break;default:return}r.resetIdle()},n=a=>{Tn(a.key)&&s.current.endSeekInteraction()};if(e==="global")return window.addEventListener("keydown",u),window.addEventListener("keyup",n),()=>{window.removeEventListener("keydown",u),window.removeEventListener("keyup",n)};let o=c.current;if(o)return o.addEventListener("keydown",u),o.addEventListener("keyup",n),()=>{o.removeEventListener("keydown",u),o.removeEventListener("keyup",n)}},[e,c])}function Ue(c,e,t){let[s,u]=d.useState(e),n=c!==void 0,o=n?c:s,a=d.useCallback(r=>{let l=typeof r=="function"?r(o):r;n||u(l),_optionalChain([t, 'optionalCall', _8 => _8(l)])},[n,o,t]);return[o,a]}function hn({rootRef:c,videoRef:e,actionsRef:t,defaultPlaying:s=!1,autoPlay:u=!1,defaultVolume:n=1,defaultMuted:o=!1,defaultPlaybackRate:a=1,playing:r,onPlayingChange:l,volume:p,onVolumeChange:i,muted:f,onMutedChange:b,playbackRate:S,onPlaybackRateChange:T,currentTime:y,onCurrentTimeChange:x,idleTimeout:v=3e3,preventIdleWhenPaused:k=!1,idle:L,onIdleChange:M,onEnded:w,onWaiting:H,onSeeking:Q,onSeeked:D,onFullscreenChange:h,onPictureInPictureChange:$,children:U}){let q=d.useRef(1),_=d.useRef(!1),J=d.useRef(!1),Z=d.useRef(!1),[B,I]=d.useState("paused"),[g,W]=d.useState(s?"play":"pause");d.useEffect(()=>{r!==void 0&&(W(r?"play":"pause"),B!=="waiting"&&I(r?"playing":"paused"))},[r,B]);let[A,te]=Ue(p,n,i),[X,de]=Ue(f,o,b),[mt,Pt]=Ue(S,a,T),[Kr,re]=Ue(L,!0,M),ne=d.useRef(null),Pe=d.useCallback(()=>{ne.current&&(clearTimeout(ne.current),ne.current=null)},[]),yt=d.useCallback(()=>{v!==0&&(Pe(),ne.current=setTimeout(()=>{re(!0)},v))},[v,Pe,re]),Rt=d.useCallback(()=>{re(!1),yt()},[re,yt]),St=d.useCallback(()=>{Pe(),re(!0)},[Pe,re]);d.useEffect(()=>(v>0&&(ne.current=setTimeout(()=>{re(!0)},v)),()=>{ne.current&&clearTimeout(ne.current)}),[]);let bt=k&&B!=="playing"?!1:Kr,ye=d.useCallback(async()=>{let m=e.current;if(!(!u||!m||Z.current)){Z.current=!0,W("play"),m.muted=X,m.volume=A;try{await m.play(),I("playing"),_optionalChain([l, 'optionalCall', _9 => _9(!0)])}catch (e2){W("pause"),I("paused")}}},[u,X,l,e,A]);d.useEffect(()=>{if(!u){Z.current=!1;return}ye()},[u,ye]);let[kt,gt]=d.useState(0),[Re,vt]=d.useState(0),[Tt,qr]=d.useState(null),[Se,Xr]=d.useState(null),[ht,xt]=d.useState(!1),[Ct,se]=d.useState(!1),[be,Yr]=d.useState(!1),[ke,Mt]=d.useState(!1),[Et,nt]=d.useState([]),[oe,Gr]=d.useState(null),[Bt,ge]=d.useState([]),[Vt,$n]=d.useState([]),[wt,zr]=d.useState(null);d.useEffect(()=>{y!==void 0&&e.current&&(e.current.currentTime=y)},[y,e]),d.useEffect(()=>{let m=e.current;m&&(m.muted=X,m.volume=A)},[X,e,A]),d.useEffect(()=>{let m=()=>{let C=document.fullscreenElement===c.current;Yr(C),_optionalChain([h, 'optionalCall', _10 => _10(C)])};return document.addEventListener("fullscreenchange",m),()=>document.removeEventListener("fullscreenchange",m)},[h,c]),d.useEffect(()=>{let m=e.current;if(!m)return;let C=()=>{Mt(!0),_optionalChain([$, 'optionalCall', _11 => _11(!0)])},N=()=>{Mt(!1),_optionalChain([$, 'optionalCall', _12 => _12(!1)])};return m.addEventListener("enterpictureinpicture",C),m.addEventListener("leavepictureinpicture",N),()=>{m.removeEventListener("enterpictureinpicture",C),m.removeEventListener("leavepictureinpicture",N)}},[$,e]);let ve=d.useCallback(async()=>{e.current&&(W("play"),await e.current.play(),I("playing"),_optionalChain([l, 'optionalCall', _13 => _13(!0)]))},[e,l]),Te=d.useCallback(()=>{e.current&&(W("pause"),e.current.pause(),I("paused"),_optionalChain([l, 'optionalCall', _14 => _14(!1)]))},[e,l]),he=d.useCallback(async()=>{B==="playing"?Te():await ve()},[B,ve,Te]),xe=d.useCallback(m=>{e.current&&(e.current.currentTime=m,gt(m),_optionalChain([x, 'optionalCall', _15 => _15(m)]))},[x,e]),Lt=d.useCallback(()=>{let m=e.current;!m||_.current||(_.current=!0,J.current=g==="play",se(!0),J.current&&!m.paused&&m.pause())},[g,e]),Ht=d.useCallback(()=>{let m=e.current;if(!m||!_.current)return;let C=J.current&&g==="play";if(_.current=!1,J.current=!1,!C){se(!1);return}m.play().then(()=>{I("playing"),se(!1)}).catch(()=>{I("waiting"),se(!1)})},[g,e]),Ce=d.useCallback(m=>{let C=Math.max(0,Math.min(1,m));e.current&&(e.current.volume=C),te(C)},[te,e]),It=d.useCallback(()=>{if(!(X||A===0))q.current=A,e.current&&(e.current.muted=!0),de(!0);else{let C=q.current>0?q.current:1;e.current&&(e.current.volume=C,e.current.muted=!1),te(C),de(!1)}},[X,A,de,te,e]),Me=d.useCallback(async()=>{_optionalChain([c, 'access', _16 => _16.current, 'optionalAccess', _17 => _17.requestFullscreen])&&await c.current.requestFullscreen()},[c]),Ee=d.useCallback(async()=>{document.exitFullscreen&&await document.exitFullscreen()},[]),Be=d.useCallback(async()=>{be?await Ee():await Me()},[be,Me,Ee]),Ve=d.useCallback(async()=>{_optionalChain([e, 'access', _18 => _18.current, 'optionalAccess', _19 => _19.requestPictureInPicture])&&await e.current.requestPictureInPicture()},[e]),we=d.useCallback(async()=>{document.pictureInPictureElement&&await document.exitPictureInPicture()},[]),Dt=d.useCallback(async()=>{ke?await we():await Ve()},[ke,Ve,we]),Ot=d.useCallback(m=>{e.current&&(e.current.playbackRate=m),Pt(m)},[Pt,e]),At=d.useCallback(m=>{if(e.current){for(let C=0;C<e.current.textTracks.length;C++){let N=e.current.textTracks[C];N&&(N.mode="disabled")}m&&(m.mode="hidden")}Gr(m),ge([])},[e]),Wt=d.useCallback(m=>{zr(m)},[]),Ft=d.useCallback(m=>{nt(C=>C.some(N=>N.id===m.id)?C:[...C,m])},[]),Qt=d.useCallback(m=>{nt(C=>C.filter(N=>N.id!==m))},[]),$t=d.useCallback((m,C)=>{nt(N=>N.map(ae=>ae.id===m?{...ae,textTrack:C}:ae))},[]);d.useEffect(()=>{if(!oe){ge([]);return}let m=()=>{let C=oe.activeCues;if(!C){ge([]);return}let N=[];for(let ae=0;ae<C.length;ae++){let tr=C[ae];tr instanceof VTTCue&&N.push(tr)}ge(N)};return m(),oe.addEventListener("cuechange",m),()=>{oe.removeEventListener("cuechange",m)}},[oe]),d.useImperativeHandle(t,()=>({toggle:he,seek:xe,setVolume:Ce,toggleFullscreen:Be}),[he,xe,Ce,Be]);let Nt=d.useCallback(()=>{if(e.current){let m=e.current.currentTime;gt(m),_optionalChain([x, 'optionalCall', _20 => _20(m)])}},[x,e]),jt=d.useCallback(()=>{e.current&&vt(e.current.duration)},[e]),Ut=d.useCallback(()=>{e.current&&qr(e.current.buffered)},[e]),_t=d.useCallback(()=>{W("play"),I("playing"),_optionalChain([l, 'optionalCall', _21 => _21(!0)])},[l]),Kt=d.useCallback(()=>{_.current||B!=="ended"&&(I("paused"),_optionalChain([l, 'optionalCall', _22 => _22(!1)]))},[B,l]),qt=d.useCallback(()=>{W("pause"),I("ended"),_optionalChain([l, 'optionalCall', _23 => _23(!1)]),_optionalChain([w, 'optionalCall', _24 => _24()])},[l,w]),Xt=d.useCallback(()=>{_.current||(I("waiting"),_optionalChain([H, 'optionalCall', _25 => _25()]))},[H]),Yt=d.useCallback(()=>{if(_.current){xt(!0);return}if(B==="waiting"){let m=g==="play"?"playing":"paused";I(m),_optionalChain([l, 'optionalCall', _26 => _26(m==="playing")])}xt(!0)},[B,g,l]),Gt=d.useCallback(()=>{se(!0),B==="ended"&&I("paused"),_optionalChain([Q, 'optionalCall', _27 => _27()])},[B,Q]),zt=d.useCallback(()=>{if(se(!1),e.current){let{currentTime:m,duration:C}=e.current;C>0&&C-m<.01&&I("ended")}_optionalChain([D, 'optionalCall', _28 => _28()])},[D,e]),Jt=d.useCallback(()=>{e.current&&(te(e.current.volume),de(e.current.muted))},[te,de,e]),Zt=d.useCallback(()=>{e.current&&vt(e.current.duration)},[e]),er=d.useCallback(()=>{ye()},[ye]),Jr=d.useMemo(()=>({playbackStatus:B,playbackIntent:g,playing:B==="playing",paused:B==="paused",ended:B==="ended",waiting:B==="waiting",seeking:Ct,canPlay:ht,currentTime:kt,duration:Re,buffered:Tt,hoverTime:Se,hoverProgress:Se!==null&&Re>0?Se/Re*100:null,volume:A,muted:X,fullscreen:be,pictureInPicture:ke,idle:bt,idleTimeout:v,preventIdleWhenPaused:k,registeredTracks:Et,activeTextTrack:oe,activeCues:Bt,playbackRate:mt,qualities:Vt,activeQuality:wt,videoRef:e,rootRef:c,play:ve,pause:Te,toggle:he,seek:xe,setVolume:Ce,toggleMute:It,enterFullscreen:Me,exitFullscreen:Ee,toggleFullscreen:Be,enterPictureInPicture:Ve,exitPictureInPicture:we,togglePictureInPicture:Dt,setPlaybackRate:Ot,setTextTrack:At,setQuality:Wt,registerTrack:Ft,unregisterTrack:Qt,updateTrackRef:$t,resetIdle:Rt,setHoverTime:Xr,beginSeekInteraction:Lt,endSeekInteraction:Ht,_handlers:{onTimeUpdate:Nt,onDurationChange:jt,onProgress:Ut,onPlay:_t,onPause:Kt,onEnded:qt,onWaiting:Xt,onCanPlay:Yt,onSeeking:Gt,onSeeked:zt,onVolumeChange:Jt,onLoadedMetadata:Zt,onVideoMount:er,onRootMouseLeave:St}}),[B,g,Ct,ht,kt,Re,Tt,Se,A,X,be,ke,bt,v,k,Et,oe,Bt,mt,Vt,wt,e,c,ve,Te,he,xe,Ce,It,Me,Ee,Be,Ve,we,Dt,Ot,At,Wt,Ft,Qt,$t,Rt,Lt,Ht,Nt,jt,Ut,_t,Kt,qt,Xt,Yt,Gt,zt,Jt,Zt,er,St]);return _jsxruntime.jsx.call(void 0, ot.Provider,{value:Jr,children:U})}var hr=d.forwardRef(function(e,t){let{actionsRef:s,keyboardShortcuts:u="focused",defaultPlaying:n,autoPlay:o,defaultVolume:a,defaultMuted:r,defaultPlaybackRate:l,playing:p,onPlayingChange:i,volume:f,onVolumeChange:b,muted:S,onMutedChange:T,playbackRate:y,onPlaybackRateChange:x,currentTime:v,onCurrentTimeChange:k,idleTimeout:L,preventIdleWhenPaused:M,hideCursorWhenIdle:w="fullscreen",idle:H,onIdleChange:Q,onEnded:D,onWaiting:h,onSeeking:$,onSeeked:U,onFullscreenChange:q,onPictureInPictureChange:_,children:J,...Z}=e,B=d.useRef(null),I=d.useRef(null);return _jsxruntime.jsx.call(void 0, hn,{actionsRef:s,defaultPlaying:n,autoPlay:o,defaultVolume:a,defaultMuted:r,defaultPlaybackRate:l,playing:p,onPlayingChange:i,volume:f,onVolumeChange:b,muted:S,onMutedChange:T,playbackRate:y,onPlaybackRateChange:x,currentTime:v,onCurrentTimeChange:k,idleTimeout:L,preventIdleWhenPaused:M,idle:H,onIdleChange:Q,onEnded:D,onWaiting:h,onSeeking:$,onSeeked:U,onFullscreenChange:q,onPictureInPictureChange:_,rootRef:B,videoRef:I,children:_jsxruntime.jsx.call(void 0, xn,{ref:t,rootRef:B,keyboardShortcuts:u,hideCursorWhenIdle:w,...Z,children:J})})}),xn=d.forwardRef(function({rootRef:e,keyboardShortcuts:t,hideCursorWhenIdle:s,children:u,className:n,style:o,...a},r){let l=ie(),p=Cn(r,e),i=d.useRef(null);Tr(e,t);let f=d.useCallback(w=>{let{clientX:H,clientY:Q}=w,D=i.current;D&&D.x===H&&D.y===Q||(i.current={x:H,y:Q},l.resetIdle())},[l]),b=d.useCallback(w=>{let{clientX:H,clientY:Q}=w,D=i.current;D&&D.x===H&&D.y===Q||(i.current={x:H,y:Q},l.resetIdle())},[l]),S=d.useCallback(()=>{l._handlers.onRootMouseLeave()},[l._handlers]),T=d.useCallback(()=>{l.resetIdle()},[l]),y=d.useCallback(()=>{l.resetIdle()},[l]),x=d.useCallback(w=>{w.key==="Tab"&&l.resetIdle()},[l]),v=E({onMouseMove:f,onMouseEnter:b,onMouseLeave:S,onClick:T,onFocus:y,onKeyDown:x},a),k={"data-playing":l.playing||void 0,"data-paused":l.paused||void 0,"data-ended":l.ended||void 0,"data-waiting":l.waiting||void 0,"data-seeking":l.seeking||void 0,"data-fullscreen":l.fullscreen||void 0,"data-pip":l.pictureInPicture||void 0,"data-muted":l.muted||void 0,"data-idle":l.idle||void 0},L=s!==!1&&l.idle&&(s==="always"||s==="fullscreen"&&l.fullscreen),M=d.useId();return _jsxruntime.jsxs.call(void 0, "div",{...v,ref:p,tabIndex:t==="focused"?0:void 0,className:n,style:o,"data-video-player-scope":M,...k,children:[L&&_jsxruntime.jsx.call(void 0, "style",{children:`[data-video-player-scope="${M}"], [data-video-player-scope="${M}"] * { cursor: none !important; }`}),u]})});function Cn(...c){return d.useCallback(e=>{for(let t of c)typeof t=="function"?t(e):t!=null&&(t.current=e)},c)}var Ke=(o=>(o.progress="--seek-progress",o.buffered="--seek-buffered",o.currentTime="--seek-current-time",o.duration="--seek-duration",o.hoverProgress="--seek-hover-progress",o.hoverTime="--seek-hover-time",o))(Ke||{});var qe=(u=>(u.seeking="data-seeking",u.hovering="data-hovering",u.pressing="data-pressing",u.dragging="data-dragging",u))(qe||{});var _slider = require('@base-ui/react/slider');var _react2 = require('@floating-ui/react');var Xe=(u=>(u.open="data-open",u.closed="data-closed",u.startingStyle="data-starting-style",u.endingStyle="data-ending-style",u))(Xe||{});var pt=R.createContext(null);function Mr(c){let e=R.useContext(pt);if(!e)throw new Error(`${c} must be used within SeekSlider`);return e}function xr(c){return c==="ArrowRight"||c==="ArrowLeft"}var Er=R.forwardRef(function(e,t){let{render:s,children:u,onPointerMove:n,onPointerLeave:o,onPointerDown:a,onKeyUp:r,onValueCommitted:l,...p}=e,i=P("SeekSlider"),f=R.useRef(null),[b,S]=R.useState(null),[T,y]=R.useState(!1),[x,v]=R.useState(!1),k=R.useRef(!1);R.useEffect(()=>{if(!T)return;let g=()=>{y(!1),v(!1),k.current=!1,i.endSeekInteraction()};return window.addEventListener("pointerup",g),()=>window.removeEventListener("pointerup",g)},[T,i]);let L=i.duration>0?i.currentTime/i.duration*100:0,M=R.useCallback((g,W)=>{let A=typeof g=="number"?g:g[0];A!==void 0&&(W.reason==="keyboard"&&i.beginSeekInteraction(),i.seek(A),i.resetIdle(),k.current&&v(!0))},[i]),w=R.useCallback(g=>{if(_optionalChain([n, 'optionalCall', _29 => _29(g)]),!f.current||i.duration===0)return;let W=f.current.getBoundingClientRect(),A=g.clientX-W.left,X=Math.max(0,Math.min(1,A/W.width))*i.duration;i.setHoverTime(X)},[n,i]),H=R.useCallback(g=>{_optionalChain([o, 'optionalCall', _30 => _30(g)]),i.setHoverTime(null)},[o,i]),Q=R.useCallback(g=>{_optionalChain([a, 'optionalCall', _31 => _31(g)]),y(!0),k.current=!0,i.beginSeekInteraction()},[a,i]),D=R.useCallback(g=>{_optionalChain([r, 'optionalCall', _32 => _32(g)]),xr(g.key)&&i.endSeekInteraction()},[r,i]),h=R.useCallback((g,W)=>{let A=typeof g=="number"?g:g[0];A!==void 0&&(_optionalChain([l, 'optionalCall', _33 => _33(A,W)]),y(!1),v(!1),k.current=!1,!(W.reason==="keyboard"&&xr(W.event.key))&&i.endSeekInteraction())},[l,i]),$=R.useMemo(()=>{if(!i.buffered||i.buffered.length===0)return 0;for(let g=0;g<i.buffered.length;g++)if(i.buffered.start(g)<=i.currentTime&&i.currentTime<=i.buffered.end(g))return i.buffered.end(g);return i.buffered.end(0)},[i.buffered,i.currentTime]),U=i.duration>0?$/i.duration*100:0;R.useLayoutEffect(()=>{typeof t=="function"?t(f.current):t&&(t.current=f.current)});let q={currentTime:i.currentTime,duration:i.duration,progress:L,seeking:i.seeking,pressing:T,dragging:x,hoverTime:i.hoverTime,hoverProgress:i.hoverProgress},_=i.hoverProgress!==null,J=_nullishCoalesce(i.hoverProgress, () => (0)),Z=R.useMemo(()=>({sliderRef:f,previewThumbElement:b,setPreviewThumbElement:S,hoverProgress:J,open:_}),[f,b,S,J,_]),B={position:"relative","--seek-progress":`${L}%`,"--seek-buffered":`${U}%`,"--seek-current-time":i.currentTime,"--seek-duration":i.duration,"--seek-hover-progress":i.hoverProgress!==null?`${i.hoverProgress}%`:void 0,"--seek-hover-time":_nullishCoalesce(i.hoverTime, () => (void 0)),...p.style},I={"data-seeking":i.seeking||void 0,"data-hovering":i.hoverTime!==null||void 0,"data-pressing":T||void 0,"data-dragging":x||void 0,style:B};return s?_jsxruntime.jsx.call(void 0, pt.Provider,{value:Z,children:_jsxruntime.jsx.call(void 0, _slider.Slider.Root,{ref:f,min:0,max:i.duration||100,step:.1,value:i.currentTime,onValueChange:M,onValueCommitted:h,onPointerMove:w,onPointerLeave:H,onPointerDown:Q,onKeyUp:D,"aria-label":"Seek",render:g=>s({...g,...I,style:{...g.style,...I.style}},q)})}):_jsxruntime.jsx.call(void 0, pt.Provider,{value:Z,children:_jsxruntime.jsx.call(void 0, _slider.Slider.Root,{ref:f,min:0,max:i.duration||100,step:.1,value:i.currentTime,onValueChange:M,onValueCommitted:h,onPointerMove:w,onPointerLeave:H,onPointerDown:Q,onKeyUp:D,"aria-label":"Seek",...I,...p,children:_nullishCoalesce(u, () => (_jsxruntime.jsx.call(void 0, _slider.Slider.Control,{children:_jsxruntime.jsxs.call(void 0, _slider.Slider.Track,{style:{position:"relative"},children:[_jsxruntime.jsx.call(void 0, "div",{style:{position:"absolute",left:0,top:0,height:"100%",width:`${U}%`}}),_jsxruntime.jsx.call(void 0, _slider.Slider.Indicator,{}),_jsxruntime.jsx.call(void 0, _slider.Slider.Thumb,{})]})})))})})}),Br=_slider.Slider.Control,Vr=R.forwardRef(function(e,t){let{render:s,children:u,style:n,...o}=e,a={},r={position:"relative",...n},l={ref:t,style:r};return s?_jsxruntime.jsx.call(void 0, _slider.Slider.Track,{render:p=>s({...p,...l},a)}):_jsxruntime.jsx.call(void 0, _slider.Slider.Track,{ref:t,style:r,...o,children:u})}),wr=R.forwardRef(function(e,t){let{render:s,children:u,style:n,...o}=e,a=P("SeekSliderProgress"),l={progress:a.duration>0?a.currentTime/a.duration*100:0},p={height:"100%",...n},i={ref:t,style:p};return s?_jsxruntime.jsx.call(void 0, _slider.Slider.Indicator,{render:f=>s({...f,...i,style:{...f.style,...p}},l)}):_jsxruntime.jsx.call(void 0, _slider.Slider.Indicator,{ref:t,style:p,...o,children:u})}),Lr=R.forwardRef(function(e,t){let{render:s,children:u,style:n,...o}=e,a={},r={ref:t,style:_nullishCoalesce(n, () => ({}))};return s?_jsxruntime.jsx.call(void 0, _slider.Slider.Thumb,{render:l=>s({...l,...r,style:{...l.style,...n}},a)}):_jsxruntime.jsx.call(void 0, _slider.Slider.Thumb,{ref:t,style:n,...o,children:u})}),Hr=R.forwardRef(function(e,t){let{render:s,children:u,...n}=e,o=P("SeekSliderBuffered"),a=R.useMemo(()=>{if(!o.buffered||o.buffered.length===0)return 0;for(let f=0;f<o.buffered.length;f++)if(o.buffered.start(f)<=o.currentTime&&o.currentTime<=o.buffered.end(f))return o.buffered.end(f);return o.buffered.end(0)},[o.buffered,o.currentTime]),r=o.duration>0?a/o.duration*100:0,l={bufferedPercentage:r},p={position:"absolute",left:0,top:0,height:"100%",width:`${r}%`,...n.style},i={ref:t,style:p};return s?s(i,l):_jsxruntime.jsx.call(void 0, "div",{...i,...n,children:u})}),Ir=R.forwardRef(function(e,t){let{keepMounted:s=!1,render:u,children:n,...o}=e,a=P("SeekSliderPreviewThumb"),r=Mr("SeekSliderPreviewThumb"),l=a.hoverProgress!==null,p=R.useRef(0);a.hoverProgress!==null&&(p.current=a.hoverProgress);let i=_nullishCoalesce(a.hoverProgress, () => (p.current)),{mounted:f,transitionStatus:b,elementRef:S}=G({open:l,keepMounted:s}),T=R.useCallback(k=>{S.current=k,r.setPreviewThumbElement(k),typeof t=="function"?t(k):t&&(t.current=k)},[t,S,r]),y={open:l,transitionStatus:b,hoverProgress:i},x={position:"absolute",left:`${i}%`,transform:"translateX(-50%)",pointerEvents:"none",...o.style},v={ref:T,style:x,"data-open":l||void 0,"data-closed":!l||void 0,"data-starting-style":b==="starting"||void 0,"data-ending-style":b==="ending"||void 0};return f?u?u(v,y):_jsxruntime.jsx.call(void 0, "span",{...v,...o,children:n}):null}),Dr=R.forwardRef(function(e,t){let{render:s,children:u,style:n,...o}=e,a=P("SeekSliderHover"),r=a.hoverProgress!==null,l=_nullishCoalesce(a.hoverProgress, () => (0)),p={hovering:r,hoverProgress:a.hoverProgress,hoverTime:a.hoverTime},i={position:"absolute",left:0,top:0,height:"100%",width:`${l}%`,pointerEvents:"none",...n},f={ref:t,style:i,"data-hovering":r||void 0};return s?s(f,p):_jsxruntime.jsx.call(void 0, "div",{...f,...o,children:u})});function Ye({children:c,container:e}){let t=P("SeekSliderPreviewTooltipPortal"),[s,u]=R.useState(!1);if(R.useEffect(()=>{u(!0)},[]),!s)return null;let n=_nullishCoalesce(_nullishCoalesce(e, () => (t.rootRef.current)), () => (document.body));return Cr.createPortal(c,n)}var Ge=R.forwardRef(function(e,t){let{sideOffset:s=8,collisionPadding:u=0,collisionBoundary:n,keepMounted:o=!1,children:a,style:r,...l}=e,p=Mr("SeekSliderPreviewTooltipPositioner"),{previewThumbElement:i,open:f,hoverProgress:b}=p,[S,T]=R.useState(null),{refs:y,floatingStyles:x,update:v}=_react2.useFloating.call(void 0, {placement:"top",middleware:[_react2.offset.call(void 0, s),_react2.shift.call(void 0, {boundary:n,padding:u})]});R.useLayoutEffect(()=>{i&&y.setReference(i)},[i,y]),R.useEffect(()=>{if(f&&i&&S)return _react2.autoUpdate.call(void 0, i,S,v)},[f,i,S,v]),R.useLayoutEffect(()=>{f&&i&&S&&v()},[b,f,i,S,v]);let k=R.useCallback(M=>{y.setFloating(M),T(M),typeof t=="function"?t(M):t&&(t.current=M)},[y,t]);return(o||f)&&!!i?_jsxruntime.jsx.call(void 0, "div",{ref:k,style:{...x,...r},"data-seek-slider-preview-tooltip-positioner":!0,"data-open":f||void 0,"data-closed":!f||void 0,...l,children:a}):null}),ze=R.forwardRef(function(e,t){let{children:s,...u}=e;return _jsxruntime.jsx.call(void 0, "div",{ref:t,"data-seek-slider-preview-tooltip-popup":!0,...u,children:s})});function fe({sideOffset:c,collisionPadding:e,collisionBoundary:t,keepMounted:s,container:u,children:n,...o}){return _jsxruntime.jsx.call(void 0, Ye,{container:u,children:_jsxruntime.jsx.call(void 0, Ge,{sideOffset:c,collisionPadding:e,collisionBoundary:t,keepMounted:s,children:_jsxruntime.jsx.call(void 0, ze,{...o,children:n})})})}fe.Portal=Ye;fe.Positioner=Ge;fe.Popup=ze;var Je=(s=>(s.loading="data-loading",s.ready="data-ready",s.error="data-error",s))(Je||{});var Or=F.forwardRef(function(e,t){let{time:s,crossOrigin:u="anonymous",render:n,children:o,width:a,height:r,...l}=e,p=P("Thumbnail"),i=F.useRef(null),f=F.useRef(null),b=F.useRef(null),[S,T]=F.useState("idle"),[y,x]=F.useState({width:160,height:90}),v=s!==void 0?s:p.hoverTime,k=F.useMemo(()=>{let h=p.videoRef.current;return h?h.currentSrc||h.src:null},[p.videoRef]);F.useEffect(()=>{if(!k)return;let h=document.createElement("video");h.src=k,h.crossOrigin=u,h.preload="metadata",h.muted=!0,h.playsInline=!0;let $=()=>{x({width:h.videoWidth,height:h.videoHeight})},U=()=>{T("error")};return h.addEventListener("loadedmetadata",$),h.addEventListener("error",U),f.current=h,()=>{h.removeEventListener("loadedmetadata",$),h.removeEventListener("error",U),h.src="",f.current=null}},[k,u]),F.useEffect(()=>{let h=f.current,$=i.current;if(!h||!$||v===null||v===void 0||b.current!==null&&Math.abs(b.current-v)<.1)return;T("loading");let U=()=>{let q=$.getContext("2d");if(q)try{q.drawImage(h,0,0,$.width,$.height),b.current=v,T("ready")}catch (e3){T("error")}};return h.addEventListener("seeked",U,{once:!0}),h.currentTime=v,()=>{h.removeEventListener("seeked",U)}},[v]);let L=F.useCallback(h=>{i.current=h,typeof t=="function"?t(h):t&&(t.current=h)},[t]),M=y.width/y.height,w=_nullishCoalesce(a, () => (160)),H=_nullishCoalesce(r, () => (Math.round(w/M)));typeof w=="string"&&(w=160),typeof H=="string"&&(H=90);let Q={loading:S==="loading",ready:S==="ready",error:S==="error",time:v,videoWidth:y.width,videoHeight:y.height},D={ref:L,width:w,height:H,"data-loading":S==="loading"||void 0,"data-ready":S==="ready"||void 0,"data-error":S==="error"||void 0};return n?n(D,Q):_jsxruntime.jsx.call(void 0, "canvas",{...D,...l,children:o})});var Ze=(e=>(e.hovering="data-hovering",e))(Ze||{});var Ar=et.forwardRef(function(e,t){let{format:s="current / duration",fixedWidth:u=!0,align:n="left",render:o,...a}=e,r=P("TimeDisplay"),l=et.useRef(0);r.hoverTime!==null&&(l.current=r.hoverTime);let p=r.duration-r.currentTime,i=me(r.currentTime),f=me(r.duration),b=me(p),S=r.hoverTime!==null?me(r.hoverTime):me(l.current),T={currentTime:r.currentTime,duration:r.duration,remaining:p,hoverTime:r.hoverTime,hovering:r.hoverTime!==null,formattedCurrent:i,formattedDuration:f,formattedRemaining:b,formattedHover:S},y=()=>{switch(s){case"current":return i;case"duration":return f;case"remaining":return`-${b}`;case"current / duration":return`${i} / ${f}`;case"current / remaining":return`${i} / -${b}`;case"hover":return S;default:return`${i} / ${f}`}},x=()=>{let k=Dn(r.duration);switch(s){case"current":case"duration":case"hover":return k;case"remaining":return`-${k}`;case"current / duration":return`${k} / ${k}`;case"current / remaining":return`${k} / -${k}`;default:return`${k} / ${k}`}},v={ref:t,style:{position:u?"relative":void 0,userSelect:"none",fontVariantNumeric:"tabular-nums",...a.style},"data-hovering":T.hovering||void 0};return o?o(v,T):_jsxruntime.jsx.call(void 0, "span",{ref:t,"data-hovering":T.hovering||void 0,...a,style:{position:u?"relative":void 0,userSelect:"none",fontVariantNumeric:"tabular-nums",...a.style},children:u?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":!0,style:{visibility:"hidden"},children:x()}),_jsxruntime.jsx.call(void 0, "span",{style:In(n),children:y()})]}):y()})});function In(c){let e={position:"absolute"};switch(c){case"left":return{...e,left:0};case"right":return{...e,right:0};case"center":return{...e,left:"50%",transform:"translateX(-50%)"}}}function me(c){if(!Number.isFinite(c)||Number.isNaN(c))return"0:00";let e=Math.floor(c/3600),t=Math.floor(c%3600/60),s=Math.floor(c%60);return e>0?`${e}:${t.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`:`${t}:${s.toString().padStart(2,"0")}`}function Dn(c){if(!Number.isFinite(c)||Number.isNaN(c)||c<=0)return"0:00";let e=Math.floor(c/3600),t=Math.floor(c%3600/60);if(e>0){let u=String(e).length;return`${"0".repeat(u)}:00:00`}let s=String(t).length;return`${"0".repeat(s)}:00`}var Wr=K.forwardRef(function(e,t){let{kind:s="captions",src:u,label:n,srcLang:o,default:a,...r}=e,{registerTrack:l,unregisterTrack:p,updateTrackRef:i,setTextTrack:f}=P("Track"),b=K.useRef(null),S=K.useId(),T=K.useCallback(y=>{typeof t=="function"?t(y):t&&(t.current=y),b.current=y},[t]);return K.useEffect(()=>(l({id:S,kind:s,label:n,srcLang:o,src:u,textTrack:null}),()=>{p(S)}),[S,s,n,o,u,l,p]),K.useEffect(()=>{let y=b.current;if(!y)return;let x=()=>{y.track&&(y.track.mode="disabled",i(S,y.track),a&&f(y.track))};return y.track&&x(),y.addEventListener("load",x),()=>{y.removeEventListener("load",x)}},[S,a,i,f]),_jsxruntime.jsx.call(void 0, "track",{ref:T,kind:s,src:u,label:n,srcLang:o,default:a,...r})});var Fr=ce.forwardRef(function(e,t){let{toggleOnClick:s=!0,...u}=e,n=P("Video"),o=ce.useRef(!1),a=ce.useCallback(p=>{typeof t=="function"?t(p):t&&(t.current=p),n.videoRef.current=p,p&&!o.current&&(o.current=!0,n._handlers.onVideoMount(),p.readyState>=1&&p.duration&&(n._handlers.onLoadedMetadata(),n._handlers.onDurationChange()),p.readyState>=3&&n._handlers.onCanPlay())},[t,n.videoRef,n._handlers]),r={"data-playing":n.playing||void 0,"data-paused":n.paused||void 0,"data-ended":n.ended||void 0,"data-waiting":n.waiting||void 0,"data-seeking":n.seeking||void 0},l=E({ref:a,preload:"metadata",...r,onClick(){s&&n.toggle()},onTimeUpdate:n._handlers.onTimeUpdate,onDurationChange:n._handlers.onDurationChange,onProgress:n._handlers.onProgress,onPlay:n._handlers.onPlay,onPause:n._handlers.onPause,onEnded:n._handlers.onEnded,onWaiting:n._handlers.onWaiting,onCanPlay:n._handlers.onCanPlay,onSeeking:n._handlers.onSeeking,onSeeked:n._handlers.onSeeked,onVolumeChange:n._handlers.onVolumeChange,onLoadedMetadata:n._handlers.onLoadedMetadata},u);return _jsxruntime.jsx.call(void 0, "video",{...l})});var tt=(t=>(t.volume="--volume",t.volumePercentage="--volume-percentage",t))(tt||{});var rt=(u=>(u.muted="data-muted",u.volume="data-volume",u.pressing="data-pressing",u.dragging="data-dragging",u))(rt||{});var Qr=O.forwardRef(function(e,t){let{render:s,children:u,onPointerDown:n,...o}=e,a=P("VolumeSlider"),r=O.useRef(null),[l,p]=O.useState(!1),[i,f]=O.useState(!1),b=O.useRef(!1);O.useEffect(()=>{if(!l)return;let M=()=>{p(!1),f(!1),b.current=!1};return window.addEventListener("pointerup",M),()=>window.removeEventListener("pointerup",M)},[l]),O.useLayoutEffect(()=>{typeof t=="function"?t(r.current):t&&(t.current=r.current)});let S=a.volume*100,T={volume:a.volume,muted:a.muted,percentage:S,pressing:l,dragging:i},y=O.useCallback(M=>{let w=typeof M=="number"?M:M[0];if(w!==void 0){if(a.muted){let H=a.videoRef.current;H&&(H.muted=!1)}a.setVolume(w),a.resetIdle(),b.current&&f(!0)}},[a]),x=O.useCallback(M=>{_optionalChain([n, 'optionalCall', _34 => _34(M)]),p(!0),b.current=!0},[n]),v={"data-muted":a.muted||void 0,"data-volume":a.volume,"data-pressing":l||void 0,"data-dragging":i||void 0},k={position:"relative","--volume":a.volume,"--volume-percentage":`${S}%`,...o.style},L={"data-muted":a.muted||void 0,"data-volume":a.volume,"data-pressing":l||void 0,"data-dragging":i||void 0,style:k};return s?_jsxruntime.jsx.call(void 0, _slider.Slider.Root,{ref:r,min:0,max:1,step:.01,value:a.muted?0:a.volume,onValueChange:y,onPointerDown:x,"aria-label":"Volume",render:M=>s({...M,...L},T)}):_jsxruntime.jsx.call(void 0, _slider.Slider.Root,{ref:r,min:0,max:1,step:.01,value:a.muted?0:a.volume,onValueChange:y,onPointerDown:x,"aria-label":"Volume",...v,...o,style:k,children:_nullishCoalesce(u, () => (_jsxruntime.jsx.call(void 0, _slider.Slider.Control,{children:_jsxruntime.jsxs.call(void 0, _slider.Slider.Track,{children:[_jsxruntime.jsx.call(void 0, _slider.Slider.Indicator,{}),_jsxruntime.jsx.call(void 0, _slider.Slider.Thumb,{})]})})))})}),$r=_slider.Slider.Control,Nr=O.forwardRef(function(e,t){let{style:s,...u}=e,n={position:"relative",...s};return _jsxruntime.jsx.call(void 0, _slider.Slider.Track,{ref:t,style:n,...u})}),jr=O.forwardRef(function(e,t){return _jsxruntime.jsx.call(void 0, _slider.Slider.Indicator,{ref:t,...e})}),Ur=O.forwardRef(function(e,t){return _jsxruntime.jsx.call(void 0, _slider.Slider.Thumb,{ref:t,...e})});exports.VideoPlayer = _r; exports.useVideoPlayer = ie;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkM4G6J7DPcjs = require('../chunk-M4G6J7DP.cjs');var _react = require('react'); var He = _interopRequireWildcard(_react); var Ie = _interopRequireWildcard(_react); var ar = _interopRequireWildcard(_react); var sr = _interopRequireWildcard(_react); var it = _interopRequireWildcard(_react); var fe = _interopRequireWildcard(_react); var X = _interopRequireWildcard(_react); var ue = _interopRequireWildcard(_react); var pr = _interopRequireWildcard(_react); var Qe = _interopRequireWildcard(_react); var ce = _interopRequireWildcard(_react); var yr = _interopRequireWildcard(_react); var Sr = _interopRequireWildcard(_react); var lt = _interopRequireWildcard(_react); var $e = _interopRequireWildcard(_react); var Ne = _interopRequireWildcard(_react); var dt = _interopRequireWildcard(_react); var d = _interopRequireWildcard(_react); var Ue = _interopRequireWildcard(_react); var R = _interopRequireWildcard(_react); var F = _interopRequireWildcard(_react); var tt = _interopRequireWildcard(_react); var K = _interopRequireWildcard(_react); var de = _interopRequireWildcard(_react); var O = _interopRequireWildcard(_react);var at=He.createContext(null);function P(c){let e=He.useContext(at);if(!e)throw new Error(`<VideoPlayer.${c}> must be used within <VideoPlayer.Root>`);return e}function ie(){return P("useVideoPlayer")}var Kr={};_chunkM4G6J7DPcjs.a.call(void 0, Kr,{BufferedIndicator:()=>nr,Captions:()=>ir,CaptionsButton:()=>lr,CaptionsDataAttributes:()=>De,CaptionsMenu:()=>ur,CaptionsMenuItem:()=>Ae,Controls:()=>cr,ControlsDataAttributes:()=>We,FullscreenButton:()=>dr,MuteButton:()=>fr,Overlay:()=>mr,OverlayDataAttributes:()=>Fe,PictureInPictureButton:()=>Pr,PlayButton:()=>Rr,PlaybackRateButton:()=>br,PlaybackRateMenu:()=>kr,PlaybackRateMenuItem:()=>ut,Portal:()=>gr,Poster:()=>vr,QualityMenu:()=>Tr,QualityMenuItem:()=>pt,Root:()=>xr,RootDataAttributes:()=>je,SeekSlider:()=>Br,SeekSliderBuffered:()=>Ir,SeekSliderControl:()=>Vr,SeekSliderCssVars:()=>qe,SeekSliderDataAttributes:()=>Xe,SeekSliderHover:()=>Or,SeekSliderPreviewThumb:()=>Dr,SeekSliderPreviewThumbDataAttributes:()=>Ye,SeekSliderPreviewTooltip:()=>me,SeekSliderPreviewTooltipPopup:()=>Je,SeekSliderPreviewTooltipPortal:()=>Ge,SeekSliderPreviewTooltipPositioner:()=>ze,SeekSliderProgress:()=>Lr,SeekSliderThumb:()=>Hr,SeekSliderTrack:()=>wr,Thumbnail:()=>Ar,ThumbnailDataAttributes:()=>Ze,TimeDisplay:()=>Wr,TimeDisplayDataAttributes:()=>et,Track:()=>Fr,Video:()=>Qr,VolumeSlider:()=>$r,VolumeSliderControl:()=>Nr,VolumeSliderCssVars:()=>rt,VolumeSliderDataAttributes:()=>nt,VolumeSliderRange:()=>Ur,VolumeSliderThumb:()=>_r,VolumeSliderTrack:()=>jr,useTransitionStatus:()=>Y,useVideoPlayer:()=>ie});var _jsxruntime = require('react/jsx-runtime');var nr=Ie.forwardRef(function(e,t){let{render:s,...u}=e,n=P("BufferedIndicator"),o=Ie.useMemo(()=>{if(!n.buffered||n.buffered.length===0)return 0;for(let i=0;i<n.buffered.length;i++)if(n.buffered.start(i)<=n.currentTime&&n.currentTime<=n.buffered.end(i))return n.buffered.end(i);return n.buffered.end(0)},[n.buffered,n.currentTime]),a=n.duration>0?o/n.duration*100:0,r={buffered:n.buffered,duration:n.duration,bufferedPercentage:a,bufferedEnd:o},l={"--buffered-percentage":`${a}%`,"--buffered-end":o,...u.style},p={ref:t,style:l,"aria-hidden":!0};return s?s(p,r):_jsxruntime.jsx.call(void 0, "div",{ref:t,"aria-hidden":"true",...u,style:l})});var De=(e=>(e.active="data-active",e))(De||{});var ir=ar.forwardRef(function(e,t){let{render:s,children:u,...n}=e,a=P("Captions").activeCues,r=a.map(f=>f.text).join(`
2
+ `),l=a.length>0,p={active:l,cueText:r,cues:a},i={ref:t,"aria-live":"polite","aria-atomic":!0,role:"status",style:{pointerEvents:"none"},"data-active":l||void 0};return s?s(i,p):u?_jsxruntime.jsx.call(void 0, "div",{...i,...n,children:u}):_jsxruntime.jsx.call(void 0, "div",{...i,...n,children:r})});var _mergeprops = require('@base-ui/react/merge-props');function E(c,e){return _mergeprops.mergeProps.call(void 0, c,on(e))}function on(c){let e={...c};for(let t in e){let s=e[t];an(t,s)&&(e[t]=(u,...n)=>(_mergeprops.makeEventPreventable.call(void 0, u),s(u,...n)))}return e}function an(c,e){return c.charCodeAt(0)===111&&c.charCodeAt(1)===110&&c.charCodeAt(2)>=65&&c.charCodeAt(2)<=90&&typeof e=="function"}var lr=sr.forwardRef(function(e,t){let{render:s,...u}=e,n=P("CaptionsButton"),o=n.registeredTracks.length>0,a=n.activeTextTrack!==null,r={active:a,available:o,trackCount:n.registeredTracks.length},l=E({ref:t,type:"button","aria-label":a?"Disable captions":"Enable captions","aria-pressed":a,disabled:!o,"data-active":a||void 0,"data-available":o||void 0,onClick(){if(a)n.setTextTrack(null);else if(n.registeredTracks.length>0){let p=n.registeredTracks[0];_optionalChain([p, 'optionalAccess', _2 => _2.textTrack])&&n.setTextTrack(p.textTrack)}}},u);return s?s(l,r):_jsxruntime.jsx.call(void 0, "button",{...l})});var ur=it.forwardRef(function(e,t){let{render:s,children:u,...n}=e,o=P("CaptionsMenu"),a={registeredTracks:o.registeredTracks,activeTextTrack:o.activeTextTrack},r={ref:t,role:"menu","aria-label":"Captions","data-active":o.activeTextTrack!==null||void 0};return s?s(r,a):_jsxruntime.jsx.call(void 0, "div",{...r,...n,children:_nullishCoalesce(u, () => (_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, Ae,{track:null,children:"Off"}),o.registeredTracks.map(l=>_jsxruntime.jsx.call(void 0, Ae,{track:l.textTrack,children:l.label},l.id))]})))})}),Ae=it.forwardRef(function(e,t){let{track:s,children:u,...n}=e,o=P("CaptionsMenuItem"),a=o.activeTextTrack===s,r=E({ref:t,type:"button",role:"menuitemradio","aria-checked":a,"data-active":a||void 0,onClick(){o.setTextTrack(s)}},n);return _jsxruntime.jsx.call(void 0, "button",{...r,children:u})});var We=(r=>(r.open="data-open",r.closed="data-closed",r.idle="data-idle",r.playing="data-playing",r.paused="data-paused",r.ended="data-ended",r.startingStyle="data-starting-style",r.endingStyle="data-ending-style",r))(We||{});function cn(c){let e=[...c.getAnimations(),...Array.from(c.querySelectorAll("*")).flatMap(t=>t.getAnimations())];return e.length===0?Promise.resolve():Promise.all(e.map(t=>t.finished)).then(()=>{}).catch(()=>{})}function Y(c){let{open:e,keepMounted:t=!1}=c,[s,u]=X.useState(e||t),[n,o]=X.useState(e?"starting":void 0),a=X.useRef(null),r=X.useRef(!1);return X.useEffect(()=>{if(e){r.current=!1,u(!0),o("starting");let l=requestAnimationFrame(()=>{requestAnimationFrame(()=>{o(void 0)})});return()=>cancelAnimationFrame(l)}},[e]),X.useEffect(()=>{if(!e&&s&&!r.current){o("ending");let l=a.current;if(!l){o(void 0),t||u(!1);return}r.current=!0;let p=requestAnimationFrame(()=>{requestAnimationFrame(()=>{cn(l).then(()=>{r.current&&(r.current=!1,o(void 0),t||u(!1))})})});return()=>{cancelAnimationFrame(p)}}},[e,s,t]),X.useEffect(()=>{t&&!s&&!e&&u(!0)},[t,s,e]),{mounted:s||t,transitionStatus:n,elementRef:a}}var cr=fe.forwardRef(function(e,t){let{idleTimeout:s,keepMounted:u=!1,render:n,children:o,...a}=e,r=P("Controls"),p=(_nullishCoalesce(s, () => (r.idleTimeout)))===0||!r.idle,{mounted:i,transitionStatus:f,elementRef:b}=Y({open:p,keepMounted:u}),S=fe.useCallback(L=>{b.current=L,typeof t=="function"?t(L):t&&(t.current=L)},[t,b]),{onClick:T,...y}=a,x=fe.useCallback(L=>{L.stopPropagation(),_optionalChain([T, 'optionalCall', _3 => _3(L)])},[T]),v={open:p,idle:r.idle,playing:r.playing,paused:r.paused,ended:r.ended},k={ref:S,onClick:x,"data-open":p||void 0,"data-closed":!p||void 0,"data-idle":r.idle||void 0,"data-playing":r.playing||void 0,"data-paused":r.paused||void 0,"data-ended":r.ended||void 0,"data-starting-style":f==="starting"||void 0,"data-ending-style":f==="ending"||void 0};return i?n?n(k,v):_jsxruntime.jsx.call(void 0, "div",{...k,...y,children:o}):null});var dr=ue.forwardRef(function(e,t){let{render:s,children:u,...n}=e,o=P("FullscreenButton"),[a,r]=ue.useState(!1);ue.useEffect(()=>{r("fullscreenEnabled"in document&&document.fullscreenEnabled)},[]);let l={fullscreen:o.fullscreen,supported:a},p=E({ref:t,type:"button","aria-label":o.fullscreen?"Exit fullscreen":"Enter fullscreen","aria-pressed":o.fullscreen,disabled:!a,"data-fullscreen":o.fullscreen||void 0,"data-supported":a||void 0,onClick(){o.toggleFullscreen()}},n);return s?s(p,l):_jsxruntime.jsx.call(void 0, "button",{...p,children:u})});var fr=pr.forwardRef(function(e,t){let{render:s,...u}=e,n=P("MuteButton"),o={muted:n.muted,volume:n.volume},a=n.volume,r=n.muted,l=a===0||r,p=a>0&&!r,i=!r&&a>0&&a<.5,f=!r&&a>=.5,b=E({ref:t,type:"button","aria-label":n.muted?"Unmute":"Mute","aria-pressed":n.muted,"data-muted":r||void 0,"data-volume-off":l||void 0,"data-volume-on":p||void 0,"data-volume-low":i||void 0,"data-volume-high":f||void 0,onClick(){n.toggleMute()}},u);return s?s(b,o):_jsxruntime.jsx.call(void 0, "button",{...b})});var Fe=(i=>(i.open="data-open",i.closed="data-closed",i.playing="data-playing",i.paused="data-paused",i.ended="data-ended",i.waiting="data-waiting",i.seeking="data-seeking",i.fullscreen="data-fullscreen",i.pip="data-pip",i.startingStyle="data-starting-style",i.endingStyle="data-ending-style",i))(Fe||{});var mr=Qe.forwardRef(function(e,t){let{idleTimeout:s,keepMounted:u=!1,render:n,children:o,...a}=e,r=P("Overlay"),p=(_nullishCoalesce(s, () => (r.idleTimeout)))===0||!r.idle,{mounted:i,transitionStatus:f,elementRef:b}=Y({open:p,keepMounted:u}),S=Qe.useCallback(x=>{b.current=x,typeof t=="function"?t(x):t&&(t.current=x)},[t,b]),T={playing:r.playing,paused:r.paused,ended:r.ended,waiting:r.waiting,seeking:r.seeking,fullscreen:r.fullscreen,pictureInPicture:r.pictureInPicture,open:p},y=E({ref:S,onClick(){r.toggle()},"data-playing":r.playing||void 0,"data-paused":r.paused||void 0,"data-ended":r.ended||void 0,"data-waiting":r.waiting||void 0,"data-seeking":r.seeking||void 0,"data-fullscreen":r.fullscreen||void 0,"data-pip":r.pictureInPicture||void 0,"data-open":p||void 0,"data-closed":!p||void 0,"data-starting-style":f==="starting"||void 0,"data-ending-style":f==="ending"||void 0},a);return i?n?n(y,T):_jsxruntime.jsx.call(void 0, "div",{...y,...a,children:o}):null});var Pr=ce.forwardRef(function(e,t){let{render:s,...u}=e,n=P("PictureInPictureButton"),[o,a]=ce.useState(!1);ce.useEffect(()=>{a("pictureInPictureEnabled"in document&&document.pictureInPictureEnabled)},[]);let r={pictureInPicture:n.pictureInPicture,supported:o},l=E({ref:t,type:"button","aria-label":n.pictureInPicture?"Exit picture-in-picture":"Enter picture-in-picture","aria-pressed":n.pictureInPicture,disabled:!o,"data-pip":n.pictureInPicture||void 0,"data-supported":o||void 0,onClick(){n.togglePictureInPicture()}},u);return s?s(l,r):_jsxruntime.jsx.call(void 0, "button",{...l})});var Rr=yr.forwardRef(function(e,t){let{render:s,children:u,...n}=e,o=P("PlayButton"),a={playing:o.playing,paused:o.paused,ended:o.ended,waiting:o.waiting},r=E({ref:t,type:"button","aria-label":o.playing?"Pause":"Play","data-playing":o.playing||void 0,"data-paused":o.paused||void 0,"data-ended":o.ended||void 0,"data-waiting":o.waiting||void 0,onClick(){o.toggle()}},n);return s?s(r,a):_jsxruntime.jsx.call(void 0, "button",{...r,children:u})});var Rn=[.25,.5,.75,1,1.25,1.5,1.75,2],br=Sr.forwardRef(function(e,t){let{rates:s=Rn,render:u,children:n,...o}=e,a=P("PlaybackRateButton"),r={playbackRate:a.playbackRate,rates:s},l=E({ref:t,type:"button","aria-label":`Playback speed: ${a.playbackRate}x`,"data-rate":a.playbackRate,onClick(){let p=s.indexOf(a.playbackRate),i=_nullishCoalesce(_nullishCoalesce(s[(p+1)%s.length], () => (s[0])), () => (a.playbackRate));a.setPlaybackRate(i)}},o);return u?u(l,r):_jsxruntime.jsx.call(void 0, "button",{...l,children:_nullishCoalesce(n, () => (`${a.playbackRate}x`))})});var bn=[.25,.5,.75,1,1.25,1.5,1.75,2],kr=lt.forwardRef(function(e,t){let{rates:s=bn,render:u,children:n,...o}=e,a=P("PlaybackRateMenu"),r={playbackRate:a.playbackRate,rates:s},l={ref:t,role:"menu","aria-label":"Playback speed","data-rate":a.playbackRate};return u?u(l,r):_jsxruntime.jsx.call(void 0, "div",{...l,...o,children:_nullishCoalesce(n, () => (s.map(p=>_jsxruntime.jsx.call(void 0, ut,{rate:p},p))))})}),ut=lt.forwardRef(function(e,t){let{rate:s,children:u,...n}=e,o=P("PlaybackRateMenuItem"),a=o.playbackRate===s,r=E({ref:t,type:"button",role:"menuitemradio","aria-checked":a,"data-active":a||void 0,onClick(){o.setPlaybackRate(s)}},n);return _jsxruntime.jsx.call(void 0, "button",{...r,children:_nullishCoalesce(u, () => (`${s}x`))})});var _reactdom = require('react-dom'); var Mr = _interopRequireWildcard(_reactdom);function gr(c){let{children:e,container:t}=c,[s,u]=$e.useState(!1);if($e.useEffect(()=>(u(!0),()=>u(!1)),[]),!s)return null;let n=_nullishCoalesce(t, () => ((typeof document<"u"?document.body:null)));return n?_reactdom.createPortal.call(void 0, e,n):null}var vr=Ne.forwardRef(function(e,t){let{keepMounted:s=!1,render:u,children:n,...o}=e,a=P("Poster"),r=!a.canPlay,l=a.canPlay,{mounted:p,transitionStatus:i,elementRef:f}=Y({open:r,keepMounted:s}),b=gn(t,f),S={loading:r,loaded:l,transitionStatus:i},T={ref:b,"aria-hidden":!0,"data-loading":r||void 0,"data-loaded":l||void 0,"data-starting-style":i==="starting"||void 0,"data-ending-style":i==="ending"||void 0};return p?u?u(T,S):_jsxruntime.jsx.call(void 0, "div",{...T,...o,children:n}):null});function gn(...c){return Ne.useCallback(e=>{for(let t of c)typeof t=="function"?t(e):t!=null&&(t.current=e)},c)}var Tr=dt.forwardRef(function(e,t){let{render:s,children:u,...n}=e,o=P("QualityMenu"),a={qualities:o.qualities,activeQuality:o.activeQuality},r={ref:t,role:"menu","aria-label":"Video quality","data-quality":_nullishCoalesce(_optionalChain([o, 'access', _4 => _4.activeQuality, 'optionalAccess', _5 => _5.label]), () => (void 0))};return s?s(r,a):_jsxruntime.jsx.call(void 0, "div",{...r,...n,children:_nullishCoalesce(u, () => (o.qualities.map(l=>_jsxruntime.jsx.call(void 0, pt,{quality:l,children:l.label},l.label))))})}),pt=dt.forwardRef(function(e,t){let{quality:s,children:u,...n}=e,o=P("QualityMenuItem"),a=_optionalChain([o, 'access', _6 => _6.activeQuality, 'optionalAccess', _7 => _7.label])===s.label,r=E({ref:t,type:"button",role:"menuitemradio","aria-checked":a,"data-active":a||void 0,onClick(){o.setQuality(s)}},n);return _jsxruntime.jsx.call(void 0, "button",{...r,children:u})});var je=(l=>(l.playing="data-playing",l.paused="data-paused",l.ended="data-ended",l.waiting="data-waiting",l.seeking="data-seeking",l.fullscreen="data-fullscreen",l.pip="data-pip",l.muted="data-muted",l.idle="data-idle",l))(je||{});function Tn(c,e){return!(c instanceof HTMLElement)||c instanceof HTMLInputElement&&c.type==="range"&&e===" "?!1:c.tagName==="INPUT"||c.tagName==="TEXTAREA"||c.isContentEditable}function hn(c){return c==="ArrowRight"||c==="ArrowLeft"}function hr(c,e){let t=ie(),s=Ue.useRef(t);s.current=t,Ue.useEffect(()=>{if(e==="none")return;let u=a=>{if(Tn(a.target,a.key))return;let r=s.current;switch(a.key){case" ":a.preventDefault(),r.toggle();break;case"f":case"F":a.preventDefault(),r.toggleFullscreen();break;case"ArrowUp":a.preventDefault(),r.setVolume(Math.min(r.volume+.1,1));break;case"ArrowDown":a.preventDefault(),r.setVolume(Math.max(r.volume-.1,0));break;case"ArrowRight":a.preventDefault(),r.beginSeekInteraction(),r.seek(Math.min(r.currentTime+5,r.duration));break;case"ArrowLeft":a.preventDefault(),r.beginSeekInteraction(),r.seek(Math.max(r.currentTime-5,0));break;default:return}r.resetIdle()},n=a=>{hn(a.key)&&s.current.endSeekInteraction()};if(e==="global")return window.addEventListener("keydown",u),window.addEventListener("keyup",n),()=>{window.removeEventListener("keydown",u),window.removeEventListener("keyup",n)};let o=c.current;if(o)return o.addEventListener("keydown",u),o.addEventListener("keyup",n),()=>{o.removeEventListener("keydown",u),o.removeEventListener("keyup",n)}},[e,c])}function _e(c,e,t){let[s,u]=d.useState(e),n=c!==void 0,o=n?c:s,a=d.useCallback(r=>{let l=typeof r=="function"?r(o):r;n||u(l),_optionalChain([t, 'optionalCall', _8 => _8(l)])},[n,o,t]);return[o,a]}function xn({rootRef:c,videoRef:e,actionsRef:t,defaultPlaying:s=!1,autoPlay:u=!1,defaultVolume:n=1,defaultMuted:o=!1,defaultPlaybackRate:a=1,playing:r,onPlayingChange:l,volume:p,onVolumeChange:i,muted:f,onMutedChange:b,playbackRate:S,onPlaybackRateChange:T,currentTime:y,onCurrentTimeChange:x,idleTimeout:v=3e3,preventIdleWhenPaused:k=!1,idle:L,onIdleChange:M,onEnded:w,onWaiting:H,onSeeking:Q,onSeeked:D,onFullscreenChange:h,onPictureInPictureChange:$,children:U}){let q=d.useRef(1),_=d.useRef(!1),z=d.useRef(!1),Z=d.useRef(!1),[B,I]=d.useState("paused"),[g,A]=d.useState(s?"play":"pause");d.useEffect(()=>{r!==void 0&&(A(r?"play":"pause"),B!=="waiting"&&I(r?"playing":"paused"))},[r,B]);let[W,te]=_e(p,n,i),[J,pe]=_e(f,o,b),[Pt,yt]=_e(S,a,T),[qr,re]=_e(L,!0,M),ne=d.useRef(null),ye=d.useCallback(()=>{ne.current&&(clearTimeout(ne.current),ne.current=null)},[]),Rt=d.useCallback(()=>{v!==0&&(ye(),ne.current=setTimeout(()=>{re(!0)},v))},[v,ye,re]),St=d.useCallback(()=>{re(!1),Rt()},[re,Rt]),bt=d.useCallback(()=>{ye(),re(!0)},[ye,re]);d.useEffect(()=>(v>0&&(ne.current=setTimeout(()=>{re(!0)},v)),()=>{ne.current&&clearTimeout(ne.current)}),[]);let kt=k&&B!=="playing"?!1:qr,se=d.useCallback(()=>{let m=e.current;m&&(m.muted!==J&&(m.muted=J),m.volume!==W&&(m.volume=W))},[J,e,W]),Re=d.useCallback(async()=>{let m=e.current;if(!(!u||!m||Z.current)){Z.current=!0,A("play"),se();try{await m.play(),I("playing"),_optionalChain([l, 'optionalCall', _9 => _9(!0)])}catch (e2){A("pause"),I("paused")}}},[u,l,se,e]);d.useEffect(()=>{if(!u){Z.current=!1;return}Re()},[u,Re]);let[gt,vt]=d.useState(0),[Se,Tt]=d.useState(0),[ht,Xr]=d.useState(null),[be,Yr]=d.useState(null),[xt,Ct]=d.useState(!1),[Mt,le]=d.useState(!1),[ke,Gr]=d.useState(!1),[ge,Et]=d.useState(!1),[Bt,ot]=d.useState([]),[oe,zr]=d.useState(null),[Vt,ve]=d.useState([]),[wt,Nn]=d.useState([]),[Lt,Jr]=d.useState(null);d.useEffect(()=>{y!==void 0&&e.current&&(e.current.currentTime=y)},[y,e]),d.useEffect(()=>{f===void 0&&p===void 0||se()},[f,p,se]),d.useEffect(()=>{let m=()=>{let C=document.fullscreenElement===c.current;Gr(C),_optionalChain([h, 'optionalCall', _10 => _10(C)])};return document.addEventListener("fullscreenchange",m),()=>document.removeEventListener("fullscreenchange",m)},[h,c]),d.useEffect(()=>{let m=e.current;if(!m)return;let C=()=>{Et(!0),_optionalChain([$, 'optionalCall', _11 => _11(!0)])},N=()=>{Et(!1),_optionalChain([$, 'optionalCall', _12 => _12(!1)])};return m.addEventListener("enterpictureinpicture",C),m.addEventListener("leavepictureinpicture",N),()=>{m.removeEventListener("enterpictureinpicture",C),m.removeEventListener("leavepictureinpicture",N)}},[$,e]);let Te=d.useCallback(async()=>{e.current&&(A("play"),await e.current.play(),I("playing"),_optionalChain([l, 'optionalCall', _13 => _13(!0)]))},[e,l]),he=d.useCallback(()=>{e.current&&(A("pause"),e.current.pause(),I("paused"),_optionalChain([l, 'optionalCall', _14 => _14(!1)]))},[e,l]),xe=d.useCallback(async()=>{B==="playing"?he():await Te()},[B,Te,he]),Ce=d.useCallback(m=>{e.current&&(e.current.currentTime=m,vt(m),_optionalChain([x, 'optionalCall', _15 => _15(m)]))},[x,e]),Ht=d.useCallback(()=>{let m=e.current;!m||_.current||(_.current=!0,z.current=g==="play",le(!0),z.current&&!m.paused&&m.pause())},[g,e]),It=d.useCallback(()=>{let m=e.current;if(!m||!_.current)return;let C=z.current&&g==="play";if(_.current=!1,z.current=!1,!C){le(!1);return}m.play().then(()=>{I("playing"),le(!1)}).catch(()=>{I("waiting"),le(!1)})},[g,e]),Me=d.useCallback(m=>{let C=Math.max(0,Math.min(1,m));e.current&&(e.current.volume=C),te(C)},[te,e]),Dt=d.useCallback(()=>{if(!(J||W===0))q.current=W,e.current&&(e.current.muted=!0),pe(!0);else{let C=q.current>0?q.current:1;e.current&&(e.current.volume=C,e.current.muted=!1),te(C),pe(!1)}},[J,W,pe,te,e]),Ee=d.useCallback(async()=>{_optionalChain([c, 'access', _16 => _16.current, 'optionalAccess', _17 => _17.requestFullscreen])&&await c.current.requestFullscreen()},[c]),Be=d.useCallback(async()=>{document.exitFullscreen&&await document.exitFullscreen()},[]),Ve=d.useCallback(async()=>{ke?await Be():await Ee()},[ke,Ee,Be]),we=d.useCallback(async()=>{_optionalChain([e, 'access', _18 => _18.current, 'optionalAccess', _19 => _19.requestPictureInPicture])&&await e.current.requestPictureInPicture()},[e]),Le=d.useCallback(async()=>{document.pictureInPictureElement&&await document.exitPictureInPicture()},[]),Ot=d.useCallback(async()=>{ge?await Le():await we()},[ge,we,Le]),At=d.useCallback(m=>{e.current&&(e.current.playbackRate=m),yt(m)},[yt,e]),Wt=d.useCallback(m=>{if(e.current){for(let C=0;C<e.current.textTracks.length;C++){let N=e.current.textTracks[C];N&&(N.mode="disabled")}m&&(m.mode="hidden")}zr(m),ve([])},[e]),Ft=d.useCallback(m=>{Jr(m)},[]),Qt=d.useCallback(m=>{ot(C=>C.some(N=>N.id===m.id)?C:[...C,m])},[]),$t=d.useCallback(m=>{ot(C=>C.filter(N=>N.id!==m))},[]),Nt=d.useCallback((m,C)=>{ot(N=>N.map(ae=>ae.id===m?{...ae,textTrack:C}:ae))},[]);d.useEffect(()=>{if(!oe){ve([]);return}let m=()=>{let C=oe.activeCues;if(!C){ve([]);return}let N=[];for(let ae=0;ae<C.length;ae++){let rr=C[ae];rr instanceof VTTCue&&N.push(rr)}ve(N)};return m(),oe.addEventListener("cuechange",m),()=>{oe.removeEventListener("cuechange",m)}},[oe]),d.useImperativeHandle(t,()=>({toggle:xe,seek:Ce,setVolume:Me,toggleFullscreen:Ve}),[xe,Ce,Me,Ve]);let jt=d.useCallback(()=>{if(e.current){let m=e.current.currentTime;vt(m),_optionalChain([x, 'optionalCall', _20 => _20(m)])}},[x,e]),Ut=d.useCallback(()=>{e.current&&Tt(e.current.duration)},[e]),_t=d.useCallback(()=>{e.current&&Xr(e.current.buffered)},[e]),Kt=d.useCallback(()=>{A("play"),I("playing"),_optionalChain([l, 'optionalCall', _21 => _21(!0)])},[l]),qt=d.useCallback(()=>{_.current||B!=="ended"&&(I("paused"),_optionalChain([l, 'optionalCall', _22 => _22(!1)]))},[B,l]),Xt=d.useCallback(()=>{A("pause"),I("ended"),_optionalChain([l, 'optionalCall', _23 => _23(!1)]),_optionalChain([w, 'optionalCall', _24 => _24()])},[l,w]),Yt=d.useCallback(()=>{_.current||(I("waiting"),_optionalChain([H, 'optionalCall', _25 => _25()]))},[H]),Gt=d.useCallback(()=>{if(_.current){Ct(!0);return}if(B==="waiting"){let m=g==="play"?"playing":"paused";I(m),_optionalChain([l, 'optionalCall', _26 => _26(m==="playing")])}Ct(!0)},[B,g,l]),zt=d.useCallback(()=>{le(!0),B==="ended"&&I("paused"),_optionalChain([Q, 'optionalCall', _27 => _27()])},[B,Q]),Jt=d.useCallback(()=>{if(le(!1),e.current){let{currentTime:m,duration:C}=e.current;C>0&&C-m<.01&&I("ended")}_optionalChain([D, 'optionalCall', _28 => _28()])},[D,e]),Zt=d.useCallback(()=>{e.current&&(te(e.current.volume),pe(e.current.muted))},[te,pe,e]),er=d.useCallback(()=>{e.current&&Tt(e.current.duration)},[e]),tr=d.useCallback(()=>{se(),Re()},[Re,se]),Zr=d.useMemo(()=>({playbackStatus:B,playbackIntent:g,playing:B==="playing",paused:B==="paused",ended:B==="ended",waiting:B==="waiting",seeking:Mt,canPlay:xt,currentTime:gt,duration:Se,buffered:ht,hoverTime:be,hoverProgress:be!==null&&Se>0?be/Se*100:null,volume:W,muted:J,fullscreen:ke,pictureInPicture:ge,idle:kt,idleTimeout:v,preventIdleWhenPaused:k,registeredTracks:Bt,activeTextTrack:oe,activeCues:Vt,playbackRate:Pt,qualities:wt,activeQuality:Lt,videoRef:e,rootRef:c,play:Te,pause:he,toggle:xe,seek:Ce,setVolume:Me,toggleMute:Dt,enterFullscreen:Ee,exitFullscreen:Be,toggleFullscreen:Ve,enterPictureInPicture:we,exitPictureInPicture:Le,togglePictureInPicture:Ot,setPlaybackRate:At,setTextTrack:Wt,setQuality:Ft,registerTrack:Qt,unregisterTrack:$t,updateTrackRef:Nt,resetIdle:St,setHoverTime:Yr,beginSeekInteraction:Ht,endSeekInteraction:It,_handlers:{onTimeUpdate:jt,onDurationChange:Ut,onProgress:_t,onPlay:Kt,onPause:qt,onEnded:Xt,onWaiting:Yt,onCanPlay:Gt,onSeeking:zt,onSeeked:Jt,onVolumeChange:Zt,onLoadedMetadata:er,onVideoMount:tr,onRootMouseLeave:bt}}),[B,g,Mt,xt,gt,Se,ht,be,W,J,ke,ge,kt,v,k,Bt,oe,Vt,Pt,wt,Lt,e,c,Te,he,xe,Ce,Me,Dt,Ee,Be,Ve,we,Le,Ot,At,Wt,Ft,Qt,$t,Nt,St,Ht,It,jt,Ut,_t,Kt,qt,Xt,Yt,Gt,zt,Jt,Zt,er,tr,bt]);return _jsxruntime.jsx.call(void 0, at.Provider,{value:Zr,children:U})}var xr=d.forwardRef(function(e,t){let{actionsRef:s,keyboardShortcuts:u="focused",defaultPlaying:n,autoPlay:o,defaultVolume:a,defaultMuted:r,defaultPlaybackRate:l,playing:p,onPlayingChange:i,volume:f,onVolumeChange:b,muted:S,onMutedChange:T,playbackRate:y,onPlaybackRateChange:x,currentTime:v,onCurrentTimeChange:k,idleTimeout:L,preventIdleWhenPaused:M,hideCursorWhenIdle:w="fullscreen",idle:H,onIdleChange:Q,onEnded:D,onWaiting:h,onSeeking:$,onSeeked:U,onFullscreenChange:q,onPictureInPictureChange:_,children:z,...Z}=e,B=d.useRef(null),I=d.useRef(null);return _jsxruntime.jsx.call(void 0, xn,{actionsRef:s,defaultPlaying:n,autoPlay:o,defaultVolume:a,defaultMuted:r,defaultPlaybackRate:l,playing:p,onPlayingChange:i,volume:f,onVolumeChange:b,muted:S,onMutedChange:T,playbackRate:y,onPlaybackRateChange:x,currentTime:v,onCurrentTimeChange:k,idleTimeout:L,preventIdleWhenPaused:M,idle:H,onIdleChange:Q,onEnded:D,onWaiting:h,onSeeking:$,onSeeked:U,onFullscreenChange:q,onPictureInPictureChange:_,rootRef:B,videoRef:I,children:_jsxruntime.jsx.call(void 0, Cn,{ref:t,rootRef:B,keyboardShortcuts:u,hideCursorWhenIdle:w,...Z,children:z})})}),Cn=d.forwardRef(function({rootRef:e,keyboardShortcuts:t,hideCursorWhenIdle:s,children:u,className:n,style:o,...a},r){let l=ie(),p=Mn(r,e),i=d.useRef(null);hr(e,t);let f=d.useCallback(w=>{let{clientX:H,clientY:Q}=w,D=i.current;D&&D.x===H&&D.y===Q||(i.current={x:H,y:Q},l.resetIdle())},[l]),b=d.useCallback(w=>{let{clientX:H,clientY:Q}=w,D=i.current;D&&D.x===H&&D.y===Q||(i.current={x:H,y:Q},l.resetIdle())},[l]),S=d.useCallback(()=>{l._handlers.onRootMouseLeave()},[l._handlers]),T=d.useCallback(()=>{l.resetIdle()},[l]),y=d.useCallback(()=>{l.resetIdle()},[l]),x=d.useCallback(w=>{w.key==="Tab"&&l.resetIdle()},[l]),v=E({onMouseMove:f,onMouseEnter:b,onMouseLeave:S,onClick:T,onFocus:y,onKeyDown:x},a),k={"data-playing":l.playing||void 0,"data-paused":l.paused||void 0,"data-ended":l.ended||void 0,"data-waiting":l.waiting||void 0,"data-seeking":l.seeking||void 0,"data-fullscreen":l.fullscreen||void 0,"data-pip":l.pictureInPicture||void 0,"data-muted":l.muted||void 0,"data-idle":l.idle||void 0},L=s!==!1&&l.idle&&(s==="always"||s==="fullscreen"&&l.fullscreen),M=d.useId();return _jsxruntime.jsxs.call(void 0, "div",{...v,ref:p,tabIndex:t==="focused"?0:void 0,className:n,style:o,"data-video-player-scope":M,...k,children:[L&&_jsxruntime.jsx.call(void 0, "style",{children:`[data-video-player-scope="${M}"], [data-video-player-scope="${M}"] * { cursor: none !important; }`}),u]})});function Mn(...c){return d.useCallback(e=>{for(let t of c)typeof t=="function"?t(e):t!=null&&(t.current=e)},c)}var qe=(o=>(o.progress="--seek-progress",o.buffered="--seek-buffered",o.currentTime="--seek-current-time",o.duration="--seek-duration",o.hoverProgress="--seek-hover-progress",o.hoverTime="--seek-hover-time",o))(qe||{});var Xe=(u=>(u.seeking="data-seeking",u.hovering="data-hovering",u.pressing="data-pressing",u.dragging="data-dragging",u))(Xe||{});var _slider = require('@base-ui/react/slider');var _react2 = require('@floating-ui/react');var Ye=(u=>(u.open="data-open",u.closed="data-closed",u.startingStyle="data-starting-style",u.endingStyle="data-ending-style",u))(Ye||{});var ft=R.createContext(null);function Er(c){let e=R.useContext(ft);if(!e)throw new Error(`${c} must be used within SeekSlider`);return e}function Cr(c){return c==="ArrowRight"||c==="ArrowLeft"}var Br=R.forwardRef(function(e,t){let{render:s,children:u,onPointerMove:n,onPointerLeave:o,onPointerDown:a,onKeyUp:r,onValueCommitted:l,...p}=e,i=P("SeekSlider"),f=R.useRef(null),[b,S]=R.useState(null),[T,y]=R.useState(!1),[x,v]=R.useState(!1),k=R.useRef(!1);R.useEffect(()=>{if(!T)return;let g=()=>{y(!1),v(!1),k.current=!1,i.endSeekInteraction()};return window.addEventListener("pointerup",g),()=>window.removeEventListener("pointerup",g)},[T,i]);let L=i.duration>0?i.currentTime/i.duration*100:0,M=R.useCallback((g,A)=>{let W=typeof g=="number"?g:g[0];W!==void 0&&(A.reason==="keyboard"&&i.beginSeekInteraction(),i.seek(W),i.resetIdle(),k.current&&v(!0))},[i]),w=R.useCallback(g=>{if(_optionalChain([n, 'optionalCall', _29 => _29(g)]),!f.current||i.duration===0)return;let A=f.current.getBoundingClientRect(),W=g.clientX-A.left,J=Math.max(0,Math.min(1,W/A.width))*i.duration;i.setHoverTime(J)},[n,i]),H=R.useCallback(g=>{_optionalChain([o, 'optionalCall', _30 => _30(g)]),i.setHoverTime(null)},[o,i]),Q=R.useCallback(g=>{_optionalChain([a, 'optionalCall', _31 => _31(g)]),y(!0),k.current=!0,i.beginSeekInteraction()},[a,i]),D=R.useCallback(g=>{_optionalChain([r, 'optionalCall', _32 => _32(g)]),Cr(g.key)&&i.endSeekInteraction()},[r,i]),h=R.useCallback((g,A)=>{let W=typeof g=="number"?g:g[0];W!==void 0&&(_optionalChain([l, 'optionalCall', _33 => _33(W,A)]),y(!1),v(!1),k.current=!1,!(A.reason==="keyboard"&&Cr(A.event.key))&&i.endSeekInteraction())},[l,i]),$=R.useMemo(()=>{if(!i.buffered||i.buffered.length===0)return 0;for(let g=0;g<i.buffered.length;g++)if(i.buffered.start(g)<=i.currentTime&&i.currentTime<=i.buffered.end(g))return i.buffered.end(g);return i.buffered.end(0)},[i.buffered,i.currentTime]),U=i.duration>0?$/i.duration*100:0;R.useLayoutEffect(()=>{typeof t=="function"?t(f.current):t&&(t.current=f.current)});let q={currentTime:i.currentTime,duration:i.duration,progress:L,seeking:i.seeking,pressing:T,dragging:x,hoverTime:i.hoverTime,hoverProgress:i.hoverProgress},_=i.hoverProgress!==null,z=_nullishCoalesce(i.hoverProgress, () => (0)),Z=R.useMemo(()=>({sliderRef:f,previewThumbElement:b,setPreviewThumbElement:S,hoverProgress:z,open:_}),[f,b,S,z,_]),B={position:"relative","--seek-progress":`${L}%`,"--seek-buffered":`${U}%`,"--seek-current-time":i.currentTime,"--seek-duration":i.duration,"--seek-hover-progress":i.hoverProgress!==null?`${i.hoverProgress}%`:void 0,"--seek-hover-time":_nullishCoalesce(i.hoverTime, () => (void 0)),...p.style},I={"data-seeking":i.seeking||void 0,"data-hovering":i.hoverTime!==null||void 0,"data-pressing":T||void 0,"data-dragging":x||void 0,style:B};return s?_jsxruntime.jsx.call(void 0, ft.Provider,{value:Z,children:_jsxruntime.jsx.call(void 0, _slider.Slider.Root,{ref:f,min:0,max:i.duration||100,step:.1,value:i.currentTime,onValueChange:M,onValueCommitted:h,onPointerMove:w,onPointerLeave:H,onPointerDown:Q,onKeyUp:D,"aria-label":"Seek",render:g=>s({...g,...I,style:{...g.style,...I.style}},q)})}):_jsxruntime.jsx.call(void 0, ft.Provider,{value:Z,children:_jsxruntime.jsx.call(void 0, _slider.Slider.Root,{ref:f,min:0,max:i.duration||100,step:.1,value:i.currentTime,onValueChange:M,onValueCommitted:h,onPointerMove:w,onPointerLeave:H,onPointerDown:Q,onKeyUp:D,"aria-label":"Seek",...I,...p,children:_nullishCoalesce(u, () => (_jsxruntime.jsx.call(void 0, _slider.Slider.Control,{children:_jsxruntime.jsxs.call(void 0, _slider.Slider.Track,{style:{position:"relative"},children:[_jsxruntime.jsx.call(void 0, "div",{style:{position:"absolute",left:0,top:0,height:"100%",width:`${U}%`}}),_jsxruntime.jsx.call(void 0, _slider.Slider.Indicator,{}),_jsxruntime.jsx.call(void 0, _slider.Slider.Thumb,{})]})})))})})}),Vr=_slider.Slider.Control,wr=R.forwardRef(function(e,t){let{render:s,children:u,style:n,...o}=e,a={},r={position:"relative",...n},l={ref:t,style:r};return s?_jsxruntime.jsx.call(void 0, _slider.Slider.Track,{render:p=>s({...p,...l},a)}):_jsxruntime.jsx.call(void 0, _slider.Slider.Track,{ref:t,style:r,...o,children:u})}),Lr=R.forwardRef(function(e,t){let{render:s,children:u,style:n,...o}=e,a=P("SeekSliderProgress"),l={progress:a.duration>0?a.currentTime/a.duration*100:0},p={height:"100%",...n},i={ref:t,style:p};return s?_jsxruntime.jsx.call(void 0, _slider.Slider.Indicator,{render:f=>s({...f,...i,style:{...f.style,...p}},l)}):_jsxruntime.jsx.call(void 0, _slider.Slider.Indicator,{ref:t,style:p,...o,children:u})}),Hr=R.forwardRef(function(e,t){let{render:s,children:u,style:n,...o}=e,a={},r={ref:t,style:_nullishCoalesce(n, () => ({}))};return s?_jsxruntime.jsx.call(void 0, _slider.Slider.Thumb,{render:l=>s({...l,...r,style:{...l.style,...n}},a)}):_jsxruntime.jsx.call(void 0, _slider.Slider.Thumb,{ref:t,style:n,...o,children:u})}),Ir=R.forwardRef(function(e,t){let{render:s,children:u,...n}=e,o=P("SeekSliderBuffered"),a=R.useMemo(()=>{if(!o.buffered||o.buffered.length===0)return 0;for(let f=0;f<o.buffered.length;f++)if(o.buffered.start(f)<=o.currentTime&&o.currentTime<=o.buffered.end(f))return o.buffered.end(f);return o.buffered.end(0)},[o.buffered,o.currentTime]),r=o.duration>0?a/o.duration*100:0,l={bufferedPercentage:r},p={position:"absolute",left:0,top:0,height:"100%",width:`${r}%`,...n.style},i={ref:t,style:p};return s?s(i,l):_jsxruntime.jsx.call(void 0, "div",{...i,...n,children:u})}),Dr=R.forwardRef(function(e,t){let{keepMounted:s=!1,render:u,children:n,...o}=e,a=P("SeekSliderPreviewThumb"),r=Er("SeekSliderPreviewThumb"),l=a.hoverProgress!==null,p=R.useRef(0);a.hoverProgress!==null&&(p.current=a.hoverProgress);let i=_nullishCoalesce(a.hoverProgress, () => (p.current)),{mounted:f,transitionStatus:b,elementRef:S}=Y({open:l,keepMounted:s}),T=R.useCallback(k=>{S.current=k,r.setPreviewThumbElement(k),typeof t=="function"?t(k):t&&(t.current=k)},[t,S,r]),y={open:l,transitionStatus:b,hoverProgress:i},x={position:"absolute",left:`${i}%`,transform:"translateX(-50%)",pointerEvents:"none",...o.style},v={ref:T,style:x,"data-open":l||void 0,"data-closed":!l||void 0,"data-starting-style":b==="starting"||void 0,"data-ending-style":b==="ending"||void 0};return f?u?u(v,y):_jsxruntime.jsx.call(void 0, "span",{...v,...o,children:n}):null}),Or=R.forwardRef(function(e,t){let{render:s,children:u,style:n,...o}=e,a=P("SeekSliderHover"),r=a.hoverProgress!==null,l=_nullishCoalesce(a.hoverProgress, () => (0)),p={hovering:r,hoverProgress:a.hoverProgress,hoverTime:a.hoverTime},i={position:"absolute",left:0,top:0,height:"100%",width:`${l}%`,pointerEvents:"none",...n},f={ref:t,style:i,"data-hovering":r||void 0};return s?s(f,p):_jsxruntime.jsx.call(void 0, "div",{...f,...o,children:u})});function Ge({children:c,container:e}){let t=P("SeekSliderPreviewTooltipPortal"),[s,u]=R.useState(!1);if(R.useEffect(()=>{u(!0)},[]),!s)return null;let n=_nullishCoalesce(_nullishCoalesce(e, () => (t.rootRef.current)), () => (document.body));return Mr.createPortal(c,n)}var ze=R.forwardRef(function(e,t){let{sideOffset:s=8,collisionPadding:u=0,collisionBoundary:n,keepMounted:o=!1,children:a,style:r,...l}=e,p=Er("SeekSliderPreviewTooltipPositioner"),{previewThumbElement:i,open:f,hoverProgress:b}=p,[S,T]=R.useState(null),{refs:y,floatingStyles:x,update:v}=_react2.useFloating.call(void 0, {placement:"top",middleware:[_react2.offset.call(void 0, s),_react2.shift.call(void 0, {boundary:n,padding:u})]});R.useLayoutEffect(()=>{i&&y.setReference(i)},[i,y]),R.useEffect(()=>{if(f&&i&&S)return _react2.autoUpdate.call(void 0, i,S,v)},[f,i,S,v]),R.useLayoutEffect(()=>{f&&i&&S&&v()},[b,f,i,S,v]);let k=R.useCallback(M=>{y.setFloating(M),T(M),typeof t=="function"?t(M):t&&(t.current=M)},[y,t]);return(o||f)&&!!i?_jsxruntime.jsx.call(void 0, "div",{ref:k,style:{...x,...r},"data-seek-slider-preview-tooltip-positioner":!0,"data-open":f||void 0,"data-closed":!f||void 0,...l,children:a}):null}),Je=R.forwardRef(function(e,t){let{children:s,...u}=e;return _jsxruntime.jsx.call(void 0, "div",{ref:t,"data-seek-slider-preview-tooltip-popup":!0,...u,children:s})});function me({sideOffset:c,collisionPadding:e,collisionBoundary:t,keepMounted:s,container:u,children:n,...o}){return _jsxruntime.jsx.call(void 0, Ge,{container:u,children:_jsxruntime.jsx.call(void 0, ze,{sideOffset:c,collisionPadding:e,collisionBoundary:t,keepMounted:s,children:_jsxruntime.jsx.call(void 0, Je,{...o,children:n})})})}me.Portal=Ge;me.Positioner=ze;me.Popup=Je;var Ze=(s=>(s.loading="data-loading",s.ready="data-ready",s.error="data-error",s))(Ze||{});var Ar=F.forwardRef(function(e,t){let{time:s,crossOrigin:u="anonymous",render:n,children:o,width:a,height:r,...l}=e,p=P("Thumbnail"),i=F.useRef(null),f=F.useRef(null),b=F.useRef(null),[S,T]=F.useState("idle"),[y,x]=F.useState({width:160,height:90}),v=s!==void 0?s:p.hoverTime,k=F.useMemo(()=>{let h=p.videoRef.current;return h?h.currentSrc||h.src:null},[p.videoRef]);F.useEffect(()=>{if(!k)return;let h=document.createElement("video");h.src=k,h.crossOrigin=u,h.preload="metadata",h.muted=!0,h.playsInline=!0;let $=()=>{x({width:h.videoWidth,height:h.videoHeight})},U=()=>{T("error")};return h.addEventListener("loadedmetadata",$),h.addEventListener("error",U),f.current=h,()=>{h.removeEventListener("loadedmetadata",$),h.removeEventListener("error",U),h.src="",f.current=null}},[k,u]),F.useEffect(()=>{let h=f.current,$=i.current;if(!h||!$||v===null||v===void 0||b.current!==null&&Math.abs(b.current-v)<.1)return;T("loading");let U=()=>{let q=$.getContext("2d");if(q)try{q.drawImage(h,0,0,$.width,$.height),b.current=v,T("ready")}catch (e3){T("error")}};return h.addEventListener("seeked",U,{once:!0}),h.currentTime=v,()=>{h.removeEventListener("seeked",U)}},[v]);let L=F.useCallback(h=>{i.current=h,typeof t=="function"?t(h):t&&(t.current=h)},[t]),M=y.width/y.height,w=_nullishCoalesce(a, () => (160)),H=_nullishCoalesce(r, () => (Math.round(w/M)));typeof w=="string"&&(w=160),typeof H=="string"&&(H=90);let Q={loading:S==="loading",ready:S==="ready",error:S==="error",time:v,videoWidth:y.width,videoHeight:y.height},D={ref:L,width:w,height:H,"data-loading":S==="loading"||void 0,"data-ready":S==="ready"||void 0,"data-error":S==="error"||void 0};return n?n(D,Q):_jsxruntime.jsx.call(void 0, "canvas",{...D,...l,children:o})});var et=(e=>(e.hovering="data-hovering",e))(et||{});var Wr=tt.forwardRef(function(e,t){let{format:s="current / duration",fixedWidth:u=!0,align:n="left",render:o,...a}=e,r=P("TimeDisplay"),l=tt.useRef(0);r.hoverTime!==null&&(l.current=r.hoverTime);let p=r.duration-r.currentTime,i=Pe(r.currentTime),f=Pe(r.duration),b=Pe(p),S=r.hoverTime!==null?Pe(r.hoverTime):Pe(l.current),T={currentTime:r.currentTime,duration:r.duration,remaining:p,hoverTime:r.hoverTime,hovering:r.hoverTime!==null,formattedCurrent:i,formattedDuration:f,formattedRemaining:b,formattedHover:S},y=()=>{switch(s){case"current":return i;case"duration":return f;case"remaining":return`-${b}`;case"current / duration":return`${i} / ${f}`;case"current / remaining":return`${i} / -${b}`;case"hover":return S;default:return`${i} / ${f}`}},x=()=>{let k=On(r.duration);switch(s){case"current":case"duration":case"hover":return k;case"remaining":return`-${k}`;case"current / duration":return`${k} / ${k}`;case"current / remaining":return`${k} / -${k}`;default:return`${k} / ${k}`}},v={ref:t,style:{position:u?"relative":void 0,userSelect:"none",fontVariantNumeric:"tabular-nums",...a.style},"data-hovering":T.hovering||void 0};return o?o(v,T):_jsxruntime.jsx.call(void 0, "span",{ref:t,"data-hovering":T.hovering||void 0,...a,style:{position:u?"relative":void 0,userSelect:"none",fontVariantNumeric:"tabular-nums",...a.style},children:u?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":!0,style:{visibility:"hidden"},children:x()}),_jsxruntime.jsx.call(void 0, "span",{style:Dn(n),children:y()})]}):y()})});function Dn(c){let e={position:"absolute"};switch(c){case"left":return{...e,left:0};case"right":return{...e,right:0};case"center":return{...e,left:"50%",transform:"translateX(-50%)"}}}function Pe(c){if(!Number.isFinite(c)||Number.isNaN(c))return"0:00";let e=Math.floor(c/3600),t=Math.floor(c%3600/60),s=Math.floor(c%60);return e>0?`${e}:${t.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`:`${t}:${s.toString().padStart(2,"0")}`}function On(c){if(!Number.isFinite(c)||Number.isNaN(c)||c<=0)return"0:00";let e=Math.floor(c/3600),t=Math.floor(c%3600/60);if(e>0){let u=String(e).length;return`${"0".repeat(u)}:00:00`}let s=String(t).length;return`${"0".repeat(s)}:00`}var Fr=K.forwardRef(function(e,t){let{kind:s="captions",src:u,label:n,srcLang:o,default:a,...r}=e,{registerTrack:l,unregisterTrack:p,updateTrackRef:i,setTextTrack:f}=P("Track"),b=K.useRef(null),S=K.useId(),T=K.useCallback(y=>{typeof t=="function"?t(y):t&&(t.current=y),b.current=y},[t]);return K.useEffect(()=>(l({id:S,kind:s,label:n,srcLang:o,src:u,textTrack:null}),()=>{p(S)}),[S,s,n,o,u,l,p]),K.useEffect(()=>{let y=b.current;if(!y)return;let x=()=>{y.track&&(y.track.mode="disabled",i(S,y.track),a&&f(y.track))};return y.track&&x(),y.addEventListener("load",x),()=>{y.removeEventListener("load",x)}},[S,a,i,f]),_jsxruntime.jsx.call(void 0, "track",{ref:T,kind:s,src:u,label:n,srcLang:o,default:a,...r})});var Qr=de.forwardRef(function(e,t){let{toggleOnClick:s=!0,...u}=e,n=P("Video"),o=de.useRef(!1),a=de.useCallback(p=>{typeof t=="function"?t(p):t&&(t.current=p),n.videoRef.current=p,p&&!o.current&&(o.current=!0,n._handlers.onVideoMount(),p.readyState>=1&&p.duration&&(n._handlers.onLoadedMetadata(),n._handlers.onDurationChange()),p.readyState>=3&&n._handlers.onCanPlay())},[t,n.videoRef,n._handlers]),r={"data-playing":n.playing||void 0,"data-paused":n.paused||void 0,"data-ended":n.ended||void 0,"data-waiting":n.waiting||void 0,"data-seeking":n.seeking||void 0},l=E({ref:a,preload:"metadata",...r,onClick(){s&&n.toggle()},onTimeUpdate:n._handlers.onTimeUpdate,onDurationChange:n._handlers.onDurationChange,onProgress:n._handlers.onProgress,onPlay:n._handlers.onPlay,onPause:n._handlers.onPause,onEnded:n._handlers.onEnded,onWaiting:n._handlers.onWaiting,onCanPlay:n._handlers.onCanPlay,onSeeking:n._handlers.onSeeking,onSeeked:n._handlers.onSeeked,onVolumeChange:n._handlers.onVolumeChange,onLoadedMetadata:n._handlers.onLoadedMetadata},u);return _jsxruntime.jsx.call(void 0, "video",{...l})});var rt=(t=>(t.volume="--volume",t.volumePercentage="--volume-percentage",t))(rt||{});var nt=(u=>(u.muted="data-muted",u.volume="data-volume",u.pressing="data-pressing",u.dragging="data-dragging",u))(nt||{});var $r=O.forwardRef(function(e,t){let{render:s,children:u,onPointerDown:n,...o}=e,a=P("VolumeSlider"),r=O.useRef(null),[l,p]=O.useState(!1),[i,f]=O.useState(!1),b=O.useRef(!1);O.useEffect(()=>{if(!l)return;let M=()=>{p(!1),f(!1),b.current=!1};return window.addEventListener("pointerup",M),()=>window.removeEventListener("pointerup",M)},[l]),O.useLayoutEffect(()=>{typeof t=="function"?t(r.current):t&&(t.current=r.current)});let S=a.volume*100,T={volume:a.volume,muted:a.muted,percentage:S,pressing:l,dragging:i},y=O.useCallback(M=>{let w=typeof M=="number"?M:M[0];if(w!==void 0){if(a.muted){let H=a.videoRef.current;H&&(H.muted=!1)}a.setVolume(w),a.resetIdle(),b.current&&f(!0)}},[a]),x=O.useCallback(M=>{_optionalChain([n, 'optionalCall', _34 => _34(M)]),p(!0),b.current=!0},[n]),v={"data-muted":a.muted||void 0,"data-volume":a.volume,"data-pressing":l||void 0,"data-dragging":i||void 0},k={position:"relative","--volume":a.volume,"--volume-percentage":`${S}%`,...o.style},L={"data-muted":a.muted||void 0,"data-volume":a.volume,"data-pressing":l||void 0,"data-dragging":i||void 0,style:k};return s?_jsxruntime.jsx.call(void 0, _slider.Slider.Root,{ref:r,min:0,max:1,step:.01,value:a.muted?0:a.volume,onValueChange:y,onPointerDown:x,"aria-label":"Volume",render:M=>s({...M,...L},T)}):_jsxruntime.jsx.call(void 0, _slider.Slider.Root,{ref:r,min:0,max:1,step:.01,value:a.muted?0:a.volume,onValueChange:y,onPointerDown:x,"aria-label":"Volume",...v,...o,style:k,children:_nullishCoalesce(u, () => (_jsxruntime.jsx.call(void 0, _slider.Slider.Control,{children:_jsxruntime.jsxs.call(void 0, _slider.Slider.Track,{children:[_jsxruntime.jsx.call(void 0, _slider.Slider.Indicator,{}),_jsxruntime.jsx.call(void 0, _slider.Slider.Thumb,{})]})})))})}),Nr=_slider.Slider.Control,jr=O.forwardRef(function(e,t){let{style:s,...u}=e,n={position:"relative",...s};return _jsxruntime.jsx.call(void 0, _slider.Slider.Track,{ref:t,style:n,...u})}),Ur=O.forwardRef(function(e,t){return _jsxruntime.jsx.call(void 0, _slider.Slider.Indicator,{ref:t,...e})}),_r=O.forwardRef(function(e,t){return _jsxruntime.jsx.call(void 0, _slider.Slider.Thumb,{ref:t,...e})});exports.VideoPlayer = Kr; exports.useVideoPlayer = ie;
3
3
  //# sourceMappingURL=index.cjs.map