import{B as Se}from"./Block-DZqtZLFP.js";import"./MarkdownCode.svelte_svelte_type_style_lang-3tofWDHK.js";import"./IconButtonWrapper.svelte_svelte_type_style_lang-BOpxTcdu.js";/* empty css */import"./StreamingBar.svelte_svelte_type_style_lang-CDNxkBIr.js";import Ye from"./Example-Cx2SdskM.js";import"./prism-python-qapVsvY8.js";import"./index-C7PS0jJm.js";import"./svelte/svelte.js";/* empty css */const{SvelteComponent:De,append:z,assign:Q,attr:d,check_outros:E,construct_svelte_component:T,create_component:S,destroy_component:Y,destroy_each:G,detach:q,element:B,empty:J,ensure_array_like:M,flush:v,get_spread_object:U,get_spread_update:V,group_outros:P,init:Fe,insert:N,listen:R,mount_component:D,noop:Ge,null_to_empty:ie,run_all:Ne,safe_not_equal:Je,set_data:le,set_style:oe,space:I,svg_element:re,text:W,toggle_class:fe,transition_in:b,transition_out:k}=window.__gradio__svelte__internal;function _e(s,e,l){const t=s.slice();return t[39]=e[l],t}function ce(s,e,l){const t=s.slice();return t[42]=e[l],t[44]=l,t}function ue(s,e,l){const t=s.slice();t[0]=e[l].value,t[46]=e[l].component,t[49]=l;const n=t[1][t[49]];return t[47]=n,t}function ae(s,e,l){const t=s.slice();return t[50]=e[l],t}function me(s,e,l){const t=s.slice();return t[42]=e[l],t[44]=l,t}function he(s){let e,l,t,n,o;return{c(){e=B("div"),l=re("svg"),t=re("path"),n=I(),o=W(s[4]),d(t,"fill","currentColor"),d(t,"d","M10 6h18v2H10zm0 18h18v2H10zm0-9h18v2H10zm-6 0h2v2H4zm0-9h2v2H4zm0 18h2v2H4z"),d(l,"xmlns","http://www.w3.org/2000/svg"),d(l,"xmlns:xlink","http://www.w3.org/1999/xlink"),d(l,"aria-hidden","true"),d(l,"role","img"),d(l,"width","1em"),d(l,"height","1em"),d(l,"preserveAspectRatio","xMidYMid meet"),d(l,"viewBox","0 0 32 32"),d(l,"class","svelte-p5q82i"),d(e,"class","label svelte-p5q82i")},m(f,i){N(f,e,i),z(e,l),z(l,t),z(e,n),z(e,o)},p(f,i){i[0]&16&&le(o,f[4])},d(f){f&&q(e)}}}function Ke(s){let e,l,t,n,o,f,i,r=M(s[6]),_=[];for(let c=0;ck(u[c],1,1,()=>{u[c]=null});return{c(){e=B("div"),l=B("table"),t=B("thead"),n=B("tr");for(let c=0;c<_.length;c+=1)_[c].c();o=I(),f=B("tbody");for(let c=0;ck(n[f],1,1,()=>{n[f]=null});return{c(){e=B("div");for(let f=0;f{Y(m,1)}),E()}f?(l=T(f,i(r,_)),S(l.$$.fragment),b(l.$$.fragment,1),D(l,e,null)):l=null}else if(f){const m=_[0]&11536388?V(o,[_[0]&4&&U(r[2][r[49]]),_[0]&2097152&&{value:r[0]},_[0]&8388608&&{samples_dir:r[23]},o[3],_[0]&1048576&&{selected:r[20]===r[44]},o[5],_[0]&2048&&{root:r[11]}]):{};l.$set(m)}(!n||_[0]&2)&&oe(e,"max-width",r[47]==="textbox"?"35ch":"auto"),(!n||_[0]&2&&t!==(t=ie(r[47])+" svelte-p5q82i"))&&d(e,"class",t)},i(r){n||(l&&b(l.$$.fragment,r),n=!0)},o(r){l&&k(l.$$.fragment,r),n=!1},d(r){r&&q(e),l&&Y(l)}}}function de(s){let e=s[47]!==void 0&&s[3].get(s[47])!==void 0,l,t,n=e&&pe(s);return{c(){n&&n.c(),l=J()},m(o,f){n&&n.m(o,f),N(o,l,f),t=!0},p(o,f){f[0]&10&&(e=o[47]!==void 0&&o[3].get(o[47])!==void 0),e?n?(n.p(o,f),f[0]&10&&b(n,1)):(n=pe(o),n.c(),b(n,1),n.m(l.parentNode,l)):n&&(P(),k(n,1,1,()=>{n=null}),E())},i(o){t||(b(n),t=!0)},o(o){k(n),t=!1},d(o){o&&q(l),n&&n.d(o)}}}function be(s){let e,l,t,n,o,f=M(s[42]),i=[];for(let u=0;uk(i[u],1,1,()=>{i[u]=null});function _(){return s[34](s[44])}function m(){return s[35](s[44])}return{c(){e=B("tr");for(let u=0;u{m[w]=null}),E()),~t?(n=m[t],n?n.p(s,g):(n=m[t]=_[t](s),n.c()),b(n,1),n.m(e,o)):n=null)},i(p){f||(b(n),f=!0)},o(p){k(n),f=!1},d(p){p&&q(e),~t&&m[t].d(),i=!1,Ne(r)}}}function Oe(s){let e,l,t;const n=[s[2][0],{value:s[42][0]},{samples_dir:s[23]},{type:"gallery"},{selected:s[20]===s[44]},{index:s[44]},{root:s[11]}];var o=s[21][0][0].component;function f(i,r){let _={};for(let m=0;m{Y(_,1)}),E()}o?(e=T(o,f(i,r)),S(e.$$.fragment),b(e.$$.fragment,1),D(e,l.parentNode,l)):e=null}else if(o){const _=r[0]&9701380?V(n,[r[0]&4&&U(i[2][0]),r[0]&262144&&{value:i[42][0]},r[0]&8388608&&{samples_dir:i[23]},n[3],r[0]&1048576&&{selected:i[20]===i[44]},n[5],r[0]&2048&&{root:i[11]}]):{};e.$set(_)}},i(i){t||(e&&b(e.$$.fragment,i),t=!0)},o(i){e&&k(e.$$.fragment,i),t=!1},d(i){i&&q(l),e&&Y(e,i)}}}function Qe(s){let e,l;return e=new Ye({props:{value:s[42][0],selected:s[20]===s[44],type:"gallery"}}),{c(){S(e.$$.fragment)},m(t,n){D(e,t,n),l=!0},p(t,n){const o={};n[0]&262144&&(o.value=t[42][0]),n[0]&1048576&&(o.selected=t[20]===t[44]),e.$set(o)},i(t){l||(b(e.$$.fragment,t),l=!0)},o(t){k(e.$$.fragment,t),l=!1},d(t){Y(e,t)}}}function ve(s){let e,l,t=s[42][0]!=null&&ke(s);return{c(){t&&t.c(),e=J()},m(n,o){t&&t.m(n,o),N(n,e,o),l=!0},p(n,o){n[42][0]!=null?t?(t.p(n,o),o[0]&262144&&b(t,1)):(t=ke(n),t.c(),b(t,1),t.m(e.parentNode,e)):t&&(P(),k(t,1,1,()=>{t=null}),E())},i(n){l||(b(t),l=!0)},o(n){k(t),l=!1},d(n){n&&q(e),t&&t.d(n)}}}function we(s){let e,l,t=M(s[19]),n=[];for(let o=0;o0?1:-1}~(l=m(s))&&(t=_[l]=r[l](s));let u=s[17]&&we(s);return{c(){i&&i.c(),e=I(),t&&t.c(),n=I(),u&&u.c(),o=J()},m(h,c){i&&i.m(h,c),N(h,e,c),~l&&_[l].m(h,c),N(h,n,c),u&&u.m(h,c),N(h,o,c),f=!0},p(h,c){h[5]?i?i.p(h,c):(i=he(h),i.c(),i.m(e.parentNode,e)):i&&(i.d(1),i=null);let p=l;l=m(h),l===p?~l&&_[l].p(h,c):(t&&(P(),k(_[p],1,1,()=>{_[p]=null}),E()),~l?(t=_[l],t?t.p(h,c):(t=_[l]=r[l](h),t.c()),b(t,1),t.m(n.parentNode,n)):t=null),h[17]?u?u.p(h,c):(u=we(h),u.c(),u.m(o.parentNode,o)):u&&(u.d(1),u=null)},i(h){f||(b(t),f=!0)},o(h){k(t),f=!1},d(h){h&&(q(e),q(n),q(o)),i&&i.d(h),~l&&_[l].d(h),u&&u.d(h)}}}function We(s){let e,l;return e=new Se({props:{visible:s[10],padding:!1,elem_id:s[8],elem_classes:s[9],scale:s[13],min_width:s[14],allow_overflow:!1,container:!1,$$slots:{default:[Ve]},$$scope:{ctx:s}}}),{c(){S(e.$$.fragment)},m(t,n){D(e,t,n),l=!0},p(t,n){const o={};n[0]&1024&&(o.visible=t[10]),n[0]&256&&(o.elem_id=t[8]),n[0]&512&&(o.elem_classes=t[9]),n[0]&8192&&(o.scale=t[13]),n[0]&16384&&(o.min_width=t[14]),n[0]&8362239|n[1]&4194304&&(o.$$scope={dirty:n,ctx:t}),e.$set(o)},i(t){l||(b(e.$$.fragment,t),l=!0)},o(t){k(e.$$.fragment,t),l=!1},d(t){Y(e,t)}}}function Xe(s,e,l){let t,{components:n}=e,{component_props:o}=e,{component_map:f}=e,{label:i="Examples"}=e,{show_label:r=!0}=e,{headers:_}=e,{samples:m=null}=e,u=null,{sample_labels:h=null}=e,{elem_id:c=""}=e,{elem_classes:p=[]}=e,{visible:g=!0}=e,{value:w=null}=e,{root:X}=e,{proxy_url:K}=e,{samples_per_page:C=10}=e,{scale:te=null}=e,{min_width:ne=void 0}=e,{gradio:F}=e,{layout:Z=null}=e,ze=K?`/proxy=${K}file=`:`${X}/file=`,j=0,y=m?m.length>C:!1,L,O,A=[],$=-1;function x(a){l(20,$=a)}function ee(){l(20,$=-1)}let se=[];async function Be(a){l(21,se=await Promise.all(a&&a.map(async H=>await Promise.all(H.map(async(Ie,Re)=>({value:Ie,component:(await f.get(n[Re]))?.default}))))))}const He=(a,H)=>{l(0,w=a+j*C),F.dispatch("click",w),F.dispatch("select",{index:w,value:H})},Me=a=>x(a),Ce=()=>ee(),Ee=a=>{l(0,w=a+j*C),F.dispatch("click",w)},Pe=a=>x(a),je=()=>ee(),Ae=a=>l(16,j=a);return s.$$set=a=>{"components"in a&&l(1,n=a.components),"component_props"in a&&l(2,o=a.component_props),"component_map"in a&&l(3,f=a.component_map),"label"in a&&l(4,i=a.label),"show_label"in a&&l(5,r=a.show_label),"headers"in a&&l(6,_=a.headers),"samples"in a&&l(26,m=a.samples),"sample_labels"in a&&l(7,h=a.sample_labels),"elem_id"in a&&l(8,c=a.elem_id),"elem_classes"in a&&l(9,p=a.elem_classes),"visible"in a&&l(10,g=a.visible),"value"in a&&l(0,w=a.value),"root"in a&&l(11,X=a.root),"proxy_url"in a&&l(27,K=a.proxy_url),"samples_per_page"in a&&l(12,C=a.samples_per_page),"scale"in a&&l(13,te=a.scale),"min_width"in a&&l(14,ne=a.min_width),"gradio"in a&&l(15,F=a.gradio),"layout"in a&&l(28,Z=a.layout)},s.$$.update=()=>{s.$$.dirty[0]&268435586&&l(22,t=(n.length<2||h!==null)&&Z!=="table"),s.$$.dirty[0]&1678446720&&(h?l(26,m=h.map(a=>[a])):m||l(26,m=[]),m!==u&&(l(16,j=0),l(29,u=m)),l(17,y=m.length>C),y?(l(19,A=[]),l(18,L=m.slice(j*C,(j+1)*C)),l(30,O=Math.ceil(m.length/C)),[0,j,O-1].forEach(a=>{for(let H=a-2;H<=a+2;H++)H>=0&&H0&&H-A[A.length-1]>1&&A.push(-1),A.push(H))})):l(18,L=m.slice())),s.$$.dirty[0]&262152&&Be(L)},[w,n,o,f,i,r,_,h,c,p,g,X,C,te,ne,F,j,y,L,A,$,se,t,ze,x,ee,m,K,Z,u,O,He,Me,Ce,Ee,Pe,je,Ae]}class ol extends De{constructor(e){super(),Fe(this,e,Xe,We,Je,{components:1,component_props:2,component_map:3,label:4,show_label:5,headers:6,samples:26,sample_labels:7,elem_id:8,elem_classes:9,visible:10,value:0,root:11,proxy_url:27,samples_per_page:12,scale:13,min_width:14,gradio:15,layout:28},null,[-1,-1])}get components(){return this.$$.ctx[1]}set components(e){this.$$set({components:e}),v()}get component_props(){return this.$$.ctx[2]}set component_props(e){this.$$set({component_props:e}),v()}get component_map(){return this.$$.ctx[3]}set component_map(e){this.$$set({component_map:e}),v()}get label(){return this.$$.ctx[4]}set label(e){this.$$set({label:e}),v()}get show_label(){return this.$$.ctx[5]}set show_label(e){this.$$set({show_label:e}),v()}get headers(){return this.$$.ctx[6]}set headers(e){this.$$set({headers:e}),v()}get samples(){return this.$$.ctx[26]}set samples(e){this.$$set({samples:e}),v()}get sample_labels(){return this.$$.ctx[7]}set sample_labels(e){this.$$set({sample_labels:e}),v()}get elem_id(){return this.$$.ctx[8]}set elem_id(e){this.$$set({elem_id:e}),v()}get elem_classes(){return this.$$.ctx[9]}set elem_classes(e){this.$$set({elem_classes:e}),v()}get visible(){return this.$$.ctx[10]}set visible(e){this.$$set({visible:e}),v()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),v()}get root(){return this.$$.ctx[11]}set root(e){this.$$set({root:e}),v()}get proxy_url(){return this.$$.ctx[27]}set proxy_url(e){this.$$set({proxy_url:e}),v()}get samples_per_page(){return this.$$.ctx[12]}set samples_per_page(e){this.$$set({samples_per_page:e}),v()}get scale(){return this.$$.ctx[13]}set scale(e){this.$$set({scale:e}),v()}get min_width(){return this.$$.ctx[14]}set min_width(e){this.$$set({min_width:e}),v()}get gradio(){return this.$$.ctx[15]}set gradio(e){this.$$set({gradio:e}),v()}get layout(){return this.$$.ctx[28]}set layout(e){this.$$set({layout:e}),v()}}export{ol as default}; //# sourceMappingURL=Index-D1EtuDcH.js.map