| 12 |
- import{dh as B,aa as z,a5 as c,a3 as U,Y as T,i as E,b6 as F,V,$ as o,a2 as N,bs as I}from"./index-D_EGaVbS.js";import{u as D,d as G,n as k,e as H}from"./appDialogsManager-B7M3PQZv.js";const Y=()=>{const{rootScope:e}=B(),s=D();return z(()=>{const i=e.managers.apiManager.getAppConfig();return s.collect(i),i})},ot=e=>{const[s]=Y(),i=c(()=>(+s()?.stars_paid_message_commission_permille||0)/1e3),a=c(()=>(+s()?.stars_usd_withdraw_rate_x1000||0)/1e3),n=c(()=>Math.round(i()*100)),l=c(()=>Math.max(.01,Math.round(i()*a()*e())/100));return{commissionPercents:n,willReceiveDollars:l}},j="_Container_16lt0_36",q="_Row_16lt0_41",J="_Limit_16lt0_49",K="_LimitLast_16lt0_53",O="_Value_16lt0_57",Q="_InputWrapper_16lt0_63",X="_Thumb_16lt0_78",Z="_Background_16lt0_98",tt="_Progress_16lt0_108",r={Container:j,Row:q,Limit:J,LimitLast:K,Value:O,InputWrapper:Q,Thumb:X,Background:Z,Progress:tt},et=N("<div><div><div>1</div><div></div><div></div></div><div><input type=range min=1 step=1><div></div><div></div><div>"),f=[[10,1],[10,2],[14,5],[10,10],[12,25],[10,50],[15,100],[20,250],[5,500]],u=G(f.map(e=>e[0]),0),nt=A(u);function A(e){let s=0;for(const[i,a]of f)if(s+=Math.min(e,i)*a,e-=i,e<=0)break;return s}function st(e){let s=0;for(const[i,a]of f){const n=Math.min(i,Math.floor(e/a));e-=n*a,s+=n}return s}const at=e=>{const s=()=>I(st(e.value),1,u),i=()=>H(s(),1,u,0,1),a=n=>{const l=I(n.currentTarget.valueAsNumber,1,u),v=Math.round(A(l));e.onChange(v)};return(()=>{const n=et(),l=n.firstChild,v=l.firstChild,d=v.nextSibling,g=d.nextSibling,p=l.nextSibling,_=p.firstChild,h=_.nextSibling,b=h.nextSibling,W=b.nextSibling;return T(d,()=>E("Stars",[k(parseInt(e.value.toFixed(0)))])),T(g,()=>k(nt)),_.$$input=a,F(_,"max",u),V(t=>{const S=r.Container,m=i(),$=i()*100+"%",C=r.Row,L=r.Limit,P=r.Value,w=`${r.Limit} ${r.LimitLast}`,x=r.InputWrapper,y=r.Background,M=r.Thumb,R=r.Progress;return S!==t._v$&&o(n,t._v$=S),m!==t._v$2&&((t._v$2=m)!=null?n.style.setProperty("--normalized",m):n.style.removeProperty("--normalized")),$!==t._v$3&&((t._v$3=$)!=null?n.style.setProperty("--w",$):n.style.removeProperty("--w")),C!==t._v$4&&o(l,t._v$4=C),L!==t._v$5&&o(v,t._v$5=L),P!==t._v$6&&o(d,t._v$6=P),w!==t._v$7&&o(g,t._v$7=w),x!==t._v$8&&o(p,t._v$8=x),y!==t._v$9&&o(h,t._v$9=y),M!==t._v$10&&o(b,t._v$10=M),R!==t._v$11&&o(W,t._v$11=R),t},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0,_v$7:void 0,_v$8:void 0,_v$9:void 0,_v$10:void 0,_v$11:void 0}),V(()=>_.value=s()),n})()};U(["input"]);export{at as S,ot as u};
- //# sourceMappingURL=starsRangeInput-DUKz4CVH.js.map
|