import{S as _e,i as de,s as he,E as x,_ as J,$ as Q,m as C,h as d,n as E,a0 as te,b as y,J as $,O as Ce,a1 as Y,D as ne,F as ae,q as N,r as P,u as U,y as V,z as L,A as q,g as w,d as S,B as H,R as F,k as B,a as j,e as le,l as T,c as K,v as W,f as X,a5 as we,K as ge,a3 as Ee,H as G,a6 as Se,a7 as ye,P as Ae,a8 as Be}from"../chunks/index.c7ccf096.js";import{g as se,c as Z,S as be}from"../chunks/utils.d5b83cd1.js";import{P as Te,h as De,R as re}from"../chunks/Page.c565e4f4.js";import{q as Ie,d as Me,a as Ne,C as Pe,t as oe,b as ie,I as ce,c as Re,T as ze,e as Ve,f as Le}from"../chunks/ConceptView.83e55fef.js";import{a as qe}from"../chunks/taskQueries.d9517cd8.js";import{M as He,u as Oe}from"../chunks/urlHashStore.f5ca7f47.js";import{B as Ye}from"../chunks/taskMonitoringStore.a15b9cd5.js";function fe(l){let e,n;return{c(){e=J("title"),n=N(l[1])},l(t){e=Q(t,"title",{});var a=C(e);n=P(a,l[1]),a.forEach(d)},m(t,a){y(t,e,a),$(e,n)},p(t,a){a&2&&U(n,t[1])},d(t){t&&d(e)}}}function je(l){let e,n,t,a=l[1]&&fe(l),o=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:l[0]},{height:l[0]},l[2],l[3]],g={};for(let u=0;u{n(5,e=x(x({},e),ae(r))),n(3,g=ne(e,o)),"size"in r&&n(0,u=r.size),"title"in r&&n(1,i=r.title)},l.$$.update=()=>{n(4,t=e["aria-label"]||e["aria-labelledby"]||i),n(2,a={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=ae(e),[u,i,a,g,t]}class Ue extends _e{constructor(e){super(),de(this,e,Ke,je,he,{size:0,title:1})}}function ue(l,e,n){const t=l.slice();return t[20]=e[n],t}function Fe(l){let e,n,t,a,o,g,u,i=l[5].data,r=[];for(let f=0;fS(r[f],1,1,()=>{r[f]=null});return t=new Ue({}),{c(){for(let f=0;f{v[I]=null}),X()),~n?(t=v[n],t?t.p(c,b):(t=v[n]=D[n](c),t.c()),w(t,1),t.m(e,null)):t=null);let _=i;i=A(c),i===_?~i&&R[i].p(c,b):(r&&(W(),S(R[_],1,1,()=>{R[_]=null}),X()),~i?(r=R[i],r?r.p(c,b):(r=R[i]=O[i](c),r.c()),w(r,1),r.m(u,null)):r=null),c[1]?p?(p.p(c,b),b&2&&w(p,1)):(p=pe(c),p.c(),w(p,1),p.m(s.parentNode,s)):p&&(W(),S(p,1,1,()=>{p=null}),X())},i(c){h||(w(t),w(r),w(f.$$.fragment,c),w(p),h=!0)},o(c){S(t),S(r),S(f.$$.fragment,c),S(p),h=!1},d(c){c&&d(e),~n&&v[n].d(),c&&d(a),c&&d(o),~i&&R[i].d(),c&&d(k),H(f,c),c&&d(m),p&&p.d(c),c&&d(s)}}}function xe(l){let e;return{c(){e=N("Add Concept")},l(n){e=P(n,"Add Concept")},m(n,t){y(n,e,t)},d(n){n&&d(e)}}}function et(l){let e,n,t;return n=new Ye({props:{$$slots:{default:[xe]},$$scope:{ctx:l}}}),n.$on("click",l[14]),{c(){e=B("div"),V(n.$$.fragment),this.h()},l(a){e=T(a,"DIV",{slot:!0});var o=C(e);L(n.$$.fragment,o),o.forEach(d),this.h()},h(){E(e,"slot","header-right")},m(a,o){y(a,e,o),q(n,e,null),t=!0},p(a,o){const g={};o&8388608&&(g.$$scope={dirty:o,ctx:a}),n.$set(g)},i(a){t||(w(n.$$.fragment,a),t=!0)},o(a){S(n.$$.fragment,a),t=!1},d(a){a&&d(e),H(n)}}}function tt(l){let e,n;return e=new Te({props:{title:"Concepts",$$slots:{"header-right":[et],default:[Ze]},$$scope:{ctx:l}}}),{c(){V(e.$$.fragment)},l(t){L(e.$$.fragment,t)},m(t,a){q(e,t,a),n=!0},p(t,[a]){const o={};a&8388731&&(o.$$scope={dirty:a,ctx:t}),e.$set(o)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){S(e.$$.fragment,t),n=!1},d(t){H(e,t)}}}function nt(l,e,n){let t,a,o,g,u,i,r,k=Y,f=()=>(k(),k=we(a,_=>n(6,r=_)),a);F(l,Oe,_=>n(13,u=_)),l.$$.on_destroy.push(()=>k());let m,s,h=null;const D=Ie();F(l,D,_=>n(5,i=_));const v=Me();F(l,v,_=>n(4,o=_));const z=qe();F(l,z,_=>n(12,g=_));function O(){if(h==null)return;const{namespace:_,name:M}=h;o.mutate([_,M],{onSuccess:()=>{var ee;for(const[ve,$e]of Object.entries(Re)){const ke=(ee=Be(Le[ve]).selectRowsSchema)==null?void 0:ee.data;$e.deleteConcept(_,M,ke)}n(1,h=null)}})}const R=()=>oe({command:ie.CreateConcept,onCreate:_=>se(Z(_.detail.namespace,_.detail.name))}),A=_=>n(1,h={namespace:_.namespace,name:_.name}),p=()=>oe({command:ie.CreateConcept,onCreate:_=>se(Z(_.detail.namespace,_.detail.name))}),c=()=>n(1,h=null),b=()=>n(1,h=null),I=()=>O();return l.$$.update=()=>{var _;l.$$.dirty&8192&&u.onHashChange("",()=>{n(11,m=void 0),n(0,s=void 0)}),l.$$.dirty&8192&&u.onHashChange("/(?.+)/(?.+)",M=>{n(11,m=M.namespace),n(0,s=M.conceptName)}),l.$$.dirty&4096&&n(3,t=((_=g.data)==null?void 0:_.read_only)??!0),l.$$.dirty&2049&&f(n(2,a=m&&s?Ne(m,s):void 0))},[s,h,a,t,o,i,r,D,v,z,O,m,g,u,R,A,p,c,b,I]}class ft extends _e{constructor(e){super(),de(this,e,nt,tt,he,{})}}export{ft as component};