import{d as C,f as g,ai as E,g as L,w as v,aj as B,N as _,H as N,b as r,J as R,Z as x}from"./index-DA4V3bi7.js";import{a as H,L as j}from"./axiosInstance-Cw054-4v.js";import{u as y}from"./use-tab-status-BsRfJGAO.js";import{c as I,e as M,f as A,t as F,o as J,w as O}from"./SvgIcon-Cza0IrRi.js";window.getBuildInfo=function(){return{buildTime:"12/28/2024, 9:18:06 AM",branch:"null"}};const[U,o,V]=I("list"),W={error:Boolean,offset:M(300),loading:Boolean,disabled:Boolean,finished:Boolean,scroller:Object,errorText:String,direction:A("down"),loadingText:String,finishedText:String,immediateCheck:F};var Z=C({name:U,props:W,emits:["load","update:error","update:loading"],setup(e,{emit:s,slots:n}){const d=g(e.loading),u=g(),h=g(),c=y(),T=E(u),m=L(()=>e.scroller||T.value),a=()=>{R(()=>{if(d.value||e.finished||e.disabled||e.error||(c==null?void 0:c.value)===!1)return;const{direction:t}=e,l=+e.offset,i=x(m);if(!i.height||J(u))return;let f=!1;const b=x(h);t==="up"?f=i.top-b.top<=l:f=b.bottom-i.bottom<=l,f&&(d.value=!0,s("update:loading",!0),s("load"))})},k=()=>{if(e.finished){const t=n.finished?n.finished():e.finishedText;if(t)return r("div",{class:o("finished-text")},[t])}},w=()=>{s("update:error",!1),a()},P=()=>{if(e.error){const t=n.error?n.error():e.errorText;if(t)return r("div",{role:"button",class:o("error-text"),tabindex:0,onClick:w},[t])}},S=()=>{if(d.value&&!e.finished&&!e.disabled)return r("div",{class:o("loading")},[n.loading?n.loading():r(j,{class:o("loading-icon")},{default:()=>[e.loadingText||V("loading")]})])};return v(()=>[e.loading,e.finished,e.error],a),c&&v(c,t=>{t&&a()}),B(()=>{d.value=e.loading}),_(()=>{e.immediateCheck&&a()}),H({check:a}),N("scroll",a,{target:m,passive:!0}),()=>{var t;const l=(t=n.default)==null?void 0:t.call(n),i=r("div",{ref:h,class:o("placeholder")},null);return r("div",{ref:u,role:"feed",class:o(),"aria-busy":d.value},[e.direction==="down"?l:i,S(),k(),P(),e.direction==="up"?l:i])}}});const K=O(Z),Q="/assets/empty-Cb98WcEH.png";export{K as L,Q as _};
