Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Thomas G. Lopes
commited on
Commit
·
b3c3418
1
Parent(s):
6f005bf
indicator
Browse files- eslint.config.mts +3 -0
- package.json +2 -2
- pnpm-lock.yaml +82 -70
- src/lib/components/billing-indicator.svelte +75 -0
- src/lib/components/inference-playground/billing-modal.svelte +54 -11
- src/lib/components/inference-playground/playground.svelte +2 -8
- src/lib/state/billing.svelte.ts +48 -1
- src/lib/utils/organization.ts +66 -0
- svelte.config.js +6 -0
eslint.config.mts
CHANGED
@@ -32,6 +32,9 @@ export default ts.config(
|
|
32 |
// While certain Svelte settings may be statically loaded from svelte.config.js even if you don’t specify it,
|
33 |
// explicitly specifying it ensures better compatibility and functionality.
|
34 |
svelteConfig,
|
|
|
|
|
|
|
35 |
},
|
36 |
},
|
37 |
},
|
|
|
32 |
// While certain Svelte settings may be statically loaded from svelte.config.js even if you don’t specify it,
|
33 |
// explicitly specifying it ensures better compatibility and functionality.
|
34 |
svelteConfig,
|
35 |
+
svelteFeatures: {
|
36 |
+
experimentalGenerics: true,
|
37 |
+
},
|
38 |
},
|
39 |
},
|
40 |
},
|
package.json
CHANGED
@@ -60,7 +60,7 @@
|
|
60 |
"prettier-plugin-tailwindcss": "^0.6.11",
|
61 |
"runed": "^0.25.0",
|
62 |
"shiki": "^3.4.0",
|
63 |
-
"svelte": "^5.
|
64 |
"svelte-check": "^4.0.0",
|
65 |
"tailwind-merge": "^3.0.2",
|
66 |
"tailwindcss": "^4.0.9",
|
@@ -76,7 +76,7 @@
|
|
76 |
"type": "module",
|
77 |
"dependencies": {
|
78 |
"dequal": "^2.0.3",
|
79 |
-
"eslint-plugin-svelte": "^3.
|
80 |
"remult": "^3.0.2",
|
81 |
"typia": "^8.0.0"
|
82 |
},
|
|
|
60 |
"prettier-plugin-tailwindcss": "^0.6.11",
|
61 |
"runed": "^0.25.0",
|
62 |
"shiki": "^3.4.0",
|
63 |
+
"svelte": "^5.36.8",
|
64 |
"svelte-check": "^4.0.0",
|
65 |
"tailwind-merge": "^3.0.2",
|
66 |
"tailwindcss": "^4.0.9",
|
|
|
76 |
"type": "module",
|
77 |
"dependencies": {
|
78 |
"dequal": "^2.0.3",
|
79 |
+
"eslint-plugin-svelte": "^3.11.0",
|
80 |
"remult": "^3.0.2",
|
81 |
"typia": "^8.0.0"
|
82 |
},
|
pnpm-lock.yaml
CHANGED
@@ -12,8 +12,8 @@ importers:
|
|
12 |
specifier: ^2.0.3
|
13 |
version: 2.0.3
|
14 |
eslint-plugin-svelte:
|
15 |
-
specifier: ^3.
|
16 |
-
version: 3.
|
17 |
remult:
|
18 |
specifier: ^3.0.2
|
19 |
version: 3.0.2
|
@@ -62,16 +62,16 @@ importers:
|
|
62 |
version: 3.0.0
|
63 |
'@sveltejs/adapter-auto':
|
64 |
specifier: ^3.2.2
|
65 |
-
version: 3.3.1(@sveltejs/kit@2.18.0(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.
|
66 |
'@sveltejs/adapter-node':
|
67 |
specifier: ^5.2.0
|
68 |
-
version: 5.2.12(@sveltejs/kit@2.18.0(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.
|
69 |
'@sveltejs/kit':
|
70 |
specifier: ^2.5.27
|
71 |
-
version: 2.18.0(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.
|
72 |
'@sveltejs/vite-plugin-svelte':
|
73 |
specifier: ^4.0.0
|
74 |
-
version: 4.0.4(svelte@5.
|
75 |
'@tailwindcss/container-queries':
|
76 |
specifier: ^0.1.1
|
77 |
version: 0.1.1(tailwindcss@4.0.9)
|
@@ -83,7 +83,7 @@ importers:
|
|
83 |
version: 6.6.3
|
84 |
'@testing-library/svelte':
|
85 |
specifier: ^5.2.4
|
86 |
-
version: 5.2.8(svelte@5.
|
87 |
'@types/node':
|
88 |
specifier: ^22.14.1
|
89 |
version: 22.14.1
|
@@ -122,7 +122,7 @@ importers:
|
|
122 |
version: 26.1.0
|
123 |
melt:
|
124 |
specifier: ^0.36.0
|
125 |
-
version: 0.36.0(@floating-ui/dom@1.6.13)(svelte@5.
|
126 |
openai:
|
127 |
specifier: ^4.90.0
|
128 |
version: 4.90.0(ws@8.18.2)
|
@@ -137,22 +137,22 @@ importers:
|
|
137 |
version: 3.5.3
|
138 |
prettier-plugin-svelte:
|
139 |
specifier: ^3.4.0
|
140 |
-
version: 3.4.0(prettier@3.5.3)(svelte@5.
|
141 |
prettier-plugin-tailwindcss:
|
142 |
specifier: ^0.6.11
|
143 |
-
version: 0.6.11(prettier-plugin-svelte@3.4.0(prettier@3.5.3)(svelte@5.
|
144 |
runed:
|
145 |
specifier: ^0.25.0
|
146 |
-
version: 0.25.0(svelte@5.
|
147 |
shiki:
|
148 |
specifier: ^3.4.0
|
149 |
version: 3.4.0
|
150 |
svelte:
|
151 |
-
specifier: ^5.
|
152 |
-
version: 5.
|
153 |
svelte-check:
|
154 |
specifier: ^4.0.0
|
155 |
-
version: 4.1.5(picomatch@4.0.2)(svelte@5.
|
156 |
tailwind-merge:
|
157 |
specifier: ^3.0.2
|
158 |
version: 3.0.2
|
@@ -173,7 +173,7 @@ importers:
|
|
173 |
version: 8.26.1(eslint@9.22.0(jiti@2.4.2))(typescript@5.8.2)
|
174 |
unplugin-icons:
|
175 |
specifier: ^22.1.0
|
176 |
-
version: 22.1.0(svelte@5.
|
177 |
vite:
|
178 |
specifier: ^5.4.4
|
179 |
version: 5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)
|
@@ -182,7 +182,7 @@ importers:
|
|
182 |
version: 3.1.4(@types/node@22.14.1)(@vitest/browser@3.1.4)(jsdom@26.1.0)(lightningcss@1.29.1)
|
183 |
vitest-browser-svelte:
|
184 |
specifier: ^0.1.0
|
185 |
-
version: 0.1.0(@vitest/browser@3.1.4)(svelte@5.
|
186 |
|
187 |
packages:
|
188 |
|
@@ -543,6 +543,12 @@ packages:
|
|
543 |
peerDependencies:
|
544 |
eslint: ^6.0.0 || ^7.0.0 || >=8.0.0
|
545 |
|
|
|
|
|
|
|
|
|
|
|
|
|
546 |
'@eslint-community/regexpp@4.12.1':
|
547 |
resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==}
|
548 |
engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}
|
@@ -1673,8 +1679,8 @@ packages:
|
|
1673 |
eslint-config-prettier:
|
1674 |
optional: true
|
1675 |
|
1676 |
-
eslint-plugin-svelte@3.
|
1677 |
-
resolution: {integrity: sha512-
|
1678 |
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
1679 |
peerDependencies:
|
1680 |
eslint: ^8.57.1 || ^9.0.0
|
@@ -1721,8 +1727,8 @@ packages:
|
|
1721 |
resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==}
|
1722 |
engines: {node: '>=0.10'}
|
1723 |
|
1724 |
-
esrap@1.
|
1725 |
-
resolution: {integrity: sha512-
|
1726 |
|
1727 |
esrecurse@4.3.0:
|
1728 |
resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==}
|
@@ -2108,8 +2114,8 @@ packages:
|
|
2108 |
resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==}
|
2109 |
engines: {node: '>=6'}
|
2110 |
|
2111 |
-
known-css-properties@0.
|
2112 |
-
resolution: {integrity: sha512-
|
2113 |
|
2114 |
kolorist@1.8.0:
|
2115 |
resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==}
|
@@ -2829,8 +2835,8 @@ packages:
|
|
2829 |
svelte: ^4.0.0 || ^5.0.0-next.0
|
2830 |
typescript: '>=5.0.0'
|
2831 |
|
2832 |
-
svelte-eslint-parser@1.
|
2833 |
-
resolution: {integrity: sha512-
|
2834 |
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
2835 |
peerDependencies:
|
2836 |
svelte: ^3.37.0 || ^4.0.0 || ^5.0.0
|
@@ -2838,8 +2844,8 @@ packages:
|
|
2838 |
svelte:
|
2839 |
optional: true
|
2840 |
|
2841 |
-
svelte@5.
|
2842 |
-
resolution: {integrity: sha512-
|
2843 |
engines: {node: '>=18'}
|
2844 |
|
2845 |
symbol-tree@3.2.4:
|
@@ -3487,6 +3493,11 @@ snapshots:
|
|
3487 |
eslint: 9.22.0(jiti@2.4.2)
|
3488 |
eslint-visitor-keys: 3.4.3
|
3489 |
|
|
|
|
|
|
|
|
|
|
|
3490 |
'@eslint-community/regexpp@4.12.1': {}
|
3491 |
|
3492 |
'@eslint/config-array@0.19.2':
|
@@ -3916,22 +3927,22 @@ snapshots:
|
|
3916 |
dependencies:
|
3917 |
acorn: 8.14.0
|
3918 |
|
3919 |
-
'@sveltejs/adapter-auto@3.3.1(@sveltejs/kit@2.18.0(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.
|
3920 |
dependencies:
|
3921 |
-
'@sveltejs/kit': 2.18.0(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.
|
3922 |
import-meta-resolve: 4.1.0
|
3923 |
|
3924 |
-
'@sveltejs/adapter-node@5.2.12(@sveltejs/kit@2.18.0(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.
|
3925 |
dependencies:
|
3926 |
'@rollup/plugin-commonjs': 28.0.2(rollup@4.34.9)
|
3927 |
'@rollup/plugin-json': 6.1.0(rollup@4.34.9)
|
3928 |
'@rollup/plugin-node-resolve': 16.0.0(rollup@4.34.9)
|
3929 |
-
'@sveltejs/kit': 2.18.0(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.
|
3930 |
rollup: 4.34.9
|
3931 |
|
3932 |
-
'@sveltejs/kit@2.18.0(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.
|
3933 |
dependencies:
|
3934 |
-
'@sveltejs/vite-plugin-svelte': 4.0.4(svelte@5.
|
3935 |
'@types/cookie': 0.6.0
|
3936 |
cookie: 0.6.0
|
3937 |
devalue: 5.1.1
|
@@ -3943,26 +3954,26 @@ snapshots:
|
|
3943 |
sade: 1.8.1
|
3944 |
set-cookie-parser: 2.7.1
|
3945 |
sirv: 3.0.1
|
3946 |
-
svelte: 5.
|
3947 |
vite: 5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)
|
3948 |
|
3949 |
-
'@sveltejs/vite-plugin-svelte-inspector@3.0.1(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.
|
3950 |
dependencies:
|
3951 |
-
'@sveltejs/vite-plugin-svelte': 4.0.4(svelte@5.
|
3952 |
debug: 4.4.0
|
3953 |
-
svelte: 5.
|
3954 |
vite: 5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)
|
3955 |
transitivePeerDependencies:
|
3956 |
- supports-color
|
3957 |
|
3958 |
-
'@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.
|
3959 |
dependencies:
|
3960 |
-
'@sveltejs/vite-plugin-svelte-inspector': 3.0.1(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.
|
3961 |
debug: 4.4.0
|
3962 |
deepmerge: 4.3.1
|
3963 |
kleur: 4.1.5
|
3964 |
magic-string: 0.30.17
|
3965 |
-
svelte: 5.
|
3966 |
vite: 5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)
|
3967 |
vitefu: 1.0.6(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1))
|
3968 |
transitivePeerDependencies:
|
@@ -4055,10 +4066,10 @@ snapshots:
|
|
4055 |
lodash: 4.17.21
|
4056 |
redent: 3.0.0
|
4057 |
|
4058 |
-
'@testing-library/svelte@5.2.8(svelte@5.
|
4059 |
dependencies:
|
4060 |
'@testing-library/dom': 10.4.0
|
4061 |
-
svelte: 5.
|
4062 |
optionalDependencies:
|
4063 |
vite: 5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)
|
4064 |
vitest: 3.1.4(@types/node@22.14.1)(@vitest/browser@3.1.4)(jsdom@26.1.0)(lightningcss@1.29.1)
|
@@ -4607,20 +4618,21 @@ snapshots:
|
|
4607 |
optionalDependencies:
|
4608 |
eslint-config-prettier: 10.1.1(eslint@9.22.0(jiti@2.4.2))
|
4609 |
|
4610 |
-
eslint-plugin-svelte@3.
|
4611 |
dependencies:
|
4612 |
-
'@eslint-community/eslint-utils': 4.
|
4613 |
'@jridgewell/sourcemap-codec': 1.5.0
|
4614 |
eslint: 9.22.0(jiti@2.4.2)
|
4615 |
esutils: 2.0.3
|
4616 |
-
|
|
|
4617 |
postcss: 8.5.3
|
4618 |
postcss-load-config: 3.1.4(postcss@8.5.3)
|
4619 |
postcss-safe-parser: 7.0.1(postcss@8.5.3)
|
4620 |
-
semver: 7.7.
|
4621 |
-
svelte-eslint-parser: 1.
|
4622 |
optionalDependencies:
|
4623 |
-
svelte: 5.
|
4624 |
transitivePeerDependencies:
|
4625 |
- ts-node
|
4626 |
|
@@ -4689,7 +4701,7 @@ snapshots:
|
|
4689 |
dependencies:
|
4690 |
estraverse: 5.3.0
|
4691 |
|
4692 |
-
esrap@1.
|
4693 |
dependencies:
|
4694 |
'@jridgewell/sourcemap-codec': 1.5.0
|
4695 |
|
@@ -5084,7 +5096,7 @@ snapshots:
|
|
5084 |
|
5085 |
kleur@4.1.5: {}
|
5086 |
|
5087 |
-
known-css-properties@0.
|
5088 |
|
5089 |
kolorist@1.8.0: {}
|
5090 |
|
@@ -5195,14 +5207,14 @@ snapshots:
|
|
5195 |
unist-util-visit: 5.0.0
|
5196 |
vfile: 6.0.3
|
5197 |
|
5198 |
-
melt@0.36.0(@floating-ui/dom@1.6.13)(svelte@5.
|
5199 |
dependencies:
|
5200 |
'@floating-ui/dom': 1.6.13
|
5201 |
dequal: 2.0.3
|
5202 |
jest-axe: 9.0.0
|
5203 |
nanoid: 5.1.5
|
5204 |
-
runed: 0.23.4(svelte@5.
|
5205 |
-
svelte: 5.
|
5206 |
|
5207 |
merge2@1.4.1: {}
|
5208 |
|
@@ -5461,16 +5473,16 @@ snapshots:
|
|
5461 |
dependencies:
|
5462 |
fast-diff: 1.3.0
|
5463 |
|
5464 |
-
prettier-plugin-svelte@3.4.0(prettier@3.5.3)(svelte@5.
|
5465 |
dependencies:
|
5466 |
prettier: 3.5.3
|
5467 |
-
svelte: 5.
|
5468 |
|
5469 |
-
prettier-plugin-tailwindcss@0.6.11(prettier-plugin-svelte@3.4.0(prettier@3.5.3)(svelte@5.
|
5470 |
dependencies:
|
5471 |
prettier: 3.5.3
|
5472 |
optionalDependencies:
|
5473 |
-
prettier-plugin-svelte: 3.4.0(prettier@3.5.3)(svelte@5.
|
5474 |
|
5475 |
prettier@3.5.3: {}
|
5476 |
|
@@ -5611,15 +5623,15 @@ snapshots:
|
|
5611 |
dependencies:
|
5612 |
queue-microtask: 1.2.3
|
5613 |
|
5614 |
-
runed@0.23.4(svelte@5.
|
5615 |
dependencies:
|
5616 |
esm-env: 1.2.2
|
5617 |
-
svelte: 5.
|
5618 |
|
5619 |
-
runed@0.25.0(svelte@5.
|
5620 |
dependencies:
|
5621 |
esm-env: 1.2.2
|
5622 |
-
svelte: 5.
|
5623 |
|
5624 |
rxjs@7.8.2:
|
5625 |
dependencies:
|
@@ -5749,19 +5761,19 @@ snapshots:
|
|
5749 |
|
5750 |
supports-preserve-symlinks-flag@1.0.0: {}
|
5751 |
|
5752 |
-
svelte-check@4.1.5(picomatch@4.0.2)(svelte@5.
|
5753 |
dependencies:
|
5754 |
'@jridgewell/trace-mapping': 0.3.25
|
5755 |
chokidar: 4.0.3
|
5756 |
fdir: 6.4.3(picomatch@4.0.2)
|
5757 |
picocolors: 1.1.1
|
5758 |
sade: 1.8.1
|
5759 |
-
svelte: 5.
|
5760 |
typescript: 5.8.2
|
5761 |
transitivePeerDependencies:
|
5762 |
- picomatch
|
5763 |
|
5764 |
-
svelte-eslint-parser@1.
|
5765 |
dependencies:
|
5766 |
eslint-scope: 8.3.0
|
5767 |
eslint-visitor-keys: 4.2.0
|
@@ -5770,9 +5782,9 @@ snapshots:
|
|
5770 |
postcss-scss: 4.0.9(postcss@8.5.3)
|
5771 |
postcss-selector-parser: 7.1.0
|
5772 |
optionalDependencies:
|
5773 |
-
svelte: 5.
|
5774 |
|
5775 |
-
svelte@5.
|
5776 |
dependencies:
|
5777 |
'@ampproject/remapping': 2.3.0
|
5778 |
'@jridgewell/sourcemap-codec': 1.5.0
|
@@ -5783,7 +5795,7 @@ snapshots:
|
|
5783 |
axobject-query: 4.1.0
|
5784 |
clsx: 2.1.1
|
5785 |
esm-env: 1.2.2
|
5786 |
-
esrap: 1.
|
5787 |
is-reference: 3.0.3
|
5788 |
locate-character: 3.0.0
|
5789 |
magic-string: 0.30.17
|
@@ -5944,7 +5956,7 @@ snapshots:
|
|
5944 |
unist-util-is: 6.0.0
|
5945 |
unist-util-visit-parents: 6.0.1
|
5946 |
|
5947 |
-
unplugin-icons@22.1.0(svelte@5.
|
5948 |
dependencies:
|
5949 |
'@antfu/install-pkg': 1.0.0
|
5950 |
'@iconify/utils': 2.3.0
|
@@ -5952,7 +5964,7 @@ snapshots:
|
|
5952 |
local-pkg: 1.1.1
|
5953 |
unplugin: 2.2.0
|
5954 |
optionalDependencies:
|
5955 |
-
svelte: 5.
|
5956 |
transitivePeerDependencies:
|
5957 |
- supports-color
|
5958 |
|
@@ -6028,10 +6040,10 @@ snapshots:
|
|
6028 |
optionalDependencies:
|
6029 |
vite: 5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)
|
6030 |
|
6031 |
-
vitest-browser-svelte@0.1.0(@vitest/browser@3.1.4)(svelte@5.
|
6032 |
dependencies:
|
6033 |
'@vitest/browser': 3.1.4(playwright@1.52.0)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1))(vitest@3.1.4)
|
6034 |
-
svelte: 5.
|
6035 |
vitest: 3.1.4(@types/node@22.14.1)(@vitest/browser@3.1.4)(jsdom@26.1.0)(lightningcss@1.29.1)
|
6036 |
|
6037 |
vitest@3.1.4(@types/node@22.14.1)(@vitest/browser@3.1.4)(jsdom@26.1.0)(lightningcss@1.29.1):
|
|
|
12 |
specifier: ^2.0.3
|
13 |
version: 2.0.3
|
14 |
eslint-plugin-svelte:
|
15 |
+
specifier: ^3.11.0
|
16 |
+
version: 3.11.0(eslint@9.22.0(jiti@2.4.2))(svelte@5.36.8)
|
17 |
remult:
|
18 |
specifier: ^3.0.2
|
19 |
version: 3.0.2
|
|
|
62 |
version: 3.0.0
|
63 |
'@sveltejs/adapter-auto':
|
64 |
specifier: ^3.2.2
|
65 |
+
version: 3.3.1(@sveltejs/kit@2.18.0(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)))(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)))
|
66 |
'@sveltejs/adapter-node':
|
67 |
specifier: ^5.2.0
|
68 |
+
version: 5.2.12(@sveltejs/kit@2.18.0(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)))(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)))
|
69 |
'@sveltejs/kit':
|
70 |
specifier: ^2.5.27
|
71 |
+
version: 2.18.0(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)))(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1))
|
72 |
'@sveltejs/vite-plugin-svelte':
|
73 |
specifier: ^4.0.0
|
74 |
+
version: 4.0.4(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1))
|
75 |
'@tailwindcss/container-queries':
|
76 |
specifier: ^0.1.1
|
77 |
version: 0.1.1(tailwindcss@4.0.9)
|
|
|
83 |
version: 6.6.3
|
84 |
'@testing-library/svelte':
|
85 |
specifier: ^5.2.4
|
86 |
+
version: 5.2.8(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1))(vitest@3.1.4)
|
87 |
'@types/node':
|
88 |
specifier: ^22.14.1
|
89 |
version: 22.14.1
|
|
|
122 |
version: 26.1.0
|
123 |
melt:
|
124 |
specifier: ^0.36.0
|
125 |
+
version: 0.36.0(@floating-ui/dom@1.6.13)(svelte@5.36.8)
|
126 |
openai:
|
127 |
specifier: ^4.90.0
|
128 |
version: 4.90.0(ws@8.18.2)
|
|
|
137 |
version: 3.5.3
|
138 |
prettier-plugin-svelte:
|
139 |
specifier: ^3.4.0
|
140 |
+
version: 3.4.0(prettier@3.5.3)(svelte@5.36.8)
|
141 |
prettier-plugin-tailwindcss:
|
142 |
specifier: ^0.6.11
|
143 |
+
version: 0.6.11(prettier-plugin-svelte@3.4.0(prettier@3.5.3)(svelte@5.36.8))(prettier@3.5.3)
|
144 |
runed:
|
145 |
specifier: ^0.25.0
|
146 |
+
version: 0.25.0(svelte@5.36.8)
|
147 |
shiki:
|
148 |
specifier: ^3.4.0
|
149 |
version: 3.4.0
|
150 |
svelte:
|
151 |
+
specifier: ^5.36.8
|
152 |
+
version: 5.36.8
|
153 |
svelte-check:
|
154 |
specifier: ^4.0.0
|
155 |
+
version: 4.1.5(picomatch@4.0.2)(svelte@5.36.8)(typescript@5.8.2)
|
156 |
tailwind-merge:
|
157 |
specifier: ^3.0.2
|
158 |
version: 3.0.2
|
|
|
173 |
version: 8.26.1(eslint@9.22.0(jiti@2.4.2))(typescript@5.8.2)
|
174 |
unplugin-icons:
|
175 |
specifier: ^22.1.0
|
176 |
+
version: 22.1.0(svelte@5.36.8)
|
177 |
vite:
|
178 |
specifier: ^5.4.4
|
179 |
version: 5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)
|
|
|
182 |
version: 3.1.4(@types/node@22.14.1)(@vitest/browser@3.1.4)(jsdom@26.1.0)(lightningcss@1.29.1)
|
183 |
vitest-browser-svelte:
|
184 |
specifier: ^0.1.0
|
185 |
+
version: 0.1.0(@vitest/browser@3.1.4)(svelte@5.36.8)(vitest@3.1.4)
|
186 |
|
187 |
packages:
|
188 |
|
|
|
543 |
peerDependencies:
|
544 |
eslint: ^6.0.0 || ^7.0.0 || >=8.0.0
|
545 |
|
546 |
+
'@eslint-community/eslint-utils@4.7.0':
|
547 |
+
resolution: {integrity: sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==}
|
548 |
+
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
549 |
+
peerDependencies:
|
550 |
+
eslint: ^6.0.0 || ^7.0.0 || >=8.0.0
|
551 |
+
|
552 |
'@eslint-community/regexpp@4.12.1':
|
553 |
resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==}
|
554 |
engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}
|
|
|
1679 |
eslint-config-prettier:
|
1680 |
optional: true
|
1681 |
|
1682 |
+
eslint-plugin-svelte@3.11.0:
|
1683 |
+
resolution: {integrity: sha512-KliWlkieHyEa65aQIkRwUFfHzT5Cn4u3BQQsu3KlkJOs7c1u7ryn84EWaOjEzilbKgttT4OfBURA8Uc4JBSQIw==}
|
1684 |
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
1685 |
peerDependencies:
|
1686 |
eslint: ^8.57.1 || ^9.0.0
|
|
|
1727 |
resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==}
|
1728 |
engines: {node: '>=0.10'}
|
1729 |
|
1730 |
+
esrap@2.1.0:
|
1731 |
+
resolution: {integrity: sha512-yzmPNpl7TBbMRC5Lj2JlJZNPml0tzqoqP5B1JXycNUwtqma9AKCO0M2wHrdgsHcy1WRW7S9rJknAMtByg3usgA==}
|
1732 |
|
1733 |
esrecurse@4.3.0:
|
1734 |
resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==}
|
|
|
2114 |
resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==}
|
2115 |
engines: {node: '>=6'}
|
2116 |
|
2117 |
+
known-css-properties@0.37.0:
|
2118 |
+
resolution: {integrity: sha512-JCDrsP4Z1Sb9JwG0aJ8Eo2r7k4Ou5MwmThS/6lcIe1ICyb7UBJKGRIUUdqc2ASdE/42lgz6zFUnzAIhtXnBVrQ==}
|
2119 |
|
2120 |
kolorist@1.8.0:
|
2121 |
resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==}
|
|
|
2835 |
svelte: ^4.0.0 || ^5.0.0-next.0
|
2836 |
typescript: '>=5.0.0'
|
2837 |
|
2838 |
+
svelte-eslint-parser@1.3.0:
|
2839 |
+
resolution: {integrity: sha512-VCgMHKV7UtOGcGLGNFSbmdm6kEKjtzo5nnpGU/mnx4OsFY6bZ7QwRF5DUx+Hokw5Lvdyo8dpk8B1m8mliomrNg==}
|
2840 |
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
2841 |
peerDependencies:
|
2842 |
svelte: ^3.37.0 || ^4.0.0 || ^5.0.0
|
|
|
2844 |
svelte:
|
2845 |
optional: true
|
2846 |
|
2847 |
+
svelte@5.36.8:
|
2848 |
+
resolution: {integrity: sha512-8JbZWQu96hMjH/oYQPxXW6taeC6Awl6muGHeZzJTxQx7NGRQ/J9wN1hkzRKLOlSDlbS2igiFg7p5xyTp5uXG3A==}
|
2849 |
engines: {node: '>=18'}
|
2850 |
|
2851 |
symbol-tree@3.2.4:
|
|
|
3493 |
eslint: 9.22.0(jiti@2.4.2)
|
3494 |
eslint-visitor-keys: 3.4.3
|
3495 |
|
3496 |
+
'@eslint-community/eslint-utils@4.7.0(eslint@9.22.0(jiti@2.4.2))':
|
3497 |
+
dependencies:
|
3498 |
+
eslint: 9.22.0(jiti@2.4.2)
|
3499 |
+
eslint-visitor-keys: 3.4.3
|
3500 |
+
|
3501 |
'@eslint-community/regexpp@4.12.1': {}
|
3502 |
|
3503 |
'@eslint/config-array@0.19.2':
|
|
|
3927 |
dependencies:
|
3928 |
acorn: 8.14.0
|
3929 |
|
3930 |
+
'@sveltejs/adapter-auto@3.3.1(@sveltejs/kit@2.18.0(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)))(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)))':
|
3931 |
dependencies:
|
3932 |
+
'@sveltejs/kit': 2.18.0(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)))(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1))
|
3933 |
import-meta-resolve: 4.1.0
|
3934 |
|
3935 |
+
'@sveltejs/adapter-node@5.2.12(@sveltejs/kit@2.18.0(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)))(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)))':
|
3936 |
dependencies:
|
3937 |
'@rollup/plugin-commonjs': 28.0.2(rollup@4.34.9)
|
3938 |
'@rollup/plugin-json': 6.1.0(rollup@4.34.9)
|
3939 |
'@rollup/plugin-node-resolve': 16.0.0(rollup@4.34.9)
|
3940 |
+
'@sveltejs/kit': 2.18.0(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)))(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1))
|
3941 |
rollup: 4.34.9
|
3942 |
|
3943 |
+
'@sveltejs/kit@2.18.0(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)))(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1))':
|
3944 |
dependencies:
|
3945 |
+
'@sveltejs/vite-plugin-svelte': 4.0.4(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1))
|
3946 |
'@types/cookie': 0.6.0
|
3947 |
cookie: 0.6.0
|
3948 |
devalue: 5.1.1
|
|
|
3954 |
sade: 1.8.1
|
3955 |
set-cookie-parser: 2.7.1
|
3956 |
sirv: 3.0.1
|
3957 |
+
svelte: 5.36.8
|
3958 |
vite: 5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)
|
3959 |
|
3960 |
+
'@sveltejs/vite-plugin-svelte-inspector@3.0.1(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)))(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1))':
|
3961 |
dependencies:
|
3962 |
+
'@sveltejs/vite-plugin-svelte': 4.0.4(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1))
|
3963 |
debug: 4.4.0
|
3964 |
+
svelte: 5.36.8
|
3965 |
vite: 5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)
|
3966 |
transitivePeerDependencies:
|
3967 |
- supports-color
|
3968 |
|
3969 |
+
'@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1))':
|
3970 |
dependencies:
|
3971 |
+
'@sveltejs/vite-plugin-svelte-inspector': 3.0.1(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)))(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1))
|
3972 |
debug: 4.4.0
|
3973 |
deepmerge: 4.3.1
|
3974 |
kleur: 4.1.5
|
3975 |
magic-string: 0.30.17
|
3976 |
+
svelte: 5.36.8
|
3977 |
vite: 5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)
|
3978 |
vitefu: 1.0.6(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1))
|
3979 |
transitivePeerDependencies:
|
|
|
4066 |
lodash: 4.17.21
|
4067 |
redent: 3.0.0
|
4068 |
|
4069 |
+
'@testing-library/svelte@5.2.8(svelte@5.36.8)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1))(vitest@3.1.4)':
|
4070 |
dependencies:
|
4071 |
'@testing-library/dom': 10.4.0
|
4072 |
+
svelte: 5.36.8
|
4073 |
optionalDependencies:
|
4074 |
vite: 5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)
|
4075 |
vitest: 3.1.4(@types/node@22.14.1)(@vitest/browser@3.1.4)(jsdom@26.1.0)(lightningcss@1.29.1)
|
|
|
4618 |
optionalDependencies:
|
4619 |
eslint-config-prettier: 10.1.1(eslint@9.22.0(jiti@2.4.2))
|
4620 |
|
4621 |
+
eslint-plugin-svelte@3.11.0(eslint@9.22.0(jiti@2.4.2))(svelte@5.36.8):
|
4622 |
dependencies:
|
4623 |
+
'@eslint-community/eslint-utils': 4.7.0(eslint@9.22.0(jiti@2.4.2))
|
4624 |
'@jridgewell/sourcemap-codec': 1.5.0
|
4625 |
eslint: 9.22.0(jiti@2.4.2)
|
4626 |
esutils: 2.0.3
|
4627 |
+
globals: 16.0.0
|
4628 |
+
known-css-properties: 0.37.0
|
4629 |
postcss: 8.5.3
|
4630 |
postcss-load-config: 3.1.4(postcss@8.5.3)
|
4631 |
postcss-safe-parser: 7.0.1(postcss@8.5.3)
|
4632 |
+
semver: 7.7.2
|
4633 |
+
svelte-eslint-parser: 1.3.0(svelte@5.36.8)
|
4634 |
optionalDependencies:
|
4635 |
+
svelte: 5.36.8
|
4636 |
transitivePeerDependencies:
|
4637 |
- ts-node
|
4638 |
|
|
|
4701 |
dependencies:
|
4702 |
estraverse: 5.3.0
|
4703 |
|
4704 |
+
esrap@2.1.0:
|
4705 |
dependencies:
|
4706 |
'@jridgewell/sourcemap-codec': 1.5.0
|
4707 |
|
|
|
5096 |
|
5097 |
kleur@4.1.5: {}
|
5098 |
|
5099 |
+
known-css-properties@0.37.0: {}
|
5100 |
|
5101 |
kolorist@1.8.0: {}
|
5102 |
|
|
|
5207 |
unist-util-visit: 5.0.0
|
5208 |
vfile: 6.0.3
|
5209 |
|
5210 |
+
melt@0.36.0(@floating-ui/dom@1.6.13)(svelte@5.36.8):
|
5211 |
dependencies:
|
5212 |
'@floating-ui/dom': 1.6.13
|
5213 |
dequal: 2.0.3
|
5214 |
jest-axe: 9.0.0
|
5215 |
nanoid: 5.1.5
|
5216 |
+
runed: 0.23.4(svelte@5.36.8)
|
5217 |
+
svelte: 5.36.8
|
5218 |
|
5219 |
merge2@1.4.1: {}
|
5220 |
|
|
|
5473 |
dependencies:
|
5474 |
fast-diff: 1.3.0
|
5475 |
|
5476 |
+
prettier-plugin-svelte@3.4.0(prettier@3.5.3)(svelte@5.36.8):
|
5477 |
dependencies:
|
5478 |
prettier: 3.5.3
|
5479 |
+
svelte: 5.36.8
|
5480 |
|
5481 |
+
prettier-plugin-tailwindcss@0.6.11(prettier-plugin-svelte@3.4.0(prettier@3.5.3)(svelte@5.36.8))(prettier@3.5.3):
|
5482 |
dependencies:
|
5483 |
prettier: 3.5.3
|
5484 |
optionalDependencies:
|
5485 |
+
prettier-plugin-svelte: 3.4.0(prettier@3.5.3)(svelte@5.36.8)
|
5486 |
|
5487 |
prettier@3.5.3: {}
|
5488 |
|
|
|
5623 |
dependencies:
|
5624 |
queue-microtask: 1.2.3
|
5625 |
|
5626 |
+
runed@0.23.4(svelte@5.36.8):
|
5627 |
dependencies:
|
5628 |
esm-env: 1.2.2
|
5629 |
+
svelte: 5.36.8
|
5630 |
|
5631 |
+
runed@0.25.0(svelte@5.36.8):
|
5632 |
dependencies:
|
5633 |
esm-env: 1.2.2
|
5634 |
+
svelte: 5.36.8
|
5635 |
|
5636 |
rxjs@7.8.2:
|
5637 |
dependencies:
|
|
|
5761 |
|
5762 |
supports-preserve-symlinks-flag@1.0.0: {}
|
5763 |
|
5764 |
+
svelte-check@4.1.5(picomatch@4.0.2)(svelte@5.36.8)(typescript@5.8.2):
|
5765 |
dependencies:
|
5766 |
'@jridgewell/trace-mapping': 0.3.25
|
5767 |
chokidar: 4.0.3
|
5768 |
fdir: 6.4.3(picomatch@4.0.2)
|
5769 |
picocolors: 1.1.1
|
5770 |
sade: 1.8.1
|
5771 |
+
svelte: 5.36.8
|
5772 |
typescript: 5.8.2
|
5773 |
transitivePeerDependencies:
|
5774 |
- picomatch
|
5775 |
|
5776 |
+
svelte-eslint-parser@1.3.0(svelte@5.36.8):
|
5777 |
dependencies:
|
5778 |
eslint-scope: 8.3.0
|
5779 |
eslint-visitor-keys: 4.2.0
|
|
|
5782 |
postcss-scss: 4.0.9(postcss@8.5.3)
|
5783 |
postcss-selector-parser: 7.1.0
|
5784 |
optionalDependencies:
|
5785 |
+
svelte: 5.36.8
|
5786 |
|
5787 |
+
svelte@5.36.8:
|
5788 |
dependencies:
|
5789 |
'@ampproject/remapping': 2.3.0
|
5790 |
'@jridgewell/sourcemap-codec': 1.5.0
|
|
|
5795 |
axobject-query: 4.1.0
|
5796 |
clsx: 2.1.1
|
5797 |
esm-env: 1.2.2
|
5798 |
+
esrap: 2.1.0
|
5799 |
is-reference: 3.0.3
|
5800 |
locate-character: 3.0.0
|
5801 |
magic-string: 0.30.17
|
|
|
5956 |
unist-util-is: 6.0.0
|
5957 |
unist-util-visit-parents: 6.0.1
|
5958 |
|
5959 |
+
unplugin-icons@22.1.0(svelte@5.36.8):
|
5960 |
dependencies:
|
5961 |
'@antfu/install-pkg': 1.0.0
|
5962 |
'@iconify/utils': 2.3.0
|
|
|
5964 |
local-pkg: 1.1.1
|
5965 |
unplugin: 2.2.0
|
5966 |
optionalDependencies:
|
5967 |
+
svelte: 5.36.8
|
5968 |
transitivePeerDependencies:
|
5969 |
- supports-color
|
5970 |
|
|
|
6040 |
optionalDependencies:
|
6041 |
vite: 5.4.14(@types/node@22.14.1)(lightningcss@1.29.1)
|
6042 |
|
6043 |
+
vitest-browser-svelte@0.1.0(@vitest/browser@3.1.4)(svelte@5.36.8)(vitest@3.1.4):
|
6044 |
dependencies:
|
6045 |
'@vitest/browser': 3.1.4(playwright@1.52.0)(vite@5.4.14(@types/node@22.14.1)(lightningcss@1.29.1))(vitest@3.1.4)
|
6046 |
+
svelte: 5.36.8
|
6047 |
vitest: 3.1.4(@types/node@22.14.1)(@vitest/browser@3.1.4)(jsdom@26.1.0)(lightningcss@1.29.1)
|
6048 |
|
6049 |
vitest@3.1.4(@types/node@22.14.1)(@vitest/browser@3.1.4)(jsdom@26.1.0)(lightningcss@1.29.1):
|
src/lib/components/billing-indicator.svelte
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script lang="ts">
|
2 |
+
import { billing } from "$lib/state/billing.svelte";
|
3 |
+
import IconUser from "~icons/carbon/user";
|
4 |
+
import IconGroup from "~icons/carbon/group";
|
5 |
+
import IconWarning from "~icons/carbon/warning";
|
6 |
+
import IconCheckmark from "~icons/carbon/checkmark";
|
7 |
+
|
8 |
+
interface Props {
|
9 |
+
showModal?: () => void;
|
10 |
+
}
|
11 |
+
|
12 |
+
const { showModal }: Props = $props();
|
13 |
+
|
14 |
+
const statusColor = $derived(() => {
|
15 |
+
if (!billing.organization) return "text-gray-600 dark:text-gray-400";
|
16 |
+
if (billing.validating) return "text-yellow-600 dark:text-yellow-400";
|
17 |
+
if (billing.isValid) return "text-green-600 dark:text-green-400";
|
18 |
+
return "text-red-600 dark:text-red-400";
|
19 |
+
});
|
20 |
+
|
21 |
+
const bgColor = $derived(() => {
|
22 |
+
if (!billing.organization) return "bg-gray-50 dark:bg-gray-800";
|
23 |
+
if (billing.validating) return "bg-yellow-50 dark:bg-yellow-900/20";
|
24 |
+
if (billing.isValid) return "bg-green-50 dark:bg-green-900/20";
|
25 |
+
return "bg-red-50 dark:bg-red-900/20";
|
26 |
+
});
|
27 |
+
</script>
|
28 |
+
|
29 |
+
<button
|
30 |
+
onclick={showModal}
|
31 |
+
class="flex items-center gap-2 rounded-lg px-3 py-2 text-sm transition-colors hover:bg-gray-100 dark:hover:bg-gray-700 {bgColor}"
|
32 |
+
>
|
33 |
+
<!-- Avatar or Icon -->
|
34 |
+
{#if billing.organization && billing.organizationInfo?.avatar && billing.isValid}
|
35 |
+
<img src={billing.organizationInfo.avatar} alt={billing.displayName} class="h-5 w-5 rounded-full" />
|
36 |
+
{:else if billing.organization}
|
37 |
+
<IconGroup class="h-4 w-4 {statusColor}" />
|
38 |
+
{:else}
|
39 |
+
<IconUser class="h-4 w-4 {statusColor}" />
|
40 |
+
{/if}
|
41 |
+
|
42 |
+
<!-- Billing info -->
|
43 |
+
<div class="flex flex-col items-start">
|
44 |
+
<div class="flex items-center gap-1">
|
45 |
+
<span class="font-medium {statusColor}">
|
46 |
+
{billing.displayName}
|
47 |
+
</span>
|
48 |
+
|
49 |
+
<!-- Status indicator -->
|
50 |
+
{#if billing.organization}
|
51 |
+
{#if billing.validating}
|
52 |
+
<div class="h-3 w-3 animate-spin rounded-full border border-yellow-600 border-t-transparent"></div>
|
53 |
+
{:else if billing.isValid}
|
54 |
+
<IconCheckmark class="h-3 w-3 text-green-600 dark:text-green-400" />
|
55 |
+
{:else}
|
56 |
+
<IconWarning class="h-3 w-3 text-red-600 dark:text-red-400" />
|
57 |
+
{/if}
|
58 |
+
{/if}
|
59 |
+
</div>
|
60 |
+
|
61 |
+
<span class="text-xs text-gray-500 dark:text-gray-400">
|
62 |
+
{#if billing.organization}
|
63 |
+
{#if billing.validating}
|
64 |
+
Validating organization...
|
65 |
+
{:else if billing.isValid}
|
66 |
+
Organization billing
|
67 |
+
{:else}
|
68 |
+
Organization not found
|
69 |
+
{/if}
|
70 |
+
{:else}
|
71 |
+
Personal billing
|
72 |
+
{/if}
|
73 |
+
</span>
|
74 |
+
</div>
|
75 |
+
</button>
|
src/lib/components/inference-playground/billing-modal.svelte
CHANGED
@@ -44,17 +44,60 @@
|
|
44 |
</div>
|
45 |
|
46 |
<!-- Current Status -->
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
<!-- Actions -->
|
59 |
<div class="flex gap-3 pt-2">
|
60 |
{#if billing.organization}
|
|
|
44 |
</div>
|
45 |
|
46 |
<!-- Current Status -->
|
47 |
+
{#if billing.organization}
|
48 |
+
{#if billing.validating}
|
49 |
+
<div class="rounded-lg bg-yellow-50 p-3 dark:bg-yellow-900/20">
|
50 |
+
<div class="flex items-center gap-2">
|
51 |
+
<div class="h-3 w-3 animate-spin rounded-full border border-yellow-600 border-t-transparent"></div>
|
52 |
+
<span class="text-sm font-medium text-yellow-800 dark:text-yellow-400">
|
53 |
+
Validating organization: <strong>{billing.organization}</strong>
|
54 |
+
</span>
|
55 |
+
</div>
|
56 |
+
</div>
|
57 |
+
{:else if billing.isValid && billing.organizationInfo}
|
58 |
+
<div class="rounded-lg bg-green-50 p-3 dark:bg-green-900/20">
|
59 |
+
<div class="flex items-center gap-3">
|
60 |
+
{#if billing.organizationInfo.avatar}
|
61 |
+
<img
|
62 |
+
src={billing.organizationInfo.avatar}
|
63 |
+
alt={billing.organizationInfo.displayName}
|
64 |
+
class="h-8 w-8 rounded-full"
|
65 |
+
/>
|
66 |
+
{/if}
|
67 |
+
<div class="flex-1">
|
68 |
+
<div class="flex items-center gap-2">
|
69 |
+
<span class="text-sm font-medium text-green-800 dark:text-green-400">
|
70 |
+
Currently billing to: <strong>{billing.organizationInfo.displayName}</strong>
|
71 |
+
</span>
|
72 |
+
</div>
|
73 |
+
{#if billing.organizationInfo.displayName !== billing.organization}
|
74 |
+
<span class="text-xs text-green-700 dark:text-green-300">
|
75 |
+
({billing.organization})
|
76 |
+
</span>
|
77 |
+
{/if}
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
</div>
|
81 |
+
{:else}
|
82 |
+
<div class="rounded-lg bg-red-50 p-3 dark:bg-red-900/20">
|
83 |
+
<div class="flex items-center gap-2">
|
84 |
+
<div class="h-2 w-2 rounded-full bg-red-500"></div>
|
85 |
+
<span class="text-sm font-medium text-red-800 dark:text-red-400">
|
86 |
+
Organization not found: <strong>{billing.organization}</strong>
|
87 |
+
</span>
|
88 |
+
</div>
|
89 |
+
<p class="mt-1 text-xs text-red-700 dark:text-red-300">
|
90 |
+
Please check the organization name or use personal billing.
|
91 |
+
</p>
|
92 |
+
</div>
|
93 |
+
{/if}
|
94 |
+
{:else}
|
95 |
+
<div class="rounded-lg bg-gray-50 p-3 dark:bg-gray-800">
|
96 |
+
<div class="flex items-center gap-2">
|
97 |
+
<span class="text-sm text-gray-600 dark:text-gray-400"> Currently using personal billing </span>
|
98 |
+
</div>
|
99 |
+
</div>
|
100 |
+
{/if}
|
101 |
<!-- Actions -->
|
102 |
<div class="flex gap-3 pt-2">
|
103 |
{#if billing.organization}
|
src/lib/components/inference-playground/playground.svelte
CHANGED
@@ -13,7 +13,6 @@
|
|
13 |
import IconInfo from "~icons/carbon/information";
|
14 |
import IconSettings from "~icons/carbon/settings";
|
15 |
import IconShare from "~icons/carbon/share";
|
16 |
-
import IconReceipt from "~icons/carbon/receipt";
|
17 |
import { default as IconDelete } from "~icons/carbon/trash-can";
|
18 |
import { showShareModal } from "../share-modal.svelte";
|
19 |
import Toaster from "../toaster.svelte";
|
@@ -26,6 +25,7 @@
|
|
26 |
import ModelSelector from "./model-selector.svelte";
|
27 |
import ProjectSelect from "./project-select.svelte";
|
28 |
import BillingModal from "./billing-modal.svelte";
|
|
|
29 |
import { TEST_IDS } from "$lib/constants.js";
|
30 |
import MessageTextarea from "./message-textarea.svelte";
|
31 |
|
@@ -223,13 +223,7 @@
|
|
223 |
|
224 |
<div class="mt-auto space-y-3">
|
225 |
<div class="flex items-center justify-end">
|
226 |
-
<
|
227 |
-
onclick={() => (billingModalOpen = true)}
|
228 |
-
class="flex items-center gap-1 text-sm text-gray-500 underline decoration-gray-300 hover:text-gray-800 dark:text-gray-400 dark:decoration-gray-600 dark:hover:text-gray-200"
|
229 |
-
>
|
230 |
-
<IconReceipt class="text-xs" />
|
231 |
-
Billing
|
232 |
-
</button>
|
233 |
</div>
|
234 |
<div class="flex items-center justify-end gap-4 whitespace-nowrap">
|
235 |
<button
|
|
|
13 |
import IconInfo from "~icons/carbon/information";
|
14 |
import IconSettings from "~icons/carbon/settings";
|
15 |
import IconShare from "~icons/carbon/share";
|
|
|
16 |
import { default as IconDelete } from "~icons/carbon/trash-can";
|
17 |
import { showShareModal } from "../share-modal.svelte";
|
18 |
import Toaster from "../toaster.svelte";
|
|
|
25 |
import ModelSelector from "./model-selector.svelte";
|
26 |
import ProjectSelect from "./project-select.svelte";
|
27 |
import BillingModal from "./billing-modal.svelte";
|
28 |
+
import BillingIndicator from "../billing-indicator.svelte";
|
29 |
import { TEST_IDS } from "$lib/constants.js";
|
30 |
import MessageTextarea from "./message-textarea.svelte";
|
31 |
|
|
|
223 |
|
224 |
<div class="mt-auto space-y-3">
|
225 |
<div class="flex items-center justify-end">
|
226 |
+
<BillingIndicator showModal={() => (billingModalOpen = true)} />
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
</div>
|
228 |
<div class="flex items-center justify-end gap-4 whitespace-nowrap">
|
229 |
<button
|
src/lib/state/billing.svelte.ts
CHANGED
@@ -1,21 +1,68 @@
|
|
1 |
import { PersistedState } from "runed";
|
|
|
2 |
|
3 |
const STORAGE_KEY = "hf_billing_org";
|
4 |
|
5 |
class Billing {
|
6 |
#organization = new PersistedState(STORAGE_KEY, "");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
get organization() {
|
9 |
return this.#organization.current;
|
10 |
}
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
set organization(org: string) {
|
13 |
this.#organization.current = org;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
}
|
15 |
|
16 |
reset = () => {
|
17 |
this.organization = "";
|
18 |
-
|
19 |
};
|
20 |
}
|
21 |
|
|
|
1 |
import { PersistedState } from "runed";
|
2 |
+
import { validateOrganization, type OrganizationInfo } from "$lib/utils/organization.js";
|
3 |
|
4 |
const STORAGE_KEY = "hf_billing_org";
|
5 |
|
6 |
class Billing {
|
7 |
#organization = new PersistedState(STORAGE_KEY, "");
|
8 |
+
#organizationInfo = $state<OrganizationInfo | null>(null);
|
9 |
+
#validating = $state(false);
|
10 |
+
|
11 |
+
constructor() {
|
12 |
+
$effect.root(() => {
|
13 |
+
// Validate organization on initialization if one exists
|
14 |
+
$effect(() => {
|
15 |
+
if (this.#organization.current) {
|
16 |
+
this.validateCurrentOrganization();
|
17 |
+
}
|
18 |
+
});
|
19 |
+
});
|
20 |
+
}
|
21 |
|
22 |
get organization() {
|
23 |
return this.#organization.current;
|
24 |
}
|
25 |
|
26 |
+
get organizationInfo() {
|
27 |
+
return this.#organizationInfo;
|
28 |
+
}
|
29 |
+
|
30 |
+
get validating() {
|
31 |
+
return this.#validating;
|
32 |
+
}
|
33 |
+
|
34 |
+
get displayName() {
|
35 |
+
if (!this.#organization.current) return "Personal Account";
|
36 |
+
return this.#organizationInfo?.displayName || this.#organization.current;
|
37 |
+
}
|
38 |
+
|
39 |
+
get isValid() {
|
40 |
+
if (!this.#organization.current) return true; // Personal account is always valid
|
41 |
+
return this.#organizationInfo?.isValid ?? false;
|
42 |
+
}
|
43 |
+
|
44 |
set organization(org: string) {
|
45 |
this.#organization.current = org;
|
46 |
+
this.validateCurrentOrganization();
|
47 |
+
}
|
48 |
+
|
49 |
+
private async validateCurrentOrganization() {
|
50 |
+
if (!this.#organization.current) {
|
51 |
+
this.#organizationInfo = null;
|
52 |
+
return;
|
53 |
+
}
|
54 |
+
|
55 |
+
this.#validating = true;
|
56 |
+
try {
|
57 |
+
this.#organizationInfo = await validateOrganization(this.#organization.current);
|
58 |
+
} finally {
|
59 |
+
this.#validating = false;
|
60 |
+
}
|
61 |
}
|
62 |
|
63 |
reset = () => {
|
64 |
this.organization = "";
|
65 |
+
this.#organizationInfo = null;
|
66 |
};
|
67 |
}
|
68 |
|
src/lib/utils/organization.ts
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export interface OrganizationInfo {
|
2 |
+
name: string;
|
3 |
+
displayName: string;
|
4 |
+
avatar?: string;
|
5 |
+
isValid: boolean;
|
6 |
+
}
|
7 |
+
|
8 |
+
const orgCache = new Map<string, OrganizationInfo>();
|
9 |
+
|
10 |
+
export async function validateOrganization(orgName: string): Promise<OrganizationInfo> {
|
11 |
+
if (!orgName.trim()) {
|
12 |
+
return {
|
13 |
+
name: "",
|
14 |
+
displayName: "Personal Account",
|
15 |
+
isValid: false,
|
16 |
+
};
|
17 |
+
}
|
18 |
+
|
19 |
+
// Check cache first
|
20 |
+
if (orgCache.has(orgName)) {
|
21 |
+
return orgCache.get(orgName)!;
|
22 |
+
}
|
23 |
+
|
24 |
+
try {
|
25 |
+
const response = await fetch(`https://huggingface.co/api/organizations/${orgName}/overview`);
|
26 |
+
|
27 |
+
if (response.ok) {
|
28 |
+
const data = await response.json();
|
29 |
+
const orgInfo: OrganizationInfo = {
|
30 |
+
name: orgName,
|
31 |
+
displayName: data.displayName || orgName,
|
32 |
+
avatar: data.avatar || `https://huggingface.co/api/organizations/${orgName}/avatar`,
|
33 |
+
isValid: true,
|
34 |
+
};
|
35 |
+
|
36 |
+
// Cache the result
|
37 |
+
orgCache.set(orgName, orgInfo);
|
38 |
+
return orgInfo;
|
39 |
+
} else {
|
40 |
+
const orgInfo: OrganizationInfo = {
|
41 |
+
name: orgName,
|
42 |
+
displayName: orgName,
|
43 |
+
isValid: false,
|
44 |
+
};
|
45 |
+
|
46 |
+
// Cache invalid result for a short time
|
47 |
+
orgCache.set(orgName, orgInfo);
|
48 |
+
return orgInfo;
|
49 |
+
}
|
50 |
+
} catch (error) {
|
51 |
+
console.warn(`Failed to validate organization ${orgName}:`, error);
|
52 |
+
const orgInfo: OrganizationInfo = {
|
53 |
+
name: orgName,
|
54 |
+
displayName: orgName,
|
55 |
+
isValid: false,
|
56 |
+
};
|
57 |
+
|
58 |
+
// Cache error result
|
59 |
+
orgCache.set(orgName, orgInfo);
|
60 |
+
return orgInfo;
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
export function clearOrganizationCache() {
|
65 |
+
orgCache.clear();
|
66 |
+
}
|
svelte.config.js
CHANGED
@@ -13,6 +13,12 @@ const config = {
|
|
13 |
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
|
14 |
adapter: adapter(),
|
15 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
};
|
17 |
|
18 |
export default config;
|
|
|
13 |
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
|
14 |
adapter: adapter(),
|
15 |
},
|
16 |
+
|
17 |
+
compilerOptions: {
|
18 |
+
experimental: {
|
19 |
+
async: true,
|
20 |
+
},
|
21 |
+
},
|
22 |
};
|
23 |
|
24 |
export default config;
|