@bcgov/design-system-react-components 0.8.1-pr944 → 0.8.1-pr950

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -730,7 +730,7 @@ function $23f2114a1b82827e$export$4282f70798064fe0(node, otherNode) {
730
730
  if (!($6a20a7989e6c817a$export$98658e8c59125e6a)()) return otherNode && node ? node.contains(otherNode) : false;
731
731
  if (!node || !otherNode) return false;
732
732
  let currentNode = otherNode;
733
- while(currentNode !== null){
733
+ while(currentNode != null){
734
734
  if (currentNode === node) return true;
735
735
  if (typeof currentNode.assignedElements !== 'function' && currentNode.assignedSlot?.parentNode) // Element is slotted
736
736
  currentNode = currentNode.assignedSlot.parentNode;
@@ -833,57 +833,9 @@ function $b72f3f7b3b5f42c6$export$759df0d867455a91(document) {
833
833
  * OF ANY KIND, either express or implied. See the License for the specific language
834
834
  * governing permissions and limitations under the License.
835
835
  */ function $1969ac565cfec8d0$export$de79e2c695e052f3(element) {
836
- if ($1969ac565cfec8d0$var$supportsPreventScroll()) element.focus({
836
+ element.focus({
837
837
  preventScroll: true
838
838
  });
839
- else {
840
- let scrollableElements = $1969ac565cfec8d0$var$getScrollableElements(element);
841
- element.focus();
842
- $1969ac565cfec8d0$var$restoreScrollPosition(scrollableElements);
843
- }
844
- }
845
- let $1969ac565cfec8d0$var$supportsPreventScrollCached = null;
846
- function $1969ac565cfec8d0$var$supportsPreventScroll() {
847
- if ($1969ac565cfec8d0$var$supportsPreventScrollCached == null) {
848
- $1969ac565cfec8d0$var$supportsPreventScrollCached = false;
849
- try {
850
- let focusElem = document.createElement('div');
851
- focusElem.focus({
852
- get preventScroll () {
853
- $1969ac565cfec8d0$var$supportsPreventScrollCached = true;
854
- return true;
855
- }
856
- });
857
- } catch {
858
- // Ignore
859
- }
860
- }
861
- return $1969ac565cfec8d0$var$supportsPreventScrollCached;
862
- }
863
- function $1969ac565cfec8d0$var$getScrollableElements(element) {
864
- let parent = element.parentNode;
865
- let scrollableElements = [];
866
- let rootScrollingElement = document.scrollingElement || document.documentElement;
867
- while(parent instanceof HTMLElement && parent !== rootScrollingElement){
868
- if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({
869
- element: parent,
870
- scrollTop: parent.scrollTop,
871
- scrollLeft: parent.scrollLeft
872
- });
873
- parent = parent.parentNode;
874
- }
875
- if (rootScrollingElement instanceof HTMLElement) scrollableElements.push({
876
- element: rootScrollingElement,
877
- scrollTop: rootScrollingElement.scrollTop,
878
- scrollLeft: rootScrollingElement.scrollLeft
879
- });
880
- return scrollableElements;
881
- }
882
- function $1969ac565cfec8d0$var$restoreScrollPosition(scrollableElements) {
883
- for (let { element: element, scrollTop: scrollTop, scrollLeft: scrollLeft } of scrollableElements){
884
- element.scrollTop = scrollTop;
885
- element.scrollLeft = scrollLeft;
886
- }
887
839
  }
888
840
 
889
841
  /*
@@ -1080,10 +1032,10 @@ function $a92dc41f639950be$export$cabe61c495ee3649(target) {
1080
1032
  let root = targetRoot != null && ($d447af545b77c9f1$export$af51f0f06c0f328a)(targetRoot) ? targetRoot : ($d447af545b77c9f1$export$f21a1ffae260145a)(target);
1081
1033
  // Focus is "moving to target" when it moves to the button or to a descendant of the button
1082
1034
  // (e.g. SVG icon)
1083
- let isFocusMovingToTarget = (focusTarget)=>focusTarget === target || focusTarget != null && ($23f2114a1b82827e$export$4282f70798064fe0)(target, focusTarget);
1035
+ let isFocusMovingToTarget = (focusTarget)=>focusTarget === target || ($d447af545b77c9f1$export$8ee0fc9ee280b4ee)(focusTarget) && ($23f2114a1b82827e$export$4282f70798064fe0)(target, focusTarget);
1084
1036
  // Blur/focusout events have their target as the element losing focus. Stop propagation when
1085
1037
  // that is the previously focused element (activeElement) or a descendant (e.g. in shadow DOM).
1086
- let isBlurFromActiveElement = (eventTarget)=>eventTarget === activeElement || activeElement != null && eventTarget != null && ($23f2114a1b82827e$export$4282f70798064fe0)(activeElement, eventTarget);
1038
+ let isBlurFromActiveElement = (eventTarget)=>eventTarget === activeElement || activeElement != null && ($d447af545b77c9f1$export$8ee0fc9ee280b4ee)(eventTarget) && ($23f2114a1b82827e$export$4282f70798064fe0)(activeElement, eventTarget);
1087
1039
  $a92dc41f639950be$export$fda7da73ab5d4c48 = true;
1088
1040
  let isRefocusing = false;
1089
1041
  let onBlur = (e)=>{
@@ -1250,14 +1202,6 @@ function $caaf0dd3060ed57c$export$efa8c9099e530235(link, modifiers) {
1250
1202
  }
1251
1203
  function $caaf0dd3060ed57c$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
1252
1204
  let { metaKey: metaKey, ctrlKey: ctrlKey, altKey: altKey, shiftKey: shiftKey } = modifiers;
1253
- // Firefox does not recognize keyboard events as a user action by default, and the popup blocker
1254
- // will prevent links with target="_blank" from opening. However, it does allow the event if the
1255
- // Command/Control key is held, which opens the link in a background tab. This seems like the best we can do.
1256
- // See https://bugzilla.mozilla.org/show_bug.cgi?id=257870 and https://bugzilla.mozilla.org/show_bug.cgi?id=746640.
1257
- if (!($2add3ce32c6007eb$export$78551043582a6a98)() && ($2add3ce32c6007eb$export$b7d78993b74f766d)() && window.event?.type?.startsWith('key') && target.target === '_blank') {
1258
- if (($2add3ce32c6007eb$export$9ac100e40613ea10)()) metaKey = true;
1259
- else ctrlKey = true;
1260
- }
1261
1205
  // WebKit does not support firing click events with modifier keys, but does support keyboard events.
1262
1206
  // https://github.com/WebKit/WebKit/blob/c03d0ac6e6db178f90923a0a63080b5ca210d25f/Source/WebCore/html/HTMLAnchorElement.cpp#L184
1263
1207
  let event = ($2add3ce32c6007eb$export$78551043582a6a98)() && ($2add3ce32c6007eb$export$9ac100e40613ea10)() && !($2add3ce32c6007eb$export$7bef049ce92e4224)() && process.env.NODE_ENV !== 'test' ? new KeyboardEvent('keydown', {
@@ -1437,6 +1381,15 @@ function $8f5a2122b0992be3$var$handleWindowBlur() {
1437
1381
  $8f5a2122b0992be3$var$hasEventBeforeFocus = false;
1438
1382
  $8f5a2122b0992be3$var$hasBlurredWindowRecently = true;
1439
1383
  }
1384
+ function $8f5a2122b0992be3$var$handleInvalidEvent(e) {
1385
+ let startingActiveElement = ($23f2114a1b82827e$export$cd4e5573fbe2b576)(($d447af545b77c9f1$export$b204af158042fbac)(($23f2114a1b82827e$export$e58f029f0fbfdb29)(e)));
1386
+ queueMicrotask(()=>{
1387
+ // If focus was moved to a different element after the form became invalid,
1388
+ // then it was likely a forms library that moved focus to the first invalid field.
1389
+ // In this case, we want to set the modality to keyboard.
1390
+ if (($23f2114a1b82827e$export$cd4e5573fbe2b576)(($d447af545b77c9f1$export$b204af158042fbac)(($23f2114a1b82827e$export$e58f029f0fbfdb29)(e))) !== startingActiveElement) $8f5a2122b0992be3$export$8397ddfc504fdb9a('keyboard');
1391
+ });
1392
+ }
1440
1393
  /**
1441
1394
  * Setup global event listeners to control when keyboard focus style should be visible.
1442
1395
  */ function $8f5a2122b0992be3$var$setupGlobalFocusEvents(element) {
@@ -1464,6 +1417,7 @@ function $8f5a2122b0992be3$var$handleWindowBlur() {
1464
1417
  documentObject.addEventListener('keydown', $8f5a2122b0992be3$var$handleKeyboardEvent, true);
1465
1418
  documentObject.addEventListener('keyup', $8f5a2122b0992be3$var$handleKeyboardEvent, true);
1466
1419
  documentObject.addEventListener('click', $8f5a2122b0992be3$var$handleClickEvent, true);
1420
+ documentObject.addEventListener('invalid', $8f5a2122b0992be3$var$handleInvalidEvent, true);
1467
1421
  // Register focus events on the window so they are sure to happen
1468
1422
  // before React's event listeners (registered on the document).
1469
1423
  windowObject.addEventListener('focus', $8f5a2122b0992be3$var$handleFocusEvent, true);
@@ -1500,6 +1454,7 @@ const $8f5a2122b0992be3$var$tearDownWindowFocusTracking = (element, loadListener
1500
1454
  documentObject.removeEventListener('keydown', $8f5a2122b0992be3$var$handleKeyboardEvent, true);
1501
1455
  documentObject.removeEventListener('keyup', $8f5a2122b0992be3$var$handleKeyboardEvent, true);
1502
1456
  documentObject.removeEventListener('click', $8f5a2122b0992be3$var$handleClickEvent, true);
1457
+ documentObject.removeEventListener('invalid', $8f5a2122b0992be3$var$handleInvalidEvent, true);
1503
1458
  windowObject.removeEventListener('focus', $8f5a2122b0992be3$var$handleFocusEvent, true);
1504
1459
  windowObject.removeEventListener('blur', $8f5a2122b0992be3$var$handleWindowBlur, false);
1505
1460
  if (typeof PointerEvent !== 'undefined') {
@@ -1598,7 +1553,7 @@ function $8f5a2122b0992be3$export$ec71b4b83ac08ec3(fn, deps, opts) {
1598
1553
  }
1599
1554
 
1600
1555
  /*
1601
- * Copyright 2024 Adobe. All rights reserved.
1556
+ * Copyright 2026 Adobe. All rights reserved.
1602
1557
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1603
1558
  * you may not use this file except in compliance with the License. You may obtain a copy
1604
1559
  * of the License at http://www.apache.org/licenses/LICENSE-2.0
@@ -1608,10 +1563,50 @@ function $8f5a2122b0992be3$export$ec71b4b83ac08ec3(fn, deps, opts) {
1608
1563
  * OF ANY KIND, either express or implied. See the License for the specific language
1609
1564
  * governing permissions and limitations under the License.
1610
1565
  */
1611
- function $bb39c0fc1c19b34c$export$16792effe837dba3(e) {
1612
- if (($2add3ce32c6007eb$export$9ac100e40613ea10)()) return e.metaKey;
1613
- return e.ctrlKey;
1566
+ function $7096878c21af5e66$export$a929f3f93e2cc67e(key, doc) {
1567
+ let ownerWindow = ($d447af545b77c9f1$export$f21a1ffae260145a)(doc);
1568
+ let ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(doc);
1569
+ if (ownerDocument == null || ownerWindow == null) return;
1570
+ let content = undefined;
1571
+ let selector = `meta[name="${CSS.escape(key)}"], meta[property="${CSS.escape(key)}"]`;
1572
+ let meta = ownerDocument.querySelector(selector);
1573
+ if (meta && meta instanceof ownerWindow.HTMLMetaElement) {
1574
+ if (key === 'csp-nonce' && meta.nonce) content ??= meta.nonce || undefined;
1575
+ if (meta.content) content ??= meta.content || undefined;
1576
+ }
1577
+ if (key === 'csp-nonce') content ??= ownerWindow.__webpack_nonce__ || globalThis.__webpack_nonce__ || undefined;
1578
+ return content;
1614
1579
  }
1580
+
1581
+ /*
1582
+ * Copyright 2024 Adobe. All rights reserved.
1583
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1584
+ * you may not use this file except in compliance with the License. You may obtain a copy
1585
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
1586
+ *
1587
+ * Unless required by applicable law or agreed to in writing, software distributed under
1588
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1589
+ * OF ANY KIND, either express or implied. See the License for the specific language
1590
+ * governing permissions and limitations under the License.
1591
+ */
1592
+
1593
+
1594
+
1595
+
1596
+ const $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT = 100;
1597
+ const $bb39c0fc1c19b34c$var$KEYBOARD_TIMEOUT = 600;
1598
+ // Tracks layout state of the on-screen keyboard.
1599
+ const $bb39c0fc1c19b34c$var$state = {
1600
+ isOpen: false,
1601
+ screenWidth: 0,
1602
+ screenHeight: 0,
1603
+ screenAngle: 0,
1604
+ screenTimeout: 0,
1605
+ startTimeStamp: 0,
1606
+ endTimeStamp: 0,
1607
+ resizeTimeStamp: 0,
1608
+ resizeTimeout: 0
1609
+ };
1615
1610
  // HTML input types that do not cause the software keyboard to appear.
1616
1611
  const $bb39c0fc1c19b34c$var$nonTextInputTypes = new Set([
1617
1612
  'checkbox',
@@ -1624,8 +1619,181 @@ const $bb39c0fc1c19b34c$var$nonTextInputTypes = new Set([
1624
1619
  'submit',
1625
1620
  'reset'
1626
1621
  ]);
1622
+ if (process.env.NODE_ENV === 'test' && typeof window !== 'undefined' && !Reflect.has(window, 'visualViewport')) {
1623
+ const visualViewport = Object.assign(new EventTarget(), {
1624
+ offsetTop: 0,
1625
+ offsetLeft: 0,
1626
+ pageTop: 0,
1627
+ pageLeft: 0,
1628
+ scale: 1
1629
+ });
1630
+ Reflect.defineProperty(visualViewport, 'width', {
1631
+ get: ()=>window.innerWidth,
1632
+ configurable: true
1633
+ });
1634
+ Reflect.defineProperty(visualViewport, 'height', {
1635
+ get: ()=>window.innerHeight,
1636
+ configurable: true
1637
+ });
1638
+ Reflect.defineProperty(window, 'visualViewport', {
1639
+ value: visualViewport,
1640
+ configurable: true,
1641
+ writable: true
1642
+ });
1643
+ }
1644
+ if (process.env.NODE_ENV === 'test' && typeof window !== 'undefined' && !Reflect.has(window.screen, 'orientation')) {
1645
+ const orientation = Object.assign(new EventTarget(), {
1646
+ type: 'landscape-primary'
1647
+ });
1648
+ Reflect.defineProperty(window.screen, 'orientation', {
1649
+ value: orientation,
1650
+ configurable: true,
1651
+ writable: true
1652
+ });
1653
+ Reflect.defineProperty(window.screen.orientation, 'angle', {
1654
+ get: ()=>window.orientation ?? 0,
1655
+ configurable: true
1656
+ });
1657
+ }
1658
+ function $bb39c0fc1c19b34c$var$getTouchScreen() {
1659
+ // Normalize the screen by any scaling to get the layout coordinate space.
1660
+ let screenWidth = Number(window.visualViewport?.width ?? window.innerWidth);
1661
+ let screenHeight = Number(window.visualViewport?.height ?? window.innerHeight);
1662
+ let visualScale = Number(window.visualViewport?.scale ?? 1);
1663
+ return {
1664
+ width: screenWidth * visualScale,
1665
+ height: screenHeight * visualScale,
1666
+ angle: window.screen.orientation?.angle ?? 0
1667
+ };
1668
+ }
1669
+ function $bb39c0fc1c19b34c$var$onResizeStart(e) {
1670
+ // So we don't constantly call clearTimeout and setTimeout, keep track of the
1671
+ // current timeout time and only reschedule the timer when it is getting close.
1672
+ if ($bb39c0fc1c19b34c$var$state.resizeTimeStamp <= e.timeStamp + 50) {
1673
+ $bb39c0fc1c19b34c$var$state.resizeTimeStamp = e.timeStamp + 150;
1674
+ window.clearTimeout($bb39c0fc1c19b34c$var$state.resizeTimeout);
1675
+ $bb39c0fc1c19b34c$var$state.resizeTimeout = window.setTimeout($bb39c0fc1c19b34c$var$onResizeEnd, 150);
1676
+ }
1677
+ }
1678
+ function $bb39c0fc1c19b34c$var$onResizeEnd() {
1679
+ let viewportMeta = ($7096878c21af5e66$export$a929f3f93e2cc67e)('viewport');
1680
+ // Overlaying keyboards do not impact geometry, so there is nothing to measure.
1681
+ // https://caniuse.com/mdn-html_elements_meta_name_viewport_interactive-widget
1682
+ if (($2add3ce32c6007eb$export$a11b0059900ceec8)() && viewportMeta?.includes('overlays-content')) return;
1683
+ let time = performance.now();
1684
+ let screen = $bb39c0fc1c19b34c$var$getTouchScreen();
1685
+ let elapsed = time - $bb39c0fc1c19b34c$var$state.startTimeStamp;
1686
+ let delta = $bb39c0fc1c19b34c$var$state.screenHeight - screen.height;
1687
+ let rotation = $bb39c0fc1c19b34c$var$state.screenAngle - screen.angle;
1688
+ // Update the screen once an open keyboard that rotated along closes. The state swap was
1689
+ // deferred, so the old width predicts the height it should close towards.
1690
+ if (Math.abs(rotation) % 180 && $bb39c0fc1c19b34c$var$state.screenWidth - screen.height < $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT) {
1691
+ $bb39c0fc1c19b34c$var$state.screenWidth = screen.width;
1692
+ $bb39c0fc1c19b34c$var$state.screenHeight = screen.height;
1693
+ $bb39c0fc1c19b34c$var$state.screenAngle = screen.angle;
1694
+ delta = 0;
1695
+ }
1696
+ // Update the screen if a resize happens outside the capture timeframe. We debounce
1697
+ // because WebKit may fire its single opening resize before the focus event.
1698
+ if (elapsed > $bb39c0fc1c19b34c$var$KEYBOARD_TIMEOUT) {
1699
+ window.clearTimeout($bb39c0fc1c19b34c$var$state.screenTimeout);
1700
+ $bb39c0fc1c19b34c$var$state.screenTimeout = window.setTimeout(()=>{
1701
+ let activeElement = document.hasFocus() ? ($23f2114a1b82827e$export$cd4e5573fbe2b576)() : null;
1702
+ let willKeyboardOpen = $bb39c0fc1c19b34c$export$c57958e35f31ed73(activeElement);
1703
+ let screen = $bb39c0fc1c19b34c$var$getTouchScreen();
1704
+ if (Math.abs($bb39c0fc1c19b34c$var$state.screenAngle - screen.angle) % 180) return;
1705
+ if ($bb39c0fc1c19b34c$var$state.isOpen && willKeyboardOpen) return;
1706
+ $bb39c0fc1c19b34c$var$state.screenWidth = screen.width;
1707
+ $bb39c0fc1c19b34c$var$state.screenHeight = screen.height;
1708
+ $bb39c0fc1c19b34c$var$state.screenAngle = screen.angle;
1709
+ $bb39c0fc1c19b34c$var$state.isOpen = false;
1710
+ }, $bb39c0fc1c19b34c$var$KEYBOARD_TIMEOUT);
1711
+ }
1712
+ // Otherwise, record an opening if the height changed by more than our threshold.
1713
+ // This may fail if the layout viewport changes for other reasons during this timeframe.
1714
+ if (elapsed <= $bb39c0fc1c19b34c$var$KEYBOARD_TIMEOUT && delta >= $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT) $bb39c0fc1c19b34c$var$state.endTimeStamp = time;
1715
+ // Store the new open state since the viewport is stable when this is reached.
1716
+ $bb39c0fc1c19b34c$var$state.isOpen = delta >= $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT;
1717
+ }
1718
+ function $bb39c0fc1c19b34c$var$onOrientationChange() {
1719
+ let screen = $bb39c0fc1c19b34c$var$getTouchScreen();
1720
+ let rotation = $bb39c0fc1c19b34c$var$state.screenAngle - screen.angle;
1721
+ // Rotation may cause the resize buffer to be filled, but we need to make sure a screen
1722
+ // estimate is already available in case focus lands before it expires. This could fail
1723
+ // if a top bar exceeds the keyboard threshold, in which case we may need to revisit.
1724
+ if (Math.abs(rotation) % 180 && !$bb39c0fc1c19b34c$var$state.isOpen) {
1725
+ let width = $bb39c0fc1c19b34c$var$state.screenWidth;
1726
+ let height = $bb39c0fc1c19b34c$var$state.screenHeight;
1727
+ $bb39c0fc1c19b34c$var$state.screenWidth = height;
1728
+ $bb39c0fc1c19b34c$var$state.screenHeight = width;
1729
+ }
1730
+ if (!$bb39c0fc1c19b34c$var$state.isOpen) $bb39c0fc1c19b34c$var$state.screenAngle = screen.angle;
1731
+ }
1732
+ function $bb39c0fc1c19b34c$var$onFocus(e) {
1733
+ let target = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
1734
+ let willKeyboardOpen = $bb39c0fc1c19b34c$export$c57958e35f31ed73(target);
1735
+ let time = performance.now();
1736
+ let screen = $bb39c0fc1c19b34c$var$getTouchScreen();
1737
+ let delta = $bb39c0fc1c19b34c$var$state.screenHeight - screen.height;
1738
+ // Update the screen and start the timer if we are about to open.
1739
+ if (delta < $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT && willKeyboardOpen) {
1740
+ $bb39c0fc1c19b34c$var$state.screenWidth = screen.width;
1741
+ $bb39c0fc1c19b34c$var$state.screenHeight = screen.height;
1742
+ $bb39c0fc1c19b34c$var$state.screenAngle = screen.angle;
1743
+ $bb39c0fc1c19b34c$var$state.startTimeStamp = time;
1744
+ }
1745
+ // This focus will open a keyboard so reset the buffer.
1746
+ if (willKeyboardOpen) window.clearTimeout($bb39c0fc1c19b34c$var$state.screenTimeout);
1747
+ // Stop the timer if the keyboard is already open.
1748
+ if (delta >= $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT && willKeyboardOpen) $bb39c0fc1c19b34c$var$state.endTimeStamp = time;
1749
+ }
1750
+ function $bb39c0fc1c19b34c$var$setupGlobalEvents() {
1751
+ let screen = $bb39c0fc1c19b34c$var$getTouchScreen();
1752
+ // WebKit only fires a single event per resize.
1753
+ ($d447af545b77c9f1$export$f531f92e2a15358f)(window.visualViewport, 'resize', ($2add3ce32c6007eb$export$78551043582a6a98)() ? $bb39c0fc1c19b34c$var$onResizeEnd : $bb39c0fc1c19b34c$var$onResizeStart);
1754
+ // oxlint-disable-next-line - looks like the lint for this is a little too aggressive
1755
+ ($d447af545b77c9f1$export$f531f92e2a15358f)(window.screen.orientation, 'change', $bb39c0fc1c19b34c$var$onOrientationChange);
1756
+ ($d447af545b77c9f1$export$f531f92e2a15358f)(window, 'focus', $bb39c0fc1c19b34c$var$onFocus, {
1757
+ capture: true,
1758
+ passive: true
1759
+ });
1760
+ // Store the initial screen dimensions.
1761
+ $bb39c0fc1c19b34c$var$state.screenWidth = screen.width;
1762
+ $bb39c0fc1c19b34c$var$state.screenHeight = screen.height;
1763
+ $bb39c0fc1c19b34c$var$state.screenAngle = screen.angle;
1764
+ }
1765
+ if (typeof document !== 'undefined') {
1766
+ if (document.readyState !== 'loading') $bb39c0fc1c19b34c$var$setupGlobalEvents();
1767
+ else ($d447af545b77c9f1$export$f531f92e2a15358f)(document, 'DOMContentLoaded', $bb39c0fc1c19b34c$var$setupGlobalEvents);
1768
+ }
1769
+ function $bb39c0fc1c19b34c$export$a986ed8aea890397() {
1770
+ let viewportMeta = ($7096878c21af5e66$export$a929f3f93e2cc67e)('viewport');
1771
+ // Overlaying keyboards do not impact geometry, so there is nothing to await.
1772
+ // https://caniuse.com/mdn-html_elements_meta_name_viewport_interactive-widget
1773
+ if (($2add3ce32c6007eb$export$a11b0059900ceec8)() && viewportMeta?.includes('overlays-content')) return false;
1774
+ // WebKit may resize before focus, but an open keyboard always means we have support.
1775
+ if ($bb39c0fc1c19b34c$var$state.isOpen) return true;
1776
+ // As long as no input has ever been focused, we return default support.
1777
+ if (!$bb39c0fc1c19b34c$var$state.startTimeStamp) return window.navigator.maxTouchPoints > 0;
1778
+ // If keyboard geometry changed within the timeout period, we have support.
1779
+ if ($bb39c0fc1c19b34c$var$state.endTimeStamp >= $bb39c0fc1c19b34c$var$state.startTimeStamp) return true;
1780
+ // If a geometry change is mid-flight we return the most recent support.
1781
+ // Supported platforms may have a hardware keyboard, which this won't catch, but thats
1782
+ // about as far as we can reasonably go to exclude non-touch devices.
1783
+ return performance.now() - $bb39c0fc1c19b34c$var$state.startTimeStamp <= $bb39c0fc1c19b34c$var$KEYBOARD_TIMEOUT ? $bb39c0fc1c19b34c$var$state.endTimeStamp > 0 || window.navigator.maxTouchPoints > 0 : false;
1784
+ }
1627
1785
  function $bb39c0fc1c19b34c$export$c57958e35f31ed73(target) {
1628
- return target instanceof HTMLInputElement && !$bb39c0fc1c19b34c$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
1786
+ if (!(target instanceof Element) || !($3b8b240c1bf84ab9$export$4c063cf1350e6fed)(target)) return false;
1787
+ let isTextArea = target instanceof HTMLTextAreaElement;
1788
+ let isEditable = target instanceof HTMLElement && target.isContentEditable;
1789
+ let isTextInput = target instanceof HTMLInputElement && !$bb39c0fc1c19b34c$var$nonTextInputTypes.has(target.type);
1790
+ return isTextArea || isEditable || isTextInput;
1791
+ }
1792
+ function $bb39c0fc1c19b34c$export$16792effe837dba3(event) {
1793
+ return ($2add3ce32c6007eb$export$9ac100e40613ea10)() ? event.metaKey : event.ctrlKey;
1794
+ }
1795
+ function $bb39c0fc1c19b34c$export$b1f1c83775b8b5f7() {
1796
+ return $bb39c0fc1c19b34c$var$state.isOpen;
1629
1797
  }
1630
1798
 
1631
1799
  /*
@@ -2074,7 +2242,7 @@ function $cf2482eff2eeeec2$export$f12b703ca79dfbb1(strings, packageName) {
2074
2242
  * governing permissions and limitations under the License.
2075
2243
  */
2076
2244
  // Use the earliest effect possible to reset the ref below.
2077
- const $3e6197669829fe11$var$useEarlyEffect = typeof document !== 'undefined' ? ($8WNJc$react)['useInsertionEffect'] ?? ($8WNJc$react).useLayoutEffect : ()=>{};
2245
+ const $3e6197669829fe11$var$useEarlyEffect = typeof document !== 'undefined' || parseInt(($8WNJc$react).version, 10) >= 19 ? ($8WNJc$react)['useInsertionEffect'] ?? ($8WNJc$react).useLayoutEffect : ()=>{};
2078
2246
  function $3e6197669829fe11$export$40bfa8c7b0832715(value, defaultValue, onChange) {
2079
2247
  // Store the value in both state and a ref. The state value will only be used when uncontrolled.
2080
2248
  // The ref is used to track the most current value, which is passed to the function setState callback.
@@ -2641,7 +2809,7 @@ class $96ead35620b8fd36$export$b34a105447964f9f extends $96ead35620b8fd36$export
2641
2809
  constructor(collection){
2642
2810
  // @ts-ignore
2643
2811
  super(null), this.nodeType = 11 // DOCUMENT_FRAGMENT_NODE
2644
- , this.ownerDocument = this, this.dirtyNodes = new Set(), this.isSSR = false, this.nodeId = 0, this.nodesByProps = new WeakMap(), this.nextCollection = null, this.subscriptions = new Set(), this.queuedRender = false, this.inSubscription = false;
2812
+ , this.ownerDocument = this, this.dirtyNodes = new Set(), this.isSSR = false, this.nodeId = 0, this.nodesByProps = new WeakMap(), this.keyOwners = new Map(), this.nextCollection = null, this.subscriptions = new Set(), this.queuedRender = false, this.inSubscription = false;
2645
2813
  this.collection = collection;
2646
2814
  this.nextCollection = collection;
2647
2815
  }
@@ -2660,6 +2828,16 @@ class $96ead35620b8fd36$export$b34a105447964f9f extends $96ead35620b8fd36$export
2660
2828
  }
2661
2829
  addNode(element) {
2662
2830
  if (element.isHidden || element.node == null) return;
2831
+ if (process.env.NODE_ENV !== 'production') {
2832
+ // Two elements with the same key would corrupt the linked list of sibling keys, which
2833
+ // silently drops items or makes key traversal loop forever. Removed and hidden elements
2834
+ // release their key in removeNode before any node is added, so a different owner here
2835
+ // is a live duplicate.
2836
+ let key = element.node.key;
2837
+ let owner = this.keyOwners.get(key);
2838
+ if (owner && owner !== element) throw new Error(`Duplicate key "${String(key)}" found in collection. Every item in a collection must have a unique key.`);
2839
+ this.keyOwners.set(key, element);
2840
+ }
2663
2841
  let collection = this.getMutableCollection();
2664
2842
  if (!collection.getItem(element.node.key)) for (let child of element)this.addNode(child);
2665
2843
  collection.addNode(element.node);
@@ -2669,6 +2847,7 @@ class $96ead35620b8fd36$export$b34a105447964f9f extends $96ead35620b8fd36$export
2669
2847
  if (node.node) {
2670
2848
  let collection = this.getMutableCollection();
2671
2849
  collection.removeNode(node.node.key);
2850
+ if (process.env.NODE_ENV !== 'production' && this.keyOwners.get(node.node.key) === node) this.keyOwners.delete(node.node.key);
2672
2851
  }
2673
2852
  }
2674
2853
  /** Finalizes the collection update, updating all nodes and freezing the collection. */ getCollection() {
@@ -2732,6 +2911,7 @@ class $96ead35620b8fd36$export$b34a105447964f9f extends $96ead35620b8fd36$export
2732
2911
  this.firstChild = null;
2733
2912
  this.lastChild = null;
2734
2913
  this.nodeId = 0;
2914
+ this.keyOwners.clear();
2735
2915
  }
2736
2916
  }
2737
2917
  }
@@ -2818,62 +2998,57 @@ function $a80bd3e9349588e7$var$isWeakKey(value) {
2818
2998
  * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
2819
2999
  * OF ANY KIND, either express or implied. See the License for the specific language
2820
3000
  * governing permissions and limitations under the License.
2821
- */ // We store a global list of elements that are currently transitioning,
3001
+ */
3002
+
3003
+ // We store a global list of elements that are currently transitioning,
2822
3004
  // mapped to a set of CSS properties that are transitioning for that element.
2823
3005
  // This is necessary rather than a simple count of transitions because of browser
2824
3006
  // bugs, e.g. Chrome sometimes fires both transitionend and transitioncancel rather
2825
3007
  // than one or the other. So we need to track what's actually transitioning so that
2826
3008
  // we can ignore these duplicate events.
2827
-
2828
- let $081cb5757e08788e$var$transitionsByElement = new Map();
2829
- // A list of callbacks to call once there are no transitioning elements.
2830
- let $081cb5757e08788e$var$transitionCallbacks = new Set();
2831
- function $081cb5757e08788e$var$setupGlobalEvents() {
2832
- if (typeof window === 'undefined') return;
2833
- function isTransitionEvent(event) {
2834
- return 'propertyName' in event;
3009
+ const $081cb5757e08788e$var$transitionsByElement = new Map();
3010
+ const $081cb5757e08788e$var$transitionCallbacks = new Set();
3011
+ function $081cb5757e08788e$var$isTransitionEvent(event) {
3012
+ return 'propertyName' in event;
3013
+ }
3014
+ function $081cb5757e08788e$var$onTransitionStart(e) {
3015
+ let eventTarget = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
3016
+ if (!$081cb5757e08788e$var$isTransitionEvent(e) || !eventTarget) return;
3017
+ // Add the transitioning property to the list for this element.
3018
+ let transitions = $081cb5757e08788e$var$transitionsByElement.get(eventTarget);
3019
+ if (!transitions) {
3020
+ transitions = new Set();
3021
+ $081cb5757e08788e$var$transitionsByElement.set(eventTarget, transitions);
3022
+ // The transitioncancel event must be registered on the element itself, rather than as a global
3023
+ // event. This enables us to handle when the node is deleted from the document while it is transitioning.
3024
+ // In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.
3025
+ eventTarget.addEventListener('transitioncancel', $081cb5757e08788e$var$onTransitionEnd, {
3026
+ once: true
3027
+ });
2835
3028
  }
2836
- let onTransitionStart = (e)=>{
2837
- let eventTarget = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
2838
- if (!isTransitionEvent(e) || !eventTarget) return;
2839
- // Add the transitioning property to the list for this element.
2840
- let transitions = $081cb5757e08788e$var$transitionsByElement.get(eventTarget);
2841
- if (!transitions) {
2842
- transitions = new Set();
2843
- $081cb5757e08788e$var$transitionsByElement.set(eventTarget, transitions);
2844
- // The transitioncancel event must be registered on the element itself, rather than as a global
2845
- // event. This enables us to handle when the node is deleted from the document while it is transitioning.
2846
- // In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.
2847
- eventTarget.addEventListener('transitioncancel', onTransitionEnd, {
2848
- once: true
2849
- });
2850
- }
2851
- transitions.add(e.propertyName);
2852
- };
2853
- let onTransitionEnd = (e)=>{
2854
- let eventTarget = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
2855
- if (!isTransitionEvent(e) || !eventTarget) return;
2856
- // Remove property from list of transitioning properties.
2857
- let properties = $081cb5757e08788e$var$transitionsByElement.get(eventTarget);
2858
- if (!properties) return;
2859
- properties.delete(e.propertyName);
2860
- // If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.
2861
- if (properties.size === 0) {
2862
- eventTarget.removeEventListener('transitioncancel', onTransitionEnd);
2863
- $081cb5757e08788e$var$transitionsByElement.delete(eventTarget);
2864
- }
2865
- // If no transitioning elements, call all of the queued callbacks.
2866
- if ($081cb5757e08788e$var$transitionsByElement.size === 0) {
2867
- for (let cb of $081cb5757e08788e$var$transitionCallbacks)cb();
2868
- $081cb5757e08788e$var$transitionCallbacks.clear();
2869
- }
2870
- };
2871
- document.body.addEventListener('transitionrun', onTransitionStart);
2872
- document.body.addEventListener('transitionend', onTransitionEnd);
3029
+ transitions.add(e.propertyName);
2873
3030
  }
2874
- if (typeof document !== 'undefined') {
2875
- if (document.readyState !== 'loading') $081cb5757e08788e$var$setupGlobalEvents();
2876
- else document.addEventListener('DOMContentLoaded', $081cb5757e08788e$var$setupGlobalEvents);
3031
+ function $081cb5757e08788e$var$onTransitionEnd(e) {
3032
+ let eventTarget = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
3033
+ if (!$081cb5757e08788e$var$isTransitionEvent(e) || !eventTarget) return;
3034
+ // Remove property from list of transitioning properties.
3035
+ let properties = $081cb5757e08788e$var$transitionsByElement.get(eventTarget);
3036
+ if (!properties) return;
3037
+ properties.delete(e.propertyName);
3038
+ // If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.
3039
+ if (properties.size === 0) {
3040
+ eventTarget.removeEventListener('transitioncancel', $081cb5757e08788e$var$onTransitionEnd);
3041
+ $081cb5757e08788e$var$transitionsByElement.delete(eventTarget);
3042
+ }
3043
+ // If no transitioning elements, call all of the queued callbacks.
3044
+ if ($081cb5757e08788e$var$transitionsByElement.size === 0) for (let callback of $081cb5757e08788e$var$transitionCallbacks){
3045
+ callback(true);
3046
+ $081cb5757e08788e$var$transitionCallbacks.delete(callback);
3047
+ }
3048
+ }
3049
+ function $081cb5757e08788e$var$setupGlobalEvents() {
3050
+ ($d447af545b77c9f1$export$f531f92e2a15358f)(document, 'transitionrun', $081cb5757e08788e$var$onTransitionStart);
3051
+ ($d447af545b77c9f1$export$f531f92e2a15358f)(document, 'transitionend', $081cb5757e08788e$var$onTransitionEnd);
2877
3052
  }
2878
3053
  /**
2879
3054
  * Cleans up any elements that are no longer in the document.
@@ -2884,15 +3059,23 @@ if (typeof document !== 'undefined') {
2884
3059
  // the explicit instanceof check, since it may be different in different contexts.
2885
3060
  if ('isConnected' in eventTarget && !eventTarget.isConnected) $081cb5757e08788e$var$transitionsByElement.delete(eventTarget);
2886
3061
  }
3062
+ if (typeof document !== 'undefined') {
3063
+ if (document.readyState !== 'loading') $081cb5757e08788e$var$setupGlobalEvents();
3064
+ else ($d447af545b77c9f1$export$f531f92e2a15358f)(document, 'DOMContentLoaded', $081cb5757e08788e$var$setupGlobalEvents);
3065
+ }
2887
3066
  function $081cb5757e08788e$export$24490316f764c430(fn) {
2888
3067
  // Wait one frame to see if an animation starts, e.g. a transition on mount.
2889
- requestAnimationFrame(()=>{
3068
+ let frame = window.requestAnimationFrame(()=>{
2890
3069
  $081cb5757e08788e$var$cleanupDetachedElements();
2891
3070
  // If no transitions are running, call the function immediately.
2892
3071
  // Otherwise, add it to a list of callbacks to run at the end of the animation.
2893
- if ($081cb5757e08788e$var$transitionsByElement.size === 0) fn();
2894
- else $081cb5757e08788e$var$transitionCallbacks.add(fn);
3072
+ if ($081cb5757e08788e$var$transitionsByElement.size === 0) return fn(false);
3073
+ $081cb5757e08788e$var$transitionCallbacks.add(fn);
2895
3074
  });
3075
+ return ()=>{
3076
+ window.cancelAnimationFrame(frame);
3077
+ $081cb5757e08788e$var$transitionCallbacks.delete(fn);
3078
+ };
2896
3079
  }
2897
3080
 
2898
3081
  /*
@@ -3904,7 +4087,8 @@ const $8e9d2fae0ecb9001$var$globalAttrs = new Set([
3904
4087
  'lang',
3905
4088
  'hidden',
3906
4089
  'inert',
3907
- 'translate'
4090
+ 'translate',
4091
+ 'suppressHydrationWarning'
3908
4092
  ]);
3909
4093
  const $8e9d2fae0ecb9001$var$globalEvents = new Set([
3910
4094
  'onClick',
@@ -4018,32 +4202,6 @@ function $cbf007e418543821$export$b0d6fa1ab32e3295(target) {
4018
4202
  }
4019
4203
  }
4020
4204
 
4021
- /*
4022
- * Copyright 2026 Adobe. All rights reserved.
4023
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4024
- * you may not use this file except in compliance with the License. You may obtain a copy
4025
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
4026
- *
4027
- * Unless required by applicable law or agreed to in writing, software distributed under
4028
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
4029
- * OF ANY KIND, either express or implied. See the License for the specific language
4030
- * governing permissions and limitations under the License.
4031
- */
4032
- function $7096878c21af5e66$export$a929f3f93e2cc67e(key, doc) {
4033
- let ownerWindow = ($d447af545b77c9f1$export$f21a1ffae260145a)(doc);
4034
- let ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(doc);
4035
- if (ownerDocument == null || ownerWindow == null) return;
4036
- let content = undefined;
4037
- let selector = `meta[name="${CSS.escape(key)}"], meta[property="${CSS.escape(key)}"]`;
4038
- let meta = ownerDocument.querySelector(selector);
4039
- if (meta && meta instanceof ownerWindow.HTMLMetaElement) {
4040
- if (key === 'csp-nonce' && meta.nonce) content ??= meta.nonce || undefined;
4041
- if (meta.content) content ??= meta.content || undefined;
4042
- }
4043
- if (key === 'csp-nonce') content ??= ownerWindow.__webpack_nonce__ || globalThis.__webpack_nonce__ || undefined;
4044
- return content;
4045
- }
4046
-
4047
4205
  /*
4048
4206
  * Copyright 2026 Adobe. All rights reserved.
4049
4207
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -5330,27 +5488,6 @@ try {
5330
5488
  }).resolvedOptions().signDisplay === 'exceptZero';
5331
5489
  // eslint-disable-next-line no-empty
5332
5490
  } catch {}
5333
- let $1dfb119a85e764e5$var$supportsUnit = false;
5334
- try {
5335
- $1dfb119a85e764e5$var$supportsUnit = new Intl.NumberFormat('de-DE', {
5336
- style: 'unit',
5337
- unit: 'degree'
5338
- }).resolvedOptions().style === 'unit';
5339
- // eslint-disable-next-line no-empty
5340
- } catch {}
5341
- // Polyfill for units since Safari doesn't support them yet. See https://bugs.webkit.org/show_bug.cgi?id=215438.
5342
- // Currently only polyfilling the unit degree in narrow format for ColorSlider in our supported locales.
5343
- // Values were determined by switching to each locale manually in Chrome.
5344
- const $1dfb119a85e764e5$var$UNITS = {
5345
- degree: {
5346
- narrow: {
5347
- default: "\xb0",
5348
- 'ja-JP': " \u5EA6",
5349
- 'zh-TW': "\u5EA6",
5350
- 'sl-SI': " \xb0"
5351
- }
5352
- }
5353
- };
5354
5491
  class $1dfb119a85e764e5$export$cc77c4ff7e8673c5 {
5355
5492
  constructor(locale, options = {}){
5356
5493
  this.numberFormatter = $1dfb119a85e764e5$var$getCachedNumberFormatter(locale, options);
@@ -5363,12 +5500,6 @@ class $1dfb119a85e764e5$export$cc77c4ff7e8673c5 {
5363
5500
  let res = '';
5364
5501
  if (!$1dfb119a85e764e5$var$supportsSignDisplay && this.options.signDisplay != null) res = $1dfb119a85e764e5$export$711b50b3c525e0f2(this.numberFormatter, this.options.signDisplay, value);
5365
5502
  else res = this.numberFormatter.format(value);
5366
- if (this.options.style === 'unit' && !$1dfb119a85e764e5$var$supportsUnit) {
5367
- let { unit: unit, unitDisplay: unitDisplay = 'short', locale: locale } = this.resolvedOptions();
5368
- if (!unit) return res;
5369
- let values = $1dfb119a85e764e5$var$UNITS[unit]?.[unitDisplay];
5370
- res += values[locale] || values.default;
5371
- }
5372
5503
  return res;
5373
5504
  }
5374
5505
  /** Formats a number to an array of parts such as separators, digits, punctuation, and more. */ formatToParts(value) {
@@ -5408,12 +5539,6 @@ class $1dfb119a85e764e5$export$cc77c4ff7e8673c5 {
5408
5539
  ...options,
5409
5540
  signDisplay: this.options.signDisplay
5410
5541
  };
5411
- if (!$1dfb119a85e764e5$var$supportsUnit && this.options.style === 'unit') options = {
5412
- ...options,
5413
- style: 'unit',
5414
- unit: this.options.unit,
5415
- unitDisplay: this.options.unitDisplay
5416
- };
5417
5542
  return options;
5418
5543
  }
5419
5544
  }
@@ -5423,15 +5548,6 @@ function $1dfb119a85e764e5$var$getCachedNumberFormatter(locale, options = {}) {
5423
5548
  if (!locale.includes('-u-')) locale += '-u-';
5424
5549
  locale += `-nu-${numberingSystem}`;
5425
5550
  }
5426
- if (options.style === 'unit' && !$1dfb119a85e764e5$var$supportsUnit) {
5427
- let { unit: unit, unitDisplay: unitDisplay = 'short' } = options;
5428
- if (!unit) throw new Error('unit option must be provided with style: "unit"');
5429
- if (!$1dfb119a85e764e5$var$UNITS[unit]?.[unitDisplay]) throw new Error(`Unsupported unit ${unit} with unitDisplay = ${unitDisplay}`);
5430
- options = {
5431
- ...options,
5432
- style: 'decimal'
5433
- };
5434
- }
5435
5551
  let cacheKey = locale + (options ? Object.entries(options).sort((a, b)=>a[0] < b[0] ? -1 : 1).join() : '');
5436
5552
  if ($1dfb119a85e764e5$var$formatterCache.has(cacheKey)) return $1dfb119a85e764e5$var$formatterCache.get(cacheKey);
5437
5553
  let numberFormatter = new Intl.NumberFormat(locale, options);
@@ -9798,11 +9914,14 @@ function $76d97191f0f90600$export$94ed1c92c7beeb22(node, checkForOverflow) {
9798
9914
  */
9799
9915
 
9800
9916
  function $51a3e22a5186a962$export$53a0910f038337bd(scrollView, element, opts = {}) {
9801
- let { block: block = 'nearest', inline: inline = 'nearest' } = opts;
9802
9917
  if (scrollView === element) return;
9918
+ let target = element.getBoundingClientRect();
9919
+ $51a3e22a5186a962$export$f064fd83a2c6e9ca(scrollView, element, target, opts);
9920
+ }
9921
+ function $51a3e22a5186a962$export$f064fd83a2c6e9ca(scrollView, element, target, opts = {}) {
9922
+ let { block: block = 'nearest', inline: inline = 'nearest' } = opts;
9803
9923
  let y = scrollView.scrollTop;
9804
9924
  let x = scrollView.scrollLeft;
9805
- let target = element.getBoundingClientRect();
9806
9925
  let view = scrollView.getBoundingClientRect();
9807
9926
  let itemStyle = window.getComputedStyle(element);
9808
9927
  let viewStyle = window.getComputedStyle(scrollView);
@@ -19473,6 +19592,97 @@ function $77844860df94ba23$export$ea8f71083e90600f(props, ref) {
19473
19592
  */
19474
19593
 
19475
19594
 
19595
+ const $e0a0e4399f316b76$var$WEBKIT_OPEN_DELAY = 200;
19596
+ const $e0a0e4399f316b76$var$TRANSITION_FRAMETIME = 50;
19597
+ const $e0a0e4399f316b76$var$TRANSITION_TIMEOUT = 600;
19598
+ const $e0a0e4399f316b76$var$listenersByWindow = new WeakMap();
19599
+ const $e0a0e4399f316b76$var$transitionCallbacks = new Set();
19600
+ const $e0a0e4399f316b76$var$resizeCallbacks = new Set();
19601
+ function $e0a0e4399f316b76$var$onTransitionFrame(wasOpenKeyboard, signal) {
19602
+ let isOpenKeyboard = ($bb39c0fc1c19b34c$export$b1f1c83775b8b5f7)();
19603
+ // Flush resize callbacks when the keyboard has affected layout or we ran out of time.
19604
+ if (wasOpenKeyboard !== isOpenKeyboard || signal.aborted) for (let callback of $e0a0e4399f316b76$var$resizeCallbacks){
19605
+ callback(isOpenKeyboard);
19606
+ $e0a0e4399f316b76$var$resizeCallbacks.delete(callback);
19607
+ }
19608
+ // WebKit only fires a single resize event at the start of an opening transition.
19609
+ // The animation takes ~200ms, so restart the listener and flush when it runs out of time.
19610
+ if (!wasOpenKeyboard && isOpenKeyboard && ($2add3ce32c6007eb$export$78551043582a6a98)() && !signal.aborted) {
19611
+ window.clearInterval($e0a0e4399f316b76$var$listenersByWindow.get(window));
19612
+ $e0a0e4399f316b76$var$listenersByWindow.set(window, $e0a0e4399f316b76$var$setupGlobalListeners($e0a0e4399f316b76$var$WEBKIT_OPEN_DELAY));
19613
+ return;
19614
+ }
19615
+ // Flush transition callbacks when the animation has completed or we ran out of time.
19616
+ if (wasOpenKeyboard !== isOpenKeyboard || signal.aborted) for (let callback of $e0a0e4399f316b76$var$transitionCallbacks){
19617
+ callback(isOpenKeyboard);
19618
+ $e0a0e4399f316b76$var$transitionCallbacks.delete(callback);
19619
+ }
19620
+ // Cancel the observer when no pending updates remain or we ran out of time.
19621
+ if ($e0a0e4399f316b76$var$resizeCallbacks.size + $e0a0e4399f316b76$var$transitionCallbacks.size <= 0 || signal.aborted) {
19622
+ window.clearInterval($e0a0e4399f316b76$var$listenersByWindow.get(window));
19623
+ $e0a0e4399f316b76$var$listenersByWindow.delete(window);
19624
+ }
19625
+ }
19626
+ function $e0a0e4399f316b76$var$setupGlobalListeners(timeout = $e0a0e4399f316b76$var$TRANSITION_TIMEOUT) {
19627
+ return window.setInterval($e0a0e4399f316b76$var$onTransitionFrame, $e0a0e4399f316b76$var$TRANSITION_FRAMETIME, ($bb39c0fc1c19b34c$export$b1f1c83775b8b5f7)(), AbortSignal.timeout(timeout));
19628
+ }
19629
+ function $e0a0e4399f316b76$export$b80f73f72d03c10f(fn) {
19630
+ // Flush synchronously when keyboard is unsupported. This is default for non-touch devices
19631
+ // or devices which did not open their OSK within our opening timeout.
19632
+ if (!($bb39c0fc1c19b34c$export$a986ed8aea890397)()) return fn(false), ()=>{};
19633
+ // Wait two frames to see if focus lands on an input.
19634
+ let frame = window.requestAnimationFrame(()=>{
19635
+ frame = window.requestAnimationFrame(()=>{
19636
+ let activeElement = document.hasFocus() ? ($23f2114a1b82827e$export$cd4e5573fbe2b576)() : null;
19637
+ let willKeyboardOpen = ($bb39c0fc1c19b34c$export$c57958e35f31ed73)(activeElement);
19638
+ // If keyboard won't change, call the function immediately.
19639
+ if (($bb39c0fc1c19b34c$export$b1f1c83775b8b5f7)() === willKeyboardOpen) return fn(willKeyboardOpen);
19640
+ // On close, fire immediately since consumers may assert the ICB.
19641
+ if (($bb39c0fc1c19b34c$export$b1f1c83775b8b5f7)() && !willKeyboardOpen) return fn(willKeyboardOpen);
19642
+ $e0a0e4399f316b76$var$resizeCallbacks.add(fn);
19643
+ if (!$e0a0e4399f316b76$var$listenersByWindow.has(window)) $e0a0e4399f316b76$var$listenersByWindow.set(window, $e0a0e4399f316b76$var$setupGlobalListeners());
19644
+ });
19645
+ });
19646
+ return ()=>{
19647
+ window.cancelAnimationFrame(frame);
19648
+ $e0a0e4399f316b76$var$resizeCallbacks.delete(fn);
19649
+ };
19650
+ }
19651
+ function $e0a0e4399f316b76$export$c82b8fe1ad51fcd9(fn) {
19652
+ // Flush synchronously when keyboard is unsupported. This is default for non-touch devices
19653
+ // or devices which did not open their OSK within our opening timeout.
19654
+ if (!($bb39c0fc1c19b34c$export$a986ed8aea890397)()) return fn(false), ()=>{};
19655
+ // Wait two frames to see if focus lands on an input.
19656
+ let frame = window.requestAnimationFrame(()=>{
19657
+ frame = window.requestAnimationFrame(()=>{
19658
+ let activeElement = document.hasFocus() ? ($23f2114a1b82827e$export$cd4e5573fbe2b576)() : null;
19659
+ let willKeyboardOpen = ($bb39c0fc1c19b34c$export$c57958e35f31ed73)(activeElement);
19660
+ // If keyboard won't transition, fire immediately.
19661
+ if (($bb39c0fc1c19b34c$export$b1f1c83775b8b5f7)() === willKeyboardOpen) return fn(willKeyboardOpen);
19662
+ $e0a0e4399f316b76$var$transitionCallbacks.add(fn);
19663
+ if (!$e0a0e4399f316b76$var$listenersByWindow.has(window)) $e0a0e4399f316b76$var$listenersByWindow.set(window, $e0a0e4399f316b76$var$setupGlobalListeners());
19664
+ });
19665
+ });
19666
+ return ()=>{
19667
+ window.cancelAnimationFrame(frame);
19668
+ $e0a0e4399f316b76$var$transitionCallbacks.delete(fn);
19669
+ };
19670
+ }
19671
+
19672
+ /*
19673
+ * Copyright 2020 Adobe. All rights reserved.
19674
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
19675
+ * you may not use this file except in compliance with the License. You may obtain a copy
19676
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
19677
+ *
19678
+ * Unless required by applicable law or agreed to in writing, software distributed under
19679
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
19680
+ * OF ANY KIND, either express or implied. See the License for the specific language
19681
+ * governing permissions and limitations under the License.
19682
+ */
19683
+
19684
+
19685
+
19476
19686
 
19477
19687
 
19478
19688
 
@@ -19484,28 +19694,29 @@ const $0644e3663365bfe5$var$visualViewport = typeof document !== 'undefined' &&
19484
19694
  let $0644e3663365bfe5$var$preventScrollCount = 0;
19485
19695
  let $0644e3663365bfe5$var$restore;
19486
19696
  function $0644e3663365bfe5$export$ee0f7cc6afcd1c18(options = {}) {
19487
- let { isDisabled: isDisabled } = options;
19697
+ let { isDisabled: isDisabled, UNSTABLE_overrideFocus: UNSTABLE_overrideFocus } = options;
19488
19698
  ($c4867b2f328c2698$export$e5c5a5f917a5871c)(()=>{
19489
19699
  if (isDisabled) return;
19490
19700
  $0644e3663365bfe5$var$preventScrollCount++;
19491
19701
  if ($0644e3663365bfe5$var$preventScrollCount === 1) {
19492
19702
  if (($2add3ce32c6007eb$export$fedb369cb70207f1)() && ($2add3ce32c6007eb$export$78551043582a6a98)()) $0644e3663365bfe5$var$restore = $0644e3663365bfe5$var$preventScrollMobileWebKit();
19493
- else $0644e3663365bfe5$var$restore = $0644e3663365bfe5$var$preventScrollStandard();
19703
+ else $0644e3663365bfe5$var$restore = $0644e3663365bfe5$var$preventScrollStandard(UNSTABLE_overrideFocus);
19494
19704
  }
19495
19705
  return ()=>{
19496
19706
  $0644e3663365bfe5$var$preventScrollCount--;
19497
19707
  if ($0644e3663365bfe5$var$preventScrollCount === 0) $0644e3663365bfe5$var$restore();
19498
19708
  };
19499
19709
  }, [
19500
- isDisabled
19710
+ isDisabled,
19711
+ UNSTABLE_overrideFocus
19501
19712
  ]);
19502
19713
  }
19503
19714
  // For most browsers, all we need to do is set `overflow: hidden` on the root element, and
19504
19715
  // add some padding to prevent the page from shifting when the scrollbar is hidden.
19505
- function $0644e3663365bfe5$var$preventScrollStandard() {
19716
+ function $0644e3663365bfe5$var$preventScrollStandard(UNSTABLE_overrideFocus) {
19506
19717
  let scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
19507
19718
  return ($a4e76a5424781910$export$e08e3b67e392101e)(scrollbarWidth > 0 && // Use scrollbar-gutter when supported because it also works for fixed positioned elements.
19508
- ('scrollbarGutter' in document.documentElement.style ? ($d447af545b77c9f1$export$37a5fde709c1db82)(document.documentElement, 'scrollbar-gutter', 'stable') : ($d447af545b77c9f1$export$37a5fde709c1db82)(document.documentElement, 'padding-right', `${scrollbarWidth}px`)), ($d447af545b77c9f1$export$37a5fde709c1db82)(document.documentElement, 'overflow', 'hidden'));
19719
+ ('scrollbarGutter' in document.documentElement.style ? ($d447af545b77c9f1$export$37a5fde709c1db82)(document.documentElement, 'scrollbar-gutter', 'stable') : ($d447af545b77c9f1$export$37a5fde709c1db82)(document.documentElement, 'padding-right', `${scrollbarWidth}px`)), ($d447af545b77c9f1$export$37a5fde709c1db82)(document.documentElement, 'overflow', 'hidden'), UNSTABLE_overrideFocus && $0644e3663365bfe5$var$overrideFocus(), UNSTABLE_overrideFocus && ($bb39c0fc1c19b34c$export$a986ed8aea890397)() && $0644e3663365bfe5$var$handleBlur());
19509
19720
  }
19510
19721
  // Mobile Safari is a whole different beast. Even with overflow: hidden,
19511
19722
  // it still scrolls the page in many situations:
@@ -19536,7 +19747,7 @@ function $0644e3663365bfe5$var$preventScrollMobileWebKit() {
19536
19747
  let onTouchStart = (e)=>{
19537
19748
  // Store the nearest scrollable parent element from the element that the user touched.
19538
19749
  let target = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
19539
- scrollable = ($901761b40e390936$export$2bb74740c4e19def)(target) ? target : ($3578607fe3d4b096$export$cfa2225e87938781)(target, true);
19750
+ scrollable = ($901761b40e390936$export$2bb74740c4e19def)(target, true) ? target : ($3578607fe3d4b096$export$cfa2225e87938781)(target, true);
19540
19751
  allowTouchMove = false;
19541
19752
  // If the target is selected, don't preventDefault in touchmove to allow user to adjust selection.
19542
19753
  let selection = target.ownerDocument.defaultView.getSelection();
@@ -19576,16 +19787,28 @@ function $0644e3663365bfe5$var$preventScrollMobileWebKit() {
19576
19787
  // because it must be set before the touchstart event.
19577
19788
  if (scrollable.scrollHeight === scrollable.clientHeight && scrollable.scrollWidth === scrollable.clientWidth) e.preventDefault();
19578
19789
  };
19790
+ let restoreFocus = $0644e3663365bfe5$var$overrideFocus();
19791
+ let removeEvents = ($a4e76a5424781910$export$e08e3b67e392101e)(($d447af545b77c9f1$export$f531f92e2a15358f)(document, 'touchstart', onTouchStart, {
19792
+ passive: false,
19793
+ capture: true
19794
+ }), ($d447af545b77c9f1$export$f531f92e2a15358f)(document, 'touchmove', onTouchMove, {
19795
+ passive: false,
19796
+ capture: true
19797
+ }), $0644e3663365bfe5$var$handleBlur());
19798
+ return ()=>{
19799
+ restoreOverflow();
19800
+ removeEvents();
19801
+ style.remove();
19802
+ restoreFocus();
19803
+ };
19804
+ }
19805
+ function $0644e3663365bfe5$var$handleBlur() {
19579
19806
  let onBlur = (e)=>{
19580
19807
  let target = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
19581
19808
  let relatedTarget = e.relatedTarget;
19582
- if (relatedTarget && ($bb39c0fc1c19b34c$export$c57958e35f31ed73)(relatedTarget)) {
19583
- // Focus without scrolling the whole page, and then scroll into view manually.
19584
- relatedTarget.focus({
19585
- preventScroll: true
19586
- });
19587
- $0644e3663365bfe5$var$scrollIntoViewWhenReady(relatedTarget, ($bb39c0fc1c19b34c$export$c57958e35f31ed73)(target));
19588
- } else if (!relatedTarget) {
19809
+ if (relatedTarget && ($bb39c0fc1c19b34c$export$c57958e35f31ed73)(relatedTarget)) // Re-focus programmatically to have the override below perform the scroll.
19810
+ relatedTarget.focus();
19811
+ else if (!relatedTarget) {
19589
19812
  // When tapping the Done button on the keyboard, focus moves to the body.
19590
19813
  // FocusScope will then restore focus back to the input. Later when tapping
19591
19814
  // the same input again, it is already focused, so no blur event will fire,
@@ -19597,34 +19820,30 @@ function $0644e3663365bfe5$var$preventScrollMobileWebKit() {
19597
19820
  });
19598
19821
  }
19599
19822
  };
19823
+ return ($d447af545b77c9f1$export$f531f92e2a15358f)(document, 'blur', onBlur, true);
19824
+ }
19825
+ function $0644e3663365bfe5$var$overrideFocus() {
19600
19826
  // Override programmatic focus to scroll into view without scrolling the whole page.
19601
19827
  let focus = HTMLElement.prototype.focus;
19602
19828
  Reflect.defineProperty(HTMLElement.prototype, 'focus', {
19603
19829
  configurable: true,
19604
19830
  writable: true,
19605
19831
  value: function(opts) {
19606
- // Track whether the keyboard was already visible before.
19607
- let activeElement = ($23f2114a1b82827e$export$cd4e5573fbe2b576)();
19608
- let wasKeyboardVisible = activeElement != null && ($bb39c0fc1c19b34c$export$c57958e35f31ed73)(activeElement);
19609
19832
  // Focus the element without scrolling the page.
19610
19833
  focus.call(this, {
19611
19834
  ...opts,
19612
19835
  preventScroll: true
19613
19836
  });
19614
- if (!opts || !opts.preventScroll) $0644e3663365bfe5$var$scrollIntoViewWhenReady(this, wasKeyboardVisible);
19837
+ if (!opts || !opts.preventScroll) {
19838
+ let scroll = ()=>{
19839
+ let activeElement = ($23f2114a1b82827e$export$cd4e5573fbe2b576)();
19840
+ if (activeElement === this) $0644e3663365bfe5$var$scrollIntoView(this);
19841
+ };
19842
+ ($e0a0e4399f316b76$export$b80f73f72d03c10f)((isOpen)=>isOpen ? scroll() : ($e0a0e4399f316b76$export$c82b8fe1ad51fcd9)(()=>scroll()));
19843
+ }
19615
19844
  }
19616
19845
  });
19617
- let removeEvents = ($a4e76a5424781910$export$e08e3b67e392101e)(($d447af545b77c9f1$export$f531f92e2a15358f)(document, 'touchstart', onTouchStart, {
19618
- passive: false,
19619
- capture: true
19620
- }), ($d447af545b77c9f1$export$f531f92e2a15358f)(document, 'touchmove', onTouchMove, {
19621
- passive: false,
19622
- capture: true
19623
- }), ($d447af545b77c9f1$export$f531f92e2a15358f)(document, 'blur', onBlur, true));
19624
19846
  return ()=>{
19625
- restoreOverflow();
19626
- removeEvents();
19627
- style.remove();
19628
19847
  Reflect.defineProperty(HTMLElement.prototype, 'focus', {
19629
19848
  configurable: true,
19630
19849
  writable: true,
@@ -19632,19 +19851,10 @@ function $0644e3663365bfe5$var$preventScrollMobileWebKit() {
19632
19851
  });
19633
19852
  };
19634
19853
  }
19635
- function $0644e3663365bfe5$var$scrollIntoViewWhenReady(target, wasKeyboardVisible) {
19636
- if (wasKeyboardVisible || !$0644e3663365bfe5$var$visualViewport) // If the keyboard was already visible, scroll the target into view immediately.
19637
- $0644e3663365bfe5$var$scrollIntoView(target);
19638
- else // Otherwise, wait for the visual viewport to resize before scrolling so we can
19639
- // measure the correct position to scroll to.
19640
- $0644e3663365bfe5$var$visualViewport.addEventListener('resize', ()=>$0644e3663365bfe5$var$scrollIntoView(target), {
19641
- once: true
19642
- });
19643
- }
19644
19854
  function $0644e3663365bfe5$var$scrollIntoView(target) {
19645
19855
  let root = document.scrollingElement || document.documentElement;
19646
19856
  let nextTarget = target;
19647
- while(nextTarget && nextTarget !== root){
19857
+ while(nextTarget && nextTarget !== root && nextTarget.isConnected){
19648
19858
  // Find the parent scrollable element and adjust the scroll position if the target is not already in view.
19649
19859
  let scrollable = ($3578607fe3d4b096$export$cfa2225e87938781)(nextTarget);
19650
19860
  if (scrollable !== document.documentElement && scrollable !== document.body && scrollable !== nextTarget) {
@@ -20181,9 +20391,21 @@ function $f11fb0bcf1b2687a$export$61c6a8c84e605fb6(props) {
20181
20391
  */
20182
20392
 
20183
20393
 
20184
- function $fcc7165e876206c6$export$6d3443f2c48bfc20(ref, isReady = true) {
20394
+
20395
+
20396
+
20397
+ function $fcc7165e876206c6$export$6d3443f2c48bfc20(ref, isReady = true, onEnter) {
20185
20398
  let [isEntering, setEntering] = (useState)(true);
20186
20399
  let isAnimationReady = isEntering && isReady;
20400
+ // Hide the element while it prepares for entry, using only non-layout-thrashing attributes.
20401
+ // This prevents accidental flashes of content in scenarios where no hidden styling is applied
20402
+ // while the enter animation is not yet ready (e.g. popovers prior to placement calculation).
20403
+ ($c4867b2f328c2698$export$e5c5a5f917a5871c)(()=>{
20404
+ if (!isReady && ref.current) return ($a4e76a5424781910$export$e08e3b67e392101e)(($d447af545b77c9f1$export$37a5fde709c1db82)(ref.current, 'opacity', '0'), ($d447af545b77c9f1$export$37a5fde709c1db82)(ref.current, 'clip', 'rect(0 0 0 0)'), ($d447af545b77c9f1$export$37a5fde709c1db82)(ref.current, 'clip-path', 'inset(50%)'), ($d447af545b77c9f1$export$37a5fde709c1db82)(ref.current, 'mask-image', 'linear-gradient(#0000, #0000)'));
20405
+ }, [
20406
+ ref,
20407
+ isReady
20408
+ ]);
20187
20409
  // There are two cases for entry animations:
20188
20410
  // 1. CSS @keyframes. The `animation` property is set during the isEntering state, and it is removed after the animation finishes.
20189
20411
  // 2. CSS transitions. The initial styles are applied during the isEntering state, and removed immediately, causing the transition to occur.
@@ -20198,10 +20420,10 @@ function $fcc7165e876206c6$export$6d3443f2c48bfc20(ref, isReady = true) {
20198
20420
  ref,
20199
20421
  isAnimationReady
20200
20422
  ]);
20201
- $fcc7165e876206c6$var$useAnimation(ref, isAnimationReady, (useCallback)(()=>setEntering(false), []));
20423
+ $fcc7165e876206c6$var$useAnimation(ref, isAnimationReady, onEnter, (useCallback)(()=>setEntering(false), []));
20202
20424
  return isAnimationReady;
20203
20425
  }
20204
- function $fcc7165e876206c6$export$45fda7c47f93fd48(ref, isOpen) {
20426
+ function $fcc7165e876206c6$export$45fda7c47f93fd48(ref, isOpen, onExit) {
20205
20427
  let [exitState, setExitState] = (useState)(isOpen ? 'open' : 'closed');
20206
20428
  switch(exitState){
20207
20429
  case 'open':
@@ -20216,35 +20438,39 @@ function $fcc7165e876206c6$export$45fda7c47f93fd48(ref, isOpen) {
20216
20438
  break;
20217
20439
  }
20218
20440
  let isExiting = exitState === 'exiting';
20219
- $fcc7165e876206c6$var$useAnimation(ref, isExiting, (useCallback)(()=>{
20441
+ $fcc7165e876206c6$var$useAnimation(ref, isExiting, onExit, (useCallback)(()=>{
20220
20442
  // Set the state to closed, which will cause the element to be unmounted.
20221
20443
  setExitState((state)=>state === 'exiting' ? 'closed' : state);
20222
20444
  }, []));
20223
20445
  return isExiting;
20224
20446
  }
20225
- function $fcc7165e876206c6$var$useAnimation(ref, isActive, onEnd) {
20447
+ function $fcc7165e876206c6$var$useAnimation(ref, isActive, onStart, onEnd) {
20448
+ let isActiveRef = (useRef)(null);
20449
+ let start = ($fe16bffc7a557bf0$export$7f54fc3180508a52)(onStart);
20226
20450
  ($c4867b2f328c2698$export$e5c5a5f917a5871c)(()=>{
20227
- if (isActive && ref.current) {
20451
+ if (isActive && ref.current && isActiveRef.current !== isActive) {
20452
+ isActiveRef.current = isActive;
20228
20453
  if (!('getAnimations' in ref.current)) {
20229
20454
  // JSDOM
20230
20455
  onEnd();
20231
20456
  return;
20232
20457
  }
20233
- let animations = ref.current.getAnimations();
20234
- if (animations.length === 0) {
20458
+ let startPromise = start?.(ref.current);
20459
+ let animations = ref.current.getAnimations().filter((a)=>(typeof DocumentTimeline === 'undefined' || a.timeline instanceof DocumentTimeline) && a.playState === 'running');
20460
+ if (animations.length === 0 && !startPromise) {
20235
20461
  onEnd();
20236
20462
  return;
20237
20463
  }
20238
- let canceled = false;
20239
- Promise.allSettled(animations.map((a)=>a.finished)).then(()=>{
20240
- if (!canceled) (flushSync)(()=>{
20464
+ Promise.all([
20465
+ startPromise,
20466
+ ...animations.map((a)=>a.finished)
20467
+ ]).then(()=>{
20468
+ (flushSync)(()=>{
20241
20469
  onEnd();
20242
20470
  });
20243
- });
20244
- return ()=>{
20245
- canceled = true;
20246
- };
20471
+ }).catch(()=>{});
20247
20472
  }
20473
+ isActiveRef.current = isActive;
20248
20474
  }, [
20249
20475
  ref,
20250
20476
  isActive,
@@ -20279,6 +20505,7 @@ function $fcc7165e876206c6$var$useAnimation(ref, isActive, onEnd) {
20279
20505
 
20280
20506
 
20281
20507
 
20508
+
20282
20509
  const $542a13ca2fa5b484$export$9b9a0cd73afb7ca4 = /*#__PURE__*/ (createContext)(null);
20283
20510
  // Stores a ref for the portal container for a group of popovers (e.g. submenus).
20284
20511
  const $542a13ca2fa5b484$var$PopoverGroupContext = /*#__PURE__*/ (createContext)(null);
@@ -20322,6 +20549,7 @@ function $542a13ca2fa5b484$var$PopoverInner({ state: state, isExiting: isExiting
20322
20549
  let containerRef = (useRef)(null);
20323
20550
  let groupCtx = (useContext)($542a13ca2fa5b484$var$PopoverGroupContext);
20324
20551
  let isSubPopover = groupCtx && props.trigger === 'SubmenuTrigger';
20552
+ let [isOpen, setIsOpen] = (useState)(false);
20325
20553
  let { popoverProps: popoverProps, underlayProps: underlayProps, arrowProps: arrowProps, placement: placement, triggerAnchorPoint: triggerAnchorPoint } = ($f8a024fbad3a5a2e$export$542a6fd13ac93354)({
20326
20554
  ...props,
20327
20555
  offset: props.offset ?? 8,
@@ -20333,7 +20561,7 @@ function $542a13ca2fa5b484$var$PopoverInner({ state: state, isExiting: isExiting
20333
20561
  let ref = props.popoverRef;
20334
20562
  // Skip the automatic entry animation when opening instantly (e.g. swapping between previews
20335
20563
  // during warmup). An explicitly provided isEntering prop still takes precedence.
20336
- let enterAnimation = ($fcc7165e876206c6$export$6d3443f2c48bfc20)(ref, !!placement);
20564
+ let enterAnimation = ($fcc7165e876206c6$export$6d3443f2c48bfc20)(ref, !!placement && isOpen);
20337
20565
  // oxlint-disable-next-line react/react-compiler
20338
20566
  let isEntering = props.isEntering || !props.shouldSkipAnimation && enterAnimation || false;
20339
20567
  // oxlint-disable-next-line react/react-compiler
@@ -20376,7 +20604,10 @@ function $542a13ca2fa5b484$var$PopoverInner({ state: state, isExiting: isExiting
20376
20604
  // oxlint-enable react/react-compiler
20377
20605
  let children = (useMemo)(()=>{
20378
20606
  let children = renderProps.children;
20379
- if (clearContexts) for (let Context of clearContexts)children = /*#__PURE__*/ ($8WNJc$react).createElement(Context.Provider, {
20607
+ for (let Context of [
20608
+ $542a13ca2fa5b484$export$9b9a0cd73afb7ca4,
20609
+ ...clearContexts ?? []
20610
+ ])children = /*#__PURE__*/ ($8WNJc$react).createElement(Context.Provider, {
20380
20611
  value: null
20381
20612
  }, children);
20382
20613
  return children;
@@ -20406,6 +20637,8 @@ function $542a13ca2fa5b484$var$PopoverInner({ state: state, isExiting: isExiting
20406
20637
  ...renderProps.style,
20407
20638
  '--trigger-width': renderProps.style?.['--trigger-width'] || triggerWidth
20408
20639
  };
20640
+ // Since our trigger may open the OSK, we defer the reveal, as a courtesy, to avoid layout shift.
20641
+ ($c4867b2f328c2698$export$e5c5a5f917a5871c)(()=>($e0a0e4399f316b76$export$b80f73f72d03c10f)(()=>setIsOpen(true)), []);
20409
20642
  // oxlint-disable react/react-compiler
20410
20643
  let overlay = /*#__PURE__*/ ($8WNJc$react).createElement(($7230ffa83bc0c2cf$export$df3a06d6289f983e).div, {
20411
20644
  ...($bbaa08b3cd72f041$export$9d1611c77c2fe928)(($8e9d2fae0ecb9001$export$457c3d6518dd4c6f)(props, {
@@ -22384,15 +22617,15 @@ const $49319ee1285aa241$export$2ce376c2cc3355c8 = /*#__PURE__*/ ($42ceafc619f9c3
22384
22617
 
22385
22618
 
22386
22619
  function $13150e6629d46e45$export$d55e7ee900f34e93(props, ref) {
22387
- let { role: role = 'dialog' } = props;
22620
+ let { role: role = 'dialog', isEntering: isEntering } = props;
22388
22621
  let titleId = ($390e54f620492c70$export$b4cc09c592e8fdb8)();
22389
22622
  titleId = props['aria-label'] ? undefined : titleId;
22390
22623
  let contentId = ($390e54f620492c70$export$b4cc09c592e8fdb8)();
22391
22624
  contentId = role === 'alertdialog' && !props['aria-describedby'] ? contentId : undefined;
22392
22625
  let isRefocusing = (useRef)(false);
22393
- // Focus the dialog itself on mount, unless a child element is already focused.
22626
+ // Focus the dialog itself on mount (or once it has entered), unless a child element is already focused.
22394
22627
  (useEffect)(()=>{
22395
- if (ref.current && !($23f2114a1b82827e$export$b4f377a2b6254582)(ref.current)) {
22628
+ if (!isEntering && ref.current && !($23f2114a1b82827e$export$b4f377a2b6254582)(ref.current)) {
22396
22629
  ($f192c2f16961cbe0$export$80f3e147d781571c)(ref.current);
22397
22630
  // Safari on iOS does not move the VoiceOver cursor to the dialog
22398
22631
  // or announce that it has opened until it has rendered. A workaround
@@ -22413,7 +22646,8 @@ function $13150e6629d46e45$export$d55e7ee900f34e93(props, ref) {
22413
22646
  };
22414
22647
  }
22415
22648
  }, [
22416
- ref
22649
+ ref,
22650
+ isEntering
22417
22651
  ]);
22418
22652
  ($d7a937236970dc7f$export$14c98a7594375490)();
22419
22653
  // Warn in dev mode if the dialog has no accessible title.
@@ -24031,7 +24265,9 @@ function $d51706f903be7eab$export$1315d136e6f7581(segment, state, ref) {
24031
24265
  era: era
24032
24266
  }).toDate('UTC');
24033
24267
  let parts = eraFormatter.formatToParts(eraDate);
24034
- let formatted = parts.find((p)=>p.type === 'era').value;
24268
+ // Some eras have no localized name in CLDR (e.g. the Coptic 'BCE' era), in which case
24269
+ // Intl omits the era part entirely. Fall back to the era identifier so it stays typeable.
24270
+ let formatted = parts.find((p)=>p.type === 'era')?.value ?? era;
24035
24271
  return {
24036
24272
  era: era,
24037
24273
  formatted: formatted
@@ -28245,17 +28481,24 @@ function $5698867baeb53f4e$export$dbc0f175b25fb0fb(props, state, ref) {
28245
28481
  onClose: state.close
28246
28482
  }, ref);
28247
28483
  ($0644e3663365bfe5$export$ee0f7cc6afcd1c18)({
28248
- isDisabled: !state.isOpen
28484
+ isDisabled: !state.isOpen,
28485
+ UNSTABLE_overrideFocus: props.UNSTABLE_overrideFocus
28249
28486
  });
28250
28487
  ($d7a937236970dc7f$export$14c98a7594375490)();
28488
+ let { isEntering: isEntering } = props;
28251
28489
  (useEffect)(()=>{
28252
- if (state.isOpen && ref.current) return ($58196c8d6a1f38fc$export$1c3ebcada18427bf)([
28253
- ref.current
28254
- ], {
28255
- shouldUseInert: true
28256
- });
28490
+ if (state.isOpen && ref.current) {
28491
+ if (isEntering) // Prevent a parent modal from hiding this one while it is entering.
28492
+ return ($58196c8d6a1f38fc$export$1020fa7f77e17884)(ref.current);
28493
+ return ($58196c8d6a1f38fc$export$1c3ebcada18427bf)([
28494
+ ref.current
28495
+ ], {
28496
+ shouldUseInert: true
28497
+ });
28498
+ }
28257
28499
  }, [
28258
28500
  state.isOpen,
28501
+ isEntering,
28259
28502
  ref
28260
28503
  ]);
28261
28504
  return {
@@ -28279,9 +28522,11 @@ function $5698867baeb53f4e$export$dbc0f175b25fb0fb(props, state, ref) {
28279
28522
 
28280
28523
 
28281
28524
 
28525
+
28282
28526
  let $6066a2c586ade9e1$var$visualViewport = typeof document !== 'undefined' && window.visualViewport;
28283
28527
  function $6066a2c586ade9e1$export$d699905dd57c73ca() {
28284
28528
  let isSSR = ($c7eafbbe1ea5834e$export$535bd6ca7f90a273)();
28529
+ let unmountRef = (useRef)(null);
28285
28530
  let [size, setSize] = (useState)(()=>isSSR ? {
28286
28531
  width: 0,
28287
28532
  height: 0
@@ -28301,13 +28546,12 @@ function $6066a2c586ade9e1$export$d699905dd57c73ca() {
28301
28546
  };
28302
28547
  // When closing the keyboard, WebKit on iOS does not fire the visual viewport resize event until the animation is complete.
28303
28548
  // We can anticipate this and resize early by handling the blur event and using the layout size.
28304
- let frame;
28305
28549
  let onBlur = (e)=>{
28306
28550
  if ($6066a2c586ade9e1$var$visualViewport && $6066a2c586ade9e1$var$visualViewport.scale > 1) return;
28307
- if (($bb39c0fc1c19b34c$export$c57958e35f31ed73)(($23f2114a1b82827e$export$e58f029f0fbfdb29)(e))) // Wait one frame to see if a new element gets focused.
28308
- frame = requestAnimationFrame(()=>{
28309
- let activeElement = ($23f2114a1b82827e$export$cd4e5573fbe2b576)();
28310
- if (!activeElement || !($bb39c0fc1c19b34c$export$c57958e35f31ed73)(activeElement)) updateSize({
28551
+ if (!($bb39c0fc1c19b34c$export$c57958e35f31ed73)(($23f2114a1b82827e$export$e58f029f0fbfdb29)(e))) return;
28552
+ unmountRef.current = ($e0a0e4399f316b76$export$b80f73f72d03c10f)((isOpen)=>{
28553
+ if (isOpen) return;
28554
+ updateSize({
28311
28555
  width: document.documentElement.clientWidth,
28312
28556
  height: document.documentElement.clientHeight
28313
28557
  });
@@ -28318,7 +28562,7 @@ function $6066a2c586ade9e1$export$d699905dd57c73ca() {
28318
28562
  if (!$6066a2c586ade9e1$var$visualViewport) window.addEventListener('resize', onResize);
28319
28563
  else $6066a2c586ade9e1$var$visualViewport.addEventListener('resize', onResize);
28320
28564
  return ()=>{
28321
- cancelAnimationFrame(frame);
28565
+ unmountRef.current?.();
28322
28566
  if (($2add3ce32c6007eb$export$fedb369cb70207f1)() && ($2add3ce32c6007eb$export$78551043582a6a98)()) window.removeEventListener('blur', onBlur, true);
28323
28567
  if (!$6066a2c586ade9e1$var$visualViewport) window.removeEventListener('resize', onResize);
28324
28568
  else $6066a2c586ade9e1$var$visualViewport.removeEventListener('resize', onResize);
@@ -28362,10 +28606,12 @@ function $6066a2c586ade9e1$export$d699905dd57c73ca() {
28362
28606
 
28363
28607
 
28364
28608
 
28609
+
28610
+
28365
28611
  const $8b8d26808cb8cb53$export$ab57792b9b6974a6 = /*#__PURE__*/ (createContext)(null);
28366
- const $8b8d26808cb8cb53$var$InternalModalContext = /*#__PURE__*/ (createContext)(null);
28612
+ const $8b8d26808cb8cb53$export$6bc057cefccad9c8 = /*#__PURE__*/ (createContext)(null);
28367
28613
  const $8b8d26808cb8cb53$export$2b77a92f1a5ad772 = /*#__PURE__*/ (forwardRef)(function Modal(props, ref) {
28368
- let ctx = (useContext)($8b8d26808cb8cb53$var$InternalModalContext);
28614
+ let ctx = (useContext)($8b8d26808cb8cb53$export$6bc057cefccad9c8);
28369
28615
  if (ctx) {
28370
28616
  if (process.env.NODE_ENV !== 'production' && (props.onOpenChange || props.defaultOpen !== undefined || props.isOpen !== undefined)) {
28371
28617
  // create a list of props that are passed in but not allowed when using an external ModalOverlay
@@ -28414,8 +28660,9 @@ function $8b8d26808cb8cb53$var$ModalOverlayWithForwardRef(props, ref) {
28414
28660
  }
28415
28661
  let objectRef = ($03e8ab2d84d7657a$export$4338b53315abf666)(ref);
28416
28662
  let modalRef = (useRef)(null);
28417
- let isOverlayExiting = ($fcc7165e876206c6$export$45fda7c47f93fd48)(objectRef, state.isOpen);
28418
- let isModalExiting = ($fcc7165e876206c6$export$45fda7c47f93fd48)(modalRef, state.isOpen);
28663
+ let isOverlayExiting = ($fcc7165e876206c6$export$45fda7c47f93fd48)(objectRef, state.isOpen, props.onExit);
28664
+ let onExitRef = (useRef)(null);
28665
+ let isModalExiting = ($fcc7165e876206c6$export$45fda7c47f93fd48)(modalRef, state.isOpen, (element)=>onExitRef.current?.(element));
28419
28666
  let isExiting = isOverlayExiting || isModalExiting || props.isExiting || false;
28420
28667
  let isSSR = ($c7eafbbe1ea5834e$export$535bd6ca7f90a273)();
28421
28668
  if (!state.isOpen && !isExiting || isSSR) return null;
@@ -28424,15 +28671,26 @@ function $8b8d26808cb8cb53$var$ModalOverlayWithForwardRef(props, ref) {
28424
28671
  state: state,
28425
28672
  isExiting: isExiting,
28426
28673
  overlayRef: objectRef,
28427
- modalRef: modalRef
28674
+ modalRef: modalRef,
28675
+ onExitRef: onExitRef
28428
28676
  });
28429
28677
  }
28430
28678
  const $8b8d26808cb8cb53$export$8948f78d83984c69 = /*#__PURE__*/ (forwardRef)($8b8d26808cb8cb53$var$ModalOverlayWithForwardRef);
28431
- function $8b8d26808cb8cb53$var$ModalOverlayInner({ UNSTABLE_portalContainer: UNSTABLE_portalContainer, ...props }) {
28679
+ function $8b8d26808cb8cb53$var$ModalOverlayInner({ UNSTABLE_portalContainer: UNSTABLE_portalContainer, UNSTABLE_deferUntilEntered: UNSTABLE_deferUntilEntered, ...props }) {
28432
28680
  let modalRef = props.modalRef;
28433
28681
  let { state: state } = props;
28434
- let { modalProps: modalProps, underlayProps: underlayProps } = ($5698867baeb53f4e$export$dbc0f175b25fb0fb)(props, state, modalRef);
28435
- let entering = ($fcc7165e876206c6$export$6d3443f2c48bfc20)(props.overlayRef) || props.isEntering || false;
28682
+ let [isOpen, setIsOpen] = (useState)(false);
28683
+ let entering = ($fcc7165e876206c6$export$6d3443f2c48bfc20)(props.overlayRef, isOpen, props.onEnter) || props.isEntering || false;
28684
+ let isDeferred = !!UNSTABLE_deferUntilEntered && (!isOpen || entering);
28685
+ let { modalProps: modalProps, underlayProps: underlayProps } = ($5698867baeb53f4e$export$dbc0f175b25fb0fb)({
28686
+ ...props,
28687
+ isEntering: isDeferred
28688
+ }, state, modalRef);
28689
+ // Pass the entering state to the dialog so it waits to move focus until the modal has entered.
28690
+ let dialogContext = (useContext)(($f2ff30fde7b014be$export$8b93a07348a7730c));
28691
+ let mergedDialogContext = UNSTABLE_deferUntilEntered ? $8b8d26808cb8cb53$var$mergeDialogContext(dialogContext, {
28692
+ isEntering: isDeferred
28693
+ }) : dialogContext;
28436
28694
  let renderProps = ($7230ffa83bc0c2cf$export$4d86445c2cf5e3)({
28437
28695
  ...props,
28438
28696
  defaultClassName: 'react-aria-ModalOverlay',
@@ -28460,6 +28718,8 @@ function $8b8d26808cb8cb53$var$ModalOverlayInner({ UNSTABLE_portalContainer: UNS
28460
28718
  '--page-width': pageWidth !== undefined ? pageWidth + 'px' : undefined,
28461
28719
  '--page-height': pageHeight !== undefined ? pageHeight + 'px' : undefined
28462
28720
  };
28721
+ // Since an auto-focused input may open the OSK, we defer the reveal, as a courtesy, to avoid layout shift.
28722
+ ($c4867b2f328c2698$export$e5c5a5f917a5871c)(()=>($e0a0e4399f316b76$export$b80f73f72d03c10f)(()=>setIsOpen(true)), []);
28463
28723
  // oxlint-disable react/react-compiler
28464
28724
  return /*#__PURE__*/ ($8WNJc$react).createElement(($d7a937236970dc7f$export$c6fdb837b070b4ff), {
28465
28725
  isExiting: props.isExiting,
@@ -28476,31 +28736,54 @@ function $8b8d26808cb8cb53$var$ModalOverlayInner({ UNSTABLE_portalContainer: UNS
28476
28736
  }, /*#__PURE__*/ ($8WNJc$react).createElement(($7230ffa83bc0c2cf$export$2881499e37b75b9a), {
28477
28737
  values: [
28478
28738
  [
28479
- $8b8d26808cb8cb53$var$InternalModalContext,
28739
+ $8b8d26808cb8cb53$export$6bc057cefccad9c8,
28480
28740
  {
28481
28741
  modalProps: modalProps,
28482
28742
  modalRef: modalRef,
28483
28743
  isExiting: props.isExiting,
28744
+ onExitRef: props.onExitRef,
28745
+ isOpen: isOpen,
28484
28746
  isDismissable: props.isDismissable
28485
28747
  }
28486
28748
  ],
28487
28749
  [
28488
28750
  ($f2ff30fde7b014be$export$d2f961adcb0afbe),
28489
28751
  state
28752
+ ],
28753
+ [
28754
+ ($f2ff30fde7b014be$export$8b93a07348a7730c),
28755
+ mergedDialogContext
28490
28756
  ]
28491
28757
  ]
28492
28758
  }, renderProps.children)));
28493
28759
  // oxlint-enable react/react-compiler
28494
28760
  }
28761
+ function $8b8d26808cb8cb53$var$mergeDialogContext(context, props) {
28762
+ if (context && 'slots' in context && context.slots) {
28763
+ let slots = {};
28764
+ for(let key in context.slots)slots[key] = {
28765
+ ...context.slots[key],
28766
+ ...props
28767
+ };
28768
+ return {
28769
+ ...context,
28770
+ slots: slots
28771
+ };
28772
+ }
28773
+ return {
28774
+ ...context,
28775
+ ...props
28776
+ };
28777
+ }
28495
28778
  function $8b8d26808cb8cb53$var$ModalContent(props) {
28496
- let { modalProps: modalProps, modalRef: modalRef, isExiting: isExiting, isDismissable: isDismissable } = (useContext)($8b8d26808cb8cb53$var$InternalModalContext);
28779
+ let { modalProps: modalProps, modalRef: modalRef, isExiting: isExiting, onExitRef: onExitRef, isDismissable: isDismissable, isOpen: isOpen } = (useContext)($8b8d26808cb8cb53$export$6bc057cefccad9c8);
28497
28780
  let state = (useContext)(($f2ff30fde7b014be$export$d2f961adcb0afbe));
28498
28781
  let mergedRefs = (useMemo)(()=>($4064df0d6f9620e1$export$c9058316764c140e)(props.modalRef, modalRef), [
28499
28782
  props.modalRef,
28500
28783
  modalRef
28501
28784
  ]);
28502
28785
  let ref = ($03e8ab2d84d7657a$export$4338b53315abf666)(mergedRefs);
28503
- let entering = ($fcc7165e876206c6$export$6d3443f2c48bfc20)(ref);
28786
+ let entering = ($fcc7165e876206c6$export$6d3443f2c48bfc20)(ref, isOpen, props.onEnter);
28504
28787
  let renderProps = ($7230ffa83bc0c2cf$export$4d86445c2cf5e3)({
28505
28788
  ...props,
28506
28789
  defaultClassName: 'react-aria-Modal',
@@ -28510,6 +28793,9 @@ function $8b8d26808cb8cb53$var$ModalContent(props) {
28510
28793
  state: state
28511
28794
  }
28512
28795
  });
28796
+ ($c4867b2f328c2698$export$e5c5a5f917a5871c)(()=>{
28797
+ if (onExitRef) onExitRef.current = props.onExit;
28798
+ });
28513
28799
  return /*#__PURE__*/ ($8WNJc$react).createElement(($7230ffa83bc0c2cf$export$df3a06d6289f983e).div, {
28514
28800
  ...($bbaa08b3cd72f041$export$9d1611c77c2fe928)(($8e9d2fae0ecb9001$export$457c3d6518dd4c6f)(props, {
28515
28801
  global: true
@@ -29341,6 +29627,7 @@ function $b046d185a4525d56$export$f809e80f58e251d1(props, state, triggerRef) {
29341
29627
  focus: ()=>triggerRef.current?.focus()
29342
29628
  }, state, props.selectRef);
29343
29629
  let setValue = state.setValue;
29630
+ // Used for both onChange and onInput, so accept the common supertype of both event types.
29344
29631
  let onChange = (useCallback)((e)=>{
29345
29632
  let eventTarget = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
29346
29633
  if (eventTarget.multiple) setValue(Array.from(eventTarget.selectedOptions, (option)=>option.value));