"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),g=require("../node_modules/.pnpm/@ant-design_colors@7.2.1/node_modules/@ant-design/colors/es/presets.js"),h=require("../_util/type.js"),$=require("./props.js"),u=require("./utils.js"),v=()=>({...$.progressProps(),strokeColor:h.anyType(),direction:h.stringType()}),m=e=>{let s=[];return Object.keys(e).forEach(r=>{const o=Number.parseFloat(r.replace(/%/g,""));isNaN(o)||s.push({key:o,value:e[r]})}),s=s.sort((r,o)=>r.key-o.key),s.map(({key:r,value:o})=>`${o} ${r}%`).join(", ")},y=(e,s)=>{const{from:r=g.presetPrimaryColors.blue,to:o=g.presetPrimaryColors.blue,direction:n=s==="rtl"?"to left":"to right",...c}=e;if(Object.keys(c).length!==0){const a=m(c);return{backgroundImage:`linear-gradient(${n}, ${a})`}}return{backgroundImage:`linear-gradient(${n}, ${r}, ${o})`}},p=t.defineComponent({compatConfig:{MODE:3},name:"ProgressLine",inheritAttrs:!1,props:v(),setup(e,{slots:s,attrs:r}){const o=t.computed(()=>{const{strokeColor:i,direction:C}=e;return i&&typeof i!="string"?y(i,C):{backgroundColor:i}}),n=t.computed(()=>e.strokeLinecap==="square"||e.strokeLinecap==="butt"?0:void 0),c=t.computed(()=>e.trailColor?{backgroundColor:e.trailColor}:void 0),a=t.computed(()=>e.size??[-1,e.strokeWidth||(e.size==="small"?6:8)]),l=t.computed(()=>u.getSize(a.value,"line",{strokeWidth:e.strokeWidth})),b=t.computed(()=>{const{percent:i}=e;return{width:`${u.validProgress(i)}%`,height:`${l.value.height}px`,borderRadius:n.value,...o.value}}),d=t.computed(()=>u.getSuccessPercent(e)),f=t.computed(()=>{const{success:i}=e;return{width:`${u.validProgress(d.value)}%`,height:`${l.value.height}px`,borderRadius:n.value,backgroundColor:i?.strokeColor}}),k={width:l.value.width<0?"100%":l.value.width,height:`${l.value.height}px`};return()=>t.createVNode(t.Fragment,null,[t.createVNode("div",{...r,class:[`${e.prefixCls}-outer`,r.class],style:[r.style,k]},[t.createVNode("div",{class:`${e.prefixCls}-inner`,style:c.value},[t.createVNode("div",{class:`${e.prefixCls}-bg`,style:b.value},null),d.value!==void 0?t.createVNode("div",{class:`${e.prefixCls}-success-bg`,style:f.value},null):null])]),s.default?.()])}});exports.default=p;exports.handleGradient=y;exports.lineProps=v;exports.sortGradient=m;
