import{J as Q,aN as R,K as z,r,c as u,cd as F,ac as I,U as O,ah as N,O as i,aE as U,m as V,ce as k,bP as D,aQ as H,bW as K,cf as L,aT as j,i as G,o as J,e as x,t as W,q as X}from"./index-CS0Lg7FU.js";import{_ as Y}from"./_plugin-vue_export-helper-BrVfw-gY.js";const w=40,S=20,ae=Q({name:"QPullToRefresh",props:{color:String,bgColor:String,icon:String,noMouse:Boolean,disable:Boolean,scrollTarget:R},emits:["refresh"],setup(e,{slots:m,emit:h}){const{proxy:a}=z(),{$q:c}=a,l=r("pull"),f=r(0),s=r(!1),p=r(-40),v=r(!1),T=r({}),P=u(()=>({opacity:f.value,transform:`translateY(${p.value}px) rotate(${f.value*360}deg)`})),C=u(()=>"q-pull-to-refresh__puller row flex-center"+(v.value===!0?" q-pull-to-refresh__puller--animating":"")+(e.bgColor!==void 0?` bg-${e.bgColor}`:""));function q(t){if(t.isFinal===!0){s.value===!0&&(s.value=!1,l.value==="pulled"?(l.value="refreshing",g({pos:S}),y()):l.value==="pull"&&g({pos:-40,ratio:0}));return}if(v.value===!0||l.value==="refreshing")return!1;if(t.isFirst===!0){if(H(b)!==0||t.direction!=="down")return s.value===!0&&(s.value=!1,l.value="pull",g({pos:-40,ratio:0})),!1;s.value=!0;const{top:B,left:M}=a.$el.getBoundingClientRect();T.value={top:B+"px",left:M+"px",width:window.getComputedStyle(a.$el).getPropertyValue("width")}}K(t.evt);const n=Math.min(140,Math.max(0,t.distance.y));p.value=n-w,f.value=L(n/(S+w),0,1);const d=p.value>S?"pulled":"pull";l.value!==d&&(l.value=d)}const E=u(()=>{const t={down:!0};return e.noMouse!==!0&&(t.mouse=!0),[[F,q,void 0,t]]}),$=u(()=>`q-pull-to-refresh__content${s.value===!0?" no-pointer-events":""}`);function y(){h("refresh",()=>{g({pos:-40,ratio:0},()=>{l.value="pull"})})}let b,o=null;function g({pos:t,ratio:n},d){v.value=!0,p.value=t,n!==void 0&&(f.value=n),o!==null&&clearTimeout(o),o=setTimeout(()=>{o=null,v.value=!1,d?.()},300)}function _(){b=j(a.$el,e.scrollTarget)}return I(()=>e.scrollTarget,_),O(_),N(()=>{o!==null&&clearTimeout(o)}),Object.assign(a,{trigger:y,updateScrollTarget:_}),()=>{const t=[i("div",{class:$.value},U(m.default)),i("div",{class:"q-pull-to-refresh__puller-container fixed row flex-center no-pointer-events z-top",style:T.value},[i("div",{class:C.value,style:P.value},[l.value!=="refreshing"?i(V,{name:e.icon||c.iconSet.pullToRefresh.icon,color:e.color,size:"32px"}):i(k,{size:"24px",color:e.color})])])];return D("div",{class:"q-pull-to-refresh"},t,"main",e.disable===!1,()=>E.value)}}}),A="/mobile_approve/assets/sad-CoKwq7eX.svg",Z={class:"empty-message"},ee={__name:"EmptyPlaceholder",props:{message:String,height:{type:[String,Number],default:"60"}},setup(e){const m=e,h=u(()=>m.message);return(a,c)=>(J(),G("div",{class:"empty-state",style:X({height:e.height+"vh"})},[c[0]||(c[0]=x("img",{class:"empty-image",src:A},null,-1)),x("div",Z,W(h.value),1)],4))}},se=Y(ee,[["__scopeId","data-v-0db3115e"]]);export{se as E,ae as Q,A as _};
