import{r as u,j as l,O as f,Z as y,w as I}from"./index-C-gKvEDq.js";var d="Progress",v=100,[w]=y(d),[E,R]=w(d),m=u.forwardRef((r,e)=>{const{__scopeProgress:n,value:o=null,max:a,getValueLabel:b=j,...h}=r;(a||a===0)&&!p(a)&&console.error(_(`${a}`,"Progress"));const s=p(a)?a:v;o!==null&&!c(o,s)&&console.error(M(`${o}`,"Progress"));const t=c(o,s)?o:null,$=i(t)?b(t,s):void 0;return l.jsx(E,{scope:n,value:t,max:s,children:l.jsx(f.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":i(t)?t:void 0,"aria-valuetext":$,role:"progressbar","data-state":P(t,s),"data-value":t??void 0,"data-max":s,...h,ref:e})})});m.displayName=d;var x="ProgressIndicator",g=u.forwardRef((r,e)=>{const{__scopeProgress:n,...o}=r,a=R(x,n);return l.jsx(f.div,{"data-state":P(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...o,ref:e})});g.displayName=x;function j(r,e){return`${Math.round(r/e*100)}%`}function P(r,e){return r==null?"indeterminate":r===e?"complete":"loading"}function i(r){return typeof r=="number"}function p(r){return i(r)&&!isNaN(r)&&r>0}function c(r,e){return i(r)&&!isNaN(r)&&r<=e&&r>=0}function _(r,e){return`Invalid prop \`max\` of value \`${r}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${v}\`.`}function M(r,e){return`Invalid prop \`value\` of value \`${r}\` supplied to \`${e}\`. The \`value\` prop must be:
  - a positive number
  - less than the value passed to \`max\` (or ${v} if no \`max\` prop is set)
  - \`null\` or \`undefined\` if the progress is indeterminate.

Defaulting to \`null\`.`}var N=m,V=g;const A=u.forwardRef(({className:r,value:e,...n},o)=>l.jsx(N,{ref:o,className:I("relative h-2 w-full overflow-hidden rounded-full bg-secondary",r),...n,children:l.jsx(V,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));A.displayName=N.displayName;export{A as P};
