import{q as F,i as g,v as U,cK as M,k as R,a as r,t as A,bu as p,X as E}from"./index-6Jqoo2rk.js";import{ag as B,ab as N}from"./accumulate-BydAFozl.js";import{G as q}from"./appDialogsManager-DnVhdlim.js";const G="_Container_1oju5_1",K="_Row_1oju5_6",X="_Limit_1oju5_14",Z="_LimitLast_1oju5_18",D="_Value_1oju5_22",H="_InputWrapper_1oju5_28",J="_Thumb_1oju5_43",O="_Background_1oju5_63",Q="_Progress_1oju5_73",o={Container:G,Row:K,Limit:X,LimitLast:Z,Value:D,InputWrapper:H,Thumb:J,Background:O,Progress:Q},Y=A("<div><div><div></div><div></div><div></div></div><div><input type=range step=1><div></div><div></div><div>"),b=[[10,1],[10,2],[14,5],[10,10],[12,25],[10,50],[15,100],[20,250],[5,500]],l=N(b.map(e=>e[0]),0),tt=W(l);function W(e){let n=0;for(const[v,s]of b)if(n+=Math.min(e,v)*s,e-=v,e<=0)break;return n}function et(e){let n=0;for(const[v,s]of b){const d=Math.min(v,Math.floor(e/s));e-=d*s,n+=d}return n}const rt=e=>{const n=F(()=>e.startFromZero?0:1),v=()=>p(et(e.value),n(),l),s=()=>q(v(),n(),l,0,1),d=i=>{const a=p(i.currentTarget.valueAsNumber,n(),l),_=Math.round(W(a));e.onChange(_)};return(()=>{const i=Y(),a=i.firstChild,_=a.firstChild,c=_.nextSibling,f=c.nextSibling,h=a.nextSibling,u=h.firstChild,L=u.nextSibling,S=L.nextSibling,z=S.nextSibling;return g(_,n),g(c,()=>U("Stars",[B(parseInt(e.value.toFixed(0)))])),g(f,()=>B(tt)),u.$$input=d,M(u,"max",l),R(t=>{const y=o.Container,m=s(),$=s()*100+"%",j=o.Row,x=o.Limit,P=o.Value,C=`${o.Limit} ${o.LimitLast}`,T=o.InputWrapper,w=n(),I=o.Background,V=o.Thumb,k=o.Progress;return y!==t._v$&&r(i,t._v$=y),m!==t._v$2&&((t._v$2=m)!=null?i.style.setProperty("--normalized",m):i.style.removeProperty("--normalized")),$!==t._v$3&&((t._v$3=$)!=null?i.style.setProperty("--w",$):i.style.removeProperty("--w")),j!==t._v$4&&r(a,t._v$4=j),x!==t._v$5&&r(_,t._v$5=x),P!==t._v$6&&r(c,t._v$6=P),C!==t._v$7&&r(f,t._v$7=C),T!==t._v$8&&r(h,t._v$8=T),w!==t._v$9&&M(u,"min",t._v$9=w),I!==t._v$10&&r(L,t._v$10=I),V!==t._v$11&&r(S,t._v$11=V),k!==t._v$12&&r(z,t._v$12=k),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$12:void 0}),R(()=>u.value=v()),i})()};E(["input"]);export{rt as S};
//# sourceMappingURL=starsRangeInput-BLe-6A9X.js.map
