GitHub Action commited on
Commit
1dbaa6c
Β·
1 Parent(s): 46db306

Sync from GitHub: a61476ffe83ee246f6423f5398bde8c3db658351

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/lib/components/Navbar.svelte CHANGED
@@ -7,7 +7,9 @@
7
  </script>
8
 
9
  <!-- Top navbar -->
10
- <div class="flex items-center justify-between px-4 py-4 border-b border-gray-200 min-h-[73px]">
 
 
11
  <!-- Logo/Title -->
12
  <div class="flex items-center gap-2">
13
  <span class="font-semibold text-gray-900 text-xl">{pageTitle}</span>
 
7
  </script>
8
 
9
  <!-- Top navbar -->
10
+ <div
11
+ class="sticky top-0 z-30 bg-white flex items-center justify-between px-4 py-4 border-b border-gray-200 min-h-[73px]"
12
+ >
13
  <!-- Logo/Title -->
14
  <div class="flex items-center gap-2">
15
  <span class="font-semibold text-gray-900 text-xl">{pageTitle}</span>
frontend/src/routes/+page.svelte CHANGED
@@ -513,6 +513,89 @@ audio_bytes = client.text_to_speech(
513
  });
514
  }
515
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
516
  function copyAllCode() {
517
  const parts = [];
518
 
@@ -563,18 +646,21 @@ audio_bytes = client.text_to_speech(
563
  <div class="flex-1 flex flex-col p-6">
564
  <!-- Text input area -->
565
  <div class="relative mb-4">
566
- <div class="absolute top-3 right-3 flex items-center gap-2 z-10">
567
- <span class="text-sm text-gray-400">
568
- {text.length.toLocaleString()} / 1,000 characters
569
- </span>
570
  <button
571
  on:click={refreshText}
572
- class="p-1 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors"
573
  title="Refresh with famous book opening"
574
  >
575
  <Shuffle size={16} />
576
  </button>
577
  </div>
 
 
 
 
 
578
  <div class="relative">
579
  <textarea
580
  bind:value={text}
@@ -611,7 +697,7 @@ audio_bytes = client.text_to_speech(
611
  <button
612
  on:click={() => (modelDropdownOpen = !modelDropdownOpen)}
613
  class="w-full p-3 border 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 {modelDropdownOpen
614
- ? 'rounded-b-lg border-t-0 border-black'
615
  : 'rounded-lg border-black'}"
616
  >
617
  <span>
@@ -631,7 +717,7 @@ audio_bytes = client.text_to_speech(
631
 
632
  {#if modelDropdownOpen}
633
  <div
634
- 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"
635
  >
636
  {#each models as model}
637
  <button
@@ -884,8 +970,8 @@ audio_bytes = client.text_to_speech(
884
  </div>
885
 
886
  <!-- Right sidebar - Live Code Display -->
887
- <div class="w-96 border-l border-gray-200 bg-white overflow-y-auto">
888
- <div class="p-4">
889
  <!-- Login prompt if not authenticated -->
890
  {#if showLoginPrompt}
891
  <div
@@ -962,7 +1048,7 @@ audio_bytes = client.text_to_speech(
962
  </button>
963
 
964
  <button
965
- on:click={() => window.open('https://huggingface.co/new-space', '_blank')}
966
  class="flex items-center bg-amber-100 hover:bg-amber-200 rounded-md px-2 py-1 transition-colors"
967
  >
968
  <svg
 
513
  });
514
  }
515
 
516
+ function deployAsSpace() {
517
+ // Get voice URL for the current selection
518
+ let voiceUrl = null;
519
+ if (selectedVoice === 'Yours' && userVoices.length > 0) {
520
+ const userVoice = userVoices[0];
521
+ if (userVoice && userVoice.voice_url) {
522
+ voiceUrl = window.location.origin + userVoice.voice_url;
523
+ }
524
+ } else {
525
+ const voice = voices.find((v) => v.name === selectedVoice);
526
+ if (voice && voice.preview_url) {
527
+ voiceUrl = voice.preview_url;
528
+ }
529
+ }
530
+
531
+ // Generate the app.py content
532
+ const appCode = `from huggingface_hub import InferenceClient
533
+ import gradio as gr
534
+ import os
535
+
536
+ client = InferenceClient(api_key=os.getenv("HF_TOKEN"))
537
+
538
+ def generate_speech(text):
539
+ if not text.strip():
540
+ return None
541
+
542
+ try:
543
+ audio_bytes = client.text_to_speech(
544
+ text,
545
+ extra_body={
546
+ "exaggeration": ${exaggeration},
547
+ "temperature": ${temperature},
548
+ ${voiceUrl ? `"audio_url": "${voiceUrl}",` : ''}
549
+ }
550
+ )
551
+ return audio_bytes
552
+ except Exception as e:
553
+ raise gr.Error(f"Error generating speech: {str(e)}")
554
+
555
+ # Create the Gradio interface
556
+ with gr.Blocks(title="Text to Speech") as demo:
557
+ gr.Markdown("# Text to Speech")
558
+ gr.Markdown("Convert text to speech using the Chatterbox model.")
559
+
560
+ with gr.Row():
561
+ with gr.Column():
562
+ text_input = gr.Textbox(
563
+ label="Text to convert to speech",
564
+ placeholder="${text.replace(/"/g, '\\"').substring(0, 100)}...",
565
+ lines=5,
566
+ value="${text.replace(/"/g, '\\"')}"
567
+ )
568
+ generate_btn = gr.Button("Generate Speech", variant="primary")
569
+
570
+ with gr.Column():
571
+ audio_output = gr.Audio(label="Generated Speech")
572
+
573
+ generate_btn.click(
574
+ fn=generate_speech,
575
+ inputs=[text_input],
576
+ outputs=[audio_output]
577
+ )
578
+
579
+ if __name__ == "__main__":
580
+ demo.launch()`;
581
+
582
+ const requirementsContent = `huggingface_hub
583
+ gradio`;
584
+
585
+ // Create the deployment URL
586
+ const baseUrl = 'https://huggingface.co/new-space';
587
+ const params = new URLSearchParams({
588
+ name: `text-to-speech-${selectedVoice.toLowerCase()}-${Date.now()}`,
589
+ sdk: 'gradio',
590
+ 'files[0][path]': 'app.py',
591
+ 'files[0][content]': appCode,
592
+ 'files[1][path]': 'requirements.txt',
593
+ 'files[1][content]': requirementsContent,
594
+ });
595
+
596
+ window.open(`${baseUrl}?${params.toString()}`, '_blank');
597
+ }
598
+
599
  function copyAllCode() {
600
  const parts = [];
601
 
 
646
  <div class="flex-1 flex flex-col p-6">
647
  <!-- Text input area -->
648
  <div class="relative mb-4">
649
+ <div class="absolute top-3 left-3 flex items-center gap-2 z-10">
650
+ <span class="text-sm text-gray-400">Text to speak</span>
 
 
651
  <button
652
  on:click={refreshText}
653
+ class="text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors"
654
  title="Refresh with famous book opening"
655
  >
656
  <Shuffle size={16} />
657
  </button>
658
  </div>
659
+ <div class="absolute top-3 right-3 flex items-center gap-2 z-10">
660
+ <span class="text-sm text-gray-400">
661
+ {text.length.toLocaleString()} / 1,000 characters
662
+ </span>
663
+ </div>
664
  <div class="relative">
665
  <textarea
666
  bind:value={text}
 
697
  <button
698
  on:click={() => (modelDropdownOpen = !modelDropdownOpen)}
699
  class="w-full p-3 border 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 {modelDropdownOpen
700
+ ? 'rounded-t-lg border-b-0 border-black'
701
  : 'rounded-lg border-black'}"
702
  >
703
  <span>
 
717
 
718
  {#if modelDropdownOpen}
719
  <div
720
+ class="absolute top-full left-0 right-0 border border-gray-200 border-t-0 bg-white shadow-lg rounded-b-lg overflow-hidden z-20"
721
  >
722
  {#each models as model}
723
  <button
 
970
  </div>
971
 
972
  <!-- Right sidebar - Live Code Display -->
973
+ <div class="w-96 border-l border-gray-200 bg-white h-full overflow-hidden">
974
+ <div class="p-4 h-full overflow-y-auto">
975
  <!-- Login prompt if not authenticated -->
976
  {#if showLoginPrompt}
977
  <div
 
1048
  </button>
1049
 
1050
  <button
1051
+ on:click={deployAsSpace}
1052
  class="flex items-center bg-amber-100 hover:bg-amber-200 rounded-md px-2 py-1 transition-colors"
1053
  >
1054
  <svg
frontend/src/routes/voice-cloning/+page.svelte CHANGED
@@ -475,9 +475,7 @@
475
  <!-- Script text -->
476
  <div class="relative mb-4">
477
  <div class="absolute top-3 left-3 flex items-center gap-2 z-10">
478
- <span class="text-sm text-gray-400">Sample script</span>
479
- </div>
480
- <div class="absolute top-3 right-3 flex items-center gap-2 z-10">
481
  <button
482
  on:click={shuffleSampleText}
483
  class="p-1 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors"
@@ -487,7 +485,7 @@
487
  </button>
488
  </div>
489
  <div
490
- class="w-full h-80 pt-10 px-6 pb-6 bg-white border border-amber-400 rounded-lg text-gray-900 text-lg leading-relaxed overflow-y-auto"
491
  >
492
  <p>
493
  <span class="bg-yellow-50 px-2 py-1 rounded border border-amber-200"
@@ -555,225 +553,227 @@
555
  </div>
556
 
557
  <!-- Right panel for voice cloning -->
558
- <div class="w-80 border-l border-gray-200 bg-white p-3 overflow-y-auto">
559
- {#if !isLoggedIn && showLoginPrompt}
560
- <!-- Login prompt message -->
561
- <div
562
- class="mb-3 px-3 py-2 bg-gradient-to-r from-amber-50 to-orange-50 rounded-lg border border-amber-200 relative"
563
- >
564
- <!-- Close button -->
565
- <button
566
- on:click={() => (showLoginPrompt = false)}
567
- class="absolute top-2 right-2 text-gray-400 hover:text-gray-600 transition-colors"
568
- aria-label="Dismiss"
569
  >
570
- <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
571
- <path
572
- stroke-linecap="round"
573
- stroke-linejoin="round"
574
- stroke-width="2"
575
- d="M6 18L18 6M6 6l12 12"
576
- />
577
- </svg>
578
- </button>
579
-
580
- <p class="text-sm font-medium text-gray-700 mb-1 pr-4">
581
- Hugging Face <span
582
- class="bg-gradient-to-r from-purple-500 via-pink-500 via-green-500 to-blue-500 bg-clip-text text-transparent font-bold"
583
- >PRO</span
584
  >
585
- </p>
586
- <p class="text-sm text-gray-600 pr-4">
587
- Sign in to with your Hugging Face <a
588
- href="https://huggingface.co/pro"
589
- target="_blank"
590
- class="text-amber-600 hover:text-amber-700 underline font-medium">PRO account</a
591
- > to get started with $2 of free API credits per month. You can add a billing method for
592
- additional pay-as-you-go usage ‴
593
- </p>
594
- </div>
595
- {/if}
596
-
597
- <div class="mb-4">
598
- {#if sessionRecordings.length === 0}
599
- <div class="text-center py-8 text-gray-500">
600
- <Mic size={32} class="mx-auto mb-2 opacity-30" />
601
- <p class="text-sm">Pick a recording to clone</p>
602
- <p class="text-xs text-gray-400">No recordings yet</p>
603
- </div>
604
- {:else}
605
- <div class="space-y-2">
606
- {#each sessionRecordings as recording, i}
607
- <div
608
- class="border rounded-lg p-3 {selectedRecording?.id === recording.id
609
- ? 'border-amber-300 bg-amber-50'
610
- : 'border-gray-200 hover:border-gray-300'} transition-colors"
611
  >
612
- <div class="flex items-center justify-between mb-2">
613
- <span class="text-sm font-medium text-gray-900">Recording {i + 1}</span>
614
- <button
615
- on:click={() => togglePlayRecording(recording)}
616
- class="p-1 hover:bg-gray-100 rounded transition-colors"
617
- >
618
- {#if playingRecording?.id === recording.id && currentAudio && !currentAudio.paused}
619
- <Pause size={14} class="text-gray-600" />
620
- {:else}
621
- <Play size={14} class="text-gray-600" />
622
- {/if}
623
- </button>
624
- </div>
625
- <div class="text-xs text-gray-500 mb-2">
626
- {recording.timestamp.toLocaleTimeString()}
627
- </div>
628
- <button
629
- on:click={() => selectRecording(recording)}
630
- class="w-full text-xs px-2 py-1 rounded {selectedRecording?.id === recording.id
631
- ? 'bg-amber-200 text-amber-800'
632
- : 'bg-gray-100 text-gray-700 hover:bg-gray-200'} transition-colors"
633
- >
634
- {selectedRecording?.id === recording.id ? 'Selected' : 'Select for cloning'}
635
- </button>
636
- </div>
637
- {/each}
638
  </div>
639
  {/if}
640
- </div>
641
 
642
- <!-- Clone section -->
643
- <div class="mt-6 pt-4 border-t border-gray-200">
644
- <button
645
- on:click={cloneVoice}
646
- disabled={!selectedRecording || isTranscribing || isUploading}
647
- class="w-full px-4 py-2 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 transition-colors flex items-center justify-center gap-2"
648
- >
649
- {#if isTranscribing}
650
- <Loader2 size={16} class="animate-spin" />
651
- Transcribing...
652
- {:else if isUploading}
653
- <Loader2 size={16} class="animate-spin" />
654
- Uploading...
655
  {:else}
656
- Clone
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
657
  {/if}
658
- </button>
659
 
660
- <!-- Validation status -->
661
- <div class="mt-3 text-sm flex items-center gap-4">
662
- <span
663
- class="flex items-center gap-1 {selectedRecording
664
- ? isRecordingLongEnough(selectedRecording)
665
- ? 'text-green-600'
666
- : 'text-red-600'
667
- : 'text-gray-400'}"
668
  >
669
- {#if selectedRecording}
670
- {#if isRecordingLongEnough(selectedRecording)}
671
- βœ“
672
- {:else}
673
- βœ—
674
- {/if}
675
  {:else}
676
- βœ“
677
  {/if}
678
- at least 3 seconds
679
- </span>
680
- <span
681
- class="flex items-center gap-1 {selectedRecording
682
- ? hasConsent(selectedRecording)
683
- ? 'text-green-600'
684
- : transcriptionStatus[selectedRecording.id]
685
- ? 'text-red-600'
686
- : 'text-gray-400'
687
- : 'text-gray-400'}"
688
- >
689
- {#if selectedRecording && transcriptionStatus[selectedRecording.id]}
690
- {#if hasConsent(selectedRecording)}
 
 
 
 
 
691
  βœ“
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
692
  {:else}
693
- βœ—
694
  {/if}
695
- {:else}
696
- βœ“
697
- {/if}
698
- includes consent
699
- </span>
700
- </div>
701
-
702
- <!-- Transcript preview -->
703
- {#if selectedRecording && transcriptionStatus[selectedRecording.id]}
704
- <div class="mt-3 p-3 bg-gray-50 rounded-lg border">
705
- <p class="text-sm text-gray-600 italic">
706
- "{transcriptionStatus[selectedRecording.id].first_words}..."
707
- </p>
708
  </div>
709
- {/if}
710
 
711
- <!-- Success message -->
712
- {#if successMessage && selectedRecording && uploadResults[selectedRecording.id]}
713
- <div class="mt-3 p-3 bg-green-50 rounded-lg border border-green-200">
714
- <p class="text-sm text-green-700">
715
- Your voice has been saved to a <a
716
- href={uploadResults[selectedRecording.id].voice_url}
717
- target="_blank"
718
- class="text-green-800 underline hover:text-green-900">temporary URL</a
719
- > for 24 hours and will be automatically deleted. You can now use it for text-to-speech
720
- generation.
721
- </p>
722
- </div>
723
- {:else if successMessage}
724
- <div class="mt-3 p-3 bg-green-50 rounded-lg border border-green-200">
725
- <p class="text-sm text-green-700">
726
- {successMessage}
727
- </p>
728
- </div>
729
- {/if}
730
- </div>
731
 
732
- <!-- Existing voices section -->
733
- {#if isLoggedIn && userVoices.length > 0}
734
- <div class="mt-6 pt-4 border-t border-gray-200">
735
- <h3 class="text-sm font-medium text-gray-700 mb-3">Your existing voice clone</h3>
736
- <div class="space-y-2">
737
- {#each userVoices as voice}
738
- <div class="border rounded-lg p-3 bg-blue-50 border-blue-200">
739
- <div class="flex items-center justify-between mb-2">
740
- <span class="text-sm font-medium text-blue-900">{voice.voice_name}</span>
741
- <div class="flex items-center gap-2">
742
- <button
743
- on:click={() => togglePlayRecording({ url: voice.voice_url, id: voice.id })}
744
- class="p-1 hover:bg-blue-100 rounded transition-colors"
745
- title="Play voice sample"
746
- >
747
- {#if playingRecording?.id === voice.id && currentAudio && !currentAudio.paused}
748
- <Pause size={14} class="text-blue-600" />
749
- {:else}
750
- <Play size={14} class="text-blue-600" />
751
- {/if}
752
- </button>
753
- <button
754
- on:click={() => deleteVoice(voice.id)}
755
- disabled={isDeletingVoice}
756
- class="p-1 text-red-600 hover:text-red-800 hover:bg-red-100 rounded transition-colors disabled:opacity-50"
757
- title="Delete voice"
758
- >
759
- {#if isDeletingVoice}
760
- <Loader2 size={14} class="animate-spin" />
761
- {:else}
762
- <Trash2 size={14} />
763
- {/if}
764
- </button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
765
  </div>
766
  </div>
767
- <div class="text-xs text-blue-600">
768
- Expires: {new Date(voice.expires_at).toLocaleDateString()} at {new Date(
769
- voice.expires_at
770
- ).toLocaleTimeString()}
771
- </div>
772
- </div>
773
- {/each}
774
  </div>
775
- </div>
776
- {/if}
777
  </div>
778
  </div>
779
  </div>
 
475
  <!-- Script text -->
476
  <div class="relative mb-4">
477
  <div class="absolute top-3 left-3 flex items-center gap-2 z-10">
478
+ <span class="text-sm text-gray-400">Sample script to read</span>
 
 
479
  <button
480
  on:click={shuffleSampleText}
481
  class="p-1 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors"
 
485
  </button>
486
  </div>
487
  <div
488
+ class="w-full h-80 pt-12 px-6 pb-6 bg-white border-2 border-amber-400 rounded-lg text-gray-900 text-lg leading-relaxed overflow-y-auto"
489
  >
490
  <p>
491
  <span class="bg-yellow-50 px-2 py-1 rounded border border-amber-200"
 
553
  </div>
554
 
555
  <!-- Right panel for voice cloning -->
556
+ <div class="w-80 border-l border-gray-200 bg-white h-full overflow-hidden">
557
+ <div class="p-3 h-full overflow-y-auto">
558
+ {#if !isLoggedIn && showLoginPrompt}
559
+ <!-- Login prompt message -->
560
+ <div
561
+ class="mb-3 px-3 py-2 bg-gradient-to-r from-amber-50 to-orange-50 rounded-lg border border-amber-200 relative"
 
 
 
 
 
562
  >
563
+ <!-- Close button -->
564
+ <button
565
+ on:click={() => (showLoginPrompt = false)}
566
+ class="absolute top-2 right-2 text-gray-400 hover:text-gray-600 transition-colors"
567
+ aria-label="Dismiss"
 
 
 
 
 
 
 
 
 
568
  >
569
+ <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
570
+ <path
571
+ stroke-linecap="round"
572
+ stroke-linejoin="round"
573
+ stroke-width="2"
574
+ d="M6 18L18 6M6 6l12 12"
575
+ />
576
+ </svg>
577
+ </button>
578
+
579
+ <p class="text-sm font-medium text-gray-700 mb-1 pr-4">
580
+ Hugging Face <span
581
+ class="bg-gradient-to-r from-purple-500 via-pink-500 via-green-500 to-blue-500 bg-clip-text text-transparent font-bold"
582
+ >PRO</span
 
 
 
 
 
 
 
 
 
 
 
 
583
  >
584
+ </p>
585
+ <p class="text-sm text-gray-600 pr-4">
586
+ Sign in to with your Hugging Face <a
587
+ href="https://huggingface.co/pro"
588
+ target="_blank"
589
+ class="text-amber-600 hover:text-amber-700 underline font-medium">PRO account</a
590
+ > to get started with $2 of free API credits per month. You can add a billing method for
591
+ additional pay-as-you-go usage ‴
592
+ </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
593
  </div>
594
  {/if}
 
595
 
596
+ <div class="mb-4">
597
+ {#if sessionRecordings.length === 0}
598
+ <div class="text-center py-8 text-gray-500">
599
+ <Mic size={32} class="mx-auto mb-2 opacity-30" />
600
+ <p class="text-sm">Pick a recording to clone</p>
601
+ <p class="text-xs text-gray-400">No recordings yet</p>
602
+ </div>
 
 
 
 
 
 
603
  {:else}
604
+ <div class="space-y-2">
605
+ {#each sessionRecordings as recording, i}
606
+ <div
607
+ class="border rounded-lg p-3 {selectedRecording?.id === recording.id
608
+ ? 'border-amber-300 bg-amber-50'
609
+ : 'border-gray-200 hover:border-gray-300'} transition-colors"
610
+ >
611
+ <div class="flex items-center justify-between mb-2">
612
+ <span class="text-sm font-medium text-gray-900">Recording {i + 1}</span>
613
+ <button
614
+ on:click={() => togglePlayRecording(recording)}
615
+ class="p-1 hover:bg-gray-100 rounded transition-colors"
616
+ >
617
+ {#if playingRecording?.id === recording.id && currentAudio && !currentAudio.paused}
618
+ <Pause size={14} class="text-gray-600" />
619
+ {:else}
620
+ <Play size={14} class="text-gray-600" />
621
+ {/if}
622
+ </button>
623
+ </div>
624
+ <div class="text-xs text-gray-500 mb-2">
625
+ {recording.timestamp.toLocaleTimeString()}
626
+ </div>
627
+ <button
628
+ on:click={() => selectRecording(recording)}
629
+ class="w-full text-xs px-2 py-1 rounded {selectedRecording?.id === recording.id
630
+ ? 'bg-amber-200 text-amber-800'
631
+ : 'bg-gray-100 text-gray-700 hover:bg-gray-200'} transition-colors"
632
+ >
633
+ {selectedRecording?.id === recording.id ? 'Selected' : 'Select for cloning'}
634
+ </button>
635
+ </div>
636
+ {/each}
637
+ </div>
638
  {/if}
639
+ </div>
640
 
641
+ <!-- Clone section -->
642
+ <div class="mt-6 pt-4 border-t border-gray-200">
643
+ <button
644
+ on:click={cloneVoice}
645
+ disabled={!selectedRecording || isTranscribing || isUploading}
646
+ class="w-full px-4 py-2 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 transition-colors flex items-center justify-center gap-2"
 
 
647
  >
648
+ {#if isTranscribing}
649
+ <Loader2 size={16} class="animate-spin" />
650
+ Transcribing...
651
+ {:else if isUploading}
652
+ <Loader2 size={16} class="animate-spin" />
653
+ Uploading...
654
  {:else}
655
+ Clone
656
  {/if}
657
+ </button>
658
+
659
+ <!-- Validation status -->
660
+ <div class="mt-3 text-sm flex items-center gap-4">
661
+ <span
662
+ class="flex items-center gap-1 {selectedRecording
663
+ ? isRecordingLongEnough(selectedRecording)
664
+ ? 'text-green-600'
665
+ : 'text-red-600'
666
+ : 'text-gray-400'}"
667
+ >
668
+ {#if selectedRecording}
669
+ {#if isRecordingLongEnough(selectedRecording)}
670
+ βœ“
671
+ {:else}
672
+ βœ—
673
+ {/if}
674
+ {:else}
675
  βœ“
676
+ {/if}
677
+ at least 3 seconds
678
+ </span>
679
+ <span
680
+ class="flex items-center gap-1 {selectedRecording
681
+ ? hasConsent(selectedRecording)
682
+ ? 'text-green-600'
683
+ : transcriptionStatus[selectedRecording.id]
684
+ ? 'text-red-600'
685
+ : 'text-gray-400'
686
+ : 'text-gray-400'}"
687
+ >
688
+ {#if selectedRecording && transcriptionStatus[selectedRecording.id]}
689
+ {#if hasConsent(selectedRecording)}
690
+ βœ“
691
+ {:else}
692
+ βœ—
693
+ {/if}
694
  {:else}
695
+ βœ“
696
  {/if}
697
+ includes consent
698
+ </span>
 
 
 
 
 
 
 
 
 
 
 
699
  </div>
 
700
 
701
+ <!-- Transcript preview -->
702
+ {#if selectedRecording && transcriptionStatus[selectedRecording.id]}
703
+ <div class="mt-3 p-3 bg-gray-50 rounded-lg border">
704
+ <p class="text-sm text-gray-600 italic">
705
+ "{transcriptionStatus[selectedRecording.id].first_words}..."
706
+ </p>
707
+ </div>
708
+ {/if}
 
 
 
 
 
 
 
 
 
 
 
 
709
 
710
+ <!-- Success message -->
711
+ {#if successMessage && selectedRecording && uploadResults[selectedRecording.id]}
712
+ <div class="mt-3 p-3 bg-green-50 rounded-lg border border-green-200">
713
+ <p class="text-sm text-green-700">
714
+ Your voice has been saved to a <a
715
+ href={uploadResults[selectedRecording.id].voice_url}
716
+ target="_blank"
717
+ class="text-green-800 underline hover:text-green-900">temporary URL</a
718
+ > for 24 hours and will be automatically deleted. You can now use it for text-to-speech
719
+ generation.
720
+ </p>
721
+ </div>
722
+ {:else if successMessage}
723
+ <div class="mt-3 p-3 bg-green-50 rounded-lg border border-green-200">
724
+ <p class="text-sm text-green-700">
725
+ {successMessage}
726
+ </p>
727
+ </div>
728
+ {/if}
729
+ </div>
730
+
731
+ <!-- Existing voices section -->
732
+ {#if isLoggedIn && userVoices.length > 0}
733
+ <div class="mt-6 pt-4 border-t border-gray-200">
734
+ <h3 class="text-sm font-medium text-gray-700 mb-3">Your existing voice clone</h3>
735
+ <div class="space-y-2">
736
+ {#each userVoices as voice}
737
+ <div class="border rounded-lg p-3 bg-blue-50 border-blue-200">
738
+ <div class="flex items-center justify-between mb-2">
739
+ <span class="text-sm font-medium text-blue-900">{voice.voice_name}</span>
740
+ <div class="flex items-center gap-2">
741
+ <button
742
+ on:click={() => togglePlayRecording({ url: voice.voice_url, id: voice.id })}
743
+ class="p-1 hover:bg-blue-100 rounded transition-colors"
744
+ title="Play voice sample"
745
+ >
746
+ {#if playingRecording?.id === voice.id && currentAudio && !currentAudio.paused}
747
+ <Pause size={14} class="text-blue-600" />
748
+ {:else}
749
+ <Play size={14} class="text-blue-600" />
750
+ {/if}
751
+ </button>
752
+ <button
753
+ on:click={() => deleteVoice(voice.id)}
754
+ disabled={isDeletingVoice}
755
+ class="p-1 text-red-600 hover:text-red-800 hover:bg-red-100 rounded transition-colors disabled:opacity-50"
756
+ title="Delete voice"
757
+ >
758
+ {#if isDeletingVoice}
759
+ <Loader2 size={14} class="animate-spin" />
760
+ {:else}
761
+ <Trash2 size={14} />
762
+ {/if}
763
+ </button>
764
+ </div>
765
+ </div>
766
+ <div class="text-xs text-blue-600">
767
+ Expires: {new Date(voice.expires_at).toLocaleDateString()} at {new Date(
768
+ voice.expires_at
769
+ ).toLocaleTimeString()}
770
  </div>
771
  </div>
772
+ {/each}
773
+ </div>
 
 
 
 
 
774
  </div>
775
+ {/if}
776
+ </div>
777
  </div>
778
  </div>
779
  </div>
hfstudio/server.py CHANGED
@@ -206,6 +206,22 @@ def generate_tts_with_client(
206
 
207
  # Time the API call
208
  start_time = time.time()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
  audio_bytes = client.text_to_speech(
210
  request.text,
211
  extra_body=extra_body if extra_body else None,
 
206
 
207
  # Time the API call
208
  start_time = time.time()
209
+
210
+ # DEBUGGING: Print exact API call details
211
+ print("=" * 60)
212
+ print("EXACT HUGGINGFACE_HUB API CALL BEING MADE:")
213
+ print(f"client.text_to_speech(")
214
+ print(
215
+ f' text="{request.text[:50] + "..." if len(request.text) > 50 else request.text}",'
216
+ )
217
+ print(f" extra_body={extra_body if extra_body else None}")
218
+ print(f")")
219
+ print(f"Client details:")
220
+ print(f" - Model: {getattr(client, 'model', 'Not set')}")
221
+ print(f" - Base URL: {getattr(client, 'base_url', 'Default HF API')}")
222
+ print(f" - Headers: {getattr(client, 'headers', {})}")
223
+ print("=" * 60)
224
+
225
  audio_bytes = client.text_to_speech(
226
  request.text,
227
  extra_body=extra_body if extra_body else None,
hfstudio/static/_app/immutable/assets/0.B_i4o2sT.css ADDED
@@ -0,0 +1 @@
 
 
1
+ *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.-left-full{left:-100%}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-0{left:0}.left-3{left:.75rem}.right-0{right:0}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-2{top:.5rem}.top-3{top:.75rem}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-0\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.flex{display:flex}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-2{height:.5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-80{height:20rem}.h-96{height:24rem}.h-full{height:100%}.h-screen{height:100vh}.max-h-\[80vh\]{max-height:80vh}.min-h-0{min-height:0px}.min-h-\[73px\]{min-height:73px}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-80{width:20rem}.w-96{width:24rem}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.rounded-b-lg{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-4{border-width:4px}.border-b{border-bottom-width:1px}.border-b-0{border-bottom-width:0px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-t-0{border-top-width:0px}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-amber-300{--tw-border-opacity: 1;border-color:rgb(252 211 77 / var(--tw-border-opacity, 1))}.border-amber-400{--tw-border-opacity: 1;border-color:rgb(251 191 36 / var(--tw-border-opacity, 1))}.border-black{--tw-border-opacity: 1;border-color:rgb(0 0 0 / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-orange-100{--tw-border-opacity: 1;border-color:rgb(255 237 213 / var(--tw-border-opacity, 1))}.border-orange-200{--tw-border-opacity: 1;border-color:rgb(254 215 170 / var(--tw-border-opacity, 1))}.border-orange-300{--tw-border-opacity: 1;border-color:rgb(253 186 116 / var(--tw-border-opacity, 1))}.border-orange-500{--tw-border-opacity: 1;border-color:rgb(249 115 22 / var(--tw-border-opacity, 1))}.border-purple-200{--tw-border-opacity: 1;border-color:rgb(233 213 255 / var(--tw-border-opacity, 1))}.border-purple-400{--tw-border-opacity: 1;border-color:rgb(192 132 252 / var(--tw-border-opacity, 1))}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-200{--tw-bg-opacity: 1;background-color:rgb(253 230 138 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-purple-50{--tw-bg-opacity: 1;background-color:rgb(250 245 255 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-opacity-50{--tw-bg-opacity: .5}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-amber-400{--tw-gradient-from: #fbbf24 var(--tw-gradient-from-position);--tw-gradient-to: rgb(251 191 36 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-amber-50{--tw-gradient-from: #fffbeb var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 251 235 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-amber-500{--tw-gradient-from: #f59e0b var(--tw-gradient-from-position);--tw-gradient-to: rgb(245 158 11 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-50{--tw-gradient-from: #f9fafb var(--tw-gradient-from-position);--tw-gradient-to: rgb(249 250 251 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-400{--tw-gradient-from: #c084fc var(--tw-gradient-from-position);--tw-gradient-to: rgb(192 132 252 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-green-500{--tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #22c55e var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-orange-400\/40{--tw-gradient-to: rgb(251 146 60 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(251 146 60 / .4) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-pink-500{--tw-gradient-to: rgb(236 72 153 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #ec4899 var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-blue-500{--tw-gradient-to: #3b82f6 var(--tw-gradient-to-position)}.to-orange-50{--tw-gradient-to: #fff7ed var(--tw-gradient-to-position)}.to-orange-500{--tw-gradient-to: #f97316 var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to: #ec4899 var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.to-white{--tw-gradient-to: #fff var(--tw-gradient-to-position)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-16{padding-bottom:4rem}.pb-24{padding-bottom:6rem}.pb-6{padding-bottom:1.5rem}.pr-4{padding-right:1rem}.pt-10{padding-top:2.5rem}.pt-12{padding-top:3rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-green-900{--tw-text-opacity: 1;color:rgb(20 83 45 / var(--tw-text-opacity, 1))}.text-orange-700{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-purple-900{--tw-text-opacity: 1;color:rgb(88 28 135 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-200{transition-duration:.2s}.duration-75{transition-duration:75ms}.ease-linear{transition-timing-function:linear}code[class*=language-],pre[class*=language-]{color:#393a34;font-family:Consolas,Bitstream Vera Sans Mono,Courier New,Courier,monospace;direction:ltr;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;font-size:.875rem;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;hyphens:none}pre[class*=language-]{padding:1rem;margin:0;overflow:auto;background:#f8f9fa}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:green;font-style:italic}.token.punctuation{color:#393a34}.token.property,.token.tag,.token.boolean,.token.number,.token.constant,.token.symbol,.token.deleted{color:#e91e63}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color:#067d17}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string{color:#795da3}.token.atrule,.token.attr-value,.token.keyword{color:#00f}.token.function,.token.class-name{color:#795da3}.token.regex,.token.important,.token.variable{color:#e90}.language-bash .token.function{color:#067d17}.slider-hf::-webkit-slider-thumb{height:1rem;width:1rem;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:9999px;background:linear-gradient(45deg,#ffd21e,#ff9d00);box-shadow:0 1px 3px #0000001a}.slider-hf::-moz-range-thumb{height:1rem;width:1rem;cursor:pointer;border-radius:9999px;border-width:0px;background:linear-gradient(45deg,#ffd21e,#ff9d00);box-shadow:0 1px 3px #0000001a}.pause-filled{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px}.pause-filled:before,.pause-filled:after{content:"";width:2px;height:10px;background-color:currentColor;border-radius:1px}.pause-filled:before{margin-right:2px}.pause-filled:after{margin-left:2px}.hover\:border-gray-300:hover{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.hover\:bg-amber-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.hover\:bg-amber-200:hover{--tw-bg-opacity: 1;background-color:rgb(253 230 138 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-800:hover{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.hover\:bg-green-100:hover{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.hover\:bg-orange-600:hover{--tw-bg-opacity: 1;background-color:rgb(234 88 12 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-50:hover{--tw-bg-opacity: 1;background-color:rgb(250 245 255 / var(--tw-bg-opacity, 1))}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:from-amber-500:hover{--tw-gradient-from: #f59e0b var(--tw-gradient-from-position);--tw-gradient-to: rgb(245 158 11 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-amber-600:hover{--tw-gradient-from: #d97706 var(--tw-gradient-from-position);--tw-gradient-to: rgb(217 119 6 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-orange-600:hover{--tw-gradient-to: #ea580c var(--tw-gradient-to-position)}.hover\:text-amber-700:hover{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\:text-gray-800:hover{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.hover\:text-green-900:hover{--tw-text-opacity: 1;color:rgb(20 83 45 / var(--tw-text-opacity, 1))}.hover\:text-red-800:hover{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.focus\:border-transparent:focus{border-color:transparent}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-amber-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(251 191 36 / var(--tw-ring-opacity, 1))}.focus\:ring-orange-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(249 115 22 / var(--tw-ring-opacity, 1))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media (min-width: 1024px){.lg\:grid-cols-\[1fr_1\.4fr_1fr\]{grid-template-columns:1fr 1.4fr 1fr}}@keyframes svelte-1s3xy1i-sweep{0%{transform:translate(-100%)}to{transform:translate(300%)}}
hfstudio/static/_app/immutable/chunks/-00l7SVl.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_1nascwh)==null?void 0:Je.base)??"";var Xe;const Zt=((Xe=globalThis.__sveltekit_1nascwh)==null?void 0:Xe.assets)??$??"",Qt="1761295579154",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_1nascwh)!=null&&s.data&&globalThis.__sveltekit_1nascwh.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/chunks/BkS3OtHZ.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{s as e}from"./-00l7SVl.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/Bv5vELPx.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{S as C,i as j,s as q,n as A,d as c,a as z,b as p,c as g,m as D,o as P,p as h,e as _,f as v,g as I,h as w,j as b,t as x,k as L,q as V,r as F}from"./TRxHAhOH.js";import"./IHki7fMi.js";function B(l){let e;return{c(){e=b("div"),this.h()},l(t){e=_(t,"DIV",{class:!0}),v(e).forEach(c),this.h()},h(){h(e,"class","absolute inset-0 -left-full animate-sweep bg-gradient-to-r from-transparent via-orange-400/40 to-transparent")},m(t,i){p(t,e,i)},d(t){t&&c(e)}}}function H(l){let e,t,i,a,n="Sign In";return{c(){e=b("img"),i=L(),a=b("span"),a.textContent=n,this.h()},l(s){e=_(s,"IMG",{src:!0,alt:!0,class:!0}),i=w(s),a=_(s,"SPAN",{class:!0,"data-svelte-h":!0}),F(a)!=="svelte-b2ltkx"&&(a.textContent=n),this.h()},h(){V(e.src,t="/assets/hf-logo.png")||h(e,"src",t),h(e,"alt","HF Logo"),h(e,"class","w-4 h-4 relative z-10"),h(a,"class","relative z-10")},m(s,f){p(s,e,f),p(s,i,f),p(s,a,f)},p:A,d(s){s&&(c(e),c(i),c(a))}}}function G(l){let e,t,i;return{c(){e=b("span"),t=x("πŸ‘‹ Logout, "),i=x(l[1]),this.h()},l(a){e=_(a,"SPAN",{class:!0});var n=v(e);t=I(n,"πŸ‘‹ Logout, "),i=I(n,l[1]),n.forEach(c),this.h()},h(){h(e,"class","relative z-10")},m(a,n){p(a,e,n),g(e,t),g(e,i)},p(a,n){n&2&&z(i,a[1])},d(a){a&&c(e)}}}function M(l){let e,t,i,a,n,s,f,o,S,r=l[3]&&B();function E(m,d){return m[0]?G:H}let y=E(l),u=y(l);return{c(){e=b("div"),t=b("div"),i=b("span"),a=x(l[4]),n=L(),s=b("button"),r&&r.c(),f=L(),u.c(),this.h()},l(m){e=_(m,"DIV",{class:!0});var d=v(e);t=_(d,"DIV",{class:!0});var N=v(t);i=_(N,"SPAN",{class:!0});var T=v(i);a=I(T,l[4]),T.forEach(c),N.forEach(c),n=w(d),s=_(d,"BUTTON",{class:!0});var k=v(s);r&&r.l(k),f=w(k),u.l(k),k.forEach(c),d.forEach(c),this.h()},h(){h(i,"class","font-semibold text-gray-900 text-xl"),h(t,"class","flex items-center gap-2"),s.disabled=!1,h(s,"class","px-4 py-2 bg-black text-white rounded-lg font-medium hover:bg-gray-800 transition-colors shadow-sm flex items-center justify-center gap-2 text-sm disabled:opacity-50 disabled:cursor-not-allowed relative overflow-hidden"),h(e,"class","sticky top-0 z-30 bg-white flex items-center justify-between px-4 py-4 border-b border-gray-200 min-h-[73px]")},m(m,d){p(m,e,d),g(e,t),g(t,i),g(i,a),g(e,n),g(e,s),r&&r.m(s,null),g(s,f),u.m(s,null),o||(S=D(s,"click",function(){P(l[2])&&l[2].apply(this,arguments)}),o=!0)},p(m,[d]){l=m,d&16&&z(a,l[4]),l[3]?r||(r=B(),r.c(),r.m(s,f)):r&&(r.d(1),r=null),y===(y=E(l))&&u?u.p(l,d):(u.d(1),u=y(l),u&&(u.c(),u.m(s,null)))},i:A,o:A,d(m){m&&c(e),r&&r.d(),u.d(),o=!1,S()}}}function O(l,e,t){let{isLoggedIn:i=!1}=e,{username:a=""}=e,{handleAuthAction:n=()=>{}}=e,{flashButton:s=!1}=e,{pageTitle:f="HFStudio"}=e;return l.$$set=o=>{"isLoggedIn"in o&&t(0,i=o.isLoggedIn),"username"in o&&t(1,a=o.username),"handleAuthAction"in o&&t(2,n=o.handleAuthAction),"flashButton"in o&&t(3,s=o.flashButton),"pageTitle"in o&&t(4,f=o.pageTitle)},[i,a,n,s,f]}class K extends C{constructor(e){super(),j(this,e,O,M,q,{isLoggedIn:0,username:1,handleAuthAction:2,flashButton:3,pageTitle:4})}}export{K as N};
hfstudio/static/_app/immutable/entry/app.C5Z-huiY.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BPGyHklu.js","../chunks/TRxHAhOH.js","../chunks/IHki7fMi.js","../chunks/BkS3OtHZ.js","../chunks/-00l7SVl.js","../chunks/Bv5vELPx.js","../chunks/nn-QVLrM.js","../chunks/BhRpzVYR.js","../assets/0.B_i4o2sT.css","../nodes/1.qZYZme2V.js","../nodes/2.ycGW5--7.js","../chunks/DUd0gdPo.js","../chunks/BNlacN_j.js","../chunks/gtFtmmyB.js","../assets/2.CdRym-eY.css","../nodes/3.CLzJht-f.js","../assets/3.BNkL3CE9.css","../nodes/4.Cz7uudur.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.BPGyHklu.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),()=>A(()=>import("../nodes/1.qZYZme2V.js"),__vite__mapDeps([9,1,2,3,4]),import.meta.url),()=>A(()=>import("../nodes/2.ycGW5--7.js"),__vite__mapDeps([10,1,11,7,2,12,13,14]),import.meta.url),()=>A(()=>import("../nodes/3.CLzJht-f.js"),__vite__mapDeps([15,1,11,7,2,5,13,16]),import.meta.url),()=>A(()=>import("../nodes/4.Cz7uudur.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.6R3nY2mE.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{l as o,a as r}from"../chunks/-00l7SVl.js";export{o as load_css,r as start};
hfstudio/static/_app/immutable/nodes/0.BPGyHklu.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ import{S as at,i as ot,s as rt,C as it,d as E,v as Qe,w as Be,x as Pe,p as s,D as ut,E as ct,F as dt,b as _e,c as e,y as Xe,e as a,f as R,r as p,h as u,z as Ze,j as o,k as c,A as $e,l as ft,G as pt,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 _t}from"../chunks/BkS3OtHZ.js";import{N as bt}from"../chunks/Bv5vELPx.js";import{M as vt}from"../chunks/nn-QVLrM.js";function tt(f){let r,n,d,H="Sign In with HuggingFace Token",z,t,g,A="<strong>Manual Token Entry:</strong> Please enter your HuggingFace token.",q,_,C=`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`,M,Y,b,B,K="HuggingFace Token",G,x,P,D,I,O,l="Cancel",w,h,S="Sign In",V,L,T=f[5]&&nt(),y=f[4]&&st(f);return{c(){r=o("div"),n=o("div"),d=o("h2"),d.textContent=H,z=c(),t=o("div"),g=o("p"),g.innerHTML=A,q=c(),_=o("p"),_.innerHTML=C,M=c(),T&&T.c(),Y=c(),b=o("div"),B=o("label"),B.textContent=K,G=c(),x=o("input"),P=c(),y&&y.c(),D=c(),I=o("div"),O=o("button"),O.textContent=l,w=c(),h=o("button"),h.textContent=S,this.h()},l(v){r=a(v,"DIV",{class:!0});var J=R(r);n=a(J,"DIV",{class:!0});var F=R(n);d=a(F,"H2",{class:!0,"data-svelte-h":!0}),p(d)!=="svelte-1t0ehet"&&(d.textContent=H),z=u(F),t=a(F,"DIV",{class:!0});var U=R(t);g=a(U,"P",{class:!0,"data-svelte-h":!0}),p(g)!=="svelte-344vn4"&&(g.innerHTML=A),q=u(U),_=a(U,"P",{class:!0,"data-svelte-h":!0}),p(_)!=="svelte-orsfwv"&&(_.innerHTML=C),M=u(U),T&&T.l(U),U.forEach(E),Y=u(F),b=a(F,"DIV",{class:!0});var Q=R(b);B=a(Q,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),p(B)!=="svelte-vtbmxo"&&(B.textContent=K),G=u(Q),x=a(Q,"INPUT",{id:!0,type:!0,placeholder:!0,class:!0}),P=u(Q),y&&y.l(Q),Q.forEach(E),D=u(F),I=a(F,"DIV",{class:!0});var X=R(I);O=a(X,"BUTTON",{class:!0,"data-svelte-h":!0}),p(O)!=="svelte-csk0rj"&&(O.textContent=l),w=u(X),h=a(X,"BUTTON",{class:!0,"data-svelte-h":!0}),p(h)!=="svelte-1nxas5u"&&(h.textContent=S),X.forEach(E),F.forEach(E),J.forEach(E),this.h()},h(){s(d,"class","text-xl font-semibold mb-4"),s(g,"class","text-blue-800 mb-2"),s(_,"class","text-blue-700"),s(t,"class","mb-4 p-3 bg-blue-50 rounded-md text-sm"),s(B,"for","token"),s(B,"class","block text-sm font-medium text-gray-700 mb-2"),s(x,"id","token"),s(x,"type","password"),s(x,"placeholder","hf_..."),s(x,"class","w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500 focus:border-transparent"),s(b,"class","mb-4"),s(O,"class","px-4 py-2 text-gray-600 hover:text-gray-800 transition-colors"),s(h,"class","px-4 py-2 bg-orange-500 text-white rounded-md hover:bg-orange-600 transition-colors"),s(I,"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(r,"class","fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50")},m(v,J){_e(v,r,J),e(r,n),e(n,d),e(n,z),e(n,t),e(t,g),e(t,q),e(t,_),e(t,M),T&&T.m(t,null),e(n,Y),e(n,b),e(b,B),e(b,G),e(b,x),et(x,f[3]),e(b,P),y&&y.m(b,null),e(n,D),e(n,I),e(I,O),e(I,w),e(I,h),V||(L=[xe(x,"input",f[13]),xe(x,"keydown",f[14]),xe(O,"click",f[9]),xe(h,"click",f[10])],V=!0)},p(v,J){v[5]?T||(T=nt(),T.c(),T.m(t,null)):T&&(T.d(1),T=null),J&8&&x.value!==v[3]&&et(x,v[3]),v[4]?y?y.p(v,J):(y=st(v),y.c(),y.m(b,null)):y&&(y.d(1),y=null)},d(v){v&&E(r),T&&T.d(),y&&y.d(),V=!1,ht(L)}}}function nt(f){let r,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(){r=o("p"),r.innerHTML=n,this.h()},l(d){r=a(d,"P",{class:!0,"data-svelte-h":!0}),p(r)!=="svelte-xrut8w"&&(r.innerHTML=n),this.h()},h(){s(r,"class","text-blue-600 mt-2")},m(d,H){_e(d,r,H)},d(d){d&&E(r)}}}function st(f){let r,n;return{c(){r=o("p"),n=xt(f[4]),this.h()},l(d){r=a(d,"P",{class:!0});var H=R(r);n=gt(H,f[4]),H.forEach(E),this.h()},h(){s(r,"class","text-red-600 text-sm mt-1")},m(d,H){_e(d,r,H),e(r,n)},p(d,H){H&16&&mt(n,d[4])},d(d){d&&E(r)}}}function wt(f){let r,n,d,H='<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>',z,t,g,A="Audio",q,_,C,M="πŸŽ™οΈ",Y,b,B="Text to Speech",K,G,x,P,D,I,O="Voice Cloning",l,w,h,S="<span>🎧</span> <span>Speech to Text</span>",V,L,T="<span>🎼</span> <span>Sound Effects</span>",y,v,J="<span>🎸</span> <span>Music Generation</span>",F,U,Q="<span>πŸ”Š</span> <span>Audio Enhancement</span>",X,fe,Oe="Image",be,Z,Ve="<span>🎨</span> <span>Text to Image</span>",ve,$,je="<span>πŸ–ΌοΈ</span> <span>Image to Image</span>",we,ee,Fe="<span>βœ‚οΈ</span> <span>Remove Background</span>",Te,te,Re="<span>πŸ”</span> <span>Upscale Image</span>",ye,ne,ze="<span>🎭</span> <span>Face Swap</span>",Ce,se,qe="<span>πŸ“</span> <span>Image to Text</span>",Le,pe,Ge="Video",ke,le,De="<span>🎬</span> <span>Text to Video</span>",Ie,ae,Je="<span>🎞️</span> <span>Image to Video</span>",He,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,Ue,de;P=new vt({props:{size:16}}),ce=new bt({props:{isLoggedIn:f[0],username:f[1],handleAuthAction:f[8],flashButton:f[6],pageTitle:lt(f[7].url.pathname)}});const Ae=f[12].default,j=it(Ae,f,f[11],null);let N=f[2]&&tt(f);return{c(){r=o("div"),n=o("aside"),d=o("div"),d.innerHTML=H,z=c(),t=o("nav"),g=o("div"),g.textContent=A,q=c(),_=o("a"),C=o("span"),C.textContent=M,Y=c(),b=o("span"),b.textContent=B,G=c(),x=o("a"),$e(P.$$.fragment),D=c(),I=o("span"),I.textContent=O,w=c(),h=o("button"),h.innerHTML=S,V=c(),L=o("button"),L.innerHTML=T,y=c(),v=o("button"),v.innerHTML=J,F=c(),U=o("button"),U.innerHTML=Q,X=c(),fe=o("div"),fe.textContent=Oe,be=c(),Z=o("button"),Z.innerHTML=Ve,ve=c(),$=o("button"),$.innerHTML=je,we=c(),ee=o("button"),ee.innerHTML=Fe,Te=c(),te=o("button"),te.innerHTML=Re,ye=c(),ne=o("button"),ne.innerHTML=ze,Ce=c(),se=o("button"),se.innerHTML=qe,Le=c(),pe=o("div"),pe.textContent=Ge,ke=c(),le=o("button"),le.innerHTML=De,Ie=c(),ae=o("button"),ae.innerHTML=Je,He=c(),oe=o("button"),oe.innerHTML=We,Me=c(),re=o("button"),re.innerHTML=Ye,Ne=c(),ie=o("button"),ie.innerHTML=Ke,Ee=c(),ue=o("main"),$e(ce.$$.fragment),Se=c(),j&&j.c(),Ue=c(),N&&N.c(),this.h()},l(m){r=a(m,"DIV",{class:!0});var k=R(r);n=a(k,"ASIDE",{class:!0});var W=R(n);d=a(W,"DIV",{class:!0,"data-svelte-h":!0}),p(d)!=="svelte-xzbt87"&&(d.innerHTML=H),z=u(W),t=a(W,"NAV",{class:!0});var i=R(t);g=a(i,"DIV",{class:!0,"data-svelte-h":!0}),p(g)!=="svelte-52jqai"&&(g.textContent=A),q=u(i),_=a(i,"A",{href:!0,class:!0});var he=R(_);C=a(he,"SPAN",{"data-svelte-h":!0}),p(C)!=="svelte-1yx42xi"&&(C.textContent=M),Y=u(he),b=a(he,"SPAN",{"data-svelte-h":!0}),p(b)!=="svelte-2j89jk"&&(b.textContent=B),he.forEach(E),G=u(i),x=a(i,"A",{href:!0,class:!0});var me=R(x);Ze(P.$$.fragment,me),D=u(me),I=a(me,"SPAN",{"data-svelte-h":!0}),p(I)!=="svelte-10pmll2"&&(I.textContent=O),me.forEach(E),w=u(i),h=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(h)!=="svelte-wf0x5d"&&(h.innerHTML=S),V=u(i),L=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(L)!=="svelte-x7bha3"&&(L.innerHTML=T),y=u(i),v=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(v)!=="svelte-1tyblmt"&&(v.innerHTML=J),F=u(i),U=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(U)!=="svelte-1emrjb3"&&(U.innerHTML=Q),X=u(i),fe=a(i,"DIV",{class:!0,"data-svelte-h":!0}),p(fe)!=="svelte-1pmjg3x"&&(fe.textContent=Oe),be=u(i),Z=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(Z)!=="svelte-11wbuiv"&&(Z.innerHTML=Ve),ve=u(i),$=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p($)!=="svelte-ol2yvl"&&($.innerHTML=je),we=u(i),ee=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(ee)!=="svelte-ttigif"&&(ee.innerHTML=Fe),Te=u(i),te=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(te)!=="svelte-ixgtu4"&&(te.innerHTML=Re),ye=u(i),ne=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(ne)!=="svelte-r2ax5z"&&(ne.innerHTML=ze),Ce=u(i),se=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(se)!=="svelte-n9rt3x"&&(se.innerHTML=qe),Le=u(i),pe=a(i,"DIV",{class:!0,"data-svelte-h":!0}),p(pe)!=="svelte-1gfxetb"&&(pe.textContent=Ge),ke=u(i),le=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(le)!=="svelte-gox1rd"&&(le.innerHTML=De),Ie=u(i),ae=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(ae)!=="svelte-13pimzy"&&(ae.innerHTML=Je),He=u(i),oe=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(oe)!=="svelte-c86wph"&&(oe.innerHTML=We),Me=u(i),re=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(re)!=="svelte-wkify0"&&(re.innerHTML=Ye),Ne=u(i),ie=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(ie)!=="svelte-10ou061"&&(ie.innerHTML=Ke),i.forEach(E),W.forEach(E),Ee=u(k),ue=a(k,"MAIN",{class:!0});var ge=R(ue);Ze(ce.$$.fragment,ge),Se=u(ge),j&&j.l(ge),ge.forEach(E),Ue=u(k),N&&N.l(k),k.forEach(E),this.h()},h(){s(d,"class","px-4 py-4 border-b border-gray-200 min-h-[73px] flex items-center"),s(g,"class","mt-2 mb-1 px-2 text-xs font-medium text-gray-500 uppercase"),s(_,"href","/"),s(_,"class",K="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(x,"href","/voice-cloning"),s(x,"class",l="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(h,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),h.disabled=!0,s(L,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),L.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(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(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(pe,"class","mt-4 mb-1 px-2 text-xs font-medium text-gray-500 uppercase"),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(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(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(t,"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(r,"class","flex h-screen bg-white")},m(m,k){_e(m,r,k),e(r,n),e(n,d),e(n,z),e(n,t),e(t,g),e(t,q),e(t,_),e(_,C),e(_,Y),e(_,b),e(t,G),e(t,x),Xe(P,x,null),e(x,D),e(x,I),e(t,w),e(t,h),e(t,V),e(t,L),e(t,y),e(t,v),e(t,F),e(t,U),e(t,X),e(t,fe),e(t,be),e(t,Z),e(t,ve),e(t,$),e(t,we),e(t,ee),e(t,Te),e(t,te),e(t,ye),e(t,ne),e(t,Ce),e(t,se),e(t,Le),e(t,pe),e(t,ke),e(t,le),e(t,Ie),e(t,ae),e(t,He),e(t,oe),e(t,Me),e(t,re),e(t,Ne),e(t,ie),e(r,Ee),e(r,ue),Xe(ce,ue,null),e(ue,Se),j&&j.m(ue,null),e(r,Ue),N&&N.m(r,null),de=!0},p(m,[k]){(!de||k&128&&K!==(K="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(_,"class",K),(!de||k&128&&l!==(l="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(x,"class",l);const W={};k&1&&(W.isLoggedIn=m[0]),k&2&&(W.username=m[1]),k&64&&(W.flashButton=m[6]),k&128&&(W.pageTitle=lt(m[7].url.pathname)),ce.$set(W),j&&j.p&&(!de||k&2048)&&ut(j,Ae,m,m[11],de?dt(Ae,m[11],k,null):ct(m[11]),null),m[2]?N?N.p(m,k):(N=tt(m),N.c(),N.m(r,null)):N&&(N.d(1),N=null)},i(m){de||(Pe(P.$$.fragment,m),Pe(ce.$$.fragment,m),Pe(j,m),de=!0)},o(m){Be(P.$$.fragment,m),Be(ce.$$.fragment,m),Be(j,m),de=!1},d(m){m&&E(r),Qe(P),Qe(ce),j&&j.d(m),N&&N.d()}}}function lt(f){switch(f){case"/":return"Text to Speech Playground";case"/voice-cloning":return"Voice Cloning Playground";default:return"HFStudio"}}function Tt(f,r,n){let d;ft(f,_t,l=>n(7,d=l));let{$$slots:H={},$$scope:z}=r,t={authenticated:!1},g=!1,A="";function q(l){if(t=l,n(0,g=(l==null?void 0:l.authenticated)||!1),l!=null&&l.authenticated&&(l!=null&&l.user_info)){const w=l.user_info,h=w.name||w.fullname||w.login||w.username||"User";n(1,A=h.split(" ")[0])}}typeof window<"u"&&(window.__INITIAL_USER__?(console.log("Found initial user data:",window.__INITIAL_USER__),q(window.__INITIAL_USER__)):(console.log("No initial user data found, listening for event"),window.addEventListener("initial-user-loaded",l=>{console.log("Received initial user event:",l.detail),q(l.detail)})));let _=!1,C="",M="",Y=!1,b=!1,B=!1;pt(()=>(window.addEventListener("show-login-prompt",()=>{g||(n(6,b=!0),setTimeout(()=>{n(6,b=!1)},1600))}),K().then(()=>{!window.__INITIAL_USER__&&!(t!=null&&t.authenticated)&&(console.log("No server data available, checking auth status via API"),G())}),document.addEventListener("visibilitychange",()=>{document.hidden||G()}),()=>{}));async function K(){try{B=(await(await fetch("/api/status")).json()).is_spaces||!1}catch(l){console.error("Error checking Spaces status:",l),B=!1}}async function G(){if(!(t!=null&&t.authenticated&&g))try{const l=await fetch("/api/auth/user",{credentials:"include"});if(l.ok){const w=await l.json();if(w.authenticated){n(0,g=!0);const h=w.user_info,S=h.name||h.fullname||h.login||h.username||"User";n(1,A=S.split(" ")[0])}else n(0,g=!1),n(1,A="")}else n(0,g=!1),n(1,A="")}catch{n(0,g=!1),n(1,A="")}}async function x(){if(g){try{await fetch("/api/auth/logout",{method:"POST",credentials:"include"})}catch(l){console.error("Logout error:",l)}sessionStorage.removeItem("oauth_state"),n(0,g=!1),n(1,A=""),window.location.reload()}else try{const w=await(await fetch("/api/auth/oauth-config")).json(),h=w.scopes||"inference-api";let S=window.location.origin+"/auth/callback";window.location.hostname==="localhost"&&window.location.port==="11111"&&(S="http://localhost:7860/auth/callback");const V=window.location.pathname,L=`https://huggingface.co/oauth/authorize?client_id=${w.client_id}&redirect_uri=${encodeURIComponent(S)}&scope=${encodeURIComponent(h)}&response_type=code&state=${encodeURIComponent(V)}`;window.location.href=L}catch{n(2,_=!0),n(3,C=""),n(4,M="")}}function P(){n(2,_=!1),n(3,C=""),n(4,M="")}async function D(){if(!C.trim()){n(4,M="Please enter a token");return}if(!C.startsWith("hf_")){n(4,M='Token should start with "hf_"');return}try{const l=await fetch("https://huggingface.co/api/whoami-v2",{headers:{Authorization:`Bearer ${C.trim()}`}});if(l.ok){const w=await l.json(),h=C.trim();try{const S=await fetch("/api/auth/manual-token",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:h})});if(S.ok){const V=await S.json();n(0,g=!0);const L=V.user_info,T=L.name||L.fullname||L.login||L.username||"User";n(1,A=T.split(" ")[0]),P()}else{const V=await S.json();n(4,M=V.detail||"Token validation failed")}}catch{n(4,M="Failed to validate token. Please try again.")}}else n(4,M=`Invalid token (${l.status}). Please check your token and try again.`)}catch{n(4,M="Error validating token. Please try again.")}}function I(){C=this.value,n(3,C)}const O=l=>l.key==="Enter"&&D();return f.$$set=l=>{"$$scope"in l&&n(11,z=l.$$scope)},[g,A,_,C,M,Y,b,d,x,P,D,z,H,I,O]}class Ht extends at{constructor(r){super(),ot(this,r,Tt,wt,rt,{})}}export{Ht as component};
hfstudio/static/_app/immutable/nodes/1.qZYZme2V.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/BkS3OtHZ.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.ycGW5--7.js ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{S as gs,i as _s,s as Ol,u as cr,v as fe,w as T,x as k,y as pe,z as he,A as me,B as Qr,C as vs,D as ys,E as ws,F as xs,d as c,J as bs,H as ml,a as et,I as dl,K as dt,p as o,b as A,c as n,m as L,L as ks,h as _,e as u,f as p,r as W,g as Y,M as Ht,k as b,j as d,t as q,G as Es,N as ft,n as Nt,O as dr,P as fr,Q as ur,R as Wr,T as Ts,q as Zr}from"../chunks/TRxHAhOH.js";import{C as ir,g as Cs,P as Mt,D as $s}from"../chunks/DUd0gdPo.js";import{I as Is,g as Ds,a as Vs,e as Sl}from"../chunks/BhRpzVYR.js";import"../chunks/IHki7fMi.js";import{S as Ls,L as Ps,A as Ms,X as Ns}from"../chunks/BNlacN_j.js";import{P as pl,a as Al}from"../chunks/gtFtmmyB.js";function Hs(s){let e;const t=s[2].default,l=vs(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)&&ys(l,t,r,r[3],e?xs(t,r[3],a,null):ws(r[3]),null)},i(r){e||(k(l,r),e=!0)},o(r){T(l,r),e=!1},d(r){l&&l.d(r)}}}function js(s){let e,t;const l=[{name:"chevron-down"},s[1],{iconNode:s[0]}];let r={$$slots:{default:[Hs]},$$scope:{ctx:s}};for(let a=0;a<l.length;a+=1)r=cr(r,l[a]);return e=new Is({props:r}),{c(){me(e.$$.fragment)},l(a){he(e.$$.fragment,a)},m(a,i){pe(e,a,i),t=!0},p(a,[i]){const h=i&3?Ds(l,[l[0],i&2&&Vs(a[1]),i&1&&{iconNode:a[0]}]):{};i&8&&(h.$$scope={dirty:i,ctx:a}),e.$set(h)},i(a){t||(k(e.$$.fragment,a),t=!0)},o(a){T(e.$$.fragment,a),t=!1},d(a){fe(e,a)}}}function Os(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=cr(cr({},e),Qr(i))),"$$scope"in i&&t(3,r=i.$$scope)},e=Qr(e),[a,e,l,r]}class Ss extends gs{constructor(e){super(),_s(this,e,Os,js,Ol,{})}}const{document:es}=Cs;function ts(s,e,t){const l=s.slice();return l[75]=e[t],l}function ls(s,e,t){const l=s.slice();return l[75]=e[t],l}function As(s){let e,t,l;return e=new pl({props:{size:16}}),{c(){me(e.$$.fragment),t=q(`
2
+ Generate speech`)},l(r){he(e.$$.fragment,r),t=Y(r,`
3
+ Generate speech`)},m(r,a){pe(e,r,a),A(r,t,a),l=!0},i(r){l||(k(e.$$.fragment,r),l=!0)},o(r){T(e.$$.fragment,r),l=!1},d(r){r&&c(t),fe(e,r)}}}function Us(s){let e,t,l;return e=new Ps({props:{size:16,class:"animate-spin"}}),{c(){me(e.$$.fragment),t=q(`
4
+ Generating...`)},l(r){he(e.$$.fragment,r),t=Y(r,`
5
+ Generating...`)},m(r,a){pe(e,r,a),A(r,t,a),l=!0},i(r){l||(k(e.$$.fragment,r),l=!0)},o(r){T(e.$$.fragment,r),l=!1},d(r){r&&c(t),fe(e,r)}}}function rs(s){let e=s[75].name+"",t,l,r=s[75].badge&&zs(s);return{c(){t=q(e),r&&r.c(),l=Ht()},l(a){t=Y(a,e),r&&r.l(a),l=Ht()},m(a,i){A(a,t,i),r&&r.m(a,i),A(a,l,i)},p(a,i){a[75].badge&&r.p(a,i)},d(a){a&&(c(t),c(l)),r&&r.d(a)}}}function zs(s){let e,t,l,r=s[75].badge+"",a,i;return{c(){e=q(" "),t=d("span"),l=q("("),a=q(r),i=q(")"),this.h()},l(h){e=Y(h," "),t=u(h,"SPAN",{class:!0});var g=p(t);l=Y(g,"("),a=Y(g,r),i=Y(g,")"),g.forEach(c),this.h()},h(){o(t,"class","text-sm text-gray-500")},m(h,g){A(h,e,g),A(h,t,g),n(t,l),n(t,a),n(t,i)},p:Nt,d(h){h&&(c(e),c(t))}}}function ss(s){let e,t=s[75].name===s[2]&&rs(s);return{c(){t&&t.c(),e=Ht()},l(l){t&&t.l(l),e=Ht()},m(l,r){t&&t.m(l,r),A(l,e,r)},p(l,r){l[75].name===l[2]?t?t.p(l,r):(t=rs(l),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(l){l&&c(e),t&&t.d(l)}}}function ns(s){let e,t=Sl(s[25]),l=[];for(let r=0;r<t.length;r+=1)l[r]=os(ts(s,t,r));return{c(){e=d("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=p(e);for(let i=0;i<l.length;i+=1)l[i].l(a);a.forEach(c),this.h()},h(){o(e,"class","absolute top-full left-0 right-0 border border-gray-200 border-t-0 bg-white shadow-lg rounded-b-lg overflow-hidden z-20")},m(r,a){A(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=Sl(r[25]);let i;for(i=0;i<t.length;i+=1){const h=ts(r,t,i);l[i]?l[i].p(h,a):(l[i]=os(h),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),bs(l,r)}}}function Bs(s){let e,t,l,r=s[75].badge+"",a,i;return{c(){e=q(" "),t=d("span"),l=q("("),a=q(r),i=q(")"),this.h()},l(h){e=Y(h," "),t=u(h,"SPAN",{class:!0});var g=p(t);l=Y(g,"("),a=Y(g,r),i=Y(g,")"),g.forEach(c),this.h()},h(){o(t,"class","text-sm text-gray-500")},m(h,g){A(h,e,g),A(h,t,g),n(t,l),n(t,a),n(t,i)},p:Nt,d(h){h&&(c(e),c(t))}}}function os(s){let e,t=s[75].name+"",l,r,a,i,h,g=s[75].badge&&Bs(s);function E(){return s[43](s[75])}return{c(){e=d("button"),l=q(t),g&&g.c(),r=b(),this.h()},l(y){e=u(y,"BUTTON",{class:!0});var v=p(e);l=Y(v,t),g&&g.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[75].disabled?"opacity-50 cursor-not-allowed":"hover:bg-gray-50")+" "+(s[75].name===s[2]?"bg-gray-100":"")),e.disabled=s[75].disabled},m(y,v){A(y,e,v),n(e,l),g&&g.m(e,null),n(e,r),i||(h=L(e,"click",E),i=!0)},p(y,v){s=y,s[75].badge&&g.p(s,v),v[0]&4&&a!==(a="w-full px-3 py-2.5 text-left transition-colors text-sm "+(s[75].disabled?"opacity-50 cursor-not-allowed":"hover:bg-gray-50")+" "+(s[75].name===s[2]?"bg-gray-100":""))&&o(e,"class",a)},d(y){y&&c(e),g&&g.d(),i=!1,h()}}}function Rs(s){let e,t;return e=new pl({props:{size:10,class:"text-gray-600"}}),{c(){me(e.$$.fragment)},l(l){he(e.$$.fragment,l)},m(l,r){pe(e,l,r),t=!0},i(l){t||(k(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){fe(e,l)}}}function Gs(s){let e,t;return e=new Al({props:{size:10,class:"text-gray-600"}}),{c(){me(e.$$.fragment)},l(l){he(e.$$.fragment,l)},m(l,r){pe(e,l,r),t=!0},i(l){t||(k(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){fe(e,l)}}}function Fs(s){let e,t;return e=new pl({props:{size:10,class:"text-gray-600"}}),{c(){me(e.$$.fragment)},l(l){he(e.$$.fragment,l)},m(l,r){pe(e,l,r),t=!0},i(l){t||(k(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){fe(e,l)}}}function Ys(s){let e,t;return e=new Al({props:{size:10,class:"text-gray-600"}}),{c(){me(e.$$.fragment)},l(l){he(e.$$.fragment,l)},m(l,r){pe(e,l,r),t=!0},i(l){t||(k(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){fe(e,l)}}}function qs(s){let e,t;return e=new pl({props:{size:10,class:"text-gray-600"}}),{c(){me(e.$$.fragment)},l(l){he(e.$$.fragment,l)},m(l,r){pe(e,l,r),t=!0},i(l){t||(k(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){fe(e,l)}}}function Ks(s){let e,t;return e=new Al({props:{size:10,class:"text-gray-600"}}),{c(){me(e.$$.fragment)},l(l){he(e.$$.fragment,l)},m(l,r){pe(e,l,r),t=!0},i(l){t||(k(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){fe(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=d("a"),e.innerHTML=t,this.h()},l(l){e=u(l,"A",{href:!0,class:!0,"data-svelte-h":!0}),W(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){A(l,e,r)},p:Nt,i:Nt,o:Nt,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,h,g,E,y,v,$;const G=[Ws,Qs],J=[];function U(w,C){return w[17]==="Yours"?0:1}return h=U(s),g=J[h]=G[h](s),{c(){e=d("button"),t=d("div"),l=d("div"),l.innerHTML=r,a=b(),i=d("button"),g.c(),this.h()},l(w){e=u(w,"BUTTON",{class:!0});var C=p(e);t=u(C,"DIV",{class:!0});var I=p(t);l=u(I,"DIV",{class:!0,"data-svelte-h":!0}),W(l)!=="svelte-1ixcco1"&&(l.innerHTML=r),a=_(I),i=u(I,"BUTTON",{class:!0,title:!0});var X=p(i);g.l(X),X.forEach(c),I.forEach(c),C.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",E="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(w,C){A(w,e,C),n(e,t),n(t,l),n(t,a),n(t,i),J[h].m(i,null),y=!0,v||($=[L(i,"click",s[50]),L(e,"click",s[51])],v=!0)},p(w,C){let I=h;h=U(w),h!==I&&(ft(),T(J[I],1,1,()=>{J[I]=null}),dt(),g=J[h],g||(g=J[h]=G[h](w),g.c()),k(g,1),g.m(i,null)),(!y||C[0]&2&&E!==(E="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(w[1]==="Yours"?"border-purple-400 bg-purple-50":"border-gray-200")))&&o(e,"class",E)},i(w){y||(k(g),y=!0)},o(w){T(g),y=!1},d(w){w&&c(e),J[h].d(),v=!1,ml($)}}}function Qs(s){let e,t;return e=new pl({props:{size:10,class:"text-gray-600"}}),{c(){me(e.$$.fragment)},l(l){he(e.$$.fragment,l)},m(l,r){pe(e,l,r),t=!0},i(l){t||(k(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){fe(e,l)}}}function Ws(s){let e,t;return e=new Al({props:{size:10,class:"text-gray-600"}}),{c(){me(e.$$.fragment)},l(l){he(e.$$.fragment,l)},m(l,r){pe(e,l,r),t=!0},i(l){t||(k(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){fe(e,l)}}}function as(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>',h,g,E=`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=d("div"),t=d("button"),t.innerHTML=l,r=b(),a=d("p"),a.innerHTML=i,h=b(),g=d("p"),g.innerHTML=E,this.h()},l($){e=u($,"DIV",{class:!0});var G=p(e);t=u(G,"BUTTON",{class:!0,"aria-label":!0,"data-svelte-h":!0}),W(t)!=="svelte-9gdgq5"&&(t.innerHTML=l),r=_(G),a=u(G,"P",{class:!0,"data-svelte-h":!0}),W(a)!=="svelte-1q58z3k"&&(a.innerHTML=i),h=_(G),g=u(G,"P",{class:!0,"data-svelte-h":!0}),W(g)!=="svelte-dysk74"&&(g.innerHTML=E),G.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(g,"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($,G){A($,e,G),n(e,t),n(e,r),n(e,a),n(e,h),n(e,g),y||(v=L(t,"click",s[54]),y=!0)},p:Nt,d($){$&&c(e),y=!1,v()}}}function is(s){let e,t,l,r=Mt.highlight(s[23],Mt.languages.bash,"bash")+"";return{c(){e=d("pre"),t=d("code"),l=new fr(!1),this.h()},l(a){e=u(a,"PRE",{class:!0});var i=p(e);t=u(i,"CODE",{class:!0});var h=p(t);l=dr(h,!1),h.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){A(a,e,i),n(e,t),l.m(r,t)},p(a,i){i[0]&8388608&&r!==(r=Mt.highlight(a[23],Mt.languages.bash,"bash")+"")&&l.p(r)},d(a){a&&c(e)}}}function cs(s){let e,t,l,r=Mt.highlight(s[24],Mt.languages.python,"python")+"";return{c(){e=d("pre"),t=d("code"),l=new fr(!1),this.h()},l(a){e=u(a,"PRE",{class:!0});var i=p(e);t=u(i,"CODE",{class:!0});var h=p(t);l=dr(h,!1),h.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){A(a,e,i),n(e,t),l.m(r,t)},p(a,i){i[0]&16777216&&r!==(r=Mt.highlight(a[24],Mt.languages.python,"python")+"")&&l.p(r)},d(a){a&&c(e)}}}function us(s){let e,t,l,r,a,i,h="Generated Audio",g,E,y,v,$,G="Download",J,U,w,C,I,X,z,ae,Z,D,te,be=fl(s[14])+"",B,M,V,N,F,le,De,K,ee,ge=fl(s[13])+"",Ne,ve,He,je,tt,xe,Ve=fl(s[14])+"",Ke,Oe,se,pt,ht,H=s[11]>0&&s[6]!=="local"&&ds(s);U=new $s({props:{size:12,class:"text-green-600"}});const Le=[en,Zs],_e=[];function Be(P,j){return P[12]?0:1}F=Be(s),le=_e[F]=Le[F](s);let ne=s[10]&&fs(s);return{c(){e=d("div"),t=d("div"),l=d("div"),r=d("div"),a=b(),i=d("span"),i.textContent=h,g=b(),H&&H.c(),E=b(),y=d("div"),v=d("button"),$=d("span"),$.textContent=G,J=b(),me(U.$$.fragment),w=b(),C=d("div"),I=d("div"),X=d("h4"),z=q(s[15]),ae=b(),Z=d("p"),D=q(s[1]),te=q(" β€’ "),B=q(be),M=b(),V=d("div"),N=d("button"),le.c(),De=b(),K=d("div"),ee=d("span"),Ne=q(ge),ve=b(),He=d("div"),je=d("div"),tt=b(),xe=d("span"),Ke=q(Ve),Oe=b(),ne&&ne.c(),this.h()},l(P){e=u(P,"DIV",{class:!0});var j=p(e);t=u(j,"DIV",{class:!0});var re=p(t);l=u(re,"DIV",{class:!0});var ie=p(l);r=u(ie,"DIV",{class:!0}),p(r).forEach(c),a=_(ie),i=u(ie,"SPAN",{class:!0,"data-svelte-h":!0}),W(i)!=="svelte-1hz7jl7"&&(i.textContent=h),g=_(ie),H&&H.l(ie),ie.forEach(c),E=_(re),y=u(re,"DIV",{class:!0});var lt=p(y);v=u(lt,"BUTTON",{class:!0,title:!0});var Je=p(v);$=u(Je,"SPAN",{class:!0,"data-svelte-h":!0}),W($)!=="svelte-kkuif9"&&($.textContent=G),J=_(Je),he(U.$$.fragment,Je),Je.forEach(c),lt.forEach(c),re.forEach(c),w=_(j),C=u(j,"DIV",{class:!0});var ye=p(C);I=u(ye,"DIV",{class:!0});var $e=p(I);X=u($e,"H4",{class:!0});var Re=p(X);z=Y(Re,s[15]),Re.forEach(c),ae=_($e),Z=u($e,"P",{class:!0});var rt=p(Z);D=Y(rt,s[1]),te=Y(rt," β€’ "),B=Y(rt,be),rt.forEach(c),$e.forEach(c),M=_(ye),V=u(ye,"DIV",{class:!0});var Xe=p(V);N=u(Xe,"BUTTON",{class:!0});var Pe=p(N);le.l(Pe),Pe.forEach(c),De=_(Xe),K=u(Xe,"DIV",{class:!0});var ce=p(K);ee=u(ce,"SPAN",{class:!0});var ke=p(ee);Ne=Y(ke,ge),ke.forEach(c),ve=_(ce),He=u(ce,"DIV",{class:!0});var st=p(He);je=u(st,"DIV",{class:!0,style:!0}),p(je).forEach(c),st.forEach(c),tt=_(ce),xe=u(ce,"SPAN",{class:!0});var mt=p(xe);Ke=Y(mt,Ve),mt.forEach(c),ce.forEach(c),Xe.forEach(c),Oe=_(ye),ne&&ne.l(ye),ye.forEach(c),j.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($,"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(X,"class","font-medium text-gray-900 text-xs"),o(Z,"class","text-xs text-gray-500"),o(I,"class","mb-3"),o(N,"class","w-6 h-6 bg-black rounded-full flex items-center justify-center hover:bg-gray-800 transition-colors flex-shrink-0"),o(ee,"class","text-xs text-gray-500 font-mono"),o(je,"class","h-full bg-gradient-to-r from-amber-400 to-orange-500 rounded-full transition-all"),ur(je,"width",s[13]/s[14]*100+"%"),o(He,"class","flex-1 h-1 bg-gray-200 rounded-full cursor-pointer"),o(xe,"class","text-xs text-gray-500 font-mono"),o(K,"class","flex-1 flex items-center gap-1"),o(V,"class","flex items-center gap-2"),o(C,"class","p-3"),o(e,"class","bg-white rounded-lg border border-gray-200 overflow-hidden mt-4")},m(P,j){A(P,e,j),n(e,t),n(t,l),n(l,r),n(l,a),n(l,i),n(l,g),H&&H.m(l,null),n(t,E),n(t,y),n(y,v),n(v,$),n(v,J),pe(U,v,null),n(e,w),n(e,C),n(C,I),n(I,X),n(X,z),n(I,ae),n(I,Z),n(Z,D),n(Z,te),n(Z,B),n(C,M),n(C,V),n(V,N),_e[F].m(N,null),n(V,De),n(V,K),n(K,ee),n(ee,Ne),n(K,ve),n(K,He),n(He,je),n(K,tt),n(K,xe),n(xe,Ke),n(C,Oe),ne&&ne.m(C,null),se=!0,pt||(ht=[L(v,"click",s[32]),L(N,"click",s[27])],pt=!0)},p(P,j){P[11]>0&&P[6]!=="local"?H?H.p(P,j):(H=ds(P),H.c(),H.m(l,null)):H&&(H.d(1),H=null),(!se||j[0]&32768)&&et(z,P[15]),(!se||j[0]&2)&&et(D,P[1]),(!se||j[0]&16384)&&be!==(be=fl(P[14])+"")&&et(B,be);let re=F;F=Be(P),F!==re&&(ft(),T(_e[re],1,1,()=>{_e[re]=null}),dt(),le=_e[F],le||(le=_e[F]=Le[F](P),le.c()),k(le,1),le.m(N,null)),(!se||j[0]&8192)&&ge!==(ge=fl(P[13])+"")&&et(Ne,ge),(!se||j[0]&24576)&&ur(je,"width",P[13]/P[14]*100+"%"),(!se||j[0]&16384)&&Ve!==(Ve=fl(P[14])+"")&&et(Ke,Ve),P[10]?ne?ne.p(P,j):(ne=fs(P),ne.c(),ne.m(C,null)):ne&&(ne.d(1),ne=null)},i(P){se||(k(U.$$.fragment,P),k(le),se=!0)},o(P){T(U.$$.fragment,P),T(le),se=!1},d(P){P&&c(e),H&&H.d(),fe(U),_e[F].d(),ne&&ne.d(),pt=!1,ml(ht)}}}function ds(s){let e,t,l=s[11].toFixed(1)+"",r,a;return{c(){e=d("span"),t=q("(took "),r=q(l),a=q("s)"),this.h()},l(i){e=u(i,"SPAN",{class:!0});var h=p(e);t=Y(h,"(took "),r=Y(h,l),a=Y(h,"s)"),h.forEach(c),this.h()},h(){o(e,"class","text-xs text-green-700")},m(i,h){A(i,e,h),n(e,t),n(e,r),n(e,a)},p(i,h){h[0]&2048&&l!==(l=i[11].toFixed(1)+"")&&et(r,l)},d(i){i&&c(e)}}}function Zs(s){let e,t;return e=new pl({props:{size:10,class:"text-white ml-0.5"}}),{c(){me(e.$$.fragment)},l(l){he(e.$$.fragment,l)},m(l,r){pe(e,l,r),t=!0},i(l){t||(k(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){fe(e,l)}}}function en(s){let e;return{c(){e=d("div"),this.h()},l(t){e=u(t,"DIV",{class:!0}),p(e).forEach(c),this.h()},h(){o(e,"class","pause-filled text-white text-xs svelte-13ak1iw")},m(t,l){A(t,e,l)},i:Nt,o:Nt,d(t){t&&c(e)}}}function fs(s){let e,t,l,r;return{c(){e=d("audio"),this.h()},l(a){e=u(a,"AUDIO",{src:!0,style:!0}),p(e).forEach(c),this.h()},h(){Zr(e.src,t=s[10])||o(e,"src",t),ur(e,"display","none")},m(a,i){A(a,e,i),s[59](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&&!Zr(e.src,t=a[10])&&o(e,"src",t)},d(a){a&&c(e),s[59](null),l=!1,ml(r)}}}function ps(s){let e,t,l,r,a,i,h,g,E,y,v,$,G="An error occurred while processing your request",J,U,w,C,I,X,z,ae,Z="Close",D,te,be;i=new Ms({props:{size:20,class:"text-red-600"}}),w=new Ns({props:{size:20,class:"text-gray-500"}});let B=s[20]&&hs(s);return{c(){e=d("div"),t=d("div"),l=d("div"),r=d("div"),a=d("div"),me(i.$$.fragment),h=b(),g=d("div"),E=d("h3"),y=q(s[19]),v=b(),$=d("p"),$.textContent=G,J=b(),U=d("button"),me(w.$$.fragment),C=b(),I=d("div"),B&&B.c(),X=b(),z=d("div"),ae=d("button"),ae.textContent=Z,this.h()},l(M){e=u(M,"DIV",{class:!0});var V=p(e);t=u(V,"DIV",{class:!0});var N=p(t);l=u(N,"DIV",{class:!0});var F=p(l);r=u(F,"DIV",{class:!0});var le=p(r);a=u(le,"DIV",{class:!0});var De=p(a);he(i.$$.fragment,De),De.forEach(c),h=_(le),g=u(le,"DIV",{class:!0});var K=p(g);E=u(K,"H3",{class:!0});var ee=p(E);y=Y(ee,s[19]),ee.forEach(c),v=_(K),$=u(K,"P",{class:!0,"data-svelte-h":!0}),W($)!=="svelte-1l3zl3"&&($.textContent=G),K.forEach(c),le.forEach(c),J=_(F),U=u(F,"BUTTON",{class:!0,title:!0});var ge=p(U);he(w.$$.fragment,ge),ge.forEach(c),F.forEach(c),C=_(N),I=u(N,"DIV",{class:!0});var Ne=p(I);B&&B.l(Ne),Ne.forEach(c),X=_(N),z=u(N,"DIV",{class:!0});var ve=p(z);ae=u(ve,"BUTTON",{class:!0,"data-svelte-h":!0}),W(ae)!=="svelte-4sxk6g"&&(ae.textContent=Z),ve.forEach(c),N.forEach(c),V.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(E,"class","text-lg font-semibold text-gray-900 truncate"),o($,"class","text-sm text-gray-600"),o(g,"class","min-w-0"),o(r,"class","flex items-center gap-3 min-w-0"),o(U,"class","p-2 hover:bg-red-100 rounded-full transition-colors flex-shrink-0"),o(U,"title","Close"),o(l,"class","flex items-center justify-between p-6 border-b border-gray-200 bg-red-50 flex-shrink-0"),o(I,"class","p-6 overflow-y-auto flex-1 min-h-0"),o(ae,"class","px-6 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors"),o(z,"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(M,V){A(M,e,V),n(e,t),n(t,l),n(l,r),n(r,a),pe(i,a,null),n(r,h),n(r,g),n(g,E),n(E,y),n(g,v),n(g,$),n(l,J),n(l,U),pe(w,U,null),n(t,C),n(t,I),B&&B.m(I,null),n(t,X),n(t,z),n(z,ae),D=!0,te||(be=[L(U,"click",s[36]),L(ae,"click",s[36])],te=!0)},p(M,V){(!D||V[0]&524288)&&et(y,M[19]),M[20]?B?B.p(M,V):(B=hs(M),B.c(),B.m(I,null)):B&&(B.d(1),B=null)},i(M){D||(k(i.$$.fragment,M),k(w.$$.fragment,M),D=!0)},o(M){T(i.$$.fragment,M),T(w.$$.fragment,M),D=!1},d(M){M&&c(e),fe(i),fe(w),B&&B.d(),te=!1,ml(be)}}}function hs(s){let e,t,l="Error Details:",r,a,i;function h(y,v){return v[0]&1048576&&(i=null),i==null&&(i=!!y[20].includes("exceeded your monthly included credits")),i?ln:tn}let g=h(s,[-1,-1,-1]),E=g(s);return{c(){e=d("div"),t=d("h4"),t.textContent=l,r=b(),a=d("pre"),E.c(),this.h()},l(y){e=u(y,"DIV",{class:!0});var v=p(e);t=u(v,"H4",{class:!0,"data-svelte-h":!0}),W(t)!=="svelte-3lmggt"&&(t.textContent=l),r=_(v),a=u(v,"PRE",{class:!0});var $=p(a);E.l($),$.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){A(y,e,v),n(e,t),n(e,r),n(e,a),E.m(a,null)},p(y,v){g===(g=h(y,v))&&E?E.p(y,v):(E.d(1),E=g(y),E&&(E.c(),E.m(a,null)))},d(y){y&&c(e),E.d()}}}function tn(s){let e;return{c(){e=q(s[20])},l(t){e=Y(t,s[20])},m(t,l){A(t,e,l)},p(t,l){l[0]&1048576&&et(e,t[20])},d(t){t&&c(e)}}}function ln(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 fr(!1),l=Ht(),this.h()},l(r){e=dr(r,!1),l=Ht(),this.h()},h(){e.a=l},m(r,a){e.m(t,r,a),A(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 ms(s){let e,t;return{c(){e=d("div"),t=q(s[22]),this.h()},l(l){e=u(l,"DIV",{class:!0});var r=p(e);t=Y(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){A(l,e,r),n(e,t)},p(l,r){r[0]&4194304&&et(t,l[22])},d(l){l&&c(e)}}}function rn(s){let e,t,l,r,a,i,h,g="Text to speak",E,y,v,$,G,J,U=s[0].length.toLocaleString()+"",w,C,I,X,z,ae,Z,D,te,be,B,M,V,N,F,le="Model",De,K,ee,ge,Ne,ve,He,je,tt,xe,Ve='~$0.025 per generation β€’ <a href="https://huggingface.co/settings/billing" target="_blank" class="text-amber-600 hover:text-amber-700 underline">Billing ‴</a>',Ke,Oe,se,pt="Voice",ht,H,Le,_e,Be,ne='<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>',P,j,re,ie,lt,Je,ye,$e,Re,rt='<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>',Xe,Pe,ce,ke,st,mt,Qe,We,nt,gl='<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>',hl,Fe,Se,m,Q,oe,R,O,S,Me,ot,jt,pr='<label for="exaggeration-slider" class="text-sm font-medium text-gray-900">Exaggeration</label>',Ul,Ae,zl,Ot,hr="<span>None</span> <span>More</span>",Bl,at,St,mr='<label for="temperature-slider" class="text-sm font-medium text-gray-900">Stability</label>',Rl,Ue,Gl,At,gr="<span>More stable</span> <span>More variable</span>",Fl,el,ze,_l,Ut,_r='<h3 class="text-lg font-semibold text-gray-900 mb-1">Results &amp; Live Documentation</h3> <p class="text-sm text-gray-600">The code below will update as you adjust the UI ✨</p>',Yl,gt,_t,bt,ql,bl,Kl,vt,Jl,vl,Xl,yt,it,zt,Ql,Bt,br="Copy all",Wl,wt,vr='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="text-amber-700"><path d="M12 2L2 7l10 5 10-5-10-5z"></path><path d="M2 17l10 5 10-5"></path><path d="M2 12l10 5 10-5"></path></svg> <span class="ml-1 text-xs font-medium text-amber-700">Deploy as Space</span>',Zl,Ye,xt,kt,Rt,yr='<span class="text-xs font-medium text-blue-900">Install in Terminal</span>',er,Et,Gt,tr,Ft,wr=s[7],lr,Tt,Ct,Yt,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>',rr,$t,qt,sr,Kt,kr=s[7],nr,yl,tl,ll,Ge,or,Er;v=new Ls({props:{size:16}});const Tr=[Us,As],Jt=[];function Cr(f,x){return f[9]?0:1}D=Cr(s),te=Jt[D]=Tr[D](s);let rl=Sl(s[25]),we=[];for(let f=0;f<rl.length;f+=1)we[f]=ss(ls(s,rl,f));ve=new Ss({props:{size:14,class:"text-gray-500 transition-transform "+(s[8]?"rotate-180":"")}});let Ee=s[8]&&ns(s);const $r=[Gs,Rs],Xt=[];function Ir(f,x){return f[17]==="Andrew"?0:1}re=Ir(s),ie=Xt[re]=$r[re](s);const Dr=[Ys,Fs],Qt=[];function Vr(f,x){return f[17]==="Lily"?0:1}ce=Vr(s),ke=Qt[ce]=Dr[ce](s);const Lr=[Ks,qs],Wt=[];function Pr(f,x){return f[17]==="Pirate"?0:1}Se=Pr(s),m=Wt[Se]=Lr[Se](s);const Mr=[Xs,Js],It=[];function Nr(f,x){return f[5].length>0?0:1}R=Nr(s),O=It[R]=Mr[R](s);let Te=s[21]&&as(s);zt=new ir({props:{size:12,class:"text-gray-600"}}),Gt=new ir({props:{size:12,class:"text-blue-600"}});let ct=is(s);qt=new ir({props:{size:12,class:"text-amber-600"}});let ut=cs(s),ue=s[10]&&us(s),de=s[18]&&ps(s),Ce=s[22]&&ms(s);return{c(){e=b(),t=d("div"),l=d("div"),r=d("div"),a=d("div"),i=d("div"),h=d("span"),h.textContent=g,E=b(),y=d("button"),me(v.$$.fragment),$=b(),G=d("div"),J=d("span"),w=q(U),C=q(" / 1,000 characters"),I=b(),X=d("div"),z=d("textarea"),ae=b(),Z=d("button"),te.c(),B=b(),M=d("div"),V=d("div"),N=d("div"),F=d("h3"),F.textContent=le,De=b(),K=d("div"),ee=d("button"),ge=d("span");for(let f=0;f<we.length;f+=1)we[f].c();Ne=b(),me(ve.$$.fragment),je=b(),Ee&&Ee.c(),tt=b(),xe=d("div"),xe.innerHTML=Ve,Ke=b(),Oe=d("div"),se=d("h3"),se.textContent=pt,ht=b(),H=d("div"),Le=d("button"),_e=d("div"),Be=d("div"),Be.innerHTML=ne,P=b(),j=d("button"),ie.c(),Je=b(),ye=d("button"),$e=d("div"),Re=d("div"),Re.innerHTML=rt,Xe=b(),Pe=d("button"),ke.c(),mt=b(),Qe=d("button"),We=d("div"),nt=d("div"),nt.innerHTML=gl,hl=b(),Fe=d("button"),m.c(),oe=b(),O.c(),S=b(),Me=d("div"),ot=d("div"),jt=d("div"),jt.innerHTML=pr,Ul=b(),Ae=d("input"),zl=b(),Ot=d("div"),Ot.innerHTML=hr,Bl=b(),at=d("div"),St=d("div"),St.innerHTML=mr,Rl=b(),Ue=d("input"),Gl=b(),At=d("div"),At.innerHTML=gr,Fl=b(),el=d("div"),ze=d("div"),Te&&Te.c(),_l=b(),Ut=d("div"),Ut.innerHTML=_r,Yl=b(),gt=d("div"),_t=d("div"),bt=d("button"),ql=q("API"),Kl=b(),vt=d("button"),Jl=q("Local"),Xl=b(),yt=d("div"),it=d("button"),me(zt.$$.fragment),Ql=b(),Bt=d("span"),Bt.textContent=br,Wl=b(),wt=d("button"),wt.innerHTML=vr,Zl=b(),Ye=d("div"),xt=d("div"),kt=d("div"),Rt=d("div"),Rt.innerHTML=yr,er=b(),Et=d("button"),me(Gt.$$.fragment),tr=b(),Ft=d("div"),ct.c(),lr=b(),Tt=d("div"),Ct=d("div"),Yt=d("div"),Yt.innerHTML=xr,rr=b(),$t=d("button"),me(qt.$$.fragment),sr=b(),Kt=d("div"),ut.c(),nr=b(),ue&&ue.c(),yl=b(),de&&de.c(),tl=b(),Ce&&Ce.c(),ll=Ht(),this.h()},l(f){ks("svelte-y100ki",es.head).forEach(c),e=_(f),t=u(f,"DIV",{class:!0,role:!0,tabindex:!0});var qe=p(t);l=u(qe,"DIV",{class:!0});var Zt=p(l);r=u(Zt,"DIV",{class:!0});var Dt=p(r);a=u(Dt,"DIV",{class:!0});var Ze=p(a);i=u(Ze,"DIV",{class:!0});var Vt=p(i);h=u(Vt,"SPAN",{class:!0,"data-svelte-h":!0}),W(h)!=="svelte-1da1nvl"&&(h.textContent=g),E=_(Vt),y=u(Vt,"BUTTON",{class:!0,title:!0});var sl=p(y);he(v.$$.fragment,sl),sl.forEach(c),Vt.forEach(c),$=_(Ze),G=u(Ze,"DIV",{class:!0});var Ie=p(G);J=u(Ie,"SPAN",{class:!0});var nl=p(J);w=Y(nl,U),C=Y(nl," / 1,000 characters"),nl.forEach(c),Ie.forEach(c),I=_(Ze),X=u(Ze,"DIV",{class:!0});var wl=p(X);z=u(wl,"TEXTAREA",{maxlength:!0,class:!0,placeholder:!0}),p(z).forEach(c),ae=_(wl),Z=u(wl,"BUTTON",{class:!0});var Hr=p(Z);te.l(Hr),Hr.forEach(c),wl.forEach(c),Ze.forEach(c),B=_(Dt),M=u(Dt,"DIV",{class:!0});var jr=p(M);V=u(jr,"DIV",{class:!0});var ol=p(V);N=u(ol,"DIV",{class:!0});var al=p(N);F=u(al,"H3",{class:!0,"data-svelte-h":!0}),W(F)!=="svelte-x9l5tw"&&(F.textContent=le),De=_(al),K=u(al,"DIV",{class:!0});var xl=p(K);ee=u(xl,"BUTTON",{class:!0});var kl=p(ee);ge=u(kl,"SPAN",{});var Or=p(ge);for(let ar=0;ar<we.length;ar+=1)we[ar].l(Or);Or.forEach(c),Ne=_(kl),he(ve.$$.fragment,kl),kl.forEach(c),je=_(xl),Ee&&Ee.l(xl),xl.forEach(c),tt=_(al),xe=u(al,"DIV",{class:!0,"data-svelte-h":!0}),W(xe)!=="svelte-m7murz"&&(xe.innerHTML=Ve),al.forEach(c),Ke=_(ol),Oe=u(ol,"DIV",{});var El=p(Oe);se=u(El,"H3",{class:!0,"data-svelte-h":!0}),W(se)!=="svelte-1pzzi7j"&&(se.textContent=pt),ht=_(El),H=u(El,"DIV",{class:!0});var Lt=p(H);Le=u(Lt,"BUTTON",{class:!0});var Sr=p(Le);_e=u(Sr,"DIV",{class:!0});var Tl=p(_e);Be=u(Tl,"DIV",{class:!0,"data-svelte-h":!0}),W(Be)!=="svelte-qsi6ww"&&(Be.innerHTML=ne),P=_(Tl),j=u(Tl,"BUTTON",{class:!0,title:!0});var Ar=p(j);ie.l(Ar),Ar.forEach(c),Tl.forEach(c),Sr.forEach(c),Je=_(Lt),ye=u(Lt,"BUTTON",{class:!0});var Ur=p(ye);$e=u(Ur,"DIV",{class:!0});var Cl=p($e);Re=u(Cl,"DIV",{class:!0,"data-svelte-h":!0}),W(Re)!=="svelte-1c7qu8y"&&(Re.innerHTML=rt),Xe=_(Cl),Pe=u(Cl,"BUTTON",{class:!0,title:!0});var zr=p(Pe);ke.l(zr),zr.forEach(c),Cl.forEach(c),Ur.forEach(c),mt=_(Lt),Qe=u(Lt,"BUTTON",{class:!0});var Br=p(Qe);We=u(Br,"DIV",{class:!0});var $l=p(We);nt=u($l,"DIV",{class:!0,"data-svelte-h":!0}),W(nt)!=="svelte-1o6w87n"&&(nt.innerHTML=gl),hl=_($l),Fe=u($l,"BUTTON",{class:!0,title:!0});var Rr=p(Fe);m.l(Rr),Rr.forEach(c),$l.forEach(c),Br.forEach(c),oe=_(Lt),O.l(Lt),Lt.forEach(c),El.forEach(c),S=_(ol),Me=u(ol,"DIV",{class:!0});var Il=p(Me);ot=u(Il,"DIV",{});var il=p(ot);jt=u(il,"DIV",{class:!0,"data-svelte-h":!0}),W(jt)!=="svelte-1n9m3ma"&&(jt.innerHTML=pr),Ul=_(il),Ae=u(il,"INPUT",{id:!0,type:!0,min:!0,max:!0,step:!0,class:!0}),zl=_(il),Ot=u(il,"DIV",{class:!0,"data-svelte-h":!0}),W(Ot)!=="svelte-y6blve"&&(Ot.innerHTML=hr),il.forEach(c),Bl=_(Il),at=u(Il,"DIV",{});var cl=p(at);St=u(cl,"DIV",{class:!0,"data-svelte-h":!0}),W(St)!=="svelte-pmq2mj"&&(St.innerHTML=mr),Rl=_(cl),Ue=u(cl,"INPUT",{id:!0,type:!0,min:!0,max:!0,step:!0,class:!0}),Gl=_(cl),At=u(cl,"DIV",{class:!0,"data-svelte-h":!0}),W(At)!=="svelte-17pelb8"&&(At.innerHTML=gr),cl.forEach(c),Il.forEach(c),ol.forEach(c),jr.forEach(c),Dt.forEach(c),Fl=_(Zt),el=u(Zt,"DIV",{class:!0});var Gr=p(el);ze=u(Gr,"DIV",{class:!0});var Pt=p(ze);Te&&Te.l(Pt),_l=_(Pt),Ut=u(Pt,"DIV",{class:!0,"data-svelte-h":!0}),W(Ut)!=="svelte-jb3ali"&&(Ut.innerHTML=_r),Yl=_(Pt),gt=u(Pt,"DIV",{class:!0});var Dl=p(gt);_t=u(Dl,"DIV",{class:!0});var Vl=p(_t);bt=u(Vl,"BUTTON",{class:!0});var Fr=p(bt);ql=Y(Fr,"API"),Fr.forEach(c),Kl=_(Vl),vt=u(Vl,"BUTTON",{class:!0});var Yr=p(vt);Jl=Y(Yr,"Local"),Yr.forEach(c),Vl.forEach(c),Xl=_(Dl),yt=u(Dl,"DIV",{class:!0});var Ll=p(yt);it=u(Ll,"BUTTON",{class:!0});var Pl=p(it);he(zt.$$.fragment,Pl),Ql=_(Pl),Bt=u(Pl,"SPAN",{class:!0,"data-svelte-h":!0}),W(Bt)!=="svelte-1horous"&&(Bt.textContent=br),Pl.forEach(c),Wl=_(Ll),wt=u(Ll,"BUTTON",{class:!0,"data-svelte-h":!0}),W(wt)!=="svelte-1u9xuv8"&&(wt.innerHTML=vr),Ll.forEach(c),Dl.forEach(c),Zl=_(Pt),Ye=u(Pt,"DIV",{class:!0});var ul=p(Ye);xt=u(ul,"DIV",{class:!0});var Ml=p(xt);kt=u(Ml,"DIV",{class:!0});var Nl=p(kt);Rt=u(Nl,"DIV",{class:!0,"data-svelte-h":!0}),W(Rt)!=="svelte-1eboucz"&&(Rt.innerHTML=yr),er=_(Nl),Et=u(Nl,"BUTTON",{class:!0,title:!0});var qr=p(Et);he(Gt.$$.fragment,qr),qr.forEach(c),Nl.forEach(c),tr=_(Ml),Ft=u(Ml,"DIV",{class:!0});var Kr=p(Ft);ct.l(Kr),Kr.forEach(c),Ml.forEach(c),lr=_(ul),Tt=u(ul,"DIV",{class:!0});var Hl=p(Tt);Ct=u(Hl,"DIV",{class:!0});var jl=p(Ct);Yt=u(jl,"DIV",{class:!0,"data-svelte-h":!0}),W(Yt)!=="svelte-w4xfzx"&&(Yt.innerHTML=xr),rr=_(jl),$t=u(jl,"BUTTON",{class:!0,title:!0});var Jr=p($t);he(qt.$$.fragment,Jr),Jr.forEach(c),jl.forEach(c),sr=_(Hl),Kt=u(Hl,"DIV",{class:!0});var Xr=p(Kt);ut.l(Xr),Xr.forEach(c),Hl.forEach(c),nr=_(ul),ue&&ue.l(ul),ul.forEach(c),Pt.forEach(c),Gr.forEach(c),Zt.forEach(c),qe.forEach(c),yl=_(f),de&&de.l(f),tl=_(f),Ce&&Ce.l(f),ll=Ht(),this.h()},h(){es.title="Text to Speech - HFStudio",o(h,"class","text-sm text-gray-400"),o(y,"class","text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors"),o(y,"title","Refresh with famous book opening"),o(i,"class","absolute top-3 left-3 flex items-center gap-2 z-10"),o(J,"class","text-sm text-gray-400"),o(G,"class","absolute top-3 right-3 flex items-center gap-2 z-10"),o(z,"maxlength","1000"),o(z,"class","w-full h-96 pt-10 px-6 pb-16 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(z,"placeholder","Type the text you'd like to convert to spoken audio here..."),z.autofocus=!0,Z.disabled=be=s[9]||!s[0].trim(),o(Z,"class","absolute bottom-4 right-4 px-5 py-2.5 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-1.5 shadow-sm text-base"),o(X,"class","relative"),o(a,"class","relative mb-4"),o(F,"class","text-sm font-medium text-gray-900 mb-2"),o(ee,"class",He="w-full p-3 border 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-t-lg border-b-0 border-black":"rounded-lg border-black")),o(K,"class","relative"),o(xe,"class","mt-1.5 text-xs text-gray-500 text-right"),o(N,"class","model-dropdown"),o(se,"class","text-sm font-medium text-gray-900 mb-2"),o(Be,"class","flex items-center gap-2"),o(j,"class","p-1 rounded-full hover:bg-gray-200 transition-colors w-5 h-5 flex items-center justify-center"),o(j,"title","Play sample"),o(_e,"class","flex items-center justify-between mb-1"),o(Le,"class",lt="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(s[1]==="Andrew"?"border-black":"border-gray-200")),o(Re,"class","flex items-center gap-2"),o(Pe,"class","p-1 rounded-full hover:bg-gray-200 transition-colors w-5 h-5 flex items-center justify-center"),o(Pe,"title","Play sample"),o($e,"class","flex items-center justify-between mb-1"),o(ye,"class",st="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(s[1]==="Lily"?"border-black":"border-gray-200")),o(nt,"class","flex items-center gap-2"),o(Fe,"class","p-1 rounded-full hover:bg-gray-200 transition-colors w-5 h-5 flex items-center justify-center"),o(Fe,"title","Play sample"),o(We,"class","flex items-center justify-between mb-1"),o(Qe,"class",Q="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(s[1]==="Pirate"?"border-black":"border-gray-200")),o(H,"class","grid grid-cols-2 gap-2"),o(jt,"class","mb-1"),o(Ae,"id","exaggeration-slider"),o(Ae,"type","range"),o(Ae,"min","0"),o(Ae,"max","1"),o(Ae,"step","0.01"),o(Ae,"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-1"),o(St,"class","mb-1"),o(Ue,"id","temperature-slider"),o(Ue,"type","range"),o(Ue,"min","0"),o(Ue,"max","1"),o(Ue,"step","0.01"),o(Ue,"class","w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"),o(At,"class","flex justify-between text-xs text-gray-400 mt-1"),o(Me,"class","space-y-3"),o(V,"class","grid grid-cols-1 lg:grid-cols-[1fr_1.4fr_1fr] gap-6"),o(M,"class","p-4 border border-gray-200 rounded-lg bg-white mb-6"),o(r,"class","flex-1 flex flex-col p-6"),o(Ut,"class","mb-4"),o(bt,"class",bl="px-2 py-1 text-xs font-medium rounded transition-colors "+(s[6]==="api"?"bg-white shadow-sm":"text-gray-600")),o(vt,"class",vl="px-2 py-1 text-xs font-medium rounded transition-colors "+(s[6]==="local"?"bg-white shadow-sm":"text-gray-600")),o(_t,"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(it,"class","flex items-center bg-gray-100 hover:bg-gray-200 rounded-md px-2 py-1 transition-colors"),o(wt,"class","flex items-center bg-amber-100 hover:bg-amber-200 rounded-md px-2 py-1 transition-colors"),o(yt,"class","flex items-center gap-2"),o(gt,"class","flex items-center justify-between mb-4"),o(Rt,"class","flex items-center gap-2"),o(Et,"class","p-1 hover:bg-blue-100 rounded transition-colors"),o(Et,"title","Copy setup code"),o(kt,"class","flex items-center justify-between px-3 py-2 bg-blue-50 border-b border-blue-200"),o(Ft,"class","relative"),o(xt,"class","bg-white rounded-lg border border-gray-200 overflow-hidden"),o(Yt,"class","flex items-center gap-2"),o($t,"class","p-1 hover:bg-amber-100 rounded transition-colors"),o($t,"title","Copy Python code"),o(Ct,"class","flex items-center justify-between px-3 py-2 bg-amber-50 border-b border-amber-200"),o(Kt,"class","relative"),o(Tt,"class","bg-white rounded-lg border border-gray-200 overflow-hidden"),o(Ye,"class","space-y-4"),o(ze,"class","p-4 h-full overflow-y-auto"),o(el,"class","w-96 border-l border-gray-200 bg-white h-full overflow-hidden"),o(l,"class","flex-1 flex"),o(t,"class","flex flex-col h-full"),o(t,"role","main"),o(t,"tabindex","-1")},m(f,x){A(f,e,x),A(f,t,x),n(t,l),n(l,r),n(r,a),n(a,i),n(i,h),n(i,E),n(i,y),pe(v,y,null),n(a,$),n(a,G),n(G,J),n(J,w),n(J,C),n(a,I),n(a,X),n(X,z),dl(z,s[0]),n(X,ae),n(X,Z),Jt[D].m(Z,null),n(r,B),n(r,M),n(M,V),n(V,N),n(N,F),n(N,De),n(N,K),n(K,ee),n(ee,ge);for(let qe=0;qe<we.length;qe+=1)we[qe]&&we[qe].m(ge,null);n(ee,Ne),pe(ve,ee,null),n(K,je),Ee&&Ee.m(K,null),n(N,tt),n(N,xe),n(V,Ke),n(V,Oe),n(Oe,se),n(Oe,ht),n(Oe,H),n(H,Le),n(Le,_e),n(_e,Be),n(_e,P),n(_e,j),Xt[re].m(j,null),n(H,Je),n(H,ye),n(ye,$e),n($e,Re),n($e,Xe),n($e,Pe),Qt[ce].m(Pe,null),n(H,mt),n(H,Qe),n(Qe,We),n(We,nt),n(We,hl),n(We,Fe),Wt[Se].m(Fe,null),n(H,oe),It[R].m(H,null),n(V,S),n(V,Me),n(Me,ot),n(ot,jt),n(ot,Ul),n(ot,Ae),dl(Ae,s[3]),n(ot,zl),n(ot,Ot),n(Me,Bl),n(Me,at),n(at,St),n(at,Rl),n(at,Ue),dl(Ue,s[4]),n(at,Gl),n(at,At),n(l,Fl),n(l,el),n(el,ze),Te&&Te.m(ze,null),n(ze,_l),n(ze,Ut),n(ze,Yl),n(ze,gt),n(gt,_t),n(_t,bt),n(bt,ql),n(_t,Kl),n(_t,vt),n(vt,Jl),n(gt,Xl),n(gt,yt),n(yt,it),pe(zt,it,null),n(it,Ql),n(it,Bt),n(yt,Wl),n(yt,wt),n(ze,Zl),n(ze,Ye),n(Ye,xt),n(xt,kt),n(kt,Rt),n(kt,er),n(kt,Et),pe(Gt,Et,null),n(xt,tr),n(xt,Ft),ct.m(Ft,null),n(Ye,lr),n(Ye,Tt),n(Tt,Ct),n(Ct,Yt),n(Ct,rr),n(Ct,$t),pe(qt,$t,null),n(Tt,sr),n(Tt,Kt),ut.m(Kt,null),n(Ye,nr),ue&&ue.m(Ye,null),A(f,yl,x),de&&de.m(f,x),A(f,tl,x),Ce&&Ce.m(f,x),A(f,ll,x),Ge=!0,z.focus(),or||(Er=[L(y,"click",s[37]),L(z,"input",s[41]),L(z,"keydown",s[34]),L(Z,"click",s[26]),L(ee,"click",s[42]),L(j,"click",s[44]),L(Le,"click",s[45]),L(Pe,"click",s[46]),L(ye,"click",s[47]),L(Fe,"click",s[48]),L(Qe,"click",s[49]),L(Ae,"change",s[52]),L(Ae,"input",s[52]),L(Ue,"change",s[53]),L(Ue,"input",s[53]),L(bt,"click",s[55]),L(vt,"click",s[56]),L(it,"click",s[40]),L(wt,"click",s[39]),L(Et,"click",s[57]),L($t,"click",s[58]),L(t,"click",s[35]),L(t,"keydown",s[34])],or=!0)},p(f,x){(!Ge||x[0]&1)&&U!==(U=f[0].length.toLocaleString()+"")&&et(w,U),x[0]&1&&dl(z,f[0]);let qe=D;if(D=Cr(f),D!==qe&&(ft(),T(Jt[qe],1,1,()=>{Jt[qe]=null}),dt(),te=Jt[D],te||(te=Jt[D]=Tr[D](f),te.c()),k(te,1),te.m(Z,null)),(!Ge||x[0]&513&&be!==(be=f[9]||!f[0].trim()))&&(Z.disabled=be),x[0]&33554436){rl=Sl(f[25]);let Ie;for(Ie=0;Ie<rl.length;Ie+=1){const nl=ls(f,rl,Ie);we[Ie]?we[Ie].p(nl,x):(we[Ie]=ss(nl),we[Ie].c(),we[Ie].m(ge,null))}for(;Ie<we.length;Ie+=1)we[Ie].d(1);we.length=rl.length}const Zt={};x[0]&256&&(Zt.class="text-gray-500 transition-transform "+(f[8]?"rotate-180":"")),ve.$set(Zt),(!Ge||x[0]&256&&He!==(He="w-full p-3 border 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 "+(f[8]?"rounded-t-lg border-b-0 border-black":"rounded-lg border-black")))&&o(ee,"class",He),f[8]?Ee?Ee.p(f,x):(Ee=ns(f),Ee.c(),Ee.m(K,null)):Ee&&(Ee.d(1),Ee=null);let Dt=re;re=Ir(f),re!==Dt&&(ft(),T(Xt[Dt],1,1,()=>{Xt[Dt]=null}),dt(),ie=Xt[re],ie||(ie=Xt[re]=$r[re](f),ie.c()),k(ie,1),ie.m(j,null)),(!Ge||x[0]&2&&lt!==(lt="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(f[1]==="Andrew"?"border-black":"border-gray-200")))&&o(Le,"class",lt);let Ze=ce;ce=Vr(f),ce!==Ze&&(ft(),T(Qt[Ze],1,1,()=>{Qt[Ze]=null}),dt(),ke=Qt[ce],ke||(ke=Qt[ce]=Dr[ce](f),ke.c()),k(ke,1),ke.m(Pe,null)),(!Ge||x[0]&2&&st!==(st="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(f[1]==="Lily"?"border-black":"border-gray-200")))&&o(ye,"class",st);let Vt=Se;Se=Pr(f),Se!==Vt&&(ft(),T(Wt[Vt],1,1,()=>{Wt[Vt]=null}),dt(),m=Wt[Se],m||(m=Wt[Se]=Lr[Se](f),m.c()),k(m,1),m.m(Fe,null)),(!Ge||x[0]&2&&Q!==(Q="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(f[1]==="Pirate"?"border-black":"border-gray-200")))&&o(Qe,"class",Q);let sl=R;R=Nr(f),R===sl?It[R].p(f,x):(ft(),T(It[sl],1,1,()=>{It[sl]=null}),dt(),O=It[R],O?O.p(f,x):(O=It[R]=Mr[R](f),O.c()),k(O,1),O.m(H,null)),x[0]&8&&dl(Ae,f[3]),x[0]&16&&dl(Ue,f[4]),f[21]?Te?Te.p(f,x):(Te=as(f),Te.c(),Te.m(ze,_l)):Te&&(Te.d(1),Te=null),(!Ge||x[0]&64&&bl!==(bl="px-2 py-1 text-xs font-medium rounded transition-colors "+(f[6]==="api"?"bg-white shadow-sm":"text-gray-600")))&&o(bt,"class",bl),(!Ge||x[0]&64&&vl!==(vl="px-2 py-1 text-xs font-medium rounded transition-colors "+(f[6]==="local"?"bg-white shadow-sm":"text-gray-600")))&&o(vt,"class",vl),x[0]&128&&Ol(wr,wr=f[7])?(ct.d(1),ct=is(f),ct.c(),ct.m(Ft,null)):ct.p(f,x),x[0]&128&&Ol(kr,kr=f[7])?(ut.d(1),ut=cs(f),ut.c(),ut.m(Kt,null)):ut.p(f,x),f[10]?ue?(ue.p(f,x),x[0]&1024&&k(ue,1)):(ue=us(f),ue.c(),k(ue,1),ue.m(Ye,null)):ue&&(ft(),T(ue,1,1,()=>{ue=null}),dt()),f[18]?de?(de.p(f,x),x[0]&262144&&k(de,1)):(de=ps(f),de.c(),k(de,1),de.m(tl.parentNode,tl)):de&&(ft(),T(de,1,1,()=>{de=null}),dt()),f[22]?Ce?Ce.p(f,x):(Ce=ms(f),Ce.c(),Ce.m(ll.parentNode,ll)):Ce&&(Ce.d(1),Ce=null)},i(f){Ge||(k(v.$$.fragment,f),k(te),k(ve.$$.fragment,f),k(ie),k(ke),k(m),k(O),k(zt.$$.fragment,f),k(Gt.$$.fragment,f),k(qt.$$.fragment,f),k(ue),k(de),Ge=!0)},o(f){T(v.$$.fragment,f),T(te),T(ve.$$.fragment,f),T(ie),T(ke),T(m),T(O),T(zt.$$.fragment,f),T(Gt.$$.fragment,f),T(qt.$$.fragment,f),T(ue),T(de),Ge=!1},d(f){f&&(c(e),c(t),c(yl),c(tl),c(ll)),fe(v),Jt[D].d(),bs(we,f),fe(ve),Ee&&Ee.d(),Xt[re].d(),Qt[ce].d(),Wt[Se].d(),It[R].d(),Te&&Te.d(),fe(zt),fe(Gt),ct.d(f),fe(qt),ut.d(f),ue&&ue.d(),de&&de.d(f),Ce&&Ce.d(f),or=!1,ml(Er)}}}function fl(s){const e=Math.floor(s/60),t=Math.floor(s%60);return`${e}:${t.toString().padStart(2,"0")}`}function sn(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,h=!1,g=null,E=0,y=.25,v=.7,$=!1,G=0,J=0,U="",w=null,C=null,I=null,X=!1,z="",ae="",Z=0,D=[],te=!1,be=!1,B=null,M="api",V="",N="",F=0;const le=["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 De=0;const K=[{id:"chatterbox",name:"Chatterbox",badge:"recommended"},{id:"kokoro",name:"Kokoro",badge:"coming soon",disabled:!0}],ee=[{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 ge(){if(!l.trim())return;if(!(await fetch("/api/auth/user",{credentials:"include"})).ok){t(21,be=!0);return}t(9,h=!0),t(10,g=null),t(13,G=0),t(12,$=!1),t(15,U=l.length>30?l.substring(0,30)+"...":l);try{let Q=null;if(r==="Yours"&&D.length>0){const S=D[0];S&&S.voice_url&&(Q=window.location.origin+S.voice_url)}else{const S=ee.find(Me=>Me.name===r);S&&S.preview_url&&(Q=S.preview_url)}const oe={text:l,voice_id:r.toLowerCase(),model_id:a.toLowerCase(),mode:"api",parameters:{exaggeration:y,temperature:v},voice_url:Q},R=await fetch("/api/tts/generate",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(oe)});if(!R.ok){const S=await R.text();throw new Error(`HTTP error! status: ${R.status}, body: ${S}`)}const O=await R.json();if(O.success&&O.audio_url)t(10,g=O.audio_url),t(11,E=O.generation_time||0),await H(oe,O),setTimeout(()=>{w&&w.play().catch(()=>{})},100);else{const S=O.error||"Unknown error occurred";se("Generation Failed",S),t(10,g=null)}}catch{se("Network Error","Failed to connect to the server. Please check your connection and try again."),t(10,g=null)}finally{t(9,h=!1)}}function Ne(){w&&($?w.pause():w.play())}function ve(){w&&t(14,J=w.duration)}function He(){w&&t(13,G=w.currentTime)}function je(){t(12,$=!0)}function tt(){t(12,$=!1)}function xe(){if(g){const m=document.createElement("a");m.href=g,m.download="speech.wav",m.click()}}function Ve(m,Q){if(Q.stopPropagation(),I===m.name)C&&(C.pause(),C.currentTime=0),t(17,I=null);else{C&&C.pause(),t(17,I=m.name);const oe=m.sample||"/samples/harvard.wav";C?C.src=oe:(C=new Audio(oe),C.addEventListener("ended",()=>{t(17,I=null)})),C.play().catch(R=>{t(17,I=null)})}}function Ke(m){m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),ge()),m.key==="Escape"&&t(8,i=!1)}function Oe(m){m.target.closest(".model-dropdown")||t(8,i=!1),m.target.closest(".voice-dropdown")}function se(m,Q=""){t(19,z=m),t(20,ae=Q),t(18,X=!0)}function pt(){t(18,X=!1),t(19,z=""),t(20,ae="")}function ht(){De=(De+1)%le.length,t(0,l=le[De])}async function H(m,Q){try{let oe=null;const R=D.find(S=>S.voice_name===r);if(R&&R.voice_url)oe=window.location.origin+R.voice_url;else{const S=ee.find(Me=>Me.name===r);S&&S.preview_url&&(oe=S.preview_url)}const O=`audio_bytes = client.text_to_speech(
7
+ "${m.text.replace(/"/g,'\\"')}",
8
+ extra_body={
9
+ "exaggeration": ${m.parameters.exaggeration},
10
+ "temperature": ${m.parameters.temperature}${oe?`,
11
+ "audio_url": "${oe}"`:""}
12
+ }
13
+ )`;await fetch("/api/history/save",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({code:O,result_type:"audio",result_data:{url:Q.audio_url,title:U,type:"audio"},entry_type:"generation"})}),await Le()}catch(oe){console.error("Error saving to history:",oe)}}async function Le(){try{const m=await fetch("/api/history/load",{method:"GET",credentials:"include"});m.ok&&(Z=(await m.json()).entries.filter(R=>R.entry_type==="generation").length)}catch(m){console.error("Error loading history count:",m),Z=0}}async function _e(){try{te=!0;const m=await fetch("/api/voice/user-voices",{method:"GET",credentials:"include"});if(m.ok){const Q=await m.json();t(5,D=Q.voices||[])}else t(5,D=[])}catch(m){console.error("Error loading user voices:",m),t(5,D=[])}finally{te=!1}}function Be(){return M==="local"?`pip install huggingface-hub hfstudio uv
14
+ hfstudio start ${a.toLowerCase()} --port 7861`:"pip install huggingface-hub"}function ne(){return M==="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 m=null;if(r==="Yours"&&D.length>0){const O=D[0];O&&O.voice_url&&(m=window.location.origin+O.voice_url)}else{const O=ee.find(S=>S.name===r);O&&O.preview_url&&(m=O.preview_url)}const Q=l||"Hello, this is a sample text.";return`${`from huggingface_hub import InferenceClient
18
+
19
+ ${ne()}`}
20
+
21
+ audio_bytes = client.text_to_speech(
22
+ "${Q.replace(/"/g,'\\"')}",
23
+ extra_body={
24
+ "exaggeration": ${y},
25
+ "temperature": ${v}${m?`,
26
+ "audio_url": "${m}"`:""}
27
+ }
28
+ )`}function j(m,Q="Copied to clipboard!"){navigator.clipboard.writeText(m).then(()=>{t(22,B=Q),setTimeout(()=>{t(22,B=null)},2e3)})}function re(){let m=null;if(r==="Yours"&&D.length>0){const S=D[0];S&&S.voice_url&&(m=window.location.origin+S.voice_url)}else{const S=ee.find(Me=>Me.name===r);S&&S.preview_url&&(m=S.preview_url)}const Q=`from huggingface_hub import InferenceClient
29
+ import gradio as gr
30
+ import os
31
+
32
+ client = InferenceClient(api_key=os.getenv("HF_TOKEN"))
33
+
34
+ def generate_speech(text):
35
+ if not text.strip():
36
+ return None
37
+
38
+ try:
39
+ audio_bytes = client.text_to_speech(
40
+ text,
41
+ extra_body={
42
+ "exaggeration": ${y},
43
+ "temperature": ${v},
44
+ ${m?`"audio_url": "${m}",`:""}
45
+ }
46
+ )
47
+ return audio_bytes
48
+ except Exception as e:
49
+ raise gr.Error(f"Error generating speech: {str(e)}")
50
+
51
+ # Create the Gradio interface
52
+ with gr.Blocks(title="Text to Speech") as demo:
53
+ gr.Markdown("# Text to Speech")
54
+ gr.Markdown("Convert text to speech using the Chatterbox model.")
55
+
56
+ with gr.Row():
57
+ with gr.Column():
58
+ text_input = gr.Textbox(
59
+ label="Text to convert to speech",
60
+ placeholder="${l.replace(/"/g,'\\"').substring(0,100)}...",
61
+ lines=5,
62
+ value="${l.replace(/"/g,'\\"')}"
63
+ )
64
+ generate_btn = gr.Button("Generate Speech", variant="primary")
65
+
66
+ with gr.Column():
67
+ audio_output = gr.Audio(label="Generated Speech")
68
+
69
+ generate_btn.click(
70
+ fn=generate_speech,
71
+ inputs=[text_input],
72
+ outputs=[audio_output]
73
+ )
74
+
75
+ if __name__ == "__main__":
76
+ demo.launch()`,oe=`huggingface_hub
77
+ gradio`,R="https://huggingface.co/new-space",O=new URLSearchParams({name:`text-to-speech-${r.toLowerCase()}-${Date.now()}`,sdk:"gradio","files[0][path]":"app.py","files[0][content]":Q,"files[1][path]":"requirements.txt","files[1][content]":oe});window.open(`${R}?${O.toString()}`,"_blank")}function ie(){const m=[];if(V){const R=V.includes("pip install")||V.includes("hfstudio start")?"bash":"";m.push(`## Setup (Run in Terminal)
78
+
79
+ \`\`\`${R}
80
+ ${V}
81
+ \`\`\``)}N&&m.push(`## Python Code
82
+
83
+ \`\`\`python
84
+ ${N}
85
+ \`\`\``);const Q=m.join(`
86
+
87
+ `);j(Q,"All code copied as Markdown!")}Es(async()=>{await Le(),await _e()});function lt(){l=this.value,t(0,l)}const Je=()=>t(8,i=!i),ye=m=>{m.disabled||(t(2,a=m.name),t(8,i=!1))},$e=m=>Ve({name:"Andrew",sample:"/voices/andrew.mp3"},m),Re=()=>t(1,r="Andrew"),rt=m=>Ve({name:"Lily",sample:"/voices/lily.mp3"},m),Xe=()=>t(1,r="Lily"),Pe=m=>Ve({name:"Pirate",sample:"/voices/pirate.mp3"},m),ce=()=>t(1,r="Pirate"),ke=m=>Ve({name:"Yours",sample:D[0].voice_url},m),st=()=>t(1,r="Yours");function mt(){y=Wr(this.value),t(3,y)}function Qe(){v=Wr(this.value),t(4,v)}const We=()=>t(21,be=!1),nt=()=>t(6,M="api"),gl=()=>t(6,M="local"),hl=()=>j(V),Fe=()=>j(N);function Se(m){Ts[m?"unshift":"push"](()=>{w=m,t(16,w)})}return s.$$.update=()=>{s.$$.dirty[0]&255&&(t(23,V=Be()),t(24,N=P()),t(7,F++,F))},[l,r,a,y,v,D,M,F,i,h,g,E,$,G,J,U,w,I,X,z,ae,be,B,V,N,K,ge,Ne,ve,He,je,tt,xe,Ve,Ke,Oe,pt,ht,j,re,ie,lt,Je,ye,$e,Re,rt,Xe,Pe,ce,ke,st,mt,Qe,We,nt,gl,hl,Fe,Se]}class fn extends gs{constructor(e){super(),_s(this,e,sn,rn,Ol,{},null,[-1,-1,-1])}}export{fn as component};
hfstudio/static/_app/immutable/nodes/3.CLzJht-f.js ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{S as Pe,i as Ve,s as Ne,u as ve,v as ee,w as S,x,y as te,z as le,A as se,B as Ce,C as Qe,D as We,E as Xe,F as Ze,d as c,H as xe,p as u,K as _e,b as W,c as a,m as ce,L as st,h as M,e as h,f as g,r as ye,g as ne,M as Se,k as O,j as m,t as ae,G as rt,n as ot,O as He,P as Me,a as we,N as be,T as nt,q as Le}from"../chunks/TRxHAhOH.js";import{g as at,C as Ie,P as Z,D as it}from"../chunks/DUd0gdPo.js";import{I as et,g as tt,a as lt,e as Re,u as ct,o as ut}from"../chunks/BhRpzVYR.js";import"../chunks/IHki7fMi.js";import{N as dt}from"../chunks/Bv5vELPx.js";import{a as ft,P as ht}from"../chunks/gtFtmmyB.js";function mt(o){let e;const t=o[2].default,l=Qe(t,o,o[3],null);return{c(){l&&l.c()},l(r){l&&l.l(r)},m(r,s){l&&l.m(r,s),e=!0},p(r,s){l&&l.p&&(!e||s&8)&&We(l,t,r,r[3],e?Ze(t,r[3],s,null):Xe(r[3]),null)},i(r){e||(x(l,r),e=!0)},o(r){S(l,r),e=!1},d(r){l&&l.d(r)}}}function pt(o){let e,t;const l=[{name:"rotate-ccw"},o[1],{iconNode:o[0]}];let r={$$slots:{default:[mt]},$$scope:{ctx:o}};for(let s=0;s<l.length;s+=1)r=ve(r,l[s]);return e=new et({props:r}),{c(){se(e.$$.fragment)},l(s){le(e.$$.fragment,s)},m(s,n){te(e,s,n),t=!0},p(s,[n]){const f=n&3?tt(l,[l[0],n&2&&lt(s[1]),n&1&&{iconNode:s[0]}]):{};n&8&&(f.$$scope={dirty:n,ctx:s}),e.$set(f)},i(s){t||(x(e.$$.fragment,s),t=!0)},o(s){S(e.$$.fragment,s),t=!1},d(s){ee(e,s)}}}function gt(o,e,t){let{$$slots:l={},$$scope:r}=e;const s=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}]];return o.$$set=n=>{t(1,e=ve(ve({},e),Ce(n))),"$$scope"in n&&t(3,r=n.$$scope)},e=Ce(e),[s,e,l,r]}class _t extends Pe{constructor(e){super(),Ve(this,e,gt,pt,Ne,{})}}function bt(o){let e;const t=o[2].default,l=Qe(t,o,o[3],null);return{c(){l&&l.c()},l(r){l&&l.l(r)},m(r,s){l&&l.m(r,s),e=!0},p(r,s){l&&l.p&&(!e||s&8)&&We(l,t,r,r[3],e?Ze(t,r[3],s,null):Xe(r[3]),null)},i(r){e||(x(l,r),e=!0)},o(r){S(l,r),e=!1},d(r){l&&l.d(r)}}}function vt(o){let e,t;const l=[{name:"share"},o[1],{iconNode:o[0]}];let r={$$slots:{default:[bt]},$$scope:{ctx:o}};for(let s=0;s<l.length;s+=1)r=ve(r,l[s]);return e=new et({props:r}),{c(){se(e.$$.fragment)},l(s){le(e.$$.fragment,s)},m(s,n){te(e,s,n),t=!0},p(s,[n]){const f=n&3?tt(l,[l[0],n&2&&lt(s[1]),n&1&&{iconNode:s[0]}]):{};n&8&&(f.$$scope={dirty:n,ctx:s}),e.$set(f)},i(s){t||(x(e.$$.fragment,s),t=!0)},o(s){S(e.$$.fragment,s),t=!1},d(s){ee(e,s)}}}function yt(o,e,t){let{$$slots:l={},$$scope:r}=e;const s=[["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}],["polyline",{points:"16 6 12 2 8 6"}],["line",{x1:"12",x2:"12",y1:"2",y2:"15"}]];return o.$$set=n=>{t(1,e=ve(ve({},e),Ce(n))),"$$scope"in n&&t(3,r=n.$$scope)},e=Ce(e),[s,e,l,r]}class Et extends Pe{constructor(e){super(),Ve(this,e,yt,vt,Ne,{})}}const{document:ze}=at;function Ue(o,e,t){const l=o.slice();return l[25]=e[t],l[26]=e,l[27]=t,l}function kt(o){let e;return{c(){e=ae("Python code to reproduce your actions via the API")},l(t){e=ne(t,"Python code to reproduce your actions via the API")},m(t,l){W(t,e,l)},d(t){t&&c(e)}}}function wt(o){let e;return{c(){e=ae("Python code to reproduce your actions using a local HFStudio server")},l(t){e=ne(t,"Python code to reproduce your actions using a local HFStudio server")},m(t,l){W(t,e,l)},d(t){t&&c(e)}}}function je(o){let e,t,l,r,s,n="Reset history",f,$,E,I,_,A="Copy all as Markdown",k,y,w;return l=new _t({props:{size:16,class:"text-red-600"}}),E=new Ie({props:{size:16,class:"text-gray-600"}}),{c(){e=m("div"),t=m("button"),se(l.$$.fragment),r=O(),s=m("span"),s.textContent=n,f=O(),$=m("button"),se(E.$$.fragment),I=O(),_=m("span"),_.textContent=A,this.h()},l(p){e=h(p,"DIV",{class:!0});var v=g(e);t=h(v,"BUTTON",{class:!0,title:!0});var P=g(t);le(l.$$.fragment,P),r=M(P),s=h(P,"SPAN",{class:!0,"data-svelte-h":!0}),ye(s)!=="svelte-1x639i7"&&(s.textContent=n),P.forEach(c),f=M(v),$=h(v,"BUTTON",{class:!0});var D=g($);le(E.$$.fragment,D),I=M(D),_=h(D,"SPAN",{class:!0,"data-svelte-h":!0}),ye(_)!=="svelte-kfbkuj"&&(_.textContent=A),D.forEach(c),v.forEach(c),this.h()},h(){u(s,"class","ml-2 text-sm font-medium text-red-600"),u(t,"class","flex items-center bg-red-50 hover:bg-red-100 rounded-md px-3 py-1.5 transition-colors"),u(t,"title","Clear history"),u(_,"class","ml-2 text-sm font-medium text-gray-600"),u($,"class","flex items-center bg-gray-100 hover:bg-gray-200 rounded-md px-3 py-1.5 transition-colors"),u(e,"class","flex items-center gap-2")},m(p,v){W(p,e,v),a(e,t),te(l,t,null),a(t,r),a(t,s),a(e,f),a(e,$),te(E,$,null),a($,I),a($,_),k=!0,y||(w=[ce(t,"click",o[6]),ce($,"click",o[8])],y=!0)},p:ot,i(p){k||(x(l.$$.fragment,p),x(E.$$.fragment,p),k=!0)},o(p){S(l.$$.fragment,p),S(E.$$.fragment,p),k=!1},d(p){p&&c(e),ee(l),ee(E),y=!1,xe(w)}}}function Be(o){let e,t,l,r='<span class="text-sm font-medium text-amber-900">Setup (Run in Terminal)</span> <span class="text-xs bg-amber-100 text-amber-700 px-2 py-0.5 rounded">Run once</span>',s,n,f,$,E,I,_,A;f=new Ie({props:{size:14,class:"text-amber-600"}});function k(p,v){return p[2]==="pip install huggingface-hub"?Ct:$t}let y=k(o),w=y(o);return{c(){e=m("div"),t=m("div"),l=m("div"),l.innerHTML=r,s=O(),n=m("button"),se(f.$$.fragment),$=O(),E=m("div"),w.c(),this.h()},l(p){e=h(p,"DIV",{class:!0});var v=g(e);t=h(v,"DIV",{class:!0});var P=g(t);l=h(P,"DIV",{class:!0,"data-svelte-h":!0}),ye(l)!=="svelte-akzwnd"&&(l.innerHTML=r),s=M(P),n=h(P,"BUTTON",{class:!0,title:!0});var D=g(n);le(f.$$.fragment,D),D.forEach(c),P.forEach(c),$=M(v),E=h(v,"DIV",{class:!0});var H=g(E);w.l(H),H.forEach(c),v.forEach(c),this.h()},h(){u(l,"class","flex items-center gap-2"),u(n,"class","p-1.5 hover:bg-amber-100 rounded transition-colors"),u(n,"title","Copy setup code"),u(t,"class","flex items-center justify-between px-4 py-2 bg-amber-50 border-b border-amber-200"),u(E,"class","relative"),u(e,"class","bg-white rounded-lg border border-gray-200 overflow-hidden")},m(p,v){W(p,e,v),a(e,t),a(t,l),a(t,s),a(t,n),te(f,n,null),a(e,$),a(e,E),w.m(E,null),I=!0,_||(A=ce(n,"click",o[12]),_=!0)},p(p,v){y===(y=k(p))&&w?w.p(p,v):(w.d(1),w=y(p),w&&(w.c(),w.m(E,null)))},i(p){I||(x(f.$$.fragment,p),I=!0)},o(p){S(f.$$.fragment,p),I=!1},d(p){p&&c(e),ee(f),w.d(),_=!1,A()}}}function $t(o){let e,t,l,r=Z.highlight(o[2],Z.languages.bash,"bash")+"";return{c(){e=m("pre"),t=m("code"),l=new Me(!1),this.h()},l(s){e=h(s,"PRE",{class:!0});var n=g(e);t=h(n,"CODE",{class:!0});var f=g(t);l=He(f,!1),f.forEach(c),n.forEach(c),this.h()},h(){l.a=null,u(t,"class","language-bash text-sm"),u(e,"class","p-4 overflow-x-auto bg-gray-50")},m(s,n){W(s,e,n),a(e,t),l.m(r,t)},p(s,n){n&4&&r!==(r=Z.highlight(s[2],Z.languages.bash,"bash")+"")&&l.p(r)},d(s){s&&c(e)}}}function Ct(o){let e,t,l;return{c(){e=m("pre"),t=m("code"),l=ae(o[2]),this.h()},l(r){e=h(r,"PRE",{class:!0});var s=g(e);t=h(s,"CODE",{class:!0});var n=g(t);l=ne(n,o[2]),n.forEach(c),s.forEach(c),this.h()},h(){u(t,"class","language-bash text-sm text-black"),u(e,"class","p-4 overflow-x-auto bg-gray-50")},m(r,s){W(r,e,s),a(e,t),a(t,l)},p(r,s){s&4&&we(l,r[2])},d(r){r&&c(e)}}}function Fe(o){let e,t,l,r='<span class="text-sm font-medium text-blue-900">Imports (Python)</span> <span class="text-xs bg-blue-100 text-blue-700 px-2 py-0.5 rounded">Run once</span>',s,n,f,$,E,I,_,A,k=Z.highlight(o[3],Z.languages.python,"python")+"",y,w,p;return f=new Ie({props:{size:14,class:"text-blue-600"}}),{c(){e=m("div"),t=m("div"),l=m("div"),l.innerHTML=r,s=O(),n=m("button"),se(f.$$.fragment),$=O(),E=m("div"),I=m("pre"),_=m("code"),A=new Me(!1),this.h()},l(v){e=h(v,"DIV",{class:!0});var P=g(e);t=h(P,"DIV",{class:!0});var D=g(t);l=h(D,"DIV",{class:!0,"data-svelte-h":!0}),ye(l)!=="svelte-sun3yz"&&(l.innerHTML=r),s=M(D),n=h(D,"BUTTON",{class:!0,title:!0});var H=g(n);le(f.$$.fragment,H),H.forEach(c),D.forEach(c),$=M(P),E=h(P,"DIV",{class:!0});var B=g(E);I=h(B,"PRE",{class:!0});var J=g(I);_=h(J,"CODE",{class:!0});var K=g(_);A=He(K,!1),K.forEach(c),J.forEach(c),B.forEach(c),P.forEach(c),this.h()},h(){u(l,"class","flex items-center gap-2"),u(n,"class","p-1.5 hover:bg-blue-100 rounded transition-colors"),u(n,"title","Copy import code"),u(t,"class","flex items-center justify-between px-4 py-2 bg-blue-50 border-b border-blue-200"),A.a=null,u(_,"class","language-python text-sm"),u(I,"class","p-4 overflow-x-auto bg-gray-50"),u(E,"class","relative"),u(e,"class","bg-white rounded-lg border border-gray-200 overflow-hidden")},m(v,P){W(v,e,P),a(e,t),a(t,l),a(t,s),a(t,n),te(f,n,null),a(e,$),a(e,E),a(E,I),a(I,_),A.m(k,_),y=!0,w||(p=ce(n,"click",o[13]),w=!0)},p(v,P){(!y||P&8)&&k!==(k=Z.highlight(v[3],Z.languages.python,"python")+"")&&A.p(k)},i(v){y||(x(f.$$.fragment,v),y=!0)},o(v){S(f.$$.fragment,v),y=!1},d(v){v&&c(e),ee(f),w=!1,p()}}}function Ge(o){let e,t='<p class="text-gray-500">Start using the UI to see generated code here</p>';return{c(){e=m("div"),e.innerHTML=t,this.h()},l(l){e=h(l,"DIV",{class:!0,"data-svelte-h":!0}),ye(e)!=="svelte-1v3062w"&&(e.innerHTML=t),this.h()},h(){u(e,"class","bg-white rounded-lg border border-gray-200 p-8 text-center")},m(l,r){W(l,e,r)},d(l){l&&c(e)}}}function qe(o){let e,t,l,r,s,n,f,$,E,I,_=(o[25].result.title||"Generated Audio")+"",A,k,y,w,p=Je(o[25].result.duration||0)+"",v,P,D,H,B,J,K,b,U,i,V,T=o[26],q=o[27],Y,L,X;const ue=[Dt,It],ie=[];function Ee(N,Q){return N[25].isPlaying?0:1}n=Ee(o),f=ie[n]=ue[n](o);function ge(){return o[15](o[25])}B=new it({props:{size:16,class:"text-gray-600"}});function re(){return o[16](o[25])}b=new Et({props:{size:16,class:"text-gray-600"}});const R=()=>o[17](i,T,q),z=()=>o[17](null,T,q);function j(){return o[18](o[25],o[26],o[27])}return{c(){e=m("div"),t=m("div"),l=m("div"),r=m("div"),s=m("button"),f.c(),$=O(),E=m("div"),I=m("div"),A=ae(_),k=O(),y=m("div"),w=ae("Duration: "),v=ae(p),P=O(),D=m("div"),H=m("button"),se(B.$$.fragment),J=O(),K=m("button"),se(b.$$.fragment),U=O(),i=m("audio"),this.h()},l(N){e=h(N,"DIV",{class:!0});var Q=g(e);t=h(Q,"DIV",{class:!0});var oe=g(t);l=h(oe,"DIV",{class:!0});var F=g(l);r=h(F,"DIV",{class:!0});var d=g(r);s=h(d,"BUTTON",{class:!0});var C=g(s);f.l(C),C.forEach(c),$=M(d),E=h(d,"DIV",{class:!0});var G=g(E);I=h(G,"DIV",{class:!0});var me=g(I);A=ne(me,_),me.forEach(c),k=M(G),y=h(G,"DIV",{class:!0});var fe=g(y);w=ne(fe,"Duration: "),v=ne(fe,p),fe.forEach(c),G.forEach(c),d.forEach(c),P=M(F),D=h(F,"DIV",{class:!0});var de=g(D);H=h(de,"BUTTON",{class:!0,title:!0});var ke=g(H);le(B.$$.fragment,ke),ke.forEach(c),J=M(de),K=h(de,"BUTTON",{class:!0,title:!0});var pe=g(K);le(b.$$.fragment,pe),pe.forEach(c),de.forEach(c),F.forEach(c),U=M(oe),i=h(oe,"AUDIO",{src:!0,class:!0}),g(i).forEach(c),oe.forEach(c),Q.forEach(c),this.h()},h(){u(s,"class","w-10 h-10 bg-gradient-to-r from-amber-500 to-orange-500 rounded-full flex items-center justify-center text-white hover:from-amber-600 hover:to-orange-600 transition-colors shadow-md"),u(I,"class","text-sm font-medium text-gray-900 truncate"),u(y,"class","text-xs text-gray-500"),u(E,"class","flex-1"),u(r,"class","flex items-center gap-3 flex-1"),u(H,"class","p-2 hover:bg-gray-100 rounded-lg transition-colors"),u(H,"title","Download"),u(K,"class","p-2 hover:bg-gray-100 rounded-lg transition-colors"),u(K,"title","Share"),u(D,"class","flex items-center gap-1"),u(l,"class","flex items-center justify-between"),Le(i.src,V=o[25].result.url)||u(i,"src",V),u(i,"class","hidden"),u(t,"class","bg-white rounded-lg border border-gray-200 p-4 shadow-sm"),u(e,"class","bg-gradient-to-b from-gray-50 to-white p-4")},m(N,Q){W(N,e,Q),a(e,t),a(t,l),a(l,r),a(r,s),ie[n].m(s,null),a(r,$),a(r,E),a(E,I),a(I,A),a(E,k),a(E,y),a(y,w),a(y,v),a(l,P),a(l,D),a(D,H),te(B,H,null),a(D,J),a(D,K),te(b,K,null),a(t,U),a(t,i),R(),Y=!0,L||(X=[ce(s,"click",ge),ce(H,"click",re),ce(i,"ended",j)],L=!0)},p(N,Q){o=N;let oe=n;n=Ee(o),n!==oe&&(be(),S(ie[oe],1,1,()=>{ie[oe]=null}),_e(),f=ie[n],f||(f=ie[n]=ue[n](o),f.c()),x(f,1),f.m(s,null)),(!Y||Q&2)&&_!==(_=(o[25].result.title||"Generated Audio")+"")&&we(A,_),(!Y||Q&2)&&p!==(p=Je(o[25].result.duration||0)+"")&&we(v,p),(!Y||Q&2&&!Le(i.src,V=o[25].result.url))&&u(i,"src",V),(T!==o[26]||q!==o[27])&&(z(),T=o[26],q=o[27],R())},i(N){Y||(x(f),x(B.$$.fragment,N),x(b.$$.fragment,N),Y=!0)},o(N){S(f),S(B.$$.fragment,N),S(b.$$.fragment,N),Y=!1},d(N){N&&c(e),ie[n].d(),ee(B),ee(b),z(),L=!1,xe(X)}}}function It(o){let e,t;return e=new ht({props:{size:18,class:"ml-0.5"}}),{c(){se(e.$$.fragment)},l(l){le(e.$$.fragment,l)},m(l,r){te(e,l,r),t=!0},i(l){t||(x(e.$$.fragment,l),t=!0)},o(l){S(e.$$.fragment,l),t=!1},d(l){ee(e,l)}}}function Dt(o){let e,t;return e=new ft({props:{size:18}}),{c(){se(e.$$.fragment)},l(l){le(e.$$.fragment,l)},m(l,r){te(e,l,r),t=!0},i(l){t||(x(e.$$.fragment,l),t=!0)},o(l){S(e.$$.fragment,l),t=!1},d(l){ee(e,l)}}}function Ke(o,e){let t,l,r,s,n,f=e[27]+1+"",$,E,I,_,A,k,y,w,p,v=Z.highlight(e[25].code,Z.languages.python,"python")+"",P,D,H,B,J;_=new Ie({props:{size:14,class:"text-gray-600"}});function K(){return e[14](e[25])}let b=e[25].result&&e[25].result.type==="audio"&&qe(e);return{key:o,first:null,c(){t=m("div"),l=m("div"),r=m("div"),s=m("span"),n=ae("Cell "),$=ae(f),E=O(),I=m("button"),se(_.$$.fragment),A=O(),k=m("div"),y=m("pre"),w=m("code"),p=new Me(!1),P=O(),b&&b.c(),D=O(),this.h()},l(U){t=h(U,"DIV",{class:!0});var i=g(t);l=h(i,"DIV",{class:!0});var V=g(l);r=h(V,"DIV",{class:!0});var T=g(r);s=h(T,"SPAN",{class:!0});var q=g(s);n=ne(q,"Cell "),$=ne(q,f),q.forEach(c),E=M(T),I=h(T,"BUTTON",{class:!0,title:!0});var Y=g(I);le(_.$$.fragment,Y),Y.forEach(c),T.forEach(c),A=M(V),k=h(V,"DIV",{class:!0});var L=g(k);y=h(L,"PRE",{class:!0});var X=g(y);w=h(X,"CODE",{class:!0});var ue=g(w);p=He(ue,!1),ue.forEach(c),X.forEach(c),L.forEach(c),V.forEach(c),P=M(i),b&&b.l(i),D=M(i),i.forEach(c),this.h()},h(){u(s,"class","text-sm font-medium text-gray-700"),u(I,"class","p-1.5 hover:bg-gray-200 rounded transition-colors"),u(I,"title","Copy code"),u(r,"class","flex items-center justify-between px-4 py-2 bg-gray-50 border-b border-gray-100"),p.a=null,u(w,"class","language-python text-sm"),u(y,"class","p-4 overflow-x-auto bg-gray-50"),u(k,"class","relative"),u(l,"class","border-b border-gray-200"),u(t,"class","bg-white rounded-lg border border-gray-200 overflow-hidden shadow-sm"),this.first=t},m(U,i){W(U,t,i),a(t,l),a(l,r),a(r,s),a(s,n),a(s,$),a(r,E),a(r,I),te(_,I,null),a(l,A),a(l,k),a(k,y),a(y,w),p.m(v,w),a(t,P),b&&b.m(t,null),a(t,D),H=!0,B||(J=ce(I,"click",K),B=!0)},p(U,i){e=U,(!H||i&2)&&f!==(f=e[27]+1+"")&&we($,f),(!H||i&2)&&v!==(v=Z.highlight(e[25].code,Z.languages.python,"python")+"")&&p.p(v),e[25].result&&e[25].result.type==="audio"?b?(b.p(e,i),i&2&&x(b,1)):(b=qe(e),b.c(),x(b,1),b.m(t,D)):b&&(be(),S(b,1,1,()=>{b=null}),_e())},i(U){H||(x(_.$$.fragment,U),x(b),H=!0)},o(U){S(_.$$.fragment,U),S(b),H=!1},d(U){U&&c(t),ee(_),b&&b.d(),B=!1,J()}}}function Ye(o){let e,t;return{c(){e=m("div"),t=ae(o[4]),this.h()},l(l){e=h(l,"DIV",{class:!0});var r=g(e);t=ne(r,o[4]),r.forEach(c),this.h()},h(){u(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-1vrx3m3")},m(l,r){W(l,e,r),a(e,t)},p(l,r){r&16&&we(t,l[4])},d(l){l&&c(e)}}}function Tt(o){let e,t,l,r,s,n,f,$,E="Code Recorder",I,_,A,k,y,w,p,v,P,D,H,B,J,K,b,U,i,V,T=[],q=new Map,Y,L,X,ue,ie;l=new dt({props:{historyCount:o[5]}});function Ee(d,C){return d[0]==="local"?wt:kt}let ge=Ee(o),re=ge(o),R=(o[1].length>0||o[2]||o[3])&&je(o),z=o[2]&&Be(o),j=o[3]&&Fe(o),N=!o[3]&&o[1].length===0&&Ge(),Q=Re(o[1]);const oe=d=>d[25].id;for(let d=0;d<Q.length;d+=1){let C=Ue(o,Q,d),G=oe(C);q.set(G,T[d]=Ke(G,C))}let F=o[4]&&Ye(o);return{c(){e=O(),t=m("div"),se(l.$$.fragment),r=O(),s=m("div"),n=m("div"),f=m("div"),$=m("h2"),$.textContent=E,I=O(),_=m("p"),re.c(),A=O(),k=m("div"),y=m("div"),w=m("button"),p=ae("API"),P=O(),D=m("button"),H=ae("Local"),J=O(),R&&R.c(),K=O(),b=m("div"),z&&z.c(),U=O(),j&&j.c(),i=O(),N&&N.c(),V=O();for(let d=0;d<T.length;d+=1)T[d].c();Y=O(),F&&F.c(),L=Se(),this.h()},l(d){st("svelte-1s75m5n",ze.head).forEach(c),e=M(d),t=h(d,"DIV",{class:!0});var G=g(t);le(l.$$.fragment,G),r=M(G),s=h(G,"DIV",{class:!0});var me=g(s);n=h(me,"DIV",{class:!0});var fe=g(n);f=h(fe,"DIV",{});var de=g(f);$=h(de,"H2",{class:!0,"data-svelte-h":!0}),ye($)!=="svelte-8fx49i"&&($.textContent=E),I=M(de),_=h(de,"P",{class:!0});var ke=g(_);re.l(ke),ke.forEach(c),de.forEach(c),A=M(fe),k=h(fe,"DIV",{class:!0});var pe=g(k);y=h(pe,"DIV",{class:!0});var $e=g(y);w=h($e,"BUTTON",{class:!0});var Oe=g(w);p=ne(Oe,"API"),Oe.forEach(c),P=M($e),D=h($e,"BUTTON",{class:!0});var Ae=g(D);H=ne(Ae,"Local"),Ae.forEach(c),$e.forEach(c),J=M(pe),R&&R.l(pe),pe.forEach(c),fe.forEach(c),K=M(me),b=h(me,"DIV",{class:!0});var he=g(b);z&&z.l(he),U=M(he),j&&j.l(he),i=M(he),N&&N.l(he),V=M(he);for(let De=0;De<T.length;De+=1)T[De].l(he);he.forEach(c),me.forEach(c),G.forEach(c),Y=M(d),F&&F.l(d),L=Se(),this.h()},h(){ze.title="Code Recorder - HFStudio",u($,"class","text-2xl font-semibold text-gray-900"),u(_,"class","text-sm text-gray-600 mt-1"),u(w,"class",v="px-3 py-1 text-sm font-medium rounded transition-colors "+(o[0]==="api"?"bg-white shadow-sm":"text-gray-600")),u(D,"class",B="px-3 py-1 text-sm font-medium rounded transition-colors "+(o[0]==="local"?"bg-white shadow-sm":"text-gray-600")),u(y,"class","flex items-center bg-gray-100 rounded-md p-0.5"),u(k,"class","flex items-center justify-between mt-4"),u(n,"class","mb-6"),u(b,"class","space-y-6"),u(s,"class","max-w-4xl mx-auto p-8"),u(t,"class","flex-1 bg-gray-50 overflow-y-auto")},m(d,C){W(d,e,C),W(d,t,C),te(l,t,null),a(t,r),a(t,s),a(s,n),a(n,f),a(f,$),a(f,I),a(f,_),re.m(_,null),a(n,A),a(n,k),a(k,y),a(y,w),a(w,p),a(y,P),a(y,D),a(D,H),a(k,J),R&&R.m(k,null),a(s,K),a(s,b),z&&z.m(b,null),a(b,U),j&&j.m(b,null),a(b,i),N&&N.m(b,null),a(b,V);for(let G=0;G<T.length;G+=1)T[G]&&T[G].m(b,null);W(d,Y,C),F&&F.m(d,C),W(d,L,C),X=!0,ue||(ie=[ce(w,"click",o[10]),ce(D,"click",o[11])],ue=!0)},p(d,[C]){const G={};C&32&&(G.historyCount=d[5]),l.$set(G),ge!==(ge=Ee(d))&&(re.d(1),re=ge(d),re&&(re.c(),re.m(_,null))),(!X||C&1&&v!==(v="px-3 py-1 text-sm font-medium rounded transition-colors "+(d[0]==="api"?"bg-white shadow-sm":"text-gray-600")))&&u(w,"class",v),(!X||C&1&&B!==(B="px-3 py-1 text-sm font-medium rounded transition-colors "+(d[0]==="local"?"bg-white shadow-sm":"text-gray-600")))&&u(D,"class",B),d[1].length>0||d[2]||d[3]?R?(R.p(d,C),C&14&&x(R,1)):(R=je(d),R.c(),x(R,1),R.m(k,null)):R&&(be(),S(R,1,1,()=>{R=null}),_e()),d[2]?z?(z.p(d,C),C&4&&x(z,1)):(z=Be(d),z.c(),x(z,1),z.m(b,U)):z&&(be(),S(z,1,1,()=>{z=null}),_e()),d[3]?j?(j.p(d,C),C&8&&x(j,1)):(j=Fe(d),j.c(),x(j,1),j.m(b,i)):j&&(be(),S(j,1,1,()=>{j=null}),_e()),!d[3]&&d[1].length===0?N||(N=Ge(),N.c(),N.m(b,V)):N&&(N.d(1),N=null),C&642&&(Q=Re(d[1]),be(),T=ct(T,C,oe,1,d,Q,q,b,ut,Ke,null,Ue),_e()),d[4]?F?F.p(d,C):(F=Ye(d),F.c(),F.m(L.parentNode,L)):F&&(F.d(1),F=null)},i(d){if(!X){x(l.$$.fragment,d),x(R),x(z),x(j);for(let C=0;C<Q.length;C+=1)x(T[C]);X=!0}},o(d){S(l.$$.fragment,d),S(R),S(z),S(j);for(let C=0;C<T.length;C+=1)S(T[C]);X=!1},d(d){d&&(c(e),c(t),c(Y),c(L)),ee(l),re.d(),R&&R.d(),z&&z.d(),j&&j.d(),N&&N.d();for(let C=0;C<T.length;C+=1)T[C].d();F&&F.d(d),ue=!1,xe(ie)}}}let Te="Chatterbox";function Pt(o,e){const t=document.createElement("a");t.href=o,t.download=`${e||"audio"}.wav`,document.body.appendChild(t),t.click(),document.body.removeChild(t)}function Je(o){if(!o)return"0:00";const e=Math.floor(o/60),t=Math.floor(o%60);return`${e}:${t.toString().padStart(2,"0")}`}function Vt(o,e,t){let l="api",r=[],s=_(),n=k(),f=null,$=0;async function E(){try{const i=await fetch("/api/history/load",{method:"GET",credentials:"include"});if(i.ok){const V=await i.json(),T=V.entries.filter(L=>L.entry_type==="setup"),q=V.entries.filter(L=>L.entry_type==="import"),Y=V.entries.filter(L=>L.entry_type==="generation");t(2,s=_()),t(3,n=q.length>0?q[q.length-1].code:k()),t(1,r=Y.map(L=>({id:L.id,code:L.code,result:L.result_data}))),t(5,$=Y.length)}}catch(i){console.error("Error loading history from database:",i),t(1,r=[]),t(2,s=_()),t(3,n=k())}}async function I(){try{await fetch("/api/history/clear",{method:"DELETE",credentials:"include"}),t(1,r=[]),t(2,s=_()),t(3,n=k()),t(5,$=0)}catch(i){console.error("Error clearing history:",i),t(1,r=[]),t(2,s=_()),t(3,n=k()),t(5,$=0)}}function _(){return l==="local"?`pip install huggingface-hub hfstudio uv
2
+ hfstudio start ${Te.toLowerCase()} --port 7861`:"pip install huggingface-hub"}function A(){return l==="local"?'client = InferenceClient(base_url="http://localhost:7861/api/v1")':`client = InferenceClient(
3
+ api_key="YOUR_HF_TOKEN", # Get your token from https://huggingface.co/settings/tokens
4
+ model="${Te.toLowerCase()==="chatterbox"?"ResembleAI/chatterbox":Te.toLowerCase()}",
5
+ )`}function k(){const i=A();return l==="local"?`from huggingface_hub import InferenceClient
6
+
7
+ ${i}`:`from huggingface_hub import InferenceClient
8
+
9
+ ${i}`}function y(i,V="Copied to clipboard!"){navigator.clipboard.writeText(i).then(()=>{t(4,f=V),setTimeout(()=>{t(4,f=null)},2e3)})}function w(){const i=[];if(s){const q=s.includes("pip install")||s.includes("hfstudio start")?"bash":"";i.push(`## Setup (Run in Terminal)
10
+
11
+ \`\`\`${q}
12
+ ${s}
13
+ \`\`\``)}n&&i.push(`## Imports (Python)
14
+
15
+ \`\`\`python
16
+ ${n}
17
+ \`\`\``),r.forEach((T,q)=>{i.push(`## Cell ${q+1}
18
+
19
+ \`\`\`python
20
+ ${T.code}
21
+ \`\`\``)});const V=i.join(`
22
+
23
+ `);y(V,"All code copied as Markdown!")}function p(i){i.audioElement||(i.audioElement=new Audio(i.result.url),i.audioElement.addEventListener("ended",()=>{i.isPlaying=!1,t(1,r=[...r])})),i.isPlaying?(i.audioElement.pause(),i.isPlaying=!1):(r.forEach(V=>{V!==i&&V.isPlaying&&V.audioElement&&(V.audioElement.pause(),V.isPlaying=!1)}),i.audioElement.play(),i.isPlaying=!0),t(1,r=[...r])}rt(async()=>{await E()});const v=()=>t(0,l="api"),P=()=>t(0,l="local"),D=()=>y(s),H=()=>y(n),B=i=>y(i.code),J=i=>p(i),K=i=>Pt(i.result.url,i.result.title);function b(i,V,T){nt[i?"unshift":"push"](()=>{V[T].audioElement=i,t(1,r)})}const U=(i,V,T)=>t(1,V[T].isPlaying=!1,r);return o.$$.update=()=>{o.$$.dirty&1&&l&&(t(2,s=_()),t(3,n=k()))},[l,r,s,n,f,$,I,y,w,p,v,P,D,H,B,J,K,b,U]}class St extends Pe{constructor(e){super(),Ve(this,e,Vt,Tt,Ne,{})}}export{St as component};
hfstudio/static/_app/immutable/nodes/4.Cz7uudur.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{S as dt,i as _t,s as ht,u as Je,v as _e,w as C,x as D,y as he,z as pe,A as me,B as nt,C as Bt,D as Ht,E as qt,F as Ot,d as u,H as ct,a as Ce,K as Ve,p as d,b as G,c,m as $e,L as Xt,h as V,e as h,f as b,r as we,g as q,M as Ke,k as x,j as p,t as O,G as Zt,Q as le,n as Be,J as Ft,N as xe}from"../chunks/TRxHAhOH.js";import{I as Yt,g as Gt,a as Jt,e as at}from"../chunks/BhRpzVYR.js";import"../chunks/IHki7fMi.js";import{S as er,L as pt,A as tr,X as rr}from"../chunks/BNlacN_j.js";import{M as Kt}from"../chunks/nn-QVLrM.js";import{a as Qt,P as Wt}from"../chunks/gtFtmmyB.js";function lr(s){let e;const t=s[2].default,r=Bt(t,s,s[3],null);return{c(){r&&r.c()},l(l){r&&r.l(l)},m(l,o){r&&r.m(l,o),e=!0},p(l,o){r&&r.p&&(!e||o&8)&&Ht(r,t,l,l[3],e?Ot(t,l[3],o,null):qt(l[3]),null)},i(l){e||(D(r,l),e=!0)},o(l){C(r,l),e=!1},d(l){r&&r.d(l)}}}function sr(s){let e,t;const r=[{name:"square"},s[1],{iconNode:s[0]}];let l={$$slots:{default:[lr]},$$scope:{ctx:s}};for(let o=0;o<r.length;o+=1)l=Je(l,r[o]);return e=new Yt({props:l}),{c(){me(e.$$.fragment)},l(o){pe(e.$$.fragment,o)},m(o,n){he(e,o,n),t=!0},p(o,[n]){const i=n&3?Gt(r,[r[0],n&2&&Jt(o[1]),n&1&&{iconNode:o[0]}]):{};n&8&&(i.$$scope={dirty:n,ctx:o}),e.$set(i)},i(o){t||(D(e.$$.fragment,o),t=!0)},o(o){C(e.$$.fragment,o),t=!1},d(o){_e(e,o)}}}function or(s,e,t){let{$$slots:r={},$$scope:l}=e;const o=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}]];return s.$$set=n=>{t(1,e=Je(Je({},e),nt(n))),"$$scope"in n&&t(3,l=n.$$scope)},e=nt(e),[o,e,r,l]}class nr extends dt{constructor(e){super(),_t(this,e,or,sr,ht,{})}}function ar(s){let e;const t=s[2].default,r=Bt(t,s,s[3],null);return{c(){r&&r.c()},l(l){r&&r.l(l)},m(l,o){r&&r.m(l,o),e=!0},p(l,o){r&&r.p&&(!e||o&8)&&Ht(r,t,l,l[3],e?Ot(t,l[3],o,null):qt(l[3]),null)},i(l){e||(D(r,l),e=!0)},o(l){C(r,l),e=!1},d(l){r&&r.d(l)}}}function ir(s){let e,t;const r=[{name:"trash-2"},s[1],{iconNode:s[0]}];let l={$$slots:{default:[ar]},$$scope:{ctx:s}};for(let o=0;o<r.length;o+=1)l=Je(l,r[o]);return e=new Yt({props:l}),{c(){me(e.$$.fragment)},l(o){pe(e.$$.fragment,o)},m(o,n){he(e,o,n),t=!0},p(o,[n]){const i=n&3?Gt(r,[r[0],n&2&&Jt(o[1]),n&1&&{iconNode:o[0]}]):{};n&8&&(i.$$scope={dirty:n,ctx:o}),e.$set(i)},i(o){t||(D(e.$$.fragment,o),t=!0)},o(o){C(e.$$.fragment,o),t=!1},d(o){_e(e,o)}}}function cr(s,e,t){let{$$slots:r={},$$scope:l}=e;const o=[["path",{d:"M3 6h18"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17"}]];return s.$$set=n=>{t(1,e=Je(Je({},e),nt(n))),"$$scope"in n&&t(3,l=n.$$scope)},e=nt(e),[o,e,r,l]}class ur extends dt{constructor(e){super(),_t(this,e,cr,ir,ht,{})}}function St(s,e,t){const r=s.slice();return r[47]=e[t],r}function Pt(s,e,t){const r=s.slice();return r[50]=e[t],r[52]=t,r}function Lt(s){let e,t,r,l,o,n;return{c(){e=p("div"),t=p("div"),r=x(),l=p("div"),o=x(),n=p("div"),this.h()},l(i){e=h(i,"DIV",{class:!0});var a=b(e);t=h(a,"DIV",{class:!0,style:!0}),b(t).forEach(u),r=V(a),l=h(a,"DIV",{class:!0,style:!0}),b(l).forEach(u),o=V(a),n=h(a,"DIV",{class:!0,style:!0}),b(n).forEach(u),a.forEach(u),this.h()},h(){d(t,"class","absolute rounded-full border-2 border-orange-300 transition-all duration-75"),le(t,"width",120+s[7]*120+"px"),le(t,"height",120+s[7]*120+"px"),le(t,"opacity",.4+s[7]*.6),d(l,"class","absolute rounded-full border-2 border-orange-200 transition-all duration-100"),le(l,"width",150+s[7]*150+"px"),le(l,"height",150+s[7]*150+"px"),le(l,"opacity",.3+s[7]*.5),d(n,"class","absolute rounded-full border-1 border-orange-100 transition-all duration-125"),le(n,"width",180+s[7]*180+"px"),le(n,"height",180+s[7]*180+"px"),le(n,"opacity",.2+s[7]*.4),d(e,"class","absolute inset-0 flex items-center justify-center")},m(i,a){G(i,e,a),c(e,t),c(e,r),c(e,l),c(e,o),c(e,n)},p(i,a){a[0]&128&&le(t,"width",120+i[7]*120+"px"),a[0]&128&&le(t,"height",120+i[7]*120+"px"),a[0]&128&&le(t,"opacity",.4+i[7]*.6),a[0]&128&&le(l,"width",150+i[7]*150+"px"),a[0]&128&&le(l,"height",150+i[7]*150+"px"),a[0]&128&&le(l,"opacity",.3+i[7]*.5),a[0]&128&&le(n,"width",180+i[7]*180+"px"),a[0]&128&&le(n,"height",180+i[7]*180+"px"),a[0]&128&&le(n,"opacity",.2+i[7]*.4)},d(i){i&&u(e)}}}function fr(s){let e,t;return e=new Kt({props:{size:36,class:"text-white"}}),{c(){me(e.$$.fragment)},l(r){pe(e.$$.fragment,r)},m(r,l){he(e,r,l),t=!0},p:Be,i(r){t||(D(e.$$.fragment,r),t=!0)},o(r){C(e.$$.fragment,r),t=!1},d(r){_e(e,r)}}}function dr(s){let e,t,r,l;return r=new nr({props:{size:36,class:(s[6]>=100?"text-white":"text-orange-700")+" relative z-10"}}),{c(){e=p("div"),t=x(),me(r.$$.fragment),this.h()},l(o){e=h(o,"DIV",{class:!0,style:!0}),b(e).forEach(u),t=V(o),pe(r.$$.fragment,o),this.h()},h(){d(e,"class","absolute bottom-0 left-0 right-0 bg-orange-500 transition-all duration-100 ease-linear rounded-full"),le(e,"height",s[6]+"%")},m(o,n){G(o,e,n),G(o,t,n),he(r,o,n),l=!0},p(o,n){(!l||n[0]&64)&&le(e,"height",o[6]+"%");const i={};n[0]&64&&(i.class=(o[6]>=100?"text-white":"text-orange-700")+" relative z-10"),r.$set(i)},i(o){l||(D(r.$$.fragment,o),l=!0)},o(o){C(r.$$.fragment,o),l=!1},d(o){o&&(u(e),u(t)),_e(r,o)}}}function Mt(s){let e,t,r='<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>',l,o,n='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>',i,a,g=`Sign in to with your Hugging Face <a href="https://huggingface.co/pro" target="_blank" class="text-amber-600 hover:text-amber-700 underline font-medium">PRO account</a> to get started with $2 of free API credits per month. You can add a billing method for
2
+ additional pay-as-you-go usage ‴`,_,v;return{c(){e=p("div"),t=p("button"),t.innerHTML=r,l=x(),o=p("p"),o.innerHTML=n,i=x(),a=p("p"),a.innerHTML=g,this.h()},l(m){e=h(m,"DIV",{class:!0});var k=b(e);t=h(k,"BUTTON",{class:!0,"aria-label":!0,"data-svelte-h":!0}),we(t)!=="svelte-9gdgq5"&&(t.innerHTML=r),l=V(k),o=h(k,"P",{class:!0,"data-svelte-h":!0}),we(o)!=="svelte-1q58z3k"&&(o.innerHTML=n),i=V(k),a=h(k,"P",{class:!0,"data-svelte-h":!0}),we(a)!=="svelte-dysk74"&&(a.innerHTML=g),k.forEach(u),this.h()},h(){d(t,"class","absolute top-2 right-2 text-gray-400 hover:text-gray-600 transition-colors"),d(t,"aria-label","Dismiss"),d(o,"class","text-sm font-medium text-gray-700 mb-1 pr-4"),d(a,"class","text-sm text-gray-600 pr-4"),d(e,"class","mb-3 px-3 py-2 bg-gradient-to-r from-amber-50 to-orange-50 rounded-lg border border-amber-200 relative")},m(m,k){G(m,e,k),c(e,t),c(e,l),c(e,o),c(e,i),c(e,a),_||(v=$e(t,"click",s[29]),_=!0)},p:Be,d(m){m&&u(e),_=!1,v()}}}function _r(s){let e,t,r=at(s[1]),l=[];for(let n=0;n<r.length;n+=1)l[n]=Nt(Pt(s,r,n));const o=n=>C(l[n],1,1,()=>{l[n]=null});return{c(){e=p("div");for(let n=0;n<l.length;n+=1)l[n].c();this.h()},l(n){e=h(n,"DIV",{class:!0});var i=b(e);for(let a=0;a<l.length;a+=1)l[a].l(i);i.forEach(u),this.h()},h(){d(e,"class","space-y-2")},m(n,i){G(n,e,i);for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(e,null);t=!0},p(n,i){if(i[0]&100664070){r=at(n[1]);let a;for(a=0;a<r.length;a+=1){const g=Pt(n,r,a);l[a]?(l[a].p(g,i),D(l[a],1)):(l[a]=Nt(g),l[a].c(),D(l[a],1),l[a].m(e,null))}for(xe(),a=r.length;a<l.length;a+=1)o(a);Ve()}},i(n){if(!t){for(let i=0;i<r.length;i+=1)D(l[i]);t=!0}},o(n){l=l.filter(Boolean);for(let i=0;i<l.length;i+=1)C(l[i]);t=!1},d(n){n&&u(e),Ft(l,n)}}}function hr(s){let e,t,r,l,o="Pick a recording to clone",n,i,a="No recordings yet",g;return t=new Kt({props:{size:32,class:"mx-auto mb-2 opacity-30"}}),{c(){e=p("div"),me(t.$$.fragment),r=x(),l=p("p"),l.textContent=o,n=x(),i=p("p"),i.textContent=a,this.h()},l(_){e=h(_,"DIV",{class:!0});var v=b(e);pe(t.$$.fragment,v),r=V(v),l=h(v,"P",{class:!0,"data-svelte-h":!0}),we(l)!=="svelte-faot34"&&(l.textContent=o),n=V(v),i=h(v,"P",{class:!0,"data-svelte-h":!0}),we(i)!=="svelte-kwlxsz"&&(i.textContent=a),v.forEach(u),this.h()},h(){d(l,"class","text-sm"),d(i,"class","text-xs text-gray-400"),d(e,"class","text-center py-8 text-gray-500")},m(_,v){G(_,e,v),he(t,e,null),c(e,r),c(e,l),c(e,n),c(e,i),g=!0},p:Be,i(_){g||(D(t.$$.fragment,_),g=!0)},o(_){C(t.$$.fragment,_),g=!1},d(_){_&&u(e),_e(t)}}}function pr(s){let e,t;return e=new Wt({props:{size:14,class:"text-gray-600"}}),{c(){me(e.$$.fragment)},l(r){pe(e.$$.fragment,r)},m(r,l){he(e,r,l),t=!0},i(r){t||(D(e.$$.fragment,r),t=!0)},o(r){C(e.$$.fragment,r),t=!1},d(r){_e(e,r)}}}function mr(s){let e,t;return e=new Qt({props:{size:14,class:"text-gray-600"}}),{c(){me(e.$$.fragment)},l(r){pe(e.$$.fragment,r)},m(r,l){he(e,r,l),t=!0},i(r){t||(D(e.$$.fragment,r),t=!0)},o(r){C(e.$$.fragment,r),t=!1},d(r){_e(e,r)}}}function Nt(s){var ie;let e,t,r,l,o=s[52]+1+"",n,i,a,g,_,v,m,k=s[50].timestamp.toLocaleTimeString()+"",L,F,T,X=((ie=s[2])==null?void 0:ie.id)===s[50].id?"Selected":"Select for cloning",R,S,K,J,z,W,U;const A=[mr,pr],E=[];function H(j,w){var $;return(($=j[8])==null?void 0:$.id)===j[50].id&&j[9]&&!j[9].paused?0:1}g=H(s),_=E[g]=A[g](s);function Q(){return s[30](s[50])}function Y(){return s[31](s[50])}return{c(){e=p("div"),t=p("div"),r=p("span"),l=O("Recording "),n=O(o),i=x(),a=p("button"),_.c(),v=x(),m=p("div"),L=O(k),F=x(),T=p("button"),R=O(X),K=x(),this.h()},l(j){e=h(j,"DIV",{class:!0});var w=b(e);t=h(w,"DIV",{class:!0});var $=b(t);r=h($,"SPAN",{class:!0});var oe=b(r);l=q(oe,"Recording "),n=q(oe,o),oe.forEach(u),i=V($),a=h($,"BUTTON",{class:!0});var P=b(a);_.l(P),P.forEach(u),$.forEach(u),v=V(w),m=h(w,"DIV",{class:!0});var I=b(m);L=q(I,k),I.forEach(u),F=V(w),T=h(w,"BUTTON",{class:!0});var M=b(T);R=q(M,X),M.forEach(u),K=V(w),w.forEach(u),this.h()},h(){var j,w;d(r,"class","text-sm font-medium text-gray-900"),d(a,"class","p-1 hover:bg-gray-100 rounded transition-colors"),d(t,"class","flex items-center justify-between mb-2"),d(m,"class","text-xs text-gray-500 mb-2"),d(T,"class",S="w-full text-xs px-2 py-1 rounded "+(((j=s[2])==null?void 0:j.id)===s[50].id?"bg-amber-200 text-amber-800":"bg-gray-100 text-gray-700 hover:bg-gray-200")+" transition-colors"),d(e,"class",J="border rounded-lg p-3 "+(((w=s[2])==null?void 0:w.id)===s[50].id?"border-amber-300 bg-amber-50":"border-gray-200 hover:border-gray-300")+" transition-colors")},m(j,w){G(j,e,w),c(e,t),c(t,r),c(r,l),c(r,n),c(t,i),c(t,a),E[g].m(a,null),c(e,v),c(e,m),c(m,L),c(e,F),c(e,T),c(T,R),c(e,K),z=!0,W||(U=[$e(a,"click",Q),$e(T,"click",Y)],W=!0)},p(j,w){var oe,P,I;s=j;let $=g;g=H(s),g!==$&&(xe(),C(E[$],1,1,()=>{E[$]=null}),Ve(),_=E[g],_||(_=E[g]=A[g](s),_.c()),D(_,1),_.m(a,null)),(!z||w[0]&2)&&k!==(k=s[50].timestamp.toLocaleTimeString()+"")&&Ce(L,k),(!z||w[0]&6)&&X!==(X=((oe=s[2])==null?void 0:oe.id)===s[50].id?"Selected":"Select for cloning")&&Ce(R,X),(!z||w[0]&6&&S!==(S="w-full text-xs px-2 py-1 rounded "+(((P=s[2])==null?void 0:P.id)===s[50].id?"bg-amber-200 text-amber-800":"bg-gray-100 text-gray-700 hover:bg-gray-200")+" transition-colors"))&&d(T,"class",S),(!z||w[0]&6&&J!==(J="border rounded-lg p-3 "+(((I=s[2])==null?void 0:I.id)===s[50].id?"border-amber-300 bg-amber-50":"border-gray-200 hover:border-gray-300")+" transition-colors"))&&d(e,"class",J)},i(j){z||(D(_),z=!0)},o(j){C(_),z=!1},d(j){j&&u(e),E[g].d(),W=!1,ct(U)}}}function gr(s){let e;return{c(){e=O("Clone")},l(t){e=q(t,"Clone")},m(t,r){G(t,e,r)},i:Be,o:Be,d(t){t&&u(e)}}}function br(s){let e,t,r;return e=new pt({props:{size:16,class:"animate-spin"}}),{c(){me(e.$$.fragment),t=O(`
3
+ Uploading...`)},l(l){pe(e.$$.fragment,l),t=q(l,`
4
+ Uploading...`)},m(l,o){he(e,l,o),G(l,t,o),r=!0},i(l){r||(D(e.$$.fragment,l),r=!0)},o(l){C(e.$$.fragment,l),r=!1},d(l){l&&u(t),_e(e,l)}}}function vr(s){let e,t,r;return e=new pt({props:{size:16,class:"animate-spin"}}),{c(){me(e.$$.fragment),t=O(`
5
+ Transcribing...`)},l(l){pe(e.$$.fragment,l),t=q(l,`
6
+ Transcribing...`)},m(l,o){he(e,l,o),G(l,t,o),r=!0},i(l){r||(D(e.$$.fragment,l),r=!0)},o(l){C(e.$$.fragment,l),r=!1},d(l){l&&u(t),_e(e,l)}}}function yr(s){let e;return{c(){e=O("βœ“")},l(t){e=q(t,"βœ“")},m(t,r){G(t,e,r)},p:Be,d(t){t&&u(e)}}}function kr(s){let e,t;function r(n,i){return i[0]&4&&(e=null),e==null&&(e=!!it(n[2])),e?Er:wr}let l=r(s,[-1,-1]),o=l(s);return{c(){o.c(),t=Ke()},l(n){o.l(n),t=Ke()},m(n,i){o.m(n,i),G(n,t,i)},p(n,i){l!==(l=r(n,i))&&(o.d(1),o=l(n),o&&(o.c(),o.m(t.parentNode,t)))},d(n){n&&u(t),o.d(n)}}}function wr(s){let e;return{c(){e=O("βœ—")},l(t){e=q(t,"βœ—")},m(t,r){G(t,e,r)},d(t){t&&u(e)}}}function Er(s){let e;return{c(){e=O("βœ“")},l(t){e=q(t,"βœ“")},m(t,r){G(t,e,r)},d(t){t&&u(e)}}}function Dr(s){let e;return{c(){e=O("βœ“")},l(t){e=q(t,"βœ“")},m(t,r){G(t,e,r)},p:Be,d(t){t&&u(e)}}}function Tr(s){let e,t;function r(n,i){return i[0]&4&&(e=null),e==null&&(e=!!n[21](n[2])),e?Vr:Ir}let l=r(s,[-1,-1]),o=l(s);return{c(){o.c(),t=Ke()},l(n){o.l(n),t=Ke()},m(n,i){o.m(n,i),G(n,t,i)},p(n,i){l!==(l=r(n,i))&&(o.d(1),o=l(n),o&&(o.c(),o.m(t.parentNode,t)))},d(n){n&&u(t),o.d(n)}}}function Ir(s){let e;return{c(){e=O("βœ—")},l(t){e=q(t,"βœ—")},m(t,r){G(t,e,r)},d(t){t&&u(e)}}}function Vr(s){let e;return{c(){e=O("βœ“")},l(t){e=q(t,"βœ“")},m(t,r){G(t,e,r)},d(t){t&&u(e)}}}function Rt(s){let e,t,r,l=s[10][s[2].id].first_words+"",o,n;return{c(){e=p("div"),t=p("p"),r=O('"'),o=O(l),n=O('..."'),this.h()},l(i){e=h(i,"DIV",{class:!0});var a=b(e);t=h(a,"P",{class:!0});var g=b(t);r=q(g,'"'),o=q(g,l),n=q(g,'..."'),g.forEach(u),a.forEach(u),this.h()},h(){d(t,"class","text-sm text-gray-600 italic"),d(e,"class","mt-3 p-3 bg-gray-50 rounded-lg border")},m(i,a){G(i,e,a),c(e,t),c(t,r),c(t,o),c(t,n)},p(i,a){a[0]&1028&&l!==(l=i[10][i[2].id].first_words+"")&&Ce(o,l)},d(i){i&&u(e)}}}function xr(s){let e,t,r;return{c(){e=p("div"),t=p("p"),r=O(s[14]),this.h()},l(l){e=h(l,"DIV",{class:!0});var o=b(e);t=h(o,"P",{class:!0});var n=b(t);r=q(n,s[14]),n.forEach(u),o.forEach(u),this.h()},h(){d(t,"class","text-sm text-green-700"),d(e,"class","mt-3 p-3 bg-green-50 rounded-lg border border-green-200")},m(l,o){G(l,e,o),c(e,t),c(t,r)},p(l,o){o[0]&16384&&Ce(r,l[14])},d(l){l&&u(e)}}}function Cr(s){let e,t,r,l,o,n,i;return{c(){e=p("div"),t=p("p"),r=O("Your voice has been saved to a "),l=p("a"),o=O("temporary URL"),i=O(` for 24 hours and will be automatically deleted. You can now use it for text-to-speech
7
+ generation.`),this.h()},l(a){e=h(a,"DIV",{class:!0});var g=b(e);t=h(g,"P",{class:!0});var _=b(t);r=q(_,"Your voice has been saved to a "),l=h(_,"A",{href:!0,target:!0,class:!0});var v=b(l);o=q(v,"temporary URL"),v.forEach(u),i=q(_,` for 24 hours and will be automatically deleted. You can now use it for text-to-speech
8
+ generation.`),_.forEach(u),g.forEach(u),this.h()},h(){d(l,"href",n=s[13][s[2].id].voice_url),d(l,"target","_blank"),d(l,"class","text-green-800 underline hover:text-green-900"),d(t,"class","text-sm text-green-700"),d(e,"class","mt-3 p-3 bg-green-50 rounded-lg border border-green-200")},m(a,g){G(a,e,g),c(e,t),c(t,r),c(t,l),c(l,o),c(t,i)},p(a,g){g[0]&8196&&n!==(n=a[13][a[2].id].voice_url)&&d(l,"href",n)},d(a){a&&u(e)}}}function zt(s){let e,t,r="Your existing voice clone",l,o,n,i=at(s[15]),a=[];for(let _=0;_<i.length;_+=1)a[_]=Ut(St(s,i,_));const g=_=>C(a[_],1,1,()=>{a[_]=null});return{c(){e=p("div"),t=p("h3"),t.textContent=r,l=x(),o=p("div");for(let _=0;_<a.length;_+=1)a[_].c();this.h()},l(_){e=h(_,"DIV",{class:!0});var v=b(e);t=h(v,"H3",{class:!0,"data-svelte-h":!0}),we(t)!=="svelte-5uh5wl"&&(t.textContent=r),l=V(v),o=h(v,"DIV",{class:!0});var m=b(o);for(let k=0;k<a.length;k+=1)a[k].l(m);m.forEach(u),v.forEach(u),this.h()},h(){d(t,"class","text-sm font-medium text-gray-700 mb-3"),d(o,"class","space-y-2"),d(e,"class","mt-6 pt-4 border-t border-gray-200")},m(_,v){G(_,e,v),c(e,t),c(e,l),c(e,o);for(let m=0;m<a.length;m+=1)a[m]&&a[m].m(o,null);n=!0},p(_,v){if(v[0]&335643392){i=at(_[15]);let m;for(m=0;m<i.length;m+=1){const k=St(_,i,m);a[m]?(a[m].p(k,v),D(a[m],1)):(a[m]=Ut(k),a[m].c(),D(a[m],1),a[m].m(o,null))}for(xe(),m=i.length;m<a.length;m+=1)g(m);Ve()}},i(_){if(!n){for(let v=0;v<i.length;v+=1)D(a[v]);n=!0}},o(_){a=a.filter(Boolean);for(let v=0;v<a.length;v+=1)C(a[v]);n=!1},d(_){_&&u(e),Ft(a,_)}}}function $r(s){let e,t;return e=new Wt({props:{size:14,class:"text-blue-600"}}),{c(){me(e.$$.fragment)},l(r){pe(e.$$.fragment,r)},m(r,l){he(e,r,l),t=!0},i(r){t||(D(e.$$.fragment,r),t=!0)},o(r){C(e.$$.fragment,r),t=!1},d(r){_e(e,r)}}}function Sr(s){let e,t;return e=new Qt({props:{size:14,class:"text-blue-600"}}),{c(){me(e.$$.fragment)},l(r){pe(e.$$.fragment,r)},m(r,l){he(e,r,l),t=!0},i(r){t||(D(e.$$.fragment,r),t=!0)},o(r){C(e.$$.fragment,r),t=!1},d(r){_e(e,r)}}}function Pr(s){let e,t;return e=new ur({props:{size:14}}),{c(){me(e.$$.fragment)},l(r){pe(e.$$.fragment,r)},m(r,l){he(e,r,l),t=!0},i(r){t||(D(e.$$.fragment,r),t=!0)},o(r){C(e.$$.fragment,r),t=!1},d(r){_e(e,r)}}}function Lr(s){let e,t;return e=new pt({props:{size:14,class:"animate-spin"}}),{c(){me(e.$$.fragment)},l(r){pe(e.$$.fragment,r)},m(r,l){he(e,r,l),t=!0},i(r){t||(D(e.$$.fragment,r),t=!0)},o(r){C(e.$$.fragment,r),t=!1},d(r){_e(e,r)}}}function Ut(s){let e,t,r,l=s[47].voice_name+"",o,n,i,a,g,_,v,m,k,L,F,T,X,R=new Date(s[47].expires_at).toLocaleDateString()+"",S,K,J=new Date(s[47].expires_at).toLocaleTimeString()+"",z,W,U,A,E;const H=[Sr,$r],Q=[];function Y(P,I){var M;return((M=P[8])==null?void 0:M.id)===P[47].id&&P[9]&&!P[9].paused?0:1}g=Y(s),_=Q[g]=H[g](s);function ie(){return s[32](s[47])}const j=[Lr,Pr],w=[];function $(P,I){return P[16]?0:1}k=$(s),L=w[k]=j[k](s);function oe(){return s[33](s[47])}return{c(){e=p("div"),t=p("div"),r=p("span"),o=O(l),n=x(),i=p("div"),a=p("button"),_.c(),v=x(),m=p("button"),L.c(),F=x(),T=p("div"),X=O("Expires: "),S=O(R),K=O(" at "),z=O(J),W=x(),this.h()},l(P){e=h(P,"DIV",{class:!0});var I=b(e);t=h(I,"DIV",{class:!0});var M=b(t);r=h(M,"SPAN",{class:!0});var ke=b(r);o=q(ke,l),ke.forEach(u),n=V(M),i=h(M,"DIV",{class:!0});var Z=b(i);a=h(Z,"BUTTON",{class:!0,title:!0});var ae=b(a);_.l(ae),ae.forEach(u),v=V(Z),m=h(Z,"BUTTON",{class:!0,title:!0});var ce=b(m);L.l(ce),ce.forEach(u),Z.forEach(u),M.forEach(u),F=V(I),T=h(I,"DIV",{class:!0});var se=b(T);X=q(se,"Expires: "),S=q(se,R),K=q(se," at "),z=q(se,J),se.forEach(u),W=V(I),I.forEach(u),this.h()},h(){d(r,"class","text-sm font-medium text-blue-900"),d(a,"class","p-1 hover:bg-blue-100 rounded transition-colors"),d(a,"title","Play voice sample"),m.disabled=s[16],d(m,"class","p-1 text-red-600 hover:text-red-800 hover:bg-red-100 rounded transition-colors disabled:opacity-50"),d(m,"title","Delete voice"),d(i,"class","flex items-center gap-2"),d(t,"class","flex items-center justify-between mb-2"),d(T,"class","text-xs text-blue-600"),d(e,"class","border rounded-lg p-3 bg-blue-50 border-blue-200")},m(P,I){G(P,e,I),c(e,t),c(t,r),c(r,o),c(t,n),c(t,i),c(i,a),Q[g].m(a,null),c(i,v),c(i,m),w[k].m(m,null),c(e,F),c(e,T),c(T,X),c(T,S),c(T,K),c(T,z),c(e,W),U=!0,A||(E=[$e(a,"click",ie),$e(m,"click",oe)],A=!0)},p(P,I){s=P,(!U||I[0]&32768)&&l!==(l=s[47].voice_name+"")&&Ce(o,l);let M=g;g=Y(s),g!==M&&(xe(),C(Q[M],1,1,()=>{Q[M]=null}),Ve(),_=Q[g],_||(_=Q[g]=H[g](s),_.c()),D(_,1),_.m(a,null));let ke=k;k=$(s),k!==ke&&(xe(),C(w[ke],1,1,()=>{w[ke]=null}),Ve(),L=w[k],L||(L=w[k]=j[k](s),L.c()),D(L,1),L.m(m,null)),(!U||I[0]&65536)&&(m.disabled=s[16]),(!U||I[0]&32768)&&R!==(R=new Date(s[47].expires_at).toLocaleDateString()+"")&&Ce(S,R),(!U||I[0]&32768)&&J!==(J=new Date(s[47].expires_at).toLocaleTimeString()+"")&&Ce(z,J)},i(P){U||(D(_),D(L),U=!0)},o(P){C(_),C(L),U=!1},d(P){P&&u(e),Q[g].d(),w[k].d(),A=!1,ct(E)}}}function At(s){let e,t,r,l,o,n,i,a,g,_,v,m,k="An error occurred while processing your request",L,F,T,X,R,S,K,J,z="Close",W,U,A;n=new tr({props:{size:20,class:"text-red-600"}}),T=new rr({props:{size:20,class:"text-gray-500"}});let E=s[5]&&jt(s);return{c(){e=p("div"),t=p("div"),r=p("div"),l=p("div"),o=p("div"),me(n.$$.fragment),i=x(),a=p("div"),g=p("h3"),_=O(s[4]),v=x(),m=p("p"),m.textContent=k,L=x(),F=p("button"),me(T.$$.fragment),X=x(),R=p("div"),E&&E.c(),S=x(),K=p("div"),J=p("button"),J.textContent=z,this.h()},l(H){e=h(H,"DIV",{class:!0});var Q=b(e);t=h(Q,"DIV",{class:!0});var Y=b(t);r=h(Y,"DIV",{class:!0});var ie=b(r);l=h(ie,"DIV",{class:!0});var j=b(l);o=h(j,"DIV",{class:!0});var w=b(o);pe(n.$$.fragment,w),w.forEach(u),i=V(j),a=h(j,"DIV",{class:!0});var $=b(a);g=h($,"H3",{class:!0});var oe=b(g);_=q(oe,s[4]),oe.forEach(u),v=V($),m=h($,"P",{class:!0,"data-svelte-h":!0}),we(m)!=="svelte-1l3zl3"&&(m.textContent=k),$.forEach(u),j.forEach(u),L=V(ie),F=h(ie,"BUTTON",{class:!0,title:!0});var P=b(F);pe(T.$$.fragment,P),P.forEach(u),ie.forEach(u),X=V(Y),R=h(Y,"DIV",{class:!0});var I=b(R);E&&E.l(I),I.forEach(u),S=V(Y),K=h(Y,"DIV",{class:!0});var M=b(K);J=h(M,"BUTTON",{class:!0,"data-svelte-h":!0}),we(J)!=="svelte-4sxk6g"&&(J.textContent=z),M.forEach(u),Y.forEach(u),Q.forEach(u),this.h()},h(){d(o,"class","w-10 h-10 bg-red-100 rounded-full flex items-center justify-center flex-shrink-0"),d(g,"class","text-lg font-semibold text-gray-900 truncate"),d(m,"class","text-sm text-gray-600"),d(a,"class","min-w-0"),d(l,"class","flex items-center gap-3 min-w-0"),d(F,"class","p-2 hover:bg-red-100 rounded-full transition-colors flex-shrink-0"),d(F,"title","Close"),d(r,"class","flex items-center justify-between p-6 border-b border-gray-200 bg-red-50 flex-shrink-0"),d(R,"class","p-6 overflow-y-auto flex-1 min-h-0"),d(J,"class","px-6 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors"),d(K,"class","flex items-center justify-end gap-3 p-6 border-t border-gray-200 bg-gray-50 flex-shrink-0"),d(t,"class","bg-white rounded-xl shadow-2xl max-w-2xl w-full max-h-[80vh] flex flex-col"),d(e,"class","fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4")},m(H,Q){G(H,e,Q),c(e,t),c(t,r),c(r,l),c(l,o),he(n,o,null),c(l,i),c(l,a),c(a,g),c(g,_),c(a,v),c(a,m),c(r,L),c(r,F),he(T,F,null),c(t,X),c(t,R),E&&E.m(R,null),c(t,S),c(t,K),c(K,J),W=!0,U||(A=[$e(F,"click",s[22]),$e(J,"click",s[22])],U=!0)},p(H,Q){(!W||Q[0]&16)&&Ce(_,H[4]),H[5]?E?E.p(H,Q):(E=jt(H),E.c(),E.m(R,null)):E&&(E.d(1),E=null)},i(H){W||(D(n.$$.fragment,H),D(T.$$.fragment,H),W=!0)},o(H){C(n.$$.fragment,H),C(T.$$.fragment,H),W=!1},d(H){H&&u(e),_e(n),_e(T),E&&E.d(),U=!1,ct(A)}}}function jt(s){let e,t,r="Error Details:",l,o,n;return{c(){e=p("div"),t=p("h4"),t.textContent=r,l=x(),o=p("pre"),n=O(s[5]),this.h()},l(i){e=h(i,"DIV",{class:!0});var a=b(e);t=h(a,"H4",{class:!0,"data-svelte-h":!0}),we(t)!=="svelte-3lmggt"&&(t.textContent=r),l=V(a),o=h(a,"PRE",{class:!0});var g=b(o);n=q(g,s[5]),g.forEach(u),a.forEach(u),this.h()},h(){d(t,"class","text-sm font-medium text-gray-900 mb-2"),d(o,"class","text-xs text-gray-700 whitespace-pre-wrap font-mono leading-relaxed break-words"),d(e,"class","bg-gray-50 rounded-lg p-4 border")},m(i,a){G(i,e,a),c(e,t),c(e,l),c(e,o),c(o,n)},p(i,a){a[0]&32&&Ce(n,i[5])},d(i){i&&u(e)}}}function Mr(s){let e,t,r,l,o,n,i,a,g="Sample script to read",_,v,m,k,L,F,T,X="I consent to cloning my voice.",R,S=s[20][s[17]]+"",K,J,z,W,U,A,E,H,Q,Y,ie=`<p class="text-center"><em>Record your voice for at least 3 seconds to create a voice clone. To prevent
9
+ unauthorized voice cloning, you must start by clearly saying &quot;I consent to cloning my
10
+ voice&quot; β€” the rest of the text is arbitrary. Try reading the sample above.</em></p>`,j,w,$,oe,P,I,M,ke,Z,ae,ce,se,Me,He,Se,Ie,Qe,We,Xe,y,B,ee,ve,Pe,Ee,ge,be,ye,Le,qe;m=new er({props:{size:16}});let ne=s[0]&&Lt(s);const mt=[dr,fr],Ne=[];function gt(f,N){return f[0]?0:1}A=gt(s),E=Ne[A]=mt[A](s);let ue=!s[18]&&s[19]&&Mt(s);const bt=[hr,_r],Re=[];function vt(f,N){return f[1].length===0?0:1}I=vt(s),M=Re[I]=bt[I](s);const yt=[vr,br,gr],je=[];function kt(f,N){return f[11]?0:f[12]?1:2}ce=kt(s),se=je[ce]=yt[ce](s);function wt(f,N){return f[2]?kr:yr}let Ze=wt(s),De=Ze(s);function Et(f,N){return f[2]&&f[10][f[2].id]?Tr:Dr}let et=Et(s),Te=et(s),fe=s[2]&&s[10][s[2].id]&&Rt(s);function Dt(f,N){if(f[14]&&f[2]&&f[13][f[2].id])return Cr;if(f[14])return xr}let Oe=Dt(s),de=Oe&&Oe(s),te=s[18]&&s[15].length>0&&zt(s),re=s[3]&&At(s);return{c(){e=x(),t=p("div"),r=p("div"),l=p("div"),o=p("div"),n=p("div"),i=p("div"),a=p("span"),a.textContent=g,_=x(),v=p("button"),me(m.$$.fragment),k=x(),L=p("div"),F=p("p"),T=p("span"),T.textContent=X,R=x(),K=O(S),J=x(),z=p("div"),ne&&ne.c(),W=x(),U=p("button"),E.c(),Q=x(),Y=p("div"),Y.innerHTML=ie,j=x(),w=p("div"),$=p("div"),ue&&ue.c(),oe=x(),P=p("div"),M.c(),ke=x(),Z=p("div"),ae=p("button"),se.c(),He=x(),Se=p("div"),Ie=p("span"),De.c(),Qe=O(`
11
+ at least 3 seconds`),Xe=x(),y=p("span"),Te.c(),B=O(`
12
+ includes consent`),ve=x(),fe&&fe.c(),Pe=x(),de&&de.c(),Ee=x(),te&&te.c(),ge=x(),re&&re.c(),be=Ke(),this.h()},l(f){Xt("svelte-ymar42",document.head).forEach(u),e=V(f),t=h(f,"DIV",{class:!0});var Fe=b(t);r=h(Fe,"DIV",{class:!0});var ze=b(r);l=h(ze,"DIV",{class:!0});var Ye=b(l);o=h(Ye,"DIV",{class:!0});var Ge=b(o);n=h(Ge,"DIV",{class:!0});var tt=b(n);i=h(tt,"DIV",{class:!0});var rt=b(i);a=h(rt,"SPAN",{class:!0,"data-svelte-h":!0}),we(a)!=="svelte-i2qskl"&&(a.textContent=g),_=V(rt),v=h(rt,"BUTTON",{class:!0,title:!0});var Tt=b(v);pe(m.$$.fragment,Tt),Tt.forEach(u),rt.forEach(u),k=V(tt),L=h(tt,"DIV",{class:!0});var It=b(L);F=h(It,"P",{});var lt=b(F);T=h(lt,"SPAN",{class:!0,"data-svelte-h":!0}),we(T)!=="svelte-teyhel"&&(T.textContent=X),R=V(lt),K=q(lt,S),lt.forEach(u),It.forEach(u),tt.forEach(u),J=V(Ge),z=h(Ge,"DIV",{class:!0});var st=b(z);ne&&ne.l(st),W=V(st),U=h(st,"BUTTON",{class:!0});var Vt=b(U);E.l(Vt),Vt.forEach(u),st.forEach(u),Q=V(Ge),Y=h(Ge,"DIV",{class:!0,"data-svelte-h":!0}),we(Y)!=="svelte-fbcwq9"&&(Y.innerHTML=ie),Ge.forEach(u),Ye.forEach(u),j=V(ze),w=h(ze,"DIV",{class:!0});var xt=b(w);$=h(xt,"DIV",{class:!0});var Ue=b($);ue&&ue.l(Ue),oe=V(Ue),P=h(Ue,"DIV",{class:!0});var Ct=b(P);M.l(Ct),Ct.forEach(u),ke=V(Ue),Z=h(Ue,"DIV",{class:!0});var Ae=b(Z);ae=h(Ae,"BUTTON",{class:!0});var $t=b(ae);se.l($t),$t.forEach(u),He=V(Ae),Se=h(Ae,"DIV",{class:!0});var ot=b(Se);Ie=h(ot,"SPAN",{class:!0});var ut=b(Ie);De.l(ut),Qe=q(ut,`
13
+ at least 3 seconds`),ut.forEach(u),Xe=V(ot),y=h(ot,"SPAN",{class:!0});var ft=b(y);Te.l(ft),B=q(ft,`
14
+ includes consent`),ft.forEach(u),ot.forEach(u),ve=V(Ae),fe&&fe.l(Ae),Pe=V(Ae),de&&de.l(Ae),Ae.forEach(u),Ee=V(Ue),te&&te.l(Ue),Ue.forEach(u),xt.forEach(u),ze.forEach(u),Fe.forEach(u),ge=V(f),re&&re.l(f),be=Ke(),this.h()},h(){document.title="Voice Cloning - HFStudio",d(a,"class","text-sm text-gray-400"),d(v,"class","p-1 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors"),d(v,"title","Try a different sample text"),d(i,"class","absolute top-3 left-3 flex items-center gap-2 z-10"),d(T,"class","bg-yellow-50 px-2 py-1 rounded border border-amber-200"),d(L,"class","w-full h-80 pt-12 px-6 pb-6 bg-white border-2 border-amber-400 rounded-lg text-gray-900 text-lg leading-relaxed overflow-y-auto"),d(n,"class","relative mb-4"),d(U,"class",H="w-24 h-24 rounded-full flex items-center justify-center transition-all duration-200 shadow-lg relative overflow-hidden z-20 cursor-pointer "+(s[0]?"border-4 border-orange-500 bg-transparent":"bg-orange-500 hover:bg-orange-600")),d(z,"class","flex justify-center items-center flex-1 relative"),d(Y,"class","mb-6"),d(o,"class","flex-1 pb-24 relative flex flex-col"),d(l,"class","flex-1 flex flex-col p-6"),d(P,"class","mb-4"),ae.disabled=Me=!s[2]||s[11]||s[12],d(ae,"class","w-full px-4 py-2 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 transition-colors flex items-center justify-center gap-2"),d(Ie,"class",We="flex items-center gap-1 "+(s[2]?it(s[2])?"text-green-600":"text-red-600":"text-gray-400")),d(y,"class",ee="flex items-center gap-1 "+(s[2]?s[21](s[2])?"text-green-600":s[10][s[2].id]?"text-red-600":"text-gray-400":"text-gray-400")),d(Se,"class","mt-3 text-sm flex items-center gap-4"),d(Z,"class","mt-6 pt-4 border-t border-gray-200"),d($,"class","p-3 h-full overflow-y-auto"),d(w,"class","w-80 border-l border-gray-200 bg-white h-full overflow-hidden"),d(r,"class","flex-1 flex"),d(t,"class","flex flex-col h-full")},m(f,N){G(f,e,N),G(f,t,N),c(t,r),c(r,l),c(l,o),c(o,n),c(n,i),c(i,a),c(i,_),c(i,v),he(m,v,null),c(n,k),c(n,L),c(L,F),c(F,T),c(F,R),c(F,K),c(o,J),c(o,z),ne&&ne.m(z,null),c(z,W),c(z,U),Ne[A].m(U,null),c(o,Q),c(o,Y),c(r,j),c(r,w),c(w,$),ue&&ue.m($,null),c($,oe),c($,P),Re[I].m(P,null),c($,ke),c($,Z),c(Z,ae),je[ce].m(ae,null),c(Z,He),c(Z,Se),c(Se,Ie),De.m(Ie,null),c(Ie,Qe),c(Se,Xe),c(Se,y),Te.m(y,null),c(y,B),c(Z,ve),fe&&fe.m(Z,null),c(Z,Pe),de&&de.m(Z,null),c($,Ee),te&&te.m($,null),G(f,ge,N),re&&re.m(f,N),G(f,be,N),ye=!0,Le||(qe=[$e(v,"click",s[23]),$e(U,"click",s[24]),$e(ae,"click",s[27])],Le=!0)},p(f,N){(!ye||N[0]&131072)&&S!==(S=f[20][f[17]]+"")&&Ce(K,S),f[0]?ne?ne.p(f,N):(ne=Lt(f),ne.c(),ne.m(z,W)):ne&&(ne.d(1),ne=null);let Fe=A;A=gt(f),A===Fe?Ne[A].p(f,N):(xe(),C(Ne[Fe],1,1,()=>{Ne[Fe]=null}),Ve(),E=Ne[A],E?E.p(f,N):(E=Ne[A]=mt[A](f),E.c()),D(E,1),E.m(U,null)),(!ye||N[0]&1&&H!==(H="w-24 h-24 rounded-full flex items-center justify-center transition-all duration-200 shadow-lg relative overflow-hidden z-20 cursor-pointer "+(f[0]?"border-4 border-orange-500 bg-transparent":"bg-orange-500 hover:bg-orange-600")))&&d(U,"class",H),!f[18]&&f[19]?ue?ue.p(f,N):(ue=Mt(f),ue.c(),ue.m($,oe)):ue&&(ue.d(1),ue=null);let ze=I;I=vt(f),I===ze?Re[I].p(f,N):(xe(),C(Re[ze],1,1,()=>{Re[ze]=null}),Ve(),M=Re[I],M?M.p(f,N):(M=Re[I]=bt[I](f),M.c()),D(M,1),M.m(P,null));let Ye=ce;ce=kt(f),ce!==Ye&&(xe(),C(je[Ye],1,1,()=>{je[Ye]=null}),Ve(),se=je[ce],se||(se=je[ce]=yt[ce](f),se.c()),D(se,1),se.m(ae,null)),(!ye||N[0]&6148&&Me!==(Me=!f[2]||f[11]||f[12]))&&(ae.disabled=Me),Ze===(Ze=wt(f))&&De?De.p(f,N):(De.d(1),De=Ze(f),De&&(De.c(),De.m(Ie,Qe))),(!ye||N[0]&4&&We!==(We="flex items-center gap-1 "+(f[2]?it(f[2])?"text-green-600":"text-red-600":"text-gray-400")))&&d(Ie,"class",We),et===(et=Et(f))&&Te?Te.p(f,N):(Te.d(1),Te=et(f),Te&&(Te.c(),Te.m(y,B))),(!ye||N[0]&1028&&ee!==(ee="flex items-center gap-1 "+(f[2]?f[21](f[2])?"text-green-600":f[10][f[2].id]?"text-red-600":"text-gray-400":"text-gray-400")))&&d(y,"class",ee),f[2]&&f[10][f[2].id]?fe?fe.p(f,N):(fe=Rt(f),fe.c(),fe.m(Z,Pe)):fe&&(fe.d(1),fe=null),Oe===(Oe=Dt(f))&&de?de.p(f,N):(de&&de.d(1),de=Oe&&Oe(f),de&&(de.c(),de.m(Z,null))),f[18]&&f[15].length>0?te?(te.p(f,N),N[0]&294912&&D(te,1)):(te=zt(f),te.c(),D(te,1),te.m($,null)):te&&(xe(),C(te,1,1,()=>{te=null}),Ve()),f[3]?re?(re.p(f,N),N[0]&8&&D(re,1)):(re=At(f),re.c(),D(re,1),re.m(be.parentNode,be)):re&&(xe(),C(re,1,1,()=>{re=null}),Ve())},i(f){ye||(D(m.$$.fragment,f),D(E),D(M),D(se),D(te),D(re),ye=!0)},o(f){C(m.$$.fragment,f),C(E),C(M),C(se),C(te),C(re),ye=!1},d(f){f&&(u(e),u(t),u(ge),u(be)),_e(m),ne&&ne.d(),Ne[A].d(),ue&&ue.d(),Re[I].d(),je[ce].d(),De.d(),Te.d(),fe&&fe.d(),de&&de.d(),te&&te.d(),re&&re.d(f),Le=!1,ct(qe)}}}function it(s){return s&&s.duration>=3}function Nr(s,e,t){let r=!1,l=[],o=null,n=[],i=null,a=[],g=!1,_="",v="",m=0,k=0,L=null,F=0,T=null,X=null,R=null,S=null,K={},J=!1,z=!1,W={},U="",A=[],E=!1;const H=["There's a quiet kind of magic in the early hours of the morning, when the world is still half-asleep and the air feels crisp with possibility. The hum of the refrigerator becomes a rhythm, the ticking of the clock a heartbeat, and for a brief moment, everything feels perfectly in sync.","The aroma of fresh coffee dances through the kitchen as sunlight streams through translucent curtains, casting golden patterns on weathered wooden floors. Steam rises from the ceramic mug like incense, creating a small sanctuary of warmth and comfort in the midst of a busy day.","Ocean waves crash against weathered cliffs with relentless determination, their white foam reaching toward the endless sky. Seabirds call out across the salt-scented breeze, their cries echoing off ancient stone formations that have stood witness to countless storms and seasons."];let Q=0,Y=!1,ie=!1;function j(y){if(!y)return!1;const B=K[y.id];return B&&B.consent_detected}function w(y,B=""){t(4,_=y),t(5,v=B),t(3,g=!0)}function $(){t(3,g=!1),t(4,_=""),t(5,v="")}function oe(){t(17,Q=(Q+1)%H.length)}async function P(){try{const y=await fetch("/api/auth/user",{credentials:"include"});if(y.ok){const B=await y.json(),ee=Y;t(18,Y=B.authenticated),Y&&!ee?await Me():!Y&&ee&&t(15,A=[])}else t(18,Y=!1),t(15,A=[])}catch{t(18,Y=!1),t(15,A=[])}}async function I(){if(!Y){t(19,ie=!0);return}try{let Ee=function(){if(!r||!X)return;X.getByteFrequencyData(Pe);let ge=0;for(let be=0;be<ve;be++)ge+=Pe[be];t(7,F=ge/ve/255),requestAnimationFrame(Ee)};const y=await navigator.mediaDevices.getUserMedia({audio:!0});let B={};MediaRecorder.isTypeSupported("audio/mp3")?B.mimeType="audio/mp3":MediaRecorder.isTypeSupported("audio/mpeg")?B.mimeType="audio/mpeg":MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?B.mimeType="audio/webm;codecs=opus":MediaRecorder.isTypeSupported("audio/webm")&&(B.mimeType="audio/webm"),i=new MediaRecorder(y,B),a=[],n=[],t(6,k=0),t(7,F=0),T=new(window.AudioContext||window.webkitAudioContext),X=T.createAnalyser(),T.createMediaStreamSource(y).connect(X),X.fftSize=256;const ve=X.frequencyBinCount,Pe=new Uint8Array(ve);i.ondataavailable=ge=>{a.push(ge.data)},i.onstop=()=>{const ge=new Blob(a,{type:B.mimeType||"audio/webm"}),be=URL.createObjectURL(ge),ye={id:Date.now(),url:be,blob:ge,timestamp:new Date,duration:k/100*15};t(1,l=[...l,ye]),y.getTracks().forEach(Le=>Le.stop()),T&&(T.close(),T=null),t(6,k=0),t(7,F=0)},i.start(),t(0,r=!0),Ee(),L=setInterval(()=>{if(!r){clearInterval(L);return}t(6,k+=100/15/10),k>=100&&t(6,k=100)},100)}catch(y){console.error("Error accessing microphone:",y),w("Microphone Error","Could not access microphone. Please check permissions.")}}function M(){i&&i.state==="recording"&&(i.stop(),t(0,r=!1),n=[],L&&(clearInterval(L),L=null))}function ke(){r?M():I()}function Z(y){t(2,o=y)}function ae(y){if((R==null?void 0:R.id)===y.id&&S&&!S.paused){S.pause(),t(8,R=null);return}S&&(S.pause(),t(9,S=null)),t(9,S=new Audio(y.url)),t(8,R=y),S.addEventListener("ended",()=>{t(8,R=null),t(9,S=null)}),S.addEventListener("pause",()=>{S&&S.ended&&(t(8,R=null),t(9,S=null))}),S.play()}async function ce(){if(!o){w("Clone Error","Please select a recording.");return}t(11,J=!0),t(14,U="");try{const y=new FormData;y.append("audio_file",o.blob,"recording.mp3");const B=await fetch("/api/voice/transcribe",{method:"POST",credentials:"include",body:y});if(!B.ok){const ve=await B.text();throw new Error(`HTTP error! status: ${B.status}, response: ${ve}`)}const ee=await B.json();if(ee.success){t(10,K[o.id]={transcript:ee.transcript,first_words:ee.first_words,consent_detected:ee.consent_detected},K),t(10,K={...K});const ve=it(o),Pe=ee.consent_detected;if(ve&&Pe){t(11,J=!1),t(12,z=!0);try{const Ee=new FormData;Ee.append("audio_file",o.blob,"recording.mp3");const ge=`Voice_${Date.now()}`,be=encodeURIComponent(ee.transcript),ye=Math.floor(o.duration),Le=await fetch(`/api/voice/upload?voice_name=${ge}&transcript=${be}&duration=${ye}`,{method:"POST",credentials:"include",body:Ee});if(!Le.ok){const ne=await Le.text();throw new Error(`Upload failed: ${ne}`)}const qe=await Le.json();qe.success?(t(13,W[o.id]=qe,W),t(13,W={...W}),t(14,U="Your voice has been saved to a temporary URL for 24 hours and will be automatically deleted. You can now use it for text-to-speech generation."),await Me()):w("Upload Error",qe.error||"Failed to upload voice")}catch(Ee){w("Upload Error",`Failed to upload voice: ${Ee.message}`)}finally{t(12,z=!1)}}}else w("Transcription Error",ee.error||"Failed to transcribe audio")}catch(y){w("Network Error",`Failed to process recording: ${y.message}`)}finally{z||t(11,J=!1)}}async function se(){try{const y=await fetch("/api/history/load",{method:"GET",credentials:"include"});y.ok&&(m=(await y.json()).entries.filter(ve=>ve.entry_type==="generation").length)}catch(y){console.error("Error loading history count:",y),m=0}}async function Me(){if(Y)try{const y=await fetch("/api/voice/user-voices",{method:"GET",credentials:"include"});if(y.ok){const B=await y.json();t(15,A=B.voices)}}catch(y){console.error("Error loading user voices:",y),t(15,A=[])}}async function He(y){t(16,E=!0);try{const B=await fetch(`/api/voice/${y}`,{method:"DELETE",credentials:"include"});if(B.ok)t(15,A=A.filter(ee=>ee.id!==y)),t(14,U="Voice deleted successfully"),setTimeout(()=>{t(14,U="")},3e3);else{const ee=await B.json();w("Delete Error",ee.detail||"Failed to delete voice")}}catch(B){w("Delete Error",`Failed to delete voice: ${B.message}`)}finally{t(16,E=!1)}}return Zt(async()=>{await P(),await se(),await Me()}),[r,l,o,g,_,v,k,F,R,S,K,J,z,W,U,A,E,Q,Y,ie,H,j,$,oe,ke,Z,ae,ce,He,()=>t(19,ie=!1),y=>ae(y),y=>Z(y),y=>ae({url:y.voice_url,id:y.id}),y=>He(y.id)]}class Hr extends dt{constructor(e){super(),_t(this,e,Nr,Mr,ht,{},null,[-1,-1])}}export{Hr as component};
hfstudio/static/_app/version.json CHANGED
@@ -1 +1 @@
1
- {"version":"1761293217408"}
 
1
+ {"version":"1761295579154"}
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.CKoTx8mP.js">
10
- <link rel="modulepreload" href="/_app/immutable/chunks/CxVfujWq.js">
11
  <link rel="modulepreload" href="/_app/immutable/chunks/TRxHAhOH.js">
12
- <link rel="modulepreload" href="/_app/immutable/entry/app.DuRM45UA.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_81rgwk = {
20
  base: ""
21
  };
22
 
23
  const element = document.currentScript.parentElement;
24
 
25
  Promise.all([
26
- import("/_app/immutable/entry/start.CKoTx8mP.js"),
27
- import("/_app/immutable/entry/app.DuRM45UA.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.6R3nY2mE.js">
10
+ <link rel="modulepreload" href="/_app/immutable/chunks/-00l7SVl.js">
11
  <link rel="modulepreload" href="/_app/immutable/chunks/TRxHAhOH.js">
12
+ <link rel="modulepreload" href="/_app/immutable/entry/app.C5Z-huiY.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_1nascwh = {
20
  base: ""
21
  };
22
 
23
  const element = document.currentScript.parentElement;
24
 
25
  Promise.all([
26
+ import("/_app/immutable/entry/start.6R3nY2mE.js"),
27
+ import("/_app/immutable/entry/app.C5Z-huiY.js")
28
  ]).then(([kit, app]) => {
29
  kit.start(app, element);
30
  });