PageSourceSearch

https://neongeckocom-brainforge-demo.hf.space/assets/Blocks-BMC4HgbM.js

js neongeckocom-brainforge-demo.hf.space collected 2026-10-03 10:24:32 UTC 120,626 bytes, 109 lines download raw bytes

vendor: 47,153 bytes, lines 1-64
1import{$ as Cn,s as Vl,l as Wo,q as Zo,d as Jo,o as rs,b as Qo,r as Yo,c as Ko,p as as,A as cs}from"./index-Do3LSwBC.js";import{B as tl}from"./Button-D62RTh6z.js";import{L as to}from"./index-Dk7BRz4q.js";import"./IconButtonWrapper.svelte_svelte_type_style_lang-Dn324h3u.js";import"./MarkdownCode.svelte_svelte_type_style_lang-C4fBIMNi.js";import"./StreamingBar.svelte_svelte_type_style_lang-CDNxkBIr.js";import{B as St}from"./Block-CygNNd5z.js";import{c as Xo}from"./Dropdown-DSZkNuau.js";/* empty css                                              */import{T as xo}from"./Toast-7aPQ8_ya.js";import{G as er}from"./utils-BsGrhMNe.js";import"./svelte/svelte.js";import"./Image-CnqB5dbD.js";import"./file-url-DoxvUUVV.js";import"./DownloadLink.svelte_svelte_type_style_lang-C_5UIfol.js";/* empty css                                                   */import"./IconButton-DSs-aBrk.js";import"./Clear-By3xiIwg.js";import"./prism-python-Cp7Xa0u5.js";import"./index-KfiBD3Sx.js";import"./BlockTitle-Bznni5NZ.js";import"./Info-B6Y9MYYe.js";import"./MarkdownCode-qms8blzp.js";import"./DropdownArrow-CFmkDyPW.js";const{SvelteComponent:tr,append:gl,attr:ft,detach:nr,init:lr,insert:sr,noop:bl,safe_not_equal:ir,set_style:hn,svg_element:Pn}=window.__gradio__svelte__internal;function or(l){let e,t,n,s;return{c(){e=Pn("svg"),t=Pn("g"),n=Pn("path"),s=Pn("path"),ft(n,"d","M3.789,0.09C3.903,-0.024 4.088,-0.024 4.202,0.09L4.817,0.705C4.931,0.819 4.931,1.004 4.817,1.118L1.118,4.817C1.004,4.931 0.819,4.931 0.705,4.817L0.09,4.202C-0.024,4.088 -0.024,3.903 0.09,3.789L3.789,0.09Z"),ft(s,"d","M4.825,3.797C4.934,3.907 4.934,4.084 4.825,4.193L4.193,4.825C4.084,4.934 3.907,4.934 3.797,4.825L0.082,1.11C-0.027,1.001 -0.027,0.823 0.082,0.714L0.714,0.082C0.823,-0.027 1.001,-0.027 1.11,0.082L4.825,3.797Z"),ft(e,"width","100%"),ft(e,"height","100%"),ft(e,"viewBox","0 0 5 5"),ft(e,"version","1.1"),ft(e,"xmlns","http://www.w3.org/2000/svg"),ft(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),ft(e,"xml:space","preserve"),hn(e,"fill","currentColor"),hn(e,"fill-rule","evenodd"),hn(e,"clip-rule","evenodd"),hn(e,"stroke-linejoin","round"),hn(e,"stroke-miterlimit","2")},m(i,o){sr(i,e,o),gl(e,t),gl(t,n),gl(t,s)},p:bl,i:bl,o:bl,d(i){i&&nr(e)}}}class Wl extends tr{constructor(e){super(),lr(this,e,null,or,ir,{})}}const{SvelteComponent:rr,append:$t,attr:On,create_component:ar,destroy_component:cr,detach:vl,element:Yt,flush:_r,init:ur,insert:$l,listen:fr,mount_component:pr,safe_not_equal:mr,set_data:dr,space:kl,text:_s,transition_in:hr,transition_out:gr}=window.__gradio__svelte__internal,{createEventDispatcher:br}=window.__gradio__svelte__internal;function vr(l){let e,t,n,s,i,o,a,c,r,_,u,f,p,g,h;return f=new Wl({}),{c(){e=Yt("div"),t=Yt("h1"),t.textContent="API Docs",n=kl(),s=Yt("p"),i=_s(`No API Routes found for
2		`),o=Yt("code"),a=_s(l[0]),c=kl(),r=Yt("p"),r.innerHTML=`To expose an API endpoint of your app in this page, set the <code>api_name</code>
3		parameter of the event listener.
4		<br/>
5		For more information, visit the
6		<a href="https://gradio.app/sharing_your_app/#api-page" target="_blank">API Page guide</a>
7		. To hide the API documentation button and this page, set
8		<code>show_api=False</code>
9		in the
10		<code>Blocks.launch()</code>
11		method.`,_=kl(),u=Yt("button"),ar(f.$$.fragment),On(o,"class","svelte-e1ha0f"),On(s,"class","attention svelte-e1ha0f"),On(e,"class","wrap prose svelte-e1ha0f"),On(u,"class","svelte-e1ha0f")},m($,m){$l($,e,m),$t(e,t),$t(e,n),$t(e,s),$t(s,i),$t(s,o),$t(o,a),$t(e,c),$t(e,r),$l($,_,m),$l($,u,m),pr(f,u,null),p=!0,g||(h=fr(u,"click",l[2]),g=!0)},p($,[m]){(!p||m&1)&&dr(a,$[0])},i($){p||(hr(f.$$.fragment,$),p=!0)},o($){gr(f.$$.fragment,$),p=!1},d($){$&&(vl(e),vl(_),vl(u)),cr(f),g=!1,h()}}}function $r(l,e,t){const n=br();let{root:s}=e;const i=()=>n("close");return l.$$set=o=>{"root"in o&&t(0,s=o.root)},[s,n,i]}class kr extends rr{constructor(e){super(),ur(this,e,$r,vr,mr,{root:0})}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),_r()}}const no="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M26.9425%202.94265C27.4632%202.42195%2027.4632%201.57773%2026.9425%201.05703C26.4218%200.536329%2025.5776%200.536329%2025.0569%201.05703L22.5713%203.54256C21.1213%202.59333%2019.5367%202.43378%2018.1753%202.64006C16.5495%202.88638%2015.1127%203.66838%2014.3905%204.39053L12.3905%206.39053C12.1405%206.64058%2012%206.97972%2012%207.33334C12%207.68697%2012.1405%208.0261%2012.3905%208.27615L19.7239%2015.6095C20.2446%2016.1302%2021.0888%2016.1302%2021.6095%2015.6095L23.6095%2013.6095C24.3316%2012.8873%2025.1136%2011.4505%2025.36%209.82475C25.5663%208.46312%2025.4066%206.87827%2024.4571%205.42807L26.9425%202.94265Z'%20fill='%233c4555'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.276%2012.9426C12.7967%2012.4219%2012.7967%2011.5777%2012.276%2011.057C11.7553%2010.5363%2010.9111%2010.5363%2010.3904%2011.057L8.66651%2012.7809L8.27615%2012.3905C8.0261%2012.1405%207.68697%2012%207.33334%2012C6.97972%2012%206.64058%2012.1405%206.39053%2012.3905L4.39053%2014.3905C3.66838%2015.1127%202.88638%2016.5495%202.64006%2018.1753C2.43377%2019.5367%202.59333%2021.1214%203.54262%2022.5714L1.05703%2025.057C0.536329%2025.5777%200.536329%2026.4219%201.05703%2026.9426C1.57773%2027.4633%202.42195%2027.4633%202.94265%2026.9426L5.42817%2024.4571C6.87835%2025.4066%208.46315%2025.5663%209.82475%2025.36C11.4505%2025.1136%2012.8873%2024.3316%2013.6095%2023.6095L15.6095%2021.6095C16.1302%2021.0888%2016.1302%2020.2446%2015.6095%2019.7239L15.2188%2019.3332L16.9426%2017.6093C17.4633%2017.0886%2017.4633%2016.2444%2016.9426%2015.7237C16.4219%2015.203%2015.5777%2015.203%2015.057%2015.7237L13.3332%2017.4475L10.5521%2014.6665L12.276%2012.9426Z'%20fill='%23FF7C00'/%3e%3c/svg%3e",{SvelteComponent:wr,append:De,attr:nt,check_outros:yr,create_component:lo,destroy_component:so,detach:dt,element:lt,empty:Cr,flush:wl,group_outros:qr,init:Sr,insert:ht,listen:Er,mount_component:io,noop:Nr,safe_not_equal:jr,set_data:us,space:Kt,src_url_equal:Lr,text:tn,transition_in:kn,transition_out:Bn}=window.__gradio__svelte__internal,{createEventDispatcher:zr}=window.__gradio__svelte__internal;function fs(l){let e,t;return e=new tl({props:{size:"sm",variant:"secondary",elem_id:"start-api-recorder",$$slots:{default:[Tr]},$$scope:{ctx:l}}}),e.$on("click",l[4]),{c(){lo(e.$$.fragment)},m(n,s){io(e,n,s),t=!0},p(n,s){const i={};s&64&&(i.$$scope={dirty:s,ctx:n}),e.$set(i)},i(n){t||(kn(e.$$.fragment,n),t=!0)},o(n){Bn(e.$$.fragment,n),t=!1},d(n){so(e,n)}}}function Tr(l){let e,t,n;return{c(){e=lt("div"),t=Kt(),n=lt("p"),n.textContent="API Recorder",nt(e,"class","loading-dot self-baseline svelte-1i1gjw2"),nt(n,"class","self-baseline btn-text svelte-1i1gjw2")},m(s,i){ht(s,e,i),ht(s,t,i),ht(s,n,i)},p:Nr,d(s){s&&(dt(e),dt(t),dt(n))}}}function Ar(l){let e;return{c(){e=tn("MCP Tool")},m(t,n){ht(t,e,n)},d(t){t&&dt(e)}}}function Mr(l){let e;return{c(){e=tn("API endpoint")},m(t,n){ht(t,e,n)},d(t){t&&dt(e)}}}function ps(l){let e;return{c(){e=tn("s")},m(t,n){ht(t,e,n)},d(t){t&&dt(e)}}}function Pr(l){let e,t,n,s,i,o,a,c,r,_,u,f,p,g,h,$,m,w,k,d,v,y,b,q=l[2]!=="mcp"&&fs(l);function j(N,O){return N[2]!=="mcp"?Mr:Ar}let E=j(l),C=E(l),A=l[1]>1&&ps();return d=new Wl({}),{c(){e=lt("h2"),t=lt("img"),s=Kt(),i=lt("div"),o=tn(`API documentation
12		`),a=lt("div"),c=tn(l[0]),r=Kt(),_=lt("span"),q&&q.c(),u=Kt(),f=lt("p"),p=lt("span"),g=tn(l[1]),h=Kt(),C.c(),$=Cr(),A&&A.c(),m=lt("br"),w=Kt(),k=lt("button"),lo(d.$$.fragment),Lr(t.src,n=no)||nt(t,"src",n),nt(t,"alt",""),nt(t,"class","svelte-1i1gjw2"),nt(a,"class","url svelte-1i1gjw2"),nt(i,"class","title svelte-1i1gjw2"),nt(p,"class","url svelte-1i1gjw2"),nt(_,"class","counts svelte-1i1gjw2"),nt(e,"class","svelte-1i1gjw2"),nt(k,"class","svelte-1i1gjw2")},m(N,O){ht(N,e,O),De(e,t),De(e,s),De(e,i),De(i,o),De(i,a),De(a,c),De(e,r),De(e,_),q&&q.m(_,null),De(_,u),De(_,f),De(f,p),De(p,g),De(f,h),C.m(f,null),De(f,$),A&&A.m(f,null),De(f,m),ht(N,w,O),ht(N,k,O),io(d,k,null),v=!0,y||(b=Er(k,"click",l[5]),y=!0)},p(N,[O]){(!v||O&1)&&us(c,N[0]),N[2]!=="mcp"?q?(q.p(N,O),O&4&&kn(q,1)):(q=fs(N),q.c(),kn(q,1),q.m(_,u)):q&&(qr(),Bn(q,1,1,()=>{q=null}),yr()),(!v||O&2)&&us(g,N[1]),E!==(E=j(N))&&(C.d(1),C=E(N),C&&(C.c(),C.m(f,$))),N[1]>1?A||(A=ps(),A.c(),A.m(f,m)):A&&(A.d(1),A=null)},i(N){v||(kn(q),kn(d.$$.fragment,N),v=!0)},o(N){Bn(q),Bn(d.$$.fragment,N),v=!1},d(N){N&&(dt(e),dt(w),dt(k)),q&&q.d(),C.d(),A&&A.d(),so(d),y=!1,b()}}}function Or(l,e,t){let{root:n}=e,{api_count:s}=e,{current_language:i="python"}=e;const o=zr(),a=()=>o("close",{api_recorder_visible:!0}),c=()=>o("close");return l.$$set=r=>{"root"in r&&t(0,n=r.root),"api_count"in r&&t(1,s=r.api_count),"current_language"in r&&t(2,i=r.current_language)},[n,s,i,o,a,c]}class Ir extends wr{constructor(e){super(),Sr(this,e,Or,Pr,jr,{root:0,api_count:1,current_language:2})}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),wl()}get api_count(){return this.$$.ctx[1]}set api_count(e){this.$$set({api_count:e}),wl()}get current_language(){return this.$$.ctx[2]}set current_language(e){this.$$set({current_language:e}),wl()}}function Xe(l,e,t=null){return e===void 0?t==="py"?"None":null:l===null&&t==="py"?"None":e==="string"||e==="str"?t===null?l:'"'+l+'"':e==="number"?t===null?parseFloat(l):l:e==="boolean"||e=="bool"?t==="py"?(l=String(l),l==="true"?"True":"False"):t==="js"||t==="bash"?l:l==="true":e==="List[str]"?(l=JSON.stringify(l),l):e.startsWith("Literal['")?'"'+l+'"':t===null?l===""?null:JSON.parse(l):typeof l=="string"?l===""?t==="py"?"None":"null":l:(t==="bash"&&(l=Al(l)),t==="py"&&(l=Ml(l)),Dr(l))}function oo(l){if(typeof l=="object"&&l!==null&&l.hasOwnProperty("url")&&l.hasOwnProperty("meta")&&typeof l.meta=="object"&&l.meta!==null&&l.meta._type==="gradio.FileData")return!0;if(typeof l=="object"&&l!==null){for(let e in l)if(typeof l[e]=="object"&&oo(l[e]))return!0}return!1}function Al(l){return typeof l=="object"&&l!==null&&!Array.isArray(l)&&"url"in l&&l.url&&"meta"in l&&l.meta?._type==="gradio.FileData"?{path:l.url,meta:{_type:"gradio.FileData"}}:(Array.isArray(l)?l.forEach((e,t)=>{typeof e=="object"&&e!==null&&(l[t]=Al(e))}):typeof l=="object"&&l!==null&&Object.keys(l).forEach(e=>{l[e]=Al(l[e])}),l)}function Ml(l){return typeof l=="object"&&l!==null&&!Array.isArray(l)&&"url"in l&&l.url&&"meta"in l&&l.meta?._type==="gradio.FileData"?`handle_file('${l.url}')`:(Array.isArray(l)?l.forEach((e,t)=>{typeof e=="object"&&e!==null&&(l[t]=Ml(e))}):typeof l=="object"&&l!==null&&Object.keys(l).forEach(e=>{l[e]=Ml(l[e])}),l)}function Dr(l){let e=JSON.stringify(l,(s,i)=>i===null?"UNQUOTEDNone":typeof i=="string"&&i.startsWith("handle_file(")&&i.endsWith(")")?`UNQUOTED${i}`:i);const t=/"UNQUOTEDhandle_file\(([^)]*)\)"/g;e=e.replace(t,(s,i)=>`handle_file(${i})`);const n=/"UNQUOTEDNone"/g;return e.replace(n,"None")}const{SvelteComponent:Fr,append:be,attr:yt,check_outros:Ur,create_component:Rr,destroy_component:Br,destroy_each:Gr,detach:Te,element:We,empty:ro,ensure_array_like:ms,flush:In,group_outros:Hr,init:Vr,insert:Ae,mount_component:Wr,noop:Zr,safe_not_equal:Jr,set_data:Ct,set_style:Ut,space:Rt,text:Oe,toggle_class:ds,transition_in:Gn,transition_out:Pl}=window.__gradio__svelte__internal;function hs(l,e,t){const n=l.slice();return n[4]=e[t].label,n[5]=e[t].python_type,n[6]=e[t].component,n[7]=e[t].parameter_name,n[8]=e[t].parameter_has_default,n[9]=e[t].parameter_default,n[11]=t,n}function gs(l){let e;return{c(){e=Oe("s")},m(t,n){Ae(t,e,n)},d(t){t&&Te(e)}}}function Qr(l){let e=(l[2][l[11]].type||"any")+"",t;return{c(){t=Oe(e)},m(n,s){Ae(n,t,s)},p(n,s){s&4&&e!==(e=(n[2][n[11]].type||"any")+"")&&Ct(t,e)},d(n){n&&Te(t)}}}function Yr(l){let e=l[5].type+"",t,n,s=l[8]&&l[9]===null&&bs();return{c(){t=Oe(e),s&&s.c(),n=ro()},m(i,o){Ae(i,t,o),s&&s.m(i,o),Ae(i,n,o)},p(i,o){o&2&&e!==(e=i[5].type+"")&&Ct(t,e),i[8]&&i[9]===null?s||(s=bs(),s.c(),s.m(n.parentNode,n)):s&&(s.d(1),s=null)},d(i){i&&(Te(t),Te(n)),s&&s.d(i)}}}function bs(l){let e;return{c(){e=Oe(` |
13							None`)},m(t,n){Ae(t,e,n)},d(t){t&&Te(e)}}}function Kr(l){let e,t,n=Xe(l[9],l[5].type,"py")+"",s;return{c(){e=We("span"),e.textContent="Default: ",t=We("span"),s=Oe(n),yt(t,"class","code svelte-1yt946s"),Ut(t,"font-size","var(--text-sm)")},m(i,o){Ae(i,e,o),Ae(i,t,o),be(t,s)},p(i,o){o&2&&n!==(n=Xe(i[9],i[5].type,"py")+"")&&Ct(s,n)},d(i){i&&(Te(e),Te(t))}}}function Xr(l){let e;return{c(){e=We("span"),e.textContent="Required",Ut(e,"font-weight","bold")},m(t,n){Ae(t,e,n)},p:Zr,d(t){t&&Te(e)}}}function vs(l){let e,t,n,s,i,o=(l[3]!=="bash"&&l[7]?l[7]:"["+l[11]+"]")+"",a,c,r,_,u,f,p,g=l[4]+"",h,$,m=l[6]+"",w,k,d=l[5].description+"",v,y;function b(N,O){return N[3]==="python"?Yr:Qr}let q=b(l),j=q(l);function E(N,O){return!N[8]||N[3]=="bash"?Xr:Kr}let C=E(l),A=C(l);return{c(){e=We("hr"),t=Rt(),n=We("div"),s=We("p"),i=We("span"),a=Oe(o),c=Rt(),r=We("span"),j.c(),_=Rt(),A.c(),u=Rt(),f=We("p"),p=Oe('The input value that is provided in the "'),h=Oe(g),$=Oe('" '),w=Oe(m),k=Oe(`
14				component. `),v=Oe(d),y=Rt(),yt(e,"class","hr svelte-1yt946s"),yt(i,"class","code svelte-1yt946s"),Ut(i,"margin-right","10px"),yt(r,"class","code highlight svelte-1yt946s"),Ut(r,"margin-right","10px"),Ut(s,"white-space","nowrap"),Ut(s,"overflow-x","auto"),yt(f,"class","desc svelte-1yt946s"),Ut(n,"margin","10px")},m(N,O){Ae(N,e,O),Ae(N,t,O),Ae(N,n,O),be(n,s),be(s,i),be(i,a),be(s,c),be(s,r),j.m(r,null),be(s,_),A.m(s,null),be(n,u),be(n,f),be(f,p),be(f,h),be(f,$),be(f,w),be(f,k),be(f,v),be(n,y)},p(N,O){O&10&&o!==(o=(N[3]!=="bash"&&N[7]?N[7]:"["+N[11]+"]")+"")&&Ct(a,o),q===(q=b(N))&&j?j.p(N,O):(j.d(1),j=q(N),j&&(j.c(),j.m(r,null))),C===(C=E(N))&&A?A.p(N,O):(A.d(1),A=C(N),A&&(A.c(),A.m(s,null))),O&2&&g!==(g=N[4]+"")&&Ct(h,g),O&2&&m!==(m=N[6]+"")&&Ct(w,m),O&2&&d!==(d=N[5].description+"")&&Ct(v,d)},d(N){N&&(Te(e),Te(t),Te(n)),j.d(),A.d()}}}function $s(l){let e,t,n;return t=new to({props:{margin:!1}}),{c(){e=We("div"),Rr(t.$$.fragment),yt(e,"class","load-wrap")},m(s,i){Ae(s,e,i),Wr(t,e,null),n=!0},i(s){n||(Gn(t.$$.fragment,s),n=!0)},o(s){Pl(t.$$.fragment,s),n=!1},d(s){s&&Te(e),Br(t)}}}function xr(l){let e,t,n,s=l[1].length+"",i,o,a,c,r,_,u,f,p=l[1].length!=1&&gs(),g=ms(l[1]),h=[];for(let m=0;m<g.length;m+=1)h[m]=vs(hs(l,g,m));let $=l[0]&&$s();return{c(){e=We("h4"),t=We("div"),t.innerHTML='<div class="toggle-dot svelte-1yt946s"></div>',n=Oe(`
15	Accepts `),i=Oe(s),o=Oe(" parameter"),p&&p.c(),a=Oe(":"),c=Rt(),r=We("div");for(let m=0;m<h.length;m+=1)h[m].c();_=Rt(),$&&$.c(),u=ro(),yt(t,"class","toggle-icon svelte-1yt946s"),yt(e,"class","svelte-1yt946s"),ds(r,"hide",l[0])},m(m,w){Ae(m,e,w),be(e,t),be(e,n),be(e,i),be(e,o),p&&p.m(e,null),be(e,a),Ae(m,c,w),Ae(m,r,w);for(let k=0;k<h.length;k+=1)h[k]&&h[k].m(r,null);Ae(m,_,w),$&&$.m(m,w),Ae(m,u,w),f=!0},p(m,[w]){if((!f||w&2)&&s!==(s=m[1].length+"")&&Ct(i,s),m[1].length!=1?p||(p=gs(),p.c(),p.m(e,a)):p&&(p.d(1),p=null),w&14){g=ms(m[1]);let k;for(k=0;k<g.length;k+=1){const d=hs(m,g,k);h[k]?h[k].p(d,w):(h[k]=vs(d),h[k].c(),h[k].m(r,null))}for(;k<h.length;k+=1)h[k].d(1);h.length=g.length}(!f||w&1)&&ds(r,"hide",m[0]),m[0]?$?w&1&&Gn($,1):($=$s(),$.c(),Gn($,1),$.m(u.parentNode,u)):$&&(Hr(),Pl($,1,1,()=>{$=null}),Ur())},i(m){f||(Gn($),f=!0)},o(m){Pl($),f=!1},d(m){m&&(Te(e),Te(c),Te(r),Te(_),Te(u)),p&&p.d(),Gr(h,m),$&&$.d(m)}}}function ea(l,e,t){let{is_running:n}=e,{endpoint_returns:s}=e,{js_returns:i}=e,{current_language:o}=e;return l.$$set=a=>{"is_running"in a&&t(0,n=a.is_running),"endpoint_returns"in a&&t(1,s=a.endpoint_returns),"js_returns"in a&&t(2,i=a.js_returns),"current_language"in a&&t(3,o=a.current_language)},[n,s,i,o]}class ta extends Fr{constructor(e){super(),Vr(this,e,ea,xr,Jr,{is_running:0,endpoint_returns:1,js_returns:2,current_language:3})}get is_running(){return this.$$.ctx[0]}set is_running(e){this.$$set({is_running:e}),In()}get endpoint_returns(){return this.$$.ctx[1]}set endpoint_returns(e){this.$$set({endpoint_returns:e}),In()}get js_returns(){return this.$$.ctx[2]}set js_returns(e){this.$$set({js_returns:e}),In()}get current_language(){return this.$$.ctx[3]}set current_language(e){this.$$set({current_language:e}),In()}}const{SvelteComponent:na,create_component:la,destroy_component:sa,detach:ia,flush:oa,init:ra,insert:aa,mount_component:ca,safe_not_equal:_a,set_data:ua,text:fa,transition_in:pa,transition_out:ma}=window.__gradio__svelte__internal;function da(l){let e;return{c(){e=fa(l[0])},m(t,n){aa(t,e,n)},p(t,n){n&1&&ua(e,t[0])},d(t){t&&ia(e)}}}function ha(l){let e,t;return e=new tl({props:{size:"sm",$$slots:{default:[da]},$$scope:{ctx:l}}}),e.$on("click",l[1]),{c(){la(e.$$.fragment)},m(n,s){ca(e,n,s),t=!0},p(n,[s]){const i={};s&9&&(i.$$scope={dirty:s,ctx:n}),e.$set(i)},i(n){t||(pa(e.$$.fragment,n),t=!0)},o(n){ma(e.$$.fragment,n),t=!1},d(n){sa(e,n)}}}function ga(l,e,t){let{code:n}=e,s="copy";function i(){navigator.clipboard.writeText(n),t(0,s="copied!"),setTimeout(()=>{t(0,s="copy")},1500)}return l.$$set=o=>{"code"in o&&t(2,n=o.code)},[s,i,n]}class tt extends na{constructor(e){super(),ra(this,e,ga,ha,_a,{code:2})}get code(){return this.$$.ctx[2]}set code(e){this.$$set({code:e}),oa()}}const{SvelteComponent:ba,append:Zl,attr:Wt,check_outros:va,create_component:nl,destroy_component:ll,detach:rt,element:at,flush:$a,group_outros:ka,init:wa,insert:ct,mount_component:sl,noop:Jl,safe_not_equal:ya,space:Ql,transition_in:sn,transition_out:on}=window.__gradio__svelte__internal;function Ca(l){let e,t,n,s,i,o;return t=new tt({props:{code:ys}}),{c(){e=at("div"),nl(t.$$.fragment),n=Ql(),s=at("div"),i=at("pre"),i.textContent=`$ ${ys}`,Wt(e,"class","copy svelte-hq8ezf"),Wt(i,"class","svelte-hq8ezf")},m(a,c){ct(a,e,c),sl(t,e,null),ct(a,n,c),ct(a,s,c),Zl(s,i),o=!0},p:Jl,i(a){o||(sn(t.$$.fragment,a),o=!0)},o(a){on(t.$$.fragment,a),o=!1},d(a){a&&(rt(e),rt(n),rt(s)),ll(t)}}}function qa(l){let e,t,n,s,i,o;return t=new tt({props:{code:ws}}),{c(){e=at("div"),nl(t.$$.fragment),n=Ql(),s=at("div"),i=at("pre"),i.textContent=`$ ${ws}`,Wt(e,"class","copy svelte-hq8ezf"),Wt(i,"class","svelte-hq8ezf")},m(a,c){ct(a,e,c),sl(t,e,null),ct(a,n,c),ct(a,s,c),Zl(s,i),o=!0},p:Jl,i(a){o||(sn(t.$$.fragment,a),o=!0)},o(a){on(t.$$.fragment,a),o=!1},d(a){a&&(rt(e),rt(n),rt(s)),ll(t)}}}function Sa(l){let e,t,n,s,i,o;return t=new tt({props:{code:ks}}),{c(){e=at("div"),nl(t.$$.fragment),n=Ql(),s=at("div"),i=at("pre"),i.textContent=`$ ${ks}`,Wt(e,"class","copy svelte-hq8ezf"),Wt(i,"class","svelte-hq8ezf")},m(a,c){ct(a,e,c),sl(t,e,null),ct(a,n,c),ct(a,s,c),Zl(s,i),o=!0},p:Jl,i(a){o||(sn(t.$$.fragment,a),o=!0)},o(a){on(t.$$.fragment,a),o=!1},d(a){a&&(rt(e),rt(n),rt(s)),ll(t)}}}function Ea(l){let e,t,n,s;const i=[Sa,qa,Ca],o=[];function a(c,r){return c[0]==="python"?0:c[0]==="javascript"?1:c[0]==="bash"?2:-1}return~(t=a(l))&&(n=o[t]=i[t](l)),{c(){e=at("code"),n&&n.c(),Wt(e,"class","svelte-hq8ezf")},m(c,r){ct(c,e,r),~t&&o[t].m(e,null),s=!0},p(c,r){let _=t;t=a(c),t===_?~t&&o[t].p(c,r):(n&&(ka(),on(o[_],1,1,()=>{o[_]=null}),va()),~t?(n=o[t],n?n.p(c,r):(n=o[t]=i[t](c),n.c()),sn(n,1),n.m(e,null)):n=null)},i(c){s||(sn(n),s=!0)},o(c){on(n),s=!1},d(c){c&&rt(e),~t&&o[t].d()}}}function Na(l){let e,t;return e=new St({props:{$$slots:{default:[Ea]},$$scope:{ctx:l}}}),{c(){nl(e.$$.fragment)},m(n,s){sl(e,n,s),t=!0},p(n,[s]){const i={};s&3&&(i.$$scope={dirty:s,ctx:n}),e.$set(i)},i(n){t||(sn(e.$$.fragment,n),t=!0)},o(n){on(e.$$.fragment,n),t=!1},d(n){ll(e,n)}}}let ks="pip install gradio_client",ws="npm i -D @gradio/client",ys="curl --version";function ja(l,e,t){let{current_language:n}=e;return l.$$set=s=>{"current_language"in s&&t(0,n=s.current_language)},[n]}class La extends ba{constructor(e){super(),wa(this,e,ja,Na,ya,{current_language:0})}get current_language(){return this.$$.ctx[0]}set current_language(e){this.$$set({current_language:e}),$a()}}const{SvelteComponent:za,append:nn,attr:Zn,detach:Yl,element:Jn,empty:Ta,flush:yl,init:Aa,insert:Kl,noop:Cs,safe_not_equal:Ma,set_data:ao,text:Qn}=window.__gradio__svelte__internal;function Pa(l){let e,t,n,s;return{c(){e=Jn("h3"),t=Qn(`fn_index:
16		`),n=Jn("span"),s=Qn(l[1]),Zn(n,"class","post svelte-41kcm6"),Zn(e,"class","svelte-41kcm6")},m(i,o){Kl(i,e,o),nn(e,t),nn(e,n),nn(n,s)},p(i,o){o&2&&ao(s,i[1])},d(i){i&&Yl(e)}}}function Oa(l){let e,t,n,s="/"+l[0],i;return{c(){e=Jn("h3"),t=Qn(`api_name:
17		`),n=Jn("span"),i=Qn(s),Zn(n,"class","post svelte-41kcm6"),Zn(e,"class","svelte-41kcm6")},m(o,a){Kl(o,e,a),nn(e,t),nn(e,n),nn(n,i)},p(o,a){a&1&&s!==(s="/"+o[0])&&ao(i,s)},d(o){o&&Yl(e)}}}function Ia(l){let e;function t(i,o){return i[2]?Oa:Pa}let n=t(l),s=n(l);return{c(){s.c(),e=Ta()},m(i,o){s.m(i,o),Kl(i,e,o)},p(i,[o]){n===(n=t(i))&&s?s.p(i,o):(s.d(1),s=n(i),s&&(s.c(),s.m(e.parentNode,e)))},i:Cs,o:Cs,d(i){i&&Yl(e),s.d(i)}}}function Da(l,e,t){let{api_name:n=null}=e,{fn_index:s=null}=e,{named:i}=e;return l.$$set=o=>{"api_name"in o&&t(0,n=o.api_name),"fn_index"in o&&t(1,s=o.fn_index),"named"in o&&t(2,i=o.named)},[n,s,i]}class co extends za{constructor(e){super(),Aa(this,e,Da,Ia,Ma,{api_name:0,fn_index:1,named:2})}get api_name(){return this.$$.ctx[0]}set api_name(e){this.$$set({api_name:e}),yl()}get fn_index(){return this.$$.ctx[1]}set fn_index(e){this.$$set({fn_index:e}),yl()}get named(){return this.$$.ctx[2]}set named(e){this.$$set({named:e}),yl()}}const{SvelteComponent:Fa,append:I,attr:$e,binding_callbacks:Cl,check_outros:qs,create_component:zt,destroy_component:Tt,destroy_each:Yn,detach:Q,element:fe,empty:_o,ensure_array_like:qt,flush:pt,group_outros:Ss,init:Ua,insert:Y,mount_component:At,noop:Ra,safe_not_equal:Ba,set_data:qe,space:il,text:M,transition_in:xe,transition_out:et}=window.__gradio__svelte__internal;function Es(l,e,t){const n=l.slice();return n[28]=e[t].label,n[23]=e[t].parameter_name,n[29]=e[t].type,n[21]=e[t].python_type,n[30]=e[t].component,n[22]=e[t].example_input,n[31]=e[t].serializer,n[27]=t,n}function Ns(l,e,t){const n=l.slice();return n[28]=e[t].label,n[23]=e[t].parameter_name,n[29]=e[t].type,n[21]=e[t].python_type,n[30]=e[t].component,n[22]=e[t].example_input,n[31]=e[t].serializer,n[27]=t,n}function js(l,e,t){const n=l.slice();return n[30]=e[t].component,n[22]=e[t].example_input,n[27]=t,n}function Ls(l,e,t){const n=l.slice();return n[21]=e[t].python_type,n[22]=e[t].example_input,n[23]=e[t].parameter_name,n[24]=e[t].parameter_has_default,n[25]=e[t].parameter_default,n[27]=t,n}function Ga(l){let e,t;return e=new co({props:{named:l[5],fn_index:l[1]}}),{c(){zt(e.$$.fragment)},m(n,s){At(e,n,s),t=!0},p(n,s){const i={};s[0]&32&&(i.named=n[5]),s[0]&2&&(i.fn_index=n[1]),e.$set(i)},i(n){t||(xe(e.$$.fragment,n),t=!0)},o(n){et(e.$$.fragment,n),t=!1},d(n){Tt(e,n)}}}function Ha(l){let e,t;return e=new co({props:{named:l[5],api_name:l[0].api_name}}),{c(){zt(e.$$.fragment)},m(n,s){At(e,n,s),t=!0},p(n,s){const i={};s[0]&32&&(i.named=n[5]),s[0]&1&&(i.api_name=n[0].api_name),e.$set(i)},i(n){t||(xe(e.$$.fragment,n),t=!0)},o(n){et(e.$$.fragment,n),t=!1},d(n){Tt(e,n)}}}function Va(l){let e,t;return e=new St({props:{$$slots:{default:[Ja]},$$scope:{ctx:l}}}),{c(){zt(e.$$.fragment)},m(n,s){At(e,n,s),t=!0},p(n,s){const i={};s[0]&7185|s[1]&16&&(i.$$scope={dirty:s,ctx:n}),e.$set(i)},i(n){t||(xe(e.$$.fragment,n),t=!0)},o(n){et(e.$$.fragment,n),t=!1},d(n){Tt(e,n)}}}function Wa(l){let e,t;return e=new St({props:{$$slots:{default:[xa]},$$scope:{ctx:l}}}),{c(){zt(e.$$.fragment)},m(n,s){At(e,n,s),t=!0},p(n,s){const i={};s[0]&639|s[1]&16&&(i.$$scope={dirty:s,ctx:n}),e.$set(i)},i(n){t||(xe(e.$$.fragment,n),t=!0)},o(n){et(e.$$.fragment,n),t=!1},d(n){Tt(e,n)}}}function Za(l){let e,t;return e=new St({props:{$$slots:{default:[tc]},$$scope:{ctx:l}}}),{c(){zt(e.$$.fragment)},m(n,s){At(e,n,s),t=!0},p(n,s){const i={};s[0]&349|s[1]&16&&(i.$$scope={dirty:s,ctx:n}),e.$set(i)},i(n){t||(xe(e.$$.fragment,n),t=!0)},o(n){et(e.$$.fragment,n),t=!1},d(n){Tt(e,n)}}}function zs(l){let e;return{c(){e=M(",")},m(t,n){Y(t,e,n)},d(t){t&&Q(e)}}}function Ts(l){let e,t=Xe(l[22],l[21].type,"bash")+"",n,s,i=l[27]<l[4].length-1&&zs();return{c(){e=M(`
18							`),n=M(t),i&&i.c(),s=_o()},m(o,a){Y(o,e,a),Y(o,n,a),i&&i.m(o,a),Y(o,s,a)},p(o,a){a[0]&16&&t!==(t=Xe(o[22],o[21].type,"bash")+"")&&qe(n,t),o[27]<o[4].length-1?i||(i=zs(),i.c(),i.m(s.parentNode,s)):i&&(i.d(1),i=null)},d(o){o&&(Q(e),Q(n),Q(s)),i&&i.d(o)}}}function Ja(l){let e,t,n,s,i,o,a,c,r,_,u=l[0].api_name+"",f,p,g="{",h,$,m,w="}",k,d,v="{",y,b,q="}",j,E,C,A,N,O=l[0].api_name+"",V,te,T;n=new tt({props:{code:l[10]?.innerText}});let P=qt(l[4]),x=[];for(let Z=0;Z<P.length;Z+=1)x[Z]=Ts(Es(l,P,Z));return{c(){e=fe("code"),t=fe("div"),zt(n.$$.fragment),s=il(),i=fe("div"),o=fe("pre"),a=M("curl -X POST "),c=M(l[11]),r=M(l[12]),_=M("/call/"),f=M(u),p=M(` -s -H "Content-Type: application/json" -d '`),h=M(g),$=M(`
19  "data": [`);for(let Z=0;Z<x.length;Z+=1)x[Z].c();m=M(`
20]`),k=M(w),d=M(`' \\
21  | awk -F'"' '`),y=M(v),b=M(" print $4"),j=M(q),E=M(`'  \\
22  | read EVENT_ID; curl -N `),C=M(l[11]),A=M(l[12]),N=M("/call/"),V=M(O),te=M("/$EVENT_ID"),$e(t,"class","copy svelte-114qcyq"),$e(o,"class","svelte-114qcyq"),$e(e,"class","svelte-114qcyq")},m(Z,re){Y(Z,e,re),I(e,t),At(n,t,null),I(e,s),I(e,i),I(i,o),I(o,a),I(o,c),I(o,r),I(o,_),I(o,f),I(o,p),I(o,h),I(o,$);for(let ie=0;ie<x.length;ie+=1)x[ie]&&x[ie].m(o,null);I(o,m),I(o,k),I(o,d),I(o,y),I(o,b),I(o,j),I(o,E),I(o,C),I(o,A),I(o,N),I(o,V),I(o,te),l[19](i),T=!0},p(Z,re){const ie={};if(re[0]&1024&&(ie.code=Z[10]?.innerText),n.$set(ie),(!T||re[0]&2048)&&qe(c,Z[11]),(!T||re[0]&4096)&&qe(r,Z[12]),(!T||re[0]&1)&&u!==(u=Z[0].api_name+"")&&qe(f,u),re[0]&16){P=qt(Z[4]);let Se;for(Se=0;Se<P.length;Se+=1){const Ln=Es(Z,P,Se);x[Se]?x[Se].p(Ln,re):(x[Se]=Ts(Ln),x[Se].c(),x[Se].m(o,m))}for(;Se<x.length;Se+=1)x[Se].d(1);x.length=P.length}(!T||re[0]&2048)&&qe(C,Z[11]),(!T||re[0]&4096)&&qe(A,Z[12]),(!T||re[0]&1)&&O!==(O=Z[0].api_name+"")&&qe(V,O)},i(Z){T||(xe(n.$$.fragment,Z),T=!0)},o(Z){et(n.$$.fragment,Z),T=!1},d(Z){Z&&Q(e),Tt(n),Yn(x,Z),l[19](null)}}}function As(l){let e,t,n,s=l[22].url+"",i,o,a=l[30]+"",c,r,_,u;return{c(){e=M(`
23const response_`),t=M(l[27]),n=M(' = await fetch("'),i=M(s),o=M(`");
24const example`),c=M(a),r=M(" = await response_"),_=M(l[27]),u=M(`.blob();
25						`)},m(f,p){Y(f,e,p),Y(f,t,p),Y(f,n,p),Y(f,i,p),Y(f,o,p),Y(f,c,p),Y(f,r,p),Y(f,_,p),Y(f,u,p)},p:Ra,d(f){f&&(Q(e),Q(t),Q(n),Q(i),Q(o),Q(c),Q(r),Q(_),Q(u))}}}function Ms(l){let e,t,n;return{c(){e=M(', {auth: ["'),t=M(l[6]),n=M('", **password**]}')},m(s,i){Y(s,e,i),Y(s,t,i),Y(s,n,i)},p(s,i){i[0]&64&&qe(t,s[6])},d(s){s&&(Q(e),Q(t),Q(n))}}}function Qa(l){let e;return{c(){e=M(l[1])},m(t,n){Y(t,e,n)},p(t,n){n[0]&2&&qe(e,t[1])},d(t){t&&Q(e)}}}function Ya(l){let e,t,n=l[0].api_name+"",s,i;return{c(){e=fe("span"),t=M('"/'),s=M(n),i=M('"'),$e(e,"class","api-name svelte-114qcyq")},m(o,a){Y(o,e,a),I(e,t),I(e,s),I(e,i)},p(o,a){a[0]&1&&n!==(n=o[0].api_name+"")&&qe(s,n)},d(o){o&&Q(e)}}}function Ka(l){let e,t,n=l[23]+"",s,i,o=Xe(l[22],l[21].type,"js")+"",a,c;return{c(){e=M(`		
26		`),t=fe("span"),s=M(n),i=M(": "),a=M(o),c=M(", "),$e(t,"class","example-inputs")},m(r,_){Y(r,e,_),Y(r,t,_),I(t,s),I(t,i),I(t,a),Y(r,c,_)},p(r,_){_[0]&16&&n!==(n=r[23]+"")&&qe(s,n),_[0]&16&&o!==(o=Xe(r[22],r[21].type,"js")+"")&&qe(a,o)},d(r){r&&(Q(e),Q(t),Q(c))}}}function Xa(l){let e,t,n=l[23]+"",s,i,o=l[30]+"",a,c,r;return{c(){e=M(`
27				`),t=fe("span"),s=M(n),i=M(": example"),a=M(o),c=M(", "),r=fe("span"),r.innerHTML="",$e(t,"class","example-inputs"),$e(r,"class","desc svelte-114qcyq")},m(_,u){Y(_,e,u),Y(_,t,u),I(t,s),I(t,i),I(t,a),Y(_,c,u),Y(_,r,u)},p(_,u){u[0]&16&&n!==(n=_[23]+"")&&qe(s,n),u[0]&16&&o!==(o=_[30]+"")&&qe(a,o)},d(_){_&&(Q(e),Q(t),Q(c),Q(r))}}}function Ps(l){let e,t;function n(o,a){return a[0]&16&&(e=null),e==null&&(e=!!o[14].includes(o[30])),e?Xa:Ka}let s=n(l,[-1,-1]),i=s(l);return{c(){i.c(),t=_o()},m(o,a){i.m(o,a),Y(o,t,a)},p(o,a){s===(s=n(o,a))&&i?i.p(o,a):(i.d(1),i=s(o),i&&(i.c(),i.m(t.parentNode,t)))},d(o){o&&Q(t),i.d(o)}}}function xa(l){let e,t,n,s,i,o,a,c,r,_,u=(l[3]||l[2])+"",f,p,g,h,$,m;n=new tt({props:{code:l[9]?.innerText}});let w=qt(l[15]),k=[];for(let E=0;E<w.length;E+=1)k[E]=As(js(l,w,E));let d=l[6]!==null&&Ms(l);function v(E,C){return E[5]?Ya:Qa}let y=v(l),b=y(l),q=qt(l[4]),j=[];for(let E=0;E<q.length;E+=1)j[E]=Ps(Ns(l,q,E));return{c(){e=fe("code"),t=fe("div"),zt(n.$$.fragment),s=il(),i=fe("div"),o=fe("pre"),a=M(`import { Client } from "@gradio/client";
28`);for(let E=0;E<k.length;E+=1)k[E].c();c=M(`
29const client = await Client.connect(`),r=fe("span"),_=M('"'),f=M(u),p=M('"'),d&&d.c(),g=M(`);
30const result = await client.predict(`),b.c(),h=M(", { ");for(let E=0;E<j.length;E+=1)j[E].c();$=M(`
31});
32
33console.log(result.data);
34`),$e(t,"class","copy svelte-114qcyq"),$e(r,"class","token string svelte-114qcyq"),$e(o,"class","svelte-114qcyq"),$e(e,"class","svelte-114qcyq")},m(E,C){Y(E,e,C),I(e,t),At(n,t,null),I(e,s),I(e,i),I(i,o),I(o,a);for(let A=0;A<k.length;A+=1)k[A]&&k[A].m(o,null);I(o,c),I(o,r),I(r,_),I(r,f),I(r,p),d&&d.m(o,null),I(o,g),b.m(o,null),I(o,h);for(let A=0;A<j.length;A+=1)j[A]&&j[A].m(o,null);I(o,$),l[18](i),m=!0},p(E,C){const A={};if(C[0]&512&&(A.code=E[9]?.innerText),n.$set(A),C[0]&32768){w=qt(E[15]);let N;for(N=0;N<w.length;N+=1){const O=js(E,w,N);k[N]?k[N].p(O,C):(k[N]=As(O),k[N].c(),k[N].m(o,c))}for(;N<k.length;N+=1)k[N].d(1);k.length=w.length}if((!m||C[0]&12)&&u!==(u=(E[3]||E[2])+"")&&qe(f,u),E[6]!==null?d?d.p(E,C):(d=Ms(E),d.c(),d.m(o,g)):d&&(d.d(1),d=null),y===(y=v(E))&&b?b.p(E,C):(b.d(1),b=y(E),b&&(b.c(),b.m(o,h))),C[0]&16400){q=qt(E[4]);let N;for(N=0;N<q.length;N+=1){const O=Ns(E,q,N);j[N]?j[N].p(O,C):(j[N]=Ps(O),j[N].c(),j[N].m(o,$))}for(;N<j.length;N+=1)j[N].d(1);j.length=q.length}},i(E){m||(xe(n.$$.fragment,E),m=!0)},o(E){et(n.$$.fragment,E),m=!1},d(E){E&&Q(e),Tt(n),Yn(k,E),d&&d.d(),b.d(),Yn(j,E),l[18](null)}}}function ec(l){let e;return{c(){e=M(", handle_file")},m(t,n){Y(t,e,n)},d(t){t&&Q(e)}}}function Os(l){let e,t,n;return{c(){e=M(', auth=("'),t=M(l[6]),n=M('", **password**)')},m(s,i){Y(s,e,i),Y(s,t,i),Y(s,n,i)},p(s,i){i[0]&64&&qe(t,s[6])},d(s){s&&(Q(e),Q(t),Q(n))}}}function Is(l){let e,t=l[23]?l[23]+"=":"",n,s,i=Xe(l[24]?l[25]:l[22],l[21].type,"py")+"",o,a;return{c(){e=M(`
35		`),n=M(t),s=fe("span"),o=M(i),a=M(",")},m(c,r){Y(c,e,r),Y(c,n,r),Y(c,s,r),I(s,o),Y(c,a,r)},p(c,r){r[0]&16&&t!==(t=c[23]?c[23]+"=":"")&&qe(n,t),r[0]&16&&i!==(i=Xe(c[24]?c[25]:c[22],c[21].type,"py")+"")&&qe(o,i)},d(c){c&&(Q(e),Q(n),Q(s),Q(a))}}}function tc(l){let e,t,n,s,i,o,a,c,r,_,u,f,p,g=(l[3]||l[2])+"",h,$,m,w,k,d,v,y,b=l[0].api_name+"",q,j,E,C,A,N;n=new tt({props:{code:l[8]?.innerText}});let O=l[13]&&ec(),V=l[6]!==null&&Os(l),te=qt(l[4]),T=[];for(let P=0;P<te.length;P+=1)T[P]=Is(Ls(l,te,P));return{c(){e=fe("code"),t=fe("div"),zt(n.$$.fragment),s=il(),i=fe("div"),o=fe("pre"),a=fe("span"),a.textContent="from",c=M(" gradio_client "),r=fe("span"),r.textContent="import",_=M(" Client"),O&&O.c(),u=M(`
36
37client = Client(`),f=fe("span"),p=M('"'),h=M(g),$=M('"'),V&&V.c(),m=M(`)
38result = client.`),w=fe("span"),w.textContent="predict",k=M("(");for(let P=0;P<T.length;P+=1)T[P].c();d=M(`
39		api_name=`),v=fe("span"),y=M('"/'),q=M(b),j=M('"'),E=M(`
40)
41`),C=fe("span"),C.textContent="print",A=M("(result)"),$e(t,"class","copy svelte-114qcyq"),$e(a,"class","highlight"),$e(r,"class","highlight"),$e(f,"class","token string svelte-114qcyq"),$e(w,"class","highlight"),$e(v,"class","api-name svelte-114qcyq"),$e(C,"class","highlight"),$e(o,"class","svelte-114qcyq"),$e(e,"class","svelte-114qcyq")},m(P,x){Y(P,e,x),I(e,t),At(n,t,null),I(e,s),I(e,i),I(i,o),I(o,a),I(o,c),I(o,r),I(o,_),O&&O.m(o,null),I(o,u),I(o,f),I(f,p),I(f,h),I(f,$),V&&V.m(o,null),I(o,m),I(o,w),I(o,k);for(let Z=0;Z<T.length;Z+=1)T[Z]&&T[Z].m(o,null);I(o,d),I(o,v),I(v,y),I(v,q),I(v,j),I(o,E),I(o,C),I(o,A),l[17](i),N=!0},p(P,x){const Z={};if(x[0]&256&&(Z.code=P[8]?.innerText),n.$set(Z),(!N||x[0]&12)&&g!==(g=(P[3]||P[2])+"")&&qe(h,g),P[6]!==null?V?V.p(P,x):(V=Os(P),V.c(),V.m(o,m)):V&&(V.d(1),V=null),x[0]&16){te=qt(P[4]);let re;for(re=0;re<te.length;re+=1){const ie=Ls(P,te,re);T[re]?T[re].p(ie,x):(T[re]=Is(ie),T[re].c(),T[re].m(o,d))}for(;re<T.length;re+=1)T[re].d(1);T.length=te.length}(!N||x[0]&1)&&b!==(b=P[0].api_name+"")&&qe(q,b)},i(P){N||(xe(n.$$.fragment,P),N=!0)},o(P){et(n.$$.fragment,P),N=!1},d(P){P&&Q(e),Tt(n),O&&O.d(),V&&V.d(),Yn(T,P),l[17](null)}}}function nc(l){let e,t,n,s,i,o,a;const c=[Ha,Ga],r=[];function _(g,h){return g[5]?0:1}t=_(l),n=r[t]=c[t](l);const u=[Za,Wa,Va],f=[];function p(g,h){return g[7]==="python"?0:g[7]==="javascript"?1:g[7]==="bash"?2:-1}return~(i=p(l))&&(o=f[i]=u[i](l)),{c(){e=fe("div"),n.c(),s=il(),o&&o.c(),$e(e,"class","container svelte-114qcyq")},m(g,h){Y(g,e,h),r[t].m(e,null),I(e,s),~i&&f[i].m(e,null),a=!0},p(g,h){let $=t;t=_(g),t===$?r[t].p(g,h):(Ss(),et(r[$],1,1,()=>{r[$]=null}),qs(),n=r[t],n?n.p(g,h):(n=r[t]=c[t](g),n.c()),xe(n,1),n.m(e,s));let m=i;i=p(g),i===m?~i&&f[i].p(g,h):(o&&(Ss(),et(f[m],1,1,()=>{f[m]=null}),qs()),~i?(o=f[i],o?o.p(g,h):(o=f[i]=u[i](g),o.c()),xe(o,1),o.m(e,null)):o=null)},i(g){a||(xe(n),xe(o),a=!0)},o(g){et(n),et(o),a=!1},d(g){g&&Q(e),r[t].d(),~i&&f[i].d()}}}function lc(l,e,t){let n,s,{dependency:i}=e,{dependency_index:o}=e,{root:a}=e,{api_prefix:c}=e,{space_id:r}=e,{endpoint_parameters:_}=e,{named:u}=e,{username:f}=e,{current_language:p}=e,g,h,$,m=_.some(b=>oo(b.example_input)),w=["Audio","File","Image","Video"],k=_.filter(b=>w.includes(b.component));function d(b){Cl[b?"unshift":"push"](()=>{g=b,t(8,g)})}function v(b){Cl[b?"unshift":"push"](()=>{h=b,t(9,h)})}function y(b){Cl[b?"unshift":"push"](()=>{$=b,t(10,$)})}return l.$$set=b=>{"dependency"in b&&t(0,i=b.dependency),"dependency_index"in b&&t(1,o=b.dependency_index),"root"in b&&t(2,a=b.root),"api_prefix"in b&&t(16,c=b.api_prefix),"space_id"in b&&t(3,r=b.space_id),"endpoint_parameters"in b&&t(4,_=b.endpoint_parameters),"named"in b&&t(5,u=b.named),"username"in b&&t(6,f=b.username),"current_language"in b&&t(7,p=b.current_language)},l.$$.update=()=>{l.$$.dirty[0]&65536&&t(12,n=c||"/"),l.$$.dirty[0]&4&&t(11,s=a.replace(/\/$/,""))},[i,o,a,r,_,u,f,p,g,h,$,s,n,m,w,k,c,d,v,y]}class sc extends Fa{constructor(e){super(),Ua(this,e,lc,nc,Ba,{dependency:0,dependency_index:1,root:2,api_prefix:16,space_id:3,endpoint_parameters:4,named:5,username:6,current_language:7},null,[-1,-1])}get dependency(){return this.$$.ctx[0]}set dependency(e){this.$$set({dependency:e}),pt()}get dependency_index(){return this.$$.ctx[1]}set dependency_index(e){this.$$set({dependency_index:e}),pt()}get root(){return this.$$.ctx[2]}set root(e){this.$$set({root:e}),pt()}get api_prefix(){return this.$$.ctx[16]}set api_prefix(e){this.$$set({api_prefix:e}),pt()}get space_id(){return this.$$.ctx[3]}set space_id(e){this.$$set({space_id:e}),pt()}get endpoint_parameters(){return this.$$.ctx[4]}set endpoint_parameters(e){this.$$set({endpoint_parameters:e}),pt()}get named(){return this.$$.ctx[5]}set named(e){this.$$set({named:e}),pt()}get username(){return this.$$.ctx[6]}set username(e){this.$$set({username:e}),pt()}get current_language(){return this.$$.ctx[7]}set current_language(e){this.$$set({current_language:e}),pt()}}const{SvelteComponent:ic,append:B,attr:ze,binding_callbacks:ql,check_outros:oc,create_component:ol,destroy_component:rl,destroy_each:Xl,detach:we,element:ke,empty:rc,ensure_array_like:rn,flush:Pt,group_outros:ac,init:cc,insert:ye,mount_component:al,safe_not_equal:_c,set_data:Qe,space:cl,text:G,transition_in:an,transition_out:cn}=window.__gradio__svelte__internal,{onMount:uc,tick:fc}=window.__gradio__svelte__internal;function Ds(l,e,t){const n=l.slice();return n[20]=e[t].call,n[21]=e[t].api_name,n}function Fs(l,e,t){const n=l.slice();return n[20]=e[t].call,n[21]=e[t].api_name,n}function Us(l,e,t){const n=l.slice();return n[20]=e[t].call,n[21]=e[t].api_name,n}function pc(l){let e,t,n,s,i,o;n=new tt({props:{code:l[6]?.innerText}});let a=rn(l[9]),c=[];for(let r=0;r<a.length;r+=1)c[r]=Rs(Ds(l,a,r));return{c(){e=ke("code"),t=ke("div"),ol(n.$$.fragment),s=cl(),i=ke("div");for(let r=0;r<c.length;r+=1)c[r].c();ze(t,"class","copy svelte-j71ub0"),ze(e,"class","svelte-j71ub0")},m(r,_){ye(r,e,_),B(e,t),al(n,t,null),B(e,s),B(e,i);for(let u=0;u<c.length;u+=1)c[u]&&c[u].m(i,null);l[16](i),o=!0},p(r,_){const u={};if(_&64&&(u.code=r[6]?.innerText),n.$set(u),_&513){a=rn(r[9]);let f;for(f=0;f<a.length;f+=1){const p=Ds(r,a,f);c[f]?c[f].p(p,_):(c[f]=Rs(p),c[f].c(),c[f].m(i,null))}for(;f<c.length;f+=1)c[f].d(1);c.length=a.length}},i(r){o||(an(n.$$.fragment,r),o=!0)},o(r){cn(n.$$.fragment,r),o=!1},d(r){r&&we(e),rl(n),Xl(c,r),l[16](null)}}}function mc(l){let e,t,n,s,i,o,a,c,r,_,u,f,p;n=new tt({props:{code:l[5]?.innerText}});let g=l[2]!==null&&Bs(l),h=rn(l[8]),$=[];for(let m=0;m<h.length;m+=1)$[m]=Hs(Fs(l,h,m));return{c(){e=ke("code"),t=ke("div"),ol(n.$$.fragment),s=cl(),i=ke("div"),o=ke("pre"),a=G(`import { Client } from "@gradio/client";
42
43const app = await Client.connect(`),c=ke("span"),r=G('"'),_=G(l[0]),u=G('"'),g&&g.c(),f=G(`);
44					`);for(let m=0;m<$.length;m+=1)$[m].c();ze(t,"class","copy svelte-j71ub0"),ze(c,"class","token string svelte-j71ub0"),ze(o,"class","svelte-j71ub0"),ze(e,"class","svelte-j71ub0")},m(m,w){ye(m,e,w),B(e,t),al(n,t,null),B(e,s),B(e,i),B(i,o),B(o,a),B(o,c),B(c,r),B(c,_),B(c,u),g&&g.m(o,null),B(o,f);for(let k=0;k<$.length;k+=1)$[k]&&$[k].m(o,null);l[15](i),p=!0},p(m,w){const k={};if(w&32&&(k.code=m[5]?.innerText),n.$set(k),(!p||w&1)&&Qe(_,m[0]),m[2]!==null?g?g.p(m,w):(g=Bs(m),g.c(),g.m(o,f)):g&&(g.d(1),g=null),w&256){h=rn(m[8]);let d;for(d=0;d<h.length;d+=1){const v=Fs(m,h,d);$[d]?$[d].p(v,w):($[d]=Hs(v),$[d].c(),$[d].m(o,null))}for(;d<$.length;d+=1)$[d].d(1);$.length=h.length}},i(m){p||(an(n.$$.fragment,m),p=!0)},o(m){cn(n.$$.fragment,m),p=!1},d(m){m&&we(e),rl(n),g&&g.d(),Xl($,m),l[15](null)}}}function dc(l){let e,t,n,s,i,o,a,c,r,_,u,f,p,g,h,$;n=new tt({props:{code:l[4]}});let m=l[2]!==null&&Vs(l),w=rn(l[7]),k=[];for(let d=0;d<w.length;d+=1)k[d]=Ws(Us(l,w,d));return{c(){e=ke("code"),t=ke("div"),ol(n.$$.fragment),s=cl(),i=ke("div"),o=ke("pre"),a=ke("span"),a.textContent="from",c=G(" gradio_client "),r=ke("span"),r.textContent="import",_=G(` Client, file
45
46client = Client(`),u=ke("span"),f=G('"'),p=G(l[0]),g=G('"'),m&&m.c(),h=G(`)
47`);for(let d=0;d<k.length;d+=1)k[d].c();ze(t,"class","copy svelte-j71ub0"),ze(a,"class","highlight"),ze(r,"class","highlight"),ze(u,"class","token string svelte-j71ub0"),ze(o,"class","svelte-j71ub0"),ze(e,"class","svelte-j71ub0")},m(d,v){ye(d,e,v),B(e,t),al(n,t,null),B(e,s),B(e,i),B(i,o),B(o,a),B(o,c),B(o,r),B(o,_),B(o,u),B(u,f),B(u,p),B(u,g),m&&m.m(o,null),B(o,h);for(let y=0;y<k.length;y+=1)k[y]&&k[y].m(o,null);l[14](i),$=!0},p(d,v){const y={};if(v&16&&(y.code=d[4]),n.$set(y),(!$||v&1)&&Qe(p,d[0]),d[2]!==null?m?m.p(d,v):(m=Vs(d),m.c(),m.m(o,h)):m&&(m.d(1),m=null),v&128){w=rn(d[7]);let b;for(b=0;b<w.length;b+=1){const q=Us(d,w,b);k[b]?k[b].p(q,v):(k[b]=Ws(q),k[b].c(),k[b].m(o,null))}for(;b<k.length;b+=1)k[b].d(1);k.length=w.length}},i(d){$||(an(n.$$.fragment,d),$=!0)},o(d){cn(n.$$.fragment,d),$=!1},d(d){d&&we(e),rl(n),m&&m.d(),Xl(k,d),l[14](null)}}}function Rs(l){let e,t,n,s,i=l[21]+"",o,a,c="{",r,_,u=l[20]+"",f,p,g="}",h,$,m="{",w,k,d="}",v,y,b,q,j=l[21]+"",E,C,A,N;return{c(){e=ke("pre"),t=G("curl -X POST "),n=G(l[0]),s=G("call/"),o=G(i),a=G(` -s -H "Content-Type: application/json" -d '`),r=G(c),_=G(` 
48	"data": [`),f=G(u),p=G("]"),h=G(g),$=G(`' \\
49  | awk -F'"' '`),w=G(m),k=G(" print $4"),v=G(d),y=G(`' \\
50  | read EVENT_ID; curl -N `),b=G(l[0]),q=G("call/"),E=G(j),C=G("/$EVENT_ID"),A=cl(),N=ke("br"),ze(e,"class","svelte-j71ub0")},m(O,V){ye(O,e,V),B(e,t),B(e,n),B(e,s),B(e,o),B(e,a),B(e,r),B(e,_),B(e,f),B(e,p),B(e,h),B(e,$),B(e,w),B(e,k),B(e,v),B(e,y),B(e,b),B(e,q),B(e,E),B(e,C),ye(O,A,V),ye(O,N,V)},p(O,V){V&1&&Qe(n,O[0]),V&512&&i!==(i=O[21]+"")&&Qe(o,i),V&512&&u!==(u=O[20]+"")&&Qe(f,u),V&1&&Qe(b,O[0]),V&512&&j!==(j=O[21]+"")&&Qe(E,j)},d(O){O&&(we(e),we(A),we(N))}}}function Bs(l){let e,t,n;return{c(){e=G(', {auth: ["'),t=G(l[2]),n=G('", **password**]}')},m(s,i){ye(s,e,i),ye(s,t,i),ye(s,n,i)},p(s,i){i&4&&Qe(t,s[2])},d(s){s&&(we(e),we(t),we(n))}}}function Gs(l){let e,t=l[20]+"",n;return{c(){e=G(", "),n=G(t)},m(s,i){ye(s,e,i),ye(s,n,i)},p(s,i){i&256&&t!==(t=s[20]+"")&&Qe(n,t)},d(s){s&&(we(e),we(n))}}}function Hs(l){let e,t,n,s=l[21]+"",i,o,a,c=l[20]&&Gs(l);return{c(){e=G(`
51await client.predict(`),t=ke("span"),n=G(`
52  "/`),i=G(s),o=G('"'),c&&c.c(),a=G(`);
53						`),ze(t,"class","api-name svelte-j71ub0")},m(r,_){ye(r,e,_),ye(r,t,_),B(t,n),B(t,i),B(t,o),c&&c.m(r,_),ye(r,a,_)},p(r,_){_&256&&s!==(s=r[21]+"")&&Qe(i,s),r[20]?c?c.p(r,_):(c=Gs(r),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(r){r&&(we(e),we(t),we(a)),c&&c.d(r)}}}function Vs(l){let e,t,n;return{c(){e=G(', auth=("'),t=G(l[2]),n=G('", **password**)')},m(s,i){ye(s,e,i),ye(s,t,i),ye(s,n,i)},p(s,i){i&4&&Qe(t,s[2])},d(s){s&&(we(e),we(t),we(n))}}}function Ws(l){let e,t,n,s=l[20]+"",i,o,a,c,r=l[21]+"",_,u,f;return{c(){e=G(`
54client.`),t=ke("span"),n=G(`predict(
55`),i=G(s),o=G("  api_name="),a=ke("span"),c=G('"/'),_=G(r),u=G('"'),f=G(`
56)
57`),ze(a,"class","api-name svelte-j71ub0"),ze(t,"class","highlight")},m(p,g){ye(p,e,g),ye(p,t,g),B(t,n),B(t,i),B(t,o),B(t,a),B(a,c),B(a,_),B(a,u),B(t,f)},p(p,g){g&128&&s!==(s=p[20]+"")&&Qe(i,s),g&128&&r!==(r=p[21]+"")&&Qe(_,r)},d(p){p&&(we(e),we(t))}}}function hc(l){let e,t,n,s;const i=[dc,mc,pc],o=[];function a(c,r){return c[1]==="python"?0:c[1]==="javascript"?1:c[1]==="bash"?2:-1}return~(e=a(l))&&(t=o[e]=i[e](l)),{c(){t&&t.c(),n=rc()},m(c,r){~e&&o[e].m(c,r),ye(c,n,r),s=!0},p(c,r){let _=e;e=a(c),e===_?~e&&o[e].p(c,r):(t&&(ac(),cn(o[_],1,1,()=>{o[_]=null}),oc()),~e?(t=o[e],t?t.p(c,r):(t=o[e]=i[e](c),t.c()),an(t,1),t.m(n.parentNode,n)):t=null)},i(c){s||(an(t),s=!0)},o(c){cn(t),s=!1},d(c){c&&we(n),~e&&o[e].d(c)}}}function gc(l){let e,t,n;return t=new St({props:{border_mode:"focus",$$slots:{default:[hc]},$$scope:{ctx:l}}}),{c(){e=ke("div"),ol(t.$$.fragment),ze(e,"class","container svelte-j71ub0")},m(s,i){ye(s,e,i),al(t,e,null),n=!0},p(s,[i]){const o={};i&268436479&&(o.$$scope={dirty:i,ctx:s}),t.$set(o)},i(s){n||(an(t.$$.fragment,s),n=!0)},o(s){cn(t.$$.fragment,s),n=!1},d(s){s&&we(e),rl(t)}}}function bc(l,e,t){let{dependencies:n}=e,{short_root:s}=e,{root:i}=e,{api_prefix:o=""}=e,{current_language:a}=e,{username:c}=e,r,_,u,f,{api_calls:p=[]}=e;async function g(){return await(await fetch(i.replace(/\/$/,"")+o+"/info/?all_endpoints=true")).json()}let h,$=[],m=[],w=[];function k(b,q){const j=`/${n[b.fn_index].api_name}`,C=b.data.filter(A=>typeof A<"u").map((A,N)=>{if(h[j]){const O=h[j].parameters[N];if(!O)return;const V=O.parameter_name,te=O.python_type.type;if(q==="py")return`  ${V}=${Xe(A,te,"py")}`;if(q==="js")return`    ${V}: ${Xe(A,te,"js")}`;if(q==="bash")return`    ${Xe(A,te,"bash")}`}return`  ${Xe(A,void 0,q)}`}).filter(A=>typeof A<"u").join(`,
58`);if(C){if(q==="py")return`${C},
59`;if(q==="js")return`{
60${C},
61}`;if(q==="bash")return`
62${C}
63`}return q==="py"?"":`
64`}uc(async()=>{h=(await g()).named_endpoints;let q=p.map(A=>k(A,"py")),j=p.map(A=>k(A,"js")),E=p.map(A=>k(A,"bash")),C=p.map(A=>n[A.fn_index].api_name||"");t(7,$=q.map((A,N)=>({call:A,api_name:C[N]}))),t(8,m=j.map((A,N)=>({call:A,api_name:C[N]}))),t(9,w=E.map((A,N)=>({call:A,api_name:C[N]}))),await fc(),t(4,_=r.innerText)});function d(b){ql[b?"unshift":"push"](()=>{r=b,t(3,r)})}function v(b){ql[b?"unshift":"push"](()=>{u=b,t(5,u)})}function y(b){ql[b?"unshift":"push"](()=>{f=b,t(6,f)})}return l.$$set=b=>{"dependencies"in b&&t(10,n=b.dependencies),"short_root"in b&&t(0,s=b.short_root),"root"in b&&t(11,i=b.root),"api_prefix"in b&&t(12,o=b.api_prefix),"current_language"in b&&t(1,a=b.current_language),"username"in b&&t(2,c=b.username),"api_calls"in b&&t(13,p=b.api_calls)},[s,a,c,r,_,u,f,$,m,w,n,i,o,p,d,v,y]}class vc extends ic{constructor(e){super(),cc(this,e,bc,gc,_c,{dependencies:10,short_root:0,root:11,api_prefix:12,current_language:1,username:2,api_calls:13})}get dependencies(){return this.$$.ctx[10]}set dependencies(e){this.$$set({dependencies:e}),Pt()}get short_root(){return this.$$.ctx[0]}set short_root(e){this.$$set({short_root:e}),Pt()}get root(){return this.$$.ctx[11]}set root(e){this.$$set({root:e}),Pt()}get api_prefix(){return this.$$.ctx[12]}set api_prefix(e){this.$$set({api_prefix:e}),Pt()}get current_language(){return this.$$.ctx[1]}set current_language(e){this.$$set({current_language:e}),Pt()}get username(){return this.$$.ctx[2]}set username(e){this.$$set({username:e}),Pt()}get api_calls(){return this.$$.ctx[13]}set api_calls(e){this.$$set({api_calls:e}),Pt()}}const $c="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20aria-hidden='true'%20focusable='false'%20role='img'%20width='1em'%20height='1em'%20preserveAspectRatio='xMidYMid%20meet'%20viewBox='0%200%2032%2032'%20%3e%3cpath%20d='M15.84.5a16.4,16.4,0,0,0-3.57.32C9.1,1.39,8.53,2.53,8.53,4.64V7.48H16v1H5.77a4.73,4.73,0,0,0-4.7,3.74,14.82,14.82,0,0,0,0,7.54c.57,2.28,1.86,3.82,4,3.82h2.6V20.14a4.73,4.73,0,0,1,4.63-4.63h7.38a3.72,3.72,0,0,0,3.73-3.73V4.64A4.16,4.16,0,0,0,19.65.82,20.49,20.49,0,0,0,15.84.5ZM11.78,2.77a1.39,1.39,0,0,1,1.38,1.46,1.37,1.37,0,0,1-1.38,1.38A1.42,1.42,0,0,1,10.4,4.23,1.44,1.44,0,0,1,11.78,2.77Z'%20fill='%235a9fd4'%20%3e%3c/path%3e%3cpath%20d='M16.16,31.5a16.4,16.4,0,0,0,3.57-.32c3.17-.57,3.74-1.71,3.74-3.82V24.52H16v-1H26.23a4.73,4.73,0,0,0,4.7-3.74,14.82,14.82,0,0,0,0-7.54c-.57-2.28-1.86-3.82-4-3.82h-2.6v3.41a4.73,4.73,0,0,1-4.63,4.63H12.35a3.72,3.72,0,0,0-3.73,3.73v7.14a4.16,4.16,0,0,0,3.73,3.82A20.49,20.49,0,0,0,16.16,31.5Zm4.06-2.27a1.39,1.39,0,0,1-1.38-1.46,1.37,1.37,0,0,1,1.38-1.38,1.42,1.42,0,0,1,1.38,1.38A1.44,1.44,0,0,1,20.22,29.23Z'%20fill='%23ffd43b'%20%3e%3c/path%3e%3c/svg%3e",kc="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20aria-hidden='true'%20focusable='false'%20role='img'%20width='1em'%20height='1em'%20preserveAspectRatio='xMidYMid%20meet'%20viewBox='0%200%2032%2032'%20%3e%3crect%20width='32'%20height='32'%20fill='%23f7df1e'%3e%3c/rect%3e%3cpath%20d='M21.5,25a3.27,3.27,0,0,0,3,1.83c1.25,0,2-.63,2-1.49,0-1-.81-1.39-2.19-2L23.56,23C21.39,22.1,20,20.94,20,18.49c0-2.25,1.72-4,4.41-4a4.44,4.44,0,0,1,4.27,2.41l-2.34,1.5a2,2,0,0,0-1.93-1.29,1.31,1.31,0,0,0-1.44,1.29c0,.9.56,1.27,1.85,1.83l.75.32c2.55,1.1,4,2.21,4,4.72,0,2.71-2.12,4.19-5,4.19a5.78,5.78,0,0,1-5.48-3.07Zm-10.63.26c.48.84.91,1.55,1.94,1.55s1.61-.39,1.61-1.89V14.69h3V25c0,3.11-1.83,4.53-4.49,4.53a4.66,4.66,0,0,1-4.51-2.75Z'%20%3e%3c/path%3e%3c/svg%3e",wc="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20version='1.1'%20id='Layer_1'%20x='0px'%20y='0px'%20viewBox='0%200%20150%20150'%20style='enable-background:new%200%200%20150%20150;%20background-color:%20%2372a824;'%20xml:space='preserve'%3e%3cscript%20xmlns=''/%3e%3cstyle%20type='text/css'%3e%20.st0{fill:%23FFFFFF;}%20%3c/style%3e%3cg%3e%3cpath%20class='st0'%20d='M118.9,40.3L81.7,18.2c-2.2-1.3-4.7-2-7.2-2s-5,0.7-7.2,2L30.1,40.3c-4.4,2.6-7.2,7.5-7.2,12.8v44.2%20c0,5.3,2.7,10.1,7.2,12.8l37.2,22.1c2.2,1.3,4.7,2,7.2,2c2.5,0,5-0.7,7.2-2l37.2-22.1c4.4-2.6,7.2-7.5,7.2-12.8V53%20C126.1,47.8,123.4,42.9,118.9,40.3z%20M90.1,109.3l0.1,3.2c0,0.4-0.2,0.8-0.5,1l-1.9,1.1c-0.3,0.2-0.5,0-0.6-0.4l0-3.1%20c-1.
646,0.7-3.2,0.8-4.3,0.4c-0.2-0.1-0.3-0.4-0.2-0.7l0.7-2.9c0.1-0.2,0.2-0.5,0.3-0.6c0.1-0.1,0.1-0.1,0.2-0.1%20c0.1-0.1,0.2-0.1,0.3,0c1.1,0.4,2.6,0.2,3.9-0.5c1.8-0.9,2.9-2.7,2.9-4.5c0-1.6-0.9-2.3-3-2.3c-2.7,0-5.2-0.5-5.3-4.5%20c0-3.3,1.7-6.7,4.4-8.8l0-3.2c0-0.4,0.2-0.8,0.5-1l1.8-1.2c0.3-0.2,0.5,0,0.6,0.4l0,3.2c1.3-0.5,2.5-0.7,3.6-0.4%20c0.2,0.1,0.3,0.4,0.2,0.7l-0.7,2.8c-0.1,0.2-0.2,0.4-0.3,0.6c-0.1,0.1-0.1,0.1-0.2,0.1c-0.1,0-0.2,0.1-0.3,0%20c-0.5-0.1-1.6-0.4-3.4,0.6c-1.9,1-2.6,2.6-2.5,3.8c0,1.5,0.8,1.9,3.3,1.9c3.4,0.1,4.9,1.6,5,5C94.7,103.4,92.9,107,90.1,109.3z%20M109.6,103.9c0,0.3,0,0.6-0.3,0.7l-9.4,5.7c-0.2,0.1-0.4,0-0.4-0.3v-2.4c0-0.3,0.2-0.5,0.4-0.6l9.3-5.5c0.2-0.1,0.4,0,0.4,0.3%20V103.9z%20M116.1,49.6L80.9,71.3c-4.4,2.6-7.6,5.4-7.6,10.7v43.4c0,3.2,1.3,5.2,3.2,5.8c-0.6,0.1-1.3,0.2-2,0.2%20c-2.1,0-4.1-0.6-5.9-1.6l-37.2-22.1c-3.6-2.2-5.9-6.2-5.9-10.5V53c0-4.3,2.3-8.4,5.9-10.5l37.2-22.1c1.8-1.1,3.8-1.6,5.9-1.6%20s4.1,0.6,5.9,1.6l37.2,22.1c3.1,1.8,5.1,5,5.7,8.5C122.1,48.4,119.3,47.7,116.1,49.6z'/%3e%3c/g%3e%3c/svg%3e",{SvelteComponent:yc,append:Ve,attr:Vt,check_outros:Cc,create_component:qc,destroy_component:Sc,destroy_each:Ec,detach:Me,element:ot,empty:Nc,ensure_array_like:Zs,flush:Dn,group_outros:jc,init:Lc,insert:Pe,mount_component:zc,noop:Tc,safe_not_equal:Ac,set_data:_n,set_style:Mc,space:Xt,text:Ye,toggle_class:Js,transition_in:Hn,transition_out:Ol}=window.__gradio__svelte__internal;function Qs(l,e,t){const n=l.slice();return n[4]=e[t].label,n[5]=e[t].type,n[6]=e[t].python_type,n[7]=e[t].component,n[8]=e[t].serializer,n[10]=t,n}function Pc(l){let e;return{c(){e=Ye("1 element")},m(t,n){Pe(t,e,n)},p:Tc,d(t){t&&Me(e)}}}function Oc(l){let e=l[3]=="python"?"tuple":"list",t,n,s=l[1].length+"",i,o;return{c(){t=Ye(e),n=Ye(" of "),i=Ye(s),o=Ye(`
65		elements`)},m(a,c){Pe(a,t,c),Pe(a,n,c),Pe(a,i,c),Pe(a,o,c)},p(a,c){c&8&&e!==(e=a[3]=="python"?"tuple":"list")&&_n(t,e),c&2&&s!==(s=a[1].length+"")&&_n(i,s)},d(a){a&&(Me(t),Me(n),Me(i),Me(o))}}}function Ys(l){let e;return{c(){e=ot("span"),e.textContent=`[${l[10]}]`,Vt(e,"class","code svelte-16h224k")},m(t,n){Pe(t,e,n)},d(t){t&&Me(e)}}}function Ic(l){let e=l[2][l[10]].type+"",t;return{c(){t=Ye(e)},m(n,s){Pe(n,t,s)},p(n,s){s&4&&e!==(e=n[2][n[10]].type+"")&&_n(t,e)},d(n){n&&Me(t)}}}function Dc(l){let e=l[6].type+"",t;return{c(){t=Ye(e)},m(n,s){Pe(n,t,s)},p(n,s){s&2&&e!==(e=n[6].type+"")&&_n(t,e)},d(n){n&&Me(t)}}}function Ks(l){let e,t,n,s,i,o,a,c,r,_=l[4]+"",u,f,p=l[7]+"",g,h,$,m=l[1].length>1&&Ys(l);function w(v,y){return v[3]==="python"?Dc:Ic}let k=w(l),d=k(l);return{c(){e=ot("hr"),t=Xt(),n=ot("div"),s=ot("p"),m&&m.c(),i=Xt(),o=ot("span"),d.c(),a=Xt(),c=ot("p"),r=Ye('The output value that appears in the "'),u=Ye(_),f=Ye('" '),g=Ye(p),h=Ye(`
66				component.`),$=Xt(),Vt(e,"class","hr svelte-16h224k"),Vt(o,"class","code highlight svelte-16h224k"),Vt(c,"class","desc svelte-16h224k"),Mc(n,"margin","10px")},m(v,y){Pe(v,e,y),Pe(v,t,y),Pe(v,n,y),Ve(n,s),m&&m.m(s,null),Ve(s,i),Ve(s,o),d.m(o,null),Ve(n,a),Ve(n,c),Ve(c,r),Ve(c,u),Ve(c,f),Ve(c,g),Ve(c,h),Ve(n,$)},p(v,y){v[1].length>1?m||(m=Ys(v),m.c(),m.m(s,i)):m&&(m.d(1),m=null),k===(k=w(v))&&d?d.p(v,y):(d.d(1),d=k(v),d&&(d.c(),d.m(o,null))),y&2&&_!==(_=v[4]+"")&&_n(u,_),y&2&&p!==(p=v[7]+"")&&_n(g,p)},d(v){v&&(Me(e),Me(t),Me(n)),m&&m.d(),d.d()}}}function Xs(l){let e,t,n;return t=new to({props:{margin:!1}}),{c(){e=ot("div"),qc(t.$$.fragment),Vt(e,"class","load-wrap")},m(s,i){Pe(s,e,i),zc(t,e,null),n=!0},i(s){n||(Hn(t.$$.fragment,s),n=!0)},o(s){Ol(t.$$.fragment,s),n=!1},d(s){s&&Me(e),Sc(t)}}}function Fc(l){let e,t,n,s,i,o,a,c;function r(h,$){return h[1].length>1?Oc:Pc}let _=r(l),u=_(l),f=Zs(l[1]),p=[];for(let h=0;h<f.length;h+=1)p[h]=Ks(Qs(l,f,h));let g=l[0]&&Xs();return{c(){e=ot("h4"),t=ot("div"),t.innerHTML='<div class="toggle-dot toggle-right svelte-16h224k"></div>',n=Ye(`
67	Returns `),u.c(),s=Xt(),i=ot("div");for(let h=0;h<p.length;h+=1)p[h].c();o=Xt(),g&&g.c(),a=Nc(),Vt(t,"class","toggle-icon svelte-16h224k"),Vt(e,"class","svelte-16h224k"),Js(i,"hide",l[0])},m(h,$){Pe(h,e,$),Ve(e,t),Ve(e,n),u.m(e,null),Pe(h,s,$),Pe(h,i,$);for(let m=0;m<p.length;m+=1)p[m]&&p[m].m(i,null);
vendor: 20,125 bytes, lines 67-105
67Pe(h,o,$),g&&g.m(h,$),Pe(h,a,$),c=!0},p(h,[$]){if(_===(_=r(h))&&u?u.p(h,$):(u.d(1),u=_(h),u&&(u.c(),u.m(e,null))),$&14){f=Zs(h[1]);let m;for(m=0;m<f.length;m+=1){const w=Qs(h,f,m);p[m]?p[m].p(w,$):(p[m]=Ks(w),p[m].c(),p[m].m(i,null))}for(;m<p.length;m+=1)p[m].d(1);p.length=f.length}(!c||$&1)&&Js(i,"hide",h[0]),h[0]?g?$&1&&Hn(g,1):(g=Xs(),g.c(),Hn(g,1),g.m(a.parentNode,a)):g&&(jc(),Ol(g,1,1,()=>{g=null}),Cc())},i(h){c||(Hn(g),c=!0)},o(h){Ol(g),c=!1},d(h){h&&(Me(e),Me(s),Me(i),Me(o),Me(a)),u.d(),Ec(p,h),g&&g.d(h)}}}function Uc(l,e,t){let{is_running:n}=e,{endpoint_returns:s}=e,{js_returns:i}=e,{current_language:o}=e;return l.$$set=a=>{"is_running"in a&&t(0,n=a.is_running),"endpoint_returns"in a&&t(1,s=a.endpoint_returns),"js_returns"in a&&t(2,i=a.js_returns),"current_language"in a&&t(3,o=a.current_language)},[n,s,i,o]}class Rc extends yc{constructor(e){super(),Lc(this,e,Uc,Fc,Ac,{is_running:0,endpoint_returns:1,js_returns:2,current_language:3})}get is_running(){return this.$$.ctx[0]}set is_running(e){this.$$set({is_running:e}),Dn()}get endpoint_returns(){return this.$$.ctx[1]}set endpoint_returns(e){this.$$set({endpoint_returns:e}),Dn()}get js_returns(){return this.$$.ctx[2]}set js_returns(e){this.$$set({js_returns:e}),Dn()}get current_language(){return this.$$.ctx[3]}set current_language(e){this.$$set({current_language:e}),Dn()}}const Bc=""+new URL("mcp-DNm9doVd.svg",import.meta.url).href,{SvelteComponent:Gc,append:F,attr:U,bubble:xs,check_outros:Nt,create_component:Be,destroy_component:Ge,destroy_each:_l,detach:L,element:D,empty:Zt,ensure_array_like:jt,flush:Ot,group_outros:Lt,init:Hc,insert:z,listen:uo,mount_component:He,noop:Ke,safe_not_equal:Vc,set_data:gt,set_style:Ft,space:X,src_url_equal:Wc,text:H,transition_in:ee,transition_out:se}=window.__gradio__svelte__internal,{onMount:Zc,createEventDispatcher:Jc}=window.__gradio__svelte__internal;function ei(l,e,t){const n=l.slice();return n[24]=e[t],n[26]=t,n}function ti(l,e,t){const n=l.slice();return n[27]=e[t],n[28]=e,n[29]=t,n}function ni(l,e,t){const n=l.slice();return n[30]=e[t][0],n[31]=e[t][1],n}function li(l,e,t){const n=l.slice();return n[34]=e[t][0],n[35]=e[t][1],n[36]=e[t][2],n}function si(l){let e,t,n,s;const i=[Yc,Qc],o=[];function a(c,r){return c[11]?0:1}return e=a(l),t=o[e]=i[e](l),{c(){t.c(),n=Zt()},m(c,r){o[e].m(c,r),z(c,n,r),s=!0},p(c,r){t.p(c,r)},i(c){s||(ee(t),s=!0)},o(c){se(t),s=!1},d(c){c&&L(n),o[e].d(c)}}}function Qc(l){let e,t;return e=new kr({props:{root:l[0]}}),e.$on("close",l[20]),{c(){Be(e.$$.fragment)},m(n,s){He(e,n,s),t=!0},p(n,s){const i={};s[0]&1&&(i.root=n[0]),e.$set(i)},i(n){t||(ee(e.$$.fragment,n),t=!0)},o(n){se(e.$$.fragment,n),t=!1},d(n){Ge(e,n)}}}function Yc(l){let e,t,n,s,i,o,a,c,r,_,u,f,p;t=new Ir({props:{root:l[3]||l[0],api_count:l[11],current_language:l[6]}}),t.$on("close",l[16]);let g=jt(l[12]),h=[];for(let d=0;d<g.length;d+=1)h[d]=ii(li(l,g,d));const $=[Xc,Kc],m=[];function w(d,v){return d[5].length?0:1}_=w(l),u=m[_]=$[_](l);let k=l[6]!=="mcp"&&mi(l);return{c(){e=D("div"),Be(t.$$.fragment),n=X(),s=D("div"),i=D("div"),i.innerHTML='<p style="font-size: var(--text-lg);">Choose one of the following ways to interact with the API.</p>',o=X(),a=D("div"),c=D("div");for(let d=0;d<h.length;d+=1)h[d].c();r=X(),u.c(),f=X(),k&&k.c(),U(e,"class","banner-wrap svelte-mko7us"),U(i,"class","client-doc svelte-mko7us"),U(c,"class","snippets svelte-mko7us"),U(a,"class","endpoint svelte-mko7us"),U(s,"class","docs-wrap svelte-mko7us")},m(d,v){z(d,e,v),He(t,e,null),z(d,n,v),z(d,s,v),F(s,i),F(s,o),F(s,a),F(a,c);for(let y=0;y<h.length;y+=1)h[y]&&h[y].m(c,null);F(a,r),m[_].m(a,null),F(a,f),k&&k.m(a,null),p=!0},p(d,v){const y={};if(v[0]&9&&(y.root=d[3]||d[0]),v[0]&64&&(y.current_language=d[6]),t.$set(y),v[0]&4160){g=jt(d[12]);let q;for(q=0;q<g.length;q+=1){const j=li(d,g,q);h[q]?h[q].p(j,v):(h[q]=ii(j),h[q].c(),h[q].m(c,null))}for(;q<h.length;q+=1)h[q].d(1);h.length=g.length}let b=_;_=w(d),_===b?m[_].p(d,v):(Lt(),se(m[b],1,1,()=>{m[b]=null}),Nt(),u=m[_],u?u.p(d,v):(u=m[_]=$[_](d),u.c()),ee(u,1),u.m(a,f)),d[6]!=="mcp"?k?(k.p(d,v),v[0]&64&&ee(k,1)):(k=mi(d),k.c(),ee(k,1),k.m(a,null)):k&&(Lt(),se(k,1,1,()=>{k=null}),Nt())},i(d){p||(ee(t.$$.fragment,d),ee(u),ee(k),p=!0)},o(d){se(t.$$.fragment,d),se(u),se(k),p=!1},d(d){d&&(L(e),L(n),L(s)),Ge(t),_l(h,d),m[_].d(),k&&k.d()}}}function ii(l){let e,t,n,s,i=l[35]+"",o,a,c,r,_;function u(){return l[17](l[34])}return{c(){e=D("li"),t=D("img"),s=X(),o=H(i),a=X(),Wc(t.src,n=l[36])||U(t,"src",n),U(t,"alt",""),U(t,"class","svelte-mko7us"),U(e,"class",c="snippet "+(l[6]===l[34]?"current-lang":"inactive-lang")+" svelte-mko7us")},m(f,p){z(f,e,p),F(e,t),F(e,s),F(e,o),F(e,a),r||(_=uo(e,"click",u),r=!0)},p(f,p){l=f,p[0]&64&&c!==(c="snippet "+(l[6]===l[34]?"current-lang":"inactive-lang")+" svelte-mko7us")&&U(e,"class",c)},d(f){f&&L(e),r=!1,_()}}}function Kc(l){let e,t,n,s,i,o;const a=[t_,e_,xc],c=[];function r(u,f){return u[6]=="python"||u[6]=="javascript"?0:u[6]=="mcp"?1:2}t=r(l),n=c[t]=a[t](l);let _=l[6]!=="mcp"&&_i(l);return{c(){e=D("p"),n.c(),s=X(),_&&_.c(),i=Zt(),U(e,"class","padded svelte-mko7us")},m(u,f){z(u,e,f),c[t].m(e,null),z(u,s,f),_&&_.m(u,f),z(u,i,f),o=!0},p(u,f){let p=t;t=r(u),t===p?c[t].p(u,f):(Lt(),se(c[p],1,1,()=>{c[p]=null}),Nt(),n=c[t],n?n.p(u,f):(n=c[t]=a[t](u),n.c()),ee(n,1),n.m(e,null)),u[6]!=="mcp"?_?(_.p(u,f),f[0]&64&&ee(_,1)):(_=_i(u),_.c(),ee(_,1),_.m(i.parentNode,i)):_&&(Lt(),se(_,1,1,()=>{_=null}),Nt())},i(u){o||(ee(n),ee(_),o=!0)},o(u){se(n),se(_),o=!1},d(u){u&&(L(e),L(s),L(i)),c[t].d(),_&&_.d(u)}}}function Xc(l){let e,t,n,s,i,o=l[5].length+"",a,c,r,_,u,f,p,g,h,$,m,w,k,d;return h=new vc({props:{current_language:l[6],api_calls:l[5],dependencies:l[1],root:l[0],api_prefix:l[2].api_prefix,short_root:l[3]||l[0],username:l[4]}}),{c(){e=D("div"),t=D("p"),n=H("🪄 Recorded API Calls "),s=D("span"),i=H("["),a=H(o),c=H("]"),r=X(),_=D("p"),u=H(`Here is the code snippet to replay the most recently recorded API
68							calls using the `),f=H(l[6]),p=H(`
69							client.`),g=X(),Be(h.$$.fragment),$=X(),m=D("p"),m.textContent=`Note: Some API calls only affect the UI, so when using the
70							clients, the desired result may be achieved with only a subset of
71							the recorded calls.`,w=X(),k=D("p"),k.textContent="API Documentation",U(s,"class","api-count svelte-mko7us"),U(t,"id","num-recorded-api-calls"),Ft(t,"font-size","var(--text-lg)"),Ft(t,"font-weight","bold"),Ft(t,"margin","10px 0px"),Ft(k,"font-size","var(--text-lg)"),Ft(k,"font-weight","bold"),Ft(k,"margin","30px 0px 10px")},m(v,y){z(v,e,y),F(e,t),F(t,n),F(t,s),F(s,i),F(s,a),F(s,c),F(e,r),F(e,_),F(_,u),F(_,f),F(_,p),F(e,g),He(h,e,null),F(e,$),F(e,m),z(v,w,y),z(v,k,y),d=!0},p(v,y){(!d||y[0]&32)&&o!==(o=v[5].length+"")&&gt(a,o),(!d||y[0]&64)&&gt(f,v[6]);const b={};y[0]&64&&(b.current_language=v[6]),y[0]&32&&(b.api_calls=v[5]),y[0]&2&&(b.dependencies=v[1]),y[0]&1&&(b.root=v[0]),y[0]&4&&(b.api_prefix=v[2].api_prefix),y[0]&9&&(b.short_root=v[3]||v[0]),y[0]&16&&(b.username=v[4]),h.$set(b)},i(v){d||(ee(h.$$.fragment,v),d=!0)},o(v){se(h.$$.fragment,v),d=!1},d(v){v&&(L(e),L(w),L(k)),Ge(h)}}}function xc(l){let e;return{c(){e=H("1. Confirm that you have cURL installed on your system.")},m(t,n){z(t,e,n)},p:Ke,i:Ke,o:Ke,d(t){t&&L(e)}}}function e_(l){let e,t,n,s;const i=[l_,n_],o=[];function a(c,r){return c[7]?0:1}return e=a(l),t=o[e]=i[e](l),{c(){t.c(),n=Zt()},m(c,r){o[e].m(c,r),z(c,n,r),s=!0},p(c,r){let _=e;e=a(c),e===_?o[e].p(c,r):(Lt(),se(o[_],1,1,()=>{o[_]=null}),Nt(),t=o[e],t?t.p(c,r):(t=o[e]=i[e](c),t.c()),ee(t,1),t.m(n.parentNode,n))},i(c){s||(ee(t),s=!0)},o(c){se(t),s=!1},d(c){c&&L(n),o[e].d(c)}}}function t_(l){let e,t,n,s,i,o,a,c;return{c(){e=H(`1. Install the
72							`),t=D("span"),n=H(l[6]),s=H(`
73							client (`),i=D("a"),o=H("docs"),c=H(") if you don't already have it installed."),Ft(t,"text-transform","capitalize"),U(i,"href",a=l[6]=="python"?Xn:Kn),U(i,"target","_blank"),U(i,"class","svelte-mko7us")},m(r,_){z(r,e,_),z(r,t,_),F(t,n),z(r,s,_),z(r,i,_),F(i,o),z(r,c,_)},p(r,_){_[0]&64&&gt(n,r[6]),_[0]&64&&a!==(a=r[6]=="python"?Xn:Kn)&&U(i,"href",a)},i:Ke,o:Ke,d(r){r&&(L(e),L(t),L(s),L(i),L(c))}}}function n_(l){let e,t,n,s,i,o,a;return{c(){e=H(`This Gradio app can also serve as an MCP server, with an MCP
74								tool corresponding to each API endpoint. To enable this, launch
75								this Gradio app with `),t=D("code"),t.textContent=".launch(mcp_server=True)",n=H(` or
76								set the `),s=D("code"),s.textContent="GRADIO_MCP_SERVER",i=H(` env variable to
77								`),o=D("code"),o.textContent='"True"',a=H("."),U(t,"class","svelte-mko7us"),U(s,"class","svelte-mko7us"),U(o,"class","svelte-mko7us")},m(c,r){z(c,e,r),z(c,t,r),z(c,n,r),z(c,s,r),z(c,i,r),z(c,o,r),z(c,a,r)},p:Ke,i:Ke,o:Ke,d(c){c&&(L(e),L(t),L(n),L(s),L(i),L(o),L(a))}}}function l_(l){let e,t,n,s,i,o,a,c,r,_,u,f,p,g,h,$,m,w,k,d,v,y,b,q,j,E,C,A,N,O;e=new St({props:{$$slots:{default:[s_]},$$scope:{ctx:l}}});let V=jt(l[10]),te=[];for(let T=0;T<V.length;T+=1)te[T]=ci(ti(l,V,T));return h=new St({props:{$$slots:{default:[r_]},$$scope:{ctx:l}}}),j=new St({props:{$$slots:{default:[a_]},$$scope:{ctx:l}}}),{c(){Be(e.$$.fragment),t=X(),n=D("p"),n.textContent=" ",s=X(),i=D("strong"),i.textContent="Available MCP Tools",o=X(),a=D("div");for(let T=0;T<te.length;T+=1)te[T].c();c=X(),r=D("p"),r.textContent=" ",_=X(),u=D("strong"),u.textContent="Integration",f=H(`: To add this MCP to clients that
78								support SSE (e.g. Cursor, Windsurf, Cline), simply add the
79								following configuration to your MCP config:
80								`),p=D("p"),p.textContent=" ",g=X(),Be(h.$$.fragment),$=X(),m=D("p"),m.textContent=" ",w=X(),k=D("em"),k.textContent="Experimental stdio support",d=H(`: For clients that only
81								support stdio, first
82								`),v=D("a"),v.textContent="install Node.js",y=H(`. Then, you can use the following command:
83								`),b=D("p"),b.textContent=" ",q=X(),Be(j.$$.fragment),E=X(),C=D("p"),C.textContent=" ",A=X(),N=D("p"),N.textContent=" ",U(a,"class","mcp-tools svelte-mko7us"),U(v,"href","https://nodejs.org/en/download/"),U(v,"target","_blank"),U(v,"class","svelte-mko7us")},m(T,P){He(e,T,P),z(T,t,P),z(T,n,P),z(T,s,P),z(T,i,P),z(T,o,P),z(T,a,P);for(let x=0;x<te.length;x+=1)te[x]&&te[x].m(a,null);z(T,c,P),z(T,r,P),z(T,_,P),z(T,u,P),z(T,f,P),z(T,p,P),z(T,g,P),He(h,T,P),z(T,$,P),z(T,m,P),z(T,w,P),z(T,k,P),z(T,d,P),z(T,v,P),z(T,y,P),z(T,b,P),z(T,q,P),He(j,T,P),z(T,E,P),z(T,C,P),z(T,A,P),z(T,N,P),O=!0},p(T,P){const x={};if(P[1]&256&&(x.$$scope={dirty:P,ctx:T}),e.$set(x),P[0]&1024){V=jt(T[10]);let ie;for(ie=0;ie<V.length;ie+=1){const Se=ti(T,V,ie);te[ie]?te[ie].p(Se,P):(te[ie]=ci(Se),te[ie].c(),te[ie].m(a,null))}for(;ie<te.length;ie+=1)te[ie].d(1);te.length=V.length}const Z={};P[1]&256&&(Z.$$scope={dirty:P,ctx:T}),h.$set(Z);const re={};P[1]&256&&(re.$$scope={dirty:P,ctx:T}),j.$set(re)},i(T){O||(ee(e.$$.fragment,T),ee(h.$$.fragment,T),ee(j.$$.fragment,T),O=!0)},o(T){se(e.$$.fragment,T),se(h.$$.fragment,T),se(j.$$.fragment,T),O=!1},d(T){T&&(L(t),L(n),L(s),L(i),L(o),L(a),L(c),L(r),L(_),L(u),L(f),L(p),L(g),L($),L(m),L(w),L(k),L(d),L(v),L(y),L(b),L(q),L(E),L(C),L(A),L(N)),Ge(e,T),_l(te,T),Ge(h,T),Ge(j,T)}}}function s_(l){let e,t,n,s,i,o,a,c;return a=new tt({props:{code:l[14]}}),{c(){e=D("div"),t=D("label"),t.innerHTML=`<span class="status-indicator active svelte-mko7us">●</span>MCP Server
84											URL`,n=X(),s=D("div"),i=D("input"),o=X(),Be(a.$$.fragment),U(t,"class","svelte-mko7us"),U(i,"type","text"),i.readOnly=!0,i.value=l[14],U(i,"class","svelte-mko7us"),U(s,"class","textbox svelte-mko7us"),U(e,"class","mcp-url svelte-mko7us")},m(r,_){z(r,e,_),F(e,t),F(e,n),F(e,s),F(s,i),F(s,o),He(a,s,null),c=!0},p:Ke,i(r){c||(ee(a.$$.fragment,r),c=!0)},o(r){se(a.$$.fragment,r),c=!1},d(r){r&&L(e),Ge(a)}}}function oi(l){let e,t=Object.keys(l[27].parameters).length>0,n=t&&ri(l);return{c(){e=D("div"),n&&n.c(),U(e,"class","tool-content svelte-mko7us")},m(s,i){z(s,e,i),n&&n.m(e,null)},p(s,i){i[0]&1024&&(t=Object.keys(s[27].parameters).length>0),t?n?n.p(s,i):(n=ri(s),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(s){s&&L(e),n&&n.d()}}}function ri(l){let e,t;function n(o,a){return a[0]&1024&&(t=null),t==null&&(t=Object.keys(o[27].parameters).length>0),t?o_:i_}let s=n(l,[-1,-1]),i=s(l);return{c(){e=D("div"),i.c(),U(e,"class","tool-parameters")},m(o,a){z(o,e,a),i.m(e,null)},p(o,a){s===(s=n(o,a))&&i?i.p(o,a):(i.d(1),i=s(o),i&&(i.c(),i.m(e,null)))},d(o){o&&L(e),i.d()}}}function i_(l){let e;return{c(){e=D("p"),e.textContent="No parameters"},m(t,n){z(t,e,n)},p:Ke,d(t){t&&L(e)}}}function o_(l){let e,t=jt(Object.entries(l[27].parameters)),n=[];for(let s=0;s<t.length;s+=1)n[s]=ai(ni(l,t,s));return{c(){for(let s=0;s<n.length;s+=1)n[s].c();e=Zt()},m(s,i){for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(s,i);z(s,e,i)},p(s,i){if(i[0]&1024){t=jt(Object.entries(s[27].parameters));let o;for(o=0;o<t.length;o+=1){const a=ni(s,t,o);n[o]?n[o].p(a,i):(n[o]=ai(a),n[o].c(),n[o].m(e.parentNode,e))}for(;o<n.length;o+=1)n[o].d(1);n.length=t.length}},d(s){s&&L(e),_l(n,s)}}}function ai(l){let e,t,n=l[30]+"",s,i,o,a,c=l[31].type+"",r,_,u,f,p=(l[31].description?l[31].description:"⚠︎ No description for this parameter in function docstring")+"",g,h;return{c(){e=D("div"),t=D("code"),s=H(n),i=X(),o=D("span"),a=H("("),r=H(c),_=H(")"),u=X(),f=D("p"),g=H(p),h=X(),U(t,"class","svelte-mko7us"),U(o,"class","parameter-type svelte-mko7us"),U(f,"class","parameter-description svelte-mko7us"),U(e,"class","parameter svelte-mko7us")},m($,m){z($,e,m),F(e,t),F(t,s),F(e,i),F(e,o),F(o,a),F(o,r),F(o,_),F(e,u),F(e,f),F(f,g),F(e,h)},p($,m){m[0]&1024&&n!==(n=$[30]+"")&&gt(s,n),m[0]&1024&&c!==(c=$[31].type+"")&&gt(r,c),m[0]&1024&&p!==(p=($[31].description?$[31].description:"⚠︎ No description for this parameter in function docstring")+"")&&gt(g,p)},d($){$&&L(e)}}}function ci(l){let e,t,n,s,i=l[27].name+"",o,a,c,r=(l[27].description?l[27].description:"⚠︎ No description provided in function docstring")+"",_,u,f,p=l[27].expanded?"▼":"▶",g,h,$,m,w;function k(){return l[18](l[27],l[28],l[29])}let d=l[27].expanded&&oi(l);return{c(){e=D("div"),t=D("button"),n=D("span"),s=D("span"),o=H(i),a=H(`  
85													`),c=D("span"),_=H(r),u=X(),f=D("span"),g=H(p),h=X(),d&&d.c(),$=X(),U(s,"class","tool-name svelte-mko7us"),U(c,"class","tool-description svelte-mko7us"),U(f,"class","tool-arrow svelte-mko7us"),U(t,"class","tool-header svelte-mko7us"),U(e,"class","tool-item svelte-mko7us")},m(v,y){z(v,e,y),F(e,t),F(t,n),F(n,s),F(s,o),F(n,a),F(n,c),F(c,_),F(t,u),F(t,f),F(f,g),F(e,h),d&&d.m(e,null),F(e,$),m||(w=uo(t,"click",k),m=!0)},p(v,y){l=v,y[0]&1024&&i!==(i=l[27].name+"")&&gt(o,i),y[0]&1024&&r!==(r=(l[27].description?l[27].description:"⚠︎ No description provided in function docstring")+"")&&gt(_,r),y[0]&1024&&p!==(p=l[27].expanded?"▼":"▶")&&gt(g,p),l[27].expanded?d?d.p(l,y):(d=oi(l),d.c(),d.m(e,$)):d&&(d.d(1),d=null)},d(v){v&&L(e),d&&d.d(),m=!1,w()}}}function r_(l){let e,t,n,s,i,o,a;return n=new tt({props:{code:JSON.stringify({mcpServers:{gradio:{url:l[14]}}},null,2)}}),{c(){e=D("code"),t=D("div"),Be(n.$$.fragment),s=X(),i=D("div"),o=D("pre"),o.textContent=`${JSON.stringify({mcpServers:{gradio:{url:l[14]}}},null,2)}`,U(t,"class","copy svelte-mko7us"),U(o,"class","svelte-mko7us"),U(e,"class","svelte-mko7us")},m(c,r){z(c,e,r),F(e,t),He(n,t,null),F(e,s),F(e,i),F(i,o),a=!0},p:Ke,i(c){a||(ee(n.$$.fragment,c),a=!0)},o(c){se(n.$$.fragment,c),a=!1},d(c){c&&L(e),Ge(n)}}}function a_(l){let e,t,n,s,i,o,a;return n=new tt({props:{code:JSON.stringify({mcpServers:{gradio:{command:"npx",args:["mcp-remote",l[14],"--transport","sse-only"]}}},null,2)}}),{c(){e=D("code"),t=D("div"),Be(n.$$.fragment),s=X(),i=D("div"),o=D("pre"),o.textContent=`${JSON.stringify({mcpServers:{gradio:{command:"npx",args:["mcp-remote",l[14],"--transport","sse-only"]}}},null,2)}`,U(t,"class","copy svelte-mko7us"),U(o,"class","svelte-mko7us"),U(e,"class","svelte-mko7us")},m(c,r){z(c,e,r),F(e,t),He(n,t,null),F(e,s),F(e,i),F(i,o),a=!0},p:Ke,i(c){a||(ee(n.$$.fragment,c),a=!0)},o(c){se(n.$$.fragment,c),a=!1},d(c){c&&L(e),Ge(n)}}}function _i(l){let e,t,n,s,i,o,a,c;e=new La({props:{current_language:l[6]}});let r=l[3]&&ui(l);o=new tl({props:{size:"sm",variant:"secondary",$$slots:{default:[c_]},$$scope:{ctx:l}}}),o.$on("click",l[19]);let _=l[6]=="bash"&&fi(l);return{c(){Be(e.$$.fragment),t=X(),n=D("p"),s=H(`2. Find the API endpoint below corresponding to your desired
86							function in the app. Copy the code snippet, replacing the
87							placeholder values with your own input data.
88							`),r&&r.c(),i=H(`
89
90							Or use the
91							`),Be(o.$$.fragment),a=H(`
92							to automatically generate your API requests.
93							`),_&&_.c(),U(n,"class","padded svelte-mko7us")},m(u,f){He(e,u,f),z(u,t,f),z(u,n,f),F(n,s),r&&r.m(n,null),F(n,i),He(o,n,null),F(n,a),_&&_.m(n,null),c=!0},p(u,f){const p={};f[0]&64&&(p.current_language=u[6]),e.$set(p),u[3]?r?r.p(u,f):(r=ui(u),r.c(),r.m(n,i)):r&&(r.d(1),r=null);const g={};f[1]&256&&(g.$$scope={dirty:f,ctx:u}),o.$set(g),u[6]=="bash"?_?_.p(u,f):(_=fi(u),_.c(),_.m(n,null)):_&&(_.d(1),_=null)},i(u){c||(ee(e.$$.fragment,u),ee(o.$$.fragment,u),c=!0)},o(u){se(e.$$.fragment,u),se(o.$$.fragment,u),c=!1},d(u){u&&(L(t),L(n)),Ge(e,u),r&&r.d(),Ge(o),_&&_.d()}}}function ui(l){let e,t,n,s,i;return{c(){e=H(`If this is a private Space, you may need to pass
94								your Hugging Face token as well (`),t=D("a"),n=H("read more"),i=H(")."),U(t,"href",s=l[6]=="python"?Xn+Fn:l[6]=="javascript"?Kn+Fn:Il),U(t,"class","underline svelte-mko7us"),U(t,"target","_blank")},m(o,a){z(o,e,a),z(o,t,a),F(t,n),z(o,i,a)},p(o,a){a[0]&64&&s!==(s=o[6]=="python"?Xn+Fn:o[6]=="javascript"?Kn+Fn:Il)&&U(t,"href",s)},d(o){o&&(L(e),L(t),L(i))}}}function c_(l){let e,t,n;return{c(){e=D("div"),t=X(),n=D("p"),n.textContent="API Recorder",U(e,"class","loading-dot svelte-mko7us"),U(n,"class","self-baseline svelte-mko7us")},m(s,i){z(s,e,i),z(s,t,i),z(s,n,i)},p:Ke,d(s){s&&(L(e),L(t),L(n))}}}function fi(l){let e,t,n,s,i,o,a,c,r,_,u,f,p,g,h,$,m,w,k,d,v,y,b,q,j=l[4]!==null&&pi();return{c(){e=D("br"),t=H(" "),n=D("br"),s=H(`Making a
95								prediction and getting a result requires
96								`),i=D("strong"),i.textContent="2 requests",o=H(`: a
97								`),a=D("code"),a.textContent="POST",c=H(`
98								and a `),r=D("code"),r.textContent="GET",_=H(" request. The "),u=D("code"),u.textContent="POST",f=H(` request
99								returns an `),p=D("code"),p.textContent="EVENT_ID",g=H(`, which is used in the second
100								`),h=D("code"),h.textContent="GET",$=H(` request to fetch the results. In these
101								snippets, we've used `),m=D("code"),m.textContent="awk",w=H(" and "),k=D("code"),k.textContent="read",d=H(` to
102								parse the results, combining these two requests into one command
103								for ease of use. `),j&&j.c(),v=H(` See
104								`),y=D("a"),b=H("curl docs"),q=H("."),U(a,"class","svelte-mko7us"),U(r,"class","svelte-mko7us"),U(u,"class","svelte-mko7us"),U(p,"class","svelte-mko7us"),U(h,"class","svelte-mko7us"),U(m,"class","svelte-mko7us"),U(k,"class","svelte-mko7us"),U(y,"href",Il),U(y,"target","_blank"),U(y,"class","svelte-mko7us")},m(E,C){z(E,e,C),z(E,t,C),z(E,n,C),z(E,s,C),z(E,i,C),z(E,o,C),z(E,a,C),z(E,c,C),z(E,r,C),z(E,_,C),z(E,u,C),z(E,f,C),z(E,p,C),z(E,g,C),z(E,h,C),z(E,$,C),z(E,m,C),z(E,w,C),z(E,k,C),z(E,d,C),j&&j.m(E,C),z(E,v,C),z(E,y,C),F(y,b),z(E,q,C)},p(E,C){E[4]!==null?j||(j=pi(),j.c(),j.m(v.parentNode,v)):j&&(j.d(1),j=null)},d(E){E&&(L(e),L(t),L(n),L(s),L(i),L(o),L(a),L(c),L(r),L(_),L(u),L(f),L(p),L(g),L(h),L($),L(m),L(w),L(k),L(d),L(v),L(y),L(q)),j&&j.d(E)}}}function pi(l){let e;return{c(){e=H(`Note: connecting to an authenticated app requires an
105									additional request.`)},m(t,n){z(t,e,n)},d(t){t&&L(e)}}}function mi(l){let e,t,n=jt(l[1]),s=[];for(let o=0;o<n.length;o+=1)s[o]=hi(ei(l,n,o));const i=o=>se(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Zt()},m(o,a){for(let c=0;c<s.length;c+=1)s[c]&&s[c].m(o,a);z(o,e,a),t=!0},p(o,a){if(a[0]&863){n=jt(o[1]);let c;for(c=0;c<n.length;c+=1){const r=ei(o,n,c);s[c]?(s[c].p(r,a),ee(s[c],1)):(s[c]=hi(r),s[c].c(),ee(s[c],1),s[c].m(e.parentNode,e))}for(Lt(),c=n.length;c<s.length;c+=1)i(c);Nt()}},i(o){if(!t){for(let a=0;a<n.length;
105a+=1)ee(s[a]);t=!0}},o(o){s=s.filter(Boolean);for(let a=0;a<s.length;a+=1)se(s[a]);t=!1},d(o){o&&L(e),_l(s,o)}}}function di(l){let e,t,n,s,i,o,a,c;return t=new sc({props:{named:!0,endpoint_parameters:l[8].named_endpoints["/"+l[24].api_name].parameters,dependency:l[24],dependency_index:l[26],current_language:l[6],root:l[0],space_id:l[3],username:l[4],api_prefix:l[2].api_prefix}}),s=new ta({props:{endpoint_returns:l[8].named_endpoints["/"+l[24].api_name].parameters,js_returns:l[9].named_endpoints["/"+l[24].api_name].parameters,is_running:gi,current_language:l[6]}}),o=new Rc({props:{endpoint_returns:l[8].named_endpoints["/"+l[24].api_name].returns,js_returns:l[9].named_endpoints["/"+l[24].api_name].returns,is_running:gi,current_language:l[6]}}),{c(){e=D("div"),Be(t.$$.fragment),n=X(),Be(s.$$.fragment),i=X(),Be(o.$$.fragment),a=X(),U(e,"class","endpoint-container svelte-mko7us")},m(r,_){z(r,e,_),He(t,e,null),F(e,n),He(s,e,null),F(e,i),He(o,e,null),F(e,a),c=!0},p(r,_){const u={};_[0]&258&&(u.endpoint_parameters=r[8].named_endpoints["/"+r[24].api_name].parameters),_[0]&2&&(u.depen
105dency=r[24]),_[0]&64&&(u.current_language=r[6]),_[0]&1&&(u.root=r[0]),_[0]&8&&(u.space_id=r[3]),_[0]&16&&(u.username=r[4]),_[0]&4&&(u.api_prefix=r[2].api_prefix),t.$set(u);const f={};_[0]&258&&(f.endpoint_returns=r[8].named_endpoints["/"+r[24].api_name].parameters),_[0]&514&&(f.js_returns=r[9].named_endpoints["/"+r[24].api_name].parameters),_[0]&64&&(f.current_language=r[6]),s.$set(f);const p={};_[0]&258&&(p.endpoint_returns=r[8].named_endpoints["/"+r[24].api_name].returns),_[0]&514&&(p.js_returns=r[9].named_endpoints["/"+r[24].api_name].returns),_[0]&64&&(p.current_language=r[6]),o.$set(p)},i(r){c||(ee(t.$$.fragment,r),ee(s.$$.fragment,r),ee(o.$$.fragment,r),c=!0)},o(r){se(t.$$.fragment,r),se(s.$$.fragment,r),se(o.$$.fragment,r),c=!1},d(r){r&&L(e),Ge(t),Ge(s),Ge(o)}}}function hi(l){let e,t,n=l[24].show_api&&l[8].named_endpoints["/"+l[24].api_name]&&di(l);return{c(){n&&n.c(),e=Zt()},m(s,i){n&&n.m(s,i),z(s,e,i),t=!0},p(s,i){s[24].show_api&&s[8].named_endpoints["/"+s[24].api_name]?n?(n.p(s,i),i[0]&258&&ee(n,1)):(n=di(s),n.c(),ee(n,1),n.m(e.parentNode,e)):n&&(Lt(),se(n,1,1,()=>{n=null}),Nt())},i(s){t||(ee(n),t=!0)},o(s){se(n),t=!1},d(s){s&&L(e),n&&n.d(s)}}}function __(l){let e,t,n=l[8]&&si(l);return{c(){n&&n.c(),e=Zt()},m(s,i){n&&n.m(s,i),z(s,e,i),t=!0},p(s,i){s[8]?n?(n.p(s,i),i[0]&256&&ee(n,1)):(n=si(s),n.c(),ee(n,1),n.m(e.parentNode,e)):n&&(Lt(),se(n,1,1,()=>{n=null}),Nt())},i(s){t||(ee(n),t=!0)},o(s){se(n),t=!1},d(s){s&&L(e),n&&n.d(s)}}}const Kn="https://www.gradio.app/guides/getting-started-with-the-js-client",Xn="https://www.gradio.app/guides/getting-started-with-the-python-client",Il="https://www.gradio.app/guides/querying-gradio-apps-with-curl",Fn="#connecting-to-a-hugging-face-space";let gi=!1;function u_(l,e,t){let{dependencies:n}=e,{root:s}=e,{app:i}=e,{space_id:o}=e,{root_node:a}=e,{username:c}=e,r=n.filter(C=>C.show_api).length;s===""&&(s=location.protocol+"//"+location.host+location.pathname),s.endsWith("/")||(s+="/");let{api_calls:_=[]}=e,u="python";const f=[["python","Python",$c],["javascript","JavaScript",kc],["bash","cURL",wc],["mcp","MCP",Bc]];let p=!1;async function g(){return await(await fetch(s.replace(/\/$/,"")+i.api_prefix+"/info")).json()}async function h(){return await i.view_api()}let $,m;g().then(C=>{t(8,$=C)}),h().then(C=>{t(9,m=C)});const w=Jc(),k=`${s}gradio_api/mcp/sse`;let d=[];async function v(){try{const A=await(await fetch(`${s}gradio_api/mcp/schema`)).json();t(10,d=Object.entries(A).map(([N,O])=>({name:`${N}`,description:O.description||"",parameters:O.properties||{},expanded:!1})))}catch(C){console.error("Failed to fetch MCP tools:",C),t(10,d=[])}}Zc(()=>(document.body.style.overflow="hidden","parentIFrame"in window&&window.parentIFrame?.scrollTo(0,0),fetch(k).then(C=>{t(7,p=C.ok),p&&v()}).catch(()=>{t(7,p=!1)}),()=>{document.body.style.overflow="auto"}));function y(C){xs.call(this,l,C)}const b=C=>t(6,u=C),q=(C,A,N)=>t(10,A[N].expanded=!C.expanded,d),j=()=>w("close",{api_recorder_visible:!0});function E(C){xs.call(this,l,C)}return l.$$set=C=>{"dependencies"in C&&t(1,n=C.dependencies),"root"in C&&t(0,s=C.root),"app"in C&&t(2,i=C.app),"space_id"in C&&t(3,o=C.space_id),"root_node"in C&&t(15,a=C.root_node),"username"in C&&t(4,c=C.username),"api_calls"in C&&t(5,_=C.api_calls)},[s,n,i,o,c,_,u,p,$,m,d,r,f,w,k,a,y,b,q,j,E]}class f_ extends Gc{constructor(e){super(),Hc(this,e,u_,__,Vc,{dependencies:1,root:0,app:2,space_id:3,root_node:15,username:4,api_calls:5},null,[-1,-1])}get dependencies(){return this.$$.ctx[1]}set dependencies(e){this.$$set({dependencies:e}),Ot()}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),Ot()}get app(){return this.$$.ctx[2]}set app(e){this.$$set({app:e}),Ot()}get space_id(){return this.$$.ctx[3]}set space_id(e){this.$$set({space_id:e}),Ot()}get root_node(){return this.$$.ctx[15]}set root_node(e){this.$$set({root_node:e}),Ot()}get username(){return this.$$.ctx[4]}set username(e){this.$$set({username:e}),Ot()}get api_calls(){return this.$$.ctx[5]}set api_calls(e){this.$$set({api_calls:e}),Ot()}}const{SvelteComponent:p_,append:Bt,attr:xt,create_component:m_,destroy_component:d_,detach:Gt,element:en,flush:bi,init:h_,insert:Ht,mount_component:g_,safe_not_equal:b_,set_data:fo,space:Sl,text:yn,transition_in:v_,transition_out:$_}=window.__gradio__svelte__internal;function vi(l){let e,t,n=l[1][l[0][l[0].length-1].fn_index].api_name+"",s;return{c(){e=en("span"),t=yn("/"),s=yn(n),xt(e,"class","api-name svelte-sy28j6")},m(i,o){Ht(i,e,o),Bt(e,t),Bt(e,s)},p(i,o){o&3&&n!==(n=i[1][i[0][i[0].length-1].fn_index].api_name+"")&&fo(s,n)},d(i){i&&Gt(e)}}}function k_(l){let e,t,n,s,i,o,a,c=l[0].length+"",r,_,u,f=l[0].length>0&&vi(l);return{c(){e=en("div"),t=Sl(),n=en("p"),n.textContent="Recording API Calls:",s=Sl(),i=en("p"),o=en("span"),a=yn("["),r=yn(c),_=yn("]"),u=Sl(),f&&f.c(),xt(e,"class","loading-dot self-baseline svelte-sy28j6"),xt(n,"class","self-baseline svelte-sy28j6"),xt(o,"class","api-count svelte-sy28j6"),xt(i,"class","self-baseline api-section svelte-sy28j6")},m(p,g){Ht(p,e,g),Ht(p,t,g),Ht(p,n,g),Ht(p,s,g),Ht(p,i,g),Bt(i,o),Bt(o,a),Bt(o,r),Bt(o,_),Bt(i,u),f&&f.m(i,null)},p(p,g){g&1&&c!==(c=p[0].length+"")&&fo(r,c),p[0].length>0?f?f.p(p,g):(f=vi(p),f.c(),f.m(i,null)):f&&(f.d(1),f=null)},d(p){p&&(Gt(e),Gt(t),Gt(n),Gt(s),Gt(i)),f&&f.d()}}}function w_(l){let e,t,n;return t=new tl({props:{size:"sm",variant:"secondary",$$slots:{default:[k_]},$$scope:{ctx:l}}}),{c(){e=en("div"),m_(t.$$.fragment),xt(e,"id","api-recorder")},m(s,i){Ht(s,e,i),g_(t,e,null),n=!0},p(s,[i]){const o={};i&7&&(o.$$scope={dirty:i,ctx:s}),t.$set(o)},i(s){n||(v_(t.$$.fragment,s),n=!0)},o(s){$_(t.$$.fragment,s),n=!1},d(s){s&&Gt(e),d_(t)}}}function y_(l,e,t){let{api_calls:n=[]}=e,{dependencies:s}=e;return l.$$set=i=>{"api_calls"in i&&t(0,n=i.api_calls),"dependencies"in i&&t(1,s=i.dependencies)},[n,s]}class C_ extends p_{constructor(e){super(),h_(this,e,y_,w_,b_,{api_calls:0,dependencies:1})}get api_calls(){return this.$$.ctx[0]}set api_calls(e){this.$$set({api_calls:e}),bi()}get dependencies(){return this.$$.ctx[1]}set dependencies(e){this.$$set({dependencies:e}),bi()}}const po="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3c!--%20Outer%20gear%20teeth%20(gray)%20--%3e%3cpath%20d='M19.14%2012.94c.04-.3.06-.61.06-.94%200-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24%200-.43.17-.47.41l-.36%202.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47%200-.59.22L2.74%208.87c-.12.21-.08.47.12.61l2.03%201.58c-.05.3-.07.62-.07.94s.02.64.07.94l-2.03%201.58c-.18.14-.23.41-.12.61l1.92%203.32c.12.22.37.29.59.22l2.39-.96c.5.38%201.03.7%201.62.94l.36%202.54c.05.24.24.41.48.41h3.84c.24%200%20.44-.17.47-.41l.36-2.54c.59-.24%201.13-.56%201.62-.94l2.39.96c.22.08.47%200%20.59
105-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12%2015.6c-1.98%200-3.6-1.62-3.6-3.6s1.62-3.6%203.6-3.6%203.6%201.62%203.6%203.6-1.62%203.6-3.6%203.6z'%20fill='%23808080'/%3e%3c!--%20Inner%20circle%20(now%20gray)%20--%3e%3ccircle%20cx='12'%20cy='12'%20r='2.5'%20fill='%23808080'/%3e%3c/svg%3e",{SvelteComponent:q_,append:It,attr:Dt,component_subscribe:S_,create_component:E_,destroy_component:N_,detach:El,element:gn,flush:j_,init:L_,insert:Nl,listen:z_,mount_component:T_,safe_not_equal:A_,set_data:$i,space:jl,src_url_equal:M_,text:ki,transition_in:P_,transition_out:O_}=window.__gradio__svelte__internal,{createEventDispatcher:I_}=window.__gradio__svelte__internal;function D_(l){let e,t,n,s,i,o=l[1]("common.settings")+"",a,c,r,_,u,f,p,g,h,$;return p=new Wl({}),{c(){e=gn("h2"),t=gn("img"),s=jl(),i=gn("div"),a=ki(o),c=jl(),r=gn("div"),_=ki(l[0]),u=jl(),f=gn("button"),E_(p.$$.fragment),M_(t.src,n=po)||Dt(t,"src",n),Dt(t,"alt",""),Dt(t,"class","svelte-1b2d8fn"),Dt(r,"class","url svelte-1b2d8fn"),Dt(i,"class","title svelte-1b2d8fn"),Dt(e,"class","svelte-1b2d8fn"),Dt(f,"class","svelte-1b2d8fn")},m(m,w){Nl(m,e,w),It(e,t),It(e,s),It(e,i),It(i,a),It(i,c),It(i,r),It(r,_),Nl(m,u,w),Nl(m,f,w),T_(p,f,null),g=!0,h||($=z_(f,"click",l[3]),h=!0)},p(m,[w]){(!g||w&2)&&o!==(o=m[1]("common.settings")+"")&&$i(a,o),(!g||w&1)&&$i(_,m[0])},i(m){g||(P_(p.$$.fragment,m),g=!0)},o(m){O_(p.$$.fragment,m),g=!1},d(m){m&&(El(e),El(u),El(f)),N_(p),h=!1,$()}}}function F_(l,e,t){let n;S_(l,Cn,a=>t(1,n=a));let{root:s}=e;const i=I_();Vl();const o=()=>i("close");return l.$$set=a=>{"root"in a&&t(0,s=a.root)},[s,n,i,o]}class U_ extends q_{constructor(e){super(),L_(this,e,F_,D_,A_,{root:0})}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),j_()}}const{SvelteComponent:R_,append:ve,attr:me,bubble:B_,component_subscribe:G_,create_component:wi,destroy_component:yi,detach:Ze,element:Ne,flush:Ll,init:H_,insert:Je,listen:zl,mount_component:Ci,noop:V_,run_all:W_,safe_not_equal:Z_,set_data:xn,space:wt,text:Et,transition_in:qi,transition_out:Si}=window.__gradio__svelte__internal,{onMount:J_}=window.__gradio__svelte__internal;function Ei(l){let e,t,n=l[5]("common.display_theme")+"",s,i,o,a,c,r,_,u,f,p,g,h,$,m,w,k;return{c(){e=Ne("div"),t=Ne("h2"),s=Et(n),i=wt(),o=Ne("p"),a=Ne("li"),c=Ne("button"),c.textContent="☀︎  Light",_=wt(),u=Ne("li"),f=Ne("button"),f.textContent="⏾   Dark",g=wt(),h=Ne("li"),$=Ne("button"),$.textContent="🖥︎  System",me(t,"class","svelte-npavty"),me(c,"class","svelte-npavty"),me(a,"class",r="theme-button "+(l[4]==="light"?"current-theme":"inactive-theme")+" svelte-npavty"),me(f,"class","svelte-npavty"),me(u,"class",p="theme-button "+(l[4]==="dark"?"current-theme":"inactive-theme")+" svelte-npavty"),me($,"class","svelte-npavty"),me(h,"class",m="theme-button "+(l[4]==="system"?"current-theme":"inactive-theme")+" svelte-npavty"),me(o,"class","padded theme-buttons svelte-npavty"),me(e,"class","banner-wrap svelte-npavty")},m(d,v){Je(d,e,v),ve(e,t),ve(t,s),ve(e,i),ve(e,o),ve(o,a),ve(a,c),ve(o,_),ve(o,u),ve(u,f),ve(o,g),ve(o,h),ve(h,$),w||(k=[zl(a,"click",l[9]),zl(u,"click",l[10]),zl(h,"click",l[11])],w=!0)},p(d,v){v&32&&n!==(n=d[5]("common.display_theme")+"")&&xn(s,n),v&16&&r!==(r="theme-button "+(d[4]==="light"?"current-theme":"inactive-theme")+" svelte-npavty")&&me(a,"class",r),v&16&&p!==(p="theme-button "+(d[4]==="dark"?"current-theme":"inactive-theme")+" svelte-npavty")&&me(u,"class",p),v&16&&m!==(m="theme-button "+(d[4]==="system"?"current-theme":"inactive-theme")+" svelte-npavty")&&me(h,"class",m)},d(d){d&&Ze(e),w=!1,W_(k)}}}function Q_(l){let e,t,n;return{c(){e=Et(`Progressive Web App is not enabled for this app. To enable it, start your
106			Gradio app with `),t=Ne("code"),t.textContent="launch(pwa=True)",n=Et(".")},m(s,i){Je(s,e,i),Je(s,t,i),Je(s,n,i)},p:V_,d(s){s&&(Ze(e),Ze(t),Ze(n))}}}function Y_(l){let e,t,n,s;return{c(){e=Et("You can install this app as a Progressive Web App on your device. Visit "),t=Ne("a"),n=Et(l[0]),s=Et(" and click the install button in the URL address bar of your browser."),me(t,"href",l[0]),me(t,"target","_blank"),me(t,"class","svelte-npavty")},m(i,o){Je(i,e,o),Je(i,t,o),ve(t,n),Je(i,s,o)},p(i,o){o&1&&xn(n,i[0]),o&1&&me(t,"href",i[0])},d(i){i&&(Ze(e),Ze(t),Ze(s))}}}function K_(l){let e,t,n,s,i,o,a=l[5]("common.language")+"",c,r,_,u,f,p,g,h=l[5]("common.pwa")+"",$,m,w,k;
106t=new U_({props:{root:l[0]}}),t.$on("close",l[8]);let d=l[1]===null&&Ei(l);u=new Xo({props:{label:"Language",choices:Wo,show_label:!1,root:l[0],value:l[3]}}),u.$on("change",l[7]);function v(q,j){return q[2]?Y_:Q_}let y=v(l),b=y(l);return{c(){e=Ne("div"),wi(t.$$.fragment),n=wt(),d&&d.c(),s=wt(),i=Ne("div"),o=Ne("h2"),c=Et(a),r=wt(),_=Ne("p"),wi(u.$$.fragment),f=wt(),p=Ne("div"),g=Ne("h2"),$=Et(h),m=wt(),w=Ne("p"),b.c(),me(e,"class","banner-wrap svelte-npavty"),me(o,"class","svelte-npavty"),me(_,"class","padded svelte-npavty"),me(i,"class","banner-wrap svelte-npavty"),me(g,"class","svelte-npavty"),me(w,"class","padded svelte-npavty"),me(p,"class","banner-wrap svelte-npavty")},m(q,j){Je(q,e,j),Ci(t,e,null),Je(q,n,j),d&&d.m(q,j),Je(q,s,j),Je(q,i,j),ve(i,o),ve(o,c),ve(i,r),ve(i,_),Ci(u,_,null),Je(q,f,j),Je(q,p,j),ve(p,g),ve(g,$),ve(p,m),ve(p,w),b.m(w,null),k=!0},p(q,[j]){const E={};j&1&&(E.root=q[0]),t.$set(E),q[1]===null?d?d.p(q,j):(d=Ei(q),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),(!k||j&32)&&a!==(a=q[5]("common.language")+"")&&xn(c,a);const C={};j&1&&(C.root=q[0]),j&8&&(C.value=q[3]),u.$set(C),(!k||j&32)&&h!==(h=q[5]("common.pwa")+"")&&xn($,h),y===(y=v(q))&&b?b.p(q,j):(b.d(1),b=y(q),b&&(b.c(),b.m(w,null)))},i(q){k||(qi(t.$$.fragment,q),qi(u.$$.fragment,q),k=!0)},o(q){Si(t.$$.fragment,q),Si(u.$$.fragment,q),k=!1},d(q){q&&(Ze(e),Ze(n),Ze(s),Ze(i),Ze(f),Ze(p)),yi(t),d&&d.d(q),yi(u),b.d()}}}function X_(l,e,t){let n;G_(l,Cn,h=>t(5,n=h));let{root:s}=e,{space_id:i}=e,{pwa_enabled:o}=e;s===""&&(s=location.protocol+"//"+location.host+location.pathname),s.endsWith("/")||(s+="/");function a(h){const $=new URL(window.location.href);h==="system"?($.searchParams.delete("__theme"),t(4,r="system")):($.searchParams.set("__theme",h),t(4,r=h)),window.location.href=$.toString()}J_(()=>{document.body.style.overflow="hidden","parentIFrame"in window&&window.parentIFrame?.scrollTo(0,0);const $=new URL(window.location.href).searchParams.get("__theme");return t(4,r=$||"system"),()=>{document.body.style.overflow="auto"}});let c,r="system";Zo.subscribe(h=>{h&&t(3,c=h)});function _(h){const $=h.detail;Jo($)}Vl();function u(h){B_.call(this,l,h)}const f=()=>a("light"),p=()=>a("dark"),g=()=>a("system");return l.$$set=h=>{"root"in h&&t(0,s=h.root),"space_id"in h&&t(1,i=h.space_id),"pwa_enabled"in h&&t(2,o=h.pwa_enabled)},[s,i,o,c,r,n,a,_,u,f,p,g]}class x_ extends R_{constructor(e){super(),H_(this,e,X_,K_,Z_,{root:0,space_id:1,pwa_enabled:2})}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),Ll()}get space_id(){return this.$$.ctx[1]}set space_id(e){this.$$set({space_id:e}),Ll()}get pwa_enabled(){return this.$$.ctx[2]}set pwa_enabled(e){this.$$set({pwa_enabled:e}),Ll()}}function eu(l){if(l==null)return"";const e=String(l),t=rs(Cn),n=rs(Cn);let s=t(e);if(s!==e)return s;const i=e.toLowerCase();for(const a of Qo){const c=a.substring(a.indexOf(".")+1);if(i===c){const r=t(a);if(r!==a)return r;break}}const o=n(e);return o!==e?o:e}const{SvelteComponent:tu,add_flush_callback:nu,assign:el,bind:Ni,binding_callbacks:Dl,bubble:lu,check_outros:su,compute_rest_props:ji,construct_svelte_component:Li,create_component:zi,create_slot:iu,destroy_component:Ti,detach:ou,empty:ru,exclude_internal_props:au,flush:it,get_all_dirty_from_scope:cu,get_slot_changes:_u,get_spread_object:Ai,get_spread_update:Mi,group_outros:uu,init:fu,insert:pu,mount_component:Pi,not_equal:mu,transition_in:Fl,transition_out:Ul,update_slot_base:du}=window.__gradio__svelte__internal,{bind:hu,binding_callbacks:gu}=window.__gradio__svelte__internal;function bu(l){let e;const t=l[12].default,n=iu(t,l,l[16],null);return{c(){n&&n.c()},m(s,i){n&&n.m(s,i),e=!0},p(s,i){n&&n.p&&(!e||i&65536)&&du(n,t,s,s[16],e?_u(t,s[16],i,null):cu(s[16]),null)},i(s){e||(Fl(n,s),e=!0)},o(s){Ul(n,s),e=!1},d(s){n&&n.d(s)}}}function vu(l){let e,t,n,s;const i=[{elem_id:l[5]},{elem_classes:l[6]},{target:l[3]},{visible:l[7]},l[9],{theme_mode:l[4]},{root:l[2]}];function o(r){l[14](r)}var a=l[8];function c(r,_){let u={$$slots:{default:[bu]},$$scope:{ctx:r}};for(let f=0;f<i.length;f+=1)u=el(u,i[f]);return _!==void 0&&_&764&&(u=el(u,Mi(i,[_&32&&{elem_id:r[5]},_&64&&{elem_classes:r[6]},_&8&&{target:r[3]},_&128&&{visible:r[7]},_&512&&Ai(r[9]),_&16&&{theme_mode:r[4]},_&4&&{root:r[2]}]))),r[1]!==void 0&&(u.value=r[1]),{props:u}}return a&&(e=Li(a,c(l)),l[13](e),Dl.push(()=>Ni(e,"value",o)),e.$on("prop_change",l[15])),{c(){e&&zi(e.$$.fragment),n=ru()},m(r,_){e&&Pi(e,r,_),pu(r,n,_),s=!0},p(r,[_]){if(a!==(a=r[8])){if(e){uu();const u=e;Ul(u.$$.fragment,1,0,()=>{Ti(u,1)}),su()}a?(e=Li(a,c(r,_)),r[13](e),Dl.push(()=>Ni(e,"value",o)),e.$on("prop_change",r[15]),zi(e.$$.fragment),Fl(e.$$.fragment,1),Pi(e,n.parentNode,n)):e=null}else if(a){const u=_&764?Mi(i,[_&32&&{elem_id:r[5]},_&64&&{elem_classes:r[6]},_&8&&{target:r[3]},_&128&&{visible:r[7]},_&512&&Ai(r[9]),_&16&&{theme_mode:r[4]},_&4&&{root:r[2]}]):{};_&65536&&(u.$$scope={dirty:_,ctx:r}),!t&&_&2&&(t=!0,u.value=r[1],nu(()=>t=!1)),e.$set(u)}},i(r){s||(e&&Fl(e.$$.fragment,r),s=!0)},o(r){e&&Ul(e.$$.fragment,r),s=!1},d(r){r&&ou(n),l[13](null),e&&Ti(e,r)}}}function $u(l,e,t){const n=["root","component","target","theme_mode","instance","value","elem_id","elem_classes","_id","visible"];let s=ji(e,n),{$$slots:i={},$$scope:o}=e,{root:a}=e,{component:c}=e,{target:r}=e,{theme_mode:_}=e,{instance:u}=e,{value:f}=e,{elem_id:p}=e,{elem_classes:g}=e,{_id:h}=e,{visible:$}=e;const m=(b,q,j)=>new CustomEvent("prop_change",{detail:{id:b,prop:q,value:j}});function w(b){return new Proxy(b,{construct(j,E){const C=new j(...E),A=Object.keys(C.$$.props);function N(O){return function(V){if(!r)return;const te=m(h,O,V);r.dispatchEvent(te)}}return A.forEach(O=>{gu.push(()=>hu(C,O,N(O)))}),C}})}const k=w(c);function d(b){Dl[b?"unshift":"push"](()=>{u=b,t(0,u)})}function v(b){f=b,t(1,f)}function y(b){lu.call(this,l,b)}return l.$$set=b=>{e=el(el({},e),au(b)),t(9,s=ji(e,n)),"root"in b&&t(2,a=b.root),"component"in b&&t(10,c=b.component),"target"in b&&t(3,r=b.target),"theme_mode"in b&&t(4,_=b.theme_mode),"instance"in b&&t(0,u=b.instance),"value"in b&&t(1,f=b.value),"elem_id"in b&&t(5,p=b.elem_id),"elem_classes"in b&&t(6,g=b.elem_classes),"_id"in b&&t(11,h=b._id),"visible"in b&&t(7,$=b.visible),"$$scope"in b&&t(16,o=b.$$scope)},[u,f,a,r,_,p,g,$,k,s,c,h,i,d,v,y,o]}class ku extends tu{constructor(e){super(),fu(this,e,$u,vu,mu,{root:2,component:10,target:3,theme_mode:4,instance:0,value:1,elem_id:5,elem_classes:6,_id:11,visible:7})}get root(){return this.$$.ctx[2]}set root(e){this.$$set({root:e}),it()}get component(){return this.$$.ctx[10]}set component(e){this.$$set({component:e}),it()}get target(){return this.$$.ctx[3]}set target(e){this.$$set({target:e}),it()}get theme_mode(){return this.$$.ctx[4]}set theme_mode(e){this.$$set({theme_mode:e}),it()}get instance(){return this.$$.ctx[0]}set instance(e){this.$$set({instance:e}),it()}get value(){return this.$$.ctx[1]}set value(e){this.$$set({value:e}),it()}get elem_id(){return this.$$.ctx[5]}set elem_id(e){this.$$set({elem_id:e}),it()}get elem_classes(){return this.$$.ctx[6]}set elem_classes(e){this.$$set({elem_classes:e}),it()}get _id(){return this.$$.ctx[11]}set _id(e){this.$$set({_id:e}),it()}get visible(){return this.$$.ctx[7]}set visible(e){this.$$set({visible:e}),it()}}const{SvelteComponent:wu,add_flush_callback:Oi,assign:yu,bind:Ii,binding_callbacks:Di,bubble:Fi,check_outros:mo,create_component:ho,destroy_component:go,detach:xl,empty:es,ensure_array_like:Ui,flush:mt,get_spread_object:Cu,get_spread_update:qu,group_outros:bo,init:Su,insert:ts,mount_component:vo,outro_and_destroy_block:Eu,safe_not_equal:Nu,transition_in:ln,transition_out:qn,update_keyed_each:ju}=window.__gradio__svelte__internal,{onMount:Lu,createEventDispatcher:zu,setContext:Tu}=window.__gradio__svelte__internal;function Ri(l,e,t){const n=l.slice();return n[15]=e[t],n}function Bi(l){let e=[],t=new Map,n,s,i=Ui(l[0].children);const o=a=>a[15].id;for(let a=0;a<i.length;a+=1){let c=Ri(l,i,a),r=o(c);t.set(r,e[a]=Gi(r,c))}return{c(){for(let a=0;a<e.length;a+=1)e[a].c();n=es()},m(a,c){for(let r=0;r<e.length;r+=1)e[r]&&e[r].m(a,c);ts(a,n,c),s=!0},p(a,c){c&63&&(i=Ui(a[0].children),bo(),e=ju(e,c,o,1,a,i,t,n.parentNode,Eu,Gi,n,Ri),mo())},i(a){if(!s){for(let c=0;c<i.length;c+=1)ln(e[c]);s=!0}},o(a){for(let c=0;c<e.length;c+=1)qn(e[c]);s=!1},d(a){a&&xl(n);for(let c=0;c<e.length;c+=1)e[c].d(a)}}}function Gi(l,e){let t,n,s;return n=new $o({props:{node:e[15],component:e[15].component,target:e[2],id:e[15].id,root:e[1],theme_mode:e[3],max_file_size:e[4],client:e[5]}}),n.$on("destroy",e[9]),n.$on("mount",e[10]),{key:l,first:null,c(){t=es(),ho(n.$$.fragment),this.first=t},m(i,o){ts(i,t,o),vo(n,i,o),s=!0},p(i,o){e=i;const a={};o&1&&(a.node=e[15]),o&1&&(a.component=e[15].component),o&4&&(a.target=e[2]),o&1&&(a.id=e[15].id),o&2&&(a.root=e[1]),o&8&&(a.theme_mode=e[3]),o&16&&(a.max_file_size=e[4]),o&32&&(a.client=e[5]),n.$set(a)},i(i){s||(ln(n.$$.fragment,i),s=!0)},o(i){qn(n.$$.fragment,i),s=!1},d(i){i&&xl(t),go(n,i)}}}function Au(l){let e,t,n=l[0].children&&l[0].children.length&&Bi(l);return{c(){n&&n.c(),e=es()},m(s,i){n&&n.m(s,i),ts(s,e,i),t=!0},p(s,i){s[0].children&&s[0].children.length?n?(n.p(s,i),i&1&&ln(n,1)):(n=Bi(s),n.c(),ln(n,1),n.m(e.parentNode,e)):n&&(bo(),qn(n,1,1,()=>{n=null}),mo())},i(s){t||(ln(n),t=!0)},o(s){qn(n),t=!1},d(s){s&&xl(e),n&&n.d(s)}}}function Mu(l){let e,t,n,s;const i=[{_id:l[0]?.id},{component:l[0].component},{elem_id:"elem_id"in l[0].props&&l[0].props.elem_id||`component-${l[0].id}`},{elem_classes:"elem_classes"in l[0].props&&l[0].props.elem_classes||[]},{target:l[2]},l[0].props,{theme_mode:l[3]},{root:l[1]},{visible:typeof l[0].props.visible=="boolean"?l[0].props.visible:!0}];function o(r){l[11](r)}function a(r){l[12](r)}let c={$$slots:{default:[Au]},$$scope:{ctx:l}};for(let r=0;r<i.length;r+=1)c=yu(c,i[r]);return l[0].instance!==void 0&&(c.instance=l[0].instance),l[0].props.value!==void 0&&(c.value=l[0].props.value),e=new ku({props:c}),Di.push(()=>Ii(e,"instance",o)),Di.push(()=>Ii(e,"value",a)),{c(){ho(e.$$.fragment)},m(r,_){vo(e,r,_),s=!0},p(r,[_]){const u=_&15?qu(i,[_&1&&{_id:r[0]?.id},_&1&&{component:r[0].component},_&1&&{elem_id:"elem_id"in r[0].props&&r[0].props.elem_id||`component-${r[0].id}`},_&1&&{elem_classes:"elem_classes"in r[0].props&&r[0].props.elem_classes||[]},_&4&&{target:r[2]},_&1&&Cu(r[0].props),_&8&&{theme_mode:r[3]},_&2&&{root:r[1]},_&1&&{visible:typeof r[0].props.visible=="boolean"?r[0].props.visible:!0}]):{};_&262207&&(u.$$scope={dirty:_,ctx:r}),!t&&_&1&&(t=!0,u.instance=r[0].instance,Oi(()=>t=!1)),!n&&_&1&&(n=!0,u.value=r[0].props.value,Oi(()=>n=!1)),e.$set(u)},i(r){s||(ln(e.$$.fragment,r),s=!0)},o(r){qn(e.$$.fragment,r),s=!1},d(r){go(e,r)}}}function Pu(l,e,t){let{root:n}=e,{node:s}=e,{parent:i=null}=e,{target:o}=e,{theme_mode:a}=e,{version:c}=e,{autoscroll:r}=e,{max_file_size:_}=e,{client:u}=e;const f=zu();let p=[];Lu(()=>{f("mount",s.id);for(const w of p)f("mount",w.id);return()=>{f("destroy",s.id);for(const w of p)f("mount",w.id)}}),Tu("BLOCK_KEY",i);function g(w){Fi.call(this,l,w)}function h(w){Fi.call(this,l,w)}function $(w){l.$$.not_equal(s.instance,w)&&(s.instance=w,t(0,s),t(14,p),t(2,o),t(3,a),t(7,c),t(1,n),t(8,r),t(4,_),t(5,u))}function m(w){l.$$.not_equal(s.props.value,w)&&(s.props.value=w,t(0,s),t(14,p),t(2,o),t(3,a),t(7,c),t(1,n),t(8,r),t(4,_),t(5,u))}return l.$$set=w=>{"root"in w&&t(1,n=w.root),"node"in w&&t(0,s=w.node),"parent"in w&&t(6,i=w.parent),"target"in w&&t(2,o=w.target),"theme_mode"in w&&t(3,a=w.theme_mode),"version"in 
vendor: 6,924 bytes, line 106
106w&&t(7,c=w.version),"autoscroll"in w&&t(8,r=w.autoscroll),"max_file_size"in w&&t(4,_=w.max_file_size),"client"in w&&t(5,u=w.client)},l.$$.update=()=>{l.$$.dirty&1&&s&&t(0,s.children=s.children&&s.children.filter(w=>{const k=s.type!=="statustracker";return k||p.push(w),k}),s),l.$$.dirty&1&&s&&s.type==="form"&&(s.children?.every(w=>!w.props.visible)?t(0,s.props.visible=!1,s):t(0,s.props.visible=!0,s)),l.$$.dirty&447&&t(0,s.props.gradio=new er(s.id,o,a,c,n,r,_,eu,u,Yo),s)},[s,n,o,a,_,u,i,c,r,g,h,$,m]}class $o extends wu{constructor(e){super(),Su(this,e,Pu,Mu,Nu,{root:1,node:0,parent:6,target:2,theme_mode:3,version:7,autoscroll:8,max_file_size:4,client:5})}get root(){return this.$$.ctx[1]}set root(e){this.$$set({root:e}),mt()}get node(){return this.$$.ctx[0]}set node(e){this.$$set({node:e}),mt()}get parent(){return this.$$.ctx[6]}set parent(e){this.$$set({parent:e}),mt()}get target(){return this.$$.ctx[2]}set target(e){this.$$set({target:e}),mt()}get theme_mode(){return this.$$.ctx[3]}set theme_mode(e){this.$$set({theme_mode:e}),mt()}get version(){return this.$$.ctx[7]}set version(e){this.$$set({version:e}),mt()}get autoscroll(){return this.$$.ctx[8]}set autoscroll(e){this.$$set({autoscroll:e}),mt()}get max_file_size(){return this.$$.ctx[4]}set max_file_size(e){this.$$set({max_file_size:e}),mt()}get client(){return this.$$.ctx[5]}set client(e){this.$$set({client:e}),mt()}}const{SvelteComponent:Ou,check_outros:Iu,create_component:Du,destroy_component:Fu,detach:Uu,empty:Ru,flush:kt,group_outros:Bu,init:Gu,insert:Hu,mount_component:Vu,safe_not_equal:Wu,transition_in:Vn,transition_out:Rl}=window.__gradio__svelte__internal,{onMount:Zu,createEventDispatcher:Ju}=window.__gradio__svelte__internal;function Hi(l){let e,t;return e=new $o({props:{node:l[0],root:l[1],target:l[2],theme_mode:l[3],version:l[4],autoscroll:l[5],max_file_size:l[6],client:l[7]}}),{c(){Du(e.$$.fragment)},m(n,s){Vu(e,n,s),t=!0},p(n,s){const i={};s&1&&(i.node=n[0]),s&2&&(i.root=n[1]),s&4&&(i.target=n[2]),s&8&&(i.theme_mode=n[3]),s&16&&(i.version=n[4]),s&32&&(i.autoscroll=n[5]),s&64&&(i.max_file_size=n[6]),s&128&&(i.client=n[7]),e.$set(i)},i(n){t||(Vn(e.$$.fragment,n),t=!0)},o(n){Rl(e.$$.fragment,n),t=!1},d(n){Fu(e,n)}}}function Qu(l){let e,t,n=l[0]&&Hi(l);return{c(){n&&n.c(),e=Ru()},m(s,i){n&&n.m(s,i),Hu(s,e,i),t=!0},p(s,[i]){s[0]?n?(n.p(s,i),i&1&&Vn(n,1)):(n=Hi(s),n.c(),Vn(n,1),n.m(e.parentNode,e)):n&&(Bu(),Rl(n,1,1,()=>{n=null}),Iu())},i(s){t||(Vn(n),t=!0)},o(s){Rl(n),t=!1},d(s){s&&Uu(e),n&&n.d(s)}}}function Yu(l,e,t){let{rootNode:n}=e,{root:s}=e,{target:i}=e,{theme_mode:o}=e,{version:a}=e,{autoscroll:c}=e,{max_file_size:r=null}=e,{client:_}=e;const u=Ju();return Zu(()=>{u("mount")}),l.$$set=f=>{"rootNode"in f&&t(0,n=f.rootNode),"root"in f&&t(1,s=f.root),"target"in f&&t(2,i=f.target),"theme_mode"in f&&t(3,o=f.theme_mode),"version"in f&&t(4,a=f.version),"autoscroll"in f&&t(5,c=f.autoscroll),"max_file_size"in f&&t(6,r=f.max_file_size),"client"in f&&t(7,_=f.client)},[n,s,i,o,a,c,r,_]}class Ku extends Ou{constructor(e){super(),Gu(this,e,Yu,Qu,Wu,{rootNode:0,root:1,target:2,theme_mode:3,version:4,autoscroll:5,max_file_size:6,client:7})}get rootNode(){return this.$$.ctx[0]}set rootNode(e){this.$$set({rootNode:e}),kt()}get root(){return this.$$.ctx[1]}set root(e){this.$$set({root:e}),kt()}get target(){return this.$$.ctx[2]}set target(e){this.$$set({target:e}),kt()}get theme_mode(){return this.$$.ctx[3]}set theme_mode(e){this.$$set({theme_mode:e}),kt()}get version(){return this.$$.ctx[4]}set version(e){this.$$set({version:e}),kt()}get autoscroll(){return this.$$.ctx[5]}set autoscroll(e){this.$$set({autoscroll:e}),kt()}get max_file_size(){return this.$$.ctx[6]}set max_file_size(e){this.$$set({max_file_size:e}),kt()}get client(){return this.$$.ctx[7]}set client(e){this.$$set({client:e}),kt()}}const Xu="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='576'%20height='576'%20viewBox='0%200%20576%20576'%20fill='none'%3e%3cpath%20d='M287.5%20229L86%20344.5L287.5%20460L489%20344.5L287.5%20229Z'%20stroke='url(%23paint0_linear_102_7)'%20stroke-width='59'%20stroke-linejoin='round'/%3e%3cpath%20d='M287.5%20116L86%20231.5L287.5%20347L489%20231.5L287.5%20116Z'%20stroke='url(%23paint1_linear_102_7)'%20stroke-width='59'%20stroke-linejoin='round'/%3e%3cpath%20d='M86%20344L288%20229'%20stroke='url(%23paint2_linear_102_7)'%20stroke-width='59'%20stroke-linejoin='bevel'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_102_7'%20x1='60'%20y1='341'%20x2='429.5'%20y2='344'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F9D100'/%3e%3cstop%20offset='1'%20stop-color='%23F97700'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_102_7'%20x1='513.5'%20y1='231'%20x2='143.5'%20y2='231'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F9D100'/%3e%3cstop%20offset='1'%20stop-color='%23F97700'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_102_7'%20x1='60'%20y1='344'%20x2='428.987'%20y2='341.811'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F9D100'/%3e%3cstop%20offset='1'%20stop-color='%23F97700'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",{HtmlTag:xu,SvelteComponent:ef,append:ue,attr:le,check_outros:bn,component_subscribe:vn,create_component:Sn,destroy_component:En,detach:Le,element:je,empty:Wn,flush:_e,globals:tf,group_outros:$n,init:nf,insert:Ue,listen:Nn,mount_component:jn,noop:Tl,safe_not_equal:lf,set_data:Bl,set_style:Un,space:Re,src_url_equal:Gl,text:Hl,transition_in:Ce,transition_out:Fe}=window.__gradio__svelte__internal,{document:wn}=tf,{tick:Rn,onMount:sf}=window.__gradio__svelte__internal;function Vi(l){return wn.title=l[2],{c:Tl,m:Tl,d:Tl}}function Wi(l){let e,t=`<style>${as(l[15],l[12])}</style>`,n;return{c(){e=new xu(!1),n=Wn(),e.a=n},m(s,i){e.m(t,s,i),Ue(s,n,i)},p(s,i){i[0]&36864&&t!==(t=`<style>${as(s[15],s[12])}</style>`)&&e.p(t)},d(s){s&&(Le(n),e.d())}}}function Zi(l){let e,t;return e=new Ku({props:{rootNode:l[16],root:l[0],target:l[3],theme_mode:l[9],version:l[12],autoscroll:l[4],max_file_size:l[14],client:l[10]}}),e.$on("mount",l[30]),{c(){Sn(e.$$.fragment)},m(n,s){jn(e,n,s),t=!0},p(n,s){const i={};s[0]&65536&&(i.rootNode=n[16]),s[0]&1&&(i.root=n[0]),s[0]&8&&(i.target=n[3]),s[0]&512&&(i.theme_mode=n[9]),s[0]&4096&&(i.version=n[12]),s[0]&16&&(i.autoscroll=n[4]),s[0]&16384&&(i.max_file_size=n[14]),s[0]&1024&&(i.client=n[10]),e.$set(i)},i(n){t||(Ce(e.$$.fragment,n),t=!0)},o(n){Fe(e.$$.fragment,n),t=!1},d(n){En(e,n)}}}function Ji(l){let e,t,n,s=l[22]("common.built_with_gradio")+"",i,o,a,c,r,_,u,f,p,g=l[22]("common.settings")+"",h,$,m,w,k,d,v,y=l[5]&&Qi(l);return{c(){e=je("footer"),y&&y.c(),t=Re(),n=je("a"),i=Hl(s),o=Re(),a=je("img"),_=Re(),u=je("div"),u.textContent="·",f=Re(),p=je("button"),h=Hl(g),$=Re(),m=je("img"),Gl(a.src,c=Xu)||le(a,"src",c),le(a,"alt",r=l[22]("common.logo")),le(a,"class","svelte-1byz9vf"),le(n,"href","https://gradio.app"),le(n,"class","built-with 
106svelte-1byz9vf"),le(n,"target","_blank"),le(n,"rel","noreferrer"),le(u,"class","divider svelte-1byz9vf"),Gl(m.src,w=po)||le(m,"src",w),le(m,"alt",k=l[22]("common.settings")),le(m,"class","svelte-1byz9vf"),le(p,"class","settings svelte-1byz9vf"),le(e,"class","svelte-1byz9vf")},m(b,q){Ue(b,e,q),y&&y.m(e,null),ue(e,t),ue(e,n),ue(n,i),ue(n,o),ue(n,a),ue(e,_),ue(e,u),ue(e,f),ue(e,p),ue(p,h),ue(p,$),ue(p,m),d||(v=Nn(p,"click",l[44]),d=!0)},p(b,q){b[5]?y?y.p(b,q):(y=Qi(b),y.c(),y.m(e,t)):y&&(y.d(1),y=null),q[0]&4194304&&s!==(s=b[22]("common.built_with_gradio")+"")&&Bl(i,s),q[0]&4194304&&r!==(r=b[22]("common.logo"))&&le(a,"alt",r),q[0]&4194304&&g!==(g=b[22]("common.settings")+"")&&Bl(h,g),q[0]&4194304&&k!==(k=b[22]("common.settings"))&&le(m,"alt",k)},d(b){b&&Le(e),y&&y.d(),d=!1,v()}}}function Qi(l){let e,t=l[22]("errors.use_via_api")+"",n,s,i,o,a,c,r,_,u;return{c(){e=je("button"),n=Hl(t),s=Re(),i=je("img"),c=Re(),r=je("div"),r.textContent="·",Gl(i.src,o=no)||le(i,"src",o),le(i,"alt",a=l[22]("common.logo")),le(i,"class","svelte-1byz9vf"),le(e,"class","show-api svelte-1byz9vf"),le(r,"class","divider show-api-divider svelte-1byz9vf")},m(f,p){Ue(f,e,p),ue(e,n),ue(e,s),ue(e,i),Ue(f,c,p),Ue(f,r,p),_||(u=Nn(e,"click",l[43]),_=!0)},p(f,p){p[0]&4194304&&t!==(t=f[22]("errors.use_via_api")+"")&&Bl(n,t),p[0]&4194304&&a!==(a=f[22]("common.logo"))&&le(i,"alt",a)},d(f){f&&(Le(e),Le(c),Le(r)),_=!1,u()}}}function Yi(l){let e,t,n,s,i;return t=new C_({props:{api_calls:l[20],dependencies:l[1]}}),{c(){e=je("div"),Sn(t.$$.fragment),le(e,"id","api-recorder-container"),le(e,"class","svelte-1byz9vf")},m(o,a){Ue(o,e,a),jn(t,e,null),n=!0,s||(i=Nn(e,"click",l[45]),s=!0)},p(o,a){const c={};a[0]&1048576&&(c.api_calls=o[20]),a[0]&2&&(c.dependencies=o[1]),t.$set(c)},i(o){n||(Ce(t.$$.fragment,o),n=!0)},o(o){Fe(t.$$.fragment,o),n=!1},d(o){o&&Le(e),En(t),s=!1,i()}}}function Ki(l){let e,t,n,s,i,o,a,c;return i=new f_({props:{root_node:l[16],dependencies:l[1],root:l[0],app:l[10],space_id:l[11],api_calls:l[20],username:l[13]}}),i.$on("close",l[47]),{c(){e=je("div"),t=je("div"),n=Re(),s=je("div"),Sn(i.$$.fragment),le(t,"class","backdrop svelte-1byz9vf"),le(s,"class","api-docs-wrap svelte-1byz9vf"),le(e,"class","api-docs svelte-1byz9vf")},m(r,_){Ue(r,e,_),ue(e,t),ue(e,n),ue(e,s),jn(i,s,null),o=!0,a||(c=Nn(t,"click",l[46]),a=!0)},p(r,_){const u={};
106_[0]&65536&&(u.root_node=r[16]),_[0]&2&&(u.dependencies=r[1]),_[0]&1&&(u.root=r[0]),_[0]&1024&&(u.app=r[10]),_[0]&2048&&(u.space_id=r[11]),_[0]&1048576&&(u.api_calls=r[20]),_[0]&8192&&(u.username=r[13]),i.$set(u)},i(r){o||(Ce(i.$$.fragment,r),o=!0)},o(r){Fe(i.$$.fragment,r),o=!1},d(r){r&&Le(e),En(i),a=!1,c()}}}function Xi(l){let e,t,n,s,i,o,a,c;return i=new x_({props:{pwa_enabled:l[10].config.pwa,root:l[0],space_id:l[11]}}),i.$on("close",l[49]),{c(){e=je("div"),t=je("div"),n=Re(),s=je("div"),Sn(i.$$.fragment),le(t,"class","backdrop svelte-1byz9vf"),le(s,"class","api-docs-wrap svelte-1byz9vf"),le(e,"class","api-docs svelte-1byz9vf")},m(r,_){Ue(r,e,_),ue(e,t),ue(e,n),ue(e,s),jn(i,s,null),o=!0,a||(c=Nn(t,"click",l[48]),a=!0)},p(r,_){const u={};_[0]&1024&&(u.pwa_enabled=r[10].config.pwa),_[0]&1&&(u.root=r[0]),_[0]&2048&&(u.space_id=r[11]),i.$set(u)},i(r){o||(Ce(i.$$.fragment,r),o=!0)},o(r){Fe(i.$$.fragment,r),o=!1},d(r){r&&Le(e),En(i),a=!1,c()}}}function xi(l){let e,t;return e=new xo({props:{messages:l[21]}}),e.$on("close",l[29]),{c(){Sn(e.$$.fragment)},m(n,s){jn(e,n,s),t=!0},p(n,s){const i={};s[0]&2097152&&(i.messages=n[21]),e.$set(i)},i(n){t||(Ce(e.$$.fragment,n),t=!0)},o(n){Fe(e.$$.fragment,n),t=!1},d(n){En(e,n)}}}function of(l){let e,t,n,s,i,o,a,c,r,_,u,f,p=l[7]&&Vi(l),g=l[15]&&Wi(l),h=l[16]&&l[10].config&&Zi(l),$=l[6]&&Ji(l),m=l[19]&&Yi(l),w=l[17]&&l[16]&&Ki(l),k=l[18]&&l[16]&&l[10].config&&Xi(l),d=l[21]&&xi(l);return{c(){p&&p.c(),e=Wn(),g&&g.c(),t=Wn(),n=Re(),s=je("div"),i=je("div"),h&&h.c(),o=Re(),$&&$.c(),a=Re(),m&&m.c(),c=Re(),w&&w.c(),r=Re(),k&&k.c(),_=Re(),d&&d.c(),u=Wn(),le(i,"class","contain svelte-1byz9vf"),Un(i,"flex-grow",l[8]?"1":"auto"),le(s,"class","wrap svelte-1byz9vf"),Un(s,"min-height",l[8]?"100%":"auto")}
106,m(v,y){p&&p.m(wn.head,null),ue(wn.head,e),g&&g.m(wn.head,null),ue(wn.head,t),Ue(v,n,y),Ue(v,s,y),ue(s,i),h&&h.m(i,null),ue(s,o),$&&$.m(s,null),Ue(v,a,y),m&&m.m(v,y),Ue(v,c,y),w&&w.m(v,y),Ue(v,r,y),k&&k.m(v,y),Ue(v,_,y),d&&d.m(v,y),Ue(v,u,y),f=!0},p(v,y){v[7]?p||(p=Vi(v),p.c(),p.m(e.parentNode,e)):p&&(p.d(1),p=null),v[15]?g?g.p(v,y):(g=Wi(v),g.c(),g.m(t.parentNode,t)):g&&(g.d(1),g=null),v[16]&&v[10].config?h?(h.p(v,y),y[0]&66560&&Ce(h,1)):(h=Zi(v),h.c(),Ce(h,1),h.m(i,null)):h&&($n(),Fe(h,1,1,()=>{h=null}),bn()),y[0]&256&&Un(i,"flex-grow",v[8]?"1":"auto"),v[6]?$?$.p(v,y):($=Ji(v),$.c(),$.m(s,null)):$&&($.d(1),$=null),y[0]&256&&Un(s,"min-height",v[8]?"100%":"auto"),v[19]?m?(m.p(v,y),y[0]&524288&&Ce(m,1)):(m=Yi(v),m.c(),Ce(m,1),m.m(c.parentNode,c)):m&&($n(),Fe(m,1,1,()=>{m=null}),bn()),v[17]&&v[16]?w?(w.p(v,y),y[0]&196608&&Ce(w,1)):(w=Ki(v),w.c(),Ce(w,1),w.m(r.parentNode,r)):w&&($n(),Fe(w,1,1,()=>{w=null}),bn()),v[18]&&v[16]&&v[10].config?k?(k.p(v,y),y[0]&328704&&Ce(k,1)):(k=Xi(v),k.c(),Ce(k,1),k.m(_.parentNode,_)):k&&($n(),Fe(k,1,1,()=>{k=null}),bn()),v[21]?d?(d.p(v,y),y[0]&2097152&&Ce(d,1)):(d=xi(v),d.c(),Ce(d,1),d.m(u.parentNode,u)):d&&($n(),Fe(d,1,1,()=>{d=null}),bn())},i(v){f||(Ce(h),Ce(m),Ce(w),Ce(k),Ce(d),f=!0)},o(v){Fe(h),Fe(m),Fe(w),Fe(k),Fe(d),f=!1},d(v){v&&(Le(n),Le(s),Le(a),Le(c),Le(r),Le(_),Le(u)),p&&p.d(v),Le(e),g&&g.d(v),Le(t),h&&h.d(),$&&$.d(),m&&m.d(v),w&&w.d(v),k&&k.d(v),d&&d.d(v)}}}const rf=/^'([^]+)'$/,af=15,cf=10;function eo(l){return"detail"in l}function _f(l,e,t){let n,s,i,o,a;vn(l,Cn,S=>t(22,o=S)),Vl();let{root:c}=e,{components:r}=e,{layout:_}=e,{dependencies:u}=e,{title:f="Gradio"}=e,{target:p}=e,{autoscroll:g}=e,{show_api:h=!0}=e,{show_footer:$=!0}=e,{control_page_title:m=!1}=e,{app_mode:w}=e,{theme_mode:k}=e,{app:d}=e,{space_id:v}=e,{version:y}=e,{js:b}=e,{fill_height:q=!1}=e,{ready:j}=e,{username:E}=e,{api_prefix:C=""}=e,{max_file_size:A=void 0}=e,{initial_layout:N=void 0}=e,{css:O=null}=e,{layout:V,targets:te,update_value:T,get_data:P,modify_stream:x,get_stream_state:Z,set_time_limit:re,loading_status:ie,scheduled_updates:Se,create_layout:Ln,rerender_layout:ko}=Ko(N);vn(l,V,S=>t(16,a=S)),vn(l,te,S=>t(56,s=S)),vn(l,ie,S=>t(42,n=S)),vn(l,Se,S=>t(57,i=S));let ul=u;async function wo(){await Ln({components:r,layout:_,dependencies:u,root:c+C,app:d,options:{fill_height:q}})}let{search_params:un}=e,fl=un.get("view")==="api"&&h,zn=un.get("view")==="settings",fn=un.get("view")==="api-recorder"&&h;function pn(S){t(19,fn=!1),t(17,fl=S);let J=new URLSearchParams(window.location.search);S?J.set("view","api"):J.delete("view"),history.replaceState(null,"","?"+J.toString())}function Tn(S){let J=new URLSearchParams(window.location.search);S?J.set("view","settings"):J.delete("view"),history.replaceState(null,"","?"+J.toString()),t(18,zn=!zn)}let An=[],{render_complete:mn=!1}=e;async function pl(S,J){const K=u.find(de=>de.id===J);if(!K)return;const pe=K.outputs,R=S?.map((de,he)=>({id:pe[he],prop:"value_is_output",value:!0}));T(R),await Rn();const oe=[];S?.forEach((de,he)=>{if(typeof de=="object"&&de!==null&&de.__type__==="update")for(const[bt,Qt]of Object.entries(de))bt!=="__type__"&&oe.push({id:pe[he],prop:bt,value:Qt});else oe.push({id:pe[he],prop:"value",value:de})}),T(oe),await Rn()}let _t=new Map,ce=[];function st(S,J,K,pe,R=10,oe=!0){return{title:S,message:J,fn_index:K,type:pe,id:++yo,duration:R,visible:oe}}function ns(S,J,K){t(21,ce=[st(S,J,-1,K),...ce])}let yo=-1,ml=!1;const Co=o("blocks.long_requests_queue"),qo=o("blocks.connection_can_break"),So=o("blocks.lost_connection"),Eo=o("blocks.waiting_for_inputs");let dl=!1,ls=!1,ss=!1,dn=[];function Jt(S,J=null,K=null){let pe=()=>{};function R(){pe()}i?pe=Se.subscribe(oe=>{oe||Rn().then(()=>{is(S,J,K),R()})}):is(S,J,K)}async function No(S,J,K){return S===J&&K&&K.is_value_data===!0?K.value:P(S)}async function is(S,J=null,K=null){const pe=u.find(W=>W.id===S);if(pe===void 0)return;const R=pe;if(dn.length>0){for(const W of dn)if(R.inputs.includes(W)){ns("Warning",Eo,"warning");return}}const oe=ie.get_status_for_fn(S);t(21,ce=ce.filter(({fn_index:W})=>W!==S)),(oe==="pending"||oe==="generating")&&(R.pending_request=!0);let de=[];R.render_id!=null&&u.forEach((W,Ie)=>{W.rendered_in===R.render_id&&de.push(Ie)}
vendor: 5,418 bytes, lines 106-108
106),de.reverse().forEach(W=>{u.splice(W,1)});let he={fn_index:S,data:await Promise.all(R.inputs.map(W=>No(W,J,K))),event_data:R.collects_event_data?K:null,trigger_id:J};R.frontend_fn&&typeof R.frontend_fn!="boolean"?R.frontend_fn(he.data.concat(await Promise.all(R.outputs.map(W=>P(W))))).then(W=>{R.backend_fn?(he.data=W,bt(R,he)):pl(W,S)}):R.types.cancel&&R.cancels?await Promise.all(R.cancels.map(async W=>{const Ie=_t.get(W);return Ie?.cancel(),Ie})):R.backend_fn&&(R.js_implementation&&new cs(`let result = await (${R.js_implementation})(...arguments);
107						return (!Array.isArray(result)) ? [result] : result;`)(...he.data).then(Ie=>{pl(Ie,S),he.js_implementation=!0}).catch(Ie=>{console.error(Ie),he.js_implementation=!1}),bt(R,he));function bt(W,Ie){W.trigger_mode==="once"?W.pending_request||Qt(Ie,W.connection=="stream"):W.trigger_mode==="multiple"?Qt(Ie,W.connection=="stream"):W.trigger_mode==="always_last"&&(W.pending_request?W.final_event=Ie:Qt(Ie,W.connection=="stream"))}async function Qt(W,Ie=!1){fn&&t(20,An=[...An,JSON.parse(JSON.stringify(W))]);let hl;if(d.set_current_payload(W),Ie)if(!_t.has(S))R.inputs.forEach(ae=>x(ae,"waiting"));else{if(_t.has(S)&&R.inputs.some(ae=>Z(ae)==="waiting"))return;if(_t.has(S)&&R.inputs.some(ae=>Z(ae)==="open")){await d.send_ws_message(`${d.config.root+d.config.api_prefix}/stream/${_t.get(S).event_id()}`,{...W,session_hash:d.session_hash});return}}try{hl=d.submit(W.fn_index,W.data,W.event_data,W.trigger_id)}catch(ae){if(d.closed)return;t(21,ce=[st("Error",String(ae),0,"error"),...ce]),ie.update({status:"error",fn_index:0,eta:0,queue:!1,queue_position:null}),Mn(n);return}_t.set(S,hl);for await(const ae of hl){if(W.js_implementation)return;ae.type==="data"?Ro(ae):ae.type==="render"?Bo(ae):ae.type==="status"?Vo(ae):ae.type==="log"&&Go(ae)}function Ro(ae){const{data:Ee,fn_index:ne}=ae;R.pending_request&&R.final_event&&(R.pending_request=!1,Qt(R.final_event,R.connection=="stream")),R.pending_request=!1,pl(Ee,ne),Mn(n)}function Bo(ae){const{data:Ee}=ae;let ne=Ee.components,ge=Ee.layout,ut=Ee.dependencies,vt=Ee.render_id;ut.forEach(Mt=>{u.push(Mt)}),ko({components:ne,layout:ge,root:c+C,dependencies:u,render_id:vt})}function Go(ae){const{title:Ee,log:ne,fn_index:ge,level:ut,duration:vt,visible:Mt}=ae;t(21,ce=[st(Ee,ne,ge,ut,vt,Mt),...ce])}function Ho(ae,Ee,ne){ae.original_msg==="process_starts"&&ne.connection==="stream"&&x(Ee,"open")}function Vo(ae){const{fn_index:Ee,...ne}=ae;if(ne.stage==="streaming"&&ne.time_limit&&R.inputs.forEach(ge=>{re(ge,ne.time_limit)}),R.inputs.forEach(ge=>{Ho(ae,ge,R)}),ie.update({...ne,time_limit:ne.time_limit,status:ne.stage,progress:ne.progress_data,fn_index:Ee}),Mn(n),!ls&&v!==null&&ne.position!==void 0&&ne.position>=2&&ne.eta!==void 0&&ne.eta>af&&(ls=!0,t(21,ce=[st("Warning",Co,Ee,"warning"),...ce])),!ss&&dl&&ne.eta!==void 0&&ne.eta>cf&&(ss=!0,t(21,ce=[st("Warning",qo,Ee,"warning"),...ce])),ne.stage==="complete"||ne.stage==="generating"){const ge=new Set;ne.changed_state_ids?.forEach(ut=>{u.filter(vt=>vt.targets.some(([Mt,uf])=>Mt===ut)).forEach(vt=>{ge.add(vt)})}),ge.forEach(ut=>{Jt(ut.id,W.trigger_id)})}if(ne.stage==="complete"&&(u.forEach(async ge=>{ge.trigger_after===Ee&&Jt(ge.id,W.trigger_id)}),R.inputs.forEach(ge=>{x(ge,"closed")}),_t.delete(S)),ne.broken&&dl&&ml)window.setTimeout(()=>{t(21,ce=[st("Error",So,Ee,"error"),...ce])},0),Jt(R.id,W.trigger_id,K),ml=!1;else if(ne.stage==="error"){if(ne.message){const ge=ne.message.replace(rf,(vt,Mt)=>Mt),ut=ne.title??"Error";t(21,ce=[st(ut,ge,Ee,"error",ne.duration,ne.visible),...ce])}u.map(async ge=>{ge.trigger_after===Ee&&!ge.trigger_only_on_success&&Jt(ge.id,W.trigger_id)})}}}}function jo(S,J){if(v===null)return;const K=new URL(`https://huggingface.co/spaces/${v}/discussions/new`);S!==void 0&&S.length>0&&K.searchParams.set("title",S),K.searchParams.set("description",J),window.open(K.toString(),"_blank")}function Lo(S){const J=S.detail;t(21,ce=ce.filter(K=>K.id!==J))}const zo=S=>!!(S&&new URL(S,location.href).origin!==location.origin);async function To(){b&&await new cs(`let result = await (${b})();
108					return (!Array.isArray(result)) ? [result] : result;`)(),await Rn();for(var S=p.getElementsByTagName("a"),J=0;J<S.length;J++){const K=S[J].getAttribute("target"),pe=S[J].getAttribute("href");zo(pe)&&K!=="_blank"&&S[J].setAttribute("target","_blank")}os(),!(!p||mn)&&(p.addEventListener("prop_change",K=>{if(!eo(K))throw new Error("not a custom event");const{id:pe,prop:R,value:oe}=K.detail;T([{id:pe,prop:R,value:oe}]),R==="input_ready"&&oe===!1&&dn.push(pe),R==="input_ready"&&oe===!0&&(dn=dn.filter(de=>de!==pe))}),p.addEventListener("gradio",K=>{if(!eo(K))throw new Error("not a custom event");const{id:pe,event:R,data:oe}=K.detail;if(R==="share"){const{title:de,description:he}=oe;jo(de,he)}else R==="error"?t(21,ce=[st("Error",oe,-1,R),...ce]):R==="warning"?t(21,ce=[st("Warning",oe,-1,R),...ce]):R==="info"?t(21,ce=[st("Info",oe,-1,R),...ce]):R=="clear_status"?Ao(pe,"complete",oe):R=="close_stream"?s[pe]?.[oe]?.forEach(he=>{if(_t.has(he)){const bt=`${d.config.root+d.config.api_prefix}/stream/${_t.get(he).event_id()}`;d.post_data(`${bt}/close`,{}),d.close_ws(bt)}}):s[pe]?.[R]?.forEach(he=>{requestAnimationFrame(()=>{Jt(he,pe,oe)})})}),t(31,mn=!0))}const os=()=>{u.forEach(S=>{S.targets.some(J=>J[1]==="load")&&Jt(S.id)})};function Ao(S,J,K){K.status=J,T([{id:S,prop:"loading_status",value:K}])}function Mn(S){let J=[];
108Object.entries(S).forEach(([R,oe])=>{if(d.closed&&oe.status==="error")return;let de=u.find(he=>he.id==oe.fn_index);de!==void 0&&(oe.scroll_to_output=de.scroll_to_output,oe.show_progress=de.show_progress,J.push({id:parseInt(R),prop:"loading_status",value:oe}))});const K=ie.get_inputs_to_update(),pe=Array.from(K).map(([R,oe])=>({id:R,prop:"pending",value:oe==="pending"}));T([...J,...pe])}sf(()=>{document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&(ml=!0)}),dl=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)});const Mo=()=>{pn(!fl)},Po=()=>{Tn(!zn)},Oo=()=>{pn(!0),t(19,fn=!1)},Io=()=>{pn(!1)},Do=S=>{pn(!1),t(20,An=[]),t(19,fn=S.detail?.api_recorder_visible)},Fo=()=>{Tn(!1)},Uo=S=>{Tn(!1)};return l.$$set=S=>{"root"in S&&t(0,c=S.root),"components"in S&&t(33,r=S.components),"layout"in S&&t(34,_=S.layout),"dependencies"in S&&t(1,u=S.dependencies),"title"in S&&t(2,f=S.title),"target"in S&&t(3,p=S.target),"autoscroll"in S&&t(4,g=S.autoscroll),"show_api"in S&&t(5,h=S.show_api),"show_footer"in S&&t(6,$=S.show_footer),"control_page_title"in S&&t(7,m=S.control_page_title),"app_mode"in S&&t(8,w=S.app_mode),"theme_mode"in S&&t(9,k=S.theme_mode),"app"in S&&t(10,d=S.app),"space_id"in S&&t(11,v=S.space_id),"version"in S&&t(12,y=S.version),"js"in S&&t(35,b=S.js),"fill_height"in S&&t(36,q=S.fill_height),"ready"in S&&t(32,j=S.ready),"username"in S&&t(13,E=S.username),"api_prefix"in S&&t(37,C=S.api_prefix),"max_file_size"in S&&t(14,A=S.max_file_size),"initial_layout"in S&&t(38,N=S.initial_layout),"css"in S&&t(15,O=S.css),"search_params"in S&&t(39,un=S.search_params),"render_complete"in S&&t(31,mn=S.render_complete)},l.$$.update=()=>{l.$$.dirty[0]&1035|l.$$.dirty[1]&44&&wo(),l.$$.dirty[0]&65536&&t(32,j=!!a),l.$$.dirty[0]&2|l.$$.dirty[1]&1025&&u!==ul&&mn&&(os(),t(41,ul=u)),l.$$.dirty[1]&2048&&Mn(n)},[c,u,f,p,g,h,$,m,w,k,d,v,y,E,A,O,a,fl,zn,fn,An,ce,o,V,te,ie,Se,pn,Tn,Lo,To,mn,j,r,_,b,q,C,N,un,ns,ul,n,Mo,Po,Oo,Io,Do,Fo,Uo]}class Of extends ef{constructor(e){super(),nf(this,e,_f,of,lf,{root:0,components:33,layout:34,dependencies:1,title:2,target:3,autoscroll:4,show_api:5,show_footer:6,control_page_title:7,app_mode:8,theme_mode:9,app:10,space_id:11,version:12,js:35,fill_height:36,ready:32,username:13,api_prefix:37,max_file_size:14,initial_layout:38,css:15,search_params:39,render_complete:31,add_new_message:40},null,[-1,-1,-1])}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),_e()}get components(){return this.$$.ctx[33]}set components(e){this.$$set({components:e}),_e()}get layout(){return this.$$.ctx[34]}set layout(e){this.$$set({layout:e}),_e()}get dependencies(){return this.$$.ctx[1]}set dependencies(e){this.$$set({dependencies:e}),_e()}get title(){return this.$$.ctx[2]}set title(e){this.$$set({title:e}),_e()}get target(){return this.$$.ctx[3]}set target(e){this.$$set({target:e}),_e()}get autoscroll(){return this.$$.ctx[4]}set autoscroll(e){this.$$set({autoscroll:e}),_e()}get show_api(){return this.$$.ctx[5]}set show_api(e){this.$$set({show_api:e}),_e()}get show_footer(){return this.$$.ctx[6]}set show_footer(e){this.$$set({show_footer:e}),_e()}get control_page_title(){return this.$$.ctx[7]}set control_page_title(e){this.$$set({control_page_title:e}),_e()}get app_mode(){return this.$$.ctx[8]}set app_mode(e){this.$$set({app_mode:e}),_e()}get theme_mode(){return this.$$.ctx[9]}set theme_mode(e){this.$$set({theme_mode:e}),_e()}get app(){return this.$$.ctx[10]}set app(e){this.$$set({app:e}),_e()}get space_id(){return this.$$.ctx[11]}set space_id(e){this.$$set({space_id:e}),_e()}get version(){return this.$$.ctx[12]}set version(e){this.$$set({version:e}),_e()}get js(){return this.$$.ctx[35]}set js(e){this.$$set({js:e}),_e()}get fill_height(){return this.$$.ctx[36]}set fill_height(e){this.$$set({fill_height:e}),_e()}get ready(){return this.$$.ctx[32]}set ready(e){this.$$set({ready:e}),_e()}get username(){return this.$$.ctx[13]}set username(e){this.$$set({username:e}),_e()}get api_prefix(){return this.$$.ctx[37]}set api_prefix(e){this.$$set({api_prefix:e}),_e()}get max_file_size(){return this.$$.ctx[14]}set max_file_size(e){this.$$set({max_file_size:e}),_e()}get initial_layout(){return this.$$.ctx[38]}set initial_layout(e){this.$$set({initial_layout:e}),_e()}get css(){return this.$$.ctx[15]}set css(e){this.$$set({css:e}),_e()}get search_params(){return this.$$.ctx[39]}set search_params(e){this.$$set({search_params:e}),_e()}get render_complete(){return this.$$.ctx[31]}set render_complete(e){this.$$set({render_complete:e}),_e()}get add_new_message(){return this.$$.ctx[40]}}export{Of as default};
109//# sourceMappingURL=Blocks-BMC4HgbM.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.