import{l as B,m as E,s as G,M as H,n as y,o as w,v as m,w as q,x as g,y as p,aA as I,N as J,O,Q as P,G as Q,H as W,J as k,W as Y,Y as j,ao as z,a0 as C,aP as F,aq as K,ap as L,t as N,A as R,D as S}from"./index.881b9b68.js";function D(n,e,s){const t=n.slice();return t[11]=e[s],t}function U(n){let e,s=n[11].name+"",t,f,r,a;function i(){return n[9](n[11])}return{c(){e=y("button"),t=N(s),f=w(),m(e,"class","px-4 pb-2 pt-1.5 border-transparent text-gray-400 hover:text-gray-700 -mb-[2px] border-2 border-b-0")},m(d,u){g(d,e,u),p(e,t),p(e,f),r||(a=R(e,"click",i),r=!0)},p(d,u){n=d,u&4&&s!==(s=n[11].name+"")&&S(t,s)},d(d){d&&k(e),r=!1,a()}}}function V(n){let e,s=n[11].name+"",t,f;return{c(){e=y("button"),t=N(s),f=w(),m(e,"class","bg-white px-4 pb-2 pt-1.5 rounded-t-lg border-gray-200 -mb-[2px] border-2 border-b-0")},m(r,a){g(r,e,a),p(e,t),p(e,f)},p(r,a){a&4&&s!==(s=r[11].name+"")&&S(t,s)},d(r){r&&k(e)}}}function M(n,e){let s,t;function f(i,d){return i[11].id===i[3]?V:U}let r=f(e),a=r(e);return{key:n,first:null,c(){s=C(),a.c(),t=C(),this.first=s},m(i,d){g(i,s,d),a.m(i,d),g(i,t,d)},p(i,d){e=i,r===(r=f(e))&&a?a.p(e,d):(a.d(1),a=r(e),a&&(a.c(),a.m(t.parentNode,t)))},d(i){i&&k(s),a.d(i),i&&k(t)}}}function X(n){let e,s,t=[],f=new Map,r,a,i=n[2];const d=l=>l[11].id;for(let l=0;l<i.length;l+=1){let c=D(n,i,l),b=d(c);f.set(b,t[l]=M(b,c))}const u=n[8].default,_=H(u,n,n[7],null);return{c(){e=y("div"),s=y("div");for(let l=0;l<t.length;l+=1)t[l].c();r=w(),_&&_.c(),m(s,"class","flex border-b-2 flex-wrap dark:border-gray-700"),m(e,"class","tabs flex flex-col my-4"),m(e,"id",n[1]),q(e,"hidden",!n[0])},m(l,c){g(l,e,c),p(e,s);for(let b=0;b<t.length;b+=1)t[b].m(s,null);p(e,r),_&&_.m(e,null),a=!0},p(l,[c]){c&44&&(i=l[2],t=I(t,c,d,1,l,i,f,s,F,M,null,D)),_&&_.p&&(!a||c&128)&&J(_,u,l,l[7],a?P(u,l[7],c,null):O(l[7]),null),(!a||c&2)&&m(e,"id",l[1]),c&1&&q(e,"hidden",!l[0])},i(l){a||(Q(_,l),a=!0)},o(l){W(_,l),a=!1},d(l){l&&k(e);for(let c=0;c<t.length;c+=1)t[c].d();_&&_.d(l)}}}const Z={};function x(n,e,s){let t,{$$slots:f={},$$scope:r}=e,{visible:a=!0}=e,{elem_id:i}=e,{selected:d}=e,u=[];const _=K(!1);Y(n,_,o=>s(3,t=o));const l=j();z(Z,{register_tab:o=>{u.push({name:o.name,id:o.id}),_.update(h=>h!=null?h:o.id),s(2,u)},unregister_tab:o=>{const h=u.findIndex(v=>v.id===o.id);u.splice(h,1),_.update(v=>{var A,T;return v===o.id?((A=u[h])==null?void 0:A.id)||((T=u[u.length-1])==null?void 0:T.id):v})},selected_tab:_});function c(o){L(_,t=o,t),l("change")}const b=o=>c(o.id);return n.$$set=o=>{"visible"in o&&s(0,a=o.visible),"elem_id"in o&&s(1,i=o.elem_id),"selected"in o&&s(6,d=o.selected),"$$scope"in o&&s(7,r=o.$$scope)},n.$$.update=()=>{n.$$.dirty&64&&d!==null&&c(d)},[a,i,u,t,_,c,d,r,f,b]}class ee extends B{constructor(e){super(),E(this,e,x,X,G,{visible:0,elem_id:1,selected:6})}}export{ee as T,Z as a};
