import { f as fallback } from './async-D55cHugf.js';
import { b as store_get, o as store_set, f as attr_class, a as attr, g as attr_style, i as stringify, s as slot, u as unsubscribe_stores, d as bind_props, e as ensure_array_like } from './index-u8mz_F03.js';
import { a as setContext } from './context-CBkBucIx.js';
import { w as writable } from './index-Cg-Pg6j3.js';
import { e as escape_html } from './escaping-CBnpiEl5.js';

function O(v){v.push('<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="2.5" cy="8" r="1.5" fill="currentColor"></circle><circle cx="8" cy="8" r="1.5" fill="currentColor"></circle><circle cx="13.5" cy="8" r="1.5" fill="currentColor"></circle></svg>');}const z={};function J(v,_){v.component(e=>{var o;let p,m,r=fallback(_.visible,true),w=fallback(_.elem_id,""),y=fallback(_.elem_classes,()=>[],true),u=_.selected,h=_.initial_tabs,c=[...h],T=[...h],x=[],q=false,g=new Set;function I(s){for(let l=0;l<s.length;l++)s[l]&&!g.has(l)&&(c[l]=s[l]);}const n=writable(u||c[0]?.id||false),b=writable(c.findIndex(s=>s?.id===u)||0);let k=false;setContext(z,{register_tab:(s,l)=>(g.add(l),c[l]=s,store_get(o??={},"$selected_tab",n)===false&&s.visible!==false&&s.interactive&&(store_set(n,s.id),store_set(b,l)),l),unregister_tab:(s,l)=>{g.delete(l),store_get(o??={},"$selected_tab",n)===s.id&&store_set(n,c[0]?.id||false),c[l]=null;},selected_tab:n,selected_tab_index:b});function S(s){const l=c.find(d=>d?.id===s);s!==void 0&&l&&l.interactive&&l.visible!==false&&store_get(o??={},"$selected_tab",n)!==l.id&&(u=s,store_set(n,s),store_set(b,c.findIndex(d=>d?.id===s)),q=false);}async function j(){}function A(s){return s===false?false:x.some(l=>l?.id===s)}if(I(h),p=c.length>0,u!==null&&S(u),j(),k=A(store_get(o??={},"$selected_tab",n)),m=c[store_get(o??={},"$selected_tab_index",b)>=0?store_get(o??={},"$selected_tab_index",b):0]?.scale,e.push(`<div${attr_class(`tabs ${stringify(y.join(" "))}`,"svelte-11gaq1",{hide:r===false,hidden:r==="hidden"})}${attr("id",w)}${attr_style("",{"flex-grow":m})}>`),p){e.push("<!--[-->"),e.push('<div class="tab-wrapper svelte-11gaq1"><div class="tab-container visually-hidden svelte-11gaq1" aria-hidden="true"><!--[-->');const s=ensure_array_like(c);for(let i=0,f=s.length;i<f;i++){let a=s[i];a&&a?.visible!==false&&a?.visible!=="hidden"?(e.push("<!--[-->"),e.push(`<button class="svelte-11gaq1">${escape_html(a?.label)}</button>`)):e.push("<!--[!-->"),e.push("<!--]-->");}e.push('<!--]--></div> <div class="tab-container svelte-11gaq1" role="tablist"><!--[-->');const l=ensure_array_like(T);for(let i=0,f=l.length;i<f;i++){let a=l[i];a&&a?.visible!==false?(e.push("<!--[-->"),e.push(`<button role="tab"${attr("aria-selected",a.id===store_get(o??={},"$selected_tab",n))}${attr("aria-controls",a.elem_id)}${attr("disabled",!a.interactive,true)}${attr("aria-disabled",!a.interactive)}${attr("id",a.elem_id?a.elem_id+"-button":null)}${attr("data-tab-id",a.id)}${attr_class("svelte-11gaq1",void 0,{selected:a.id===store_get(o??={},"$selected_tab",n)})}>${escape_html(a?.label!==void 0?a?.label:"Tab "+(i+1))}</button>`)):e.push("<!--[!-->"),e.push("<!--]-->");}e.push(`<!--]--></div> <span${attr_class("overflow-menu svelte-11gaq1",void 0,{hide:true})}><button${attr_class("svelte-11gaq1",void 0,{"overflow-item-selected":k})}>`),O(e),e.push(`<!----></button> <div${attr_class("overflow-dropdown svelte-11gaq1",void 0,{hide:!q})}><!--[-->`);const d=ensure_array_like(x);for(let i=0,f=d.length;i<f;i++){let a=d[i];a?.visible!==false?(e.push("<!--[-->"),e.push(`<button${attr_class("svelte-11gaq1",void 0,{selected:a?.id===store_get(o??={},"$selected_tab",n)})}>${escape_html(a?.label)}</button>`)):e.push("<!--[!-->"),e.push("<!--]-->");}e.push("<!--]--></div></span></div>");}else e.push("<!--[!-->");e.push("<!--]--> <!--[-->"),slot(e,_,"default",{}),e.push("<!--]--></div>"),o&&unsubscribe_stores(o),bind_props(_,{visible:r,elem_id:w,elem_classes:y,selected:u,initial_tabs:h});});}

export { J, z };
//# sourceMappingURL=Walkthrough.svelte_svelte_type_style_lang-DRIsDysA.js.map
