UNPKG

@cloudquery/plugin-config-ui-lib

Version:

Plugin configuration UI library for CloudQuery Cloud App

1 lines 307 kB
"use strict";var e=require("react/jsx-runtime"),t=require("@mui/material/Button"),n=require("@mui/material/Stack"),r=require("react"),o=require("@mui/icons-material/Close"),i=require("@mui/icons-material/ExpandMore"),s=require("@mui/material"),a=require("@mui/material/Accordion"),l=require("@mui/material/AccordionSummary"),u=require("@mui/material/Alert"),c=require("@mui/material/AlertTitle"),d=require("@mui/material/Card"),h=require("@mui/material/CardContent"),p=require("@mui/material/LinearProgress"),g=require("@mui/material/Typography"),f=require("@mui/material/styles"),m=require("@mui/icons-material/Download"),v=require("@mui/material/Box"),y=require("@mui/material/MenuItem"),b=require("react-dom"),x=require("@mui/material/Backdrop"),S=require("@mui/material/CircularProgress"),w=require("@mui/material/IconButton"),C=require("@mui/material/Modal"),T=require("@mui/icons-material/Link"),k=require("@mui/material/Divider"),I=require("@mui/material/Link"),E=require("@mui/icons-material/ContentCopy"),_=require("@mui/icons-material/ContentCopyRounded"),A=require("yup"),j=require("@mui/icons-material/ChevronRight"),O=require("@mui/material/Step"),P=require("@mui/material/StepLabel"),R=require("@mui/material/Stepper"),D=require("@mui/material/Checkbox"),L=require("@mui/material/Tab"),M=require("@mui/material/Tabs"),F=require("@mui/material/ToggleButton"),$=require("@mui/material/Tooltip"),B=require("@mui/material/CardHeader"),N=require("@mui/material/List"),H=require("@mui/material/ListItem"),z=require("@mui/material/FilledInput"),V=require("@mui/material/FormLabel"),U=require("@mui/material/InputLabel"),W=require("@mui/material/OutlinedInput"),q=require("@mui/material/PaginationItem"),G=require("@mui/material/TableCell"),K=require("@mui/material/TableRow");require("@mui/lab/themeAugmentation");var Y=require("@mui/material/colors"),Q=require("@emotion/cache"),J=require("@emotion/react"),Z=require("@mui/material/CssBaseline"),X=require("@mui/material/FormHelperText"),ee=require("@mui/material/TextField"),te=require("@mui/material/Skeleton"),ne=require("@mui/material/AccordionDetails"),re=require("@mui/icons-material/Check"),oe=require("@mui/material/FormControl"),ie=require("@mui/material/FormControlLabel"),se=require("@mui/material/Switch"),ae=require("@mui/material/Autocomplete"),le=require("@mui/material/InputBase"),ue=require("@mui/x-date-pickers/AdapterDayjs"),ce=require("@mui/x-date-pickers/DateTimeField"),de=require("@mui/x-date-pickers/LocalizationProvider"),he=require("@mui/x-date-pickers"),pe=require("@mui/material/Radio"),ge=require("@mui/material/ToggleButtonGroup"),fe=require("@mui/icons-material/FilterAlt"),me=require("@mui/material/Menu"),ve=require("@mui/material/RadioGroup"),ye=require("@mui/icons-material/Search");function be(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var xe=be(A);function Se(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function we(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))}function Ce(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function Te(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}exports.__assign=function(){return exports.__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},exports.__assign.apply(this,arguments)},"function"==typeof SuppressedError&&SuppressedError;var ke="undefined"!=typeof window&&window.REACT_APP_CLOUDQUERY_API_BASE_URL||process.env.REACT_APP_CLOUDQUERY_API_BASE_URL||"https://api.cloudquery.io",Ie="undefined"!=typeof window&&window.REACT_APP_CLOUDQUERY_OAUTH_CONNECTOR_URL||process.env.REACT_APP_CLOUDQUERY_OAUTH_CONNECTOR_URL||"https://cloud.cloudquery.io/auth/connector",Ee="b25b8efe-63fd-4c32-9f87-059cfd649128",_e="************",Ae=function(e){return we(void 0,void 0,void 0,(function(){var t,n,r,o,i,s,a,l,u,c,d,h,p,g,f,m,v,y,b,x,S;return Ce(this,(function(w){switch(w.label){case 0:for(t=e.data,n=e.headers,r=e.method,o=e.params,i=e.signal,s=e.streamData,a=e.url,l="",u=function(e,t){l+=Array.isArray(t)?"".concat(t.map((function(t){return"".concat(e,"=").concat(encodeURIComponent(t))})).join("&"),"&"):"".concat(e,"=").concat(encodeURIComponent(t),"&")},c=0,d=Object.entries(o||{});c<d.length;c++)h=d[c],p=h[0],g=h[1],u(p,g);return f="".concat(a).concat(l?"?".concat(l):""),m="".concat(a.startsWith("http")?"":ke).concat(f),[4,fetch(m,exports.__assign(exports.__assign({method:r},t?{body:JSON.stringify(t)}:{}),{credentials:"include",headers:exports.__assign({Accept:"application/json","Content-Type":"application/json"},n),signal:i}))];case 1:return v=w.sent(),s?(b={},[3,4]):[3,2];case 2:return[4,v.json().catch((function(){return{}}))];case 3:b=w.sent(),w.label=4;case 4:return y=b,v.ok&&205!==v.status?[2,{data:y,headers:v.headers,response:v,status:v.status,statusText:v.statusText}]:(S={},s?[4,v.json().catch((function(){return{}}))]:[3,6]);case 5:return x=w.sent(),[3,7];case 6:x=y,w.label=7;case 7:throw S.data=x,S.headers=v.headers,S.isCustom=!0,S.message="There was an error during the API request",S.payload=t,S.status=v.status,S}}))}))};function je(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Oe,Pe={exports:{}};var Re=(Oe||(Oe=1,Pe.exports=function(){var e=1e3,t=6e4,n=36e5,r="millisecond",o="second",i="minute",s="hour",a="day",l="week",u="month",c="quarter",d="year",h="date",p="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|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,m={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("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},v=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},y={s:v,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),o=n%60;return(t<=0?"+":"-")+v(r,2,"0")+":"+v(o,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),o=t.clone().add(r,u),i=n-o<0,s=t.clone().add(r+(i?-1:1),u);return+(-(r+(n-o)/(i?o-s:s-o))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:d,w:l,d:a,D:h,h:s,m:i,s:o,ms:r,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",x={};x[b]=m;var S="$isDayjsObject",w=function(e){return e instanceof I||!(!e||!e[S])},C=function e(t,n,r){var o;if(!t)return b;if("string"==typeof t){var i=t.toLowerCase();x[i]&&(o=i),n&&(x[i]=n,o=i);var s=t.split("-");if(!o&&s.length>1)return e(s[0])}else{var a=t.name;x[a]=t,o=a}return!r&&o&&(b=o),o||!r&&b},T=function(e,t){if(w(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new I(n)},k=y;k.l=C,k.i=w,k.w=function(e,t){return T(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var I=function(){function m(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[S]=!0}var v=m.prototype;return v.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(k.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(g);if(r){var o=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.init()},v.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},v.$utils=function(){return k},v.isValid=function(){return!(this.$d.toString()===p)},v.isSame=function(e,t){var n=T(e);return this.startOf(t)<=n&&n<=this.endOf(t)},v.isAfter=function(e,t){return T(e)<this.startOf(t)},v.isBefore=function(e,t){return this.endOf(t)<T(e)},v.$g=function(e,t,n){return k.u(e)?this[t]:this.set(n,e)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(e,t){var n=this,r=!!k.u(t)||t,c=k.p(e),p=function(e,t){var o=k.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?o:o.endOf(a)},g=function(e,t){return k.w(n.toDate()[e].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},f=this.$W,m=this.$M,v=this.$D,y="set"+(this.$u?"UTC":"");switch(c){case d:return r?p(1,0):p(31,11);case u:return r?p(1,m):p(0,m+1);case l:var b=this.$locale().weekStart||0,x=(f<b?f+7:f)-b;return p(r?v-x:v+(6-x),m);case a:case h:return g(y+"Hours",0);case s:return g(y+"Minutes",1);case i:return g(y+"Seconds",2);case o:return g(y+"Milliseconds",3);default:return this.clone()}},v.endOf=function(e){return this.startOf(e,!1)},v.$set=function(e,t){var n,l=k.p(e),c="set"+(this.$u?"UTC":""),p=(n={},n[a]=c+"Date",n[h]=c+"Date",n[u]=c+"Month",n[d]=c+"FullYear",n[s]=c+"Hours",n[i]=c+"Minutes",n[o]=c+"Seconds",n[r]=c+"Milliseconds",n)[l],g=l===a?this.$D+(t-this.$W):t;if(l===u||l===d){var f=this.clone().set(h,1);f.$d[p](g),f.init(),this.$d=f.set(h,Math.min(this.$D,f.daysInMonth())).$d}else p&&this.$d[p](g);return this.init(),this},v.set=function(e,t){return this.clone().$set(e,t)},v.get=function(e){return this[k.p(e)]()},v.add=function(r,c){var h,p=this;r=Number(r);var g=k.p(c),f=function(e){var t=T(p);return k.w(t.date(t.date()+Math.round(e*r)),p)};if(g===u)return this.set(u,this.$M+r);if(g===d)return this.set(d,this.$y+r);if(g===a)return f(1);if(g===l)return f(7);var m=(h={},h[i]=t,h[s]=n,h[o]=e,h)[g]||1,v=this.$d.getTime()+r*m;return k.w(v,this)},v.subtract=function(e,t){return this.add(-1*e,t)},v.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||"YYYY-MM-DDTHH:mm:ssZ",o=k.z(this),i=this.$H,s=this.$m,a=this.$M,l=n.weekdays,u=n.months,c=n.meridiem,d=function(e,n,o,i){return e&&(e[n]||e(t,r))||o[n].slice(0,i)},h=function(e){return k.s(i%12||12,e,"0")},g=c||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(f,(function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return k.s(t.$y,4,"0");case"M":return a+1;case"MM":return k.s(a+1,2,"0");case"MMM":return d(n.monthsShort,a,u,3);case"MMMM":return d(u,a);case"D":return t.$D;case"DD":return k.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(n.weekdaysMin,t.$W,l,2);case"ddd":return d(n.weekdaysShort,t.$W,l,3);case"dddd":return l[t.$W];case"H":return String(i);case"HH":return k.s(i,2,"0");case"h":return h(1);case"hh":return h(2);case"a":return g(i,s,!0);case"A":return g(i,s,!1);case"m":return String(s);case"mm":return k.s(s,2,"0");case"s":return String(t.$s);case"ss":return k.s(t.$s,2,"0");case"SSS":return k.s(t.$ms,3,"0");case"Z":return o}return null}(e)||o.replace(":","")}))},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(r,h,p){var g,f=this,m=k.p(h),v=T(r),y=(v.utcOffset()-this.utcOffset())*t,b=this-v,x=function(){return k.m(f,v)};switch(m){case d:g=x()/12;break;case u:g=x();break;case c:g=x()/3;break;case l:g=(b-y)/6048e5;break;case a:g=(b-y)/864e5;break;case s:g=b/n;break;case i:g=b/t;break;case o:g=b/e;break;default:g=b}return p?g:k.a(g)},v.daysInMonth=function(){return this.endOf(u).$D},v.$locale=function(){return x[this.$L]},v.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},v.clone=function(){return k.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},m}(),E=I.prototype;return T.prototype=E,[["$ms",r],["$s",o],["$m",i],["$H",s],["$W",a],["$M",u],["$y",d],["$D",h]].forEach((function(e){E[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),T.extend=function(e,t){return e.$i||(e(t,I,T),e.$i=!0),T},T.locale=C,T.isDayjs=w,T.unix=function(e){return T(1e3*e)},T.en=x[b],T.Ls=x,T.p={},T}()),Pe.exports),De=je(Re);function Le(t,n){var r={debug:n.info.dark,error:n.error.main,fatal:n.error.dark,info:n.text.primary,panic:n.error.dark,trace:n.info.main,warn:n.warning.main};return t.replace(/}\s*{/g,"}\n{").split("\n").map((function(t){try{var n=JSON.parse(t),o=n.level,i=n.time,s=Se(n,["level","time"]),a=r[o.toLowerCase()];return{logLevel:o.toLowerCase(),logLine:e.jsxs(e.Fragment,{children:["[",De(i).format("YYYY-MM-DD HH:mm:ss:SSS"),"] |"," ",e.jsx("span",{style:{color:a},children:o.toUpperCase().padEnd(5," ")})," |"," ",e.jsx("span",{style:{color:a,wordBreak:"break-word"},children:JSON.stringify(s)})]}),logText:"".concat(De(i).format("YYYY-MM-DD HH:mm:ss:SSS")," | ").concat(o.toUpperCase().padEnd(5," ")," | ").concat(JSON.stringify(s))}}catch(e){return}})).filter(Boolean)}function Me(t){var r=t.LoadingSkeleton,o=t.children,i=t.data,a=t.emptyAction,l=t.emptyCondensed,u=t.emptyImage,c=t.emptyMessage,d=t.emptyTitle,h=t.errorMessage,p=t.errorTitle,g=t.isError,f=t.isLoading,m=t.loaderText,v=t.errorActionText;return g?e.jsxs(s.Box,{padding:3,textAlign:"center",width:"100%",children:[e.jsx(s.Typography,{marginBottom:2,variant:"h5",children:null!=p?p:"Something went wrong"}),e.jsx(s.Typography,{variant:"body1",whiteSpace:"pre-line",children:h||"Error occurred when trying to ".concat(v,".")})]}):f||!g&&!i&&!1===f?e.jsx(e.Fragment,{children:r?e.jsx(r,{}):e.jsx(n,{padding:1,width:"100%",children:e.jsxs(s.Box,{alignItems:"center",display:"flex",flexDirection:"column",gap:2,height:150,justifyContent:"center",children:[e.jsx(s.CircularProgress,{}),!!m&&e.jsx(s.Typography,{variant:"body1",children:m})]})})}):i&&Array.isArray(i)&&0===i.length?e.jsx(s.Box,{sx:{bgcolor:"background.paper",borderRadius:2.5,padding:l?5:9},textAlign:"center",width:"100%",children:e.jsxs(n,{spacing:3,children:[u&&e.jsx(s.Box,{display:"flex",justifyContent:"center",width:"100%",children:u}),e.jsxs(n,{alignItems:"center",spacing:2,children:[e.jsx(s.Typography,{color:"text.primary",variant:"h5",children:d}),!!c&&e.jsx(s.Typography,{maxWidth:"600px",sx:{color:"text.secondary"},variant:"body1",whiteSpace:"pre-line",children:c})]}),a&&e.jsx("div",{children:a})]})}):e.jsx(e.Fragment,{children:o(i)})}function Fe(e){return()=>e}function $e(e){e()}function Be(e,t){return n=>e(t(n))}function Ne(e,t){return()=>e(t)}function He(e,t){return n=>e(t,n)}function ze(e){return void 0!==e}function Ve(){}function Ue(e,t){return t(e),e}function We(e,t){return t(e)}function qe(...e){return e}function Ge(e,t){return e(1,t)}function Ke(e,t){e(0,t)}function Ye(e){e(2)}function Qe(e){return e(4)}function Je(e,t){return Ge(e,He(t,0))}function Ze(e,t){const n=e(1,(e=>{n(),t(e)}));return n}function Xe(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout((()=>{r(t)}),e)}}function et(e,t){return e===t}function tt(e=et){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function nt(e){return t=>n=>{e(n)&&t(n)}}function rt(e){return t=>Be(t,e)}function ot(e){return t=>()=>{t(e)}}function it(e,...t){const n=function(...e){return t=>e.reduceRight(We,t)}(...t);return(t,r)=>{switch(t){case 2:return void Ye(e);case 1:return Ge(e,n(r))}}}function st(e,t){return n=>r=>{n(t=e(t,r))}}function at(e){return t=>n=>{e>0?e--:t(n)}}function lt(e){let t,n=null;return r=>o=>{n=o,!t&&(t=setTimeout((()=>{t=void 0,r(n)}),e))}}function ut(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach(((e,i)=>{const s=Math.pow(2,i);Ge(e,(e=>{const a=n;n|=s,t[i]=e,a!==o&&n===o&&r&&(r(),r=null)}))})),e=>i=>{const s=()=>{e([i].concat(t))};n===o?s():r=s}}function ct(e){let t=e;const n=ht();return(e,r)=>{switch(e){case 0:t=r;break;case 1:r(t);break;case 4:return t}return n(e,r)}}function dt(e,t){return Ue(ct(t),(t=>Je(e,t)))}function ht(){const e=[];return(t,n)=>{switch(t){case 0:return void e.slice().forEach((e=>{e(n)}));case 2:return void e.splice(0,e.length);case 1:return e.push(n),()=>{const t=e.indexOf(n);t>-1&&e.splice(t,1)}}}}function pt(e){return Ue(ht(),(t=>Je(e,t)))}function gt(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:ft(),singleton:n}}const ft=()=>Symbol();function mt(...e){const t=ht(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach(((e,i)=>{const s=Math.pow(2,i);Ge(e,(e=>{n[i]=e,r|=s,r===o&&Ke(t,n)}))})),function(e,i){switch(e){case 2:return void Ye(t);case 1:return r===o&&i(n),Ge(t,i)}}}function vt(e,t=et){return it(e,tt(t))}function yt(...e){return function(t,n){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map($e)}}(...e.map((e=>Ge(e,n))))}}}var bt=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(bt||{});const xt={0:"debug",3:"error",1:"log",2:"warn"},St=gt((()=>{const e=ct(3);return{log:ct(((t,n,r=1)=>{var o;r>=(null!=(o=(typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL)?o:Qe(e))&&console[xt[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)})),logLevel:e}}),[],{singleton:!0});function wt(e,t,n){return Ct(e,t,n).callbackRef}function Ct(e,t,n){const o=r.useRef(null);let i=e=>{};if(typeof ResizeObserver<"u"){const s=r.useMemo((()=>new ResizeObserver((t=>{const r=()=>{const n=t[0].target;null!==n.offsetParent&&e(n)};n?r():requestAnimationFrame(r)}))),[e]);i=e=>{e&&t?(s.observe(e),o.current=e):(o.current&&s.unobserve(o.current),o.current=null)}}return{callbackRef:i,ref:o}}function Tt(e,t,n,o,i,s,a,l,u){const c=r.useCallback((n=>{const r=function(e,t,n,r){const o=e.length;if(0===o)return null;const i=[];for(let s=0;s<o;s++){const o=e.item(s);if(void 0===o.dataset.index)continue;const a=parseInt(o.dataset.index),l=parseFloat(o.dataset.knownSize),u=t(o,n);if(0===u&&r("Zero-sized element, this should not happen",{child:o},bt.ERROR),u===l)continue;const c=i[i.length-1];0===i.length||c.size!==u||c.endIndex!==a-1?i.push({endIndex:a,size:u,startIndex:a}):i[i.length-1].endIndex++}return i}(n.children,t,l?"offsetWidth":"offsetHeight",i);let u=n.parentElement;for(;!u.dataset.virtuosoScroller;)u=u.parentElement;const c="window"===u.lastElementChild.dataset.viewportType;let d;c&&(d=u.ownerDocument.defaultView);const h=a?l?a.scrollLeft:a.scrollTop:c?l?d.scrollX||d.document.documentElement.scrollLeft:d.scrollY||d.document.documentElement.scrollTop:l?u.scrollLeft:u.scrollTop,p=a?l?a.scrollWidth:a.scrollHeight:c?l?d.document.documentElement.scrollWidth:d.document.documentElement.scrollHeight:l?u.scrollWidth:u.scrollHeight,g=a?l?a.offsetWidth:a.offsetHeight:c?l?d.innerWidth:d.innerHeight:l?u.offsetWidth:u.offsetHeight;o({scrollHeight:p,scrollTop:Math.max(h,0),viewportHeight:g}),null==s||s(l?kt("column-gap",getComputedStyle(n).columnGap,i):kt("row-gap",getComputedStyle(n).rowGap,i)),null!==r&&e(r)}),[e,t,i,s,a,o]);return Ct(c,n,u)}function kt(e,t,n){return"normal"!==t&&!(null!=t&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,bt.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}function It(e,t,n){const o=r.useRef(null),i=r.useCallback((n=>{if(null==n||!n.offsetParent)return;const r=n.getBoundingClientRect(),i=r.width;let s,l;if(t){const e=t.getBoundingClientRect(),n=r.top-e.top;l=e.height-Math.max(0,n),s=n+t.scrollTop}else{const e=a.current.ownerDocument.defaultView;l=e.innerHeight-Math.max(0,r.top),s=r.top+e.scrollY}o.current={offsetTop:s,visibleHeight:l,visibleWidth:i},e(o.current)}),[e,t]),{callbackRef:s,ref:a}=Ct(i,!0,n),l=r.useCallback((()=>{i(a.current)}),[i,a]);return r.useEffect((()=>{var e;if(t){t.addEventListener("scroll",l);const e=new ResizeObserver((()=>{requestAnimationFrame(l)}));return e.observe(t),()=>{t.removeEventListener("scroll",l),e.unobserve(t)}}{const t=null==(e=a.current)?void 0:e.ownerDocument.defaultView;return null==t||t.addEventListener("scroll",l),null==t||t.addEventListener("resize",l),()=>{null==t||t.removeEventListener("scroll",l),null==t||t.removeEventListener("resize",l)}}}),[l,t]),s}const Et=gt((()=>{const e=ht(),t=ht(),n=ct(0),r=ht(),o=ct(0),i=ht(),s=ht(),a=ct(0),l=ct(0),u=ct(0),c=ct(0),d=ht(),h=ht(),p=ct(!1),g=ct(!1),f=ct(!1);return Je(it(e,rt((({scrollTop:e})=>e))),t),Je(it(e,rt((({scrollHeight:e})=>e))),s),Je(t,o),{deviation:n,fixedFooterHeight:u,fixedHeaderHeight:l,footerHeight:c,headerHeight:a,horizontalDirection:g,scrollBy:h,scrollContainerState:e,scrollHeight:s,scrollingInProgress:p,scrollTo:d,scrollTop:t,skipAnimationFrameInResizeObserver:f,smoothScrollTargetReached:r,statefulScrollTop:o,viewportHeight:i}}),[],{singleton:!0}),_t={lvl:0};function At(e,t){const n=e.length;if(0===n)return[];let{index:r,value:o}=t(e[0]);const i=[];for(let s=1;s<n;s++){const{index:n,value:a}=t(e[s]);i.push({end:n-1,start:r,value:o}),r=n,o=a}return i.push({end:1/0,start:r,value:o}),i}function jt(e){return e===_t}function Ot(e,t){if(!jt(e))return t===e.k?e.v:t<e.k?Ot(e.l,t):Ot(e.r,t)}function Pt(e,t,n="k"){if(jt(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=Pt(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return Pt(e.l,t,n)}function Rt(e,t,n){return jt(e)?Ut(t,n,1):t===e.k?Nt(e,{k:t,v:n}):t<e.k?Wt(Nt(e,{l:Rt(e.l,t,n)})):Wt(Nt(e,{r:Rt(e.r,t,n)}))}function Dt(){return _t}function Lt(e,t,n){if(jt(e))return[];return function(e){return At(e,(({k:e,v:t})=>({index:e,value:t})))}($t(e,Pt(e,t)[0],n))}function Mt(e,t){if(jt(e))return _t;const{k:n,l:r,r:o}=e;if(t===n){if(jt(r))return o;if(jt(o))return r;{const[t,n]=Vt(r);return Bt(Nt(e,{k:t,l:Ht(r),v:n}))}}return Bt(Nt(e,t<n?{l:Mt(r,t)}:{r:Mt(o,t)}))}function Ft(e){return jt(e)?[]:[...Ft(e.l),{k:e.k,v:e.v},...Ft(e.r)]}function $t(e,t,n){if(jt(e))return[];const{k:r,l:o,r:i,v:s}=e;let a=[];return r>t&&(a=a.concat($t(o,t,n))),r>=t&&r<=n&&a.push({k:r,v:s}),r<=n&&(a=a.concat($t(i,t,n))),a}function Bt(e){const{l:t,lvl:n,r:r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(zt(t))return qt(Nt(e,{lvl:n-1}));if(!jt(t)&&!jt(t.r))return Nt(t.r,{l:Nt(t,{r:t.r.l}),lvl:n,r:Nt(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(zt(e))return Gt(Nt(e,{lvl:n-1}));if(jt(r)||jt(r.l))throw new Error("Unexpected empty nodes");{const t=r.l,o=zt(t)?r.lvl-1:r.lvl;return Nt(t,{l:Nt(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:Gt(Nt(r,{l:t.r,lvl:o}))})}}function Nt(e,t){return Ut(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 Ht(e){return jt(e.r)?e.l:Bt(Nt(e,{r:Ht(e.r)}))}function zt(e){return jt(e)||e.lvl>e.r.lvl}function Vt(e){return jt(e.r)?[e.k,e.v]:Vt(e.r)}function Ut(e,t,n,r=_t,o=_t){return{k:e,l:r,lvl:n,r:o,v:t}}function Wt(e){return Gt(qt(e))}function qt(e){const{l:t}=e;return jt(t)||t.lvl!==e.lvl?e:Nt(t,{r:Nt(e,{l:t.r})})}function Gt(e){const{lvl:t,r:n}=e;return jt(n)||jt(n.r)||n.lvl!==t||n.r.lvl!==t?e:Nt(n,{l:Nt(e,{r:n.l}),lvl:t+1})}function Kt(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}function Yt(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}const Qt=gt((()=>({recalcInProgress:ct(!1)})),[],{singleton:!0});function Jt(e,t,n){return e[Zt(e,t,n)]}function Zt(e,t,n,r=0){let o=e.length-1;for(;r<=o;){const i=Math.floor((r+o)/2),s=n(e[i],t);if(0===s)return i;if(-1===s){if(o-r<2)return i-1;o=i-1}else{if(o===r)return i;r=i+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function Xt(e,t){return Math.round(e.getBoundingClientRect()[t])}function en(e){return!jt(e.groupOffsetTree)}function tn({index:e},t){return t===e?0:t<e?-1:1}function nn({offset:e},t){return t===e?0:t<e?-1:1}function rn(e,t,n){if(0===t.length)return 0;const{index:r,offset:o,size:i}=Jt(t,e,tn),s=e-r,a=i*s+(s-1)*n+o;return a>0?a+n:a}function on(e,t){if(!en(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function sn(e,t,n){if(function(e){return typeof e.groupIndex<"u"}(e))return t.groupIndices[e.groupIndex]+1;{let r=on("LAST"===e.index?n:e.index,t);return r=Math.max(0,r,Math.min(n,r)),r}}function an(e,t,n,r=0){return r>0&&(t=Math.max(t,Jt(e,r,tn).offset)),At(function(e,t,n,r){const o=Zt(e,t,r),i=Zt(e,n,r,o);return e.slice(o,i+1)}(e,t,n,nn),dn)}function ln(e,[t,n,r,o]){t.length>0&&r("received item sizes",t,bt.DEBUG);const i=e.sizeTree;let s=i,a=0;if(n.length>0&&jt(i)&&2===t.length){const e=t[0].size,r=t[1].size;s=n.reduce(((t,n)=>Rt(Rt(t,n,e),n+1,r)),s)}else[s,a]=function(e,t){let n=jt(e)?0:1/0;for(const r of t){const{endIndex:t,size:o,startIndex:i}=r;if(n=Math.min(n,i),jt(e)){e=Rt(e,0,o);continue}const s=Lt(e,i-1,t+1);if(s.some(hn(r)))continue;let a=!1,l=!1;for(const{end:n,start:r,value:i}of s)a?(t>=r||o===i)&&(e=Mt(e,r)):(l=i!==o,a=!0),n>t&&t>=r&&i!==o&&(e=Rt(e,t+1,i));l&&(e=Rt(e,i,o))}return[e,n]}(s,t);if(s===i)return e;const{lastIndex:l,lastOffset:u,lastSize:c,offsetTree:d}=cn(e.offsetTree,a,s,o);return{groupIndices:n,groupOffsetTree:n.reduce(((e,t)=>Rt(e,t,rn(t,d,o))),Dt()),lastIndex:l,lastOffset:u,lastSize:c,offsetTree:d,sizeTree:s}}function un(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function cn(e,t,n,r){let o=e,i=0,s=0,a=0,l=0;if(0!==t){l=Zt(o,t-1,tn),a=o[l].offset;const e=Pt(n,t-1);i=e[0],s=e[1],o.length&&o[l].size===Pt(n,t)[1]&&(l-=1),o=o.slice(0,l+1)}else o=[];for(const{start:e,value:l}of Lt(n,t,1/0)){const t=e-i,n=t*s+a+t*r;o.push({index:e,offset:n,size:l}),i=e,a=n,s=l}return{lastIndex:i,lastOffset:a,lastSize:s,offsetTree:o}}function dn(e){return{index:e.index,value:e}}function hn(e){const{endIndex:t,size:n,startIndex:r}=e;return e=>e.start===r&&(e.end===t||e.end===1/0)&&e.value===n}const pn={offsetHeight:"height",offsetWidth:"width"},gn=gt((([{log:e},{recalcInProgress:t}])=>{const n=ht(),r=ht(),o=dt(r,0),i=ht(),s=ht(),a=ct(0),l=ct([]),u=ct(void 0),c=ct(void 0),d=ct(((e,t)=>Xt(e,pn[t]))),h=ct(void 0),p=ct(0),g={groupIndices:[],groupOffsetTree:Dt(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Dt()},f=dt(it(n,ut(l,e,p),st(ln,g),tt()),g),m=dt(it(l,tt(),st(((e,t)=>({current:t,prev:e.current})),{current:[],prev:[]}),rt((({prev:e})=>e))),[]);Je(it(l,nt((e=>e.length>0)),ut(f,p),rt((([e,t,n])=>{const r=e.reduce(((e,r,o)=>Rt(e,r,rn(r,t.offsetTree,n)||o)),Dt());return{...t,groupIndices:e,groupOffsetTree:r}}))),f),Je(it(r,ut(f),nt((([e,{lastIndex:t}])=>e<t)),rt((([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}]))),n),Je(u,c);const v=dt(it(u,rt((e=>void 0===e))),!0);Je(it(c,nt((e=>void 0!==e&&jt(Qe(f).sizeTree))),rt((e=>[{endIndex:0,size:e,startIndex:0}]))),n);const y=pt(it(n,ut(f),st((({sizes:e},[t,n])=>({changed:n!==e,sizes:n})),{changed:!1,sizes:g}),rt((e=>e.changed))));Ge(it(a,st(((e,t)=>({diff:e.prev-t,prev:t})),{diff:0,prev:0}),rt((e=>e.diff))),(e=>{const{groupIndices:n}=Qe(f);if(e>0)Ke(t,!0),Ke(i,e+un(e,n));else if(e<0){const t=Qe(m);t.length>0&&(e-=un(-e,t)),Ke(s,e)}})),Ge(it(a,ut(e)),(([e,t])=>{e<0&&t("`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:a},bt.ERROR)}));const b=pt(i);Je(it(i,ut(f),rt((([e,t])=>{const n=t.groupIndices.length>0,r=[],o=t.lastSize;if(n){const n=Ot(t.sizeTree,0);let i=0,s=0;for(;i<e;){const e=t.groupIndices[s],a=t.groupIndices.length===s+1?1/0:t.groupIndices[s+1]-e-1;r.push({endIndex:e,size:n,startIndex:e}),r.push({endIndex:e+1+a-1,size:o,startIndex:e+1}),s++,i+=a+1}const a=Ft(t.sizeTree);return i!==e&&a.shift(),a.reduce(((t,{k:n,v:r})=>{let o=t.ranges;return 0!==t.prevSize&&(o=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:r,ranges:o}}),{prevIndex:e,prevSize:0,ranges:r}).ranges}return Ft(t.sizeTree).reduce(((t,{k:n,v:r})=>({prevIndex:n+e,prevSize:r,ranges:[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]})),{prevIndex:0,prevSize:o,ranges:[]}).ranges}))),n);const x=pt(it(s,ut(f,p),rt((([e,{offsetTree:t},n])=>rn(-e,t,n)))));return Je(it(s,ut(f,p),rt((([e,t,n])=>{if(t.groupIndices.length>0){if(jt(t.sizeTree))return t;let r=Dt();const o=Qe(m);let i=0,s=0,a=0;for(;i<-e;){a=o[s];const e=o[s+1]-a-1;s++,i+=e+1}if(r=Ft(t.sizeTree).reduce(((t,{k:n,v:r})=>Rt(t,Math.max(0,n+e),r)),r),i!==-e){r=Rt(r,0,Ot(t.sizeTree,a));r=Rt(r,1,Pt(t.sizeTree,1-e)[1])}return{...t,sizeTree:r,...cn(t.offsetTree,0,r,n)}}{const r=Ft(t.sizeTree).reduce(((t,{k:n,v:r})=>Rt(t,Math.max(0,n+e),r)),Dt());return{...t,sizeTree:r,...cn(t.offsetTree,0,r,n)}}}))),f),{beforeUnshiftWith:b,data:h,defaultItemSize:c,firstItemIndex:a,fixedItemSize:u,gap:p,groupIndices:l,itemSize:d,listRefresh:y,shiftWith:s,shiftWithOffset:x,sizeRanges:n,sizes:f,statefulTotalCount:o,totalCount:r,trackItemSizes:v,unshiftWith:i}}),qe(St,Qt),{singleton:!0});function fn(e){return e.reduce(((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e)),{groupIndices:[],totalCount:0})}const mn=gt((([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:o}])=>{const i=ht(),s=ht(),a=pt(it(i,rt(fn)));return Je(it(a,rt((e=>e.totalCount))),n),Je(it(a,rt((e=>e.groupIndices))),e),Je(it(mt(o,t,r),nt((([e,t])=>en(t))),rt((([e,t,n])=>Pt(t.groupOffsetTree,Math.max(e-n,0),"v")[0])),tt(),rt((e=>[e]))),s),{groupCounts:i,topItemsIndexes:s}}),qe(gn,Et)),vn=gt((([{log:e}])=>{const t=ct(!1),n=pt(it(t,nt((e=>e)),tt()));return Ge(t,(t=>{t&&Qe(e)("props updated",{},bt.DEBUG)})),{didMount:n,propsReady:t}}),qe(St),{singleton:!0}),yn=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function bn(e){const t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!yn)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const xn=gt((([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:o,fixedHeaderHeight:i,footerHeight:s,headerHeight:a,scrollingInProgress:l,scrollTo:u,smoothScrollTargetReached:c,viewportHeight:d},{log:h}])=>{const p=ht(),g=ht(),f=ct(0);let m=null,v=null,y=null;function b(){m&&(m(),m=null),y&&(y(),y=null),v&&(clearTimeout(v),v=null),Ke(l,!1)}return Je(it(p,ut(n,d,r,f,a,s,h),ut(e,i,o),rt((([[e,n,r,o,i,s,a,u],d,h,f])=>{const x=bn(e),{align:S,behavior:w,offset:C}=x,T=o-1,k=sn(x,n,T);let I=rn(k,n.offsetTree,d)+s;"end"===S?(I+=h+Pt(n.sizeTree,k)[1]-r+f,k===T&&(I+=a)):"center"===S?I+=(h+Pt(n.sizeTree,k)[1]-r+f)/2:I-=i,C&&(I+=C);const E=t=>{b(),t?(u("retrying to scroll to",{location:e},bt.DEBUG),Ke(p,e)):(Ke(g,!0),u("list did not change, scroll successful",{},bt.DEBUG))};if(b(),"smooth"===w){let e=!1;y=Ge(t,(t=>{e=e||t})),m=Ze(c,(()=>{E(e)}))}else m=Ze(it(t,function(e){return t=>{const n=setTimeout((()=>{t(!1)}),e);return e=>{e&&(t(!0),clearTimeout(n))}}}(150)),E);return v=setTimeout((()=>{b()}),1200),Ke(l,!0),u("scrolling from index to",{behavior:w,index:k,top:I},bt.DEBUG),{behavior:w,top:I}}))),u),{scrollTargetReached:g,scrollToIndex:p,topListHeight:f}}),qe(gn,Et,St),{singleton:!0});function Sn(e,t){0==e?t():requestAnimationFrame((()=>{Sn(e-1,t)}))}function wn(e,t){const n=t-1;return"number"==typeof e?e:"LAST"===e.index?n:e.index}const Cn=gt((([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:o,scrollToIndex:i},{didMount:s}])=>{const a=ct(!0),l=ct(0),u=ct(!0);return Je(it(s,ut(l),nt((([e,t])=>!!t)),ot(!1)),a),Je(it(s,ut(l),nt((([e,t])=>!!t)),ot(!1)),u),Ge(it(mt(t,s),ut(a,n,e,u),nt((([[,e],t,{sizeTree:n},r,o])=>e&&(!jt(n)||ze(r))&&!t&&!o)),ut(l)),(([,e])=>{Ze(o,(()=>{Ke(u,!0)})),Sn(4,(()=>{Ze(r,(()=>{Ke(a,!0)})),Ke(i,e)}))})),{initialItemFinalLocationReached:u,initialTopMostItemIndex:l,scrolledToInitialItem:a}}),qe(gn,Et,xn,vn),{singleton:!0});function Tn(e,t){return Math.abs(e-t)<1.01}const kn="up",In="down",En={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},_n=gt((([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:o,viewportHeight:i}])=>{const s=ct(!1),a=ct(!0),l=ht(),u=ht(),c=ct(4),d=ct(0),h=dt(it(yt(it(vt(o),at(1),ot(!0)),it(vt(o),at(1),ot(!1),Xe(100))),tt()),!1),p=dt(it(yt(it(n,ot(!0)),it(n,ot(!1),Xe(200))),tt()),!1);Je(it(mt(vt(o),vt(d)),rt((([e,t])=>e<=t)),tt()),a),Je(it(a,lt(50)),u);const g=pt(it(mt(r,vt(i),vt(t),vt(e),vt(c)),st(((e,[{scrollHeight:t,scrollTop:n},r,o,i,s])=>{const a={scrollHeight:t,scrollTop:n,viewportHeight:r};if(n+r-t>-s){let t,r;return n>e.state.scrollTop?(t="SCROLLED_DOWN",r=e.state.scrollTop-n):(t="SIZE_DECREASED",r=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:a}}let l;return l=a.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":r<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":n<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:l,state:a}}),En),tt(((e,t)=>e&&e.atBottom===t.atBottom)))),f=dt(it(r,st(((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(Tn(e.scrollHeight,t))return{changed:!1,jump:0,scrollHeight:t,scrollTop:n};{const o=t-(n+r)<1;return e.scrollTop!==n&&o?{changed:!0,jump:e.scrollTop-n,scrollHeight:t,scrollTop:n}:{changed:!0,jump:0,scrollHeight:t,scrollTop:n}}}),{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),nt((e=>e.changed)),rt((e=>e.jump))),0);Je(it(g,rt((e=>e.atBottom))),s),Je(it(s,lt(50)),l);const m=ct(In);Je(it(r,rt((({scrollTop:e})=>e)),tt(),st(((e,t)=>Qe(p)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?kn:In,prevScrollTop:t}),{direction:In,prevScrollTop:0}),rt((e=>e.direction))),m),Je(it(r,lt(50),ot("none")),m);const v=ct(0);return Je(it(h,nt((e=>!e)),ot(0)),v),Je(it(o,lt(100),ut(h),nt((([e,t])=>!!t)),st((([e,t],[n])=>[t,n]),[0,0]),rt((([e,t])=>t-e))),v),{atBottomState:g,atBottomStateChange:l,atBottomThreshold:c,atTopStateChange:u,atTopThreshold:d,isAtBottom:s,isAtTop:a,isScrolling:h,lastJumpDueToItemResize:f,scrollDirection:m,scrollVelocity:v}}),qe(Et)),An="top",jn="bottom",On="none";function Pn(e,t,n){return"number"==typeof e?n===kn&&t===An||n===In&&t===jn?e:0:n===kn?t===An?e.main:e.reverse:t===jn?e.main:e.reverse}function Rn(e,t){var n;return"number"==typeof e?e:null!=(n=e[t])?n:0}const Dn=gt((([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:o}])=>{const i=ht(),s=ct(0),a=ct(0),l=ct(0),u=dt(it(mt(vt(r),vt(o),vt(n),vt(i,Yt),vt(l),vt(s),vt(t),vt(e),vt(a)),rt((([e,t,n,[r,o],i,s,a,l,u])=>{const c=e-l,d=s+a,h=Math.max(n-c,0);let p=On;const g=Rn(u,An),f=Rn(u,jn);return r-=l,o+=n+a,(r+=n+a)>e+d-g&&(p=kn),(o-=l)<e-h+t+f&&(p=In),p!==On?[Math.max(c-n-Pn(i,An,p)-g,0),c-h-a+t+Pn(i,jn,p)+f]:null})),nt((e=>null!=e)),tt(Yt)),[0,0]);return{increaseViewportBy:a,listBoundary:i,overscan:l,topListHeight:s,visibleRange:u}}),qe(Et),{singleton:!0});const Ln={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Mn(e,t,n,r,o,i){const{lastIndex:s,lastOffset:a,lastSize:l}=o;let u=0,c=0;if(e.length>0){u=e[0].offset;const t=e[e.length-1];c=t.offset+t.size}const d=n-s,h=u,p=a+d*l+(d-1)*r-c;return{bottom:c,firstItemIndex:i,items:$n(e,o,i),offsetBottom:p,offsetTop:u,top:h,topItems:$n(t,o,i),topListHeight:t.reduce(((e,t)=>t.size+e),0),totalCount:n}}function Fn(e,t,n,r,o,i){let s=0;if(n.groupIndices.length>0)for(const t of n.groupIndices){if(t-s>=e)break;s++}const a=e+s,l=wn(t,a);return Mn(Array.from({length:a}).map(((e,t)=>({data:i[t+l],index:t+l,offset:0,size:0}))),[],a,o,n,r)}function $n(e,t,n){if(0===e.length)return[];if(!en(t))return e.map((e=>({...e,index:e.index+n,originalIndex:e.index})));const r=e[0].index,o=e[e.length-1].index,i=[],s=Lt(t.groupOffsetTree,r,o);let a,l=0;for(const r of e){let e;(!a||a.end<r.index)&&(a=s.shift(),l=t.groupIndices.indexOf(a.start)),e=r.index===a.start?{index:l,type:"group"}:{groupIndex:l,index:r.index-(l+1)+n},i.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return i}const Bn=gt((([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:o},i,{listBoundary:s,topListHeight:a,visibleRange:l},{initialTopMostItemIndex:u,scrolledToInitialItem:c},{topListHeight:d},h,{didMount:p},{recalcInProgress:g}])=>{const f=ct([]),m=ct(0),v=ht();Je(i.topItemsIndexes,f);const y=dt(it(mt(p,g,vt(l,Yt),vt(o),vt(r),vt(u),c,vt(f),vt(t),vt(n),e),nt((([e,t,,n,,,,,,,r])=>{const o=r&&r.length!==n;return e&&!t&&!o})),rt((([,,[e,t],n,r,o,i,s,a,l,u])=>{const c=r,{offsetTree:d,sizeTree:h}=c,p=Qe(m);if(0===n)return{...Ln,totalCount:n};if(0===e&&0===t)return 0===p?{...Ln,totalCount:n}:Fn(p,o,r,a,l,u||[]);if(jt(h))return p>0?null:Mn(function(e,t,n){if(en(t)){const r=on(e,t);return[{index:Pt(t.groupOffsetTree,r)[0],offset:0,size:0},{data:null==n?void 0:n[0],index:r,offset:0,size:0}]}return[{data:null==n?void 0:n[0],index:e,offset:0,size:0}]}(wn(o,n),c,u),[],n,l,c,a);const g=[];if(s.length>0){const e=s[0],t=s[s.length-1];let n=0;for(const r of Lt(h,e,t)){const o=r.value,i=Math.max(r.start,e),s=Math.min(r.end,t);for(let e=i;e<=s;e++)g.push({data:null==u?void 0:u[e],index:e,offset:n,size:o}),n+=o}}if(!i)return Mn([],g,n,l,c,a);const f=s.length>0?s[s.length-1]+1:0,v=an(d,e,t,f);if(0===v.length)return null;const y=n-1,b=Ue([],(n=>{for(const r of v){const o=r.value;let i=o.offset,s=r.start;const a=o.size;if(o.offset<e){s+=Math.floor((e-o.offset+l)/(a+l));const t=s-r.start;i+=t*a+t*l}s<f&&(i+=(f-s)*a,s=f);const c=Math.min(r.end,y);for(let e=s;e<=c&&!(i>=t);e++)n.push({data:null==u?void 0:u[e],index:e,offset:i,size:a}),i+=a+l}}));return Mn(b,g,n,l,c,a)})),nt((e=>null!==e)),tt()),Ln);Je(it(e,nt(ze),rt((e=>null==e?void 0:e.length))),o),Je(it(y,rt((e=>e.topListHeight))),d),Je(d,a),Je(it(y,rt((e=>[e.top,e.bottom]))),s),Je(it(y,rt((e=>e.items))),v);const b=pt(it(y,nt((({items:e})=>e.length>0)),ut(o,e),nt((([{items:e},t])=>e[e.length-1].originalIndex===t-1)),rt((([,e,t])=>[e-1,t])),tt(Yt),rt((([e])=>e)))),x=pt(it(y,lt(200),nt((({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length)),rt((({items:e})=>e[0].index)),tt())),S=pt(it(y,nt((({items:e})=>e.length>0)),rt((({items:e})=>{let t=0,n=e.length-1;for(;"group"===e[t].type&&t<n;)t++;for(;"group"===e[n].type&&n>t;)n--;return{endIndex:e[n].index,startIndex:e[t].index}})),tt(Kt)));return{endReached:b,initialItemCount:m,itemsRendered:v,listState:y,rangeChanged:S,startReached:x,topItemsIndexes:f,...h}}),qe(gn,mn,Dn,Cn,xn,_n,vn,Qt),{singleton:!0}),Nn=gt((([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:o}])=>{const i=ht(),s=dt(it(mt(n,e,r,t,o),rt((([e,t,n,r,o])=>e+t+n+r+o.offsetBottom+o.bottom))),0);return Je(vt(s),i),{totalListHeight:s,totalListHeightChanged:i}}),qe(Et,Bn),{singleton:!0}),Hn=gt((([{viewportHeight:e},{totalListHeight:t}])=>{const n=ct(!1),r=dt(it(mt(n,e,t),nt((([e])=>e)),rt((([,e,t])=>Math.max(0,e-t))),lt(0),tt()),0);return{alignToBottom:n,paddingTopAddition:r}}),qe(Et,Nn),{singleton:!0});function zn(e){return!!e&&("smooth"===e?"smooth":"auto")}const Vn=gt((([{listRefresh:e,totalCount:t},{atBottomState:n,isAtBottom:r},{scrollToIndex:o},{scrolledToInitialItem:i},{didMount:s,propsReady:a},{log:l},{scrollingInProgress:u}])=>{const c=ct(!1),d=ht();let h=null;function p(e){Ke(o,{align:"end",behavior:e,index:"LAST"})}function g(e){const t=Ze(n,(t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&!h&&(Qe(l)("scrolling to bottom due to increased size",{},bt.DEBUG),p("auto"))}));setTimeout(t,100)}return Ge(it(mt(it(vt(t),at(1)),s),ut(vt(c),r,i,u),rt((([[e,t],n,r,o,i])=>{let s=t&&o,a="auto";return s&&(a=((e,t)=>"function"==typeof e?zn(e(t)):t&&zn(e))(n,r||i),s=s&&!!a),{followOutputBehavior:a,shouldFollow:s,totalCount:e}})),nt((({shouldFollow:e})=>e))),(({followOutputBehavior:t,totalCount:n})=>{h&&(h(),h=null),h=Ze(e,(()=>{Qe(l)("following output to ",{totalCount:n},bt.DEBUG),p(t),h=null}))})),Ge(it(mt(vt(c),t,a),nt((([e,,t])=>e&&t)),st((({value:e},[,t])=>({refreshed:e===t,value:t})),{refreshed:!1,value:0}),nt((({refreshed:e})=>e)),ut(c,t)),(([,e])=>{Qe(i)&&g(!1!==e)})),Ge(d,(()=>{g(!1!==Qe(c))})),Ge(mt(vt(c),n),(([e,t])=>{e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&p("auto")})),{autoscrollToBottom:d,followOutput:c}}),qe(gn,_n,xn,Cn,vn,St,Et)),Un=gt((([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:o},{initialItemCount:i,listState:s},{didMount:a}])=>(Je(it(a,ut(i),nt((([,e])=>0!==e)),ut(o,r,t,n,e),rt((([[,e],t,n,r,o,i=[]])=>Fn(e,t,n,r,o,i)))),s),{})),qe(gn,Cn,Bn,vn),{singleton:!0}),Wn=gt((([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=ct(0);return Ge(it(e,ut(r),nt((([,e])=>0!==e)),rt((([,e])=>({top:e})))),(e=>{Ze(it(n,at(1),nt((e=>e.items.length>1))),(()=>{requestAnimationFrame((()=>{Ke(t,e)}))}))})),{initialScrollTop:r}}),qe(vn,Et,Bn),{singleton:!0}),qn=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...o},viewportBottom:i,viewportTop:s})=>t<s?{...o,align:null!=n?n:"start",behavior:r}:e>i?{...o,align:null!=n?n:"end",behavior:r}:null,Gn=gt((([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:o,headerHeight:i,scrollingInProgress:s,scrollTop:a,viewportHeight:l},{scrollToIndex:u}])=>{const c=ht();return Je(it(c,ut(t,l,n,i,o,r,a),ut(e),rt((([[e,t,n,r,o,i,a,l],u])=>{const{align:c,behavior:d,calculateViewLocation:h=qn,done:p,...g}=e,f=sn(e,t,r-1),m=rn(f,t.offsetTree,u)+o+i,v=h({itemBottom:m+Pt(t.sizeTree,f)[1],itemTop:m,locationParams:{align:c,behavior:d,...g},viewportBottom:l+n-a,viewportTop:l+i});return v?p&&Ze(it(s,nt((e=>!e)),at(Qe(s)?1:2)),p):p&&p(),v})),nt((e=>null!==e))),u),{scrollIntoView:c}}),qe(gn,Et,xn,Bn,St),{singleton:!0}),Kn=gt((([{scrollVelocity:e}])=>{const t=ct(!1),n=ht(),r=ct(!1);return Je(it(e,ut(r,t,n),nt((([e,t])=>!!t)),rt((([e,t,n,r])=>{const{enter:o,exit:i}=t;if(n){if(i(e,r))return!1}else if(o(e,r))return!0;return n})),tt()),t),Ge(it(mt(t,e,n),ut(r)),(([[e,t,n],r])=>{e&&r&&r.change&&r.change(t,n)})),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}}),qe(_n),{singleton:!0}),Yn=gt((([{scrollContainerState:e,scrollTo:t}])=>{const n=ht(),r=ht(),o=ht(),i=ct(!1),s=ct(void 0);return Je(it(mt(n,r),rt((([{scrollHeight:e,scrollTop:t,viewportHeight:n},{offsetTop:r}])=>({scrollHeight:e,scrollTop:Math.max(0,t-r),viewportHeight:n})))),e),Je(it(t,ut(r),rt((([e,{offsetTop:t}])=>({...e,top:e.top+t})))),o),{customScrollParent:s,useWindowScroll:i,windowScrollContainerState:n,windowScrollTo:o,windowViewportRect:r}}),qe(Et)),Qn=gt((([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:o},{didMount:i},{useWindowScroll:s,windowScrollContainerState:a,windowViewportRect:l}])=>{const u=ht(),c=ct(void 0),d=ct(null),h=ct(null);return Je(a,d),Je(l,h),Ge(it(u,ut(t,r,s,d,h,n)),(([e,t,n,r,o,i,s])=>{const a=function(e){return Ft(e).map((({k:e,v:t},n,r)=>{const o=r[n+1];return{endIndex:o?o.k-1:1/0,size:t,startIndex:e}}))}(t.sizeTree);r&&null!==o&&null!==i&&(n=o.scrollTop-i.offsetTop),e({ranges:a,scrollTop:n-=s})})),Je(it(c,nt(ze),rt(Jn)),o),Je(it(i,ut(c),nt((([,e])=>void 0!==e)),tt(),rt((([,e])=>e.ranges))),e),{getState:u,restoreStateFrom:c}}),qe(gn,Et,Cn,vn,Yn));function Jn(e){return{align:"start",index:0,offset:e.scrollTop}}const Zn=gt((([{topItemsIndexes:e}])=>{const t=ct(0);return Je(it(t,nt((e=>e>=0)),rt((e=>Array.from({length:e}).map(((e,t)=>t))))),e),{topItemCount:t}}),qe(Bn));function Xn(e){let t,n=!1;return()=>(n||(n=!0,t=e()),t)}const er=Xn((()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent))),tr=gt((([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:o,isScrolling:i,lastJumpDueToItemResize:s,scrollDirection:a},{listState:l},{beforeUnshiftWith:u,gap:c,shiftWithOffset:d,sizes:h},{log:p},{recalcInProgress:g}])=>{const f=pt(it(l,ut(s),st((([,e,t,n],[{bottom:r,items:o,offsetBottom:i,totalCount:s},a])=>{const l=r+i;let u=0;return t===s&&e.length>0&&o.length>0&&(0===o[0].originalIndex&&0===e[0].originalIndex||(u=l-n,0!==u&&(u+=a))),[u,o,s,l]}),[0,[],0,0]),nt((([e])=>0!==e)),ut(r,a,n,o,p,g),nt((([,e,t,n,,,r])=>!r&&!n&&0!==e&&t===kn)),rt((([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},bt.DEBUG),e)))));function m(n){n>0?(Ke(t,{behavior:"auto",top:-n}),Ke(e,0)):(Ke(e,0),Ke(t,{behavior:"auto",top:-n}))}return Ge(it(f,ut(e,i)),(([t,n,r])=>{r&&er()?Ke(e,n-t):m(-t)})),Ge(it(mt(dt(i,!1),e,g),nt((([e,t,n])=>!e&&!n&&0!==t)),rt((([e,t])=>t)),lt(1)),m),Je(it(d,rt((e=>({top:-e})))),t),Ge(it(u,ut(h,c),rt((([e,{groupIndices:t,lastSize:n,sizeTree:r},o])=>{function i(e){return e*(n+o)}if(0===t.length)return i(e);{let n=0;const o=Ot(r,0);let s=0,a=0;for(;s<e;){s++,n+=o;let r=t.length===a+1?1/0:t[a+1]-t[a]-1;s+r>e&&(n-=o,r=e-s+1),s+=r,n+=i(r),a++}return n}}))),(n=>{Ke(e,n),requestAnimationFrame((()=>{Ke(t,{top:n}),requestAnimationFrame((()=>{Ke(e,0),Ke(g,!1)}))}))})),{deviation:e}}),qe(Et,_n,Bn,gn,St,Qt)),nr=gt((([e,t,n,r,o,i,s,a,l,u])=>({...e,...t,...n,...r,...o,...i,...s,...a,...l,...u})),qe(Dn,Un,vn,Kn,Nn,Wn,Hn,Yn,Gn,St)),rr=gt((([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,gap:o,groupIndices:i,itemSize:s,sizeRanges:a,sizes:l,statefulTotalCount:u,totalCount:c,trackItemSizes:d},{initialItemFinalLocationReached:h,initialTopMostItemIndex:p,scrolledToInitialItem:g},f,m,v,{listState:y,topItemsIndexes:b,...x},{scrollToIndex:S},w,{topItemCount:C},{groupCounts:T},k])=>(Je(x.rangeChanged,k.scrollSeekRangeChanged),Je(it(k.windowViewportRect,rt((e=>e.visibleHeight))),f.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,gap:o,groupCounts:T,initialItemFinalLocationReached:h,initialTopMostItemIndex:p,scrolledToInitialItem:g,sizeRanges:a,topItemCount:C,topItemsIndexes:b,totalCount:c,...v,groupIndices:i,itemSize:s,listState:y,scrollToIndex:S,statefulTotalCount:u,trackItemSizes:d,...x,...k,...f,sizes:l,...m})),qe(gn,Cn,Et,Qn,Vn,Bn,xn,tr,Zn,mn,nr));function or(e,t){const n={},r={};let o=0;const i=e.length;for(;o<i;)r[e[o]]=1,o+=1;for(const e in t)Object.hasOwn(r,e)||(n[e]=t[e]);return n}const ir=typeof document<"u"?r.useLayoutEffect:r.useEffect;function sr(t,n,o){const i=Object.keys(n.required||{}),s=Object.keys(n.optional||{}),a=Object.keys(n.methods||{}),l=Object.keys(n.events||{}),u=r.createContext({});function c(e,t){e.propsReady&&Ke(e.propsReady,!1);for(const r of i){Ke(e[n.required[r]],t[r])}for(const r of s)if(r in t){Ke(e[n.optional[r]],t[r])}e.propsReady&&Ke(e.propsReady,!0)}function d(e){return l.reduce(((t,r)=>(t[r]=function(e){let t,n;const r=()=>null==t?void 0:t();return function(o,i){switch(o){case 1:return i?n===i?void 0:(r(),n=i,t=Ge(e,i),t):(r(),Ve);case 2:return r(),void(n=null)}}}(e[n.events[r]]),t)),{})}const h=r.forwardRef(((h,p)=>{const{children:g,...f}=h,[m]=r.useState((()=>Ue(function(e){const t=new Map,n=({constructor:e,dependencies:r,id:o,singleton:i})=>{if(i&&t.has(o))return t.get(o);const s=e(r.map((e=>n(e))));return i&&t.set(o,s),s};return n(e)}(t),(e=>{c(e,f)})))),[v]=r.useState(Ne(d,m));ir((()=>{for(const e of l)e in f&&Ge(v[e],f[e]);return()=>{Object.values(v).map(Ye)}}),[f,v,m]),ir((()=>{c(m,f)})),r.useImperativeHandle(p,Fe(function(e){return a.reduce(((t,r)=>(t[r]=t=>{Ke(e[n.methods[r]],t)},t)),{})}(m)));const y=o;return e.jsx(u.Provider,{value:m,children:o?e.jsx(y,{...or([...i,...s,...l],f),children:g}):g})})),p=r.version.startsWith("18")?e=>{const t=r.useContext(u)[e],n=r.useCallback((e=>Ge(t,e)),[t]);return r.useSyncExternalStore(n,(()=>Qe(t)),(()=>Qe(t)))}:e=>{const t=r.useContext(u)[e],[n,o]=r.useState(Ne(Qe,t));return ir((()=>Ge(t,(e=>{e!==n&&o(Fe(e))}))),[t,n]),n};return{Component:h,useEmitter:(e,t)=>{const n=r.useContext(u)[e];ir((()=>Ge(n,t)),[t,n])},useEmitterValue:p,usePublisher:e=>r.useCallback(He(Ke,r.useContext(u)[e]),[e])}}const ar=r.createContext(void 0),lr=r.createContext(void 0),ur=typeof document<"u"?r.useLayoutEffect:r.useEffect;function cr(e){return"self"in e}function dr(e,t,n,o=Ve,i,s){const a=r.useRef(null),l=r.useRef(null),u=r.useRef(null),c=r.useCallback((n=>{let r,o,i;const a=n.target;if(function(e){return"body"in e}(a)||cr(a)){const e=cr(a)?a:a.defaultView;i=s?e.scrollX:e.scrollY,r=s?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,o=s?e.innerWidth:e.innerHeight}else i=s?a.scrollLeft:a.scrollTop,r=s?a.scrollWidth:a.scrollHeight,o=s?a.offsetWidth:a.offsetHeight;const c=()=>{e({scrollHeight:r,scrollTop:Math.max(i,0),viewportHeight:o})};n.suppressFlus