@puckeditor/plugin-auth 0.9.0-canary.179ef636

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.
package/dist/index.mjs ADDED
@@ -0,0 +1,4857 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __esm = (fn, res) => function __init() {
8
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
9
+ };
10
+ var __commonJS = (cb, mod) => function __require() {
11
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+
30
+ // ../tsup-config/react-import.js
31
+ import React from "react";
32
+ var init_react_import = __esm({
33
+ "../tsup-config/react-import.js"() {
34
+ "use strict";
35
+ }
36
+ });
37
+
38
+ // ../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js
39
+ var require_classnames = __commonJS({
40
+ "../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js"(exports, module) {
41
+ "use strict";
42
+ init_react_import();
43
+ (function() {
44
+ "use strict";
45
+ var hasOwn = {}.hasOwnProperty;
46
+ function classNames() {
47
+ var classes = "";
48
+ for (var i = 0; i < arguments.length; i++) {
49
+ var arg = arguments[i];
50
+ if (arg) {
51
+ classes = appendClass(classes, parseValue(arg));
52
+ }
53
+ }
54
+ return classes;
55
+ }
56
+ function parseValue(arg) {
57
+ if (typeof arg === "string" || typeof arg === "number") {
58
+ return arg;
59
+ }
60
+ if (typeof arg !== "object") {
61
+ return "";
62
+ }
63
+ if (Array.isArray(arg)) {
64
+ return classNames.apply(null, arg);
65
+ }
66
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
67
+ return arg.toString();
68
+ }
69
+ var classes = "";
70
+ for (var key in arg) {
71
+ if (hasOwn.call(arg, key) && arg[key]) {
72
+ classes = appendClass(classes, key);
73
+ }
74
+ }
75
+ return classes;
76
+ }
77
+ function appendClass(value, newClass) {
78
+ if (!newClass) {
79
+ return value;
80
+ }
81
+ if (value) {
82
+ return value + " " + newClass;
83
+ }
84
+ return value + newClass;
85
+ }
86
+ if (typeof module !== "undefined" && module.exports) {
87
+ classNames.default = classNames;
88
+ module.exports = classNames;
89
+ } else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
90
+ define("classnames", [], function() {
91
+ return classNames;
92
+ });
93
+ } else {
94
+ window.classNames = classNames;
95
+ }
96
+ })();
97
+ }
98
+ });
99
+
100
+ // index.ts
101
+ init_react_import();
102
+
103
+ // src/index.tsx
104
+ init_react_import();
105
+
106
+ // ../platform-client/lib/header-actions.ts
107
+ init_react_import();
108
+ import {
109
+ cloneElement,
110
+ isValidElement
111
+ } from "react";
112
+ var HEADER_ACTIONS = Symbol.for("@puckeditor/header-actions");
113
+ var markHeaderActions = (Component) => Object.assign(Component, { [HEADER_ACTIONS]: true });
114
+
115
+ // src/components/SessionMenu/index.tsx
116
+ init_react_import();
117
+
118
+ // ../platform-client/components/Menu/index.tsx
119
+ init_react_import();
120
+ import { useState as useState14 } from "react";
121
+
122
+ // css-module:/home/runner/work/platform/platform/packages/platform-client/components/Menu/styles.module.css#css-module
123
+ init_react_import();
124
+ var styles_module_default = { "Menu": "_Menu_1jr57_1", "Menu-content": "_Menu-content_1jr57_6", "Menu-sections": "_Menu-sections_1jr57_11", "Menu-action": "_Menu-action_1jr57_22", "Menu-list": "_Menu-list_1jr57_44", "Menu-item": "_Menu-item_1jr57_55", "Menu-item--disabled": "_Menu-item--disabled_1jr57_84" };
125
+
126
+ // ../platform-client/lib/get-class-name-factory.ts
127
+ init_react_import();
128
+ var import_classnames = __toESM(require_classnames());
129
+ var getClassNameFactory = (rootClass, styles, { baseClass = "" } = {}) => (options = {}) => {
130
+ let descendant = false;
131
+ let modifiers = false;
132
+ if (typeof options === "string") {
133
+ descendant = options;
134
+ } else if (typeof options === "object") {
135
+ modifiers = options;
136
+ }
137
+ if (descendant) {
138
+ const style = styles[`${rootClass}-${descendant}`];
139
+ if (style) {
140
+ return baseClass + styles[`${rootClass}-${descendant}`] || "";
141
+ }
142
+ return "";
143
+ } else if (modifiers) {
144
+ const prefixedModifiers = {};
145
+ for (let modifier in modifiers) {
146
+ prefixedModifiers[styles[`${rootClass}--${modifier}`]] = modifiers[modifier];
147
+ }
148
+ const c = styles[rootClass];
149
+ return baseClass + (0, import_classnames.default)({
150
+ [c]: !!c,
151
+ // only apply the class if it exists
152
+ ...prefixedModifiers
153
+ });
154
+ } else {
155
+ return baseClass + styles[rootClass] || "";
156
+ }
157
+ };
158
+ var get_class_name_factory_default = getClassNameFactory;
159
+
160
+ // ../../node_modules/.pnpm/@radix-ui+react-popover@1.1.15_@types+react-dom@19.2.0_@types+react@19.2.0__@types+reac_e6e9e3f3089a7a72fc73cc2cd9dafc33/node_modules/@radix-ui/react-popover/dist/index.mjs
161
+ init_react_import();
162
+ import * as React29 from "react";
163
+
164
+ // ../../node_modules/.pnpm/@radix-ui+primitive@1.1.3/node_modules/@radix-ui/primitive/dist/index.mjs
165
+ init_react_import();
166
+ var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
167
+ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
168
+ return function handleEvent(event) {
169
+ originalEventHandler?.(event);
170
+ if (checkForDefaultPrevented === false || !event.defaultPrevented) {
171
+ return ourEventHandler?.(event);
172
+ }
173
+ };
174
+ }
175
+
176
+ // ../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
177
+ init_react_import();
178
+ import * as React2 from "react";
179
+ function setRef(ref, value) {
180
+ if (typeof ref === "function") {
181
+ return ref(value);
182
+ } else if (ref !== null && ref !== void 0) {
183
+ ref.current = value;
184
+ }
185
+ }
186
+ function composeRefs(...refs) {
187
+ return (node) => {
188
+ let hasCleanup = false;
189
+ const cleanups = refs.map((ref) => {
190
+ const cleanup = setRef(ref, node);
191
+ if (!hasCleanup && typeof cleanup == "function") {
192
+ hasCleanup = true;
193
+ }
194
+ return cleanup;
195
+ });
196
+ if (hasCleanup) {
197
+ return () => {
198
+ for (let i = 0; i < cleanups.length; i++) {
199
+ const cleanup = cleanups[i];
200
+ if (typeof cleanup == "function") {
201
+ cleanup();
202
+ } else {
203
+ setRef(refs[i], null);
204
+ }
205
+ }
206
+ };
207
+ }
208
+ };
209
+ }
210
+ function useComposedRefs(...refs) {
211
+ return React2.useCallback(composeRefs(...refs), refs);
212
+ }
213
+
214
+ // ../../node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-context/dist/index.mjs
215
+ init_react_import();
216
+ import * as React3 from "react";
217
+ import { jsx } from "react/jsx-runtime";
218
+ function createContextScope(scopeName, createContextScopeDeps = []) {
219
+ let defaultContexts = [];
220
+ function createContext3(rootComponentName, defaultContext) {
221
+ const BaseContext = React3.createContext(defaultContext);
222
+ const index2 = defaultContexts.length;
223
+ defaultContexts = [...defaultContexts, defaultContext];
224
+ const Provider = (props) => {
225
+ const { scope, children, ...context } = props;
226
+ const Context = scope?.[scopeName]?.[index2] || BaseContext;
227
+ const value = React3.useMemo(() => context, Object.values(context));
228
+ return /* @__PURE__ */ jsx(Context.Provider, { value, children });
229
+ };
230
+ Provider.displayName = rootComponentName + "Provider";
231
+ function useContext22(consumerName, scope) {
232
+ const Context = scope?.[scopeName]?.[index2] || BaseContext;
233
+ const context = React3.useContext(Context);
234
+ if (context) return context;
235
+ if (defaultContext !== void 0) return defaultContext;
236
+ throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
237
+ }
238
+ return [Provider, useContext22];
239
+ }
240
+ const createScope = () => {
241
+ const scopeContexts = defaultContexts.map((defaultContext) => {
242
+ return React3.createContext(defaultContext);
243
+ });
244
+ return function useScope(scope) {
245
+ const contexts = scope?.[scopeName] || scopeContexts;
246
+ return React3.useMemo(
247
+ () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
248
+ [scope, contexts]
249
+ );
250
+ };
251
+ };
252
+ createScope.scopeName = scopeName;
253
+ return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
254
+ }
255
+ function composeContextScopes(...scopes) {
256
+ const baseScope = scopes[0];
257
+ if (scopes.length === 1) return baseScope;
258
+ const createScope = () => {
259
+ const scopeHooks = scopes.map((createScope2) => ({
260
+ useScope: createScope2(),
261
+ scopeName: createScope2.scopeName
262
+ }));
263
+ return function useComposedScopes(overrideScopes) {
264
+ const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
265
+ const scopeProps = useScope(overrideScopes);
266
+ const currentScope = scopeProps[`__scope${scopeName}`];
267
+ return { ...nextScopes2, ...currentScope };
268
+ }, {});
269
+ return React3.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
270
+ };
271
+ };
272
+ createScope.scopeName = baseScope.scopeName;
273
+ return createScope;
274
+ }
275
+
276
+ // ../../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.11_@types+react-dom@19.2.0_@types+react@19.2.0__@_0427988989ef438cb994d86fd87ebad1/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
277
+ init_react_import();
278
+ import * as React8 from "react";
279
+
280
+ // ../../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.2.0_@types+react@19.2.0__@types+rea_ea2bc0681dd1d05b829e42d1b452627b/node_modules/@radix-ui/react-primitive/dist/index.mjs
281
+ init_react_import();
282
+ import * as React5 from "react";
283
+ import * as ReactDOM from "react-dom";
284
+
285
+ // ../../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-slot/dist/index.mjs
286
+ init_react_import();
287
+ import * as React4 from "react";
288
+ import { Fragment as Fragment2, jsx as jsx2 } from "react/jsx-runtime";
289
+ // @__NO_SIDE_EFFECTS__
290
+ function createSlot(ownerName) {
291
+ const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
292
+ const Slot2 = React4.forwardRef((props, forwardedRef) => {
293
+ const { children, ...slotProps } = props;
294
+ const childrenArray = React4.Children.toArray(children);
295
+ const slottable = childrenArray.find(isSlottable);
296
+ if (slottable) {
297
+ const newElement = slottable.props.children;
298
+ const newChildren = childrenArray.map((child) => {
299
+ if (child === slottable) {
300
+ if (React4.Children.count(newElement) > 1) return React4.Children.only(null);
301
+ return React4.isValidElement(newElement) ? newElement.props.children : null;
302
+ } else {
303
+ return child;
304
+ }
305
+ });
306
+ return /* @__PURE__ */ jsx2(SlotClone, { ...slotProps, ref: forwardedRef, children: React4.isValidElement(newElement) ? React4.cloneElement(newElement, void 0, newChildren) : null });
307
+ }
308
+ return /* @__PURE__ */ jsx2(SlotClone, { ...slotProps, ref: forwardedRef, children });
309
+ });
310
+ Slot2.displayName = `${ownerName}.Slot`;
311
+ return Slot2;
312
+ }
313
+ // @__NO_SIDE_EFFECTS__
314
+ function createSlotClone(ownerName) {
315
+ const SlotClone = React4.forwardRef((props, forwardedRef) => {
316
+ const { children, ...slotProps } = props;
317
+ if (React4.isValidElement(children)) {
318
+ const childrenRef = getElementRef(children);
319
+ const props2 = mergeProps(slotProps, children.props);
320
+ if (children.type !== React4.Fragment) {
321
+ props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
322
+ }
323
+ return React4.cloneElement(children, props2);
324
+ }
325
+ return React4.Children.count(children) > 1 ? React4.Children.only(null) : null;
326
+ });
327
+ SlotClone.displayName = `${ownerName}.SlotClone`;
328
+ return SlotClone;
329
+ }
330
+ var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
331
+ function isSlottable(child) {
332
+ return React4.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
333
+ }
334
+ function mergeProps(slotProps, childProps) {
335
+ const overrideProps = { ...childProps };
336
+ for (const propName in childProps) {
337
+ const slotPropValue = slotProps[propName];
338
+ const childPropValue = childProps[propName];
339
+ const isHandler = /^on[A-Z]/.test(propName);
340
+ if (isHandler) {
341
+ if (slotPropValue && childPropValue) {
342
+ overrideProps[propName] = (...args) => {
343
+ const result = childPropValue(...args);
344
+ slotPropValue(...args);
345
+ return result;
346
+ };
347
+ } else if (slotPropValue) {
348
+ overrideProps[propName] = slotPropValue;
349
+ }
350
+ } else if (propName === "style") {
351
+ overrideProps[propName] = { ...slotPropValue, ...childPropValue };
352
+ } else if (propName === "className") {
353
+ overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
354
+ }
355
+ }
356
+ return { ...slotProps, ...overrideProps };
357
+ }
358
+ function getElementRef(element) {
359
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
360
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
361
+ if (mayWarn) {
362
+ return element.ref;
363
+ }
364
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
365
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
366
+ if (mayWarn) {
367
+ return element.props.ref;
368
+ }
369
+ return element.props.ref || element.ref;
370
+ }
371
+
372
+ // ../../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.2.0_@types+react@19.2.0__@types+rea_ea2bc0681dd1d05b829e42d1b452627b/node_modules/@radix-ui/react-primitive/dist/index.mjs
373
+ import { jsx as jsx3 } from "react/jsx-runtime";
374
+ var NODES = [
375
+ "a",
376
+ "button",
377
+ "div",
378
+ "form",
379
+ "h2",
380
+ "h3",
381
+ "img",
382
+ "input",
383
+ "label",
384
+ "li",
385
+ "nav",
386
+ "ol",
387
+ "p",
388
+ "select",
389
+ "span",
390
+ "svg",
391
+ "ul"
392
+ ];
393
+ var Primitive = NODES.reduce((primitive, node) => {
394
+ const Slot2 = createSlot(`Primitive.${node}`);
395
+ const Node2 = React5.forwardRef((props, forwardedRef) => {
396
+ const { asChild, ...primitiveProps } = props;
397
+ const Comp = asChild ? Slot2 : node;
398
+ if (typeof window !== "undefined") {
399
+ window[Symbol.for("radix-ui")] = true;
400
+ }
401
+ return /* @__PURE__ */ jsx3(Comp, { ...primitiveProps, ref: forwardedRef });
402
+ });
403
+ Node2.displayName = `Primitive.${node}`;
404
+ return { ...primitive, [node]: Node2 };
405
+ }, {});
406
+ function dispatchDiscreteCustomEvent(target, event) {
407
+ if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
408
+ }
409
+
410
+ // ../../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.1_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
411
+ init_react_import();
412
+ import * as React6 from "react";
413
+ function useCallbackRef(callback) {
414
+ const callbackRef = React6.useRef(callback);
415
+ React6.useEffect(() => {
416
+ callbackRef.current = callback;
417
+ });
418
+ return React6.useMemo(() => (...args) => callbackRef.current?.(...args), []);
419
+ }
420
+
421
+ // ../../node_modules/.pnpm/@radix-ui+react-use-escape-keydown@1.1.1_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
422
+ init_react_import();
423
+ import * as React7 from "react";
424
+ function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
425
+ const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
426
+ React7.useEffect(() => {
427
+ const handleKeyDown = (event) => {
428
+ if (event.key === "Escape") {
429
+ onEscapeKeyDown(event);
430
+ }
431
+ };
432
+ ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
433
+ return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
434
+ }, [onEscapeKeyDown, ownerDocument]);
435
+ }
436
+
437
+ // ../../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.11_@types+react-dom@19.2.0_@types+react@19.2.0__@_0427988989ef438cb994d86fd87ebad1/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
438
+ import { jsx as jsx4 } from "react/jsx-runtime";
439
+ var DISMISSABLE_LAYER_NAME = "DismissableLayer";
440
+ var CONTEXT_UPDATE = "dismissableLayer.update";
441
+ var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
442
+ var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
443
+ var originalBodyPointerEvents;
444
+ var DismissableLayerContext = React8.createContext({
445
+ layers: /* @__PURE__ */ new Set(),
446
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
447
+ branches: /* @__PURE__ */ new Set()
448
+ });
449
+ var DismissableLayer = React8.forwardRef(
450
+ (props, forwardedRef) => {
451
+ const {
452
+ disableOutsidePointerEvents = false,
453
+ onEscapeKeyDown,
454
+ onPointerDownOutside,
455
+ onFocusOutside,
456
+ onInteractOutside,
457
+ onDismiss,
458
+ ...layerProps
459
+ } = props;
460
+ const context = React8.useContext(DismissableLayerContext);
461
+ const [node, setNode] = React8.useState(null);
462
+ const ownerDocument = node?.ownerDocument ?? globalThis?.document;
463
+ const [, force] = React8.useState({});
464
+ const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
465
+ const layers = Array.from(context.layers);
466
+ const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
467
+ const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
468
+ const index2 = node ? layers.indexOf(node) : -1;
469
+ const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
470
+ const isPointerEventsEnabled = index2 >= highestLayerWithOutsidePointerEventsDisabledIndex;
471
+ const pointerDownOutside = usePointerDownOutside((event) => {
472
+ const target = event.target;
473
+ const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
474
+ if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
475
+ onPointerDownOutside?.(event);
476
+ onInteractOutside?.(event);
477
+ if (!event.defaultPrevented) onDismiss?.();
478
+ }, ownerDocument);
479
+ const focusOutside = useFocusOutside((event) => {
480
+ const target = event.target;
481
+ const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
482
+ if (isFocusInBranch) return;
483
+ onFocusOutside?.(event);
484
+ onInteractOutside?.(event);
485
+ if (!event.defaultPrevented) onDismiss?.();
486
+ }, ownerDocument);
487
+ useEscapeKeydown((event) => {
488
+ const isHighestLayer = index2 === context.layers.size - 1;
489
+ if (!isHighestLayer) return;
490
+ onEscapeKeyDown?.(event);
491
+ if (!event.defaultPrevented && onDismiss) {
492
+ event.preventDefault();
493
+ onDismiss();
494
+ }
495
+ }, ownerDocument);
496
+ React8.useEffect(() => {
497
+ if (!node) return;
498
+ if (disableOutsidePointerEvents) {
499
+ if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
500
+ originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
501
+ ownerDocument.body.style.pointerEvents = "none";
502
+ }
503
+ context.layersWithOutsidePointerEventsDisabled.add(node);
504
+ }
505
+ context.layers.add(node);
506
+ dispatchUpdate();
507
+ return () => {
508
+ if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
509
+ ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
510
+ }
511
+ };
512
+ }, [node, ownerDocument, disableOutsidePointerEvents, context]);
513
+ React8.useEffect(() => {
514
+ return () => {
515
+ if (!node) return;
516
+ context.layers.delete(node);
517
+ context.layersWithOutsidePointerEventsDisabled.delete(node);
518
+ dispatchUpdate();
519
+ };
520
+ }, [node, context]);
521
+ React8.useEffect(() => {
522
+ const handleUpdate = () => force({});
523
+ document.addEventListener(CONTEXT_UPDATE, handleUpdate);
524
+ return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
525
+ }, []);
526
+ return /* @__PURE__ */ jsx4(
527
+ Primitive.div,
528
+ {
529
+ ...layerProps,
530
+ ref: composedRefs,
531
+ style: {
532
+ pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
533
+ ...props.style
534
+ },
535
+ onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
536
+ onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
537
+ onPointerDownCapture: composeEventHandlers(
538
+ props.onPointerDownCapture,
539
+ pointerDownOutside.onPointerDownCapture
540
+ )
541
+ }
542
+ );
543
+ }
544
+ );
545
+ DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
546
+ var BRANCH_NAME = "DismissableLayerBranch";
547
+ var DismissableLayerBranch = React8.forwardRef((props, forwardedRef) => {
548
+ const context = React8.useContext(DismissableLayerContext);
549
+ const ref = React8.useRef(null);
550
+ const composedRefs = useComposedRefs(forwardedRef, ref);
551
+ React8.useEffect(() => {
552
+ const node = ref.current;
553
+ if (node) {
554
+ context.branches.add(node);
555
+ return () => {
556
+ context.branches.delete(node);
557
+ };
558
+ }
559
+ }, [context.branches]);
560
+ return /* @__PURE__ */ jsx4(Primitive.div, { ...props, ref: composedRefs });
561
+ });
562
+ DismissableLayerBranch.displayName = BRANCH_NAME;
563
+ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
564
+ const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
565
+ const isPointerInsideReactTreeRef = React8.useRef(false);
566
+ const handleClickRef = React8.useRef(() => {
567
+ });
568
+ React8.useEffect(() => {
569
+ const handlePointerDown = (event) => {
570
+ if (event.target && !isPointerInsideReactTreeRef.current) {
571
+ let handleAndDispatchPointerDownOutsideEvent2 = function() {
572
+ handleAndDispatchCustomEvent(
573
+ POINTER_DOWN_OUTSIDE,
574
+ handlePointerDownOutside,
575
+ eventDetail,
576
+ { discrete: true }
577
+ );
578
+ };
579
+ var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;
580
+ const eventDetail = { originalEvent: event };
581
+ if (event.pointerType === "touch") {
582
+ ownerDocument.removeEventListener("click", handleClickRef.current);
583
+ handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
584
+ ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
585
+ } else {
586
+ handleAndDispatchPointerDownOutsideEvent2();
587
+ }
588
+ } else {
589
+ ownerDocument.removeEventListener("click", handleClickRef.current);
590
+ }
591
+ isPointerInsideReactTreeRef.current = false;
592
+ };
593
+ const timerId = window.setTimeout(() => {
594
+ ownerDocument.addEventListener("pointerdown", handlePointerDown);
595
+ }, 0);
596
+ return () => {
597
+ window.clearTimeout(timerId);
598
+ ownerDocument.removeEventListener("pointerdown", handlePointerDown);
599
+ ownerDocument.removeEventListener("click", handleClickRef.current);
600
+ };
601
+ }, [ownerDocument, handlePointerDownOutside]);
602
+ return {
603
+ // ensures we check React component tree (not just DOM tree)
604
+ onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
605
+ };
606
+ }
607
+ function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
608
+ const handleFocusOutside = useCallbackRef(onFocusOutside);
609
+ const isFocusInsideReactTreeRef = React8.useRef(false);
610
+ React8.useEffect(() => {
611
+ const handleFocus = (event) => {
612
+ if (event.target && !isFocusInsideReactTreeRef.current) {
613
+ const eventDetail = { originalEvent: event };
614
+ handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
615
+ discrete: false
616
+ });
617
+ }
618
+ };
619
+ ownerDocument.addEventListener("focusin", handleFocus);
620
+ return () => ownerDocument.removeEventListener("focusin", handleFocus);
621
+ }, [ownerDocument, handleFocusOutside]);
622
+ return {
623
+ onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
624
+ onBlurCapture: () => isFocusInsideReactTreeRef.current = false
625
+ };
626
+ }
627
+ function dispatchUpdate() {
628
+ const event = new CustomEvent(CONTEXT_UPDATE);
629
+ document.dispatchEvent(event);
630
+ }
631
+ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
632
+ const target = detail.originalEvent.target;
633
+ const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
634
+ if (handler) target.addEventListener(name, handler, { once: true });
635
+ if (discrete) {
636
+ dispatchDiscreteCustomEvent(target, event);
637
+ } else {
638
+ target.dispatchEvent(event);
639
+ }
640
+ }
641
+
642
+ // ../../node_modules/.pnpm/@radix-ui+react-focus-guards@1.1.3_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-focus-guards/dist/index.mjs
643
+ init_react_import();
644
+ import * as React9 from "react";
645
+ var count = 0;
646
+ function useFocusGuards() {
647
+ React9.useEffect(() => {
648
+ const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
649
+ document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
650
+ document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
651
+ count++;
652
+ return () => {
653
+ if (count === 1) {
654
+ document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
655
+ }
656
+ count--;
657
+ };
658
+ }, []);
659
+ }
660
+ function createFocusGuard() {
661
+ const element = document.createElement("span");
662
+ element.setAttribute("data-radix-focus-guard", "");
663
+ element.tabIndex = 0;
664
+ element.style.outline = "none";
665
+ element.style.opacity = "0";
666
+ element.style.position = "fixed";
667
+ element.style.pointerEvents = "none";
668
+ return element;
669
+ }
670
+
671
+ // ../../node_modules/.pnpm/@radix-ui+react-focus-scope@1.1.7_@types+react-dom@19.2.0_@types+react@19.2.0__@types+r_432f7c191b0104b6af97209524a0df56/node_modules/@radix-ui/react-focus-scope/dist/index.mjs
672
+ init_react_import();
673
+ import * as React10 from "react";
674
+ import { jsx as jsx5 } from "react/jsx-runtime";
675
+ var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
676
+ var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
677
+ var EVENT_OPTIONS = { bubbles: false, cancelable: true };
678
+ var FOCUS_SCOPE_NAME = "FocusScope";
679
+ var FocusScope = React10.forwardRef((props, forwardedRef) => {
680
+ const {
681
+ loop = false,
682
+ trapped = false,
683
+ onMountAutoFocus: onMountAutoFocusProp,
684
+ onUnmountAutoFocus: onUnmountAutoFocusProp,
685
+ ...scopeProps
686
+ } = props;
687
+ const [container, setContainer] = React10.useState(null);
688
+ const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
689
+ const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
690
+ const lastFocusedElementRef = React10.useRef(null);
691
+ const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
692
+ const focusScope = React10.useRef({
693
+ paused: false,
694
+ pause() {
695
+ this.paused = true;
696
+ },
697
+ resume() {
698
+ this.paused = false;
699
+ }
700
+ }).current;
701
+ React10.useEffect(() => {
702
+ if (trapped) {
703
+ let handleFocusIn2 = function(event) {
704
+ if (focusScope.paused || !container) return;
705
+ const target = event.target;
706
+ if (container.contains(target)) {
707
+ lastFocusedElementRef.current = target;
708
+ } else {
709
+ focus(lastFocusedElementRef.current, { select: true });
710
+ }
711
+ }, handleFocusOut2 = function(event) {
712
+ if (focusScope.paused || !container) return;
713
+ const relatedTarget = event.relatedTarget;
714
+ if (relatedTarget === null) return;
715
+ if (!container.contains(relatedTarget)) {
716
+ focus(lastFocusedElementRef.current, { select: true });
717
+ }
718
+ }, handleMutations2 = function(mutations) {
719
+ const focusedElement = document.activeElement;
720
+ if (focusedElement !== document.body) return;
721
+ for (const mutation of mutations) {
722
+ if (mutation.removedNodes.length > 0) focus(container);
723
+ }
724
+ };
725
+ var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;
726
+ document.addEventListener("focusin", handleFocusIn2);
727
+ document.addEventListener("focusout", handleFocusOut2);
728
+ const mutationObserver = new MutationObserver(handleMutations2);
729
+ if (container) mutationObserver.observe(container, { childList: true, subtree: true });
730
+ return () => {
731
+ document.removeEventListener("focusin", handleFocusIn2);
732
+ document.removeEventListener("focusout", handleFocusOut2);
733
+ mutationObserver.disconnect();
734
+ };
735
+ }
736
+ }, [trapped, container, focusScope.paused]);
737
+ React10.useEffect(() => {
738
+ if (container) {
739
+ focusScopesStack.add(focusScope);
740
+ const previouslyFocusedElement = document.activeElement;
741
+ const hasFocusedCandidate = container.contains(previouslyFocusedElement);
742
+ if (!hasFocusedCandidate) {
743
+ const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
744
+ container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
745
+ container.dispatchEvent(mountEvent);
746
+ if (!mountEvent.defaultPrevented) {
747
+ focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
748
+ if (document.activeElement === previouslyFocusedElement) {
749
+ focus(container);
750
+ }
751
+ }
752
+ }
753
+ return () => {
754
+ container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
755
+ setTimeout(() => {
756
+ const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
757
+ container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
758
+ container.dispatchEvent(unmountEvent);
759
+ if (!unmountEvent.defaultPrevented) {
760
+ focus(previouslyFocusedElement ?? document.body, { select: true });
761
+ }
762
+ container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
763
+ focusScopesStack.remove(focusScope);
764
+ }, 0);
765
+ };
766
+ }
767
+ }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
768
+ const handleKeyDown = React10.useCallback(
769
+ (event) => {
770
+ if (!loop && !trapped) return;
771
+ if (focusScope.paused) return;
772
+ const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
773
+ const focusedElement = document.activeElement;
774
+ if (isTabKey && focusedElement) {
775
+ const container2 = event.currentTarget;
776
+ const [first, last] = getTabbableEdges(container2);
777
+ const hasTabbableElementsInside = first && last;
778
+ if (!hasTabbableElementsInside) {
779
+ if (focusedElement === container2) event.preventDefault();
780
+ } else {
781
+ if (!event.shiftKey && focusedElement === last) {
782
+ event.preventDefault();
783
+ if (loop) focus(first, { select: true });
784
+ } else if (event.shiftKey && focusedElement === first) {
785
+ event.preventDefault();
786
+ if (loop) focus(last, { select: true });
787
+ }
788
+ }
789
+ }
790
+ },
791
+ [loop, trapped, focusScope.paused]
792
+ );
793
+ return /* @__PURE__ */ jsx5(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
794
+ });
795
+ FocusScope.displayName = FOCUS_SCOPE_NAME;
796
+ function focusFirst(candidates, { select = false } = {}) {
797
+ const previouslyFocusedElement = document.activeElement;
798
+ for (const candidate of candidates) {
799
+ focus(candidate, { select });
800
+ if (document.activeElement !== previouslyFocusedElement) return;
801
+ }
802
+ }
803
+ function getTabbableEdges(container) {
804
+ const candidates = getTabbableCandidates(container);
805
+ const first = findVisible(candidates, container);
806
+ const last = findVisible(candidates.reverse(), container);
807
+ return [first, last];
808
+ }
809
+ function getTabbableCandidates(container) {
810
+ const nodes = [];
811
+ const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
812
+ acceptNode: (node) => {
813
+ const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
814
+ if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
815
+ return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
816
+ }
817
+ });
818
+ while (walker.nextNode()) nodes.push(walker.currentNode);
819
+ return nodes;
820
+ }
821
+ function findVisible(elements, container) {
822
+ for (const element of elements) {
823
+ if (!isHidden(element, { upTo: container })) return element;
824
+ }
825
+ }
826
+ function isHidden(node, { upTo }) {
827
+ if (getComputedStyle(node).visibility === "hidden") return true;
828
+ while (node) {
829
+ if (upTo !== void 0 && node === upTo) return false;
830
+ if (getComputedStyle(node).display === "none") return true;
831
+ node = node.parentElement;
832
+ }
833
+ return false;
834
+ }
835
+ function isSelectableInput(element) {
836
+ return element instanceof HTMLInputElement && "select" in element;
837
+ }
838
+ function focus(element, { select = false } = {}) {
839
+ if (element && element.focus) {
840
+ const previouslyFocusedElement = document.activeElement;
841
+ element.focus({ preventScroll: true });
842
+ if (element !== previouslyFocusedElement && isSelectableInput(element) && select)
843
+ element.select();
844
+ }
845
+ }
846
+ var focusScopesStack = createFocusScopesStack();
847
+ function createFocusScopesStack() {
848
+ let stack = [];
849
+ return {
850
+ add(focusScope) {
851
+ const activeFocusScope = stack[0];
852
+ if (focusScope !== activeFocusScope) {
853
+ activeFocusScope?.pause();
854
+ }
855
+ stack = arrayRemove(stack, focusScope);
856
+ stack.unshift(focusScope);
857
+ },
858
+ remove(focusScope) {
859
+ stack = arrayRemove(stack, focusScope);
860
+ stack[0]?.resume();
861
+ }
862
+ };
863
+ }
864
+ function arrayRemove(array, item) {
865
+ const updatedArray = [...array];
866
+ const index2 = updatedArray.indexOf(item);
867
+ if (index2 !== -1) {
868
+ updatedArray.splice(index2, 1);
869
+ }
870
+ return updatedArray;
871
+ }
872
+ function removeLinks(items) {
873
+ return items.filter((item) => item.tagName !== "A");
874
+ }
875
+
876
+ // ../../node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-id/dist/index.mjs
877
+ init_react_import();
878
+ import * as React12 from "react";
879
+
880
+ // ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.1_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
881
+ init_react_import();
882
+ import * as React11 from "react";
883
+ var useLayoutEffect2 = globalThis?.document ? React11.useLayoutEffect : () => {
884
+ };
885
+
886
+ // ../../node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-id/dist/index.mjs
887
+ var useReactId = React12[" useId ".trim().toString()] || (() => void 0);
888
+ var count2 = 0;
889
+ function useId(deterministicId) {
890
+ const [id, setId] = React12.useState(useReactId());
891
+ useLayoutEffect2(() => {
892
+ if (!deterministicId) setId((reactId) => reactId ?? String(count2++));
893
+ }, [deterministicId]);
894
+ return deterministicId || (id ? `radix-${id}` : "");
895
+ }
896
+
897
+ // ../../node_modules/.pnpm/@radix-ui+react-popper@1.2.8_@types+react-dom@19.2.0_@types+react@19.2.0__@types+react@_a6a7fea0f37d2b2529626c9011032658/node_modules/@radix-ui/react-popper/dist/index.mjs
898
+ init_react_import();
899
+ import * as React16 from "react";
900
+
901
+ // ../../node_modules/.pnpm/@floating-ui+react-dom@2.1.5_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
902
+ init_react_import();
903
+
904
+ // ../../node_modules/.pnpm/@floating-ui+dom@1.7.3/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
905
+ init_react_import();
906
+
907
+ // ../../node_modules/.pnpm/@floating-ui+core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
908
+ init_react_import();
909
+
910
+ // ../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
911
+ init_react_import();
912
+ var sides = ["top", "right", "bottom", "left"];
913
+ var min = Math.min;
914
+ var max = Math.max;
915
+ var round = Math.round;
916
+ var floor = Math.floor;
917
+ var createCoords = (v) => ({
918
+ x: v,
919
+ y: v
920
+ });
921
+ var oppositeSideMap = {
922
+ left: "right",
923
+ right: "left",
924
+ bottom: "top",
925
+ top: "bottom"
926
+ };
927
+ var oppositeAlignmentMap = {
928
+ start: "end",
929
+ end: "start"
930
+ };
931
+ function clamp(start, value, end) {
932
+ return max(start, min(value, end));
933
+ }
934
+ function evaluate(value, param) {
935
+ return typeof value === "function" ? value(param) : value;
936
+ }
937
+ function getSide(placement) {
938
+ return placement.split("-")[0];
939
+ }
940
+ function getAlignment(placement) {
941
+ return placement.split("-")[1];
942
+ }
943
+ function getOppositeAxis(axis) {
944
+ return axis === "x" ? "y" : "x";
945
+ }
946
+ function getAxisLength(axis) {
947
+ return axis === "y" ? "height" : "width";
948
+ }
949
+ var yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
950
+ function getSideAxis(placement) {
951
+ return yAxisSides.has(getSide(placement)) ? "y" : "x";
952
+ }
953
+ function getAlignmentAxis(placement) {
954
+ return getOppositeAxis(getSideAxis(placement));
955
+ }
956
+ function getAlignmentSides(placement, rects, rtl) {
957
+ if (rtl === void 0) {
958
+ rtl = false;
959
+ }
960
+ const alignment = getAlignment(placement);
961
+ const alignmentAxis = getAlignmentAxis(placement);
962
+ const length = getAxisLength(alignmentAxis);
963
+ let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
964
+ if (rects.reference[length] > rects.floating[length]) {
965
+ mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
966
+ }
967
+ return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
968
+ }
969
+ function getExpandedPlacements(placement) {
970
+ const oppositePlacement = getOppositePlacement(placement);
971
+ return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
972
+ }
973
+ function getOppositeAlignmentPlacement(placement) {
974
+ return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
975
+ }
976
+ var lrPlacement = ["left", "right"];
977
+ var rlPlacement = ["right", "left"];
978
+ var tbPlacement = ["top", "bottom"];
979
+ var btPlacement = ["bottom", "top"];
980
+ function getSideList(side, isStart, rtl) {
981
+ switch (side) {
982
+ case "top":
983
+ case "bottom":
984
+ if (rtl) return isStart ? rlPlacement : lrPlacement;
985
+ return isStart ? lrPlacement : rlPlacement;
986
+ case "left":
987
+ case "right":
988
+ return isStart ? tbPlacement : btPlacement;
989
+ default:
990
+ return [];
991
+ }
992
+ }
993
+ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
994
+ const alignment = getAlignment(placement);
995
+ let list = getSideList(getSide(placement), direction === "start", rtl);
996
+ if (alignment) {
997
+ list = list.map((side) => side + "-" + alignment);
998
+ if (flipAlignment) {
999
+ list = list.concat(list.map(getOppositeAlignmentPlacement));
1000
+ }
1001
+ }
1002
+ return list;
1003
+ }
1004
+ function getOppositePlacement(placement) {
1005
+ return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
1006
+ }
1007
+ function expandPaddingObject(padding) {
1008
+ return {
1009
+ top: 0,
1010
+ right: 0,
1011
+ bottom: 0,
1012
+ left: 0,
1013
+ ...padding
1014
+ };
1015
+ }
1016
+ function getPaddingObject(padding) {
1017
+ return typeof padding !== "number" ? expandPaddingObject(padding) : {
1018
+ top: padding,
1019
+ right: padding,
1020
+ bottom: padding,
1021
+ left: padding
1022
+ };
1023
+ }
1024
+ function rectToClientRect(rect) {
1025
+ const {
1026
+ x,
1027
+ y,
1028
+ width,
1029
+ height
1030
+ } = rect;
1031
+ return {
1032
+ width,
1033
+ height,
1034
+ top: y,
1035
+ left: x,
1036
+ right: x + width,
1037
+ bottom: y + height,
1038
+ x,
1039
+ y
1040
+ };
1041
+ }
1042
+
1043
+ // ../../node_modules/.pnpm/@floating-ui+core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
1044
+ function computeCoordsFromPlacement(_ref, placement, rtl) {
1045
+ let {
1046
+ reference,
1047
+ floating
1048
+ } = _ref;
1049
+ const sideAxis = getSideAxis(placement);
1050
+ const alignmentAxis = getAlignmentAxis(placement);
1051
+ const alignLength = getAxisLength(alignmentAxis);
1052
+ const side = getSide(placement);
1053
+ const isVertical = sideAxis === "y";
1054
+ const commonX = reference.x + reference.width / 2 - floating.width / 2;
1055
+ const commonY = reference.y + reference.height / 2 - floating.height / 2;
1056
+ const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
1057
+ let coords;
1058
+ switch (side) {
1059
+ case "top":
1060
+ coords = {
1061
+ x: commonX,
1062
+ y: reference.y - floating.height
1063
+ };
1064
+ break;
1065
+ case "bottom":
1066
+ coords = {
1067
+ x: commonX,
1068
+ y: reference.y + reference.height
1069
+ };
1070
+ break;
1071
+ case "right":
1072
+ coords = {
1073
+ x: reference.x + reference.width,
1074
+ y: commonY
1075
+ };
1076
+ break;
1077
+ case "left":
1078
+ coords = {
1079
+ x: reference.x - floating.width,
1080
+ y: commonY
1081
+ };
1082
+ break;
1083
+ default:
1084
+ coords = {
1085
+ x: reference.x,
1086
+ y: reference.y
1087
+ };
1088
+ }
1089
+ switch (getAlignment(placement)) {
1090
+ case "start":
1091
+ coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
1092
+ break;
1093
+ case "end":
1094
+ coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
1095
+ break;
1096
+ }
1097
+ return coords;
1098
+ }
1099
+ var computePosition = async (reference, floating, config) => {
1100
+ const {
1101
+ placement = "bottom",
1102
+ strategy = "absolute",
1103
+ middleware = [],
1104
+ platform: platform2
1105
+ } = config;
1106
+ const validMiddleware = middleware.filter(Boolean);
1107
+ const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
1108
+ let rects = await platform2.getElementRects({
1109
+ reference,
1110
+ floating,
1111
+ strategy
1112
+ });
1113
+ let {
1114
+ x,
1115
+ y
1116
+ } = computeCoordsFromPlacement(rects, placement, rtl);
1117
+ let statefulPlacement = placement;
1118
+ let middlewareData = {};
1119
+ let resetCount = 0;
1120
+ for (let i = 0; i < validMiddleware.length; i++) {
1121
+ const {
1122
+ name,
1123
+ fn
1124
+ } = validMiddleware[i];
1125
+ const {
1126
+ x: nextX,
1127
+ y: nextY,
1128
+ data,
1129
+ reset
1130
+ } = await fn({
1131
+ x,
1132
+ y,
1133
+ initialPlacement: placement,
1134
+ placement: statefulPlacement,
1135
+ strategy,
1136
+ middlewareData,
1137
+ rects,
1138
+ platform: platform2,
1139
+ elements: {
1140
+ reference,
1141
+ floating
1142
+ }
1143
+ });
1144
+ x = nextX != null ? nextX : x;
1145
+ y = nextY != null ? nextY : y;
1146
+ middlewareData = {
1147
+ ...middlewareData,
1148
+ [name]: {
1149
+ ...middlewareData[name],
1150
+ ...data
1151
+ }
1152
+ };
1153
+ if (reset && resetCount <= 50) {
1154
+ resetCount++;
1155
+ if (typeof reset === "object") {
1156
+ if (reset.placement) {
1157
+ statefulPlacement = reset.placement;
1158
+ }
1159
+ if (reset.rects) {
1160
+ rects = reset.rects === true ? await platform2.getElementRects({
1161
+ reference,
1162
+ floating,
1163
+ strategy
1164
+ }) : reset.rects;
1165
+ }
1166
+ ({
1167
+ x,
1168
+ y
1169
+ } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
1170
+ }
1171
+ i = -1;
1172
+ }
1173
+ }
1174
+ return {
1175
+ x,
1176
+ y,
1177
+ placement: statefulPlacement,
1178
+ strategy,
1179
+ middlewareData
1180
+ };
1181
+ };
1182
+ async function detectOverflow(state, options) {
1183
+ var _await$platform$isEle;
1184
+ if (options === void 0) {
1185
+ options = {};
1186
+ }
1187
+ const {
1188
+ x,
1189
+ y,
1190
+ platform: platform2,
1191
+ rects,
1192
+ elements,
1193
+ strategy
1194
+ } = state;
1195
+ const {
1196
+ boundary = "clippingAncestors",
1197
+ rootBoundary = "viewport",
1198
+ elementContext = "floating",
1199
+ altBoundary = false,
1200
+ padding = 0
1201
+ } = evaluate(options, state);
1202
+ const paddingObject = getPaddingObject(padding);
1203
+ const altContext = elementContext === "floating" ? "reference" : "floating";
1204
+ const element = elements[altBoundary ? altContext : elementContext];
1205
+ const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
1206
+ element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
1207
+ boundary,
1208
+ rootBoundary,
1209
+ strategy
1210
+ }));
1211
+ const rect = elementContext === "floating" ? {
1212
+ x,
1213
+ y,
1214
+ width: rects.floating.width,
1215
+ height: rects.floating.height
1216
+ } : rects.reference;
1217
+ const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
1218
+ const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
1219
+ x: 1,
1220
+ y: 1
1221
+ } : {
1222
+ x: 1,
1223
+ y: 1
1224
+ };
1225
+ const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
1226
+ elements,
1227
+ rect,
1228
+ offsetParent,
1229
+ strategy
1230
+ }) : rect);
1231
+ return {
1232
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
1233
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
1234
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
1235
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
1236
+ };
1237
+ }
1238
+ var arrow = (options) => ({
1239
+ name: "arrow",
1240
+ options,
1241
+ async fn(state) {
1242
+ const {
1243
+ x,
1244
+ y,
1245
+ placement,
1246
+ rects,
1247
+ platform: platform2,
1248
+ elements,
1249
+ middlewareData
1250
+ } = state;
1251
+ const {
1252
+ element,
1253
+ padding = 0
1254
+ } = evaluate(options, state) || {};
1255
+ if (element == null) {
1256
+ return {};
1257
+ }
1258
+ const paddingObject = getPaddingObject(padding);
1259
+ const coords = {
1260
+ x,
1261
+ y
1262
+ };
1263
+ const axis = getAlignmentAxis(placement);
1264
+ const length = getAxisLength(axis);
1265
+ const arrowDimensions = await platform2.getDimensions(element);
1266
+ const isYAxis = axis === "y";
1267
+ const minProp = isYAxis ? "top" : "left";
1268
+ const maxProp = isYAxis ? "bottom" : "right";
1269
+ const clientProp = isYAxis ? "clientHeight" : "clientWidth";
1270
+ const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
1271
+ const startDiff = coords[axis] - rects.reference[axis];
1272
+ const arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element));
1273
+ let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
1274
+ if (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) {
1275
+ clientSize = elements.floating[clientProp] || rects.floating[length];
1276
+ }
1277
+ const centerToReference = endDiff / 2 - startDiff / 2;
1278
+ const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
1279
+ const minPadding = min(paddingObject[minProp], largestPossiblePadding);
1280
+ const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
1281
+ const min$1 = minPadding;
1282
+ const max2 = clientSize - arrowDimensions[length] - maxPadding;
1283
+ const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
1284
+ const offset4 = clamp(min$1, center, max2);
1285
+ const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
1286
+ const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
1287
+ return {
1288
+ [axis]: coords[axis] + alignmentOffset,
1289
+ data: {
1290
+ [axis]: offset4,
1291
+ centerOffset: center - offset4 - alignmentOffset,
1292
+ ...shouldAddOffset && {
1293
+ alignmentOffset
1294
+ }
1295
+ },
1296
+ reset: shouldAddOffset
1297
+ };
1298
+ }
1299
+ });
1300
+ var flip = function(options) {
1301
+ if (options === void 0) {
1302
+ options = {};
1303
+ }
1304
+ return {
1305
+ name: "flip",
1306
+ options,
1307
+ async fn(state) {
1308
+ var _middlewareData$arrow, _middlewareData$flip;
1309
+ const {
1310
+ placement,
1311
+ middlewareData,
1312
+ rects,
1313
+ initialPlacement,
1314
+ platform: platform2,
1315
+ elements
1316
+ } = state;
1317
+ const {
1318
+ mainAxis: checkMainAxis = true,
1319
+ crossAxis: checkCrossAxis = true,
1320
+ fallbackPlacements: specifiedFallbackPlacements,
1321
+ fallbackStrategy = "bestFit",
1322
+ fallbackAxisSideDirection = "none",
1323
+ flipAlignment = true,
1324
+ ...detectOverflowOptions
1325
+ } = evaluate(options, state);
1326
+ if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
1327
+ return {};
1328
+ }
1329
+ const side = getSide(placement);
1330
+ const initialSideAxis = getSideAxis(initialPlacement);
1331
+ const isBasePlacement = getSide(initialPlacement) === initialPlacement;
1332
+ const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
1333
+ const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
1334
+ const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
1335
+ if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
1336
+ fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
1337
+ }
1338
+ const placements2 = [initialPlacement, ...fallbackPlacements];
1339
+ const overflow = await detectOverflow(state, detectOverflowOptions);
1340
+ const overflows = [];
1341
+ let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
1342
+ if (checkMainAxis) {
1343
+ overflows.push(overflow[side]);
1344
+ }
1345
+ if (checkCrossAxis) {
1346
+ const sides2 = getAlignmentSides(placement, rects, rtl);
1347
+ overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
1348
+ }
1349
+ overflowsData = [...overflowsData, {
1350
+ placement,
1351
+ overflows
1352
+ }];
1353
+ if (!overflows.every((side2) => side2 <= 0)) {
1354
+ var _middlewareData$flip2, _overflowsData$filter;
1355
+ const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
1356
+ const nextPlacement = placements2[nextIndex];
1357
+ if (nextPlacement) {
1358
+ const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
1359
+ if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
1360
+ // overflows the main axis.
1361
+ overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
1362
+ return {
1363
+ data: {
1364
+ index: nextIndex,
1365
+ overflows: overflowsData
1366
+ },
1367
+ reset: {
1368
+ placement: nextPlacement
1369
+ }
1370
+ };
1371
+ }
1372
+ }
1373
+ let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
1374
+ if (!resetPlacement) {
1375
+ switch (fallbackStrategy) {
1376
+ case "bestFit": {
1377
+ var _overflowsData$filter2;
1378
+ const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {
1379
+ if (hasFallbackAxisSideDirection) {
1380
+ const currentSideAxis = getSideAxis(d.placement);
1381
+ return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
1382
+ // reading directions favoring greater width.
1383
+ currentSideAxis === "y";
1384
+ }
1385
+ return true;
1386
+ }).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
1387
+ if (placement2) {
1388
+ resetPlacement = placement2;
1389
+ }
1390
+ break;
1391
+ }
1392
+ case "initialPlacement":
1393
+ resetPlacement = initialPlacement;
1394
+ break;
1395
+ }
1396
+ }
1397
+ if (placement !== resetPlacement) {
1398
+ return {
1399
+ reset: {
1400
+ placement: resetPlacement
1401
+ }
1402
+ };
1403
+ }
1404
+ }
1405
+ return {};
1406
+ }
1407
+ };
1408
+ };
1409
+ function getSideOffsets(overflow, rect) {
1410
+ return {
1411
+ top: overflow.top - rect.height,
1412
+ right: overflow.right - rect.width,
1413
+ bottom: overflow.bottom - rect.height,
1414
+ left: overflow.left - rect.width
1415
+ };
1416
+ }
1417
+ function isAnySideFullyClipped(overflow) {
1418
+ return sides.some((side) => overflow[side] >= 0);
1419
+ }
1420
+ var hide = function(options) {
1421
+ if (options === void 0) {
1422
+ options = {};
1423
+ }
1424
+ return {
1425
+ name: "hide",
1426
+ options,
1427
+ async fn(state) {
1428
+ const {
1429
+ rects
1430
+ } = state;
1431
+ const {
1432
+ strategy = "referenceHidden",
1433
+ ...detectOverflowOptions
1434
+ } = evaluate(options, state);
1435
+ switch (strategy) {
1436
+ case "referenceHidden": {
1437
+ const overflow = await detectOverflow(state, {
1438
+ ...detectOverflowOptions,
1439
+ elementContext: "reference"
1440
+ });
1441
+ const offsets = getSideOffsets(overflow, rects.reference);
1442
+ return {
1443
+ data: {
1444
+ referenceHiddenOffsets: offsets,
1445
+ referenceHidden: isAnySideFullyClipped(offsets)
1446
+ }
1447
+ };
1448
+ }
1449
+ case "escaped": {
1450
+ const overflow = await detectOverflow(state, {
1451
+ ...detectOverflowOptions,
1452
+ altBoundary: true
1453
+ });
1454
+ const offsets = getSideOffsets(overflow, rects.floating);
1455
+ return {
1456
+ data: {
1457
+ escapedOffsets: offsets,
1458
+ escaped: isAnySideFullyClipped(offsets)
1459
+ }
1460
+ };
1461
+ }
1462
+ default: {
1463
+ return {};
1464
+ }
1465
+ }
1466
+ }
1467
+ };
1468
+ };
1469
+ var originSides = /* @__PURE__ */ new Set(["left", "top"]);
1470
+ async function convertValueToCoords(state, options) {
1471
+ const {
1472
+ placement,
1473
+ platform: platform2,
1474
+ elements
1475
+ } = state;
1476
+ const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
1477
+ const side = getSide(placement);
1478
+ const alignment = getAlignment(placement);
1479
+ const isVertical = getSideAxis(placement) === "y";
1480
+ const mainAxisMulti = originSides.has(side) ? -1 : 1;
1481
+ const crossAxisMulti = rtl && isVertical ? -1 : 1;
1482
+ const rawValue = evaluate(options, state);
1483
+ let {
1484
+ mainAxis,
1485
+ crossAxis,
1486
+ alignmentAxis
1487
+ } = typeof rawValue === "number" ? {
1488
+ mainAxis: rawValue,
1489
+ crossAxis: 0,
1490
+ alignmentAxis: null
1491
+ } : {
1492
+ mainAxis: rawValue.mainAxis || 0,
1493
+ crossAxis: rawValue.crossAxis || 0,
1494
+ alignmentAxis: rawValue.alignmentAxis
1495
+ };
1496
+ if (alignment && typeof alignmentAxis === "number") {
1497
+ crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
1498
+ }
1499
+ return isVertical ? {
1500
+ x: crossAxis * crossAxisMulti,
1501
+ y: mainAxis * mainAxisMulti
1502
+ } : {
1503
+ x: mainAxis * mainAxisMulti,
1504
+ y: crossAxis * crossAxisMulti
1505
+ };
1506
+ }
1507
+ var offset = function(options) {
1508
+ if (options === void 0) {
1509
+ options = 0;
1510
+ }
1511
+ return {
1512
+ name: "offset",
1513
+ options,
1514
+ async fn(state) {
1515
+ var _middlewareData$offse, _middlewareData$arrow;
1516
+ const {
1517
+ x,
1518
+ y,
1519
+ placement,
1520
+ middlewareData
1521
+ } = state;
1522
+ const diffCoords = await convertValueToCoords(state, options);
1523
+ if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
1524
+ return {};
1525
+ }
1526
+ return {
1527
+ x: x + diffCoords.x,
1528
+ y: y + diffCoords.y,
1529
+ data: {
1530
+ ...diffCoords,
1531
+ placement
1532
+ }
1533
+ };
1534
+ }
1535
+ };
1536
+ };
1537
+ var shift = function(options) {
1538
+ if (options === void 0) {
1539
+ options = {};
1540
+ }
1541
+ return {
1542
+ name: "shift",
1543
+ options,
1544
+ async fn(state) {
1545
+ const {
1546
+ x,
1547
+ y,
1548
+ placement
1549
+ } = state;
1550
+ const {
1551
+ mainAxis: checkMainAxis = true,
1552
+ crossAxis: checkCrossAxis = false,
1553
+ limiter = {
1554
+ fn: (_ref) => {
1555
+ let {
1556
+ x: x2,
1557
+ y: y2
1558
+ } = _ref;
1559
+ return {
1560
+ x: x2,
1561
+ y: y2
1562
+ };
1563
+ }
1564
+ },
1565
+ ...detectOverflowOptions
1566
+ } = evaluate(options, state);
1567
+ const coords = {
1568
+ x,
1569
+ y
1570
+ };
1571
+ const overflow = await detectOverflow(state, detectOverflowOptions);
1572
+ const crossAxis = getSideAxis(getSide(placement));
1573
+ const mainAxis = getOppositeAxis(crossAxis);
1574
+ let mainAxisCoord = coords[mainAxis];
1575
+ let crossAxisCoord = coords[crossAxis];
1576
+ if (checkMainAxis) {
1577
+ const minSide = mainAxis === "y" ? "top" : "left";
1578
+ const maxSide = mainAxis === "y" ? "bottom" : "right";
1579
+ const min2 = mainAxisCoord + overflow[minSide];
1580
+ const max2 = mainAxisCoord - overflow[maxSide];
1581
+ mainAxisCoord = clamp(min2, mainAxisCoord, max2);
1582
+ }
1583
+ if (checkCrossAxis) {
1584
+ const minSide = crossAxis === "y" ? "top" : "left";
1585
+ const maxSide = crossAxis === "y" ? "bottom" : "right";
1586
+ const min2 = crossAxisCoord + overflow[minSide];
1587
+ const max2 = crossAxisCoord - overflow[maxSide];
1588
+ crossAxisCoord = clamp(min2, crossAxisCoord, max2);
1589
+ }
1590
+ const limitedCoords = limiter.fn({
1591
+ ...state,
1592
+ [mainAxis]: mainAxisCoord,
1593
+ [crossAxis]: crossAxisCoord
1594
+ });
1595
+ return {
1596
+ ...limitedCoords,
1597
+ data: {
1598
+ x: limitedCoords.x - x,
1599
+ y: limitedCoords.y - y,
1600
+ enabled: {
1601
+ [mainAxis]: checkMainAxis,
1602
+ [crossAxis]: checkCrossAxis
1603
+ }
1604
+ }
1605
+ };
1606
+ }
1607
+ };
1608
+ };
1609
+ var limitShift = function(options) {
1610
+ if (options === void 0) {
1611
+ options = {};
1612
+ }
1613
+ return {
1614
+ options,
1615
+ fn(state) {
1616
+ const {
1617
+ x,
1618
+ y,
1619
+ placement,
1620
+ rects,
1621
+ middlewareData
1622
+ } = state;
1623
+ const {
1624
+ offset: offset4 = 0,
1625
+ mainAxis: checkMainAxis = true,
1626
+ crossAxis: checkCrossAxis = true
1627
+ } = evaluate(options, state);
1628
+ const coords = {
1629
+ x,
1630
+ y
1631
+ };
1632
+ const crossAxis = getSideAxis(placement);
1633
+ const mainAxis = getOppositeAxis(crossAxis);
1634
+ let mainAxisCoord = coords[mainAxis];
1635
+ let crossAxisCoord = coords[crossAxis];
1636
+ const rawOffset = evaluate(offset4, state);
1637
+ const computedOffset = typeof rawOffset === "number" ? {
1638
+ mainAxis: rawOffset,
1639
+ crossAxis: 0
1640
+ } : {
1641
+ mainAxis: 0,
1642
+ crossAxis: 0,
1643
+ ...rawOffset
1644
+ };
1645
+ if (checkMainAxis) {
1646
+ const len = mainAxis === "y" ? "height" : "width";
1647
+ const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
1648
+ const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
1649
+ if (mainAxisCoord < limitMin) {
1650
+ mainAxisCoord = limitMin;
1651
+ } else if (mainAxisCoord > limitMax) {
1652
+ mainAxisCoord = limitMax;
1653
+ }
1654
+ }
1655
+ if (checkCrossAxis) {
1656
+ var _middlewareData$offse, _middlewareData$offse2;
1657
+ const len = mainAxis === "y" ? "width" : "height";
1658
+ const isOriginSide = originSides.has(getSide(placement));
1659
+ const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
1660
+ const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
1661
+ if (crossAxisCoord < limitMin) {
1662
+ crossAxisCoord = limitMin;
1663
+ } else if (crossAxisCoord > limitMax) {
1664
+ crossAxisCoord = limitMax;
1665
+ }
1666
+ }
1667
+ return {
1668
+ [mainAxis]: mainAxisCoord,
1669
+ [crossAxis]: crossAxisCoord
1670
+ };
1671
+ }
1672
+ };
1673
+ };
1674
+ var size = function(options) {
1675
+ if (options === void 0) {
1676
+ options = {};
1677
+ }
1678
+ return {
1679
+ name: "size",
1680
+ options,
1681
+ async fn(state) {
1682
+ var _state$middlewareData, _state$middlewareData2;
1683
+ const {
1684
+ placement,
1685
+ rects,
1686
+ platform: platform2,
1687
+ elements
1688
+ } = state;
1689
+ const {
1690
+ apply = () => {
1691
+ },
1692
+ ...detectOverflowOptions
1693
+ } = evaluate(options, state);
1694
+ const overflow = await detectOverflow(state, detectOverflowOptions);
1695
+ const side = getSide(placement);
1696
+ const alignment = getAlignment(placement);
1697
+ const isYAxis = getSideAxis(placement) === "y";
1698
+ const {
1699
+ width,
1700
+ height
1701
+ } = rects.floating;
1702
+ let heightSide;
1703
+ let widthSide;
1704
+ if (side === "top" || side === "bottom") {
1705
+ heightSide = side;
1706
+ widthSide = alignment === (await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
1707
+ } else {
1708
+ widthSide = side;
1709
+ heightSide = alignment === "end" ? "top" : "bottom";
1710
+ }
1711
+ const maximumClippingHeight = height - overflow.top - overflow.bottom;
1712
+ const maximumClippingWidth = width - overflow.left - overflow.right;
1713
+ const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
1714
+ const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
1715
+ const noShift = !state.middlewareData.shift;
1716
+ let availableHeight = overflowAvailableHeight;
1717
+ let availableWidth = overflowAvailableWidth;
1718
+ if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {
1719
+ availableWidth = maximumClippingWidth;
1720
+ }
1721
+ if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {
1722
+ availableHeight = maximumClippingHeight;
1723
+ }
1724
+ if (noShift && !alignment) {
1725
+ const xMin = max(overflow.left, 0);
1726
+ const xMax = max(overflow.right, 0);
1727
+ const yMin = max(overflow.top, 0);
1728
+ const yMax = max(overflow.bottom, 0);
1729
+ if (isYAxis) {
1730
+ availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
1731
+ } else {
1732
+ availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
1733
+ }
1734
+ }
1735
+ await apply({
1736
+ ...state,
1737
+ availableWidth,
1738
+ availableHeight
1739
+ });
1740
+ const nextDimensions = await platform2.getDimensions(elements.floating);
1741
+ if (width !== nextDimensions.width || height !== nextDimensions.height) {
1742
+ return {
1743
+ reset: {
1744
+ rects: true
1745
+ }
1746
+ };
1747
+ }
1748
+ return {};
1749
+ }
1750
+ };
1751
+ };
1752
+
1753
+ // ../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
1754
+ init_react_import();
1755
+ function hasWindow() {
1756
+ return typeof window !== "undefined";
1757
+ }
1758
+ function getNodeName(node) {
1759
+ if (isNode(node)) {
1760
+ return (node.nodeName || "").toLowerCase();
1761
+ }
1762
+ return "#document";
1763
+ }
1764
+ function getWindow(node) {
1765
+ var _node$ownerDocument;
1766
+ return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
1767
+ }
1768
+ function getDocumentElement(node) {
1769
+ var _ref;
1770
+ return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
1771
+ }
1772
+ function isNode(value) {
1773
+ if (!hasWindow()) {
1774
+ return false;
1775
+ }
1776
+ return value instanceof Node || value instanceof getWindow(value).Node;
1777
+ }
1778
+ function isElement(value) {
1779
+ if (!hasWindow()) {
1780
+ return false;
1781
+ }
1782
+ return value instanceof Element || value instanceof getWindow(value).Element;
1783
+ }
1784
+ function isHTMLElement(value) {
1785
+ if (!hasWindow()) {
1786
+ return false;
1787
+ }
1788
+ return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
1789
+ }
1790
+ function isShadowRoot(value) {
1791
+ if (!hasWindow() || typeof ShadowRoot === "undefined") {
1792
+ return false;
1793
+ }
1794
+ return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
1795
+ }
1796
+ var invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
1797
+ function isOverflowElement(element) {
1798
+ const {
1799
+ overflow,
1800
+ overflowX,
1801
+ overflowY,
1802
+ display
1803
+ } = getComputedStyle2(element);
1804
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
1805
+ }
1806
+ var tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]);
1807
+ function isTableElement(element) {
1808
+ return tableElements.has(getNodeName(element));
1809
+ }
1810
+ var topLayerSelectors = [":popover-open", ":modal"];
1811
+ function isTopLayer(element) {
1812
+ return topLayerSelectors.some((selector) => {
1813
+ try {
1814
+ return element.matches(selector);
1815
+ } catch (_e) {
1816
+ return false;
1817
+ }
1818
+ });
1819
+ }
1820
+ var transformProperties = ["transform", "translate", "scale", "rotate", "perspective"];
1821
+ var willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"];
1822
+ var containValues = ["paint", "layout", "strict", "content"];
1823
+ function isContainingBlock(elementOrCss) {
1824
+ const webkit = isWebKit();
1825
+ const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss;
1826
+ return transformProperties.some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || willChangeValues.some((value) => (css.willChange || "").includes(value)) || containValues.some((value) => (css.contain || "").includes(value));
1827
+ }
1828
+ function getContainingBlock(element) {
1829
+ let currentNode = getParentNode(element);
1830
+ while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
1831
+ if (isContainingBlock(currentNode)) {
1832
+ return currentNode;
1833
+ } else if (isTopLayer(currentNode)) {
1834
+ return null;
1835
+ }
1836
+ currentNode = getParentNode(currentNode);
1837
+ }
1838
+ return null;
1839
+ }
1840
+ function isWebKit() {
1841
+ if (typeof CSS === "undefined" || !CSS.supports) return false;
1842
+ return CSS.supports("-webkit-backdrop-filter", "none");
1843
+ }
1844
+ var lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]);
1845
+ function isLastTraversableNode(node) {
1846
+ return lastTraversableNodeNames.has(getNodeName(node));
1847
+ }
1848
+ function getComputedStyle2(element) {
1849
+ return getWindow(element).getComputedStyle(element);
1850
+ }
1851
+ function getNodeScroll(element) {
1852
+ if (isElement(element)) {
1853
+ return {
1854
+ scrollLeft: element.scrollLeft,
1855
+ scrollTop: element.scrollTop
1856
+ };
1857
+ }
1858
+ return {
1859
+ scrollLeft: element.scrollX,
1860
+ scrollTop: element.scrollY
1861
+ };
1862
+ }
1863
+ function getParentNode(node) {
1864
+ if (getNodeName(node) === "html") {
1865
+ return node;
1866
+ }
1867
+ const result = (
1868
+ // Step into the shadow DOM of the parent of a slotted node.
1869
+ node.assignedSlot || // DOM Element detected.
1870
+ node.parentNode || // ShadowRoot detected.
1871
+ isShadowRoot(node) && node.host || // Fallback.
1872
+ getDocumentElement(node)
1873
+ );
1874
+ return isShadowRoot(result) ? result.host : result;
1875
+ }
1876
+ function getNearestOverflowAncestor(node) {
1877
+ const parentNode = getParentNode(node);
1878
+ if (isLastTraversableNode(parentNode)) {
1879
+ return node.ownerDocument ? node.ownerDocument.body : node.body;
1880
+ }
1881
+ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
1882
+ return parentNode;
1883
+ }
1884
+ return getNearestOverflowAncestor(parentNode);
1885
+ }
1886
+ function getOverflowAncestors(node, list, traverseIframes) {
1887
+ var _node$ownerDocument2;
1888
+ if (list === void 0) {
1889
+ list = [];
1890
+ }
1891
+ if (traverseIframes === void 0) {
1892
+ traverseIframes = true;
1893
+ }
1894
+ const scrollableAncestor = getNearestOverflowAncestor(node);
1895
+ const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
1896
+ const win = getWindow(scrollableAncestor);
1897
+ if (isBody) {
1898
+ const frameElement = getFrameElement(win);
1899
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
1900
+ }
1901
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
1902
+ }
1903
+ function getFrameElement(win) {
1904
+ return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
1905
+ }
1906
+
1907
+ // ../../node_modules/.pnpm/@floating-ui+dom@1.7.3/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
1908
+ function getCssDimensions(element) {
1909
+ const css = getComputedStyle2(element);
1910
+ let width = parseFloat(css.width) || 0;
1911
+ let height = parseFloat(css.height) || 0;
1912
+ const hasOffset = isHTMLElement(element);
1913
+ const offsetWidth = hasOffset ? element.offsetWidth : width;
1914
+ const offsetHeight = hasOffset ? element.offsetHeight : height;
1915
+ const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
1916
+ if (shouldFallback) {
1917
+ width = offsetWidth;
1918
+ height = offsetHeight;
1919
+ }
1920
+ return {
1921
+ width,
1922
+ height,
1923
+ $: shouldFallback
1924
+ };
1925
+ }
1926
+ function unwrapElement(element) {
1927
+ return !isElement(element) ? element.contextElement : element;
1928
+ }
1929
+ function getScale(element) {
1930
+ const domElement = unwrapElement(element);
1931
+ if (!isHTMLElement(domElement)) {
1932
+ return createCoords(1);
1933
+ }
1934
+ const rect = domElement.getBoundingClientRect();
1935
+ const {
1936
+ width,
1937
+ height,
1938
+ $
1939
+ } = getCssDimensions(domElement);
1940
+ let x = ($ ? round(rect.width) : rect.width) / width;
1941
+ let y = ($ ? round(rect.height) : rect.height) / height;
1942
+ if (!x || !Number.isFinite(x)) {
1943
+ x = 1;
1944
+ }
1945
+ if (!y || !Number.isFinite(y)) {
1946
+ y = 1;
1947
+ }
1948
+ return {
1949
+ x,
1950
+ y
1951
+ };
1952
+ }
1953
+ var noOffsets = /* @__PURE__ */ createCoords(0);
1954
+ function getVisualOffsets(element) {
1955
+ const win = getWindow(element);
1956
+ if (!isWebKit() || !win.visualViewport) {
1957
+ return noOffsets;
1958
+ }
1959
+ return {
1960
+ x: win.visualViewport.offsetLeft,
1961
+ y: win.visualViewport.offsetTop
1962
+ };
1963
+ }
1964
+ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
1965
+ if (isFixed === void 0) {
1966
+ isFixed = false;
1967
+ }
1968
+ if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
1969
+ return false;
1970
+ }
1971
+ return isFixed;
1972
+ }
1973
+ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
1974
+ if (includeScale === void 0) {
1975
+ includeScale = false;
1976
+ }
1977
+ if (isFixedStrategy === void 0) {
1978
+ isFixedStrategy = false;
1979
+ }
1980
+ const clientRect = element.getBoundingClientRect();
1981
+ const domElement = unwrapElement(element);
1982
+ let scale = createCoords(1);
1983
+ if (includeScale) {
1984
+ if (offsetParent) {
1985
+ if (isElement(offsetParent)) {
1986
+ scale = getScale(offsetParent);
1987
+ }
1988
+ } else {
1989
+ scale = getScale(element);
1990
+ }
1991
+ }
1992
+ const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
1993
+ let x = (clientRect.left + visualOffsets.x) / scale.x;
1994
+ let y = (clientRect.top + visualOffsets.y) / scale.y;
1995
+ let width = clientRect.width / scale.x;
1996
+ let height = clientRect.height / scale.y;
1997
+ if (domElement) {
1998
+ const win = getWindow(domElement);
1999
+ const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
2000
+ let currentWin = win;
2001
+ let currentIFrame = getFrameElement(currentWin);
2002
+ while (currentIFrame && offsetParent && offsetWin !== currentWin) {
2003
+ const iframeScale = getScale(currentIFrame);
2004
+ const iframeRect = currentIFrame.getBoundingClientRect();
2005
+ const css = getComputedStyle2(currentIFrame);
2006
+ const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
2007
+ const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
2008
+ x *= iframeScale.x;
2009
+ y *= iframeScale.y;
2010
+ width *= iframeScale.x;
2011
+ height *= iframeScale.y;
2012
+ x += left;
2013
+ y += top;
2014
+ currentWin = getWindow(currentIFrame);
2015
+ currentIFrame = getFrameElement(currentWin);
2016
+ }
2017
+ }
2018
+ return rectToClientRect({
2019
+ width,
2020
+ height,
2021
+ x,
2022
+ y
2023
+ });
2024
+ }
2025
+ function getWindowScrollBarX(element, rect) {
2026
+ const leftScroll = getNodeScroll(element).scrollLeft;
2027
+ if (!rect) {
2028
+ return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
2029
+ }
2030
+ return rect.left + leftScroll;
2031
+ }
2032
+ function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
2033
+ if (ignoreScrollbarX === void 0) {
2034
+ ignoreScrollbarX = false;
2035
+ }
2036
+ const htmlRect = documentElement.getBoundingClientRect();
2037
+ const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 : (
2038
+ // RTL <body> scrollbar.
2039
+ getWindowScrollBarX(documentElement, htmlRect)
2040
+ ));
2041
+ const y = htmlRect.top + scroll.scrollTop;
2042
+ return {
2043
+ x,
2044
+ y
2045
+ };
2046
+ }
2047
+ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
2048
+ let {
2049
+ elements,
2050
+ rect,
2051
+ offsetParent,
2052
+ strategy
2053
+ } = _ref;
2054
+ const isFixed = strategy === "fixed";
2055
+ const documentElement = getDocumentElement(offsetParent);
2056
+ const topLayer = elements ? isTopLayer(elements.floating) : false;
2057
+ if (offsetParent === documentElement || topLayer && isFixed) {
2058
+ return rect;
2059
+ }
2060
+ let scroll = {
2061
+ scrollLeft: 0,
2062
+ scrollTop: 0
2063
+ };
2064
+ let scale = createCoords(1);
2065
+ const offsets = createCoords(0);
2066
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
2067
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
2068
+ if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
2069
+ scroll = getNodeScroll(offsetParent);
2070
+ }
2071
+ if (isHTMLElement(offsetParent)) {
2072
+ const offsetRect = getBoundingClientRect(offsetParent);
2073
+ scale = getScale(offsetParent);
2074
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
2075
+ offsets.y = offsetRect.y + offsetParent.clientTop;
2076
+ }
2077
+ }
2078
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
2079
+ return {
2080
+ width: rect.width * scale.x,
2081
+ height: rect.height * scale.y,
2082
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
2083
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
2084
+ };
2085
+ }
2086
+ function getClientRects(element) {
2087
+ return Array.from(element.getClientRects());
2088
+ }
2089
+ function getDocumentRect(element) {
2090
+ const html = getDocumentElement(element);
2091
+ const scroll = getNodeScroll(element);
2092
+ const body = element.ownerDocument.body;
2093
+ const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
2094
+ const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
2095
+ let x = -scroll.scrollLeft + getWindowScrollBarX(element);
2096
+ const y = -scroll.scrollTop;
2097
+ if (getComputedStyle2(body).direction === "rtl") {
2098
+ x += max(html.clientWidth, body.clientWidth) - width;
2099
+ }
2100
+ return {
2101
+ width,
2102
+ height,
2103
+ x,
2104
+ y
2105
+ };
2106
+ }
2107
+ function getViewportRect(element, strategy) {
2108
+ const win = getWindow(element);
2109
+ const html = getDocumentElement(element);
2110
+ const visualViewport = win.visualViewport;
2111
+ let width = html.clientWidth;
2112
+ let height = html.clientHeight;
2113
+ let x = 0;
2114
+ let y = 0;
2115
+ if (visualViewport) {
2116
+ width = visualViewport.width;
2117
+ height = visualViewport.height;
2118
+ const visualViewportBased = isWebKit();
2119
+ if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
2120
+ x = visualViewport.offsetLeft;
2121
+ y = visualViewport.offsetTop;
2122
+ }
2123
+ }
2124
+ return {
2125
+ width,
2126
+ height,
2127
+ x,
2128
+ y
2129
+ };
2130
+ }
2131
+ var absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
2132
+ function getInnerBoundingClientRect(element, strategy) {
2133
+ const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
2134
+ const top = clientRect.top + element.clientTop;
2135
+ const left = clientRect.left + element.clientLeft;
2136
+ const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
2137
+ const width = element.clientWidth * scale.x;
2138
+ const height = element.clientHeight * scale.y;
2139
+ const x = left * scale.x;
2140
+ const y = top * scale.y;
2141
+ return {
2142
+ width,
2143
+ height,
2144
+ x,
2145
+ y
2146
+ };
2147
+ }
2148
+ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
2149
+ let rect;
2150
+ if (clippingAncestor === "viewport") {
2151
+ rect = getViewportRect(element, strategy);
2152
+ } else if (clippingAncestor === "document") {
2153
+ rect = getDocumentRect(getDocumentElement(element));
2154
+ } else if (isElement(clippingAncestor)) {
2155
+ rect = getInnerBoundingClientRect(clippingAncestor, strategy);
2156
+ } else {
2157
+ const visualOffsets = getVisualOffsets(element);
2158
+ rect = {
2159
+ x: clippingAncestor.x - visualOffsets.x,
2160
+ y: clippingAncestor.y - visualOffsets.y,
2161
+ width: clippingAncestor.width,
2162
+ height: clippingAncestor.height
2163
+ };
2164
+ }
2165
+ return rectToClientRect(rect);
2166
+ }
2167
+ function hasFixedPositionAncestor(element, stopNode) {
2168
+ const parentNode = getParentNode(element);
2169
+ if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
2170
+ return false;
2171
+ }
2172
+ return getComputedStyle2(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
2173
+ }
2174
+ function getClippingElementAncestors(element, cache) {
2175
+ const cachedResult = cache.get(element);
2176
+ if (cachedResult) {
2177
+ return cachedResult;
2178
+ }
2179
+ let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
2180
+ let currentContainingBlockComputedStyle = null;
2181
+ const elementIsFixed = getComputedStyle2(element).position === "fixed";
2182
+ let currentNode = elementIsFixed ? getParentNode(element) : element;
2183
+ while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
2184
+ const computedStyle = getComputedStyle2(currentNode);
2185
+ const currentNodeIsContaining = isContainingBlock(currentNode);
2186
+ if (!currentNodeIsContaining && computedStyle.position === "fixed") {
2187
+ currentContainingBlockComputedStyle = null;
2188
+ }
2189
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
2190
+ if (shouldDropCurrentNode) {
2191
+ result = result.filter((ancestor) => ancestor !== currentNode);
2192
+ } else {
2193
+ currentContainingBlockComputedStyle = computedStyle;
2194
+ }
2195
+ currentNode = getParentNode(currentNode);
2196
+ }
2197
+ cache.set(element, result);
2198
+ return result;
2199
+ }
2200
+ function getClippingRect(_ref) {
2201
+ let {
2202
+ element,
2203
+ boundary,
2204
+ rootBoundary,
2205
+ strategy
2206
+ } = _ref;
2207
+ const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
2208
+ const clippingAncestors = [...elementClippingAncestors, rootBoundary];
2209
+ const firstClippingAncestor = clippingAncestors[0];
2210
+ const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
2211
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
2212
+ accRect.top = max(rect.top, accRect.top);
2213
+ accRect.right = min(rect.right, accRect.right);
2214
+ accRect.bottom = min(rect.bottom, accRect.bottom);
2215
+ accRect.left = max(rect.left, accRect.left);
2216
+ return accRect;
2217
+ }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
2218
+ return {
2219
+ width: clippingRect.right - clippingRect.left,
2220
+ height: clippingRect.bottom - clippingRect.top,
2221
+ x: clippingRect.left,
2222
+ y: clippingRect.top
2223
+ };
2224
+ }
2225
+ function getDimensions(element) {
2226
+ const {
2227
+ width,
2228
+ height
2229
+ } = getCssDimensions(element);
2230
+ return {
2231
+ width,
2232
+ height
2233
+ };
2234
+ }
2235
+ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
2236
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
2237
+ const documentElement = getDocumentElement(offsetParent);
2238
+ const isFixed = strategy === "fixed";
2239
+ const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
2240
+ let scroll = {
2241
+ scrollLeft: 0,
2242
+ scrollTop: 0
2243
+ };
2244
+ const offsets = createCoords(0);
2245
+ function setLeftRTLScrollbarOffset() {
2246
+ offsets.x = getWindowScrollBarX(documentElement);
2247
+ }
2248
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
2249
+ if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
2250
+ scroll = getNodeScroll(offsetParent);
2251
+ }
2252
+ if (isOffsetParentAnElement) {
2253
+ const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
2254
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
2255
+ offsets.y = offsetRect.y + offsetParent.clientTop;
2256
+ } else if (documentElement) {
2257
+ setLeftRTLScrollbarOffset();
2258
+ }
2259
+ }
2260
+ if (isFixed && !isOffsetParentAnElement && documentElement) {
2261
+ setLeftRTLScrollbarOffset();
2262
+ }
2263
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
2264
+ const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
2265
+ const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
2266
+ return {
2267
+ x,
2268
+ y,
2269
+ width: rect.width,
2270
+ height: rect.height
2271
+ };
2272
+ }
2273
+ function isStaticPositioned(element) {
2274
+ return getComputedStyle2(element).position === "static";
2275
+ }
2276
+ function getTrueOffsetParent(element, polyfill) {
2277
+ if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") {
2278
+ return null;
2279
+ }
2280
+ if (polyfill) {
2281
+ return polyfill(element);
2282
+ }
2283
+ let rawOffsetParent = element.offsetParent;
2284
+ if (getDocumentElement(element) === rawOffsetParent) {
2285
+ rawOffsetParent = rawOffsetParent.ownerDocument.body;
2286
+ }
2287
+ return rawOffsetParent;
2288
+ }
2289
+ function getOffsetParent(element, polyfill) {
2290
+ const win = getWindow(element);
2291
+ if (isTopLayer(element)) {
2292
+ return win;
2293
+ }
2294
+ if (!isHTMLElement(element)) {
2295
+ let svgOffsetParent = getParentNode(element);
2296
+ while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
2297
+ if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
2298
+ return svgOffsetParent;
2299
+ }
2300
+ svgOffsetParent = getParentNode(svgOffsetParent);
2301
+ }
2302
+ return win;
2303
+ }
2304
+ let offsetParent = getTrueOffsetParent(element, polyfill);
2305
+ while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
2306
+ offsetParent = getTrueOffsetParent(offsetParent, polyfill);
2307
+ }
2308
+ if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
2309
+ return win;
2310
+ }
2311
+ return offsetParent || getContainingBlock(element) || win;
2312
+ }
2313
+ var getElementRects = async function(data) {
2314
+ const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
2315
+ const getDimensionsFn = this.getDimensions;
2316
+ const floatingDimensions = await getDimensionsFn(data.floating);
2317
+ return {
2318
+ reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
2319
+ floating: {
2320
+ x: 0,
2321
+ y: 0,
2322
+ width: floatingDimensions.width,
2323
+ height: floatingDimensions.height
2324
+ }
2325
+ };
2326
+ };
2327
+ function isRTL(element) {
2328
+ return getComputedStyle2(element).direction === "rtl";
2329
+ }
2330
+ var platform = {
2331
+ convertOffsetParentRelativeRectToViewportRelativeRect,
2332
+ getDocumentElement,
2333
+ getClippingRect,
2334
+ getOffsetParent,
2335
+ getElementRects,
2336
+ getClientRects,
2337
+ getDimensions,
2338
+ getScale,
2339
+ isElement,
2340
+ isRTL
2341
+ };
2342
+ function rectsAreEqual(a, b) {
2343
+ return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
2344
+ }
2345
+ function observeMove(element, onMove) {
2346
+ let io = null;
2347
+ let timeoutId;
2348
+ const root = getDocumentElement(element);
2349
+ function cleanup() {
2350
+ var _io;
2351
+ clearTimeout(timeoutId);
2352
+ (_io = io) == null || _io.disconnect();
2353
+ io = null;
2354
+ }
2355
+ function refresh(skip, threshold) {
2356
+ if (skip === void 0) {
2357
+ skip = false;
2358
+ }
2359
+ if (threshold === void 0) {
2360
+ threshold = 1;
2361
+ }
2362
+ cleanup();
2363
+ const elementRectForRootMargin = element.getBoundingClientRect();
2364
+ const {
2365
+ left,
2366
+ top,
2367
+ width,
2368
+ height
2369
+ } = elementRectForRootMargin;
2370
+ if (!skip) {
2371
+ onMove();
2372
+ }
2373
+ if (!width || !height) {
2374
+ return;
2375
+ }
2376
+ const insetTop = floor(top);
2377
+ const insetRight = floor(root.clientWidth - (left + width));
2378
+ const insetBottom = floor(root.clientHeight - (top + height));
2379
+ const insetLeft = floor(left);
2380
+ const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
2381
+ const options = {
2382
+ rootMargin,
2383
+ threshold: max(0, min(1, threshold)) || 1
2384
+ };
2385
+ let isFirstUpdate = true;
2386
+ function handleObserve(entries) {
2387
+ const ratio = entries[0].intersectionRatio;
2388
+ if (ratio !== threshold) {
2389
+ if (!isFirstUpdate) {
2390
+ return refresh();
2391
+ }
2392
+ if (!ratio) {
2393
+ timeoutId = setTimeout(() => {
2394
+ refresh(false, 1e-7);
2395
+ }, 1e3);
2396
+ } else {
2397
+ refresh(false, ratio);
2398
+ }
2399
+ }
2400
+ if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
2401
+ refresh();
2402
+ }
2403
+ isFirstUpdate = false;
2404
+ }
2405
+ try {
2406
+ io = new IntersectionObserver(handleObserve, {
2407
+ ...options,
2408
+ // Handle <iframe>s
2409
+ root: root.ownerDocument
2410
+ });
2411
+ } catch (_e) {
2412
+ io = new IntersectionObserver(handleObserve, options);
2413
+ }
2414
+ io.observe(element);
2415
+ }
2416
+ refresh(true);
2417
+ return cleanup;
2418
+ }
2419
+ function autoUpdate(reference, floating, update, options) {
2420
+ if (options === void 0) {
2421
+ options = {};
2422
+ }
2423
+ const {
2424
+ ancestorScroll = true,
2425
+ ancestorResize = true,
2426
+ elementResize = typeof ResizeObserver === "function",
2427
+ layoutShift = typeof IntersectionObserver === "function",
2428
+ animationFrame = false
2429
+ } = options;
2430
+ const referenceEl = unwrapElement(reference);
2431
+ const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
2432
+ ancestors.forEach((ancestor) => {
2433
+ ancestorScroll && ancestor.addEventListener("scroll", update, {
2434
+ passive: true
2435
+ });
2436
+ ancestorResize && ancestor.addEventListener("resize", update);
2437
+ });
2438
+ const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
2439
+ let reobserveFrame = -1;
2440
+ let resizeObserver = null;
2441
+ if (elementResize) {
2442
+ resizeObserver = new ResizeObserver((_ref) => {
2443
+ let [firstEntry] = _ref;
2444
+ if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
2445
+ resizeObserver.unobserve(floating);
2446
+ cancelAnimationFrame(reobserveFrame);
2447
+ reobserveFrame = requestAnimationFrame(() => {
2448
+ var _resizeObserver;
2449
+ (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
2450
+ });
2451
+ }
2452
+ update();
2453
+ });
2454
+ if (referenceEl && !animationFrame) {
2455
+ resizeObserver.observe(referenceEl);
2456
+ }
2457
+ resizeObserver.observe(floating);
2458
+ }
2459
+ let frameId;
2460
+ let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
2461
+ if (animationFrame) {
2462
+ frameLoop();
2463
+ }
2464
+ function frameLoop() {
2465
+ const nextRefRect = getBoundingClientRect(reference);
2466
+ if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
2467
+ update();
2468
+ }
2469
+ prevRefRect = nextRefRect;
2470
+ frameId = requestAnimationFrame(frameLoop);
2471
+ }
2472
+ update();
2473
+ return () => {
2474
+ var _resizeObserver2;
2475
+ ancestors.forEach((ancestor) => {
2476
+ ancestorScroll && ancestor.removeEventListener("scroll", update);
2477
+ ancestorResize && ancestor.removeEventListener("resize", update);
2478
+ });
2479
+ cleanupIo == null || cleanupIo();
2480
+ (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
2481
+ resizeObserver = null;
2482
+ if (animationFrame) {
2483
+ cancelAnimationFrame(frameId);
2484
+ }
2485
+ };
2486
+ }
2487
+ var offset2 = offset;
2488
+ var shift2 = shift;
2489
+ var flip2 = flip;
2490
+ var size2 = size;
2491
+ var hide2 = hide;
2492
+ var arrow2 = arrow;
2493
+ var limitShift2 = limitShift;
2494
+ var computePosition2 = (reference, floating, options) => {
2495
+ const cache = /* @__PURE__ */ new Map();
2496
+ const mergedOptions = {
2497
+ platform,
2498
+ ...options
2499
+ };
2500
+ const platformWithCache = {
2501
+ ...mergedOptions.platform,
2502
+ _c: cache
2503
+ };
2504
+ return computePosition(reference, floating, {
2505
+ ...mergedOptions,
2506
+ platform: platformWithCache
2507
+ });
2508
+ };
2509
+
2510
+ // ../../node_modules/.pnpm/@floating-ui+react-dom@2.1.5_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
2511
+ import * as React13 from "react";
2512
+ import { useLayoutEffect as useLayoutEffect3 } from "react";
2513
+ import * as ReactDOM2 from "react-dom";
2514
+ var isClient = typeof document !== "undefined";
2515
+ var noop = function noop2() {
2516
+ };
2517
+ var index = isClient ? useLayoutEffect3 : noop;
2518
+ function deepEqual(a, b) {
2519
+ if (a === b) {
2520
+ return true;
2521
+ }
2522
+ if (typeof a !== typeof b) {
2523
+ return false;
2524
+ }
2525
+ if (typeof a === "function" && a.toString() === b.toString()) {
2526
+ return true;
2527
+ }
2528
+ let length;
2529
+ let i;
2530
+ let keys;
2531
+ if (a && b && typeof a === "object") {
2532
+ if (Array.isArray(a)) {
2533
+ length = a.length;
2534
+ if (length !== b.length) return false;
2535
+ for (i = length; i-- !== 0; ) {
2536
+ if (!deepEqual(a[i], b[i])) {
2537
+ return false;
2538
+ }
2539
+ }
2540
+ return true;
2541
+ }
2542
+ keys = Object.keys(a);
2543
+ length = keys.length;
2544
+ if (length !== Object.keys(b).length) {
2545
+ return false;
2546
+ }
2547
+ for (i = length; i-- !== 0; ) {
2548
+ if (!{}.hasOwnProperty.call(b, keys[i])) {
2549
+ return false;
2550
+ }
2551
+ }
2552
+ for (i = length; i-- !== 0; ) {
2553
+ const key = keys[i];
2554
+ if (key === "_owner" && a.$$typeof) {
2555
+ continue;
2556
+ }
2557
+ if (!deepEqual(a[key], b[key])) {
2558
+ return false;
2559
+ }
2560
+ }
2561
+ return true;
2562
+ }
2563
+ return a !== a && b !== b;
2564
+ }
2565
+ function getDPR(element) {
2566
+ if (typeof window === "undefined") {
2567
+ return 1;
2568
+ }
2569
+ const win = element.ownerDocument.defaultView || window;
2570
+ return win.devicePixelRatio || 1;
2571
+ }
2572
+ function roundByDPR(element, value) {
2573
+ const dpr = getDPR(element);
2574
+ return Math.round(value * dpr) / dpr;
2575
+ }
2576
+ function useLatestRef(value) {
2577
+ const ref = React13.useRef(value);
2578
+ index(() => {
2579
+ ref.current = value;
2580
+ });
2581
+ return ref;
2582
+ }
2583
+ function useFloating(options) {
2584
+ if (options === void 0) {
2585
+ options = {};
2586
+ }
2587
+ const {
2588
+ placement = "bottom",
2589
+ strategy = "absolute",
2590
+ middleware = [],
2591
+ platform: platform2,
2592
+ elements: {
2593
+ reference: externalReference,
2594
+ floating: externalFloating
2595
+ } = {},
2596
+ transform = true,
2597
+ whileElementsMounted,
2598
+ open
2599
+ } = options;
2600
+ const [data, setData] = React13.useState({
2601
+ x: 0,
2602
+ y: 0,
2603
+ strategy,
2604
+ placement,
2605
+ middlewareData: {},
2606
+ isPositioned: false
2607
+ });
2608
+ const [latestMiddleware, setLatestMiddleware] = React13.useState(middleware);
2609
+ if (!deepEqual(latestMiddleware, middleware)) {
2610
+ setLatestMiddleware(middleware);
2611
+ }
2612
+ const [_reference, _setReference] = React13.useState(null);
2613
+ const [_floating, _setFloating] = React13.useState(null);
2614
+ const setReference = React13.useCallback((node) => {
2615
+ if (node !== referenceRef.current) {
2616
+ referenceRef.current = node;
2617
+ _setReference(node);
2618
+ }
2619
+ }, []);
2620
+ const setFloating = React13.useCallback((node) => {
2621
+ if (node !== floatingRef.current) {
2622
+ floatingRef.current = node;
2623
+ _setFloating(node);
2624
+ }
2625
+ }, []);
2626
+ const referenceEl = externalReference || _reference;
2627
+ const floatingEl = externalFloating || _floating;
2628
+ const referenceRef = React13.useRef(null);
2629
+ const floatingRef = React13.useRef(null);
2630
+ const dataRef = React13.useRef(data);
2631
+ const hasWhileElementsMounted = whileElementsMounted != null;
2632
+ const whileElementsMountedRef = useLatestRef(whileElementsMounted);
2633
+ const platformRef = useLatestRef(platform2);
2634
+ const openRef = useLatestRef(open);
2635
+ const update = React13.useCallback(() => {
2636
+ if (!referenceRef.current || !floatingRef.current) {
2637
+ return;
2638
+ }
2639
+ const config = {
2640
+ placement,
2641
+ strategy,
2642
+ middleware: latestMiddleware
2643
+ };
2644
+ if (platformRef.current) {
2645
+ config.platform = platformRef.current;
2646
+ }
2647
+ computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => {
2648
+ const fullData = {
2649
+ ...data2,
2650
+ // The floating element's position may be recomputed while it's closed
2651
+ // but still mounted (such as when transitioning out). To ensure
2652
+ // `isPositioned` will be `false` initially on the next open, avoid
2653
+ // setting it to `true` when `open === false` (must be specified).
2654
+ isPositioned: openRef.current !== false
2655
+ };
2656
+ if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
2657
+ dataRef.current = fullData;
2658
+ ReactDOM2.flushSync(() => {
2659
+ setData(fullData);
2660
+ });
2661
+ }
2662
+ });
2663
+ }, [latestMiddleware, placement, strategy, platformRef, openRef]);
2664
+ index(() => {
2665
+ if (open === false && dataRef.current.isPositioned) {
2666
+ dataRef.current.isPositioned = false;
2667
+ setData((data2) => ({
2668
+ ...data2,
2669
+ isPositioned: false
2670
+ }));
2671
+ }
2672
+ }, [open]);
2673
+ const isMountedRef = React13.useRef(false);
2674
+ index(() => {
2675
+ isMountedRef.current = true;
2676
+ return () => {
2677
+ isMountedRef.current = false;
2678
+ };
2679
+ }, []);
2680
+ index(() => {
2681
+ if (referenceEl) referenceRef.current = referenceEl;
2682
+ if (floatingEl) floatingRef.current = floatingEl;
2683
+ if (referenceEl && floatingEl) {
2684
+ if (whileElementsMountedRef.current) {
2685
+ return whileElementsMountedRef.current(referenceEl, floatingEl, update);
2686
+ }
2687
+ update();
2688
+ }
2689
+ }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
2690
+ const refs = React13.useMemo(() => ({
2691
+ reference: referenceRef,
2692
+ floating: floatingRef,
2693
+ setReference,
2694
+ setFloating
2695
+ }), [setReference, setFloating]);
2696
+ const elements = React13.useMemo(() => ({
2697
+ reference: referenceEl,
2698
+ floating: floatingEl
2699
+ }), [referenceEl, floatingEl]);
2700
+ const floatingStyles = React13.useMemo(() => {
2701
+ const initialStyles = {
2702
+ position: strategy,
2703
+ left: 0,
2704
+ top: 0
2705
+ };
2706
+ if (!elements.floating) {
2707
+ return initialStyles;
2708
+ }
2709
+ const x = roundByDPR(elements.floating, data.x);
2710
+ const y = roundByDPR(elements.floating, data.y);
2711
+ if (transform) {
2712
+ return {
2713
+ ...initialStyles,
2714
+ transform: "translate(" + x + "px, " + y + "px)",
2715
+ ...getDPR(elements.floating) >= 1.5 && {
2716
+ willChange: "transform"
2717
+ }
2718
+ };
2719
+ }
2720
+ return {
2721
+ position: strategy,
2722
+ left: x,
2723
+ top: y
2724
+ };
2725
+ }, [strategy, transform, elements.floating, data.x, data.y]);
2726
+ return React13.useMemo(() => ({
2727
+ ...data,
2728
+ update,
2729
+ refs,
2730
+ elements,
2731
+ floatingStyles
2732
+ }), [data, update, refs, elements, floatingStyles]);
2733
+ }
2734
+ var arrow$1 = (options) => {
2735
+ function isRef(value) {
2736
+ return {}.hasOwnProperty.call(value, "current");
2737
+ }
2738
+ return {
2739
+ name: "arrow",
2740
+ options,
2741
+ fn(state) {
2742
+ const {
2743
+ element,
2744
+ padding
2745
+ } = typeof options === "function" ? options(state) : options;
2746
+ if (element && isRef(element)) {
2747
+ if (element.current != null) {
2748
+ return arrow2({
2749
+ element: element.current,
2750
+ padding
2751
+ }).fn(state);
2752
+ }
2753
+ return {};
2754
+ }
2755
+ if (element) {
2756
+ return arrow2({
2757
+ element,
2758
+ padding
2759
+ }).fn(state);
2760
+ }
2761
+ return {};
2762
+ }
2763
+ };
2764
+ };
2765
+ var offset3 = (options, deps) => ({
2766
+ ...offset2(options),
2767
+ options: [options, deps]
2768
+ });
2769
+ var shift3 = (options, deps) => ({
2770
+ ...shift2(options),
2771
+ options: [options, deps]
2772
+ });
2773
+ var limitShift3 = (options, deps) => ({
2774
+ ...limitShift2(options),
2775
+ options: [options, deps]
2776
+ });
2777
+ var flip3 = (options, deps) => ({
2778
+ ...flip2(options),
2779
+ options: [options, deps]
2780
+ });
2781
+ var size3 = (options, deps) => ({
2782
+ ...size2(options),
2783
+ options: [options, deps]
2784
+ });
2785
+ var hide3 = (options, deps) => ({
2786
+ ...hide2(options),
2787
+ options: [options, deps]
2788
+ });
2789
+ var arrow3 = (options, deps) => ({
2790
+ ...arrow$1(options),
2791
+ options: [options, deps]
2792
+ });
2793
+
2794
+ // ../../node_modules/.pnpm/@radix-ui+react-arrow@1.1.7_@types+react-dom@19.2.0_@types+react@19.2.0__@types+react@1_fbfac9ffba7da2430c67e19ffbb04d38/node_modules/@radix-ui/react-arrow/dist/index.mjs
2795
+ init_react_import();
2796
+ import * as React14 from "react";
2797
+ import { jsx as jsx6 } from "react/jsx-runtime";
2798
+ var NAME = "Arrow";
2799
+ var Arrow = React14.forwardRef((props, forwardedRef) => {
2800
+ const { children, width = 10, height = 5, ...arrowProps } = props;
2801
+ return /* @__PURE__ */ jsx6(
2802
+ Primitive.svg,
2803
+ {
2804
+ ...arrowProps,
2805
+ ref: forwardedRef,
2806
+ width,
2807
+ height,
2808
+ viewBox: "0 0 30 10",
2809
+ preserveAspectRatio: "none",
2810
+ children: props.asChild ? children : /* @__PURE__ */ jsx6("polygon", { points: "0,0 30,0 15,10" })
2811
+ }
2812
+ );
2813
+ });
2814
+ Arrow.displayName = NAME;
2815
+ var Root = Arrow;
2816
+
2817
+ // ../../node_modules/.pnpm/@radix-ui+react-use-size@1.1.1_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-use-size/dist/index.mjs
2818
+ init_react_import();
2819
+ import * as React15 from "react";
2820
+ function useSize(element) {
2821
+ const [size4, setSize] = React15.useState(void 0);
2822
+ useLayoutEffect2(() => {
2823
+ if (element) {
2824
+ setSize({ width: element.offsetWidth, height: element.offsetHeight });
2825
+ const resizeObserver = new ResizeObserver((entries) => {
2826
+ if (!Array.isArray(entries)) {
2827
+ return;
2828
+ }
2829
+ if (!entries.length) {
2830
+ return;
2831
+ }
2832
+ const entry = entries[0];
2833
+ let width;
2834
+ let height;
2835
+ if ("borderBoxSize" in entry) {
2836
+ const borderSizeEntry = entry["borderBoxSize"];
2837
+ const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
2838
+ width = borderSize["inlineSize"];
2839
+ height = borderSize["blockSize"];
2840
+ } else {
2841
+ width = element.offsetWidth;
2842
+ height = element.offsetHeight;
2843
+ }
2844
+ setSize({ width, height });
2845
+ });
2846
+ resizeObserver.observe(element, { box: "border-box" });
2847
+ return () => resizeObserver.unobserve(element);
2848
+ } else {
2849
+ setSize(void 0);
2850
+ }
2851
+ }, [element]);
2852
+ return size4;
2853
+ }
2854
+
2855
+ // ../../node_modules/.pnpm/@radix-ui+react-popper@1.2.8_@types+react-dom@19.2.0_@types+react@19.2.0__@types+react@_a6a7fea0f37d2b2529626c9011032658/node_modules/@radix-ui/react-popper/dist/index.mjs
2856
+ import { jsx as jsx7 } from "react/jsx-runtime";
2857
+ var POPPER_NAME = "Popper";
2858
+ var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
2859
+ var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
2860
+ var Popper = (props) => {
2861
+ const { __scopePopper, children } = props;
2862
+ const [anchor, setAnchor] = React16.useState(null);
2863
+ return /* @__PURE__ */ jsx7(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
2864
+ };
2865
+ Popper.displayName = POPPER_NAME;
2866
+ var ANCHOR_NAME = "PopperAnchor";
2867
+ var PopperAnchor = React16.forwardRef(
2868
+ (props, forwardedRef) => {
2869
+ const { __scopePopper, virtualRef, ...anchorProps } = props;
2870
+ const context = usePopperContext(ANCHOR_NAME, __scopePopper);
2871
+ const ref = React16.useRef(null);
2872
+ const composedRefs = useComposedRefs(forwardedRef, ref);
2873
+ const anchorRef = React16.useRef(null);
2874
+ React16.useEffect(() => {
2875
+ const previousAnchor = anchorRef.current;
2876
+ anchorRef.current = virtualRef?.current || ref.current;
2877
+ if (previousAnchor !== anchorRef.current) {
2878
+ context.onAnchorChange(anchorRef.current);
2879
+ }
2880
+ });
2881
+ return virtualRef ? null : /* @__PURE__ */ jsx7(Primitive.div, { ...anchorProps, ref: composedRefs });
2882
+ }
2883
+ );
2884
+ PopperAnchor.displayName = ANCHOR_NAME;
2885
+ var CONTENT_NAME = "PopperContent";
2886
+ var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
2887
+ var PopperContent = React16.forwardRef(
2888
+ (props, forwardedRef) => {
2889
+ const {
2890
+ __scopePopper,
2891
+ side = "bottom",
2892
+ sideOffset = 0,
2893
+ align = "center",
2894
+ alignOffset = 0,
2895
+ arrowPadding = 0,
2896
+ avoidCollisions = true,
2897
+ collisionBoundary = [],
2898
+ collisionPadding: collisionPaddingProp = 0,
2899
+ sticky = "partial",
2900
+ hideWhenDetached = false,
2901
+ updatePositionStrategy = "optimized",
2902
+ onPlaced,
2903
+ ...contentProps
2904
+ } = props;
2905
+ const context = usePopperContext(CONTENT_NAME, __scopePopper);
2906
+ const [content, setContent] = React16.useState(null);
2907
+ const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
2908
+ const [arrow4, setArrow] = React16.useState(null);
2909
+ const arrowSize = useSize(arrow4);
2910
+ const arrowWidth = arrowSize?.width ?? 0;
2911
+ const arrowHeight = arrowSize?.height ?? 0;
2912
+ const desiredPlacement = side + (align !== "center" ? "-" + align : "");
2913
+ const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };
2914
+ const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];
2915
+ const hasExplicitBoundaries = boundary.length > 0;
2916
+ const detectOverflowOptions = {
2917
+ padding: collisionPadding,
2918
+ boundary: boundary.filter(isNotNull),
2919
+ // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
2920
+ altBoundary: hasExplicitBoundaries
2921
+ };
2922
+ const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({
2923
+ // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
2924
+ strategy: "fixed",
2925
+ placement: desiredPlacement,
2926
+ whileElementsMounted: (...args) => {
2927
+ const cleanup = autoUpdate(...args, {
2928
+ animationFrame: updatePositionStrategy === "always"
2929
+ });
2930
+ return cleanup;
2931
+ },
2932
+ elements: {
2933
+ reference: context.anchor
2934
+ },
2935
+ middleware: [
2936
+ offset3({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),
2937
+ avoidCollisions && shift3({
2938
+ mainAxis: true,
2939
+ crossAxis: false,
2940
+ limiter: sticky === "partial" ? limitShift3() : void 0,
2941
+ ...detectOverflowOptions
2942
+ }),
2943
+ avoidCollisions && flip3({ ...detectOverflowOptions }),
2944
+ size3({
2945
+ ...detectOverflowOptions,
2946
+ apply: ({ elements, rects, availableWidth, availableHeight }) => {
2947
+ const { width: anchorWidth, height: anchorHeight } = rects.reference;
2948
+ const contentStyle = elements.floating.style;
2949
+ contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
2950
+ contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`);
2951
+ contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`);
2952
+ contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
2953
+ }
2954
+ }),
2955
+ arrow4 && arrow3({ element: arrow4, padding: arrowPadding }),
2956
+ transformOrigin({ arrowWidth, arrowHeight }),
2957
+ hideWhenDetached && hide3({ strategy: "referenceHidden", ...detectOverflowOptions })
2958
+ ]
2959
+ });
2960
+ const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
2961
+ const handlePlaced = useCallbackRef(onPlaced);
2962
+ useLayoutEffect2(() => {
2963
+ if (isPositioned) {
2964
+ handlePlaced?.();
2965
+ }
2966
+ }, [isPositioned, handlePlaced]);
2967
+ const arrowX = middlewareData.arrow?.x;
2968
+ const arrowY = middlewareData.arrow?.y;
2969
+ const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
2970
+ const [contentZIndex, setContentZIndex] = React16.useState();
2971
+ useLayoutEffect2(() => {
2972
+ if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
2973
+ }, [content]);
2974
+ return /* @__PURE__ */ jsx7(
2975
+ "div",
2976
+ {
2977
+ ref: refs.setFloating,
2978
+ "data-radix-popper-content-wrapper": "",
2979
+ style: {
2980
+ ...floatingStyles,
2981
+ transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)",
2982
+ // keep off the page when measuring
2983
+ minWidth: "max-content",
2984
+ zIndex: contentZIndex,
2985
+ ["--radix-popper-transform-origin"]: [
2986
+ middlewareData.transformOrigin?.x,
2987
+ middlewareData.transformOrigin?.y
2988
+ ].join(" "),
2989
+ // hide the content if using the hide middleware and should be hidden
2990
+ // set visibility to hidden and disable pointer events so the UI behaves
2991
+ // as if the PopperContent isn't there at all
2992
+ ...middlewareData.hide?.referenceHidden && {
2993
+ visibility: "hidden",
2994
+ pointerEvents: "none"
2995
+ }
2996
+ },
2997
+ dir: props.dir,
2998
+ children: /* @__PURE__ */ jsx7(
2999
+ PopperContentProvider,
3000
+ {
3001
+ scope: __scopePopper,
3002
+ placedSide,
3003
+ onArrowChange: setArrow,
3004
+ arrowX,
3005
+ arrowY,
3006
+ shouldHideArrow: cannotCenterArrow,
3007
+ children: /* @__PURE__ */ jsx7(
3008
+ Primitive.div,
3009
+ {
3010
+ "data-side": placedSide,
3011
+ "data-align": placedAlign,
3012
+ ...contentProps,
3013
+ ref: composedRefs,
3014
+ style: {
3015
+ ...contentProps.style,
3016
+ // if the PopperContent hasn't been placed yet (not all measurements done)
3017
+ // we prevent animations so that users's animation don't kick in too early referring wrong sides
3018
+ animation: !isPositioned ? "none" : void 0
3019
+ }
3020
+ }
3021
+ )
3022
+ }
3023
+ )
3024
+ }
3025
+ );
3026
+ }
3027
+ );
3028
+ PopperContent.displayName = CONTENT_NAME;
3029
+ var ARROW_NAME = "PopperArrow";
3030
+ var OPPOSITE_SIDE = {
3031
+ top: "bottom",
3032
+ right: "left",
3033
+ bottom: "top",
3034
+ left: "right"
3035
+ };
3036
+ var PopperArrow = React16.forwardRef(function PopperArrow2(props, forwardedRef) {
3037
+ const { __scopePopper, ...arrowProps } = props;
3038
+ const contentContext = useContentContext(ARROW_NAME, __scopePopper);
3039
+ const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
3040
+ return (
3041
+ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
3042
+ // doesn't report size as we'd expect on SVG elements.
3043
+ // it reports their bounding box which is effectively the largest path inside the SVG.
3044
+ /* @__PURE__ */ jsx7(
3045
+ "span",
3046
+ {
3047
+ ref: contentContext.onArrowChange,
3048
+ style: {
3049
+ position: "absolute",
3050
+ left: contentContext.arrowX,
3051
+ top: contentContext.arrowY,
3052
+ [baseSide]: 0,
3053
+ transformOrigin: {
3054
+ top: "",
3055
+ right: "0 0",
3056
+ bottom: "center 0",
3057
+ left: "100% 0"
3058
+ }[contentContext.placedSide],
3059
+ transform: {
3060
+ top: "translateY(100%)",
3061
+ right: "translateY(50%) rotate(90deg) translateX(-50%)",
3062
+ bottom: `rotate(180deg)`,
3063
+ left: "translateY(50%) rotate(-90deg) translateX(50%)"
3064
+ }[contentContext.placedSide],
3065
+ visibility: contentContext.shouldHideArrow ? "hidden" : void 0
3066
+ },
3067
+ children: /* @__PURE__ */ jsx7(
3068
+ Root,
3069
+ {
3070
+ ...arrowProps,
3071
+ ref: forwardedRef,
3072
+ style: {
3073
+ ...arrowProps.style,
3074
+ // ensures the element can be measured correctly (mostly for if SVG)
3075
+ display: "block"
3076
+ }
3077
+ }
3078
+ )
3079
+ }
3080
+ )
3081
+ );
3082
+ });
3083
+ PopperArrow.displayName = ARROW_NAME;
3084
+ function isNotNull(value) {
3085
+ return value !== null;
3086
+ }
3087
+ var transformOrigin = (options) => ({
3088
+ name: "transformOrigin",
3089
+ options,
3090
+ fn(data) {
3091
+ const { placement, rects, middlewareData } = data;
3092
+ const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
3093
+ const isArrowHidden = cannotCenterArrow;
3094
+ const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
3095
+ const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
3096
+ const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
3097
+ const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign];
3098
+ const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
3099
+ const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
3100
+ let x = "";
3101
+ let y = "";
3102
+ if (placedSide === "bottom") {
3103
+ x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
3104
+ y = `${-arrowHeight}px`;
3105
+ } else if (placedSide === "top") {
3106
+ x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
3107
+ y = `${rects.floating.height + arrowHeight}px`;
3108
+ } else if (placedSide === "right") {
3109
+ x = `${-arrowHeight}px`;
3110
+ y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
3111
+ } else if (placedSide === "left") {
3112
+ x = `${rects.floating.width + arrowHeight}px`;
3113
+ y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
3114
+ }
3115
+ return { data: { x, y } };
3116
+ }
3117
+ });
3118
+ function getSideAndAlignFromPlacement(placement) {
3119
+ const [side, align = "center"] = placement.split("-");
3120
+ return [side, align];
3121
+ }
3122
+ var Root2 = Popper;
3123
+ var Anchor = PopperAnchor;
3124
+ var Content = PopperContent;
3125
+ var Arrow2 = PopperArrow;
3126
+
3127
+ // ../../node_modules/.pnpm/@radix-ui+react-portal@1.1.9_@types+react-dom@19.2.0_@types+react@19.2.0__@types+react@_d5762485d50ad8dfa8cb627e2e59c867/node_modules/@radix-ui/react-portal/dist/index.mjs
3128
+ init_react_import();
3129
+ import * as React17 from "react";
3130
+ import ReactDOM3 from "react-dom";
3131
+ import { jsx as jsx8 } from "react/jsx-runtime";
3132
+ var PORTAL_NAME = "Portal";
3133
+ var Portal = React17.forwardRef((props, forwardedRef) => {
3134
+ const { container: containerProp, ...portalProps } = props;
3135
+ const [mounted, setMounted] = React17.useState(false);
3136
+ useLayoutEffect2(() => setMounted(true), []);
3137
+ const container = containerProp || mounted && globalThis?.document?.body;
3138
+ return container ? ReactDOM3.createPortal(/* @__PURE__ */ jsx8(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
3139
+ });
3140
+ Portal.displayName = PORTAL_NAME;
3141
+
3142
+ // ../../node_modules/.pnpm/@radix-ui+react-presence@1.1.5_@types+react-dom@19.2.0_@types+react@19.2.0__@types+reac_2bd60694cdd2d52fd7a4d143c1d68333/node_modules/@radix-ui/react-presence/dist/index.mjs
3143
+ init_react_import();
3144
+ import * as React22 from "react";
3145
+ import * as React18 from "react";
3146
+ function useStateMachine(initialState, machine) {
3147
+ return React18.useReducer((state, event) => {
3148
+ const nextState = machine[state][event];
3149
+ return nextState ?? state;
3150
+ }, initialState);
3151
+ }
3152
+ var Presence = (props) => {
3153
+ const { present, children } = props;
3154
+ const presence = usePresence(present);
3155
+ const child = typeof children === "function" ? children({ present: presence.isPresent }) : React22.Children.only(children);
3156
+ const ref = useComposedRefs(presence.ref, getElementRef2(child));
3157
+ const forceMount = typeof children === "function";
3158
+ return forceMount || presence.isPresent ? React22.cloneElement(child, { ref }) : null;
3159
+ };
3160
+ Presence.displayName = "Presence";
3161
+ function usePresence(present) {
3162
+ const [node, setNode] = React22.useState();
3163
+ const stylesRef = React22.useRef(null);
3164
+ const prevPresentRef = React22.useRef(present);
3165
+ const prevAnimationNameRef = React22.useRef("none");
3166
+ const initialState = present ? "mounted" : "unmounted";
3167
+ const [state, send] = useStateMachine(initialState, {
3168
+ mounted: {
3169
+ UNMOUNT: "unmounted",
3170
+ ANIMATION_OUT: "unmountSuspended"
3171
+ },
3172
+ unmountSuspended: {
3173
+ MOUNT: "mounted",
3174
+ ANIMATION_END: "unmounted"
3175
+ },
3176
+ unmounted: {
3177
+ MOUNT: "mounted"
3178
+ }
3179
+ });
3180
+ React22.useEffect(() => {
3181
+ const currentAnimationName = getAnimationName(stylesRef.current);
3182
+ prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
3183
+ }, [state]);
3184
+ useLayoutEffect2(() => {
3185
+ const styles = stylesRef.current;
3186
+ const wasPresent = prevPresentRef.current;
3187
+ const hasPresentChanged = wasPresent !== present;
3188
+ if (hasPresentChanged) {
3189
+ const prevAnimationName = prevAnimationNameRef.current;
3190
+ const currentAnimationName = getAnimationName(styles);
3191
+ if (present) {
3192
+ send("MOUNT");
3193
+ } else if (currentAnimationName === "none" || styles?.display === "none") {
3194
+ send("UNMOUNT");
3195
+ } else {
3196
+ const isAnimating = prevAnimationName !== currentAnimationName;
3197
+ if (wasPresent && isAnimating) {
3198
+ send("ANIMATION_OUT");
3199
+ } else {
3200
+ send("UNMOUNT");
3201
+ }
3202
+ }
3203
+ prevPresentRef.current = present;
3204
+ }
3205
+ }, [present, send]);
3206
+ useLayoutEffect2(() => {
3207
+ if (node) {
3208
+ let timeoutId;
3209
+ const ownerWindow = node.ownerDocument.defaultView ?? window;
3210
+ const handleAnimationEnd = (event) => {
3211
+ const currentAnimationName = getAnimationName(stylesRef.current);
3212
+ const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
3213
+ if (event.target === node && isCurrentAnimation) {
3214
+ send("ANIMATION_END");
3215
+ if (!prevPresentRef.current) {
3216
+ const currentFillMode = node.style.animationFillMode;
3217
+ node.style.animationFillMode = "forwards";
3218
+ timeoutId = ownerWindow.setTimeout(() => {
3219
+ if (node.style.animationFillMode === "forwards") {
3220
+ node.style.animationFillMode = currentFillMode;
3221
+ }
3222
+ });
3223
+ }
3224
+ }
3225
+ };
3226
+ const handleAnimationStart = (event) => {
3227
+ if (event.target === node) {
3228
+ prevAnimationNameRef.current = getAnimationName(stylesRef.current);
3229
+ }
3230
+ };
3231
+ node.addEventListener("animationstart", handleAnimationStart);
3232
+ node.addEventListener("animationcancel", handleAnimationEnd);
3233
+ node.addEventListener("animationend", handleAnimationEnd);
3234
+ return () => {
3235
+ ownerWindow.clearTimeout(timeoutId);
3236
+ node.removeEventListener("animationstart", handleAnimationStart);
3237
+ node.removeEventListener("animationcancel", handleAnimationEnd);
3238
+ node.removeEventListener("animationend", handleAnimationEnd);
3239
+ };
3240
+ } else {
3241
+ send("ANIMATION_END");
3242
+ }
3243
+ }, [node, send]);
3244
+ return {
3245
+ isPresent: ["mounted", "unmountSuspended"].includes(state),
3246
+ ref: React22.useCallback((node2) => {
3247
+ stylesRef.current = node2 ? getComputedStyle(node2) : null;
3248
+ setNode(node2);
3249
+ }, [])
3250
+ };
3251
+ }
3252
+ function getAnimationName(styles) {
3253
+ return styles?.animationName || "none";
3254
+ }
3255
+ function getElementRef2(element) {
3256
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
3257
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
3258
+ if (mayWarn) {
3259
+ return element.ref;
3260
+ }
3261
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
3262
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
3263
+ if (mayWarn) {
3264
+ return element.props.ref;
3265
+ }
3266
+ return element.props.ref || element.ref;
3267
+ }
3268
+
3269
+ // ../../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
3270
+ init_react_import();
3271
+ import * as React19 from "react";
3272
+ import * as React23 from "react";
3273
+ var useInsertionEffect = React19[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
3274
+ function useControllableState({
3275
+ prop,
3276
+ defaultProp,
3277
+ onChange = () => {
3278
+ },
3279
+ caller
3280
+ }) {
3281
+ const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
3282
+ defaultProp,
3283
+ onChange
3284
+ });
3285
+ const isControlled = prop !== void 0;
3286
+ const value = isControlled ? prop : uncontrolledProp;
3287
+ if (true) {
3288
+ const isControlledRef = React19.useRef(prop !== void 0);
3289
+ React19.useEffect(() => {
3290
+ const wasControlled = isControlledRef.current;
3291
+ if (wasControlled !== isControlled) {
3292
+ const from = wasControlled ? "controlled" : "uncontrolled";
3293
+ const to = isControlled ? "controlled" : "uncontrolled";
3294
+ console.warn(
3295
+ `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
3296
+ );
3297
+ }
3298
+ isControlledRef.current = isControlled;
3299
+ }, [isControlled, caller]);
3300
+ }
3301
+ const setValue = React19.useCallback(
3302
+ (nextValue) => {
3303
+ if (isControlled) {
3304
+ const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
3305
+ if (value2 !== prop) {
3306
+ onChangeRef.current?.(value2);
3307
+ }
3308
+ } else {
3309
+ setUncontrolledProp(nextValue);
3310
+ }
3311
+ },
3312
+ [isControlled, prop, setUncontrolledProp, onChangeRef]
3313
+ );
3314
+ return [value, setValue];
3315
+ }
3316
+ function useUncontrolledState({
3317
+ defaultProp,
3318
+ onChange
3319
+ }) {
3320
+ const [value, setValue] = React19.useState(defaultProp);
3321
+ const prevValueRef = React19.useRef(value);
3322
+ const onChangeRef = React19.useRef(onChange);
3323
+ useInsertionEffect(() => {
3324
+ onChangeRef.current = onChange;
3325
+ }, [onChange]);
3326
+ React19.useEffect(() => {
3327
+ if (prevValueRef.current !== value) {
3328
+ onChangeRef.current?.(value);
3329
+ prevValueRef.current = value;
3330
+ }
3331
+ }, [value, prevValueRef]);
3332
+ return [value, setValue, onChangeRef];
3333
+ }
3334
+ function isFunction(value) {
3335
+ return typeof value === "function";
3336
+ }
3337
+ var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
3338
+
3339
+ // ../../node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js
3340
+ init_react_import();
3341
+ var getDefaultParent = function(originalTarget) {
3342
+ if (typeof document === "undefined") {
3343
+ return null;
3344
+ }
3345
+ var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
3346
+ return sampleTarget.ownerDocument.body;
3347
+ };
3348
+ var counterMap = /* @__PURE__ */ new WeakMap();
3349
+ var uncontrolledNodes = /* @__PURE__ */ new WeakMap();
3350
+ var markerMap = {};
3351
+ var lockCount = 0;
3352
+ var unwrapHost = function(node) {
3353
+ return node && (node.host || unwrapHost(node.parentNode));
3354
+ };
3355
+ var correctTargets = function(parent, targets) {
3356
+ return targets.map(function(target) {
3357
+ if (parent.contains(target)) {
3358
+ return target;
3359
+ }
3360
+ var correctedTarget = unwrapHost(target);
3361
+ if (correctedTarget && parent.contains(correctedTarget)) {
3362
+ return correctedTarget;
3363
+ }
3364
+ console.error("aria-hidden", target, "in not contained inside", parent, ". Doing nothing");
3365
+ return null;
3366
+ }).filter(function(x) {
3367
+ return Boolean(x);
3368
+ });
3369
+ };
3370
+ var applyAttributeToOthers = function(originalTarget, parentNode, markerName, controlAttribute) {
3371
+ var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
3372
+ if (!markerMap[markerName]) {
3373
+ markerMap[markerName] = /* @__PURE__ */ new WeakMap();
3374
+ }
3375
+ var markerCounter = markerMap[markerName];
3376
+ var hiddenNodes = [];
3377
+ var elementsToKeep = /* @__PURE__ */ new Set();
3378
+ var elementsToStop = new Set(targets);
3379
+ var keep = function(el) {
3380
+ if (!el || elementsToKeep.has(el)) {
3381
+ return;
3382
+ }
3383
+ elementsToKeep.add(el);
3384
+ keep(el.parentNode);
3385
+ };
3386
+ targets.forEach(keep);
3387
+ var deep = function(parent) {
3388
+ if (!parent || elementsToStop.has(parent)) {
3389
+ return;
3390
+ }
3391
+ Array.prototype.forEach.call(parent.children, function(node) {
3392
+ if (elementsToKeep.has(node)) {
3393
+ deep(node);
3394
+ } else {
3395
+ try {
3396
+ var attr = node.getAttribute(controlAttribute);
3397
+ var alreadyHidden = attr !== null && attr !== "false";
3398
+ var counterValue = (counterMap.get(node) || 0) + 1;
3399
+ var markerValue = (markerCounter.get(node) || 0) + 1;
3400
+ counterMap.set(node, counterValue);
3401
+ markerCounter.set(node, markerValue);
3402
+ hiddenNodes.push(node);
3403
+ if (counterValue === 1 && alreadyHidden) {
3404
+ uncontrolledNodes.set(node, true);
3405
+ }
3406
+ if (markerValue === 1) {
3407
+ node.setAttribute(markerName, "true");
3408
+ }
3409
+ if (!alreadyHidden) {
3410
+ node.setAttribute(controlAttribute, "true");
3411
+ }
3412
+ } catch (e) {
3413
+ console.error("aria-hidden: cannot operate on ", node, e);
3414
+ }
3415
+ }
3416
+ });
3417
+ };
3418
+ deep(parentNode);
3419
+ elementsToKeep.clear();
3420
+ lockCount++;
3421
+ return function() {
3422
+ hiddenNodes.forEach(function(node) {
3423
+ var counterValue = counterMap.get(node) - 1;
3424
+ var markerValue = markerCounter.get(node) - 1;
3425
+ counterMap.set(node, counterValue);
3426
+ markerCounter.set(node, markerValue);
3427
+ if (!counterValue) {
3428
+ if (!uncontrolledNodes.has(node)) {
3429
+ node.removeAttribute(controlAttribute);
3430
+ }
3431
+ uncontrolledNodes.delete(node);
3432
+ }
3433
+ if (!markerValue) {
3434
+ node.removeAttribute(markerName);
3435
+ }
3436
+ });
3437
+ lockCount--;
3438
+ if (!lockCount) {
3439
+ counterMap = /* @__PURE__ */ new WeakMap();
3440
+ counterMap = /* @__PURE__ */ new WeakMap();
3441
+ uncontrolledNodes = /* @__PURE__ */ new WeakMap();
3442
+ markerMap = {};
3443
+ }
3444
+ };
3445
+ };
3446
+ var hideOthers = function(originalTarget, parentNode, markerName) {
3447
+ if (markerName === void 0) {
3448
+ markerName = "data-aria-hidden";
3449
+ }
3450
+ var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
3451
+ var activeParentNode = parentNode || getDefaultParent(originalTarget);
3452
+ if (!activeParentNode) {
3453
+ return function() {
3454
+ return null;
3455
+ };
3456
+ }
3457
+ targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll("[aria-live], script")));
3458
+ return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
3459
+ };
3460
+
3461
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/index.js
3462
+ init_react_import();
3463
+
3464
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/Combination.js
3465
+ init_react_import();
3466
+
3467
+ // ../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs
3468
+ init_react_import();
3469
+ var __assign = function() {
3470
+ __assign = Object.assign || function __assign2(t) {
3471
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
3472
+ s = arguments[i];
3473
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
3474
+ }
3475
+ return t;
3476
+ };
3477
+ return __assign.apply(this, arguments);
3478
+ };
3479
+ function __rest(s, e) {
3480
+ var t = {};
3481
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
3482
+ t[p] = s[p];
3483
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
3484
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
3485
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
3486
+ t[p[i]] = s[p[i]];
3487
+ }
3488
+ return t;
3489
+ }
3490
+ function __spreadArray(to, from, pack) {
3491
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3492
+ if (ar || !(i in from)) {
3493
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
3494
+ ar[i] = from[i];
3495
+ }
3496
+ }
3497
+ return to.concat(ar || Array.prototype.slice.call(from));
3498
+ }
3499
+
3500
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/Combination.js
3501
+ import * as React28 from "react";
3502
+
3503
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/UI.js
3504
+ init_react_import();
3505
+ import * as React24 from "react";
3506
+
3507
+ // ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll-bar/dist/es2015/constants.js
3508
+ init_react_import();
3509
+ var zeroRightClassName = "right-scroll-bar-position";
3510
+ var fullWidthClassName = "width-before-scroll-bar";
3511
+ var noScrollbarsClassName = "with-scroll-bars-hidden";
3512
+ var removedBarSizeVariable = "--removed-body-scroll-bar-size";
3513
+
3514
+ // ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.2.0_react@19.2.8/node_modules/use-callback-ref/dist/es2015/index.js
3515
+ init_react_import();
3516
+
3517
+ // ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.2.0_react@19.2.8/node_modules/use-callback-ref/dist/es2015/assignRef.js
3518
+ init_react_import();
3519
+ function assignRef(ref, value) {
3520
+ if (typeof ref === "function") {
3521
+ ref(value);
3522
+ } else if (ref) {
3523
+ ref.current = value;
3524
+ }
3525
+ return ref;
3526
+ }
3527
+
3528
+ // ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.2.0_react@19.2.8/node_modules/use-callback-ref/dist/es2015/useRef.js
3529
+ init_react_import();
3530
+ import { useState as useState10 } from "react";
3531
+ function useCallbackRef2(initialValue, callback) {
3532
+ var ref = useState10(function() {
3533
+ return {
3534
+ // value
3535
+ value: initialValue,
3536
+ // last callback
3537
+ callback,
3538
+ // "memoized" public interface
3539
+ facade: {
3540
+ get current() {
3541
+ return ref.value;
3542
+ },
3543
+ set current(value) {
3544
+ var last = ref.value;
3545
+ if (last !== value) {
3546
+ ref.value = value;
3547
+ ref.callback(value, last);
3548
+ }
3549
+ }
3550
+ }
3551
+ };
3552
+ })[0];
3553
+ ref.callback = callback;
3554
+ return ref.facade;
3555
+ }
3556
+
3557
+ // ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.2.0_react@19.2.8/node_modules/use-callback-ref/dist/es2015/useMergeRef.js
3558
+ init_react_import();
3559
+ import * as React20 from "react";
3560
+ var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React20.useLayoutEffect : React20.useEffect;
3561
+ var currentValues = /* @__PURE__ */ new WeakMap();
3562
+ function useMergeRefs(refs, defaultValue) {
3563
+ var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
3564
+ return refs.forEach(function(ref) {
3565
+ return assignRef(ref, newValue);
3566
+ });
3567
+ });
3568
+ useIsomorphicLayoutEffect(function() {
3569
+ var oldValue = currentValues.get(callbackRef);
3570
+ if (oldValue) {
3571
+ var prevRefs_1 = new Set(oldValue);
3572
+ var nextRefs_1 = new Set(refs);
3573
+ var current_1 = callbackRef.current;
3574
+ prevRefs_1.forEach(function(ref) {
3575
+ if (!nextRefs_1.has(ref)) {
3576
+ assignRef(ref, null);
3577
+ }
3578
+ });
3579
+ nextRefs_1.forEach(function(ref) {
3580
+ if (!prevRefs_1.has(ref)) {
3581
+ assignRef(ref, current_1);
3582
+ }
3583
+ });
3584
+ }
3585
+ currentValues.set(callbackRef, refs);
3586
+ }, [refs]);
3587
+ return callbackRef;
3588
+ }
3589
+
3590
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/medium.js
3591
+ init_react_import();
3592
+
3593
+ // ../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.2.0_react@19.2.8/node_modules/use-sidecar/dist/es2015/index.js
3594
+ init_react_import();
3595
+
3596
+ // ../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.2.0_react@19.2.8/node_modules/use-sidecar/dist/es2015/medium.js
3597
+ init_react_import();
3598
+ function ItoI(a) {
3599
+ return a;
3600
+ }
3601
+ function innerCreateMedium(defaults, middleware) {
3602
+ if (middleware === void 0) {
3603
+ middleware = ItoI;
3604
+ }
3605
+ var buffer = [];
3606
+ var assigned = false;
3607
+ var medium = {
3608
+ read: function() {
3609
+ if (assigned) {
3610
+ throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
3611
+ }
3612
+ if (buffer.length) {
3613
+ return buffer[buffer.length - 1];
3614
+ }
3615
+ return defaults;
3616
+ },
3617
+ useMedium: function(data) {
3618
+ var item = middleware(data, assigned);
3619
+ buffer.push(item);
3620
+ return function() {
3621
+ buffer = buffer.filter(function(x) {
3622
+ return x !== item;
3623
+ });
3624
+ };
3625
+ },
3626
+ assignSyncMedium: function(cb) {
3627
+ assigned = true;
3628
+ while (buffer.length) {
3629
+ var cbs = buffer;
3630
+ buffer = [];
3631
+ cbs.forEach(cb);
3632
+ }
3633
+ buffer = {
3634
+ push: function(x) {
3635
+ return cb(x);
3636
+ },
3637
+ filter: function() {
3638
+ return buffer;
3639
+ }
3640
+ };
3641
+ },
3642
+ assignMedium: function(cb) {
3643
+ assigned = true;
3644
+ var pendingQueue = [];
3645
+ if (buffer.length) {
3646
+ var cbs = buffer;
3647
+ buffer = [];
3648
+ cbs.forEach(cb);
3649
+ pendingQueue = buffer;
3650
+ }
3651
+ var executeQueue = function() {
3652
+ var cbs2 = pendingQueue;
3653
+ pendingQueue = [];
3654
+ cbs2.forEach(cb);
3655
+ };
3656
+ var cycle = function() {
3657
+ return Promise.resolve().then(executeQueue);
3658
+ };
3659
+ cycle();
3660
+ buffer = {
3661
+ push: function(x) {
3662
+ pendingQueue.push(x);
3663
+ cycle();
3664
+ },
3665
+ filter: function(filter) {
3666
+ pendingQueue = pendingQueue.filter(filter);
3667
+ return buffer;
3668
+ }
3669
+ };
3670
+ }
3671
+ };
3672
+ return medium;
3673
+ }
3674
+ function createSidecarMedium(options) {
3675
+ if (options === void 0) {
3676
+ options = {};
3677
+ }
3678
+ var medium = innerCreateMedium(null);
3679
+ medium.options = __assign({ async: true, ssr: false }, options);
3680
+ return medium;
3681
+ }
3682
+
3683
+ // ../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.2.0_react@19.2.8/node_modules/use-sidecar/dist/es2015/exports.js
3684
+ init_react_import();
3685
+ import * as React21 from "react";
3686
+ var SideCar = function(_a) {
3687
+ var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
3688
+ if (!sideCar) {
3689
+ throw new Error("Sidecar: please provide `sideCar` property to import the right car");
3690
+ }
3691
+ var Target = sideCar.read();
3692
+ if (!Target) {
3693
+ throw new Error("Sidecar medium not found");
3694
+ }
3695
+ return React21.createElement(Target, __assign({}, rest));
3696
+ };
3697
+ SideCar.isSideCarExport = true;
3698
+ function exportSidecar(medium, exported) {
3699
+ medium.useMedium(exported);
3700
+ return SideCar;
3701
+ }
3702
+
3703
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/medium.js
3704
+ var effectCar = createSidecarMedium();
3705
+
3706
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/UI.js
3707
+ var nothing = function() {
3708
+ return;
3709
+ };
3710
+ var RemoveScroll = React24.forwardRef(function(props, parentRef) {
3711
+ var ref = React24.useRef(null);
3712
+ var _a = React24.useState({
3713
+ onScrollCapture: nothing,
3714
+ onWheelCapture: nothing,
3715
+ onTouchMoveCapture: nothing
3716
+ }), callbacks = _a[0], setCallbacks = _a[1];
3717
+ var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? "div" : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
3718
+ var SideCar2 = sideCar;
3719
+ var containerRef = useMergeRefs([ref, parentRef]);
3720
+ var containerProps = __assign(__assign({}, rest), callbacks);
3721
+ return React24.createElement(
3722
+ React24.Fragment,
3723
+ null,
3724
+ enabled && React24.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
3725
+ forwardProps ? React24.cloneElement(React24.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React24.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
3726
+ );
3727
+ });
3728
+ RemoveScroll.defaultProps = {
3729
+ enabled: true,
3730
+ removeScrollBar: true,
3731
+ inert: false
3732
+ };
3733
+ RemoveScroll.classNames = {
3734
+ fullWidth: fullWidthClassName,
3735
+ zeroRight: zeroRightClassName
3736
+ };
3737
+
3738
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/sidecar.js
3739
+ init_react_import();
3740
+
3741
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
3742
+ init_react_import();
3743
+ import * as React27 from "react";
3744
+
3745
+ // ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll-bar/dist/es2015/index.js
3746
+ init_react_import();
3747
+
3748
+ // ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll-bar/dist/es2015/component.js
3749
+ init_react_import();
3750
+ import * as React26 from "react";
3751
+
3752
+ // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.2.0_react@19.2.8/node_modules/react-style-singleton/dist/es2015/index.js
3753
+ init_react_import();
3754
+
3755
+ // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.2.0_react@19.2.8/node_modules/react-style-singleton/dist/es2015/component.js
3756
+ init_react_import();
3757
+
3758
+ // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.2.0_react@19.2.8/node_modules/react-style-singleton/dist/es2015/hook.js
3759
+ init_react_import();
3760
+ import * as React25 from "react";
3761
+
3762
+ // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.2.0_react@19.2.8/node_modules/react-style-singleton/dist/es2015/singleton.js
3763
+ init_react_import();
3764
+
3765
+ // ../../node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js
3766
+ init_react_import();
3767
+ var currentNonce;
3768
+ var getNonce = function() {
3769
+ if (currentNonce) {
3770
+ return currentNonce;
3771
+ }
3772
+ if (typeof __webpack_nonce__ !== "undefined") {
3773
+ return __webpack_nonce__;
3774
+ }
3775
+ return void 0;
3776
+ };
3777
+
3778
+ // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.2.0_react@19.2.8/node_modules/react-style-singleton/dist/es2015/singleton.js
3779
+ function makeStyleTag() {
3780
+ if (!document)
3781
+ return null;
3782
+ var tag = document.createElement("style");
3783
+ tag.type = "text/css";
3784
+ var nonce = getNonce();
3785
+ if (nonce) {
3786
+ tag.setAttribute("nonce", nonce);
3787
+ }
3788
+ return tag;
3789
+ }
3790
+ function injectStyles(tag, css) {
3791
+ if (tag.styleSheet) {
3792
+ tag.styleSheet.cssText = css;
3793
+ } else {
3794
+ tag.appendChild(document.createTextNode(css));
3795
+ }
3796
+ }
3797
+ function insertStyleTag(tag) {
3798
+ var head = document.head || document.getElementsByTagName("head")[0];
3799
+ head.appendChild(tag);
3800
+ }
3801
+ var stylesheetSingleton = function() {
3802
+ var counter = 0;
3803
+ var stylesheet = null;
3804
+ return {
3805
+ add: function(style) {
3806
+ if (counter == 0) {
3807
+ if (stylesheet = makeStyleTag()) {
3808
+ injectStyles(stylesheet, style);
3809
+ insertStyleTag(stylesheet);
3810
+ }
3811
+ }
3812
+ counter++;
3813
+ },
3814
+ remove: function() {
3815
+ counter--;
3816
+ if (!counter && stylesheet) {
3817
+ stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
3818
+ stylesheet = null;
3819
+ }
3820
+ }
3821
+ };
3822
+ };
3823
+
3824
+ // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.2.0_react@19.2.8/node_modules/react-style-singleton/dist/es2015/hook.js
3825
+ var styleHookSingleton = function() {
3826
+ var sheet = stylesheetSingleton();
3827
+ return function(styles, isDynamic) {
3828
+ React25.useEffect(function() {
3829
+ sheet.add(styles);
3830
+ return function() {
3831
+ sheet.remove();
3832
+ };
3833
+ }, [styles && isDynamic]);
3834
+ };
3835
+ };
3836
+
3837
+ // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.2.0_react@19.2.8/node_modules/react-style-singleton/dist/es2015/component.js
3838
+ var styleSingleton = function() {
3839
+ var useStyle = styleHookSingleton();
3840
+ var Sheet = function(_a) {
3841
+ var styles = _a.styles, dynamic = _a.dynamic;
3842
+ useStyle(styles, dynamic);
3843
+ return null;
3844
+ };
3845
+ return Sheet;
3846
+ };
3847
+
3848
+ // ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll-bar/dist/es2015/utils.js
3849
+ init_react_import();
3850
+ var zeroGap = {
3851
+ left: 0,
3852
+ top: 0,
3853
+ right: 0,
3854
+ gap: 0
3855
+ };
3856
+ var parse = function(x) {
3857
+ return parseInt(x || "", 10) || 0;
3858
+ };
3859
+ var getOffset = function(gapMode) {
3860
+ var cs = window.getComputedStyle(document.body);
3861
+ var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"];
3862
+ var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"];
3863
+ var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"];
3864
+ return [parse(left), parse(top), parse(right)];
3865
+ };
3866
+ var getGapWidth = function(gapMode) {
3867
+ if (gapMode === void 0) {
3868
+ gapMode = "margin";
3869
+ }
3870
+ if (typeof window === "undefined") {
3871
+ return zeroGap;
3872
+ }
3873
+ var offsets = getOffset(gapMode);
3874
+ var documentWidth = document.documentElement.clientWidth;
3875
+ var windowWidth = window.innerWidth;
3876
+ return {
3877
+ left: offsets[0],
3878
+ top: offsets[1],
3879
+ right: offsets[2],
3880
+ gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0])
3881
+ };
3882
+ };
3883
+
3884
+ // ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll-bar/dist/es2015/component.js
3885
+ var Style = styleSingleton();
3886
+ var lockAttribute = "data-scroll-locked";
3887
+ var getStyles = function(_a, allowRelative, gapMode, important) {
3888
+ var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
3889
+ if (gapMode === void 0) {
3890
+ gapMode = "margin";
3891
+ }
3892
+ return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([
3893
+ allowRelative && "position: relative ".concat(important, ";"),
3894
+ gapMode === "margin" && "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "),
3895
+ gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";")
3896
+ ].filter(Boolean).join(""), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n");
3897
+ };
3898
+ var getCurrentUseCounter = function() {
3899
+ var counter = parseInt(document.body.getAttribute(lockAttribute) || "0", 10);
3900
+ return isFinite(counter) ? counter : 0;
3901
+ };
3902
+ var useLockAttribute = function() {
3903
+ React26.useEffect(function() {
3904
+ document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
3905
+ return function() {
3906
+ var newCounter = getCurrentUseCounter() - 1;
3907
+ if (newCounter <= 0) {
3908
+ document.body.removeAttribute(lockAttribute);
3909
+ } else {
3910
+ document.body.setAttribute(lockAttribute, newCounter.toString());
3911
+ }
3912
+ };
3913
+ }, []);
3914
+ };
3915
+ var RemoveScrollBar = function(_a) {
3916
+ var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
3917
+ useLockAttribute();
3918
+ var gap = React26.useMemo(function() {
3919
+ return getGapWidth(gapMode);
3920
+ }, [gapMode]);
3921
+ return React26.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
3922
+ };
3923
+
3924
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
3925
+ init_react_import();
3926
+ var passiveSupported = false;
3927
+ if (typeof window !== "undefined") {
3928
+ try {
3929
+ options = Object.defineProperty({}, "passive", {
3930
+ get: function() {
3931
+ passiveSupported = true;
3932
+ return true;
3933
+ }
3934
+ });
3935
+ window.addEventListener("test", options, options);
3936
+ window.removeEventListener("test", options, options);
3937
+ } catch (err) {
3938
+ passiveSupported = false;
3939
+ }
3940
+ }
3941
+ var options;
3942
+ var nonPassive = passiveSupported ? { passive: false } : false;
3943
+
3944
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/handleScroll.js
3945
+ init_react_import();
3946
+ var alwaysContainsScroll = function(node) {
3947
+ return node.tagName === "TEXTAREA";
3948
+ };
3949
+ var elementCanBeScrolled = function(node, overflow) {
3950
+ if (!(node instanceof Element)) {
3951
+ return false;
3952
+ }
3953
+ var styles = window.getComputedStyle(node);
3954
+ return (
3955
+ // not-not-scrollable
3956
+ styles[overflow] !== "hidden" && // contains scroll inside self
3957
+ !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === "visible")
3958
+ );
3959
+ };
3960
+ var elementCouldBeVScrolled = function(node) {
3961
+ return elementCanBeScrolled(node, "overflowY");
3962
+ };
3963
+ var elementCouldBeHScrolled = function(node) {
3964
+ return elementCanBeScrolled(node, "overflowX");
3965
+ };
3966
+ var locationCouldBeScrolled = function(axis, node) {
3967
+ var ownerDocument = node.ownerDocument;
3968
+ var current = node;
3969
+ do {
3970
+ if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) {
3971
+ current = current.host;
3972
+ }
3973
+ var isScrollable = elementCouldBeScrolled(axis, current);
3974
+ if (isScrollable) {
3975
+ var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];
3976
+ if (scrollHeight > clientHeight) {
3977
+ return true;
3978
+ }
3979
+ }
3980
+ current = current.parentNode;
3981
+ } while (current && current !== ownerDocument.body);
3982
+ return false;
3983
+ };
3984
+ var getVScrollVariables = function(_a) {
3985
+ var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
3986
+ return [
3987
+ scrollTop,
3988
+ scrollHeight,
3989
+ clientHeight
3990
+ ];
3991
+ };
3992
+ var getHScrollVariables = function(_a) {
3993
+ var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
3994
+ return [
3995
+ scrollLeft,
3996
+ scrollWidth,
3997
+ clientWidth
3998
+ ];
3999
+ };
4000
+ var elementCouldBeScrolled = function(axis, node) {
4001
+ return axis === "v" ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
4002
+ };
4003
+ var getScrollVariables = function(axis, node) {
4004
+ return axis === "v" ? getVScrollVariables(node) : getHScrollVariables(node);
4005
+ };
4006
+ var getDirectionFactor = function(axis, direction) {
4007
+ return axis === "h" && direction === "rtl" ? -1 : 1;
4008
+ };
4009
+ var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) {
4010
+ var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
4011
+ var delta = directionFactor * sourceDelta;
4012
+ var target = event.target;
4013
+ var targetInLock = endTarget.contains(target);
4014
+ var shouldCancelScroll = false;
4015
+ var isDeltaPositive = delta > 0;
4016
+ var availableScroll = 0;
4017
+ var availableScrollTop = 0;
4018
+ do {
4019
+ if (!target) {
4020
+ break;
4021
+ }
4022
+ var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
4023
+ var elementScroll = scroll_1 - capacity - directionFactor * position;
4024
+ if (position || elementScroll) {
4025
+ if (elementCouldBeScrolled(axis, target)) {
4026
+ availableScroll += elementScroll;
4027
+ availableScrollTop += position;
4028
+ }
4029
+ }
4030
+ var parent_1 = target.parentNode;
4031
+ target = parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1;
4032
+ } while (
4033
+ // portaled content
4034
+ !targetInLock && target !== document.body || // self content
4035
+ targetInLock && (endTarget.contains(target) || endTarget === target)
4036
+ );
4037
+ if (isDeltaPositive && (noOverscroll && Math.abs(availableScroll) < 1 || !noOverscroll && delta > availableScroll)) {
4038
+ shouldCancelScroll = true;
4039
+ } else if (!isDeltaPositive && (noOverscroll && Math.abs(availableScrollTop) < 1 || !noOverscroll && -delta > availableScrollTop)) {
4040
+ shouldCancelScroll = true;
4041
+ }
4042
+ return shouldCancelScroll;
4043
+ };
4044
+
4045
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
4046
+ var getTouchXY = function(event) {
4047
+ return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
4048
+ };
4049
+ var getDeltaXY = function(event) {
4050
+ return [event.deltaX, event.deltaY];
4051
+ };
4052
+ var extractRef = function(ref) {
4053
+ return ref && "current" in ref ? ref.current : ref;
4054
+ };
4055
+ var deltaCompare = function(x, y) {
4056
+ return x[0] === y[0] && x[1] === y[1];
4057
+ };
4058
+ var generateStyle = function(id) {
4059
+ return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n");
4060
+ };
4061
+ var idCounter = 0;
4062
+ var lockStack = [];
4063
+ function RemoveScrollSideCar(props) {
4064
+ var shouldPreventQueue = React27.useRef([]);
4065
+ var touchStartRef = React27.useRef([0, 0]);
4066
+ var activeAxis = React27.useRef();
4067
+ var id = React27.useState(idCounter++)[0];
4068
+ var Style2 = React27.useState(styleSingleton)[0];
4069
+ var lastProps = React27.useRef(props);
4070
+ React27.useEffect(function() {
4071
+ lastProps.current = props;
4072
+ }, [props]);
4073
+ React27.useEffect(function() {
4074
+ if (props.inert) {
4075
+ document.body.classList.add("block-interactivity-".concat(id));
4076
+ var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
4077
+ allow_1.forEach(function(el) {
4078
+ return el.classList.add("allow-interactivity-".concat(id));
4079
+ });
4080
+ return function() {
4081
+ document.body.classList.remove("block-interactivity-".concat(id));
4082
+ allow_1.forEach(function(el) {
4083
+ return el.classList.remove("allow-interactivity-".concat(id));
4084
+ });
4085
+ };
4086
+ }
4087
+ return;
4088
+ }, [props.inert, props.lockRef.current, props.shards]);
4089
+ var shouldCancelEvent = React27.useCallback(function(event, parent) {
4090
+ if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
4091
+ return !lastProps.current.allowPinchZoom;
4092
+ }
4093
+ var touch = getTouchXY(event);
4094
+ var touchStart = touchStartRef.current;
4095
+ var deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0];
4096
+ var deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1];
4097
+ var currentAxis;
4098
+ var target = event.target;
4099
+ var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v";
4100
+ if ("touches" in event && moveDirection === "h" && target.type === "range") {
4101
+ return false;
4102
+ }
4103
+ var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
4104
+ if (!canBeScrolledInMainDirection) {
4105
+ return true;
4106
+ }
4107
+ if (canBeScrolledInMainDirection) {
4108
+ currentAxis = moveDirection;
4109
+ } else {
4110
+ currentAxis = moveDirection === "v" ? "h" : "v";
4111
+ canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
4112
+ }
4113
+ if (!canBeScrolledInMainDirection) {
4114
+ return false;
4115
+ }
4116
+ if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY)) {
4117
+ activeAxis.current = currentAxis;
4118
+ }
4119
+ if (!currentAxis) {
4120
+ return true;
4121
+ }
4122
+ var cancelingAxis = activeAxis.current || currentAxis;
4123
+ return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
4124
+ }, []);
4125
+ var shouldPrevent = React27.useCallback(function(_event) {
4126
+ var event = _event;
4127
+ if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
4128
+ return;
4129
+ }
4130
+ var delta = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event);
4131
+ var sourceEvent = shouldPreventQueue.current.filter(function(e) {
4132
+ return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta);
4133
+ })[0];
4134
+ if (sourceEvent && sourceEvent.should) {
4135
+ if (event.cancelable) {
4136
+ event.preventDefault();
4137
+ }
4138
+ return;
4139
+ }
4140
+ if (!sourceEvent) {
4141
+ var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function(node) {
4142
+ return node.contains(event.target);
4143
+ });
4144
+ var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
4145
+ if (shouldStop) {
4146
+ if (event.cancelable) {
4147
+ event.preventDefault();
4148
+ }
4149
+ }
4150
+ }
4151
+ }, []);
4152
+ var shouldCancel = React27.useCallback(function(name, delta, target, should) {
4153
+ var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
4154
+ shouldPreventQueue.current.push(event);
4155
+ setTimeout(function() {
4156
+ shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
4157
+ return e !== event;
4158
+ });
4159
+ }, 1);
4160
+ }, []);
4161
+ var scrollTouchStart = React27.useCallback(function(event) {
4162
+ touchStartRef.current = getTouchXY(event);
4163
+ activeAxis.current = void 0;
4164
+ }, []);
4165
+ var scrollWheel = React27.useCallback(function(event) {
4166
+ shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
4167
+ }, []);
4168
+ var scrollTouchMove = React27.useCallback(function(event) {
4169
+ shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
4170
+ }, []);
4171
+ React27.useEffect(function() {
4172
+ lockStack.push(Style2);
4173
+ props.setCallbacks({
4174
+ onScrollCapture: scrollWheel,
4175
+ onWheelCapture: scrollWheel,
4176
+ onTouchMoveCapture: scrollTouchMove
4177
+ });
4178
+ document.addEventListener("wheel", shouldPrevent, nonPassive);
4179
+ document.addEventListener("touchmove", shouldPrevent, nonPassive);
4180
+ document.addEventListener("touchstart", scrollTouchStart, nonPassive);
4181
+ return function() {
4182
+ lockStack = lockStack.filter(function(inst) {
4183
+ return inst !== Style2;
4184
+ });
4185
+ document.removeEventListener("wheel", shouldPrevent, nonPassive);
4186
+ document.removeEventListener("touchmove", shouldPrevent, nonPassive);
4187
+ document.removeEventListener("touchstart", scrollTouchStart, nonPassive);
4188
+ };
4189
+ }, []);
4190
+ var removeScrollBar = props.removeScrollBar, inert = props.inert;
4191
+ return React27.createElement(
4192
+ React27.Fragment,
4193
+ null,
4194
+ inert ? React27.createElement(Style2, { styles: generateStyle(id) }) : null,
4195
+ removeScrollBar ? React27.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
4196
+ );
4197
+ }
4198
+ function getOutermostShadowParent(node) {
4199
+ var shadowParent = null;
4200
+ while (node !== null) {
4201
+ if (node instanceof ShadowRoot) {
4202
+ shadowParent = node.host;
4203
+ node = node.host;
4204
+ }
4205
+ node = node.parentNode;
4206
+ }
4207
+ return shadowParent;
4208
+ }
4209
+
4210
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/sidecar.js
4211
+ var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
4212
+
4213
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/Combination.js
4214
+ var ReactRemoveScroll = React28.forwardRef(function(props, ref) {
4215
+ return React28.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
4216
+ });
4217
+ ReactRemoveScroll.classNames = RemoveScroll.classNames;
4218
+ var Combination_default = ReactRemoveScroll;
4219
+
4220
+ // ../../node_modules/.pnpm/@radix-ui+react-popover@1.1.15_@types+react-dom@19.2.0_@types+react@19.2.0__@types+reac_e6e9e3f3089a7a72fc73cc2cd9dafc33/node_modules/@radix-ui/react-popover/dist/index.mjs
4221
+ import { jsx as jsx9 } from "react/jsx-runtime";
4222
+ var POPOVER_NAME = "Popover";
4223
+ var [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [
4224
+ createPopperScope
4225
+ ]);
4226
+ var usePopperScope = createPopperScope();
4227
+ var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
4228
+ var Popover = (props) => {
4229
+ const {
4230
+ __scopePopover,
4231
+ children,
4232
+ open: openProp,
4233
+ defaultOpen,
4234
+ onOpenChange,
4235
+ modal = false
4236
+ } = props;
4237
+ const popperScope = usePopperScope(__scopePopover);
4238
+ const triggerRef = React29.useRef(null);
4239
+ const [hasCustomAnchor, setHasCustomAnchor] = React29.useState(false);
4240
+ const [open, setOpen] = useControllableState({
4241
+ prop: openProp,
4242
+ defaultProp: defaultOpen ?? false,
4243
+ onChange: onOpenChange,
4244
+ caller: POPOVER_NAME
4245
+ });
4246
+ return /* @__PURE__ */ jsx9(Root2, { ...popperScope, children: /* @__PURE__ */ jsx9(
4247
+ PopoverProvider,
4248
+ {
4249
+ scope: __scopePopover,
4250
+ contentId: useId(),
4251
+ triggerRef,
4252
+ open,
4253
+ onOpenChange: setOpen,
4254
+ onOpenToggle: React29.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
4255
+ hasCustomAnchor,
4256
+ onCustomAnchorAdd: React29.useCallback(() => setHasCustomAnchor(true), []),
4257
+ onCustomAnchorRemove: React29.useCallback(() => setHasCustomAnchor(false), []),
4258
+ modal,
4259
+ children
4260
+ }
4261
+ ) });
4262
+ };
4263
+ Popover.displayName = POPOVER_NAME;
4264
+ var ANCHOR_NAME2 = "PopoverAnchor";
4265
+ var PopoverAnchor = React29.forwardRef(
4266
+ (props, forwardedRef) => {
4267
+ const { __scopePopover, ...anchorProps } = props;
4268
+ const context = usePopoverContext(ANCHOR_NAME2, __scopePopover);
4269
+ const popperScope = usePopperScope(__scopePopover);
4270
+ const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
4271
+ React29.useEffect(() => {
4272
+ onCustomAnchorAdd();
4273
+ return () => onCustomAnchorRemove();
4274
+ }, [onCustomAnchorAdd, onCustomAnchorRemove]);
4275
+ return /* @__PURE__ */ jsx9(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
4276
+ }
4277
+ );
4278
+ PopoverAnchor.displayName = ANCHOR_NAME2;
4279
+ var TRIGGER_NAME = "PopoverTrigger";
4280
+ var PopoverTrigger = React29.forwardRef(
4281
+ (props, forwardedRef) => {
4282
+ const { __scopePopover, ...triggerProps } = props;
4283
+ const context = usePopoverContext(TRIGGER_NAME, __scopePopover);
4284
+ const popperScope = usePopperScope(__scopePopover);
4285
+ const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
4286
+ const trigger = /* @__PURE__ */ jsx9(
4287
+ Primitive.button,
4288
+ {
4289
+ type: "button",
4290
+ "aria-haspopup": "dialog",
4291
+ "aria-expanded": context.open,
4292
+ "aria-controls": context.contentId,
4293
+ "data-state": getState(context.open),
4294
+ ...triggerProps,
4295
+ ref: composedTriggerRef,
4296
+ onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
4297
+ }
4298
+ );
4299
+ return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx9(Anchor, { asChild: true, ...popperScope, children: trigger });
4300
+ }
4301
+ );
4302
+ PopoverTrigger.displayName = TRIGGER_NAME;
4303
+ var PORTAL_NAME2 = "PopoverPortal";
4304
+ var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME2, {
4305
+ forceMount: void 0
4306
+ });
4307
+ var PopoverPortal = (props) => {
4308
+ const { __scopePopover, forceMount, children, container } = props;
4309
+ const context = usePopoverContext(PORTAL_NAME2, __scopePopover);
4310
+ return /* @__PURE__ */ jsx9(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx9(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx9(Portal, { asChild: true, container, children }) }) });
4311
+ };
4312
+ PopoverPortal.displayName = PORTAL_NAME2;
4313
+ var CONTENT_NAME2 = "PopoverContent";
4314
+ var PopoverContent = React29.forwardRef(
4315
+ (props, forwardedRef) => {
4316
+ const portalContext = usePortalContext(CONTENT_NAME2, props.__scopePopover);
4317
+ const { forceMount = portalContext.forceMount, ...contentProps } = props;
4318
+ const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
4319
+ return /* @__PURE__ */ jsx9(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx9(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx9(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
4320
+ }
4321
+ );
4322
+ PopoverContent.displayName = CONTENT_NAME2;
4323
+ var Slot = createSlot("PopoverContent.RemoveScroll");
4324
+ var PopoverContentModal = React29.forwardRef(
4325
+ (props, forwardedRef) => {
4326
+ const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
4327
+ const contentRef = React29.useRef(null);
4328
+ const composedRefs = useComposedRefs(forwardedRef, contentRef);
4329
+ const isRightClickOutsideRef = React29.useRef(false);
4330
+ React29.useEffect(() => {
4331
+ const content = contentRef.current;
4332
+ if (content) return hideOthers(content);
4333
+ }, []);
4334
+ return /* @__PURE__ */ jsx9(Combination_default, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx9(
4335
+ PopoverContentImpl,
4336
+ {
4337
+ ...props,
4338
+ ref: composedRefs,
4339
+ trapFocus: context.open,
4340
+ disableOutsidePointerEvents: true,
4341
+ onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
4342
+ event.preventDefault();
4343
+ if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();
4344
+ }),
4345
+ onPointerDownOutside: composeEventHandlers(
4346
+ props.onPointerDownOutside,
4347
+ (event) => {
4348
+ const originalEvent = event.detail.originalEvent;
4349
+ const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
4350
+ const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
4351
+ isRightClickOutsideRef.current = isRightClick;
4352
+ },
4353
+ { checkForDefaultPrevented: false }
4354
+ ),
4355
+ onFocusOutside: composeEventHandlers(
4356
+ props.onFocusOutside,
4357
+ (event) => event.preventDefault(),
4358
+ { checkForDefaultPrevented: false }
4359
+ )
4360
+ }
4361
+ ) });
4362
+ }
4363
+ );
4364
+ var PopoverContentNonModal = React29.forwardRef(
4365
+ (props, forwardedRef) => {
4366
+ const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
4367
+ const hasInteractedOutsideRef = React29.useRef(false);
4368
+ const hasPointerDownOutsideRef = React29.useRef(false);
4369
+ return /* @__PURE__ */ jsx9(
4370
+ PopoverContentImpl,
4371
+ {
4372
+ ...props,
4373
+ ref: forwardedRef,
4374
+ trapFocus: false,
4375
+ disableOutsidePointerEvents: false,
4376
+ onCloseAutoFocus: (event) => {
4377
+ props.onCloseAutoFocus?.(event);
4378
+ if (!event.defaultPrevented) {
4379
+ if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
4380
+ event.preventDefault();
4381
+ }
4382
+ hasInteractedOutsideRef.current = false;
4383
+ hasPointerDownOutsideRef.current = false;
4384
+ },
4385
+ onInteractOutside: (event) => {
4386
+ props.onInteractOutside?.(event);
4387
+ if (!event.defaultPrevented) {
4388
+ hasInteractedOutsideRef.current = true;
4389
+ if (event.detail.originalEvent.type === "pointerdown") {
4390
+ hasPointerDownOutsideRef.current = true;
4391
+ }
4392
+ }
4393
+ const target = event.target;
4394
+ const targetIsTrigger = context.triggerRef.current?.contains(target);
4395
+ if (targetIsTrigger) event.preventDefault();
4396
+ if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
4397
+ event.preventDefault();
4398
+ }
4399
+ }
4400
+ }
4401
+ );
4402
+ }
4403
+ );
4404
+ var PopoverContentImpl = React29.forwardRef(
4405
+ (props, forwardedRef) => {
4406
+ const {
4407
+ __scopePopover,
4408
+ trapFocus,
4409
+ onOpenAutoFocus,
4410
+ onCloseAutoFocus,
4411
+ disableOutsidePointerEvents,
4412
+ onEscapeKeyDown,
4413
+ onPointerDownOutside,
4414
+ onFocusOutside,
4415
+ onInteractOutside,
4416
+ ...contentProps
4417
+ } = props;
4418
+ const context = usePopoverContext(CONTENT_NAME2, __scopePopover);
4419
+ const popperScope = usePopperScope(__scopePopover);
4420
+ useFocusGuards();
4421
+ return /* @__PURE__ */ jsx9(
4422
+ FocusScope,
4423
+ {
4424
+ asChild: true,
4425
+ loop: true,
4426
+ trapped: trapFocus,
4427
+ onMountAutoFocus: onOpenAutoFocus,
4428
+ onUnmountAutoFocus: onCloseAutoFocus,
4429
+ children: /* @__PURE__ */ jsx9(
4430
+ DismissableLayer,
4431
+ {
4432
+ asChild: true,
4433
+ disableOutsidePointerEvents,
4434
+ onInteractOutside,
4435
+ onEscapeKeyDown,
4436
+ onPointerDownOutside,
4437
+ onFocusOutside,
4438
+ onDismiss: () => context.onOpenChange(false),
4439
+ children: /* @__PURE__ */ jsx9(
4440
+ Content,
4441
+ {
4442
+ "data-state": getState(context.open),
4443
+ role: "dialog",
4444
+ id: context.contentId,
4445
+ ...popperScope,
4446
+ ...contentProps,
4447
+ ref: forwardedRef,
4448
+ style: {
4449
+ ...contentProps.style,
4450
+ // re-namespace exposed content custom properties
4451
+ ...{
4452
+ "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
4453
+ "--radix-popover-content-available-width": "var(--radix-popper-available-width)",
4454
+ "--radix-popover-content-available-height": "var(--radix-popper-available-height)",
4455
+ "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
4456
+ "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
4457
+ }
4458
+ }
4459
+ }
4460
+ )
4461
+ }
4462
+ )
4463
+ }
4464
+ );
4465
+ }
4466
+ );
4467
+ var CLOSE_NAME = "PopoverClose";
4468
+ var PopoverClose = React29.forwardRef(
4469
+ (props, forwardedRef) => {
4470
+ const { __scopePopover, ...closeProps } = props;
4471
+ const context = usePopoverContext(CLOSE_NAME, __scopePopover);
4472
+ return /* @__PURE__ */ jsx9(
4473
+ Primitive.button,
4474
+ {
4475
+ type: "button",
4476
+ ...closeProps,
4477
+ ref: forwardedRef,
4478
+ onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
4479
+ }
4480
+ );
4481
+ }
4482
+ );
4483
+ PopoverClose.displayName = CLOSE_NAME;
4484
+ var ARROW_NAME2 = "PopoverArrow";
4485
+ var PopoverArrow = React29.forwardRef(
4486
+ (props, forwardedRef) => {
4487
+ const { __scopePopover, ...arrowProps } = props;
4488
+ const popperScope = usePopperScope(__scopePopover);
4489
+ return /* @__PURE__ */ jsx9(Arrow2, { ...popperScope, ...arrowProps, ref: forwardedRef });
4490
+ }
4491
+ );
4492
+ PopoverArrow.displayName = ARROW_NAME2;
4493
+ function getState(open) {
4494
+ return open ? "open" : "closed";
4495
+ }
4496
+
4497
+ // ../platform-client/components/Menu/index.tsx
4498
+ import { Fragment as Fragment5, jsx as jsx10, jsxs } from "react/jsx-runtime";
4499
+ var getClassName = get_class_name_factory_default("Menu", styles_module_default);
4500
+ var itemClassName = get_class_name_factory_default("Menu-item", styles_module_default);
4501
+ var Menu = ({
4502
+ children,
4503
+ sections,
4504
+ disabled = false,
4505
+ ariaLabel,
4506
+ renderLink
4507
+ }) => {
4508
+ const [open, setOpen] = useState14(false);
4509
+ return /* @__PURE__ */ jsx10(Popover, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs("div", { className: getClassName(), children: [
4510
+ /* @__PURE__ */ jsx10(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx10(
4511
+ "button",
4512
+ {
4513
+ className: getClassName("action"),
4514
+ "aria-haspopup": "menu",
4515
+ "aria-label": ariaLabel,
4516
+ disabled,
4517
+ type: "button",
4518
+ children
4519
+ }
4520
+ ) }),
4521
+ /* @__PURE__ */ jsx10(PopoverPortal, { children: /* @__PURE__ */ jsx10(
4522
+ PopoverContent,
4523
+ {
4524
+ align: "end",
4525
+ className: getClassName("content"),
4526
+ collisionPadding: 8,
4527
+ sideOffset: 4,
4528
+ children: /* @__PURE__ */ jsx10("div", { className: getClassName("sections"), role: "menu", children: sections.map((section, sectionIdx) => /* @__PURE__ */ jsx10("ul", { className: getClassName("list"), children: section.map((item, itemIdx) => {
4529
+ const content = /* @__PURE__ */ jsxs(Fragment5, { children: [
4530
+ item.icon,
4531
+ item.label
4532
+ ] });
4533
+ if (item.disabled) {
4534
+ return /* @__PURE__ */ jsx10("li", { children: /* @__PURE__ */ jsx10(
4535
+ "span",
4536
+ {
4537
+ "aria-disabled": "true",
4538
+ className: itemClassName({
4539
+ disabled: true
4540
+ }),
4541
+ role: "menuitem",
4542
+ children: content
4543
+ }
4544
+ ) }, itemIdx);
4545
+ }
4546
+ if (item.href) {
4547
+ const onClick = () => {
4548
+ setOpen(false);
4549
+ };
4550
+ return /* @__PURE__ */ jsx10("li", { children: renderLink ? renderLink({
4551
+ href: item.href,
4552
+ className: getClassName("item"),
4553
+ children: content,
4554
+ onClick
4555
+ }) : /* @__PURE__ */ jsx10(
4556
+ "a",
4557
+ {
4558
+ className: getClassName("item"),
4559
+ href: item.href,
4560
+ onClick,
4561
+ role: "menuitem",
4562
+ children: content
4563
+ }
4564
+ ) }, itemIdx);
4565
+ }
4566
+ if (item.onClick) {
4567
+ return /* @__PURE__ */ jsx10("li", { children: /* @__PURE__ */ jsx10(
4568
+ "button",
4569
+ {
4570
+ className: getClassName("item"),
4571
+ onClick: () => {
4572
+ setOpen(false);
4573
+ void item.onClick?.();
4574
+ },
4575
+ role: "menuitem",
4576
+ type: "button",
4577
+ children: content
4578
+ }
4579
+ ) }, itemIdx);
4580
+ }
4581
+ return /* @__PURE__ */ jsx10("li", { children: /* @__PURE__ */ jsx10("span", { className: getClassName("item"), role: "menuitem", children: content }) }, itemIdx);
4582
+ }) }, sectionIdx)) })
4583
+ }
4584
+ ) })
4585
+ ] }) });
4586
+ };
4587
+
4588
+ // ../utils/lib/get-class-name-factory.ts
4589
+ init_react_import();
4590
+ var import_classnames2 = __toESM(require_classnames());
4591
+ var getClassNameFactory2 = (rootClass, styles, { baseClass = "" } = {}) => (options = {}) => {
4592
+ let descendant = false;
4593
+ let modifiers = false;
4594
+ if (typeof options === "string") {
4595
+ descendant = options;
4596
+ } else if (typeof options === "object") {
4597
+ modifiers = options;
4598
+ }
4599
+ if (descendant) {
4600
+ const style = styles[`${rootClass}-${descendant}`];
4601
+ if (style) {
4602
+ return baseClass + styles[`${rootClass}-${descendant}`] || "";
4603
+ }
4604
+ return "";
4605
+ } else if (modifiers) {
4606
+ const prefixedModifiers = {};
4607
+ for (let modifier in modifiers) {
4608
+ prefixedModifiers[styles[`${rootClass}--${modifier}`]] = modifiers[modifier];
4609
+ }
4610
+ const c = styles[rootClass];
4611
+ return baseClass + (0, import_classnames2.default)({
4612
+ [c]: !!c,
4613
+ // only apply the class if it exists
4614
+ ...prefixedModifiers
4615
+ });
4616
+ } else {
4617
+ return baseClass + styles[rootClass] || "";
4618
+ }
4619
+ };
4620
+
4621
+ // ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/lucide-react.js
4622
+ init_react_import();
4623
+
4624
+ // ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/createLucideIcon.js
4625
+ init_react_import();
4626
+ import { forwardRef as forwardRef12, createElement as createElement7 } from "react";
4627
+
4628
+ // ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/shared/src/utils.js
4629
+ init_react_import();
4630
+ var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
4631
+ var toCamelCase = (string) => string.replace(
4632
+ /^([A-Z])|[\s-_]+(\w)/g,
4633
+ (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
4634
+ );
4635
+ var toPascalCase = (string) => {
4636
+ const camelCase = toCamelCase(string);
4637
+ return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
4638
+ };
4639
+ var mergeClasses = (...classes) => classes.filter((className, index2, array) => {
4640
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index2;
4641
+ }).join(" ").trim();
4642
+ var hasA11yProp = (props) => {
4643
+ for (const prop in props) {
4644
+ if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
4645
+ return true;
4646
+ }
4647
+ }
4648
+ };
4649
+
4650
+ // ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/Icon.js
4651
+ init_react_import();
4652
+ import { forwardRef as forwardRef11, createElement as createElement6 } from "react";
4653
+
4654
+ // ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/defaultAttributes.js
4655
+ init_react_import();
4656
+ var defaultAttributes = {
4657
+ xmlns: "http://www.w3.org/2000/svg",
4658
+ width: 24,
4659
+ height: 24,
4660
+ viewBox: "0 0 24 24",
4661
+ fill: "none",
4662
+ stroke: "currentColor",
4663
+ strokeWidth: 2,
4664
+ strokeLinecap: "round",
4665
+ strokeLinejoin: "round"
4666
+ };
4667
+
4668
+ // ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/Icon.js
4669
+ var Icon = forwardRef11(
4670
+ ({
4671
+ color = "currentColor",
4672
+ size: size4 = 24,
4673
+ strokeWidth = 2,
4674
+ absoluteStrokeWidth,
4675
+ className = "",
4676
+ children,
4677
+ iconNode,
4678
+ ...rest
4679
+ }, ref) => createElement6(
4680
+ "svg",
4681
+ {
4682
+ ref,
4683
+ ...defaultAttributes,
4684
+ width: size4,
4685
+ height: size4,
4686
+ stroke: color,
4687
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size4) : strokeWidth,
4688
+ className: mergeClasses("lucide", className),
4689
+ ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
4690
+ ...rest
4691
+ },
4692
+ [
4693
+ ...iconNode.map(([tag, attrs]) => createElement6(tag, attrs)),
4694
+ ...Array.isArray(children) ? children : [children]
4695
+ ]
4696
+ )
4697
+ );
4698
+
4699
+ // ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/createLucideIcon.js
4700
+ var createLucideIcon = (iconName, iconNode) => {
4701
+ const Component = forwardRef12(
4702
+ ({ className, ...props }, ref) => createElement7(Icon, {
4703
+ ref,
4704
+ iconNode,
4705
+ className: mergeClasses(
4706
+ `lucide-${toKebabCase(toPascalCase(iconName))}`,
4707
+ `lucide-${iconName}`,
4708
+ className
4709
+ ),
4710
+ ...props
4711
+ })
4712
+ );
4713
+ Component.displayName = toPascalCase(iconName);
4714
+ return Component;
4715
+ };
4716
+
4717
+ // ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/icons/git-branch.js
4718
+ init_react_import();
4719
+ var __iconNode = [
4720
+ ["line", { x1: "6", x2: "6", y1: "3", y2: "15", key: "17qcm7" }],
4721
+ ["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
4722
+ ["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
4723
+ ["path", { d: "M18 9a9 9 0 0 1-9 9", key: "n2h4wq" }]
4724
+ ];
4725
+ var GitBranch = createLucideIcon("git-branch", __iconNode);
4726
+
4727
+ // ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/icons/log-out.js
4728
+ init_react_import();
4729
+ var __iconNode2 = [
4730
+ ["path", { d: "m16 17 5-5-5-5", key: "1bji2h" }],
4731
+ ["path", { d: "M21 12H9", key: "dn1m92" }],
4732
+ ["path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4", key: "1uf3rs" }]
4733
+ ];
4734
+ var LogOut = createLucideIcon("log-out", __iconNode2);
4735
+
4736
+ // src/components/SessionMenu/index.tsx
4737
+ import { useEffect as useEffect15, useState as useState15 } from "react";
4738
+
4739
+ // css-module:/home/runner/work/platform/platform/packages/plugin-auth/src/components/SessionMenu/styles.module.css#css-module
4740
+ init_react_import();
4741
+ var styles_module_default2 = { "SessionMenu-avatar": "_SessionMenu-avatar_j6dlr_1", "SessionMenu-placeholder": "_SessionMenu-placeholder_j6dlr_16", "SessionMenu-identity": "_SessionMenu-identity_j6dlr_30", "SessionMenu-name": "_SessionMenu-name_j6dlr_37", "SessionMenu-email": "_SessionMenu-email_j6dlr_41" };
4742
+
4743
+ // src/components/SessionMenu/index.tsx
4744
+ import { jsx as jsx11, jsxs as jsxs2 } from "react/jsx-runtime";
4745
+ var cx = getClassNameFactory2("SessionMenu", styles_module_default2);
4746
+ var initials = (name) => name.split(/\s+/).filter(Boolean).slice(0, 2).map((part) => part[0].toUpperCase()).join("");
4747
+ var SessionMenu = ({
4748
+ authHost,
4749
+ showBranch
4750
+ }) => {
4751
+ const [session, setSession] = useState15();
4752
+ useEffect15(() => {
4753
+ let cancelled = false;
4754
+ fetch(`${authHost}/session`, { cache: "no-store" }).then((response) => response.ok ? response.json() : null).then((data) => {
4755
+ if (!cancelled) setSession(data?.user ? data : null);
4756
+ }).catch(() => {
4757
+ if (!cancelled) setSession(null);
4758
+ });
4759
+ return () => {
4760
+ cancelled = true;
4761
+ };
4762
+ }, [authHost]);
4763
+ if (session === void 0) {
4764
+ return /* @__PURE__ */ jsx11("span", { "aria-hidden": "true", className: cx("placeholder") });
4765
+ }
4766
+ if (!session) return null;
4767
+ const signOut = () => {
4768
+ const form = document.createElement("form");
4769
+ form.method = "post";
4770
+ form.action = `${authHost}/logout`;
4771
+ document.body.appendChild(form);
4772
+ form.submit();
4773
+ };
4774
+ return /* @__PURE__ */ jsx11(
4775
+ Menu,
4776
+ {
4777
+ ariaLabel: "Account",
4778
+ sections: [
4779
+ [
4780
+ {
4781
+ disabled: true,
4782
+ label: /* @__PURE__ */ jsxs2("span", { className: cx("identity"), children: [
4783
+ /* @__PURE__ */ jsx11("span", { className: cx("name"), children: session.user.name }),
4784
+ /* @__PURE__ */ jsx11("span", { className: cx("email"), children: session.user.email })
4785
+ ] })
4786
+ },
4787
+ ...showBranch ? [
4788
+ {
4789
+ disabled: true,
4790
+ icon: /* @__PURE__ */ jsx11(GitBranch, { size: 16 }),
4791
+ label: `Editing ${session.branch}`
4792
+ }
4793
+ ] : []
4794
+ ],
4795
+ [{ icon: /* @__PURE__ */ jsx11(LogOut, { size: 16 }), label: "Sign out", onClick: signOut }]
4796
+ ],
4797
+ children: /* @__PURE__ */ jsx11("span", { className: cx("avatar"), title: session.user.name, children: session.user.image ? /* @__PURE__ */ jsx11("img", { alt: "", src: session.user.image }) : initials(session.user.name) || "?" })
4798
+ }
4799
+ );
4800
+ };
4801
+
4802
+ // src/index.tsx
4803
+ import { Fragment as Fragment6, jsx as jsx12, jsxs as jsxs3 } from "react/jsx-runtime";
4804
+ var AuthHeaderActions = markHeaderActions(
4805
+ ({
4806
+ children,
4807
+ authHost,
4808
+ showBranch
4809
+ }) => /* @__PURE__ */ jsxs3(Fragment6, { children: [
4810
+ children,
4811
+ /* @__PURE__ */ jsx12(SessionMenu, { authHost, showBranch })
4812
+ ] })
4813
+ );
4814
+ function createAuthPlugin({
4815
+ host = "/api/puck/auth",
4816
+ showBranch = process.env.NODE_ENV === "development"
4817
+ } = {}) {
4818
+ return {
4819
+ name: "auth",
4820
+ overrides: {
4821
+ headerActions: ({ children }) => /* @__PURE__ */ jsx12(
4822
+ AuthHeaderActions,
4823
+ {
4824
+ authHost: host.replace(/\/+$/, ""),
4825
+ showBranch,
4826
+ children
4827
+ }
4828
+ )
4829
+ }
4830
+ };
4831
+ }
4832
+ export {
4833
+ createAuthPlugin
4834
+ };
4835
+ /*! Bundled license information:
4836
+
4837
+ classnames/index.js:
4838
+ (*!
4839
+ Copyright (c) 2018 Jed Watson.
4840
+ Licensed under the MIT License (MIT), see
4841
+ http://jedwatson.github.io/classnames
4842
+ *)
4843
+
4844
+ lucide-react/dist/esm/shared/src/utils.js:
4845
+ lucide-react/dist/esm/defaultAttributes.js:
4846
+ lucide-react/dist/esm/Icon.js:
4847
+ lucide-react/dist/esm/createLucideIcon.js:
4848
+ lucide-react/dist/esm/icons/git-branch.js:
4849
+ lucide-react/dist/esm/icons/log-out.js:
4850
+ lucide-react/dist/esm/lucide-react.js:
4851
+ (**
4852
+ * @license lucide-react v0.554.0 - ISC
4853
+ *
4854
+ * This source code is licensed under the ISC license.
4855
+ * See the LICENSE file in the root directory of this source tree.
4856
+ *)
4857
+ */