@eightshift/ui-components 1.3.2 → 1.4.0

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 (110) hide show
  1. package/dist/{Button-DTARR6Ff.js → Button-uYE9D_E3.js} +6 -5
  2. package/dist/{ColorSwatch-5bZ_yIMB.js → ColorSwatch-Bev-9Vbr.js} +4 -4
  3. package/dist/{Dialog-DJgS0mAg.js → Dialog-CGE2ficT.js} +17 -15
  4. package/dist/{FieldError-CviphIN5.js → FieldError-CBPJ4Xx8.js} +2 -2
  5. package/dist/{FocusScope-BjM5iOQC.js → FocusScope-CVd6C65L.js} +24 -8
  6. package/dist/{GridList-DjRnMEae.js → GridList-PBJsm70G.js} +156 -116
  7. package/dist/{Group-BQu67pVS.js → Group-WZgNv9RE.js} +3 -3
  8. package/dist/Hidden-YSmyVF_5.js +45 -0
  9. package/dist/{Input-DWRQF0ro.js → Input-CaS4qmLb.js} +10 -9
  10. package/dist/{Label-BXvY41yE.js → Label-yZgqvhXc.js} +3 -2
  11. package/dist/ListBox-MZyPpwvj.js +567 -0
  12. package/dist/{Select-49a62830.esm-BnlXlUnT.js → Select-49a62830.esm-CqLHaIei.js} +1 -1
  13. package/dist/{SelectionManager-JxXmb3-k.js → SelectionManager-CvRaua4m.js} +1580 -1484
  14. package/dist/{Separator-CX64zwq8.js → Separator-C7Few7L6.js} +80 -62
  15. package/dist/{Slider-Clme2C36.js → Slider-D8a63VhT.js} +14 -12
  16. package/dist/{Text-qjognpzK.js → Text-D8qh3_U7.js} +1 -1
  17. package/dist/{VisuallyHidden-BZPezMV5.js → VisuallyHidden-DD480kAb.js} +2 -2
  18. package/dist/_commonjsHelpers-CUmg6egw.js +6 -0
  19. package/dist/{ariaHideOutside-BZ5z6iCD.js → ariaHideOutside-BzxkODNq.js} +1 -9
  20. package/dist/assets/style.css +1 -1
  21. package/dist/assets/wp-ui-enhancements.css +1 -1
  22. package/dist/components/animated-visibility/animated-visibility.js +311 -198
  23. package/dist/components/base-control/base-control.js +1 -1
  24. package/dist/components/button/button.js +274 -9
  25. package/dist/components/checkbox/checkbox.js +171 -1
  26. package/dist/components/color-pickers/color-picker.js +1 -1
  27. package/dist/components/color-pickers/color-swatch.js +3 -3
  28. package/dist/components/color-pickers/gradient-editor.js +3 -3
  29. package/dist/components/color-pickers/solid-color-picker.js +46 -32
  30. package/dist/components/component-toggle/component-toggle.js +2 -2
  31. package/dist/components/container-panel/container-panel.js +2 -2
  32. package/dist/components/draggable-list/draggable-list-item.js +3 -3
  33. package/dist/components/draggable-list/draggable-list.js +3671 -6
  34. package/dist/components/expandable/expandable.js +7 -4
  35. package/dist/components/index.js +4 -4
  36. package/dist/components/input-field/input-field.js +7 -7
  37. package/dist/components/link-input/link-input.js +1519 -489
  38. package/dist/components/list-box/list-box.js +2 -2
  39. package/dist/components/matrix-align/matrix-align.js +3 -3
  40. package/dist/components/menu/menu.js +164 -466
  41. package/dist/components/modal/modal.js +7 -7
  42. package/dist/components/number-picker/number-picker.js +22 -17
  43. package/dist/components/option-select/option-select.js +2 -2
  44. package/dist/components/placeholders/file-placeholder.js +1 -1
  45. package/dist/components/popover/popover.js +3 -3
  46. package/dist/components/radio/radio.js +13 -13
  47. package/dist/components/repeater/repeater-context.js +5 -0
  48. package/dist/components/repeater/repeater-item.js +46 -91
  49. package/dist/components/repeater/repeater.js +5130 -175
  50. package/dist/components/responsive/responsive-legacy.js +3 -3
  51. package/dist/components/responsive/responsive.js +3 -3
  52. package/dist/components/responsive-preview/responsive-preview.js +1 -1
  53. package/dist/components/select/async-multi-select.js +3 -3
  54. package/dist/components/select/async-single-select.js +2 -2
  55. package/dist/components/select/custom-select-default-components.js +1 -1
  56. package/dist/components/select/multi-select-components.js +1 -1
  57. package/dist/components/select/multi-select.js +5 -5
  58. package/dist/components/select/react-select-component-wrappers.js +1 -1
  59. package/dist/components/select/single-select.js +2 -2
  60. package/dist/components/select/styles.js +1 -1
  61. package/dist/components/slider/column-config-slider.js +3 -3
  62. package/dist/components/slider/slider.js +3 -3
  63. package/dist/components/slider/utils.js +1 -1
  64. package/dist/components/tabs/tabs.js +46 -71
  65. package/dist/components/toggle/switch.js +6 -6
  66. package/dist/components/toggle/toggle.js +1 -1
  67. package/dist/components/toggle-button/toggle-button.js +7 -7
  68. package/dist/components/tooltip/tooltip.js +3 -3
  69. package/dist/{context-BG_1RnbC.js → context-Bon2Gyx5.js} +1 -1
  70. package/dist/{default-i18n-BqwLkgZv.js → default-i18n-BqWys-1G.js} +1 -1
  71. package/dist/{focusSafely-DGZ4R5fj.js → focusSafely-PMGZgZ9-.js} +33 -26
  72. package/dist/getScrollParent-B3XgpXBL.js +10 -0
  73. package/dist/icons/icons.js +205 -0
  74. package/dist/icons/jsx-svg.js +2 -2
  75. package/dist/{index-CAPcSs9K.js → index-BTCzc3zb.js} +1 -1
  76. package/dist/{index-a301f526.esm-ByOfDxiG.js → index-a301f526.esm-B9tWL9yi.js} +80 -603
  77. package/dist/index.js +4 -4
  78. package/dist/{intlStrings-CkuKCPkT.js → intlStrings-KQxgp5tS.js} +14 -9
  79. package/dist/{multi-select-components-7vKCF8dG.js → multi-select-components-DTvEidE3.js} +1 -1
  80. package/dist/react-jsx-parser.min-CAGfntg1.js +13425 -0
  81. package/dist/{react-select-async.esm-5zW9Dv9E.js → react-select-async.esm-8Rba_3KV.js} +3 -3
  82. package/dist/{react-select.esm-Bi6uzjbT.js → react-select.esm-DkSeQzOP.js} +3 -3
  83. package/dist/{textSelection-BLyBtNe2.js → textSelection-DS7-670U.js} +1 -1
  84. package/dist/{tooltip-DSk8I1SO.js → tooltip-C9mg1CP5.js} +54 -18
  85. package/dist/{useButton-EJ9c8fmq.js → useButton-BPY4yXUo.js} +3 -3
  86. package/dist/{useEvent-Cxq_BzP_.js → useEvent-DDLT851Z.js} +1 -1
  87. package/dist/{useFocusRing-Dg5Y_10S.js → useFocusRing-DsxEaA2J.js} +1 -1
  88. package/dist/{useFocusable-CQZyQp4q.js → useFocusable-BFKHuYS9.js} +2 -2
  89. package/dist/{useFormReset-DJMtIgSL.js → useFormReset-BCPbwfnH.js} +1 -1
  90. package/dist/{useFormValidationState-DDC_nImg.js → useFormValidationState-DC5jbhBW.js} +2 -2
  91. package/dist/{useHasTabbableChild-M3O3VIil.js → useHasTabbableChild-Byd7ylXD.js} +2 -2
  92. package/dist/{useLabel-6NqYraET.js → useLabel-DuJhImKc.js} +2 -2
  93. package/dist/{useLabels-D2RG7TdI.js → useLabels-JaBafrnV.js} +1 -1
  94. package/dist/{useListData-BpYQj7kK.js → useListData-B5Pk32vd.js} +6 -3
  95. package/dist/{useListState-IllYYnXV.js → useListState-Csx05BmT.js} +6 -3
  96. package/dist/{useLocalizedStringFormatter-Cwm_siat.js → useLocalizedStringFormatter-CVIIVTgz.js} +1 -1
  97. package/dist/useMenuTrigger-CMgzyMKW.js +246 -0
  98. package/dist/{useNumberFieldState-CVJOJnF1.js → useNumberFieldState-BVFqhboT.js} +12 -11
  99. package/dist/{useNumberFormatter-DVZRQXk3.js → useNumberFormatter-BEeBSV-N.js} +1 -1
  100. package/dist/{usePress-CiXj8dLE.js → usePress-CY8MpqYD.js} +58 -16
  101. package/dist/useSingleSelectListState-CzZUgAt0.js +37 -0
  102. package/dist/{useToggle-CV-IX6nL.js → useToggle-CJp2Fh_L.js} +4 -4
  103. package/dist/{useToggleState-DHIdITtQ.js → useToggleState-B4--Ski0.js} +1 -1
  104. package/dist/{utils-DC-UMp1n.js → utils-B4IdLYb8.js} +48 -85
  105. package/package.json +24 -21
  106. package/dist/Checkbox-CiJIVbAP.js +0 -174
  107. package/dist/ListBox-DTKMdjQC.js +0 -4216
  108. package/dist/_commonjsHelpers-DWwsNxpa.js +0 -8
  109. package/dist/button-IxfzzzbP.js +0 -277
  110. package/dist/react-jsx-parser.min-DhrYeqLL.js +0 -4563
@@ -1,1575 +1,1670 @@
1
- import React__default, { useState, useRef, useEffect, useMemo, forwardRef, useCallback, useContext, cloneElement, createContext } from "react";
2
- import { r as reactDomExports } from "./index-CAPcSs9K.js";
3
- import { a as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "./FocusScope-BjM5iOQC.js";
4
- import { v as $c87311424ea30a05$export$e1865c3bedcd822b, o as $c87311424ea30a05$export$9ac100e40613ea10, h as $6a99195332edec8b$export$80f3e147d781571c, t as $507fabe10e71c6fb$export$630ff653c5ada6a9, m as $7215afc6de606d6b$export$de79e2c695e052f3, e as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "./focusSafely-DGZ4R5fj.js";
5
- import { g as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, d as $3ef42575df84b30b$export$9d1611c77c2fe928, o as $b5e257d569688ac6$export$535bd6ca7f90a273 } from "./utils-DC-UMp1n.js";
6
- import { $ as $f6c31cce2adf654f$export$45712eceda6fad21, b as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, c as $ea8dcbcb9ea1b556$export$95185d699e05d4d7 } from "./usePress-CiXj8dLE.js";
7
- import { $ as $e9faafb641e167db$export$90fc3a17d93f704c } from "./useEvent-Cxq_BzP_.js";
1
+ import React__default, { useMemo, cloneElement, useState, forwardRef, useContext, createContext, useRef, useCallback, useEffect } from "react";
2
+ import { a as $f39a9eba43920ace$export$8dc98ba7eadeaa56 } from "./Hidden-YSmyVF_5.js";
3
+ import { r as reactDomExports } from "./index-BTCzc3zb.js";
4
+ import { g as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, d as $b5e257d569688ac6$export$535bd6ca7f90a273, c as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-B4IdLYb8.js";
5
+ import { a as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "./FocusScope-CVd6C65L.js";
6
+ import { w as $c87311424ea30a05$export$e1865c3bedcd822b, n as $c87311424ea30a05$export$9ac100e40613ea10, h as $6a99195332edec8b$export$80f3e147d781571c, u as $507fabe10e71c6fb$export$630ff653c5ada6a9, m as $7215afc6de606d6b$export$de79e2c695e052f3, e as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "./focusSafely-PMGZgZ9-.js";
7
+ import { $ as $f6c31cce2adf654f$export$45712eceda6fad21, b as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, c as $ea8dcbcb9ea1b556$export$95185d699e05d4d7 } from "./usePress-CY8MpqYD.js";
8
+ import { $ as $e9faafb641e167db$export$90fc3a17d93f704c } from "./useEvent-DDLT851Z.js";
8
9
  import { $ as $cc38e7bd3fc7b213$export$2bb74740c4e19def } from "./isScrollable-Dh9D9IOd.js";
9
- import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-BG_1RnbC.js";
10
- import { $ as $03deb23ff14920c4$export$4eaf04e54aa8eed6 } from "./textSelection-BLyBtNe2.js";
11
- function $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(node, checkForOverflow) {
12
- const scrollParents = [];
13
- while (node && node !== document.documentElement) {
14
- if ($cc38e7bd3fc7b213$export$2bb74740c4e19def(node, checkForOverflow)) scrollParents.push(node);
15
- node = node.parentElement;
10
+ import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-Bon2Gyx5.js";
11
+ import { $ as $03deb23ff14920c4$export$4eaf04e54aa8eed6 } from "./textSelection-DS7-670U.js";
12
+ class $23b9f4fcf0fe224b$export$d68d59712b04d9d1 {
13
+ get childNodes() {
14
+ throw new Error("childNodes is not supported");
16
15
  }
17
- return scrollParents;
18
- }
19
- let $ef06256079686ba0$var$descriptionId = 0;
20
- const $ef06256079686ba0$var$descriptionNodes = /* @__PURE__ */ new Map();
21
- function $ef06256079686ba0$export$f8aeda7b10753fa1(description) {
22
- let [id, setId] = useState();
23
- $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
24
- if (!description) return;
25
- let desc = $ef06256079686ba0$var$descriptionNodes.get(description);
26
- if (!desc) {
27
- let id2 = `react-aria-description-${$ef06256079686ba0$var$descriptionId++}`;
28
- setId(id2);
29
- let node = document.createElement("div");
30
- node.id = id2;
31
- node.style.display = "none";
32
- node.textContent = description;
33
- document.body.appendChild(node);
34
- desc = {
35
- refCount: 0,
36
- element: node
37
- };
38
- $ef06256079686ba0$var$descriptionNodes.set(description, desc);
39
- } else setId(desc.element.id);
40
- desc.refCount++;
41
- return () => {
42
- if (desc && --desc.refCount === 0) {
43
- desc.element.remove();
44
- $ef06256079686ba0$var$descriptionNodes.delete(description);
45
- }
46
- };
47
- }, [
48
- description
49
- ]);
50
- return {
51
- "aria-describedby": description ? id : void 0
52
- };
53
- }
54
- function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
55
- let offsetX = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, "left");
56
- let offsetY = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, "top");
57
- let width = element.offsetWidth;
58
- let height = element.offsetHeight;
59
- let x = scrollView.scrollLeft;
60
- let y = scrollView.scrollTop;
61
- let { borderTopWidth, borderLeftWidth } = getComputedStyle(scrollView);
62
- let borderAdjustedX = scrollView.scrollLeft + parseInt(borderLeftWidth, 10);
63
- let borderAdjustedY = scrollView.scrollTop + parseInt(borderTopWidth, 10);
64
- let maxX = borderAdjustedX + scrollView.clientWidth;
65
- let maxY = borderAdjustedY + scrollView.clientHeight;
66
- if (offsetX <= x) x = offsetX - parseInt(borderLeftWidth, 10);
67
- else if (offsetX + width > maxX) x += offsetX + width - maxX;
68
- if (offsetY <= borderAdjustedY) y = offsetY - parseInt(borderTopWidth, 10);
69
- else if (offsetY + height > maxY) y += offsetY + height - maxY;
70
- scrollView.scrollLeft = x;
71
- scrollView.scrollTop = y;
72
- }
73
- function $2f04cbc44ee30ce0$var$relativeOffset(ancestor, child, axis) {
74
- const prop = axis === "left" ? "offsetLeft" : "offsetTop";
75
- let sum = 0;
76
- while (child.offsetParent) {
77
- sum += child[prop];
78
- if (child.offsetParent === ancestor) break;
79
- else if (child.offsetParent.contains(ancestor)) {
80
- sum -= ancestor[prop];
81
- break;
82
- }
83
- child = child.offsetParent;
16
+ clone() {
17
+ let node = new $23b9f4fcf0fe224b$export$d68d59712b04d9d1(this.type, this.key);
18
+ node.value = this.value;
19
+ node.level = this.level;
20
+ node.hasChildNodes = this.hasChildNodes;
21
+ node.rendered = this.rendered;
22
+ node.textValue = this.textValue;
23
+ node["aria-label"] = this["aria-label"];
24
+ node.index = this.index;
25
+ node.parentKey = this.parentKey;
26
+ node.prevKey = this.prevKey;
27
+ node.nextKey = this.nextKey;
28
+ node.firstChildKey = this.firstChildKey;
29
+ node.lastChildKey = this.lastChildKey;
30
+ node.props = this.props;
31
+ node.render = this.render;
32
+ return node;
33
+ }
34
+ constructor(type, key) {
35
+ this.value = null;
36
+ this.level = 0;
37
+ this.hasChildNodes = false;
38
+ this.rendered = null;
39
+ this.textValue = "";
40
+ this["aria-label"] = void 0;
41
+ this.index = 0;
42
+ this.parentKey = null;
43
+ this.prevKey = null;
44
+ this.nextKey = null;
45
+ this.firstChildKey = null;
46
+ this.lastChildKey = null;
47
+ this.props = {};
48
+ this.type = type;
49
+ this.key = key;
84
50
  }
85
- return sum;
86
51
  }
87
- function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
88
- if (document.contains(targetElement)) {
89
- let root = document.scrollingElement || document.documentElement;
90
- let isScrollPrevented = window.getComputedStyle(root).overflow === "hidden";
91
- if (!isScrollPrevented) {
92
- var _targetElement_scrollIntoView;
93
- let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
94
- targetElement === null || targetElement === void 0 ? void 0 : (_targetElement_scrollIntoView = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView === void 0 ? void 0 : _targetElement_scrollIntoView.call(targetElement, {
95
- block: "nearest"
96
- });
97
- let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
98
- if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
99
- var _opts_containingElement_scrollIntoView, _opts_containingElement, _targetElement_scrollIntoView1;
100
- opts === null || opts === void 0 ? void 0 : (_opts_containingElement = opts.containingElement) === null || _opts_containingElement === void 0 ? void 0 : (_opts_containingElement_scrollIntoView = _opts_containingElement.scrollIntoView) === null || _opts_containingElement_scrollIntoView === void 0 ? void 0 : _opts_containingElement_scrollIntoView.call(_opts_containingElement, {
101
- block: "center",
102
- inline: "center"
103
- });
104
- (_targetElement_scrollIntoView1 = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView1 === void 0 ? void 0 : _targetElement_scrollIntoView1.call(targetElement, {
105
- block: "nearest"
106
- });
107
- }
108
- } else {
109
- let scrollParents = $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(targetElement);
110
- for (let scrollParent of scrollParents) $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollParent, targetElement);
52
+ class $23b9f4fcf0fe224b$export$408d25a4e12db025 {
53
+ get size() {
54
+ return this.keyMap.size;
55
+ }
56
+ getKeys() {
57
+ return this.keyMap.keys();
58
+ }
59
+ *[Symbol.iterator]() {
60
+ let node = this.firstKey != null ? this.keyMap.get(this.firstKey) : void 0;
61
+ while (node) {
62
+ yield node;
63
+ node = node.nextKey != null ? this.keyMap.get(node.nextKey) : void 0;
111
64
  }
112
65
  }
113
- }
114
- const $8a26561d2877236e$var$DEFAULT_THRESHOLD = 500;
115
- function $8a26561d2877236e$export$c24ed0104d07eab9(props) {
116
- let { isDisabled, onLongPressStart, onLongPressEnd, onLongPress, threshold = $8a26561d2877236e$var$DEFAULT_THRESHOLD, accessibilityDescription } = props;
117
- const timeRef = useRef();
118
- let { addGlobalListener, removeGlobalListener } = $03deb23ff14920c4$export$4eaf04e54aa8eed6();
119
- let { pressProps } = $f6c31cce2adf654f$export$45712eceda6fad21({
120
- isDisabled,
121
- onPressStart(e) {
122
- e.continuePropagation();
123
- if (e.pointerType === "mouse" || e.pointerType === "touch") {
124
- if (onLongPressStart) onLongPressStart({
125
- ...e,
126
- type: "longpressstart"
127
- });
128
- timeRef.current = setTimeout(() => {
129
- e.target.dispatchEvent(new PointerEvent("pointercancel", {
130
- bubbles: true
131
- }));
132
- if (onLongPress) onLongPress({
133
- ...e,
134
- type: "longpress"
135
- });
136
- timeRef.current = void 0;
137
- }, threshold);
138
- if (e.pointerType === "touch") {
139
- let onContextMenu = (e2) => {
140
- e2.preventDefault();
141
- };
142
- addGlobalListener(e.target, "contextmenu", onContextMenu, {
143
- once: true
144
- });
145
- addGlobalListener(window, "pointerup", () => {
146
- setTimeout(() => {
147
- removeGlobalListener(e.target, "contextmenu", onContextMenu);
148
- }, 30);
149
- }, {
150
- once: true
151
- });
66
+ getChildren(key) {
67
+ let keyMap = this.keyMap;
68
+ return {
69
+ *[Symbol.iterator]() {
70
+ let parent = keyMap.get(key);
71
+ let node = (parent === null || parent === void 0 ? void 0 : parent.firstChildKey) != null ? keyMap.get(parent.firstChildKey) : null;
72
+ while (node) {
73
+ yield node;
74
+ node = node.nextKey != null ? keyMap.get(node.nextKey) : void 0;
152
75
  }
153
76
  }
154
- },
155
- onPressEnd(e) {
156
- if (timeRef.current) clearTimeout(timeRef.current);
157
- if (onLongPressEnd && (e.pointerType === "mouse" || e.pointerType === "touch")) onLongPressEnd({
158
- ...e,
159
- type: "longpressend"
160
- });
161
- }
162
- });
163
- let descriptionProps = $ef06256079686ba0$export$f8aeda7b10753fa1(onLongPress && !isDisabled ? accessibilityDescription : void 0);
164
- return {
165
- longPressProps: $3ef42575df84b30b$export$9d1611c77c2fe928(pressProps, descriptionProps)
166
- };
167
- }
168
- function $feb5ffebff200149$export$d3e3bd3e26688c04(e) {
169
- return $c87311424ea30a05$export$e1865c3bedcd822b() ? e.altKey : e.ctrlKey;
170
- }
171
- function $feb5ffebff200149$export$16792effe837dba3(e) {
172
- if ($c87311424ea30a05$export$9ac100e40613ea10()) return e.metaKey;
173
- return e.ctrlKey;
174
- }
175
- const $fb3050f43d946246$var$TYPEAHEAD_DEBOUNCE_WAIT_MS = 1e3;
176
- function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
177
- let { keyboardDelegate, selectionManager, onTypeSelect } = options;
178
- let state = useRef({
179
- search: "",
180
- timeout: null
181
- }).current;
182
- let onKeyDown = (e) => {
183
- let character = $fb3050f43d946246$var$getStringForKey(e.key);
184
- if (!character || e.ctrlKey || e.metaKey || !e.currentTarget.contains(e.target)) return;
185
- if (character === " " && state.search.trim().length > 0) {
186
- e.preventDefault();
187
- if (!("continuePropagation" in e)) e.stopPropagation();
77
+ };
78
+ }
79
+ getKeyBefore(key) {
80
+ let node = this.keyMap.get(key);
81
+ if (!node) return null;
82
+ if (node.prevKey != null) {
83
+ node = this.keyMap.get(node.prevKey);
84
+ while (node && node.type !== "item" && node.lastChildKey != null) node = this.keyMap.get(node.lastChildKey);
85
+ var _node_key;
86
+ return (_node_key = node === null || node === void 0 ? void 0 : node.key) !== null && _node_key !== void 0 ? _node_key : null;
188
87
  }
189
- state.search += character;
190
- let key = keyboardDelegate.getKeyForSearch(state.search, selectionManager.focusedKey);
191
- if (key == null) key = keyboardDelegate.getKeyForSearch(state.search);
192
- if (key != null) {
193
- selectionManager.setFocusedKey(key);
194
- if (onTypeSelect) onTypeSelect(key);
88
+ return node.parentKey;
89
+ }
90
+ getKeyAfter(key) {
91
+ let node = this.keyMap.get(key);
92
+ if (!node) return null;
93
+ if (node.type !== "item" && node.firstChildKey != null) return node.firstChildKey;
94
+ while (node) {
95
+ if (node.nextKey != null) return node.nextKey;
96
+ if (node.parentKey != null) node = this.keyMap.get(node.parentKey);
97
+ else return null;
195
98
  }
196
- clearTimeout(state.timeout);
197
- state.timeout = setTimeout(() => {
198
- state.search = "";
199
- }, $fb3050f43d946246$var$TYPEAHEAD_DEBOUNCE_WAIT_MS);
200
- };
201
- return {
202
- typeSelectProps: {
203
- // Using a capturing listener to catch the keydown event before
204
- // other hooks in order to handle the Spacebar event.
205
- onKeyDownCapture: keyboardDelegate.getKeyForSearch ? onKeyDown : null
206
- }
207
- };
208
- }
209
- function $fb3050f43d946246$var$getStringForKey(key) {
210
- if (key.length === 1 || !/^[A-Z]/i.test(key)) return key;
211
- return "";
99
+ return null;
100
+ }
101
+ getFirstKey() {
102
+ return this.firstKey;
103
+ }
104
+ getLastKey() {
105
+ let node = this.lastKey != null ? this.keyMap.get(this.lastKey) : null;
106
+ while ((node === null || node === void 0 ? void 0 : node.lastChildKey) != null) node = this.keyMap.get(node.lastChildKey);
107
+ var _node_key;
108
+ return (_node_key = node === null || node === void 0 ? void 0 : node.key) !== null && _node_key !== void 0 ? _node_key : null;
109
+ }
110
+ getItem(key) {
111
+ var _this_keyMap_get;
112
+ return (_this_keyMap_get = this.keyMap.get(key)) !== null && _this_keyMap_get !== void 0 ? _this_keyMap_get : null;
113
+ }
114
+ at() {
115
+ throw new Error("Not implemented");
116
+ }
117
+ clone() {
118
+ let Constructor = this.constructor;
119
+ let collection = new Constructor();
120
+ collection.keyMap = new Map(this.keyMap);
121
+ collection.firstKey = this.firstKey;
122
+ collection.lastKey = this.lastKey;
123
+ return collection;
124
+ }
125
+ addNode(node) {
126
+ if (this.frozen) throw new Error("Cannot add a node to a frozen collection");
127
+ this.keyMap.set(node.key, node);
128
+ }
129
+ removeNode(key) {
130
+ if (this.frozen) throw new Error("Cannot remove a node to a frozen collection");
131
+ this.keyMap.delete(key);
132
+ }
133
+ commit(firstKey, lastKey, isSSR = false) {
134
+ if (this.frozen) throw new Error("Cannot commit a frozen collection");
135
+ this.firstKey = firstKey;
136
+ this.lastKey = lastKey;
137
+ this.frozen = !isSSR;
138
+ }
139
+ constructor() {
140
+ this.keyMap = /* @__PURE__ */ new Map();
141
+ this.firstKey = null;
142
+ this.lastKey = null;
143
+ this.frozen = false;
144
+ }
212
145
  }
213
- function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
214
- let { selectionManager: manager, keyboardDelegate: delegate, ref, autoFocus = false, shouldFocusWrap = false, disallowEmptySelection = false, disallowSelectAll = false, selectOnFocus = manager.selectionBehavior === "replace", disallowTypeAhead = false, shouldUseVirtualFocus, allowsTabNavigation = false, isVirtualized, scrollRef = ref, linkBehavior = "action" } = options;
215
- let { direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
216
- let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
217
- let onKeyDown = (e) => {
218
- if (e.altKey && e.key === "Tab") e.preventDefault();
219
- if (!ref.current.contains(e.target)) return;
220
- const navigateToKey = (key, childFocus) => {
221
- if (key != null) {
222
- if (manager.isLink(key) && linkBehavior === "selection" && selectOnFocus && !$feb5ffebff200149$export$d3e3bd3e26688c04(e)) {
223
- reactDomExports.flushSync(() => {
224
- manager.setFocusedKey(key, childFocus);
225
- });
226
- let item = scrollRef.current.querySelector(`[data-key="${CSS.escape(key.toString())}"]`);
227
- let itemProps = manager.getItemProps(key);
228
- router.open(item, e, itemProps.href, itemProps.routerOptions);
229
- return;
230
- }
231
- manager.setFocusedKey(key, childFocus);
232
- if (manager.isLink(key) && linkBehavior === "override") return;
233
- if (e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(key);
234
- else if (selectOnFocus && !$feb5ffebff200149$export$d3e3bd3e26688c04(e)) manager.replaceSelection(key);
235
- }
236
- };
237
- switch (e.key) {
238
- case "ArrowDown":
239
- if (delegate.getKeyBelow) {
240
- var _delegate_getFirstKey, _delegate_getFirstKey1;
241
- e.preventDefault();
242
- let nextKey = manager.focusedKey != null ? delegate.getKeyBelow(manager.focusedKey) : (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate);
243
- if (nextKey == null && shouldFocusWrap) nextKey = (_delegate_getFirstKey1 = delegate.getFirstKey) === null || _delegate_getFirstKey1 === void 0 ? void 0 : _delegate_getFirstKey1.call(delegate, manager.focusedKey);
244
- navigateToKey(nextKey);
245
- }
246
- break;
247
- case "ArrowUp":
248
- if (delegate.getKeyAbove) {
249
- var _delegate_getLastKey, _delegate_getLastKey1;
250
- e.preventDefault();
251
- let nextKey = manager.focusedKey != null ? delegate.getKeyAbove(manager.focusedKey) : (_delegate_getLastKey = delegate.getLastKey) === null || _delegate_getLastKey === void 0 ? void 0 : _delegate_getLastKey.call(delegate);
252
- if (nextKey == null && shouldFocusWrap) nextKey = (_delegate_getLastKey1 = delegate.getLastKey) === null || _delegate_getLastKey1 === void 0 ? void 0 : _delegate_getLastKey1.call(delegate, manager.focusedKey);
253
- navigateToKey(nextKey);
254
- }
255
- break;
256
- case "ArrowLeft":
257
- if (delegate.getKeyLeftOf) {
258
- var _delegate_getFirstKey2, _delegate_getLastKey2;
259
- e.preventDefault();
260
- let nextKey = delegate.getKeyLeftOf(manager.focusedKey);
261
- if (nextKey == null && shouldFocusWrap) nextKey = direction === "rtl" ? (_delegate_getFirstKey2 = delegate.getFirstKey) === null || _delegate_getFirstKey2 === void 0 ? void 0 : _delegate_getFirstKey2.call(delegate, manager.focusedKey) : (_delegate_getLastKey2 = delegate.getLastKey) === null || _delegate_getLastKey2 === void 0 ? void 0 : _delegate_getLastKey2.call(delegate, manager.focusedKey);
262
- navigateToKey(nextKey, direction === "rtl" ? "first" : "last");
263
- }
264
- break;
265
- case "ArrowRight":
266
- if (delegate.getKeyRightOf) {
267
- var _delegate_getLastKey3, _delegate_getFirstKey3;
268
- e.preventDefault();
269
- let nextKey = delegate.getKeyRightOf(manager.focusedKey);
270
- if (nextKey == null && shouldFocusWrap) nextKey = direction === "rtl" ? (_delegate_getLastKey3 = delegate.getLastKey) === null || _delegate_getLastKey3 === void 0 ? void 0 : _delegate_getLastKey3.call(delegate, manager.focusedKey) : (_delegate_getFirstKey3 = delegate.getFirstKey) === null || _delegate_getFirstKey3 === void 0 ? void 0 : _delegate_getFirstKey3.call(delegate, manager.focusedKey);
271
- navigateToKey(nextKey, direction === "rtl" ? "last" : "first");
272
- }
273
- break;
274
- case "Home":
275
- if (delegate.getFirstKey) {
276
- e.preventDefault();
277
- let firstKey = delegate.getFirstKey(manager.focusedKey, $feb5ffebff200149$export$16792effe837dba3(e));
278
- manager.setFocusedKey(firstKey);
279
- if ($feb5ffebff200149$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(firstKey);
280
- else if (selectOnFocus) manager.replaceSelection(firstKey);
281
- }
282
- break;
283
- case "End":
284
- if (delegate.getLastKey) {
285
- e.preventDefault();
286
- let lastKey = delegate.getLastKey(manager.focusedKey, $feb5ffebff200149$export$16792effe837dba3(e));
287
- manager.setFocusedKey(lastKey);
288
- if ($feb5ffebff200149$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(lastKey);
289
- else if (selectOnFocus) manager.replaceSelection(lastKey);
290
- }
291
- break;
292
- case "PageDown":
293
- if (delegate.getKeyPageBelow) {
294
- e.preventDefault();
295
- let nextKey = delegate.getKeyPageBelow(manager.focusedKey);
296
- navigateToKey(nextKey);
297
- }
298
- break;
299
- case "PageUp":
300
- if (delegate.getKeyPageAbove) {
301
- e.preventDefault();
302
- let nextKey = delegate.getKeyPageAbove(manager.focusedKey);
303
- navigateToKey(nextKey);
304
- }
305
- break;
306
- case "a":
307
- if ($feb5ffebff200149$export$16792effe837dba3(e) && manager.selectionMode === "multiple" && disallowSelectAll !== true) {
308
- e.preventDefault();
309
- manager.selectAll();
310
- }
311
- break;
312
- case "Escape":
313
- if (!disallowEmptySelection && manager.selectedKeys.size !== 0) {
314
- e.stopPropagation();
315
- e.preventDefault();
316
- manager.clearSelection();
317
- }
318
- break;
319
- case "Tab":
320
- if (!allowsTabNavigation) {
321
- if (e.shiftKey) ref.current.focus();
322
- else {
323
- let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(ref.current, {
324
- tabbable: true
325
- });
326
- let next;
327
- let last;
328
- do {
329
- last = walker.lastChild();
330
- if (last) next = last;
331
- } while (last);
332
- if (next && !next.contains(document.activeElement)) $7215afc6de606d6b$export$de79e2c695e052f3(next);
333
- }
334
- break;
335
- }
146
+ class $681cc3c98f569e39$export$410b0c854570d131 {
147
+ *[Symbol.iterator]() {
148
+ let node = this.firstChild;
149
+ while (node) {
150
+ yield node;
151
+ node = node.nextSibling;
336
152
  }
337
- };
338
- let scrollPos = useRef({
339
- top: 0,
340
- left: 0
341
- });
342
- $e9faafb641e167db$export$90fc3a17d93f704c(scrollRef, "scroll", isVirtualized ? null : () => {
343
- scrollPos.current = {
344
- top: scrollRef.current.scrollTop,
345
- left: scrollRef.current.scrollLeft
346
- };
347
- });
348
- let onFocus = (e) => {
349
- if (manager.isFocused) {
350
- if (!e.currentTarget.contains(e.target)) manager.setFocused(false);
351
- return;
153
+ }
154
+ get firstChild() {
155
+ return this._firstChild;
156
+ }
157
+ set firstChild(firstChild) {
158
+ this._firstChild = firstChild;
159
+ this.ownerDocument.markDirty(this);
160
+ }
161
+ get lastChild() {
162
+ return this._lastChild;
163
+ }
164
+ set lastChild(lastChild) {
165
+ this._lastChild = lastChild;
166
+ this.ownerDocument.markDirty(this);
167
+ }
168
+ get previousSibling() {
169
+ return this._previousSibling;
170
+ }
171
+ set previousSibling(previousSibling) {
172
+ this._previousSibling = previousSibling;
173
+ this.ownerDocument.markDirty(this);
174
+ }
175
+ get nextSibling() {
176
+ return this._nextSibling;
177
+ }
178
+ set nextSibling(nextSibling) {
179
+ this._nextSibling = nextSibling;
180
+ this.ownerDocument.markDirty(this);
181
+ }
182
+ get parentNode() {
183
+ return this._parentNode;
184
+ }
185
+ set parentNode(parentNode) {
186
+ this._parentNode = parentNode;
187
+ this.ownerDocument.markDirty(this);
188
+ }
189
+ get isConnected() {
190
+ var _this_parentNode;
191
+ return ((_this_parentNode = this.parentNode) === null || _this_parentNode === void 0 ? void 0 : _this_parentNode.isConnected) || false;
192
+ }
193
+ appendChild(child) {
194
+ this.ownerDocument.startTransaction();
195
+ if (child.parentNode) child.parentNode.removeChild(child);
196
+ if (this.firstChild == null) this.firstChild = child;
197
+ if (this.lastChild) {
198
+ this.lastChild.nextSibling = child;
199
+ child.index = this.lastChild.index + 1;
200
+ child.previousSibling = this.lastChild;
201
+ } else {
202
+ child.previousSibling = null;
203
+ child.index = 0;
352
204
  }
353
- if (!e.currentTarget.contains(e.target)) return;
354
- manager.setFocused(true);
355
- if (manager.focusedKey == null) {
356
- let navigateToFirstKey = (key) => {
357
- if (key != null) {
358
- manager.setFocusedKey(key);
359
- if (selectOnFocus) manager.replaceSelection(key);
360
- }
361
- };
362
- let relatedTarget = e.relatedTarget;
363
- var _manager_lastSelectedKey, _manager_firstSelectedKey;
364
- if (relatedTarget && e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING) navigateToFirstKey((_manager_lastSelectedKey = manager.lastSelectedKey) !== null && _manager_lastSelectedKey !== void 0 ? _manager_lastSelectedKey : delegate.getLastKey());
365
- else navigateToFirstKey((_manager_firstSelectedKey = manager.firstSelectedKey) !== null && _manager_firstSelectedKey !== void 0 ? _manager_firstSelectedKey : delegate.getFirstKey());
366
- } else if (!isVirtualized) {
367
- scrollRef.current.scrollTop = scrollPos.current.top;
368
- scrollRef.current.scrollLeft = scrollPos.current.left;
205
+ child.parentNode = this;
206
+ child.nextSibling = null;
207
+ this.lastChild = child;
208
+ this.ownerDocument.markDirty(this);
209
+ if (child.hasSetProps)
210
+ this.ownerDocument.addNode(child);
211
+ this.ownerDocument.endTransaction();
212
+ this.ownerDocument.queueUpdate();
213
+ }
214
+ insertBefore(newNode, referenceNode) {
215
+ if (referenceNode == null) return this.appendChild(newNode);
216
+ this.ownerDocument.startTransaction();
217
+ if (newNode.parentNode) newNode.parentNode.removeChild(newNode);
218
+ newNode.nextSibling = referenceNode;
219
+ newNode.previousSibling = referenceNode.previousSibling;
220
+ newNode.index = referenceNode.index;
221
+ if (this.firstChild === referenceNode) this.firstChild = newNode;
222
+ else if (referenceNode.previousSibling) referenceNode.previousSibling.nextSibling = newNode;
223
+ referenceNode.previousSibling = newNode;
224
+ newNode.parentNode = referenceNode.parentNode;
225
+ let node = referenceNode;
226
+ while (node) {
227
+ node.index++;
228
+ node = node.nextSibling;
369
229
  }
370
- if (!isVirtualized && manager.focusedKey != null) {
371
- let element = scrollRef.current.querySelector(`[data-key="${CSS.escape(manager.focusedKey.toString())}"]`);
372
- if (element) {
373
- if (!element.contains(document.activeElement)) $7215afc6de606d6b$export$de79e2c695e052f3(element);
374
- let modality = $507fabe10e71c6fb$export$630ff653c5ada6a9();
375
- if (modality === "keyboard") $2f04cbc44ee30ce0$export$c826860796309d1b(element, {
376
- containingElement: ref.current
377
- });
378
- }
230
+ if (newNode.hasSetProps) this.ownerDocument.addNode(newNode);
231
+ this.ownerDocument.endTransaction();
232
+ this.ownerDocument.queueUpdate();
233
+ }
234
+ removeChild(child) {
235
+ if (child.parentNode !== this || !this.ownerDocument.isMounted) return;
236
+ this.ownerDocument.startTransaction();
237
+ let node = child.nextSibling;
238
+ while (node) {
239
+ node.index--;
240
+ node = node.nextSibling;
379
241
  }
380
- };
381
- let onBlur = (e) => {
382
- if (!e.currentTarget.contains(e.relatedTarget)) manager.setFocused(false);
383
- };
384
- const autoFocusRef = useRef(autoFocus);
385
- useEffect(() => {
386
- if (autoFocusRef.current) {
387
- let focusedKey = null;
388
- if (autoFocus === "first") focusedKey = delegate.getFirstKey();
389
- if (autoFocus === "last") focusedKey = delegate.getLastKey();
390
- let selectedKeys = manager.selectedKeys;
391
- if (selectedKeys.size) {
392
- for (let key of selectedKeys) if (manager.canSelectItem(key)) {
393
- focusedKey = key;
394
- break;
395
- }
396
- }
397
- manager.setFocused(true);
398
- manager.setFocusedKey(focusedKey);
399
- if (focusedKey == null && !shouldUseVirtualFocus) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
242
+ if (child.nextSibling) child.nextSibling.previousSibling = child.previousSibling;
243
+ if (child.previousSibling) child.previousSibling.nextSibling = child.nextSibling;
244
+ if (this.firstChild === child) this.firstChild = child.nextSibling;
245
+ if (this.lastChild === child) this.lastChild = child.previousSibling;
246
+ child.parentNode = null;
247
+ child.nextSibling = null;
248
+ child.previousSibling = null;
249
+ child.index = 0;
250
+ this.ownerDocument.removeNode(child);
251
+ this.ownerDocument.endTransaction();
252
+ this.ownerDocument.queueUpdate();
253
+ }
254
+ addEventListener() {
255
+ }
256
+ removeEventListener() {
257
+ }
258
+ constructor(ownerDocument) {
259
+ this._firstChild = null;
260
+ this._lastChild = null;
261
+ this._previousSibling = null;
262
+ this._nextSibling = null;
263
+ this._parentNode = null;
264
+ this.ownerDocument = ownerDocument;
265
+ }
266
+ }
267
+ class $681cc3c98f569e39$export$dc064fe9e59310fd extends $681cc3c98f569e39$export$410b0c854570d131 {
268
+ get index() {
269
+ return this._index;
270
+ }
271
+ set index(index) {
272
+ this._index = index;
273
+ this.ownerDocument.markDirty(this);
274
+ }
275
+ get level() {
276
+ if (this.parentNode instanceof $681cc3c98f569e39$export$dc064fe9e59310fd) return this.parentNode.level + (this.node.type === "item" ? 1 : 0);
277
+ return 0;
278
+ }
279
+ updateNode() {
280
+ var _this_previousSibling, _this_nextSibling, _this_firstChild, _this_lastChild;
281
+ let node = this.ownerDocument.getMutableNode(this);
282
+ node.index = this.index;
283
+ node.level = this.level;
284
+ node.parentKey = this.parentNode instanceof $681cc3c98f569e39$export$dc064fe9e59310fd ? this.parentNode.node.key : null;
285
+ var _this_previousSibling_node_key;
286
+ node.prevKey = (_this_previousSibling_node_key = (_this_previousSibling = this.previousSibling) === null || _this_previousSibling === void 0 ? void 0 : _this_previousSibling.node.key) !== null && _this_previousSibling_node_key !== void 0 ? _this_previousSibling_node_key : null;
287
+ var _this_nextSibling_node_key;
288
+ node.nextKey = (_this_nextSibling_node_key = (_this_nextSibling = this.nextSibling) === null || _this_nextSibling === void 0 ? void 0 : _this_nextSibling.node.key) !== null && _this_nextSibling_node_key !== void 0 ? _this_nextSibling_node_key : null;
289
+ node.hasChildNodes = !!this.firstChild;
290
+ var _this_firstChild_node_key;
291
+ node.firstChildKey = (_this_firstChild_node_key = (_this_firstChild = this.firstChild) === null || _this_firstChild === void 0 ? void 0 : _this_firstChild.node.key) !== null && _this_firstChild_node_key !== void 0 ? _this_firstChild_node_key : null;
292
+ var _this_lastChild_node_key;
293
+ node.lastChildKey = (_this_lastChild_node_key = (_this_lastChild = this.lastChild) === null || _this_lastChild === void 0 ? void 0 : _this_lastChild.node.key) !== null && _this_lastChild_node_key !== void 0 ? _this_lastChild_node_key : null;
294
+ }
295
+ setProps(obj, ref, rendered, render) {
296
+ let node = this.ownerDocument.getMutableNode(this);
297
+ let { value, textValue, id, ...props } = obj;
298
+ props.ref = ref;
299
+ node.props = props;
300
+ node.rendered = rendered;
301
+ node.render = render;
302
+ node.value = value;
303
+ node.textValue = textValue || (typeof props.children === "string" ? props.children : "") || obj["aria-label"] || "";
304
+ if (id != null && id !== node.key) {
305
+ if (this.hasSetProps) throw new Error("Cannot change the id of an item");
306
+ node.key = id;
400
307
  }
401
- }, []);
402
- let lastFocusedKey = useRef(manager.focusedKey);
403
- useEffect(() => {
404
- let modality = $507fabe10e71c6fb$export$630ff653c5ada6a9();
405
- if (manager.isFocused && manager.focusedKey != null && (scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current)) {
406
- let element = scrollRef.current.querySelector(`[data-key="${CSS.escape(manager.focusedKey.toString())}"]`);
407
- if (element && (modality === "keyboard" || autoFocusRef.current)) {
408
- if (!isVirtualized) $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollRef.current, element);
409
- if (modality !== "virtual") $2f04cbc44ee30ce0$export$c826860796309d1b(element, {
410
- containingElement: ref.current
411
- });
412
- }
308
+ if (!this.hasSetProps) {
309
+ this.ownerDocument.addNode(this);
310
+ this.ownerDocument.endTransaction();
311
+ this.hasSetProps = true;
413
312
  }
414
- if (manager.isFocused && manager.focusedKey == null && lastFocusedKey.current != null) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
415
- lastFocusedKey.current = manager.focusedKey;
416
- autoFocusRef.current = false;
417
- }, [
418
- isVirtualized,
419
- scrollRef,
420
- manager.focusedKey,
421
- manager.isFocused,
422
- ref
423
- ]);
424
- let handlers = {
425
- onKeyDown,
426
- onFocus,
427
- onBlur,
428
- onMouseDown(e) {
429
- if (scrollRef.current === e.target)
430
- e.preventDefault();
313
+ this.ownerDocument.queueUpdate();
314
+ }
315
+ get style() {
316
+ return {};
317
+ }
318
+ hasAttribute() {
319
+ }
320
+ setAttribute() {
321
+ }
322
+ setAttributeNS() {
323
+ }
324
+ removeAttribute() {
325
+ }
326
+ constructor(type, ownerDocument) {
327
+ super(ownerDocument);
328
+ this.nodeType = 8;
329
+ this._index = 0;
330
+ this.hasSetProps = false;
331
+ this.node = new $23b9f4fcf0fe224b$export$d68d59712b04d9d1(type, `react-aria-${++ownerDocument.nodeId}`);
332
+ this.ownerDocument.startTransaction();
333
+ }
334
+ }
335
+ class $681cc3c98f569e39$export$b34a105447964f9f extends $681cc3c98f569e39$export$410b0c854570d131 {
336
+ get isConnected() {
337
+ return this.isMounted;
338
+ }
339
+ createElement(type) {
340
+ return new $681cc3c98f569e39$export$dc064fe9e59310fd(type, this);
341
+ }
342
+ /**
343
+ * Lazily gets a mutable instance of a Node. If the node has already
344
+ * been cloned during this update cycle, it just returns the existing one.
345
+ */
346
+ getMutableNode(element) {
347
+ let node = element.node;
348
+ if (!this.mutatedNodes.has(element)) {
349
+ node = element.node.clone();
350
+ this.mutatedNodes.add(element);
351
+ element.node = node;
352
+ }
353
+ this.markDirty(element);
354
+ return node;
355
+ }
356
+ getMutableCollection() {
357
+ if (!this.isSSR && !this.collectionMutated) {
358
+ this.collection = this.collection.clone();
359
+ this.collectionMutated = true;
360
+ }
361
+ return this.collection;
362
+ }
363
+ markDirty(node) {
364
+ this.dirtyNodes.add(node);
365
+ }
366
+ startTransaction() {
367
+ this.transactionCount++;
368
+ }
369
+ endTransaction() {
370
+ this.transactionCount--;
371
+ }
372
+ addNode(element) {
373
+ let collection = this.getMutableCollection();
374
+ if (!collection.getItem(element.node.key)) {
375
+ collection.addNode(element.node);
376
+ for (let child of element) this.addNode(child);
377
+ }
378
+ this.markDirty(element);
379
+ }
380
+ removeNode(node) {
381
+ for (let child of node) this.removeNode(child);
382
+ let collection = this.getMutableCollection();
383
+ collection.removeNode(node.node.key);
384
+ this.markDirty(node);
385
+ }
386
+ /** Finalizes the collection update, updating all nodes and freezing the collection. */
387
+ getCollection() {
388
+ if (this.transactionCount > 0) return this.collection;
389
+ this.updateCollection();
390
+ return this.collection;
391
+ }
392
+ updateCollection() {
393
+ for (let element of this.dirtyNodes) if (element instanceof $681cc3c98f569e39$export$dc064fe9e59310fd && element.isConnected) element.updateNode();
394
+ this.dirtyNodes.clear();
395
+ if (this.mutatedNodes.size || this.collectionMutated) {
396
+ var _this_firstChild, _this_lastChild;
397
+ let collection = this.getMutableCollection();
398
+ for (let element of this.mutatedNodes) if (element.isConnected) collection.addNode(element.node);
399
+ var _this_firstChild_node_key, _this_lastChild_node_key;
400
+ collection.commit((_this_firstChild_node_key = (_this_firstChild = this.firstChild) === null || _this_firstChild === void 0 ? void 0 : _this_firstChild.node.key) !== null && _this_firstChild_node_key !== void 0 ? _this_firstChild_node_key : null, (_this_lastChild_node_key = (_this_lastChild = this.lastChild) === null || _this_lastChild === void 0 ? void 0 : _this_lastChild.node.key) !== null && _this_lastChild_node_key !== void 0 ? _this_lastChild_node_key : null, this.isSSR);
401
+ this.mutatedNodes.clear();
431
402
  }
432
- };
433
- let { typeSelectProps } = $fb3050f43d946246$export$e32c88dfddc6e1d8({
434
- keyboardDelegate: delegate,
435
- selectionManager: manager
436
- });
437
- if (!disallowTypeAhead) handlers = $3ef42575df84b30b$export$9d1611c77c2fe928(typeSelectProps, handlers);
438
- let tabIndex;
439
- if (!shouldUseVirtualFocus) tabIndex = manager.focusedKey == null ? 0 : -1;
440
- return {
441
- collectionProps: {
442
- ...handlers,
443
- tabIndex
403
+ this.collectionMutated = false;
404
+ }
405
+ queueUpdate() {
406
+ if (this.dirtyNodes.size === 0 || this.transactionCount > 0) return;
407
+ for (let fn of this.subscriptions) fn();
408
+ }
409
+ subscribe(fn) {
410
+ this.subscriptions.add(fn);
411
+ return () => this.subscriptions.delete(fn);
412
+ }
413
+ resetAfterSSR() {
414
+ if (this.isSSR) {
415
+ this.isSSR = false;
416
+ this.firstChild = null;
417
+ this.lastChild = null;
418
+ this.nodeId = 0;
444
419
  }
445
- };
420
+ }
421
+ constructor(collection) {
422
+ super(null);
423
+ this.nodeType = 11;
424
+ this.ownerDocument = this;
425
+ this.dirtyNodes = /* @__PURE__ */ new Set();
426
+ this.isSSR = false;
427
+ this.nodeId = 0;
428
+ this.nodesByProps = /* @__PURE__ */ new WeakMap();
429
+ this.isMounted = true;
430
+ this.mutatedNodes = /* @__PURE__ */ new Set();
431
+ this.subscriptions = /* @__PURE__ */ new Set();
432
+ this.transactionCount = 0;
433
+ this.collection = collection;
434
+ this.collectionMutated = true;
435
+ }
446
436
  }
447
- function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
448
- let { selectionManager: manager, key, ref, shouldSelectOnPressUp, shouldUseVirtualFocus, focus, isDisabled, onAction, allowsDifferentPressOrigin, linkBehavior = "action" } = options;
449
- let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
450
- let onSelect = (e) => {
451
- if (e.pointerType === "keyboard" && $feb5ffebff200149$export$d3e3bd3e26688c04(e)) manager.toggleSelection(key);
452
- else {
453
- if (manager.selectionMode === "none") return;
454
- if (manager.isLink(key)) {
455
- if (linkBehavior === "selection") {
456
- let itemProps2 = manager.getItemProps(key);
457
- router.open(ref.current, e, itemProps2.href, itemProps2.routerOptions);
458
- manager.setSelectedKeys(manager.selectedKeys);
459
- return;
460
- } else if (linkBehavior === "override" || linkBehavior === "none") return;
437
+ function $e948873055cbafe4$export$727c8fc270210f13(props) {
438
+ let { children, items, idScope, addIdAndValue, dependencies = [] } = props;
439
+ let cache = useMemo(() => /* @__PURE__ */ new WeakMap(), dependencies);
440
+ return useMemo(() => {
441
+ if (items && typeof children === "function") {
442
+ let res = [];
443
+ for (let item of items) {
444
+ let rendered = cache.get(item);
445
+ if (!rendered) {
446
+ rendered = children(item);
447
+ var _rendered_props_id, _ref;
448
+ let key = (_ref = (_rendered_props_id = rendered.props.id) !== null && _rendered_props_id !== void 0 ? _rendered_props_id : item.key) !== null && _ref !== void 0 ? _ref : item.id;
449
+ if (key == null) throw new Error("Could not determine key for item");
450
+ if (idScope) key = idScope + ":" + key;
451
+ rendered = cloneElement(rendered, addIdAndValue ? {
452
+ key,
453
+ id: key,
454
+ value: item
455
+ } : {
456
+ key
457
+ });
458
+ cache.set(item, rendered);
459
+ }
460
+ res.push(rendered);
461
461
  }
462
- if (manager.selectionMode === "single") {
463
- if (manager.isSelected(key) && !manager.disallowEmptySelection) manager.toggleSelection(key);
464
- else manager.replaceSelection(key);
465
- } else if (e && e.shiftKey) manager.extendSelection(key);
466
- else if (manager.selectionBehavior === "toggle" || e && ($feb5ffebff200149$export$16792effe837dba3(e) || e.pointerType === "touch" || e.pointerType === "virtual"))
467
- manager.toggleSelection(key);
468
- else manager.replaceSelection(key);
469
- }
470
- };
471
- useEffect(() => {
472
- let isFocused = key === manager.focusedKey;
473
- if (isFocused && manager.isFocused && !shouldUseVirtualFocus) {
474
- if (focus) focus();
475
- else if (document.activeElement !== ref.current) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
476
- }
462
+ return res;
463
+ } else if (typeof children !== "function") return children;
477
464
  }, [
478
- ref,
479
- key,
480
- manager.focusedKey,
481
- manager.childFocusStrategy,
482
- manager.isFocused,
483
- shouldUseVirtualFocus
465
+ children,
466
+ items,
467
+ cache,
468
+ idScope,
469
+ addIdAndValue
484
470
  ]);
485
- isDisabled = isDisabled || manager.isDisabled(key);
486
- let itemProps = {};
487
- if (!shouldUseVirtualFocus && !isDisabled) itemProps = {
488
- tabIndex: key === manager.focusedKey ? 0 : -1,
489
- onFocus(e) {
490
- if (e.target === ref.current) manager.setFocusedKey(key);
491
- }
492
- };
493
- else if (isDisabled) itemProps.onMouseDown = (e) => {
494
- e.preventDefault();
495
- };
496
- let isLinkOverride = manager.isLink(key) && linkBehavior === "override";
497
- let hasLinkAction = manager.isLink(key) && linkBehavior !== "selection" && linkBehavior !== "none";
498
- let allowsSelection = !isDisabled && manager.canSelectItem(key) && !isLinkOverride;
499
- let allowsActions = (onAction || hasLinkAction) && !isDisabled;
500
- let hasPrimaryAction = allowsActions && (manager.selectionBehavior === "replace" ? !allowsSelection : !allowsSelection || manager.isEmpty);
501
- let hasSecondaryAction = allowsActions && allowsSelection && manager.selectionBehavior === "replace";
502
- let hasAction = hasPrimaryAction || hasSecondaryAction;
503
- let modality = useRef(null);
504
- let longPressEnabled = hasAction && allowsSelection;
505
- let longPressEnabledOnPressStart = useRef(false);
506
- let hadPrimaryActionOnPressStart = useRef(false);
507
- let performAction = (e) => {
508
- if (onAction) onAction();
509
- if (hasLinkAction) {
510
- let itemProps2 = manager.getItemProps(key);
511
- router.open(ref.current, e, itemProps2.href, itemProps2.routerOptions);
512
- }
513
- };
514
- let itemPressProps = {};
515
- if (shouldSelectOnPressUp) {
516
- itemPressProps.onPressStart = (e) => {
517
- modality.current = e.pointerType;
518
- longPressEnabledOnPressStart.current = longPressEnabled;
519
- if (e.pointerType === "keyboard" && (!hasAction || $880e95eb8b93ba9a$var$isSelectionKey())) onSelect(e);
520
- };
521
- if (!allowsDifferentPressOrigin) itemPressProps.onPress = (e) => {
522
- if (hasPrimaryAction || hasSecondaryAction && e.pointerType !== "mouse") {
523
- if (e.pointerType === "keyboard" && !$880e95eb8b93ba9a$var$isActionKey()) return;
524
- performAction(e);
525
- } else if (e.pointerType !== "keyboard" && allowsSelection) onSelect(e);
526
- };
527
- else {
528
- itemPressProps.onPressUp = hasPrimaryAction ? null : (e) => {
529
- if (e.pointerType !== "keyboard" && allowsSelection) onSelect(e);
471
+ }
472
+ function $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(node, checkForOverflow) {
473
+ const scrollParents = [];
474
+ while (node && node !== document.documentElement) {
475
+ if ($cc38e7bd3fc7b213$export$2bb74740c4e19def(node, checkForOverflow)) scrollParents.push(node);
476
+ node = node.parentElement;
477
+ }
478
+ return scrollParents;
479
+ }
480
+ let $ef06256079686ba0$var$descriptionId = 0;
481
+ const $ef06256079686ba0$var$descriptionNodes = /* @__PURE__ */ new Map();
482
+ function $ef06256079686ba0$export$f8aeda7b10753fa1(description) {
483
+ let [id, setId] = useState();
484
+ $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
485
+ if (!description) return;
486
+ let desc = $ef06256079686ba0$var$descriptionNodes.get(description);
487
+ if (!desc) {
488
+ let id2 = `react-aria-description-${$ef06256079686ba0$var$descriptionId++}`;
489
+ setId(id2);
490
+ let node = document.createElement("div");
491
+ node.id = id2;
492
+ node.style.display = "none";
493
+ node.textContent = description;
494
+ document.body.appendChild(node);
495
+ desc = {
496
+ refCount: 0,
497
+ element: node
530
498
  };
531
- itemPressProps.onPress = hasPrimaryAction ? performAction : null;
532
- }
533
- } else {
534
- itemPressProps.onPressStart = (e) => {
535
- modality.current = e.pointerType;
536
- longPressEnabledOnPressStart.current = longPressEnabled;
537
- hadPrimaryActionOnPressStart.current = hasPrimaryAction;
538
- if (allowsSelection && (e.pointerType === "mouse" && !hasPrimaryAction || e.pointerType === "keyboard" && (!allowsActions || $880e95eb8b93ba9a$var$isSelectionKey()))) onSelect(e);
539
- };
540
- itemPressProps.onPress = (e) => {
541
- if (e.pointerType === "touch" || e.pointerType === "pen" || e.pointerType === "virtual" || e.pointerType === "keyboard" && hasAction && $880e95eb8b93ba9a$var$isActionKey() || e.pointerType === "mouse" && hadPrimaryActionOnPressStart.current) {
542
- if (hasAction) performAction(e);
543
- else if (allowsSelection) onSelect(e);
499
+ $ef06256079686ba0$var$descriptionNodes.set(description, desc);
500
+ } else setId(desc.element.id);
501
+ desc.refCount++;
502
+ return () => {
503
+ if (desc && --desc.refCount === 0) {
504
+ desc.element.remove();
505
+ $ef06256079686ba0$var$descriptionNodes.delete(description);
544
506
  }
545
507
  };
546
- }
547
- itemProps["data-key"] = key;
548
- itemPressProps.preventFocusOnPress = shouldUseVirtualFocus;
549
- let { pressProps, isPressed } = $f6c31cce2adf654f$export$45712eceda6fad21(itemPressProps);
550
- let onDoubleClick = hasSecondaryAction ? (e) => {
551
- if (modality.current === "mouse") {
552
- e.stopPropagation();
553
- e.preventDefault();
554
- performAction(e);
555
- }
556
- } : void 0;
557
- let { longPressProps } = $8a26561d2877236e$export$c24ed0104d07eab9({
558
- isDisabled: !longPressEnabled,
559
- onLongPress(e) {
560
- if (e.pointerType === "touch") {
561
- onSelect(e);
562
- manager.setSelectionBehavior("toggle");
563
- }
564
- }
565
- });
566
- let onDragStartCapture = (e) => {
567
- if (modality.current === "touch" && longPressEnabledOnPressStart.current) e.preventDefault();
568
- };
569
- let onClick = manager.isLink(key) ? (e) => {
570
- if (!$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening) e.preventDefault();
571
- } : void 0;
508
+ }, [
509
+ description
510
+ ]);
572
511
  return {
573
- itemProps: $3ef42575df84b30b$export$9d1611c77c2fe928(itemProps, allowsSelection || hasPrimaryAction ? pressProps : {}, longPressEnabled ? longPressProps : {}, {
574
- onDoubleClick,
575
- onDragStartCapture,
576
- onClick
577
- }),
578
- isPressed,
579
- isSelected: manager.isSelected(key),
580
- isFocused: manager.isFocused && manager.focusedKey === key,
581
- isDisabled,
582
- allowsSelection,
583
- hasAction
512
+ "aria-describedby": description ? id : void 0
584
513
  };
585
514
  }
586
- function $880e95eb8b93ba9a$var$isActionKey() {
587
- let event = window.event;
588
- return (event === null || event === void 0 ? void 0 : event.key) === "Enter";
589
- }
590
- function $880e95eb8b93ba9a$var$isSelectionKey() {
591
- let event = window.event;
592
- return (event === null || event === void 0 ? void 0 : event.key) === " " || (event === null || event === void 0 ? void 0 : event.code) === "Space";
515
+ function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
516
+ let offsetX = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, "left");
517
+ let offsetY = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, "top");
518
+ let width = element.offsetWidth;
519
+ let height = element.offsetHeight;
520
+ let x = scrollView.scrollLeft;
521
+ let y = scrollView.scrollTop;
522
+ let { borderTopWidth, borderLeftWidth } = getComputedStyle(scrollView);
523
+ let borderAdjustedX = scrollView.scrollLeft + parseInt(borderLeftWidth, 10);
524
+ let borderAdjustedY = scrollView.scrollTop + parseInt(borderTopWidth, 10);
525
+ let maxX = borderAdjustedX + scrollView.clientWidth;
526
+ let maxY = borderAdjustedY + scrollView.clientHeight;
527
+ if (offsetX <= x) x = offsetX - parseInt(borderLeftWidth, 10);
528
+ else if (offsetX + width > maxX) x += offsetX + width - maxX;
529
+ if (offsetY <= borderAdjustedY) y = offsetY - parseInt(borderTopWidth, 10);
530
+ else if (offsetY + height > maxY) y += offsetY + height - maxY;
531
+ scrollView.scrollLeft = x;
532
+ scrollView.scrollTop = y;
593
533
  }
594
- class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
595
- build(props, context) {
596
- this.context = context;
597
- return $eb2240fc39a57fa5$var$iterable(() => this.iterateCollection(props));
534
+ function $2f04cbc44ee30ce0$var$relativeOffset(ancestor, child, axis) {
535
+ const prop = axis === "left" ? "offsetLeft" : "offsetTop";
536
+ let sum = 0;
537
+ while (child.offsetParent) {
538
+ sum += child[prop];
539
+ if (child.offsetParent === ancestor) break;
540
+ else if (child.offsetParent.contains(ancestor)) {
541
+ sum -= ancestor[prop];
542
+ break;
543
+ }
544
+ child = child.offsetParent;
598
545
  }
599
- *iterateCollection(props) {
600
- let { children, items } = props;
601
- if (typeof children === "function") {
602
- if (!items) throw new Error("props.children was a function but props.items is missing");
603
- for (let item of props.items) yield* this.getFullNode({
604
- value: item
605
- }, {
606
- renderer: children
607
- });
608
- } else {
609
- let items2 = [];
610
- React__default.Children.forEach(children, (child) => {
611
- items2.push(child);
546
+ return sum;
547
+ }
548
+ function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
549
+ if (document.contains(targetElement)) {
550
+ let root = document.scrollingElement || document.documentElement;
551
+ let isScrollPrevented = window.getComputedStyle(root).overflow === "hidden";
552
+ if (!isScrollPrevented) {
553
+ var _targetElement_scrollIntoView;
554
+ let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
555
+ targetElement === null || targetElement === void 0 ? void 0 : (_targetElement_scrollIntoView = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView === void 0 ? void 0 : _targetElement_scrollIntoView.call(targetElement, {
556
+ block: "nearest"
612
557
  });
613
- let index = 0;
614
- for (let item of items2) {
615
- let nodes = this.getFullNode({
616
- element: item,
617
- index
618
- }, {});
619
- for (let node of nodes) {
620
- index++;
621
- yield node;
622
- }
558
+ let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
559
+ if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
560
+ var _opts_containingElement_scrollIntoView, _opts_containingElement, _targetElement_scrollIntoView1;
561
+ opts === null || opts === void 0 ? void 0 : (_opts_containingElement = opts.containingElement) === null || _opts_containingElement === void 0 ? void 0 : (_opts_containingElement_scrollIntoView = _opts_containingElement.scrollIntoView) === null || _opts_containingElement_scrollIntoView === void 0 ? void 0 : _opts_containingElement_scrollIntoView.call(_opts_containingElement, {
562
+ block: "center",
563
+ inline: "center"
564
+ });
565
+ (_targetElement_scrollIntoView1 = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView1 === void 0 ? void 0 : _targetElement_scrollIntoView1.call(targetElement, {
566
+ block: "nearest"
567
+ });
623
568
  }
569
+ } else {
570
+ let scrollParents = $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(targetElement);
571
+ for (let scrollParent of scrollParents) $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollParent, targetElement);
624
572
  }
625
573
  }
626
- getKey(item, partialNode, state, parentKey) {
627
- if (item.key != null) return item.key;
628
- if (partialNode.type === "cell" && partialNode.key != null) return `${parentKey}${partialNode.key}`;
629
- let v = partialNode.value;
630
- if (v != null) {
631
- var _v_key;
632
- let key = (_v_key = v.key) !== null && _v_key !== void 0 ? _v_key : v.id;
633
- if (key == null) throw new Error("No key found for item");
634
- return key;
574
+ }
575
+ var shim = { exports: {} };
576
+ var useSyncExternalStoreShim_production_min = {};
577
+ /**
578
+ * @license React
579
+ * use-sync-external-store-shim.production.min.js
580
+ *
581
+ * Copyright (c) Facebook, Inc. and its affiliates.
582
+ *
583
+ * This source code is licensed under the MIT license found in the
584
+ * LICENSE file in the root directory of this source tree.
585
+ */
586
+ var hasRequiredUseSyncExternalStoreShim_production_min;
587
+ function requireUseSyncExternalStoreShim_production_min() {
588
+ if (hasRequiredUseSyncExternalStoreShim_production_min) return useSyncExternalStoreShim_production_min;
589
+ hasRequiredUseSyncExternalStoreShim_production_min = 1;
590
+ var e = React__default;
591
+ function h(a, b) {
592
+ return a === b && (0 !== a || 1 / a === 1 / b) || a !== a && b !== b;
593
+ }
594
+ var k = "function" === typeof Object.is ? Object.is : h, l = e.useState, m = e.useEffect, n = e.useLayoutEffect, p = e.useDebugValue;
595
+ function q(a, b) {
596
+ var d = b(), f = l({ inst: { value: d, getSnapshot: b } }), c = f[0].inst, g = f[1];
597
+ n(function() {
598
+ c.value = d;
599
+ c.getSnapshot = b;
600
+ r(c) && g({ inst: c });
601
+ }, [a, d, b]);
602
+ m(function() {
603
+ r(c) && g({ inst: c });
604
+ return a(function() {
605
+ r(c) && g({ inst: c });
606
+ });
607
+ }, [a]);
608
+ p(d);
609
+ return d;
610
+ }
611
+ function r(a) {
612
+ var b = a.getSnapshot;
613
+ a = a.value;
614
+ try {
615
+ var d = b();
616
+ return !k(a, d);
617
+ } catch (f) {
618
+ return true;
635
619
  }
636
- return parentKey ? `${parentKey}.${partialNode.index}` : `$.${partialNode.index}`;
637
620
  }
638
- getChildState(state, partialNode) {
639
- return {
640
- renderer: partialNode.renderer || state.renderer
641
- };
621
+ function t(a, b) {
622
+ return b();
642
623
  }
643
- *getFullNode(partialNode, state, parentKey, parentNode) {
644
- let element = partialNode.element;
645
- if (!element && partialNode.value && state && state.renderer) {
646
- let cached = this.cache.get(partialNode.value);
647
- if (cached && (!cached.shouldInvalidate || !cached.shouldInvalidate(this.context))) {
648
- cached.index = partialNode.index;
649
- cached.parentKey = parentNode ? parentNode.key : null;
650
- yield cached;
651
- return;
624
+ var u = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? t : q;
625
+ useSyncExternalStoreShim_production_min.useSyncExternalStore = void 0 !== e.useSyncExternalStore ? e.useSyncExternalStore : u;
626
+ return useSyncExternalStoreShim_production_min;
627
+ }
628
+ var useSyncExternalStoreShim_development = {};
629
+ /**
630
+ * @license React
631
+ * use-sync-external-store-shim.development.js
632
+ *
633
+ * Copyright (c) Facebook, Inc. and its affiliates.
634
+ *
635
+ * This source code is licensed under the MIT license found in the
636
+ * LICENSE file in the root directory of this source tree.
637
+ */
638
+ var hasRequiredUseSyncExternalStoreShim_development;
639
+ function requireUseSyncExternalStoreShim_development() {
640
+ if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
641
+ hasRequiredUseSyncExternalStoreShim_development = 1;
642
+ if (process.env.NODE_ENV !== "production") {
643
+ (function() {
644
+ if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
645
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
652
646
  }
653
- element = state.renderer(partialNode.value);
654
- }
655
- if (React__default.isValidElement(element)) {
656
- let type = element.type;
657
- if (typeof type !== "function" && typeof type.getCollectionNode !== "function") {
658
- let name = typeof element.type === "function" ? element.type.name : element.type;
659
- throw new Error(`Unknown element <${name}> in collection.`);
647
+ var React = React__default;
648
+ var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
649
+ function error(format) {
650
+ {
651
+ {
652
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
653
+ args[_key2 - 1] = arguments[_key2];
654
+ }
655
+ printWarning("error", format, args);
656
+ }
657
+ }
658
+ }
659
+ function printWarning(level, format, args) {
660
+ {
661
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
662
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
663
+ if (stack !== "") {
664
+ format += "%s";
665
+ args = args.concat([stack]);
666
+ }
667
+ var argsWithFormat = args.map(function(item) {
668
+ return String(item);
669
+ });
670
+ argsWithFormat.unshift("Warning: " + format);
671
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
672
+ }
673
+ }
674
+ function is(x, y) {
675
+ return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
676
+ }
677
+ var objectIs = typeof Object.is === "function" ? Object.is : is;
678
+ var useState2 = React.useState, useEffect2 = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue;
679
+ var didWarnOld18Alpha = false;
680
+ var didWarnUncachedGetSnapshot = false;
681
+ function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
682
+ {
683
+ if (!didWarnOld18Alpha) {
684
+ if (React.startTransition !== void 0) {
685
+ didWarnOld18Alpha = true;
686
+ error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.");
687
+ }
688
+ }
689
+ }
690
+ var value = getSnapshot();
691
+ {
692
+ if (!didWarnUncachedGetSnapshot) {
693
+ var cachedValue = getSnapshot();
694
+ if (!objectIs(value, cachedValue)) {
695
+ error("The result of getSnapshot should be cached to avoid an infinite loop");
696
+ didWarnUncachedGetSnapshot = true;
697
+ }
698
+ }
699
+ }
700
+ var _useState = useState2({
701
+ inst: {
702
+ value,
703
+ getSnapshot
704
+ }
705
+ }), inst = _useState[0].inst, forceUpdate = _useState[1];
706
+ useLayoutEffect(function() {
707
+ inst.value = value;
708
+ inst.getSnapshot = getSnapshot;
709
+ if (checkIfSnapshotChanged(inst)) {
710
+ forceUpdate({
711
+ inst
712
+ });
713
+ }
714
+ }, [subscribe, value, getSnapshot]);
715
+ useEffect2(function() {
716
+ if (checkIfSnapshotChanged(inst)) {
717
+ forceUpdate({
718
+ inst
719
+ });
720
+ }
721
+ var handleStoreChange = function() {
722
+ if (checkIfSnapshotChanged(inst)) {
723
+ forceUpdate({
724
+ inst
725
+ });
726
+ }
727
+ };
728
+ return subscribe(handleStoreChange);
729
+ }, [subscribe]);
730
+ useDebugValue(value);
731
+ return value;
660
732
  }
661
- let childNodes = type.getCollectionNode(element.props, this.context);
662
- let index = partialNode.index;
663
- let result = childNodes.next();
664
- while (!result.done && result.value) {
665
- let childNode = result.value;
666
- partialNode.index = index;
667
- let nodeKey = childNode.key;
668
- if (!nodeKey) nodeKey = childNode.element ? null : this.getKey(element, partialNode, state, parentKey);
669
- let nodes = this.getFullNode({
670
- ...childNode,
671
- key: nodeKey,
672
- index,
673
- wrapper: $eb2240fc39a57fa5$var$compose(partialNode.wrapper, childNode.wrapper)
674
- }, this.getChildState(state, childNode), parentKey ? `${parentKey}${element.key}` : element.key, parentNode);
675
- let children = [
676
- ...nodes
677
- ];
678
- for (let node2 of children) {
679
- node2.value = childNode.value || partialNode.value;
680
- if (node2.value) this.cache.set(node2.value, node2);
681
- if (partialNode.type && node2.type !== partialNode.type) throw new Error(`Unsupported type <${$eb2240fc39a57fa5$var$capitalize(node2.type)}> in <${$eb2240fc39a57fa5$var$capitalize(parentNode.type)}>. Only <${$eb2240fc39a57fa5$var$capitalize(partialNode.type)}> is supported.`);
682
- index++;
683
- yield node2;
733
+ function checkIfSnapshotChanged(inst) {
734
+ var latestGetSnapshot = inst.getSnapshot;
735
+ var prevValue = inst.value;
736
+ try {
737
+ var nextValue = latestGetSnapshot();
738
+ return !objectIs(prevValue, nextValue);
739
+ } catch (error2) {
740
+ return true;
684
741
  }
685
- result = childNodes.next(children);
686
742
  }
687
- return;
688
- }
689
- if (partialNode.key == null) return;
690
- let builder = this;
691
- let node = {
692
- type: partialNode.type,
693
- props: partialNode.props,
694
- key: partialNode.key,
695
- parentKey: parentNode ? parentNode.key : null,
696
- value: partialNode.value,
697
- level: parentNode ? parentNode.level + 1 : 0,
698
- index: partialNode.index,
699
- rendered: partialNode.rendered,
700
- textValue: partialNode.textValue,
701
- "aria-label": partialNode["aria-label"],
702
- wrapper: partialNode.wrapper,
703
- shouldInvalidate: partialNode.shouldInvalidate,
704
- hasChildNodes: partialNode.hasChildNodes,
705
- childNodes: $eb2240fc39a57fa5$var$iterable(function* () {
706
- if (!partialNode.hasChildNodes) return;
707
- let index = 0;
708
- for (let child of partialNode.childNodes()) {
709
- if (child.key != null)
710
- child.key = `${node.key}${child.key}`;
711
- child.index = index;
712
- let nodes = builder.getFullNode(child, builder.getChildState(state, child), node.key, node);
713
- for (let node2 of nodes) {
714
- index++;
715
- yield node2;
716
- }
717
- }
718
- })
719
- };
720
- yield node;
721
- }
722
- constructor() {
723
- this.cache = /* @__PURE__ */ new WeakMap();
743
+ function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
744
+ return getSnapshot();
745
+ }
746
+ var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
747
+ var isServerEnvironment = !canUseDOM;
748
+ var shim2 = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
749
+ var useSyncExternalStore$2 = React.useSyncExternalStore !== void 0 ? React.useSyncExternalStore : shim2;
750
+ useSyncExternalStoreShim_development.useSyncExternalStore = useSyncExternalStore$2;
751
+ if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
752
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
753
+ }
754
+ })();
724
755
  }
756
+ return useSyncExternalStoreShim_development;
725
757
  }
726
- function $eb2240fc39a57fa5$var$iterable(iterator) {
727
- let cache = [];
728
- let iterable = null;
729
- return {
730
- *[Symbol.iterator]() {
731
- for (let item of cache) yield item;
732
- if (!iterable) iterable = iterator();
733
- for (let item of iterable) {
734
- cache.push(item);
735
- yield item;
736
- }
737
- }
738
- };
758
+ if (process.env.NODE_ENV === "production") {
759
+ shim.exports = requireUseSyncExternalStoreShim_production_min();
760
+ } else {
761
+ shim.exports = requireUseSyncExternalStoreShim_development();
739
762
  }
740
- function $eb2240fc39a57fa5$var$compose(outer, inner) {
741
- if (outer && inner) return (element) => outer(inner(element));
742
- if (outer) return outer;
743
- if (inner) return inner;
763
+ var shimExports = shim.exports;
764
+ const $e1995378a142960e$var$ShallowRenderContext = /* @__PURE__ */ createContext(false);
765
+ const $e1995378a142960e$var$CollectionDocumentContext = /* @__PURE__ */ createContext(null);
766
+ function $e1995378a142960e$export$bf788dd355e3a401(props) {
767
+ let doc = useContext($e1995378a142960e$var$CollectionDocumentContext);
768
+ if (doc)
769
+ return props.content;
770
+ let { collection, document: document2 } = $e1995378a142960e$var$useCollectionDocument(props.createCollection);
771
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement($f39a9eba43920ace$export$8dc98ba7eadeaa56, null, /* @__PURE__ */ React__default.createElement($e1995378a142960e$var$CollectionDocumentContext.Provider, {
772
+ value: document2
773
+ }, props.content)), /* @__PURE__ */ React__default.createElement($e1995378a142960e$var$CollectionInner, {
774
+ render: props.children,
775
+ collection
776
+ }));
744
777
  }
745
- function $eb2240fc39a57fa5$var$capitalize(str) {
746
- return str[0].toUpperCase() + str.slice(1);
778
+ function $e1995378a142960e$var$CollectionInner({ collection, render }) {
779
+ return render(collection);
747
780
  }
748
- function $7613b1592d41b092$export$6cd28814d92fa9c9(props, factory, context) {
749
- let builder = useMemo(() => new $eb2240fc39a57fa5$export$bf788dd355e3a401(), []);
750
- let { children, items, collection } = props;
751
- let result = useMemo(() => {
752
- if (collection) return collection;
753
- let nodes = builder.build({
754
- children,
755
- items
756
- }, context);
757
- return factory(nodes);
781
+ function $e1995378a142960e$var$useSyncExternalStoreFallback(subscribe, getSnapshot, getServerSnapshot) {
782
+ let isSSR = $b5e257d569688ac6$export$535bd6ca7f90a273();
783
+ let isSSRRef = useRef(isSSR);
784
+ isSSRRef.current = isSSR;
785
+ let getSnapshotWrapper = useCallback(() => {
786
+ return isSSRRef.current ? getServerSnapshot() : getSnapshot();
758
787
  }, [
759
- builder,
760
- children,
761
- items,
788
+ getSnapshot,
789
+ getServerSnapshot
790
+ ]);
791
+ return shimExports.useSyncExternalStore(subscribe, getSnapshotWrapper);
792
+ }
793
+ const $e1995378a142960e$var$useSyncExternalStore = typeof React__default["useSyncExternalStore"] === "function" ? React__default["useSyncExternalStore"] : $e1995378a142960e$var$useSyncExternalStoreFallback;
794
+ function $e1995378a142960e$var$useCollectionDocument(createCollection) {
795
+ let [document2] = useState(() => new $681cc3c98f569e39$export$b34a105447964f9f((createCollection === null || createCollection === void 0 ? void 0 : createCollection()) || new $23b9f4fcf0fe224b$export$408d25a4e12db025()));
796
+ let subscribe = useCallback((fn) => document2.subscribe(fn), [
797
+ document2
798
+ ]);
799
+ let getSnapshot = useCallback(() => {
800
+ let collection2 = document2.getCollection();
801
+ if (document2.isSSR)
802
+ document2.resetAfterSSR();
803
+ return collection2;
804
+ }, [
805
+ document2
806
+ ]);
807
+ let getServerSnapshot = useCallback(() => {
808
+ document2.isSSR = true;
809
+ return document2.getCollection();
810
+ }, [
811
+ document2
812
+ ]);
813
+ let collection = $e1995378a142960e$var$useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
814
+ $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
815
+ document2.isMounted = true;
816
+ return () => {
817
+ document2.isMounted = false;
818
+ };
819
+ }, [
820
+ document2
821
+ ]);
822
+ return {
762
823
  collection,
763
- context,
764
- factory
824
+ document: document2
825
+ };
826
+ }
827
+ const $e1995378a142960e$var$SSRContext = /* @__PURE__ */ createContext(null);
828
+ function $e1995378a142960e$var$useSSRCollectionNode(Type, props, ref, rendered, children, render) {
829
+ let itemRef = useCallback((element) => {
830
+ element === null || element === void 0 ? void 0 : element.setProps(props, ref, rendered, render);
831
+ }, [
832
+ props,
833
+ ref,
834
+ rendered,
835
+ render
765
836
  ]);
766
- return result;
837
+ let parentNode = useContext($e1995378a142960e$var$SSRContext);
838
+ if (parentNode) {
839
+ let element = parentNode.ownerDocument.nodesByProps.get(props);
840
+ if (!element) {
841
+ element = parentNode.ownerDocument.createElement(Type);
842
+ element.setProps(props, ref, rendered, render);
843
+ parentNode.appendChild(element);
844
+ parentNode.ownerDocument.updateCollection();
845
+ parentNode.ownerDocument.nodesByProps.set(props, element);
846
+ }
847
+ return children ? /* @__PURE__ */ React__default.createElement($e1995378a142960e$var$SSRContext.Provider, {
848
+ value: element
849
+ }, children) : null;
850
+ }
851
+ return /* @__PURE__ */ React__default.createElement(Type, {
852
+ ref: itemRef
853
+ }, children);
767
854
  }
768
- function $c5a24bc478652b5f$export$1005530eda016c13(node, collection) {
769
- if (typeof collection.getChildren === "function") return collection.getChildren(node.key);
770
- return node.childNodes;
855
+ function $e1995378a142960e$export$18af5c7a9e9b3664(type, render) {
856
+ let Component = ({ node }) => render(node.props, node.props.ref, node);
857
+ let Result = forwardRef((props, ref) => {
858
+ let isShallow = useContext($e1995378a142960e$var$ShallowRenderContext);
859
+ if (!isShallow) {
860
+ if (render.length >= 3) throw new Error(render.name + " cannot be rendered outside a collection.");
861
+ return render(props, ref);
862
+ }
863
+ return $e1995378a142960e$var$useSSRCollectionNode(type, props, ref, "children" in props ? props.children : null, null, (node) => /* @__PURE__ */ React__default.createElement(Component, {
864
+ node
865
+ }));
866
+ });
867
+ Result.displayName = render.name;
868
+ return Result;
771
869
  }
772
- function $c5a24bc478652b5f$export$fbdeaa6a76694f71(iterable) {
773
- return $c5a24bc478652b5f$export$5f3398f8733f90e2(iterable);
870
+ function $e1995378a142960e$export$e953bb1cd0f19726(type, render, useChildren = $e1995378a142960e$var$useCollectionChildren) {
871
+ let Component = ({ node }) => render(node.props, node.props.ref, node);
872
+ let Result = forwardRef((props, ref) => {
873
+ let children = useChildren(props);
874
+ var _useSSRCollectionNode;
875
+ return (_useSSRCollectionNode = $e1995378a142960e$var$useSSRCollectionNode(type, props, ref, null, children, (node) => /* @__PURE__ */ React__default.createElement(Component, {
876
+ node
877
+ }))) !== null && _useSSRCollectionNode !== void 0 ? _useSSRCollectionNode : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null);
878
+ });
879
+ Result.displayName = render.name;
880
+ return Result;
774
881
  }
775
- function $c5a24bc478652b5f$export$5f3398f8733f90e2(iterable, index) {
776
- for (let item of iterable) {
777
- return item;
882
+ function $e1995378a142960e$var$useCollectionChildren(options) {
883
+ return $e948873055cbafe4$export$727c8fc270210f13({
884
+ ...options,
885
+ addIdAndValue: true
886
+ });
887
+ }
888
+ const $e1995378a142960e$var$CollectionContext = /* @__PURE__ */ createContext(null);
889
+ function $e1995378a142960e$export$fb8073518f34e6ec(props) {
890
+ let ctx = useContext($e1995378a142960e$var$CollectionContext);
891
+ let dependencies = ((ctx === null || ctx === void 0 ? void 0 : ctx.dependencies) || []).concat(props.dependencies);
892
+ let idScope = props.idScope || (ctx === null || ctx === void 0 ? void 0 : ctx.idScope);
893
+ let children = $e1995378a142960e$var$useCollectionChildren({
894
+ ...props,
895
+ idScope,
896
+ dependencies
897
+ });
898
+ let doc = useContext($e1995378a142960e$var$CollectionDocumentContext);
899
+ if (doc) children = /* @__PURE__ */ React__default.createElement($e1995378a142960e$var$CollectionRoot, null, children);
900
+ ctx = useMemo(() => ({
901
+ dependencies,
902
+ idScope
903
+ }), [
904
+ idScope,
905
+ ...dependencies
906
+ ]);
907
+ return /* @__PURE__ */ React__default.createElement($e1995378a142960e$var$CollectionContext.Provider, {
908
+ value: ctx
909
+ }, children);
910
+ }
911
+ function $e1995378a142960e$var$CollectionRoot({ children }) {
912
+ let doc = useContext($e1995378a142960e$var$CollectionDocumentContext);
913
+ let wrappedChildren = useMemo(() => /* @__PURE__ */ React__default.createElement($e1995378a142960e$var$CollectionDocumentContext.Provider, {
914
+ value: null
915
+ }, /* @__PURE__ */ React__default.createElement($e1995378a142960e$var$ShallowRenderContext.Provider, {
916
+ value: true
917
+ }, children)), [
918
+ children
919
+ ]);
920
+ return $b5e257d569688ac6$export$535bd6ca7f90a273() ? /* @__PURE__ */ React__default.createElement($e1995378a142960e$var$SSRContext.Provider, {
921
+ value: doc
922
+ }, wrappedChildren) : /* @__PURE__ */ reactDomExports.createPortal(wrappedChildren, doc);
923
+ }
924
+ const $7135fc7d473fd974$export$d40e14dec8b060a8 = /* @__PURE__ */ createContext(null);
925
+ const $7135fc7d473fd974$export$6e2c8f0811a474ce = /* @__PURE__ */ $e1995378a142960e$export$e953bb1cd0f19726("section", (props, ref, section) => {
926
+ let { render } = useContext($7135fc7d473fd974$export$d40e14dec8b060a8);
927
+ return render(props, ref, section);
928
+ });
929
+ const $7135fc7d473fd974$export$a164736487e3f0ae = {
930
+ CollectionRoot({ collection, renderDropIndicator }) {
931
+ return $7135fc7d473fd974$var$useCollectionRender(collection, null, renderDropIndicator);
932
+ },
933
+ CollectionBranch({ collection, parent, renderDropIndicator }) {
934
+ return $7135fc7d473fd974$var$useCollectionRender(collection, parent, renderDropIndicator);
778
935
  }
936
+ };
937
+ function $7135fc7d473fd974$var$useCollectionRender(collection, parent, renderDropIndicator) {
938
+ return $e948873055cbafe4$export$727c8fc270210f13({
939
+ items: parent ? collection.getChildren(parent.key) : collection,
940
+ dependencies: [
941
+ renderDropIndicator
942
+ ],
943
+ children(node) {
944
+ var _collection_getItem;
945
+ let rendered = node.render(node);
946
+ if (!renderDropIndicator || node.type !== "item") return rendered;
947
+ let key = node.key;
948
+ let keyAfter = collection.getKeyAfter(key);
949
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, renderDropIndicator({
950
+ type: "item",
951
+ key,
952
+ dropPosition: "before"
953
+ }), rendered, (keyAfter == null || ((_collection_getItem = collection.getItem(keyAfter)) === null || _collection_getItem === void 0 ? void 0 : _collection_getItem.type) !== "item") && renderDropIndicator({
954
+ type: "item",
955
+ key,
956
+ dropPosition: "after"
957
+ }));
958
+ }
959
+ });
779
960
  }
780
- function $c5a24bc478652b5f$export$7475b2c64539e4cf(iterable) {
781
- let lastItem = void 0;
782
- for (let value of iterable) lastItem = value;
783
- return lastItem;
961
+ const $7135fc7d473fd974$export$4feb769f8ddf26c5 = /* @__PURE__ */ createContext($7135fc7d473fd974$export$a164736487e3f0ae);
962
+ function $7135fc7d473fd974$export$90e00781bc59d8f9(focusedKey) {
963
+ return useMemo(() => focusedKey != null ? /* @__PURE__ */ new Set([
964
+ focusedKey
965
+ ]) : null, [
966
+ focusedKey
967
+ ]);
968
+ }
969
+ const $8a26561d2877236e$var$DEFAULT_THRESHOLD = 500;
970
+ function $8a26561d2877236e$export$c24ed0104d07eab9(props) {
971
+ let { isDisabled, onLongPressStart, onLongPressEnd, onLongPress, threshold = $8a26561d2877236e$var$DEFAULT_THRESHOLD, accessibilityDescription } = props;
972
+ const timeRef = useRef(void 0);
973
+ let { addGlobalListener, removeGlobalListener } = $03deb23ff14920c4$export$4eaf04e54aa8eed6();
974
+ let { pressProps } = $f6c31cce2adf654f$export$45712eceda6fad21({
975
+ isDisabled,
976
+ onPressStart(e) {
977
+ e.continuePropagation();
978
+ if (e.pointerType === "mouse" || e.pointerType === "touch") {
979
+ if (onLongPressStart) onLongPressStart({
980
+ ...e,
981
+ type: "longpressstart"
982
+ });
983
+ timeRef.current = setTimeout(() => {
984
+ e.target.dispatchEvent(new PointerEvent("pointercancel", {
985
+ bubbles: true
986
+ }));
987
+ if (onLongPress) onLongPress({
988
+ ...e,
989
+ type: "longpress"
990
+ });
991
+ timeRef.current = void 0;
992
+ }, threshold);
993
+ if (e.pointerType === "touch") {
994
+ let onContextMenu = (e2) => {
995
+ e2.preventDefault();
996
+ };
997
+ addGlobalListener(e.target, "contextmenu", onContextMenu, {
998
+ once: true
999
+ });
1000
+ addGlobalListener(window, "pointerup", () => {
1001
+ setTimeout(() => {
1002
+ removeGlobalListener(e.target, "contextmenu", onContextMenu);
1003
+ }, 30);
1004
+ }, {
1005
+ once: true
1006
+ });
1007
+ }
1008
+ }
1009
+ },
1010
+ onPressEnd(e) {
1011
+ if (timeRef.current) clearTimeout(timeRef.current);
1012
+ if (onLongPressEnd && (e.pointerType === "mouse" || e.pointerType === "touch")) onLongPressEnd({
1013
+ ...e,
1014
+ type: "longpressend"
1015
+ });
1016
+ }
1017
+ });
1018
+ let descriptionProps = $ef06256079686ba0$export$f8aeda7b10753fa1(onLongPress && !isDisabled ? accessibilityDescription : void 0);
1019
+ return {
1020
+ longPressProps: $3ef42575df84b30b$export$9d1611c77c2fe928(pressProps, descriptionProps)
1021
+ };
784
1022
  }
785
- function $c5a24bc478652b5f$export$8c434b3a7a4dad6(collection, a, b) {
786
- if (a.parentKey === b.parentKey) return a.index - b.index;
787
- let aAncestors = [
788
- ...$c5a24bc478652b5f$var$getAncestors(collection, a),
789
- a
790
- ];
791
- let bAncestors = [
792
- ...$c5a24bc478652b5f$var$getAncestors(collection, b),
793
- b
794
- ];
795
- let firstNonMatchingAncestor = aAncestors.slice(0, bAncestors.length).findIndex((a2, i) => a2 !== bAncestors[i]);
796
- if (firstNonMatchingAncestor !== -1) {
797
- a = aAncestors[firstNonMatchingAncestor];
798
- b = bAncestors[firstNonMatchingAncestor];
799
- return a.index - b.index;
800
- }
801
- if (aAncestors.findIndex((node) => node === b) >= 0) return 1;
802
- else if (bAncestors.findIndex((node) => node === a) >= 0) return -1;
803
- return -1;
1023
+ function $feb5ffebff200149$export$d3e3bd3e26688c04(e) {
1024
+ return $c87311424ea30a05$export$e1865c3bedcd822b() ? e.altKey : e.ctrlKey;
804
1025
  }
805
- function $c5a24bc478652b5f$var$getAncestors(collection, node) {
806
- let parents = [];
807
- while ((node === null || node === void 0 ? void 0 : node.parentKey) != null) {
808
- node = collection.getItem(node.parentKey);
809
- parents.unshift(node);
810
- }
811
- return parents;
1026
+ function $feb5ffebff200149$export$16792effe837dba3(e) {
1027
+ if ($c87311424ea30a05$export$9ac100e40613ea10()) return e.metaKey;
1028
+ return e.ctrlKey;
812
1029
  }
813
- var shim = { exports: {} };
814
- var useSyncExternalStoreShim_production_min = {};
815
- /**
816
- * @license React
817
- * use-sync-external-store-shim.production.min.js
818
- *
819
- * Copyright (c) Facebook, Inc. and its affiliates.
820
- *
821
- * This source code is licensed under the MIT license found in the
822
- * LICENSE file in the root directory of this source tree.
823
- */
824
- var hasRequiredUseSyncExternalStoreShim_production_min;
825
- function requireUseSyncExternalStoreShim_production_min() {
826
- if (hasRequiredUseSyncExternalStoreShim_production_min) return useSyncExternalStoreShim_production_min;
827
- hasRequiredUseSyncExternalStoreShim_production_min = 1;
828
- var e = React__default;
829
- function h(a, b) {
830
- return a === b && (0 !== a || 1 / a === 1 / b) || a !== a && b !== b;
831
- }
832
- var k = "function" === typeof Object.is ? Object.is : h, l = e.useState, m = e.useEffect, n = e.useLayoutEffect, p = e.useDebugValue;
833
- function q(a, b) {
834
- var d = b(), f = l({ inst: { value: d, getSnapshot: b } }), c = f[0].inst, g = f[1];
835
- n(function() {
836
- c.value = d;
837
- c.getSnapshot = b;
838
- r(c) && g({ inst: c });
839
- }, [a, d, b]);
840
- m(function() {
841
- r(c) && g({ inst: c });
842
- return a(function() {
843
- r(c) && g({ inst: c });
844
- });
845
- }, [a]);
846
- p(d);
847
- return d;
848
- }
849
- function r(a) {
850
- var b = a.getSnapshot;
851
- a = a.value;
852
- try {
853
- var d = b();
854
- return !k(a, d);
855
- } catch (f) {
856
- return true;
1030
+ const $fb3050f43d946246$var$TYPEAHEAD_DEBOUNCE_WAIT_MS = 1e3;
1031
+ function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
1032
+ let { keyboardDelegate, selectionManager, onTypeSelect } = options;
1033
+ let state = useRef({
1034
+ search: "",
1035
+ timeout: null
1036
+ }).current;
1037
+ let onKeyDown = (e) => {
1038
+ let character = $fb3050f43d946246$var$getStringForKey(e.key);
1039
+ if (!character || e.ctrlKey || e.metaKey || !e.currentTarget.contains(e.target)) return;
1040
+ if (character === " " && state.search.trim().length > 0) {
1041
+ e.preventDefault();
1042
+ if (!("continuePropagation" in e)) e.stopPropagation();
857
1043
  }
858
- }
859
- function t(a, b) {
860
- return b();
861
- }
862
- var u = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? t : q;
863
- useSyncExternalStoreShim_production_min.useSyncExternalStore = void 0 !== e.useSyncExternalStore ? e.useSyncExternalStore : u;
864
- return useSyncExternalStoreShim_production_min;
1044
+ state.search += character;
1045
+ let key = keyboardDelegate.getKeyForSearch(state.search, selectionManager.focusedKey);
1046
+ if (key == null) key = keyboardDelegate.getKeyForSearch(state.search);
1047
+ if (key != null) {
1048
+ selectionManager.setFocusedKey(key);
1049
+ if (onTypeSelect) onTypeSelect(key);
1050
+ }
1051
+ clearTimeout(state.timeout);
1052
+ state.timeout = setTimeout(() => {
1053
+ state.search = "";
1054
+ }, $fb3050f43d946246$var$TYPEAHEAD_DEBOUNCE_WAIT_MS);
1055
+ };
1056
+ return {
1057
+ typeSelectProps: {
1058
+ // Using a capturing listener to catch the keydown event before
1059
+ // other hooks in order to handle the Spacebar event.
1060
+ onKeyDownCapture: keyboardDelegate.getKeyForSearch ? onKeyDown : null
1061
+ }
1062
+ };
865
1063
  }
866
- var useSyncExternalStoreShim_development = {};
867
- /**
868
- * @license React
869
- * use-sync-external-store-shim.development.js
870
- *
871
- * Copyright (c) Facebook, Inc. and its affiliates.
872
- *
873
- * This source code is licensed under the MIT license found in the
874
- * LICENSE file in the root directory of this source tree.
875
- */
876
- var hasRequiredUseSyncExternalStoreShim_development;
877
- function requireUseSyncExternalStoreShim_development() {
878
- if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
879
- hasRequiredUseSyncExternalStoreShim_development = 1;
880
- if (process.env.NODE_ENV !== "production") {
881
- (function() {
882
- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
883
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
884
- }
885
- var React = React__default;
886
- var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
887
- function error(format) {
888
- {
889
- {
890
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
891
- args[_key2 - 1] = arguments[_key2];
892
- }
893
- printWarning("error", format, args);
894
- }
1064
+ function $fb3050f43d946246$var$getStringForKey(key) {
1065
+ if (key.length === 1 || !/^[A-Z]/i.test(key)) return key;
1066
+ return "";
1067
+ }
1068
+ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
1069
+ let { selectionManager: manager, keyboardDelegate: delegate, ref, autoFocus = false, shouldFocusWrap = false, disallowEmptySelection = false, disallowSelectAll = false, selectOnFocus = manager.selectionBehavior === "replace", disallowTypeAhead = false, shouldUseVirtualFocus, allowsTabNavigation = false, isVirtualized, scrollRef = ref, linkBehavior = "action" } = options;
1070
+ let { direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
1071
+ let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
1072
+ let onKeyDown = (e) => {
1073
+ if (e.altKey && e.key === "Tab") e.preventDefault();
1074
+ if (!ref.current.contains(e.target)) return;
1075
+ const navigateToKey = (key, childFocus) => {
1076
+ if (key != null) {
1077
+ if (manager.isLink(key) && linkBehavior === "selection" && selectOnFocus && !$feb5ffebff200149$export$d3e3bd3e26688c04(e)) {
1078
+ reactDomExports.flushSync(() => {
1079
+ manager.setFocusedKey(key, childFocus);
1080
+ });
1081
+ let item = scrollRef.current.querySelector(`[data-key="${CSS.escape(key.toString())}"]`);
1082
+ let itemProps = manager.getItemProps(key);
1083
+ router.open(item, e, itemProps.href, itemProps.routerOptions);
1084
+ return;
895
1085
  }
1086
+ manager.setFocusedKey(key, childFocus);
1087
+ if (manager.isLink(key) && linkBehavior === "override") return;
1088
+ if (e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(key);
1089
+ else if (selectOnFocus && !$feb5ffebff200149$export$d3e3bd3e26688c04(e)) manager.replaceSelection(key);
896
1090
  }
897
- function printWarning(level, format, args) {
898
- {
899
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
900
- var stack = ReactDebugCurrentFrame.getStackAddendum();
901
- if (stack !== "") {
902
- format += "%s";
903
- args = args.concat([stack]);
904
- }
905
- var argsWithFormat = args.map(function(item) {
906
- return String(item);
907
- });
908
- argsWithFormat.unshift("Warning: " + format);
909
- Function.prototype.apply.call(console[level], console, argsWithFormat);
1091
+ };
1092
+ switch (e.key) {
1093
+ case "ArrowDown":
1094
+ if (delegate.getKeyBelow) {
1095
+ var _delegate_getFirstKey, _delegate_getFirstKey1;
1096
+ e.preventDefault();
1097
+ let nextKey = manager.focusedKey != null ? delegate.getKeyBelow(manager.focusedKey) : (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate);
1098
+ if (nextKey == null && shouldFocusWrap) nextKey = (_delegate_getFirstKey1 = delegate.getFirstKey) === null || _delegate_getFirstKey1 === void 0 ? void 0 : _delegate_getFirstKey1.call(delegate, manager.focusedKey);
1099
+ navigateToKey(nextKey);
1100
+ }
1101
+ break;
1102
+ case "ArrowUp":
1103
+ if (delegate.getKeyAbove) {
1104
+ var _delegate_getLastKey, _delegate_getLastKey1;
1105
+ e.preventDefault();
1106
+ let nextKey = manager.focusedKey != null ? delegate.getKeyAbove(manager.focusedKey) : (_delegate_getLastKey = delegate.getLastKey) === null || _delegate_getLastKey === void 0 ? void 0 : _delegate_getLastKey.call(delegate);
1107
+ if (nextKey == null && shouldFocusWrap) nextKey = (_delegate_getLastKey1 = delegate.getLastKey) === null || _delegate_getLastKey1 === void 0 ? void 0 : _delegate_getLastKey1.call(delegate, manager.focusedKey);
1108
+ navigateToKey(nextKey);
1109
+ }
1110
+ break;
1111
+ case "ArrowLeft":
1112
+ if (delegate.getKeyLeftOf) {
1113
+ var _delegate_getFirstKey2, _delegate_getLastKey2;
1114
+ e.preventDefault();
1115
+ let nextKey = delegate.getKeyLeftOf(manager.focusedKey);
1116
+ if (nextKey == null && shouldFocusWrap) nextKey = direction === "rtl" ? (_delegate_getFirstKey2 = delegate.getFirstKey) === null || _delegate_getFirstKey2 === void 0 ? void 0 : _delegate_getFirstKey2.call(delegate, manager.focusedKey) : (_delegate_getLastKey2 = delegate.getLastKey) === null || _delegate_getLastKey2 === void 0 ? void 0 : _delegate_getLastKey2.call(delegate, manager.focusedKey);
1117
+ navigateToKey(nextKey, direction === "rtl" ? "first" : "last");
1118
+ }
1119
+ break;
1120
+ case "ArrowRight":
1121
+ if (delegate.getKeyRightOf) {
1122
+ var _delegate_getLastKey3, _delegate_getFirstKey3;
1123
+ e.preventDefault();
1124
+ let nextKey = delegate.getKeyRightOf(manager.focusedKey);
1125
+ if (nextKey == null && shouldFocusWrap) nextKey = direction === "rtl" ? (_delegate_getLastKey3 = delegate.getLastKey) === null || _delegate_getLastKey3 === void 0 ? void 0 : _delegate_getLastKey3.call(delegate, manager.focusedKey) : (_delegate_getFirstKey3 = delegate.getFirstKey) === null || _delegate_getFirstKey3 === void 0 ? void 0 : _delegate_getFirstKey3.call(delegate, manager.focusedKey);
1126
+ navigateToKey(nextKey, direction === "rtl" ? "last" : "first");
1127
+ }
1128
+ break;
1129
+ case "Home":
1130
+ if (delegate.getFirstKey) {
1131
+ e.preventDefault();
1132
+ let firstKey = delegate.getFirstKey(manager.focusedKey, $feb5ffebff200149$export$16792effe837dba3(e));
1133
+ manager.setFocusedKey(firstKey);
1134
+ if ($feb5ffebff200149$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(firstKey);
1135
+ else if (selectOnFocus) manager.replaceSelection(firstKey);
1136
+ }
1137
+ break;
1138
+ case "End":
1139
+ if (delegate.getLastKey) {
1140
+ e.preventDefault();
1141
+ let lastKey = delegate.getLastKey(manager.focusedKey, $feb5ffebff200149$export$16792effe837dba3(e));
1142
+ manager.setFocusedKey(lastKey);
1143
+ if ($feb5ffebff200149$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(lastKey);
1144
+ else if (selectOnFocus) manager.replaceSelection(lastKey);
1145
+ }
1146
+ break;
1147
+ case "PageDown":
1148
+ if (delegate.getKeyPageBelow) {
1149
+ e.preventDefault();
1150
+ let nextKey = delegate.getKeyPageBelow(manager.focusedKey);
1151
+ navigateToKey(nextKey);
1152
+ }
1153
+ break;
1154
+ case "PageUp":
1155
+ if (delegate.getKeyPageAbove) {
1156
+ e.preventDefault();
1157
+ let nextKey = delegate.getKeyPageAbove(manager.focusedKey);
1158
+ navigateToKey(nextKey);
910
1159
  }
911
- }
912
- function is(x, y) {
913
- return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
914
- }
915
- var objectIs = typeof Object.is === "function" ? Object.is : is;
916
- var useState2 = React.useState, useEffect2 = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue;
917
- var didWarnOld18Alpha = false;
918
- var didWarnUncachedGetSnapshot = false;
919
- function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
920
- {
921
- if (!didWarnOld18Alpha) {
922
- if (React.startTransition !== void 0) {
923
- didWarnOld18Alpha = true;
924
- error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.");
925
- }
926
- }
1160
+ break;
1161
+ case "a":
1162
+ if ($feb5ffebff200149$export$16792effe837dba3(e) && manager.selectionMode === "multiple" && disallowSelectAll !== true) {
1163
+ e.preventDefault();
1164
+ manager.selectAll();
927
1165
  }
928
- var value = getSnapshot();
929
- {
930
- if (!didWarnUncachedGetSnapshot) {
931
- var cachedValue = getSnapshot();
932
- if (!objectIs(value, cachedValue)) {
933
- error("The result of getSnapshot should be cached to avoid an infinite loop");
934
- didWarnUncachedGetSnapshot = true;
935
- }
936
- }
1166
+ break;
1167
+ case "Escape":
1168
+ if (!disallowEmptySelection && manager.selectedKeys.size !== 0) {
1169
+ e.stopPropagation();
1170
+ e.preventDefault();
1171
+ manager.clearSelection();
937
1172
  }
938
- var _useState = useState2({
939
- inst: {
940
- value,
941
- getSnapshot
942
- }
943
- }), inst = _useState[0].inst, forceUpdate = _useState[1];
944
- useLayoutEffect(function() {
945
- inst.value = value;
946
- inst.getSnapshot = getSnapshot;
947
- if (checkIfSnapshotChanged(inst)) {
948
- forceUpdate({
949
- inst
950
- });
951
- }
952
- }, [subscribe, value, getSnapshot]);
953
- useEffect2(function() {
954
- if (checkIfSnapshotChanged(inst)) {
955
- forceUpdate({
956
- inst
1173
+ break;
1174
+ case "Tab":
1175
+ if (!allowsTabNavigation) {
1176
+ if (e.shiftKey) ref.current.focus();
1177
+ else {
1178
+ let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(ref.current, {
1179
+ tabbable: true
957
1180
  });
1181
+ let next;
1182
+ let last;
1183
+ do {
1184
+ last = walker.lastChild();
1185
+ if (last) next = last;
1186
+ } while (last);
1187
+ if (next && !next.contains(document.activeElement)) $7215afc6de606d6b$export$de79e2c695e052f3(next);
958
1188
  }
959
- var handleStoreChange = function() {
960
- if (checkIfSnapshotChanged(inst)) {
961
- forceUpdate({
962
- inst
963
- });
964
- }
965
- };
966
- return subscribe(handleStoreChange);
967
- }, [subscribe]);
968
- useDebugValue(value);
969
- return value;
970
- }
971
- function checkIfSnapshotChanged(inst) {
972
- var latestGetSnapshot = inst.getSnapshot;
973
- var prevValue = inst.value;
974
- try {
975
- var nextValue = latestGetSnapshot();
976
- return !objectIs(prevValue, nextValue);
977
- } catch (error2) {
978
- return true;
1189
+ break;
979
1190
  }
1191
+ }
1192
+ };
1193
+ let scrollPos = useRef({
1194
+ top: 0,
1195
+ left: 0
1196
+ });
1197
+ $e9faafb641e167db$export$90fc3a17d93f704c(scrollRef, "scroll", isVirtualized ? null : () => {
1198
+ scrollPos.current = {
1199
+ top: scrollRef.current.scrollTop,
1200
+ left: scrollRef.current.scrollLeft
1201
+ };
1202
+ });
1203
+ let onFocus = (e) => {
1204
+ if (manager.isFocused) {
1205
+ if (!e.currentTarget.contains(e.target)) manager.setFocused(false);
1206
+ return;
1207
+ }
1208
+ if (!e.currentTarget.contains(e.target)) return;
1209
+ manager.setFocused(true);
1210
+ if (manager.focusedKey == null) {
1211
+ let navigateToFirstKey = (key) => {
1212
+ if (key != null) {
1213
+ manager.setFocusedKey(key);
1214
+ if (selectOnFocus) manager.replaceSelection(key);
1215
+ }
1216
+ };
1217
+ let relatedTarget = e.relatedTarget;
1218
+ var _manager_lastSelectedKey, _manager_firstSelectedKey;
1219
+ if (relatedTarget && e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING) navigateToFirstKey((_manager_lastSelectedKey = manager.lastSelectedKey) !== null && _manager_lastSelectedKey !== void 0 ? _manager_lastSelectedKey : delegate.getLastKey());
1220
+ else navigateToFirstKey((_manager_firstSelectedKey = manager.firstSelectedKey) !== null && _manager_firstSelectedKey !== void 0 ? _manager_firstSelectedKey : delegate.getFirstKey());
1221
+ } else if (!isVirtualized) {
1222
+ scrollRef.current.scrollTop = scrollPos.current.top;
1223
+ scrollRef.current.scrollLeft = scrollPos.current.left;
1224
+ }
1225
+ if (manager.focusedKey != null) {
1226
+ let element = scrollRef.current.querySelector(`[data-key="${CSS.escape(manager.focusedKey.toString())}"]`);
1227
+ if (element) {
1228
+ if (!element.contains(document.activeElement)) $7215afc6de606d6b$export$de79e2c695e052f3(element);
1229
+ let modality = $507fabe10e71c6fb$export$630ff653c5ada6a9();
1230
+ if (modality === "keyboard") $2f04cbc44ee30ce0$export$c826860796309d1b(element, {
1231
+ containingElement: ref.current
1232
+ });
980
1233
  }
981
- function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
982
- return getSnapshot();
983
- }
984
- var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
985
- var isServerEnvironment = !canUseDOM;
986
- var shim2 = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
987
- var useSyncExternalStore$2 = React.useSyncExternalStore !== void 0 ? React.useSyncExternalStore : shim2;
988
- useSyncExternalStoreShim_development.useSyncExternalStore = useSyncExternalStore$2;
989
- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
990
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
991
- }
992
- })();
993
- }
994
- return useSyncExternalStoreShim_development;
995
- }
996
- if (process.env.NODE_ENV === "production") {
997
- shim.exports = requireUseSyncExternalStoreShim_production_min();
998
- } else {
999
- shim.exports = requireUseSyncExternalStoreShim_development();
1000
- }
1001
- var shimExports = shim.exports;
1002
- class $7135fc7d473fd974$export$f5d856d854e74713 {
1003
- get childNodes() {
1004
- throw new Error("childNodes is not supported");
1005
- }
1006
- clone() {
1007
- let node = new $7135fc7d473fd974$export$f5d856d854e74713(this.type, this.key);
1008
- node.value = this.value;
1009
- node.level = this.level;
1010
- node.hasChildNodes = this.hasChildNodes;
1011
- node.rendered = this.rendered;
1012
- node.textValue = this.textValue;
1013
- node["aria-label"] = this["aria-label"];
1014
- node.index = this.index;
1015
- node.parentKey = this.parentKey;
1016
- node.prevKey = this.prevKey;
1017
- node.nextKey = this.nextKey;
1018
- node.firstChildKey = this.firstChildKey;
1019
- node.lastChildKey = this.lastChildKey;
1020
- node.props = this.props;
1021
- return node;
1022
- }
1023
- constructor(type, key) {
1024
- this.value = null;
1025
- this.level = 0;
1026
- this.hasChildNodes = false;
1027
- this.rendered = null;
1028
- this.textValue = "";
1029
- this["aria-label"] = void 0;
1030
- this.index = 0;
1031
- this.parentKey = null;
1032
- this.prevKey = null;
1033
- this.nextKey = null;
1034
- this.firstChildKey = null;
1035
- this.lastChildKey = null;
1036
- this.props = {};
1037
- this.type = type;
1038
- this.key = key;
1039
- }
1040
- }
1041
- class $7135fc7d473fd974$var$BaseNode {
1042
- *[Symbol.iterator]() {
1043
- let node = this.firstChild;
1044
- while (node) {
1045
- yield node;
1046
- node = node.nextSibling;
1047
1234
  }
1048
- }
1049
- get firstChild() {
1050
- return this._firstChild;
1051
- }
1052
- set firstChild(firstChild) {
1053
- this._firstChild = firstChild;
1054
- this.ownerDocument.markDirty(this);
1055
- }
1056
- get lastChild() {
1057
- return this._lastChild;
1058
- }
1059
- set lastChild(lastChild) {
1060
- this._lastChild = lastChild;
1061
- this.ownerDocument.markDirty(this);
1062
- }
1063
- get previousSibling() {
1064
- return this._previousSibling;
1065
- }
1066
- set previousSibling(previousSibling) {
1067
- this._previousSibling = previousSibling;
1068
- this.ownerDocument.markDirty(this);
1069
- }
1070
- get nextSibling() {
1071
- return this._nextSibling;
1072
- }
1073
- set nextSibling(nextSibling) {
1074
- this._nextSibling = nextSibling;
1075
- this.ownerDocument.markDirty(this);
1076
- }
1077
- get parentNode() {
1078
- return this._parentNode;
1079
- }
1080
- set parentNode(parentNode) {
1081
- this._parentNode = parentNode;
1082
- this.ownerDocument.markDirty(this);
1083
- }
1084
- get isConnected() {
1085
- var _this_parentNode;
1086
- return ((_this_parentNode = this.parentNode) === null || _this_parentNode === void 0 ? void 0 : _this_parentNode.isConnected) || false;
1087
- }
1088
- appendChild(child) {
1089
- this.ownerDocument.startTransaction();
1090
- if (child.parentNode) child.parentNode.removeChild(child);
1091
- if (this.firstChild == null) this.firstChild = child;
1092
- if (this.lastChild) {
1093
- this.lastChild.nextSibling = child;
1094
- child.index = this.lastChild.index + 1;
1095
- child.previousSibling = this.lastChild;
1096
- } else {
1097
- child.previousSibling = null;
1098
- child.index = 0;
1235
+ };
1236
+ let onBlur = (e) => {
1237
+ if (!e.currentTarget.contains(e.relatedTarget)) manager.setFocused(false);
1238
+ };
1239
+ const autoFocusRef = useRef(autoFocus);
1240
+ useEffect(() => {
1241
+ if (autoFocusRef.current) {
1242
+ let focusedKey = null;
1243
+ if (autoFocus === "first") focusedKey = delegate.getFirstKey();
1244
+ if (autoFocus === "last") focusedKey = delegate.getLastKey();
1245
+ let selectedKeys = manager.selectedKeys;
1246
+ if (selectedKeys.size) {
1247
+ for (let key of selectedKeys) if (manager.canSelectItem(key)) {
1248
+ focusedKey = key;
1249
+ break;
1250
+ }
1251
+ }
1252
+ manager.setFocused(true);
1253
+ manager.setFocusedKey(focusedKey);
1254
+ if (focusedKey == null && !shouldUseVirtualFocus) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
1099
1255
  }
1100
- child.parentNode = this;
1101
- child.nextSibling = null;
1102
- this.lastChild = child;
1103
- this.ownerDocument.markDirty(this);
1104
- if (child.hasSetProps)
1105
- this.ownerDocument.addNode(child);
1106
- this.ownerDocument.endTransaction();
1107
- this.ownerDocument.queueUpdate();
1108
- }
1109
- insertBefore(newNode, referenceNode) {
1110
- if (referenceNode == null) return this.appendChild(newNode);
1111
- this.ownerDocument.startTransaction();
1112
- if (newNode.parentNode) newNode.parentNode.removeChild(newNode);
1113
- newNode.nextSibling = referenceNode;
1114
- newNode.previousSibling = referenceNode.previousSibling;
1115
- newNode.index = referenceNode.index;
1116
- if (this.firstChild === referenceNode) this.firstChild = newNode;
1117
- else if (referenceNode.previousSibling) referenceNode.previousSibling.nextSibling = newNode;
1118
- referenceNode.previousSibling = newNode;
1119
- newNode.parentNode = referenceNode.parentNode;
1120
- let node = referenceNode;
1121
- while (node) {
1122
- node.index++;
1123
- node = node.nextSibling;
1256
+ }, []);
1257
+ let lastFocusedKey = useRef(manager.focusedKey);
1258
+ useEffect(() => {
1259
+ if (manager.isFocused && manager.focusedKey != null && (manager.focusedKey !== lastFocusedKey.current || autoFocusRef.current) && (scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current)) {
1260
+ let modality = $507fabe10e71c6fb$export$630ff653c5ada6a9();
1261
+ let element = ref.current.querySelector(`[data-key="${CSS.escape(manager.focusedKey.toString())}"]`);
1262
+ if (!element)
1263
+ return;
1264
+ if (modality === "keyboard" || autoFocusRef.current) {
1265
+ $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollRef.current, element);
1266
+ if (modality !== "virtual") $2f04cbc44ee30ce0$export$c826860796309d1b(element, {
1267
+ containingElement: ref.current
1268
+ });
1269
+ }
1124
1270
  }
1125
- if (newNode.hasSetProps) this.ownerDocument.addNode(newNode);
1126
- this.ownerDocument.endTransaction();
1127
- this.ownerDocument.queueUpdate();
1128
- }
1129
- removeChild(child) {
1130
- if (child.parentNode !== this) return;
1131
- this.ownerDocument.startTransaction();
1132
- let node = child.nextSibling;
1133
- while (node) {
1134
- node.index--;
1135
- node = node.nextSibling;
1271
+ if (manager.isFocused && manager.focusedKey == null && lastFocusedKey.current != null) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
1272
+ lastFocusedKey.current = manager.focusedKey;
1273
+ autoFocusRef.current = false;
1274
+ });
1275
+ $e9faafb641e167db$export$90fc3a17d93f704c(ref, "react-aria-focus-scope-restore", (e) => {
1276
+ e.preventDefault();
1277
+ manager.setFocused(true);
1278
+ });
1279
+ let handlers = {
1280
+ onKeyDown,
1281
+ onFocus,
1282
+ onBlur,
1283
+ onMouseDown(e) {
1284
+ if (scrollRef.current === e.target)
1285
+ e.preventDefault();
1136
1286
  }
1137
- if (child.nextSibling) child.nextSibling.previousSibling = child.previousSibling;
1138
- if (child.previousSibling) child.previousSibling.nextSibling = child.nextSibling;
1139
- if (this.firstChild === child) this.firstChild = child.nextSibling;
1140
- if (this.lastChild === child) this.lastChild = child.previousSibling;
1141
- child.parentNode = null;
1142
- child.nextSibling = null;
1143
- child.previousSibling = null;
1144
- child.index = 0;
1145
- this.ownerDocument.removeNode(child);
1146
- this.ownerDocument.endTransaction();
1147
- this.ownerDocument.queueUpdate();
1148
- }
1149
- addEventListener() {
1150
- }
1151
- removeEventListener() {
1152
- }
1153
- constructor(ownerDocument) {
1154
- this._firstChild = null;
1155
- this._lastChild = null;
1156
- this._previousSibling = null;
1157
- this._nextSibling = null;
1158
- this._parentNode = null;
1159
- this.ownerDocument = ownerDocument;
1160
- }
1287
+ };
1288
+ let { typeSelectProps } = $fb3050f43d946246$export$e32c88dfddc6e1d8({
1289
+ keyboardDelegate: delegate,
1290
+ selectionManager: manager
1291
+ });
1292
+ if (!disallowTypeAhead) handlers = $3ef42575df84b30b$export$9d1611c77c2fe928(typeSelectProps, handlers);
1293
+ let tabIndex;
1294
+ if (!shouldUseVirtualFocus) tabIndex = manager.focusedKey == null ? 0 : -1;
1295
+ return {
1296
+ collectionProps: {
1297
+ ...handlers,
1298
+ tabIndex
1299
+ }
1300
+ };
1161
1301
  }
1162
- class $7135fc7d473fd974$export$dc064fe9e59310fd extends $7135fc7d473fd974$var$BaseNode {
1163
- get index() {
1164
- return this._index;
1165
- }
1166
- set index(index) {
1167
- this._index = index;
1168
- this.ownerDocument.markDirty(this);
1169
- }
1170
- get level() {
1171
- if (this.parentNode instanceof $7135fc7d473fd974$export$dc064fe9e59310fd) return this.parentNode.level + (this.node.type === "item" ? 1 : 0);
1172
- return 0;
1173
- }
1174
- updateNode() {
1175
- var _this_previousSibling, _this_nextSibling, _this_firstChild, _this_lastChild;
1176
- let node = this.ownerDocument.getMutableNode(this);
1177
- node.index = this.index;
1178
- node.level = this.level;
1179
- node.parentKey = this.parentNode instanceof $7135fc7d473fd974$export$dc064fe9e59310fd ? this.parentNode.node.key : null;
1180
- var _this_previousSibling_node_key;
1181
- node.prevKey = (_this_previousSibling_node_key = (_this_previousSibling = this.previousSibling) === null || _this_previousSibling === void 0 ? void 0 : _this_previousSibling.node.key) !== null && _this_previousSibling_node_key !== void 0 ? _this_previousSibling_node_key : null;
1182
- var _this_nextSibling_node_key;
1183
- node.nextKey = (_this_nextSibling_node_key = (_this_nextSibling = this.nextSibling) === null || _this_nextSibling === void 0 ? void 0 : _this_nextSibling.node.key) !== null && _this_nextSibling_node_key !== void 0 ? _this_nextSibling_node_key : null;
1184
- node.hasChildNodes = !!this.firstChild;
1185
- var _this_firstChild_node_key;
1186
- node.firstChildKey = (_this_firstChild_node_key = (_this_firstChild = this.firstChild) === null || _this_firstChild === void 0 ? void 0 : _this_firstChild.node.key) !== null && _this_firstChild_node_key !== void 0 ? _this_firstChild_node_key : null;
1187
- var _this_lastChild_node_key;
1188
- node.lastChildKey = (_this_lastChild_node_key = (_this_lastChild = this.lastChild) === null || _this_lastChild === void 0 ? void 0 : _this_lastChild.node.key) !== null && _this_lastChild_node_key !== void 0 ? _this_lastChild_node_key : null;
1189
- }
1190
- setProps(obj, ref, rendered) {
1191
- let node = this.ownerDocument.getMutableNode(this);
1192
- let { value, textValue, id, ...props } = obj;
1193
- props.ref = ref;
1194
- node.props = props;
1195
- node.rendered = rendered;
1196
- node.value = value;
1197
- node.textValue = textValue || (typeof rendered === "string" ? rendered : "") || obj["aria-label"] || "";
1198
- if (id != null && id !== node.key) {
1199
- if (this.hasSetProps) throw new Error("Cannot change the id of an item");
1200
- node.key = id;
1302
+ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
1303
+ let { selectionManager: manager, key, ref, shouldSelectOnPressUp, shouldUseVirtualFocus, focus, isDisabled, onAction, allowsDifferentPressOrigin, linkBehavior = "action" } = options;
1304
+ let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
1305
+ let onSelect = (e) => {
1306
+ if (e.pointerType === "keyboard" && $feb5ffebff200149$export$d3e3bd3e26688c04(e)) manager.toggleSelection(key);
1307
+ else {
1308
+ if (manager.selectionMode === "none") return;
1309
+ if (manager.isLink(key)) {
1310
+ if (linkBehavior === "selection") {
1311
+ let itemProps2 = manager.getItemProps(key);
1312
+ router.open(ref.current, e, itemProps2.href, itemProps2.routerOptions);
1313
+ manager.setSelectedKeys(manager.selectedKeys);
1314
+ return;
1315
+ } else if (linkBehavior === "override" || linkBehavior === "none") return;
1316
+ }
1317
+ if (manager.selectionMode === "single") {
1318
+ if (manager.isSelected(key) && !manager.disallowEmptySelection) manager.toggleSelection(key);
1319
+ else manager.replaceSelection(key);
1320
+ } else if (e && e.shiftKey) manager.extendSelection(key);
1321
+ else if (manager.selectionBehavior === "toggle" || e && ($feb5ffebff200149$export$16792effe837dba3(e) || e.pointerType === "touch" || e.pointerType === "virtual"))
1322
+ manager.toggleSelection(key);
1323
+ else manager.replaceSelection(key);
1201
1324
  }
1202
- if (!this.hasSetProps) {
1203
- this.ownerDocument.addNode(this);
1204
- this.ownerDocument.endTransaction();
1205
- this.hasSetProps = true;
1325
+ };
1326
+ useEffect(() => {
1327
+ let isFocused = key === manager.focusedKey;
1328
+ if (isFocused && manager.isFocused && !shouldUseVirtualFocus) {
1329
+ if (focus) focus();
1330
+ else if (document.activeElement !== ref.current) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
1206
1331
  }
1207
- this.ownerDocument.queueUpdate();
1208
- }
1209
- get style() {
1210
- return {};
1211
- }
1212
- hasAttribute() {
1213
- }
1214
- setAttribute() {
1215
- }
1216
- setAttributeNS() {
1217
- }
1218
- removeAttribute() {
1219
- }
1220
- constructor(type, ownerDocument) {
1221
- super(ownerDocument);
1222
- this.nodeType = 8;
1223
- this._index = 0;
1224
- this.hasSetProps = false;
1225
- this.node = new $7135fc7d473fd974$export$f5d856d854e74713(type, `react-aria-${++ownerDocument.nodeId}`);
1226
- this.ownerDocument.startTransaction();
1227
- }
1228
- }
1229
- class $7135fc7d473fd974$export$408d25a4e12db025 {
1230
- get size() {
1231
- return this.keyMap.size;
1232
- }
1233
- getKeys() {
1234
- return this.keyMap.keys();
1235
- }
1236
- *[Symbol.iterator]() {
1237
- let node = this.firstKey != null ? this.keyMap.get(this.firstKey) : void 0;
1238
- while (node) {
1239
- yield node;
1240
- node = node.nextKey != null ? this.keyMap.get(node.nextKey) : void 0;
1332
+ }, [
1333
+ ref,
1334
+ key,
1335
+ manager.focusedKey,
1336
+ manager.childFocusStrategy,
1337
+ manager.isFocused,
1338
+ shouldUseVirtualFocus
1339
+ ]);
1340
+ isDisabled = isDisabled || manager.isDisabled(key);
1341
+ let itemProps = {};
1342
+ if (!shouldUseVirtualFocus && !isDisabled) itemProps = {
1343
+ tabIndex: key === manager.focusedKey ? 0 : -1,
1344
+ onFocus(e) {
1345
+ if (e.target === ref.current) manager.setFocusedKey(key);
1346
+ }
1347
+ };
1348
+ else if (isDisabled) itemProps.onMouseDown = (e) => {
1349
+ e.preventDefault();
1350
+ };
1351
+ let isLinkOverride = manager.isLink(key) && linkBehavior === "override";
1352
+ let hasLinkAction = manager.isLink(key) && linkBehavior !== "selection" && linkBehavior !== "none";
1353
+ let allowsSelection = !isDisabled && manager.canSelectItem(key) && !isLinkOverride;
1354
+ let allowsActions = (onAction || hasLinkAction) && !isDisabled;
1355
+ let hasPrimaryAction = allowsActions && (manager.selectionBehavior === "replace" ? !allowsSelection : !allowsSelection || manager.isEmpty);
1356
+ let hasSecondaryAction = allowsActions && allowsSelection && manager.selectionBehavior === "replace";
1357
+ let hasAction = hasPrimaryAction || hasSecondaryAction;
1358
+ let modality = useRef(null);
1359
+ let longPressEnabled = hasAction && allowsSelection;
1360
+ let longPressEnabledOnPressStart = useRef(false);
1361
+ let hadPrimaryActionOnPressStart = useRef(false);
1362
+ let performAction = (e) => {
1363
+ if (onAction) onAction();
1364
+ if (hasLinkAction) {
1365
+ let itemProps2 = manager.getItemProps(key);
1366
+ router.open(ref.current, e, itemProps2.href, itemProps2.routerOptions);
1367
+ }
1368
+ };
1369
+ let itemPressProps = {};
1370
+ if (shouldSelectOnPressUp) {
1371
+ itemPressProps.onPressStart = (e) => {
1372
+ modality.current = e.pointerType;
1373
+ longPressEnabledOnPressStart.current = longPressEnabled;
1374
+ if (e.pointerType === "keyboard" && (!hasAction || $880e95eb8b93ba9a$var$isSelectionKey())) onSelect(e);
1375
+ };
1376
+ if (!allowsDifferentPressOrigin) itemPressProps.onPress = (e) => {
1377
+ if (hasPrimaryAction || hasSecondaryAction && e.pointerType !== "mouse") {
1378
+ if (e.pointerType === "keyboard" && !$880e95eb8b93ba9a$var$isActionKey()) return;
1379
+ performAction(e);
1380
+ } else if (e.pointerType !== "keyboard" && allowsSelection) onSelect(e);
1381
+ };
1382
+ else {
1383
+ itemPressProps.onPressUp = hasPrimaryAction ? null : (e) => {
1384
+ if (e.pointerType !== "keyboard" && allowsSelection) onSelect(e);
1385
+ };
1386
+ itemPressProps.onPress = hasPrimaryAction ? performAction : null;
1241
1387
  }
1242
- }
1243
- getChildren(key) {
1244
- let keyMap = this.keyMap;
1245
- return {
1246
- *[Symbol.iterator]() {
1247
- let parent = keyMap.get(key);
1248
- let node = (parent === null || parent === void 0 ? void 0 : parent.firstChildKey) != null ? keyMap.get(parent.firstChildKey) : null;
1249
- while (node) {
1250
- yield node;
1251
- node = node.nextKey != null ? keyMap.get(node.nextKey) : void 0;
1252
- }
1388
+ } else {
1389
+ itemPressProps.onPressStart = (e) => {
1390
+ modality.current = e.pointerType;
1391
+ longPressEnabledOnPressStart.current = longPressEnabled;
1392
+ hadPrimaryActionOnPressStart.current = hasPrimaryAction;
1393
+ if (allowsSelection && (e.pointerType === "mouse" && !hasPrimaryAction || e.pointerType === "keyboard" && (!allowsActions || $880e95eb8b93ba9a$var$isSelectionKey()))) onSelect(e);
1394
+ };
1395
+ itemPressProps.onPress = (e) => {
1396
+ if (e.pointerType === "touch" || e.pointerType === "pen" || e.pointerType === "virtual" || e.pointerType === "keyboard" && hasAction && $880e95eb8b93ba9a$var$isActionKey() || e.pointerType === "mouse" && hadPrimaryActionOnPressStart.current) {
1397
+ if (hasAction) performAction(e);
1398
+ else if (allowsSelection) onSelect(e);
1253
1399
  }
1254
1400
  };
1255
1401
  }
1256
- getKeyBefore(key) {
1257
- let node = this.keyMap.get(key);
1258
- if (!node) return null;
1259
- if (node.prevKey != null) {
1260
- node = this.keyMap.get(node.prevKey);
1261
- while (node && node.type !== "item" && node.lastChildKey != null) node = this.keyMap.get(node.lastChildKey);
1262
- var _node_key;
1263
- return (_node_key = node === null || node === void 0 ? void 0 : node.key) !== null && _node_key !== void 0 ? _node_key : null;
1402
+ itemProps["data-key"] = key;
1403
+ itemPressProps.preventFocusOnPress = shouldUseVirtualFocus;
1404
+ let { pressProps, isPressed } = $f6c31cce2adf654f$export$45712eceda6fad21(itemPressProps);
1405
+ let onDoubleClick = hasSecondaryAction ? (e) => {
1406
+ if (modality.current === "mouse") {
1407
+ e.stopPropagation();
1408
+ e.preventDefault();
1409
+ performAction(e);
1264
1410
  }
1265
- return node.parentKey;
1266
- }
1267
- getKeyAfter(key) {
1268
- let node = this.keyMap.get(key);
1269
- if (!node) return null;
1270
- if (node.type !== "item" && node.firstChildKey != null) return node.firstChildKey;
1271
- while (node) {
1272
- if (node.nextKey != null) return node.nextKey;
1273
- if (node.parentKey != null) node = this.keyMap.get(node.parentKey);
1274
- else return null;
1411
+ } : void 0;
1412
+ let { longPressProps } = $8a26561d2877236e$export$c24ed0104d07eab9({
1413
+ isDisabled: !longPressEnabled,
1414
+ onLongPress(e) {
1415
+ if (e.pointerType === "touch") {
1416
+ onSelect(e);
1417
+ manager.setSelectionBehavior("toggle");
1418
+ }
1275
1419
  }
1276
- return null;
1277
- }
1278
- getFirstKey() {
1279
- return this.firstKey;
1280
- }
1281
- getLastKey() {
1282
- let node = this.lastKey != null ? this.keyMap.get(this.lastKey) : null;
1283
- while ((node === null || node === void 0 ? void 0 : node.lastChildKey) != null) node = this.keyMap.get(node.lastChildKey);
1284
- var _node_key;
1285
- return (_node_key = node === null || node === void 0 ? void 0 : node.key) !== null && _node_key !== void 0 ? _node_key : null;
1286
- }
1287
- getItem(key) {
1288
- var _this_keyMap_get;
1289
- return (_this_keyMap_get = this.keyMap.get(key)) !== null && _this_keyMap_get !== void 0 ? _this_keyMap_get : null;
1290
- }
1291
- at() {
1292
- throw new Error("Not implemented");
1293
- }
1294
- clone() {
1295
- let Constructor = this.constructor;
1296
- let collection = new Constructor();
1297
- collection.keyMap = new Map(this.keyMap);
1298
- collection.firstKey = this.firstKey;
1299
- collection.lastKey = this.lastKey;
1300
- return collection;
1301
- }
1302
- addNode(node) {
1303
- if (this.frozen) throw new Error("Cannot add a node to a frozen collection");
1304
- this.keyMap.set(node.key, node);
1305
- }
1306
- removeNode(key) {
1307
- if (this.frozen) throw new Error("Cannot remove a node to a frozen collection");
1308
- this.keyMap.delete(key);
1309
- }
1310
- commit(firstKey, lastKey, isSSR = false) {
1311
- if (this.frozen) throw new Error("Cannot commit a frozen collection");
1312
- this.firstKey = firstKey;
1313
- this.lastKey = lastKey;
1314
- this.frozen = !isSSR;
1315
- }
1316
- constructor() {
1317
- this.keyMap = /* @__PURE__ */ new Map();
1318
- this.firstKey = null;
1319
- this.lastKey = null;
1320
- this.frozen = false;
1321
- }
1420
+ });
1421
+ let onDragStartCapture = (e) => {
1422
+ if (modality.current === "touch" && longPressEnabledOnPressStart.current) e.preventDefault();
1423
+ };
1424
+ let onClick = manager.isLink(key) ? (e) => {
1425
+ if (!$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening) e.preventDefault();
1426
+ } : void 0;
1427
+ return {
1428
+ itemProps: $3ef42575df84b30b$export$9d1611c77c2fe928(itemProps, allowsSelection || hasPrimaryAction ? pressProps : {}, longPressEnabled ? longPressProps : {}, {
1429
+ onDoubleClick,
1430
+ onDragStartCapture,
1431
+ onClick
1432
+ }),
1433
+ isPressed,
1434
+ isSelected: manager.isSelected(key),
1435
+ isFocused: manager.isFocused && manager.focusedKey === key,
1436
+ isDisabled,
1437
+ allowsSelection,
1438
+ hasAction
1439
+ };
1322
1440
  }
1323
- class $7135fc7d473fd974$export$b34a105447964f9f extends $7135fc7d473fd974$var$BaseNode {
1324
- get isConnected() {
1325
- return true;
1326
- }
1327
- createElement(type) {
1328
- return new $7135fc7d473fd974$export$dc064fe9e59310fd(type, this);
1329
- }
1330
- /**
1331
- * Lazily gets a mutable instance of a Node. If the node has already
1332
- * been cloned during this update cycle, it just returns the existing one.
1333
- */
1334
- getMutableNode(element) {
1335
- let node = element.node;
1336
- if (!this.mutatedNodes.has(element)) {
1337
- node = element.node.clone();
1338
- this.mutatedNodes.add(element);
1339
- element.node = node;
1340
- }
1341
- this.markDirty(element);
1342
- return node;
1343
- }
1344
- getMutableCollection() {
1345
- if (!this.isSSR && !this.collectionMutated) {
1346
- this.collection = this.collection.clone();
1347
- this.collectionMutated = true;
1348
- }
1349
- return this.collection;
1350
- }
1351
- markDirty(node) {
1352
- this.dirtyNodes.add(node);
1353
- }
1354
- startTransaction() {
1355
- this.transactionCount++;
1356
- }
1357
- endTransaction() {
1358
- this.transactionCount--;
1359
- }
1360
- addNode(element) {
1361
- let collection = this.getMutableCollection();
1362
- if (!collection.getItem(element.node.key)) {
1363
- collection.addNode(element.node);
1364
- for (let child of element) this.addNode(child);
1365
- }
1366
- this.markDirty(element);
1367
- }
1368
- removeNode(node) {
1369
- for (let child of node) this.removeNode(child);
1370
- let collection = this.getMutableCollection();
1371
- collection.removeNode(node.node.key);
1372
- this.markDirty(node);
1373
- }
1374
- /** Finalizes the collection update, updating all nodes and freezing the collection. */
1375
- getCollection() {
1376
- if (this.transactionCount > 0) return this.collection;
1377
- this.updateCollection();
1378
- return this.collection;
1379
- }
1380
- updateCollection() {
1381
- for (let element of this.dirtyNodes) if (element instanceof $7135fc7d473fd974$export$dc064fe9e59310fd && element.isConnected) element.updateNode();
1382
- this.dirtyNodes.clear();
1383
- if (this.mutatedNodes.size || this.collectionMutated) {
1384
- var _this_firstChild, _this_lastChild;
1385
- let collection = this.getMutableCollection();
1386
- for (let element of this.mutatedNodes) if (element.isConnected) collection.addNode(element.node);
1387
- var _this_firstChild_node_key, _this_lastChild_node_key;
1388
- collection.commit((_this_firstChild_node_key = (_this_firstChild = this.firstChild) === null || _this_firstChild === void 0 ? void 0 : _this_firstChild.node.key) !== null && _this_firstChild_node_key !== void 0 ? _this_firstChild_node_key : null, (_this_lastChild_node_key = (_this_lastChild = this.lastChild) === null || _this_lastChild === void 0 ? void 0 : _this_lastChild.node.key) !== null && _this_lastChild_node_key !== void 0 ? _this_lastChild_node_key : null, this.isSSR);
1389
- this.mutatedNodes.clear();
1390
- }
1391
- this.collectionMutated = false;
1392
- }
1393
- queueUpdate() {
1394
- if (this.dirtyNodes.size === 0 || this.transactionCount > 0) return;
1395
- for (let fn of this.subscriptions) fn();
1396
- }
1397
- subscribe(fn) {
1398
- this.subscriptions.add(fn);
1399
- return () => this.subscriptions.delete(fn);
1441
+ function $880e95eb8b93ba9a$var$isActionKey() {
1442
+ let event = window.event;
1443
+ return (event === null || event === void 0 ? void 0 : event.key) === "Enter";
1444
+ }
1445
+ function $880e95eb8b93ba9a$var$isSelectionKey() {
1446
+ let event = window.event;
1447
+ return (event === null || event === void 0 ? void 0 : event.key) === " " || (event === null || event === void 0 ? void 0 : event.code) === "Space";
1448
+ }
1449
+ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
1450
+ build(props, context) {
1451
+ this.context = context;
1452
+ return $eb2240fc39a57fa5$var$iterable(() => this.iterateCollection(props));
1400
1453
  }
1401
- resetAfterSSR() {
1402
- if (this.isSSR) {
1403
- this.isSSR = false;
1404
- this.firstChild = null;
1405
- this.lastChild = null;
1406
- this.nodeId = 0;
1454
+ *iterateCollection(props) {
1455
+ let { children, items } = props;
1456
+ if (typeof children === "function") {
1457
+ if (!items) throw new Error("props.children was a function but props.items is missing");
1458
+ for (let item of props.items) yield* this.getFullNode({
1459
+ value: item
1460
+ }, {
1461
+ renderer: children
1462
+ });
1463
+ } else {
1464
+ let items2 = [];
1465
+ React__default.Children.forEach(children, (child) => {
1466
+ items2.push(child);
1467
+ });
1468
+ let index = 0;
1469
+ for (let item of items2) {
1470
+ let nodes = this.getFullNode({
1471
+ element: item,
1472
+ index
1473
+ }, {});
1474
+ for (let node of nodes) {
1475
+ index++;
1476
+ yield node;
1477
+ }
1478
+ }
1407
1479
  }
1408
1480
  }
1409
- constructor(collection) {
1410
- super(null);
1411
- this.nodeType = 11;
1412
- this.ownerDocument = this;
1413
- this.dirtyNodes = /* @__PURE__ */ new Set();
1414
- this.isSSR = false;
1415
- this.nodeId = 0;
1416
- this.nodesByProps = /* @__PURE__ */ new WeakMap();
1417
- this.mutatedNodes = /* @__PURE__ */ new Set();
1418
- this.subscriptions = /* @__PURE__ */ new Set();
1419
- this.transactionCount = 0;
1420
- this.collection = collection;
1421
- this.collectionMutated = true;
1481
+ getKey(item, partialNode, state, parentKey) {
1482
+ if (item.key != null) return item.key;
1483
+ if (partialNode.type === "cell" && partialNode.key != null) return `${parentKey}${partialNode.key}`;
1484
+ let v = partialNode.value;
1485
+ if (v != null) {
1486
+ var _v_key;
1487
+ let key = (_v_key = v.key) !== null && _v_key !== void 0 ? _v_key : v.id;
1488
+ if (key == null) throw new Error("No key found for item");
1489
+ return key;
1490
+ }
1491
+ return parentKey ? `${parentKey}.${partialNode.index}` : `$.${partialNode.index}`;
1422
1492
  }
1423
- }
1424
- function $7135fc7d473fd974$export$727c8fc270210f13(props) {
1425
- let { children, items, idScope, addIdAndValue, dependencies = [] } = props;
1426
- let cache = useMemo(() => /* @__PURE__ */ new WeakMap(), dependencies);
1427
- return useMemo(() => {
1428
- if (items && typeof children === "function") {
1429
- let res = [];
1430
- for (let item of items) {
1431
- let rendered = cache.get(item);
1432
- if (!rendered) {
1433
- rendered = children(item);
1434
- var _rendered_props_id, _ref;
1435
- let key = (_ref = (_rendered_props_id = rendered.props.id) !== null && _rendered_props_id !== void 0 ? _rendered_props_id : item.key) !== null && _ref !== void 0 ? _ref : item.id;
1436
- if (key == null) throw new Error("Could not determine key for item");
1437
- if (idScope) key = idScope + ":" + key;
1438
- rendered = /* @__PURE__ */ cloneElement(rendered, addIdAndValue ? {
1439
- key,
1440
- id: key,
1441
- value: item
1442
- } : {
1443
- key
1444
- });
1445
- cache.set(item, rendered);
1493
+ getChildState(state, partialNode) {
1494
+ return {
1495
+ renderer: partialNode.renderer || state.renderer
1496
+ };
1497
+ }
1498
+ *getFullNode(partialNode, state, parentKey, parentNode) {
1499
+ let element = partialNode.element;
1500
+ if (!element && partialNode.value && state && state.renderer) {
1501
+ let cached = this.cache.get(partialNode.value);
1502
+ if (cached && (!cached.shouldInvalidate || !cached.shouldInvalidate(this.context))) {
1503
+ cached.index = partialNode.index;
1504
+ cached.parentKey = parentNode ? parentNode.key : null;
1505
+ yield cached;
1506
+ return;
1507
+ }
1508
+ element = state.renderer(partialNode.value);
1509
+ }
1510
+ if (React__default.isValidElement(element)) {
1511
+ let type = element.type;
1512
+ if (typeof type !== "function" && typeof type.getCollectionNode !== "function") {
1513
+ let name = typeof element.type === "function" ? element.type.name : element.type;
1514
+ throw new Error(`Unknown element <${name}> in collection.`);
1515
+ }
1516
+ let childNodes = type.getCollectionNode(element.props, this.context);
1517
+ let index = partialNode.index;
1518
+ let result = childNodes.next();
1519
+ while (!result.done && result.value) {
1520
+ let childNode = result.value;
1521
+ partialNode.index = index;
1522
+ let nodeKey = childNode.key;
1523
+ if (!nodeKey) nodeKey = childNode.element ? null : this.getKey(element, partialNode, state, parentKey);
1524
+ let nodes = this.getFullNode({
1525
+ ...childNode,
1526
+ key: nodeKey,
1527
+ index,
1528
+ wrapper: $eb2240fc39a57fa5$var$compose(partialNode.wrapper, childNode.wrapper)
1529
+ }, this.getChildState(state, childNode), parentKey ? `${parentKey}${element.key}` : element.key, parentNode);
1530
+ let children = [
1531
+ ...nodes
1532
+ ];
1533
+ for (let node2 of children) {
1534
+ node2.value = childNode.value || partialNode.value;
1535
+ if (node2.value) this.cache.set(node2.value, node2);
1536
+ if (partialNode.type && node2.type !== partialNode.type) throw new Error(`Unsupported type <${$eb2240fc39a57fa5$var$capitalize(node2.type)}> in <${$eb2240fc39a57fa5$var$capitalize(parentNode.type)}>. Only <${$eb2240fc39a57fa5$var$capitalize(partialNode.type)}> is supported.`);
1537
+ index++;
1538
+ yield node2;
1446
1539
  }
1447
- res.push(rendered);
1540
+ result = childNodes.next(children);
1448
1541
  }
1449
- return res;
1450
- } else if (typeof children !== "function") return children;
1451
- }, [
1452
- children,
1453
- items,
1454
- cache,
1455
- idScope,
1456
- addIdAndValue
1457
- ]);
1458
- }
1459
- function $7135fc7d473fd974$export$901dbff4e54a6dd0(props) {
1460
- return $7135fc7d473fd974$export$727c8fc270210f13({
1461
- ...props,
1462
- addIdAndValue: true
1463
- });
1542
+ return;
1543
+ }
1544
+ if (partialNode.key == null) return;
1545
+ let builder = this;
1546
+ let node = {
1547
+ type: partialNode.type,
1548
+ props: partialNode.props,
1549
+ key: partialNode.key,
1550
+ parentKey: parentNode ? parentNode.key : null,
1551
+ value: partialNode.value,
1552
+ level: parentNode ? parentNode.level + 1 : 0,
1553
+ index: partialNode.index,
1554
+ rendered: partialNode.rendered,
1555
+ textValue: partialNode.textValue,
1556
+ "aria-label": partialNode["aria-label"],
1557
+ wrapper: partialNode.wrapper,
1558
+ shouldInvalidate: partialNode.shouldInvalidate,
1559
+ hasChildNodes: partialNode.hasChildNodes,
1560
+ childNodes: $eb2240fc39a57fa5$var$iterable(function* () {
1561
+ if (!partialNode.hasChildNodes) return;
1562
+ let index = 0;
1563
+ for (let child of partialNode.childNodes()) {
1564
+ if (child.key != null)
1565
+ child.key = `${node.key}${child.key}`;
1566
+ child.index = index;
1567
+ let nodes = builder.getFullNode(child, builder.getChildState(state, child), node.key, node);
1568
+ for (let node2 of nodes) {
1569
+ index++;
1570
+ yield node2;
1571
+ }
1572
+ }
1573
+ })
1574
+ };
1575
+ yield node;
1576
+ }
1577
+ constructor() {
1578
+ this.cache = /* @__PURE__ */ new WeakMap();
1579
+ }
1464
1580
  }
1465
- const $7135fc7d473fd974$var$ShallowRenderContext = /* @__PURE__ */ createContext(false);
1466
- function $7135fc7d473fd974$export$6cd28814d92fa9c9(props, initialCollection) {
1467
- let { collection, document: document2 } = $7135fc7d473fd974$export$7cd71aa5ddd6dc4e(initialCollection);
1468
- let portal = $7135fc7d473fd974$export$ad42d5efb4461b31(props, document2);
1581
+ function $eb2240fc39a57fa5$var$iterable(iterator) {
1582
+ let cache = [];
1583
+ let iterable = null;
1469
1584
  return {
1470
- portal,
1471
- collection
1585
+ *[Symbol.iterator]() {
1586
+ for (let item of cache) yield item;
1587
+ if (!iterable) iterable = iterator();
1588
+ for (let item of iterable) {
1589
+ cache.push(item);
1590
+ yield item;
1591
+ }
1592
+ }
1472
1593
  };
1473
1594
  }
1474
- function $7135fc7d473fd974$var$useSyncExternalStoreFallback(subscribe, getSnapshot, getServerSnapshot) {
1475
- let isSSR = $b5e257d569688ac6$export$535bd6ca7f90a273();
1476
- let isSSRRef = useRef(isSSR);
1477
- isSSRRef.current = isSSR;
1478
- let getSnapshotWrapper = useCallback(() => {
1479
- return isSSRRef.current ? getServerSnapshot() : getSnapshot();
1480
- }, [
1481
- getSnapshot,
1482
- getServerSnapshot
1483
- ]);
1484
- return shimExports.useSyncExternalStore(subscribe, getSnapshotWrapper);
1595
+ function $eb2240fc39a57fa5$var$compose(outer, inner) {
1596
+ if (outer && inner) return (element) => outer(inner(element));
1597
+ if (outer) return outer;
1598
+ if (inner) return inner;
1485
1599
  }
1486
- const $7135fc7d473fd974$var$useSyncExternalStore = typeof React__default["useSyncExternalStore"] === "function" ? React__default["useSyncExternalStore"] : $7135fc7d473fd974$var$useSyncExternalStoreFallback;
1487
- function $7135fc7d473fd974$export$7cd71aa5ddd6dc4e(initialCollection) {
1488
- let document2 = useMemo(() => new $7135fc7d473fd974$export$b34a105447964f9f(initialCollection || new $7135fc7d473fd974$export$408d25a4e12db025()), [
1489
- initialCollection
1490
- ]);
1491
- let subscribe = useCallback((fn) => document2.subscribe(fn), [
1492
- document2
1493
- ]);
1494
- let getSnapshot = useCallback(() => {
1495
- let collection2 = document2.getCollection();
1496
- if (document2.isSSR)
1497
- document2.resetAfterSSR();
1498
- return collection2;
1499
- }, [
1500
- document2
1501
- ]);
1502
- let getServerSnapshot = useCallback(() => {
1503
- document2.isSSR = true;
1504
- return document2.getCollection();
1600
+ function $eb2240fc39a57fa5$var$capitalize(str) {
1601
+ return str[0].toUpperCase() + str.slice(1);
1602
+ }
1603
+ function $7613b1592d41b092$export$6cd28814d92fa9c9(props, factory, context) {
1604
+ let builder = useMemo(() => new $eb2240fc39a57fa5$export$bf788dd355e3a401(), []);
1605
+ let { children, items, collection } = props;
1606
+ let result = useMemo(() => {
1607
+ if (collection) return collection;
1608
+ let nodes = builder.build({
1609
+ children,
1610
+ items
1611
+ }, context);
1612
+ return factory(nodes);
1505
1613
  }, [
1506
- document2
1507
- ]);
1508
- let collection = $7135fc7d473fd974$var$useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
1509
- return {
1614
+ builder,
1615
+ children,
1616
+ items,
1510
1617
  collection,
1511
- document: document2
1512
- };
1513
- }
1514
- const $7135fc7d473fd974$var$SSRContext = /* @__PURE__ */ createContext(null);
1515
- const $7135fc7d473fd974$export$8c25dea96356a8b6 = /* @__PURE__ */ createContext(null);
1516
- function $7135fc7d473fd974$export$ad42d5efb4461b31(props, document2) {
1517
- let ctx = useContext($7135fc7d473fd974$export$8c25dea96356a8b6);
1518
- let doc = document2 !== null && document2 !== void 0 ? document2 : ctx;
1519
- let children = $7135fc7d473fd974$export$901dbff4e54a6dd0(props);
1520
- let wrappedChildren = useMemo(() => /* @__PURE__ */ React__default.createElement($7135fc7d473fd974$var$ShallowRenderContext.Provider, {
1521
- value: true
1522
- }, children), [
1523
- children
1618
+ context,
1619
+ factory
1524
1620
  ]);
1525
- return $b5e257d569688ac6$export$535bd6ca7f90a273() ? /* @__PURE__ */ React__default.createElement($7135fc7d473fd974$var$SSRContext.Provider, {
1526
- value: doc
1527
- }, wrappedChildren) : /* @__PURE__ */ reactDomExports.createPortal(wrappedChildren, doc);
1621
+ return result;
1528
1622
  }
1529
- function $7135fc7d473fd974$export$813b5978dd974d8(props) {
1530
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, $7135fc7d473fd974$export$ad42d5efb4461b31(props));
1623
+ function $c5a24bc478652b5f$export$1005530eda016c13(node, collection) {
1624
+ if (typeof collection.getChildren === "function") return collection.getChildren(node.key);
1625
+ return node.childNodes;
1531
1626
  }
1532
- function $7135fc7d473fd974$export$aeba0b1fb3dcd8b8(type, props, ref) {
1533
- let isShallow = useContext($7135fc7d473fd974$var$ShallowRenderContext);
1534
- var _useSSRCollectionNode;
1535
- if (isShallow)
1536
- return (_useSSRCollectionNode = $7135fc7d473fd974$export$e7c29ae2353b16ea(type, props, ref, "children" in props ? props.children : null)) !== null && _useSSRCollectionNode !== void 0 ? _useSSRCollectionNode : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null);
1537
- return null;
1627
+ function $c5a24bc478652b5f$export$fbdeaa6a76694f71(iterable) {
1628
+ return $c5a24bc478652b5f$export$5f3398f8733f90e2(iterable);
1538
1629
  }
1539
- function $7135fc7d473fd974$export$636783d3732b5559(props, ref, rendered) {
1540
- return useCallback((element) => {
1541
- element === null || element === void 0 ? void 0 : element.setProps(props, ref, rendered);
1542
- }, [
1543
- props,
1544
- ref,
1545
- rendered
1546
- ]);
1630
+ function $c5a24bc478652b5f$export$5f3398f8733f90e2(iterable, index) {
1631
+ for (let item of iterable) {
1632
+ return item;
1633
+ }
1547
1634
  }
1548
- function $7135fc7d473fd974$export$e7c29ae2353b16ea(Type, props, ref, rendered, children) {
1549
- let itemRef = $7135fc7d473fd974$export$636783d3732b5559(props, ref, rendered);
1550
- let parentNode = useContext($7135fc7d473fd974$var$SSRContext);
1551
- if (parentNode) {
1552
- let element = parentNode.ownerDocument.nodesByProps.get(props);
1553
- if (!element) {
1554
- element = parentNode.ownerDocument.createElement(Type);
1555
- element.setProps(props, ref, rendered);
1556
- parentNode.appendChild(element);
1557
- parentNode.ownerDocument.updateCollection();
1558
- parentNode.ownerDocument.nodesByProps.set(props, element);
1559
- }
1560
- return children ? /* @__PURE__ */ React__default.createElement($7135fc7d473fd974$var$SSRContext.Provider, {
1561
- value: element
1562
- }, children) : null;
1635
+ function $c5a24bc478652b5f$export$7475b2c64539e4cf(iterable) {
1636
+ let lastItem = void 0;
1637
+ for (let value of iterable) lastItem = value;
1638
+ return lastItem;
1639
+ }
1640
+ function $c5a24bc478652b5f$export$8c434b3a7a4dad6(collection, a, b) {
1641
+ if (a.parentKey === b.parentKey) return a.index - b.index;
1642
+ let aAncestors = [
1643
+ ...$c5a24bc478652b5f$var$getAncestors(collection, a),
1644
+ a
1645
+ ];
1646
+ let bAncestors = [
1647
+ ...$c5a24bc478652b5f$var$getAncestors(collection, b),
1648
+ b
1649
+ ];
1650
+ let firstNonMatchingAncestor = aAncestors.slice(0, bAncestors.length).findIndex((a2, i) => a2 !== bAncestors[i]);
1651
+ if (firstNonMatchingAncestor !== -1) {
1652
+ a = aAncestors[firstNonMatchingAncestor];
1653
+ b = bAncestors[firstNonMatchingAncestor];
1654
+ return a.index - b.index;
1563
1655
  }
1564
- return /* @__PURE__ */ React__default.createElement(Type, {
1565
- ref: itemRef
1566
- }, children);
1656
+ if (aAncestors.findIndex((node) => node === b) >= 0) return 1;
1657
+ else if (bAncestors.findIndex((node) => node === a) >= 0) return -1;
1658
+ return -1;
1567
1659
  }
1568
- function $7135fc7d473fd974$var$Section(props, ref) {
1569
- let children = $7135fc7d473fd974$export$901dbff4e54a6dd0(props);
1570
- return $7135fc7d473fd974$export$e7c29ae2353b16ea("section", props, ref, null, children);
1660
+ function $c5a24bc478652b5f$var$getAncestors(collection, node) {
1661
+ let parents = [];
1662
+ while ((node === null || node === void 0 ? void 0 : node.parentKey) != null) {
1663
+ node = collection.getItem(node.parentKey);
1664
+ parents.unshift(node);
1665
+ }
1666
+ return parents;
1571
1667
  }
1572
- const $7135fc7d473fd974$export$6e2c8f0811a474ce = /* @__PURE__ */ forwardRef($7135fc7d473fd974$var$Section);
1573
1668
  class $e40ea825a81a3709$export$52baac22726c72bf extends Set {
1574
1669
  constructor(keys, anchorKey, currentKey) {
1575
1670
  super(keys);
@@ -1869,7 +1964,7 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
1869
1964
  getSelectAllKeys() {
1870
1965
  let keys = [];
1871
1966
  let addKeys = (key) => {
1872
- while (key) {
1967
+ while (key != null) {
1873
1968
  if (this.canSelectItem(key)) {
1874
1969
  let item = this.collection.getItem(key);
1875
1970
  if (item.type === "item") keys.push(key);
@@ -1955,19 +2050,20 @@ export {
1955
2050
  $7af3f5b51489e0b5$export$253fe78d46329472 as $,
1956
2051
  $7613b1592d41b092$export$6cd28814d92fa9c9 as a,
1957
2052
  $d496c0a20b6e58ec$export$6c8a5aaad13c9852 as b,
1958
- $ae20dd8cbca75726$export$d6daf82dcd84e87c as c,
1959
- $c5a24bc478652b5f$export$1005530eda016c13 as d,
1960
- $7135fc7d473fd974$export$aeba0b1fb3dcd8b8 as e,
1961
- $880e95eb8b93ba9a$export$ecf600387e221c37 as f,
1962
- $7135fc7d473fd974$export$7cd71aa5ddd6dc4e as g,
1963
- $7135fc7d473fd974$export$8c25dea96356a8b6 as h,
1964
- $7135fc7d473fd974$export$813b5978dd974d8 as i,
1965
- $7135fc7d473fd974$export$e7c29ae2353b16ea as j,
1966
- $ef06256079686ba0$export$f8aeda7b10753fa1 as k,
1967
- $c5a24bc478652b5f$export$7475b2c64539e4cf as l,
1968
- $2f04cbc44ee30ce0$export$c826860796309d1b as m,
1969
- $7135fc7d473fd974$export$6cd28814d92fa9c9 as n,
1970
- $7135fc7d473fd974$export$727c8fc270210f13 as o,
1971
- $8a26561d2877236e$export$c24ed0104d07eab9 as p,
1972
- $7135fc7d473fd974$export$6e2c8f0811a474ce as q
2053
+ $880e95eb8b93ba9a$export$ecf600387e221c37 as c,
2054
+ $e1995378a142960e$export$18af5c7a9e9b3664 as d,
2055
+ $e1995378a142960e$export$bf788dd355e3a401 as e,
2056
+ $e1995378a142960e$export$fb8073518f34e6ec as f,
2057
+ $7135fc7d473fd974$export$4feb769f8ddf26c5 as g,
2058
+ $7135fc7d473fd974$export$d40e14dec8b060a8 as h,
2059
+ $ae20dd8cbca75726$export$d6daf82dcd84e87c as i,
2060
+ $7135fc7d473fd974$export$90e00781bc59d8f9 as j,
2061
+ $c5a24bc478652b5f$export$1005530eda016c13 as k,
2062
+ $e1995378a142960e$export$e953bb1cd0f19726 as l,
2063
+ $7135fc7d473fd974$export$6e2c8f0811a474ce as m,
2064
+ $8a26561d2877236e$export$c24ed0104d07eab9 as n,
2065
+ $ef06256079686ba0$export$f8aeda7b10753fa1 as o,
2066
+ $c5a24bc478652b5f$export$7475b2c64539e4cf as p,
2067
+ $2f04cbc44ee30ce0$export$c826860796309d1b as q,
2068
+ $7135fc7d473fd974$export$a164736487e3f0ae as r
1973
2069
  };