@puckeditor/plugin-auth 0.9.0-canary.e9811666c

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