PageSourceSearch

https://ddeshler-neural-music-generator.hf.space/assets/index-9Ev7iYt6.js

js ddeshler-neural-music-generator.hf.space collected 2026-10-03 16:47:38 UTC 87,485 bytes, 43 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Index-Bokbevwk.js","./i18n-DhLovEFo.js","./i18n-BGEK-qBj.css","./index-BKfLiH8b.js","./StreamingBar.svelte_svelte_type_style_lang-D07DuzRz.js","./html-CfSn455r.js","./ScrollFade.svelte_svelte_type_style_lang-ogAEaD61.js","./snippet-xbRfGdXG.js","./ScrollFade-DV-0xzhB.css","./index-B_pwUImq.js","./StreamingBar-CMuqaV2j.css","./Clear-D8pztZ4O.js","./Index-CI7BqPz-.css","./index-BlQXYsaG.js","./index-tFQomdd2.js"])))=>i.map(i=>d[i]);
2(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();const vs="modulepreload",ms=function(e,t){return new URL(e,t).href},qn={},ht=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let h=function(u){return Promise.all(u.map(l=>Promise.resolve(l).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");s=h(n.map(u=>{if(u=ms(u,r),u in qn)return;qn[u]=!0;const l=u.endsWith(".css"),f=l?'[rel="stylesheet"]':"";if(r)for(let v=o.length-1;v>=0;v--){const p=o[v];if(p.href===u&&(!l||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${f}`))return;const d=document.createElement("link");if(d.rel=l?"stylesheet":vs,l||(d.as="script"),d.crossOrigin="",d.href=u,c&&d.setAttribute("nonce",c),document.head.appendChild(d),l)return new Promise((v,p)=>{d.addEventListener("load",v),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})},gs="host",cr="queue/data",ws="queue/join",Un="upload",ys="login",Nt="config",bs="info",Es="runtime",Ss="sleeptime",ks="heartbeat",Ts="component_server",As="reset",xs="cancel",$s="app_id",ur="This application is currently busy. Please try again. ",ke="Connection errored out. ",Se="Could not resolve app config. ",Os="Could not get space status. ",Rs="Could not get API info. ",wn="Space metadata could not be loaded. ",Cs="Invalid URL. A full URL path is required.",Ns="Not authorized to access this space. ",fr="Invalid credentials. Could not login. ",Ps="Login credentials are required to access this space.",Ls="File system access is only available in Node.js environments",dr="Root URL not found in client config",Is="Error uploading file";async function Fn(e,t,n){try{return(await(await fetch(`https://huggingface.co/api/spaces/${e}/jwt`,{headers:{Authorization:`Bearer ${t}`,...n?{Cookie:n}:{}}})).json()).token||!1}catch{return!1}}function Ds(e){let t={};return e.forEach(({api_name:n,id:r})=>{n&&(t[n]=r)}),t}async function Ms(e){const t=this.options.token?{Authorization:`Bearer ${this.options.token}`}:{};if(typeof window<"u"&&window.gradio_config&&location.origin!=="http://localhost:9876"){if(window.gradio_config.current_page&&(e=e.substring(0,e.lastIndexOf("/"))),window.gradio_config.dev_mode||typeof window<"u"&&window?.BUILD_MODE==="dev"){let n=sn(e,this.deep_link?Nt+"?deep_link="+this.deep_link:Nt);const r=await this.fetch(n,{headers:t,credentials:this.options.credentials??"same-origin"}),s=await zn(r,!!this.options.auth);s.root=e||s.root,window.gradio_config={...s,current_page:window.gradio_config.current_page}}return{...window.gradio_config}}else if(e){let n=sn(e,this.deep_link?Nt+"?deep_link="+this.deep_link:Nt);const r=await this.fetch(n,{headers:t,credentials:this.options.credentials??"same-origin"}),s=await zn(r,!!this.options.auth);return s.root||(s.root=e),s}throw new Error(Se)}async function zn(e,t){if(e?.status===401&&!t){const r=(await e.json())?.detail?.auth_message;throw new Error(r||Ps)}else if(e?.status===401&&t)throw new Error(fr);if(e?.status===200){let n=await e.json();return n.dependencies?.forEach((r,s)=>{r.id===void 0&&(r.id=s)}),n}else if(e?.status===401)throw new Error(Ns);throw new Error(Se)}async function js(){const{http_protocol:e,host:t}=await bn(this.app_reference,this.options.token);try{if(this.options.auth){const n=await hr(e,t,this.options.auth,this.fetch,this.options.token,this.options.credentials);n&&this.set_cookies(n)}}catch(n){throw Error(n.message)}}async function hr(e,t,n,r,s,i){const o=new FormData;o.append("username",n?.[0]),o.append("password",n?.[1]);let a={};s&&(a.Authorization=`Bearer ${s}`);const c=await r(`${e}//${t}/${ys}`,{headers:a,method:"POST",body:o,credentials:i??"same-origin"});if(c.status===200)return c.headers.get("set-cookie");throw c.status===401?new Error(fr):new Error(wn)}function en(e){if(e.startsWith("http")){const{protocol:t,host:n,pathname:r}=new URL(e);return{ws_protocol:t==="https:"?"wss":"ws",http_protocol:t,host:n+(r!=="/"?r:"")}}return{ws_protocol:"wss",http_protocol:"https:",host:new URL(e).host}}const _r=e=>{let t=[];return e.split(/,(?=\s*[^\s=;]+=[^\s=;
vendor: 5,221 bytes, line 2
2]+)/).forEach(r=>{const[s,i]=r.split(";")[0].split("=");s&&i&&t.push(`${s.trim()}=${i.trim()}`)}),t},yn=/^[a-zA-Z0-9_\-\.]+\/[a-zA-Z0-9_\-\.]+$/,qs=/.*hf\.space\/{0,1}.*$/;async function bn(e,t){const n={};t&&(n.Authorization=`Bearer ${t}`);const r=e.trim().replace(/\/$/,"");if(yn.test(r))try{const i=(await(await fetch(`https://huggingface.co/api/spaces/${r}/${gs}`,{headers:n})).json()).host;return{space_id:e,...en(i)}}catch{throw new Error(wn)}if(qs.test(r)){const{ws_protocol:s,http_protocol:i,host:o}=en(r);return{space_id:o.split("/")[0].replace(".hf.space",""),ws_protocol:s,http_protocol:i,host:o}}return{space_id:!1,...en(r)}}const sn=(...e)=>{try{return e.reduce((t,n)=>(t=t.replace(/\/+$/,""),n=n.replace(/^\/+/,""),new URL(n,t+"/").toString()))}catch{throw new Error(Cs)}};function Us(e,t,n){const r={named_endpoints:{},unnamed_endpoints:{}};return Object.keys(e).forEach(s=>{(s==="named_endpoints"||s==="unnamed_endpoints")&&(r[s]={},Object.entries(e[s]).forEach(([i,{parameters:o,returns:a}])=>{const c=t.dependencies.find(l=>l.api_name===i||l.api_name===i.replace("/",""))?.id||n[i.replace("/","")]||-1,h=c!==-1?t.dependencies.find(l=>l.id==c)?.types:{generator:!1,cancel:!1};if(c!==-1&&t.dependencies.find(l=>l.id==c)?.inputs?.length!==o.length){const l=t.dependencies.find(f=>f.id==c).inputs.map(f=>t.components.find(d=>d.id===f)?.type);try{l.forEach((f,d)=>{if(f==="state"){const v={component:"state",example:null,parameter_default:null,parameter_has_default:!0,parameter_name:null,hidden:!0};o.splice(d,0,v)}})}catch(f){console.error(f)}}const u=(l,f,d,v)=>({...l,description:zs(l?.type,d),type:Fs(l?.type,f,d,v)||""});r[s][i]={parameters:o.map(l=>u(l,l?.component,l?.serializer,"parameter")),returns:a.map(l=>u(l,l?.component,l?.serializer,"return")),type:h}}))}),r}function Fs(e,t,n,r){if(t==="Api")return e.type;switch(e?.type){case"string":return"string";case"boolean":return"boolean";case"number":return"number"}if(n==="JSONSerializable"||n==="StringSerializable")return"any";if(n==="ListStringSerializable")return"string[]";if(t==="Image")return r==="parameter"?"Blob | File | Buffer":"string";if(n==="FileSerializable")return e?.type==="array"?r==="parameter"?"(Blob | File | Buffer)[]":"{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}[]":r==="parameter"?"Blob | File | Buffer":"{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}";if(n==="GallerySerializable")return r==="parameter"?"[(Blob | File | Buffer), (string | null)][]":"[{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}, (string | null))][]"}function zs(e,t){return t==="GallerySerializable"?"array of [file, label] tuples":t==="ListStringSerializable"?"array of strings":t==="FileSerializable"?"array of files or single file":e?.description}function Bn(e,t){switch(e.msg){case"send_data":return{type:"data"};case"send_hash":return{type:"hash"};case"queue_full":return{type:"update",status:{queue:!0,message:ur,stage:"error",code:e.code,success:e.success}};case"heartbeat":return{type:"heartbeat"};case"unexpected_error":return{type:"unexpected_error",status:{queue:!0,message:e.message,session_not_found:e.session_not_found,stage:"error",success:!1}};case"broken_connection":return{type:"broken_connection",status:{queue:!0,message:e.message,stage:"error",success:!1}};case"estimation":return{type:"update",status:{queue:!0,stage:t||"pending",code:e.code,size:e.queue_size,position:e.rank,eta:e.rank_eta,success:e.success}};case"progress":return{type:"update",status:{queue:!0,stage:"pending",code:e.code,progress_data:e.progress_data,success:e.success}};case"log":return{type:"log",data:e};case"process_generating":return{type:"generating",status:{queue:!0,message:e.success?null:e.output.error,stage:e.success?"generating":"error",code:e.code,progress_data:e.progress_data,eta:e.average_duration,changed_state_ids:e.success?e.output.changed_state_ids:void 0},data:e.success?e.output:null};case"process_streaming":return{type:"streaming",status:{queue:!0,message:e.output.error,stage:"streaming",time_limit:e.time_limit,code:e.code,progress_data:e.progress_data,changed_state_ids:e.output.changed_state_ids,eta:e.eta},data:e.output};case"process_completed":return"error"in e.output?{type:"update",status:{queue:!0,title:e.output.title??"Error",message:e.output.error??"An error occurred",visible:e.output.visible,duration:e.output.duration,stage:"error",code:e.code,success:e.success}}:{type:"complete",status:{queue:!0,message:e.success?void 0:e.output.error,stage:e.success?"complete":"error",code:e.code,progress_data:e.progress_data,changed_state_ids:e.success?e.output.changed_state_ids:void 0,used_cache:e.used_cache,cache_duration:e.cache_duration,avg_time:e.avg_time},data:e.success?e.output:null};case"process_starts":return{type:"update",status:{queue:!0,stage:"pending",code:e.code,size:e.rank,position:0,success:e.success,eta:e.eta},original_msg:"process_starts"}}return{type:"none",status:{stage:"error",queue:!0}}}const Bs=(e=[],t)=>{const n=t?t.parameters:[];if(Array.isArray(e))return t&&n.length>0&&e.length>n.length&&console.warn("Too many arguments provided for the endpoint."),e;const r=[],s=Object.keys(e);
2return n.forEach((i,o)=>{if(e.hasOwnProperty(i.parameter_name))r[o]=e[i.parameter_name];else if(i.parameter_has_default)r[o]=i.parameter_default;else throw new Error(`No value provided for required parameter: ${i.parameter_name}`)}),s.forEach(i=>{if(!n.some(o=>o.parameter_name===i))throw new Error(`Parameter \`${i}\` is not a valid keyword argument. Please refer to the API for usage.`)}),r.forEach((i,o)=>{if(i===void 0&&!n[o].parameter_has_default)throw new Error(`No value provided for required parameter: ${n[o].parameter_name}`)}),r};async function Gs(){if(this.api_info)return this.api_info;const{token:e}=this.options,{config:t}=this,n={};if(e&&(n.Authorization=`Bearer ${e}`),!!t)try{let r,s;if(typeof window<"u"&&window.gradio_api_info)s=window.gradio_api_info;else{const i=sn(t.root,this.api_prefix,bs);if(r=await this.fetch(i,{headers:n,credentials:this.options.credentials??"same-origin"}),!r.ok)throw new Error(ke);s=await r.json()}return"api"in s&&(s=s.api),s.named_endpoints["/predict"]&&!s.unnamed_endpoints[0]&&(s.unnamed_endpoints[0]=s.named_endpoints["/predict"]),Us(s,t,this.api_map)}catch(r){throw new Error("Could not get API info. "+r.message)}}async function Hs(e,t,n){const r={};this?.options?.token&&(r.Authorization=`Bearer ${this.options.token}`);const s=1e3,i=[];let o;for(let a=0;a<t.length;a+=s){const c=t.slice(a,a+s),h=new FormData;c.forEach(l=>{h.append("files",l)});try{const l=n?`${e}${this.api_prefix}/${Un}?upload_id=${n}`:`${e}${this.api_prefix}/${Un}`;o=await this.fetch(l,{method:"POST",body:h,headers:r,credentials:this.options.credentials??"same-origin"})}catch(l){throw new Error(ke+l.message)}if(!o.ok){const l=await o.text();return{error:`HTTP ${o.status}: ${l}`}}const u=await o.json();u&&i.push(...u)}return{files:i}}const Vs={radix:1e3,unit:["b","kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"]},Ys={radix:1024,unit:["b","Kib","Mib","Gib","Tib","Pib","Eib","Zib","Yib"]},Ws={radix:1024,unit:["b","Kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"]},Gn={si:Vs,iec:Ys,jedec:Ws};function Ks(e,t=1,n="jedec"){e=Math.abs(e);const{radix:r,unit:s}=Gn[n]||Gn.jedec;let i=0;for(;e>=r;)e/=r,++i;return`${e.toFixed(t)} ${s[i]}`}async function Js(e,t,n,r){let s=(Array.isArray(e)?e:[e]).map(o=>o.blob);const i=s.filter(o=>o.size>(r??1/0));if(i.length)throw new Error(`File(s) exceed the maximum allowed size of ${Ks(r||1/0)}: ${i.map(o=>`"${o.name}"`).join(", ")}`);return await Promise.all(await this.upload_files(t,s,n).then(async o=>{if(o.error)throw new Error(o.error);return o.files?o.files.map((a,c)=>new Ft({...e[c],path:a,url:`${t}${this.api_prefix}/file=${a}`})):[]}))}async function sa(e,t){return e.map(n=>new Ft({path:n.name,orig_name:n.name,blob:n,size:n.size,mime_type:n.type,is_stream:t}))}class Ft{path;url;orig_name;size;blob;is_stream;mime_type;alt_text;b64;meta={_type:"gradio.FileData"};constructor({path:t,url:n,orig_name:r,size:s,blob:i,is_stream:o,mime_type:a,alt_text:c,b64:h}){this.path=t,this.url=n,this.orig_name=r,this.size=s,this.blob=n?void 0:i,this.is_stream=o,this.mime_type=a,this.alt_text=c,this.b64=h}}class Zs{type;command;meta;fileData;constructor(t,n){this.type="command",this.command=t,this.meta=n}}typeof process<"u"&&process.versions&&process.versions.node;function Hn(e,t,n){for(;n.length>1;){const s=n.shift();if(typeof s=="string"||typeof s=="number")e=e[s];else throw new Error("Invalid key type")}const r=n.shift();if(typeof r=="string"||typeof r=="number")e[r]=t;else throw new Error("Invalid key type")}async function on(e,t=void 0,n=[],r=!1,s=void 0){if(Array.isArray(e)){let i=[];return await Promise.all(e.map(async(o,a)=>{let c=n.slice();c.push(String(a));const h=await on(e[a],r?s?.parameters[a]?.component||void 0:t,c,!1,s);i=i.concat(h)})),i}else{if(globalThis.Buffer&&e instanceof globalThis.Buffer||e instanceof Blob)return[{path:n,blob:new Blob([e]),type:t}];if(typeof e=="object"&&e!==null){let i=[];for(const o of Object.keys(e)){const a=[...n,o],c=e[o];i=i.concat(await on(c,void 0,a,!1,s))}return i}}return[]}function Xs(e,t){let n=t?.dependencies?.find(r=>r.id==e)?.queue;return n!=null?!n:!t.enable_queue}function Qs(e,t){return new Promise((n,r)=>{const s=new MessageChannel;s.port1.onmessage=(({data:i})=>{s.port1.close(),n(i)}),window.parent.postMessage(e,t,[s.port2])})}function Pt(e,t,n,r,s=!1){if(r==="input"&&!s)throw new Error("Invalid code path. Cannot skip state inputs for input.");if(r==="output"&&s)return e;let i=[],o=0;
vendor: 5,746 bytes, line 2
2const a=r==="input"?t.inputs:t.outputs;for(let c=0;c<a.length;c++){const h=a[c];if(n.find(l=>l.id===h)?.type==="state"){if(s)if(e.length===a.length){const l=e[o];i.push(l),o++}else i.push(null);else{o++;continue}continue}else{const l=e[o];i.push(l),o++}}return i}async function ei(e,t,n){const r=this;await ti(r,t);const s=await on(t,void 0,[],!0,n);return(await Promise.all(s.map(async({path:o,blob:a,type:c})=>{if(!a)return{path:o,type:c};const h=await r.upload_files(e,[a]),u=h.files&&h.files[0];return{path:o,file_url:u,type:c,name:typeof File<"u"&&a instanceof File?a?.name:void 0}}))).forEach(({path:o,file_url:a,type:c,name:h})=>{if(c==="Gallery")Hn(t,a,o);else if(a){const u=new Ft({path:a,orig_name:h});Hn(t,u,o)}}),t}async function ti(e,t){if(!(e.config?.root||e.config?.root_url))throw new Error(dr);await pr(e,t)}async function pr(e,t,n=[]){for(const r in t)t[r]instanceof Zs?await ni(e,t,r):typeof t[r]=="object"&&t[r]!==null&&await pr(e,t[r],[...n,r])}async function ni(e,t,n){let r=t[n];const s=e.config?.root||e.config?.root_url;if(!s)throw new Error(dr);try{let i,o;if(typeof process<"u"&&process.versions&&process.versions.node){const u=await ht(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(f=>f._),[],import.meta.url);o=(await ht(()=>import("./__vite-browser-external-D7Ct-6yo.js").then(f=>f._),[],import.meta.url)).resolve(process.cwd(),r.meta.path),i=await u.readFile(o)}else throw new Error(Ls);const a=new Blob([i],{type:"application/octet-stream"}),c=await e.upload_files(s,[a]),h=c.files&&c.files[0];if(h){const u=new Ft({path:h,orig_name:r.meta.name||""});t[n]=u}}catch(i){console.error(Is,i)}}async function ri(e,t,n){const r={"Content-Type":"application/json"};this.options.token&&(r.Authorization=`Bearer ${this.options.token}`);try{var s=await this.fetch(e,{method:"POST",body:JSON.stringify(t),headers:{...r,...n},credentials:this.options.credentials??"same-origin"})}catch{return[{error:ke},500]}let i,o;try{i=await s.json(),o=s.status}catch(a){i={error:`Could not parse server response: ${a}`},o=500}return[i,o]}async function si(e,t={}){let n=!1,r=!1;if(!this.config)throw new Error("Could not resolve app config");if(typeof e=="number")this.config.dependencies.find(o=>o.id==e);else{const o=e.replace(/^\//,"");this.config.dependencies.find(a=>a.id==this.api_map[o])}const s=this.submit(e,t,null,null,!0);let i;for await(const o of s){if(o.type==="data"&&(n=!0,i=o,r))return i;if(o.type==="status"){if(o.stage==="error")throw o;if(o.stage==="complete"&&(r=!0,n))return i}}return i}async function _t(e,t,n){let r=t==="subdomain"?`https://huggingface.co/api/spaces/by-subdomain/${e}`:`https://huggingface.co/api/spaces/${e}`,s,i;try{if(s=await fetch(r),i=s.status,i!==200)throw new Error;s=await s.json()}catch{n({status:"error",load_status:"error",message:Os,detail:"NOT_FOUND"});return}if(!s||i!==200)return;const{runtime:{stage:o},id:a}=s;switch(o){case"STOPPED":case"SLEEPING":n({status:"sleeping",load_status:"pending",message:"Space is asleep. Waking it up...",detail:o}),setTimeout(()=>{_t(e,t,n)},1e3);break;case"PAUSED":n({status:"paused",load_status:"error",message:"This space has been paused by the author. If you would like to try this demo, consider duplicating the space.",detail:o,discussions_enabled:await Vn(a)});break;case"RUNNING":case"RUNNING_BUILDING":n({status:"running",load_status:"complete",message:"Space is running.",detail:o});break;case"BUILDING":n({status:"building",load_status:"pending",message:"Space is building...",detail:o}),setTimeout(()=>{_t(e,t,n)},1e3);break;case"APP_STARTING":n({status:"starting",load_status:"pending",message:"Space is starting...",detail:o}),setTimeout(()=>{_t(e,t,n)},1e3);break;default:n({status:"space_error",load_status:"error",message:"This space is experiencing an issue.",detail:o,discussions_enabled:await Vn(a)});break}}const vr=async(e,t)=>{let n=0;const r=12,s=5e3;return new Promise(i=>{_t(e,yn.test(e)?"space_name":"subdomain",o=>{t(o),o.status==="running"||o.status==="error"||o.status==="paused"||o.status==="space_error"?i():(o.status==="sleeping"||o.status==="building")&&(n<r?(n++,setTimeout(()=>{vr(e,t).then(i)},s)):i())})})},ii=/^(?=[^]*\b[dD]iscussions{0,1}\b)(?=[^]*\b[dD]isabled\b)[^]*$/;async function Vn(e){try{const t=await fetch(`https://huggingface.co/api/spaces/${e}/discussions`,{method:"HEAD"}),n=t.headers.get("x-error-message");return!(!t.ok||n&&ii.test(n))}catch{return!1}}async function oi(e,t){const n={};t&&(n.Authorization=`Bearer ${t}`);try{const r=await fetch(`https://huggingface.co/api/spaces/${e}/${Es}`,{headers:n});if(r.status!==200)throw new Error("Space hardware could not be obtained.");const{hardware:s}=await r.json();return s.current}catch(r){throw new Error(r.message)}}async function ai(e,t,n){const r={};n&&(r.Authorization=`Bearer ${n}`);const s={seconds:t};try{const i=await fetch(`https://huggingface.co/api/spaces/${e}/${Ss}`,{method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(s)});if(i.status!==200)throw new Error("Could not set sleep timeout on duplicated Space. Please visit *ADD HF LINK TO SETTINGS* to set a timeout manually to reduce billing charges.");return await i.json()}catch(i){throw new Error(i.message)}}const Yn=["cpu-basic","cpu-upgrade","cpu-xl","t4-small","t4-medium","a10g-small","a10g-large","a10g-largex2","a10g-largex4","a100-large","zero-a10g","h100","h100x8"];async function li(e,t){const{token:n,private:r,hardware:s,timeout:i,auth:o}=t;if(s&&!Yn.includes(s))throw new Error(`Invalid hardware type provided. Valid types are: ${Yn.map(m=>`"${m}"`).join(",")}.`);const{http_protocol:a,host:c}=await bn(e,n);let h=null;if(o){const m=await hr(a,c,o,fetch,void 0,t.credentials);m&&(h=_r(m))}const u={Authorization:`Bearer ${n}
2`,"Content-Type":"application/json",...h?{Cookie:h.join("; ")}:{}},l=(await(await fetch("https://huggingface.co/api/whoami-v2",{headers:u})).json()).name,f=e.split("/")[1],d={repository:`${l}/${f}`};r&&(d.private=!0);let v;try{s||(v=await oi(e,n))}catch(m){throw Error(wn+m.message)}const p=s||v||"cpu-basic";d.hardware=p;try{const m=await fetch(`https://huggingface.co/api/spaces/${e}/duplicate`,{method:"POST",headers:u,body:JSON.stringify(d)});if(m.status===409)try{return await It.connect(`${l}/${f}`,t)}catch(Ce){throw console.error("Failed to connect Client instance:",Ce),Ce}else if(m.status!==200)throw new Error(m.statusText);const q=await m.json();return await ai(`${l}/${f}`,i||300,n),await It.connect(ci(q.url),t)}catch(m){throw new Error(m)}}function ci(e){const t=/https:\/\/huggingface.co\/spaces\/([^/]+\/[^/]+)/,n=e.match(t);if(n)return n[1]}const Wn="supports-zerogpu-headers";let Kn=!1;function ui(){return typeof window<"u"&&typeof document<"u"&&typeof window.addEventListener=="function"}function mr(e){return e.includes(".dev.")?`https://moon-${e.split(".")[1]}.dev.spaces.huggingface.tech`:e.endsWith(".hf.space")?"https://huggingface.co":null}function fi(){if(!ui()||Kn)return;window.addEventListener("message",t=>{t.data===Wn&&(window.supports_zerogpu_headers=!0)}),Kn=!0;const e=mr(window.location.hostname);e&&window.parent!==window&&window.parent.postMessage(Wn,e)}class di extends TransformStream{#e="";constructor(t={allowCR:!1}){super({transform:(n,r)=>{for(n=this.#e+n;;){const s=n.indexOf(`
3`),i=t.allowCR?n.indexOf("\r"):-1;if(i!==-1&&i!==n.length-1&&(s===-1||s-1>i)){r.enqueue(n.slice(0,i)),n=n.slice(i+1);continue}if(s===-1)break;const o=n[s-1]==="\r"?s-1:s;r.enqueue(n.slice(0,o)),n=n.slice(s+1)}this.#e=n},flush:n=>{if(this.#e==="")return;const r=t.allowCR&&this.#e.endsWith("\r")?this.#e.slice(0,-1):this.#e;n.enqueue(r)}})}}function hi(e){let t=new TextDecoderStream,n=new di({allowCR:!0});return e.pipeThrough(t).pipeThrough(n)}function _i(e){let n=/[:]\s*/.exec(e),r=n&&n.index;if(r)return[e.substring(0,r),e.substring(r+n[0].length)]}function Jn(e,t,n){e.get(t)||e.set(t,n)}async function*pi(e,t){if(!e.body)return;let n=hi(e.body),r,s=n.getReader(),i;for(;;){if(t&&t.aborted)return s.cancel();if(r=await s.read(),r.done)return;if(!r.value){i&&(yield i),i=void 0;continue}let[o,a]=_i(r.value)||[];o==="data"?(i||={},i[o]=i[o]?i[o]+`
4`+a:a):o==="event"?(i||={},i[o]=a):o==="id"?(i||={},i[o]=String(+a)===a?+a:a):o==="retry"&&(i||={},i[o]=+a||void 0)}}async function vi(e,t){let n=new Request(e,t);Jn(n.headers,"Accept","text/event-stream"),Jn(n.headers,"Content-Type","application/json");let r=await fetch(n);if(!r.ok)throw r;return pi(r,n.signal)}async function mi(){let{event_callbacks:e,unclosed_events:t,pending_stream_messages:n,stream_status:r,config:s,jwt:i}=this;const o=this;if(!s)throw new Error("Could not resolve app config");r.open=!0;let a=null,c=new URLSearchParams({session_hash:this.session_hash}).toString(),h=new URL(`${s.root}${this.api_prefix}/${cr}?${c}`);if(i&&h.searchParams.set("__sign",i),a=this.stream(h),!a){console.warn("Cannot connect to SSE endpoint: "+h.toString());return}a.onmessage=async function(u){let l=JSON.parse(u.data);if(l.msg==="close_stream"){En(r,o.abort_controller);return}const f=l.event_id;if(!f)await Promise.all(Object.keys(e).map(d=>e[d](l)));else if(e[f]&&s){l.msg==="process_completed"&&["sse","sse_v1","sse_v2","sse_v2.1","sse_v3"].includes(s.protocol)&&t.delete(f);let d=e[f];typeof window<"u"&&typeof document<"u"?setTimeout(d,0,l):d(l)}else n[f]||(n[f]=[]),n[f].push(l)},a.onerror=async function(u){console.error(u),await Promise.all(Object.keys(e).map(l=>e[l]({msg:"broken_connection",message:ke})))}}function En(e,t){e&&(e.open=!1,t?.abort())}function gi(e,t,n){!e[t]?(e[t]=[],n.data.forEach((s,i)=>{e[t][i]=s})):n.data.forEach((s,i)=>{let o=wi(e[t][i],s);e[t][i]=o,n.data[i]=o})}function wi(e,t){return t.forEach(([n,r,s])=>{e=yi(e,r,n,s)}),e}function yi(e,t,n,r){if(t.length===0){if(n==="replace")return r;if(n==="append")return e+r;throw new Error(`Unsupported action: ${n}`)}let s=e;for(let o=0;o<t.length-1;o++)s=s[t[o]];const i=t[t.length-1];switch(n){case"replace":s[i]=r;break;case"append":s[i]+=r;break;case"add":Array.isArray(s)?s.splice(Number(i),0,r):s[i]=r;break;
4case"delete":Array.isArray(s)?s.splice(Number(i),1):delete s[i];break;default:throw new Error(`Unknown action: ${n}`)}return e}function bi(e,t={}){const n={close:()=>{console.warn("Method not implemented.")},onerror:null,onmessage:null,onopen:null,readyState:0,url:e.toString(),withCredentials:!1,CONNECTING:0,OPEN:1,CLOSED:2,addEventListener:()=>{throw new Error("Method not implemented.")},dispatchEvent:()=>{throw new Error("Method not implemented.")},removeEventListener:()=>{throw new Error("Method not implemented.")}};return vi(e,t).then(async r=>{n.readyState=n.OPEN;try{for await(const s of r)n.onmessage&&n.onmessage(s);n.readyState=n.CLOSED}catch(s){n.onerror&&n.onerror(s),n.readyState=n.CLOSED}}).catch(r=>{console.error(r),n.onerror&&n.onerror(r),n.readyState=n.CLOSED}),n}function Ei(e,t={},n,r,s,i){try{let o=function(E){(s||us[E.type])&&u(E)},a=function(){for(Mn=!0;ut.length>0;)ut.shift()({value:void 0,done:!0})},c=function(E){ut.length>0?ut.shift()(E):Xt.push(E)},h=function(E){c(Si(E)),a()},u=function(E){c({value:E,done:!1})},l=function(){return Xt.length>0?Promise.resolve(Xt.shift()):Mn?Promise.resolve({value:void 0,done:!0}):new Promise(E=>ut.push(E))};const{token:f}=this.options,{fetch:d,app_reference:v,config:p,session_hash:m,api_info:q,api_map:Ce,stream_status:Ge,pending_stream_messages:He,pending_diff_streams:Ne,event_callbacks:Jt,unclosed_events:as,post_data:Zt,options:Ot,api_prefix:ge}=this,Pn=i||{"x-gradio-user":"api"},ls=this;if(!q)throw new Error("No API found");if(!p)throw new Error("Could not resolve app config");let{fn_index:b,endpoint_info:Ln,dependency:lt}=ki(q,e,Ce,p),cs=Bs(t,Ln),Ve,we=p.protocol??"ws";if(we==="ws")throw new Error("WebSocket protocol is not supported in this version");let Ye="",ra=()=>Ye;const k=typeof e=="number"?"/predict":e;let Rt,P=null,ye=!1,In={},ct=typeof window<"u"&&typeof document<"u"?new URLSearchParams(window.location.search).toString():"";const us=Ot?.events?.reduce((E,ae)=>(E[ae]=!0,E),{})||{};async function fs(){let E={},ae={};E={event_id:P},ae={event_id:P,session_hash:m,fn_index:b};try{if(!p)throw new Error("Could not resolve app config");"event_id"in ae&&await d(`${p.root}${ge}/${xs}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(ae)}),await d(`${p.root}${ge}/${As}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(E)})}catch{console.warn("The `/reset` endpoint could not be called. Subsequent endpoint results may be unreliable.")}}const ds=async E=>{await this._resolve_heartbeat(E)};async function Dn(E){if(!p)return;let ae=E.render_id;p.components=[...p.components.filter(I=>I.props.rendered_in!==ae),...E.components],p.dependencies=[...p.dependencies.filter(I=>I.rendered_in!==ae),...E.dependencies];const Ct=p.components.some(I=>I.type==="state"),O=p.dependencies.some(I=>I.targets.some(We=>We[1]==="unload"));p.connect_heartbeat=Ct||O,await ds(p),o({type:"render",data:E,endpoint:k,fn_index:b})}const hs=this.handle_blob(p.root,cs,Ln).then(async E=>{if(Rt={data:Pt(E,lt,p.components,"input",!0)||[],event_data:n,fn_index:b,trigger_id:r},Xs(b,p))o({type:"status",endpoint:k,stage:"pending",queue:!1,fn_index:b,time:new Date}),Zt(`${p.root}${ge}/run${k.startsWith("/")?k:`/${k}`}${ct?"?"+ct:""}`,{...Rt,session_hash:m},Pn).then(async([O,I])=>{const We=O.data;if(I==200)o({type:"data",endpoint:k,fn_index:b,data:Pt(We,lt,p.components,"output",Ot.with_null_state),time:new Date,event_data:n,trigger_id:r}),O.render_config&&await Dn(O.render_config),o({type:"status",endpoint:k,fn_index:b,stage:"complete",eta:O.average_duration,queue:!1,time:new Date});else{const le=O?.error===ke;o({type:"status",stage:"error",endpoint:k,fn_index:b,message:O.error,broken:le,queue:!1,time:new Date})}}).catch(O=>{o({type:"status",stage:"error",message:O.message,endpoint:k,fn_index:b,queue:!1,time:new Date})});else if(we=="sse"){o({type:"status",stage:"pending",queue:!0,endpoint:k,fn_index:b,time:new Date});var Ct=new URLSearchParams({fn_index:b.toString(),session_hash:m}).toString();let O=new URL(`${p.root}${ge}/${cr}?${ct?ct+"&":""}${Ct}`);if(this.jwt&&O.searchParams.set("__sign",this.jwt),Ve=this.stream(O),!Ve)return Promise.reject(new Error("Cannot connect to SSE endpoint: "+O.toString()));
4Ve.onmessage=async function(I){const We=JSON.parse(I.data),{type:le,status:be,data:R}=Bn(We,In[b]);if(le==="update"&&be&&!ye)o({type:"status",endpoint:k,fn_index:b,time:new Date,...be}),be.stage==="error"&&(Ve?.close(),a());else if(le==="data"){let[Ke,Pe]=await Zt(`${p.root}${ge}/queue/data`,{...Rt,session_hash:m,event_id:P});Pe!==200&&(o({type:"status",stage:"error",message:ke,queue:!0,endpoint:k,fn_index:b,time:new Date}),Ve?.close(),a())}else le==="complete"?ye=be:le==="log"?o({type:"log",title:R.title,log:R.log,level:R.level,endpoint:k,duration:R.duration,visible:R.visible,fn_index:b}):(le==="generating"||le==="streaming")&&o({type:"status",time:new Date,...be,stage:be?.stage,queue:!0,endpoint:k,fn_index:b});R&&(o({type:"data",time:new Date,data:Pt(R.data,lt,p.components,"output",Ot.with_null_state),endpoint:k,fn_index:b,event_data:n,trigger_id:r}),ye&&(o({type:"status",time:new Date,...ye,stage:be?.stage,queue:!0,endpoint:k,fn_index:b}),Ve?.close(),a()))}}else if(we=="sse_v1"||we=="sse_v2"||we=="sse_v2.1"||we=="sse_v3"){o({type:"status",stage:"pending",queue:!0,endpoint:k,fn_index:b,time:new Date});let O="";typeof window<"u"&&typeof document<"u"&&(O=window?.location?.hostname);const I=mr(O);return(typeof window<"u"&&typeof document<"u"&&window.parent!=window&&!!I&&window.supports_zerogpu_headers?Qs("zerogpu-headers",I):Promise.resolve(null)).then(R=>{const Ke={...Pn,...R||{}};return Zt(`${p.root}${ge}/${ws}?${ct}`,{...Rt,session_hash:m},Ke)}).then(async([R,Ke])=>{if(R.event_id&&(Ye=R.event_id),Ke===503)o({type:"status",stage:"error",message:ur,queue:!0,endpoint:k,fn_index:b,time:new Date,visible:!0}),a();else if(Ke===422)o({type:"status",stage:"error",message:R.detail,queue:!0,endpoint:k,fn_index:b,code:"validation_error",time:new Date,visible:!0}),a();else if(Ke!==200){const Pe=R?.error===ke;o({type:"status",stage:"error",broken:Pe,message:Pe?ke:R.detail||R.error,queue:!0,endpoint:k,fn_index:b,time:new Date,visible:!0}),a()}else{P=R.event_id,Ye=P;let Pe=async function(Qt){try{const{type:H,status:V,data:Y,original_msg:_s}=Bn(Qt,In[b]);if(H=="heartbeat")return;if(H==="update"&&V&&!ye)o({type:"status",endpoint:k,fn_index:b,time:new Date,original_msg:_s,...V});else if(H==="complete")ye=V;else if(H=="unexpected_error"||H=="broken_connection"){console.error("Unexpected error",V?.message);const ps=H==="broken_connection";o({type:"status",stage:"error",message:V?.message||"An Unexpected Error Occurred!",queue:!0,endpoint:k,broken:ps,session_not_found:V?.session_not_found,fn_index:b,time:new Date})}else if(H==="log"){o({type:"log",title:Y.title,log:Y.log,level:Y.level,endpoint:k,duration:Y.duration,visible:Y.visible,fn_index:b});return}else(H==="generating"||H==="streaming")&&(o({type:"status",time:new Date,...V,stage:V?.stage,queue:!0,endpoint:k,fn_index:b}),Y&&lt.connection!=="stream"&&["sse_v2","sse_v2.1","sse_v3"].includes(we)&&gi(Ne,P,Y));Y&&(o({type:"data",time:new Date,data:Pt(Y.data,lt,p.components,"output",Ot.with_null_state),endpoint:k,fn_index:b}),Y.render_config&&await Dn(Y.render_config),ye&&(o({type:"status",time:new Date,...ye,stage:V?.stage,queue:!0,endpoint:k,fn_index:b}),a())),(V?.stage==="complete"||V?.stage==="error")&&(Jt[P]&&delete Jt[P],P in Ne&&delete Ne[P],a())}catch(H){console.error("Unexpected client exception",H),o({type:"status",stage:"error",message:"An Unexpected Error Occurred!",queue:!0,endpoint:k,fn_index:b,time:new Date}),["sse_v2","sse_v2.1","sse_v3"].includes(we)&&(En(Ge,ls.abort_controller),Ge.open=!1,a())}};P in He&&(He[P].forEach(Qt=>Pe(Qt)),delete He[P]),Jt[P]=Pe,as.add(P),Ge.open||await this.open_stream()}})}});let Mn=!1;const Xt=[],ut=[],jn={[Symbol.asyncIterator]:()=>jn,next:l,throw:async E=>(h(E),l()),return:async()=>(a(),{value:void 0,done:!0}),cancel:fs,send_chunk:E=>{this.post_data(`${p.root}${ge}/stream/${Ye}`,{...E,session_hash:this.session_hash})},close_stream:()=>{this.post_data(`${p.root}${ge}/stream/${Ye}/close`,{}),a()},event_id:()=>Ye,wait_for_id:async()=>(await hs,P)};return jn}catch(o){throw console.error("Submit function encountered an error:",o),o}}function Si(e){return{then:(t,n)=>n(e)}}function ki(e,t,n,r){let s,i,o;if(typeof t=="number")s=t,i=e.unnamed_endpoints[s],o=r.dependencies.find(a=>a.id==t);else{const a=t.replace(/^\//,"");s=n[a],i=e.named_endpoints[t.trim()],o=r.dependencies.find(c=>c.id==n[a])}if(typeof s!="number")throw new Error("There is no endpoint matching that name of fn_index matching that number.");return{fn_index:s,endpoint_info:i,dependency:o}}class It{app_reference;options;deep_link=null;config;api_prefix="";api_info;api_map={};session_hash=Math.random().toString(36).substring(2);jwt=!1;last_status={};cookies=null;stream_status={open:!1};closed=!1;pending_stream_messages={};pending_diff_streams={};event_callbacks={};unclosed_events=new Set;heartbeat_event=null;abort_controller=null;stream_instance=null;current_payload;get_url_config(t=null){if(!this.config)throw new Error(Se);t===null&&(t=window.location.href);const n=o=>o.replace(/^\/+|\/+$/g,"");let r=n(new URL(this.config.root).pathname),s=n(new URL(t).pathname),i;return s.startsWith(r)?i=n(s.substring(r.length)):i="",this.get_page_config(i)}get_page_config(t){if(!this.config)throw new Error(Se);let n=this.config;return t in n.page||(t=""),{...n,current_page:t,layout:n.page[t].layout,components:n.components.filter(r=>n.page[t].components.includes(r.id)),dependencies:this.config.dependencies.filter(r=>n.page[t].dependencies.includes(r.id))}}
4fetch(t,n){const r=new Headers(n?.headers||{});return this&&this.cookies&&r.append("Cookie",this.cookies),this&&this.options.headers&&new Headers(this.options.headers).forEach((i,o)=>{r.append(o,i)}),fetch(t,{...n,headers:r})}stream(t){const n=new Headers;return this&&this.cookies&&n.append("Cookie",this.cookies),this&&this.options.headers&&new Headers(this.options.headers).forEach((s,i)=>{n.append(i,s)}),this&&this.options.token&&n.append("Authorization",`Bearer ${this.options.token}`),this.abort_controller=new AbortController,this.stream_instance=bi(t.toString(),{credentials:this.options.credentials??"same-origin",headers:n,signal:this.abort_controller.signal}),this.stream_instance}view_api;upload_files;upload;handle_blob;post_data;submit;predict;open_stream;resolve_config;resolve_cookies;constructor(t,n={events:["data"]}){this.app_reference=t,this.deep_link=n.query_params?.deep_link||null,n.events||(n.events=["data"]),this.options=n,this.current_payload={},n.cookies&&(this.cookies=n.cookies),this.view_api=Gs.bind(this),this.upload_files=Hs.bind(this),this.handle_blob=ei.bind(this),this.post_data=ri.bind(this),this.submit=Ei.bind(this),this.predict=si.bind(this),this.open_stream=mi.bind(this),this.resolve_config=Ms.bind(this),this.resolve_cookies=js.bind(this),this.upload=Js.bind(this),this.fetch=this.fetch.bind(this),this.handle_space_success=this.handle_space_success.bind(this),this.stream=this.stream.bind(this)}
4async init(){fi(),this.options.auth&&await this.resolve_cookies(),await this._resolve_config().then(({config:t})=>this._resolve_heartbeat(t)),this.api_info=await this.view_api(),this.api_map=Ds(this.config?.dependencies||[])}async _resolve_heartbeat(t){if(t&&(this.config=t,this.api_prefix=t.api_prefix||"",this.config&&this.config.connect_heartbeat&&this.config.space_id&&this.options.token&&(this.jwt=await Fn(this.config.space_id,this.options.token,this.cookies))),t.space_id&&this.options.token&&(this.jwt=await Fn(t.space_id,this.options.token)),this.config&&this.config.connect_heartbeat){const n=new URL(`${this.config.root}${this.api_prefix}/${ks}/${this.session_hash}`);this.jwt&&n.searchParams.set("__sign",this.jwt),this.heartbeat_event||(this.heartbeat_event=this.stream(n))}}static async connect(t,n={events:["data"]}){const r=new this(t,n);return n.session_hash&&(r.session_hash=n.session_hash),await r.init(),r}async reconnect(){const t=new URL(`${this.config.root}${this.api_prefix}/${$s}`);let n;try{const r=await this.fetch(t);if(!r.ok)throw new Error;n=(await r.json()).app_id}catch{return"broken"}return n!==this.config.app_id?"changed":"connected"}close(){this.closed=!0,En(this.stream_status,this.abort_controller)}set_current_payload(t){this.current_payload=t}static async duplicate(t,n={events:["data"]}){return li(t,n)}async _resolve_config(){const{http_protocol:t,host:n,space_id:r}=await bn(this.app_reference,this.options.token),{status_callback:s}=this.options;r&&s&&await vr(r,s);let i;try{let o=`${t}//${n}`;if(i=await this.resolve_config(o),!i)throw new Error(Se);return this.config_success(i)}catch(o){if(r&&s)_t(r,yn.test(r)?"space_name":"subdomain",this.handle_space_success);else throw s&&s({status:"error",message:"Could not load this space.",load_status:"error",detail:"NOT_FOUND"}),Error(o)}}async config_success(t){if(this.config=t,this.api_prefix=t.api_prefix||"",this.config.auth_required)return this.prepare_return_obj();try{this.api_info=await this.view_api()}catch(n){console.error(Rs+n.message)}return this.prepare_return_obj()}async handle_space_success(t){if(!this)throw new Error(Se);const{status_callback:n}=this.options;if(n&&n(t),t.status==="running")try{if(this.config=await this._resolve_config(),this.api_prefix=this?.config?.api_prefix||"",!this.config)throw new Error(Se);return await this.config_success(this.config)}catch(r){throw n&&n({status:"error",message:"Could not load this space.",load_status:"error",detail:"NOT_FOUND"}),r}}async component_server(t,n,r){if(!this.config)throw new Error(Se);const s={},{token:i}=this.options,{session_hash:o}=this;i&&(s.Authorization=`Bearer ${this.options.token}`);let a,c=this.config.components.find(u=>u.id===t);c?.props?.root_url?a=c.props.root_url:a=this.config.root;let h;if(typeof r=="object"&&r!==null&&"binary"in r){const u=r;h=new FormData;for(const l in u.data)l!=="binary"&&h.append(l,u.data[l]);h.set("component_id",t.toString()),h.set("fn_name",n),h.set("session_hash",o)}else h=JSON.stringify({data:r,component_id:t,fn_name:n,session_hash:o}),s["Content-Type"]="application/json";i&&(s.Authorization=`Bearer ${i}`);try{const u=await this.fetch(`${a}${this.api_prefix}/${Ts}/`,{method:"POST",body:h,headers:s,credentials:this.options.credentials??"same-origin"});if(!u.ok)throw new Error("Could not connect to component server: "+u.statusText);return await u.json()}catch(u){console.warn(u)}}set_cookies(t){this.cookies=_r(t).join("; ")}prepare_return_obj(){return{config:this.config,predict:this.predict,submit:this.submit,view_api:this.view_api,component_server:this.component_server}}}const Ti="production",_=!Ti.toLowerCase().startsWith("prod");var gr=Array.isArray,Ai=Array.prototype.indexOf,xi=Array.from,$e=Object.defineProperty,Qe=Object.getOwnPropertyDescriptor,$i=Object.getOwnPropertyDescriptors,Oi=Object.prototype,Ri=Array.prototype,wr=Object.getPrototypeOf,Zn=Object.isExtensible;function ia(e){return typeof e=="function"}const oa=()=>{};function aa(e){return typeof e?.then=="function"}function la(e){return e()}function Ci(e){for(var t=0;t<e.length;t++)e[t]()}function yr(){var e,t,n=new Promise((r,s)=>{e=r,t=s});return{promise:n,resolve:e,reject:t}}function ca(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);const n=[];for(const r of e)if(n.push(r),n.length===t)break;return n}const $=2,gt=4,et=8,Dt=1<<24,pe=16,ie=32,Be=64,zt=128,B=512,N=1024,L=2048,oe=4096,ne=8192,ue=16384,Et=32768,wt=65536,Mt=1<<17,br=1<<18,it=1<<19,Er=1<<20,ua=1<<25,Oe=32768,an=1<<21,Bt=1<<22,Te=1<<23,Ae=Symbol("$state"),fa=Symbol("legacy props"),da=Symbol(""),Sr=Symbol("proxy path"),De=new class extends 
4Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},_a=1,Gt=3,St=8;function Ht(e){if(_){const t=new Error(`lifecycle_outside_component
5\`${e}(...)\` can only be used during component initialisation
6https://svelte.dev/e/lifecycle_outside_component`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Ni(){if(_){const e=new Error("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/async_derived_orphan")}function pa(){if(_){const e=new Error("bind_invalid_checkbox_value\nUsing `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/bind_invalid_checkbox_value")}function Pi(){if(_){const e=new Error(`derived_references_self
7A derived value cannot reference itself recursively
8https://svelte.dev/e/derived_references_self`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/derived_references_self")}function Li(e){if(_){const t=new Error(`effect_in_teardown
9\`${e}\` cannot be used inside an effect cleanup function
10https://svelte.dev/e/effect_in_teardown`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function Ii(){if(_){const e=new Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Di(e){if(_){const t=new Error(`effect_orphan
11\`${e}\` can only be used inside an effect (e.g. during component initialisation)
12https://svelte.dev/e/effect_orphan`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_orphan")}function Mi(){if(_){const e=new Error(`effect_update_depth_exceeded
13Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
14https://svelte.dev/e/effect_update_depth_exceeded`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function va(){if(_){const e=new Error("invalid_snippet\nCould not `{@render}` snippet due to the expression being `null` or `undefined`. Consider using optional chaining `{@render snippet?.()}`\nhttps://svelte.dev/e/invalid_snippet");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/invalid_snippet")}function ma(e){if(_){const t=new Error(`props_invalid_value
15Cannot do \`bind:${e}={undefined}\` when \`${e}\` has a fallback value
16https://svelte.dev/e/props_invalid_value`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/props_invalid_value")}function ga(e){if(_){const t=new Error(`props_rest_readonly
17Rest element properties of \`$props()\` such as \`${e}\` are readonly
18https://svelte.dev/e/props_rest_readonly`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/props_rest_readonly")}function ji(e){if(_){const t=new Error(`rune_outside_svelte
19The \`${e}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
20https://svelte.dev/e/rune_outside_svelte`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function qi(){if(_){const e=new Error("set_context_after_init\n`setContext` must be called when a component first initializes, not in a subsequent effect or after an `await` expression\nhttps://svelte.dev/e/set_context_after_init");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/set_context_after_init")}function Ui(){if(_){const e=new Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Fi(){if(_){const e=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function zi(){if(_){const e=new Error("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Bi(){if(_){const e=new Error("svelte_boundary_reset_onerror\nA `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const wa=1,ya=2,ba=4,Ea=8,Sa=16,ka=1,Ta=2,Aa=4,xa=8,$a=16,Oa=1,Ra=2,Ca=4,kr=1,Gi=2,Hi="[",Tr="[!",Ar="]",Vt={},C=Symbol(),Vi=Symbol("filename"),Na="http://www.w3.org/1999/xhtml",Pa="http://www.w3.org/2000/svg",La="@attach";var ve="font-weight: bold",me="font-weight: normal";
20function Ia(e,t,n){_?console.warn(`%c[svelte] hydration_attribute_changed
21%cThe \`${e}\` attribute on \`${t}\` changed its value between server and client renders. The client value, \`${n}\`, will be ignored in favour of the server value
22https://svelte.dev/e/hydration_attribute_changed`,ve,me):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function Da(e){_?console.warn(`%c[svelte] hydration_html_changed
23%c${e?`The value of an \`{@html ...}\` block ${e} changed between server and client renders. The client value will be ignored in favour of the server value`:"The value of an `{@html ...}` block changed between server and client renders. The client value will be ignored in favour of the server value"}
24https://svelte.dev/e/hydration_html_changed`,ve,me):console.warn("https://svelte.dev/e/hydration_html_changed")}function Yt(e){_?console.warn(`%c[svelte] hydration_mismatch
25%cHydration failed because the initial UI does not match what was rendered on the server
26https://svelte.dev/e/hydration_mismatch`,ve,me):console.warn("https://svelte.dev/e/hydration_mismatch")}function Yi(){_?console.warn(`%c[svelte] lifecycle_double_unmount
27%cTried to unmount a component that was not mounted
28https://svelte.dev/e/lifecycle_double_unmount`,ve,me):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function Ma(){_?console.warn("%c[svelte] select_multiple_invalid_value\n%cThe `value` property of a `<select multiple>` element should be an array, but it received a non-array value. The selection will be kept as is.\nhttps://svelte.dev/e/select_multiple_invalid_value",ve,me):console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function tn(e){_?console.warn(`%c[svelte] state_proxy_equality_mismatch
29%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${e}\` will produce unexpected results
30https://svelte.dev/e/state_proxy_equality_mismatch`,ve,me):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function Wi(){_?console.warn(`%c[svelte] state_proxy_unmount
31%cTried to unmount a state proxy, rather than a component
32https://svelte.dev/e/state_proxy_unmount`,ve,me):console.warn("https://svelte.dev/e/state_proxy_unmount")}function Ki(){_?console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `<svelte:boundary>` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",ve,me):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function ja(e){_?console.warn(`%c[svelte] transition_slide_display
33%cThe \`slide\` transition does not work correctly for elements with \`display: ${e}\`
34https://svelte.dev/e/transition_slide_display`,ve,me):console.warn("https://svelte.dev/e/transition_slide_display")}let A=!1;function qa(e){A=e}let y;function de(e){if(e===null)throw Yt(),Vt;return y=e}function Sn(){return de(Re(y))}function Ua(e){if(A){if(Re(y)!==null)throw Yt(),Vt;y=e}}function Ji(e=1){if(A){for(var t=e,n=y;t--;)n=Re(n);y=n}}function Zi(e=!0){for(var t=0,n=y;;){if(n.nodeType===St){var r=n.data;if(r===Ar){if(t===0)return n;t-=1}else(r===Hi||r===Tr)&&(t+=1)}var s=Re(n);e&&n.remove(),n=s}}function Fa(e){if(!e||e.nodeType!==St)throw Yt(),Vt;return e.data}function xr(e){return e===this.v}function Xi(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function $r(e){return!Xi(e,this.v)}let re=!1,kt=!1,Qi=!1;function za(){re=!0}function Ba(){kt=!0}function X(e,t){return e.label=t,Or(e.v,t),e}function Or(e,t){return e?.[Sr]?.(t),e}function eo(e){const t=new Error,n=to();return n.length===0?null:(n.unshift(`
35`),$e(t,"stack",{value:n.join(`
36`)}),$e(t,"name",{value:e}),t)}function to(){const e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;const t=new Error().stack;if(Error.stackTraceLimit=e,!t)return[];const n=t.split(`
37`),r=[];for(let s=0;s<n.length;s++){const i=n[s],o=i.replaceAll("\\","/");if(i.trim()!=="Error"){if(i.includes("validate_each_keys"))return[];o.includes("svelte/src/internal")||o.includes("node_modules/.vite")||r.push(i)}}return r}let S=null;function tt(e){S=e}let nt=null;function jt(e){nt=e}let Tt=null;function Xn(e){Tt=e}function Ga(e){return Rr("getContext").get(e)}function Ha(e,t){const n=Rr("setContext");if(re){var r=g.f,s=!w&&(r&ie)!==0&&!S.i;s||qi()}return n.set(e,t),t}function no(e,t=!1,n){S={p:S,i:!1,c:null,e:null,s:e,x:null,l:kt&&!t?{s:null,u:null,$:[]}:null},_&&(S.function=n,Tt=n)}function ro(e){var t=S,n=t.e;if(n!==null){t.e=null;for(var r of n)Vr(r)}return e!==void 0&&(t.x=e),t.i=!0,S=t.p,_&&(Tt=S?.function??null),e??{}}function At(){return!kt||S!==null&&S.l===null}function Rr(e){return S===null&&Ht(e),S.c??=new Map(so(S)||void 0)}function so(e){let t=e.p;for(;t!==null;){const n=t.c;if(n!==null)return n;t=t.p}return null}let Me=[];function Cr(){var e=Me;Me=[],Ci(e)}function xt(e){if(Me.length===0&&!pt){var t=Me;queueMicrotask(()=>{t===Me&&Cr()})}Me.push(e)}function io(){for(;Me.length>0;)Cr()}const ln=new WeakMap;function Nr(e){var t=g;if(t===null)return w.f|=Te,e;if(_&&e instanceof Error&&!ln.has(e)&&ln.set(e,oo(e,t)),(t.f&Et)===0){if((t.f&zt)===0)throw _&&!t.parent&&e instanceof Error&&Pr(e),e;t.b.error(e)}else Fe(e,t)}function Fe(e,t){for(;t!==null;){if((t.f&zt)!==0)try{t.b.error(e);return}catch(n){e=n}t=t.parent}throw _&&e instanceof Error&&Pr(e),e}function oo(e,t){const n=Qe(e,"message");if(!(n&&!n.configurable)){for(var r=On?"  ":"	",s=`
38${r}in ${t.fn?.name||"<unknown>"}`,i=t.ctx;i!==null;)s+=`
39${r}in ${i.function?.[Vi].split("/").pop()}`,i=i.p;return{message:e.message+`
40${s}
41`,stack:e.stack?.split(`
42`).filter(o=>!o.includes("svelte/src/internal")).join(`
43`)}}}function Pr(e){const t=ln.get(e);t&&($e(e,"message",{value:t.message}),$e(e,"stack",{value:t.stack}))}const ao=-7169;
43function x(e,t){e.f=e.f&ao|t}function kn(e){(e.f&B)!==0||e.deps===null?x(e,N):x(e,oe)}function Lr(e){if(e!==null)for(const t of e)(t.f&$)===0||(t.f&Oe)===0||(t.f^=Oe,Lr(t.deps))}function Ir(e,t,n){(e.f&L)!==0?t.add(e):(e.f&oe)!==0&&n.add(e),Lr(e.deps),x(e,N)}const Je=new Set;let T=null,nn=null,D=null,z=[],Wt=null,cn=!1,pt=!1;class ee{committed=!1;current=new Map;previous=new Map;#e=new Set;#c=new Set;#r=0;#o=0;#s=null;#n=new Set;#t=new Set;skipped_effects=new Set;is_fork=!1;is_deferred(){return this.is_fork||this.#o>0}process(t){z=[],nn=null,this.apply();var n=[],r=[];for(const s of t)this.#i(s,n,r);this.is_fork||this.#l(),this.is_deferred()?(this.#a(r),this.#a(n)):(nn=this,T=null,Qn(r),Qn(n),nn=null,this.#s?.resolve()),D=null}#i(t,n,r){t.f^=N;for(var s=t.first,i=null;s!==null;){var o=s.f,a=(o&(ie|Be))!==0,c=a&&(o&N)!==0,h=c||(o&ne)!==0||this.skipped_effects.has(s);if(re&&i===null&&(o&zt)!==0&&s.b?.is_pending&&(i=s),!h&&s.fn!==null){a?s.f^=N:i!==null&&(o&(gt|et|Dt))!==0?i.b.defer_effect(s):(o&gt)!==0?n.push(s):re&&(o&(et|Dt))!==0?r.push(s):ot(s)&&((o&pe)!==0&&this.#n.add(s),st(s));var u=s.first;if(u!==null){s=u;continue}}var l=s.parent;for(s=s.next;s===null&&l!==null;)l===i&&(i=null),s=l.next,l=l.parent}}#a(t){for(var n=0;n<t.length;n+=1)Ir(t[n],this.#n,this.#t)}capture(t,n){n!==C&&!this.previous.has(t)&&this.previous.set(t,n),(t.f&Te)===0&&(this.current.set(t,t.v),D?.set(t,t.v))}activate(){T=this,this.apply()}deactivate(){T===this&&(T=null,D=null)}flush(){if(this.activate(),z.length>0){if(Dr(),T!==null&&T!==this)return}else this.#r===0&&this.process([]);this.deactivate()}discard(){for(const t of this.#c)t(this);this.#c.clear()}#l(){if(this.#o===0){for(const t of this.#e)t();this.#e.clear()}this.#r===0&&this.#u()}#u(){if(Je.size>1){this.previous.clear();var t=D,n=!0;for(const s of Je){if(s===this){n=!1;continue}const i=[];for(const[a,c]of this.current){if(s.current.has(a))if(n&&c!==s.current.get(a))s.current.set(a,c);else continue;i.push(a)}if(i.length===0)continue;const o=[...s.current.keys()].filter(a=>!this.current.has(a));if(o.length>0){var r=z;z=[];const a=new Set,c=new Map;for(const h of i)Mr(h,o,a,c);if(z.length>0){T=s,s.apply();for(const h of z)s.#i(h,[],[]);s.deactivate()}z=r}}T=null,D=t}this.committed=!0,Je.delete(this)}increment(t){this.#r+=1,t&&(this.#o+=1)}decrement(t){this.#r-=1,t&&(this.#o-=1),this.revive()}revive(){for(const t of this.#n)this.#t.delete(t),x(t,L),he(t);for(const t of this.#t)x(t,oe),he(t);this.flush()}oncommit(t){this.#e.add(t)}ondiscard(t){this.#c.add(t)}settled(){return(this.#s??=yr()).promise}static ensure(){if(T===null){const t=T=new ee;Je.add(T),pt||ee.enqueue(()=>{T===t&&t.flush()})}return T}static enqueue(t){xt(t)}apply(){if(!(!re||!this.is_fork&&Je.size===1)){D=new Map(this.current);for(const t of Je)if(t!==this)for(const[n,r]of t.previous)D.has(n)||D.set(n,r)}}}function lo(e){var t=pt;pt=!0;try{for(var n;;){if(io(),z.length===0&&(T?.flush(),z.length===0))return Wt=null,n;Dr()}}finally{pt=t}}function Dr(){var e=qe;cn=!0;var t=_?new Set:null;try{var n=0;for(qt(!0);z.length>0;){var r=ee.ensure();if(n++>1e3){if(_){var s=new Map;for(const o of r.current.keys())for(const[a,c]of o.updated??[]){var i=s.get(a);i||(i={error:c.error,count:0},s.set(a,i)),i.count+=c.count}for(const o of s.values())o.error&&console.error(o.error)}co()}if(r.process(z),xe.clear(),_)for(const o of r.current.keys())t.add(o)}}finally{if(cn=!1,qt(e),Wt=null,_)for(const o of t)o.updated=null}}function co(){try{Mi()}catch(e){_&&$e(e,"stack",{value:""}),Fe(e,Wt)}}let Q=null;function Qn(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&(ue|ne))===0&&ot(r)&&(Q=new Set,st(r),r.deps===null&&r.first===null&&r.nodes===null&&(r.teardown===null&&r.ac===null?Kr(r):r.fn=null),Q?.size>0)){xe.clear();for(const s of Q){if((s.f&(ue|ne))!==0)continue;const i=[s];let o=s.parent;for(;o!==null;)Q.has(o)&&(Q.delete(o),i.push(o)),o=o.parent;for(let a=i.length-1;a>=0;a--){const c=i[a];(c.f&(ue|ne))===0&&st(c)}}Q.clear()}}Q=null}}function Mr(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const s of e.reactions){const i=s.f;(i&$)!==0?Mr(s,t,n,r):(i&(Bt|pe))!==0&&(i&L)===0&&jr(s,t,r)&&(x(s,L),he(s))}}function jr(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const s of e.deps){if(t.includes(s))return!0;
43if((s.f&$)!==0&&jr(s,t,n))return n.set(s,!0),!0}return n.set(e,!1),!1}function he(e){for(var t=Wt=e;t.parent!==null;){t=t.parent;var n=t.f;if(cn&&t===g&&(n&pe)!==0&&(n&br)===0)return;if((n&(Be|ie))!==0){if((n&N)===0)return;t.f^=N}}z.push(t)}function uo(e){let t=0,n=$t(0),r;return _&&X(n,"createSubscriber version"),()=>{Rn()&&(te(n),Nn(()=>(t===0&&(r=at(()=>e(()=>vt(n)))),t+=1,()=>{xt(()=>{t-=1,t===0&&(r?.(),r=void 0,vt(n))})})))}}var fo=wt|it|zt;function ho(e,t,n){new _o(e,t,n)}class _o{parent;is_pending=!1;#e;#c=A?y:null;#r;#o;#s;#n=null;#t=null;#i=null;#a=null;#l=null;#u=0;#f=0;#h=!1;#_=new Set;#p=new Set;#d=null;#y=uo(()=>(this.#d=$t(this.#u),_&&X(this.#d,"$effect.pending()"),()=>{this.#d=null}));constructor(t,n,r){this.#e=t,this.#r=n,this.#o=r,this.parent=g.b,this.is_pending=!!this.#r.pending,this.#s=Po(()=>{if(g.b=this,A){const i=this.#c;Sn(),i.nodeType===St&&i.data===Tr?this.#E():(this.#b(),this.#f===0&&(this.is_pending=!1))}else{var s=this.#g();try{this.#n=Ie(()=>r(s))}catch(i){this.error(i)}this.#f>0?this.#m():this.is_pending=!1}return()=>{this.#l?.remove()}},fo),A&&(this.#e=y)}#b(){try{this.#n=Ie(()=>this.#o(this.#e))}catch(t){this.error(t)}}#E(){const t=this.#r.pending;t&&(this.#t=Ie(()=>t(this.#e)),ee.enqueue(()=>{var n=this.#g();this.#n=this.#v(()=>(ee.ensure(),Ie(()=>this.#o(n)))),this.#f>0?this.#m():(Lt(this.#t,()=>{this.#t=null}),this.is_pending=!1)}))}#g(){var t=this.#e;return this.is_pending&&(this.#l=_e(),this.#e.before(this.#l),t=this.#l),t}defer_effect(t){Ir(t,this.#_,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#r.pending}#v(t){var n=g,r=w,s=S;J(this.#s),j(this.#s),tt(this.#s.ctx);try{return t()}catch(i){return Nr(i),null}finally{J(n),j(r),tt(s)}}#m(){const t=this.#r.pending;this.#n!==null&&(this.#a=document.createDocumentFragment(),this.#a.append(this.#l),Do(this.#n,this.#a)),this.#t===null&&(this.#t=Ie(()=>t(this.#e)))}#w(t){if(!this.has_pending_snippet()){this.parent&&this.parent.#w(t);return}if(this.#f+=t,this.#f===0){this.is_pending=!1;for(const n of this.#_)x(n,L),he(n);for(const n of this.#p)x(n,oe),he(n);this.#_.clear(),this.#p.clear(),this.#t&&Lt(this.#t,()=>{this.#t=null}),this.#a&&(this.#e.before(this.#a),this.#a=null)}}update_pending_count(t){this.#w(t),this.#u+=t,this.#d&&bt(this.#d,this.#u)}get_effect_pending(){return this.#y(),te(this.#d)}error(t){var n=this.#r.onerror;let r=this.#r.failed;if(this.#h||!n&&!r)throw t;this.#n&&(se(this.#n),this.#n=null),this.#t&&(se(this.#t),this.#t=null),this.#i&&(se(this.#i),this.#i=null),A&&(de(this.#c),Ji(),de(Zi()));var s=!1,i=!1;const o=()=>{if(s){Ki();return}s=!0,i&&Bi(),ee.ensure(),this.#u=0,this.#i!==null&&Lt(this.#i,()=>{this.#i=null}),this.is_pending=this.has_pending_snippet(),this.#n=this.#v(()=>(this.#h=!1,Ie(()=>this.#o(this.#e)))),this.#f>0?this.#m():this.is_pending=!1};var a=w;try{j(null),i=!0,n?.(t,o),i=!1}catch(c){Fe(c,this.#s&&this.#s.parent)}finally{j(a)}r&&xt(()=>{this.#i=this.#v(()=>{ee.ensure(),this.#h=!0;try{return Ie(()=>{r(this.#e,()=>t,()=>o)})}catch(c){return Fe(c,this.#s.parent),null}finally{this.#h=!1}})})}}function po(){return g.b}function Tn(e,t,n,r){const s=At()?An:go;if(n.length===0&&e.length===0){r(t.map(s));return}var i=T,o=g,a=qr();function c(){Promise.all(n.map(h=>mo(h))).then(h=>{a();try{r([...t.map(s),...h])}catch(u){(o.f&ue)===0&&Fe(u,o)}i?.deactivate(),yt()}).catch(h=>{Fe(h,o)})}e.length>0?Promise.all(e).then(()=>{a();try{return c()}finally{i?.deactivate(),yt()}}):c()}function Va(e,t){Tn(e,[],[],t)}function qr(){var e=g,t=w,n=S,r=T;if(_)var s=nt;return function(o=!0){J(e),j(t),tt(n),o&&r?.activate(),_&&jt(s)}}function yt(){J(null),j(null),tt(null),_&&jt(null)}function Ya(e){const t=qr();var n=po(),r=T,s=n.is_rendered();n.update_pending_count(1),r.increment(s);var i=g,o=null;const a=u=>{o={error:u},rr(i)||Fe(u,i)};var c=Promise.resolve(e[0]()).catch(a),h=[c];for(const u of e.slice(1))c=c.then(()=>{if(o)throw o.error;if(rr(i))throw De;return t(),u()}).catch(a).finally(()=>{yt(),T?.deactivate()}),h.push(c);return c.then(()=>Promise.resolve()).finally(()=>
43{n.update_pending_count(-1),r.decrement(s)}),h}const vo=new Set;function An(e){var t=$|L,n=w!==null&&(w.f&$)!==0?w:null;return g!==null&&(g.f|=it),{ctx:S,deps:null,effects:null,equals:xr,f:t,fn:e,reactions:null,rv:0,v:C,wv:0,parent:n??g,ac:null}}function mo(e,t,n){let r=g;r===null&&Ni();var s=r.b,i=void 0,o=$t(C);_&&(o.label=t);var a=!w,c=new Map;return No(()=>{var h=yr();i=h.promise;try{Promise.resolve(e()).then(h.resolve,h.reject).then(()=>{u===T&&u.committed&&u.deactivate(),yt()})}catch(d){h.reject(d),yt()}var u=T;if(a){var l=s.is_rendered();s.update_pending_count(1),u.increment(l),c.get(u)?.reject(De),c.delete(u),c.set(u,h)}const f=(d,v=void 0)=>{if(u.activate(),v)v!==De&&(o.f|=Te,bt(o,v));else{(o.f&Te)!==0&&(o.f^=Te),bt(o,d);for(const[p,m]of c){if(c.delete(p),p===u)break;m.reject(De)}}a&&(s.update_pending_count(-1),u.decrement(l))};h.promise.then(f,d=>f(null,d||"unknown"))}),Cn(()=>{for(const h of c.values())h.reject(De)}),_&&(o.f|=Bt),new Promise(h=>{function u(l){function f(){l===i?h(o):u(i)}l.then(f,f)}u(i)})}function Wa(e){const t=An(e);return re||Xr(t),t}function go(e){const t=An(e);return t.equals=$r,t}function un(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)se(t[n])}}let rn=[];function wo(e){for(var t=e.parent;t!==null;){if((t.f&$)===0)return(t.f&ue)===0?t:null;t=t.parent}return null}function xn(e){var t,n=g;if(J(wo(e)),_){let r=rt;er(new Set);try{rn.includes(e)&&Pi(),rn.push(e),e.f&=~Oe,un(e),t=fn(e)}finally{J(n),er(r),rn.pop()}}else try{e.f&=~Oe,un(e),t=fn(e)}finally{J(n)}return t}function Ur(e){var t=xn(e);if(!e.equals(t)&&(e.wv=es(),(!T?.is_fork||e.deps===null)&&(e.v=t,e.deps===null))){x(e,N);return}ze||(D!==null?(Rn()||T?.is_fork)&&D.set(e,t):kn(e))}let rt=new Set;const xe=new Map;function er(e){rt=e}let $n=!1;function yo(){$n=!0}function $t(e,t){var n={f:0,v:e,reactions:null,equals:xr,rv:0,wv:0};return n}function Ee(e,t){const n=$t(e);return Xr(n),n}function Ka(e,t=!1,n=!0){const r=$t(e);return t||(r.equals=$r),kt&&n&&S!==null&&S.l!==null&&(S.l.s??=[]).push(r),r}function Ja(e,t){return ce(e,at(()=>te(e))),t}function ce(e,t,n=!1){w!==null&&(!K||(w.f&Mt)!==0)&&At()&&(w.f&($|pe|Bt|Mt))!==0&&!fe?.includes(e)&&zi();let r=n?ft(t):t;return _&&Or(r,e.label),bt(e,r)}function bt(e,t){if(!e.equals(t)){var n=e.v;ze?xe.set(e,t):xe.set(e,n),e.v=t;var r=ee.ensure();if(r.capture(e,n),_){if(g!==null){e.updated??=new Map;const s=(e.updated.get("")?.count??0)+1;if(e.updated.set("",{error:null,count:s}),s>5){const i=eo("updated at");if(i!==null){let o=e.updated.get(i.stack);o||(o={error:i,count:0},e.updated.set(i.stack,o)),o.count++}}}g!==null&&(e.set_during_effect=!0)}if((e.f&$)!==0){const s=e;(e.f&L)!==0&&xn(s),kn(s)}e.wv=es(),zr(e,L),At()&&g!==null&&(g.f&N)!==0&&(g.f&(ie|Be))===0&&(F===null?jo([e]):F.push(e)),!r.is_fork&&rt.size>0&&!$n&&Fr()}return t}function Fr(){$n=!1;var e=qe;qt(!0);const t=Array.from(rt);try{for(const n of t)(n.f&N)!==0&&x(n,oe),ot(n)&&st(n)}finally{qt(e)}rt.clear()}function Za(e,t=1){var n=te(e),r=t===1?n++:n--;return ce(e,n),r}function vt(e){ce(e,e.v+1)}function zr(e,t){var n=e.reactions;if(n!==null)for(var r=At(),s=n.length,i=0;i<s;i++){var o=n[i],a=o.f;if(!(!r&&o===g)){if(_&&(a&Mt)!==0){rt.add(o);continue}var c=(a&L)===0;if(c&&x(o,t),(a&$)!==0){var h=o;D?.delete(h),(a&Oe)===0&&(a&B&&(o.f|=Oe),zr(h,oe))}else c&&((a&pe)!==0&&Q!==null&&Q.add(o),he(o))}}}const bo=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function ft(e){if(typeof e!="object"||e===null||Ae in e)return e;const t=wr(e);if(t!==Oi&&t!==Ri)return e;var n=new Map,r=gr(e),s=Ee(0),i=Ue,o=u=>{if(Ue===i)return u();var l=w,f=Ue;j(null),ir(i);var d=u();return j(l),ir(f),d};r&&(n.set("length",Ee(e.length)),_&&(e=So(e)));var a="";let c=!1;function h(u){if(!c){c=!0,a=u,X(s,`${a} version`);for(const[l,f]of n)X(f,Le(a,l));c=!1}}return new Proxy(e,{defineProperty(u,l,f){(!("value"in f)||f.configurable===!1||f.enumerable===!1||f.writable===!1)&&Ui();var d=n.get(l);return d===void 0?d=o(()=>{var v=Ee(f.value);return n.set(l,v),_&&typeof l=="string"&&X(v,Le(a,l)),v}):ce(d,f.value,!0),!0},deleteProperty(u,l){var f=n.get(l);if(f===void 0){if(l in u){const d=o(()=>Ee(C));n.set(l,d),vt(s),_&&X(d,Le(a,l))}}else ce(f,C),vt(s);return!0},get(u,l,f){if(l===Ae)return e;if(_&&l===Sr)return h;var d=n.get(l),v=l in u;if(d===void 0&&(!v||Qe(u,l)?.writable)&&(d=o(()=>{var m=ft(v?u[l]:C),q=Ee(m);return _&&X(q,Le(a,l)),q}),n.set(l,d)),d!==void 0){var p=te(d);return p===C?void 0:p}return Reflect.get(u,l,f)},getOwnPropertyDescriptor(u,l){var f=Reflect.getOwnPropertyDescriptor(u,l);if(f&&"value"in f){var d=n.get(l);d&&(f.value=te(d))}else if(f===void 0){var v=n.get(l),p=v?.v;if(v!==void 0&&p!==C)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return f},has(u,l){if(l===Ae)return!0;var f=n.get(l),d=f!==void 0&&f.v!==C||Reflect.has(u,l);if(f!==void 0||g!==null&&(!d||Qe(u,l)?.writable)){f===void 0&&(f=o(()=>{var p=d?ft(u[l]):C,m=Ee(p);return _&&X(m,Le(a,l)),m}),n.set(l,f));var v=te(f);if(v===C)return!1}return d},set(u,l,f,d){var v=n.get(l),p=l in u;if(r&&l==="length")for(var m=f;m<v.v;m+=1){var q=n.get(m+"");q!==void 0?ce(q,C):m in u&&(q=o(()=>Ee(C)),n.set(m+"",q),_&&X(q,Le(a,m)))}if(v===void 0)(!p||Qe(u,l)?.writable)&&(v=o(()=>Ee(void 0)),_&&X(v,Le(a,l)),ce(v,ft(f)),n.set(l,v));else{p=v.v!==C;var Ce=o(()=>ft(f));ce(v,Ce)}var Ge=Reflect.getOwnPropertyDescriptor(u,l);if(Ge?.set&&Ge.set.call(d,f),!p){if(r&&typeof l=="string"){var He=n.get("length"),Ne=Number(l);Number.isInteger(Ne)&&Ne>=He.v&&ce(He,Ne+1)}vt(s)}return!0},ownKeys(u){te(s);var l=Reflect.ownKeys(u).filter(v=>{var p=n.get(v);return p===void 0||p.v!==C});for(var[f,d]of n)d.v!==C&&!(f in u)&&l.push(f);return l},setPrototypeOf(){Fi()}})}function Le(e,t){return typeof t=="symbol"?`${e}[Symbol(${t.description??""})]`:bo.test(t)?`${e}.${t}`:/^\d+$/.test(t)?`${e}[${t}]`:`${e}['${t}']`}function mt(e){try{if(e!==null&&typeof e=="object"&&Ae in e)return e[Ae]}catch{}return e}function Xa(e,t){return Object.is(mt(e),mt(t))}const Eo=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function So(e){return new Proxy(e,{get(t,n,r){var s=Reflect.get(t,n,r);return Eo.has(n)?function(...i){yo();var o=s.apply(this,i);return Fr(),o}:s}})}function ko(){const e=Array.prototype,t=Array.__svelte_cleanup;t&&t();const{indexOf:n,lastIndexOf:r,includes:s}=e;e.indexOf=function(i,o){const a=n.call(this,i,o);if(a===-1){for(let c=o??0;c<this.length;c+=1)if(mt(this[c])===i){tn("array.indexOf(...)");break}}return a},e.lastIndexOf=function(i,o){const a=r.call(this,i,o??this.length-1);if(a===-1){for(let c=0;c<=(o??this.length-1);c+=1)if(mt(this[c])===i){tn("array.lastIndexOf(...)");break}}return a}
43,e.includes=function(i,o){const a=s.call(this,i,o);if(!a){for(let c=0;c<this.length;c+=1)if(mt(this[c])===i){tn("array.includes(...)");break}}return a},Array.__svelte_cleanup=()=>{e.indexOf=n,e.lastIndexOf=r,e.includes=s}}var tr,To,On,Br,Gr;function Ao(){if(tr===void 0){tr=window,To=document,On=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Br=Qe(t,"firstChild").get,Gr=Qe(t,"nextSibling").get,Zn(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Zn(n)&&(n.__t=void 0),_&&(e.__svelte_meta=null,ko())}}function _e(e=""){return document.createTextNode(e)}function W(e){return Br.call(e)}function Re(e){return Gr.call(e)}function Qa(e,t){if(!A)return W(e);var n=W(y);if(n===null)n=y.appendChild(_e());else if(t&&n.nodeType!==Gt){var r=_e();return n?.before(r),de(r),r}return de(n),n}function el(e,t=!1){if(!A){var n=W(e);return n instanceof Comment&&n.data===""?Re(n):n}if(t&&y?.nodeType!==Gt){var r=_e();return y?.before(r),de(r),r}return y}function tl(e,t=1,n=!1){let r=A?y:e;for(var s;t--;)s=r,r=Re(r);if(!A)return r;if(n&&r?.nodeType!==Gt){var i=_e();return r===null?s?.after(i):r.before(i),de(i),i}return de(r),r}function xo(e){e.textContent=""}function nl(){if(!re||Q!==null)return!1;var e=g.f;return(e&Et)!==0}function rl(e,t){if(t){const n=document.body;e.autofocus=!0,xt(()=>{document.activeElement===n&&e.focus()})}}function sl(e){A&&W(e)!==null&&xo(e)}let nr=!1;function $o(){nr||(nr=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function il(e,t,n,r=!0){r&&n();for(var s of t)e.addEventListener(s,n);Cn(()=>{for(var i of t)e.removeEventListener(i,n)})}function Kt(e){var t=w,n=g;j(null),J(null);try{return e()}finally{j(t),J(n)}}function ol(e,t,n,r=n){e.addEventListener(t,()=>Kt(n));const s=e.__on_r;s?e.__on_r=()=>{s(),r(!0)}:e.__on_r=()=>r(!0),$o()}function Hr(e){g===null&&(w===null&&Di(e),Ii()),ze&&Li(e)}function Oo(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function G(e,t,n){var r=g;if(_)for(;r!==null&&(r.f&Mt)!==0;)r=r.parent;r!==null&&(r.f&ne)!==0&&(e|=ne);var s={ctx:S,deps:null,nodes:null,f:e|L|B,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};if(_&&(s.component_function=Tt),n)try{st(s),s.f|=Et}catch(a){throw se(s),a}else t!==null&&he(s);var i=s;if(n&&i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&it)===0&&(i=i.first,(e&pe)!==0&&(e&wt)!==0&&i!==null&&(i.f|=wt)),i!==null&&(i.parent=r,r!==null&&Oo(i,r),w!==null&&(w.f&$)!==0&&(e&Be)===0)){var o=w;(o.effects??=[]).push(i)}return s}function Rn(){return w!==null&&!K}function Cn(e){const t=G(et,null,!1);return x(t,N),t.teardown=e,t}function Ro(e){Hr("$effect"),_&&$e(e,"name",{value:"$effect"});var t=g.f,n=!w&&(t&ie)!==0&&(t&Et)===0;if(n){var r=S;(r.e??=[]).push(e)}else return Vr(e)}function Vr(e){return G(gt|Er,e,!1)}function al(e){return Hr("$effect.pre"),_&&$e(e,"name",{value:"$effect.pre"}),G(et|Er,e,!0)}function Co(e){ee.ensure();const t=G(Be|it,e,!0);return(n={})=>new Promise(r=>{n.outro?Lt(t,()=>{se(t),r(void 0)}):(se(t),r(void 0))})}function ll(e){return G(gt,e,!1)}function cl(e,t){var n=S,r={effect:null,ran:!1,deps:e};n.l.$.push(r),r.effect=Nn(()=>{e(),!r.ran&&(r.ran=!0,at(t))})}function ul(){var e=S;Nn(()=>{for(var t of e.l.$){t.deps();var n=t.effect;(n.f&N)!==0&&n.deps!==null&&x(n,oe),ot(n)&&st(n),t.ran=!1}})}function No(e){return G(Bt|it,e,!0)}function Nn(e,t=0){return G(et|t,e,!0)}function fl(e,t=[],n=[],r=[]){Tn(r,t,n,s=>{G(et,()=>e(...s.map(te)),!0)})}function dl(e,t=[],n=[],r=[]){var s=T,i=n.length>0||r.length>0;i&&s.increment(!0),Tn(r,t,n,o=>{G(gt,()=>e(...o.map(te)),!1),i&&s.decrement(!0)})}function Po(e,t=0){var n=G(pe|t,e,!0);return _&&(n.dev_stack=nt),n}function hl(e,t=0){var n=G(Dt|t,e,!0);return _&&(n.dev_stack=nt),n}function Ie(e){return G(ie|it,e,!0)}function Yr(e){var t=e.teardown;
43if(t!==null){const n=ze,r=w;sr(!0),j(null);try{t.call(null)}finally{sr(n),j(r)}}}function Wr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const s=n.ac;s!==null&&Kt(()=>{s.abort(De)});var r=n.next;(n.f&Be)!==0?n.parent=null:se(n,t),n=r}}function Lo(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&ie)===0&&se(t),t=n}}function se(e,t=!0){var n=!1;(t||(e.f&br)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(Io(e.nodes.start,e.nodes.end),n=!0),Wr(e,t&&!n),Ut(e,0),x(e,ue);var r=e.nodes&&e.nodes.t;if(r!==null)for(const i of r)i.stop();Yr(e);var s=e.parent;s!==null&&s.first!==null&&Kr(e),_&&(e.component_function=null),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function Io(e,t){for(;e!==null;){var n=e===t?null:Re(e);e.remove(),e=n}}function Kr(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Lt(e,t,n=!0){var r=[];Jr(e,r,!0);var s=()=>{n&&se(e),t&&t()},i=r.length;if(i>0){var o=()=>--i||s();for(var a of r)a.out(o)}else s()}function Jr(e,t,n){if((e.f&ne)===0){e.f^=ne;var r=e.nodes&&e.nodes.t;if(r!==null)for(const a of r)(a.is_global||n)&&t.push(a);for(var s=e.first;s!==null;){var i=s.next,o=(s.f&wt)!==0||(s.f&ie)!==0&&(e.f&pe)!==0;Jr(s,t,o?n:!1),s=i}}}function _l(e){Zr(e,!0)}function Zr(e,t){if((e.f&ne)!==0){e.f^=ne,(e.f&N)===0&&(x(e,L),he(e));for(var n=e.first;n!==null;){var r=n.next,s=(n.f&wt)!==0||(n.f&ie)!==0;Zr(n,s?t:!1),n=r}var i=e.nodes&&e.nodes.t;if(i!==null)for(const o of i)(o.is_global||t)&&o.in()}}function rr(e=g){return(e.f&ue)!==0}function Do(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var s=n===r?null:Re(n);t.append(n),n=s}}let Xe=null;function Mo(e){var t=Xe;try{if(Xe=new Set,at(e),t!==null)for(var n of Xe)t.add(n);return Xe}finally{Xe=t}}function pl(e){for(var t of Mo(e))bt(t,t.v)}let qe=!1;function qt(e){qe=e}let ze=!1;function sr(e){ze=e}let w=null,K=!1;function j(e){w=e}let g=null;function J(e){g=e}let fe=null;function Xr(e){w!==null&&(!re||(w.f&$)!==0)&&(fe===null?fe=[e]:fe.push(e))}let M=null,U=0,F=null;function jo(e){F=e}let Qr=1,je=0,Ue=je;function ir(e){Ue=e}function es(){return++Qr}function ot(e){var t=e.f;if((t&L)!==0)return!0;if(t&$&&(e.f&=~Oe),(t&oe)!==0){for(var n=e.deps,r=n.length,s=0;s<r;s++){var i=n[s];if(ot(i)&&Ur(i),i.wv>e.wv)return!0}(t&B)!==0&&D===null&&x(e,N)}return!1}function ts(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!re&&fe?.includes(e)))for(var s=0;s<r.length;s++){var i=r[s];(i.f&$)!==0?ts(i,t,!1):t===i&&(n?x(i,L):(i.f&N)!==0&&x(i,oe),he(i))}}function fn(e){var t=M,n=U,r=F,s=w,i=fe,o=S,a=K,c=Ue,h=e.f;M=null,U=0,F=null,w=(h&(ie|Be))===0?e:null,fe=null,tt(e.ctx),K=!1,Ue=++je,e.ac!==null&&(Kt(()=>{e.ac.abort(De)}),e.ac=null);try{e.f|=an;var u=e.fn,l=u(),f=e.deps;if(M!==null){var d;if(Ut(e,U),f!==null&&U>0)for(f.length=U+M.length,d=0;d<M.length;d++)f[U+d]=M[d];else e.deps=f=M;if(Rn()&&(e.f&B)!==0)for(d=U;d<f.length;d++)(f[d].reactions??=[]).push(e)}else f!==null&&U<f.length&&(Ut(e,U),f.length=U);if(At()&&F!==null&&!K&&f!==null&&(e.f&($|oe|L))===0)for(d=0;d<F.length;d++)ts(F[d],e);if(s!==null&&s!==e){if(je++,s.deps!==null)for(let v=0;v<n;v+=1)s.deps[v].rv=je;if(t!==null)for(const v of t)v.rv=je;F!==null&&(r===null?r=F:r.push(...F))}return(e.f&Te)!==0&&(e.f^=Te),l}catch(v){return Nr(v)}finally{e.f^=an,M=t,U=n,F=r,w=s,fe=i,tt(o),K=a,Ue=c}}function qo(e,t){let n=t.reactions;if(n!==null){var r=Ai.call(n,e);if(r!==-1){var s=n.length-1;s===0?n=t.reactions=null:(n[r]=n[s],n.pop())}}if(n===null&&(t.f&$)!==0&&(M===null||!M.includes(t))){var i=t;(i.f&B)!==0&&(i.f^=B,i.f&=~Oe),kn(i),un(i),Ut(i,0)}}function Ut(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)qo(e,n[r])}function st(e){var t=e.f;if((t&ue)===0){x(e,N);var n=g,r=qe;if(g=e,qe=!0,_){var s=Tt;Xn(e.component_function);var i=nt;jt(e.dev_stack??nt)}try{(t&(pe|Dt))!==0?Lo(e):Wr(e),Yr(e);var o=fn(e);e.teardown=typeof o=="function"?o:null,e.wv=Qr;var a;_&&Qi&&(e.f&L)!==0&&e.deps}finally{qe=r,g=n,_&&(Xn(s),jt(i))}}}async function vl(){if(re)return new Promise(e=>{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),lo()}function te(e){var t=e.f,n=(t&$)!==0;if(Xe?.add(e),w!==null&&!K){var r=g!==null&&(g.f&ue)!==0;if(!r&&!fe?.includes(e)){var s=w.deps;if((w.f&an)!==0)e.rv<je&&(e.rv=je,M===null&&s!==null&&s[U]===e?U++:M===null?M=[e]:M.push(e));else{(w.deps??=[]).push(e);var i=e.reactions;i===null?e.reactions=[w]:i.includes(w)||i.push(w)}}}if(_&&vo.delete(e),ze&&xe.has(e))return xe.get(e);if(n){var o=e;if(ze){var a=o.v;return((o.f&N)===0&&o.reactions!==null||rs(o))&&(a=xn(o)),xe.set(o,a),a}var c=(o.f&B)===0&&!K&&w!==null&&(qe||(w.f&B)!==0),h=o.deps===null;
43ot(o)&&(c&&(o.f|=B),Ur(o)),c&&!h&&ns(o)}if(D?.has(e))return D.get(e);if((e.f&Te)!==0)throw e.v;return e.v}function ns(e){if(e.deps!==null){e.f|=B;for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&$)!==0&&(t.f&B)===0&&ns(t)}}function rs(e){if(e.v===C)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(xe.has(t)||(t.f&$)!==0&&rs(t))return!0;return!1}function at(e){var t=K;try{return K=!0,e()}finally{K=t}}function ml(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(Ae in e)dn(e);else if(!Array.isArray(e))for(let t in e){const n=e[t];typeof n=="object"&&n&&Ae in n&&dn(n)}}}function dn(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let r in e)try{dn(e[r],t)}catch{}const n=wr(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=$i(n);for(let s in r){const i=r[s].get;if(i)try{i.call(e)}catch{}}}}}const Uo=/\r/g;function gl(e){e=e.replace(Uo,"");let t=5381,n=e.length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return(t>>>0).toString(36)}function wl(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const Fo=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function yl(e){return Fo.includes(e)}const zo={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function bl(e){return e=e.toLowerCase(),zo[e]??e}const Bo=["touchstart","touchmove"];function Go(e){return Bo.includes(e)}const Ho=["textarea","script","style","title"];function El(e){return Ho.includes(e)}function Sl(e){return e?.replace(/\//g,"/​")}const ss=new Set,hn=new Set;function kl(e){if(!A)return;e.removeAttribute("onload"),e.removeAttribute("onerror");const t=e.__e;t!==void 0&&(e.__e=void 0,queueMicrotask(()=>{e.isConnected&&e.dispatchEvent(t)}))}function Vo(e,t,n,r={}){function s(i){if(r.capture||dt.call(t,i),!i.cancelBubble)return Kt(()=>n?.call(this,i))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?xt(()=>{t.addEventListener(e,s,r)}):t.addEventListener(e,s,r),s}function Tl(e,t,n,r,s){var i={capture:r,passive:s},o=Vo(e,t,n,i);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Cn(()=>{t.removeEventListener(e,o,i)})}function Al(e){for(var t=0;t<e.length;t++)ss.add(e[t]);for(var n of hn)n(e)}let or=null;function dt(e){var t=this,n=t.ownerDocument,r=e.type,s=e.composedPath?.()||[],i=s[0]||e.target;or=e;var o=0,a=or===e&&e.__root;if(a){var c=s.indexOf(a);if(c!==-1&&(t===document||t===window)){e.__root=t;return}var h=s.indexOf(t);if(h===-1)return;c<=h&&(o=c)}if(i=s[o]||e.target,i!==t){$e(e,"currentTarget",{configurable:!0,get(){return i||n}});var u=w,l=g;j(null),J(null);try{for(var f,d=[];i!==null;){var v=i.assignedSlot||i.parentNode||i.host||null;try{var p=i["__"+r];p!=null&&(!i.disabled||e.target===i)&&p.call(i,e)}catch(m){f?d.push(m):f=m}if(e.cancelBubble||v===t||v===null)break;i=v}if(f){for(let m of d)queueMicrotask(()=>{throw m});throw f}}finally{e.__root=t,delete e.currentTarget,j(u),J(l)}}}function is(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","<!---->"),t.content}function Z(e,t){var n=g;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function xl(e,t){var n=(t&kr)!==0,r=(t&Gi)!==0,s,i=!e.startsWith("<!>");return()=>{if(A)return Z(y,null),y;s===void 0&&(s=is(i?e:"<!>"+e),n||(s=W(s)));var o=r||On?document.importNode(s,!0):s.cloneNode(!0);if(n){var a=W(o),c=o.lastChild;Z(a,c)}else Z(o,o);return o}}function Yo(e,t,n="svg"){var r=!e.startsWith("<!>"),s=(t&kr)!==0,i=`<${n}>${r?e:"<!>"+e}</${n}>`,o;return()=>{if(A)return Z(y,null),y;if(!o){var a=is(i),c=W(a);if(s)for(o=document.createDocumentFragment();W(c);)o.appendChild(W(c));else o=W(c)}var h=o.cloneNode(!0);if(s){var u=W(h),l=h.lastChild;Z(u,l)}else Z(h,h);return h}}function $l(e,t){return Yo(e,t,"svg")}function Ol(e=""){if(!A){var t=_e(e+"");return Z(t,t),t}var n=y;return n.nodeType!==Gt&&(n.before(n=_e()),de(n)),Z(n,n),n}function Rl(){if(A)return Z(y,null),y;var e=document.createDocumentFragment(),t=document.createComment(""),n=_e();return e.append(t,n),Z(t,n),e}function Cl(e,t){if(A){var n=g;((n.f&Et)===0||n.nodes.end===null)&&(n.nodes.end=y),Sn();return}e!==null&&e.before(t)}function Nl(){if(A&&y&&y.nodeType===St&&y.textContent?.startsWith("$")){const e=y.textContent.substring(1);return Sn(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}let _n=!0;function Pl(e){_n=e}function Ll(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=n+"")}function ar(e,t){return Wo(e,t)}const Ze=new Map;function Wo(e,{target:t,anchor:n,props:r={},events:s,context:i,intro:o=!0}){Ao();var a=new Set,c=l=>{for(var f=0;f<l.length;f++){var d=l[f];if(!a.has(d)){a.add(d);var v=Go(d);t.addEventListener(d,dt,{passive:v});var p=Ze.get(d);p===void 0?(document.addEventListener(d,dt,{passive:v}),Ze.set(d,1)):Ze.set(d,p+1)}}};c(xi(ss)),hn.add(c);var h=void 0,u=Co(()=>{var l=n??t.appendChild(_e());return ho(l,{pending:()=>{}},f=>{if(i){no({});var d=S;d.c=i}if(s&&(r.$$events=s),A&&Z(f,null),_n=o,h=e(f,r)||{},_n=!0,A&&(g.nodes.end=y,y===null||y.nodeType!==St||y.data!==Ar))throw Yt(),Vt;i&&ro()}),()=>{for(var f of a){t.removeEventListener(f,dt);var d=Ze.get(f);--d===0?(document.removeEventListener(f,dt),Ze.delete(f)):Ze.set(f,d)}hn.delete(c),l!==n&&l.parentNode?.removeChild(l)}});return pn.set(h,u),h}let pn=new WeakMap;function lr(e,t){const n=pn.get(e);return n?(pn.delete(e),n(t)):(_&&(Ae in e?Wi():Yi()),Promise.resolve())}if(_){let e=function(t){if(!(t in globalThis)){let n;Object.defineProperty(globalThis,t,{configurable:!0,get:()=>{if(n!==void 0)return n;ji(t)},set:r=>{n=r}})}};e("$state"),e("$effect"),e("$derived"),e("$inspect"),e("$props"),e("$bindable")}function Ko(e){S===null&&Ht("onMount"),kt&&S.l!==null?Zo(S).m.push(e):Ro(()=>{const t=at(e);
43if(typeof t=="function")return t})}function Il(e){S===null&&Ht("onDestroy"),Ko(()=>()=>at(e))}function Jo(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}function Dl(){const e=S;return e===null&&Ht("createEventDispatcher"),(t,n,r)=>{const s=e.s.$$events?.[t];if(s){const i=gr(s)?s.slice():[s],o=Jo(t,n,r);for(const a of i)a.call(e.x,o);return!o.defaultPrevented}return!0}}function Zo(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}const Xo="./assets/index-CJjI6XC6.css";let vn;vn=[];let mn,gn,os,Qo=new Promise(e=>{os=e});globalThis.__MODE__??="_NORMAL_";const ea=globalThis.__MODE__;async function ta(){ea==="_CC_"&&await ht(()=>import("virtual:cc-init"),[],import.meta.url);const e=await Promise.all([ht(()=>import("./Index-Bokbevwk.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url),ht(()=>import("./index-BlQXYsaG.js"),__vite__mapDeps([13,1,2,14]),import.meta.url)]);mn=e[0].default,gn=e[1].mount_css,os()}function na(){class e extends HTMLElement{control_page_title;initial_height;is_embed;container;info;autoscroll;eager;theme_mode;host;space;src;app;loading;updating;constructor(){super(),this.host=this.getAttribute("host"),this.space=this.getAttribute("space"),this.src=this.getAttribute("src"),this.control_page_title=this.getAttribute("control_page_title"),this.initial_height=this.getAttribute("initial_height")??"300px",this.is_embed=this.getAttribute("embed")??"true",this.container=this.getAttribute("container")??"true",this.info=this.getAttribute("info")??!0,this.autoscroll=this.getAttribute("autoscroll"),this.eager=this.getAttribute("eager"),this.theme_mode=this.getAttribute("theme_mode"),this.updating=!1,this.loading=!1}async connectedCallback(){await ta(),this.loading=!0,this.app&&lr(this.app),typeof vn!="string"&&vn.forEach(i=>gn(i,document.head)),await gn(Xo,document.head);const n=new CustomEvent("domchange",{bubbles:!0,cancelable:!1,composed:!0});new MutationObserver(i=>{this.dispatchEvent(n)}).observe(this,{childList:!0});const s={target:this,props:{space:this.space?this.space.trim():this.space,src:this.src?this.src.trim():this.src,info:this.info!=="false",container:this.container!=="false",is_embed:this.is_embed!=="false",initial_height:this.initial_height,eager:this.eager==="true",version:"6-20-0",theme_mode:this.theme_mode,autoscroll:this.autoscroll==="true",control_page_title:this.control_page_title==="true",Client:It,app_mode:window.__gradio_mode__==="app"}};this.app=ar(mn,s),this.updating&&this.setAttribute(this.updating.name,this.updating.value),this.loading=!1}static get observedAttributes(){return["src","space","host"]}async attributeChangedCallback(n,r,s){if(await Qo,(n==="host"||n==="space"||n==="src")&&s!==r){if(this.updating={name:n,value:s},this.loading)return;this.app&&lr(this.app),this.space=null,this.host=null,this.src=null,n==="host"?this.host=s:n==="space"?this.space=s:n==="src"&&(this.src=s);const i={target:this,props:{space:this.space?this.space.trim():this.space,src:this.src?this.src.trim():this.src,info:this.info!=="false",container:this.container!=="false",is_embed:this.is_embed!=="false",initial_height:this.initial_height,eager:this.eager==="true",version:"6-20-0",theme_mode:this.theme_mode,autoscroll:this.autoscroll==="true",control_page_title:this.control_page_title==="true",Client:It,app_mode:window.__gradio_mode__==="app"}};this.app=ar(mn,i),this.updating=!1}}}customElements.get("gradio-app")||customElements.define("gradio-app",e)}na();export{ce as $,pa as A,T as B,St as C,_ as D,wt as E,Vi as F,vl as G,Vt as H,Cn as I,xt as J,nn as K,Xa as L,no as M,el as N,ro as O,lo as P,Qa as Q,xl as R,tl as S,Ua as T,Ll as U,Dl as V,Tl as W,te as X,Wa as Y,cl as Z,ul as _,Cl as a,gr as a$,Ka as a0,Rl as a1,Ol as a2,Ji as a3,At as a4,Ko as a5,il as a6,Kt as a7,Ee as a8,ft as a9,yt as aA,pt as aB,$t as aC,C as aD,qr as aE,Tr as aF,Zi as aG,ar as aH,lr as aI,Za as aJ,po as aK,Tn as aL,br as aM,Ya as aN,mo as aO,Va as aP,dl as aQ,To as aR,_n as aS,pe as aT,Et as aU,Ca as aV,Oa as aW,Ra as aX,ia as aY,oa as aZ,ja as a_,Ro as aa,go as ab,Il as ac,ht as ad,al as ae,Al as af,sl as ag,rl as ah,Pl as ai,Pa as aj,_e as ak,_a as al,El as am,qa as an,Ja as ao,kl as ap,ca as aq,sa as ar,tr as as,Nl as at,Ga as au,Ft as av,Ha as aw,aa as ax,bt as ay,ee as az,g as b,pl as b0,wr as b1,Oi as b2,_l as b3,se as b4,Lt as b5,Ie as b6,Do as b7,nl as b8,Fa as b9,An as bA,$e as bB,Qe as bC,ma as bD,Aa as bE,ue as bF,xa as bG,ka as bH,$a as bI,ze as bJ,fa as bK,J as bL,ga as bM,kt as bN,Ta as bO,Ba as bP,za as bQ,uo as bR,Rn as bS,ba,xi as bb,wa as bc,Sa as bd,ya as be,ua as bf,ne as bg,Ea as bh,xo as bi,Ar as bj,hl as bk,Ma as bl,da as bm,La as bn,Na as bo,wl as bp,Vo as bq,bl as br,yl as bs,$i as bt,$o as bu,Ia as bv,Ae as bw,S as bx,Ci as by,la as bz,is as c,Z as d,Sn as e,$l as f,W as g,A as h,y as i,Re as j,Yt as k,gl as l,Tt as m,Da as n,Sl as o,Po as p,va as q,Io as r,de as s,fl as t,ll as u,at as v,Nn as w,ml as x,Xi as y,ol as z};

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.