hermium 0.2.0 → 0.3.1

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 (172) hide show
  1. package/bin/hermium.mjs +103 -58
  2. package/dist/api.mjs +35 -0
  3. package/dist/public/assets/css/styles-o9LLzp-x.css +1 -0
  4. package/dist/public/assets/js/{ChatInputBlock-Bw7AL70H.js → ChatInputBlock-BgJMx5nW.js} +1 -1
  5. package/dist/public/assets/js/{MarkdownMessage-8d7Y6VL-.js → MarkdownMessage-Dd6VsKhk.js} +1 -1
  6. package/dist/public/assets/js/{base-ui-BvQbAt_1.js → base-ui-Ls-HE_Zl.js} +1 -1
  7. package/dist/public/assets/js/{chat._sessionId-BG6lVraH.js → chat._sessionId-Yif-J0_7.js} +1 -1
  8. package/dist/public/assets/js/{chat.index-D2zdMPTT.js → chat.index-QgwoSqOs.js} +1 -1
  9. package/dist/public/assets/js/{index-C0AK45FU.js → index-BDLsrzTe.js} +26 -26
  10. package/dist/public/assets/js/{index-Cx5En4FK.js → index-DRH0t4ti.js} +1 -1
  11. package/dist/public/assets/js/{memory-CeSRdTkW.js → memory-CHpNNtU2.js} +1 -1
  12. package/dist/public/assets/js/{router-8uDKazL-.js → router-B8BATVn7.js} +1 -1
  13. package/dist/public/assets/js/{settings-Bc3Y5zXO.js → settings-CRV3Pp8x.js} +1 -1
  14. package/dist/public/assets/js/{skills-DZv7sA_5.js → skills-C8G72gXr.js} +1 -1
  15. package/dist/public/assets/js/{usage-DXQsT9_b.js → usage-Bev8hqwh.js} +1 -1
  16. package/dist/server/__23tanstack-start-plugin-adapters-Cwee5PKy.mjs +6 -0
  17. package/dist/server/_chunks/ssr-renderer.mjs +22 -0
  18. package/dist/server/_libs/bail.mjs +8 -0
  19. package/dist/server/_libs/base-ui__react.mjs +9858 -0
  20. package/dist/server/_libs/base-ui__utils.mjs +1106 -0
  21. package/dist/server/_libs/ccount.mjs +16 -0
  22. package/dist/server/_libs/character-entities.mjs +2130 -0
  23. package/dist/server/_libs/class-variance-authority.mjs +44 -0
  24. package/dist/server/_libs/clsx.mjs +16 -0
  25. package/dist/server/_libs/comma-separated-tokens.mjs +10 -0
  26. package/dist/server/_libs/cookie-es.mjs +1 -0
  27. package/dist/server/_libs/croner.mjs +1 -0
  28. package/dist/server/_libs/crossws.mjs +1 -0
  29. package/dist/server/_libs/decode-named-character-reference+[...].mjs +8 -0
  30. package/dist/server/_libs/devlop.mjs +8 -0
  31. package/dist/server/_libs/escape-string-regexp.mjs +9 -0
  32. package/dist/server/_libs/estree-util-is-identifier-name.mjs +11 -0
  33. package/dist/server/_libs/extend.mjs +97 -0
  34. package/dist/server/_libs/floating-ui__core.mjs +663 -0
  35. package/dist/server/_libs/floating-ui__dom.mjs +624 -0
  36. package/dist/server/_libs/floating-ui__react-dom.mjs +279 -0
  37. package/dist/server/_libs/floating-ui__utils.mjs +322 -0
  38. package/dist/server/_libs/h3.mjs +408 -0
  39. package/dist/server/_libs/hast-util-is-element.mjs +75 -0
  40. package/dist/server/_libs/hast-util-to-jsx-runtime.mjs +388 -0
  41. package/dist/server/_libs/hast-util-to-text.mjs +305 -0
  42. package/dist/server/_libs/hast-util-whitespace.mjs +10 -0
  43. package/dist/server/_libs/highlight.js.mjs +14756 -0
  44. package/dist/server/_libs/hookable.mjs +1 -0
  45. package/dist/server/_libs/html-url-attributes.mjs +26 -0
  46. package/dist/server/_libs/inline-style-parser.mjs +142 -0
  47. package/dist/server/_libs/is-plain-obj.mjs +10 -0
  48. package/dist/server/_libs/isbot.mjs +21 -0
  49. package/dist/server/_libs/longest-streak.mjs +25 -0
  50. package/dist/server/_libs/lowlight.mjs +262 -0
  51. package/dist/server/_libs/markdown-table.mjs +142 -0
  52. package/dist/server/_libs/mdast-util-find-and-replace.mjs +109 -0
  53. package/dist/server/_libs/mdast-util-from-markdown.mjs +717 -0
  54. package/dist/server/_libs/mdast-util-gfm-autolink-literal+[...].mjs +156 -0
  55. package/dist/server/_libs/mdast-util-gfm-footnote.mjs +117 -0
  56. package/dist/server/_libs/mdast-util-gfm-strikethrough.mjs +54 -0
  57. package/dist/server/_libs/mdast-util-gfm-table.mjs +157 -0
  58. package/dist/server/_libs/mdast-util-gfm-task-list-item.mjs +77 -0
  59. package/dist/server/_libs/mdast-util-gfm.mjs +29 -0
  60. package/dist/server/_libs/mdast-util-phrasing.mjs +30 -0
  61. package/dist/server/_libs/mdast-util-to-hast.mjs +710 -0
  62. package/dist/server/_libs/mdast-util-to-markdown.mjs +798 -0
  63. package/dist/server/_libs/mdast-util-to-string.mjs +38 -0
  64. package/dist/server/_libs/micromark-core-commonmark.mjs +2259 -0
  65. package/dist/server/_libs/micromark-extension-gfm-autolink-literal+[...].mjs +344 -0
  66. package/dist/server/_libs/micromark-extension-gfm-footnote+[...].mjs +279 -0
  67. package/dist/server/_libs/micromark-extension-gfm-strikethrough+[...].mjs +98 -0
  68. package/dist/server/_libs/micromark-extension-gfm-table.mjs +491 -0
  69. package/dist/server/_libs/micromark-extension-gfm-tagfilter+[...].mjs +1 -0
  70. package/dist/server/_libs/micromark-extension-gfm-task-list-item+[...].mjs +77 -0
  71. package/dist/server/_libs/micromark-extension-gfm.mjs +18 -0
  72. package/dist/server/_libs/micromark-factory-destination.mjs +94 -0
  73. package/dist/server/_libs/micromark-factory-label.mjs +63 -0
  74. package/dist/server/_libs/micromark-factory-space.mjs +24 -0
  75. package/dist/server/_libs/micromark-factory-title.mjs +65 -0
  76. package/dist/server/_libs/micromark-factory-whitespace.mjs +22 -0
  77. package/dist/server/_libs/micromark-util-character.mjs +44 -0
  78. package/dist/server/_libs/micromark-util-chunked.mjs +36 -0
  79. package/dist/server/_libs/micromark-util-classify-character+[...].mjs +12 -0
  80. package/dist/server/_libs/micromark-util-combine-extensions+[...].mjs +41 -0
  81. package/dist/server/_libs/micromark-util-decode-numeric-character-reference+[...].mjs +19 -0
  82. package/dist/server/_libs/micromark-util-decode-string.mjs +21 -0
  83. package/dist/server/_libs/micromark-util-encode.mjs +1 -0
  84. package/dist/server/_libs/micromark-util-html-tag-name.mjs +69 -0
  85. package/dist/server/_libs/micromark-util-normalize-identifier+[...].mjs +6 -0
  86. package/dist/server/_libs/micromark-util-resolve-all.mjs +15 -0
  87. package/dist/server/_libs/micromark-util-sanitize-uri.mjs +41 -0
  88. package/dist/server/_libs/micromark-util-subtokenize.mjs +346 -0
  89. package/dist/server/_libs/micromark.mjs +906 -0
  90. package/dist/server/_libs/ocache.mjs +1 -0
  91. package/dist/server/_libs/ohash.mjs +1 -0
  92. package/dist/server/_libs/property-information.mjs +1209 -0
  93. package/dist/server/_libs/react-dom.mjs +10779 -0
  94. package/dist/server/_libs/react-markdown.mjs +147 -0
  95. package/dist/server/_libs/react.mjs +513 -0
  96. package/dist/server/_libs/rehype-highlight.mjs +94 -0
  97. package/dist/server/_libs/remark-gfm.mjs +20 -0
  98. package/dist/server/_libs/remark-parse.mjs +19 -0
  99. package/dist/server/_libs/remark-rehype.mjs +21 -0
  100. package/dist/server/_libs/reselect.mjs +1 -0
  101. package/dist/server/_libs/rou3.mjs +8 -0
  102. package/dist/server/_libs/seroval-plugins.mjs +1 -0
  103. package/dist/server/_libs/seroval.mjs +1 -0
  104. package/dist/server/_libs/space-separated-tokens.mjs +6 -0
  105. package/dist/server/_libs/srvx.mjs +781 -0
  106. package/dist/server/_libs/style-to-js.mjs +72 -0
  107. package/dist/server/_libs/style-to-object.mjs +38 -0
  108. package/dist/server/_libs/tabler__icons-react.mjs +140 -0
  109. package/dist/server/_libs/tailwind-merge.mjs +3255 -0
  110. package/dist/server/_libs/tanstack__history.mjs +29 -0
  111. package/dist/server/_libs/tanstack__react-router.mjs +1120 -0
  112. package/dist/server/_libs/tanstack__react-store.mjs +2 -0
  113. package/dist/server/_libs/tanstack__router-core.mjs +3594 -0
  114. package/dist/server/_libs/tanstack__store.mjs +1 -0
  115. package/dist/server/_libs/trim-lines.mjs +41 -0
  116. package/dist/server/_libs/trough.mjs +85 -0
  117. package/dist/server/_libs/ufo.mjs +54 -0
  118. package/dist/server/_libs/unctx.mjs +1 -0
  119. package/dist/server/_libs/ungap__structured-clone.mjs +224 -0
  120. package/dist/server/_libs/unified.mjs +661 -0
  121. package/dist/server/_libs/unist-util-find-after.mjs +41 -0
  122. package/dist/server/_libs/unist-util-is.mjs +100 -0
  123. package/dist/server/_libs/unist-util-position.mjs +27 -0
  124. package/dist/server/_libs/unist-util-stringify-position.mjs +27 -0
  125. package/dist/server/_libs/unist-util-visit-parents.mjs +83 -0
  126. package/dist/server/_libs/unist-util-visit.mjs +24 -0
  127. package/dist/server/_libs/unstorage.mjs +1 -0
  128. package/dist/server/_libs/use-sync-external-store.mjs +139 -0
  129. package/dist/server/_libs/vfile-message.mjs +138 -0
  130. package/dist/server/_libs/vfile.mjs +467 -0
  131. package/dist/server/_libs/zustand.mjs +43 -0
  132. package/dist/server/_libs/zwitch.mjs +1 -0
  133. package/dist/server/_ssr/ChatInputBlock-Bu2-iop_.mjs +220 -0
  134. package/dist/server/_ssr/MarkdownMessage-CNS7OSKN.mjs +68 -0
  135. package/dist/server/_ssr/chat._sessionId-P02iSfut.mjs +477 -0
  136. package/dist/server/_ssr/chat.index-BYB_48NC.mjs +64 -0
  137. package/dist/server/_ssr/index-C1mT_2d8.mjs +4890 -0
  138. package/dist/server/_ssr/index-DFV9_oCk.mjs +43 -0
  139. package/dist/server/_ssr/memory-CW_fSOG9.mjs +257 -0
  140. package/dist/server/_ssr/router-CUAfx91O.mjs +2035 -0
  141. package/dist/server/_ssr/settings-DoXurzvn.mjs +10 -0
  142. package/dist/server/_ssr/skills-Cs7A5ZwO.mjs +422 -0
  143. package/dist/server/_ssr/theme-BK4-7E2h.mjs +42 -0
  144. package/dist/server/_ssr/usage-Bs2-LXGz.mjs +298 -0
  145. package/dist/server/_tanstack-start-manifest_v-C7Upe2TI.mjs +4 -0
  146. package/dist/server/index.mjs +506 -0
  147. package/dist/server/public/assets/css/index-Dfs9RUU9.css +1 -0
  148. package/dist/server/public/assets/css/styles-o9LLzp-x.css +1 -0
  149. package/dist/server/public/assets/js/ChatInputBlock-BgJMx5nW.js +1 -0
  150. package/dist/server/public/assets/js/MarkdownMessage-Dd6VsKhk.js +1 -0
  151. package/dist/server/public/assets/js/base-ui-Ls-HE_Zl.js +1 -0
  152. package/dist/server/public/assets/js/chat._sessionId-Yif-J0_7.js +1 -0
  153. package/dist/server/public/assets/js/chat.index-QgwoSqOs.js +1 -0
  154. package/dist/server/public/assets/js/index-BDLsrzTe.js +60 -0
  155. package/dist/server/public/assets/js/index-DRH0t4ti.js +1 -0
  156. package/dist/server/public/assets/js/memory-CHpNNtU2.js +3 -0
  157. package/dist/server/public/assets/js/router-B8BATVn7.js +1 -0
  158. package/dist/server/public/assets/js/settings-CRV3Pp8x.js +1 -0
  159. package/dist/server/public/assets/js/skills-C8G72gXr.js +1 -0
  160. package/dist/server/public/assets/js/theme-CPkdkpaj.js +1 -0
  161. package/dist/server/public/assets/js/usage-Bev8hqwh.js +1 -0
  162. package/dist/server/public/assets/woff2/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  163. package/dist/server/public/assets/woff2/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  164. package/dist/server/public/assets/woff2/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  165. package/dist/server/public/assets/woff2/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  166. package/dist/server/public/assets/woff2/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  167. package/dist/server/public/favicon.ico +0 -0
  168. package/dist/server/public/logo.png +0 -0
  169. package/dist/server/public/manifest.json +25 -0
  170. package/dist/server/public/robots.txt +3 -0
  171. package/package.json +4 -3
  172. package/dist/public/assets/css/styles-B8p6jk5Z.css +0 -1
@@ -0,0 +1,1106 @@
1
+ import { r as reactExports, a as React } from "./react.mjs";
2
+ import { w as withSelectorExports, s as shimExports } from "./use-sync-external-store.mjs";
3
+ import "./react-dom.mjs";
4
+ import { x as getWindow, D as isOverflowElement } from "./floating-ui__utils.mjs";
5
+ const UNINITIALIZED = {};
6
+ function useRefWithInit(init, initArg) {
7
+ const ref = reactExports.useRef(UNINITIALIZED);
8
+ if (ref.current === UNINITIALIZED) {
9
+ ref.current = init(initArg);
10
+ }
11
+ return ref;
12
+ }
13
+ const hooks = [];
14
+ let currentInstance = void 0;
15
+ function getInstance() {
16
+ return currentInstance;
17
+ }
18
+ function register(hook) {
19
+ hooks.push(hook);
20
+ }
21
+ function fastComponent(fn) {
22
+ const FastComponent = (props, forwardedRef) => {
23
+ const instance = useRefWithInit(createInstance).current;
24
+ let result;
25
+ try {
26
+ currentInstance = instance;
27
+ for (const hook of hooks) {
28
+ hook.before(instance);
29
+ }
30
+ result = fn(props, forwardedRef);
31
+ for (const hook of hooks) {
32
+ hook.after(instance);
33
+ }
34
+ instance.didInitialize = true;
35
+ } finally {
36
+ currentInstance = void 0;
37
+ }
38
+ return result;
39
+ };
40
+ FastComponent.displayName = fn.displayName || fn.name;
41
+ return FastComponent;
42
+ }
43
+ function fastComponentRef(fn) {
44
+ return /* @__PURE__ */ reactExports.forwardRef(fastComponent(fn));
45
+ }
46
+ function createInstance() {
47
+ return {
48
+ didInitialize: false
49
+ };
50
+ }
51
+ function useOnFirstRender(fn) {
52
+ const ref = reactExports.useRef(true);
53
+ if (ref.current) {
54
+ ref.current = false;
55
+ fn();
56
+ }
57
+ }
58
+ const noop = () => {
59
+ };
60
+ const useIsoLayoutEffect = typeof document !== "undefined" ? reactExports.useLayoutEffect : noop;
61
+ function createFormatErrorMessage(baseUrl, prefix) {
62
+ return function formatErrorMessage2(code, ...args) {
63
+ const url = new URL(baseUrl);
64
+ url.searchParams.set("code", code.toString());
65
+ args.forEach((arg) => url.searchParams.append("args[]", arg));
66
+ return `${prefix} error #${code}; visit ${url} for the full message.`;
67
+ };
68
+ }
69
+ const formatErrorMessage = createFormatErrorMessage("https://base-ui.com/production-error", "Base UI");
70
+ const EMPTY$2 = [];
71
+ function useOnMount(fn) {
72
+ reactExports.useEffect(fn, EMPTY$2);
73
+ }
74
+ const EMPTY$1 = 0;
75
+ class Timeout {
76
+ static create() {
77
+ return new Timeout();
78
+ }
79
+ currentId = EMPTY$1;
80
+ /**
81
+ * Executes `fn` after `delay`, clearing any previously scheduled call.
82
+ */
83
+ start(delay, fn) {
84
+ this.clear();
85
+ this.currentId = setTimeout(() => {
86
+ this.currentId = EMPTY$1;
87
+ fn();
88
+ }, delay);
89
+ }
90
+ isStarted() {
91
+ return this.currentId !== EMPTY$1;
92
+ }
93
+ clear = () => {
94
+ if (this.currentId !== EMPTY$1) {
95
+ clearTimeout(this.currentId);
96
+ this.currentId = EMPTY$1;
97
+ }
98
+ };
99
+ disposeEffect = () => {
100
+ return this.clear;
101
+ };
102
+ }
103
+ function useTimeout() {
104
+ const timeout = useRefWithInit(Timeout.create).current;
105
+ useOnMount(timeout.disposeEffect);
106
+ return timeout;
107
+ }
108
+ const hasNavigator = typeof navigator !== "undefined";
109
+ const nav = getNavigatorData();
110
+ const platform = getPlatform();
111
+ const userAgent = getUserAgent();
112
+ const isWebKit = typeof CSS === "undefined" || !CSS.supports ? false : CSS.supports("-webkit-backdrop-filter:none");
113
+ const isIOS = (
114
+ // iPads can claim to be MacIntel
115
+ nav.platform === "MacIntel" && nav.maxTouchPoints > 1 ? true : /iP(hone|ad|od)|iOS/.test(nav.platform)
116
+ );
117
+ const isSafari = hasNavigator && /apple/i.test(navigator.vendor);
118
+ const isAndroid = hasNavigator && /android/i.test(platform) || /android/i.test(userAgent);
119
+ const isMac = hasNavigator && platform.toLowerCase().startsWith("mac") && !navigator.maxTouchPoints;
120
+ const isJSDOM = userAgent.includes("jsdom/");
121
+ function getNavigatorData() {
122
+ if (!hasNavigator) {
123
+ return {
124
+ platform: "",
125
+ maxTouchPoints: -1
126
+ };
127
+ }
128
+ const uaData = navigator.userAgentData;
129
+ if (uaData?.platform) {
130
+ return {
131
+ platform: uaData.platform,
132
+ maxTouchPoints: navigator.maxTouchPoints
133
+ };
134
+ }
135
+ return {
136
+ platform: navigator.platform ?? "",
137
+ maxTouchPoints: navigator.maxTouchPoints ?? -1
138
+ };
139
+ }
140
+ function getUserAgent() {
141
+ if (!hasNavigator) {
142
+ return "";
143
+ }
144
+ const uaData = navigator.userAgentData;
145
+ if (uaData && Array.isArray(uaData.brands)) {
146
+ return uaData.brands.map(({
147
+ brand,
148
+ version
149
+ }) => `${brand}/${version}`).join(" ");
150
+ }
151
+ return navigator.userAgent;
152
+ }
153
+ function getPlatform() {
154
+ if (!hasNavigator) {
155
+ return "";
156
+ }
157
+ const uaData = navigator.userAgentData;
158
+ if (uaData?.platform) {
159
+ return uaData.platform;
160
+ }
161
+ return navigator.platform ?? "";
162
+ }
163
+ function NOOP() {
164
+ }
165
+ const EMPTY_ARRAY = Object.freeze([]);
166
+ const EMPTY_OBJECT = Object.freeze({});
167
+ function addEventListener(target, type, listener, options) {
168
+ target.addEventListener(type, listener, options);
169
+ return () => {
170
+ target.removeEventListener(type, listener, options);
171
+ };
172
+ }
173
+ function mergeCleanups(...cleanups) {
174
+ return () => {
175
+ for (let i = 0; i < cleanups.length; i += 1) {
176
+ const cleanup = cleanups[i];
177
+ if (cleanup) {
178
+ cleanup();
179
+ }
180
+ }
181
+ };
182
+ }
183
+ function useMergedRefs(a, b, c, d) {
184
+ const forkRef = useRefWithInit(createForkRef).current;
185
+ if (didChange(forkRef, a, b, c, d)) {
186
+ update(forkRef, [a, b, c, d]);
187
+ }
188
+ return forkRef.callback;
189
+ }
190
+ function useMergedRefsN(refs) {
191
+ const forkRef = useRefWithInit(createForkRef).current;
192
+ if (didChangeN(forkRef, refs)) {
193
+ update(forkRef, refs);
194
+ }
195
+ return forkRef.callback;
196
+ }
197
+ function createForkRef() {
198
+ return {
199
+ callback: null,
200
+ cleanup: null,
201
+ refs: []
202
+ };
203
+ }
204
+ function didChange(forkRef, a, b, c, d) {
205
+ return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
206
+ }
207
+ function didChangeN(forkRef, newRefs) {
208
+ return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);
209
+ }
210
+ function update(forkRef, refs) {
211
+ forkRef.refs = refs;
212
+ if (refs.every((ref) => ref == null)) {
213
+ forkRef.callback = null;
214
+ return;
215
+ }
216
+ forkRef.callback = (instance) => {
217
+ if (forkRef.cleanup) {
218
+ forkRef.cleanup();
219
+ forkRef.cleanup = null;
220
+ }
221
+ if (instance != null) {
222
+ const cleanupCallbacks = Array(refs.length).fill(null);
223
+ for (let i = 0; i < refs.length; i += 1) {
224
+ const ref = refs[i];
225
+ if (ref == null) {
226
+ continue;
227
+ }
228
+ switch (typeof ref) {
229
+ case "function": {
230
+ const refCleanup = ref(instance);
231
+ if (typeof refCleanup === "function") {
232
+ cleanupCallbacks[i] = refCleanup;
233
+ }
234
+ break;
235
+ }
236
+ case "object": {
237
+ ref.current = instance;
238
+ break;
239
+ }
240
+ }
241
+ }
242
+ forkRef.cleanup = () => {
243
+ for (let i = 0; i < refs.length; i += 1) {
244
+ const ref = refs[i];
245
+ if (ref == null) {
246
+ continue;
247
+ }
248
+ switch (typeof ref) {
249
+ case "function": {
250
+ const cleanupCallback = cleanupCallbacks[i];
251
+ if (typeof cleanupCallback === "function") {
252
+ cleanupCallback();
253
+ } else {
254
+ ref(null);
255
+ }
256
+ break;
257
+ }
258
+ case "object": {
259
+ ref.current = null;
260
+ break;
261
+ }
262
+ }
263
+ }
264
+ };
265
+ }
266
+ };
267
+ }
268
+ function useValueAsRef(value) {
269
+ const latest = useRefWithInit(createLatestRef, value).current;
270
+ latest.next = value;
271
+ useIsoLayoutEffect(latest.effect);
272
+ return latest;
273
+ }
274
+ function createLatestRef(value) {
275
+ const latest = {
276
+ current: value,
277
+ next: value,
278
+ effect: () => {
279
+ latest.current = latest.next;
280
+ }
281
+ };
282
+ return latest;
283
+ }
284
+ const useInsertionEffect = React[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0, -3)];
285
+ const useSafeInsertionEffect = (
286
+ // React 17 doesn't have useInsertionEffect.
287
+ useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late.
288
+ useInsertionEffect !== reactExports.useLayoutEffect ? useInsertionEffect : (fn) => fn()
289
+ );
290
+ function useStableCallback(callback) {
291
+ const stable = useRefWithInit(createStableCallback).current;
292
+ stable.next = callback;
293
+ useSafeInsertionEffect(stable.effect);
294
+ return stable.trampoline;
295
+ }
296
+ function createStableCallback() {
297
+ const stable = {
298
+ next: void 0,
299
+ callback: assertNotCalled,
300
+ trampoline: (...args) => stable.callback?.(...args),
301
+ effect: () => {
302
+ stable.callback = stable.next;
303
+ }
304
+ };
305
+ return stable;
306
+ }
307
+ function assertNotCalled() {
308
+ }
309
+ const EMPTY = null;
310
+ class Scheduler {
311
+ /* This implementation uses an array as a backing data-structure for frame callbacks.
312
+ * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it
313
+ * never calls the native `cancelAnimationFrame` if there are no frames left. This can
314
+ * be much more efficient if there is a call pattern that alterns as
315
+ * "request-cancel-request-cancel-…".
316
+ * But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation
317
+ * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */
318
+ callbacks = [];
319
+ callbacksCount = 0;
320
+ nextId = 1;
321
+ startId = 1;
322
+ isScheduled = false;
323
+ tick = (timestamp) => {
324
+ this.isScheduled = false;
325
+ const currentCallbacks = this.callbacks;
326
+ const currentCallbacksCount = this.callbacksCount;
327
+ this.callbacks = [];
328
+ this.callbacksCount = 0;
329
+ this.startId = this.nextId;
330
+ if (currentCallbacksCount > 0) {
331
+ for (let i = 0; i < currentCallbacks.length; i += 1) {
332
+ currentCallbacks[i]?.(timestamp);
333
+ }
334
+ }
335
+ };
336
+ request(fn) {
337
+ const id = this.nextId;
338
+ this.nextId += 1;
339
+ this.callbacks.push(fn);
340
+ this.callbacksCount += 1;
341
+ const didRAFChange = false;
342
+ if (!this.isScheduled || didRAFChange) {
343
+ requestAnimationFrame(this.tick);
344
+ this.isScheduled = true;
345
+ }
346
+ return id;
347
+ }
348
+ cancel(id) {
349
+ const index = id - this.startId;
350
+ if (index < 0 || index >= this.callbacks.length) {
351
+ return;
352
+ }
353
+ this.callbacks[index] = null;
354
+ this.callbacksCount -= 1;
355
+ }
356
+ }
357
+ const scheduler = new Scheduler();
358
+ class AnimationFrame {
359
+ static create() {
360
+ return new AnimationFrame();
361
+ }
362
+ static request(fn) {
363
+ return scheduler.request(fn);
364
+ }
365
+ static cancel(id) {
366
+ return scheduler.cancel(id);
367
+ }
368
+ currentId = EMPTY;
369
+ /**
370
+ * Executes `fn` after `delay`, clearing any previously scheduled call.
371
+ */
372
+ request(fn) {
373
+ this.cancel();
374
+ this.currentId = scheduler.request(() => {
375
+ this.currentId = EMPTY;
376
+ fn();
377
+ });
378
+ }
379
+ cancel = () => {
380
+ if (this.currentId !== EMPTY) {
381
+ scheduler.cancel(this.currentId);
382
+ this.currentId = EMPTY;
383
+ }
384
+ };
385
+ disposeEffect = () => {
386
+ return this.cancel;
387
+ };
388
+ }
389
+ function useAnimationFrame() {
390
+ const timeout = useRefWithInit(AnimationFrame.create).current;
391
+ useOnMount(timeout.disposeEffect);
392
+ return timeout;
393
+ }
394
+ function ownerDocument(node) {
395
+ return node?.ownerDocument || document;
396
+ }
397
+ const visuallyHiddenBase = {
398
+ clipPath: "inset(50%)",
399
+ overflow: "hidden",
400
+ whiteSpace: "nowrap",
401
+ border: 0,
402
+ padding: 0,
403
+ width: 1,
404
+ height: 1,
405
+ margin: -1
406
+ };
407
+ const visuallyHidden = {
408
+ ...visuallyHiddenBase,
409
+ position: "fixed",
410
+ top: 0,
411
+ left: 0
412
+ };
413
+ const visuallyHiddenInput = {
414
+ ...visuallyHiddenBase,
415
+ position: "absolute"
416
+ };
417
+ const SafeReact = {
418
+ ...React
419
+ };
420
+ let globalId = 0;
421
+ function useGlobalId(idOverride, prefix = "mui") {
422
+ const [defaultId, setDefaultId] = reactExports.useState(idOverride);
423
+ const id = idOverride || defaultId;
424
+ reactExports.useEffect(() => {
425
+ if (defaultId == null) {
426
+ globalId += 1;
427
+ setDefaultId(`${prefix}-${globalId}`);
428
+ }
429
+ }, [defaultId, prefix]);
430
+ return id;
431
+ }
432
+ const maybeReactUseId = SafeReact.useId;
433
+ function useId(idOverride, prefix) {
434
+ if (maybeReactUseId !== void 0) {
435
+ const reactId = maybeReactUseId();
436
+ return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);
437
+ }
438
+ return useGlobalId(idOverride, prefix);
439
+ }
440
+ const majorVersion = parseInt(reactExports.version, 10);
441
+ function isReactVersionAtLeast(reactVersionToCheck) {
442
+ return majorVersion >= reactVersionToCheck;
443
+ }
444
+ function getReactElementRef(element) {
445
+ if (!/* @__PURE__ */ reactExports.isValidElement(element)) {
446
+ return null;
447
+ }
448
+ const reactElement = element;
449
+ const propsWithRef = reactElement.props;
450
+ return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
451
+ }
452
+ function mergeObjects(a, b) {
453
+ if (a && !b) {
454
+ return a;
455
+ }
456
+ if (!a && b) {
457
+ return b;
458
+ }
459
+ if (a || b) {
460
+ return {
461
+ ...a,
462
+ ...b
463
+ };
464
+ }
465
+ return void 0;
466
+ }
467
+ const createSelector = (a, b, c, d, e, f, ...other) => {
468
+ if (other.length > 0) {
469
+ throw new Error(formatErrorMessage(1));
470
+ }
471
+ let selector;
472
+ if (a) {
473
+ selector = a;
474
+ } else {
475
+ throw (
476
+ /* minify-error-disabled */
477
+ new Error("Missing arguments")
478
+ );
479
+ }
480
+ return selector;
481
+ };
482
+ const canUseRawUseSyncExternalStore = isReactVersionAtLeast(19);
483
+ const useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy;
484
+ function useStore(store, selector, a1, a2, a3) {
485
+ return useStoreImplementation(store, selector, a1, a2, a3);
486
+ }
487
+ function useStoreR19(store, selector, a1, a2, a3) {
488
+ const getSelection = reactExports.useCallback(() => selector(store.getSnapshot(), a1, a2, a3), [store, selector, a1, a2, a3]);
489
+ return shimExports.useSyncExternalStore(store.subscribe, getSelection, getSelection);
490
+ }
491
+ register({
492
+ before(instance) {
493
+ instance.syncIndex = 0;
494
+ if (!instance.didInitialize) {
495
+ instance.syncTick = 1;
496
+ instance.syncHooks = [];
497
+ instance.didChangeStore = true;
498
+ instance.getSnapshot = () => {
499
+ let didChange2 = false;
500
+ for (let i = 0; i < instance.syncHooks.length; i += 1) {
501
+ const hook = instance.syncHooks[i];
502
+ const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3);
503
+ if (hook.didChange || !Object.is(hook.value, value)) {
504
+ didChange2 = true;
505
+ hook.value = value;
506
+ hook.didChange = false;
507
+ }
508
+ }
509
+ if (didChange2) {
510
+ instance.syncTick += 1;
511
+ }
512
+ return instance.syncTick;
513
+ };
514
+ }
515
+ },
516
+ after(instance) {
517
+ if (instance.syncHooks.length > 0) {
518
+ if (instance.didChangeStore) {
519
+ instance.didChangeStore = false;
520
+ instance.subscribe = (onStoreChange) => {
521
+ const stores = /* @__PURE__ */ new Set();
522
+ for (const hook of instance.syncHooks) {
523
+ stores.add(hook.store);
524
+ }
525
+ const unsubscribes = [];
526
+ for (const store of stores) {
527
+ unsubscribes.push(store.subscribe(onStoreChange));
528
+ }
529
+ return () => {
530
+ for (const unsubscribe of unsubscribes) {
531
+ unsubscribe();
532
+ }
533
+ };
534
+ };
535
+ }
536
+ shimExports.useSyncExternalStore(instance.subscribe, instance.getSnapshot, instance.getSnapshot);
537
+ }
538
+ }
539
+ });
540
+ function useStoreFast(store, selector, a1, a2, a3) {
541
+ const instance = getInstance();
542
+ if (!instance) {
543
+ return useStoreR19(store, selector, a1, a2, a3);
544
+ }
545
+ const index = instance.syncIndex;
546
+ instance.syncIndex += 1;
547
+ let hook;
548
+ if (!instance.didInitialize) {
549
+ hook = {
550
+ store,
551
+ selector,
552
+ a1,
553
+ a2,
554
+ a3,
555
+ value: selector(store.getSnapshot(), a1, a2, a3),
556
+ didChange: false
557
+ };
558
+ instance.syncHooks.push(hook);
559
+ } else {
560
+ hook = instance.syncHooks[index];
561
+ if (hook.store !== store || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) {
562
+ if (hook.store !== store) {
563
+ instance.didChangeStore = true;
564
+ }
565
+ hook.store = store;
566
+ hook.selector = selector;
567
+ hook.a1 = a1;
568
+ hook.a2 = a2;
569
+ hook.a3 = a3;
570
+ hook.didChange = true;
571
+ }
572
+ }
573
+ return hook.value;
574
+ }
575
+ function useStoreLegacy(store, selector, a1, a2, a3) {
576
+ return withSelectorExports.useSyncExternalStoreWithSelector(store.subscribe, store.getSnapshot, store.getSnapshot, (state) => selector(state, a1, a2, a3));
577
+ }
578
+ class Store {
579
+ /**
580
+ * The current state of the store.
581
+ * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.
582
+ * To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState).
583
+ * The values can be used directly (to avoid subscribing to the store) in effects or event handlers.
584
+ *
585
+ * Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.
586
+ */
587
+ // Internal state to handle recursive `setState()` calls
588
+ constructor(state) {
589
+ this.state = state;
590
+ this.listeners = /* @__PURE__ */ new Set();
591
+ this.updateTick = 0;
592
+ }
593
+ /**
594
+ * Registers a listener that will be called whenever the store's state changes.
595
+ *
596
+ * @param fn The listener function to be called on state changes.
597
+ * @returns A function to unsubscribe the listener.
598
+ */
599
+ subscribe = (fn) => {
600
+ this.listeners.add(fn);
601
+ return () => {
602
+ this.listeners.delete(fn);
603
+ };
604
+ };
605
+ /**
606
+ * Returns the current state of the store.
607
+ */
608
+ getSnapshot = () => {
609
+ return this.state;
610
+ };
611
+ /**
612
+ * Updates the entire store's state and notifies all registered listeners.
613
+ *
614
+ * @param newState The new state to set for the store.
615
+ */
616
+ setState(newState) {
617
+ if (this.state === newState) {
618
+ return;
619
+ }
620
+ this.state = newState;
621
+ this.updateTick += 1;
622
+ const currentTick = this.updateTick;
623
+ for (const listener of this.listeners) {
624
+ if (currentTick !== this.updateTick) {
625
+ return;
626
+ }
627
+ listener(newState);
628
+ }
629
+ }
630
+ /**
631
+ * Merges the provided changes into the current state and notifies listeners if there are changes.
632
+ *
633
+ * @param changes An object containing the changes to apply to the current state.
634
+ */
635
+ update(changes) {
636
+ for (const key in changes) {
637
+ if (!Object.is(this.state[key], changes[key])) {
638
+ this.setState({
639
+ ...this.state,
640
+ ...changes
641
+ });
642
+ return;
643
+ }
644
+ }
645
+ }
646
+ /**
647
+ * Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.
648
+ *
649
+ * @param key The key in the store's state to update.
650
+ * @param value The new value to set for the specified key.
651
+ */
652
+ set(key, value) {
653
+ if (!Object.is(this.state[key], value)) {
654
+ this.setState({
655
+ ...this.state,
656
+ [key]: value
657
+ });
658
+ }
659
+ }
660
+ /**
661
+ * Gives the state a new reference and updates all registered listeners.
662
+ */
663
+ notifyAll() {
664
+ const newState = {
665
+ ...this.state
666
+ };
667
+ this.setState(newState);
668
+ }
669
+ use(selector, a1, a2, a3) {
670
+ return useStore(this, selector, a1, a2, a3);
671
+ }
672
+ }
673
+ class ReactStore extends Store {
674
+ /**
675
+ * Creates a new ReactStore instance.
676
+ *
677
+ * @param state Initial state of the store.
678
+ * @param context Non-reactive context values.
679
+ * @param selectors Optional selectors for use with `useState`.
680
+ */
681
+ constructor(state, context = {}, selectors) {
682
+ super(state);
683
+ this.context = context;
684
+ this.selectors = selectors;
685
+ }
686
+ /**
687
+ * Non-reactive values such as refs, callbacks, etc.
688
+ */
689
+ /**
690
+ * Synchronizes a single external value into the store.
691
+ *
692
+ * Note that the while the value in `state` is updated immediately, the value returned
693
+ * by `useState` is updated before the next render (similarly to React's `useState`).
694
+ */
695
+ useSyncedValue(key, value) {
696
+ reactExports.useDebugValue(key);
697
+ useIsoLayoutEffect(() => {
698
+ if (this.state[key] !== value) {
699
+ this.set(key, value);
700
+ }
701
+ }, [key, value]);
702
+ }
703
+ /**
704
+ * Synchronizes a single external value into the store and
705
+ * cleans it up (sets to `undefined`) on unmount.
706
+ *
707
+ * Note that the while the value in `state` is updated immediately, the value returned
708
+ * by `useState` is updated before the next render (similarly to React's `useState`).
709
+ */
710
+ useSyncedValueWithCleanup(key, value) {
711
+ const store = this;
712
+ useIsoLayoutEffect(() => {
713
+ if (store.state[key] !== value) {
714
+ store.set(key, value);
715
+ }
716
+ return () => {
717
+ store.set(key, void 0);
718
+ };
719
+ }, [store, key, value]);
720
+ }
721
+ /**
722
+ * Synchronizes multiple external values into the store.
723
+ *
724
+ * Note that the while the values in `state` are updated immediately, the values returned
725
+ * by `useState` are updated before the next render (similarly to React's `useState`).
726
+ */
727
+ useSyncedValues(statePart) {
728
+ const store = this;
729
+ const dependencies = Object.values(statePart);
730
+ useIsoLayoutEffect(() => {
731
+ store.update(statePart);
732
+ }, [store, ...dependencies]);
733
+ }
734
+ /**
735
+ * Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled`
736
+ * is non-undefined, the store's state at `key` is updated to match `controlled`.
737
+ */
738
+ useControlledProp(key, controlled) {
739
+ reactExports.useDebugValue(key);
740
+ const isControlled = controlled !== void 0;
741
+ useIsoLayoutEffect(() => {
742
+ if (isControlled && !Object.is(this.state[key], controlled)) {
743
+ super.setState({
744
+ ...this.state,
745
+ [key]: controlled
746
+ });
747
+ }
748
+ }, [key, controlled, isControlled]);
749
+ }
750
+ /** Gets the current value from the store using a selector with the provided key.
751
+ *
752
+ * @param key Key of the selector to use.
753
+ */
754
+ select(key, a1, a2, a3) {
755
+ const selector = this.selectors[key];
756
+ return selector(this.state, a1, a2, a3);
757
+ }
758
+ /**
759
+ * Returns a value from the store's state using a selector function.
760
+ * Used to subscribe to specific parts of the state.
761
+ * This methods causes a rerender whenever the selected state changes.
762
+ *
763
+ * @param key Key of the selector to use.
764
+ */
765
+ useState(key, a1, a2, a3) {
766
+ reactExports.useDebugValue(key);
767
+ return useStore(this, this.selectors[key], a1, a2, a3);
768
+ }
769
+ /**
770
+ * Wraps a function with `useStableCallback` to ensure it has a stable reference
771
+ * and assigns it to the context.
772
+ *
773
+ * @param key Key of the event callback. Must be a function in the context.
774
+ * @param fn Function to assign.
775
+ */
776
+ useContextCallback(key, fn) {
777
+ reactExports.useDebugValue(key);
778
+ const stableFunction = useStableCallback(fn ?? NOOP);
779
+ this.context[key] = stableFunction;
780
+ }
781
+ /**
782
+ * Returns a stable setter function for a specific key in the store's state.
783
+ * It's commonly used to pass as a ref callback to React elements.
784
+ *
785
+ * @param key Key of the state to set.
786
+ */
787
+ useStateSetter(key) {
788
+ const ref = reactExports.useRef(void 0);
789
+ if (ref.current === void 0) {
790
+ ref.current = (value) => {
791
+ this.set(key, value);
792
+ };
793
+ }
794
+ return ref.current;
795
+ }
796
+ /**
797
+ * Observes changes derived from the store's selectors and calls the listener when the selected value changes.
798
+ *
799
+ * @param key Key of the selector to observe.
800
+ * @param listener Listener function called when the selector result changes.
801
+ */
802
+ observe(selector, listener) {
803
+ let selectFn;
804
+ if (typeof selector === "function") {
805
+ selectFn = selector;
806
+ } else {
807
+ selectFn = this.selectors[selector];
808
+ }
809
+ let prevValue = selectFn(this.state);
810
+ listener(prevValue, prevValue, this);
811
+ return this.subscribe((nextState) => {
812
+ const nextValue = selectFn(nextState);
813
+ if (!Object.is(prevValue, nextValue)) {
814
+ const oldValue = prevValue;
815
+ prevValue = nextValue;
816
+ listener(nextValue, oldValue, this);
817
+ }
818
+ });
819
+ }
820
+ }
821
+ function inertValue(value) {
822
+ if (isReactVersionAtLeast(19)) {
823
+ return value;
824
+ }
825
+ return value ? "true" : void 0;
826
+ }
827
+ let originalHtmlStyles = {};
828
+ let originalBodyStyles = {};
829
+ let originalHtmlScrollBehavior = "";
830
+ function hasInsetScrollbars(referenceElement) {
831
+ if (typeof document === "undefined") {
832
+ return false;
833
+ }
834
+ const doc = ownerDocument(referenceElement);
835
+ const win = getWindow(doc);
836
+ return win.innerWidth - doc.documentElement.clientWidth > 0;
837
+ }
838
+ function supportsStableScrollbarGutter(referenceElement) {
839
+ const supported = typeof CSS !== "undefined" && CSS.supports && CSS.supports("scrollbar-gutter", "stable");
840
+ if (!supported || typeof document === "undefined") {
841
+ return false;
842
+ }
843
+ const doc = ownerDocument(referenceElement);
844
+ const html = doc.documentElement;
845
+ const body = doc.body;
846
+ const scrollContainer = isOverflowElement(html) ? html : body;
847
+ const originalScrollContainerOverflowY = scrollContainer.style.overflowY;
848
+ const originalHtmlStyleGutter = html.style.scrollbarGutter;
849
+ html.style.scrollbarGutter = "stable";
850
+ scrollContainer.style.overflowY = "scroll";
851
+ const before = scrollContainer.offsetWidth;
852
+ scrollContainer.style.overflowY = "hidden";
853
+ const after = scrollContainer.offsetWidth;
854
+ scrollContainer.style.overflowY = originalScrollContainerOverflowY;
855
+ html.style.scrollbarGutter = originalHtmlStyleGutter;
856
+ return before === after;
857
+ }
858
+ function preventScrollOverlayScrollbars(referenceElement) {
859
+ const doc = ownerDocument(referenceElement);
860
+ const html = doc.documentElement;
861
+ const body = doc.body;
862
+ const elementToLock = isOverflowElement(html) ? html : body;
863
+ const originalElementToLockStyles = {
864
+ overflowY: elementToLock.style.overflowY,
865
+ overflowX: elementToLock.style.overflowX
866
+ };
867
+ Object.assign(elementToLock.style, {
868
+ overflowY: "hidden",
869
+ overflowX: "hidden"
870
+ });
871
+ return () => {
872
+ Object.assign(elementToLock.style, originalElementToLockStyles);
873
+ };
874
+ }
875
+ function preventScrollInsetScrollbars(referenceElement) {
876
+ const doc = ownerDocument(referenceElement);
877
+ const html = doc.documentElement;
878
+ const body = doc.body;
879
+ const win = getWindow(html);
880
+ let scrollTop = 0;
881
+ let scrollLeft = 0;
882
+ let updateGutterOnly = false;
883
+ const resizeFrame = AnimationFrame.create();
884
+ if (isWebKit && (win.visualViewport?.scale ?? 1) !== 1) {
885
+ return () => {
886
+ };
887
+ }
888
+ function lockScroll() {
889
+ const htmlStyles = win.getComputedStyle(html);
890
+ const bodyStyles = win.getComputedStyle(body);
891
+ const htmlScrollbarGutterValue = htmlStyles.scrollbarGutter || "";
892
+ const hasBothEdges = htmlScrollbarGutterValue.includes("both-edges");
893
+ const scrollbarGutterValue = hasBothEdges ? "stable both-edges" : "stable";
894
+ scrollTop = html.scrollTop;
895
+ scrollLeft = html.scrollLeft;
896
+ originalHtmlStyles = {
897
+ scrollbarGutter: html.style.scrollbarGutter,
898
+ overflowY: html.style.overflowY,
899
+ overflowX: html.style.overflowX
900
+ };
901
+ originalHtmlScrollBehavior = html.style.scrollBehavior;
902
+ originalBodyStyles = {
903
+ position: body.style.position,
904
+ height: body.style.height,
905
+ width: body.style.width,
906
+ boxSizing: body.style.boxSizing,
907
+ overflowY: body.style.overflowY,
908
+ overflowX: body.style.overflowX,
909
+ scrollBehavior: body.style.scrollBehavior
910
+ };
911
+ const isScrollableY = html.scrollHeight > html.clientHeight;
912
+ const isScrollableX = html.scrollWidth > html.clientWidth;
913
+ const hasConstantOverflowY = htmlStyles.overflowY === "scroll" || bodyStyles.overflowY === "scroll";
914
+ const hasConstantOverflowX = htmlStyles.overflowX === "scroll" || bodyStyles.overflowX === "scroll";
915
+ const scrollbarWidth = Math.max(0, win.innerWidth - body.clientWidth);
916
+ const scrollbarHeight = Math.max(0, win.innerHeight - body.clientHeight);
917
+ const marginY = parseFloat(bodyStyles.marginTop) + parseFloat(bodyStyles.marginBottom);
918
+ const marginX = parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight);
919
+ const elementToLock = isOverflowElement(html) ? html : body;
920
+ updateGutterOnly = supportsStableScrollbarGutter(referenceElement);
921
+ if (updateGutterOnly) {
922
+ html.style.scrollbarGutter = scrollbarGutterValue;
923
+ elementToLock.style.overflowY = "hidden";
924
+ elementToLock.style.overflowX = "hidden";
925
+ return;
926
+ }
927
+ Object.assign(html.style, {
928
+ scrollbarGutter: scrollbarGutterValue,
929
+ overflowY: "hidden",
930
+ overflowX: "hidden"
931
+ });
932
+ if (isScrollableY || hasConstantOverflowY) {
933
+ html.style.overflowY = "scroll";
934
+ }
935
+ if (isScrollableX || hasConstantOverflowX) {
936
+ html.style.overflowX = "scroll";
937
+ }
938
+ Object.assign(body.style, {
939
+ position: "relative",
940
+ height: marginY || scrollbarHeight ? `calc(100dvh - ${marginY + scrollbarHeight}px)` : "100dvh",
941
+ width: marginX || scrollbarWidth ? `calc(100vw - ${marginX + scrollbarWidth}px)` : "100vw",
942
+ boxSizing: "border-box",
943
+ overflow: "hidden",
944
+ scrollBehavior: "unset"
945
+ });
946
+ body.scrollTop = scrollTop;
947
+ body.scrollLeft = scrollLeft;
948
+ html.setAttribute("data-base-ui-scroll-locked", "");
949
+ html.style.scrollBehavior = "unset";
950
+ }
951
+ function cleanup() {
952
+ Object.assign(html.style, originalHtmlStyles);
953
+ Object.assign(body.style, originalBodyStyles);
954
+ if (!updateGutterOnly) {
955
+ html.scrollTop = scrollTop;
956
+ html.scrollLeft = scrollLeft;
957
+ html.removeAttribute("data-base-ui-scroll-locked");
958
+ html.style.scrollBehavior = originalHtmlScrollBehavior;
959
+ }
960
+ }
961
+ function handleResize() {
962
+ cleanup();
963
+ resizeFrame.request(lockScroll);
964
+ }
965
+ lockScroll();
966
+ const unsubscribeResize = addEventListener(win, "resize", handleResize);
967
+ return () => {
968
+ resizeFrame.cancel();
969
+ cleanup();
970
+ if (typeof win.removeEventListener === "function") {
971
+ unsubscribeResize();
972
+ }
973
+ };
974
+ }
975
+ class ScrollLocker {
976
+ lockCount = 0;
977
+ restore = null;
978
+ timeoutLock = Timeout.create();
979
+ timeoutUnlock = Timeout.create();
980
+ acquire(referenceElement) {
981
+ this.lockCount += 1;
982
+ if (this.lockCount === 1 && this.restore === null) {
983
+ this.timeoutLock.start(0, () => this.lock(referenceElement));
984
+ }
985
+ return this.release;
986
+ }
987
+ release = () => {
988
+ this.lockCount -= 1;
989
+ if (this.lockCount === 0 && this.restore) {
990
+ this.timeoutUnlock.start(0, this.unlock);
991
+ }
992
+ };
993
+ unlock = () => {
994
+ if (this.lockCount === 0 && this.restore) {
995
+ this.restore?.();
996
+ this.restore = null;
997
+ }
998
+ };
999
+ lock(referenceElement) {
1000
+ if (this.lockCount === 0 || this.restore !== null) {
1001
+ return;
1002
+ }
1003
+ const doc = ownerDocument(referenceElement);
1004
+ const html = doc.documentElement;
1005
+ const htmlOverflowY = getWindow(html).getComputedStyle(html).overflowY;
1006
+ if (htmlOverflowY === "hidden" || htmlOverflowY === "clip") {
1007
+ this.restore = NOOP;
1008
+ return;
1009
+ }
1010
+ const hasOverlayScrollbars = isIOS || !hasInsetScrollbars(referenceElement);
1011
+ this.restore = hasOverlayScrollbars ? preventScrollOverlayScrollbars(referenceElement) : preventScrollInsetScrollbars(referenceElement);
1012
+ }
1013
+ }
1014
+ const SCROLL_LOCKER = new ScrollLocker();
1015
+ function useScrollLock(enabled = true, referenceElement = null) {
1016
+ useIsoLayoutEffect(() => {
1017
+ if (!enabled) {
1018
+ return void 0;
1019
+ }
1020
+ return SCROLL_LOCKER.acquire(referenceElement);
1021
+ }, [enabled, referenceElement]);
1022
+ }
1023
+ function useEnhancedClickHandler(handler) {
1024
+ const lastClickInteractionTypeRef = reactExports.useRef("");
1025
+ const handlePointerDown = reactExports.useCallback((event) => {
1026
+ if (event.defaultPrevented) {
1027
+ return;
1028
+ }
1029
+ lastClickInteractionTypeRef.current = event.pointerType;
1030
+ handler(event, event.pointerType);
1031
+ }, [handler]);
1032
+ const handleClick = reactExports.useCallback((event) => {
1033
+ if (event.detail === 0) {
1034
+ handler(event, "keyboard");
1035
+ return;
1036
+ }
1037
+ if ("pointerType" in event) {
1038
+ handler(event, event.pointerType);
1039
+ } else {
1040
+ handler(event, lastClickInteractionTypeRef.current);
1041
+ }
1042
+ lastClickInteractionTypeRef.current = "";
1043
+ }, [handler]);
1044
+ return {
1045
+ onClick: handleClick,
1046
+ onPointerDown: handlePointerDown
1047
+ };
1048
+ }
1049
+ function useControlled({
1050
+ controlled,
1051
+ default: defaultProp,
1052
+ name,
1053
+ state = "value"
1054
+ }) {
1055
+ const {
1056
+ current: isControlled
1057
+ } = reactExports.useRef(controlled !== void 0);
1058
+ const [valueState, setValue] = reactExports.useState(defaultProp);
1059
+ const value = isControlled ? controlled : valueState;
1060
+ const setValueIfUncontrolled = reactExports.useCallback((newValue) => {
1061
+ if (!isControlled) {
1062
+ setValue(newValue);
1063
+ }
1064
+ }, []);
1065
+ return [value, setValueIfUncontrolled];
1066
+ }
1067
+ export {
1068
+ AnimationFrame as A,
1069
+ useRefWithInit as B,
1070
+ useScrollLock as C,
1071
+ useStableCallback as D,
1072
+ EMPTY_ARRAY as E,
1073
+ useTimeout as F,
1074
+ useValueAsRef as G,
1075
+ visuallyHidden as H,
1076
+ visuallyHiddenInput as I,
1077
+ NOOP as N,
1078
+ ReactStore as R,
1079
+ Timeout as T,
1080
+ EMPTY_OBJECT as a,
1081
+ addEventListener as b,
1082
+ createSelector as c,
1083
+ fastComponentRef as d,
1084
+ formatErrorMessage as e,
1085
+ fastComponent as f,
1086
+ getReactElementRef as g,
1087
+ isAndroid as h,
1088
+ inertValue as i,
1089
+ isIOS as j,
1090
+ isJSDOM as k,
1091
+ isMac as l,
1092
+ isSafari as m,
1093
+ isWebKit as n,
1094
+ mergeCleanups as o,
1095
+ mergeObjects as p,
1096
+ ownerDocument as q,
1097
+ useControlled as r,
1098
+ useEnhancedClickHandler as s,
1099
+ useId as t,
1100
+ useAnimationFrame as u,
1101
+ useIsoLayoutEffect as v,
1102
+ useMergedRefs as w,
1103
+ useMergedRefsN as x,
1104
+ useOnFirstRender as y,
1105
+ useOnMount as z
1106
+ };