@rededor/cura 2.0.0-alpha.5 → 2.0.0-alpha.8

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 (51) hide show
  1. package/dist/assets/assets/icons/iconset-default-list.ts +1 -1
  2. package/dist/assets/assets/icons/iconset-default-tmp.svg +40 -0
  3. package/dist/assets/assets/icons/iconset-default.svg +1 -1
  4. package/dist/cjs/cura-accordion_21.cjs.entry.js +179 -69
  5. package/dist/cjs/cura-accordion_21.cjs.entry.js.map +1 -1
  6. package/dist/cjs/cura-icons-view.cjs.entry.js +1 -1
  7. package/dist/cjs/cura-icons-view.cjs.entry.js.map +1 -1
  8. package/dist/cjs/cura-icons-view.entry.cjs.js.map +1 -1
  9. package/dist/cjs/index-BK9MSAiE.js.map +1 -1
  10. package/dist/collection/assets/icons/iconset-default-list.js +1 -1
  11. package/dist/collection/assets/icons/iconset-default-list.js.map +1 -1
  12. package/dist/collection/assets/icons/iconset-default-tmp.svg +40 -0
  13. package/dist/collection/assets/icons/iconset-default.svg +1 -1
  14. package/dist/collection/assets-raw/icons/default/autism.svg +3 -0
  15. package/dist/collection/assets-raw/icons/default/biop.svg +3 -0
  16. package/dist/collection/assets-raw/icons/default/lab.svg +3 -0
  17. package/dist/collection/assets-raw/icons/default/mobileClick.svg +3 -0
  18. package/dist/collection/assets-raw/icons/default/mobileRotate1.svg +3 -0
  19. package/dist/collection/assets-raw/icons/default/mobileRotate2.svg +3 -0
  20. package/dist/collection/assets-raw/icons/default/mobileRotate3.svg +3 -0
  21. package/dist/collection/assets-raw/icons/default/star.svg +3 -0
  22. package/dist/collection/assets-raw/icons/default/stop.svg +3 -0
  23. package/dist/collection/assets-raw/icons/default/xray.svg +3 -0
  24. package/dist/collection/components/forms/cura-input-text/cura-input-text.js +1 -1
  25. package/dist/components/cura-calendar.js +1 -1
  26. package/dist/components/cura-icons-view.js +1 -1
  27. package/dist/components/cura-icons-view.js.map +1 -1
  28. package/dist/components/cura-input-date.js +2 -2
  29. package/dist/components/cura-select.js +1 -1
  30. package/dist/components/{p-Cs5scX1L.js → p-CvdWbsfO.js} +181 -71
  31. package/dist/components/p-CvdWbsfO.js.map +1 -0
  32. package/dist/components/p-D1cPOZpG.js.map +1 -1
  33. package/dist/components/{p-D6PpdPRJ.js → p-DETZu2ie.js} +3 -3
  34. package/dist/components/{p-D6PpdPRJ.js.map → p-DETZu2ie.js.map} +1 -1
  35. package/dist/cura/cura-icons-view.entry.esm.js.map +1 -1
  36. package/dist/cura/cura.esm.js +1 -1
  37. package/dist/cura/{p-6dfc7c02.entry.js → p-2ab58335.entry.js} +2 -2
  38. package/dist/cura/p-2ab58335.entry.js.map +1 -0
  39. package/dist/cura/p-76603652.entry.js +2 -0
  40. package/dist/cura/p-76603652.entry.js.map +1 -0
  41. package/dist/cura/p-PPMZr_VE.js.map +1 -1
  42. package/dist/esm/cura-accordion_21.entry.js +179 -69
  43. package/dist/esm/cura-accordion_21.entry.js.map +1 -1
  44. package/dist/esm/cura-icons-view.entry.js +1 -1
  45. package/dist/esm/cura-icons-view.entry.js.map +1 -1
  46. package/dist/esm/index-OdKytJIH.js.map +1 -1
  47. package/package.json +2 -2
  48. package/dist/components/p-Cs5scX1L.js.map +0 -1
  49. package/dist/cura/p-2632183e.entry.js +0 -2
  50. package/dist/cura/p-2632183e.entry.js.map +0 -1
  51. package/dist/cura/p-6dfc7c02.entry.js.map +0 -1
@@ -5567,8 +5567,9 @@ function getOppositeAxis(axis) {
5567
5567
  function getAxisLength(axis) {
5568
5568
  return axis === 'y' ? 'height' : 'width';
5569
5569
  }
5570
+ const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
5570
5571
  function getSideAxis(placement) {
5571
- return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
5572
+ return yAxisSides.has(getSide(placement)) ? 'y' : 'x';
5572
5573
  }
5573
5574
  function getAlignmentAxis(placement) {
5574
5575
  return getOppositeAxis(getSideAxis(placement));
@@ -5593,19 +5594,19 @@ function getExpandedPlacements(placement) {
5593
5594
  function getOppositeAlignmentPlacement(placement) {
5594
5595
  return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
5595
5596
  }
5597
+ const lrPlacement = ['left', 'right'];
5598
+ const rlPlacement = ['right', 'left'];
5599
+ const tbPlacement = ['top', 'bottom'];
5600
+ const btPlacement = ['bottom', 'top'];
5596
5601
  function getSideList(side, isStart, rtl) {
5597
- const lr = ['left', 'right'];
5598
- const rl = ['right', 'left'];
5599
- const tb = ['top', 'bottom'];
5600
- const bt = ['bottom', 'top'];
5601
5602
  switch (side) {
5602
5603
  case 'top':
5603
5604
  case 'bottom':
5604
- if (rtl) return isStart ? rl : lr;
5605
- return isStart ? lr : rl;
5605
+ if (rtl) return isStart ? rlPlacement : lrPlacement;
5606
+ return isStart ? lrPlacement : rlPlacement;
5606
5607
  case 'left':
5607
5608
  case 'right':
5608
- return isStart ? tb : bt;
5609
+ return isStart ? tbPlacement : btPlacement;
5609
5610
  default:
5610
5611
  return [];
5611
5612
  }
@@ -5943,16 +5944,22 @@ const flip$1 = function (options) {
5943
5944
  const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
5944
5945
  const nextPlacement = placements[nextIndex];
5945
5946
  if (nextPlacement) {
5946
- // Try next placement and re-run the lifecycle.
5947
- return {
5948
- data: {
5949
- index: nextIndex,
5950
- overflows: overflowsData
5951
- },
5952
- reset: {
5953
- placement: nextPlacement
5954
- }
5955
- };
5947
+ const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
5948
+ if (!ignoreCrossAxisOverflow ||
5949
+ // We leave the current main axis only if every placement on that axis
5950
+ // overflows the main axis.
5951
+ overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
5952
+ // Try next placement and re-run the lifecycle.
5953
+ return {
5954
+ data: {
5955
+ index: nextIndex,
5956
+ overflows: overflowsData
5957
+ },
5958
+ reset: {
5959
+ placement: nextPlacement
5960
+ }
5961
+ };
5962
+ }
5956
5963
  }
5957
5964
 
5958
5965
  // First, find the candidates that fit on the mainAxis side of overflow,
@@ -5998,6 +6005,8 @@ const flip$1 = function (options) {
5998
6005
  };
5999
6006
  };
6000
6007
 
6008
+ const originSides = /*#__PURE__*/new Set(['left', 'top']);
6009
+
6001
6010
  // For type backwards-compatibility, the `OffsetOptions` type was also
6002
6011
  // Derivable.
6003
6012
 
@@ -6011,7 +6020,7 @@ async function convertValueToCoords(state, options) {
6011
6020
  const side = getSide(placement);
6012
6021
  const alignment = getAlignment(placement);
6013
6022
  const isVertical = getSideAxis(placement) === 'y';
6014
- const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
6023
+ const mainAxisMulti = originSides.has(side) ? -1 : 1;
6015
6024
  const crossAxisMulti = rtl && isVertical ? -1 : 1;
6016
6025
  const rawValue = evaluate(options, state);
6017
6026
 
@@ -6025,10 +6034,9 @@ async function convertValueToCoords(state, options) {
6025
6034
  crossAxis: 0,
6026
6035
  alignmentAxis: null
6027
6036
  } : {
6028
- mainAxis: 0,
6029
- crossAxis: 0,
6030
- alignmentAxis: null,
6031
- ...rawValue
6037
+ mainAxis: rawValue.mainAxis || 0,
6038
+ crossAxis: rawValue.crossAxis || 0,
6039
+ alignmentAxis: rawValue.alignmentAxis
6032
6040
  };
6033
6041
  if (alignment && typeof alignmentAxis === 'number') {
6034
6042
  crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
@@ -6150,7 +6158,11 @@ const shift$1 = function (options) {
6150
6158
  ...limitedCoords,
6151
6159
  data: {
6152
6160
  x: limitedCoords.x - x,
6153
- y: limitedCoords.y - y
6161
+ y: limitedCoords.y - y,
6162
+ enabled: {
6163
+ [mainAxis]: checkMainAxis,
6164
+ [crossAxis]: checkCrossAxis
6165
+ }
6154
6166
  }
6155
6167
  };
6156
6168
  }
@@ -6171,6 +6183,7 @@ const size$1 = function (options) {
6171
6183
  name: 'size',
6172
6184
  options,
6173
6185
  async fn(state) {
6186
+ var _state$middlewareData, _state$middlewareData2;
6174
6187
  const {
6175
6188
  placement,
6176
6189
  rects,
@@ -6205,10 +6218,11 @@ const size$1 = function (options) {
6205
6218
  const noShift = !state.middlewareData.shift;
6206
6219
  let availableHeight = overflowAvailableHeight;
6207
6220
  let availableWidth = overflowAvailableWidth;
6208
- if (isYAxis) {
6209
- availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
6210
- } else {
6211
- availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
6221
+ if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {
6222
+ availableWidth = maximumClippingWidth;
6223
+ }
6224
+ if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {
6225
+ availableHeight = maximumClippingHeight;
6212
6226
  }
6213
6227
  if (noShift && !alignment) {
6214
6228
  const xMin = max(overflow.left, 0);
@@ -6239,6 +6253,9 @@ const size$1 = function (options) {
6239
6253
  };
6240
6254
  };
6241
6255
 
6256
+ function hasWindow() {
6257
+ return typeof window !== 'undefined';
6258
+ }
6242
6259
  function getNodeName(node) {
6243
6260
  if (isNode(node)) {
6244
6261
  return (node.nodeName || '').toLowerCase();
@@ -6257,48 +6274,63 @@ function getDocumentElement(node) {
6257
6274
  return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
6258
6275
  }
6259
6276
  function isNode(value) {
6277
+ if (!hasWindow()) {
6278
+ return false;
6279
+ }
6260
6280
  return value instanceof Node || value instanceof getWindow(value).Node;
6261
6281
  }
6262
6282
  function isElement(value) {
6283
+ if (!hasWindow()) {
6284
+ return false;
6285
+ }
6263
6286
  return value instanceof Element || value instanceof getWindow(value).Element;
6264
6287
  }
6265
6288
  function isHTMLElement(value) {
6289
+ if (!hasWindow()) {
6290
+ return false;
6291
+ }
6266
6292
  return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
6267
6293
  }
6268
6294
  function isShadowRoot(value) {
6269
- // Browsers without `ShadowRoot` support.
6270
- if (typeof ShadowRoot === 'undefined') {
6295
+ if (!hasWindow() || typeof ShadowRoot === 'undefined') {
6271
6296
  return false;
6272
6297
  }
6273
6298
  return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
6274
6299
  }
6300
+ const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);
6275
6301
  function isOverflowElement(element) {
6276
6302
  const {
6277
6303
  overflow,
6278
6304
  overflowX,
6279
6305
  overflowY,
6280
6306
  display
6281
- } = getComputedStyle(element);
6282
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
6307
+ } = getComputedStyle$1(element);
6308
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
6283
6309
  }
6310
+ const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);
6284
6311
  function isTableElement(element) {
6285
- return ['table', 'td', 'th'].includes(getNodeName(element));
6312
+ return tableElements.has(getNodeName(element));
6286
6313
  }
6314
+ const topLayerSelectors = [':popover-open', ':modal'];
6287
6315
  function isTopLayer(element) {
6288
- return [':popover-open', ':modal'].some(selector => {
6316
+ return topLayerSelectors.some(selector => {
6289
6317
  try {
6290
6318
  return element.matches(selector);
6291
- } catch (e) {
6319
+ } catch (_e) {
6292
6320
  return false;
6293
6321
  }
6294
6322
  });
6295
6323
  }
6324
+ const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];
6325
+ const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];
6326
+ const containValues = ['paint', 'layout', 'strict', 'content'];
6296
6327
  function isContainingBlock(elementOrCss) {
6297
6328
  const webkit = isWebKit();
6298
- const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
6329
+ const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
6299
6330
 
6300
6331
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
6301
- return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
6332
+ // https://drafts.csswg.org/css-transforms-2/#individual-transforms
6333
+ 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));
6302
6334
  }
6303
6335
  function getContainingBlock(element) {
6304
6336
  let currentNode = getParentNode(element);
@@ -6316,10 +6348,11 @@ function isWebKit() {
6316
6348
  if (typeof CSS === 'undefined' || !CSS.supports) return false;
6317
6349
  return CSS.supports('-webkit-backdrop-filter', 'none');
6318
6350
  }
6351
+ const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
6319
6352
  function isLastTraversableNode(node) {
6320
- return ['html', 'body', '#document'].includes(getNodeName(node));
6353
+ return lastTraversableNodeNames.has(getNodeName(node));
6321
6354
  }
6322
- function getComputedStyle(element) {
6355
+ function getComputedStyle$1(element) {
6323
6356
  return getWindow(element).getComputedStyle(element);
6324
6357
  }
6325
6358
  function getNodeScroll(element) {
@@ -6371,13 +6404,17 @@ function getOverflowAncestors(node, list, traverseIframes) {
6371
6404
  const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
6372
6405
  const win = getWindow(scrollableAncestor);
6373
6406
  if (isBody) {
6374
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
6407
+ const frameElement = getFrameElement(win);
6408
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
6375
6409
  }
6376
6410
  return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
6377
6411
  }
6412
+ function getFrameElement(win) {
6413
+ return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
6414
+ }
6378
6415
 
6379
6416
  function getCssDimensions(element) {
6380
- const css = getComputedStyle(element);
6417
+ const css = getComputedStyle$1(element);
6381
6418
  // In testing environments, the `width` and `height` properties are empty
6382
6419
  // strings for SVG elements, returning NaN. Fallback to `0` in this case.
6383
6420
  let width = parseFloat(css.width) || 0;
@@ -6478,11 +6515,11 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
6478
6515
  const win = getWindow(domElement);
6479
6516
  const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
6480
6517
  let currentWin = win;
6481
- let currentIFrame = currentWin.frameElement;
6518
+ let currentIFrame = getFrameElement(currentWin);
6482
6519
  while (currentIFrame && offsetParent && offsetWin !== currentWin) {
6483
6520
  const iframeScale = getScale(currentIFrame);
6484
6521
  const iframeRect = currentIFrame.getBoundingClientRect();
6485
- const css = getComputedStyle(currentIFrame);
6522
+ const css = getComputedStyle$1(currentIFrame);
6486
6523
  const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
6487
6524
  const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
6488
6525
  x *= iframeScale.x;
@@ -6492,7 +6529,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
6492
6529
  x += left;
6493
6530
  y += top;
6494
6531
  currentWin = getWindow(currentIFrame);
6495
- currentIFrame = currentWin.frameElement;
6532
+ currentIFrame = getFrameElement(currentWin);
6496
6533
  }
6497
6534
  }
6498
6535
  return rectToClientRect({
@@ -6503,6 +6540,26 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
6503
6540
  });
6504
6541
  }
6505
6542
 
6543
+ // If <html> has a CSS width greater than the viewport, then this will be
6544
+ // incorrect for RTL.
6545
+ function getWindowScrollBarX(element, rect) {
6546
+ const leftScroll = getNodeScroll(element).scrollLeft;
6547
+ if (!rect) {
6548
+ return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
6549
+ }
6550
+ return rect.left + leftScroll;
6551
+ }
6552
+
6553
+ function getHTMLOffset(documentElement, scroll) {
6554
+ const htmlRect = documentElement.getBoundingClientRect();
6555
+ const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
6556
+ const y = htmlRect.top + scroll.scrollTop;
6557
+ return {
6558
+ x,
6559
+ y
6560
+ };
6561
+ }
6562
+
6506
6563
  function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
6507
6564
  let {
6508
6565
  elements,
@@ -6534,11 +6591,12 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
6534
6591
  offsets.y = offsetRect.y + offsetParent.clientTop;
6535
6592
  }
6536
6593
  }
6594
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
6537
6595
  return {
6538
6596
  width: rect.width * scale.x,
6539
6597
  height: rect.height * scale.y,
6540
- x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
6541
- y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
6598
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
6599
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
6542
6600
  };
6543
6601
  }
6544
6602
 
@@ -6546,12 +6604,6 @@ function getClientRects(element) {
6546
6604
  return Array.from(element.getClientRects());
6547
6605
  }
6548
6606
 
6549
- function getWindowScrollBarX(element) {
6550
- // If <html> has a CSS width greater than the viewport, then this will be
6551
- // incorrect for RTL.
6552
- return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
6553
- }
6554
-
6555
6607
  // Gets the entire size of the scrollable document area, even extending outside
6556
6608
  // of the `<html>` and `<body>` rect bounds if horizontally scrollable.
6557
6609
  function getDocumentRect(element) {
@@ -6562,7 +6614,7 @@ function getDocumentRect(element) {
6562
6614
  const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
6563
6615
  let x = -scroll.scrollLeft + getWindowScrollBarX(element);
6564
6616
  const y = -scroll.scrollTop;
6565
- if (getComputedStyle(body).direction === 'rtl') {
6617
+ if (getComputedStyle$1(body).direction === 'rtl') {
6566
6618
  x += max(html.clientWidth, body.clientWidth) - width;
6567
6619
  }
6568
6620
  return {
@@ -6573,6 +6625,10 @@ function getDocumentRect(element) {
6573
6625
  };
6574
6626
  }
6575
6627
 
6628
+ // Safety check: ensure the scrollbar space is reasonable in case this
6629
+ // calculation is affected by unusual styles.
6630
+ // Most scrollbars leave 15-18px of space.
6631
+ const SCROLLBAR_MAX = 25;
6576
6632
  function getViewportRect(element, strategy) {
6577
6633
  const win = getWindow(element);
6578
6634
  const html = getDocumentElement(element);
@@ -6590,6 +6646,24 @@ function getViewportRect(element, strategy) {
6590
6646
  y = visualViewport.offsetTop;
6591
6647
  }
6592
6648
  }
6649
+ const windowScrollbarX = getWindowScrollBarX(html);
6650
+ // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the
6651
+ // visual width of the <html> but this is not considered in the size
6652
+ // of `html.clientWidth`.
6653
+ if (windowScrollbarX <= 0) {
6654
+ const doc = html.ownerDocument;
6655
+ const body = doc.body;
6656
+ const bodyStyles = getComputedStyle(body);
6657
+ const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
6658
+ const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
6659
+ if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
6660
+ width -= clippingStableScrollbarWidth;
6661
+ }
6662
+ } else if (windowScrollbarX <= SCROLLBAR_MAX) {
6663
+ // If the <body> scrollbar is on the left, the width needs to be extended
6664
+ // by the scrollbar amount so there isn't extra space on the right.
6665
+ width += windowScrollbarX;
6666
+ }
6593
6667
  return {
6594
6668
  width,
6595
6669
  height,
@@ -6598,6 +6672,7 @@ function getViewportRect(element, strategy) {
6598
6672
  };
6599
6673
  }
6600
6674
 
6675
+ const absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);
6601
6676
  // Returns the inner client rect, subtracting scrollbars if present.
6602
6677
  function getInnerBoundingClientRect(element, strategy) {
6603
6678
  const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
@@ -6626,9 +6701,10 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
6626
6701
  } else {
6627
6702
  const visualOffsets = getVisualOffsets(element);
6628
6703
  rect = {
6629
- ...clippingAncestor,
6630
6704
  x: clippingAncestor.x - visualOffsets.x,
6631
- y: clippingAncestor.y - visualOffsets.y
6705
+ y: clippingAncestor.y - visualOffsets.y,
6706
+ width: clippingAncestor.width,
6707
+ height: clippingAncestor.height
6632
6708
  };
6633
6709
  }
6634
6710
  return rectToClientRect(rect);
@@ -6638,7 +6714,7 @@ function hasFixedPositionAncestor(element, stopNode) {
6638
6714
  if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
6639
6715
  return false;
6640
6716
  }
6641
- return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
6717
+ return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
6642
6718
  }
6643
6719
 
6644
6720
  // A "clipping ancestor" is an `overflow` element with the characteristic of
@@ -6651,17 +6727,17 @@ function getClippingElementAncestors(element, cache) {
6651
6727
  }
6652
6728
  let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
6653
6729
  let currentContainingBlockComputedStyle = null;
6654
- const elementIsFixed = getComputedStyle(element).position === 'fixed';
6730
+ const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
6655
6731
  let currentNode = elementIsFixed ? getParentNode(element) : element;
6656
6732
 
6657
6733
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
6658
6734
  while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
6659
- const computedStyle = getComputedStyle(currentNode);
6735
+ const computedStyle = getComputedStyle$1(currentNode);
6660
6736
  const currentNodeIsContaining = isContainingBlock(currentNode);
6661
6737
  if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
6662
6738
  currentContainingBlockComputedStyle = null;
6663
6739
  }
6664
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
6740
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
6665
6741
  if (shouldDropCurrentNode) {
6666
6742
  // Drop non-containing blocks.
6667
6743
  result = result.filter(ancestor => ancestor !== currentNode);
@@ -6724,6 +6800,12 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
6724
6800
  scrollTop: 0
6725
6801
  };
6726
6802
  const offsets = createCoords(0);
6803
+
6804
+ // If the <body> scrollbar appears on the left (e.g. RTL systems). Use
6805
+ // Firefox with layout.scrollbar.side = 3 in about:config to test this.
6806
+ function setLeftRTLScrollbarOffset() {
6807
+ offsets.x = getWindowScrollBarX(documentElement);
6808
+ }
6727
6809
  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
6728
6810
  if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
6729
6811
  scroll = getNodeScroll(offsetParent);
@@ -6733,11 +6815,15 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
6733
6815
  offsets.x = offsetRect.x + offsetParent.clientLeft;
6734
6816
  offsets.y = offsetRect.y + offsetParent.clientTop;
6735
6817
  } else if (documentElement) {
6736
- offsets.x = getWindowScrollBarX(documentElement);
6818
+ setLeftRTLScrollbarOffset();
6737
6819
  }
6738
6820
  }
6739
- const x = rect.left + scroll.scrollLeft - offsets.x;
6740
- const y = rect.top + scroll.scrollTop - offsets.y;
6821
+ if (isFixed && !isOffsetParentAnElement && documentElement) {
6822
+ setLeftRTLScrollbarOffset();
6823
+ }
6824
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
6825
+ const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
6826
+ const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
6741
6827
  return {
6742
6828
  x,
6743
6829
  y,
@@ -6747,17 +6833,26 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
6747
6833
  }
6748
6834
 
6749
6835
  function isStaticPositioned(element) {
6750
- return getComputedStyle(element).position === 'static';
6836
+ return getComputedStyle$1(element).position === 'static';
6751
6837
  }
6752
6838
 
6753
6839
  function getTrueOffsetParent(element, polyfill) {
6754
- if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
6840
+ if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
6755
6841
  return null;
6756
6842
  }
6757
6843
  if (polyfill) {
6758
6844
  return polyfill(element);
6759
6845
  }
6760
- return element.offsetParent;
6846
+ let rawOffsetParent = element.offsetParent;
6847
+
6848
+ // Firefox returns the <html> element as the offsetParent if it's non-static,
6849
+ // while Chrome and Safari return the <body> element. The <body> element must
6850
+ // be used to perform the correct calculations even if the <html> element is
6851
+ // non-static.
6852
+ if (getDocumentElement(element) === rawOffsetParent) {
6853
+ rawOffsetParent = rawOffsetParent.ownerDocument.body;
6854
+ }
6855
+ return rawOffsetParent;
6761
6856
  }
6762
6857
 
6763
6858
  // Gets the closest ancestor positioned element. Handles some edge cases,
@@ -6803,7 +6898,7 @@ const getElementRects = async function (data) {
6803
6898
  };
6804
6899
 
6805
6900
  function isRTL(element) {
6806
- return getComputedStyle(element).direction === 'rtl';
6901
+ return getComputedStyle$1(element).direction === 'rtl';
6807
6902
  }
6808
6903
 
6809
6904
  const platform = {
@@ -6819,6 +6914,10 @@ const platform = {
6819
6914
  isRTL
6820
6915
  };
6821
6916
 
6917
+ function rectsAreEqual(a, b) {
6918
+ return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
6919
+ }
6920
+
6822
6921
  // https://samthor.au/2021/observing-dom/
6823
6922
  function observeMove(element, onMove) {
6824
6923
  let io = null;
@@ -6838,12 +6937,13 @@ function observeMove(element, onMove) {
6838
6937
  threshold = 1;
6839
6938
  }
6840
6939
  cleanup();
6940
+ const elementRectForRootMargin = element.getBoundingClientRect();
6841
6941
  const {
6842
6942
  left,
6843
6943
  top,
6844
6944
  width,
6845
6945
  height
6846
- } = element.getBoundingClientRect();
6946
+ } = elementRectForRootMargin;
6847
6947
  if (!skip) {
6848
6948
  onMove();
6849
6949
  }
@@ -6876,6 +6976,16 @@ function observeMove(element, onMove) {
6876
6976
  refresh(false, ratio);
6877
6977
  }
6878
6978
  }
6979
+ if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
6980
+ // It's possible that even though the ratio is reported as 1, the
6981
+ // element is not actually fully within the IntersectionObserver's root
6982
+ // area anymore. This can happen under performance constraints. This may
6983
+ // be a bug in the browser's IntersectionObserver implementation. To
6984
+ // work around this, we compare the element's bounding rect now with
6985
+ // what it was at the time we created the IntersectionObserver. If they
6986
+ // are not equal then the element moved, so we refresh.
6987
+ refresh();
6988
+ }
6879
6989
  isFirstUpdate = false;
6880
6990
  }
6881
6991
 
@@ -6887,7 +6997,7 @@ function observeMove(element, onMove) {
6887
6997
  // Handle <iframe>s
6888
6998
  root: root.ownerDocument
6889
6999
  });
6890
- } catch (e) {
7000
+ } catch (_e) {
6891
7001
  io = new IntersectionObserver(handleObserve, options);
6892
7002
  }
6893
7003
  io.observe(element);
@@ -6953,7 +7063,7 @@ function autoUpdate(reference, floating, update, options) {
6953
7063
  }
6954
7064
  function frameLoop() {
6955
7065
  const nextRefRect = getBoundingClientRect(reference);
6956
- if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
7066
+ if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
6957
7067
  update();
6958
7068
  }
6959
7069
  prevRefRect = nextRefRect;