import{S as ke,i as we,s as ye,y as O,z as L,A,g as $,d as v,B as U,O as ne,a as q,c as F,b as H,h,k as w,l as y,m as E,n as C,a0 as _,v as ee,f as te,w as Ee,T as Ce,q as M,r as B,G as x,H as ie,u as se,U as Ie,e as re,a1 as ae,a7 as Te,a8 as Me,M as De,ab as Be,ad as Oe,ae as Le}from"../chunks/index.8706e7a3.js";import{g as fe}from"../chunks/navigation.5a12ff62.js";import{P as Ae}from"../chunks/Page.a00a6e3e.js";import{A as Ue,i as Se,b as He,D as qe,E as Ne,F as Fe,M as je,G as ze,H as Ge,I as Re,J as Ke,K as Je,c as Ve,g as Qe,n as We,d as Xe,h as Pe,L as _e,N as Ye,O as Ze,P as xe}from"../chunks/Commands.0d29256a.js";import{T as et,V as tt,a as nt,I as he,S as lt,C as st}from"../chunks/ConceptView.56f2a192.js";import{T as at}from"../chunks/StringSpanHighlight.8d1f5830.js";import{S as ot,M as rt}from"../chunks/Settings.92d5275a.js";import{f as it}from"../chunks/notificationsStore.2895bc3e.js";function ct(a){let e,n,t,l,o,i,r,s,u,m,p,f,c,d,b,k,Q,z,J,N,W,G,D,T,V,g,S,j,P;function R(I){a[19](I)}let X={invalid:a[5]!=a[7]};return a[5]!==void 0&&(X.value=a[5]),N=new Ke({props:X}),Ee.push(()=>Ce(N,"value",R)),V=new et({}),{c(){e=w("div"),n=w("section"),t=w("section"),l=w("div"),o=M("Delete this concept"),i=q(),r=w("div"),s=w("p"),u=M("This action cannot be undone."),m=q(),p=w("p"),f=M(`This will permanently delete the
                    `),c=w("span"),d=M(a[7]),b=M(` dataset and all its files. Please
                    type
                    `),k=w("span"),Q=M(a[7]),z=M(" to confirm."),J=q(),O(N.$$.fragment),G=q(),D=w("button"),T=M(`I understand, delete this concept
                  `),O(V.$$.fragment),this.h()},l(I){e=y(I,"DIV",{class:!0});var K=E(e);n=y(K,"SECTION",{class:!0});var Y=E(n);t=y(Y,"SECTION",{class:!0});var Z=E(t);l=y(Z,"DIV",{class:!0});var ue=E(l);o=B(ue,"Delete this concept"),ue.forEach(h),i=F(Z),r=y(Z,"DIV",{class:!0});var oe=E(r);s=y(oe,"P",{class:!0});var pe=E(s);u=B(pe,"This action cannot be undone."),pe.forEach(h),m=F(oe),p=y(oe,"P",{});var le=E(p);f=B(le,`This will permanently delete the
                    `),c=y(le,"SPAN",{class:!0});var de=E(c);d=B(de,a[7]),de.forEach(h),b=B(le,` dataset and all its files. Please
                    type
                    `),k=y(le,"SPAN",{class:!0});var me=E(k);Q=B(me,a[7]),me.forEach(h),z=B(le," to confirm."),le.forEach(h),oe.forEach(h),J=F(Z),L(N.$$.fragment,Z),G=F(Z),D=y(Z,"BUTTON",{class:!0});var ce=E(D);T=B(ce,`I understand, delete this concept
                  `),L(V.$$.fragment,ce),ce.forEach(h),Z.forEach(h),Y.forEach(h),K.forEach(h),this.h()},h(){C(l,"class","text-lg text-gray-700"),C(s,"class","mb-2"),C(c,"class","font-bold"),C(k,"class","font-bold"),C(r,"class","mb-4 text-sm text-gray-500"),C(D,"class","mt-2 flex cursor-pointer flex-row justify-between p-4 text-left outline-red-400 hover:bg-gray-200"),D.disabled=g=a[5]!=a[7],x(D,"cursor-not-allowed",a[5]!=a[7]),x(D,"outline",a[5]==a[7]),x(D,"opacity-50",a[5]!=a[7]),C(t,"class","flex flex-col gap-y-1"),C(n,"class","flex flex-col gap-y-1"),C(e,"class","flex flex-col gap-y-6")},m(I,K){H(I,e,K),_(e,n),_(n,t),_(t,l),_(l,o),_(t,i),_(t,r),_(r,s),_(s,u),_(r,m),_(r,p),_(p,f),_(p,c),_(c,d),_(p,b),_(p,k),_(k,Q),_(p,z),_(t,J),A(N,t,null),_(t,G),_(t,D),_(D,T),A(V,D,null),S=!0,j||(P=ie(D,"click",a[20]),j=!0)},p(I,K){(!S||K&128)&&se(d,I[7]),(!S||K&128)&&se(Q,I[7]);const Y={};K&160&&(Y.invalid=I[5]!=I[7]),!W&&K&32&&(W=!0,Y.value=I[5],Ie(()=>W=!1)),N.$set(Y),(!S||K&160&&g!==(g=I[5]!=I[7]))&&(D.disabled=g),(!S||K&160)&&x(D,"cursor-not-allowed",I[5]!=I[7]),(!S||K&160)&&x(D,"outline",I[5]==I[7]),(!S||K&160)&&x(D,"opacity-50",I[5]!=I[7])},i(I){S||($(N.$$.fragment,I),$(V.$$.fragment,I),S=!0)},o(I){v(N.$$.fragment,I),v(V.$$.fragment,I),S=!1},d(I){I&&h(e),U(N),U(V),j=!1,P()}}}function ft(a){let e,n,t,l;const o=[pt,ut],i=[];function r(s,u){return s[3].isFetching?0:1}return e=r(a),n=i[e]=o[e](a),{c(){n.c(),t=re()},l(s){n.l(s),t=re()},m(s,u){i[e].m(s,u),H(s,t,u),l=!0},p(s,u){let m=e;e=r(s),e===m?i[e].p(s,u):(ee(),v(i[m],1,1,()=>{i[m]=null}),te(),n=i[e],n?n.p(s,u):(n=i[e]=o[e](s),n.c()),$(n,1),n.m(t.parentNode,t))},i(s){l||($(n),l=!0)},o(s){v(n),l=!1},d(s){i[e].d(s),s&&h(t)}}}function ut(a){let e,n,t,l,o,i,r,s,u,m,p,f,c,d,b,k,Q,z,J,N;i=new at({props:{value:a[6].description,cols:50,placeholder:"Enter a description...",rows:3,class:"mb-2"}}),i.$on("input",a[13]),c=new Je({props:{labelText:"Publicly visible",checked:a[6].is_public}}),c.$on("check",a[18]);const W=[mt,dt],G=[];function D(T,V){return T[6].is_public?0:1}return b=D(a),k=G[b]=W[b](a),{c(){e=w("div"),n=w("section"),t=w("div"),l=M("Description"),o=q(),O(i.$$.fragment),r=q(),s=w("section"),u=w("div"),m=M("Visibility"),p=q(),f=w("div"),O(c.$$.fragment),d=q(),k.c(),Q=q(),z=w("div"),J=M(`Setting the concept to publicly visible will allow any user with access to this
                  Lilac instance to view this concept.`),this.h()},l(T){e=y(T,"DIV",{class:!0});var V=E(e);n=y(V,"SECTION",{class:!0});var g=E(n);t=y(g,"DIV",{class:!0});var S=E(t);l=B(S,"Description"),S.forEach(h),o=F(g),L(i.$$.fragment,g),g.forEach(h),r=F(V),s=y(V,"SECTION",{class:!0});var j=E(s);u=y(j,"DIV",{class:!0});var P=E(u);m=B(P,"Visibility"),P.forEach(h),p=F(j),f=y(j,"DIV",{class:!0});var R=E(f);L(c.$$.fragment,R),d=F(R),k.l(R),R.forEach(h),Q=F(j),z=y(j,"DIV",{class:!0});var X=E(z);J=B(X,`Setting the concept to publicly visible will allow any user with access to this
                  Lilac instance to view this concept.`),X.forEach(h),j.forEach(h),V.forEach(h),this.h()},h(){C(t,"class","text-base"),C(n,"class","flex flex-col gap-y-1"),C(u,"class","text-base"),C(f,"class","flex flex-row items-center"),C(z,"class","text-xs font-light"),C(s,"class","flex flex-col gap-y-1"),C(e,"class","flex flex-col gap-y-6")},m(T,V){H(T,e,V),_(e,n),_(n,t),_(t,l),_(n,o),A(i,n,null),_(e,r),_(e,s),_(s,u),_(u,m),_(s,p),_(s,f),A(c,f,null),_(f,d),G[b].m(f,null),_(s,Q),_(s,z),_(z,J),N=!0},p(T,V){const g={};V&64&&(g.value=T[6].description),i.$set(g);const S={};V&64&&(S.checked=T[6].is_public),c.$set(S);let j=b;b=D(T),b!==j&&(ee(),v(G[j],1,1,()=>{G[j]=null}),te(),k=G[b],k||(k=G[b]=W[b](T),k.c()),$(k,1),k.m(f,null))},i(T){N||($(i.$$.fragment,T),$(c.$$.fragment,T),$(k),N=!0)},o(T){v(i.$$.fragment,T),v(c.$$.fragment,T),v(k),N=!1},d(T){T&&h(e),U(i),U(c),G[b].d()}}}function pt(a){let e,n;return e=new Ve({}),{c(){O(e.$$.fragment)},l(t){L(e.$$.fragment,t)},m(t,l){A(e,t,l),n=!0},p:ae,i(t){n||($(e.$$.fragment,t),n=!0)},o(t){v(e.$$.fragment,t),n=!1},d(t){U(e,t)}}}function dt(a){let e,n;return e=new tt({}),{c(){O(e.$$.fragment)},l(t){L(e.$$.fragment,t)},m(t,l){A(e,t,l),n=!0},i(t){n||($(e.$$.fragment,t),n=!0)},o(t){v(e.$$.fragment,t),n=!1},d(t){U(e,t)}}}function mt(a){let e,n;return e=new nt({}),{c(){O(e.$$.fragment)},l(t){L(e.$$.fragment,t)},m(t,l){A(e,t,l),n=!0},i(t){n||($(e.$$.fragment,t),n=!0)},o(t){v(e.$$.fragment,t),n=!1},d(t){U(e,t)}}}function _t(a){let e,n,t,l,o,i,r,s;t=new Re({props:{items:[{title:"General",value:"general"},{title:"Administration",value:"administration"}],item:a[4]}}),t.$on("select",a[17]);const u=[ft,ct],m=[];function p(f,c){return f[4]==="general"?0:f[4]==="administration"?1:-1}return~(i=p(a))&&(r=m[i]=u[i](a)),{c(){e=w("div"),n=w("div"),O(t.$$.fragment),l=q(),o=w("div"),r&&r.c(),this.h()},l(f){e=y(f,"DIV",{class:!0});var c=E(e);n=y(c,"DIV",{class:!0});var d=E(n);L(t.$$.fragment,d),d.forEach(h),l=F(c),o=y(c,"DIV",{class:!0});var b=E(o);r&&r.l(b),b.forEach(h),c.forEach(h),this.h()},h(){C(n,"class","-ml-4 mr-4 w-96 grow-0 p-1"),C(o,"class","flex w-full flex-col gap-y-6 rounded border border-gray-300 bg-white p-4"),C(e,"class","flex flex-row")},m(f,c){H(f,e,c),_(e,n),A(t,n,null),_(e,l),_(e,o),~i&&m[i].m(o,null),s=!0},p(f,c){const d={};c&16&&(d.item=f[4]),t.$set(d);let b=i;i=p(f),i===b?~i&&m[i].p(f,c):(r&&(ee(),v(m[b],1,1,()=>{m[b]=null}),te()),~i?(r=m[i],r?r.p(f,c):(r=m[i]=u[i](f),r.c()),$(r,1),r.m(o,null)):r=null)},i(f){s||($(t.$$.fragment,f),$(r),s=!0)},o(f){v(t.$$.fragment,f),v(r),s=!1},d(f){f&&h(e),U(t),~i&&m[i].d()}}}function ht(a){let e,n,t,l,o,i;return e=new je({props:{label:a[2],title:"Concept settings"}}),t=new ze({props:{hasForm:!0,$$slots:{default:[_t]},$$scope:{ctx:a}}}),o=new Ge({props:{danger:a[4]==="administration",primaryButtonText:"Save",secondaryButtonText:"Cancel",primaryButtonDisabled:a[4]==="administration"}}),o.$on("click:button--secondary",close),{c(){O(e.$$.fragment),n=q(),O(t.$$.fragment),l=q(),O(o.$$.fragment)},l(r){L(e.$$.fragment,r),n=F(r),L(t.$$.fragment,r),l=F(r),L(o.$$.fragment,r)},m(r,s){A(e,r,s),H(r,n,s),A(t,r,s),H(r,l,s),A(o,r,s),i=!0},p(r,s){const u={};s&4&&(u.label=r[2]),e.$set(u);const m={};s&8389118&&(m.$$scope={dirty:s,ctx:r}),t.$set(m);const p={};s&16&&(p.danger=r[4]==="administration"),s&16&&(p.primaryButtonDisabled=r[4]==="administration"),o.$set(p)},i(r){i||($(e.$$.fragment,r),$(t.$$.fragment,r),$(o.$$.fragment,r),i=!0)},o(r){v(e.$$.fragment,r),v(t.$$.fragment,r),v(o.$$.fragment,r),i=!1},d(r){U(e,r),r&&h(n),U(t,r),r&&h(l),U(o,r)}}}function gt(a){let e,n;return e=new Ue({props:{open:a[0],$$slots:{default:[ht]},$$scope:{ctx:a}}}),e.$on("submit",a[12]),e.$on("close",a[21]),{c(){O(e.$$.fragment)},l(t){L(e.$$.fragment,t)},m(t,l){A(e,t,l),n=!0},p(t,[l]){const o={};l&1&&(o.open=t[0]),l&8389118&&(o.$$scope={dirty:l,ctx:t}),e.$set(o)},i(t){n||($(e.$$.fragment,t),n=!0)},o(t){v(e.$$.fragment,t),n=!1},d(t){U(e,t)}}}function $t(a,e,n){let t,l,o,i,r,s,u,{namespace:m}=e,{conceptName:p}=e;const f=Se();ne(a,f,g=>n(3,s=g));const c=He();ne(a,c,g=>n(16,r=g));let{open:d=!1}=e,b="general";const k=qe();ne(a,k,g=>n(22,i=g));function Q(){n(0,d=!1),l!=null&&i.mutate([m,p,l])}function z(g){const S=g.target.value;n(6,l={...l,description:S})}let J="";const N=Ne();ne(a,N,g=>n(8,u=g));const W=g=>n(4,b=g.detail),G=g=>n(6,l={...l,is_public:g.detail});function D(g){J=g,n(5,J)}const T=()=>u.mutate([m,p],{onSuccess:()=>fe("/")}),V=()=>n(0,d=!1);return a.$$set=g=>{"namespace"in g&&n(1,m=g.namespace),"conceptName"in g&&n(2,p=g.conceptName),"open"in g&&n(0,d=g.open)},a.$$.update=()=>{var g;a.$$.dirty&14&&n(15,t=(g=s.data)==null?void 0:g.find(S=>S.namespace===m&&S.name===p)),a.$$.dirty&32768&&n(6,l=(t==null?void 0:t.metadata)||{}),a.$$.dirty&65542&&n(7,o=Fe(m,p,r.data))},[d,m,p,s,b,J,l,o,u,f,c,k,Q,z,N,t,r,W,G,D,T,V]}class bt extends ke{constructor(e){super(),we(this,e,$t,gt,ye,{namespace:1,conceptName:2,open:0})}}function ge(a){let e,n,t,l;const o=[wt,kt,vt],i=[];function r(s,u){var m,p,f;return(m=s[10])!=null&&m.isLoading?0:(p=s[10])!=null&&p.isError?1:(f=s[10])!=null&&f.isSuccess?2:-1}return~(e=r(a))&&(n=i[e]=o[e](a)),{c(){n&&n.c(),t=re()},l(s){n&&n.l(s),t=re()},m(s,u){~e&&i[e].m(s,u),H(s,t,u),l=!0},p(s,u){let m=e;e=r(s),e===m?~e&&i[e].p(s,u):(n&&(ee(),v(i[m],1,1,()=>{i[m]=null}),te()),~e?(n=i[e],n?n.p(s,u):(n=i[e]=o[e](s),n.c()),$(n,1),n.m(t.parentNode,t)):n=null)},i(s){l||($(n),l=!0)},o(s){v(n),l=!1},d(s){~e&&i[e].d(s),s&&h(t)}}}function vt(a){let e,n;return e=new st({props:{concept:a[10].data}}),{c(){O(e.$$.fragment)},l(t){L(e.$$.fragment,t)},m(t,l){A(e,t,l),n=!0},p(t,l){const o={};l&1024&&(o.concept=t[10].data),e.$set(o)},i(t){n||($(e.$$.fragment,t),n=!0)},o(t){v(e.$$.fragment,t),n=!1},d(t){U(e,t)}}}function kt(a){let e,n=a[10].error+"",t;return{c(){e=w("p"),t=M(n)},l(l){e=y(l,"P",{});var o=E(e);t=B(o,n),o.forEach(h)},m(l,o){H(l,e,o),_(e,t)},p(l,o){o&1024&&n!==(n=l[10].error+"")&&se(t,n)},i:ae,o:ae,d(l){l&&h(e)}}}function wt(a){let e,n;return e=new Ve({}),{c(){O(e.$$.fragment)},l(t){L(e.$$.fragment,t)},m(t,l){A(e,t,l),n=!0},p:ae,i(t){n||($(e.$$.fragment,t),n=!0)},o(t){v(e.$$.fragment,t),n=!1},d(t){U(e,t)}}}function $e(a){let e,n;return e=new rt({props:{danger:!0,open:!0,modalHeading:"Delete concept",primaryButtonText:"Delete",primaryButtonIcon:a[9].isLoading?he:void 0,secondaryButtonText:"Cancel",$$slots:{default:[yt]},$$scope:{ctx:a}}}),e.$on("click:button--secondary",a[20]),e.$on("close",a[21]),e.$on("submit",a[22]),{c(){O(e.$$.fragment)},l(t){L(e.$$.fragment,t)},m(t,l){A(e,t,l),n=!0},p(t,l){const o={};l&512&&(o.primaryButtonIcon=t[9].isLoading?he:void 0),l&16777224&&(o.$$scope={dirty:l,ctx:t}),e.$set(o)},i(t){n||($(e.$$.fragment,t),n=!0)},o(t){v(e.$$.fragment,t),n=!1},d(t){U(e,t)}}}function yt(a){let e,n,t,l=a[3].namespace+"",o,i,r=a[3].name+"",s,u,m,p,f;return{c(){e=w("p"),n=M("Confirm deleting "),t=w("code"),o=M(l),i=M("/"),s=M(r),u=M(" ?"),m=q(),p=w("p"),f=M("This is a permanent action and cannot be undone."),this.h()},l(c){e=y(c,"P",{class:!0});var d=E(e);n=B(d,"Confirm deleting "),t=y(d,"CODE",{});var b=E(t);o=B(b,l),i=B(b,"/"),s=B(b,r),b.forEach(h),u=B(d," ?"),d.forEach(h),m=F(c),p=y(c,"P",{class:!0});var k=E(p);f=B(k,"This is a permanent action and cannot be undone."),k.forEach(h),this.h()},h(){C(e,"class","!text-lg"),C(p,"class","mt-2")},m(c,d){H(c,e,d),_(e,n),_(e,t),_(t,o),_(t,i),_(t,s),_(e,u),H(c,m,d),H(c,p,d),_(p,f)},p(c,d){d&8&&l!==(l=c[3].namespace+"")&&se(o,l),d&8&&r!==(r=c[3].name+"")&&se(s,r)},d(c){c&&h(e),c&&h(m),c&&h(p)}}}function Et(a){let e,n,t,l,o,i,r,s=a[0]!=null&&a[1]!=null&&ge(a),u=a[3]&&$e(a);function m(f){a[23](f)}let p={namespace:a[0],conceptName:a[1]};return a[4]!==void 0&&(p.open=a[4]),o=new bt({props:p}),Ee.push(()=>Ce(o,"open",m)),{c(){e=w("div"),n=w("div"),s&&s.c(),t=q(),u&&u.c(),l=q(),O(o.$$.fragment),this.h()},l(f){e=y(f,"DIV",{class:!0});var c=E(e);n=y(c,"DIV",{class:!0});var d=E(n);s&&s.l(d),d.forEach(h),c.forEach(h),t=F(f),u&&u.l(f),l=F(f),L(o.$$.fragment,f),this.h()},h(){C(n,"class","lilac-page flex w-full"),C(e,"class","flex h-full w-full overflow-x-hidden overflow-y-scroll")},m(f,c){H(f,e,c),_(e,n),s&&s.m(n,null),H(f,t,c),u&&u.m(f,c),H(f,l,c),A(o,f,c),r=!0},p(f,c){f[0]!=null&&f[1]!=null?s?(s.p(f,c),c&3&&$(s,1)):(s=ge(f),s.c(),$(s,1),s.m(n,null)):s&&(ee(),v(s,1,1,()=>{s=null}),te()),f[3]?u?(u.p(f,c),c&8&&$(u,1)):(u=$e(f),u.c(),$(u,1),u.m(l.parentNode,l)):u&&(ee(),v(u,1,1,()=>{u=null}),te());const d={};c&1&&(d.namespace=f[0]),c&2&&(d.conceptName=f[1]),!i&&c&16&&(i=!0,d.open=f[4],Ie(()=>i=!1)),o.$set(d)},i(f){r||($(s),$(u),$(o.$$.fragment,f),r=!0)},o(f){v(s),v(u),v(o.$$.fragment,f),r=!1},d(f){f&&h(e),s&&s.d(),f&&h(t),u&&u.d(f),f&&h(l),U(o,f)}}}function Ct(a){let e,n=_e(a[0],a[1])+"",t,l,o;return{c(){e=w("a"),t=M(n),this.h()},l(i){e=y(i,"A",{class:!0,href:!0});var r=E(e);t=B(r,n),r.forEach(h),this.h()},h(){C(e,"class","font-semibold text-black"),C(e,"href",a[6])},m(i,r){H(i,e,r),_(e,t),l||(o=ie(e,"click",a[19]),l=!0)},p(i,r){r&3&&n!==(n=_e(i[0],i[1])+"")&&se(t,n),r&64&&C(e,"href",i[6])},d(i){i&&h(e),l=!1,o()}}}function It(a){let e,n,t;return n=new Xe({props:{type:"green",$$slots:{default:[Ct]},$$scope:{ctx:a}}}),{c(){e=w("div"),O(n.$$.fragment),this.h()},l(l){e=y(l,"DIV",{slot:!0});var o=E(e);L(n.$$.fragment,o),o.forEach(h),this.h()},h(){C(e,"slot","header-subtext")},m(l,o){H(l,e,o),A(n,e,null),t=!0},p(l,o){const i={};o&16777283&&(i.$$scope={dirty:o,ctx:l}),n.$set(i)},i(l){t||($(n.$$.fragment,l),t=!0)},o(l){v(n.$$.fragment,l),t=!1},d(l){l&&h(e),U(n)}}}function be(a){let e,n,t,l,o,i,r,s=a[5]&&ve();return l=new lt({}),{c(){e=w("div"),s&&s.c(),n=q(),t=w("button"),O(l.$$.fragment),this.h()},l(u){e=y(u,"DIV",{class:!0});var m=E(e);s&&s.l(m),n=F(m),t=y(m,"BUTTON",{class:!0});var p=E(t);L(l.$$.fragment,p),p.forEach(h),m.forEach(h),this.h()},h(){C(t,"class","p-3"),C(e,"class","relative flex flex-row justify-items-center")},m(u,m){H(u,e,m),s&&s.m(e,null),_(e,n),_(e,t),A(l,t,null),o=!0,i||(r=[Te(Pe.call(null,t,{text:"Copy the URL"})),ie(t,"click",a[17])],i=!0)},p(u,m){u[5]?s?m&32&&$(s,1):(s=ve(),s.c(),$(s,1),s.m(e,n)):s&&(ee(),v(s,1,1,()=>{s=null}),te())},i(u){o||($(s),$(l.$$.fragment,u),o=!0)},o(u){v(s),v(l.$$.fragment,u),o=!1},d(u){u&&h(e),s&&s.d(),U(l),i=!1,De(r)}}}function ve(a){let e,n,t,l;return{c(){e=w("div"),n=M("Copied!"),this.h()},l(o){e=y(o,"DIV",{class:!0});var i=E(e);n=B(i,"Copied!"),i.forEach(h),this.h()},h(){C(e,"class","absolute right-12 z-50 mt-2 rounded border border-neutral-300 bg-neutral-50 px-4 py-1 text-xs")},m(o,i){H(o,e,i),_(e,n),l=!0},i(o){l||(t&&t.end(1),l=!0)},o(o){t=Oe(e,it,{}),l=!1},d(o){o&&h(e),o&&t&&t.end()}}}function Tt(a){var f;let e,n,t,l,o,i,r,s,u,m,p=((f=a[2])==null?void 0:f.metadata.is_public)&&be(a);return o=new ot({props:{size:16}}),{c(){e=w("div"),p&&p.c(),n=q(),t=w("div"),l=w("button"),O(o.$$.fragment),this.h()},l(c){e=y(c,"DIV",{slot:!0,class:!0});var d=E(e);p&&p.l(d),n=F(d),t=y(d,"DIV",{});var b=E(t);l=y(b,"BUTTON",{title:!0,class:!0});var k=E(l);L(o.$$.fragment,k),k.forEach(h),b.forEach(h),d.forEach(h),this.h()},h(){C(l,"title","Concept settings"),l.disabled=i=!a[7],C(l,"class","p-3"),x(t,"opacity-40",!a[7]),C(e,"slot","header-right"),C(e,"class","flex flex-row")},m(c,d){H(c,e,d),p&&p.m(e,null),_(e,n),_(e,t),_(t,l),A(o,l,null),s=!0,u||(m=[ie(l,"click",a[18]),Te(r=Pe.call(null,t,{text:a[7]?"Edit concept settings":"User does not have access to edit this concept."}))],u=!0)},p(c,d){var b;(b=c[2])!=null&&b.metadata.is_public?p?(p.p(c,d),d&4&&$(p,1)):(p=be(c),p.c(),$(p,1),p.m(e,n)):p&&(ee(),v(p,1,1,()=>{p=null}),te()),(!s||d&128&&i!==(i=!c[7]))&&(l.disabled=i),r&&Me(r.update)&&d&128&&r.update.call(null,{text:c[7]?"Edit concept settings":"User does not have access to edit this concept."}),(!s||d&128)&&x(t,"opacity-40",!c[7])},i(c){s||($(p),$(o.$$.fragment,c),s=!0)},o(c){v(p),v(o.$$.fragment,c),s=!1},d(c){c&&h(e),p&&p.d(),U(o),u=!1,De(m)}}}function Dt(a){let e,n;return e=new Ae({props:{$$slots:{"header-right":[Tt],"header-subtext":[It],default:[Et]},$$scope:{ctx:a}}}),{c(){O(e.$$.fragment)},l(t){L(e.$$.fragment,t)},m(t,l){A(e,t,l),n=!0},p(t,[l]){const o={};l&16779007&&(o.$$scope={dirty:l,ctx:t}),e.$set(o)},i(t){n||($(e.$$.fragment,t),n=!0)},o(t){v(e.$$.fragment,t),n=!1},d(t){U(e,t)}}}function St(a,e,n){let t,l,o,i,r,s,u,m,p=ae,f=()=>(p(),p=Be(t,P=>n(10,m=P)),t);a.$$.on_destroy.push(()=>p());let c,d;const b=Qe();ne(a,b,P=>n(16,u=P));let k=null;const Q=Se();ne(a,Q,P=>n(15,s=P));const z=Ne();ne(a,z,P=>n(9,r=P));function J(){if(k==null)return;const{namespace:P,name:R}=k;r.mutate([P,R],{onSuccess:()=>{var X;for(const[I,K]of Object.entries(Ye)){const Y=(X=Le(xe[I]).selectRowsSchema)==null?void 0:X.data;K.deleteConcept(P,R,Y)}n(3,k=null),fe("/")}})}let N=!1,W=!1;const G=()=>navigator.clipboard.writeText(location.href).then(()=>{n(5,W=!0),setTimeout(()=>n(5,W=!1),2e3)},()=>{throw Error("Error copying link to clipboard.")}),D=()=>n(4,N=!0),T=()=>fe(i),V=()=>n(3,k=null),g=()=>n(3,k=null),S=()=>J();function j(P){N=P,n(4,N)}return a.$$.update=()=>{var P;if(a.$$.dirty&65539&&u.page==="concepts"&&u.identifier!=null){const[R,X]=u.identifier.split("/");(c!=R||d!=X)&&(n(0,c=R),n(1,d=X))}a.$$.dirty&3&&f(n(8,t=c&&d?Ze(c,d):void 0)),a.$$.dirty&32771&&n(2,l=(P=s.data)==null?void 0:P.find(R=>R.namespace===c&&R.name===d)),a.$$.dirty&4&&n(7,o=l==null?void 0:l.acls.write),a.$$.dirty&3&&n(6,i=We(c,d))},[c,d,l,k,N,W,i,o,t,r,m,b,Q,z,J,s,u,G,D,T,V,g,S,j]}class Ut extends ke{constructor(e){super(),we(this,e,St,Dt,ye,{})}}export{Ut as component};
