1import{B as ko}from"./Block-CMfAaXj9.js";import"./MarkdownCode.svelte_svelte_type_style_lang-BzidkVB1.js";import"./IconButtonWrapper.svelte_svelte_type_style_lang-CPevJZa9.js";import{w as po,k as St}from"./index-C1aeWpzY.js";import{d as vo}from"./dsv-DB8NKgIY.js";import{d as vt}from"./index-CnqicUFC.js";import{a as yo}from"./Upload-CoxNxyp7.js";import"./DownloadLink.svelte_svelte_type_style_lang-C_5UIfol.js";import{M as Co}from"./MarkdownCode-DYhoLAju.js";import{C as ui}from"./Check-BiRlaMNo.js";import{C as So}from"./Copy-CxQ9EyK2.js";import{M as Eo,a as Mo}from"./FullscreenButton-DDesI3hz.js";import{S as qo}from"./index-DTtw30GJ.js";import"./StreamingBar.svelte_svelte_type_style_lang-CDNxkBIr.js";import Ao from"./Index-DsUQoM1e.js";import{default as Wc}from"./Example-CqPGqNav.js";import"./prism-python-Bhmms-Lt.js";import"./svelte/svelte.js";/* empty css */import"./IconButton-DbC-jsk_.js";import"./Clear-By3xiIwg.js";import"./ImagePreview-BSGhI99w.js";import"./utils-BsGrhMNe.js";import"./BlockLabel-JbMBN4MZ.js";import"./Empty-BgOmVBFg.js";import"./ShareButton-BfWeO6Sd.js";import"./Community-Dw1micSV.js";import"./Download-DVtk-Jv3.js";import"./IconButtonWrapper-DrWC4NJv.js";import"./utils-Gtzs_Zla.js";import"./Image-CnqB5dbD.js";import"./file-url-DoxvUUVV.js";import"./DownloadLink-QIttOhoR.js";/* empty css */import"./ImageUploader-Bgsnn6Ao.js";import"./SelectSource-C_xcpRDd.js";import"./DropdownArrow-DuA1Ifms.js";import"./Square-oAGqOwsh.js";import"./index-Dd1js9rI.js";import"./StreamingBar-BU9S4hA7.js";import"./UploadText-CzGAfhJY.js";import"./Example-CC8yxxGn.js";/* empty css */function Lo(n,e){const[t,l]=n;return e.some(([s,i])=>s===t&&i===l)}function jo(n,e){const[t,l]=n;if(!e.some(([u,c])=>u===t&&c===l))return"";const s=e.some(([u,c])=>u===t-1&&c===l),i=e.some(([u,c])=>u===t+1&&c===l),o=e.some(([u,c])=>u===t&&c===l-1),_=e.some(([u,c])=>u===t&&c===l+1);return`cell-selected${s?" no-top":""}${i?" no-bottom":""}${o?" no-left":""}${_?" no-right":""}`}function fl(n,e){const[t,l]=n,[s,i]=e,o=Math.min(t,s),_=Math.max(t,s),u=Math.min(l,i),c=Math.max(l,i),r=[];r.push(n);for(let a=o;a<=_;a++)for(let f=u;f<=c;f++)a===t&&f===l||r.push([a,f]);return r}function Bo(n,e,t){if(t.shiftKey&&e.length>0)return fl(e[e.length-1],n);if(t.metaKey||t.ctrlKey){const l=([i,o])=>i===n[0]&&o===n[1],s=e.findIndex(l);return s===-1?[...e,n]:e.filter((i,o)=>o!==s)}return[n]}function zo(n,e){const t=n.map(l=>[...l]);return e.forEach(([l,s])=>{t[l]&&t[l][s]&&(t[l][s]={...t[l][s],value:""})}),t}function Do(n,e,t){const[l,s]=n;return t&&e.length===1&&e[0][0]===l&&e[0][1]===s}function To(n,e,t){const[l,s]=n,i=t?-1:1;if(e[l]?.[s+i])return[l,s+i];const o=l+(i>0?1:0),_=l+(i<0?-1:0);return i>0&&e[o]?.[0]?[o,0]:i<0&&e[_]?.[e[0].length-1]?[_,e[0].length-1]:!1}function Ho(n,e,t){const l=n.key,s={ArrowRight:[0,1],ArrowLeft:[0,-1],ArrowDown:[1,0],ArrowUp:[-1,0]}[l];let i,o;if(n.metaKey||n.ctrlKey)if(l==="ArrowRight")i=e[0],o=t[0].length-1;else if(l==="ArrowLeft")i=e[0],o=0;else if(l==="ArrowDown")i=t.length-1,o=e[1];else if(l==="ArrowUp")i=0,o=e[1];else return!1;else i=e[0]+s[0],o=e[1]+s[1];return i<0&&o<=0?!1:t[i]?.[o]?[i,o]:!1}function Ro(n,e){return e.reduce((t,l,s)=>{const i=l.reduce((o,_,u)=>n===_.id?u:o,-1);return i===-1?t:[s,i]},[-1,-1])}function No(n,e){const[t]=n.composedPath();return!e.contains(t)}function Po(n,e,t,l,s){const[i,o]=n;if(!e[i]?.[o])return{col_pos:"0px",row_pos:void 0};const _=e[i][o].id,u=t[_]?.cell;if(!u)return{col_pos:"0px",row_pos:void 0};const c=u.getBoundingClientRect(),r=s.getBoundingClientRect(),a=`${c.left-r.left+c.width/2}px`,f=`${c.top-r.top+c.height/2}px`;return{col_pos:a,row_pos:f}}const{getContext:Kc,setContext:Nl}=window.__gradio__svelte__internal,{tick:Ko}=window.__gradio__svelte__internal,Io=Symbol("selection");function Oo(n){const e=Symbol(`selection_${Math.random().toString(36).substring(2)}`),t={handle_cell_click:(s,i,o)=>{if(s.target instanceof HTMLAnchorElement||(s.preventDefault(),s.stopPropagation(),n.show_row_numbers&&o===-1))return;n.clear_on_focus=!1,n.df_actions.set_active_cell_menu(null),n.df_actions.set_active_header_menu(null),n.df_actions.set_selected_header(!1),n.df_actions.set_header_edit(!1);const _=Bo([i,o],n.selected_cells||[],s);n.df_actions.set_selected_cells(_),n.df_actions.set_selected(_[0]),n.editable?_.length===1?(n.df_actions.set_editing([i,o]),Ko().then(()=>{const u=n.els[n.data[i][o].id].input;
1u&&(u.focus(),u.selectionStart=u.selectionEnd=u.value.length)})):(n.df_actions.set_editing(!1),n.parent_element.focus()):n.parent_element.focus(),t.toggle_cell_button(i,o),n.dispatch("select",{index:[i,o],value:n.get_data_at(i,o),row_value:n.data[i].map(u=>u.value)})},toggle_cell_menu:(s,i,o)=>{s.stopPropagation();const _=n.df_actions.get_active_cell_menu();if(_&&_.row===i&&_.col===o)n.df_actions.set_active_cell_menu(null);else{const u=s.target.closest("td");if(u){const c=u.getBoundingClientRect();n.df_actions.set_active_cell_menu({row:i,col:o,x:c.right,y:c.bottom})}}},toggle_cell_button:(s,i)=>{const o=n.df_actions.get_active_button(),_=o?.type==="cell"&&o.row===s&&o.col===i?null:{type:"cell",row:s,col:i};n.df_actions.set_active_button(_)},handle_select_column:s=>{const i=n.data.map((o,_)=>[_,s]);n.df_actions.set_selected_cells(i),n.df_actions.set_selected(i[0]),n.df_actions.set_editing(!1),setTimeout(()=>{n.parent_element.focus()},0)},handle_select_row:s=>{const i=n.data[0].map((o,_)=>[s,_]);n.df_actions.set_selected_cells(i),n.df_actions.set_selected(i[0]),n.df_actions.set_editing(!1),setTimeout(()=>{n.parent_element.focus()},0)}},l={...n,actions:t};return Nl(e,l),Nl(Io,{instance_id:e,context:l}),l}const{getContext:Ic,setContext:Pl}=window.__gradio__svelte__internal,Fo=Symbol("keyboard");function Vo(n){const e=Symbol(`keyboard_${Math.random().toString(36).substring(2)}`);return Pl(e,n),Pl(Fo,{instance_id:e,context:n}),n}function Uo(n,e){if(!n||!n.length||!n[0])return[];if(e.length>0){const t=[...Array(n.length)].map((l,s)=>s);return t.sort((l,s)=>{const i=n[l],o=n[s];for(const{col:_,direction:u}of e){if(!i||!o||_<0||_>=i.length||_>=o.length||!i[_]||!o[_])continue;const c=i[_].value,r=o[_].value,a=c<r?-1:c>r?1:0;if(a!==0)return u==="asc"?a:-a}return 0}),t}return[...Array(n.length)].map((t,l)=>l)}function Wo(n,e,t,l,s,i){let o=null;s&&s[0]in n&&s[1]in n[s[0]]&&(o=n[s[0]][s[1]].id),ci(n,e,t,l);let _=s;if(o){const[u,c]=i(o,n);_=[u,c]}return{data:n,selected:_}}function Yo(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 ci(n,e,t,l){if(!l.length||!n||!n.length)return;const s=Uo(n,l),i=s.map(o=>n[o]);if(n.splice(0,n.length,...i),e){const o=s.map(_=>e[_]);e.splice(0,e.length,...o)}if(t){const o=s.map(_=>t[_]);t.splice(0,t.length,...o)}}async function fi(n,e){if(!n||!n.length)return;const l=(e||n.flatMap((_,u)=>_.map((c,r)=>[u,r]))).reduce((_,[u,c])=>{_[u]=_[u]||{};const r=String(n[u][c].value);return _[u][c]=r.includes(",")||r.includes('"')||r.includes(` 2`)?`"${r.replace(/"/g,'""')}"`:r,_},{}),s=Object.keys(l).sort((_,u)=>+_-+u);if(!s.length)return;const i=Object.keys(l[s[0]]).sort((_,u)=>+_-+u),o=s.map(_=>i.map(u=>l[_][u]||"").join(",")).join(` 3`);try{await navigator.clipboard.writeText(o)}catch(_){throw new Error("Failed to copy to clipboard: "+_.message)}}function Jo(n,e){return e.filter(t);function t(l){var s=-1;return n.split(` 4`).every(i);function i(o){if(!o)return!0;var _=o.split(l).length;return s<0&&(s=_),s===_&&_>1}}}function Xo(n){const e=atob(n.split(",")[1]),t=n.split(",")[0].split(":")[1].split(";")[0],l=new ArrayBuffer(e.length),s=new Uint8Array(l);for(let i=0;i<e.length;i++)s[i]=e.charCodeAt(i);return new Blob([l],{type:t})}function Go(n,e,t){const l=Xo(n),s=new FileReader;s.addEventListener("loadend",i=>{if(!i?.target?.result||typeof i.target.result!="string")return;const[o]=Jo(i.target.result,[","," "]),[_,...u]=vo(o).parseRows(i.target.result);e(_),t(u)}),s.readAsText(l)}const{getContext:Oc,setContext:Kl}=window.__gradio__svelte__internal,Qo=Symbol("dataframe");function Zo(n){const e=(s,i,o)=>{if(!s||s.length===0)return[[{value:"",id:i()}]];const _=Array(s[0].length).fill(null).map(()=>({value:"",id:i()})),u=[...s];return typeof o=="number"&&o>=0&&o<=s.length?u.splice(o,0,_):u.push(_),u},t=(s,i,o,_)=>{if(!s||s.length===0)return{data:[[{value:"",id:o()}]],headers:["Header 1"]};const u=[...i],c=s.map(r=>[...r]);return typeof _=="number"&&_>=0&&_<=(s[0]?.length||0)?(u.splice(_,0,`Header ${i.length+1}
4`),c.forEach(r=>{const a=o();r.splice(_,0,{value:"",id:a})})):(u.push(`Header ${i.length+1}`),c.forEach(r=>{const a=o();r.push({value:"",id:a})})),{data:c,headers:u}},l=()=>{n.update(s=>({...s,sort_state:{sort_columns:[],row_order:[]}}))};return{handle_search:s=>{n.update(i=>({...i,current_search_query:s}))},handle_sort:(s,i)=>{n.update(o=>{const _=[...o.sort_state.sort_columns],u=_.findIndex(c=>c.col===s);return u!==-1?_[u].direction===i?_.splice(u,1):_[u]={col:s,direction:i}:(_.length>=3&&_.shift(),_.push({col:s,direction:i})),{...o,sort_state:{...o.sort_state,sort_columns:_}}})},get_sort_status:(s,i)=>{const _=St(n).sort_state.sort_columns.find(u=>i[u.col]===s);return _?_.direction:"none"},sort_data:(s,i,o)=>{const _=St(n);_.sort_state.sort_columns.length>0&&ci(s,i,o,_.sort_state.sort_columns)},update_row_order:s=>{n.update(i=>{const o={...i.sort_state};if(o.sort_columns.length>0&&s[0]){const _=[...Array(s.length)].map((u,c)=>c);_.sort((u,c)=>{const r=s[u],a=s[c];for(const{col:f,direction:p}of o.sort_columns){if(!r||!a||f<0||f>=r.length||f>=a.length)continue;const C=r[f].value,m=a[f].value,y=C<m?-1:C>m?1:0;if(y!==0)return p==="asc"?y:-y}return 0}),o.row_order=_}else o.row_order=[...Array(s.length)].map((_,u)=>u);return{...i,sort_state:o}})},filter_data:s=>{const i=St(n);if(!i.current_search_query)return s;const o=i.current_search_query.toLowerCase();return s.filter(u=>u.some(c=>{if(!c)return!1;const r=c.value;return r==null?!1:String(r).toLowerCase().includes(o)}))},add_row:e,add_col:t,add_row_at:(s,i,o,_)=>{const u=o==="above"?i:i+1;return e(s,_,u)},add_col_at:(s,i,o,_,u)=>{const c=_==="left"?o:o+1;return t(s,i,u,c)},delete_row:(s,i)=>{if(s.length<=1)return s;const o=[...s];return o.splice(i,1),o},delete_col:(s,i,o)=>{if(i.length<=1)return{data:s,headers:i};const _=[...i];return _.splice(o,1),{data:s.map(c=>{const r=[...c];return r.splice(o,1),r}),headers:_}},delete_row_at:(s,i)=>(s.length<=1||s.splice(i,1),s),delete_col_at:(s,i,o)=>{if(i.length<=1)return{data:s,headers:i};const _=[...i];return _.splice(o,1),{data:s.map(c=>{const r=[...c];return r.splice(o,1),r}),headers:_}},set_active_cell_menu:s=>{n.update(i=>({...i,ui_state:{...i.ui_state,active_cell_menu:s}}))},set_active_header_menu:s=>{n.update(i=>({...i,ui_state:{...i.ui_state,active_header_menu:s}}))},set_selected_cells:s=>{n.update(i=>({...i,ui_state:{...i.ui_state,selected_cells:s}}))},set_selected:s=>{n.update(i=>({...i,ui_state:{...i.ui_state,selected:s}}))},set_editing:s=>{n.update(i=>({...i,ui_state:{...i.ui_state,editing:s}}))},clear_ui_state:()=>{n.update(s=>({...s,ui_state:{active_cell_menu:null,active_header_menu:null,selected_cells:[],selected:!1,editing:!1,header_edit:!1,selected_header:!1,active_button:null}}))},set_header_edit:s=>{n.update(i=>({...i,ui_state:{...i.ui_state,selected_cells:[],selected_header:s,header_edit:s}}))},set_selected_header:s=>{n.update(i=>({...i,ui_state:{...i.ui_state,selected_header:s,selected:!1,selected_cells:[]}}))},handle_header_click:(s,i)=>{n.update(o=>({...o,ui_state:{...o.ui_state,active_cell_menu:null,active_header_menu:null,selected:!1,selected_cells:[],selected_header:s,header_edit:i?s:!1}}))},end_header_edit:s=>{(s==="Escape"||s==="Enter"||s==="Tab")&&n.update(i=>({...i,ui_state:{...i.ui_state,selected:!1,header_edit:!1}}))},trigger_change:async(s,i,o,_,u,c)=>{if(St(n).current_search_query)return;const a=i.map(p=>p.value),f=s.map(p=>p.map(C=>String(C.value)));(!vt(f,o)||!vt(a,_))&&(vt(a,_)||l(),c("change",{data:s.map(p=>p.map(C=>C.value)),headers:i.map(p=>p.value),metadata:null}),u||c("input"))},get_selected_cells:()=>St(n).ui_state.selected_cells,get_active_cell_menu:()=>St(n).ui_state.active_cell_menu,get_active_button:()=>St(n).ui_state.active_button,set_active_button:s=>{n.update(i=>({...i,ui_state:{...i.ui_state,active_button:s}}))},reset_sort_state:l}}function $o(n){const e=Symbol(`dataframe_${Math.random().toString(36).substring(2)}`),t=po({config:n,current_search_query:null,sort_state:{sort_columns:[],row_order:[]},ui_state:{active_cell_menu:null,active_header_menu:null,selected_cells:[],selected:!1,editing:!1,header_edit:!1,selected_header:!1,active_button:null}}),l=Zo(t),s={state:t,actions:l};return Kl(e,s),Kl(Qo,{instance_id:e,context:s}),s}const{SvelteComponent:xo,append:Fn,attr:Je,detach:er,element:Il,flush:Vn,init:tr,insert:nr,listen:lr,noop:Ol,null_to_empty:Fl,safe_not_equal:sr,stop_propagation:ir,svg_element:Vl}=window.__gradio__svelte__internal;function or(n){let e,t,l,s,i,o,_,u,c;return{c(){e=Il("button"),t=Il("span"),l=Vl("svg"),s=Vl("path"),Je(s,"d","m16.707 13.293-4-4a1 1 0 0 0-1.414 0l-4 4A1 1 0 0 0 8 15h8a1 1 0 0 0 .707-1.707z"),Je(s,"data-name",n[3]),Je(l,"xmlns","http://www.w3.org/2000/svg"),Je(l,"viewBox","0 0 24 24"),Je(l,"class","svelte-1mp8yw1"),Je(t,"class",i=Fl(n[3])+" svelte-1mp8yw1"),Je(e,"class",o="selection-button selection-button-"+n[0]+" "+(n[2]?`move-${n[3]}`:"")+" svelte-1mp8yw1"),Je(e,"aria-label",_=`Select ${n[0]}`)},m(r,a){nr(r,e,a),Fn(e,t),Fn(t,l),Fn(l,s),u||(c=lr(e,"click",ir(n[5])),u=!0)},p(r,[a]){a&8&&Je(s,"data-name",r[3]),a&8&&i!==(i=Fl(r[3])+" svelte-1mp8yw1")&&Je(t,"class",i),a&13&&o!==(o="selection-button selection-button-"+r[0]+" "+(r[2]?`move-${r[3]}`:"")+" svelte-1mp8yw1")&&Je(e,"class",o),a&1&&_!==(_=`Select ${r[0]}`)&&Je(e,"aria-label",_)},i:Ol,o:Ol,d(r){r&&er(e),u=!1,c()}}}function rr(n,e,t){let l,s,{position:i}=e,{coords:o}=e,{on_click:_=null}=e;const u=()=>_&&_();return n.$$set=c=>{"position"in c&&t(0,i=c.position),"coords"in c&&t(4,o=c.coords),"on_click"in c&&t(1,_=c.on_click)},n.$$.update=()=>{n.$$.dirty&17&&t(2,l=i==="column"?o[0]===0:o[1]===0),n.$$.dirty&5&&t(3,s=i==="column"?l?"down":"up":l?"right":"left")},[i,_,l,s,o,u]}class Ul extends xo{constructor(e){super(),tr(this,e,rr,or,sr,{position:0,
4coords:4,on_click:1})}get position(){return this.$$.ctx[0]}set position(e){this.$$set({position:e}),Vn()}get coords(){return this.$$.ctx[4]}set coords(e){this.$$set({coords:e}),Vn()}get on_click(){return this.$$.ctx[1]}set on_click(e){this.$$set({on_click:e}),Vn()}}const{HtmlTag:_r,SvelteComponent:ar,action_destroyer:ur,attr:Se,binding_callbacks:cr,bubble:dn,check_outros:Qn,construct_svelte_component:Wl,create_component:Jt,destroy_component:Xt,detach:at,element:hi,empty:hl,flush:de,group_outros:Zn,init:fr,insert:ut,listen:rt,mount_component:Gt,noop:Sn,prevent_default:hr,run_all:di,safe_not_equal:dr,set_data:mr,set_input_value:Yl,space:$n,stop_propagation:Un,text:gr,toggle_class:Ke,transition_in:st,transition_out:ct}=window.__gradio__svelte__internal,{createEventDispatcher:br}=window.__gradio__svelte__internal;function Jl(n){let e,t,l,s;return{c(){e=hi("input"),e.readOnly=n[8],Se(e,"aria-readonly",n[8]),Se(e,"role","textbox"),Se(e,"aria-label",t=n[8]?"Cell is read-only":"Edit cell"),Se(e,"tabindex","-1"),Se(e,"class","svelte-1y3tas2"),Ke(e,"header",n[3])},m(i,o){ut(i,e,o),n[35](e),Yl(e,n[20]),l||(s=[rt(e,"input",n[36]),rt(e,"blur",n[23]),rt(e,"mousedown",Un(n[32])),rt(e,"mouseup",Un(n[33])),rt(e,"click",Un(n[34])),ur(n[22].call(null,e)),rt(e,"keydown",n[24])],l=!0)},p(i,o){o[0]&256&&(e.readOnly=i[8]),o[0]&256&&Se(e,"aria-readonly",i[8]),o[0]&256&&t!==(t=i[8]?"Cell is read-only":"Edit cell")&&Se(e,"aria-label",t),o[0]&1048576&&e.value!==i[20]&&Yl(e,i[20]),o[0]&8&&Ke(e,"header",i[3])},d(i){i&&at(e),n[35](null),l=!1,di(s)}}}function wr(n){let e;return{c(){e=gr(n[21])},m(t,l){ut(t,e,l)},p(t,l){l[0]&2097152&&mr(e,t[21])},i:Sn,o:Sn,d(t){t&&at(e)}}}function kr(n){let e,t;return e=new Co({props:{message:n[21].toLocaleString(),latex_delimiters:n[5],line_breaks:n[6],chatbot:!1,root:n[9]}}),{c(){Jt(e.$$.fragment)},m(l,s){Gt(e,l,s),t=!0},p(l,s){const i={};s[0]&2097152&&(i.message=l[21].toLocaleString()),s[0]&32&&(i.latex_delimiters=l[5]),s[0]&64&&(i.line_breaks=l[6]),s[0]&512&&(i.root=l[9]),e.$set(i)},i(l){t||(st(e.$$.fragment,l),t=!0)},o(l){ct(e.$$.fragment,l),t=!1},d(l){Xt(e,l)}}}function pr(n){let e,t;return{c(){e=new _r(!1),t=hl(),e.a=t},m(l,s){e.m(n[21],l,s),ut(l,t,s)},p(l,s){s[0]&2097152&&e.p(l[21])},i:Sn,o:Sn,d(l){l&&(at(t),e.d())}}}function vr(n){let e,t,l;var s=n[11].image;function i(o,_){return{props:{value:{url:o[21]},show_label:!1,label:"cell-image",show_download_button:!1,i18n:o[12],gradio:{dispatch:Sr}}}}return s&&(e=Wl(s,i(n))),{c(){e&&Jt(e.$$.fragment),t=hl()},m(o,_){e&&Gt(e,o,_),ut(o,t,_),l=!0},p(o,_){if(_[0]&2048&&s!==(s=o[11].image)){if(e){Zn();const u=e;ct(u.$$.fragment,1,0,()=>{Xt(u,1)}),Qn()}s?(e=Wl(s,i(o)),Jt(e.$$.fragment),st(e.$$.fragment,1),Gt(e,t.parentNode,t)):e=null}else if(s){const u={};_[0]&2097152&&(u.value={url:o[21]}),_[0]&4096&&(u.i18n=o[12]),e.$set(u)}},i(o){l||(e&&st(e.$$.fragment,o),l=!0)},o(o){e&&ct(e.$$.fragment,o),l=!1},d(o){o&&at(t),e&&Xt(e,o)}}}function Xl(n){let e,t,l,s;return e=new Ul({props:{position:"column",coords:n[16],on_click:n[37]}}),l=new Ul({props:{position:"row",coords:n[16],on_click:n[38]}}),{c(){Jt(e.$$.fragment),t=$n(),Jt(l.$$.fragment)},m(i,o){Gt(e,i,o),ut(i,t,o),Gt(l,i,o),s=!0},p(i,o){const _={};o[0]&65536&&(_.coords=i[16]),o[0]&196608&&(_.on_click=i[37]),e.$set(_);const u={};o[0]&65536&&(u.coords=i[16]),o[0]&327680&&(u.on_click=i[38]),l.$set(u)},i(i){s||(st(e.$$.fragment,i),st(l.$$.fragment,i),s=!0)},o(i){ct(e.$$.fragment,i),ct(l.$$.fragment,i),s=!1},d(i){i&&at(t),Xt(e,i),Xt(l,i)}}}function yr(n){let e,t,l,s,i,o,_,u,c,r=n[1]&&Jl(n);const a=[vr,pr,kr,wr],f=[];function p(m,y){return m[4]==="image"&&m[11].image?0:m[4]==="html"?1:m[4]==="markdown"?2:3}l=p(n),s=f[l]=a[l](n);let C=n[15]&&n[16]&&n[17]&&n[18]&&Xl(n);return{c(){r&&r.c(),e=$n(),t=hi("span"),s.c(),i=$n(),C&&C.c(),o=hl(),Se(t,"tabindex","0"),Se(t,"role","button"),Se(t,"style",n[2]),Se(t,"data-editable",n[7]),Se(t,"data-max-chars",n[10]),Se(t,"data-expanded",n[19]),Se(t,"placeholder"," "),Se(t,"class","svelte-1y3tas2"),Ke(t,"dragging",n[13]),Ke(t,"edit",n[1]),Ke(t,"expanded",n[19]),Ke(t,"multiline",n[3]),Ke(t,"text",n[4]==="str"),Ke(t,"wrap",n[14])},m(m,y){r&&r.m(m,y),ut(m,e,y),ut(m,t,y),f[l].m(t,null),ut(m,i,y),C&&C.m(m,y),ut(m,o,y),_=!0,u||(c=[rt(t,"click",n[25]),rt(t,"keydown",n[24]),rt(t,"focus",hr(n[31]))],u=!0)},p(m,y){m[1]?r?r.p(m,y):(r=Jl(m),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null);let w=l;l=p(m),l===w?f[l].p(m,y):(Zn(),ct(f[w],1,1,()=>{f[w]=null}),Qn(),s=f[l],s?s.p(m,y):(s=f[l]=a[l](m),s.c()),st(s,1),s.m(t,null)),(!_||y[0]&4)&&Se(t,"style",m[2]),(!_||y[0]&128)&&Se(t,"data-editable",m[7]),(!_||y[0]&1024)&&Se(t,"data-max-chars",m[10]),(!_||y[0]&524288)&&Se(t,"data-expanded",m[19]),(!_||y[0]&8192)&&Ke(t,"dragging",m[13]),(!_||y[0]&2)&&Ke(t,"edit",m[1]),(!_||y[0]&524288)&&Ke(t,"expanded",m[19]),(!_||y[0]&8)&&Ke(t,"multiline",m[3]),(!_||y[0]&16)&&Ke(t,"text",m[4]==="str"),(!_||y[0]&16384)&&Ke(t,"wrap",m[14]),m[15]&&m[16]&&m[17]&&m[18]?C?(C.p(m,y),y[0]&491520&&st(C,1)):(C=Xl(m),C.c(),st(C,1),C.m(o.parentNode,o)):C&&(Zn(),ct(C,1,1,()=>{C=null}),Qn())},i(m){_||(st(s),st(C),_=!0)},o(m){ct(s),ct(C),_=!1}
4,d(m){m&&(at(e),at(t),at(i),at(o)),r&&r.d(m),f[l].d(),C&&C.d(m),u=!1,di(c)}}}function Cr(n,e=null,t=!1){if(t)return String(n);const l=String(n);return!e||e<=0||l.length<=e?l:l.slice(0,e)+"..."}const Sr=()=>{};function Er(n,e,t){let l,s,i,o,{edit:_}=e,{value:u=""}=e,{display_value:c=null}=e,{styling:r=""}=e,{header:a=!1}=e,{datatype:f="str"}=e,{latex_delimiters:p}=e,{clear_on_focus:C=!1}=e,{line_breaks:m=!0}=e,{editable:y=!0}=e,{is_static:w=!1}=e,{root:h}=e,{max_chars:k=null}=e,{components:v={}}=e,{i18n:S}=e,{is_dragging:j=!1}=e,{wrap_text:q=!1}=e,{show_selection_buttons:D=!1}=e,{coords:T=null}=e,{on_select_column:I=null}=e,{on_select_row:O=null}=e;const K=br();let F=!1,{el:ie}=e;function oe(M){return C&&t(20,l=""),requestAnimationFrame(()=>{M.focus()}),{}}function W({currentTarget:M}){t(26,u=M.value),K("blur")}function ne(M){M.key==="Enter"&&(_?(t(26,u=l),K("blur")):a||t(19,F=!F)),K("keydown",M)}function z(){!_&&!a&&t(19,F=!F)}function A(M){dn.call(this,n,M)}function ce(M){dn.call(this,n,M)}function G(M){dn.call(this,n,M)}function J(M){dn.call(this,n,M)}function Z(M){cr[M?"unshift":"push"](()=>{ie=M,t(0,ie)})}function H(){l=this.value,t(20,l),t(26,u)}const L=()=>I(T[1]),g=()=>O(T[0]);return n.$$set=M=>{"edit"in M&&t(1,_=M.edit),"value"in M&&t(26,u=M.value),"display_value"in M&&t(27,c=M.display_value),"styling"in M&&t(2,r=M.styling),"header"in M&&t(3,a=M.header),"datatype"in M&&t(4,f=M.datatype),"latex_delimiters"in M&&t(5,p=M.latex_delimiters),"clear_on_focus"in M&&t(28,C=M.clear_on_focus),"line_breaks"in M&&t(6,m=M.line_breaks),"editable"in M&&t(7,y=M.editable),"is_static"in M&&t(8,w=M.is_static),"root"in M&&t(9,h=M.root),"max_chars"in M&&t(10,k=M.max_chars),"components"in M&&t(11,v=M.components),"i18n"in M&&t(12,S=M.i18n),"is_dragging"in M&&t(13,j=M.is_dragging),"wrap_text"in M&&t(14,q=M.wrap_text),"show_selection_buttons"in M&&t(15,D=M.show_selection_buttons),"coords"in M&&t(16,T=M.coords),"on_select_column"in M&&t(17,I=M.on_select_column),"on_select_row"in M&&t(18,O=M.on_select_row),"el"in M&&t(0,ie=M.el)},n.$$.update=()=>{n.$$.dirty[0]&67108864&&t(20,l=u),n.$$.dirty[0]&525314&&t(30,s=!_&&!F&&k!==null&&k>0),n.$$.dirty[0]&201326720&&t(29,i=y?u:c!==null?c:u),n.$$.dirty[0]&1610613776&&t(21,o=s?Cr(i,k,f==="image"):i)},[ie,_,r,a,f,p,m,y,w,h,k,v,S,j,q,D,T,I,O,F,l,o,oe,W,ne,z,u,c,C,i,s,A,ce,G,J,Z,H,L,g]}class dl extends ar{constructor(e){super(),fr(this,e,Er,yr,dr,{edit:1,value:26,display_value:27,styling:2,header:3,datatype:4,latex_delimiters:5,clear_on_focus:28,line_breaks:6,editable:7,is_static:8,root:9,max_chars:10,components:11,i18n:12,is_dragging:13,wrap_text:14,show_selection_buttons:15,coords:16,on_select_column:17,on_select_row:18,el:0},null,[-1,-1])}get edit(){return this.$$.ctx[1]}set edit(e){this.$$set({edit:e}),de()}get value(){return this.$$.ctx[26]}set value(e){this.$$set({value:e}),de()}get display_value(){return this.$$.ctx[27]}set display_value(e){this.$$set({display_value:e}),de()}get styling(){return this.$$.ctx[2]}set styling(e){this.$$set({styling:e}),de()}get header(){return this.$$.ctx[3]}set header(e){this.$$set({header:e}),de()}get datatype(){return this.$$.ctx[4]}set datatype(e){this.$$set({datatype:e}),de()}get latex_delimiters(){return this.$$.ctx[5]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),de()}get clear_on_focus(){return this.$$.ctx[28]}set clear_on_focus(e){this.$$set({clear_on_focus:e}),de()}get line_breaks(){return this.$$.ctx[6]}set line_breaks(e){this.$$set({line_breaks:e}),de()}get editable(){return this.$$.ctx[7]}set editable(e){this.$$set({editable:e}),de()}get is_static(){return this.$$.ctx[8]}set is_static(e){this.$$set({is_static:e}),de()}get root(){return this.$$.ctx[9]}set root(e){this.$$set({root:e}),de()}get max_chars(){return this.$$.ctx[10]}set max_chars(e){this.$$set({max_chars:e}),de()}get components(){return this.$$.ctx[11]}set components(e){this.$$set({components:e}),de()}get i18n(){return this.$$.ctx[12]}set i18n(e){this.$$set({i18n:e}),de()}get is_dragging(){return this.$$.ctx[13]}set is_dragging(e){this.$$set({is_dragging:e}),de()}get wrap_text(){return this.$$.ctx[14]}set wrap_text(e){this.$$set({wrap_text:e}),de()}get show_selection_buttons(){return this.$$.ctx[15]}set show_selection_buttons(e){this.$$set({show_selection_buttons:e}),de()}get coords(){return this.$$.ctx[16]}set coords(e){this.$$set({coords:e}),de()}get on_select_column(){return this.$$.ctx[17]}set on_select_column(e){this.$$set({on_select_column:e}),de()}get on_select_row(){return this.$$.ctx[18]}set on_select_row(e){this.$$set({on_select_row:e}),de()}get el(){return this.$$.ctx[0]}set el(e){this.$$set({el:e}),de()}}const{SvelteComponent:Mr,append:qr,attr:At,detach:ml,element:mi,empty:Ar,flush:Gl,init:Lr,insert:gl,noop:xn,safe_not_equal:jr,set_data:Br,text:zr}=window.__gradio__svelte__internal;function Dr(n){let e,t=(n[0]!==null?n[0]+1:"")+"",l;return{c(){e=mi("td"),l=zr(t),At(e,"class","row-number svelte-l87gn2"),At(e,"tabindex","-1"),At(e,"data-row",n[0]),At(e,"data-col","row-number")},m(s,i){gl(s,e,i),qr(e,l)},p(s,i){i&1&&t!==(t=(s[0]!==null?s[0]+1:"")+"")&&Br(l,t),i&1&&At(e,"data-row",s[0])},d(s){s&&ml(e)}}}function Tr(n){let e;return{c(){e=mi("th"),e.innerHTML='<div class="cell-wrap"><div class="header-content"><div class="header-text"></div></div></div>',At(e,"tabindex","-1"),At(e,"class","row-number svelte-l87gn2")},m(t,l){gl(t,e,l)},p:xn,d(t){t&&ml(e)}}}function Hr(n){let e;function t(i,o){return i[1]?Tr:Dr}let l=t(n),s=l(n);return{c(){s.c(),e=Ar()},m(i,o){s.m(i,o),gl(i,e,o)},p(i,[o]){l===(l=t(i))&&s?s.p(i,o):(s.d(1),s=l(i),s&&(s.c(),s.m(e.parentNode,e)))},i:xn,o:xn,d(i){i&&ml(e),s.d(i)}}}function Rr(n,e,t){let{index:l=null}=e,{is_header:s=!1}=e;return n.$$set=i=>{"index"in i&&t(0,l=i.index),"is_header"in i&&t(1,s=i.is_header)},[l,s]}class An extends Mr{constructor(e){super(),Lr(this,e,Rr,Hr,jr,{index:0,is_header:1})}get index(){return this.$$.ctx[0]}set index(e){this.$$set({index:e}),Gl()}get is_header(){return this.$$.ctx[1]}set is_header(e){this.$$set({is_header:e}),Gl()}}const{SvelteComponent:Nr,attr:Wn,detach:Pr,element:Kr,flush:Ir,init:Or,insert:Fr,is_function:Vr,listen:Ql,noop:Zl,run_all:Ur,safe_not_equal:Wr}=window.__gradio__svelte__internal;function Yr(n){let e,t,l;return{c(){e=Kr("button"),e.textContent="â®",Wn(e,"aria-label","Open cell menu"),Wn(e,"class","cell-menu-button svelte-vt38nd"),Wn(e,"aria-haspopup","menu")},m(s,i){Fr(s,e,i),t||(l=[Ql(e,"click",function(){Vr(n[0])&&n[0].apply(this,arguments)}),Ql(e,"touchstart",n[1])],t=!0)},p(s,[i]){n=s},i:Zl,o:Zl,d(s){s&&Pr(e),t=!1,Ur(l)}}}function Jr(n,e,t){let{on_click:l}=e;const s=i=>{i.preventDefault();const o=i.touches[0],_=new MouseEvent("click",{clientX:o.clientX,clientY:o.clientY,bubbles:!0,cancelable:!0,view:window});l(_)};return n.$$set=i=>{"on_click"in i&&t(0,l=i.on_click)},[l,s]}class gi extends Nr{constructor(e){super(),Or(this,e,Jr,Yr,Wr,{on_click:0})}get on_click(){return this.$$.ctx[0]}set on_click(e){this.$$set({on_click:e}),Ir()}}const{SvelteComponent:Xr,attr:$l,detach:Gr,element:Qr,init:Zr,insert:$r,noop:Yn,safe_not_equal:xr}=window.__gradio__svelte__internal;function e_(n){let e;return{c(){e=Qr("div"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg>',$l(e,"class","wrapper svelte-1skchaw"),$l(e,"aria-label","Static column")},m(t,l){$r(t,e,l)},p:Yn,i:Yn,o:Yn,d(t){t&&Gr(e)}}}class t_ extends Xr{constructor(e){super(),Zr(this,e,null,e_,xr,{})}}const{SvelteComponent:n_,append:xl,attr:ze,detach:l_,flush:s_,init:i_,insert:o_,noop:es,safe_not_equal:r_,svg_element:Jn}=window.__gradio__svelte__internal;function __(n){let e,t,l;return{c(){e=Jn("svg"),t=Jn("path"),l=Jn("path"),ze(t,"d","M4 8L8 4L12 8"),ze(t,"stroke","currentColor"),ze(t,"stroke-width","1.5"),ze(t,"stroke-linecap","round"),ze(t,"stroke-linejoin","round"),ze(l,"d","M8 4V12"),ze(l,"stroke","currentColor"),ze(l,"stroke-width","1.5"),ze(l,"stroke-linecap","round"),ze(e,"width",n[0]),ze(e,"height",n[0]),ze(e,"viewBox","0 0 16 16"),ze(e,"fill","none"),ze(e,"xmlns","http://www.w3.org/2000/svg")},m(s,i){o_(s,e,i),xl(e,t),xl(e,l)},p(s,[i]){i&1&&ze(e,"width",s[0]),i&1&&ze(e,"height",s[0])},i:es,o:es,d(s){s&&l_(e)}}}function a_(n,e,t){let{size:l=16}=e;return n.$$set=s=>
4{"size"in s&&t(0,l=s.size)},[l]}class u_ extends n_{constructor(e){super(),i_(this,e,a_,__,r_,{size:0})}get size(){return this.$$.ctx[0]}set size(e){this.$$set({size:e}),s_()}}const{SvelteComponent:c_,append:ts,attr:De,detach:f_,flush:h_,init:d_,insert:m_,noop:ns,safe_not_equal:g_,svg_element:Xn}=window.__gradio__svelte__internal;function b_(n){let e,t,l;return{c(){e=Xn("svg"),t=Xn("path"),l=Xn("path"),De(t,"d","M4 8L8 12L12 8"),De(t,"stroke","currentColor"),De(t,"stroke-width","1.5"),De(t,"stroke-linecap","round"),De(t,"stroke-linejoin","round"),De(l,"d","M8 12V4"),De(l,"stroke","currentColor"),De(l,"stroke-width","1.5"),De(l,"stroke-linecap","round"),De(e,"width",n[0]),De(e,"height",n[0]),De(e,"viewBox","0 0 16 16"),De(e,"fill","none"),De(e,"xmlns","http://www.w3.org/2000/svg")},m(s,i){m_(s,e,i),ts(e,t),ts(e,l)},p(s,[i]){i&1&&De(e,"width",s[0]),i&1&&De(e,"height",s[0])},i:ns,o:ns,d(s){s&&f_(e)}}}function w_(n,e,t){let{size:l=16}=e;return n.$$set=s=>{"size"in s&&t(0,l=s.size)},[l]}class k_ extends c_{constructor(e){super(),d_(this,e,w_,b_,g_,{size:0})}get size(){return this.$$.ctx[0]}set size(e){this.$$set({size:e}),h_()}}const{SvelteComponent:p_,add_flush_callback:ls,append:_t,attr:Oe,bind:ss,binding_callbacks:is,check_outros:pn,create_component:Qt,destroy_component:Zt,detach:bl,element:jt,flush:ge,group_outros:vn,init:v_,insert:wl,listen:mn,mount_component:$t,run_all:y_,safe_not_equal:C_,set_data:S_,set_style:gn,space:yn,text:E_,toggle_class:wt,transition_in:Te,transition_out:Ve}=window.__gradio__svelte__internal;function os(n){let e,t,l,s,i,o;const _=[q_,M_],u=[];function c(a,f){return a[21]==="asc"?0:1}l=c(n),s=u[l]=_[l](n);let r=n[12].length>1&&rs(n);return{c(){e=jt("div"),t=jt("span"),s.c(),i=yn(),r&&r.c(),Oe(t,"class","sort-arrow svelte-sy2j2s"),Oe(e,"class","sort-indicators svelte-sy2j2s")},m(a,f){wl(a,e,f),_t(e,t),u[l].m(t,null),_t(e,i),r&&r.m(e,null),o=!0},p(a,f){let p=l;l=c(a),l!==p&&(vn(),Ve(u[p],1,1,()=>{u[p]=null}),pn(),s=u[l],s||(s=u[l]=_[l](a),s.c()),Te(s,1),s.m(t,null)),a[12].length>1?r?r.p(a,f):(r=rs(a),r.c(),r.m(e,null)):r&&(r.d(1),r=null)},i(a){o||(Te(s),o=!0)},o(a){Ve(s),o=!1},d(a){a&&bl(e),u[l].d(),r&&r.d()}}}function M_(n){let e,t;return e=new k_({props:{size:12}}),{c(){Qt(e.$$.fragment)},m(l,s){$t(e,l,s),t=!0},i(l){t||(Te(e.$$.fragment,l),t=!0)},o(l){Ve(e.$$.fragment,l),t=!1},d(l){Zt(e,l)}}}function q_(n){let e,t;return e=new u_({props:{size:12}}),{c(){Qt(e.$$.fragment)},m(l,s){$t(e,l,s),t=!0},i(l){t||(Te(e.$$.fragment,l),t=!0)},o(l){Ve(e.$$.fragment,l),t=!1},d(l){Zt(e,l)}}}function rs(n){let e,t;return{c(){e=jt("span"),t=E_(n[22]),Oe(e,"class","sort-priority svelte-sy2j2s")},m(l,s){wl(l,e,s),_t(e,t)},p(l,s){s[0]&4194304&&S_(t,l[22])},d(l){l&&bl(e)}}}function _s(n){let e,t;return e=new t_({}),{c(){Qt(e.$$.fragment)},m(l,s){$t(e,l,s),t=!0},i(l){t||(Te(e.$$.fragment,l),t=!0)},o(l){Ve(e.$$.fragment,l),t=!1},d(l){Zt(e,l)}}}function as(n){let e,t;return e=new gi({props:{on_click:n[30]}}),{c(){Qt(e.$$.fragment)},m(l,s){$t(e,l,s),t=!0},p(l,s){const i={};s[0]&1028&&(i.on_click=l[30]),e.$set(i)},i(l){t||(Te(e.$$.fragment,l),t=!0)},o(l){Ve(e.$$.fragment,l),t=!1},d(l){Zt(e,l)}}}function A_(n){let e,t,l,s,i,o,_,u,c,r,a,f,p,C;function m(S){n[26](S)}function y(S){n[27](S)}let w={max_chars:n[15],latex_delimiters:n[13],line_breaks:n[14],edit:n[4]===n[2],header:!0,root:n[16],editable:n[17],is_static:n[19],i18n:n[18]};n[0]!==void 0&&(w.value=n[0]),n[1]!==void 0&&(w.el=n[1]),i=new dl({props:w}),is.push(()=>ss(i,"value",m)),is.push(()=>ss(i,"el",y)),i.$on("keydown",n[28]);let h=n[20]!==-1&&os(n),k=n[19]&&_s(),v=n[23]&&as(n);return{c(){e=jt("th"),t=jt("div"),l=jt("div"),s=jt("button"),Qt(i.$$.fragment),u=yn(),h&&h.c(),c=yn(),k&&k.c(),r=yn(),v&&v.c(),Oe(s,"class","header-button svelte-sy2j2s"),Oe(s,"title",n[0]),Oe(l,"class","header-content svelte-sy2j2s"),Oe(t,"class","cell-wrap svelte-sy2j2s"),Oe(e,"aria-sort",a=n[6](n[0],n[7])==="none"?"none":n[6](n[0],n[7])==="asc"?"ascending":"descending"),gn(e,"width",n[8](n[2])),gn(e,"left",n[24](n[2])),Oe(e,"title",n[0]),Oe(e,"class","svelte-sy2j2s"),wt(e,"pinned-column",n[2]<n[3]),wt(e,"last-pinned",n[2]===n[3]-1),wt(e,"focus",n[4]===n[2]||n[5]===n[2]),wt(e,"sorted",n[20]!==-1)},m(S,j){wl(S,e,j),_t(e,t),_t(t,l),_t(l,s),$t(i,s,null),_t(s,u),h&&h.m(s,null),_t(l,c),k&&k.m(l,null),_t(t,r),v&&v.m(t,null),f=!0,p||(C=[mn(s,"click",n[29]),mn(s,"mousedown",L_),mn(e,"click",n[31]),mn(e,"mousedown",j_)],p=!0)},p(S,j){const q={};j[0]&32768&&(q.max_chars=S[15]),j[0]&8192&&(q.latex_delimiters=S[13]),j[0]&16384&&(q.line_breaks=S[14]),j[0]&20&&(q.edit=S[4]===S[2]),j[0]&65536&&(q.root=S[16]),j[0]&131072&&(q.editable=S[17]),j[0]&524288&&(q.is_static=S[19]),j[0]&262144&&(q.i18n=S[18]),!o&&j[0]&1&&(o=!0,q.value=S[0],ls(()=>o=!1)),!_&&j[0]&2&&(_=!0,q.el=S[1],ls(()=>_=!1)),i.$set(q),S[20]!==-1?h?(h.p(S,j),j[0]&1048576&&Te(h,1)):(h=os(S),h.c(),Te(h,1),h.m(s,null)):h&&(vn(),Ve(h,1,1,()=>{h=null}),pn()),(!f||j[0]&1)&&Oe(s,"title",S[0]),S[19]?k?j[0]&524288&&Te(k,1):(k=_s(),
4k.c(),Te(k,1),k.m(l,null)):k&&(vn(),Ve(k,1,1,()=>{k=null}),pn()),S[23]?v?(v.p(S,j),j[0]&8388608&&Te(v,1)):(v=as(S),v.c(),Te(v,1),v.m(t,null)):v&&(vn(),Ve(v,1,1,()=>{v=null}),pn()),(!f||j[0]&193&&a!==(a=S[6](S[0],S[7])==="none"?"none":S[6](S[0],S[7])==="asc"?"ascending":"descending"))&&Oe(e,"aria-sort",a),(!f||j[0]&260)&&gn(e,"width",S[8](S[2])),(!f||j[0]&4)&&gn(e,"left",S[24](S[2])),(!f||j[0]&1)&&Oe(e,"title",S[0]),(!f||j[0]&12)&&wt(e,"pinned-column",S[2]<S[3]),(!f||j[0]&12)&&wt(e,"last-pinned",S[2]===S[3]-1),(!f||j[0]&52)&&wt(e,"focus",S[4]===S[2]||S[5]===S[2]),(!f||j[0]&1048576)&&wt(e,"sorted",S[20]!==-1)},i(S){f||(Te(i.$$.fragment,S),Te(h),Te(k),Te(v),f=!0)},o(S){Ve(i.$$.fragment,S),Ve(h),Ve(k),Ve(v),f=!1},d(S){S&&bl(e),Zt(i),h&&h.d(),k&&k.d(),v&&v.d(),p=!1,y_(C)}}}const L_=n=>{n.preventDefault(),n.stopPropagation()},j_=n=>{n.preventDefault(),n.stopPropagation()};function B_(n,e,t){let l,s,i,o,{value:_}=e,{i:u}=e,{actual_pinned_columns:c}=e,{header_edit:r}=e,{selected_header:a}=e,{get_sort_status:f}=e,{headers:p}=e,{get_cell_width:C}=e,{handle_header_click:m}=e,{toggle_header_menu:y}=e,{end_header_edit:w}=e,{sort_columns:h=[]}=e,{latex_delimiters:k}=e,{line_breaks:v}=e,{max_chars:S}=e,{root:j}=e,{editable:q}=e,{i18n:D}=e,{el:T}=e,{is_static:I}=e,{col_count:O}=e;function K(A){return A>=c?"auto":A===0?"0":`calc(${Array(A).fill(0).map((G,J)=>C(J)).join(" + ")})`}function F(A){_=A,t(0,_)}function ie(A){T=A,t(1,T)}const oe=A=>{(A.detail.key==="Enter"||A.detail.key==="Escape"||A.detail.key==="Tab")&&w(A)},W=A=>m(A,u),ne=A=>y(A,u),z=A=>m(A,u);return n.$$set=A=>{"value"in A&&t(0,_=A.value),"i"in A&&t(2,u=A.i),"actual_pinned_columns"in A&&t(3,c=A.actual_pinned_columns),"header_edit"in A&&t(4,r=A.header_edit),"selected_header"in A&&t(5,a=A.selected_header),"get_sort_status"in A&&t(6,f=A.get_sort_status),"headers"in A&&t(7,p=A.headers),"get_cell_width"in A&&t(8,C=A.get_cell_width),"handle_header_click"in A&&t(9,m=A.handle_header_click),"toggle_header_menu"in A&&t(10,y=A.toggle_header_menu),"end_header_edit"in A&&t(11,w=A.end_header_edit),"sort_columns"in A&&t(12,h=A.sort_columns),"latex_delimiters"in A&&t(13,k=A.latex_delimiters),"line_breaks"in A&&t(14,v=A.line_breaks),"max_chars"in A&&t(15,S=A.max_chars),"root"in A&&t(16,j=A.root),"editable"in A&&t(17,q=A.editable),"i18n"in A&&t(18,D=A.i18n),"el"in A&&t(1,T=A.el),"is_static"in A&&t(19,I=A.is_static),"col_count"in A&&t(25,O=A.col_count)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&t(23,l=O&&O[1]==="dynamic"),n.$$.dirty[0]&4100&&t(20,s=h.findIndex(A=>A.col===u)),n.$$.dirty[0]&1048576&&t(22,i=s!==-1?s+1:null),n.$$.dirty[0]&1052672&&t(21,o=s!==-1?h[s].direction:null)},[_,T,u,c,r,a,f,p,C,m,y,w,h,k,v,S,j,q,D,I,s,o,i,l,K,O,F,ie,oe,W,ne,z]}class bi extends p_{constructor(e){super(),v_(this,e,B_,A_,C_,{value:0,i:2,actual_pinned_columns:3,header_edit:4,selected_header:5,get_sort_status:6,headers:7,get_cell_width:8,handle_header_click:9,toggle_header_menu:10,end_header_edit:11,sort_columns:12,latex_delimiters:13,line_breaks:14,max_chars:15,root:16,editable:17,i18n:18,el:1,is_static:19,col_count:25},null,[-1,-1])}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),ge()}get i(){return this.$$.ctx[2]}set i(e){this.$$set({i:e}),ge()}get actual_pinned_columns(){return this.$$.ctx[3]}set actual_pinned_columns(e){this.$$set({actual_pinned_columns:e}),ge()}get header_edit(){return this.$$.ctx[4]}set header_edit(e){this.$$set({header_edit:e}),ge()}get selected_header(){return this.$$.ctx[5]}set selected_header(e){this.$$set({selected_header:e}),ge()}get get_sort_status(){return this.$$.ctx[6]}set get_sort_status(e){this.$$set({get_sort_status:e}),ge()}get headers(){return this.$$.ctx[7]}set headers(e){this.$$set({headers:e}),ge()}get get_cell_width(){return this.$$.ctx[8]}set get_cell_width(e){this.$$set({get_cell_width:e}),ge()}get handle_header_click(){return this.$$.ctx[9]}set handle_header_click(e){this.$$set({handle_header_click:e}),ge()}get toggle_header_menu(){return this.$$.ctx[10]}set toggle_header_menu(e){this.$$set({toggle_header_menu:e}),ge()}get end_header_edit(){return this.$$.ctx[11]}set end_header_edit(e){this.$$set({end_header_edit:e}),ge()}get sort_columns(){return this.$$.ctx[12]}set sort_columns(e){this.$$set({sort_columns:e}),ge()}get latex_delimiters(){return this.$$.ctx[13]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),ge()}get line_breaks(){return this.$$.ctx[14]}set line_breaks(e){this.$$set({line_breaks:e}),ge()}get max_chars(){return this.$$.ctx[15]}set max_chars(e){this.$$set({max_chars:e}),ge()}get root(){return this.$$.ctx[16]}set root(e){this.$$set({root:e}),ge()}get editable(){return this.$$.ctx[17]}set editable(e){this.$$set({editable:e}),ge()}get i18n(){return this.$$.ctx[18]}set i18n(e){this.$$set({i18n:e}),ge()}get el(){return this.$$.ctx[1]}set el(e){this.$$set({el:e}),ge()}get is_static(){return this.$$.ctx[19]}set is_static(e){this.$$set({is_static:e}),ge()}get col_count(){return this.$$.ctx[25]}set col_count(e){this.$$set({col_count:e}),ge()}}const{SvelteComponent:z_,add_flush_callback:us,append:cs,attr:Xe,bind:fs,binding_callbacks:el,check_outros:D_,create_component:wi,destroy_component:ki,detach:T_,element:hs,flush:ee,group_outros:H_,init:R_,insert:N_,listen:ds,mount_component:pi,prevent_default:P_,run_all:K_,safe_not_equal:I_,space:O_,toggle_class:ke,transition_in:Vt,transition_out:Cn}=window.__gradio__svelte__internal;function ms(n){let e,t;return e=new gi({props:{on_click:n[40]}}),{c(){wi(e.$$.fragment)},m(l,s){pi(e,l,s),t=!0},p(l,s){const i={};s[0]&560&&(i.on_click=l[40]),e.$set(i)},i(l){t||(Vt(e.$$.fragment,l),t=!0)},o(l){Cn(e.$$.fragment,l),t=!1},d(l){ki(e,l)}}}function F_(n){let e,t,l,s,i,o,_=n[20]&&n[10]([n[4],n[5]],n[0],n[20]),u,c,r,a,f,p;function C(h){n[36](h)}function m(h){n[37](h)}let y={display_value:String(n[1]),latex_delimiters:n[14],line_breaks:n[15],editable:n[20],is_static:n[21],edit:n[17]&&n[17][0]===n[4]&&n[17][1]===n[5],datatype:n[16],clear_on_focus:n[2],root:n[19],max_chars:n[18],i18n:n[22],components:n[23],show_selection_buttons:n[0].length===1&&n[0][0][0]===n[4]&&n[0][0][1]===n[5],coords:[n[4],n[5]],on_select_column:n[24],on_select_row:n[25],is_dragging:n[26],wrap_text:n[27]};n[1]!==void 0&&(y.value=n[1]),n[3].input!==void 0&&(y.el=n[3].input),l=new dl({props:y}),el.push(()=>fs(l,"value",C)),el.push(()=>fs(l,"el",m)),l.$on("blur",n[38]),l.$on("focus",n[39]);let w=_&&ms(n);return{c(){e=hs("td"),t=hs("div"),wi(l.$$.fragment),o=O_(),w&&w.c(),Xe(t,"class","cell-wrap svelte-v1pjjd"),Xe(e,"tabindex",u=n[5]<n[6]?-1:0),Xe(e,"data-row",n[4]),Xe(e,"data-col",n[5]),Xe(e,"data-testid",c=`cell-${n[4]}-${n[5]}`),Xe(e,"style",r="width: "+n[7](n[5])+"; left: "+n[33](n[5])+"; "+(n[13]||"")),Xe(e,"class","svelte-v1pjjd"),ke(e,"pinned-column",n[5]<n[6]),ke(e,"last-pinned",n[5]===n[6]-1),ke(e,"flash",n[11]&&n[32]),ke(e,"cell-selected",n[32]),ke(e,"no-top",n[31]),ke(e,"no-bottom",n[30]),ke(e,"no-left",n[29]),ke(e,"no-right",n[28]),ke(e,"menu-active",n[12]&&n[12].row===n[4]&&n[12].
4col===n[5]),ke(e,"dragging",n[26])},m(h,k){N_(h,e,k),cs(e,t),pi(l,t,null),cs(t,o),w&&w.m(t,null),n[41](e),a=!0,f||(p=[ds(e,"mousedown",n[42]),ds(e,"contextmenu",P_(n[43]))],f=!0)},p(h,k){const v={};k[0]&2&&(v.display_value=String(h[1])),k[0]&16384&&(v.latex_delimiters=h[14]),k[0]&32768&&(v.line_breaks=h[15]),k[0]&1048576&&(v.editable=h[20]),k[0]&2097152&&(v.is_static=h[21]),k[0]&131120&&(v.edit=h[17]&&h[17][0]===h[4]&&h[17][1]===h[5]),k[0]&65536&&(v.datatype=h[16]),k[0]&4&&(v.clear_on_focus=h[2]),k[0]&524288&&(v.root=h[19]),k[0]&262144&&(v.max_chars=h[18]),k[0]&4194304&&(v.i18n=h[22]),k[0]&8388608&&(v.components=h[23]),k[0]&49&&(v.show_selection_buttons=h[0].length===1&&h[0][0][0]===h[4]&&h[0][0][1]===h[5]),k[0]&48&&(v.coords=[h[4],h[5]]),k[0]&16777216&&(v.on_select_column=h[24]),k[0]&33554432&&(v.on_select_row=h[25]),k[0]&67108864&&(v.is_dragging=h[26]),k[0]&134217728&&(v.wrap_text=h[27]),!s&&k[0]&2&&(s=!0,v.value=h[1],us(()=>s=!1)),!i&&k[0]&8&&(i=!0,v.el=h[3].input,us(()=>i=!1)),l.$set(v),k[0]&1049649&&(_=h[20]&&h[10]([h[4],h[5]],h[0],h[20])),_?w?(w.p(h,k),k[0]&1049649&&Vt(w,1)):(w=ms(h),w.c(),Vt(w,1),w.m(t,null)):w&&(H_(),Cn(w,1,1,()=>{w=null}),D_()),(!a||k[0]&96&&u!==(u=h[5]<h[6]?-1:0))&&Xe(e,"tabindex",u),(!a||k[0]&16)&&Xe(e,"data-row",h[4]),(!a||k[0]&32)&&Xe(e,"data-col",h[5]),(!a||k[0]&48&&c!==(c=`cell-${h[4]}-${h[5]}`))&&Xe(e,"data-testid",c),(!a||k[0]&8352&&r!==(r="width: "+h[7](h[5])+"; left: "+h[33](h[5])+"; "+(h[13]||"")))&&Xe(e,"style",r),(!a||k[0]&96)&&ke(e,"pinned-column",h[5]<h[6]),(!a||k[0]&96)&&ke(e,"last-pinned",h[5]===h[6]-1),(!a||k[0]&2048|k[1]&2)&&ke(e,"flash",h[11]&&h[32]),(!a||k[1]&2)&&ke(e,"cell-selected",h[32]),(!a||k[1]&1)&&ke(e,"no-top",h[31]),(!a||k[0]&1073741824)&&ke(e,"no-bottom",h[30]),(!a||k[0]&536870912)&&ke(e,"no-left",h[29]),(!a||k[0]&268435456)&&ke(e,"no-right",h[28]),(!a||k[0]&4144)&&ke(e,"menu-active",h[12]&&h[12].row===h[4]&&h[12].col===h[5]),(!a||k[0]&67108864)&&ke(e,"dragging",h[26])},i(h){a||(Vt(l.$$.fragment,h),Vt(w),a=!0)},o(h){Cn(l.$$.fragment,h),Cn(w),a=!1},d(h){h&&T_(e),ki(l),w&&w.d(),n[41](null),f=!1,K_(p)}}}function V_(n,e,t){let l,s,i,o,_,u,{value:c}=e,{index:r}=e,{j:a}=e,{actual_pinned_columns:f}=e,{get_cell_width:p}=e,{handle_cell_click:C}=e,{toggle_cell_menu:m}=e,{is_cell_selected:y}=e,{should_show_cell_menu:w}=e,{selected_cells:h}=e,{copy_flash:k}=e,{active_cell_menu:v}=e,{styling:S}=e,{latex_delimiters:j}=e,{line_breaks:q}=e,{datatype:D}=e,{editing:T}=e,{clear_on_focus:I}=e,{max_chars:O}=e,{root:K}=e,{editable:F}=e,{is_static:ie=!1}=e,{i18n:oe}=e,{components:W={}}=e,{el:ne}=e,{handle_select_column:z}=e,{handle_select_row:A}=e,{is_dragging:ce}=e,{wrap:G=!1}=e;function J(E){return E>=f?"auto":E===0?"0":`calc(${Array(E).fill(0).map((x,Y)=>p(Y)).join(" + ")})`}function Z(E){c=E,t(1,c)}function H(E){n.$$.not_equal(ne.input,E)&&(ne.input=E,t(3,ne))}const L=()=>{t(2,I=!1)},g=()=>{const E=r,V=a;h.some(([x,Y])=>x===E&&Y===V)||t(0,h=[[E,V]])},M=E=>m(E,r,a);function ye(E){el[E?"unshift":"push"](()=>{ne.cell=E,t(3,ne)})}const Ne=E=>C(E,r,a),R=E=>m(E,r,a);return n.$$set=E=>{"value"in E&&t(1,c=E.value),"index"in E&&t(4,r=E.index),"j"in E&&t(5,a=E.j),"actual_pinned_columns"in E&&t(6,f=E.actual_pinned_columns),"get_cell_width"in E&&t(7,p=E.get_cell_width),"handle_cell_click"in E&&t(8,C=E.handle_cell_click),"toggle_cell_menu"in E&&t(9,m=E.toggle_cell_menu),"is_cell_selected"in E&&t(34,y=E.is_cell_selected),"should_show_cell_menu"in E&&t(10,w=E.should_show_cell_menu),"selected_cells"in E&&t(0,h=E.selected_cells),"copy_flash"in E&&t(11,k=E.copy_flash),"active_cell_menu"in E&&t(12,v=E.active_cell_menu),"styling"in E&&t(13,S=E.styling),"latex_delimiters"in E&&t(14,j=E.latex_delimiters),"line_breaks"in E&&t(15,q=E.line_breaks),"datatype"in E&&t(16,D=E.datatype),"editing"in E&&t(17,T=E.editing),"clear_on_focus"in E&&t(2,I=E.clear_on_focus),"max_chars"in E&&t(18,O=E.max_chars),"root"in E&&t(19,K=E.root),"editable"in E&&t(20,F=E.editable),"is_static"in E&&t(21,ie=E.is_static),"i18n"in E&&t(22,oe=E.i18n),"components"in E&&t(23,W=E.components),"el"in E&&t(3,ne=E.el),"handle_select_column"in E&&t(24,z=E.handle_select_column),"handle_select_row"in E&&t(25,A=E.handle_select_row),"is_dragging"in E&&t(26,ce=E.is_dragging),"wrap"in E&&t(27,G=E.wrap)},n.$$.update=()=>{n.$$.dirty[0]&49|n.$$.dirty[1]&8&&t(35,l=y([r,a],h||[])),n.$$.dirty[0]&49&&t(32,s=Lo([r,a],h)),n.$$.dirty[1]&16&&t(31,i=l.includes("no-top")),n.$$.dirty[1]&16&&t(30,o=l.includes("no-bottom")),n.$$.dirty[1]&16&&t(29,_=l.includes("no-left")),n.$$.dirty[1]&16&&t(28,u=l.includes("no-right"))},[h,c,I,ne,r,a,f,p,C,m,w,k,v,S,j,q,D,T,O,K,F,ie,oe,W,z,A,ce,G,u,_,o,i,s,J,y,l,Z,H,L,g,M,ye,Ne,R]}class U_ extends z_{constructor(e){super(),R_(this,e,V_,F_,I_,{value:1,index:4,j:5,actual_pinned_columns:6,get_cell_width:7,handle_cell_click:8,toggle_cell_menu:9,is_cell_selected:34,should_show_cell_menu:10,selected_cells:0,copy_flash:11,active_cell_menu:12,styling:13,latex_delimiters:14,line_breaks:15,datatype:16,editing:17,clear_on_focus:2,max_chars:18,root:19,editable:20,is_static:21,i18n:22,components:23,el:3,handle_select_column:24,handle_select_row:25,is_dragging:26,wrap:27},null,[-1,-1])}get value(){return this.$$.ctx[1]}set value(e){this.$$set({value:e}),ee()}get index(){return this.$$.ctx[4]}set index(e){this.$$set({index:e}),ee()}get j(){return this.$$.ctx[5]}set j(e){this.$$set({j:e}),ee()}get actual_pinned_columns(){return this.$$.ctx[6]}set actual_pinned_columns(e){this.$$set({actual_pinned_columns:e}),ee()}get get_cell_width(){return this.$$.ctx[7]}set get_cell_width(e){this.$$set({get_cell_width:e}),ee()}get handle_cell_click(){return this.$$.ctx[8]}set handle_cell_click(e){this.$$set({handle_cell_click:e}),ee()}get toggle_cell_menu(){return this.$$.ctx[9]}set toggle_cell_menu(e){this.$$set({toggle_cell_menu:e}),ee()}get is_cell_selected(){return this.$$.ctx[34]}set is_cell_selected(e){this.$$set({is_cell_selected:e}),ee()}get should_show_cell_menu(){return this.$$.ctx[10]}set should_show_cell_menu(e){this.$$set({should_show_cell_menu:e}),ee()}get selected_cells(){return this.$$.ctx[0]}set selected_cells(e){this.$$set({selected_cells:e}),ee()}get copy_flash(){return this.$$.ctx[11]}set copy_flash(e){this.$$set({copy_flash:e}),ee()}get active_cell_menu(){return this.$$.ctx[12]}set active_cell_menu(e){this.$$set({active_cell_menu:e}),ee()}get styling(){return this.$$.ctx[13]}set styling(e){this.$$set({styling:e}),ee()}get latex_delimiters(){return this.$$.ctx[14]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),ee()}get line_breaks(){return this.$$.ctx[15]}set line_breaks(e){this.$$set({line_breaks:e}),ee()}get datatype(){return this.$$.ctx[16]}set datatype(e){this.$$set({datatype:e}),ee()}
4get editing(){return this.$$.ctx[17]}set editing(e){this.$$set({editing:e}),ee()}get clear_on_focus(){return this.$$.ctx[2]}set clear_on_focus(e){this.$$set({clear_on_focus:e}),ee()}get max_chars(){return this.$$.ctx[18]}set max_chars(e){this.$$set({max_chars:e}),ee()}get root(){return this.$$.ctx[19]}set root(e){this.$$set({root:e}),ee()}get editable(){return this.$$.ctx[20]}set editable(e){this.$$set({editable:e}),ee()}get is_static(){return this.$$.ctx[21]}set is_static(e){this.$$set({is_static:e}),ee()}get i18n(){return this.$$.ctx[22]}set i18n(e){this.$$set({i18n:e}),ee()}get components(){return this.$$.ctx[23]}set components(e){this.$$set({components:e}),ee()}get el(){return this.$$.ctx[3]}set el(e){this.$$set({el:e}),ee()}get handle_select_column(){return this.$$.ctx[24]}set handle_select_column(e){this.$$set({handle_select_column:e}),ee()}get handle_select_row(){return this.$$.ctx[25]}set handle_select_row(e){this.$$set({handle_select_row:e}),ee()}get is_dragging(){return this.$$.ctx[26]}set is_dragging(e){this.$$set({is_dragging:e}),ee()}get wrap(){return this.$$.ctx[27]}set wrap(e){this.$$set({wrap:e}),ee()}}const{SvelteComponent:W_,attr:gs,detach:Y_,element:J_,flush:X_,init:G_,insert:Q_,is_function:Z_,listen:$_,noop:bs,safe_not_equal:x_}=window.__gradio__svelte__internal;function ea(n){let e,t,l;return{c(){e=J_("button"),e.textContent="+",gs(e,"class","add-row-button svelte-jkwuz7"),gs(e,"aria-label","Add row")},m(s,i){Q_(s,e,i),t||(l=$_(e,"click",function(){Z_(n[0])&&n[0].apply(this,arguments)}),t=!0)},p(s,[i]){n=s},i:bs,o:bs,d(s){s&&Y_(e),t=!1,l()}}}function ta(n,e,t){let{on_click:l}=e;return n.$$set=s=>{"on_click"in s&&t(0,l=s.on_click)},[l]}class na extends W_{constructor(e){super(),G_(this,e,ta,ea,x_,{on_click:0})}get on_click(){return this.$$.ctx[0]}set on_click(e){this.$$set({on_click:e}),X_()}}const{ResizeObserverSingleton:la,SvelteComponent:sa,add_iframe_resize_listener:ws,add_render_callback:ks,append:Et,attr:bn,binding_callbacks:ps,check_outros:vi,create_slot:tl,detach:Ln,element:Dt,empty:yi,ensure_array_like:vs,flush:lt,get_all_dirty_from_scope:nl,get_slot_changes:ll,group_outros:Ci,init:ia,insert:jn,listen:oa,outro_and_destroy_block:ra,resize_observer_content_box:_a,safe_not_equal:aa,set_style:Ie,space:ys,text:ua,toggle_class:Cs,transition_in:Lt,transition_out:Ht,update_keyed_each:ca,update_slot_base:sl}=window.__gradio__svelte__internal,{onMount:fa,tick:Ft,createEventDispatcher:ha}=window.__gradio__svelte__internal,da=n=>({}),Ss=n=>({});function Es(n,e,t){const l=n.slice();return l[39]=e[t],l}const ma=n=>({item:n[0]&1024,index:n[0]&1024}),Ms=n=>({item:n[39].data,index:n[39].index}),ga=n=>({}),qs=n=>({});function As(n){let e=[],t=new Map,l,s,i=vs(n[10]);const o=_=>_[39].data[0].id;for(let _=0;_<i.length;_+=1){let u=Es(n,i,_),c=o(u);t.set(c,e[_]=Ls(c,u))}return{c(){for(let _=0;_<e.length;_+=1)e[_].c();l=yi()},m(_,u){for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(_,u);jn(_,l,u),s=!0},p(_,u){u[0]&4195328&&(i=vs(_[10]),Ci(),e=ca(e,u,o,1,_,i,t,l.parentNode,ra,Ls,l,Es),vi())},i(_){if(!s){for(let u=0;u<i.length;u+=1)Lt(e[u]);s=!0}},o(_){for(let u=0;u<e.length;u+=1)Ht(e[u]);s=!1},d(_){_&&Ln(l);for(let u=0;u<e.length;u+=1)e[u].d(_)}}}function ba(n){let e;return{c(){e=ua(`Missing Table Row 5 `)},m(t,l){jn(t,e,l)},d(t){t&&Ln(e)}}}function Ls(n,e){let t,l;const s=e[23].tbody,i=tl(s,e,e[22],Ms),o=i||ba();return{key:n,first:null,c(){t=yi(),o&&o.c(),this.first=t},m(_,u){jn(_,t,u),o&&o.m(_,u),l=!0},p(_,u){e=_,i&&i.p&&(!l||u[0]&4195328)&&sl(i,s,e,e[22],l?ll(s,e[22],u,ma):nl(e[22]),Ms)},i(_){l||(Lt(o,_),l=!0)},o(_){Ht(o,_),l=!1},d(_){_&&Ln(t),o&&o.d(_)}}}function wa(n){let e,t,l,s,i,o,_,u,c,r,a,f,p,C;const m=n[23].thead,y=tl(m,n,n[22],qs);let w=n[10].length&&n[10][0].data.length&&As(n);const h=n[23].tfoot,k=tl(h,n,n[22],Ss);return{c(){e=Dt("svelte-virtual-table-viewport"),t=Dt("div"),l=Dt("table"),s=Dt("thead"),y&&y.c(),o=ys(),_=Dt("tbody"),w&&w.c(),u=ys(),c=Dt("tfoot"),k&&k.c(),bn(s,"class","thead svelte-1e98i6s"),ks(()=>n[24].call(s)),bn(_,"class","tbody svelte-1e98i6s"),bn(c,"class","tfoot svelte-1e98i6s"),ks(()=>n[26].call(c)),bn(l,"class","table svelte-1e98i6s"),Ie(l,"height",ka),Ie(l,"--bw-svt-p-top",n[9]+"px"),Ie(l,"--bw-svt-p-bottom",n[5]+"px"),Ie(l,"--bw-svt-head-height",n[7]+"px"),Ie(l,"--bw-svt-foot-height",n[8]+"px"),Ie(l,"--bw-svt-avg-row-height",n[3]+"px"),Ie(l,"--max-height",n[1]+"px"),Cs(l,"disable-scroll",n[2])},m(v,S){jn(v,e,S),Et(e,t),Et(t,l),Et(l,s),y&&y.m(s,null),i=ws(s,n[24].bind(s)),Et(l,o),Et(l,_),w&&w.m(_,null),n[25](_),Et(l,u),Et(l,c),k&&k.m(c,null),r=ws(c,n[26].bind(c)),n[27](l),a=_a.observe(l,n[28].bind(l)),f=!0,p||(C=oa(l,"scroll",n[11]),p=!0)},p(v,S){y&&y.p&&(!f||S[0]&4194304)&&sl(y,m,v,v[22],f?ll(m,v[22],S,ga):nl(v[22]),qs),v[10].length&&v[10][0].data.length?w?(w.p(v,S),S[0]&1024&&Lt(w,1)):(w=As(v),w.c(),Lt(w,1),w.m(_,null)):w&&(Ci(),Ht(w,1,1,()=>{w=null}),vi()),k&&k.p&&(!f||S[0]&4194304)&&sl(k,h,v,v[22],f?ll(h,v[22],S,da):nl(v[22]),Ss),(!f||S[0]&512)&&Ie(l,"--bw-svt-p-top",v[9]+"px"),(!f||S[0]&32)&&Ie(l,"--bw-svt-p-bottom",v[5]+"px"),(!f||S[0]&128)&&Ie(l,"--bw-svt-head-height",v[7]+"px"),(!f||S[0]&256)&&Ie(l,"--bw-svt-foot-height",v[8]+"px"),(!f||S[0]&8)&&Ie(l,"--bw-svt-avg-row-height",v[3]+"px"),(!f||S[0]&2)&&Ie(l,"--max-height",v[1]+"px"),(!f||S[0]&4)&&Cs(l,"disable-scroll",v[2])},i(v){f||(Lt(y,v),Lt(w),Lt(k,v),f=!0)},o(v){Ht(y,v),Ht(w),Ht(k,v),f=!1},d(v){v&&Ln(e),y&&y.d(v),i(),w&&w.d(),n[25](null),k&&k.d(v),r(),n[27](null),a(),p=!1,C()}}}let ka="100%";function pa(n,e){if(!n)return 0;const t=getComputedStyle(n);return parseInt(t.getPropertyValue(e))}function va(n,e,t){let l,{$$slots:s={},$$scope:i}=e,{items:o=[]}=e,{max_height:_}=e,{actual_height:u}=e,{table_scrollbar_width:c}=e,{start:r=0}=e,{end:a=20}=e,{selected:f}=e,{disable_scroll:p=!1}=e,{show_scroll_button:C=!1}=e,{viewport:m}=e;const y=ha();let w=30,h=0,k,v=0,S=0,j=[],q,D,T=0,I=200,O=[],K;const F=typeof window<"u",ie=F?window.requestAnimationFrame:g=>g();let oe=0;async function W(g){if(I===0)return;t(7,v=m.querySelector(".thead")?.getBoundingClientRect().height||0),await Ft();const{scrollTop:M}=m;t(15,c=m.offsetWidth-m.clientWidth),oe=T-(M-v);let ye=r;for(;oe<_&&ye<g.length;){let V=D[ye-r];V||(t(13,a=ye+1),await Ft(),V=D[ye-r]);let x=V?.getBoundingClientRect().height;x||(x=w);const Y=j[ye]=x;oe+=Y,ye+=1}t(13,a=ye);const Ne=g.length-a,R=m.offsetHeight-m.clientHeight;R>0&&(oe+=R);let E=j.filter(V=>typeof V=="number");t(3,w=E.reduce((V,x)=>V+x,0)/E.length),t(5,h=Ne*w),j.length=g.length,await Ft(),_?oe<_?t(14,u=oe+2):t(14,u=_):t(14,u=oe+1),await Ft()}async function ne(g){ie(async()=>
5{if(typeof g!="number")return;const M=typeof g!="number"?!1:z(g);M!==!0&&(M==="back"&&await ce(g,{behavior:"instant"}),M==="forwards"&&await ce(g,{behavior:"instant"},!0))})}function z(g){const M=D&&D[g-r];if(!M&&g<r)return"back";if(!M&&g>=a-1)return"forwards";const{top:ye}=m.getBoundingClientRect(),{top:Ne,bottom:R}=M.getBoundingClientRect();return Ne-ye<37?"back":R-ye>I?"forwards":!0}async function A(g){const M=m.scrollTop;t(16,C=M>100),C&&y("scroll_top",M),D=k.children;const ye=l.length<r,Ne=pa(D[1],"border-top-width"),R=0;ye&&await ce(l.length-1,{behavior:"auto"});let E=0;for(let Pe=0;Pe<D.length;Pe+=1)j[r+Pe]=D[Pe].getBoundingClientRect().height;let V=0,x=v+Ne/2,Y=[];for(;V<l.length;){const Pe=j[V]||w;if(Y[V]=Pe,x+Pe+R>M){E=V,t(9,T=x-(v+Ne/2));break}x+=Pe,V+=1}for(E=Math.max(0,E);V<l.length;){const Pe=j[V]||w;if(x+=Pe,V+=1,x>M+I)break}t(12,r=E),t(13,a=V);const yt=l.length-a;a===0&&t(13,a=10),t(3,w=(x-v)/a);let Ct=yt*w;for(;V<l.length;)V+=1,j[V]=w;t(5,h=Ct),isFinite(h)||t(5,h=2e5)}async function ce(g,M,ye=!1){await Ft();const Ne=w;let R=g*Ne;ye&&(R=R-I+Ne+v);const E=m.offsetHeight-m.clientHeight;E>0&&(R+=E);const V={top:R,behavior:"smooth",...M};m.scrollTo(V)}fa(()=>{D=k.children,t(20,q=!0),W(o)});function G(){v=this.offsetHeight,t(7,v)}function J(g){ps[g?"unshift":"push"](()=>{k=g,t(6,k)})}function Z(){S=this.offsetHeight,t(8,S)}function H(g){ps[g?"unshift":"push"](()=>{m=g,t(0,m)})}function L(){K=la.entries.get(this)?.contentRect,t(4,K)}return n.$$set=g=>{"items"in g&&t(17,o=g.items),"max_height"in g&&t(1,_=g.max_height),"actual_height"in g&&t(14,u=g.actual_height),"table_scrollbar_width"in g&&t(15,c=g.table_scrollbar_width),"start"in g&&t(12,r=g.start),"end"in g&&t(13,a=g.end),"selected"in g&&t(18,f=g.selected),"disable_scroll"in g&&t(2,p=g.disable_scroll),"show_scroll_button"in g&&t(16,C=g.show_scroll_button),"viewport"in g&&t(0,m=g.viewport),"$$scope"in g&&t(22,i=g.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&16&&(I=K?.height||200),n.$$.dirty[0]&131072&&t(21,l=o),n.$$.dirty[0]&3145728&&q&&ie(()=>W(l)),n.$$.dirty[0]&262144&&ne(f),n.$$.dirty[0]&2109450&&t(10,O=F?l.slice(r,a).map((g,M)=>({index:M+r,data:g})):l.slice(0,_/l.length*w+1).map((g,M)=>({index:M+r,data:g})))},[m,_,p,w,K,h,k,v,S,T,O,A,r,a,u,c,C,o,f,ce,q,l,i,s,G,J,Z,H,L]}class ya extends sa{constructor(e){super(),ia(this,e,va,wa,aa,{items:17,max_height:1,actual_height:14,table_scrollbar_width:15,start:12,end:13,selected:18,disable_scroll:2,show_scroll_button:16,viewport:0,scroll_to_index:19},null,[-1,-1])}get items(){return this.$$.ctx[17]}set items(e){this.$$set({items:e}),lt()}get max_height(){return this.$$.ctx[1]}set max_height(e){this.$$set({max_height:e}),lt()}get actual_height(){return this.$$.ctx[14]}set actual_height(e){this.$$set({actual_height:e}),lt()}get table_scrollbar_width(){return this.$$.ctx[15]}set table_scrollbar_width(e){this.$$set({table_scrollbar_width:e}),lt()}get start(){return this.$$.ctx[12]}set start(e){this.$$set({start:e}),lt()}get end(){return this.$$.ctx[13]}set end(e){this.$$set({end:e}),lt()}get selected(){return this.$$.ctx[18]}set selected(e){this.$$set({selected:e}),lt()}get disable_scroll(){return this.$$.ctx[2]}set disable_scroll(e){this.$$set({disable_scroll:e}),lt()}get show_scroll_button(){return this.$$.ctx[16]}set show_scroll_button(e){this.$$set({show_scroll_button:e}),lt()}get viewport(){return this.$$.ctx[0]}set viewport(e){this.$$set({viewport:e}),lt()}get scroll_to_index(){return this.$$.ctx[19]}}const{SvelteComponent:Ca,append:he,attr:b,detach:it,empty:Sa,flush:Ea,init:Ma,insert:ot,noop:js,safe_not_equal:qa,svg_element:X}=window.__gradio__svelte__internal;function Aa(n){let e,t,l,s,i,o;return{c(){e=X("svg"),t=X("path"),l=X("path"),s=X("path"),i=X("path"),o=X("path"),b(t,"d","M5 5H19"),b(t,"stroke","currentColor"),b(t,"stroke-width","2"),b(t,"stroke-linecap","round"),b(l,"d","M5 9H15"),b(l,"stroke","currentColor"),b(l,"stroke-width","2"),b(l,"stroke-linecap","round"),b(s,"d","M5 13H11"),b(s,"stroke","currentColor"),b(s,"stroke-width","2"),b(s,"stroke-linecap","round"),b(i,"d","M5 17H7"),b(i,"stroke","currentColor"),b(i,"stroke-width","2"),b(i,"stroke-linecap","round"),b(o,"d","M17 17L21 21M21 17L17 21"),b(o,"stroke","currentColor"),b(o,"stroke-width","2"),b(o,"stroke-linecap","round"),b(e,"viewBox","0 0 24 24"),b(e,"width","16"),b(e,"height","16")},m(_,u){ot(_,e,u),he(e,t),he(e,l),he(e,s),he(e,i),he(e,o)},d(_){_&&it(e)}}}function La(n){let e,t,l,s;return{c(){e=X("svg"),t=X("path"),l=X("path"),s=X("path"),b(t,"d","M8 12L12 16L16 12"),b(t,"stroke","currentColor"),b(t,"stroke-width","2"),b(t,"fill","none"),b(t,"stroke-linecap","round"),b(t,"stroke-linejoin","round"),b(l,"d","M12 16V9"),b(l,"stroke","currentColor"),b(l,"stroke-width","2"),b(l,"stroke-linecap","round"),b(s,"d","M5 5H19"),b(s,"stroke","currentColor"),b(s,"stroke-width","2"),b(s,"stroke-linecap","round"),b(e,"viewBox","0 0 24 24"),b(e,"width","16"),b(e,"height","16")},m(i,o){ot(i,e,o),he(e,t),he(e,l),he(e,s)},d(i){i&&it(e)}}}function ja(n){let e,t,l,s;return{c(){e=X("svg"),t=X("path"),l=X("path"),s=X("path"),b(t,"d","M8 16L12 12L16 16"),b(t,"stroke","currentColor"),b(t,"stroke-width","2"),b(t,"fill","none"),b(t,"stroke-linecap","round"),b(t,"stroke-linejoin","round"),b(l,"d","M12 12V19"),b(l,"stroke","currentColor"),b(l,"stroke-width","2"),b(l,"stroke-linecap","round"),b(s,"d","M5 7H19"),b(s,"stroke","currentColor"),b(s,"stroke-width","2"),b(s,"stroke-linecap","round"),b(e,"viewBox","0 0 24 24"),b(e,"width","16"),b(e,"height","16")},m(i,o){ot(i,e,o),he(e,t),he(e,l),he(e,s)},d(i){i&&it(e)}}}function Ba(n){let e,t,l;return{c(){e=X("svg"),t=X("rect"),l=X("path"),b(t,"x","10"),b(t,"y","5"),b(t,"width","4"),b(t,"height","14"),b(t,"stroke","currentColor"),b(t,"stroke-width","2"),b(l,"d","M7 8L17 16M17 8L7 16"),b(l,"stroke","currentColor"),b(l,"stroke-width","2"),b(l,"stroke-linecap","round"),b(e,"viewBox","0 0 24 24"),b(e,"width","16"),b(e,"height","16")},m(s,i){ot(s,e,i),he(e,t),he(e,l)},d(s){s&&it(e)}}}function za(n){let e,t,l;return{c(){e=X("svg"),t=X("rect"),l=X("path"),b(t,"x","5"),b(t,"y","10"),b(t,"width","14"),b(t,"height","4"),b(t,"stroke","currentColor"),b(t,"stroke-width","2"),b(l,"d","M8 7L16 17M16 7L8 17"),b(l,"stroke","currentColor"),b(l,"stroke-width","2"),b(l,"stroke-linecap","round"),b(e,"viewBox","0 0 24 24"),b(e,"width","16"),b(e,"height","16")},m(s,i){ot(s,e,i),he(e,t),he(e,l)},d(s){s&&it(e)}}}function Da(n){let e,t,l;return{c(){e=X("svg"),t=X("rect"),l=X("path"),b(t,"x","6"),b(t,"y","4"),b(t,"width","12"),b(t,"height","4"),b(t,"stroke","currentColor"),b(t,"stroke-width","2"),b(l,"d","M12 12V19M8 16L12 19L16 16"),b(l,"stroke","currentColor"),b(l,"stroke-width","2"),b(l,"fill","none"),b(l,"stroke-linecap","round"),b(e,"viewBox","0 0 24 24"),b(e,"width","16"),b(e,"height","16")},m(s,i){ot(s,e,i),he(e,t),he(e,l)},d(s){s&&it(e)}}}function Ta(n){let e,t,l;return{c(){e=X("svg"),t=X("rect"),l=X("path"),b(t,"x","6"),b(t,"y","16"),b(t,"width","12"),b(t,"height","4"),b(t,"stroke","currentColor"),b(t,"stroke-width","2"),b(l,"d","M12 12V5M8 8L12 5L16 8"),b(l,"stroke","currentColor"),b(l,"stroke-width","2"),b(l,"fill","none"),b(l,"stroke-linecap","round"),b(e,"viewBox","0 0 24 24"),b(e,"width","16"),b(e,"height","16")},m(s,i){ot(s,e,i),he(e,t),he(e,l)},d(s){s&&it(e)}}}function Ha(n){let e,t,l;return{c(){e=X("svg"),t=X("rect"),l=X("path"),b(t,"x","16"),b(t,"y","6"),b(t,"width","4"),b(t,"height","12"),b(t,"stroke","currentColor"),b(t,"stroke-width","2"),b(t,"fill","none"),b(l,"d","M12 12H5M8 8L5 12L8 16"),b(l,"stroke","currentColor"),b(l,"stroke-width","2"),b(l,"fill","none"),b(l,"stroke-linecap","round"),b(e,"viewBox","0 0 24 24"),b(e,"width","16"),b(e,"height","16")},m(s,i){ot(s,e,i),he(e,t),he(e,l)},d(s){s&&it(e)}}}function Ra(n){let e,t,l;return{c(){e=X("svg"),t=X("rect"),l=X("path"),b(t,"x","4"),b(t,"y","6"),b(t,"width","4"),b(t,"height","12"),b(t,"stroke","currentColor"),b(t,"stroke-width","2"),b(t,"fill","none"),b(l,"d","M12 12H19M16 8L19
512L16 16"),b(l,"stroke","currentColor"),b(l,"stroke-width","2"),b(l,"fill","none"),b(l,"stroke-linecap","round"),b(e,"viewBox","0 0 24 24"),b(e,"width","16"),b(e,"height","16")},m(s,i){ot(s,e,i),he(e,t),he(e,l)},d(s){s&&it(e)}}}function Na(n){let e;function t(i,o){if(i[0]=="add-column-right")return Ra;if(i[0]=="add-column-left")return Ha;if(i[0]=="add-row-above")return Ta;if(i[0]=="add-row-below")return Da;if(i[0]=="delete-row")return za;if(i[0]=="delete-column")return Ba;if(i[0]=="sort-asc")return ja;if(i[0]=="sort-desc")return La;if(i[0]=="clear-sort")return Aa}let l=t(n),s=l&&l(n);return{c(){s&&s.c(),e=Sa()},m(i,o){s&&s.m(i,o),ot(i,e,o)},p(i,[o]){l!==(l=t(i))&&(s&&s.d(1),s=l&&l(i),s&&(s.c(),s.m(e.parentNode,e)))},i:js,o:js,d(i){i&&it(e),s&&s.d(i)}}}function Pa(n,e,t){let{icon:l}=e;return n.$$set=s=>{"icon"in s&&t(0,l=s.icon)},[l]}class ft extends Ca{constructor(e){super(),Ma(this,e,Pa,Na,qa,{icon:0})}get icon(){return this.$$.ctx[0]}set icon(e){this.$$set({icon:e}),Ea()}}const{SvelteComponent:Ka,append:ae,attr:se,binding_callbacks:Ia,check_outros:Ut,create_component:ht,destroy_component:dt,detach:pe,element:Ze,empty:Si,flush:Ce,group_outros:Wt,init:Oa,insert:ve,is_function:kl,listen:mt,mount_component:gt,run_all:pl,safe_not_equal:Fa,set_data:tt,space:Ee,text:nt,toggle_class:wn,transition_in:_e,transition_out:Me}=window.__gradio__svelte__internal,{onMount:Va}=window.__gradio__svelte__internal;function Bs(n){let e,t,l,s=n[12]("dataframe.sort_ascending")+"",i,o,_,u,c,r,a=n[12]("dataframe.sort_descending")+"",f,p,C,m,y,w,h=n[12]("dataframe.clear_sort")+"",k,v,S,j;t=new ft({props:{icon:"sort-asc"}});let q=n[10]==="asc"&&n[11]!==null&&zs(n);c=new ft({props:{icon:"sort-desc"}});let D=n[10]==="desc"&&n[11]!==null&&Ds(n);return y=new ft({props:{icon:"clear-sort"}}),{c(){e=Ze("button"),ht(t.$$.fragment),l=Ee(),i=nt(s),o=Ee(),q&&q.c(),_=Ee(),u=Ze("button"),ht(c.$$.fragment),r=Ee(),f=nt(a),p=Ee(),D&&D.c(),C=Ee(),m=Ze("button"),ht(y.$$.fragment),w=Ee(),k=nt(h),se(e,"role","menuitem"),se(e,"class","svelte-42thj4"),wn(e,"active",n[10]==="asc"),se(u,"role","menuitem"),se(u,"class","svelte-42thj4"),wn(u,"active",n[10]==="desc"),se(m,"role","menuitem"),se(m,"class","svelte-42thj4")},m(T,I){ve(T,e,I),gt(t,e,null),ae(e,l),ae(e,i),ae(e,o),q&&q.m(e,null),ve(T,_,I),ve(T,u,I),gt(c,u,null),ae(u,r),ae(u,f),ae(u,p),D&&D.m(u,null),ve(T,C,I),ve(T,m,I),gt(y,m,null),ae(m,w),ae(m,k),v=!0,S||(j=[mt(e,"click",n[23]),mt(u,"click",n[24]),mt(m,"click",function(){kl(n[9])&&n[9].apply(this,arguments)})],S=!0)},p(T,I){n=T,(!v||I&4096)&&s!==(s=n[12]("dataframe.sort_ascending")+"")&&tt(i,s),n[10]==="asc"&&n[11]!==null?q?q.p(n,I):(q=zs(n),q.c(),q.m(e,null)):q&&(q.d(1),q=null),(!v||I&1024)&&wn(e,"active",n[10]==="asc"),(!v||I&4096)&&a!==(a=n[12]("dataframe.sort_descending")+"")&&tt(f,a),n[10]==="desc"&&n[11]!==null?D?D.p(n,I):(D=Ds(n),D.c(),D.m(u,null)):D&&(D.d(1),D=null),(!v||I&1024)&&wn(u,"active",n[10]==="desc"),(!v||I&4096)&&h!==(h=n[12]("dataframe.clear_sort")+"")&&tt(k,h)},i(T){v||(_e(t.$$.fragment,T),_e(c.$$.fragment,T),_e(y.$$.fragment,T),v=!0)},o(T){Me(t.$$.fragment,T),Me(c.$$.fragment,T),Me(y.$$.fragment,T),v=!1},d(T){T&&(pe(e),pe(_),pe(u),pe(C),pe(m)),dt(t),q&&q.d(),dt(c),D&&D.d(),dt(y),S=!1,pl(j)}}}function zs(n){let e,t;return{c(){e=Ze("span"),t=nt(n[11]),se(e,"class","priority svelte-42thj4")},m(l,s){ve(l,e,s),ae(e,t)},p(l,s){s&2048&&tt(t,l[11])},d(l){l&&pe(e)}}}function Ds(n){let e,t;return{c(){e=Ze("span"),t=nt(n[11]),se(e,"class","priority svelte-42thj4")},m(l,s){ve(l,e,s),ae(e,t)},p(l,s){s&2048&&tt(t,l[11])},d(l){l&&pe(e)}}}function Ts(n){let e,t,l,s=n[12]("dataframe.add_row_above")+"",i,o,_,u,c,r=n[12]("dataframe.add_row_below")+"",a,f,p,C,m,y;t=new ft({props:{icon:"add-row-above"}}),u=new ft({props:{icon:"add-row-below"}});let w=n[6]&&Hs(n);return{c(){e=Ze("button"),ht(t.$$.fragment),l=Ee(),i=nt(s),o=Ee(),_=Ze("button"),ht(u.$$.fragment),c=Ee(),a=nt(r),f=Ee(),w&&w.c(),p=Si(),se(e,"role","menuitem"),se(e,"aria-label","Add row above"),se(e,"class","svelte-42thj4"),se(_,"role","menuitem"),se(_,"aria-label","Add row below"),se(_,"class","svelte-42thj4")}
5,m(h,k){ve(h,e,k),gt(t,e,null),ae(e,l),ae(e,i),ve(h,o,k),ve(h,_,k),gt(u,_,null),ae(_,c),ae(_,a),ve(h,f,k),w&&w.m(h,k),ve(h,p,k),C=!0,m||(y=[mt(e,"click",n[25]),mt(_,"click",n[26])],m=!0)},p(h,k){(!C||k&4096)&&s!==(s=h[12]("dataframe.add_row_above")+"")&&tt(i,s),(!C||k&4096)&&r!==(r=h[12]("dataframe.add_row_below")+"")&&tt(a,r),h[6]?w?(w.p(h,k),k&64&&_e(w,1)):(w=Hs(h),w.c(),_e(w,1),w.m(p.parentNode,p)):w&&(Wt(),Me(w,1,1,()=>{w=null}),Ut())},i(h){C||(_e(t.$$.fragment,h),_e(u.$$.fragment,h),_e(w),C=!0)},o(h){Me(t.$$.fragment,h),Me(u.$$.fragment,h),Me(w),C=!1},d(h){h&&(pe(e),pe(o),pe(_),pe(f),pe(p)),dt(t),dt(u),w&&w.d(h),m=!1,pl(y)}}}function Hs(n){let e,t,l,s=n[12]("dataframe.delete_row")+"",i,o,_,u;return t=new ft({props:{icon:"delete-row"}}),{c(){e=Ze("button"),ht(t.$$.fragment),l=Ee(),i=nt(s),se(e,"role","menuitem"),se(e,"class","delete svelte-42thj4"),se(e,"aria-label","Delete row")},m(c,r){ve(c,e,r),gt(t,e,null),ae(e,l),ae(e,i),o=!0,_||(u=mt(e,"click",function(){kl(n[4])&&n[4].apply(this,arguments)}),_=!0)},p(c,r){n=c,(!o||r&4096)&&s!==(s=n[12]("dataframe.delete_row")+"")&&tt(i,s)},i(c){o||(_e(t.$$.fragment,c),o=!0)},o(c){Me(t.$$.fragment,c),o=!1},d(c){c&&pe(e),dt(t),_=!1,u()}}}function Rs(n){let e,t,l,s=n[12]("dataframe.add_column_left")+"",i,o,_,u,c,r=n[12]("dataframe.add_column_right")+"",a,f,p,C,m,y;t=new ft({props:{icon:"add-column-left"}}),u=new ft({props:{icon:"add-column-right"}});let w=n[7]&&Ns(n);return{c(){e=Ze("button"),ht(t.$$.fragment),l=Ee(),i=nt(s),o=Ee(),_=Ze("button"),ht(u.$$.fragment),c=Ee(),a=nt(r),f=Ee(),w&&w.c(),p=Si(),se(e,"role","menuitem"),se(e,"aria-label","Add column to the left"),se(e,"class","svelte-42thj4"),se(_,"role","menuitem"),se(_,"aria-label","Add column to the right"),se(_,"class","svelte-42thj4")},m(h,k){ve(h,e,k),gt(t,e,null),ae(e,l),ae(e,i),ve(h,o,k),ve(h,_,k),gt(u,_,null),ae(_,c),ae(_,a),ve(h,f,k),w&&w.m(h,k),ve(h,p,k),C=!0,m||(y=[mt(e,"click",n[27]),mt(_,"click",n[28])],m=!0)},p(h,k){(!C||k&4096)&&s!==(s=h[12]("dataframe.add_column_left")+"")&&tt(i,s),(!C||k&4096)&&r!==(r=h[12]("dataframe.add_column_right")+"")&&tt(a,r),h[7]?w?(w.p(h,k),k&128&&_e(w,1)):(w=Ns(h),w.c(),_e(w,1),w.m(p.parentNode,p)):w&&(Wt(),Me(w,1,1,()=>{w=null}),Ut())},i(h){C||(_e(t.$$.fragment,h),_e(u.$$.fragment,h),_e(w),C=!0)},o(h){Me(t.$$.fragment,h),Me(u.$$.fragment,h),Me(w),C=!1},d(h){h&&(pe(e),pe(o),pe(_),pe(f),pe(p)),dt(t),dt(u),w&&w.d(h),m=!1,pl(y)}}}function Ns(n){let e,t,l,s=n[12]("dataframe.delete_column")+"",i,o,_,u;return t=new ft({props:{icon:"delete-column"}}),{c(){e=Ze("button"),ht(t.$$.fragment),l=Ee(),i=nt(s),se(e,"role","menuitem"),se(e,"class","delete svelte-42thj4"),se(e,"aria-label","Delete column")},m(c,r){ve(c,e,r),gt(t,e,null),ae(e,l),ae(e,i),o=!0,_||(u=mt(e,"click",function(){kl(n[5])&&n[5].apply(this,arguments)}),_=!0)},p(c,r){n=c,(!o||r&4096)&&s!==(s=n[12]("dataframe.delete_column")+"")&&tt(i,s)},i(c){o||(_e(t.$$.fragment,c),o=!0)},o(c){Me(t.$$.fragment,c),o=!1},d(c){c&&pe(e),dt(t),_=!1,u()}}}function Ua(n){let e,t,l,s,i=n[16]&&Bs(n),o=!n[16]&&n[15]&&Ts(n),_=n[14]&&Rs(n);return{c(){e=Ze("div"),i&&i.c(),t=Ee(),o&&o.c(),l=Ee(),_&&_.c(),se(e,"class","cell-menu svelte-42thj4"),se(e,"role","menu")},m(u,c){ve(u,e,c),i&&i.m(e,null),ae(e,t),o&&o.m(e,null),ae(e,l),_&&_.m(e,null),n[29](e),s=!0},p(u,[c]){u[16]?i?(i.p(u,c),c&65536&&_e(i,1)):(i=Bs(u),i.c(),_e(i,1),i.m(e,t)):i&&(Wt(),Me(i,1,1,()=>{i=null}),Ut()),!u[16]&&u[15]?o?(o.p(u,c),c&98304&&_e(o,1)):(o=Ts(u),o.c(),_e(o,1),o.m(e,l)):o&&(Wt(),Me(o,1,1,()=>{o=null}),Ut()),u[14]?_?(_.p(u,c),c&16384&&_e(_,1)):(_=Rs(u),_.c(),_e(_,1),_.m(e,null)):_&&(Wt(),Me(_,1,1,()=>{_=null}),Ut())},i(u){s||(_e(i),_e(o),_e(_),s=!0)},o(u){Me(i),Me(o),Me(_),s=!1},d(u){u&&pe(e),i&&i.d(),o&&o.d(),_&&_.d(),n[29](null)}}}function Wa(n,e,t){let l,s,i,{x:o}=e,{y:_}=e,{on_add_row_above:u}=e,{on_add_row_below:c}=e,{on_add_column_left:r}=e,{on_add_column_right:a}=e,{row:f}=e,{col_count:p}=e,{row_count:C}=e,{on_delete_row:m}=e,{on_delete_col:y}=e,{can_delete_rows:w}=e,{can_delete_cols:h}=e,{on_sort:k=()=>{}}=e,{on_clear_sort:v=()=>{}}=e,{sort_direction:S=null}=e,{sort_priority:j=null}=e,{editable:q=!0}=e,{i18n:D}=e,T;Va(()=>{I()});function I(){if(!T)return;const z=window.innerWidth,A=window.innerHeight,ce=T.getBoundingClientRect();
5let G=o-30,J=_-20;G+ce.width>z&&(G=o-ce.width+10),J+ce.height>A&&(J=_-ce.height+10),t(13,T.style.left=`${G}px`,T),t(13,T.style.top=`${J}px`,T)}const O=()=>k("asc"),K=()=>k("desc"),F=()=>u(),ie=()=>c(),oe=()=>r(),W=()=>a();function ne(z){Ia[z?"unshift":"push"](()=>{T=z,t(13,T)})}return n.$$set=z=>{"x"in z&&t(17,o=z.x),"y"in z&&t(18,_=z.y),"on_add_row_above"in z&&t(0,u=z.on_add_row_above),"on_add_row_below"in z&&t(1,c=z.on_add_row_below),"on_add_column_left"in z&&t(2,r=z.on_add_column_left),"on_add_column_right"in z&&t(3,a=z.on_add_column_right),"row"in z&&t(19,f=z.row),"col_count"in z&&t(20,p=z.col_count),"row_count"in z&&t(21,C=z.row_count),"on_delete_row"in z&&t(4,m=z.on_delete_row),"on_delete_col"in z&&t(5,y=z.on_delete_col),"can_delete_rows"in z&&t(6,w=z.can_delete_rows),"can_delete_cols"in z&&t(7,h=z.can_delete_cols),"on_sort"in z&&t(8,k=z.on_sort),"on_clear_sort"in z&&t(9,v=z.on_clear_sort),"sort_direction"in z&&t(10,S=z.sort_direction),"sort_priority"in z&&t(11,j=z.sort_priority),"editable"in z&&t(22,q=z.editable),"i18n"in z&&t(12,D=z.i18n)},n.$$.update=()=>{n.$$.dirty&524288&&t(16,l=f===-1),n.$$.dirty&6291456&&t(15,s=q&&C[1]==="dynamic"),n.$$.dirty&5242880&&t(14,i=q&&p[1]==="dynamic")},[u,c,r,a,m,y,w,h,k,v,S,j,D,T,i,s,l,o,_,f,p,C,q,O,K,F,ie,oe,W,ne]}class Ya extends Ka{constructor(e){super(),Oa(this,e,Wa,Ua,Fa,{x:17,y:18,on_add_row_above:0,on_add_row_below:1,on_add_column_left:2,on_add_column_right:3,row:19,col_count:20,row_count:21,on_delete_row:4,on_delete_col:5,can_delete_rows:6,can_delete_cols:7,on_sort:8,on_clear_sort:9,sort_direction:10,sort_priority:11,editable:22,i18n:12})}get x(){return this.$$.ctx[17]}set x(e){this.$$set({x:e}),Ce()}get y(){return this.$$.ctx[18]}set y(e){this.$$set({y:e}),Ce()}get on_add_row_above(){return this.$$.ctx[0]}set on_add_row_above(e){this.$$set({on_add_row_above:e}),Ce()}get on_add_row_below(){return this.$$.ctx[1]}set on_add_row_below(e){this.$$set({on_add_row_below:e}),Ce()}get on_add_column_left(){return this.$$.ctx[2]}set on_add_column_left(e){this.$$set({on_add_column_left:e}),Ce()}get on_add_column_right(){return this.$$.ctx[3]}set on_add_column_right(e){this.$$set({on_add_column_right:e}),Ce()}get row(){return this.$$.ctx[19]}set row(e){this.$$set({row:e}),Ce()}get col_count(){return this.$$.ctx[20]}set col_count(e){this.$$set({col_count:e}),Ce()}get row_count(){return this.$$.ctx[21]}set row_count(e){this.$$set({row_count:e}),Ce()}get on_delete_row(){return this.$$.ctx[4]}set on_delete_row(e){this.$$set({on_delete_row:e}),Ce()}get on_delete_col(){return this.$$.ctx[5]}set on_delete_col(e){this.$$set({on_delete_col:e}),Ce()}get can_delete_rows(){return this.$$.ctx[6]}set can_delete_rows(e){this.$$set({can_delete_rows:e}),Ce()}get can_delete_cols(){return this.$$.ctx[7]}set can_delete_cols(e){this.$$set({can_delete_cols:e}),Ce()}get on_sort(){return this.$$.ctx[8]}set on_sort(e){this.$$set({on_sort:e}),Ce()}get on_clear_sort(){return this.$$.ctx[9]}set on_clear_sort(e){this.$$set({on_clear_sort:e}),Ce()}get sort_direction(){return this.$$.ctx[10]}set sort_direction(e){this.$$set({sort_direction:e}),Ce()}get sort_priority(){return this.$$.ctx[11]}set sort_priority(e){this.$$set({sort_priority:e}),Ce()}get editable(){return this.$$.ctx[22]}set editable(e){this.$$set({editable:e}),Ce()}get i18n(){return this.$$.ctx[12]}set i18n(e){this.$$set({i18n:e}),Ce()}}const{SvelteComponent:Ja,append:Yt,attr:ue,bubble:Xa,check_outros:Rt,create_component:xt,destroy_component:en,detach:tn,element:Bt,flush:Mt,group_outros:Nt,init:Ga,insert:nn,is_function:Qa,listen:Bn,mount_component:ln,safe_not_equal:Za,space:il,toggle_class:Ps,transition_in:be,transition_out:Le}=window.__gradio__svelte__internal,{onDestroy:$a}=window.__gradio__svelte__internal,{createEventDispatcher:xa}=window.__gradio__svelte__internal;function Ks(n){let e,t,l,s,i,o,_,u,c,r=n[0]&&n[3]==="filter"&&Is(n);return{c(){e=Bt("div"),t=Bt("input"),o=il(),r&&r.c(),ue(t,"type","text"),t.value=l=n[0]||"",ue(t,"placeholder",s=n[3]==="filter"?"Filter...":"Search..."),ue(t,"class","search-input svelte-b1nr0g"),ue(t,"title",i=`Enter text to ${n[3]} the table`),Ps(t,"filter-mode",n[3]==="filter"),ue(e,"class","search-container svelte-b1nr0g")},m(a,f){nn(a,e,f),Yt(e,t),Yt(e,o),r&&r.m(e,null),_=!0,u||(c=Bn(t,"input",n[7]),u=!0)}
5,p(a,f){(!_||f&1&&l!==(l=a[0]||"")&&t.value!==l)&&(t.value=l),(!_||f&8&&s!==(s=a[3]==="filter"?"Filter...":"Search..."))&&ue(t,"placeholder",s),(!_||f&8&&i!==(i=`Enter text to ${a[3]} the table`))&&ue(t,"title",i),(!_||f&8)&&Ps(t,"filter-mode",a[3]==="filter"),a[0]&&a[3]==="filter"?r?(r.p(a,f),f&9&&be(r,1)):(r=Is(a),r.c(),be(r,1),r.m(e,null)):r&&(Nt(),Le(r,1,1,()=>{r=null}),Rt())},i(a){_||(be(r),_=!0)},o(a){Le(r),_=!1},d(a){a&&tn(e),r&&r.d(),u=!1,c()}}}function Is(n){let e,t,l,s,i;return t=new ui({}),{c(){e=Bt("button"),xt(t.$$.fragment),ue(e,"class","toolbar-button check-button svelte-b1nr0g"),ue(e,"aria-label","Apply filter and update dataframe values"),ue(e,"title","Apply filter and update dataframe values")},m(o,_){nn(o,e,_),ln(t,e,null),l=!0,s||(i=Bn(e,"click",function(){Qa(n[5])&&n[5].apply(this,arguments)}),s=!0)},p(o,_){n=o},i(o){l||(be(t.$$.fragment,o),l=!0)},o(o){Le(t.$$.fragment,o),l=!1},d(o){o&&tn(e),en(t),s=!1,i()}}}function Os(n){let e,t,l,s,i,o,_,u;const c=[tu,eu],r=[];function a(f,p){return f[6]?0:1}return t=a(n),l=r[t]=c[t](n),{c(){e=Bt("button"),l.c(),ue(e,"class","toolbar-button svelte-b1nr0g"),ue(e,"aria-label",s=n[6]?"Copied to clipboard":"Copy table data"),ue(e,"title",i=n[6]?"Copied to clipboard":"Copy table data")},m(f,p){nn(f,e,p),r[t].m(e,null),o=!0,_||(u=Bn(e,"click",n[8]),_=!0)},p(f,p){let C=t;t=a(f),t!==C&&(Nt(),Le(r[C],1,1,()=>{r[C]=null}),Rt(),l=r[t],l||(l=r[t]=c[t](f),l.c()),be(l,1),l.m(e,null)),(!o||p&64&&s!==(s=f[6]?"Copied to clipboard":"Copy table data"))&&ue(e,"aria-label",s),(!o||p&64&&i!==(i=f[6]?"Copied to clipboard":"Copy table data"))&&ue(e,"title",i)},i(f){o||(be(l),o=!0)},o(f){Le(l),o=!1},d(f){f&&tn(e),r[t].d(),_=!1,u()}}}function eu(n){let e,t;return e=new So({}),{c(){xt(e.$$.fragment)},m(l,s){ln(e,l,s),t=!0},i(l){t||(be(e.$$.fragment,l),t=!0)},o(l){Le(e.$$.fragment,l),t=!1},d(l){en(e,l)}}}function tu(n){let e,t;return e=new ui({}),{c(){xt(e.$$.fragment)},m(l,s){ln(e,l,s),t=!0},i(l){t||(be(e.$$.fragment,l),t=!0)},o(l){Le(e.$$.fragment,l),t=!1},d(l){en(e,l)}}}function Fs(n){let e,t,l,s,i,o,_,u;const c=[lu,nu],r=[];function a(f,p){return f[4]?0:1}return t=a(n),l=r[t]=c[t](n),{c(){e=Bt("button"),l.c(),ue(e,"class","toolbar-button svelte-b1nr0g"),ue(e,"aria-label",s=n[4]?"Exit fullscreen":"Enter fullscreen"),ue(e,"title",i=n[4]?"Exit fullscreen":"Enter fullscreen")},m(f,p){nn(f,e,p),r[t].m(e,null),o=!0,_||(u=Bn(e,"click",n[10]),_=!0)},p(f,p){let C=t;t=a(f),t!==C&&(Nt(),Le(r[C],1,1,()=>{r[C]=null}),Rt(),l=r[t],l||(l=r[t]=c[t](f),l.c()),be(l,1),l.m(e,null)),(!o||p&16&&s!==(s=f[4]?"Exit fullscreen":"Enter fullscreen"))&&ue(e,"aria-label",s),(!o||p&16&&i!==(i=f[4]?"Exit fullscreen":"Enter fullscreen"))&&ue(e,"title",i)},i(f){o||(be(l),o=!0)},o(f){Le(l),o=!1},d(f){f&&tn(e),r[t].d(),_=!1,u()}}}function nu(n){let e,t;return e=new Eo({}),{c(){xt(e.$$.fragment)},m(l,s){ln(e,l,s),t=!0},i(l){t||(be(e.$$.fragment,l),t=!0)},o(l){Le(e.$$.fragment,l),t=!1},d(l){en(e,l)}}}function lu(n){let e,t;return e=new Mo({}),{c(){xt(e.$$.fragment)},m(l,s){ln(e,l,s),t=!0},i(l){t||(be(e.$$.fragment,l),t=!0)},o(l){Le(e.$$.fragment,l),t=!1},d(l){en(e,l)}}}function su(n){let e,t,l,s,i,o=n[3]!=="none"&&Ks(n),_=n[2]&&Os(n),u=n[1]&&Fs(n);return{c(){e=Bt("div"),t=Bt("div"),o&&o.c(),l=il(),_&&_.c(),s=il(),u&&u.c(),ue(t,"class","toolbar-buttons svelte-b1nr0g"),ue(e,"class","toolbar svelte-b1nr0g"),ue(e,"role","toolbar"),ue(e,"aria-label","Table actions")},m(c,r){nn(c,e,r),Yt(e,t),o&&o.m(t,null),Yt(t,l),_&&_.m(t,null),Yt(t,s),u&&u.m(t,null),i=!0},p(c,[r]){c[3]!=="none"?o?(o.p(c,r),r&8&&be(o,1)):(o=Ks(c),o.c(),be(o,1),o.m(t,l)):o&&(Nt(),Le(o,1,1,()=>{o=null}),Rt()),c[2]?_?(_.p(c,r),r&4&&be(_,1)):(_=Os(c),_.c(),be(_,1),_.m(t,s)):_&&(Nt(),Le(_,1,1,()=>{_=null}),Rt()),c[1]?u?(u.p(c,r),r&2&&be(u,1)):(u=Fs(c),u.c(),be(u,1),u.m(t,null)):u&&(Nt(),Le(u,1,1,()=>{u=null}),Rt())},i(c){i||(be(o),be(_),be(u),i=!0)},o(c){Le(o),Le(_),Le(u),i=!1},d(c){c&&tn(e),o&&o.d(),_&&_.d(),u&&u.d()}}}function iu(n,e,t){let{show_fullscreen_button:l=!1}=e,{show_copy_button:s=!1}=e,{show_search:i="none"}=e,{is_fullscreen:o=!1}=e,{on_copy:_}=e,{on_commit_filter:u}=e;const c=xa();let r=!1,a,{current_search_query:f=null}=e,p="";function C(h){p=h.target.value;const v=p||null;f!==v&&(t(0,f=v),c("search",f))}function m(){t(6,r=!0),a&&clearTimeout(a),a=setTimeout(()=>{t(6,r=!1)},2e3)}async function y(){await _(),m()}$a(()=>{a&&clearTimeout(a)});function w(h){Xa.call(this,n,h)}return n.$$set=h=>{"show_fullscreen_button"in h&&t(1,l=h.show_fullscreen_button),"show_copy_button"in h&&t(2,s=h.show_copy_button),"show_search"in h&&t(3,i=h.show_search),"is_fullscreen"in h&&t(4,o=h.is_fullscreen),"on_copy"in h&&t(9,_=h.on_copy),"on_commit_filter"in h&&t(5,u=h.on_commit_filter),"current_search_query"in h&&t(0,f=h.current_search_query)},[f,l,s,i,o,u,r,C,y,_,w]}class ou extends Ja{constructor(e){super(),Ga(this,e,iu,su,Za,{show_fullscreen_button:1,show_copy_button:2,show_search:3,is_fullscreen:4,on_copy:9,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}),Mt()}get show_copy_button(){return this.$$.ctx[2]}set show_copy_button(e){this.$$set({show_copy_button:e}),Mt()}get show_search(){return this.$$.ctx[3]}set show_search(e){this.$$set({show_search:e}),Mt()}get is_fullscreen(){return this.$$.ctx[4]}set is_fullscreen(e){this.$$set({is_fullscreen:e}),Mt()}get on_copy(){return this.$$.ctx[9]}set on_copy(e){this.$$set({on_copy:e}),Mt()}get on_commit_filter(){return this.$$.ctx[5]}set on_commit_filter(e){this.$$set({on_commit_filter:e}),Mt()}get current_search_query(){return this.$$.ctx[0]}set current_search_query(e){this.$$set({current_search_query:e}),Mt()}}function kn(n,e,t,l){let s=n||[];if(e[1]==="fixed"&&s.length<e[0]){const i=Array(e[0]-s.length).fill("").map((o,_)=>`${_+s.length}`);s=s.concat(i)}return!s||s.length===0?Array(e[0]).fill(0).map((i,o)=>{const _=l();return t[_]={cell:null,input:null},{id:_,value:JSON.stringify(o+1)}}):s.map((i,o)=>{const _=l();return t[_]={cell:null,input:null},{id:_,value:i??""}})}function ru(n,e,t,l,s=null){return!n||n.length===0?[]:n.map((o,_)=>o.map((u,c)=>{const r=l();e[r]={cell:null,input:null},t[r]=u;let a=s?.[_]?.[c];return a===void 0&&(a=String(u)),{id:r,value:u,display_value:a}}))}const{tick:ol}=window.__gradio__svelte__internal;function _u(n,e){if(e.selected_header===!1||e.header_edit!==!1)return!1;switch(n.key){case"ArrowDown":return e.df_actions.set_selected_header(!1),e.df_actions.set_selected([0,e.selected_header]),e.df_actions.set_selected_cells([[0,e.selected_header]]),!0;case"ArrowLeft":return e.df_actions.set_selected_header(e.selected_header>0?e.selected_header-1:e.selected_header),!0;case"ArrowRight":return e.df_actions.set_selected_header(e.selected_header<e.headers.length-1?e.
5selected_header+1:e.selected_header),!0;case"Escape":return n.preventDefault(),e.df_actions.set_selected_header(!1),!0;case"Enter":return n.preventDefault(),e.editable&&e.df_actions.set_header_edit(e.selected_header),!0}return!1}function au(n,e){if(!e.editable||n.key!=="Delete"&&n.key!=="Backspace")return!1;if(e.editing){const[t,l]=e.editing,s=e.els[e.data[t][l].id].input;if(s&&s.selectionStart!==s.selectionEnd||n.key==="Delete"&&s?.selectionStart!==s?.value.length||n.key==="Backspace"&&s?.selectionStart!==0)return!1}if(n.preventDefault(),e.selected_cells.length>0){const t=zo(e.data,e.selected_cells);e.dispatch("change",{data:t.map(l=>l.map(s=>s.value)),headers:e.headers.map(l=>l.value),metadata:null}),e.dispatch("input")}return!0}function uu(n,e,t,l){if(e.editing)return!1;n.preventDefault();const s=e.move_cursor(n,[t,l],e.data);return s?(n.shiftKey?(e.df_actions.set_selected_cells(e.get_range_selection(e.selected_cells.length>0?e.selected_cells[0]:[t,l],s)),e.df_actions.set_editing(!1)):(e.df_actions.set_selected_cells([s]),e.df_actions.set_editing(!1)),e.df_actions.set_selected(s)):s===!1&&n.key==="ArrowUp"&&t===0&&(e.df_actions.set_selected_header(l),e.df_actions.set_selected(!1),e.df_actions.set_selected_cells([]),e.df_actions.set_editing(!1)),!0}async function cu(n,e,t,l){if(n.preventDefault(),!e.editable)return!1;if(n.shiftKey)await e.add_row(t),await ol(),e.df_actions.set_selected([t+1,l]);else if(vt(e.editing,[t,l])){const s=e.data[t][l].id,i=e.els[s].input;if(i){const o=e.data[t][l].value;e.data[t][l].value=i.value,o!==i.value&&e.dispatch("input")}e.df_actions.set_editing(!1),await ol(),e.df_actions.set_selected([t,l])}else e.df_actions.set_editing([t,l]);return!0}function fu(n,e,t,l){n.preventDefault(),e.df_actions.set_editing(!1);const s=e.get_next_cell_coordinates([t,l],e.data,n.shiftKey);return s&&(e.df_actions.set_selected_cells([s]),e.df_actions.set_selected(s),e.editable&&e.df_actions.set_editing(s)),!0}function hu(n,e,t,l){return e.editable&&(!e.editing||e.editing&&vt(e.editing,[t,l]))&&n.key.length===1?(e.df_actions.set_editing([t,l]),!0):!1}async function du(n,e){if(!e.selected)return!1;if(n.key==="c"&&(n.metaKey||n.ctrlKey))return n.preventDefault(),e.selected_cells.length>0&&await fi(e.data,e.selected_cells),e.set_copy_flash(!0),!0;const[t,l]=e.selected;switch(n.key){case"ArrowRight":case"ArrowLeft":case"ArrowDown":case"ArrowUp":return uu(n,e,t,l);case"Escape":return e.editable?(n.preventDefault(),e.df_actions.set_editing(!1),ol().then(()=>{e.parent_element&&e.parent_element.focus()}),!0):!1;case"Enter":return await cu(n,e,t,l);case"Tab":return fu(n,e,t,l);default:return hu(n,e,t,l)}}async function mu(n,e){_u(n,e)||au(n,e)||await du(n,e)}function gu(n,e,t,l,s,i,o){const _=(r,a,f)=>{r.target instanceof HTMLAnchorElement||i&&f===-1||(r.preventDefault(),r.stopPropagation(),n.mouse_down_pos={x:r.clientX,y:r.clientY},n.drag_start=[a,f],!r.shiftKey&&!r.metaKey&&!r.ctrlKey&&(t([[a,f]]),l([a,f])))},u=r=>{const a=r.target.closest("td");if(!a)return;const f=parseInt(a.getAttribute("data-row")||"0"),p=parseInt(a.getAttribute("data-col")||"0");if(isNaN(f)||isNaN(p))return;const C=fl(n.drag_start,[f,p]);t(C),l([f,p])};return{handle_mouse_down:_,handle_mouse_move(r){if(!n.drag_start||!n.mouse_down_pos)return;const a=Math.abs(r.clientX-n.mouse_down_pos.x),f=Math.abs(r.clientY-n.mouse_down_pos.y);!n.is_dragging&&(a>3||f>3)&&(n.is_dragging=!0,e(!0)),n.is_dragging&&u(r)},handle_mouse_up:r=>{!n.is_dragging&&n.drag_start?s(r,n.drag_start[0],n.drag_start[1]):n.is_dragging&&o&&o.focus(),n.is_dragging=!1,e(!1),n.drag_start=null,n.mouse_down_pos=null}}}const{SvelteComponent:bu,add_flush_callback:Ge,append:me,attr:fe,bind:Qe,binding_callbacks:Re,check_outros:xe,component_subscribe:wu,create_component:Ue,destroy_component:We,detach:je,element:qe,empty:sn,ensure_array_like:pt,flush:le,globals:ku,group_outros:et,init:pu,insert:Be,is_function:Gn,listen:Tt,mount_component:Ye,noop:Ei,outro_and_destroy_block:En,run_all:vu,safe_not_equal:yu,set_data:vl,set_style:Vs,space:Fe,text:yl,toggle_class:kt,transition_in:U,transition_out:Q,update_keyed_each:Mn}=window.__gradio__svelte__internal,{Map:qn,window:Cu}=ku,{afterUpdate:Su,createEventDispatcher:Eu,tick:Mu,onMount:Us}=window.__gradio__svelte__internal;function Ws(n,e,t){const l=n.slice();return l[139]=e[t].value,l[140]=e[t].id,l[143]=e,l[144]=t,l}function Ys(n,e,t){const l=n.slice();return l[139]=e[t].value,l[140]=e[t].id,l[141]=e,l[142]=t,l}function Js(n,e,t){const l=n.slice();
5return l[139]=e[t].value,l[140]=e[t].id,l[145]=e,l[142]=t,l}function Xs(n,e,t){const l=n.slice();return l[139]=e[t].value,l[140]=e[t].id,l[146]=e,l[144]=t,l}function Gs(n){let e,t,l,s,i=n[3]&&n[3].length!==0&&n[4]&&Qs(n);return l=new ou({props:{show_fullscreen_button:n[18],is_fullscreen:n[37],on_copy:n[86],show_copy_button:n[19],show_search:n[21],on_commit_filter:n[68],current_search_query:n[36].current_search_query}}),l.$on("click",n[64]),l.$on("search",n[87]),{c(){e=qe("div"),i&&i.c(),t=Fe(),Ue(l.$$.fragment),fe(e,"class","header-row svelte-18s8a4c")},m(o,_){Be(o,e,_),i&&i.m(e,null),me(e,t),Ye(l,e,null),s=!0},p(o,_){o[3]&&o[3].length!==0&&o[4]?i?i.p(o,_):(i=Qs(o),i.c(),i.m(e,t)):i&&(i.d(1),i=null);const u={};_[0]&262144&&(u.show_fullscreen_button=o[18]),_[1]&64&&(u.is_fullscreen=o[37]),_[0]&134217728&&(u.on_copy=o[86]),_[0]&524288&&(u.show_copy_button=o[19]),_[0]&2097152&&(u.show_search=o[21]),_[1]&32&&(u.current_search_query=o[36].current_search_query),l.$set(u)},i(o){s||(U(l.$$.fragment,o),s=!0)},o(o){Q(l.$$.fragment,o),s=!1},d(o){o&&je(e),i&&i.d(),We(l)}}}function Qs(n){let e,t,l;return{c(){e=qe("div"),t=qe("p"),l=yl(n[3]),fe(t,"class","svelte-18s8a4c"),fe(e,"class","label svelte-18s8a4c")},m(s,i){Be(s,e,i),me(e,t),me(t,l)},p(s,i){i[0]&8&&vl(l,s[3])},d(s){s&&je(e)}}}function Zs(n){let e,t;return{c(){e=qe("caption"),t=yl(n[3]),fe(e,"class","sr-only svelte-18s8a4c")},m(l,s){Be(l,e,s),me(e,t)},p(l,s){s[0]&8&&vl(t,l[3])},d(l){l&&je(e)}}}function $s(n){let e,t;return e=new An({props:{is_header:!0}}),{c(){Ue(e.$$.fragment)},m(l,s){Ye(e,l,s),t=!0},i(l){t||(U(e.$$.fragment,l),t=!0)},o(l){Q(e.$$.fragment,l),t=!1},d(l){We(e,l)}}}function xs(n,e){let t,l,s,i,o;function _(r){e[88](r,e[144])}function u(r){e[89](r,e[140])}let c={i:e[144],actual_pinned_columns:e[52],header_edit:e[33],selected_header:e[34],get_sort_status:e[54].get_sort_status,headers:e[0],get_cell_width:Cl,handle_header_click:e[57],toggle_header_menu:e[65],end_header_edit:e[58],sort_columns:e[36].sort_state.sort_columns,latex_delimiters:e[7],line_breaks:e[14],max_chars:e[20],root:e[11],editable:e[9],is_static:e[22].includes(e[144]),i18n:e[12],col_count:e[5]};return e[26][e[144]].value!==void 0&&(c.value=e[26][e[144]].value),e[23][e[140]].input!==void 0&&(c.el=e[23][e[140]].input),l=new bi({props:c}),Re.push(()=>Qe(l,"value",_)),Re.push(()=>Qe(l,"el",u)),{key:n,first:null,c(){t=sn(),Ue(l.$$.fragment),this.first=t},m(r,a){Be(r,t,a),Ye(l,r,a),o=!0},p(r,a){e=r;const f={};a[0]&67108864&&(f.i=e[144]),a[1]&2097152&&(f.actual_pinned_columns=e[52]),a[1]&4&&(f.header_edit=e[33]),a[1]&8&&(f.selected_header=e[34]),a[0]&1&&(f.headers=e[0]),a[1]&32&&(f.sort_columns=e[36].sort_state.sort_columns),a[0]&128&&(f.latex_delimiters=e[7]),a[0]&16384&&(f.line_breaks=e[14]),a[0]&1048576&&(f.max_chars=e[20]),a[0]&2048&&(f.root=e[11]),a[0]&512&&(f.editable=e[9]),a[0]&71303168&&(f.is_static=e[22].includes(e[144])),a[0]&4096&&(f.i18n=e[12]),a[0]&32&&(f.col_count=e[5]),!s&&a[0]&67108864&&(s=!0,f.value=e[26][e[144]].value,Ge(()=>s=!1)),!i&&a[0]&75497472&&(i=!0,f.el=e[23][e[140]].input,Ge(()=>i=!1)),l.$set(f)},i(r){o||(U(l.$$.fragment,r),o=!0)},o(r){Q(l.$$.fragment,r),o=!1},d(r){r&&je(t),We(l,r)}}}function ei(n){let e,t;return e=new An({props:{index:0}}),{c(){Ue(e.$$.fragment)},m(l,s){Ye(e,l,s),t=!0},i(l){t||(U(e.$$.fragment,l),t=!0)},o(l){Q(e.$$.fragment,l),t=!1},d(l){We(e,l)}}}function ti(n,e){let t,l,s,i,o=e[142],_;s=new dl({props:{value:e[139],latex_delimiters:e[7],line_breaks:e[14],datatype:Array.isArray(e[2])?e[2][e[142]]:e[2],edit:!1,el:null,root:e[11],editable:e[9],i18n:e[12],show_selection_buttons:e[32].length===1&&e[32][0][0]===0&&e[32][0][1]===e[142],coords:[0,e[142]],on_select_column:e[62],on_select_row:e[63],is_dragging:e[44]}});const u=()=>e[90](t,o),c=()=>e[90](null,o);return{key:n,first:null,c(){t=qe("td"),l=qe("div"),Ue(s.$$.fragment),i=Fe(),fe(l,"class","cell-wrap svelte-18s8a4c"),fe(t,"tabindex","-1"),fe(t,"class","svelte-18s8a4c"),this.first=t},m(r,a){Be(r,t,a),me(t,l),Ye(s,l,null),me(t,i),u(),_=!0},p(r,a){e=r;const f={};a[1]&1048576&&(f.value=e[139]),a[0]&128&&(f.latex_delimiters=e[7]),a[0]&16384&&(f.line_breaks=e[14]),a[0]&4|a[1]&1048576&&(f.datatype=Array.isArray(e[2])?e[2][e[142]]:e[2]),a[0]&2048&&(f.root=e[11]),a[0]&512&&(f.editable=e[9]),a[0]&4096&&(f.i18n=e[12]),a[1]&1048578&&(f.show_selection_buttons=e[32].length===1&&e[32][0][0]===0&&e[32][0][1]===e[142]),a[1]&1048576&&(f.coords=[0,e[142]]),a[1]&8192&&(f.is_dragging=e[44]),s.$set(f),o!==e[142]&&(c(),o=e[142],u())},i(r){_||(U(s.$$.fragment,r),_=!0)},o(r){Q(s.$$.fragment,r),_=!1},d(r){r&&je(t),We(s),c()}}}function ni(n){let e,t;return{c(){e=qe("caption"),t=yl(n[3]),fe(e,"class","sr-only svelte-18s8a4c")},m(l,s){Be(l,e,s),me(e,t)},p(l,s){s[0]&8&&vl(t,l[3])},d(l){l&&je(e)}}}function qu(n){let e,t=n[3]&&n[3].length!==0&&ni(n);return{c(){t&&t.c(),e=sn()},m(l,s){t&&t.m(l,s),Be(l,e,s)},p(l,s){l[3]&&l[3].length!==0?t?t.p(l,s):(t=ni(l),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(l){l&&je(e),t&&t.d(l)}}}function li(n){let e,t;return e=new An({props:{is_header:!0}}),{c(){Ue(e.$$.fragment)},m(l,s){Ye(e,l,s),t=!0},i(l){t||(U(e.$$.fragment,l),t=!0)},o(l){Q(e.$$.fragment,l),t=!1},d(l){We(e,l)}}}function si(n,e){let t,l,s,i,o;function _(r){e[95](r,e[144])}function u(r){e[96](r,e[140])}let c={i:e[144],actual_pinned_columns:e[52],header_edit:e[33],selected_header:e[34],get_sort_status:e[54].get_sort_status,headers:e[0],get_cell_width:Cl,handle_header_click:e[57],toggle_header_menu:e[65],end_header_edit:e[58],sort_columns:e[36].sort_state.sort_columns,latex_delimiters:e[7],line_breaks:e[14],max_chars:e[20],root:e[11],editable:e[9],is_static:e[22].includes(e[144]),i18n:e[12],col_count:e[5]};return e[26][e[144]].value!==void 0&&(c.value=e[26][e[144]].value),e[23][e[140]].input!==void 0&&(c.el=e[23][e[140]].input),l=new bi({props:c}),Re.push(()=>Qe(l,"value",_)),Re.push(()=>Qe(l,"el",u)),{key:n,first:null,c(){t=sn(),Ue(l.$$.fragment),this.first=t},m(r,a){Be(r,t,a),Ye(l,r,a),o=!0},p(r,a){e=r;const f={};a[0]&67108864&&(f.i=e[144]),a[1]&2097152&&(f.actual_pinned_columns=e[52]),a[1]&4&&(f.header_edit=e[33]),a[1]&8&&(f.selected_header=e[34]),a[0]&1&&(f.headers=e[0]),a[1]&32&&(f.sort_columns=e[36].sort_state.sort_columns),a[0]&128&&(f.latex_delimiters=e[7]),a[0]&16384&&(f.line_breaks=e[14]),a[0]&1048576&&(f.max_chars=e[20]),a[0]&2048&&(f.root=e[11]),a[0]&512&&(f.editable=e[9]),a[0]&71303168&&(f.is_static=e[22].includes(e[144])),a[0]&4096&&(f.i18n=e[12]),a[0]&32&&(f.col_
5count=e[5]),!s&&a[0]&67108864&&(s=!0,f.value=e[26][e[144]].value,Ge(()=>s=!1)),!i&&a[0]&75497472&&(i=!0,f.el=e[23][e[140]].input,Ge(()=>i=!1)),l.$set(f)},i(r){o||(U(l.$$.fragment,r),o=!0)},o(r){Q(l.$$.fragment,r),o=!1},d(r){r&&je(t),We(l,r)}}}function Au(n){let e,t,l=[],s=new qn,i,o=n[15]&&li(),_=pt(n[26]);const u=c=>c[140];for(let c=0;c<_.length;c+=1){let r=Ws(n,_,c),a=u(r);s.set(a,l[c]=si(a,r))}return{c(){e=qe("tr"),o&&o.c(),t=Fe();for(let c=0;c<l.length;c+=1)l[c].c();fe(e,"slot","thead"),fe(e,"class","svelte-18s8a4c")},m(c,r){Be(c,e,r),o&&o.m(e,null),me(e,t);for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(e,null);i=!0},p(c,r){c[15]?o?r[0]&32768&&U(o,1):(o=li(),o.c(),U(o,1),o.m(e,t)):o&&(et(),Q(o,1,1,()=>{o=null}),xe()),r[0]&80763553|r[1]&211812396|r[2]&8&&(_=pt(c[26]),et(),l=Mn(l,r,u,1,c,_,s,e,En,si,null,Ws),xe())},i(c){if(!i){U(o);for(let r=0;r<_.length;r+=1)U(l[r]);i=!0}},o(c){Q(o);for(let r=0;r<l.length;r+=1)Q(l[r]);i=!1},d(c){c&&je(e),o&&o.d();for(let r=0;r<l.length;r+=1)l[r].d()}}}function ii(n){let e,t;return e=new An({props:{index:n[137]}}),{c(){Ue(e.$$.fragment)},m(l,s){Ye(e,l,s),t=!0},p(l,s){const i={};s[4]&8192&&(i.index=l[137]),e.$set(i)},i(l){t||(U(e.$$.fragment,l),t=!0)},o(l){Q(e.$$.fragment,l),t=!1},d(l){We(e,l)}}}function oi(n,e){let t,l,s,i,o;function _(r){e[93](r,e[137],e[142])}function u(r){e[94](r,e[140])}let c={index:e[137],j:e[142],actual_pinned_columns:e[52],get_cell_width:Cl,handle_cell_click:e[92],toggle_cell_menu:e[61],is_cell_selected:jo,should_show_cell_menu:Do,selected_cells:e[32],copy_flash:e[25],active_cell_menu:e[49],styling:e[39][e[137]][e[142]].styling,latex_delimiters:e[7],line_breaks:e[14],datatype:Array.isArray(e[2])?e[2][e[142]]:e[2],editing:e[31],clear_on_focus:e[24],max_chars:e[20],root:e[11],editable:e[9],is_static:e[22].includes(e[142]),i18n:e[12],components:e[8],handle_select_column:e[62],handle_select_row:e[63],is_dragging:e[44],wrap:e[10]};return e[39][e[137]][e[142]].value!==void 0&&(c.value=e[39][e[137]][e[142]].value),e[23][e[140]]!==void 0&&(c.el=e[23][e[140]]),l=new U_({props:c}),Re.push(()=>Qe(l,"value",_)),Re.push(()=>Qe(l,"el",u)),{key:n,first:null,c(){t=sn(),Ue(l.$$.fragment),this.first=t},m(r,a){Be(r,t,a),Ye(l,r,a),o=!0},p(r,a){e=r;const f={};a[4]&8192&&(f.index=e[137]),a[4]&16384&&(f.j=e[142]),a[1]&2097152&&(f.actual_pinned_columns=e[52]),a[1]&65536&&(f.handle_cell_click=e[92]),a[1]&2&&(f.selected_cells=e[32]),a[0]&33554432&&(f.copy_flash=e[25]),a[1]&262144&&(f.active_cell_menu=e[49]),a[1]&256|a[4]&24576&&(f.styling=e[39][e[137]][e[142]].styling),a[0]&128&&(f.latex_delimiters=e[7]),a[0]&16384&&(f.line_breaks=e[14]),a[0]&4|a[4]&16384&&(f.datatype=Array.isArray(e[2])?e[2][e[142]]:e[2]),a[1]&1&&(f.editing=e[31]),a[0]&16777216&&(f.clear_on_focus=e[24]),a[0]&1048576&&(f.max_chars=e[20]),a[0]&2048&&(f.root=e[11]),a[0]&512&&(f.editable=e[9]),a[0]&4194304|a[4]&16384&&(f.is_static=e[22].includes(e[142])),a[0]&4096&&(f.i18n=e[12]),a[0]&256&&(f.components=e[8]),a[1]&8192&&(f.is_dragging=e[44]),a[0]&1024&&(f.wrap=e[10]),!s&&a[1]&256|a[4]&24576&&(s=!0,f.value=e[39][e[137]][e[142]].value,Ge(()=>s=!1)),!i&&a[0]&8388608|a[4]&16384&&(i=!0,f.el=e[23][e[140]],Ge(()=>i=!1)),l.$set(f)},i(r){o||(U(l.$$.fragment,r),o=!0)},o(r){Q(l.$$.fragment,r),o=!1},d(r){r&&je(t),We(l,r)}}}function Lu(n){let e,t,l=[],s=new qn,i,o=n[15]&&ii(n),_=pt(n[138]);const u=c=>c[140];for(let c=0;c<_.length;c+=1){let r=Ys(n,_,c),a=u(r);s.set(a,l[c]=oi(a,r))}return{c(){e=qe("tr"),o&&o.c(),t=Fe();for(let c=0;c<l.length;c+=1)l[c].c();fe(e,"slot","tbody"),fe(e,"class","svelte-18s8a4c"),kt(e,"row-odd",n[137]%2===0)},m(c,r){Be(c,e,r),o&&o.m(e,null),me(e,t);for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(e,null);i=!0},p(c,r){c[15]?o?(o.p(c,r),r[0]&32768&&U(o,1)):(o=ii(c),o.c(),U(o,1),o.m(e,t)):o&&(et(),Q(o,1,1,()=>{o=null}),xe()),r[0]&63987588|r[1]&1076175107|r[2]&3|r[4]&24576&&(_=pt(c[138]),et(),l=Mn(l,r,u,1,c,_,s,e,En,oi,null,Ys),xe()),(!i||r[4]&8192)&&kt(e,"row-odd",c[137]%2===0)},i(c){if(!i){U(o);for(let r=0;r<_.length;r+=1)U(l[r]);i=!0}},o(c){Q(o);for(let r=0;r<l.length;r+=1)Q(l[r]);i=!1},d(c){c&&je(e),o&&o.d();for(let r=0;r<l.length;r+=1)l[r].d()}}}function ju(n){let e,t,l,s,i,o,_,u;
5function c(m){n[97](m)}function r(m){n[98](m)}function a(m){n[99](m)}function f(m){n[100](m)}function p(m){n[101](m)}let C={max_height:n[13],selected:n[50],disable_scroll:n[49]!==null||n[48]!==null,$$slots:{tbody:[Lu,({index:m,item:y})=>({137:m,138:y}),({index:m,item:y})=>[0,0,0,0,(m?8192:0)|(y?16384:0)]],thead:[Au],default:[qu]},$$scope:{ctx:n}};return n[39]!==void 0&&(C.items=n[39]),n[40]!==void 0&&(C.actual_height=n[40]),n[41]!==void 0&&(C.table_scrollbar_width=n[41]),n[42]!==void 0&&(C.viewport=n[42]),n[43]!==void 0&&(C.show_scroll_button=n[43]),t=new ya({props:C}),Re.push(()=>Qe(t,"items",c)),Re.push(()=>Qe(t,"actual_height",r)),Re.push(()=>Qe(t,"table_scrollbar_width",a)),Re.push(()=>Qe(t,"viewport",f)),Re.push(()=>Qe(t,"show_scroll_button",p)),t.$on("scroll_top",zu),{c(){e=qe("div"),Ue(t.$$.fragment),fe(e,"class","table-wrap svelte-18s8a4c")},m(m,y){Be(m,e,y),Ye(t,e,null),u=!0},p(m,y){const w={};y[0]&8192&&(w.max_height=m[13]),y[1]&524288&&(w.selected=m[50]),y[1]&393216&&(w.disable_scroll=m[49]!==null||m[48]!==null),y[0]&131129261|y[1]&2433327|y[4]&8413184&&(w.$$scope={dirty:y,ctx:m}),!l&&y[1]&256&&(l=!0,w.items=m[39],Ge(()=>l=!1)),!s&&y[1]&512&&(s=!0,w.actual_height=m[40],Ge(()=>s=!1)),!i&&y[1]&1024&&(i=!0,w.table_scrollbar_width=m[41],Ge(()=>i=!1)),!o&&y[1]&2048&&(o=!0,w.viewport=m[42],Ge(()=>o=!1)),!_&&y[1]&4096&&(_=!0,w.show_scroll_button=m[43],Ge(()=>_=!1)),t.$set(w)},i(m){u||(U(t.$$.fragment,m),u=!0)},o(m){Q(t.$$.fragment,m),u=!1},d(m){m&&je(e),We(t)}}}function ri(n){let e,t,l;return{c(){e=qe("button"),e.textContent="â",fe(e,"class","scroll-top-button svelte-18s8a4c")},m(s,i){Be(s,e,i),t||(l=Tt(e,"click",n[69]),t=!0)},p:Ei,d(s){s&&je(e),t=!1,l()}}}function _i(n){let e,t;return e=new na({props:{on_click:n[106]}}),{c(){Ue(e.$$.fragment)},m(l,s){Ye(e,l,s),t=!0},p:Ei,i(l){t||(U(e.$$.fragment,l),t=!0)},o(l){Q(e.$$.fragment,l),t=!1},d(l){We(e,l)}}}function ai(n){let e,t;return e=new Ya({props:{x:n[49]?.x??n[48]?.x??0,y:n[49]?.y??n[48]?.y??0,row:n[48]?-1:n[49]?.row??0,col_count:n[5],row_count:n[6],on_add_row_above:n[107],on_add_row_below:n[108],on_add_column_left:n[109],on_add_column_right:n[110],on_delete_row:n[111],on_delete_col:n[112],editable:n[9],can_delete_rows:!n[48]&&n[27].length>1&&n[9],can_delete_cols:n[27].length>0&&n[27][0]?.length>1&&n[9],i18n:n[12],on_sort:n[48]?n[113]:void 0,on_clear_sort:n[48]?n[114]:void 0,sort_direction:n[48]?n[36].sort_state.sort_columns.find(n[115])?.direction??null:null,sort_priority:n[48]&&n[36].sort_state.sort_columns.findIndex(n[116])+1||null}}),{c(){Ue(e.$$.fragment)},m(l,s){Ye(e,l,s),t=!0},p(l,s){const i={};s[1]&393216&&(i.x=l[49]?.x??l[48]?.x??0),s[1]&393216&&(i.y=l[49]?.y??l[48]?.y??0),s[1]&393216&&(i.row=l[48]?-1:l[49]?.row??0),s[0]&32&&(i.col_count=l[5]),s[0]&64&&(i.row_count=l[6]),s[1]&262144&&(i.on_add_row_above=l[107]),s[1]&262144&&(i.on_add_row_below=l[108]),s[1]&393216&&(i.on_add_column_left=l[109]),s[1]&393216&&(i.on_add_column_right=l[110]),s[1]&262144&&(i.on_delete_row=l[111]),s[1]&393216&&(i.on_delete_col=l[112]),s[0]&512&&(i.editable=l[9]),s[0]&134218240|s[1]&131072&&(i.can_delete_rows=!l[48]&&l[27].length>1&&l[9]),s[0]&134218240&&(i.can_delete_cols=l[27].length>0&&l[27][0]?.length>1&&l[9]),s[0]&4096&&(i.i18n=l[12]),s[1]&131072&&(i.on_sort=l[48]?l[113]:void 0),s[1]&131072&&(i.on_clear_sort=l[48]?l[114]:void 0),s[1]&131104&&(i.sort_direction=l[48]?l[36].sort_state.sort_columns.find(l[115])?.direction??null:null),s[1]&131104&&(i.sort_priority=l[48]&&l[36].sort_state.sort_columns.findIndex(l[116])+1||null),e.$set(i)},i(l){t||(U(e.$$.fragment,l),t=!0)},o(l){Q(e.$$.fragment,l),t=!1},d(l){We(e,l)}}}function Bu(n){let e,t,l,s,i,o,_,u,c=[],r=new qn,a,f,p,C,m=[],y=new qn,w,h,k,v,S,j,q,D,T,I,O=(n[3]&&n[3].length!==0&&n[4]||n[18]||n[19]||n[21]!=="none")&&Gs(n),K=n[3]&&n[3].length!==0&&Zs(n),F=n[15]&&$s(),ie=pt(n[26]);const oe=H=>H[140];for(let H=0;H<ie.length;H+=1){let L=Xs(n,ie,H),g=oe(L);r.set(g,c[H]=xs(g,L))}let W=n[15]&&ei(),ne=pt(n[51]);const z=H=>H[140];for(let H=0;H<ne.length;H+=1){let L=Js(n,ne,H),g=z(L);y.set(g,m[H]=ti(g,L))}function A(H){n[102](H)}let ce={upload:n[16],stream_handler:n[17],flex:!1,center:!1,boundedheight:!1,disable_click:!0,root:n[11],aria_label:n[12]("dataframe.drop_to_upload"),$$
5slots:{default:[ju]},$$scope:{ctx:n}};n[38]!==void 0&&(ce.dragging=n[38]),h=new yo({props:ce}),Re.push(()=>Qe(h,"dragging",A)),h.$on("load",n[103]);let G=n[43]&&ri(n),J=n[27].length===0&&n[9]&&n[6][1]==="dynamic"&&_i(n),Z=(n[49]||n[48])&&ai(n);return{c(){e=qe("div"),O&&O.c(),t=Fe(),l=qe("div"),s=qe("table"),K&&K.c(),i=Fe(),o=qe("thead"),_=qe("tr"),F&&F.c(),u=Fe();for(let H=0;H<c.length;H+=1)c[H].c();a=Fe(),f=qe("tbody"),p=qe("tr"),W&&W.c(),C=Fe();for(let H=0;H<m.length;H+=1)m[H].c();w=Fe(),Ue(h.$$.fragment),v=Fe(),G&&G.c(),S=Fe(),J&&J.c(),j=Fe(),Z&&Z.c(),q=sn(),fe(_,"class","svelte-18s8a4c"),fe(o,"class","svelte-18s8a4c"),fe(p,"class","svelte-18s8a4c"),fe(f,"class","svelte-18s8a4c"),fe(s,"class","svelte-18s8a4c"),fe(l,"class","table-wrap svelte-18s8a4c"),Vs(l,"height",n[40]+"px"),fe(l,"role","grid"),fe(l,"tabindex","0"),kt(l,"dragging",n[44]),kt(l,"no-wrap",!n[10]),kt(l,"menu-open",n[49]||n[48]),fe(e,"class","table-container svelte-18s8a4c")},m(H,L){Be(H,e,L),O&&O.m(e,null),me(e,t),me(e,l),me(l,s),K&&K.m(s,null),me(s,i),me(s,o),me(o,_),F&&F.m(_,null),me(_,u);for(let g=0;g<c.length;g+=1)c[g]&&c[g].m(_,null);me(s,a),me(s,f),me(f,p),W&&W.m(p,null),me(p,C);for(let g=0;g<m.length;g+=1)m[g]&&m[g].m(p,null);n[91](s),me(l,w),Ye(h,l,null),me(l,v),G&&G.m(l,null),n[104](l),Be(H,S,L),J&&J.m(H,L),Be(H,j,L),Z&&Z.m(H,L),Be(H,q,L),D=!0,T||(I=[Tt(Cu,"resize",n[85]),Tt(l,"keydown",n[105]),Tt(l,"mousemove",function(){Gn(n[46])&&n[46].apply(this,arguments)}),Tt(l,"mouseup",function(){Gn(n[45])&&n[45].apply(this,arguments)}),Tt(l,"mouseleave",function(){Gn(n[45])&&n[45].apply(this,arguments)})],T=!0)},p(H,L){n=H,n[3]&&n[3].length!==0&&n[4]||n[18]||n[19]||n[21]!=="none"?O?(O.p(n,L),L[0]&2883608&&U(O,1)):(O=Gs(n),O.c(),U(O,1),O.m(e,t)):O&&(et(),Q(O,1,1,()=>{O=null}),xe()),n[3]&&n[3].length!==0?K?K.p(n,L):(K=Zs(n),K.c(),K.m(s,i)):K&&(K.d(1),K=null),n[15]?F?L[0]&32768&&U(F,1):(F=$s(),F.c(),U(F,1),F.m(_,u)):F&&(et(),Q(F,1,1,()=>{F=null}),xe()),L[0]&80763553|L[1]&211812396|L[2]&8&&(ie=pt(n[26]),et(),c=Mn(c,L,oe,1,n,ie,r,_,En,xs,null,Xs),xe()),n[15]?W?L[0]&32768&&U(W,1):(W=ei(),W.c(),U(W,1),W.m(p,C)):W&&(et(),Q(W,1,1,()=>{W=null}),xe()),L[0]&268458628|L[1]&1056770|L[2]&3&&(ne=pt(n[51]),et(),m=Mn(m,L,z,1,n,ne,y,p,En,ti,null,Js),xe());const g={};L[0]&65536&&(g.upload=n[16]),L[0]&131072&&(g.stream_handler=n[17]),L[0]&2048&&(g.root=n[11]),L[0]&4096&&(g.aria_label=n[12]("dataframe.drop_to_upload")),L[0]&131137453|L[1]&3096367|L[4]&8388608&&(g.$$scope={dirty:L,ctx:n}),!k&&L[1]&128&&(k=!0,g.dragging=n[38],Ge(()=>k=!1)),h.$set(g),n[43]?G?G.p(n,L):(G=ri(n),G.c(),G.m(l,null)):G&&(G.d(1),G=null),(!D||L[1]&512)&&Vs(l,"height",n[40]+"px"),(!D||L[1]&8192)&&kt(l,"dragging",n[44]),(!D||L[0]&1024)&&kt(l,"no-wrap",!n[10]),(!D||L[1]&393216)&&kt(l,"menu-open",n[49]||n[48]),n[27].length===0&&n[9]&&n[6][1]==="dynamic"?J?(J.p(n,L),L[0]&134218304&&U(J,1)):(J=_i(n),J.c(),U(J,1),J.m(j.parentNode,j)):J&&(et(),Q(J,1,1,()=>{J=null}),xe()),n[49]||n[48]?Z?(Z.p(n,L),L[1]&393216&&U(Z,1)):(Z=ai(n),Z.c(),U(Z,1),Z.m(q.parentNode,q)):Z&&(et(),Q(Z,1,1,()=>{Z=null}),xe())},i(H){if(!D){U(O),U(F);for(let L=0;L<ie.length;L+=1)U(c[L]);U(W);for(let L=0;L<ne.length;L+=1)U(m[L]);U(h.$$.fragment,H),U(J),U(Z),D=!0}},o(H){Q(O),Q(F);for(let L=0;L<c.length;L+=1)Q(c[L]);Q(W);for(let L=0;L<m.length;L+=1)Q(m[L]);Q(h.$$.fragment,H),Q(J),Q(Z),D=!1},d(H){H&&(je(e),je(S),je(j),je(q)),O&&O.d(),K&&K.d(),F&&F.d();for(let L=0;L<c.length;L+=1)c[L].d();W&&W.d();for(let L=0;L<m.length;L+=1)m[L].d();n[91](null),We(h),G&&G.d(),n[104](null),J&&J.d(H),Z&&Z.d(H),T=!1,vu(I)}}}function qt(){return Math.random().toString(36).substring(2,15)}function Cl(n){return`var(--cell-width-${n})`}const zu=n=>{};function Du(n,e,t){let l,s,i,o,_,u,c,r,a,f,p,C,m,y,w,h,{datatype:k}=e,{label:v=null}=e,{show_label:S=!0}=e,{headers:j=[]}=e,{values:q=[]}=e,{col_count:D}=e,{row_count:T}=e,{latex_delimiters:I}=e,{components:O={}}=e,{editable:K=!0}=e,{wrap:F=!1}=e,{root:ie}=e,{i18n:oe}=e,{max_height:W=500}=e,{line_breaks:ne=!0}=e,{column_widths:z=[]}=e,{show_row_numbers:A=!1}=e,{upload:ce}=e,{stream_handler:G}=e,{show_fullscreen_button:J=!1}=e,{show_copy_button:Z=!1}=e,{value_is_output:H=!1}=e,{max_chars:L=void 0}=e,{show_search:g="none"}=e,{pinned_columns:M=0}=e,{static_columns:ye=[]}=e;const{state:Ne,actions:R}=$o({show_fullscreen_button:J,show_copy_button:Z,show_search:g,show_row_numbers:A,editable:K,pinned_columns:M,show_label:S,line_breaks:ne,wrap:F,max_height:W,column_widths:z,max_chars:L});wu(n,Ne,d=>t(36,h=d));let E=[],{display_value:V=null}=e,{styling:x=null}=e,Y={},yt={};const Ct=Eu();let Pe=!1,on=!1,zn=!1,Pt=!1,Sl;Us(()=>{Sl=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()+"40",document.documentElement.style.setProperty("--color-accent-copied",Sl)});const Mi=(d,B)=>P?.[d]?.[B]?.value;let Ae=kn(j,D,Y,qt),Kt=j,P=[[]],He,bt=[[]],Dn=Ae.map(d=>d.value),Tn=P.map(d=>d.map(B=>String(B.value)));function El(d,B){R.handle_sort(d,B),It(P,V,x)}function Ml(){R.reset_sort_state(),It(P,V,x)}async function qi(d,B=!1){!K||_===d||!K||D[1]!=="dynamic"||_===d||R.set_header_edit(d)}function Ai(d,B){d.target instanceof HTMLAnchorElement||(d.preventDefault(),d.stopPropagation(),K&&(t(24,Pe=!1),R.set_editing(!1),R.handle_header_click(B,K),$.focus()))}
5function Li(d){K&&(R.end_header_edit(d.detail.key),$.focus())}async function rn(d){if($.focus(),T[1]!=="dynamic")return;const B=Array(P[0]?.length||j.length).fill(0).map((N,re)=>{const we=qt();return t(23,Y[we]={cell:null,input:null},Y),{id:we,value:""}});P.length===0?t(27,P=[B]):d!==void 0&&d>=0&&d<=P.length?P.splice(d,0,B):P.push(B),t(27,P),t(1,q),t(80,He),t(29,$),t(23,Y),t(125,yt),t(75,V),t(36,h),t(76,x),t(28,$e),t(84,i=[d!==void 0?d:P.length-1,0])}async function ji(d){if($.focus(),D[1]!=="dynamic")return;const B=R.add_col(P,j,qt,d);B.data.forEach(N=>{N.forEach(re=>{Y[re.id]||t(23,Y[re.id]={cell:null,input:null},Y)})}),t(27,P=B.data),t(0,j=B.headers),await Mu(),requestAnimationFrame(()=>{qi(d!==void 0?d:P[0].length-1,!0);const N=$.querySelectorAll("tbody")[1].offsetWidth;$.querySelectorAll("table")[1].scrollTo({left:N})})}function ql(d){No(d,$)&&(R.clear_ui_state(),t(33,_=!1),t(34,u=!1))}let $e=[],$,_n,Hn=0,Rn=0;function zt(){const d=P[0]?.length||0;if(Hn===P.length&&Rn===d&&h.sort_state.sort_columns.length>0)return;Hn=P.length,Rn=d;const B=$e.map(N=>N?.clientWidth||0);if(B.length!==0){A&&$.style.setProperty("--cell-width-row-number",`${B[0]}px`);for(let N=0;N<50;N++)if(!z[N])$.style.removeProperty(`--cell-width-${N}`);else if(z[N].endsWith("%")){const re=parseFloat(z[N]),we=Math.floor(re/100*$.clientWidth);$.style.setProperty(`--cell-width-${N}`,`${we}px`)}else $.style.setProperty(`--cell-width-${N}`,z[N]);B.forEach((N,re)=>{if(!z[re]){const we=`${Math.max(N,45)}px`;$.style.setProperty(`--cell-width-${re}`,we)}})}}let Nn=q.slice(0,W/q.length*37).length*37+37,Pn=0;function It(d,B,N){const re=Wo(d,B,N,h.sort_state.sort_columns,i,Ro);t(27,P=re.data),t(84,i=re.selected)}let Al=!1;Us(()=>{const d=new IntersectionObserver(B=>{B.forEach(N=>{N.isIntersecting&&!Al&&(zt(),t(27,P),t(1,q),t(80,He),t(29,$),t(23,Y),t(125,yt),t(75,V),t(36,h),t(76,x),t(28,$e)),Al=N.isIntersecting})});return d.observe($),document.addEventListener("click",ql),window.addEventListener("resize",zl),document.addEventListener("fullscreenchange",Ll),()=>{d.disconnect(),document.removeEventListener("click",ql),window.removeEventListener("resize",zl),document.removeEventListener("fullscreenchange",Ll)}});function Bi(d,B,N){C.actions.toggle_cell_menu(d,B,N)}function zi(d){C.actions.handle_select_column(d)}function Di(d){C.actions.handle_select_row(d)}function Ti(){document.fullscreenElement?(document.exitFullscreen(),t(37,on=!1)):($.requestFullscreen(),t(37,on=!0))}function Ll(){t(37,on=!!document.fullscreenElement)}function Hi(d,B){if(d.stopPropagation(),r&&r.col===B)R.set_active_header_menu(null);else{const N=d.target.closest("th");if(N){const re=N.getBoundingClientRect();R.set_active_header_menu({col:B,x:re.right,y:re.bottom})}}}Su(()=>{t(72,H=!1)});function jl(d){if(D[1]!=="dynamic"||P[0].length<=1)return;const B=R.delete_col_at(P,j,d);t(27,P=B.data),t(0,j=B.headers),t(26,Ae=kn(j,D,Y,qt)),R.set_active_cell_menu(null),R.set_active_header_menu(null),R.set_selected(!1),R.set_selected_cells([]),R.set_editing(!1)}function Bl(d){t(27,P=R.delete_row_at(P,d)),R.set_active_cell_menu(null),R.set_active_header_menu(null)}function Ri(){if(h.current_search_query&&g==="filter"){const d=[],B=[],N=[];bt.forEach(we=>{const fn=[],Hl=[],Rl=[];we.forEach(hn=>{fn.push(hn.value),Hl.push(hn.display_value||String(hn.value)),Rl.push(hn.styling||"")}),d.push(fn),B.push(Hl),N.push(Rl)});const re={data:d,headers:Ae.map(we=>
5we.value),metadata:{display_value:B,styling:N}};Ct("change",re),H||Ct("input"),R.handle_search(null)}}let an,Kn=!1;function Ni(){an.scrollTo({top:0})}function zl(){R.set_active_cell_menu(null),R.set_active_header_menu(null),t(32,s=[]),t(84,i=!1),t(31,o=!1),zt()}function In(d,B){const N=B==="above"?d:d+1;rn(N),t(49,c=null),t(48,r=null)}function On(d,B){const N=B==="left"?d:d+1;ji(N),t(49,c=null),t(48,r=null)}function Pi(){R.reset_sort_state()}let un=!1,Dl=null,Tl=null;const cn={is_dragging:un,drag_start:Dl,mouse_down_pos:Tl};let Ot;function Ki(){t(83,Ot=gu(cn,d=>t(44,un=d),d=>R.set_selected_cells(d),d=>R.set_selected(d),(d,B,N)=>C.actions.handle_cell_click(d,B,N),A,$))}const Ii=()=>zt(),Oi=async()=>await fi(P,null),Fi=d=>R.handle_search(d.detail);function Vi(d,B){n.$$.not_equal(Ae[B].value,d)&&(Ae[B].value=d,t(26,Ae),t(0,j),t(79,Kt),t(5,D),t(23,Y))}function Ui(d,B){n.$$.not_equal(Y[B].input,d)&&(Y[B].input=d,t(23,Y))}function Wi(d,B){Re[d?"unshift":"push"](()=>{$e[B]=d,t(28,$e)})}function Yi(d){Re[d?"unshift":"push"](()=>{_n=d,t(30,_n)})}const Ji=(d,B,N)=>m(d,B,N);function Xi(d,B,N){n.$$.not_equal(bt[B][N].value,d)&&(bt[B][N].value=d,t(39,bt),t(36,h),t(27,P),t(76,x),t(1,q),t(80,He),t(29,$),t(23,Y),t(125,yt),t(75,V),t(28,$e))}function Gi(d,B){n.$$.not_equal(Y[B],d)&&(Y[B]=d,t(23,Y))}function Qi(d,B){n.$$.not_equal(Ae[B].value,d)&&(Ae[B].value=d,t(26,Ae),t(0,j),t(79,Kt),t(5,D),t(23,Y))}function Zi(d,B){n.$$.not_equal(Y[B].input,d)&&(Y[B].input=d,t(23,Y))}function $i(d){bt=d,t(39,bt),t(36,h),t(27,P),t(76,x),t(1,q),t(80,He),t(29,$),t(23,Y),t(125,yt),t(75,V),t(28,$e)}function xi(d){Nn=d,t(40,Nn)}function eo(d){Pn=d,t(41,Pn)}function to(d){an=d,t(42,an)}function no(d){Kn=d,t(43,Kn)}function lo(d){zn=d,t(38,zn)}const so=({detail:d})=>Go(d.data,B=>(t(26,Ae=kn(B.map(N=>N??""),D,Y,qt)),Ae),B=>{t(1,q=B)});function io(d){Re[d?"unshift":"push"](()=>{$=d,t(29,$)})}const oo=d=>mu(d,p),ro=()=>rn(),_o=()=>In(c?.row??-1,"above"),ao=()=>In(c?.row??-1,"below"),uo=()=>On(c?.col??r?.col??-1,"left"),co=()=>On(c?.col??r?.col??-1,"right"),fo=()=>Bl(c?.row??-1),ho=()=>jl(c?.col??r?.col??-1),mo=d=>{r&&(El(r.col,d),R.set_active_header_menu(null))},go=()=>{Ml(),R.set_active_header_menu(null)},bo=d=>d.col===(r?.col??-1),wo=d=>d.col===(r?.col??-1);return n.$$set=d=>{"datatype"in d&&t(2,k=d.datatype),"label"in d&&t(3,v=d.label),"show_label"in d&&t(4,S=d.show_label),"headers"in d&&t(0,j=d.headers),"values"in d&&t(1,q=d.values),"col_count"in d&&t(5,D=d.col_count),"row_count"in d&&t(6,T=d.row_count),"latex_delimiters"in d&&t(7,I=d.latex_delimiters),"components"in d&&t(8,O=d.components),"editable"in d&&t(9,K=d.editable),"wrap"in d&&t(10,F=d.wrap),"root"in d&&t(11,ie=d.root),"i18n"in d&&t(12,oe=d.i18n),"max_height"in d&&t(13,W=d.max_height),"line_breaks"in d&&t(14,ne=d.line_breaks),"column_widths"in d&&t(73,z=d.column_widths),"show_row_numbers"in d&&t(15,A=d.show_row_numbers),"upload"in d&&t(16,ce=d.upload),"stream_handler"in d&&t(17,G=d.stream_handler),"show_fullscreen_button"in d&&t(18,J=d.show_fullscreen_button),"show_copy_button"in d&&t(19,Z=d.show_copy_button),"value_is_output"in d&&t(72,H=d.value_is_output),"max_chars"in d&&t(20,L=d.max_chars),"show_search"in d&&t(21,g=d.show_search),"pinned_columns"in d&&t(74,M=d.pinned_columns),"static_columns"in d&&t(22,ye=d.static_columns),"display_value"in d&&t(75,V=d.display_value),"styling"in d&&t(76,x=d.styling)},n.$$.update=()=>{if(n.$$.dirty[0]&947912706|n.$$.dirty[1]&32|n.$$.dirty[2]&286720&&!vt(q,He)){if($){const N=q.length===0||q.length===1&&q[0].length===0,re=He!==void 0&&(q.length!==He.length||q[0]&&He[0]&&q[0].length!==He[0].length);if(N||re){for(let we=0;we<50;we++)$.style.removeProperty(`--cell-width-${we}`);Hn=0,Rn=0}}const d=q.length===0||q.length===1&&q[0].length===0,B=He!==void 0&&(q.length!==He.length||q[0]&&He[0]&&q[0].length!==He[0].length);t(27,P=ru(q,Y,yt,qt,V)),t(80,He=JSON.parse(JSON.stringify(q))),d||B?R.reset_sort_state():h.sort_state.sort_columns.length>0&&It(P,V,x),h.current_search_query&&R.handle_search(null),$&&$e.length>0&&zt()}if(n.$$.dirty[0]&134217728|n.$$.dirty[2]&4096&&t(52,l=M&&P?.[0]?.length?Math.min(M,P[0].length):0),n.$$.dirty[1]&32&&t(32,s=h.ui_state.selected_cells),n.$$.dirty[1]&32&&t(34,u=h.ui_state.selected_header),n.$$.dirty[1]&32&&t(33,_=h.ui_state.header_edit),n.$$.dirty[1]&32&&t(31,o=h.ui_state.editing),n.$$.dirty[1]&32&&t(84,i=h.ui_state.selected),n.$$.dirty[0]&8388641|n.$$.dirty[2]&131072&&(vt(j,Kt)||(t(26,Ae=kn(j,D,Y,qt)),t(79,Kt=JSON.parse(JSON.stringify(j))))),n.$$.dirty[0]&780141056|n.$$.dirty[1]&15|n.$$.dirty[2]&4194304&&t(35,p=Vo({selected_header:u,header_edit:_,editing:o,selected:i,selected_cells:s,editable:K,data:P,headers:Ae,els:Y,df_actions:R,dispatch:Ct,add_row:rn,get_next_cell_coordinates:To,get_range_selection:fl,move_cursor:Ho,copy_flash:Pt,parent_element:$,set_copy_flash:d=>{t(25,Pt=d),d&&setTimeout(()=>{t(25,Pt=!1)},800)}})),n.$$.dirty[0]&33554432|n.$$.dirty[1]&18|n.$$.dirty[2]&65536&&(Pt&&!vt(s,E)&&p?.set_copy_flash(!1),t(78,E=s)),n.$$.dirty[1]&32&&t(49,c=h.ui_state.active_cell_menu),n.$$.dirty[1]&32&&t(48,r=h.ui_state.active_header_menu),n.$$.dirty[0]&134217728|n.$$.dirty[1]&32|n.$$.dirty[2]&16384&&h.current_search_query!==void 0){const d=new Map;P.forEach((N,re)=>
5{N.forEach((we,fn)=>{d.set(we.id,{value:we.value,styling:x?.[re]?.[fn]||""})})});const B=R.filter_data(P);t(39,bt=B.map(N=>N.map(re=>{const we=d.get(re.id);return{...re,display_value:we?.display_value||String(re.value),styling:we?.styling||""}})))}if(n.$$.dirty[0]&201326592|n.$$.dirty[2]&1573888&&(P||Ae)&&(R.trigger_change(P,Ae,Tn,Dn,H,Ct),t(82,Tn=P.map(d=>d.map(B=>String(B.value)))),t(81,Dn=Ae.map(d=>d.value))),n.$$.dirty[0]&134217728|n.$$.dirty[2]&24576&&(R.sort_data(P,V,x),R.update_row_order(P)),n.$$.dirty[0]&134217728|n.$$.dirty[1]&32|n.$$.dirty[2]&24576&&h.sort_state.sort_columns&&h.sort_state.sort_columns.length>0&&It(P,V,x),n.$$.dirty[0]&134217728&&t(51,a=Yo(P)),n.$$.dirty[0]&268435456&&$e[0]&&$e[0]?.clientWidth&&zt(),n.$$.dirty[0]&134217728|n.$$.dirty[2]&24576&&It(P,V,x),n.$$.dirty[2]&4194304&&t(50,f=!!i&&i[0]),n.$$.dirty[0]&696287744|n.$$.dirty[1]&2&&(C=Oo({df_actions:R,dispatch:Ct,data:P,els:Y,editable:K,show_row_numbers:A,get_data_at:Mi,clear_on_focus:Pe,selected_cells:s,parent_element:$})),n.$$.dirty[2]&4194304,n.$$.dirty[0]&1753219072|n.$$.dirty[2]&4194304&&i!==!1){const d=Po(i,P,Y,$,_n);document.documentElement.style.setProperty("--selected-col-pos",d.col_pos),document.documentElement.style.setProperty("--selected-row-pos",d.row_pos||"0px")}n.$$.dirty[0]&536870912&&$&&Ki(),n.$$.dirty[2]&2097152&&t(47,m=Ot?.handle_mouse_down||(()=>{})),n.$$.dirty[2]&2097152&&t(46,y=Ot?.handle_mouse_move||(()=>{})),n.$$.dirty[2]&2097152&&t(45,w=Ot?.handle_mouse_up||(()=>{}))},t(44,un=cn.is_dragging),Dl=cn.drag_start,Tl=cn.mouse_down_pos,[j,q,k,v,S,D,T,I,O,K,F,ie,oe,W,ne,A,ce,G,J,Z,L,g,ye,Y,Pe,Pt,Ae,P,$e,$,_n,o,s,_,u,p,h,on,zn,bt,Nn,Pn,an,Kn,un,w,y,m,r,c,f,a,l,Ne,R,El,Ml,Ai,Li,rn,zt,Bi,zi,Di,Ti,Hi,jl,Bl,Ri,Ni,In,On,H,z,M,V,x,Pi,E,Kt,He,Dn,Tn,Ot,i,Ii,Oi,Fi,Vi,Ui,Wi,Yi,Ji,Xi,Gi,Qi,Zi,$i,xi,eo,to,no,lo,so,io,oo,ro,_o,ao,uo,co,fo,ho,mo,go,bo,wo]}class Tu extends bu{constructor(e){super(),pu(this,e,Du,Bu,yu,{datatype:2,label:3,show_label:4,headers:0,values:1,col_count:5,row_count:6,latex_delimiters:7,components:8,editable:9,wrap:10,root:11,i18n:12,max_height:13,line_breaks:14,column_widths:73,show_row_numbers:15,upload:16,stream_handler:17,show_fullscreen_button:18,show_copy_button:19,value_is_output:72,max_chars:20,show_search:21,pinned_columns:74,static_columns:22,display_value:75,styling:76,reset_sort_state:77},null,[-1,-1,-1,-1,-1])}get datatype(){return this.$$.ctx[2]}set datatype(e){this.$$set({datatype:e}),le()}get label(){return this.$$.ctx[3]}set label(e){this.$$set({label:e}),le()}get show_label(){return this.$$.ctx[4]}set show_label(e){this.$$set({show_label:e}),le()}get headers(){return this.$$.ctx[0]}set headers(e){this.$$set({headers:e}),le()}get values(){return this.$$.ctx[1]}set values(e){this.$$set({values:e}),le()}get col_count(){return this.$$.ctx[5]}set col_count(e){this.$$set({col_count:e}),le()}get row_count(){return this.$$.ctx[6]}set row_count(e){this.$$set({row_count:e}),le()}get latex_delimiters(){return this.$$.ctx[7]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),le()}get components(){return this.$$.ctx[8]}set components(e){this.$$set({components:e}),le()}get editable(){return this.$$.ctx[9]}set editable(e){this.$$set({editable:e}),le()}get wrap(){return this.$$.ctx[10]}set wrap(e){this.$$set({wrap:e}),le()}get root(){return this.$$.ctx[11]}set root(e){this.$$set({root:e}),le()}get i18n(){return this.$$.ctx[12]}set i18n(e){this.$$set({i18n:e}),le()}get max_height(){return this.$$.ctx[13]}set max_height(e){this.$$set({max_height:e}),le()}get line_breaks(){return this.$$.ctx[14]}set line_breaks(e){this.$$set({line_breaks:e}),le()}get column_widths(){return this.$$.ctx[73]}set column_widths(e){this.$$set({column_widths:e}),le()}get show_row_numbers(){return this.$$.ctx[15]}set show_row_numbers(e){this.$$set({show_row_numbers:e}),le()}get upload(){return this.$$.ctx[16]}set upload(e){this.$$set({upload:e}),le()}get stream_handler(){return this.$$.ctx[17]}set stream_handler(e){this.$$set({stream_handler:e}),le()}get show_fullscreen_button(){return this.$$.ctx[18]}set show_fullscreen_button(e){this.$$set({show_fullscreen_button:e}),le()}get show_copy_button(){return this.$$.ctx[19]}set show_copy_button(e){this.$$set({show_copy_button:e}),le()}get value_is_output(){return this.$$.ctx[72]}set value_is_output(e){this.$$set({value_is_output:e}),le()}get max_chars(){return this.$$.ctx[20]}set max_chars(e){this.$$set({max_chars:e}),le()}get show_search(){return this.$$.ctx[21]}set show_search(e){this.$$set({show_search:e}),le()}get pinned_columns(){return this.$$.ctx[74]}set pinned_columns(e){this.$$set({pinned_columns:e}),le()}get static_columns(){return this.$$.ctx[22]}set static_columns(e){this.$$set({static_columns:e}),le()}get display_value(){return this.$$.ctx[75]}set display_value(e){this.$$set({display_value:e}),le()}get styling(){return this.$$.ctx[76]}set styling(e){this.$$set({styling:e}),le()}get reset_sort_state(){return this.$$.ctx[77]}}const Hu=Tu,{SvelteComponent:Ru,add_flush_callback:Nu,assign:Pu,bind:Ku,binding_callbacks:Iu,create_component:rl,destroy_component:_l,detach:Ou,flush:te,get_spread_object:Fu,get_spread_update:Vu,init:Uu,insert:Wu,mount_component:al,safe_not_equal:Yu,space:Ju,transition_in:ul,transition_out:cl}=window.__gradio__svelte__internal;function Xu(n){let e,t,l,s,i;const o=[{autoscroll:n[16].autoscroll},{i18n:n[16].i18n},n[19]];let _={};for(let r=0;r<o.length;r+=1)_=Pu(_,o[r]);e=new qo({props:_}),e.$on("clear_status",n[32]);function u(r){n[35](r)}let c={root:n[13],label:n[7],show_label:n[8],row_count:n[6],col_count:n[5],values: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[33],stream_handler:n[34],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],components:{image:Ao},static_columns:n[27]};return n[1]!==void 0&&(c.value_is_output=n[1]),l=new Hu({props:c}),Iu.push(()=>Ku(l,"value_is_output",u)),l.$on("change",n[36]),l.$on("input",n[37]),l.$on("select",n[38]),{c(){rl(e.$$.fragment),t=Ju(),rl(l.$$.fragment)},m(r,a){al(e,r,a),Wu(r,t,a),al(l,r,a),i=!0},p(r,a){const f=a[0]&589824?Vu(o,[a[0]&65536&&{autoscroll:r[16].autoscroll},a[0]&65536&&{i18n:r[16].i18n},a[0]&524288&&Fu(r[19])]):{};e.$set(f);const p={};
5a[0]&8192&&(p.root=r[13]),a[0]&128&&(p.label=r[7]),a[0]&256&&(p.show_label=r[8]),a[0]&64&&(p.row_count=r[6]),a[0]&32&&(p.col_count=r[5]),a[0]&1&&(p.values=r[0].data),a[0]&536870912&&(p.display_value=r[29]),a[0]&268435456&&(p.styling=r[28]),a[0]&1073741824&&(p.headers=r[30]),a[0]&512&&(p.wrap=r[9]),a[0]&1024&&(p.datatype=r[10]),a[0]&131072&&(p.latex_delimiters=r[17]),a[0]&1048576&&(p.editable=r[20]),a[0]&262144&&(p.max_height=r[18]),a[0]&65536&&(p.i18n=r[16].i18n),a[0]&16384&&(p.line_breaks=r[14]),a[0]&32768&&(p.column_widths=r[15]),a[0]&65536&&(p.upload=r[33]),a[0]&65536&&(p.stream_handler=r[34]),a[0]&2097152&&(p.show_fullscreen_button=r[21]),a[0]&4194304&&(p.max_chars=r[22]),a[0]&8388608&&(p.show_copy_button=r[23]),a[0]&16777216&&(p.show_row_numbers=r[24]),a[0]&33554432&&(p.show_search=r[25]),a[0]&67108864&&(p.pinned_columns=r[26]),a[0]&134217728&&(p.static_columns=r[27]),!s&&a[0]&2&&(s=!0,p.value_is_output=r[1],Nu(()=>s=!1)),l.$set(p)},i(r){i||(ul(e.$$.fragment,r),ul(l.$$.fragment,r),i=!0)},o(r){cl(e.$$.fragment,r),cl(l.$$.fragment,r),i=!1},d(r){r&&Ou(t),_l(e,r),_l(l,r)}}}function Gu(n){let e,t;return e=new ko({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:[Xu]},$$scope:{ctx:n}}}),{c(){rl(e.$$.fragment)},m(l,s){al(e,l,s),t=!0},p(l,s){const i={};s[0]&16&&(i.visible=l[4]),s[0]&4&&(i.elem_id=l[2]),s[0]&8&&(i.elem_classes=l[3]),s[0]&2048&&(i.scale=l[11]),s[0]&4096&&(i.min_width=l[12]),s[0]&2147477475|s[1]&256&&(i.$$scope={dirty:s,ctx:l}),e.$set(i)},i(l){t||(ul(e.$$.fragment,l),t=!0)},o(l){cl(e.$$.fragment,l),t=!1},d(l){_l(e,l)}}}function Qu(n,e,t){let l,s,i,{headers:o=[]}=e,{elem_id:_=""}=e,{elem_classes:u=[]}=e,{visible:c=!0}=e,{value:r={data:[["","",""]],headers:["1","2","3"],metadata:null}}=e,{value_is_output:a=!1}=e,{col_count:f}=e,{row_count:p}=e,{label:C=null}=e,{show_label:m=!0}=e,{wrap:y}=e,{datatype:w}=e,{scale:h=null}=e,{min_width:k=void 0}=e,{root:v}=e,{line_breaks:S=!0}=e,{column_widths:j=[]}=e,{gradio:q}=e,{latex_delimiters:D}=e,{max_height:T=void 0}=e,{loading_status:I}=e,{interactive:O}=e,{show_fullscreen_button:K=!1}=e,{max_chars:F=void 0}=e,{show_copy_button:ie=!1}=e,{show_row_numbers:oe=!1}=e,{show_search:W="none"}=e,{pinned_columns:ne=0}=e,{static_columns:z=[]}=e;const A=()=>q.dispatch("clear_status",I),ce=(...g)=>q.client.upload(...g),G=(...g)=>q.client.stream(...g);function J(g){a=g,t(1,a)}const Z=g=>{t(0,r.data=g.detail.data,r),t(0,r.headers=g.detail.headers,r),q.dispatch("change")},H=g=>q.dispatch("input"),L=g=>q.dispatch("select",g.detail);return n.$$set=g=>{"headers"in g&&t(31,o=g.headers),"elem_id"in g&&t(2,_=g.elem_id),"elem_classes"in g&&t(3,u=g.elem_classes),"visible"in g&&t(4,c=g.visible),"value"in g&&t(0,r=g.value),"value_is_output"in g&&t(1,a=g.value_is_output),"col_count"in g&&t(5,f=g.col_count),"row_count"in g&&t(6,p=g.row_count),"label"in g&&t(7,C=g.label),"show_label"in g&&t(8,m=g.show_label),"wrap"in g&&t(9,y=g.wrap),"datatype"in g&&t(10,w=g.datatype),"scale"in g&&t(11,h=g.scale),"min_width"in g&&t(12,k=g.min_width),"root"in g&&t(13,v=g.root),"line_breaks"in g&&t(14,S=g.line_breaks),"column_widths"in g&&t(15,j=g.column_widths),"gradio"in g&&t(16,q=g.gradio),"latex_delimiters"in g&&t(17,D=g.latex_delimiters),"max_height"in g&&t(18,T=g.max_height),"loading_status"in g&&t(19,I=g.loading_status),"interactive"in g&&t(20,O=g.interactive),"show_fullscreen_button"in g&&t(21,K=g.show_fullscreen_button),"max_chars"in g&&t(22,F=g.max_chars),"show_copy_button"in g&&t(23,ie=g.show_copy_button),"show_row_numbers"in g&&t(24,oe=g.show_row_numbers),"show_search"in g&&t(25,W=g.show_search),"pinned_columns"in g&&t(26,ne=g.pinned_columns),"static_columns"in g&&t(27,z=g.static_columns)},n.$$.update=()=>{n.$$.dirty[0]&1|n.$$.dirty[1]&1&&t(30,l=[...r.headers||o]),n.$$.dirty[0]&1&&t(29,s=r?.metadata?.display_value?[...r?.metadata?.display_value]:null),n.$$.dirty[0]&1048577&&t(28,i=!O&&r?.metadata?.styling?[...r?.metadata?.styling]:null)},[r,a,_,u,c,f,p,C,m,y,w,h,k,v,S,j,q,D,T,I,O,K,F,ie,oe,W,ne,z,i,s,l,o,A,ce,G,J,Z,H,L]}class Fc extends Ru{constructor(e){super(),Uu(this,e,Qu,Gu,Yu,{headers:31,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,static_columns:27},null,[-1,-1])}get headers(){return this.$$.ctx[31]}set headers(e){this.$$set({headers:e}),te()}get elem_id(){return this.$$.ctx[2]}set elem_id(e){this.$$set({elem_id:e}),te()}get elem_classes(){return this.$$.ctx[3]}set elem_classes(e){this.$$set({elem_classes:e}),te()}get visible(){return this.$$.ctx[4]}set visible(e){this.$$set({visible:e}),te()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),te()}get value_is_output(){return this.$$.ctx[1]}set value_is_output(e){this.$$set({value_is_output:e}),te()}get col_count(){return this.$$.ctx[5]}set col_count(e){this.$$set({col_count:e}),te()}get row_count(){return this.$$.ctx[6]}set row_count(e){this.$$set({row_count:e}),te()}get label(){return this.$$.ctx[7]}set label(e){this.$$set({label:e}),te()}get show_label(){return this.$$.ctx[8]}set show_label(e){this.$$set({show_label:e}),te()}get wrap(){return this.$$.ctx[9]}set wrap(e){this.$$set({wrap:e}),te()}get datatype(){return this.$$.ctx[10]}set datatype(e){this.$$set({datatype:e}),te()}get scale(){return this.$$.ctx[11]}set scale(e){this.$$set({scale:e}),te()}get min_width(){return this.$$.ctx[12]}set min_width(e){this.$$set({min_width:e}),te()}get root(){return this.$$.ctx[13]}set root(e){this.$$set({root:e}),te()}get line_breaks(){return this.$$.ctx[14]}set line_breaks(e){this.$$set({line_breaks:e}),te()}get column_widths(){return this.$$.ctx[15]}set column_widths(e){this.$$set({column_widths:e}),te()}get gradio(){return this.$$.ctx[16]}set gradio(e){this.$$set({gradio:e}),te()}get latex_delimiters(){return this.$$.ctx[17]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),te()}get max_height(){return this.$$.ctx[18]}set max_height(e){this.$$set({max_height:e}),te()}get loading_status(){return this.$$.ctx[19]}set loading_status(e){this.$$set({loading_status:e}),te()}get interactive(){return this.$$.ctx[20]}set interactive(e){this.$$set({interactive:e}),te()}get show_fullscreen_button(){return this.$$.ctx[21]}set show_fullscreen_button(e){this.$$set({show_fullscreen_button:e}),te()}get max_chars(){return this.$$.ctx[22]}set max_chars(e){this.$$set({max_chars:e}),te()}get show_copy_button(){return this.$$.ctx[23]}set show_copy_button(e){this.$$set({show_copy_button:e}),te()}get show_row_numbers(){return this.$$.ctx[24]}set show_row_numbers(e){this.$$set({show_row_numbers:e}),te()}get show_search(){return this.$$.ctx[25]}set show_search(e){this.$$set({show_search:e}),te()}get pinned_columns(){return this.$$.ctx[26]}set pinned_columns(e){this.$$set({pinned_columns:e}),te()}get static_columns(){return this.$$.ctx[27]}set static_columns(e){this.$$set({static_columns:e}),te()}}export{Hu as BaseDataFrame,Wc as BaseExample,Fc as default}; 6//# sourceMappingURL=Index-DwYnKh0M.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.