import{Q as v,u as b}from"./useBaseQuery-DCSHiJ5h.js";import{be as f,bf as x,bg as l,r as P}from"./index-BX768Frx.js";var p=class extends v{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:f()})}getOptimisticResult(e){return e.behavior=f(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:g,isError:o,isRefetchError:d}=i,r=s.fetchMeta?.fetchMore?.direction,c=o&&r==="forward",n=a&&r==="forward",h=o&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:l(t,s.data),hasPreviousPage:x(t,s.data),isFetchNextPageError:c,isFetchingNextPage:n,isFetchPreviousPageError:h,isFetchingPreviousPage:u,isRefetchError:d&&!c&&!h,isRefetching:g&&!n&&!u}}};function E(e,t){return b(e,p)}const m=P.createContext({position:"horizontal",moveSidebar:()=>{}});function M(){const e=P.useContext(m);if(!e)throw new Error("useSidePanel must be used within SidePanelProvider");return e}export{m as S,M as a,E as u};
