@videojs/html 0.1.0-preview.3 → 0.1.0-preview.4

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 (123) hide show
  1. package/dist/button-D1DWjsQu.js +57 -0
  2. package/dist/button-D1DWjsQu.js.map +1 -0
  3. package/dist/component-factory-DeAN6cjC.js +47 -0
  4. package/dist/component-factory-DeAN6cjC.js.map +1 -0
  5. package/dist/current-time-display-C3qndGf5.js +47 -0
  6. package/dist/current-time-display-C3qndGf5.js.map +1 -0
  7. package/dist/custom-element-3bDlB2XO.js +10 -0
  8. package/dist/custom-element-3bDlB2XO.js.map +1 -0
  9. package/dist/define/index.d.ts +12 -0
  10. package/dist/define/index.js +27 -0
  11. package/dist/define/media-container.d.ts +1 -0
  12. package/dist/define/media-container.js +3 -0
  13. package/dist/define/media-current-time-display.d.ts +1 -0
  14. package/dist/define/media-current-time-display.js +4 -0
  15. package/dist/define/media-duration-display.d.ts +1 -0
  16. package/dist/define/media-duration-display.js +4 -0
  17. package/dist/define/media-fullscreen-button.d.ts +1 -0
  18. package/dist/define/media-fullscreen-button.js +5 -0
  19. package/dist/define/media-mute-button.d.ts +1 -0
  20. package/dist/define/media-mute-button.js +5 -0
  21. package/dist/define/media-play-button.d.ts +1 -0
  22. package/dist/define/media-play-button.js +5 -0
  23. package/dist/define/media-popover.d.ts +1 -0
  24. package/dist/define/media-popover.js +3 -0
  25. package/dist/define/media-preview-time-display.d.ts +1 -0
  26. package/dist/define/media-preview-time-display.js +4 -0
  27. package/dist/define/media-provider.d.ts +1 -0
  28. package/dist/define/media-provider.js +3 -0
  29. package/dist/define/media-time-slider.d.ts +1 -0
  30. package/dist/define/media-time-slider.js +4 -0
  31. package/dist/define/media-tooltip.d.ts +1 -0
  32. package/dist/define/media-tooltip.js +3 -0
  33. package/dist/define/media-volume-slider.d.ts +1 -0
  34. package/dist/define/media-volume-slider.js +4 -0
  35. package/dist/duration-display-JOPp3bdU.js +49 -0
  36. package/dist/duration-display-JOPp3bdU.js.map +1 -0
  37. package/dist/fullscreen-button-CGO2UJjs.js +48 -0
  38. package/dist/fullscreen-button-CGO2UJjs.js.map +1 -0
  39. package/dist/{icons-eJws_3Te.js → icons-CuxuONCk.js} +20 -57
  40. package/dist/icons-CuxuONCk.js.map +1 -0
  41. package/dist/icons.d.ts +1 -2
  42. package/dist/icons.js +2 -3
  43. package/dist/index-LKrIp3Oo.d.ts +1 -0
  44. package/dist/index.d.ts +172 -4
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +16 -9
  47. package/dist/media-container-BGEXSi9g.js +8 -0
  48. package/dist/media-container-BGEXSi9g.js.map +1 -0
  49. package/dist/media-container-C0MUzkJ_.js +83 -0
  50. package/dist/media-container-C0MUzkJ_.js.map +1 -0
  51. package/dist/media-container-DPnFjmtK.d.ts +1 -0
  52. package/dist/media-current-time-display-B-4Cp845.js +8 -0
  53. package/dist/media-current-time-display-B-4Cp845.js.map +1 -0
  54. package/dist/media-current-time-display-Cd0rPAuj.d.ts +1 -0
  55. package/dist/media-duration-display-BLMr7VHo.js +8 -0
  56. package/dist/media-duration-display-BLMr7VHo.js.map +1 -0
  57. package/dist/media-duration-display-qvm6YX-q.d.ts +1 -0
  58. package/dist/media-fullscreen-button-BgUK3lgu.d.ts +1 -0
  59. package/dist/media-fullscreen-button-Dcflbt54.js +8 -0
  60. package/dist/media-fullscreen-button-Dcflbt54.js.map +1 -0
  61. package/dist/media-mute-button-BOVhZ3aP.js +8 -0
  62. package/dist/media-mute-button-BOVhZ3aP.js.map +1 -0
  63. package/dist/media-mute-button-NVJF2EEW.d.ts +1 -0
  64. package/dist/media-play-button-CLj-hkwn.js +8 -0
  65. package/dist/media-play-button-CLj-hkwn.js.map +1 -0
  66. package/dist/media-play-button-oq8yDlxe.d.ts +1 -0
  67. package/dist/media-popover-BtJmPv0E.d.ts +1 -0
  68. package/dist/media-popover-F4M4Tq4z.js +8 -0
  69. package/dist/media-popover-F4M4Tq4z.js.map +1 -0
  70. package/dist/media-preview-time-display-4YX5Rics.d.ts +1 -0
  71. package/dist/media-preview-time-display-DAiMgLPX.js +8 -0
  72. package/dist/media-preview-time-display-DAiMgLPX.js.map +1 -0
  73. package/dist/media-provider-CyoL0bCx.js +17 -0
  74. package/dist/media-provider-CyoL0bCx.js.map +1 -0
  75. package/dist/media-provider-D7P2TLXG.d.ts +1 -0
  76. package/dist/media-provider-D_GL2_DN.js +8 -0
  77. package/dist/media-provider-D_GL2_DN.js.map +1 -0
  78. package/dist/media-skin-Di3vSHvS.d.ts +11 -0
  79. package/dist/media-skin-Di3vSHvS.d.ts.map +1 -0
  80. package/dist/media-skin-mHWwUPg3.js +36 -0
  81. package/dist/media-skin-mHWwUPg3.js.map +1 -0
  82. package/dist/media-time-slider-Bp2qnwsW.js +12 -0
  83. package/dist/media-time-slider-Bp2qnwsW.js.map +1 -0
  84. package/dist/media-time-slider-DvMnfYXZ.d.ts +1 -0
  85. package/dist/media-tooltip-BqV17mdM.d.ts +1 -0
  86. package/dist/media-tooltip-ClcVafMb.js +14 -0
  87. package/dist/media-tooltip-ClcVafMb.js.map +1 -0
  88. package/dist/media-volume-slider-CKSxmdQv.js +11 -0
  89. package/dist/media-volume-slider-CKSxmdQv.js.map +1 -0
  90. package/dist/media-volume-slider-DP47VLVi.d.ts +1 -0
  91. package/dist/mute-button-vW2sLqqY.js +50 -0
  92. package/dist/mute-button-vW2sLqqY.js.map +1 -0
  93. package/dist/play-button-aVb0g10G.js +44 -0
  94. package/dist/play-button-aVb0g10G.js.map +1 -0
  95. package/dist/popover-Dc0hyhwB.js +187 -0
  96. package/dist/popover-Dc0hyhwB.js.map +1 -0
  97. package/dist/{media-preview-time-display-C7jpAct6.js → preview-time-display-Dax0FQ2X.js} +6 -6
  98. package/dist/preview-time-display-Dax0FQ2X.js.map +1 -0
  99. package/dist/skins/frosted.d.ts +16 -5
  100. package/dist/skins/frosted.d.ts.map +1 -1
  101. package/dist/skins/frosted.js +46 -20
  102. package/dist/skins/frosted.js.map +1 -1
  103. package/dist/skins/minimal.d.ts +16 -5
  104. package/dist/skins/minimal.d.ts.map +1 -1
  105. package/dist/skins/minimal.js +46 -20
  106. package/dist/skins/minimal.js.map +1 -1
  107. package/dist/time-slider-CA1GMs6A.js +201 -0
  108. package/dist/time-slider-CA1GMs6A.js.map +1 -0
  109. package/dist/tooltip-54fBUUpb.js +296 -0
  110. package/dist/tooltip-54fBUUpb.js.map +1 -0
  111. package/dist/volume-slider-guD8gqpi.js +206 -0
  112. package/dist/volume-slider-guD8gqpi.js.map +1 -0
  113. package/package.json +8 -4
  114. package/dist/chunk-Bp6m_JJh.js +0 -13
  115. package/dist/icons-eJws_3Te.js.map +0 -1
  116. package/dist/index-AcYRyuAY.d.ts +0 -76
  117. package/dist/index-AcYRyuAY.d.ts.map +0 -1
  118. package/dist/index.js.map +0 -1
  119. package/dist/media-preview-time-display-C7jpAct6.js.map +0 -1
  120. package/dist/media-skin-D44BfH6y.d.ts +0 -182
  121. package/dist/media-skin-D44BfH6y.d.ts.map +0 -1
  122. package/dist/media-skin-DR8zj-LV.js +0 -1324
  123. package/dist/media-skin-DR8zj-LV.js.map +0 -1
@@ -0,0 +1,201 @@
1
+ import { t as toConnectedHTMLComponent } from "./component-factory-DeAN6cjC.js";
2
+ import { timeSliderStateDefinition } from "@videojs/core/store";
3
+ import { setAttributes } from "@videojs/utils/dom";
4
+ import { TimeSlider } from "@videojs/core";
5
+
6
+ //#region src/elements/time-slider.ts
7
+ /**
8
+ * TimeSlider Root props hook - equivalent to React's useTimeSliderRootProps
9
+ * Handles element attributes and properties based on state
10
+ */
11
+ const getTimeSliderRootProps = (state, element) => {
12
+ const formatTime = (time) => {
13
+ return `${Math.floor(time / 60)}:${Math.floor(time % 60).toString().padStart(2, "0")}`;
14
+ };
15
+ const currentTimeText = formatTime(state.currentTime);
16
+ const durationText = formatTime(state.duration);
17
+ return {
18
+ role: "slider",
19
+ tabindex: element.getAttribute("tabindex") ?? "0",
20
+ "data-current-time": state.currentTime.toString(),
21
+ "data-duration": state.duration.toString(),
22
+ "data-orientation": element.orientation || "horizontal",
23
+ "aria-label": "Seek",
24
+ "aria-valuemin": "0",
25
+ "aria-valuemax": Math.round(state.duration).toString(),
26
+ "aria-valuenow": Math.round(state.currentTime).toString(),
27
+ "aria-valuetext": `${currentTimeText} of ${durationText}`,
28
+ "aria-orientation": element.orientation || "horizontal"
29
+ };
30
+ };
31
+ var TimeSliderRoot = class extends HTMLElement {
32
+ constructor(..._args) {
33
+ super(..._args);
34
+ this._core = null;
35
+ }
36
+ static {
37
+ this.observedAttributes = ["orientation"];
38
+ }
39
+ get currentTime() {
40
+ return this._state?.currentTime ?? 0;
41
+ }
42
+ get duration() {
43
+ return this._state?.duration ?? 0;
44
+ }
45
+ get orientation() {
46
+ return this.getAttribute("orientation") || "horizontal";
47
+ }
48
+ attributeChangedCallback(name, _oldValue, _newValue) {
49
+ if (name === "orientation" && this._state) this._render(getTimeSliderRootProps(this._state, this), this._state);
50
+ }
51
+ _update(_props, state) {
52
+ this._state = state;
53
+ if (state && !this._core) {
54
+ this._core = new TimeSlider();
55
+ this._core.subscribe(() => this._render(getTimeSliderRootProps(state, this), state));
56
+ this._core.attach(this);
57
+ state.core = this._core;
58
+ }
59
+ this._core?.setState(state);
60
+ }
61
+ _render(props, state) {
62
+ const coreState = state?.core?.getState();
63
+ if (!coreState) return;
64
+ this.style.setProperty("--slider-fill", `${Math.round(coreState._fillWidth)}%`);
65
+ this.style.setProperty("--slider-pointer", `${Math.round(coreState._pointerWidth)}%`);
66
+ setAttributes(this, props);
67
+ }
68
+ };
69
+ var TimeSliderTrack = class extends HTMLElement {
70
+ constructor() {
71
+ super();
72
+ }
73
+ connectedCallback() {
74
+ const rootElement = this.closest("media-time-slider");
75
+ if (rootElement?._state?.core) rootElement._state.core.setState({ _trackElement: this });
76
+ }
77
+ _update(props, _state) {
78
+ setAttributes(this, props);
79
+ if (props["data-orientation"] === "horizontal") {
80
+ this.style.width = "100%";
81
+ this.style.removeProperty("height");
82
+ } else {
83
+ this.style.height = "100%";
84
+ this.style.removeProperty("width");
85
+ }
86
+ }
87
+ };
88
+ var TimeSliderProgress = class extends HTMLElement {
89
+ constructor() {
90
+ super();
91
+ this.style.position = "absolute";
92
+ this.style.width = "var(--slider-fill, 0%)";
93
+ this.style.height = "100%";
94
+ }
95
+ _update(props, _state) {
96
+ setAttributes(this, props);
97
+ if (props["data-orientation"] === "horizontal") {
98
+ this.style.width = "var(--slider-fill, 0%)";
99
+ this.style.height = "100%";
100
+ this.style.top = "0";
101
+ this.style.removeProperty("bottom");
102
+ } else {
103
+ this.style.height = "var(--slider-fill, 0%)";
104
+ this.style.width = "100%";
105
+ this.style.bottom = "0";
106
+ this.style.removeProperty("top");
107
+ }
108
+ }
109
+ };
110
+ var TimeSliderPointer = class extends HTMLElement {
111
+ constructor() {
112
+ super();
113
+ this.style.position = "absolute";
114
+ this.style.width = "var(--slider-pointer, 0%)";
115
+ this.style.height = "100%";
116
+ }
117
+ _update(props, _state) {
118
+ setAttributes(this, props);
119
+ if (props["data-orientation"] === "horizontal") {
120
+ this.style.width = "var(--slider-pointer, 0%)";
121
+ this.style.height = "100%";
122
+ this.style.top = "0";
123
+ this.style.removeProperty("bottom");
124
+ } else {
125
+ this.style.height = "var(--slider-pointer, 0%)";
126
+ this.style.width = "100%";
127
+ this.style.bottom = "0";
128
+ this.style.removeProperty("top");
129
+ }
130
+ }
131
+ };
132
+ var TimeSliderThumb = class extends HTMLElement {
133
+ constructor() {
134
+ super();
135
+ this.style.position = "absolute";
136
+ }
137
+ _update(props, _state) {
138
+ setAttributes(this, props);
139
+ if (props["data-orientation"] === "horizontal") {
140
+ this.style.left = "var(--slider-fill, 0%)";
141
+ this.style.top = "50%";
142
+ this.style.translate = "-50% -50%";
143
+ } else {
144
+ this.style.bottom = "var(--slider-fill, 0%)";
145
+ this.style.left = "50%";
146
+ this.style.translate = "-50% 50%";
147
+ }
148
+ }
149
+ };
150
+ const useTimeSliderRootState = {
151
+ keys: timeSliderStateDefinition.keys,
152
+ transform: (rawState, mediaStore) => ({
153
+ ...timeSliderStateDefinition.stateTransform(rawState),
154
+ ...timeSliderStateDefinition.createRequestMethods(mediaStore.dispatch),
155
+ core: null
156
+ })
157
+ };
158
+ const getTimeSliderTrackProps = (_state, element) => {
159
+ const rootElement = element.closest("media-time-slider");
160
+ return { "data-orientation": rootElement?.orientation || "horizontal" };
161
+ };
162
+ const getTimeSliderProgressProps = (_state, element) => {
163
+ const rootElement = element.closest("media-time-slider");
164
+ return { "data-orientation": rootElement?.orientation || "horizontal" };
165
+ };
166
+ const getTimeSliderPointerProps = (_state, element) => {
167
+ const rootElement = element.closest("media-time-slider");
168
+ return { "data-orientation": rootElement?.orientation || "horizontal" };
169
+ };
170
+ const getTimeSliderThumbProps = (_state, element) => {
171
+ const rootElement = element.closest("media-time-slider");
172
+ return { "data-orientation": rootElement?.orientation || "horizontal" };
173
+ };
174
+ const TimeSliderRootElement = toConnectedHTMLComponent(TimeSliderRoot, useTimeSliderRootState, getTimeSliderRootProps, "TimeSliderRoot");
175
+ const TimeSliderTrackElement = toConnectedHTMLComponent(TimeSliderTrack, {
176
+ keys: [],
177
+ transform: () => ({})
178
+ }, getTimeSliderTrackProps, "TimeSliderTrack");
179
+ const TimeSliderProgressElement = toConnectedHTMLComponent(TimeSliderProgress, {
180
+ keys: [],
181
+ transform: () => ({})
182
+ }, getTimeSliderProgressProps, "TimeSliderProgress");
183
+ const TimeSliderPointerElement = toConnectedHTMLComponent(TimeSliderPointer, {
184
+ keys: [],
185
+ transform: () => ({})
186
+ }, getTimeSliderPointerProps, "TimeSliderPointer");
187
+ const TimeSliderThumbElement = toConnectedHTMLComponent(TimeSliderThumb, {
188
+ keys: [],
189
+ transform: () => ({})
190
+ }, getTimeSliderThumbProps, "TimeSliderThumb");
191
+ const TimeSliderElement = Object.assign({}, {
192
+ Root: TimeSliderRootElement,
193
+ Track: TimeSliderTrackElement,
194
+ Progress: TimeSliderProgressElement,
195
+ Pointer: TimeSliderPointerElement,
196
+ Thumb: TimeSliderThumbElement
197
+ });
198
+
199
+ //#endregion
200
+ export { TimeSliderThumbElement as a, TimeSliderRootElement as i, TimeSliderPointerElement as n, TimeSliderTrackElement as o, TimeSliderProgressElement as r, TimeSliderElement as t };
201
+ //# sourceMappingURL=time-slider-CA1GMs6A.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time-slider-CA1GMs6A.js","names":["getTimeSliderRootProps: PropsHook<{\n currentTime: number;\n duration: number;\n requestSeek: (time: number) => void;\n core: CoreTimeSlider | null;\n}>","CoreTimeSlider","useTimeSliderRootState: StateHook<{\n currentTime: number;\n duration: number;\n requestSeek: (time: number) => void;\n core: CoreTimeSlider | null;\n}>","getTimeSliderTrackProps: PropsHook<Record<string, never>>","getTimeSliderProgressProps: PropsHook<Record<string, never>>","getTimeSliderPointerProps: PropsHook<Record<string, never>>","getTimeSliderThumbProps: PropsHook<Record<string, never>>","TimeSliderRootElement: ConnectedComponentConstructor<{\n currentTime: number;\n duration: number;\n requestSeek: (time: number) => void;\n core: CoreTimeSlider | null;\n}>","TimeSliderTrackElement: ConnectedComponentConstructor<any>","TimeSliderProgressElement: ConnectedComponentConstructor<any>","TimeSliderPointerElement: ConnectedComponentConstructor<any>","TimeSliderThumbElement: ConnectedComponentConstructor<any>"],"sources":["../src/elements/time-slider.ts"],"sourcesContent":["import type { ConnectedComponentConstructor, PropsHook, StateHook } from '../utils/component-factory';\n\nimport { TimeSlider as CoreTimeSlider } from '@videojs/core';\nimport { timeSliderStateDefinition } from '@videojs/core/store';\n\nimport { setAttributes } from '@videojs/utils/dom';\nimport { toConnectedHTMLComponent } from '../utils/component-factory';\n\ninterface TimeSliderRootState {\n currentTime: number;\n duration: number;\n requestSeek: (time: number) => void;\n core: CoreTimeSlider | null;\n}\n\n/**\n * TimeSlider Root props hook - equivalent to React's useTimeSliderRootProps\n * Handles element attributes and properties based on state\n */\nexport const getTimeSliderRootProps: PropsHook<{\n currentTime: number;\n duration: number;\n requestSeek: (time: number) => void;\n core: CoreTimeSlider | null;\n}> = (state, element) => {\n const formatTime = (time: number) => {\n const minutes = Math.floor(time / 60);\n const seconds = Math.floor(time % 60);\n return `${minutes}:${seconds.toString().padStart(2, '0')}`;\n };\n\n const currentTimeText = formatTime(state.currentTime);\n const durationText = formatTime(state.duration);\n\n const baseProps: Record<string, any> = {\n role: 'slider',\n tabindex: element.getAttribute('tabindex') ?? '0',\n 'data-current-time': state.currentTime.toString(),\n 'data-duration': state.duration.toString(),\n 'data-orientation': (element as any).orientation || 'horizontal',\n 'aria-label': 'Seek',\n 'aria-valuemin': '0',\n 'aria-valuemax': Math.round(state.duration).toString(),\n 'aria-valuenow': Math.round(state.currentTime).toString(),\n 'aria-valuetext': `${currentTimeText} of ${durationText}`,\n 'aria-orientation': (element as any).orientation || 'horizontal',\n };\n\n return baseProps;\n};\n\nexport class TimeSliderRoot extends HTMLElement {\n static readonly observedAttributes: readonly string[] = ['orientation'];\n\n _state: TimeSliderRootState | undefined;\n _core: CoreTimeSlider | null = null;\n\n get currentTime(): number {\n return this._state?.currentTime ?? 0;\n }\n\n get duration(): number {\n return this._state?.duration ?? 0;\n }\n\n get orientation(): 'horizontal' | 'vertical' {\n return (this.getAttribute('orientation') as 'horizontal' | 'vertical') || 'horizontal';\n }\n\n attributeChangedCallback(name: string, _oldValue: string | null, _newValue: string | null): void {\n if (name === 'orientation' && this._state) {\n this._render(getTimeSliderRootProps(this._state, this), this._state);\n }\n }\n\n _update(_props: any, state: any): void {\n this._state = state;\n\n if (state && !this._core) {\n this._core = new CoreTimeSlider();\n this._core.subscribe(() => this._render(getTimeSliderRootProps(state, this), state));\n this._core.attach(this);\n state.core = this._core;\n }\n\n this._core?.setState(state);\n }\n\n _render(props: any, state: any): void {\n const coreState = state?.core?.getState();\n if (!coreState) return;\n\n this.style.setProperty('--slider-fill', `${Math.round(coreState._fillWidth)}%`);\n this.style.setProperty('--slider-pointer', `${Math.round(coreState._pointerWidth)}%`);\n\n setAttributes(this, props);\n }\n}\n\nexport class TimeSliderTrack extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback(): void {\n // Set this element as the track element in the core TimeSlider\n const rootElement = this.closest('media-time-slider') as any;\n if (rootElement?._state?.core) {\n rootElement._state.core.setState({ _trackElement: this });\n }\n }\n\n _update(props: any, _state: any): void {\n setAttributes(this, props);\n\n if (props['data-orientation'] === 'horizontal') {\n this.style.width = '100%';\n this.style.removeProperty('height');\n } else {\n this.style.height = '100%';\n this.style.removeProperty('width');\n }\n }\n}\n\nexport class TimeSliderProgress extends HTMLElement {\n constructor() {\n super();\n this.style.position = 'absolute';\n this.style.width = 'var(--slider-fill, 0%)';\n this.style.height = '100%';\n }\n\n _update(props: any, _state: any): void {\n setAttributes(this, props);\n\n if (props['data-orientation'] === 'horizontal') {\n this.style.width = 'var(--slider-fill, 0%)';\n this.style.height = '100%';\n this.style.top = '0';\n this.style.removeProperty('bottom');\n } else {\n this.style.height = 'var(--slider-fill, 0%)';\n this.style.width = '100%';\n this.style.bottom = '0';\n this.style.removeProperty('top');\n }\n }\n}\n\nexport class TimeSliderPointer extends HTMLElement {\n constructor() {\n super();\n this.style.position = 'absolute';\n this.style.width = 'var(--slider-pointer, 0%)';\n this.style.height = '100%';\n }\n\n _update(props: any, _state: any): void {\n setAttributes(this, props);\n\n if (props['data-orientation'] === 'horizontal') {\n this.style.width = 'var(--slider-pointer, 0%)';\n this.style.height = '100%';\n this.style.top = '0';\n this.style.removeProperty('bottom');\n } else {\n this.style.height = 'var(--slider-pointer, 0%)';\n this.style.width = '100%';\n this.style.bottom = '0';\n this.style.removeProperty('top');\n }\n }\n}\n\nexport class TimeSliderThumb extends HTMLElement {\n constructor() {\n super();\n this.style.position = 'absolute';\n }\n\n _update(props: any, _state: any): void {\n setAttributes(this, props);\n\n // Set appropriate positioning based on orientation\n if (props['data-orientation'] === 'horizontal') {\n this.style.left = 'var(--slider-fill, 0%)';\n this.style.top = '50%';\n this.style.translate = '-50% -50%';\n } else {\n this.style.bottom = 'var(--slider-fill, 0%)';\n this.style.left = '50%';\n this.style.translate = '-50% 50%';\n }\n }\n}\n\nexport const useTimeSliderRootState: StateHook<{\n currentTime: number;\n duration: number;\n requestSeek: (time: number) => void;\n core: CoreTimeSlider | null;\n}> = {\n keys: timeSliderStateDefinition.keys,\n transform: (rawState, mediaStore) => ({\n ...timeSliderStateDefinition.stateTransform(rawState),\n ...timeSliderStateDefinition.createRequestMethods(mediaStore.dispatch),\n core: null,\n }),\n};\n\nexport const getTimeSliderTrackProps: PropsHook<Record<string, never>> = (_state, element) => {\n const rootElement = element.closest('media-time-slider') as any;\n return {\n 'data-orientation': rootElement?.orientation || 'horizontal',\n };\n};\n\nexport const getTimeSliderProgressProps: PropsHook<Record<string, never>> = (_state, element) => {\n const rootElement = element.closest('media-time-slider') as any;\n return {\n 'data-orientation': rootElement?.orientation || 'horizontal',\n };\n};\n\nexport const getTimeSliderPointerProps: PropsHook<Record<string, never>> = (_state, element) => {\n const rootElement = element.closest('media-time-slider') as any;\n return {\n 'data-orientation': rootElement?.orientation || 'horizontal',\n };\n};\n\nexport const getTimeSliderThumbProps: PropsHook<Record<string, never>> = (_state, element) => {\n const rootElement = element.closest('media-time-slider') as any;\n return {\n 'data-orientation': rootElement?.orientation || 'horizontal',\n };\n};\n\nexport const TimeSliderRootElement: ConnectedComponentConstructor<{\n currentTime: number;\n duration: number;\n requestSeek: (time: number) => void;\n core: CoreTimeSlider | null;\n}> = toConnectedHTMLComponent(TimeSliderRoot, useTimeSliderRootState, getTimeSliderRootProps, 'TimeSliderRoot');\n\nexport const TimeSliderTrackElement: ConnectedComponentConstructor<any> = toConnectedHTMLComponent(\n TimeSliderTrack,\n { keys: [], transform: () => ({}) },\n getTimeSliderTrackProps,\n 'TimeSliderTrack',\n);\n\nexport const TimeSliderProgressElement: ConnectedComponentConstructor<any> = toConnectedHTMLComponent(\n TimeSliderProgress,\n { keys: [], transform: () => ({}) },\n getTimeSliderProgressProps,\n 'TimeSliderProgress',\n);\n\nexport const TimeSliderPointerElement: ConnectedComponentConstructor<any> = toConnectedHTMLComponent(\n TimeSliderPointer,\n { keys: [], transform: () => ({}) },\n getTimeSliderPointerProps,\n 'TimeSliderPointer',\n);\n\nexport const TimeSliderThumbElement: ConnectedComponentConstructor<any> = toConnectedHTMLComponent(\n TimeSliderThumb,\n { keys: [], transform: () => ({}) },\n getTimeSliderThumbProps,\n 'TimeSliderThumb',\n);\n\nexport const TimeSliderElement = Object.assign(\n {},\n {\n Root: TimeSliderRootElement,\n Track: TimeSliderTrackElement,\n Progress: TimeSliderProgressElement,\n Pointer: TimeSliderPointerElement,\n Thumb: TimeSliderThumbElement,\n },\n) as {\n Root: typeof TimeSliderRootElement;\n Track: typeof TimeSliderTrackElement;\n Progress: typeof TimeSliderProgressElement;\n Pointer: typeof TimeSliderPointerElement;\n Thumb: typeof TimeSliderThumbElement;\n};\n"],"mappings":";;;;;;;;;;AAmBA,MAAaA,0BAKP,OAAO,YAAY;CACvB,MAAM,cAAc,SAAiB;AAGnC,SAAO,GAFS,KAAK,MAAM,OAAO,GAAG,CAEnB,GADF,KAAK,MAAM,OAAO,GAAG,CACR,UAAU,CAAC,SAAS,GAAG,IAAI;;CAG1D,MAAM,kBAAkB,WAAW,MAAM,YAAY;CACrD,MAAM,eAAe,WAAW,MAAM,SAAS;AAgB/C,QAduC;EACrC,MAAM;EACN,UAAU,QAAQ,aAAa,WAAW,IAAI;EAC9C,qBAAqB,MAAM,YAAY,UAAU;EACjD,iBAAiB,MAAM,SAAS,UAAU;EAC1C,oBAAqB,QAAgB,eAAe;EACpD,cAAc;EACd,iBAAiB;EACjB,iBAAiB,KAAK,MAAM,MAAM,SAAS,CAAC,UAAU;EACtD,iBAAiB,KAAK,MAAM,MAAM,YAAY,CAAC,UAAU;EACzD,kBAAkB,GAAG,gBAAgB,MAAM;EAC3C,oBAAqB,QAAgB,eAAe;EACrD;;AAKH,IAAa,iBAAb,cAAo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}
@@ -0,0 +1,296 @@
1
+ import { uniqueId } from "@videojs/utils";
2
+ import { arrow, autoUpdate, computePosition, flip, offset, shift } from "@floating-ui/dom";
3
+
4
+ //#region src/elements/tooltip.ts
5
+ var TooltipRootElement = class extends HTMLElement {
6
+ #open = false;
7
+ #hoverTimeout = null;
8
+ #cleanup = null;
9
+ #arrowElement = null;
10
+ #pointerPosition = {
11
+ x: 0,
12
+ y: 0
13
+ };
14
+ #transitionStatus = "initial";
15
+ constructor() {
16
+ super();
17
+ if (globalThis.matchMedia?.("(hover: hover)")?.matches) {
18
+ this.addEventListener("pointerenter", this);
19
+ this.addEventListener("pointerleave", this);
20
+ this.addEventListener("pointermove", this);
21
+ }
22
+ }
23
+ handleEvent(event) {
24
+ if (event.type === "pointerenter") this.#handlePointerEnter();
25
+ else if (event.type === "pointerleave") this.#handlePointerLeave(event);
26
+ else if (event.type === "pointermove") this.#handlePointerMove(event);
27
+ }
28
+ connectedCallback() {
29
+ this.#updateVisibility();
30
+ }
31
+ disconnectedCallback() {
32
+ this.#clearHoverTimeout();
33
+ this.#cleanup?.();
34
+ this.#transitionStatus = "unmounted";
35
+ this.#updateVisibility();
36
+ }
37
+ static get observedAttributes() {
38
+ return [
39
+ "delay",
40
+ "close-delay",
41
+ "track-cursor-axis"
42
+ ];
43
+ }
44
+ get delay() {
45
+ return Number.parseInt(this.getAttribute("delay") ?? "0", 10);
46
+ }
47
+ get closeDelay() {
48
+ return Number.parseInt(this.getAttribute("close-delay") ?? "0", 10);
49
+ }
50
+ get trackCursorAxis() {
51
+ const value = this.getAttribute("track-cursor-axis");
52
+ return value === "x" || value === "y" || value === "both" ? value : void 0;
53
+ }
54
+ get #triggerElement() {
55
+ return this.querySelector("media-tooltip-trigger");
56
+ }
57
+ get #portalElement() {
58
+ return this.querySelector("media-tooltip-portal");
59
+ }
60
+ get #positionerElement() {
61
+ return this.#portalElement?.querySelector("media-tooltip-positioner");
62
+ }
63
+ get #popupElement() {
64
+ return this.#portalElement?.querySelector("media-tooltip-popup");
65
+ }
66
+ #setOpen(open) {
67
+ if (this.#open === open) return;
68
+ this.#open = open;
69
+ if (open) {
70
+ this.#transitionStatus = "initial";
71
+ requestAnimationFrame(() => {
72
+ this.#transitionStatus = "open";
73
+ this.#updateVisibility();
74
+ });
75
+ } else this.#transitionStatus = "close";
76
+ this.#updateVisibility();
77
+ if (open) this.#setupFloating();
78
+ else {
79
+ this.#cleanup?.();
80
+ this.#cleanup = null;
81
+ }
82
+ }
83
+ #updateVisibility() {
84
+ this.style.display = "contents";
85
+ if (this.#popupElement) {
86
+ const placement = this.#positionerElement?.side ?? "top";
87
+ this.#popupElement.setAttribute("data-side", placement);
88
+ this.#popupElement.toggleAttribute("data-starting-style", this.#transitionStatus === "initial");
89
+ this.#popupElement.toggleAttribute("data-open", this.#transitionStatus === "initial" || this.#transitionStatus === "open");
90
+ this.#popupElement.toggleAttribute("data-ending-style", this.#transitionStatus === "close" || this.#transitionStatus === "unmounted");
91
+ this.#popupElement.toggleAttribute("data-closed", this.#transitionStatus === "close" || this.#transitionStatus === "unmounted");
92
+ }
93
+ const triggerElement = this.#triggerElement?.firstElementChild;
94
+ if (triggerElement) triggerElement.toggleAttribute("data-popup-open", this.#open);
95
+ }
96
+ #setupFloating() {
97
+ if (!this.#triggerElement || !this.#popupElement) return;
98
+ const trigger = this.#triggerElement.firstElementChild;
99
+ const popup = this.#popupElement;
100
+ if (!trigger || !popup) return;
101
+ const placement = this.#positionerElement?.side ?? "top";
102
+ const sideOffset = this.#positionerElement?.sideOffset ?? 0;
103
+ const collisionPadding = this.#positionerElement?.collisionPadding ?? 0;
104
+ const mediaContainer = this.closest("media-container");
105
+ this.#arrowElement = popup.querySelector("media-tooltip-arrow");
106
+ const updatePosition = () => {
107
+ const middleware = [
108
+ offset(sideOffset),
109
+ flip(),
110
+ shift({
111
+ boundary: mediaContainer,
112
+ padding: collisionPadding
113
+ })
114
+ ];
115
+ if (this.#arrowElement) middleware.push(arrow({ element: this.#arrowElement }));
116
+ computePosition(this.trackCursorAxis ? { getBoundingClientRect: () => {
117
+ const triggerRect = trigger.getBoundingClientRect();
118
+ if (this.trackCursorAxis === "x") return {
119
+ width: 0,
120
+ height: 0,
121
+ top: triggerRect.top,
122
+ right: this.#pointerPosition.x,
123
+ bottom: triggerRect.bottom,
124
+ left: this.#pointerPosition.x,
125
+ x: this.#pointerPosition.x,
126
+ y: triggerRect.top
127
+ };
128
+ else if (this.trackCursorAxis === "y") return {
129
+ width: 0,
130
+ height: 0,
131
+ top: this.#pointerPosition.y,
132
+ right: triggerRect.right,
133
+ bottom: this.#pointerPosition.y,
134
+ left: triggerRect.left,
135
+ x: triggerRect.left,
136
+ y: this.#pointerPosition.y
137
+ };
138
+ else return {
139
+ width: 0,
140
+ height: 0,
141
+ top: this.#pointerPosition.y,
142
+ right: this.#pointerPosition.x,
143
+ bottom: this.#pointerPosition.y,
144
+ left: this.#pointerPosition.x,
145
+ x: this.#pointerPosition.x,
146
+ y: this.#pointerPosition.y
147
+ };
148
+ } } : trigger, popup, {
149
+ placement,
150
+ middleware
151
+ }).then(({ x, y, middlewareData, placement: computedPlacement }) => {
152
+ Object.assign(popup.style, {
153
+ left: `${x}px`,
154
+ top: `${y}px`
155
+ });
156
+ popup.setAttribute("data-side", computedPlacement);
157
+ if (this.#arrowElement && middlewareData.arrow) {
158
+ const { x: arrowX, y: arrowY } = middlewareData.arrow;
159
+ Object.assign(this.#arrowElement.style, {
160
+ left: arrowX != null ? `${arrowX}px` : void 0,
161
+ top: arrowY != null ? `${arrowY}px` : void 0
162
+ });
163
+ }
164
+ });
165
+ };
166
+ updatePosition();
167
+ if (!this.trackCursorAxis) this.#cleanup = autoUpdate(trigger, popup, updatePosition);
168
+ }
169
+ #updatePosition() {
170
+ if (this.#open && this.trackCursorAxis) this.#setupFloating();
171
+ }
172
+ #clearHoverTimeout() {
173
+ if (this.#hoverTimeout) {
174
+ clearTimeout(this.#hoverTimeout);
175
+ this.#hoverTimeout = null;
176
+ }
177
+ }
178
+ #handlePointerEnter() {
179
+ this.#clearHoverTimeout();
180
+ this.#hoverTimeout = globalThis.setTimeout(() => {
181
+ this.#setOpen(true);
182
+ }, this.delay);
183
+ }
184
+ #handlePointerLeave(_event) {
185
+ this.#clearHoverTimeout();
186
+ this.#hoverTimeout = globalThis.setTimeout(() => {
187
+ this.#setOpen(false);
188
+ }, this.closeDelay);
189
+ }
190
+ #handlePointerMove(event) {
191
+ if (this.trackCursorAxis) {
192
+ this.#pointerPosition = {
193
+ x: event.clientX,
194
+ y: event.clientY
195
+ };
196
+ if (this.#open) this.#updatePosition();
197
+ }
198
+ }
199
+ };
200
+ var TooltipTriggerElement = class extends HTMLElement {
201
+ connectedCallback() {
202
+ this.style.display = "contents";
203
+ const triggerElement = this.firstElementChild;
204
+ if (triggerElement) new MutationObserver((mutations) => {
205
+ mutations.forEach((mutation) => {
206
+ if (mutation.type === "attributes") {
207
+ const rootElement = this.closest("media-tooltip");
208
+ let popupElement = rootElement.querySelector("media-tooltip-popup");
209
+ if (!popupElement) {
210
+ const portalElement = rootElement.querySelector("media-tooltip-portal");
211
+ if (!portalElement) return;
212
+ popupElement = portalElement.querySelector("media-tooltip-popup");
213
+ if (!popupElement) return;
214
+ }
215
+ const attributeName = mutation.attributeName;
216
+ if (!attributeName || !attributeName.startsWith("data-")) return;
217
+ const attributeValue = triggerElement.getAttribute(attributeName);
218
+ if (attributeValue !== null) popupElement.setAttribute(attributeName, attributeValue);
219
+ else popupElement.removeAttribute(attributeName);
220
+ }
221
+ });
222
+ }).observe(triggerElement, { attributes: true });
223
+ }
224
+ };
225
+ var TooltipPortalElement = class extends HTMLElement {
226
+ #portal = null;
227
+ connectedCallback() {
228
+ this.style.display = "contents";
229
+ this.#setupPortal();
230
+ }
231
+ disconnectedCallback() {
232
+ this.#cleanupPortal();
233
+ }
234
+ querySelector(selector) {
235
+ return this.#portal?.querySelector(selector) ?? null;
236
+ }
237
+ #setupPortal() {
238
+ const portalId = this.getAttribute("root-id") ?? "@default_portal_id";
239
+ if (!portalId) return;
240
+ const portalContainer = this.getRootNode().getElementById(portalId) ?? this.getRootNode().querySelector("media-container")?.shadowRoot?.getElementById(portalId) ? this.getRootNode().querySelector("media-container") : void 0;
241
+ if (!portalContainer) return;
242
+ this.#portal = document.createElement("div");
243
+ this.#portal.slot = "portal";
244
+ this.#portal.id = uniqueId();
245
+ portalContainer.append(this.#portal);
246
+ this.#portal.append(...this.children);
247
+ }
248
+ #cleanupPortal() {
249
+ if (!this.#portal) return;
250
+ this.append(...this.#portal.children);
251
+ this.#portal.remove();
252
+ this.#portal = null;
253
+ }
254
+ };
255
+ var TooltipPositionerElement = class extends HTMLElement {
256
+ connectedCallback() {
257
+ this.style.display = "contents";
258
+ const popup = this.firstElementChild;
259
+ if (popup) Object.assign(popup.style, {
260
+ position: "absolute",
261
+ top: "0",
262
+ left: "0"
263
+ });
264
+ }
265
+ get side() {
266
+ return this.getAttribute("side") ?? "top";
267
+ }
268
+ get sideOffset() {
269
+ return Number.parseInt(this.getAttribute("side-offset") ?? "0", 10);
270
+ }
271
+ get collisionPadding() {
272
+ return Number.parseInt(this.getAttribute("collision-padding") ?? "0", 10);
273
+ }
274
+ };
275
+ var TooltipPopupElement = class extends HTMLElement {
276
+ connectedCallback() {
277
+ this.setAttribute("role", "tooltip");
278
+ }
279
+ };
280
+ var TooltipArrowElement = class extends HTMLElement {
281
+ connectedCallback() {
282
+ this.setAttribute("aria-hidden", "true");
283
+ }
284
+ };
285
+ const TooltipElement = {
286
+ Root: TooltipRootElement,
287
+ Trigger: TooltipTriggerElement,
288
+ Portal: TooltipPortalElement,
289
+ Positioner: TooltipPositionerElement,
290
+ Popup: TooltipPopupElement,
291
+ Arrow: TooltipArrowElement
292
+ };
293
+
294
+ //#endregion
295
+ export { TooltipPositionerElement as a, TooltipPortalElement as i, TooltipElement as n, TooltipRootElement as o, TooltipPopupElement as r, TooltipTriggerElement as s, TooltipArrowElement as t };
296
+ //# sourceMappingURL=tooltip-54fBUUpb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip-54fBUUpb.js","names":["#handlePointerEnter","#handlePointerLeave","#handlePointerMove","#updateVisibility","#clearHoverTimeout","#cleanup","#transitionStatus","#triggerElement","#portalElement","#positionerElement","#popupElement","#open","#setupFloating","#arrowElement","#pointerPosition","#hoverTimeout","#setOpen","#updatePosition","#setupPortal","#cleanupPortal","#portal","TooltipElement: {\n Root: typeof TooltipRootElement;\n Trigger: typeof TooltipTriggerElement;\n Portal: typeof TooltipPortalElement;\n Positioner: typeof TooltipPositionerElement;\n Popup: typeof TooltipPopupElement;\n Arrow: typeof TooltipArrowElement;\n}"],"sources":["../src/elements/tooltip.ts"],"sourcesContent":["import type { Placement } from '@floating-ui/dom';\nimport type { MediaContainerElement } from '@/media/media-container';\n\nimport { arrow, autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom';\nimport { uniqueId } from '@videojs/utils';\n\nexport class TooltipRootElement extends HTMLElement {\n #open = false;\n #hoverTimeout: ReturnType<typeof setTimeout> | null = null;\n #cleanup: (() => void) | null = null;\n #arrowElement: HTMLElement | null = null;\n #pointerPosition = { x: 0, y: 0 };\n #transitionStatus: 'initial' | 'open' | 'close' | 'unmounted' = 'initial';\n\n constructor() {\n super();\n\n if (globalThis.matchMedia?.('(hover: hover)')?.matches) {\n this.addEventListener('pointerenter', this);\n this.addEventListener('pointerleave', this);\n this.addEventListener('pointermove', this);\n }\n }\n\n handleEvent(event: Event): void {\n if (event.type === 'pointerenter') {\n this.#handlePointerEnter();\n } else if (event.type === 'pointerleave') {\n this.#handlePointerLeave(event as PointerEvent);\n } else if (event.type === 'pointermove') {\n this.#handlePointerMove(event as PointerEvent);\n }\n }\n\n connectedCallback(): void {\n this.#updateVisibility();\n }\n\n disconnectedCallback(): void {\n this.#clearHoverTimeout();\n this.#cleanup?.();\n\n this.#transitionStatus = 'unmounted';\n this.#updateVisibility();\n }\n\n static get observedAttributes(): string[] {\n return ['delay', 'close-delay', 'track-cursor-axis'];\n }\n\n get delay(): number {\n return Number.parseInt(this.getAttribute('delay') ?? '0', 10);\n }\n\n get closeDelay(): number {\n return Number.parseInt(this.getAttribute('close-delay') ?? '0', 10);\n }\n\n get trackCursorAxis(): 'x' | 'y' | 'both' | undefined {\n const value = this.getAttribute('track-cursor-axis');\n return value === 'x' || value === 'y' || value === 'both' ? value : undefined;\n }\n\n get #triggerElement(): TooltipTriggerElement | null {\n return this.querySelector('media-tooltip-trigger') as TooltipTriggerElement | null;\n }\n\n get #portalElement(): TooltipPortalElement | null {\n return this.querySelector('media-tooltip-portal') as TooltipPortalElement | null;\n }\n\n get #positionerElement(): TooltipPositionerElement | null {\n return this.#portalElement?.querySelector('media-tooltip-positioner') as TooltipPositionerElement | null;\n }\n\n get #popupElement(): TooltipPopupElement | null {\n return this.#portalElement?.querySelector('media-tooltip-popup') as TooltipPopupElement | null;\n }\n\n #setOpen(open: boolean): void {\n if (this.#open === open) return;\n\n this.#open = open;\n\n if (open) {\n this.#transitionStatus = 'initial';\n requestAnimationFrame(() => {\n this.#transitionStatus = 'open';\n this.#updateVisibility();\n });\n } else {\n this.#transitionStatus = 'close';\n }\n\n this.#updateVisibility();\n\n if (open) {\n this.#setupFloating();\n } else {\n this.#cleanup?.();\n this.#cleanup = null;\n }\n }\n\n #updateVisibility(): void {\n this.style.display = 'contents';\n\n if (this.#popupElement) {\n const placement = this.#positionerElement?.side ?? 'top';\n this.#popupElement.setAttribute('data-side', placement);\n\n this.#popupElement.toggleAttribute('data-starting-style', this.#transitionStatus === 'initial');\n this.#popupElement.toggleAttribute('data-open', this.#transitionStatus === 'initial' || this.#transitionStatus === 'open');\n this.#popupElement.toggleAttribute('data-ending-style', this.#transitionStatus === 'close' || this.#transitionStatus === 'unmounted');\n this.#popupElement.toggleAttribute('data-closed', this.#transitionStatus === 'close' || this.#transitionStatus === 'unmounted');\n }\n\n const triggerElement = this.#triggerElement?.firstElementChild as HTMLElement;\n if (triggerElement) {\n triggerElement.toggleAttribute('data-popup-open', this.#open);\n }\n }\n\n #setupFloating(): void {\n if (!this.#triggerElement || !this.#popupElement) return;\n\n const trigger = this.#triggerElement.firstElementChild as HTMLElement;\n const popup = this.#popupElement;\n\n if (!trigger || !popup) return;\n\n const placement = this.#positionerElement?.side ?? 'top';\n const sideOffset = this.#positionerElement?.sideOffset ?? 0;\n const collisionPadding = this.#positionerElement?.collisionPadding ?? 0;\n const mediaContainer = this.closest('media-container') as MediaContainerElement;\n\n this.#arrowElement = popup.querySelector('media-tooltip-arrow') as HTMLElement;\n\n const updatePosition = () => {\n const middleware = [\n offset(sideOffset),\n flip(),\n shift({\n boundary: mediaContainer,\n padding: collisionPadding,\n }),\n ];\n\n if (this.#arrowElement) {\n middleware.push(arrow({ element: this.#arrowElement }));\n }\n\n const referenceElement = this.trackCursorAxis\n ? {\n getBoundingClientRect: () => {\n const triggerRect = trigger.getBoundingClientRect();\n\n if (this.trackCursorAxis === 'x') {\n return {\n width: 0,\n height: 0,\n top: triggerRect.top,\n right: this.#pointerPosition.x,\n bottom: triggerRect.bottom,\n left: this.#pointerPosition.x,\n x: this.#pointerPosition.x,\n y: triggerRect.top,\n };\n } else if (this.trackCursorAxis === 'y') {\n return {\n width: 0,\n height: 0,\n top: this.#pointerPosition.y,\n right: triggerRect.right,\n bottom: this.#pointerPosition.y,\n left: triggerRect.left,\n x: triggerRect.left,\n y: this.#pointerPosition.y,\n };\n } else {\n // Track both axes (trackCursorAxis === 'both')\n return {\n width: 0,\n height: 0,\n top: this.#pointerPosition.y,\n right: this.#pointerPosition.x,\n bottom: this.#pointerPosition.y,\n left: this.#pointerPosition.x,\n x: this.#pointerPosition.x,\n y: this.#pointerPosition.y,\n };\n }\n },\n }\n : trigger;\n\n computePosition(referenceElement, popup, {\n placement,\n middleware,\n }).then(({ x, y, middlewareData, placement: computedPlacement }: { x: number; y: number; middlewareData: any; placement: Placement }) => {\n Object.assign(popup.style, {\n left: `${x}px`,\n top: `${y}px`,\n });\n\n popup.setAttribute('data-side', computedPlacement);\n\n if (this.#arrowElement && middlewareData.arrow) {\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n Object.assign(this.#arrowElement.style, {\n left: arrowX != null ? `${arrowX}px` : undefined,\n top: arrowY != null ? `${arrowY}px` : undefined,\n });\n }\n });\n };\n\n updatePosition();\n\n if (!this.trackCursorAxis) {\n this.#cleanup = autoUpdate(trigger, popup, updatePosition);\n }\n }\n\n #updatePosition(): void {\n if (this.#open && this.trackCursorAxis) {\n this.#setupFloating();\n }\n }\n\n #clearHoverTimeout(): void {\n if (this.#hoverTimeout) {\n clearTimeout(this.#hoverTimeout);\n this.#hoverTimeout = null;\n }\n }\n\n #handlePointerEnter(): void {\n this.#clearHoverTimeout();\n this.#hoverTimeout = globalThis.setTimeout(() => {\n this.#setOpen(true);\n }, this.delay);\n }\n\n #handlePointerLeave(_event: PointerEvent): void {\n this.#clearHoverTimeout();\n this.#hoverTimeout = globalThis.setTimeout(() => {\n this.#setOpen(false);\n }, this.closeDelay);\n }\n\n #handlePointerMove(event: PointerEvent): void {\n if (this.trackCursorAxis) {\n this.#pointerPosition = { x: event.clientX, y: event.clientY };\n\n if (this.#open) {\n this.#updatePosition();\n }\n }\n }\n}\n\nexport class TooltipTriggerElement extends HTMLElement {\n connectedCallback(): void {\n this.style.display = 'contents';\n\n const triggerElement = this.firstElementChild as HTMLElement;\n if (triggerElement) {\n const mutationObserver = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.type === 'attributes') {\n const rootElement = this.closest('media-tooltip') as TooltipRootElement;\n let popupElement = rootElement.querySelector('media-tooltip-popup') as TooltipPopupElement;\n\n if (!popupElement) {\n const portalElement = rootElement.querySelector('media-tooltip-portal') as TooltipPortalElement;\n if (!portalElement) {\n return;\n }\n\n popupElement = portalElement.querySelector('media-tooltip-popup') as TooltipPopupElement;\n if (!popupElement) {\n return;\n }\n }\n\n const attributeName = mutation.attributeName;\n if (!attributeName || !attributeName.startsWith('data-')) {\n return;\n }\n\n const attributeValue = triggerElement.getAttribute(attributeName);\n if (attributeValue !== null) {\n popupElement.setAttribute(attributeName, attributeValue);\n } else {\n popupElement.removeAttribute(attributeName);\n }\n }\n });\n });\n\n mutationObserver.observe(triggerElement, {\n attributes: true,\n });\n }\n }\n}\n\nexport class TooltipPortalElement extends HTMLElement {\n #portal: HTMLElement | null = null;\n\n connectedCallback(): void {\n this.style.display = 'contents';\n this.#setupPortal();\n }\n\n disconnectedCallback(): void {\n this.#cleanupPortal();\n }\n\n querySelector(selector: string): HTMLElement | null {\n return this.#portal?.querySelector(selector) ?? null;\n }\n\n #setupPortal(): void {\n const portalId = this.getAttribute('root-id') ?? '@default_portal_id';\n if (!portalId) return;\n\n /* @TODO We need to make sure portal logic is non-brittle longer term (CJP) */\n // NOTE: Hacky solution in part to ensure styling propogates from skin to container's baked in portal (TL;DR - Shadow DOM vs. Light DOM CSS) (CJP)\n const portalContainer\n = ((this.getRootNode() as ShadowRoot | Document).getElementById(portalId)\n ?? (this.getRootNode() as ShadowRoot | Document)\n .querySelector('media-container')\n ?.shadowRoot\n ?.getElementById(portalId))\n ? (this.getRootNode() as ShadowRoot | Document).querySelector('media-container')\n : undefined;\n if (!portalContainer) return;\n\n this.#portal = document.createElement('div');\n this.#portal.slot = 'portal';\n this.#portal.id = uniqueId();\n portalContainer.append(this.#portal);\n\n this.#portal.append(...this.children);\n }\n\n #cleanupPortal(): void {\n if (!this.#portal) return;\n\n // Move children back to the portal element\n this.append(...this.#portal.children);\n this.#portal.remove();\n this.#portal = null;\n }\n}\n\nexport class TooltipPositionerElement extends HTMLElement {\n connectedCallback(): void {\n this.style.display = 'contents';\n\n const popup = this.firstElementChild as HTMLElement;\n if (popup) {\n Object.assign(popup.style, {\n position: 'absolute',\n top: '0',\n left: '0',\n });\n }\n }\n\n get side(): Placement {\n return (this.getAttribute('side') as Placement) ?? 'top';\n }\n\n get sideOffset(): number {\n return Number.parseInt(this.getAttribute('side-offset') ?? '0', 10);\n }\n\n get collisionPadding(): number {\n return Number.parseInt(this.getAttribute('collision-padding') ?? '0', 10);\n }\n}\n\nexport class TooltipPopupElement extends HTMLElement {\n connectedCallback(): void {\n this.setAttribute('role', 'tooltip');\n }\n}\n\nexport class TooltipArrowElement extends HTMLElement {\n connectedCallback(): void {\n this.setAttribute('aria-hidden', 'true');\n }\n}\n\nexport const TooltipElement: {\n Root: typeof TooltipRootElement;\n Trigger: typeof TooltipTriggerElement;\n Portal: typeof TooltipPortalElement;\n Positioner: typeof TooltipPositionerElement;\n Popup: typeof TooltipPopupElement;\n Arrow: typeof TooltipArrowElement;\n} = {\n Root: TooltipRootElement,\n Trigger: TooltipTriggerElement,\n Portal: TooltipPortalElement,\n Positioner: TooltipPositionerElement,\n Popup: TooltipPopupElement,\n Arrow: TooltipArrowElement,\n};\n"],"mappings":";;;;AAMA,IAAa,qBAAb,cAAwC,YAAY;CAClD,QAAQ;CACR,gBAAsD;CACtD,WAAgC;CAChC,gBAAoC;CACpC,mBAAmB;EAAE,GAAG;EAAG,GAAG;EAAG;CACjC,oBAAgE;CAEhE,cAAc;AACZ,SAAO;AAEP,MAAI,WAAW,aAAa,iBAAiB,EAAE,SAAS;AACtD,QAAK,iBAAiB,gBAAgB,KAAK;AAC3C,QAAK,iBAAiB,gBAAgB,KAAK;AAC3C,QAAK,iBAAiB,eAAe,KAAK;;;CAI9C,YAAY,OAAoB;AAC9B,MAAI,MAAM,SAAS,eACjB,OAAKA,oBAAqB;WACjB,MAAM,SAAS,eACxB,OAAKC,mBAAoB,MAAsB;WACtC,MAAM,SAAS,cACxB,OAAKC,kBAAmB,MAAsB;;CAIlD,oBAA0B;AACxB,QAAKC,kBAAmB;;CAG1B,uBAA6B;AAC3B,QAAKC,mBAAoB;AACzB,QAAKC,WAAY;AAEjB,QAAKC,mBAAoB;AACzB,QAAKH,kBAAmB;;CAG1B,WAAW,qBAA+B;AACxC,SAAO;GAAC;GAAS;GAAe;GAAoB;;CAGtD,IAAI,QAAgB;AAClB,SAAO,OAAO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