react-virtuoso 2.2.6-beta.0 → 2.2.6-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/List.d.ts +10 -10
- package/dist/__examples.cc6a8f9f.js +4 -6
- package/dist/__examples.cc6a8f9f.js.map +1 -1
- package/dist/__examples.js +1 -1
- package/dist/align-to-bottom.7fcd2087.js +1 -1
- package/dist/alignToBottomSystem.d.ts +1 -1
- package/dist/auto-prepend-items.bd7e9b90.js +1 -1
- package/dist/benchmark.66d31485.js +1 -1
- package/dist/chat.d4f93b8b.js +1 -1
- package/dist/custom-components.5aeaa7ef.js +1 -1
- package/dist/custom-scroller.b0240d14.js +1 -1
- package/dist/data.26707046.js +1 -1
- package/dist/decrease-items.e2211e50.js +1 -1
- package/dist/default-item-height.b77ada36.js +1 -1
- package/dist/empty-placeholder.00607a6e.js +1 -1
- package/dist/end-reached.8531e5b1.js +1 -1
- package/dist/endless-scrolling.bc4101f0.js +1 -1
- package/dist/expandable-cards.5439f51b.js +1 -1
- package/dist/follow-output.4e36fca8.js +1 -1
- package/dist/followOutputSystem.d.ts +1 -1
- package/dist/grid-optimize-rendering.b49e36f5.js +1 -1
- package/dist/grid.d5d77b6a.js +1 -1
- package/dist/grouped-endless-scrolling.24985a0f.js +1 -1
- package/dist/grouped-load-more.bce8f6e4.js +1 -1
- package/dist/grouped-topmost-item.34960f5e.js +1 -1
- package/dist/grouped.a2908632.js +1 -1
- package/dist/header-footer.49733d45.js +1 -1
- package/dist/hello.54765c26.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.m.js +1 -1
- package/dist/index.m.js.map +1 -1
- package/dist/initial-from-zero.22ad1626.js +1 -1
- package/dist/initial-scroll-top.90db1920.js +1 -1
- package/dist/initial-topmost-item-default-height.43a95247.js +1 -1
- package/dist/initial-topmost-item.61c0e169.js +6 -4
- package/dist/initial-topmost-item.61c0e169.js.map +1 -1
- package/dist/initialItemCountSystem.d.ts +1 -1
- package/dist/initialScrollTopSystem.d.ts +1 -1
- package/dist/initialTopMostItemIndexSystem.d.ts +1 -1
- package/dist/listStateSystem.d.ts +1 -1
- package/dist/listSystem.d.ts +10 -10
- package/dist/long-last-item.b56ff89c.js +1 -1
- package/dist/prepend-items.f2bda34b.js +1 -1
- package/dist/prepend-last-tall-item.168a9e65.js +1 -1
- package/dist/react-beautiful-dnd-window-scroller.0a227511.js +1 -1
- package/dist/react-beautiful-dnd.817e9251.js +1 -1
- package/dist/rerender.ddd61b7c.js +1 -1
- package/dist/resize-loop.309b1dac.js +1 -1
- package/dist/resizing-items.c09b5e1b.js +1 -1
- package/dist/scroll-into-view.39b77fe9.js +1 -1
- package/dist/scroll-seek-placeholder.69fb85c6.js +1 -1
- package/dist/scroll-to-index.e72249cf.js +1 -1
- package/dist/scrollIntoViewSystem.d.ts +1 -1
- package/dist/ssr.8f31b042.js +1 -1
- package/dist/start-reached.2990ece7.js +1 -1
- package/dist/tall-item-reverse-scrolling.58bcd140.js +1 -1
- package/dist/test-case-446.dce9595c.js +1 -1
- package/dist/test-case-460.6d75ad1f.js +3 -4
- package/dist/test-case-460.6d75ad1f.js.map +1 -1
- package/dist/test-case-463.525f34ba.js +1 -1
- package/dist/toggle-display-grouped.4f4ae058.js +1 -1
- package/dist/top-items.f724bf61.js +1 -1
- package/dist/topItemCountSystem.d.ts +1 -1
- package/dist/totalListHeightSystem.d.ts +1 -1
- package/dist/upward-scroll.d49e0815.js +1 -1
- package/dist/upwardScrollFixSystem.d.ts +1 -1
- package/dist/window-grid.b22094fd.js +1 -1
- package/dist/window-scroller.a979c6d6.js +1 -1
- package/package.json +1 -1
package/dist/__examples.js
CHANGED
|
@@ -212,7 +212,7 @@ var parent = module.bundle.parent;
|
|
|
212
212
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
213
213
|
var hostname = "" || location.hostname;
|
|
214
214
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
215
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
215
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
216
216
|
|
|
217
217
|
ws.onmessage = function (event) {
|
|
218
218
|
checkedAssets = {};
|
|
@@ -221,7 +221,7 @@ var parent = module.bundle.parent;
|
|
|
221
221
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
222
222
|
var hostname = "" || location.hostname;
|
|
223
223
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
224
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
224
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
225
225
|
|
|
226
226
|
ws.onmessage = function (event) {
|
|
227
227
|
checkedAssets = {};
|
|
@@ -231,7 +231,7 @@ export declare const alignToBottomSystem: u.SystemSpec<[u.SystemSpec<never[], ()
|
|
|
231
231
|
}]) => {
|
|
232
232
|
propsReady: u.StatefulStream<boolean>;
|
|
233
233
|
didMount: u.Stream<boolean>;
|
|
234
|
-
}>], ([{ sizes, listRefresh, defaultItemSize }, { scrollToIndex
|
|
234
|
+
}>], ([{ sizes, listRefresh, defaultItemSize }, { scrollToIndex }, { didMount }]: [{
|
|
235
235
|
data: u.StatefulStream<import("./sizeSystem").Data>;
|
|
236
236
|
totalCount: u.Stream<number>;
|
|
237
237
|
sizeRanges: u.Stream<import("./sizeSystem").SizeRange[]>;
|
|
@@ -288,7 +288,7 @@ var parent = module.bundle.parent;
|
|
|
288
288
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
289
289
|
var hostname = "" || location.hostname;
|
|
290
290
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
291
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
291
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
292
292
|
|
|
293
293
|
ws.onmessage = function (event) {
|
|
294
294
|
checkedAssets = {};
|
|
@@ -186,7 +186,7 @@ var parent = module.bundle.parent;
|
|
|
186
186
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
187
187
|
var hostname = "" || location.hostname;
|
|
188
188
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
189
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
189
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
190
190
|
|
|
191
191
|
ws.onmessage = function (event) {
|
|
192
192
|
checkedAssets = {};
|
package/dist/chat.d4f93b8b.js
CHANGED
|
@@ -390,7 +390,7 @@ var parent = module.bundle.parent;
|
|
|
390
390
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
391
391
|
var hostname = "" || location.hostname;
|
|
392
392
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
393
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
393
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
394
394
|
|
|
395
395
|
ws.onmessage = function (event) {
|
|
396
396
|
checkedAssets = {};
|
|
@@ -227,7 +227,7 @@ var parent = module.bundle.parent;
|
|
|
227
227
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
228
228
|
var hostname = "" || location.hostname;
|
|
229
229
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
230
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
230
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
231
231
|
|
|
232
232
|
ws.onmessage = function (event) {
|
|
233
233
|
checkedAssets = {};
|
|
@@ -205,7 +205,7 @@ var parent = module.bundle.parent;
|
|
|
205
205
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
206
206
|
var hostname = "" || location.hostname;
|
|
207
207
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
208
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
208
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
209
209
|
|
|
210
210
|
ws.onmessage = function (event) {
|
|
211
211
|
checkedAssets = {};
|
package/dist/data.26707046.js
CHANGED
|
@@ -211,7 +211,7 @@ var parent = module.bundle.parent;
|
|
|
211
211
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
212
212
|
var hostname = "" || location.hostname;
|
|
213
213
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
214
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
214
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
215
215
|
|
|
216
216
|
ws.onmessage = function (event) {
|
|
217
217
|
checkedAssets = {};
|
|
@@ -205,7 +205,7 @@ var parent = module.bundle.parent;
|
|
|
205
205
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
206
206
|
var hostname = "" || location.hostname;
|
|
207
207
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
208
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
208
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
209
209
|
|
|
210
210
|
ws.onmessage = function (event) {
|
|
211
211
|
checkedAssets = {};
|
|
@@ -180,7 +180,7 @@ var parent = module.bundle.parent;
|
|
|
180
180
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
181
181
|
var hostname = "" || location.hostname;
|
|
182
182
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
183
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
183
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
184
184
|
|
|
185
185
|
ws.onmessage = function (event) {
|
|
186
186
|
checkedAssets = {};
|
|
@@ -210,7 +210,7 @@ var parent = module.bundle.parent;
|
|
|
210
210
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
211
211
|
var hostname = "" || location.hostname;
|
|
212
212
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
213
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
213
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
214
214
|
|
|
215
215
|
ws.onmessage = function (event) {
|
|
216
216
|
checkedAssets = {};
|
|
@@ -224,7 +224,7 @@ var parent = module.bundle.parent;
|
|
|
224
224
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
225
225
|
var hostname = "" || location.hostname;
|
|
226
226
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
227
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
227
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
228
228
|
|
|
229
229
|
ws.onmessage = function (event) {
|
|
230
230
|
checkedAssets = {};
|
|
@@ -230,7 +230,7 @@ var parent = module.bundle.parent;
|
|
|
230
230
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
231
231
|
var hostname = "" || location.hostname;
|
|
232
232
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
233
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
233
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
234
234
|
|
|
235
235
|
ws.onmessage = function (event) {
|
|
236
236
|
checkedAssets = {};
|
|
@@ -247,7 +247,7 @@ var parent = module.bundle.parent;
|
|
|
247
247
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
248
248
|
var hostname = "" || location.hostname;
|
|
249
249
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
250
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
250
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
251
251
|
|
|
252
252
|
ws.onmessage = function (event) {
|
|
253
253
|
checkedAssets = {};
|
|
@@ -250,7 +250,7 @@ var parent = module.bundle.parent;
|
|
|
250
250
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
251
251
|
var hostname = "" || location.hostname;
|
|
252
252
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
253
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
253
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
254
254
|
|
|
255
255
|
ws.onmessage = function (event) {
|
|
256
256
|
checkedAssets = {};
|
|
@@ -218,7 +218,7 @@ export declare const followOutputSystem: u.SystemSpec<[u.SystemSpec<[u.SystemSpe
|
|
|
218
218
|
}]) => {
|
|
219
219
|
propsReady: u.StatefulStream<boolean>;
|
|
220
220
|
didMount: u.Stream<boolean>;
|
|
221
|
-
}>], ([{ sizes, listRefresh, defaultItemSize }, { scrollToIndex
|
|
221
|
+
}>], ([{ sizes, listRefresh, defaultItemSize }, { scrollToIndex }, { didMount }]: [{
|
|
222
222
|
data: u.StatefulStream<import("./sizeSystem").Data>;
|
|
223
223
|
totalCount: u.Stream<number>;
|
|
224
224
|
sizeRanges: u.Stream<import("./sizeSystem").SizeRange[]>;
|
|
@@ -272,7 +272,7 @@ var parent = module.bundle.parent;
|
|
|
272
272
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
273
273
|
var hostname = "" || location.hostname;
|
|
274
274
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
275
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
275
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
276
276
|
|
|
277
277
|
ws.onmessage = function (event) {
|
|
278
278
|
checkedAssets = {};
|
package/dist/grid.d5d77b6a.js
CHANGED
|
@@ -269,7 +269,7 @@ var parent = module.bundle.parent;
|
|
|
269
269
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
270
270
|
var hostname = "" || location.hostname;
|
|
271
271
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
272
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
272
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
273
273
|
|
|
274
274
|
ws.onmessage = function (event) {
|
|
275
275
|
checkedAssets = {};
|
|
@@ -326,7 +326,7 @@ var parent = module.bundle.parent;
|
|
|
326
326
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
327
327
|
var hostname = "" || location.hostname;
|
|
328
328
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
329
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
329
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
330
330
|
|
|
331
331
|
ws.onmessage = function (event) {
|
|
332
332
|
checkedAssets = {};
|
|
@@ -325,7 +325,7 @@ var parent = module.bundle.parent;
|
|
|
325
325
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
326
326
|
var hostname = "" || location.hostname;
|
|
327
327
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
328
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
328
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
329
329
|
|
|
330
330
|
ws.onmessage = function (event) {
|
|
331
331
|
checkedAssets = {};
|
|
@@ -186,7 +186,7 @@ var parent = module.bundle.parent;
|
|
|
186
186
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
187
187
|
var hostname = "" || location.hostname;
|
|
188
188
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
189
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
189
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
190
190
|
|
|
191
191
|
ws.onmessage = function (event) {
|
|
192
192
|
checkedAssets = {};
|
package/dist/grouped.a2908632.js
CHANGED
|
@@ -185,7 +185,7 @@ var parent = module.bundle.parent;
|
|
|
185
185
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
186
186
|
var hostname = "" || location.hostname;
|
|
187
187
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
188
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
188
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
189
189
|
|
|
190
190
|
ws.onmessage = function (event) {
|
|
191
191
|
checkedAssets = {};
|
|
@@ -196,7 +196,7 @@ var parent = module.bundle.parent;
|
|
|
196
196
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
197
197
|
var hostname = "" || location.hostname;
|
|
198
198
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
199
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
199
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
200
200
|
|
|
201
201
|
ws.onmessage = function (event) {
|
|
202
202
|
checkedAssets = {};
|
package/dist/hello.54765c26.js
CHANGED
|
@@ -180,7 +180,7 @@ var parent = module.bundle.parent;
|
|
|
180
180
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
181
181
|
var hostname = "" || location.hostname;
|
|
182
182
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
183
|
-
var ws = new WebSocket(protocol + '://' + hostname + ':' + "
|
|
183
|
+
var ws = new WebSocket(protocol + '://' + hostname + ':' + "60851" + '/');
|
|
184
184
|
|
|
185
185
|
ws.onmessage = function (event) {
|
|
186
186
|
checkedAssets = {};
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("@virtuoso.dev/react-urx"),t=require("@virtuoso.dev/urx"),n=require("react");function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function o(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function a(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function s(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}function l(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}var u,c,m="up",f=t.system(function(){var e=t.stream(),n=t.statefulStream(0),r=t.stream(),o=t.statefulStream(0),i=t.stream(),a=t.statefulStream(0),s=t.statefulStream(0),l=t.stream(),u=t.stream(),c=t.statefulStream(!1);t.connect(e,o);var f=t.statefulStream("down");return t.connect(t.pipe(e,t.scan(function(e,t){return{direction:t<e.prevScrollTop?m:"down",prevScrollTop:t}},{direction:"down",prevScrollTop:0}),t.map(function(e){return e.direction})),f),{scrollTop:e,viewportHeight:i,headerHeight:a,footerHeight:s,smoothScrollTargetReached:r,scrollTo:l,scrollBy:u,scrollDirection:f,statefulScrollTop:o,deviation:n,scrollingInProgress:c}},[],{singleton:!0});(c=exports.LogLevel||(exports.LogLevel={}))[c.DEBUG=0]="DEBUG",c[c.INFO=1]="INFO",c[c.WARN=2]="WARN",c[c.ERROR=3]="ERROR";var d=((u={})[exports.LogLevel.DEBUG]="debug",u[exports.LogLevel.INFO]="log",u[exports.LogLevel.WARN]="warn",u[exports.LogLevel.ERROR]="error",u),p=t.system(function(){var e=t.statefulStream(exports.LogLevel.ERROR);return{log:t.statefulStream(function(n,r,o){var i;void 0===o&&(o=exports.LogLevel.INFO),o>=(null!=(i=(globalThis||window).VIRTUOSO_LOG_LEVEL)?i:t.getValue(e))&&console[d[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: black",n,r)}),logLevel:e}},[],{singleton:!0}),h=t.system(function(e){var n=e[0].log,r=t.statefulStream(!1),o=t.streamFromEmitter(t.pipe(r,t.filter(function(e){return e}),t.distinctUntilChanged()));return t.subscribe(r,function(e){e&&t.getValue(n)("props updated",{},exports.LogLevel.DEBUG)}),{propsReady:r,didMount:o}},t.tup(p),{singleton:!0}),g={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,totalHeight:0}},v=t.system(function(e){var n=e[0],r=n.scrollTop,o=n.viewportHeight,i=n.headerHeight,a=n.footerHeight,s=t.statefulStream(!1),l=t.statefulStream(!0),u=t.stream(),c=t.stream(),m=t.stream(),f=t.streamFromEmitter(t.pipe(t.merge(t.pipe(t.duc(r),t.skip(1),t.mapTo(!0)),t.pipe(t.duc(r),t.skip(1),t.mapTo(!1),t.debounceTime(100))),t.distinctUntilChanged()));t.connect(t.pipe(t.duc(r),t.map(function(e){return 0===e}),t.distinctUntilChanged()),l),t.connect(l,c);var d=t.streamFromEmitter(t.pipe(t.combineLatest(m,t.duc(r),t.duc(o),t.duc(i),t.duc(a)),t.scan(function(e,t){var n=t[0],r=n.bottom,o=n.offsetBottom,i=t[1],a=t[2],s={viewportHeight:a,scrollTop:i,offsetBottom:o,totalHeight:r+o};return 0===o&&i+a-(r+t[3]+t[4])>-4?{atBottom:!0,state:s}:{atBottom:!1,notAtBottomBecause:s.totalHeight>e.state.totalHeight?"SIZE_INCREASED":0!==o?"NOT_SHOWING_LAST_ITEM":a<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":i<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",state:s}},g),t.distinctUntilChanged(function(e,t){return e&&e.atBottom===t.atBottom})));return t.connect(t.pipe(d,t.map(function(e){return e.atBottom})),s),t.subscribe(s,function(e){setTimeout(function(){return t.publish(u,e)})}),{isScrolling:f,isAtTop:l,isAtBottom:s,atBottomState:d,atTopStateChange:c,atBottomStateChange:u,listStateListener:m}},t.tup(f)),I=t.system(function(e){var n=e[0].scrollTop,r=e[1].isScrolling,o=t.statefulStream(0),i=t.statefulStream(!1),a=t.stream(),s=t.statefulStream(!1);return t.connect(t.pipe(r,t.filter(function(e){return!e}),t.mapTo(0)),o),t.connect(t.pipe(n,t.throttleTime(100),t.withLatestFrom(r),t.filter(function(e){return!!e[1]}),t.scan(function(e,t){return[e[1],t[0]]},[0,0]),t.map(function(e){return e[1]-e[0]})),o),t.connect(t.pipe(o,t.withLatestFrom(s,i,a),t.filter(function(e){return!!e[1]}),t.map(function(e){var t=e[0],n=e[1],r=e[2],o=e[3],i=n.enter;if(r){if((0,n.exit)(t,o))return!1}else if(i(t,o))return!0;return r}),t.distinctUntilChanged()),i),t.subscribe(t.pipe(t.combineLatest(i,o,a),t.withLatestFrom(s)),function(e){var t=e[0],n=e[1];return t[0]&&n&&n.change&&n.change(t[1],t[2])}),{isSeeking:i,scrollSeekConfiguration:s,scrollVelocity:o,scrollSeekRangeChanged:a}},t.tup(f,v),{singleton:!0}),S={lvl:0};function C(e,t,n,r,o){return void 0===r&&(r=S),void 0===o&&(o=S),{k:e,v:t,lvl:n,l:r,r:o}}function x(e){return e===S}function w(){return S}function T(e,t){if(x(e))return S;var n=e.k,r=e.l,o=e.r;if(t===n){if(x(r))return o;if(x(o))return r;var i=R(r);return F(z(e,{k:i[0],v:i[1],l:k(r)}))}return F(z(e,t<n?{l:T(r,t)}:{r:T(o,t)}))}function b(e,t,n){if(void 0===n&&(n="k"),x(e))return[-Infinity,void 0];if(e[n]===t)return[e.k,e.v];if(e[n]<t){var r=b(e.r,t,n);return-Infinity===r[0]?[e.k,e.v]:r}return b(e.l,t,n)}function y(e,t,n){return x(e)?C(t,n,1):t===e.k?z(e,{k:t,v:n}):function(e){return M(P(e))}(z(e,t<e.k?{l:y(e.l,t,n)}:{r:y(e.r,t,n)}))}function L(e,t,n){if(x(e))return[];var r=e.k,o=e.v,i=e.r,a=[];return r>t&&(a=a.concat(L(e.l,t,n))),r>=t&&r<=n&&a.push({k:r,v:o}),r<=n&&(a=a.concat(L(i,t,n))),a}function E(e){return x(e)?[]:[].concat(E(e.l),[{k:e.k,v:e.v}],E(e.r))}function R(e){return x(e.r)?[e.k,e.v]:R(e.r)}function k(e){return x(e.r)?e.l:F(z(e,{r:k(e.r)}))}function z(e,t){return C(void 0!==t.k?t.k:e.k,void 0!==t.v?t.v:e.v,void 0!==t.lvl?t.lvl:e.lvl,void 0!==t.l?t.l:e.l,void 0!==t.r?t.r:e.r)}function H(e){return x(e)||e.lvl>e.r.lvl}function F(e){var t=e.l,n=e.r,r=e.lvl;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(H(t))return P(z(e,{lvl:r-1}));if(x(t)||x(t.r))throw new Error("Unexpected empty nodes");return z(t.r,{l:z(t,{r:t.r.l}),r:z(e,{l:t.r.r,lvl:r-1}),lvl:r})}if(H(e))return M(z(e,{lvl:r-1}));if(x(n)||x(n.l))throw new Error("Unexpected empty nodes");var o=n.l,i=H(o)?n.lvl-1:n.lvl;return z(o,{l:z(e,{r:o.l,lvl:r-1}),r:M(z(n,{l:o.r,lvl:i})),lvl:o.lvl+1})}function B(e,t,n){return x(e)?[]:O(L(e,b(e,t)[0],n),function(e){return{index:e.k,value:e.v}})}function O(e,t){var n=e.length;if(0===n)return[];for(var r=t(e[0]),o=r.index,i=r.value,a=[],s=1;s<n;s++){var l=t(e[s]),u=l.index,c=l.value;a.push({start:o,end:u-1,value:i}),o=u,i=c}return a.push({start:o,end:Infinity,value:i}),a}function M(e){var t=e.r,n=e.lvl;return x(t)||x(t.r)||t.lvl!==n||t.r.lvl!==n?e:z(t,{l:z(e,{r:t.l}),lvl:n+1})}function P(e){var t=e.l;return x(t)||t.lvl!==e.lvl?e:z(t,{r:z(e,{l:t.r})})}function U(e,t,n,r){void 0===r&&(r=0);for(var o=e.length-1;r<=o;){var i=Math.floor((r+o)/2),a=n(e[i],t);if(0===a)return i;if(-1===a){if(o-r<2)return i-1;o=i-1}else{if(o===r)return i;r=i+1}}throw new Error("Failed binary finding record in array - "+e.join(",")+", searched for "+t)}function V(e,t,n){return e[U(e,t,n)]}function N(e,t){return Math.round(e.getBoundingClientRect()[t])}function G(e){var t=e.size,n=e.startIndex,r=e.endIndex;return function(e){return e.start===n&&(e.end===r||Infinity===e.end)&&e.value===t}}function A(e,t){var n=e.index;return t===n?0:t<n?-1:1}function W(e,t){var n=e.offset;return t===n?0:t<n?-1:1}function D(e){return{index:e.index,value:e}}function _(e,t){var n=t[0],r=t[1];n.length>0&&(0,t[2])("received item sizes",n,exports.LogLevel.DEBUG);var o=e.sizeTree,i=e.offsetTree,s=o,l=0;if(r.length>0&&x(o)&&2===n.length){var u=n[0].size,c=n[1].size;s=r.reduce(function(e,t){return y(y(e,t,u),t+1,c)},s)}else{var m=function(e,t){for(var n,r=x(e)?0:Infinity,o=a(t);!(n=o()).done;){var i=n.value,s=i.size,l=i.startIndex,u=i.endIndex;if(r=Math.min(r,l),x(e))e=y(e,0,s);else{var c=B(e,l-1,u+1);if(!c.some(G(i))){for(var m,f=!1,d=!1,p=a(c);!(m=p()).done;){var h=m.value,g=h.start,v=h.end,I=h.value;f?(u>=g||s===I)&&(e=T(e,g)):(d=I!==s,f=!0),v>u&&u>=g&&I!==s&&(e=y(e,u+1,I))}d&&(e=y(e,l,s))}}}return[e,r]}(s,n);s=m[0],l=m[1]}if(s===o)return e;var f=0,d=0,p=0,h=0;if(0!==l){h=U(i,l-1,A),p=i[h].offset;var g=b(s,l-1);f=g[0],d=g[1],i.length&&i[h].size===b(s,l)[1]&&(h-=1),i=i.slice(0,h+1)}else i=[];for(var v,I=a(B(s,l,Infinity));!(v=I()).done;){var S=v.value,C=S.start,L=S.value,E=(C-f)*d+p;i.push({offset:E,size:L,index:C}),f=C,p=E,d=L}return{sizeTree:s,offsetTree:i,groupOffsetTree:r.reduce(function(e,t){return y(e,t,j(t,i))},w()),lastIndex:f,lastOffset:p,lastSize:d,groupIndices:r}}function j(e,t){if(0===t.length)return 0;var n=V(t,e,A);return n.size*(e-n.index)+n.offset}function K(e,t){if(!Y(t))return e;for(var n=0;t.groupIndices[n]<=e+n;)n++;return e+n}function Y(e){return!x(e.groupOffsetTree)}var q={offsetHeight:"height",offsetWidth:"width"},Z=t.system(function(e){var n=e[0].log,o=t.stream(),i=t.stream(),a=t.stream(),s=t.statefulStream(0),l=t.statefulStream([]),u=t.statefulStream(void 0),c=t.statefulStream(void 0),m=t.statefulStream(function(e,t){return N(e,q[t])}),f=t.statefulStream(void 0),d={offsetTree:[],sizeTree:w(),groupOffsetTree:w(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]},p=t.statefulStreamFromEmitter(t.pipe(o,t.withLatestFrom(l,n),t.scan(_,d),t.distinctUntilChanged()),d);t.connect(t.pipe(l,t.filter(function(e){return e.length>0}),t.withLatestFrom(p),t.map(function(e){var t=e[0],n=e[1],o=t.reduce(function(e,t,r){return y(e,t,j(t,n.offsetTree)||r)},w());return r({},n,{groupIndices:t,groupOffsetTree:o})})),p),t.connect(t.pipe(i,t.withLatestFrom(p),t.filter(function(e){return e[0]<e[1].lastIndex}),t.map(function(e){var t=e[1];return[{startIndex:e[0],endIndex:t.lastIndex,size:t.lastSize}]})),o),t.connect(u,c);var h=t.statefulStreamFromEmitter(t.pipe(u,t.map(function(e){return void 0===e})),!0);t.connect(t.pipe(c,t.filter(function(e){return void 0!==e&&x(t.getValue(p).sizeTree)}),t.map(function(e){return[{startIndex:0,endIndex:0,size:e}]})),o);var g=t.streamFromEmitter(t.pipe(o,t.withLatestFrom(p),t.scan(function(e,t){var n=t[1];return{changed:n!==e.sizes,sizes:n}},{changed:!1,sizes:d}),t.map(function(e){return e.changed})));t.connect(t.pipe(s,t.scan(function(e,t){return{diff:e.prev-t,prev:t}},{diff:0,prev:0}),t.map(function(e){return e.diff}),t.filter(function(e){return e>0})),a),t.subscribe(t.pipe(s,t.withLatestFrom(n)),function(e){e[0]<0&&(0,e[1])("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},exports.LogLevel.ERROR)});var v=t.streamFromEmitter(a);return t.connect(t.pipe(a,t.withLatestFrom(p),t.map(function(e){var t=e[0],n=e[1];if(n.groupIndices.length>0)throw new Error("Virtuoso: prepending items does not work with groups");return E(n.sizeTree).reduce(function(e,n){var r=n.k,o=n.v;return{ranges:[].concat(e.ranges,[{startIndex:e.prevIndex,endIndex:r+t-1,size:e.prevSize}]),prevIndex:r+t,prevSize:o}},{ranges:[],prevIndex:0,prevSize:n.lastSize}).ranges})),o),{data:f,totalCount:i,sizeRanges:o,groupIndices:l,defaultItemSize:c,fixedItemSize:u,unshiftWith:a,beforeUnshiftWith:v,firstItemIndex:s,sizes:p,listRefresh:g,trackItemSizes:h,itemSize:m}},t.tup(p),{singleton:!0}),$="undefined"!=typeof document&&"scrollBehavior"in document.documentElement.style;function J(e){var t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),t.behavior&&$||(t.behavior="auto"),t.offset||(t.offset=0),t}var Q=t.system(function(e){var n=e[0],r=n.sizes,o=n.totalCount,i=n.listRefresh,a=e[1],s=a.scrollingInProgress,l=a.viewportHeight,u=a.scrollTo,c=a.smoothScrollTargetReached,m=a.headerHeight,f=a.footerHeight,d=e[2].log,p=t.stream(),h=t.statefulStream(0),g=null,v=null,I=null;function S(){g&&(g(),g=null),I&&(I(),I=null),v&&(clearTimeout(v),v=null),t.publish(s,!1)}return t.connect(t.pipe(p,t.withLatestFrom(r,l,o,h,m,f,d),t.map(function(e){var n=e[0],r=e[1],o=e[2],a=e[3],l=e[4],u=e[5],m=e[6],f=e[7],d=J(n),h=d.align,C=d.behavior,x=d.offset,w=a-1,T=d.index;T=K(T,r);var y=j(T=Math.max(0,T,Math.min(w,T)),r.offsetTree)+u;"end"===h?(y=Math.round(y-o+b(r.sizeTree,T)[1]),T===w&&(y+=m)):"center"===h?y=Math.round(y-o/2+b(r.sizeTree,T)[1]/2):y-=l,x&&(y+=x);var L=function(e){S(),e?(f("retrying to scroll to",{location:n},exports.LogLevel.DEBUG),t.publish(p,n)):f("list did not change, scroll successful",{},exports.LogLevel.DEBUG)};if(S(),"smooth"===C){var E=!1;I=t.subscribe(i,function(e){E=E||e}),g=t.handleNext(c,function(){L(E)})}else g=t.handleNext(t.pipe(i,function(e){var t=setTimeout(function(){e(!1)},50);return function(n){n&&(e(!0),clearTimeout(t))}}),L);return v=setTimeout(function(){S()},1200),t.publish(s,!0),f("scrolling from index to",{index:T,top:y,behavior:C},exports.LogLevel.DEBUG),{top:y,behavior:C}})),u),{scrollToIndex:p,scrollingInProgress:s,topListHeight:h}},t.tup(Z,f,p),{singleton:!0});function X(e,t,n){return"number"==typeof e?n===m&&"top"===t||"down"===n&&"bottom"===t?e:0:n===m?"top"===t?e.main:e.reverse:"bottom"===t?e.main:e.reverse}function ee(e,t){return"number"==typeof e?e:e[t]||0}var te=t.system(function(e){var n=e[0],r=n.scrollTop,o=n.viewportHeight,i=n.deviation,a=n.headerHeight,l=t.stream(),u=t.statefulStream(0),c=t.statefulStream(0),f=t.statefulStream(0);return{listBoundary:l,overscan:f,topListHeight:u,increaseViewportBy:c,visibleRange:t.statefulStreamFromEmitter(t.pipe(t.combineLatest(t.duc(r),t.duc(o),t.duc(a),t.duc(l,s),t.duc(f),t.duc(u),t.duc(i),t.duc(c)),t.map(function(e){var t=e[0],n=e[1],r=e[2],o=e[3],i=o[0],a=o[1],s=e[4],l=e[5],u=e[6],c=e[7],f=t-u,d=Math.max(r-f,0),p="none",h=ee(c,"top"),g=ee(c,"bottom");return i-=u,a+=r,(i+=r)>t+l-h&&(p=m),(a-=u)<t-d+n+g&&(p="down"),"none"!==p?[Math.max(f-r-X(s,"top",p)-h,0),f-d+n+X(s,"bottom",p)+g]:null}),t.filter(function(e){return null!=e}),t.distinctUntilChanged(s)),[0,0])}},t.tup(f),{singleton:!0}),ne=t.system(function(e){var n=e[0],o=n.scrollTop,i=n.scrollTo,a=t.stream(),s=t.stream(),l=t.stream(),u=t.statefulStream(!1);return t.connect(t.pipe(t.combineLatest(s,a),t.map(function(e){return Math.max(0,e[0]-e[1].offsetTop)})),o),t.connect(t.pipe(i,t.withLatestFrom(a),t.map(function(e){var t=e[0];return r({},t,{top:t.top+e[1].offsetTop})})),l),{useWindowScroll:u,windowScrollTop:s,windowViewportRect:a,windowScrollTo:l}},t.tup(f)),re={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},oe={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},ie=Math.ceil,ae=Math.floor,se=Math.min,le=Math.max;function ue(e){return ie(e)-e<.03?ie(e):ae(e)}function ce(e,t){return Array.from({length:t-e+1}).map(function(t,n){return{index:n+e}})}var me=t.system(function(e){var n=e[0],o=n.overscan,i=n.visibleRange,a=n.listBoundary,u=e[1],c=u.scrollTop,m=u.viewportHeight,f=u.scrollBy,d=u.scrollTo,p=u.smoothScrollTargetReached,h=e[2],g=e[3],v=e[4],I=v.propsReady,S=v.didMount,C=e[5],x=C.windowViewportRect,w=C.windowScrollTo,T=C.useWindowScroll,b=C.windowScrollTop,y=t.statefulStream(0),L=t.statefulStream(0),E=t.statefulStream(re),R=t.statefulStream({height:0,width:0}),k=t.statefulStream({height:0,width:0}),z=t.stream();t.connect(t.pipe(S,t.withLatestFrom(L),t.filter(function(e){return 0!==e[1]}),t.map(function(e){return{items:ce(0,e[1]-1),top:0,bottom:0,offsetBottom:0,offsetTop:0,itemHeight:0,itemWidth:0}})),E),t.connect(t.pipe(t.combineLatest(t.duc(y),i,t.duc(k,function(e,t){return e&&e.width===t.width&&e.height===t.height})),t.withLatestFrom(R),t.map(function(e){var t=e[0],n=t[0],r=t[1],o=r[0],i=r[1],a=t[2],s=e[1],l=a.height,u=a.width,c=s.width;if(0===n||0===c)return re;if(0===u)return oe;var m=ue(c/u),f=m*ae(o/l),d=m*ie(i/l)-1;d=se(n-1,d);var p=ce(f=se(d,le(0,f)),d),h=fe(s,a,p),g=h.top,v=h.bottom;return{items:p,offsetTop:g,offsetBottom:ie(n/m)*l-v,top:g,bottom:v,itemHeight:l,itemWidth:u}})),E),t.connect(t.pipe(R,t.map(function(e){return e.height})),m),t.connect(t.pipe(t.combineLatest(R,k,E),t.map(function(e){var t=fe(e[0],e[1],e[2].items);return[t.top,t.bottom]}),t.distinctUntilChanged(s)),a),t.connect(t.pipe(a,t.withLatestFrom(E),t.map(function(e){return{bottom:e[0][1],offsetBottom:e[1].offsetBottom}})),h.listStateListener);var H=t.streamFromEmitter(t.pipe(t.duc(E),t.filter(function(e){return e.items.length>0}),t.withLatestFrom(y),t.filter(function(e){var t=e[0].items;return t[t.length-1].index===e[1]-1}),t.map(function(e){return e[1]-1}),t.distinctUntilChanged())),F=t.streamFromEmitter(t.pipe(t.duc(E),t.filter(function(e){var t=e.items;return t.length>0&&0===t[0].index}),t.mapTo(0),t.distinctUntilChanged())),B=t.streamFromEmitter(t.pipe(t.duc(E),t.filter(function(e){return e.items.length>0}),t.map(function(e){var t=e.items;return{startIndex:t[0].index,endIndex:t[t.length-1].index}}),t.distinctUntilChanged(l)));t.connect(B,g.scrollSeekRangeChanged),t.connect(t.pipe(z,t.withLatestFrom(R,k,y),t.map(function(e){var t=e[1],n=e[2],r=e[3],o=J(e[0]),i=o.align,a=o.behavior,s=o.offset,l=o.index,u=de(t,n,l=Math.max(0,l,Math.min(r-1,l)));return"end"===i?u=Math.round(u-t.height+n.height):"center"===i&&(u=Math.round(u-t.height/2+n.height/2)),s&&(u+=s),{top:u,behavior:a}})),d);var O=t.statefulStreamFromEmitter(t.pipe(E,t.map(function(e){return e.offsetBottom+e.bottom})),0);return t.connect(t.pipe(x,t.map(function(e){return{width:e.visibleWidth,height:e.visibleHeight}})),R),r({totalCount:y,viewportDimensions:R,itemDimensions:k,scrollTop:c,overscan:o,scrollBy:f,scrollTo:d,scrollToIndex:z,smoothScrollTargetReached:p,windowViewportRect:x,windowScrollTo:w,useWindowScroll:T,windowScrollTop:b,initialItemCount:L},g,{gridState:E,totalListHeight:O},h,{startReached:F,endReached:H,rangeChanged:B,propsReady:I})},t.tup(te,f,v,I,h,ne));function fe(e,t,n){var r=t.height;return void 0===r||0===n.length?{top:0,bottom:0}:{top:de(e,t,n[0].index),bottom:de(e,t,n[n.length-1].index)+r}}function de(e,t,n){var r=ue(e.width/t.width);return ae(n/r)*t.height}function pe(e,t){void 0===t&&(t=!0);var r=n.useRef(null),o=function(e){};if("undefined"!=typeof ResizeObserver){var i=new ResizeObserver(function(t){var n=t[0].target;null!==n.offsetParent&&e(n)});o=function(e){e&&t?(i.observe(e),r.current=e):(r.current&&i.unobserve(r.current),r.current=null)}}return{ref:r,callbackRef:o}}function he(e,t){return void 0===t&&(t=!0),pe(e,t).callbackRef}function ge(e){var t=n.useRef(null),r=n.useCallback(function(n){if(null!==n){var r=n.getBoundingClientRect(),o=window.innerHeight-Math.max(0,r.top),i=r.top+window.pageYOffset;t.current={offsetTop:i,visibleHeight:o,visibleWidth:r.width},e(t.current)}},[e]),o=pe(r),i=o.callbackRef,a=o.ref,s=n.useCallback(function(){r(a.current)},[r,a]);return n.useEffect(function(){return window.addEventListener("scroll",s),window.addEventListener("resize",s),function(){window.removeEventListener("scroll",s),window.removeEventListener("resize",s)}},[s]),i}var ve="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;function Ie(e,r,o,i){void 0===i&&(i=t.noop);var a=n.useRef(null),s=n.useRef(null),l=n.useRef(null),u=n.useCallback(function(t){var n=t.target,o=n===window||n===document?window.pageYOffset||document.documentElement.scrollTop:n.scrollTop;e(Math.max(o,0)),null!==s.current&&(o===s.current||o<=0||o===n.scrollHeight-N(n,"height"))&&(s.current=null,r(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,r]);return n.useEffect(function(){var e=a.current;return i(a.current),u({target:e}),e.addEventListener("scroll",u,{passive:!0}),function(){i(null),e.removeEventListener("scroll",u)}},[a,u,o,i]),{scrollerRef:a,scrollByCallback:function(e){null===s.current&&a.current.scrollBy(e)},scrollToCallback:function(t){var n=a.current;if(n&&(!("offsetHeight"in n)||0!==n.offsetHeight)){var o,i,u,c="smooth"===t.behavior;if(n===window?(i=Math.max(N(document.documentElement,"height"),document.documentElement.scrollHeight),o=window.innerHeight,u=document.documentElement.scrollTop):(i=n.scrollHeight,o=N(n,"height"),u=n.scrollTop),Math.abs(o-i)<1.01||t.top===u)return e(u),void(c&&r(!0));t.top=Math.max(Math.min(i-o,t.top),0),c?(s.current=t.top,l.current&&clearTimeout(l.current),l.current=setTimeout(function(){l.current=null,s.current=null,r(!0)},1e3)):s.current=null,n.scrollTo(t)}}}}var Se=t.system(function(e){var n=e[0],r=n.sizes,o=n.listRefresh,i=n.defaultItemSize,a=e[1],s=a.scrollToIndex,l=a.scrollingInProgress,u=e[2].didMount,c=t.statefulStream(!0),m=t.statefulStream(0);return t.connect(t.pipe(u,t.withLatestFrom(m),t.filter(function(e){return 0!==e[1]}),t.mapTo(!1)),c),t.subscribe(t.pipe(t.combineLatest(o,u),t.withLatestFrom(c,r,i),t.filter(function(e){var t=e[1],n=e[3];return e[0][1]&&(!x(e[2].sizeTree)||void 0!==n)&&!t}),t.withLatestFrom(m)),function(e){var n=e[1];setTimeout(function(){t.publish(s,n),t.handleNext(t.pipe(l,t.skip(1)),function(){t.publish(c,!0)})})}),{scrolledToInitialItem:c,initialTopMostItemIndex:m}},t.tup(Z,Q,h),{singleton:!0});function Ce(e){return!!e&&("smooth"===e?"smooth":"auto")}var xe=t.system(function(e){var n=e[0],r=n.totalCount,o=n.listRefresh,i=e[1],a=i.isAtBottom,s=i.atBottomState,l=e[2].scrollToIndex,u=e[3].scrolledToInitialItem,c=e[4],m=c.propsReady,f=c.didMount,d=e[5].log,p=t.statefulStream(!1),h=null;function g(e,n){t.publish(l,{index:e-1,align:"end",behavior:n})}return t.subscribe(t.pipe(t.combineLatest(t.pipe(t.duc(r),t.skip(1)),f),t.withLatestFrom(t.duc(p),a,u),t.map(function(e){var t=e[0],n=t[0],r=t[1]&&e[3],o="auto";return r&&(o=function(e,t){return"function"==typeof e?Ce(e(t)):t&&Ce(e)}(e[1],e[2]),r=r&&!!o),{totalCount:n,shouldFollow:r,followOutputBehavior:o}}),t.filter(function(e){return e.shouldFollow})),function(e){var n=e.totalCount,r=e.followOutputBehavior;h&&(h(),h=null),h=t.handleNext(o,function(){g(n,r),h=null})}),t.subscribe(t.pipe(t.combineLatest(t.duc(p),r,m),t.filter(function(e){return e[0]&&e[2]}),t.scan(function(e,t){var n=t[1];return{refreshed:e.value===n,value:n}},{refreshed:!1,value:0}),t.filter(function(e){return e.refreshed}),t.withLatestFrom(p,r)),function(e){var n=e[1],r=e[2],o=t.handleNext(s,function(e){!n||e.atBottom||"SIZE_INCREASED"!==e.notAtBottomBecause||h||(t.getValue(d)("scrolling to bottom due to increased size",{totalCount:r},exports.LogLevel.DEBUG),g(r,"auto"))});setTimeout(o,100)}),t.subscribe(t.pipe(t.combineLatest(t.duc(p),s),t.withLatestFrom(r)),function(e){var t=e[0],n=t[1];t[0]&&!n.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===n.notAtBottomBecause&&g(e[1],"auto")}),{followOutput:p}},t.tup(Z,v,Q,Se,h,p));function we(e){return e.reduce(function(e,t){return e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e},{totalCount:0,groupIndices:[]})}var Te=t.system(function(e){var n=e[0],r=n.totalCount,o=n.groupIndices,i=n.sizes,a=e[1],s=a.scrollTop,l=a.headerHeight,u=t.stream(),c=t.stream(),m=t.streamFromEmitter(t.pipe(u,t.map(we)));return t.connect(t.pipe(m,t.map(t.prop("totalCount"))),r),t.connect(t.pipe(m,t.map(t.prop("groupIndices"))),o),t.connect(t.pipe(t.combineLatest(s,i,l),t.filter(function(e){return Y(e[1])}),t.map(function(e){return b(e[1].groupOffsetTree,Math.max(e[0]-e[2],0),"v")[0]}),t.distinctUntilChanged(),t.map(function(e){return[e]})),c),{groupCounts:u,topItemsIndexes:c}},t.tup(Z,f)),be={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0};function ye(e,t,n){if(0===e.length)return[];if(!Y(t))return e.map(function(e){return r({},e,{index:e.index+n,originalIndex:e.index})});for(var o,i=[],s=B(t.groupOffsetTree,e[0].index,e[e.length-1].index),l=void 0,u=0,c=a(e);!(o=c()).done;){var m=o.value;(!l||l.end<m.index)&&(l=s.shift(),u=t.groupIndices.indexOf(l.start)),i.push(r({},m.index===l.start?{type:"group",index:u}:{index:m.index-(u+1)+n,groupIndex:u},{size:m.size,offset:m.offset,originalIndex:m.index,data:m.data}))}return i}function Le(e,t,n,r,o){var i=0,a=0;if(e.length>0){i=e[0].offset;var s=e[e.length-1];a=s.offset+s.size}var l=i,u=r.lastOffset+(n-r.lastIndex)*r.lastSize-a;return{items:ye(e,r,o),topItems:ye(t,r,o),topListHeight:t.reduce(function(e,t){return t.size+e},0),offsetTop:i,offsetBottom:u,top:l,bottom:a,totalCount:n}}var Ee,Re,ke,ze=t.system(function(e){var n=e[0],o=n.sizes,i=n.totalCount,u=n.data,c=n.firstItemIndex,m=e[1],f=e[2],d=f.visibleRange,p=f.listBoundary,h=f.topListHeight,g=e[3],v=g.scrolledToInitialItem,I=g.initialTopMostItemIndex,S=e[4].topListHeight,C=e[5],w=e[6].didMount,T=t.statefulStream([]),y=t.stream();t.connect(m.topItemsIndexes,T);var L=t.statefulStreamFromEmitter(t.pipe(t.combineLatest(w,t.duc(d),t.duc(i),t.duc(o),t.duc(I),v,t.duc(T),t.duc(c),u),t.filter(function(e){return e[0]}),t.map(function(e){var n=e[1],r=n[0],o=n[1],i=e[2],s=e[4],l=e[5],u=e[6],c=e[7],m=e[8],f=e[3],d=f.sizeTree,p=f.offsetTree;if(0===i||0===r&&0===o)return be;if(x(d))return Le(function(e,t,n){if(Y(t)){var r=K(e,t);return[{index:b(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}(s,f,m),[],i,f,c);var h=[];if(u.length>0)for(var g,v=u[0],I=u[u.length-1],S=0,C=a(B(d,v,I));!(g=C()).done;)for(var w=g.value,T=w.value,y=Math.max(w.start,v),L=Math.min(w.end,I),E=y;E<=L;E++)h.push({index:E,size:T,offset:S,data:m&&m[E]}),S+=T;if(!l)return Le([],h,i,f,c);var R=u.length>0?u[u.length-1]+1:0,k=function(e,t,n,r){return void 0===r&&(r=0),r>0&&(t=Math.max(t,V(e,r,A).offset)),O((i=n,s=U(o=e,t,a=W),l=U(o,i,a,s),o.slice(s,l+1)),D);var o,i,a,s,l}(p,r,o,R);if(0===k.length)return null;var z=i-1;return Le(t.tap([],function(e){for(var t,n=a(k);!(t=n()).done;){var i=t.value,s=i.value,l=s.offset,u=i.start,c=s.size;s.offset<r&&(l+=((u+=Math.floor((r-s.offset)/c))-i.start)*c),u<R&&(l+=(R-u)*c,u=R);for(var f=Math.min(i.end,z),d=u;d<=f&&!(l>=o);d++)e.push({index:d,size:c,offset:l,data:m&&m[d]}),l+=c}}),h,i,f,c)}),t.filter(function(e){return null!==e}),t.distinctUntilChanged()),be);return t.connect(t.pipe(u,t.filter(function(e){return void 0!==e}),t.map(function(e){return e.length})),i),t.connect(t.pipe(L,t.map(t.prop("topListHeight"))),S),t.connect(S,h),t.connect(L,C.listStateListener),t.connect(t.pipe(L,t.map(function(e){return[e.top,e.bottom]})),p),t.connect(t.pipe(L,t.map(function(e){return e.items})),y),r({listState:L,topItemsIndexes:T,endReached:t.streamFromEmitter(t.pipe(L,t.filter(function(e){return e.items.length>0}),t.withLatestFrom(i,u),t.filter(function(e){var t=e[0].items;return t[t.length-1].originalIndex===e[1]-1}),t.map(function(e){return[e[1]-1,e[2]]}),t.distinctUntilChanged(s),t.map(function(e){return e[0]}))),startReached:t.streamFromEmitter(t.pipe(L,t.throttleTime(200),t.filter(function(e){var t=e.items;return t.length>0&&t[0].originalIndex===e.topItems.length}),t.map(function(e){return e.items[0].index}),t.distinctUntilChanged())),rangeChanged:t.streamFromEmitter(t.pipe(L,t.filter(function(e){return e.items.length>0}),t.map(function(e){var t=e.items;return{startIndex:t[0].index,endIndex:t[t.length-1].index}}),t.distinctUntilChanged(l))),itemsRendered:y},C)},t.tup(Z,Te,te,Se,Q,v,h),{singleton:!0}),He=t.system(function(e){var n=e[0],r=n.sizes,o=n.firstItemIndex,i=n.data,s=e[1].listState,l=e[2].didMount,u=t.statefulStream(0);return t.connect(t.pipe(l,t.withLatestFrom(u),t.filter(function(e){return 0!==e[1]}),t.withLatestFrom(r,o,i),t.map(function(e){var t=e[0][1],n=e[1],r=e[2],o=e[3],i=void 0===o?[]:o,s=0;if(n.groupIndices.length>0)for(var l,u=a(n.groupIndices);!((l=u()).done||l.value-s>=t);)s++;var c=t+s;return Le(Array.from({length:c}).map(function(e,t){return{index:t,size:0,offset:0,data:i[t]}}),[],c,n,r)})),s),{initialItemCount:u}},t.tup(Z,ze,h),{singleton:!0}),Fe=t.system(function(e){var n=e[0].topItemsIndexes,r=t.statefulStream(0);return t.connect(t.pipe(r,t.filter(function(e){return e>0}),t.map(function(e){return Array.from({length:e}).map(function(e,t){return t})})),n),{topItemCount:r}},t.tup(ze)),Be=t.system(function(e){var n=e[0],r=n.footerHeight,o=n.headerHeight,i=e[1].listState,a=t.stream(),s=t.statefulStreamFromEmitter(t.pipe(t.combineLatest(r,o,i),t.map(function(e){var t=e[2];return e[0]+e[1]+t.offsetBottom+t.bottom})),0);return t.connect(t.duc(s),a),{totalListHeight:s,totalListHeightChanged:a}},t.tup(f,ze),{singleton:!0}),Oe=t.system(function(e){var n=e[0],r=n.scrollBy,o=n.scrollTop,i=n.scrollDirection,a=n.deviation,s=n.scrollingInProgress,l=e[1].isScrolling,u=e[3],c=u.beforeUnshiftWith,f=u.sizes,d=e[4].log,p=t.streamFromEmitter(t.pipe(e[2].listState,t.scan(function(e,t){var n=e[1],r=t.items,o=0;if(n.length>0&&r.length>0){var i=r[0].originalIndex,a=n[0].originalIndex;if(0!==i||0!==a)if(i===a)o=r[0].size-n[0].size;else for(var s=function(e){var t=r[e],i=n.find(function(e){return e.originalIndex===t.originalIndex});return i?t.offset!==i.offset?(o=t.offset-i.offset,"break"):void 0:"continue"},l=r.length-1;l>=0;l--){var u=s(l);if("continue"!==u&&"break"===u)break}}return[o,r]},[0,[]]),t.filter(function(e){return 0!==e[0]}),t.withLatestFrom(o,i,s,d),t.filter(function(e){return!e[3]&&0!==e[1]&&e[2]===m}),t.map(function(e){var t=e[0][0];return(0,e[4])("Upward scrolling compensation",{amount:t},exports.LogLevel.DEBUG),t})));return t.connect(t.pipe(p,t.withLatestFrom(a),t.map(function(e){return e[1]-e[0]})),a),t.subscribe(t.pipe(t.combineLatest(t.statefulStreamFromEmitter(l,!1),a),t.filter(function(e){return!e[0]&&0!==e[1]}),t.map(function(e){return e[1]}),t.throttleTime(1)),function(e){e>0?(t.publish(r,{top:-e,behavior:"auto"}),t.publish(a,0)):(t.publish(a,0),t.publish(r,{top:-e,behavior:"auto"}))}),t.connect(t.pipe(c,t.withLatestFrom(f),t.map(function(e){return e[0]*e[1].lastSize})),p),{deviation:a}},t.tup(f,v,ze,Z,p)),Me=t.system(function(e){var n=e[0].totalListHeight,r=e[1].didMount,o=e[2].scrollTo,i=t.statefulStream(0);return t.subscribe(t.pipe(r,t.withLatestFrom(i),t.filter(function(e){return 0!==e[1]}),t.map(function(e){return{top:e[1]}})),function(e){t.handleNext(t.pipe(n,t.filter(function(e){return 0!==e})),function(){setTimeout(function(){t.publish(o,e)})})}),{initialScrollTop:i}},t.tup(Be,h,f),{singleton:!0}),Pe=t.system(function(e){var n=e[0].viewportHeight,r=e[1].totalListHeight,o=t.statefulStream(!1);return{alignToBottom:o,paddingTopAddition:t.statefulStreamFromEmitter(t.pipe(t.combineLatest(o,n,r),t.filter(function(e){return e[0]}),t.map(function(e){return Math.max(0,e[1]-e[2])}),t.distinctUntilChanged()),0)}},t.tup(f,Be),{singleton:!0}),Ue=t.system(function(e){var n=e[0],r=n.sizes,o=n.totalCount,i=e[1],a=i.scrollTop,s=i.viewportHeight,l=i.headerHeight,u=i.scrollingInProgress,c=e[2].scrollToIndex,m=t.stream();return t.connect(t.pipe(m,t.withLatestFrom(r,s,o,l,a),t.map(function(e){var n=e[0],r=n.index,o=n.behavior,i=void 0===o?"auto":o,a=n.done,s=e[1],l=e[2],c=e[4],m=e[5],f=e[3]-1,d=null;r=K(r,s);var p=j(r=Math.max(0,r,Math.min(f,r)),s.offsetTree)+c;return p<m?d={index:r,behavior:i,align:"start"}:p+b(s.sizeTree,r)[1]>m+l&&(d={index:r,behavior:i,align:"end"}),d?a&&t.handleNext(t.pipe(u,t.skip(1),t.filter(function(e){return!1===e})),a):a&&a(),d}),t.filter(function(e){return null!==e})),c),{scrollIntoView:m}},t.tup(Z,f,Q,ze,p),{singleton:!0}),Ve=t.system(function(e){return r({},e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},t.tup(te,He,h,I,Be,Me,Pe,ne,Ue)),Ne=t.system(function(e){var n=e[0],i=n.totalCount,a=n.sizeRanges,s=n.fixedItemSize,l=n.defaultItemSize,u=n.trackItemSizes,c=n.itemSize,m=n.data,f=n.firstItemIndex,d=n.groupIndices,p=e[1],h=p.initialTopMostItemIndex,g=p.scrolledToInitialItem,v=e[2],I=e[3],S=e[4],C=S.listState,x=S.topItemsIndexes,w=o(S,["listState","topItemsIndexes"]),T=e[5].scrollToIndex,b=e[7].topItemCount,y=e[8].groupCounts,L=e[9],E=e[10];return t.connect(w.rangeChanged,L.scrollSeekRangeChanged),t.connect(t.pipe(L.windowViewportRect,t.map(t.prop("visibleHeight"))),v.viewportHeight),r({totalCount:i,data:m,firstItemIndex:f,sizeRanges:a,initialTopMostItemIndex:h,scrolledToInitialItem:g,topItemsIndexes:x,topItemCount:b,groupCounts:y,fixedItemHeight:s,defaultItemHeight:l},I,{listState:C,scrollToIndex:T,trackItemSizes:u,itemSize:c,groupIndices:d},w,L,v,E)},t.tup(Z,Se,f,xe,ze,Q,Oe,Fe,Te,Ve,p)),Ge=(Ee=function(){if("undefined"==typeof document)return"sticky";var e=document.createElement("div");return e.style.position="-webkit-sticky","-webkit-sticky"===e.style.position?"-webkit-sticky":"sticky"},ke=!1,function(){return ke||(ke=!0,Re=Ee()),Re});function Ae(e){return e}var We=t.system(function(){var e=t.statefulStream(function(e){return"Item "+e}),n=t.statefulStream(function(e){return"Group "+e}),r=t.statefulStream({}),o=t.statefulStream(Ae),i=t.statefulStream("div"),a=t.statefulStream(t.noop),s=function(e,n){return void 0===n&&(n=null),t.statefulStreamFromEmitter(t.pipe(r,t.map(function(t){return t[e]}),t.distinctUntilChanged()),n)};return{itemContent:e,groupContent:n,components:r,computeItemKey:o,headerFooterTag:i,scrollerRef:a,FooterComponent:s("Footer"),HeaderComponent:s("Header"),TopItemListComponent:s("TopItemList"),ListComponent:s("List","div"),ItemComponent:s("Item","div"),GroupComponent:s("Group","div"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder")}});function De(e,n){var r=t.stream();return t.subscribe(r,function(){return console.warn("react-virtuoso: You are using a deprecated property. "+n,"color: red;","color: inherit;","color: blue;")}),t.connect(r,e),r}var _e=t.system(function(e){var n=e[0],i=e[1],a={item:De(i.itemContent,"Rename the %citem%c prop to %citemContent."),group:De(i.groupContent,"Rename the %cgroup%c prop to %cgroupContent."),topItems:De(n.topItemCount,"Rename the %ctopItems%c prop to %ctopItemCount."),itemHeight:De(n.fixedItemHeight,"Rename the %citemHeight%c prop to %cfixedItemHeight."),scrollingStateChange:De(n.isScrolling,"Rename the %cscrollingStateChange%c prop to %cisScrolling."),adjustForPrependedItems:t.stream(),maxHeightCacheSize:t.stream(),footer:t.stream(),header:t.stream(),HeaderContainer:t.stream(),FooterContainer:t.stream(),ItemContainer:t.stream(),ScrollContainer:t.stream(),GroupContainer:t.stream(),ListContainer:t.stream(),emptyComponent:t.stream(),scrollSeek:t.stream()};function s(e,n,o){t.connect(t.pipe(e,t.withLatestFrom(i.components),t.map(function(e){var t,i=e[0],a=e[1];return console.warn("react-virtuoso: "+o+" property is deprecated. Pass components."+n+" instead."),r({},a,((t={})[n]=i,t))})),i.components)}return t.subscribe(a.adjustForPrependedItems,function(){console.warn("react-virtuoso: adjustForPrependedItems is no longer supported. Use the firstItemIndex property instead - https://virtuoso.dev/prepend-items.","color: red;","color: inherit;","color: blue;")}),t.subscribe(a.maxHeightCacheSize,function(){console.warn("react-virtuoso: maxHeightCacheSize is no longer necessary. Setting it has no effect - remove it from your code.")}),t.subscribe(a.HeaderContainer,function(){console.warn("react-virtuoso: HeaderContainer is deprecated. Use headerFooterTag if you want to change the wrapper of the header component and pass components.Header to change its contents.")}),t.subscribe(a.FooterContainer,function(){console.warn("react-virtuoso: FooterContainer is deprecated. Use headerFooterTag if you want to change the wrapper of the footer component and pass components.Footer to change its contents.")}),t.subscribe(a.scrollSeek,function(e){var a=e.placeholder,s=o(e,["placeholder"]);console.warn("react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead."),t.publish(i.components,r({},t.getValue(i.components),{ScrollSeekPlaceholder:a})),t.publish(n.scrollSeekConfiguration,s)}),s(a.footer,"Footer","footer"),s(a.header,"Header","header"),s(a.ItemContainer,"Item","ItemContainer"),s(a.ListContainer,"List","ListContainer"),s(a.ScrollContainer,"Scroller","ScrollContainer"),s(a.emptyComponent,"EmptyPlaceholder","emptyComponent"),s(a.GroupContainer,"Group","GroupContainer"),r({},n,i,a)},t.tup(Ne,We)),je=function(e){return n.createElement("div",{style:{height:e.height}})},Ke={position:Ge(),zIndex:1},Ye=n.memo(function(e){var t,r,o,i,a=e.showTopList,s=void 0!==a&&a,l=lt("listState"),u=lt("deviation"),c=st("sizeRanges"),m=lt("itemContent"),f=lt("groupContent"),d=lt("trackItemSizes"),p=(t=c,r=lt("itemSize"),o=d,i=lt("log"),he(function(e){var n=function(e,t,n,r){var o=e.length;if(0===o)return null;for(var i=[],a=0;a<o;a++){var s=e.item(a);if(s&&void 0!==s.dataset.index){var l=parseInt(s.dataset.index),u=parseFloat(s.dataset.knownSize),c=t(s,"offsetHeight");if(0===c&&r("Zero-sized element, this should not happen",{child:s},exports.LogLevel.ERROR),c!==u){var m=i[i.length-1];0===i.length||m.size!==c||m.endIndex!==l-1?i.push({startIndex:l,endIndex:l,size:c}):i[i.length-1].endIndex++}}}return i}(e.children,r,0,i);null!==n&&t(n)},o)),h=lt("EmptyPlaceholder"),g=lt("ScrollSeekPlaceholder")||je,v=lt("ListComponent"),I=lt("ItemComponent"),S=lt("GroupComponent"),C=lt("computeItemKey"),x=lt("isSeeking"),w=lt("groupIndices").length>0,T=lt("paddingTopAddition"),b=lt("scrolledToInitialItem"),y=lt("firstItemIndex"),L=s?{}:{boxSizing:"border-box",paddingTop:l.offsetTop+T,paddingBottom:l.offsetBottom,marginTop:u};return!s&&0===l.items.length&&h&&b?n.createElement(h):n.createElement(v,{ref:p,style:L,"data-test-id":s?"virtuoso-top-item-list":"virtuoso-item-list"},(s?l.topItems:l.items).map(function(e){var t=e.originalIndex,r=C(t+y,e.data);return x?n.createElement(g,{key:r,index:e.index,height:e.size}):"group"===e.type?n.createElement(S,{key:r,"data-index":t,"data-known-size":e.size,"data-item-index":e.index,style:Ke},f(e.index)):n.createElement(I,{key:r,"data-index":t,"data-known-size":e.size,"data-item-index":e.index,"data-item-group-index":e.groupIndex},w?m(e.index,e.groupIndex,e.data):m(e.index,e.data))}))}),qe={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},Ze={width:"100%",height:"100%",position:"absolute",top:0},$e={width:"100%",position:Ge(),top:0},Je=n.memo(function(){var e=lt("HeaderComponent"),t=st("headerHeight"),r=lt("headerFooterTag"),o=he(function(e){return t(N(e,"height"))});return e?n.createElement(r,{ref:o},n.createElement(e)):null}),Qe=n.memo(function(){var e=lt("FooterComponent"),t=st("footerHeight"),r=lt("headerFooterTag"),o=he(function(e){return t(N(e,"height"))});return e?n.createElement(r,{ref:o},n.createElement(e)):null});function Xe(e){var t=e.usePublisher,i=e.useEmitter,a=e.useEmitterValue;return n.memo(function(e){var s=e.style,l=e.children,u=o(e,["style","children"]),c=t("scrollTop"),m=a("ScrollerComponent"),f=Ie(c,t("smoothScrollTargetReached"),m,a("scrollerRef")),d=f.scrollerRef,p=f.scrollByCallback;return i("scrollTo",f.scrollToCallback),i("scrollBy",p),n.createElement(m,r({ref:d,style:r({},qe,s),tabIndex:0},u),l)})}function et(e){var t=e.usePublisher,i=e.useEmitter,a=e.useEmitterValue;return n.memo(function(e){var s=e.style,l=e.children,u=o(e,["style","children"]),c=t("windowScrollTop"),m=a("ScrollerComponent"),f=t("smoothScrollTargetReached"),d=a("totalListHeight"),p=Ie(c,f,m),h=p.scrollerRef,g=p.scrollByCallback,v=p.scrollToCallback;return ve(function(){return h.current=window,function(){h.current=null}},[h]),i("windowScrollTo",v),i("scrollBy",g),n.createElement(m,r({style:r({position:"relative"},s,0!==d?{height:d}:{})},u),l)})}var tt=function(e){var r=e.children,o=st("viewportHeight"),i=he(t.compose(o,function(e){return N(e,"height")}));return n.createElement("div",{style:Ze,ref:i},r)},nt=function(e){var t=e.children,r=ge(st("windowViewportRect"));return n.createElement("div",{ref:r,style:Ze},t)},rt=function(e){var t=e.children,o=lt("TopItemListComponent"),i=lt("headerHeight"),a=r({},$e,{marginTop:i+"px"});return n.createElement(o||"div",{style:a},t)},ot=n.memo(function(e){var t=lt("useWindowScroll"),o=lt("topItemsIndexes").length>0,i=t?nt:tt;return n.createElement(t?mt:ct,r({},e),n.createElement(i,null,n.createElement(Je,null),n.createElement(Ye,null),n.createElement(Qe,null)),o&&n.createElement(rt,null,n.createElement(Ye,{showTopList:!0})))}),it=e.systemToComponent(_e,{required:{},optional:{followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",scrollerRef:"scrollerRef",logLevel:"logLevel",item:"item",group:"group",topItems:"topItems",itemHeight:"itemHeight",scrollingStateChange:"scrollingStateChange",maxHeightCacheSize:"maxHeightCacheSize",footer:"footer",header:"header",ItemContainer:"ItemContainer",ScrollContainer:"ScrollContainer",ListContainer:"ListContainer",GroupContainer:"GroupContainer",emptyComponent:"emptyComponent",HeaderContainer:"HeaderContainer",FooterContainer:"FooterContainer",scrollSeek:"scrollSeek"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",adjustForPrependedItems:"adjustForPrependedItems"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},ot),at=it.Component,st=it.usePublisher,lt=it.useEmitterValue,ut=it.useEmitter,ct=Xe({usePublisher:st,useEmitterValue:lt,useEmitter:ut}),mt=et({usePublisher:st,useEmitterValue:lt,useEmitter:ut}),ft=t.system(function(){var e=t.statefulStream(function(e){return"Item "+e}),n=t.statefulStream({}),r=t.statefulStream("virtuoso-grid-item"),o=t.statefulStream("virtuoso-grid-list"),i=t.statefulStream(Ae),a=t.statefulStream(t.noop),s=function(e,r){return void 0===r&&(r=null),t.statefulStreamFromEmitter(t.pipe(n,t.map(function(t){return t[e]}),t.distinctUntilChanged()),r)};return{itemContent:e,components:n,computeItemKey:i,itemClassName:r,listClassName:o,scrollerRef:a,ListComponent:s("List","div"),ItemComponent:s("Item","div"),ScrollerComponent:s("Scroller","div"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder","div")}}),dt=t.system(function(e){var n=e[0],i=e[1],a={item:De(i.itemContent,"Rename the %citem%c prop to %citemContent."),ItemContainer:t.stream(),ScrollContainer:t.stream(),ListContainer:t.stream(),emptyComponent:t.stream(),scrollSeek:t.stream()};function s(e,n,o){t.connect(t.pipe(e,t.withLatestFrom(i.components),t.map(function(e){var t,i=e[0],a=e[1];return console.warn("react-virtuoso: "+o+" property is deprecated. Pass components."+n+" instead."),r({},a,((t={})[n]=i,t))})),i.components)}return t.subscribe(a.scrollSeek,function(e){var a=e.placeholder,s=o(e,["placeholder"]);console.warn("react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead."),t.publish(i.components,r({},t.getValue(i.components),{ScrollSeekPlaceholder:a})),t.publish(n.scrollSeekConfiguration,s)}),s(a.ItemContainer,"Item","ItemContainer"),s(a.ListContainer,"List","ListContainer"),s(a.ScrollContainer,"Scroller","ScrollContainer"),r({},n,i,a)},t.tup(me,ft)),pt=n.memo(function(){var e=xt("gridState"),t=xt("listClassName"),r=xt("itemClassName"),o=xt("itemContent"),i=xt("computeItemKey"),a=xt("isSeeking"),s=xt("ItemComponent"),l=xt("ListComponent"),u=xt("ScrollSeekPlaceholder"),c=Ct("itemDimensions"),m=he(function(e){var t=e.firstChild;t&&c(t.getBoundingClientRect())});return n.createElement(l,{ref:m,className:t,style:{paddingTop:e.offsetTop,paddingBottom:e.offsetBottom}},e.items.map(function(t){var l=i(t.index);return a?n.createElement(u,{key:l,style:{height:e.itemHeight,width:e.itemWidth}}):n.createElement(s,{className:r,"data-index":t.index,key:l},o(t.index))}))}),ht=function(e){var t=e.children,r=Ct("viewportDimensions"),o=he(function(e){r(e.getBoundingClientRect())});return n.createElement("div",{style:Ze,ref:o},t)},gt=function(e){var t=e.children,r=ge(Ct("windowViewportRect"));return n.createElement("div",{ref:r,style:Ze},t)},vt=n.memo(function(e){var t=r({},e),o=xt("useWindowScroll"),i=o?gt:ht;return n.createElement(o?bt:Tt,r({},t),n.createElement(i,null,n.createElement(pt,null)))}),It=e.systemToComponent(dt,{optional:{totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",scrollerRef:"scrollerRef",item:"item",ItemContainer:"ItemContainer",ScrollContainer:"ScrollContainer",ListContainer:"ListContainer",scrollSeek:"scrollSeek"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange"}},vt),St=It.Component,Ct=It.usePublisher,xt=It.useEmitterValue,wt=It.useEmitter,Tt=Xe({usePublisher:Ct,useEmitterValue:xt,useEmitter:wt}),bt=et({usePublisher:Ct,useEmitterValue:xt,useEmitter:wt}),yt=at,Lt=St;exports.GroupedVirtuoso=at,exports.Virtuoso=yt,exports.VirtuosoGrid=Lt;
|
|
1
|
+
"use strict";var e=require("@virtuoso.dev/react-urx"),t=require("@virtuoso.dev/urx"),n=require("react");function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function o(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function a(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function s(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}function l(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}var u,c,m="up",f=t.system(function(){var e=t.stream(),n=t.statefulStream(0),r=t.stream(),o=t.statefulStream(0),i=t.stream(),a=t.statefulStream(0),s=t.statefulStream(0),l=t.stream(),u=t.stream(),c=t.statefulStream(!1);t.connect(e,o);var f=t.statefulStream("down");return t.connect(t.pipe(e,t.scan(function(e,t){return{direction:t<e.prevScrollTop?m:"down",prevScrollTop:t}},{direction:"down",prevScrollTop:0}),t.map(function(e){return e.direction})),f),{scrollTop:e,viewportHeight:i,headerHeight:a,footerHeight:s,smoothScrollTargetReached:r,scrollTo:l,scrollBy:u,scrollDirection:f,statefulScrollTop:o,deviation:n,scrollingInProgress:c}},[],{singleton:!0});(c=exports.LogLevel||(exports.LogLevel={}))[c.DEBUG=0]="DEBUG",c[c.INFO=1]="INFO",c[c.WARN=2]="WARN",c[c.ERROR=3]="ERROR";var d=((u={})[exports.LogLevel.DEBUG]="debug",u[exports.LogLevel.INFO]="log",u[exports.LogLevel.WARN]="warn",u[exports.LogLevel.ERROR]="error",u),p=t.system(function(){var e=t.statefulStream(exports.LogLevel.ERROR);return{log:t.statefulStream(function(n,r,o){var i;void 0===o&&(o=exports.LogLevel.INFO),o>=(null!=(i=(globalThis||window).VIRTUOSO_LOG_LEVEL)?i:t.getValue(e))&&console[d[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: black",n,r)}),logLevel:e}},[],{singleton:!0}),h=t.system(function(e){var n=e[0].log,r=t.statefulStream(!1),o=t.streamFromEmitter(t.pipe(r,t.filter(function(e){return e}),t.distinctUntilChanged()));return t.subscribe(r,function(e){e&&t.getValue(n)("props updated",{},exports.LogLevel.DEBUG)}),{propsReady:r,didMount:o}},t.tup(p),{singleton:!0}),g={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,totalHeight:0}},v=t.system(function(e){var n=e[0],r=n.scrollTop,o=n.viewportHeight,i=n.headerHeight,a=n.footerHeight,s=t.statefulStream(!1),l=t.statefulStream(!0),u=t.stream(),c=t.stream(),m=t.stream(),f=t.streamFromEmitter(t.pipe(t.merge(t.pipe(t.duc(r),t.skip(1),t.mapTo(!0)),t.pipe(t.duc(r),t.skip(1),t.mapTo(!1),t.debounceTime(100))),t.distinctUntilChanged()));t.connect(t.pipe(t.duc(r),t.map(function(e){return 0===e}),t.distinctUntilChanged()),l),t.connect(l,c);var d=t.streamFromEmitter(t.pipe(t.combineLatest(m,t.duc(r),t.duc(o),t.duc(i),t.duc(a)),t.scan(function(e,t){var n=t[0],r=n.bottom,o=n.offsetBottom,i=t[1],a=t[2],s={viewportHeight:a,scrollTop:i,offsetBottom:o,totalHeight:r+o};return 0===o&&i+a-(r+t[3]+t[4])>-4?{atBottom:!0,state:s}:{atBottom:!1,notAtBottomBecause:s.totalHeight>e.state.totalHeight?"SIZE_INCREASED":0!==o?"NOT_SHOWING_LAST_ITEM":a<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":i<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",state:s}},g),t.distinctUntilChanged(function(e,t){return e&&e.atBottom===t.atBottom})));return t.connect(t.pipe(d,t.map(function(e){return e.atBottom})),s),t.subscribe(s,function(e){setTimeout(function(){return t.publish(u,e)})}),{isScrolling:f,isAtTop:l,isAtBottom:s,atBottomState:d,atTopStateChange:c,atBottomStateChange:u,listStateListener:m}},t.tup(f)),I=t.system(function(e){var n=e[0].scrollTop,r=e[1].isScrolling,o=t.statefulStream(0),i=t.statefulStream(!1),a=t.stream(),s=t.statefulStream(!1);return t.connect(t.pipe(r,t.filter(function(e){return!e}),t.mapTo(0)),o),t.connect(t.pipe(n,t.throttleTime(100),t.withLatestFrom(r),t.filter(function(e){return!!e[1]}),t.scan(function(e,t){return[e[1],t[0]]},[0,0]),t.map(function(e){return e[1]-e[0]})),o),t.connect(t.pipe(o,t.withLatestFrom(s,i,a),t.filter(function(e){return!!e[1]}),t.map(function(e){var t=e[0],n=e[1],r=e[2],o=e[3],i=n.enter;if(r){if((0,n.exit)(t,o))return!1}else if(i(t,o))return!0;return r}),t.distinctUntilChanged()),i),t.subscribe(t.pipe(t.combineLatest(i,o,a),t.withLatestFrom(s)),function(e){var t=e[0],n=e[1];return t[0]&&n&&n.change&&n.change(t[1],t[2])}),{isSeeking:i,scrollSeekConfiguration:s,scrollVelocity:o,scrollSeekRangeChanged:a}},t.tup(f,v),{singleton:!0}),S={lvl:0};function C(e,t,n,r,o){return void 0===r&&(r=S),void 0===o&&(o=S),{k:e,v:t,lvl:n,l:r,r:o}}function x(e){return e===S}function w(){return S}function T(e,t){if(x(e))return S;var n=e.k,r=e.l,o=e.r;if(t===n){if(x(r))return o;if(x(o))return r;var i=R(r);return F(z(e,{k:i[0],v:i[1],l:k(r)}))}return F(z(e,t<n?{l:T(r,t)}:{r:T(o,t)}))}function b(e,t,n){if(void 0===n&&(n="k"),x(e))return[-Infinity,void 0];if(e[n]===t)return[e.k,e.v];if(e[n]<t){var r=b(e.r,t,n);return-Infinity===r[0]?[e.k,e.v]:r}return b(e.l,t,n)}function y(e,t,n){return x(e)?C(t,n,1):t===e.k?z(e,{k:t,v:n}):function(e){return M(P(e))}(z(e,t<e.k?{l:y(e.l,t,n)}:{r:y(e.r,t,n)}))}function L(e,t,n){if(x(e))return[];var r=e.k,o=e.v,i=e.r,a=[];return r>t&&(a=a.concat(L(e.l,t,n))),r>=t&&r<=n&&a.push({k:r,v:o}),r<=n&&(a=a.concat(L(i,t,n))),a}function E(e){return x(e)?[]:[].concat(E(e.l),[{k:e.k,v:e.v}],E(e.r))}function R(e){return x(e.r)?[e.k,e.v]:R(e.r)}function k(e){return x(e.r)?e.l:F(z(e,{r:k(e.r)}))}function z(e,t){return C(void 0!==t.k?t.k:e.k,void 0!==t.v?t.v:e.v,void 0!==t.lvl?t.lvl:e.lvl,void 0!==t.l?t.l:e.l,void 0!==t.r?t.r:e.r)}function H(e){return x(e)||e.lvl>e.r.lvl}function F(e){var t=e.l,n=e.r,r=e.lvl;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(H(t))return P(z(e,{lvl:r-1}));if(x(t)||x(t.r))throw new Error("Unexpected empty nodes");return z(t.r,{l:z(t,{r:t.r.l}),r:z(e,{l:t.r.r,lvl:r-1}),lvl:r})}if(H(e))return M(z(e,{lvl:r-1}));if(x(n)||x(n.l))throw new Error("Unexpected empty nodes");var o=n.l,i=H(o)?n.lvl-1:n.lvl;return z(o,{l:z(e,{r:o.l,lvl:r-1}),r:M(z(n,{l:o.r,lvl:i})),lvl:o.lvl+1})}function B(e,t,n){return x(e)?[]:O(L(e,b(e,t)[0],n),function(e){return{index:e.k,value:e.v}})}function O(e,t){var n=e.length;if(0===n)return[];for(var r=t(e[0]),o=r.index,i=r.value,a=[],s=1;s<n;s++){var l=t(e[s]),u=l.index,c=l.value;a.push({start:o,end:u-1,value:i}),o=u,i=c}return a.push({start:o,end:Infinity,value:i}),a}function M(e){var t=e.r,n=e.lvl;return x(t)||x(t.r)||t.lvl!==n||t.r.lvl!==n?e:z(t,{l:z(e,{r:t.l}),lvl:n+1})}function P(e){var t=e.l;return x(t)||t.lvl!==e.lvl?e:z(t,{r:z(e,{l:t.r})})}function U(e,t,n,r){void 0===r&&(r=0);for(var o=e.length-1;r<=o;){var i=Math.floor((r+o)/2),a=n(e[i],t);if(0===a)return i;if(-1===a){if(o-r<2)return i-1;o=i-1}else{if(o===r)return i;r=i+1}}throw new Error("Failed binary finding record in array - "+e.join(",")+", searched for "+t)}function V(e,t,n){return e[U(e,t,n)]}function N(e,t){return Math.round(e.getBoundingClientRect()[t])}function G(e){var t=e.size,n=e.startIndex,r=e.endIndex;return function(e){return e.start===n&&(e.end===r||Infinity===e.end)&&e.value===t}}function A(e,t){var n=e.index;return t===n?0:t<n?-1:1}function W(e,t){var n=e.offset;return t===n?0:t<n?-1:1}function D(e){return{index:e.index,value:e}}function _(e,t){var n=t[0],r=t[1];n.length>0&&(0,t[2])("received item sizes",n,exports.LogLevel.DEBUG);var o=e.sizeTree,i=e.offsetTree,s=o,l=0;if(r.length>0&&x(o)&&2===n.length){var u=n[0].size,c=n[1].size;s=r.reduce(function(e,t){return y(y(e,t,u),t+1,c)},s)}else{var m=function(e,t){for(var n,r=x(e)?0:Infinity,o=a(t);!(n=o()).done;){var i=n.value,s=i.size,l=i.startIndex,u=i.endIndex;if(r=Math.min(r,l),x(e))e=y(e,0,s);else{var c=B(e,l-1,u+1);if(!c.some(G(i))){for(var m,f=!1,d=!1,p=a(c);!(m=p()).done;){var h=m.value,g=h.start,v=h.end,I=h.value;f?(u>=g||s===I)&&(e=T(e,g)):(d=I!==s,f=!0),v>u&&u>=g&&I!==s&&(e=y(e,u+1,I))}d&&(e=y(e,l,s))}}}return[e,r]}(s,n);s=m[0],l=m[1]}if(s===o)return e;var f=0,d=0,p=0,h=0;if(0!==l){h=U(i,l-1,A),p=i[h].offset;var g=b(s,l-1);f=g[0],d=g[1],i.length&&i[h].size===b(s,l)[1]&&(h-=1),i=i.slice(0,h+1)}else i=[];for(var v,I=a(B(s,l,Infinity));!(v=I()).done;){var S=v.value,C=S.start,L=S.value,E=(C-f)*d+p;i.push({offset:E,size:L,index:C}),f=C,p=E,d=L}return{sizeTree:s,offsetTree:i,groupOffsetTree:r.reduce(function(e,t){return y(e,t,j(t,i))},w()),lastIndex:f,lastOffset:p,lastSize:d,groupIndices:r}}function j(e,t){if(0===t.length)return 0;var n=V(t,e,A);return n.size*(e-n.index)+n.offset}function K(e,t){if(!Y(t))return e;for(var n=0;t.groupIndices[n]<=e+n;)n++;return e+n}function Y(e){return!x(e.groupOffsetTree)}var q={offsetHeight:"height",offsetWidth:"width"},Z=t.system(function(e){var n=e[0].log,o=t.stream(),i=t.stream(),a=t.stream(),s=t.statefulStream(0),l=t.statefulStream([]),u=t.statefulStream(void 0),c=t.statefulStream(void 0),m=t.statefulStream(function(e,t){return N(e,q[t])}),f=t.statefulStream(void 0),d={offsetTree:[],sizeTree:w(),groupOffsetTree:w(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]},p=t.statefulStreamFromEmitter(t.pipe(o,t.withLatestFrom(l,n),t.scan(_,d),t.distinctUntilChanged()),d);t.connect(t.pipe(l,t.filter(function(e){return e.length>0}),t.withLatestFrom(p),t.map(function(e){var t=e[0],n=e[1],o=t.reduce(function(e,t,r){return y(e,t,j(t,n.offsetTree)||r)},w());return r({},n,{groupIndices:t,groupOffsetTree:o})})),p),t.connect(t.pipe(i,t.withLatestFrom(p),t.filter(function(e){return e[0]<e[1].lastIndex}),t.map(function(e){var t=e[1];return[{startIndex:e[0],endIndex:t.lastIndex,size:t.lastSize}]})),o),t.connect(u,c);var h=t.statefulStreamFromEmitter(t.pipe(u,t.map(function(e){return void 0===e})),!0);t.connect(t.pipe(c,t.filter(function(e){return void 0!==e&&x(t.getValue(p).sizeTree)}),t.map(function(e){return[{startIndex:0,endIndex:0,size:e}]})),o);var g=t.streamFromEmitter(t.pipe(o,t.withLatestFrom(p),t.scan(function(e,t){var n=t[1];return{changed:n!==e.sizes,sizes:n}},{changed:!1,sizes:d}),t.map(function(e){return e.changed})));t.connect(t.pipe(s,t.scan(function(e,t){return{diff:e.prev-t,prev:t}},{diff:0,prev:0}),t.map(function(e){return e.diff}),t.filter(function(e){return e>0})),a),t.subscribe(t.pipe(s,t.withLatestFrom(n)),function(e){e[0]<0&&(0,e[1])("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},exports.LogLevel.ERROR)});var v=t.streamFromEmitter(a);return t.connect(t.pipe(a,t.withLatestFrom(p),t.map(function(e){var t=e[0],n=e[1];if(n.groupIndices.length>0)throw new Error("Virtuoso: prepending items does not work with groups");return E(n.sizeTree).reduce(function(e,n){var r=n.k,o=n.v;return{ranges:[].concat(e.ranges,[{startIndex:e.prevIndex,endIndex:r+t-1,size:e.prevSize}]),prevIndex:r+t,prevSize:o}},{ranges:[],prevIndex:0,prevSize:n.lastSize}).ranges})),o),{data:f,totalCount:i,sizeRanges:o,groupIndices:l,defaultItemSize:c,fixedItemSize:u,unshiftWith:a,beforeUnshiftWith:v,firstItemIndex:s,sizes:p,listRefresh:g,trackItemSizes:h,itemSize:m}},t.tup(p),{singleton:!0}),$="undefined"!=typeof document&&"scrollBehavior"in document.documentElement.style;function J(e){var t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),t.behavior&&$||(t.behavior="auto"),t.offset||(t.offset=0),t}var Q=t.system(function(e){var n=e[0],r=n.sizes,o=n.totalCount,i=n.listRefresh,a=e[1],s=a.scrollingInProgress,l=a.viewportHeight,u=a.scrollTo,c=a.smoothScrollTargetReached,m=a.headerHeight,f=a.footerHeight,d=e[2].log,p=t.stream(),h=t.statefulStream(0),g=null,v=null,I=null;function S(){g&&(g(),g=null),I&&(I(),I=null),v&&(clearTimeout(v),v=null),t.publish(s,!1)}return t.connect(t.pipe(p,t.withLatestFrom(r,l,o,h,m,f,d),t.map(function(e){var n=e[0],r=e[1],o=e[2],a=e[3],l=e[4],u=e[5],m=e[6],f=e[7],d=J(n),h=d.align,C=d.behavior,x=d.offset,w=a-1,T=d.index;T=K(T,r);var y=j(T=Math.max(0,T,Math.min(w,T)),r.offsetTree)+u;"end"===h?(y=Math.round(y-o+b(r.sizeTree,T)[1]),T===w&&(y+=m)):"center"===h?y=Math.round(y-o/2+b(r.sizeTree,T)[1]/2):y-=l,x&&(y+=x);var L=function(e){S(),e?(f("retrying to scroll to",{location:n},exports.LogLevel.DEBUG),t.publish(p,n)):f("list did not change, scroll successful",{},exports.LogLevel.DEBUG)};if(S(),"smooth"===C){var E=!1;I=t.subscribe(i,function(e){E=E||e}),g=t.handleNext(c,function(){L(E)})}else g=t.handleNext(t.pipe(i,function(e){var t=setTimeout(function(){e(!1)},50);return function(n){n&&(e(!0),clearTimeout(t))}}),L);return v=setTimeout(function(){S()},1200),t.publish(s,!0),f("scrolling from index to",{index:T,top:y,behavior:C},exports.LogLevel.DEBUG),{top:y,behavior:C}})),u),{scrollToIndex:p,scrollingInProgress:s,topListHeight:h}},t.tup(Z,f,p),{singleton:!0});function X(e,t,n){return"number"==typeof e?n===m&&"top"===t||"down"===n&&"bottom"===t?e:0:n===m?"top"===t?e.main:e.reverse:"bottom"===t?e.main:e.reverse}function ee(e,t){return"number"==typeof e?e:e[t]||0}var te=t.system(function(e){var n=e[0],r=n.scrollTop,o=n.viewportHeight,i=n.deviation,a=n.headerHeight,l=t.stream(),u=t.statefulStream(0),c=t.statefulStream(0),f=t.statefulStream(0);return{listBoundary:l,overscan:f,topListHeight:u,increaseViewportBy:c,visibleRange:t.statefulStreamFromEmitter(t.pipe(t.combineLatest(t.duc(r),t.duc(o),t.duc(a),t.duc(l,s),t.duc(f),t.duc(u),t.duc(i),t.duc(c)),t.map(function(e){var t=e[0],n=e[1],r=e[2],o=e[3],i=o[0],a=o[1],s=e[4],l=e[5],u=e[6],c=e[7],f=t-u,d=Math.max(r-f,0),p="none",h=ee(c,"top"),g=ee(c,"bottom");return i-=u,a+=r,(i+=r)>t+l-h&&(p=m),(a-=u)<t-d+n+g&&(p="down"),"none"!==p?[Math.max(f-r-X(s,"top",p)-h,0),f-d+n+X(s,"bottom",p)+g]:null}),t.filter(function(e){return null!=e}),t.distinctUntilChanged(s)),[0,0])}},t.tup(f),{singleton:!0}),ne=t.system(function(e){var n=e[0],o=n.scrollTop,i=n.scrollTo,a=t.stream(),s=t.stream(),l=t.stream(),u=t.statefulStream(!1);return t.connect(t.pipe(t.combineLatest(s,a),t.map(function(e){return Math.max(0,e[0]-e[1].offsetTop)})),o),t.connect(t.pipe(i,t.withLatestFrom(a),t.map(function(e){var t=e[0];return r({},t,{top:t.top+e[1].offsetTop})})),l),{useWindowScroll:u,windowScrollTop:s,windowViewportRect:a,windowScrollTo:l}},t.tup(f)),re={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},oe={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},ie=Math.ceil,ae=Math.floor,se=Math.min,le=Math.max;function ue(e){return ie(e)-e<.03?ie(e):ae(e)}function ce(e,t){return Array.from({length:t-e+1}).map(function(t,n){return{index:n+e}})}var me=t.system(function(e){var n=e[0],o=n.overscan,i=n.visibleRange,a=n.listBoundary,u=e[1],c=u.scrollTop,m=u.viewportHeight,f=u.scrollBy,d=u.scrollTo,p=u.smoothScrollTargetReached,h=e[2],g=e[3],v=e[4],I=v.propsReady,S=v.didMount,C=e[5],x=C.windowViewportRect,w=C.windowScrollTo,T=C.useWindowScroll,b=C.windowScrollTop,y=t.statefulStream(0),L=t.statefulStream(0),E=t.statefulStream(re),R=t.statefulStream({height:0,width:0}),k=t.statefulStream({height:0,width:0}),z=t.stream();t.connect(t.pipe(S,t.withLatestFrom(L),t.filter(function(e){return 0!==e[1]}),t.map(function(e){return{items:ce(0,e[1]-1),top:0,bottom:0,offsetBottom:0,offsetTop:0,itemHeight:0,itemWidth:0}})),E),t.connect(t.pipe(t.combineLatest(t.duc(y),i,t.duc(k,function(e,t){return e&&e.width===t.width&&e.height===t.height})),t.withLatestFrom(R),t.map(function(e){var t=e[0],n=t[0],r=t[1],o=r[0],i=r[1],a=t[2],s=e[1],l=a.height,u=a.width,c=s.width;if(0===n||0===c)return re;if(0===u)return oe;var m=ue(c/u),f=m*ae(o/l),d=m*ie(i/l)-1;d=se(n-1,d);var p=ce(f=se(d,le(0,f)),d),h=fe(s,a,p),g=h.top,v=h.bottom;return{items:p,offsetTop:g,offsetBottom:ie(n/m)*l-v,top:g,bottom:v,itemHeight:l,itemWidth:u}})),E),t.connect(t.pipe(R,t.map(function(e){return e.height})),m),t.connect(t.pipe(t.combineLatest(R,k,E),t.map(function(e){var t=fe(e[0],e[1],e[2].items);return[t.top,t.bottom]}),t.distinctUntilChanged(s)),a),t.connect(t.pipe(a,t.withLatestFrom(E),t.map(function(e){return{bottom:e[0][1],offsetBottom:e[1].offsetBottom}})),h.listStateListener);var H=t.streamFromEmitter(t.pipe(t.duc(E),t.filter(function(e){return e.items.length>0}),t.withLatestFrom(y),t.filter(function(e){var t=e[0].items;return t[t.length-1].index===e[1]-1}),t.map(function(e){return e[1]-1}),t.distinctUntilChanged())),F=t.streamFromEmitter(t.pipe(t.duc(E),t.filter(function(e){var t=e.items;return t.length>0&&0===t[0].index}),t.mapTo(0),t.distinctUntilChanged())),B=t.streamFromEmitter(t.pipe(t.duc(E),t.filter(function(e){return e.items.length>0}),t.map(function(e){var t=e.items;return{startIndex:t[0].index,endIndex:t[t.length-1].index}}),t.distinctUntilChanged(l)));t.connect(B,g.scrollSeekRangeChanged),t.connect(t.pipe(z,t.withLatestFrom(R,k,y),t.map(function(e){var t=e[1],n=e[2],r=e[3],o=J(e[0]),i=o.align,a=o.behavior,s=o.offset,l=o.index,u=de(t,n,l=Math.max(0,l,Math.min(r-1,l)));return"end"===i?u=Math.round(u-t.height+n.height):"center"===i&&(u=Math.round(u-t.height/2+n.height/2)),s&&(u+=s),{top:u,behavior:a}})),d);var O=t.statefulStreamFromEmitter(t.pipe(E,t.map(function(e){return e.offsetBottom+e.bottom})),0);return t.connect(t.pipe(x,t.map(function(e){return{width:e.visibleWidth,height:e.visibleHeight}})),R),r({totalCount:y,viewportDimensions:R,itemDimensions:k,scrollTop:c,overscan:o,scrollBy:f,scrollTo:d,scrollToIndex:z,smoothScrollTargetReached:p,windowViewportRect:x,windowScrollTo:w,useWindowScroll:T,windowScrollTop:b,initialItemCount:L},g,{gridState:E,totalListHeight:O},h,{startReached:F,endReached:H,rangeChanged:B,propsReady:I})},t.tup(te,f,v,I,h,ne));function fe(e,t,n){var r=t.height;return void 0===r||0===n.length?{top:0,bottom:0}:{top:de(e,t,n[0].index),bottom:de(e,t,n[n.length-1].index)+r}}function de(e,t,n){var r=ue(e.width/t.width);return ae(n/r)*t.height}function pe(e,t){void 0===t&&(t=!0);var r=n.useRef(null),o=function(e){};if("undefined"!=typeof ResizeObserver){var i=new ResizeObserver(function(t){var n=t[0].target;null!==n.offsetParent&&e(n)});o=function(e){e&&t?(i.observe(e),r.current=e):(r.current&&i.unobserve(r.current),r.current=null)}}return{ref:r,callbackRef:o}}function he(e,t){return void 0===t&&(t=!0),pe(e,t).callbackRef}function ge(e){var t=n.useRef(null),r=n.useCallback(function(n){if(null!==n){var r=n.getBoundingClientRect(),o=window.innerHeight-Math.max(0,r.top),i=r.top+window.pageYOffset;t.current={offsetTop:i,visibleHeight:o,visibleWidth:r.width},e(t.current)}},[e]),o=pe(r),i=o.callbackRef,a=o.ref,s=n.useCallback(function(){r(a.current)},[r,a]);return n.useEffect(function(){return window.addEventListener("scroll",s),window.addEventListener("resize",s),function(){window.removeEventListener("scroll",s),window.removeEventListener("resize",s)}},[s]),i}var ve="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;function Ie(e,r,o,i){void 0===i&&(i=t.noop);var a=n.useRef(null),s=n.useRef(null),l=n.useRef(null),u=n.useCallback(function(t){var n=t.target,o=n===window||n===document?window.pageYOffset||document.documentElement.scrollTop:n.scrollTop;e(Math.max(o,0)),null!==s.current&&(o===s.current||o<=0||o===n.scrollHeight-N(n,"height"))&&(s.current=null,r(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,r]);return n.useEffect(function(){var e=a.current;return i(a.current),u({target:e}),e.addEventListener("scroll",u,{passive:!0}),function(){i(null),e.removeEventListener("scroll",u)}},[a,u,o,i]),{scrollerRef:a,scrollByCallback:function(e){null===s.current&&a.current.scrollBy(e)},scrollToCallback:function(t){var n=a.current;if(n&&(!("offsetHeight"in n)||0!==n.offsetHeight)){var o,i,u,c="smooth"===t.behavior;if(n===window?(i=Math.max(N(document.documentElement,"height"),document.documentElement.scrollHeight),o=window.innerHeight,u=document.documentElement.scrollTop):(i=n.scrollHeight,o=N(n,"height"),u=n.scrollTop),Math.abs(o-i)<1.01||t.top===u)return e(u),void(c&&r(!0));t.top=Math.max(Math.min(i-o,t.top),0),c?(s.current=t.top,l.current&&clearTimeout(l.current),l.current=setTimeout(function(){l.current=null,s.current=null,r(!0)},1e3)):s.current=null,n.scrollTo(t)}}}}var Se=t.system(function(e){var n=e[0],r=n.sizes,o=n.listRefresh,i=n.defaultItemSize,a=e[1].scrollToIndex,s=e[2].didMount,l=t.statefulStream(!0),u=t.statefulStream(0);return t.connect(t.pipe(s,t.withLatestFrom(u),t.filter(function(e){return 0!==e[1]}),t.mapTo(!1)),l),t.subscribe(t.pipe(t.combineLatest(o,s),t.withLatestFrom(l,r,i),t.filter(function(e){var t=e[1],n=e[3];return e[0][1]&&(!x(e[2].sizeTree)||void 0!==n)&&!t}),t.withLatestFrom(u)),function(e){var n=e[1];setTimeout(function(){t.publish(a,n),setTimeout(function(){return t.publish(l,!0)})})}),{scrolledToInitialItem:l,initialTopMostItemIndex:u}},t.tup(Z,Q,h),{singleton:!0});function Ce(e){return!!e&&("smooth"===e?"smooth":"auto")}var xe=t.system(function(e){var n=e[0],r=n.totalCount,o=n.listRefresh,i=e[1],a=i.isAtBottom,s=i.atBottomState,l=e[2].scrollToIndex,u=e[3].scrolledToInitialItem,c=e[4],m=c.propsReady,f=c.didMount,d=e[5].log,p=t.statefulStream(!1),h=null;function g(e,n){t.publish(l,{index:e-1,align:"end",behavior:n})}return t.subscribe(t.pipe(t.combineLatest(t.pipe(t.duc(r),t.skip(1)),f),t.withLatestFrom(t.duc(p),a,u),t.map(function(e){var t=e[0],n=t[0],r=t[1]&&e[3],o="auto";return r&&(o=function(e,t){return"function"==typeof e?Ce(e(t)):t&&Ce(e)}(e[1],e[2]),r=r&&!!o),{totalCount:n,shouldFollow:r,followOutputBehavior:o}}),t.filter(function(e){return e.shouldFollow})),function(e){var n=e.totalCount,r=e.followOutputBehavior;h&&(h(),h=null),h=t.handleNext(o,function(){g(n,r),h=null})}),t.subscribe(t.pipe(t.combineLatest(t.duc(p),r,m),t.filter(function(e){return e[0]&&e[2]}),t.scan(function(e,t){var n=t[1];return{refreshed:e.value===n,value:n}},{refreshed:!1,value:0}),t.filter(function(e){return e.refreshed}),t.withLatestFrom(p,r)),function(e){var n=e[1],r=e[2],o=t.handleNext(s,function(e){!n||e.atBottom||"SIZE_INCREASED"!==e.notAtBottomBecause||h||(t.getValue(d)("scrolling to bottom due to increased size",{totalCount:r},exports.LogLevel.DEBUG),g(r,"auto"))});setTimeout(o,100)}),t.subscribe(t.pipe(t.combineLatest(t.duc(p),s),t.withLatestFrom(r)),function(e){var t=e[0],n=t[1];t[0]&&!n.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===n.notAtBottomBecause&&g(e[1],"auto")}),{followOutput:p}},t.tup(Z,v,Q,Se,h,p));function we(e){return e.reduce(function(e,t){return e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e},{totalCount:0,groupIndices:[]})}var Te=t.system(function(e){var n=e[0],r=n.totalCount,o=n.groupIndices,i=n.sizes,a=e[1],s=a.scrollTop,l=a.headerHeight,u=t.stream(),c=t.stream(),m=t.streamFromEmitter(t.pipe(u,t.map(we)));return t.connect(t.pipe(m,t.map(t.prop("totalCount"))),r),t.connect(t.pipe(m,t.map(t.prop("groupIndices"))),o),t.connect(t.pipe(t.combineLatest(s,i,l),t.filter(function(e){return Y(e[1])}),t.map(function(e){return b(e[1].groupOffsetTree,Math.max(e[0]-e[2],0),"v")[0]}),t.distinctUntilChanged(),t.map(function(e){return[e]})),c),{groupCounts:u,topItemsIndexes:c}},t.tup(Z,f)),be={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0};function ye(e,t,n){if(0===e.length)return[];if(!Y(t))return e.map(function(e){return r({},e,{index:e.index+n,originalIndex:e.index})});for(var o,i=[],s=B(t.groupOffsetTree,e[0].index,e[e.length-1].index),l=void 0,u=0,c=a(e);!(o=c()).done;){var m=o.value;(!l||l.end<m.index)&&(l=s.shift(),u=t.groupIndices.indexOf(l.start)),i.push(r({},m.index===l.start?{type:"group",index:u}:{index:m.index-(u+1)+n,groupIndex:u},{size:m.size,offset:m.offset,originalIndex:m.index,data:m.data}))}return i}function Le(e,t,n,r,o){var i=0,a=0;if(e.length>0){i=e[0].offset;var s=e[e.length-1];a=s.offset+s.size}var l=i,u=r.lastOffset+(n-r.lastIndex)*r.lastSize-a;return{items:ye(e,r,o),topItems:ye(t,r,o),topListHeight:t.reduce(function(e,t){return t.size+e},0),offsetTop:i,offsetBottom:u,top:l,bottom:a,totalCount:n}}var Ee,Re,ke,ze=t.system(function(e){var n=e[0],o=n.sizes,i=n.totalCount,u=n.data,c=n.firstItemIndex,m=e[1],f=e[2],d=f.visibleRange,p=f.listBoundary,h=f.topListHeight,g=e[3],v=g.scrolledToInitialItem,I=g.initialTopMostItemIndex,S=e[4].topListHeight,C=e[5],w=e[6].didMount,T=t.statefulStream([]),y=t.stream();t.connect(m.topItemsIndexes,T);var L=t.statefulStreamFromEmitter(t.pipe(t.combineLatest(w,t.duc(d),t.duc(i),t.duc(o),t.duc(I),v,t.duc(T),t.duc(c),u),t.filter(function(e){return e[0]}),t.map(function(e){var n=e[1],r=n[0],o=n[1],i=e[2],s=e[4],l=e[5],u=e[6],c=e[7],m=e[8],f=e[3],d=f.sizeTree,p=f.offsetTree;if(0===i||0===r&&0===o)return be;if(x(d))return Le(function(e,t,n){if(Y(t)){var r=K(e,t);return[{index:b(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}(s,f,m),[],i,f,c);var h=[];if(u.length>0)for(var g,v=u[0],I=u[u.length-1],S=0,C=a(B(d,v,I));!(g=C()).done;)for(var w=g.value,T=w.value,y=Math.max(w.start,v),L=Math.min(w.end,I),E=y;E<=L;E++)h.push({index:E,size:T,offset:S,data:m&&m[E]}),S+=T;if(!l)return Le([],h,i,f,c);var R=u.length>0?u[u.length-1]+1:0,k=function(e,t,n,r){return void 0===r&&(r=0),r>0&&(t=Math.max(t,V(e,r,A).offset)),O((i=n,s=U(o=e,t,a=W),l=U(o,i,a,s),o.slice(s,l+1)),D);var o,i,a,s,l}(p,r,o,R);if(0===k.length)return null;var z=i-1;return Le(t.tap([],function(e){for(var t,n=a(k);!(t=n()).done;){var i=t.value,s=i.value,l=s.offset,u=i.start,c=s.size;s.offset<r&&(l+=((u+=Math.floor((r-s.offset)/c))-i.start)*c),u<R&&(l+=(R-u)*c,u=R);for(var f=Math.min(i.end,z),d=u;d<=f&&!(l>=o);d++)e.push({index:d,size:c,offset:l,data:m&&m[d]}),l+=c}}),h,i,f,c)}),t.filter(function(e){return null!==e}),t.distinctUntilChanged()),be);return t.connect(t.pipe(u,t.filter(function(e){return void 0!==e}),t.map(function(e){return e.length})),i),t.connect(t.pipe(L,t.map(t.prop("topListHeight"))),S),t.connect(S,h),t.connect(L,C.listStateListener),t.connect(t.pipe(L,t.map(function(e){return[e.top,e.bottom]})),p),t.connect(t.pipe(L,t.map(function(e){return e.items})),y),r({listState:L,topItemsIndexes:T,endReached:t.streamFromEmitter(t.pipe(L,t.filter(function(e){return e.items.length>0}),t.withLatestFrom(i,u),t.filter(function(e){var t=e[0].items;return t[t.length-1].originalIndex===e[1]-1}),t.map(function(e){return[e[1]-1,e[2]]}),t.distinctUntilChanged(s),t.map(function(e){return e[0]}))),startReached:t.streamFromEmitter(t.pipe(L,t.throttleTime(200),t.filter(function(e){var t=e.items;return t.length>0&&t[0].originalIndex===e.topItems.length}),t.map(function(e){return e.items[0].index}),t.distinctUntilChanged())),rangeChanged:t.streamFromEmitter(t.pipe(L,t.filter(function(e){return e.items.length>0}),t.map(function(e){var t=e.items;return{startIndex:t[0].index,endIndex:t[t.length-1].index}}),t.distinctUntilChanged(l))),itemsRendered:y},C)},t.tup(Z,Te,te,Se,Q,v,h),{singleton:!0}),He=t.system(function(e){var n=e[0],r=n.sizes,o=n.firstItemIndex,i=n.data,s=e[1].listState,l=e[2].didMount,u=t.statefulStream(0);return t.connect(t.pipe(l,t.withLatestFrom(u),t.filter(function(e){return 0!==e[1]}),t.withLatestFrom(r,o,i),t.map(function(e){var t=e[0][1],n=e[1],r=e[2],o=e[3],i=void 0===o?[]:o,s=0;if(n.groupIndices.length>0)for(var l,u=a(n.groupIndices);!((l=u()).done||l.value-s>=t);)s++;var c=t+s;return Le(Array.from({length:c}).map(function(e,t){return{index:t,size:0,offset:0,data:i[t]}}),[],c,n,r)})),s),{initialItemCount:u}},t.tup(Z,ze,h),{singleton:!0}),Fe=t.system(function(e){var n=e[0].topItemsIndexes,r=t.statefulStream(0);return t.connect(t.pipe(r,t.filter(function(e){return e>0}),t.map(function(e){return Array.from({length:e}).map(function(e,t){return t})})),n),{topItemCount:r}},t.tup(ze)),Be=t.system(function(e){var n=e[0],r=n.footerHeight,o=n.headerHeight,i=e[1].listState,a=t.stream(),s=t.statefulStreamFromEmitter(t.pipe(t.combineLatest(r,o,i),t.map(function(e){var t=e[2];return e[0]+e[1]+t.offsetBottom+t.bottom})),0);return t.connect(t.duc(s),a),{totalListHeight:s,totalListHeightChanged:a}},t.tup(f,ze),{singleton:!0}),Oe=t.system(function(e){var n=e[0],r=n.scrollBy,o=n.scrollTop,i=n.scrollDirection,a=n.deviation,s=n.scrollingInProgress,l=e[1].isScrolling,u=e[3],c=u.beforeUnshiftWith,f=u.sizes,d=e[4].log,p=t.streamFromEmitter(t.pipe(e[2].listState,t.scan(function(e,t){var n=e[1],r=t.items,o=0;if(n.length>0&&r.length>0){var i=r[0].originalIndex,a=n[0].originalIndex;if(0!==i||0!==a)if(i===a)o=r[0].size-n[0].size;else for(var s=function(e){var t=r[e],i=n.find(function(e){return e.originalIndex===t.originalIndex});return i?t.offset!==i.offset?(o=t.offset-i.offset,"break"):void 0:"continue"},l=r.length-1;l>=0;l--){var u=s(l);if("continue"!==u&&"break"===u)break}}return[o,r]},[0,[]]),t.filter(function(e){return 0!==e[0]}),t.withLatestFrom(o,i,s,d),t.filter(function(e){return!e[3]&&0!==e[1]&&e[2]===m}),t.map(function(e){var t=e[0][0];return(0,e[4])("Upward scrolling compensation",{amount:t},exports.LogLevel.DEBUG),t})));return t.connect(t.pipe(p,t.withLatestFrom(a),t.map(function(e){return e[1]-e[0]})),a),t.subscribe(t.pipe(t.combineLatest(t.statefulStreamFromEmitter(l,!1),a),t.filter(function(e){return!e[0]&&0!==e[1]}),t.map(function(e){return e[1]}),t.throttleTime(1)),function(e){e>0?(t.publish(r,{top:-e,behavior:"auto"}),t.publish(a,0)):(t.publish(a,0),t.publish(r,{top:-e,behavior:"auto"}))}),t.connect(t.pipe(c,t.withLatestFrom(f),t.map(function(e){return e[0]*e[1].lastSize})),p),{deviation:a}},t.tup(f,v,ze,Z,p)),Me=t.system(function(e){var n=e[0].totalListHeight,r=e[1].didMount,o=e[2].scrollTo,i=t.statefulStream(0);return t.subscribe(t.pipe(r,t.withLatestFrom(i),t.filter(function(e){return 0!==e[1]}),t.map(function(e){return{top:e[1]}})),function(e){t.handleNext(t.pipe(n,t.filter(function(e){return 0!==e})),function(){setTimeout(function(){t.publish(o,e)})})}),{initialScrollTop:i}},t.tup(Be,h,f),{singleton:!0}),Pe=t.system(function(e){var n=e[0].viewportHeight,r=e[1].totalListHeight,o=t.statefulStream(!1);return{alignToBottom:o,paddingTopAddition:t.statefulStreamFromEmitter(t.pipe(t.combineLatest(o,n,r),t.filter(function(e){return e[0]}),t.map(function(e){return Math.max(0,e[1]-e[2])}),t.distinctUntilChanged()),0)}},t.tup(f,Be),{singleton:!0}),Ue=t.system(function(e){var n=e[0],r=n.sizes,o=n.totalCount,i=e[1],a=i.scrollTop,s=i.viewportHeight,l=i.headerHeight,u=i.scrollingInProgress,c=e[2].scrollToIndex,m=t.stream();return t.connect(t.pipe(m,t.withLatestFrom(r,s,o,l,a),t.map(function(e){var n=e[0],r=n.index,o=n.behavior,i=void 0===o?"auto":o,a=n.done,s=e[1],l=e[2],c=e[4],m=e[5],f=e[3]-1,d=null;r=K(r,s);var p=j(r=Math.max(0,r,Math.min(f,r)),s.offsetTree)+c;return p<m?d={index:r,behavior:i,align:"start"}:p+b(s.sizeTree,r)[1]>m+l&&(d={index:r,behavior:i,align:"end"}),d?a&&t.handleNext(t.pipe(u,t.skip(1),t.filter(function(e){return!1===e})),a):a&&a(),d}),t.filter(function(e){return null!==e})),c),{scrollIntoView:m}},t.tup(Z,f,Q,ze,p),{singleton:!0}),Ve=t.system(function(e){return r({},e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},t.tup(te,He,h,I,Be,Me,Pe,ne,Ue)),Ne=t.system(function(e){var n=e[0],i=n.totalCount,a=n.sizeRanges,s=n.fixedItemSize,l=n.defaultItemSize,u=n.trackItemSizes,c=n.itemSize,m=n.data,f=n.firstItemIndex,d=n.groupIndices,p=e[1],h=p.initialTopMostItemIndex,g=p.scrolledToInitialItem,v=e[2],I=e[3],S=e[4],C=S.listState,x=S.topItemsIndexes,w=o(S,["listState","topItemsIndexes"]),T=e[5].scrollToIndex,b=e[7].topItemCount,y=e[8].groupCounts,L=e[9],E=e[10];return t.connect(w.rangeChanged,L.scrollSeekRangeChanged),t.connect(t.pipe(L.windowViewportRect,t.map(t.prop("visibleHeight"))),v.viewportHeight),r({totalCount:i,data:m,firstItemIndex:f,sizeRanges:a,initialTopMostItemIndex:h,scrolledToInitialItem:g,topItemsIndexes:x,topItemCount:b,groupCounts:y,fixedItemHeight:s,defaultItemHeight:l},I,{listState:C,scrollToIndex:T,trackItemSizes:u,itemSize:c,groupIndices:d},w,L,v,E)},t.tup(Z,Se,f,xe,ze,Q,Oe,Fe,Te,Ve,p)),Ge=(Ee=function(){if("undefined"==typeof document)return"sticky";var e=document.createElement("div");return e.style.position="-webkit-sticky","-webkit-sticky"===e.style.position?"-webkit-sticky":"sticky"},ke=!1,function(){return ke||(ke=!0,Re=Ee()),Re});function Ae(e){return e}var We=t.system(function(){var e=t.statefulStream(function(e){return"Item "+e}),n=t.statefulStream(function(e){return"Group "+e}),r=t.statefulStream({}),o=t.statefulStream(Ae),i=t.statefulStream("div"),a=t.statefulStream(t.noop),s=function(e,n){return void 0===n&&(n=null),t.statefulStreamFromEmitter(t.pipe(r,t.map(function(t){return t[e]}),t.distinctUntilChanged()),n)};return{itemContent:e,groupContent:n,components:r,computeItemKey:o,headerFooterTag:i,scrollerRef:a,FooterComponent:s("Footer"),HeaderComponent:s("Header"),TopItemListComponent:s("TopItemList"),ListComponent:s("List","div"),ItemComponent:s("Item","div"),GroupComponent:s("Group","div"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder")}});function De(e,n){var r=t.stream();return t.subscribe(r,function(){return console.warn("react-virtuoso: You are using a deprecated property. "+n,"color: red;","color: inherit;","color: blue;")}),t.connect(r,e),r}var _e=t.system(function(e){var n=e[0],i=e[1],a={item:De(i.itemContent,"Rename the %citem%c prop to %citemContent."),group:De(i.groupContent,"Rename the %cgroup%c prop to %cgroupContent."),topItems:De(n.topItemCount,"Rename the %ctopItems%c prop to %ctopItemCount."),itemHeight:De(n.fixedItemHeight,"Rename the %citemHeight%c prop to %cfixedItemHeight."),scrollingStateChange:De(n.isScrolling,"Rename the %cscrollingStateChange%c prop to %cisScrolling."),adjustForPrependedItems:t.stream(),maxHeightCacheSize:t.stream(),footer:t.stream(),header:t.stream(),HeaderContainer:t.stream(),FooterContainer:t.stream(),ItemContainer:t.stream(),ScrollContainer:t.stream(),GroupContainer:t.stream(),ListContainer:t.stream(),emptyComponent:t.stream(),scrollSeek:t.stream()};function s(e,n,o){t.connect(t.pipe(e,t.withLatestFrom(i.components),t.map(function(e){var t,i=e[0],a=e[1];return console.warn("react-virtuoso: "+o+" property is deprecated. Pass components."+n+" instead."),r({},a,((t={})[n]=i,t))})),i.components)}return t.subscribe(a.adjustForPrependedItems,function(){console.warn("react-virtuoso: adjustForPrependedItems is no longer supported. Use the firstItemIndex property instead - https://virtuoso.dev/prepend-items.","color: red;","color: inherit;","color: blue;")}),t.subscribe(a.maxHeightCacheSize,function(){console.warn("react-virtuoso: maxHeightCacheSize is no longer necessary. Setting it has no effect - remove it from your code.")}),t.subscribe(a.HeaderContainer,function(){console.warn("react-virtuoso: HeaderContainer is deprecated. Use headerFooterTag if you want to change the wrapper of the header component and pass components.Header to change its contents.")}),t.subscribe(a.FooterContainer,function(){console.warn("react-virtuoso: FooterContainer is deprecated. Use headerFooterTag if you want to change the wrapper of the footer component and pass components.Footer to change its contents.")}),t.subscribe(a.scrollSeek,function(e){var a=e.placeholder,s=o(e,["placeholder"]);console.warn("react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead."),t.publish(i.components,r({},t.getValue(i.components),{ScrollSeekPlaceholder:a})),t.publish(n.scrollSeekConfiguration,s)}),s(a.footer,"Footer","footer"),s(a.header,"Header","header"),s(a.ItemContainer,"Item","ItemContainer"),s(a.ListContainer,"List","ListContainer"),s(a.ScrollContainer,"Scroller","ScrollContainer"),s(a.emptyComponent,"EmptyPlaceholder","emptyComponent"),s(a.GroupContainer,"Group","GroupContainer"),r({},n,i,a)},t.tup(Ne,We)),je=function(e){return n.createElement("div",{style:{height:e.height}})},Ke={position:Ge(),zIndex:1},Ye=n.memo(function(e){var t,r,o,i,a=e.showTopList,s=void 0!==a&&a,l=lt("listState"),u=lt("deviation"),c=st("sizeRanges"),m=lt("itemContent"),f=lt("groupContent"),d=lt("trackItemSizes"),p=(t=c,r=lt("itemSize"),o=d,i=lt("log"),he(function(e){var n=function(e,t,n,r){var o=e.length;if(0===o)return null;for(var i=[],a=0;a<o;a++){var s=e.item(a);if(s&&void 0!==s.dataset.index){var l=parseInt(s.dataset.index),u=parseFloat(s.dataset.knownSize),c=t(s,"offsetHeight");if(0===c&&r("Zero-sized element, this should not happen",{child:s},exports.LogLevel.ERROR),c!==u){var m=i[i.length-1];0===i.length||m.size!==c||m.endIndex!==l-1?i.push({startIndex:l,endIndex:l,size:c}):i[i.length-1].endIndex++}}}return i}(e.children,r,0,i);null!==n&&t(n)},o)),h=lt("EmptyPlaceholder"),g=lt("ScrollSeekPlaceholder")||je,v=lt("ListComponent"),I=lt("ItemComponent"),S=lt("GroupComponent"),C=lt("computeItemKey"),x=lt("isSeeking"),w=lt("groupIndices").length>0,T=lt("paddingTopAddition"),b=lt("scrolledToInitialItem"),y=lt("firstItemIndex"),L=s?{}:{boxSizing:"border-box",paddingTop:l.offsetTop+T,paddingBottom:l.offsetBottom,marginTop:u};return!s&&0===l.items.length&&h&&b?n.createElement(h):n.createElement(v,{ref:p,style:L,"data-test-id":s?"virtuoso-top-item-list":"virtuoso-item-list"},(s?l.topItems:l.items).map(function(e){var t=e.originalIndex,r=C(t+y,e.data);return x?n.createElement(g,{key:r,index:e.index,height:e.size}):"group"===e.type?n.createElement(S,{key:r,"data-index":t,"data-known-size":e.size,"data-item-index":e.index,style:Ke},f(e.index)):n.createElement(I,{key:r,"data-index":t,"data-known-size":e.size,"data-item-index":e.index,"data-item-group-index":e.groupIndex},w?m(e.index,e.groupIndex,e.data):m(e.index,e.data))}))}),qe={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},Ze={width:"100%",height:"100%",position:"absolute",top:0},$e={width:"100%",position:Ge(),top:0},Je=n.memo(function(){var e=lt("HeaderComponent"),t=st("headerHeight"),r=lt("headerFooterTag"),o=he(function(e){return t(N(e,"height"))});return e?n.createElement(r,{ref:o},n.createElement(e)):null}),Qe=n.memo(function(){var e=lt("FooterComponent"),t=st("footerHeight"),r=lt("headerFooterTag"),o=he(function(e){return t(N(e,"height"))});return e?n.createElement(r,{ref:o},n.createElement(e)):null});function Xe(e){var t=e.usePublisher,i=e.useEmitter,a=e.useEmitterValue;return n.memo(function(e){var s=e.style,l=e.children,u=o(e,["style","children"]),c=t("scrollTop"),m=a("ScrollerComponent"),f=Ie(c,t("smoothScrollTargetReached"),m,a("scrollerRef")),d=f.scrollerRef,p=f.scrollByCallback;return i("scrollTo",f.scrollToCallback),i("scrollBy",p),n.createElement(m,r({ref:d,style:r({},qe,s),tabIndex:0},u),l)})}function et(e){var t=e.usePublisher,i=e.useEmitter,a=e.useEmitterValue;return n.memo(function(e){var s=e.style,l=e.children,u=o(e,["style","children"]),c=t("windowScrollTop"),m=a("ScrollerComponent"),f=t("smoothScrollTargetReached"),d=a("totalListHeight"),p=Ie(c,f,m),h=p.scrollerRef,g=p.scrollByCallback,v=p.scrollToCallback;return ve(function(){return h.current=window,function(){h.current=null}},[h]),i("windowScrollTo",v),i("scrollBy",g),n.createElement(m,r({style:r({position:"relative"},s,0!==d?{height:d}:{})},u),l)})}var tt=function(e){var r=e.children,o=st("viewportHeight"),i=he(t.compose(o,function(e){return N(e,"height")}));return n.createElement("div",{style:Ze,ref:i},r)},nt=function(e){var t=e.children,r=ge(st("windowViewportRect"));return n.createElement("div",{ref:r,style:Ze},t)},rt=function(e){var t=e.children,o=lt("TopItemListComponent"),i=lt("headerHeight"),a=r({},$e,{marginTop:i+"px"});return n.createElement(o||"div",{style:a},t)},ot=n.memo(function(e){var t=lt("useWindowScroll"),o=lt("topItemsIndexes").length>0,i=t?nt:tt;return n.createElement(t?mt:ct,r({},e),n.createElement(i,null,n.createElement(Je,null),n.createElement(Ye,null),n.createElement(Qe,null)),o&&n.createElement(rt,null,n.createElement(Ye,{showTopList:!0})))}),it=e.systemToComponent(_e,{required:{},optional:{followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",scrollerRef:"scrollerRef",logLevel:"logLevel",item:"item",group:"group",topItems:"topItems",itemHeight:"itemHeight",scrollingStateChange:"scrollingStateChange",maxHeightCacheSize:"maxHeightCacheSize",footer:"footer",header:"header",ItemContainer:"ItemContainer",ScrollContainer:"ScrollContainer",ListContainer:"ListContainer",GroupContainer:"GroupContainer",emptyComponent:"emptyComponent",HeaderContainer:"HeaderContainer",FooterContainer:"FooterContainer",scrollSeek:"scrollSeek"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",adjustForPrependedItems:"adjustForPrependedItems"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},ot),at=it.Component,st=it.usePublisher,lt=it.useEmitterValue,ut=it.useEmitter,ct=Xe({usePublisher:st,useEmitterValue:lt,useEmitter:ut}),mt=et({usePublisher:st,useEmitterValue:lt,useEmitter:ut}),ft=t.system(function(){var e=t.statefulStream(function(e){return"Item "+e}),n=t.statefulStream({}),r=t.statefulStream("virtuoso-grid-item"),o=t.statefulStream("virtuoso-grid-list"),i=t.statefulStream(Ae),a=t.statefulStream(t.noop),s=function(e,r){return void 0===r&&(r=null),t.statefulStreamFromEmitter(t.pipe(n,t.map(function(t){return t[e]}),t.distinctUntilChanged()),r)};return{itemContent:e,components:n,computeItemKey:i,itemClassName:r,listClassName:o,scrollerRef:a,ListComponent:s("List","div"),ItemComponent:s("Item","div"),ScrollerComponent:s("Scroller","div"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder","div")}}),dt=t.system(function(e){var n=e[0],i=e[1],a={item:De(i.itemContent,"Rename the %citem%c prop to %citemContent."),ItemContainer:t.stream(),ScrollContainer:t.stream(),ListContainer:t.stream(),emptyComponent:t.stream(),scrollSeek:t.stream()};function s(e,n,o){t.connect(t.pipe(e,t.withLatestFrom(i.components),t.map(function(e){var t,i=e[0],a=e[1];return console.warn("react-virtuoso: "+o+" property is deprecated. Pass components."+n+" instead."),r({},a,((t={})[n]=i,t))})),i.components)}return t.subscribe(a.scrollSeek,function(e){var a=e.placeholder,s=o(e,["placeholder"]);console.warn("react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead."),t.publish(i.components,r({},t.getValue(i.components),{ScrollSeekPlaceholder:a})),t.publish(n.scrollSeekConfiguration,s)}),s(a.ItemContainer,"Item","ItemContainer"),s(a.ListContainer,"List","ListContainer"),s(a.ScrollContainer,"Scroller","ScrollContainer"),r({},n,i,a)},t.tup(me,ft)),pt=n.memo(function(){var e=xt("gridState"),t=xt("listClassName"),r=xt("itemClassName"),o=xt("itemContent"),i=xt("computeItemKey"),a=xt("isSeeking"),s=xt("ItemComponent"),l=xt("ListComponent"),u=xt("ScrollSeekPlaceholder"),c=Ct("itemDimensions"),m=he(function(e){var t=e.firstChild;t&&c(t.getBoundingClientRect())});return n.createElement(l,{ref:m,className:t,style:{paddingTop:e.offsetTop,paddingBottom:e.offsetBottom}},e.items.map(function(t){var l=i(t.index);return a?n.createElement(u,{key:l,style:{height:e.itemHeight,width:e.itemWidth}}):n.createElement(s,{className:r,"data-index":t.index,key:l},o(t.index))}))}),ht=function(e){var t=e.children,r=Ct("viewportDimensions"),o=he(function(e){r(e.getBoundingClientRect())});return n.createElement("div",{style:Ze,ref:o},t)},gt=function(e){var t=e.children,r=ge(Ct("windowViewportRect"));return n.createElement("div",{ref:r,style:Ze},t)},vt=n.memo(function(e){var t=r({},e),o=xt("useWindowScroll"),i=o?gt:ht;return n.createElement(o?bt:Tt,r({},t),n.createElement(i,null,n.createElement(pt,null)))}),It=e.systemToComponent(dt,{optional:{totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",scrollerRef:"scrollerRef",item:"item",ItemContainer:"ItemContainer",ScrollContainer:"ScrollContainer",ListContainer:"ListContainer",scrollSeek:"scrollSeek"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange"}},vt),St=It.Component,Ct=It.usePublisher,xt=It.useEmitterValue,wt=It.useEmitter,Tt=Xe({usePublisher:Ct,useEmitterValue:xt,useEmitter:wt}),bt=et({usePublisher:Ct,useEmitterValue:xt,useEmitter:wt}),yt=at,Lt=St;exports.GroupedVirtuoso=at,exports.Virtuoso=yt,exports.VirtuosoGrid=Lt;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|