mirror of
https://github.com/Ladebeze66/projetcbaollm.git
synced 2025-12-18 22:37:50 +01:00
7 lines
85 KiB
JavaScript
7 lines
85 KiB
JavaScript
import{B as cs}from"./Block-DZqtZLFP.js";import"./MarkdownCode.svelte_svelte_type_style_lang-3tofWDHK.js";import"./IconButtonWrapper.svelte_svelte_type_style_lang-BOpxTcdu.js";import{d as Ge}from"./index-CnqicUFC.js";import{U as hs}from"./Upload-DeO6qHmq.js";/* empty css */import{M as ds}from"./MarkdownCode-DJM7o_VY.js";import"./index-C7PS0jJm.js";import{C as ms}from"./Copy-CxQ9EyK2.js";import{M as gs,a as bs}from"./Minimize-OAHZO2Ge.js";import{d as ws}from"./dsv-DB8NKgIY.js";import{S as ps}from"./index-B1gfMDT9.js";import"./StreamingBar.svelte_svelte_type_style_lang-CDNxkBIr.js";import{default as Cu}from"./Example-CqPGqNav.js";import"./prism-python-qapVsvY8.js";/* empty css */import"./svelte/svelte.js";import"./IconButton-B-aAVSzy.js";import"./Clear-By3xiIwg.js";const{HtmlTag:ks,SvelteComponent:vs,action_destroyer:ys,attr:Re,binding_callbacks:qs,bubble:Kt,check_outros:Cs,create_component:Es,destroy_component:As,detach:Lt,element:Yn,empty:Ss,flush:Ce,group_outros:Ms,init:zs,insert:Dt,listen:Ke,mount_component:Ls,noop:Wt,prevent_default:Ds,run_all:Jn,safe_not_equal:Bs,set_data:js,set_input_value:Ol,space:Ts,stop_propagation:fl,text:Rs,toggle_class:Qe,transition_in:ml,transition_out:gl}=window.__gradio__svelte__internal,{createEventDispatcher:Hs}=window.__gradio__svelte__internal;function Il(n){let e,t,l;return{c(){e=Yn("input"),Re(e,"role","textbox"),Re(e,"tabindex","-1"),Re(e,"class","svelte-1xjy58k"),Qe(e,"header",n[4])},m(o,s){Dt(o,e,s),n[24](e),Ol(e,n[11]),t||(l=[Ke(e,"input",n[25]),Ke(e,"blur",n[14]),Ke(e,"mousedown",fl(n[21])),Ke(e,"mouseup",fl(n[22])),Ke(e,"click",fl(n[23])),ys(n[13].call(null,e)),Ke(e,"keydown",n[15])],t=!0)},p(o,s){s&2048&&e.value!==o[11]&&Ol(e,o[11]),s&16&&Qe(e,"header",o[4])},d(o){o&&Lt(e),n[24](null),t=!1,Jn(l)}}}function Ps(n){let e=(n[8]?n[12]:n[2]||n[12])+"",t;return{c(){t=Rs(e)},m(l,o){Dt(l,t,o)},p(l,o){o&4356&&e!==(e=(l[8]?l[12]:l[2]||l[12])+"")&&js(t,e)},i:Wt,o:Wt,d(l){l&&Lt(t)}}}function Ns(n){let e,t;return e=new ds({props:{message:n[12].toLocaleString(),latex_delimiters:n[6],line_breaks:n[7],chatbot:!1,root:n[9]}}),{c(){Es(e.$$.fragment)},m(l,o){Ls(e,l,o),t=!0},p(l,o){const s={};o&4096&&(s.message=l[12].toLocaleString()),o&64&&(s.latex_delimiters=l[6]),o&128&&(s.line_breaks=l[7]),o&512&&(s.root=l[9]),e.$set(s)},i(l){t||(ml(e.$$.fragment,l),t=!0)},o(l){gl(e.$$.fragment,l),t=!1},d(l){As(e,l)}}}function Fs(n){let e,t;return{c(){e=new ks(!1),t=Ss(),e.a=t},m(l,o){e.m(n[12],l,o),Dt(l,t,o)},p(l,o){o&4096&&e.p(l[12])},i:Wt,o:Wt,d(l){l&&(Lt(t),e.d())}}}function Os(n){let e,t,l,o,s,i,r,a=n[1]&&Il(n);const f=[Fs,Ns,Ps],u=[];function c(h,g){return h[5]==="html"?0:h[5]==="markdown"?1:2}return l=c(n),o=u[l]=f[l](n),{c(){a&&a.c(),e=Ts(),t=Yn("span"),o.c(),Re(t,"tabindex","0"),Re(t,"role","button"),Re(t,"style",n[3]),Re(t,"data-editable",n[8]),Re(t,"placeholder"," "),Re(t,"class","svelte-1xjy58k"),Qe(t,"edit",n[1]),Qe(t,"expanded",n[10]),Qe(t,"multiline",n[4])},m(h,g){a&&a.m(h,g),Dt(h,e,g),Dt(h,t,g),u[l].m(t,null),s=!0,i||(r=[Ke(t,"click",n[16]),Ke(t,"keydown",n[15]),Ke(t,"focus",Ds(n[20]))],i=!0)},p(h,[g]){h[1]?a?a.p(h,g):(a=Il(h),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null);let A=l;l=c(h),l===A?u[l].p(h,g):(Ms(),gl(u[A],1,1,()=>{u[A]=null}),Cs(),o=u[l],o?o.p(h,g):(o=u[l]=f[l](h),o.c()),ml(o,1),o.m(t,null)),(!s||g&8)&&Re(t,"style",h[3]),(!s||g&256)&&Re(t,"data-editable",h[8]),(!s||g&2)&&Qe(t,"edit",h[1]),(!s||g&1024)&&Qe(t,"expanded",h[10]),(!s||g&16)&&Qe(t,"multiline",h[4])},i(h){s||(ml(o),s=!0)},o(h){gl(o),s=!1},d(h){h&&(Lt(e),Lt(t)),a&&a.d(h),u[l].d(),i=!1,Jn(r)}}}function Is(n,e=null){const t=String(n);return!e||t.length<=e?t:t.slice(0,e)+"..."}function Ks(n,e,t){let l,o,{edit:s}=e,{value:i=""}=e,{display_value:r=null}=e,{styling:a=""}=e,{header:f=!1}=e,{datatype:u="str"}=e,{latex_delimiters:c}=e,{clear_on_focus:h=!1}=e,{line_breaks:g=!0}=e,{editable:A=!0}=e,{root:B}=e,{max_chars:j=null}=e;const b=Hs();let w=!1,{el:k}=e;function D(v){return h&&t(11,l=""),requestAnimationFrame(()=>{v.focus()}),{}}function E({currentTarget:v}){t(17,i=v.value),b("blur")}function z(v){v.key==="Enter"&&(s?(t(17,i=l),b("blur")):f||t(10,w=!w)),b("keydown",v)}function H(){!s&&!f&&t(10,w=!w)}function Q(v){Kt.call(this,n,v)}function x(v){Kt.call(this,n,v)}function K(v){Kt.call(this,n,v)}function y(v){Kt.call(this,n,v)}function N(v){qs[v?"unshift":"push"](()=>{k=v,t(0,k)})}function X(){l=this.value,t(11,l),t(17,i)}return n.$$set=v=>{"edit"in v&&t(1,s=v.edit),"value"in v&&t(17,i=v.value),"display_value"in v&&t(2,r=v.display_value),"styling"in v&&t(3,a=v.styling),"header"in v&&t(4,f=v.header),"datatype"in v&&t(5,u=v.datatype),"latex_delimiters"in v&&t(6,c=v.latex_delimiters),"clear_on_focus"in v&&t(18,h=v.clear_on_focus),"line_breaks"in v&&t(7,g=v.line_breaks),"editable"in v&&t(8,A=v.editable),"root"in v&&t(9,B=v.root),"max_chars"in v&&t(19,j=v.max_chars),"el"in v&&t(0,k=v.el)},n.$$.update=()=>{n.$$.dirty&131072&&t(11,l=i),n.$$.dirty&656388&&t(12,o=w?i:Is(r||i,j))},[k,s,r,a,f,u,c,g,A,B,w,l,o,D,E,z,H,i,h,j,Q,x,K,y,N,X]}class xt extends vs{constructor(e){super(),zs(this,e,Ks,Os,Bs,{edit:1,value:17,display_value:2,styling:3,header:4,datatype:5,latex_delimiters:6,clear_on_focus:18,line_breaks:7,editable:8,root:9,max_chars:19,el:0})}get edit(){return this.$$.ctx[1]}set edit(e){this.$$set({edit:e}),Ce()}get value(){return this.$$.ctx[17]}set value(e){this.$$set({value:e}),Ce()}get display_value(){return this.$$.ctx[2]}set display_value(e){this.$$set({display_value:e}),Ce()}get styling(){return this.$$.ctx[3]}set styling(e){this.$$set({styling:e}),Ce()}get header(){return this.$$.ctx[4]}set header(e){this.$$set({header:e}),Ce()}get datatype(){return this.$$.ctx[5]}set datatype(e){this.$$set({datatype:e}),Ce()}get latex_delimiters(){return this.$$.ctx[6]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),Ce()}get clear_on_focus(){return this.$$.ctx[18]}set clear_on_focus(e){this.$$set({clear_on_focus:e}),Ce()}get line_breaks(){return this.$$.ctx[7]}set line_breaks(e){this.$$set({line_breaks:e}),Ce()}get editable(){return this.$$.ctx[8]}set editable(e){this.$$set({editable:e}),Ce()}get root(){return this.$$.ctx[9]}set root(e){this.$$set({root:e}),Ce()}get max_chars(){return this.$$.ctx[19]}set max_chars(e){this.$$set({max_chars:e}),Ce()}get el(){return this.$$.ctx[0]}set el(e){this.$$set({el:e}),Ce()}}const{ResizeObserverSingleton:Us,SvelteComponent:Vs,add_iframe_resize_listener:Kl,add_render_callback:Ul,append:$e,attr:Ut,binding_callbacks:Vl,check_outros:Wn,create_slot:bl,detach:el,element:ut,empty:Gn,ensure_array_like:Xl,flush:Je,get_all_dirty_from_scope:wl,get_slot_changes:pl,group_outros:Qn,init:Xs,insert:tl,listen:Ys,outro_and_destroy_block:Js,resize_observer_content_box:Ws,safe_not_equal:Gs,set_style:Ee,space:Yl,text:Qs,toggle_class:Jl,transition_in:tt,transition_out:_t,update_keyed_each:Zs,update_slot_base:kl}=window.__gradio__svelte__internal,{onMount:$s,tick:St}=window.__gradio__svelte__internal,xs=n=>({}),Wl=n=>({});function Gl(n,e,t){const l=n.slice();return l[37]=e[t],l}const ei=n=>({item:n[0]&1024,index:n[0]&1024}),Ql=n=>({item:n[37].data,index:n[37].index}),ti=n=>({}),Zl=n=>({});function $l(n){let e=[],t=new Map,l,o,s=Xl(n[10]);const i=r=>r[37].data[0].id;for(let r=0;r<s.length;r+=1){let a=Gl(n,s,r),f=i(a);t.set(f,e[r]=xl(f,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();l=Gn()},m(r,a){for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(r,a);tl(r,l,a),o=!0},p(r,a){a[0]&2098176&&(s=Xl(r[10]),Qn(),e=Zs(e,a,i,1,r,s,t,l.parentNode,Js,xl,l,Gl),Wn())},i(r){if(!o){for(let a=0;a<s.length;a+=1)tt(e[a]);o=!0}},o(r){for(let a=0;a<e.length;a+=1)_t(e[a]);o=!1},d(r){r&&el(l);for(let a=0;a<e.length;a+=1)e[a].d(r)}}}function li(n){let e;return{c(){e=Qs(`Missing Table Row
|
|
`)},m(t,l){tl(t,e,l)},d(t){t&&el(e)}}}function xl(n,e){let t,l;const o=e[22].tbody,s=bl(o,e,e[21],Ql),i=s||li();return{key:n,first:null,c(){t=Gn(),i&&i.c(),this.first=t},m(r,a){tl(r,t,a),i&&i.m(r,a),l=!0},p(r,a){e=r,s&&s.p&&(!l||a[0]&2098176)&&kl(s,o,e,e[21],l?pl(o,e[21],a,ei):wl(e[21]),Ql)},i(r){l||(tt(i,r),l=!0)},o(r){_t(i,r),l=!1},d(r){r&&el(t),i&&i.d(r)}}}function ni(n){let e,t,l,o,s,i,r,a,f,u,c,h,g,A;const B=n[22].thead,j=bl(B,n,n[21],Zl);let b=n[10].length&&n[10][0].data.length&&$l(n);const w=n[22].tfoot,k=bl(w,n,n[21],Wl);return{c(){e=ut("svelte-virtual-table-viewport"),t=ut("div"),l=ut("table"),o=ut("thead"),j&&j.c(),i=Yl(),r=ut("tbody"),b&&b.c(),a=Yl(),f=ut("tfoot"),k&&k.c(),Ut(o,"class","thead svelte-y11bhb"),Ul(()=>n[23].call(o)),Ut(r,"class","tbody svelte-y11bhb"),Ut(f,"class","tfoot svelte-y11bhb"),Ul(()=>n[25].call(f)),Ut(l,"class","table svelte-y11bhb"),Ee(l,"height",oi),Ee(l,"--bw-svt-p-top",n[8]+"px"),Ee(l,"--bw-svt-p-bottom",n[4]+"px"),Ee(l,"--bw-svt-head-height",n[6]+"px"),Ee(l,"--bw-svt-foot-height",n[7]+"px"),Ee(l,"--bw-svt-avg-row-height",n[2]+"px"),Ee(l,"--max-height",n[0]+"px"),Jl(l,"disable-scroll",n[1])},m(D,E){tl(D,e,E),$e(e,t),$e(t,l),$e(l,o),j&&j.m(o,null),s=Kl(o,n[23].bind(o)),$e(l,i),$e(l,r),b&&b.m(r,null),n[24](r),$e(l,a),$e(l,f),k&&k.m(f,null),u=Kl(f,n[25].bind(f)),n[26](l),c=Ws.observe(l,n[27].bind(l)),h=!0,g||(A=Ys(l,"scroll",n[11]),g=!0)},p(D,E){j&&j.p&&(!h||E[0]&2097152)&&kl(j,B,D,D[21],h?pl(B,D[21],E,ti):wl(D[21]),Zl),D[10].length&&D[10][0].data.length?b?(b.p(D,E),E[0]&1024&&tt(b,1)):(b=$l(D),b.c(),tt(b,1),b.m(r,null)):b&&(Qn(),_t(b,1,1,()=>{b=null}),Wn()),k&&k.p&&(!h||E[0]&2097152)&&kl(k,w,D,D[21],h?pl(w,D[21],E,xs):wl(D[21]),Wl),(!h||E[0]&256)&&Ee(l,"--bw-svt-p-top",D[8]+"px"),(!h||E[0]&16)&&Ee(l,"--bw-svt-p-bottom",D[4]+"px"),(!h||E[0]&64)&&Ee(l,"--bw-svt-head-height",D[6]+"px"),(!h||E[0]&128)&&Ee(l,"--bw-svt-foot-height",D[7]+"px"),(!h||E[0]&4)&&Ee(l,"--bw-svt-avg-row-height",D[2]+"px"),(!h||E[0]&1)&&Ee(l,"--max-height",D[0]+"px"),(!h||E[0]&2)&&Jl(l,"disable-scroll",D[1])},i(D){h||(tt(j,D),tt(b),tt(k,D),h=!0)},o(D){_t(j,D),_t(b),_t(k,D),h=!1},d(D){D&&el(e),j&&j.d(D),s(),b&&b.d(),n[24](null),k&&k.d(D),u(),n[26](null),c(),g=!1,A()}}}let oi="100%";function si(n,e){if(!n)return 0;const t=getComputedStyle(n);return parseInt(t.getPropertyValue(e))}function ii(n,e,t){let l,{$$slots:o={},$$scope:s}=e,{items:i=[]}=e,{max_height:r}=e,{actual_height:a}=e,{table_scrollbar_width:f}=e,{start:u=0}=e,{end:c=20}=e,{selected:h}=e,{disable_scroll:g=!1}=e,A=30,B=0,j,b=0,w=0,k=[],D,E,z=0,H,Q=200,x=[],K;const y=typeof window<"u",N=y?window.requestAnimationFrame:q=>q();let X=0;async function v(q){if(Q===0)return;t(6,b=H.querySelector(".thead")?.getBoundingClientRect().height||0),await St();const{scrollTop:m}=H;t(15,f=H.offsetWidth-H.clientWidth),X=z-(m-b);let p=u;for(;X<r&&p<q.length;){let oe=E[p-u];oe||(t(13,c=p+1),await St(),oe=E[p-u]);let ke=oe?.getBoundingClientRect().height;ke||(ke=A);const pt=k[p]=ke;X+=pt,p+=1}t(13,c=p);const F=q.length-c,C=H.offsetHeight-H.clientHeight;C>0&&(X+=C);let be=k.filter(oe=>typeof oe=="number");t(2,A=be.reduce((oe,ke)=>oe+ke,0)/be.length),t(4,B=F*A),k.length=q.length,await St(),r?X<r?t(14,a=X+2):t(14,a=r):t(14,a=X+1),await St()}async function T(q){N(async()=>{if(typeof q!="number")return;const m=typeof q!="number"?!1:we(q);m!==!0&&(m==="back"&&await ae(q,{behavior:"instant"}),m==="forwards"&&await ae(q,{behavior:"instant"},!0))})}function we(q){const m=E&&E[q-u];if(!m&&q<u)return"back";if(!m&&q>=c-1)return"forwards";const{top:p}=H.getBoundingClientRect(),{top:F,bottom:C}=m.getBoundingClientRect();return F-p<37?"back":C-p>Q?"forwards":!0}async function De(q){const m=H.scrollTop;E=j.children;const p=l.length<u,F=si(E[1],"border-top-width"),C=0;p&&await ae(l.length-1,{behavior:"auto"});let be=0;for(let L=0;L<E.length;L+=1)k[u+L]=E[L].getBoundingClientRect().height;let oe=0,ke=b+F/2,pt=[];for(;oe<l.length;){const L=k[oe]||A;if(pt[oe]=L,ke+L+C>m){be=oe,t(8,z=ke-(b+F/2));break}ke+=L,oe+=1}for(be=Math.max(0,be);oe<l.length;){const L=k[oe]||A;if(ke+=L,oe+=1,ke>m+Q)break}t(12,u=be),t(13,c=oe);const ie=l.length-c;c===0&&t(13,c=10),t(2,A=(ke-b)/c);let Xe=ie*A;for(;oe<l.length;)oe+=1,k[oe]=A;t(4,B=Xe),isFinite(B)||t(4,B=2e5)}async function ae(q,m,p=!1){await St();const F=A;let C=q*F;p&&(C=C-Q+F+b);const be=H.offsetHeight-H.clientHeight;be>0&&(C+=be);const oe={top:C,behavior:"smooth",...m};H.scrollTo(oe)}$s(()=>{E=j.children,t(19,D=!0),v(i)});function O(){b=this.offsetHeight,t(6,b)}function pe(q){Vl[q?"unshift":"push"](()=>{j=q,t(5,j)})}function J(){w=this.offsetHeight,t(7,w)}function te(q){Vl[q?"unshift":"push"](()=>{H=q,t(9,H)})}function Y(){K=Us.entries.get(this)?.contentRect,t(3,K)}return n.$$set=q=>{"items"in q&&t(16,i=q.items),"max_height"in q&&t(0,r=q.max_height),"actual_height"in q&&t(14,a=q.actual_height),"table_scrollbar_width"in q&&t(15,f=q.table_scrollbar_width),"start"in q&&t(12,u=q.start),"end"in q&&t(13,c=q.end),"selected"in q&&t(17,h=q.selected),"disable_scroll"in q&&t(1,g=q.disable_scroll),"$$scope"in q&&t(21,s=q.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&8&&(Q=K?.height||200),n.$$.dirty[0]&65536&&t(20,l=i),n.$$.dirty[0]&1572864&&D&&N(()=>v(l)),n.$$.dirty[0]&131072&&T(h),n.$$.dirty[0]&1060869&&t(10,x=y?l.slice(u,c).map((q,m)=>({index:m+u,data:q})):l.slice(0,r/l.length*A+1).map((q,m)=>({index:m+u,data:q})))},[r,g,A,K,B,j,b,w,z,H,x,De,u,c,a,f,i,h,ae,D,l,s,o,O,pe,J,te,Y]}class ri extends Vs{constructor(e){super(),Xs(this,e,ii,ni,Gs,{items:16,max_height:0,actual_height:14,table_scrollbar_width:15,start:12,end:13,selected:17,disable_scroll:1,scroll_to_index:18},null,[-1,-1])}get items(){return this.$$.ctx[16]}set items(e){this.$$set({items:e}),Je()}get max_height(){return this.$$.ctx[0]}set max_height(e){this.$$set({max_height:e}),Je()}get actual_height(){return this.$$.ctx[14]}set actual_height(e){this.$$set({actual_height:e}),Je()}get table_scrollbar_width(){return this.$$.ctx[15]}set table_scrollbar_width(e){this.$$set({table_scrollbar_width:e}),Je()}get start(){return this.$$.ctx[12]}set start(e){this.$$set({start:e}),Je()}get end(){return this.$$.ctx[13]}set end(e){this.$$set({end:e}),Je()}get selected(){return this.$$.ctx[17]}set selected(e){this.$$set({selected:e}),Je()}get disable_scroll(){return this.$$.ctx[1]}set disable_scroll(e){this.$$set({disable_scroll:e}),Je()}get scroll_to_index(){return this.$$.ctx[18]}}const{SvelteComponent:ui,append:Le,attr:S,detach:st,empty:_i,flush:ai,init:fi,insert:it,noop:en,safe_not_equal:ci,svg_element:de}=window.__gradio__svelte__internal;function hi(n){let e,t,l;return{c(){e=de("svg"),t=de("rect"),l=de("path"),S(t,"x","10"),S(t,"y","5"),S(t,"width","4"),S(t,"height","14"),S(t,"stroke","currentColor"),S(t,"stroke-width","2"),S(l,"d","M7 8L17 16M17 8L7 16"),S(l,"stroke","currentColor"),S(l,"stroke-width","2"),S(l,"stroke-linecap","round"),S(e,"viewBox","0 0 24 24"),S(e,"width","16"),S(e,"height","16")},m(o,s){it(o,e,s),Le(e,t),Le(e,l)},d(o){o&&st(e)}}}function di(n){let e,t,l;return{c(){e=de("svg"),t=de("rect"),l=de("path"),S(t,"x","5"),S(t,"y","10"),S(t,"width","14"),S(t,"height","4"),S(t,"stroke","currentColor"),S(t,"stroke-width","2"),S(l,"d","M8 7L16 17M16 7L8 17"),S(l,"stroke","currentColor"),S(l,"stroke-width","2"),S(l,"stroke-linecap","round"),S(e,"viewBox","0 0 24 24"),S(e,"width","16"),S(e,"height","16")},m(o,s){it(o,e,s),Le(e,t),Le(e,l)},d(o){o&&st(e)}}}function mi(n){let e,t,l;return{c(){e=de("svg"),t=de("rect"),l=de("path"),S(t,"x","6"),S(t,"y","4"),S(t,"width","12"),S(t,"height","4"),S(t,"stroke","currentColor"),S(t,"stroke-width","2"),S(l,"d","M12 12V19M8 16L12 19L16 16"),S(l,"stroke","currentColor"),S(l,"stroke-width","2"),S(l,"fill","none"),S(l,"stroke-linecap","round"),S(e,"viewBox","0 0 24 24"),S(e,"width","16"),S(e,"height","16")},m(o,s){it(o,e,s),Le(e,t),Le(e,l)},d(o){o&&st(e)}}}function gi(n){let e,t,l;return{c(){e=de("svg"),t=de("rect"),l=de("path"),S(t,"x","6"),S(t,"y","16"),S(t,"width","12"),S(t,"height","4"),S(t,"stroke","currentColor"),S(t,"stroke-width","2"),S(l,"d","M12 12V5M8 8L12 5L16 8"),S(l,"stroke","currentColor"),S(l,"stroke-width","2"),S(l,"fill","none"),S(l,"stroke-linecap","round"),S(e,"viewBox","0 0 24 24"),S(e,"width","16"),S(e,"height","16")},m(o,s){it(o,e,s),Le(e,t),Le(e,l)},d(o){o&&st(e)}}}function bi(n){let e,t,l;return{c(){e=de("svg"),t=de("rect"),l=de("path"),S(t,"x","16"),S(t,"y","6"),S(t,"width","4"),S(t,"height","12"),S(t,"stroke","currentColor"),S(t,"stroke-width","2"),S(t,"fill","none"),S(l,"d","M12 12H5M8 8L5 12L8 16"),S(l,"stroke","currentColor"),S(l,"stroke-width","2"),S(l,"fill","none"),S(l,"stroke-linecap","round"),S(e,"viewBox","0 0 24 24"),S(e,"width","16"),S(e,"height","16")},m(o,s){it(o,e,s),Le(e,t),Le(e,l)},d(o){o&&st(e)}}}function wi(n){let e,t,l;return{c(){e=de("svg"),t=de("rect"),l=de("path"),S(t,"x","4"),S(t,"y","6"),S(t,"width","4"),S(t,"height","12"),S(t,"stroke","currentColor"),S(t,"stroke-width","2"),S(t,"fill","none"),S(l,"d","M12 12H19M16 8L19 12L16 16"),S(l,"stroke","currentColor"),S(l,"stroke-width","2"),S(l,"fill","none"),S(l,"stroke-linecap","round"),S(e,"viewBox","0 0 24 24"),S(e,"width","16"),S(e,"height","16")},m(o,s){it(o,e,s),Le(e,t),Le(e,l)},d(o){o&&st(e)}}}function pi(n){let e;function t(s,i){if(s[0]=="add-column-right")return wi;if(s[0]=="add-column-left")return bi;if(s[0]=="add-row-above")return gi;if(s[0]=="add-row-below")return mi;if(s[0]=="delete-row")return di;if(s[0]=="delete-column")return hi}let l=t(n),o=l&&l(n);return{c(){o&&o.c(),e=_i()},m(s,i){o&&o.m(s,i),it(s,e,i)},p(s,[i]){l!==(l=t(s))&&(o&&o.d(1),o=l&&l(s),o&&(o.c(),o.m(e.parentNode,e)))},i:en,o:en,d(s){s&&st(e),o&&o.d(s)}}}function ki(n,e,t){let{icon:l}=e;return n.$$set=o=>{"icon"in o&&t(0,l=o.icon)},[l]}class ct extends ui{constructor(e){super(),fi(this,e,ki,pi,ci,{icon:0})}get icon(){return this.$$.ctx[0]}set icon(e){this.$$set({icon:e}),ai()}}const{SvelteComponent:vi,append:Me,attr:lt,binding_callbacks:yi,check_outros:Gt,create_component:ht,destroy_component:dt,detach:Ae,element:nt,empty:Zn,flush:ve,group_outros:Qt,init:qi,insert:Se,is_function:$n,listen:mt,mount_component:gt,run_all:xn,safe_not_equal:Ci,set_data:bt,space:He,text:wt,transition_in:he,transition_out:ye}=window.__gradio__svelte__internal,{onMount:Ei}=window.__gradio__svelte__internal;function tn(n){let e,t,l,o=n[8]("dataframe.add_row_above")+"",s,i,r,a,f,u=n[8]("dataframe.add_row_below")+"",c,h,g,A,B,j;t=new ct({props:{icon:"add-row-above"}}),a=new ct({props:{icon:"add-row-below"}});let b=n[6]&&ln(n);return{c(){e=nt("button"),ht(t.$$.fragment),l=He(),s=wt(o),i=He(),r=nt("button"),ht(a.$$.fragment),f=He(),c=wt(u),h=He(),b&&b.c(),g=Zn(),lt(e,"class","svelte-1d2u1p1"),lt(r,"class","svelte-1d2u1p1")},m(w,k){Se(w,e,k),gt(t,e,null),Me(e,l),Me(e,s),Se(w,i,k),Se(w,r,k),gt(a,r,null),Me(r,f),Me(r,c),Se(w,h,k),b&&b.m(w,k),Se(w,g,k),A=!0,B||(j=[mt(e,"click",n[18]),mt(r,"click",n[19])],B=!0)},p(w,k){(!A||k&256)&&o!==(o=w[8]("dataframe.add_row_above")+"")&&bt(s,o),(!A||k&256)&&u!==(u=w[8]("dataframe.add_row_below")+"")&&bt(c,u),w[6]?b?(b.p(w,k),k&64&&he(b,1)):(b=ln(w),b.c(),he(b,1),b.m(g.parentNode,g)):b&&(Qt(),ye(b,1,1,()=>{b=null}),Gt())},i(w){A||(he(t.$$.fragment,w),he(a.$$.fragment,w),he(b),A=!0)},o(w){ye(t.$$.fragment,w),ye(a.$$.fragment,w),ye(b),A=!1},d(w){w&&(Ae(e),Ae(i),Ae(r),Ae(h),Ae(g)),dt(t),dt(a),b&&b.d(w),B=!1,xn(j)}}}function ln(n){let e,t,l,o=n[8]("dataframe.delete_row")+"",s,i,r,a;return t=new ct({props:{icon:"delete-row"}}),{c(){e=nt("button"),ht(t.$$.fragment),l=He(),s=wt(o),lt(e,"class","delete svelte-1d2u1p1")},m(f,u){Se(f,e,u),gt(t,e,null),Me(e,l),Me(e,s),i=!0,r||(a=mt(e,"click",function(){$n(n[4])&&n[4].apply(this,arguments)}),r=!0)},p(f,u){n=f,(!i||u&256)&&o!==(o=n[8]("dataframe.delete_row")+"")&&bt(s,o)},i(f){i||(he(t.$$.fragment,f),i=!0)},o(f){ye(t.$$.fragment,f),i=!1},d(f){f&&Ae(e),dt(t),r=!1,a()}}}function nn(n){let e,t,l,o=n[8]("dataframe.add_column_left")+"",s,i,r,a,f,u=n[8]("dataframe.add_column_right")+"",c,h,g,A,B,j;t=new ct({props:{icon:"add-column-left"}}),a=new ct({props:{icon:"add-column-right"}});let b=n[7]&&on(n);return{c(){e=nt("button"),ht(t.$$.fragment),l=He(),s=wt(o),i=He(),r=nt("button"),ht(a.$$.fragment),f=He(),c=wt(u),h=He(),b&&b.c(),g=Zn(),lt(e,"class","svelte-1d2u1p1"),lt(r,"class","svelte-1d2u1p1")},m(w,k){Se(w,e,k),gt(t,e,null),Me(e,l),Me(e,s),Se(w,i,k),Se(w,r,k),gt(a,r,null),Me(r,f),Me(r,c),Se(w,h,k),b&&b.m(w,k),Se(w,g,k),A=!0,B||(j=[mt(e,"click",n[20]),mt(r,"click",n[21])],B=!0)},p(w,k){(!A||k&256)&&o!==(o=w[8]("dataframe.add_column_left")+"")&&bt(s,o),(!A||k&256)&&u!==(u=w[8]("dataframe.add_column_right")+"")&&bt(c,u),w[7]?b?(b.p(w,k),k&128&&he(b,1)):(b=on(w),b.c(),he(b,1),b.m(g.parentNode,g)):b&&(Qt(),ye(b,1,1,()=>{b=null}),Gt())},i(w){A||(he(t.$$.fragment,w),he(a.$$.fragment,w),he(b),A=!0)},o(w){ye(t.$$.fragment,w),ye(a.$$.fragment,w),ye(b),A=!1},d(w){w&&(Ae(e),Ae(i),Ae(r),Ae(h),Ae(g)),dt(t),dt(a),b&&b.d(w),B=!1,xn(j)}}}function on(n){let e,t,l,o=n[8]("dataframe.delete_column")+"",s,i,r,a;return t=new ct({props:{icon:"delete-column"}}),{c(){e=nt("button"),ht(t.$$.fragment),l=He(),s=wt(o),lt(e,"class","delete svelte-1d2u1p1")},m(f,u){Se(f,e,u),gt(t,e,null),Me(e,l),Me(e,s),i=!0,r||(a=mt(e,"click",function(){$n(n[5])&&n[5].apply(this,arguments)}),r=!0)},p(f,u){n=f,(!i||u&256)&&o!==(o=n[8]("dataframe.delete_column")+"")&&bt(s,o)},i(f){i||(he(t.$$.fragment,f),i=!0)},o(f){ye(t.$$.fragment,f),i=!1},d(f){f&&Ae(e),dt(t),r=!1,a()}}}function Ai(n){let e,t,l,o=!n[12]&&n[11]&&tn(n),s=n[10]&&nn(n);return{c(){e=nt("div"),o&&o.c(),t=He(),s&&s.c(),lt(e,"class","cell-menu svelte-1d2u1p1")},m(i,r){Se(i,e,r),o&&o.m(e,null),Me(e,t),s&&s.m(e,null),n[22](e),l=!0},p(i,[r]){!i[12]&&i[11]?o?(o.p(i,r),r&6144&&he(o,1)):(o=tn(i),o.c(),he(o,1),o.m(e,t)):o&&(Qt(),ye(o,1,1,()=>{o=null}),Gt()),i[10]?s?(s.p(i,r),r&1024&&he(s,1)):(s=nn(i),s.c(),he(s,1),s.m(e,null)):s&&(Qt(),ye(s,1,1,()=>{s=null}),Gt())},i(i){l||(he(o),he(s),l=!0)},o(i){ye(o),ye(s),l=!1},d(i){i&&Ae(e),o&&o.d(),s&&s.d(),n[22](null)}}}function Si(n,e,t){let l,o,s,{x:i}=e,{y:r}=e,{on_add_row_above:a}=e,{on_add_row_below:f}=e,{on_add_column_left:u}=e,{on_add_column_right:c}=e,{row:h}=e,{col_count:g}=e,{row_count:A}=e,{on_delete_row:B}=e,{on_delete_col:j}=e,{can_delete_rows:b}=e,{can_delete_cols:w}=e,{i18n:k}=e,D;Ei(()=>{E()});function E(){if(!D)return;const y=window.innerWidth,N=window.innerHeight,X=D.getBoundingClientRect();let v=i-30,T=r-20;v+X.width>y&&(v=i-X.width+10),T+X.height>N&&(T=r-X.height+10),t(9,D.style.left=`${v}px`,D),t(9,D.style.top=`${T}px`,D)}const z=()=>a(),H=()=>f(),Q=()=>u(),x=()=>c();function K(y){yi[y?"unshift":"push"](()=>{D=y,t(9,D)})}return n.$$set=y=>{"x"in y&&t(13,i=y.x),"y"in y&&t(14,r=y.y),"on_add_row_above"in y&&t(0,a=y.on_add_row_above),"on_add_row_below"in y&&t(1,f=y.on_add_row_below),"on_add_column_left"in y&&t(2,u=y.on_add_column_left),"on_add_column_right"in y&&t(3,c=y.on_add_column_right),"row"in y&&t(15,h=y.row),"col_count"in y&&t(16,g=y.col_count),"row_count"in y&&t(17,A=y.row_count),"on_delete_row"in y&&t(4,B=y.on_delete_row),"on_delete_col"in y&&t(5,j=y.on_delete_col),"can_delete_rows"in y&&t(6,b=y.can_delete_rows),"can_delete_cols"in y&&t(7,w=y.can_delete_cols),"i18n"in y&&t(8,k=y.i18n)},n.$$.update=()=>{n.$$.dirty&32768&&t(12,l=h===-1),n.$$.dirty&131072&&t(11,o=A[1]==="dynamic"),n.$$.dirty&65536&&t(10,s=g[1]==="dynamic")},[a,f,u,c,B,j,b,w,k,D,s,o,l,i,r,h,g,A,z,H,Q,x,K]}class eo extends vi{constructor(e){super(),qi(this,e,Si,Ai,Ci,{x:13,y:14,on_add_row_above:0,on_add_row_below:1,on_add_column_left:2,on_add_column_right:3,row:15,col_count:16,row_count:17,on_delete_row:4,on_delete_col:5,can_delete_rows:6,can_delete_cols:7,i18n:8})}get x(){return this.$$.ctx[13]}set x(e){this.$$set({x:e}),ve()}get y(){return this.$$.ctx[14]}set y(e){this.$$set({y:e}),ve()}get on_add_row_above(){return this.$$.ctx[0]}set on_add_row_above(e){this.$$set({on_add_row_above:e}),ve()}get on_add_row_below(){return this.$$.ctx[1]}set on_add_row_below(e){this.$$set({on_add_row_below:e}),ve()}get on_add_column_left(){return this.$$.ctx[2]}set on_add_column_left(e){this.$$set({on_add_column_left:e}),ve()}get on_add_column_right(){return this.$$.ctx[3]}set on_add_column_right(e){this.$$set({on_add_column_right:e}),ve()}get row(){return this.$$.ctx[15]}set row(e){this.$$set({row:e}),ve()}get col_count(){return this.$$.ctx[16]}set col_count(e){this.$$set({col_count:e}),ve()}get row_count(){return this.$$.ctx[17]}set row_count(e){this.$$set({row_count:e}),ve()}get on_delete_row(){return this.$$.ctx[4]}set on_delete_row(e){this.$$set({on_delete_row:e}),ve()}get on_delete_col(){return this.$$.ctx[5]}set on_delete_col(e){this.$$set({on_delete_col:e}),ve()}get can_delete_rows(){return this.$$.ctx[6]}set can_delete_rows(e){this.$$set({can_delete_rows:e}),ve()}get can_delete_cols(){return this.$$.ctx[7]}set can_delete_cols(e){this.$$set({can_delete_cols:e}),ve()}get i18n(){return this.$$.ctx[8]}set i18n(e){this.$$set({i18n:e}),ve()}}const{SvelteComponent:Mi,append:zi,attr:We,detach:Li,init:Di,insert:Bi,noop:cl,safe_not_equal:ji,svg_element:sn}=window.__gradio__svelte__internal;function Ti(n){let e,t;return{c(){e=sn("svg"),t=sn("path"),We(t,"d","M4 4h16v2.67l-6.67 6.67v8L9.33 19v-5.66L2.67 6.67V4h1.33z"),We(t,"stroke","currentColor"),We(t,"stroke-width","2"),We(t,"stroke-linecap","round"),We(t,"stroke-linejoin","round"),We(e,"viewBox","0 0 24 24"),We(e,"fill","none"),We(e,"xmlns","http://www.w3.org/2000/svg")},m(l,o){Bi(l,e,o),zi(e,t)},p:cl,i:cl,o:cl,d(l){l&&Li(e)}}}function Ri(n){return[]}class to extends Mi{constructor(e){super(),Di(this,e,Ri,Ti,ji,{})}}const{SvelteComponent:Hi,append:Mt,attr:_e,bubble:Pi,check_outros:at,create_component:Bt,destroy_component:jt,detach:Tt,element:ot,flush:xe,group_outros:ft,init:Ni,insert:Rt,is_function:Fi,listen:ll,mount_component:Ht,safe_not_equal:Oi,set_input_value:rn,space:vl,transition_in:ue,transition_out:me}=window.__gradio__svelte__internal,{onDestroy:Ii}=window.__gradio__svelte__internal,{createEventDispatcher:Ki}=window.__gradio__svelte__internal;function un(n){let e,t,l,o,s,i,r=n[0]&&n[3]==="filter"&&_n(n);return{c(){e=ot("div"),t=ot("input"),l=vl(),r&&r.c(),_e(t,"type","text"),_e(t,"placeholder","Search..."),_e(t,"class","search-input svelte-b1nr0g"),_e(e,"class","search-container svelte-b1nr0g")},m(a,f){Rt(a,e,f),Mt(e,t),rn(t,n[0]),Mt(e,l),r&&r.m(e,null),o=!0,s||(i=ll(t,"input",n[10]),s=!0)},p(a,f){f&1&&t.value!==a[0]&&rn(t,a[0]),a[0]&&a[3]==="filter"?r?(r.p(a,f),f&9&&ue(r,1)):(r=_n(a),r.c(),ue(r,1),r.m(e,null)):r&&(ft(),me(r,1,1,()=>{r=null}),at())},i(a){o||(ue(r),o=!0)},o(a){me(r),o=!1},d(a){a&&Tt(e),r&&r.d(),s=!1,i()}}}function _n(n){let e,t,l,o,s;return t=new to({}),{c(){e=ot("button"),Bt(t.$$.fragment),_e(e,"class","toolbar-button check-button svelte-b1nr0g"),_e(e,"aria-label","Apply filter and update dataframe values"),_e(e,"title","Apply filter and update dataframe values")},m(i,r){Rt(i,e,r),Ht(t,e,null),l=!0,o||(s=ll(e,"click",function(){Fi(n[5])&&n[5].apply(this,arguments)}),o=!0)},p(i,r){n=i},i(i){l||(ue(t.$$.fragment,i),l=!0)},o(i){me(t.$$.fragment,i),l=!1},d(i){i&&Tt(e),jt(t),o=!1,s()}}}function an(n){let e,t,l,o,s,i,r,a;const f=[Vi,Ui],u=[];function c(h,g){return h[6]?0:1}return t=c(n),l=u[t]=f[t](n),{c(){e=ot("button"),l.c(),_e(e,"class","toolbar-button svelte-b1nr0g"),_e(e,"aria-label",o=n[6]?"Copied to clipboard":"Copy table data"),_e(e,"title",s=n[6]?"Copied to clipboard":"Copy table data")},m(h,g){Rt(h,e,g),u[t].m(e,null),i=!0,r||(a=ll(e,"click",n[7]),r=!0)},p(h,g){let A=t;t=c(h),t!==A&&(ft(),me(u[A],1,1,()=>{u[A]=null}),at(),l=u[t],l||(l=u[t]=f[t](h),l.c()),ue(l,1),l.m(e,null)),(!i||g&64&&o!==(o=h[6]?"Copied to clipboard":"Copy table data"))&&_e(e,"aria-label",o),(!i||g&64&&s!==(s=h[6]?"Copied to clipboard":"Copy table data"))&&_e(e,"title",s)},i(h){i||(ue(l),i=!0)},o(h){me(l),i=!1},d(h){h&&Tt(e),u[t].d(),r=!1,a()}}}function Ui(n){let e,t;return e=new ms({}),{c(){Bt(e.$$.fragment)},m(l,o){Ht(e,l,o),t=!0},i(l){t||(ue(e.$$.fragment,l),t=!0)},o(l){me(e.$$.fragment,l),t=!1},d(l){jt(e,l)}}}function Vi(n){let e,t;return e=new to({}),{c(){Bt(e.$$.fragment)},m(l,o){Ht(e,l,o),t=!0},i(l){t||(ue(e.$$.fragment,l),t=!0)},o(l){me(e.$$.fragment,l),t=!1},d(l){jt(e,l)}}}function fn(n){let e,t,l,o,s,i,r,a;const f=[Yi,Xi],u=[];function c(h,g){return h[4]?0:1}return t=c(n),l=u[t]=f[t](n),{c(){e=ot("button"),l.c(),_e(e,"class","toolbar-button svelte-b1nr0g"),_e(e,"aria-label",o=n[4]?"Exit fullscreen":"Enter fullscreen"),_e(e,"title",s=n[4]?"Exit fullscreen":"Enter fullscreen")},m(h,g){Rt(h,e,g),u[t].m(e,null),i=!0,r||(a=ll(e,"click",n[9]),r=!0)},p(h,g){let A=t;t=c(h),t!==A&&(ft(),me(u[A],1,1,()=>{u[A]=null}),at(),l=u[t],l||(l=u[t]=f[t](h),l.c()),ue(l,1),l.m(e,null)),(!i||g&16&&o!==(o=h[4]?"Exit fullscreen":"Enter fullscreen"))&&_e(e,"aria-label",o),(!i||g&16&&s!==(s=h[4]?"Exit fullscreen":"Enter fullscreen"))&&_e(e,"title",s)},i(h){i||(ue(l),i=!0)},o(h){me(l),i=!1},d(h){h&&Tt(e),u[t].d(),r=!1,a()}}}function Xi(n){let e,t;return e=new gs({}),{c(){Bt(e.$$.fragment)},m(l,o){Ht(e,l,o),t=!0},i(l){t||(ue(e.$$.fragment,l),t=!0)},o(l){me(e.$$.fragment,l),t=!1},d(l){jt(e,l)}}}function Yi(n){let e,t;return e=new bs({}),{c(){Bt(e.$$.fragment)},m(l,o){Ht(e,l,o),t=!0},i(l){t||(ue(e.$$.fragment,l),t=!0)},o(l){me(e.$$.fragment,l),t=!1},d(l){jt(e,l)}}}function Ji(n){let e,t,l,o,s,i=n[3]!=="none"&&un(n),r=n[2]&&an(n),a=n[1]&&fn(n);return{c(){e=ot("div"),t=ot("div"),i&&i.c(),l=vl(),r&&r.c(),o=vl(),a&&a.c(),_e(t,"class","toolbar-buttons svelte-b1nr0g"),_e(e,"class","toolbar svelte-b1nr0g"),_e(e,"role","toolbar"),_e(e,"aria-label","Table actions")},m(f,u){Rt(f,e,u),Mt(e,t),i&&i.m(t,null),Mt(t,l),r&&r.m(t,null),Mt(t,o),a&&a.m(t,null),s=!0},p(f,[u]){f[3]!=="none"?i?(i.p(f,u),u&8&&ue(i,1)):(i=un(f),i.c(),ue(i,1),i.m(t,l)):i&&(ft(),me(i,1,1,()=>{i=null}),at()),f[2]?r?(r.p(f,u),u&4&&ue(r,1)):(r=an(f),r.c(),ue(r,1),r.m(t,o)):r&&(ft(),me(r,1,1,()=>{r=null}),at()),f[1]?a?(a.p(f,u),u&2&&ue(a,1)):(a=fn(f),a.c(),ue(a,1),a.m(t,null)):a&&(ft(),me(a,1,1,()=>{a=null}),at())},i(f){s||(ue(i),ue(r),ue(a),s=!0)},o(f){me(i),me(r),me(a),s=!1},d(f){f&&Tt(e),i&&i.d(),r&&r.d(),a&&a.d()}}}function Wi(n,e,t){let{show_fullscreen_button:l=!1}=e,{show_copy_button:o=!1}=e,{show_search:s="none"}=e,{is_fullscreen:i=!1}=e,{on_copy:r}=e,{on_commit_filter:a}=e;const f=Ki();let u=!1,c,{current_search_query:h=null}=e;function g(){t(6,u=!0),c&&clearTimeout(c),c=setTimeout(()=>{t(6,u=!1)},2e3)}async function A(){await r(),g()}Ii(()=>{c&&clearTimeout(c)});function B(b){Pi.call(this,n,b)}function j(){h=this.value,t(0,h)}return n.$$set=b=>{"show_fullscreen_button"in b&&t(1,l=b.show_fullscreen_button),"show_copy_button"in b&&t(2,o=b.show_copy_button),"show_search"in b&&t(3,s=b.show_search),"is_fullscreen"in b&&t(4,i=b.is_fullscreen),"on_copy"in b&&t(8,r=b.on_copy),"on_commit_filter"in b&&t(5,a=b.on_commit_filter),"current_search_query"in b&&t(0,h=b.current_search_query)},n.$$.update=()=>{n.$$.dirty&1&&f("search",h)},[h,l,o,s,i,a,u,A,r,B,j]}class Gi extends Hi{constructor(e){super(),Ni(this,e,Wi,Ji,Oi,{show_fullscreen_button:1,show_copy_button:2,show_search:3,is_fullscreen:4,on_copy:8,on_commit_filter:5,current_search_query:0})}get show_fullscreen_button(){return this.$$.ctx[1]}set show_fullscreen_button(e){this.$$set({show_fullscreen_button:e}),xe()}get show_copy_button(){return this.$$.ctx[2]}set show_copy_button(e){this.$$set({show_copy_button:e}),xe()}get show_search(){return this.$$.ctx[3]}set show_search(e){this.$$set({show_search:e}),xe()}get is_fullscreen(){return this.$$.ctx[4]}set is_fullscreen(e){this.$$set({is_fullscreen:e}),xe()}get on_copy(){return this.$$.ctx[8]}set on_copy(e){this.$$set({on_copy:e}),xe()}get on_commit_filter(){return this.$$.ctx[5]}set on_commit_filter(e){this.$$set({on_commit_filter:e}),xe()}get current_search_query(){return this.$$.ctx[0]}set current_search_query(e){this.$$set({current_search_query:e}),xe()}}const{SvelteComponent:Qi,append:et,attr:U,detach:Zi,element:hl,flush:cn,init:$i,insert:xi,listen:hn,noop:dn,run_all:er,safe_not_equal:tr,space:lr,svg_element:Vt,toggle_class:Xt}=window.__gradio__svelte__internal,{createEventDispatcher:nr}=window.__gradio__svelte__internal;function or(n){let e,t,l,o,s,i,r,a,f,u,c,h,g,A,B;return{c(){e=hl("div"),t=hl("button"),l=Vt("svg"),o=Vt("path"),r=lr(),a=hl("button"),f=Vt("svg"),u=Vt("path"),U(o,"d","M7 14l5-5 5 5"),U(o,"stroke","currentColor"),U(o,"stroke-width","2"),U(o,"stroke-linecap","round"),U(o,"stroke-linejoin","round"),U(l,"viewBox","0 0 24 24"),U(l,"fill","none"),U(l,"xmlns","http://www.w3.org/2000/svg"),U(l,"aria-hidden","true"),U(l,"focusable","false"),U(l,"class","svelte-a5uqm5"),U(t,"class","sort-button up svelte-a5uqm5"),U(t,"aria-label",s=n[1]("dataframe.sort_ascending")),U(t,"aria-pressed",i=n[0]==="asc"),Xt(t,"active",n[0]==="asc"),U(u,"d","M7 10l5 5 5-5"),U(u,"stroke","currentColor"),U(u,"stroke-width","2"),U(u,"stroke-linecap","round"),U(u,"stroke-linejoin","round"),U(f,"viewBox","0 0 24 24"),U(f,"fill","none"),U(f,"xmlns","http://www.w3.org/2000/svg"),U(f,"aria-hidden","true"),U(f,"focusable","false"),U(f,"class","svelte-a5uqm5"),U(a,"class","sort-button down svelte-a5uqm5"),U(a,"aria-label",c=n[1]("dataframe.sort_descending")),U(a,"aria-pressed",h=n[0]==="des"),Xt(a,"active",n[0]==="des"),U(e,"class","sort-icons svelte-a5uqm5"),U(e,"role","group"),U(e,"aria-label",g=n[1]("dataframe.sort_column"))},m(j,b){xi(j,e,b),et(e,t),et(t,l),et(l,o),et(e,r),et(e,a),et(a,f),et(f,u),A||(B=[hn(t,"click",n[3]),hn(a,"click",n[4])],A=!0)},p(j,[b]){b&2&&s!==(s=j[1]("dataframe.sort_ascending"))&&U(t,"aria-label",s),b&1&&i!==(i=j[0]==="asc")&&U(t,"aria-pressed",i),b&1&&Xt(t,"active",j[0]==="asc"),b&2&&c!==(c=j[1]("dataframe.sort_descending"))&&U(a,"aria-label",c),b&1&&h!==(h=j[0]==="des")&&U(a,"aria-pressed",h),b&1&&Xt(a,"active",j[0]==="des"),b&2&&g!==(g=j[1]("dataframe.sort_column"))&&U(e,"aria-label",g)},i:dn,o:dn,d(j){j&&Zi(e),A=!1,er(B)}}}function sr(n,e,t){let{direction:l=null}=e,{i18n:o}=e;const s=nr(),i=()=>s("sort","asc"),r=()=>s("sort","des");return n.$$set=a=>{"direction"in a&&t(0,l=a.direction),"i18n"in a&&t(1,o=a.i18n)},[l,o,s,i,r]}class lo extends Qi{constructor(e){super(),$i(this,e,sr,or,tr,{direction:0,i18n:1})}get direction(){return this.$$.ctx[0]}set direction(e){this.$$set({direction:e}),cn()}get i18n(){return this.$$.ctx[1]}set i18n(e){this.$$set({i18n:e}),cn()}}function Yt(n,e){const[t,l]=n;if(!e.some(([a,f])=>a===t&&f===l))return"";const o=e.some(([a,f])=>a===t-1&&f===l),s=e.some(([a,f])=>a===t+1&&f===l),i=e.some(([a,f])=>a===t&&f===l-1),r=e.some(([a,f])=>a===t&&f===l+1);return`cell-selected${o?" no-top":""}${s?" no-bottom":""}${i?" no-left":""}${r?" no-right":""}`}function no(n,e){const[t,l]=n,[o,s]=e,i=Math.min(t,o),r=Math.max(t,o),a=Math.min(l,s),f=Math.max(l,s),u=[];for(let c=i;c<=r;c++)for(let h=a;h<=f;h++)u.push([c,h]);return u}function ir(n,e,t){if(t.shiftKey&&e.length>0)return no(e[e.length-1],n);if(t.metaKey||t.ctrlKey){const l=([s,i])=>s===n[0]&&i===n[1],o=e.findIndex(l);return o===-1?[...e,n]:e.filter((s,i)=>i!==o)}return[n]}function rr(n,e){const t=n.map(l=>[...l]);return e.forEach(([l,o])=>{t[l]&&t[l][o]&&(t[l][o]={...t[l][o],value:""})}),t}function mn(n,e,t){const[l,o]=n;return t&&e.length===1&&e[0][0]===l&&e[0][1]===o}function ur(n,e,t){const[l,o]=n,s=t?-1:1;if(e[l]?.[o+s])return[l,o+s];const i=l+(s>0?1:0),r=l+(s<0?-1:0);return s>0&&e[i]?.[0]?[i,0]:s<0&&e[r]?.[e[0].length-1]?[r,e[0].length-1]:!1}function _r(n,e,t){const l={ArrowRight:[0,1],ArrowLeft:[0,-1],ArrowDown:[1,0],ArrowUp:[-1,0]}[n],o=e[0]+l[0],s=e[1]+l[1];return o<0&&s<=0?!1:t[o]?.[s]?[o,s]:!1}function ar(n,e){return e.reduce((t,l,o)=>{const s=l.reduce((i,r,a)=>n===r.id?a:i,-1);return s===-1?t:[o,s]},[-1,-1])}function fr(n,e){const[t]=n.composedPath();return!e.contains(t)}function cr(n,e){return Array.from({length:n.length},(t,l)=>[l,e])}function hr(n,e){return Array.from({length:n[0].length},(t,l)=>[e,l])}function dr(n,e,t,l,o){const[s,i]=n;if(!e[s]?.[i])return{col_pos:"0px",row_pos:void 0};let r=0;for(let B=0;B<i;B++)r+=parseFloat(getComputedStyle(l).getPropertyValue(`--cell-width-${B}`));const a=e[s][i].id,f=t[a]?.cell;if(!f)return{col_pos:"0px",row_pos:void 0};const u=f.getBoundingClientRect(),c=o.getBoundingClientRect(),h=`${u.left-c.left+u.width/2}px`,A=`${u.top-c.top+u.height/2}px`;return{col_pos:h,row_pos:A}}function mr(n,e,t){if(!n||!n.length||!n[0])return[];if(typeof e=="number"&&t&&e>=0&&e<n[0].length){const l=[...Array(n.length)].map((o,s)=>s);return l.sort((o,s)=>{const i=n[o],r=n[s];if(!i||!r||e>=i.length||e>=r.length)return 0;const a=i[e].value,f=r[e].value,u=a<f?-1:a>f?1:0;return t==="asc"?u:-u}),l}return[...Array(n.length)].map((l,o)=>o)}function gr(n){if(!n||!n.length)return[];let e=n[0].slice();for(let t=0;t<n.length;t++)for(let l=0;l<n[t].length;l++)`${e[l].value}`.length<`${n[t][l].value}`.length&&(e[l]=n[t][l]);return e}function br(n,e,t,l,o){const s=mr(n,l,o),i=s.map(r=>n[r]);if(n.splice(0,n.length,...i),e){const r=s.map(a=>e[a]);e.splice(0,e.length,...r)}if(t){const r=s.map(a=>t[a]);t.splice(0,t.length,...r)}}async function wr(n,e){const t=e.reduce((i,[r,a])=>{i[r]=i[r]||{};const f=String(n[r][a].value);return i[r][a]=f.includes(",")||f.includes('"')||f.includes(`
|
|
`)?`"${f.replace(/"/g,'""')}"`:f,i},{}),l=Object.keys(t).sort((i,r)=>+i-+r),o=Object.keys(t[l[0]]).sort((i,r)=>+i-+r),s=l.map(i=>o.map(r=>t[i][r]||"").join(",")).join(`
|
|
`);try{await navigator.clipboard.writeText(s)}catch(i){throw console.error("Copy failed:",i),new Error("Failed to copy to clipboard: "+i.message)}}function pr(n,e){return e.filter(t);function t(l){var o=-1;return n.split(`
|
|
`).every(s);function s(i){if(!i)return!0;var r=i.split(l).length;return o<0&&(o=r),o===r&&r>1}}}function kr(n){const e=atob(n.split(",")[1]),t=n.split(",")[0].split(":")[1].split(";")[0],l=new ArrayBuffer(e.length),o=new Uint8Array(l);for(let s=0;s<e.length;s++)o[s]=e.charCodeAt(s);return new Blob([l],{type:t})}function vr(n,e,t){const l=kr(n),o=new FileReader;o.addEventListener("loadend",s=>{if(!s?.target?.result||typeof s.target.result!="string")return;const[i]=pr(s.target.result,[","," "]),[r,...a]=ws(i).parseRows(s.target.result);e(r),t(a)}),o.readAsText(l)}const{ResizeObserverSingleton:yr,SvelteComponent:qr,add_flush_callback:Oe,append:V,attr:P,bind:Ie,binding_callbacks:qe,check_outros:Ue,create_component:Pe,destroy_component:Ne,detach:Z,element:I,empty:oo,ensure_array_like:Ze,flush:ne,globals:Cr,group_outros:Ve,init:Er,insert:$,listen:ge,mount_component:Fe,noop:so,null_to_empty:gn,outro_and_destroy_block:Zt,resize_observer_content_box:Ar,run_all:rt,safe_not_equal:Sr,set_data:nl,set_style:ze,space:re,stop_propagation:bn,text:ol,toggle_class:G,transition_in:W,transition_out:se,update_keyed_each:$t}=window.__gradio__svelte__internal,{window:Mr}=Cr,{afterUpdate:zr,createEventDispatcher:Lr,tick:Jt,onMount:wn}=window.__gradio__svelte__internal;function pn(n,e,t){const l=n.slice();return l[146]=e[t].value,l[147]=e[t].id,l[150]=e,l[151]=t,l}function kn(n,e,t){const l=n.slice();return l[146]=e[t].value,l[147]=e[t].id,l[148]=e,l[149]=t,l}function vn(n,e,t){const l=n.slice();return l[146]=e[t].value,l[147]=e[t].id,l[152]=e,l[149]=t,l}function yn(n,e,t){const l=n.slice();return l[146]=e[t].value,l[147]=e[t].id,l[153]=e,l[151]=t,l}function qn(n){let e,t,l,o,s=n[2]&&n[2].length!==0&&n[3]&&Cn(n);return l=new Gi({props:{show_fullscreen_button:n[17],is_fullscreen:n[41],on_copy:n[62],show_copy_button:n[18],show_search:n[20],on_commit_filter:n[69],current_search_query:n[47]}}),l.$on("click",n[61]),l.$on("search",n[77]),{c(){e=I("div"),s&&s.c(),t=re(),Pe(l.$$.fragment),P(e,"class","header-row svelte-v7qhxw")},m(i,r){$(i,e,r),s&&s.m(e,null),V(e,t),Fe(l,e,null),o=!0},p(i,r){i[2]&&i[2].length!==0&&i[3]?s?s.p(i,r):(s=Cn(i),s.c(),s.m(e,t)):s&&(s.d(1),s=null);const a={};r[0]&131072&&(a.show_fullscreen_button=i[17]),r[1]&1024&&(a.is_fullscreen=i[41]),r[0]&262144&&(a.show_copy_button=i[18]),r[0]&1048576&&(a.show_search=i[20]),r[1]&65536&&(a.current_search_query=i[47]),l.$set(a)},i(i){o||(W(l.$$.fragment,i),o=!0)},o(i){se(l.$$.fragment,i),o=!1},d(i){i&&Z(e),s&&s.d(),Ne(l)}}}function Cn(n){let e,t,l;return{c(){e=I("div"),t=I("p"),l=ol(n[2]),P(t,"class","svelte-v7qhxw"),P(e,"class","label svelte-v7qhxw")},m(o,s){$(o,e,s),V(e,t),V(t,l)},p(o,s){s[0]&4&&nl(l,o[2])},d(o){o&&Z(e)}}}function En(n){let e,t,l,o,s;return{c(){e=I("button"),e.textContent="⋮",t=re(),l=I("button"),l.textContent="⋮",P(e,"class","selection-button selection-button-column svelte-v7qhxw"),P(e,"aria-label","Select column"),P(l,"class","selection-button selection-button-row svelte-v7qhxw"),P(l,"aria-label","Select row")},m(i,r){$(i,e,r),$(i,t,r),$(i,l,r),o||(s=[ge(e,"click",bn(n[78])),ge(l,"click",bn(n[79]))],o=!0)},p:so,d(i){i&&(Z(e),Z(t),Z(l)),o=!1,rt(s)}}}function An(n){let e,t;return{c(){e=I("caption"),t=ol(n[2]),P(e,"class","sr-only")},m(l,o){$(l,e,o),V(e,t)},p(l,o){o[0]&4&&nl(t,l[2])},d(l){l&&Z(e)}}}function Sn(n){let e;return{c(){e=I("th"),e.innerHTML='<div class="cell-wrap svelte-v7qhxw"><div class="header-content svelte-v7qhxw"><div class="header-text"></div></div></div>',P(e,"class","row-number-header frozen-column always-frozen svelte-v7qhxw"),ze(e,"left","0")},m(t,l){$(t,e,l)},d(t){t&&Z(e)}}}function Mn(n){let e,t,l;function o(...s){return n[82](n[151],...s)}return t=new lo({props:{direction:n[29]===n[151]?n[28]:null,i18n:n[10]}}),t.$on("sort",o),{c(){e=I("div"),Pe(t.$$.fragment),P(e,"class","sort-buttons svelte-v7qhxw")},m(s,i){$(s,e,i),Fe(t,e,null),l=!0},p(s,i){n=s;const r={};i[0]&872415232&&(r.direction=n[29]===n[151]?n[28]:null),i[0]&1024&&(r.i18n=n[10]),t.$set(r)},i(s){l||(W(t.$$.fragment,s),l=!0)},o(s){se(t.$$.fragment,s),l=!1},d(s){s&&Z(e),Ne(t)}}}function zn(n){let e,t,l;function o(...i){return n[83](n[151],...i)}function s(...i){return n[84](n[151],...i)}return{c(){e=I("button"),e.textContent="⋮",P(e,"class","cell-menu-button svelte-v7qhxw")},m(i,r){$(i,e,r),t||(l=[ge(e,"click",o),ge(e,"touchstart",s)],t=!0)},p(i,r){n=i},d(i){i&&Z(e),t=!1,rt(l)}}}function Ln(n,e){let t,l,o,s,i,r,a,f,u,c,h,g,A;function B(E){e[80](E,e[151])}function j(E){e[81](E,e[147])}let b={max_chars:e[19],latex_delimiters:e[6],line_breaks:e[12],edit:e[37]===e[151],header:!0,root:e[9],editable:e[7]};e[26][e[151]].value!==void 0&&(b.value=e[26][e[151]].value),e[25][e[147]].input!==void 0&&(b.el=e[25][e[147]].input),s=new xt({props:b}),qe.push(()=>Ie(s,"value",B)),qe.push(()=>Ie(s,"el",j)),s.$on("keydown",e[53]);let w=e[37]!==e[151]&&Mn(e),k=e[7]&&zn(e);function D(...E){return e[85](e[151],...E)}return{key:n,first:null,c(){t=I("th"),l=I("div"),o=I("div"),Pe(s.$$.fragment),a=re(),w&&w.c(),f=re(),k&&k.c(),u=re(),P(o,"class","header-content svelte-v7qhxw"),P(l,"class","cell-wrap svelte-v7qhxw"),P(t,"aria-sort",c=e[50](e[146],e[29],e[28])),ze(t,"width",e[56](e[151])),ze(t,"left",e[151]<e[33]?e[151]===0?e[14]?"var(--cell-width-row-number)":"0":`calc(${e[14]?"var(--cell-width-row-number) + ":""}${Array(e[151]).fill(0).map(Un).join(" + ")})`:"auto"),P(t,"class","svelte-v7qhxw"),G(t,"frozen-column",e[151]<e[33]),G(t,"last-frozen",e[151]===e[33]-1),G(t,"focus",e[37]===e[151]||e[38]===e[151]),this.first=t},m(E,z){$(E,t,z),V(t,l),V(l,o),Fe(s,o,null),V(o,a),w&&w.m(o,null),V(l,f),k&&k.m(l,null),V(t,u),h=!0,g||(A=[ge(t,"click",D),ge(t,"mousedown",Hr)],g=!0)},p(E,z){e=E;const H={};z[0]&524288&&(H.max_chars=e[19]),z[0]&64&&(H.latex_delimiters=e[6]),z[0]&4096&&(H.line_breaks=e[12]),z[0]&67108864|z[1]&64&&(H.edit=e[37]===e[151]),z[0]&512&&(H.root=e[9]),z[0]&128&&(H.editable=e[7]),!i&&z[0]&67108864&&(i=!0,H.value=e[26][e[151]].value,Oe(()=>i=!1)),!r&&z[0]&100663296&&(r=!0,H.el=e[25][e[147]].input,Oe(()=>r=!1)),s.$set(H),e[37]!==e[151]?w?(w.p(e,z),z[0]&67108864|z[1]&64&&W(w,1)):(w=Mn(e),w.c(),W(w,1),w.m(o,null)):w&&(Ve(),se(w,1,1,()=>{w=null}),Ue()),e[7]?k?k.p(e,z):(k=zn(e),k.c(),k.m(l,null)):k&&(k.d(1),k=null),(!h||z[0]&872415232&&c!==(c=e[50](e[146],e[29],e[28])))&&P(t,"aria-sort",c),(!h||z[0]&67108864)&&ze(t,"width",e[56](e[151])),(!h||z[0]&67125248|z[1]&4)&&ze(t,"left",e[151]<e[33]?e[151]===0?e[14]?"var(--cell-width-row-number)":"0":`calc(${e[14]?"var(--cell-width-row-number) + ":""}${Array(e[151]).fill(0).map(Un).join(" + ")})`:"auto"),(!h||z[0]&67108864|z[1]&4)&&G(t,"frozen-column",e[151]<e[33]),(!h||z[0]&67108864|z[1]&4)&&G(t,"last-frozen",e[151]===e[33]-1),(!h||z[0]&67108864|z[1]&192)&&G(t,"focus",e[37]===e[151]||e[38]===e[151])},i(E){h||(W(s.$$.fragment,E),W(w),h=!0)},o(E){se(s.$$.fragment,E),se(w),h=!1},d(E){E&&Z(t),Ne(s),w&&w.d(),k&&k.d(),g=!1,rt(A)}}}function Dn(n,e){let t,l,o,s,i=e[149],r;o=new xt({props:{value:e[146],latex_delimiters:e[6],line_breaks:e[12],datatype:Array.isArray(e[1])?e[1][e[149]]:e[1],edit:!1,el:null,root:e[9],editable:e[7]}});const a=()=>e[86](t,i),f=()=>e[86](null,i);return{key:n,first:null,c(){t=I("td"),l=I("div"),Pe(o.$$.fragment),s=re(),P(l,"class","cell-wrap svelte-v7qhxw"),P(t,"tabindex","-1"),P(t,"class","svelte-v7qhxw"),this.first=t},m(u,c){$(u,t,c),V(t,l),Fe(o,l,null),V(t,s),a(),r=!0},p(u,c){e=u;const h={};c[1]&262144&&(h.value=e[146]),c[0]&64&&(h.latex_delimiters=e[6]),c[0]&4096&&(h.line_breaks=e[12]),c[0]&2|c[1]&262144&&(h.datatype=Array.isArray(e[1])?e[1][e[149]]:e[1]),c[0]&512&&(h.root=e[9]),c[0]&128&&(h.editable=e[7]),o.$set(h),i!==e[149]&&(f(),i=e[149],a())},i(u){r||(W(o.$$.fragment,u),r=!0)},o(u){se(o.$$.fragment,u),r=!1},d(u){u&&Z(t),Ne(o),f()}}}function Bn(n){let e,t;return{c(){e=I("caption"),t=ol(n[2]),P(e,"class","sr-only")},m(l,o){$(l,e,o),V(e,t)},p(l,o){o[0]&4&&nl(t,l[2])},d(l){l&&Z(e)}}}function Dr(n){let e,t=n[2]&&n[2].length!==0&&Bn(n);return{c(){t&&t.c(),e=oo()},m(l,o){t&&t.m(l,o),$(l,e,o)},p(l,o){l[2]&&l[2].length!==0?t?t.p(l,o):(t=Bn(l),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(l){l&&Z(e),t&&t.d(l)}}}function jn(n){let e;return{c(){e=I("th"),e.innerHTML='<div class="cell-wrap svelte-v7qhxw"><div class="header-content svelte-v7qhxw"><div class="header-text"></div></div></div>',P(e,"class","row-number-header frozen-column always-frozen svelte-v7qhxw"),ze(e,"left","0")},m(t,l){$(t,e,l)},d(t){t&&Z(e)}}}function Tn(n){let e,t,l;function o(...s){return n[99](n[151],...s)}return t=new lo({props:{direction:n[29]===n[151]?n[28]:null,i18n:n[10]}}),t.$on("sort",o),{c(){e=I("div"),Pe(t.$$.fragment),P(e,"class","sort-buttons svelte-v7qhxw")},m(s,i){$(s,e,i),Fe(t,e,null),l=!0},p(s,i){n=s;const r={};i[0]&872415232&&(r.direction=n[29]===n[151]?n[28]:null),i[0]&1024&&(r.i18n=n[10]),t.$set(r)},i(s){l||(W(t.$$.fragment,s),l=!0)},o(s){se(t.$$.fragment,s),l=!1},d(s){s&&Z(e),Ne(t)}}}function Rn(n){let e,t,l;function o(...i){return n[100](n[151],...i)}function s(...i){return n[101](n[151],...i)}return{c(){e=I("button"),e.textContent="⋮",P(e,"class","cell-menu-button svelte-v7qhxw")},m(i,r){$(i,e,r),t||(l=[ge(e,"click",o),ge(e,"touchstart",s)],t=!0)},p(i,r){n=i},d(i){i&&Z(e),t=!1,rt(l)}}}function Hn(n,e){let t,l,o,s,i,r,a,f,u,c,h,g,A;function B(E){e[97](E,e[151])}function j(E){e[98](E,e[147])}let b={max_chars:e[19],latex_delimiters:e[6],line_breaks:e[12],edit:e[37]===e[151],header:!0,root:e[9],editable:e[7]};e[26][e[151]].value!==void 0&&(b.value=e[26][e[151]].value),e[25][e[147]].input!==void 0&&(b.el=e[25][e[147]].input),s=new xt({props:b}),qe.push(()=>Ie(s,"value",B)),qe.push(()=>Ie(s,"el",j));let w=e[37]!==e[151]&&Tn(e),k=e[7]&&Rn(e);function D(...E){return e[102](e[151],...E)}return{key:n,first:null,c(){t=I("th"),l=I("div"),o=I("div"),Pe(s.$$.fragment),a=re(),w&&w.c(),f=re(),k&&k.c(),u=re(),P(o,"class","header-content svelte-v7qhxw"),P(l,"class","cell-wrap svelte-v7qhxw"),P(t,"aria-sort",c=e[50](e[146],e[29],e[28])),ze(t,"width",e[56](e[151])),ze(t,"left",e[151]<e[33]?e[151]===0?e[14]?"var(--cell-width-row-number)":"0":`calc(${e[14]?"var(--cell-width-row-number) + ":""}${Array(e[151]).fill(0).map(Xn).join(" + ")})`:"auto"),P(t,"class","svelte-v7qhxw"),G(t,"frozen-column",e[151]<e[33]),G(t,"last-frozen",e[151]===e[33]-1),G(t,"focus",e[37]===e[151]||e[38]===e[151]),this.first=t},m(E,z){$(E,t,z),V(t,l),V(l,o),Fe(s,o,null),V(o,a),w&&w.m(o,null),V(l,f),k&&k.m(l,null),V(t,u),h=!0,g||(A=[ge(t,"click",D),ge(t,"mousedown",Nr)],g=!0)},p(E,z){e=E;const H={};z[0]&524288&&(H.max_chars=e[19]),z[0]&64&&(H.latex_delimiters=e[6]),z[0]&4096&&(H.line_breaks=e[12]),z[0]&67108864|z[1]&64&&(H.edit=e[37]===e[151]),z[0]&512&&(H.root=e[9]),z[0]&128&&(H.editable=e[7]),!i&&z[0]&67108864&&(i=!0,H.value=e[26][e[151]].value,Oe(()=>i=!1)),!r&&z[0]&100663296&&(r=!0,H.el=e[25][e[147]].input,Oe(()=>r=!1)),s.$set(H),e[37]!==e[151]?w?(w.p(e,z),z[0]&67108864|z[1]&64&&W(w,1)):(w=Tn(e),w.c(),W(w,1),w.m(o,null)):w&&(Ve(),se(w,1,1,()=>{w=null}),Ue()),e[7]?k?k.p(e,z):(k=Rn(e),k.c(),k.m(l,null)):k&&(k.d(1),k=null),(!h||z[0]&872415232&&c!==(c=e[50](e[146],e[29],e[28])))&&P(t,"aria-sort",c),(!h||z[0]&67108864)&&ze(t,"width",e[56](e[151])),(!h||z[0]&67125248|z[1]&4)&&ze(t,"left",e[151]<e[33]?e[151]===0?e[14]?"var(--cell-width-row-number)":"0":`calc(${e[14]?"var(--cell-width-row-number) + ":""}${Array(e[151]).fill(0).map(Xn).join(" + ")})`:"auto"),(!h||z[0]&67108864|z[1]&4)&&G(t,"frozen-column",e[151]<e[33]),(!h||z[0]&67108864|z[1]&4)&&G(t,"last-frozen",e[151]===e[33]-1),(!h||z[0]&67108864|z[1]&192)&&G(t,"focus",e[37]===e[151]||e[38]===e[151])},i(E){h||(W(s.$$.fragment,E),W(w),h=!0)},o(E){se(s.$$.fragment,E),se(w),h=!1},d(E){E&&Z(t),Ne(s),w&&w.d(),k&&k.d(),g=!1,rt(A)}}}function Br(n){let e,t,l=[],o=new Map,s,i=n[14]&&jn(),r=Ze(n[26]);const a=f=>f[147];for(let f=0;f<r.length;f+=1){let u=pn(n,r,f),c=a(u);o.set(c,l[f]=Hn(c,u))}return{c(){e=I("tr"),i&&i.c(),t=re();for(let f=0;f<l.length;f+=1)l[f].c();P(e,"slot","thead"),P(e,"class","svelte-v7qhxw")},m(f,u){$(f,e,u),i&&i.m(e,null),V(e,t);for(let c=0;c<l.length;c+=1)l[c]&&l[c].m(e,null);s=!0},p(f,u){f[14]?i||(i=jn(),i.c(),i.m(e,t)):i&&(i.d(1),i=null),u[0]&906516160|u[1]&36176068|u[2]&258&&(r=Ze(f[26]),Ve(),l=$t(l,u,a,1,f,r,o,e,Zt,Hn,null,pn),Ue())},i(f){if(!s){for(let u=0;u<r.length;u+=1)W(l[u]);s=!0}},o(f){for(let u=0;u<l.length;u+=1)se(l[u]);s=!1},d(f){f&&Z(e),i&&i.d();for(let u=0;u<l.length;u+=1)l[u].d()}}}function Pn(n){let e,t=n[144]+1+"",l;return{c(){e=I("td"),l=ol(t),P(e,"class","row-number frozen-column always-frozen svelte-v7qhxw"),ze(e,"left","0"),P(e,"tabindex","-1")},m(o,s){$(o,e,s),V(e,l)},p(o,s){s[4]&1048576&&t!==(t=o[144]+1+"")&&nl(l,t)},d(o){o&&Z(e)}}}function Nn(n){let e,t,l;function o(...s){return n[93](n[144],n[149],...s)}return{c(){e=I("button"),e.textContent="⋮",P(e,"class","cell-menu-button svelte-v7qhxw")},m(s,i){$(s,e,i),t||(l=ge(e,"click",o),t=!0)},p(s,i){n=s},d(s){s&&Z(e),t=!1,l()}}}function Fn(n,e){let t,l,o,s,i,r,a=e[7]&&mn([e[144],e[149]],e[23],e[7]),f,u,c,h,g=e[147],A,B,j;function b(K){e[89](K,e[144],e[149])}function w(K){e[90](K,e[147])}function k(){return e[92](e[144],e[149])}let D={display_value:e[21]?.[e[144]]?.[e[149]],latex_delimiters:e[6],line_breaks:e[12],editable:e[7],edit:Ge(e[35],[e[144],e[149]]),datatype:Array.isArray(e[1])?e[1][e[149]]:e[1],clear_on_focus:e[36],root:e[9],max_chars:e[19]};e[27][e[144]][e[149]].value!==void 0&&(D.value=e[27][e[144]][e[149]].value),e[25][e[147]].input!==void 0&&(D.el=e[25][e[147]].input),o=new xt({props:D}),qe.push(()=>Ie(o,"value",b)),qe.push(()=>Ie(o,"el",w)),o.$on("blur",e[91]),o.$on("focus",k);let E=a&&Nn(e);const z=()=>e[94](t,g),H=()=>e[94](null,g);function Q(...K){return e[95](e[144],e[149],...K)}function x(...K){return e[96](e[144],e[149],...K)}return{key:n,first:null,c(){t=I("td"),l=I("div"),Pe(o.$$.fragment),r=re(),E&&E.c(),f=re(),P(l,"class","cell-wrap svelte-v7qhxw"),P(t,"tabindex",u=e[14]&&e[149]===0?-1:0),P(t,"style",c="width: "+e[56](e[149])+"; left: "+(e[149]<e[33]?e[149]===0?e[14]?"var(--cell-width-row-number)":"0":`calc(${e[14]?"var(--cell-width-row-number) + ":""}${Array(e[149]).fill(0).map(Vn).join(" + ")})`:"auto")+"; "+(e[22]?.[e[144]]?.[e[149]]||"")),P(t,"class",h=gn(Yt([e[144],e[149]],e[23]))+" svelte-v7qhxw"),G(t,"frozen-column",e[149]<e[33]),G(t,"last-frozen",e[149]===e[33]-1),G(t,"flash",e[43]&&Yt([e[144],e[149]],e[23])),G(t,"menu-active",e[39]&&e[39].row===e[144]&&e[39].col===e[149]),this.first=t},m(K,y){$(K,t,y),V(t,l),Fe(o,l,null),V(l,r),E&&E.m(l,null),V(t,f),z(),A=!0,B||(j=[ge(t,"touchstart",Q),ge(t,"mousedown",Pr),ge(t,"click",x)],B=!0)},p(K,y){e=K;const N={};y[0]&2097152|y[4]&3145728&&(N.display_value=e[21]?.[e[144]]?.[e[149]]),y[0]&64&&(N.latex_delimiters=e[6]),y[0]&4096&&(N.line_breaks=e[12]),y[0]&128&&(N.editable=e[7]),y[1]&16|y[4]&3145728&&(N.edit=Ge(e[35],[e[144],e[149]])),y[0]&2|y[4]&2097152&&(N.datatype=Array.isArray(e[1])?e[1][e[149]]:e[1]),y[1]&32&&(N.clear_on_focus=e[36]),y[0]&512&&(N.root=e[9]),y[0]&524288&&(N.max_chars=e[19]),!s&&y[0]&134217728|y[4]&3145728&&(s=!0,N.value=e[27][e[144]][e[149]].value,Oe(()=>s=!1)),!i&&y[0]&33554432|y[4]&2097152&&(i=!0,N.el=e[25][e[147]].input,Oe(()=>i=!1)),o.$set(N),y[0]&8388736|y[4]&3145728&&(a=e[7]&&mn([e[144],e[149]],e[23],e[7])),a?E?E.p(e,y):(E=Nn(e),E.c(),E.m(l,null)):E&&(E.d(1),E=null),(!A||y[0]&16384|y[4]&2097152&&u!==(u=e[14]&&e[149]===0?-1:0))&&P(t,"tabindex",u),(!A||y[0]&4210688|y[1]&4|y[4]&3145728&&c!==(c="width: "+e[56](e[149])+"; left: "+(e[149]<e[33]?e[149]===0?e[14]?"var(--cell-width-row-number)":"0":`calc(${e[14]?"var(--cell-width-row-number) + ":""}${Array(e[149]).fill(0).map(Vn).join(" + ")})`:"auto")+"; "+(e[22]?.[e[144]]?.[e[149]]||"")))&&P(t,"style",c),(!A||y[0]&8388608|y[4]&3145728&&h!==(h=gn(Yt([e[144],e[149]],e[23]))+" svelte-v7qhxw"))&&P(t,"class",h),g!==e[147]&&(H(),g=e[147],z()),(!A||y[0]&8388608|y[1]&4|y[4]&3145728)&&G(t,"frozen-column",e[149]<e[33]),(!A||y[0]&8388608|y[1]&4|y[4]&3145728)&&G(t,"last-frozen",e[149]===e[33]-1),(!A||y[0]&8388608|y[1]&4096|y[4]&3145728)&&G(t,"flash",e[43]&&Yt([e[144],e[149]],e[23])),(!A||y[0]&8388608|y[1]&256|y[4]&3145728)&&G(t,"menu-active",e[39]&&e[39].row===e[144]&&e[39].col===e[149])},i(K){A||(W(o.$$.fragment,K),A=!0)},o(K){se(o.$$.fragment,K),A=!1},d(K){K&&Z(t),Ne(o),E&&E.d(),H(),B=!1,rt(j)}}}function jr(n){let e,t,l=[],o=new Map,s,i=n[14]&&Pn(n),r=Ze(n[145]);const a=f=>f[147];for(let f=0;f<r.length;f+=1){let u=kn(n,r,f),c=a(u);o.set(c,l[f]=Fn(c,u))}return{c(){e=I("tr"),i&&i.c(),t=re();for(let f=0;f<l.length;f+=1)l[f].c();P(e,"slot","tbody"),P(e,"class","svelte-v7qhxw"),G(e,"row_odd",n[144]%2===0)},m(f,u){$(f,e,u),i&&i.m(e,null),V(e,t);for(let c=0;c<l.length;c+=1)l[c]&&l[c].m(e,null);s=!0},p(f,u){f[14]?i?i.p(f,u):(i=Pn(f),i.c(),i.m(e,t)):i&&(i.d(1),i=null),u[0]&182997698|u[1]&234885429|u[4]&3145728&&(r=Ze(f[145]),Ve(),l=$t(l,u,a,1,f,r,o,e,Zt,Fn,null,kn),Ue()),(!s||u[4]&1048576)&&G(e,"row_odd",f[144]%2===0)},i(f){if(!s){for(let u=0;u<r.length;u+=1)W(l[u]);s=!0}},o(f){for(let u=0;u<l.length;u+=1)se(l[u]);s=!1},d(f){f&&Z(e),i&&i.d();for(let u=0;u<l.length;u+=1)l[u].d()}}}function Tr(n){let e,t,l,o,s,i;function r(c){n[103](c)}function a(c){n[104](c)}function f(c){n[105](c)}let u={max_height:n[11],selected:n[48],disable_scroll:n[39]!==null||n[40]!==null,$$slots:{tbody:[jr,({index:c,item:h})=>({144:c,145:h}),({index:c,item:h})=>[0,0,0,0,(c?1048576:0)|(h?2097152:0)]],thead:[Br],default:[Dr]},$$scope:{ctx:n}};return n[27]!==void 0&&(u.items=n[27]),n[44]!==void 0&&(u.actual_height=n[44]),n[45]!==void 0&&(u.table_scrollbar_width=n[45]),t=new ri({props:u}),qe.push(()=>Ie(t,"items",r)),qe.push(()=>Ie(t,"actual_height",a)),qe.push(()=>Ie(t,"table_scrollbar_width",f)),{c(){e=I("div"),Pe(t.$$.fragment),P(e,"class","table-wrap svelte-v7qhxw")},m(c,h){$(c,e,h),Fe(t,e,null),i=!0},p(c,h){const g={};h[0]&2048&&(g.max_height=c[11]),h[1]&131072&&(g.selected=c[48]),h[1]&768&&(g.disable_scroll=c[39]!==null||c[40]!==null),h[0]&1055413958|h[1]&4597|h[4]&1076887552&&(g.$$scope={dirty:h,ctx:c}),!l&&h[0]&134217728&&(l=!0,g.items=c[27],Oe(()=>l=!1)),!o&&h[1]&8192&&(o=!0,g.actual_height=c[44],Oe(()=>o=!1)),!s&&h[1]&16384&&(s=!0,g.table_scrollbar_width=c[45],Oe(()=>s=!1)),t.$set(g)},i(c){i||(W(t.$$.fragment,c),i=!0)},o(c){se(t.$$.fragment,c),i=!1},d(c){c&&Z(e),Ne(t)}}}function On(n){let e,t,l,o;return{c(){e=I("div"),t=I("button"),t.innerHTML="<span>+</span>",P(t,"class","add-row-button svelte-v7qhxw"),P(e,"class","add-row-container svelte-v7qhxw")},m(s,i){$(s,e,i),V(e,t),l||(o=ge(t,"click",n[110]),l=!0)},p:so,d(s){s&&Z(e),l=!1,o()}}}function In(n){let e,t;return e=new eo({props:{x:n[39].x,y:n[39].y,row:n[39].row,col_count:n[4],row_count:n[5],on_add_row_above:n[111],on_add_row_below:n[112],on_add_column_left:n[113],on_add_column_right:n[114],on_delete_row:n[115],on_delete_col:n[116],can_delete_rows:n[27].length>1,can_delete_cols:n[27][0].length>1,i18n:n[10]}}),{c(){Pe(e.$$.fragment)},m(l,o){Fe(e,l,o),t=!0},p(l,o){const s={};o[1]&256&&(s.x=l[39].x),o[1]&256&&(s.y=l[39].y),o[1]&256&&(s.row=l[39].row),o[0]&16&&(s.col_count=l[4]),o[0]&32&&(s.row_count=l[5]),o[1]&256&&(s.on_add_row_above=l[111]),o[1]&256&&(s.on_add_row_below=l[112]),o[1]&256&&(s.on_add_column_left=l[113]),o[1]&256&&(s.on_add_column_right=l[114]),o[1]&256&&(s.on_delete_row=l[115]),o[1]&256&&(s.on_delete_col=l[116]),o[0]&134217728&&(s.can_delete_rows=l[27].length>1),o[0]&134217728&&(s.can_delete_cols=l[27][0].length>1),o[0]&1024&&(s.i18n=l[10]),e.$set(s)},i(l){t||(W(e.$$.fragment,l),t=!0)},o(l){se(e.$$.fragment,l),t=!1},d(l){Ne(e,l)}}}function Kn(n){let e,t;return e=new eo({props:{i18n:n[10],x:n[40].x,y:n[40].y,row:-1,col_count:n[4],row_count:n[5],on_add_row_above:n[117],on_add_row_below:n[118],on_add_column_left:n[119],on_add_column_right:n[120],on_delete_row:n[121],on_delete_col:n[122],can_delete_rows:!1,can_delete_cols:n[26].length>1}}),{c(){Pe(e.$$.fragment)},m(l,o){Fe(e,l,o),t=!0},p(l,o){const s={};o[0]&1024&&(s.i18n=l[10]),o[1]&512&&(s.x=l[40].x),o[1]&512&&(s.y=l[40].y),o[0]&16&&(s.col_count=l[4]),o[0]&32&&(s.row_count=l[5]),o[1]&256&&(s.on_add_row_above=l[117]),o[1]&256&&(s.on_add_row_below=l[118]),o[1]&512&&(s.on_add_column_left=l[119]),o[1]&512&&(s.on_add_column_right=l[120]),o[1]&256&&(s.on_delete_row=l[121]),o[1]&512&&(s.on_delete_col=l[122]),o[0]&67108864&&(s.can_delete_cols=l[26].length>1),e.$set(s)},i(l){t||(W(e.$$.fragment,l),t=!0)},o(l){se(e.$$.fragment,l),t=!1},d(l){Ne(e,l)}}}function Rr(n){let e,t,l,o,s,i,r,a,f,u=[],c=new Map,h,g,A,B=[],j=new Map,b,w,k,D,E,z,H,Q,x,K,y,N=(n[2]&&n[2].length!==0&&n[3]||n[17]||n[18]||n[20]!=="none")&&qn(n),X=n[24]!==!1&&n[23].length===1&&En(n),v=n[2]&&n[2].length!==0&&An(n),T=n[14]&&Sn(),we=Ze(n[26]);const De=m=>m[147];for(let m=0;m<we.length;m+=1){let p=yn(n,we,m),F=De(p);c.set(F,u[m]=Ln(F,p))}let ae=Ze(n[49]);const O=m=>m[147];for(let m=0;m<ae.length;m+=1){let p=vn(n,ae,m),F=O(p);j.set(F,B[m]=Dn(F,p))}function pe(m){n[106](m)}let J={upload:n[15],stream_handler:n[16],flex:!1,center:!1,boundedheight:!1,disable_click:!0,root:n[9],aria_label:n[10]("dataframe.drop_to_upload"),$$slots:{default:[Tr]},$$scope:{ctx:n}};n[42]!==void 0&&(J.dragging=n[42]),k=new hs({props:J}),qe.push(()=>Ie(k,"dragging",pe)),k.$on("load",n[107]);let te=n[27].length===0&&n[7]&&n[5][1]==="dynamic"&&On(n),Y=n[39]&&In(n),q=n[40]!==null&&Kn(n);return{c(){e=I("div"),N&&N.c(),t=re(),l=I("div"),X&&X.c(),o=re(),s=I("table"),v&&v.c(),i=re(),r=I("thead"),a=I("tr"),T&&T.c(),f=re();for(let m=0;m<u.length;m+=1)u[m].c();h=re(),g=I("tbody"),A=I("tr");for(let m=0;m<B.length;m+=1)B[m].c();w=re(),Pe(k.$$.fragment),E=re(),te&&te.c(),z=re(),Y&&Y.c(),H=re(),q&&q.c(),Q=oo(),P(a,"class","svelte-v7qhxw"),P(r,"class","svelte-v7qhxw"),P(A,"class","svelte-v7qhxw"),P(s,"class","svelte-v7qhxw"),G(s,"fixed-layout",n[13].length!=0),P(l,"class","table-wrap svelte-v7qhxw"),ze(l,"height",n[44]+"px"),P(l,"role","grid"),P(l,"tabindex","0"),G(l,"dragging",n[42]),G(l,"no-wrap",!n[8]),G(l,"menu-open",n[39]||n[40]),P(e,"class","table-container svelte-v7qhxw")},m(m,p){$(m,e,p),N&&N.m(e,null),V(e,t),V(e,l),X&&X.m(l,null),V(l,o),V(l,s),v&&v.m(s,null),V(s,i),V(s,r),V(r,a),T&&T.m(a,null),V(a,f);for(let F=0;F<u.length;F+=1)u[F]&&u[F].m(a,null);V(s,h),V(s,g),V(g,A);for(let F=0;F<B.length;F+=1)B[F]&&B[F].m(A,null);b=Ar.observe(s,n[87].bind(s)),n[88](s),V(l,w),Fe(k,l,null),n[108](l),$(m,E,p),te&&te.m(m,p),$(m,z,p),Y&&Y.m(m,p),$(m,H,p),q&&q.m(m,p),$(m,Q,p),x=!0,K||(y=[ge(Mr,"resize",n[76]),ge(l,"keydown",n[109])],K=!0)},p(m,p){m[2]&&m[2].length!==0&&m[3]||m[17]||m[18]||m[20]!=="none"?N?(N.p(m,p),p[0]&1441804&&W(N,1)):(N=qn(m),N.c(),W(N,1),N.m(e,t)):N&&(Ve(),se(N,1,1,()=>{N=null}),Ue()),m[24]!==!1&&m[23].length===1?X?X.p(m,p):(X=En(m),X.c(),X.m(l,o)):X&&(X.d(1),X=null),m[2]&&m[2].length!==0?v?v.p(m,p):(v=An(m),v.c(),v.m(s,i)):v&&(v.d(1),v=null),m[14]?T||(T=Sn(),T.c(),T.m(a,f)):T&&(T.d(1),T=null),p[0]&906516160|p[1]&40370372|p[2]&258&&(we=Ze(m[26]),Ve(),u=$t(u,p,De,1,m,we,c,a,Zt,Ln,null,yn),Ue()),p[0]&1073746626|p[1]&262144&&(ae=Ze(m[49]),Ve(),B=$t(B,p,O,1,m,ae,j,A,Zt,Dn,null,vn),Ue()),(!x||p[0]&8192)&&G(s,"fixed-layout",m[13].length!=0);const F={};p[0]&32768&&(F.upload=m[15]),p[0]&65536&&(F.stream_handler=m[16]),p[0]&512&&(F.root=m[9]),p[0]&1024&&(F.aria_label=m[10]("dataframe.drop_to_upload")),p[0]&1055416006|p[1]&160757|p[4]&1073741824&&(F.$$scope={dirty:p,ctx:m}),!D&&p[1]&2048&&(D=!0,F.dragging=m[42],Oe(()=>D=!1)),k.$set(F),(!x||p[1]&8192)&&ze(l,"height",m[44]+"px"),(!x||p[1]&2048)&&G(l,"dragging",m[42]),(!x||p[0]&256)&&G(l,"no-wrap",!m[8]),(!x||p[1]&768)&&G(l,"menu-open",m[39]||m[40]),m[27].length===0&&m[7]&&m[5][1]==="dynamic"?te?te.p(m,p):(te=On(m),te.c(),te.m(z.parentNode,z)):te&&(te.d(1),te=null),m[39]?Y?(Y.p(m,p),p[1]&256&&W(Y,1)):(Y=In(m),Y.c(),W(Y,1),Y.m(H.parentNode,H)):Y&&(Ve(),se(Y,1,1,()=>{Y=null}),Ue()),m[40]!==null?q?(q.p(m,p),p[1]&512&&W(q,1)):(q=Kn(m),q.c(),W(q,1),q.m(Q.parentNode,Q)):q&&(Ve(),se(q,1,1,()=>{q=null}),Ue())},i(m){if(!x){W(N);for(let p=0;p<we.length;p+=1)W(u[p]);for(let p=0;p<ae.length;p+=1)W(B[p]);W(k.$$.fragment,m),W(Y),W(q),x=!0}},o(m){se(N);for(let p=0;p<u.length;p+=1)se(u[p]);for(let p=0;p<B.length;p+=1)se(B[p]);se(k.$$.fragment,m),se(Y),se(q),x=!1},d(m){m&&(Z(e),Z(E),Z(z),Z(H),Z(Q)),N&&N.d(),X&&X.d(),v&&v.d(),T&&T.d();for(let p=0;p<u.length;p+=1)u[p].d();for(let p=0;p<B.length;p+=1)B[p].d();b(),n[88](null),Ne(k),n[108](null),te&&te.d(m),Y&&Y.d(m),q&&q.d(m),K=!1,rt(y)}}}function zt(){return Math.random().toString(36).substring(2,15)}function dl(n,e,t){let l=n||[];if(e[1]==="fixed"&&l.length<e[0]){const o=Array(e[0]-l.length).fill("").map((s,i)=>`${i+l.length}`);l=l.concat(o)}return!l||l.length===0?Array(e[0]).fill(0).map((o,s)=>{const i=zt();return t[i]={cell:null,input:null},{id:i,value:JSON.stringify(s+1)}}):l.map((o,s)=>{const i=zt();return t[i]={cell:null,input:null},{id:i,value:o??""}})}const Un=(n,e)=>`var(--cell-width-${e})`,Hr=n=>{n.preventDefault(),n.stopPropagation()},Vn=(n,e)=>`var(--cell-width-${e})`,Pr=n=>{n.preventDefault(),n.stopPropagation()},Xn=(n,e)=>`var(--cell-width-${e})`,Nr=n=>{n.preventDefault(),n.stopPropagation()};function Fr(n,e,t){let l,o,{datatype:s}=e,{label:i=null}=e,{show_label:r=!0}=e,{headers:a=[]}=e,{values:f=[]}=e,{col_count:u}=e,{row_count:c}=e,{latex_delimiters:h}=e,{editable:g=!0}=e,{wrap:A=!1}=e,{root:B}=e,{i18n:j}=e,{max_height:b=500}=e,{line_breaks:w=!0}=e,{column_widths:k=[]}=e,{show_row_numbers:D=!1}=e,{upload:E}=e,{stream_handler:z}=e,{show_fullscreen_button:H=!1}=e,{show_copy_button:Q=!1}=e,{value_is_output:x=!1}=e,{max_chars:K=void 0}=e,{show_search:y="none"}=e,{pinned_columns:N=0}=e,X=0,v=[],T=!1,{display_value:we=null}=e,{styling:De=null}=e,ae,O={};const pe=Lr();let J=!1,te=!1,Y=!1,q=!1,m=null,p=null,F=!1,C=!1,be=!1,oe;wn(()=>{oe=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()+"40",document.documentElement.style.setProperty("--color-accent-copied",oe)});const ke=(_,d)=>L?.[_]?.[d]?.value;function pt(_){const d=_.length;return d===0?[]:Array(c[1]==="fixed"?c[0]:d).fill(0).map((M,R)=>Array(u[1]==="fixed"?u[0]:_[0].length||a.length).fill(0).map((le,fe)=>{const Te=zt();return t(25,O[Te]=O[Te]||{input:null,cell:null},O),{value:_?.[R]?.[fe]??"",id:Te}}))}let ie=dl(a,u,O),Xe=a,L=[[]],Be,Sl=ie.map(_=>_.value),Ml=L.map(_=>_.map(d=>String(d.value)));async function io(){if(Et)return;const _=ie.map(M=>M.value),d=L.map(M=>M.map(R=>String(R.value)));(!Ge(d,Ml)||!Ge(_,Sl))&&(pe("change",{data:L.map(M=>M.map(R=>R.value)),headers:ie.map(M=>M.value),metadata:null}),x||pe("input"),Ml=d,Sl=_)}function ro(_,d,M){if(!d)return"none";if(a[d]===_){if(M==="asc")return"ascending";if(M==="des")return"descending"}return"none"}async function zl(_){if(q!==!1&&Y===!1)switch(_.key){case"ArrowDown":t(24,T=[0,q]),t(23,v=[[0,q]]),t(38,q=!1);return;case"ArrowLeft":t(38,q=q>0?q-1:q);return;case"ArrowRight":t(38,q=q<ie.length-1?q+1:q);return;case"Escape":_.preventDefault(),t(38,q=!1);break;case"Enter":_.preventDefault(),g&&t(37,Y=q);break}if(_.key==="Delete"||_.key==="Backspace"){if(!g)return;if(J){const[R,le]=J,fe=O[L[R][le].id].input;if(fe&&fe.selectionStart!==fe.selectionEnd||_.key==="Delete"&&fe?.selectionStart!==fe?.value.length||_.key==="Backspace"&&fe?.selectionStart!==0)return}_.preventDefault(),v.length>0&&(t(27,L=rr(L,v)),pe("change",{data:L.map(R=>R.map(le=>le.value)),headers:ie.map(R=>R.value),metadata:null}),x||pe("input"));return}if(_.key==="c"&&(_.metaKey||_.ctrlKey)){_.preventDefault(),v.length>0&&await Rl();return}if(!T)return;const[d,M]=T;switch(_.key){case"ArrowRight":case"ArrowLeft":case"ArrowDown":case"ArrowUp":if(J)break;_.preventDefault();const R=_r(_.key,[d,M],L);R?(_.shiftKey?(t(23,v=no(v.length>0?v[0]:[d,M],R)),t(35,J=!1)):(t(23,v=[R]),t(35,J=!1)),t(24,T=R)):R===!1&&_.key==="ArrowUp"&&d===0&&(t(38,q=M),t(24,T=!1),t(23,v=[]),t(35,J=!1));break;case"Escape":if(!g)break;_.preventDefault(),t(35,J=!1);break;case"Enter":if(_.preventDefault(),g)if(_.shiftKey)Pt(d),await Jt(),t(24,T=[d+1,M]);else if(Ge(J,[d,M])){const fe=L[d][M].id,Te=O[fe].input;Te&&t(27,L[d][M].value=Te.value,L),t(35,J=!1),await Jt(),t(24,T=[d,M])}else t(35,J=[d,M]),t(36,te=!1);break;case"Tab":_.preventDefault(),t(35,J=!1);const le=ur([d,M],L,_.shiftKey);le&&(t(23,v=[le]),t(24,T=le),g&&(t(35,J=le),t(36,te=!1)));break;default:if(!g)break;(!J||J&&Ge(J,[d,M]))&&_.key.length===1&&(t(36,te=!0),t(35,J=[d,M]))}}let Ye,je;function sl(_,d){typeof je!="number"||je!==_?(t(28,Ye=d),t(29,je=_)):je===_&&(Ye===d?(t(28,Ye=void 0),t(29,je=void 0)):t(28,Ye=d))}async function uo(_,d=!1){!g||Y===_||(t(24,T=!1),t(23,v=[]),t(38,q=_),t(37,Y=_))}function _o(_){if(g)switch(_.detail.key){case"Escape":case"Enter":case"Tab":_.preventDefault(),t(24,T=!1),t(38,q=Y),t(37,Y=!1),ce.focus();break}}async function Pt(_){if(ce.focus(),c[1]!=="dynamic")return;const d=Array(L[0]?.length||a.length).fill(0).map((M,R)=>{const le=zt();return t(25,O[le]={cell:null,input:null},O),{id:le,value:""}});L.length===0?t(27,L=[d]):_!==void 0&&_>=0&&_<=L.length?L.splice(_,0,d):L.push(d),t(27,L),t(0,f),t(75,Be),t(24,T=[_!==void 0?_:L.length-1,0])}async function ao(_){if(ce.focus(),u[1]!=="dynamic")return;const d=_!==void 0?_:L[0].length;for(let M=0;M<L.length;M++){const R=zt();t(25,O[R]={cell:null,input:null},O),L[M].splice(d,0,{id:R,value:""})}a.splice(d,0,`Header ${a.length+1}`),t(27,L),t(0,f),t(75,Be),t(71,a),await Jt(),requestAnimationFrame(()=>{uo(d,!0);const M=ce.querySelectorAll("tbody")[1].offsetWidth;ce.querySelectorAll("table")[1].scrollTo({left:M})})}function Ll(_){fr(_,ce)&&(t(35,J=!1),t(23,v=[]),t(37,Y=!1),t(38,q=!1),t(39,m=null),t(40,p=null))}let kt=[],ce,Nt;function vt(){const _=kt.map(M=>M?.clientWidth||0);if(_.length===0)return;D&&ce.style.setProperty("--cell-width-row-number",`${_[0]}px`);const d=D?_.slice(1):_;d.forEach((M,R)=>{k[R]||ce.style.setProperty(`--cell-width-${R}`,`${M-Ft/d.length}px`)})}function fo(_){return k[_]||`var(--cell-width-${_})`}let il=f.slice(0,b/f.length*37).length*37+37,Ft=0;function co(_,d,M,R,le){let fe=null;if(T&&T[0]in _&&T[1]in _[T[0]]&&(fe=_[T[0]][T[1]].id),!(typeof R!="number"||!le)&&(br(_,d,M,R,le),t(27,L),t(0,f),t(75,Be),fe)){const[Te,At]=ar(fe,L);t(24,T=[Te,At])}}let Dl=!1;wn(()=>{const _=new IntersectionObserver(d=>{d.forEach(M=>{M.isIntersecting&&!Dl&&(vt(),t(27,L),t(0,f),t(75,Be)),Dl=M.isIntersecting})});return _.observe(ce),document.addEventListener("click",Ll),window.addEventListener("resize",jl),document.addEventListener("fullscreenchange",Tl),()=>{_.disconnect(),document.removeEventListener("click",Ll),window.removeEventListener("resize",jl),document.removeEventListener("fullscreenchange",Tl)}});function rl(_,d,M){_.target instanceof HTMLAnchorElement||(_.preventDefault(),_.stopPropagation(),!(D&&M===-1)&&(t(36,te=!1),t(39,m=null),t(40,p=null),t(38,q=!1),t(37,Y=!1),t(23,v=ir([d,M],v,_)),ce.focus(),g&&(v.length===1?(t(35,J=[d,M]),Jt().then(()=>{const R=O[L[d][M].id].input;R&&(R.focus(),R.selectionStart=R.selectionEnd=R.value.length)})):t(35,J=!1)),ho(d,M),pe("select",{index:[d,M],value:ke(d,M),row_value:L[d].map(R=>R.value)})))}function Bl(_,d,M){if(_.stopPropagation(),m&&m.row===d&&m.col===M)t(39,m=null);else{const R=_.target.closest("td");if(R){const le=R.getBoundingClientRect();t(39,m={row:d,col:M,x:le.right,y:le.bottom})}}}function yt(_,d){const M=d==="above"?_:_+1;Pt(M),t(39,m=null),t(40,p=null)}function qt(_,d){const M=d==="left"?_:_+1;ao(M),t(39,m=null),t(40,p=null)}function jl(){t(39,m=null),t(40,p=null),t(23,v=[]),t(24,T=!1),t(35,J=!1),vt()}let Ot=null;function ho(_,d){Ot=Ot?.type==="cell"&&Ot.row===_&&Ot.col===d?null:{type:"cell",row:_,col:d}}function mo(){document.fullscreenElement?(document.exitFullscreen(),t(41,F=!1)):(ce.requestFullscreen(),t(41,F=!0))}function Tl(){t(41,F=!!document.fullscreenElement)}async function Rl(){await wr(L,v),t(43,be=!0),setTimeout(()=>{t(43,be=!1)},800)}function Ct(_,d){if(_.stopPropagation(),p&&p.col===d)t(40,p=null);else{const M=_.target.closest("th");if(M){const R=M.getBoundingClientRect();t(40,p={col:d,x:R.right,y:R.bottom})}}}zr(()=>{t(72,x=!1)});async function go(_){ce.focus(),c[1]==="dynamic"&&(L.length<=1||(L.splice(_,1),t(27,L),t(0,f),t(75,Be),t(24,T=!1)))}async function bo(_){ce.focus(),u[1]==="dynamic"&&(ie.length<=1||(ie.splice(_,1),t(26,ie),t(71,a),t(74,Xe),t(4,u),t(25,O),L.length>0&&(L.forEach(d=>{d.splice(_,1)}),t(27,L),t(0,f),t(75,Be)),t(24,T=!1)))}function ul(_){go(_),t(39,m=null),t(40,p=null)}function _l(_){bo(_),t(39,m=null),t(40,p=null)}function Hl(_){t(23,v=cr(L,_)),t(24,T=v[0]),t(35,J=!1)}function Pl(_){t(23,v=hr(L,_)),t(24,T=v[0]),t(35,J=!1)}let It,Et=null;function Nl(_){t(47,Et=_),pe("search",_)}function wo(){Et&&y==="filter"&&(pe("change",{data:L.map(_=>_.map(d=>d.value)),headers:ie.map(_=>_.value),metadata:null}),x||pe("input"),t(47,Et=null))}function al(_,d){_.target instanceof HTMLAnchorElement||(_.preventDefault(),_.stopPropagation(),g&&(t(36,te=!1),t(39,m=null),t(40,p=null),t(24,T=!1),t(23,v=[]),t(38,q=d),t(37,Y=d),ce.focus()))}const po=()=>vt(),ko=_=>Nl(_.detail),vo=()=>Hl(It[1]),yo=()=>Pl(It[0]);function qo(_,d){n.$$.not_equal(ie[d].value,_)&&(ie[d].value=_,t(26,ie),t(71,a),t(74,Xe),t(4,u),t(25,O))}function Co(_,d){n.$$.not_equal(O[d].input,_)&&(O[d].input=_,t(25,O))}const Eo=(_,{detail:d})=>sl(_,d),Ao=(_,d)=>Ct(d,_),So=(_,d)=>{d.preventDefault();const M=d.touches[0],R=new MouseEvent("click",{clientX:M.clientX,clientY:M.clientY,bubbles:!0,cancelable:!0,view:window});Ct(R,_)},Mo=(_,d)=>al(d,_);function zo(_,d){qe[_?"unshift":"push"](()=>{kt[d]=_,t(30,kt)})}function Lo(){ae=yr.entries.get(this)?.contentRect,t(34,ae)}function Do(_){qe[_?"unshift":"push"](()=>{Nt=_,t(32,Nt)})}function Bo(_,d,M){n.$$.not_equal(L[d][M].value,_)&&(L[d][M].value=_,t(27,L),t(0,f),t(75,Be))}function jo(_,d){n.$$.not_equal(O[d].input,_)&&(O[d].input=_,t(25,O))}const To=()=>{t(36,te=!1),ce.focus()},Ro=(_,d)=>{const M=_,R=d;v.some(([le,fe])=>le===M&&fe===R)||t(23,v=[[M,R]])},Ho=(_,d,M)=>Bl(M,_,d);function Po(_,d){qe[_?"unshift":"push"](()=>{O[d].cell=_,t(25,O)})}const No=(_,d,M)=>{const R=M.touches[0],le=new MouseEvent("click",{clientX:R.clientX,clientY:R.clientY,bubbles:!0,cancelable:!0,view:window});rl(le,_,d)},Fo=(_,d,M)=>rl(M,_,d);function Oo(_,d){n.$$.not_equal(ie[d].value,_)&&(ie[d].value=_,t(26,ie),t(71,a),t(74,Xe),t(4,u),t(25,O))}function Io(_,d){n.$$.not_equal(O[d].input,_)&&(O[d].input=_,t(25,O))}const Ko=(_,{detail:d})=>sl(_,d),Uo=(_,d)=>Ct(d,_),Vo=(_,d)=>{d.preventDefault();const M=d.touches[0],R=new MouseEvent("click",{clientX:M.clientX,clientY:M.clientY,bubbles:!0,cancelable:!0,view:window});Ct(R,_)},Xo=(_,d)=>al(d,_);function Yo(_){L=_,t(27,L),t(0,f),t(75,Be)}function Jo(_){il=_,t(44,il)}function Wo(_){Ft=_,t(45,Ft)}function Go(_){C=_,t(42,C)}const Qo=({detail:_})=>vr(_.data,d=>(t(26,ie=dl(d.map(M=>M??""),u,O)),ie),d=>{t(0,f=d)});function Zo(_){qe[_?"unshift":"push"](()=>{ce=_,t(31,ce)})}const $o=_=>zl(_),xo=()=>Pt(),es=()=>yt(m?.row||0,"above"),ts=()=>yt(m?.row||0,"below"),ls=()=>qt(m?.col||0,"left"),ns=()=>qt(m?.col||0,"right"),os=()=>ul(m?.row||0),ss=()=>_l(m?.col||0),is=()=>yt(m?.row??-1,"above"),rs=()=>yt(m?.row??-1,"below"),us=()=>qt(p?.col??-1,"left"),_s=()=>qt(p?.col??-1,"right"),as=()=>ul(m?.row??-1),fs=()=>_l(p?.col??-1);return n.$$set=_=>{"datatype"in _&&t(1,s=_.datatype),"label"in _&&t(2,i=_.label),"show_label"in _&&t(3,r=_.show_label),"headers"in _&&t(71,a=_.headers),"values"in _&&t(0,f=_.values),"col_count"in _&&t(4,u=_.col_count),"row_count"in _&&t(5,c=_.row_count),"latex_delimiters"in _&&t(6,h=_.latex_delimiters),"editable"in _&&t(7,g=_.editable),"wrap"in _&&t(8,A=_.wrap),"root"in _&&t(9,B=_.root),"i18n"in _&&t(10,j=_.i18n),"max_height"in _&&t(11,b=_.max_height),"line_breaks"in _&&t(12,w=_.line_breaks),"column_widths"in _&&t(13,k=_.column_widths),"show_row_numbers"in _&&t(14,D=_.show_row_numbers),"upload"in _&&t(15,E=_.upload),"stream_handler"in _&&t(16,z=_.stream_handler),"show_fullscreen_button"in _&&t(17,H=_.show_fullscreen_button),"show_copy_button"in _&&t(18,Q=_.show_copy_button),"value_is_output"in _&&t(72,x=_.value_is_output),"max_chars"in _&&t(19,K=_.max_chars),"show_search"in _&&t(20,y=_.show_search),"pinned_columns"in _&&t(73,N=_.pinned_columns),"display_value"in _&&t(21,we=_.display_value),"styling"in _&&t(22,De=_.styling)},n.$$.update=()=>{if(n.$$.dirty[0]&1|n.$$.dirty[2]&8192&&(Ge(f,Be)||(t(27,L=pt(f)),t(75,Be=JSON.parse(JSON.stringify(f))))),n.$$.dirty[0]&134217728|n.$$.dirty[2]&2048&&t(33,X=N&&L?.[0]?.length?Math.min(N,L[0].length):0),n.$$.dirty[0]&8388608&&t(23,v=[...v]),n.$$.dirty[0]&8388608&&t(24,T=v.length>0?v[v.length-1]:!1),n.$$.dirty[0]&33554448|n.$$.dirty[2]&4608&&(Ge(a,Xe)||(t(26,ie=dl(a,u,O)),t(74,Xe=JSON.parse(JSON.stringify(a))))),n.$$.dirty[0]&201326592&&(L||ie)&&io(),n.$$.dirty[0]&134217728&&t(49,l=gr(L)),n.$$.dirty[0]&1073741824&&kt[0]&&vt(),n.$$.dirty[0]&945815552&&co(L,we,De,je,Ye),n.$$.dirty[0]&16777216&&t(48,o=!!T&&T[0]),n.$$.dirty[0]&939524096)if(typeof je=="number"&&Ye&&je>=0&&je<L[0].length){const _=[...Array(L.length)].map((M,R)=>R),d=je;_.sort((M,R)=>{const le=L[M],fe=L[R];if(!le||!fe||d>=le.length||d>=fe.length)return 0;const Te=le[d].value,At=fe[d].value,Fl=Te<At?-1:Te>At?1:0;return Ye==="asc"?Fl:-Fl})}else[...Array(L.length)].map((_,d)=>d);if(n.$$.dirty[0]&16777216&&T!==!1&&t(46,It=T),n.$$.dirty[0]&184549376|n.$$.dirty[1]&3&&T!==!1){const _=dr(T,L,O,ce,Nt);document.documentElement.style.setProperty("--selected-col-pos",_.col_pos),_.row_pos&&document.documentElement.style.setProperty("--selected-row-pos",_.row_pos)}},[f,s,i,r,u,c,h,g,A,B,j,b,w,k,D,E,z,H,Q,K,y,we,De,v,T,O,ie,L,Ye,je,kt,ce,Nt,X,ae,J,te,Y,q,m,p,F,C,be,il,Ft,It,Et,o,l,ro,zl,sl,_o,Pt,vt,fo,rl,Bl,yt,qt,mo,Rl,Ct,ul,_l,Hl,Pl,Nl,wo,al,a,x,N,Xe,Be,po,ko,vo,yo,qo,Co,Eo,Ao,So,Mo,zo,Lo,Do,Bo,jo,To,Ro,Ho,Po,No,Fo,Oo,Io,Ko,Uo,Vo,Xo,Yo,Jo,Wo,Go,Qo,Zo,$o,xo,es,ts,ls,ns,os,ss,is,rs,us,_s,as,fs]}class Or extends qr{constructor(e){super(),Er(this,e,Fr,Rr,Sr,{datatype:1,label:2,show_label:3,headers:71,values:0,col_count:4,row_count:5,latex_delimiters:6,editable:7,wrap:8,root:9,i18n:10,max_height:11,line_breaks:12,column_widths:13,show_row_numbers:14,upload:15,stream_handler:16,show_fullscreen_button:17,show_copy_button:18,value_is_output:72,max_chars:19,show_search:20,pinned_columns:73,display_value:21,styling:22},null,[-1,-1,-1,-1,-1])}get datatype(){return this.$$.ctx[1]}set datatype(e){this.$$set({datatype:e}),ne()}get label(){return this.$$.ctx[2]}set label(e){this.$$set({label:e}),ne()}get show_label(){return this.$$.ctx[3]}set show_label(e){this.$$set({show_label:e}),ne()}get headers(){return this.$$.ctx[71]}set headers(e){this.$$set({headers:e}),ne()}get values(){return this.$$.ctx[0]}set values(e){this.$$set({values:e}),ne()}get col_count(){return this.$$.ctx[4]}set col_count(e){this.$$set({col_count:e}),ne()}get row_count(){return this.$$.ctx[5]}set row_count(e){this.$$set({row_count:e}),ne()}get latex_delimiters(){return this.$$.ctx[6]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),ne()}get editable(){return this.$$.ctx[7]}set editable(e){this.$$set({editable:e}),ne()}get wrap(){return this.$$.ctx[8]}set wrap(e){this.$$set({wrap:e}),ne()}get root(){return this.$$.ctx[9]}set root(e){this.$$set({root:e}),ne()}get i18n(){return this.$$.ctx[10]}set i18n(e){this.$$set({i18n:e}),ne()}get max_height(){return this.$$.ctx[11]}set max_height(e){this.$$set({max_height:e}),ne()}get line_breaks(){return this.$$.ctx[12]}set line_breaks(e){this.$$set({line_breaks:e}),ne()}get column_widths(){return this.$$.ctx[13]}set column_widths(e){this.$$set({column_widths:e}),ne()}get show_row_numbers(){return this.$$.ctx[14]}set show_row_numbers(e){this.$$set({show_row_numbers:e}),ne()}get upload(){return this.$$.ctx[15]}set upload(e){this.$$set({upload:e}),ne()}get stream_handler(){return this.$$.ctx[16]}set stream_handler(e){this.$$set({stream_handler:e}),ne()}get show_fullscreen_button(){return this.$$.ctx[17]}set show_fullscreen_button(e){this.$$set({show_fullscreen_button:e}),ne()}get show_copy_button(){return this.$$.ctx[18]}set show_copy_button(e){this.$$set({show_copy_button:e}),ne()}get value_is_output(){return this.$$.ctx[72]}set value_is_output(e){this.$$set({value_is_output:e}),ne()}get max_chars(){return this.$$.ctx[19]}set max_chars(e){this.$$set({max_chars:e}),ne()}get show_search(){return this.$$.ctx[20]}set show_search(e){this.$$set({show_search:e}),ne()}get pinned_columns(){return this.$$.ctx[73]}set pinned_columns(e){this.$$set({pinned_columns:e}),ne()}get display_value(){return this.$$.ctx[21]}set display_value(e){this.$$set({display_value:e}),ne()}get styling(){return this.$$.ctx[22]}set styling(e){this.$$set({styling:e}),ne()}}const Ir=Or,{SvelteComponent:Kr,add_flush_callback:Ur,assign:Vr,bind:Xr,binding_callbacks:Yr,create_component:yl,destroy_component:ql,detach:Jr,flush:ee,get_spread_object:Wr,get_spread_update:Gr,init:Qr,insert:Zr,mount_component:Cl,safe_not_equal:$r,space:xr,transition_in:El,transition_out:Al}=window.__gradio__svelte__internal;function eu(n){let e,t,l,o,s;const i=[{autoscroll:n[16].autoscroll},{i18n:n[16].i18n},n[19]];let r={};for(let u=0;u<i.length;u+=1)r=Vr(r,i[u]);e=new ps({props:r}),e.$on("clear_status",n[33]);function a(u){n[36](u)}let f={root:n[13],label:n[7],show_label:n[8],row_count:n[6],col_count:n[5],values:n[31]||n[0].data,display_value:n[29],styling:n[28],headers:n[30],wrap:n[9],datatype:n[10],latex_delimiters:n[17],editable:n[20],max_height:n[18],i18n:n[16].i18n,line_breaks:n[14],column_widths:n[15],upload:n[34],stream_handler:n[35],show_fullscreen_button:n[21],max_chars:n[22],show_copy_button:n[23],show_row_numbers:n[24],show_search:n[25],pinned_columns:n[26]};return n[1]!==void 0&&(f.value_is_output=n[1]),l=new Ir({props:f}),Yr.push(()=>Xr(l,"value_is_output",a)),l.$on("change",n[37]),l.$on("input",n[38]),l.$on("select",n[39]),l.$on("search",n[40]),{c(){yl(e.$$.fragment),t=xr(),yl(l.$$.fragment)},m(u,c){Cl(e,u,c),Zr(u,t,c),Cl(l,u,c),s=!0},p(u,c){const h=c[0]&589824?Gr(i,[c[0]&65536&&{autoscroll:u[16].autoscroll},c[0]&65536&&{i18n:u[16].i18n},c[0]&524288&&Wr(u[19])]):{};e.$set(h);const g={};c[0]&8192&&(g.root=u[13]),c[0]&128&&(g.label=u[7]),c[0]&256&&(g.show_label=u[8]),c[0]&64&&(g.row_count=u[6]),c[0]&32&&(g.col_count=u[5]),c[0]&1|c[1]&1&&(g.values=u[31]||u[0].data),c[0]&536870912&&(g.display_value=u[29]),c[0]&268435456&&(g.styling=u[28]),c[0]&1073741824&&(g.headers=u[30]),c[0]&512&&(g.wrap=u[9]),c[0]&1024&&(g.datatype=u[10]),c[0]&131072&&(g.latex_delimiters=u[17]),c[0]&1048576&&(g.editable=u[20]),c[0]&262144&&(g.max_height=u[18]),c[0]&65536&&(g.i18n=u[16].i18n),c[0]&16384&&(g.line_breaks=u[14]),c[0]&32768&&(g.column_widths=u[15]),c[0]&65536&&(g.upload=u[34]),c[0]&65536&&(g.stream_handler=u[35]),c[0]&2097152&&(g.show_fullscreen_button=u[21]),c[0]&4194304&&(g.max_chars=u[22]),c[0]&8388608&&(g.show_copy_button=u[23]),c[0]&16777216&&(g.show_row_numbers=u[24]),c[0]&33554432&&(g.show_search=u[25]),c[0]&67108864&&(g.pinned_columns=u[26]),!o&&c[0]&2&&(o=!0,g.value_is_output=u[1],Ur(()=>o=!1)),l.$set(g)},i(u){s||(El(e.$$.fragment,u),El(l.$$.fragment,u),s=!0)},o(u){Al(e.$$.fragment,u),Al(l.$$.fragment,u),s=!1},d(u){u&&Jr(t),ql(e,u),ql(l,u)}}}function tu(n){let e,t;return e=new cs({props:{visible:n[4],padding:!1,elem_id:n[2],elem_classes:n[3],container:!1,scale:n[11],min_width:n[12],overflow_behavior:"visible",$$slots:{default:[eu]},$$scope:{ctx:n}}}),{c(){yl(e.$$.fragment)},m(l,o){Cl(e,l,o),t=!0},p(l,o){const s={};o[0]&16&&(s.visible=l[4]),o[0]&4&&(s.elem_id=l[2]),o[0]&8&&(s.elem_classes=l[3]),o[0]&2048&&(s.scale=l[11]),o[0]&4096&&(s.min_width=l[12]),o[0]&2147477475|o[1]&1025&&(s.$$scope={dirty:o,ctx:l}),e.$set(s)},i(l){t||(El(e.$$.fragment,l),t=!0)},o(l){Al(e.$$.fragment,l),t=!1},d(l){ql(e,l)}}}function lu(n,e,t){let l,o,s,i,{headers:r=[]}=e,{elem_id:a=""}=e,{elem_classes:f=[]}=e,{visible:u=!0}=e,{value:c={data:[["","",""]],headers:["1","2","3"],metadata:null}}=e,{value_is_output:h=!1}=e,{col_count:g}=e,{row_count:A}=e,{label:B=null}=e,{show_label:j=!0}=e,{wrap:b}=e,{datatype:w}=e,{scale:k=null}=e,{min_width:D=void 0}=e,{root:E}=e,{line_breaks:z=!0}=e,{column_widths:H=[]}=e,{gradio:Q}=e,{latex_delimiters:x}=e,{max_height:K=void 0}=e,{loading_status:y}=e,{interactive:N}=e,{show_fullscreen_button:X=!1}=e,{max_chars:v=void 0}=e,{show_copy_button:T=!1}=e,{show_row_numbers:we=!1}=e,{show_search:De="none"}=e,ae=null,{pinned_columns:O=0}=e;const pe=()=>Q.dispatch("clear_status",y),J=(...C)=>Q.client.upload(...C),te=(...C)=>Q.client.stream(...C);function Y(C){h=C,t(1,h)}const q=C=>{t(0,c.data=C.detail.data,c),t(0,c.headers=C.detail.headers,c),Q.dispatch("change")},m=C=>Q.dispatch("input"),p=C=>Q.dispatch("select",C.detail),F=C=>t(27,ae=C.detail);return n.$$set=C=>{"headers"in C&&t(32,r=C.headers),"elem_id"in C&&t(2,a=C.elem_id),"elem_classes"in C&&t(3,f=C.elem_classes),"visible"in C&&t(4,u=C.visible),"value"in C&&t(0,c=C.value),"value_is_output"in C&&t(1,h=C.value_is_output),"col_count"in C&&t(5,g=C.col_count),"row_count"in C&&t(6,A=C.row_count),"label"in C&&t(7,B=C.label),"show_label"in C&&t(8,j=C.show_label),"wrap"in C&&t(9,b=C.wrap),"datatype"in C&&t(10,w=C.datatype),"scale"in C&&t(11,k=C.scale),"min_width"in C&&t(12,D=C.min_width),"root"in C&&t(13,E=C.root),"line_breaks"in C&&t(14,z=C.line_breaks),"column_widths"in C&&t(15,H=C.column_widths),"gradio"in C&&t(16,Q=C.gradio),"latex_delimiters"in C&&t(17,x=C.latex_delimiters),"max_height"in C&&t(18,K=C.max_height),"loading_status"in C&&t(19,y=C.loading_status),"interactive"in C&&t(20,N=C.interactive),"show_fullscreen_button"in C&&t(21,X=C.show_fullscreen_button),"max_chars"in C&&t(22,v=C.max_chars),"show_copy_button"in C&&t(23,T=C.show_copy_button),"show_row_numbers"in C&&t(24,we=C.show_row_numbers),"show_search"in C&&t(25,De=C.show_search),"pinned_columns"in C&&t(26,O=C.pinned_columns)},n.$$.update=()=>{n.$$.dirty[0]&134217729&&t(31,l=ae?c.data?.filter(C=>C.some(be=>ae&&String(be).toLowerCase().includes(ae.toLowerCase()))):null),n.$$.dirty[0]&1|n.$$.dirty[1]&2&&t(30,o=[...c.headers||r]),n.$$.dirty[0]&1&&t(29,s=c?.metadata?.display_value?[...c?.metadata?.display_value]:null),n.$$.dirty[0]&1048577&&t(28,i=!N&&c?.metadata?.styling?[...c?.metadata?.styling]:null)},[c,h,a,f,u,g,A,B,j,b,w,k,D,E,z,H,Q,x,K,y,N,X,v,T,we,De,O,ae,i,s,o,l,r,pe,J,te,Y,q,m,p,F]}class vu extends Kr{constructor(e){super(),Qr(this,e,lu,tu,$r,{headers:32,elem_id:2,elem_classes:3,visible:4,value:0,value_is_output:1,col_count:5,row_count:6,label:7,show_label:8,wrap:9,datatype:10,scale:11,min_width:12,root:13,line_breaks:14,column_widths:15,gradio:16,latex_delimiters:17,max_height:18,loading_status:19,interactive:20,show_fullscreen_button:21,max_chars:22,show_copy_button:23,show_row_numbers:24,show_search:25,pinned_columns:26},null,[-1,-1])}get headers(){return this.$$.ctx[32]}set headers(e){this.$$set({headers:e}),ee()}get elem_id(){return this.$$.ctx[2]}set elem_id(e){this.$$set({elem_id:e}),ee()}get elem_classes(){return this.$$.ctx[3]}set elem_classes(e){this.$$set({elem_classes:e}),ee()}get visible(){return this.$$.ctx[4]}set visible(e){this.$$set({visible:e}),ee()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),ee()}get value_is_output(){return this.$$.ctx[1]}set value_is_output(e){this.$$set({value_is_output:e}),ee()}get col_count(){return this.$$.ctx[5]}set col_count(e){this.$$set({col_count:e}),ee()}get row_count(){return this.$$.ctx[6]}set row_count(e){this.$$set({row_count:e}),ee()}get label(){return this.$$.ctx[7]}set label(e){this.$$set({label:e}),ee()}get show_label(){return this.$$.ctx[8]}set show_label(e){this.$$set({show_label:e}),ee()}get wrap(){return this.$$.ctx[9]}set wrap(e){this.$$set({wrap:e}),ee()}get datatype(){return this.$$.ctx[10]}set datatype(e){this.$$set({datatype:e}),ee()}get scale(){return this.$$.ctx[11]}set scale(e){this.$$set({scale:e}),ee()}get min_width(){return this.$$.ctx[12]}set min_width(e){this.$$set({min_width:e}),ee()}get root(){return this.$$.ctx[13]}set root(e){this.$$set({root:e}),ee()}get line_breaks(){return this.$$.ctx[14]}set line_breaks(e){this.$$set({line_breaks:e}),ee()}get column_widths(){return this.$$.ctx[15]}set column_widths(e){this.$$set({column_widths:e}),ee()}get gradio(){return this.$$.ctx[16]}set gradio(e){this.$$set({gradio:e}),ee()}get latex_delimiters(){return this.$$.ctx[17]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),ee()}get max_height(){return this.$$.ctx[18]}set max_height(e){this.$$set({max_height:e}),ee()}get loading_status(){return this.$$.ctx[19]}set loading_status(e){this.$$set({loading_status:e}),ee()}get interactive(){return this.$$.ctx[20]}set interactive(e){this.$$set({interactive:e}),ee()}get show_fullscreen_button(){return this.$$.ctx[21]}set show_fullscreen_button(e){this.$$set({show_fullscreen_button:e}),ee()}get max_chars(){return this.$$.ctx[22]}set max_chars(e){this.$$set({max_chars:e}),ee()}get show_copy_button(){return this.$$.ctx[23]}set show_copy_button(e){this.$$set({show_copy_button:e}),ee()}get show_row_numbers(){return this.$$.ctx[24]}set show_row_numbers(e){this.$$set({show_row_numbers:e}),ee()}get show_search(){return this.$$.ctx[25]}set show_search(e){this.$$set({show_search:e}),ee()}get pinned_columns(){return this.$$.ctx[26]}set pinned_columns(e){this.$$set({pinned_columns:e}),ee()}}export{Ir as BaseDataFrame,Cu as BaseExample,vu as default};
|
|
//# sourceMappingURL=Index-BuDZ-7Iv.js.map
|