import{__assign as e}from"tslib";import{jsxs as i,jsx as t}from"react/jsx-runtime";import{useState as h,useEffect as s}from"react";import{Sparkles as r,Check as a}from"lucide-react";import n from"../../styles/OnboardingLoader.module.css.js";var d=[{id:1,label:"Saving station details"},{id:2,label:"Applying rule template"},{id:3,label:"Finalizing station setup"}],l=function(i){var h=i.status;return t("div","complete"===h?e({className:n.successIndicator},{children:t(a,{size:12,color:"white",strokeWidth:3})}):"in-progress"===h?e({className:n.progressIndicator},{children:t(r,{size:18,color:"#7C3AED"})}):{className:n.pendingIndicator})},c=function(i){var h=i.width,s=void 0===h?"100%":h,r=i.height,a=void 0===r?"10px":r,d=i.style;return t("div",{className:n.shimmerBar,style:e({width:s,height:a},d)})},p=function(){return i("div",e({className:n.shimmer1},{children:[t(c,{width:"100%",height:"12px"}),t(c,{width:"85%",height:"10px"}),t("div",{style:{height:"8px"}}),t(c,{width:"60%",height:"12px"}),t(c,{width:"90%",height:"10px"}),t(c,{width:"75%",height:"10px"}),t("div",{style:{height:"8px"}}),t(c,{width:"40%",height:"12px"}),t(c,{width:"100%",height:"10px"}),t(c,{width:"80%",height:"10px"}),t("div",{style:{height:"8px"}}),t(c,{width:"55%",height:"12px"}),t(c,{width:"95%",height:"10px"}),t(c,{width:"70%",height:"10px"}),t(c,{width:"45%",height:"12px"}),t(c,{width:"88%",height:"10px"})]}))},m=function(){return i("div",e({className:n.shimmer2},{children:[i("div",e({className:n.shimmer2Left},{children:[t(c,{width:"70%",height:"12px"}),t(c,{width:"50%",height:"10px"}),t("div",{style:{height:"12px"}}),t(c,{width:"80%",height:"12px"}),t(c,{width:"60%",height:"10px"}),t(c,{width:"90%",height:"10px"}),t("div",{style:{height:"12px"}}),t(c,{width:"45%",height:"12px"}),t(c,{width:"75%",height:"10px"}),t(c,{width:"55%",height:"10px"}),t("div",{style:{height:"12px"}}),t(c,{width:"65%",height:"10px"}),t(c,{width:"85%",height:"10px"})]})),t("div",{className:n.shimmer2Right})]}))},o=function(){return i("div",e({className:n.shimmer3},{children:[i("div",e({className:n.shimmer3Left},{children:[t(c,{width:"60%",height:"14px"}),t(c,{width:"40%",height:"10px"}),t("div",{style:{height:"16px"}}),t(c,{width:"75%",height:"12px"}),t(c,{width:"50%",height:"10px"})]})),i("div",e({className:n.shimmer3Right},{children:[t("div",{className:n.shimmer3Card}),t("div",{className:n.shimmer3Card,style:{animationDelay:"0.2s"}}),t("div",{className:n.shimmer3Card,style:{animationDelay:"0.4s"}})]}))]}))},g=function(e){switch(e.currentStepIndex){case 0:default:return t(p,{});case 1:return t(m,{});case 2:return t(o,{})}},u=function(a){var c=a.isLoading,p=a.steps,m=void 0===p?d:p,o=a.currentStep,u=a.stepIntervalMs,v=void 0===u?3e3:u,x=a.onComplete,w=h(0),f=w[0],N=w[1],y=void 0!==o,b=y?o:f;s(function(){if(!y){if(c){var e=setInterval(function(){N(function(i){var t=i+1;return t>=m.length?(clearInterval(e),null==x||x(),i):t})},v);return function(){return clearInterval(e)}}N(0)}},[c,m.length,v,x,y]),s(function(){c||N(0)},[c]),s(function(){y&&void 0!==o&&o>=m.length&&(null==x||x())},[y,o,m.length,x]);return c?i("div",e({className:n.overlay},{children:[i("div",e({className:n.leftSide},{children:[t("div",e({className:n.sparkleWrapper},{children:t(r,{size:32,color:"#7C3AED"})})),t("h2",e({className:n.title},{children:"Onboarding your Station"})),i("p",e({className:n.subtitle},{children:["We're setting up your station and applying the selected rule",t("br",{}),"templates. This may take a moment."]})),t("div",e({className:n.stepsList},{children:m.map(function(h,s){var r,a=(r=s)<b?"complete":r===b?"in-progress":"pending";return i("div",e({className:n.stepRow},{children:[t(l,{status:a}),t("span",e({className:"".concat(n.stepText," ").concat("in-progress"===a?n.stepTextActive:n.stepTextPending)},{children:h.label}))]}),h.id)})}))]})),t("div",e({className:n.rightSide},{children:t(g,{currentStepIndex:b})}))]})):null};export{u as default};
//# sourceMappingURL=OnboardingLoader.js.map
