@pnx-mixtape/mxds 0.0.15 → 0.0.16

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 (85) hide show
  1. package/dist/build/accordion.css +113 -1
  2. package/dist/build/accordion.entry.js +83 -1
  3. package/dist/build/accordion.entry.js.map +1 -0
  4. package/dist/build/base.css +1012 -1
  5. package/dist/build/breadcrumb.css +55 -1
  6. package/dist/build/button.css +127 -1
  7. package/dist/build/callout.css +11 -1
  8. package/dist/build/card.css +160 -1
  9. package/dist/build/carousel.css +125 -1
  10. package/dist/build/chunks/Accordion-O-huO4At.js +61 -0
  11. package/dist/build/chunks/Accordion-O-huO4At.js.map +1 -0
  12. package/dist/build/chunks/disclosure-widget-CtNx0f8p.js +124 -0
  13. package/dist/build/chunks/disclosure-widget-CtNx0f8p.js.map +1 -0
  14. package/dist/build/chunks/drop-menu.entry-BEhZ_Je3.js +132 -0
  15. package/dist/build/chunks/drop-menu.entry-BEhZ_Je3.js.map +1 -0
  16. package/dist/build/chunks/keyboard-C73DHu0c.js +101 -0
  17. package/dist/build/chunks/keyboard-C73DHu0c.js.map +1 -0
  18. package/dist/build/chunks/polyfills-DoxMZOqh.js +806 -0
  19. package/dist/build/chunks/polyfills-DoxMZOqh.js.map +1 -0
  20. package/dist/build/chunks/popover-DzUcnIlX.js +797 -0
  21. package/dist/build/chunks/popover-DzUcnIlX.js.map +1 -0
  22. package/dist/build/chunks/utilities-DXELy_An.js +245 -0
  23. package/dist/build/chunks/utilities-DXELy_An.js.map +1 -0
  24. package/dist/build/constants.css +151 -1
  25. package/dist/build/container-grid.css +186 -1
  26. package/dist/build/content-block.css +36 -1
  27. package/dist/build/dialog.css +116 -1
  28. package/dist/build/dialog.entry.js +93 -1
  29. package/dist/build/dialog.entry.js.map +1 -0
  30. package/dist/build/drop-menu.css +89 -1
  31. package/dist/build/drop-menu.entry.js +2 -1
  32. package/dist/build/drop-menu.entry.js.map +1 -0
  33. package/dist/build/drupal.css +70 -1
  34. package/dist/build/filters.css +117 -1
  35. package/dist/build/filters.entry.js +138 -1
  36. package/dist/build/filters.entry.js.map +1 -0
  37. package/dist/build/footer.css +141 -1
  38. package/dist/build/form.css +505 -1
  39. package/dist/build/global-alert.css +60 -1
  40. package/dist/build/global-alert.entry.js +68 -1
  41. package/dist/build/global-alert.entry.js.map +1 -0
  42. package/dist/build/grid.css +201 -1
  43. package/dist/build/header.css +161 -1
  44. package/dist/build/header.entry.js +103 -1
  45. package/dist/build/header.entry.js.map +1 -0
  46. package/dist/build/hero-banner.css +67 -1
  47. package/dist/build/icon.css +399 -1
  48. package/dist/build/in-page-alert.css +93 -1
  49. package/dist/build/in-page-navigation.css +17 -1
  50. package/dist/build/in-page-navigation.entry.js +99 -1
  51. package/dist/build/in-page-navigation.entry.js.map +1 -0
  52. package/dist/build/link-list.css +45 -1
  53. package/dist/build/list-item.css +29 -1
  54. package/dist/build/masthead.css +53 -1
  55. package/dist/build/navigation.css +391 -1
  56. package/dist/build/navigation.entry.js +124 -1
  57. package/dist/build/navigation.entry.js.map +1 -0
  58. package/dist/build/page.css +65 -1
  59. package/dist/build/pagination.css +117 -1
  60. package/dist/build/results-bar.css +21 -1
  61. package/dist/build/section.css +147 -1
  62. package/dist/build/side-navigation.css +85 -1
  63. package/dist/build/sidebar.css +53 -1
  64. package/dist/build/social-links.css +20 -1
  65. package/dist/build/steps.css +118 -1
  66. package/dist/build/sticky.css +47 -1
  67. package/dist/build/sticky.entry.js +60 -1
  68. package/dist/build/sticky.entry.js.map +1 -0
  69. package/dist/build/tabs.css +108 -1
  70. package/dist/build/tabs.entry.js +202 -1
  71. package/dist/build/tabs.entry.js.map +1 -0
  72. package/dist/build/tag.css +70 -1
  73. package/dist/build/utilities.css +178 -1
  74. package/package.json +11 -4
  75. package/src/Component/Carousel/Carousel.stories.ts +1 -1
  76. package/src/Component/DropMenu/drop-menu.css +1 -1
  77. package/src/Layout/Section/Section.stories.ts +2 -1
  78. package/src/Layout/Section/section.twig +3 -1
  79. package/dist/build/chunks/Accordion-RtUfbsTy.js +0 -1
  80. package/dist/build/chunks/disclosure-widget-CPdkUWkq.js +0 -1
  81. package/dist/build/chunks/drop-menu.entry-BqBzLfVC.js +0 -1
  82. package/dist/build/chunks/keyboard-Cs0cduxq.js +0 -1
  83. package/dist/build/chunks/polyfills-5KNOJw2W.js +0 -1
  84. package/dist/build/chunks/popover-CiVl-0jk.js +0 -1
  85. package/dist/build/chunks/utilities-CE6xwgqF.js +0 -2
@@ -0,0 +1,806 @@
1
+ const min = Math.min;
2
+ const max = Math.max;
3
+ const round = Math.round;
4
+ const createCoords = (v) => ({
5
+ x: v,
6
+ y: v
7
+ });
8
+ function getSide(placement) {
9
+ return placement.split("-")[0];
10
+ }
11
+ function getAlignment(placement) {
12
+ return placement.split("-")[1];
13
+ }
14
+ function getOppositeAxis(axis) {
15
+ return axis === "x" ? "y" : "x";
16
+ }
17
+ function getAxisLength(axis) {
18
+ return axis === "y" ? "height" : "width";
19
+ }
20
+ const yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
21
+ function getSideAxis(placement) {
22
+ return yAxisSides.has(getSide(placement)) ? "y" : "x";
23
+ }
24
+ function getAlignmentAxis(placement) {
25
+ return getOppositeAxis(getSideAxis(placement));
26
+ }
27
+ function rectToClientRect(rect) {
28
+ const {
29
+ x,
30
+ y,
31
+ width,
32
+ height
33
+ } = rect;
34
+ return {
35
+ width,
36
+ height,
37
+ top: y,
38
+ left: x,
39
+ right: x + width,
40
+ bottom: y + height,
41
+ x,
42
+ y
43
+ };
44
+ }
45
+ function computeCoordsFromPlacement(_ref, placement, rtl) {
46
+ let {
47
+ reference,
48
+ floating
49
+ } = _ref;
50
+ const sideAxis = getSideAxis(placement);
51
+ const alignmentAxis = getAlignmentAxis(placement);
52
+ const alignLength = getAxisLength(alignmentAxis);
53
+ const side = getSide(placement);
54
+ const isVertical = sideAxis === "y";
55
+ const commonX = reference.x + reference.width / 2 - floating.width / 2;
56
+ const commonY = reference.y + reference.height / 2 - floating.height / 2;
57
+ const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
58
+ let coords;
59
+ switch (side) {
60
+ case "top":
61
+ coords = {
62
+ x: commonX,
63
+ y: reference.y - floating.height
64
+ };
65
+ break;
66
+ case "bottom":
67
+ coords = {
68
+ x: commonX,
69
+ y: reference.y + reference.height
70
+ };
71
+ break;
72
+ case "right":
73
+ coords = {
74
+ x: reference.x + reference.width,
75
+ y: commonY
76
+ };
77
+ break;
78
+ case "left":
79
+ coords = {
80
+ x: reference.x - floating.width,
81
+ y: commonY
82
+ };
83
+ break;
84
+ default:
85
+ coords = {
86
+ x: reference.x,
87
+ y: reference.y
88
+ };
89
+ }
90
+ switch (getAlignment(placement)) {
91
+ case "start":
92
+ coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
93
+ break;
94
+ case "end":
95
+ coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
96
+ break;
97
+ }
98
+ return coords;
99
+ }
100
+ const computePosition$1 = async (reference, floating, config) => {
101
+ const {
102
+ placement = "bottom",
103
+ strategy = "absolute",
104
+ middleware = [],
105
+ platform: platform2
106
+ } = config;
107
+ const validMiddleware = middleware.filter(Boolean);
108
+ const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
109
+ let rects = await platform2.getElementRects({
110
+ reference,
111
+ floating,
112
+ strategy
113
+ });
114
+ let {
115
+ x,
116
+ y
117
+ } = computeCoordsFromPlacement(rects, placement, rtl);
118
+ let statefulPlacement = placement;
119
+ let middlewareData = {};
120
+ let resetCount = 0;
121
+ for (let i = 0; i < validMiddleware.length; i++) {
122
+ const {
123
+ name,
124
+ fn
125
+ } = validMiddleware[i];
126
+ const {
127
+ x: nextX,
128
+ y: nextY,
129
+ data,
130
+ reset
131
+ } = await fn({
132
+ x,
133
+ y,
134
+ initialPlacement: placement,
135
+ placement: statefulPlacement,
136
+ strategy,
137
+ middlewareData,
138
+ rects,
139
+ platform: platform2,
140
+ elements: {
141
+ reference,
142
+ floating
143
+ }
144
+ });
145
+ x = nextX != null ? nextX : x;
146
+ y = nextY != null ? nextY : y;
147
+ middlewareData = {
148
+ ...middlewareData,
149
+ [name]: {
150
+ ...middlewareData[name],
151
+ ...data
152
+ }
153
+ };
154
+ if (reset && resetCount <= 50) {
155
+ resetCount++;
156
+ if (typeof reset === "object") {
157
+ if (reset.placement) {
158
+ statefulPlacement = reset.placement;
159
+ }
160
+ if (reset.rects) {
161
+ rects = reset.rects === true ? await platform2.getElementRects({
162
+ reference,
163
+ floating,
164
+ strategy
165
+ }) : reset.rects;
166
+ }
167
+ ({
168
+ x,
169
+ y
170
+ } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
171
+ }
172
+ i = -1;
173
+ }
174
+ }
175
+ return {
176
+ x,
177
+ y,
178
+ placement: statefulPlacement,
179
+ strategy,
180
+ middlewareData
181
+ };
182
+ };
183
+ function hasWindow() {
184
+ return typeof window !== "undefined";
185
+ }
186
+ function getNodeName(node) {
187
+ if (isNode(node)) {
188
+ return (node.nodeName || "").toLowerCase();
189
+ }
190
+ return "#document";
191
+ }
192
+ function getWindow(node) {
193
+ var _node$ownerDocument;
194
+ return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
195
+ }
196
+ function getDocumentElement(node) {
197
+ var _ref;
198
+ return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
199
+ }
200
+ function isNode(value) {
201
+ if (!hasWindow()) {
202
+ return false;
203
+ }
204
+ return value instanceof Node || value instanceof getWindow(value).Node;
205
+ }
206
+ function isElement(value) {
207
+ if (!hasWindow()) {
208
+ return false;
209
+ }
210
+ return value instanceof Element || value instanceof getWindow(value).Element;
211
+ }
212
+ function isHTMLElement(value) {
213
+ if (!hasWindow()) {
214
+ return false;
215
+ }
216
+ return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
217
+ }
218
+ function isShadowRoot(value) {
219
+ if (!hasWindow() || typeof ShadowRoot === "undefined") {
220
+ return false;
221
+ }
222
+ return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
223
+ }
224
+ const invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
225
+ function isOverflowElement(element) {
226
+ const {
227
+ overflow,
228
+ overflowX,
229
+ overflowY,
230
+ display
231
+ } = getComputedStyle(element);
232
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
233
+ }
234
+ const tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]);
235
+ function isTableElement(element) {
236
+ return tableElements.has(getNodeName(element));
237
+ }
238
+ const topLayerSelectors = [":popover-open", ":modal"];
239
+ function isTopLayer(element) {
240
+ return topLayerSelectors.some((selector) => {
241
+ try {
242
+ return element.matches(selector);
243
+ } catch (_e) {
244
+ return false;
245
+ }
246
+ });
247
+ }
248
+ const transformProperties = ["transform", "translate", "scale", "rotate", "perspective"];
249
+ const willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"];
250
+ const containValues = ["paint", "layout", "strict", "content"];
251
+ function isContainingBlock(elementOrCss) {
252
+ const webkit = isWebKit();
253
+ const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
254
+ 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));
255
+ }
256
+ function getContainingBlock(element) {
257
+ let currentNode = getParentNode(element);
258
+ while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
259
+ if (isContainingBlock(currentNode)) {
260
+ return currentNode;
261
+ } else if (isTopLayer(currentNode)) {
262
+ return null;
263
+ }
264
+ currentNode = getParentNode(currentNode);
265
+ }
266
+ return null;
267
+ }
268
+ function isWebKit() {
269
+ if (typeof CSS === "undefined" || !CSS.supports) return false;
270
+ return CSS.supports("-webkit-backdrop-filter", "none");
271
+ }
272
+ const lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]);
273
+ function isLastTraversableNode(node) {
274
+ return lastTraversableNodeNames.has(getNodeName(node));
275
+ }
276
+ function getComputedStyle(element) {
277
+ return getWindow(element).getComputedStyle(element);
278
+ }
279
+ function getNodeScroll(element) {
280
+ if (isElement(element)) {
281
+ return {
282
+ scrollLeft: element.scrollLeft,
283
+ scrollTop: element.scrollTop
284
+ };
285
+ }
286
+ return {
287
+ scrollLeft: element.scrollX,
288
+ scrollTop: element.scrollY
289
+ };
290
+ }
291
+ function getParentNode(node) {
292
+ if (getNodeName(node) === "html") {
293
+ return node;
294
+ }
295
+ const result = (
296
+ // Step into the shadow DOM of the parent of a slotted node.
297
+ node.assignedSlot || // DOM Element detected.
298
+ node.parentNode || // ShadowRoot detected.
299
+ isShadowRoot(node) && node.host || // Fallback.
300
+ getDocumentElement(node)
301
+ );
302
+ return isShadowRoot(result) ? result.host : result;
303
+ }
304
+ function getNearestOverflowAncestor(node) {
305
+ const parentNode = getParentNode(node);
306
+ if (isLastTraversableNode(parentNode)) {
307
+ return node.ownerDocument ? node.ownerDocument.body : node.body;
308
+ }
309
+ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
310
+ return parentNode;
311
+ }
312
+ return getNearestOverflowAncestor(parentNode);
313
+ }
314
+ function getOverflowAncestors(node, list, traverseIframes) {
315
+ var _node$ownerDocument2;
316
+ if (list === void 0) {
317
+ list = [];
318
+ }
319
+ if (traverseIframes === void 0) {
320
+ traverseIframes = true;
321
+ }
322
+ const scrollableAncestor = getNearestOverflowAncestor(node);
323
+ const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
324
+ const win = getWindow(scrollableAncestor);
325
+ if (isBody) {
326
+ const frameElement = getFrameElement(win);
327
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
328
+ }
329
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
330
+ }
331
+ function getFrameElement(win) {
332
+ return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
333
+ }
334
+ function getCssDimensions(element) {
335
+ const css = getComputedStyle(element);
336
+ let width = parseFloat(css.width) || 0;
337
+ let height = parseFloat(css.height) || 0;
338
+ const hasOffset = isHTMLElement(element);
339
+ const offsetWidth = hasOffset ? element.offsetWidth : width;
340
+ const offsetHeight = hasOffset ? element.offsetHeight : height;
341
+ const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
342
+ if (shouldFallback) {
343
+ width = offsetWidth;
344
+ height = offsetHeight;
345
+ }
346
+ return {
347
+ width,
348
+ height,
349
+ $: shouldFallback
350
+ };
351
+ }
352
+ function unwrapElement(element) {
353
+ return !isElement(element) ? element.contextElement : element;
354
+ }
355
+ function getScale(element) {
356
+ const domElement = unwrapElement(element);
357
+ if (!isHTMLElement(domElement)) {
358
+ return createCoords(1);
359
+ }
360
+ const rect = domElement.getBoundingClientRect();
361
+ const {
362
+ width,
363
+ height,
364
+ $
365
+ } = getCssDimensions(domElement);
366
+ let x = ($ ? round(rect.width) : rect.width) / width;
367
+ let y = ($ ? round(rect.height) : rect.height) / height;
368
+ if (!x || !Number.isFinite(x)) {
369
+ x = 1;
370
+ }
371
+ if (!y || !Number.isFinite(y)) {
372
+ y = 1;
373
+ }
374
+ return {
375
+ x,
376
+ y
377
+ };
378
+ }
379
+ const noOffsets = /* @__PURE__ */ createCoords(0);
380
+ function getVisualOffsets(element) {
381
+ const win = getWindow(element);
382
+ if (!isWebKit() || !win.visualViewport) {
383
+ return noOffsets;
384
+ }
385
+ return {
386
+ x: win.visualViewport.offsetLeft,
387
+ y: win.visualViewport.offsetTop
388
+ };
389
+ }
390
+ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
391
+ if (isFixed === void 0) {
392
+ isFixed = false;
393
+ }
394
+ if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
395
+ return false;
396
+ }
397
+ return isFixed;
398
+ }
399
+ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
400
+ if (includeScale === void 0) {
401
+ includeScale = false;
402
+ }
403
+ if (isFixedStrategy === void 0) {
404
+ isFixedStrategy = false;
405
+ }
406
+ const clientRect = element.getBoundingClientRect();
407
+ const domElement = unwrapElement(element);
408
+ let scale = createCoords(1);
409
+ if (includeScale) {
410
+ if (offsetParent) {
411
+ if (isElement(offsetParent)) {
412
+ scale = getScale(offsetParent);
413
+ }
414
+ } else {
415
+ scale = getScale(element);
416
+ }
417
+ }
418
+ const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
419
+ let x = (clientRect.left + visualOffsets.x) / scale.x;
420
+ let y = (clientRect.top + visualOffsets.y) / scale.y;
421
+ let width = clientRect.width / scale.x;
422
+ let height = clientRect.height / scale.y;
423
+ if (domElement) {
424
+ const win = getWindow(domElement);
425
+ const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
426
+ let currentWin = win;
427
+ let currentIFrame = getFrameElement(currentWin);
428
+ while (currentIFrame && offsetParent && offsetWin !== currentWin) {
429
+ const iframeScale = getScale(currentIFrame);
430
+ const iframeRect = currentIFrame.getBoundingClientRect();
431
+ const css = getComputedStyle(currentIFrame);
432
+ const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
433
+ const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
434
+ x *= iframeScale.x;
435
+ y *= iframeScale.y;
436
+ width *= iframeScale.x;
437
+ height *= iframeScale.y;
438
+ x += left;
439
+ y += top;
440
+ currentWin = getWindow(currentIFrame);
441
+ currentIFrame = getFrameElement(currentWin);
442
+ }
443
+ }
444
+ return rectToClientRect({
445
+ width,
446
+ height,
447
+ x,
448
+ y
449
+ });
450
+ }
451
+ function getWindowScrollBarX(element, rect) {
452
+ const leftScroll = getNodeScroll(element).scrollLeft;
453
+ if (!rect) {
454
+ return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
455
+ }
456
+ return rect.left + leftScroll;
457
+ }
458
+ function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
459
+ if (ignoreScrollbarX === void 0) {
460
+ ignoreScrollbarX = false;
461
+ }
462
+ const htmlRect = documentElement.getBoundingClientRect();
463
+ const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 : (
464
+ // RTL <body> scrollbar.
465
+ getWindowScrollBarX(documentElement, htmlRect)
466
+ ));
467
+ const y = htmlRect.top + scroll.scrollTop;
468
+ return {
469
+ x,
470
+ y
471
+ };
472
+ }
473
+ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
474
+ let {
475
+ elements,
476
+ rect,
477
+ offsetParent,
478
+ strategy
479
+ } = _ref;
480
+ const isFixed = strategy === "fixed";
481
+ const documentElement = getDocumentElement(offsetParent);
482
+ const topLayer = elements ? isTopLayer(elements.floating) : false;
483
+ if (offsetParent === documentElement || topLayer && isFixed) {
484
+ return rect;
485
+ }
486
+ let scroll = {
487
+ scrollLeft: 0,
488
+ scrollTop: 0
489
+ };
490
+ let scale = createCoords(1);
491
+ const offsets = createCoords(0);
492
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
493
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
494
+ if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
495
+ scroll = getNodeScroll(offsetParent);
496
+ }
497
+ if (isHTMLElement(offsetParent)) {
498
+ const offsetRect = getBoundingClientRect(offsetParent);
499
+ scale = getScale(offsetParent);
500
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
501
+ offsets.y = offsetRect.y + offsetParent.clientTop;
502
+ }
503
+ }
504
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
505
+ return {
506
+ width: rect.width * scale.x,
507
+ height: rect.height * scale.y,
508
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
509
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
510
+ };
511
+ }
512
+ function getClientRects(element) {
513
+ return Array.from(element.getClientRects());
514
+ }
515
+ function getDocumentRect(element) {
516
+ const html = getDocumentElement(element);
517
+ const scroll = getNodeScroll(element);
518
+ const body = element.ownerDocument.body;
519
+ const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
520
+ const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
521
+ let x = -scroll.scrollLeft + getWindowScrollBarX(element);
522
+ const y = -scroll.scrollTop;
523
+ if (getComputedStyle(body).direction === "rtl") {
524
+ x += max(html.clientWidth, body.clientWidth) - width;
525
+ }
526
+ return {
527
+ width,
528
+ height,
529
+ x,
530
+ y
531
+ };
532
+ }
533
+ function getViewportRect(element, strategy) {
534
+ const win = getWindow(element);
535
+ const html = getDocumentElement(element);
536
+ const visualViewport = win.visualViewport;
537
+ let width = html.clientWidth;
538
+ let height = html.clientHeight;
539
+ let x = 0;
540
+ let y = 0;
541
+ if (visualViewport) {
542
+ width = visualViewport.width;
543
+ height = visualViewport.height;
544
+ const visualViewportBased = isWebKit();
545
+ if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
546
+ x = visualViewport.offsetLeft;
547
+ y = visualViewport.offsetTop;
548
+ }
549
+ }
550
+ return {
551
+ width,
552
+ height,
553
+ x,
554
+ y
555
+ };
556
+ }
557
+ const absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
558
+ function getInnerBoundingClientRect(element, strategy) {
559
+ const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
560
+ const top = clientRect.top + element.clientTop;
561
+ const left = clientRect.left + element.clientLeft;
562
+ const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
563
+ const width = element.clientWidth * scale.x;
564
+ const height = element.clientHeight * scale.y;
565
+ const x = left * scale.x;
566
+ const y = top * scale.y;
567
+ return {
568
+ width,
569
+ height,
570
+ x,
571
+ y
572
+ };
573
+ }
574
+ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
575
+ let rect;
576
+ if (clippingAncestor === "viewport") {
577
+ rect = getViewportRect(element, strategy);
578
+ } else if (clippingAncestor === "document") {
579
+ rect = getDocumentRect(getDocumentElement(element));
580
+ } else if (isElement(clippingAncestor)) {
581
+ rect = getInnerBoundingClientRect(clippingAncestor, strategy);
582
+ } else {
583
+ const visualOffsets = getVisualOffsets(element);
584
+ rect = {
585
+ x: clippingAncestor.x - visualOffsets.x,
586
+ y: clippingAncestor.y - visualOffsets.y,
587
+ width: clippingAncestor.width,
588
+ height: clippingAncestor.height
589
+ };
590
+ }
591
+ return rectToClientRect(rect);
592
+ }
593
+ function hasFixedPositionAncestor(element, stopNode) {
594
+ const parentNode = getParentNode(element);
595
+ if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
596
+ return false;
597
+ }
598
+ return getComputedStyle(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
599
+ }
600
+ function getClippingElementAncestors(element, cache) {
601
+ const cachedResult = cache.get(element);
602
+ if (cachedResult) {
603
+ return cachedResult;
604
+ }
605
+ let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
606
+ let currentContainingBlockComputedStyle = null;
607
+ const elementIsFixed = getComputedStyle(element).position === "fixed";
608
+ let currentNode = elementIsFixed ? getParentNode(element) : element;
609
+ while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
610
+ const computedStyle = getComputedStyle(currentNode);
611
+ const currentNodeIsContaining = isContainingBlock(currentNode);
612
+ if (!currentNodeIsContaining && computedStyle.position === "fixed") {
613
+ currentContainingBlockComputedStyle = null;
614
+ }
615
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
616
+ if (shouldDropCurrentNode) {
617
+ result = result.filter((ancestor) => ancestor !== currentNode);
618
+ } else {
619
+ currentContainingBlockComputedStyle = computedStyle;
620
+ }
621
+ currentNode = getParentNode(currentNode);
622
+ }
623
+ cache.set(element, result);
624
+ return result;
625
+ }
626
+ function getClippingRect(_ref) {
627
+ let {
628
+ element,
629
+ boundary,
630
+ rootBoundary,
631
+ strategy
632
+ } = _ref;
633
+ const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
634
+ const clippingAncestors = [...elementClippingAncestors, rootBoundary];
635
+ const firstClippingAncestor = clippingAncestors[0];
636
+ const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
637
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
638
+ accRect.top = max(rect.top, accRect.top);
639
+ accRect.right = min(rect.right, accRect.right);
640
+ accRect.bottom = min(rect.bottom, accRect.bottom);
641
+ accRect.left = max(rect.left, accRect.left);
642
+ return accRect;
643
+ }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
644
+ return {
645
+ width: clippingRect.right - clippingRect.left,
646
+ height: clippingRect.bottom - clippingRect.top,
647
+ x: clippingRect.left,
648
+ y: clippingRect.top
649
+ };
650
+ }
651
+ function getDimensions(element) {
652
+ const {
653
+ width,
654
+ height
655
+ } = getCssDimensions(element);
656
+ return {
657
+ width,
658
+ height
659
+ };
660
+ }
661
+ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
662
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
663
+ const documentElement = getDocumentElement(offsetParent);
664
+ const isFixed = strategy === "fixed";
665
+ const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
666
+ let scroll = {
667
+ scrollLeft: 0,
668
+ scrollTop: 0
669
+ };
670
+ const offsets = createCoords(0);
671
+ function setLeftRTLScrollbarOffset() {
672
+ offsets.x = getWindowScrollBarX(documentElement);
673
+ }
674
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
675
+ if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
676
+ scroll = getNodeScroll(offsetParent);
677
+ }
678
+ if (isOffsetParentAnElement) {
679
+ const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
680
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
681
+ offsets.y = offsetRect.y + offsetParent.clientTop;
682
+ } else if (documentElement) {
683
+ setLeftRTLScrollbarOffset();
684
+ }
685
+ }
686
+ if (isFixed && !isOffsetParentAnElement && documentElement) {
687
+ setLeftRTLScrollbarOffset();
688
+ }
689
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
690
+ const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
691
+ const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
692
+ return {
693
+ x,
694
+ y,
695
+ width: rect.width,
696
+ height: rect.height
697
+ };
698
+ }
699
+ function isStaticPositioned(element) {
700
+ return getComputedStyle(element).position === "static";
701
+ }
702
+ function getTrueOffsetParent(element, polyfill) {
703
+ if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") {
704
+ return null;
705
+ }
706
+ if (polyfill) {
707
+ return polyfill(element);
708
+ }
709
+ let rawOffsetParent = element.offsetParent;
710
+ if (getDocumentElement(element) === rawOffsetParent) {
711
+ rawOffsetParent = rawOffsetParent.ownerDocument.body;
712
+ }
713
+ return rawOffsetParent;
714
+ }
715
+ function getOffsetParent(element, polyfill) {
716
+ const win = getWindow(element);
717
+ if (isTopLayer(element)) {
718
+ return win;
719
+ }
720
+ if (!isHTMLElement(element)) {
721
+ let svgOffsetParent = getParentNode(element);
722
+ while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
723
+ if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
724
+ return svgOffsetParent;
725
+ }
726
+ svgOffsetParent = getParentNode(svgOffsetParent);
727
+ }
728
+ return win;
729
+ }
730
+ let offsetParent = getTrueOffsetParent(element, polyfill);
731
+ while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
732
+ offsetParent = getTrueOffsetParent(offsetParent, polyfill);
733
+ }
734
+ if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
735
+ return win;
736
+ }
737
+ return offsetParent || getContainingBlock(element) || win;
738
+ }
739
+ const getElementRects = async function(data) {
740
+ const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
741
+ const getDimensionsFn = this.getDimensions;
742
+ const floatingDimensions = await getDimensionsFn(data.floating);
743
+ return {
744
+ reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
745
+ floating: {
746
+ x: 0,
747
+ y: 0,
748
+ width: floatingDimensions.width,
749
+ height: floatingDimensions.height
750
+ }
751
+ };
752
+ };
753
+ function isRTL(element) {
754
+ return getComputedStyle(element).direction === "rtl";
755
+ }
756
+ const platform = {
757
+ convertOffsetParentRelativeRectToViewportRelativeRect,
758
+ getDocumentElement,
759
+ getClippingRect,
760
+ getOffsetParent,
761
+ getElementRects,
762
+ getClientRects,
763
+ getDimensions,
764
+ getScale,
765
+ isElement,
766
+ isRTL
767
+ };
768
+ const computePosition = (reference, floating, options) => {
769
+ const cache = /* @__PURE__ */ new Map();
770
+ const mergedOptions = {
771
+ platform,
772
+ ...options
773
+ };
774
+ const platformWithCache = {
775
+ ...mergedOptions.platform,
776
+ _c: cache
777
+ };
778
+ return computePosition$1(reference, floating, {
779
+ ...mergedOptions,
780
+ platform: platformWithCache
781
+ });
782
+ };
783
+ class Polyfills {
784
+ constructor(popover) {
785
+ this.popover = popover;
786
+ this.trigger = document.querySelector(
787
+ `[popovertarget="${popover.getAttribute("id")}"`
788
+ );
789
+ this.positionPopover = this.positionPopover.bind(this);
790
+ this.popover.addEventListener("toggle", this.positionPopover);
791
+ }
792
+ positionPopover = ({ newState }) => {
793
+ if (newState === "open") {
794
+ computePosition(this.trigger, this.popover, {
795
+ placement: "bottom-start"
796
+ }).then(({ x, y }) => {
797
+ this.popover.style.insetInlineStart = `${x}px`;
798
+ this.popover.style.insetBlockStart = `${y}px`;
799
+ });
800
+ }
801
+ };
802
+ }
803
+ export {
804
+ Polyfills as default
805
+ };
806
+ //# sourceMappingURL=polyfills-DoxMZOqh.js.map