import { f as fallback } from './async-D55cHugf.js';
import { s as slot, b as store_get, o as store_set, f as attr_class, a as attr, g as attr_style, i as stringify, e as ensure_array_like, u as unsubscribe_stores, d as bind_props } from './index-u8mz_F03.js';
import './2-EyCg4N-O.js';
import { $ } from './utils.svelte-C798QV9b.js';
import { J, z } from './Walkthrough.svelte_svelte_type_style_lang-DRIsDysA.js';
import { c as createEventDispatcher } from './index-server-CQz6EZl_.js';
import { w as writable } from './index-Cg-Pg6j3.js';
import { a as setContext } from './context-CBkBucIx.js';
import { e as escape_html } from './escaping-CBnpiEl5.js';
import './index5-BoOEKc6P.js';
import './dev-fallback-Bc5Ork7Y.js';
import './clone-Yk88IHKV.js';

function L(r,p){r.component(e=>{var i;let x,v,c=fallback(p.visible,true),b=fallback(p.elem_id,""),h=fallback(p.elem_classes,()=>[],true),d=p.selected,u=p.initial_tabs,s=[...u],z$1=true,y=0,f=false;const _=writable(d||s[0]?.id||false),n=writable(s.findIndex(l=>l?.id===d)||0),I=createEventDispatcher();async function m(){}setContext(z,{register_tab:(l,a)=>(s[a]=l,store_get(i??={},"$selected_tab",_)===false&&l.visible&&l.interactive&&(store_set(_,l.id),store_set(n,a)),a),unregister_tab:(l,a)=>{store_get(i??={},"$selected_tab",_)===l.id&&store_set(_,s[0]?.id||false),s[a]=null;},selected_tab:_,selected_tab_index:n});function T(l,a){const g=s.find(o=>o?.id===l);l!==void 0&&g&&g.interactive&&g.visible&&store_get(i??={},"$selected_tab",_)!==g.id&&(d=l,store_set(_,l),store_set(n,s.findIndex(o=>o?.id===l)),I("change"));}if(x=s.length>0,d!==null&&T(d,s.findIndex(l=>l?.id===d)),m(),store_get(i??={},"$selected_tab_index",n),m(),v=s[store_get(i??={},"$selected_tab_index",n)>=0?store_get(i??={},"$selected_tab_index",n):0]?.scale,e.push(`<div${attr_class(`stepper ${stringify(h.join(" "))}`,"svelte-1xpzbgb",{hide:!c,compact:f})}${attr("id",b)}${attr_style("",{"flex-grow":v})}>`),x){e.push("<!--[-->"),e.push("<!--[!-->"),e.push(`<!--]--> <div class="stepper-wrapper svelte-1xpzbgb"${attr_style("",{"--label-height":y+"px"})}><div class="stepper-container svelte-1xpzbgb" role="tablist"><!--[-->`);const l=ensure_array_like(s);for(let a=0,g=l.length;a<g;a++){let o=l[a];o?.visible?(e.push("<!--[-->"),e.push(`<div class="step-item svelte-1xpzbgb"><button role="tab"${attr_class("step-button svelte-1xpzbgb",void 0,{active:o.id===store_get(i??={},"$selected_tab",_),completed:o.id<store_get(i??={},"$selected_tab",_),pending:o.id>store_get(i??={},"$selected_tab",_)})}${attr("aria-selected",o.id===store_get(i??={},"$selected_tab",_))}${attr("aria-controls",o.elem_id)}${attr("disabled",!o.interactive||a>store_get(i??={},"$selected_tab_index",n),true)}${attr("aria-disabled",!o.interactive||a>store_get(i??={},"$selected_tab_index",n))}${attr("id",o.elem_id?o.elem_id+"-button":null)}${attr("data-tab-id",o.id)}><span class="step-number svelte-1xpzbgb">`),o.id<store_get(i??={},"$selected_tab",_)?(e.push("<!--[-->"),e.push('<svg width="12" height="10" viewBox="0 0 12 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 5L4.5 8.5L11 1.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>')):(e.push("<!--[!-->"),e.push(`${escape_html(a+1)}`)),e.push("<!--]--></span> "),(e.push("<!--[-->"),e.push(`<span${attr_class("step-label svelte-1xpzbgb",void 0,{visible:z$1})}>${escape_html(o?.label!==void 0?o?.label:"Step "+(a+1))}</span>`)),e.push("<!--]--></button></div> "),a<s.length-1&&!f?(e.push("<!--[-->"),e.push(`<div${attr_class("step-connector svelte-1xpzbgb",void 0,{completed:a<store_get(i??={},"$selected_tab_index",n)})}></div>`)):e.push("<!--[!-->"),e.push("<!--]-->")):e.push("<!--[!-->"),e.push("<!--]-->");}e.push("<!--]--></div></div>");}else e.push("<!--[!-->");e.push("<!--]--> <!--[-->"),slot(e,p,"default",{}),e.push("<!--]--></div>"),i&&unsubscribe_stores(i),bind_props(p,{visible:c,elem_id:b,elem_classes:h,selected:d,initial_tabs:u});});}function q(r,p){r.component(e=>{let{$$slots:i,$$events:x,...v}=p;const c=new $(v);let b=true,h;function d(u){c.props.name==="walkthrough"?(u.push("<!--[-->"),L(u,{visible:c.shared.visible,elem_id:c.shared.elem_id,elem_classes:c.shared.elem_classes,initial_tabs:c.props.initial_tabs,get selected(){return c.props.selected},set selected(s){c.props.selected=s,b=false;},children:s=>{s.push("<!--[-->"),slot(s,p,"default",{}),s.push("<!--]-->");},$$slots:{default:true}})):(u.push("<!--[!-->"),J(u,{visible:c.shared.visible,elem_id:c.shared.elem_id,elem_classes:c.shared.elem_classes,initial_tabs:c.props.initial_tabs,get selected(){return c.props.selected},set selected(s){c.props.selected=s,b=false;},children:s=>{s.push("<!--[-->"),slot(s,p,"default",{}),s.push("<!--]-->");},$$slots:{default:true}})),u.push("<!--]-->");}do b=true,h=e.copy(),d(h);while(!b);e.subsume(h);});}

export { J as BaseTabs, z as TABS, q as default };
//# sourceMappingURL=Index31-CVv3wbrD.js.map
