nsthorat's picture
Push
ce87126
raw
history blame
No virus
182 kB
import{S as ge,i as pe,s as _e,E as de,k as A,a as j,y as R,l as F,m as D,c as U,z as O,h,I as Ze,H as se,b as C,J as w,A as q,K as Ve,O as Ce,g,d as b,B as L,D as ke,C as _t,o as oi,F as Se,q as Q,r as J,n as T,u as ue,e as le,v as X,f as x,P as Je,w as Pe,X as gt,Y as pt,G as rt,L as st,M as at,N as ft,a9 as Et,aa as qt,R as he,T as ui,t as Di,j as Ii,Q as je,ab as ci,_ as be,$ as ve,a0 as $e,a1 as Z,Z as Vi,p as Ue,W as di,a6 as Me,a8 as qe,a3 as Fe,a5 as Be,ac as kt,ad as Ti,U as et,V as tt,ae as Ci,a4 as ot,af as ut,x as ct,ag as St}from"../chunks/index.01827105.js";import{h as ze,f as De,b as Lt,s as Ie,p as Ot,a as Ni,c as wt,i as Mi,e as Qe,g as vt,j as zi,L as Ke,l as Ai,k as dt,m as Fi,n as mi,o as Bi,U as Ht,C as tl,r as hi,q as Pi,t as jt,u as Ri,v as Ge,w as yt,x as Pt,O as qi,y as bt,z as Li,A as Oi,B as $t,V as _i,D as Hi,E as ji,F as Ui,P as gi,G as Yi,H as Wi,I as Qi,J as Ji,K as Ki}from"../chunks/Page.635e2ebb.js";import{e as lt,f as Zi,h as Re,t as Xe,a as xe,E as Ut,i as We,j as Yt,k as Gi,b as Xi,S as xi,l as er,m as Ct,n as tr,o as lr,p as nr,q as ir,r as ll,s as Rt,u as rr,v as sr,w as ar,g as fr,x as or,y as ur,I as Dt,z as Wt,A as cr,B as mt,D as ht,F as pi,M as bi,G as vi,H as wi,J as dr,C as mr,K as hr,L as _r,N as gr,O as pr,P as br,Q as vr,T as wr}from"../chunks/ConceptView.0172a944.js";import{d as nl,w as it}from"../chunks/index.2213faf5.js";import{C as kr,S as Le,n as Sr,I as Qt,d as il}from"../chunks/utils.fafae123.js";import{W as Er,b as yr,C as $r,S as Jt,a as Nt}from"../chunks/SelectItem.978ba842.js";import{L as Dr,a as Ir,b as Vr,c as Tr,C as Cr}from"../chunks/ComboBox.07cc2afb.js";import{B as Ye,a as Mt}from"../chunks/taskMonitoringStore.f29f8009.js";import{M as Kt,g as ki}from"../chunks/urlHashStore.8012d85b.js";import{q as Zt,S as Nr}from"../chunks/signalQueries.235d6662.js";import{g as Si}from"../chunks/settingsStore.3b86ec39.js";import{S as Mr}from"../chunks/Settings.07bf1197.js";import{g as At}from"../chunks/navigation.29c1b9b9.js";function rl(i,e,l){const t=i.slice();return t[39]=e[l],t[41]=l,t}const zr=i=>({item:i[0]&8,index:i[0]&8}),sl=i=>({item:i[39],index:i[41]});function al(i){let e,l;return{c(){e=A("label"),l=Q(i[10]),this.h()},l(t){e=F(t,"LABEL",{for:!0});var n=D(e);l=J(n,i[10]),n.forEach(h),this.h()},h(){T(e,"for",i[19]),se(e,"bx--label",!0),se(e,"bx--label--disabled",i[9]),se(e,"bx--visually-hidden",i[17])},m(t,n){C(t,e,n),w(e,l)},p(t,n){n[0]&1024&&ue(l,t[10]),n[0]&524288&&T(e,"for",t[19]),n[0]&512&&se(e,"bx--label--disabled",t[9]),n[0]&131072&&se(e,"bx--visually-hidden",t[17])},d(t){t&&h(e)}}}function fl(i){let e,l;return e=new Er({props:{class:"bx--list-box__invalid-icon"}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function ol(i){let e,l;return e=new yr({props:{class:"bx--list-box__invalid-icon bx--list-box__invalid-icon--warning"}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Ar(i){let e;return{c(){e=Q(i[16])},l(l){e=J(l,i[16])},m(l,t){C(l,e,t)},p(l,t){t[0]&65536&&ue(e,l[16])},d(l){l&&h(e)}}}function Fr(i){let e=i[4](i[22])+"",l;return{c(){l=Q(e)},l(t){l=J(t,e)},m(t,n){C(t,l,n)},p(t,n){n[0]&4194320&&e!==(e=t[4](t[22])+"")&&ue(l,e)},d(t){t&&h(l)}}}function ul(i){let e,l;return e=new Vr({props:{"aria-labelledby":i[19],id:i[19],$$slots:{default:[Rr]},$$scope:{ctx:i}}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n[0]&524288&&(f["aria-labelledby"]=t[19]),n[0]&524288&&(f.id=t[19]),n[0]&2097181|n[1]&64&&(f.$$scope={dirty:n,ctx:t}),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Br(i){let e=i[4](i[39])+"",l;return{c(){l=Q(e)},l(t){l=J(t,e)},m(t,n){C(t,l,n)},p(t,n){n[0]&24&&e!==(e=t[4](t[39])+"")&&ue(l,e)},d(t){t&&h(l)}}}function Pr(i){let e,l;const t=i[29].default,n=rt(t,i,i[37],sl),f=n||Br(i);return{c(){f&&f.c(),e=j()},l(r){f&&f.l(r),e=U(r)},m(r,a){f&&f.m(r,a),C(r,e,a),l=!0},p(r,a){n?n.p&&(!l||a[0]&8|a[1]&64)&&st(n,t,r,r[37],l?ft(t,r[37],a,zr):at(r[37]),sl):f&&f.p&&(!l||a[0]&24)&&f.p(r,l?a:[-1,-1])},i(r){l||(g(f,r),l=!0)},o(r){b(f,r),l=!1},d(r){f&&f.d(r),r&&h(e)}}}function cl(i,e){let l,t,n;function f(...a){return e[34](e[39],...a)}function r(){return e[35](e[39],e[41])}return t=new Tr({props:{id:e[39].id,active:e[0]===e[39].id,highlighted:e[21]===e[41],disabled:e[39].disabled,$$slots:{default:[Pr]},$$scope:{ctx:e}}}),t.$on("click",f),t.$on("mouseenter",r),{key:i,first:null,c(){l=le(),R(t.$$.fragment),this.h()},l(a){l=le(),O(t.$$.fragment,a),this.h()},h(){this.first=l},m(a,s){C(a,l,s),q(t,a,s),n=!0},p(a,s){e=a;const o={};s[0]&8&&(o.id=e[39].id),s[0]&9&&(o.active=e[0]===e[39].id),s[0]&2097160&&(o.highlighted=e[21]===e[41]),s[0]&8&&(o.disabled=e[39].disabled),s[0]&24|s[1]&64&&(o.$$scope={dirty:s,ctx:e}),t.$set(o)},i(a){n||(g(t.$$.fragment,a),n=!0)},o(a){b(t.$$.fragment,a),n=!1},d(a){a&&h(l),L(t,a)}}}function Rr(i){let e=[],l=new Map,t,n,f=i[3];const r=a=>a[39].id;for(let a=0;a<f.length;a+=1){let s=rl(i,f,a),o=r(s);l.set(o,e[a]=cl(o,s))}return{c(){for(let a=0;a<e.length;a+=1)e[a].c();t=le()},l(a){for(let s=0;s<e.length;s+=1)e[s].l(a);t=le()},m(a,s){for(let o=0;o<e.length;o+=1)e[o]&&e[o].m(a,s);C(a,t,s),n=!0},p(a,s){s[0]&35651613|s[1]&64&&(f=a[3],X(),e=gt(e,s,r,1,a,f,l,t.parentNode,pt,cl,t,rl),x())},i(a){if(!n){for(let s=0;s<f.length;s+=1)g(e[s]);n=!0}},o(a){for(let s=0;s<e.length;s+=1)b(e[s]);n=!1},d(a){for(let s=0;s<e.length;s+=1)e[s].d(a);a&&h(t)}}}function qr(i){let e,l,t,n,f,r,a,s,o,u,d,c=i[11]&&fl(),m=!i[11]&&i[13]&&ol();function _(S,v){return S[22]?Fr:Ar}let p=_(i),k=p(i);r=new Ir({props:{translateWithId:i[18],open:i[1]}}),r.$on("click",i[30]);let $=i[1]&&ul(i);return{c(){c&&c.c(),e=j(),m&&m.c(),l=j(),t=A("button"),n=A("span"),k.c(),f=j(),R(r.$$.fragment),a=j(),$&&$.c(),s=le(),this.h()},l(S){c&&c.l(S),e=U(S),m&&m.l(S),l=U(S),t=F(S,"BUTTON",{type:!0,tabindex:!0,"aria-expanded":!0,translatewithid:!0,id:!0});var v=D(t);n=F(v,"SPAN",{});var y=D(n);k.l(y),y.forEach(h),f=U(v),O(r.$$.fragment,v),v.forEach(h),a=U(S),$&&$.l(S),s=le(),this.h()},h(){se(n,"bx--list-box__label",!0),T(t,"type","button"),T(t,"tabindex","0"),T(t,"aria-expanded",i[1]),t.disabled=i[9],T(t,"translatewithid",i[18]),T(t,"id",i[19]),se(t,"bx--list-box__field",!0)},m(S,v){c&&c.m(S,v),C(S,e,v),m&&m.m(S,v),C(S,l,v),C(S,t,v),w(t,n),k.m(n,null),w(t,f),q(r,t,null),i[31](t),C(S,a,v),$&&$.m(S,v),C(S,s,v),o=!0,u||(d=[Ve(t,"keydown",i[32]),Ve(t,"keyup",i[33])],u=!0)},p(S,v){S[11]?c?v[0]&2048&&g(c,1):(c=fl(),c.c(),g(c,1),c.m(e.parentNode,e)):c&&(X(),b(c,1,1,()=>{c=null}),x()),!S[11]&&S[13]?m?v[0]&10240&&g(m,1):(m=ol(),m.c(),g(m,1),m.m(l.parentNode,l)):m&&(X(),b(m,1,1,()=>{m=null}),x()),p===(p=_(S))&&k?k.p(S,v):(k.d(1),k=p(S),k&&(k.c(),k.m(n,null)));const y={};v[0]&262144&&(y.translateWithId=S[18]),v[0]&2&&(y.open=S[1]),r.$set(y),(!o||v[0]&2)&&T(t,"aria-expanded",S[1]),(!o||v[0]&512)&&(t.disabled=S[9]),(!o||v[0]&262144)&&T(t,"translatewithid",S[18]),(!o||v[0]&524288)&&T(t,"id",S[19]),S[1]?$?($.p(S,v),v[0]&2&&g($,1)):($=ul(S),$.c(),g($,1),$.m(s.parentNode,s)):$&&(X(),b($,1,1,()=>{$=null}),x())},i(S){o||(g(c),g(m),g(r.$$.fragment,S),g($),o=!0)},o(S){b(c),b(m),b(r.$$.fragment,S),b($),o=!1},d(S){c&&c.d(S),S&&h(e),m&&m.d(S),S&&h(l),S&&h(t),k.d(),L(r),i[31](null),S&&h(a),$&&$.d(S),S&&h(s),u=!1,Je(d)}}}function dl(i){let e,l;return{c(){e=A("div"),l=Q(i[15]),this.h()},l(t){e=F(t,"DIV",{});var n=D(e);l=J(n,i[15]),n.forEach(h),this.h()},h(){se(e,"bx--form__helper-text",!0),se(e,"bx--form__helper-text--disabled",i[9])},m(t,n){C(t,e,n),w(e,l)},p(t,n){n[0]&32768&&ue(l,t[15]),n[0]&512&&se(e,"bx--form__helper-text--disabled",t[9])},d(t){t&&h(e)}}}function Lr(i){let e,l,t,n,f,r,a,s=i[10]&&al(i);t=new Dr({props:{role:void 0,type:i[5],size:i[7],name:i[20],"aria-label":i[28]["aria-label"],class:`bx--dropdown
`+(i[6]==="top"&&"bx--list-box--up")+`
`+(i[11]&&"bx--dropdown--invalid")+`
`+(!i[11]&&i[13]&&"bx--dropdown--warning")+`
`+(i[1]&&"bx--dropdown--open")+`
`+(i[7]==="sm"&&"bx--dropdown--sm")+`
`+(i[7]==="xl"&&"bx--dropdown--xl")+`
`+(i[23]&&"bx--dropdown--inline")+`
`+(i[9]&&"bx--dropdown--disabled")+`
`+(i[8]&&"bx--dropdown--light"),disabled:i[9],open:i[1],invalid:i[11],invalidText:i[12],light:i[8],warn:i[13],warnText:i[14],$$slots:{default:[qr]},$$scope:{ctx:i}}}),t.$on("click",i[36]);let o=!i[23]&&!i[11]&&!i[13]&&i[15]&&dl(i),u=[i[27]],d={};for(let c=0;c<u.length;c+=1)d=de(d,u[c]);return{c(){e=A("div"),s&&s.c(),l=j(),R(t.$$.fragment),n=j(),o&&o.c(),this.h()},l(c){e=F(c,"DIV",{});var m=D(e);s&&s.l(m),l=U(m),O(t.$$.fragment,m),n=U(m),o&&o.l(m),m.forEach(h),this.h()},h(){Ze(e,d),se(e,"bx--dropdown__wrapper",!0),se(e,"bx--list-box__wrapper",!0),se(e,"bx--dropdown__wrapper--inline",i[23]),se(e,"bx--list-box__wrapper--inline",i[23]),se(e,"bx--dropdown__wrapper--inline--invalid",i[23]&&i[11])},m(c,m){C(c,e,m),s&&s.m(e,null),w(e,l),q(t,e,null),w(e,n),o&&o.m(e,null),f=!0,r||(a=Ve(window,"click",i[26]),r=!0)},p(c,m){c[10]?s?s.p(c,m):(s=al(c),s.c(),s.m(e,l)):s&&(s.d(1),s=null);const _={};m[0]&32&&(_.type=c[5]),m[0]&128&&(_.size=c[7]),m[0]&1048576&&(_.name=c[20]),m[0]&268435456&&(_["aria-label"]=c[28]["aria-label"]),m[0]&8399810&&(_.class=`bx--dropdown
`+(c[6]==="top"&&"bx--list-box--up")+`
`+(c[11]&&"bx--dropdown--invalid")+`
`+(!c[11]&&c[13]&&"bx--dropdown--warning")+`
`+(c[1]&&"bx--dropdown--open")+`
`+(c[7]==="sm"&&"bx--dropdown--sm")+`
`+(c[7]==="xl"&&"bx--dropdown--xl")+`
`+(c[23]&&"bx--dropdown--inline")+`
`+(c[9]&&"bx--dropdown--disabled")+`
`+(c[8]&&"bx--dropdown--light")),m[0]&512&&(_.disabled=c[9]),m[0]&2&&(_.open=c[1]),m[0]&2048&&(_.invalid=c[11]),m[0]&4096&&(_.invalidText=c[12]),m[0]&256&&(_.light=c[8]),m[0]&8192&&(_.warn=c[13]),m[0]&16384&&(_.warnText=c[14]),m[0]&7154207|m[1]&64&&(_.$$scope={dirty:m,ctx:c}),t.$set(_),!c[23]&&!c[11]&&!c[13]&&c[15]?o?o.p(c,m):(o=dl(c),o.c(),o.m(e,null)):o&&(o.d(1),o=null),Ze(e,d=Ce(u,[m[0]&134217728&&c[27]])),se(e,"bx--dropdown__wrapper",!0),se(e,"bx--list-box__wrapper",!0),se(e,"bx--dropdown__wrapper--inline",c[23]),se(e,"bx--list-box__wrapper--inline",c[23]),se(e,"bx--dropdown__wrapper--inline--invalid",c[23]&&c[11])},i(c){f||(g(t.$$.fragment,c),f=!0)},o(c){b(t.$$.fragment,c),f=!1},d(c){c&&h(e),s&&s.d(),L(t),o&&o.d(),r=!1,a()}}}function Or(i,e,l){let t,n;const f=["items","itemToString","selectedId","type","direction","size","open","light","disabled","titleText","invalid","invalidText","warn","warnText","helperText","label","hideLabel","translateWithId","id","name","ref"];let r=ke(e,f),{$$slots:a={},$$scope:s}=e,{items:o=[]}=e,{itemToString:u=Y=>Y.text||Y.id}=e,{selectedId:d}=e,{type:c="default"}=e,{direction:m="bottom"}=e,{size:_=void 0}=e,{open:p=!1}=e,{light:k=!1}=e,{disabled:$=!1}=e,{titleText:S=""}=e,{invalid:v=!1}=e,{invalidText:y=""}=e,{warn:N=!1}=e,{warnText:z=""}=e,{helperText:V=""}=e,{label:E=void 0}=e,{hideLabel:B=!1}=e,{translateWithId:I=void 0}=e,{id:M="ccs-"+Math.random().toString(36)}=e,{name:P=void 0}=e,{ref:K=null}=e;const ne=_t();let W=-1;function te(Y){let H=W+Y;if(o.length===0)return;H<0?H=o.length-1:H>=o.length&&(H=0);let ie=o[H].disabled;for(;ie;)H=H+Y,H<0?H=o.length-1:H>=o.length&&(H=0),ie=o[H].disabled;l(21,W=H)}const G=()=>{ne("select",{selectedId:d,selectedItem:o.find(Y=>Y.id===d)})},ee=({target:Y})=>{p&&K&&!K.contains(Y)&&l(1,p=!1)};oi(()=>(parent&&parent.addEventListener("click",ee),()=>{parent&&parent.removeEventListener("click",ee)}));const we=Y=>{Y.stopPropagation(),!$&&l(1,p=!p)};function fe(Y){Pe[Y?"unshift":"push"](()=>{K=Y,l(2,K)})}const ae=Y=>{const{key:H}=Y;["Enter","ArrowDown","ArrowUp"].includes(H)&&Y.preventDefault(),H==="Enter"?(l(1,p=!p),W>-1&&o[W].id!==d&&(l(0,d=o[W].id),G(),l(1,p=!1))):H==="Tab"?(l(1,p=!1),K.blur()):H==="ArrowDown"?(p||l(1,p=!0),te(1)):H==="ArrowUp"?(p||l(1,p=!0),te(-1)):H==="Escape"&&l(1,p=!1)},ye=Y=>{const{key:H}=Y;if([" "].includes(H))Y.preventDefault();else return;l(1,p=!p),W>-1&&o[W].id!==d&&(l(0,d=o[W].id),G(),l(1,p=!1))},ce=(Y,H)=>{if(Y.disabled){H.stopPropagation();return}l(0,d=Y.id),G(),K.focus()},Ee=(Y,H)=>{Y.disabled||l(21,W=H)},oe=({target:Y})=>{$||l(1,p=K.contains(Y)?!p:!1)};return i.$$set=Y=>{l(28,e=de(de({},e),Se(Y))),l(27,r=ke(e,f)),"items"in Y&&l(3,o=Y.items),"itemToString"in Y&&l(4,u=Y.itemToString),"selectedId"in Y&&l(0,d=Y.selectedId),"type"in Y&&l(5,c=Y.type),"direction"in Y&&l(6,m=Y.direction),"size"in Y&&l(7,_=Y.size),"open"in Y&&l(1,p=Y.open),"light"in Y&&l(8,k=Y.light),"disabled"in Y&&l(9,$=Y.disabled),"titleText"in Y&&l(10,S=Y.titleText),"invalid"in Y&&l(11,v=Y.invalid),"invalidText"in Y&&l(12,y=Y.invalidText),"warn"in Y&&l(13,N=Y.warn),"warnText"in Y&&l(14,z=Y.warnText),"helperText"in Y&&l(15,V=Y.helperText),"label"in Y&&l(16,E=Y.label),"hideLabel"in Y&&l(17,B=Y.hideLabel),"translateWithId"in Y&&l(18,I=Y.translateWithId),"id"in Y&&l(19,M=Y.id),"name"in Y&&l(20,P=Y.name),"ref"in Y&&l(2,K=Y.ref),"$$scope"in Y&&l(37,s=Y.$$scope)},i.$$.update=()=>{i.$$.dirty[0]&32&&l(23,t=c==="inline"),i.$$.dirty[0]&9&&l(22,n=o.find(Y=>Y.id===d)),i.$$.dirty[0]&2&&(p||l(21,W=-1))},e=Se(e),[d,p,K,o,u,c,m,_,k,$,S,v,y,N,z,V,E,B,I,M,P,W,n,t,te,G,ee,r,e,a,we,fe,ae,ye,ce,Ee,oe,s]}class Hr extends ge{constructor(e){super(),pe(this,e,Or,Lr,_e,{items:3,itemToString:4,selectedId:0,type:5,direction:6,size:7,open:1,light:8,disabled:9,titleText:10,invalid:11,invalidText:12,warn:13,warnText:14,helperText:15,label:16,hideLabel:17,translateWithId:18,id:19,name:20,ref:2},null,[-1,-1])}}const jr=Hr,Ur=i=>({}),ml=i=>({});function hl(i){let e=i[3].label+"",l;return{c(){l=Q(e)},l(t){l=J(t,e)},m(t,n){C(t,l,n)},p(t,n){n[0]&8&&e!==(e=t[3].label+"")&&ue(l,e)},d(t){t&&h(l)}}}function Yr(i){let e,l,t,n,f,r,a,s,o,u,d,c,m=i[3]&&hl(i);f=new $r({props:{"aria-hidden":"true",title:i[1]}});const _=i[20].default,p=rt(_,i,i[19],null);let k=[{role:"navigation"},i[10]],$={};for(let y=0;y<k.length;y+=1)$=de($,k[y]);const S=i[20].content,v=rt(S,i,i[19],ml);return{c(){e=A("div"),l=A("div"),t=A("a"),m&&m.c(),n=j(),R(f.$$.fragment),a=j(),s=A("ul"),p&&p.c(),o=j(),v&&v.c(),this.h()},l(y){e=F(y,"DIV",{role:!0});var N=D(e);l=F(N,"DIV",{role:!0,tabindex:!0,"aria-label":!0});var z=D(l);t=F(z,"A",{tabindex:!0,href:!0});var V=D(t);m&&m.l(V),V.forEach(h),n=U(z),O(f.$$.fragment,z),z.forEach(h),a=U(N),s=F(N,"UL",{role:!0});var E=D(s);p&&p.l(E),E.forEach(h),N.forEach(h),o=U(y),v&&v.l(y),this.h()},h(){T(t,"tabindex","-1"),T(t,"href",i[2]),se(t,"bx--tabs-trigger-text",!0),T(l,"role","listbox"),T(l,"tabindex","0"),T(l,"aria-label",r=i[11]["aria-label"]||"listbox"),se(l,"bx--tabs-trigger",!0),T(s,"role","tablist"),se(s,"bx--tabs__nav",!0),se(s,"bx--tabs__nav--hidden",i[5]),Ze(e,$),se(e,"bx--tabs",!0),se(e,"bx--tabs--container",i[0]==="container")},m(y,N){C(y,e,N),w(e,l),w(l,t),m&&m.m(t,null),w(l,n),q(f,l,null),w(e,a),w(e,s),p&&p.m(s,null),i[26](s),C(y,o,N),v&&v.m(y,N),u=!0,d||(c=[Ve(t,"click",Et(i[22])),Ve(t,"click",qt(Et(i[23]))),Ve(l,"click",i[24]),Ve(l,"keypress",i[21]),Ve(l,"keypress",i[25])],d=!0)},p(y,N){y[3]?m?m.p(y,N):(m=hl(y),m.c(),m.m(t,null)):m&&(m.d(1),m=null),(!u||N[0]&4)&&T(t,"href",y[2]);const z={};N[0]&2&&(z.title=y[1]),f.$set(z),(!u||N[0]&2048&&r!==(r=y[11]["aria-label"]||"listbox"))&&T(l,"aria-label",r),p&&p.p&&(!u||N[0]&524288)&&st(p,_,y,y[19],u?ft(_,y[19],N,null):at(y[19]),null),(!u||N[0]&32)&&se(s,"bx--tabs__nav--hidden",y[5]),Ze(e,$=Ce(k,[{role:"navigation"},N[0]&1024&&y[10]])),se(e,"bx--tabs",!0),se(e,"bx--tabs--container",y[0]==="container"),v&&v.p&&(!u||N[0]&524288)&&st(v,S,y,y[19],u?ft(S,y[19],N,Ur):at(y[19]),ml)},i(y){u||(g(f.$$.fragment,y),g(p,y),g(v,y),u=!0)},o(y){b(f.$$.fragment,y),b(p,y),b(v,y),u=!1},d(y){y&&h(e),m&&m.d(),L(f),p&&p.d(y),i[26](null),y&&h(o),v&&v.d(y),d=!1,Je(c)}}}function Wr(i,e,l){let t,n;const f=["selected","type","autoWidth","iconDescription","triggerHref"];let r=ke(e,f),a,s,o,u,{$$slots:d={},$$scope:c}=e,{selected:m=0}=e,{type:_="default"}=e,{autoWidth:p=!1}=e,{iconDescription:k="Show menu options"}=e,{triggerHref:$="#"}=e;const S=_t(),v=it([]);he(i,v,fe=>l(18,o=fe));const y=nl(v,fe=>fe.reduce((ae,ye)=>({...ae,[ye.id]:ye}),{}));he(i,y,fe=>l(28,u=fe));const N=it(p),z=it(void 0);he(i,z,fe=>l(16,a=fe));const V=it([]);he(i,V,fe=>l(17,s=fe));const E=nl(V,fe=>fe.reduce((ae,ye)=>({...ae,[ye.id]:ye}),{})),B=it(void 0);let I=null;ui("Tabs",{tabs:v,contentById:E,selectedTab:z,selectedContent:B,useAutoWidth:N,add:fe=>{v.update(ae=>[...ae,{...fe,index:ae.length}])},addContent:fe=>{V.update(ae=>[...ae,{...fe,index:ae.length}])},update:fe=>{l(14,P=u[fe].index)},change:async fe=>{let ae=P+fe;ae<0?ae=o.length-1:ae>=o.length&&(ae=0);let ye=o[ae].disabled;for(;ye;)ae=ae+fe,ae<0?ae=o.length-1:ae>=o.length&&(ae=0),ye=o[ae].disabled;l(14,P=ae),await Di();const ce=I==null?void 0:I.querySelectorAll("[role='tab']")[P];ce==null||ce.focus()}}),Ii(()=>{l(12,m=P),K>-1&&K!==P&&S("change",P),K=P});let M=!0,P=m,K=-1;function ne(fe){je.call(this,i,fe)}function W(fe){je.call(this,i,fe)}const te=()=>{l(5,M=!M)},G=()=>{l(5,M=!M)},ee=()=>{l(5,M=!M)};function we(fe){Pe[fe?"unshift":"push"](()=>{I=fe,l(4,I)})}return i.$$set=fe=>{l(11,e=de(de({},e),Se(fe))),l(10,r=ke(e,f)),"selected"in fe&&l(12,m=fe.selected),"type"in fe&&l(0,_=fe.type),"autoWidth"in fe&&l(13,p=fe.autoWidth),"iconDescription"in fe&&l(1,k=fe.iconDescription),"triggerHref"in fe&&l(2,$=fe.triggerHref),"$$scope"in fe&&l(19,c=fe.$$scope)},i.$$.update=()=>{i.$$.dirty[0]&4096&&l(14,P=m),i.$$.dirty[0]&278528&&l(3,t=o[P]||void 0),i.$$.dirty[0]&147456&&l(15,n=s[P]||void 0),i.$$.dirty[0]&32776&&(t&&z.set(t.id),n&&B.set(n.id)),i.$$.dirty[0]&65536&&a&&l(5,M=!0),i.$$.dirty[0]&8192&&N.set(p)},e=Se(e),[_,k,$,t,I,M,v,y,z,V,r,e,m,p,P,n,a,s,o,c,d,ne,W,te,G,ee,we]}class Qr extends ge{constructor(e){super(),pe(this,e,Wr,Yr,_e,{selected:12,type:0,autoWidth:13,iconDescription:1,triggerHref:2},null,[-1,-1])}}const Jr=Qr;function Kr(i){let e;return{c(){e=Q(i[1])},l(l){e=J(l,i[1])},m(l,t){C(l,e,t)},p(l,t){t&2&&ue(e,l[1])},d(l){l&&h(e)}}}function Zr(i){let e,l,t,n,f,r,a;const s=i[15].default,o=rt(s,i,i[14],null),u=o||Kr(i);let d=[{tabindex:"-1"},{role:"presentation"},i[12]],c={};for(let m=0;m<d.length;m+=1)c=de(c,d[m]);return{c(){e=A("li"),l=A("a"),u&&u.c(),this.h()},l(m){e=F(m,"LI",{tabindex:!0,role:!0});var _=D(e);l=F(_,"A",{role:!0,tabindex:!0,"aria-selected":!0,"aria-disabled":!0,id:!0,href:!0,style:!0});var p=D(l);u&&u.l(p),p.forEach(h),_.forEach(h),this.h()},h(){T(l,"role","tab"),T(l,"tabindex",t=i[3]?"-1":i[4]),T(l,"aria-selected",i[6]),T(l,"aria-disabled",i[3]),T(l,"id",i[5]),T(l,"href",i[2]),T(l,"style",n=i[7]?"width: auto":void 0),se(l,"bx--tabs__nav-link",!0),Ze(e,c),se(e,"bx--tabs__nav-item",!0),se(e,"bx--tabs__nav-item--disabled",i[3]),se(e,"bx--tabs__nav-item--selected",i[6])},m(m,_){C(m,e,_),w(e,l),u&&u.m(l,null),i[20](l),f=!0,r||(a=[Ve(e,"click",Et(i[16])),Ve(e,"click",Et(i[21])),Ve(e,"mouseover",i[17]),Ve(e,"mouseenter",i[18]),Ve(e,"mouseleave",i[19]),Ve(e,"keydown",i[22])],r=!0)},p(m,[_]){o?o.p&&(!f||_&16384)&&st(o,s,m,m[14],f?ft(s,m[14],_,null):at(m[14]),null):u&&u.p&&(!f||_&2)&&u.p(m,f?_:-1),(!f||_&24&&t!==(t=m[3]?"-1":m[4]))&&T(l,"tabindex",t),(!f||_&64)&&T(l,"aria-selected",m[6]),(!f||_&8)&&T(l,"aria-disabled",m[3]),(!f||_&32)&&T(l,"id",m[5]),(!f||_&4)&&T(l,"href",m[2]),(!f||_&128&&n!==(n=m[7]?"width: auto":void 0))&&T(l,"style",n),Ze(e,c=Ce(d,[{tabindex:"-1"},{role:"presentation"},_&4096&&m[12]])),se(e,"bx--tabs__nav-item",!0),se(e,"bx--tabs__nav-item--disabled",m[3]),se(e,"bx--tabs__nav-item--selected",m[6])},i(m){f||(g(u,m),f=!0)},o(m){b(u,m),f=!1},d(m){m&&h(e),u&&u.d(m),i[20](null),r=!1,Je(a)}}}function Gr(i,e,l){let t;const n=["label","href","disabled","tabindex","id","ref"];let f=ke(e,n),r,a,{$$slots:s={},$$scope:o}=e,{label:u=""}=e,{href:d="#"}=e,{disabled:c=!1}=e,{tabindex:m="0"}=e,{id:_="ccs-"+Math.random().toString(36)}=e,{ref:p=null}=e;const{selectedTab:k,useAutoWidth:$,add:S,update:v,change:y}=ci("Tabs");he(i,k,P=>l(13,r=P)),he(i,$,P=>l(7,a=P)),S({id:_,label:u,disabled:c});function N(P){je.call(this,i,P)}function z(P){je.call(this,i,P)}function V(P){je.call(this,i,P)}function E(P){je.call(this,i,P)}function B(P){Pe[P?"unshift":"push"](()=>{p=P,l(0,p)})}const I=()=>{c||v(_)},M=({key:P})=>{c||(P==="ArrowRight"?y(1):P==="ArrowLeft"?y(-1):(P===" "||P==="Enter")&&v(_))};return i.$$set=P=>{e=de(de({},e),Se(P)),l(12,f=ke(e,n)),"label"in P&&l(1,u=P.label),"href"in P&&l(2,d=P.href),"disabled"in P&&l(3,c=P.disabled),"tabindex"in P&&l(4,m=P.tabindex),"id"in P&&l(5,_=P.id),"ref"in P&&l(0,p=P.ref),"$$scope"in P&&l(14,o=P.$$scope)},i.$$.update=()=>{i.$$.dirty&8224&&l(6,t=r===_)},[p,u,d,c,m,_,t,a,k,$,v,y,f,r,o,s,N,z,V,E,B,I,M]}class Xr extends ge{constructor(e){super(),pe(this,e,Gr,Zr,_e,{label:1,href:2,disabled:3,tabindex:4,id:5,ref:0})}}const Ft=Xr;function xr(i){let e,l,t,n;const f=i[12].default,r=rt(f,i,i[11],null);let a=[{role:"tabpanel"},{"aria-labelledby":i[1]},{"aria-hidden":l=!i[2]},{hidden:t=i[2]?void 0:""},{id:i[0]},i[6]],s={};for(let o=0;o<a.length;o+=1)s=de(s,a[o]);return{c(){e=A("div"),r&&r.c(),this.h()},l(o){e=F(o,"DIV",{role:!0,"aria-labelledby":!0,"aria-hidden":!0,id:!0});var u=D(e);r&&r.l(u),u.forEach(h),this.h()},h(){Ze(e,s),se(e,"bx--tab-content",!0)},m(o,u){C(o,e,u),r&&r.m(e,null),n=!0},p(o,[u]){r&&r.p&&(!n||u&2048)&&st(r,f,o,o[11],n?ft(f,o[11],u,null):at(o[11]),null),Ze(e,s=Ce(a,[{role:"tabpanel"},(!n||u&2)&&{"aria-labelledby":o[1]},(!n||u&4&&l!==(l=!o[2]))&&{"aria-hidden":l},(!n||u&4&&t!==(t=o[2]?void 0:""))&&{hidden:t},(!n||u&1)&&{id:o[0]},u&64&&o[6]])),se(e,"bx--tab-content",!0)},i(o){n||(g(r,o),n=!0)},o(o){b(r,o),n=!1},d(o){o&&h(e),r&&r.d(o)}}}function es(i,e,l){let t,n,f;const r=["id"];let a=ke(e,r),s,o,u,{$$slots:d={},$$scope:c}=e,{id:m="ccs-"+Math.random().toString(36)}=e;const{selectedContent:_,addContent:p,tabs:k,contentById:$}=ci("Tabs");return he(i,_,S=>l(10,u=S)),he(i,k,S=>l(8,s=S)),he(i,$,S=>l(9,o=S)),p({id:m}),i.$$set=S=>{e=de(de({},e),Se(S)),l(6,a=ke(e,r)),"id"in S&&l(0,m=S.id),"$$scope"in S&&l(11,c=S.$$scope)},i.$$.update=()=>{i.$$.dirty&1025&&l(2,t=u===m),i.$$.dirty&513&&l(7,n=o[m].index),i.$$.dirty&384&&l(1,f=s[n].id)},[m,f,t,_,k,$,a,n,s,o,u,c,d]}class ts extends ge{constructor(e){super(),pe(this,e,es,xr,_e,{id:0})}}const Bt=ts;function _l(i){let e,l;return{c(){e=be("title"),l=Q(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=J(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),w(e,l)},p(t,n){n&2&&ue(l,t[1])},d(t){t&&h(e)}}}function ls(i){let e,l,t=i[1]&&_l(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],f={};for(let r=0;r<n.length;r+=1)f=de(f,n[r]);return{c(){e=be("svg"),t&&t.c(),l=be("path"),this.h()},l(r){e=ve(r,"svg",{xmlns:!0,viewBox:!0,fill:!0,preserveAspectRatio:!0,width:!0,height:!0});var a=D(e);t&&t.l(a),l=ve(a,"path",{d:!0}),D(l).forEach(h),a.forEach(h),this.h()},h(){T(l,"d","M17 15L17 8 15 8 15 15 8 15 8 17 15 17 15 24 17 24 17 17 24 17 24 15z"),$e(e,f)},m(r,a){C(r,e,a),t&&t.m(e,null),w(e,l)},p(r,[a]){r[1]?t?t.p(r,a):(t=_l(r),t.c(),t.m(e,l)):t&&(t.d(1),t=null),$e(e,f=Ce(n,[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},a&1&&{width:r[0]},a&1&&{height:r[0]},a&4&&r[2],a&8&&r[3]]))},i:Z,o:Z,d(r){r&&h(e),t&&t.d()}}}function ns(i,e,l){let t,n;const f=["size","title"];let r=ke(e,f),{size:a=16}=e,{title:s=void 0}=e;return i.$$set=o=>{l(5,e=de(de({},e),Se(o))),l(3,r=ke(e,f)),"size"in o&&l(0,a=o.size),"title"in o&&l(1,s=o.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[a,s,n,r,t]}class is extends ge{constructor(e){super(),pe(this,e,ns,ls,_e,{size:0,title:1})}}function gl(i){let e,l;return{c(){e=be("title"),l=Q(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=J(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),w(e,l)},p(t,n){n&2&&ue(l,t[1])},d(t){t&&h(e)}}}function rs(i){let e,l,t=i[1]&&gl(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],f={};for(let r=0;r<n.length;r+=1)f=de(f,n[r]);return{c(){e=be("svg"),t&&t.c(),l=be("path"),this.h()},l(r){e=ve(r,"svg",{xmlns:!0,viewBox:!0,fill:!0,preserveAspectRatio:!0,width:!0,height:!0});var a=D(e);t&&t.l(a),l=ve(a,"path",{d:!0}),D(l).forEach(h),a.forEach(h),this.h()},h(){T(l,"d","M24 12L16 22 8 12z"),$e(e,f)},m(r,a){C(r,e,a),t&&t.m(e,null),w(e,l)},p(r,[a]){r[1]?t?t.p(r,a):(t=gl(r),t.c(),t.m(e,l)):t&&(t.d(1),t=null),$e(e,f=Ce(n,[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},a&1&&{width:r[0]},a&1&&{height:r[0]},a&4&&r[2],a&8&&r[3]]))},i:Z,o:Z,d(r){r&&h(e),t&&t.d()}}}function ss(i,e,l){let t,n;const f=["size","title"];let r=ke(e,f),{size:a=16}=e,{title:s=void 0}=e;return i.$$set=o=>{l(5,e=de(de({},e),Se(o))),l(3,r=ke(e,f)),"size"in o&&l(0,a=o.size),"title"in o&&l(1,s=o.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[a,s,n,r,t]}class as extends ge{constructor(e){super(),pe(this,e,ss,rs,_e,{size:0,title:1})}}function pl(i){let e,l;return{c(){e=be("title"),l=Q(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=J(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),w(e,l)},p(t,n){n&2&&ue(l,t[1])},d(t){t&&h(e)}}}function fs(i){let e,l,t=i[1]&&pl(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],f={};for(let r=0;r<n.length;r+=1)f=de(f,n[r]);return{c(){e=be("svg"),t&&t.c(),l=be("path"),this.h()},l(r){e=ve(r,"svg",{xmlns:!0,viewBox:!0,fill:!0,preserveAspectRatio:!0,width:!0,height:!0});var a=D(e);t&&t.l(a),l=ve(a,"path",{d:!0}),D(l).forEach(h),a.forEach(h),this.h()},h(){T(l,"d","M10 16L20 6 21.4 7.4 12.8 16 21.4 24.6 20 26z"),$e(e,f)},m(r,a){C(r,e,a),t&&t.m(e,null),w(e,l)},p(r,[a]){r[1]?t?t.p(r,a):(t=pl(r),t.c(),t.m(e,l)):t&&(t.d(1),t=null),$e(e,f=Ce(n,[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},a&1&&{width:r[0]},a&1&&{height:r[0]},a&4&&r[2],a&8&&r[3]]))},i:Z,o:Z,d(r){r&&h(e),t&&t.d()}}}function os(i,e,l){let t,n;const f=["size","title"];let r=ke(e,f),{size:a=16}=e,{title:s=void 0}=e;return i.$$set=o=>{l(5,e=de(de({},e),Se(o))),l(3,r=ke(e,f)),"size"in o&&l(0,a=o.size),"title"in o&&l(1,s=o.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[a,s,n,r,t]}class us extends ge{constructor(e){super(),pe(this,e,os,fs,_e,{size:0,title:1})}}function bl(i){let e,l;return{c(){e=be("title"),l=Q(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=J(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),w(e,l)},p(t,n){n&2&&ue(l,t[1])},d(t){t&&h(e)}}}function cs(i){let e,l,t=i[1]&&bl(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],f={};for(let r=0;r<n.length;r+=1)f=de(f,n[r]);return{c(){e=be("svg"),t&&t.c(),l=be("path"),this.h()},l(r){e=ve(r,"svg",{xmlns:!0,viewBox:!0,fill:!0,preserveAspectRatio:!0,width:!0,height:!0});var a=D(e);t&&t.l(a),l=ve(a,"path",{d:!0}),D(l).forEach(h),a.forEach(h),this.h()},h(){T(l,"d","M22 16L12 26 10.6 24.6 19.2 16 10.6 7.4 12 6z"),$e(e,f)},m(r,a){C(r,e,a),t&&t.m(e,null),w(e,l)},p(r,[a]){r[1]?t?t.p(r,a):(t=bl(r),t.c(),t.m(e,l)):t&&(t.d(1),t=null),$e(e,f=Ce(n,[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},a&1&&{width:r[0]},a&1&&{height:r[0]},a&4&&r[2],a&8&&r[3]]))},i:Z,o:Z,d(r){r&&h(e),t&&t.d()}}}function ds(i,e,l){let t,n;const f=["size","title"];let r=ke(e,f),{size:a=16}=e,{title:s=void 0}=e;return i.$$set=o=>{l(5,e=de(de({},e),Se(o))),l(3,r=ke(e,f)),"size"in o&&l(0,a=o.size),"title"in o&&l(1,s=o.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[a,s,n,r,t]}class ms extends ge{constructor(e){super(),pe(this,e,ds,cs,_e,{size:0,title:1})}}function vl(i){let e,l;return{c(){e=be("title"),l=Q(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=J(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),w(e,l)},p(t,n){n&2&&ue(l,t[1])},d(t){t&&h(e)}}}function hs(i){let e,l,t=i[1]&&vl(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],f={};for(let r=0;r<n.length;r+=1)f=de(f,n[r]);return{c(){e=be("svg"),t&&t.c(),l=be("path"),this.h()},l(r){e=ve(r,"svg",{xmlns:!0,viewBox:!0,fill:!0,preserveAspectRatio:!0,width:!0,height:!0});var a=D(e);t&&t.l(a),l=ve(a,"path",{d:!0}),D(l).forEach(h),a.forEach(h),this.h()},h(){T(l,"d","M26 24v4H6V24H4v4H4a2 2 0 002 2H26a2 2 0 002-2h0V24zM26 14L24.59 12.59 17 20.17 17 2 15 2 15 20.17 7.41 12.59 6 14 16 24 26 14z"),$e(e,f)},m(r,a){C(r,e,a),t&&t.m(e,null),w(e,l)},p(r,[a]){r[1]?t?t.p(r,a):(t=vl(r),t.c(),t.m(e,l)):t&&(t.d(1),t=null),$e(e,f=Ce(n,[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},a&1&&{width:r[0]},a&1&&{height:r[0]},a&4&&r[2],a&8&&r[3]]))},i:Z,o:Z,d(r){r&&h(e),t&&t.d()}}}function _s(i,e,l){let t,n;const f=["size","title"];let r=ke(e,f),{size:a=16}=e,{title:s=void 0}=e;return i.$$set=o=>{l(5,e=de(de({},e),Se(o))),l(3,r=ke(e,f)),"size"in o&&l(0,a=o.size),"title"in o&&l(1,s=o.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[a,s,n,r,t]}class gs extends ge{constructor(e){super(),pe(this,e,_s,hs,_e,{size:0,title:1})}}function wl(i){let e,l;return{c(){e=be("title"),l=Q(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=J(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),w(e,l)},p(t,n){n&2&&ue(l,t[1])},d(t){t&&h(e)}}}function ps(i){let e,l,t=i[1]&&wl(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],f={};for(let r=0;r<n.length;r+=1)f=de(f,n[r]);return{c(){e=be("svg"),t&&t.c(),l=be("path"),this.h()},l(r){e=ve(r,"svg",{xmlns:!0,viewBox:!0,fill:!0,preserveAspectRatio:!0,width:!0,height:!0});var a=D(e);t&&t.l(a),l=ve(a,"path",{d:!0}),D(l).forEach(h),a.forEach(h),this.h()},h(){T(l,"d","M16 7a3 3 0 113-3A3.0033 3.0033 0 0116 7zm0-4a1 1 0 101 1A1.001 1.001 0 0016 3zM11 30a3 3 0 113-3A3.0033 3.0033 0 0111 30zm0-4a1 1 0 101 1A1.001 1.001 0 0011 26zM7 11a3 3 0 113-3A3.0033 3.0033 0 017 11zM7 7A1 1 0 108 8 1.001 1.001 0 007 7zM21 30a3 3 0 113-3A3.0033 3.0033 0 0121 30zm0-4a1 1 0 101 1A1.001 1.001 0 0021 26zM25 11a3 3 0 113-3A3.0033 3.0033 0 0125 11zm0-4a1 1 0 101 1A1.001 1.001 0 0025 7zM4 21a3 3 0 113-3A3.0033 3.0033 0 014 21zm0-4a1 1 0 101 1A1.001 1.001 0 004 17zM28 21a3 3 0 113-3A3.0033 3.0033 0 0128 21zm0-4a1 1 0 101 1A1.001 1.001 0 0028 17zM16 22a6 6 0 116-6A6.0069 6.0069 0 0116 22zm0-10a4 4 0 104 4A4.0045 4.0045 0 0016 12z"),$e(e,f)},m(r,a){C(r,e,a),t&&t.m(e,null),w(e,l)},p(r,[a]){r[1]?t?t.p(r,a):(t=wl(r),t.c(),t.m(e,l)):t&&(t.d(1),t=null),$e(e,f=Ce(n,[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},a&1&&{width:r[0]},a&1&&{height:r[0]},a&4&&r[2],a&8&&r[3]]))},i:Z,o:Z,d(r){r&&h(e),t&&t.d()}}}function bs(i,e,l){let t,n;const f=["size","title"];let r=ke(e,f),{size:a=16}=e,{title:s=void 0}=e;return i.$$set=o=>{l(5,e=de(de({},e),Se(o))),l(3,r=ke(e,f)),"size"in o&&l(0,a=o.size),"title"in o&&l(1,s=o.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[a,s,n,r,t]}class vs extends ge{constructor(e){super(),pe(this,e,bs,ps,_e,{size:0,title:1})}}function kl(i){let e,l;return{c(){e=be("title"),l=Q(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=J(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),w(e,l)},p(t,n){n&2&&ue(l,t[1])},d(t){t&&h(e)}}}function ws(i){let e,l,t,n=i[1]&&kl(i),f=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],r={};for(let a=0;a<f.length;a+=1)r=de(r,f[a]);return{c(){e=be("svg"),n&&n.c(),l=be("path"),t=be("path"),this.h()},l(a){e=ve(a,"svg",{xmlns:!0,viewBox:!0,fill:!0,preserveAspectRatio:!0,width:!0,height:!0});var s=D(e);n&&n.l(s),l=ve(s,"path",{d:!0}),D(l).forEach(h),t=ve(s,"path",{d:!0}),D(t).forEach(h),s.forEach(h),this.h()},h(){T(l,"d","M17 22L17 14 13 14 13 16 15 16 15 22 12 22 12 24 20 24 20 22 17 22zM16 8a1.5 1.5 0 101.5 1.5A1.5 1.5 0 0016 8z"),T(t,"d","M16,30A14,14,0,1,1,30,16,14,14,0,0,1,16,30ZM16,4A12,12,0,1,0,28,16,12,12,0,0,0,16,4Z"),$e(e,r)},m(a,s){C(a,e,s),n&&n.m(e,null),w(e,l),w(e,t)},p(a,[s]){a[1]?n?n.p(a,s):(n=kl(a),n.c(),n.m(e,l)):n&&(n.d(1),n=null),$e(e,r=Ce(f,[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},s&1&&{width:a[0]},s&1&&{height:a[0]},s&4&&a[2],s&8&&a[3]]))},i:Z,o:Z,d(a){a&&h(e),n&&n.d()}}}function ks(i,e,l){let t,n;const f=["size","title"];let r=ke(e,f),{size:a=16}=e,{title:s=void 0}=e;return i.$$set=o=>{l(5,e=de(de({},e),Se(o))),l(3,r=ke(e,f)),"size"in o&&l(0,a=o.size),"title"in o&&l(1,s=o.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[a,s,n,r,t]}class It extends ge{constructor(e){super(),pe(this,e,ks,ws,_e,{size:0,title:1})}}function Sl(i){let e,l;return{c(){e=be("title"),l=Q(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=J(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),w(e,l)},p(t,n){n&2&&ue(l,t[1])},d(t){t&&h(e)}}}function Ss(i){let e,l,t=i[1]&&Sl(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],f={};for(let r=0;r<n.length;r+=1)f=de(f,n[r]);return{c(){e=be("svg"),t&&t.c(),l=be("path"),this.h()},l(r){e=ve(r,"svg",{xmlns:!0,viewBox:!0,fill:!0,preserveAspectRatio:!0,width:!0,height:!0});var a=D(e);t&&t.l(a),l=ve(a,"path",{d:!0}),D(l).forEach(h),a.forEach(h),this.h()},h(){T(l,"d","M18,28A12,12,0,1,0,6,16v6.2L2.4,18.6,1,20l6,6,6-6-1.4-1.4L8,22.2V16H8A10,10,0,1,1,18,26Z"),$e(e,f)},m(r,a){C(r,e,a),t&&t.m(e,null),w(e,l)},p(r,[a]){r[1]?t?t.p(r,a):(t=Sl(r),t.c(),t.m(e,l)):t&&(t.d(1),t=null),$e(e,f=Ce(n,[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},a&1&&{width:r[0]},a&1&&{height:r[0]},a&4&&r[2],a&8&&r[3]]))},i:Z,o:Z,d(r){r&&h(e),t&&t.d()}}}function Es(i,e,l){let t,n;const f=["size","title"];let r=ke(e,f),{size:a=16}=e,{title:s=void 0}=e;return i.$$set=o=>{l(5,e=de(de({},e),Se(o))),l(3,r=ke(e,f)),"size"in o&&l(0,a=o.size),"title"in o&&l(1,s=o.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[a,s,n,r,t]}class ys extends ge{constructor(e){super(),pe(this,e,Es,Ss,_e,{size:0,title:1})}}function El(i){let e,l;return{c(){e=be("title"),l=Q(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=J(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),w(e,l)},p(t,n){n&2&&ue(l,t[1])},d(t){t&&h(e)}}}function $s(i){let e,l,t=i[1]&&El(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],f={};for(let r=0;r<n.length;r+=1)f=de(f,n[r]);return{c(){e=be("svg"),t&&t.c(),l=be("path"),this.h()},l(r){e=ve(r,"svg",{xmlns:!0,viewBox:!0,fill:!0,preserveAspectRatio:!0,width:!0,height:!0});var a=D(e);t&&t.l(a),l=ve(a,"path",{d:!0}),D(l).forEach(h),a.forEach(h),this.h()},h(){T(l,"d","M30 6L26 6 26 2 24 2 24 6 20 6 20 8 24 8 24 12 26 12 26 8 30 8 30 6zM24 28.5859l-5.9751-5.9751a9.0234 9.0234 0 10-1.4141 1.4141L22.5859 30zM4 17a7 7 0 117 7A7.0078 7.0078 0 014 17z"),$e(e,f)},m(r,a){C(r,e,a),t&&t.m(e,null),w(e,l)},p(r,[a]){r[1]?t?t.p(r,a):(t=El(r),t.c(),t.m(e,l)):t&&(t.d(1),t=null),$e(e,f=Ce(n,[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},a&1&&{width:r[0]},a&1&&{height:r[0]},a&4&&r[2],a&8&&r[3]]))},i:Z,o:Z,d(r){r&&h(e),t&&t.d()}}}function Ds(i,e,l){let t,n;const f=["size","title"];let r=ke(e,f),{size:a=16}=e,{title:s=void 0}=e;return i.$$set=o=>{l(5,e=de(de({},e),Se(o))),l(3,r=ke(e,f)),"size"in o&&l(0,a=o.size),"title"in o&&l(1,s=o.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[a,s,n,r,t]}class Is extends ge{constructor(e){super(),pe(this,e,Ds,$s,_e,{size:0,title:1})}}function yl(i){let e,l;return{c(){e=be("title"),l=Q(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=J(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),w(e,l)},p(t,n){n&2&&ue(l,t[1])},d(t){t&&h(e)}}}function Vs(i){let e,l,t=i[1]&&yl(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],f={};for(let r=0;r<n.length;r+=1)f=de(f,n[r]);return{c(){e=be("svg"),t&&t.c(),l=be("path"),this.h()},l(r){e=ve(r,"svg",{xmlns:!0,viewBox:!0,fill:!0,preserveAspectRatio:!0,width:!0,height:!0});var a=D(e);t&&t.l(a),l=ve(a,"path",{d:!0}),D(l).forEach(h),a.forEach(h),this.h()},h(){T(l,"d","M18 22L19.414 20.586 23 24.172 23 4 25 4 25 24.172 28.586 20.586 30 22 24 28 18 22zM2 18H16V20H2zM6 12H16V14H6zM10 6H16V8H10z"),$e(e,f)},m(r,a){C(r,e,a),t&&t.m(e,null),w(e,l)},p(r,[a]){r[1]?t?t.p(r,a):(t=yl(r),t.c(),t.m(e,l)):t&&(t.d(1),t=null),$e(e,f=Ce(n,[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},a&1&&{width:r[0]},a&1&&{height:r[0]},a&4&&r[2],a&8&&r[3]]))},i:Z,o:Z,d(r){r&&h(e),t&&t.d()}}}function Ts(i,e,l){let t,n;const f=["size","title"];let r=ke(e,f),{size:a=16}=e,{title:s=void 0}=e;return i.$$set=o=>{l(5,e=de(de({},e),Se(o))),l(3,r=ke(e,f)),"size"in o&&l(0,a=o.size),"title"in o&&l(1,s=o.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[a,s,n,r,t]}class Vt extends ge{constructor(e){super(),pe(this,e,Ts,Vs,_e,{size:0,title:1})}}function $l(i){let e,l;return{c(){e=be("title"),l=Q(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=J(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),w(e,l)},p(t,n){n&2&&ue(l,t[1])},d(t){t&&h(e)}}}function Cs(i){let e,l,t=i[1]&&$l(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],f={};for(let r=0;r<n.length;r+=1)f=de(f,n[r]);return{c(){e=be("svg"),t&&t.c(),l=be("path"),this.h()},l(r){e=ve(r,"svg",{xmlns:!0,viewBox:!0,fill:!0,preserveAspectRatio:!0,width:!0,height:!0});var a=D(e);t&&t.l(a),l=ve(a,"path",{d:!0}),D(l).forEach(h),a.forEach(h),this.h()},h(){T(l,"d","M18 22L19.414 20.586 23 24.172 23 4 25 4 25 24.172 28.586 20.586 30 22 24 28 18 22zM2 6H16V8H2zM6 12H16V14H6zM10 18H16V20H10z"),$e(e,f)},m(r,a){C(r,e,a),t&&t.m(e,null),w(e,l)},p(r,[a]){r[1]?t?t.p(r,a):(t=$l(r),t.c(),t.m(e,l)):t&&(t.d(1),t=null),$e(e,f=Ce(n,[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},a&1&&{width:r[0]},a&1&&{height:r[0]},a&4&&r[2],a&8&&r[3]]))},i:Z,o:Z,d(r){r&&h(e),t&&t.d()}}}function Ns(i,e,l){let t,n;const f=["size","title"];let r=ke(e,f),{size:a=16}=e,{title:s=void 0}=e;return i.$$set=o=>{l(5,e=de(de({},e),Se(o))),l(3,r=ke(e,f)),"size"in o&&l(0,a=o.size),"title"in o&&l(1,s=o.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[a,s,n,r,t]}class Tt extends ge{constructor(e){super(),pe(this,e,Ns,Cs,_e,{size:0,title:1})}}function Dl(i){let e,l;return{c(){e=be("title"),l=Q(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=J(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),w(e,l)},p(t,n){n&2&&ue(l,t[1])},d(t){t&&h(e)}}}function Ms(i){let e,l,t=i[1]&&Dl(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],f={};for(let r=0;r<n.length;r+=1)f=de(f,n[r]);return{c(){e=be("svg"),t&&t.c(),l=be("path"),this.h()},l(r){e=ve(r,"svg",{xmlns:!0,viewBox:!0,fill:!0,preserveAspectRatio:!0,width:!0,height:!0});var a=D(e);t&&t.l(a),l=ve(a,"path",{d:!0}),D(l).forEach(h),a.forEach(h),this.h()},h(){T(l,"d","M30 19.415L28.586 18 25 21.587 21.414 18 20 19.415 23.586 23 20 26.586 21.414 28 25 24.414 28.586 28 30 26.586 26.414 23 30 19.415zM10 18H16V20H10zM2 6H16V8H2zM6 12H16V14H6z"),$e(e,f)},m(r,a){C(r,e,a),t&&t.m(e,null),w(e,l)},p(r,[a]){r[1]?t?t.p(r,a):(t=Dl(r),t.c(),t.m(e,l)):t&&(t.d(1),t=null),$e(e,f=Ce(n,[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},a&1&&{width:r[0]},a&1&&{height:r[0]},a&4&&r[2],a&8&&r[3]]))},i:Z,o:Z,d(r){r&&h(e),t&&t.d()}}}function zs(i,e,l){let t,n;const f=["size","title"];let r=ke(e,f),{size:a=16}=e,{title:s=void 0}=e;return i.$$set=o=>{l(5,e=de(de({},e),Se(o))),l(3,r=ke(e,f)),"size"in o&&l(0,a=o.size),"title"in o&&l(1,s=o.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[a,s,n,r,t]}class Il extends ge{constructor(e){super(),pe(this,e,zs,Ms,_e,{size:0,title:1})}}function Vl(i){let e,l;return{c(){e=be("title"),l=Q(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=J(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),w(e,l)},p(t,n){n&2&&ue(l,t[1])},d(t){t&&h(e)}}}function As(i){let e,l,t,n=i[1]&&Vl(i),f=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],r={};for(let a=0;a<f.length;a+=1)r=de(r,f[a]);return{c(){e=be("svg"),n&&n.c(),l=be("path"),t=be("path"),this.h()},l(a){e=ve(a,"svg",{xmlns:!0,viewBox:!0,fill:!0,preserveAspectRatio:!0,width:!0,height:!0});var s=D(e);n&&n.l(s),l=ve(s,"path",{d:!0}),D(l).forEach(h),t=ve(s,"path",{d:!0}),D(t).forEach(h),s.forEach(h),this.h()},h(){T(l,"d","M30.94,15.66A16.69,16.69,0,0,0,16,5,16.69,16.69,0,0,0,1.06,15.66a1,1,0,0,0,0,.68A16.69,16.69,0,0,0,16,27,16.69,16.69,0,0,0,30.94,16.34,1,1,0,0,0,30.94,15.66ZM16,25c-5.3,0-10.9-3.93-12.93-9C5.1,10.93,10.7,7,16,7s10.9,3.93,12.93,9C26.9,21.07,21.3,25,16,25Z"),T(t,"d","M16,10a6,6,0,1,0,6,6A6,6,0,0,0,16,10Zm0,10a4,4,0,1,1,4-4A4,4,0,0,1,16,20Z"),$e(e,r)},m(a,s){C(a,e,s),n&&n.m(e,null),w(e,l),w(e,t)},p(a,[s]){a[1]?n?n.p(a,s):(n=Vl(a),n.c(),n.m(e,l)):n&&(n.d(1),n=null),$e(e,r=Ce(f,[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},s&1&&{width:a[0]},s&1&&{height:a[0]},s&4&&a[2],s&8&&a[3]]))},i:Z,o:Z,d(a){a&&h(e),n&&n.d()}}}function Fs(i,e,l){let t,n;const f=["size","title"];let r=ke(e,f),{size:a=16}=e,{title:s=void 0}=e;return i.$$set=o=>{l(5,e=de(de({},e),Se(o))),l(3,r=ke(e,f)),"size"in o&&l(0,a=o.size),"title"in o&&l(1,s=o.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[a,s,n,r,t]}class Bs extends ge{constructor(e){super(),pe(this,e,Fs,As,_e,{size:0,title:1})}}function Tl(i){let e;return{c(){e=A("div"),this.h()},l(l){e=F(l,"DIV",{id:!0,style:!0}),D(e).forEach(h),this.h()},h(){T(e,"id","svelte-infinite-scroll"),Ue(e,"width","0")},m(l,t){C(l,e,t),i[11](e)},p:Z,d(l){l&&h(e),i[11](null)}}}function Ps(i){let e,l=!i[1]&&!i[0]&&Tl(i);return{c(){l&&l.c(),e=le()},l(t){l&&l.l(t),e=le()},m(t,n){l&&l.m(t,n),C(t,e,n)},p(t,[n]){!t[1]&&!t[0]?l?l.p(t,n):(l=Tl(t),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:Z,o:Z,d(t){l&&l.d(t),t&&h(e)}}}function Rs(i,e,l){let{threshold:t=0}=e,{horizontal:n=!1}=e,{elementScroll:f=null}=e,{hasMore:r=!0}=e,{reverse:a=!1}=e,{window:s=!1}=e;const o=_t();let u=!1,d,c,m,_;const p=S=>{if(!r)return;const v=S.target;k(v,a,n)<=t?(!u&&r&&(o("loadMore"),l(8,c=v.scrollHeight),l(9,m=v.scrollTop)),l(7,u=!0)):l(7,u=!1)},k=(S,v,y)=>{const N=S.documentElement?S.documentElement:S;return v?y?N.scrollLeft:N.scrollTop:y?N.scrollWidth-N.clientWidth-N.scrollLeft:N.scrollHeight-N.clientHeight-N.scrollTop};oi(()=>{s?l(10,_=document):f?l(10,_=f):l(10,_=d.parentNode)}),Vi(()=>{_&&(_.removeEventListener("scroll",p),_.removeEventListener("resize",p))});function $(S){Pe[S?"unshift":"push"](()=>{d=S,l(2,d)})}return i.$$set=S=>{"threshold"in S&&l(3,t=S.threshold),"horizontal"in S&&l(4,n=S.horizontal),"elementScroll"in S&&l(0,f=S.elementScroll),"hasMore"in S&&l(5,r=S.hasMore),"reverse"in S&&l(6,a=S.reverse),"window"in S&&l(1,s=S.window)},i.$$.update=()=>{i.$$.dirty&1088&&_&&(a&&l(10,_.scrollTop=_.scrollHeight,_),_.addEventListener("scroll",p),_.addEventListener("resize",p)),i.$$.dirty&1984&&u&&a&&l(10,_.scrollTop=_.scrollHeight-c+m,_)},[f,s,d,t,n,r,a,u,c,m,_,$]}class qs extends ge{constructor(e){super(),pe(this,e,Rs,Ps,_e,{threshold:3,horizontal:4,elementScroll:0,hasMore:5,reverse:6,window:1})}}function Ls(i){let e,l,t,n,f,r,a,s;t=new Zi({});const o=i[3].default,u=rt(o,i,i[6],null);return{c(){e=A("div"),l=A("button"),R(t.$$.fragment),n=j(),f=A("span"),u&&u.c(),this.h()},l(d){e=F(d,"DIV",{class:!0});var c=D(e);l=F(c,"BUTTON",{class:!0});var m=D(l);O(t.$$.fragment,m),m.forEach(h),n=U(c),f=F(c,"SPAN",{class:!0});var _=D(f);u&&u.l(_),_.forEach(h),c.forEach(h),this.h()},h(){T(l,"class","opacity-50 hover:opacity-100"),T(f,"class","truncate"),T(e,"class","removable-tag flex items-center gap-x-1")},m(d,c){C(d,e,c),w(e,l),q(t,l,null),w(e,n),w(e,f),u&&u.m(f,null),r=!0,a||(s=Ve(l,"click",qt(i[4])),a=!0)},p(d,c){u&&u.p&&(!r||c&64)&&st(u,o,d,d[6],r?ft(o,d[6],c,null):at(d[6]),null)},i(d){r||(g(t.$$.fragment,d),g(u,d),r=!0)},o(d){b(t.$$.fragment,d),b(u,d),r=!1},d(d){d&&h(e),L(t),u&&u.d(d),a=!1,s()}}}function Os(i){let e,l;const t=[{type:i[0]},i[2]];let n={$$slots:{default:[Ls]},$$scope:{ctx:i}};for(let f=0;f<t.length;f+=1)n=de(n,t[f]);return e=new lt({props:n}),e.$on("click",i[5]),{c(){R(e.$$.fragment)},l(f){O(e.$$.fragment,f)},m(f,r){q(e,f,r),l=!0},p(f,[r]){const a=r&5?Ce(t,[r&1&&{type:f[0]},r&4&&di(f[2])]):{};r&64&&(a.$$scope={dirty:r,ctx:f}),e.$set(a)},i(f){l||(g(e.$$.fragment,f),l=!0)},o(f){b(e.$$.fragment,f),l=!1},d(f){L(e,f)}}}function Hs(i,e,l){const t=["type"];let n=ke(e,t),{$$slots:f={},$$scope:r}=e;const a=_t();let{type:s}=e;const o=()=>a("remove");function u(d){je.call(this,i,d)}return i.$$set=d=>{e=de(de({},e),Se(d)),l(2,n=ke(e,t)),"type"in d&&l(0,s=d.type),"$$scope"in d&&l(6,r=d.$$scope)},[s,a,n,f,o,u,r]}class zt extends ge{constructor(e){super(),pe(this,e,Hs,Os,_e,{type:0})}}function js(i){let e=(i[2]?"":i[5])+"",l,t,n=i[0][i[1].op]+"",f,r,a;return{c(){l=Q(e),t=j(),f=Q(n),r=j(),a=Q(i[4])},l(s){l=J(s,e),t=U(s),f=J(s,n),r=U(s),a=J(s,i[4])},m(s,o){C(s,l,o),C(s,t,o),C(s,f,o),C(s,r,o),C(s,a,o)},p(s,o){o&36&&e!==(e=(s[2]?"":s[5])+"")&&ue(l,e),o&2&&n!==(n=s[0][s[1].op]+"")&&ue(f,n),o&16&&ue(a,s[4])},d(s){s&&h(l),s&&h(t),s&&h(f),s&&h(r),s&&h(a)}}}function Us(i){let e,l,t,n,f,r;return l=new zt({props:{interactive:!0,type:"magenta",$$slots:{default:[js]},$$scope:{ctx:i}}}),l.$on("click",i[9]),l.$on("remove",i[10]),{c(){e=A("div"),R(l.$$.fragment),this.h()},l(a){e=F(a,"DIV",{class:!0});var s=D(e);O(l.$$.fragment,s),s.forEach(h),this.h()},h(){T(e,"class","filter-pill items-center")},m(a,s){C(a,e,s),q(l,e,null),n=!0,f||(r=Me(t=ze.call(null,e,{text:i[6]})),f=!0)},p(a,[s]){const o={};s&2102&&(o.$$scope={dirty:s,ctx:a}),l.$set(o),t&&qe(t.update)&&s&64&&t.update.call(null,{text:a[6]})},i(a){n||(g(l.$$.fragment,a),n=!0)},o(a){b(l.$$.fragment,a),n=!1},d(a){a&&h(e),L(l),f=!1,r()}}}function Ys(i,e,l){let t,n,f,r,a;const s={equals:"=",not_equal:"≠",less:"<",less_equal:"≤",greater:">",greater_equal:"≥",in:"in",exists:"exists"};let{filter:o}=e,{hidePath:u=!1}=e;const d=Re();he(i,d,_=>l(7,a=_));const c=()=>Xe({command:xe.EditFilter,namespace:a.namespace,datasetName:a.datasetName,path:n}),m=()=>d.removeFilter(o);return i.$$set=_=>{"filter"in _&&l(1,o=_.filter),"hidePath"in _&&l(2,u=_.hidePath)},i.$$.update=()=>{i.$$.dirty&2&&l(4,t=De(o.value||"false")),i.$$.dirty&2&&l(3,n=Lt(o.path)),i.$$.dirty&18&&l(6,f=`${Ie(o.path)} ${s[o.op]} ${t}`),i.$$.dirty&8&&l(5,r=n.at(-1))},[s,o,u,n,t,r,f,a,d,c,m]}class Gt extends ge{constructor(e){super(),pe(this,e,Ys,Us,_e,{FILTER_SHORTHANDS:0,filter:1,hidePath:2})}get FILTER_SHORTHANDS(){return this.$$.ctx[0]}}function Cl(i){let e,l=i[0].query.concept_namespace+"",t,n,f=i[0].query.concept_name+"",r;return{c(){e=A("div"),t=Q(l),n=Q(" / "),r=Q(f),this.h()},l(a){e=F(a,"DIV",{class:!0});var s=D(e);t=J(s,l),n=J(s," / "),r=J(s,f),s.forEach(h),this.h()},h(){T(e,"class","mb-2 w-full text-center text-xs")},m(a,s){C(a,e,s),w(e,t),w(e,n),w(e,r)},p(a,s){s&1&&l!==(l=a[0].query.concept_namespace+"")&&ue(t,l),s&1&&f!==(f=a[0].query.concept_name+"")&&ue(r,f)},d(a){a&&h(e)}}}function Ws(i){let e=Ie(i[0].path)+"",l,t,n=i[0].query.type+"",f;return{c(){l=Q(e),t=Q(": "),f=Q(n)},l(r){l=J(r,e),t=J(r,": "),f=J(r,n)},m(r,a){C(r,l,a),C(r,t,a),C(r,f,a)},p(r,a){a&1&&e!==(e=Ie(r[0].path)+"")&&ue(l,e),a&1&&n!==(n=r[0].query.type+"")&&ue(f,n)},d(r){r&&h(l),r&&h(t),r&&h(f)}}}function Nl(i){let e,l,t;return l=new Ut({props:{embedding:i[0].query.embedding}}),{c(){e=A("div"),R(l.$$.fragment),this.h()},l(n){e=F(n,"DIV",{class:!0});var f=D(e);O(l.$$.fragment,f),f.forEach(h),this.h()},h(){T(e,"class","ml-2")},m(n,f){C(n,e,f),q(l,e,null),t=!0},p(n,f){const r={};f&1&&(r.embedding=n[0].query.embedding),l.$set(r)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){b(l.$$.fragment,n),t=!1},d(n){n&&h(e),L(l)}}}function Ml(i){let e,l;return{c(){e=A("div"),l=Q(i[2]),this.h()},l(t){e=F(t,"DIV",{class:!0});var n=D(e);l=J(n,i[2]),n.forEach(h),this.h()},h(){T(e,"class","mt-2 whitespace-pre-wrap text-left")},m(t,n){C(t,e,n),w(e,l)},p(t,n){n&4&&ue(l,t[2])},d(t){t&&h(e)}}}function Qs(i){let e,l,t,n,f,r,a,s,o=i[0].query.type==="concept"&&Cl(i);n=new lt({props:{type:i[1],$$slots:{default:[Ws]},$$scope:{ctx:i}}});let u=(i[0].query.type==="semantic"||i[0].query.type==="concept")&&Nl(i),d=i[2]&&Ml(i);return{c(){o&&o.c(),e=j(),l=A("div"),t=A("div"),R(n.$$.fragment),f=j(),u&&u.c(),r=j(),d&&d.c(),a=le(),this.h()},l(c){o&&o.l(c),e=U(c),l=F(c,"DIV",{class:!0});var m=D(l);t=F(m,"DIV",{class:!0});var _=D(t);O(n.$$.fragment,_),_.forEach(h),f=U(m),u&&u.l(m),m.forEach(h),r=U(c),d&&d.l(c),a=le(),this.h()},h(){T(t,"class","whitespace-nowrap"),T(l,"class","flex items-center justify-items-center")},m(c,m){o&&o.m(c,m),C(c,e,m),C(c,l,m),w(l,t),q(n,t,null),w(l,f),u&&u.m(l,null),C(c,r,m),d&&d.m(c,m),C(c,a,m),s=!0},p(c,[m]){c[0].query.type==="concept"?o?o.p(c,m):(o=Cl(c),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null);const _={};m&2&&(_.type=c[1]),m&9&&(_.$$scope={dirty:m,ctx:c}),n.$set(_),c[0].query.type==="semantic"||c[0].query.type==="concept"?u?(u.p(c,m),m&1&&g(u,1)):(u=Nl(c),u.c(),g(u,1),u.m(l,null)):u&&(X(),b(u,1,1,()=>{u=null}),x()),c[2]?d?d.p(c,m):(d=Ml(c),d.c(),d.m(a.parentNode,a)):d&&(d.d(1),d=null)},i(c){s||(g(n.$$.fragment,c),g(u),s=!0)},o(c){b(n.$$.fragment,c),b(u),s=!1},d(c){o&&o.d(c),c&&h(e),c&&h(l),L(n),u&&u.d(),c&&h(r),d&&d.d(c),c&&h(a)}}}function Js(i,e,l){let t,{search:n}=e,{tagType:f="outline"}=e;return i.$$set=r=>{"search"in r&&l(0,n=r.search),"tagType"in r&&l(1,f=r.tagType)},i.$$.update=()=>{i.$$.dirty&1&&l(2,t=n.query.type==="concept"?"":n.query.search)},[n,f,t]}class zl extends ge{constructor(e){super(),pe(this,e,Js,Qs,_e,{search:0,tagType:1})}}function Ks(i){let e;return{c(){e=Q(i[2])},l(l){e=J(l,i[2])},m(l,t){C(l,e,t)},p(l,t){t&4&&ue(e,l[2])},d(l){l&&h(e)}}}function Zs(i){let e,l,t,n,f,r;return l=new zt({props:{title:"query",interactive:!0,type:i[1],$$slots:{default:[Ks]},$$scope:{ctx:i}}}),l.$on("remove",i[7]),{c(){e=A("button"),R(l.$$.fragment),this.h()},l(a){e=F(a,"BUTTON",{class:!0});var s=D(e);O(l.$$.fragment,s),s.forEach(h),this.h()},h(){T(e,"class","search-pill items-center text-left")},m(a,s){C(a,e,s),q(l,e,null),n=!0,f||(r=[Me(t=ze.call(null,e,{component:zl,props:{search:i[0],tagType:i[1]}})),Ve(e,"click",i[6])],f=!0)},p(a,[s]){const o={};s&2&&(o.type=a[1]),s&516&&(o.$$scope={dirty:s,ctx:a}),l.$set(o),t&&qe(t.update)&&s&3&&t.update.call(null,{component:zl,props:{search:a[0],tagType:a[1]}})},i(a){n||(g(l.$$.fragment,a),n=!0)},o(a){b(l.$$.fragment,a),n=!1},d(a){a&&h(e),L(l),f=!1,Je(r)}}}function Gs(i,e,l){let t,n,f,{search:r}=e;const a={keyword:"outline",semantic:"teal",concept:"green"},s=Re(),o=We();he(i,o,c=>l(3,f=c));function u(c){je.call(this,i,c)}const d=()=>{var c;return s.removeSearch(r,((c=f.selectRowsSchema)==null?void 0:c.data)||null)};return i.$$set=c=>{"search"in c&&l(0,r=c.search)},i.$$.update=()=>{i.$$.dirty&1&&l(2,t=r.query.type==="concept"?r.query.concept_name:r.query.search),i.$$.dirty&1&&l(1,n=r.query.type!=null?a[r.query.type]:"outline")},[r,n,t,f,s,o,u,d]}class Ei extends ge{constructor(e){super(),pe(this,e,Gs,Zs,_e,{search:0})}}function Al(i,e,l){const t=i.slice();return t[25]=e[l],t}function Fl(i,e,l){const t=i.slice();return t[28]=e[l],t}function Bl(i,e,l){const t=i.slice();return t[31]=e[l],t}function Xs(i){let e,l,t,n=i[13],f=[];for(let s=0;s<n.length;s+=1)f[s]=ql(Fl(i,n,s));const r=s=>b(f[s],1,1,()=>{f[s]=null});let a=i[8]!=null&&i[8].length>0&&Ll(i);return{c(){e=A("div");for(let s=0;s<f.length;s+=1)f[s].c();l=j(),a&&a.c(),this.h()},l(s){e=F(s,"DIV",{class:!0});var o=D(e);for(let u=0;u<f.length;u+=1)f[u].l(o);l=U(o),a&&a.l(o),o.forEach(h),this.h()},h(){T(e,"class","flex w-full flex-row gap-x-4")},m(s,o){C(s,e,o);for(let u=0;u<f.length;u+=1)f[u]&&f[u].m(e,null);w(e,l),a&&a.m(e,null),t=!0},p(s,o){if(o[0]&57352){n=s[13];let u;for(u=0;u<n.length;u+=1){const d=Fl(s,n,u);f[u]?(f[u].p(d,o),g(f[u],1)):(f[u]=ql(d),f[u].c(),g(f[u],1),f[u].m(e,l))}for(X(),u=n.length;u<f.length;u+=1)r(u);x()}s[8]!=null&&s[8].length>0?a?(a.p(s,o),o[0]&256&&g(a,1)):(a=Ll(s),a.c(),g(a,1),a.m(e,null)):a&&(X(),b(a,1,1,()=>{a=null}),x())},i(s){if(!t){for(let o=0;o<n.length;o+=1)g(f[o]);g(a),t=!0}},o(s){f=f.filter(Boolean);for(let o=0;o<f.length;o+=1)b(f[o]);b(a),t=!1},d(s){s&&h(e),Fe(f,s),a&&a.d()}}}function Pl(i){let e,l,t=i[14][i[28]]+"",n,f,r,a,s,o=i[3][i[28]],u=[];for(let c=0;c<o.length;c+=1)u[c]=Rl(Bl(i,o,c));const d=c=>b(u[c],1,1,()=>{u[c]=null});return{c(){e=A("div"),l=A("div"),n=Q(t),f=j(),r=A("div");for(let c=0;c<u.length;c+=1)u[c].c();a=j(),this.h()},l(c){e=F(c,"DIV",{class:!0});var m=D(e);l=F(m,"DIV",{class:!0});var _=D(l);n=J(_,t),_.forEach(h),f=U(m),r=F(m,"DIV",{class:!0});var p=D(r);for(let k=0;k<u.length;k+=1)u[k].l(p);p.forEach(h),a=U(m),m.forEach(h),this.h()},h(){T(l,"class","text-xs font-light"),T(r,"class","flex flex-row gap-x-1"),T(e,"class","filter-group items-center rounded bg-slate-50 px-2 py-1 shadow-sm svelte-fyw6pu")},m(c,m){C(c,e,m),w(e,l),w(l,n),w(e,f),w(e,r);for(let _=0;_<u.length;_+=1)u[_]&&u[_].m(r,null);w(e,a),s=!0},p(c,m){if(m[0]&40968){o=c[3][c[28]];let _;for(_=0;_<o.length;_+=1){const p=Bl(c,o,_);u[_]?(u[_].p(p,m),g(u[_],1)):(u[_]=Rl(p),u[_].c(),g(u[_],1),u[_].m(r,null))}for(X(),_=o.length;_<u.length;_+=1)d(_);x()}},i(c){if(!s){for(let m=0;m<o.length;m+=1)g(u[m]);s=!0}},o(c){u=u.filter(Boolean);for(let m=0;m<u.length;m+=1)b(u[m]);s=!1},d(c){c&&h(e),Fe(u,c)}}}function Rl(i){let e,l;function t(){return i[22](i[31])}return e=new Ei({props:{search:i[31]}}),e.$on("click",t),{c(){R(e.$$.fragment)},l(n){O(e.$$.fragment,n)},m(n,f){q(e,n,f),l=!0},p(n,f){i=n;const r={};f[0]&8&&(r.search=i[31]),e.$set(r)},i(n){l||(g(e.$$.fragment,n),l=!0)},o(n){b(e.$$.fragment,n),l=!1},d(n){L(e,n)}}}function ql(i){let e,l,t=i[3][i[28]]&&Pl(i);return{c(){t&&t.c(),e=le()},l(n){t&&t.l(n),e=le()},m(n,f){t&&t.m(n,f),C(n,e,f),l=!0},p(n,f){n[3][n[28]]?t?(t.p(n,f),f[0]&8&&g(t,1)):(t=Pl(n),t.c(),g(t,1),t.m(e.parentNode,e)):t&&(X(),b(t,1,1,()=>{t=null}),x())},i(n){l||(g(t),l=!0)},o(n){b(t),l=!1},d(n){t&&t.d(n),n&&h(e)}}}function Ll(i){let e,l,t,n,f,r,a=i[8],s=[];for(let u=0;u<a.length;u+=1)s[u]=Ol(Al(i,a,u));const o=u=>b(s[u],1,1,()=>{s[u]=null});return{c(){e=A("div"),l=A("div"),t=Q("Filters"),n=j(),f=A("div");for(let u=0;u<s.length;u+=1)s[u].c();this.h()},l(u){e=F(u,"DIV",{class:!0});var d=D(e);l=F(d,"DIV",{class:!0});var c=D(l);t=J(c,"Filters"),c.forEach(h),n=U(d),f=F(d,"DIV",{class:!0});var m=D(f);for(let _=0;_<s.length;_+=1)s[_].l(m);m.forEach(h),d.forEach(h),this.h()},h(){T(l,"class","text-xs font-light"),T(f,"class","flex flex-row gap-x-1"),T(e,"class","filter-group rounded bg-slate-50 px-2 py-1 shadow-sm svelte-fyw6pu")},m(u,d){C(u,e,d),w(e,l),w(l,t),w(e,n),w(e,f);for(let c=0;c<s.length;c+=1)s[c]&&s[c].m(f,null);r=!0},p(u,d){if(d[0]&256){a=u[8];let c;for(c=0;c<a.length;c+=1){const m=Al(u,a,c);s[c]?(s[c].p(m,d),g(s[c],1)):(s[c]=Ol(m),s[c].c(),g(s[c],1),s[c].m(f,null))}for(X(),c=a.length;c<s.length;c+=1)o(c);x()}},i(u){if(!r){for(let d=0;d<a.length;d+=1)g(s[d]);r=!0}},o(u){s=s.filter(Boolean);for(let d=0;d<s.length;d+=1)b(s[d]);r=!1},d(u){u&&h(e),Fe(s,u)}}}function Ol(i){let e,l;return e=new Gt({props:{filter:i[25]}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n[0]&256&&(f.filter=t[25]),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Hl(i){let e=De(i[0])+"",l,t,n=De(i[1].dataset_manifest.num_items)+"",f,r;return{c(){l=Q(e),t=Q(" of "),f=Q(n),r=Q(" rows")},l(a){l=J(a,e),t=J(a," of "),f=J(a,n),r=J(a," rows")},m(a,s){C(a,l,s),C(a,t,s),C(a,f,s),C(a,r,s)},p(a,s){s[0]&1&&e!==(e=De(a[0])+"")&&ue(l,e),s[0]&2&&n!==(n=De(a[1].dataset_manifest.num_items)+"")&&ue(f,n)},d(a){a&&h(l),a&&h(t),a&&h(f),a&&h(r)}}}function jl(i){let e,l;return e=new Ye({props:{class:"top-2",kind:"ghost",expressive:!0,icon:kr,disabled:i[4]==null,iconDescription:"Clear sort"}}),e.$on("click",i[18]),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n[0]&16&&(f.disabled=t[4]==null),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Ul(i){let e,l;return e=new Kt({props:{open:!0,modalHeading:"Concept",passiveModal:!0,size:"lg",$$slots:{default:[la]},$$scope:{ctx:i}}}),e.$on("close",i[23]),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n[0]&1024|n[1]&8&&(f.$$scope={dirty:n,ctx:t}),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function xs(i){let e,l;return e=new Xi({props:{concept:i[10].data}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n[0]&1024&&(f.concept=t[10].data),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function ea(i){let e,l=i[10].error.message+"",t;return{c(){e=A("p"),t=Q(l)},l(n){e=F(n,"P",{});var f=D(e);t=J(f,l),f.forEach(h)},m(n,f){C(n,e,f),w(e,t)},p(n,f){f[0]&1024&&l!==(l=n[10].error.message+"")&&ue(t,l)},i:Z,o:Z,d(n){n&&h(e)}}}function ta(i){let e,l;return e=new Le({}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function la(i){let e,l,t,n;const f=[ta,ea,xs],r=[];function a(s,o){var u,d,c;return(u=s[10])!=null&&u.isLoading?0:(d=s[10])!=null&&d.isError?1:(c=s[10])!=null&&c.isSuccess?2:-1}return~(e=a(i))&&(l=r[e]=f[e](i)),{c(){l&&l.c(),t=le()},l(s){l&&l.l(s),t=le()},m(s,o){~e&&r[e].m(s,o),C(s,t,o),n=!0},p(s,o){let u=e;e=a(s),e===u?~e&&r[e].p(s,o):(l&&(X(),b(r[u],1,1,()=>{r[u]=null}),x()),~e?(l=r[e],l?l.p(s,o):(l=r[e]=f[e](s),l.c()),g(l,1),l.m(t.parentNode,t)):l=null)},i(s){n||(g(l),n=!0)},o(s){b(l),n=!1},d(s){~e&&r[e].d(s),s&&h(t)}}}function na(i){var N,z,V;let e,l,t,n,f,r,a,s,o,u,d,c,m,_,p,k,$=i[13].length>0&&Xs(i),S=i[0]&&i[1]&&Hl(i),v=i[6]!=null&&jl(i);u=new jr({props:{size:"sm",titleText:"Sort by",class:"w-36",selectedId:i[5],items:i[7]}}),u.$on("select",i[16]),m=new Ye({props:{class:"top-2",kind:"ghost",expressive:!0,icon:((N=i[4])==null?void 0:N.order)==null?Il:((z=i[4])==null?void 0:z.order)==="ASC"?Vt:Tt,disabled:i[4]==null,tooltipPosition:"bottom",tooltipAlignment:"end",iconDescription:((V=i[4])==null?void 0:V.order)==="ASC"?"Sorted ascending. Toggle to switch to descending.":"Sorted descending. Toggle to switch to ascending."}}),m.$on("click",i[17]);let y=i[2]&&Ul(i);return{c(){e=A("div"),l=A("div"),$&&$.c(),t=j(),n=A("div"),f=A("div"),S&&S.c(),r=j(),a=A("div"),s=A("div"),v&&v.c(),o=j(),R(u.$$.fragment),d=j(),c=A("div"),R(m.$$.fragment),_=j(),y&&y.c(),p=le(),this.h()},l(E){e=F(E,"DIV",{class:!0});var B=D(e);l=F(B,"DIV",{class:!0});var I=D(l);$&&$.l(I),t=U(I),n=F(I,"DIV",{class:!0});var M=D(n);f=F(M,"DIV",{class:!0});var P=D(f);S&&S.l(P),P.forEach(h),r=U(M),a=F(M,"DIV",{class:!0});var K=D(a);s=F(K,"DIV",{class:!0});var ne=D(s);v&&v.l(ne),ne.forEach(h),o=U(K),O(u.$$.fragment,K),d=U(K),c=F(K,"DIV",{class:!0});var W=D(c);O(m.$$.fragment,W),W.forEach(h),K.forEach(h),M.forEach(h),I.forEach(h),B.forEach(h),_=U(E),y&&y.l(E),p=le(),this.h()},h(){T(f,"class","self-end py-1"),T(s,"class","ml-1 w-8"),T(c,"class","ml-1"),T(a,"class","sort-container flex flex-row items-center"),T(n,"class","flex w-full flex-row items-end justify-between"),T(l,"class","flex w-full flex-col"),T(e,"class","mx-5 my-2 flex items-center justify-between")},m(E,B){C(E,e,B),w(e,l),$&&$.m(l,null),w(l,t),w(l,n),w(n,f),S&&S.m(f,null),w(n,r),w(n,a),w(a,s),v&&v.m(s,null),w(a,o),q(u,a,null),w(a,d),w(a,c),q(m,c,null),C(E,_,B),y&&y.m(E,B),C(E,p,B),k=!0},p(E,B){var P,K,ne;E[13].length>0&&$.p(E,B),E[0]&&E[1]?S?S.p(E,B):(S=Hl(E),S.c(),S.m(f,null)):S&&(S.d(1),S=null),E[6]!=null?v?(v.p(E,B),B[0]&64&&g(v,1)):(v=jl(E),v.c(),g(v,1),v.m(s,null)):v&&(X(),b(v,1,1,()=>{v=null}),x());const I={};B[0]&32&&(I.selectedId=E[5]),B[0]&128&&(I.items=E[7]),u.$set(I);const M={};B[0]&16&&(M.icon=((P=E[4])==null?void 0:P.order)==null?Il:((K=E[4])==null?void 0:K.order)==="ASC"?Vt:Tt),B[0]&16&&(M.disabled=E[4]==null),B[0]&16&&(M.iconDescription=((ne=E[4])==null?void 0:ne.order)==="ASC"?"Sorted ascending. Toggle to switch to descending.":"Sorted descending. Toggle to switch to ascending."),m.$set(M),E[2]?y?(y.p(E,B),B[0]&4&&g(y,1)):(y=Ul(E),y.c(),g(y,1),y.m(p.parentNode,p)):y&&(X(),b(y,1,1,()=>{y=null}),x())},i(E){k||(g($),g(v),g(u.$$.fragment,E),g(m.$$.fragment,E),g(y),k=!0)},o(E){b($),b(v),b(u.$$.fragment,E),b(m.$$.fragment,E),b(y),k=!1},d(E){E&&h(e),$&&$.d(),S&&S.d(),v&&v.d(),L(u),L(m),E&&h(_),y&&y.d(E),E&&h(p)}}}function ia(i,e,l){let t,n,f,r,a,s,o,u,d,c,m=Z,_=()=>(m(),m=Be(t,ne=>l(10,c=ne)),t);i.$$.on_destroy.push(()=>m());let{totalNumRows:p}=e,{manifest:k}=e,$=Re();he(i,$,ne=>l(21,d=ne));let S=We();he(i,S,ne=>l(20,u=ne));let v=null;const y=["keyword","semantic","concept"],N={keyword:"Keyword",semantic:"Semantic",concept:"Concepts"};let z={};function V(ne){if(ne.query.type==="concept"){const W=ne.query;l(2,v={namespace:W.concept_namespace,name:W.concept_name})}}let E={};const B=ne=>{if(ne.detail.selectedId==null){$.setSortBy(null);return}$.setSortBy(Lt(ne.detail.selectedId))},I=()=>{r!=null&&$.setSortBy(r.path),$.setSortOrder((r==null?void 0:r.order)==="ASC"?"DESC":"ASC")},M=()=>{$.clearSorts()},P=ne=>V(ne),K=()=>l(2,v=null);return i.$$set=ne=>{"totalNumRows"in ne&&l(0,p=ne.totalNumRows),"manifest"in ne&&l(1,k=ne.manifest)},i.$$.update=()=>{var ne,W,te,G;if(i.$$.dirty[0]&4&&_(l(9,t=v?Ni(v.namespace,v.name):void 0)),i.$$.dirty[0]&2097152&&l(19,n=Yt(d)),i.$$.dirty[0]&2097152&&l(8,f=d.query.filters),i.$$.dirty[0]&524296){l(3,z={});for(const ee of n)ee.query.type&&(ee.query.type in z||l(3,z[ee.query.type]=[],z),z[ee.query.type].push(ee))}if(i.$$.dirty[0]&1048576&&l(4,r=Gi(u)),i.$$.dirty[0]&1048576)for(const ee of((W=(ne=u.selectRowsSchema)==null?void 0:ne.data)==null?void 0:W.search_results)||[])E[Ie(ee.result_path)]=ee;i.$$.dirty[0]&16&&l(5,a=r!=null&&r.path?Ie(r.path):null),i.$$.dirty[0]&2097152&&l(6,s=d.query.sort_by),i.$$.dirty[0]&1048672&&l(7,o=((G=(te=u.selectRowsSchema)==null?void 0:te.data)==null?void 0:G.schema)!=null?[{id:null,text:"None",disabled:s==null&&a!=null},...Ot(u.selectRowsSchema.data.schema).map(ee=>{const we=Ie(ee.path);return{id:we,text:we}})]:[])},[p,k,v,z,r,a,s,o,f,t,c,$,S,y,N,V,B,I,M,n,u,d,P,K]}class ra extends ge{constructor(e){super(),pe(this,e,ia,na,_e,{totalNumRows:0,manifest:1},null,[-1,-1])}}function Yl(i,e,l){const t=i.slice();t[16]=e[l],t[19]=l;const n=t[2].length>1?`[${t[19]}]`:"";return t[17]=n,t}function Wl(i){let e,l,t,n=i[0].join(".")+i[17]+"",f,r,a,s,o,u;return s=new xi({props:{text:De(i[16]),row:i[1],spanPaths:i[3],valuePaths:i[5],datasetViewStore:i[6],datasetStore:i[4]}}),{c(){e=A("div"),l=A("div"),t=A("div"),f=Q(n),r=j(),a=A("div"),R(s.$$.fragment),o=j(),this.h()},l(d){e=F(d,"DIV",{class:!0});var c=D(e);l=F(c,"DIV",{class:!0});var m=D(l);t=F(m,"DIV",{class:!0});var _=D(t);f=J(_,n),_.forEach(h),r=U(m),a=F(m,"DIV",{class:!0});var p=D(a);O(s.$$.fragment,p),p.forEach(h),m.forEach(h),o=U(c),c.forEach(h),this.h()},h(){T(t,"class","sticky top-0 z-10 w-full self-start border-t border-neutral-200 bg-neutral-100 px-2 py-2 pb-2 font-mono font-medium text-neutral-500"),T(a,"class","font-normal"),T(l,"class","flex w-full flex-col"),T(e,"class","flex flex-row")},m(d,c){C(d,e,c),w(e,l),w(l,t),w(t,f),w(l,r),w(l,a),q(s,a,null),w(e,o),u=!0},p(d,c){(!u||c&5)&&n!==(n=d[0].join(".")+d[17]+"")&&ue(f,n);const m={};c&4&&(m.text=De(d[16])),c&2&&(m.row=d[1]),c&8&&(m.spanPaths=d[3]),c&16&&(m.datasetStore=d[4]),s.$set(m)},i(d){u||(g(s.$$.fragment,d),u=!0)},o(d){b(s.$$.fragment,d),u=!1},d(d){d&&h(e),L(s)}}}function sa(i){let e,l,t=i[2],n=[];for(let r=0;r<t.length;r+=1)n[r]=Wl(Yl(i,t,r));const f=r=>b(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;r<n.length;r+=1)n[r].c();e=le()},l(r){for(let a=0;a<n.length;a+=1)n[a].l(r);e=le()},m(r,a){for(let s=0;s<n.length;s+=1)n[s]&&n[s].m(r,a);C(r,e,a),l=!0},p(r,[a]){if(a&127){t=r[2];let s;for(s=0;s<t.length;s+=1){const o=Yl(r,t,s);n[s]?(n[s].p(o,a),g(n[s],1)):(n[s]=Wl(o),n[s].c(),g(n[s],1),n[s].m(e.parentNode,e))}for(X(),s=t.length;s<n.length;s+=1)f(s);x()}},i(r){if(!l){for(let a=0;a<t.length;a+=1)g(n[a]);l=!0}},o(r){n=n.filter(Boolean);for(let a=0;a<n.length;a+=1)b(n[a]);l=!1},d(r){Fe(n,r),r&&h(e)}}}function aa(i,e,l){let t,n,f,r,a,s,o,u,d,{path:c}=e,{row:m}=e,{field:_}=e,p=[];const k=Re(),$=We();he(i,$,v=>l(4,d=v));const S=d.visibleFields||[];return i.$$set=v=>{"path"in v&&l(0,c=v.path),"row"in v&&l(1,m=v.row),"field"in v&&l(8,_=v.field)},i.$$.update=()=>{if(i.$$.dirty&256&&l(14,t=wt(_)),i.$$.dirty&16384&&l(11,n=t.filter(v=>Mi(v.signal))),i.$$.dirty&16384&&l(10,f=t.filter(v=>{var y;return((y=v.signal)==null?void 0:y.signal_name)==="concept_labels"})),i.$$.dirty&16384&&l(9,r=t.filter(v=>{var y;return((y=v.signal)==null?void 0:y.signal_name)==="semantic_similarity"})),i.$$.dirty&16384&&l(12,a=t.filter(v=>{var y;return((y=v.signal)==null?void 0:y.signal_name)==="substring_search"})),i.$$.dirty&16384&&l(13,s=t.filter(v=>v.dtype==="string_span")),i.$$.dirty&8192&&l(3,o=s.map(v=>v.path)),i.$$.dirty&15872)for(const v of s){const N=wt(v).filter(E=>E.dtype!="string_span").filter(E=>S==null?void 0:S.some(B=>Qe(B.path,E.path))).filter(E=>E.dtype!=null&&E.dtype!="embedding"),z=v.path,V=a.find(E=>vt(v.path,E.path));if(V!=null){const E=V.signal;p.push({path:v.path,spanPath:z,type:"keyword",name:E.query,dtype:v.dtype,signal:E})}for(const E of N){const B=n.find(P=>vt(E.path,P.path)),I=f.find(P=>vt(E.path,P.path)),M=r.find(P=>vt(E.path,P.path));if(B!=null){const P=B.signal;p.push({path:E.path,spanPath:z,type:"concept_score",name:`${P.namespace}/${P.concept_name}`,dtype:E.dtype,signal:P})}else if(I!=null){const P=I.signal;p.push({path:E.path,spanPath:z,type:"label",name:`${P.namespace}/${P.concept_name} label`,dtype:E.dtype,signal:P})}else if(M!=null){const P=M.signal;p.push({path:E.path,spanPath:z,type:"semantic_similarity",name:`similarity: ${P.query}`,dtype:E.dtype,signal:P})}else p.push({path:E.path,spanPath:z,type:"metadata",name:E.path[E.path.length-1],dtype:E.dtype})}}i.$$.dirty&3&&l(2,u=zi(m,c).map(v=>Ke.value(v)).filter(Sr))},[c,m,u,o,d,p,k,$,_,r,f,n,a,s,t]}class fa extends ge{constructor(e){super(),pe(this,e,aa,sa,_e,{path:0,row:1,field:8})}}function oa(i){let e,l,t,n,f;const r=[i[3],{type:i[0]?"green":"blue"},{icon:i[2]}];let a={};for(let s=0;s<r.length;s+=1)a=de(a,r[s]);return l=new lt({props:a}),{c(){e=A("div"),R(l.$$.fragment),this.h()},l(s){e=F(s,"DIV",{class:!0});var o=D(e);O(l.$$.fragment,o),o.forEach(h),this.h()},h(){T(e,"class","signal-badge")},m(s,o){C(s,e,o),q(l,e,null),t=!0,n||(f=Me(ze.call(null,e,{text:i[1]})),n=!0)},p(s,[o]){const u=o&13?Ce(r,[o&8&&di(s[3]),o&1&&{type:s[0]?"green":"blue"},o&4&&{icon:s[2]}]):{};l.$set(u)},i(s){t||(g(l.$$.fragment,s),t=!0)},o(s){b(l.$$.fragment,s),t=!1},d(s){s&&h(e),L(l),n=!1,f()}}}function ua(i,e,l){const t=["isPreview"];let n=ke(e,t),{isPreview:f=!1}=e;const r=f?"Signal is in preview mode and has not been computed for the whole dataset.":"This field was generated by a signal.",a=f?Bs:vs;return i.$$set=s=>{e=de(de({},e),Se(s)),l(3,n=ke(e,t)),"isPreview"in s&&l(0,f=s.isPreview)},[f,r,a,n]}class Xt extends ge{constructor(e){super(),pe(this,e,ua,oa,_e,{isPreview:0})}}function Ql(i,e,l){const t=i.slice();return t[0]=e[l],t}function Jl(i){let e,l,t=[],n=new Map,f,r=i[1];const a=s=>Ie(s[0].path);for(let s=0;s<r.length;s+=1){let o=Ql(i,r,s),u=a(o);n.set(u,t[s]=Kl(u,o))}return{c(){e=A("div"),l=A("table");for(let s=0;s<t.length;s+=1)t[s].c();this.h()},l(s){e=F(s,"DIV",{class:!0});var o=D(e);l=F(o,"TABLE",{class:!0});var u=D(l);for(let d=0;d<t.length;d+=1)t[d].l(u);u.forEach(h),o.forEach(h),this.h()},h(){T(l,"class","table w-full table-fixed border-collapse px-2 pt-1"),T(e,"class","border-t border-neutral-200 px-2 py-4")},m(s,o){C(s,e,o),w(e,l);for(let u=0;u<t.length;u+=1)t[u]&&t[u].m(l,null);f=!0},p(s,o){o&2&&(r=s[1],X(),t=gt(t,o,a,1,s,r,n,l,pt,Kl,null,Ql),x())},i(s){if(!f){for(let o=0;o<r.length;o+=1)g(t[o]);f=!0}},o(s){for(let o=0;o<t.length;o+=1)b(t[o]);f=!1},d(s){s&&h(e);for(let o=0;o<t.length;o+=1)t[o].d()}}}function ca(i){let e,l;return e=new Xt({props:{isPreview:i[0].isPreviewSignal}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n&2&&(f.isPreview=t[0].isPreviewSignal),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function da(i){var t;let e,l;return e=new Ut({props:{hideEmbeddingName:!0,embedding:(t=i[0].field.signal)==null?void 0:t.signal_name}}),{c(){R(e.$$.fragment)},l(n){O(e.$$.fragment,n)},m(n,f){q(e,n,f),l=!0},p(n,f){var a;const r={};f&2&&(r.embedding=(a=n[0].field.signal)==null?void 0:a.signal_name),e.$set(r)},i(n){l||(g(e.$$.fragment,n),l=!0)},o(n){b(e.$$.fragment,n),l=!1},d(n){L(e,n)}}}function Kl(i,e){let l,t,n,f=e[0].fieldName+"",r,a,s,o,u,d,c,m,_,p=e[0].formattedValue+"",k,$,S,v;const y=[da,ca],N=[];function z(V,E){return V[0].isEmbeddingSignal?0:V[0].isSignal?1:-1}return~(u=z(e))&&(d=N[u]=y[u](e)),{key:i,first:null,c(){l=A("tr"),t=A("td"),n=A("span"),r=Q(f),s=j(),o=A("td"),d&&d.c(),c=j(),m=A("td"),_=A("div"),k=Q(p),S=j(),this.h()},l(V){l=F(V,"TR",{class:!0});var E=D(l);t=F(E,"TD",{class:!0});var B=D(t);n=F(B,"SPAN",{title:!0});var I=D(n);r=J(I,f),I.forEach(h),B.forEach(h),s=U(E),o=F(E,"TD",{class:!0});var M=D(o);d&&d.l(M),M.forEach(h),c=U(E),m=F(E,"TD",{class:!0});var P=D(m);_=F(P,"DIV",{title:!0,class:!0});var K=D(_);k=J(K,p),K.forEach(h),P.forEach(h),S=U(E),E.forEach(h),this.h()},h(){T(n,"title",a=e[0].fieldName),Ue(n,"padding-left",`${e[0].indentLevel*12}px`),T(t,"class","truncate p-2 font-mono text-xs font-medium text-neutral-500"),T(o,"class","w-10"),T(_,"title",$=`${e[0].value}`),T(_,"class","truncate pr-2 text-xs"),se(_,"italic",e[0].formattedValue===null),T(m,"class","p-2"),T(l,"class","border-gray-300"),this.first=l},m(V,E){C(V,l,E),w(l,t),w(t,n),w(n,r),w(l,s),w(l,o),~u&&N[u].m(o,null),w(l,c),w(l,m),w(m,_),w(_,k),w(l,S),v=!0},p(V,E){e=V,(!v||E&2)&&f!==(f=e[0].fieldName+"")&&ue(r,f),(!v||E&2&&a!==(a=e[0].fieldName))&&T(n,"title",a),E&2&&Ue(n,"padding-left",`${e[0].indentLevel*12}px`);let B=u;u=z(e),u===B?~u&&N[u].p(e,E):(d&&(X(),b(N[B],1,1,()=>{N[B]=null}),x()),~u?(d=N[u],d?d.p(e,E):(d=N[u]=y[u](e),d.c()),g(d,1),d.m(o,null)):d=null),(!v||E&2)&&p!==(p=e[0].formattedValue+"")&&ue(k,p),(!v||E&2&&$!==($=`${e[0].value}`))&&T(_,"title",$),(!v||E&2)&&se(_,"italic",e[0].formattedValue===null)},i(V){v||(g(d),v=!0)},o(V){b(d),v=!1},d(V){V&&h(l),~u&&N[u].d()}}}function ma(i){let e,l,t=i[1].length>0&&Jl(i);return{c(){t&&t.c(),e=le()},l(n){t&&t.l(n),e=le()},m(n,f){t&&t.m(n,f),C(n,e,f),l=!0},p(n,[f]){n[1].length>0?t?(t.p(n,f),f&2&&g(t,1)):(t=Jl(n),t.c(),g(t,1),t.m(e.parentNode,e)):t&&(X(),b(t,1,1,()=>{t=null}),x())},i(n){l||(g(t),l=!0)},o(n){b(t),l=!1},d(n){t&&t.d(n),n&&h(e)}}}function ha(i,e,l){let t,n,f,{row:r}=e,{visibleFields:a}=e;const s=We();he(i,s,d=>l(5,n=d));const o=Zt();he(i,o,d=>l(6,f=d));function u(d){const c=Ai(d).filter(_=>er(_,a)),m=c.filter(_=>{var p;return((p=Ke.field(_))==null?void 0:p.dtype)==="string_span"}).map(_=>Ke.path(_));return c.filter(_=>!m.some(p=>vt(Ke.path(_),p))).map(_=>{var N,z;const p=Ke.field(_),k=Ke.path(_);let $=Ke.value(_);if(p.dtype==="string_span")return null;const S=((N=f.data)==null?void 0:N.some(V=>{var E;return V.name===((E=p.signal)==null?void 0:E.signal_name)}))||!1,v=dt(p);let y;return S||v&&p.dtype==null||p.dtype==="embedding"||p.repeated_field!=null?y="":$==null?y=null:y=De($),{indentLevel:k.length-1,fieldName:k[k.length-1],field:p,path:k,isSignal:v,isPreviewSignal:Ct(((z=n.selectRowsSchema)==null?void 0:z.data)||null,k),isEmbeddingSignal:S,value:$,formattedValue:y}}).filter(_=>_!=null)}return i.$$set=d=>{"row"in d&&l(0,r=d.row),"visibleFields"in d&&l(4,a=d.visibleFields)},i.$$.update=()=>{i.$$.dirty&1&&l(1,t=u(r))},[r,t,s,o,a]}class _a extends ge{constructor(e){super(),pe(this,e,ha,ma,_e,{row:0,visibleFields:4})}}function Zl(i,e,l){const t=i.slice();return t[5]=e[l],t[7]=l,t}function Gl(i){let e,l=[],t=new Map,n,f,r=i[1];const a=s=>Ie(s[5].path);for(let s=0;s<r.length;s+=1){let o=Zl(i,r,s),u=a(o);t.set(u,l[s]=Xl(u,o))}return{c(){e=A("div");for(let s=0;s<l.length;s+=1)l[s].c();this.h()},l(s){e=F(s,"DIV",{class:!0});var o=D(e);for(let u=0;u<l.length;u+=1)l[u].l(o);o.forEach(h),this.h()},h(){T(e,"class","w-2/3 overflow-hidden"),kt(()=>i[4].call(e))},m(s,o){C(s,e,o);for(let u=0;u<l.length;u+=1)l[u]&&l[u].m(e,null);n=Ti(e,i[4].bind(e)),f=!0},p(s,o){o&3&&(r=s[1],X(),l=gt(l,o,a,1,s,r,t,e,pt,Xl,null,Zl),x())},i(s){if(!f){for(let o=0;o<r.length;o+=1)g(l[o]);f=!0}},o(s){for(let o=0;o<l.length;o+=1)b(l[o]);f=!1},d(s){s&&h(e);for(let o=0;o<l.length;o+=1)l[o].d();n()}}}function Xl(i,e){let l,t,n,f;return t=new fa({props:{row:e[0],path:e[5].path,field:e[5]}}),{key:i,first:null,c(){l=A("div"),R(t.$$.fragment),n=j(),this.h()},l(r){l=F(r,"DIV",{class:!0});var a=D(l);O(t.$$.fragment,a),n=U(a),a.forEach(h),this.h()},h(){T(l,"class","border-gray-100"),se(l,"border-b",e[7]<e[1].length-1),this.first=l},m(r,a){C(r,l,a),q(t,l,null),w(l,n),f=!0},p(r,a){e=r;const s={};a&1&&(s.row=e[0]),a&2&&(s.path=e[5].path),a&2&&(s.field=e[5]),t.$set(s),(!f||a&2)&&se(l,"border-b",e[7]<e[1].length-1)},i(r){f||(g(t.$$.fragment,r),f=!0)},o(r){b(t.$$.fragment,r),f=!1},d(r){r&&h(l),L(t)}}}function ga(i){let e,l,t,n,f,r,a,s,o,u=i[1].length>0&&Gl(i);return a=new _a({props:{row:i[0],visibleFields:i[2]}}),{c(){e=A("div"),l=A("div"),u&&u.c(),t=j(),n=A("div"),f=A("div"),r=A("div"),R(a.$$.fragment),this.h()},l(d){e=F(d,"DIV",{class:!0});var c=D(e);l=F(c,"DIV",{class:!0});var m=D(l);u&&u.l(m),t=U(m),n=F(m,"DIV",{class:!0});var _=D(n);f=F(_,"DIV",{class:!0});var p=D(f);r=F(p,"DIV",{style:!0,class:!0});var k=D(r);O(a.$$.fragment,k),k.forEach(h),p.forEach(h),_.forEach(h),m.forEach(h),c.forEach(h),this.h()},h(){T(r,"style",s=`max-height: ${Math.max(xl,i[3])}px`),T(r,"class","overflow-y-auto"),T(f,"class","sticky top-0 self-start"),T(n,"class","flex h-full w-1/3 bg-neutral-100"),T(l,"class","flex h-full w-full flex-row"),T(e,"class","mx-5 mb-10 rounded border-x border-b border-neutral-200 shadow-md")},m(d,c){C(d,e,c),w(e,l),u&&u.m(l,null),w(l,t),w(l,n),w(n,f),w(f,r),q(a,r,null),o=!0},p(d,[c]){d[1].length>0?u?(u.p(d,c),c&2&&g(u,1)):(u=Gl(d),u.c(),g(u,1),u.m(l,t)):u&&(X(),b(u,1,1,()=>{u=null}),x());const m={};c&1&&(m.row=d[0]),c&4&&(m.visibleFields=d[2]),a.$set(m),(!o||c&8&&s!==(s=`max-height: ${Math.max(xl,d[3])}px`))&&T(r,"style",s)},i(d){o||(g(u),g(a.$$.fragment,d),o=!0)},o(d){b(u),b(a.$$.fragment,d),o=!1},d(d){d&&h(e),u&&u.d(),L(a)}}}const xl=320;function pa(i,e,l){let{row:t}=e,{mediaFields:n}=e,{visibleFields:f}=e,r=0;function a(){r=this.clientHeight,l(3,r)}return i.$$set=s=>{"row"in s&&l(0,t=s.row),"mediaFields"in s&&l(1,n=s.mediaFields),"visibleFields"in s&&l(2,f=s.visibleFields)},[t,n,f,r,a]}class ba extends ge{constructor(e){super(),pe(this,e,pa,ga,_e,{row:0,mediaFields:1,visibleFields:2})}}function en(i,e,l){const t=i.slice();return t[21]=e[l],t}function va(i){let e,l;return{c(){e=A("div"),l=Q("No results."),this.h()},l(t){e=F(t,"DIV",{class:!0});var n=D(e);l=J(n,"No results."),n.forEach(h),this.h()},h(){T(e,"class","mx-4 mt-8 w-full text-gray-600")},m(t,n){C(t,e,n),w(e,l)},p:Z,i:Z,o:Z,d(t){t&&h(e)}}}function wa(i){let e,l;return{c(){e=A("div"),l=Q("Select fields to display"),this.h()},l(t){e=F(t,"DIV",{class:!0});var n=D(e);l=J(n,"Select fields to display"),n.forEach(h),this.h()},h(){T(e,"class","mt-12 w-full text-center text-gray-600")},m(t,n){C(t,e,n),w(e,l)},p:Z,i:Z,o:Z,d(t){t&&h(e)}}}function ka(i){let e,l;return e=new Le({props:{paragraph:!0,lines:3}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Sa(i){var t,n;let e,l;return e=new Qt({props:{lowContrast:!0,title:"Could not fetch schema:",subtitle:((t=i[2].error.body)==null?void 0:t.detail)||((n=i[2])==null?void 0:n.error.message)}}),{c(){R(e.$$.fragment)},l(f){O(e.$$.fragment,f)},m(f,r){q(e,f,r),l=!0},p(f,r){var s,o;const a={};r&4&&(a.subtitle=((s=f[2].error.body)==null?void 0:s.detail)||((o=f[2])==null?void 0:o.error.message)),e.$set(a)},i(f){l||(g(e.$$.fragment,f),l=!0)},o(f){b(e.$$.fragment,f),l=!1},d(f){L(e,f)}}}function Ea(i){var t;let e,l;return e=new Qt({props:{lowContrast:!0,title:"Could not fetch rows:",subtitle:((t=i[3].error.body)==null?void 0:t.detail)||i[3].error.message}}),{c(){R(e.$$.fragment)},l(n){O(e.$$.fragment,n)},m(n,f){q(e,n,f),l=!0},p(n,f){var a;const r={};f&8&&(r.subtitle=((a=n[3].error.body)==null?void 0:a.detail)||n[3].error.message),e.$set(r)},i(n){l||(g(e.$$.fragment,n),l=!0)},o(n){b(e.$$.fragment,n),l=!1},d(n){L(e,n)}}}function tn(i){let e,l=[],t=new Map,n,f,r=i[6];const a=o=>Ke.value(o[21][Ht]);for(let o=0;o<r.length;o+=1){let u=en(i,r,o),d=a(u);t.set(d,l[o]=ln(d,u))}let s=i[6].length>0&&nn(i);return{c(){e=A("div");for(let o=0;o<l.length;o+=1)l[o].c();n=j(),s&&s.c(),this.h()},l(o){e=F(o,"DIV",{class:!0});var u=D(e);for(let d=0;d<l.length;d+=1)l[d].l(u);n=U(u),s&&s.l(u),u.forEach(h),this.h()},h(){T(e,"class","flex h-full w-full flex-col overflow-y-scroll")},m(o,u){C(o,e,u);for(let d=0;d<l.length;d+=1)l[d]&&l[d].m(e,null);w(e,n),s&&s.m(e,null),i[19](e),f=!0},p(o,u){u&98&&(r=o[6],X(),l=gt(l,u,a,1,o,r,t,e,pt,ln,n,en),x()),o[6].length>0?s?(s.p(o,u),u&64&&g(s,1)):(s=nn(o),s.c(),g(s,1),s.m(e,null)):s&&(X(),b(s,1,1,()=>{s=null}),x())},i(o){if(!f){for(let u=0;u<r.length;u+=1)g(l[u]);g(s),f=!0}},o(o){for(let u=0;u<l.length;u+=1)b(l[u]);b(s),f=!1},d(o){o&&h(e);for(let u=0;u<l.length;u+=1)l[u].d();s&&s.d(),i[19](null)}}}function ln(i,e){let l,t,n;return t=new ba({props:{visibleFields:e[1],row:e[21],mediaFields:e[5]}}),{key:i,first:null,c(){l=le(),R(t.$$.fragment),this.h()},l(f){l=le(),O(t.$$.fragment,f),this.h()},h(){this.first=l},m(f,r){C(f,l,r),q(t,f,r),n=!0},p(f,r){e=f;const a={};r&2&&(a.visibleFields=e[1]),r&64&&(a.row=e[21]),r&32&&(a.mediaFields=e[5]),t.$set(a)},i(f){n||(g(t.$$.fragment,f),n=!0)},o(f){b(t.$$.fragment,f),n=!1},d(f){f&&h(l),L(t,f)}}}function nn(i){let e,l;return e=new qs({props:{threshold:100}}),e.$on("loadMore",i[18]),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function ya(i){let e,l,t,n,f,r,a;e=new ra({props:{totalNumRows:i[7],manifest:i[10].data}});const s=[Ea,Sa,ka,wa,va],o=[];function u(c,m){var _,p,k,$;return c[3].isError?0:(_=c[2])!=null&&_.isError?1:(p=c[3])!=null&&p.isLoading||c[4].isLoading||(k=c[2])!=null&&k.isLoading?2:c[1].length===0?3:($=c[3])!=null&&$.isSuccess&&c[6]&&c[6].length===0?4:-1}~(t=u(i))&&(n=o[t]=s[t](i));let d=i[6]&&i[1].length>0&&i[4].isSuccess&&i[5]!=null&&tn(i);return{c(){R(e.$$.fragment),l=j(),n&&n.c(),f=j(),d&&d.c(),r=le()},l(c){O(e.$$.fragment,c),l=U(c),n&&n.l(c),f=U(c),d&&d.l(c),r=le()},m(c,m){q(e,c,m),C(c,l,m),~t&&o[t].m(c,m),C(c,f,m),d&&d.m(c,m),C(c,r,m),a=!0},p(c,[m]){const _={};m&128&&(_.totalNumRows=c[7]),m&1024&&(_.manifest=c[10].data),e.$set(_);let p=t;t=u(c),t===p?~t&&o[t].p(c,m):(n&&(X(),b(o[p],1,1,()=>{o[p]=null}),x()),~t?(n=o[t],n?n.p(c,m):(n=o[t]=s[t](c),n.c()),g(n,1),n.m(f.parentNode,f)):n=null),c[6]&&c[1].length>0&&c[4].isSuccess&&c[5]!=null?d?(d.p(c,m),m&114&&g(d,1)):(d=tn(c),d.c(),g(d,1),d.m(r.parentNode,r)):d&&(X(),b(d,1,1,()=>{d=null}),x())},i(c){a||(g(e.$$.fragment,c),g(n),g(d),a=!0)},o(c){b(e.$$.fragment,c),b(n),b(d),a=!1},d(c){L(e,c),c&&h(l),~t&&o[t].d(c),c&&h(f),d&&d.d(c),c&&h(r)}}}function $a(i,e,l){let t,n,f,r,a,s,o,u,d,c,m,_=Z,p=()=>(_(),_=Be(r,P=>l(3,m=P)),r),k,$,S=Z,v=()=>(S(),S=Be(t,P=>l(4,$=P)),t),y;i.$$.on_destroy.push(()=>_()),i.$$.on_destroy.push(()=>S());let N=Re();he(i,N,P=>l(17,k=P));let z=We();he(i,z,P=>l(16,c=P));const V=Fi(k.namespace,k.datasetName);he(i,V,P=>l(10,y=P));let E=null;const B=it(E),I=()=>m==null?void 0:m.fetchNextPage();function M(P){Pe[P?"unshift":"push"](()=>{E=P,l(0,E)})}return i.$$.update=()=>{var P,K,ne,W;i.$$.dirty&131072&&v(l(9,t=mi(k.namespace,k.datasetName))),i.$$.dirty&131088&&l(15,n=$.isSuccess?tr(k):void 0),i.$$.dirty&65536&&l(2,f=c.selectRowsSchema),i.$$.dirty&163844&&p(l(8,r=Bi(k.namespace,k.datasetName,n||{},f!=null&&f.isSuccess?f.data.schema:void 0))),i.$$.dirty&8&&l(7,a=(P=m.data)==null?void 0:P.pages[0].total_num_rows),i.$$.dirty&8&&l(6,s=(K=m.data)==null?void 0:K.pages.flatMap(te=>te.rows)),i.$$.dirty&65536&&l(1,o=(c.visibleFields||[]).sort((te,G)=>Ie(te.path)>Ie(G.path)?1:-1)),i.$$.dirty&6&&l(14,u=((ne=f==null?void 0:f.data)==null?void 0:ne.schema)!=null?lr((W=f==null?void 0:f.data)==null?void 0:W.schema,o):null),i.$$.dirty&81920&&l(5,d=nr(u,c.settings)),i.$$.dirty&1&&B.set(E)},ui(ir,B),[E,o,f,m,$,d,s,a,r,t,y,N,z,V,u,n,c,k,I,M]}class Da extends ge{constructor(e){super(),pe(this,e,$a,ya,_e,{})}}function rn(i,e,l){const t=i.slice();return t[43]=e[l],t}function sn(i,e,l){const t=i.slice();return t[46]=e[l],t}function Ia(i){let e,l=i[49].text+"",t;return{c(){e=A("div"),t=Q(l)},l(n){e=F(n,"DIV",{});var f=D(e);t=J(f,l),f.forEach(h)},m(n,f){C(n,e,f),w(e,t)},p(n,f){f[1]&262144&&l!==(l=n[49].text+"")&&ue(t,l)},i:Z,o:Z,d(n){n&&h(e)}}}function Va(i){let e,l,t,n,f,r,a;return l=new lt({props:{$$slots:{default:[Ca]},$$scope:{ctx:i}}}),{c(){e=A("div"),R(l.$$.fragment),t=j(),n=A("div"),f=Q(`Keyword search:
`),r=Q(i[0]),this.h()},l(s){e=F(s,"DIV",{class:!0});var o=D(e);O(l.$$.fragment,o),t=U(o),n=F(o,"DIV",{class:!0});var u=D(n);f=J(u,`Keyword search:
`),r=J(u,i[0]),u.forEach(h),o.forEach(h),this.h()},h(){T(n,"class","ml-2"),T(e,"class","new-keyword flex flex-row items-center justify-items-center")},m(s,o){C(s,e,o),q(l,e,null),w(e,t),w(e,n),w(n,f),w(n,r),a=!0},p(s,o){const u={};o[1]&524288&&(u.$$scope={dirty:o,ctx:s}),l.$set(u),(!a||o[0]&1)&&ue(r,s[0])},i(s){a||(g(l.$$.fragment,s),a=!0)},o(s){b(l.$$.fragment,s),a=!1},d(s){s&&h(e),L(l)}}}function Ta(i){let e,l,t,n,f,r=i[0]!=""?":":"",a,s,o,u;return l=new lt({props:{$$slots:{default:[Na]},$$scope:{ctx:i}}}),{c(){e=A("div"),R(l.$$.fragment),t=j(),n=A("div"),f=Q("New concept"),a=Q(r),s=j(),o=Q(i[0]),this.h()},l(d){e=F(d,"DIV",{class:!0});var c=D(e);O(l.$$.fragment,c),t=U(c),n=F(c,"DIV",{class:!0});var m=D(n);f=J(m,"New concept"),a=J(m,r),s=U(m),o=J(m,i[0]),m.forEach(h),c.forEach(h),this.h()},h(){T(n,"class","ml-2"),T(e,"class","new-concept flex flex-row items-center justify-items-center")},m(d,c){C(d,e,c),q(l,e,null),w(e,t),w(e,n),w(n,f),w(n,a),w(n,s),w(n,o),u=!0},p(d,c){const m={};c[1]&524288&&(m.$$scope={dirty:c,ctx:d}),l.$set(m),(!u||c[0]&1)&&r!==(r=d[0]!=""?":":"")&&ue(a,r),(!u||c[0]&1)&&ue(o,d[0])},i(d){u||(g(l.$$.fragment,d),u=!0)},o(d){b(l.$$.fragment,d),u=!1},d(d){d&&h(e),L(l)}}}function Ca(i){let e,l;return e=new Is({}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Na(i){let e,l;return e=new is({}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Ma(i){let e,l,t,n;const f=[Ta,Va,Ia],r=[];function a(s,o){return s[49].id==="new-concept"?0:s[49].id==="keyword-search"?1:2}return e=a(i),l=r[e]=f[e](i),{c(){l.c(),t=le()},l(s){l.l(s),t=le()},m(s,o){r[e].m(s,o),C(s,t,o),n=!0},p(s,o){let u=e;e=a(s),e===u?r[e].p(s,o):(X(),b(r[u],1,1,()=>{r[u]=null}),x(),l=r[e],l?l.p(s,o):(l=r[e]=f[e](s),l.c()),g(l,1),l.m(t.parentNode,t))},i(s){n||(g(l),n=!0)},o(s){b(l),n=!1},d(s){r[e].d(s),s&&h(t)}}}function an(i){let e,l;return e=new Nt({props:{value:Ie(i[46]),text:Ie(i[46])}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n[0]&512&&(f.value=Ie(t[46])),n[0]&512&&(f.text=Ie(t[46])),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function za(i){let e,l,t=i[9],n=[];for(let r=0;r<t.length;r+=1)n[r]=an(sn(i,t,r));const f=r=>b(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;r<n.length;r+=1)n[r].c();e=le()},l(r){for(let a=0;a<n.length;a+=1)n[a].l(r);e=le()},m(r,a){for(let s=0;s<n.length;s+=1)n[s]&&n[s].m(r,a);C(r,e,a),l=!0},p(r,a){if(a[0]&512){t=r[9];let s;for(s=0;s<t.length;s+=1){const o=sn(r,t,s);n[s]?(n[s].p(o,a),g(n[s],1)):(n[s]=an(o),n[s].c(),g(n[s],1),n[s].m(e.parentNode,e))}for(X(),s=t.length;s<n.length;s+=1)f(s);x()}},i(r){if(!l){for(let a=0;a<t.length;a+=1)g(n[a]);l=!0}},o(r){n=n.filter(Boolean);for(let a=0;a<n.length;a+=1)b(n[a]);l=!1},d(r){Fe(n,r),r&&h(e)}}}function fn(i){let e,l;return e=new Jt({props:{size:"xl",class:"field-select w-28",selected:i[1]?Ie(i[1]):"",disabled:i[9].length===0,warn:i[9].length===0,$$slots:{default:[za]},$$scope:{ctx:i}}}),e.$on("change",i[21]),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n[0]&2&&(f.selected=t[1]?Ie(t[1]):""),n[0]&512&&(f.disabled=t[9].length===0),n[0]&512&&(f.warn=t[9].length===0),n[0]&512|n[1]&524288&&(f.$$scope={dirty:n,ctx:t}),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function on(i){let e,l;return e=new Nt({props:{value:i[43].name,text:i[43].name}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n[0]&16&&(f.value=t[43].name),n[0]&16&&(f.text=t[43].name),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Aa(i){let e,l,t=i[4].data||[],n=[];for(let r=0;r<t.length;r+=1)n[r]=on(rn(i,t,r));const f=r=>b(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;r<n.length;r+=1)n[r].c();e=le()},l(r){for(let a=0;a<n.length;a+=1)n[a].l(r);e=le()},m(r,a){for(let s=0;s<n.length;s+=1)n[s]&&n[s].m(r,a);C(r,e,a),l=!0},p(r,a){if(a[0]&16){t=r[4].data||[];let s;for(s=0;s<t.length;s+=1){const o=rn(r,t,s);n[s]?(n[s].p(o,a),g(n[s],1)):(n[s]=on(o),n[s].c(),g(n[s],1),n[s].m(e.parentNode,e))}for(X(),s=t.length;s<n.length;s+=1)f(s);x()}},i(r){if(!l){for(let a=0;a<t.length;a+=1)g(n[a]);l=!0}},o(r){n=n.filter(Boolean);for(let a=0;a<n.length;a+=1)b(n[a]);l=!1},d(r){Fe(n,r),r&&h(e)}}}function Fa(i){let e,l,t,n,f,r,a,s,o,u,d,c,m,_=i[9],p,k,$,S,v,y,N;t=new Ye({props:{disabled:i[3]||i[8],iconDescription:"Compute embedding index. This may be expensive.",icon:i[3]?tl:i[8]?ll:Rt}}),t.$on("click",i[35]);function z(B){i[37](B)}let V={size:"xl",items:i[5],shouldFilterItem:Ba,placeholder:i[7],$$slots:{default:[Ma,({item:B})=>({49:B}),({item:B})=>[0,B?262144:0]]},$$scope:{ctx:i}};i[0]!==void 0&&(V.value=i[0]),u=new Cr({props:V}),i[36](u),Pe.push(()=>et(u,"value",z)),u.$on("select",i[20]);let E=fn(i);return S=new Jt({props:{size:"xl",selected:i[2]||"",name:i[2]||"",$$slots:{default:[Aa]},$$scope:{ctx:i}}}),S.$on("change",i[18]),{c(){e=A("div"),l=A("div"),R(t.$$.fragment),n=j(),f=A("div"),r=A("div"),a=A("div"),s=A("div"),o=A("div"),R(u.$$.fragment),c=j(),m=A("div"),E.c(),p=j(),k=A("div"),$=A("div"),R(S.$$.fragment),this.h()},l(B){e=F(B,"DIV",{class:!0});var I=D(e);l=F(I,"DIV",{class:!0});var M=D(l);O(t.$$.fragment,M),M.forEach(h),n=U(I),f=F(I,"DIV",{class:!0});var P=D(f);r=F(P,"DIV",{class:!0});var K=D(r);a=F(K,"DIV",{class:!0});var ne=D(a);s=F(ne,"DIV",{class:!0});var W=D(s);o=F(W,"DIV",{class:!0});var te=D(o);O(u.$$.fragment,te),te.forEach(h),W.forEach(h),ne.forEach(h),K.forEach(h),P.forEach(h),c=U(I),m=F(I,"DIV",{class:!0});var G=D(m);E.l(G),G.forEach(h),p=U(I),k=F(I,"DIV",{class:!0});var ee=D(k);$=F(ee,"DIV",{class:!0});var we=D($);O(S.$$.fragment,we),we.forEach(h),ee.forEach(h),I.forEach(h),this.h()},h(){T(l,"class","compute-embedding mr-1"),se(l,"compute-embedding-indexing",i[8]),T(o,"class","flex-grow"),T(s,"class","flex w-full flex-row items-start justify-items-start"),T(a,"class","flex flex-row"),T(r,"class","w-full"),T(f,"class","search-container flex w-full flex-grow flex-row"),T(m,"class","mx-1"),T($,"class","w-28"),T(k,"class","embedding-select mr-8 flex flex-row"),T(e,"class","border-1 flex w-full flex-row items-center px-4")},m(B,I){C(B,e,I),w(e,l),q(t,l,null),w(e,n),w(e,f),w(f,r),w(r,a),w(a,s),w(s,o),q(u,o,null),w(e,c),w(e,m),E.m(m,null),w(e,p),w(e,k),w(k,$),q(S,$,null),v=!0,y||(N=[Me(ze.call(null,m,{text:"Select the field to search over."})),Me(ze.call(null,$,{text:"Select the embedding to use."}))],y=!0)},p(B,I){const M={};I[0]&264&&(M.disabled=B[3]||B[8]),I[0]&264&&(M.icon=B[3]?tl:B[8]?ll:Rt),t.$set(M),(!v||I[0]&256)&&se(l,"compute-embedding-indexing",B[8]);const P={};I[0]&32&&(P.items=B[5]),I[0]&128&&(P.placeholder=B[7]),I[0]&1|I[1]&786432&&(P.$$scope={dirty:I,ctx:B}),!d&&I[0]&1&&(d=!0,P.value=B[0],tt(()=>d=!1)),u.$set(P),I[0]&512&&_e(_,_=B[9])?(X(),b(E,1,1,Z),x(),E=fn(B),E.c(),g(E,1),E.m(m,null)):E.p(B,I);const K={};I[0]&4&&(K.selected=B[2]||""),I[0]&4&&(K.name=B[2]||""),I[0]&16|I[1]&524288&&(K.$$scope={dirty:I,ctx:B}),S.$set(K)},i(B){v||(g(t.$$.fragment,B),g(u.$$.fragment,B),g(E),g(S.$$.fragment,B),v=!0)},o(B){b(t.$$.fragment,B),b(u.$$.fragment,B),b(E),b(S.$$.fragment,B),v=!1},d(B){B&&h(e),L(t),i[36](null),L(u),E.d(B),L(S),y=!1,Je(N)}}}const Ba=(i,e)=>i.text.toLowerCase().includes(e.toLowerCase())||i.id==="new-concept";function Pa(i,e,l){let t,n,f,r,a,s,o,u,d,c,m,_,p,k,$,S,v,y,N,z,V,E=Z,B=()=>(E(),E=Be(t,re=>l(33,V=re)),t),I;i.$$.on_destroy.push(()=>E());const M=Re();he(i,M,re=>l(32,z=re));const P=We();he(i,P,re=>l(31,y=re));const K=Si();he(i,K,re=>l(34,I=re));const ne=hi();he(i,ne,re=>l(40,$=re));const W=Zt();he(i,W,re=>l(4,N=re));const te=(re,Te)=>`${Ie(re||"")}_${Te}`;let G={};const ee=Pi();he(i,ee,re=>l(30,v=re));const we=Mt();he(i,we,re=>l(29,S=re));let fe=[],ae="",ye;const ce=re=>{l(2,o=re.target.value),M.setSearchEmbedding(re.target.value)},Ee=()=>{o!=null&&(l(22,G[te(r,o)]=!0,G),$.mutate([n,f,{leaf_path:Lt(r||[]),signal:{signal_name:o}}]))};let oe;const Y=(re,Te)=>{r==null||o==null||(M.addSearch({path:[Ie(r)],query:{type:"concept",concept_namespace:re,concept_name:Te,embedding:o}}),oe.clear())},H=re=>{if(!(r==null||o==null)){if(re.detail.selectedId==="new-concept"){ae===ye.id&&l(0,ae="");const Te=ae.split("/",2);let Ne="",He="";Te.length===2?[Ne,He]=Te:[He]=Te,Xe({command:xe.CreateConcept,namespace:Ne,conceptName:He,onCreate:nt=>Y(nt.detail.namespace,nt.detail.name)}),oe.clear();return}else if(re.detail.selectedId==="keyword-search"){if(ae=="")return;M.addSearch({path:[Ie(r)],query:{type:"keyword",search:ae}});return}Y(re.detail.selectedId.namespace,re.detail.selectedId.name)}},ie=re=>{M.setSearchPath(re.target.value)},me=()=>{Ee()};function Ae(re){Pe[re?"unshift":"push"](()=>{oe=re,l(6,oe)})}function Oe(re){ae=re,l(0,ae)}return i.$$.update=()=>{var re,Te;i.$$.dirty[1]&2&&B(l(10,t=jt(z.namespace,z.datasetName))),i.$$.dirty[1]&2&&(n=z.namespace),i.$$.dirty[1]&2&&(f=z.datasetName),i.$$.dirty[1]&3&&l(1,r=rr(z,y)),i.$$.dirty[0]&2|i.$$.dirty[1]&2&&l(24,a=Yt(z,r)),i.$$.dirty[1]&1&&l(9,s=(y.visibleFields||[]).filter(Ne=>Ne.dtype==="string").map(Ne=>Ie(Ne.path))),i.$$.dirty[0]&18|i.$$.dirty[1]&15&&l(2,o=sr(I,V.data,z,y,r,(N.data||[]).map(Ne=>Ne.name))),i.$$.dirty[0]&2|i.$$.dirty[1]&1&&l(28,u=ar(y,r)),i.$$.dirty[0]&268435460&&l(3,d=u!=null&&!!u.includes(o||"")),i.$$.dirty[0]&4194318&&l(8,c=!d&&G[te(r,o)]),i.$$.dirty[0]&8&&l(7,m=d?"Search by concept or keyword.":'Search by keyword. Click "compute embedding" to search by concept.'),i.$$.dirty[0]&536870912&&l(27,_=(Te=(re=S.data)==null?void 0:re.user)==null?void 0:Te.id),i.$$.dirty[0]&1207959552&&l(25,p=fr(v.data||[],_)),i.$$.dirty[0]&9&&l(23,ye={id:"new-concept",text:ae,disabled:!d}),i.$$.dirty[0]&1&&l(26,k={id:"keyword-search",text:ae}),i.$$.dirty[0]&1736441865&&l(5,fe=v!=null&&v.data?[ye,...ae!=""?[k]:[],...p.flatMap(Ne=>Ne.concepts.map(He=>({id:{namespace:He.namespace,name:He.name},text:or(He.namespace,He.name,S.data),disabled:!d||a.some(nt=>nt.query.type==="concept"&&nt.query.concept_namespace===He.namespace&&nt.query.concept_name===He.name)})))]:[])},[ae,r,o,d,N,fe,oe,m,c,s,t,M,P,K,ne,W,ee,we,ce,Ee,H,ie,G,ye,a,p,k,_,u,S,v,y,z,V,I,me,Ae,Oe]}class Ra extends ge{constructor(e){super(),pe(this,e,Pa,Fa,_e,{},null,[-1,-1])}}function qa(i){let e,l;return e=new Ye({props:{$$slots:{default:[Oa]},$$scope:{ctx:i}}}),e.$on("click",i[5]),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n&512&&(f.$$scope={dirty:n,ctx:t}),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function La(i){let e,l;return{c(){e=A("span"),l=Q("Invalid query"),this.h()},l(t){e=F(t,"SPAN",{class:!0});var n=D(e);l=J(n,"Invalid query"),n.forEach(h),this.h()},h(){T(e,"class","text-red-500")},m(t,n){C(t,e,n),w(e,l)},p:Z,i:Z,o:Z,d(t){t&&h(e)}}}function Oa(i){let e;return{c(){e=Q("Apply")},l(l){e=J(l,"Apply")},m(l,t){C(l,e,t)},d(l){l&&h(e)}}}function Ha(i){let e,l,t,n,f,r,a,s,o,u,d;const c=[La,qa],m=[];function _(p,k){return p[0]?p[3]?1:-1:0}return~(r=_(i))&&(a=m[r]=c[r](i)),{c(){e=A("pre"),l=Q(""),t=Q(i[2]),n=Q(`
`),f=j(),a&&a.c(),s=le(),this.h()},l(p){e=F(p,"PRE",{class:!0,contenteditable:!0});var k=D(e);l=J(k,""),t=J(k,i[2]),n=J(k,`
`),k.forEach(h),f=U(p),a&&a.l(p),s=le(),this.h()},h(){T(e,"class","whitespace-pre bg-gray-50 p-4 font-mono"),T(e,"contenteditable",""),i[1]===void 0&&kt(()=>i[8].call(e)),se(e,"outline-red-500",!i[0])},m(p,k){C(p,e,k),w(e,l),w(e,t),w(e,n),i[1]!==void 0&&(e.innerText=i[1]),C(p,f,k),~r&&m[r].m(p,k),C(p,s,k),o=!0,u||(d=Ve(e,"input",i[8]),u=!0)},p(p,[k]){(!o||k&4)&&Ci(t,p[2]),k&2&&p[1]!==e.innerText&&(e.innerText=p[1]),(!o||k&1)&&se(e,"outline-red-500",!p[0]);let $=r;r=_(p),r===$?~r&&m[r].p(p,k):(a&&(X(),b(m[$],1,1,()=>{m[$]=null}),x()),~r?(a=m[r],a?a.p(p,k):(a=m[r]=c[r](p),a.c()),g(a,1),a.m(s.parentNode,s)):a=null)},i(p){o||(g(a),o=!0)},o(p){b(a),o=!1},d(p){p&&h(e),p&&h(f),~r&&m[r].d(p),p&&h(s),u=!1,d()}}}function ja(i,e,l){let t,n,f,r,a;const s=Re();he(i,s,c=>l(7,a=c));let o=!0;function u(){ot(s,a.query=JSON.parse(f),a)}function d(){f=this.innerText,l(1,f),l(2,n),l(6,t),l(7,a)}return i.$$.update=()=>{if(i.$$.dirty&128&&l(6,t=a.query),i.$$.dirty&64&&l(2,n=t?JSON.stringify(t,null,2):""),i.$$.dirty&4&&l(1,f=n),i.$$.dirty&2)try{JSON.parse(f),l(0,o=!0)}catch{l(0,o=!1)}i.$$.dirty&67&&l(3,r=o&&!ur(JSON.parse(f),t))},[o,f,n,r,s,u,t,a,d]}class Ua extends ge{constructor(e){super(),pe(this,e,ja,Ha,_e,{})}}function un(i){let e,l;return e=new qi({props:{light:!0,flipped:!0,$$slots:{default:[Ya]},$$scope:{ctx:i}}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n&1073742079&&(f.$$scope={dirty:n,ctx:t}),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function cn(i){let e,l;return e=new bt({props:{text:"Sort by"}}),e.$on("click",i[20]),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function dn(i){let e,l;return e=new bt({props:{text:"Filter"}}),e.$on("click",i[21]),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function mn(i){let e,l,t,n,f,r;return l=new bt({props:{disabled:!i[7],text:"Compute embedding"}}),l.$on("click",i[22]),{c(){e=A("div"),R(l.$$.fragment),this.h()},l(a){e=F(a,"DIV",{class:!0});var s=D(e);O(l.$$.fragment,s),s.forEach(h),this.h()},h(){T(e,"class","w-full")},m(a,s){C(a,e,s),q(l,e,null),n=!0,f||(r=Me(t=ze.call(null,e,{text:i[7]?"":"User does not have access to compute embeddings over this dataset."})),f=!0)},p(a,s){const o={};s&128&&(o.disabled=!a[7]),l.$set(o),t&&qe(t.update)&&s&128&&t.update.call(null,{text:a[7]?"":"User does not have access to compute embeddings over this dataset."})},i(a){n||(g(l.$$.fragment,a),n=!0)},o(a){b(l.$$.fragment,a),n=!1},d(a){a&&h(e),L(l),f=!1,r()}}}function hn(i){let e,l;return e=new bt({props:{text:"Preview signal"}}),e.$on("click",i[23]),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function _n(i){let e,l,t,n,f,r;return l=new bt({props:{text:"Compute signal",disabled:!i[7]}}),l.$on("click",i[24]),{c(){e=A("div"),R(l.$$.fragment),this.h()},l(a){e=F(a,"DIV",{class:!0});var s=D(e);O(l.$$.fragment,s),s.forEach(h),this.h()},h(){T(e,"class","w-full")},m(a,s){C(a,e,s),q(l,e,null),n=!0,f||(r=Me(t=ze.call(null,e,{text:i[7]?"":"User does not have access to compute signals over this dataset."})),f=!0)},p(a,s){const o={};s&128&&(o.disabled=!a[7]),l.$set(o),t&&qe(t.update)&&s&128&&t.update.call(null,{text:a[7]?"":"User does not have access to compute signals over this dataset."})},i(a){n||(g(l.$$.fragment,a),n=!0)},o(a){b(l.$$.fragment,a),n=!1},d(a){a&&h(e),L(l),f=!1,r()}}}function gn(i){let e,l,t,n,f,r;return l=new bt({props:{disabled:!i[6],text:"Delete signal"}}),l.$on("click",i[25]),{c(){e=A("div"),R(l.$$.fragment),this.h()},l(a){e=F(a,"DIV",{class:!0});var s=D(e);O(l.$$.fragment,s),s.forEach(h),this.h()},h(){T(e,"class","w-full")},m(a,s){C(a,e,s),q(l,e,null),n=!0,f||(r=Me(t=ze.call(null,e,{text:i[6]?"":"User does not have access to delete signals for this dataset."})),f=!0)},p(a,s){const o={};s&64&&(o.disabled=!a[6]),l.$set(o),t&&qe(t.update)&&s&64&&t.update.call(null,{text:a[6]?"":"User does not have access to delete signals for this dataset."})},i(a){n||(g(l.$$.fragment,a),n=!0)},o(a){b(l.$$.fragment,a),n=!1},d(a){a&&h(e),L(l),f=!1,r()}}}function Ya(i){let e=yt(i[0]),l,t=Pt(i[0]),n,f,r,a,s,o,u=e&&cn(i),d=t&&dn(i),c=!i[2]&&mn(i),m=!i[2]&&hn(i),_=!i[2]&&_n(i),p=i[1]&&gn(i);return{c(){u&&u.c(),l=j(),d&&d.c(),n=j(),c&&c.c(),f=j(),m&&m.c(),r=j(),_&&_.c(),a=j(),p&&p.c(),s=le()},l(k){u&&u.l(k),l=U(k),d&&d.l(k),n=U(k),c&&c.l(k),f=U(k),m&&m.l(k),r=U(k),_&&_.l(k),a=U(k),p&&p.l(k),s=le()},m(k,$){u&&u.m(k,$),C(k,l,$),d&&d.m(k,$),C(k,n,$),c&&c.m(k,$),C(k,f,$),m&&m.m(k,$),C(k,r,$),_&&_.m(k,$),C(k,a,$),p&&p.m(k,$),C(k,s,$),o=!0},p(k,$){$&1&&(e=yt(k[0])),e?u?(u.p(k,$),$&1&&g(u,1)):(u=cn(k),u.c(),g(u,1),u.m(l.parentNode,l)):u&&(X(),b(u,1,1,()=>{u=null}),x()),$&1&&(t=Pt(k[0])),t?d?(d.p(k,$),$&1&&g(d,1)):(d=dn(k),d.c(),g(d,1),d.m(n.parentNode,n)):d&&(X(),b(d,1,1,()=>{d=null}),x()),k[2]?c&&(X(),b(c,1,1,()=>{c=null}),x()):c?(c.p(k,$),$&4&&g(c,1)):(c=mn(k),c.c(),g(c,1),c.m(f.parentNode,f)),k[2]?m&&(X(),b(m,1,1,()=>{m=null}),x()):m?(m.p(k,$),$&4&&g(m,1)):(m=hn(k),m.c(),g(m,1),m.m(r.parentNode,r)),k[2]?_&&(X(),b(_,1,1,()=>{_=null}),x()):_?(_.p(k,$),$&4&&g(_,1)):(_=_n(k),_.c(),g(_,1),_.m(a.parentNode,a)),k[1]?p?(p.p(k,$),$&2&&g(p,1)):(p=gn(k),p.c(),g(p,1),p.m(s.parentNode,s)):p&&(X(),b(p,1,1,()=>{p=null}),x())},i(k){o||(g(u),g(d),g(c),g(m),g(_),g(p),o=!0)},o(k){b(u),b(d),b(c),b(m),b(_),b(p),o=!1},d(k){u&&u.d(k),k&&h(l),d&&d.d(k),k&&h(n),c&&c.d(k),k&&h(f),m&&m.d(k),k&&h(r),_&&_.d(k),k&&h(a),p&&p.d(k),k&&h(s)}}}function Wa(i){let e,l,t,n=Ie(i[0].path)+"",f,r,a,s,o;return{c(){e=A("p"),l=Q("Confirm deleting "),t=A("code"),f=Q(n),r=Q(" ?"),a=j(),s=A("p"),o=Q("This is a permanent action and cannot be undone."),this.h()},l(u){e=F(u,"P",{class:!0});var d=D(e);l=J(d,"Confirm deleting "),t=F(d,"CODE",{});var c=D(t);f=J(c,n),c.forEach(h),r=J(d," ?"),d.forEach(h),a=U(u),s=F(u,"P",{class:!0});var m=D(s);o=J(m,"This is a permanent action and cannot be undone."),m.forEach(h),this.h()},h(){T(e,"class","!text-lg"),T(s,"class","mt-2")},m(u,d){C(u,e,d),w(e,l),w(e,t),w(t,f),w(e,r),C(u,a,d),C(u,s,d),w(s,o)},p(u,d){d&1&&n!==(n=Ie(u[0].path)+"")&&ue(f,n)},d(u){u&&h(e),u&&h(a),u&&h(s)}}}function Qa(i){let e,l,t,n,f=i[8]&&un(i);function r(s){i[26](s)}let a={danger:!0,modalHeading:"Delete signal",primaryButtonText:"Delete",primaryButtonIcon:i[9].isLoading?Dt:void 0,secondaryButtonText:"Cancel",$$slots:{default:[Wa]},$$scope:{ctx:i}};return i[3]!==void 0&&(a.open=i[3]),l=new Kt({props:a}),Pe.push(()=>et(l,"open",r)),l.$on("click:button--secondary",i[27]),l.$on("open",i[28]),l.$on("close",i[29]),l.$on("submit",i[14]),{c(){f&&f.c(),e=j(),R(l.$$.fragment)},l(s){f&&f.l(s),e=U(s),O(l.$$.fragment,s)},m(s,o){f&&f.m(s,o),C(s,e,o),q(l,s,o),n=!0},p(s,[o]){s[8]?f?(f.p(s,o),o&256&&g(f,1)):(f=un(s),f.c(),g(f,1),f.m(e.parentNode,e)):f&&(X(),b(f,1,1,()=>{f=null}),x());const u={};o&512&&(u.primaryButtonIcon=s[9].isLoading?Dt:void 0),o&1073741825&&(u.$$scope={dirty:o,ctx:s}),!t&&o&8&&(t=!0,u.open=s[3],tt(()=>t=!1)),l.$set(u)},i(s){n||(g(f),g(l.$$.fragment,s),n=!0)},o(s){b(f),b(l.$$.fragment,s),n=!1},d(s){f&&f.d(s),s&&h(e),L(l,s)}}}function Ja(i,e,l){let t,n,f,r,a,s,o,u,d,c,m,_,{field:p}=e,{schema:k}=e,$=!1;const S=Re();he(i,S,G=>l(19,_=G));const v=We();he(i,v,G=>l(18,m=G));const y=Ri();he(i,y,G=>l(9,d=G));const N=Mt();he(i,N,G=>l(17,c=G));function z(){d.mutate([t,n,{signal_path:p.path}],{onSuccess:()=>{l(3,$=!1),S.deleteSignal(p.path)}})}const V=()=>S.addSortBy(p.path),E=()=>Xe({command:xe.EditFilter,namespace:t,datasetName:n,path:p.path}),B=()=>Xe({command:xe.ComputeEmbedding,namespace:t,datasetName:n,path:p==null?void 0:p.path}),I=()=>Xe({command:xe.PreviewConcept,namespace:t,datasetName:n,path:p==null?void 0:p.path}),M=()=>Xe({command:xe.ComputeSignal,namespace:t,datasetName:n,path:p==null?void 0:p.path}),P=()=>l(3,$=!0);function K(G){$=G,l(3,$)}const ne=()=>l(3,$=!1);function W(G){je.call(this,i,G)}function te(G){je.call(this,i,G)}return i.$$set=G=>{"field"in G&&l(0,p=G.field),"schema"in G&&l(15,k=G.schema)},i.$$.update=()=>{var G,ee,we;i.$$.dirty&524288&&l(5,t=_.namespace),i.$$.dirty&524288&&l(4,n=_.datasetName),i.$$.dirty&32769&&l(2,f=Ge(p,k)),i.$$.dirty&1&&l(1,r=dt(p)),i.$$.dirty&262145&&l(16,a=Ct(((G=m.selectRowsSchema)==null?void 0:G.data)||null,p.path)),i.$$.dirty&65543&&l(8,s=(yt(p)||Pt(p)||!f||r)&&!a),i.$$.dirty&131072&&l(7,o=(ee=c.data)==null?void 0:ee.access.dataset.compute_signals),i.$$.dirty&131072&&l(6,u=(we=c.data)==null?void 0:we.access.dataset.delete_signals)},[p,r,f,$,n,t,u,o,s,d,S,v,y,N,z,k,a,c,m,_,V,E,B,I,M,P,K,ne,W,te]}class yi extends ge{constructor(e){super(),pe(this,e,Ja,Qa,_e,{field:0,schema:15})}}function pn(i,e,l){const t=i.slice();t[7]=e[l][0],t[8]=e[l][1];const n=t[2](t[7]);t[9]=n;const f=`${t[8]/t[1]*100}%`;t[10]=f;const r=De(t[8]);return t[11]=r,t}function bn(i){let e,l,t=i[9]+"",n,f,r,a,s,o=i[11]+"",u,d,c,m,_;function p(){return i[6](i[7])}return{c(){e=A("button"),l=A("div"),n=Q(t),r=j(),a=A("div"),s=A("div"),u=Q(o),c=j(),this.h()},l(k){e=F(k,"BUTTON",{class:!0});var $=D(e);l=F($,"DIV",{title:!0,class:!0});var S=D(l);n=J(S,t),S.forEach(h),r=U($),a=F($,"DIV",{class:!0});var v=D(a);s=F(v,"DIV",{title:!0,class:!0});var y=D(s);u=J(y,o),y.forEach(h),v.forEach(h),c=U($),$.forEach(h),this.h()},h(){T(l,"title",f=i[9]),T(l,"class","w-48 flex-none truncate px-2"),T(s,"title",d=i[11]),T(s,"class","histogram-bar my-px bg-indigo-200 pl-2 text-xs leading-5"),Ue(s,"width",i[10]),T(a,"class","w-36 border-l border-gray-300 pl-2"),T(e,"class","flex items-center text-left text-xs text-black hover:bg-gray-200")},m(k,$){C(k,e,$),w(e,l),w(l,n),w(e,r),w(e,a),w(a,s),w(s,u),w(e,c),m||(_=Ve(e,"click",p),m=!0)},p(k,$){i=k,$&1&&t!==(t=i[9]+"")&&ue(n,t),$&1&&f!==(f=i[9])&&T(l,"title",f),$&1&&o!==(o=i[11]+"")&&ue(u,o),$&1&&d!==(d=i[11])&&T(s,"title",d),$&3&&Ue(s,"width",i[10])},d(k){k&&h(e),m=!1,_()}}}function Ka(i){let e,l=i[0],t=[];for(let n=0;n<l.length;n+=1)t[n]=bn(pn(i,l,n));return{c(){e=A("div");for(let n=0;n<t.length;n+=1)t[n].c();this.h()},l(n){e=F(n,"DIV",{class:!0});var f=D(e);for(let r=0;r<t.length;r+=1)t[r].l(f);f.forEach(h),this.h()},h(){T(e,"class","histogram")},m(n,f){C(n,e,f);for(let r=0;r<t.length;r+=1)t[r]&&t[r].m(e,null)},p(n,[f]){if(f&15){l=n[0];let r;for(r=0;r<l.length;r+=1){const a=pn(n,l,r);t[r]?t[r].p(a,f):(t[r]=bn(a),t[r].c(),t[r].m(e,null))}for(;r<t.length;r+=1)t[r].d(1);t.length=l.length}},i:Z,o:Z,d(n){n&&h(e),Fe(t,n)}}}function Za(i,e,l){let t,{field:n}=e,{counts:f}=e,{bins:r}=e;function a(u){if(u==null)return De(u);if(r==null||n.bins!=null)return De(u);const[d,c]=r[u.toString()];return d==null?`< ${De(c)}`:c==null?`≥ ${De(d)}`:`${De(d)} .. ${De(c)}`}const s=_t(),o=u=>s("row-click",{value:u});return i.$$set=u=>{"field"in u&&l(4,n=u.field),"counts"in u&&l(0,f=u.counts),"bins"in u&&l(5,r=u.bins)},i.$$.update=()=>{i.$$.dirty&1&&l(1,t=Math.max(...f.map(([u,d])=>d)))},[f,t,a,s,n,r,o]}class Ga extends ge{constructor(e){super(),pe(this,e,Za,Ka,_e,{field:4,counts:0,bins:5})}}function Xa(i){let e,l,t,n,f,r,a,s,o,u,d,c=De(i[4].total_count)+"",m,_,p,k,$,S,v,y,N,z,V,E,B=De(i[4].approx_count_distinct)+"",I,M,P,K,ne,W;r=new It({props:{class:"inline"}}),S=new It({props:{class:"inline"}});let te=i[4].avg_text_length&&vn(i),G=i[4].min_val&&i[4].max_val&&wn(i);return{c(){e=A("table"),l=A("tbody"),t=A("tr"),n=A("td"),f=A("span"),R(r.$$.fragment),a=j(),s=A("span"),o=Q("Total count"),u=j(),d=A("td"),m=Q(c),_=j(),p=A("tr"),k=A("td"),$=A("span"),R(S.$$.fragment),v=j(),y=A("span"),N=Q("Unique values"),z=j(),V=A("td"),E=Q("~"),I=Q(B),M=j(),te&&te.c(),P=j(),G&&G.c(),this.h()},l(ee){e=F(ee,"TABLE",{class:!0});var we=D(e);l=F(we,"TBODY",{});var fe=D(l);t=F(fe,"TR",{});var ae=D(t);n=F(ae,"TD",{class:!0});var ye=D(n);f=F(ye,"SPAN",{});var ce=D(f);O(r.$$.fragment,ce),ce.forEach(h),a=U(ye),s=F(ye,"SPAN",{});var Ee=D(s);o=J(Ee,"Total count"),Ee.forEach(h),ye.forEach(h),u=U(ae),d=F(ae,"TD",{class:!0});var oe=D(d);m=J(oe,c),oe.forEach(h),ae.forEach(h),_=U(fe),p=F(fe,"TR",{});var Y=D(p);k=F(Y,"TD",{class:!0});var H=D(k);$=F(H,"SPAN",{});var ie=D($);O(S.$$.fragment,ie),ie.forEach(h),v=U(H),y=F(H,"SPAN",{});var me=D(y);N=J(me,"Unique values"),me.forEach(h),H.forEach(h),z=U(Y),V=F(Y,"TD",{class:!0});var Ae=D(V);E=J(Ae,"~"),I=J(Ae,B),Ae.forEach(h),Y.forEach(h),M=U(fe),te&&te.l(fe),P=U(fe),G&&G.l(fe),fe.forEach(h),we.forEach(h),this.h()},h(){T(n,"class","svelte-1tctrjz"),T(d,"class","svelte-1tctrjz"),T(k,"class","svelte-1tctrjz"),T(V,"class","svelte-1tctrjz"),T(e,"class","stats-table w-full svelte-1tctrjz")},m(ee,we){C(ee,e,we),w(e,l),w(l,t),w(t,n),w(n,f),q(r,f,null),w(n,a),w(n,s),w(s,o),w(t,u),w(t,d),w(d,m),w(l,_),w(l,p),w(p,k),w(k,$),q(S,$,null),w(k,v),w(k,y),w(y,N),w(p,z),w(p,V),w(V,E),w(V,I),w(l,M),te&&te.m(l,null),w(l,P),G&&G.m(l,null),K=!0,ne||(W=[Me(ze.call(null,f,{text:"Total number of rows where the value is defined."})),Me(ze.call(null,$,{text:"An approximation of the total number of unique values."}))],ne=!0)},p(ee,we){(!K||we&16)&&c!==(c=De(ee[4].total_count)+"")&&ue(m,c),(!K||we&16)&&B!==(B=De(ee[4].approx_count_distinct)+"")&&ue(I,B),ee[4].avg_text_length?te?(te.p(ee,we),we&16&&g(te,1)):(te=vn(ee),te.c(),g(te,1),te.m(l,P)):te&&(X(),b(te,1,1,()=>{te=null}),x()),ee[4].min_val&&ee[4].max_val?G?(G.p(ee,we),we&16&&g(G,1)):(G=wn(ee),G.c(),g(G,1),G.m(l,null)):G&&(X(),b(G,1,1,()=>{G=null}),x())},i(ee){K||(g(r.$$.fragment,ee),g(S.$$.fragment,ee),g(te),g(G),K=!0)},o(ee){b(r.$$.fragment,ee),b(S.$$.fragment,ee),b(te),b(G),K=!1},d(ee){ee&&h(e),L(r),L(S),te&&te.d(),G&&G.d(),ne=!1,Je(W)}}}function xa(i){let e,l;return e=new Le({props:{paragraph:!0,width:"50%"}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function ef(i){let e,l,t=i[2].error.message+"",n;return{c(){e=A("p"),l=Q("Error: "),n=Q(t)},l(f){e=F(f,"P",{});var r=D(e);l=J(r,"Error: "),n=J(r,t),r.forEach(h)},m(f,r){C(f,e,r),w(e,l),w(e,n)},p(f,r){r&4&&t!==(t=f[2].error.message+"")&&ue(n,t)},i:Z,o:Z,d(f){f&&h(e)}}}function vn(i){let e,l,t,n,f,r,a,s,o,u=De(i[4].avg_text_length)+"",d,c,m,_;return n=new It({props:{class:"inline"}}),{c(){e=A("tr"),l=A("td"),t=A("span"),R(n.$$.fragment),f=j(),r=A("span"),a=Q("Average text length"),s=j(),o=A("td"),d=Q(u),this.h()},l(p){e=F(p,"TR",{});var k=D(e);l=F(k,"TD",{class:!0});var $=D(l);t=F($,"SPAN",{});var S=D(t);O(n.$$.fragment,S),S.forEach(h),f=U($),r=F($,"SPAN",{});var v=D(r);a=J(v,"Average text length"),v.forEach(h),$.forEach(h),s=U(k),o=F(k,"TD",{class:!0});var y=D(o);d=J(y,u),y.forEach(h),k.forEach(h),this.h()},h(){T(l,"class","svelte-1tctrjz"),T(o,"class","svelte-1tctrjz")},m(p,k){C(p,e,k),w(e,l),w(l,t),q(n,t,null),w(l,f),w(l,r),w(r,a),w(e,s),w(e,o),w(o,d),c=!0,m||(_=Me(ze.call(null,t,{text:"The average length of the text in characters."})),m=!0)},p(p,k){(!c||k&16)&&u!==(u=De(p[4].avg_text_length)+"")&&ue(d,u)},i(p){c||(g(n.$$.fragment,p),c=!0)},o(p){b(n.$$.fragment,p),c=!1},d(p){p&&h(e),L(n),m=!1,_()}}}function wn(i){let e,l,t,n,f,r,a,s,o,u=De(i[4].min_val)+"",d,c,m=De(i[4].max_val)+"",_,p,k,$;return n=new It({props:{class:"inline"}}),{c(){e=A("tr"),l=A("td"),t=A("span"),R(n.$$.fragment),f=j(),r=A("span"),a=Q("Range"),s=j(),o=A("td"),d=Q(u),c=Q(" .. "),_=Q(m),this.h()},l(S){e=F(S,"TR",{});var v=D(e);l=F(v,"TD",{class:!0});var y=D(l);t=F(y,"SPAN",{});var N=D(t);O(n.$$.fragment,N),N.forEach(h),f=U(y),r=F(y,"SPAN",{});var z=D(r);a=J(z,"Range"),z.forEach(h),y.forEach(h),s=U(v),o=F(v,"TD",{class:!0});var V=D(o);d=J(V,u),c=J(V," .. "),_=J(V,m),V.forEach(h),v.forEach(h),this.h()},h(){T(l,"class","svelte-1tctrjz"),T(o,"class","svelte-1tctrjz")},m(S,v){C(S,e,v),w(e,l),w(l,t),q(n,t,null),w(l,f),w(l,r),w(r,a),w(e,s),w(e,o),w(o,d),w(o,c),w(o,_),p=!0,k||($=Me(ze.call(null,t,{text:"The minimum and maximum value across the dataset"})),k=!0)},p(S,v){(!p||v&16)&&u!==(u=De(S[4].min_val)+"")&&ue(d,u),(!p||v&16)&&m!==(m=De(S[4].max_val)+"")&&ue(_,m)},i(S){p||(g(n.$$.fragment,S),p=!0)},o(S){b(n.$$.fragment,S),p=!1},d(S){S&&h(e),L(n),k=!1,$()}}}function tf(i){let e,l,t;return l=new Ga({props:{counts:i[5],bins:i[3],field:i[0]}}),l.$on("row-click",i[11]),{c(){e=A("div"),R(l.$$.fragment),this.h()},l(n){e=F(n,"DIV",{class:!0});var f=D(e);O(l.$$.fragment,f),f.forEach(h),this.h()},h(){T(e,"class","mt-4")},m(n,f){C(n,e,f),q(l,e,null),t=!0},p(n,f){const r={};f&32&&(r.counts=n[5]),f&8&&(r.bins=n[3]),f&1&&(r.field=n[0]),l.$set(r)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){b(l.$$.fragment,n),t=!1},d(n){n&&h(e),L(l)}}}function lf(i){let e,l;return e=new Le({props:{paragraph:!0,width:"50%"}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function nf(i){let e,l,t=i[1].error.message+"",n;return{c(){e=A("p"),l=Q("Error: "),n=Q(t)},l(f){e=F(f,"P",{});var r=D(e);l=J(r,"Error: "),n=J(r,t),r.forEach(h)},m(f,r){C(f,e,r),w(e,l),w(e,n)},p(f,r){r&2&&t!==(t=f[1].error.message+"")&&ue(n,t)},i:Z,o:Z,d(f){f&&h(e)}}}function rf(i){let e,l,t,n,f,r,a;const s=[ef,xa,Xa],o=[];function u(_,p){return _[2].error?0:_[4]==null?1:2}l=u(i),t=o[l]=s[l](i);const d=[nf,lf,tf],c=[];function m(_,p){return _[1].error?0:_[5]==null?1:_[5].length>0?2:-1}return~(f=m(i))&&(r=c[f]=d[f](i)),{c(){e=A("div"),t.c(),n=j(),r&&r.c(),this.h()},l(_){e=F(_,"DIV",{class:!0});var p=D(e);t.l(p),n=U(p),r&&r.l(p),p.forEach(h),this.h()},h(){T(e,"class","p-4")},m(_,p){C(_,e,p),o[l].m(e,null),w(e,n),~f&&c[f].m(e,null),a=!0},p(_,[p]){let k=l;l=u(_),l===k?o[l].p(_,p):(X(),b(o[k],1,1,()=>{o[k]=null}),x(),t=o[l],t?t.p(_,p):(t=o[l]=s[l](_),t.c()),g(t,1),t.m(e,n));let $=f;f=m(_),f===$?~f&&c[f].p(_,p):(r&&(X(),b(c[$],1,1,()=>{c[$]=null}),x()),~f?(r=c[f],r?r.p(_,p):(r=c[f]=d[f](_),r.c()),g(r,1),r.m(e,null)):r=null)},i(_){a||(g(t),g(r),a=!0)},o(_){b(t),b(r),a=!1},d(_){_&&h(e),o[l].d(),~f&&c[f].d()}}}function sf(i,e,l){let t,n,f,r,a,s=Z,o=()=>(s(),s=Be(n,v=>l(1,a=v)),n),u,d=Z,c=()=>(d(),d=Be(t,v=>l(2,u=v)),t),m;i.$$.on_destroy.push(()=>s()),i.$$.on_destroy.push(()=>d());let{field:_}=e;const p=Re();he(i,p,v=>l(10,m=v));let k=null;function $(v){if(v==null)return;if(k!=null){const[N,z]=k[v.toString()];if(N!=null){const V={path:_.path,op:"greater_equal",value:N};p.addFilter(V)}if(z!=null){const V={path:_.path,op:"less",value:z};p.addFilter(V)}return}const y={path:_.path,op:"equals",value:v};p.addFilter(y)}const S=v=>$(v.detail.value);return i.$$set=v=>{"field"in v&&l(0,_=v.field)},i.$$.update=()=>{var v;if(i.$$.dirty&1025&&c(l(7,t=Li(m.namespace,m.datasetName,{leaf_path:_.path}))),i.$$.dirty&1025&&o(l(6,n=Oi(m.namespace,m.datasetName,{leaf_path:_.path,filters:m.query.filters}))),i.$$.dirty&2&&l(5,f=a.data!=null?a.data.counts:null),i.$$.dirty&4&&l(4,r=u.data!=null?u.data:null),i.$$.dirty&2)if(((v=a.data)==null?void 0:v.bins)!=null){l(3,k={});for(const[y,N,z]of Object.values(a.data.bins))l(3,k[y]=[N,z],k)}else l(3,k=null)},[_,a,u,k,r,f,n,t,p,$,m,S]}class af extends ge{constructor(e){super(),pe(this,e,sf,rf,_e,{field:0})}}function kn(i,e,l){const t=i.slice();return t[38]=e[l],t}function Sn(i,e,l){const t=i.slice();return t[41]=e[l],t}function En(i,e,l){const t=i.slice();return t[44]=e[l],t}function yn(i,e,l){const t=i.slice();return t[47]=e[l],t}function ff(i){let e,l="{}",t;return{c(){e=A("span"),t=Q(l),this.h()},l(n){e=F(n,"SPAN",{class:!0});var f=D(e);t=J(f,l),f.forEach(h),this.h()},h(){T(e,"class","font-mono")},m(n,f){C(n,e,f),w(e,t)},p:Z,i:Z,o:Z,d(n){n&&h(e)}}}function of(i){let e,l,t,n;var f=ht[i[1].repeated_field.dtype];function r(a){return{props:{title:a[1].dtype}}}return f&&(l=ct(f,r(i))),{c(){e=A("div"),l&&R(l.$$.fragment),t=Q("[]"),this.h()},l(a){e=F(a,"DIV",{class:!0});var s=D(e);l&&O(l.$$.fragment,s),t=J(s,"[]"),s.forEach(h),this.h()},h(){T(e,"class","flex")},m(a,s){C(a,e,s),l&&q(l,e,null),w(e,t),n=!0},p(a,s){const o={};if(s[0]&2&&(o.title=a[1].dtype),s[0]&2&&f!==(f=ht[a[1].repeated_field.dtype])){if(l){X();const u=l;b(u.$$.fragment,1,0,()=>{L(u,1)}),x()}f?(l=ct(f,r(a)),R(l.$$.fragment),g(l.$$.fragment,1),q(l,e,t)):l=null}else f&&l.$set(o)},i(a){n||(l&&g(l.$$.fragment,a),n=!0)},o(a){l&&b(l.$$.fragment,a),n=!1},d(a){a&&h(e),l&&L(l)}}}function uf(i){let e,l,t;var n=ht[i[1].dtype];function f(r){return{props:{title:r[1].dtype}}}return n&&(e=ct(n,f(i))),{c(){e&&R(e.$$.fragment),l=le()},l(r){e&&O(e.$$.fragment,r),l=le()},m(r,a){e&&q(e,r,a),C(r,l,a),t=!0},p(r,a){const s={};if(a[0]&2&&(s.title=r[1].dtype),a[0]&2&&n!==(n=ht[r[1].dtype])){if(e){X();const o=e;b(o.$$.fragment,1,0,()=>{L(o,1)}),x()}n?(e=ct(n,f(r)),R(e.$$.fragment),g(e.$$.fragment,1),q(e,l.parentNode,l)):e=null}else n&&e.$set(s)},i(r){t||(e&&g(e.$$.fragment,r),t=!0)},o(r){e&&b(e.$$.fragment,r),t=!1},d(r){r&&h(l),e&&L(e,r)}}}function $n(i){let e,l;return e=new zt({props:{interactive:!0,type:"green",$$slots:{default:[mf]},$$scope:{ctx:i}}}),e.$on("click",i[32]),e.$on("remove",i[33]),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n[0]&16384|n[1]&524288&&(f.$$scope={dirty:n,ctx:t}),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function cf(i){let e,l;return e=new Tt({}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function df(i){let e,l;return e=new Vt({}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function mf(i){let e,l,t,n,f,r,a,s;const o=[df,cf],u=[];function d(c,m){return c[14]=="ASC"?0:1}return r=d(i),a=u[r]=o[r](i),{c(){e=A("div"),l=A("div"),t=Q("Sorted"),n=j(),f=A("span"),a.c(),this.h()},l(c){e=F(c,"DIV",{class:!0});var m=D(e);l=F(m,"DIV",{class:!0});var _=D(l);t=J(_,"Sorted"),_.forEach(h),n=U(m),f=F(m,"SPAN",{});var p=D(f);a.l(p),p.forEach(h),m.forEach(h),this.h()},h(){T(l,"class","mr-1"),T(e,"class","flex flex-row")},m(c,m){C(c,e,m),w(e,l),w(l,t),w(e,n),w(e,f),u[r].m(f,null),s=!0},p(c,m){let _=r;r=d(c),r!==_&&(X(),b(u[_],1,1,()=>{u[_]=null}),x(),a=u[r],a||(a=u[r]=o[r](c),a.c()),g(a,1),a.m(f,null))},i(c){s||(g(a),s=!0)},o(c){b(a),s=!1},d(c){c&&h(e),u[r].d()}}}function Dn(i){let e,l,t=i[7],n=[];for(let r=0;r<t.length;r+=1)n[r]=In(yn(i,t,r));const f=r=>b(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;r<n.length;r+=1)n[r].c();e=le()},l(r){for(let a=0;a<n.length;a+=1)n[a].l(r);e=le()},m(r,a){for(let s=0;s<n.length;s+=1)n[s]&&n[s].m(r,a);C(r,e,a),l=!0},p(r,a){if(a[0]&128){t=r[7];let s;for(s=0;s<t.length;s+=1){const o=yn(r,t,s);n[s]?(n[s].p(o,a),g(n[s],1)):(n[s]=In(o),n[s].c(),g(n[s],1),n[s].m(e.parentNode,e))}for(X(),s=t.length;s<n.length;s+=1)f(s);x()}},i(r){if(!l){for(let a=0;a<t.length;a+=1)g(n[a]);l=!0}},o(r){n=n.filter(Boolean);for(let a=0;a<n.length;a+=1)b(n[a]);l=!1},d(r){Fe(n,r),r&&h(e)}}}function In(i){let e,l;return e=new Gt({props:{filter:i[47],hidePath:!0}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n[0]&128&&(f.filter=t[47]),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Vn(i){let e,l;return e=new Ei({props:{search:i[44]}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n[0]&4096&&(f.search=t[44]),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Tn(i){var t;let e,l;return e=new Ut({props:{embedding:(t=i[41].signal)==null?void 0:t.signal_name}}),{c(){R(e.$$.fragment)},l(n){O(e.$$.fragment,n)},m(n,f){q(e,n,f),l=!0},p(n,f){var a;const r={};f[0]&65536&&(r.embedding=(a=n[41].signal)==null?void 0:a.signal_name),e.$set(r)},i(n){l||(g(e.$$.fragment,n),l=!0)},o(n){b(e.$$.fragment,n),l=!1},d(n){L(e,n)}}}function Cn(i){let e,l,t,n,f,r,a;return l=new lt({props:{type:"cyan",icon:Rt}}),l.$on("click",i[34]),n=new Xt({props:{isPreview:!0}}),n.$on("click",i[35]),{c(){e=A("div"),R(l.$$.fragment),t=j(),R(n.$$.fragment),this.h()},l(s){e=F(s,"DIV",{class:!0});var o=D(e);O(l.$$.fragment,o),o.forEach(h),t=U(s),O(n.$$.fragment,s),this.h()},h(){T(e,"class","compute-signal-preview pointer-events-auto mr-2")},m(s,o){C(s,e,o),q(l,e,null),C(s,t,o),q(n,s,o),f=!0,r||(a=Me(ze.call(null,e,{text:`Compute signal over the column and save the result.
This may be expensive.`})),r=!0)},p:Z,i(s){f||(g(l.$$.fragment,s),g(n.$$.fragment,s),f=!0)},o(s){b(l.$$.fragment,s),b(n.$$.fragment,s),f=!1},d(s){s&&h(e),L(l),s&&h(t),L(n,s),r=!1,a()}}}function Nn(i){let e,l,t;return l=new Ye({props:{isSelected:i[20],kind:"ghost",size:"field",iconDescription:i[20]?"Close statistics":"See statistics",icon:cr}}),l.$on("click",i[36]),{c(){e=A("div"),R(l.$$.fragment),this.h()},l(n){e=F(n,"DIV",{class:!0});var f=D(e);O(l.$$.fragment,f),f.forEach(h),this.h()},h(){T(e,"class","stats-button flex")},m(n,f){C(n,e,f),q(l,e,null),t=!0},p(n,f){const r={};f[0]&1048576&&(r.isSelected=n[20]),f[0]&1048576&&(r.iconDescription=n[20]?"Close statistics":"See statistics"),l.$set(r)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){b(l.$$.fragment,n),t=!1},d(n){n&&h(e),L(l)}}}function Mn(i){let e,l,t,n;return l=new af({props:{field:i[1]}}),{c(){e=A("div"),R(l.$$.fragment),this.h()},l(f){e=F(f,"DIV",{class:!0});var r=D(e);O(l.$$.fragment,r),r.forEach(h),this.h()},h(){T(e,"class","px-2")},m(f,r){C(f,e,r),q(l,e,null),n=!0},p(f,r){const a={};r[0]&2&&(a.field=f[1]),l.$set(a)},i(f){n||(g(l.$$.fragment,f),f&&kt(()=>{n&&(t||(t=ut(e,mt,{},!0)),t.run(1))}),n=!0)},o(f){b(l.$$.fragment,f),f&&(t||(t=ut(e,mt,{},!1)),t.run(0)),n=!1},d(f){f&&h(e),L(l),f&&t&&t.end()}}}function zn(i){let e,l,t=i[18],n=[];for(let r=0;r<t.length;r+=1)n[r]=An(kn(i,t,r));const f=r=>b(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;r<n.length;r+=1)n[r].c();e=le()},l(r){for(let a=0;a<n.length;a+=1)n[a].l(r);e=le()},m(r,a){for(let s=0;s<n.length;s+=1)n[s]&&n[s].m(r,a);C(r,e,a),l=!0},p(r,a){if(a[0]&262415){t=r[18];let s;for(s=0;s<t.length;s+=1){const o=kn(r,t,s);n[s]?(n[s].p(o,a),g(n[s],1)):(n[s]=An(o),n[s].c(),g(n[s],1),n[s].m(e.parentNode,e))}for(X(),s=t.length;s<n.length;s+=1)f(s);x()}},i(r){if(!l){for(let a=0;a<t.length;a+=1)g(n[a]);l=!0}},o(r){n=n.filter(Boolean);for(let a=0;a<n.length;a+=1)b(n[a]);l=!1},d(r){Fe(n,r),r&&h(e)}}}function An(i){let e,l;return e=new $i({props:{schema:i[0],field:i[38],indent:i[3]+1,sourceField:i[8]&&Ge(i[38],i[0])?i[1]:i[2]}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n[0]&1&&(f.schema=t[0]),n[0]&262144&&(f.field=t[38]),n[0]&8&&(f.indent=t[3]+1),n[0]&262407&&(f.sourceField=t[8]&&Ge(t[38],t[0])?t[1]:t[2]),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function hf(i){let e,l,t,n,f,r,a,s,o,u,d,c,m,_,p,k,$,S,v,y,N,z,V,E,B,I,M;n=new Wt({props:{labelText:"Show",hideLabel:!0,checked:i[17]}}),n.$on("change",i[30]);const P=[uf,of,ff],K=[];function ne(H,ie){return H[1].dtype?0:H[1].repeated_field&&H[1].repeated_field.dtype?1:2}a=ne(i),s=K[a]=P[a](i);let W=i[15]&&$n(i),te=i[13]&&Dn(i),G=i[12],ee=[];for(let H=0;H<G.length;H+=1)ee[H]=Vn(En(i,G,H));const we=H=>b(ee[H],1,1,()=>{ee[H]=null});let fe=i[16],ae=[];for(let H=0;H<fe.length;H+=1)ae[H]=Tn(Sn(i,fe,H));const ye=H=>b(ae[H],1,1,()=>{ae[H]=null});let ce=i[4]&&i[21]&&Cn(i),Ee=i[10]&&Nn(i);y=new yi({props:{field:i[1],schema:i[0]}});let oe=i[20]&&Mn(i),Y=i[18].length&&zn(i);return{c(){e=A("div"),l=A("div"),t=A("div"),R(n.$$.fragment),f=j(),r=A("div"),s.c(),u=j(),d=A("button"),c=Q(i[19]),m=j(),W&&W.c(),_=j(),te&&te.c(),p=j();for(let H=0;H<ee.length;H+=1)ee[H].c();k=j();for(let H=0;H<ae.length;H+=1)ae[H].c();$=j(),ce&&ce.c(),S=j(),Ee&&Ee.c(),v=j(),R(y.$$.fragment),N=j(),oe&&oe.c(),z=j(),V=A("div"),Y&&Y.c(),this.h()},l(H){e=F(H,"DIV",{class:!0});var ie=D(e);l=F(ie,"DIV",{class:!0});var me=D(l);t=F(me,"DIV",{});var Ae=D(t);O(n.$$.fragment,Ae),Ae.forEach(h),f=U(me),r=F(me,"DIV",{class:!0});var Oe=D(r);s.l(Oe),Oe.forEach(h),u=U(me),d=F(me,"BUTTON",{class:!0});var re=D(d);c=J(re,i[19]),re.forEach(h),m=U(me),W&&W.l(me),_=U(me),te&&te.l(me),p=U(me);for(let Ne=0;Ne<ee.length;Ne+=1)ee[Ne].l(me);k=U(me);for(let Ne=0;Ne<ae.length;Ne+=1)ae[Ne].l(me);$=U(me),ce&&ce.l(me),S=U(me),Ee&&Ee.l(me),v=U(me),O(y.$$.fragment,me),me.forEach(h),N=U(ie),oe&&oe.l(ie),z=U(ie),V=F(ie,"DIV",{});var Te=D(V);Y&&Y.l(Te),Te.forEach(h),ie.forEach(h),this.h()},h(){Ue(t,"margin-left",i[3]*1.5+"rem"),T(r,"class","rounded-md bg-blue-200 p-0.5"),se(r,"bg-blue-200",i[5]),T(d,"class","ml-2 grow cursor-pointer truncate whitespace-nowrap text-left text-gray-900"),se(d,"cursor-default",!i[10]),Ue(d,"line-height","3rem"),T(l,"class","flex w-full flex-row items-center gap-x-2 border-gray-300 px-4 hover:bg-gray-100"),se(l,"bg-blue-50",i[5]),se(l,"bg-emerald-100",i[4]),se(l,"hover:bg-blue-100",i[5]),T(e,"class","border-gray-300"),se(e,"border-b",!i[5])},m(H,ie){C(H,e,ie),w(e,l),w(l,t),q(n,t,null),w(l,f),w(l,r),K[a].m(r,null),w(l,u),w(l,d),w(d,c),w(l,m),W&&W.m(l,null),w(l,_),te&&te.m(l,null),w(l,p);for(let me=0;me<ee.length;me+=1)ee[me]&&ee[me].m(l,null);w(l,k);for(let me=0;me<ae.length;me+=1)ae[me]&&ae[me].m(l,null);w(l,$),ce&&ce.m(l,null),w(l,S),Ee&&Ee.m(l,null),w(l,v),q(y,l,null),w(e,N),oe&&oe.m(e,null),w(e,z),w(e,V),Y&&Y.m(V,null),B=!0,I||(M=[Me(o=ze.call(null,r,{text:i[11]})),Ve(d,"click",i[31])],I=!0)},p(H,ie){const me={};ie[0]&131072&&(me.checked=H[17]),n.$set(me),ie[0]&8&&Ue(t,"margin-left",H[3]*1.5+"rem");let Ae=a;if(a=ne(H),a===Ae?K[a].p(H,ie):(X(),b(K[Ae],1,1,()=>{K[Ae]=null}),x(),s=K[a],s?s.p(H,ie):(s=K[a]=P[a](H),s.c()),g(s,1),s.m(r,null)),o&&qe(o.update)&&ie[0]&2048&&o.update.call(null,{text:H[11]}),(!B||ie[0]&32)&&se(r,"bg-blue-200",H[5]),(!B||ie[0]&524288)&&ue(c,H[19]),(!B||ie[0]&1024)&&se(d,"cursor-default",!H[10]),H[15]?W?(W.p(H,ie),ie[0]&32768&&g(W,1)):(W=$n(H),W.c(),g(W,1),W.m(l,_)):W&&(X(),b(W,1,1,()=>{W=null}),x()),H[13]?te?(te.p(H,ie),ie[0]&8192&&g(te,1)):(te=Dn(H),te.c(),g(te,1),te.m(l,p)):te&&(X(),b(te,1,1,()=>{te=null}),x()),ie[0]&4096){G=H[12];let re;for(re=0;re<G.length;re+=1){const Te=En(H,G,re);ee[re]?(ee[re].p(Te,ie),g(ee[re],1)):(ee[re]=Vn(Te),ee[re].c(),g(ee[re],1),ee[re].m(l,k))}for(X(),re=G.length;re<ee.length;re+=1)we(re);x()}if(ie[0]&65536){fe=H[16];let re;for(re=0;re<fe.length;re+=1){const Te=Sn(H,fe,re);ae[re]?(ae[re].p(Te,ie),g(ae[re],1)):(ae[re]=Tn(Te),ae[re].c(),g(ae[re],1),ae[re].m(l,$))}for(X(),re=fe.length;re<ae.length;re+=1)ye(re);x()}H[4]&&H[21]?ce?(ce.p(H,ie),ie[0]&2097168&&g(ce,1)):(ce=Cn(H),ce.c(),g(ce,1),ce.m(l,S)):ce&&(X(),b(ce,1,1,()=>{ce=null}),x()),H[10]?Ee?(Ee.p(H,ie),ie[0]&1024&&g(Ee,1)):(Ee=Nn(H),Ee.c(),g(Ee,1),Ee.m(l,v)):Ee&&(X(),b(Ee,1,1,()=>{Ee=null}),x());const Oe={};ie[0]&2&&(Oe.field=H[1]),ie[0]&1&&(Oe.schema=H[0]),y.$set(Oe),(!B||ie[0]&32)&&se(l,"bg-blue-50",H[5]),(!B||ie[0]&16)&&se(l,"bg-emerald-100",H[4]),(!B||ie[0]&32)&&se(l,"hover:bg-blue-100",H[5]),H[20]?oe?(oe.p(H,ie),ie[0]&1048576&&g(oe,1)):(oe=Mn(H),oe.c(),g(oe,1),oe.m(e,z)):oe&&(X(),b(oe,1,1,()=>{oe=null}),x()),H[18].length?Y?(Y.p(H,ie),ie[0]&262144&&g(Y,1)):(Y=zn(H),Y.c(),g(Y,1),Y.m(V,null)):Y&&(X(),b(Y,1,1,()=>{Y=null}),x()),(!B||ie[0]&32)&&se(e,"border-b",!H[5])},i(H){if(!B){g(n.$$.fragment,H),g(s),g(W),g(te);for(let ie=0;ie<G.length;ie+=1)g(ee[ie]);for(let ie=0;ie<fe.length;ie+=1)g(ae[ie]);g(ce),g(Ee),g(y.$$.fragment,H),g(oe),g(Y),H&&kt(()=>{B&&(E||(E=ut(V,mt,{},!0)),E.run(1))}),B=!0}},o(H){b(n.$$.fragment,H),b(s),b(W),b(te),ee=ee.filter(Boolean);for(let ie=0;ie<ee.length;ie+=1)b(ee[ie]);ae=ae.filter(Boolean);for(let ie=0;ie<ae.length;ie+=1)b(ae[ie]);b(ce),b(Ee),b(y.$$.fragment,H),b(oe),b(Y),H&&(E||(E=ut(V,mt,{},!1)),E.run(0)),B=!1},d(H){H&&h(e),L(n),K[a].d(),W&&W.d(),te&&te.d(),Fe(ee,H),Fe(ae,H),ce&&ce.d(),Ee&&Ee.d(),L(y),oe&&oe.d(),Y&&Y.d(),H&&E&&E.end(),I=!1,Je(M)}}}function _f(i,e,l){let t,n,f,r,a,s,o,u,d,c,m,_,p,k,$,S,v,y,N,z,V,E,B,{schema:I}=e,{field:M}=e,{sourceField:P=void 0}=e,{indent:K=0}=e;const ne=hi();he(i,ne,oe=>l(22,B=oe));const W=Re();he(i,W,oe=>l(9,V=oe));const te=We();he(i,te,oe=>l(29,E=oe));function G(oe){return oe!=null&&oe.repeated_field?G(oe.repeated_field):oe!=null&&oe.fields?[...Object.values(oe.fields).filter(Y=>Y.path.at(-1)!==_i)].flatMap(Y=>{const H=G(Y);return H.some(ie=>dt(ie))?H:[Y]}).filter(Y=>{var H,ie,me,Ae;return!(Y.dtype==="embedding"||Y.signal!=null&&wt(Y).some(Oe=>Oe.dtype==="embedding")||((H=Y.signal)==null?void 0:H.signal_name)==="sentences"||((ie=Y.signal)==null?void 0:ie.signal_name)==="substring_search"||((me=Y.signal)==null?void 0:me.signal_name)==="semantic_similarity"||((Ae=Y.signal)==null?void 0:Ae.signal_name)==="concept_labels")}):[]}const ee=()=>{d?W.removeSelectedColumn(r):W.addSelectedColumn(r)},we=()=>{z&&(a?W.removeExpandedColumn(r):W.addExpandedColumn(r))},fe=()=>_==="ASC"?ot(W,V.query.sort_order="DESC",V):ot(W,V.query.sort_order="ASC",V),ae=()=>W.removeSortBy(r),ye=()=>M.signal&&$&&P&&B.mutate([V.namespace,V.datasetName,{leaf_path:P.path,signal:M.signal}]),ce=()=>{var oe;return M.signal&&$&&Xe({command:xe.EditPreviewConcept,namespace:V.namespace,datasetName:V.datasetName,path:P==null?void 0:P.path,signalName:(oe=M.signal)==null?void 0:oe.signal_name,value:M.signal})},Ee=()=>{a?W.removeExpandedColumn(r):W.addExpandedColumn(r)};return i.$$set=oe=>{"schema"in oe&&l(0,I=oe.schema),"field"in oe&&l(1,M=oe.field),"sourceField"in oe&&l(2,P=oe.sourceField),"indent"in oe&&l(3,K=oe.indent)},i.$$.update=()=>{var oe,Y,H,ie;i.$$.dirty[0]&3&&l(5,t=Ge(M,I)),i.$$.dirty[0]&2&&l(21,n=dt(M)),i.$$.dirty[0]&32&&l(8,f=!t),i.$$.dirty[0]&2&&l(6,r=M.path),i.$$.dirty[0]&576&&l(20,a=V.expandedColumns[Ie(r)]||!1),i.$$.dirty[0]&64&&l(28,s=r.at(-1)===$t),i.$$.dirty[0]&268435520&&l(19,o=s?r.at(-2):r.at(-1)),i.$$.dirty[0]&2&&l(18,u=G(M)),i.$$.dirty[0]&536870976&&l(17,d=(oe=E.visibleFields)==null?void 0:oe.some(me=>Qe(me.path,r))),i.$$.dirty[0]&258&&l(16,c=f?wt(M).filter(me=>me.signal!=null&&wt(me).some(Ae=>Ae.dtype==="embedding")):[]),i.$$.dirty[0]&576&&l(15,m=(Y=V.query.sort_by)==null?void 0:Y.some(me=>Qe(me,r))),i.$$.dirty[0]&512&&l(14,_=V.query.sort_order),i.$$.dirty[0]&576&&l(7,p=((H=V.query.filters)==null?void 0:H.filter(me=>Qe(me.path,r)))||[]),i.$$.dirty[0]&128&&l(13,k=p.length>0),i.$$.dirty[0]&536870976&&l(4,$=Ct(((ie=E.selectRowsSchema)==null?void 0:ie.data)||null,r)),i.$$.dirty[0]&576&&l(12,S=Yt(V,r)),i.$$.dirty[0]&32&&l(26,v=t?". This field was generated by a signal":""),i.$$.dirty[0]&2&&l(27,y=M.dtype??(M.repeated_field&&M.repeated_field.dtype?`${M.repeated_field.dtype}[]`:"object")),i.$$.dirty[0]&201326592&&l(11,N=`Data type: ${y}${v}`),i.$$.dirty[0]&18&&l(10,z=yt(M)&&!$)},[I,M,P,K,$,t,r,p,f,V,z,N,S,k,_,m,c,d,u,o,a,n,B,ne,W,te,v,y,s,E,ee,we,fe,ae,ye,ce,Ee]}class $i extends ge{constructor(e){super(),pe(this,e,_f,hf,_e,{schema:0,field:1,sourceField:2,indent:3},null,[-1,-1])}}function Fn(i,e,l){const t=i.slice();return t[28]=e[l],t}function Bn(i,e,l){const t=i.slice();return t[31]=e[l],t}function gf(i){var B;let e,l,t,n,f,r,a,s,o,u,d,c,m,_,p,k,$,S;t=new Wt({props:{labelText:"Show",hideLabel:!0,checked:i[14],disabled:i[10]}}),t.$on("change",i[23]);let v=i[15]&&Pn(i),y=i[13]&&Rn(i),N=i[11]&&qn(i),z=i[17]&&On(i),V=((B=i[1])==null?void 0:B.dtype)&&Hn(i);p=new yi({props:{field:i[1],schema:i[0]}});let E=i[8]&&jn(i);return{c(){e=A("div"),l=A("div"),R(t.$$.fragment),n=j(),f=A("div"),v&&v.c(),r=j(),a=A("div"),s=Q(i[16]),o=j(),y&&y.c(),u=j(),N&&N.c(),d=j(),z&&z.c(),c=j(),V&&V.c(),m=j(),_=A("div"),R(p.$$.fragment),k=j(),E&&E.c(),$=le(),this.h()},l(I){e=F(I,"DIV",{class:!0});var M=D(e);l=F(M,"DIV",{class:!0});var P=D(l);O(t.$$.fragment,P),P.forEach(h),n=U(M),f=F(M,"DIV",{class:!0});var K=D(f);v&&v.l(K),K.forEach(h),r=U(M),a=F(M,"DIV",{class:!0,title:!0});var ne=D(a);s=J(ne,i[16]),ne.forEach(h),o=U(M),y&&y.l(M),u=U(M),N&&N.l(M),d=U(M),z&&z.l(M),c=U(M),V&&V.l(M),m=U(M),_=F(M,"DIV",{});var W=D(_);O(p.$$.fragment,W),W.forEach(h),M.forEach(h),k=U(I),E&&E.l(I),$=le(),this.h()},h(){T(l,"class","w-6"),T(f,"class","w-6"),Ue(f,"margin-left",i[2]*24+"px"),T(a,"class","grow truncate whitespace-nowrap pr-2 text-gray-900"),T(a,"title",i[16]),T(e,"class","flex w-full flex-row items-center border-b border-gray-200 px-4 py-2 hover:bg-gray-100"),se(e,"bg-blue-50",i[18]),se(e,"hover:bg-blue-100",i[18])},m(I,M){C(I,e,M),w(e,l),q(t,l,null),w(e,n),w(e,f),v&&v.m(f,null),w(e,r),w(e,a),w(a,s),w(e,o),y&&y.m(e,null),w(e,u),N&&N.m(e,null),w(e,d),z&&z.m(e,null),w(e,c),V&&V.m(e,null),w(e,m),w(e,_),q(p,_,null),C(I,k,M),E&&E.m(I,M),C(I,$,M),S=!0},p(I,M){var ne;const P={};M[0]&16384&&(P.checked=I[14]),M[0]&1024&&(P.disabled=I[10]),t.$set(P),I[15]?v?(v.p(I,M),M[0]&32768&&g(v,1)):(v=Pn(I),v.c(),g(v,1),v.m(f,null)):v&&(X(),b(v,1,1,()=>{v=null}),x()),M[0]&4&&Ue(f,"margin-left",I[2]*24+"px"),(!S||M[0]&65536)&&ue(s,I[16]),(!S||M[0]&65536)&&T(a,"title",I[16]),I[13]?y?(y.p(I,M),M[0]&8192&&g(y,1)):(y=Rn(I),y.c(),g(y,1),y.m(e,u)):y&&(X(),b(y,1,1,()=>{y=null}),x()),I[11]?N?(N.p(I,M),M[0]&2048&&g(N,1)):(N=qn(I),N.c(),g(N,1),N.m(e,d)):N&&(X(),b(N,1,1,()=>{N=null}),x()),I[17]?z?(z.p(I,M),M[0]&131072&&g(z,1)):(z=On(I),z.c(),g(z,1),z.m(e,c)):z&&(X(),b(z,1,1,()=>{z=null}),x()),(ne=I[1])!=null&&ne.dtype?V?V.p(I,M):(V=Hn(I),V.c(),V.m(e,m)):V&&(V.d(1),V=null);const K={};M[0]&2&&(K.field=I[1]),M[0]&1&&(K.schema=I[0]),p.$set(K),(!S||M[0]&262144)&&se(e,"bg-blue-50",I[18]),(!S||M[0]&262144)&&se(e,"hover:bg-blue-100",I[18]),I[8]?E?(E.p(I,M),M[0]&256&&g(E,1)):(E=jn(I),E.c(),g(E,1),E.m($.parentNode,$)):E&&(X(),b(E,1,1,()=>{E=null}),x())},i(I){S||(g(t.$$.fragment,I),g(v),g(y),g(N),g(z),g(p.$$.fragment,I),g(E),S=!0)},o(I){b(t.$$.fragment,I),b(v),b(y),b(N),b(z),b(p.$$.fragment,I),b(E),S=!1},d(I){I&&h(e),L(t),v&&v.d(),y&&y.d(),N&&N.d(),z&&z.d(),V&&V.d(),L(p),I&&h(k),E&&E.d(I),I&&h($)}}}function pf(i){let e,l;return e=new xt({props:{field:i[1].repeated_field,indent:i[2],schema:i[0]}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n[0]&2&&(f.field=t[1].repeated_field),n[0]&4&&(f.indent=t[2]),n[0]&1&&(f.schema=t[0]),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Pn(i){let e,l,t,n,f;return l=new as({props:{class:"w-3"}}),{c(){e=A("button"),R(l.$$.fragment),this.h()},l(r){e=F(r,"BUTTON",{class:!0});var a=D(e);O(l.$$.fragment,a),a.forEach(h),this.h()},h(){T(e,"class","p-2 transition hover:opacity-60"),se(e,"rotate-180",!i[8])},m(r,a){C(r,e,a),q(l,e,null),t=!0,n||(f=Ve(e,"click",i[24]),n=!0)},p(r,a){(!t||a[0]&256)&&se(e,"rotate-180",!r[8])},i(r){t||(g(l.$$.fragment,r),t=!0)},o(r){b(l.$$.fragment,r),t=!1},d(r){r&&h(e),L(l),n=!1,f()}}}function Rn(i){let e,l;return e=new zt({props:{interactive:!0,type:"green",$$slots:{default:[wf]},$$scope:{ctx:i}}}),e.$on("click",i[25]),e.$on("remove",i[26]),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n[0]&4096|n[1]&8&&(f.$$scope={dirty:n,ctx:t}),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function bf(i){let e,l;return e=new Tt({}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function vf(i){let e,l;return e=new Vt({}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function wf(i){let e,l,t,n,f;const r=[vf,bf],a=[];function s(o,u){return o[12]=="ASC"?0:1}return l=s(i),t=a[l]=r[l](i),{c(){e=Q(`Sorted
`),t.c(),n=le()},l(o){e=J(o,`Sorted
`),t.l(o),n=le()},m(o,u){C(o,e,u),a[l].m(o,u),C(o,n,u),f=!0},p(o,u){let d=l;l=s(o),l!==d&&(X(),b(a[d],1,1,()=>{a[d]=null}),x(),t=a[l],t||(t=a[l]=r[l](o),t.c()),g(t,1),t.m(n.parentNode,n))},i(o){f||(g(t),f=!0)},o(o){b(t),f=!1},d(o){o&&h(e),a[l].d(o),o&&h(n)}}}function qn(i){let e,l,t=i[4],n=[];for(let r=0;r<t.length;r+=1)n[r]=Ln(Bn(i,t,r));const f=r=>b(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;r<n.length;r+=1)n[r].c();e=le()},l(r){for(let a=0;a<n.length;a+=1)n[a].l(r);e=le()},m(r,a){for(let s=0;s<n.length;s+=1)n[s]&&n[s].m(r,a);C(r,e,a),l=!0},p(r,a){if(a[0]&16){t=r[4];let s;for(s=0;s<t.length;s+=1){const o=Bn(r,t,s);n[s]?(n[s].p(o,a),g(n[s],1)):(n[s]=Ln(o),n[s].c(),g(n[s],1),n[s].m(e.parentNode,e))}for(X(),s=t.length;s<n.length;s+=1)f(s);x()}},i(r){if(!l){for(let a=0;a<t.length;a+=1)g(n[a]);l=!0}},o(r){n=n.filter(Boolean);for(let a=0;a<n.length;a+=1)b(n[a]);l=!1},d(r){Fe(n,r),r&&h(e)}}}function Ln(i){let e,l,t,n;return l=new Gt({props:{filter:i[31],hidePath:!0}}),{c(){e=A("div"),R(l.$$.fragment),t=j(),this.h()},l(f){e=F(f,"DIV",{class:!0});var r=D(e);O(l.$$.fragment,r),t=U(r),r.forEach(h),this.h()},h(){T(e,"class","mx-1")},m(f,r){C(f,e,r),q(l,e,null),w(e,t),n=!0},p(f,r){const a={};r[0]&16&&(a.filter=f[31]),l.$set(a)},i(f){n||(g(l.$$.fragment,f),n=!0)},o(f){b(l.$$.fragment,f),n=!1},d(f){f&&h(e),L(l)}}}function On(i){let e,l;return e=new Xt({props:{isPreview:i[9]}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n[0]&512&&(f.isPreview=t[9]),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Hn(i){let e,l=i[1].dtype+"",t,n=i[6]?"[]":"",f;return{c(){e=A("div"),t=Q(l),f=Q(n),this.h()},l(r){e=F(r,"DIV",{class:!0});var a=D(e);t=J(a,l),f=J(a,n),a.forEach(h),this.h()},h(){T(e,"class","w-24 px-2 text-right")},m(r,a){C(r,e,a),w(e,t),w(e,f)},p(r,a){a[0]&2&&l!==(l=r[1].dtype+"")&&ue(t,l),a[0]&64&&n!==(n=r[6]?"[]":"")&&ue(f,n)},d(r){r&&h(e)}}}function jn(i){let e,l,t,n=i[5].length&&Un(i);return{c(){e=A("div"),n&&n.c()},l(f){e=F(f,"DIV",{});var r=D(e);n&&n.l(r),r.forEach(h)},m(f,r){C(f,e,r),n&&n.m(e,null),t=!0},p(f,r){f[5].length?n?(n.p(f,r),r[0]&32&&g(n,1)):(n=Un(f),n.c(),g(n,1),n.m(e,null)):n&&(X(),b(n,1,1,()=>{n=null}),x())},i(f){t||(g(n),f&&kt(()=>{t&&(l||(l=ut(e,mt,{},!0)),l.run(1))}),t=!0)},o(f){b(n),f&&(l||(l=ut(e,mt,{},!1)),l.run(0)),t=!1},d(f){f&&h(e),n&&n.d(),f&&l&&l.end()}}}function Un(i){let e,l,t=i[5],n=[];for(let r=0;r<t.length;r+=1)n[r]=Yn(Fn(i,t,r));const f=r=>b(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;r<n.length;r+=1)n[r].c();e=le()},l(r){for(let a=0;a<n.length;a+=1)n[a].l(r);e=le()},m(r,a){for(let s=0;s<n.length;s+=1)n[s]&&n[s].m(r,a);C(r,e,a),l=!0},p(r,a){if(a[0]&37){t=r[5];let s;for(s=0;s<t.length;s+=1){const o=Fn(r,t,s);n[s]?(n[s].p(o,a),g(n[s],1)):(n[s]=Yn(o),n[s].c(),g(n[s],1),n[s].m(e.parentNode,e))}for(X(),s=t.length;s<n.length;s+=1)f(s);x()}},i(r){if(!l){for(let a=0;a<t.length;a+=1)g(n[a]);l=!0}},o(r){n=n.filter(Boolean);for(let a=0;a<n.length;a+=1)b(n[a]);l=!1},d(r){Fe(n,r),r&&h(e)}}}function Yn(i){let e,l;return e=new xt({props:{schema:i[0],field:i[28],indent:i[2]+1}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n[0]&1&&(f.schema=t[0]),n[0]&32&&(f.field=t[28]),n[0]&4&&(f.indent=t[2]+1),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function kf(i){let e,l,t,n;const f=[pf,gf],r=[];function a(s,o){return s[1].repeated_field?0:1}return e=a(i),l=r[e]=f[e](i),{c(){l.c(),t=le()},l(s){l.l(s),t=le()},m(s,o){r[e].m(s,o),C(s,t,o),n=!0},p(s,o){let u=e;e=a(s),e===u?r[e].p(s,o):(X(),b(r[u],1,1,()=>{r[u]=null}),x(),l=r[e],l?l.p(s,o):(l=r[e]=f[e](s),l.c()),g(l,1),l.m(t.parentNode,t))},i(s){n||(g(l),n=!0)},o(s){b(l),n=!1},d(s){r[e].d(s),s&&h(t)}}}function Sf(i,e,l){let t,n,f,r,a,s,o,u,d,c,m,_,p,k,$,S,v,{schema:y}=e,{field:N}=e,{indent:z=0}=e;const V=Re();he(i,V,W=>l(7,v=W));const E=We();he(i,E,W=>l(22,S=W));let B=!0;function I(W){return W!=null&&W.fields?Object.values(W.fields).filter(te=>te.path.at(-1)!==_i):[]}const M=()=>{d?V.removeSelectedColumn(t):V.addSelectedColumn(t)},P=()=>l(8,B=!B),K=()=>m==="ASC"?ot(V,v.query.sort_order="DESC",v):ot(V,v.query.sort_order="ASC",v),ne=()=>V.removeSortBy(t);return i.$$set=W=>{"schema"in W&&l(0,y=W.schema),"field"in W&&l(1,N=W.field),"indent"in W&&l(2,z=W.indent)},i.$$.update=()=>{var W,te,G,ee;i.$$.dirty[0]&2&&l(3,t=N.path),i.$$.dirty[0]&3&&l(21,n=Hi(y,N.path.slice(0,-1))),i.$$.dirty[0]&3&&l(18,f=Ge(N,y)),i.$$.dirty[0]&2&&l(6,a=N.path.at(-1)===$t),i.$$.dirty[0]&2097218&&l(17,r=a&&n?dt(n):dt(N)),i.$$.dirty[0]&66&&l(16,s=a?N.path.at(-2):N.path.at(-1)),i.$$.dirty[0]&2&&l(5,o=I(N)),i.$$.dirty[0]&32&&l(15,u=o.length>0),i.$$.dirty[0]&4194312&&l(14,d=(W=S.visibleFields)==null?void 0:W.some(we=>Qe(we.path,t))),i.$$.dirty[0]&136&&l(13,c=(te=v.query.sort_by)==null?void 0:te.some(we=>Qe(we,t))),i.$$.dirty[0]&128&&l(12,m=v.query.sort_order),i.$$.dirty[0]&136&&l(4,_=((G=v.query.filters)==null?void 0:G.filter(we=>Qe(we.path,t)))||[]),i.$$.dirty[0]&16&&l(11,p=_.length>0),i.$$.dirty[0]&2&&l(10,k=!N.dtype||N.dtype==="embedding"),i.$$.dirty[0]&4194312&&l(9,$=Ct(((ee=S.selectRowsSchema)==null?void 0:ee.data)||null,t))},[y,N,z,t,_,o,a,v,B,$,k,p,m,c,d,u,s,r,f,V,E,n,S,M,P,K,ne]}class xt extends ge{constructor(e){super(),pe(this,e,Sf,kf,_e,{schema:0,field:1,indent:2},null,[-1,-1])}}function Wn(i,e,l){const t=i.slice();return t[3]=e[l],t}function Qn(i,e,l){const t=i.slice();return t[3]=e[l],t}function Ef(i){let e,l,t,n,f,r;return e=new Ft({props:{label:"Schema",class:"w-1/3"}}),t=new Ft({props:{label:"Tree View",class:"w-1/3"}}),f=new Ft({props:{label:"Raw Query",class:"w-1/3"}}),{c(){R(e.$$.fragment),l=j(),R(t.$$.fragment),n=j(),R(f.$$.fragment)},l(a){O(e.$$.fragment,a),l=U(a),O(t.$$.fragment,a),n=U(a),O(f.$$.fragment,a)},m(a,s){q(e,a,s),C(a,l,s),q(t,a,s),C(a,n,s),q(f,a,s),r=!0},p:Z,i(a){r||(g(e.$$.fragment,a),g(t.$$.fragment,a),g(f.$$.fragment,a),r=!0)},o(a){b(e.$$.fragment,a),b(t.$$.fragment,a),b(f.$$.fragment,a),r=!1},d(a){L(e,a),a&&h(l),L(t,a),a&&h(n),L(f,a)}}}function yf(i){let e=[],l=new Map,t,n,f=Object.keys(i[0].data.schema.fields);const r=a=>a[3];for(let a=0;a<f.length;a+=1){let s=Qn(i,f,a),o=r(s);l.set(o,e[a]=Jn(o,s))}return{c(){for(let a=0;a<e.length;a+=1)e[a].c();t=le()},l(a){for(let s=0;s<e.length;s+=1)e[s].l(a);t=le()},m(a,s){for(let o=0;o<e.length;o+=1)e[o]&&e[o].m(a,s);C(a,t,s),n=!0},p(a,s){s&1&&(f=Object.keys(a[0].data.schema.fields),X(),e=gt(e,s,r,1,a,f,l,t.parentNode,pt,Jn,t,Qn),x())},i(a){if(!n){for(let s=0;s<f.length;s+=1)g(e[s]);n=!0}},o(a){for(let s=0;s<e.length;s+=1)b(e[s]);n=!1},d(a){for(let s=0;s<e.length;s+=1)e[s].d(a);a&&h(t)}}}function $f(i){let e,l;return e=new Le({props:{paragraph:!0,lines:3}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Jn(i,e){let l,t,n;return t=new $i({props:{schema:e[0].data.schema,field:e[0].data.schema.fields[e[3]]}}),{key:i,first:null,c(){l=le(),R(t.$$.fragment),this.h()},l(f){l=le(),O(t.$$.fragment,f),this.h()},h(){this.first=l},m(f,r){C(f,l,r),q(t,f,r),n=!0},p(f,r){e=f;const a={};r&1&&(a.schema=e[0].data.schema),r&1&&(a.field=e[0].data.schema.fields[e[3]]),t.$set(a)},i(f){n||(g(t.$$.fragment,f),n=!0)},o(f){b(t.$$.fragment,f),n=!1},d(f){f&&h(l),L(t,f)}}}function Df(i){let e,l,t,n;const f=[$f,yf],r=[];function a(s,o){var u,d;return(u=s[0])!=null&&u.isLoading?0:(d=s[0])!=null&&d.isSuccess&&s[0].data.schema.fields!=null?1:-1}return~(e=a(i))&&(l=r[e]=f[e](i)),{c(){l&&l.c(),t=le()},l(s){l&&l.l(s),t=le()},m(s,o){~e&&r[e].m(s,o),C(s,t,o),n=!0},p(s,o){let u=e;e=a(s),e===u?~e&&r[e].p(s,o):(l&&(X(),b(r[u],1,1,()=>{r[u]=null}),x()),~e?(l=r[e],l?l.p(s,o):(l=r[e]=f[e](s),l.c()),g(l,1),l.m(t.parentNode,t)):l=null)},i(s){n||(g(l),n=!0)},o(s){b(l),n=!1},d(s){~e&&r[e].d(s),s&&h(t)}}}function If(i){let e=[],l=new Map,t,n,f=Object.keys(i[0].data.schema.fields);const r=a=>a[3];for(let a=0;a<f.length;a+=1){let s=Wn(i,f,a),o=r(s);l.set(o,e[a]=Kn(o,s))}return{c(){for(let a=0;a<e.length;a+=1)e[a].c();t=le()},l(a){for(let s=0;s<e.length;s+=1)e[s].l(a);t=le()},m(a,s){for(let o=0;o<e.length;o+=1)e[o]&&e[o].m(a,s);C(a,t,s),n=!0},p(a,s){s&1&&(f=Object.keys(a[0].data.schema.fields),X(),e=gt(e,s,r,1,a,f,l,t.parentNode,pt,Kn,t,Wn),x())},i(a){if(!n){for(let s=0;s<f.length;s+=1)g(e[s]);n=!0}},o(a){for(let s=0;s<e.length;s+=1)b(e[s]);n=!1},d(a){for(let s=0;s<e.length;s+=1)e[s].d(a);a&&h(t)}}}function Vf(i){let e,l;return e=new Le({props:{paragraph:!0,lines:3}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Kn(i,e){let l,t,n;return t=new xt({props:{schema:e[0].data.schema,field:e[0].data.schema.fields[e[3]]}}),{key:i,first:null,c(){l=le(),R(t.$$.fragment),this.h()},l(f){l=le(),O(t.$$.fragment,f),this.h()},h(){this.first=l},m(f,r){C(f,l,r),q(t,f,r),n=!0},p(f,r){e=f;const a={};r&1&&(a.schema=e[0].data.schema),r&1&&(a.field=e[0].data.schema.fields[e[3]]),t.$set(a)},i(f){n||(g(t.$$.fragment,f),n=!0)},o(f){b(t.$$.fragment,f),n=!1},d(f){f&&h(l),L(t,f)}}}function Tf(i){let e,l,t,n;const f=[Vf,If],r=[];function a(s,o){var u,d;return(u=s[0])!=null&&u.isLoading?0:(d=s[0])!=null&&d.isSuccess&&s[0].data.schema.fields!=null?1:-1}return~(e=a(i))&&(l=r[e]=f[e](i)),{c(){l&&l.c(),t=le()},l(s){l&&l.l(s),t=le()},m(s,o){~e&&r[e].m(s,o),C(s,t,o),n=!0},p(s,o){let u=e;e=a(s),e===u?~e&&r[e].p(s,o):(l&&(X(),b(r[u],1,1,()=>{r[u]=null}),x()),~e?(l=r[e],l?l.p(s,o):(l=r[e]=f[e](s),l.c()),g(l,1),l.m(t.parentNode,t)):l=null)},i(s){n||(g(l),n=!0)},o(s){b(l),n=!1},d(s){~e&&r[e].d(s),s&&h(t)}}}function Cf(i){let e,l;return e=new Ua({}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Nf(i){let e,l,t,n,f,r,a;return l=new Bt({props:{$$slots:{default:[Df]},$$scope:{ctx:i}}}),n=new Bt({props:{$$slots:{default:[Tf]},$$scope:{ctx:i}}}),r=new Bt({props:{$$slots:{default:[Cf]},$$scope:{ctx:i}}}),{c(){e=A("div"),R(l.$$.fragment),t=j(),R(n.$$.fragment),f=j(),R(r.$$.fragment),this.h()},l(s){e=F(s,"DIV",{class:!0,slot:!0});var o=D(e);O(l.$$.fragment,o),t=U(o),O(n.$$.fragment,o),f=U(o),O(r.$$.fragment,o),o.forEach(h),this.h()},h(){T(e,"class","h-full overflow-y-auto"),T(e,"slot","content")},m(s,o){C(s,e,o),q(l,e,null),w(e,t),q(n,e,null),w(e,f),q(r,e,null),a=!0},p(s,o){const u={};o&257&&(u.$$scope={dirty:o,ctx:s}),l.$set(u);const d={};o&257&&(d.$$scope={dirty:o,ctx:s}),n.$set(d);const c={};o&256&&(c.$$scope={dirty:o,ctx:s}),r.$set(c)},i(s){a||(g(l.$$.fragment,s),g(n.$$.fragment,s),g(r.$$.fragment,s),a=!0)},o(s){b(l.$$.fragment,s),b(n.$$.fragment,s),b(r.$$.fragment,s),a=!1},d(s){s&&h(e),L(l),L(n),L(r)}}}function Mf(i){let e,l,t;return l=new Jr({props:{class:"overflow-hidden border-b border-gray-200",$$slots:{content:[Nf],default:[Ef]},$$scope:{ctx:i}}}),{c(){e=A("div"),R(l.$$.fragment),this.h()},l(n){e=F(n,"DIV",{class:!0});var f=D(e);O(l.$$.fragment,f),f.forEach(h),this.h()},h(){T(e,"class","flex h-full flex-col pt-4")},m(n,f){C(n,e,f),q(l,e,null),t=!0},p(n,[f]){const r={};f&257&&(r.$$scope={dirty:f,ctx:n}),l.$set(r)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){b(l.$$.fragment,n),t=!1},d(n){n&&h(e),L(l)}}}function zf(i,e,l){let t,n;const f=We();return he(i,f,r=>l(2,n=r)),i.$$.update=()=>{i.$$.dirty&4&&l(0,t=n.selectRowsSchema)},[t,f,n]}class Af extends ge{constructor(e){super(),pe(this,e,zf,Mf,_e,{})}}function Zn(i,e,l){const t=i.slice();return t[4]=e[l],t}function Ff(i){let e,l="{}",t;return{c(){e=A("span"),t=Q(l),this.h()},l(n){e=F(n,"SPAN",{class:!0});var f=D(e);t=J(f,l),f.forEach(h),this.h()},h(){T(e,"class","font-mono")},m(n,f){C(n,e,f),w(e,t)},p:Z,i:Z,o:Z,d(n){n&&h(e)}}}function Bf(i){let e,l,t;var n=ht[i[4].dtype];function f(r){return{props:{title:r[4].dtype}}}return n&&(e=ct(n,f(i))),{c(){e&&R(e.$$.fragment),l=le()},l(r){e&&O(e.$$.fragment,r),l=le()},m(r,a){e&&q(e,r,a),C(r,l,a),t=!0},p(r,a){const s={};if(a&2&&(s.title=r[4].dtype),a&2&&n!==(n=ht[r[4].dtype])){if(e){X();const o=e;b(o.$$.fragment,1,0,()=>{L(o,1)}),x()}n?(e=ct(n,f(r)),R(e.$$.fragment),g(e.$$.fragment,1),q(e,l.parentNode,l)):e=null}else n&&e.$set(s)},i(r){t||(e&&g(e.$$.fragment,r),t=!0)},o(r){e&&b(e.$$.fragment,r),t=!1},d(r){r&&h(l),e&&L(e,r)}}}function Gn(i){let e;return{c(){e=Q("[]")},l(l){e=J(l,"[]")},m(l,t){C(l,e,t)},d(l){l&&h(e)}}}function Xn(i){let e,l,t,n,f,r,a,s,o,u=i[4].path.indexOf($t)>=0,d,c,m=Ie(i[4].path)+"",_,p,k;function $(...z){return i[3](i[4],...z)}t=new Wt({props:{labelText:"Download",hideLabel:!0,checked:i[0].indexOf(i[4])>=0}}),t.$on("change",$);const S=[Bf,Ff],v=[];function y(z,V){return z[4].dtype?0:1}a=y(i),s=v[a]=S[a](i);let N=u&&Gn();return{c(){e=A("div"),l=A("div"),R(t.$$.fragment),n=j(),f=A("div"),r=A("div"),s.c(),o=j(),N&&N.c(),d=j(),c=A("div"),_=Q(m),p=j(),this.h()},l(z){e=F(z,"DIV",{class:!0});var V=D(e);l=F(V,"DIV",{class:!0});var E=D(l);O(t.$$.fragment,E),E.forEach(h),n=U(V),f=F(V,"DIV",{class:!0});var B=D(f);r=F(B,"DIV",{class:!0});var I=D(r);s.l(I),o=U(I),N&&N.l(I),I.forEach(h),B.forEach(h),d=U(V),c=F(V,"DIV",{class:!0});var M=D(c);_=J(M,m),M.forEach(h),p=U(V),V.forEach(h),this.h()},h(){T(l,"class","mr-2"),T(r,"class","inline-flex items-center rounded-md bg-blue-200 p-0.5"),T(f,"class","flex w-10"),T(c,"class","flex-grow"),T(e,"class","flex items-center")},m(z,V){C(z,e,V),w(e,l),q(t,l,null),w(e,n),w(e,f),w(f,r),v[a].m(r,null),w(r,o),N&&N.m(r,null),w(e,d),w(e,c),w(c,_),w(e,p),k=!0},p(z,V){i=z;const E={};V&3&&(E.checked=i[0].indexOf(i[4])>=0),t.$set(E);let B=a;a=y(i),a===B?v[a].p(i,V):(X(),b(v[B],1,1,()=>{v[B]=null}),x(),s=v[a],s?s.p(i,V):(s=v[a]=S[a](i),s.c()),g(s,1),s.m(r,o)),V&2&&(u=i[4].path.indexOf($t)>=0),u?N||(N=Gn(),N.c(),N.m(r,null)):N&&(N.d(1),N=null),(!k||V&2)&&m!==(m=Ie(i[4].path)+"")&&ue(_,m)},i(z){k||(g(t.$$.fragment,z),g(s),k=!0)},o(z){b(t.$$.fragment,z),b(s),k=!1},d(z){z&&h(e),L(t),v[a].d(),N&&N.d()}}}function Pf(i){let e,l,t=i[1],n=[];for(let r=0;r<t.length;r+=1)n[r]=Xn(Zn(i,t,r));const f=r=>b(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;r<n.length;r+=1)n[r].c();e=le()},l(r){for(let a=0;a<n.length;a+=1)n[a].l(r);e=le()},m(r,a){for(let s=0;s<n.length;s+=1)n[s]&&n[s].m(r,a);C(r,e,a),l=!0},p(r,[a]){if(a&7){t=r[1];let s;for(s=0;s<t.length;s+=1){const o=Zn(r,t,s);n[s]?(n[s].p(o,a),g(n[s],1)):(n[s]=Xn(o),n[s].c(),g(n[s],1),n[s].m(e.parentNode,e))}for(X(),s=t.length;s<n.length;s+=1)f(s);x()}},i(r){if(!l){for(let a=0;a<t.length;a+=1)g(n[a]);l=!0}},o(r){n=n.filter(Boolean);for(let a=0;a<n.length;a+=1)b(n[a]);l=!1},d(r){Fe(n,r),r&&h(e)}}}function Rf(i,e,l){let{fields:t}=e,{checkedFields:n}=e;function f(a,s){s.target.checked?(n.push(a),l(0,n)):l(0,n=n.filter(u=>u!==a))}const r=(a,s)=>f(a,s);return i.$$set=a=>{"fields"in a&&l(1,t=a.fields),"checkedFields"in a&&l(0,n=a.checkedFields)},[n,t,f,r]}class el extends ge{constructor(e){super(),pe(this,e,Rf,Pf,_e,{fields:1,checkedFields:0})}}function xn(i,e,l){const t=i.slice();return t[19]=e[l],t}function qf(i){let e,l,t,n,f,r,a,s,o,u,d,c,m,_,p,k,$,S,v,y,N=i[1]!=null&&ei(i);const z=[Hf,Of],V=[];function E(B,I){return B[5].isFetching?0:1}return S=E(i),v=V[S]=z[S](i),{c(){e=A("div"),l=A("section"),t=A("div"),n=Q("Media fields"),f=j(),r=A("div"),a=Q("These fields will be presented differently from the rest of the metadata fields."),s=j(),N&&N.c(),o=j(),u=A("section"),d=A("div"),c=Q("Preferred embedding"),m=j(),_=A("div"),p=Q("This embedding will be used by default when indexing and querying the data."),k=j(),$=A("div"),v.c(),this.h()},l(B){e=F(B,"DIV",{class:!0});var I=D(e);l=F(I,"SECTION",{class:!0});var M=D(l);t=F(M,"DIV",{class:!0});var P=D(t);n=J(P,"Media fields"),P.forEach(h),f=U(M),r=F(M,"DIV",{class:!0});var K=D(r);a=J(K,"These fields will be presented differently from the rest of the metadata fields."),K.forEach(h),s=U(M),N&&N.l(M),M.forEach(h),o=U(I),u=F(I,"SECTION",{class:!0});var ne=D(u);d=F(ne,"DIV",{class:!0});var W=D(d);c=J(W,"Preferred embedding"),W.forEach(h),m=U(ne),_=F(ne,"DIV",{class:!0});var te=D(_);p=J(te,"This embedding will be used by default when indexing and querying the data."),te.forEach(h),k=U(ne),$=F(ne,"DIV",{class:!0});var G=D($);v.l(G),G.forEach(h),ne.forEach(h),I.forEach(h),this.h()},h(){T(t,"class","text-lg text-gray-700"),T(r,"class","text-sm text-gray-500"),T(l,"class","flex flex-col gap-y-1"),T(d,"class","text-lg text-gray-700"),T(_,"class","text-sm text-gray-500"),T($,"class","w-60"),T(u,"class","flex flex-col gap-y-1"),T(e,"class","flex flex-col gap-y-6")},m(B,I){C(B,e,I),w(e,l),w(l,t),w(t,n),w(l,f),w(l,r),w(r,a),w(l,s),N&&N.m(l,null),w(e,o),w(e,u),w(u,d),w(d,c),w(u,m),w(u,_),w(_,p),w(u,k),w(u,$),V[S].m($,null),y=!0},p(B,I){B[1]!=null?N?(N.p(B,I),I&2&&g(N,1)):(N=ei(B),N.c(),g(N,1),N.m(l,null)):N&&(X(),b(N,1,1,()=>{N=null}),x());let M=S;S=E(B),S===M?V[S].p(B,I):(X(),b(V[M],1,1,()=>{V[M]=null}),x(),v=V[S],v?v.p(B,I):(v=V[S]=z[S](B),v.c()),g(v,1),v.m($,null))},i(B){y||(g(N),g(v),y=!0)},o(B){b(N),b(v),y=!1},d(B){B&&h(e),N&&N.d(),V[S].d()}}}function Lf(i){let e,l;return e=new Le({}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function ei(i){let e,l,t;function n(r){i[14](r)}let f={fields:i[2]};return i[1]!==void 0&&(f.checkedFields=i[1]),e=new el({props:f}),Pe.push(()=>et(e,"checkedFields",n)),{c(){R(e.$$.fragment)},l(r){O(e.$$.fragment,r)},m(r,a){q(e,r,a),t=!0},p(r,a){const s={};a&4&&(s.fields=r[2]),!l&&a&2&&(l=!0,s.checkedFields=r[1],tt(()=>l=!1)),e.$set(s)},i(r){t||(g(e.$$.fragment,r),t=!0)},o(r){b(e.$$.fragment,r),t=!1},d(r){L(e,r)}}}function Of(i){var t;let e,l;return e=new Jt({props:{selected:(t=i[3].data)==null?void 0:t.preferred_embedding,$$slots:{default:[jf]},$$scope:{ctx:i}}}),e.$on("change",i[10]),{c(){R(e.$$.fragment)},l(n){O(e.$$.fragment,n)},m(n,f){q(e,n,f),l=!0},p(n,f){var a;const r={};f&8&&(r.selected=(a=n[3].data)==null?void 0:a.preferred_embedding),f&4194336&&(r.$$scope={dirty:f,ctx:n}),e.$set(r)},i(n){l||(g(e.$$.fragment,n),l=!0)},o(n){b(e.$$.fragment,n),l=!1},d(n){L(e,n)}}}function Hf(i){let e,l;return e=new Nr({}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function ti(i){let e,l;return e=new Nt({props:{value:i[19].name}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n&32&&(f.value=t[19].name),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function jf(i){let e,l,t,n;e=new Nt({props:{value:void 0,text:"None"}});let f=i[5].data||[],r=[];for(let s=0;s<f.length;s+=1)r[s]=ti(xn(i,f,s));const a=s=>b(r[s],1,1,()=>{r[s]=null});return{c(){R(e.$$.fragment),l=j();for(let s=0;s<r.length;s+=1)r[s].c();t=le()},l(s){O(e.$$.fragment,s),l=U(s);for(let o=0;o<r.length;o+=1)r[o].l(s);t=le()},m(s,o){q(e,s,o),C(s,l,o);for(let u=0;u<r.length;u+=1)r[u]&&r[u].m(s,o);C(s,t,o),n=!0},p(s,o){if(o&32){f=s[5].data||[];let u;for(u=0;u<f.length;u+=1){const d=xn(s,f,u);r[u]?(r[u].p(d,o),g(r[u],1)):(r[u]=ti(d),r[u].c(),g(r[u],1),r[u].m(t.parentNode,t))}for(X(),u=f.length;u<r.length;u+=1)a(u);x()}},i(s){if(!n){g(e.$$.fragment,s);for(let o=0;o<f.length;o+=1)g(r[o]);n=!0}},o(s){b(e.$$.fragment,s),r=r.filter(Boolean);for(let o=0;o<r.length;o+=1)b(r[o]);n=!1},d(s){L(e,s),s&&h(l),Fe(r,s),s&&h(t)}}}function Uf(i){let e,l,t,n;const f=[Lf,qf],r=[];function a(s,o){return s[3].isFetching?0:1}return e=a(i),l=r[e]=f[e](i),{c(){l.c(),t=le()},l(s){l.l(s),t=le()},m(s,o){r[e].m(s,o),C(s,t,o),n=!0},p(s,o){let u=e;e=a(s),e===u?r[e].p(s,o):(X(),b(r[u],1,1,()=>{r[u]=null}),x(),l=r[e],l?l.p(s,o):(l=r[e]=f[e](s),l.c()),g(l,1),l.m(t.parentNode,t))},i(s){n||(g(l),n=!0)},o(s){b(l),n=!1},d(s){r[e].d(s),s&&h(t)}}}function Yf(i){let e,l,t,n,f,r;return e=new bi({props:{label:"Changes",title:"Dataset settings"}}),t=new vi({props:{hasForm:!0,$$slots:{default:[Uf]},$$scope:{ctx:i}}}),f=new wi({props:{primaryButtonText:"Save"}}),{c(){R(e.$$.fragment),l=j(),R(t.$$.fragment),n=j(),R(f.$$.fragment)},l(a){O(e.$$.fragment,a),l=U(a),O(t.$$.fragment,a),n=U(a),O(f.$$.fragment,a)},m(a,s){q(e,a,s),C(a,l,s),q(t,a,s),C(a,n,s),q(f,a,s),r=!0},p(a,s){const o={};s&4194350&&(o.$$scope={dirty:s,ctx:a}),t.$set(o)},i(a){r||(g(e.$$.fragment,a),g(t.$$.fragment,a),g(f.$$.fragment,a),r=!0)},o(a){b(e.$$.fragment,a),b(t.$$.fragment,a),b(f.$$.fragment,a),r=!1},d(a){L(e,a),a&&h(l),L(t,a),a&&h(n),L(f,a)}}}function Wf(i){let e,l;return e=new pi({props:{open:i[0],$$slots:{default:[Yf]},$$scope:{ctx:i}}}),e.$on("submit",i[11]),e.$on("close",i[15]),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,[n]){const f={};n&1&&(f.open=t[0]),n&4194350&&(f.$$scope={dirty:n,ctx:t}),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Qf(i,e,l){let t,n,f,r,a,s=Z,o=()=>(s(),s=Be(t,E=>l(3,a=E)),t),u,d;i.$$.on_destroy.push(()=>s());let{open:c=!1}=e,{schema:m}=e;const _=Re();he(i,_,E=>l(13,f=E));const p=Si();he(i,p,E=>l(18,u=E));const k=Zt();he(i,k,E=>l(5,d=E));const $=ji();he(i,$,E=>l(17,r=E));let S=null,v=u.embedding;function y(E){v=E.target.value,v===""&&(v=void 0)}function N(){if(S==null)return;const E={ui:{media_paths:S.map(B=>B.path)},preferred_embedding:v};r.mutate([f.namespace,f.datasetName,E],{onSuccess:()=>{l(0,c=!1)}})}function z(E){S=E,l(1,S),l(3,a),l(2,n),l(12,m)}const V=()=>l(0,c=!1);return i.$$set=E=>{"open"in E&&l(0,c=E.open),"schema"in E&&l(12,m=E.schema)},i.$$.update=()=>{var E,B;if(i.$$.dirty&8192&&o(l(4,t=jt(f.namespace,f.datasetName))),i.$$.dirty&4096&&l(2,n=Ot(m).filter(I=>I.dtype==="string"&&!Qe(I.path,[Ht])&&!Ge(I,m))),i.$$.dirty&14&&S==null){const I=((B=(E=a.data)==null?void 0:E.ui)==null?void 0:B.media_paths)||[];l(1,S=n.filter(M=>I.some(P=>Qe(M.path,P))))}},[c,S,n,a,t,d,_,p,k,$,y,N,m,f,z,V]}class Jf extends ge{constructor(e){super(),pe(this,e,Qf,Wf,_e,{open:0,schema:12})}}function Kf(i){let e,l,t;function n(r){i[13](r)}let f={fields:i[6]};return i[1]!==void 0&&(f.checkedFields=i[1]),e=new el({props:f}),Pe.push(()=>et(e,"checkedFields",n)),{c(){R(e.$$.fragment)},l(r){O(e.$$.fragment,r)},m(r,a){q(e,r,a),t=!0},p(r,a){const s={};a&64&&(s.fields=r[6]),!l&&a&2&&(l=!0,s.checkedFields=r[1],tt(()=>l=!1)),e.$set(s)},i(r){t||(g(e.$$.fragment,r),t=!0)},o(r){b(e.$$.fragment,r),t=!1},d(r){L(e,r)}}}function Zf(i){let e,l;return e=new Le({}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function li(i){let e,l,t,n,f,r,a;const s=[Xf,Gf],o=[];function u(d,c){return d[5]==null?0:1}return f=u(i),r=o[f]=s[f](i),{c(){e=A("section"),l=A("h4"),t=Q("Select enriched fields"),n=j(),r.c(),this.h()},l(d){e=F(d,"SECTION",{});var c=D(e);l=F(c,"H4",{class:!0});var m=D(l);t=J(m,"Select enriched fields"),m.forEach(h),n=U(c),r.l(c),c.forEach(h),this.h()},h(){T(l,"class","svelte-1ge817j")},m(d,c){C(d,e,c),w(e,l),w(l,t),w(e,n),o[f].m(e,null),a=!0},p(d,c){let m=f;f=u(d),f===m?o[f].p(d,c):(X(),b(o[m],1,1,()=>{o[m]=null}),x(),r=o[f],r?r.p(d,c):(r=o[f]=s[f](d),r.c()),g(r,1),r.m(e,null))},i(d){a||(g(r),a=!0)},o(d){b(r),a=!1},d(d){d&&h(e),o[f].d()}}}function Gf(i){let e,l,t;function n(r){i[14](r)}let f={fields:i[5]};return i[2]!==void 0&&(f.checkedFields=i[2]),e=new el({props:f}),Pe.push(()=>et(e,"checkedFields",n)),{c(){R(e.$$.fragment)},l(r){O(e.$$.fragment,r)},m(r,a){q(e,r,a),t=!0},p(r,a){const s={};a&32&&(s.fields=r[5]),!l&&a&4&&(l=!0,s.checkedFields=r[2],tt(()=>l=!1)),e.$set(s)},i(r){t||(g(e.$$.fragment,r),t=!0)},o(r){b(e.$$.fragment,r),t=!1},d(r){L(e,r)}}}function Xf(i){let e,l;return e=new Le({}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function ni(i){let e,l;return{c(){e=A("p"),l=Q("No fields selected. Please select at least one field to download."),this.h()},l(t){e=F(t,"P",{class:!0});var n=D(e);l=J(n,"No fields selected. Please select at least one field to download."),n.forEach(h),this.h()},h(){T(e,"class","text-gray-600")},m(t,n){C(t,e,n),w(e,l)},d(t){t&&h(e)}}}function xf(i){let e,l;return e=new dr({props:{value:JSON.stringify(i[7].data,null,2),readonly:!0,rows:30,placeholder:"3 rows of data for previewing the response",class:"mb-2 font-mono"}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n&128&&(f.value=JSON.stringify(t[7].data,null,2)),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function eo(i){let e,l;return e=new Le({props:{paragraph:!0}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function to(i){let e,l,t,n,f,r,a,s,o,u,d,c,m,_,p,k,$;const S=[Zf,Kf],v=[];function y(I,M){return I[6]==null?0:1}f=y(i),r=v[f]=S[f](i);let N=(i[5]==null||i[5].length>0)&&li(i),z=i[3].length===0&&ni();const V=[eo,xf],E=[];function B(I,M){return I[7]&&I[7].isFetching?0:I[4]&&I[7]?1:-1}return~(p=B(i))&&(k=E[p]=V[p](i)),{c(){e=A("section"),l=A("h4"),t=Q("Select source fields"),n=j(),r.c(),a=j(),N&&N.c(),s=j(),o=A("section"),u=A("h4"),d=Q("Download preview"),c=j(),z&&z.c(),m=j(),_=A("div"),k&&k.c(),this.h()},l(I){e=F(I,"SECTION",{});var M=D(e);l=F(M,"H4",{class:!0});var P=D(l);t=J(P,"Select source fields"),P.forEach(h),n=U(M),r.l(M),M.forEach(h),a=U(I),N&&N.l(I),s=U(I),o=F(I,"SECTION",{});var K=D(o);u=F(K,"H4",{class:!0});var ne=D(u);d=J(ne,"Download preview"),ne.forEach(h),c=U(K),z&&z.l(K),m=U(K),_=F(K,"DIV",{class:!0});var W=D(_);k&&k.l(W),W.forEach(h),K.forEach(h),this.h()},h(){T(l,"class","svelte-1ge817j"),T(u,"class","svelte-1ge817j"),T(_,"class","preview svelte-1ge817j")},m(I,M){C(I,e,M),w(e,l),w(l,t),w(e,n),v[f].m(e,null),C(I,a,M),N&&N.m(I,M),C(I,s,M),C(I,o,M),w(o,u),w(u,d),w(o,c),z&&z.m(o,null),w(o,m),w(o,_),~p&&E[p].m(_,null),$=!0},p(I,M){let P=f;f=y(I),f===P?v[f].p(I,M):(X(),b(v[P],1,1,()=>{v[P]=null}),x(),r=v[f],r?r.p(I,M):(r=v[f]=S[f](I),r.c()),g(r,1),r.m(e,null)),I[5]==null||I[5].length>0?N?(N.p(I,M),M&32&&g(N,1)):(N=li(I),N.c(),g(N,1),N.m(s.parentNode,s)):N&&(X(),b(N,1,1,()=>{N=null}),x()),I[3].length===0?z||(z=ni(),z.c(),z.m(o,m)):z&&(z.d(1),z=null);let K=p;p=B(I),p===K?~p&&E[p].p(I,M):(k&&(X(),b(E[K],1,1,()=>{E[K]=null}),x()),~p?(k=E[p],k?k.p(I,M):(k=E[p]=V[p](I),k.c()),g(k,1),k.m(_,null)):k=null)},i(I){$||(g(r),g(N),g(k),$=!0)},o(I){b(r),b(N),b(k),$=!1},d(I){I&&h(e),v[f].d(),I&&h(a),N&&N.d(I),I&&h(s),I&&h(o),z&&z.d(),~p&&E[p].d()}}}function lo(i){let e,l,t,n,f,r;return e=new bi({props:{title:"Download data"}}),t=new vi({props:{hasForm:!0,$$slots:{default:[to]},$$scope:{ctx:i}}}),f=new wi({props:{primaryButtonText:"Download",primaryButtonDisabled:i[3].length===0,secondaryButtonText:"Cancel"}}),f.$on("click:button--secondary",i[10]),{c(){R(e.$$.fragment),l=j(),R(t.$$.fragment),n=j(),R(f.$$.fragment)},l(a){O(e.$$.fragment,a),l=U(a),O(t.$$.fragment,a),n=U(a),O(f.$$.fragment,a)},m(a,s){q(e,a,s),C(a,l,s),q(t,a,s),C(a,n,s),q(f,a,s),r=!0},p(a,s){const o={};s&262398&&(o.$$scope={dirty:s,ctx:a}),t.$set(o);const u={};s&8&&(u.primaryButtonDisabled=a[3].length===0),f.$set(u)},i(a){r||(g(e.$$.fragment,a),g(t.$$.fragment,a),g(f.$$.fragment,a),r=!0)},o(a){b(e.$$.fragment,a),b(t.$$.fragment,a),b(f.$$.fragment,a),r=!1},d(a){L(e,a),a&&h(l),L(t,a),a&&h(n),L(f,a)}}}function no(i){let e,l;return e=new pi({props:{size:"lg",open:i[0],$$slots:{default:[lo]},$$scope:{ctx:i}}}),e.$on("submit",i[9]),e.$on("close",i[15]),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,[n]){const f={};n&1&&(f.open=t[0]),n&262398&&(f.$$scope={dirty:n,ctx:t}),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function io(i,e,l){let t,n,f,r,a,s,o=Z,u=()=>(o(),o=Be(r,V=>l(7,s=V)),r);i.$$.on_destroy.push(()=>o());let{open:d=!1}=e,{schema:c}=e;const m=_t(),_=Re();he(i,_,V=>l(12,a=V));let p=[],k=[];function $(V){if(V==null)return{sourceFields:null,enrichedFields:null};const E=Ot(V).filter(M=>["string_span","embedding"].indexOf(M.dtype)===-1),B=E.filter(M=>!Ge(M,V)&&M.path.at(-1)!==Ht),I=E.filter(M=>Ge(M,V));return{sourceFields:B,enrichedFields:I}}async function S(){const V=a.namespace,E=a.datasetName,B={combine_columns:!1,columns:f.map(P=>P.path)},I=`/api/v1/datasets/${V}/${E}/select_rows_download?url_safe_options=${encodeURIComponent(JSON.stringify(B))}`,M=document.createElement("a");M.download=`${V}_${E}.json`,M.href=I,document.body.appendChild(M),M.click(),M.remove()}function v(){l(0,d=!1),m("close")}function y(V){p=V,l(1,p)}function N(V){k=V,l(2,k)}const z=()=>l(0,d=!1);return i.$$set=V=>{"open"in V&&l(0,d=V.open),"schema"in V&&l(11,c=V.schema)},i.$$.update=()=>{i.$$.dirty&2048&&l(6,{sourceFields:t,enrichedFields:n}=$(c),t,(l(5,n),l(11,c))),i.$$.dirty&6&&l(3,f=[...p,...k]),i.$$.dirty&4104&&u(l(4,r=f.length>0?Ui(a.namespace,a.datasetName,{columns:f.map(V=>V.path),limit:3,combine_columns:!1}):null))},[d,p,k,f,r,n,t,s,_,S,v,c,a,y,N,z]}class ro extends ge{constructor(e){super(),pe(this,e,io,no,_e,{open:0,schema:11})}}function so(i){let e,l;return e=new ms({}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function ao(i){let e,l;return e=new us({}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function ii(i){let e,l,t,n,f,r;function a(d){i[23](d)}let s={schema:i[2].data};i[3]!==void 0&&(s.open=i[3]),e=new Jf({props:s}),Pe.push(()=>et(e,"open",a));function o(d){i[24](d)}let u={schema:i[2].data};return i[4]!==void 0&&(u.open=i[4]),n=new ro({props:u}),Pe.push(()=>et(n,"open",o)),{c(){R(e.$$.fragment),t=j(),R(n.$$.fragment)},l(d){O(e.$$.fragment,d),t=U(d),O(n.$$.fragment,d)},m(d,c){q(e,d,c),C(d,t,c),q(n,d,c),r=!0},p(d,c){const m={};c&4&&(m.schema=d[2].data),!l&&c&8&&(l=!0,m.open=d[3],tt(()=>l=!1)),e.$set(m);const _={};c&4&&(_.schema=d[2].data),!f&&c&16&&(f=!0,_.open=d[4],tt(()=>f=!1)),n.$set(_)},i(d){r||(g(e.$$.fragment,d),g(n.$$.fragment,d),r=!0)},o(d){b(e.$$.fragment,d),b(n.$$.fragment,d),r=!1},d(d){L(e,d),d&&h(t),L(n,d)}}}function fo(i){let e,l,t,n,f,r,a,s,o,u,d,c,m,_,p,k,$,S;t=new Af({});const v=[ao,so],y=[];function N(V,E){return V[10]?1:0}r=N(i),a=y[r]=v[r](i),m=new Da({});let z=i[2].data&&ii(i);return{c(){e=A("div"),l=A("div"),R(t.$$.fragment),n=j(),f=A("div"),a.c(),d=j(),c=A("div"),R(m.$$.fragment),_=j(),z&&z.c(),p=le(),this.h()},l(V){e=F(V,"DIV",{class:!0});var E=D(e);l=F(E,"DIV",{class:!0});var B=D(l);O(t.$$.fragment,B),n=U(B),f=F(B,"DIV",{class:!0});var I=D(f);a.l(I),I.forEach(h),B.forEach(h),d=U(E),c=F(E,"DIV",{class:!0});var M=D(c);O(m.$$.fragment,M),M.forEach(h),E.forEach(h),_=U(V),z&&z.l(V),p=le(),this.h()},h(){T(f,"class",s=St(`absolute right-0 top-1/2 flex
h-8 w-4 cursor-pointer items-center justify-center
rounded border
border-neutral-200 bg-neutral-100
opacity-60 hover:bg-neutral-200
hover:opacity-100
${i[10]?" translate-x-full":" translate-x-1/2"}`)+" svelte-1nu5kbu"),T(l,"class",u=St(`schema-container relative h-full ${i[10]?"w-0":"w-1/3"} border-r border-gray-200`)+" svelte-1nu5kbu"),T(c,"class","h-full w-2/3 flex-grow"),T(e,"class","flex h-full w-full")},m(V,E){C(V,e,E),w(e,l),q(t,l,null),w(l,n),w(l,f),y[r].m(f,null),w(e,d),w(e,c),q(m,c,null),C(V,_,E),z&&z.m(V,E),C(V,p,E),k=!0,$||(S=[Me(o=ze.call(null,f,{text:i[10]?"Show Schema":"Hide Schema"})),Ve(f,"click",i[11]),Ve(f,"keypress",i[11])],$=!0)},p(V,E){let B=r;r=N(V),r!==B&&(X(),b(y[B],1,1,()=>{y[B]=null}),x(),a=y[r],a||(a=y[r]=v[r](V),a.c()),g(a,1),a.m(f,null)),(!k||E&1024&&s!==(s=St(`absolute right-0 top-1/2 flex
h-8 w-4 cursor-pointer items-center justify-center
rounded border
border-neutral-200 bg-neutral-100
opacity-60 hover:bg-neutral-200
hover:opacity-100
${V[10]?" translate-x-full":" translate-x-1/2"}`)+" svelte-1nu5kbu"))&&T(f,"class",s),o&&qe(o.update)&&E&1024&&o.update.call(null,{text:V[10]?"Show Schema":"Hide Schema"}),(!k||E&1024&&u!==(u=St(`schema-container relative h-full ${V[10]?"w-0":"w-1/3"} border-r border-gray-200`)+" svelte-1nu5kbu"))&&T(l,"class",u),V[2].data?z?(z.p(V,E),E&4&&g(z,1)):(z=ii(V),z.c(),g(z,1),z.m(p.parentNode,p)):z&&(X(),b(z,1,1,()=>{z=null}),x())},i(V){k||(g(t.$$.fragment,V),g(a),g(m.$$.fragment,V),g(z),k=!0)},o(V){b(t.$$.fragment,V),b(a),b(m.$$.fragment,V),b(z),k=!1},d(V){V&&h(e),L(t),y[r].d(),L(m),V&&h(_),z&&z.d(V),V&&h(p),$=!1,Je(S)}}}function oo(i){let e=i[1].datasetName+"",l;return{c(){l=Q(e)},l(t){l=J(t,e)},m(t,n){C(t,l,n)},p(t,n){n&2&&e!==(e=t[1].datasetName+"")&&ue(l,e)},d(t){t&&h(l)}}}function uo(i){let e,l,t,n,f,r,a;return t=new lt({props:{type:"outline",$$slots:{default:[oo]},$$scope:{ctx:i}}}),{c(){e=A("div"),l=A("div"),R(t.$$.fragment),this.h()},l(s){e=F(s,"DIV",{slot:!0});var o=D(e);l=F(o,"DIV",{});var u=D(l);O(t.$$.fragment,u),u.forEach(h),o.forEach(h),this.h()},h(){T(e,"slot","header-subtext")},m(s,o){C(s,e,o),w(e,l),q(t,l,null),f=!0,r||(a=Me(n=ze.call(null,l,{text:`${i[1].namespace}/${i[1].datasetName}`})),r=!0)},p(s,o){const u={};o&67108866&&(u.$$scope={dirty:o,ctx:s}),t.$set(u),n&&qe(n.update)&&o&2&&n.update.call(null,{text:`${s[1].namespace}/${s[1].datasetName}`})},i(s){f||(g(t.$$.fragment,s),f=!0)},o(s){b(t.$$.fragment,s),f=!1},d(s){s&&h(e),L(t),r=!1,a()}}}function co(i){let e,l,t;return l=new Ra({}),{c(){e=A("div"),R(l.$$.fragment),this.h()},l(n){e=F(n,"DIV",{slot:!0,class:!0});var f=D(e);O(l.$$.fragment,f),f.forEach(h),this.h()},h(){T(e,"slot","header-center"),T(e,"class","flex w-full items-center")},m(n,f){C(n,e,f),q(l,e,null),t=!0},p:Z,i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){b(l.$$.fragment,n),t=!1},d(n){n&&h(e),L(l)}}}function mo(i){let e,l,t,n,f,r,a,s,o,u,d,c,m;return n=new Ye({props:{size:"field",kind:"ghost",icon:ys,iconDescription:"Reset View"}}),n.$on("click",function(){qe(i[0].reset)&&i[0].reset.apply(this,arguments)}),r=new Ye({props:{size:"field",kind:"ghost",icon:gs,iconDescription:"Download data"}}),r.$on("click",i[21]),o=new Ye({props:{disabled:!i[5],size:"field",kind:"ghost",icon:Mr,iconDescription:"Dataset settings"}}),o.$on("click",i[22]),{c(){e=A("div"),l=A("div"),t=A("div"),R(n.$$.fragment),f=j(),R(r.$$.fragment),a=j(),s=A("div"),R(o.$$.fragment),this.h()},l(_){e=F(_,"DIV",{slot:!0});var p=D(e);l=F(p,"DIV",{class:!0});var k=D(l);t=F(k,"DIV",{class:!0});var $=D(t);O(n.$$.fragment,$),f=U($),O(r.$$.fragment,$),a=U($),s=F($,"DIV",{});var S=D(s);O(o.$$.fragment,S),S.forEach(h),$.forEach(h),k.forEach(h),p.forEach(h),this.h()},h(){se(s,"opacity-40",!i[5]),T(t,"class","flex"),T(l,"class","flex h-full flex-col"),T(e,"slot","header-right")},m(_,p){C(_,e,p),w(e,l),w(l,t),q(n,t,null),w(t,f),q(r,t,null),w(t,a),w(t,s),q(o,s,null),d=!0,c||(m=Me(u=ze.call(null,s,{text:i[5]?"":"User does not have access to update settings of this dataset."})),c=!0)},p(_,p){i=_;const k={};p&32&&(k.disabled=!i[5]),o.$set(k),u&&qe(u.update)&&p&32&&u.update.call(null,{text:i[5]?"":"User does not have access to update settings of this dataset."}),(!d||p&32)&&se(s,"opacity-40",!i[5])},i(_){d||(g(n.$$.fragment,_),g(r.$$.fragment,_),g(o.$$.fragment,_),d=!0)},o(_){b(n.$$.fragment,_),b(r.$$.fragment,_),b(o.$$.fragment,_),d=!1},d(_){_&&h(e),L(n),L(r),L(o),c=!1,m()}}}function ho(i){let e,l,t,n;return e=new gi({props:{title:"Datasets",$$slots:{"header-right":[mo],"header-center":[co],"header-subtext":[uo],default:[fo]},$$scope:{ctx:i}}}),t=new mr({}),{c(){R(e.$$.fragment),l=j(),R(t.$$.fragment)},l(f){O(e.$$.fragment,f),l=U(f),O(t.$$.fragment,f)},m(f,r){q(e,f,r),C(f,l,r),q(t,f,r),n=!0},p(f,[r]){const a={};r&67109951&&(a.$$scope={dirty:r,ctx:f}),e.$set(a)},i(f){n||(g(e.$$.fragment,f),g(t.$$.fragment,f),n=!0)},o(f){b(e.$$.fragment,f),b(t.$$.fragment,f),n=!1},d(f){L(e,f),f&&h(l),L(t,f)}}}function _o(i,e,l){let t,n,f,r,a,s,o,u,d,c,m,_=Z,p=()=>(_(),_=Be(u,ce=>l(18,m=ce)),u),k,$=Z,S=()=>($(),$=Be(o,ce=>l(19,k=ce)),o),v,y=Z,N=()=>(y(),y=Be(n,ce=>l(1,v=ce)),n),z,V=Z,E=()=>(V(),V=Be(r,ce=>l(2,z=ce)),r),B,I=Z,M=()=>(I(),I=Be(s,ce=>l(20,B=ce)),s);i.$$.on_destroy.push(()=>_()),i.$$.on_destroy.push(()=>$()),i.$$.on_destroy.push(()=>y()),i.$$.on_destroy.push(()=>V()),i.$$.on_destroy.push(()=>I());let{namespace:P}=e,{datasetName:K}=e;function ne(){ot(n,v.schemaCollapsed=!v.schemaCollapsed,v)}const W=hr(P,K);_r(W);let te=!1,G=!1;const ee=Mt();he(i,ee,ce=>l(17,c=ce));const we=()=>l(4,G=!0),fe=()=>l(3,te=!0);function ae(ce){te=ce,l(3,te)}function ye(ce){G=ce,l(4,G)}return i.$$set=ce=>{"namespace"in ce&&l(13,P=ce.namespace),"datasetName"in ce&&l(14,K=ce.datasetName)},i.$$.update=()=>{var ce,Ee;if(i.$$.dirty&90112&&N(l(0,n=gr(t,P,K))),i.$$.dirty&1&&pr(n),i.$$.dirty&2&&l(10,f=v.schemaCollapsed),i.$$.dirty&2&&E(l(9,r=mi(v.namespace,v.datasetName))),i.$$.dirty&4&&l(15,a=Yi("string",z.data)),i.$$.dirty&32770&&M(l(8,s=Wi(v.namespace,v.datasetName,a.map(oe=>oe.path)))),i.$$.dirty&2&&S(l(7,o=Qi(v.namespace,v.datasetName,br(v)))),i.$$.dirty&2&&p(l(6,u=jt(v.namespace,v.datasetName))),i.$$.dirty&1048580&&z.data!=null&&B.data&&!B.isFetching&&W.setStats(B.data),i.$$.dirty&4&&z.data!=null&&W.setSchema(z.data),i.$$.dirty&524288&&k!=null&&W.setSelectRowsSchema(k),i.$$.dirty&524290){const oe=vr(v.selectedColumns,((ce=k==null?void 0:k.data)==null?void 0:ce.schema)||null);W.setVisibleFields(oe)}i.$$.dirty&262144&&m.data!=null&&W.setSettings(m.data),i.$$.dirty&131072&&l(5,d=(Ee=c.data)==null?void 0:Ee.access.dataset.update_settings)},l(16,t=ki()),[n,v,z,te,G,d,u,o,s,r,f,ne,ee,P,K,a,t,c,m,k,B,we,fe,ae,ye]}class go extends ge{constructor(e){super(),pe(this,e,_o,ho,_e,{namespace:13,datasetName:14})}}function ri(i,e,l){const t=i.slice();return t[17]=e[l],t}function po(i){let e,l,t=i[4].data,n=[];for(let r=0;r<t.length;r+=1)n[r]=ai(ri(i,t,r));const f=r=>b(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;r<n.length;r+=1)n[r].c();e=le()},l(r){for(let a=0;a<n.length;a+=1)n[a].l(r);e=le()},m(r,a){for(let s=0;s<n.length;s+=1)n[s]&&n[s].m(r,a);C(r,e,a),l=!0},p(r,a){if(a&21){t=r[4].data;let s;for(s=0;s<t.length;s+=1){const o=ri(r,t,s);n[s]?(n[s].p(o,a),g(n[s],1)):(n[s]=ai(o),n[s].c(),g(n[s],1),n[s].m(e.parentNode,e))}for(X(),s=t.length;s<n.length;s+=1)f(s);x()}},i(r){if(!l){for(let a=0;a<t.length;a+=1)g(n[a]);l=!0}},o(r){n=n.filter(Boolean);for(let a=0;a<n.length;a+=1)b(n[a]);l=!1},d(r){Fe(n,r),r&&h(e)}}}function bo(i){let e,l;return e=new Qt({props:{kind:"error",title:"Error loading datasets",lowContrast:!0,subtitle:i[4].error.message}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n&16&&(f.subtitle=t[4].error.message),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function vo(i){let e,l;return e=new Le({props:{paragraph:!0,lines:3,width:"30%"}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function si(i){let e,l=i[17].description+"",t;return{c(){e=A("div"),t=Q(l),this.h()},l(n){e=F(n,"DIV",{class:!0});var f=D(e);t=J(f,l),f.forEach(h),this.h()},h(){T(e,"class","my-4")},m(n,f){C(n,e,f),w(e,t)},p(n,f){f&16&&l!==(l=n[17].description+"")&&ue(t,l)},d(n){n&&h(e)}}}function wo(i){let e;return{c(){e=Q("Open")},l(l){e=J(l,"Open")},m(l,t){C(l,e,t)},d(l){l&&h(e)}}}function ai(i){let e,l,t=i[17].namespace+"",n,f,r=i[17].dataset_name+"",a,s,o,u,d,c,m,_,p,k,$,S,v,y,N,z=i[17].description&&si(i);function V(){return i[11](i[17])}d=new Ye({props:{kind:"tertiary",$$slots:{default:[wo]},$$scope:{ctx:i}}}),d.$on("click",V),p=new wr({props:{size:16}});function E(){return i[12](i[17])}function B(){return i[13](i[17])}return{c(){e=A("button"),l=A("div"),n=Q(t),f=Q(" / "),a=Q(r),s=j(),z&&z.c(),o=j(),u=A("div"),R(d.$$.fragment),c=j(),m=A("div"),_=A("button"),R(p.$$.fragment),S=j(),this.h()},l(I){e=F(I,"BUTTON",{class:!0});var M=D(e);l=F(M,"DIV",{class:!0});var P=D(l);n=J(P,t),f=J(P," / "),a=J(P,r),P.forEach(h),s=U(M),z&&z.l(M),o=U(M),u=F(M,"DIV",{class:!0});var K=D(u);O(d.$$.fragment,K),c=U(K),m=F(K,"DIV",{});var ne=D(m);_=F(ne,"BUTTON",{title:!0,class:!0});var W=D(_);O(p.$$.fragment,W),W.forEach(h),ne.forEach(h),K.forEach(h),S=U(M),M.forEach(h),this.h()},h(){T(l,"class","truncate text-xl"),T(_,"title","Delete dataset"),_.disabled=k=!i[2],T(_,"class","h-full w-full rounded border border-gray-300 p-2"),se(_,"hover:border-red-400",i[2]),se(_,"hover:text-red-400",i[2]),se(m,"opacity-40",!i[2]),T(u,"class","mt-4 flex gap-x-2"),T(e,"class","w-80 cursor-pointer rounded-md border border-gray-200 px-3 py-4 text-left hover:border-gray-400")},m(I,M){C(I,e,M),w(e,l),w(l,n),w(l,f),w(l,a),w(e,s),z&&z.m(e,null),w(e,o),w(e,u),q(d,u,null),w(u,c),w(u,m),w(m,_),q(p,_,null),w(e,S),v=!0,y||(N=[Ve(_,"click",qt(E)),Me($=ze.call(null,m,{text:i[2]?"":"User does not have access to delete this dataset."})),Ve(e,"click",B)],y=!0)},p(I,M){i=I,(!v||M&16)&&t!==(t=i[17].namespace+"")&&ue(n,t),(!v||M&16)&&r!==(r=i[17].dataset_name+"")&&ue(a,r),i[17].description?z?z.p(i,M):(z=si(i),z.c(),z.m(e,o)):z&&(z.d(1),z=null);const P={};M&1048576&&(P.$$scope={dirty:M,ctx:i}),d.$set(P),(!v||M&4&&k!==(k=!i[2]))&&(_.disabled=k),(!v||M&4)&&se(_,"hover:border-red-400",i[2]),(!v||M&4)&&se(_,"hover:text-red-400",i[2]),$&&qe($.update)&&M&4&&$.update.call(null,{text:i[2]?"":"User does not have access to delete this dataset."}),(!v||M&4)&&se(m,"opacity-40",!i[2])},i(I){v||(g(d.$$.fragment,I),g(p.$$.fragment,I),v=!0)},o(I){b(d.$$.fragment,I),b(p.$$.fragment,I),v=!1},d(I){I&&h(e),z&&z.d(),L(d),L(p),y=!1,Je(N)}}}function fi(i){let e,l;return e=new Kt({props:{danger:!0,open:!0,modalHeading:"Delete dataset",primaryButtonText:"Delete",primaryButtonIcon:i[3].isLoading?Dt:void 0,secondaryButtonText:"Cancel",$$slots:{default:[ko]},$$scope:{ctx:i}}}),e.$on("click:button--secondary",i[14]),e.$on("close",i[15]),e.$on("submit",i[16]),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n&8&&(f.primaryButtonIcon=t[3].isLoading?Dt:void 0),n&1048577&&(f.$$scope={dirty:n,ctx:t}),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function ko(i){let e,l,t,n=i[0].namespace+"",f,r,a=i[0].name+"",s,o,u,d,c;return{c(){e=A("p"),l=Q("Confirm deleting "),t=A("code"),f=Q(n),r=Q("/"),s=Q(a),o=Q(" ?"),u=j(),d=A("p"),c=Q("This is a permanent action and cannot be undone."),this.h()},l(m){e=F(m,"P",{class:!0});var _=D(e);l=J(_,"Confirm deleting "),t=F(_,"CODE",{});var p=D(t);f=J(p,n),r=J(p,"/"),s=J(p,a),p.forEach(h),o=J(_," ?"),_.forEach(h),u=U(m),d=F(m,"P",{class:!0});var k=D(d);c=J(k,"This is a permanent action and cannot be undone."),k.forEach(h),this.h()},h(){T(e,"class","!text-lg"),T(d,"class","mt-2")},m(m,_){C(m,e,_),w(e,l),w(e,t),w(t,f),w(t,r),w(t,s),w(e,o),C(m,u,_),C(m,d,_),w(d,c)},p(m,_){_&1&&n!==(n=m[0].namespace+"")&&ue(f,n),_&1&&a!==(a=m[0].name+"")&&ue(s,a)},d(m){m&&h(e),m&&h(u),m&&h(d)}}}function So(i){let e,l,t,n,f,r,a;const s=[vo,bo,po],o=[];function u(c,m){return c[4].isLoading?0:c[4].isError?1:c[4].isSuccess?2:-1}~(t=u(i))&&(n=o[t]=s[t](i));let d=i[0]&&fi(i);return{c(){e=A("div"),l=A("div"),n&&n.c(),f=j(),d&&d.c(),r=le(),this.h()},l(c){e=F(c,"DIV",{class:!0});var m=D(e);l=F(m,"DIV",{class:!0});var _=D(l);n&&n.l(_),_.forEach(h),m.forEach(h),f=U(c),d&&d.l(c),r=le(),this.h()},h(){T(l,"class","flex flex-wrap gap-x-4 gap-y-4"),T(e,"class","flex flex-col gap-y-4 p-4")},m(c,m){C(c,e,m),w(e,l),~t&&o[t].m(l,null),C(c,f,m),d&&d.m(c,m),C(c,r,m),a=!0},p(c,m){let _=t;t=u(c),t===_?~t&&o[t].p(c,m):(n&&(X(),b(o[_],1,1,()=>{o[_]=null}),x()),~t?(n=o[t],n?n.p(c,m):(n=o[t]=s[t](c),n.c()),g(n,1),n.m(l,null)):n=null),c[0]?d?(d.p(c,m),m&1&&g(d,1)):(d=fi(c),d.c(),g(d,1),d.m(r.parentNode,r)):d&&(X(),b(d,1,1,()=>{d=null}),x())},i(c){a||(g(n),g(d),a=!0)},o(c){b(n),b(d),a=!1},d(c){c&&h(e),~t&&o[t].d(),c&&h(f),d&&d.d(c),c&&h(r)}}}function Eo(i){let e;return{c(){e=Q("+ Add Dataset")},l(l){e=J(l,"+ Add Dataset")},m(l,t){C(l,e,t)},d(l){l&&h(e)}}}function yo(i){let e,l,t;return l=new Ye({props:{size:"small",disabled:!i[1],$$slots:{default:[Eo]},$$scope:{ctx:i}}}),l.$on("click",i[10]),{c(){e=A("div"),R(l.$$.fragment),this.h()},l(n){e=F(n,"DIV",{slot:!0});var f=D(e);O(l.$$.fragment,f),f.forEach(h),this.h()},h(){T(e,"slot","header-right")},m(n,f){C(n,e,f),q(l,e,null),t=!0},p(n,f){const r={};f&2&&(r.disabled=!n[1]),f&1048576&&(r.$$scope={dirty:f,ctx:n}),l.$set(r)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){b(l.$$.fragment,n),t=!1},d(n){n&&h(e),L(l)}}}function $o(i){let e,l;return e=new gi({props:{title:"Datasets",$$slots:{"header-right":[yo],default:[So]},$$scope:{ctx:i}}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,[n]){const f={};n&1048607&&(f.$$scope={dirty:n,ctx:t}),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Do(i,e,l){let t,n,f,r,a;const s=Ji();he(i,s,y=>l(4,a=y));const o=Ki();he(i,o,y=>l(3,f=y));const u=Mt();he(i,u,y=>l(9,r=y));let d=null;function c(){if(d==null)return;const{namespace:y,name:N}=d;f.mutate([y,N],{onSuccess:()=>l(0,d=null)})}const m=()=>At("/datasets/new"),_=y=>At(il(y.namespace,y.dataset_name)),p=y=>l(0,d={namespace:y.namespace,name:y.dataset_name}),k=y=>At(il(y.namespace,y.dataset_name)),$=()=>l(0,d=null),S=()=>l(0,d=null),v=()=>c();return i.$$.update=()=>{var y,N;i.$$.dirty&512&&l(2,t=(y=r.data)==null?void 0:y.access.dataset.delete_dataset),i.$$.dirty&512&&l(1,n=(N=r.data)==null?void 0:N.access.create_dataset)},[d,n,t,f,a,s,o,u,c,r,m,_,p,k,$,S,v]}class Io extends ge{constructor(e){super(),pe(this,e,Do,$o,_e,{})}}function Vo(i){let e,l;return e=new Io({}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function To(i){let e,l;return e=new go({props:{namespace:i[0],datasetName:i[1]}}),{c(){R(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,n){q(e,t,n),l=!0},p(t,n){const f={};n&1&&(f.namespace=t[0]),n&2&&(f.datasetName=t[1]),e.$set(f)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Co(i){let e,l,t,n;const f=[To,Vo],r=[];function a(s,o){return s[0]!=null&&s[1]!=null?0:1}return e=a(i),l=r[e]=f[e](i),{c(){l.c(),t=le()},l(s){l.l(s),t=le()},m(s,o){r[e].m(s,o),C(s,t,o),n=!0},p(s,[o]){let u=e;e=a(s),e===u?r[e].p(s,o):(X(),b(r[u],1,1,()=>{r[u]=null}),x(),l=r[e],l?l.p(s,o):(l=r[e]=f[e](s),l.c()),g(l,1),l.m(t.parentNode,t))},i(s){n||(g(l),n=!0)},o(s){b(l),n=!1},d(s){r[e].d(s),s&&h(t)}}}function No(i,e,l){let t,n,f;const r=ki();return he(i,r,a=>l(3,t=a)),i.$$.update=()=>{i.$$.dirty&11&&t.onUrlChange("datasets",a=>{if(a=="")l(0,n=void 0),l(1,f=void 0);else{const[s,o]=a.split("/");(n!=s||f!=o)&&(l(0,n=s),l(1,f=o))}})},[n,f,r,t]}class Yo extends ge{constructor(e){super(),pe(this,e,No,Co,_e,{})}}export{Yo as component};