import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import t,{forwardRef as l,useRef as s,useCallback as i,useMemo as n}from"react";import"prop-types";import r from"classnames";import o from"../../hooks/useMergeRefs.js";import p from"../Icon/Icon.js";import a from"../Icon/Icons/components/Check.js";import{NOOP as m}from"../../utils/function-utils.js";import c from"./components/StepIndicator/StepIndicator.js";import{TEXT_PLACEMENTS as u,MULTI_STEP_TYPES as f,STEP_STATUSES as d}from"./MultiStepConstants.js";import"./MultiStepIndicator.scss.js";import C from"../Divider/Divider.js";var I=l((function(l,p){var a=l.className,m=l.type,f=l.steps,d=l.stepComponentClassName,I=l.dividerComponentClassName,N=l.fulfilledStepIcon,S=l.fulfilledStepIconType,y=l.isFulfilledStepDisplayNumber,v=l.onClick,j=l.textPlacement,b=s(null),g=o({refs:[p,b]}),D="multi-step-indicator--wrapper",E="".concat(D,"__divider"),T="".concat("multi-step-indicator--wrapper-vertical","__divider"),F=i((function(l,s){return t.createElement(t.Fragment,null,t.createElement(c,e({},l,{stepNumber:l.stepNumber||s+1,type:m,stepComponentClassName:d,fulfilledStepIcon:N,fulfilledStepIconType:S,onClick:v,isFulfilledStepDisplayNumber:y})),s!==f.length-1&&t.createElement(C,{direction:C.directions.HORIZONTAL,className:r(E,I)}))}),[v,y,m,d,N,S,I,E,f.length]),P=i((function(l,s){return t.createElement(t.Fragment,null,t.createElement(c,e({},l,{stepNumber:s+1,type:m,stepComponentClassName:d,fulfilledStepIcon:N,fulfilledStepIconType:S,onClick:v,isFollowedByDivider:s!==f.length+1,stepDividerClassName:r(E,I),isVertical:!0,isFulfilledStepDisplayNumber:y})))}),[v,y,m,d,N,S,I,E,f.length]),R=n((function(){return j===u.VERTICAL?P:F}),[j,P,F]);return t.createElement("ol",{ref:g,className:j===u.VERTICAL?T:r(D,a)},f.map(R))}));I.types=f,I.stepStatuses=d,I.textPlacements=u,I.defaultProps={className:"",stepComponentClassName:"",dividerComponentClassName:"",type:I.types.PRIMARY,steps:[],fulfilledStepIcon:a,fulfilledStepIconType:p.type.SVG,isFulfilledStepDisplayNumber:!1,onClick:m,textPlacement:I.textPlacements.HORIZONTAL};var N=I;export{N as default};
