PageSourceSearch

https://rizavelioglu-tryoffdiff.hf.space/assets/Index-DL7Tckdq.js

js rizavelioglu-tryoffdiff.hf.space collected 2026-10-03 10:22:32 UTC 127,368 bytes, 6 lines download raw bytes

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