stream-chat-react 6.12.0 → 6.12.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.
Files changed (35) hide show
  1. package/README.md +1 -1
  2. package/dist/browser.full-bundle.js +388 -465
  3. package/dist/browser.full-bundle.js.map +1 -1
  4. package/dist/browser.full-bundle.min.js +4 -4
  5. package/dist/browser.full-bundle.min.js.map +1 -1
  6. package/dist/components/Attachment/Card.d.ts.map +1 -1
  7. package/dist/components/Attachment/Card.js +1 -3
  8. package/dist/components/MessageInput/MessageInput.d.ts +2 -0
  9. package/dist/components/MessageInput/MessageInput.d.ts.map +1 -1
  10. package/dist/components/MessageInput/hooks/useAttachments.d.ts +1 -1
  11. package/dist/components/MessageInput/hooks/useAttachments.d.ts.map +1 -1
  12. package/dist/components/MessageInput/hooks/useAttachments.js +3 -1
  13. package/dist/components/MessageInput/hooks/useEmojiPicker.d.ts +1 -1
  14. package/dist/components/MessageInput/hooks/useEmojiPicker.d.ts.map +1 -1
  15. package/dist/components/MessageInput/hooks/useEmojiPicker.js +12 -4
  16. package/dist/components/MessageInput/hooks/useMessageInputState.js +3 -3
  17. package/dist/css/index.css +1 -1
  18. package/dist/i18n/Streami18n.js +5 -5
  19. package/dist/index.cjs.js +25 -18
  20. package/dist/index.cjs.js.map +1 -1
  21. package/dist/scss/Card.scss +10 -0
  22. package/dist/scss/ChannelListMessenger.scss +4 -0
  23. package/dist/scss/ChannelSearch.scss +1 -1
  24. package/dist/scss/EditMessageForm.scss +4 -0
  25. package/dist/scss/LoadMoreButton.scss +5 -0
  26. package/dist/scss/Message.scss +5 -0
  27. package/dist/scss/MessageActions.scss +12 -0
  28. package/dist/scss/MessageInput.scss +15 -0
  29. package/dist/scss/MessageInputFlat.scss +8 -1
  30. package/dist/scss/Modal.scss +7 -2
  31. package/dist/scss/_base.scss +10 -0
  32. package/dist/scss/_variables.scss +2 -0
  33. package/dist/version.d.ts +1 -1
  34. package/dist/version.js +1 -1
  35. package/package.json +7 -7
@@ -5568,8 +5568,6 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
5568
5568
 
5569
5569
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};// export { default as SafeAnchor } from './SafeAnchor';
5570
5570
 
5571
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var img$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAkCAYAAAB/up84AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABVhJREFUeNrsW6GS20AMdToGBgEGAQYBBgEBBQYFgQcP5hMO9jP6CYWFBwsPBgYUGBQEFAQUGAQYBBgYGHjmutt5O6NupbXXcZJrx5rJXGyv11o96Ukr52avr6/BJG9HZmMBMpvNYnxt1JzNZNoRAYFxM2Z8rT6FuueMcaH6s1KfhBn3U42r1Jg1rrfq+Bt5xgf1Z64+uQFQndNzLc1Ydfwg6F2p6wd1PVXfU+b6Gc9vHGuh8+jrsXVN61Sq64XggNw95tlH9XmP6y3W2OI+qvN3db6mN7/zBFAb8L2aNMJxRsDQC6jIuEyN039LnAvV8QJKRRijZUHmT8iiLpEFDHKJaB1TGN732WuAokEIDQCwhwGjsMEIMNgp6qY9JlsTgyXquCFG1d54IsbOsKAVPLDBcQJjUxB0RJwAltGntNQ46GhzqPnb0y0954RG/1iLQ7SRCkR+guiPtW6GFRg5gAlCrFvbJEZ0ngDAUn0/Y77fDCJFXuiB/AmGDC3PLg0YWLRW5CcJWWPglNxDKS6C59AcZBs/sYxbOQBqHHkuZYCsGCds4SQJDDx3RK3RjUb9EfMUcLQ57BHS64MAIYtYkvEt+d4wCzqr++ipkoTtkihOI2chREfA5KiC0GOAaMig05zoWJPjgMk39jxcPphDR0mSDrtq438g51iq8omQlEnYJfHoiAFxYQGko6bCPSmZ5wS+TRx0Zc5R4CtmHbEVJT+0p1uOYdNE1SMfOKNO0zXWEmItptApsfYa1LV0UZUPIHSCmlRYJhfokNWhX5IcsmIWbEAMCQWerWirhZK57MghNQyzgke3QuQWPUv4EAac9wCuJjmkNmvUNEwiobX+DgdEWoQGgNDPGtTWWhRRWONX5JlnePCZhP1JUCOzPN1O0C2MohP7xuiko8Qy9INUDBg2YPJMlzP8pRv0qYeUdu+Cy+RAKIYmtVqojM5kkS0DwkXlLuY0ICzgAEOlAd8fPe+rYJdppz61TiZ5G4AgcScWz05RcUtAkOwyJMtI4FzNt3suCWKfwLUhdqRC0yA/enB1CZ4vBZ2fhIptJ4x/5PYVavyzQ39N0V8ddnsQ+m3sfX02hjo3bIVJ7d5PhqojZxYdC3NEdv9oQMQWFFjHHqpLEsc9BZyF23c9cG0ZOJjUIN15V1mY8OOAhW0E77yWaP2eoO9VBFG/d6yX6/xuHT2z3AsQ5ImnjrZBF6XcUiKAEl0RlJzZ7ZtnbxmqSgRqfxmyD9k6wNDGzuExecB3Z1/ukBOjQH73MZbspChFp9nQ/EYY9+LaaIYOqlo7JjwISX+LcBwbjAOz2ZKS7BpOcq0o0R2HvZAbHpHPJGc+dm00paQuedmOA4O0WD5fyQ4V08Ip4ATxhYl8CCh76/0QLVyehlBVFyCpYJTcKmPjHoY8XNE2VQ8dbIkdr4Z95npBwcNVahKzNEMBSYSyz46iLm8sLunreG5O+xYTsaMUHYu6bMn79sRCT2+8l6SMV2cCT5e3UspBXbbd9n3nDIN/Q1KP3JDfWLcd8kZwCVX12hjeOlmOIMe+L6FGjJLC4QS5rz6hg/tThjZiU0Pr/g7D65/uCUafKgaUJu0lHjvox/XsjXA+GAOQUogIXV8/v7GoKOGJfYuHxvHjt7t3rEMHD2+E5PoR+5GCLCS+8g6Z2xgGt6anuwGC99MSKAl6RrfUs/ofje+b1PcjlJBlMMk4gKBUe77AqKVP/T1Jj30IQPmCTdkm6NeKb5BkJzCGdCA8XuFGZIOWCBEh/mwGiZ/rFZXk3xHEdkjHb6MknVOhypJe+Sac03XlL4fe3r81mH518q9GyCS3kV8CDADlsrVaJhTLAgAAAABJRU5ErkJggg==";
5572
-
5573
5571
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
5574
5572
  var dayjs_min = createCommonjsModule$1(function (module, exports) {
5575
5573
  !function(t,e){module.exports=e();}(commonjsGlobal,function(){var t="millisecond",e="second",n="minute",r="hour",i="day",s="week",u="month",a="quarter",o="year",f="date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,c=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},$=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},l={s:$,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+$(r,2,"0")+":"+$(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,u),s=n-i<0,a=e.clone().add(r+(s?-1:1),u);return +(-(r+(n-i)/(s?i-a:a-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return {M:u,y:o,w:s,d:i,D:f,h:r,m:n,s:e,ms:t,Q:a}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},y="en",M={};M[y]=d;var m=function(t){return t instanceof S},D=function(t,e,n){var r;if(!t)return y;if("string"==typeof t)M[t]&&(r=t),e&&(M[t]=e,r=t);else {var i=t.name;M[i]=t,r=i;}return !n&&r&&(y=r),r||!n&&y},v=function(t,e){if(m(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new S(n)},g=l;g.l=D,g.i=m,g.w=function(t,e){return v(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var S=function(){function d(t){this.$L=D(t.locale,null,!0),this.parse(t);}var $=d.prototype;return $.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(g.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(h);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},$.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},$.$utils=function(){return g},$.isValid=function(){return !("Invalid Date"===this.$d.toString())},$.isSame=function(t,e){var n=v(t);return this.startOf(e)<=n&&n<=this.endOf(e)},$.isAfter=function(t,e){return v(t)<this.startOf(e)},$.isBefore=function(t,e){return this.endOf(e)<v(t)},$.$g=function(t,e,n){return g.u(t)?this[e]:this.set(n,t)},$.unix=function(){return Math.floor(this.valueOf()/1e3)},$.valueOf=function(){return this.$d.getTime()},$.startOf=function(t,a){var h=this,c=!!g.u(a)||a,d=g.p(t),$=function(t,e){var n=g.w(h.$u?Date.UTC(h.$y,e,t):new Date(h.$y,e,t),h);return c?n:n.endOf(i)},l=function(t,e){return g.w(h.toDate()[t].apply(h.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(e)),h)},y=this.$W,M=this.$M,m=this.$D,D="set"+(this.$u?"UTC":"");switch(d){case o:return c?$(1,0):$(31,11);case u:return c?$(1,M):$(0,M+1);case s:var v=this.$locale().weekStart||0,S=(y<v?y+7:y)-v;return $(c?m-S:m+(6-S),M);case i:case f:return l(D+"Hours",0);case r:return l(D+"Minutes",1);case n:return l(D+"Seconds",2);case e:return l(D+"Milliseconds",3);default:return this.clone()}},$.endOf=function(t){return this.startOf(t,!1)},$.$set=function(s,a){var h,c=g.p(s),d="set"+(this.$u?"UTC":""),$=(h={},h[i]=d+"Date",h[f]=d+"Date",h[u]=d+"Month",h[o]=d+"FullYear",h[r]=d+"Hours",h[n]=d+"Minutes",h[e]=d+"Seconds",h[t]=d+"Milliseconds",h)[c],l=c===i?this.$D+(a-this.$W):a;if(c===u||c===o){var y=this.clone().set(f,1);y.$d[$](l),y.init(),this.$d=y.set(f,Math.min(this.$D,y.daysInMonth())).$d;}else $&&this.$d[$](l);return this.init(),this},$.set=function(t,e){return this.clone().$set(t,e)},$.get=function(t){return this[g.p(t)]()},$.add=function(t,a){var f,h=this;t=Number(t);var c=g.p(a),d=function(e){var n=v(h);return g.w(n.date(n.date()+Math.round(e*t)),h)};if(c===u)return this.set(u,this.$M+t);if(c===o)return this.set(o,this.$y+t);if(c===i)return d(1);if(c===s)return d(7);var $=(f={},f[n]=6e4,f[r]=36e5,f[e]=1e3,f)[c]||1,l=this.$d.getTime()+t*$;return g.w(l,this)},$.subtract=function(t,e){return this.add(-1*t,e)},$.format=function(t){var e=this;if(!this.isValid())return "Invalid Date";var n=t||"YYYY-MM-DDTHH:mm:ssZ",r=g.z(this),i=this.$locale(),s=this.$H,u=this.$m,a=this.$M,o=i.weekdays,f=i.months,h=function(t,r,i,s){return t&&(t[r]||t(e,n))||i[r].substr(0,s)},d=function(t){return g.s(s%12||12,t,"0")},$=i.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:g.s(a+1,2,"0"),MMM:h(i.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:g.s(this.$D,2,"0"),d:String(this.$W),dd:h(i.weekdaysMin,this.$W,o,2),ddd:h(i.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:g.s(s,2,"0"),h:d(1),hh:d(2),a:$(s,u,!0),A:$(s,u,!1),m:String(u),mm:g.s(u,2,"0"),s:String(this.$s),ss:g.s(this.$s,2,"0"),SSS:g.s(this.$ms,3,"0"),Z:r};return n.replace(c,function(t,e){return e||l[t]||r.replace(":","")})},$.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$.diff=function(t,f,h){var c,d=g.p(f),$=v(t),l=6e4*($.utcOffset()-this.utcOffset()),y=this-$,M=g.m(this,$);return M=(c={},c[o]=M/12,c[u]=M,c[a]=M/3,c[s]=(y-l)/6048e5,c[i]=(y-l)/864e5,c[r]=y/36e5,c[n]=y/6e4,c[e]=y/1e3,c)[d]||y,h?M:g.a(M)},$.daysInMonth=function(){return this.endOf(u).$D},$.$locale=function(){return M[this.$L]},$.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=D(t,e,!0);return r&&(n.$L=r),n},$.clone=function(){return g.w(this.$d,this)},$.toDate=function(){return new Date(this.valueOf())},$.toJSON=function(){return this.isValid()?this.toISOString():null},$.toISOString=function(){return this.$d.toISOString()},$.toString=function(){return this.$d.toUTCString()},d}(),p=S.prototype;return v.prototype=p,[["$ms",t],["$s",e],["$m",n],["$H",r],["$W",i],["$M",u],["$y",o],["$D",f]].forEach(function(t){p[t[1]]=function(e){return this.$g(e,t[0],t[1])};}),v.extend=function(t,e){return t.$i||(t(e,S,v),t.$i=!0),v},v.locale=D,v.isDayjs=m,v.unix=function(t){return v(1e3*t)},v.en=M[y],v.Ls=M,v.p={},v});
@@ -5656,8 +5654,7 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
5656
5654
  React__default$1['default'].createElement("div", { className: 'str-chat__message-attachment-card--flex' },
5657
5655
  title && React__default$1['default'].createElement("div", { className: 'str-chat__message-attachment-card--title' }, title),
5658
5656
  text && React__default$1['default'].createElement("div", { className: 'str-chat__message-attachment-card--text' }, text),
5659
- (title_link || og_scrape_url) && (React__default$1['default'].createElement(SafeAnchor, { className: 'str-chat__message-attachment-card--url', href: title_link || og_scrape_url, rel: 'noopener noreferrer', target: '_blank' }, trimUrl(title_link || og_scrape_url)))),
5660
- type === 'giphy' && (React__default$1['default'].createElement("img", { alt: 'giphy logo', className: 'str-chat__message-attachment-card__giphy-logo', "data-testid": 'card-giphy', src: img$1 })))));
5657
+ (title_link || og_scrape_url) && (React__default$1['default'].createElement(SafeAnchor, { className: 'str-chat__message-attachment-card--url', href: title_link || og_scrape_url, rel: 'noopener noreferrer', target: '_blank' }, trimUrl(title_link || og_scrape_url)))))));
5661
5658
  };
5662
5659
  /**
5663
5660
  * Simple Card Layout for displaying links
@@ -12258,15 +12255,15 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
12258
12255
  var release = {};
12259
12256
  var config$1 = {};
12260
12257
 
12261
- function noop$5() {}
12258
+ function noop$4() {}
12262
12259
 
12263
- var on = noop$5;
12264
- var addListener = noop$5;
12265
- var once = noop$5;
12266
- var off = noop$5;
12267
- var removeListener = noop$5;
12268
- var removeAllListeners = noop$5;
12269
- var emit = noop$5;
12260
+ var on = noop$4;
12261
+ var addListener = noop$4;
12262
+ var once = noop$4;
12263
+ var off = noop$4;
12264
+ var removeListener = noop$4;
12265
+ var removeAllListeners = noop$4;
12266
+ var emit = noop$4;
12270
12267
 
12271
12268
  function binding(name) {
12272
12269
  throw new Error('process.binding is not supported');
@@ -47666,7 +47663,7 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
47666
47663
  return [height, rowHeight];
47667
47664
  }
47668
47665
 
47669
- var noop$4 = function noop() {};
47666
+ var noop$3 = function noop() {};
47670
47667
  var pick = function pick(props, obj) {
47671
47668
  return props.reduce(function (acc, prop) {
47672
47669
  acc[prop] = obj[prop];
@@ -47727,9 +47724,9 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
47727
47724
  maxRows = _ref.maxRows,
47728
47725
  minRows = _ref.minRows,
47729
47726
  _ref$onChange = _ref.onChange,
47730
- onChange = _ref$onChange === void 0 ? noop$4 : _ref$onChange,
47727
+ onChange = _ref$onChange === void 0 ? noop$3 : _ref$onChange,
47731
47728
  _ref$onHeightChange = _ref.onHeightChange,
47732
- onHeightChange = _ref$onHeightChange === void 0 ? noop$4 : _ref$onHeightChange,
47729
+ onHeightChange = _ref$onHeightChange === void 0 ? noop$3 : _ref$onHeightChange,
47733
47730
  props = _objectWithoutPropertiesLoose$2(_ref, ["cacheMeasurements", "maxRows", "minRows", "onChange", "onHeightChange"]);
47734
47731
 
47735
47732
  var isControlled = props.value !== undefined;
@@ -53121,7 +53118,7 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
53121
53118
  };
53122
53119
 
53123
53120
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var apiMaxNumberOfFiles = 10;
53124
- var useAttachments = function (props, state, dispatch) {
53121
+ var useAttachments = function (props, state, dispatch, textareaRef) {
53125
53122
  var noFiles = props.noFiles;
53126
53123
  var fileUploads = state.fileUploads, imageUploads = state.imageUploads;
53127
53124
  var _a = useChannelStateContext('useAttachments'), maxNumberOfFiles = _a.maxNumberOfFiles, multipleUploads = _a.multipleUploads;
@@ -53142,6 +53139,7 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
53142
53139
  var numberOfUploads = numberOfImages + numberOfFiles;
53143
53140
  var maxFilesLeft = maxFilesAllowed - numberOfUploads;
53144
53141
  var uploadNewFiles = React.useCallback(function (files) {
53142
+ var _a;
53145
53143
  Array.from(files)
53146
53144
  .slice(0, maxFilesLeft)
53147
53145
  .forEach(function (file) {
@@ -53155,6 +53153,7 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
53155
53153
  dispatch({ file: file, id: id, state: 'uploading', type: 'setFileUpload' });
53156
53154
  }
53157
53155
  });
53156
+ (_a = textareaRef === null || textareaRef === void 0 ? void 0 : textareaRef.current) === null || _a === void 0 ? void 0 : _a.focus();
53158
53157
  }, [maxFilesLeft, noFiles]);
53159
53158
  return {
53160
53159
  maxFilesLeft: maxFilesLeft,
@@ -53237,7 +53236,7 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
53237
53236
  };
53238
53237
  };
53239
53238
 
53240
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var useEmojiPicker = function (state, dispatch, insertText) {
53239
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var useEmojiPicker = function (state, dispatch, insertText, textareaRef, closeEmojiPickerOnClick) {
53241
53240
  var emojiPickerRef = React.useRef(null);
53242
53241
  var closeEmojiPicker = React.useCallback(function (event) {
53243
53242
  if (emojiPickerRef.current && !emojiPickerRef.current.contains(event.target)) {
@@ -53283,9 +53282,17 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
53283
53282
  document.removeEventListener('keydown', handleEmojiEscape);
53284
53283
  };
53285
53284
  }, [closeEmojiPicker, state.emojiPickerIsOpen]);
53286
- var onSelectEmoji = React.useCallback(function (emoji) { return insertText(emoji.native); }, [
53287
- insertText,
53288
- ]);
53285
+ var onSelectEmoji = React.useCallback(function (emoji) {
53286
+ var _a;
53287
+ insertText(emoji.native);
53288
+ if (closeEmojiPickerOnClick) {
53289
+ dispatch({
53290
+ type: 'setEmojiPickerIsOpen',
53291
+ value: false,
53292
+ });
53293
+ }
53294
+ (_a = textareaRef === null || textareaRef === void 0 ? void 0 : textareaRef.current) === null || _a === void 0 ? void 0 : _a.focus();
53295
+ }, [insertText]);
53289
53296
  return {
53290
53297
  closeEmojiPicker: closeEmojiPicker,
53291
53298
  emojiPickerRef: emojiPickerRef,
@@ -53607,7 +53614,7 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
53607
53614
  * hook for MessageInput state
53608
53615
  */
53609
53616
  var useMessageInputState = function (props) {
53610
- var message = props.message;
53617
+ var closeEmojiPickerOnClick = props.closeEmojiPickerOnClick, message = props.message;
53611
53618
  var _a = useChannelStateContext('useMessageInputState'), _b = _a.channelCapabilities, channelCapabilities = _b === void 0 ? {} : _b, channelConfig = _a.channelConfig;
53612
53619
  var _c = React.useReducer(messageInputReducer, message, initState), state = _c[0], dispatch = _c[1];
53613
53620
  var _d = useMessageInputText(props, state, dispatch), handleChange = _d.handleChange, insertText = _d.insertText, textareaRef = _d.textareaRef;
@@ -53629,8 +53636,8 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
53629
53636
  setShowMentionsList(true);
53630
53637
  };
53631
53638
  var closeMentionsList = function () { return setShowMentionsList(false); };
53632
- var _g = useEmojiPicker(state, dispatch, insertText), closeEmojiPicker = _g.closeEmojiPicker, emojiPickerRef = _g.emojiPickerRef, handleEmojiKeyDown = _g.handleEmojiKeyDown, onSelectEmoji = _g.onSelectEmoji, openEmojiPicker = _g.openEmojiPicker;
53633
- var _h = useAttachments(props, state, dispatch), maxFilesLeft = _h.maxFilesLeft, numberOfUploads = _h.numberOfUploads, removeFile = _h.removeFile, removeImage = _h.removeImage, uploadFile = _h.uploadFile, uploadImage = _h.uploadImage, uploadNewFiles = _h.uploadNewFiles;
53639
+ var _g = useEmojiPicker(state, dispatch, insertText, textareaRef, closeEmojiPickerOnClick), closeEmojiPicker = _g.closeEmojiPicker, emojiPickerRef = _g.emojiPickerRef, handleEmojiKeyDown = _g.handleEmojiKeyDown, onSelectEmoji = _g.onSelectEmoji, openEmojiPicker = _g.openEmojiPicker;
53640
+ var _h = useAttachments(props, state, dispatch, textareaRef), maxFilesLeft = _h.maxFilesLeft, numberOfUploads = _h.numberOfUploads, removeFile = _h.removeFile, removeImage = _h.removeImage, uploadFile = _h.uploadFile, uploadImage = _h.uploadImage, uploadNewFiles = _h.uploadNewFiles;
53634
53641
  var handleSubmit = useSubmitHandler(props, state, dispatch, numberOfUploads).handleSubmit;
53635
53642
  var onPaste = usePasteHandler(uploadNewFiles, insertText).onPaste;
53636
53643
  var isUploadEnabled = (channelConfig === null || channelConfig === void 0 ? void 0 : channelConfig.uploads) !== false && channelCapabilities['upload-file'] !== false;
@@ -57566,7 +57573,7 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
57566
57573
  return options;
57567
57574
  }
57568
57575
 
57569
- function noop$3() {}
57576
+ function noop$2() {}
57570
57577
 
57571
57578
  var I18n = function (_EventEmitter) {
57572
57579
  _inherits(I18n, _EventEmitter);
@@ -57630,7 +57637,7 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
57630
57637
 
57631
57638
  this.options = _objectSpread({}, get(), this.options, transformOptions(options));
57632
57639
  this.format = this.options.interpolation.format;
57633
- if (!callback) callback = noop$3;
57640
+ if (!callback) callback = noop$2;
57634
57641
 
57635
57642
  function createClassOnDemand(ClassOrObject) {
57636
57643
  if (!ClassOrObject) return null;
@@ -57751,7 +57758,7 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
57751
57758
  value: function loadResources(language) {
57752
57759
  var _this3 = this;
57753
57760
 
57754
- var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop$3;
57761
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop$2;
57755
57762
  var usedCallback = callback;
57756
57763
  var usedLng = typeof language === 'string' ? language : this.language;
57757
57764
  if (typeof language === 'function') usedCallback = language;
@@ -57796,7 +57803,7 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
57796
57803
  var deferred = defer();
57797
57804
  if (!lngs) lngs = this.languages;
57798
57805
  if (!ns) ns = this.options.ns;
57799
- if (!callback) callback = noop$3;
57806
+ if (!callback) callback = noop$2;
57800
57807
  this.services.backendConnector.reload(lngs, ns, function (err) {
57801
57808
  deferred.resolve();
57802
57809
  callback(err);
@@ -58051,7 +58058,7 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
58051
58058
  var _this8 = this;
58052
58059
 
58053
58060
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
58054
- var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop$3;
58061
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop$2;
58055
58062
 
58056
58063
  var mergedOptions = _objectSpread({}, this.options, options, {
58057
58064
  isClone: true
@@ -58257,19 +58264,19 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
58257
58264
  dayjs_min.updateLocale('ja', {
58258
58265
  calendar: {
58259
58266
  lastDay: '[昨日] LT',
58260
- lastWeek: '[過去] dddd [で] LT',
58267
+ lastWeek: 'dddd LT',
58261
58268
  nextDay: '[明日] LT',
58262
- nextWeek: 'dddd [] LT',
58263
- sameDay: '[今日は] LT',
58269
+ nextWeek: '[次の] dddd LT',
58270
+ sameDay: '[今日] LT',
58264
58271
  sameElse: 'L',
58265
58272
  },
58266
58273
  });
58267
58274
  dayjs_min.updateLocale('ko', {
58268
58275
  calendar: {
58269
58276
  lastDay: '[어제] LT',
58270
- lastWeek: '[마지막] dddd [~에] LT',
58277
+ lastWeek: '[지난] dddd LT',
58271
58278
  nextDay: '[내일] LT',
58272
- nextWeek: 'dddd [~에] LT',
58279
+ nextWeek: 'dddd LT',
58273
58280
  sameDay: '[오늘] LT',
58274
58281
  sameElse: 'L',
58275
58282
  },
@@ -58764,7 +58771,7 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
58764
58771
 
58765
58772
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
58766
58773
 
58767
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var version = '6.12.0';
58774
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var version = '6.12.1';
58768
58775
 
58769
58776
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var useChat = function (_a) {
58770
58777
  var _b;
@@ -60116,436 +60123,6 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
60116
60123
  return (React__default$1['default'].createElement(MessageListWithContext, __assign$2({ loadMore: loadMore }, restChannelStateContext, props)));
60117
60124
  };
60118
60125
 
60119
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var PUBLISH$2 = 0;
60120
- var SUBSCRIBE$2 = 1;
60121
- var RESET$2 = 2;
60122
- var VALUE$2 = 4;
60123
- /**
60124
- * Takes a 2 argument function and partially applies the first argument.
60125
- */
60126
-
60127
- function curry2to1$2(proc, arg1) {
60128
- return function (arg2) {
60129
- return proc(arg1, arg2);
60130
- };
60131
- }
60132
- /**
60133
- * Takes a 1 argument function and returns a function which when called, executes it with the provided argument.
60134
- */
60135
-
60136
- function curry1to0$1(proc, arg) {
60137
- return function () {
60138
- return proc(arg);
60139
- };
60140
- }
60141
- /**
60142
- * Calls callback with the first argument, and returns it.
60143
- */
60144
-
60145
- function tap$2(arg, proc) {
60146
- proc(arg);
60147
- return arg;
60148
- }
60149
- /**
60150
- * returns a function which when called always returns the passed value
60151
- */
60152
-
60153
- function always$1(value) {
60154
- return function () {
60155
- return value;
60156
- };
60157
- }
60158
- function noop$2() {}
60159
-
60160
- /**
60161
- * urx Actions operate on streams - `publish` publishes data in a stream, and `subscribe` attaches a subscription to a stream.
60162
- * @packageDocumentation
60163
- */
60164
- /**
60165
- * Subscribes the specified [[Subscription]] to the updates from the Emitter.
60166
- * The emitter calls the subscription with the new data each time new data is published into it.
60167
- *
60168
- * ```ts
60169
- * const foo = stream<number>();
60170
- * subscribe(foo, (value) => console.log(value));
60171
- * ```
60172
- *
60173
- * @returns an [[Unsubscribe]] handle - calling it will unbind the subscription from the emitter.
60174
- *```ts
60175
- * const foo = stream<number>();
60176
- * const unsub = subscribe(foo, (value) => console.log(value));
60177
- * unsub();
60178
- *```
60179
- */
60180
-
60181
- function subscribe$2(emitter, subscription) {
60182
- return emitter(SUBSCRIBE$2, subscription);
60183
- }
60184
- /**
60185
- * Publishes the value into the passed [[Publisher]].
60186
- *
60187
- * ```ts
60188
- * const foo = stream<number>();
60189
- * publish(foo, 42);
60190
- * ```
60191
- */
60192
-
60193
- function publish$2(publisher, value) {
60194
- publisher(PUBLISH$2, value);
60195
- }
60196
- /**
60197
- * Clears all subscriptions from the [[Emitter]].
60198
- * ```ts
60199
- * const foo = stream<number>();
60200
- * subscribe(foo, (value) => console.log(value));
60201
- * reset(foo);
60202
- * publish(foo, 42);
60203
- * ```
60204
- */
60205
-
60206
- function reset$2(emitter) {
60207
- emitter(RESET$2);
60208
- }
60209
- /**
60210
- * Extracts the current value from a stateful stream. Use it only as an escape hatch, as it violates the concept of reactive programming.
60211
- * ```ts
60212
- * const foo = statefulStream(42);
60213
- * console.log(getValue(foo));
60214
- * ```
60215
- */
60216
-
60217
- function getValue$2(depot) {
60218
- return depot(VALUE$2);
60219
- }
60220
- /**
60221
- * Event handlers are special emitters which can have **at most one active subscription**.
60222
- * Subscribing to an event handler unsubscribes the previous subscription, if present.
60223
- * ```ts
60224
- * const foo = stream<number>();
60225
- * const fooEvent = eventHandler(foo);
60226
- *
60227
- * // will be called once with 42
60228
- * subscribe(fooEvent, (value) => console.log(`Sub 1 ${value}`));
60229
- * publish(foo, 42);
60230
- *
60231
- * // unsubscribes sub 1
60232
- * subscribe(fooEvent, (value) => console.log(`Sub 2 ${value}`));
60233
- * publish(foo, 43);
60234
- * ```
60235
- * @param emitter the source emitter.
60236
- * @returns the single-subscription emitter.
60237
- */
60238
-
60239
- function eventHandler$1(emitter) {
60240
- var unsub;
60241
- var currentSubscription;
60242
-
60243
- var cleanup = function cleanup() {
60244
- return unsub && unsub();
60245
- };
60246
-
60247
- return function (action, subscription) {
60248
- switch (action) {
60249
- case SUBSCRIBE$2:
60250
- if (subscription) {
60251
- if (currentSubscription === subscription) {
60252
- return;
60253
- }
60254
-
60255
- cleanup();
60256
- currentSubscription = subscription;
60257
- unsub = subscribe$2(emitter, subscription);
60258
- return unsub;
60259
- } else {
60260
- cleanup();
60261
- return noop$2;
60262
- }
60263
-
60264
- case RESET$2:
60265
- cleanup();
60266
- currentSubscription = null;
60267
- return;
60268
-
60269
- default:
60270
- throw new Error("unrecognized action " + action);
60271
- }
60272
- };
60273
- }
60274
- /**
60275
- * Initializes a [[SystemSpec]] by recursively initializing its dependencies.
60276
- *
60277
- * ```ts
60278
- * // a simple system with two streams
60279
- * const sys1 = system(() => {
60280
- * const a = stream<number>()
60281
- * const b = stream<number>()
60282
- *
60283
- * connect(pipe(a, map(value => value * 2)), b)
60284
- * return { a, b }
60285
- * })
60286
- *
60287
- * const { a, b } = init(sys1)
60288
- * subscribe(b, b => console.log(b))
60289
- * publish(a, 2)
60290
- * ```
60291
- *
60292
- * @returns the [[System]] constructed by the spec constructor.
60293
- * @param systemSpec the system spec to initialize.
60294
- */
60295
-
60296
-
60297
- function init$1(systemSpec) {
60298
- var singletons = new Map();
60299
-
60300
- var _init = function _init(_ref2) {
60301
- var id = _ref2.id,
60302
- constructor = _ref2.constructor,
60303
- dependencies = _ref2.dependencies,
60304
- singleton = _ref2.singleton;
60305
-
60306
- if (singleton && singletons.has(id)) {
60307
- return singletons.get(id);
60308
- }
60309
-
60310
- var system = constructor(dependencies.map(function (e) {
60311
- return _init(e);
60312
- }));
60313
-
60314
- if (singleton) {
60315
- singletons.set(id, system);
60316
- }
60317
-
60318
- return system;
60319
- };
60320
-
60321
- return _init(systemSpec);
60322
- }
60323
-
60324
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
60325
- function _objectWithoutPropertiesLoose$1(source, excluded) {
60326
- if (source == null) return {};
60327
- var target = {};
60328
- var sourceKeys = Object.keys(source);
60329
- var key, i;
60330
-
60331
- for (i = 0; i < sourceKeys.length; i++) {
60332
- key = sourceKeys[i];
60333
- if (excluded.indexOf(key) >= 0) continue;
60334
- target[key] = source[key];
60335
- }
60336
-
60337
- return target;
60338
- }
60339
-
60340
- function _unsupportedIterableToArray$1(o, minLen) {
60341
- if (!o) return;
60342
- if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
60343
- var n = Object.prototype.toString.call(o).slice(8, -1);
60344
- if (n === "Object" && o.constructor) n = o.constructor.name;
60345
- if (n === "Map" || n === "Set") return Array.from(o);
60346
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
60347
- }
60348
-
60349
- function _arrayLikeToArray$1(arr, len) {
60350
- if (len == null || len > arr.length) len = arr.length;
60351
-
60352
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
60353
-
60354
- return arr2;
60355
- }
60356
-
60357
- function _createForOfIteratorHelperLoose$1(o, allowArrayLike) {
60358
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
60359
- if (it) return (it = it.call(o)).next.bind(it);
60360
-
60361
- if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") {
60362
- if (it) o = it;
60363
- var i = 0;
60364
- return function () {
60365
- if (i >= o.length) return {
60366
- done: true
60367
- };
60368
- return {
60369
- done: false,
60370
- value: o[i++]
60371
- };
60372
- };
60373
- }
60374
-
60375
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
60376
- }
60377
-
60378
- var _excluded$1 = ["children"];
60379
- /** @internal */
60380
-
60381
- function omit$1(keys, obj) {
60382
- var result = {};
60383
- var index = {};
60384
- var idx = 0;
60385
- var len = keys.length;
60386
-
60387
- while (idx < len) {
60388
- index[keys[idx]] = 1;
60389
- idx += 1;
60390
- }
60391
-
60392
- for (var prop in obj) {
60393
- if (!index.hasOwnProperty(prop)) {
60394
- result[prop] = obj[prop];
60395
- }
60396
- }
60397
-
60398
- return result;
60399
- }
60400
-
60401
- var useIsomorphicLayoutEffect$1 = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect;
60402
- /**
60403
- * Converts a system spec to React component by mapping the system streams to component properties, events and methods. Returns hooks for querying and modifying
60404
- * the system streams from the component's child components.
60405
- * @param systemSpec The return value from a [[system]] call.
60406
- * @param map The streams to props / events / methods mapping Check [[SystemPropsMap]] for more details.
60407
- * @param Root The optional React component to render. By default, the resulting component renders nothing, acting as a logical wrapper for its children.
60408
- * @returns an object containing the following:
60409
- * - `Component`: the React component.
60410
- * - `useEmitterValue`: a hook that lets child components use values emitted from the specified output stream.
60411
- * - `useEmitter`: a hook that calls the provided callback whenever the specified stream emits a value.
60412
- * - `usePublisher`: a hook which lets child components publish values to the specified stream.
60413
- * <hr />
60414
- */
60415
-
60416
- function systemToComponent$1(systemSpec, map, Root) {
60417
- var requiredPropNames = Object.keys(map.required || {});
60418
- var optionalPropNames = Object.keys(map.optional || {});
60419
- var methodNames = Object.keys(map.methods || {});
60420
- var eventNames = Object.keys(map.events || {});
60421
- var Context = React.createContext({});
60422
-
60423
- function applyPropsToSystem(system, props) {
60424
- if (system['propsReady']) {
60425
- publish$2(system['propsReady'], false);
60426
- }
60427
-
60428
- for (var _iterator = _createForOfIteratorHelperLoose$1(requiredPropNames), _step; !(_step = _iterator()).done;) {
60429
- var requiredPropName = _step.value;
60430
- var stream = system[map.required[requiredPropName]];
60431
- publish$2(stream, props[requiredPropName]);
60432
- }
60433
-
60434
- for (var _iterator2 = _createForOfIteratorHelperLoose$1(optionalPropNames), _step2; !(_step2 = _iterator2()).done;) {
60435
- var optionalPropName = _step2.value;
60436
-
60437
- if (optionalPropName in props) {
60438
- var _stream = system[map.optional[optionalPropName]];
60439
- publish$2(_stream, props[optionalPropName]);
60440
- }
60441
- }
60442
-
60443
- if (system['propsReady']) {
60444
- publish$2(system['propsReady'], true);
60445
- }
60446
- }
60447
-
60448
- function buildMethods(system) {
60449
- return methodNames.reduce(function (acc, methodName) {
60450
-
60451
- acc[methodName] = function (value) {
60452
- var stream = system[map.methods[methodName]];
60453
- publish$2(stream, value);
60454
- };
60455
-
60456
- return acc;
60457
- }, {});
60458
- }
60459
-
60460
- function buildEventHandlers(system) {
60461
- return eventNames.reduce(function (handlers, eventName) {
60462
- handlers[eventName] = eventHandler$1(system[map.events[eventName]]);
60463
- return handlers;
60464
- }, {});
60465
- }
60466
- /**
60467
- * A React component generated from an urx system
60468
- */
60469
-
60470
-
60471
- var Component = React.forwardRef(function (propsWithChildren, ref) {
60472
- var children = propsWithChildren.children,
60473
- props = _objectWithoutPropertiesLoose$1(propsWithChildren, _excluded$1);
60474
-
60475
- var _useState = React.useState(function () {
60476
- return tap$2(init$1(systemSpec), function (system) {
60477
- return applyPropsToSystem(system, props);
60478
- });
60479
- }),
60480
- system = _useState[0];
60481
-
60482
- var _useState2 = React.useState(curry1to0$1(buildEventHandlers, system)),
60483
- handlers = _useState2[0];
60484
-
60485
- useIsomorphicLayoutEffect$1(function () {
60486
- for (var _iterator3 = _createForOfIteratorHelperLoose$1(eventNames), _step3; !(_step3 = _iterator3()).done;) {
60487
- var eventName = _step3.value;
60488
-
60489
- if (eventName in props) {
60490
- subscribe$2(handlers[eventName], props[eventName]);
60491
- }
60492
- }
60493
-
60494
- return function () {
60495
- Object.values(handlers).map(reset$2);
60496
- };
60497
- }, [props, handlers, system]);
60498
- useIsomorphicLayoutEffect$1(function () {
60499
- applyPropsToSystem(system, props);
60500
- });
60501
- React.useImperativeHandle(ref, always$1(buildMethods(system)));
60502
- return React.createElement(Context.Provider, {
60503
- value: system
60504
- }, Root ? React.createElement(Root, omit$1([].concat(requiredPropNames, optionalPropNames, eventNames), props), children) : children);
60505
- });
60506
-
60507
- var usePublisher = function usePublisher(key) {
60508
- return React.useCallback(curry2to1$2(publish$2, React.useContext(Context)[key]), [key]);
60509
- };
60510
- /**
60511
- * Returns the value emitted from the stream.
60512
- */
60513
-
60514
-
60515
- var useEmitterValue = function useEmitterValue(key) {
60516
- var context = React.useContext(Context);
60517
- var source = context[key];
60518
-
60519
- var _useState3 = React.useState(curry1to0$1(getValue$2, source)),
60520
- value = _useState3[0],
60521
- setValue = _useState3[1];
60522
-
60523
- useIsomorphicLayoutEffect$1(function () {
60524
- return subscribe$2(source, function (next) {
60525
- if (next !== value) {
60526
- setValue(always$1(next));
60527
- }
60528
- });
60529
- }, [source, value]);
60530
- return value;
60531
- };
60532
-
60533
- var useEmitter = function useEmitter(key, callback) {
60534
- var context = React.useContext(Context);
60535
- var source = context[key];
60536
- useIsomorphicLayoutEffect$1(function () {
60537
- return subscribe$2(source, callback);
60538
- }, [callback, source]);
60539
- };
60540
-
60541
- return {
60542
- Component: Component,
60543
- usePublisher: usePublisher,
60544
- useEmitterValue: useEmitterValue,
60545
- useEmitter: useEmitter
60546
- };
60547
- }
60548
-
60549
60126
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var PUBLISH$1 = 0;
60550
60127
  var SUBSCRIBE$1 = 1;
60551
60128
  var RESET$1 = 2;
@@ -60585,6 +60162,15 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
60585
60162
  return proc(arg1, arg2);
60586
60163
  };
60587
60164
  }
60165
+ /**
60166
+ * Takes a 1 argument function and returns a function which when called, executes it with the provided argument.
60167
+ */
60168
+
60169
+ function curry1to0$1(proc, arg) {
60170
+ return function () {
60171
+ return proc(arg);
60172
+ };
60173
+ }
60588
60174
  /**
60589
60175
  * Returns a function which extracts the property from from the passed object.
60590
60176
  */
@@ -60621,6 +60207,15 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
60621
60207
  function call$1(proc) {
60622
60208
  proc();
60623
60209
  }
60210
+ /**
60211
+ * returns a function which when called always returns the passed value
60212
+ */
60213
+
60214
+ function always$1(value) {
60215
+ return function () {
60216
+ return value;
60217
+ };
60218
+ }
60624
60219
  /**
60625
60220
  * returns a function which calls all passed functions in the passed order.
60626
60221
  * joinProc does not pass arguments or collect return values.
@@ -60834,6 +60429,60 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
60834
60429
  return innerSubject(action, arg);
60835
60430
  };
60836
60431
  }
60432
+ /**
60433
+ * Event handlers are special emitters which can have **at most one active subscription**.
60434
+ * Subscribing to an event handler unsubscribes the previous subscription, if present.
60435
+ * ```ts
60436
+ * const foo = stream<number>();
60437
+ * const fooEvent = eventHandler(foo);
60438
+ *
60439
+ * // will be called once with 42
60440
+ * subscribe(fooEvent, (value) => console.log(`Sub 1 ${value}`));
60441
+ * publish(foo, 42);
60442
+ *
60443
+ * // unsubscribes sub 1
60444
+ * subscribe(fooEvent, (value) => console.log(`Sub 2 ${value}`));
60445
+ * publish(foo, 43);
60446
+ * ```
60447
+ * @param emitter the source emitter.
60448
+ * @returns the single-subscription emitter.
60449
+ */
60450
+
60451
+ function eventHandler$1(emitter) {
60452
+ var unsub;
60453
+ var currentSubscription;
60454
+
60455
+ var cleanup = function cleanup() {
60456
+ return unsub && unsub();
60457
+ };
60458
+
60459
+ return function (action, subscription) {
60460
+ switch (action) {
60461
+ case SUBSCRIBE$1:
60462
+ if (subscription) {
60463
+ if (currentSubscription === subscription) {
60464
+ return;
60465
+ }
60466
+
60467
+ cleanup();
60468
+ currentSubscription = subscription;
60469
+ unsub = subscribe$1(emitter, subscription);
60470
+ return unsub;
60471
+ } else {
60472
+ cleanup();
60473
+ return noop$1;
60474
+ }
60475
+
60476
+ case RESET$1:
60477
+ cleanup();
60478
+ currentSubscription = null;
60479
+ return;
60480
+
60481
+ default:
60482
+ throw new Error("unrecognized action " + action);
60483
+ }
60484
+ };
60485
+ }
60837
60486
  /**
60838
60487
  * Creates and connects a "junction" stream to the specified emitter. Often used with [[pipe]], to avoid the multiple evaluation of operator sets.
60839
60488
  *
@@ -61406,8 +61055,282 @@ var StreamChatReact = (function (exports, React, reactDom, streamChat) {
61406
61055
  var id$1 = function id() {
61407
61056
  return Symbol();
61408
61057
  };
61058
+ /**
61059
+ * Initializes a [[SystemSpec]] by recursively initializing its dependencies.
61060
+ *
61061
+ * ```ts
61062
+ * // a simple system with two streams
61063
+ * const sys1 = system(() => {
61064
+ * const a = stream<number>()
61065
+ * const b = stream<number>()
61066
+ *
61067
+ * connect(pipe(a, map(value => value * 2)), b)
61068
+ * return { a, b }
61069
+ * })
61070
+ *
61071
+ * const { a, b } = init(sys1)
61072
+ * subscribe(b, b => console.log(b))
61073
+ * publish(a, 2)
61074
+ * ```
61075
+ *
61076
+ * @returns the [[System]] constructed by the spec constructor.
61077
+ * @param systemSpec the system spec to initialize.
61078
+ */
61079
+
61080
+
61081
+ function init$1(systemSpec) {
61082
+ var singletons = new Map();
61083
+
61084
+ var _init = function _init(_ref2) {
61085
+ var id = _ref2.id,
61086
+ constructor = _ref2.constructor,
61087
+ dependencies = _ref2.dependencies,
61088
+ singleton = _ref2.singleton;
61089
+
61090
+ if (singleton && singletons.has(id)) {
61091
+ return singletons.get(id);
61092
+ }
61093
+
61094
+ var system = constructor(dependencies.map(function (e) {
61095
+ return _init(e);
61096
+ }));
61097
+
61098
+ if (singleton) {
61099
+ singletons.set(id, system);
61100
+ }
61101
+
61102
+ return system;
61103
+ };
61104
+
61105
+ return _init(systemSpec);
61106
+ }
61107
+
61108
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
61109
+ function _objectWithoutPropertiesLoose$1(source, excluded) {
61110
+ if (source == null) return {};
61111
+ var target = {};
61112
+ var sourceKeys = Object.keys(source);
61113
+ var key, i;
61114
+
61115
+ for (i = 0; i < sourceKeys.length; i++) {
61116
+ key = sourceKeys[i];
61117
+ if (excluded.indexOf(key) >= 0) continue;
61118
+ target[key] = source[key];
61119
+ }
61120
+
61121
+ return target;
61122
+ }
61123
+
61124
+ function _unsupportedIterableToArray$1(o, minLen) {
61125
+ if (!o) return;
61126
+ if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
61127
+ var n = Object.prototype.toString.call(o).slice(8, -1);
61128
+ if (n === "Object" && o.constructor) n = o.constructor.name;
61129
+ if (n === "Map" || n === "Set") return Array.from(o);
61130
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
61131
+ }
61132
+
61133
+ function _arrayLikeToArray$1(arr, len) {
61134
+ if (len == null || len > arr.length) len = arr.length;
61135
+
61136
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
61137
+
61138
+ return arr2;
61139
+ }
61140
+
61141
+ function _createForOfIteratorHelperLoose$1(o, allowArrayLike) {
61142
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
61143
+ if (it) return (it = it.call(o)).next.bind(it);
61144
+
61145
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") {
61146
+ if (it) o = it;
61147
+ var i = 0;
61148
+ return function () {
61149
+ if (i >= o.length) return {
61150
+ done: true
61151
+ };
61152
+ return {
61153
+ done: false,
61154
+ value: o[i++]
61155
+ };
61156
+ };
61157
+ }
61158
+
61159
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
61160
+ }
61161
+
61162
+ var _excluded$1 = ["children"];
61163
+ /** @internal */
61164
+
61165
+ function omit$1(keys, obj) {
61166
+ var result = {};
61167
+ var index = {};
61168
+ var idx = 0;
61169
+ var len = keys.length;
61170
+
61171
+ while (idx < len) {
61172
+ index[keys[idx]] = 1;
61173
+ idx += 1;
61174
+ }
61175
+
61176
+ for (var prop in obj) {
61177
+ if (!index.hasOwnProperty(prop)) {
61178
+ result[prop] = obj[prop];
61179
+ }
61180
+ }
61181
+
61182
+ return result;
61183
+ }
61184
+
61185
+ var useIsomorphicLayoutEffect$1 = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect;
61186
+ /**
61187
+ * Converts a system spec to React component by mapping the system streams to component properties, events and methods. Returns hooks for querying and modifying
61188
+ * the system streams from the component's child components.
61189
+ * @param systemSpec The return value from a [[system]] call.
61190
+ * @param map The streams to props / events / methods mapping Check [[SystemPropsMap]] for more details.
61191
+ * @param Root The optional React component to render. By default, the resulting component renders nothing, acting as a logical wrapper for its children.
61192
+ * @returns an object containing the following:
61193
+ * - `Component`: the React component.
61194
+ * - `useEmitterValue`: a hook that lets child components use values emitted from the specified output stream.
61195
+ * - `useEmitter`: a hook that calls the provided callback whenever the specified stream emits a value.
61196
+ * - `usePublisher`: a hook which lets child components publish values to the specified stream.
61197
+ * <hr />
61198
+ */
61199
+
61200
+ function systemToComponent$1(systemSpec, map, Root) {
61201
+ var requiredPropNames = Object.keys(map.required || {});
61202
+ var optionalPropNames = Object.keys(map.optional || {});
61203
+ var methodNames = Object.keys(map.methods || {});
61204
+ var eventNames = Object.keys(map.events || {});
61205
+ var Context = React.createContext({});
61206
+
61207
+ function applyPropsToSystem(system, props) {
61208
+ if (system['propsReady']) {
61209
+ publish$1(system['propsReady'], false);
61210
+ }
61211
+
61212
+ for (var _iterator = _createForOfIteratorHelperLoose$1(requiredPropNames), _step; !(_step = _iterator()).done;) {
61213
+ var requiredPropName = _step.value;
61214
+ var stream = system[map.required[requiredPropName]];
61215
+ publish$1(stream, props[requiredPropName]);
61216
+ }
61217
+
61218
+ for (var _iterator2 = _createForOfIteratorHelperLoose$1(optionalPropNames), _step2; !(_step2 = _iterator2()).done;) {
61219
+ var optionalPropName = _step2.value;
61220
+
61221
+ if (optionalPropName in props) {
61222
+ var _stream = system[map.optional[optionalPropName]];
61223
+ publish$1(_stream, props[optionalPropName]);
61224
+ }
61225
+ }
61226
+
61227
+ if (system['propsReady']) {
61228
+ publish$1(system['propsReady'], true);
61229
+ }
61230
+ }
61231
+
61232
+ function buildMethods(system) {
61233
+ return methodNames.reduce(function (acc, methodName) {
61234
+
61235
+ acc[methodName] = function (value) {
61236
+ var stream = system[map.methods[methodName]];
61237
+ publish$1(stream, value);
61238
+ };
61239
+
61240
+ return acc;
61241
+ }, {});
61242
+ }
61243
+
61244
+ function buildEventHandlers(system) {
61245
+ return eventNames.reduce(function (handlers, eventName) {
61246
+ handlers[eventName] = eventHandler$1(system[map.events[eventName]]);
61247
+ return handlers;
61248
+ }, {});
61249
+ }
61250
+ /**
61251
+ * A React component generated from an urx system
61252
+ */
61253
+
61254
+
61255
+ var Component = React.forwardRef(function (propsWithChildren, ref) {
61256
+ var children = propsWithChildren.children,
61257
+ props = _objectWithoutPropertiesLoose$1(propsWithChildren, _excluded$1);
61258
+
61259
+ var _useState = React.useState(function () {
61260
+ return tap$1(init$1(systemSpec), function (system) {
61261
+ return applyPropsToSystem(system, props);
61262
+ });
61263
+ }),
61264
+ system = _useState[0];
61265
+
61266
+ var _useState2 = React.useState(curry1to0$1(buildEventHandlers, system)),
61267
+ handlers = _useState2[0];
61268
+
61269
+ useIsomorphicLayoutEffect$1(function () {
61270
+ for (var _iterator3 = _createForOfIteratorHelperLoose$1(eventNames), _step3; !(_step3 = _iterator3()).done;) {
61271
+ var eventName = _step3.value;
61272
+
61273
+ if (eventName in props) {
61274
+ subscribe$1(handlers[eventName], props[eventName]);
61275
+ }
61276
+ }
61277
+
61278
+ return function () {
61279
+ Object.values(handlers).map(reset$1);
61280
+ };
61281
+ }, [props, handlers, system]);
61282
+ useIsomorphicLayoutEffect$1(function () {
61283
+ applyPropsToSystem(system, props);
61284
+ });
61285
+ React.useImperativeHandle(ref, always$1(buildMethods(system)));
61286
+ return React.createElement(Context.Provider, {
61287
+ value: system
61288
+ }, Root ? React.createElement(Root, omit$1([].concat(requiredPropNames, optionalPropNames, eventNames), props), children) : children);
61289
+ });
61290
+
61291
+ var usePublisher = function usePublisher(key) {
61292
+ return React.useCallback(curry2to1$1(publish$1, React.useContext(Context)[key]), [key]);
61293
+ };
61294
+ /**
61295
+ * Returns the value emitted from the stream.
61296
+ */
61297
+
61298
+
61299
+ var useEmitterValue = function useEmitterValue(key) {
61300
+ var context = React.useContext(Context);
61301
+ var source = context[key];
61302
+
61303
+ var _useState3 = React.useState(curry1to0$1(getValue$1, source)),
61304
+ value = _useState3[0],
61305
+ setValue = _useState3[1];
61306
+
61307
+ useIsomorphicLayoutEffect$1(function () {
61308
+ return subscribe$1(source, function (next) {
61309
+ if (next !== value) {
61310
+ setValue(always$1(next));
61311
+ }
61312
+ });
61313
+ }, [source, value]);
61314
+ return value;
61315
+ };
61316
+
61317
+ var useEmitter = function useEmitter(key, callback) {
61318
+ var context = React.useContext(Context);
61319
+ var source = context[key];
61320
+ useIsomorphicLayoutEffect$1(function () {
61321
+ return subscribe$1(source, callback);
61322
+ }, [callback, source]);
61323
+ };
61324
+
61325
+ return {
61326
+ Component: Component,
61327
+ usePublisher: usePublisher,
61328
+ useEmitterValue: useEmitterValue,
61329
+ useEmitter: useEmitter
61330
+ };
61331
+ }
61409
61332
 
61410
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};function P$1(){return (P$1=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);}return e}).apply(this,arguments)}function F$1(e,t){if(null==e)return {};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)t.indexOf(n=i[o])>=0||(r[n]=e[n]);return r}function A$1(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function W$1(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 A$1(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)?A$1(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}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 G$1(e,t){return !(!e||e[0]!==t[0]||e[1]!==t[1])}function N$1(e,t){return !(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}var V$1,D$1,U$1="up",_$1=system$1(function(){var e=stream$1(),t=statefulStream$1(0),a=stream$1(),s=statefulStream$1(0),c=stream$1(),f=statefulStream$1(0),d=statefulStream$1(0),m=stream$1(),h=stream$1(),p=statefulStream$1(!1);connect$1(e,s);var v=statefulStream$1("down");return connect$1(pipe$1(e,scan$1(function(e,t){return {direction:t<e.prevScrollTop?U$1:"down",prevScrollTop:t}},{direction:"down",prevScrollTop:0}),map$1(function(e){return e.direction})),v),{scrollTop:e,viewportHeight:c,headerHeight:f,footerHeight:d,smoothScrollTargetReached:a,scrollTo:m,scrollBy:h,scrollDirection:v,statefulScrollTop:s,deviation:t,scrollingInProgress:p}},[],{singleton:!0});!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR";}(D$1||(D$1={}));var j$1=((V$1={})[D$1.DEBUG]="debug",V$1[D$1.INFO]="log",V$1[D$1.WARN]="warn",V$1[D$1.ERROR]="error",V$1),K$1=system$1(function(){var e=statefulStream$1(D$1.ERROR);return {log:statefulStream$1(function(t,n,o){var r;void 0===o&&(o=D$1.INFO),o>=(null!=(r=(globalThis||window).VIRTUOSO_LOG_LEVEL)?r:getValue$1(e))&&console[j$1[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: black",t,n);}),logLevel:e}},[],{singleton:!0}),Y$1=system$1(function(e){var t=e[0].log,n=statefulStream$1(!1),r=streamFromEmitter$1(pipe$1(n,filter$1(function(e){return e}),distinctUntilChanged$1()));return subscribe$1(n,function(e){e&&getValue$1(t)("props updated",{},D$1.DEBUG);}),{propsReady:n,didMount:r}},tup$1(K$1),{singleton:!0}),Z$1={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,totalHeight:0}},q$1=system$1(function(e){var t=e[0],a=t.scrollTop,c=t.viewportHeight,m=t.headerHeight,x=t.footerHeight,T=statefulStream$1(!1),w=statefulStream$1(!0),y=stream$1(),b=stream$1(),R=stream$1(),z=streamFromEmitter$1(pipe$1(merge$1(pipe$1(duc$1(a),skip$1(1),mapTo$1(!0)),pipe$1(duc$1(a),skip$1(1),mapTo$1(!1),debounceTime$1(100))),distinctUntilChanged$1()));connect$1(pipe$1(duc$1(a),map$1(function(e){return 0===e}),distinctUntilChanged$1()),w),connect$1(w,b);var H=streamFromEmitter$1(pipe$1(combineLatest$1(R,duc$1(a),duc$1(c),duc$1(m),duc$1(x)),scan$1(function(e,t){var n=t[0],o=n.bottom,r=n.offsetBottom,i=t[1],l=t[2],u={viewportHeight:l,scrollTop:i,offsetBottom:r,totalHeight:o+r};return 0===r&&i+l-(o+t[3]+t[4])>-4?{atBottom:!0,state:u}:{atBottom:!1,notAtBottomBecause:u.totalHeight>e.state.totalHeight?"SIZE_INCREASED":0!==r?"NOT_SHOWING_LAST_ITEM":l<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":i<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",state:u}},Z$1),distinctUntilChanged$1(function(e,t){return e&&e.atBottom===t.atBottom})));return connect$1(pipe$1(H,map$1(function(e){return e.atBottom})),T),subscribe$1(T,function(e){setTimeout(function(){return publish$1(y,e)});}),{isScrolling:z,isAtTop:w,isAtBottom:T,atBottomState:H,atTopStateChange:b,atBottomStateChange:y,listStateListener:R}},tup$1(_$1)),$$1=system$1(function(e){var t=e[0].scrollTop,a=e[1].isScrolling,s=statefulStream$1(0),m=statefulStream$1(!1),h=stream$1(),p=statefulStream$1(!1);return connect$1(pipe$1(a,filter$1(function(e){return !e}),mapTo$1(0)),s),connect$1(pipe$1(t,throttleTime$1(100),withLatestFrom$1(a),filter$1(function(e){return !!e[1]}),scan$1(function(e,t){return [e[1],t[0]]},[0,0]),map$1(function(e){return e[1]-e[0]})),s),connect$1(pipe$1(s,withLatestFrom$1(p,m,h),filter$1(function(e){return !!e[1]}),map$1(function(e){var t=e[0],n=e[1],o=e[2],r=e[3],i=n.enter;if(o){if((0, n.exit)(t,r))return !1}else if(i(t,r))return !0;return o}),distinctUntilChanged$1()),m),subscribe$1(pipe$1(combineLatest$1(m,s,h),withLatestFrom$1(p)),function(e){var t=e[0],n=e[1];return t[0]&&n&&n.change&&n.change(t[1],t[2])}),{isSeeking:m,scrollSeekConfiguration:p,scrollVelocity:s,scrollSeekRangeChanged:h}},tup$1(_$1,q$1),{singleton:!0}),J$1={lvl:0};function Q$1(e,t,n,o,r){return void 0===o&&(o=J$1),void 0===r&&(r=J$1),{k:e,v:t,lvl:n,l:o,r:r}}function X$1(e){return e===J$1}function ee$1(){return J$1}function te$1(e,t){if(X$1(e))return J$1;var n=e.k,o=e.l,r=e.r;if(t===n){if(X$1(o))return r;if(X$1(r))return o;var i=le$1(o);return ce$1(ae$1(e,{k:i[0],v:i[1],l:ue$1(o)}))}return ce$1(ae$1(e,t<n?{l:te$1(o,t)}:{r:te$1(r,t)}))}function ne$1(e,t,n){if(void 0===n&&(n="k"),X$1(e))return [-Infinity,void 0];if(e[n]===t)return [e.k,e.v];if(e[n]<t){var o=ne$1(e.r,t,n);return -Infinity===o[0]?[e.k,e.v]:o}return ne$1(e.l,t,n)}function oe$1(e,t,n){return X$1(e)?Q$1(t,n,1):t===e.k?ae$1(e,{k:t,v:n}):function(e){return me$1(he$1(e))}(ae$1(e,t<e.k?{l:oe$1(e.l,t,n)}:{r:oe$1(e.r,t,n)}))}function re$1(e,t,n){if(X$1(e))return [];var o=e.k,r=e.v,i=e.r,l=[];return o>t&&(l=l.concat(re$1(e.l,t,n))),o>=t&&o<=n&&l.push({k:o,v:r}),o<=n&&(l=l.concat(re$1(i,t,n))),l}function ie$1(e){return X$1(e)?[]:[].concat(ie$1(e.l),[{k:e.k,v:e.v}],ie$1(e.r))}function le$1(e){return X$1(e.r)?[e.k,e.v]:le$1(e.r)}function ue$1(e){return X$1(e.r)?e.l:ce$1(ae$1(e,{r:ue$1(e.r)}))}function ae$1(e,t){return Q$1(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 se$1(e){return X$1(e)||e.lvl>e.r.lvl}function ce$1(e){var t=e.l,n=e.r,o=e.lvl;if(n.lvl>=o-1&&t.lvl>=o-1)return e;if(o>n.lvl+1){if(se$1(t))return he$1(ae$1(e,{lvl:o-1}));if(X$1(t)||X$1(t.r))throw new Error("Unexpected empty nodes");return ae$1(t.r,{l:ae$1(t,{r:t.r.l}),r:ae$1(e,{l:t.r.r,lvl:o-1}),lvl:o})}if(se$1(e))return me$1(ae$1(e,{lvl:o-1}));if(X$1(n)||X$1(n.l))throw new Error("Unexpected empty nodes");var r=n.l,i=se$1(r)?n.lvl-1:n.lvl;return ae$1(r,{l:ae$1(e,{r:r.l,lvl:o-1}),r:me$1(ae$1(n,{l:r.r,lvl:i})),lvl:r.lvl+1})}function fe$1(e,t,n){return X$1(e)?[]:de$1(re$1(e,ne$1(e,t)[0],n),function(e){return {index:e.k,value:e.v}})}function de$1(e,t){var n=e.length;if(0===n)return [];for(var o=t(e[0]),r=o.index,i=o.value,l=[],u=1;u<n;u++){var a=t(e[u]),s=a.index,c=a.value;l.push({start:r,end:s-1,value:i}),r=s,i=c;}return l.push({start:r,end:Infinity,value:i}),l}function me$1(e){var t=e.r,n=e.lvl;return X$1(t)||X$1(t.r)||t.lvl!==n||t.r.lvl!==n?e:ae$1(t,{l:ae$1(e,{r:t.l}),lvl:n+1})}function he$1(e){var t=e.l;return X$1(t)||t.lvl!==e.lvl?e:ae$1(t,{r:ae$1(e,{l:t.r})})}function pe$1(e,t,n,o){void 0===o&&(o=0);for(var r=e.length-1;o<=r;){var i=Math.floor((o+r)/2),l=n(e[i],t);if(0===l)return i;if(-1===l){if(r-o<2)return i-1;r=i-1;}else {if(r===o)return i;o=i+1;}}throw new Error("Failed binary finding record in array - "+e.join(",")+", searched for "+t)}function ve$1(e,t,n){return e[pe$1(e,t,n)]}function ge$1(e,t){return Math.round(e.getBoundingClientRect()[t])}function Ie$1(e){var t=e.size,n=e.startIndex,o=e.endIndex;return function(e){return e.start===n&&(e.end===o||Infinity===e.end)&&e.value===t}}function Ce$1(e,t){var n=e.index;return t===n?0:t<n?-1:1}function Se$1(e,t){var n=e.offset;return t===n?0:t<n?-1:1}function xe$1(e){return {index:e.index,value:e}}function Te$1(e,t){var n=t[0],o=t[1];n.length>0&&(0, t[2])("received item sizes",n,D$1.DEBUG);var r=e.sizeTree,i=e.offsetTree,l=r,u=0;if(o.length>0&&X$1(r)&&2===n.length){var a=n[0].size,s=n[1].size;l=o.reduce(function(e,t){return oe$1(oe$1(e,t,a),t+1,s)},l);}else {var c=function(e,t){for(var n,o=X$1(e)?0:Infinity,r=W$1(t);!(n=r()).done;){var i=n.value,l=i.size,u=i.startIndex,a=i.endIndex;if(o=Math.min(o,u),X$1(e))e=oe$1(e,0,l);else {var s=fe$1(e,u-1,a+1);if(!s.some(Ie$1(i))){for(var c,f=!1,d=!1,m=W$1(s);!(c=m()).done;){var h=c.value,p=h.start,v=h.end,g=h.value;f?(a>=p||l===g)&&(e=te$1(e,p)):(d=g!==l,f=!0),v>a&&a>=p&&g!==l&&(e=oe$1(e,a+1,g));}d&&(e=oe$1(e,u,l));}}}return [e,o]}(l,n);l=c[0],u=c[1];}if(l===r)return e;var f=0,d=0,m=0,h=0;if(0!==u){h=pe$1(i,u-1,Ce$1),m=i[h].offset;var p=ne$1(l,u-1);f=p[0],d=p[1],i.length&&i[h].size===ne$1(l,u)[1]&&(h-=1),i=i.slice(0,h+1);}else i=[];for(var v,g=W$1(fe$1(l,u,Infinity));!(v=g()).done;){var I=v.value,C=I.start,S=I.value,x=(C-f)*d+m;i.push({offset:x,size:S,index:C}),f=C,m=x,d=S;}return {sizeTree:l,offsetTree:i,groupOffsetTree:o.reduce(function(e,t){return oe$1(e,t,we$1(t,i))},ee$1()),lastIndex:f,lastOffset:m,lastSize:d,groupIndices:o}}function we$1(e,t){if(0===t.length)return 0;var n=ve$1(t,e,Ce$1);return n.size*(e-n.index)+n.offset}function ye$1(e,t){if(!be$1(t))return e;for(var n=0;t.groupIndices[n]<=e+n;)n++;return e+n}function be$1(e){return !X$1(e.groupOffsetTree)}var Re$1={offsetHeight:"height",offsetWidth:"width"},ze$1=system$1(function(e){var t=e[0].log,m=stream$1(),h=stream$1(),p=stream$1(),v=statefulStream$1(0),g=statefulStream$1([]),I=statefulStream$1(void 0),C=statefulStream$1(void 0),S=statefulStream$1(function(e,t){return ge$1(e,Re$1[t])}),x=statefulStream$1(void 0),y={offsetTree:[],sizeTree:ee$1(),groupOffsetTree:ee$1(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]},b=statefulStreamFromEmitter$1(pipe$1(m,withLatestFrom$1(g,t),scan$1(Te$1,y),distinctUntilChanged$1()),y);connect$1(pipe$1(g,filter$1(function(e){return e.length>0}),withLatestFrom$1(b),map$1(function(e){var t=e[0],n=e[1],o=t.reduce(function(e,t,o){return oe$1(e,t,we$1(t,n.offsetTree)||o)},ee$1());return P$1({},n,{groupIndices:t,groupOffsetTree:o})})),b),connect$1(pipe$1(h,withLatestFrom$1(b),filter$1(function(e){return e[0]<e[1].lastIndex}),map$1(function(e){var t=e[1];return [{startIndex:e[0],endIndex:t.lastIndex,size:t.lastSize}]})),m),connect$1(I,C);var R=statefulStreamFromEmitter$1(pipe$1(I,map$1(function(e){return void 0===e})),!0);connect$1(pipe$1(C,filter$1(function(e){return void 0!==e&&X$1(getValue$1(b).sizeTree)}),map$1(function(e){return [{startIndex:0,endIndex:0,size:e}]})),m);var z=streamFromEmitter$1(pipe$1(m,withLatestFrom$1(b),scan$1(function(e,t){var n=t[1];return {changed:n!==e.sizes,sizes:n}},{changed:!1,sizes:y}),map$1(function(e){return e.changed})));connect$1(pipe$1(v,scan$1(function(e,t){return {diff:e.prev-t,prev:t}},{diff:0,prev:0}),map$1(function(e){return e.diff}),filter$1(function(e){return e>0})),p),subscribe$1(pipe$1(v,withLatestFrom$1(t)),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:v},D$1.ERROR);});var H=streamFromEmitter$1(p);return connect$1(pipe$1(p,withLatestFrom$1(b),map$1(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 ie$1(n.sizeTree).reduce(function(e,n){var o=n.k,r=n.v;return {ranges:[].concat(e.ranges,[{startIndex:e.prevIndex,endIndex:o+t-1,size:e.prevSize}]),prevIndex:o+t,prevSize:r}},{ranges:[],prevIndex:0,prevSize:n.lastSize}).ranges})),m),{data:x,totalCount:h,sizeRanges:m,groupIndices:g,defaultItemSize:C,fixedItemSize:I,unshiftWith:p,beforeUnshiftWith:H,firstItemIndex:v,sizes:b,listRefresh:z,trackItemSizes:R,itemSize:S}},tup$1(K$1),{singleton:!0}),He$1="undefined"!=typeof document&&"scrollBehavior"in document.documentElement.style;function ke$1(e){var t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),t.behavior&&He$1||(t.behavior="auto"),t.offset||(t.offset=0),t}var Be$1=system$1(function(e){var t=e[0],l=t.sizes,a=t.totalCount,s=t.listRefresh,c=e[1],f=c.scrollingInProgress,m=c.viewportHeight,h=c.scrollTo,p=c.smoothScrollTargetReached,v=c.headerHeight,g=c.footerHeight,I=e[2].log,C=stream$1(),x=statefulStream$1(0),w=null,b=null,R=null;function z(){w&&(w(),w=null),R&&(R(),R=null),b&&(clearTimeout(b),b=null),publish$1(f,!1);}return connect$1(pipe$1(C,withLatestFrom$1(l,m,a,x,v,g,I),map$1(function(e){var t=e[0],n=e[1],o=e[2],r=e[3],l=e[4],u=e[5],a=e[6],c=e[7],m=ke$1(t),h=m.align,v=m.behavior,g=m.offset,I=r-1,x=m.index;x=ye$1(x,n);var T=we$1(x=Math.max(0,x,Math.min(I,x)),n.offsetTree)+u;"end"===h?(T=Math.round(T-o+ne$1(n.sizeTree,x)[1]),x===I&&(T+=a)):"center"===h?T=Math.round(T-o/2+ne$1(n.sizeTree,x)[1]/2):T-=l,g&&(T+=g);var H=function(e){z(),e?(c("retrying to scroll to",{location:t},D$1.DEBUG),publish$1(C,t)):c("list did not change, scroll successful",{},D$1.DEBUG);};if(z(),"smooth"===v){var k=!1;R=subscribe$1(s,function(e){k=k||e;}),w=handleNext$1(p,function(){H(k);});}else w=handleNext$1(pipe$1(s,function(e){var t=setTimeout(function(){e(!1);},50);return function(n){n&&(e(!0),clearTimeout(t));}}),H);return b=setTimeout(function(){z();},1200),publish$1(f,!0),c("scrolling from index to",{index:x,top:T,behavior:v},D$1.DEBUG),{top:T,behavior:v}})),h),{scrollToIndex:C,topListHeight:x}},tup$1(ze$1,_$1,K$1),{singleton:!0});function Ee$1(e,t,n){return "number"==typeof e?n===U$1&&"top"===t||"down"===n&&"bottom"===t?e:0:n===U$1?"top"===t?e.main:e.reverse:"bottom"===t?e.main:e.reverse}function Le$1(e,t){return "number"==typeof e?e:e[t]||0}var Oe$1=system$1(function(e){var t=e[0],r=t.scrollTop,l=t.viewportHeight,a=t.deviation,s=t.headerHeight,d=stream$1(),m=statefulStream$1(0),h=statefulStream$1(0),v=statefulStream$1(0);return {listBoundary:d,overscan:v,topListHeight:m,increaseViewportBy:h,visibleRange:statefulStreamFromEmitter$1(pipe$1(combineLatest$1(duc$1(r),duc$1(l),duc$1(s),duc$1(d,G$1),duc$1(v),duc$1(m),duc$1(a),duc$1(h)),map$1(function(e){var t=e[0],n=e[1],o=e[2],r=e[3],i=r[0],l=r[1],u=e[4],a=e[5],s=e[6],c=e[7],f=t-s,d=Math.max(o-f,0),m="none",h=Le$1(c,"top"),p=Le$1(c,"bottom");return i-=s,l+=o,(i+=o)>t+a-h&&(m=U$1),(l-=s)<t-d+n+p&&(m="down"),"none"!==m?[Math.max(f-o-Ee$1(u,"top",m)-h,0),f-d+n+Ee$1(u,"bottom",m)+p]:null}),filter$1(function(e){return null!=e}),distinctUntilChanged$1(G$1)),[0,0])}},tup$1(_$1),{singleton:!0}),Me$1=system$1(function(e){var t=e[0],l=t.scrollTop,a=t.scrollTo,s=stream$1(),c=stream$1(),f=stream$1(),d=statefulStream$1(!1);return connect$1(pipe$1(combineLatest$1(c,s),map$1(function(e){return Math.max(0,e[0]-e[1].offsetTop)})),l),connect$1(pipe$1(a,withLatestFrom$1(s),map$1(function(e){var t=e[0];return P$1({},t,{top:t.top+e[1].offsetTop})})),f),{useWindowScroll:d,windowScrollTop:c,windowViewportRect:s,windowScrollTo:f}},tup$1(_$1)),Pe$1={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},Fe$1={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},Ae$1=Math.ceil,We$1=Math.floor,Ge$1=Math.min,Ne$1=Math.max;function Ve$1(e){return Ae$1(e)-e<.03?Ae$1(e):We$1(e)}function De$1(e,t){return Array.from({length:t-e+1}).map(function(t,n){return {index:n+e}})}var Ue$1=system$1(function(e){var t=e[0],l=t.overscan,a=t.visibleRange,d=t.listBoundary,m=e[1],h=m.scrollTop,v=m.viewportHeight,I=m.scrollBy,S=m.scrollTo,x=m.smoothScrollTargetReached,y=e[2],b=e[3],R=e[4],z=R.propsReady,H=R.didMount,k=e[5],B=k.windowViewportRect,E=k.windowScrollTo,L=k.useWindowScroll,O=k.windowScrollTop,M=statefulStream$1(0),F=statefulStream$1(0),A=statefulStream$1(Pe$1),W=statefulStream$1({height:0,width:0}),V=statefulStream$1({height:0,width:0}),D=stream$1();connect$1(pipe$1(H,withLatestFrom$1(F),filter$1(function(e){return 0!==e[1]}),map$1(function(e){return {items:De$1(0,e[1]-1),top:0,bottom:0,offsetBottom:0,offsetTop:0,itemHeight:0,itemWidth:0}})),A),connect$1(pipe$1(combineLatest$1(duc$1(M),a,duc$1(V,function(e,t){return e&&e.width===t.width&&e.height===t.height})),withLatestFrom$1(W),map$1(function(e){var t=e[0],n=t[0],o=t[1],r=o[0],i=o[1],l=t[2],u=e[1],a=l.height,s=l.width,c=u.width;if(0===n||0===c)return Pe$1;if(0===s)return Fe$1;var f=Ve$1(c/s),d=f*We$1(r/a),m=f*Ae$1(i/a)-1;m=Ge$1(n-1,m);var h=De$1(d=Ge$1(m,Ne$1(0,d)),m),p=_e$1(u,l,h),v=p.top,g=p.bottom;return {items:h,offsetTop:v,offsetBottom:Ae$1(n/f)*a-g,top:v,bottom:g,itemHeight:a,itemWidth:s}})),A),connect$1(pipe$1(W,map$1(function(e){return e.height})),v),connect$1(pipe$1(combineLatest$1(W,V,A),map$1(function(e){var t=_e$1(e[0],e[1],e[2].items);return [t.top,t.bottom]}),distinctUntilChanged$1(G$1)),d),connect$1(pipe$1(d,withLatestFrom$1(A),map$1(function(e){return {bottom:e[0][1],offsetBottom:e[1].offsetBottom}})),y.listStateListener);var U=streamFromEmitter$1(pipe$1(duc$1(A),filter$1(function(e){return e.items.length>0}),withLatestFrom$1(M),filter$1(function(e){var t=e[0].items;return t[t.length-1].index===e[1]-1}),map$1(function(e){return e[1]-1}),distinctUntilChanged$1())),_=streamFromEmitter$1(pipe$1(duc$1(A),filter$1(function(e){var t=e.items;return t.length>0&&0===t[0].index}),mapTo$1(0),distinctUntilChanged$1())),j=streamFromEmitter$1(pipe$1(duc$1(A),filter$1(function(e){return e.items.length>0}),map$1(function(e){var t=e.items;return {startIndex:t[0].index,endIndex:t[t.length-1].index}}),distinctUntilChanged$1(N$1)));connect$1(j,b.scrollSeekRangeChanged),connect$1(pipe$1(D,withLatestFrom$1(W,V,M),map$1(function(e){var t=e[1],n=e[2],o=e[3],r=ke$1(e[0]),i=r.align,l=r.behavior,u=r.offset,a=r.index,s=je$1(t,n,a=Math.max(0,a,Math.min(o-1,a)));return "end"===i?s=Math.round(s-t.height+n.height):"center"===i&&(s=Math.round(s-t.height/2+n.height/2)),u&&(s+=u),{top:s,behavior:l}})),S);var K=statefulStreamFromEmitter$1(pipe$1(A,map$1(function(e){return e.offsetBottom+e.bottom})),0);return connect$1(pipe$1(B,map$1(function(e){return {width:e.visibleWidth,height:e.visibleHeight}})),W),P$1({totalCount:M,viewportDimensions:W,itemDimensions:V,scrollTop:h,overscan:l,scrollBy:I,scrollTo:S,scrollToIndex:D,smoothScrollTargetReached:x,windowViewportRect:B,windowScrollTo:E,useWindowScroll:L,windowScrollTop:O,initialItemCount:F},b,{gridState:A,totalListHeight:K},y,{startReached:_,endReached:U,rangeChanged:j,propsReady:z})},tup$1(Oe$1,_$1,q$1,$$1,Y$1,Me$1));function _e$1(e,t,n){var o=t.height;return void 0===o||0===n.length?{top:0,bottom:0}:{top:je$1(e,t,n[0].index),bottom:je$1(e,t,n[n.length-1].index)+o}}function je$1(e,t,n){var o=Ve$1(e.width/t.width);return We$1(n/o)*t.height}function Ke$1(e,t){void 0===t&&(t=!0);var n=React.useRef(null),o=function(e){};if("undefined"!=typeof ResizeObserver){var r=new ResizeObserver(function(t){var n=t[0].target;null!==n.offsetParent&&e(n);});o=function(e){e&&t?(r.observe(e),n.current=e):(n.current&&r.unobserve(n.current),n.current=null);};}return {ref:n,callbackRef:o}}function Ye$1(e,t){return void 0===t&&(t=!0),Ke$1(e,t).callbackRef}function Ze$1(e){var t=React.useRef(null),n=React.useCallback(function(n){if(null!==n){var o=n.getBoundingClientRect(),r=window.innerHeight-Math.max(0,o.top),i=o.top+window.pageYOffset;t.current={offsetTop:i,visibleHeight:r,visibleWidth:o.width},e(t.current);}},[e]),o=Ke$1(n),r=o.callbackRef,i=o.ref,l=React.useCallback(function(){n(i.current);},[n,i]);return React.useEffect(function(){return window.addEventListener("scroll",l),window.addEventListener("resize",l),function(){window.removeEventListener("scroll",l),window.removeEventListener("resize",l);}},[l]),r}var qe$1="undefined"!=typeof document?React.useLayoutEffect:React.useEffect;function $e$1(e,t,n,o){void 0===o&&(o=noop$1);var r=React.useRef(null),i=React.useRef(null),l=React.useRef(null),u=React.useCallback(function(n){var o=n.target,r=o===window||o===document?window.pageYOffset||document.documentElement.scrollTop:o.scrollTop;e(Math.max(r,0)),null!==i.current&&(r===i.current||r<=0||r===o.scrollHeight-ge$1(o,"height"))&&(i.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null));},[e,t]);return React.useEffect(function(){var e=r.current;return o(r.current),u({target:e}),e.addEventListener("scroll",u,{passive:!0}),function(){o(null),e.removeEventListener("scroll",u);}},[r,u,n,o]),{scrollerRef:r,scrollByCallback:function(e){null===i.current&&r.current.scrollBy(e);},scrollToCallback:function(n){var o=r.current;if(o&&(!("offsetHeight"in o)||0!==o.offsetHeight)){var u,a,s,c="smooth"===n.behavior;if(o===window?(a=Math.max(ge$1(document.documentElement,"height"),document.documentElement.scrollHeight),u=window.innerHeight,s=document.documentElement.scrollTop):(a=o.scrollHeight,u=ge$1(o,"height"),s=o.scrollTop),n.top=Math.max(Math.min(a-u,n.top),0),Math.abs(u-a)<1.01||n.top===s)return e(s),void(c&&t(!0));c?(i.current=n.top,l.current&&clearTimeout(l.current),l.current=setTimeout(function(){l.current=null,i.current=null,t(!0);},1e3)):i.current=null,o.scrollTo(n);}}}}var Je$1=system$1(function(e){var t=e[0],n=t.sizes,l=t.listRefresh,u=t.defaultItemSize,a=e[1].scrollTop,s=e[2].scrollToIndex,f=e[3].didMount,m=statefulStream$1(!0),h=statefulStream$1(0);return connect$1(pipe$1(f,withLatestFrom$1(h),filter$1(function(e){return 0!==e[1]}),mapTo$1(!1)),m),subscribe$1(pipe$1(combineLatest$1(l,f),withLatestFrom$1(m,n,u),filter$1(function(e){var t=e[1],n=e[3];return e[0][1]&&(!X$1(e[2].sizeTree)||void 0!==n)&&!t}),withLatestFrom$1(h)),function(e){var t=e[1];setTimeout(function(){handleNext$1(a,function(){publish$1(m,!0);}),publish$1(s,t);});}),{scrolledToInitialItem:m,initialTopMostItemIndex:h}},tup$1(ze$1,_$1,Be$1,Y$1),{singleton:!0});function Qe$1(e){return !!e&&("smooth"===e?"smooth":"auto")}var Xe$1=system$1(function(e){var t=e[0],n=t.totalCount,r=t.listRefresh,s=e[1],f=s.isAtBottom,m=s.atBottomState,h=e[2].scrollToIndex,g=e[3].scrolledToInitialItem,I=e[4],x=I.propsReady,w=I.didMount,b=e[5].log,R=statefulStream$1(!1),z=null;function H(e,t){publish$1(h,{index:e-1,align:"end",behavior:t});}return subscribe$1(pipe$1(combineLatest$1(pipe$1(duc$1(n),skip$1(1)),w),withLatestFrom$1(duc$1(R),f,g),map$1(function(e){var t=e[0],n=t[0],o=t[1]&&e[3],r="auto";return o&&(r=function(e,t){return "function"==typeof e?Qe$1(e(t)):t&&Qe$1(e)}(e[1],e[2]),o=o&&!!r),{totalCount:n,shouldFollow:o,followOutputBehavior:r}}),filter$1(function(e){return e.shouldFollow})),function(e){var t=e.totalCount,n=e.followOutputBehavior;z&&(z(),z=null),z=handleNext$1(r,function(){H(t,n),z=null;});}),subscribe$1(pipe$1(combineLatest$1(duc$1(R),n,x),filter$1(function(e){return e[0]&&e[2]}),scan$1(function(e,t){var n=t[1];return {refreshed:e.value===n,value:n}},{refreshed:!1,value:0}),filter$1(function(e){return e.refreshed}),withLatestFrom$1(R,n)),function(e){var t=e[1],n=e[2],o=handleNext$1(m,function(e){!t||e.atBottom||"SIZE_INCREASED"!==e.notAtBottomBecause||z||(getValue$1(b)("scrolling to bottom due to increased size",{totalCount:n},D$1.DEBUG),H(n,"auto"));});setTimeout(o,100);}),subscribe$1(pipe$1(combineLatest$1(duc$1(R),m),withLatestFrom$1(n)),function(e){var t=e[0],n=t[1];t[0]&&!n.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===n.notAtBottomBecause&&H(e[1],"auto");}),{followOutput:R}},tup$1(ze$1,q$1,Be$1,Je$1,Y$1,K$1));function et$1(e){return e.reduce(function(e,t){return e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e},{totalCount:0,groupIndices:[]})}var tt$1=system$1(function(e){var t=e[0],o=t.totalCount,l=t.groupIndices,a=t.sizes,d=e[1],m=d.scrollTop,h=d.headerHeight,p=stream$1(),v=stream$1(),g=streamFromEmitter$1(pipe$1(p,map$1(et$1)));return connect$1(pipe$1(g,map$1(prop$1("totalCount"))),o),connect$1(pipe$1(g,map$1(prop$1("groupIndices"))),l),connect$1(pipe$1(combineLatest$1(m,a,h),filter$1(function(e){return be$1(e[1])}),map$1(function(e){return ne$1(e[1].groupOffsetTree,Math.max(e[0]-e[2],0),"v")[0]}),distinctUntilChanged$1(),map$1(function(e){return [e]})),v),{groupCounts:p,topItemsIndexes:v}},tup$1(ze$1,_$1)),nt$1={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0};function ot$1(e,t,n){if(0===e.length)return [];if(!be$1(t))return e.map(function(e){return P$1({},e,{index:e.index+n,originalIndex:e.index})});for(var o,r=[],i=fe$1(t.groupOffsetTree,e[0].index,e[e.length-1].index),l=void 0,u=0,a=W$1(e);!(o=a()).done;){var s=o.value;(!l||l.end<s.index)&&(l=i.shift(),u=t.groupIndices.indexOf(l.start)),r.push(P$1({},s.index===l.start?{type:"group",index:u}:{index:s.index-(u+1)+n,groupIndex:u},{size:s.size,offset:s.offset,originalIndex:s.index,data:s.data}));}return r}function rt$1(e,t,n,o,r){var i=0,l=0;if(e.length>0){i=e[0].offset;var u=e[e.length-1];l=u.offset+u.size;}var a=i,s=o.lastOffset+(n-o.lastIndex)*o.lastSize-l;return {items:ot$1(e,o,r),topItems:ot$1(t,o,r),topListHeight:t.reduce(function(e,t){return t.size+e},0),offsetTop:i,offsetBottom:s,top:a,bottom:l,totalCount:n}}var it$1,lt$1,ut$1,at$1=system$1(function(e){var t=e[0],l=t.sizes,a=t.totalCount,d=t.data,m=t.firstItemIndex,h=e[1],v=e[2],g=v.visibleRange,I=v.listBoundary,S=v.topListHeight,y=e[3],b=y.scrolledToInitialItem,H=y.initialTopMostItemIndex,k=e[4].topListHeight,B=e[5],E=e[6].didMount,L=statefulStream$1([]),O=stream$1();connect$1(h.topItemsIndexes,L);var M=statefulStreamFromEmitter$1(pipe$1(combineLatest$1(E,duc$1(g),duc$1(a),duc$1(l),duc$1(H),b,duc$1(L),duc$1(m),d),filter$1(function(e){return e[0]}),map$1(function(e){var t=e[1],n=t[0],o=t[1],r=e[2],i=e[4],l=e[5],u=e[6],a=e[7],s=e[8],c=e[3],f=c.sizeTree,d=c.offsetTree;if(0===r||0===n&&0===o)return nt$1;if(X$1(f))return rt$1(function(e,t,n){if(be$1(t)){var o=ye$1(e,t);return [{index:ne$1(t.groupOffsetTree,o)[0],size:0,offset:0},{index:o,size:0,offset:0,data:n&&n[0]}]}return [{index:e,size:0,offset:0,data:n&&n[0]}]}(i,c,s),[],r,c,a);var m=[];if(u.length>0)for(var h,p=u[0],v=u[u.length-1],g=0,I=W$1(fe$1(f,p,v));!(h=I()).done;)for(var C=h.value,S=C.value,x=Math.max(C.start,p),T=Math.min(C.end,v),w=x;w<=T;w++)m.push({index:w,size:S,offset:g,data:s&&s[w]}),g+=S;if(!l)return rt$1([],m,r,c,a);var y=u.length>0?u[u.length-1]+1:0,b=function(e,t,n,o){return void 0===o&&(o=0),o>0&&(t=Math.max(t,ve$1(e,o,Ce$1).offset)),de$1((i=n,u=pe$1(r=e,t,l=Se$1),a=pe$1(r,i,l,u),r.slice(u,a+1)),xe$1);var r,i,l,u,a;}(d,n,o,y);if(0===b.length)return null;var R=r-1;return rt$1(tap$1([],function(e){for(var t,r=W$1(b);!(t=r()).done;){var i=t.value,l=i.value,u=l.offset,a=i.start,c=l.size;l.offset<n&&(u+=((a+=Math.floor((n-l.offset)/c))-i.start)*c),a<y&&(u+=(y-a)*c,a=y);for(var f=Math.min(i.end,R),d=a;d<=f&&!(u>=o);d++)e.push({index:d,size:c,offset:u,data:s&&s[d]}),u+=c;}}),m,r,c,a)}),filter$1(function(e){return null!==e}),distinctUntilChanged$1()),nt$1);return connect$1(pipe$1(d,filter$1(function(e){return void 0!==e}),map$1(function(e){return e.length})),a),connect$1(pipe$1(M,map$1(prop$1("topListHeight"))),k),connect$1(k,S),connect$1(M,B.listStateListener),connect$1(pipe$1(M,map$1(function(e){return [e.top,e.bottom]})),I),connect$1(pipe$1(M,map$1(function(e){return e.items})),O),P$1({listState:M,topItemsIndexes:L,endReached:streamFromEmitter$1(pipe$1(M,filter$1(function(e){return e.items.length>0}),withLatestFrom$1(a,d),filter$1(function(e){var t=e[0].items;return t[t.length-1].originalIndex===e[1]-1}),map$1(function(e){return [e[1]-1,e[2]]}),distinctUntilChanged$1(G$1),map$1(function(e){return e[0]}))),startReached:streamFromEmitter$1(pipe$1(M,throttleTime$1(200),filter$1(function(e){var t=e.items;return t.length>0&&t[0].originalIndex===e.topItems.length}),map$1(function(e){return e.items[0].index}),distinctUntilChanged$1())),rangeChanged:streamFromEmitter$1(pipe$1(M,filter$1(function(e){return e.items.length>0}),map$1(function(e){var t=e.items;return {startIndex:t[0].index,endIndex:t[t.length-1].index}}),distinctUntilChanged$1(N$1))),itemsRendered:O},B)},tup$1(ze$1,tt$1,Oe$1,Je$1,Be$1,q$1,Y$1),{singleton:!0}),st$1=system$1(function(e){var t=e[0],n=t.sizes,l=t.firstItemIndex,a=t.data,s=e[1].listState,f=e[2].didMount,d=statefulStream$1(0);return connect$1(pipe$1(f,withLatestFrom$1(d),filter$1(function(e){return 0!==e[1]}),withLatestFrom$1(n,l,a),map$1(function(e){var t=e[0][1],n=e[1],o=e[2],r=e[3],i=void 0===r?[]:r,l=0;if(n.groupIndices.length>0)for(var u,a=W$1(n.groupIndices);!((u=a()).done||u.value-l>=t);)l++;var s=t+l;return rt$1(Array.from({length:s}).map(function(e,t){return {index:t,size:0,offset:0,data:i[t]}}),[],s,n,o)})),s),{initialItemCount:d}},tup$1(ze$1,at$1,Y$1),{singleton:!0}),ct$1=system$1(function(e){var t=e[0].topItemsIndexes,n=statefulStream$1(0);return connect$1(pipe$1(n,filter$1(function(e){return e>0}),map$1(function(e){return Array.from({length:e}).map(function(e,t){return t})})),t),{topItemCount:n}},tup$1(at$1)),ft$1=system$1(function(e){var t=e[0],o=t.footerHeight,l=t.headerHeight,a=e[1].listState,s=stream$1(),c=statefulStreamFromEmitter$1(pipe$1(combineLatest$1(o,l,a),map$1(function(e){var t=e[2];return e[0]+e[1]+t.offsetBottom+t.bottom})),0);return connect$1(duc$1(c),s),{totalListHeight:c,totalListHeightChanged:s}},tup$1(_$1,at$1),{singleton:!0}),dt$1=system$1(function(e){var t=e[0],n=t.scrollBy,o=t.scrollTop,a=t.scrollDirection,f=t.deviation,m=t.scrollingInProgress,h=e[1].isScrolling,p=e[3],v=p.beforeUnshiftWith,g=p.sizes,I=e[4].log,y=streamFromEmitter$1(pipe$1(e[2].listState,scan$1(function(e,t){var n=e[1],o=t.items,r=0;if(n.length>0&&o.length>0){var i=o[0].originalIndex,l=n[0].originalIndex;if(0!==i||0!==l)if(i===l)r=o[0].size-n[0].size;else for(var u=function(e){var t=o[e],i=n.find(function(e){return e.originalIndex===t.originalIndex});return i?t.offset!==i.offset?(r=t.offset-i.offset,"break"):void 0:"continue"},a=o.length-1;a>=0;a--){var s=u(a);if("continue"!==s&&"break"===s)break}}return [r,o]},[0,[]]),filter$1(function(e){return 0!==e[0]}),withLatestFrom$1(o,a,m,I),filter$1(function(e){return !e[3]&&0!==e[1]&&e[2]===U$1}),map$1(function(e){var t=e[0][0];return (0, e[4])("Upward scrolling compensation",{amount:t},D$1.DEBUG),t})));return connect$1(pipe$1(y,withLatestFrom$1(f),map$1(function(e){return e[1]-e[0]})),f),subscribe$1(pipe$1(combineLatest$1(statefulStreamFromEmitter$1(h,!1),f),filter$1(function(e){return !e[0]&&0!==e[1]}),map$1(function(e){return e[1]}),throttleTime$1(1)),function(e){e>0?(publish$1(n,{top:-e,behavior:"auto"}),publish$1(f,0)):(publish$1(f,0),publish$1(n,{top:-e,behavior:"auto"}));}),connect$1(pipe$1(v,withLatestFrom$1(g),map$1(function(e){return e[0]*e[1].lastSize})),y),{deviation:f}},tup$1(_$1,q$1,at$1,ze$1,K$1)),mt$1=system$1(function(e){var t=e[0].totalListHeight,n=e[1].didMount,r=e[2].scrollTo,l=statefulStream$1(0);return subscribe$1(pipe$1(n,withLatestFrom$1(l),filter$1(function(e){return 0!==e[1]}),map$1(function(e){return {top:e[1]}})),function(e){handleNext$1(pipe$1(t,filter$1(function(e){return 0!==e})),function(){setTimeout(function(){publish$1(r,e);});});}),{initialScrollTop:l}},tup$1(ft$1,Y$1,_$1),{singleton:!0}),ht$1=system$1(function(e){var t=e[0].viewportHeight,n=e[1].totalListHeight,r=statefulStream$1(!1);return {alignToBottom:r,paddingTopAddition:statefulStreamFromEmitter$1(pipe$1(combineLatest$1(r,t,n),filter$1(function(e){return e[0]}),map$1(function(e){return Math.max(0,e[1]-e[2])}),distinctUntilChanged$1()),0)}},tup$1(_$1,ft$1),{singleton:!0}),pt$1=system$1(function(e){var t=e[0],o=t.sizes,l=t.totalCount,a=e[1],s=a.scrollTop,f=a.viewportHeight,d=a.headerHeight,m=a.scrollingInProgress,h=e[2].scrollToIndex,p=stream$1();return connect$1(pipe$1(p,withLatestFrom$1(o,f,l,d,s),map$1(function(e){var t=e[0],n=t.index,o=t.behavior,r=void 0===o?"auto":o,l=t.done,u=e[1],a=e[2],s=e[4],f=e[5],d=e[3]-1,h=null;n=ye$1(n,u);var p=we$1(n=Math.max(0,n,Math.min(d,n)),u.offsetTree)+s;return p<f?h={index:n,behavior:r,align:"start"}:p+ne$1(u.sizeTree,n)[1]>f+a&&(h={index:n,behavior:r,align:"end"}),h?l&&handleNext$1(pipe$1(m,skip$1(1),filter$1(function(e){return !1===e})),l):l&&l(),h}),filter$1(function(e){return null!==e})),h),{scrollIntoView:p}},tup$1(ze$1,_$1,Be$1,at$1,K$1),{singleton:!0}),vt$1=system$1(function(e){return P$1({},e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},tup$1(Oe$1,st$1,Y$1,$$1,ft$1,mt$1,ht$1,Me$1,pt$1)),gt$1=system$1(function(e){var t=e[0],n=t.totalCount,o=t.sizeRanges,l=t.fixedItemSize,a=t.defaultItemSize,s=t.trackItemSizes,c=t.itemSize,f=t.data,d=t.firstItemIndex,m=t.groupIndices,h=e[1],p=h.initialTopMostItemIndex,v=h.scrolledToInitialItem,g=e[2],I=e[3],C=e[4],S=C.listState,x=C.topItemsIndexes,T=F$1(C,["listState","topItemsIndexes"]),w=e[5].scrollToIndex,y=e[7].topItemCount,b=e[8].groupCounts,z=e[9],H=e[10];return connect$1(T.rangeChanged,z.scrollSeekRangeChanged),connect$1(pipe$1(z.windowViewportRect,map$1(prop$1("visibleHeight"))),g.viewportHeight),P$1({totalCount:n,data:f,firstItemIndex:d,sizeRanges:o,initialTopMostItemIndex:p,scrolledToInitialItem:v,topItemsIndexes:x,topItemCount:y,groupCounts:b,fixedItemHeight:l,defaultItemHeight:a},I,{listState:S,scrollToIndex:w,trackItemSizes:s,itemSize:c,groupIndices:m},T,z,g,H)},tup$1(ze$1,Je$1,_$1,Xe$1,at$1,Be$1,dt$1,ct$1,tt$1,vt$1,K$1)),It$1=(it$1=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"},ut$1=!1,function(){return ut$1||(ut$1=!0,lt$1=it$1()),lt$1});function Ct$1(e){return e}var St$1=system$1(function(){var e=statefulStream$1(function(e){return "Item "+e}),t=statefulStream$1(function(e){return "Group "+e}),n=statefulStream$1({}),r=statefulStream$1(Ct$1),l=statefulStream$1("div"),a=statefulStream$1(noop$1),s=function(e,t){return void 0===t&&(t=null),statefulStreamFromEmitter$1(pipe$1(n,map$1(function(t){return t[e]}),distinctUntilChanged$1()),t)};return {itemContent:e,groupContent:t,components:n,computeItemKey:r,headerFooterTag:l,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 xt$1(e,t){var o=stream$1();return subscribe$1(o,function(){return console.warn("react-virtuoso: You are using a deprecated property. "+t,"color: red;","color: inherit;","color: blue;")}),connect$1(o,e),o}var Tt$1=system$1(function(e){var t=e[0],o=e[1],l={item:xt$1(o.itemContent,"Rename the %citem%c prop to %citemContent."),group:xt$1(o.groupContent,"Rename the %cgroup%c prop to %cgroupContent."),topItems:xt$1(t.topItemCount,"Rename the %ctopItems%c prop to %ctopItemCount."),itemHeight:xt$1(t.fixedItemHeight,"Rename the %citemHeight%c prop to %cfixedItemHeight."),scrollingStateChange:xt$1(t.isScrolling,"Rename the %cscrollingStateChange%c prop to %cisScrolling."),adjustForPrependedItems:stream$1(),maxHeightCacheSize:stream$1(),footer:stream$1(),header:stream$1(),HeaderContainer:stream$1(),FooterContainer:stream$1(),ItemContainer:stream$1(),ScrollContainer:stream$1(),GroupContainer:stream$1(),ListContainer:stream$1(),emptyComponent:stream$1(),scrollSeek:stream$1()};function s(e,t,n){connect$1(pipe$1(e,withLatestFrom$1(o.components),map$1(function(e){var o,r=e[0],i=e[1];return console.warn("react-virtuoso: "+n+" property is deprecated. Pass components."+t+" instead."),P$1({},i,((o={})[t]=r,o))})),o.components);}return subscribe$1(l.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;");}),subscribe$1(l.maxHeightCacheSize,function(){console.warn("react-virtuoso: maxHeightCacheSize is no longer necessary. Setting it has no effect - remove it from your code.");}),subscribe$1(l.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.");}),subscribe$1(l.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.");}),subscribe$1(l.scrollSeek,function(e){var n=e.placeholder,r=F$1(e,["placeholder"]);console.warn("react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead."),publish$1(o.components,P$1({},getValue$1(o.components),{ScrollSeekPlaceholder:n})),publish$1(t.scrollSeekConfiguration,r);}),s(l.footer,"Footer","footer"),s(l.header,"Header","header"),s(l.ItemContainer,"Item","ItemContainer"),s(l.ListContainer,"List","ListContainer"),s(l.ScrollContainer,"Scroller","ScrollContainer"),s(l.emptyComponent,"EmptyPlaceholder","emptyComponent"),s(l.GroupContainer,"Group","GroupContainer"),P$1({},t,o,l)},tup$1(gt$1,St$1)),wt$1=function(e){return React.createElement("div",{style:{height:e.height}})},yt$1={position:It$1(),zIndex:1},bt$1=React.memo(function(e){var t,n,o,r,i=e.showTopList,l=void 0!==i&&i,u=Gt$1("listState"),a=Gt$1("deviation"),s=Wt$1("sizeRanges"),c=Gt$1("itemContent"),f=Gt$1("groupContent"),d=Gt$1("trackItemSizes"),m=(t=s,n=Gt$1("itemSize"),o=d,r=Gt$1("log"),Ye$1(function(e){var o=function(e,t,n,o){var r=e.length;if(0===r)return null;for(var i=[],l=0;l<r;l++){var u=e.item(l);if(u&&void 0!==u.dataset.index){var a=parseInt(u.dataset.index),s=parseFloat(u.dataset.knownSize),c=t(u,"offsetHeight");if(0===c&&o("Zero-sized element, this should not happen",{child:u},D$1.ERROR),c!==s){var f=i[i.length-1];0===i.length||f.size!==c||f.endIndex!==a-1?i.push({startIndex:a,endIndex:a,size:c}):i[i.length-1].endIndex++;}}}return i}(e.children,n,0,r);null!==o&&t(o);},o)),h=Gt$1("EmptyPlaceholder"),p=Gt$1("ScrollSeekPlaceholder")||wt$1,v=Gt$1("ListComponent"),g=Gt$1("ItemComponent"),I=Gt$1("GroupComponent"),C=Gt$1("computeItemKey"),S=Gt$1("isSeeking"),x=Gt$1("groupIndices").length>0,T=Gt$1("paddingTopAddition"),w=Gt$1("scrolledToInitialItem"),y=Gt$1("firstItemIndex"),b=l?{}:{boxSizing:"border-box",paddingTop:u.offsetTop+T,paddingBottom:u.offsetBottom,marginTop:a};return !l&&0===u.items.length&&h&&w?React.createElement(h):React.createElement(v,{ref:m,style:b,"data-test-id":l?"virtuoso-top-item-list":"virtuoso-item-list"},(l?u.topItems:u.items).map(function(e){var t=e.originalIndex,n=C(t+y,e.data);return S?React.createElement(p,{key:n,index:e.index,height:e.size}):"group"===e.type?React.createElement(I,{key:n,"data-index":t,"data-known-size":e.size,"data-item-index":e.index,style:yt$1},f(e.index)):React.createElement(g,{key:n,"data-index":t,"data-known-size":e.size,"data-item-index":e.index,"data-item-group-index":e.groupIndex},x?c(e.index,e.groupIndex,e.data):c(e.index,e.data))}))}),Rt$1={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},zt$1={width:"100%",height:"100%",position:"absolute",top:0},Ht$1={width:"100%",position:It$1(),top:0},kt$1=React.memo(function(){var e=Gt$1("HeaderComponent"),t=Wt$1("headerHeight"),n=Gt$1("headerFooterTag"),o=Ye$1(function(e){return t(ge$1(e,"height"))});return e?React.createElement(n,{ref:o},React.createElement(e)):null}),Bt$1=React.memo(function(){var e=Gt$1("FooterComponent"),t=Wt$1("footerHeight"),n=Gt$1("headerFooterTag"),o=Ye$1(function(e){return t(ge$1(e,"height"))});return e?React.createElement(n,{ref:o},React.createElement(e)):null});function Et$1(e){var t=e.usePublisher,n=e.useEmitter,o=e.useEmitterValue;return React.memo(function(e){var r=e.style,i=e.children,l=F$1(e,["style","children"]),u=t("scrollTop"),a=o("ScrollerComponent"),s=$e$1(u,t("smoothScrollTargetReached"),a,o("scrollerRef")),c=s.scrollerRef,f=s.scrollByCallback;return n("scrollTo",s.scrollToCallback),n("scrollBy",f),React.createElement(a,P$1({ref:c,style:P$1({},Rt$1,r),tabIndex:0},l),i)})}function Lt$1(e){var t=e.usePublisher,n=e.useEmitter,o=e.useEmitterValue;return React.memo(function(e){var r=e.style,i=e.children,l=F$1(e,["style","children"]),u=t("windowScrollTop"),a=o("ScrollerComponent"),s=t("smoothScrollTargetReached"),c=o("totalListHeight"),f=$e$1(u,s,a),d=f.scrollerRef,m=f.scrollByCallback,h=f.scrollToCallback;return qe$1(function(){return d.current=window,function(){d.current=null;}},[d]),n("windowScrollTo",h),n("scrollBy",m),React.createElement(a,P$1({style:P$1({position:"relative"},r,0!==c?{height:c}:{})},l),i)})}var Ot$1=function(e){var t=e.children,n=Wt$1("viewportHeight"),o=Ye$1(compose$1(n,function(e){return ge$1(e,"height")}));return React.createElement("div",{style:zt$1,ref:o},t)},Mt$1=function(e){var t=e.children,n=Ze$1(Wt$1("windowViewportRect"));return React.createElement("div",{ref:n,style:zt$1},t)},Pt$1=function(e){var t=e.children,n=Gt$1("TopItemListComponent"),o=Gt$1("headerHeight"),r=P$1({},Ht$1,{marginTop:o+"px"});return React.createElement(n||"div",{style:r},t)},Ft$1=systemToComponent$1(Tt$1,{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"}},React.memo(function(e){var t=Gt$1("useWindowScroll"),n=Gt$1("topItemsIndexes").length>0,o=t?Mt$1:Ot$1;return React.createElement(t?Dt$1:Vt$1,P$1({},e),React.createElement(o,null,React.createElement(kt$1,null),React.createElement(bt$1,null),React.createElement(Bt$1,null)),n&&React.createElement(Pt$1,null,React.createElement(bt$1,{showTopList:!0})))})),At$1=Ft$1.Component,Wt$1=Ft$1.usePublisher,Gt$1=Ft$1.useEmitterValue,Nt$1=Ft$1.useEmitter,Vt$1=Et$1({usePublisher:Wt$1,useEmitterValue:Gt$1,useEmitter:Nt$1}),Dt$1=Lt$1({usePublisher:Wt$1,useEmitterValue:Gt$1,useEmitter:Nt$1}),Ut$1=system$1(function(){var e=statefulStream$1(function(e){return "Item "+e}),t=statefulStream$1({}),n=statefulStream$1("virtuoso-grid-item"),r=statefulStream$1("virtuoso-grid-list"),l=statefulStream$1(Ct$1),a=statefulStream$1(noop$1),s=function(e,n){return void 0===n&&(n=null),statefulStreamFromEmitter$1(pipe$1(t,map$1(function(t){return t[e]}),distinctUntilChanged$1()),n)};return {itemContent:e,components:t,computeItemKey:l,itemClassName:n,listClassName:r,scrollerRef:a,ListComponent:s("List","div"),ItemComponent:s("Item","div"),ScrollerComponent:s("Scroller","div"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder","div")}}),_t$1=system$1(function(e){var t=e[0],o=e[1],l={item:xt$1(o.itemContent,"Rename the %citem%c prop to %citemContent."),ItemContainer:stream$1(),ScrollContainer:stream$1(),ListContainer:stream$1(),emptyComponent:stream$1(),scrollSeek:stream$1()};function s(e,t,n){connect$1(pipe$1(e,withLatestFrom$1(o.components),map$1(function(e){var o,r=e[0],i=e[1];return console.warn("react-virtuoso: "+n+" property is deprecated. Pass components."+t+" instead."),P$1({},i,((o={})[t]=r,o))})),o.components);}return subscribe$1(l.scrollSeek,function(e){var n=e.placeholder,r=F$1(e,["placeholder"]);console.warn("react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead."),publish$1(o.components,P$1({},getValue$1(o.components),{ScrollSeekPlaceholder:n})),publish$1(t.scrollSeekConfiguration,r);}),s(l.ItemContainer,"Item","ItemContainer"),s(l.ListContainer,"List","ListContainer"),s(l.ScrollContainer,"Scroller","ScrollContainer"),P$1({},t,o,l)},tup$1(Ue$1,Ut$1)),jt$1=React.memo(function(){var e=Jt$1("gridState"),t=Jt$1("listClassName"),n=Jt$1("itemClassName"),o=Jt$1("itemContent"),r=Jt$1("computeItemKey"),i=Jt$1("isSeeking"),l=Jt$1("ItemComponent"),u=Jt$1("ListComponent"),a=Jt$1("ScrollSeekPlaceholder"),s=$t$1("itemDimensions"),c=Ye$1(function(e){var t=e.firstChild;t&&s(t.getBoundingClientRect());});return React.createElement(u,{ref:c,className:t,style:{paddingTop:e.offsetTop,paddingBottom:e.offsetBottom}},e.items.map(function(t){var u=r(t.index);return i?React.createElement(a,{key:u,style:{height:e.itemHeight,width:e.itemWidth}}):React.createElement(l,{className:n,"data-index":t.index,key:u},o(t.index))}))}),Kt$1=function(e){var t=e.children,n=$t$1("viewportDimensions"),o=Ye$1(function(e){n(e.getBoundingClientRect());});return React.createElement("div",{style:zt$1,ref:o},t)},Yt$1=function(e){var t=e.children,n=Ze$1($t$1("windowViewportRect"));return React.createElement("div",{ref:n,style:zt$1},t)},Zt$1=systemToComponent$1(_t$1,{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"}},React.memo(function(e){var t=P$1({},e),n=Jt$1("useWindowScroll"),o=n?Yt$1:Kt$1;return React.createElement(n?en$1:Xt$1,P$1({},t),React.createElement(o,null,React.createElement(jt$1,null)))})),$t$1=Zt$1.usePublisher,Jt$1=Zt$1.useEmitterValue,Qt$1=Zt$1.useEmitter,Xt$1=Et$1({usePublisher:$t$1,useEmitterValue:Jt$1,useEmitter:Qt$1}),en$1=Lt$1({usePublisher:$t$1,useEmitterValue:Jt$1,useEmitter:Qt$1}),tn$1=At$1;
61333
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};function P$1(){return (P$1=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);}return e}).apply(this,arguments)}function A$1(e,t){if(null==e)return {};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)t.indexOf(n=i[o])>=0||(r[n]=e[n]);return r}function F$1(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function G$1(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 F$1(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)?F$1(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}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 W$1(e,t){return !(!e||e[0]!==t[0]||e[1]!==t[1])}function V$1(e,t){return !(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}var N$1,D$1,U$1=system$1(function(){var e=stream$1(),t=statefulStream$1(0),i=stream$1(),l=statefulStream$1(0),u=stream$1(),a=stream$1(),s=statefulStream$1(0),c=statefulStream$1(0),d=stream$1(),f=stream$1(),h=statefulStream$1(!1);return connect$1(e,l),{scrollTop:e,viewportHeight:u,headerHeight:s,footerHeight:c,scrollHeight:a,smoothScrollTargetReached:i,scrollTo:d,scrollBy:f,statefulScrollTop:l,deviation:t,scrollingInProgress:h}},[],{singleton:!0});!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR";}(D$1||(D$1={}));var _$1=((N$1={})[D$1.DEBUG]="debug",N$1[D$1.INFO]="log",N$1[D$1.WARN]="warn",N$1[D$1.ERROR]="error",N$1),j$1=system$1(function(){var e=statefulStream$1(D$1.ERROR);return {log:statefulStream$1(function(t,n,o){var r;void 0===o&&(o=D$1.INFO),o>=(null!=(r=("undefined"==typeof globalThis?window:globalThis).VIRTUOSO_LOG_LEVEL)?r:getValue$1(e))&&console[_$1[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: black",t,n);}),logLevel:e}},[],{singleton:!0}),K$1=system$1(function(e){var t=e[0].log,n=statefulStream$1(!1),r=streamFromEmitter$1(pipe$1(n,filter$1(function(e){return e}),distinctUntilChanged$1()));return subscribe$1(n,function(e){e&&getValue$1(t)("props updated",{},D$1.DEBUG);}),{propsReady:n,didMount:r}},tup$1(j$1),{singleton:!0}),Y$1="up",Z$1={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},q$1=system$1(function(e){var t=e[0],a=t.scrollTop,d=t.viewportHeight,S=t.headerHeight,T=t.footerHeight,w=t.scrollHeight,y=statefulStream$1(!1),H=statefulStream$1(!0),b=stream$1(),R=stream$1(),z=statefulStream$1(4),k=streamFromEmitter$1(pipe$1(merge$1(pipe$1(duc$1(a),skip$1(1),mapTo$1(!0)),pipe$1(duc$1(a),skip$1(1),mapTo$1(!1),debounceTime$1(100))),distinctUntilChanged$1()));connect$1(pipe$1(duc$1(a),map$1(function(e){return 0===e}),distinctUntilChanged$1()),H),connect$1(H,R);var B=streamFromEmitter$1(pipe$1(combineLatest$1(w,duc$1(a),duc$1(d),duc$1(S),duc$1(T),duc$1(z)),scan$1(function(e,t){var n=t[0],o=t[1],r=t[2],i={viewportHeight:r,scrollTop:o,scrollHeight:n};return o+r-n>-t[5]?{atBottom:!0,state:i}:{atBottom:!1,notAtBottomBecause:i.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":r<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":o<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",state:i}},Z$1),distinctUntilChanged$1(function(e,t){return e&&e.atBottom===t.atBottom})));connect$1(pipe$1(B,map$1(function(e){return e.atBottom})),y),subscribe$1(y,function(e){setTimeout(function(){return publish$1(b,e)});});var E=statefulStream$1("down");return connect$1(pipe$1(a,scan$1(function(e,t){return {direction:t<e.prevScrollTop&&!getValue$1(y)?Y$1:"down",prevScrollTop:t}},{direction:"down",prevScrollTop:0}),map$1(function(e){return e.direction})),E),{isScrolling:k,isAtTop:H,isAtBottom:y,atBottomState:B,atTopStateChange:R,atBottomStateChange:b,scrollDirection:E,atBottomThreshold:z}},tup$1(U$1)),$$1=system$1(function(e){var t=e[0].scrollTop,i=e[1].isScrolling,l=statefulStream$1(0),d=statefulStream$1(!1),f=stream$1(),h=statefulStream$1(!1);return connect$1(pipe$1(i,filter$1(function(e){return !e}),mapTo$1(0)),l),connect$1(pipe$1(t,throttleTime$1(100),withLatestFrom$1(i),filter$1(function(e){return !!e[1]}),scan$1(function(e,t){return [e[1],t[0]]},[0,0]),map$1(function(e){return e[1]-e[0]})),l),connect$1(pipe$1(l,withLatestFrom$1(h,d,f),filter$1(function(e){return !!e[1]}),map$1(function(e){var t=e[0],n=e[1],o=e[2],r=e[3],i=n.enter;if(o){if((0, n.exit)(t,r))return !1}else if(i(t,r))return !0;return o}),distinctUntilChanged$1()),d),subscribe$1(pipe$1(combineLatest$1(d,l,f),withLatestFrom$1(h)),function(e){var t=e[0],n=e[1];return t[0]&&n&&n.change&&n.change(t[1],t[2])}),{isSeeking:d,scrollSeekConfiguration:h,scrollVelocity:l,scrollSeekRangeChanged:f}},tup$1(U$1,q$1),{singleton:!0}),J$1={lvl:0};function Q$1(e,t,n,o,r){return void 0===o&&(o=J$1),void 0===r&&(r=J$1),{k:e,v:t,lvl:n,l:o,r:r}}function X$1(e){return e===J$1}function ee$1(){return J$1}function te$1(e,t){if(X$1(e))return J$1;var n=e.k,o=e.l,r=e.r;if(t===n){if(X$1(o))return r;if(X$1(r))return o;var i=le$1(o);return ce$1(ae$1(e,{k:i[0],v:i[1],l:ue$1(o)}))}return ce$1(ae$1(e,t<n?{l:te$1(o,t)}:{r:te$1(r,t)}))}function ne$1(e,t,n){if(void 0===n&&(n="k"),X$1(e))return [-Infinity,void 0];if(e[n]===t)return [e.k,e.v];if(e[n]<t){var o=ne$1(e.r,t,n);return -Infinity===o[0]?[e.k,e.v]:o}return ne$1(e.l,t,n)}function oe$1(e,t,n){return X$1(e)?Q$1(t,n,1):t===e.k?ae$1(e,{k:t,v:n}):function(e){return he$1(me$1(e))}(ae$1(e,t<e.k?{l:oe$1(e.l,t,n)}:{r:oe$1(e.r,t,n)}))}function re$1(e,t,n){if(X$1(e))return [];var o=e.k,r=e.v,i=e.r,l=[];return o>t&&(l=l.concat(re$1(e.l,t,n))),o>=t&&o<=n&&l.push({k:o,v:r}),o<=n&&(l=l.concat(re$1(i,t,n))),l}function ie$1(e){return X$1(e)?[]:[].concat(ie$1(e.l),[{k:e.k,v:e.v}],ie$1(e.r))}function le$1(e){return X$1(e.r)?[e.k,e.v]:le$1(e.r)}function ue$1(e){return X$1(e.r)?e.l:ce$1(ae$1(e,{r:ue$1(e.r)}))}function ae$1(e,t){return Q$1(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 se$1(e){return X$1(e)||e.lvl>e.r.lvl}function ce$1(e){var t=e.l,n=e.r,o=e.lvl;if(n.lvl>=o-1&&t.lvl>=o-1)return e;if(o>n.lvl+1){if(se$1(t))return me$1(ae$1(e,{lvl:o-1}));if(X$1(t)||X$1(t.r))throw new Error("Unexpected empty nodes");return ae$1(t.r,{l:ae$1(t,{r:t.r.l}),r:ae$1(e,{l:t.r.r,lvl:o-1}),lvl:o})}if(se$1(e))return he$1(ae$1(e,{lvl:o-1}));if(X$1(n)||X$1(n.l))throw new Error("Unexpected empty nodes");var r=n.l,i=se$1(r)?n.lvl-1:n.lvl;return ae$1(r,{l:ae$1(e,{r:r.l,lvl:o-1}),r:he$1(ae$1(n,{l:r.r,lvl:i})),lvl:r.lvl+1})}function de$1(e,t,n){return X$1(e)?[]:fe$1(re$1(e,ne$1(e,t)[0],n),function(e){return {index:e.k,value:e.v}})}function fe$1(e,t){var n=e.length;if(0===n)return [];for(var o=t(e[0]),r=o.index,i=o.value,l=[],u=1;u<n;u++){var a=t(e[u]),s=a.index,c=a.value;l.push({start:r,end:s-1,value:i}),r=s,i=c;}return l.push({start:r,end:Infinity,value:i}),l}function he$1(e){var t=e.r,n=e.lvl;return X$1(t)||X$1(t.r)||t.lvl!==n||t.r.lvl!==n?e:ae$1(t,{l:ae$1(e,{r:t.l}),lvl:n+1})}function me$1(e){var t=e.l;return X$1(t)||t.lvl!==e.lvl?e:ae$1(t,{r:ae$1(e,{l:t.r})})}function pe$1(e,t,n,o){void 0===o&&(o=0);for(var r=e.length-1;o<=r;){var i=Math.floor((o+r)/2),l=n(e[i],t);if(0===l)return i;if(-1===l){if(r-o<2)return i-1;r=i-1;}else {if(r===o)return i;o=i+1;}}throw new Error("Failed binary finding record in array - "+e.join(",")+", searched for "+t)}function ve$1(e,t,n){return e[pe$1(e,t,n)]}function ge$1(e,t){return Math.round(e.getBoundingClientRect()[t])}function Ie$1(e){var t=e.size,n=e.startIndex,o=e.endIndex;return function(e){return e.start===n&&(e.end===o||Infinity===e.end)&&e.value===t}}function Ce$1(e,t){var n=e.index;return t===n?0:t<n?-1:1}function xe$1(e,t){var n=e.offset;return t===n?0:t<n?-1:1}function Se$1(e){return {index:e.index,value:e}}function Te$1(e,t){var n=t[0],o=t[1];n.length>0&&(0, t[2])("received item sizes",n,D$1.DEBUG);var r=e.sizeTree,i=e.offsetTree,l=r,u=0;if(o.length>0&&X$1(r)&&2===n.length){var a=n[0].size,s=n[1].size;l=o.reduce(function(e,t){return oe$1(oe$1(e,t,a),t+1,s)},l);}else {var c=function(e,t){for(var n,o=X$1(e)?0:Infinity,r=G$1(t);!(n=r()).done;){var i=n.value,l=i.size,u=i.startIndex,a=i.endIndex;if(o=Math.min(o,u),X$1(e))e=oe$1(e,0,l);else {var s=de$1(e,u-1,a+1);if(!s.some(Ie$1(i))){for(var c,d=!1,f=!1,h=G$1(s);!(c=h()).done;){var m=c.value,p=m.start,v=m.end,g=m.value;d?(a>=p||l===g)&&(e=te$1(e,p)):(f=g!==l,d=!0),v>a&&a>=p&&g!==l&&(e=oe$1(e,a+1,g));}f&&(e=oe$1(e,u,l));}}}return [e,o]}(l,n);l=c[0],u=c[1];}if(l===r)return e;var d=0,f=0,h=0,m=0;if(0!==u){m=pe$1(i,u-1,Ce$1),h=i[m].offset;var p=ne$1(l,u-1);d=p[0],f=p[1],i.length&&i[m].size===ne$1(l,u)[1]&&(m-=1),i=i.slice(0,m+1);}else i=[];for(var v,g=G$1(de$1(l,u,Infinity));!(v=g()).done;){var I=v.value,C=I.start,x=I.value,S=(C-d)*f+h;i.push({offset:S,size:x,index:C}),d=C,h=S,f=x;}return {sizeTree:l,offsetTree:i,groupOffsetTree:o.reduce(function(e,t){return oe$1(e,t,we$1(t,i))},ee$1()),lastIndex:d,lastOffset:h,lastSize:f,groupIndices:o}}function we$1(e,t){if(0===t.length)return 0;var n=ve$1(t,e,Ce$1);return n.size*(e-n.index)+n.offset}function ye$1(e,t){if(!He$1(t))return e;for(var n=0;t.groupIndices[n]<=e+n;)n++;return e+n}function He$1(e){return !X$1(e.groupOffsetTree)}var be$1={offsetHeight:"height",offsetWidth:"width"},Re$1=system$1(function(e){var t=e[0].log,d=stream$1(),f=stream$1(),h=stream$1(),m=statefulStream$1(0),p=statefulStream$1([]),v=statefulStream$1(void 0),I=statefulStream$1(void 0),x=statefulStream$1(function(e,t){return ge$1(e,be$1[t])}),S=statefulStream$1(void 0),y={offsetTree:[],sizeTree:ee$1(),groupOffsetTree:ee$1(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]},H=statefulStreamFromEmitter$1(pipe$1(d,withLatestFrom$1(p,t),scan$1(Te$1,y),distinctUntilChanged$1()),y);connect$1(pipe$1(p,filter$1(function(e){return e.length>0}),withLatestFrom$1(H),map$1(function(e){var t=e[0],n=e[1],o=t.reduce(function(e,t,o){return oe$1(e,t,we$1(t,n.offsetTree)||o)},ee$1());return P$1({},n,{groupIndices:t,groupOffsetTree:o})})),H),connect$1(pipe$1(f,withLatestFrom$1(H),filter$1(function(e){return e[0]<e[1].lastIndex}),map$1(function(e){var t=e[1];return [{startIndex:e[0],endIndex:t.lastIndex,size:t.lastSize}]})),d),connect$1(v,I);var b=statefulStreamFromEmitter$1(pipe$1(v,map$1(function(e){return void 0===e})),!0);connect$1(pipe$1(I,filter$1(function(e){return void 0!==e&&X$1(getValue$1(H).sizeTree)}),map$1(function(e){return [{startIndex:0,endIndex:0,size:e}]})),d);var R=streamFromEmitter$1(pipe$1(d,withLatestFrom$1(H),scan$1(function(e,t){var n=t[1];return {changed:n!==e.sizes,sizes:n}},{changed:!1,sizes:y}),map$1(function(e){return e.changed})));connect$1(pipe$1(m,scan$1(function(e,t){return {diff:e.prev-t,prev:t}},{diff:0,prev:0}),map$1(function(e){return e.diff}),filter$1(function(e){return e>0})),h),subscribe$1(pipe$1(m,withLatestFrom$1(t)),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:m},D$1.ERROR);});var z=streamFromEmitter$1(h);return connect$1(pipe$1(h,withLatestFrom$1(H),map$1(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 ie$1(n.sizeTree).reduce(function(e,n){var o=n.k,r=n.v;return {ranges:[].concat(e.ranges,[{startIndex:e.prevIndex,endIndex:o+t-1,size:e.prevSize}]),prevIndex:o+t,prevSize:r}},{ranges:[],prevIndex:0,prevSize:n.lastSize}).ranges})),d),{data:S,totalCount:f,sizeRanges:d,groupIndices:p,defaultItemSize:I,fixedItemSize:v,unshiftWith:h,beforeUnshiftWith:z,firstItemIndex:m,sizes:H,listRefresh:R,trackItemSizes:b,itemSize:x}},tup$1(j$1),{singleton:!0}),ze$1="undefined"!=typeof document&&"scrollBehavior"in document.documentElement.style;function ke$1(e){var t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),t.behavior&&ze$1||(t.behavior="auto"),t.offset||(t.offset=0),t}var Be$1=system$1(function(e){var t=e[0],i=t.sizes,l=t.totalCount,a=t.listRefresh,s=e[1],d=s.scrollingInProgress,f=s.viewportHeight,h=s.scrollTo,m=s.smoothScrollTargetReached,p=s.headerHeight,v=s.footerHeight,I=e[2].log,C=stream$1(),S=statefulStream$1(0),w=null,H=null,b=null;function R(){w&&(w(),w=null),b&&(b(),b=null),H&&(clearTimeout(H),H=null),publish$1(d,!1);}return connect$1(pipe$1(C,withLatestFrom$1(i,f,l,S,p,v,I),map$1(function(e){var t=e[0],n=e[1],o=e[2],r=e[3],i=e[4],l=e[5],s=e[6],f=e[7],h=ke$1(t),p=h.align,v=h.behavior,g=h.offset,I=r-1,S=h.index;"LAST"===S&&(S=I),S=ye$1(S,n);var T=we$1(S=Math.max(0,S,Math.min(I,S)),n.offsetTree)+l;"end"===p?(T=Math.round(T-o+ne$1(n.sizeTree,S)[1]),S===I&&(T+=s)):"center"===p?T=Math.round(T-o/2+ne$1(n.sizeTree,S)[1]/2):T-=i,g&&(T+=g);var z=function(e){R(),e?(f("retrying to scroll to",{location:t},D$1.DEBUG),publish$1(C,t)):f("list did not change, scroll successful",{},D$1.DEBUG);};if(R(),"smooth"===v){var k=!1;b=subscribe$1(a,function(e){k=k||e;}),w=handleNext$1(m,function(){z(k);});}else w=handleNext$1(pipe$1(a,function(e){var t=setTimeout(function(){e(!1);},50);return function(n){n&&(e(!0),clearTimeout(t));}}),z);return H=setTimeout(function(){R();},1200),publish$1(d,!0),f("scrolling from index to",{index:S,top:T,behavior:v},D$1.DEBUG),{top:T,behavior:v}})),h),{scrollToIndex:C,topListHeight:S}},tup$1(Re$1,U$1,j$1),{singleton:!0});function Ee$1(e,t,n){return "number"==typeof e?n===Y$1&&"top"===t||"down"===n&&"bottom"===t?e:0:n===Y$1?"top"===t?e.main:e.reverse:"bottom"===t?e.main:e.reverse}function Le$1(e,t){return "number"==typeof e?e:e[t]||0}var Oe$1=system$1(function(e){var t=e[0],r=t.scrollTop,i=t.viewportHeight,l=t.deviation,c=t.headerHeight,d=stream$1(),f=statefulStream$1(0),m=statefulStream$1(0),p=statefulStream$1(0);return {listBoundary:d,overscan:p,topListHeight:f,increaseViewportBy:m,visibleRange:statefulStreamFromEmitter$1(pipe$1(combineLatest$1(duc$1(r),duc$1(i),duc$1(c),duc$1(d,W$1),duc$1(p),duc$1(f),duc$1(l),duc$1(m)),map$1(function(e){var t=e[0],n=e[1],o=e[2],r=e[3],i=r[0],l=r[1],u=e[4],a=e[5],s=e[6],c=e[7],d=t-s,f=Math.max(o-d,0),h="none",m=Le$1(c,"top"),p=Le$1(c,"bottom");return i-=s,l+=o,(i+=o)>t+a-m&&(h=Y$1),(l-=s)<t-f+n+p&&(h="down"),"none"!==h?[Math.max(d-o-Ee$1(u,"top",h)-m,0),d-f+n+Ee$1(u,"bottom",h)+p]:null}),filter$1(function(e){return null!=e}),distinctUntilChanged$1(W$1)),[0,0])}},tup$1(U$1),{singleton:!0}),Me$1=system$1(function(e){var t=e[0],i=t.scrollTop,l=t.scrollTo,a=stream$1(),s=stream$1(),c=stream$1(),d=statefulStream$1(!1);return connect$1(pipe$1(combineLatest$1(s,a),map$1(function(e){return Math.max(0,e[0]-e[1].offsetTop)})),i),connect$1(pipe$1(l,withLatestFrom$1(a),map$1(function(e){var t=e[0];return P$1({},t,{top:t.top+e[1].offsetTop})})),c),{useWindowScroll:d,windowScrollTop:s,windowViewportRect:a,windowScrollTo:c}},tup$1(U$1)),Pe$1={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},Ae$1={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},Fe$1=Math.ceil,Ge$1=Math.floor,We$1=Math.min,Ve$1=Math.max;function Ne$1(e){return Fe$1(e)-e<.03?Fe$1(e):Ge$1(e)}function De$1(e,t){return Array.from({length:t-e+1}).map(function(t,n){return {index:n+e}})}var Ue$1=system$1(function(e){var t=e[0],i=t.overscan,c=t.visibleRange,d=t.listBoundary,f=e[1],m=f.scrollTop,v=f.viewportHeight,C=f.scrollBy,x=f.scrollTo,S=f.smoothScrollTargetReached,y=e[2],H=e[3],b=e[4],R=b.propsReady,z=b.didMount,k=e[5],B=k.windowViewportRect,E=k.windowScrollTo,L=k.useWindowScroll,O=k.windowScrollTop,M=statefulStream$1(0),A=statefulStream$1(0),F=statefulStream$1(Pe$1),G=statefulStream$1({height:0,width:0}),N=statefulStream$1({height:0,width:0}),D=stream$1(),U=stream$1();connect$1(pipe$1(z,withLatestFrom$1(A),filter$1(function(e){return 0!==e[1]}),map$1(function(e){return {items:De$1(0,e[1]-1),top:0,bottom:0,offsetBottom:0,offsetTop:0,itemHeight:0,itemWidth:0}})),F),connect$1(pipe$1(combineLatest$1(duc$1(M),c,duc$1(N,function(e,t){return e&&e.width===t.width&&e.height===t.height})),withLatestFrom$1(G),map$1(function(e){var t=e[0],n=t[0],o=t[1],r=o[0],i=o[1],l=t[2],u=e[1],a=l.height,s=l.width,c=u.width;if(0===n||0===c)return Pe$1;if(0===s)return Ae$1;var d=Ne$1(c/s),f=d*Ge$1(r/a),h=d*Fe$1(i/a)-1;h=We$1(n-1,h);var m=De$1(f=We$1(h,Ve$1(0,f)),h),p=_e$1(u,l,m),v=p.top,g=p.bottom;return {items:m,offsetTop:v,offsetBottom:Fe$1(n/d)*a-g,top:v,bottom:g,itemHeight:a,itemWidth:s}})),F),connect$1(pipe$1(G,map$1(function(e){return e.height})),v),connect$1(pipe$1(combineLatest$1(G,N,F),map$1(function(e){var t=_e$1(e[0],e[1],e[2].items);return [t.top,t.bottom]}),distinctUntilChanged$1(W$1)),d);var _=streamFromEmitter$1(pipe$1(duc$1(F),filter$1(function(e){return e.items.length>0}),withLatestFrom$1(M),filter$1(function(e){var t=e[0].items;return t[t.length-1].index===e[1]-1}),map$1(function(e){return e[1]-1}),distinctUntilChanged$1())),j=streamFromEmitter$1(pipe$1(duc$1(F),filter$1(function(e){var t=e.items;return t.length>0&&0===t[0].index}),mapTo$1(0),distinctUntilChanged$1())),K=streamFromEmitter$1(pipe$1(duc$1(F),filter$1(function(e){return e.items.length>0}),map$1(function(e){var t=e.items;return {startIndex:t[0].index,endIndex:t[t.length-1].index}}),distinctUntilChanged$1(V$1)));connect$1(K,H.scrollSeekRangeChanged),connect$1(pipe$1(D,withLatestFrom$1(G,N,M),map$1(function(e){var t=e[1],n=e[2],o=e[3],r=ke$1(e[0]),i=r.align,l=r.behavior,u=r.offset,a=r.index;"LAST"===a&&(a=o-1);var s=je$1(t,n,a=Math.max(0,a,Math.min(o-1,a)));return "end"===i?s=Math.round(s-t.height+n.height):"center"===i&&(s=Math.round(s-t.height/2+n.height/2)),u&&(s+=u),{top:s,behavior:l}})),x);var Y=statefulStreamFromEmitter$1(pipe$1(F,map$1(function(e){return e.offsetBottom+e.bottom})),0);return connect$1(pipe$1(B,map$1(function(e){return {width:e.visibleWidth,height:e.visibleHeight}})),G),P$1({totalCount:M,viewportDimensions:G,itemDimensions:N,scrollTop:m,scrollHeight:U,overscan:i,scrollBy:C,scrollTo:x,scrollToIndex:D,smoothScrollTargetReached:S,windowViewportRect:B,windowScrollTo:E,useWindowScroll:L,windowScrollTop:O,initialItemCount:A},H,{gridState:F,totalListHeight:Y},y,{startReached:j,endReached:_,rangeChanged:K,propsReady:R})},tup$1(Oe$1,U$1,q$1,$$1,K$1,Me$1));function _e$1(e,t,n){var o=t.height;return void 0===o||0===n.length?{top:0,bottom:0}:{top:je$1(e,t,n[0].index),bottom:je$1(e,t,n[n.length-1].index)+o}}function je$1(e,t,n){var o=Ne$1(e.width/t.width);return Ge$1(n/o)*t.height}function Ke$1(e,t){void 0===t&&(t=!0);var n=React.useRef(null),o=function(e){};if("undefined"!=typeof ResizeObserver){var r=new ResizeObserver(function(t){var n=t[0].target;null!==n.offsetParent&&e(n);});o=function(e){e&&t?(r.observe(e),n.current=e):(n.current&&r.unobserve(n.current),n.current=null);};}return {ref:n,callbackRef:o}}function Ye$1(e,t){return void 0===t&&(t=!0),Ke$1(e,t).callbackRef}function Ze$1(e){var t=React.useRef(null),n=React.useCallback(function(n){if(null!==n){var o=n.getBoundingClientRect(),r=window.innerHeight-Math.max(0,o.top),i=o.top+window.pageYOffset;t.current={offsetTop:i,visibleHeight:r,visibleWidth:o.width},e(t.current);}},[e]),o=Ke$1(n),r=o.callbackRef,i=o.ref,l=React.useCallback(function(){n(i.current);},[n,i]);return React.useEffect(function(){return window.addEventListener("scroll",l),window.addEventListener("resize",l),function(){window.removeEventListener("scroll",l),window.removeEventListener("resize",l);}},[l]),r}var qe$1="undefined"!=typeof document?React.useLayoutEffect:React.useEffect;function $e$1(e,t,n,o,r){void 0===o&&(o=noop$1),void 0===r&&(r=noop$1);var i=React.useRef(null),l=React.useRef(null),u=React.useRef(null),a=React.useCallback(function(n){var o=n.target,i=o===window||o===document?window.pageYOffset||document.documentElement.scrollTop:o.scrollTop,a=o===window?document.documentElement.scrollHeight:o.scrollHeight;r(a),e(Math.max(i,0)),null!==l.current&&(i===l.current||i<=0||i===o.scrollHeight-ge$1(o,"height"))&&(l.current=null,t(!0),u.current&&(clearTimeout(u.current),u.current=null));},[e,t,r]);return React.useEffect(function(){var e=i.current;return o(i.current),a({target:e}),e.addEventListener("scroll",a,{passive:!0}),function(){o(null),e.removeEventListener("scroll",a);}},[i,a,n,o]),{scrollerRef:i,scrollByCallback:function(e){null===l.current&&i.current.scrollBy(e);},scrollToCallback:function(n){var o=i.current;if(o&&(!("offsetHeight"in o)||0!==o.offsetHeight)){var r,a,s,c="smooth"===n.behavior;if(o===window?(a=Math.max(ge$1(document.documentElement,"height"),document.documentElement.scrollHeight),r=window.innerHeight,s=document.documentElement.scrollTop):(a=o.scrollHeight,r=ge$1(o,"height"),s=o.scrollTop),n.top=Math.max(Math.min(a-r,n.top),0),Math.abs(r-a)<1.01||n.top===s)return e(s),void(c&&t(!0));c?(l.current=n.top,u.current&&clearTimeout(u.current),u.current=setTimeout(function(){u.current=null,l.current=null,t(!0);},1e3)):l.current=null,o.scrollTo(n);}}}}var Je$1=system$1(function(e){var t=e[0],n=t.sizes,i=t.listRefresh,l=t.defaultItemSize,s=e[1].scrollTop,d=e[2].scrollToIndex,f=e[3].didMount,h=statefulStream$1(!0),m=statefulStream$1(0);return connect$1(pipe$1(f,withLatestFrom$1(m),filter$1(function(e){return 0!==e[1]}),mapTo$1(!1)),h),subscribe$1(pipe$1(combineLatest$1(i,f),withLatestFrom$1(h,n,l),filter$1(function(e){var t=e[1],n=e[3];return e[0][1]&&(!X$1(e[2].sizeTree)||void 0!==n)&&!t}),withLatestFrom$1(m)),function(e){var t=e[1];setTimeout(function(){handleNext$1(s,function(){publish$1(h,!0);}),publish$1(d,t);});}),{scrolledToInitialItem:h,initialTopMostItemIndex:m}},tup$1(Re$1,U$1,Be$1,K$1),{singleton:!0});function Qe$1(e){return !!e&&("smooth"===e?"smooth":"auto")}var Xe$1=system$1(function(e){var t=e[0],n=t.totalCount,r=t.listRefresh,l=e[1],s=l.isAtBottom,d=l.atBottomState,f=e[2].scrollToIndex,p=e[3].scrolledToInitialItem,v=e[4],S=v.propsReady,w=v.didMount,H=e[5].log,b=e[6].scrollingInProgress,R=statefulStream$1(!1),z=null;function k(e){publish$1(f,{index:"LAST",align:"end",behavior:e});}return subscribe$1(pipe$1(combineLatest$1(pipe$1(duc$1(n),skip$1(1)),w),withLatestFrom$1(duc$1(R),s,p,b),map$1(function(e){var t=e[0],n=t[0],o=t[1]&&e[3],r="auto";return o&&(r=function(e,t){return "function"==typeof e?Qe$1(e(t)):t&&Qe$1(e)}(e[1],e[2]||e[4]),o=o&&!!r),{totalCount:n,shouldFollow:o,followOutputBehavior:r}}),filter$1(function(e){return e.shouldFollow})),function(e){var t=e.totalCount,n=e.followOutputBehavior;z&&(z(),z=null),z=handleNext$1(r,function(){getValue$1(H)("following output to ",{totalCount:t},D$1.DEBUG),k(n),z=null;});}),subscribe$1(pipe$1(combineLatest$1(duc$1(R),n,S),filter$1(function(e){return e[0]&&e[2]}),scan$1(function(e,t){var n=t[1];return {refreshed:e.value===n,value:n}},{refreshed:!1,value:0}),filter$1(function(e){return e.refreshed}),withLatestFrom$1(R,n)),function(e){var t=e[1],n=handleNext$1(d,function(e){!t||e.atBottom||"SIZE_INCREASED"!==e.notAtBottomBecause||z||(getValue$1(H)("scrolling to bottom due to increased size",D$1.DEBUG),k("auto"));});setTimeout(n,100);}),subscribe$1(combineLatest$1(duc$1(R),d),function(e){var t=e[1];e[0]&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&k("auto");}),{followOutput:R}},tup$1(Re$1,q$1,Be$1,Je$1,K$1,j$1,U$1));function et$1(e){return e.reduce(function(e,t){return e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e},{totalCount:0,groupIndices:[]})}var tt$1=system$1(function(e){var t=e[0],o=t.totalCount,i=t.groupIndices,c=t.sizes,d=e[1],f=d.scrollTop,h=d.headerHeight,m=stream$1(),p=stream$1(),v=streamFromEmitter$1(pipe$1(m,map$1(et$1)));return connect$1(pipe$1(v,map$1(prop$1("totalCount"))),o),connect$1(pipe$1(v,map$1(prop$1("groupIndices"))),i),connect$1(pipe$1(combineLatest$1(f,c,h),filter$1(function(e){return He$1(e[1])}),map$1(function(e){return ne$1(e[1].groupOffsetTree,Math.max(e[0]-e[2],0),"v")[0]}),distinctUntilChanged$1(),map$1(function(e){return [e]})),p),{groupCounts:m,topItemsIndexes:p}},tup$1(Re$1,U$1)),nt$1={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0};function ot$1(e,t,n){if(0===e.length)return [];if(!He$1(t))return e.map(function(e){return P$1({},e,{index:e.index+n,originalIndex:e.index})});for(var o,r=[],i=de$1(t.groupOffsetTree,e[0].index,e[e.length-1].index),l=void 0,u=0,a=G$1(e);!(o=a()).done;){var s=o.value;(!l||l.end<s.index)&&(l=i.shift(),u=t.groupIndices.indexOf(l.start)),r.push(P$1({},s.index===l.start?{type:"group",index:u}:{index:s.index-(u+1)+n,groupIndex:u},{size:s.size,offset:s.offset,originalIndex:s.index,data:s.data}));}return r}function rt$1(e,t,n,o,r){var i=0,l=0;if(e.length>0){i=e[0].offset;var u=e[e.length-1];l=u.offset+u.size;}var a=i,s=o.lastOffset+(n-o.lastIndex)*o.lastSize-l;return {items:ot$1(e,o,r),topItems:ot$1(t,o,r),topListHeight:t.reduce(function(e,t){return t.size+e},0),offsetTop:i,offsetBottom:s,top:a,bottom:l,totalCount:n}}var it$1,lt$1,ut$1,at$1=system$1(function(e){var t=e[0],i=t.sizes,c=t.totalCount,d=t.data,f=t.firstItemIndex,m=e[1],p=e[2],v=p.visibleRange,C=p.listBoundary,x=p.topListHeight,y=e[3],H=y.scrolledToInitialItem,z=y.initialTopMostItemIndex,k=e[4].topListHeight,B=e[5],E=e[6].didMount,L=statefulStream$1([]),O=stream$1();connect$1(m.topItemsIndexes,L);var M=statefulStreamFromEmitter$1(pipe$1(combineLatest$1(E,duc$1(v),duc$1(c),duc$1(i),duc$1(z),H,duc$1(L),duc$1(f),d),filter$1(function(e){return e[0]}),map$1(function(e){var t=e[1],n=t[0],o=t[1],r=e[2],i=e[4],l=e[5],u=e[6],a=e[7],s=e[8],c=e[3],d=c.sizeTree,f=c.offsetTree;if(0===r||0===n&&0===o)return nt$1;if(X$1(d))return rt$1(function(e,t,n){if(He$1(t)){var o=ye$1(e,t);return [{index:ne$1(t.groupOffsetTree,o)[0],size:0,offset:0},{index:o,size:0,offset:0,data:n&&n[0]}]}return [{index:e,size:0,offset:0,data:n&&n[0]}]}(i,c,s),[],r,c,a);var h=[];if(u.length>0)for(var m,p=u[0],v=u[u.length-1],g=0,I=G$1(de$1(d,p,v));!(m=I()).done;)for(var C=m.value,x=C.value,S=Math.max(C.start,p),T=Math.min(C.end,v),w=S;w<=T;w++)h.push({index:w,size:x,offset:g,data:s&&s[w]}),g+=x;if(!l)return rt$1([],h,r,c,a);var y=u.length>0?u[u.length-1]+1:0,H=function(e,t,n,o){return void 0===o&&(o=0),o>0&&(t=Math.max(t,ve$1(e,o,Ce$1).offset)),fe$1((i=n,u=pe$1(r=e,t,l=xe$1),a=pe$1(r,i,l,u),r.slice(u,a+1)),Se$1);var r,i,l,u,a;}(f,n,o,y);if(0===H.length)return null;var b=r-1;return rt$1(tap$1([],function(e){for(var t,r=G$1(H);!(t=r()).done;){var i=t.value,l=i.value,u=l.offset,a=i.start,c=l.size;l.offset<n&&(u+=((a+=Math.floor((n-l.offset)/c))-i.start)*c),a<y&&(u+=(y-a)*c,a=y);for(var d=Math.min(i.end,b),f=a;f<=d&&!(u>=o);f++)e.push({index:f,size:c,offset:u,data:s&&s[f]}),u+=c;}}),h,r,c,a)}),filter$1(function(e){return null!==e}),distinctUntilChanged$1()),nt$1);return connect$1(pipe$1(d,filter$1(function(e){return void 0!==e}),map$1(function(e){return e.length})),c),connect$1(pipe$1(M,map$1(prop$1("topListHeight"))),k),connect$1(k,x),connect$1(pipe$1(M,map$1(function(e){return [e.top,e.bottom]})),C),connect$1(pipe$1(M,map$1(function(e){return e.items})),O),P$1({listState:M,topItemsIndexes:L,endReached:streamFromEmitter$1(pipe$1(M,filter$1(function(e){return e.items.length>0}),withLatestFrom$1(c,d),filter$1(function(e){var t=e[0].items;return t[t.length-1].originalIndex===e[1]-1}),map$1(function(e){return [e[1]-1,e[2]]}),distinctUntilChanged$1(W$1),map$1(function(e){return e[0]}))),startReached:streamFromEmitter$1(pipe$1(M,throttleTime$1(200),filter$1(function(e){var t=e.items;return t.length>0&&t[0].originalIndex===e.topItems.length}),map$1(function(e){return e.items[0].index}),distinctUntilChanged$1())),rangeChanged:streamFromEmitter$1(pipe$1(M,filter$1(function(e){return e.items.length>0}),map$1(function(e){var t=e.items;return {startIndex:t[0].index,endIndex:t[t.length-1].index}}),distinctUntilChanged$1(V$1))),itemsRendered:O},B)},tup$1(Re$1,tt$1,Oe$1,Je$1,Be$1,q$1,K$1),{singleton:!0}),st$1=system$1(function(e){var t=e[0],n=t.sizes,i=t.firstItemIndex,l=t.data,s=e[1].listState,c=e[2].didMount,d=statefulStream$1(0);return connect$1(pipe$1(c,withLatestFrom$1(d),filter$1(function(e){return 0!==e[1]}),withLatestFrom$1(n,i,l),map$1(function(e){var t=e[0][1],n=e[1],o=e[2],r=e[3],i=void 0===r?[]:r,l=0;if(n.groupIndices.length>0)for(var u,a=G$1(n.groupIndices);!((u=a()).done||u.value-l>=t);)l++;var s=t+l;return rt$1(Array.from({length:s}).map(function(e,t){return {index:t,size:0,offset:0,data:i[t]}}),[],s,n,o)})),s),{initialItemCount:d}},tup$1(Re$1,at$1,K$1),{singleton:!0}),ct$1=system$1(function(e){var t=e[0].topItemsIndexes,n=statefulStream$1(0);return connect$1(pipe$1(n,filter$1(function(e){return e>0}),map$1(function(e){return Array.from({length:e}).map(function(e,t){return t})})),t),{topItemCount:n}},tup$1(at$1)),dt$1=system$1(function(e){var t=e[0],o=t.footerHeight,i=t.headerHeight,l=e[1].listState,a=stream$1(),s=statefulStreamFromEmitter$1(pipe$1(combineLatest$1(o,i,l),map$1(function(e){var t=e[2];return e[0]+e[1]+t.offsetBottom+t.bottom})),0);return connect$1(duc$1(s),a),{totalListHeight:s,totalListHeightChanged:a}},tup$1(U$1,at$1),{singleton:!0}),ft$1=system$1(function(e){var t=e[0],n=t.scrollBy,o=t.scrollTop,i=t.deviation,s=t.scrollingInProgress,d=e[1],f=d.isScrolling,h=d.isAtBottom,m=d.scrollDirection,p=e[3],v=p.beforeUnshiftWith,y=p.sizes,H=e[4].log,b=streamFromEmitter$1(pipe$1(e[2].listState,scan$1(function(e,t){var n=e[1],o=t.items,r=0;if(n.length>0&&o.length>0){var i=o[0].originalIndex,l=n[0].originalIndex;if(0!==i||0!==l)if(i===l)r=o[0].size-n[0].size;else for(var u=function(e){var t=o[e],i=n.find(function(e){return e.originalIndex===t.originalIndex});return i?t.offset!==i.offset?(r=t.offset-i.offset,"break"):void 0:"continue"},a=o.length-1;a>=0;a--){var s=u(a);if("continue"!==s&&"break"===s)break}}return [r,o]},[0,[]]),filter$1(function(e){return 0!==e[0]}),withLatestFrom$1(o,m,s,H,h),filter$1(function(e){return !e[3]&&0!==e[1]&&e[2]===Y$1&&(!e[5]||e[0][0]>0)}),map$1(function(e){var t=e[0][0];return (0, e[4])("Upward scrolling compensation",{amount:t},D$1.DEBUG),t})));return connect$1(pipe$1(b,withLatestFrom$1(i),map$1(function(e){return e[1]-e[0]})),i),subscribe$1(pipe$1(combineLatest$1(statefulStreamFromEmitter$1(f,!1),i),filter$1(function(e){return !e[0]&&0!==e[1]}),map$1(function(e){return e[1]}),throttleTime$1(1)),function(e){e>0?(publish$1(n,{top:-e,behavior:"auto"}),publish$1(i,0)):(publish$1(i,0),publish$1(n,{top:-e,behavior:"auto"}));}),connect$1(pipe$1(v,withLatestFrom$1(y),map$1(function(e){return e[0]*e[1].lastSize})),b),{deviation:i}},tup$1(U$1,q$1,at$1,Re$1,j$1)),ht$1=system$1(function(e){var t=e[0].totalListHeight,n=e[1].didMount,r=e[2].scrollTo,i=statefulStream$1(0);return subscribe$1(pipe$1(n,withLatestFrom$1(i),filter$1(function(e){return 0!==e[1]}),map$1(function(e){return {top:e[1]}})),function(e){handleNext$1(pipe$1(t,filter$1(function(e){return 0!==e})),function(){setTimeout(function(){publish$1(r,e);});});}),{initialScrollTop:i}},tup$1(dt$1,K$1,U$1),{singleton:!0}),mt$1=system$1(function(e){var t=e[0].viewportHeight,n=e[1].totalListHeight,r=statefulStream$1(!1);return {alignToBottom:r,paddingTopAddition:statefulStreamFromEmitter$1(pipe$1(combineLatest$1(r,t,n),filter$1(function(e){return e[0]}),map$1(function(e){return Math.max(0,e[1]-e[2])}),distinctUntilChanged$1()),0)}},tup$1(U$1,dt$1),{singleton:!0}),pt$1=system$1(function(e){var t=e[0],o=t.sizes,i=t.totalCount,l=e[1],s=l.scrollTop,c=l.viewportHeight,d=l.headerHeight,f=l.scrollingInProgress,h=e[2].scrollToIndex,p=stream$1();return connect$1(pipe$1(p,withLatestFrom$1(o,c,i,d,s),map$1(function(e){var t=e[0],n=t.index,o=t.behavior,r=void 0===o?"auto":o,i=t.done,l=e[1],s=e[2],c=e[4],d=e[5],h=e[3]-1,p=null;n=ye$1(n,l);var v=we$1(n=Math.max(0,n,Math.min(h,n)),l.offsetTree)+c;return v<d?p={index:n,behavior:r,align:"start"}:v+ne$1(l.sizeTree,n)[1]>d+s&&(p={index:n,behavior:r,align:"end"}),p?i&&handleNext$1(pipe$1(f,skip$1(1),filter$1(function(e){return !1===e})),i):i&&i(),p}),filter$1(function(e){return null!==e})),h),{scrollIntoView:p}},tup$1(Re$1,U$1,Be$1,at$1,j$1),{singleton:!0}),vt$1=system$1(function(e){return P$1({},e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},tup$1(Oe$1,st$1,K$1,$$1,dt$1,ht$1,mt$1,Me$1,pt$1)),gt$1=system$1(function(e){var t=e[0],n=t.totalCount,o=t.sizeRanges,i=t.fixedItemSize,l=t.defaultItemSize,a=t.trackItemSizes,s=t.itemSize,c=t.data,d=t.firstItemIndex,f=t.groupIndices,h=e[1],m=h.initialTopMostItemIndex,p=h.scrolledToInitialItem,v=e[2],I=e[3],C=e[4],x=C.listState,S=C.topItemsIndexes,T=A$1(C,["listState","topItemsIndexes"]),w=e[5].scrollToIndex,y=e[7].topItemCount,H=e[8].groupCounts,R=e[9],z=e[10];return connect$1(T.rangeChanged,R.scrollSeekRangeChanged),connect$1(pipe$1(R.windowViewportRect,map$1(prop$1("visibleHeight"))),v.viewportHeight),P$1({totalCount:n,data:c,firstItemIndex:d,sizeRanges:o,initialTopMostItemIndex:m,scrolledToInitialItem:p,topItemsIndexes:S,topItemCount:y,groupCounts:H,fixedItemHeight:i,defaultItemHeight:l},I,{listState:x,scrollToIndex:w,trackItemSizes:a,itemSize:s,groupIndices:f},T,R,v,z)},tup$1(Re$1,Je$1,U$1,Xe$1,at$1,Be$1,ft$1,ct$1,tt$1,vt$1,j$1)),It$1=(it$1=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"},ut$1=!1,function(){return ut$1||(ut$1=!0,lt$1=it$1()),lt$1});function Ct$1(e){return e}var xt$1=system$1(function(){var e=statefulStream$1(function(e){return "Item "+e}),t=statefulStream$1(function(e){return "Group "+e}),n=statefulStream$1({}),r=statefulStream$1(Ct$1),i=statefulStream$1("div"),l=statefulStream$1(noop$1),a=function(e,t){return void 0===t&&(t=null),statefulStreamFromEmitter$1(pipe$1(n,map$1(function(t){return t[e]}),distinctUntilChanged$1()),t)};return {itemContent:e,groupContent:t,components:n,computeItemKey:r,headerFooterTag:i,scrollerRef:l,FooterComponent:a("Footer"),HeaderComponent:a("Header"),TopItemListComponent:a("TopItemList"),ListComponent:a("List","div"),ItemComponent:a("Item","div"),GroupComponent:a("Group","div"),ScrollerComponent:a("Scroller","div"),EmptyPlaceholder:a("EmptyPlaceholder"),ScrollSeekPlaceholder:a("ScrollSeekPlaceholder")}});function St$1(e,t){var o=stream$1();return subscribe$1(o,function(){return console.warn("react-virtuoso: You are using a deprecated property. "+t,"color: red;","color: inherit;","color: blue;")}),connect$1(o,e),o}var Tt$1=system$1(function(e){var t=e[0],o=e[1],l={item:St$1(o.itemContent,"Rename the %citem%c prop to %citemContent."),group:St$1(o.groupContent,"Rename the %cgroup%c prop to %cgroupContent."),topItems:St$1(t.topItemCount,"Rename the %ctopItems%c prop to %ctopItemCount."),itemHeight:St$1(t.fixedItemHeight,"Rename the %citemHeight%c prop to %cfixedItemHeight."),scrollingStateChange:St$1(t.isScrolling,"Rename the %cscrollingStateChange%c prop to %cisScrolling."),adjustForPrependedItems:stream$1(),maxHeightCacheSize:stream$1(),footer:stream$1(),header:stream$1(),HeaderContainer:stream$1(),FooterContainer:stream$1(),ItemContainer:stream$1(),ScrollContainer:stream$1(),GroupContainer:stream$1(),ListContainer:stream$1(),emptyComponent:stream$1(),scrollSeek:stream$1()};function a(e,t,n){connect$1(pipe$1(e,withLatestFrom$1(o.components),map$1(function(e){var o,r=e[0],i=e[1];return console.warn("react-virtuoso: "+n+" property is deprecated. Pass components."+t+" instead."),P$1({},i,((o={})[t]=r,o))})),o.components);}return subscribe$1(l.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;");}),subscribe$1(l.maxHeightCacheSize,function(){console.warn("react-virtuoso: maxHeightCacheSize is no longer necessary. Setting it has no effect - remove it from your code.");}),subscribe$1(l.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.");}),subscribe$1(l.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.");}),subscribe$1(l.scrollSeek,function(e){var n=e.placeholder,r=A$1(e,["placeholder"]);console.warn("react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead."),publish$1(o.components,P$1({},getValue$1(o.components),{ScrollSeekPlaceholder:n})),publish$1(t.scrollSeekConfiguration,r);}),a(l.footer,"Footer","footer"),a(l.header,"Header","header"),a(l.ItemContainer,"Item","ItemContainer"),a(l.ListContainer,"List","ListContainer"),a(l.ScrollContainer,"Scroller","ScrollContainer"),a(l.emptyComponent,"EmptyPlaceholder","emptyComponent"),a(l.GroupContainer,"Group","GroupContainer"),P$1({},t,o,l)},tup$1(gt$1,xt$1)),wt$1=function(e){return React.createElement("div",{style:{height:e.height}})},yt$1={position:It$1(),zIndex:1},Ht$1=React.memo(function(e){var t=e.showTopList,n=void 0!==t&&t,o=Wt$1("listState"),r=Wt$1("deviation"),i=Gt$1("sizeRanges"),l=Gt$1("scrollHeight"),u=Wt$1("itemContent"),a=Wt$1("groupContent"),s=Wt$1("trackItemSizes"),c=Wt$1("itemSize"),d=Wt$1("log"),f=function(e,t,n,o,r){return Ye$1(function(n){var i=function(e,t,n,o){var r=e.length;if(0===r)return null;for(var i=[],l=0;l<r;l++){var u=e.item(l);if(u&&void 0!==u.dataset.index){var a=parseInt(u.dataset.index),s=parseFloat(u.dataset.knownSize),c=t(u,"offsetHeight");if(0===c&&o("Zero-sized element, this should not happen",{child:u},D$1.ERROR),c!==s){var d=i[i.length-1];0===i.length||d.size!==c||d.endIndex!==a-1?i.push({startIndex:a,endIndex:a,size:c}):i[i.length-1].endIndex++;}}}return i}(n.children,t,0,r);o(n.parentElement.parentElement.scrollHeight),null!==i&&e(i);},n)}(i,c,s,n?noop$1:l,d),h=Wt$1("EmptyPlaceholder"),m=Wt$1("ScrollSeekPlaceholder")||wt$1,p=Wt$1("ListComponent"),v=Wt$1("ItemComponent"),g=Wt$1("GroupComponent"),I=Wt$1("computeItemKey"),C=Wt$1("isSeeking"),x=Wt$1("groupIndices").length>0,S=Wt$1("paddingTopAddition"),T=Wt$1("scrolledToInitialItem"),w=Wt$1("firstItemIndex"),y=n?{}:{boxSizing:"border-box",paddingTop:o.offsetTop+S,paddingBottom:o.offsetBottom,marginTop:r};return !n&&0===o.items.length&&h&&T?React.createElement(h):React.createElement(p,{ref:f,style:y,"data-test-id":n?"virtuoso-top-item-list":"virtuoso-item-list"},(n?o.topItems:o.items).map(function(e){var t=e.originalIndex,n=I(t+w,e.data);return C?React.createElement(m,{key:n,index:e.index,height:e.size}):"group"===e.type?React.createElement(g,{key:n,"data-index":t,"data-known-size":e.size,"data-item-index":e.index,style:yt$1},a(e.index)):React.createElement(v,{key:n,"data-index":t,"data-known-size":e.size,"data-item-index":e.index,"data-item-group-index":e.groupIndex,style:{overflowAnchor:"none"}},x?u(e.index,e.groupIndex,e.data):u(e.index,e.data))}))}),bt$1={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},Rt$1={width:"100%",height:"100%",position:"absolute",top:0},zt$1={width:"100%",position:It$1(),top:0},kt$1=React.memo(function(){var e=Wt$1("HeaderComponent"),t=Gt$1("headerHeight"),n=Wt$1("headerFooterTag"),o=Ye$1(function(e){return t(ge$1(e,"height"))});return e?React.createElement(n,{ref:o},React.createElement(e)):null}),Bt$1=React.memo(function(){var e=Wt$1("FooterComponent"),t=Gt$1("footerHeight"),n=Wt$1("headerFooterTag"),o=Ye$1(function(e){return t(ge$1(e,"height"))});return e?React.createElement(n,{ref:o},React.createElement(e)):null});function Et$1(e){var t=e.usePublisher,n=e.useEmitter,o=e.useEmitterValue;return React.memo(function(e){var r=e.style,i=e.children,l=A$1(e,["style","children"]),u=t("scrollTop"),a=t("scrollHeight"),s=o("ScrollerComponent"),c=$e$1(u,t("smoothScrollTargetReached"),s,o("scrollerRef"),a),d=c.scrollerRef,f=c.scrollByCallback;return n("scrollTo",c.scrollToCallback),n("scrollBy",f),React.createElement(s,P$1({ref:d,style:P$1({},bt$1,r),tabIndex:0},l),i)})}function Lt$1(e){var t=e.usePublisher,n=e.useEmitter,o=e.useEmitterValue;return React.memo(function(e){var r=e.style,i=e.children,l=A$1(e,["style","children"]),u=t("windowScrollTop"),a=t("scrollHeight"),s=o("ScrollerComponent"),c=t("smoothScrollTargetReached"),d=o("totalListHeight"),f=$e$1(u,c,s,noop$1,a),h=f.scrollerRef,m=f.scrollByCallback,p=f.scrollToCallback;return qe$1(function(){return h.current=window,function(){h.current=null;}},[h]),n("windowScrollTo",p),n("scrollBy",m),React.createElement(s,P$1({style:P$1({position:"relative"},r,0!==d?{height:d}:{})},l),i)})}var Ot$1=function(e){var t=e.children,n=Gt$1("viewportHeight"),o=Ye$1(compose$1(n,function(e){return ge$1(e,"height")}));return React.createElement("div",{style:Rt$1,ref:o},t)},Mt$1=function(e){var t=e.children,n=Ze$1(Gt$1("windowViewportRect"));return React.createElement("div",{ref:n,style:Rt$1},t)},Pt$1=function(e){var t=e.children,n=Wt$1("TopItemListComponent"),o=Wt$1("headerHeight"),r=P$1({},zt$1,{marginTop:o+"px"});return React.createElement(n||"div",{style:r},t)},At$1=systemToComponent$1(Tt$1,{required:{},optional:{followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",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"}},React.memo(function(e){var t=Wt$1("useWindowScroll"),n=Wt$1("topItemsIndexes").length>0,o=t?Mt$1:Ot$1;return React.createElement(t?Dt$1:Nt$1,P$1({},e),React.createElement(o,null,React.createElement(kt$1,null),React.createElement(Ht$1,null),React.createElement(Bt$1,null)),n&&React.createElement(Pt$1,null,React.createElement(Ht$1,{showTopList:!0})))})),Ft$1=At$1.Component,Gt$1=At$1.usePublisher,Wt$1=At$1.useEmitterValue,Vt$1=At$1.useEmitter,Nt$1=Et$1({usePublisher:Gt$1,useEmitterValue:Wt$1,useEmitter:Vt$1}),Dt$1=Lt$1({usePublisher:Gt$1,useEmitterValue:Wt$1,useEmitter:Vt$1}),Ut$1=system$1(function(){var e=statefulStream$1(function(e){return "Item "+e}),t=statefulStream$1({}),n=statefulStream$1("virtuoso-grid-item"),r=statefulStream$1("virtuoso-grid-list"),i=statefulStream$1(Ct$1),l=statefulStream$1(noop$1),a=function(e,n){return void 0===n&&(n=null),statefulStreamFromEmitter$1(pipe$1(t,map$1(function(t){return t[e]}),distinctUntilChanged$1()),n)};return {itemContent:e,components:t,computeItemKey:i,itemClassName:n,listClassName:r,scrollerRef:l,ListComponent:a("List","div"),ItemComponent:a("Item","div"),ScrollerComponent:a("Scroller","div"),ScrollSeekPlaceholder:a("ScrollSeekPlaceholder","div")}}),_t$1=system$1(function(e){var t=e[0],o=e[1],l={item:St$1(o.itemContent,"Rename the %citem%c prop to %citemContent."),ItemContainer:stream$1(),ScrollContainer:stream$1(),ListContainer:stream$1(),emptyComponent:stream$1(),scrollSeek:stream$1()};function a(e,t,n){connect$1(pipe$1(e,withLatestFrom$1(o.components),map$1(function(e){var o,r=e[0],i=e[1];return console.warn("react-virtuoso: "+n+" property is deprecated. Pass components."+t+" instead."),P$1({},i,((o={})[t]=r,o))})),o.components);}return subscribe$1(l.scrollSeek,function(e){var n=e.placeholder,r=A$1(e,["placeholder"]);console.warn("react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead."),publish$1(o.components,P$1({},getValue$1(o.components),{ScrollSeekPlaceholder:n})),publish$1(t.scrollSeekConfiguration,r);}),a(l.ItemContainer,"Item","ItemContainer"),a(l.ListContainer,"List","ListContainer"),a(l.ScrollContainer,"Scroller","ScrollContainer"),P$1({},t,o,l)},tup$1(Ue$1,Ut$1)),jt$1=React.memo(function(){var e=Jt$1("gridState"),t=Jt$1("listClassName"),n=Jt$1("itemClassName"),o=Jt$1("itemContent"),r=Jt$1("computeItemKey"),i=Jt$1("isSeeking"),l=$t$1("scrollHeight"),u=Jt$1("ItemComponent"),a=Jt$1("ListComponent"),s=Jt$1("ScrollSeekPlaceholder"),c=$t$1("itemDimensions"),d=Ye$1(function(e){l(e.parentElement.parentElement.scrollHeight);var t=e.firstChild;t&&c(t.getBoundingClientRect());});return React.createElement(a,{ref:d,className:t,style:{paddingTop:e.offsetTop,paddingBottom:e.offsetBottom}},e.items.map(function(t){var l=r(t.index);return i?React.createElement(s,{key:l,index:t.index,height:e.itemHeight,width:e.itemWidth}):React.createElement(u,{className:n,"data-index":t.index,key:l},o(t.index))}))}),Kt$1=function(e){var t=e.children,n=$t$1("viewportDimensions"),o=Ye$1(function(e){n(e.getBoundingClientRect());});return React.createElement("div",{style:Rt$1,ref:o},t)},Yt$1=function(e){var t=e.children,n=Ze$1($t$1("windowViewportRect"));return React.createElement("div",{ref:n,style:Rt$1},t)},Zt$1=systemToComponent$1(_t$1,{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"}},React.memo(function(e){var t=P$1({},e),n=Jt$1("useWindowScroll"),o=n?Yt$1:Kt$1;return React.createElement(n?en$1:Xt$1,P$1({},t),React.createElement(o,null,React.createElement(jt$1,null)))})),$t$1=Zt$1.usePublisher,Jt$1=Zt$1.useEmitterValue,Qt$1=Zt$1.useEmitter,Xt$1=Et$1({usePublisher:$t$1,useEmitterValue:Jt$1,useEmitter:Qt$1}),en$1=Lt$1({usePublisher:$t$1,useEmitterValue:Jt$1,useEmitter:Qt$1}),tn$1=Ft$1;
61411
61334
 
61412
61335
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var useGiphyPreview = function (separateGiphyPreview) {
61413
61336
  var _a = React.useState(), giphyPreviewMessage = _a[0], setGiphyPreviewMessage = _a[1];