import{S as j,i as B,s as D,A as S,f as h,n as g,p as I,e as v,a as w,b as m,d as T,g as p,a8 as M,u as N,q as O,r as Z,j as z,k as F,O as G,E as H,Z as J,al as K,a0 as L,$ as P,t as C,l as Q,h as E}from"./index.06d85743.js";function q(n,e,s){const t=n.slice();return t[11]=e[s],t}function R(n){let e,s=n[11].name+"",t,f,o,i;function a(){return n[9](n[11])}return{c(){e=v("button"),t=C(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){h(d,e,u),p(e,t),p(e,f),o||(i=Q(e,"click",a),o=!0)},p(d,u){n=d,u&4&&s!==(s=n[11].name+"")&&E(t,s)},d(d){d&&g(e),o=!1,i()}}}function U(n){let e,s=n[11].name+"",t,f;return{c(){e=v("button"),t=C(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(o,i){h(o,e,i),p(e,t),p(e,f)},p(o,i){i&4&&s!==(s=o[11].name+"")&&E(t,s)},d(o){o&&g(e)}}}function A(n,e){let s,t;function f(a,d){return a[11].id===a[3]?U:R}let o=f(e),i=o(e);return{key:n,first:null,c(){s=S(),i.c(),t=S(),this.first=s},m(a,d){h(a,s,d),i.m(a,d),h(a,t,d)},p(a,d){e=a,o===(o=f(e))&&i?i.p(e,d):(i.d(1),i=o(e),i&&(i.c(),i.m(t.parentNode,t)))},d(a){a&&g(s),i.d(a),a&&g(t)}}}function V(n){let e,s,t=[],f=new Map,o,i,a=n[2];const d=l=>l[11].id;for(let l=0;l<a.length;l+=1){let c=q(n,a,l),b=d(c);f.set(b,t[l]=A(b,c))}const u=n[8].default,_=I(u,n,n[7],null);return{c(){e=v("div"),s=v("div");for(let l=0;l<t.length;l+=1)t[l].c();o=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]),T(e,"hidden",!n[0])},m(l,c){h(l,e,c),p(e,s);for(let b=0;b<t.length;b+=1)t[b].m(s,null);p(e,o),_&&_.m(e,null),i=!0},p(l,[c]){c&44&&(a=l[2],t=M(t,c,d,1,l,a,f,s,K,A,null,q)),_&&_.p&&(!i||c&128)&&N(_,u,l,l[7],i?Z(u,l[7],c,null):O(l[7]),null),(!i||c&2)&&m(e,"id",l[1]),c&1&&T(e,"hidden",!l[0])},i(l){i||(z(_,l),i=!0)},o(l){F(_,l),i=!1},d(l){l&&g(e);for(let c=0;c<t.length;c+=1)t[c].d();_&&_.d(l)}}}const W={};function X(n,e,s){let t,{$$slots:f={},$$scope:o}=e,{visible:i=!0}=e,{elem_id:a}=e,{selected:d}=e,u=[];const _=L(!1);G(n,_,r=>s(3,t=r));const l=H();J(W,{register_tab:r=>{u.push({name:r.name,id:r.id}),_.update(k=>k??r.id),s(2,u)},unregister_tab:r=>{const k=u.findIndex(y=>y.id===r.id);u.splice(k,1),_.update(y=>y===r.id?u[k]?.id||u[u.length-1]?.id:y)},selected_tab:_});function c(r){P(_,t=r,t),l("change")}const b=r=>c(r.id);return n.$$set=r=>{"visible"in r&&s(0,i=r.visible),"elem_id"in r&&s(1,a=r.elem_id),"selected"in r&&s(6,d=r.selected),"$$scope"in r&&s(7,o=r.$$scope)},n.$$.update=()=>{n.$$.dirty&64&&d!==null&&c(d)},[i,a,u,t,_,c,d,o,f,b]}class x extends j{constructor(e){super(),B(this,e,X,V,D,{visible:0,elem_id:1,selected:6})}}export{x as T,W as a};
