astro-md-editor 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/.output/nitro.json +17 -0
  2. package/.output/public/assets/index-Cc7yKB0o.js +19 -0
  3. package/.output/public/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  4. package/.output/public/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  5. package/.output/public/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  6. package/.output/public/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  7. package/.output/public/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  8. package/.output/public/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  9. package/.output/public/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  10. package/.output/public/assets/main-DDBjVFnt.js +17 -0
  11. package/.output/public/assets/styles-ggfdUHMo.css +1 -0
  12. package/.output/public/favicon.ico +0 -0
  13. package/.output/public/logo192.png +0 -0
  14. package/.output/public/logo512.png +0 -0
  15. package/.output/public/manifest.json +25 -0
  16. package/.output/public/robots.txt +3 -0
  17. package/.output/server/__root-C09LBXMv.mjs +40 -0
  18. package/.output/server/_chunks/ssr-renderer.mjs +21 -0
  19. package/.output/server/_libs/ajv-formats.mjs +330 -0
  20. package/.output/server/_libs/ajv.mjs +5484 -0
  21. package/.output/server/_libs/base-ui__react.mjs +8712 -0
  22. package/.output/server/_libs/base-ui__utils.mjs +980 -0
  23. package/.output/server/_libs/class-variance-authority.mjs +44 -0
  24. package/.output/server/_libs/clsx.mjs +16 -0
  25. package/.output/server/_libs/cookie-es.mjs +58 -0
  26. package/.output/server/_libs/croner.mjs +1 -0
  27. package/.output/server/_libs/crossws.mjs +1 -0
  28. package/.output/server/_libs/date-fns.mjs +1716 -0
  29. package/.output/server/_libs/date-fns__tz.mjs +217 -0
  30. package/.output/server/_libs/extend-shallow.mjs +35 -0
  31. package/.output/server/_libs/fast-deep-equal.mjs +38 -0
  32. package/.output/server/_libs/fast-uri.mjs +725 -0
  33. package/.output/server/_libs/floating-ui__core.mjs +663 -0
  34. package/.output/server/_libs/floating-ui__dom.mjs +624 -0
  35. package/.output/server/_libs/floating-ui__react-dom.mjs +279 -0
  36. package/.output/server/_libs/floating-ui__utils.mjs +322 -0
  37. package/.output/server/_libs/gray-matter.mjs +393 -0
  38. package/.output/server/_libs/h3-v2.mjs +276 -0
  39. package/.output/server/_libs/h3.mjs +400 -0
  40. package/.output/server/_libs/hookable.mjs +1 -0
  41. package/.output/server/_libs/is-extendable.mjs +13 -0
  42. package/.output/server/_libs/isbot.mjs +20 -0
  43. package/.output/server/_libs/js-yaml.mjs +2822 -0
  44. package/.output/server/_libs/json-schema-traverse.mjs +91 -0
  45. package/.output/server/_libs/kind-of.mjs +125 -0
  46. package/.output/server/_libs/lucide-react.mjs +177 -0
  47. package/.output/server/_libs/ohash.mjs +1 -0
  48. package/.output/server/_libs/react-day-picker.mjs +2216 -0
  49. package/.output/server/_libs/react-dom.mjs +10779 -0
  50. package/.output/server/_libs/react-resizable-panels.mjs +2024 -0
  51. package/.output/server/_libs/react.mjs +513 -0
  52. package/.output/server/_libs/reselect.mjs +326 -0
  53. package/.output/server/_libs/rou3.mjs +8 -0
  54. package/.output/server/_libs/section-matter.mjs +112 -0
  55. package/.output/server/_libs/seroval-plugins.mjs +58 -0
  56. package/.output/server/_libs/seroval.mjs +1765 -0
  57. package/.output/server/_libs/srvx.mjs +736 -0
  58. package/.output/server/_libs/strip-bom-string.mjs +16 -0
  59. package/.output/server/_libs/tabbable.mjs +342 -0
  60. package/.output/server/_libs/tailwind-merge.mjs +3175 -0
  61. package/.output/server/_libs/tanstack__history.mjs +217 -0
  62. package/.output/server/_libs/tanstack__react-router.mjs +1464 -0
  63. package/.output/server/_libs/tanstack__react-store.mjs +1 -0
  64. package/.output/server/_libs/tanstack__router-core.mjs +4912 -0
  65. package/.output/server/_libs/tanstack__store.mjs +1 -0
  66. package/.output/server/_libs/tiny-invariant.mjs +12 -0
  67. package/.output/server/_libs/tiny-warning.mjs +5 -0
  68. package/.output/server/_libs/ufo.mjs +54 -0
  69. package/.output/server/_libs/unctx.mjs +1 -0
  70. package/.output/server/_libs/unstorage.mjs +1 -0
  71. package/.output/server/_libs/use-sync-external-store.mjs +139 -0
  72. package/.output/server/_libs/zod.mjs +3634 -0
  73. package/.output/server/_libs/zustand.mjs +43 -0
  74. package/.output/server/_ssr/RightSidebar-RSY9M7XF.mjs +218 -0
  75. package/.output/server/_ssr/collections.server-D6U2tEsT.mjs +120 -0
  76. package/.output/server/_ssr/createServerRpc-29xaFZcb.mjs +12 -0
  77. package/.output/server/_ssr/index-BaqV4cZC.mjs +2083 -0
  78. package/.output/server/_ssr/index-sQBM6rwN.mjs +115 -0
  79. package/.output/server/_ssr/index.mjs +1448 -0
  80. package/.output/server/_ssr/router-D4G1DGr3.mjs +155 -0
  81. package/.output/server/_ssr/start-HYkvq4Ni.mjs +4 -0
  82. package/.output/server/_tanstack-start-manifest_v-CYEHh_qB.mjs +4 -0
  83. package/.output/server/index.mjs +451 -0
  84. package/README.md +118 -0
  85. package/index.mjs +21 -0
  86. package/package.json +86 -0
  87. package/scripts/bootstrap-collections.mjs +1201 -0
@@ -0,0 +1,624 @@
1
+ import { f as flip$1, s as size$1, c as computePosition$1, o as offset$1, h as hide$1, a as shift$1, l as limitShift$1 } from "./floating-ui__core.mjs";
2
+ import { l as getOverflowAncestors, c as isElement, E as getDocumentElement, F as createCoords, g as getWindow, G as getFrameElement, h as getComputedStyle$1, B as rectToClientRect, f as floor, a as isHTMLElement, H as round, m as isWebKit, I as isTopLayer, k as getParentNode, j as isLastTraversableNode, J as isTableElement, K as isContainingBlock, L as getContainingBlock, A as max, z as min, d as getNodeName, i as isOverflowElement, M as getNodeScroll } from "./floating-ui__utils.mjs";
3
+ function getCssDimensions(element) {
4
+ const css = getComputedStyle$1(element);
5
+ let width = parseFloat(css.width) || 0;
6
+ let height = parseFloat(css.height) || 0;
7
+ const hasOffset = isHTMLElement(element);
8
+ const offsetWidth = hasOffset ? element.offsetWidth : width;
9
+ const offsetHeight = hasOffset ? element.offsetHeight : height;
10
+ const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
11
+ if (shouldFallback) {
12
+ width = offsetWidth;
13
+ height = offsetHeight;
14
+ }
15
+ return {
16
+ width,
17
+ height,
18
+ $: shouldFallback
19
+ };
20
+ }
21
+ function unwrapElement(element) {
22
+ return !isElement(element) ? element.contextElement : element;
23
+ }
24
+ function getScale(element) {
25
+ const domElement = unwrapElement(element);
26
+ if (!isHTMLElement(domElement)) {
27
+ return createCoords(1);
28
+ }
29
+ const rect = domElement.getBoundingClientRect();
30
+ const {
31
+ width,
32
+ height,
33
+ $
34
+ } = getCssDimensions(domElement);
35
+ let x = ($ ? round(rect.width) : rect.width) / width;
36
+ let y = ($ ? round(rect.height) : rect.height) / height;
37
+ if (!x || !Number.isFinite(x)) {
38
+ x = 1;
39
+ }
40
+ if (!y || !Number.isFinite(y)) {
41
+ y = 1;
42
+ }
43
+ return {
44
+ x,
45
+ y
46
+ };
47
+ }
48
+ const noOffsets = /* @__PURE__ */ createCoords(0);
49
+ function getVisualOffsets(element) {
50
+ const win = getWindow(element);
51
+ if (!isWebKit() || !win.visualViewport) {
52
+ return noOffsets;
53
+ }
54
+ return {
55
+ x: win.visualViewport.offsetLeft,
56
+ y: win.visualViewport.offsetTop
57
+ };
58
+ }
59
+ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
60
+ if (isFixed === void 0) {
61
+ isFixed = false;
62
+ }
63
+ if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
64
+ return false;
65
+ }
66
+ return isFixed;
67
+ }
68
+ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
69
+ if (includeScale === void 0) {
70
+ includeScale = false;
71
+ }
72
+ if (isFixedStrategy === void 0) {
73
+ isFixedStrategy = false;
74
+ }
75
+ const clientRect = element.getBoundingClientRect();
76
+ const domElement = unwrapElement(element);
77
+ let scale = createCoords(1);
78
+ if (includeScale) {
79
+ if (offsetParent) {
80
+ if (isElement(offsetParent)) {
81
+ scale = getScale(offsetParent);
82
+ }
83
+ } else {
84
+ scale = getScale(element);
85
+ }
86
+ }
87
+ const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
88
+ let x = (clientRect.left + visualOffsets.x) / scale.x;
89
+ let y = (clientRect.top + visualOffsets.y) / scale.y;
90
+ let width = clientRect.width / scale.x;
91
+ let height = clientRect.height / scale.y;
92
+ if (domElement) {
93
+ const win = getWindow(domElement);
94
+ const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
95
+ let currentWin = win;
96
+ let currentIFrame = getFrameElement(currentWin);
97
+ while (currentIFrame && offsetParent && offsetWin !== currentWin) {
98
+ const iframeScale = getScale(currentIFrame);
99
+ const iframeRect = currentIFrame.getBoundingClientRect();
100
+ const css = getComputedStyle$1(currentIFrame);
101
+ const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
102
+ const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
103
+ x *= iframeScale.x;
104
+ y *= iframeScale.y;
105
+ width *= iframeScale.x;
106
+ height *= iframeScale.y;
107
+ x += left;
108
+ y += top;
109
+ currentWin = getWindow(currentIFrame);
110
+ currentIFrame = getFrameElement(currentWin);
111
+ }
112
+ }
113
+ return rectToClientRect({
114
+ width,
115
+ height,
116
+ x,
117
+ y
118
+ });
119
+ }
120
+ function getWindowScrollBarX(element, rect) {
121
+ const leftScroll = getNodeScroll(element).scrollLeft;
122
+ if (!rect) {
123
+ return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
124
+ }
125
+ return rect.left + leftScroll;
126
+ }
127
+ function getHTMLOffset(documentElement, scroll) {
128
+ const htmlRect = documentElement.getBoundingClientRect();
129
+ const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
130
+ const y = htmlRect.top + scroll.scrollTop;
131
+ return {
132
+ x,
133
+ y
134
+ };
135
+ }
136
+ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
137
+ let {
138
+ elements,
139
+ rect,
140
+ offsetParent,
141
+ strategy
142
+ } = _ref;
143
+ const isFixed = strategy === "fixed";
144
+ const documentElement = getDocumentElement(offsetParent);
145
+ const topLayer = elements ? isTopLayer(elements.floating) : false;
146
+ if (offsetParent === documentElement || topLayer && isFixed) {
147
+ return rect;
148
+ }
149
+ let scroll = {
150
+ scrollLeft: 0,
151
+ scrollTop: 0
152
+ };
153
+ let scale = createCoords(1);
154
+ const offsets = createCoords(0);
155
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
156
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
157
+ if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
158
+ scroll = getNodeScroll(offsetParent);
159
+ }
160
+ if (isOffsetParentAnElement) {
161
+ const offsetRect = getBoundingClientRect(offsetParent);
162
+ scale = getScale(offsetParent);
163
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
164
+ offsets.y = offsetRect.y + offsetParent.clientTop;
165
+ }
166
+ }
167
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
168
+ return {
169
+ width: rect.width * scale.x,
170
+ height: rect.height * scale.y,
171
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
172
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
173
+ };
174
+ }
175
+ function getClientRects(element) {
176
+ return Array.from(element.getClientRects());
177
+ }
178
+ function getDocumentRect(element) {
179
+ const html = getDocumentElement(element);
180
+ const scroll = getNodeScroll(element);
181
+ const body = element.ownerDocument.body;
182
+ const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
183
+ const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
184
+ let x = -scroll.scrollLeft + getWindowScrollBarX(element);
185
+ const y = -scroll.scrollTop;
186
+ if (getComputedStyle$1(body).direction === "rtl") {
187
+ x += max(html.clientWidth, body.clientWidth) - width;
188
+ }
189
+ return {
190
+ width,
191
+ height,
192
+ x,
193
+ y
194
+ };
195
+ }
196
+ const SCROLLBAR_MAX = 25;
197
+ function getViewportRect(element, strategy) {
198
+ const win = getWindow(element);
199
+ const html = getDocumentElement(element);
200
+ const visualViewport = win.visualViewport;
201
+ let width = html.clientWidth;
202
+ let height = html.clientHeight;
203
+ let x = 0;
204
+ let y = 0;
205
+ if (visualViewport) {
206
+ width = visualViewport.width;
207
+ height = visualViewport.height;
208
+ const visualViewportBased = isWebKit();
209
+ if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
210
+ x = visualViewport.offsetLeft;
211
+ y = visualViewport.offsetTop;
212
+ }
213
+ }
214
+ const windowScrollbarX = getWindowScrollBarX(html);
215
+ if (windowScrollbarX <= 0) {
216
+ const doc = html.ownerDocument;
217
+ const body = doc.body;
218
+ const bodyStyles = getComputedStyle(body);
219
+ const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
220
+ const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
221
+ if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
222
+ width -= clippingStableScrollbarWidth;
223
+ }
224
+ } else if (windowScrollbarX <= SCROLLBAR_MAX) {
225
+ width += windowScrollbarX;
226
+ }
227
+ return {
228
+ width,
229
+ height,
230
+ x,
231
+ y
232
+ };
233
+ }
234
+ function getInnerBoundingClientRect(element, strategy) {
235
+ const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
236
+ const top = clientRect.top + element.clientTop;
237
+ const left = clientRect.left + element.clientLeft;
238
+ const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
239
+ const width = element.clientWidth * scale.x;
240
+ const height = element.clientHeight * scale.y;
241
+ const x = left * scale.x;
242
+ const y = top * scale.y;
243
+ return {
244
+ width,
245
+ height,
246
+ x,
247
+ y
248
+ };
249
+ }
250
+ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
251
+ let rect;
252
+ if (clippingAncestor === "viewport") {
253
+ rect = getViewportRect(element, strategy);
254
+ } else if (clippingAncestor === "document") {
255
+ rect = getDocumentRect(getDocumentElement(element));
256
+ } else if (isElement(clippingAncestor)) {
257
+ rect = getInnerBoundingClientRect(clippingAncestor, strategy);
258
+ } else {
259
+ const visualOffsets = getVisualOffsets(element);
260
+ rect = {
261
+ x: clippingAncestor.x - visualOffsets.x,
262
+ y: clippingAncestor.y - visualOffsets.y,
263
+ width: clippingAncestor.width,
264
+ height: clippingAncestor.height
265
+ };
266
+ }
267
+ return rectToClientRect(rect);
268
+ }
269
+ function hasFixedPositionAncestor(element, stopNode) {
270
+ const parentNode = getParentNode(element);
271
+ if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
272
+ return false;
273
+ }
274
+ return getComputedStyle$1(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
275
+ }
276
+ function getClippingElementAncestors(element, cache) {
277
+ const cachedResult = cache.get(element);
278
+ if (cachedResult) {
279
+ return cachedResult;
280
+ }
281
+ let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
282
+ let currentContainingBlockComputedStyle = null;
283
+ const elementIsFixed = getComputedStyle$1(element).position === "fixed";
284
+ let currentNode = elementIsFixed ? getParentNode(element) : element;
285
+ while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
286
+ const computedStyle = getComputedStyle$1(currentNode);
287
+ const currentNodeIsContaining = isContainingBlock(currentNode);
288
+ if (!currentNodeIsContaining && computedStyle.position === "fixed") {
289
+ currentContainingBlockComputedStyle = null;
290
+ }
291
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === "absolute" || currentContainingBlockComputedStyle.position === "fixed") || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
292
+ if (shouldDropCurrentNode) {
293
+ result = result.filter((ancestor) => ancestor !== currentNode);
294
+ } else {
295
+ currentContainingBlockComputedStyle = computedStyle;
296
+ }
297
+ currentNode = getParentNode(currentNode);
298
+ }
299
+ cache.set(element, result);
300
+ return result;
301
+ }
302
+ function getClippingRect(_ref) {
303
+ let {
304
+ element,
305
+ boundary,
306
+ rootBoundary,
307
+ strategy
308
+ } = _ref;
309
+ const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
310
+ const clippingAncestors = [...elementClippingAncestors, rootBoundary];
311
+ const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);
312
+ let top = firstRect.top;
313
+ let right = firstRect.right;
314
+ let bottom = firstRect.bottom;
315
+ let left = firstRect.left;
316
+ for (let i = 1; i < clippingAncestors.length; i++) {
317
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);
318
+ top = max(rect.top, top);
319
+ right = min(rect.right, right);
320
+ bottom = min(rect.bottom, bottom);
321
+ left = max(rect.left, left);
322
+ }
323
+ return {
324
+ width: right - left,
325
+ height: bottom - top,
326
+ x: left,
327
+ y: top
328
+ };
329
+ }
330
+ function getDimensions(element) {
331
+ const {
332
+ width,
333
+ height
334
+ } = getCssDimensions(element);
335
+ return {
336
+ width,
337
+ height
338
+ };
339
+ }
340
+ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
341
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
342
+ const documentElement = getDocumentElement(offsetParent);
343
+ const isFixed = strategy === "fixed";
344
+ const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
345
+ let scroll = {
346
+ scrollLeft: 0,
347
+ scrollTop: 0
348
+ };
349
+ const offsets = createCoords(0);
350
+ function setLeftRTLScrollbarOffset() {
351
+ offsets.x = getWindowScrollBarX(documentElement);
352
+ }
353
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
354
+ if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
355
+ scroll = getNodeScroll(offsetParent);
356
+ }
357
+ if (isOffsetParentAnElement) {
358
+ const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
359
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
360
+ offsets.y = offsetRect.y + offsetParent.clientTop;
361
+ } else if (documentElement) {
362
+ setLeftRTLScrollbarOffset();
363
+ }
364
+ }
365
+ if (isFixed && !isOffsetParentAnElement && documentElement) {
366
+ setLeftRTLScrollbarOffset();
367
+ }
368
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
369
+ const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
370
+ const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
371
+ return {
372
+ x,
373
+ y,
374
+ width: rect.width,
375
+ height: rect.height
376
+ };
377
+ }
378
+ function isStaticPositioned(element) {
379
+ return getComputedStyle$1(element).position === "static";
380
+ }
381
+ function getTrueOffsetParent(element, polyfill) {
382
+ if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") {
383
+ return null;
384
+ }
385
+ if (polyfill) {
386
+ return polyfill(element);
387
+ }
388
+ let rawOffsetParent = element.offsetParent;
389
+ if (getDocumentElement(element) === rawOffsetParent) {
390
+ rawOffsetParent = rawOffsetParent.ownerDocument.body;
391
+ }
392
+ return rawOffsetParent;
393
+ }
394
+ function getOffsetParent(element, polyfill) {
395
+ const win = getWindow(element);
396
+ if (isTopLayer(element)) {
397
+ return win;
398
+ }
399
+ if (!isHTMLElement(element)) {
400
+ let svgOffsetParent = getParentNode(element);
401
+ while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
402
+ if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
403
+ return svgOffsetParent;
404
+ }
405
+ svgOffsetParent = getParentNode(svgOffsetParent);
406
+ }
407
+ return win;
408
+ }
409
+ let offsetParent = getTrueOffsetParent(element, polyfill);
410
+ while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
411
+ offsetParent = getTrueOffsetParent(offsetParent, polyfill);
412
+ }
413
+ if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
414
+ return win;
415
+ }
416
+ return offsetParent || getContainingBlock(element) || win;
417
+ }
418
+ const getElementRects = async function(data) {
419
+ const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
420
+ const getDimensionsFn = this.getDimensions;
421
+ const floatingDimensions = await getDimensionsFn(data.floating);
422
+ return {
423
+ reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
424
+ floating: {
425
+ x: 0,
426
+ y: 0,
427
+ width: floatingDimensions.width,
428
+ height: floatingDimensions.height
429
+ }
430
+ };
431
+ };
432
+ function isRTL(element) {
433
+ return getComputedStyle$1(element).direction === "rtl";
434
+ }
435
+ const platform = {
436
+ convertOffsetParentRelativeRectToViewportRelativeRect,
437
+ getDocumentElement,
438
+ getClippingRect,
439
+ getOffsetParent,
440
+ getElementRects,
441
+ getClientRects,
442
+ getDimensions,
443
+ getScale,
444
+ isElement,
445
+ isRTL
446
+ };
447
+ function rectsAreEqual(a, b) {
448
+ return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
449
+ }
450
+ function observeMove(element, onMove) {
451
+ let io = null;
452
+ let timeoutId;
453
+ const root = getDocumentElement(element);
454
+ function cleanup() {
455
+ var _io;
456
+ clearTimeout(timeoutId);
457
+ (_io = io) == null || _io.disconnect();
458
+ io = null;
459
+ }
460
+ function refresh(skip, threshold) {
461
+ if (skip === void 0) {
462
+ skip = false;
463
+ }
464
+ if (threshold === void 0) {
465
+ threshold = 1;
466
+ }
467
+ cleanup();
468
+ const elementRectForRootMargin = element.getBoundingClientRect();
469
+ const {
470
+ left,
471
+ top,
472
+ width,
473
+ height
474
+ } = elementRectForRootMargin;
475
+ if (!skip) {
476
+ onMove();
477
+ }
478
+ if (!width || !height) {
479
+ return;
480
+ }
481
+ const insetTop = floor(top);
482
+ const insetRight = floor(root.clientWidth - (left + width));
483
+ const insetBottom = floor(root.clientHeight - (top + height));
484
+ const insetLeft = floor(left);
485
+ const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
486
+ const options = {
487
+ rootMargin,
488
+ threshold: max(0, min(1, threshold)) || 1
489
+ };
490
+ let isFirstUpdate = true;
491
+ function handleObserve(entries) {
492
+ const ratio = entries[0].intersectionRatio;
493
+ if (ratio !== threshold) {
494
+ if (!isFirstUpdate) {
495
+ return refresh();
496
+ }
497
+ if (!ratio) {
498
+ timeoutId = setTimeout(() => {
499
+ refresh(false, 1e-7);
500
+ }, 1e3);
501
+ } else {
502
+ refresh(false, ratio);
503
+ }
504
+ }
505
+ if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
506
+ refresh();
507
+ }
508
+ isFirstUpdate = false;
509
+ }
510
+ try {
511
+ io = new IntersectionObserver(handleObserve, {
512
+ ...options,
513
+ // Handle <iframe>s
514
+ root: root.ownerDocument
515
+ });
516
+ } catch (_e) {
517
+ io = new IntersectionObserver(handleObserve, options);
518
+ }
519
+ io.observe(element);
520
+ }
521
+ refresh(true);
522
+ return cleanup;
523
+ }
524
+ function autoUpdate(reference, floating, update, options) {
525
+ if (options === void 0) {
526
+ options = {};
527
+ }
528
+ const {
529
+ ancestorScroll = true,
530
+ ancestorResize = true,
531
+ elementResize = typeof ResizeObserver === "function",
532
+ layoutShift = typeof IntersectionObserver === "function",
533
+ animationFrame = false
534
+ } = options;
535
+ const referenceEl = unwrapElement(reference);
536
+ const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
537
+ ancestors.forEach((ancestor) => {
538
+ ancestorScroll && ancestor.addEventListener("scroll", update, {
539
+ passive: true
540
+ });
541
+ ancestorResize && ancestor.addEventListener("resize", update);
542
+ });
543
+ const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
544
+ let reobserveFrame = -1;
545
+ let resizeObserver = null;
546
+ if (elementResize) {
547
+ resizeObserver = new ResizeObserver((_ref) => {
548
+ let [firstEntry] = _ref;
549
+ if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {
550
+ resizeObserver.unobserve(floating);
551
+ cancelAnimationFrame(reobserveFrame);
552
+ reobserveFrame = requestAnimationFrame(() => {
553
+ var _resizeObserver;
554
+ (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
555
+ });
556
+ }
557
+ update();
558
+ });
559
+ if (referenceEl && !animationFrame) {
560
+ resizeObserver.observe(referenceEl);
561
+ }
562
+ if (floating) {
563
+ resizeObserver.observe(floating);
564
+ }
565
+ }
566
+ let frameId;
567
+ let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
568
+ if (animationFrame) {
569
+ frameLoop();
570
+ }
571
+ function frameLoop() {
572
+ const nextRefRect = getBoundingClientRect(reference);
573
+ if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
574
+ update();
575
+ }
576
+ prevRefRect = nextRefRect;
577
+ frameId = requestAnimationFrame(frameLoop);
578
+ }
579
+ update();
580
+ return () => {
581
+ var _resizeObserver2;
582
+ ancestors.forEach((ancestor) => {
583
+ ancestorScroll && ancestor.removeEventListener("scroll", update);
584
+ ancestorResize && ancestor.removeEventListener("resize", update);
585
+ });
586
+ cleanupIo == null || cleanupIo();
587
+ (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
588
+ resizeObserver = null;
589
+ if (animationFrame) {
590
+ cancelAnimationFrame(frameId);
591
+ }
592
+ };
593
+ }
594
+ const offset = offset$1;
595
+ const shift = shift$1;
596
+ const flip = flip$1;
597
+ const size = size$1;
598
+ const hide = hide$1;
599
+ const limitShift = limitShift$1;
600
+ const computePosition = (reference, floating, options) => {
601
+ const cache = /* @__PURE__ */ new Map();
602
+ const mergedOptions = {
603
+ platform,
604
+ ...options
605
+ };
606
+ const platformWithCache = {
607
+ ...mergedOptions.platform,
608
+ _c: cache
609
+ };
610
+ return computePosition$1(reference, floating, {
611
+ ...mergedOptions,
612
+ platform: platformWithCache
613
+ });
614
+ };
615
+ export {
616
+ autoUpdate as a,
617
+ shift as b,
618
+ computePosition as c,
619
+ flip as f,
620
+ hide as h,
621
+ limitShift as l,
622
+ offset as o,
623
+ size as s
624
+ };