text: var pe=Object.defineProperty,de=Object.defineProperties;var me=Object.getOwnPropertyDescriptors;var Y=Object.getOwnPropertySymbols;var he=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable;var x=(s,e,t)=>e in s?pe(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,K=(s,e)=>{for(var t in e||(e={}))he.call(e,t)&&x(s,t,e[t]);if(Y)for(var t of Y(e))_e.call(e,t)&&x(s,t,e[t]);return s},R=(s,e)=>de(s,me(e));import{S as ge,i as be,s as ve,w as ce,x as ae,y as ue,a1 as ee,q as F,o as N,B as fe,e as g,t as O,k as T,c as b,a as v,h as j,d,m as B,b as _,g as U,M as c,j as ke,p as te,Q as we,Z as Ee,X as se,a0 as le,n as ie,ab as oe,E as C,P as L,G as Se}from"../../../../chunks/index-bed072e4.js";import Ve from"./Step.svelte-7de45d71.js";import{D as ze}from"../../../../chunks/Dropdown-c142f7f6.js";import{c as Ie}from"../../../../chunks/utils-c922859c.js";import"../../../../chunks/themes-fa5ad8e6.js";import"../../../../chunks/iconMap-7a0cdc3f.js";import"../../../../chunks/lodash-8a03b776.js";import"../../../../chunks/randomColor-af782e7b.js";import"../../../../chunks/v4-bf0bf616.js";function re(s,e,t){const r=s.slice();return r[14]=e[t],r[15]=e,r[16]=t,r}function ye(s){let e,t,r,l,u;return{c(){e=g("button"),t=g("div"),r=O("Select Step"),l=T(),u=g("i"),this.h()},l(a){e=b(a,"BUTTON",{class:!0});var f=v(e);t=b(f,"DIV",{class:!0});var n=v(t);r=j(n,"Select Step"),n.forEach(d),l=B(f),u=b(f,"I",{class:!0}),v(u).forEach(d),f.forEach(d),this.h()},h(){_(t,"class","flex-grow"),_(u,"class","ri-arrow-drop-down-line align-bottom"),e.disabled=!0,_(e,"class","opacity-40 cursor-pointer w-full bg-zinc-200 py-1 px-2 text-sm flex items-center rounded")},m(a,f){U(a,e,f),c(e,t),c(t,r),c(e,l),c(e,u)},p:C,i:C,o:C,d(a){a&&d(e)}}}function De(s){let e,t;return e=new ze({props:{full:!0,$$slots:{menu:[je],toggle:[Oe]},$$scope:{ctx:s}}}),{c(){ce(e.$$.fragment)},l(r){ae(e.$$.fragment,r)},m(r,l){ue(e,r,l),t=!0},p(r,l){const u={};l&131072&&(u.$$scope={dirty:l,ctx:r}),e.$set(u)},i(r){t||(F(e.$$.fragment,r),t=!0)},o(r){N(e.$$.fragment,r),t=!1},d(r){fe(e,r)}}}function Oe(s){let e,t,r,l,u;return{c(){e=g("button"),t=g("div"),r=O("Select Step"),l=T(),u=g("i"),this.h()},l(a){e=b(a,"BUTTON",{slot:!0,class:!0});var f=v(e);t=b(f,"DIV",{class:!0});var n=v(t);r=j(n,"Select Step"),n.forEach(d),l=B(f),u=b(f,"I",{class:!0}),v(u).forEach(d),f.forEach(d),this.h()},h(){_(t,"class","flex-grow"),_(u,"class","ri-arrow-drop-down-line align-bottom"),_(e,"slot","toggle"),_(e,"class","cursor-pointer w-full bg-zinc-200 py-1 px-2 text-sm flex items-center rounded")},m(a,f){U(a,e,f),c(e,t),c(t,r),c(e,l),c(e,u)},d(a){a&&d(e)}}}function je(s){let e,t,r,l,u,a,f,n,h,k,S,D,q,E,$,I,o,w,i,p,V,m,y,G,H,W;return{c(){e=g("div"),t=g("div"),r=g("i"),l=O(" Filter"),u=T(),a=g("div"),f=g("i"),n=O(" Summarize"),h=T(),k=g("div"),S=g("i"),D=O(" Sort"),q=T(),E=g("div"),$=g("i"),I=O(" Deduplicate"),o=T(),w=g("div"),i=g("i"),p=O(" Limit"),V=T(),m=g("div"),y=g("i"),G=O(" Offset"),this.h()},l(A){e=b(A,"DIV",{slot:!0});var z=v(e);t=b(z,"DIV",{class:!0});var M=v(t);r=b(M,"I",{class:!0}),v(r).forEach(d),l=j(M," Filter"),M.forEach(d),u=B(z),a=b(z,"DIV",{class:!0});var P=v(a);f=b(P,"I",{class:!0}),v(f).forEach(d),n=j(P," Summarize"),P.forEach(d),h=B(z),k=b(z,"DIV",{class:!0});var Q=v(k);S=b(Q,"I",{class:!0}),v(S).forEach(d),D=j(Q," Sort"),Q.forEach(d),q=B(z),E=b(z,"DIV",{class:!0});var X=v(E);$=b(X,"I",{class:!0}),v($).forEach(d),I=j(X," Deduplicate"),X.forEach(d),o=B(z),w=b(z,"DIV",{class:!0});var Z=v(w);i=b(Z,"I",{class:!0}),v(i).forEach(d),p=j(Z," Limit"),Z.forEach(d),V=B(z),m=b(z,"DIV",{class:!0});var J=v(m);y=b(J,"I",{class:!0}),v(y).forEach(d),G=j(J," Offset"),J.forEach(d),z.forEach(d),this.h()},h(){_(r,"class","ri-filter-line align-bottom"),_(t,"class","p-2 cursor-pointer hover:bg-zinc-200"),_(f,"class","ri-layout-row-fill align-bottom"),_(a,"class","p-2 cursor-pointer hover:bg-zinc-200"),_(S,"class","ri-arrow-up-down-fill align-bottom"),_(k,"class","p-2 cursor-pointer hover:bg-zinc-200"),_($,"class","ri-tools-line align-bottom"),_(E,"class","p-2 cursor-pointer hover:bg-zinc-200"),_(i,"class","ri-tools-line align-bottom"),_(w,"class","p-2 cursor-pointer hover:bg-zinc-200"),_(y,"class","ri-tools-line align-bottom"),_(m,"class","p-2 cursor-pointer hover:bg-zinc-200"),_(e,"slot","menu")},m(A,z){U(A,e,z),c(e,t),c(t,r),c(t,l),c(e,u),c(e,a),c(a,f),c(a,n),c(e,h),c(e,k),c(k,S),c(k,D),c(e,q),c(e,E),c(E,$),c(E,I),c(e,o),c(e,w),c(w,i),c(w,p),c(e,V),c(e,m),c(m,y),c(m,G),H||(W=[L(t,"click",s[3]),L(a,"click",s[4]),L(k,"click",s[5]),L(E,"click",s[6]),L(w,"click",s[7]),L(m,"click",s[8])],H=!0)},p:C,d(A){A&&d(e),H=!1,Se(W)}}}function ne(s){let e,t,r,l;function u(n){s[9](n,s[16])}function a(n){s[10](n)}let f={step:s[14]};return s[1][s[16]]!==void 0&&(f.minimize=s[1][s[16]]),s[0]!==void 0&&(f.selectedView=s[0]),e=new Ve({props:f}),se.push(()=>le(e,"minimize",u)),se.push(()=>le(e,"selectedView",a)),e.$on("previewStep",s[11]),e.$on("deleteStep",s[12]),{c(){ce(e.$$.fragment)},l(n){ae(e.$$.fragment,n)},m(n,h){ue(e,n,h),l=!0},p(n,h){s=n;const k={};h&1&&(k.step=s[14]),!t&&h&2&&(t=!0,k.minimize=s[1][s[16]],ee(()=>t=!1)),!r&&h&1&&(r=!0,k.selectedView=s[0],ee(()=>r=!1)),e.$set(k)},i(n){l||(F(e.$$.fragment,n),l=!0)},o(n){N(e.$$.fragment,n),l=!1},d(n){fe(e,n)}}}function $e(s){let e,t,r,l=Object.keys(s[0].steps).length+"",u,a,f,n,h,k,S,D;const q=[De,ye],E=[];function $(i,p){return i[0].columns.length>0?0:1}n=$(s),h=E[n]=q[n](s);let I=Object.keys(s[0].steps),o=[];for(let i=0;i<I.length;i+=1)o[i]=ne(re(s,I,i));const w=i=>N(o[i],1,1,()=>{o[i]=null});return{c(){e=g("div"),t=g("h4"),r=O("Transform Steps ("),u=O(l),a=O(")"),f=T(),h.c(),k=T(),S=g("div");for(let i=0;i<o.length;i+=1)o[i].c();this.h()},l(i){e=b(i,"DIV",{class:!0});var p=v(e);t=b(p,"H4",{class:!0});var V=v(t);r=j(V,"Transform Steps ("),u=j(V,l),a=j(V,")"),V.forEach(d),f=B(p),h.l(p),p.forEach(d),k=B(i),S=b(i,"DIV",{class:!0});var m=v(S);for(let y=0;y<o.length;y+=1)o[y].l(m);m.forEach(d),this.h()},h(){_(t,"class","font-semibold text-sm leading-6"),_(e,"class","p-2 space-y-2"),_(S,"class","border-t overflow-y-scroll p-2 border-zinc-200 space-y-2 flex-grow")},m(i,p){U(i,e,p),c(e,t),c(t,r),c(t,u),c(t,a),c(e,f),E[n].m(e,null),U(i,k,p),U(i,S,p);for(let V=0;V<o.length;V+=1)o[V].m(S,null);D=!0},p(i,[p]){(!D||p&1)&&l!==(l=Object.keys(i[0].steps).length+"")&&ke(u,l);let V=n;if(n=$(i),n===V?E[n].p(i,p):(ie(),N(E[V],1,1,()=>{E[V]=null}),te(),h=E[n],h?h.p(i,p):(h=E[n]=q[n](i),h.c()),F(h,1),h.m(e,null)),p&3){I=Object.keys(i[0].steps);let m;for(m=0;m<I.length;m+=1){const y=re(i,I,m);o[m]?(o[m].p(y,p),F(o[m],1)):(o[m]=ne(y),o[m].c(),F(o[m],1),o[m].m(S,null))}for(ie(),m=I.length;m<o.length;m+=1)w(m);te()}},i(i){if(!D){F(h);for(let p=0;p<I.length;p+=1)F(o[p]);D=!0}},o(i){N(h),o=o.filter(Boolean);for(let p=0;p<o.length;p+=1)N(o[p]);D=!1},d(i){i&&d(e),E[n].d(),i&&d(k),i&&d(S),we(o,i)}}}function Te(s,e,t){const r=Ee();let{selectedView:l}=e,u=[];function a(o){Object.keys(l.steps).forEach(i=>{t(0,l.steps[i].hidden=!1,l)});let w=`${o}_${l.steps?Object.keys(l.steps).length:0}`;t(0,l.steps[w]={column:l.columns[0],type:o},l),o=="filter"&&t(0,l.steps[w]=R(K({},l.steps[w]),{condition:Ie[l.steps[w].column.type][0],value:""}),l),o=="summarize"&&t(0,l.steps[w]=R(K({},l.steps[w]),{aggregations:[]}),l),t(0,l),r("AddStep",l.records),t(1,u=Object.keys(l.steps).map((i,p)=>Object.keys(l.steps).length>p+1))}const f=()=>a("filter"),n=()=>a("summarize"),h=()=>a("sort"),k=()=>a("deduplicate"),S=()=>a("limit"),D=()=>a("offset");function q(o,w){s.$$.not_equal(u[w],o)&&(u[w]=o,t(1,u))}function E(o){l=o,t(0,l)}function $(o){oe.call(this,s,o)}function I(o){oe.call(this,s,o)}return s.$$set=o=>{"selectedView"in o&&t(0,l=o.selectedView)},[l,u,a,f,n,h,k,S,D,q,E,$,I]}class Me extends ge{constructor(e){super();be(this,e,Te,$e,ve,{selectedView:0})}}export{Me as default};
  