1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Blocks-BEaKnzuj.js","./index-DputZZxm.js","./index-CCA5X64I.css","./init-CYI6iZYC.js","./init-DV_66Kck.css","./StreamingBar-BtwDBaPl.js","./FullscreenButton-D7DmzQQ9.js","./MarkdownCode-DTX-UkhB.js","./prism-python-oCRsS_S4.js","./MarkdownCode-Ca9FjBJK.css","./FullscreenButton-BYduS5IX.css","./StreamingBar-Dq7cCzkm.css","./Blocks-D0rbzfnq.css","./Login-BMGWFjDF.js","./Index-cwl6r4yK.js","./Index-DMXFGchm.css","./Index-CHBVi5hu.js","./Example-Bdcw8sPw.js","./Example-DRnq2kzJ.css","./Index-D812IjdW.css","./Index-Dwn46RCV.js","./Image-0bVIZe-w.js","./Image-Ds1uFAjO.css","./ImagePreview-BiSVoKtP.js","./ImagePreview-D5bl4ZzZ.css","./Index-VLJFaMM1.css","./Index-DcuC0IYx.js","./Index-Bp6-wsMo.css","./Login-NNqXlI-L.css"])))=>i.map(i=>d[i]); 2import{_ as we}from"./index-DputZZxm.js";import{$ as He,s as Ve,E as Ge,w as We,p as be,m as ye}from"./init-CYI6iZYC.js";import{S as Ze}from"./StreamingBar-BtwDBaPl.js";import"./svelte/svelte.js";import"./FullscreenButton-D7DmzQQ9.js";import"./MarkdownCode-DTX-UkhB.js";import"./prism-python-oCRsS_S4.js";var Ye=()=>{const t=document.createElement("link");t.href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700;1,900&display=swap",t.rel="stylesheet";const e=document.createElement("link");e.href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600;700&display=swap",e.rel="stylesheet",document.head.appendChild(t),document.head.appendChild(e)},Je=()=>{const t=document.createElement("div");return t.style.backgroundImage="linear-gradient(to top, #f9fafb, white)",t.style.border="1px solid #e5e7eb",t.style.borderRadius="0.75rem",t.style.boxShadow="0 0 10px rgba(0, 0, 0, 0.1)",t.style.color="#374151",t.style.display="flex",t.style.flexDirection="row",t.style.alignItems="center",t.style.height="40px",t.style.justifyContent="space-between",t.style.overflow="hidden",t.style.position="fixed",t.style.right=".75rem",t.style.top=".75rem",t.style.width="auto",t.style.zIndex="20",t.style.paddingLeft="1rem",t.setAttribute("id","huggingface-space-header"),window.matchMedia("(max-width: 768px)").addEventListener("change",e=>{e.matches?t.style.display="none":t.style.display="flex"}),t},Ke=()=>{const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("xmlns:link","http://www.w3.org/1999/xlink"),t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false"),t.setAttribute("role","img"),t.setAttribute("width","1em"),t.setAttribute("height","1em"),t.setAttribute("preserveAspectRatio","xMidYMid meet"),t.setAttribute("viewBox","0 0 12 12"),t.setAttribute("fill","currentColor");const e=document.createElementNS("http://www.w3.org/2000/svg","path");return e.setAttribute("d","M0.375001 10.3828L0.375 1.61719C0.375 1.104 0.816001 0.687501 1.35938 0.687501L10.6406 0.6875C10.9017 0.6875 11.1521 0.785449 11.3367 0.959797C11.5213 1.13415 11.625 1.37062 11.625 1.61719V10.3828C11.625 10.6294 11.5213 10.8659 11.3367 11.0402C11.1521 11.2145 10.9017 11.3125 10.6406 11.3125H1.35938C0.816001 11.3125 0.375001 10.896 0.375001 10.3828ZM1.35938 10.5156H10.6406C10.7183 10.5156 10.7813 10.4561 10.7813 10.3828V4.40625H1.21875V10.3828C1.21875 10.418 1.23356 10.4518 1.25994 10.4767C1.28631 10.5017 1.32208 10.5156 1.35938 10.5156ZM4.61052 6.38251L5.9999 7.69472L7.38927 6.38251C7.44083 6.33007 7.50645 6.29173 7.57913 6.27153C7.6518 6.25134 7.72898 6.25003 7.8024 6.26776C7.87583 6.28549 7.9428 6.3216 7.99628 6.37227C8.04983 6.42295 8.08785 6.48631 8.10645 6.5557C8.12528 6.62497 8.12393 6.69773 8.10263 6.76635C8.0814 6.83497 8.0409 6.8969 7.98555 6.94564L6.29802 8.53936C6.21892 8.61399 6.11169 8.65592 5.9999 8.65592C5.8881 8.65592 5.78087 8.61399 5.70177 8.53936L4.01427 6.94564C3.95874 6.89694 3.91814 6.835 3.89676 6.76633C3.87538 6.69766 3.874 6.62483 3.89277 6.55549C3.91154 6.48615 3.94977 6.42287 4.00343 6.37233C4.05708 6.32179 4.12418 6.28585 4.19765 6.2683C4.27098 6.25054 4.34803 6.25178 4.42068 6.27188C4.49334 6.29198 4.55891 6.3302 4.610
252 6.38251Z"),t.appendChild(e),t},Qe=(t,e)=>{const n=document.createElement("div");return n.setAttribute("id","space-header__collapse"),n.style.display="flex",n.style.flexDirection="row",n.style.alignItems="center",n.style.justifyContent="center",n.style.fontSize="16px",n.style.paddingLeft="10px",n.style.paddingRight="10px",n.style.height="40px",n.style.cursor="pointer",n.style.color="#40546e",n.style.transitionDuration="0.1s",n.style.transitionProperty="all",n.style.transitionTimingFunction="ease-in-out",n.appendChild(Ke()),n.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation(),e()}),n.addEventListener("mouseenter",()=>{n.style.color="#213551"}),n.addEventListener("mouseleave",()=>{n.style.color="#40546e"}),n},Xe=t=>{const e=document.createElement("p");return e.style.margin="0",e.style.padding="0",e.style.color="#9ca3af",e.style.fontSize="14px",e.style.fontFamily="Source Sans Pro, sans-serif",e.style.padding="0px 6px",e.style.borderLeft="1px solid #e5e7eb",e.style.marginLeft="4px",e.textContent=(t??0).toString(),e},xe=()=>{const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("xmlns:link","http://www.w3.org/1999/xlink"),t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false"),t.setAttribute("role","img"),t.setAttribute("width","1em"),t.setAttribute("height","1em"),t.setAttribute("preserveAspectRatio","xMidYMid meet"),t.setAttribute("viewBox","0 0 32 32"),t.setAttribute("fill","#6b7280");const e=document.createElementNS("http://www.w3.org/2000/svg","path");return e.setAttribute("d","M22.45,6a5.47,5.47,0,0,1,3.91,1.64,5.7,5.7,0,0,1,0,8L16,26.13,5.64,15.64a5.7,5.7,0,0,1,0-8,5.48,5.48,0,0,1,7.82,0L16,10.24l2.53-2.58A5.44,5.44,0,0,1,22.45,6m0-2a7.47,7.47,0,0,0-5.34,2.24L16,7.36,14.89,6.24a7.49,7.49,0,0,0-10.68,0,7.72,7.72,0,0,0,0,10.82L16,29,27.79,17.06a7.72,7.72,0,0,0,0-10.82A7.49,7.49,0,0,0,22.45,4Z"),t.appendChild(e),t},$e=t=>{const e=document.createElement("a");return e.setAttribute("href",`https://huggingface.co/spaces/${t.id}`),e.setAttribute("rel","noopener noreferrer"),e.setAttribute("target","_blank"),e.style.border="1px solid #e5e7eb",e.style.borderRadius="6px",e.style.display="flex",e.style.flexDirection="row",e.style.alignItems="center",e.style.margin="0 0 0 12px",e.style.fontSize="14px",e.style.paddingLeft="4px",e.style.textDecoration="none",e.appendChild(xe()),e.appendChild(Xe(t.likes)),e},et=(t,e="user")=>{const n=e==="user"?"users":"organizations",r=document.createElement("img");return r.src=`https://huggingface.co/api/${n}/${t}/avatar`,r.style.width="0.875rem",r.style.height="0.875rem",r.style.borderRadius="50%",r.style.flex="none",r.style.marginRight="0.375rem",r},tt=t=>{const[e,n]=t.split("/"),r=document.createElement("a");return r.setAttribute("href",`https://huggingface.co/spaces/${t}`),r.setAttribute("rel","noopener noreferrer"),r.setAttribute("target","_blank"),r.style.color="#1f2937",r.style.textDecoration="none",r.style.fontWeight="600",r.style.fontSize="15px",r.style.lineHeight="24px",r.style.flex="none",r.style.fontFamily="IBM Plex Mono, sans-serif",r.addEventListener("mouseover",()=>{r.style.color="#2563eb"}),r.addEventListener("mouseout",()=>{r.style.color="#1f2937"}),r.textContent=n,r},nt=()=>{const t=document.createElement("div");return t.style.marginLeft=".125rem",t.style.marginRight=".125rem",t.style.color="#d1d5db",t.textContent="/",t},rt=t=>{const e=document.createElement("a");return e.setAttribute("href",`https://huggingface.co/${t}`),e.setAttribute("rel","noopener noreferrer"),e.setAttribute("target","_blank"),e.style.color="rgb(107, 114, 128)",e.style.textDecoration="none",e.style.fontWeight="400",e.style.fontSize="16px",e.style.lineHeight="24px",e.style.flex="none",e.style.fontFamily="Source Sans Pro, sans-serif",e.addEventListener("mouseover",()=>{e.style.color="#2563eb"}),e.addEventListener("mouseout",()=>{e.style.color="rgb(107, 114, 128)"}),e.textContent=t,e},st=t=>{const e=document.createElement("div");return e.style.display="flex",e.style.flexDirection="row",e.style.alignItems="center",e.style.justifyContent="center",e.style.borderRight="1px solid #e5e7eb",e.style.paddingRight="12px",e.style.height="40px",t.type!=="unknown"&&e.appendChild(et(t.author,t.type)),e.appendChild(rt(t.author)),e.appendChild(nt()),e.appendChild(tt(t.id)),e.appendChild($e(t)),e},ot=t=>{const e=Je(),n=()=>e.style.display="none";return e.appendChild(st(t)),e.appendChild(Qe(t,n)),e},ve=async(t,e="user")=>{const n=e==="user"?"users":"organizations";try{return(await fetch(`https://huggingface.co/api/${n}/${t}/avatar`)).ok}catch{return!1}},it=async t=>{try{return await(await fetch(`https://huggingface.co/api/spaces/${t}`)).json()}catch{return null}},at=(t,e)=>{if(document.body===null)return console.error("document.body is null");document.body.appendChild(t)};async function lt(t,e){var n,r;if(window===void 0)return console.error("Please run this script in a browser environment");
vendor: 13,467 bytes, line 2
2if(Object.values((r=(n=window.location)==null?void 0:n.ancestorOrigins)!=null?r:{0:window.document.referrer}).some(_=>{var c;return((c=new URL(_))==null?void 0:c.origin)==="https://huggingface.co"}))return;Ye();let o;if(typeof t=="string"){if(o=await it(t),o===null)return console.error("Space not found")}else o=t;const[i,d]=await Promise.all([ve(o.author,"user"),ve(o.author,"org")]);o.type=i?"user":d?"org":"unknown";const u=ot(o);return at(u),{element:u}}var ct=(t,e)=>lt(t);const{SvelteComponent:ut,add_flush_callback:F,append:C,assign:dt,attr:v,bind:H,binding_callbacks:V,check_outros:x,component_subscribe:ke,create_component:G,destroy_component:W,detach:A,element:E,empty:Se,flush:w,get_spread_object:_t,get_spread_update:ft,group_outros:$,init:pt,insert:L,mount_component:Z,noop:mt,safe_not_equal:ht,set_data:Ie,space:Me,text:U,transition_in:y,transition_out:k}=window.__gradio__svelte__internal,{onMount:Ce,createEventDispatcher:gt,onDestroy:wt}=window.__gradio__svelte__internal;function Ee(t){let e,n,r,s,o,i=(t[21]==="pending"||t[21]==="error")&&!(t[13]&&t[13]?.auth_required)&&Ae(t);const d=[At,Et],u=[];function _(c,l){return c[13]?.auth_required&&c[26]?0:c[13]&&c[25]&&c[24]?1:-1}return~(n=_(t))&&(r=u[n]=d[n](t)),{c(){i&&i.c(),e=Me(),r&&r.c(),s=Se()},m(c,l){i&&i.m(c,l),L(c,e,l),~n&&u[n].m(c,l),L(c,s,l),o=!0},p(c,l){(c[21]==="pending"||c[21]==="error")&&!(c[13]&&c[13]?.auth_required)?i?(i.p(c,l),l[0]&2105344&&y(i,1)):(i=Ae(c),i.c(),y(i,1),i.m(e.parentNode,e)):i&&($(),k(i,1,1,()=>{i=null}),x());let f=n;n=_(c),n===f?~n&&u[n].p(c,l):(r&&($(),k(u[f],1,1,()=>{u[f]=null}),x()),~n?(r=u[n],r?r.p(c,l):(r=u[n]=d[n](c),r.c()),y(r,1),r.m(s.parentNode,s)):r=null)},i(c){o||(y(i),y(r),o=!0)},o(c){k(i),k(r),o=!1},d(c){c&&(A(e),A(s)),i&&i.d(c),~n&&u[n].d(c)}}}function Ae(t){let e,n;return e=new Ze({props:{absolute:!t[4],status:t[21],timer:!1,queue_position:null,queue_size:null,translucent:!0,loading_text:t[22],i18n:t[17],autoscroll:t[0],$$slots:{error:[Ct],"additional-loading-text":[yt]},$$scope:{ctx:t}}}),{c(){G(e.$$.fragment)},m(r,s){Z(e,r,s),n=!0},p(r,s){const o={};s[0]&16&&(o.absolute=!r[4]),s[0]&2097152&&(o.status=r[21]),s[0]&4194304&&(o.loading_text=r[22]),s[0]&131072&&(o.i18n=r[17]),s[0]&1&&(o.autoscroll=r[0]),s[0]&134365952|s[1]&16777216&&(o.$$scope={dirty:s,ctx:r}),e.$set(o)},i(r){n||(y(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){W(e,r)}}}function bt(t){let e;return{c(){e=E("p"),e.innerHTML='If your custom component never loads, consult the troubleshooting <a style="color: blue;" href="https://www.gradio.app/guides/frequently-asked-questions#the-development-server-didnt-work-for-me" class="svelte-y6l4b">guide</a>.'},m(n,r){L(n,e,r)},d(n){n&&A(e)}}}function yt(t){let e,n=t[28]==="dev"&&bt();return{c(){e=E("div"),n&&n.c(),v(e,"class","load-text"),v(e,"slot","additional-loading-text")},m(r,s){L(r,e,s),n&&n.m(e,null)},p:mt,d(r){r&&A(e),n&&n.d()}}}function vt(t){let e,n=t[17]("errors.contact_page_author")+"",r;return{c(){e=E("p"),r=U(n),v(e,"class","svelte-y6l4b")},m(s,o){L(s,e,o),C(e,r)},p(s,o){o[0]&131072&&n!==(n=s[17]("errors.contact_page_author")+"")&&Ie(r,n)},d(s){s&&A(e)}}}function kt(t){let e,n,r,s,o,i;return{c(){e=E("p"),n=U("Please "),r=E("a"),s=U("contact the author of the space"),i=U(" to let them know."),v(r,"href",o="https://huggingface.co/spaces/"+t[8]+"/discussions/new?title="+t[27].title(t[14]?.detail)+"&description="+t[27].description(t[14]?.detail,location.origin)),v(r,"class","svelte-y6l4b"),v(e,"class","svelte-y6l4b")},m(d,u){L(d,e,u),C(e,n),C(e,r),C(r,s),C(e,i)},p(d,u){u[0]&134234368&&o!==(o="https://huggingface.co/spaces/"+d[8]+"/discussions/new?title="+d[27].title(d[14]?.detail)+"&description="+d[27].description(d[14]?.detail,location.origin))&&v(r,"href",o)},d(d){d&&A(e)}}}function Ct(t){let e,n,r,s=(t[14]?.message||"")+"",o,i;function d(c,l){if((c[14].status==="space_error"||c[14].status==="paused")&&c[14].discussions_enabled&&c[27])return kt;if(c[9])return vt}let u=d(t),_=u&&u(t);return{c(){e=E("div"),n=E("p"),r=E("strong"),o=U(s),i=Me(),_&&_.c(),v(n,"class","svelte-y6l4b"),v(e,"class","error svelte-y6l4b"),v(e,"slot","error")},m(c,l){L(c,e,l),C(e,n),C(n,r),C(r,o),C(e,i),_&&_.m(e,null)},p(c,l){l[0]&16384&&s!==(s=(c[14]?.message||"")+"")&&Ie(o,s),u===(u=d(c))&&_?_.p(c,l):(_&&_.d(1),_=u&&u(c),_&&(_.c(),_.m(e,null)))},d(c){c&&A(e),_&&_.d()}}}function Et(t){let e,n,r,s,o;const i=[{app:t[15]},t[13],{fill_height:!t[4]&&t[13].fill_height},{theme_mode:t[23]},{control_page_title:t[5]},{target:t[10]},{autoscroll:t[0]},{show_footer:!t[4]},{app_mode:t[3]},{version:t[1]},{api_prefix:t[13].api_prefix||""},{max_file_size:t[13].max_file_size},{initial_layout:void 0},{search_params:new URLSearchParams(window.location.search)}];function d(l){t[35](l)}function u(l){t[36](l)}function _(l){t[37](l)}let c={};for(let l=0;l<i.length;l+=1)c=dt(c,i[l]);return t[11]!==void 0&&(c.ready=t[11]),t[12]!==void 0&&(c.render_complete=t[12]),t[16]!==void 0&&(c.add_new_message=t[16]),e=new t[25]({props:c}),V.push(()=>H(e,"ready",d)),V.push(()=>H(e,"render_complete",u)),V.push(()=>H(e,"add_new_message",_)),{c(){G(e.$$.fragment)},m(l,f){Z(e,l,f),o=!0},p(l,f){const R=f[0]&8430651?ft(i,[f[0]&32768&&{app:l[15]},f[0]&8192&&_t(l[13]),f[0]&8208&&{fill_height:!l[4]&&l[13].fill_height},f[0]&8388608&&{theme_mode:l[23]},f[0]&32&&{control_page_title:l[5]},f[0]&1024&&{target:l[10]},f[0]&1&&{autoscroll:l[0]},f[0]&16&&{show_footer:!l[4]},f[0]&8&&{app_mode:l[3]},f[0]&2&&{version:l[1]},f[0]&8192&&{api_prefix:l[13].api_prefix||""},f[0]&8192&&{max_file_size:l[13].max_file_size},f&0&&{initial_layout:void 0},f&0&&{search_params:new URLSearchParams(window.location.search)}]):{};!n&&f[0]&2048&&(n=!0,R.ready=l[11],F(()=>n=!1)),!r&&f[0]&4096&&(r=!0,R.render_complete=l[12],F(()=>r=!1)),!s&&f[0]&65536&&(s=!0,R.add_new_message=l[16],F(()=>s=!1)),e.$set(R)},i(l){o||(y(e.$$.fragment,l),o=!0)},o(l){k(e.$$.fragment,l),o=!1},d(l){W(e,l)}}}function At(t){let e,n;return e=new t[26]({props:{auth_message:t[13].auth_message,root:t[13].root,space_id:t[8],app_mode:t[3]}}),{c(){G(e.$$.fragment)},m(r,s){Z(e,r,s),n=!0},p(r,s){const o={};s[0]&8192&&(o.auth_message=r[13].auth_message),s[0]&8192&&(o.root=r[13].root),s[0]&256&&(o.space_id=r[8]),s[0]&8&&(o.app_mode=r[3]),e.$set(o)},i(r){n||(y(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){W(e,r)}}}function Lt(t){let e,n,r=t[9]&&Ee(t);return{c(){r&&r.c(),e=Se()},m(s,o){r&&r.m(s,o),L(s,e,o),n=!0},p(s,o){s[9]?r?(r.p(s,o),o[0]&512&&y(r,1)):(r=Ee(s),r.c(),y(r,1),r.m(e.parentNode,e)):r&&($(),k(r,1,1,()=>{r=null}),x())},i(s){n||(y(r),n=!0)},o(s){k(r),n=!1},d(s){s&&A(e),r&&r.d(s)}}}function Rt(t){let e,n,r;function s(i){t[38](i)}let o={display:t[6]&&t[4],is_embed:t[4],info:!!t[8]&&t[7],version:t[1],initial_height:t[2],space:t[8],loaded:t[21]==="complete",fill_width:t[13]?.fill_width||!1,pages:t[18],current_page:t[19],root:t[20],components:t[13]?.components||[],$$slots:{default:[Lt]},$$scope:{ctx:t}};return t[10]!==void 0&&(o.wrapper=t[10]),e=new Ge({props:o}),V.push(()=>H(e,"wrapper",s)),{c(){G(e.$$.fragment)},m(i,d){Z(e,i,d),r=!0},p(i,d){const u={};d[0]&80&&(u.display=i[6]&&i[4]),d[0]&16&&(u.is_embed=i[4]),d[0]&384&&(u.info=!!i[8]&&i[7]),d[0]&2&&(u.version=i[1]),d[0]&4&&(u.initial_height=i[2]),d[0]&256&&(u.space=i[8]),d[0]&2097152&&(u.loaded=i[21]==="complete"),d[0]&8192&&(u.fill_width=i[13]?.fill_width||!1),d[0]&262144&&(u.pages=i[18]),d[0]&524288&&(u.current_page=i[19]),d[0]&1048576&&(u.root=i[20]),d[0]&8192&&(u.components=i[13]?.components||[]),d[0]&266600251|d[1]&16777216&&(u.$$scope={dirty:d,ctx:i}),!n&&d[0]&1024&&(n=!0,u.wrapper=i[10],F(()=>n=!1)),e.$set(u)},i(i){r||(y(e.$$.fragment,i),r=!0)},o(i){k(e.$$.fragment,i),r=!1},d(i){W(e,i)}}}let St=-1;function It(){const t=We({}),e=new Map,n=new IntersectionObserver(s=>{s.forEach(o=>{if(o.isIntersecting){let i=e.get(o.target);i!==void 0&&t.update(d=>({...d,[i]:!0}))}})});function r(s,o){e.set(o,s),n.observe(o)}return{register:r,subscribe:t.subscribe}}const Le=It();async function Re(t){if(t){const e=new DOMParser,n=Array.from(e.parseFromString(t,"text/html").head.children);if(n)for(let r of n){let s=document.createElement(r.tagName);if(Array.from(r.attributes).forEach(o=>{s.setAttribute(o.name,o.value)}),s.textContent=r.textContent,s.tagName=="META"){const o=s.getAttribute("property"),i=s.getAttribute("name");if(o||i){const u=Array.from(document.head.getElementsByTagName("meta")??[]).find(_=>o&&_.getAttribute("property")===o||i&&_.getAttribute("name")===i?!_.isEqualNode(s):!1);if(u){document.head.replaceChild(s,u);continue}}}document.head.appendChild(s)}}}function Mt(t,e,n){let r,s;ke(t,He,a=>n(17,r=a)),ke(t,Le,a=>n(34,s=a));let o=!1;Ve().then(()=>{n(9,o=!0)});const i=gt();let{autoscroll:d}=e,{version:u}=e,{initial_height:_}=e,{app_mode:c}=e,{is_embed:l}=e,{theme_mode:f="system"}=e,{control_page_title:R}=e,{container:ee}=e,{info:te}=e,{eager:Y}=e,J,ne=[],re,se,{Client:q}=e,{space:K}=e,{src:Q}=e,oe=St++,ie="pending",S,N=!1,T=!1,p,ae="Loading...",le,B,D=null;async function ce(a){a&&(D||(D=document.createElement("style"),document.head.appendChild(D)),D.textContent=be(a,u,D)),await ye(p.root+"/theme.css?v="+p.theme_hash,document.head),p.stylesheets&&await Promise.all(p.stylesheets.map(h=>h.startsWith("http:")||h.startsWith("https:")?ye(h,document.head):fetch(p.root+"/"+h).then(b=>b.text()).then(b=>{be(b,u)})))}function Pe(a){const h=window.__gradio_mode__==="website";let m;if(h)m="light";else{const P=new URL(window.location.toString()).searchParams.get("__theme");m=f||P||"system"}return m==="dark"||m==="light"?ue(a,m):m=Ne(a),m}function Ne(a){const h=m();window?.matchMedia("(prefers-color-scheme: dark)")?.addEventListener("change",m);function m(){let b=window?.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light";return ue(a,b),b}return h}function ue(a,h){const m=l?a.parentElement:document.body,b=l?a:a.parentElement;b.style.background="var(--body-background-fill)",h==="dark"?m.classList.add("dark"):m.classList.remove("dark")}let I={message:"",load_status:"pending",status:"sleeping",detail:"SLEEPING"},g,X=!1;function de(a){n(14,I=a)}const _e=window.__GRADIO_DEV__;let j=!1,M;Ce(async()=>{n(23,le=Pe(S));const a=window.__GRADIO__SERVER_PORT__;B=_e==="dev"?`http://localhost:${typeof a=="number"?a:7860}`:K||Q||new URL(location.pathname,location.origin).href.replace(/\/$/,"");const h=new URLSearchParams(window.location.search).get("deep_link"),m={};if(h&&(m.deep_link=h),n(15,g=await q.connect(B,{status_callback:de,with_null_state:!0,events:["data","log","status","render"],query_params:m})),window.addEventListener("beforeunload",()=>{g.close()}),!g.config)throw new Error("Could not resolve app config");n(13,p=g.get_url_config()),window.__gradio_space__=p.space_id,window.__gradio_session_hash__=g.session_hash,n(14,I={message:"",load_status:"complete",status:"running",detail:"RUNNING"}),await ce(p.css),await Re(p.head),n(24,X=!0),window.__is_colab__=p.is_colab;const b="supports-zerogpu-headers";window.addEventListener("message",O=>{O.data===b&&(window.supports_zerogpu_headers=!0)});const P=window.location.hostname;if(P.includes(".dev.")||P.endsWith(".hf.space")){const O=P.includes(".dev.")?`https://moon-${P.split(".")[1]}.dev.spaces.huggingface.tech`:"https://huggingface.co";window.parent.postMessage(b,O)}i("loaded"),n(18,ne=p.pages),n(19,re=p.current_page),n(20,se=p.root),p.deep_link_state==="invalid"&&n(33,j=!0),p.dev_mode&&setTimeout(()=>{const{host:O}=new URL(B);let Fe=new URL(`${window.location.protocol}//${O}${g.api_prefix}/dev/reload`);J=new EventSource(Fe),J.addEventListener("error",async he=>{let ge=he.data;ge&&(M("Error","Error reloading app","error"),console.error(JSON.parse(ge)))}),J.addEventListener("reload",async he=>{if(g.close(),n(15,g=await q.connect(B,{status_callback:de,with_null_state:!0,events:["data","log","status","render"],session_hash:g.session_hash})),!g.config)throw new Error("Could not resolve app config");n(13,p=g.get_url_config()),window.__gradio_space__=p.space_id,await ce(p.css),await Re(p.head),n(24,X=!0),window.__is_colab__=p.is_colab,i("loaded")})},200)});let fe,pe;async function De(){n(25,fe=(await we(async()=>{const{default:a}=await import("./Blocks-BEaKnzuj.js").then(h=>h.B);return{default:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url)).default)}async function ze(){n(26,pe=(await we(async()=>{const{default:a}=await import("./Login-BMGWFjDF.js");return{default:a}},__vite__mapDeps([13,14,15,16,6,7,1,2,8,3,4,9,10,5,11,17,18,19,20,21,22,23,24,25,26,27,28]),import.meta.url)).default)}function Oe(){p.auth_required?ze():De()}let me;Ce(async()=>{Le.register(oe,S)});let z;async function Ue(a,h){if(a&&!h&&window.self===window.top){z&&(z.remove(),z=void 0);const m=await ct(a);m&&(z=m.element)}}wt(()=>{z?.remove()});function qe(a){N=a,n(11,N)}function Te(a){T=a,n(12,T)}function Be(a){M=a,n(16,M)}function je(a){S=a,n(10,S)}return t.$$set=a=>{"autoscroll"in a&&n(0,d=a.autoscroll),"version"in a&&n(1,u=a.version),"initial_height"in a&&n(2,_=a.initial_height),"app_mode"in a&&n(3,c=a.app_mode),"is_embed"in a&&n(4,l=a.is_embed),"theme_mode"in a&&n(29,f=a.theme_mode),"control_page_title"in a&&n(5,R=a.control_page_title),"container"in a&&n(6,ee=a.container),"info"in a&&n(7,te=a.info),"eager"in a&&n(30,Y=a.eager),"Client"in a&&n(31,q=a.Client),"space"in a&&n(8,K=a.space),"src"in a&&n(32,Q=a.src)},t.$$.update=()=>{t.$$.dirty[0]&8192&&p?.app_id&&p.app_id,t.$$.dirty[0]&65536|t.$$.dirty[1]&4&&M&&j&&(M("Error","Deep link was not val
2id","error"),n(33,j=!1)),t.$$.dirty[0]&18432&&n(21,ie=!N&&I.load_status!=="error"?"pending":!N&&I.load_status==="error"?"error":I.load_status),t.$$.dirty[0]&1073750016|t.$$.dirty[1]&8&&p&&(Y||s[oe])&&Oe(),t.$$.dirty[0]&131584&&o&&(n(22,ae=r("common.loading")+"..."),n(27,me={readable_error:{NO_APP_FILE:r("errors.no_app_file"),CONFIG_ERROR:r("errors.config_error"),BUILD_ERROR:r("errors.build_error"),RUNTIME_ERROR:r("errors.runtime_error"),PAUSED:r("errors.space_paused")},title(a){return encodeURIComponent(r("errors.space_not_working"))},description(a,h){return encodeURIComponent(`Hello, 3 4Firstly, thanks for creating this space! 5 6I noticed that the space isn't working correctly because there is ${this.readable_error[a]||"an error"}. 7 8It would be great if you could take a look at this because this space is being embedded on ${h}. 9 10Thanks!`)}})),t.$$.dirty[0]&5120&&T&&S.dispatchEvent(new CustomEvent("render",{bubbles:!0,cancelable:!1,composed:!0})),t.$$.dirty[0]&32784&&g?.config&&Ue(g?.config?.space_id,l)},[d,u,_,c,l,R,ee,te,K,o,S,N,T,p,I,g,M,r,ne,re,se,ie,ae,le,X,fe,pe,me,_e,f,Y,q,Q,j,s,qe,Te,Be,je]}class Bt extends ut{constructor(e){super(),pt(this,e,Mt,Rt,ht,{autoscroll:0,version:1,initial_height:2,app_mode:3,is_embed:4,theme_mode:29,control_page_title:5,container:6,info:7,eager:30,Client:31,space:8,src:32},null,[-1,-1])}get autoscroll(){return this.$$.ctx[0]}set autoscroll(e){this.$$set({autoscroll:e}),w()}get version(){return this.$$.ctx[1]}set version(e){this.$$set({version:e}),w()}get initial_height(){return this.$$.ctx[2]}set initial_height(e){this.$$set({initial_height:e}),w()}get app_mode(){return this.$$.ctx[3]}set app_mode(e){this.$$set({app_mode:e}),w()}get is_embed(){return this.$$.ctx[4]}set is_embed(e){this.$$set({is_embed:e}),w()}get theme_mode(){return this.$$.ctx[29]}set theme_mode(e){this.$$set({theme_mode:e}),w()}get control_page_title(){return this.$$.ctx[5]}set control_page_title(e){this.$$set({control_page_title:e}),w()}get container(){return this.$$.ctx[6]}set container(e){this.$$set({container:e}),w()}get info(){return this.$$.ctx[7]}set info(e){this.$$set({info:e}),w()}get eager(){return this.$$.ctx[30]}set eager(e){this.$$set({eager:e}),w()}get Client(){return this.$$.ctx[31]}set Client(e){this.$$set({Client:e}),w()}get space(){return this.$$.ctx[8]}set space(e){this.$$set({space:e}),w()}get src(){return this.$$.ctx[32]}set src(e){this.$$set({src:e}),w()}}export{Bt as default}; 11//# sourceMappingURL=Index-CDBfCghh.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.