var Cn=e=>{throw TypeError(e)};var Pt=(e,t,n)=>t.has(e)||Cn("Cannot "+n);var u=(e,t,n)=>(Pt(e,t,"read from private field"),n?n.call(e):t.get(e)),y=(e,t,n)=>t.has(e)?Cn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),v=(e,t,n,s)=>(Pt(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n),w=(e,t,n)=>(Pt(e,t,"access private method"),n);var vt=(e,t,n,s)=>({set _(i){v(e,t,i,n)},get _(){return u(e,t,s)}});import{q as O,n as Ss}from"./vendor-react-DfNOgXDS.js";const Cs="modulepreload",ys=function(e){return"/"+e},yn={},Ui=function(t,n,s){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(a=>{if(a=ys(a),a in yn)return;yn[a]=!0;const d=a.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${h}`))return;const g=document.createElement("link");if(g.rel=d?"stylesheet":Cs,d||(g.as="script"),g.crossOrigin="",g.href=a,l&&g.setAttribute("nonce",l),document.head.appendChild(g),d)return new Promise((f,c)=>{g.addEventListener("load",f),g.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${a}`)))})}))}function r(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return i.then(o=>{for(const l of o||[])l.status==="rejected"&&r(l.reason);return t().catch(r)})};var Le=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Me,ge,Ge,Dn,Rs=(Dn=class extends Le{constructor(){super();y(this,Me);y(this,ge);y(this,Ge);v(this,Ge,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){u(this,ge)||this.setEventListener(u(this,Ge))}onUnsubscribe(){var t;this.hasListeners()||((t=u(this,ge))==null||t.call(this),v(this,ge,void 0))}setEventListener(t){var n;v(this,Ge,t),(n=u(this,ge))==null||n.call(this),v(this,ge,t(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(t){u(this,Me)!==t&&(v(this,Me,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof u(this,Me)=="boolean"?u(this,Me):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Me=new WeakMap,ge=new WeakMap,Ge=new WeakMap,Dn),un=new Rs,ws={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},he,on,An,Fs=(An=class{constructor(){y(this,he,ws);y(this,on,!1)}setTimeoutProvider(e){v(this,he,e)}setTimeout(e,t){return u(this,he).setTimeout(e,t)}clearTimeout(e){u(this,he).clearTimeout(e)}setInterval(e,t){return u(this,he).setInterval(e,t)}clearInterval(e){u(this,he).clearInterval(e)}},he=new WeakMap,on=new WeakMap,An),Pe=new Fs;function _s(e){setTimeout(e,0)}var Ps=typeof window>"u"||"Deno"in globalThis;function Q(){}function Ms(e,t){return typeof e=="function"?e(t):e}function Dt(e){return typeof e=="number"&&e>=0&&e!==1/0}function kn(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Fe(e,t){return typeof e=="function"?e(t):e}function K(e,t){return typeof e=="function"?e(t):e}function Rn(e,t){const{type:n="all",exact:s,fetchStatus:i,predicate:r,queryKey:o,stale:l}=e;if(o){if(s){if(t.queryHash!==ln(o,t.options))return!1}else if(!nt(t.queryKey,o))return!1}if(n!=="all"){const a=t.isActive();if(n==="active"&&!a||n==="inactive"&&a)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||r&&!r(t))}function wn(e,t){const{exact:n,status:s,predicate:i,mutationKey:r}=e;if(r){if(!t.options.mutationKey)return!1;if(n){if(He(t.options.mutationKey)!==He(r))return!1}else if(!nt(t.options.mutationKey,r))return!1}return!(s&&t.state.status!==s||i&&!i(t))}function ln(e,t){return((t==null?void 0:t.queryKeyHashFn)||He)(e)}function He(e){return JSON.stringify(e,(t,n)=>At(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function nt(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>nt(e[n],t[n])):!1}var Is=Object.prototype.hasOwnProperty;function an(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=Fn(e)&&Fn(t);if(!s&&!(At(e)&&At(t)))return t;const r=(s?e:Object.keys(e)).length,o=s?t:Object.keys(t),l=o.length,a=s?new Array(l):{};let d=0;for(let h=0;h<l;h++){const g=s?h:o[h],f=e[g],c=t[g];if(f===c){a[g]=f,(s?h<r:Is.call(e,g))&&d++;continue}if(f===null||c===null||typeof f!="object"||typeof c!="object"){a[g]=c;continue}const m=an(f,c,n+1);a[g]=m,m===f&&d++}return r===l&&d===r?e:a}function st(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Fn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function At(e){if(!_n(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!_n(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function _n(e){return Object.prototype.toString.call(e)==="[object Object]"}function xs(e){return new Promise(t=>{Pe.setTimeout(t,e)})}function bt(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?an(e,t):t}function Es(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function $s(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var cn=Symbol();function Bn(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===cn?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function dn(e,t){return typeof e=="function"?e(...t):!!e}function Os(e,t,n){let s=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),s||(s=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var it=(()=>{let e=()=>Ps;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ht(){let e,t;const n=new Promise((i,r)=>{e=i,t=r});n.status="pending",n.catch(()=>{});function s(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{s({status:"fulfilled",value:i}),e(i)},n.reject=i=>{s({status:"rejected",reason:i}),t(i)},n}var Vs=_s;function Ds(){let e=[],t=0,n=l=>{l()},s=l=>{l()},i=Vs;const r=l=>{t?e.push(l):i(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&i(()=>{s(()=>{l.forEach(a=>{n(a)})})})};return{batch:l=>{let a;t++;try{a=l()}finally{t--,t||o()}return a},batchCalls:l=>(...a)=>{r(()=>{l(...a)})},schedule:r,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{s=l},setScheduler:l=>{i=l}}}var D=Ds(),Te,fe,ze,bn,As=(bn=class extends Le{constructor(){super();y(this,Te,!0);y(this,fe);y(this,ze);v(this,ze,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}}})}onSubscribe(){u(this,fe)||this.setEventListener(u(this,ze))}onUnsubscribe(){var t;this.hasListeners()||((t=u(this,fe))==null||t.call(this),v(this,fe,void 0))}setEventListener(t){var n;v(this,ze,t),(n=u(this,fe))==null||n.call(this),v(this,fe,t(this.setOnline.bind(this)))}setOnline(t){u(this,Te)!==t&&(v(this,Te,t),this.listeners.forEach(s=>{s(t)}))}isOnline(){return u(this,Te)}},Te=new WeakMap,fe=new WeakMap,ze=new WeakMap,bn),Ft=new As;function bs(e){return Math.min(1e3*2**e,3e4)}function Nn(e){return(e??"online")==="online"?Ft.isOnline():!0}var Lt=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Kn(e){let t=!1,n=0,s;const i=Ht(),r=()=>i.status!=="pending",o=p=>{var C;if(!r()){const S=new Lt(p);f(S),(C=e.onCancel)==null||C.call(e,S)}},l=()=>{t=!0},a=()=>{t=!1},d=()=>un.isFocused()&&(e.networkMode==="always"||Ft.isOnline())&&e.canRun(),h=()=>Nn(e.networkMode)&&e.canRun(),g=p=>{r()||(s==null||s(),i.resolve(p))},f=p=>{r()||(s==null||s(),i.reject(p))},c=()=>new Promise(p=>{var C;s=S=>{(r()||d())&&p(S)},(C=e.onPause)==null||C.call(e)}).then(()=>{var p;s=void 0,r()||(p=e.onContinue)==null||p.call(e)}),m=()=>{if(r())return;let p;const C=n===0?e.initialPromise:void 0;try{p=C??e.fn()}catch(S){p=Promise.reject(S)}Promise.resolve(p).then(g).catch(S=>{var A;if(r())return;const M=e.retry??(it.isServer()?0:3),P=e.retryDelay??bs,R=typeof P=="function"?P(n,S):P,x=M===!0||typeof M=="number"&&n<M||typeof M=="function"&&M(n,S);if(t||!x){f(S);return}n++,(A=e.onFail)==null||A.call(e,n,S),xs(R).then(()=>d()?void 0:c()).then(()=>{t?f(S):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(s==null||s(),i),cancelRetry:l,continueRetry:a,canStart:h,start:()=>(h()?m():c().then(m),i)}}var Ie,Hn,Xn=(Hn=class{constructor(){y(this,Ie)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Dt(this.gcTime)&&v(this,Ie,Pe.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(it.isServer()?1/0:5*60*1e3))}clearGcTimeout(){u(this,Ie)!==void 0&&(Pe.clearTimeout(u(this,Ie)),v(this,Ie,void 0))}},Ie=new WeakMap,Hn);function Hs(e){return{onFetch:(t,n)=>{var h,g,f,c,m;const s=t.options,i=(f=(g=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:g.fetchMore)==null?void 0:f.direction,r=((c=t.state.data)==null?void 0:c.pages)||[],o=((m=t.state.data)==null?void 0:m.pageParams)||[];let l={pages:[],pageParams:[]},a=0;const d=async()=>{let p=!1;const C=P=>{Os(P,()=>t.signal,()=>p=!0)},S=Bn(t.options,t.fetchOptions),M=async(P,R,x)=>{if(p)return Promise.reject(t.signal.reason);if(R==null&&P.pages.length)return Promise.resolve(P);const J=(()=>{const Z={client:t.client,queryKey:t.queryKey,pageParam:R,direction:x?"backward":"forward",meta:t.options.meta};return C(Z),Z})(),$=await S(J),{maxPages:b}=t.options,G=x?$s:Es;return{pages:G(P.pages,$,b),pageParams:G(P.pageParams,R,b)}};if(i&&r.length){const P=i==="backward",R=P?Ls:Pn,x={pages:r,pageParams:o},A=R(s,x);l=await M(x,A,P)}else{const P=e??r.length;do{const R=a===0?o[0]??s.initialPageParam:Pn(s,l);if(a>0&&R==null)break;l=await M(l,R),a++}while(a<P)}return l};t.options.persister?t.fetchFn=()=>{var p,C;return(C=(p=t.options).persister)==null?void 0:C.call(p,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function Pn(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function Ls(e,{pages:t,pageParams:n}){var s;return t.length>0?(s=e.getPreviousPageParam)==null?void 0:s.call(e,t[0],t,n[0],n):void 0}var Qe,xe,qe,W,Ee,L,rt,$e,N,Wn,ie,Ln,Gs=(Ln=class extends Xn{constructor(t){super();y(this,N);y(this,Qe);y(this,xe);y(this,qe);y(this,W);y(this,Ee);y(this,L);y(this,rt);y(this,$e);v(this,$e,!1),v(this,rt,t.defaultOptions),this.setOptions(t.options),this.observers=[],v(this,Ee,t.client),v(this,W,u(this,Ee).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,v(this,xe,In(this.options)),this.state=t.state??u(this,xe),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return u(this,Qe)}get promise(){var t;return(t=u(this,L))==null?void 0:t.promise}setOptions(t){if(this.options={...u(this,rt),...t},t!=null&&t._type&&v(this,Qe,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=In(this.options);n.data!==void 0&&(this.setState(Mn(n.data,n.dataUpdatedAt)),v(this,xe,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&u(this,W).remove(this)}setData(t,n){const s=bt(this.state.data,t,this.options);return w(this,N,ie).call(this,{data:s,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),s}setState(t){w(this,N,ie).call(this,{type:"setState",state:t})}cancel(t){var s,i;const n=(s=u(this,L))==null?void 0:s.promise;return(i=u(this,L))==null||i.cancel(t),n?n.then(Q).catch(Q):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return u(this,xe)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>K(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===cn||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Fe(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!kn(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(s=>s.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=u(this,L))==null||n.continue()}onOnline(){var n;const t=this.observers.find(s=>s.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=u(this,L))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),u(this,W).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(u(this,L)&&(u(this,$e)||w(this,N,Wn).call(this)?u(this,L).cancel({revert:!0}):u(this,L).cancelRetry()),this.scheduleGc()),u(this,W).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||w(this,N,ie).call(this,{type:"invalidate"})}async fetch(t,n){var d,h,g,f,c,m,p,C,S,M,P;if(this.state.fetchStatus!=="idle"&&((d=u(this,L))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(u(this,L))return u(this,L).continueRetry(),u(this,L).promise}if(t&&this.setOptions(t),!this.options.queryFn){const R=this.observers.find(x=>x.options.queryFn);R&&this.setOptions(R.options)}const s=new AbortController,i=R=>{Object.defineProperty(R,"signal",{enumerable:!0,get:()=>(v(this,$e,!0),s.signal)})},r=()=>{const R=Bn(this.options,n),A=(()=>{const J={client:u(this,Ee),queryKey:this.queryKey,meta:this.meta};return i(J),J})();return v(this,$e,!1),this.options.persister?this.options.persister(R,A,this):R(A)},l=(()=>{const R={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:u(this,Ee),state:this.state,fetchFn:r};return i(R),R})(),a=u(this,Qe)==="infinite"?Hs(this.options.pages):this.options.behavior;a==null||a.onFetch(l,this),v(this,qe,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=l.fetchOptions)==null?void 0:h.meta))&&w(this,N,ie).call(this,{type:"fetch",meta:(g=l.fetchOptions)==null?void 0:g.meta}),v(this,L,Kn({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:R=>{R instanceof Lt&&R.revert&&this.setState({...u(this,qe),fetchStatus:"idle"}),s.abort()},onFail:(R,x)=>{w(this,N,ie).call(this,{type:"failed",failureCount:R,error:x})},onPause:()=>{w(this,N,ie).call(this,{type:"pause"})},onContinue:()=>{w(this,N,ie).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const R=await u(this,L).start();if(R===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(R),(c=(f=u(this,W).config).onSuccess)==null||c.call(f,R,this),(p=(m=u(this,W).config).onSettled)==null||p.call(m,R,this.state.error,this),R}catch(R){if(R instanceof Lt){if(R.silent)return u(this,L).promise;if(R.revert){if(this.state.data===void 0)throw R;return this.state.data}}throw w(this,N,ie).call(this,{type:"error",error:R}),(S=(C=u(this,W).config).onError)==null||S.call(C,R,this),(P=(M=u(this,W).config).onSettled)==null||P.call(M,this.state.data,R,this),R}finally{this.scheduleGc()}}},Qe=new WeakMap,xe=new WeakMap,qe=new WeakMap,W=new WeakMap,Ee=new WeakMap,L=new WeakMap,rt=new WeakMap,$e=new WeakMap,N=new WeakSet,Wn=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ie=function(t){const n=s=>{switch(t.type){case"failed":return{...s,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...Jn(s.data,this.options),fetchMeta:t.meta??null};case"success":const i={...s,...Mn(t.data,t.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return v(this,qe,t.manual?i:void 0),i;case"error":const r=t.error;return{...s,error:r,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...t.state}}};this.state=n(this.state),D.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),u(this,W).notify({query:this,type:"updated",action:t})})},Ln);function Jn(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Nn(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Mn(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function In(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var U,I,ot,q,Oe,Ue,oe,pe,ut,je,ke,Ve,De,me,Be,E,et,Gt,Tt,zt,Qt,qt,Ut,jt,Zn,Gn,gn=(Gn=class extends Le{constructor(t,n){super();y(this,E);y(this,U);y(this,I);y(this,ot);y(this,q);y(this,Oe);y(this,Ue);y(this,oe);y(this,pe);y(this,ut);y(this,je);y(this,ke);y(this,Ve);y(this,De);y(this,me);y(this,Be,new Set);this.options=n,v(this,U,t),v(this,pe,null),v(this,oe,Ht()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(u(this,I).addObserver(this),xn(u(this,I),this.options)?w(this,E,et).call(this):this.updateResult(),w(this,E,Qt).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return kt(u(this,I),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return kt(u(this,I),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,w(this,E,qt).call(this),w(this,E,Ut).call(this),u(this,I).removeObserver(this)}setOptions(t){const n=this.options,s=u(this,I);if(this.options=u(this,U).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof K(this.options.enabled,u(this,I))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");w(this,E,jt).call(this),u(this,I).setOptions(this.options),n._defaulted&&!st(this.options,n)&&u(this,U).getQueryCache().notify({type:"observerOptionsUpdated",query:u(this,I),observer:this});const i=this.hasListeners();i&&En(u(this,I),s,this.options,n)&&w(this,E,et).call(this),this.updateResult(),i&&(u(this,I)!==s||K(this.options.enabled,u(this,I))!==K(n.enabled,u(this,I))||Fe(this.options.staleTime,u(this,I))!==Fe(n.staleTime,u(this,I)))&&w(this,E,Gt).call(this);const r=w(this,E,Tt).call(this);i&&(u(this,I)!==s||K(this.options.enabled,u(this,I))!==K(n.enabled,u(this,I))||r!==u(this,me))&&w(this,E,zt).call(this,r)}getOptimisticResult(t){const n=u(this,U).getQueryCache().build(u(this,U),t),s=this.createResult(n,t);return zs(this,s)&&(v(this,q,s),v(this,Ue,this.options),v(this,Oe,u(this,I).state)),s}getCurrentResult(){return u(this,q)}trackResult(t,n){return new Proxy(t,{get:(s,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&u(this,oe).status==="pending"&&u(this,oe).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,i))})}trackProp(t){u(this,Be).add(t)}getCurrentQuery(){return u(this,I)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=u(this,U).defaultQueryOptions(t),s=u(this,U).getQueryCache().build(u(this,U),n);return s.fetch().then(()=>this.createResult(s,n))}fetch(t){return w(this,E,et).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),u(this,q)))}createResult(t,n){var b;const s=u(this,I),i=this.options,r=u(this,q),o=u(this,Oe),l=u(this,Ue),d=t!==s?t.state:u(this,ot),{state:h}=t;let g={...h},f=!1,c;if(n._optimisticResults){const G=this.hasListeners(),Z=!G&&xn(t,n),ft=G&&En(t,s,n,i);(Z||ft)&&(g={...g,...Jn(h.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:m,errorUpdatedAt:p,status:C}=g;c=g.data;let S=!1;if(n.placeholderData!==void 0&&c===void 0&&C==="pending"){let G;r!=null&&r.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(G=r.data,S=!0):G=typeof n.placeholderData=="function"?n.placeholderData((b=u(this,ke))==null?void 0:b.state.data,u(this,ke)):n.placeholderData,G!==void 0&&(C="success",c=bt(r==null?void 0:r.data,G,n),f=!0)}if(n.select&&c!==void 0&&!S)if(r&&c===(o==null?void 0:o.data)&&n.select===u(this,ut))c=u(this,je);else try{v(this,ut,n.select),c=n.select(c),c=bt(r==null?void 0:r.data,c,n),v(this,je,c),v(this,pe,null)}catch(G){v(this,pe,G)}u(this,pe)&&(m=u(this,pe),c=u(this,je),p=Date.now(),C="error");const M=g.fetchStatus==="fetching",P=C==="pending",R=C==="error",x=P&&M,A=c!==void 0,$={status:C,fetchStatus:g.fetchStatus,isPending:P,isSuccess:C==="success",isError:R,isInitialLoading:x,isLoading:x,data:c,dataUpdatedAt:g.dataUpdatedAt,error:m,errorUpdatedAt:p,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:g.dataUpdateCount>d.dataUpdateCount||g.errorUpdateCount>d.errorUpdateCount,isFetching:M,isRefetching:M&&!P,isLoadingError:R&&!A,isPaused:g.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:R&&A,isStale:hn(t,n),refetch:this.refetch,promise:u(this,oe),isEnabled:K(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const G=$.data!==void 0,Z=$.status==="error"&&!G,ft=mt=>{Z?mt.reject($.error):G&&mt.resolve($.data)},Sn=()=>{const mt=v(this,oe,$.promise=Ht());ft(mt)},pt=u(this,oe);switch(pt.status){case"pending":t.queryHash===s.queryHash&&ft(pt);break;case"fulfilled":(Z||$.data!==pt.value)&&Sn();break;case"rejected":(!Z||$.error!==pt.reason)&&Sn();break}}return $}updateResult(){const t=u(this,q),n=this.createResult(u(this,I),this.options);if(v(this,Oe,u(this,I).state),v(this,Ue,this.options),u(this,Oe).data!==void 0&&v(this,ke,u(this,I)),st(n,t))return;v(this,q,n);const s=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,r=typeof i=="function"?i():i;if(r==="all"||!r&&!u(this,Be).size)return!0;const o=new Set(r??u(this,Be));return this.options.throwOnError&&o.add("error"),Object.keys(u(this,q)).some(l=>{const a=l;return u(this,q)[a]!==t[a]&&o.has(a)})};w(this,E,Zn).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&w(this,E,Qt).call(this)}},U=new WeakMap,I=new WeakMap,ot=new WeakMap,q=new WeakMap,Oe=new WeakMap,Ue=new WeakMap,oe=new WeakMap,pe=new WeakMap,ut=new WeakMap,je=new WeakMap,ke=new WeakMap,Ve=new WeakMap,De=new WeakMap,me=new WeakMap,Be=new WeakMap,E=new WeakSet,et=function(t){w(this,E,jt).call(this);let n=u(this,I).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Q)),n},Gt=function(){w(this,E,qt).call(this);const t=Fe(this.options.staleTime,u(this,I));if(it.isServer()||u(this,q).isStale||!Dt(t))return;const s=kn(u(this,q).dataUpdatedAt,t)+1;v(this,Ve,Pe.setTimeout(()=>{u(this,q).isStale||this.updateResult()},s))},Tt=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(u(this,I)):this.options.refetchInterval)??!1},zt=function(t){w(this,E,Ut).call(this),v(this,me,t),!(it.isServer()||K(this.options.enabled,u(this,I))===!1||!Dt(u(this,me))||u(this,me)===0)&&v(this,De,Pe.setInterval(()=>{(this.options.refetchIntervalInBackground||un.isFocused())&&w(this,E,et).call(this)},u(this,me)))},Qt=function(){w(this,E,Gt).call(this),w(this,E,zt).call(this,w(this,E,Tt).call(this))},qt=function(){u(this,Ve)!==void 0&&(Pe.clearTimeout(u(this,Ve)),v(this,Ve,void 0))},Ut=function(){u(this,De)!==void 0&&(Pe.clearInterval(u(this,De)),v(this,De,void 0))},jt=function(){const t=u(this,U).getQueryCache().build(u(this,U),this.options);if(t===u(this,I))return;const n=u(this,I);v(this,I,t),v(this,ot,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Zn=function(t){D.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(u(this,q))}),u(this,U).getQueryCache().notify({query:u(this,I),type:"observerResultsUpdated"})})},Gn);function Ts(e,t){return K(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&K(t.retryOnMount,e)===!1)}function xn(e,t){return Ts(e,t)||e.state.data!==void 0&&kt(e,t,t.refetchOnMount)}function kt(e,t,n){if(K(t.enabled,e)!==!1&&Fe(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&hn(e,t)}return!1}function En(e,t,n,s){return(e!==t||K(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&hn(e,n)}function hn(e,t){return K(t.enabled,e)!==!1&&e.isStaleByTime(Fe(t.staleTime,e))}function zs(e,t){return!st(e.getCurrentResult(),t)}var lt,te,z,Ae,ne,de,Tn,Qs=(Tn=class extends Xn{constructor(t){super();y(this,ne);y(this,lt);y(this,te);y(this,z);y(this,Ae);v(this,lt,t.client),this.mutationId=t.mutationId,v(this,z,t.mutationCache),v(this,te,[]),this.state=t.state||Yn(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){u(this,te).includes(t)||(u(this,te).push(t),this.clearGcTimeout(),u(this,z).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){v(this,te,u(this,te).filter(n=>n!==t)),this.scheduleGc(),u(this,z).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){u(this,te).length||(this.state.status==="pending"?this.scheduleGc():u(this,z).remove(this))}continue(){var t;return((t=u(this,Ae))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,a,d,h,g,f,c,m,p,C,S,M,P,R,x,A,J;const n=()=>{w(this,ne,de).call(this,{type:"continue"})},s={client:u(this,lt),meta:this.options.meta,mutationKey:this.options.mutationKey};v(this,Ae,Kn({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(new Error("No mutationFn found")),onFail:($,b)=>{w(this,ne,de).call(this,{type:"failed",failureCount:$,error:b})},onPause:()=>{w(this,ne,de).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>u(this,z).canRun(this)}));const i=this.state.status==="pending",r=!u(this,Ae).canStart();try{if(i)n();else{w(this,ne,de).call(this,{type:"pending",variables:t,isPaused:r}),u(this,z).config.onMutate&&await u(this,z).config.onMutate(t,this,s);const b=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t,s));b!==this.state.context&&w(this,ne,de).call(this,{type:"pending",context:b,variables:t,isPaused:r})}const $=await u(this,Ae).start();return await((d=(a=u(this,z).config).onSuccess)==null?void 0:d.call(a,$,t,this.state.context,this,s)),await((g=(h=this.options).onSuccess)==null?void 0:g.call(h,$,t,this.state.context,s)),await((c=(f=u(this,z).config).onSettled)==null?void 0:c.call(f,$,null,this.state.variables,this.state.context,this,s)),await((p=(m=this.options).onSettled)==null?void 0:p.call(m,$,null,t,this.state.context,s)),w(this,ne,de).call(this,{type:"success",data:$}),$}catch($){try{await((S=(C=u(this,z).config).onError)==null?void 0:S.call(C,$,t,this.state.context,this,s))}catch(b){Promise.reject(b)}try{await((P=(M=this.options).onError)==null?void 0:P.call(M,$,t,this.state.context,s))}catch(b){Promise.reject(b)}try{await((x=(R=u(this,z).config).onSettled)==null?void 0:x.call(R,void 0,$,this.state.variables,this.state.context,this,s))}catch(b){Promise.reject(b)}try{await((J=(A=this.options).onSettled)==null?void 0:J.call(A,void 0,$,t,this.state.context,s))}catch(b){Promise.reject(b)}throw w(this,ne,de).call(this,{type:"error",error:$}),$}finally{u(this,z).runNext(this)}}},lt=new WeakMap,te=new WeakMap,z=new WeakMap,Ae=new WeakMap,ne=new WeakSet,de=function(t){const n=s=>{switch(t.type){case"failed":return{...s,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...s,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:t.error,failureCount:s.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),D.batch(()=>{u(this,te).forEach(s=>{s.onMutationUpdate(t)}),u(this,z).notify({mutation:this,type:"updated",action:t})})},Tn);function Yn(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ue,Y,at,zn,qs=(zn=class extends Le{constructor(t={}){super();y(this,ue);y(this,Y);y(this,at);this.config=t,v(this,ue,new Set),v(this,Y,new Map),v(this,at,0)}build(t,n,s){const i=new Qs({client:t,mutationCache:this,mutationId:++vt(this,at)._,options:t.defaultMutationOptions(n),state:s});return this.add(i),i}add(t){u(this,ue).add(t);const n=St(t);if(typeof n=="string"){const s=u(this,Y).get(n);s?s.push(t):u(this,Y).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(u(this,ue).delete(t)){const n=St(t);if(typeof n=="string"){const s=u(this,Y).get(n);if(s)if(s.length>1){const i=s.indexOf(t);i!==-1&&s.splice(i,1)}else s[0]===t&&u(this,Y).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=St(t);if(typeof n=="string"){const s=u(this,Y).get(n),i=s==null?void 0:s.find(r=>r.state.status==="pending");return!i||i===t}else return!0}runNext(t){var s;const n=St(t);if(typeof n=="string"){const i=(s=u(this,Y).get(n))==null?void 0:s.find(r=>r!==t&&r.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){D.batch(()=>{u(this,ue).forEach(t=>{this.notify({type:"removed",mutation:t})}),u(this,ue).clear(),u(this,Y).clear()})}getAll(){return Array.from(u(this,ue))}find(t){const n={exact:!0,...t};return this.getAll().find(s=>wn(n,s))}findAll(t={}){return this.getAll().filter(n=>wn(t,n))}notify(t){D.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return D.batch(()=>Promise.all(t.map(n=>n.continue().catch(Q))))}},ue=new WeakMap,Y=new WeakMap,at=new WeakMap,zn);function St(e){var t;return(t=e.options.scope)==null?void 0:t.id}var le,ve,j,ae,ce,wt,Bt,Qn,Us=(Qn=class extends Le{constructor(n,s){super();y(this,ce);y(this,le);y(this,ve);y(this,j);y(this,ae);v(this,le,n),this.setOptions(s),this.bindMethods(),w(this,ce,wt).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const s=this.options;this.options=u(this,le).defaultMutationOptions(n),st(this.options,s)||u(this,le).getMutationCache().notify({type:"observerOptionsUpdated",mutation:u(this,j),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&He(s.mutationKey)!==He(this.options.mutationKey)?this.reset():((i=u(this,j))==null?void 0:i.state.status)==="pending"&&u(this,j).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=u(this,j))==null||n.removeObserver(this)}onMutationUpdate(n){w(this,ce,wt).call(this),w(this,ce,Bt).call(this,n)}getCurrentResult(){return u(this,ve)}reset(){var n;(n=u(this,j))==null||n.removeObserver(this),v(this,j,void 0),w(this,ce,wt).call(this),w(this,ce,Bt).call(this)}mutate(n,s){var i;return v(this,ae,s),(i=u(this,j))==null||i.removeObserver(this),v(this,j,u(this,le).getMutationCache().build(u(this,le),this.options)),u(this,j).addObserver(this),u(this,j).execute(n)}},le=new WeakMap,ve=new WeakMap,j=new WeakMap,ae=new WeakMap,ce=new WeakSet,wt=function(){var s;const n=((s=u(this,j))==null?void 0:s.state)??Yn();v(this,ve,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Bt=function(n){D.batch(()=>{var s,i,r,o,l,a,d,h;if(u(this,ae)&&this.hasListeners()){const g=u(this,ve).variables,f=u(this,ve).context,c={client:u(this,le),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(s=u(this,ae)).onSuccess)==null||i.call(s,n.data,g,f,c)}catch(m){Promise.reject(m)}try{(o=(r=u(this,ae)).onSettled)==null||o.call(r,n.data,null,g,f,c)}catch(m){Promise.reject(m)}}else if((n==null?void 0:n.type)==="error"){try{(a=(l=u(this,ae)).onError)==null||a.call(l,n.error,g,f,c)}catch(m){Promise.reject(m)}try{(h=(d=u(this,ae)).onSettled)==null||h.call(d,void 0,n.error,g,f,c)}catch(m){Promise.reject(m)}}}this.listeners.forEach(g=>{g(u(this,ve))})})},Qn);function $n(e,t){const n=new Set(t);return e.filter(s=>!n.has(s))}function js(e,t,n){const s=e.slice(0);return s[t]=n,s}var Ne,k,Ke,be,B,Se,ct,dt,gt,ht,H,Nt,Kt,es,Xt,Wt,Jt,qn,ks=(qn=class extends Le{constructor(t,n,s){super();y(this,H);y(this,Ne);y(this,k);y(this,Ke);y(this,be);y(this,B);y(this,Se);y(this,ct);y(this,dt);y(this,gt);y(this,ht,[]);v(this,Ne,t),v(this,be,s),v(this,Ke,[]),v(this,B,[]),v(this,k,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&u(this,B).forEach(t=>{t.subscribe(n=>{w(this,H,Wt).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,u(this,B).forEach(t=>{t.destroy()})}setQueries(t,n){v(this,Ke,t),v(this,be,n),D.batch(()=>{const s=u(this,B),i=w(this,H,Xt).call(this,u(this,Ke));i.forEach(g=>g.observer.setOptions(g.defaultedQueryOptions));const r=i.map(g=>g.observer),o=r.map(g=>g.getCurrentResult()),l=s.length!==r.length,a=r.some((g,f)=>g!==s[f]),d=l||a,h=d?!0:o.some((g,f)=>{const c=u(this,k)[f];return!c||!st(g,c)});!d&&!h||(d&&(v(this,ht,i),v(this,B,r)),v(this,k,o),this.hasListeners()&&(d&&($n(s,r).forEach(g=>{g.destroy()}),$n(r,s).forEach(g=>{g.subscribe(f=>{w(this,H,Wt).call(this,g,f)})})),w(this,H,Jt).call(this)))})}getCurrentResult(){return u(this,k)}getQueries(){return u(this,B).map(t=>t.getCurrentQuery())}getObservers(){return u(this,B)}getOptimisticResult(t,n){const s=w(this,H,Xt).call(this,t),i=s.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),r=s.map(o=>o.defaultedQueryOptions.queryHash);return[i,o=>w(this,H,Kt).call(this,o??i,n,r),()=>w(this,H,Nt).call(this,i,s)]}},Ne=new WeakMap,k=new WeakMap,Ke=new WeakMap,be=new WeakMap,B=new WeakMap,Se=new WeakMap,ct=new WeakMap,dt=new WeakMap,gt=new WeakMap,ht=new WeakMap,H=new WeakSet,Nt=function(t,n){return n.map((s,i)=>{const r=t[i];return s.defaultedQueryOptions.notifyOnChangeProps?r:s.observer.trackResult(r,o=>{n.forEach(l=>{l.observer.trackProp(o)})})})},Kt=function(t,n,s){if(n){const i=u(this,gt),r=s!==void 0&&i!==void 0&&(i.length!==s.length||s.some((o,l)=>o!==i[l]));return(!u(this,Se)||u(this,k)!==u(this,dt)||r||n!==u(this,ct))&&(v(this,ct,n),v(this,dt,u(this,k)),s!==void 0&&v(this,gt,s),v(this,Se,an(u(this,Se),n(t)))),u(this,Se)}return t},es=function(){var t;return((t=u(this,be))==null?void 0:t.combine)!==void 0&&u(this,B).some((n,s)=>{var i;return n.options.suspense&&((i=u(this,k)[s])==null?void 0:i.data)===void 0})},Xt=function(t){const n=new Map;u(this,B).forEach(i=>{const r=i.options.queryHash;if(!r)return;const o=n.get(r);o?o.push(i):n.set(r,[i])});const s=[];return t.forEach(i=>{var a;const r=u(this,Ne).defaultQueryOptions(i),l=((a=n.get(r.queryHash))==null?void 0:a.shift())??new gn(u(this,Ne),r);s.push({defaultedQueryOptions:r,observer:l})}),s},Wt=function(t,n){const s=u(this,B).indexOf(t);s!==-1&&(v(this,k,js(u(this,k),s,n)),w(this,H,Jt).call(this))},Jt=function(){var t;if(this.hasListeners()){const n=w(this,H,Nt).call(this,u(this,k),u(this,ht)),s=w(this,H,es).call(this),i=u(this,Se),r=s?i:w(this,H,Kt).call(this,n,(t=u(this,be))==null?void 0:t.combine);(s||i!==r)&&D.batch(()=>{this.listeners.forEach(o=>{o(u(this,k))})})}},qn),se,Un,Bs=(Un=class extends Le{constructor(t={}){super();y(this,se);this.config=t,v(this,se,new Map)}build(t,n,s){const i=n.queryKey,r=n.queryHash??ln(i,n);let o=this.get(r);return o||(o=new Gs({client:t,queryKey:i,queryHash:r,options:t.defaultQueryOptions(n),state:s,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){u(this,se).has(t.queryHash)||(u(this,se).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=u(this,se).get(t.queryHash);n&&(t.destroy(),n===t&&u(this,se).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){D.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return u(this,se).get(t)}getAll(){return[...u(this,se).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(s=>Rn(n,s))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(s=>Rn(t,s)):n}notify(t){D.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){D.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){D.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},se=new WeakMap,Un),V,Ce,ye,Xe,We,Re,Je,Ze,jn,ki=(jn=class{constructor(e={}){y(this,V);y(this,Ce);y(this,ye);y(this,Xe);y(this,We);y(this,Re);y(this,Je);y(this,Ze);v(this,V,e.queryCache||new Bs),v(this,Ce,e.mutationCache||new qs),v(this,ye,e.defaultOptions||{}),v(this,Xe,new Map),v(this,We,new Map),v(this,Re,0)}mount(){vt(this,Re)._++,u(this,Re)===1&&(v(this,Je,un.subscribe(async e=>{e&&(await this.resumePausedMutations(),u(this,V).onFocus())})),v(this,Ze,Ft.subscribe(async e=>{e&&(await this.resumePausedMutations(),u(this,V).onOnline())})))}unmount(){var e,t;vt(this,Re)._--,u(this,Re)===0&&((e=u(this,Je))==null||e.call(this),v(this,Je,void 0),(t=u(this,Ze))==null||t.call(this),v(this,Ze,void 0))}isFetching(e){return u(this,V).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return u(this,Ce).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=u(this,V).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=u(this,V).build(this,t),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Fe(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return u(this,V).findAll(e).map(({queryKey:t,state:n})=>{const s=n.data;return[t,s]})}setQueryData(e,t,n){const s=this.defaultQueryOptions({queryKey:e}),i=u(this,V).get(s.queryHash),r=i==null?void 0:i.state.data,o=Ms(t,r);if(o!==void 0)return u(this,V).build(this,s).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return D.batch(()=>u(this,V).findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=u(this,V).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=u(this,V);D.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=u(this,V);return D.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=D.batch(()=>u(this,V).findAll(e).map(i=>i.cancel(n)));return Promise.all(s).then(Q).catch(Q)}invalidateQueries(e,t={}){return D.batch(()=>(u(this,V).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},s=D.batch(()=>u(this,V).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let r=i.fetch(void 0,n);return n.throwOnError||(r=r.catch(Q)),i.state.fetchStatus==="paused"?Promise.resolve():r}));return Promise.all(s).then(Q)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=u(this,V).build(this,t);return n.isStaleByTime(Fe(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Q).catch(Q)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Q).catch(Q)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Ft.isOnline()?u(this,Ce).resumePausedMutations():Promise.resolve()}getQueryCache(){return u(this,V)}getMutationCache(){return u(this,Ce)}getDefaultOptions(){return u(this,ye)}setDefaultOptions(e){v(this,ye,e)}setQueryDefaults(e,t){u(this,Xe).set(He(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...u(this,Xe).values()],n={};return t.forEach(s=>{nt(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){u(this,We).set(He(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...u(this,We).values()],n={};return t.forEach(s=>{nt(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...u(this,ye).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ln(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===cn&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...u(this,ye).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){u(this,V).clear(),u(this,Ce).clear()}},V=new WeakMap,Ce=new WeakMap,ye=new WeakMap,Xe=new WeakMap,We=new WeakMap,Re=new WeakMap,Je=new WeakMap,Ze=new WeakMap,jn),ts=O.createContext(void 0),fn=e=>{const t=O.useContext(ts);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Bi=({client:e,children:t})=>(O.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),Ss.jsx(ts.Provider,{value:e,children:t})),ns=O.createContext(!1),ss=()=>O.useContext(ns);ns.Provider;function Ns(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ks=O.createContext(Ns()),is=()=>O.useContext(Ks),rs=(e,t,n)=>{const s=n!=null&&n.state.error&&typeof e.throwOnError=="function"?dn(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))},os=e=>{O.useEffect(()=>{e.clearReset()},[e])},us=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&e.data===void 0||dn(n,[e.error,s])),ls=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...i)=>n(s(...i)):n(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Xs=(e,t)=>e.isLoading&&e.isFetching&&!t,Zt=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Yt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ni({queries:e,...t},n){const s=fn(),i=ss(),r=is(),o=O.useMemo(()=>e.map(p=>{const C=s.defaultQueryOptions(p);return C._optimisticResults=i?"isRestoring":"optimistic",C}),[e,s,i]);o.forEach(p=>{ls(p);const C=s.getQueryCache().get(p.queryHash);rs(p,r,C)}),os(r);const[l]=O.useState(()=>new ks(s,o,t)),[a,d,h]=l.getOptimisticResult(o,t.combine),g=!i&&t.subscribed!==!1;O.useSyncExternalStore(O.useCallback(p=>g?l.subscribe(D.batchCalls(p)):Q,[l,g]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),O.useEffect(()=>{l.setQueries(o,t)},[o,t,l]);const c=a.some((p,C)=>Zt(o[C],p))?a.flatMap((p,C)=>{const S=o[C];if(S&&Zt(S,p)){const M=new gn(s,S);return Yt(S,M,r)}return[]}):[];if(c.length>0)throw Promise.all(c);const m=a.find((p,C)=>{const S=o[C];return S&&us({result:p,errorResetBoundary:r,throwOnError:S.throwOnError,query:s.getQueryCache().get(S.queryHash),suspense:S.suspense})});if(m!=null&&m.error)throw m.error;return d(h())}function Ws(e,t,n){var c,m,p,C;const s=ss(),i=is(),r=fn(),o=r.defaultQueryOptions(e);(m=(c=r.getDefaultOptions().queries)==null?void 0:c._experimental_beforeQuery)==null||m.call(c,o);const l=r.getQueryCache().get(o.queryHash),a=e.subscribed!==!1;o._optimisticResults=s?"isRestoring":a?"optimistic":void 0,ls(o),rs(o,i,l),os(i);const d=!r.getQueryCache().get(o.queryHash),[h]=O.useState(()=>new t(r,o)),g=h.getOptimisticResult(o),f=!s&&a;if(O.useSyncExternalStore(O.useCallback(S=>{const M=f?h.subscribe(D.batchCalls(S)):Q;return h.updateResult(),M},[h,f]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),O.useEffect(()=>{h.setOptions(o)},[o,h]),Zt(o,g))throw Yt(o,h,i);if(us({result:g,errorResetBoundary:i,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw g.error;if((C=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||C.call(p,o,g),o.experimental_prefetchInRender&&!it.isServer()&&Xs(g,s)){const S=d?Yt(o,h,i):l==null?void 0:l.promise;S==null||S.catch(Q).finally(()=>{h.updateResult()})}return o.notifyOnChangeProps?g:h.trackResult(g)}function Ki(e,t){return Ws(e,gn)}function Xi(e,t){const n=fn(),[s]=O.useState(()=>new Us(n,e));O.useEffect(()=>{s.setOptions(e)},[s,e]);const i=O.useSyncExternalStore(O.useCallback(o=>s.subscribe(D.batchCalls(o)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),r=O.useCallback((o,l)=>{s.mutate(o,l).catch(Q)},[s]);if(i.error&&dn(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:r,mutateAsync:i.mutate}}/**
* table-core
*
* Copyright (c) TanStack
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function we(e,t){return typeof e=="function"?e(t):e}function X(e,t){return n=>{t.setState(s=>({...s,[e]:we(n,s[e])}))}}function _t(e){return e instanceof Function}function Js(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Zs(e,t){const n=[],s=i=>{i.forEach(r=>{n.push(r);const o=t(r);o!=null&&o.length&&s(o)})};return s(e),n}function F(e,t,n){let s=[],i;return r=>{let o;n.key&&n.debug&&(o=Date.now());const l=e(r);if(!(l.length!==s.length||l.some((h,g)=>s[g]!==h)))return i;s=l;let d;if(n.key&&n.debug&&(d=Date.now()),i=t(...l),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const h=Math.round((Date.now()-o)*100)/100,g=Math.round((Date.now()-d)*100)/100,f=g/16,c=(m,p)=>{for(m=String(m);m.length<p;)m=" "+m;return m};console.info(`%cвЏ± ${c(g,5)} /${c(h,5)} ms`,`
font-size: .6rem;
font-weight: bold;
color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return i}}function _(e,t,n,s){return{debug:()=>{var i;return(i=e==null?void 0:e.debugAll)!=null?i:e[t]},key:!1,onChange:s}}function Ys(e,t,n,s){const i=()=>{var o;return(o=r.getValue())!=null?o:e.options.renderFallbackValue},r={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(s),renderValue:i,getContext:F(()=>[e,n,t,r],(o,l,a,d)=>({table:o,column:l,row:a,cell:d,getValue:d.getValue,renderValue:d.renderValue}),_(e.options,"debugCells"))};return e._features.forEach(o=>{o.createCell==null||o.createCell(r,n,t,e)},{}),r}function ei(e,t,n,s){var i,r;const l={...e._getDefaultColumnDef(),...t},a=l.accessorKey;let d=(i=(r=l.id)!=null?r:a?typeof String.prototype.replaceAll=="function"?a.replaceAll(".","_"):a.replace(/\./g,"_"):void 0)!=null?i:typeof l.header=="string"?l.header:void 0,h;if(l.accessorFn?h=l.accessorFn:a&&(a.includes(".")?h=f=>{let c=f;for(const p of a.split(".")){var m;c=(m=c)==null?void 0:m[p]}return c}:h=f=>f[l.accessorKey]),!d)throw new Error;let g={id:`${String(d)}`,accessorFn:h,parent:s,depth:n,columnDef:l,columns:[],getFlatColumns:F(()=>[!0],()=>{var f;return[g,...(f=g.columns)==null?void 0:f.flatMap(c=>c.getFlatColumns())]},_(e.options,"debugColumns")),getLeafColumns:F(()=>[e._getOrderColumnsFn()],f=>{var c;if((c=g.columns)!=null&&c.length){let m=g.columns.flatMap(p=>p.getLeafColumns());return f(m)}return[g]},_(e.options,"debugColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(g,e);return g}const T="debugHeaders";function On(e,t,n){var s;let r={id:(s=n.id)!=null?s:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const o=[],l=a=>{a.subHeaders&&a.subHeaders.length&&a.subHeaders.map(l),o.push(a)};return l(r),o},getContext:()=>({table:e,header:r,column:t})};return e._features.forEach(o=>{o.createHeader==null||o.createHeader(r,e)}),r}const ti={createTable:e=>{e.getHeaderGroups=F(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,s,i)=>{var r,o;const l=(r=s==null?void 0:s.map(g=>n.find(f=>f.id===g)).filter(Boolean))!=null?r:[],a=(o=i==null?void 0:i.map(g=>n.find(f=>f.id===g)).filter(Boolean))!=null?o:[],d=n.filter(g=>!(s!=null&&s.includes(g.id))&&!(i!=null&&i.includes(g.id)));return Ct(t,[...l,...d,...a],e)},_(e.options,T)),e.getCenterHeaderGroups=F(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,s,i)=>(n=n.filter(r=>!(s!=null&&s.includes(r.id))&&!(i!=null&&i.includes(r.id))),Ct(t,n,e,"center")),_(e.options,T)),e.getLeftHeaderGroups=F(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,s)=>{var i;const r=(i=s==null?void 0:s.map(o=>n.find(l=>l.id===o)).filter(Boolean))!=null?i:[];return Ct(t,r,e,"left")},_(e.options,T)),e.getRightHeaderGroups=F(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,s)=>{var i;const r=(i=s==null?void 0:s.map(o=>n.find(l=>l.id===o)).filter(Boolean))!=null?i:[];return Ct(t,r,e,"right")},_(e.options,T)),e.getFooterGroups=F(()=>[e.getHeaderGroups()],t=>[...t].reverse(),_(e.options,T)),e.getLeftFooterGroups=F(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),_(e.options,T)),e.getCenterFooterGroups=F(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),_(e.options,T)),e.getRightFooterGroups=F(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),_(e.options,T)),e.getFlatHeaders=F(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),_(e.options,T)),e.getLeftFlatHeaders=F(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),_(e.options,T)),e.getCenterFlatHeaders=F(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),_(e.options,T)),e.getRightFlatHeaders=F(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),_(e.options,T)),e.getCenterLeafHeaders=F(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var s;return!((s=n.subHeaders)!=null&&s.length)}),_(e.options,T)),e.getLeftLeafHeaders=F(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var s;return!((s=n.subHeaders)!=null&&s.length)}),_(e.options,T)),e.getRightLeafHeaders=F(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var s;return!((s=n.subHeaders)!=null&&s.length)}),_(e.options,T)),e.getLeafHeaders=F(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,s)=>{var i,r,o,l,a,d;return[...(i=(r=t[0])==null?void 0:r.headers)!=null?i:[],...(o=(l=n[0])==null?void 0:l.headers)!=null?o:[],...(a=(d=s[0])==null?void 0:d.headers)!=null?a:[]].map(h=>h.getLeafHeaders()).flat()},_(e.options,T))}};function Ct(e,t,n,s){var i,r;let o=0;const l=function(f,c){c===void 0&&(c=1),o=Math.max(o,c),f.filter(m=>m.getIsVisible()).forEach(m=>{var p;(p=m.columns)!=null&&p.length&&l(m.columns,c+1)},0)};l(e);let a=[];const d=(f,c)=>{const m={depth:c,id:[s,`${c}`].filter(Boolean).join("_"),headers:[]},p=[];f.forEach(C=>{const S=[...p].reverse()[0],M=C.column.depth===m.depth;let P,R=!1;if(M&&C.column.parent?P=C.column.parent:(P=C.column,R=!0),S&&(S==null?void 0:S.column)===P)S.subHeaders.push(C);else{const x=On(n,P,{id:[s,c,P.id,C==null?void 0:C.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${p.filter(A=>A.column===P).length}`:void 0,depth:c,index:p.length});x.subHeaders.push(C),p.push(x)}m.headers.push(C),C.headerGroup=m}),a.push(m),c>0&&d(p,c-1)},h=t.map((f,c)=>On(n,f,{depth:o,index:c}));d(h,o-1),a.reverse();const g=f=>f.filter(m=>m.column.getIsVisible()).map(m=>{let p=0,C=0,S=[0];m.subHeaders&&m.subHeaders.length?(S=[],g(m.subHeaders).forEach(P=>{let{colSpan:R,rowSpan:x}=P;p+=R,S.push(x)})):p=1;const M=Math.min(...S);return C=C+M,m.colSpan=p,m.rowSpan=C,{colSpan:p,rowSpan:C}});return g((i=(r=a[0])==null?void 0:r.headers)!=null?i:[]),a}const ni=(e,t,n,s,i,r,o)=>{let l={id:t,index:s,original:n,depth:i,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:a=>{if(l._valuesCache.hasOwnProperty(a))return l._valuesCache[a];const d=e.getColumn(a);if(d!=null&&d.accessorFn)return l._valuesCache[a]=d.accessorFn(l.original,s),l._valuesCache[a]},getUniqueValues:a=>{if(l._uniqueValuesCache.hasOwnProperty(a))return l._uniqueValuesCache[a];const d=e.getColumn(a);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(l._uniqueValuesCache[a]=d.columnDef.getUniqueValues(l.original,s),l._uniqueValuesCache[a]):(l._uniqueValuesCache[a]=[l.getValue(a)],l._uniqueValuesCache[a])},renderValue:a=>{var d;return(d=l.getValue(a))!=null?d:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Zs(l.subRows,a=>a.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let a=[],d=l;for(;;){const h=d.getParentRow();if(!h)break;a.push(h),d=h}return a.reverse()},getAllCells:F(()=>[e.getAllLeafColumns()],a=>a.map(d=>Ys(e,l,d,d.id)),_(e.options,"debugRows")),_getAllCellsByColumnId:F(()=>[l.getAllCells()],a=>a.reduce((d,h)=>(d[h.column.id]=h,d),{}),_(e.options,"debugRows"))};for(let a=0;a<e._features.length;a++){const d=e._features[a];d==null||d.createRow==null||d.createRow(l,e)}return l},si={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},as=(e,t,n)=>{var s,i;const r=n==null||(s=n.toString())==null?void 0:s.toLowerCase();return!!(!((i=e.getValue(t))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(r))};as.autoRemove=e=>ee(e);const cs=(e,t,n)=>{var s;return!!(!((s=e.getValue(t))==null||(s=s.toString())==null)&&s.includes(n))};cs.autoRemove=e=>ee(e);const ds=(e,t,n)=>{var s;return((s=e.getValue(t))==null||(s=s.toString())==null?void 0:s.toLowerCase())===(n==null?void 0:n.toLowerCase())};ds.autoRemove=e=>ee(e);const gs=(e,t,n)=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(n)};gs.autoRemove=e=>ee(e);const hs=(e,t,n)=>!n.some(s=>{var i;return!((i=e.getValue(t))!=null&&i.includes(s))});hs.autoRemove=e=>ee(e)||!(e!=null&&e.length);const fs=(e,t,n)=>n.some(s=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(s)});fs.autoRemove=e=>ee(e)||!(e!=null&&e.length);const ps=(e,t,n)=>e.getValue(t)===n;ps.autoRemove=e=>ee(e);const ms=(e,t,n)=>e.getValue(t)==n;ms.autoRemove=e=>ee(e);const pn=(e,t,n)=>{let[s,i]=n;const r=e.getValue(t);return r>=s&&r<=i};pn.resolveFilterValue=e=>{let[t,n]=e,s=typeof t!="number"?parseFloat(t):t,i=typeof n!="number"?parseFloat(n):n,r=t===null||Number.isNaN(s)?-1/0:s,o=n===null||Number.isNaN(i)?1/0:i;if(r>o){const l=r;r=o,o=l}return[r,o]};pn.autoRemove=e=>ee(e)||ee(e[0])&&ee(e[1]);const re={includesString:as,includesStringSensitive:cs,equalsString:ds,arrIncludes:gs,arrIncludesAll:hs,arrIncludesSome:fs,equals:ps,weakEquals:ms,inNumberRange:pn};function ee(e){return e==null||e===""}const ii={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:X("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],s=n==null?void 0:n.getValue(e.id);return typeof s=="string"?re.includesString:typeof s=="number"?re.inNumberRange:typeof s=="boolean"||s!==null&&typeof s=="object"?re.equals:Array.isArray(s)?re.arrIncludes:re.weakEquals},e.getFilterFn=()=>{var n,s;return _t(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(s=t.options.filterFns)==null?void 0:s[e.columnDef.filterFn])!=null?n:re[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,s,i;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((s=t.options.enableColumnFilters)!=null?s:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(s=>s.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,s;return(n=(s=t.getState().columnFilters)==null?void 0:s.findIndex(i=>i.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(s=>{const i=e.getFilterFn(),r=s==null?void 0:s.find(h=>h.id===e.id),o=we(n,r?r.value:void 0);if(Vn(i,o,e)){var l;return(l=s==null?void 0:s.filter(h=>h.id!==e.id))!=null?l:[]}const a={id:e.id,value:o};if(r){var d;return(d=s==null?void 0:s.map(h=>h.id===e.id?a:h))!=null?d:[]}return s!=null&&s.length?[...s,a]:[a]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),s=i=>{var r;return(r=we(t,i))==null?void 0:r.filter(o=>{const l=n.find(a=>a.id===o.id);if(l){const a=l.getFilterFn();if(Vn(a,o.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(s)},e.resetColumnFilters=t=>{var n,s;e.setColumnFilters(t?[]:(n=(s=e.initialState)==null?void 0:s.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Vn(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const ri=(e,t,n)=>n.reduce((s,i)=>{const r=i.getValue(e);return s+(typeof r=="number"?r:0)},0),oi=(e,t,n)=>{let s;return n.forEach(i=>{const r=i.getValue(e);r!=null&&(s>r||s===void 0&&r>=r)&&(s=r)}),s},ui=(e,t,n)=>{let s;return n.forEach(i=>{const r=i.getValue(e);r!=null&&(s<r||s===void 0&&r>=r)&&(s=r)}),s},li=(e,t,n)=>{let s,i;return n.forEach(r=>{const o=r.getValue(e);o!=null&&(s===void 0?o>=o&&(s=i=o):(s>o&&(s=o),i<o&&(i=o)))}),[s,i]},ai=(e,t)=>{let n=0,s=0;if(t.forEach(i=>{let r=i.getValue(e);r!=null&&(r=+r)>=r&&(++n,s+=r)}),n)return s/n},ci=(e,t)=>{if(!t.length)return;const n=t.map(r=>r.getValue(e));if(!Js(n))return;if(n.length===1)return n[0];const s=Math.floor(n.length/2),i=n.sort((r,o)=>r-o);return n.length%2!==0?i[s]:(i[s-1]+i[s])/2},di=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),gi=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,hi=(e,t)=>t.length,Mt={sum:ri,min:oi,max:ui,extent:li,mean:ai,median:ci,unique:di,uniqueCount:gi,count:hi},fi={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:X("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(s=>s!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,s;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((s=t.options.enableGrouping)!=null?s:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],s=n==null?void 0:n.getValue(e.id);if(typeof s=="number")return Mt.sum;if(Object.prototype.toString.call(s)==="[object Date]")return Mt.extent},e.getAggregationFn=()=>{var n,s;if(!e)throw new Error;return _t(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(s=t.options.aggregationFns)==null?void 0:s[e.columnDef.aggregationFn])!=null?n:Mt[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,s;e.setGrouping(t?[]:(n=(s=e.initialState)==null?void 0:s.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const s=t.getColumn(n);return s!=null&&s.columnDef.getGroupingValue?(e._groupingValuesCache[n]=s.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,s)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function pi(e,t,n){if(!(t!=null&&t.length)||!n)return e;const s=e.filter(r=>!t.includes(r.id));return n==="remove"?s:[...t.map(r=>e.find(o=>o.id===r)).filter(Boolean),...s]}const mi={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:X("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=F(n=>[tt(t,n)],n=>n.findIndex(s=>s.id===e.id),_(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var s;return((s=tt(t,n)[0])==null?void 0:s.id)===e.id},e.getIsLastColumn=n=>{var s;const i=tt(t,n);return((s=i[i.length-1])==null?void 0:s.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=F(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,s)=>i=>{let r=[];if(!(t!=null&&t.length))r=i;else{const o=[...t],l=[...i];for(;l.length&&o.length;){const a=o.shift(),d=l.findIndex(h=>h.id===a);d>-1&&r.push(l.splice(d,1)[0])}r=[...r,...l]}return pi(r,n,s)},_(e.options,"debugTable"))}},It=()=>({left:[],right:[]}),vi={getInitialState:e=>({columnPinning:It(),...e}),getDefaultOptions:e=>({onColumnPinningChange:X("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const s=e.getLeafColumns().map(i=>i.id).filter(Boolean);t.setColumnPinning(i=>{var r,o;if(n==="right"){var l,a;return{left:((l=i==null?void 0:i.left)!=null?l:[]).filter(g=>!(s!=null&&s.includes(g))),right:[...((a=i==null?void 0:i.right)!=null?a:[]).filter(g=>!(s!=null&&s.includes(g))),...s]}}if(n==="left"){var d,h;return{left:[...((d=i==null?void 0:i.left)!=null?d:[]).filter(g=>!(s!=null&&s.includes(g))),...s],right:((h=i==null?void 0:i.right)!=null?h:[]).filter(g=>!(s!=null&&s.includes(g)))}}return{left:((r=i==null?void 0:i.left)!=null?r:[]).filter(g=>!(s!=null&&s.includes(g))),right:((o=i==null?void 0:i.right)!=null?o:[]).filter(g=>!(s!=null&&s.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(s=>{var i,r,o;return((i=s.columnDef.enablePinning)!=null?i:!0)&&((r=(o=t.options.enableColumnPinning)!=null?o:t.options.enablePinning)!=null?r:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(l=>l.id),{left:s,right:i}=t.getState().columnPinning,r=n.some(l=>s==null?void 0:s.includes(l)),o=n.some(l=>i==null?void 0:i.includes(l));return r?"left":o?"right":!1},e.getPinnedIndex=()=>{var n,s;const i=e.getIsPinned();return i?(n=(s=t.getState().columnPinning)==null||(s=s[i])==null?void 0:s.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=F(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,s,i)=>{const r=[...s??[],...i??[]];return n.filter(o=>!r.includes(o.column.id))},_(t.options,"debugRows")),e.getLeftVisibleCells=F(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,s)=>(s??[]).map(r=>n.find(o=>o.column.id===r)).filter(Boolean).map(r=>({...r,position:"left"})),_(t.options,"debugRows")),e.getRightVisibleCells=F(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,s)=>(s??[]).map(r=>n.find(o=>o.column.id===r)).filter(Boolean).map(r=>({...r,position:"right"})),_(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,s;return e.setColumnPinning(t?It():(n=(s=e.initialState)==null?void 0:s.columnPinning)!=null?n:It())},e.getIsSomeColumnsPinned=t=>{var n;const s=e.getState().columnPinning;if(!t){var i,r;return!!((i=s.left)!=null&&i.length||(r=s.right)!=null&&r.length)}return!!((n=s[t])!=null&&n.length)},e.getLeftLeafColumns=F(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(s=>t.find(i=>i.id===s)).filter(Boolean),_(e.options,"debugColumns")),e.getRightLeafColumns=F(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(s=>t.find(i=>i.id===s)).filter(Boolean),_(e.options,"debugColumns")),e.getCenterLeafColumns=F(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,s)=>{const i=[...n??[],...s??[]];return t.filter(r=>!i.includes(r.id))},_(e.options,"debugColumns"))}};function Si(e){return e||(typeof document<"u"?document:null)}const yt={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},xt=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Ci={getDefaultColumnDef:()=>yt,getInitialState:e=>({columnSizing:{},columnSizingInfo:xt(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:X("columnSizing",e),onColumnSizingInfoChange:X("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,s,i;const r=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:yt.minSize,(s=r??e.columnDef.size)!=null?s:yt.size),(i=e.columnDef.maxSize)!=null?i:yt.maxSize)},e.getStart=F(n=>[n,tt(t,n),t.getState().columnSizing],(n,s)=>s.slice(0,e.getIndex(n)).reduce((i,r)=>i+r.getSize(),0),_(t.options,"debugColumns")),e.getAfter=F(n=>[n,tt(t,n),t.getState().columnSizing],(n,s)=>s.slice(e.getIndex(n)+1).reduce((i,r)=>i+r.getSize(),0),_(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:s,...i}=n;return i})},e.getCanResize=()=>{var n,s;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((s=t.options.enableColumnResizing)!=null?s:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const s=i=>{if(i.subHeaders.length)i.subHeaders.forEach(s);else{var r;n+=(r=i.column.getSize())!=null?r:0}};return s(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const s=t.getColumn(e.column.id),i=s==null?void 0:s.getCanResize();return r=>{if(!s||!i||(r.persist==null||r.persist(),Et(r)&&r.touches&&r.touches.length>1))return;const o=e.getSize(),l=e?e.getLeafHeaders().map(S=>[S.column.id,S.column.getSize()]):[[s.id,s.getSize()]],a=Et(r)?Math.round(r.touches[0].clientX):r.clientX,d={},h=(S,M)=>{typeof M=="number"&&(t.setColumnSizingInfo(P=>{var R,x;const A=t.options.columnResizeDirection==="rtl"?-1:1,J=(M-((R=P==null?void 0:P.startOffset)!=null?R:0))*A,$=Math.max(J/((x=P==null?void 0:P.startSize)!=null?x:0),-.999999);return P.columnSizingStart.forEach(b=>{let[G,Z]=b;d[G]=Math.round(Math.max(Z+Z*$,0)*100)/100}),{...P,deltaOffset:J,deltaPercentage:$}}),(t.options.columnResizeMode==="onChange"||S==="end")&&t.setColumnSizing(P=>({...P,...d})))},g=S=>h("move",S),f=S=>{h("end",S),t.setColumnSizingInfo(M=>({...M,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},c=Si(n),m={moveHandler:S=>g(S.clientX),upHandler:S=>{c==null||c.removeEventListener("mousemove",m.moveHandler),c==null||c.removeEventListener("mouseup",m.upHandler),f(S.clientX)}},p={moveHandler:S=>(S.cancelable&&(S.preventDefault(),S.stopPropagation()),g(S.touches[0].clientX),!1),upHandler:S=>{var M;c==null||c.removeEventListener("touchmove",p.moveHandler),c==null||c.removeEventListener("touchend",p.upHandler),S.cancelable&&(S.preventDefault(),S.stopPropagation()),f((M=S.touches[0])==null?void 0:M.clientX)}},C=yi()?{passive:!1}:!1;Et(r)?(c==null||c.addEventListener("touchmove",p.moveHandler,C),c==null||c.addEventListener("touchend",p.upHandler,C)):(c==null||c.addEventListener("mousemove",m.moveHandler,C),c==null||c.addEventListener("mouseup",m.upHandler,C)),t.setColumnSizingInfo(S=>({...S,startOffset:a,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:s.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?xt():(n=e.initialState.columnSizingInfo)!=null?n:xt())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((s,i)=>s+i.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((s,i)=>s+i.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((s,i)=>s+i.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((s,i)=>s+i.getSize(),0))!=null?t:0}}};let Rt=null;function yi(){if(typeof Rt=="boolean")return Rt;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Rt=e,Rt}function Et(e){return e.type==="touchstart"}const Ri={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:X("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(s=>({...s,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,s;const i=e.columns;return(n=i.length?i.some(r=>r.getIsVisible()):(s=t.getState().columnVisibility)==null?void 0:s[e.id])!=null?n:!0},e.getCanHide=()=>{var n,s;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((s=t.options.enableHiding)!=null?s:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=F(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(s=>s.column.getIsVisible()),_(t.options,"debugRows")),e.getVisibleCells=F(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,s,i)=>[...n,...s,...i],_(t.options,"debugRows"))},createTable:e=>{const t=(n,s)=>F(()=>[s(),s().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(r=>r.getIsVisible==null?void 0:r.getIsVisible()),_(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var s;e.setColumnVisibility(n?{}:(s=e.initialState.columnVisibility)!=null?s:{})},e.toggleAllColumnsVisible=n=>{var s;n=(s=n)!=null?s:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,r)=>({...i,[r.id]:n||!(r.getCanHide!=null&&r.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var s;e.toggleAllColumnsVisible((s=n.target)==null?void 0:s.checked)}}};function tt(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const wi={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Fi={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:X("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const s=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof s=="string"||typeof s=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,s,i,r;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((s=t.options.enableGlobalFilter)!=null?s:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&((r=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?r:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>re.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:s}=e.options;return _t(s)?s:s==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[s])!=null?t:re[s]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},_i={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:X("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var s,i;if(!t){e._queue(()=>{t=!0});return}if((s=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?s:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=s=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(s),e.toggleAllRowsExpanded=s=>{s??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=s=>{var i,r;e.setExpanded(s?{}:(i=(r=e.initialState)==null?void 0:r.expanded)!=null?i:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(s=>s.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>s=>{s.persist==null||s.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const s=e.getState().expanded;return s===!0||Object.values(s).some(Boolean)},e.getIsAllRowsExpanded=()=>{const s=e.getState().expanded;return typeof s=="boolean"?s===!0:!(!Object.keys(s).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},e.getExpandedDepth=()=>{let s=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(r=>{const o=r.split(".");s=Math.max(s,o.length)}),s},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(s=>{var i;const r=s===!0?!0:!!(s!=null&&s[e.id]);let o={};if(s===!0?Object.keys(t.getRowModel().rowsById).forEach(l=>{o[l]=!0}):o=s,n=(i=n)!=null?i:!r,!r&&n)return{...o,[e.id]:!0};if(r&&!n){const{[e.id]:l,...a}=o;return a}return s})},e.getIsExpanded=()=>{var n;const s=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:s===!0||s!=null&&s[e.id])},e.getCanExpand=()=>{var n,s,i;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((s=t.options.enableExpanding)!=null?s:!0)&&!!((i=e.subRows)!=null&&i.length)},e.getIsAllParentsExpanded=()=>{let n=!0,s=e;for(;n&&s.parentId;)s=t.getRow(s.parentId,!0),n=s.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},en=0,tn=10,$t=()=>({pageIndex:en,pageSize:tn}),Pi={getInitialState:e=>({...e,pagination:{...$t(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:X("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var s,i;if(!t){e._queue(()=>{t=!0});return}if((s=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?s:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=s=>{const i=r=>we(s,r);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=s=>{var i;e.setPagination(s?$t():(i=e.initialState.pagination)!=null?i:$t())},e.setPageIndex=s=>{e.setPagination(i=>{let r=we(s,i.pageIndex);const o=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return r=Math.max(0,Math.min(r,o)),{...i,pageIndex:r}})},e.resetPageIndex=s=>{var i,r;e.setPageIndex(s?en:(i=(r=e.initialState)==null||(r=r.pagination)==null?void 0:r.pageIndex)!=null?i:en)},e.resetPageSize=s=>{var i,r;e.setPageSize(s?tn:(i=(r=e.initialState)==null||(r=r.pagination)==null?void 0:r.pageSize)!=null?i:tn)},e.setPageSize=s=>{e.setPagination(i=>{const r=Math.max(1,we(s,i.pageSize)),o=i.pageSize*i.pageIndex,l=Math.floor(o/r);return{...i,pageIndex:l,pageSize:r}})},e.setPageCount=s=>e.setPagination(i=>{var r;let o=we(s,(r=e.options.pageCount)!=null?r:-1);return typeof o=="number"&&(o=Math.max(-1,o)),{...i,pageCount:o}}),e.getPageOptions=F(()=>[e.getPageCount()],s=>{let i=[];return s&&s>0&&(i=[...new Array(s)].fill(null).map((r,o)=>o)),i},_(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:s}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:s<i-1},e.previousPage=()=>e.setPageIndex(s=>s-1),e.nextPage=()=>e.setPageIndex(s=>s+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var s;return(s=e.options.pageCount)!=null?s:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var s;return(s=e.options.rowCount)!=null?s:e.getPrePaginationRowModel().rows.length}}},Ot=()=>({top:[],bottom:[]}),Mi={getInitialState:e=>({rowPinning:Ot(),...e}),getDefaultOptions:e=>({onRowPinningChange:X("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,s,i)=>{const r=s?e.getLeafRows().map(a=>{let{id:d}=a;return d}):[],o=i?e.getParentRows().map(a=>{let{id:d}=a;return d}):[],l=new Set([...o,e.id,...r]);t.setRowPinning(a=>{var d,h;if(n==="bottom"){var g,f;return{top:((g=a==null?void 0:a.top)!=null?g:[]).filter(p=>!(l!=null&&l.has(p))),bottom:[...((f=a==null?void 0:a.bottom)!=null?f:[]).filter(p=>!(l!=null&&l.has(p))),...Array.from(l)]}}if(n==="top"){var c,m;return{top:[...((c=a==null?void 0:a.top)!=null?c:[]).filter(p=>!(l!=null&&l.has(p))),...Array.from(l)],bottom:((m=a==null?void 0:a.bottom)!=null?m:[]).filter(p=>!(l!=null&&l.has(p)))}}return{top:((d=a==null?void 0:a.top)!=null?d:[]).filter(p=>!(l!=null&&l.has(p))),bottom:((h=a==null?void 0:a.bottom)!=null?h:[]).filter(p=>!(l!=null&&l.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:s,enablePinning:i}=t.options;return typeof s=="function"?s(e):(n=s??i)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:s,bottom:i}=t.getState().rowPinning,r=n.some(l=>s==null?void 0:s.includes(l)),o=n.some(l=>i==null?void 0:i.includes(l));return r?"top":o?"bottom":!1},e.getPinnedIndex=()=>{var n,s;const i=e.getIsPinned();if(!i)return-1;const r=(n=i==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(o=>{let{id:l}=o;return l});return(s=r==null?void 0:r.indexOf(e.id))!=null?s:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,s;return e.setRowPinning(t?Ot():(n=(s=e.initialState)==null?void 0:s.rowPinning)!=null?n:Ot())},e.getIsSomeRowsPinned=t=>{var n;const s=e.getState().rowPinning;if(!t){var i,r;return!!((i=s.top)!=null&&i.length||(r=s.bottom)!=null&&r.length)}return!!((n=s[t])!=null&&n.length)},e._getPinnedRows=(t,n,s)=>{var i;return((i=e.options.keepPinnedRows)==null||i?(n??[]).map(o=>{const l=e.getRow(o,!0);return l.getIsAllParentsExpanded()?l:null}):(n??[]).map(o=>t.find(l=>l.id===o))).filter(Boolean).map(o=>({...o,position:s}))},e.getTopRows=F(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),_(e.options,"debugRows")),e.getBottomRows=F(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),_(e.options,"debugRows")),e.getCenterRows=F(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,s)=>{const i=new Set([...n??[],...s??[]]);return t.filter(r=>!i.has(r.id))},_(e.options,"debugRows"))}},Ii={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:X("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const s={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(r=>{r.getCanSelect()&&(s[r.id]=!0)}):i.forEach(r=>{delete s[r.id]}),s})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const s=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(r=>{nn(i,r.id,s,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=F(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Vt(e,n):{rows:[],flatRows:[],rowsById:{}},_(e.options,"debugTable")),e.getFilteredSelectedRowModel=F(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Vt(e,n):{rows:[],flatRows:[],rowsById:{}},_(e.options,"debugTable")),e.getGroupedSelectedRowModel=F(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Vt(e,n):{rows:[],flatRows:[],rowsById:{}},_(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let s=!!(t.length&&Object.keys(n).length);return s&&t.some(i=>i.getCanSelect()&&!n[i.id])&&(s=!1),s},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=e.getState();let s=!!t.length;return s&&t.some(i=>!n[i.id])&&(s=!1),s},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,s)=>{const i=e.getIsSelected();t.setRowSelection(r=>{var o;if(n=typeof n<"u"?n:!i,e.getCanSelect()&&i===n)return r;const l={...r};return nn(l,e.id,n,(o=s==null?void 0:s.selectChildren)!=null?o:!0,t),l})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return mn(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return sn(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return sn(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return s=>{var i;n&&e.toggleSelected((i=s.target)==null?void 0:i.checked)}}}},nn=(e,t,n,s,i)=>{var r;const o=i.getRow(t,!0);n?(o.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),o.getCanSelect()&&(e[t]=!0)):delete e[t],s&&(r=o.subRows)!=null&&r.length&&o.getCanSelectSubRows()&&o.subRows.forEach(l=>nn(e,l.id,n,s,i))};function Vt(e,t){const n=e.getState().rowSelection,s=[],i={},r=function(o,l){return o.map(a=>{var d;const h=mn(a,n);if(h&&(s.push(a),i[a.id]=a),(d=a.subRows)!=null&&d.length&&(a={...a,subRows:r(a.subRows)}),h)return a}).filter(Boolean)};return{rows:r(t.rows),flatRows:s,rowsById:i}}function mn(e,t){var n;return(n=t[e.id])!=null?n:!1}function sn(e,t,n){var s;if(!((s=e.subRows)!=null&&s.length))return!1;let i=!0,r=!1;return e.subRows.forEach(o=>{if(!(r&&!i)&&(o.getCanSelect()&&(mn(o,t)?r=!0:i=!1),o.subRows&&o.subRows.length)){const l=sn(o,t);l==="all"?r=!0:(l==="some"&&(r=!0),i=!1)}}),i?"all":r?"some":!1}const rn=/([0-9]+)/gm,xi=(e,t,n)=>vs(_e(e.getValue(n)).toLowerCase(),_e(t.getValue(n)).toLowerCase()),Ei=(e,t,n)=>vs(_e(e.getValue(n)),_e(t.getValue(n))),$i=(e,t,n)=>vn(_e(e.getValue(n)).toLowerCase(),_e(t.getValue(n)).toLowerCase()),Oi=(e,t,n)=>vn(_e(e.getValue(n)),_e(t.getValue(n))),Vi=(e,t,n)=>{const s=e.getValue(n),i=t.getValue(n);return s>i?1:s<i?-1:0},Di=(e,t,n)=>vn(e.getValue(n),t.getValue(n));function vn(e,t){return e===t?0:e>t?1:-1}function _e(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function vs(e,t){const n=e.split(rn).filter(Boolean),s=t.split(rn).filter(Boolean);for(;n.length&&s.length;){const i=n.shift(),r=s.shift(),o=parseInt(i,10),l=parseInt(r,10),a=[o,l].sort();if(isNaN(a[0])){if(i>r)return 1;if(r>i)return-1;continue}if(isNaN(a[1]))return isNaN(o)?-1:1;if(o>l)return 1;if(l>o)return-1}return n.length-s.length}const Ye={alphanumeric:xi,alphanumericCaseSensitive:Ei,text:$i,textCaseSensitive:Oi,datetime:Vi,basic:Di},Ai={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:X("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let s=!1;for(const i of n){const r=i==null?void 0:i.getValue(e.id);if(Object.prototype.toString.call(r)==="[object Date]")return Ye.datetime;if(typeof r=="string"&&(s=!0,r.split(rn).length>1))return Ye.alphanumeric}return s?Ye.text:Ye.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,s;if(!e)throw new Error;return _t(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(s=t.options.sortingFns)==null?void 0:s[e.columnDef.sortingFn])!=null?n:Ye[e.columnDef.sortingFn]},e.toggleSorting=(n,s)=>{const i=e.getNextSortingOrder(),r=typeof n<"u"&&n!==null;t.setSorting(o=>{const l=o==null?void 0:o.find(c=>c.id===e.id),a=o==null?void 0:o.findIndex(c=>c.id===e.id);let d=[],h,g=r?n:i==="desc";if(o!=null&&o.length&&e.getCanMultiSort()&&s?l?h="toggle":h="add":o!=null&&o.length&&a!==o.length-1?h="replace":l?h="toggle":h="replace",h==="toggle"&&(r||i||(h="remove")),h==="add"){var f;d=[...o,{id:e.id,desc:g}],d.splice(0,d.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else h==="toggle"?d=o.map(c=>c.id===e.id?{...c,desc:g}:c):h==="remove"?d=o.filter(c=>c.id!==e.id):d=[{id:e.id,desc:g}];return d})},e.getFirstSortDir=()=>{var n,s;return((n=(s=e.columnDef.sortDescFirst)!=null?s:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var s,i;const r=e.getFirstSortDir(),o=e.getIsSorted();return o?o!==r&&((s=t.options.enableSortingRemoval)==null||s)&&(!(n&&(i=t.options.enableMultiRemove)!=null)||i)?!1:o==="desc"?"asc":"desc":r},e.getCanSort=()=>{var n,s;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((s=t.options.enableSorting)!=null?s:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,s;return(n=(s=e.columnDef.enableMultiSort)!=null?s:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const s=(n=t.getState().sorting)==null?void 0:n.find(i=>i.id===e.id);return s?s.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,s;return(n=(s=t.getState().sorting)==null?void 0:s.findIndex(i=>i.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(s=>s.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return s=>{n&&(s.persist==null||s.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(s):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,s;e.setSorting(t?[]:(n=(s=e.initialState)==null?void 0:s.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},bi=[ti,Ri,mi,vi,si,ii,wi,Fi,Ai,fi,_i,Pi,Mi,Ii,Ci];function Hi(e){var t,n;const s=[...bi,...(t=e._features)!=null?t:[]];let i={_features:s};const r=i._features.reduce((f,c)=>Object.assign(f,c.getDefaultOptions==null?void 0:c.getDefaultOptions(i)),{}),o=f=>i.options.mergeOptions?i.options.mergeOptions(r,f):{...r,...f};let a={...{},...(n=e.initialState)!=null?n:{}};i._features.forEach(f=>{var c;a=(c=f.getInitialState==null?void 0:f.getInitialState(a))!=null?c:a});const d=[];let h=!1;const g={_features:s,options:{...r,...e},initialState:a,_queue:f=>{d.push(f),h||(h=!0,Promise.resolve().then(()=>{for(;d.length;)d.shift()();h=!1}).catch(c=>setTimeout(()=>{throw c})))},reset:()=>{i.setState(i.initialState)},setOptions:f=>{const c=we(f,i.options);i.options=o(c)},getState:()=>i.options.state,setState:f=>{i.options.onStateChange==null||i.options.onStateChange(f)},_getRowId:(f,c,m)=>{var p;return(p=i.options.getRowId==null?void 0:i.options.getRowId(f,c,m))!=null?p:`${m?[m.id,c].join("."):c}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(f,c)=>{let m=(c?i.getPrePaginationRowModel():i.getRowModel()).rowsById[f];if(!m&&(m=i.getCoreRowModel().rowsById[f],!m))throw new Error;return m},_getDefaultColumnDef:F(()=>[i.options.defaultColumn],f=>{var c;return f=(c=f)!=null?c:{},{header:m=>{const p=m.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:m=>{var p,C;return(p=(C=m.renderValue())==null||C.toString==null?void 0:C.toString())!=null?p:null},...i._features.reduce((m,p)=>Object.assign(m,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...f}},_(e,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:F(()=>[i._getColumnDefs()],f=>{const c=function(m,p,C){return C===void 0&&(C=0),m.map(S=>{const M=ei(i,S,C,p),P=S;return M.columns=P.columns?c(P.columns,M,C+1):[],M})};return c(f)},_(e,"debugColumns")),getAllFlatColumns:F(()=>[i.getAllColumns()],f=>f.flatMap(c=>c.getFlatColumns()),_(e,"debugColumns")),_getAllFlatColumnsById:F(()=>[i.getAllFlatColumns()],f=>f.reduce((c,m)=>(c[m.id]=m,c),{}),_(e,"debugColumns")),getAllLeafColumns:F(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(f,c)=>{let m=f.flatMap(p=>p.getLeafColumns());return c(m)},_(e,"debugColumns")),getColumn:f=>i._getAllFlatColumnsById()[f]};Object.assign(i,g);for(let f=0;f<i._features.length;f++){const c=i._features[f];c==null||c.createTable==null||c.createTable(i)}return i}function Wi(){return e=>F(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},s=function(i,r,o){r===void 0&&(r=0);const l=[];for(let d=0;d<i.length;d++){const h=ni(e,e._getRowId(i[d],d,o),i[d],d,r,void 0,o==null?void 0:o.id);if(n.flatRows.push(h),n.rowsById[h.id]=h,l.push(h),e.options.getSubRows){var a;h.originalSubRows=e.options.getSubRows(i[d],d),(a=h.originalSubRows)!=null&&a.length&&(h.subRows=s(h.originalSubRows,r+1,h))}}return l};return n.rows=s(t),n},_(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Li(e){const t=[],n=s=>{var i;t.push(s),(i=s.subRows)!=null&&i.length&&s.getIsExpanded()&&s.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Ji(e){return t=>F(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,s)=>{if(!s.rows.length)return s;const{pageSize:i,pageIndex:r}=n;let{rows:o,flatRows:l,rowsById:a}=s;const d=i*r,h=d+i;o=o.slice(d,h);let g;t.options.paginateExpandedRows?g={rows:o,flatRows:l,rowsById:a}:g=Li({rows:o,flatRows:l,rowsById:a}),g.flatRows=[];const f=c=>{g.flatRows.push(c),c.subRows.length&&c.subRows.forEach(f)};return g.rows.forEach(f),g},_(t.options,"debugTable"))}function Zi(){return e=>F(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const s=e.getState().sorting,i=[],r=s.filter(a=>{var d;return(d=e.getColumn(a.id))==null?void 0:d.getCanSort()}),o={};r.forEach(a=>{const d=e.getColumn(a.id);d&&(o[a.id]={sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortingFn:d.getSortingFn()})});const l=a=>{const d=a.map(h=>({...h}));return d.sort((h,g)=>{for(let c=0;c<r.length;c+=1){var f;const m=r[c],p=o[m.id],C=p.sortUndefined,S=(f=m==null?void 0:m.desc)!=null?f:!1;let M=0;if(C){const P=h.getValue(m.id),R=g.getValue(m.id),x=P===void 0,A=R===void 0;if(x||A){if(C==="first")return x?-1:1;if(C==="last")return x?1:-1;M=x&&A?0:x?C:-C}}if(M===0&&(M=p.sortingFn(h,g,m.id)),M!==0)return S&&(M*=-1),p.invertSorting&&(M*=-1),M}return h.index-g.index}),d.forEach(h=>{var g;i.push(h),(g=h.subRows)!=null&&g.length&&(h.subRows=l(h.subRows))}),d};return{rows:l(n.rows),flatRows:i,rowsById:n.rowsById}},_(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
* react-table
*
* Copyright (c) TanStack
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Yi(e,t){return e?Gi(e)?O.createElement(e,t):e:null}function Gi(e){return Ti(e)||typeof e=="function"||zi(e)}function Ti(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function zi(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function er(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=O.useState(()=>({current:Hi(t)})),[s,i]=O.useState(()=>n.current.initialState);return n.current.setOptions(r=>({...r,...e,state:{...s,...e.state},onStateChange:o=>{i(o),e.onStateChange==null||e.onStateChange(o)}})),n.current}export{ki as Q,Ui as _,Bi as a,Ji as b,Zi as c,Ni as d,Ki as e,Yi as f,Wi as g,fn as h,er as i,Xi as u};