import{i as p,l as h,n as r,d as U,q as H,az as N,$ as Y,aW as n,x as F,a7 as P,g,at as u,L as z,av as m,al as Z,w as V,F as j,h as S,a2 as d,b5 as f,B as b,aV as X}from"./index-bc617d61.js";import{O as v}from"./index-f0184086.js";import{I as J}from"./index-e80a7d08.js";import{L as _}from"./index-94680c8b.js";const[$,s,AA]=p("pull-refresh"),y=50,CA=["pulling","loosing","success"],gA={disabled:Boolean,modelValue:Boolean,headHeight:h(y),successText:String,pullingText:String,loosingText:String,loadingText:String,pullDistance:r,successDuration:h(500),animationDuration:h(300)};var IA=U({name:$,props:gA,emits:["change","refresh","update:modelValue"],setup(C,{emit:w,slots:Q}){let E;const i=H(),c=H(),R=N(i),I=Y({status:"normal",distance:0,duration:0}),K=n(),x=()=>{if(C.headHeight!==y)return{height:`${C.headHeight}px`}},k=()=>I.status!=="loading"&&I.status!=="success"&&!C.disabled,e=A=>{const B=+(C.pullDistance||C.headHeight);return A>B&&(A<B*2?A=B+(A-B)/2:A=B*1.5+(A-B*2)/4),Math.round(A)},o=(A,B)=>{const M=+(C.pullDistance||C.headHeight);I.distance=A,B?I.status="loading":A===0?I.status="normal":A<M?I.status="pulling":I.status="loosing",w("change",{status:I.status,distance:A})},L=()=>{const{status:A}=I;return A==="normal"?"":C[`${A}Text`]||AA(A)},W=()=>{const{status:A,distance:B}=I;if(Q[A])return Q[A]({distance:B});const M=[];return CA.includes(A)&&M.push(g("div",{class:s("text")},[L()])),A==="loading"&&M.push(g(u,{class:s("loading")},{default:L})),M},q=()=>{I.status="success",setTimeout(()=>{o(0)},+C.successDuration)},a=A=>{E=m(R.value)===0,E&&(I.duration=0,K.start(A))},t=A=>{k()&&a(A)},T=A=>{if(k()){E||a(A);const{deltaY:B}=K;K.move(A),E&&B.value>=0&&K.isVertical()&&(Z(A),o(e(B.value)))}},G=()=>{E&&K.deltaY.value&&k()&&(I.duration=+C.animationDuration,I.status==="loosing"?(o(+C.headHeight,!0),w("update:modelValue",!0),z(()=>w("refresh"))):o(0))};return F(()=>C.modelValue,A=>{I.duration=+C.animationDuration,A?o(+C.headHeight,!0):Q.success||C.successText?q():o(0,!1)}),P("touchmove",T,{target:c}),()=>{var A;const B={transitionDuration:`${I.duration}ms`,transform:I.distance?`translate3d(0,${I.distance}px, 0)`:""};return g("div",{ref:i,class:s()},[g("div",{ref:c,class:s("track"),style:B,onTouchstartPassive:t,onTouchend:G,onTouchcancel:G},[g("div",{class:s("head"),style:x()},[W()]),(A=Q.default)==null?void 0:A.call(Q)])])}}});const BA=V(IA),QA="_knowledgeLibrary_gjvqh_1",O={knowledgeLibrary:QA},EA="_animateWrap_1kuq9_1",wA="_loading_1kuq9_5",iA="_pullRefresh_1kuq9_13",D={animateWrap:EA,loading:wA,pullRefresh:iA};const l=""+new URL("loading-9729222e.gif",import.meta.url).href,oA="data:image/gif;base64,[encoded data, 64032 characters]",KA={loading:oA},MA=U({name:"m-full-refresh",props:{title:String,modelValue:{type:Boolean,default:!1}},emits:["refresh","update:modelValue"],setup(C,{emit:w,slots:Q}){const E=Y({fullState:!1});return F(()=>C.modelValue,i=>{E.fullState=i}),F(()=>E.fullState,i=>{w("update:modelValue",i)}),()=>g(BA,{modelValue:E.fullState,"onUpdate:modelValue":i=>E.fullState=i,onRefresh:()=>w("refresh"),loadingText:" ",class:D.pullRefresh},{loading:()=>g("div",null,[g(J,{src:KA.loading,class:D.loading},null)]),pulling:()=>g("div",null,[g(J,{src:l,class:D.loading},null)]),loosing:()=>g("div",null,[g(J,{src:l,class:D.loading},null)]),default:()=>g(j,null,[S(" "),Q.default&&Q.default()])})}}),JA=U({name:"knowledge-ligrary",setup(){d();const C=Y({oPopover:!1,searchList:[],list:[],listState:{dataShow:!0,loading:!1,finished:!1,refreshing:!1,height:0},statusText:"全部测验",params:{keyword:null,status:null,page:1,rows:20},isClick:!1,visiableNotice:!1,unitExam:{},selectUnitExam:{},dialogMessage:"",dialogStatus:!1}),w=()=>{};return()=>g("div",{class:O.knowledgeLibrary},[g(v,{position:"top"},{default:()=>[g(f,{border:!1,background:"transparent"},{right:()=>g(b,{round:!0,size:"small"},{default:()=>[S("错题本")]})})]}),g(MA,{modelValue:C.listState.refreshing,"onUpdate:modelValue":Q=>C.listState.refreshing=Q,style:{minHeight:`calc(100vh - ${C.listState.height}px)`}},{default:()=>[g(_,{finished:C.listState.finished,finishedText:" ",class:[O.liveList],style:{paddingTop:"12px"},onLoad:w,immediateCheck:!1},{default:()=>[C.listState.dataShow?g(j,null,[S("121212")]):g(X,{description:"暂无阶段自测"},null)]})]})])}});export{JA as default};
