import{S as ie,i as ce,s as fe,E as W,a2 as Y,a3 as F,m as $,h as _,n as S,a4 as Z,b as M,J as v,O as _e,$ as P,D as x,F as ee,q as N,r as z,u as K,k as B,a as O,y as R,e as te,l as T,c as j,z as L,A as V,d as A,f as J,g as C,B as q,R as Q,v as G,a5 as de,K as ue,a0 as he,H as ne,a6 as ge}from"../chunks/index.d6a3d821.js";import{g as be}from"../chunks/navigation.0888c73f.js";import{C as ve,q as ke,d as we,a as Ce,t as $e,b as ye,c as Ee,e as Se,f as Ae}from"../chunks/ConceptView.4cac775f.js";import{u as Be}from"../chunks/urlHashStore.b081783b.js";import{c as X,S as me}from"../chunks/utils.c5a61a40.js";import{I as le,T as Te}from"../chunks/TrashCan.dd2b985e.js";import{M as Me}from"../chunks/Modal.a017af0f.js";function ae(a){let e,n;return{c(){e=Y("title"),n=N(a[1])},l(t){e=F(t,"title",{});var l=$(e);n=z(l,a[1]),l.forEach(_)},m(t,l){M(t,e,l),v(e,n)},p(t,l){l&2&&K(n,t[1])},d(t){t&&_(e)}}}function Ne(a){let e,n,t,l=a[1]&&ae(a),m=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:a[0]},{height:a[0]},a[2],a[3]],p={};for(let o=0;o{n(5,e=W(W({},e),ee(f))),n(3,p=x(e,m)),"size"in f&&n(0,o=f.size),"title"in f&&n(1,r=f.title)},a.$$.update=()=>{n(4,t=e["aria-label"]||e["aria-labelledby"]||r),n(2,l={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=ee(e),[o,r,l,p,t]}class Ie extends ie{constructor(e){super(),ce(this,e,ze,Ne,fe,{size:0,title:1})}}function se(a,e,n){const t=a.slice();return t[16]=e[n],t}function De(a){let e,n,t,l,m,p,o,r=a[4].data,f=[];for(let c=0;cA(f[c],1,1,()=>{f[c]=null});return t=new Ie({}),{c(){for(let c=0;c{w[E]=null}),J()),~t?(l=w[t],l?l.p(s,g):(l=w[t]=d[t](s),l.c()),C(l,1),l.m(n,null)):l=null);let I=o;o=y(s),o===I?~o&&k[o].p(s,g):(r&&(G(),A(k[I],1,1,()=>{k[I]=null}),J()),~o?(r=k[o],r?r.p(s,g):(r=k[o]=H[o](s),r.c()),C(r,1),r.m(p,null)):r=null),s[1]?h?(h.p(s,g),g&2&&C(h,1)):(h=oe(s),h.c(),C(h,1),h.m(u.parentNode,u)):h&&(G(),A(h,1,1,()=>{h=null}),J())},i(s){i||(C(l),C(r),C(b.$$.fragment,s),C(h),i=!0)},o(s){A(l),A(r),A(b.$$.fragment,s),A(h),i=!1},d(s){s&&_(e),~t&&w[t].d(),~o&&k[o].d(),s&&_(f),q(b,s),s&&_(c),h&&h.d(s),s&&_(u)}}}function Oe(a,e,n){let t,l,m,p,o,r=P,f=()=>(r(),r=de(t,s=>n(5,o=s)),t);Q(a,Be,s=>n(10,m=s)),a.$$.on_destroy.push(()=>r());let b,c,u=null;const i=ke();Q(a,i,s=>n(4,p=s));const d=we();Q(a,d,s=>n(3,l=s));function w(){if(u==null)return;const{namespace:s,name:g}=u;l.mutate([s,g],{onSuccess:()=>{var E;for(const[I,U]of Object.entries(Se)){const pe=(E=ge(Ae[I]).selectRowsSchema)==null?void 0:E.data;U.deleteConcept(s,g,pe)}n(1,u=null)}})}const D=s=>n(1,u={namespace:s.namespace,name:s.name}),H=()=>$e({command:ye.CreateConcept,onCreate:s=>be(X(s.detail.namespace,s.detail.name))}),k=()=>n(1,u=null),y=()=>n(1,u=null),h=()=>w();return a.$$.update=()=>{a.$$.dirty&1024&&m.onHashChange("/(?.+)/(?.+)",s=>{n(9,b=s.namespace),n(0,c=s.conceptName)}),a.$$.dirty&513&&f(n(2,t=b&&c?Ce(b,c):void 0))},[c,u,t,l,p,o,i,d,w,b,m,D,H,k,y,h]}class Qe extends ie{constructor(e){super(),ce(this,e,Oe,He,fe,{})}}export{Qe as component};