@badnpm/ui 0.0.0-stage → 0.0.0

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 (56) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +193 -2
  3. package/dist/cjs/components/button.cjs +41 -0
  4. package/dist/cjs/components/input.cjs +11 -0
  5. package/dist/cjs/components/theme-toggle.cjs +19 -0
  6. package/dist/cjs/hooks/use-hydrated.cjs +15 -0
  7. package/dist/cjs/index.cjs +30 -0
  8. package/dist/cjs/lib/preference.cjs +40 -0
  9. package/dist/cjs/providers/preference-provider.cjs +127 -0
  10. package/dist/cjs/providers/theme-provider.cjs +181 -0
  11. package/dist/cjs/types/components/button.d.ts +12 -0
  12. package/dist/cjs/types/components/index.d.ts +3 -0
  13. package/dist/cjs/types/components/input.d.ts +5 -0
  14. package/dist/cjs/types/components/theme-toggle.d.ts +14 -0
  15. package/dist/cjs/types/hooks/index.d.ts +1 -0
  16. package/dist/cjs/types/hooks/use-hydrated.d.ts +4 -0
  17. package/dist/cjs/types/index.d.ts +8 -0
  18. package/dist/cjs/types/lib/index.d.ts +2 -0
  19. package/dist/cjs/types/lib/preference.d.ts +85 -0
  20. package/dist/cjs/types/lib/utils.d.ts +1 -0
  21. package/dist/cjs/types/package.json +1 -0
  22. package/dist/cjs/types/providers/index.d.ts +2 -0
  23. package/dist/cjs/types/providers/preference-provider.d.ts +20 -0
  24. package/dist/cjs/types/providers/theme-provider.d.ts +25 -0
  25. package/dist/esm/components/button.js +38 -0
  26. package/dist/esm/components/input.js +9 -0
  27. package/dist/esm/components/theme-toggle.js +17 -0
  28. package/dist/esm/hooks/use-hydrated.js +13 -0
  29. package/dist/esm/index.js +8 -0
  30. package/dist/esm/lib/preference.js +35 -0
  31. package/dist/esm/providers/preference-provider.js +124 -0
  32. package/dist/esm/providers/theme-provider.js +178 -0
  33. package/dist/styles/body.css +7 -0
  34. package/dist/styles/font/LICENSE +93 -0
  35. package/dist/styles/font/files/11944884.woff2 +0 -0
  36. package/dist/styles/font/files/3f081d19.woff2 +0 -0
  37. package/dist/styles/font/files/aa4aa22f.woff2 +0 -0
  38. package/dist/styles/font/files/ba1a9b92.woff2 +0 -0
  39. package/dist/styles/font/files/eadd8e6c.woff2 +0 -0
  40. package/dist/styles/font/geist.css +2 -0
  41. package/dist/styles/index.css +2 -0
  42. package/dist/types/components/button.d.ts +12 -0
  43. package/dist/types/components/index.d.ts +3 -0
  44. package/dist/types/components/input.d.ts +5 -0
  45. package/dist/types/components/theme-toggle.d.ts +14 -0
  46. package/dist/types/hooks/index.d.ts +1 -0
  47. package/dist/types/hooks/use-hydrated.d.ts +4 -0
  48. package/dist/types/index.d.ts +8 -0
  49. package/dist/types/lib/index.d.ts +2 -0
  50. package/dist/types/lib/preference.d.ts +85 -0
  51. package/dist/types/lib/utils.d.ts +1 -0
  52. package/dist/types/providers/index.d.ts +2 -0
  53. package/dist/types/providers/preference-provider.d.ts +20 -0
  54. package/dist/types/providers/theme-provider.d.ts +25 -0
  55. package/dist/umd/index.js +3541 -0
  56. package/package.json +81 -4
@@ -0,0 +1,3541 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BadUI = {}, global.React));
5
+ })(this, (function (exports, React) { 'use strict';
6
+
7
+ function _interopNamespaceDefault(e) {
8
+ var n = Object.create(null);
9
+ if (e) {
10
+ Object.keys(e).forEach(function (k) {
11
+ if (k !== 'default') {
12
+ var d = Object.getOwnPropertyDescriptor(e, k);
13
+ Object.defineProperty(n, k, d.get ? d : {
14
+ enumerable: true,
15
+ get: function () { return e[k]; }
16
+ });
17
+ }
18
+ });
19
+ }
20
+ n.default = e;
21
+ return Object.freeze(n);
22
+ }
23
+
24
+ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
25
+
26
+ var jsxRuntime = {exports: {}};
27
+
28
+ var reactJsxRuntime_production = {};
29
+
30
+ /**
31
+ * @license React
32
+ * react-jsx-runtime.production.js
33
+ *
34
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
35
+ *
36
+ * This source code is licensed under the MIT license found in the
37
+ * LICENSE file in the root directory of this source tree.
38
+ */
39
+
40
+ var hasRequiredReactJsxRuntime_production;
41
+
42
+ function requireReactJsxRuntime_production () {
43
+ if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
44
+ hasRequiredReactJsxRuntime_production = 1;
45
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
46
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
47
+ function jsxProd(type, config, maybeKey) {
48
+ var key = null;
49
+ void 0 !== maybeKey && (key = "" + maybeKey);
50
+ void 0 !== config.key && (key = "" + config.key);
51
+ if ("key" in config) {
52
+ maybeKey = {};
53
+ for (var propName in config)
54
+ "key" !== propName && (maybeKey[propName] = config[propName]);
55
+ } else maybeKey = config;
56
+ config = maybeKey.ref;
57
+ return {
58
+ $$typeof: REACT_ELEMENT_TYPE,
59
+ type: type,
60
+ key: key,
61
+ ref: void 0 !== config ? config : null,
62
+ props: maybeKey
63
+ };
64
+ }
65
+ reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
66
+ reactJsxRuntime_production.jsx = jsxProd;
67
+ reactJsxRuntime_production.jsxs = jsxProd;
68
+ return reactJsxRuntime_production;
69
+ }
70
+
71
+ var hasRequiredJsxRuntime;
72
+
73
+ function requireJsxRuntime () {
74
+ if (hasRequiredJsxRuntime) return jsxRuntime.exports;
75
+ hasRequiredJsxRuntime = 1;
76
+
77
+ {
78
+ jsxRuntime.exports = requireReactJsxRuntime_production();
79
+ }
80
+ return jsxRuntime.exports;
81
+ }
82
+
83
+ var jsxRuntimeExports = requireJsxRuntime();
84
+
85
+ function hasWindow() {
86
+ return typeof window !== 'undefined';
87
+ }
88
+ function getWindow(node) {
89
+ var _node$ownerDocument;
90
+ return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
91
+ }
92
+ function isHTMLElement(value) {
93
+ if (!hasWindow()) {
94
+ return false;
95
+ }
96
+ return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
97
+ }
98
+
99
+ /**
100
+ * A clone of the React namespace for reading APIs that may be missing in older
101
+ * supported React versions. Bundlers can rewrite direct `React.someNewApi`
102
+ * reads into named imports, which breaks React 17. Reading from this cloned
103
+ * object keeps those lookups optional.
104
+ *
105
+ * @see https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379
106
+ */
107
+ const SafeReact = {
108
+ ...React__namespace
109
+ };
110
+
111
+ const UNINITIALIZED = {};
112
+
113
+ /**
114
+ * A React.useRef() that is initialized with a function. Note that it accepts an optional
115
+ * initialization argument, so the initialization function doesn't need to be an inline closure.
116
+ *
117
+ * @usage
118
+ * const ref = useRefWithInit(sortColumns, columns)
119
+ */
120
+
121
+ function useRefWithInit(init, initArg) {
122
+ const ref = React__namespace.useRef(UNINITIALIZED);
123
+ if (ref.current === UNINITIALIZED) {
124
+ ref.current = init(initArg);
125
+ }
126
+ return ref;
127
+ }
128
+
129
+ const useInsertionEffect = SafeReact.useInsertionEffect;
130
+ const useSafeInsertionEffect =
131
+ // React 17 doesn't have useInsertionEffect.
132
+ useInsertionEffect &&
133
+ // Preact replaces useInsertionEffect with useLayoutEffect and fires too late.
134
+ useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : fn => fn();
135
+ /**
136
+ * Stabilizes the function passed so it's always the same between renders.
137
+ *
138
+ * The function becomes non-reactive to any values it captures.
139
+ * It can safely be passed as a dependency of `React.useMemo` and `React.useEffect` without re-triggering them if its captured values change.
140
+ *
141
+ * The function must only be called inside effects and event handlers, never during render (which throws an error).
142
+ *
143
+ * This hook is a more permissive version of React 19.2's `React.useEffectEvent` in that it can be passed through contexts and called in event handler props, not just effects.
144
+ */
145
+ function useStableCallback(callback) {
146
+ const stable = useRefWithInit(createStableCallback).current;
147
+ stable.next = callback;
148
+ useSafeInsertionEffect(stable.effect);
149
+ return stable.trampoline;
150
+ }
151
+ function createStableCallback() {
152
+ const stable = {
153
+ next: undefined,
154
+ callback: assertNotCalled,
155
+ trampoline: (...args) => stable.callback?.(...args),
156
+ effect: () => {
157
+ stable.callback = stable.next;
158
+ }
159
+ };
160
+ return stable;
161
+ }
162
+ function assertNotCalled() {
163
+ }
164
+
165
+ const noop = () => {};
166
+ const useIsoLayoutEffect = typeof document !== 'undefined' ? React__namespace.useLayoutEffect : noop;
167
+
168
+ function mergeObjects(a, b) {
169
+ if (a && !b) {
170
+ return a;
171
+ }
172
+ if (!a && b) {
173
+ return b;
174
+ }
175
+ if (a || b) {
176
+ return {
177
+ ...a,
178
+ ...b
179
+ };
180
+ }
181
+ return undefined;
182
+ }
183
+
184
+ const EMPTY_PROPS = {};
185
+
186
+ /* eslint-disable id-denylist */
187
+ /**
188
+ * Merges multiple sets of React props. It follows the Object.assign pattern where the rightmost object's fields overwrite
189
+ * the conflicting ones from others. This doesn't apply to event handlers, `className` and `style` props.
190
+ *
191
+ * Event handlers are merged and called in right-to-left order (rightmost handler executes first, leftmost last).
192
+ * For React synthetic events, the rightmost handler can prevent prior (left-positioned) handlers from executing
193
+ * by calling `event.preventBaseUIHandler()`. For non-synthetic events (custom events with primitive/object values),
194
+ * all handlers always execute without prevention capability.
195
+ *
196
+ * The `className` prop is merged by concatenating classes in right-to-left order (rightmost class appears first in the string).
197
+ * The `style` prop is merged with rightmost styles overwriting the prior ones.
198
+ *
199
+ * Props can either be provided as objects or as functions that take the previous props as an argument.
200
+ * The function will receive the merged props up to that point (going from left to right):
201
+ * so in the case of `(obj1, obj2, fn, obj3)`, `fn` will receive the merged props of `obj1` and `obj2`.
202
+ * The function is responsible for chaining event handlers if needed (that is, we don't run the merge logic).
203
+ *
204
+ * Event handlers returned by the functions are not automatically prevented when `preventBaseUIHandler` is called.
205
+ * They must check `event.baseUIHandlerPrevented` themselves and bail out if it's true.
206
+ *
207
+ * @important **`ref` is not merged.**
208
+ * @param a Props object to merge.
209
+ * @param b Props object to merge. The function will overwrite conflicting props from `a`.
210
+ * @param c Props object to merge. The function will overwrite conflicting props from previous parameters.
211
+ * @param d Props object to merge. The function will overwrite conflicting props from previous parameters.
212
+ * @param e Props object to merge. The function will overwrite conflicting props from previous parameters.
213
+ * @returns The merged props.
214
+ * @public
215
+ */
216
+
217
+ function mergeProps(a, b, c, d, e) {
218
+ if (!c && !d && true && !a) {
219
+ return createInitialMergedProps(b);
220
+ }
221
+
222
+ // We need to mutably own `merged`.
223
+ let merged = createInitialMergedProps(a);
224
+ if (b) {
225
+ merged = mergeInto(merged, b);
226
+ }
227
+ if (c) {
228
+ merged = mergeInto(merged, c);
229
+ }
230
+ if (d) {
231
+ merged = mergeInto(merged, d);
232
+ }
233
+ return merged;
234
+ }
235
+ /* eslint-enable id-denylist */
236
+
237
+ /**
238
+ * Merges an arbitrary number of React props using the same logic as {@link mergeProps}.
239
+ * This function accepts an array of props instead of individual arguments.
240
+ *
241
+ * This has slightly lower performance than {@link mergeProps} due to accepting an array
242
+ * instead of a fixed number of arguments. Prefer {@link mergeProps} when merging 5 or
243
+ * fewer prop sets for better performance.
244
+ *
245
+ * @param props Array of props to merge.
246
+ * @returns The merged props.
247
+ * @see mergeProps
248
+ * @public
249
+ */
250
+ function mergePropsN(props) {
251
+ if (props.length === 0) {
252
+ return EMPTY_PROPS;
253
+ }
254
+ if (props.length === 1) {
255
+ return createInitialMergedProps(props[0]);
256
+ }
257
+
258
+ // We need to mutably own `merged`.
259
+ let merged = createInitialMergedProps(props[0]);
260
+ for (let i = 1; i < props.length; i += 1) {
261
+ merged = mergeInto(merged, props[i]);
262
+ }
263
+ return merged;
264
+ }
265
+ function createInitialMergedProps(inputProps) {
266
+ if (isPropsGetter(inputProps)) {
267
+ // Getter-returned handlers intentionally keep their existing semantics.
268
+ return {
269
+ ...inputProps(EMPTY_PROPS)
270
+ };
271
+ }
272
+ return copyInitialProps(inputProps);
273
+ }
274
+ function mergeInto(merged, inputProps) {
275
+ if (isPropsGetter(inputProps)) {
276
+ return inputProps(merged);
277
+ }
278
+ return mutablyMergeInto(merged, inputProps);
279
+ }
280
+ function copyInitialProps(inputProps) {
281
+ const copiedProps = {
282
+ ...inputProps
283
+ };
284
+
285
+ // `copiedProps` is our fresh own-object copy, so iterating with `for...in` is safe here.
286
+ // eslint-disable-next-line guard-for-in
287
+ for (const propName in copiedProps) {
288
+ const propValue = copiedProps[propName];
289
+ if (isEventHandler(propName, propValue)) {
290
+ copiedProps[propName] = wrapEventHandler(propValue);
291
+ }
292
+ }
293
+ return copiedProps;
294
+ }
295
+
296
+ /**
297
+ * Merges two sets of props. In case of conflicts, the external props take precedence.
298
+ */
299
+ function mutablyMergeInto(mergedProps, externalProps) {
300
+ if (!externalProps) {
301
+ return mergedProps;
302
+ }
303
+
304
+ // eslint-disable-next-line guard-for-in
305
+ for (const propName in externalProps) {
306
+ const externalPropValue = externalProps[propName];
307
+ switch (propName) {
308
+ case 'style':
309
+ {
310
+ mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);
311
+ break;
312
+ }
313
+ case 'className':
314
+ {
315
+ mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);
316
+ break;
317
+ }
318
+ default:
319
+ {
320
+ if (isEventHandler(propName, externalPropValue)) {
321
+ mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);
322
+ } else {
323
+ mergedProps[propName] = externalPropValue;
324
+ }
325
+ }
326
+ }
327
+ }
328
+ return mergedProps;
329
+ }
330
+ function isEventHandler(key, value) {
331
+ // This approach is more efficient than using a regex.
332
+ const code0 = key.charCodeAt(0);
333
+ const code1 = key.charCodeAt(1);
334
+ const code2 = key.charCodeAt(2);
335
+ return code0 === 111 /* o */ && code1 === 110 /* n */ && code2 >= 65 /* A */ && code2 <= 90 /* Z */ && (typeof value === 'function' || typeof value === 'undefined');
336
+ }
337
+ function isPropsGetter(inputProps) {
338
+ return typeof inputProps === 'function';
339
+ }
340
+ function mergeEventHandlers(ourHandler, theirHandler) {
341
+ if (!theirHandler) {
342
+ return ourHandler;
343
+ }
344
+ if (!ourHandler) {
345
+ return wrapEventHandler(theirHandler);
346
+ }
347
+ return (...args) => {
348
+ const event = args[0];
349
+ if (isSyntheticEvent(event)) {
350
+ const baseUIEvent = event;
351
+ makeEventPreventable(baseUIEvent);
352
+ const result = theirHandler(...args);
353
+ if (!baseUIEvent.baseUIHandlerPrevented) {
354
+ ourHandler?.(...args);
355
+ }
356
+ return result;
357
+ }
358
+ const result = theirHandler(...args);
359
+ ourHandler?.(...args);
360
+ return result;
361
+ };
362
+ }
363
+ function wrapEventHandler(handler) {
364
+ if (!handler) {
365
+ return handler;
366
+ }
367
+ return (...args) => {
368
+ const event = args[0];
369
+ if (isSyntheticEvent(event)) {
370
+ makeEventPreventable(event);
371
+ }
372
+ return handler(...args);
373
+ };
374
+ }
375
+ function makeEventPreventable(event) {
376
+ event.preventBaseUIHandler = () => {
377
+ event.baseUIHandlerPrevented = true;
378
+ };
379
+ return event;
380
+ }
381
+ function mergeClassNames(ourClassName, theirClassName) {
382
+ if (theirClassName) {
383
+ if (ourClassName) {
384
+ // eslint-disable-next-line prefer-template
385
+ return theirClassName + ' ' + ourClassName;
386
+ }
387
+ return theirClassName;
388
+ }
389
+ return ourClassName;
390
+ }
391
+ function isSyntheticEvent(event) {
392
+ return event != null && typeof event === 'object' && 'nativeEvent' in event;
393
+ }
394
+
395
+ /**
396
+ * Creates a formatErrorMessage function with a custom URL and prefix.
397
+ * @param baseUrl - The base URL for the error page (e.g., 'https://base-ui.com/production-error')
398
+ * @param prefix - The prefix for the error message (e.g., 'Base UI')
399
+ * @returns A function that formats error messages with the given URL and prefix
400
+ */
401
+ function createFormatErrorMessage(baseUrl, prefix) {
402
+ return function formatErrorMessage(code, ...args) {
403
+ const url = new URL(baseUrl);
404
+ url.searchParams.set('code', code.toString());
405
+ args.forEach(arg => url.searchParams.append('args[]', arg));
406
+ return `${prefix} error #${code}; visit ${url} for the full message.`;
407
+ };
408
+ }
409
+
410
+ /**
411
+ * WARNING: Don't import this directly. It's imported by the code generated by
412
+ * `@mui/internal-babel-plugin-minify-errors`. Make sure to always use string literals in `Error`
413
+ * constructors to ensure the plugin works as expected. Supported patterns include:
414
+ * throw new Error('My message');
415
+ * throw new Error(`My message: ${foo}`);
416
+ * throw new Error(`My message: ${foo}` + 'another string');
417
+ * ...
418
+ */
419
+ const formatErrorMessage = createFormatErrorMessage('https://base-ui.com/production-error', 'Base UI');
420
+
421
+ const CompositeRootContext = /*#__PURE__*/React__namespace.createContext(undefined);
422
+ function useCompositeRootContext(optional = false) {
423
+ const context = React__namespace.useContext(CompositeRootContext);
424
+ if (context === undefined && !optional) {
425
+ throw new Error(formatErrorMessage(16));
426
+ }
427
+ return context;
428
+ }
429
+
430
+ function useFocusableWhenDisabled(parameters) {
431
+ const {
432
+ focusableWhenDisabled,
433
+ disabled,
434
+ composite = false,
435
+ tabIndex: tabIndexProp = 0,
436
+ isNativeButton
437
+ } = parameters;
438
+ const isFocusableComposite = composite && focusableWhenDisabled !== false;
439
+ const isNonFocusableComposite = composite && focusableWhenDisabled === false;
440
+
441
+ // we can't explicitly assign `undefined` to any of these props because it
442
+ // would otherwise prevent subsequently merged props from setting them
443
+ const props = React__namespace.useMemo(() => {
444
+ const additionalProps = {
445
+ // allow Tabbing away from focusableWhenDisabled elements
446
+ onKeyDown(event) {
447
+ if (disabled && focusableWhenDisabled && event.key !== 'Tab') {
448
+ event.preventDefault();
449
+ }
450
+ }
451
+ };
452
+ if (!composite) {
453
+ additionalProps.tabIndex = tabIndexProp;
454
+ if (!isNativeButton && disabled) {
455
+ additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;
456
+ }
457
+ }
458
+ if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled) {
459
+ additionalProps['aria-disabled'] = disabled;
460
+ }
461
+ if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) {
462
+ additionalProps.disabled = disabled;
463
+ }
464
+ return additionalProps;
465
+ }, [composite, disabled, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]);
466
+ return {
467
+ props
468
+ };
469
+ }
470
+
471
+ /**
472
+ * Dispatches a constructed click on the target so it carries the source event's
473
+ * modifier state, which `click()` always reports as unpressed. Like `click()`,
474
+ * the untrusted click still runs native activation behavior (form submission,
475
+ * link navigation).
476
+ * `detail` defaults to 0 and `pointerType` to `''` (the native convention for
477
+ * keyboard-generated clicks). When the click represents a mouse gesture, pass
478
+ * `detail: 1` and `pointerType: 'mouse'` so consumers don't classify it as a
479
+ * keyboard activation.
480
+ */
481
+ function dispatchClickWithModifiers(target, sourceEvent, {
482
+ detail = 0,
483
+ pointerType = ''
484
+ } = {}) {
485
+ target.dispatchEvent(new (getWindow(target).PointerEvent)('click', {
486
+ bubbles: true,
487
+ cancelable: true,
488
+ composed: true,
489
+ detail,
490
+ pointerType,
491
+ shiftKey: sourceEvent.shiftKey,
492
+ ctrlKey: sourceEvent.ctrlKey,
493
+ altKey: sourceEvent.altKey,
494
+ metaKey: sourceEvent.metaKey
495
+ }));
496
+ }
497
+
498
+ function useButton(parameters = {}) {
499
+ const {
500
+ disabled = false,
501
+ focusableWhenDisabled,
502
+ tabIndex = 0,
503
+ native: isNativeButton = true,
504
+ composite: compositeProp
505
+ } = parameters;
506
+ const elementRef = React__namespace.useRef(null);
507
+ const compositeRootContext = useCompositeRootContext(true);
508
+ const isCompositeItem = compositeProp ?? compositeRootContext !== undefined;
509
+ const {
510
+ props: focusableWhenDisabledProps
511
+ } = useFocusableWhenDisabled({
512
+ focusableWhenDisabled,
513
+ disabled,
514
+ composite: isCompositeItem,
515
+ tabIndex,
516
+ isNativeButton
517
+ });
518
+
519
+ // handles a disabled composite button rendering another button, e.g.
520
+ // <Toolbar.Button disabled render={<Menu.Trigger />} />
521
+ // the `disabled` prop needs to pass through 2 `useButton`s then finally
522
+ // delete the `disabled` attribute from DOM
523
+ const updateDisabled = React__namespace.useCallback(() => {
524
+ const element = elementRef.current;
525
+ if (!isButtonElement(element)) {
526
+ return;
527
+ }
528
+ if (isCompositeItem && disabled && focusableWhenDisabledProps.disabled === undefined && element.disabled) {
529
+ element.disabled = false;
530
+ }
531
+ }, [disabled, focusableWhenDisabledProps.disabled, isCompositeItem]);
532
+ useIsoLayoutEffect(updateDisabled, [updateDisabled]);
533
+ const getButtonProps = React__namespace.useCallback((externalProps = {}) => {
534
+ const {
535
+ onClick: externalOnClick,
536
+ onMouseDown: externalOnMouseDown,
537
+ onKeyUp: externalOnKeyUp,
538
+ onKeyDown: externalOnKeyDown,
539
+ onPointerDown: externalOnPointerDown,
540
+ ...otherExternalProps
541
+ } = externalProps;
542
+ return mergeProps({
543
+ onClick(event) {
544
+ if (disabled) {
545
+ event.preventDefault();
546
+ return;
547
+ }
548
+ externalOnClick?.(event);
549
+ },
550
+ onMouseDown(event) {
551
+ if (!disabled) {
552
+ externalOnMouseDown?.(event);
553
+ }
554
+ },
555
+ onKeyDown(event) {
556
+ if (disabled) {
557
+ return;
558
+ }
559
+ makeEventPreventable(event);
560
+ externalOnKeyDown?.(event);
561
+ if (event.baseUIHandlerPrevented) {
562
+ return;
563
+ }
564
+ const isCurrentTarget = event.target === event.currentTarget;
565
+ const currentTarget = event.currentTarget;
566
+ const isButton = isButtonElement(currentTarget);
567
+ const isLink = !isNativeButton && isValidLinkElement(currentTarget);
568
+ const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink);
569
+ const isEnterKey = event.key === 'Enter';
570
+ const isSpaceKey = event.key === ' ';
571
+ const role = currentTarget.getAttribute('role');
572
+ const isTextNavigationRole = role?.startsWith('menuitem') || role === 'option' || role === 'gridcell';
573
+ if (isCurrentTarget && isCompositeItem && isSpaceKey) {
574
+ if (event.defaultPrevented && isTextNavigationRole) {
575
+ return;
576
+ }
577
+ event.preventDefault();
578
+
579
+ // Only a native-mode item that isn't a real <button> is excluded.
580
+ if (!isNativeButton || isButton) {
581
+ event.preventBaseUIHandler();
582
+ dispatchClickWithModifiers(currentTarget, event);
583
+ }
584
+ return;
585
+ }
586
+
587
+ // Keyboard accessibility for native and non-native elements.
588
+ if (!shouldClick || isNativeButton || !isSpaceKey && !isEnterKey) {
589
+ // Space activates links on keyup (`role="button"` semantics, matching the
590
+ // composite path); prevent the page scroll Space would otherwise trigger.
591
+ // Enter is left to the browser's native link activation.
592
+ if (isCurrentTarget && isLink && isSpaceKey) {
593
+ event.preventDefault();
594
+ }
595
+ return;
596
+ }
597
+
598
+ // Match native buttons: preventing the keydown's default cancels activation.
599
+ if (event.defaultPrevented) {
600
+ return;
601
+ }
602
+ event.preventDefault();
603
+ if (isEnterKey) {
604
+ event.preventBaseUIHandler();
605
+ dispatchClickWithModifiers(currentTarget, event);
606
+ }
607
+ },
608
+ onKeyUp(event) {
609
+ if (disabled) {
610
+ return;
611
+ }
612
+
613
+ // calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed
614
+ // https://codesandbox.io/p/sandbox/button-keyup-preventdefault-dn7f0
615
+ makeEventPreventable(event);
616
+ externalOnKeyUp?.(event);
617
+ if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === ' ') {
618
+ event.preventDefault();
619
+ return;
620
+ }
621
+ if (event.baseUIHandlerPrevented) {
622
+ return;
623
+ }
624
+
625
+ // Keyboard accessibility for non interactive elements.
626
+ // Match native buttons: preventing the keyup's default cancels Space activation.
627
+ // Limitation: unlike a native <button>, a prevented *keydown* cannot cancel the
628
+ // activation — no state is kept between keydown and keyup, so we can't tell
629
+ // whether the keydown was prevented or even happened on this element.
630
+ if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && !event.defaultPrevented && event.key === ' ') {
631
+ event.preventBaseUIHandler();
632
+ dispatchClickWithModifiers(event.currentTarget, event);
633
+ }
634
+ },
635
+ onPointerDown(event) {
636
+ if (disabled) {
637
+ event.preventDefault();
638
+ return;
639
+ }
640
+ externalOnPointerDown?.(event);
641
+ }
642
+ }, isNativeButton ? {
643
+ type: 'button'
644
+ } : {
645
+ role: 'button'
646
+ }, focusableWhenDisabledProps, otherExternalProps);
647
+ }, [disabled, focusableWhenDisabledProps, isCompositeItem, isNativeButton]);
648
+ const buttonRef = useStableCallback(element => {
649
+ elementRef.current = element;
650
+ updateDisabled();
651
+ });
652
+ return {
653
+ getButtonProps,
654
+ buttonRef
655
+ };
656
+ }
657
+ function isButtonElement(elem) {
658
+ return isHTMLElement(elem) && elem.tagName === 'BUTTON';
659
+ }
660
+ function isValidLinkElement(elem) {
661
+ return isHTMLElement(elem) && elem.tagName === 'A' && Boolean(elem.href);
662
+ }
663
+
664
+ /**
665
+ * Merges refs into a single memoized callback ref or `null`.
666
+ * This makes sure multiple refs are updated together and have the same value.
667
+ *
668
+ * This function accepts up to four refs. If you need to merge more, or have an unspecified number of refs to merge,
669
+ * use `useMergedRefsN` instead.
670
+ */
671
+
672
+ function useMergedRefs(a, b, c, d) {
673
+ const forkRef = useRefWithInit(createForkRef).current;
674
+ if (didChange(forkRef, a, b, c, d)) {
675
+ update(forkRef, [a, b, c, d]);
676
+ }
677
+ return forkRef.callback;
678
+ }
679
+
680
+ /**
681
+ * Merges an array of refs into a single memoized callback ref or `null`.
682
+ *
683
+ * If you need to merge a fixed number (up to four) of refs, use `useMergedRefs` instead for better performance.
684
+ */
685
+ function useMergedRefsN(refs) {
686
+ const forkRef = useRefWithInit(createForkRef).current;
687
+ if (didChangeN(forkRef, refs)) {
688
+ update(forkRef, refs);
689
+ }
690
+ return forkRef.callback;
691
+ }
692
+ function createForkRef() {
693
+ return {
694
+ callback: null,
695
+ cleanup: null,
696
+ refs: []
697
+ };
698
+ }
699
+ function didChange(forkRef, a, b, c, d) {
700
+ // prettier-ignore
701
+ return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
702
+ }
703
+ function didChangeN(forkRef, newRefs) {
704
+ return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);
705
+ }
706
+ function update(forkRef, refs) {
707
+ forkRef.refs = refs;
708
+ if (refs.every(ref => ref == null)) {
709
+ forkRef.callback = null;
710
+ return;
711
+ }
712
+ forkRef.callback = instance => {
713
+ if (forkRef.cleanup) {
714
+ forkRef.cleanup();
715
+ forkRef.cleanup = null;
716
+ }
717
+ if (instance != null) {
718
+ const cleanupCallbacks = Array(refs.length).fill(null);
719
+ for (let i = 0; i < refs.length; i += 1) {
720
+ const ref = refs[i];
721
+ if (ref == null) {
722
+ continue;
723
+ }
724
+ switch (typeof ref) {
725
+ case 'function':
726
+ {
727
+ const refCleanup = ref(instance);
728
+ if (typeof refCleanup === 'function') {
729
+ cleanupCallbacks[i] = refCleanup;
730
+ }
731
+ break;
732
+ }
733
+ case 'object':
734
+ {
735
+ ref.current = instance;
736
+ break;
737
+ }
738
+ }
739
+ }
740
+ forkRef.cleanup = () => {
741
+ for (let i = 0; i < refs.length; i += 1) {
742
+ const ref = refs[i];
743
+ if (ref == null) {
744
+ continue;
745
+ }
746
+ switch (typeof ref) {
747
+ case 'function':
748
+ {
749
+ const cleanupCallback = cleanupCallbacks[i];
750
+ if (typeof cleanupCallback === 'function') {
751
+ cleanupCallback();
752
+ } else {
753
+ // Legacy ref with no attach-time cleanup: detach by calling it with `null`.
754
+ // It returns nothing; React 19 cleanups are handled in the branch above.
755
+ void ref(null);
756
+ }
757
+ break;
758
+ }
759
+ case 'object':
760
+ {
761
+ ref.current = null;
762
+ break;
763
+ }
764
+ }
765
+ }
766
+ };
767
+ }
768
+ };
769
+ }
770
+
771
+ const majorVersion = parseInt(React__namespace.version, 10);
772
+ function isReactVersionAtLeast(reactVersionToCheck) {
773
+ return majorVersion >= reactVersionToCheck;
774
+ }
775
+
776
+ /**
777
+ * Extracts the `ref` from a React element, handling different React versions.
778
+ */
779
+ function getReactElementRef(element) {
780
+ if (! /*#__PURE__*/React__namespace.isValidElement(element)) {
781
+ return null;
782
+ }
783
+ const reactElement = element;
784
+ const propsWithRef = reactElement.props;
785
+ return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
786
+ }
787
+
788
+ function NOOP() {}
789
+
790
+ // Typed as mutable `never[]` so it is assignable to any `T[]` fallback (for example
791
+ // `defaultValue ?? EMPTY_ARRAY` in `useControlled` callers) without widening `T`.
792
+ // Frozen so a write through a widened alias throws instead of mutating the shared singleton.
793
+ const EMPTY_ARRAY = Object.freeze([]);
794
+ const EMPTY_OBJECT = Object.freeze({});
795
+
796
+ function getStateAttributesProps(state, customMapping) {
797
+ const props = {};
798
+
799
+ /* eslint-disable-next-line guard-for-in */
800
+ for (const key in state) {
801
+ const value = state[key];
802
+ if (customMapping?.hasOwnProperty(key)) {
803
+ const customProps = customMapping[key](value);
804
+ if (customProps != null) {
805
+ Object.assign(props, customProps);
806
+ }
807
+ continue;
808
+ }
809
+ if (value === true) {
810
+ props[`data-${key.toLowerCase()}`] = '';
811
+ } else if (value) {
812
+ props[`data-${key.toLowerCase()}`] = value.toString();
813
+ }
814
+ }
815
+ return props;
816
+ }
817
+
818
+ /**
819
+ * If the provided className is a string, it will be returned as is.
820
+ * Otherwise, the function will call the className function with the state as the first argument.
821
+ *
822
+ * @param className
823
+ * @param state
824
+ */
825
+ function resolveClassName(className, state) {
826
+ return typeof className === 'function' ? className(state) : className;
827
+ }
828
+
829
+ /**
830
+ * If the provided style is an object, it will be returned as is.
831
+ * Otherwise, the function will call the style function with the state as the first argument.
832
+ *
833
+ * @param style
834
+ * @param state
835
+ */
836
+ function resolveStyle(style, state) {
837
+ return typeof style === 'function' ? style(state) : style;
838
+ }
839
+
840
+ /**
841
+ * Renders a Base UI element.
842
+ *
843
+ * @param element The default HTML element to render. Can be overridden by the `render` prop.
844
+ * @param componentProps An object containing the `render` and `className` props to be used for element customization. Other props are ignored.
845
+ * @param params Additional parameters for rendering the element.
846
+ */
847
+ function useRenderElement(element, componentProps, params = {}) {
848
+ let renderProp = componentProps.render;
849
+ if (params.enabled !== false) {
850
+ // A pending lazy element suspends when unwrapped, so leave it wrapped while disabled.
851
+ renderProp = unwrapLazyRenderProp(renderProp);
852
+ }
853
+ const outProps = useRenderElementProps(componentProps, params, renderProp);
854
+ if (params.enabled === false) {
855
+ return null;
856
+ }
857
+ const state = params.state ?? EMPTY_OBJECT;
858
+ return evaluateRenderProp(element, renderProp, outProps, state);
859
+ }
860
+
861
+ /**
862
+ * Computes render element final props.
863
+ */
864
+ function useRenderElementProps(componentProps, params, renderProp) {
865
+ const {
866
+ className: classNameProp,
867
+ style: styleProp
868
+ } = componentProps;
869
+ const {
870
+ state = EMPTY_OBJECT,
871
+ ref,
872
+ props,
873
+ stateAttributesMapping,
874
+ enabled = true
875
+ } = params;
876
+ const className = enabled ? resolveClassName(classNameProp, state) : undefined;
877
+ const style = enabled ? resolveStyle(styleProp, state) : undefined;
878
+ const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT;
879
+ const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : undefined;
880
+
881
+ // Ensure outProps is always a new mutable object when enabled, never EMPTY_OBJECT.
882
+ // This prevents potential TypeError when setting ref, className, or style properties,
883
+ // since EMPTY_OBJECT is frozen and mutations would fail in strict mode.
884
+ const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;
885
+
886
+ // SAFETY: The `useMergedRefs` functions use a single hook to store the same value,
887
+ // switching between them at runtime is safe. If this assertion fails, React will
888
+ // throw at runtime anyway.
889
+ // This also skips the `useMergedRefs` call on the server, which is fine because
890
+ // refs are not used on the server side.
891
+ /* eslint-disable react-hooks/rules-of-hooks */
892
+ if (typeof document !== 'undefined') {
893
+ if (!enabled) {
894
+ // Called only to keep the hook order stable when disabled; the merged ref is unused.
895
+ void useMergedRefs(null, null);
896
+ } else if (Array.isArray(ref)) {
897
+ outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
898
+ } else {
899
+ outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
900
+ }
901
+ }
902
+ if (!enabled) {
903
+ return EMPTY_OBJECT;
904
+ }
905
+ if (className !== undefined) {
906
+ outProps.className = mergeClassNames(outProps.className, className);
907
+ }
908
+ if (style !== undefined) {
909
+ outProps.style = mergeObjects(outProps.style, style);
910
+ }
911
+ return outProps;
912
+ }
913
+ function resolveRenderFunctionProps(props) {
914
+ if (Array.isArray(props)) {
915
+ return mergePropsN(props);
916
+ }
917
+ return mergeProps(undefined, props);
918
+ }
919
+
920
+ // The symbol React uses internally for lazy components
921
+ // https://github.com/react/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/shared/ReactSymbols.js#L31
922
+ //
923
+ // TODO delete once https://github.com/react/react/issues/32392 is fixed
924
+ const REACT_LAZY_TYPE = Symbol.for('react.lazy');
925
+
926
+ // Workaround for https://github.com/react/react/issues/32392
927
+ // The Flight client hands over a lazy wrapper in place of a render element created in a
928
+ // Server Component. The wrapper exposes no `.props` or `.ref`, so it must be unwrapped
929
+ // before those are read. This works because the toArray() logic unwraps the lazy
930
+ // element type in
931
+ // https://github.com/react/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/react/src/ReactChildren.js#L186
932
+ function unwrapLazyRenderProp(render) {
933
+ // `$$typeof` is a React internal, absent from the public element types.
934
+ if (render?.$$typeof !== REACT_LAZY_TYPE) {
935
+ return render;
936
+ }
937
+ // Keep the wrapper unless it unwraps to an element, so an invalid render prop is still
938
+ // reported as one instead of silently falling back to the default element.
939
+ const unwrapped = React__namespace.Children.toArray(render)[0];
940
+ return /*#__PURE__*/React__namespace.isValidElement(unwrapped) ? unwrapped : render;
941
+ }
942
+ function evaluateRenderProp(element, render, props, state) {
943
+ if (render) {
944
+ if (typeof render === 'function') {
945
+ return render(props, state);
946
+ }
947
+ const mergedProps = mergeProps(props, render.props);
948
+ mergedProps.ref = props.ref;
949
+ return /*#__PURE__*/React__namespace.cloneElement(render, mergedProps);
950
+ }
951
+ // `element` is always provided when there is no `render` prop.
952
+ return renderTag(element, props);
953
+ }
954
+ function renderTag(Tag, props) {
955
+ if (Tag === 'button') {
956
+ return /*#__PURE__*/React.createElement("button", {
957
+ type: "button",
958
+ ...props,
959
+ key: props.key
960
+ });
961
+ }
962
+ if (Tag === 'img') {
963
+ return /*#__PURE__*/React.createElement("img", {
964
+ alt: "",
965
+ ...props,
966
+ key: props.key
967
+ });
968
+ }
969
+ return /*#__PURE__*/React__namespace.createElement(Tag, props);
970
+ }
971
+
972
+ /**
973
+ * A button component that can be used to trigger actions.
974
+ * Renders a `<button>` element.
975
+ *
976
+ * Documentation: [Base UI Button](https://base-ui.com/react/components/button)
977
+ */
978
+ const Button$1 = /*#__PURE__*/React__namespace.forwardRef(function Button(componentProps, forwardedRef) {
979
+ const {
980
+ render,
981
+ className,
982
+ disabled = false,
983
+ focusableWhenDisabled = false,
984
+ nativeButton = true,
985
+ style,
986
+ ...elementProps
987
+ } = componentProps;
988
+ const {
989
+ getButtonProps,
990
+ buttonRef
991
+ } = useButton({
992
+ disabled,
993
+ focusableWhenDisabled,
994
+ native: nativeButton
995
+ });
996
+ const state = {
997
+ disabled
998
+ };
999
+ return useRenderElement('button', componentProps, {
1000
+ state,
1001
+ ref: [forwardedRef, buttonRef],
1002
+ props: [elementProps, getButtonProps]
1003
+ });
1004
+ });
1005
+
1006
+ function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
1007
+
1008
+ const falsyToString = (value)=>typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
1009
+ const cx = clsx;
1010
+ const cva = (base, config)=>(props)=>{
1011
+ var _config_compoundVariants;
1012
+ if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
1013
+ const { variants, defaultVariants } = config;
1014
+ const getVariantClassNames = Object.keys(variants).map((variant)=>{
1015
+ const variantProp = props === null || props === void 0 ? void 0 : props[variant];
1016
+ const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
1017
+ if (variantProp === null) return null;
1018
+ const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
1019
+ return variants[variant][variantKey];
1020
+ });
1021
+ const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{
1022
+ let [key, value] = param;
1023
+ if (value === undefined) {
1024
+ return acc;
1025
+ }
1026
+ acc[key] = value;
1027
+ return acc;
1028
+ }, {});
1029
+ const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{
1030
+ let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
1031
+ return Object.entries(compoundVariantOptions).every((param)=>{
1032
+ let [key, value] = param;
1033
+ return Array.isArray(value) ? value.includes({
1034
+ ...defaultVariants,
1035
+ ...propsWithoutUndefined
1036
+ }[key]) : ({
1037
+ ...defaultVariants,
1038
+ ...propsWithoutUndefined
1039
+ })[key] === value;
1040
+ }) ? [
1041
+ ...acc,
1042
+ cvClass,
1043
+ cvClassName
1044
+ ] : acc;
1045
+ }, []);
1046
+ return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
1047
+ };
1048
+
1049
+ //#region src/tables.generated.ts
1050
+ const P = 48;
1051
+ const U = (s, o = 0) => {
1052
+ const out = new Int32Array(s.length);
1053
+ for (let i = 0; i < s.length; i++) out[i] = s.charCodeAt(i) - P - o;
1054
+ return out;
1055
+ };
1056
+ const PS = (counts) => {
1057
+ const out = new Int32Array(counts.length + 1);
1058
+ for (let i = 0; i < counts.length; i++) out[i + 1] = out[i] + counts[i];
1059
+ return out;
1060
+ };
1061
+ const DZ = (s) => {
1062
+ const out = new Int32Array(s.length);
1063
+ let a = 0;
1064
+ for (let i = 0; i < s.length; i++) {
1065
+ const z = s.charCodeAt(i) - P;
1066
+ a += z >>> 1 ^ -(z & 1);
1067
+ out[i] = a;
1068
+ }
1069
+ return out;
1070
+ };
1071
+ const GROUP_COUNT = 384;
1072
+ const customValidatorNames = [];
1073
+ const edgeStart = PS(U("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010"));
1074
+ const labelStart = PS(U(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3"));
1075
+ const labelText = "@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom";
1076
+ const edgeTarget = (() => {
1077
+ const N = edgeStart.length - 1;
1078
+ const sizes = new Int32Array(N);
1079
+ for (let i = N - 1; i >= 0; i--) {
1080
+ let s = 1;
1081
+ let c = i + 1;
1082
+ for (let k = edgeStart[i]; k < edgeStart[i + 1]; k++) {
1083
+ s += sizes[c];
1084
+ c += sizes[c];
1085
+ }
1086
+ sizes[i] = s;
1087
+ }
1088
+ const out = new Int32Array(edgeStart[N]);
1089
+ let e = 0;
1090
+ for (let i = 0; i < N; i++) {
1091
+ let c = i + 1;
1092
+ for (let k = edgeStart[i]; k < edgeStart[i + 1]; k++) {
1093
+ out[e++] = c;
1094
+ c += sizes[c];
1095
+ }
1096
+ }
1097
+ return out;
1098
+ })();
1099
+ const nodeGroup = U("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000", 1);
1100
+ const vlistPat = PS(U("123333359346463635126536711576"));
1101
+ const vlistOps = U("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032");
1102
+ const vlistRef = U("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199");
1103
+ const vlistGroup = DZ("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200");
1104
+ const nodeVlist = (() => {
1105
+ const out = (/* @__PURE__ */ new Int32Array(319)).fill(-1);
1106
+ const A = DZ("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222");
1107
+ const V = DZ("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");
1108
+ for (let i = 0; i < A.length; i++) out[A[i]] = V[i];
1109
+ return out;
1110
+ })();
1111
+ const SETS = "container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform".split("|").map((s) => {
1112
+ const tails = s.split(" ");
1113
+ const prefix = tails.shift();
1114
+ for (let i = 0; i < tails.length; i++) tails[i] = prefix + tails[i];
1115
+ return tails;
1116
+ });
1117
+ const AA = DZ("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422");
1118
+ const AG = DZ("ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>6ʰ22ʷʺʷʺʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622");
1119
+ const AS = DZ("02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}€22ƒ†…:22z22222222222G000q†OVI00000{˜2™<40000Œ›@00000G¦§000ª00000000000000021K¬«00®“000000000000000000000–222›HGH_1¸222½2¾2222ÇÊ000­°2±");
1120
+ const litAnchor = /* @__PURE__ */ new Int32Array(987);
1121
+ const litGroup = /* @__PURE__ */ new Int32Array(987);
1122
+ const litPool = /* @__PURE__ */ new Int32Array(987);
1123
+ let poolText = "";
1124
+ const poolOffsets = /* @__PURE__ */ new Int32Array(1022);
1125
+ {
1126
+ const tailRef = /* @__PURE__ */ new Map();
1127
+ let nextRef = 0;
1128
+ let e = 0;
1129
+ for (let i = 0; i < AA.length; i++) for (const tail of SETS[AS[i]]) {
1130
+ let r = tailRef.get(tail);
1131
+ if (r === void 0) {
1132
+ r = nextRef++;
1133
+ tailRef.set(tail, r);
1134
+ poolOffsets[r * 2] = poolText.length;
1135
+ poolOffsets[r * 2 + 1] = tail.length;
1136
+ poolText += tail;
1137
+ }
1138
+ litAnchor[e] = AA[i];
1139
+ litGroup[e] = AG[i];
1140
+ litPool[e] = r;
1141
+ e++;
1142
+ }
1143
+ }
1144
+ const adjGid = DZ("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p");
1145
+ const adjStart = PS(U("1::24444432:442:44:44>222222:44:4421322511111311111114"));
1146
+ const adjTgt = DZ("2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222");
1147
+ const patGid = U("ij");
1148
+ const patTgt = U("—");
1149
+ const postfixLookupGroups = U("1");
1150
+ const orderSensitiveModifiers = "* ** after backdrop before details-content file first-letter first-line marker placeholder selection";
1151
+ var tables_generated_default = {
1152
+ GROUP_COUNT,
1153
+ customValidatorNames,
1154
+ edgeStart,
1155
+ labelStart,
1156
+ labelText,
1157
+ edgeTarget,
1158
+ nodeGroup,
1159
+ nodeVlist,
1160
+ vlistPat,
1161
+ vlistOps,
1162
+ vlistRef,
1163
+ vlistGroup,
1164
+ litAnchor,
1165
+ litGroup,
1166
+ litPool,
1167
+ poolOffsets,
1168
+ poolText,
1169
+ adjGid,
1170
+ adjStart,
1171
+ adjTgt,
1172
+ patGid,
1173
+ patTgt,
1174
+ postfixLookupGroups,
1175
+ orderSensitiveModifiers
1176
+ };
1177
+
1178
+ //#region src/engine.ts
1179
+ const IS_JSC = "line" in /* @__PURE__ */ new Error();
1180
+ const EXTERNAL = -1;
1181
+ const DEAD = -1;
1182
+ const fnv = (str, s, e) => {
1183
+ let h = 2166136261;
1184
+ for (let p = s; p < e; p++) h = Math.imul(h ^ str.charCodeAt(p), 16777619);
1185
+ return h;
1186
+ };
1187
+ const spanHash = (str, s, e) => {
1188
+ const len = e - s;
1189
+ let h = Math.imul(len, 2654435761) ^ str.charCodeAt(s);
1190
+ if (len > 3) {
1191
+ const q = len >> 2;
1192
+ const m = len >> 1;
1193
+ h = Math.imul(h ^ str.charCodeAt(s + 1) << 8 ^ str.charCodeAt(s + 2) << 16 ^ str.charCodeAt(s + q), 2246822507);
1194
+ h = Math.imul(h ^ str.charCodeAt(s + m) << 8 ^ str.charCodeAt(s + m + q) << 16 ^ str.charCodeAt(e - 3), 3266489909);
1195
+ h ^= str.charCodeAt(e - 2) << 8 ^ str.charCodeAt(e - 1) << 16;
1196
+ for (let p = s + 3, q = e - 4; p < s + 8 && p < q; p++, q--) h = Math.imul(h ^ str.charCodeAt(p) ^ str.charCodeAt(q) << 8, 16777619);
1197
+ }
1198
+ return h ^ h >>> 15 | 0;
1199
+ };
1200
+ const createEngine = (T, validatorImpls, options = {}) => {
1201
+ const { GROUP_COUNT, edgeStart, labelStart, labelText, edgeTarget, nodeGroup, nodeVlist, vlistPat, vlistOps, vlistRef, vlistGroup, litAnchor, litGroup, litPool, poolOffsets, poolText, adjGid, adjStart, adjTgt, patGid, patTgt, postfixLookupGroups, customValidatorNames, orderSensitiveModifiers } = T;
1202
+ const adjRow = new Int32Array(GROUP_COUNT).fill(-1);
1203
+ for (let i = 0; i < adjGid.length; i++) adjRow[adjGid[i]] = i;
1204
+ let maxAdj = 0;
1205
+ for (let r = 0; r + 1 < adjStart.length; r++) {
1206
+ const n = adjStart[r + 1] - adjStart[r];
1207
+ if (n > maxAdj) maxAdj = n;
1208
+ }
1209
+ let CLAIM_PER_TOKEN = 32;
1210
+ while (CLAIM_PER_TOKEN < 2 * (1 + maxAdj + patGid.length)) CLAIM_PER_TOKEN <<= 1;
1211
+ const vgStart = new Int32Array(vlistRef.length + 1);
1212
+ for (let l = 0; l < vlistRef.length; l++) vgStart[l + 1] = vgStart[l] + vlistPat[vlistRef[l] + 1] - vlistPat[vlistRef[l]];
1213
+ const postfixLookupSet = new Uint8Array(GROUP_COUNT);
1214
+ for (let i = 0; i < postfixLookupGroups.length; i++) postfixLookupSet[postfixLookupGroups[i]] = 1;
1215
+ const nodeCount = edgeStart.length - 1;
1216
+ const nodeHasLit = new Uint8Array(nodeCount);
1217
+ let litMaxLen = 0;
1218
+ let litNoArb = true;
1219
+ for (let i = 0; i < litAnchor.length; i++) {
1220
+ nodeHasLit[litAnchor[i]] = 1;
1221
+ const len = poolOffsets[litPool[i] * 2 + 1];
1222
+ if (len > litMaxLen) litMaxLen = len;
1223
+ const c0 = poolText.charCodeAt(poolOffsets[litPool[i] * 2]);
1224
+ if (c0 === 91 || c0 === 40) litNoArb = false;
1225
+ }
1226
+ let LIT_SIZE = 1;
1227
+ while (LIT_SIZE < litAnchor.length * 2) LIT_SIZE <<= 1;
1228
+ const litTable = new Int32Array(LIT_SIZE).fill(-1);
1229
+ for (let i = 0; i < litAnchor.length; i++) {
1230
+ const off = poolOffsets[litPool[i] * 2];
1231
+ let idx = (fnv(poolText, off, off + poolOffsets[litPool[i] * 2 + 1]) ^ Math.imul(litAnchor[i], 2654435761) | 0) & LIT_SIZE - 1;
1232
+ while (litTable[idx] !== -1) idx = idx + 1 & LIT_SIZE - 1;
1233
+ litTable[idx] = i;
1234
+ }
1235
+ const litProbe = (anchor, input, s, e) => {
1236
+ let idx = (fnv(input, s, e) ^ Math.imul(anchor, 2654435761) | 0) & LIT_SIZE - 1;
1237
+ const len = e - s;
1238
+ for (;;) {
1239
+ const entry = litTable[idx];
1240
+ if (entry === -1) return -1;
1241
+ if (litAnchor[entry] === anchor && poolOffsets[litPool[entry] * 2 + 1] === len) {
1242
+ const off = poolOffsets[litPool[entry] * 2];
1243
+ let ok = true;
1244
+ for (let k = 0; k < len; k++) if (poolText.charCodeAt(off + k) !== input.charCodeAt(s + k)) {
1245
+ ok = false;
1246
+ break;
1247
+ }
1248
+ if (ok) return litGroup[entry];
1249
+ }
1250
+ idx = idx + 1 & LIT_SIZE - 1;
1251
+ }
1252
+ };
1253
+ const cacheSize = options.cacheSize ?? 8192;
1254
+ const RAW_PREFIX = options.prefix ?? T.prefix ?? "";
1255
+ const FULL_PREFIX = RAW_PREFIX === "" ? "" : RAW_PREFIX + ":";
1256
+ const FPL = FULL_PREFIX.length;
1257
+ const vCustom = (customValidatorNames ?? []).map((name) => {
1258
+ throw new Error("cn: missing validator " + name);
1259
+ });
1260
+ const lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
1261
+ const colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/;
1262
+ const shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
1263
+ const imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
1264
+ let aKind = 0;
1265
+ let aLabelS = -1;
1266
+ let aLabelE = -1;
1267
+ let aValS = -1;
1268
+ let aValE = -1;
1269
+ const isWordCode = (c) => c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c === 95;
1270
+ const isUniWS = (c) => /\s/.test(String.fromCharCode(c));
1271
+ const analyzeArb = (input, s, e) => {
1272
+ aKind = 0;
1273
+ aLabelS = -1;
1274
+ if (e - s < 3) return;
1275
+ const c0 = input.charCodeAt(s);
1276
+ const cl = input.charCodeAt(e - 1);
1277
+ if (c0 === 91 && cl === 93) aKind = 1;
1278
+ else if (c0 === 40 && cl === 41) aKind = 2;
1279
+ else return;
1280
+ aValS = s + 1;
1281
+ aValE = e - 1;
1282
+ let p = s + 1;
1283
+ if (isWordCode(input.charCodeAt(p))) {
1284
+ p++;
1285
+ while (p < e - 1) {
1286
+ const c = input.charCodeAt(p);
1287
+ if (!isWordCode(c) && c !== 45) break;
1288
+ p++;
1289
+ }
1290
+ if (p < e - 2 && input.charCodeAt(p) === 58) {
1291
+ aLabelS = s + 1;
1292
+ aLabelE = p;
1293
+ aValS = p + 1;
1294
+ }
1295
+ }
1296
+ };
1297
+ const spanEq = (input, s, e, str) => {
1298
+ if (e - s !== str.length) return false;
1299
+ for (let i = 0; i < str.length; i++) if (input.charCodeAt(s + i) !== str.charCodeAt(i)) return false;
1300
+ return true;
1301
+ };
1302
+ const fractionRegex = /^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/;
1303
+ const tshirtRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
1304
+ const isNumStr = (v) => !!v && !Number.isNaN(Number(v));
1305
+ const spanIsNamedContainerQuery = (input, s, e) => {
1306
+ if (e - s < 11 || !spanEq(input, s, s + 10, "@container")) return false;
1307
+ if (input.charCodeAt(s + 10) === 47) return e - s >= 12;
1308
+ const c11 = input.charCodeAt(s + 11);
1309
+ return c11 === 115 && e - s >= 17 && spanEq(input, s + 10, s + 16, "-size/") || c11 === 110 && e - s >= 19 && spanEq(input, s + 10, s + 18, "-normal/");
1310
+ };
1311
+ const VKIND = [
1312
+ 1,
1313
+ 1,
1314
+ 1,
1315
+ 1,
1316
+ 1,
1317
+ 1,
1318
+ 1,
1319
+ 1,
1320
+ 2,
1321
+ 2,
1322
+ 2,
1323
+ 2,
1324
+ 2,
1325
+ 2,
1326
+ 2
1327
+ ];
1328
+ const VLABELS = "length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight".split("|").map((s) => s.split(" "));
1329
+ const VFALL = [
1330
+ 2,
1331
+ 3,
1332
+ 1,
1333
+ 0,
1334
+ 0,
1335
+ 0,
1336
+ 4,
1337
+ 5,
1338
+ 0,
1339
+ 0,
1340
+ 0,
1341
+ 0,
1342
+ 0,
1343
+ 1,
1344
+ 1
1345
+ ];
1346
+ const runValidator = (op, input, s, e) => {
1347
+ if (op >= 10) {
1348
+ if (op >= 25) return vCustom[op - 25](input.slice(s, e));
1349
+ const i = op - 10;
1350
+ if (aKind !== VKIND[i]) return false;
1351
+ if (aLabelS >= 0) {
1352
+ for (const L of VLABELS[i]) if (spanEq(input, aLabelS, aLabelE, L)) return true;
1353
+ return false;
1354
+ }
1355
+ switch (VFALL[i]) {
1356
+ case 0: return false;
1357
+ case 1: return true;
1358
+ case 2: {
1359
+ const v = input.slice(aValS, aValE);
1360
+ return lengthUnitRegex.test(v) && !colorFunctionRegex.test(v);
1361
+ }
1362
+ case 3: return isNumStr(input.slice(aValS, aValE));
1363
+ case 4: return imageRegex.test(input.slice(aValS, aValE));
1364
+ default: return shadowRegex.test(input.slice(aValS, aValE));
1365
+ }
1366
+ }
1367
+ switch (op) {
1368
+ case 0: return true;
1369
+ case 1: return aKind === 0;
1370
+ case 2: return aKind === 1;
1371
+ case 3: return aKind === 2;
1372
+ case 4: return fractionRegex.test(input.slice(s, e));
1373
+ case 5: return isNumStr(input.slice(s, e));
1374
+ case 6: {
1375
+ const v = input.slice(s, e);
1376
+ return !!v && Number.isInteger(Number(v));
1377
+ }
1378
+ case 7: return e > s && input.charCodeAt(e - 1) === 37 && isNumStr(input.slice(s, e - 1));
1379
+ case 8: return tshirtRegex.test(input.slice(s, e));
1380
+ default: return spanIsNamedContainerQuery(input, s, e);
1381
+ }
1382
+ };
1383
+ const orderSensitive = new Set(typeof orderSensitiveModifiers === "string" ? orderSensitiveModifiers.split(" ") : orderSensitiveModifiers);
1384
+ const internSpan = (map, input, s, e, imp, make) => {
1385
+ const h = fnv(input, s, e) ^ (imp ? 2654435769 : 0) | 0;
1386
+ let bucket = map.get(h);
1387
+ if (bucket !== void 0) outer: for (let b = 0; b < bucket.length; b++) {
1388
+ const en = bucket[b];
1389
+ if (en.imp !== imp || en.k.length !== e - s) continue;
1390
+ for (let i = 0; i < en.k.length; i++) if (en.k.charCodeAt(i) !== input.charCodeAt(s + i)) continue outer;
1391
+ return en.id;
1392
+ }
1393
+ else map.set(h, bucket = []);
1394
+ const k = input.slice(s, e);
1395
+ const id = make(k);
1396
+ bucket.push({
1397
+ k,
1398
+ imp,
1399
+ id
1400
+ });
1401
+ return id;
1402
+ };
1403
+ let ctxByHash = /* @__PURE__ */ new Map();
1404
+ let ctxByCanon = /* @__PURE__ */ new Map();
1405
+ let nextCtxId = 2;
1406
+ const MAX_CTX = 4096;
1407
+ const canonicalizeContext = (raw, important) => {
1408
+ const mods = [];
1409
+ let dB = 0, dP = 0, start = 0;
1410
+ for (let i = 0; i < raw.length; i++) {
1411
+ const c = raw.charCodeAt(i);
1412
+ if (dB === 0 && dP === 0 && c === 58) {
1413
+ mods.push(raw.slice(start, i));
1414
+ start = i + 1;
1415
+ } else if (c === 91) dB++;
1416
+ else if (c === 93) dB--;
1417
+ else if (c === 40) dP++;
1418
+ else if (c === 41) dP--;
1419
+ }
1420
+ mods.push(raw.slice(start));
1421
+ let canonical = mods[0];
1422
+ if (mods.length > 1) {
1423
+ const result = [];
1424
+ let segment = [];
1425
+ for (const mod of mods) if (mod.charCodeAt(0) === 91 || orderSensitive.has(mod)) {
1426
+ if (segment.length) {
1427
+ result.push(...segment.sort());
1428
+ segment = [];
1429
+ }
1430
+ result.push(mod);
1431
+ } else segment.push(mod);
1432
+ if (segment.length) result.push(...segment.sort());
1433
+ canonical = result.join(":");
1434
+ }
1435
+ const key = important ? canonical + " !" : canonical;
1436
+ let id = ctxByCanon.get(key);
1437
+ if (id === void 0) ctxByCanon.set(key, id = nextCtxId++);
1438
+ return id;
1439
+ };
1440
+ let dynByHash = /* @__PURE__ */ new Map();
1441
+ let nextDynId = GROUP_COUNT;
1442
+ const MAX_DYN = GROUP_COUNT + 4096;
1443
+ const newDynId = () => nextDynId++;
1444
+ const ID_LIMIT = 2097152;
1445
+ const TOKEN_TABLE = 8192;
1446
+ const memoHash = new Int32Array(TOKEN_TABLE);
1447
+ const memoStr = new Array(TOKEN_TABLE).fill(null);
1448
+ const memoGid = new Int32Array(TOKEN_TABLE);
1449
+ const memoCtx = new Int32Array(TOKEN_TABLE);
1450
+ const memoFlags = new Uint8Array(TOKEN_TABLE);
1451
+ let memoTick = 0;
1452
+ const memoPut = (way0, input, ts, te, h, gid, ctxId, flags) => {
1453
+ let slot = way0;
1454
+ if (memoStr[way0] !== null) {
1455
+ if (memoStr[way0 | 1] === null) slot = way0 | 1;
1456
+ else if ((memoTick++ & 3) === 0) slot = way0 | memoTick >> 2 & 1;
1457
+ else return;
1458
+ }
1459
+ memoStr[slot] = input.slice(ts, te);
1460
+ memoHash[slot] = h;
1461
+ memoGid[slot] = gid;
1462
+ memoCtx[slot] = ctxId;
1463
+ memoFlags[slot] = flags;
1464
+ };
1465
+ const memoReset = () => memoStr.fill(null);
1466
+ let cap = 256;
1467
+ let tokI32 = [
1468
+ new Int32Array(cap),
1469
+ new Int32Array(cap),
1470
+ new Int32Array(cap),
1471
+ new Int32Array(cap)
1472
+ ];
1473
+ let [tokStart, tokEnd, tokGid, tokCtx] = tokI32;
1474
+ let tokFlags = new Uint8Array(cap);
1475
+ let keep = new Uint8Array(cap);
1476
+ const growTokens = () => {
1477
+ cap *= 2;
1478
+ tokI32 = tokI32.map((a) => {
1479
+ const n = new Int32Array(cap);
1480
+ n.set(a);
1481
+ return n;
1482
+ });
1483
+ [tokStart, tokEnd, tokGid, tokCtx] = tokI32;
1484
+ const nf = new Uint8Array(cap);
1485
+ nf.set(tokFlags);
1486
+ tokFlags = nf;
1487
+ keep = new Uint8Array(cap);
1488
+ };
1489
+ let ckptCap = 64;
1490
+ let ckptNode = new Int32Array(ckptCap);
1491
+ let ckptTail = new Int32Array(ckptCap);
1492
+ const claim0 = new Int32Array(GROUP_COUNT);
1493
+ let CLAIM_TABLE = 2048;
1494
+ let claimShift = 21;
1495
+ let claimKeys = new Float64Array(CLAIM_TABLE);
1496
+ let claimEpochs = new Int32Array(CLAIM_TABLE);
1497
+ let epoch = 0;
1498
+ const claimTest = (ctx, gid) => {
1499
+ if (ctx === 0 && gid < GROUP_COUNT) {
1500
+ if (claim0[gid] === epoch) return 1;
1501
+ claim0[gid] = epoch;
1502
+ return 0;
1503
+ }
1504
+ const key = ctx * 2097152 + gid + 1;
1505
+ let idx = Math.imul(key, 2654435761) >>> claimShift;
1506
+ for (;;) {
1507
+ if (claimEpochs[idx] !== epoch) break;
1508
+ if (claimKeys[idx] === key) return 1;
1509
+ idx = idx + 1 & CLAIM_TABLE - 1;
1510
+ }
1511
+ claimKeys[idx] = key;
1512
+ claimEpochs[idx] = epoch;
1513
+ return 0;
1514
+ };
1515
+ const resolveAt = (input, bs, endPos, nodeAt, ckptAt) => {
1516
+ if (endPos - bs >= 2 && input.charCodeAt(bs) === 91 && input.charCodeAt(endPos - 1) === 93) {
1517
+ let colon = -1;
1518
+ for (let p = bs + 1; p < endPos - 1; p++) if (input.charCodeAt(p) === 58) {
1519
+ colon = p;
1520
+ break;
1521
+ }
1522
+ if (colon === -1 || colon === bs + 1) return EXTERNAL;
1523
+ return internSpan(dynByHash, input, bs + 1, colon, 0, newDynId);
1524
+ }
1525
+ if (nodeAt >= 0 && nodeGroup[nodeAt] >= 0) return nodeGroup[nodeAt];
1526
+ for (let k = ckptAt - 1; k >= 0; k--) {
1527
+ const tailStart = ckptTail[k];
1528
+ if (tailStart > endPos) continue;
1529
+ const nodeId = ckptNode[k];
1530
+ const tlen = endPos - tailStart;
1531
+ if (nodeHasLit[nodeId] === 1 && tlen > 0 && tlen <= litMaxLen) {
1532
+ const c0 = input.charCodeAt(tailStart);
1533
+ if (litNoArb === false || c0 !== 91 && c0 !== 40) {
1534
+ const g = litProbe(nodeId, input, tailStart, endPos);
1535
+ if (g >= 0) return g;
1536
+ }
1537
+ }
1538
+ const vl = nodeVlist[nodeId];
1539
+ if (vl < 0) continue;
1540
+ const pat = vlistRef[vl];
1541
+ const vs = vlistPat[pat];
1542
+ const ve = vlistPat[pat + 1];
1543
+ if (vs === ve) continue;
1544
+ analyzeArb(input, tailStart, endPos);
1545
+ const g0 = vgStart[vl] - vs;
1546
+ for (let v = vs; v < ve; v++) if (runValidator(vlistOps[v], input, tailStart, endPos)) return vlistGroup[g0 + v];
1547
+ }
1548
+ return EXTERNAL;
1549
+ };
1550
+ const mergeClassList = (input) => {
1551
+ const n = input.length;
1552
+ let tokenCount = 0;
1553
+ let totalTokenChars = 0;
1554
+ let sawNonSpaceWS = false;
1555
+ if (nextCtxId > MAX_CTX || ctxByHash.size > MAX_CTX) {
1556
+ ctxByHash = /* @__PURE__ */ new Map();
1557
+ ctxByCanon = /* @__PURE__ */ new Map();
1558
+ nextCtxId = 2;
1559
+ memoReset();
1560
+ }
1561
+ if (nextDynId > MAX_DYN) {
1562
+ dynByHash = /* @__PURE__ */ new Map();
1563
+ nextDynId = GROUP_COUNT;
1564
+ memoReset();
1565
+ }
1566
+ let i = 0;
1567
+ while (i < n) {
1568
+ let c = input.charCodeAt(i);
1569
+ if (c === 32 || c >= 9 && c <= 13 || c >= 160 && isUniWS(c)) {
1570
+ if (c !== 32) sawNonSpaceWS = true;
1571
+ i++;
1572
+ continue;
1573
+ }
1574
+ const ts = i;
1575
+ let th = 0;
1576
+ while (i < n) {
1577
+ c = input.charCodeAt(i);
1578
+ if (c <= 32) {
1579
+ if (c === 32) break;
1580
+ if (c >= 9 && c <= 13) {
1581
+ sawNonSpaceWS = true;
1582
+ break;
1583
+ }
1584
+ } else if (c >= 160 && isUniWS(c)) {
1585
+ sawNonSpaceWS = true;
1586
+ break;
1587
+ }
1588
+ th = Math.imul(th ^ c, 16777619);
1589
+ i++;
1590
+ }
1591
+ const te = i;
1592
+ const len = te - ts;
1593
+ if (tokenCount === cap) growTokens();
1594
+ const t = tokenCount++;
1595
+ tokStart[t] = ts;
1596
+ tokEnd[t] = te;
1597
+ totalTokenChars += len;
1598
+ th ^= Math.imul(len, 2654435761);
1599
+ const h = th ^ th >>> 15 | 0;
1600
+ const way0 = h & 8190;
1601
+ {
1602
+ let hitAt = -1;
1603
+ if (memoHash[way0] === h && memoStr[way0] !== null && memoStr[way0].length === len) hitAt = way0;
1604
+ else if (memoHash[way0 | 1] === h && memoStr[way0 | 1] !== null && memoStr[way0 | 1].length === len) hitAt = way0 | 1;
1605
+ if (hitAt >= 0) {
1606
+ const s = memoStr[hitAt];
1607
+ let ok = true;
1608
+ for (let k = 0; k < len; k++) if (s.charCodeAt(k) !== input.charCodeAt(ts + k)) {
1609
+ ok = false;
1610
+ break;
1611
+ }
1612
+ if (ok) {
1613
+ tokGid[t] = memoGid[hitAt];
1614
+ tokCtx[t] = memoCtx[hitAt];
1615
+ tokFlags[t] = memoFlags[hitAt];
1616
+ continue;
1617
+ }
1618
+ }
1619
+ }
1620
+ let pts = ts;
1621
+ if (FPL !== 0) {
1622
+ if (te - ts <= FPL || !input.startsWith(FULL_PREFIX, ts)) {
1623
+ tokGid[t] = EXTERNAL;
1624
+ memoPut(way0, input, ts, te, h, EXTERNAL, 0, 0);
1625
+ continue;
1626
+ }
1627
+ pts = ts + FPL;
1628
+ }
1629
+ let depthB = 0, depthP = 0;
1630
+ let lastColon = -1, lastSlash = -1;
1631
+ for (let p = pts; p < te; p++) {
1632
+ const pc = input.charCodeAt(p);
1633
+ if (depthB === 0 && depthP === 0) {
1634
+ if (pc === 58) {
1635
+ lastColon = p;
1636
+ continue;
1637
+ }
1638
+ if (pc === 47) {
1639
+ lastSlash = p;
1640
+ continue;
1641
+ }
1642
+ }
1643
+ if (pc === 91) depthB++;
1644
+ else if (pc === 93) depthB--;
1645
+ else if (pc === 40) depthP++;
1646
+ else if (pc === 41) depthP--;
1647
+ }
1648
+ const modStart = lastColon >= pts ? lastColon + 1 : pts;
1649
+ let bs = modStart;
1650
+ let be = te;
1651
+ let important = false;
1652
+ let prefixShift = 0;
1653
+ if (be > bs && input.charCodeAt(be - 1) === 33) {
1654
+ important = true;
1655
+ be--;
1656
+ } else if (be > bs && input.charCodeAt(bs) === 33) {
1657
+ important = true;
1658
+ bs++;
1659
+ prefixShift = 1;
1660
+ }
1661
+ let postfixEnd = -1;
1662
+ if (lastSlash > modStart) {
1663
+ postfixEnd = lastSlash + prefixShift;
1664
+ if (postfixEnd >= be) postfixEnd = -1;
1665
+ }
1666
+ let feedStart = bs;
1667
+ if (be - bs > 1 && input.charCodeAt(bs) === 45) feedStart = bs + 1;
1668
+ let node = 0;
1669
+ let lp = 0;
1670
+ let le = 0;
1671
+ let pending = -1;
1672
+ let ckptTop = 0;
1673
+ if (nodeVlist[0] >= 0 || nodeHasLit[0] === 1) {
1674
+ ckptNode[0] = 0;
1675
+ ckptTail[0] = feedStart;
1676
+ ckptTop = 1;
1677
+ }
1678
+ let slashNode = DEAD;
1679
+ let slashCkpt = 0;
1680
+ for (let p = feedStart; p < be; p++) {
1681
+ if (p === postfixEnd) {
1682
+ slashNode = lp < le ? DEAD : node;
1683
+ slashCkpt = ckptTop;
1684
+ }
1685
+ if (node !== DEAD) {
1686
+ const cc = input.charCodeAt(p);
1687
+ let arrived = -1;
1688
+ if (lp < le) {
1689
+ if (labelText.charCodeAt(lp) === cc) {
1690
+ lp++;
1691
+ if (lp === le) arrived = node = pending;
1692
+ } else node = DEAD;
1693
+ } else {
1694
+ const es = edgeStart[node];
1695
+ const ee = edgeStart[node + 1];
1696
+ let next = DEAD;
1697
+ for (let e = es; e < ee; e++) {
1698
+ const ls = labelStart[e];
1699
+ if (labelText.charCodeAt(ls) === cc) {
1700
+ if (labelStart[e + 1] - ls === 1) arrived = next = edgeTarget[e];
1701
+ else {
1702
+ lp = ls + 1;
1703
+ le = labelStart[e + 1];
1704
+ pending = edgeTarget[e];
1705
+ next = node;
1706
+ }
1707
+ break;
1708
+ }
1709
+ }
1710
+ node = next;
1711
+ }
1712
+ if (arrived >= 0 && (nodeVlist[arrived] >= 0 || nodeHasLit[arrived] === 1) && p + 1 < be && input.charCodeAt(p + 1) === 45) {
1713
+ if (ckptTop === ckptCap) {
1714
+ ckptCap *= 2;
1715
+ const nv = new Int32Array(ckptCap);
1716
+ nv.set(ckptNode);
1717
+ ckptNode = nv;
1718
+ const nt = new Int32Array(ckptCap);
1719
+ nt.set(ckptTail);
1720
+ ckptTail = nt;
1721
+ }
1722
+ ckptNode[ckptTop] = arrived;
1723
+ ckptTail[ckptTop] = p + 2;
1724
+ ckptTop++;
1725
+ }
1726
+ }
1727
+ }
1728
+ if (postfixEnd === be) {
1729
+ slashNode = lp < le ? DEAD : node;
1730
+ slashCkpt = ckptTop;
1731
+ }
1732
+ const endNode = lp < le ? DEAD : node;
1733
+ let gid;
1734
+ let hasPostfix = false;
1735
+ if (postfixEnd >= 0) {
1736
+ hasPostfix = true;
1737
+ gid = resolveAt(input, bs, postfixEnd, slashNode, slashCkpt);
1738
+ if (gid !== EXTERNAL && gid < GROUP_COUNT && postfixLookupSet[gid]) {
1739
+ const gidFull = resolveAt(input, bs, be, endNode, ckptTop);
1740
+ if (gidFull !== EXTERNAL && gidFull !== gid) {
1741
+ gid = gidFull;
1742
+ hasPostfix = false;
1743
+ }
1744
+ } else if (gid === EXTERNAL) {
1745
+ gid = resolveAt(input, bs, be, endNode, ckptTop);
1746
+ hasPostfix = false;
1747
+ }
1748
+ } else gid = resolveAt(input, bs, be, endNode, ckptTop);
1749
+ let ctxId = 0;
1750
+ let flags = 0;
1751
+ if (gid === EXTERNAL) tokGid[t] = EXTERNAL;
1752
+ else {
1753
+ flags = hasPostfix ? 1 : 0;
1754
+ ctxId = pts >= lastColon ? important ? 1 : 0 : internSpan(ctxByHash, input, pts, lastColon, important ? 1 : 0, (k) => canonicalizeContext(k, important));
1755
+ tokGid[t] = gid;
1756
+ tokFlags[t] = flags;
1757
+ tokCtx[t] = ctxId;
1758
+ }
1759
+ memoPut(way0, input, ts, te, h, gid, ctxId, flags);
1760
+ }
1761
+ if (tokenCount === 0) return "";
1762
+ if (tokenCount === 1) return tokStart[0] === 0 && tokEnd[0] === n ? input : input.slice(tokStart[0], tokEnd[0]);
1763
+ if (tokenCount * CLAIM_PER_TOKEN > CLAIM_TABLE) {
1764
+ while (tokenCount * CLAIM_PER_TOKEN > CLAIM_TABLE) {
1765
+ CLAIM_TABLE <<= 1;
1766
+ claimShift--;
1767
+ }
1768
+ claimKeys = new Float64Array(CLAIM_TABLE);
1769
+ claimEpochs = new Int32Array(CLAIM_TABLE);
1770
+ }
1771
+ if (nextCtxId >= ID_LIMIT || nextDynId >= ID_LIMIT) throw new Error("cn: too many distinct classes in one merge");
1772
+ epoch = epoch + 1 | 0;
1773
+ if (epoch === 0) {
1774
+ claim0.fill(0);
1775
+ claimEpochs.fill(0);
1776
+ epoch = 1;
1777
+ }
1778
+ let didDrop = false;
1779
+ for (let t = tokenCount - 1; t >= 0; t--) {
1780
+ const gid = tokGid[t];
1781
+ if (gid === EXTERNAL) {
1782
+ keep[t] = 1;
1783
+ continue;
1784
+ }
1785
+ const ctxId = tokCtx[t];
1786
+ if (claimTest(ctxId, gid) === 1) {
1787
+ keep[t] = 0;
1788
+ didDrop = true;
1789
+ continue;
1790
+ }
1791
+ keep[t] = 1;
1792
+ if (gid < GROUP_COUNT) {
1793
+ const r = adjRow[gid];
1794
+ if (r >= 0) for (let k = adjStart[r]; k < adjStart[r + 1]; k++) claimTest(ctxId, adjTgt[k]);
1795
+ if (tokFlags[t] & 1) {
1796
+ for (let k = 0; k < patGid.length; k++) if (patGid[k] === gid) claimTest(ctxId, patTgt[k]);
1797
+ }
1798
+ }
1799
+ }
1800
+ if (!didDrop && !sawNonSpaceWS && n === totalTokenChars + tokenCount - 1) return input;
1801
+ let out = "";
1802
+ let t = 0;
1803
+ while (t < tokenCount) {
1804
+ if (!keep[t]) {
1805
+ t++;
1806
+ continue;
1807
+ }
1808
+ const runStart = tokStart[t];
1809
+ let runEnd = tokEnd[t];
1810
+ let u = t + 1;
1811
+ while (u < tokenCount && keep[u] && tokStart[u] === runEnd + 1 && input.charCodeAt(runEnd) === 32) {
1812
+ runEnd = tokEnd[u];
1813
+ u++;
1814
+ }
1815
+ if (out.length > 0) out += " ";
1816
+ out += input.slice(runStart, runEnd);
1817
+ t = u;
1818
+ }
1819
+ return out;
1820
+ };
1821
+ const DOOR_SIZE = 16384;
1822
+ const door = new Int32Array(DOOR_SIZE * 2);
1823
+ let doorBase = 0;
1824
+ let doorEpoch = 1;
1825
+ let cache = Object.create(null);
1826
+ let prevCache = Object.create(null);
1827
+ let cacheMap = /* @__PURE__ */ new Map();
1828
+ let prevCacheMap = /* @__PURE__ */ new Map();
1829
+ let cacheCount = 0;
1830
+ let doorMarks = 0;
1831
+ const rotateDoor = () => {
1832
+ doorBase ^= DOOR_SIZE;
1833
+ doorEpoch = doorEpoch + 1 | 0;
1834
+ doorMarks = 0;
1835
+ };
1836
+ const mergeCached = (input) => {
1837
+ let merged = cache[input];
1838
+ if (merged !== void 0) return merged;
1839
+ const hash = spanHash(input, 0, input.length);
1840
+ const slot = (hash & 16383) + doorBase;
1841
+ const wasSeen = door[slot] === (hash ^ doorEpoch) || door[slot ^ DOOR_SIZE] === (hash ^ doorEpoch - 1);
1842
+ if (wasSeen) {
1843
+ merged = prevCache[input];
1844
+ if (merged !== void 0) {
1845
+ cache[input] = merged;
1846
+ return merged;
1847
+ }
1848
+ }
1849
+ merged = mergeClassList(input);
1850
+ if (wasSeen) {
1851
+ cache[input] = merged;
1852
+ if (++cacheCount > cacheSize) {
1853
+ cacheCount = 0;
1854
+ prevCache = cache;
1855
+ cache = Object.create(null);
1856
+ rotateDoor();
1857
+ }
1858
+ } else {
1859
+ door[slot] = hash ^ doorEpoch;
1860
+ if (++doorMarks > DOOR_SIZE) rotateDoor();
1861
+ }
1862
+ return merged;
1863
+ };
1864
+ const mergeCachedMap = (input) => {
1865
+ let merged = cacheMap.get(input);
1866
+ if (merged !== void 0) return merged;
1867
+ const hash = spanHash(input, 0, input.length);
1868
+ const slot = (hash & 16383) + doorBase;
1869
+ const wasSeen = door[slot] === (hash ^ doorEpoch) || door[slot ^ DOOR_SIZE] === (hash ^ doorEpoch - 1);
1870
+ if (wasSeen) {
1871
+ merged = prevCacheMap.get(input);
1872
+ if (merged !== void 0) {
1873
+ cacheMap.set(input, merged);
1874
+ return merged;
1875
+ }
1876
+ }
1877
+ merged = mergeClassList(input);
1878
+ if (wasSeen) {
1879
+ cacheMap.set(input, merged);
1880
+ if (++cacheCount > cacheSize) {
1881
+ cacheCount = 0;
1882
+ prevCacheMap = cacheMap;
1883
+ cacheMap = /* @__PURE__ */ new Map();
1884
+ rotateDoor();
1885
+ }
1886
+ } else {
1887
+ door[slot] = hash ^ doorEpoch;
1888
+ if (++doorMarks > DOOR_SIZE) rotateDoor();
1889
+ }
1890
+ return merged;
1891
+ };
1892
+ const seenBefore = (input) => {
1893
+ const hash = spanHash(input, 0, input.length);
1894
+ const slot = (hash & 16383) + doorBase;
1895
+ if (door[slot] === (hash ^ doorEpoch) || door[slot ^ DOOR_SIZE] === (hash ^ doorEpoch - 1)) return true;
1896
+ door[slot] = hash ^ doorEpoch;
1897
+ if (++doorMarks > DOOR_SIZE) rotateDoor();
1898
+ return false;
1899
+ };
1900
+ const mergeString = cacheSize === 0 ? mergeClassList : IS_JSC ? (input) => {
1901
+ const merged = cacheMap.get(input);
1902
+ return merged !== void 0 ? merged : mergeCachedMap(input);
1903
+ } : mergeCached;
1904
+ const merge = function() {
1905
+ return arguments.length === 1 && typeof arguments[0] === "string" ? mergeString(arguments[0]) : mergeString(twJoin.apply(null, arguments));
1906
+ };
1907
+ return {
1908
+ merge,
1909
+ mergeString,
1910
+ seenBefore: cacheSize === 0 ? () => false : seenBefore,
1911
+ mergeUncached: mergeClassList
1912
+ };
1913
+ };
1914
+ const resolveValue = (v, clsxMode) => {
1915
+ if (!v) return "";
1916
+ if (typeof v === "string") return v;
1917
+ let out = "";
1918
+ if (typeof v.length === "number" && (clsxMode ? Array.isArray(v) : true)) {
1919
+ const arr = v;
1920
+ for (let i = 0; i < arr.length; i++) {
1921
+ const item = arr[i];
1922
+ if (!item) continue;
1923
+ const r = typeof item === "string" ? item : resolveValue(item, clsxMode);
1924
+ if (r) {
1925
+ if (out) out += " ";
1926
+ out += r;
1927
+ }
1928
+ }
1929
+ return out;
1930
+ }
1931
+ if (clsxMode) {
1932
+ if (typeof v === "number") return "" + v;
1933
+ if (typeof v === "object") {
1934
+ for (const k in v) if (v[k]) {
1935
+ if (out) out += " ";
1936
+ out += k;
1937
+ }
1938
+ }
1939
+ }
1940
+ return out;
1941
+ };
1942
+ const joinArgs = (args, clsxMode) => {
1943
+ let s = "";
1944
+ for (let i = 0; i < args.length; i++) {
1945
+ const a = args[i];
1946
+ if (!a) continue;
1947
+ const r = typeof a === "string" ? a : resolveValue(a, clsxMode);
1948
+ if (r) {
1949
+ if (s) s += " ";
1950
+ s += r;
1951
+ }
1952
+ }
1953
+ return s;
1954
+ };
1955
+ /** join-only, `twJoin`-compatible (strings + nested arrays, falsy skipped) */
1956
+ const twJoin = function() {
1957
+ return joinArgs(arguments, false);
1958
+ };
1959
+ const BUCKET_CAP = 256;
1960
+ const BUCKET_MISS_CAP = 16;
1961
+ const BUCKET_SKIP = 1024;
1962
+ const CHURN_SIZE = 4096;
1963
+ const wrapClsx = (mergeString, fresh) => {
1964
+ const seenBefore = fresh === void 0 ? () => true : fresh.seenBefore;
1965
+ const mergeUncached = fresh === void 0 ? mergeString : fresh.mergeUncached;
1966
+ let argCache = /* @__PURE__ */ new Map();
1967
+ let prevArgCache = /* @__PURE__ */ new Map();
1968
+ let argCount = 0;
1969
+ let lastHit = null;
1970
+ let churnKey = null;
1971
+ let churnOwn = [];
1972
+ let churnVal = [];
1973
+ let churnTick = 0;
1974
+ const churnLookup = (key, own, join) => {
1975
+ if (churnKey === null) {
1976
+ churnKey = new Array(CHURN_SIZE).fill("");
1977
+ churnOwn = new Array(CHURN_SIZE).fill("");
1978
+ churnVal = new Array(CHURN_SIZE).fill("");
1979
+ }
1980
+ const way0 = spanHash(key, 0, key.length) & 4094;
1981
+ if (churnKey[way0] === key && churnOwn[way0] === own) return churnVal[way0];
1982
+ if (churnKey[way0 | 1] === key && churnOwn[way0 | 1] === own) return churnVal[way0 | 1];
1983
+ const merged = mergeString(join ? own + " " + key : key);
1984
+ const slot = churnKey[way0] === "" ? way0 : way0 | (churnKey[way0 | 1] === "" ? 1 : churnTick++ & 1);
1985
+ churnKey[slot] = key;
1986
+ churnOwn[slot] = own;
1987
+ churnVal[slot] = merged;
1988
+ return merged;
1989
+ };
1990
+ const match3 = (e, v0, v1, v2) => {
1991
+ let k = 0;
1992
+ if (v0) {
1993
+ if (v0 !== e.a0) return false;
1994
+ k = 1;
1995
+ }
1996
+ if (v1) {
1997
+ if (v1 !== (k === 0 ? e.a0 : e.a1)) return false;
1998
+ k++;
1999
+ }
2000
+ if (v2) {
2001
+ if (v2 !== (k === 0 ? e.a0 : k === 1 ? e.a1 : e.a2)) return false;
2002
+ k++;
2003
+ }
2004
+ return k === e.t;
2005
+ };
2006
+ const matchN = (e, vals) => {
2007
+ const ea = e.a;
2008
+ let k = 0;
2009
+ for (let i = 0; i < vals.length; i++) {
2010
+ const v = vals[i];
2011
+ if (!v) continue;
2012
+ if (v !== ea[k]) return false;
2013
+ k++;
2014
+ }
2015
+ return k === e.t;
2016
+ };
2017
+ const resolveArgs = (vals, probed) => {
2018
+ const nArgs = vals.length;
2019
+ const pred = lastHit === null ? null : lastHit.n;
2020
+ if (!probed) {
2021
+ if (pred !== null && matchN(pred, vals)) {
2022
+ lastHit = pred;
2023
+ return pred.r;
2024
+ }
2025
+ if (lastHit !== null && lastHit !== pred && matchN(lastHit, vals)) return lastHit.r;
2026
+ }
2027
+ let first = "";
2028
+ let firstIdx = -1;
2029
+ let truthy = 0;
2030
+ let hasResolvedValue = false;
2031
+ for (let i = 0; i < nArgs; i++) {
2032
+ let v = vals[i];
2033
+ if (!v) continue;
2034
+ if (typeof v !== "string") {
2035
+ v = vals[i] = resolveValue(v, true);
2036
+ if (!v) continue;
2037
+ hasResolvedValue = true;
2038
+ }
2039
+ if (firstIdx < 0) {
2040
+ first = v;
2041
+ firstIdx = i;
2042
+ }
2043
+ truthy++;
2044
+ }
2045
+ if (truthy === 0) return "";
2046
+ if (truthy === 1) return mergeString(first);
2047
+ if (hasResolvedValue) {
2048
+ if (pred !== null && matchN(pred, vals)) {
2049
+ lastHit = pred;
2050
+ return pred.r;
2051
+ }
2052
+ if (lastHit !== null && lastHit !== pred && matchN(lastHit, vals)) return lastHit.r;
2053
+ }
2054
+ let bucket = argCache.get(first);
2055
+ if (bucket === void 0) {
2056
+ bucket = prevArgCache.get(first);
2057
+ if (bucket !== void 0) argCache.set(first, bucket);
2058
+ }
2059
+ let hit = null;
2060
+ if (bucket !== void 0) {
2061
+ if (bucket.skip > 0) {
2062
+ bucket.skip--;
2063
+ lastHit = null;
2064
+ let joined = first;
2065
+ for (let i = firstIdx + 1; i < nArgs; i++) {
2066
+ const v = vals[i];
2067
+ if (v) joined += " " + v;
2068
+ }
2069
+ return churnLookup(joined, "", false);
2070
+ }
2071
+ const entries = bucket.e;
2072
+ outer: for (let b = 0; b < entries.length; b++) {
2073
+ const e = entries[b];
2074
+ if (e.t !== truthy) continue;
2075
+ const ea = e.a;
2076
+ let k = 1;
2077
+ for (let i = firstIdx + 1; i < nArgs; i++) {
2078
+ const v = vals[i];
2079
+ if (v && v !== ea[k++]) continue outer;
2080
+ }
2081
+ hit = e;
2082
+ break;
2083
+ }
2084
+ if (hit !== null) bucket.miss = 0;
2085
+ }
2086
+ if (hit === null) {
2087
+ let joined = first;
2088
+ const a = [first];
2089
+ for (let i = firstIdx + 1; i < nArgs; i++) {
2090
+ const v = vals[i];
2091
+ if (!v) continue;
2092
+ joined += " " + v;
2093
+ a.push(v);
2094
+ }
2095
+ if (!seenBefore(joined)) return mergeUncached(joined);
2096
+ hit = {
2097
+ r: mergeString(joined),
2098
+ t: a.length,
2099
+ a0: a[0],
2100
+ a1: a[1],
2101
+ a2: a[2] ?? "",
2102
+ a,
2103
+ n: null
2104
+ };
2105
+ if (bucket === void 0) argCache.set(first, bucket = {
2106
+ e: [],
2107
+ miss: 0,
2108
+ skip: 0,
2109
+ at: 0
2110
+ });
2111
+ else if (++bucket.miss > BUCKET_MISS_CAP) {
2112
+ bucket.miss = BUCKET_MISS_CAP;
2113
+ bucket.skip = BUCKET_SKIP;
2114
+ bucket.e.length = 0;
2115
+ bucket.at = 0;
2116
+ }
2117
+ const entries = bucket.e;
2118
+ if (entries.length < BUCKET_CAP) entries.push(hit);
2119
+ else {
2120
+ entries[bucket.at] = hit;
2121
+ bucket.at = bucket.at + 1 & 255;
2122
+ }
2123
+ if (++argCount > 1e3) {
2124
+ argCount = 0;
2125
+ prevArgCache = argCache;
2126
+ argCache = /* @__PURE__ */ new Map();
2127
+ }
2128
+ }
2129
+ if (lastHit !== null && lastHit !== hit) lastHit.n = hit;
2130
+ lastHit = hit;
2131
+ return hit.r;
2132
+ };
2133
+ const mergeSingleValue = (value) => Array.isArray(value) ? resolveArgs(value.slice(), false) : mergeString(resolveValue(value, true));
2134
+ return function(v0, v1, v2) {
2135
+ const nArgs = arguments.length;
2136
+ if ((nArgs | 1) === 3) {
2137
+ const lh = lastHit;
2138
+ if (lh !== null) {
2139
+ const pred = lh.n;
2140
+ if (pred !== null && match3(pred, v0, v1, v2)) {
2141
+ lastHit = pred;
2142
+ return pred.r;
2143
+ }
2144
+ if (lh !== pred && match3(lh, v0, v1, v2)) return lh.r;
2145
+ }
2146
+ if (nArgs === 2 && typeof v1 === "string" && v1 !== "") {
2147
+ const bucket = argCache.get(v0);
2148
+ if (bucket !== void 0 && bucket.skip > 0) {
2149
+ bucket.skip--;
2150
+ lastHit = null;
2151
+ return churnLookup(v1, v0, true);
2152
+ }
2153
+ }
2154
+ return resolveArgs([
2155
+ v0,
2156
+ v1,
2157
+ v2
2158
+ ], true);
2159
+ }
2160
+ if (nArgs === 1) return typeof v0 === "string" ? mergeString(v0) : mergeSingleValue(v0);
2161
+ const lh = lastHit;
2162
+ if (lh !== null) {
2163
+ const pred = lh.n;
2164
+ if (pred !== null) {
2165
+ const pa = pred.a;
2166
+ let k = 0;
2167
+ let ok = true;
2168
+ for (let i = 0; i < nArgs; i++) {
2169
+ const v = arguments[i];
2170
+ if (!v) continue;
2171
+ if (v !== pa[k]) {
2172
+ ok = false;
2173
+ break;
2174
+ }
2175
+ k++;
2176
+ }
2177
+ if (ok && k === pred.t) {
2178
+ lastHit = pred;
2179
+ return pred.r;
2180
+ }
2181
+ }
2182
+ if (lh !== pred) {
2183
+ const la = lh.a;
2184
+ let k = 0;
2185
+ let ok = true;
2186
+ for (let i = 0; i < nArgs; i++) {
2187
+ const v = arguments[i];
2188
+ if (!v) continue;
2189
+ if (v !== la[k]) {
2190
+ ok = false;
2191
+ break;
2192
+ }
2193
+ k++;
2194
+ }
2195
+ if (ok && k === lh.t) return lh.r;
2196
+ }
2197
+ }
2198
+ const vals = [];
2199
+ for (let i = 0; i < nArgs; i++) vals.push(arguments[i]);
2200
+ return resolveArgs(vals, true);
2201
+ };
2202
+ };
2203
+
2204
+ //#region src/index.ts
2205
+ const instance = /* @__PURE__ */ createEngine(tables_generated_default);
2206
+ /**
2207
+ * Merge Tailwind CSS classes with clsx-style arguments (strings, arrays,
2208
+ * objects, conditionals). Drop-in replacement for `twMerge(clsx(...))`.
2209
+ */
2210
+ const cn = /* @__PURE__ */ wrapClsx(instance.mergeString, instance);
2211
+
2212
+ const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
2213
+ variants: {
2214
+ variant: {
2215
+ default: 'bg-primary text-primary-foreground hover:bg-primary/80',
2216
+ outline: 'border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50',
2217
+ secondary: 'bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',
2218
+ ghost: 'hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50',
2219
+ destructive: 'bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40',
2220
+ link: 'text-primary underline-offset-4 hover:underline',
2221
+ },
2222
+ size: {
2223
+ default: 'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
2224
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
2225
+ sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
2226
+ lg: 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
2227
+ icon: 'size-8',
2228
+ 'icon-xs': "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
2229
+ 'icon-sm': 'size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg',
2230
+ 'icon-lg': 'size-9',
2231
+ },
2232
+ },
2233
+ defaultVariants: {
2234
+ variant: 'default',
2235
+ size: 'default',
2236
+ },
2237
+ });
2238
+ function Button({ className, variant = 'default', size = 'default', ...props }) {
2239
+ return (jsxRuntimeExports.jsx(Button$1, { "data-slot": "button", className: typeof className === 'function'
2240
+ ? (state) => cn(buttonVariants({ variant, size }), className(state))
2241
+ : cn(buttonVariants({ variant, size }), className), ...props }));
2242
+ }
2243
+
2244
+ /**
2245
+ * Present when the field is disabled.
2246
+ */
2247
+ /**
2248
+ * Present when the field is in a valid state.
2249
+ */
2250
+ const valid = 'data-valid';
2251
+ /**
2252
+ * Present when the field is in an invalid state.
2253
+ */
2254
+ const invalid = 'data-invalid';
2255
+
2256
+ const DEFAULT_VALIDITY_STATE = {
2257
+ badInput: false,
2258
+ customError: false,
2259
+ patternMismatch: false,
2260
+ rangeOverflow: false,
2261
+ rangeUnderflow: false,
2262
+ stepMismatch: false,
2263
+ tooLong: false,
2264
+ tooShort: false,
2265
+ typeMismatch: false,
2266
+ valid: null,
2267
+ valueMissing: false
2268
+ };
2269
+ const DEFAULT_FIELD_STATE_ATTRIBUTES = {
2270
+ valid: null,
2271
+ touched: false,
2272
+ dirty: false,
2273
+ filled: false,
2274
+ focused: false
2275
+ };
2276
+ const DEFAULT_FIELD_ROOT_STATE = {
2277
+ disabled: false,
2278
+ ...DEFAULT_FIELD_STATE_ATTRIBUTES
2279
+ };
2280
+ const fieldValidityMapping = {
2281
+ valid(value) {
2282
+ if (value === null) {
2283
+ return null;
2284
+ }
2285
+ if (value) {
2286
+ return {
2287
+ [valid]: ''
2288
+ };
2289
+ }
2290
+ return {
2291
+ [invalid]: ''
2292
+ };
2293
+ }
2294
+ };
2295
+
2296
+ const DEFAULT_FIELD_ROOT_CONTEXT = {
2297
+ invalid: undefined,
2298
+ name: undefined,
2299
+ validityData: {
2300
+ state: DEFAULT_VALIDITY_STATE,
2301
+ errors: [],
2302
+ error: '',
2303
+ value: '',
2304
+ initialValue: null
2305
+ },
2306
+ setValidityData: NOOP,
2307
+ disabled: undefined,
2308
+ setTouched: NOOP,
2309
+ setDirty: NOOP,
2310
+ setFilled: NOOP,
2311
+ setFocused: NOOP,
2312
+ focusOwnerRef: {
2313
+ current: undefined
2314
+ },
2315
+ validationMode: 'onSubmit',
2316
+ shouldValidateOnChange: () => false,
2317
+ state: DEFAULT_FIELD_ROOT_STATE,
2318
+ registerFieldControl: NOOP,
2319
+ validation: {
2320
+ getValidationProps: (_disabled, props = EMPTY_OBJECT) => props,
2321
+ inputRef: {
2322
+ current: null
2323
+ },
2324
+ registeredInputs: new Map(),
2325
+ registerInput: NOOP,
2326
+ getInputControl: () => null,
2327
+ commit: async () => {},
2328
+ change: NOOP
2329
+ }
2330
+ };
2331
+ const FieldRootContext = /*#__PURE__*/React__namespace.createContext(DEFAULT_FIELD_ROOT_CONTEXT);
2332
+ function useFieldRootContext(optional = true) {
2333
+ const context = React__namespace.useContext(FieldRootContext);
2334
+ if (context.setValidityData === NOOP && !optional) {
2335
+ throw new Error(formatErrorMessage(28));
2336
+ }
2337
+ return context;
2338
+ }
2339
+
2340
+ const FormContext = /*#__PURE__*/React__namespace.createContext({
2341
+ elementRef: {
2342
+ current: null
2343
+ },
2344
+ formRef: {
2345
+ current: {
2346
+ fields: new Map()
2347
+ }
2348
+ },
2349
+ errors: {},
2350
+ clearErrors: NOOP,
2351
+ validationMode: 'onSubmit',
2352
+ submitCountRef: {
2353
+ current: 0
2354
+ }
2355
+ });
2356
+ function useFormContext() {
2357
+ return React__namespace.useContext(FormContext);
2358
+ }
2359
+
2360
+ /**
2361
+ * Returns a function that forces a rerender.
2362
+ */
2363
+ function useForcedRerendering() {
2364
+ const [, setState] = React__namespace.useState({});
2365
+ return React__namespace.useCallback(() => {
2366
+ setState({});
2367
+ }, []);
2368
+ }
2369
+
2370
+ let globalId = 0;
2371
+
2372
+ // TODO React 17: Remove `useGlobalId` once React 17 support is removed
2373
+ function useGlobalId(idOverride, prefix = 'mui') {
2374
+ const defaultId = React__namespace.useRef(undefined);
2375
+ const forceRerender = useForcedRerendering();
2376
+ const id = idOverride ?? defaultId.current;
2377
+ React__namespace.useEffect(() => {
2378
+ if (defaultId.current == null) {
2379
+ // Fallback to this default id when possible.
2380
+ // Use the incrementing value for client-side rendering only.
2381
+ // We can't use it server-side.
2382
+ // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem
2383
+ globalId += 1;
2384
+ defaultId.current = `${prefix}-${globalId}`;
2385
+ // Generate the fallback even while `idOverride` is set.
2386
+ // Removing the override then swaps in the existing id within the same commit.
2387
+ // Deferring generation would leave one commit with no id, breaking `htmlFor` and `aria-labelledby` links.
2388
+ // Only rerender when the fallback is the value being rendered.
2389
+ {
2390
+ forceRerender();
2391
+ }
2392
+ }
2393
+ }, [idOverride, prefix, forceRerender]);
2394
+ return id;
2395
+ }
2396
+ const maybeReactUseId = SafeReact.useId;
2397
+
2398
+ /**
2399
+ *
2400
+ * @example <div id={useId()} />
2401
+ * @param {string | undefined} idOverride overrides the generated id when provided
2402
+ * @param {string | undefined} prefix prefixes the generated id when provided
2403
+ * @returns {string | undefined}
2404
+ */
2405
+ function useId(idOverride, prefix) {
2406
+ // React.useId() is only available from React 18.0.0.
2407
+ if (maybeReactUseId !== undefined) {
2408
+ const reactId = maybeReactUseId();
2409
+ return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);
2410
+ }
2411
+
2412
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
2413
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.
2414
+ return useGlobalId(idOverride, prefix);
2415
+ }
2416
+
2417
+ /**
2418
+ * Wraps `useId` and prefixes generated `id`s with `base-ui-`
2419
+ * @param {string | undefined} idOverride overrides the generated id when provided
2420
+ * @returns {string | undefined}
2421
+ */
2422
+ function useBaseUiId(idOverride) {
2423
+ return useId(idOverride, 'base-ui');
2424
+ }
2425
+
2426
+ /**
2427
+ * A context for providing [labelable elements](https://html.spec.whatwg.org/multipage/forms.html#category-label)\
2428
+ * with an accessible name (label) and description.
2429
+ */
2430
+ const LabelableContext = /*#__PURE__*/React__namespace.createContext({
2431
+ controlId: undefined,
2432
+ registerControlId: NOOP,
2433
+ resetControlId: NOOP,
2434
+ labelId: undefined,
2435
+ setLabelId: NOOP,
2436
+ messageIds: [],
2437
+ setMessageIds: NOOP,
2438
+ getDescriptionProps: externalProps => externalProps
2439
+ });
2440
+ function useLabelableContext() {
2441
+ return React__namespace.useContext(LabelableContext);
2442
+ }
2443
+
2444
+ function useLabelableId(params = {}) {
2445
+ const {
2446
+ id,
2447
+ enabled = true
2448
+ } = params;
2449
+ const {
2450
+ controlId,
2451
+ registerControlId,
2452
+ resetControlId
2453
+ } = useLabelableContext();
2454
+
2455
+ // Deliberately not seeded with `id`: on React 17 the seed would stick around after the
2456
+ // `id` prop is removed, leaving the control on a stale id forever.
2457
+ const defaultId = useBaseUiId();
2458
+ const controlSourceRef = useRefWithInit(() => Symbol());
2459
+ const hasRegisteredRef = React__namespace.useRef(false);
2460
+ const hadExplicitIdRef = React__namespace.useRef(false);
2461
+ const unregisterControlId = useStableCallback(() => {
2462
+ if (!hasRegisteredRef.current || registerControlId === NOOP) {
2463
+ return;
2464
+ }
2465
+ hasRegisteredRef.current = false;
2466
+ registerControlId(controlSourceRef.current, undefined);
2467
+ });
2468
+ useIsoLayoutEffect(() => {
2469
+ if (!enabled || registerControlId === NOOP) {
2470
+ unregisterControlId();
2471
+ return undefined;
2472
+ }
2473
+ let nextId;
2474
+ if (id !== undefined) {
2475
+ hadExplicitIdRef.current = true;
2476
+ nextId = id;
2477
+ } else if (hadExplicitIdRef.current) {
2478
+ nextId = defaultId;
2479
+ } else {
2480
+ // An id-less replacement must claim the provider's fallback so a previously registered
2481
+ // explicit id is not retained after its control unmounts.
2482
+ resetControlId();
2483
+ return undefined;
2484
+ }
2485
+
2486
+ // Either the control never had an explicit `id`, or React 17 has not assigned the
2487
+ // fallback id yet. Neither is worth registering.
2488
+ if (nextId === undefined) {
2489
+ unregisterControlId();
2490
+ return undefined;
2491
+ }
2492
+ hasRegisteredRef.current = true;
2493
+ registerControlId(controlSourceRef.current, nextId);
2494
+ return undefined;
2495
+ }, [id, enabled, registerControlId, resetControlId, defaultId, controlSourceRef, unregisterControlId]);
2496
+
2497
+ // Unregistering in the layout phase, not a passive effect: a replacement control's layout
2498
+ // effect would otherwise run first and still see the outgoing control's registration.
2499
+ useIsoLayoutEffect(() => {
2500
+ return unregisterControlId;
2501
+ }, [unregisterControlId]);
2502
+
2503
+ // The provider's id wins until registration runs: the label renders `htmlFor` from the
2504
+ // provider's pre-registration state, so preempting it with an explicit `id` here would
2505
+ // leave the pair unassociated in server-rendered markup.
2506
+ return (enabled ? controlId : undefined) ?? id ?? defaultId;
2507
+ }
2508
+
2509
+ /**
2510
+ * A React.useEffect equivalent that runs once, when the component is mounted.
2511
+ */
2512
+ function useOnMount(fn) {
2513
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- no need to put `fn` in the dependency array
2514
+ /* eslint-disable react-hooks/exhaustive-deps */
2515
+ React__namespace.useEffect(fn, EMPTY_ARRAY);
2516
+ /* eslint-enable react-hooks/exhaustive-deps */
2517
+ }
2518
+
2519
+ const EMPTY = 0;
2520
+ class Timeout {
2521
+ static create() {
2522
+ return new Timeout();
2523
+ }
2524
+ currentId = EMPTY;
2525
+
2526
+ /**
2527
+ * Executes `fn` after `delay`, clearing any previously scheduled call.
2528
+ */
2529
+ start(delay, fn) {
2530
+ this.clear();
2531
+ this.currentId = setTimeout(() => {
2532
+ this.currentId = EMPTY;
2533
+ fn();
2534
+ }, delay); /* Node.js types are enabled in development */
2535
+ }
2536
+ isStarted() {
2537
+ return this.currentId !== EMPTY;
2538
+ }
2539
+ clear = () => {
2540
+ if (this.currentId !== EMPTY) {
2541
+ clearTimeout(this.currentId);
2542
+ this.currentId = EMPTY;
2543
+ }
2544
+ };
2545
+ disposeEffect = () => {
2546
+ return this.clear;
2547
+ };
2548
+ }
2549
+
2550
+ /**
2551
+ * A `setTimeout` with automatic cleanup and guard.
2552
+ */
2553
+ function useTimeout() {
2554
+ const timeout = useRefWithInit(Timeout.create).current;
2555
+ useOnMount(timeout.disposeEffect);
2556
+ return timeout;
2557
+ }
2558
+
2559
+ /**
2560
+ * Returns the field's `setFocused`, recording which control the focused state belongs to.
2561
+ *
2562
+ * Disabling or unmounting a focused control moves focus away without firing `blur`, so the focused
2563
+ * state would otherwise stay latched. A field can have several focus targets, so a control only
2564
+ * clears the shared state when focus last landed on itself. The stable callback doubles as that
2565
+ * identity.
2566
+ */
2567
+ function useSetFieldFocused(disabled, focusTargetRef, onFocusedChange) {
2568
+ const {
2569
+ setFocused,
2570
+ focusOwnerRef
2571
+ } = useFieldRootContext();
2572
+ const setFieldFocused = useStableCallback(focused => {
2573
+ // A disabled target can still be focused (`aria-disabled` elements stay programmatically
2574
+ // focusable), but must not publish the field's focused styling.
2575
+ if (focused ? !disabled : focusOwnerRef.current === setFieldFocused) {
2576
+ focusOwnerRef.current = focused && setFieldFocused;
2577
+ setFocused(focused);
2578
+ }
2579
+ });
2580
+
2581
+ // Re-run when `disabled` changes so a focused control releases the field even when the browser
2582
+ // does not fire `blur`. The setup reclaims focus that no focus event reported: StrictMode
2583
+ // re-running effects after a mount-time focus, a control focused before hydration, or an
2584
+ // `aria-disabled` control re-enabled while it kept focus.
2585
+ useIsoLayoutEffect(() => {
2586
+ const el = focusTargetRef.current;
2587
+ const root = el?.getRootNode();
2588
+ if (root?.activeElement === el) {
2589
+ setFieldFocused(true);
2590
+ }
2591
+ return () => setFieldFocused(false);
2592
+ }, [disabled, focusTargetRef, setFieldFocused]);
2593
+ return setFieldFocused;
2594
+ }
2595
+
2596
+ function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true, name) {
2597
+ const {
2598
+ registerFieldControl
2599
+ } = useFieldRootContext();
2600
+ const sourceRef = useRefWithInit(() => Symbol());
2601
+
2602
+ // Re-register without unregistering first: re-registration with the same id updates the
2603
+ // form's fields Map entry in place, while a delete + re-add would move the field to the
2604
+ // end of the Map every time its value changes.
2605
+ useIsoLayoutEffect(() => {
2606
+ const source = sourceRef.current;
2607
+ if (!enabled) {
2608
+ registerFieldControl(source, undefined);
2609
+ return;
2610
+ }
2611
+ const registration = {
2612
+ controlRef,
2613
+ getValue: getFormValueOverride,
2614
+ id,
2615
+ name,
2616
+ value
2617
+ };
2618
+ registerFieldControl(source, registration);
2619
+ }, [controlRef, enabled, getFormValueOverride, id, name, registerFieldControl, sourceRef, value]);
2620
+ useIsoLayoutEffect(() => {
2621
+ const source = sourceRef.current;
2622
+ return () => {
2623
+ registerFieldControl(source, undefined);
2624
+ };
2625
+ }, [registerFieldControl, sourceRef]);
2626
+ }
2627
+
2628
+ function useValueChanged(value, onChange) {
2629
+ const valueRef = React__namespace.useRef(value);
2630
+ const onChangeCallback = useStableCallback(onChange);
2631
+ useIsoLayoutEffect(() => {
2632
+ if (valueRef.current !== value) {
2633
+ onChangeCallback(valueRef.current);
2634
+ }
2635
+ valueRef.current = value;
2636
+ }, [value, onChangeCallback]);
2637
+ }
2638
+
2639
+ /**
2640
+ * Maps a change `reason` string to the corresponding native event type.
2641
+ */
2642
+
2643
+ /**
2644
+ * Details of custom change events emitted by Base UI components.
2645
+ */
2646
+
2647
+ /**
2648
+ * Details of custom generic events emitted by Base UI components.
2649
+ */
2650
+
2651
+ /** Highlight navigation uses mouse events for hover and pointer events for leaving an item. */
2652
+
2653
+ /**
2654
+ * Creates a Base UI event details object with the given reason and utilities
2655
+ * for preventing Base UI's internal event handling.
2656
+ */
2657
+ function createChangeEventDetails(reason, event, trigger, customProperties) {
2658
+ let canceled = false;
2659
+ let allowPropagation = false;
2660
+ const custom = EMPTY_OBJECT;
2661
+ const details = {
2662
+ reason,
2663
+ event: event ?? new Event('base-ui'),
2664
+ cancel() {
2665
+ canceled = true;
2666
+ },
2667
+ allowPropagation() {
2668
+ allowPropagation = true;
2669
+ },
2670
+ get isCanceled() {
2671
+ return canceled;
2672
+ },
2673
+ get isPropagationAllowed() {
2674
+ return allowPropagation;
2675
+ },
2676
+ trigger,
2677
+ ...custom
2678
+ };
2679
+ return details;
2680
+ }
2681
+
2682
+ const none = 'none';
2683
+
2684
+ /**
2685
+ * The form control to label and validate.
2686
+ * Renders an `<input>` element.
2687
+ *
2688
+ * You can omit this part and use any Base UI input component instead. For example,
2689
+ * [Input](https://base-ui.com/react/components/input), [Checkbox](https://base-ui.com/react/components/checkbox),
2690
+ * or [Select](https://base-ui.com/react/components/select), among others, will work with Field out of the box.
2691
+ *
2692
+ * Documentation: [Base UI Field](https://base-ui.com/react/components/field)
2693
+ */
2694
+ const FieldControl = /*#__PURE__*/React__namespace.forwardRef(function FieldControl(componentProps, forwardedRef) {
2695
+ const {
2696
+ render,
2697
+ className,
2698
+ id: idProp,
2699
+ name: nameProp,
2700
+ value,
2701
+ disabled: disabledProp = false,
2702
+ onValueChange,
2703
+ defaultValue,
2704
+ autoFocus = false,
2705
+ style,
2706
+ ...elementProps
2707
+ } = componentProps;
2708
+ const {
2709
+ state: fieldState,
2710
+ name: fieldName,
2711
+ disabled: fieldDisabled,
2712
+ setTouched,
2713
+ setDirty,
2714
+ validityData,
2715
+ setFilled,
2716
+ validationMode,
2717
+ validation
2718
+ } = useFieldRootContext();
2719
+ const {
2720
+ clearErrors,
2721
+ elementRef: formElementRef,
2722
+ submitCountRef
2723
+ } = useFormContext();
2724
+ const disabled = fieldDisabled || disabledProp;
2725
+ const name = fieldName ?? nameProp;
2726
+ const state = {
2727
+ ...fieldState,
2728
+ disabled
2729
+ };
2730
+ const {
2731
+ labelId
2732
+ } = useLabelableContext();
2733
+ const id = useLabelableId({
2734
+ id: idProp
2735
+ });
2736
+ const isControlled = value !== undefined;
2737
+ // The DOM value is always a string, so dirty comparisons must serialize the controlled value.
2738
+ const serializedValue = value == null ? undefined : String(value);
2739
+ const getValueFromInput = useStableCallback(() => validation.inputRef.current?.value);
2740
+ useRegisterFieldControl(validation.inputRef, id, serializedValue, getValueFromInput, !disabled, nameProp);
2741
+ useIsoLayoutEffect(() => {
2742
+ const currentValue = serializedValue ?? validation.inputRef.current?.value;
2743
+ if (currentValue !== undefined) {
2744
+ setFilled(currentValue !== '');
2745
+ }
2746
+ }, [serializedValue, defaultValue, validation.inputRef, setFilled]);
2747
+ useValueChanged(serializedValue, () => {
2748
+ if (serializedValue === undefined) {
2749
+ return;
2750
+ }
2751
+ clearErrors(name);
2752
+ setDirty(serializedValue !== (validityData.initialValue ?? ''));
2753
+ validation.change(serializedValue);
2754
+ });
2755
+ const inputRef = React__namespace.useRef(null);
2756
+ const setFocused = useSetFieldFocused(disabled, inputRef);
2757
+ const enterValidationTimeout = useTimeout();
2758
+ const element = useRenderElement('input', componentProps, {
2759
+ ref: [forwardedRef, inputRef],
2760
+ state,
2761
+ props: [{
2762
+ id,
2763
+ disabled,
2764
+ name,
2765
+ ref: validation.inputRef,
2766
+ 'aria-labelledby': labelId,
2767
+ autoFocus,
2768
+ ...(isControlled ? {
2769
+ value
2770
+ } : {
2771
+ defaultValue
2772
+ }),
2773
+ onChange(event) {
2774
+ const inputValue = event.currentTarget.value;
2775
+ const details = createChangeEventDetails(none, event.nativeEvent);
2776
+ onValueChange?.(inputValue, details);
2777
+
2778
+ // Controlled values sync from the `value` prop instead, so that a value the consumer
2779
+ // rejects or rewrites never reaches the field state.
2780
+ if (isControlled) {
2781
+ return;
2782
+ }
2783
+
2784
+ // `validation.change` reads `markedDirtyRef`, so update dirty before validating.
2785
+ setDirty(inputValue !== (validityData.initialValue ?? ''));
2786
+ setFilled(inputValue !== '');
2787
+
2788
+ // Workaround for https://github.com/react/react/issues/9023
2789
+ if (!event.nativeEvent.defaultPrevented && !details.isCanceled) {
2790
+ clearErrors(name);
2791
+ validation.change(inputValue);
2792
+ }
2793
+ },
2794
+ onFocus() {
2795
+ setFocused(true);
2796
+ },
2797
+ onBlur(event) {
2798
+ setTouched(true);
2799
+ setFocused(false);
2800
+ if (validationMode === 'onBlur') {
2801
+ const inputValue = event.currentTarget.value;
2802
+ validation.commit(inputValue);
2803
+ if (isControlled) {
2804
+ // Controlled blur handlers can normalize the value before this microtask runs.
2805
+ // A rewrite back to the initial value is a programmatic reset: the field looks
2806
+ // pristine, so committing it would only surface `valueMissing` noise.
2807
+ queueMicrotask(() => {
2808
+ const nextValue = validation.inputRef.current?.value;
2809
+ if (nextValue !== undefined && nextValue !== inputValue && nextValue !== (validityData.initialValue ?? '')) {
2810
+ validation.commit(nextValue);
2811
+ }
2812
+ });
2813
+ }
2814
+ }
2815
+ },
2816
+ onKeyDown(event) {
2817
+ if (event.currentTarget.tagName === 'INPUT' && event.key === 'Enter') {
2818
+ setTouched(true);
2819
+ const value = event.currentTarget.value;
2820
+ const form = event.currentTarget.form;
2821
+ if (form && form === formElementRef.current && !event.defaultPrevented) {
2822
+ const input = event.currentTarget;
2823
+ const submitCount = submitCountRef.current;
2824
+
2825
+ // Implicit submission runs after keydown. Fall back unless Form handles it first.
2826
+ enterValidationTimeout.start(0, () => {
2827
+ if (submitCountRef.current === submitCount) {
2828
+ validation.commit(input.value);
2829
+ }
2830
+ });
2831
+ } else {
2832
+ validation.commit(value);
2833
+ }
2834
+ }
2835
+ }
2836
+ }, elementProps, props => validation.getValidationProps(disabled, props)],
2837
+ stateAttributesMapping: fieldValidityMapping
2838
+ });
2839
+ return element;
2840
+ });
2841
+
2842
+ /**
2843
+ * A native input element that automatically works with [Field](https://base-ui.com/react/components/field).
2844
+ * Renders an `<input>` element.
2845
+ *
2846
+ * Documentation: [Base UI Input](https://base-ui.com/react/components/input)
2847
+ */
2848
+ const Input$1 = /*#__PURE__*/React__namespace.forwardRef(function Input(props, forwardedRef) {
2849
+ return /*#__PURE__*/jsxRuntimeExports.jsx(FieldControl, {
2850
+ ref: forwardedRef,
2851
+ ...props
2852
+ });
2853
+ });
2854
+
2855
+ function Input({ className, type, ...props }) {
2856
+ return (jsxRuntimeExports.jsx(Input$1, { type: type, "data-slot": "input", className: cn("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className), ...props }));
2857
+ }
2858
+
2859
+ /**
2860
+ * @license lucide-react v1.70.0 - ISC
2861
+ *
2862
+ * This source code is licensed under the ISC license.
2863
+ * See the LICENSE file in the root directory of this source tree.
2864
+ */
2865
+
2866
+ const toKebabCase = (string) => string?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
2867
+
2868
+ /**
2869
+ * @license lucide-react v1.70.0 - ISC
2870
+ *
2871
+ * This source code is licensed under the ISC license.
2872
+ * See the LICENSE file in the root directory of this source tree.
2873
+ */
2874
+
2875
+
2876
+ function toLucideIconData(iconName, iconNode, aliases = []) {
2877
+ if (iconNode == null) {
2878
+ throw new Error("[lucide]: iconNode is required when icon name is used");
2879
+ }
2880
+ return {
2881
+ name: toKebabCase(iconName),
2882
+ size: 24,
2883
+ node: iconNode,
2884
+ ...aliases.length > 0 ? { aliases } : {}
2885
+ };
2886
+ }
2887
+
2888
+ /**
2889
+ * @license lucide-react v1.70.0 - ISC
2890
+ *
2891
+ * This source code is licensed under the ISC license.
2892
+ * See the LICENSE file in the root directory of this source tree.
2893
+ */
2894
+
2895
+ const toCamelCase = (string) => {
2896
+ let out = "";
2897
+ let upperNext = false;
2898
+ for (const ch of string) {
2899
+ if (ch === "-" || ch === "_" || ch <= " ") {
2900
+ upperNext = out.length > 0;
2901
+ continue;
2902
+ }
2903
+ if (out.length === 0) {
2904
+ out += ch.toLowerCase();
2905
+ } else {
2906
+ out += upperNext ? ch.toUpperCase() : ch;
2907
+ }
2908
+ upperNext = false;
2909
+ }
2910
+ return out;
2911
+ };
2912
+
2913
+ /**
2914
+ * @license lucide-react v1.70.0 - ISC
2915
+ *
2916
+ * This source code is licensed under the ISC license.
2917
+ * See the LICENSE file in the root directory of this source tree.
2918
+ */
2919
+
2920
+
2921
+ const toPascalCase = (string) => {
2922
+ const camelCase = toCamelCase(string);
2923
+ return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
2924
+ };
2925
+
2926
+ /**
2927
+ * @license lucide-react v1.70.0 - ISC
2928
+ *
2929
+ * This source code is licensed under the ISC license.
2930
+ * See the LICENSE file in the root directory of this source tree.
2931
+ */
2932
+
2933
+ const mergeClasses = (...classes) => classes.filter((className, index, array) => {
2934
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
2935
+ }).join(" ").trim();
2936
+
2937
+ /**
2938
+ * @license lucide-react v1.70.0 - ISC
2939
+ *
2940
+ * This source code is licensed under the ISC license.
2941
+ * See the LICENSE file in the root directory of this source tree.
2942
+ */
2943
+
2944
+ const defaultAttributes = {
2945
+ xmlns: "http://www.w3.org/2000/svg",
2946
+ width: 24,
2947
+ height: 24,
2948
+ viewBox: "0 0 24 24",
2949
+ fill: "none",
2950
+ stroke: "currentColor",
2951
+ "stroke-width": 2,
2952
+ "stroke-linecap": "round",
2953
+ "stroke-linejoin": "round"
2954
+ };
2955
+
2956
+ /**
2957
+ * @license lucide-react v1.70.0 - ISC
2958
+ *
2959
+ * This source code is licensed under the ISC license.
2960
+ * See the LICENSE file in the root directory of this source tree.
2961
+ */
2962
+
2963
+
2964
+ function isDefined(value) {
2965
+ return value !== null && value !== void 0;
2966
+ }
2967
+ function buildLucideIconNode(icon, params = {}) {
2968
+ const attributeNames = params.attributeNames ?? {};
2969
+ const getAttributeName = (attributeName) => attributeNames[attributeName] ?? attributeName;
2970
+ const viewBoxWidth = icon.size ?? icon.width ?? defaultAttributes["width"];
2971
+ const viewBoxHeight = icon.size ?? icon.height ?? defaultAttributes["height"];
2972
+ const aliasClassNames = icon.aliases?.filter((alias) => typeof alias === "string" && alias.trim() !== "").map((alias) => `lucide-${alias}`) ?? [];
2973
+ const iconClassNames = [...icon.name ? [`lucide-${icon.name}`] : [], ...aliasClassNames];
2974
+ const classNamesFromClassName = params.className?.split(" ").filter(Boolean) ?? [];
2975
+ const className = params.includeDefaultClasses === false ? mergeClasses(...classNamesFromClassName) : mergeClasses("lucide", ...iconClassNames, ...classNamesFromClassName);
2976
+ const calculatedStrokeWidth = params.absoluteStrokeWidth ? Number(params.strokeWidth ?? defaultAttributes["stroke-width"]) * Number(icon.size ?? icon.width ?? defaultAttributes["width"]) / Number(params.size ?? params.width ?? defaultAttributes["width"]) : params.strokeWidth ?? defaultAttributes["stroke-width"];
2977
+ const attributes = {
2978
+ ...Object.entries(defaultAttributes).reduce((attrs, [attrName, value]) => {
2979
+ attrs[getAttributeName(attrName)] = value;
2980
+ return attrs;
2981
+ }, {}),
2982
+ ..."color" in params && params.color && {
2983
+ [getAttributeName("stroke")]: params.color
2984
+ },
2985
+ ..."size" in params && isDefined(params.size) && {
2986
+ [getAttributeName("width")]: params.size,
2987
+ [getAttributeName("height")]: params.size
2988
+ },
2989
+ ..."width" in params && isDefined(params.width) && {
2990
+ [getAttributeName("width")]: params.width
2991
+ },
2992
+ ..."height" in params && isDefined(params.height) && {
2993
+ [getAttributeName("height")]: params.height
2994
+ },
2995
+ [getAttributeName("stroke-width")]: calculatedStrokeWidth,
2996
+ ...className && {
2997
+ [getAttributeName("class")]: className
2998
+ },
2999
+ [getAttributeName("viewBox")]: `0 0 ${viewBoxWidth} ${viewBoxHeight}`,
3000
+ ...params.hasA11yProp === false ? {
3001
+ [getAttributeName("aria-hidden")]: "true"
3002
+ } : {},
3003
+ ..."attributes" in params && params.attributes
3004
+ };
3005
+ return [
3006
+ "svg",
3007
+ attributes,
3008
+ icon.node.map((child) => {
3009
+ const [name, attrs, children] = child;
3010
+ const nextAttrs = params.nonScalingStroke ? { [getAttributeName("vector-effect")]: "non-scaling-stroke", ...attrs } : attrs;
3011
+ return children ? [name, nextAttrs, children] : [name, nextAttrs];
3012
+ })
3013
+ ];
3014
+ }
3015
+
3016
+ /**
3017
+ * @license lucide-react v1.70.0 - ISC
3018
+ *
3019
+ * This source code is licensed under the ISC license.
3020
+ * See the LICENSE file in the root directory of this source tree.
3021
+ */
3022
+
3023
+
3024
+ function buildLucideIconForReact(icon, params = {}) {
3025
+ return buildLucideIconNode(icon, {
3026
+ ...params,
3027
+ attributeNames: {
3028
+ ...params.attributeNames,
3029
+ class: "className",
3030
+ "stroke-width": "strokeWidth",
3031
+ "stroke-linecap": "strokeLinecap",
3032
+ "stroke-linejoin": "strokeLinejoin",
3033
+ "vector-effect": "vectorEffect"
3034
+ }
3035
+ });
3036
+ }
3037
+
3038
+ /**
3039
+ * @license lucide-react v1.70.0 - ISC
3040
+ *
3041
+ * This source code is licensed under the ISC license.
3042
+ * See the LICENSE file in the root directory of this source tree.
3043
+ */
3044
+
3045
+ const hasA11yProp = (props) => {
3046
+ for (const prop in props) {
3047
+ if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
3048
+ return true;
3049
+ }
3050
+ }
3051
+ return false;
3052
+ };
3053
+
3054
+ const LucideContext = React.createContext({});
3055
+ const useLucideContext = () => React.useContext(LucideContext);
3056
+
3057
+ const Icon = React.forwardRef(
3058
+ ({
3059
+ color,
3060
+ size,
3061
+ width,
3062
+ height,
3063
+ strokeWidth,
3064
+ absoluteStrokeWidth,
3065
+ nonScalingStroke,
3066
+ className = "",
3067
+ children,
3068
+ iconNode = [],
3069
+ icon = {
3070
+ node: iconNode,
3071
+ aliases: [],
3072
+ size: 24
3073
+ },
3074
+ ...rest
3075
+ }, ref) => {
3076
+ const {
3077
+ size: contextSize = 24,
3078
+ strokeWidth: contextStrokeWidth = 2,
3079
+ absoluteStrokeWidth: contextAbsoluteStrokeWidth = false,
3080
+ nonScalingStroke: contextNonScalingStroke = false,
3081
+ color: contextColor = "currentColor",
3082
+ className: contextClass = ""
3083
+ } = useLucideContext() ?? {};
3084
+ const hasAccessibleProp = Boolean(children) || hasA11yProp(rest);
3085
+ const [name, svgAttributes, builtIconNode = []] = buildLucideIconForReact(icon, {
3086
+ color: color ?? contextColor,
3087
+ width: width ?? size ?? contextSize,
3088
+ height: height ?? size ?? contextSize,
3089
+ strokeWidth: strokeWidth ?? contextStrokeWidth,
3090
+ absoluteStrokeWidth: absoluteStrokeWidth ?? contextAbsoluteStrokeWidth,
3091
+ nonScalingStroke: nonScalingStroke ?? contextNonScalingStroke,
3092
+ className: mergeClasses(contextClass, className),
3093
+ hasA11yProp: hasAccessibleProp,
3094
+ attributes: rest
3095
+ });
3096
+ return React.createElement(
3097
+ name,
3098
+ {
3099
+ ref,
3100
+ ...svgAttributes
3101
+ },
3102
+ [
3103
+ ...builtIconNode.map(([tag, attrs]) => React.createElement(tag, attrs)),
3104
+ ...Array.isArray(children) ? children : [children]
3105
+ ]
3106
+ );
3107
+ }
3108
+ );
3109
+
3110
+ /**
3111
+ * @license lucide-react v1.70.0 - ISC
3112
+ *
3113
+ * This source code is licensed under the ISC license.
3114
+ * See the LICENSE file in the root directory of this source tree.
3115
+ */
3116
+
3117
+
3118
+ function createLucideIcon(iconDataOrName, iconNode = [], aliases = []) {
3119
+ const iconData = typeof iconDataOrName === "string" ? toLucideIconData(iconDataOrName, iconNode, aliases) : iconDataOrName;
3120
+ const Component = React.forwardRef(
3121
+ ({ className, ...props }, ref) => React.createElement(Icon, {
3122
+ ref,
3123
+ icon: iconData,
3124
+ className,
3125
+ ...props
3126
+ })
3127
+ );
3128
+ if (iconData.name) {
3129
+ Component.displayName = toPascalCase(iconData.name);
3130
+ }
3131
+ return Component;
3132
+ }
3133
+
3134
+ /**
3135
+ * @license lucide-react v1.70.0 - ISC
3136
+ *
3137
+ * This source code is licensed under the ISC license.
3138
+ * See the LICENSE file in the root directory of this source tree.
3139
+ */
3140
+
3141
+
3142
+ const __iconData$1 = {
3143
+ name: "moon",
3144
+ size: 24,
3145
+ node: [
3146
+ [
3147
+ "path",
3148
+ {
3149
+ d: "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",
3150
+ key: "kfwtm"
3151
+ }
3152
+ ]
3153
+ ]
3154
+ };
3155
+ __iconData$1.node;
3156
+ const Moon = createLucideIcon(__iconData$1);
3157
+
3158
+ /**
3159
+ * @license lucide-react v1.70.0 - ISC
3160
+ *
3161
+ * This source code is licensed under the ISC license.
3162
+ * See the LICENSE file in the root directory of this source tree.
3163
+ */
3164
+
3165
+
3166
+ const __iconData = {
3167
+ name: "sun",
3168
+ size: 24,
3169
+ node: [
3170
+ ["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
3171
+ ["path", { d: "M12 2v2", key: "tus03m" }],
3172
+ ["path", { d: "M12 20v2", key: "1lh1kg" }],
3173
+ ["path", { d: "m4.93 4.93 1.41 1.41", key: "149t6j" }],
3174
+ ["path", { d: "m17.66 17.66 1.41 1.41", key: "ptbguv" }],
3175
+ ["path", { d: "M2 12h2", key: "1t8f8n" }],
3176
+ ["path", { d: "M20 12h2", key: "1q8mjw" }],
3177
+ ["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
3178
+ ["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
3179
+ ]
3180
+ };
3181
+ __iconData.node;
3182
+ const Sun = createLucideIcon(__iconData);
3183
+
3184
+ // 水合完成与否由 React 的服务端快照机制区分,无需 effect 中同步设置状态。
3185
+ const subscribe = () => () => { };
3186
+ const getSnapshot = () => true;
3187
+ const getServerSnapshot = () => false;
3188
+ /** 服务端及客户端水合首帧返回 false,之后返回 true;纯客户端渲染直接返回 true。 */
3189
+ function useHydrated() {
3190
+ return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
3191
+ }
3192
+
3193
+ const COLOR_SCHEME_QUERY = '(prefers-color-scheme: dark)';
3194
+ const ThemeProviderContext = React.createContext(undefined);
3195
+ // 校验存储值,同时将类型收窄为合法的主题选项。
3196
+ function isTheme(value) {
3197
+ return value === 'dark' || value === 'light' || value === 'system';
3198
+ }
3199
+ // 优先读取已保存的主题;值无效或存储不可用时使用默认主题。
3200
+ function readTheme(storageKey, fallback) {
3201
+ try {
3202
+ const value = localStorage.getItem(storageKey);
3203
+ return isTheme(value) ? value : fallback;
3204
+ }
3205
+ catch {
3206
+ // 存储不可用时回退到默认主题,不影响组件初始化。
3207
+ return fallback;
3208
+ }
3209
+ }
3210
+ // 持久化用户选择,存储失败时仍允许更新页面主题。
3211
+ function persistTheme(storageKey, theme) {
3212
+ try {
3213
+ localStorage.setItem(storageKey, theme);
3214
+ }
3215
+ catch {
3216
+ // 忽略存储异常,主题仍可在当前页面内切换。
3217
+ }
3218
+ }
3219
+ // 将用户选择解析为实际配色;system 每次读取当前系统偏好。
3220
+ function resolveTheme(theme) {
3221
+ if (theme !== 'system') {
3222
+ return theme;
3223
+ }
3224
+ return window.matchMedia(COLOR_SCHEME_QUERY).matches ? 'dark' : 'light';
3225
+ }
3226
+ // 更新根元素的主题类名,并返回清理临时样式及动画帧的函数。
3227
+ function applyTheme(theme, disableTransitionOnChange) {
3228
+ const root = document.documentElement;
3229
+ const resolvedTheme = resolveTheme(theme);
3230
+ // 主题已生效且没有冲突类名时,跳过重复的 DOM 操作。
3231
+ if (root.classList.contains(resolvedTheme) && !root.classList.contains(resolvedTheme === 'dark' ? 'light' : 'dark')) {
3232
+ return () => { };
3233
+ }
3234
+ const style = disableTransitionOnChange ? document.createElement('style') : null;
3235
+ if (style) {
3236
+ style.textContent = '*,*::before,*::after{transition:none!important}';
3237
+ document.head.appendChild(style);
3238
+ // 强制浏览器计算样式,确保禁用过渡的规则先于主题切换生效。
3239
+ window.getComputedStyle(root).getPropertyValue('transition-property');
3240
+ }
3241
+ root.classList.remove('light', 'dark');
3242
+ root.classList.add(resolvedTheme);
3243
+ if (!style) {
3244
+ return () => { };
3245
+ }
3246
+ // 在禁用过渡期间计算新主题样式,再通过两次动画帧延迟移除规则。
3247
+ window.getComputedStyle(root).getPropertyValue('color');
3248
+ let frame = requestAnimationFrame(() => {
3249
+ frame = requestAnimationFrame(() => style.remove());
3250
+ });
3251
+ // 重新应用主题或卸载时,取消待执行的帧并移除临时样式。
3252
+ return () => {
3253
+ cancelAnimationFrame(frame);
3254
+ style.remove();
3255
+ };
3256
+ }
3257
+ // 判断事件是否来自可编辑区域,避免主题快捷键干扰输入。
3258
+ function isEditableTarget(target) {
3259
+ if (!(target instanceof HTMLElement)) {
3260
+ return false;
3261
+ }
3262
+ if (target.isContentEditable) {
3263
+ return true;
3264
+ }
3265
+ return target.closest('input, textarea, select') !== null;
3266
+ }
3267
+ // 统一管理主题状态、页面样式及系统和跨标签页同步。
3268
+ function ThemeProvider({ children, defaultTheme = 'system', storageKey = 'bad-ui:theme', disableTransitionOnChange = true, keyboardShortcut, }) {
3269
+ const hydrated = useHydrated();
3270
+ const [storedTheme, setThemeState] = React.useState(() => readTheme(storageKey, defaultTheme));
3271
+ // 水合首帧与服务端一致,完成后才使用浏览器保存的主题。
3272
+ const theme = hydrated ? storedTheme : defaultTheme;
3273
+ // 所有主动切换共用此入口,统一更新存储和 React 状态。
3274
+ const setTheme = React.useCallback((nextTheme) => {
3275
+ persistTheme(storageKey, nextTheme);
3276
+ setThemeState(nextTheme);
3277
+ }, [storageKey]);
3278
+ // 按需解析系统配色,按钮和快捷键共用同一切换逻辑。
3279
+ const toggleTheme = React.useCallback(() => {
3280
+ setTheme(resolveTheme(theme) === 'dark' ? 'light' : 'dark');
3281
+ }, [theme, setTheme]);
3282
+ // 水合完成后应用主题;服务端与水合首帧不访问系统配色或修改根元素。
3283
+ React.useLayoutEffect(() => {
3284
+ if (!hydrated)
3285
+ return;
3286
+ let cleanup = applyTheme(theme, disableTransitionOnChange);
3287
+ const mediaQuery = window.matchMedia(COLOR_SCHEME_QUERY);
3288
+ const handleChange = () => {
3289
+ cleanup();
3290
+ cleanup = applyTheme(theme, disableTransitionOnChange);
3291
+ };
3292
+ // 仅跟随系统时订阅配色变化;显式选择深浅色后不再跟随。
3293
+ if (theme === 'system') {
3294
+ mediaQuery.addEventListener('change', handleChange);
3295
+ }
3296
+ return () => {
3297
+ mediaQuery.removeEventListener('change', handleChange);
3298
+ cleanup();
3299
+ };
3300
+ }, [theme, disableTransitionOnChange, hydrated]);
3301
+ React.useEffect(() => {
3302
+ if (!hydrated || !keyboardShortcut)
3303
+ return;
3304
+ const shortcutKey = keyboardShortcut.toLowerCase();
3305
+ // 忽略已处理事件、输入法组合和长按重复。
3306
+ const handleKeyDown = (event) => {
3307
+ if (event.defaultPrevented || event.isComposing || event.repeat) {
3308
+ return;
3309
+ }
3310
+ if (event.metaKey || event.ctrlKey || event.altKey) {
3311
+ return;
3312
+ }
3313
+ if (isEditableTarget(event.target)) {
3314
+ return;
3315
+ }
3316
+ if (event.key.toLowerCase() !== shortcutKey) {
3317
+ return;
3318
+ }
3319
+ toggleTheme();
3320
+ };
3321
+ window.addEventListener('keydown', handleKeyDown);
3322
+ return () => {
3323
+ window.removeEventListener('keydown', handleKeyDown);
3324
+ };
3325
+ }, [toggleTheme, hydrated, keyboardShortcut]);
3326
+ React.useEffect(() => {
3327
+ // storage 事件用于接收同源其他标签页的主题变更。
3328
+ const handleStorageChange = (event) => {
3329
+ if (event.storageArea !== localStorage) {
3330
+ return;
3331
+ }
3332
+ // clear() 触发的事件 key 为 null,也需要回退到默认主题。
3333
+ if (event.key !== null && event.key !== storageKey) {
3334
+ return;
3335
+ }
3336
+ if (isTheme(event.newValue)) {
3337
+ setThemeState(event.newValue);
3338
+ return;
3339
+ }
3340
+ // 存储项被移除、清空或写入无效值时,恢复默认主题。
3341
+ setThemeState(defaultTheme);
3342
+ };
3343
+ window.addEventListener('storage', handleStorageChange);
3344
+ return () => {
3345
+ window.removeEventListener('storage', handleStorageChange);
3346
+ };
3347
+ }, [defaultTheme, storageKey]);
3348
+ // 保持上下文值的引用稳定,避免父组件重渲染引起无关更新。
3349
+ const value = React.useMemo(() => ({
3350
+ theme,
3351
+ setTheme,
3352
+ toggleTheme,
3353
+ }), [theme, setTheme, toggleTheme]);
3354
+ return jsxRuntimeExports.jsx(ThemeProviderContext.Provider, { value: value, children: children });
3355
+ }
3356
+ // 获取主题上下文,并在缺少 Provider 时给出明确错误。
3357
+ const useTheme = () => {
3358
+ const context = React.useContext(ThemeProviderContext);
3359
+ if (context === undefined) {
3360
+ throw new Error('useTheme must be used within a ThemeProvider');
3361
+ }
3362
+ return context;
3363
+ };
3364
+
3365
+ function ThemeToggle({ darkLabel = '切换到深色主题', lightLabel = '切换到浅色主题', variant = 'outline', size = 'icon', title = '切换主题', onClick, ...props }) {
3366
+ const { toggleTheme } = useTheme();
3367
+ return (jsxRuntimeExports.jsxs(Button, { type: "button", variant: variant, size: size, title: title, ...props, onClick: (event) => {
3368
+ // 先执行使用方回调,允许通过 preventDefault() 取消主题切换。
3369
+ onClick?.(event);
3370
+ if (!event.defaultPrevented)
3371
+ toggleTheme();
3372
+ }, children: [jsxRuntimeExports.jsx(Moon, { "data-icon": "inline-start", "aria-hidden": "true", className: "animate-in duration-200 ease-out zoom-in-75 fade-in spin-in-90 motion-reduce:animate-none dark:hidden" }), jsxRuntimeExports.jsx(Sun, { "data-icon": "inline-start", "aria-hidden": "true", className: "hidden animate-in duration-200 ease-out zoom-in-75 fade-in spin-in-90 motion-reduce:animate-none dark:block" }), jsxRuntimeExports.jsx("span", { className: "sr-only dark:hidden", children: darkLabel }), jsxRuntimeExports.jsx("span", { className: "sr-only hidden dark:block", children: lightLabel })] }));
3373
+ }
3374
+
3375
+ // color 用于选项色块预览:基础色取浅色模式的 muted-foreground,主题色取 primary。
3376
+ const BASE_COLORS = [
3377
+ { value: 'neutral', label: 'Neutral', color: 'oklch(0.556 0 0)' },
3378
+ { value: 'mist', label: 'Mist', color: 'oklch(0.56 0.021 213.5)' },
3379
+ { value: 'zinc', label: 'Zinc', color: 'oklch(0.552 0.016 285.938)' },
3380
+ ];
3381
+ // value 对应 CSS 的 data-theme 属性,label 用于展示,color 是固定的预览色。
3382
+ const COLOR_THEMES = [
3383
+ { value: 'neutral', label: 'Neutral', color: 'oklch(0.205 0 0)' },
3384
+ { value: 'blue', label: 'Blue', color: 'oklch(0.488 0.243 264.376)' },
3385
+ { value: 'green', label: 'Green', color: 'oklch(0.527 0.154 150.069)' },
3386
+ { value: 'orange', label: 'Orange', color: 'oklch(0.553 0.195 38.402)' },
3387
+ { value: 'pink', label: 'Pink', color: 'oklch(0.525 0.223 3.958)' },
3388
+ { value: 'purple', label: 'Purple', color: 'oklch(0.496 0.265 301.924)' },
3389
+ { value: 'red', label: 'Red', color: 'oklch(0.505 0.213 27.518)' },
3390
+ { value: 'rose', label: 'Rose', color: 'oklch(0.514 0.222 16.935)' },
3391
+ { value: 'sky', label: 'Sky', color: 'oklch(0.5 0.134 242.749)' },
3392
+ { value: 'yellow', label: 'Yellow', color: 'oklch(0.852 0.199 91.936)' },
3393
+ ];
3394
+ // 圆角预设的 value 单位为 rem,可直接传给 setRadius,也可用于 borderRadius 预览。
3395
+ const RADIUS_OPTIONS = [
3396
+ { value: 0, label: '0' },
3397
+ { value: 0.25, label: '0.25' },
3398
+ { value: 0.5, label: '0.5' },
3399
+ { value: 0.625, label: 'Default' },
3400
+ { value: 0.75, label: '0.75' },
3401
+ { value: 1, label: '1' },
3402
+ ];
3403
+ const DEFAULT_PREFERENCE = {
3404
+ baseColor: 'neutral',
3405
+ theme: 'neutral',
3406
+ radius: 0.625,
3407
+ };
3408
+
3409
+ const PreferenceContext = React.createContext(undefined);
3410
+ // 校验选项标识,并将 unknown 收窄为对应的字符串联合类型。
3411
+ function isOption(options, value) {
3412
+ return options.some((option) => option.value === value);
3413
+ }
3414
+ // 存储内容不可信:逐项校验,单个字段无效时不影响其他有效偏好。
3415
+ function normalizePreference(value, fallback) {
3416
+ const candidate = typeof value === 'object' && value !== null ? value : {};
3417
+ return {
3418
+ baseColor: isOption(BASE_COLORS, candidate.baseColor) ? candidate.baseColor : fallback.baseColor,
3419
+ theme: isOption(COLOR_THEMES, candidate.theme) ? candidate.theme : fallback.theme,
3420
+ // 预设用于展示,不限制自定义圆角;只接受有限的非负数。
3421
+ radius: typeof candidate.radius === 'number' && Number.isFinite(candidate.radius) && candidate.radius >= 0
3422
+ ? candidate.radius
3423
+ : fallback.radius,
3424
+ };
3425
+ }
3426
+ // 解析并校验存储字符串;没有记录或 JSON 损坏时回退到默认值。
3427
+ function parsePreference(value, fallback) {
3428
+ try {
3429
+ return normalizePreference(value === null ? null : JSON.parse(value), fallback);
3430
+ }
3431
+ catch {
3432
+ return fallback;
3433
+ }
3434
+ }
3435
+ // 将存储访问与 JSON 解析分开处理,兼容浏览器禁止存储的情况。
3436
+ function readPreference(storageKey, fallback) {
3437
+ try {
3438
+ return parsePreference(localStorage.getItem(storageKey), fallback);
3439
+ }
3440
+ catch {
3441
+ // 存储不可用时,偏好仍可在当前页面内使用。
3442
+ return fallback;
3443
+ }
3444
+ }
3445
+ // 比较字段值,避免相同偏好触发重复渲染。
3446
+ function isSamePreference(current, next) {
3447
+ return current.baseColor === next.baseColor && current.theme === next.theme && current.radius === next.radius;
3448
+ }
3449
+ // 管理基础色、主题配色和圆角;深浅模式继续由 ThemeProvider 管理。
3450
+ function PreferenceProvider({ children, defaultPreference, storageKey = 'bad-ui:preference', }) {
3451
+ // 先补齐并校验调用方传入的默认值,再作为存储读取和重置时的回退值。
3452
+ const { baseColor, theme, radius } = normalizePreference(defaultPreference, DEFAULT_PREFERENCE);
3453
+ const defaults = React.useMemo(() => ({ baseColor, theme, radius }), [baseColor, theme, radius]);
3454
+ const hydrated = useHydrated();
3455
+ const [storedPreference, setPreference] = React.useState(() => readPreference(storageKey, defaults));
3456
+ // 保存最新偏好,保证同一批次连续修改不同字段时保留先前修改。
3457
+ const preferenceRef = React.useRef(storedPreference);
3458
+ // 服务端及客户端水合首帧使用相同默认值,水合后才向子组件公开本地偏好。
3459
+ const preference = hydrated ? storedPreference : defaults;
3460
+ // 主动修改时才写入存储;跨标签页同步仅更新内存,避免删除后又写回默认值。
3461
+ const updatePreference = React.useCallback((patch) => {
3462
+ const current = preferenceRef.current;
3463
+ const next = normalizePreference({ ...current, ...patch }, current);
3464
+ if (isSamePreference(current, next))
3465
+ return;
3466
+ preferenceRef.current = next;
3467
+ setPreference(next);
3468
+ try {
3469
+ localStorage.setItem(storageKey, JSON.stringify(next));
3470
+ }
3471
+ catch {
3472
+ // 写入失败不阻断页面偏好更新。
3473
+ }
3474
+ }, [storageKey]);
3475
+ const setBaseColor = React.useCallback((nextBaseColor) => {
3476
+ updatePreference({ baseColor: nextBaseColor });
3477
+ }, [updatePreference]);
3478
+ // 此处 theme 是配色方案(如 blue),并非 light / dark / system。
3479
+ const setTheme = React.useCallback((nextTheme) => {
3480
+ updatePreference({ theme: nextTheme });
3481
+ }, [updatePreference]);
3482
+ // 圆角以 rem 保存,转换为 CSS 长度的工作由下方 effect 统一完成。
3483
+ const setRadius = React.useCallback((nextRadius) => {
3484
+ updatePreference({ radius: nextRadius });
3485
+ }, [updatePreference]);
3486
+ // 配色通过独立属性组合;圆角以内联变量覆盖主题默认值,不改动深浅模式类名。
3487
+ React.useLayoutEffect(() => {
3488
+ if (!hydrated)
3489
+ return;
3490
+ const root = document.documentElement;
3491
+ // 在浏览器绘制前更新属性,分别匹配 base-color 和 themes 中的选择器。
3492
+ root.dataset.baseColor = preference.baseColor;
3493
+ root.dataset.theme = preference.theme;
3494
+ root.style.setProperty('--radius', `${preference.radius}rem`);
3495
+ }, [preference, hydrated]);
3496
+ React.useEffect(() => {
3497
+ // 接收其他标签页的变更;删除或清空存储时恢复默认偏好。
3498
+ function handleStorageChange(event) {
3499
+ // 只处理 localStorage 中当前键的变化;clear() 的事件 key 为 null。
3500
+ if (event.storageArea !== localStorage || (event.key !== null && event.key !== storageKey)) {
3501
+ return;
3502
+ }
3503
+ const next = parsePreference(event.newValue, defaults);
3504
+ if (isSamePreference(preferenceRef.current, next))
3505
+ return;
3506
+ preferenceRef.current = next;
3507
+ setPreference(next);
3508
+ }
3509
+ window.addEventListener('storage', handleStorageChange);
3510
+ // 卸载或依赖变化时注销监听,避免重复订阅。
3511
+ return () => window.removeEventListener('storage', handleStorageChange);
3512
+ }, [defaults, storageKey]);
3513
+ // 保持 Context 值的引用稳定,避免父组件重渲染引起无关的订阅更新。
3514
+ const value = React.useMemo(() => ({ ...preference, setBaseColor, setTheme, setRadius }), [preference, setBaseColor, setTheme, setRadius]);
3515
+ return jsxRuntimeExports.jsx(PreferenceContext.Provider, { value: value, children: children });
3516
+ }
3517
+ // 统一读取偏好上下文,在缺少 Provider 时给出明确的使用错误。
3518
+ function usePreference() {
3519
+ const context = React.useContext(PreferenceContext);
3520
+ if (context === undefined) {
3521
+ throw new Error('usePreference must be used within a PreferenceProvider');
3522
+ }
3523
+ return context;
3524
+ }
3525
+
3526
+ exports.BASE_COLORS = BASE_COLORS;
3527
+ exports.Button = Button;
3528
+ exports.COLOR_THEMES = COLOR_THEMES;
3529
+ exports.DEFAULT_PREFERENCE = DEFAULT_PREFERENCE;
3530
+ exports.Input = Input;
3531
+ exports.PreferenceProvider = PreferenceProvider;
3532
+ exports.RADIUS_OPTIONS = RADIUS_OPTIONS;
3533
+ exports.ThemeProvider = ThemeProvider;
3534
+ exports.ThemeToggle = ThemeToggle;
3535
+ exports.buttonVariants = buttonVariants;
3536
+ exports.cn = cn;
3537
+ exports.useHydrated = useHydrated;
3538
+ exports.usePreference = usePreference;
3539
+ exports.useTheme = useTheme;
3540
+
3541
+ }));