import { f as fallback, w as writable } from './async-Djx13DAD.js';
import { i as slot, s as store_get, q as store_set, d as attr_class, a as attr, g as attr_style, j as stringify, e as ensure_array_like, u as unsubscribe_stores, c as bind_props } from './index-B7gr0Dsc.js';
import './2-CeYbpaU1.js';
import { g } from './utils.svelte-D8Xdzglu.js';
import { G, O } from './Walkthrough.svelte_svelte_type_style_lang-B-su9fRx.js';
import { c as createEventDispatcher } from './index-server-lqjMX237.js';
import { s as setContext } from './context-BZS6UlnY.js';
import { e as escape_html } from './escaping-CBnpiEl5.js';
import './uneval-DjLoL4oF.js';
import './clone-BLo8hHdj.js';
import './index5-BoOEKc6P.js';
import './dev-fallback-Bc5Ork7Y.js';

function L(x,p){x.component(e=>{var i;let r,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$1=[...u],z=true,y=0,f=false;const _=writable(d||s$1[0]?.id||false),n=writable(s$1.findIndex(l=>l?.id===d)||0),I=createEventDispatcher();async function m(){}setContext(O,{register_tab:(l,a)=>(s$1[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$1[0]?.id||false),s$1[a]=null;},selected_tab:_,selected_tab_index:n});function T(l,a){const g=s$1.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$1.findIndex(o=>o?.id===l)),I("change"));}if(r=s$1.length>0,d!==null&&T(d,s$1.findIndex(l=>l?.id===d)),m(),store_get(i??={},"$selected_tab_index",n),m(),v=s$1[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})}>`),r){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$1);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})}>${escape_html(o?.label!==void 0?o?.label:"Step "+(a+1))}</span>`)),e.push("<!--]--></button></div> "),a<s$1.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",{},null),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(x,p){x.component(e=>{let{$$slots:i,$$events:r,...v}=p;const c=new g(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,selected:c.props.selected,initial_tabs:c.props.initial_tabs,children:s$1=>{s$1.push("<!--[-->"),slot(s$1,p,"default",{},null),s$1.push("<!--]-->");},$$slots:{default:true}})):(u.push("<!--[!-->"),G(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$1=>{s$1.push("<!--[-->"),slot(s$1,p,"default",{},null),s$1.push("<!--]-->");},$$slots:{default:true}})),u.push("<!--]-->");}do b=true,h=e.copy(),d(h);while(!b);e.subsume(h);});}

export { G as BaseTabs, O as TABS, q as default };
//# sourceMappingURL=Index34-BsUoiN1o.js.map
