autumn-js 0.0.113 → 0.0.114-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/libraries/backend/better-auth.js +5 -16
- package/dist/libraries/backend/better-auth.mjs +8 -8
- package/dist/libraries/backend/{chunk-45WVZY23.mjs → chunk-2TEL6LR5.mjs} +5 -6
- package/dist/libraries/backend/{chunk-C342MVRJ.mjs → chunk-5W265EHC.mjs} +1 -1
- package/dist/libraries/backend/{chunk-B5EK655Y.mjs → chunk-AE3ATQW3.mjs} +1 -1
- package/dist/libraries/backend/{chunk-ZHA3DHVC.mjs → chunk-AHC5CF27.mjs} +1 -1
- package/dist/libraries/backend/{chunk-74THWZUU.mjs → chunk-HPQ3LI62.mjs} +6 -6
- package/dist/libraries/backend/{chunk-NBQSYUOH.mjs → chunk-JUTZHAHU.mjs} +2 -2
- package/dist/libraries/backend/{chunk-EUAZMSHG.mjs → chunk-QGTZAKB7.mjs} +1 -1
- package/dist/libraries/backend/{chunk-BNRLG2NJ.mjs → chunk-SHE3OJIL.mjs} +1 -1
- package/dist/libraries/backend/convex.js +5 -16
- package/dist/libraries/backend/convex.mjs +8 -8
- package/dist/libraries/backend/elysia.js +5 -16
- package/dist/libraries/backend/elysia.mjs +8 -8
- package/dist/libraries/backend/express.js +5 -16
- package/dist/libraries/backend/express.mjs +8 -8
- package/dist/libraries/backend/fastify.js +5 -16
- package/dist/libraries/backend/fastify.mjs +8 -8
- package/dist/libraries/backend/hono.js +5 -16
- package/dist/libraries/backend/hono.mjs +8 -8
- package/dist/libraries/backend/next.js +99 -100
- package/dist/libraries/backend/next.mjs +102 -102
- package/dist/libraries/backend/react-router.js +5 -16
- package/dist/libraries/backend/react-router.mjs +8 -8
- package/dist/libraries/backend/remix_dep.js +5 -16
- package/dist/libraries/backend/remix_dep.mjs +8 -8
- package/dist/libraries/backend/routes/backendRouter.js +5 -16
- package/dist/libraries/backend/routes/backendRouter.mjs +8 -8
- package/dist/libraries/backend/routes/entityRoutes.js +5 -16
- package/dist/libraries/backend/routes/entityRoutes.mjs +4 -4
- package/dist/libraries/backend/routes/genRoutes.js +5 -16
- package/dist/libraries/backend/routes/genRoutes.mjs +4 -4
- package/dist/libraries/backend/routes/productRoutes.js +5 -16
- package/dist/libraries/backend/routes/productRoutes.mjs +4 -4
- package/dist/libraries/backend/routes/referralRoutes.js +5 -16
- package/dist/libraries/backend/routes/referralRoutes.mjs +4 -4
- package/dist/libraries/backend/supabase.js +5 -16
- package/dist/libraries/backend/supabase.mjs +8 -8
- package/dist/libraries/backend/tanstack.js +5 -16
- package/dist/libraries/backend/tanstack.mjs +8 -8
- package/dist/libraries/backend/utils/backendRes.js +5 -16
- package/dist/libraries/backend/utils/backendRes.mjs +2 -2
- package/dist/libraries/backend/utils/logBackendErrors.js +5 -16
- package/dist/libraries/backend/utils/logBackendErrors.mjs +1 -1
- package/dist/libraries/backend/utils/withAuth.js +5 -16
- package/dist/libraries/backend/utils/withAuth.mjs +3 -3
- package/dist/libraries/react/AutumnContext.d.mts +6 -6
- package/dist/libraries/react/AutumnContext.d.ts +6 -6
- package/dist/libraries/react/AutumnContext.js +5 -16
- package/dist/libraries/react/AutumnContext.mjs +5 -5
- package/dist/libraries/react/BaseAutumnProvider.d.mts +6 -6
- package/dist/libraries/react/BaseAutumnProvider.d.ts +6 -6
- package/dist/libraries/react/BaseAutumnProvider.js +5 -6
- package/dist/libraries/react/BaseAutumnProvider.mjs +10 -10
- package/dist/libraries/react/{ReactAutumnClient-BNcDsxYe.d.ts → ReactAutumnClient-DIZQVmRy.d.ts} +17 -17
- package/dist/libraries/react/{ReactAutumnClient-Bm0Y_zzP.d.mts → ReactAutumnClient-DqpPS6mx.d.mts} +17 -17
- package/dist/libraries/react/ReactAutumnProvider.d.mts +2 -2
- package/dist/libraries/react/ReactAutumnProvider.d.ts +2 -2
- package/dist/libraries/react/ReactAutumnProvider.js +5 -6
- package/dist/libraries/react/ReactAutumnProvider.mjs +11 -11
- package/dist/libraries/react/{attachTypes-DIsESO5Y.d.ts → attachTypes-BJdXhnWy.d.ts} +7 -7
- package/dist/libraries/react/{attachTypes-BQzswBtK.d.mts → attachTypes-BXiFiJdF.d.mts} +7 -7
- package/dist/libraries/react/{chunk-GUZH4TKK.mjs → chunk-3JORYFTY.mjs} +5 -6
- package/dist/libraries/react/{chunk-DDYSMKLY.mjs → chunk-3UNBBJY5.mjs} +1 -1
- package/dist/libraries/react/{chunk-HDMOJP3E.mjs → chunk-4Q7BDIOS.mjs} +1 -1
- package/dist/libraries/react/{chunk-DGBYTZLQ.mjs → chunk-5PA5P2UE.mjs} +2 -2
- package/dist/libraries/react/{chunk-4X4TKILZ.mjs → chunk-62QDB3KQ.mjs} +3 -3
- package/dist/libraries/react/{chunk-3C7OO2N3.mjs → chunk-6R3O2T4H.mjs} +1 -1
- package/dist/libraries/react/{chunk-JP6WLDHX.mjs → chunk-CV4TKYAC.mjs} +2 -2
- package/dist/libraries/react/{chunk-QMOLXJIH.mjs → chunk-CZVP6BZG.mjs} +3 -3
- package/dist/libraries/react/{chunk-QEKHWOGC.mjs → chunk-E2H5MYIO.mjs} +1 -1
- package/dist/libraries/react/{chunk-TX3X2LDE.mjs → chunk-FEISQQNM.mjs} +92 -649
- package/dist/libraries/react/chunk-FJWZPMWU.mjs +448 -0
- package/dist/libraries/react/{chunk-F324RNGU.mjs → chunk-FOXUAY7Y.mjs} +7 -7
- package/dist/libraries/react/{chunk-4NIALZY6.mjs → chunk-GNX5VVIG.mjs} +33 -32
- package/dist/libraries/react/{chunk-CYFC6BOH.mjs → chunk-HBVLIBOE.mjs} +3 -3
- package/dist/libraries/react/chunk-I2A7PK2L.mjs +151 -0
- package/dist/libraries/react/chunk-JGDTNJTR.mjs +584 -0
- package/dist/libraries/react/chunk-KUS3X33V.mjs +46 -0
- package/dist/libraries/react/chunk-OTZ65PCT.mjs +2520 -0
- package/dist/libraries/react/{chunk-EGPEAPRK.mjs → chunk-PEYCQWHI.mjs} +2 -2
- package/dist/libraries/react/{chunk-RL47UQK4.mjs → chunk-RGAEIODW.mjs} +1 -1
- package/dist/libraries/react/{chunk-PLGLCII4.mjs → chunk-YDRULJZE.mjs} +2 -2
- package/dist/libraries/react/{chunk-PRFT4OKG.mjs → chunk-YEG5KJEI.mjs} +1 -1
- package/dist/libraries/react/{chunk-6EZVNJHQ.mjs → chunk-YWQTQ72B.mjs} +15 -50
- package/dist/libraries/react/client/ReactAutumnClient.d.mts +6 -6
- package/dist/libraries/react/client/ReactAutumnClient.d.ts +6 -6
- package/dist/libraries/react/client/ReactAutumnClient.js +5 -16
- package/dist/libraries/react/client/ReactAutumnClient.mjs +4 -4
- package/dist/libraries/react/client/clientCompMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientCompMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientCusMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientCusMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientEntityMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientEntityMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientGenMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientGenMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientProdMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientProdMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientReferralMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientReferralMethods.d.ts +6 -6
- package/dist/libraries/react/client/types/clientAttachTypes.d.mts +18 -18
- package/dist/libraries/react/client/types/clientAttachTypes.d.ts +18 -18
- package/dist/libraries/react/client/types/clientGenTypes.d.mts +4 -4
- package/dist/libraries/react/client/types/clientGenTypes.d.ts +4 -4
- package/dist/libraries/react/client/types/clientGenTypes.js +5 -16
- package/dist/libraries/react/client/types/clientGenTypes.mjs +1 -1
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.mts +2 -2
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.ts +2 -2
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.js +6486 -3517
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.mjs +30 -27
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.mts +2 -2
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.ts +2 -2
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.js +3131 -169
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.mjs +30 -27
- package/dist/libraries/react/components/check-dialog/lib/check-content.d.mts +1 -1
- package/dist/libraries/react/components/check-dialog/lib/check-content.d.ts +1 -1
- package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.mts +1 -1
- package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.ts +1 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +1 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +1 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +5895 -2928
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +30 -27
- package/dist/libraries/react/components/ui/accordion.js +984 -26
- package/dist/libraries/react/components/ui/accordion.mjs +4 -1
- package/dist/libraries/react/components/ui/button.d.mts +1 -1
- package/dist/libraries/react/components/ui/button.d.ts +1 -1
- package/dist/libraries/react/components/ui/dialog.mjs +4 -2
- package/dist/libraries/react/components/ui/popover.js +4282 -24
- package/dist/libraries/react/components/ui/popover.mjs +6 -1
- package/dist/libraries/react/components/ui/switch.mjs +3 -2
- package/dist/libraries/react/{cusTypes-CwLJs1D1.d.ts → cusTypes-BF0duryT.d.ts} +7 -7
- package/dist/libraries/react/{cusTypes-CI8GNjww.d.mts → cusTypes-DtZmTpFX.d.mts} +7 -7
- package/dist/libraries/react/{entTypes-Kh8o7OKO.d.mts → entTypes-Bp6pNHjR.d.mts} +1 -1
- package/dist/libraries/react/{entTypes-ByG7ZqG-.d.ts → entTypes-xJhFmB7-.d.ts} +1 -1
- package/dist/libraries/react/{genTypes-BjDGPkYi.d.mts → genTypes-DZOWhqU8.d.mts} +5 -5
- package/dist/libraries/react/{genTypes-CtkYtnSx.d.ts → genTypes-DkoXRRN5.d.ts} +5 -5
- package/dist/libraries/react/hooks/helpers/handleCheck.d.mts +6 -6
- package/dist/libraries/react/hooks/helpers/handleCheck.d.ts +6 -6
- package/dist/libraries/react/hooks/helpers/handleCheck.js +5 -16
- package/dist/libraries/react/hooks/helpers/handleCheck.mjs +2 -2
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.mts +7 -7
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.ts +7 -7
- package/dist/libraries/react/hooks/helpers/useAutumnBase.js +5 -6
- package/dist/libraries/react/hooks/helpers/useAutumnBase.mjs +3 -3
- package/dist/libraries/react/hooks/useAnalytics.d.mts +2 -2
- package/dist/libraries/react/hooks/useAnalytics.d.ts +2 -2
- package/dist/libraries/react/hooks/useAnalytics.js +5 -6
- package/dist/libraries/react/hooks/useAnalytics.mjs +6 -6
- package/dist/libraries/react/hooks/useCustomer.d.mts +6 -6
- package/dist/libraries/react/hooks/useCustomer.d.ts +6 -6
- package/dist/libraries/react/hooks/useCustomer.js +5 -6
- package/dist/libraries/react/hooks/useCustomer.mjs +10 -10
- package/dist/libraries/react/hooks/useCustomerBase.d.mts +6 -6
- package/dist/libraries/react/hooks/useCustomerBase.d.ts +6 -6
- package/dist/libraries/react/hooks/useCustomerBase.js +5 -6
- package/dist/libraries/react/hooks/useCustomerBase.mjs +9 -9
- package/dist/libraries/react/hooks/useEntity.d.mts +4 -4
- package/dist/libraries/react/hooks/useEntity.d.ts +4 -4
- package/dist/libraries/react/hooks/useEntity.js +5 -6
- package/dist/libraries/react/hooks/useEntity.mjs +10 -10
- package/dist/libraries/react/hooks/useEntityBase.d.mts +6 -6
- package/dist/libraries/react/hooks/useEntityBase.d.ts +6 -6
- package/dist/libraries/react/hooks/useEntityBase.js +5 -6
- package/dist/libraries/react/hooks/useEntityBase.mjs +9 -9
- package/dist/libraries/react/hooks/usePaywall.d.mts +1 -1
- package/dist/libraries/react/hooks/usePaywall.d.ts +1 -1
- package/dist/libraries/react/hooks/usePaywall.js +5 -6
- package/dist/libraries/react/hooks/usePaywall.mjs +6 -6
- package/dist/libraries/react/hooks/usePricingTable.d.mts +1 -1
- package/dist/libraries/react/hooks/usePricingTable.d.ts +1 -1
- package/dist/libraries/react/hooks/usePricingTable.js +5 -6
- package/dist/libraries/react/hooks/usePricingTable.mjs +7 -7
- package/dist/libraries/react/hooks/usePricingTableBase.d.mts +6 -6
- package/dist/libraries/react/hooks/usePricingTableBase.d.ts +6 -6
- package/dist/libraries/react/hooks/usePricingTableBase.js +5 -6
- package/dist/libraries/react/hooks/usePricingTableBase.mjs +2 -2
- package/dist/libraries/react/hooks/useProductsBase.d.mts +6 -6
- package/dist/libraries/react/hooks/useProductsBase.d.ts +6 -6
- package/dist/libraries/react/index.js +5906 -2939
- package/dist/libraries/react/index.mjs +5863 -2896
- package/dist/libraries/react/{prodTypes-Y1CLtmfa.d.mts → prodTypes-C9oGJVm4.d.mts} +3 -3
- package/dist/libraries/react/{prodTypes-Y1CLtmfa.d.ts → prodTypes-C9oGJVm4.d.ts} +3 -3
- package/dist/next/server/auth/withNextAuth.d.mts +1 -1
- package/dist/next/server/auth/withNextAuth.d.ts +1 -1
- package/dist/next/server/componentActions.d.mts +1 -1
- package/dist/next/server/componentActions.d.ts +1 -1
- package/dist/next/server/cusActions.d.mts +19 -19
- package/dist/next/server/cusActions.d.ts +19 -19
- package/dist/next/server/genActions.d.mts +1 -1
- package/dist/next/server/genActions.d.ts +1 -1
- package/dist/sdk/index.js +7 -10
- package/dist/sdk/index.mjs +7 -6
- package/dist/utils/{chunk-V7R5DCYR.mjs → chunk-WNUBT3GZ.mjs} +5 -6
- package/dist/utils/encryptUtils.js +5 -6
- package/dist/utils/encryptUtils.mjs +1 -1
- package/dist/utils/logger.js +5 -16
- package/dist/utils/logger.mjs +1 -1
- package/package.json +7 -13
- package/dist/libraries/react/chunk-JGRLRPKG.mjs +0 -56
- package/dist/libraries/react/chunk-UM3ZQPMU.mjs +0 -34
- package/dist/libraries/react/{chunk-KWNH6C27.mjs → chunk-7TYAAD2T.mjs} +11 -11
- package/dist/next/server/{cusTypes-PcPWkSme.d.mts → cusTypes-DNT0aDSN.d.mts} +6 -6
- package/dist/next/server/{cusTypes-PcPWkSme.d.ts → cusTypes-DNT0aDSN.d.ts} +6 -6
|
@@ -0,0 +1,2520 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
useSize
|
|
5
|
+
} from "./chunk-KUS3X33V.mjs";
|
|
6
|
+
import {
|
|
7
|
+
Combination_default,
|
|
8
|
+
DismissableLayer,
|
|
9
|
+
FocusScope,
|
|
10
|
+
Portal,
|
|
11
|
+
hideOthers,
|
|
12
|
+
useCallbackRef,
|
|
13
|
+
useFocusGuards
|
|
14
|
+
} from "./chunk-FEISQQNM.mjs";
|
|
15
|
+
import {
|
|
16
|
+
Presence,
|
|
17
|
+
useId
|
|
18
|
+
} from "./chunk-I2A7PK2L.mjs";
|
|
19
|
+
import {
|
|
20
|
+
Primitive,
|
|
21
|
+
composeEventHandlers,
|
|
22
|
+
createContextScope,
|
|
23
|
+
useControllableState,
|
|
24
|
+
useLayoutEffect2
|
|
25
|
+
} from "./chunk-7TYAAD2T.mjs";
|
|
26
|
+
import {
|
|
27
|
+
createSlot,
|
|
28
|
+
useComposedRefs
|
|
29
|
+
} from "./chunk-RPEGNKJH.mjs";
|
|
30
|
+
import {
|
|
31
|
+
cn
|
|
32
|
+
} from "./chunk-4J6OC4ZQ.mjs";
|
|
33
|
+
|
|
34
|
+
// src/libraries/react/components/ui/popover.tsx
|
|
35
|
+
import * as React5 from "react";
|
|
36
|
+
|
|
37
|
+
// ../node_modules/.pnpm/@radix-ui+react-popover@1.1.14_@types+react-dom@19.1.6_@types+react@19.1.8__@types+react@19.1_pyqmioko53yxjnlrzhv5y3hiqq/node_modules/@radix-ui/react-popover/dist/index.mjs
|
|
38
|
+
import * as React4 from "react";
|
|
39
|
+
|
|
40
|
+
// ../node_modules/.pnpm/@radix-ui+react-popper@1.2.7_@types+react-dom@19.1.6_@types+react@19.1.8__@types+react@19.1.8_itfjovpaz7ozxobqqhn2dn4epm/node_modules/@radix-ui/react-popper/dist/index.mjs
|
|
41
|
+
import * as React3 from "react";
|
|
42
|
+
|
|
43
|
+
// ../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
44
|
+
var sides = ["top", "right", "bottom", "left"];
|
|
45
|
+
var min = Math.min;
|
|
46
|
+
var max = Math.max;
|
|
47
|
+
var round = Math.round;
|
|
48
|
+
var floor = Math.floor;
|
|
49
|
+
var createCoords = (v) => ({
|
|
50
|
+
x: v,
|
|
51
|
+
y: v
|
|
52
|
+
});
|
|
53
|
+
var oppositeSideMap = {
|
|
54
|
+
left: "right",
|
|
55
|
+
right: "left",
|
|
56
|
+
bottom: "top",
|
|
57
|
+
top: "bottom"
|
|
58
|
+
};
|
|
59
|
+
var oppositeAlignmentMap = {
|
|
60
|
+
start: "end",
|
|
61
|
+
end: "start"
|
|
62
|
+
};
|
|
63
|
+
function clamp(start, value, end) {
|
|
64
|
+
return max(start, min(value, end));
|
|
65
|
+
}
|
|
66
|
+
function evaluate(value, param) {
|
|
67
|
+
return typeof value === "function" ? value(param) : value;
|
|
68
|
+
}
|
|
69
|
+
function getSide(placement) {
|
|
70
|
+
return placement.split("-")[0];
|
|
71
|
+
}
|
|
72
|
+
function getAlignment(placement) {
|
|
73
|
+
return placement.split("-")[1];
|
|
74
|
+
}
|
|
75
|
+
function getOppositeAxis(axis) {
|
|
76
|
+
return axis === "x" ? "y" : "x";
|
|
77
|
+
}
|
|
78
|
+
function getAxisLength(axis) {
|
|
79
|
+
return axis === "y" ? "height" : "width";
|
|
80
|
+
}
|
|
81
|
+
var yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
82
|
+
function getSideAxis(placement) {
|
|
83
|
+
return yAxisSides.has(getSide(placement)) ? "y" : "x";
|
|
84
|
+
}
|
|
85
|
+
function getAlignmentAxis(placement) {
|
|
86
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
87
|
+
}
|
|
88
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
89
|
+
if (rtl === void 0) {
|
|
90
|
+
rtl = false;
|
|
91
|
+
}
|
|
92
|
+
const alignment = getAlignment(placement);
|
|
93
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
94
|
+
const length = getAxisLength(alignmentAxis);
|
|
95
|
+
let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
|
|
96
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
97
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
98
|
+
}
|
|
99
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
100
|
+
}
|
|
101
|
+
function getExpandedPlacements(placement) {
|
|
102
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
103
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
104
|
+
}
|
|
105
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
106
|
+
return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
|
|
107
|
+
}
|
|
108
|
+
var lrPlacement = ["left", "right"];
|
|
109
|
+
var rlPlacement = ["right", "left"];
|
|
110
|
+
var tbPlacement = ["top", "bottom"];
|
|
111
|
+
var btPlacement = ["bottom", "top"];
|
|
112
|
+
function getSideList(side, isStart, rtl) {
|
|
113
|
+
switch (side) {
|
|
114
|
+
case "top":
|
|
115
|
+
case "bottom":
|
|
116
|
+
if (rtl) return isStart ? rlPlacement : lrPlacement;
|
|
117
|
+
return isStart ? lrPlacement : rlPlacement;
|
|
118
|
+
case "left":
|
|
119
|
+
case "right":
|
|
120
|
+
return isStart ? tbPlacement : btPlacement;
|
|
121
|
+
default:
|
|
122
|
+
return [];
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
126
|
+
const alignment = getAlignment(placement);
|
|
127
|
+
let list = getSideList(getSide(placement), direction === "start", rtl);
|
|
128
|
+
if (alignment) {
|
|
129
|
+
list = list.map((side) => side + "-" + alignment);
|
|
130
|
+
if (flipAlignment) {
|
|
131
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return list;
|
|
135
|
+
}
|
|
136
|
+
function getOppositePlacement(placement) {
|
|
137
|
+
return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
|
|
138
|
+
}
|
|
139
|
+
function expandPaddingObject(padding) {
|
|
140
|
+
return {
|
|
141
|
+
top: 0,
|
|
142
|
+
right: 0,
|
|
143
|
+
bottom: 0,
|
|
144
|
+
left: 0,
|
|
145
|
+
...padding
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function getPaddingObject(padding) {
|
|
149
|
+
return typeof padding !== "number" ? expandPaddingObject(padding) : {
|
|
150
|
+
top: padding,
|
|
151
|
+
right: padding,
|
|
152
|
+
bottom: padding,
|
|
153
|
+
left: padding
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function rectToClientRect(rect) {
|
|
157
|
+
const {
|
|
158
|
+
x,
|
|
159
|
+
y,
|
|
160
|
+
width,
|
|
161
|
+
height
|
|
162
|
+
} = rect;
|
|
163
|
+
return {
|
|
164
|
+
width,
|
|
165
|
+
height,
|
|
166
|
+
top: y,
|
|
167
|
+
left: x,
|
|
168
|
+
right: x + width,
|
|
169
|
+
bottom: y + height,
|
|
170
|
+
x,
|
|
171
|
+
y
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// ../node_modules/.pnpm/@floating-ui+core@1.7.2/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
|
|
176
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
177
|
+
let {
|
|
178
|
+
reference,
|
|
179
|
+
floating
|
|
180
|
+
} = _ref;
|
|
181
|
+
const sideAxis = getSideAxis(placement);
|
|
182
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
183
|
+
const alignLength = getAxisLength(alignmentAxis);
|
|
184
|
+
const side = getSide(placement);
|
|
185
|
+
const isVertical = sideAxis === "y";
|
|
186
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
187
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
188
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
189
|
+
let coords;
|
|
190
|
+
switch (side) {
|
|
191
|
+
case "top":
|
|
192
|
+
coords = {
|
|
193
|
+
x: commonX,
|
|
194
|
+
y: reference.y - floating.height
|
|
195
|
+
};
|
|
196
|
+
break;
|
|
197
|
+
case "bottom":
|
|
198
|
+
coords = {
|
|
199
|
+
x: commonX,
|
|
200
|
+
y: reference.y + reference.height
|
|
201
|
+
};
|
|
202
|
+
break;
|
|
203
|
+
case "right":
|
|
204
|
+
coords = {
|
|
205
|
+
x: reference.x + reference.width,
|
|
206
|
+
y: commonY
|
|
207
|
+
};
|
|
208
|
+
break;
|
|
209
|
+
case "left":
|
|
210
|
+
coords = {
|
|
211
|
+
x: reference.x - floating.width,
|
|
212
|
+
y: commonY
|
|
213
|
+
};
|
|
214
|
+
break;
|
|
215
|
+
default:
|
|
216
|
+
coords = {
|
|
217
|
+
x: reference.x,
|
|
218
|
+
y: reference.y
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
switch (getAlignment(placement)) {
|
|
222
|
+
case "start":
|
|
223
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
224
|
+
break;
|
|
225
|
+
case "end":
|
|
226
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
return coords;
|
|
230
|
+
}
|
|
231
|
+
var computePosition = async (reference, floating, config) => {
|
|
232
|
+
const {
|
|
233
|
+
placement = "bottom",
|
|
234
|
+
strategy = "absolute",
|
|
235
|
+
middleware = [],
|
|
236
|
+
platform: platform2
|
|
237
|
+
} = config;
|
|
238
|
+
const validMiddleware = middleware.filter(Boolean);
|
|
239
|
+
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
|
|
240
|
+
let rects = await platform2.getElementRects({
|
|
241
|
+
reference,
|
|
242
|
+
floating,
|
|
243
|
+
strategy
|
|
244
|
+
});
|
|
245
|
+
let {
|
|
246
|
+
x,
|
|
247
|
+
y
|
|
248
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
249
|
+
let statefulPlacement = placement;
|
|
250
|
+
let middlewareData = {};
|
|
251
|
+
let resetCount = 0;
|
|
252
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
|
253
|
+
const {
|
|
254
|
+
name,
|
|
255
|
+
fn
|
|
256
|
+
} = validMiddleware[i];
|
|
257
|
+
const {
|
|
258
|
+
x: nextX,
|
|
259
|
+
y: nextY,
|
|
260
|
+
data,
|
|
261
|
+
reset
|
|
262
|
+
} = await fn({
|
|
263
|
+
x,
|
|
264
|
+
y,
|
|
265
|
+
initialPlacement: placement,
|
|
266
|
+
placement: statefulPlacement,
|
|
267
|
+
strategy,
|
|
268
|
+
middlewareData,
|
|
269
|
+
rects,
|
|
270
|
+
platform: platform2,
|
|
271
|
+
elements: {
|
|
272
|
+
reference,
|
|
273
|
+
floating
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
x = nextX != null ? nextX : x;
|
|
277
|
+
y = nextY != null ? nextY : y;
|
|
278
|
+
middlewareData = {
|
|
279
|
+
...middlewareData,
|
|
280
|
+
[name]: {
|
|
281
|
+
...middlewareData[name],
|
|
282
|
+
...data
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
if (reset && resetCount <= 50) {
|
|
286
|
+
resetCount++;
|
|
287
|
+
if (typeof reset === "object") {
|
|
288
|
+
if (reset.placement) {
|
|
289
|
+
statefulPlacement = reset.placement;
|
|
290
|
+
}
|
|
291
|
+
if (reset.rects) {
|
|
292
|
+
rects = reset.rects === true ? await platform2.getElementRects({
|
|
293
|
+
reference,
|
|
294
|
+
floating,
|
|
295
|
+
strategy
|
|
296
|
+
}) : reset.rects;
|
|
297
|
+
}
|
|
298
|
+
({
|
|
299
|
+
x,
|
|
300
|
+
y
|
|
301
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
302
|
+
}
|
|
303
|
+
i = -1;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return {
|
|
307
|
+
x,
|
|
308
|
+
y,
|
|
309
|
+
placement: statefulPlacement,
|
|
310
|
+
strategy,
|
|
311
|
+
middlewareData
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
async function detectOverflow(state, options) {
|
|
315
|
+
var _await$platform$isEle;
|
|
316
|
+
if (options === void 0) {
|
|
317
|
+
options = {};
|
|
318
|
+
}
|
|
319
|
+
const {
|
|
320
|
+
x,
|
|
321
|
+
y,
|
|
322
|
+
platform: platform2,
|
|
323
|
+
rects,
|
|
324
|
+
elements,
|
|
325
|
+
strategy
|
|
326
|
+
} = state;
|
|
327
|
+
const {
|
|
328
|
+
boundary = "clippingAncestors",
|
|
329
|
+
rootBoundary = "viewport",
|
|
330
|
+
elementContext = "floating",
|
|
331
|
+
altBoundary = false,
|
|
332
|
+
padding = 0
|
|
333
|
+
} = evaluate(options, state);
|
|
334
|
+
const paddingObject = getPaddingObject(padding);
|
|
335
|
+
const altContext = elementContext === "floating" ? "reference" : "floating";
|
|
336
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
337
|
+
const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
|
|
338
|
+
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)),
|
|
339
|
+
boundary,
|
|
340
|
+
rootBoundary,
|
|
341
|
+
strategy
|
|
342
|
+
}));
|
|
343
|
+
const rect = elementContext === "floating" ? {
|
|
344
|
+
x,
|
|
345
|
+
y,
|
|
346
|
+
width: rects.floating.width,
|
|
347
|
+
height: rects.floating.height
|
|
348
|
+
} : rects.reference;
|
|
349
|
+
const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
|
|
350
|
+
const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
|
|
351
|
+
x: 1,
|
|
352
|
+
y: 1
|
|
353
|
+
} : {
|
|
354
|
+
x: 1,
|
|
355
|
+
y: 1
|
|
356
|
+
};
|
|
357
|
+
const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
358
|
+
elements,
|
|
359
|
+
rect,
|
|
360
|
+
offsetParent,
|
|
361
|
+
strategy
|
|
362
|
+
}) : rect);
|
|
363
|
+
return {
|
|
364
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
365
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
366
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
367
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
var arrow = (options) => ({
|
|
371
|
+
name: "arrow",
|
|
372
|
+
options,
|
|
373
|
+
async fn(state) {
|
|
374
|
+
const {
|
|
375
|
+
x,
|
|
376
|
+
y,
|
|
377
|
+
placement,
|
|
378
|
+
rects,
|
|
379
|
+
platform: platform2,
|
|
380
|
+
elements,
|
|
381
|
+
middlewareData
|
|
382
|
+
} = state;
|
|
383
|
+
const {
|
|
384
|
+
element,
|
|
385
|
+
padding = 0
|
|
386
|
+
} = evaluate(options, state) || {};
|
|
387
|
+
if (element == null) {
|
|
388
|
+
return {};
|
|
389
|
+
}
|
|
390
|
+
const paddingObject = getPaddingObject(padding);
|
|
391
|
+
const coords = {
|
|
392
|
+
x,
|
|
393
|
+
y
|
|
394
|
+
};
|
|
395
|
+
const axis = getAlignmentAxis(placement);
|
|
396
|
+
const length = getAxisLength(axis);
|
|
397
|
+
const arrowDimensions = await platform2.getDimensions(element);
|
|
398
|
+
const isYAxis = axis === "y";
|
|
399
|
+
const minProp = isYAxis ? "top" : "left";
|
|
400
|
+
const maxProp = isYAxis ? "bottom" : "right";
|
|
401
|
+
const clientProp = isYAxis ? "clientHeight" : "clientWidth";
|
|
402
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
403
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
|
404
|
+
const arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element));
|
|
405
|
+
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
406
|
+
if (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) {
|
|
407
|
+
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
408
|
+
}
|
|
409
|
+
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
410
|
+
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
411
|
+
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
412
|
+
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
413
|
+
const min$1 = minPadding;
|
|
414
|
+
const max2 = clientSize - arrowDimensions[length] - maxPadding;
|
|
415
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
416
|
+
const offset4 = clamp(min$1, center, max2);
|
|
417
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
418
|
+
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
|
|
419
|
+
return {
|
|
420
|
+
[axis]: coords[axis] + alignmentOffset,
|
|
421
|
+
data: {
|
|
422
|
+
[axis]: offset4,
|
|
423
|
+
centerOffset: center - offset4 - alignmentOffset,
|
|
424
|
+
...shouldAddOffset && {
|
|
425
|
+
alignmentOffset
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
reset: shouldAddOffset
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
var flip = function(options) {
|
|
433
|
+
if (options === void 0) {
|
|
434
|
+
options = {};
|
|
435
|
+
}
|
|
436
|
+
return {
|
|
437
|
+
name: "flip",
|
|
438
|
+
options,
|
|
439
|
+
async fn(state) {
|
|
440
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
|
441
|
+
const {
|
|
442
|
+
placement,
|
|
443
|
+
middlewareData,
|
|
444
|
+
rects,
|
|
445
|
+
initialPlacement,
|
|
446
|
+
platform: platform2,
|
|
447
|
+
elements
|
|
448
|
+
} = state;
|
|
449
|
+
const {
|
|
450
|
+
mainAxis: checkMainAxis = true,
|
|
451
|
+
crossAxis: checkCrossAxis = true,
|
|
452
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
453
|
+
fallbackStrategy = "bestFit",
|
|
454
|
+
fallbackAxisSideDirection = "none",
|
|
455
|
+
flipAlignment = true,
|
|
456
|
+
...detectOverflowOptions
|
|
457
|
+
} = evaluate(options, state);
|
|
458
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
459
|
+
return {};
|
|
460
|
+
}
|
|
461
|
+
const side = getSide(placement);
|
|
462
|
+
const initialSideAxis = getSideAxis(initialPlacement);
|
|
463
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
464
|
+
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
465
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
466
|
+
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
|
|
467
|
+
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
468
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
469
|
+
}
|
|
470
|
+
const placements2 = [initialPlacement, ...fallbackPlacements];
|
|
471
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
472
|
+
const overflows = [];
|
|
473
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
474
|
+
if (checkMainAxis) {
|
|
475
|
+
overflows.push(overflow[side]);
|
|
476
|
+
}
|
|
477
|
+
if (checkCrossAxis) {
|
|
478
|
+
const sides2 = getAlignmentSides(placement, rects, rtl);
|
|
479
|
+
overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
|
|
480
|
+
}
|
|
481
|
+
overflowsData = [...overflowsData, {
|
|
482
|
+
placement,
|
|
483
|
+
overflows
|
|
484
|
+
}];
|
|
485
|
+
if (!overflows.every((side2) => side2 <= 0)) {
|
|
486
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
487
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
488
|
+
const nextPlacement = placements2[nextIndex];
|
|
489
|
+
if (nextPlacement) {
|
|
490
|
+
const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
491
|
+
if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
|
|
492
|
+
// overflows the main axis.
|
|
493
|
+
overflowsData.every((d) => d.overflows[0] > 0 && getSideAxis(d.placement) === initialSideAxis)) {
|
|
494
|
+
return {
|
|
495
|
+
data: {
|
|
496
|
+
index: nextIndex,
|
|
497
|
+
overflows: overflowsData
|
|
498
|
+
},
|
|
499
|
+
reset: {
|
|
500
|
+
placement: nextPlacement
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
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;
|
|
506
|
+
if (!resetPlacement) {
|
|
507
|
+
switch (fallbackStrategy) {
|
|
508
|
+
case "bestFit": {
|
|
509
|
+
var _overflowsData$filter2;
|
|
510
|
+
const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {
|
|
511
|
+
if (hasFallbackAxisSideDirection) {
|
|
512
|
+
const currentSideAxis = getSideAxis(d.placement);
|
|
513
|
+
return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
|
|
514
|
+
// reading directions favoring greater width.
|
|
515
|
+
currentSideAxis === "y";
|
|
516
|
+
}
|
|
517
|
+
return true;
|
|
518
|
+
}).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];
|
|
519
|
+
if (placement2) {
|
|
520
|
+
resetPlacement = placement2;
|
|
521
|
+
}
|
|
522
|
+
break;
|
|
523
|
+
}
|
|
524
|
+
case "initialPlacement":
|
|
525
|
+
resetPlacement = initialPlacement;
|
|
526
|
+
break;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
if (placement !== resetPlacement) {
|
|
530
|
+
return {
|
|
531
|
+
reset: {
|
|
532
|
+
placement: resetPlacement
|
|
533
|
+
}
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
return {};
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
};
|
|
541
|
+
function getSideOffsets(overflow, rect) {
|
|
542
|
+
return {
|
|
543
|
+
top: overflow.top - rect.height,
|
|
544
|
+
right: overflow.right - rect.width,
|
|
545
|
+
bottom: overflow.bottom - rect.height,
|
|
546
|
+
left: overflow.left - rect.width
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
function isAnySideFullyClipped(overflow) {
|
|
550
|
+
return sides.some((side) => overflow[side] >= 0);
|
|
551
|
+
}
|
|
552
|
+
var hide = function(options) {
|
|
553
|
+
if (options === void 0) {
|
|
554
|
+
options = {};
|
|
555
|
+
}
|
|
556
|
+
return {
|
|
557
|
+
name: "hide",
|
|
558
|
+
options,
|
|
559
|
+
async fn(state) {
|
|
560
|
+
const {
|
|
561
|
+
rects
|
|
562
|
+
} = state;
|
|
563
|
+
const {
|
|
564
|
+
strategy = "referenceHidden",
|
|
565
|
+
...detectOverflowOptions
|
|
566
|
+
} = evaluate(options, state);
|
|
567
|
+
switch (strategy) {
|
|
568
|
+
case "referenceHidden": {
|
|
569
|
+
const overflow = await detectOverflow(state, {
|
|
570
|
+
...detectOverflowOptions,
|
|
571
|
+
elementContext: "reference"
|
|
572
|
+
});
|
|
573
|
+
const offsets = getSideOffsets(overflow, rects.reference);
|
|
574
|
+
return {
|
|
575
|
+
data: {
|
|
576
|
+
referenceHiddenOffsets: offsets,
|
|
577
|
+
referenceHidden: isAnySideFullyClipped(offsets)
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
case "escaped": {
|
|
582
|
+
const overflow = await detectOverflow(state, {
|
|
583
|
+
...detectOverflowOptions,
|
|
584
|
+
altBoundary: true
|
|
585
|
+
});
|
|
586
|
+
const offsets = getSideOffsets(overflow, rects.floating);
|
|
587
|
+
return {
|
|
588
|
+
data: {
|
|
589
|
+
escapedOffsets: offsets,
|
|
590
|
+
escaped: isAnySideFullyClipped(offsets)
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
default: {
|
|
595
|
+
return {};
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
};
|
|
600
|
+
};
|
|
601
|
+
var originSides = /* @__PURE__ */ new Set(["left", "top"]);
|
|
602
|
+
async function convertValueToCoords(state, options) {
|
|
603
|
+
const {
|
|
604
|
+
placement,
|
|
605
|
+
platform: platform2,
|
|
606
|
+
elements
|
|
607
|
+
} = state;
|
|
608
|
+
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
609
|
+
const side = getSide(placement);
|
|
610
|
+
const alignment = getAlignment(placement);
|
|
611
|
+
const isVertical = getSideAxis(placement) === "y";
|
|
612
|
+
const mainAxisMulti = originSides.has(side) ? -1 : 1;
|
|
613
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
614
|
+
const rawValue = evaluate(options, state);
|
|
615
|
+
let {
|
|
616
|
+
mainAxis,
|
|
617
|
+
crossAxis,
|
|
618
|
+
alignmentAxis
|
|
619
|
+
} = typeof rawValue === "number" ? {
|
|
620
|
+
mainAxis: rawValue,
|
|
621
|
+
crossAxis: 0,
|
|
622
|
+
alignmentAxis: null
|
|
623
|
+
} : {
|
|
624
|
+
mainAxis: rawValue.mainAxis || 0,
|
|
625
|
+
crossAxis: rawValue.crossAxis || 0,
|
|
626
|
+
alignmentAxis: rawValue.alignmentAxis
|
|
627
|
+
};
|
|
628
|
+
if (alignment && typeof alignmentAxis === "number") {
|
|
629
|
+
crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
|
|
630
|
+
}
|
|
631
|
+
return isVertical ? {
|
|
632
|
+
x: crossAxis * crossAxisMulti,
|
|
633
|
+
y: mainAxis * mainAxisMulti
|
|
634
|
+
} : {
|
|
635
|
+
x: mainAxis * mainAxisMulti,
|
|
636
|
+
y: crossAxis * crossAxisMulti
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
var offset = function(options) {
|
|
640
|
+
if (options === void 0) {
|
|
641
|
+
options = 0;
|
|
642
|
+
}
|
|
643
|
+
return {
|
|
644
|
+
name: "offset",
|
|
645
|
+
options,
|
|
646
|
+
async fn(state) {
|
|
647
|
+
var _middlewareData$offse, _middlewareData$arrow;
|
|
648
|
+
const {
|
|
649
|
+
x,
|
|
650
|
+
y,
|
|
651
|
+
placement,
|
|
652
|
+
middlewareData
|
|
653
|
+
} = state;
|
|
654
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
655
|
+
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
656
|
+
return {};
|
|
657
|
+
}
|
|
658
|
+
return {
|
|
659
|
+
x: x + diffCoords.x,
|
|
660
|
+
y: y + diffCoords.y,
|
|
661
|
+
data: {
|
|
662
|
+
...diffCoords,
|
|
663
|
+
placement
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
};
|
|
669
|
+
var shift = function(options) {
|
|
670
|
+
if (options === void 0) {
|
|
671
|
+
options = {};
|
|
672
|
+
}
|
|
673
|
+
return {
|
|
674
|
+
name: "shift",
|
|
675
|
+
options,
|
|
676
|
+
async fn(state) {
|
|
677
|
+
const {
|
|
678
|
+
x,
|
|
679
|
+
y,
|
|
680
|
+
placement
|
|
681
|
+
} = state;
|
|
682
|
+
const {
|
|
683
|
+
mainAxis: checkMainAxis = true,
|
|
684
|
+
crossAxis: checkCrossAxis = false,
|
|
685
|
+
limiter = {
|
|
686
|
+
fn: (_ref) => {
|
|
687
|
+
let {
|
|
688
|
+
x: x2,
|
|
689
|
+
y: y2
|
|
690
|
+
} = _ref;
|
|
691
|
+
return {
|
|
692
|
+
x: x2,
|
|
693
|
+
y: y2
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
},
|
|
697
|
+
...detectOverflowOptions
|
|
698
|
+
} = evaluate(options, state);
|
|
699
|
+
const coords = {
|
|
700
|
+
x,
|
|
701
|
+
y
|
|
702
|
+
};
|
|
703
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
704
|
+
const crossAxis = getSideAxis(getSide(placement));
|
|
705
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
706
|
+
let mainAxisCoord = coords[mainAxis];
|
|
707
|
+
let crossAxisCoord = coords[crossAxis];
|
|
708
|
+
if (checkMainAxis) {
|
|
709
|
+
const minSide = mainAxis === "y" ? "top" : "left";
|
|
710
|
+
const maxSide = mainAxis === "y" ? "bottom" : "right";
|
|
711
|
+
const min2 = mainAxisCoord + overflow[minSide];
|
|
712
|
+
const max2 = mainAxisCoord - overflow[maxSide];
|
|
713
|
+
mainAxisCoord = clamp(min2, mainAxisCoord, max2);
|
|
714
|
+
}
|
|
715
|
+
if (checkCrossAxis) {
|
|
716
|
+
const minSide = crossAxis === "y" ? "top" : "left";
|
|
717
|
+
const maxSide = crossAxis === "y" ? "bottom" : "right";
|
|
718
|
+
const min2 = crossAxisCoord + overflow[minSide];
|
|
719
|
+
const max2 = crossAxisCoord - overflow[maxSide];
|
|
720
|
+
crossAxisCoord = clamp(min2, crossAxisCoord, max2);
|
|
721
|
+
}
|
|
722
|
+
const limitedCoords = limiter.fn({
|
|
723
|
+
...state,
|
|
724
|
+
[mainAxis]: mainAxisCoord,
|
|
725
|
+
[crossAxis]: crossAxisCoord
|
|
726
|
+
});
|
|
727
|
+
return {
|
|
728
|
+
...limitedCoords,
|
|
729
|
+
data: {
|
|
730
|
+
x: limitedCoords.x - x,
|
|
731
|
+
y: limitedCoords.y - y,
|
|
732
|
+
enabled: {
|
|
733
|
+
[mainAxis]: checkMainAxis,
|
|
734
|
+
[crossAxis]: checkCrossAxis
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
};
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
};
|
|
741
|
+
var limitShift = function(options) {
|
|
742
|
+
if (options === void 0) {
|
|
743
|
+
options = {};
|
|
744
|
+
}
|
|
745
|
+
return {
|
|
746
|
+
options,
|
|
747
|
+
fn(state) {
|
|
748
|
+
const {
|
|
749
|
+
x,
|
|
750
|
+
y,
|
|
751
|
+
placement,
|
|
752
|
+
rects,
|
|
753
|
+
middlewareData
|
|
754
|
+
} = state;
|
|
755
|
+
const {
|
|
756
|
+
offset: offset4 = 0,
|
|
757
|
+
mainAxis: checkMainAxis = true,
|
|
758
|
+
crossAxis: checkCrossAxis = true
|
|
759
|
+
} = evaluate(options, state);
|
|
760
|
+
const coords = {
|
|
761
|
+
x,
|
|
762
|
+
y
|
|
763
|
+
};
|
|
764
|
+
const crossAxis = getSideAxis(placement);
|
|
765
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
766
|
+
let mainAxisCoord = coords[mainAxis];
|
|
767
|
+
let crossAxisCoord = coords[crossAxis];
|
|
768
|
+
const rawOffset = evaluate(offset4, state);
|
|
769
|
+
const computedOffset = typeof rawOffset === "number" ? {
|
|
770
|
+
mainAxis: rawOffset,
|
|
771
|
+
crossAxis: 0
|
|
772
|
+
} : {
|
|
773
|
+
mainAxis: 0,
|
|
774
|
+
crossAxis: 0,
|
|
775
|
+
...rawOffset
|
|
776
|
+
};
|
|
777
|
+
if (checkMainAxis) {
|
|
778
|
+
const len = mainAxis === "y" ? "height" : "width";
|
|
779
|
+
const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
|
|
780
|
+
const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
|
|
781
|
+
if (mainAxisCoord < limitMin) {
|
|
782
|
+
mainAxisCoord = limitMin;
|
|
783
|
+
} else if (mainAxisCoord > limitMax) {
|
|
784
|
+
mainAxisCoord = limitMax;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
if (checkCrossAxis) {
|
|
788
|
+
var _middlewareData$offse, _middlewareData$offse2;
|
|
789
|
+
const len = mainAxis === "y" ? "width" : "height";
|
|
790
|
+
const isOriginSide = originSides.has(getSide(placement));
|
|
791
|
+
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);
|
|
792
|
+
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);
|
|
793
|
+
if (crossAxisCoord < limitMin) {
|
|
794
|
+
crossAxisCoord = limitMin;
|
|
795
|
+
} else if (crossAxisCoord > limitMax) {
|
|
796
|
+
crossAxisCoord = limitMax;
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
return {
|
|
800
|
+
[mainAxis]: mainAxisCoord,
|
|
801
|
+
[crossAxis]: crossAxisCoord
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
};
|
|
806
|
+
var size = function(options) {
|
|
807
|
+
if (options === void 0) {
|
|
808
|
+
options = {};
|
|
809
|
+
}
|
|
810
|
+
return {
|
|
811
|
+
name: "size",
|
|
812
|
+
options,
|
|
813
|
+
async fn(state) {
|
|
814
|
+
var _state$middlewareData, _state$middlewareData2;
|
|
815
|
+
const {
|
|
816
|
+
placement,
|
|
817
|
+
rects,
|
|
818
|
+
platform: platform2,
|
|
819
|
+
elements
|
|
820
|
+
} = state;
|
|
821
|
+
const {
|
|
822
|
+
apply = () => {
|
|
823
|
+
},
|
|
824
|
+
...detectOverflowOptions
|
|
825
|
+
} = evaluate(options, state);
|
|
826
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
827
|
+
const side = getSide(placement);
|
|
828
|
+
const alignment = getAlignment(placement);
|
|
829
|
+
const isYAxis = getSideAxis(placement) === "y";
|
|
830
|
+
const {
|
|
831
|
+
width,
|
|
832
|
+
height
|
|
833
|
+
} = rects.floating;
|
|
834
|
+
let heightSide;
|
|
835
|
+
let widthSide;
|
|
836
|
+
if (side === "top" || side === "bottom") {
|
|
837
|
+
heightSide = side;
|
|
838
|
+
widthSide = alignment === (await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
|
|
839
|
+
} else {
|
|
840
|
+
widthSide = side;
|
|
841
|
+
heightSide = alignment === "end" ? "top" : "bottom";
|
|
842
|
+
}
|
|
843
|
+
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
844
|
+
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
845
|
+
const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
|
|
846
|
+
const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
|
|
847
|
+
const noShift = !state.middlewareData.shift;
|
|
848
|
+
let availableHeight = overflowAvailableHeight;
|
|
849
|
+
let availableWidth = overflowAvailableWidth;
|
|
850
|
+
if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {
|
|
851
|
+
availableWidth = maximumClippingWidth;
|
|
852
|
+
}
|
|
853
|
+
if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {
|
|
854
|
+
availableHeight = maximumClippingHeight;
|
|
855
|
+
}
|
|
856
|
+
if (noShift && !alignment) {
|
|
857
|
+
const xMin = max(overflow.left, 0);
|
|
858
|
+
const xMax = max(overflow.right, 0);
|
|
859
|
+
const yMin = max(overflow.top, 0);
|
|
860
|
+
const yMax = max(overflow.bottom, 0);
|
|
861
|
+
if (isYAxis) {
|
|
862
|
+
availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
|
|
863
|
+
} else {
|
|
864
|
+
availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
await apply({
|
|
868
|
+
...state,
|
|
869
|
+
availableWidth,
|
|
870
|
+
availableHeight
|
|
871
|
+
});
|
|
872
|
+
const nextDimensions = await platform2.getDimensions(elements.floating);
|
|
873
|
+
if (width !== nextDimensions.width || height !== nextDimensions.height) {
|
|
874
|
+
return {
|
|
875
|
+
reset: {
|
|
876
|
+
rects: true
|
|
877
|
+
}
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
return {};
|
|
881
|
+
}
|
|
882
|
+
};
|
|
883
|
+
};
|
|
884
|
+
|
|
885
|
+
// ../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
886
|
+
function hasWindow() {
|
|
887
|
+
return typeof window !== "undefined";
|
|
888
|
+
}
|
|
889
|
+
function getNodeName(node) {
|
|
890
|
+
if (isNode(node)) {
|
|
891
|
+
return (node.nodeName || "").toLowerCase();
|
|
892
|
+
}
|
|
893
|
+
return "#document";
|
|
894
|
+
}
|
|
895
|
+
function getWindow(node) {
|
|
896
|
+
var _node$ownerDocument;
|
|
897
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
898
|
+
}
|
|
899
|
+
function getDocumentElement(node) {
|
|
900
|
+
var _ref;
|
|
901
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
902
|
+
}
|
|
903
|
+
function isNode(value) {
|
|
904
|
+
if (!hasWindow()) {
|
|
905
|
+
return false;
|
|
906
|
+
}
|
|
907
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
908
|
+
}
|
|
909
|
+
function isElement(value) {
|
|
910
|
+
if (!hasWindow()) {
|
|
911
|
+
return false;
|
|
912
|
+
}
|
|
913
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
914
|
+
}
|
|
915
|
+
function isHTMLElement(value) {
|
|
916
|
+
if (!hasWindow()) {
|
|
917
|
+
return false;
|
|
918
|
+
}
|
|
919
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
920
|
+
}
|
|
921
|
+
function isShadowRoot(value) {
|
|
922
|
+
if (!hasWindow() || typeof ShadowRoot === "undefined") {
|
|
923
|
+
return false;
|
|
924
|
+
}
|
|
925
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
926
|
+
}
|
|
927
|
+
var invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
928
|
+
function isOverflowElement(element) {
|
|
929
|
+
const {
|
|
930
|
+
overflow,
|
|
931
|
+
overflowX,
|
|
932
|
+
overflowY,
|
|
933
|
+
display
|
|
934
|
+
} = getComputedStyle(element);
|
|
935
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
|
|
936
|
+
}
|
|
937
|
+
var tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
938
|
+
function isTableElement(element) {
|
|
939
|
+
return tableElements.has(getNodeName(element));
|
|
940
|
+
}
|
|
941
|
+
var topLayerSelectors = [":popover-open", ":modal"];
|
|
942
|
+
function isTopLayer(element) {
|
|
943
|
+
return topLayerSelectors.some((selector) => {
|
|
944
|
+
try {
|
|
945
|
+
return element.matches(selector);
|
|
946
|
+
} catch (_e) {
|
|
947
|
+
return false;
|
|
948
|
+
}
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
var transformProperties = ["transform", "translate", "scale", "rotate", "perspective"];
|
|
952
|
+
var willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"];
|
|
953
|
+
var containValues = ["paint", "layout", "strict", "content"];
|
|
954
|
+
function isContainingBlock(elementOrCss) {
|
|
955
|
+
const webkit = isWebKit();
|
|
956
|
+
const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
957
|
+
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));
|
|
958
|
+
}
|
|
959
|
+
function getContainingBlock(element) {
|
|
960
|
+
let currentNode = getParentNode(element);
|
|
961
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
962
|
+
if (isContainingBlock(currentNode)) {
|
|
963
|
+
return currentNode;
|
|
964
|
+
} else if (isTopLayer(currentNode)) {
|
|
965
|
+
return null;
|
|
966
|
+
}
|
|
967
|
+
currentNode = getParentNode(currentNode);
|
|
968
|
+
}
|
|
969
|
+
return null;
|
|
970
|
+
}
|
|
971
|
+
function isWebKit() {
|
|
972
|
+
if (typeof CSS === "undefined" || !CSS.supports) return false;
|
|
973
|
+
return CSS.supports("-webkit-backdrop-filter", "none");
|
|
974
|
+
}
|
|
975
|
+
var lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
976
|
+
function isLastTraversableNode(node) {
|
|
977
|
+
return lastTraversableNodeNames.has(getNodeName(node));
|
|
978
|
+
}
|
|
979
|
+
function getComputedStyle(element) {
|
|
980
|
+
return getWindow(element).getComputedStyle(element);
|
|
981
|
+
}
|
|
982
|
+
function getNodeScroll(element) {
|
|
983
|
+
if (isElement(element)) {
|
|
984
|
+
return {
|
|
985
|
+
scrollLeft: element.scrollLeft,
|
|
986
|
+
scrollTop: element.scrollTop
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
return {
|
|
990
|
+
scrollLeft: element.scrollX,
|
|
991
|
+
scrollTop: element.scrollY
|
|
992
|
+
};
|
|
993
|
+
}
|
|
994
|
+
function getParentNode(node) {
|
|
995
|
+
if (getNodeName(node) === "html") {
|
|
996
|
+
return node;
|
|
997
|
+
}
|
|
998
|
+
const result = (
|
|
999
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
1000
|
+
node.assignedSlot || // DOM Element detected.
|
|
1001
|
+
node.parentNode || // ShadowRoot detected.
|
|
1002
|
+
isShadowRoot(node) && node.host || // Fallback.
|
|
1003
|
+
getDocumentElement(node)
|
|
1004
|
+
);
|
|
1005
|
+
return isShadowRoot(result) ? result.host : result;
|
|
1006
|
+
}
|
|
1007
|
+
function getNearestOverflowAncestor(node) {
|
|
1008
|
+
const parentNode = getParentNode(node);
|
|
1009
|
+
if (isLastTraversableNode(parentNode)) {
|
|
1010
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
1011
|
+
}
|
|
1012
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
1013
|
+
return parentNode;
|
|
1014
|
+
}
|
|
1015
|
+
return getNearestOverflowAncestor(parentNode);
|
|
1016
|
+
}
|
|
1017
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
1018
|
+
var _node$ownerDocument2;
|
|
1019
|
+
if (list === void 0) {
|
|
1020
|
+
list = [];
|
|
1021
|
+
}
|
|
1022
|
+
if (traverseIframes === void 0) {
|
|
1023
|
+
traverseIframes = true;
|
|
1024
|
+
}
|
|
1025
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
1026
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
1027
|
+
const win = getWindow(scrollableAncestor);
|
|
1028
|
+
if (isBody) {
|
|
1029
|
+
const frameElement = getFrameElement(win);
|
|
1030
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
1031
|
+
}
|
|
1032
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
1033
|
+
}
|
|
1034
|
+
function getFrameElement(win) {
|
|
1035
|
+
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
// ../node_modules/.pnpm/@floating-ui+dom@1.7.2/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
|
|
1039
|
+
function getCssDimensions(element) {
|
|
1040
|
+
const css = getComputedStyle(element);
|
|
1041
|
+
let width = parseFloat(css.width) || 0;
|
|
1042
|
+
let height = parseFloat(css.height) || 0;
|
|
1043
|
+
const hasOffset = isHTMLElement(element);
|
|
1044
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
1045
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
1046
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
1047
|
+
if (shouldFallback) {
|
|
1048
|
+
width = offsetWidth;
|
|
1049
|
+
height = offsetHeight;
|
|
1050
|
+
}
|
|
1051
|
+
return {
|
|
1052
|
+
width,
|
|
1053
|
+
height,
|
|
1054
|
+
$: shouldFallback
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
1057
|
+
function unwrapElement(element) {
|
|
1058
|
+
return !isElement(element) ? element.contextElement : element;
|
|
1059
|
+
}
|
|
1060
|
+
function getScale(element) {
|
|
1061
|
+
const domElement = unwrapElement(element);
|
|
1062
|
+
if (!isHTMLElement(domElement)) {
|
|
1063
|
+
return createCoords(1);
|
|
1064
|
+
}
|
|
1065
|
+
const rect = domElement.getBoundingClientRect();
|
|
1066
|
+
const {
|
|
1067
|
+
width,
|
|
1068
|
+
height,
|
|
1069
|
+
$
|
|
1070
|
+
} = getCssDimensions(domElement);
|
|
1071
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
1072
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
1073
|
+
if (!x || !Number.isFinite(x)) {
|
|
1074
|
+
x = 1;
|
|
1075
|
+
}
|
|
1076
|
+
if (!y || !Number.isFinite(y)) {
|
|
1077
|
+
y = 1;
|
|
1078
|
+
}
|
|
1079
|
+
return {
|
|
1080
|
+
x,
|
|
1081
|
+
y
|
|
1082
|
+
};
|
|
1083
|
+
}
|
|
1084
|
+
var noOffsets = /* @__PURE__ */ createCoords(0);
|
|
1085
|
+
function getVisualOffsets(element) {
|
|
1086
|
+
const win = getWindow(element);
|
|
1087
|
+
if (!isWebKit() || !win.visualViewport) {
|
|
1088
|
+
return noOffsets;
|
|
1089
|
+
}
|
|
1090
|
+
return {
|
|
1091
|
+
x: win.visualViewport.offsetLeft,
|
|
1092
|
+
y: win.visualViewport.offsetTop
|
|
1093
|
+
};
|
|
1094
|
+
}
|
|
1095
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
1096
|
+
if (isFixed === void 0) {
|
|
1097
|
+
isFixed = false;
|
|
1098
|
+
}
|
|
1099
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
1100
|
+
return false;
|
|
1101
|
+
}
|
|
1102
|
+
return isFixed;
|
|
1103
|
+
}
|
|
1104
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
1105
|
+
if (includeScale === void 0) {
|
|
1106
|
+
includeScale = false;
|
|
1107
|
+
}
|
|
1108
|
+
if (isFixedStrategy === void 0) {
|
|
1109
|
+
isFixedStrategy = false;
|
|
1110
|
+
}
|
|
1111
|
+
const clientRect = element.getBoundingClientRect();
|
|
1112
|
+
const domElement = unwrapElement(element);
|
|
1113
|
+
let scale = createCoords(1);
|
|
1114
|
+
if (includeScale) {
|
|
1115
|
+
if (offsetParent) {
|
|
1116
|
+
if (isElement(offsetParent)) {
|
|
1117
|
+
scale = getScale(offsetParent);
|
|
1118
|
+
}
|
|
1119
|
+
} else {
|
|
1120
|
+
scale = getScale(element);
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
1124
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
1125
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
1126
|
+
let width = clientRect.width / scale.x;
|
|
1127
|
+
let height = clientRect.height / scale.y;
|
|
1128
|
+
if (domElement) {
|
|
1129
|
+
const win = getWindow(domElement);
|
|
1130
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
1131
|
+
let currentWin = win;
|
|
1132
|
+
let currentIFrame = getFrameElement(currentWin);
|
|
1133
|
+
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
1134
|
+
const iframeScale = getScale(currentIFrame);
|
|
1135
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
1136
|
+
const css = getComputedStyle(currentIFrame);
|
|
1137
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
1138
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
1139
|
+
x *= iframeScale.x;
|
|
1140
|
+
y *= iframeScale.y;
|
|
1141
|
+
width *= iframeScale.x;
|
|
1142
|
+
height *= iframeScale.y;
|
|
1143
|
+
x += left;
|
|
1144
|
+
y += top;
|
|
1145
|
+
currentWin = getWindow(currentIFrame);
|
|
1146
|
+
currentIFrame = getFrameElement(currentWin);
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
return rectToClientRect({
|
|
1150
|
+
width,
|
|
1151
|
+
height,
|
|
1152
|
+
x,
|
|
1153
|
+
y
|
|
1154
|
+
});
|
|
1155
|
+
}
|
|
1156
|
+
function getWindowScrollBarX(element, rect) {
|
|
1157
|
+
const leftScroll = getNodeScroll(element).scrollLeft;
|
|
1158
|
+
if (!rect) {
|
|
1159
|
+
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
1160
|
+
}
|
|
1161
|
+
return rect.left + leftScroll;
|
|
1162
|
+
}
|
|
1163
|
+
function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
|
|
1164
|
+
if (ignoreScrollbarX === void 0) {
|
|
1165
|
+
ignoreScrollbarX = false;
|
|
1166
|
+
}
|
|
1167
|
+
const htmlRect = documentElement.getBoundingClientRect();
|
|
1168
|
+
const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 : (
|
|
1169
|
+
// RTL <body> scrollbar.
|
|
1170
|
+
getWindowScrollBarX(documentElement, htmlRect)
|
|
1171
|
+
));
|
|
1172
|
+
const y = htmlRect.top + scroll.scrollTop;
|
|
1173
|
+
return {
|
|
1174
|
+
x,
|
|
1175
|
+
y
|
|
1176
|
+
};
|
|
1177
|
+
}
|
|
1178
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
1179
|
+
let {
|
|
1180
|
+
elements,
|
|
1181
|
+
rect,
|
|
1182
|
+
offsetParent,
|
|
1183
|
+
strategy
|
|
1184
|
+
} = _ref;
|
|
1185
|
+
const isFixed = strategy === "fixed";
|
|
1186
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
1187
|
+
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
1188
|
+
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
1189
|
+
return rect;
|
|
1190
|
+
}
|
|
1191
|
+
let scroll = {
|
|
1192
|
+
scrollLeft: 0,
|
|
1193
|
+
scrollTop: 0
|
|
1194
|
+
};
|
|
1195
|
+
let scale = createCoords(1);
|
|
1196
|
+
const offsets = createCoords(0);
|
|
1197
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1198
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1199
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
1200
|
+
scroll = getNodeScroll(offsetParent);
|
|
1201
|
+
}
|
|
1202
|
+
if (isHTMLElement(offsetParent)) {
|
|
1203
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
1204
|
+
scale = getScale(offsetParent);
|
|
1205
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1206
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
|
|
1210
|
+
return {
|
|
1211
|
+
width: rect.width * scale.x,
|
|
1212
|
+
height: rect.height * scale.y,
|
|
1213
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
|
|
1214
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
|
|
1215
|
+
};
|
|
1216
|
+
}
|
|
1217
|
+
function getClientRects(element) {
|
|
1218
|
+
return Array.from(element.getClientRects());
|
|
1219
|
+
}
|
|
1220
|
+
function getDocumentRect(element) {
|
|
1221
|
+
const html = getDocumentElement(element);
|
|
1222
|
+
const scroll = getNodeScroll(element);
|
|
1223
|
+
const body = element.ownerDocument.body;
|
|
1224
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
1225
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
1226
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1227
|
+
const y = -scroll.scrollTop;
|
|
1228
|
+
if (getComputedStyle(body).direction === "rtl") {
|
|
1229
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
|
1230
|
+
}
|
|
1231
|
+
return {
|
|
1232
|
+
width,
|
|
1233
|
+
height,
|
|
1234
|
+
x,
|
|
1235
|
+
y
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
function getViewportRect(element, strategy) {
|
|
1239
|
+
const win = getWindow(element);
|
|
1240
|
+
const html = getDocumentElement(element);
|
|
1241
|
+
const visualViewport = win.visualViewport;
|
|
1242
|
+
let width = html.clientWidth;
|
|
1243
|
+
let height = html.clientHeight;
|
|
1244
|
+
let x = 0;
|
|
1245
|
+
let y = 0;
|
|
1246
|
+
if (visualViewport) {
|
|
1247
|
+
width = visualViewport.width;
|
|
1248
|
+
height = visualViewport.height;
|
|
1249
|
+
const visualViewportBased = isWebKit();
|
|
1250
|
+
if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
|
|
1251
|
+
x = visualViewport.offsetLeft;
|
|
1252
|
+
y = visualViewport.offsetTop;
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
return {
|
|
1256
|
+
width,
|
|
1257
|
+
height,
|
|
1258
|
+
x,
|
|
1259
|
+
y
|
|
1260
|
+
};
|
|
1261
|
+
}
|
|
1262
|
+
var absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
1263
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
1264
|
+
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
|
|
1265
|
+
const top = clientRect.top + element.clientTop;
|
|
1266
|
+
const left = clientRect.left + element.clientLeft;
|
|
1267
|
+
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
1268
|
+
const width = element.clientWidth * scale.x;
|
|
1269
|
+
const height = element.clientHeight * scale.y;
|
|
1270
|
+
const x = left * scale.x;
|
|
1271
|
+
const y = top * scale.y;
|
|
1272
|
+
return {
|
|
1273
|
+
width,
|
|
1274
|
+
height,
|
|
1275
|
+
x,
|
|
1276
|
+
y
|
|
1277
|
+
};
|
|
1278
|
+
}
|
|
1279
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
1280
|
+
let rect;
|
|
1281
|
+
if (clippingAncestor === "viewport") {
|
|
1282
|
+
rect = getViewportRect(element, strategy);
|
|
1283
|
+
} else if (clippingAncestor === "document") {
|
|
1284
|
+
rect = getDocumentRect(getDocumentElement(element));
|
|
1285
|
+
} else if (isElement(clippingAncestor)) {
|
|
1286
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
1287
|
+
} else {
|
|
1288
|
+
const visualOffsets = getVisualOffsets(element);
|
|
1289
|
+
rect = {
|
|
1290
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
1291
|
+
y: clippingAncestor.y - visualOffsets.y,
|
|
1292
|
+
width: clippingAncestor.width,
|
|
1293
|
+
height: clippingAncestor.height
|
|
1294
|
+
};
|
|
1295
|
+
}
|
|
1296
|
+
return rectToClientRect(rect);
|
|
1297
|
+
}
|
|
1298
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
1299
|
+
const parentNode = getParentNode(element);
|
|
1300
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
1301
|
+
return false;
|
|
1302
|
+
}
|
|
1303
|
+
return getComputedStyle(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
|
|
1304
|
+
}
|
|
1305
|
+
function getClippingElementAncestors(element, cache) {
|
|
1306
|
+
const cachedResult = cache.get(element);
|
|
1307
|
+
if (cachedResult) {
|
|
1308
|
+
return cachedResult;
|
|
1309
|
+
}
|
|
1310
|
+
let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
|
|
1311
|
+
let currentContainingBlockComputedStyle = null;
|
|
1312
|
+
const elementIsFixed = getComputedStyle(element).position === "fixed";
|
|
1313
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
1314
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1315
|
+
const computedStyle = getComputedStyle(currentNode);
|
|
1316
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
1317
|
+
if (!currentNodeIsContaining && computedStyle.position === "fixed") {
|
|
1318
|
+
currentContainingBlockComputedStyle = null;
|
|
1319
|
+
}
|
|
1320
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
1321
|
+
if (shouldDropCurrentNode) {
|
|
1322
|
+
result = result.filter((ancestor) => ancestor !== currentNode);
|
|
1323
|
+
} else {
|
|
1324
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
1325
|
+
}
|
|
1326
|
+
currentNode = getParentNode(currentNode);
|
|
1327
|
+
}
|
|
1328
|
+
cache.set(element, result);
|
|
1329
|
+
return result;
|
|
1330
|
+
}
|
|
1331
|
+
function getClippingRect(_ref) {
|
|
1332
|
+
let {
|
|
1333
|
+
element,
|
|
1334
|
+
boundary,
|
|
1335
|
+
rootBoundary,
|
|
1336
|
+
strategy
|
|
1337
|
+
} = _ref;
|
|
1338
|
+
const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
1339
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
1340
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
1341
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
1342
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
1343
|
+
accRect.top = max(rect.top, accRect.top);
|
|
1344
|
+
accRect.right = min(rect.right, accRect.right);
|
|
1345
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
1346
|
+
accRect.left = max(rect.left, accRect.left);
|
|
1347
|
+
return accRect;
|
|
1348
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
1349
|
+
return {
|
|
1350
|
+
width: clippingRect.right - clippingRect.left,
|
|
1351
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
1352
|
+
x: clippingRect.left,
|
|
1353
|
+
y: clippingRect.top
|
|
1354
|
+
};
|
|
1355
|
+
}
|
|
1356
|
+
function getDimensions(element) {
|
|
1357
|
+
const {
|
|
1358
|
+
width,
|
|
1359
|
+
height
|
|
1360
|
+
} = getCssDimensions(element);
|
|
1361
|
+
return {
|
|
1362
|
+
width,
|
|
1363
|
+
height
|
|
1364
|
+
};
|
|
1365
|
+
}
|
|
1366
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
1367
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1368
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
1369
|
+
const isFixed = strategy === "fixed";
|
|
1370
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
1371
|
+
let scroll = {
|
|
1372
|
+
scrollLeft: 0,
|
|
1373
|
+
scrollTop: 0
|
|
1374
|
+
};
|
|
1375
|
+
const offsets = createCoords(0);
|
|
1376
|
+
function setLeftRTLScrollbarOffset() {
|
|
1377
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
1378
|
+
}
|
|
1379
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1380
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
1381
|
+
scroll = getNodeScroll(offsetParent);
|
|
1382
|
+
}
|
|
1383
|
+
if (isOffsetParentAnElement) {
|
|
1384
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
1385
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1386
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1387
|
+
} else if (documentElement) {
|
|
1388
|
+
setLeftRTLScrollbarOffset();
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
if (isFixed && !isOffsetParentAnElement && documentElement) {
|
|
1392
|
+
setLeftRTLScrollbarOffset();
|
|
1393
|
+
}
|
|
1394
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
1395
|
+
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
1396
|
+
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
1397
|
+
return {
|
|
1398
|
+
x,
|
|
1399
|
+
y,
|
|
1400
|
+
width: rect.width,
|
|
1401
|
+
height: rect.height
|
|
1402
|
+
};
|
|
1403
|
+
}
|
|
1404
|
+
function isStaticPositioned(element) {
|
|
1405
|
+
return getComputedStyle(element).position === "static";
|
|
1406
|
+
}
|
|
1407
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
1408
|
+
if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") {
|
|
1409
|
+
return null;
|
|
1410
|
+
}
|
|
1411
|
+
if (polyfill) {
|
|
1412
|
+
return polyfill(element);
|
|
1413
|
+
}
|
|
1414
|
+
let rawOffsetParent = element.offsetParent;
|
|
1415
|
+
if (getDocumentElement(element) === rawOffsetParent) {
|
|
1416
|
+
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
1417
|
+
}
|
|
1418
|
+
return rawOffsetParent;
|
|
1419
|
+
}
|
|
1420
|
+
function getOffsetParent(element, polyfill) {
|
|
1421
|
+
const win = getWindow(element);
|
|
1422
|
+
if (isTopLayer(element)) {
|
|
1423
|
+
return win;
|
|
1424
|
+
}
|
|
1425
|
+
if (!isHTMLElement(element)) {
|
|
1426
|
+
let svgOffsetParent = getParentNode(element);
|
|
1427
|
+
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
1428
|
+
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
1429
|
+
return svgOffsetParent;
|
|
1430
|
+
}
|
|
1431
|
+
svgOffsetParent = getParentNode(svgOffsetParent);
|
|
1432
|
+
}
|
|
1433
|
+
return win;
|
|
1434
|
+
}
|
|
1435
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
1436
|
+
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
1437
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
1438
|
+
}
|
|
1439
|
+
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
|
|
1440
|
+
return win;
|
|
1441
|
+
}
|
|
1442
|
+
return offsetParent || getContainingBlock(element) || win;
|
|
1443
|
+
}
|
|
1444
|
+
var getElementRects = async function(data) {
|
|
1445
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
1446
|
+
const getDimensionsFn = this.getDimensions;
|
|
1447
|
+
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
1448
|
+
return {
|
|
1449
|
+
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
1450
|
+
floating: {
|
|
1451
|
+
x: 0,
|
|
1452
|
+
y: 0,
|
|
1453
|
+
width: floatingDimensions.width,
|
|
1454
|
+
height: floatingDimensions.height
|
|
1455
|
+
}
|
|
1456
|
+
};
|
|
1457
|
+
};
|
|
1458
|
+
function isRTL(element) {
|
|
1459
|
+
return getComputedStyle(element).direction === "rtl";
|
|
1460
|
+
}
|
|
1461
|
+
var platform = {
|
|
1462
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
1463
|
+
getDocumentElement,
|
|
1464
|
+
getClippingRect,
|
|
1465
|
+
getOffsetParent,
|
|
1466
|
+
getElementRects,
|
|
1467
|
+
getClientRects,
|
|
1468
|
+
getDimensions,
|
|
1469
|
+
getScale,
|
|
1470
|
+
isElement,
|
|
1471
|
+
isRTL
|
|
1472
|
+
};
|
|
1473
|
+
function rectsAreEqual(a, b) {
|
|
1474
|
+
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
1475
|
+
}
|
|
1476
|
+
function observeMove(element, onMove) {
|
|
1477
|
+
let io = null;
|
|
1478
|
+
let timeoutId;
|
|
1479
|
+
const root = getDocumentElement(element);
|
|
1480
|
+
function cleanup() {
|
|
1481
|
+
var _io;
|
|
1482
|
+
clearTimeout(timeoutId);
|
|
1483
|
+
(_io = io) == null || _io.disconnect();
|
|
1484
|
+
io = null;
|
|
1485
|
+
}
|
|
1486
|
+
function refresh(skip, threshold) {
|
|
1487
|
+
if (skip === void 0) {
|
|
1488
|
+
skip = false;
|
|
1489
|
+
}
|
|
1490
|
+
if (threshold === void 0) {
|
|
1491
|
+
threshold = 1;
|
|
1492
|
+
}
|
|
1493
|
+
cleanup();
|
|
1494
|
+
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
1495
|
+
const {
|
|
1496
|
+
left,
|
|
1497
|
+
top,
|
|
1498
|
+
width,
|
|
1499
|
+
height
|
|
1500
|
+
} = elementRectForRootMargin;
|
|
1501
|
+
if (!skip) {
|
|
1502
|
+
onMove();
|
|
1503
|
+
}
|
|
1504
|
+
if (!width || !height) {
|
|
1505
|
+
return;
|
|
1506
|
+
}
|
|
1507
|
+
const insetTop = floor(top);
|
|
1508
|
+
const insetRight = floor(root.clientWidth - (left + width));
|
|
1509
|
+
const insetBottom = floor(root.clientHeight - (top + height));
|
|
1510
|
+
const insetLeft = floor(left);
|
|
1511
|
+
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
1512
|
+
const options = {
|
|
1513
|
+
rootMargin,
|
|
1514
|
+
threshold: max(0, min(1, threshold)) || 1
|
|
1515
|
+
};
|
|
1516
|
+
let isFirstUpdate = true;
|
|
1517
|
+
function handleObserve(entries) {
|
|
1518
|
+
const ratio = entries[0].intersectionRatio;
|
|
1519
|
+
if (ratio !== threshold) {
|
|
1520
|
+
if (!isFirstUpdate) {
|
|
1521
|
+
return refresh();
|
|
1522
|
+
}
|
|
1523
|
+
if (!ratio) {
|
|
1524
|
+
timeoutId = setTimeout(() => {
|
|
1525
|
+
refresh(false, 1e-7);
|
|
1526
|
+
}, 1e3);
|
|
1527
|
+
} else {
|
|
1528
|
+
refresh(false, ratio);
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
1532
|
+
refresh();
|
|
1533
|
+
}
|
|
1534
|
+
isFirstUpdate = false;
|
|
1535
|
+
}
|
|
1536
|
+
try {
|
|
1537
|
+
io = new IntersectionObserver(handleObserve, {
|
|
1538
|
+
...options,
|
|
1539
|
+
// Handle <iframe>s
|
|
1540
|
+
root: root.ownerDocument
|
|
1541
|
+
});
|
|
1542
|
+
} catch (_e) {
|
|
1543
|
+
io = new IntersectionObserver(handleObserve, options);
|
|
1544
|
+
}
|
|
1545
|
+
io.observe(element);
|
|
1546
|
+
}
|
|
1547
|
+
refresh(true);
|
|
1548
|
+
return cleanup;
|
|
1549
|
+
}
|
|
1550
|
+
function autoUpdate(reference, floating, update, options) {
|
|
1551
|
+
if (options === void 0) {
|
|
1552
|
+
options = {};
|
|
1553
|
+
}
|
|
1554
|
+
const {
|
|
1555
|
+
ancestorScroll = true,
|
|
1556
|
+
ancestorResize = true,
|
|
1557
|
+
elementResize = typeof ResizeObserver === "function",
|
|
1558
|
+
layoutShift = typeof IntersectionObserver === "function",
|
|
1559
|
+
animationFrame = false
|
|
1560
|
+
} = options;
|
|
1561
|
+
const referenceEl = unwrapElement(reference);
|
|
1562
|
+
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
|
|
1563
|
+
ancestors.forEach((ancestor) => {
|
|
1564
|
+
ancestorScroll && ancestor.addEventListener("scroll", update, {
|
|
1565
|
+
passive: true
|
|
1566
|
+
});
|
|
1567
|
+
ancestorResize && ancestor.addEventListener("resize", update);
|
|
1568
|
+
});
|
|
1569
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
1570
|
+
let reobserveFrame = -1;
|
|
1571
|
+
let resizeObserver = null;
|
|
1572
|
+
if (elementResize) {
|
|
1573
|
+
resizeObserver = new ResizeObserver((_ref) => {
|
|
1574
|
+
let [firstEntry] = _ref;
|
|
1575
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
1576
|
+
resizeObserver.unobserve(floating);
|
|
1577
|
+
cancelAnimationFrame(reobserveFrame);
|
|
1578
|
+
reobserveFrame = requestAnimationFrame(() => {
|
|
1579
|
+
var _resizeObserver;
|
|
1580
|
+
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
1581
|
+
});
|
|
1582
|
+
}
|
|
1583
|
+
update();
|
|
1584
|
+
});
|
|
1585
|
+
if (referenceEl && !animationFrame) {
|
|
1586
|
+
resizeObserver.observe(referenceEl);
|
|
1587
|
+
}
|
|
1588
|
+
resizeObserver.observe(floating);
|
|
1589
|
+
}
|
|
1590
|
+
let frameId;
|
|
1591
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
1592
|
+
if (animationFrame) {
|
|
1593
|
+
frameLoop();
|
|
1594
|
+
}
|
|
1595
|
+
function frameLoop() {
|
|
1596
|
+
const nextRefRect = getBoundingClientRect(reference);
|
|
1597
|
+
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
|
|
1598
|
+
update();
|
|
1599
|
+
}
|
|
1600
|
+
prevRefRect = nextRefRect;
|
|
1601
|
+
frameId = requestAnimationFrame(frameLoop);
|
|
1602
|
+
}
|
|
1603
|
+
update();
|
|
1604
|
+
return () => {
|
|
1605
|
+
var _resizeObserver2;
|
|
1606
|
+
ancestors.forEach((ancestor) => {
|
|
1607
|
+
ancestorScroll && ancestor.removeEventListener("scroll", update);
|
|
1608
|
+
ancestorResize && ancestor.removeEventListener("resize", update);
|
|
1609
|
+
});
|
|
1610
|
+
cleanupIo == null || cleanupIo();
|
|
1611
|
+
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
|
|
1612
|
+
resizeObserver = null;
|
|
1613
|
+
if (animationFrame) {
|
|
1614
|
+
cancelAnimationFrame(frameId);
|
|
1615
|
+
}
|
|
1616
|
+
};
|
|
1617
|
+
}
|
|
1618
|
+
var offset2 = offset;
|
|
1619
|
+
var shift2 = shift;
|
|
1620
|
+
var flip2 = flip;
|
|
1621
|
+
var size2 = size;
|
|
1622
|
+
var hide2 = hide;
|
|
1623
|
+
var arrow2 = arrow;
|
|
1624
|
+
var limitShift2 = limitShift;
|
|
1625
|
+
var computePosition2 = (reference, floating, options) => {
|
|
1626
|
+
const cache = /* @__PURE__ */ new Map();
|
|
1627
|
+
const mergedOptions = {
|
|
1628
|
+
platform,
|
|
1629
|
+
...options
|
|
1630
|
+
};
|
|
1631
|
+
const platformWithCache = {
|
|
1632
|
+
...mergedOptions.platform,
|
|
1633
|
+
_c: cache
|
|
1634
|
+
};
|
|
1635
|
+
return computePosition(reference, floating, {
|
|
1636
|
+
...mergedOptions,
|
|
1637
|
+
platform: platformWithCache
|
|
1638
|
+
});
|
|
1639
|
+
};
|
|
1640
|
+
|
|
1641
|
+
// ../node_modules/.pnpm/@floating-ui+react-dom@2.1.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
|
|
1642
|
+
import * as React from "react";
|
|
1643
|
+
import { useLayoutEffect } from "react";
|
|
1644
|
+
import * as ReactDOM from "react-dom";
|
|
1645
|
+
var isClient = typeof document !== "undefined";
|
|
1646
|
+
var noop = function noop2() {
|
|
1647
|
+
};
|
|
1648
|
+
var index = isClient ? useLayoutEffect : noop;
|
|
1649
|
+
function deepEqual(a, b) {
|
|
1650
|
+
if (a === b) {
|
|
1651
|
+
return true;
|
|
1652
|
+
}
|
|
1653
|
+
if (typeof a !== typeof b) {
|
|
1654
|
+
return false;
|
|
1655
|
+
}
|
|
1656
|
+
if (typeof a === "function" && a.toString() === b.toString()) {
|
|
1657
|
+
return true;
|
|
1658
|
+
}
|
|
1659
|
+
let length;
|
|
1660
|
+
let i;
|
|
1661
|
+
let keys;
|
|
1662
|
+
if (a && b && typeof a === "object") {
|
|
1663
|
+
if (Array.isArray(a)) {
|
|
1664
|
+
length = a.length;
|
|
1665
|
+
if (length !== b.length) return false;
|
|
1666
|
+
for (i = length; i-- !== 0; ) {
|
|
1667
|
+
if (!deepEqual(a[i], b[i])) {
|
|
1668
|
+
return false;
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
return true;
|
|
1672
|
+
}
|
|
1673
|
+
keys = Object.keys(a);
|
|
1674
|
+
length = keys.length;
|
|
1675
|
+
if (length !== Object.keys(b).length) {
|
|
1676
|
+
return false;
|
|
1677
|
+
}
|
|
1678
|
+
for (i = length; i-- !== 0; ) {
|
|
1679
|
+
if (!{}.hasOwnProperty.call(b, keys[i])) {
|
|
1680
|
+
return false;
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
for (i = length; i-- !== 0; ) {
|
|
1684
|
+
const key = keys[i];
|
|
1685
|
+
if (key === "_owner" && a.$$typeof) {
|
|
1686
|
+
continue;
|
|
1687
|
+
}
|
|
1688
|
+
if (!deepEqual(a[key], b[key])) {
|
|
1689
|
+
return false;
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
return true;
|
|
1693
|
+
}
|
|
1694
|
+
return a !== a && b !== b;
|
|
1695
|
+
}
|
|
1696
|
+
function getDPR(element) {
|
|
1697
|
+
if (typeof window === "undefined") {
|
|
1698
|
+
return 1;
|
|
1699
|
+
}
|
|
1700
|
+
const win = element.ownerDocument.defaultView || window;
|
|
1701
|
+
return win.devicePixelRatio || 1;
|
|
1702
|
+
}
|
|
1703
|
+
function roundByDPR(element, value) {
|
|
1704
|
+
const dpr = getDPR(element);
|
|
1705
|
+
return Math.round(value * dpr) / dpr;
|
|
1706
|
+
}
|
|
1707
|
+
function useLatestRef(value) {
|
|
1708
|
+
const ref = React.useRef(value);
|
|
1709
|
+
index(() => {
|
|
1710
|
+
ref.current = value;
|
|
1711
|
+
});
|
|
1712
|
+
return ref;
|
|
1713
|
+
}
|
|
1714
|
+
function useFloating(options) {
|
|
1715
|
+
if (options === void 0) {
|
|
1716
|
+
options = {};
|
|
1717
|
+
}
|
|
1718
|
+
const {
|
|
1719
|
+
placement = "bottom",
|
|
1720
|
+
strategy = "absolute",
|
|
1721
|
+
middleware = [],
|
|
1722
|
+
platform: platform2,
|
|
1723
|
+
elements: {
|
|
1724
|
+
reference: externalReference,
|
|
1725
|
+
floating: externalFloating
|
|
1726
|
+
} = {},
|
|
1727
|
+
transform = true,
|
|
1728
|
+
whileElementsMounted,
|
|
1729
|
+
open
|
|
1730
|
+
} = options;
|
|
1731
|
+
const [data, setData] = React.useState({
|
|
1732
|
+
x: 0,
|
|
1733
|
+
y: 0,
|
|
1734
|
+
strategy,
|
|
1735
|
+
placement,
|
|
1736
|
+
middlewareData: {},
|
|
1737
|
+
isPositioned: false
|
|
1738
|
+
});
|
|
1739
|
+
const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);
|
|
1740
|
+
if (!deepEqual(latestMiddleware, middleware)) {
|
|
1741
|
+
setLatestMiddleware(middleware);
|
|
1742
|
+
}
|
|
1743
|
+
const [_reference, _setReference] = React.useState(null);
|
|
1744
|
+
const [_floating, _setFloating] = React.useState(null);
|
|
1745
|
+
const setReference = React.useCallback((node) => {
|
|
1746
|
+
if (node !== referenceRef.current) {
|
|
1747
|
+
referenceRef.current = node;
|
|
1748
|
+
_setReference(node);
|
|
1749
|
+
}
|
|
1750
|
+
}, []);
|
|
1751
|
+
const setFloating = React.useCallback((node) => {
|
|
1752
|
+
if (node !== floatingRef.current) {
|
|
1753
|
+
floatingRef.current = node;
|
|
1754
|
+
_setFloating(node);
|
|
1755
|
+
}
|
|
1756
|
+
}, []);
|
|
1757
|
+
const referenceEl = externalReference || _reference;
|
|
1758
|
+
const floatingEl = externalFloating || _floating;
|
|
1759
|
+
const referenceRef = React.useRef(null);
|
|
1760
|
+
const floatingRef = React.useRef(null);
|
|
1761
|
+
const dataRef = React.useRef(data);
|
|
1762
|
+
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
1763
|
+
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
1764
|
+
const platformRef = useLatestRef(platform2);
|
|
1765
|
+
const openRef = useLatestRef(open);
|
|
1766
|
+
const update = React.useCallback(() => {
|
|
1767
|
+
if (!referenceRef.current || !floatingRef.current) {
|
|
1768
|
+
return;
|
|
1769
|
+
}
|
|
1770
|
+
const config = {
|
|
1771
|
+
placement,
|
|
1772
|
+
strategy,
|
|
1773
|
+
middleware: latestMiddleware
|
|
1774
|
+
};
|
|
1775
|
+
if (platformRef.current) {
|
|
1776
|
+
config.platform = platformRef.current;
|
|
1777
|
+
}
|
|
1778
|
+
computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => {
|
|
1779
|
+
const fullData = {
|
|
1780
|
+
...data2,
|
|
1781
|
+
// The floating element's position may be recomputed while it's closed
|
|
1782
|
+
// but still mounted (such as when transitioning out). To ensure
|
|
1783
|
+
// `isPositioned` will be `false` initially on the next open, avoid
|
|
1784
|
+
// setting it to `true` when `open === false` (must be specified).
|
|
1785
|
+
isPositioned: openRef.current !== false
|
|
1786
|
+
};
|
|
1787
|
+
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
|
1788
|
+
dataRef.current = fullData;
|
|
1789
|
+
ReactDOM.flushSync(() => {
|
|
1790
|
+
setData(fullData);
|
|
1791
|
+
});
|
|
1792
|
+
}
|
|
1793
|
+
});
|
|
1794
|
+
}, [latestMiddleware, placement, strategy, platformRef, openRef]);
|
|
1795
|
+
index(() => {
|
|
1796
|
+
if (open === false && dataRef.current.isPositioned) {
|
|
1797
|
+
dataRef.current.isPositioned = false;
|
|
1798
|
+
setData((data2) => ({
|
|
1799
|
+
...data2,
|
|
1800
|
+
isPositioned: false
|
|
1801
|
+
}));
|
|
1802
|
+
}
|
|
1803
|
+
}, [open]);
|
|
1804
|
+
const isMountedRef = React.useRef(false);
|
|
1805
|
+
index(() => {
|
|
1806
|
+
isMountedRef.current = true;
|
|
1807
|
+
return () => {
|
|
1808
|
+
isMountedRef.current = false;
|
|
1809
|
+
};
|
|
1810
|
+
}, []);
|
|
1811
|
+
index(() => {
|
|
1812
|
+
if (referenceEl) referenceRef.current = referenceEl;
|
|
1813
|
+
if (floatingEl) floatingRef.current = floatingEl;
|
|
1814
|
+
if (referenceEl && floatingEl) {
|
|
1815
|
+
if (whileElementsMountedRef.current) {
|
|
1816
|
+
return whileElementsMountedRef.current(referenceEl, floatingEl, update);
|
|
1817
|
+
}
|
|
1818
|
+
update();
|
|
1819
|
+
}
|
|
1820
|
+
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
1821
|
+
const refs = React.useMemo(() => ({
|
|
1822
|
+
reference: referenceRef,
|
|
1823
|
+
floating: floatingRef,
|
|
1824
|
+
setReference,
|
|
1825
|
+
setFloating
|
|
1826
|
+
}), [setReference, setFloating]);
|
|
1827
|
+
const elements = React.useMemo(() => ({
|
|
1828
|
+
reference: referenceEl,
|
|
1829
|
+
floating: floatingEl
|
|
1830
|
+
}), [referenceEl, floatingEl]);
|
|
1831
|
+
const floatingStyles = React.useMemo(() => {
|
|
1832
|
+
const initialStyles = {
|
|
1833
|
+
position: strategy,
|
|
1834
|
+
left: 0,
|
|
1835
|
+
top: 0
|
|
1836
|
+
};
|
|
1837
|
+
if (!elements.floating) {
|
|
1838
|
+
return initialStyles;
|
|
1839
|
+
}
|
|
1840
|
+
const x = roundByDPR(elements.floating, data.x);
|
|
1841
|
+
const y = roundByDPR(elements.floating, data.y);
|
|
1842
|
+
if (transform) {
|
|
1843
|
+
return {
|
|
1844
|
+
...initialStyles,
|
|
1845
|
+
transform: "translate(" + x + "px, " + y + "px)",
|
|
1846
|
+
...getDPR(elements.floating) >= 1.5 && {
|
|
1847
|
+
willChange: "transform"
|
|
1848
|
+
}
|
|
1849
|
+
};
|
|
1850
|
+
}
|
|
1851
|
+
return {
|
|
1852
|
+
position: strategy,
|
|
1853
|
+
left: x,
|
|
1854
|
+
top: y
|
|
1855
|
+
};
|
|
1856
|
+
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
1857
|
+
return React.useMemo(() => ({
|
|
1858
|
+
...data,
|
|
1859
|
+
update,
|
|
1860
|
+
refs,
|
|
1861
|
+
elements,
|
|
1862
|
+
floatingStyles
|
|
1863
|
+
}), [data, update, refs, elements, floatingStyles]);
|
|
1864
|
+
}
|
|
1865
|
+
var arrow$1 = (options) => {
|
|
1866
|
+
function isRef(value) {
|
|
1867
|
+
return {}.hasOwnProperty.call(value, "current");
|
|
1868
|
+
}
|
|
1869
|
+
return {
|
|
1870
|
+
name: "arrow",
|
|
1871
|
+
options,
|
|
1872
|
+
fn(state) {
|
|
1873
|
+
const {
|
|
1874
|
+
element,
|
|
1875
|
+
padding
|
|
1876
|
+
} = typeof options === "function" ? options(state) : options;
|
|
1877
|
+
if (element && isRef(element)) {
|
|
1878
|
+
if (element.current != null) {
|
|
1879
|
+
return arrow2({
|
|
1880
|
+
element: element.current,
|
|
1881
|
+
padding
|
|
1882
|
+
}).fn(state);
|
|
1883
|
+
}
|
|
1884
|
+
return {};
|
|
1885
|
+
}
|
|
1886
|
+
if (element) {
|
|
1887
|
+
return arrow2({
|
|
1888
|
+
element,
|
|
1889
|
+
padding
|
|
1890
|
+
}).fn(state);
|
|
1891
|
+
}
|
|
1892
|
+
return {};
|
|
1893
|
+
}
|
|
1894
|
+
};
|
|
1895
|
+
};
|
|
1896
|
+
var offset3 = (options, deps) => ({
|
|
1897
|
+
...offset2(options),
|
|
1898
|
+
options: [options, deps]
|
|
1899
|
+
});
|
|
1900
|
+
var shift3 = (options, deps) => ({
|
|
1901
|
+
...shift2(options),
|
|
1902
|
+
options: [options, deps]
|
|
1903
|
+
});
|
|
1904
|
+
var limitShift3 = (options, deps) => ({
|
|
1905
|
+
...limitShift2(options),
|
|
1906
|
+
options: [options, deps]
|
|
1907
|
+
});
|
|
1908
|
+
var flip3 = (options, deps) => ({
|
|
1909
|
+
...flip2(options),
|
|
1910
|
+
options: [options, deps]
|
|
1911
|
+
});
|
|
1912
|
+
var size3 = (options, deps) => ({
|
|
1913
|
+
...size2(options),
|
|
1914
|
+
options: [options, deps]
|
|
1915
|
+
});
|
|
1916
|
+
var hide3 = (options, deps) => ({
|
|
1917
|
+
...hide2(options),
|
|
1918
|
+
options: [options, deps]
|
|
1919
|
+
});
|
|
1920
|
+
var arrow3 = (options, deps) => ({
|
|
1921
|
+
...arrow$1(options),
|
|
1922
|
+
options: [options, deps]
|
|
1923
|
+
});
|
|
1924
|
+
|
|
1925
|
+
// ../node_modules/.pnpm/@radix-ui+react-arrow@1.1.7_@types+react-dom@19.1.6_@types+react@19.1.8__@types+react@19.1.8__k3vdwn4oujzgfg4h66z6kymfyq/node_modules/@radix-ui/react-arrow/dist/index.mjs
|
|
1926
|
+
import * as React2 from "react";
|
|
1927
|
+
import { jsx } from "react/jsx-runtime";
|
|
1928
|
+
var NAME = "Arrow";
|
|
1929
|
+
var Arrow = React2.forwardRef((props, forwardedRef) => {
|
|
1930
|
+
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
1931
|
+
return /* @__PURE__ */ jsx(
|
|
1932
|
+
Primitive.svg,
|
|
1933
|
+
{
|
|
1934
|
+
...arrowProps,
|
|
1935
|
+
ref: forwardedRef,
|
|
1936
|
+
width,
|
|
1937
|
+
height,
|
|
1938
|
+
viewBox: "0 0 30 10",
|
|
1939
|
+
preserveAspectRatio: "none",
|
|
1940
|
+
children: props.asChild ? children : /* @__PURE__ */ jsx("polygon", { points: "0,0 30,0 15,10" })
|
|
1941
|
+
}
|
|
1942
|
+
);
|
|
1943
|
+
});
|
|
1944
|
+
Arrow.displayName = NAME;
|
|
1945
|
+
var Root = Arrow;
|
|
1946
|
+
|
|
1947
|
+
// ../node_modules/.pnpm/@radix-ui+react-popper@1.2.7_@types+react-dom@19.1.6_@types+react@19.1.8__@types+react@19.1.8_itfjovpaz7ozxobqqhn2dn4epm/node_modules/@radix-ui/react-popper/dist/index.mjs
|
|
1948
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
1949
|
+
var POPPER_NAME = "Popper";
|
|
1950
|
+
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
1951
|
+
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
1952
|
+
var Popper = (props) => {
|
|
1953
|
+
const { __scopePopper, children } = props;
|
|
1954
|
+
const [anchor, setAnchor] = React3.useState(null);
|
|
1955
|
+
return /* @__PURE__ */ jsx2(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
|
1956
|
+
};
|
|
1957
|
+
Popper.displayName = POPPER_NAME;
|
|
1958
|
+
var ANCHOR_NAME = "PopperAnchor";
|
|
1959
|
+
var PopperAnchor = React3.forwardRef(
|
|
1960
|
+
(props, forwardedRef) => {
|
|
1961
|
+
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
1962
|
+
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
1963
|
+
const ref = React3.useRef(null);
|
|
1964
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
1965
|
+
React3.useEffect(() => {
|
|
1966
|
+
context.onAnchorChange(virtualRef?.current || ref.current);
|
|
1967
|
+
});
|
|
1968
|
+
return virtualRef ? null : /* @__PURE__ */ jsx2(Primitive.div, { ...anchorProps, ref: composedRefs });
|
|
1969
|
+
}
|
|
1970
|
+
);
|
|
1971
|
+
PopperAnchor.displayName = ANCHOR_NAME;
|
|
1972
|
+
var CONTENT_NAME = "PopperContent";
|
|
1973
|
+
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
|
|
1974
|
+
var PopperContent = React3.forwardRef(
|
|
1975
|
+
(props, forwardedRef) => {
|
|
1976
|
+
const {
|
|
1977
|
+
__scopePopper,
|
|
1978
|
+
side = "bottom",
|
|
1979
|
+
sideOffset = 0,
|
|
1980
|
+
align = "center",
|
|
1981
|
+
alignOffset = 0,
|
|
1982
|
+
arrowPadding = 0,
|
|
1983
|
+
avoidCollisions = true,
|
|
1984
|
+
collisionBoundary = [],
|
|
1985
|
+
collisionPadding: collisionPaddingProp = 0,
|
|
1986
|
+
sticky = "partial",
|
|
1987
|
+
hideWhenDetached = false,
|
|
1988
|
+
updatePositionStrategy = "optimized",
|
|
1989
|
+
onPlaced,
|
|
1990
|
+
...contentProps
|
|
1991
|
+
} = props;
|
|
1992
|
+
const context = usePopperContext(CONTENT_NAME, __scopePopper);
|
|
1993
|
+
const [content, setContent] = React3.useState(null);
|
|
1994
|
+
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
1995
|
+
const [arrow4, setArrow] = React3.useState(null);
|
|
1996
|
+
const arrowSize = useSize(arrow4);
|
|
1997
|
+
const arrowWidth = arrowSize?.width ?? 0;
|
|
1998
|
+
const arrowHeight = arrowSize?.height ?? 0;
|
|
1999
|
+
const desiredPlacement = side + (align !== "center" ? "-" + align : "");
|
|
2000
|
+
const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };
|
|
2001
|
+
const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];
|
|
2002
|
+
const hasExplicitBoundaries = boundary.length > 0;
|
|
2003
|
+
const detectOverflowOptions = {
|
|
2004
|
+
padding: collisionPadding,
|
|
2005
|
+
boundary: boundary.filter(isNotNull),
|
|
2006
|
+
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
2007
|
+
altBoundary: hasExplicitBoundaries
|
|
2008
|
+
};
|
|
2009
|
+
const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({
|
|
2010
|
+
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
2011
|
+
strategy: "fixed",
|
|
2012
|
+
placement: desiredPlacement,
|
|
2013
|
+
whileElementsMounted: (...args) => {
|
|
2014
|
+
const cleanup = autoUpdate(...args, {
|
|
2015
|
+
animationFrame: updatePositionStrategy === "always"
|
|
2016
|
+
});
|
|
2017
|
+
return cleanup;
|
|
2018
|
+
},
|
|
2019
|
+
elements: {
|
|
2020
|
+
reference: context.anchor
|
|
2021
|
+
},
|
|
2022
|
+
middleware: [
|
|
2023
|
+
offset3({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),
|
|
2024
|
+
avoidCollisions && shift3({
|
|
2025
|
+
mainAxis: true,
|
|
2026
|
+
crossAxis: false,
|
|
2027
|
+
limiter: sticky === "partial" ? limitShift3() : void 0,
|
|
2028
|
+
...detectOverflowOptions
|
|
2029
|
+
}),
|
|
2030
|
+
avoidCollisions && flip3({ ...detectOverflowOptions }),
|
|
2031
|
+
size3({
|
|
2032
|
+
...detectOverflowOptions,
|
|
2033
|
+
apply: ({ elements, rects, availableWidth, availableHeight }) => {
|
|
2034
|
+
const { width: anchorWidth, height: anchorHeight } = rects.reference;
|
|
2035
|
+
const contentStyle = elements.floating.style;
|
|
2036
|
+
contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
|
|
2037
|
+
contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`);
|
|
2038
|
+
contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`);
|
|
2039
|
+
contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
|
|
2040
|
+
}
|
|
2041
|
+
}),
|
|
2042
|
+
arrow4 && arrow3({ element: arrow4, padding: arrowPadding }),
|
|
2043
|
+
transformOrigin({ arrowWidth, arrowHeight }),
|
|
2044
|
+
hideWhenDetached && hide3({ strategy: "referenceHidden", ...detectOverflowOptions })
|
|
2045
|
+
]
|
|
2046
|
+
});
|
|
2047
|
+
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
|
2048
|
+
const handlePlaced = useCallbackRef(onPlaced);
|
|
2049
|
+
useLayoutEffect2(() => {
|
|
2050
|
+
if (isPositioned) {
|
|
2051
|
+
handlePlaced?.();
|
|
2052
|
+
}
|
|
2053
|
+
}, [isPositioned, handlePlaced]);
|
|
2054
|
+
const arrowX = middlewareData.arrow?.x;
|
|
2055
|
+
const arrowY = middlewareData.arrow?.y;
|
|
2056
|
+
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
2057
|
+
const [contentZIndex, setContentZIndex] = React3.useState();
|
|
2058
|
+
useLayoutEffect2(() => {
|
|
2059
|
+
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
2060
|
+
}, [content]);
|
|
2061
|
+
return /* @__PURE__ */ jsx2(
|
|
2062
|
+
"div",
|
|
2063
|
+
{
|
|
2064
|
+
ref: refs.setFloating,
|
|
2065
|
+
"data-radix-popper-content-wrapper": "",
|
|
2066
|
+
style: {
|
|
2067
|
+
...floatingStyles,
|
|
2068
|
+
transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)",
|
|
2069
|
+
// keep off the page when measuring
|
|
2070
|
+
minWidth: "max-content",
|
|
2071
|
+
zIndex: contentZIndex,
|
|
2072
|
+
["--radix-popper-transform-origin"]: [
|
|
2073
|
+
middlewareData.transformOrigin?.x,
|
|
2074
|
+
middlewareData.transformOrigin?.y
|
|
2075
|
+
].join(" "),
|
|
2076
|
+
// hide the content if using the hide middleware and should be hidden
|
|
2077
|
+
// set visibility to hidden and disable pointer events so the UI behaves
|
|
2078
|
+
// as if the PopperContent isn't there at all
|
|
2079
|
+
...middlewareData.hide?.referenceHidden && {
|
|
2080
|
+
visibility: "hidden",
|
|
2081
|
+
pointerEvents: "none"
|
|
2082
|
+
}
|
|
2083
|
+
},
|
|
2084
|
+
dir: props.dir,
|
|
2085
|
+
children: /* @__PURE__ */ jsx2(
|
|
2086
|
+
PopperContentProvider,
|
|
2087
|
+
{
|
|
2088
|
+
scope: __scopePopper,
|
|
2089
|
+
placedSide,
|
|
2090
|
+
onArrowChange: setArrow,
|
|
2091
|
+
arrowX,
|
|
2092
|
+
arrowY,
|
|
2093
|
+
shouldHideArrow: cannotCenterArrow,
|
|
2094
|
+
children: /* @__PURE__ */ jsx2(
|
|
2095
|
+
Primitive.div,
|
|
2096
|
+
{
|
|
2097
|
+
"data-side": placedSide,
|
|
2098
|
+
"data-align": placedAlign,
|
|
2099
|
+
...contentProps,
|
|
2100
|
+
ref: composedRefs,
|
|
2101
|
+
style: {
|
|
2102
|
+
...contentProps.style,
|
|
2103
|
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
2104
|
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
2105
|
+
animation: !isPositioned ? "none" : void 0
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
)
|
|
2109
|
+
}
|
|
2110
|
+
)
|
|
2111
|
+
}
|
|
2112
|
+
);
|
|
2113
|
+
}
|
|
2114
|
+
);
|
|
2115
|
+
PopperContent.displayName = CONTENT_NAME;
|
|
2116
|
+
var ARROW_NAME = "PopperArrow";
|
|
2117
|
+
var OPPOSITE_SIDE = {
|
|
2118
|
+
top: "bottom",
|
|
2119
|
+
right: "left",
|
|
2120
|
+
bottom: "top",
|
|
2121
|
+
left: "right"
|
|
2122
|
+
};
|
|
2123
|
+
var PopperArrow = React3.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
2124
|
+
const { __scopePopper, ...arrowProps } = props;
|
|
2125
|
+
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
|
2126
|
+
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
2127
|
+
return (
|
|
2128
|
+
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
2129
|
+
// doesn't report size as we'd expect on SVG elements.
|
|
2130
|
+
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
2131
|
+
/* @__PURE__ */ jsx2(
|
|
2132
|
+
"span",
|
|
2133
|
+
{
|
|
2134
|
+
ref: contentContext.onArrowChange,
|
|
2135
|
+
style: {
|
|
2136
|
+
position: "absolute",
|
|
2137
|
+
left: contentContext.arrowX,
|
|
2138
|
+
top: contentContext.arrowY,
|
|
2139
|
+
[baseSide]: 0,
|
|
2140
|
+
transformOrigin: {
|
|
2141
|
+
top: "",
|
|
2142
|
+
right: "0 0",
|
|
2143
|
+
bottom: "center 0",
|
|
2144
|
+
left: "100% 0"
|
|
2145
|
+
}[contentContext.placedSide],
|
|
2146
|
+
transform: {
|
|
2147
|
+
top: "translateY(100%)",
|
|
2148
|
+
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
|
2149
|
+
bottom: `rotate(180deg)`,
|
|
2150
|
+
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
|
2151
|
+
}[contentContext.placedSide],
|
|
2152
|
+
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
|
2153
|
+
},
|
|
2154
|
+
children: /* @__PURE__ */ jsx2(
|
|
2155
|
+
Root,
|
|
2156
|
+
{
|
|
2157
|
+
...arrowProps,
|
|
2158
|
+
ref: forwardedRef,
|
|
2159
|
+
style: {
|
|
2160
|
+
...arrowProps.style,
|
|
2161
|
+
// ensures the element can be measured correctly (mostly for if SVG)
|
|
2162
|
+
display: "block"
|
|
2163
|
+
}
|
|
2164
|
+
}
|
|
2165
|
+
)
|
|
2166
|
+
}
|
|
2167
|
+
)
|
|
2168
|
+
);
|
|
2169
|
+
});
|
|
2170
|
+
PopperArrow.displayName = ARROW_NAME;
|
|
2171
|
+
function isNotNull(value) {
|
|
2172
|
+
return value !== null;
|
|
2173
|
+
}
|
|
2174
|
+
var transformOrigin = (options) => ({
|
|
2175
|
+
name: "transformOrigin",
|
|
2176
|
+
options,
|
|
2177
|
+
fn(data) {
|
|
2178
|
+
const { placement, rects, middlewareData } = data;
|
|
2179
|
+
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
2180
|
+
const isArrowHidden = cannotCenterArrow;
|
|
2181
|
+
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
|
|
2182
|
+
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
|
|
2183
|
+
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
|
2184
|
+
const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign];
|
|
2185
|
+
const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
|
|
2186
|
+
const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
|
|
2187
|
+
let x = "";
|
|
2188
|
+
let y = "";
|
|
2189
|
+
if (placedSide === "bottom") {
|
|
2190
|
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
2191
|
+
y = `${-arrowHeight}px`;
|
|
2192
|
+
} else if (placedSide === "top") {
|
|
2193
|
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
2194
|
+
y = `${rects.floating.height + arrowHeight}px`;
|
|
2195
|
+
} else if (placedSide === "right") {
|
|
2196
|
+
x = `${-arrowHeight}px`;
|
|
2197
|
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
2198
|
+
} else if (placedSide === "left") {
|
|
2199
|
+
x = `${rects.floating.width + arrowHeight}px`;
|
|
2200
|
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
2201
|
+
}
|
|
2202
|
+
return { data: { x, y } };
|
|
2203
|
+
}
|
|
2204
|
+
});
|
|
2205
|
+
function getSideAndAlignFromPlacement(placement) {
|
|
2206
|
+
const [side, align = "center"] = placement.split("-");
|
|
2207
|
+
return [side, align];
|
|
2208
|
+
}
|
|
2209
|
+
var Root2 = Popper;
|
|
2210
|
+
var Anchor = PopperAnchor;
|
|
2211
|
+
var Content = PopperContent;
|
|
2212
|
+
var Arrow2 = PopperArrow;
|
|
2213
|
+
|
|
2214
|
+
// ../node_modules/.pnpm/@radix-ui+react-popover@1.1.14_@types+react-dom@19.1.6_@types+react@19.1.8__@types+react@19.1_pyqmioko53yxjnlrzhv5y3hiqq/node_modules/@radix-ui/react-popover/dist/index.mjs
|
|
2215
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
2216
|
+
var POPOVER_NAME = "Popover";
|
|
2217
|
+
var [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [
|
|
2218
|
+
createPopperScope
|
|
2219
|
+
]);
|
|
2220
|
+
var usePopperScope = createPopperScope();
|
|
2221
|
+
var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
|
|
2222
|
+
var Popover = (props) => {
|
|
2223
|
+
const {
|
|
2224
|
+
__scopePopover,
|
|
2225
|
+
children,
|
|
2226
|
+
open: openProp,
|
|
2227
|
+
defaultOpen,
|
|
2228
|
+
onOpenChange,
|
|
2229
|
+
modal = false
|
|
2230
|
+
} = props;
|
|
2231
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
2232
|
+
const triggerRef = React4.useRef(null);
|
|
2233
|
+
const [hasCustomAnchor, setHasCustomAnchor] = React4.useState(false);
|
|
2234
|
+
const [open, setOpen] = useControllableState({
|
|
2235
|
+
prop: openProp,
|
|
2236
|
+
defaultProp: defaultOpen ?? false,
|
|
2237
|
+
onChange: onOpenChange,
|
|
2238
|
+
caller: POPOVER_NAME
|
|
2239
|
+
});
|
|
2240
|
+
return /* @__PURE__ */ jsx3(Root2, { ...popperScope, children: /* @__PURE__ */ jsx3(
|
|
2241
|
+
PopoverProvider,
|
|
2242
|
+
{
|
|
2243
|
+
scope: __scopePopover,
|
|
2244
|
+
contentId: useId(),
|
|
2245
|
+
triggerRef,
|
|
2246
|
+
open,
|
|
2247
|
+
onOpenChange: setOpen,
|
|
2248
|
+
onOpenToggle: React4.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
2249
|
+
hasCustomAnchor,
|
|
2250
|
+
onCustomAnchorAdd: React4.useCallback(() => setHasCustomAnchor(true), []),
|
|
2251
|
+
onCustomAnchorRemove: React4.useCallback(() => setHasCustomAnchor(false), []),
|
|
2252
|
+
modal,
|
|
2253
|
+
children
|
|
2254
|
+
}
|
|
2255
|
+
) });
|
|
2256
|
+
};
|
|
2257
|
+
Popover.displayName = POPOVER_NAME;
|
|
2258
|
+
var ANCHOR_NAME2 = "PopoverAnchor";
|
|
2259
|
+
var PopoverAnchor = React4.forwardRef(
|
|
2260
|
+
(props, forwardedRef) => {
|
|
2261
|
+
const { __scopePopover, ...anchorProps } = props;
|
|
2262
|
+
const context = usePopoverContext(ANCHOR_NAME2, __scopePopover);
|
|
2263
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
2264
|
+
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
2265
|
+
React4.useEffect(() => {
|
|
2266
|
+
onCustomAnchorAdd();
|
|
2267
|
+
return () => onCustomAnchorRemove();
|
|
2268
|
+
}, [onCustomAnchorAdd, onCustomAnchorRemove]);
|
|
2269
|
+
return /* @__PURE__ */ jsx3(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
|
|
2270
|
+
}
|
|
2271
|
+
);
|
|
2272
|
+
PopoverAnchor.displayName = ANCHOR_NAME2;
|
|
2273
|
+
var TRIGGER_NAME = "PopoverTrigger";
|
|
2274
|
+
var PopoverTrigger = React4.forwardRef(
|
|
2275
|
+
(props, forwardedRef) => {
|
|
2276
|
+
const { __scopePopover, ...triggerProps } = props;
|
|
2277
|
+
const context = usePopoverContext(TRIGGER_NAME, __scopePopover);
|
|
2278
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
2279
|
+
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
2280
|
+
const trigger = /* @__PURE__ */ jsx3(
|
|
2281
|
+
Primitive.button,
|
|
2282
|
+
{
|
|
2283
|
+
type: "button",
|
|
2284
|
+
"aria-haspopup": "dialog",
|
|
2285
|
+
"aria-expanded": context.open,
|
|
2286
|
+
"aria-controls": context.contentId,
|
|
2287
|
+
"data-state": getState(context.open),
|
|
2288
|
+
...triggerProps,
|
|
2289
|
+
ref: composedTriggerRef,
|
|
2290
|
+
onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
|
|
2291
|
+
}
|
|
2292
|
+
);
|
|
2293
|
+
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx3(Anchor, { asChild: true, ...popperScope, children: trigger });
|
|
2294
|
+
}
|
|
2295
|
+
);
|
|
2296
|
+
PopoverTrigger.displayName = TRIGGER_NAME;
|
|
2297
|
+
var PORTAL_NAME = "PopoverPortal";
|
|
2298
|
+
var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, {
|
|
2299
|
+
forceMount: void 0
|
|
2300
|
+
});
|
|
2301
|
+
var PopoverPortal = (props) => {
|
|
2302
|
+
const { __scopePopover, forceMount, children, container } = props;
|
|
2303
|
+
const context = usePopoverContext(PORTAL_NAME, __scopePopover);
|
|
2304
|
+
return /* @__PURE__ */ jsx3(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx3(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx3(Portal, { asChild: true, container, children }) }) });
|
|
2305
|
+
};
|
|
2306
|
+
PopoverPortal.displayName = PORTAL_NAME;
|
|
2307
|
+
var CONTENT_NAME2 = "PopoverContent";
|
|
2308
|
+
var PopoverContent = React4.forwardRef(
|
|
2309
|
+
(props, forwardedRef) => {
|
|
2310
|
+
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopePopover);
|
|
2311
|
+
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
2312
|
+
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
2313
|
+
return /* @__PURE__ */ jsx3(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx3(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx3(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
|
2314
|
+
}
|
|
2315
|
+
);
|
|
2316
|
+
PopoverContent.displayName = CONTENT_NAME2;
|
|
2317
|
+
var Slot = createSlot("PopoverContent.RemoveScroll");
|
|
2318
|
+
var PopoverContentModal = React4.forwardRef(
|
|
2319
|
+
(props, forwardedRef) => {
|
|
2320
|
+
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
2321
|
+
const contentRef = React4.useRef(null);
|
|
2322
|
+
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
2323
|
+
const isRightClickOutsideRef = React4.useRef(false);
|
|
2324
|
+
React4.useEffect(() => {
|
|
2325
|
+
const content = contentRef.current;
|
|
2326
|
+
if (content) return hideOthers(content);
|
|
2327
|
+
}, []);
|
|
2328
|
+
return /* @__PURE__ */ jsx3(Combination_default, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx3(
|
|
2329
|
+
PopoverContentImpl,
|
|
2330
|
+
{
|
|
2331
|
+
...props,
|
|
2332
|
+
ref: composedRefs,
|
|
2333
|
+
trapFocus: context.open,
|
|
2334
|
+
disableOutsidePointerEvents: true,
|
|
2335
|
+
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
2336
|
+
event.preventDefault();
|
|
2337
|
+
if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();
|
|
2338
|
+
}),
|
|
2339
|
+
onPointerDownOutside: composeEventHandlers(
|
|
2340
|
+
props.onPointerDownOutside,
|
|
2341
|
+
(event) => {
|
|
2342
|
+
const originalEvent = event.detail.originalEvent;
|
|
2343
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
2344
|
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
2345
|
+
isRightClickOutsideRef.current = isRightClick;
|
|
2346
|
+
},
|
|
2347
|
+
{ checkForDefaultPrevented: false }
|
|
2348
|
+
),
|
|
2349
|
+
onFocusOutside: composeEventHandlers(
|
|
2350
|
+
props.onFocusOutside,
|
|
2351
|
+
(event) => event.preventDefault(),
|
|
2352
|
+
{ checkForDefaultPrevented: false }
|
|
2353
|
+
)
|
|
2354
|
+
}
|
|
2355
|
+
) });
|
|
2356
|
+
}
|
|
2357
|
+
);
|
|
2358
|
+
var PopoverContentNonModal = React4.forwardRef(
|
|
2359
|
+
(props, forwardedRef) => {
|
|
2360
|
+
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
2361
|
+
const hasInteractedOutsideRef = React4.useRef(false);
|
|
2362
|
+
const hasPointerDownOutsideRef = React4.useRef(false);
|
|
2363
|
+
return /* @__PURE__ */ jsx3(
|
|
2364
|
+
PopoverContentImpl,
|
|
2365
|
+
{
|
|
2366
|
+
...props,
|
|
2367
|
+
ref: forwardedRef,
|
|
2368
|
+
trapFocus: false,
|
|
2369
|
+
disableOutsidePointerEvents: false,
|
|
2370
|
+
onCloseAutoFocus: (event) => {
|
|
2371
|
+
props.onCloseAutoFocus?.(event);
|
|
2372
|
+
if (!event.defaultPrevented) {
|
|
2373
|
+
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
|
2374
|
+
event.preventDefault();
|
|
2375
|
+
}
|
|
2376
|
+
hasInteractedOutsideRef.current = false;
|
|
2377
|
+
hasPointerDownOutsideRef.current = false;
|
|
2378
|
+
},
|
|
2379
|
+
onInteractOutside: (event) => {
|
|
2380
|
+
props.onInteractOutside?.(event);
|
|
2381
|
+
if (!event.defaultPrevented) {
|
|
2382
|
+
hasInteractedOutsideRef.current = true;
|
|
2383
|
+
if (event.detail.originalEvent.type === "pointerdown") {
|
|
2384
|
+
hasPointerDownOutsideRef.current = true;
|
|
2385
|
+
}
|
|
2386
|
+
}
|
|
2387
|
+
const target = event.target;
|
|
2388
|
+
const targetIsTrigger = context.triggerRef.current?.contains(target);
|
|
2389
|
+
if (targetIsTrigger) event.preventDefault();
|
|
2390
|
+
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
|
|
2391
|
+
event.preventDefault();
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
);
|
|
2396
|
+
}
|
|
2397
|
+
);
|
|
2398
|
+
var PopoverContentImpl = React4.forwardRef(
|
|
2399
|
+
(props, forwardedRef) => {
|
|
2400
|
+
const {
|
|
2401
|
+
__scopePopover,
|
|
2402
|
+
trapFocus,
|
|
2403
|
+
onOpenAutoFocus,
|
|
2404
|
+
onCloseAutoFocus,
|
|
2405
|
+
disableOutsidePointerEvents,
|
|
2406
|
+
onEscapeKeyDown,
|
|
2407
|
+
onPointerDownOutside,
|
|
2408
|
+
onFocusOutside,
|
|
2409
|
+
onInteractOutside,
|
|
2410
|
+
...contentProps
|
|
2411
|
+
} = props;
|
|
2412
|
+
const context = usePopoverContext(CONTENT_NAME2, __scopePopover);
|
|
2413
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
2414
|
+
useFocusGuards();
|
|
2415
|
+
return /* @__PURE__ */ jsx3(
|
|
2416
|
+
FocusScope,
|
|
2417
|
+
{
|
|
2418
|
+
asChild: true,
|
|
2419
|
+
loop: true,
|
|
2420
|
+
trapped: trapFocus,
|
|
2421
|
+
onMountAutoFocus: onOpenAutoFocus,
|
|
2422
|
+
onUnmountAutoFocus: onCloseAutoFocus,
|
|
2423
|
+
children: /* @__PURE__ */ jsx3(
|
|
2424
|
+
DismissableLayer,
|
|
2425
|
+
{
|
|
2426
|
+
asChild: true,
|
|
2427
|
+
disableOutsidePointerEvents,
|
|
2428
|
+
onInteractOutside,
|
|
2429
|
+
onEscapeKeyDown,
|
|
2430
|
+
onPointerDownOutside,
|
|
2431
|
+
onFocusOutside,
|
|
2432
|
+
onDismiss: () => context.onOpenChange(false),
|
|
2433
|
+
children: /* @__PURE__ */ jsx3(
|
|
2434
|
+
Content,
|
|
2435
|
+
{
|
|
2436
|
+
"data-state": getState(context.open),
|
|
2437
|
+
role: "dialog",
|
|
2438
|
+
id: context.contentId,
|
|
2439
|
+
...popperScope,
|
|
2440
|
+
...contentProps,
|
|
2441
|
+
ref: forwardedRef,
|
|
2442
|
+
style: {
|
|
2443
|
+
...contentProps.style,
|
|
2444
|
+
// re-namespace exposed content custom properties
|
|
2445
|
+
...{
|
|
2446
|
+
"--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
2447
|
+
"--radix-popover-content-available-width": "var(--radix-popper-available-width)",
|
|
2448
|
+
"--radix-popover-content-available-height": "var(--radix-popper-available-height)",
|
|
2449
|
+
"--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
|
|
2450
|
+
"--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
)
|
|
2455
|
+
}
|
|
2456
|
+
)
|
|
2457
|
+
}
|
|
2458
|
+
);
|
|
2459
|
+
}
|
|
2460
|
+
);
|
|
2461
|
+
var CLOSE_NAME = "PopoverClose";
|
|
2462
|
+
var PopoverClose = React4.forwardRef(
|
|
2463
|
+
(props, forwardedRef) => {
|
|
2464
|
+
const { __scopePopover, ...closeProps } = props;
|
|
2465
|
+
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
2466
|
+
return /* @__PURE__ */ jsx3(
|
|
2467
|
+
Primitive.button,
|
|
2468
|
+
{
|
|
2469
|
+
type: "button",
|
|
2470
|
+
...closeProps,
|
|
2471
|
+
ref: forwardedRef,
|
|
2472
|
+
onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
|
|
2473
|
+
}
|
|
2474
|
+
);
|
|
2475
|
+
}
|
|
2476
|
+
);
|
|
2477
|
+
PopoverClose.displayName = CLOSE_NAME;
|
|
2478
|
+
var ARROW_NAME2 = "PopoverArrow";
|
|
2479
|
+
var PopoverArrow = React4.forwardRef(
|
|
2480
|
+
(props, forwardedRef) => {
|
|
2481
|
+
const { __scopePopover, ...arrowProps } = props;
|
|
2482
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
2483
|
+
return /* @__PURE__ */ jsx3(Arrow2, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
2484
|
+
}
|
|
2485
|
+
);
|
|
2486
|
+
PopoverArrow.displayName = ARROW_NAME2;
|
|
2487
|
+
function getState(open) {
|
|
2488
|
+
return open ? "open" : "closed";
|
|
2489
|
+
}
|
|
2490
|
+
var Root22 = Popover;
|
|
2491
|
+
var Anchor2 = PopoverAnchor;
|
|
2492
|
+
var Trigger = PopoverTrigger;
|
|
2493
|
+
var Content2 = PopoverContent;
|
|
2494
|
+
|
|
2495
|
+
// src/libraries/react/components/ui/popover.tsx
|
|
2496
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
2497
|
+
var Popover2 = Root22;
|
|
2498
|
+
var PopoverTrigger2 = Trigger;
|
|
2499
|
+
var PopoverAnchor2 = Anchor2;
|
|
2500
|
+
var PopoverContent2 = React5.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
2501
|
+
Content2,
|
|
2502
|
+
{
|
|
2503
|
+
ref,
|
|
2504
|
+
align,
|
|
2505
|
+
sideOffset,
|
|
2506
|
+
className: cn(
|
|
2507
|
+
"au-root au-z-[9999] au-w-72 au-rounded-md au-border au-bg-popover au-p-4 au-text-popover-foreground au-shadow-md au-outline-none data-[state=open]:au-animate-in data-[state=closed]:au-animate-out data-[state=closed]:au-fade-out-0 data-[state=open]:au-fade-in-0 data-[state=closed]:au-zoom-out-95 data-[state=open]:au-zoom-in-95 data-[side=bottom]:au-slide-in-from-top-2 data-[side=left]:au-slide-in-from-right-2 data-[side=right]:au-slide-in-from-left-2 data-[side=top]:au-slide-in-from-bottom-2 au-origin-[--radix-popover-content-transform-origin]",
|
|
2508
|
+
className
|
|
2509
|
+
),
|
|
2510
|
+
...props
|
|
2511
|
+
}
|
|
2512
|
+
));
|
|
2513
|
+
PopoverContent2.displayName = Content2.displayName;
|
|
2514
|
+
|
|
2515
|
+
export {
|
|
2516
|
+
Popover2 as Popover,
|
|
2517
|
+
PopoverTrigger2 as PopoverTrigger,
|
|
2518
|
+
PopoverAnchor2 as PopoverAnchor,
|
|
2519
|
+
PopoverContent2 as PopoverContent
|
|
2520
|
+
};
|