System.register(["./index-legacy-fdce4919.js","./use-tab-status-legacy-8cf70741.js"],(function(e,i){"use strict";var r,t,o,n,a,d,l,s,u,c,f,g,v,h,p,b,m,x,T;return{setters:[e=>{r=e.c,t=e.b,o=e.m,n=e.t,a=e.d,d=e.r,l=e.aR,s=e.w,u=e.bA,c=e.y,f=e.X,g=e.Y,v=e.a,h=e.z,p=e.Z,b=e.bB,m=e.L,x=e.k},e=>{T=e.u}],execute:function(){const[i,k,y]=r("list"),B={error:Boolean,offset:t(300),loading:Boolean,disabled:Boolean,finished:Boolean,errorText:String,direction:o("down"),loadingText:String,finishedText:String,immediateCheck:n};var S=a({name:i,props:B,emits:["load","update:error","update:loading"],setup(e,{emit:i,slots:r}){const t=d(e.loading),o=d(),n=d(),a=T(),x=l(o),B=()=>{h((()=>{if(t.value||e.finished||e.disabled||e.error||!1===(null==a?void 0:a.value))return;const{direction:r}=e,d=+e.offset,l=p(x);if(!l.height||b(o))return;let s=!1;const u=p(n);s="up"===r?l.top-u.top<=d:u.bottom-l.bottom<=d,s&&(t.value=!0,i("update:loading",!0),i("load"))}))},S=()=>{if(e.finished){const i=r.finished?r.finished():e.finishedText;if(i)return v("div",{class:k("finished-text")},[i])}},w=()=>{i("update:error",!1),B()},C=()=>{if(e.error){const i=r.error?r.error():e.errorText;if(i)return v("div",{role:"button",class:k("error-text"),tabindex:0,onClick:w},[i])}},j=()=>{if(t.value&&!e.finished&&!e.disabled)return v("div",{class:k("loading")},[r.loading?r.loading():v(m,{class:k("loading-icon")},{default:()=>[e.loadingText||y("loading")]})])};return s((()=>[e.loading,e.finished,e.error]),B),a&&s(a,(e=>{e&&B()})),u((()=>{t.value=e.loading})),c((()=>{e.immediateCheck&&B()})),f({check:B}),g("scroll",B,{target:x,passive:!0}),()=>{var i;const a=null==(i=r.default)?void 0:i.call(r),d=v("div",{ref:n,class:k("placeholder")},null);return v("div",{ref:o,role:"feed",class:k(),"aria-busy":t.value},["down"===e.direction?a:d,j(),S(),C(),"up"===e.direction?a:d])}}});e("L",x(S))}}}));
