GitHub Action commited on
Commit
c2715b1
·
1 Parent(s): 30c506d

Sync from GitHub: ff022256303e7f466ee2a39b4bf2ee2b5af23c45

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/+page.svelte CHANGED
@@ -746,11 +746,11 @@ audio_bytes = client.text_to_speech(
746
  >
747
  🎤
748
  </div>
749
- <span class="text-sm font-medium">Yours</span>
750
  </div>
751
  <button
752
  on:click={(e) =>
753
- playSampleVoice({ name: 'Yours', sample: userVoices[0].sample_url }, e)}
754
  class="p-1 rounded-full hover:bg-gray-200 transition-colors w-5 h-5 flex items-center justify-center"
755
  title="Play sample"
756
  >
@@ -775,7 +775,7 @@ audio_bytes = client.text_to_speech(
775
  >
776
  🎤
777
  </div>
778
- <span class="text-sm font-medium text-purple-900">Clone</span>
779
  </div>
780
  <div class="w-5 h-5 flex items-center justify-center">
781
  <svg
 
746
  >
747
  🎤
748
  </div>
749
+ <span class="text-xs font-medium">Your cloned voice</span>
750
  </div>
751
  <button
752
  on:click={(e) =>
753
+ playSampleVoice({ name: 'Yours', sample: userVoices[0].voice_url }, e)}
754
  class="p-1 rounded-full hover:bg-gray-200 transition-colors w-5 h-5 flex items-center justify-center"
755
  title="Play sample"
756
  >
 
775
  >
776
  🎤
777
  </div>
778
+ <span class="text-xs font-medium text-purple-900">Clone your voice</span>
779
  </div>
780
  <div class="w-5 h-5 flex items-center justify-center">
781
  <svg
hfstudio/server.py CHANGED
@@ -680,6 +680,7 @@ async def exchange_oauth_token(request: OAuthTokenRequest, http_request: Request
680
 
681
  # List of allowed redirect URIs for the Connected App
682
  allowed_redirects = [
 
683
  "https://www.hfstud.io/auth/callback",
684
  "https://abidlabs-hfstudio.hf.space/auth/callback",
685
  "http://localhost:11111/auth/callback",
@@ -770,6 +771,7 @@ async def oauth_callback(
770
 
771
  # List of allowed redirect URIs for the Connected App
772
  allowed_redirects = [
 
773
  "https://www.hfstud.io/auth/callback",
774
  "https://abidlabs-hfstudio.hf.space/auth/callback",
775
  "http://localhost:11111/auth/callback",
@@ -816,7 +818,6 @@ async def oauth_callback(
816
  session_id = create_session(access_token, user_info)
817
 
818
  # Determine redirect URL based on environment and state parameter
819
- base_url = "/"
820
  if (
821
  not is_running_on_spaces()
822
  and referer
@@ -824,6 +825,14 @@ async def oauth_callback(
824
  ):
825
  # Local development - redirect to frontend port
826
  base_url = "http://localhost:11111"
 
 
 
 
 
 
 
 
827
 
828
  # Use state parameter to redirect to original page
829
  if state and state.startswith("/"):
 
680
 
681
  # List of allowed redirect URIs for the Connected App
682
  allowed_redirects = [
683
+ "https://hfstud.io/auth/callback",
684
  "https://www.hfstud.io/auth/callback",
685
  "https://abidlabs-hfstudio.hf.space/auth/callback",
686
  "http://localhost:11111/auth/callback",
 
771
 
772
  # List of allowed redirect URIs for the Connected App
773
  allowed_redirects = [
774
+ "https://hfstud.io/auth/callback",
775
  "https://www.hfstud.io/auth/callback",
776
  "https://abidlabs-hfstudio.hf.space/auth/callback",
777
  "http://localhost:11111/auth/callback",
 
818
  session_id = create_session(access_token, user_info)
819
 
820
  # Determine redirect URL based on environment and state parameter
 
821
  if (
822
  not is_running_on_spaces()
823
  and referer
 
825
  ):
826
  # Local development - redirect to frontend port
827
  base_url = "http://localhost:11111"
828
+ else:
829
+ # Production - use full origin URL from referer or fallback to www.hfstud.io
830
+ if referer:
831
+ from urllib.parse import urlparse
832
+ parsed = urlparse(referer)
833
+ base_url = f"{parsed.scheme}://{parsed.netloc}"
834
+ else:
835
+ base_url = "https://www.hfstud.io"
836
 
837
  # Use state parameter to redirect to original page
838
  if state and state.startswith("/"):
hfstudio/static/_app/immutable/chunks/Bu7WF-kh.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{s as e}from"./DOHzRSwz.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p};
hfstudio/static/_app/immutable/chunks/DOHzRSwz.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,U as At,$ as Rt,a0 as Tt,a1 as It,a2 as Ut,a3 as Lt,a4 as $t,G as ve,a5 as xt,V as be,n as ge,s as Ct}from"./TRxHAhOH.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 Bt(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 Ft(...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 Vt=new TextDecoder;function Mt(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=Mt(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="${Ft(...a)}"]`}return r}const Ht=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Kt(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=Ht.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 zt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Wt(e){return e.slice(1).split("/").filter(zt)}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}=Kt(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 Fe(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_b6ga54)==null?void 0:Je.base)??"";var Xe;const Zt=((Xe=globalThis.__sveltekit_b6ga54)==null?void 0:Xe.assets)??$??"",Qt="1761280915964",et="sveltekit:snapshot",tt="sveltekit:scroll",nt="sveltekit:states",en="sveltekit:pageurl",F="sveltekit:history",z="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 B(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Ve={...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=B(o,"preload-code")),a===null&&(a=B(o,"preload-data")),t===null&&(t=B(o,"keepfocus")),n===null&&(n=B(o,"noscroll")),s===null&&(s=B(o,"reload")),i===null&&(i=B(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:Ve[r??"off"],preload_data:Ve[a??"off"],keepfocus:c(t),noscroll:c(n),reload:c(s),replace_state:c(i)}}function Me(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:Me({}),page:Me({}),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,H=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 K=new Set,He=new Map;async function Kn(e,t,n){var s,i,o,c,l;(s=globalThis.__sveltekit_b6ga54)!=null&&s.data&&globalThis.__sveltekit_b6ga54.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[F],L=(l=history.state)==null?void 0:l[z],A||(A=L=Date.now(),history.replaceState({...history.state,[F]:A,[z]:L},""));const r=j[A];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await Dn(Ee,n)):(await V({type:"enter",url:at(k.hash?Fn(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 Ke(){Le(A),Fe(tt,j),dt(L),Fe(et,J)}async function Un(e,t,n,r){let a;t.invalidateAll&&(U=null),await V({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=[...He.keys()]),t.invalidate&&t.invalidate.forEach(Nn)}}),t.invalidateAll&&be().then(be).then(()=>{He.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={};K.add(t),U={id:e.id,token:t,promise:mt({...e,preload:t}).then(n=>(K.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()};H.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:Bt(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 ze(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 K.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]||ze(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 M(w,{url:n,params:r,route:{id:e}});return K.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)&&!ze(_,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 Be;const De={};for(let pe=0;pe<m;pe+=1)Object.assign(De,(Be=await I[pe])==null?void 0:Be.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(K.has(s))return We({error:await M(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 M(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 V({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 M(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 V({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 M(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={[F]:A+=m,[z]: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=>{H.delete(S)})};m.push(v),m.forEach(S=>{H.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&&Bn(t,E),Ye=!0,_.props.page&&Object.assign(T,_.props.page),X=!1,e==="popstate"&&ht(L),p.fulfil(void 0),H.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))}}H.add(i),i()}function M(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(Ke(),!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"&&Ke()}),(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 V({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(),V({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[F]){const a=n.state[F];if(N={},a===A)return;const s=j[a],i=n.state[nt]??{},o=new URL(n.state[en]??location.href),c=n.state[z],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 V({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,[F]:++A,[z]: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 M(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
+ `:Vt.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 Bn(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 Fn(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{Kn as a,qn as l,C as s};
hfstudio/static/_app/immutable/entry/app.z5hcEL1B.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0._s6OdEWf.js","../chunks/TRxHAhOH.js","../chunks/IHki7fMi.js","../chunks/Bu7WF-kh.js","../chunks/DOHzRSwz.js","../chunks/QpZLpmTi.js","../chunks/nn-QVLrM.js","../chunks/BhRpzVYR.js","../assets/0.D3cVNcGj.css","../nodes/1.-mR6_BC8.js","../nodes/2.B1zebCaO.js","../chunks/DUd0gdPo.js","../chunks/BNlacN_j.js","../chunks/DRlRadqT.js","../assets/2.CdRym-eY.css","../nodes/3.D8euRajz.js","../assets/3.BNkL3CE9.css","../nodes/4.CskQnfpl.js"])))=>i.map(i=>d[i]);
2
+ import{S as C,i as U,s as q,d,w as h,x as g,N as O,K as S,b as v,h as B,M as w,k as W,U as z,G,V as K,W as y,v as P,A as R,y as L,z as D,p as T,Q as p,e as Q,f as F,j as H,T as V,a as J,g as X,t as Y}from"../chunks/TRxHAhOH.js";import"../chunks/IHki7fMi.js";const Z="modulepreload",M=function(o,e){return new URL(o,e).href},I={},A=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 I)return;I[f]=!0;const l=f.endsWith(".css"),_=l?'[rel="stylesheet"]':"";if(!!i)for(let k=t.length-1;k>=0;k--){const E=t[k];if(E.href===f&&(!l||E.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,E)=>{m.addEventListener("load",k),m.addEventListener("error",()=>E(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&&D(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),v(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][0])){if(e){O();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),S()}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&&D(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),v(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][0])){if(e){O();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),S()}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&&D(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),v(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][1])){if(e){O();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),S()}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 N(o){let e,n=o[7]&&j(o);return{c(){e=H("div"),n&&n.c(),this.h()},l(i){e=Q(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var r=F(e);n&&n.l(r),r.forEach(d),this.h()},h(){T(e,"id","svelte-announcer"),T(e,"aria-live","assertive"),T(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){v(i,e,r),n&&n.m(e,null)},p(i,r){i[7]?n?n.p(i,r):(n=j(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&d(e),n&&n.d()}}}function j(o){let e;return{c(){e=Y(o[8])},l(n){e=X(n,o[8])},m(n,i){v(n,e,i)},p(n,i){i&256&&J(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]&&N(o);return{c(){n.c(),i=W(),f&&f.c(),r=w()},l(l){n.l(l),i=B(l),f&&f.l(l),r=w()},m(l,_){s[e].m(l,_),v(l,i,_),f&&f.m(l,_),v(l,r,_),u=!0},p(l,[_]){let b=e;e=a(l),e===b?s[e].p(l,_):(O(),h(s[b],1,1,()=>{s[b]=null}),S(),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=N(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;z(i.page.notify);let l=!1,_=!1,b=null;G(()=>{const c=i.page.subscribe(()=>{l&&(n(7,_=!0),K().then(()=>{n(8,b=document.title||"untitled page")}))});return n(6,l=!0),c});function m(c){V[c?"unshift":"push"](()=>{t[1]=c,n(0,t)})}function k(c){V[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}function E(c){V[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,E]}class le extends C{constructor(e){super(),U(this,e,ne,te,q,{stores:9,page:1,constructors:2,components:0,form:3,data_0:4,data_1:5})}}const fe=[()=>A(()=>import("../nodes/0._s6OdEWf.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),()=>A(()=>import("../nodes/1.-mR6_BC8.js"),__vite__mapDeps([9,1,2,3,4]),import.meta.url),()=>A(()=>import("../nodes/2.B1zebCaO.js"),__vite__mapDeps([10,1,11,7,2,12,13,14]),import.meta.url),()=>A(()=>import("../nodes/3.D8euRajz.js"),__vite__mapDeps([15,1,11,7,2,5,13,16]),import.meta.url),()=>A(()=>import("../nodes/4.CskQnfpl.js"),__vite__mapDeps([17,1,7,2,12,6,13]),import.meta.url)],ce=[],ue={"/":[2],"/code-recorder":[3],"/voice-cloning":[4]},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.C-8lEFyc.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{l as o,a as r}from"../chunks/DOHzRSwz.js";export{o as load_css,r as start};
hfstudio/static/_app/immutable/nodes/0._s6OdEWf.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ import{S as lt,i as ot,s as rt,C as it,d as M,v as Qe,w as Oe,x as Ue,p as s,D as ut,E as ct,F as pt,b as be,c as t,y as Xe,e as a,f as j,r as d,h as u,z as Ze,j as l,k as c,A as $e,l as ft,G as dt,H as ht,I as et,m as xe,a as mt,g as gt,t as xt}from"../chunks/TRxHAhOH.js";import"../chunks/IHki7fMi.js";import{p as bt}from"../chunks/Bu7WF-kh.js";import{N as _t}from"../chunks/QpZLpmTi.js";import{M as vt}from"../chunks/nn-QVLrM.js";function tt(f){let o,n,p,L="Sign In with HuggingFace Token",R,e,x,A="<strong>Manual Token Entry:</strong> Please enter your HuggingFace token.",D,h,T=`1. Go to <a href="https://huggingface.co/settings/tokens" target="_blank" class="underline text-blue-600">HuggingFace Settings</a><br/>
2
+ 2. Create a new token with &quot;Inference API&quot; permissions<br/>
3
+ 3. Copy and paste it below`,Q,F,_,O,q="HuggingFace Token",W,b,S,Y,k,i,N="Cancel",H,g,z="Sign In",B,U,y=f[5]&&nt(),w=f[4]&&st(f);return{c(){o=l("div"),n=l("div"),p=l("h2"),p.textContent=L,R=c(),e=l("div"),x=l("p"),x.innerHTML=A,D=c(),h=l("p"),h.innerHTML=T,Q=c(),y&&y.c(),F=c(),_=l("div"),O=l("label"),O.textContent=q,W=c(),b=l("input"),S=c(),w&&w.c(),Y=c(),k=l("div"),i=l("button"),i.textContent=N,H=c(),g=l("button"),g.textContent=z,this.h()},l(v){o=a(v,"DIV",{class:!0});var G=j(o);n=a(G,"DIV",{class:!0});var V=j(n);p=a(V,"H2",{class:!0,"data-svelte-h":!0}),d(p)!=="svelte-1t0ehet"&&(p.textContent=L),R=u(V),e=a(V,"DIV",{class:!0});var E=j(e);x=a(E,"P",{class:!0,"data-svelte-h":!0}),d(x)!=="svelte-344vn4"&&(x.innerHTML=A),D=u(E),h=a(E,"P",{class:!0,"data-svelte-h":!0}),d(h)!=="svelte-orsfwv"&&(h.innerHTML=T),Q=u(E),y&&y.l(E),E.forEach(M),F=u(V),_=a(V,"DIV",{class:!0});var K=j(_);O=a(K,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),d(O)!=="svelte-vtbmxo"&&(O.textContent=q),W=u(K),b=a(K,"INPUT",{id:!0,type:!0,placeholder:!0,class:!0}),S=u(K),w&&w.l(K),K.forEach(M),Y=u(V),k=a(V,"DIV",{class:!0});var X=j(k);i=a(X,"BUTTON",{class:!0,"data-svelte-h":!0}),d(i)!=="svelte-csk0rj"&&(i.textContent=N),H=u(X),g=a(X,"BUTTON",{class:!0,"data-svelte-h":!0}),d(g)!=="svelte-1nxas5u"&&(g.textContent=z),X.forEach(M),V.forEach(M),G.forEach(M),this.h()},h(){s(p,"class","text-xl font-semibold mb-4"),s(x,"class","text-blue-800 mb-2"),s(h,"class","text-blue-700"),s(e,"class","mb-4 p-3 bg-blue-50 rounded-md text-sm"),s(O,"for","token"),s(O,"class","block text-sm font-medium text-gray-700 mb-2"),s(b,"id","token"),s(b,"type","password"),s(b,"placeholder","hf_..."),s(b,"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"),s(_,"class","mb-4"),s(i,"class","px-4 py-2 text-gray-600 hover:text-gray-800 transition-colors"),s(g,"class","px-4 py-2 bg-orange-500 text-white rounded-md hover:bg-orange-600 transition-colors"),s(k,"class","flex justify-end gap-3"),s(n,"class","bg-white rounded-lg p-6 max-w-md w-full mx-4 shadow-xl"),s(o,"class","fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50")},m(v,G){be(v,o,G),t(o,n),t(n,p),t(n,R),t(n,e),t(e,x),t(e,D),t(e,h),t(e,Q),y&&y.m(e,null),t(n,F),t(n,_),t(_,O),t(_,W),t(_,b),et(b,f[3]),t(_,S),w&&w.m(_,null),t(n,Y),t(n,k),t(k,i),t(k,H),t(k,g),B||(U=[xe(b,"input",f[13]),xe(b,"keydown",f[14]),xe(i,"click",f[9]),xe(g,"click",f[10])],B=!0)},p(v,G){v[5]?y||(y=nt(),y.c(),y.m(e,null)):y&&(y.d(1),y=null),G&8&&b.value!==v[3]&&et(b,v[3]),v[4]?w?w.p(v,G):(w=st(v),w.c(),w.m(_,null)):w&&(w.d(1),w=null)},d(v){v&&M(o),y&&y.d(),w&&w.d(),B=!1,ht(U)}}}function nt(f){let o,n=`<strong>Tip:</strong> You can also run <code>huggingface-cli login</code> in your terminal
4
+ to automatically use your local token.`;return{c(){o=l("p"),o.innerHTML=n,this.h()},l(p){o=a(p,"P",{class:!0,"data-svelte-h":!0}),d(o)!=="svelte-xrut8w"&&(o.innerHTML=n),this.h()},h(){s(o,"class","text-blue-600 mt-2")},m(p,L){be(p,o,L)},d(p){p&&M(o)}}}function st(f){let o,n;return{c(){o=l("p"),n=xt(f[4]),this.h()},l(p){o=a(p,"P",{class:!0});var L=j(o);n=gt(L,f[4]),L.forEach(M),this.h()},h(){s(o,"class","text-red-600 text-sm mt-1")},m(p,L){be(p,o,L),t(o,n)},p(p,L){L&16&&mt(n,p[4])},d(p){p&&M(o)}}}function wt(f){let o,n,p,L='<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>',R,e,x,A="Audio",D,h,T,Q="🎙️",F,_,O="Text to Speech",q,W,b,S,Y,k,i="Voice Cloning",N,H,g,z="<span>🎧</span> <span>Speech to Text</span>",B,U,y="<span>🎼</span> <span>Sound Effects</span>",w,v,G="<span>🎸</span> <span>Music Generation</span>",V,E,K="<span>🔊</span> <span>Audio Enhancement</span>",X,fe,Pe="Image",_e,Z,Ve="<span>🎨</span> <span>Text to Image</span>",ve,$,je="<span>🖼️</span> <span>Image to Image</span>",we,ee,De="<span>✂️</span> <span>Remove Background</span>",Te,te,Fe="<span>🔍</span> <span>Upscale Image</span>",ye,ne,ze="<span>🎭</span> <span>Face Swap</span>",Ce,se,Re="<span>📝</span> <span>Image to Text</span>",ke,de,qe="Video",Le,ae,Ge="<span>🎬</span> <span>Text to Video</span>",He,le,Je="<span>🎞️</span> <span>Image to Video</span>",Ie,oe,We="<span>✨</span> <span>Video Enhancement</span>",Me,re,Ye="<span>🎤</span> <span>Lip Sync</span>",Ne,ie,Ke="<span>🗣️</span> <span>Video Dubbing</span>",Ee,ue,ce,Se,Be,pe;S=new vt({props:{size:16}}),ce=new _t({props:{isLoggedIn:f[0],username:f[1],handleAuthAction:f[8],flashButton:f[6],pageTitle:at(f[7].url.pathname)}});const Ae=f[12].default,P=it(Ae,f,f[11],null);let I=f[2]&&tt(f);return{c(){o=l("div"),n=l("aside"),p=l("div"),p.innerHTML=L,R=c(),e=l("nav"),x=l("div"),x.textContent=A,D=c(),h=l("a"),T=l("span"),T.textContent=Q,F=c(),_=l("span"),_.textContent=O,W=c(),b=l("a"),$e(S.$$.fragment),Y=c(),k=l("span"),k.textContent=i,H=c(),g=l("button"),g.innerHTML=z,B=c(),U=l("button"),U.innerHTML=y,w=c(),v=l("button"),v.innerHTML=G,V=c(),E=l("button"),E.innerHTML=K,X=c(),fe=l("div"),fe.textContent=Pe,_e=c(),Z=l("button"),Z.innerHTML=Ve,ve=c(),$=l("button"),$.innerHTML=je,we=c(),ee=l("button"),ee.innerHTML=De,Te=c(),te=l("button"),te.innerHTML=Fe,ye=c(),ne=l("button"),ne.innerHTML=ze,Ce=c(),se=l("button"),se.innerHTML=Re,ke=c(),de=l("div"),de.textContent=qe,Le=c(),ae=l("button"),ae.innerHTML=Ge,He=c(),le=l("button"),le.innerHTML=Je,Ie=c(),oe=l("button"),oe.innerHTML=We,Me=c(),re=l("button"),re.innerHTML=Ye,Ne=c(),ie=l("button"),ie.innerHTML=Ke,Ee=c(),ue=l("main"),$e(ce.$$.fragment),Se=c(),P&&P.c(),Be=c(),I&&I.c(),this.h()},l(m){o=a(m,"DIV",{class:!0});var C=j(o);n=a(C,"ASIDE",{class:!0});var J=j(n);p=a(J,"DIV",{class:!0,"data-svelte-h":!0}),d(p)!=="svelte-xzbt87"&&(p.innerHTML=L),R=u(J),e=a(J,"NAV",{class:!0});var r=j(e);x=a(r,"DIV",{class:!0,"data-svelte-h":!0}),d(x)!=="svelte-52jqai"&&(x.textContent=A),D=u(r),h=a(r,"A",{href:!0,class:!0});var he=j(h);T=a(he,"SPAN",{"data-svelte-h":!0}),d(T)!=="svelte-1yx42xi"&&(T.textContent=Q),F=u(he),_=a(he,"SPAN",{"data-svelte-h":!0}),d(_)!=="svelte-2j89jk"&&(_.textContent=O),he.forEach(M),W=u(r),b=a(r,"A",{href:!0,class:!0});var me=j(b);Ze(S.$$.fragment,me),Y=u(me),k=a(me,"SPAN",{"data-svelte-h":!0}),d(k)!=="svelte-10pmll2"&&(k.textContent=i),me.forEach(M),H=u(r),g=a(r,"BUTTON",{class:!0,"data-svelte-h":!0}),d(g)!=="svelte-wf0x5d"&&(g.innerHTML=z),B=u(r),U=a(r,"BUTTON",{class:!0,"data-svelte-h":!0}),d(U)!=="svelte-x7bha3"&&(U.innerHTML=y),w=u(r),v=a(r,"BUTTON",{class:!0,"data-svelte-h":!0}),d(v)!=="svelte-1tyblmt"&&(v.innerHTML=G),V=u(r),E=a(r,"BUTTON",{class:!0,"data-svelte-h":!0}),d(E)!=="svelte-1emrjb3"&&(E.innerHTML=K),X=u(r),fe=a(r,"DIV",{class:!0,"data-svelte-h":!0}),d(fe)!=="svelte-1pmjg3x"&&(fe.textContent=Pe),_e=u(r),Z=a(r,"BUTTON",{class:!0,"data-svelte-h":!0}),d(Z)!=="svelte-11wbuiv"&&(Z.innerHTML=Ve),ve=u(r),$=a(r,"BUTTON",{class:!0,"data-svelte-h":!0}),d($)!=="svelte-ol2yvl"&&($.innerHTML=je),we=u(r),ee=a(r,"BUTTON",{class:!0,"data-svelte-h":!0}),d(ee)!=="svelte-ttigif"&&(ee.innerHTML=De),Te=u(r),te=a(r,"BUTTON",{class:!0,"data-svelte-h":!0}),d(te)!=="svelte-ixgtu4"&&(te.innerHTML=Fe),ye=u(r),ne=a(r,"BUTTON",{class:!0,"data-svelte-h":!0}),d(ne)!=="svelte-r2ax5z"&&(ne.innerHTML=ze),Ce=u(r),se=a(r,"BUTTON",{class:!0,"data-svelte-h":!0}),d(se)!=="svelte-n9rt3x"&&(se.innerHTML=Re),ke=u(r),de=a(r,"DIV",{class:!0,"data-svelte-h":!0}),d(de)!=="svelte-1gfxetb"&&(de.textContent=qe),Le=u(r),ae=a(r,"BUTTON",{class:!0,"data-svelte-h":!0}),d(ae)!=="svelte-gox1rd"&&(ae.innerHTML=Ge),He=u(r),le=a(r,"BUTTON",{class:!0,"data-svelte-h":!0}),d(le)!=="svelte-13pimzy"&&(le.innerHTML=Je),Ie=u(r),oe=a(r,"BUTTON",{class:!0,"data-svelte-h":!0}),d(oe)!=="svelte-c86wph"&&(oe.innerHTML=We),Me=u(r),re=a(r,"BUTTON",{class:!0,"data-svelte-h":!0}),d(re)!=="svelte-wkify0"&&(re.innerHTML=Ye),Ne=u(r),ie=a(r,"BUTTON",{class:!0,"data-svelte-h":!0}),d(ie)!=="svelte-10ou061"&&(ie.innerHTML=Ke),r.forEach(M),J.forEach(M),Ee=u(C),ue=a(C,"MAIN",{class:!0});var ge=j(ue);Ze(ce.$$.fragment,ge),Se=u(ge),P&&P.l(ge),ge.forEach(M),Be=u(C),I&&I.l(C),C.forEach(M),this.h()},h(){s(p,"class","px-4 py-4 border-b border-gray-200 min-h-[73px] flex items-center"),s(x,"class","mt-2 mb-1 px-2 text-xs font-medium text-gray-500 uppercase"),s(h,"href","/"),s(h,"class",q="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(f[7].url.pathname==="/"?"bg-gray-100":"")),s(b,"href","/voice-cloning"),s(b,"class",N="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(f[7].url.pathname==="/voice-cloning"?"bg-gray-100":"")),s(g,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),g.disabled=!0,s(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,s(v,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),v.disabled=!0,s(E,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),E.disabled=!0,s(fe,"class","mt-4 mb-1 px-2 text-xs font-medium text-gray-500 uppercase"),s(Z,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),Z.disabled=!0,s($,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),$.disabled=!0,s(ee,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),ee.disabled=!0,s(te,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),te.disabled=!0,s(ne,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),ne.disabled=!0,s(se,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),se.disabled=!0,s(de,"class","mt-4 mb-1 px-2 text-xs font-medium text-gray-500 uppercase"),s(ae,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),ae.disabled=!0,s(le,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),le.disabled=!0,s(oe,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),oe.disabled=!0,s(re,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),re.disabled=!0,s(ie,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),ie.disabled=!0,s(e,"class","p-2 text-sm flex-1"),s(n,"class","w-56 border-r border-gray-200 bg-white flex-shrink-0 flex flex-col h-full relative "),s(ue,"class","flex-1 overflow-auto"),s(o,"class","flex h-screen bg-white")},m(m,C){be(m,o,C),t(o,n),t(n,p),t(n,R),t(n,e),t(e,x),t(e,D),t(e,h),t(h,T),t(h,F),t(h,_),t(e,W),t(e,b),Xe(S,b,null),t(b,Y),t(b,k),t(e,H),t(e,g),t(e,B),t(e,U),t(e,w),t(e,v),t(e,V),t(e,E),t(e,X),t(e,fe),t(e,_e),t(e,Z),t(e,ve),t(e,$),t(e,we),t(e,ee),t(e,Te),t(e,te),t(e,ye),t(e,ne),t(e,Ce),t(e,se),t(e,ke),t(e,de),t(e,Le),t(e,ae),t(e,He),t(e,le),t(e,Ie),t(e,oe),t(e,Me),t(e,re),t(e,Ne),t(e,ie),t(o,Ee),t(o,ue),Xe(ce,ue,null),t(ue,Se),P&&P.m(ue,null),t(o,Be),I&&I.m(o,null),pe=!0},p(m,[C]){(!pe||C&128&&q!==(q="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(m[7].url.pathname==="/"?"bg-gray-100":"")))&&s(h,"class",q),(!pe||C&128&&N!==(N="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(m[7].url.pathname==="/voice-cloning"?"bg-gray-100":"")))&&s(b,"class",N);const J={};C&1&&(J.isLoggedIn=m[0]),C&2&&(J.username=m[1]),C&64&&(J.flashButton=m[6]),C&128&&(J.pageTitle=at(m[7].url.pathname)),ce.$set(J),P&&P.p&&(!pe||C&2048)&&ut(P,Ae,m,m[11],pe?pt(Ae,m[11],C,null):ct(m[11]),null),m[2]?I?I.p(m,C):(I=tt(m),I.c(),I.m(o,null)):I&&(I.d(1),I=null)},i(m){pe||(Ue(S.$$.fragment,m),Ue(ce.$$.fragment,m),Ue(P,m),pe=!0)},o(m){Oe(S.$$.fragment,m),Oe(ce.$$.fragment,m),Oe(P,m),pe=!1},d(m){m&&M(o),Qe(S),Qe(ce),P&&P.d(m),I&&I.d()}}}function at(f){switch(f){case"/":return"Text to Speech";case"/voice-cloning":return"Voice Cloning";default:return"HFStudio"}}function Tt(f,o,n){let p;ft(f,bt,i=>n(7,p=i));let{$$slots:L={},$$scope:R}=o,e=typeof window<"u"&&window.__INITIAL_USER__?window.__INITIAL_USER__:{authenticated:!1},x=(e==null?void 0:e.authenticated)||!1,A=e!=null&&e.authenticated&&(e!=null&&e.user_info)?(e.user_info.name||e.user_info.fullname||e.user_info.login||e.user_info.username||"User").split(" ")[0]:"",D=!1,h="",T="",Q=!1,F=!1,_=!1;dt(()=>(window.addEventListener("show-login-prompt",()=>{x||(n(6,F=!0),setTimeout(()=>{n(6,F=!1)},1600))}),O().then(()=>{e!=null&&e.authenticated||q()}),document.addEventListener("visibilitychange",()=>{document.hidden||q()}),()=>{}));async function O(){try{_=(await(await fetch("/api/status")).json()).is_spaces||!1}catch(i){console.error("Error checking Spaces status:",i),_=!1}}async function q(){if(!(e!=null&&e.authenticated&&x))try{const i=await fetch("/api/auth/user",{credentials:"include"});if(i.ok){const N=await i.json();if(N.authenticated){n(0,x=!0);const H=N.user_info,g=H.name||H.fullname||H.login||H.username||"User";n(1,A=g.split(" ")[0])}else n(0,x=!1),n(1,A="")}else n(0,x=!1),n(1,A="")}catch{n(0,x=!1),n(1,A="")}}async function W(){if(x){try{await fetch("/api/auth/logout",{method:"POST",credentials:"include"})}catch(i){console.error("Logout error:",i)}sessionStorage.removeItem("oauth_state"),n(0,x=!1),n(1,A=""),window.location.reload()}else try{const N=await(await fetch("/api/auth/oauth-config")).json(),H=N.scopes||"inference-api";let g=window.location.origin+"/auth/callback";window.location.hostname==="localhost"&&window.location.port==="11111"&&(g="http://localhost:7860/auth/callback");const z=window.location.pathname,B=`https://huggingface.co/oauth/authorize?client_id=${N.client_id}&redirect_uri=${encodeURIComponent(g)}&scope=${encodeURIComponent(H)}&response_type=code&state=${encodeURIComponent(z)}`;window.location.href=B}catch{n(2,D=!0),n(3,h=""),n(4,T="")}}function b(){n(2,D=!1),n(3,h=""),n(4,T="")}async function S(){if(!h.trim()){n(4,T="Please enter a token");return}if(!h.startsWith("hf_")){n(4,T='Token should start with "hf_"');return}try{const i=await fetch("https://huggingface.co/api/whoami-v2",{headers:{Authorization:`Bearer ${h.trim()}`}});if(i.ok){const N=await i.json(),H=h.trim();try{const g=await fetch("/api/auth/manual-token",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:H})});if(g.ok){const z=await g.json();n(0,x=!0);const B=z.user_info,U=B.name||B.fullname||B.login||B.username||"User";n(1,A=U.split(" ")[0]),b()}else{const z=await g.json();n(4,T=z.detail||"Token validation failed")}}catch{n(4,T="Failed to validate token. Please try again.")}}else n(4,T=`Invalid token (${i.status}). Please check your token and try again.`)}catch{n(4,T="Error validating token. Please try again.")}}function Y(){h=this.value,n(3,h)}const k=i=>i.key==="Enter"&&S();return f.$$set=i=>{"$$scope"in i&&n(11,R=i.$$scope)},[x,A,D,h,T,Q,F,p,W,b,S,R,L,Y,k]}class It extends lt{constructor(o){super(),ot(this,o,Tt,wt,rt,{})}}export{It as component};
hfstudio/static/_app/immutable/nodes/1.-mR6_BC8.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{S as x,i as S,s as j,n as u,d as c,a as h,b as _,c as d,e as v,f as g,g as b,h as k,j as E,t as $,k as q,l as y}from"../chunks/TRxHAhOH.js";import"../chunks/IHki7fMi.js";import{p as C}from"../chunks/Bu7WF-kh.js";function H(p){var f;let a,s=p[0].status+"",r,n,o,i=((f=p[0].error)==null?void 0:f.message)+"",m;return{c(){a=E("h1"),r=$(s),n=q(),o=E("p"),m=$(i)},l(e){a=v(e,"H1",{});var t=g(a);r=b(t,s),t.forEach(c),n=k(e),o=v(e,"P",{});var l=g(o);m=b(l,i),l.forEach(c)},m(e,t){_(e,a,t),d(a,r),_(e,n,t),_(e,o,t),d(o,m)},p(e,[t]){var l;t&1&&s!==(s=e[0].status+"")&&h(r,s),t&1&&i!==(i=((l=e[0].error)==null?void 0:l.message)+"")&&h(m,i)},i:u,o:u,d(e){e&&(c(a),c(n),c(o))}}}function P(p,a,s){let r;return y(p,C,n=>s(0,r=n)),[r]}class B extends x{constructor(a){super(),S(this,a,P,H,j,{})}}export{B as component};
hfstudio/static/_app/immutable/nodes/2.B1zebCaO.js ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{S as bs,i as vs,s as zl,u as dr,v as ce,w as I,x as C,y as ue,z as fe,A as de,B as Zr,C as ws,D as ks,E as xs,F as Es,d as c,J as ys,H as _l,a as Ye,I as ul,p as o,K as pt,b as j,c as n,m as L,L as Ts,h as _,e as u,f as h,g as M,r as G,M as At,k as b,j as f,t as H,G as Cs,N as mt,n as jt,O as pr,P as mr,Q as hr,R as es,T as $s,q as ts}from"../chunks/TRxHAhOH.js";import{C as fr,g as Is,P as Ht,D as Ds}from"../chunks/DUd0gdPo.js";import{I as Vs,g as Ps,a as Ls,e as Ul}from"../chunks/BhRpzVYR.js";import"../chunks/IHki7fMi.js";import{S as Ns,L as Ms,A as Hs,X as js}from"../chunks/BNlacN_j.js";import{P as Bl,a as dl}from"../chunks/DRlRadqT.js";function As(s){let e;const t=s[2].default,l=ws(t,s,s[3],null);return{c(){l&&l.c()},l(r){l&&l.l(r)},m(r,a){l&&l.m(r,a),e=!0},p(r,a){l&&l.p&&(!e||a&8)&&ks(l,t,r,r[3],e?Es(t,r[3],a,null):xs(r[3]),null)},i(r){e||(C(l,r),e=!0)},o(r){I(l,r),e=!1},d(r){l&&l.d(r)}}}function Os(s){let e,t;const l=[{name:"chevron-down"},s[1],{iconNode:s[0]}];let r={$$slots:{default:[As]},$$scope:{ctx:s}};for(let a=0;a<l.length;a+=1)r=dr(r,l[a]);return e=new Vs({props:r}),{c(){de(e.$$.fragment)},l(a){fe(e.$$.fragment,a)},m(a,i){ue(e,a,i),t=!0},p(a,[i]){const p=i&3?Ps(l,[l[0],i&2&&Ls(a[1]),i&1&&{iconNode:a[0]}]):{};i&8&&(p.$$scope={dirty:i,ctx:a}),e.$set(p)},i(a){t||(C(e.$$.fragment,a),t=!0)},o(a){I(e.$$.fragment,a),t=!1},d(a){ce(e,a)}}}function Ss(s,e,t){let{$$slots:l={},$$scope:r}=e;const a=[["path",{d:"m6 9 6 6 6-6"}]];return s.$$set=i=>{t(1,e=dr(dr({},e),Zr(i))),"$$scope"in i&&t(3,r=i.$$scope)},e=Zr(e),[a,e,l,r]}class zs extends bs{constructor(e){super(),vs(this,e,Ss,Os,zl,{})}}const{document:ls}=Is;function rs(s,e,t){const l=s.slice();return l[74]=e[t],l}function ss(s,e,t){const l=s.slice();return l[74]=e[t],l}function ns(s){let e=s[74].name+"",t,l,r=s[74].badge&&Us(s);return{c(){t=H(e),r&&r.c(),l=At()},l(a){t=M(a,e),r&&r.l(a),l=At()},m(a,i){j(a,t,i),r&&r.m(a,i),j(a,l,i)},p(a,i){a[74].badge&&r.p(a,i)},d(a){a&&(c(t),c(l)),r&&r.d(a)}}}function Us(s){let e,t,l,r=s[74].badge+"",a,i;return{c(){e=H(" "),t=f("span"),l=H("("),a=H(r),i=H(")"),this.h()},l(p){e=M(p," "),t=u(p,"SPAN",{class:!0});var m=h(t);l=M(m,"("),a=M(m,r),i=M(m,")"),m.forEach(c),this.h()},h(){o(t,"class","text-sm text-gray-500")},m(p,m){j(p,e,m),j(p,t,m),n(t,l),n(t,a),n(t,i)},p:jt,d(p){p&&(c(e),c(t))}}}function os(s){let e,t=s[74].name===s[2]&&ns(s);return{c(){t&&t.c(),e=At()},l(l){t&&t.l(l),e=At()},m(l,r){t&&t.m(l,r),j(l,e,r)},p(l,r){l[74].name===l[2]?t?t.p(l,r):(t=ns(l),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(l){l&&c(e),t&&t.d(l)}}}function as(s){let e,t=Ul(s[25]),l=[];for(let r=0;r<t.length;r+=1)l[r]=is(rs(s,t,r));return{c(){e=f("div");for(let r=0;r<l.length;r+=1)l[r].c();this.h()},l(r){e=u(r,"DIV",{class:!0});var a=h(e);for(let i=0;i<l.length;i+=1)l[i].l(a);a.forEach(c),this.h()},h(){o(e,"class","absolute bottom-full left-0 right-0 border border-gray-200 border-b-0 bg-white shadow-lg rounded-t-lg overflow-hidden z-20")},m(r,a){j(r,e,a);for(let i=0;i<l.length;i+=1)l[i]&&l[i].m(e,null)},p(r,a){if(a[0]&33554692){t=Ul(r[25]);let i;for(i=0;i<t.length;i+=1){const p=rs(r,t,i);l[i]?l[i].p(p,a):(l[i]=is(p),l[i].c(),l[i].m(e,null))}for(;i<l.length;i+=1)l[i].d(1);l.length=t.length}},d(r){r&&c(e),ys(l,r)}}}function Bs(s){let e,t,l,r=s[74].badge+"",a,i;return{c(){e=H(" "),t=f("span"),l=H("("),a=H(r),i=H(")"),this.h()},l(p){e=M(p," "),t=u(p,"SPAN",{class:!0});var m=h(t);l=M(m,"("),a=M(m,r),i=M(m,")"),m.forEach(c),this.h()},h(){o(t,"class","text-sm text-gray-500")},m(p,m){j(p,e,m),j(p,t,m),n(t,l),n(t,a),n(t,i)},p:jt,d(p){p&&(c(e),c(t))}}}function is(s){let e,t=s[74].name+"",l,r,a,i,p,m=s[74].badge&&Bs(s);function $(){return s[42](s[74])}return{c(){e=f("button"),l=H(t),m&&m.c(),r=b(),this.h()},l(y){e=u(y,"BUTTON",{class:!0});var v=h(e);l=M(v,t),m&&m.l(v),r=_(v),v.forEach(c),this.h()},h(){o(e,"class",a="w-full px-3 py-2.5 text-left transition-colors text-sm "+(s[74].disabled?"opacity-50 cursor-not-allowed":"hover:bg-gray-50")+" "+(s[74].name===s[2]?"bg-gray-100":"")),e.disabled=s[74].disabled},m(y,v){j(y,e,v),n(e,l),m&&m.m(e,null),n(e,r),i||(p=L(e,"click",$),i=!0)},p(y,v){s=y,s[74].badge&&m.p(s,v),v[0]&4&&a!==(a="w-full px-3 py-2.5 text-left transition-colors text-sm "+(s[74].disabled?"opacity-50 cursor-not-allowed":"hover:bg-gray-50")+" "+(s[74].name===s[2]?"bg-gray-100":""))&&o(e,"class",a)},d(y){y&&c(e),m&&m.d(),i=!1,p()}}}function Fs(s){let e,t;return e=new dl({props:{size:10,class:"text-gray-600"}}),{c(){de(e.$$.fragment)},l(l){fe(e.$$.fragment,l)},m(l,r){ue(e,l,r),t=!0},i(l){t||(C(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){ce(e,l)}}}function Rs(s){let e,t;return e=new Bl({props:{size:10,class:"text-gray-600"}}),{c(){de(e.$$.fragment)},l(l){fe(e.$$.fragment,l)},m(l,r){ue(e,l,r),t=!0},i(l){t||(C(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){ce(e,l)}}}function qs(s){let e,t;return e=new dl({props:{size:10,class:"text-gray-600"}}),{c(){de(e.$$.fragment)},l(l){fe(e.$$.fragment,l)},m(l,r){ue(e,l,r),t=!0},i(l){t||(C(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){ce(e,l)}}}function Gs(s){let e,t;return e=new Bl({props:{size:10,class:"text-gray-600"}}),{c(){de(e.$$.fragment)},l(l){fe(e.$$.fragment,l)},m(l,r){ue(e,l,r),t=!0},i(l){t||(C(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){ce(e,l)}}}function Ys(s){let e,t;return e=new dl({props:{size:10,class:"text-gray-600"}}),{c(){de(e.$$.fragment)},l(l){fe(e.$$.fragment,l)},m(l,r){ue(e,l,r),t=!0},i(l){t||(C(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){ce(e,l)}}}function Ks(s){let e,t;return e=new Bl({props:{size:10,class:"text-gray-600"}}),{c(){de(e.$$.fragment)},l(l){fe(e.$$.fragment,l)},m(l,r){ue(e,l,r),t=!0},i(l){t||(C(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){ce(e,l)}}}function Js(s){let e,t='<div class="flex items-center justify-between mb-1"><div class="flex items-center gap-2"><div class="w-6 h-6 bg-gradient-to-br from-purple-400 to-pink-500 rounded-full flex items-center justify-center text-white text-xs font-semibold">🎤</div> <span class="text-xs font-medium text-purple-900">Clone your voice</span></div> <div class="w-5 h-5 flex items-center justify-center"><svg class="w-3 h-3 text-purple-600" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg></div></div>';return{c(){e=f("a"),e.innerHTML=t,this.h()},l(l){e=u(l,"A",{href:!0,class:!0,"data-svelte-h":!0}),G(e)!=="svelte-aczm6q"&&(e.innerHTML=t),this.h()},h(){o(e,"href","/voice-cloning"),o(e,"class","p-3 border border-purple-200 rounded-lg transition-colors text-left hover:bg-purple-50 bg-purple-25")},m(l,r){j(l,e,r)},p:jt,i:jt,o:jt,d(l){l&&c(e)}}}function Xs(s){let e,t,l,r='<div class="w-6 h-6 bg-gradient-to-br from-purple-400 to-pink-500 rounded-full flex items-center justify-center text-white text-xs">🎤</div> <span class="text-xs font-medium">Your cloned voice</span>',a,i,p,m,$,y,v,x;const A=[Ws,Qs],J=[];function D(E,T){return E[17]==="Yours"?0:1}return p=D(s),m=J[p]=A[p](s),{c(){e=f("button"),t=f("div"),l=f("div"),l.innerHTML=r,a=b(),i=f("button"),m.c(),this.h()},l(E){e=u(E,"BUTTON",{class:!0});var T=h(e);t=u(T,"DIV",{class:!0});var w=h(t);l=u(w,"DIV",{class:!0,"data-svelte-h":!0}),G(l)!=="svelte-1ixcco1"&&(l.innerHTML=r),a=_(w),i=u(w,"BUTTON",{class:!0,title:!0});var U=h(i);m.l(U),U.forEach(c),w.forEach(c),T.forEach(c),this.h()},h(){o(l,"class","flex items-center gap-2"),o(i,"class","p-1 rounded-full hover:bg-gray-200 transition-colors w-5 h-5 flex items-center justify-center"),o(i,"title","Play sample"),o(t,"class","flex items-center justify-between mb-1"),o(e,"class",$="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(s[1]==="Yours"?"border-purple-400 bg-purple-50":"border-gray-200"))},m(E,T){j(E,e,T),n(e,t),n(t,l),n(t,a),n(t,i),J[p].m(i,null),y=!0,v||(x=[L(i,"click",s[49]),L(e,"click",s[50])],v=!0)},p(E,T){let w=p;p=D(E),p!==w&&(mt(),I(J[w],1,1,()=>{J[w]=null}),pt(),m=J[p],m||(m=J[p]=A[p](E),m.c()),C(m,1),m.m(i,null)),(!y||T[0]&2&&$!==($="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(E[1]==="Yours"?"border-purple-400 bg-purple-50":"border-gray-200")))&&o(e,"class",$)},i(E){y||(C(m),y=!0)},o(E){I(m),y=!1},d(E){E&&c(e),J[p].d(),v=!1,_l(x)}}}function Qs(s){let e,t;return e=new dl({props:{size:10,class:"text-gray-600"}}),{c(){de(e.$$.fragment)},l(l){fe(e.$$.fragment,l)},m(l,r){ue(e,l,r),t=!0},i(l){t||(C(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){ce(e,l)}}}function Ws(s){let e,t;return e=new Bl({props:{size:10,class:"text-gray-600"}}),{c(){de(e.$$.fragment)},l(l){fe(e.$$.fragment,l)},m(l,r){ue(e,l,r),t=!0},i(l){t||(C(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){ce(e,l)}}}function Zs(s){let e,t,l;return e=new dl({props:{size:20}}),{c(){de(e.$$.fragment),t=H(`
2
+ Generate speech`)},l(r){fe(e.$$.fragment,r),t=M(r,`
3
+ Generate speech`)},m(r,a){ue(e,r,a),j(r,t,a),l=!0},i(r){l||(C(e.$$.fragment,r),l=!0)},o(r){I(e.$$.fragment,r),l=!1},d(r){r&&c(t),ce(e,r)}}}function en(s){let e,t,l;return e=new Ms({props:{size:20,class:"animate-spin"}}),{c(){de(e.$$.fragment),t=H(`
4
+ Generating...`)},l(r){fe(e.$$.fragment,r),t=M(r,`
5
+ Generating...`)},m(r,a){ue(e,r,a),j(r,t,a),l=!0},i(r){l||(C(e.$$.fragment,r),l=!0)},o(r){I(e.$$.fragment,r),l=!1},d(r){r&&c(t),ce(e,r)}}}function cs(s){let e,t,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>',r,a,i='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>',p,m,$=`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
6
+ additional pay-as-you-go usage ⤴`,y,v;return{c(){e=f("div"),t=f("button"),t.innerHTML=l,r=b(),a=f("p"),a.innerHTML=i,p=b(),m=f("p"),m.innerHTML=$,this.h()},l(x){e=u(x,"DIV",{class:!0});var A=h(e);t=u(A,"BUTTON",{class:!0,"aria-label":!0,"data-svelte-h":!0}),G(t)!=="svelte-9gdgq5"&&(t.innerHTML=l),r=_(A),a=u(A,"P",{class:!0,"data-svelte-h":!0}),G(a)!=="svelte-1q58z3k"&&(a.innerHTML=i),p=_(A),m=u(A,"P",{class:!0,"data-svelte-h":!0}),G(m)!=="svelte-dysk74"&&(m.innerHTML=$),A.forEach(c),this.h()},h(){o(t,"class","absolute top-2 right-2 text-gray-400 hover:text-gray-600 transition-colors"),o(t,"aria-label","Dismiss"),o(a,"class","text-sm font-medium text-gray-700 mb-1 pr-4"),o(m,"class","text-sm text-gray-600 pr-4"),o(e,"class","mb-4 px-3 py-2 bg-gradient-to-r from-amber-50 to-orange-50 rounded-lg border border-amber-200 relative")},m(x,A){j(x,e,A),n(e,t),n(e,r),n(e,a),n(e,p),n(e,m),y||(v=L(t,"click",s[53]),y=!0)},p:jt,d(x){x&&c(e),y=!1,v()}}}function us(s){let e,t,l,r=Ht.highlight(s[23],Ht.languages.bash,"bash")+"";return{c(){e=f("pre"),t=f("code"),l=new mr(!1),this.h()},l(a){e=u(a,"PRE",{class:!0});var i=h(e);t=u(i,"CODE",{class:!0});var p=h(t);l=pr(p,!1),p.forEach(c),i.forEach(c),this.h()},h(){l.a=null,o(t,"class","language-bash"),o(e,"class","p-3 overflow-x-auto bg-gray-50 text-xs")},m(a,i){j(a,e,i),n(e,t),l.m(r,t)},p(a,i){i[0]&8388608&&r!==(r=Ht.highlight(a[23],Ht.languages.bash,"bash")+"")&&l.p(r)},d(a){a&&c(e)}}}function fs(s){let e,t,l,r=Ht.highlight(s[24],Ht.languages.python,"python")+"";return{c(){e=f("pre"),t=f("code"),l=new mr(!1),this.h()},l(a){e=u(a,"PRE",{class:!0});var i=h(e);t=u(i,"CODE",{class:!0});var p=h(t);l=pr(p,!1),p.forEach(c),i.forEach(c),this.h()},h(){l.a=null,o(t,"class","language-python"),o(e,"class","p-3 overflow-x-auto bg-gray-50 text-xs")},m(a,i){j(a,e,i),n(e,t),l.m(r,t)},p(a,i){i[0]&16777216&&r!==(r=Ht.highlight(a[24],Ht.languages.python,"python")+"")&&l.p(r)},d(a){a&&c(e)}}}function ds(s){let e,t,l,r,a,i,p="Generated Audio",m,$,y,v,x,A="Download",J,D,E,T,w,U,Y,he,_e,O,Z,pe=fl(s[14])+"",S,V,z,F,q,B,Oe,ee,se,me=fl(s[13])+"",Be,Fe,X,be,Pe,xe,Le=fl(s[14])+"",We,Ie,R,ye,ot,Q=s[11]>0&&s[6]!=="local"&&hs(s);D=new Ds({props:{size:12,class:"text-green-600"}});const Ne=[ln,tn],ve=[];function Re(P,N){return P[12]?0:1}q=Re(s),B=ve[q]=Ne[q](s);let te=s[10]&&ps(s);return{c(){e=f("div"),t=f("div"),l=f("div"),r=f("div"),a=b(),i=f("span"),i.textContent=p,m=b(),Q&&Q.c(),$=b(),y=f("div"),v=f("button"),x=f("span"),x.textContent=A,J=b(),de(D.$$.fragment),E=b(),T=f("div"),w=f("div"),U=f("h4"),Y=H(s[15]),he=b(),_e=f("p"),O=H(s[1]),Z=H(" • "),S=H(pe),V=b(),z=f("div"),F=f("button"),B.c(),Oe=b(),ee=f("div"),se=f("span"),Be=H(me),Fe=b(),X=f("div"),be=f("div"),Pe=b(),xe=f("span"),We=H(Le),Ie=b(),te&&te.c(),this.h()},l(P){e=u(P,"DIV",{class:!0});var N=h(e);t=u(N,"DIV",{class:!0});var W=h(t);l=u(W,"DIV",{class:!0});var ne=h(l);r=u(ne,"DIV",{class:!0}),h(r).forEach(c),a=_(ne),i=u(ne,"SPAN",{class:!0,"data-svelte-h":!0}),G(i)!=="svelte-1hz7jl7"&&(i.textContent=p),m=_(ne),Q&&Q.l(ne),ne.forEach(c),$=_(W),y=u(W,"DIV",{class:!0});var at=h(y);v=u(at,"BUTTON",{class:!0,title:!0});var Ze=h(v);x=u(Ze,"SPAN",{class:!0,"data-svelte-h":!0}),G(x)!=="svelte-kkuif9"&&(x.textContent=A),J=_(Ze),fe(D.$$.fragment,Ze),Ze.forEach(c),at.forEach(c),W.forEach(c),E=_(N),T=u(N,"DIV",{class:!0});var we=h(T);w=u(we,"DIV",{class:!0});var De=h(w);U=u(De,"H4",{class:!0});var qe=h(U);Y=M(qe,s[15]),qe.forEach(c),he=_(De),_e=u(De,"P",{class:!0});var it=h(_e);O=M(it,s[1]),Z=M(it," • "),S=M(it,pe),it.forEach(c),De.forEach(c),V=_(we),z=u(we,"DIV",{class:!0});var et=h(z);F=u(et,"BUTTON",{class:!0});var Me=h(F);B.l(Me),Me.forEach(c),Oe=_(et),ee=u(et,"DIV",{class:!0});var oe=h(ee);se=u(oe,"SPAN",{class:!0});var Ee=h(se);Be=M(Ee,me),Ee.forEach(c),Fe=_(oe),X=u(oe,"DIV",{class:!0});var ct=h(X);be=u(ct,"DIV",{class:!0,style:!0}),h(be).forEach(c),ct.forEach(c),Pe=_(oe),xe=u(oe,"SPAN",{class:!0});var gt=h(xe);We=M(gt,Le),gt.forEach(c),oe.forEach(c),et.forEach(c),Ie=_(we),te&&te.l(we),we.forEach(c),N.forEach(c),this.h()},h(){o(r,"class","w-1.5 h-1.5 bg-green-500 rounded-full"),o(i,"class","text-xs font-medium text-green-900"),o(l,"class","flex items-center gap-2"),o(x,"class","text-xs text-green-700"),o(v,"class","flex items-center gap-1 px-2 py-1 hover:bg-green-100 rounded transition-colors"),o(v,"title","Download audio"),o(y,"class","flex items-center gap-1"),o(t,"class","flex items-center justify-between px-3 py-2 bg-green-50 border-b border-green-200"),o(U,"class","font-medium text-gray-900 text-xs"),o(_e,"class","text-xs text-gray-500"),o(w,"class","mb-3"),o(F,"class","w-6 h-6 bg-black rounded-full flex items-center justify-center hover:bg-gray-800 transition-colors flex-shrink-0"),o(se,"class","text-xs text-gray-500 font-mono"),o(be,"class","h-full bg-gradient-to-r from-amber-400 to-orange-500 rounded-full transition-all"),hr(be,"width",s[13]/s[14]*100+"%"),o(X,"class","flex-1 h-1 bg-gray-200 rounded-full cursor-pointer"),o(xe,"class","text-xs text-gray-500 font-mono"),o(ee,"class","flex-1 flex items-center gap-1"),o(z,"class","flex items-center gap-2"),o(T,"class","p-3"),o(e,"class","bg-white rounded-lg border border-gray-200 overflow-hidden mt-4")},m(P,N){j(P,e,N),n(e,t),n(t,l),n(l,r),n(l,a),n(l,i),n(l,m),Q&&Q.m(l,null),n(t,$),n(t,y),n(y,v),n(v,x),n(v,J),ue(D,v,null),n(e,E),n(e,T),n(T,w),n(w,U),n(U,Y),n(w,he),n(w,_e),n(_e,O),n(_e,Z),n(_e,S),n(T,V),n(T,z),n(z,F),ve[q].m(F,null),n(z,Oe),n(z,ee),n(ee,se),n(se,Be),n(ee,Fe),n(ee,X),n(X,be),n(ee,Pe),n(ee,xe),n(xe,We),n(T,Ie),te&&te.m(T,null),R=!0,ye||(ot=[L(v,"click",s[32]),L(F,"click",s[27])],ye=!0)},p(P,N){P[11]>0&&P[6]!=="local"?Q?Q.p(P,N):(Q=hs(P),Q.c(),Q.m(l,null)):Q&&(Q.d(1),Q=null),(!R||N[0]&32768)&&Ye(Y,P[15]),(!R||N[0]&2)&&Ye(O,P[1]),(!R||N[0]&16384)&&pe!==(pe=fl(P[14])+"")&&Ye(S,pe);let W=q;q=Re(P),q!==W&&(mt(),I(ve[W],1,1,()=>{ve[W]=null}),pt(),B=ve[q],B||(B=ve[q]=Ne[q](P),B.c()),C(B,1),B.m(F,null)),(!R||N[0]&8192)&&me!==(me=fl(P[13])+"")&&Ye(Be,me),(!R||N[0]&24576)&&hr(be,"width",P[13]/P[14]*100+"%"),(!R||N[0]&16384)&&Le!==(Le=fl(P[14])+"")&&Ye(We,Le),P[10]?te?te.p(P,N):(te=ps(P),te.c(),te.m(T,null)):te&&(te.d(1),te=null)},i(P){R||(C(D.$$.fragment,P),C(B),R=!0)},o(P){I(D.$$.fragment,P),I(B),R=!1},d(P){P&&c(e),Q&&Q.d(),ce(D),ve[q].d(),te&&te.d(),ye=!1,_l(ot)}}}function hs(s){let e,t,l=s[11].toFixed(1)+"",r,a;return{c(){e=f("span"),t=H("(took "),r=H(l),a=H("s)"),this.h()},l(i){e=u(i,"SPAN",{class:!0});var p=h(e);t=M(p,"(took "),r=M(p,l),a=M(p,"s)"),p.forEach(c),this.h()},h(){o(e,"class","text-xs text-green-700")},m(i,p){j(i,e,p),n(e,t),n(e,r),n(e,a)},p(i,p){p[0]&2048&&l!==(l=i[11].toFixed(1)+"")&&Ye(r,l)},d(i){i&&c(e)}}}function tn(s){let e,t;return e=new dl({props:{size:10,class:"text-white ml-0.5"}}),{c(){de(e.$$.fragment)},l(l){fe(e.$$.fragment,l)},m(l,r){ue(e,l,r),t=!0},i(l){t||(C(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){ce(e,l)}}}function ln(s){let e;return{c(){e=f("div"),this.h()},l(t){e=u(t,"DIV",{class:!0}),h(e).forEach(c),this.h()},h(){o(e,"class","pause-filled text-white text-xs svelte-13ak1iw")},m(t,l){j(t,e,l)},i:jt,o:jt,d(t){t&&c(e)}}}function ps(s){let e,t,l,r;return{c(){e=f("audio"),this.h()},l(a){e=u(a,"AUDIO",{src:!0,style:!0}),h(e).forEach(c),this.h()},h(){ts(e.src,t=s[10])||o(e,"src",t),hr(e,"display","none")},m(a,i){j(a,e,i),s[58](e),l||(r=[L(e,"loadedmetadata",s[28]),L(e,"timeupdate",s[29]),L(e,"play",s[30]),L(e,"pause",s[31])],l=!0)},p(a,i){i[0]&1024&&!ts(e.src,t=a[10])&&o(e,"src",t)},d(a){a&&c(e),s[58](null),l=!1,_l(r)}}}function ms(s){let e,t,l,r,a,i,p,m,$,y,v,x,A="An error occurred while processing your request",J,D,E,T,w,U,Y,he,_e="Close",O,Z,pe;i=new Hs({props:{size:20,class:"text-red-600"}}),E=new js({props:{size:20,class:"text-gray-500"}});let S=s[20]&&gs(s);return{c(){e=f("div"),t=f("div"),l=f("div"),r=f("div"),a=f("div"),de(i.$$.fragment),p=b(),m=f("div"),$=f("h3"),y=H(s[19]),v=b(),x=f("p"),x.textContent=A,J=b(),D=f("button"),de(E.$$.fragment),T=b(),w=f("div"),S&&S.c(),U=b(),Y=f("div"),he=f("button"),he.textContent=_e,this.h()},l(V){e=u(V,"DIV",{class:!0});var z=h(e);t=u(z,"DIV",{class:!0});var F=h(t);l=u(F,"DIV",{class:!0});var q=h(l);r=u(q,"DIV",{class:!0});var B=h(r);a=u(B,"DIV",{class:!0});var Oe=h(a);fe(i.$$.fragment,Oe),Oe.forEach(c),p=_(B),m=u(B,"DIV",{class:!0});var ee=h(m);$=u(ee,"H3",{class:!0});var se=h($);y=M(se,s[19]),se.forEach(c),v=_(ee),x=u(ee,"P",{class:!0,"data-svelte-h":!0}),G(x)!=="svelte-1l3zl3"&&(x.textContent=A),ee.forEach(c),B.forEach(c),J=_(q),D=u(q,"BUTTON",{class:!0,title:!0});var me=h(D);fe(E.$$.fragment,me),me.forEach(c),q.forEach(c),T=_(F),w=u(F,"DIV",{class:!0});var Be=h(w);S&&S.l(Be),Be.forEach(c),U=_(F),Y=u(F,"DIV",{class:!0});var Fe=h(Y);he=u(Fe,"BUTTON",{class:!0,"data-svelte-h":!0}),G(he)!=="svelte-4sxk6g"&&(he.textContent=_e),Fe.forEach(c),F.forEach(c),z.forEach(c),this.h()},h(){o(a,"class","w-10 h-10 bg-red-100 rounded-full flex items-center justify-center flex-shrink-0"),o($,"class","text-lg font-semibold text-gray-900 truncate"),o(x,"class","text-sm text-gray-600"),o(m,"class","min-w-0"),o(r,"class","flex items-center gap-3 min-w-0"),o(D,"class","p-2 hover:bg-red-100 rounded-full transition-colors flex-shrink-0"),o(D,"title","Close"),o(l,"class","flex items-center justify-between p-6 border-b border-gray-200 bg-red-50 flex-shrink-0"),o(w,"class","p-6 overflow-y-auto flex-1 min-h-0"),o(he,"class","px-6 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors"),o(Y,"class","flex items-center justify-end gap-3 p-6 border-t border-gray-200 bg-gray-50 flex-shrink-0"),o(t,"class","bg-white rounded-xl shadow-2xl max-w-2xl w-full max-h-[80vh] flex flex-col"),o(e,"class","fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4")},m(V,z){j(V,e,z),n(e,t),n(t,l),n(l,r),n(r,a),ue(i,a,null),n(r,p),n(r,m),n(m,$),n($,y),n(m,v),n(m,x),n(l,J),n(l,D),ue(E,D,null),n(t,T),n(t,w),S&&S.m(w,null),n(t,U),n(t,Y),n(Y,he),O=!0,Z||(pe=[L(D,"click",s[36]),L(he,"click",s[36])],Z=!0)},p(V,z){(!O||z[0]&524288)&&Ye(y,V[19]),V[20]?S?S.p(V,z):(S=gs(V),S.c(),S.m(w,null)):S&&(S.d(1),S=null)},i(V){O||(C(i.$$.fragment,V),C(E.$$.fragment,V),O=!0)},o(V){I(i.$$.fragment,V),I(E.$$.fragment,V),O=!1},d(V){V&&c(e),ce(i),ce(E),S&&S.d(),Z=!1,_l(pe)}}}function gs(s){let e,t,l="Error Details:",r,a,i;function p(y,v){return v[0]&1048576&&(i=null),i==null&&(i=!!y[20].includes("exceeded your monthly included credits")),i?sn:rn}let m=p(s,[-1,-1,-1]),$=m(s);return{c(){e=f("div"),t=f("h4"),t.textContent=l,r=b(),a=f("pre"),$.c(),this.h()},l(y){e=u(y,"DIV",{class:!0});var v=h(e);t=u(v,"H4",{class:!0,"data-svelte-h":!0}),G(t)!=="svelte-3lmggt"&&(t.textContent=l),r=_(v),a=u(v,"PRE",{class:!0});var x=h(a);$.l(x),x.forEach(c),v.forEach(c),this.h()},h(){o(t,"class","text-sm font-medium text-gray-900 mb-2"),o(a,"class","text-xs text-gray-700 whitespace-pre-wrap font-mono leading-relaxed break-words"),o(e,"class","bg-gray-50 rounded-lg p-4 border")},m(y,v){j(y,e,v),n(e,t),n(e,r),n(e,a),$.m(a,null)},p(y,v){m===(m=p(y,v))&&$?$.p(y,v):($.d(1),$=m(y),$&&($.c(),$.m(a,null)))},d(y){y&&c(e),$.d()}}}function rn(s){let e;return{c(){e=H(s[20])},l(t){e=M(t,s[20])},m(t,l){j(t,e,l)},p(t,l){l[0]&1048576&&Ye(e,t[20])},d(t){t&&c(e)}}}function sn(s){let e,t=s[20].replace("Subscribe to PRO",'<a href="https://huggingface.co/settings/billing" target="_blank" class="text-amber-600 hover:text-amber-700 underline font-medium">Subscribe to PRO</a>')+"",l;return{c(){e=new mr(!1),l=At(),this.h()},l(r){e=pr(r,!1),l=At(),this.h()},h(){e.a=l},m(r,a){e.m(t,r,a),j(r,l,a)},p(r,a){a[0]&1048576&&t!==(t=r[20].replace("Subscribe to PRO",'<a href="https://huggingface.co/settings/billing" target="_blank" class="text-amber-600 hover:text-amber-700 underline font-medium">Subscribe to PRO</a>')+"")&&e.p(t)},d(r){r&&(c(l),e.d())}}}function _s(s){let e,t;return{c(){e=f("div"),t=H(s[22]),this.h()},l(l){e=u(l,"DIV",{class:!0});var r=h(e);t=M(r,s[22]),r.forEach(c),this.h()},h(){o(e,"class","fixed bottom-4 right-4 px-4 py-2 bg-gray-900 text-white rounded-lg shadow-lg z-50 animate-fade-in svelte-13ak1iw")},m(l,r){j(l,e,r),n(e,t)},p(l,r){r[0]&4194304&&Ye(t,l[22])},d(l){l&&c(e)}}}function nn(s){let e,t,l,r,a,i,p,m=s[0].length.toLocaleString()+"",$,y,v,x,A,J,D,E,T,w,U,Y,he="Model",_e,O,Z,pe,S,V,z,F,q,B,Oe='$0.025 per 1000 chars • <a href="https://huggingface.co/settings/billing" target="_blank" class="text-amber-600 hover:text-amber-700 underline">Billing ⤴</a>',ee,se,me,Be="Voice",Fe,X,be,Pe,xe,Le='<div class="w-6 h-6 bg-gradient-to-br from-amber-400 to-orange-500 rounded-full flex items-center justify-center text-white text-xs font-semibold">A</div> <span class="text-sm font-medium">Andrew</span>',We,Ie,R,ye,ot,Q,Ne,ve,Re,te='<div class="w-6 h-6 bg-gradient-to-br from-amber-400 to-orange-500 rounded-full flex items-center justify-center text-white text-xs font-semibold">L</div> <span class="text-sm font-medium">Lily</span>',P,N,W,ne,at,Ze,we,De,qe,it='<div class="w-6 h-6 bg-gradient-to-br from-amber-400 to-orange-500 rounded-full flex items-center justify-center text-white text-xs font-semibold">P</div> <span class="text-sm font-medium">Pirate</span>',et,Me,oe,Ee,ct,gt,He,je,hl,tt,Ke,lt,g,le="Exaggeration",re,K,ge=s[3].toFixed(2)+"",Ge,pl,Se,Fl,Ot,gr="<span>None</span> <span>More</span>",Rl,ut,_t,bt,_r="Stability",ql,el,ml=s[4].toFixed(2)+"",bl,Gl,ze,Yl,St,br="<span>More stable</span> <span>More variable</span>",Kl,rt,Je,Xe,vl,Jl,tl,Ue,yl,zt,vr='<h3 class="text-lg font-semibold text-gray-900 mb-1">Live Documentation ✨</h3>',Xl,vt,yt,wt,Ql,wl,Wl,kt,Zl,kl,er,ft,Ut,tr,Bt,yr="Copy all as Markdown",lr,Qe,xt,Et,Ft,wr='<span class="text-xs font-medium text-blue-900">Install in Terminal</span>',rr,Tt,Rt,sr,qt,kr=s[7],nr,Ct,$t,Gt,xr='<span class="text-xs font-medium text-amber-900">Python Code</span> <span class="text-xs bg-amber-100 text-amber-700 px-1.5 py-0.5 rounded">Live</span>',or,It,Yt,ar,Kt,Er=s[7],ir,xl,ll,rl,Ae,cr,Tr;A=new Ns({props:{size:16}});let sl=Ul(s[25]),ke=[];for(let d=0;d<sl.length;d+=1)ke[d]=os(ss(s,sl,d));V=new zs({props:{size:14,class:"text-gray-500 transition-transform "+(s[8]?"rotate-180":"")}});let Te=s[8]&&as(s);const Cr=[Rs,Fs],Jt=[];function $r(d,k){return d[17]==="Andrew"?0:1}R=$r(s),ye=Jt[R]=Cr[R](s);const Ir=[Gs,qs],Xt=[];function Dr(d,k){return d[17]==="Lily"?0:1}W=Dr(s),ne=Xt[W]=Ir[W](s);const Vr=[Ks,Ys],Qt=[];function Pr(d,k){return d[17]==="Pirate"?0:1}oe=Pr(s),Ee=Qt[oe]=Vr[oe](s);const Lr=[Xs,Js],Dt=[];function Nr(d,k){return d[5].length>0?0:1}He=Nr(s),je=Dt[He]=Lr[He](s);const Mr=[en,Zs],Wt=[];function Hr(d,k){return d[9]?0:1}Je=Hr(s),Xe=Wt[Je]=Mr[Je](s);let Ce=s[21]&&cs(s);Ut=new fr({props:{size:12,class:"text-gray-600"}}),Rt=new fr({props:{size:12,class:"text-blue-600"}});let dt=us(s);Yt=new fr({props:{size:12,class:"text-amber-600"}});let ht=fs(s),ae=s[10]&&ds(s),ie=s[18]&&ms(s),$e=s[22]&&_s(s);return{c(){e=b(),t=f("div"),l=f("div"),r=f("div"),a=f("div"),i=f("div"),p=f("span"),$=H(m),y=H(" / 1,000 characters"),v=b(),x=f("button"),de(A.$$.fragment),J=b(),D=f("textarea"),E=b(),T=f("div"),w=f("div"),U=f("div"),Y=f("h3"),Y.textContent=he,_e=b(),O=f("div"),Z=f("button"),pe=f("span");for(let d=0;d<ke.length;d+=1)ke[d].c();S=b(),de(V.$$.fragment),F=b(),Te&&Te.c(),q=b(),B=f("div"),B.innerHTML=Oe,ee=b(),se=f("div"),me=f("h3"),me.textContent=Be,Fe=b(),X=f("div"),be=f("button"),Pe=f("div"),xe=f("div"),xe.innerHTML=Le,We=b(),Ie=f("button"),ye.c(),Q=b(),Ne=f("button"),ve=f("div"),Re=f("div"),Re.innerHTML=te,P=b(),N=f("button"),ne.c(),Ze=b(),we=f("button"),De=f("div"),qe=f("div"),qe.innerHTML=it,et=b(),Me=f("button"),Ee.c(),gt=b(),je.c(),hl=b(),tt=f("div"),Ke=f("div"),lt=f("div"),g=f("label"),g.textContent=le,re=b(),K=f("span"),Ge=H(ge),pl=b(),Se=f("input"),Fl=b(),Ot=f("div"),Ot.innerHTML=gr,Rl=b(),ut=f("div"),_t=f("div"),bt=f("label"),bt.textContent=_r,ql=b(),el=f("span"),bl=H(ml),Gl=b(),ze=f("input"),Yl=b(),St=f("div"),St.innerHTML=br,Kl=b(),rt=f("button"),Xe.c(),Jl=b(),tl=f("div"),Ue=f("div"),Ce&&Ce.c(),yl=b(),zt=f("div"),zt.innerHTML=vr,Xl=b(),vt=f("div"),yt=f("div"),wt=f("button"),Ql=H("API"),Wl=b(),kt=f("button"),Zl=H("Local"),er=b(),ft=f("button"),de(Ut.$$.fragment),tr=b(),Bt=f("span"),Bt.textContent=yr,lr=b(),Qe=f("div"),xt=f("div"),Et=f("div"),Ft=f("div"),Ft.innerHTML=wr,rr=b(),Tt=f("button"),de(Rt.$$.fragment),sr=b(),qt=f("div"),dt.c(),nr=b(),Ct=f("div"),$t=f("div"),Gt=f("div"),Gt.innerHTML=xr,or=b(),It=f("button"),de(Yt.$$.fragment),ar=b(),Kt=f("div"),ht.c(),ir=b(),ae&&ae.c(),xl=b(),ie&&ie.c(),ll=b(),$e&&$e.c(),rl=At(),this.h()},l(d){Ts("svelte-y100ki",ls.head).forEach(c),e=_(d),t=u(d,"DIV",{class:!0,role:!0,tabindex:!0});var st=h(t);l=u(st,"DIV",{class:!0});var Vt=h(l);r=u(Vt,"DIV",{class:!0});var nt=h(r);a=u(nt,"DIV",{class:!0});var Pt=h(a);i=u(Pt,"DIV",{class:!0});var Lt=h(i);p=u(Lt,"SPAN",{class:!0});var Zt=h(p);$=M(Zt,m),y=M(Zt," / 1,000 characters"),Zt.forEach(c),v=_(Lt),x=u(Lt,"BUTTON",{class:!0,title:!0});var Ve=h(x);fe(A.$$.fragment,Ve),Ve.forEach(c),Lt.forEach(c),J=_(Pt),D=u(Pt,"TEXTAREA",{maxlength:!0,class:!0,placeholder:!0}),h(D).forEach(c),Pt.forEach(c),E=_(nt),T=u(nt,"DIV",{class:!0});var gl=h(T);w=u(gl,"DIV",{class:!0});var nl=h(w);U=u(nl,"DIV",{class:!0});var ol=h(U);Y=u(ol,"H3",{class:!0,"data-svelte-h":!0}),G(Y)!=="svelte-x9l5tw"&&(Y.textContent=he),_e=_(ol),O=u(ol,"DIV",{class:!0});var El=h(O);Z=u(El,"BUTTON",{class:!0});var Tl=h(Z);pe=u(Tl,"SPAN",{});var jr=h(pe);for(let ur=0;ur<ke.length;ur+=1)ke[ur].l(jr);jr.forEach(c),S=_(Tl),fe(V.$$.fragment,Tl),Tl.forEach(c),F=_(El),Te&&Te.l(El),El.forEach(c),q=_(ol),B=u(ol,"DIV",{class:!0,"data-svelte-h":!0}),G(B)!=="svelte-162fgbh"&&(B.innerHTML=Oe),ol.forEach(c),ee=_(nl),se=u(nl,"DIV",{});var Cl=h(se);me=u(Cl,"H3",{class:!0,"data-svelte-h":!0}),G(me)!=="svelte-1pzzi7j"&&(me.textContent=Be),Fe=_(Cl),X=u(Cl,"DIV",{class:!0});var Nt=h(X);be=u(Nt,"BUTTON",{class:!0});var Ar=h(be);Pe=u(Ar,"DIV",{class:!0});var $l=h(Pe);xe=u($l,"DIV",{class:!0,"data-svelte-h":!0}),G(xe)!=="svelte-qsi6ww"&&(xe.innerHTML=Le),We=_($l),Ie=u($l,"BUTTON",{class:!0,title:!0});var Or=h(Ie);ye.l(Or),Or.forEach(c),$l.forEach(c),Ar.forEach(c),Q=_(Nt),Ne=u(Nt,"BUTTON",{class:!0});var Sr=h(Ne);ve=u(Sr,"DIV",{class:!0});var Il=h(ve);Re=u(Il,"DIV",{class:!0,"data-svelte-h":!0}),G(Re)!=="svelte-1c7qu8y"&&(Re.innerHTML=te),P=_(Il),N=u(Il,"BUTTON",{class:!0,title:!0});var zr=h(N);ne.l(zr),zr.forEach(c),Il.forEach(c),Sr.forEach(c),Ze=_(Nt),we=u(Nt,"BUTTON",{class:!0});var Ur=h(we);De=u(Ur,"DIV",{class:!0});var Dl=h(De);qe=u(Dl,"DIV",{class:!0,"data-svelte-h":!0}),G(qe)!=="svelte-1o6w87n"&&(qe.innerHTML=it),et=_(Dl),Me=u(Dl,"BUTTON",{class:!0,title:!0});var Br=h(Me);Ee.l(Br),Br.forEach(c),Dl.forEach(c),Ur.forEach(c),gt=_(Nt),je.l(Nt),Nt.forEach(c),Cl.forEach(c),hl=_(nl),tt=u(nl,"DIV",{class:!0});var Vl=h(tt);Ke=u(Vl,"DIV",{});var al=h(Ke);lt=u(al,"DIV",{class:!0});var Pl=h(lt);g=u(Pl,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),G(g)!=="svelte-ywi5v5"&&(g.textContent=le),re=_(Pl),K=u(Pl,"SPAN",{class:!0});var Fr=h(K);Ge=M(Fr,ge),Fr.forEach(c),Pl.forEach(c),pl=_(al),Se=u(al,"INPUT",{id:!0,type:!0,min:!0,max:!0,step:!0,class:!0}),Fl=_(al),Ot=u(al,"DIV",{class:!0,"data-svelte-h":!0}),G(Ot)!=="svelte-y2ce61"&&(Ot.innerHTML=gr),al.forEach(c),Rl=_(Vl),ut=u(Vl,"DIV",{});var il=h(ut);_t=u(il,"DIV",{class:!0});var Ll=h(_t);bt=u(Ll,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),G(bt)!=="svelte-1y95y02"&&(bt.textContent=_r),ql=_(Ll),el=u(Ll,"SPAN",{class:!0});var Rr=h(el);bl=M(Rr,ml),Rr.forEach(c),Ll.forEach(c),Gl=_(il),ze=u(il,"INPUT",{id:!0,type:!0,min:!0,max:!0,step:!0,class:!0}),Yl=_(il),St=u(il,"DIV",{class:!0,"data-svelte-h":!0}),G(St)!=="svelte-1sqzqqv"&&(St.innerHTML=br),il.forEach(c),Vl.forEach(c),nl.forEach(c),gl.forEach(c),Kl=_(nt),rt=u(nt,"BUTTON",{class:!0});var qr=h(rt);Xe.l(qr),qr.forEach(c),nt.forEach(c),Jl=_(Vt),tl=u(Vt,"DIV",{class:!0});var Gr=h(tl);Ue=u(Gr,"DIV",{class:!0});var Mt=h(Ue);Ce&&Ce.l(Mt),yl=_(Mt),zt=u(Mt,"DIV",{class:!0,"data-svelte-h":!0}),G(zt)!=="svelte-kwvs7"&&(zt.innerHTML=vr),Xl=_(Mt),vt=u(Mt,"DIV",{class:!0});var Nl=h(vt);yt=u(Nl,"DIV",{class:!0});var Ml=h(yt);wt=u(Ml,"BUTTON",{class:!0});var Yr=h(wt);Ql=M(Yr,"API"),Yr.forEach(c),Wl=_(Ml),kt=u(Ml,"BUTTON",{class:!0});var Kr=h(kt);Zl=M(Kr,"Local"),Kr.forEach(c),Ml.forEach(c),er=_(Nl),ft=u(Nl,"BUTTON",{class:!0});var Hl=h(ft);fe(Ut.$$.fragment,Hl),tr=_(Hl),Bt=u(Hl,"SPAN",{class:!0,"data-svelte-h":!0}),G(Bt)!=="svelte-o5pdun"&&(Bt.textContent=yr),Hl.forEach(c),Nl.forEach(c),lr=_(Mt),Qe=u(Mt,"DIV",{class:!0});var cl=h(Qe);xt=u(cl,"DIV",{class:!0});var jl=h(xt);Et=u(jl,"DIV",{class:!0});var Al=h(Et);Ft=u(Al,"DIV",{class:!0,"data-svelte-h":!0}),G(Ft)!=="svelte-1eboucz"&&(Ft.innerHTML=wr),rr=_(Al),Tt=u(Al,"BUTTON",{class:!0,title:!0});var Jr=h(Tt);fe(Rt.$$.fragment,Jr),Jr.forEach(c),Al.forEach(c),sr=_(jl),qt=u(jl,"DIV",{class:!0});var Xr=h(qt);dt.l(Xr),Xr.forEach(c),jl.forEach(c),nr=_(cl),Ct=u(cl,"DIV",{class:!0});var Ol=h(Ct);$t=u(Ol,"DIV",{class:!0});var Sl=h($t);Gt=u(Sl,"DIV",{class:!0,"data-svelte-h":!0}),G(Gt)!=="svelte-w4xfzx"&&(Gt.innerHTML=xr),or=_(Sl),It=u(Sl,"BUTTON",{class:!0,title:!0});var Qr=h(It);fe(Yt.$$.fragment,Qr),Qr.forEach(c),Sl.forEach(c),ar=_(Ol),Kt=u(Ol,"DIV",{class:!0});var Wr=h(Kt);ht.l(Wr),Wr.forEach(c),Ol.forEach(c),ir=_(cl),ae&&ae.l(cl),cl.forEach(c),Mt.forEach(c),Gr.forEach(c),Vt.forEach(c),st.forEach(c),xl=_(d),ie&&ie.l(d),ll=_(d),$e&&$e.l(d),rl=At(),this.h()},h(){ls.title="Text to Speech - HFStudio",o(p,"class","text-sm text-gray-400"),o(x,"class","p-1 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors"),o(x,"title","Refresh with famous book opening"),o(i,"class","absolute top-3 right-3 flex items-center gap-2 z-10"),o(D,"maxlength","1000"),o(D,"class","w-full h-80 pt-10 px-6 pb-6 bg-white resize-none border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-amber-400 focus:border-transparent text-gray-900 text-lg leading-relaxed"),o(D,"placeholder","Type the text you'd like to convert to spoken audio here..."),D.autofocus=!0,o(a,"class","relative mb-4"),o(Y,"class","text-sm font-medium text-gray-900 mb-2"),o(Z,"class",z="w-full p-3 border border-gray-200 bg-white text-sm focus:outline-none focus:ring-2 focus:ring-amber-400 focus:border-transparent shadow-sm text-left flex items-center justify-between "+(s[8]?"rounded-b-lg border-t-0":"rounded-lg")),o(O,"class","relative"),o(B,"class","mt-1.5 text-xs text-gray-500 text-right"),o(U,"class","model-dropdown"),o(me,"class","text-sm font-medium text-gray-900 mb-2"),o(xe,"class","flex items-center gap-2"),o(Ie,"class","p-1 rounded-full hover:bg-gray-200 transition-colors w-5 h-5 flex items-center justify-center"),o(Ie,"title","Play sample"),o(Pe,"class","flex items-center justify-between mb-1"),o(be,"class",ot="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(s[1]==="Andrew"?"border-amber-400 bg-amber-50":"border-gray-200")),o(Re,"class","flex items-center gap-2"),o(N,"class","p-1 rounded-full hover:bg-gray-200 transition-colors w-5 h-5 flex items-center justify-center"),o(N,"title","Play sample"),o(ve,"class","flex items-center justify-between mb-1"),o(Ne,"class",at="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(s[1]==="Lily"?"border-amber-400 bg-amber-50":"border-gray-200")),o(qe,"class","flex items-center gap-2"),o(Me,"class","p-1 rounded-full hover:bg-gray-200 transition-colors w-5 h-5 flex items-center justify-center"),o(Me,"title","Play sample"),o(De,"class","flex items-center justify-between mb-1"),o(we,"class",ct="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(s[1]==="Pirate"?"border-amber-400 bg-amber-50":"border-gray-200")),o(X,"class","grid grid-cols-2 gap-2"),o(g,"for","exaggeration-slider"),o(g,"class","text-sm font-medium text-gray-900"),o(K,"class","text-sm text-gray-500"),o(lt,"class","flex justify-between mb-3"),o(Se,"id","exaggeration-slider"),o(Se,"type","range"),o(Se,"min","0"),o(Se,"max","1"),o(Se,"step","0.01"),o(Se,"class","w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"),o(Ot,"class","flex justify-between text-xs text-gray-400 mt-2"),o(bt,"for","temperature-slider"),o(bt,"class","text-sm font-medium text-gray-900"),o(el,"class","text-sm text-gray-500"),o(_t,"class","flex justify-between mb-3"),o(ze,"id","temperature-slider"),o(ze,"type","range"),o(ze,"min","0"),o(ze,"max","1"),o(ze,"step","0.01"),o(ze,"class","w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"),o(St,"class","flex justify-between text-xs text-gray-400 mt-2"),o(tt,"class","space-y-6"),o(w,"class","grid grid-cols-1 lg:grid-cols-[1fr_1.4fr_1fr] gap-6"),o(T,"class","p-4 border border-gray-200 rounded-lg bg-white mb-6"),rt.disabled=vl=s[9]||!s[0].trim(),o(rt,"class","w-full px-4 py-3 bg-gradient-to-r from-amber-400 to-orange-500 text-white rounded-lg font-medium hover:from-amber-500 hover:to-orange-600 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 shadow-sm"),o(r,"class","flex-1 flex flex-col p-6"),o(zt,"class","mb-4"),o(wt,"class",wl="px-2 py-1 text-xs font-medium rounded transition-colors "+(s[6]==="api"?"bg-white shadow-sm":"text-gray-600")),o(kt,"class",kl="px-2 py-1 text-xs font-medium rounded transition-colors "+(s[6]==="local"?"bg-white shadow-sm":"text-gray-600")),o(yt,"class","flex items-center bg-gray-100 rounded-md p-0.5"),o(Bt,"class","ml-1 text-xs font-medium text-gray-600"),o(ft,"class","flex items-center bg-gray-100 hover:bg-gray-200 rounded-md px-2 py-1 transition-colors"),o(vt,"class","flex items-center justify-between mb-4"),o(Ft,"class","flex items-center gap-2"),o(Tt,"class","p-1 hover:bg-blue-100 rounded transition-colors"),o(Tt,"title","Copy setup code"),o(Et,"class","flex items-center justify-between px-3 py-2 bg-blue-50 border-b border-blue-200"),o(qt,"class","relative"),o(xt,"class","bg-white rounded-lg border border-gray-200 overflow-hidden"),o(Gt,"class","flex items-center gap-2"),o(It,"class","p-1 hover:bg-amber-100 rounded transition-colors"),o(It,"title","Copy Python code"),o($t,"class","flex items-center justify-between px-3 py-2 bg-amber-50 border-b border-amber-200"),o(Kt,"class","relative"),o(Ct,"class","bg-white rounded-lg border border-gray-200 overflow-hidden"),o(Qe,"class","space-y-4"),o(Ue,"class","p-4"),o(tl,"class","w-96 border-l border-gray-200 bg-white overflow-y-auto"),o(l,"class","flex-1 flex"),o(t,"class","flex flex-col h-full"),o(t,"role","main"),o(t,"tabindex","-1")},m(d,k){j(d,e,k),j(d,t,k),n(t,l),n(l,r),n(r,a),n(a,i),n(i,p),n(p,$),n(p,y),n(i,v),n(i,x),ue(A,x,null),n(a,J),n(a,D),ul(D,s[0]),n(r,E),n(r,T),n(T,w),n(w,U),n(U,Y),n(U,_e),n(U,O),n(O,Z),n(Z,pe);for(let st=0;st<ke.length;st+=1)ke[st]&&ke[st].m(pe,null);n(Z,S),ue(V,Z,null),n(O,F),Te&&Te.m(O,null),n(U,q),n(U,B),n(w,ee),n(w,se),n(se,me),n(se,Fe),n(se,X),n(X,be),n(be,Pe),n(Pe,xe),n(Pe,We),n(Pe,Ie),Jt[R].m(Ie,null),n(X,Q),n(X,Ne),n(Ne,ve),n(ve,Re),n(ve,P),n(ve,N),Xt[W].m(N,null),n(X,Ze),n(X,we),n(we,De),n(De,qe),n(De,et),n(De,Me),Qt[oe].m(Me,null),n(X,gt),Dt[He].m(X,null),n(w,hl),n(w,tt),n(tt,Ke),n(Ke,lt),n(lt,g),n(lt,re),n(lt,K),n(K,Ge),n(Ke,pl),n(Ke,Se),ul(Se,s[3]),n(Ke,Fl),n(Ke,Ot),n(tt,Rl),n(tt,ut),n(ut,_t),n(_t,bt),n(_t,ql),n(_t,el),n(el,bl),n(ut,Gl),n(ut,ze),ul(ze,s[4]),n(ut,Yl),n(ut,St),n(r,Kl),n(r,rt),Wt[Je].m(rt,null),n(l,Jl),n(l,tl),n(tl,Ue),Ce&&Ce.m(Ue,null),n(Ue,yl),n(Ue,zt),n(Ue,Xl),n(Ue,vt),n(vt,yt),n(yt,wt),n(wt,Ql),n(yt,Wl),n(yt,kt),n(kt,Zl),n(vt,er),n(vt,ft),ue(Ut,ft,null),n(ft,tr),n(ft,Bt),n(Ue,lr),n(Ue,Qe),n(Qe,xt),n(xt,Et),n(Et,Ft),n(Et,rr),n(Et,Tt),ue(Rt,Tt,null),n(xt,sr),n(xt,qt),dt.m(qt,null),n(Qe,nr),n(Qe,Ct),n(Ct,$t),n($t,Gt),n($t,or),n($t,It),ue(Yt,It,null),n(Ct,ar),n(Ct,Kt),ht.m(Kt,null),n(Qe,ir),ae&&ae.m(Qe,null),j(d,xl,k),ie&&ie.m(d,k),j(d,ll,k),$e&&$e.m(d,k),j(d,rl,k),Ae=!0,D.focus(),cr||(Tr=[L(x,"click",s[37]),L(D,"input",s[40]),L(D,"keydown",s[34]),L(Z,"click",s[41]),L(Ie,"click",s[43]),L(be,"click",s[44]),L(N,"click",s[45]),L(Ne,"click",s[46]),L(Me,"click",s[47]),L(we,"click",s[48]),L(Se,"change",s[51]),L(Se,"input",s[51]),L(ze,"change",s[52]),L(ze,"input",s[52]),L(rt,"click",s[26]),L(wt,"click",s[54]),L(kt,"click",s[55]),L(ft,"click",s[39]),L(Tt,"click",s[56]),L(It,"click",s[57]),L(t,"click",s[35]),L(t,"keydown",s[34])],cr=!0)},p(d,k){if((!Ae||k[0]&1)&&m!==(m=d[0].length.toLocaleString()+"")&&Ye($,m),k[0]&1&&ul(D,d[0]),k[0]&33554436){sl=Ul(d[25]);let Ve;for(Ve=0;Ve<sl.length;Ve+=1){const gl=ss(d,sl,Ve);ke[Ve]?ke[Ve].p(gl,k):(ke[Ve]=os(gl),ke[Ve].c(),ke[Ve].m(pe,null))}for(;Ve<ke.length;Ve+=1)ke[Ve].d(1);ke.length=sl.length}const st={};k[0]&256&&(st.class="text-gray-500 transition-transform "+(d[8]?"rotate-180":"")),V.$set(st),(!Ae||k[0]&256&&z!==(z="w-full p-3 border border-gray-200 bg-white text-sm focus:outline-none focus:ring-2 focus:ring-amber-400 focus:border-transparent shadow-sm text-left flex items-center justify-between "+(d[8]?"rounded-b-lg border-t-0":"rounded-lg")))&&o(Z,"class",z),d[8]?Te?Te.p(d,k):(Te=as(d),Te.c(),Te.m(O,null)):Te&&(Te.d(1),Te=null);let Vt=R;R=$r(d),R!==Vt&&(mt(),I(Jt[Vt],1,1,()=>{Jt[Vt]=null}),pt(),ye=Jt[R],ye||(ye=Jt[R]=Cr[R](d),ye.c()),C(ye,1),ye.m(Ie,null)),(!Ae||k[0]&2&&ot!==(ot="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(d[1]==="Andrew"?"border-amber-400 bg-amber-50":"border-gray-200")))&&o(be,"class",ot);let nt=W;W=Dr(d),W!==nt&&(mt(),I(Xt[nt],1,1,()=>{Xt[nt]=null}),pt(),ne=Xt[W],ne||(ne=Xt[W]=Ir[W](d),ne.c()),C(ne,1),ne.m(N,null)),(!Ae||k[0]&2&&at!==(at="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(d[1]==="Lily"?"border-amber-400 bg-amber-50":"border-gray-200")))&&o(Ne,"class",at);let Pt=oe;oe=Pr(d),oe!==Pt&&(mt(),I(Qt[Pt],1,1,()=>{Qt[Pt]=null}),pt(),Ee=Qt[oe],Ee||(Ee=Qt[oe]=Vr[oe](d),Ee.c()),C(Ee,1),Ee.m(Me,null)),(!Ae||k[0]&2&&ct!==(ct="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(d[1]==="Pirate"?"border-amber-400 bg-amber-50":"border-gray-200")))&&o(we,"class",ct);let Lt=He;He=Nr(d),He===Lt?Dt[He].p(d,k):(mt(),I(Dt[Lt],1,1,()=>{Dt[Lt]=null}),pt(),je=Dt[He],je?je.p(d,k):(je=Dt[He]=Lr[He](d),je.c()),C(je,1),je.m(X,null)),(!Ae||k[0]&8)&&ge!==(ge=d[3].toFixed(2)+"")&&Ye(Ge,ge),k[0]&8&&ul(Se,d[3]),(!Ae||k[0]&16)&&ml!==(ml=d[4].toFixed(2)+"")&&Ye(bl,ml),k[0]&16&&ul(ze,d[4]);let Zt=Je;Je=Hr(d),Je!==Zt&&(mt(),I(Wt[Zt],1,1,()=>{Wt[Zt]=null}),pt(),Xe=Wt[Je],Xe||(Xe=Wt[Je]=Mr[Je](d),Xe.c()),C(Xe,1),Xe.m(rt,null)),(!Ae||k[0]&513&&vl!==(vl=d[9]||!d[0].trim()))&&(rt.disabled=vl),d[21]?Ce?Ce.p(d,k):(Ce=cs(d),Ce.c(),Ce.m(Ue,yl)):Ce&&(Ce.d(1),Ce=null),(!Ae||k[0]&64&&wl!==(wl="px-2 py-1 text-xs font-medium rounded transition-colors "+(d[6]==="api"?"bg-white shadow-sm":"text-gray-600")))&&o(wt,"class",wl),(!Ae||k[0]&64&&kl!==(kl="px-2 py-1 text-xs font-medium rounded transition-colors "+(d[6]==="local"?"bg-white shadow-sm":"text-gray-600")))&&o(kt,"class",kl),k[0]&128&&zl(kr,kr=d[7])?(dt.d(1),dt=us(d),dt.c(),dt.m(qt,null)):dt.p(d,k),k[0]&128&&zl(Er,Er=d[7])?(ht.d(1),ht=fs(d),ht.c(),ht.m(Kt,null)):ht.p(d,k),d[10]?ae?(ae.p(d,k),k[0]&1024&&C(ae,1)):(ae=ds(d),ae.c(),C(ae,1),ae.m(Qe,null)):ae&&(mt(),I(ae,1,1,()=>{ae=null}),pt()),d[18]?ie?(ie.p(d,k),k[0]&262144&&C(ie,1)):(ie=ms(d),ie.c(),C(ie,1),ie.m(ll.parentNode,ll)):ie&&(mt(),I(ie,1,1,()=>{ie=null}),pt()),d[22]?$e?$e.p(d,k):($e=_s(d),$e.c(),$e.m(rl.parentNode,rl)):$e&&($e.d(1),$e=null)},i(d){Ae||(C(A.$$.fragment,d),C(V.$$.fragment,d),C(ye),C(ne),C(Ee),C(je),C(Xe),C(Ut.$$.fragment,d),C(Rt.$$.fragment,d),C(Yt.$$.fragment,d),C(ae),C(ie),Ae=!0)},o(d){I(A.$$.fragment,d),I(V.$$.fragment,d),I(ye),I(ne),I(Ee),I(je),I(Xe),I(Ut.$$.fragment,d),I(Rt.$$.fragment,d),I(Yt.$$.fragment,d),I(ae),I(ie),Ae=!1},d(d){d&&(c(e),c(t),c(xl),c(ll),c(rl)),ce(A),ys(ke,d),ce(V),Te&&Te.d(),Jt[R].d(),Xt[W].d(),Qt[oe].d(),Dt[He].d(),Wt[Je].d(),Ce&&Ce.d(),ce(Ut),ce(Rt),dt.d(d),ce(Yt),ht.d(d),ae&&ae.d(),ie&&ie.d(d),$e&&$e.d(d),cr=!1,_l(Tr)}}}function fl(s){const e=Math.floor(s/60),t=Math.floor(s%60);return`${e}:${t.toString().padStart(2,"0")}`}function on(s,e,t){let l="In a hole in the ground, there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it was a hobbit-hole, and that means comfort.",r="Andrew",a="Chatterbox",i=!1,p=!1,m=null,$=0,y=.25,v=.7,x=!1,A=0,J=0,D="",E=null,T=null,w=null,U=!1,Y="",he="",_e=0,O=[],Z=!1,pe=!1,S=null,V="api",z="",F="",q=0;const B=["It was the best of times, it was the worst of times. It was the age of wisdom, it was the age of foolishness.","It is a truth universally acknowledged, that a single man in possession of a good fortune, must be in want of a wife.","All happy families are alike; each unhappy family is unhappy in its own way.","In a hole in the ground, there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it was a hobbit-hole, and that means comfort."];let Oe=0;const ee=[{id:"chatterbox",name:"Chatterbox",badge:"recommended"},{id:"kokoro",name:"Kokoro",badge:"coming soon",disabled:!0}],se=[{id:"andrew",name:"Andrew",description:"Older British man who speaks clearly and warmly.",sample:"/voices/andrew.mp3",preview_url:"https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/andrew.mp3"},{id:"lily",name:"Lily",description:"Friendly, conversational tone of a woman in her 30s",sample:"/voices/lily.mp3",preview_url:"https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/lily.mp3"},{id:"pirate",name:"Pirate",description:"Young male pirate-y voice that speaks gruffly and with excitement",sample:"/voices/pirate.mp3",preview_url:"https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/pirate.mp3"},{id:"fairy",name:"Fairy",description:"High and airy female voice that bursts with excitement",sample:"/voices/fairy.mp3",preview_url:"https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/fairy.mp3"}];async function me(){if(!l.trim())return;if(!(await fetch("/api/auth/user",{credentials:"include"})).ok){t(21,pe=!0);return}t(9,p=!0),t(10,m=null),t(13,A=0),t(12,x=!1),t(15,D=l.length>30?l.substring(0,30)+"...":l);try{const le={text:l,voice_id:r.toLowerCase(),model_id:a.toLowerCase(),mode:"api",parameters:{exaggeration:y,temperature:v}},re=await fetch("/api/tts/generate",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(le)});if(!re.ok){const ge=await re.text();throw new Error(`HTTP error! status: ${re.status}, body: ${ge}`)}const K=await re.json();if(K.success&&K.audio_url)t(10,m=K.audio_url),t(11,$=K.generation_time||0),await Q(le,K),setTimeout(()=>{E&&E.play().catch(()=>{})},100);else{const ge=K.error||"Unknown error occurred";R("Generation Failed",ge),t(10,m=null)}}catch{R("Network Error","Failed to connect to the server. Please check your connection and try again."),t(10,m=null)}finally{t(9,p=!1)}}function Be(){E&&(x?E.pause():E.play())}function Fe(){E&&t(14,J=E.duration)}function X(){E&&t(13,A=E.currentTime)}function be(){t(12,x=!0)}function Pe(){t(12,x=!1)}function xe(){if(m){const g=document.createElement("a");g.href=m,g.download="speech.wav",g.click()}}function Le(g,le){if(le.stopPropagation(),w===g.name)T&&(T.pause(),T.currentTime=0),t(17,w=null);else{T&&T.pause(),t(17,w=g.name);const re=g.sample||"/samples/harvard.wav";T?T.src=re:(T=new Audio(re),T.addEventListener("ended",()=>{t(17,w=null)})),T.play().catch(K=>{t(17,w=null)})}}function We(g){g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),me()),g.key==="Escape"&&t(8,i=!1)}function Ie(g){g.target.closest(".model-dropdown")||t(8,i=!1),g.target.closest(".voice-dropdown")}function R(g,le=""){t(19,Y=g),t(20,he=le),t(18,U=!0)}function ye(){t(18,U=!1),t(19,Y=""),t(20,he="")}function ot(){Oe=(Oe+1)%B.length,t(0,l=B[Oe])}async function Q(g,le){try{let re=null;const K=O.find(Ge=>Ge.voice_name===r);if(K&&K.voice_url)re=window.location.origin+K.voice_url;else{const Ge=se.find(pl=>pl.name===r);Ge&&Ge.preview_url&&(re=Ge.preview_url)}const ge=`audio_bytes = client.text_to_speech(
7
+ "${g.text.replace(/"/g,'\\"')}",
8
+ extra_body={
9
+ "exaggeration": ${g.parameters.exaggeration},
10
+ "temperature": ${g.parameters.temperature}${re?`,
11
+ "audio_url": "${re}"`:""}
12
+ }
13
+ )`;await fetch("/api/history/save",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({code:ge,result_type:"audio",result_data:{url:le.audio_url,title:D,type:"audio"},entry_type:"generation"})}),await Ne()}catch(re){console.error("Error saving to history:",re)}}async function Ne(){try{const g=await fetch("/api/history/load",{method:"GET",credentials:"include"});g.ok&&(_e=(await g.json()).entries.filter(K=>K.entry_type==="generation").length)}catch(g){console.error("Error loading history count:",g),_e=0}}async function ve(){try{Z=!0;const g=await fetch("/api/voice/user-voices",{method:"GET",credentials:"include"});if(g.ok){const le=await g.json();t(5,O=le.voices||[])}else t(5,O=[])}catch(g){console.error("Error loading user voices:",g),t(5,O=[])}finally{Z=!1}}function Re(){return V==="local"?`pip install huggingface-hub hfstudio uv
14
+ hfstudio start ${a.toLowerCase()} --port 7861`:"pip install huggingface-hub"}function te(){return V==="local"?'client = InferenceClient(base_url="http://localhost:7861/api/v1")':`client = InferenceClient(
15
+ api_key="YOUR_HF_TOKEN", # Get your token from https://huggingface.co/settings/tokens
16
+ model="${a.toLowerCase()==="chatterbox"?"ResembleAI/chatterbox":a.toLowerCase()}",
17
+ )`}function P(){let g=null;if(r==="Yours"&&O.length>0){const ge=O[0];ge&&ge.voice_url&&(g=window.location.origin+ge.voice_url)}else{const ge=se.find(Ge=>Ge.name===r);ge&&ge.preview_url&&(g=ge.preview_url)}const le=l||"Hello, this is a sample text.";return`${`from huggingface_hub import InferenceClient
18
+
19
+ ${te()}`}
20
+
21
+ audio_bytes = client.text_to_speech(
22
+ "${le.replace(/"/g,'\\"')}",
23
+ extra_body={
24
+ "exaggeration": ${y},
25
+ "temperature": ${v}${g?`,
26
+ "audio_url": "${g}"`:""}
27
+ }
28
+ )`}function N(g,le="Copied to clipboard!"){navigator.clipboard.writeText(g).then(()=>{t(22,S=le),setTimeout(()=>{t(22,S=null)},2e3)})}function W(){const g=[];if(z){const K=z.includes("pip install")||z.includes("hfstudio start")?"bash":"";g.push(`## Setup (Run in Terminal)
29
+
30
+ \`\`\`${K}
31
+ ${z}
32
+ \`\`\``)}F&&g.push(`## Python Code
33
+
34
+ \`\`\`python
35
+ ${F}
36
+ \`\`\``);const le=g.join(`
37
+
38
+ `);N(le,"All code copied as Markdown!")}Cs(async()=>{await Ne(),await ve()});function ne(){l=this.value,t(0,l)}const at=()=>t(8,i=!i),Ze=g=>{g.disabled||(t(2,a=g.name),t(8,i=!1))},we=g=>Le({name:"Andrew",sample:"/voices/andrew.mp3"},g),De=()=>t(1,r="Andrew"),qe=g=>Le({name:"Lily",sample:"/voices/lily.mp3"},g),it=()=>t(1,r="Lily"),et=g=>Le({name:"Pirate",sample:"/voices/pirate.mp3"},g),Me=()=>t(1,r="Pirate"),oe=g=>Le({name:"Yours",sample:O[0].voice_url},g),Ee=()=>t(1,r="Yours");function ct(){y=es(this.value),t(3,y)}function gt(){v=es(this.value),t(4,v)}const He=()=>t(21,pe=!1),je=()=>t(6,V="api"),hl=()=>t(6,V="local"),tt=()=>N(z),Ke=()=>N(F);function lt(g){$s[g?"unshift":"push"](()=>{E=g,t(16,E)})}return s.$$.update=()=>{s.$$.dirty[0]&255&&(t(23,z=Re()),t(24,F=P()),t(7,q++,q))},[l,r,a,y,v,O,V,q,i,p,m,$,x,A,J,D,E,w,U,Y,he,pe,S,z,F,ee,me,Be,Fe,X,be,Pe,xe,Le,We,Ie,ye,ot,N,W,ne,at,Ze,we,De,qe,it,et,Me,oe,Ee,ct,gt,He,je,hl,tt,Ke,lt]}class pn extends bs{constructor(e){super(),vs(this,e,on,nn,zl,{},null,[-1,-1,-1])}}export{pn as component};
hfstudio/static/_app/version.json CHANGED
@@ -1 +1 @@
1
- {"version":"1761280282149"}
 
1
+ {"version":"1761280915964"}
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.BaKegEJU.js">
10
- <link rel="modulepreload" href="/_app/immutable/chunks/DpK-nRy1.js">
11
  <link rel="modulepreload" href="/_app/immutable/chunks/TRxHAhOH.js">
12
- <link rel="modulepreload" href="/_app/immutable/entry/app.OF4DjnI5.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_ab53oa = {
20
  base: ""
21
  };
22
 
23
  const element = document.currentScript.parentElement;
24
 
25
  Promise.all([
26
- import("/_app/immutable/entry/start.BaKegEJU.js"),
27
- import("/_app/immutable/entry/app.OF4DjnI5.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.C-8lEFyc.js">
10
+ <link rel="modulepreload" href="/_app/immutable/chunks/DOHzRSwz.js">
11
  <link rel="modulepreload" href="/_app/immutable/chunks/TRxHAhOH.js">
12
+ <link rel="modulepreload" href="/_app/immutable/entry/app.z5hcEL1B.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_b6ga54 = {
20
  base: ""
21
  };
22
 
23
  const element = document.currentScript.parentElement;
24
 
25
  Promise.all([
26
+ import("/_app/immutable/entry/start.C-8lEFyc.js"),
27
+ import("/_app/immutable/entry/app.z5hcEL1B.js")
28
  ]).then(([kit, app]) => {
29
  kit.start(app, element);
30
  });