GitHub Action commited on
Commit
68d4ca1
Β·
1 Parent(s): 497cc85

Sync from GitHub: 4669d40fc14f4e07fe72e288595b87a564ada653

Browse files
.gitattributes CHANGED
@@ -7,3 +7,9 @@
7
  *.mp4 filter=lfs diff=lfs merge=lfs -text
8
  *.webm filter=lfs diff=lfs merge=lfs -text
9
  *.pdf filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
7
  *.mp4 filter=lfs diff=lfs merge=lfs -text
8
  *.webm filter=lfs diff=lfs merge=lfs -text
9
  *.pdf filter=lfs diff=lfs merge=lfs -text
10
+ hfstudio/static/assets/hf-logo.png filter=lfs diff=lfs merge=lfs -text
11
+ hfstudio/static/assets/hf-studio-logo.png filter=lfs diff=lfs merge=lfs -text
12
+ frontend/static/assets/hf-logo.png filter=lfs diff=lfs merge=lfs -text
13
+ frontend/static/assets/hf-studio-logo.png filter=lfs diff=lfs merge=lfs -text
14
+ hfstudio/static/samples/harvard.wav filter=lfs diff=lfs merge=lfs -text
15
+ frontend/static/samples/harvard.wav filter=lfs diff=lfs merge=lfs -text
frontend/src/routes/+layout.svelte CHANGED
@@ -46,10 +46,10 @@
46
 
47
  // Check if running on Spaces first
48
  checkSpacesStatus().then(() => {
49
- // Only check local token availability if not already authenticated and not on Spaces
50
- if (!isLoggedIn && !isSpaces) {
51
- checkLocalTokenAvailability();
52
- }
53
 
54
  // Only check login status if we don't have initial user data
55
  if (!initialUser?.authenticated) {
@@ -63,13 +63,8 @@
63
  }
64
  });
65
 
66
- window.addEventListener('storage', checkLoginStatus);
67
-
68
- const interval = setInterval(checkLoginStatus, 1000);
69
-
70
  return () => {
71
- window.removeEventListener('storage', checkLoginStatus);
72
- clearInterval(interval);
73
  };
74
  });
75
 
@@ -169,30 +164,60 @@
169
 
170
  async function handleAuthAction() {
171
  if (isLoggedIn) {
172
- localStorage.removeItem('hf_access_token');
173
- localStorage.removeItem('hf_user_info');
174
- localStorage.removeItem('hf_cached_token');
 
 
 
 
 
 
 
 
175
  sessionStorage.removeItem('oauth_state');
176
  isLoggedIn = false;
177
  username = '';
178
  } else {
179
- if (isSpaces) {
180
- try {
181
- const response = await fetch('/api/auth/oauth-config');
182
- const config = await response.json();
183
- const scopes = config.scopes || 'read-repos write-repos manage-repos inference-api';
184
- const oauthUrl = `https://huggingface.co/oauth/authorize?client_id=${config.client_id}&redirect_uri=${encodeURIComponent(window.location.origin + '/auth/callback')}&scope=${encodeURIComponent(scopes)}&response_type=code&state=${Date.now()}`;
185
- window.location.href = oauthUrl;
186
- } catch (error) {
187
- showTokenInput = true;
188
- tokenInput = '';
189
- tokenError = '';
190
  }
191
- } else {
 
 
 
 
192
  showTokenInput = true;
193
  tokenInput = '';
194
  tokenError = '';
195
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  }
197
  }
198
 
@@ -352,14 +377,14 @@
352
  <p class="text-sm font-medium text-gray-700 mb-1 pr-4">
353
  Hugging Face <span
354
  class="bg-gradient-to-r from-purple-500 via-pink-500 via-green-500 to-blue-500 bg-clip-text text-transparent font-bold"
355
- >Pro</span
356
  >
357
  </p>
358
  <p class="text-sm text-gray-600 pr-4">
359
  Sign in to with your Hugging Face <a
360
  href="https://huggingface.co/pro"
361
  target="_blank"
362
- class="text-amber-600 hover:text-amber-700 underline font-medium">Pro account</a
363
  > to get started with $2 of free API credits per month. You can add a billing method for
364
  additional pay-as-you-go usage &#10549;
365
  </p>
 
46
 
47
  // Check if running on Spaces first
48
  checkSpacesStatus().then(() => {
49
+ // Comment out local token check - use OAuth everywhere
50
+ // if (!isLoggedIn && !isSpaces) {
51
+ // checkLocalTokenAvailability();
52
+ // }
53
 
54
  // Only check login status if we don't have initial user data
55
  if (!initialUser?.authenticated) {
 
63
  }
64
  });
65
 
 
 
 
 
66
  return () => {
67
+ // Cleanup function
 
68
  };
69
  });
70
 
 
164
 
165
  async function handleAuthAction() {
166
  if (isLoggedIn) {
167
+ // Call backend logout endpoint to clear session
168
+ try {
169
+ await fetch('/api/auth/logout', {
170
+ method: 'POST',
171
+ credentials: 'include',
172
+ });
173
+ } catch (error) {
174
+ console.error('Logout error:', error);
175
+ }
176
+
177
+ // Clear any legacy storage
178
  sessionStorage.removeItem('oauth_state');
179
  isLoggedIn = false;
180
  username = '';
181
  } else {
182
+ // Always use OAuth flow for authentication
183
+ try {
184
+ const response = await fetch('/api/auth/oauth-config');
185
+ const config = await response.json();
186
+ const scopes = config.scopes || 'inference-api';
187
+
188
+ // For local development, use backend port for callback
189
+ let redirectUri = window.location.origin + '/auth/callback';
190
+ if (window.location.hostname === 'localhost' && window.location.port === '11111') {
191
+ redirectUri = 'http://localhost:7860/auth/callback';
 
192
  }
193
+
194
+ const oauthUrl = `https://huggingface.co/oauth/authorize?client_id=${config.client_id}&redirect_uri=${encodeURIComponent(redirectUri)}&scope=${encodeURIComponent(scopes)}&response_type=code&state=${Date.now()}`;
195
+ window.location.href = oauthUrl;
196
+ } catch (error) {
197
+ // Fallback to manual token input if OAuth config fails
198
  showTokenInput = true;
199
  tokenInput = '';
200
  tokenError = '';
201
  }
202
+
203
+ // Old approach - commented out
204
+ // if (isSpaces) {
205
+ // try {
206
+ // const response = await fetch('/api/auth/oauth-config');
207
+ // const config = await response.json();
208
+ // const scopes = config.scopes || 'read-repos write-repos manage-repos inference-api';
209
+ // const oauthUrl = `https://huggingface.co/oauth/authorize?client_id=${config.client_id}&redirect_uri=${encodeURIComponent(window.location.origin + '/auth/callback')}&scope=${encodeURIComponent(scopes)}&response_type=code&state=${Date.now()}`;
210
+ // window.location.href = oauthUrl;
211
+ // } catch (error) {
212
+ // showTokenInput = true;
213
+ // tokenInput = '';
214
+ // tokenError = '';
215
+ // }
216
+ // } else {
217
+ // showTokenInput = true;
218
+ // tokenInput = '';
219
+ // tokenError = '';
220
+ // }
221
  }
222
  }
223
 
 
377
  <p class="text-sm font-medium text-gray-700 mb-1 pr-4">
378
  Hugging Face <span
379
  class="bg-gradient-to-r from-purple-500 via-pink-500 via-green-500 to-blue-500 bg-clip-text text-transparent font-bold"
380
+ >PRO</span
381
  >
382
  </p>
383
  <p class="text-sm text-gray-600 pr-4">
384
  Sign in to with your Hugging Face <a
385
  href="https://huggingface.co/pro"
386
  target="_blank"
387
+ class="text-amber-600 hover:text-amber-700 underline font-medium">PRO account</a
388
  > to get started with $2 of free API credits per month. You can add a billing method for
389
  additional pay-as-you-go usage &#10549;
390
  </p>
hfstudio/server.py CHANGED
@@ -234,9 +234,7 @@ async def get_status():
234
 
235
  @app.get("/api/auth/oauth-config")
236
  async def get_oauth_config():
237
- scopes = os.getenv(
238
- "OAUTH_SCOPES", "read-repos write-repos manage-repos inference-api"
239
- )
240
 
241
  return {
242
  "client_id": os.getenv(
@@ -352,14 +350,21 @@ async def validate_manual_token(request: ManualTokenRequest, response: Response)
352
  session_id = create_session(request.token, user_info)
353
 
354
  # Set cookie with appropriate settings for Spaces
355
- response.set_cookie(
356
- key="hf_session",
357
- value=session_id,
358
- httponly=True,
359
- secure=is_running_on_spaces(),
360
- samesite="none" if is_running_on_spaces() else "lax",
361
- max_age=SESSION_TIMEOUT,
362
- )
 
 
 
 
 
 
 
363
 
364
  return {"success": True, "user_info": user_info}
365
 
@@ -480,7 +485,11 @@ async def exchange_oauth_token(request: OAuthTokenRequest, http_request: Request
480
 
481
  # Check if the origin matches any allowed redirect
482
  redirect_uri = f"{origin}/auth/callback"
483
- if redirect_uri not in allowed_redirects:
 
 
 
 
484
  # Default to the primary domain if not in allowed list
485
  redirect_uri = "https://www.hfstud.io/auth/callback"
486
  else:
@@ -566,7 +575,11 @@ async def oauth_callback(
566
 
567
  # Check if the origin matches any allowed redirect
568
  redirect_uri = f"{origin}/auth/callback"
569
- if redirect_uri not in allowed_redirects:
 
 
 
 
570
  # Default to the primary domain if not in allowed list
571
  redirect_uri = "https://www.hfstud.io/auth/callback"
572
  else:
@@ -599,28 +612,46 @@ async def oauth_callback(
599
  # Create session and set HTTP-only cookie
600
  session_id = create_session(access_token, user_info)
601
 
602
- html_response = HTMLResponse("""
 
 
 
 
 
 
 
 
 
 
 
 
603
  <html>
604
  <head><title>OAuth Success</title></head>
605
  <body>
606
  <h1>Sign in successful!</h1>
607
  <p>Redirecting...</p>
608
  <script>
609
- window.location.href = '/';
610
  </script>
611
  </body>
612
  </html>
613
  """)
614
 
615
  # Set HTTP-only, secure session cookie
616
- html_response.set_cookie(
617
- key="hf_session",
618
- value=session_id,
619
- httponly=True,
620
- secure=is_running_on_spaces(), # Secure in production
621
- samesite="none" if is_running_on_spaces() else "lax",
622
- max_age=SESSION_TIMEOUT,
623
- )
 
 
 
 
 
 
624
 
625
  return html_response
626
  else:
 
234
 
235
  @app.get("/api/auth/oauth-config")
236
  async def get_oauth_config():
237
+ scopes = os.getenv("OAUTH_SCOPES", "inference-api")
 
 
238
 
239
  return {
240
  "client_id": os.getenv(
 
350
  session_id = create_session(request.token, user_info)
351
 
352
  # Set cookie with appropriate settings for Spaces
353
+ cookie_kwargs = {
354
+ "key": "hf_session",
355
+ "value": session_id,
356
+ "httponly": True,
357
+ "secure": is_running_on_spaces(),
358
+ "samesite": "none" if is_running_on_spaces() else "lax",
359
+ "max_age": SESSION_TIMEOUT,
360
+ }
361
+
362
+ # For local development, set domain to localhost to allow cross-port access
363
+ referer = request.headers.get("referer", "")
364
+ if not is_running_on_spaces() and "localhost" in referer:
365
+ cookie_kwargs["domain"] = "localhost"
366
+
367
+ response.set_cookie(**cookie_kwargs)
368
 
369
  return {"success": True, "user_info": user_info}
370
 
 
485
 
486
  # Check if the origin matches any allowed redirect
487
  redirect_uri = f"{origin}/auth/callback"
488
+
489
+ # For local development, if frontend port 11111 is used, redirect to backend port 7860
490
+ if origin == "http://localhost:11111":
491
+ redirect_uri = "http://localhost:7860/auth/callback"
492
+ elif redirect_uri not in allowed_redirects:
493
  # Default to the primary domain if not in allowed list
494
  redirect_uri = "https://www.hfstud.io/auth/callback"
495
  else:
 
575
 
576
  # Check if the origin matches any allowed redirect
577
  redirect_uri = f"{origin}/auth/callback"
578
+
579
+ # For local development, if frontend port 11111 is used, redirect to backend port 7860
580
+ if origin == "http://localhost:11111":
581
+ redirect_uri = "http://localhost:7860/auth/callback"
582
+ elif redirect_uri not in allowed_redirects:
583
  # Default to the primary domain if not in allowed list
584
  redirect_uri = "https://www.hfstud.io/auth/callback"
585
  else:
 
612
  # Create session and set HTTP-only cookie
613
  session_id = create_session(access_token, user_info)
614
 
615
+ # Determine redirect URL based on environment
616
+ if (
617
+ not is_running_on_spaces()
618
+ and referer
619
+ and "localhost:11111" in referer
620
+ ):
621
+ # Local development - redirect to frontend port
622
+ redirect_url = "http://localhost:11111/"
623
+ else:
624
+ # Production or same-origin - redirect to root
625
+ redirect_url = "/"
626
+
627
+ html_response = HTMLResponse(f"""
628
  <html>
629
  <head><title>OAuth Success</title></head>
630
  <body>
631
  <h1>Sign in successful!</h1>
632
  <p>Redirecting...</p>
633
  <script>
634
+ window.location.href = '{redirect_url}';
635
  </script>
636
  </body>
637
  </html>
638
  """)
639
 
640
  # Set HTTP-only, secure session cookie
641
+ cookie_kwargs = {
642
+ "key": "hf_session",
643
+ "value": session_id,
644
+ "httponly": True,
645
+ "secure": is_running_on_spaces(), # Secure in production
646
+ "samesite": "none" if is_running_on_spaces() else "lax",
647
+ "max_age": SESSION_TIMEOUT,
648
+ }
649
+
650
+ # For local development, set domain to localhost to allow cross-port access
651
+ if not is_running_on_spaces() and referer and "localhost" in referer:
652
+ cookie_kwargs["domain"] = "localhost"
653
+
654
+ html_response.set_cookie(**cookie_kwargs)
655
 
656
  return html_response
657
  else:
hfstudio/static/_app/immutable/chunks/H9bLuign.js ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ var St=Object.defineProperty;var kt=(e,t,n)=>t in e?St(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var R=(e,t,n)=>kt(e,typeof t!="symbol"?t+"":t,n);import{S as Et,F as At,Z as Rt,_ as Tt,$ as It,a0 as Ut,a1 as Lt,a2 as $t,z as ve,a3 as xt,G as be,n as ge,s as Ct}from"./MT0Fezl8.js";class Ze extends Et{constructor(n){if(!n||!n.target&&!n.$$inline)throw new Error("'target' is a required option");super();R(this,"$$prop_def");R(this,"$$events_def");R(this,"$$slot_def")}$destroy(){super.$destroy(),this.$destroy=()=>{console.warn("Component was already destroyed")}}$capture_state(){}$inject_state(){}}class Pt extends Ze{}const Ot=Object.freeze(Object.defineProperty({__proto__:null,SvelteComponent:Ze,SvelteComponentTyped:Pt,afterUpdate:At,beforeUpdate:Rt,createEventDispatcher:Tt,getAllContexts:It,getContext:Ut,hasContext:Lt,onDestroy:$t,onMount:ve,setContext:xt,tick:be},Symbol.toStringTag,{value:"Module"}));class ie{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Re{constructor(t,n){this.status=t,this.location=n}}class Te extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function Nt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function jt(e){return e.split("%25").map(decodeURI).join("%25")}function Dt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function me({href:e}){return e.split("#")[0]}function Ft(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(i,o){if(o==="get"||o==="getAll"||o==="has")return l=>(n(l),i[o](l));t();const c=Reflect.get(i,o);return typeof c=="function"?c.bind(i):c}}),enumerable:!0,configurable:!0});const s=["href","pathname","search","toString","toJSON"];r&&s.push("hash");for(const i of s)Object.defineProperty(a,i,{get(){return t(),e[i]},enumerable:!0,configurable:!0});return a}function Bt(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;const Mt=new TextDecoder;function Vt(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const qt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:(t==null?void 0:t.method)||"GET")!=="GET"&&Y.delete(Ie(e)),qt(e,t));const Y=new Map;function Gt(e,t){const n=Ie(e,t),r=document.querySelector(n);if(r!=null&&r.textContent){r.remove();let{body:a,...s}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&Y.set(n,{body:a,init:s,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=Vt(a)),Promise.resolve(new Response(a,s))}return window.fetch(e,t)}function Yt(e,t,n){if(Y.size>0){const r=Ie(e,n),a=Y.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n==null?void 0:n.cache))return new Response(a.body,a.init);Y.delete(r)}}return window.fetch(t,n)}function Ie(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t!=null&&t.headers||t!=null&&t.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${Bt(...a)}"]`}return r}const zt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Ht(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Wt(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return t.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,l)=>{if(l%2){if(c.startsWith("x+"))return _e(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return _e(String.fromCharCode(...c.slice(2).split("-").map(u=>parseInt(u,16))));const d=zt.exec(c),[,h,y,f,p]=d;return t.push({name:f,matcher:p,optional:!!h,rest:!!y,chained:y?l===1&&i[0]==="":!1}),y?"([^]*?)":h?"([^/]*)?":"([^/]+?)"}return _e(c)}).join("")}).join("")}/?$`),params:t}}function Kt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Wt(e){return e.slice(1).split("/").filter(Kt)}function Jt(e,t,n){const r={},a=e.slice(1),s=a.filter(o=>o!==void 0);let i=0;for(let o=0;o<t.length;o+=1){const c=t[o];let l=a[o-i];if(c.chained&&c.rest&&i&&(l=a.slice(o-i,o+1).filter(d=>d).join("/"),i=0),l===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||n[c.matcher](l)){r[c.name]=l;const d=t[o+1],h=a[o+1];d&&!d.rest&&d.optional&&h&&c.chained&&(i=0),!d&&!h&&Object.keys(r).length===s.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function _e(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Xt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[c,l,d]])=>{const{pattern:h,params:y}=Ht(o),f={id:o,exec:p=>{const u=h.exec(p);if(u)return Jt(u,y,r)},errors:[1,...d||[]].map(p=>e[p]),layouts:[0,...l||[]].map(i),leaf:s(c)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function s(o){const c=o<0;return c&&(o=~o),[c,e[o]]}function i(o){return o===void 0?o:[a.has(o),e[o]]}}function Qe(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Be(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const D=[];function Ue(e,t=ge){let n;const r=new Set;function a(o){if(Ct(e,o)&&(e=o,n)){const c=!D.length;for(const l of r)l[1](),D.push(l,e);if(c){for(let l=0;l<D.length;l+=2)D[l][0](D[l+1]);D.length=0}}}function s(o){a(o(e))}function i(o,c=ge){const l=[o,c];return r.add(l),r.size===1&&(n=t(a,s)||ge),o(e),()=>{r.delete(l),r.size===0&&n&&(n(),n=null)}}return{set:a,update:s,subscribe:i}}var Je;const $=((Je=globalThis.__sveltekit_1hob969)==null?void 0:Je.base)??"";var Xe;const Zt=((Xe=globalThis.__sveltekit_1hob969)==null?void 0:Xe.assets)??$??"",Qt="1761233809732",et="sveltekit:snapshot",tt="sveltekit:scroll",nt="sveltekit:states",en="sveltekit:pageurl",B="sveltekit:history",K="sveltekit:navigation",O={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},ce=location.origin;function at(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function le(){return{x:pageXOffset,y:pageYOffset}}function F(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Me={...O,"":O.hover};function rt(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function ot(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=rt(e)}}function Se(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,s=!r||!!a||fe(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),i=(r==null?void 0:r.origin)===ce&&e.hasAttribute("download");return{url:r,external:s,target:a,download:i}}function Q(e){let t=null,n=null,r=null,a=null,s=null,i=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=F(o,"preload-code")),a===null&&(a=F(o,"preload-data")),t===null&&(t=F(o,"keepfocus")),n===null&&(n=F(o,"noscroll")),s===null&&(s=F(o,"reload")),i===null&&(i=F(o,"replacestate")),o=rt(o);function c(l){switch(l){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Me[r??"off"],preload_data:Me[a??"off"],keepfocus:c(t),noscroll:c(n),reload:c(s),replace_state:c(i)}}function Ve(e){const t=Ue(e);let n=!0;function r(){n=!0,t.update(i=>i)}function a(i){n=!1,t.set(i)}function s(i){let o;return t.subscribe(c=>{(o===void 0||n&&c!==o)&&i(o=c)})}return{notify:r,set:a,subscribe:s}}const st={v:()=>{}};function tn(){const{set:e,subscribe:t}=Ue(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Zt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==Qt;return i&&(e(!0),st.v(),clearTimeout(n)),i}catch{return!1}}return{subscribe:t,check:r}}function fe(e,t,n){return e.origin!==ce||!e.pathname.startsWith(t)?!0:n?!(e.pathname===t+"/"||e.pathname===t+"/index.html"||e.protocol==="file:"&&e.pathname.replace(/\/[^/]+\.html?$/,"")===t):!1}function qn(e){}function nn(e){const t=rn(e),n=new ArrayBuffer(t.length),r=new DataView(n);for(let a=0;a<n.byteLength;a++)r.setUint8(a,t.charCodeAt(a));return n}const an="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function rn(e){e.length%4===0&&(e=e.replace(/==?$/,""));let t="",n=0,r=0;for(let a=0;a<e.length;a++)n<<=6,n|=an.indexOf(e[a]),r+=6,r===24&&(t+=String.fromCharCode((n&16711680)>>16),t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255),n=r=0);return r===12?(n>>=4,t+=String.fromCharCode(n)):r===18&&(n>>=2,t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255)),t}const on=-1,sn=-2,cn=-3,ln=-4,fn=-5,un=-6;function dn(e,t){if(typeof e=="number")return a(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const n=e,r=Array(n.length);function a(s,i=!1){if(s===on)return;if(s===cn)return NaN;if(s===ln)return 1/0;if(s===fn)return-1/0;if(s===un)return-0;if(i||typeof s!="number")throw new Error("Invalid input");if(s in r)return r[s];const o=n[s];if(!o||typeof o!="object")r[s]=o;else if(Array.isArray(o))if(typeof o[0]=="string"){const c=o[0],l=t==null?void 0:t[c];if(l)return r[s]=l(a(o[1]));switch(c){case"Date":r[s]=new Date(o[1]);break;case"Set":const d=new Set;r[s]=d;for(let f=1;f<o.length;f+=1)d.add(a(o[f]));break;case"Map":const h=new Map;r[s]=h;for(let f=1;f<o.length;f+=2)h.set(a(o[f]),a(o[f+1]));break;case"RegExp":r[s]=new RegExp(o[1],o[2]);break;case"Object":r[s]=Object(o[1]);break;case"BigInt":r[s]=BigInt(o[1]);break;case"null":const y=Object.create(null);r[s]=y;for(let f=1;f<o.length;f+=2)y[o[f]]=a(o[f+1]);break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":{const f=globalThis[c],p=new f(a(o[1]));r[s]=o[2]!==void 0?p.subarray(o[2],o[3]):p;break}case"ArrayBuffer":{const f=o[1],p=nn(f);r[s]=p;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const f=c.slice(9);r[s]=Temporal[f].from(o[1]);break}case"URL":{const f=new URL(o[1]);r[s]=f;break}case"URLSearchParams":{const f=new URLSearchParams(o[1]);r[s]=f;break}default:throw new Error(`Unknown type ${c}`)}}else{const c=new Array(o.length);r[s]=c;for(let l=0;l<o.length;l+=1){const d=o[l];d!==sn&&(c[l]=a(d))}}else{const c={};r[s]=c;for(const l in o){if(l==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const d=o[l];c[l]=a(d)}}return r[s]}return a(0)}const it=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...it];const hn=new Set([...it]);[...hn];function pn(e){return e.filter(t=>t!=null)}const gn="x-sveltekit-invalidated",mn="x-sveltekit-trailing-slash";function ee(e){return e instanceof ie||e instanceof Te?e.status:500}function _n(e){return e instanceof Te?e.text:"Internal Error"}let T,W,we;const wn=ve.toString().includes("$$")||/function \w+\(\) \{\}/.test(ve.toString());wn?(T={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},W={current:null},we={current:!1}):(T=new class{constructor(){R(this,"data",$state.raw({}));R(this,"form",$state.raw(null));R(this,"error",$state.raw(null));R(this,"params",$state.raw({}));R(this,"route",$state.raw({id:null}));R(this,"state",$state.raw({}));R(this,"status",$state.raw(-1));R(this,"url",$state.raw(new URL("https://example.com")))}},W=new class{constructor(){R(this,"current",$state.raw(null))}},we=new class{constructor(){R(this,"current",$state.raw(!1))}},st.v=()=>we.current=!0);function yn(e){Object.assign(T,e)}const vn="/__data.json",bn=".html__data.json";function Sn(e){return e.endsWith(".html")?e.replace(/\.html$/,bn):e.replace(/\/$/,"")+vn}const qe={spanContext(){return kn},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},kn={traceId:"",spanId:"",traceFlags:0},{tick:En}=Ot,An=new Set(["icon","shortcut icon","apple-touch-icon"]),j=Qe(tt)??{},J=Qe(et)??{},C={url:Ve({}),page:Ve({}),navigating:Ue(null),updated:tn()};function Le(e){j[e]=le()}function Rn(e,t){let n=e+1;for(;j[n];)delete j[n],n+=1;for(n=t+1;J[n];)delete J[n],n+=1}function q(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function ct(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration($||"/");e&&await e.update()}}function Ge(){}let $e,ke,te,x,Ee,k;const ne=[],ae=[];let U=null;const Z=new Map,lt=new Set,Tn=new Set,z=new Set;let b={branch:[],error:null,url:null},xe=!1,re=!1,Ye=!0,X=!1,G=!1,ft=!1,Ce=!1,ut,A,L,N;const H=new Set,ze=new Map;async function Hn(e,t,n){var s,i,o,c,l;(s=globalThis.__sveltekit_1hob969)!=null&&s.data&&globalThis.__sveltekit_1hob969.data,document.URL!==location.href&&(location.href=location.href),k=e,await((o=(i=e.hooks).init)==null?void 0:o.call(i)),$e=Xt(e),x=document.documentElement,Ee=t,ke=e.nodes[0],te=e.nodes[1],ke(),te(),A=(c=history.state)==null?void 0:c[B],L=(l=history.state)==null?void 0:l[K],A||(A=L=Date.now(),history.replaceState({...history.state,[B]:A,[K]:L},""));const r=j[A];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await Dn(Ee,n)):(await M({type:"enter",url:at(k.hash?Bn(new URL(location.href)):location.href),replace_state:!0}),a()),jn()}function In(){ne.length=0,Ce=!1}function dt(e){ae.some(t=>t==null?void 0:t.snapshot)&&(J[e]=ae.map(t=>{var n;return(n=t==null?void 0:t.snapshot)==null?void 0:n.capture()}))}function ht(e){var t;(t=J[e])==null||t.forEach((n,r)=>{var a,s;(s=(a=ae[r])==null?void 0:a.snapshot)==null||s.restore(n)})}function He(){Le(A),Be(tt,j),dt(L),Be(et,J)}async function Un(e,t,n,r){let a;t.invalidateAll&&(U=null),await M({type:"goto",url:at(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Ce=!0,a=[...ze.keys()]),t.invalidate&&t.invalidate.forEach(Nn)}}),t.invalidateAll&&be().then(be).then(()=>{ze.forEach(({resource:s},i)=>{var o;a!=null&&a.includes(i)&&((o=s.refresh)==null||o.call(s))})})}async function Ln(e){if(e.id!==(U==null?void 0:U.id)){const t={};H.add(t),U={id:e.id,token:t,promise:mt({...e,preload:t}).then(n=>(H.delete(t),n.type==="loaded"&&n.state.error&&(U=null),n))}}return U.promise}async function ye(e){var n;const t=(n=await de(e,!1))==null?void 0:n.route;t&&await Promise.all([...t.layouts,t.leaf].map(r=>r==null?void 0:r[1]()))}function pt(e,t,n){var a;b=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(T,e.props.page),ut=new k.root({target:t,props:{...e.props,stores:C,components:ae},hydrate:n,sync:!1}),ht(L),n){const s={from:null,to:{params:b.params,route:{id:((a=b.route)==null?void 0:a.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};z.forEach(i=>i(s))}re=!0}function oe({url:e,params:t,branch:n,status:r,error:a,route:s,form:i}){let o="never";if($&&(e.pathname===$||e.pathname===$+"/"))o="always";else for(const f of n)(f==null?void 0:f.slash)!==void 0&&(o=f.slash);e.pathname=Nt(e.pathname,o),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:s},props:{constructors:pn(n).map(f=>f.node.component),page:je(T)}};i!==void 0&&(c.props.form=i);let l={},d=!T,h=0;for(let f=0;f<Math.max(n.length,b.branch.length);f+=1){const p=n[f],u=b.branch[f];(p==null?void 0:p.data)!==(u==null?void 0:u.data)&&(d=!0),p&&(l={...l,...p.data},d&&(c.props[`data_${h}`]=l),h+=1)}return(!b.url||e.href!==b.url.href||b.error!==a||i!==void 0&&i!==T.form||d)&&(c.props.page={error:a,params:t,route:{id:(s==null?void 0:s.id)??null},state:{},status:r,url:new URL(e),form:i??null,data:d?l:T.data}),c}async function Pe({loader:e,parent:t,url:n,params:r,route:a,server_data_node:s}){var d,h,y;let i=null,o=!0;const c={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},l=await e();if((d=l.universal)!=null&&d.load){let f=function(...u){for(const g of u){const{href:_}=new URL(g,n);c.dependencies.add(_)}};const p={tracing:{enabled:!1,root:qe,current:qe},route:new Proxy(a,{get:(u,g)=>(o&&(c.route=!0),u[g])}),params:new Proxy(r,{get:(u,g)=>(o&&c.params.add(g),u[g])}),data:(s==null?void 0:s.data)??null,url:Ft(n,()=>{o&&(c.url=!0)},u=>{o&&c.search_params.add(u)},k.hash),async fetch(u,g){u instanceof Request&&(g={body:u.method==="GET"||u.method==="HEAD"?void 0:await u.blob(),cache:u.cache,credentials:u.credentials,headers:[...u.headers].length>0?u==null?void 0:u.headers:void 0,integrity:u.integrity,keepalive:u.keepalive,method:u.method,mode:u.mode,redirect:u.redirect,referrer:u.referrer,referrerPolicy:u.referrerPolicy,signal:u.signal,...g});const{resolved:_,promise:I}=gt(u,g,n);return o&&f(_.href),I},setHeaders:()=>{},depends:f,parent(){return o&&(c.parent=!0),t()},untrack(u){o=!1;try{return u()}finally{o=!0}}};i=await l.universal.load.call(null,p)??null}return{node:l,loader:e,server:s,universal:(h=l.universal)!=null&&h.load?{type:"data",data:i,uses:c}:null,data:i??(s==null?void 0:s.data)??null,slash:((y=l.universal)==null?void 0:y.trailingSlash)??(s==null?void 0:s.slash)}}function gt(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const s=re?Yt(r,a.href,t):Gt(r,t);return{resolved:a,promise:s}}function Ke(e,t,n,r,a,s){if(Ce)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(s[i]!==b.params[i])return!0;for(const i of a.dependencies)if(ne.some(o=>o(new URL(i))))return!0;return!1}function Oe(e,t){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?t??null:null}function $n(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),s=t.searchParams.getAll(r);a.every(i=>s.includes(i))&&s.every(i=>a.includes(i))&&n.delete(r)}return n}function We({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:je(T),constructors:[]}}}async function mt({id:e,invalidating:t,url:n,params:r,route:a,preload:s}){if((U==null?void 0:U.id)===e)return H.delete(U.token),U.promise;const{errors:i,layouts:o,leaf:c}=a,l=[...o,c];i.forEach(w=>w==null?void 0:w().catch(()=>{})),l.forEach(w=>w==null?void 0:w[1]().catch(()=>{}));let d=null;const h=b.url?e!==se(b.url):!1,y=b.route?a.id!==b.route.id:!1,f=$n(b.url,n);let p=!1;const u=l.map((w,m)=>{var P;const v=b.branch[m],S=!!(w!=null&&w[0])&&((v==null?void 0:v.loader)!==w[1]||Ke(p,y,h,f,(P=v.server)==null?void 0:P.uses,r));return S&&(p=!0),S});if(u.some(Boolean)){try{d=await yt(n,u)}catch(w){const m=await V(w,{url:n,params:r,route:{id:e}});return H.has(s)?We({error:m,url:n,params:r,route:a}):ue({status:ee(w),error:m,url:n,route:a})}if(d.type==="redirect")return d}const g=d==null?void 0:d.nodes;let _=!1;const I=l.map(async(w,m)=>{var he;if(!w)return;const v=b.branch[m],S=g==null?void 0:g[m];if((!S||S.type==="skip")&&w[1]===(v==null?void 0:v.loader)&&!Ke(_,y,h,f,(he=v.universal)==null?void 0:he.uses,r))return v;if(_=!0,(S==null?void 0:S.type)==="error")throw S;return Pe({loader:w[1],url:n,params:r,route:a,parent:async()=>{var Fe;const De={};for(let pe=0;pe<m;pe+=1)Object.assign(De,(Fe=await I[pe])==null?void 0:Fe.data);return De},server_data_node:Oe(S===void 0&&w[0]?{type:"skip"}:S??null,w[0]?v==null?void 0:v.server:void 0)})});for(const w of I)w.catch(()=>{});const E=[];for(let w=0;w<l.length;w+=1)if(l[w])try{E.push(await I[w])}catch(m){if(m instanceof Re)return{type:"redirect",location:m.location};if(H.has(s))return We({error:await V(m,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let v=ee(m),S;if(g!=null&&g.includes(m))v=m.status??v,S=m.error;else if(m instanceof ie)S=m.body;else{if(await C.updated.check())return await ct(),await q(n);S=await V(m,{params:r,url:n,route:{id:a.id}})}const P=await xn(w,E,i);return P?oe({url:n,params:r,branch:E.slice(0,P.idx).concat(P.node),status:v,error:S,route:a}):await wt(n,{id:a.id},S,v)}else E.push(void 0);return oe({url:n,params:r,branch:E,status:200,error:null,route:a,form:t?void 0:null})}async function xn(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function ue({status:e,error:t,url:n,route:r}){const a={};let s=null;if(k.server_loads[0]===0)try{const o=await yt(n,[!0]);if(o.type!=="data"||o.nodes[0]&&o.nodes[0].type!=="data")throw 0;s=o.nodes[0]??null}catch{(n.origin!==ce||n.pathname!==location.pathname||xe)&&await q(n)}try{const o=await Pe({loader:ke,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Oe(s)}),c={node:await te(),loader:te,universal:null,server:null,data:null};return oe({url:n,params:a,branch:[o,c],status:e,error:t,route:null})}catch(o){if(o instanceof Re)return Un(new URL(o.location,location.href),{},0);throw o}}async function Cn(e){const t=e.href;if(Z.has(t))return Z.get(t);let n;try{const r=(async()=>{let a=await k.hooks.reroute({url:new URL(e),fetch:async(s,i)=>gt(s,i,e).promise})??e;if(typeof a=="string"){const s=new URL(e);k.hash?s.hash=a:s.pathname=a,a=s}return a})();Z.set(t,r),n=await r}catch{Z.delete(t);return}return n}async function de(e,t){if(e&&!fe(e,$,k.hash)){const n=await Cn(e);if(!n)return;const r=Pn(n);for(const a of $e){const s=a.exec(r);if(s)return{id:se(e),invalidating:t,route:a,params:Dt(s),url:e}}}}function Pn(e){return jt(k.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice($.length))||"/"}function se(e){return(k.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function _t({url:e,type:t,intent:n,delta:r,event:a}){let s=!1;const i=Ne(b,n,e,t);r!==void 0&&(i.navigation.delta=r),a!==void 0&&(i.navigation.event=a);const o={...i.navigation,cancel:()=>{s=!0,i.reject(new Error("navigation cancelled"))}};return X||lt.forEach(c=>c(o)),s?null:i}async function M({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i={},redirect_count:o=0,nav_token:c={},accept:l=Ge,block:d=Ge,event:h}){const y=N;N=c;const f=await de(t,!1),p=e==="enter"?Ne(b,f,t,e):_t({url:t,type:e,delta:n==null?void 0:n.delta,intent:f,event:h});if(!p){d(),N===c&&(N=y);return}const u=A,g=L;l(),X=!0,re&&p.navigation.type!=="enter"&&C.navigating.set(W.current=p.navigation);let _=f&&await mt(f);if(!_){if(fe(t,$,k.hash))return await q(t,s);_=await wt(t,{id:null},await V(new Te(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,s)}if(t=(f==null?void 0:f.url)||t,N!==c)return p.reject(new Error("navigation aborted")),!1;if(_.type==="redirect"){if(o<20){await M({type:e,url:new URL(_.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i,redirect_count:o+1,nav_token:c}),p.fulfil(void 0);return}_=await ue({status:500,error:await V(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else _.props.page.status>=400&&await C.updated.check()&&(await ct(),await q(t,s));if(In(),Le(u),dt(g),_.props.page.url.pathname!==t.pathname&&(t.pathname=_.props.page.url.pathname),i=n?n.state:i,!n){const m=s?0:1,v={[B]:A+=m,[K]:L+=m,[nt]:i};(s?history.replaceState:history.pushState).call(history,v,"",t),s||Rn(A,L)}if(U=null,_.props.page.state=i,re){const m=(await Promise.all(Array.from(Tn,v=>v(p.navigation)))).filter(v=>typeof v=="function");if(m.length>0){let v=function(){m.forEach(S=>{z.delete(S)})};m.push(v),m.forEach(S=>{z.add(S)})}b=_.state,_.props.page&&(_.props.page.url=t),ut.$set(_.props),yn(_.props.page),ft=!0}else pt(_,Ee,!1);const{activeElement:I}=document;await En();let E=n?n.scroll:a?le():null;if(Ye){const m=t.hash&&document.getElementById(bt(t));if(E)scrollTo(E.x,E.y);else if(m){m.scrollIntoView();const{top:v,left:S}=m.getBoundingClientRect();E={x:pageXOffset+S,y:pageYOffset+v}}else scrollTo(0,0)}const w=document.activeElement!==I&&document.activeElement!==document.body;!r&&!w&&Fn(t,E),Ye=!0,_.props.page&&Object.assign(T,_.props.page),X=!1,e==="popstate"&&ht(L),p.fulfil(void 0),z.forEach(m=>m(p.navigation)),C.navigating.set(W.current=null)}async function wt(e,t,n,r,a){return e.origin===ce&&e.pathname===location.pathname&&!xe?await ue({status:r,error:n,url:e,route:t}):await q(e,a)}function On(){let e,t,n;x.addEventListener("mousemove",o=>{const c=o.target;clearTimeout(e),e=setTimeout(()=>{s(c,O.hover)},20)});function r(o){o.defaultPrevented||s(o.composedPath()[0],O.tap)}x.addEventListener("mousedown",r),x.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const c of o)c.isIntersecting&&(ye(new URL(c.target.href)),a.unobserve(c.target))},{threshold:0});async function s(o,c){const l=ot(o,x),d=l===t&&c>=n;if(!l||d)return;const{url:h,external:y,download:f}=Se(l,$,k.hash);if(y||f)return;const p=Q(l),u=h&&se(b.url)===se(h);if(!(p.reload||u))if(c<=p.preload_data){t=l,n=O.tap;const g=await de(h,!1);if(!g)return;Ln(g)}else c<=p.preload_code&&(t=l,n=c,ye(h))}function i(){a.disconnect();for(const o of x.querySelectorAll("a")){const{url:c,external:l,download:d}=Se(o,$,k.hash);if(l||d)continue;const h=Q(o);h.reload||(h.preload_code===O.viewport&&a.observe(o),h.preload_code===O.eager&&ye(c))}}z.add(i),i()}function V(e,t){if(e instanceof ie)return e.body;const n=ee(e),r=_n(e);return k.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Nn(e){if(typeof e=="function")ne.push(e);else{const{href:t}=new URL(e,location.href);ne.push(n=>n.href===t)}}function jn(){var t;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let r=!1;if(He(),!X){const a=Ne(b,void 0,null,"leave"),s={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};lt.forEach(i=>i(s))}r?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&He()}),(t=navigator.connection)!=null&&t.saveData||On(),x.addEventListener("click",async n=>{if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const r=ot(n.composedPath()[0],x);if(!r)return;const{url:a,external:s,target:i,download:o}=Se(r,$,k.hash);if(!a)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const c=Q(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||o)return;const[d,h]=(k.hash?a.hash.replace(/^#/,""):a.href).split("#"),y=d===me(location);if(s||c.reload&&(!y||!h)){_t({url:a,type:"link",event:n})?X=!0:n.preventDefault();return}if(h!==void 0&&y){const[,f]=b.url.href.split("#");if(f===h){if(n.preventDefault(),h===""||h==="top"&&r.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const p=r.ownerDocument.getElementById(decodeURIComponent(h));p&&(p.scrollIntoView(),p.focus())}return}if(G=!0,Le(A),e(a),!c.replace_state)return;G=!1}n.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await M({type:"link",url:a,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??a.href===location.href,event:n})}),x.addEventListener("submit",n=>{if(n.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formTarget)||r.target)==="_blank"||((a==null?void 0:a.formMethod)||r.method)!=="get")return;const o=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(fe(o,$,!1))return;const c=n.target,l=Q(c);if(l.reload)return;n.preventDefault(),n.stopPropagation();const d=new FormData(c,a);o.search=new URLSearchParams(d).toString(),M({type:"form",url:o,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??o.href===location.href,event:n})}),addEventListener("popstate",async n=>{var r;if(!Ae){if((r=n.state)!=null&&r[B]){const a=n.state[B];if(N={},a===A)return;const s=j[a],i=n.state[nt]??{},o=new URL(n.state[en]??location.href),c=n.state[K],l=b.url?me(location)===me(b.url):!1;if(c===L&&(ft||l)){i!==T.state&&(T.state=i),e(o),j[A]=le(),s&&scrollTo(s.x,s.y),A=a;return}const h=a-A;await M({type:"popstate",url:o,popped:{state:i,scroll:s,delta:h},accept:()=>{A=a,L=c},block:()=>{history.go(-h)},nav_token:N,event:n})}else if(!G){const a=new URL(location.href);e(a),k.hash&&location.reload()}}}),addEventListener("hashchange",()=>{G&&(G=!1,history.replaceState({...history.state,[B]:++A,[K]:L},"",location.href))});for(const n of document.querySelectorAll("link"))An.has(n.rel)&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&C.navigating.set(W.current=null)});function e(n){b.url=T.url=n,C.page.set(je(T)),C.page.notify()}}async function Dn(e,{status:t=200,error:n,node_ids:r,params:a,route:s,server_route:i,data:o,form:c}){xe=!0;const l=new URL(location.href);let d;({params:a={},route:s={id:null}}=await de(l,!1)||{}),d=$e.find(({id:f})=>f===s.id);let h,y=!0;try{const f=r.map(async(u,g)=>{const _=o[g];return _!=null&&_.uses&&(_.uses=vt(_.uses)),Pe({loader:k.nodes[u],url:l,params:a,route:s,parent:async()=>{const I={};for(let E=0;E<g;E+=1)Object.assign(I,(await f[E]).data);return I},server_data_node:Oe(_)})}),p=await Promise.all(f);if(d){const u=d.layouts;for(let g=0;g<u.length;g++)u[g]||p.splice(g,0,void 0)}h=oe({url:l,params:a,branch:p,status:t,error:n,form:c,route:d??null})}catch(f){if(f instanceof Re){await q(new URL(f.location,location.href));return}h=await ue({status:ee(f),error:await V(f,{url:l,params:a,route:s}),url:l,route:s}),e.textContent="",y=!1}h.props.page&&(h.props.page.state={}),pt(h,e,y)}async function yt(e,t){var s;const n=new URL(e);n.pathname=Sn(e.pathname),e.pathname.endsWith("/")&&n.searchParams.append(mn,"1"),n.searchParams.append(gn,t.map(i=>i?"1":"0").join(""));const r=window.fetch,a=await r(n.href,{});if(!a.ok){let i;throw(s=a.headers.get("content-type"))!=null&&s.includes("application/json")?i=await a.json():a.status===404?i="Not Found":a.status===500&&(i="Internal Error"),new ie(a.status,i)}return new Promise(async i=>{var h;const o=new Map,c=a.body.getReader();function l(y){return dn(y,{...k.decoders,Promise:f=>new Promise((p,u)=>{o.set(f,{fulfil:p,reject:u})})})}let d="";for(;;){const{done:y,value:f}=await c.read();if(y&&!d)break;for(d+=!f&&d?`
2
+ `:Mt.decode(f,{stream:!0});;){const p=d.indexOf(`
3
+ `);if(p===-1)break;const u=JSON.parse(d.slice(0,p));if(d=d.slice(p+1),u.type==="redirect")return i(u);if(u.type==="data")(h=u.nodes)==null||h.forEach(g=>{(g==null?void 0:g.type)==="data"&&(g.uses=vt(g.uses),g.data=l(g.data))}),i(u);else if(u.type==="chunk"){const{id:g,data:_,error:I}=u,E=o.get(g);o.delete(g),I?E.reject(l(I)):E.fulfil(l(_))}}}})}function vt(e){return{dependencies:new Set((e==null?void 0:e.dependencies)??[]),params:new Set((e==null?void 0:e.params)??[]),parent:!!(e!=null&&e.parent),route:!!(e!=null&&e.route),url:!!(e!=null&&e.url),search_params:new Set((e==null?void 0:e.search_params)??[])}}let Ae=!1;function Fn(e,t=null){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=bt(e);if(r&&document.getElementById(r)){const{x:s,y:i}=t??le();setTimeout(()=>{const o=history.state;Ae=!0,location.replace(`#${r}`),k.hash&&location.replace(e.hash),history.replaceState(o,"",e.hash),scrollTo(s,i),Ae=!1})}else{const s=document.body,i=s.getAttribute("tabindex");s.tabIndex=-1,s.focus({preventScroll:!0,focusVisible:!1}),i!==null?s.setAttribute("tabindex",i):s.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const s=[];for(let i=0;i<a.rangeCount;i+=1)s.push(a.getRangeAt(i));setTimeout(()=>{if(a.rangeCount===s.length){for(let i=0;i<a.rangeCount;i+=1){const o=s[i],c=a.getRangeAt(i);if(o.commonAncestorContainer!==c.commonAncestorContainer||o.startContainer!==c.startContainer||o.endContainer!==c.endContainer||o.startOffset!==c.startOffset||o.endOffset!==c.endOffset)return}a.removeAllRanges()}})}}}function Ne(e,t,n,r){var c,l;let a,s;const i=new Promise((d,h)=>{a=d,s=h});return i.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:((c=e.route)==null?void 0:c.id)??null},url:e.url},to:n&&{params:(t==null?void 0:t.params)??null,route:{id:((l=t==null?void 0:t.route)==null?void 0:l.id)??null},url:n},willUnload:!t,type:r,complete:i},fulfil:a,reject:s}}function je(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function Bn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function bt(e){let t;if(k.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Hn as a,qn as l,C as s};
hfstudio/static/_app/immutable/entry/app.CdRJjHnj.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.B7aAWi3z.js","../chunks/MT0Fezl8.js","../chunks/IHki7fMi.js","../assets/0.BqmMj_TK.css","../nodes/1.C7DZkBQo.js","../chunks/H9bLuign.js","../nodes/2.DPbkTEMF.js","../assets/2.BoAMr1TJ.css"])))=>i.map(i=>d[i]);
2
+ import{S as T,i as V,s as B,d,o as h,p as g,C as S,D as O,b as E,h as U,E as w,k as z,F,z as G,G as H,H as y,I as P,J as R,K as L,L as I,q as A,M as p,e as J,f as K,j as W,N as C,a as Q,g as X,t as Y}from"../chunks/MT0Fezl8.js";import"../chunks/IHki7fMi.js";const Z="modulepreload",M=function(o,e){return new URL(o,e).href},N={},D=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){const t=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));r=Promise.allSettled(n.map(f=>{if(f=M(f,i),f in N)return;N[f]=!0;const l=f.endsWith(".css"),_=l?'[rel="stylesheet"]':"";if(!!i)for(let k=t.length-1;k>=0;k--){const v=t[k];if(v.href===f&&(!l||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${_}`))return;const m=document.createElement("link");if(m.rel=l?"stylesheet":Z,l||(m.as="script"),m.crossOrigin="",m.href=f,a&&m.setAttribute("nonce",a),document.head.appendChild(m),l)return new Promise((k,v)=>{m.addEventListener("load",k),m.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${f}`)))})}))}function u(t){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=t,window.dispatchEvent(s),!s.defaultPrevented)throw t}return r.then(t=>{for(const s of t||[])s.status==="rejected"&&u(s.reason);return e().catch(u)})},ae={};function $(o){let e,n,i;var r=o[2][0];function u(t,s){return{props:{data:t[4],form:t[3],params:t[1].params}}}return r&&(e=y(r,u(o)),o[12](e)),{c(){e&&R(e.$$.fragment),n=w()},l(t){e&&I(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),E(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][0])){if(e){S();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),O()}r?(e=y(r,u(t)),t[12](e),R(e.$$.fragment),g(e.$$.fragment,1),L(e,n.parentNode,n)):e=null}else if(r){const a={};s&16&&(a.data=t[4]),s&8&&(a.form=t[3]),s&2&&(a.params=t[1].params),e.$set(a)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){t&&d(n),o[12](null),e&&P(e,t)}}}function x(o){let e,n,i;var r=o[2][0];function u(t,s){return{props:{data:t[4],params:t[1].params,$$slots:{default:[ee]},$$scope:{ctx:t}}}}return r&&(e=y(r,u(o)),o[11](e)),{c(){e&&R(e.$$.fragment),n=w()},l(t){e&&I(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),E(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][0])){if(e){S();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),O()}r?(e=y(r,u(t)),t[11](e),R(e.$$.fragment),g(e.$$.fragment,1),L(e,n.parentNode,n)):e=null}else if(r){const a={};s&16&&(a.data=t[4]),s&2&&(a.params=t[1].params),s&8239&&(a.$$scope={dirty:s,ctx:t}),e.$set(a)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){t&&d(n),o[11](null),e&&P(e,t)}}}function ee(o){let e,n,i;var r=o[2][1];function u(t,s){return{props:{data:t[5],form:t[3],params:t[1].params}}}return r&&(e=y(r,u(o)),o[10](e)),{c(){e&&R(e.$$.fragment),n=w()},l(t){e&&I(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),E(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][1])){if(e){S();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),O()}r?(e=y(r,u(t)),t[10](e),R(e.$$.fragment),g(e.$$.fragment,1),L(e,n.parentNode,n)):e=null}else if(r){const a={};s&32&&(a.data=t[5]),s&8&&(a.form=t[3]),s&2&&(a.params=t[1].params),e.$set(a)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){t&&d(n),o[10](null),e&&P(e,t)}}}function j(o){let e,n=o[7]&&q(o);return{c(){e=W("div"),n&&n.c(),this.h()},l(i){e=J(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var r=K(e);n&&n.l(r),r.forEach(d),this.h()},h(){A(e,"id","svelte-announcer"),A(e,"aria-live","assertive"),A(e,"aria-atomic","true"),p(e,"position","absolute"),p(e,"left","0"),p(e,"top","0"),p(e,"clip","rect(0 0 0 0)"),p(e,"clip-path","inset(50%)"),p(e,"overflow","hidden"),p(e,"white-space","nowrap"),p(e,"width","1px"),p(e,"height","1px")},m(i,r){E(i,e,r),n&&n.m(e,null)},p(i,r){i[7]?n?n.p(i,r):(n=q(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&d(e),n&&n.d()}}}function q(o){let e;return{c(){e=Y(o[8])},l(n){e=X(n,o[8])},m(n,i){E(n,e,i)},p(n,i){i&256&&Q(e,n[8])},d(n){n&&d(e)}}}function te(o){let e,n,i,r,u;const t=[x,$],s=[];function a(l,_){return l[2][1]?0:1}e=a(o),n=s[e]=t[e](o);let f=o[6]&&j(o);return{c(){n.c(),i=z(),f&&f.c(),r=w()},l(l){n.l(l),i=U(l),f&&f.l(l),r=w()},m(l,_){s[e].m(l,_),E(l,i,_),f&&f.m(l,_),E(l,r,_),u=!0},p(l,[_]){let b=e;e=a(l),e===b?s[e].p(l,_):(S(),h(s[b],1,1,()=>{s[b]=null}),O(),n=s[e],n?n.p(l,_):(n=s[e]=t[e](l),n.c()),g(n,1),n.m(i.parentNode,i)),l[6]?f?f.p(l,_):(f=j(l),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},i(l){u||(g(n),u=!0)},o(l){h(n),u=!1},d(l){l&&(d(i),d(r)),s[e].d(l),f&&f.d(l)}}}function ne(o,e,n){let{stores:i}=e,{page:r}=e,{constructors:u}=e,{components:t=[]}=e,{form:s}=e,{data_0:a=null}=e,{data_1:f=null}=e;F(i.page.notify);let l=!1,_=!1,b=null;G(()=>{const c=i.page.subscribe(()=>{l&&(n(7,_=!0),H().then(()=>{n(8,b=document.title||"untitled page")}))});return n(6,l=!0),c});function m(c){C[c?"unshift":"push"](()=>{t[1]=c,n(0,t)})}function k(c){C[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}function v(c){C[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}return o.$$set=c=>{"stores"in c&&n(9,i=c.stores),"page"in c&&n(1,r=c.page),"constructors"in c&&n(2,u=c.constructors),"components"in c&&n(0,t=c.components),"form"in c&&n(3,s=c.form),"data_0"in c&&n(4,a=c.data_0),"data_1"in c&&n(5,f=c.data_1)},o.$$.update=()=>{o.$$.dirty&514&&i.page.set(r)},[t,r,u,s,a,f,l,_,b,i,m,k,v]}class le extends T{constructor(e){super(),V(this,e,ne,te,B,{stores:9,page:1,constructors:2,components:0,form:3,data_0:4,data_1:5})}}const fe=[()=>D(()=>import("../nodes/0.B7aAWi3z.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),()=>D(()=>import("../nodes/1.C7DZkBQo.js"),__vite__mapDeps([4,1,2,5]),import.meta.url),()=>D(()=>import("../nodes/2.DPbkTEMF.js"),__vite__mapDeps([6,1,2,7]),import.meta.url)],ce=[],ue={"/":[2]},se={handleError:({error:o})=>{console.error(o)},reroute:()=>{},transport:{}},ie=Object.fromEntries(Object.entries(se.transport).map(([o,e])=>[o,e.decode])),_e=!1,me=(o,e)=>ie[o](e);export{me as decode,ie as decoders,ue as dictionary,_e as hash,se as hooks,ae as matchers,fe as nodes,le as root,ce as server_loads};
hfstudio/static/_app/immutable/entry/start.B9QfSl3B.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{l as o,a as r}from"../chunks/H9bLuign.js";export{o as load_css,r as start};
hfstudio/static/_app/immutable/nodes/0.B7aAWi3z.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ import{S as Ie,i as He,s as Ee,m as Me,d as m,r as Te,o as Se,p as Pe,q as a,u as Ne,v as Ae,w as De,b as Q,c as n,x as se,e as r,f as A,y as L,h as b,j as i,k as v,z as je,n as Ce,A as be,a as Le,g as pe,t as he,B as Be}from"../chunks/MT0Fezl8.js";import"../chunks/IHki7fMi.js";function ve(u){let t,e,l='<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg>',o,h,s='Hugging Face <span class="bg-gradient-to-r from-purple-500 via-pink-500 via-green-500 to-blue-500 bg-clip-text text-transparent font-bold">PRO</span>',c,k,B=`Sign in to with your Hugging Face <a href="https://huggingface.co/pro" target="_blank" class="text-amber-600 hover:text-amber-700 underline font-medium">PRO account</a> to get started with $2 of free API credits per month. You can add a billing method for
2
+ additional pay-as-you-go usage ‡`,f,w;return{c(){t=i("div"),e=i("button"),e.innerHTML=l,o=v(),h=i("p"),h.innerHTML=s,c=v(),k=i("p"),k.innerHTML=B,this.h()},l(O){t=r(O,"DIV",{class:!0});var C=A(t);e=r(C,"BUTTON",{class:!0,"aria-label":!0,"data-svelte-h":!0}),L(e)!=="svelte-1ywh7al"&&(e.innerHTML=l),o=b(C),h=r(C,"P",{class:!0,"data-svelte-h":!0}),L(h)!=="svelte-1k9uu9c"&&(h.innerHTML=s),c=b(C),k=r(C,"P",{class:!0,"data-svelte-h":!0}),L(k)!=="svelte-s4eiw5"&&(k.innerHTML=B),C.forEach(m),this.h()},h(){a(e,"class","absolute top-2 right-2 text-gray-400 hover:text-gray-600 transition-colors"),a(e,"aria-label","Dismiss"),a(h,"class","text-sm font-medium text-gray-700 mb-1 pr-4"),a(k,"class","text-sm text-gray-600 pr-4"),a(t,"class","mb-3 px-3 py-2 bg-gradient-to-r from-amber-50 to-orange-50 rounded-lg border border-amber-200 relative")},m(O,C){Q(O,t,C),n(t,e),n(t,o),n(t,h),n(t,c),n(t,k),f||(w=se(e,"click",u[15]),f=!0)},p:Ce,d(O){O&&m(t),f=!1,w()}}}function xe(u){let t;return{c(){t=i("div"),this.h()},l(e){t=r(e,"DIV",{class:!0}),A(t).forEach(m),this.h()},h(){a(t,"class","absolute inset-0 -left-full animate-sweep bg-gradient-to-r from-transparent via-orange-400/40 to-transparent svelte-1s3xy1i")},m(e,l){Q(e,t,l)},d(e){e&&m(t)}}}function Oe(u){let t,e,l,o,h="Sign In";return{c(){t=i("img"),l=v(),o=i("span"),o.textContent=h,this.h()},l(s){t=r(s,"IMG",{src:!0,alt:!0,class:!0}),l=b(s),o=r(s,"SPAN",{class:!0,"data-svelte-h":!0}),L(o)!=="svelte-b2ltkx"&&(o.textContent=h),this.h()},h(){Be(t.src,e="/assets/hf-logo.png")||a(t,"src",e),a(t,"alt","HF Logo"),a(t,"class","w-5 h-5 relative z-10"),a(o,"class","relative z-10")},m(s,c){Q(s,t,c),Q(s,l,c),Q(s,o,c)},p:Ce,d(s){s&&(m(t),m(l),m(o))}}}function Ve(u){let t,e,l;return{c(){t=i("span"),e=he("πŸ‘‹ Logout, "),l=he(u[2]),this.h()},l(o){t=r(o,"SPAN",{class:!0});var h=A(t);e=pe(h,"πŸ‘‹ Logout, "),l=pe(h,u[2]),h.forEach(m),this.h()},h(){a(t,"class","relative z-10")},m(o,h){Q(o,t,h),n(t,e),n(t,l)},p(o,h){h&4&&Le(l,o[2])},d(o){o&&m(t)}}}function we(u){let t,e,l,o="Sign In with HuggingFace Token",h,s,c,k="<strong>Manual Token Entry:</strong> Please enter your HuggingFace token.",B,f,w=`1. Go to <a href="https://huggingface.co/settings/tokens" target="_blank" class="underline text-blue-600">HuggingFace Settings</a><br/>
3
+ 2. Create a new token with &quot;Inference API&quot; permissions<br/>
4
+ 3. Copy and paste it below`,O,C,y,V,X="HuggingFace Token",W,x,Z,K,I,R,ee="Cancel",U,d,F="Sign In",T,D,_=u[6]&&ye(),p=u[5]&&ke(u);return{c(){t=i("div"),e=i("div"),l=i("h2"),l.textContent=o,h=v(),s=i("div"),c=i("p"),c.innerHTML=k,B=v(),f=i("p"),f.innerHTML=w,O=v(),_&&_.c(),C=v(),y=i("div"),V=i("label"),V.textContent=X,W=v(),x=i("input"),Z=v(),p&&p.c(),K=v(),I=i("div"),R=i("button"),R.textContent=ee,U=v(),d=i("button"),d.textContent=F,this.h()},l(M){t=r(M,"DIV",{class:!0});var G=A(t);e=r(G,"DIV",{class:!0});var E=A(e);l=r(E,"H2",{class:!0,"data-svelte-h":!0}),L(l)!=="svelte-1t0ehet"&&(l.textContent=o),h=b(E),s=r(E,"DIV",{class:!0});var Y=A(s);c=r(Y,"P",{class:!0,"data-svelte-h":!0}),L(c)!=="svelte-344vn4"&&(c.innerHTML=k),B=b(Y),f=r(Y,"P",{class:!0,"data-svelte-h":!0}),L(f)!=="svelte-orsfwv"&&(f.innerHTML=w),O=b(Y),_&&_.l(Y),Y.forEach(m),C=b(E),y=r(E,"DIV",{class:!0});var H=A(y);V=r(H,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),L(V)!=="svelte-vtbmxo"&&(V.textContent=X),W=b(H),x=r(H,"INPUT",{id:!0,type:!0,placeholder:!0,class:!0}),Z=b(H),p&&p.l(H),H.forEach(m),K=b(E),I=r(E,"DIV",{class:!0});var $=A(I);R=r($,"BUTTON",{class:!0,"data-svelte-h":!0}),L(R)!=="svelte-csk0rj"&&(R.textContent=ee),U=b($),d=r($,"BUTTON",{class:!0,"data-svelte-h":!0}),L(d)!=="svelte-1nxas5u"&&(d.textContent=F),$.forEach(m),E.forEach(m),G.forEach(m),this.h()},h(){a(l,"class","text-xl font-semibold mb-4"),a(c,"class","text-blue-800 mb-2"),a(f,"class","text-blue-700"),a(s,"class","mb-4 p-3 bg-blue-50 rounded-md text-sm"),a(V,"for","token"),a(V,"class","block text-sm font-medium text-gray-700 mb-2"),a(x,"id","token"),a(x,"type","password"),a(x,"placeholder","hf_..."),a(x,"class","w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500 focus:border-transparent"),a(y,"class","mb-4"),a(R,"class","px-4 py-2 text-gray-600 hover:text-gray-800 transition-colors"),a(d,"class","px-4 py-2 bg-orange-500 text-white rounded-md hover:bg-orange-600 transition-colors"),a(I,"class","flex justify-end gap-3"),a(e,"class","bg-white rounded-lg p-6 max-w-md w-full mx-4 shadow-xl"),a(t,"class","fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50")},m(M,G){Q(M,t,G),n(t,e),n(e,l),n(e,h),n(e,s),n(s,c),n(s,B),n(s,f),n(s,O),_&&_.m(s,null),n(e,C),n(e,y),n(y,V),n(y,W),n(y,x),be(x,u[4]),n(y,Z),p&&p.m(y,null),n(e,K),n(e,I),n(I,R),n(I,U),n(I,d),T||(D=[se(x,"input",u[16]),se(x,"keydown",u[17]),se(R,"click",u[10]),se(d,"click",u[11])],T=!0)},p(M,G){M[6]?_||(_=ye(),_.c(),_.m(s,null)):_&&(_.d(1),_=null),G&16&&x.value!==M[4]&&be(x,M[4]),M[5]?p?p.p(M,G):(p=ke(M),p.c(),p.m(y,null)):p&&(p.d(1),p=null)},d(M){M&&m(t),_&&_.d(),p&&p.d(),T=!1,Te(D)}}}function ye(u){let t,e=`<strong>Tip:</strong> You can also run <code>huggingface-cli login</code> in your terminal
5
+ to automatically use your local token.`;return{c(){t=i("p"),t.innerHTML=e,this.h()},l(l){t=r(l,"P",{class:!0,"data-svelte-h":!0}),L(t)!=="svelte-xrut8w"&&(t.innerHTML=e),this.h()},h(){a(t,"class","text-blue-600 mt-2")},m(l,o){Q(l,t,o)},d(l){l&&m(t)}}}function ke(u){let t,e;return{c(){t=i("p"),e=he(u[5]),this.h()},l(l){t=r(l,"P",{class:!0});var o=A(t);e=pe(o,u[5]),o.forEach(m),this.h()},h(){a(t,"class","text-red-600 text-sm mt-1")},m(l,o){Q(l,t,o),n(t,e)},p(l,o){o&32&&Le(e,l[5])},d(l){l&&m(t)}}}function Ue(u){let t,e,l,o='<div class="flex items-center gap-3"><img src="/assets/hf-studio-logo.png" alt="HF Logo" class="w-8 h-8"/> <h1 class="text-xl font-semibold">HFStudio<sup class="text-xs text-gray-500 ml-1">BETA</sup></h1></div>',h,s,c,k="Tasks",B,f,w,O="πŸŽ™οΈ",C,y,V="Text to Speech",X,W,x,Z="<span>🎡</span> <span>Voice Cloning</span>",K,I,R="<span>🎧</span> <span>Speech to Text</span>",ee,U,d="<span>🎼</span> <span>Sound Effects</span>",F,T,D="<span>🎸</span> <span>Music Generation</span>",_,p,M="<span>πŸ”Š</span> <span>Audio Enhancement</span>",G,E,Y,H,$,ue,ne,ce,te,fe,ge,S=!u[1]&&u[7]&&ve(u),j=u[8]&&xe();function me(g,N){return g[1]?Ve:Oe}let ae=me(u),J=ae(u);const de=u[13].default,q=Me(de,u,u[12],null);let P=u[3]&&we(u);return{c(){t=i("div"),e=i("aside"),l=i("div"),l.innerHTML=o,h=v(),s=i("nav"),c=i("div"),c.textContent=k,B=v(),f=i("button"),w=i("span"),w.textContent=O,C=v(),y=i("span"),y.textContent=V,W=v(),x=i("button"),x.innerHTML=Z,K=v(),I=i("button"),I.innerHTML=R,ee=v(),U=i("button"),U.innerHTML=d,F=v(),T=i("button"),T.innerHTML=D,_=v(),p=i("button"),p.innerHTML=M,G=v(),E=i("div"),S&&S.c(),Y=v(),H=i("button"),j&&j.c(),$=v(),J.c(),ue=v(),ne=i("main"),q&&q.c(),ce=v(),P&&P.c(),this.h()},l(g){t=r(g,"DIV",{class:!0});var N=A(t);e=r(N,"ASIDE",{class:!0});var le=A(e);l=r(le,"DIV",{class:!0,"data-svelte-h":!0}),L(l)!=="svelte-60or62"&&(l.innerHTML=o),h=b(le),s=r(le,"NAV",{class:!0});var z=A(s);c=r(z,"DIV",{class:!0,"data-svelte-h":!0}),L(c)!=="svelte-pii1fa"&&(c.textContent=k),B=b(z),f=r(z,"BUTTON",{class:!0});var oe=A(f);w=r(oe,"SPAN",{"data-svelte-h":!0}),L(w)!=="svelte-1yx42xi"&&(w.textContent=O),C=b(oe),y=r(oe,"SPAN",{"data-svelte-h":!0}),L(y)!=="svelte-2j89jk"&&(y.textContent=V),oe.forEach(m),W=b(z),x=r(z,"BUTTON",{class:!0,"data-svelte-h":!0}),L(x)!=="svelte-10dl8nf"&&(x.innerHTML=Z),K=b(z),I=r(z,"BUTTON",{class:!0,"data-svelte-h":!0}),L(I)!=="svelte-wf0x5d"&&(I.innerHTML=R),ee=b(z),U=r(z,"BUTTON",{class:!0,"data-svelte-h":!0}),L(U)!=="svelte-x7bha3"&&(U.innerHTML=d),F=b(z),T=r(z,"BUTTON",{class:!0,"data-svelte-h":!0}),L(T)!=="svelte-1tyblmt"&&(T.innerHTML=D),_=b(z),p=r(z,"BUTTON",{class:!0,"data-svelte-h":!0}),L(p)!=="svelte-1emrjb3"&&(p.innerHTML=M),z.forEach(m),G=b(le),E=r(le,"DIV",{class:!0});var re=A(E);S&&S.l(re),Y=b(re),H=r(re,"BUTTON",{class:!0});var ie=A(H);j&&j.l(ie),$=b(ie),J.l(ie),ie.forEach(m),re.forEach(m),le.forEach(m),ue=b(N),ne=r(N,"MAIN",{class:!0});var _e=A(ne);q&&q.l(_e),_e.forEach(m),ce=b(N),P&&P.l(N),N.forEach(m),this.h()},h(){a(l,"class","p-4 border-b border-gray-200"),a(c,"class","mt-2 mb-1 px-2 text-xs font-medium text-gray-500 uppercase"),a(f,"class",X="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(u[0]==="tts"?"bg-gray-100":"")),a(x,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),x.disabled=!0,a(I,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),I.disabled=!0,a(U,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),U.disabled=!0,a(T,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),T.disabled=!0,a(p,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),p.disabled=!0,a(s,"class","p-2 text-sm flex-1"),H.disabled=!1,a(H,"class","w-full px-6 py-3 bg-black text-white rounded-lg font-medium hover:bg-gray-800 transition-colors shadow-sm flex items-center justify-center gap-2 text-sm disabled:opacity-50 disabled:cursor-not-allowed relative overflow-hidden"),a(E,"class","p-2"),a(e,"class","w-56 border-r border-gray-200 bg-white flex-shrink-0 flex flex-col h-full "),a(ne,"class","flex-1 overflow-auto"),a(t,"class","flex h-screen bg-white")},m(g,N){Q(g,t,N),n(t,e),n(e,l),n(e,h),n(e,s),n(s,c),n(s,B),n(s,f),n(f,w),n(f,C),n(f,y),n(s,W),n(s,x),n(s,K),n(s,I),n(s,ee),n(s,U),n(s,F),n(s,T),n(s,_),n(s,p),n(e,G),n(e,E),S&&S.m(E,null),n(E,Y),n(E,H),j&&j.m(H,null),n(H,$),J.m(H,null),n(t,ue),n(t,ne),q&&q.m(ne,null),n(t,ce),P&&P.m(t,null),te=!0,fe||(ge=[se(f,"click",u[14]),se(H,"click",u[9])],fe=!0)},p(g,[N]){(!te||N&1&&X!==(X="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(g[0]==="tts"?"bg-gray-100":"")))&&a(f,"class",X),!g[1]&&g[7]?S?S.p(g,N):(S=ve(g),S.c(),S.m(E,Y)):S&&(S.d(1),S=null),g[8]?j||(j=xe(),j.c(),j.m(H,$)):j&&(j.d(1),j=null),ae===(ae=me(g))&&J?J.p(g,N):(J.d(1),J=ae(g),J&&(J.c(),J.m(H,null))),q&&q.p&&(!te||N&4096)&&Ne(q,de,g,g[12],te?De(de,g[12],N,null):Ae(g[12]),null),g[3]?P?P.p(g,N):(P=we(g),P.c(),P.m(t,null)):P&&(P.d(1),P=null)},i(g){te||(Pe(q,g),te=!0)},o(g){Se(q,g),te=!1},d(g){g&&m(t),S&&S.d(),j&&j.d(),J.d(),q&&q.d(g),P&&P.d(),fe=!1,Te(ge)}}}function Fe(u,t,e){let{$$slots:l={},$$scope:o}=t,h="tts",s=typeof window<"u"&&window.__INITIAL_USER__?window.__INITIAL_USER__:{authenticated:!1},c=(s==null?void 0:s.authenticated)||!1,k=s!=null&&s.authenticated&&(s!=null&&s.user_info)?(s.user_info.name||s.user_info.fullname||s.user_info.login||s.user_info.username||"User").split(" ")[0]:"",B=!1,f="",w="",O=!1,C=!1,y=!1,V=!1;je(()=>(window.addEventListener("show-login-prompt",()=>{c||(e(7,C=!0),e(8,y=!0),setTimeout(()=>{e(8,y=!1)},1600))}),X().then(()=>{s!=null&&s.authenticated||W()}),document.addEventListener("visibilitychange",()=>{document.hidden||W()}),()=>{}));async function X(){try{V=(await(await fetch("/api/status")).json()).is_spaces||!1}catch(d){console.error("Error checking Spaces status:",d),V=!1}}async function W(){if(!(s!=null&&s.authenticated&&c))try{const d=await fetch("/api/auth/user",{credentials:"include"});if(d.ok){const F=await d.json();if(F.authenticated){e(1,c=!0);const T=F.user_info,D=T.name||T.fullname||T.login||T.username||"User";e(2,k=D.split(" ")[0])}else e(1,c=!1),e(2,k="")}else e(1,c=!1),e(2,k="")}catch{e(1,c=!1),e(2,k="")}}async function x(){if(c){try{await fetch("/api/auth/logout",{method:"POST",credentials:"include"})}catch(d){console.error("Logout error:",d)}sessionStorage.removeItem("oauth_state"),e(1,c=!1),e(2,k="")}else try{const F=await(await fetch("/api/auth/oauth-config")).json(),T=F.scopes||"inference-api";let D=window.location.origin+"/auth/callback";window.location.hostname==="localhost"&&window.location.port==="11111"&&(D="http://localhost:7860/auth/callback");const _=`https://huggingface.co/oauth/authorize?client_id=${F.client_id}&redirect_uri=${encodeURIComponent(D)}&scope=${encodeURIComponent(T)}&response_type=code&state=${Date.now()}`;window.location.href=_}catch{e(3,B=!0),e(4,f=""),e(5,w="")}}function Z(){e(3,B=!1),e(4,f=""),e(5,w="")}async function K(){if(!f.trim()){e(5,w="Please enter a token");return}if(!f.startsWith("hf_")){e(5,w='Token should start with "hf_"');return}try{const d=await fetch("https://huggingface.co/api/whoami-v2",{headers:{Authorization:`Bearer ${f.trim()}`}});if(d.ok){const F=await d.json(),T=f.trim();try{const D=await fetch("/api/auth/manual-token",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:T})});if(D.ok){const _=await D.json();e(1,c=!0);const p=_.user_info,M=p.name||p.fullname||p.login||p.username||"User";e(2,k=M.split(" ")[0]),Z()}else{const _=await D.json();e(5,w=_.detail||"Token validation failed")}}catch{e(5,w="Failed to validate token. Please try again.")}}else e(5,w=`Invalid token (${d.status}). Please check your token and try again.`)}catch{e(5,w="Error validating token. Please try again.")}}const I=()=>e(0,h="tts"),R=()=>e(7,C=!1);function ee(){f=this.value,e(4,f)}const U=d=>d.key==="Enter"&&K();return u.$$set=d=>{"$$scope"in d&&e(12,o=d.$$scope)},[h,c,k,B,f,w,O,C,y,x,Z,K,o,l,I,R,ee,U]}class qe extends Ie{constructor(t){super(),He(this,t,Fe,Ue,Ee,{})}}export{qe as component};
hfstudio/static/_app/immutable/nodes/1.C7DZkBQo.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{S,i as x,s as j,n as _,d as l,a as d,b as m,c as f,e as g,f as h,g as v,h as k,j as $,t as E,k as q,l as y}from"../chunks/MT0Fezl8.js";import"../chunks/IHki7fMi.js";import{s as C}from"../chunks/H9bLuign.js";const H=()=>{const s=C;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},P={subscribe(s){return H().page.subscribe(s)}};function w(s){var b;let t,r=s[0].status+"",n,o,i,c=((b=s[0].error)==null?void 0:b.message)+"",u;return{c(){t=$("h1"),n=E(r),o=q(),i=$("p"),u=E(c)},l(e){t=g(e,"H1",{});var a=h(t);n=v(a,r),a.forEach(l),o=k(e),i=g(e,"P",{});var p=h(i);u=v(p,c),p.forEach(l)},m(e,a){m(e,t,a),f(t,n),m(e,o,a),m(e,i,a),f(i,u)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&d(n,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&d(u,c)},i:_,o:_,d(e){e&&(l(t),l(o),l(i))}}}function z(s,t,r){let n;return y(s,P,o=>r(0,n=o)),[n]}let F=class extends S{constructor(t){super(),x(this,t,z,w,j,{})}};export{F as component};
hfstudio/static/_app/version.json CHANGED
@@ -1 +1 @@
1
- {"version":"1761197182887"}
 
1
+ {"version":"1761233809732"}
hfstudio/static/index.html CHANGED
@@ -6,25 +6,25 @@
6
  <meta name="viewport" content="width=device-width, initial-scale=1" />
7
  <title>HFStudio - Text to Speech</title>
8
 
9
- <link rel="modulepreload" href="/_app/immutable/entry/start.DQCc6o_5.js">
10
- <link rel="modulepreload" href="/_app/immutable/chunks/B7qSU_uo.js">
11
  <link rel="modulepreload" href="/_app/immutable/chunks/MT0Fezl8.js">
12
- <link rel="modulepreload" href="/_app/immutable/entry/app.CprdS0bs.js">
13
  <link rel="modulepreload" href="/_app/immutable/chunks/IHki7fMi.js">
14
  </head>
15
  <body data-sveltekit-preload-data="hover">
16
  <div style="display: contents">
17
  <script>
18
  {
19
- __sveltekit_mvopnb = {
20
  base: ""
21
  };
22
 
23
  const element = document.currentScript.parentElement;
24
 
25
  Promise.all([
26
- import("/_app/immutable/entry/start.DQCc6o_5.js"),
27
- import("/_app/immutable/entry/app.CprdS0bs.js")
28
  ]).then(([kit, app]) => {
29
  kit.start(app, element);
30
  });
 
6
  <meta name="viewport" content="width=device-width, initial-scale=1" />
7
  <title>HFStudio - Text to Speech</title>
8
 
9
+ <link rel="modulepreload" href="/_app/immutable/entry/start.B9QfSl3B.js">
10
+ <link rel="modulepreload" href="/_app/immutable/chunks/H9bLuign.js">
11
  <link rel="modulepreload" href="/_app/immutable/chunks/MT0Fezl8.js">
12
+ <link rel="modulepreload" href="/_app/immutable/entry/app.CdRJjHnj.js">
13
  <link rel="modulepreload" href="/_app/immutable/chunks/IHki7fMi.js">
14
  </head>
15
  <body data-sveltekit-preload-data="hover">
16
  <div style="display: contents">
17
  <script>
18
  {
19
+ __sveltekit_1hob969 = {
20
  base: ""
21
  };
22
 
23
  const element = document.currentScript.parentElement;
24
 
25
  Promise.all([
26
+ import("/_app/immutable/entry/start.B9QfSl3B.js"),
27
+ import("/_app/immutable/entry/app.CdRJjHnj.js")
28
  ]).then(([kit, app]) => {
29
  kit.start(app, element);
30
  });