GitHub Action
commited on
Commit
Β·
e459198
1
Parent(s):
e3ad800
Sync from GitHub: 8c7faa0010d4550740b90f755504f83ba9a709f0
Browse files- .gitattributes +6 -0
- frontend/src/routes/+layout.svelte +24 -12
- frontend/src/routes/+page.svelte +55 -33
- hfstudio/server.py +71 -26
- hfstudio/static/_app/immutable/assets/0.BqmMj_TK.css +1 -0
- hfstudio/static/_app/immutable/chunks/DzjgK6hA.js +3 -0
- hfstudio/static/_app/immutable/entry/app.nVU5EqYr.js +2 -0
- hfstudio/static/_app/immutable/entry/start.BI3xAqHM.js +1 -0
- hfstudio/static/_app/immutable/nodes/0.Bl1mwlCJ.js +5 -0
- hfstudio/static/_app/immutable/nodes/1.SnSFDeew.js +1 -0
- hfstudio/static/_app/immutable/nodes/2.DPbkTEMF.js +0 -0
- hfstudio/static/_app/version.json +1 -1
- hfstudio/static/index.html +6 -6
.gitattributes
CHANGED
|
@@ -7,3 +7,9 @@
|
|
| 7 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 8 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 9 |
*.pdf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 8 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 9 |
*.pdf filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
hfstudio/static/assets/hf-logo.png filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
hfstudio/static/assets/hf-studio-logo.png filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
frontend/static/assets/hf-logo.png filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
frontend/static/assets/hf-studio-logo.png filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
hfstudio/static/samples/harvard.wav filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
frontend/static/samples/harvard.wav filter=lfs diff=lfs merge=lfs -text
|
frontend/src/routes/+layout.svelte
CHANGED
|
@@ -30,6 +30,7 @@
|
|
| 30 |
let isLocalEnvironment = false;
|
| 31 |
let showLoginPrompt = false;
|
| 32 |
let flashButton = false;
|
|
|
|
| 33 |
|
| 34 |
onMount(() => {
|
| 35 |
// Listen for event to show login prompt
|
|
@@ -43,15 +44,18 @@
|
|
| 43 |
}
|
| 44 |
});
|
| 45 |
|
| 46 |
-
//
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
|
|
|
|
|
|
| 50 |
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
|
|
|
| 55 |
|
| 56 |
document.addEventListener('visibilitychange', () => {
|
| 57 |
if (!document.hidden) {
|
|
@@ -69,6 +73,17 @@
|
|
| 69 |
};
|
| 70 |
});
|
| 71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
async function checkLocalTokenAvailability() {
|
| 73 |
// Only check if not already authenticated
|
| 74 |
if (isLoggedIn) {
|
|
@@ -161,10 +176,7 @@
|
|
| 161 |
isLoggedIn = false;
|
| 162 |
username = '';
|
| 163 |
} else {
|
| 164 |
-
if (
|
| 165 |
-
window.location.hostname.includes('hf.space') ||
|
| 166 |
-
window.location.hostname.includes('huggingface.co')
|
| 167 |
-
) {
|
| 168 |
try {
|
| 169 |
const response = await fetch('/api/auth/oauth-config');
|
| 170 |
const config = await response.json();
|
|
|
|
| 30 |
let isLocalEnvironment = false;
|
| 31 |
let showLoginPrompt = false;
|
| 32 |
let flashButton = false;
|
| 33 |
+
let isSpaces = false;
|
| 34 |
|
| 35 |
onMount(() => {
|
| 36 |
// Listen for event to show login prompt
|
|
|
|
| 44 |
}
|
| 45 |
});
|
| 46 |
|
| 47 |
+
// Check if running on Spaces first
|
| 48 |
+
checkSpacesStatus().then(() => {
|
| 49 |
+
// Only check local token availability if not already authenticated and not on Spaces
|
| 50 |
+
if (!isLoggedIn && !isSpaces) {
|
| 51 |
+
checkLocalTokenAvailability();
|
| 52 |
+
}
|
| 53 |
|
| 54 |
+
// Only check login status if we don't have initial user data
|
| 55 |
+
if (!initialUser?.authenticated) {
|
| 56 |
+
checkLoginStatus();
|
| 57 |
+
}
|
| 58 |
+
});
|
| 59 |
|
| 60 |
document.addEventListener('visibilitychange', () => {
|
| 61 |
if (!document.hidden) {
|
|
|
|
| 73 |
};
|
| 74 |
});
|
| 75 |
|
| 76 |
+
async function checkSpacesStatus() {
|
| 77 |
+
try {
|
| 78 |
+
const response = await fetch('/api/status');
|
| 79 |
+
const data = await response.json();
|
| 80 |
+
isSpaces = data.is_spaces || false;
|
| 81 |
+
} catch (error) {
|
| 82 |
+
console.error('Error checking Spaces status:', error);
|
| 83 |
+
isSpaces = false;
|
| 84 |
+
}
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
async function checkLocalTokenAvailability() {
|
| 88 |
// Only check if not already authenticated
|
| 89 |
if (isLoggedIn) {
|
|
|
|
| 176 |
isLoggedIn = false;
|
| 177 |
username = '';
|
| 178 |
} else {
|
| 179 |
+
if (isSpaces) {
|
|
|
|
|
|
|
|
|
|
| 180 |
try {
|
| 181 |
const response = await fetch('/api/auth/oauth-config');
|
| 182 |
const config = await response.json();
|
frontend/src/routes/+page.svelte
CHANGED
|
@@ -60,7 +60,7 @@
|
|
| 60 |
{
|
| 61 |
id: 'lily',
|
| 62 |
name: 'Lily',
|
| 63 |
-
description: 'Warm, conversational
|
| 64 |
sample: '/voices/lily.mp3',
|
| 65 |
preview_url:
|
| 66 |
'https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/lily.mp3',
|
|
@@ -84,7 +84,7 @@
|
|
| 84 |
{
|
| 85 |
id: 'pirate',
|
| 86 |
name: 'Pirate',
|
| 87 |
-
description: 'Young pirate that speaks gruffly and
|
| 88 |
sample: '/voices/pirate.mp3',
|
| 89 |
preview_url:
|
| 90 |
'https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/pirate.mp3',
|
|
@@ -756,13 +756,13 @@ print(f"β Audio saved to {output_filename}")
|
|
| 756 |
</div>
|
| 757 |
|
| 758 |
<!-- Right panel -->
|
| 759 |
-
<div class="w-80 border-l border-gray-200 bg-white p-
|
| 760 |
<!-- Model selector -->
|
| 761 |
-
<div class="mb-
|
| 762 |
-
<h3 class="font-medium text-gray-900 mb-
|
| 763 |
<button
|
| 764 |
on:click={() => (modelDropdownOpen = !modelDropdownOpen)}
|
| 765 |
-
class="w-full p-
|
| 766 |
>
|
| 767 |
<span>
|
| 768 |
{#each models as model}
|
|
@@ -773,7 +773,7 @@ print(f"β Audio saved to {output_filename}")
|
|
| 773 |
{/if}
|
| 774 |
{/each}
|
| 775 |
</span>
|
| 776 |
-
<ChevronDown size={
|
| 777 |
</button>
|
| 778 |
|
| 779 |
{#if modelDropdownOpen}
|
|
@@ -782,7 +782,7 @@ print(f"β Audio saved to {output_filename}")
|
|
| 782 |
>
|
| 783 |
{#each models as model}
|
| 784 |
<button
|
| 785 |
-
class="w-full px-3 py-
|
| 786 |
? 'opacity-50 cursor-not-allowed'
|
| 787 |
: 'hover:bg-gray-50'} {model.name === selectedModel ? 'bg-gray-100' : ''}"
|
| 788 |
disabled={model.disabled}
|
|
@@ -802,7 +802,7 @@ print(f"β Audio saved to {output_filename}")
|
|
| 802 |
{/if}
|
| 803 |
|
| 804 |
<!-- Pricing info -->
|
| 805 |
-
<div class="mt-
|
| 806 |
Estimated $0.025 per 1000 characters β’ <a
|
| 807 |
href="https://huggingface.co/settings/billing"
|
| 808 |
target="_blank"
|
|
@@ -811,26 +811,26 @@ print(f"β Audio saved to {output_filename}")
|
|
| 811 |
</div>
|
| 812 |
</div>
|
| 813 |
|
| 814 |
-
<div class="mb-
|
| 815 |
-
<div class="mb-
|
| 816 |
-
<h3 class="font-medium text-gray-900">Voice</h3>
|
| 817 |
</div>
|
| 818 |
|
| 819 |
-
<div class="space-y-
|
| 820 |
{#each voices as voice}
|
| 821 |
<button
|
| 822 |
-
class="w-full flex items-center justify-between p-
|
| 823 |
{voice.name === selectedVoice ? 'bg-gray-100 border-gray-200' : ''}"
|
| 824 |
on:click={() => (selectedVoice = voice.name)}
|
| 825 |
>
|
| 826 |
-
<div class="flex items-center gap-
|
| 827 |
<div
|
| 828 |
-
class="w-
|
| 829 |
>
|
| 830 |
{voice.name[0]}
|
| 831 |
</div>
|
| 832 |
<div class="flex-1 min-w-0">
|
| 833 |
-
<div class="text-
|
| 834 |
<div class="text-xs text-gray-500 leading-relaxed">
|
| 835 |
{voice.description}
|
| 836 |
</div>
|
|
@@ -838,13 +838,13 @@ print(f"β Audio saved to {output_filename}")
|
|
| 838 |
</div>
|
| 839 |
<button
|
| 840 |
on:click={(e) => playSampleVoice(voice, e)}
|
| 841 |
-
class="p-
|
| 842 |
title="Play sample"
|
| 843 |
>
|
| 844 |
{#if playingSampleVoice === voice.name}
|
| 845 |
-
<Pause size={
|
| 846 |
{:else}
|
| 847 |
-
<Play size={
|
| 848 |
{/if}
|
| 849 |
</button>
|
| 850 |
</button>
|
|
@@ -852,17 +852,17 @@ print(f"β Audio saved to {output_filename}")
|
|
| 852 |
|
| 853 |
<!-- Clone voice option -->
|
| 854 |
<button
|
| 855 |
-
class="w-full flex items-center justify-between p-
|
| 856 |
disabled
|
| 857 |
>
|
| 858 |
-
<div class="flex items-center gap-
|
| 859 |
<div
|
| 860 |
-
class="w-
|
| 861 |
>
|
| 862 |
+
|
| 863 |
</div>
|
| 864 |
<div class="flex-1 min-w-0">
|
| 865 |
-
<div class="text-
|
| 866 |
<div class="text-xs text-gray-400">(coming soon)</div>
|
| 867 |
</div>
|
| 868 |
</div>
|
|
@@ -870,14 +870,14 @@ print(f"β Audio saved to {output_filename}")
|
|
| 870 |
</div>
|
| 871 |
</div>
|
| 872 |
|
| 873 |
-
<div class="space-y-
|
| 874 |
<!-- Exaggeration control -->
|
| 875 |
<div>
|
| 876 |
-
<div class="flex justify-between mb-
|
| 877 |
-
<label for="exaggeration-slider" class="text-
|
| 878 |
>Exaggeration</label
|
| 879 |
>
|
| 880 |
-
<span class="text-
|
| 881 |
</div>
|
| 882 |
<input
|
| 883 |
id="exaggeration-slider"
|
|
@@ -888,7 +888,7 @@ print(f"β Audio saved to {output_filename}")
|
|
| 888 |
step="0.01"
|
| 889 |
class="w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"
|
| 890 |
/>
|
| 891 |
-
<div class="flex justify-between text-xs text-gray-400 mt-
|
| 892 |
<span>None</span>
|
| 893 |
<span>Exaggerated</span>
|
| 894 |
</div>
|
|
@@ -896,11 +896,11 @@ print(f"β Audio saved to {output_filename}")
|
|
| 896 |
|
| 897 |
<!-- Stability control -->
|
| 898 |
<div>
|
| 899 |
-
<div class="flex justify-between mb-
|
| 900 |
-
<label for="temperature-slider" class="text-
|
| 901 |
>Stability</label
|
| 902 |
>
|
| 903 |
-
<span class="text-
|
| 904 |
</div>
|
| 905 |
<input
|
| 906 |
id="temperature-slider"
|
|
@@ -911,12 +911,34 @@ print(f"β Audio saved to {output_filename}")
|
|
| 911 |
step="0.01"
|
| 912 |
class="w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"
|
| 913 |
/>
|
| 914 |
-
<div class="flex justify-between text-xs text-gray-400 mt-
|
| 915 |
<span>More stable</span>
|
| 916 |
<span>More variable</span>
|
| 917 |
</div>
|
| 918 |
</div>
|
| 919 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 920 |
</div>
|
| 921 |
</div>
|
| 922 |
{:else}
|
|
|
|
| 60 |
{
|
| 61 |
id: 'lily',
|
| 62 |
name: 'Lily',
|
| 63 |
+
description: 'Warm, conversational tone of a woman in her 30s',
|
| 64 |
sample: '/voices/lily.mp3',
|
| 65 |
preview_url:
|
| 66 |
'https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/lily.mp3',
|
|
|
|
| 84 |
{
|
| 85 |
id: 'pirate',
|
| 86 |
name: 'Pirate',
|
| 87 |
+
description: 'Young pirate that speaks gruffly and with excitement',
|
| 88 |
sample: '/voices/pirate.mp3',
|
| 89 |
preview_url:
|
| 90 |
'https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/pirate.mp3',
|
|
|
|
| 756 |
</div>
|
| 757 |
|
| 758 |
<!-- Right panel -->
|
| 759 |
+
<div class="w-80 border-l border-gray-200 bg-white p-3 overflow-y-auto">
|
| 760 |
<!-- Model selector -->
|
| 761 |
+
<div class="mb-4 relative model-dropdown">
|
| 762 |
+
<h3 class="text-sm font-medium text-gray-900 mb-2">Model</h3>
|
| 763 |
<button
|
| 764 |
on:click={() => (modelDropdownOpen = !modelDropdownOpen)}
|
| 765 |
+
class="w-full p-2.5 border border-gray-200 rounded-lg bg-white text-xs focus:outline-none focus:ring-2 focus:ring-amber-400 focus:border-transparent appearance-none bg-no-repeat bg-right pr-10 shadow-sm text-left flex items-center justify-between"
|
| 766 |
>
|
| 767 |
<span>
|
| 768 |
{#each models as model}
|
|
|
|
| 773 |
{/if}
|
| 774 |
{/each}
|
| 775 |
</span>
|
| 776 |
+
<ChevronDown size={14} class="text-gray-500" />
|
| 777 |
</button>
|
| 778 |
|
| 779 |
{#if modelDropdownOpen}
|
|
|
|
| 782 |
>
|
| 783 |
{#each models as model}
|
| 784 |
<button
|
| 785 |
+
class="w-full px-3 py-1.5 text-left transition-colors text-xs {model.disabled
|
| 786 |
? 'opacity-50 cursor-not-allowed'
|
| 787 |
: 'hover:bg-gray-50'} {model.name === selectedModel ? 'bg-gray-100' : ''}"
|
| 788 |
disabled={model.disabled}
|
|
|
|
| 802 |
{/if}
|
| 803 |
|
| 804 |
<!-- Pricing info -->
|
| 805 |
+
<div class="mt-1.5 text-xs text-gray-500">
|
| 806 |
Estimated $0.025 per 1000 characters β’ <a
|
| 807 |
href="https://huggingface.co/settings/billing"
|
| 808 |
target="_blank"
|
|
|
|
| 811 |
</div>
|
| 812 |
</div>
|
| 813 |
|
| 814 |
+
<div class="mb-4">
|
| 815 |
+
<div class="mb-2">
|
| 816 |
+
<h3 class="text-sm font-medium text-gray-900">Voice</h3>
|
| 817 |
</div>
|
| 818 |
|
| 819 |
+
<div class="space-y-1.5">
|
| 820 |
{#each voices as voice}
|
| 821 |
<button
|
| 822 |
+
class="w-full flex items-center justify-between p-1.5 rounded-lg hover:bg-gray-50 transition-colors text-left group border border-transparent
|
| 823 |
{voice.name === selectedVoice ? 'bg-gray-100 border-gray-200' : ''}"
|
| 824 |
on:click={() => (selectedVoice = voice.name)}
|
| 825 |
>
|
| 826 |
+
<div class="flex items-center gap-2.5 flex-1 min-w-0">
|
| 827 |
<div
|
| 828 |
+
class="w-8 h-8 bg-gradient-to-br from-amber-400 to-orange-500 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0"
|
| 829 |
>
|
| 830 |
{voice.name[0]}
|
| 831 |
</div>
|
| 832 |
<div class="flex-1 min-w-0">
|
| 833 |
+
<div class="text-xs font-medium text-gray-900">{voice.name}</div>
|
| 834 |
<div class="text-xs text-gray-500 leading-relaxed">
|
| 835 |
{voice.description}
|
| 836 |
</div>
|
|
|
|
| 838 |
</div>
|
| 839 |
<button
|
| 840 |
on:click={(e) => playSampleVoice(voice, e)}
|
| 841 |
+
class="p-1.5 rounded-full hover:bg-gray-200 transition-colors flex-shrink-0 ml-2 w-7 h-7 flex items-center justify-center"
|
| 842 |
title="Play sample"
|
| 843 |
>
|
| 844 |
{#if playingSampleVoice === voice.name}
|
| 845 |
+
<Pause size={14} class="text-gray-600" />
|
| 846 |
{:else}
|
| 847 |
+
<Play size={14} class="text-gray-600" />
|
| 848 |
{/if}
|
| 849 |
</button>
|
| 850 |
</button>
|
|
|
|
| 852 |
|
| 853 |
<!-- Clone voice option -->
|
| 854 |
<button
|
| 855 |
+
class="w-full flex items-center justify-between p-1.5 rounded-lg opacity-50 cursor-not-allowed text-left border border-transparent"
|
| 856 |
disabled
|
| 857 |
>
|
| 858 |
+
<div class="flex items-center gap-2.5 flex-1 min-w-0">
|
| 859 |
<div
|
| 860 |
+
class="w-8 h-8 bg-gray-400 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0"
|
| 861 |
>
|
| 862 |
+
|
| 863 |
</div>
|
| 864 |
<div class="flex-1 min-w-0">
|
| 865 |
+
<div class="text-xs font-medium text-gray-600">Clone your voice</div>
|
| 866 |
<div class="text-xs text-gray-400">(coming soon)</div>
|
| 867 |
</div>
|
| 868 |
</div>
|
|
|
|
| 870 |
</div>
|
| 871 |
</div>
|
| 872 |
|
| 873 |
+
<div class="space-y-3 pt-3 border-t border-gray-200">
|
| 874 |
<!-- Exaggeration control -->
|
| 875 |
<div>
|
| 876 |
+
<div class="flex justify-between mb-0.5">
|
| 877 |
+
<label for="exaggeration-slider" class="text-xs font-medium text-gray-700"
|
| 878 |
>Exaggeration</label
|
| 879 |
>
|
| 880 |
+
<span class="text-xs text-gray-500">{exaggeration.toFixed(2)}</span>
|
| 881 |
</div>
|
| 882 |
<input
|
| 883 |
id="exaggeration-slider"
|
|
|
|
| 888 |
step="0.01"
|
| 889 |
class="w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"
|
| 890 |
/>
|
| 891 |
+
<div class="flex justify-between text-xs text-gray-400 mt-0.5">
|
| 892 |
<span>None</span>
|
| 893 |
<span>Exaggerated</span>
|
| 894 |
</div>
|
|
|
|
| 896 |
|
| 897 |
<!-- Stability control -->
|
| 898 |
<div>
|
| 899 |
+
<div class="flex justify-between mb-0.5">
|
| 900 |
+
<label for="temperature-slider" class="text-xs font-medium text-gray-700"
|
| 901 |
>Stability</label
|
| 902 |
>
|
| 903 |
+
<span class="text-xs text-gray-500">{temperature.toFixed(2)}</span>
|
| 904 |
</div>
|
| 905 |
<input
|
| 906 |
id="temperature-slider"
|
|
|
|
| 911 |
step="0.01"
|
| 912 |
class="w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"
|
| 913 |
/>
|
| 914 |
+
<div class="flex justify-between text-xs text-gray-400 mt-0.5">
|
| 915 |
<span>More stable</span>
|
| 916 |
<span>More variable</span>
|
| 917 |
</div>
|
| 918 |
</div>
|
| 919 |
</div>
|
| 920 |
+
|
| 921 |
+
<!-- GitHub link at bottom -->
|
| 922 |
+
<div class="mt-auto pt-3 flex justify-end">
|
| 923 |
+
<a
|
| 924 |
+
href="https://github.com/gradio-app/hfstudio"
|
| 925 |
+
target="_blank"
|
| 926 |
+
class="p-2 text-gray-400 hover:text-gray-600 transition-colors"
|
| 927 |
+
title="View on GitHub"
|
| 928 |
+
>
|
| 929 |
+
<svg
|
| 930 |
+
xmlns="http://www.w3.org/2000/svg"
|
| 931 |
+
width="20"
|
| 932 |
+
height="20"
|
| 933 |
+
viewBox="0 0 24 24"
|
| 934 |
+
fill="currentColor"
|
| 935 |
+
>
|
| 936 |
+
<path
|
| 937 |
+
d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"
|
| 938 |
+
/>
|
| 939 |
+
</svg>
|
| 940 |
+
</a>
|
| 941 |
+
</div>
|
| 942 |
</div>
|
| 943 |
</div>
|
| 944 |
{:else}
|
hfstudio/server.py
CHANGED
|
@@ -97,6 +97,11 @@ static_dir = Path(__file__).parent / "static"
|
|
| 97 |
models_dir = Path(__file__).parent.parent / "models"
|
| 98 |
|
| 99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
def load_model_spec(model_id: str) -> Optional[Dict[str, Any]]:
|
| 101 |
"""Load model specification from JSON file."""
|
| 102 |
spec_path = models_dir / model_id / "spec.json"
|
|
@@ -219,7 +224,12 @@ async def root():
|
|
| 219 |
|
| 220 |
@app.get("/api/status")
|
| 221 |
async def get_status():
|
| 222 |
-
return {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 223 |
|
| 224 |
|
| 225 |
@app.get("/api/auth/oauth-config")
|
|
@@ -233,14 +243,14 @@ async def get_oauth_config():
|
|
| 233 |
"OAUTH_CLIENT_ID", "cdf32a17-e40f-4a84-b683-f66aa1105793"
|
| 234 |
),
|
| 235 |
"scopes": scopes,
|
| 236 |
-
"is_spaces":
|
| 237 |
}
|
| 238 |
|
| 239 |
|
| 240 |
@app.get("/api/auth/local-token")
|
| 241 |
async def get_local_token():
|
| 242 |
try:
|
| 243 |
-
if
|
| 244 |
return {"available": False, "reason": "running_on_spaces"}
|
| 245 |
|
| 246 |
token = get_token()
|
|
@@ -341,14 +351,21 @@ async def validate_manual_token(request: ManualTokenRequest, response: Response)
|
|
| 341 |
# Create session and set cookie
|
| 342 |
session_id = create_session(request.token, user_info)
|
| 343 |
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 352 |
|
| 353 |
return {"success": True, "user_info": user_info}
|
| 354 |
|
|
@@ -359,9 +376,15 @@ async def validate_manual_token(request: ManualTokenRequest, response: Response)
|
|
| 359 |
|
| 360 |
|
| 361 |
@app.get("/api/auth/user")
|
| 362 |
-
async def get_current_user(
|
|
|
|
|
|
|
| 363 |
"""Get current user info from session."""
|
| 364 |
if not session:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 365 |
raise HTTPException(status_code=401, detail="Not authenticated")
|
| 366 |
|
| 367 |
return {"authenticated": True, "user_info": session["user_info"]}
|
|
@@ -445,9 +468,17 @@ async def exchange_oauth_token(request: OAuthTokenRequest, http_request: Request
|
|
| 445 |
"OAUTH_CLIENT_SECRET", "f590cb2d-6eac-4cef-a0cb-d0116825295c"
|
| 446 |
)
|
| 447 |
|
| 448 |
-
if
|
| 449 |
-
|
| 450 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 451 |
else:
|
| 452 |
referer = http_request.headers.get("referer", "")
|
| 453 |
if referer:
|
|
@@ -520,9 +551,17 @@ async def oauth_callback(
|
|
| 520 |
"OAUTH_CLIENT_SECRET", "f590cb2d-6eac-4cef-a0cb-d0116825295c"
|
| 521 |
)
|
| 522 |
|
| 523 |
-
if
|
| 524 |
-
|
| 525 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 526 |
else:
|
| 527 |
redirect_uri = "http://localhost:7860/auth/callback"
|
| 528 |
|
|
@@ -567,14 +606,20 @@ async def oauth_callback(
|
|
| 567 |
""")
|
| 568 |
|
| 569 |
# Set HTTP-only, secure session cookie
|
| 570 |
-
|
| 571 |
-
key
|
| 572 |
-
value
|
| 573 |
-
httponly
|
| 574 |
-
secure
|
| 575 |
-
samesite
|
| 576 |
-
max_age
|
| 577 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 578 |
|
| 579 |
return html_response
|
| 580 |
else:
|
|
|
|
| 97 |
models_dir = Path(__file__).parent.parent / "models"
|
| 98 |
|
| 99 |
|
| 100 |
+
def is_running_on_spaces() -> bool:
|
| 101 |
+
"""Check if running on HuggingFace Spaces using SPACE_ID environment variable."""
|
| 102 |
+
return bool(os.getenv("SPACE_ID"))
|
| 103 |
+
|
| 104 |
+
|
| 105 |
def load_model_spec(model_id: str) -> Optional[Dict[str, Any]]:
|
| 106 |
"""Load model specification from JSON file."""
|
| 107 |
spec_path = models_dir / model_id / "spec.json"
|
|
|
|
| 224 |
|
| 225 |
@app.get("/api/status")
|
| 226 |
async def get_status():
|
| 227 |
+
return {
|
| 228 |
+
"mode": "api",
|
| 229 |
+
"local_available": False,
|
| 230 |
+
"api_configured": True,
|
| 231 |
+
"is_spaces": is_running_on_spaces(),
|
| 232 |
+
}
|
| 233 |
|
| 234 |
|
| 235 |
@app.get("/api/auth/oauth-config")
|
|
|
|
| 243 |
"OAUTH_CLIENT_ID", "cdf32a17-e40f-4a84-b683-f66aa1105793"
|
| 244 |
),
|
| 245 |
"scopes": scopes,
|
| 246 |
+
"is_spaces": is_running_on_spaces(),
|
| 247 |
}
|
| 248 |
|
| 249 |
|
| 250 |
@app.get("/api/auth/local-token")
|
| 251 |
async def get_local_token():
|
| 252 |
try:
|
| 253 |
+
if is_running_on_spaces():
|
| 254 |
return {"available": False, "reason": "running_on_spaces"}
|
| 255 |
|
| 256 |
token = get_token()
|
|
|
|
| 351 |
# Create session and set cookie
|
| 352 |
session_id = create_session(request.token, user_info)
|
| 353 |
|
| 354 |
+
# Set cookie with appropriate settings for Spaces
|
| 355 |
+
cookie_kwargs = {
|
| 356 |
+
"key": "hf_session",
|
| 357 |
+
"value": session_id,
|
| 358 |
+
"httponly": True,
|
| 359 |
+
"secure": is_running_on_spaces(),
|
| 360 |
+
"samesite": "lax",
|
| 361 |
+
"max_age": SESSION_TIMEOUT,
|
| 362 |
+
}
|
| 363 |
+
|
| 364 |
+
# On Spaces, don't set domain to allow subdomain cookies
|
| 365 |
+
if not is_running_on_spaces():
|
| 366 |
+
cookie_kwargs["domain"] = None
|
| 367 |
+
|
| 368 |
+
response.set_cookie(**cookie_kwargs)
|
| 369 |
|
| 370 |
return {"success": True, "user_info": user_info}
|
| 371 |
|
|
|
|
| 376 |
|
| 377 |
|
| 378 |
@app.get("/api/auth/user")
|
| 379 |
+
async def get_current_user(
|
| 380 |
+
request: Request, session: Dict[str, Any] = Depends(get_current_session)
|
| 381 |
+
):
|
| 382 |
"""Get current user info from session."""
|
| 383 |
if not session:
|
| 384 |
+
# Log for debugging on Spaces
|
| 385 |
+
print(
|
| 386 |
+
f"No session found. Is Spaces: {is_running_on_spaces()}, Cookies: {request.cookies}"
|
| 387 |
+
)
|
| 388 |
raise HTTPException(status_code=401, detail="Not authenticated")
|
| 389 |
|
| 390 |
return {"authenticated": True, "user_info": session["user_info"]}
|
|
|
|
| 468 |
"OAUTH_CLIENT_SECRET", "f590cb2d-6eac-4cef-a0cb-d0116825295c"
|
| 469 |
)
|
| 470 |
|
| 471 |
+
if is_running_on_spaces():
|
| 472 |
+
# On Spaces, construct URL from SPACE_ID
|
| 473 |
+
space_id = os.getenv("SPACE_ID")
|
| 474 |
+
if space_id:
|
| 475 |
+
redirect_uri = (
|
| 476 |
+
f"https://{space_id.replace('/', '-')}.hf.space/auth/callback"
|
| 477 |
+
)
|
| 478 |
+
else:
|
| 479 |
+
# Fallback to SPACE_HOST if available
|
| 480 |
+
space_host = os.getenv("SPACE_HOST", "unknown").split(",")[0]
|
| 481 |
+
redirect_uri = f"https://{space_host}/auth/callback"
|
| 482 |
else:
|
| 483 |
referer = http_request.headers.get("referer", "")
|
| 484 |
if referer:
|
|
|
|
| 551 |
"OAUTH_CLIENT_SECRET", "f590cb2d-6eac-4cef-a0cb-d0116825295c"
|
| 552 |
)
|
| 553 |
|
| 554 |
+
if is_running_on_spaces():
|
| 555 |
+
# On Spaces, construct URL from SPACE_ID
|
| 556 |
+
space_id = os.getenv("SPACE_ID")
|
| 557 |
+
if space_id:
|
| 558 |
+
redirect_uri = (
|
| 559 |
+
f"https://{space_id.replace('/', '-')}.hf.space/auth/callback"
|
| 560 |
+
)
|
| 561 |
+
else:
|
| 562 |
+
# Fallback to SPACE_HOST if available
|
| 563 |
+
space_host = os.getenv("SPACE_HOST", "unknown").split(",")[0]
|
| 564 |
+
redirect_uri = f"https://{space_host}/auth/callback"
|
| 565 |
else:
|
| 566 |
redirect_uri = "http://localhost:7860/auth/callback"
|
| 567 |
|
|
|
|
| 606 |
""")
|
| 607 |
|
| 608 |
# Set HTTP-only, secure session cookie
|
| 609 |
+
cookie_kwargs = {
|
| 610 |
+
"key": "hf_session",
|
| 611 |
+
"value": session_id,
|
| 612 |
+
"httponly": True,
|
| 613 |
+
"secure": is_running_on_spaces(), # Secure in production
|
| 614 |
+
"samesite": "lax",
|
| 615 |
+
"max_age": SESSION_TIMEOUT,
|
| 616 |
+
}
|
| 617 |
+
|
| 618 |
+
# On Spaces, don't set domain to allow subdomain cookies
|
| 619 |
+
if not is_running_on_spaces():
|
| 620 |
+
cookie_kwargs["domain"] = None
|
| 621 |
+
|
| 622 |
+
html_response.set_cookie(**cookie_kwargs)
|
| 623 |
|
| 624 |
return html_response
|
| 625 |
else:
|
hfstudio/static/_app/immutable/assets/0.BqmMj_TK.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}.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-56{left:14rem}.right-0{right:0}.right-2{right:.5rem}.right-4{right:1rem}.right-80{right:20rem}.top-2{top:.5rem}.top-full{top:100%}.z-10{z-index:10}.z-50{z-index:50}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-0\.5{margin-bottom:.125rem}.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-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-auto{margin-top:auto}.block{display:block}.flex{display:flex}.contents{display:contents}.hidden{display:none}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-2{height:.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-\[18px\]{height:18px}.h-full{height:100%}.h-screen{height:100vh}.max-h-\[80vh\]{max-height:80vh}.min-h-0{min-height:0px}.w-10{width:2.5rem}.w-12{width:3rem}.w-2{width:.5rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-80{width:20rem}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[18px\]{min-width:18px}.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}.scale-150{--tw-scale-x: 1.5;--tw-scale-y: 1.5;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}.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-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * 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-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}.border{border-width:1px}.border-0{border-width:0px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / 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-transparent{border-color:transparent}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / 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-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / 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-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / 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-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-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-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / 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-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-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}.bg-right{background-position:right}.bg-no-repeat{background-repeat:no-repeat}.p-0\.5{padding:.125rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.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-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-3{padding-top:.75rem;padding-bottom:.75rem}.pb-24{padding-bottom:6rem}.pr-10{padding-right:2.5rem}.pr-4{padding-right:1rem}.pt-3{padding-top:.75rem}.text-left{text-align:left}.text-center{text-align:center}.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}.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-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-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-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)}.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}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\:bg-amber-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / 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-orange-600:hover{--tw-bg-opacity: 1;background-color:rgb(234 88 12 / 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))}.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}@keyframes svelte-1s3xy1i-sweep{0%{transform:translate(-100%)}to{transform:translate(300%)}}.animate-sweep.svelte-1s3xy1i{animation:svelte-1s3xy1i-sweep 1.6s linear forwards}
|
hfstudio/static/_app/immutable/chunks/DzjgK6hA.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
var St=Object.defineProperty;var kt=(e,t,n)=>t in e?St(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var R=(e,t,n)=>kt(e,typeof t!="symbol"?t+"":t,n);import{S as Et,F as At,Z as Rt,_ as Tt,$ as It,a0 as Ut,a1 as Lt,a2 as $t,z as ve,a3 as xt,G as be,n as ge,s as Ct}from"./MT0Fezl8.js";class Ze extends Et{constructor(n){if(!n||!n.target&&!n.$$inline)throw new Error("'target' is a required option");super();R(this,"$$prop_def");R(this,"$$events_def");R(this,"$$slot_def")}$destroy(){super.$destroy(),this.$destroy=()=>{console.warn("Component was already destroyed")}}$capture_state(){}$inject_state(){}}class Pt extends Ze{}const Ot=Object.freeze(Object.defineProperty({__proto__:null,SvelteComponent:Ze,SvelteComponentTyped:Pt,afterUpdate:At,beforeUpdate:Rt,createEventDispatcher:Tt,getAllContexts:It,getContext:Ut,hasContext:Lt,onDestroy:$t,onMount:ve,setContext:xt,tick:be},Symbol.toStringTag,{value:"Module"}));class ie{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Re{constructor(t,n){this.status=t,this.location=n}}class Te extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function jt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function Nt(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 qt(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 Bt=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 Vt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:(t==null?void 0:t.method)||"GET")!=="GET"&&Y.delete(Ie(e)),Vt(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 zt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Ht(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Wt(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return t.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,l)=>{if(l%2){if(c.startsWith("x+"))return _e(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return _e(String.fromCharCode(...c.slice(2).split("-").map(u=>parseInt(u,16))));const d=zt.exec(c),[,h,y,f,p]=d;return t.push({name:f,matcher:p,optional:!!h,rest:!!y,chained:y?l===1&&i[0]==="":!1}),y?"([^]*?)":h?"([^/]*)?":"([^/]+?)"}return _e(c)}).join("")}).join("")}/?$`),params:t}}function Kt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Wt(e){return e.slice(1).split("/").filter(Kt)}function Jt(e,t,n){const r={},a=e.slice(1),s=a.filter(o=>o!==void 0);let i=0;for(let o=0;o<t.length;o+=1){const c=t[o];let l=a[o-i];if(c.chained&&c.rest&&i&&(l=a.slice(o-i,o+1).filter(d=>d).join("/"),i=0),l===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||n[c.matcher](l)){r[c.name]=l;const d=t[o+1],h=a[o+1];d&&!d.rest&&d.optional&&h&&c.chained&&(i=0),!d&&!h&&Object.keys(r).length===s.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function _e(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Xt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[c,l,d]])=>{const{pattern:h,params:y}=Ht(o),f={id:o,exec:p=>{const u=h.exec(p);if(u)return Jt(u,y,r)},errors:[1,...d||[]].map(p=>e[p]),layouts:[0,...l||[]].map(i),leaf:s(c)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function s(o){const c=o<0;return c&&(o=~o),[c,e[o]]}function i(o){return o===void 0?o:[a.has(o),e[o]]}}function Qe(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function 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_jql70e)==null?void 0:Je.base)??"";var Xe;const Zt=((Xe=globalThis.__sveltekit_jql70e)==null?void 0:Xe.assets)??$??"",Qt="1761161939593",et="sveltekit:snapshot",tt="sveltekit:scroll",nt="sveltekit:states",en="sveltekit:pageurl",F="sveltekit:history",K="sveltekit:navigation",O={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},ce=location.origin;function at(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function le(){return{x:pageXOffset,y:pageYOffset}}function q(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Be={...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=q(o,"preload-code")),a===null&&(a=q(o,"preload-data")),t===null&&(t=q(o,"keepfocus")),n===null&&(n=q(o,"noscroll")),s===null&&(s=q(o,"reload")),i===null&&(i=q(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:Be[r??"off"],preload_data:Be[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 Vn(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 Ve={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"]),N=Qe(tt)??{},J=Qe(et)??{},C={url:Me({}),page:Me({}),navigating:Ue(null),updated:tn()};function Le(e){N[e]=le()}function Rn(e,t){let n=e+1;for(;N[n];)delete N[n],n+=1;for(n=t+1;J[n];)delete J[n],n+=1}function V(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function ct(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration($||"/");e&&await e.update()}}function Ge(){}let $e,ke,te,x,Ee,k;const ne=[],ae=[];let U=null;const Z=new Map,lt=new Set,Tn=new Set,z=new Set;let b={branch:[],error:null,url:null},xe=!1,re=!1,Ye=!0,X=!1,G=!1,ft=!1,Ce=!1,ut,A,L,j;const H=new Set,ze=new Map;async function Hn(e,t,n){var s,i,o,c,l;(s=globalThis.__sveltekit_jql70e)!=null&&s.data&&globalThis.__sveltekit_jql70e.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[K],A||(A=L=Date.now(),history.replaceState({...history.state,[F]:A,[K]:L},""));const r=N[A];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await Dn(Ee,n)):(await B({type:"enter",url:at(k.hash?Fn(new URL(location.href)):location.href),replace_state:!0}),a()),Nn()}function In(){ne.length=0,Ce=!1}function dt(e){ae.some(t=>t==null?void 0:t.snapshot)&&(J[e]=ae.map(t=>{var n;return(n=t==null?void 0:t.snapshot)==null?void 0:n.capture()}))}function ht(e){var t;(t=J[e])==null||t.forEach((n,r)=>{var a,s;(s=(a=ae[r])==null?void 0:a.snapshot)==null||s.restore(n)})}function He(){Le(A),Fe(tt,N),dt(L),Fe(et,J)}async function Un(e,t,n,r){let a;t.invalidateAll&&(U=null),await B({type:"goto",url:at(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Ce=!0,a=[...ze.keys()]),t.invalidate&&t.invalidate.forEach(jn)}}),t.invalidateAll&&be().then(be).then(()=>{ze.forEach(({resource:s},i)=>{var o;a!=null&&a.includes(i)&&((o=s.refresh)==null||o.call(s))})})}async function Ln(e){if(e.id!==(U==null?void 0:U.id)){const t={};H.add(t),U={id:e.id,token:t,promise:mt({...e,preload:t}).then(n=>(H.delete(t),n.type==="loaded"&&n.state.error&&(U=null),n))}}return U.promise}async function ye(e){var n;const t=(n=await de(e,!1))==null?void 0:n.route;t&&await Promise.all([...t.layouts,t.leaf].map(r=>r==null?void 0:r[1]()))}function pt(e,t,n){var a;b=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(T,e.props.page),ut=new k.root({target:t,props:{...e.props,stores:C,components:ae},hydrate:n,sync:!1}),ht(L),n){const s={from:null,to:{params:b.params,route:{id:((a=b.route)==null?void 0:a.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};z.forEach(i=>i(s))}re=!0}function oe({url:e,params:t,branch:n,status:r,error:a,route:s,form:i}){let o="never";if($&&(e.pathname===$||e.pathname===$+"/"))o="always";else for(const f of n)(f==null?void 0:f.slash)!==void 0&&(o=f.slash);e.pathname=jt(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:Ne(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:Ve,current:Ve},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:qt(n,()=>{o&&(c.url=!0)},u=>{o&&c.search_params.add(u)},k.hash),async fetch(u,g){u instanceof Request&&(g={body:u.method==="GET"||u.method==="HEAD"?void 0:await u.blob(),cache:u.cache,credentials:u.credentials,headers:[...u.headers].length>0?u==null?void 0:u.headers:void 0,integrity:u.integrity,keepalive:u.keepalive,method:u.method,mode:u.mode,redirect:u.redirect,referrer:u.referrer,referrerPolicy:u.referrerPolicy,signal:u.signal,...g});const{resolved:_,promise:I}=gt(u,g,n);return o&&f(_.href),I},setHeaders:()=>{},depends:f,parent(){return o&&(c.parent=!0),t()},untrack(u){o=!1;try{return u()}finally{o=!0}}};i=await l.universal.load.call(null,p)??null}return{node:l,loader:e,server:s,universal:(h=l.universal)!=null&&h.load?{type:"data",data:i,uses:c}:null,data:i??(s==null?void 0:s.data)??null,slash:((y=l.universal)==null?void 0:y.trailingSlash)??(s==null?void 0:s.slash)}}function gt(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const s=re?Yt(r,a.href,t):Gt(r,t);return{resolved:a,promise:s}}function Ke(e,t,n,r,a,s){if(Ce)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(s[i]!==b.params[i])return!0;for(const i of a.dependencies)if(ne.some(o=>o(new URL(i))))return!0;return!1}function Oe(e,t){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?t??null:null}function $n(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),s=t.searchParams.getAll(r);a.every(i=>s.includes(i))&&s.every(i=>a.includes(i))&&n.delete(r)}return n}function We({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Ne(T),constructors:[]}}}async function mt({id:e,invalidating:t,url:n,params:r,route:a,preload:s}){if((U==null?void 0:U.id)===e)return H.delete(U.token),U.promise;const{errors:i,layouts:o,leaf:c}=a,l=[...o,c];i.forEach(w=>w==null?void 0:w().catch(()=>{})),l.forEach(w=>w==null?void 0:w[1]().catch(()=>{}));let d=null;const h=b.url?e!==se(b.url):!1,y=b.route?a.id!==b.route.id:!1,f=$n(b.url,n);let p=!1;const u=l.map((w,m)=>{var P;const v=b.branch[m],S=!!(w!=null&&w[0])&&((v==null?void 0:v.loader)!==w[1]||Ke(p,y,h,f,(P=v.server)==null?void 0:P.uses,r));return S&&(p=!0),S});if(u.some(Boolean)){try{d=await yt(n,u)}catch(w){const m=await M(w,{url:n,params:r,route:{id:e}});return H.has(s)?We({error:m,url:n,params:r,route:a}):ue({status:ee(w),error:m,url:n,route:a})}if(d.type==="redirect")return d}const g=d==null?void 0:d.nodes;let _=!1;const I=l.map(async(w,m)=>{var he;if(!w)return;const v=b.branch[m],S=g==null?void 0:g[m];if((!S||S.type==="skip")&&w[1]===(v==null?void 0:v.loader)&&!Ke(_,y,h,f,(he=v.universal)==null?void 0:he.uses,r))return v;if(_=!0,(S==null?void 0:S.type)==="error")throw S;return Pe({loader:w[1],url:n,params:r,route:a,parent:async()=>{var qe;const De={};for(let pe=0;pe<m;pe+=1)Object.assign(De,(qe=await I[pe])==null?void 0:qe.data);return De},server_data_node:Oe(S===void 0&&w[0]?{type:"skip"}:S??null,w[0]?v==null?void 0:v.server:void 0)})});for(const w of I)w.catch(()=>{});const E=[];for(let w=0;w<l.length;w+=1)if(l[w])try{E.push(await I[w])}catch(m){if(m instanceof Re)return{type:"redirect",location:m.location};if(H.has(s))return We({error:await 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 V(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 V(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 Nt(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=je(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 B({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=j;j=c;const f=await de(t,!1),p=e==="enter"?je(b,f,t,e):_t({url:t,type:e,delta:n==null?void 0:n.delta,intent:f,event:h});if(!p){d(),j===c&&(j=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 V(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,j!==c)return p.reject(new Error("navigation aborted")),!1;if(_.type==="redirect"){if(o<20){await B({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 V(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,[K]:L+=m,[nt]:i};(s?history.replaceState:history.pushState).call(history,v,"",t),s||Rn(A,L)}if(U=null,_.props.page.state=i,re){const m=(await Promise.all(Array.from(Tn,v=>v(p.navigation)))).filter(v=>typeof v=="function");if(m.length>0){let v=function(){m.forEach(S=>{z.delete(S)})};m.push(v),m.forEach(S=>{z.add(S)})}b=_.state,_.props.page&&(_.props.page.url=t),ut.$set(_.props),yn(_.props.page),ft=!0}else pt(_,Ee,!1);const{activeElement:I}=document;await En();let E=n?n.scroll:a?le():null;if(Ye){const m=t.hash&&document.getElementById(bt(t));if(E)scrollTo(E.x,E.y);else if(m){m.scrollIntoView();const{top:v,left:S}=m.getBoundingClientRect();E={x:pageXOffset+S,y:pageYOffset+v}}else scrollTo(0,0)}const w=document.activeElement!==I&&document.activeElement!==document.body;!r&&!w&&qn(t,E),Ye=!0,_.props.page&&Object.assign(T,_.props.page),X=!1,e==="popstate"&&ht(L),p.fulfil(void 0),z.forEach(m=>m(p.navigation)),C.navigating.set(W.current=null)}async function wt(e,t,n,r,a){return e.origin===ce&&e.pathname===location.pathname&&!xe?await ue({status:r,error:n,url:e,route:t}):await V(e,a)}function On(){let e,t,n;x.addEventListener("mousemove",o=>{const c=o.target;clearTimeout(e),e=setTimeout(()=>{s(c,O.hover)},20)});function r(o){o.defaultPrevented||s(o.composedPath()[0],O.tap)}x.addEventListener("mousedown",r),x.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const c of o)c.isIntersecting&&(ye(new URL(c.target.href)),a.unobserve(c.target))},{threshold:0});async function s(o,c){const l=ot(o,x),d=l===t&&c>=n;if(!l||d)return;const{url:h,external:y,download:f}=Se(l,$,k.hash);if(y||f)return;const p=Q(l),u=h&&se(b.url)===se(h);if(!(p.reload||u))if(c<=p.preload_data){t=l,n=O.tap;const g=await de(h,!1);if(!g)return;Ln(g)}else c<=p.preload_code&&(t=l,n=c,ye(h))}function i(){a.disconnect();for(const o of x.querySelectorAll("a")){const{url:c,external:l,download:d}=Se(o,$,k.hash);if(l||d)continue;const h=Q(o);h.reload||(h.preload_code===O.viewport&&a.observe(o),h.preload_code===O.eager&&ye(c))}}z.add(i),i()}function 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 jn(e){if(typeof e=="function")ne.push(e);else{const{href:t}=new URL(e,location.href);ne.push(n=>n.href===t)}}function Nn(){var t;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let r=!1;if(He(),!X){const a=je(b,void 0,null,"leave"),s={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};lt.forEach(i=>i(s))}r?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&He()}),(t=navigator.connection)!=null&&t.saveData||On(),x.addEventListener("click",async n=>{if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const r=ot(n.composedPath()[0],x);if(!r)return;const{url:a,external:s,target:i,download:o}=Se(r,$,k.hash);if(!a)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const c=Q(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||o)return;const[d,h]=(k.hash?a.hash.replace(/^#/,""):a.href).split("#"),y=d===me(location);if(s||c.reload&&(!y||!h)){_t({url:a,type:"link",event:n})?X=!0:n.preventDefault();return}if(h!==void 0&&y){const[,f]=b.url.href.split("#");if(f===h){if(n.preventDefault(),h===""||h==="top"&&r.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const p=r.ownerDocument.getElementById(decodeURIComponent(h));p&&(p.scrollIntoView(),p.focus())}return}if(G=!0,Le(A),e(a),!c.replace_state)return;G=!1}n.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await B({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(),B({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(j={},a===A)return;const s=N[a],i=n.state[nt]??{},o=new URL(n.state[en]??location.href),c=n.state[K],l=b.url?me(location)===me(b.url):!1;if(c===L&&(ft||l)){i!==T.state&&(T.state=i),e(o),N[A]=le(),s&&scrollTo(s.x,s.y),A=a;return}const h=a-A;await B({type:"popstate",url:o,popped:{state:i,scroll:s,delta:h},accept:()=>{A=a,L=c},block:()=>{history.go(-h)},nav_token:j,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,[K]:L},"",location.href))});for(const n of document.querySelectorAll("link"))An.has(n.rel)&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&C.navigating.set(W.current=null)});function e(n){b.url=T.url=n,C.page.set(Ne(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 V(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 |
+
`:Bt.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 qn(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 je(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 Ne(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{Hn as a,Vn as l,C as s};
|
hfstudio/static/_app/immutable/entry/app.nVU5EqYr.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.Bl1mwlCJ.js","../chunks/MT0Fezl8.js","../chunks/IHki7fMi.js","../assets/0.BqmMj_TK.css","../nodes/1.SnSFDeew.js","../chunks/DzjgK6hA.js","../nodes/2.DPbkTEMF.js","../assets/2.BoAMr1TJ.css"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{S as T,i as V,s as B,d,o as h,p as g,C as S,D as O,b as E,h as U,E as w,k as z,F,z as G,G as H,H as y,I as P,J as R,K as L,L as I,q as A,M as p,e as J,f as K,j as W,N as C,a as Q,g as X,t as Y}from"../chunks/MT0Fezl8.js";import"../chunks/IHki7fMi.js";const Z="modulepreload",M=function(o,e){return new URL(o,e).href},N={},D=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){const t=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));r=Promise.allSettled(n.map(f=>{if(f=M(f,i),f in N)return;N[f]=!0;const l=f.endsWith(".css"),_=l?'[rel="stylesheet"]':"";if(!!i)for(let k=t.length-1;k>=0;k--){const v=t[k];if(v.href===f&&(!l||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${_}`))return;const m=document.createElement("link");if(m.rel=l?"stylesheet":Z,l||(m.as="script"),m.crossOrigin="",m.href=f,a&&m.setAttribute("nonce",a),document.head.appendChild(m),l)return new Promise((k,v)=>{m.addEventListener("load",k),m.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${f}`)))})}))}function u(t){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=t,window.dispatchEvent(s),!s.defaultPrevented)throw t}return r.then(t=>{for(const s of t||[])s.status==="rejected"&&u(s.reason);return e().catch(u)})},ae={};function $(o){let e,n,i;var r=o[2][0];function u(t,s){return{props:{data:t[4],form:t[3],params:t[1].params}}}return r&&(e=y(r,u(o)),o[12](e)),{c(){e&&R(e.$$.fragment),n=w()},l(t){e&&I(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),E(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][0])){if(e){S();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),O()}r?(e=y(r,u(t)),t[12](e),R(e.$$.fragment),g(e.$$.fragment,1),L(e,n.parentNode,n)):e=null}else if(r){const a={};s&16&&(a.data=t[4]),s&8&&(a.form=t[3]),s&2&&(a.params=t[1].params),e.$set(a)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){t&&d(n),o[12](null),e&&P(e,t)}}}function x(o){let e,n,i;var r=o[2][0];function u(t,s){return{props:{data:t[4],params:t[1].params,$$slots:{default:[ee]},$$scope:{ctx:t}}}}return r&&(e=y(r,u(o)),o[11](e)),{c(){e&&R(e.$$.fragment),n=w()},l(t){e&&I(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),E(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][0])){if(e){S();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),O()}r?(e=y(r,u(t)),t[11](e),R(e.$$.fragment),g(e.$$.fragment,1),L(e,n.parentNode,n)):e=null}else if(r){const a={};s&16&&(a.data=t[4]),s&2&&(a.params=t[1].params),s&8239&&(a.$$scope={dirty:s,ctx:t}),e.$set(a)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){t&&d(n),o[11](null),e&&P(e,t)}}}function ee(o){let e,n,i;var r=o[2][1];function u(t,s){return{props:{data:t[5],form:t[3],params:t[1].params}}}return r&&(e=y(r,u(o)),o[10](e)),{c(){e&&R(e.$$.fragment),n=w()},l(t){e&&I(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),E(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][1])){if(e){S();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),O()}r?(e=y(r,u(t)),t[10](e),R(e.$$.fragment),g(e.$$.fragment,1),L(e,n.parentNode,n)):e=null}else if(r){const a={};s&32&&(a.data=t[5]),s&8&&(a.form=t[3]),s&2&&(a.params=t[1].params),e.$set(a)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){t&&d(n),o[10](null),e&&P(e,t)}}}function j(o){let e,n=o[7]&&q(o);return{c(){e=W("div"),n&&n.c(),this.h()},l(i){e=J(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var r=K(e);n&&n.l(r),r.forEach(d),this.h()},h(){A(e,"id","svelte-announcer"),A(e,"aria-live","assertive"),A(e,"aria-atomic","true"),p(e,"position","absolute"),p(e,"left","0"),p(e,"top","0"),p(e,"clip","rect(0 0 0 0)"),p(e,"clip-path","inset(50%)"),p(e,"overflow","hidden"),p(e,"white-space","nowrap"),p(e,"width","1px"),p(e,"height","1px")},m(i,r){E(i,e,r),n&&n.m(e,null)},p(i,r){i[7]?n?n.p(i,r):(n=q(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&d(e),n&&n.d()}}}function q(o){let e;return{c(){e=Y(o[8])},l(n){e=X(n,o[8])},m(n,i){E(n,e,i)},p(n,i){i&256&&Q(e,n[8])},d(n){n&&d(e)}}}function te(o){let e,n,i,r,u;const t=[x,$],s=[];function a(l,_){return l[2][1]?0:1}e=a(o),n=s[e]=t[e](o);let f=o[6]&&j(o);return{c(){n.c(),i=z(),f&&f.c(),r=w()},l(l){n.l(l),i=U(l),f&&f.l(l),r=w()},m(l,_){s[e].m(l,_),E(l,i,_),f&&f.m(l,_),E(l,r,_),u=!0},p(l,[_]){let b=e;e=a(l),e===b?s[e].p(l,_):(S(),h(s[b],1,1,()=>{s[b]=null}),O(),n=s[e],n?n.p(l,_):(n=s[e]=t[e](l),n.c()),g(n,1),n.m(i.parentNode,i)),l[6]?f?f.p(l,_):(f=j(l),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},i(l){u||(g(n),u=!0)},o(l){h(n),u=!1},d(l){l&&(d(i),d(r)),s[e].d(l),f&&f.d(l)}}}function ne(o,e,n){let{stores:i}=e,{page:r}=e,{constructors:u}=e,{components:t=[]}=e,{form:s}=e,{data_0:a=null}=e,{data_1:f=null}=e;F(i.page.notify);let l=!1,_=!1,b=null;G(()=>{const c=i.page.subscribe(()=>{l&&(n(7,_=!0),H().then(()=>{n(8,b=document.title||"untitled page")}))});return n(6,l=!0),c});function m(c){C[c?"unshift":"push"](()=>{t[1]=c,n(0,t)})}function k(c){C[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}function v(c){C[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}return o.$$set=c=>{"stores"in c&&n(9,i=c.stores),"page"in c&&n(1,r=c.page),"constructors"in c&&n(2,u=c.constructors),"components"in c&&n(0,t=c.components),"form"in c&&n(3,s=c.form),"data_0"in c&&n(4,a=c.data_0),"data_1"in c&&n(5,f=c.data_1)},o.$$.update=()=>{o.$$.dirty&514&&i.page.set(r)},[t,r,u,s,a,f,l,_,b,i,m,k,v]}class le extends T{constructor(e){super(),V(this,e,ne,te,B,{stores:9,page:1,constructors:2,components:0,form:3,data_0:4,data_1:5})}}const fe=[()=>D(()=>import("../nodes/0.Bl1mwlCJ.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),()=>D(()=>import("../nodes/1.SnSFDeew.js"),__vite__mapDeps([4,1,2,5]),import.meta.url),()=>D(()=>import("../nodes/2.DPbkTEMF.js"),__vite__mapDeps([6,1,2,7]),import.meta.url)],ce=[],ue={"/":[2]},se={handleError:({error:o})=>{console.error(o)},reroute:()=>{},transport:{}},ie=Object.fromEntries(Object.entries(se.transport).map(([o,e])=>[o,e.decode])),_e=!1,me=(o,e)=>ie[o](e);export{me as decode,ie as decoders,ue as dictionary,_e as hash,se as hooks,ae as matchers,fe as nodes,le as root,ce as server_loads};
|
hfstudio/static/_app/immutable/entry/start.BI3xAqHM.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{l as o,a as r}from"../chunks/DzjgK6hA.js";export{o as load_css,r as start};
|
hfstudio/static/_app/immutable/nodes/0.Bl1mwlCJ.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{S as Ie,i as He,s as Ee,m as Me,d as v,r as Te,o as Se,p as Ne,q as o,u as Pe,v as je,w as Ae,b as K,c as n,x as se,e as i,f as B,y as H,h as k,j as c,k as w,z as De,n as Ce,A as be,a as Le,g as pe,t as he,B as Be}from"../chunks/MT0Fezl8.js";import"../chunks/IHki7fMi.js";function ve(u){let t,e,l='<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg>',r,h,s='Hugging Face <span class="bg-gradient-to-r from-purple-500 via-pink-500 via-green-500 to-blue-500 bg-clip-text text-transparent font-bold">Pro</span>',a,x,O=`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 ‡`,d,y;return{c(){t=c("div"),e=c("button"),e.innerHTML=l,r=w(),h=c("p"),h.innerHTML=s,a=w(),x=c("p"),x.innerHTML=O,this.h()},l(N){t=i(N,"DIV",{class:!0});var L=B(t);e=i(L,"BUTTON",{class:!0,"aria-label":!0,"data-svelte-h":!0}),H(e)!=="svelte-1ywh7al"&&(e.innerHTML=l),r=k(L),h=i(L,"P",{class:!0,"data-svelte-h":!0}),H(h)!=="svelte-1mnmz00"&&(h.innerHTML=s),a=k(L),x=i(L,"P",{class:!0,"data-svelte-h":!0}),H(x)!=="svelte-p23n8l"&&(x.innerHTML=O),L.forEach(v),this.h()},h(){o(e,"class","absolute top-2 right-2 text-gray-400 hover:text-gray-600 transition-colors"),o(e,"aria-label","Dismiss"),o(h,"class","text-sm font-medium text-gray-700 mb-1 pr-4"),o(x,"class","text-sm text-gray-600 pr-4"),o(t,"class","mb-3 px-3 py-2 bg-gradient-to-r from-amber-50 to-orange-50 rounded-lg border border-amber-200 relative")},m(N,L){K(N,t,L),n(t,e),n(t,r),n(t,h),n(t,a),n(t,x),d||(y=se(e,"click",u[15]),d=!0)},p:Ce,d(N){N&&v(t),d=!1,y()}}}function xe(u){let t;return{c(){t=c("div"),this.h()},l(e){t=i(e,"DIV",{class:!0}),B(t).forEach(v),this.h()},h(){o(t,"class","absolute inset-0 -left-full animate-sweep bg-gradient-to-r from-transparent via-orange-400/40 to-transparent svelte-1s3xy1i")},m(e,l){K(e,t,l)},d(e){e&&v(t)}}}function Oe(u){let t,e,l,r,h="Sign In";return{c(){t=c("img"),l=w(),r=c("span"),r.textContent=h,this.h()},l(s){t=i(s,"IMG",{src:!0,alt:!0,class:!0}),l=k(s),r=i(s,"SPAN",{class:!0,"data-svelte-h":!0}),H(r)!=="svelte-b2ltkx"&&(r.textContent=h),this.h()},h(){Be(t.src,e="/assets/hf-logo.png")||o(t,"src",e),o(t,"alt","HF Logo"),o(t,"class","w-5 h-5 relative z-10"),o(r,"class","relative z-10")},m(s,a){K(s,t,a),K(s,l,a),K(s,r,a)},p:Ce,d(s){s&&(v(t),v(l),v(r))}}}function Ue(u){let t,e,l;return{c(){t=c("span"),e=he("Logout, "),l=he(u[2]),this.h()},l(r){t=i(r,"SPAN",{class:!0});var h=B(t);e=pe(h,"Logout, "),l=pe(h,u[2]),h.forEach(v),this.h()},h(){o(t,"class","relative z-10")},m(r,h){K(r,t,h),n(t,e),n(t,l)},p(r,h){h&4&&Le(l,r[2])},d(r){r&&v(t)}}}function ke(u){let t,e,l,r="Sign In with HuggingFace Token",h,s,a,x="<strong>Manual Token Entry:</strong> Please enter your HuggingFace token.",O,d,y=`1. Go to <a href="https://huggingface.co/settings/tokens" target="_blank" class="underline text-blue-600">HuggingFace Settings</a><br/>
|
| 3 |
+
2. Create a new token with "Inference API" permissions<br/>
|
| 4 |
+
3. Copy and paste it below`,N,L,T,P,Q="HuggingFace Token",X,_,$,W,I,z,ee="Cancel",V,R,m="Sign In",b,E,p=u[6]&&we(),f=u[5]&&ye(u);return{c(){t=c("div"),e=c("div"),l=c("h2"),l.textContent=r,h=w(),s=c("div"),a=c("p"),a.innerHTML=x,O=w(),d=c("p"),d.innerHTML=y,N=w(),p&&p.c(),L=w(),T=c("div"),P=c("label"),P.textContent=Q,X=w(),_=c("input"),$=w(),f&&f.c(),W=w(),I=c("div"),z=c("button"),z.textContent=ee,V=w(),R=c("button"),R.textContent=m,this.h()},l(C){t=i(C,"DIV",{class:!0});var q=B(t);e=i(q,"DIV",{class:!0});var S=B(e);l=i(S,"H2",{class:!0,"data-svelte-h":!0}),H(l)!=="svelte-1t0ehet"&&(l.textContent=r),h=k(S),s=i(S,"DIV",{class:!0});var J=B(s);a=i(J,"P",{class:!0,"data-svelte-h":!0}),H(a)!=="svelte-344vn4"&&(a.innerHTML=x),O=k(J),d=i(J,"P",{class:!0,"data-svelte-h":!0}),H(d)!=="svelte-orsfwv"&&(d.innerHTML=y),N=k(J),p&&p.l(J),J.forEach(v),L=k(S),T=i(S,"DIV",{class:!0});var M=B(T);P=i(M,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),H(P)!=="svelte-vtbmxo"&&(P.textContent=Q),X=k(M),_=i(M,"INPUT",{id:!0,type:!0,placeholder:!0,class:!0}),$=k(M),f&&f.l(M),M.forEach(v),W=k(S),I=i(S,"DIV",{class:!0});var Z=B(I);z=i(Z,"BUTTON",{class:!0,"data-svelte-h":!0}),H(z)!=="svelte-csk0rj"&&(z.textContent=ee),V=k(Z),R=i(Z,"BUTTON",{class:!0,"data-svelte-h":!0}),H(R)!=="svelte-1nxas5u"&&(R.textContent=m),Z.forEach(v),S.forEach(v),q.forEach(v),this.h()},h(){o(l,"class","text-xl font-semibold mb-4"),o(a,"class","text-blue-800 mb-2"),o(d,"class","text-blue-700"),o(s,"class","mb-4 p-3 bg-blue-50 rounded-md text-sm"),o(P,"for","token"),o(P,"class","block text-sm font-medium text-gray-700 mb-2"),o(_,"id","token"),o(_,"type","password"),o(_,"placeholder","hf_..."),o(_,"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"),o(T,"class","mb-4"),o(z,"class","px-4 py-2 text-gray-600 hover:text-gray-800 transition-colors"),o(R,"class","px-4 py-2 bg-orange-500 text-white rounded-md hover:bg-orange-600 transition-colors"),o(I,"class","flex justify-end gap-3"),o(e,"class","bg-white rounded-lg p-6 max-w-md w-full mx-4 shadow-xl"),o(t,"class","fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50")},m(C,q){K(C,t,q),n(t,e),n(e,l),n(e,h),n(e,s),n(s,a),n(s,O),n(s,d),n(s,N),p&&p.m(s,null),n(e,L),n(e,T),n(T,P),n(T,X),n(T,_),be(_,u[4]),n(T,$),f&&f.m(T,null),n(e,W),n(e,I),n(I,z),n(I,V),n(I,R),b||(E=[se(_,"input",u[16]),se(_,"keydown",u[17]),se(z,"click",u[10]),se(R,"click",u[11])],b=!0)},p(C,q){C[6]?p||(p=we(),p.c(),p.m(s,null)):p&&(p.d(1),p=null),q&16&&_.value!==C[4]&&be(_,C[4]),C[5]?f?f.p(C,q):(f=ye(C),f.c(),f.m(T,null)):f&&(f.d(1),f=null)},d(C){C&&v(t),p&&p.d(),f&&f.d(),b=!1,Te(E)}}}function we(u){let t,e=`<strong>Tip:</strong> You can also run <code>huggingface-cli login</code> in your terminal
|
| 5 |
+
to automatically use your local token.`;return{c(){t=c("p"),t.innerHTML=e,this.h()},l(l){t=i(l,"P",{class:!0,"data-svelte-h":!0}),H(t)!=="svelte-xrut8w"&&(t.innerHTML=e),this.h()},h(){o(t,"class","text-blue-600 mt-2")},m(l,r){K(l,t,r)},d(l){l&&v(t)}}}function ye(u){let t,e;return{c(){t=c("p"),e=he(u[5]),this.h()},l(l){t=i(l,"P",{class:!0});var r=B(t);e=pe(r,u[5]),r.forEach(v),this.h()},h(){o(t,"class","text-red-600 text-sm mt-1")},m(l,r){K(l,t,r),n(t,e)},p(l,r){r&32&&Le(e,l[5])},d(l){l&&v(t)}}}function Ve(u){let t,e,l,r='<div class="flex items-center gap-3"><img src="/assets/hf-studio-logo.png" alt="HF Logo" class="w-8 h-8"/> <h1 class="text-xl font-semibold">HFStudio<sup class="text-xs text-gray-500 ml-1">BETA</sup></h1></div>',h,s,a,x="Tasks",O,d,y,N="ποΈ",L,T,P="Text to Speech",Q,X,_,$="<span>π΅</span> <span>Voice Cloning</span>",W,I,z="<span>π§</span> <span>Speech to Text</span>",ee,V,R="<span>πΌ</span> <span>Sound Effects</span>",m,b,E="<span>πΈ</span> <span>Music Generation</span>",p,f,C="<span>π</span> <span>Audio Enhancement</span>",q,S,J,M,Z,ce,ne,ue,te,fe,me,j=!u[1]&&u[7]&&ve(u),U=u[8]&&xe();function ge(g,D){return g[1]?Ue:Oe}let oe=ge(u),Y=oe(u);const de=u[13].default,G=Me(de,u,u[12],null);let A=u[3]&&ke(u);return{c(){t=c("div"),e=c("aside"),l=c("div"),l.innerHTML=r,h=w(),s=c("nav"),a=c("div"),a.textContent=x,O=w(),d=c("button"),y=c("span"),y.textContent=N,L=w(),T=c("span"),T.textContent=P,X=w(),_=c("button"),_.innerHTML=$,W=w(),I=c("button"),I.innerHTML=z,ee=w(),V=c("button"),V.innerHTML=R,m=w(),b=c("button"),b.innerHTML=E,p=w(),f=c("button"),f.innerHTML=C,q=w(),S=c("div"),j&&j.c(),J=w(),M=c("button"),U&&U.c(),Z=w(),Y.c(),ce=w(),ne=c("main"),G&&G.c(),ue=w(),A&&A.c(),this.h()},l(g){t=i(g,"DIV",{class:!0});var D=B(t);e=i(D,"ASIDE",{class:!0});var le=B(e);l=i(le,"DIV",{class:!0,"data-svelte-h":!0}),H(l)!=="svelte-60or62"&&(l.innerHTML=r),h=k(le),s=i(le,"NAV",{class:!0});var F=B(s);a=i(F,"DIV",{class:!0,"data-svelte-h":!0}),H(a)!=="svelte-pii1fa"&&(a.textContent=x),O=k(F),d=i(F,"BUTTON",{class:!0});var ae=B(d);y=i(ae,"SPAN",{"data-svelte-h":!0}),H(y)!=="svelte-1yx42xi"&&(y.textContent=N),L=k(ae),T=i(ae,"SPAN",{"data-svelte-h":!0}),H(T)!=="svelte-2j89jk"&&(T.textContent=P),ae.forEach(v),X=k(F),_=i(F,"BUTTON",{class:!0,"data-svelte-h":!0}),H(_)!=="svelte-10dl8nf"&&(_.innerHTML=$),W=k(F),I=i(F,"BUTTON",{class:!0,"data-svelte-h":!0}),H(I)!=="svelte-wf0x5d"&&(I.innerHTML=z),ee=k(F),V=i(F,"BUTTON",{class:!0,"data-svelte-h":!0}),H(V)!=="svelte-x7bha3"&&(V.innerHTML=R),m=k(F),b=i(F,"BUTTON",{class:!0,"data-svelte-h":!0}),H(b)!=="svelte-1tyblmt"&&(b.innerHTML=E),p=k(F),f=i(F,"BUTTON",{class:!0,"data-svelte-h":!0}),H(f)!=="svelte-1emrjb3"&&(f.innerHTML=C),F.forEach(v),q=k(le),S=i(le,"DIV",{class:!0});var re=B(S);j&&j.l(re),J=k(re),M=i(re,"BUTTON",{class:!0});var ie=B(M);U&&U.l(ie),Z=k(ie),Y.l(ie),ie.forEach(v),re.forEach(v),le.forEach(v),ce=k(D),ne=i(D,"MAIN",{class:!0});var _e=B(ne);G&&G.l(_e),_e.forEach(v),ue=k(D),A&&A.l(D),D.forEach(v),this.h()},h(){o(l,"class","p-4 border-b border-gray-200"),o(a,"class","mt-2 mb-1 px-2 text-xs font-medium text-gray-500 uppercase"),o(d,"class",Q="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(u[0]==="tts"?"bg-gray-100":"")),o(_,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),_.disabled=!0,o(I,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),I.disabled=!0,o(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,o(b,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),b.disabled=!0,o(f,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),f.disabled=!0,o(s,"class","p-2 text-sm flex-1"),M.disabled=!1,o(M,"class","w-full px-6 py-3 bg-black text-white rounded-lg font-medium hover:bg-gray-800 transition-colors shadow-sm flex items-center justify-center gap-2 text-sm disabled:opacity-50 disabled:cursor-not-allowed relative overflow-hidden"),o(S,"class","p-2"),o(e,"class","w-56 border-r border-gray-200 bg-white flex-shrink-0 flex flex-col h-full "),o(ne,"class","flex-1 overflow-auto"),o(t,"class","flex h-screen bg-white")},m(g,D){K(g,t,D),n(t,e),n(e,l),n(e,h),n(e,s),n(s,a),n(s,O),n(s,d),n(d,y),n(d,L),n(d,T),n(s,X),n(s,_),n(s,W),n(s,I),n(s,ee),n(s,V),n(s,m),n(s,b),n(s,p),n(s,f),n(e,q),n(e,S),j&&j.m(S,null),n(S,J),n(S,M),U&&U.m(M,null),n(M,Z),Y.m(M,null),n(t,ce),n(t,ne),G&&G.m(ne,null),n(t,ue),A&&A.m(t,null),te=!0,fe||(me=[se(d,"click",u[14]),se(M,"click",u[9])],fe=!0)},p(g,[D]){(!te||D&1&&Q!==(Q="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(g[0]==="tts"?"bg-gray-100":"")))&&o(d,"class",Q),!g[1]&&g[7]?j?j.p(g,D):(j=ve(g),j.c(),j.m(S,J)):j&&(j.d(1),j=null),g[8]?U||(U=xe(),U.c(),U.m(M,Z)):U&&(U.d(1),U=null),oe===(oe=ge(g))&&Y?Y.p(g,D):(Y.d(1),Y=oe(g),Y&&(Y.c(),Y.m(M,null))),G&&G.p&&(!te||D&4096)&&Pe(G,de,g,g[12],te?Ae(de,g[12],D,null):je(g[12]),null),g[3]?A?A.p(g,D):(A=ke(g),A.c(),A.m(t,null)):A&&(A.d(1),A=null)},i(g){te||(Ne(G,g),te=!0)},o(g){Se(G,g),te=!1},d(g){g&&v(t),j&&j.d(),U&&U.d(),Y.d(),G&&G.d(g),A&&A.d(),fe=!1,Te(me)}}}function Fe(u,t,e){let{$$slots:l={},$$scope:r}=t,h="tts",s=typeof window<"u"&&window.__INITIAL_USER__?window.__INITIAL_USER__:{authenticated:!1},a=(s==null?void 0:s.authenticated)||!1,x=s!=null&&s.authenticated&&(s!=null&&s.user_info)?(s.user_info.name||s.user_info.fullname||s.user_info.login||s.user_info.username||"User").split(" ")[0]:"",O=!1,d="",y="",N=!1,L=!1,T=!1,P=!1;De(()=>{window.addEventListener("show-login-prompt",()=>{a||(e(7,L=!0),e(8,T=!0),setTimeout(()=>{e(8,T=!1)},1600))}),Q().then(()=>{!a&&!P&&X(),s!=null&&s.authenticated||_()}),document.addEventListener("visibilitychange",()=>{document.hidden||_()}),window.addEventListener("storage",_);const m=setInterval(_,1e3);return()=>{window.removeEventListener("storage",_),clearInterval(m)}});async function Q(){try{P=(await(await fetch("/api/status")).json()).is_spaces||!1}catch(m){console.error("Error checking Spaces status:",m),P=!1}}async function X(){if(!a)try{const b=await(await fetch("/api/auth/local-token")).json();if(b.available)if(e(6,N=!0),b.token&&!a)try{const E=await fetch("/api/auth/manual-token",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:b.token})});if(E.ok){const p=await E.json();e(1,a=!0);const f=p.user_info,C=f.name||f.fullname||f.login||f.username||"User";e(2,x=C.split(" ")[0])}}catch(E){console.error("Local token session creation failed:",E)}else b.user_info&&b.user_info.name!=="Local User"&&!a?(e(1,a=!0),e(2,x=b.user_info.name.split(" ")[0])):a||(e(1,a=!0),e(2,x="Local User"));else e(6,N=!1)}catch{e(6,N=!1)}}async function _(){if(!(s!=null&&s.authenticated&&a))try{const m=await fetch("/api/auth/user",{credentials:"include"});if(m.ok){const b=await m.json();if(b.authenticated){e(1,a=!0);const E=b.user_info,p=E.name||E.fullname||E.login||E.username||"User";e(2,x=p.split(" ")[0])}else e(1,a=!1),e(2,x="")}else e(1,a=!1),e(2,x="")}catch{e(1,a=!1),e(2,x="")}}async function $(){if(a)localStorage.removeItem("hf_access_token"),localStorage.removeItem("hf_user_info"),localStorage.removeItem("hf_cached_token"),sessionStorage.removeItem("oauth_state"),e(1,a=!1),e(2,x="");else if(P)try{const b=await(await fetch("/api/auth/oauth-config")).json(),E=b.scopes||"read-repos write-repos manage-repos inference-api",p=`https://huggingface.co/oauth/authorize?client_id=${b.client_id}&redirect_uri=${encodeURIComponent(window.location.origin+"/auth/callback")}&scope=${encodeURIComponent(E)}&response_type=code&state=${Date.now()}`;window.location.href=p}catch{e(3,O=!0),e(4,d=""),e(5,y="")}else e(3,O=!0),e(4,d=""),e(5,y="")}function W(){e(3,O=!1),e(4,d=""),e(5,y="")}async function I(){if(!d.trim()){e(5,y="Please enter a token");return}if(!d.startsWith("hf_")){e(5,y='Token should start with "hf_"');return}try{const m=await fetch("https://huggingface.co/api/whoami-v2",{headers:{Authorization:`Bearer ${d.trim()}`}});if(m.ok){const b=await m.json(),E=d.trim();try{const p=await fetch("/api/auth/manual-token",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:E})});if(p.ok){const f=await p.json();e(1,a=!0);const C=f.user_info,q=C.name||C.fullname||C.login||C.username||"User";e(2,x=q.split(" ")[0]),W()}else{const f=await p.json();e(5,y=f.detail||"Token validation failed")}}catch{e(5,y="Failed to validate token. Please try again.")}}else e(5,y=`Invalid token (${m.status}). Please check your token and try again.`)}catch{e(5,y="Error validating token. Please try again.")}}const z=()=>e(0,h="tts"),ee=()=>e(7,L=!1);function V(){d=this.value,e(4,d)}const R=m=>m.key==="Enter"&&I();return u.$$set=m=>{"$$scope"in m&&e(12,r=m.$$scope)},[h,a,x,O,d,y,N,L,T,$,W,I,r,l,z,ee,V,R]}class qe extends Ie{constructor(t){super(),He(this,t,Fe,Ve,Ee,{})}}export{qe as component};
|
hfstudio/static/_app/immutable/nodes/1.SnSFDeew.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{S,i as x,s as j,n as _,d as l,a as d,b as m,c as f,e as g,f as h,g as v,h as k,j as $,t as E,k as q,l as y}from"../chunks/MT0Fezl8.js";import"../chunks/IHki7fMi.js";import{s as C}from"../chunks/DzjgK6hA.js";const H=()=>{const s=C;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},P={subscribe(s){return H().page.subscribe(s)}};function w(s){var b;let t,r=s[0].status+"",n,o,i,c=((b=s[0].error)==null?void 0:b.message)+"",u;return{c(){t=$("h1"),n=E(r),o=q(),i=$("p"),u=E(c)},l(e){t=g(e,"H1",{});var a=h(t);n=v(a,r),a.forEach(l),o=k(e),i=g(e,"P",{});var p=h(i);u=v(p,c),p.forEach(l)},m(e,a){m(e,t,a),f(t,n),m(e,o,a),m(e,i,a),f(i,u)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&d(n,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&d(u,c)},i:_,o:_,d(e){e&&(l(t),l(o),l(i))}}}function z(s,t,r){let n;return y(s,P,o=>r(0,n=o)),[n]}let F=class extends S{constructor(t){super(),x(this,t,z,w,j,{})}};export{F as component};
|
hfstudio/static/_app/immutable/nodes/2.DPbkTEMF.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
hfstudio/static/_app/version.json
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":"
|
|
|
|
| 1 |
+
{"version":"1761161939593"}
|
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.
|
| 10 |
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
| 11 |
<link rel="modulepreload" href="/_app/immutable/chunks/MT0Fezl8.js">
|
| 12 |
-
<link rel="modulepreload" href="/_app/immutable/entry/app.
|
| 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 |
-
|
| 20 |
base: ""
|
| 21 |
};
|
| 22 |
|
| 23 |
const element = document.currentScript.parentElement;
|
| 24 |
|
| 25 |
Promise.all([
|
| 26 |
-
import("/_app/immutable/entry/start.
|
| 27 |
-
import("/_app/immutable/entry/app.
|
| 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.BI3xAqHM.js">
|
| 10 |
+
<link rel="modulepreload" href="/_app/immutable/chunks/DzjgK6hA.js">
|
| 11 |
<link rel="modulepreload" href="/_app/immutable/chunks/MT0Fezl8.js">
|
| 12 |
+
<link rel="modulepreload" href="/_app/immutable/entry/app.nVU5EqYr.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_jql70e = {
|
| 20 |
base: ""
|
| 21 |
};
|
| 22 |
|
| 23 |
const element = document.currentScript.parentElement;
|
| 24 |
|
| 25 |
Promise.all([
|
| 26 |
+
import("/_app/immutable/entry/start.BI3xAqHM.js"),
|
| 27 |
+
import("/_app/immutable/entry/app.nVU5EqYr.js")
|
| 28 |
]).then(([kit, app]) => {
|
| 29 |
kit.start(app, element);
|
| 30 |
});
|