wizards 0.2.55 → 0.2.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/apps/runtime/dist/cli/autostart.js +1 -1
- package/apps/runtime/dist/cli/machine.js +5 -48
- package/apps/runtime/dist/cli/report.js +1 -1
- package/apps/runtime/dist/docs/dev/index.md +4 -4
- package/apps/runtime/dist/docs/dev/plugins/connections.md +4 -3
- package/apps/runtime/dist/docs/dev/plugins/events.md +1 -0
- package/apps/runtime/dist/docs/dev/plugins/examples.md +10 -9
- package/apps/runtime/dist/docs/dev/plugins/index.md +4 -3
- package/apps/runtime/dist/docs/dev/plugins/layout.md +2 -1
- package/apps/runtime/dist/docs/dev/plugins/meta.json +0 -1
- package/apps/runtime/dist/docs/dev/plugins/quick-start.md +4 -3
- package/apps/runtime/dist/docs/dev/plugins/reference.md +36 -14
- package/apps/runtime/dist/docs/dev/plugins/reloading.md +5 -5
- package/apps/runtime/dist/docs/dev/plugins/routes.md +30 -6
- package/apps/runtime/dist/docs/dev/plugins/runners.md +15 -10
- package/apps/runtime/dist/docs/dev/plugins/server.md +16 -7
- package/apps/runtime/dist/docs/dev/plugins/shipping.md +4 -26
- package/apps/runtime/dist/docs/dev/plugins/space.md +66 -53
- package/apps/runtime/dist/docs/dev/plugins/starters.md +10 -7
- package/apps/runtime/dist/docs/dev/plugins/studio.md +33 -12
- package/apps/runtime/dist/docs/dev/plugins/styling.md +19 -9
- package/apps/runtime/dist/docs/dev/plugins/tables.md +6 -4
- package/apps/runtime/dist/docs/dev/plugins/tools.md +22 -12
- package/apps/runtime/dist/docs/dev/wizard-format.md +3 -2
- package/apps/runtime/dist/docs/user/ai-apps.md +3 -1
- package/apps/runtime/dist/docs/user/assistant.md +5 -3
- package/apps/runtime/dist/docs/user/build-a-wizard.md +14 -2
- package/apps/runtime/dist/docs/user/command-line.md +16 -14
- package/apps/runtime/dist/docs/user/connectors.md +17 -12
- package/apps/runtime/dist/docs/user/data.md +14 -9
- package/apps/runtime/dist/docs/user/first-start.md +13 -6
- package/apps/runtime/dist/docs/user/index.md +2 -1
- package/apps/runtime/dist/docs/user/install.md +19 -11
- package/apps/runtime/dist/docs/user/models.md +44 -22
- package/apps/runtime/dist/docs/user/plugins.md +9 -4
- package/apps/runtime/dist/docs/user/run.md +14 -9
- package/apps/runtime/dist/docs/user/server.md +7 -5
- package/apps/runtime/dist/docs/user/space.md +15 -8
- package/apps/runtime/dist/docs/user/steps.md +33 -13
- package/apps/runtime/dist/docs/user/test-and-share.md +41 -25
- package/apps/runtime/dist/docs/user/troubleshooting.md +15 -7
- package/apps/runtime/dist/docs/user/wordpress.md +59 -49
- package/apps/runtime/dist/engine/runner.js +40 -18
- package/apps/runtime/dist/env.js +6 -3
- package/apps/runtime/dist/harness/apple.js +36 -21
- package/apps/runtime/dist/harness/claude.js +1 -1
- package/apps/runtime/dist/harness/model.js +2 -2
- package/apps/runtime/dist/limits.js +7 -4
- package/apps/runtime/dist/media/conversation.js +6 -5
- package/apps/runtime/dist/model-errors.js +22 -1
- package/apps/runtime/dist/models.js +30 -7
- package/apps/runtime/dist/plugins/pro-keys.js +1 -1
- package/apps/runtime/dist/plugins/pro-state.js +1 -1
- package/apps/runtime/dist/plugins/pro.js +1 -1
- package/apps/runtime/dist/plugins/runs.js +14 -10
- package/apps/runtime/dist/render/browser-path.js +54 -0
- package/apps/runtime/dist/routes/runs.js +51 -31
- package/apps/runtime/dist/routes/studio.js +7 -3
- package/apps/runtime/dist/services/api.js +3 -1
- package/apps/runtime/dist/services/package-file.js +8 -8
- package/apps/runtime/dist/update.js +1 -1
- package/apps/web/dist/assets/AboutDialog-Bv7p9iGr.js +1 -0
- package/apps/web/dist/assets/{ChangelogDialog-BLmJABe4.js → ChangelogDialog-D4sBrhi-.js} +1 -1
- package/apps/web/dist/assets/{ChatView-YAiOT6mt.js → ChatView-Bntm0u8V.js} +1 -1
- package/apps/web/dist/assets/{EditorPage-C0zMXwlF.js → EditorPage-DaVeNzHU.js} +2 -2
- package/apps/web/dist/assets/{FlowPreview-B4lbmeha.js → FlowPreview-C0tTz51A.js} +1 -1
- package/apps/web/dist/assets/{Harness-_riwRD-c.js → Harness-De-PsLFA.js} +1 -1
- package/apps/web/dist/assets/{Marketplace-B0Nki6J6.js → Marketplace-7Bdv7Gd5.js} +2 -2
- package/apps/web/dist/assets/{NewWizardPage-DkvGgROv.js → NewWizardPage-CV7jrSkz.js} +1 -1
- package/apps/web/dist/assets/{ProjectPage-CFRIPset.js → ProjectPage-CBCd24oM.js} +1 -1
- package/apps/web/dist/assets/{PublicRunner-QJuQB7ff.js → PublicRunner-CVmkHSnC.js} +1 -1
- package/apps/web/dist/assets/{ReadOnly-DiOfNtVr.js → ReadOnly-zQecD9OB.js} +1 -1
- package/apps/web/dist/assets/{RunDrawer-LjUX3yIv.js → RunDrawer-CvzuYc0d.js} +1 -1
- package/apps/web/dist/assets/{RunnerView-DkJVfUeG.js → RunnerView-BtZp1FD6.js} +1 -1
- package/apps/web/dist/assets/SettingsPage--Zj2pTgf.js +1 -0
- package/apps/web/dist/assets/SetupPage-F_e8f1to.js +1 -0
- package/apps/web/dist/assets/{SharePage-CCimr8XT.js → SharePage-DLivbYu6.js} +1 -1
- package/apps/web/dist/assets/{brand-CwLcF9JR.js → brand-DIKyySmf.js} +1 -1
- package/apps/web/dist/assets/changelog-CWualFcc.js +1 -0
- package/apps/web/dist/assets/{circle-alert-BEDKtkJy.js → circle-alert-B9b9Vb9k.js} +1 -1
- package/apps/web/dist/assets/{esm-BCwno33N.js → esm-BMtXxAe0.js} +1 -1
- package/apps/web/dist/assets/{index-Dq-Wj6Yo.js → index-MlQy_Qoy.js} +4 -4
- package/apps/web/dist/assets/{lock-Ce2ofIWG.js → lock-BNvsUKTg.js} +1 -1
- package/apps/web/dist/assets/session-CSbo-pmx.js +1 -0
- package/apps/web/dist/assets/{settings-menu-DX0JnPBR.js → settings-menu-JtMfy9en.js} +1 -1
- package/apps/web/dist/assets/{ui-mkL5nF_f.js → ui-FW7ypPI6.js} +1 -1
- package/apps/web/dist/assets/{upload-BfrqabpO.js → upload-MQ_24gSb.js} +1 -1
- package/apps/web/dist/assets/{volume-2-C3GeMqc-.js → volume-2-B1mj20eS.js} +1 -1
- package/apps/web/dist/index.html +6 -6
- package/apps/web/dist/install.sh +2 -2
- package/apps/web/dist/mcp/flow.html +1 -1
- package/modules/calls/dist/client.css +1 -1
- package/modules/sms/dist/client.css +1 -1
- package/modules/whatsapp/dist/client.css +1 -1
- package/node_modules/@engenty-wizards/shared/dist/run.d.ts +152 -2
- package/node_modules/@engenty-wizards/shared/dist/run.js +135 -1
- package/package.json +2 -2
- package/apps/runtime/dist/docs/dev/plugins/pro-modules.md +0 -59
- package/apps/web/dist/assets/AboutDialog-BelD7JCn.js +0 -1
- package/apps/web/dist/assets/SettingsPage-BKZ1KLfP.js +0 -1
- package/apps/web/dist/assets/SetupPage-Rqlo16Lk.js +0 -1
- package/apps/web/dist/assets/changelog-Bg5ZBu5p.js +0 -1
- package/apps/web/dist/assets/session-BuVghS-e.js +0 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What a step reports while it works, in words for each language: the runtime writes the German
|
|
3
|
-
* line into the run's log, a runner shows it in the language the person reads.
|
|
3
|
+
* line into the run's log, a runner shows it in the language the person reads. The runtime's
|
|
4
|
+
* answers to the person running a shared wizard (a refusal, a failure) are notes too: it answers
|
|
5
|
+
* them in the wizard's language.
|
|
4
6
|
*/
|
|
5
7
|
export const RUN_NOTES = {
|
|
6
8
|
entry: { de: "Eintrag {n} von {total}", en: "Entry {n} of {total}" },
|
|
@@ -103,6 +105,138 @@ export const RUN_NOTES = {
|
|
|
103
105
|
de: "Macht dort weiter, wo der Film stehen geblieben ist",
|
|
104
106
|
en: "Picking the film up where it stopped",
|
|
105
107
|
},
|
|
108
|
+
// What the runtime answers the person running a shared wizard, in the wizard's language.
|
|
109
|
+
wizardUnavailable: {
|
|
110
|
+
de: "Dieser Wizard ist gerade nicht verfügbar.",
|
|
111
|
+
en: "This wizard is not available right now.",
|
|
112
|
+
},
|
|
113
|
+
wizardLimit: {
|
|
114
|
+
de: "Für heute ist das Limit dieses Wizards erreicht. Bitte morgen wieder versuchen.",
|
|
115
|
+
en: "This wizard has reached its limit for today. Try again tomorrow.",
|
|
116
|
+
},
|
|
117
|
+
confirmHuman: {
|
|
118
|
+
de: "Bitte bestätige kurz, dass du ein Mensch bist.",
|
|
119
|
+
en: "Please confirm that you are a person.",
|
|
120
|
+
},
|
|
121
|
+
tooManyRuns: {
|
|
122
|
+
de: "Du hast gerade viele Durchläufe gestartet. Bitte versuche es in einer Stunde wieder.",
|
|
123
|
+
en: "You started many runs just now. Try again in an hour.",
|
|
124
|
+
},
|
|
125
|
+
runOver: { de: "Der Durchlauf ist beendet.", en: "The run is over." },
|
|
126
|
+
runBusy: { de: "Der Wizard arbeitet gerade.", en: "The wizard is working right now." },
|
|
127
|
+
pageOutdated: {
|
|
128
|
+
de: "Diese Seite ist nicht mehr aktuell.",
|
|
129
|
+
en: "This page is out of date.",
|
|
130
|
+
},
|
|
131
|
+
noStepBefore: { de: "Kein vorheriger Schritt.", en: "There is no step before this one." },
|
|
132
|
+
checkFields: {
|
|
133
|
+
de: "Bitte die markierten Felder prüfen.",
|
|
134
|
+
en: "Please check the marked fields.",
|
|
135
|
+
},
|
|
136
|
+
talkOff: {
|
|
137
|
+
de: "Live-Gespräche sind für diesen Wizard nicht eingeschaltet.",
|
|
138
|
+
en: "Live conversations are not switched on for this wizard.",
|
|
139
|
+
},
|
|
140
|
+
talkKeyRefused: {
|
|
141
|
+
de: "Das Gespräch ließ sich nicht starten: Der OpenAI API Key wurde abgelehnt.",
|
|
142
|
+
en: "The conversation could not be started: the OpenAI API key was refused.",
|
|
143
|
+
},
|
|
144
|
+
talkFailed: {
|
|
145
|
+
de: "Das Gespräch ließ sich nicht starten ({status}).",
|
|
146
|
+
en: "The conversation could not be started ({status}).",
|
|
147
|
+
},
|
|
148
|
+
talkNoSecret: {
|
|
149
|
+
de: "Das Gespräch ließ sich nicht starten: Es kam kein Zugang zurück.",
|
|
150
|
+
en: "The conversation could not be started: no secret came back.",
|
|
151
|
+
},
|
|
152
|
+
tryLater: { de: "Bitte später noch einmal.", en: "Try again later." },
|
|
153
|
+
recordingTooLarge: {
|
|
154
|
+
de: "Bitte eine Aufnahme bis 10 MB.",
|
|
155
|
+
en: "A recording of up to 10 MB, please.",
|
|
156
|
+
},
|
|
157
|
+
fileTooLarge: {
|
|
158
|
+
de: "Bitte eine Datei bis {mb} MB wählen.",
|
|
159
|
+
en: "Choose a file of up to {mb} MB, please.",
|
|
160
|
+
},
|
|
161
|
+
askClosed: {
|
|
162
|
+
de: "Diese Frage ist nicht mehr offen.",
|
|
163
|
+
en: "This question is no longer open.",
|
|
164
|
+
},
|
|
165
|
+
noBrowser: {
|
|
166
|
+
de: "Der Wizard hat gerade keinen Browser offen.",
|
|
167
|
+
en: "The wizard has no browser open right now.",
|
|
168
|
+
},
|
|
169
|
+
notWaiting: {
|
|
170
|
+
de: "Der Wizard wartet gerade nicht auf dich.",
|
|
171
|
+
en: "The wizard is not waiting for you right now.",
|
|
172
|
+
},
|
|
173
|
+
pageActFailed: {
|
|
174
|
+
de: "Das hat auf der Seite nicht geklappt.",
|
|
175
|
+
en: "That did not work on the page.",
|
|
176
|
+
},
|
|
177
|
+
linkGone: {
|
|
178
|
+
de: "Dieser Link ist abgelaufen oder wurde zurückgezogen.",
|
|
179
|
+
en: "This link has expired or was withdrawn.",
|
|
180
|
+
},
|
|
181
|
+
connected: {
|
|
182
|
+
de: "Verbunden. Du kannst dieses Fenster schließen.",
|
|
183
|
+
en: "Connected. You can close this window.",
|
|
184
|
+
},
|
|
185
|
+
connectFailed: {
|
|
186
|
+
de: "Verbinden hat nicht geklappt. Bitte noch einmal versuchen.",
|
|
187
|
+
en: "Connecting did not work. Try again.",
|
|
188
|
+
},
|
|
189
|
+
connectCancelled: { de: "Verbinden wurde abgebrochen.", en: "Connecting was cancelled." },
|
|
190
|
+
// Apple Intelligence on the Mac the runtime runs on (apps/runtime/src/harness/apple.ts).
|
|
191
|
+
appleOff: {
|
|
192
|
+
de: "Apple Intelligence ist auf diesem Mac ausgeschaltet. Einschalten unter Systemeinstellungen → Apple Intelligence & Siri.",
|
|
193
|
+
en: "Apple Intelligence is switched off on this Mac. Switch it on in System Settings → Apple Intelligence & Siri.",
|
|
194
|
+
},
|
|
195
|
+
appleLoading: {
|
|
196
|
+
de: "Apple lädt das Modell für Apple Intelligence noch auf diesen Mac. Gleich noch einmal versuchen.",
|
|
197
|
+
en: "Apple is still loading the model for Apple Intelligence onto this Mac. Try again in a moment.",
|
|
198
|
+
},
|
|
199
|
+
appleMissing: {
|
|
200
|
+
de: "Der Helfer für Apple Intelligence (wizards-apple) fehlt in dieser Installation.",
|
|
201
|
+
en: "The helper for Apple Intelligence (wizards-apple) is missing from this installation.",
|
|
202
|
+
},
|
|
203
|
+
appleOs: {
|
|
204
|
+
de: "Apple Intelligence braucht macOS 26 oder neuer.",
|
|
205
|
+
en: "Apple Intelligence needs macOS 26 or later.",
|
|
206
|
+
},
|
|
207
|
+
appleDevice: {
|
|
208
|
+
de: "Apple Intelligence gibt es nur auf einem Mac mit Apple Silicon.",
|
|
209
|
+
en: "Apple Intelligence is only there on a Mac with Apple silicon.",
|
|
210
|
+
},
|
|
211
|
+
appleBusy: {
|
|
212
|
+
de: "Apple Intelligence nimmt gerade keine weiteren Anfragen an. Gleich noch einmal versuchen.",
|
|
213
|
+
en: "Apple Intelligence takes no more requests right now. Try again in a moment.",
|
|
214
|
+
},
|
|
215
|
+
appleTooLong: {
|
|
216
|
+
de: "Apple Intelligence: Der Text ist zu lang für das Modell auf diesem Mac (4.096 Tokens für Frage und Antwort). Diese Klasse in den Einstellungen unter „Modelle“ auf ein anderes Modell legen.",
|
|
217
|
+
en: "Apple Intelligence: the text is too long for the model on this Mac (4,096 tokens for question and answer). Put this class on another model under “Models” in the settings.",
|
|
218
|
+
},
|
|
219
|
+
appleRefused: {
|
|
220
|
+
de: "Apple Intelligence hat die Anfrage abgelehnt: Apples Inhaltsregeln lassen sie nicht zu.",
|
|
221
|
+
en: "Apple Intelligence turned the request down: Apple's content rules do not allow it.",
|
|
222
|
+
},
|
|
223
|
+
appleLanguage: {
|
|
224
|
+
de: "Apple Intelligence versteht die Sprache dieser Anfrage nicht.",
|
|
225
|
+
en: "Apple Intelligence does not understand the language of this request.",
|
|
226
|
+
},
|
|
227
|
+
appleFormat: {
|
|
228
|
+
de: "Apple Intelligence kann dieses Antwortformat nicht liefern: {detail}",
|
|
229
|
+
en: "Apple Intelligence cannot answer in this format: {detail}",
|
|
230
|
+
},
|
|
231
|
+
appleFailed: { de: "Apple Intelligence: {detail}", en: "Apple Intelligence: {detail}" },
|
|
232
|
+
appleNoFfmpeg: {
|
|
233
|
+
de: "Apple Intelligence liest {type} nicht; ohne ffmpeg bleibt die Aufnahme so. ffmpeg installieren oder im Browser als MP4 aufnehmen.",
|
|
234
|
+
en: "Apple Intelligence cannot read {type}, and without ffmpeg the recording stays as it is. Install ffmpeg or record as MP4 in the browser.",
|
|
235
|
+
},
|
|
236
|
+
appleNotConverted: {
|
|
237
|
+
de: "Apple Intelligence: die Aufnahme ließ sich nicht wandeln: {detail}",
|
|
238
|
+
en: "Apple Intelligence: the recording could not be converted: {detail}",
|
|
239
|
+
},
|
|
106
240
|
};
|
|
107
241
|
/** A note in a language, its gaps filled. */
|
|
108
242
|
export function noteText(note, lang) {
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wizards",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.56",
|
|
4
4
|
"description": "Make a wish. Get your wizard. It guides you step by step. Let AI do the work. Runs on your machine, on the AI subscription you already have.",
|
|
5
5
|
"license": "FSL-1.1-MIT",
|
|
6
6
|
"homepage": "https://engenty.ai",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/engenty/
|
|
9
|
+
"url": "git+https://github.com/engenty/wizards.git"
|
|
10
10
|
},
|
|
11
11
|
"type": "module",
|
|
12
12
|
"bin": {
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Pro modules
|
|
3
|
-
description: engenty's closed plugins on a local install – signed packages from the linked account, on while its plan includes them.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Some of engenty's plugins are not part of the open product: they come with the Pro and Team
|
|
7
|
-
plans. On engenty.ai they are in the cloud runtime's image. A local install gets them from the
|
|
8
|
-
linked account, in Settings → Plugins → Pro modules.
|
|
9
|
-
|
|
10
|
-
## How a module gets there
|
|
11
|
-
|
|
12
|
-
1. Settings → Account links the install to an engenty account.
|
|
13
|
-
2. The runtime asks the account's Manage-App which modules are built for its release and which
|
|
14
|
-
of them the plan includes (`GET /v1/modules`,
|
|
15
|
-
[contract](https://github.com/engenty/engenty-wizards/blob/main/docs/manage-contract.md)).
|
|
16
|
-
The answer holds an entitlement the Manage-App signed: the team, the plan's modules, an end
|
|
17
|
-
about a week ahead.
|
|
18
|
-
3. "Install" downloads the module's zip. The runtime takes it only when its SHA-256 matches and
|
|
19
|
-
the signature over id, version, release and that hash checks out against the public key it
|
|
20
|
-
ships with (`apps/runtime/src/plugins/pro-keys.ts`). Nothing is unpacked before that.
|
|
21
|
-
4. The module lands in `<DATA_DIR>/pro-modules/<id>/`, apart from the person's own plugins, and
|
|
22
|
-
loads like any other plugin. Its tables are made in the space's database.
|
|
23
|
-
|
|
24
|
-
## When it is on
|
|
25
|
-
|
|
26
|
-
A Pro module loads at start and after every check only when all of these hold:
|
|
27
|
-
|
|
28
|
-
| | Otherwise |
|
|
29
|
-
|---|---|
|
|
30
|
-
| It was installed for this release | Held back; the next check fetches it again for the new release |
|
|
31
|
-
| The entitlement belongs to the account linked now | Held back |
|
|
32
|
-
| The entitlement has not ended | Held back until the install is online again |
|
|
33
|
-
| The entitlement lists it | Held back: not in the plan |
|
|
34
|
-
|
|
35
|
-
The runtime checks at start, once a day, when an account is linked and on "Check plan". Offline,
|
|
36
|
-
what was confirmed lasts until the entitlement ends. Unlinking the account turns every Pro
|
|
37
|
-
module off.
|
|
38
|
-
|
|
39
|
-
A module that goes off unloads; its files and its tables stay. It comes back with its data when
|
|
40
|
-
the plan includes it again. "Remove" deletes its files, not its tables.
|
|
41
|
-
|
|
42
|
-
## What this protects, and what not
|
|
43
|
-
|
|
44
|
-
- **Protected:** only a team whose plan includes a module can download it; a package that engenty
|
|
45
|
-
did not sign, or that was changed after signing, never loads – whatever the Manage-App or the
|
|
46
|
-
network in between hand over.
|
|
47
|
-
- **Not protected:** the code is on the person's machine. Someone who edits the runtime or its
|
|
48
|
-
data can keep a module on. The terms of use cover that; modules whose value is on the server
|
|
49
|
-
(models, the gateway) stay gated there anyway.
|
|
50
|
-
|
|
51
|
-
## Settings
|
|
52
|
-
|
|
53
|
-
| Variable | |
|
|
54
|
-
|---|---|
|
|
55
|
-
| `ACCOUNT_URL` | The Manage-App the account is linked to; the modules come from there |
|
|
56
|
-
| `PRO_MODULES_KEYS` | More public keys (Ed25519, SPKI DER in base64, comma-separated) a package may be signed with – for testing packages signed elsewhere |
|
|
57
|
-
|
|
58
|
-
A runtime of a Manage-App (`MANAGE_URL`) has no Pro modules: its plugins come with its image and
|
|
59
|
-
the Manage-App switches them on per tenant ([Shipping](./shipping)).
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{t as r}from"./logo-C4V2_3Ar.js";import{t as i}from"./preload-helper-CNEI7N0N.js";import{Ct as a,Gt as o,Mt as s,Tt as c,Wt as l,Yt as u,_t as d,ct as f,lt as p,mt as m,ot as h,rt as g,st as _,xt as v,yt as y}from"./ui-mkL5nF_f.js";import{$ as b,v as x}from"./index-Dq-Wj6Yo.js";import{c as S,f as C}from"./settings-menu-DX0JnPBR.js";import{ReleaseNotes as w,loadReleases as T,releaseDate as E,releaseLabel as D}from"./ChangelogDialog-BLmJABe4.js";var O=e(t(),1),k=[{name:`engenty wizards`,description:{de:`KI-Wizards aus einer Beschreibung, mit einem Link geteilt.`,en:`AI wizards built from a description, shared with a link.`},homepage:`https://github.com/engenty/engenty-wizards`,license:`FSL-1.1-MIT`},{name:`engenty`,description:{de:`Konnektoren, Datentabellen, Suche und die Engenties stammen aus dem engenty-Framework.`,en:`Connectors, data tables, search and the engenties come from the engenty framework.`},homepage:`https://github.com/engenty/engenty`,license:`FSL-1.1-MIT`}],A=[{name:`Mastra`,description:{de:`Agent-Framework hinter den KI-Schritten.`,en:`Agent framework behind the AI steps.`},homepage:`https://github.com/mastra-ai/mastra`,license:`Apache-2.0`},{name:`AI SDK`,description:{de:`Modell-Aufrufe für Text, Bild, Video und Sprache.`,en:`Model calls for text, image, video and speech.`},homepage:`https://github.com/vercel/ai`,license:`Apache-2.0`},{name:`Model Context Protocol`,description:{de:`MCP-Server zum Bauen von Wizards, MCP-Client für Werkzeuge der Schritte.`,en:`MCP server for building wizards, MCP client for the steps' tools.`},homepage:`https://github.com/modelcontextprotocol/typescript-sdk`,license:`MIT`},{name:`Hono`,description:{de:`HTTP-API der Runtime.`,en:`The runtime's HTTP API.`},homepage:`https://github.com/honojs/hono`,license:`MIT`},{name:`Drizzle ORM`,description:{de:`Schema und Migrationen der Datenbanken.`,en:`Schema and migrations of the databases.`},homepage:`https://github.com/drizzle-team/drizzle-orm`,license:`Apache-2.0`},{name:`libSQL`,description:{de:`Eine Datenbank je Mandant, lokal als Datei oder bei Turso.`,en:`One database per tenant, a local file or at Turso.`},homepage:`https://github.com/tursodatabase/libsql`,license:`MIT`},{name:`Playwright`,description:{de:`Browser-Schritte sowie PDF- und PNG-Export.`,en:`Browser steps and the PDF and PNG export.`},homepage:`https://github.com/microsoft/playwright`,license:`Apache-2.0`},{name:`agentOS`,description:{de:`Sandbox für Code-Schritte ohne Docker.`,en:`Sandbox for code steps without Docker.`},homepage:`https://github.com/rivet-dev/agentos`,license:`Apache-2.0`},{name:`React`,description:{de:`UI-Bibliothek der Web-App.`,en:`UI library of the web app.`},homepage:`https://github.com/facebook/react`,license:`MIT`},{name:`Vite`,description:{de:`Build-Werkzeug der Web-App.`,en:`Build tool of the web app.`},homepage:`https://github.com/vitejs/vite`,license:`MIT`},{name:`Tailwind CSS`,description:{de:`Styling der Oberfläche.`,en:`Styling of the interface.`},homepage:`https://github.com/tailwindlabs/tailwindcss`,license:`MIT`},{name:`React Flow`,description:{de:`Das Diagramm der Schritte im Editor.`,en:`The diagram of steps in the editor.`},homepage:`https://github.com/xyflow/xyflow`,license:`MIT`},{name:`TanStack Query`,description:{de:`Server-Daten in der Web-App.`,en:`Server data in the web app.`},homepage:`https://github.com/TanStack/query`,license:`MIT`},{name:`xterm.js`,description:{de:`Das Terminal auf der Seite, in dem sich KI-Clients anmelden.`,en:`The terminal on the page where AI clients sign in.`},homepage:`https://github.com/xtermjs/xterm.js`,license:`MIT`},{name:`Lucide`,description:{de:`Icons.`,en:`Icons.`},homepage:`https://github.com/lucide-icons/lucide`,license:`ISC`},{name:`Geist & Geist Mono`,description:{de:`Schrift der Oberfläche.`,en:`Typeface of the interface.`},homepage:`https://github.com/vercel/geist-font`,license:`OFL-1.1`},{name:`Space Grotesk`,description:{de:`Schrift der Überschriften.`,en:`Typeface of the headings.`},homepage:`https://github.com/floriankarsten/space-grotesk`,license:`OFL-1.1`},{name:`git-cliff`,description:{de:`Erzeugt den Changelog aus den Commits.`,en:`Generates the changelog from the commits.`},homepage:`https://github.com/orhun/git-cliff`,license:`MIT OR Apache-2.0`}],j=e(n(),1),M=(e,...t)=>t.some(t=>t?.toLowerCase().includes(e));function N({name:e,homepage:t,version:n,license:r,description:i}){return(0,j.jsxs)(`li`,{className:`py-2.5`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5`,children:[t?(0,j.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 font-medium text-[0.875rem] text-ink underline-offset-4 hover:underline`,children:[e,(0,j.jsx)(l,{"aria-hidden":!0,className:`size-3 text-ink-4`})]}):(0,j.jsx)(`span`,{className:`font-medium text-[0.875rem] text-ink`,children:e}),n?(0,j.jsx)(`span`,{className:`text-[0.75rem] text-ink-3 tabular-nums`,children:n}):null,(0,j.jsx)(`span`,{className:`text-[0.75rem] text-ink-3`,children:r})]}),i?(0,j.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:i}):null]})}function P({title:e,hint:t,children:n}){return(0,j.jsxs)(`section`,{className:`mt-6`,children:[(0,j.jsx)(`h3`,{className:`border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:e}),t?(0,j.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-ink-3`,children:t}):null,n]})}function F({credits:e}){return(0,j.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:e.map(e=>(0,j.jsx)(N,{name:e.name,homepage:e.homepage,license:e.license,description:e.description[v]},e.name))})}function I({label:e,packages:t}){return(0,j.jsxs)(`div`,{className:`mt-4`,children:[(0,j.jsx)(`h4`,{className:`font-medium text-[0.75rem] text-ink-3 tracking-wide`,children:e}),(0,j.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:t.map(e=>(0,j.jsx)(N,{...e},e.name))})]})}function L({active:e}){let[t,n]=(0,O.useState)(null),[r,o]=(0,O.useState)(``);(0,O.useEffect)(()=>{if(!e||t)return;let r=!1;return i(()=>import(`./oss-credits-BQQX0kvk.js`).then(e=>{r||n(e.default)}),[]),()=>{r=!0}},[e,t]),(0,O.useEffect)(()=>{e||o(``)},[e]);let s=r.trim().toLowerCase(),c=e=>s?e.filter(e=>M(s,e.name,e.license,e.description.de,e.description.en)):e,l=e=>s?e.filter(e=>M(s,e.name,e.license,e.version)):e,u=c(k),d=c(A),f=t?[{id:`shared`,label:a(`about.creditsShared`),packages:l(t.shared)},...t.groups.map(e=>({id:e.id,label:e.label,packages:l(e.packages)}))].filter(e=>e.packages.length>0):[],h=u.length===0&&d.length===0&&f.length===0;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`mb-4 text-[0.875rem] text-ink-3`,children:a(`about.creditsHint`)}),(0,j.jsx)(p,{type:`search`,value:r,placeholder:a(`about.search`),onChange:e=>o(e.target.value)}),u.length>0?(0,j.jsx)(P,{title:a(`about.creditsProduct`),children:(0,j.jsx)(F,{credits:u})}):null,d.length>0?(0,j.jsx)(P,{title:a(`about.creditsBuiltWith`),children:(0,j.jsx)(F,{credits:d})}):null,t===null?(0,j.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,j.jsx)(m,{})}):f.length>0?(0,j.jsx)(P,{title:a(`about.creditsDeps`),hint:s?void 0:a(`about.creditsDepsHint`),children:f.map(e=>(0,j.jsx)(I,{label:e.label,packages:e.packages},e.id))}):null,t!==null&&h?(0,j.jsx)(_,{children:a(`about.noMatches`)}):null]})}var R=[`new`,`earlier`,`credits`],z=e=>a(e===`new`?`about.tab.new`:e===`earlier`?`about.tab.earlier`:`about.credits`),B=e=>e===1?a(`about.change`):a(`about.changes`,{n:e});function V({open:e,onClose:t,me:n}){let i=n?.mode===`local`,{status:p,data:_,latest:v,check:k,apply:A,busy:M,progress:N}=x(i&&e),[P,F]=(0,O.useState)(null),[I,V]=(0,O.useState)(`new`),H=C(R.indexOf(I)),U=_?.newer&&v?v:b;(0,O.useEffect)(()=>{if(!e)return;let t=!1;return F(null),T(U===`0.2.55`?void 0:U).then(e=>{t||F(e)}),()=>{t=!0}},[e,U]);let W=P?.find(e=>e.version===`v${U}`)??P?.[0]??null,G=P?.filter(e=>e!==W)??[],K=i?_?.kind??null:`cloud`,q=_?.checkedAt?new Date(_.checkedAt).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`}):null;return(0,j.jsxs)(h,{open:e,onClose:t,wide:!0,height:`tall`,children:[(0,j.jsx)(`div`,{className:`-mt-2 -mr-2 sticky top-0 z-10 flex h-0 justify-end`,children:(0,j.jsx)(f,{label:a(`common.close`),onClick:t,children:(0,j.jsx)(c,{className:`size-4`})})}),(0,j.jsxs)(`div`,{className:`flex flex-col items-center pt-4 text-center`,children:[(0,j.jsx)(r,{size:96}),(0,j.jsxs)(`div`,{className:`mt-4 font-display font-semibold text-[1.5rem] tracking-tight`,children:[`engenty`,(0,j.jsx)(`span`,{className:`text-ember`,children:`.`}),(0,j.jsx)(`span`,{className:`ml-1.5 font-normal text-ink-3`,children:`wizards`})]}),(0,j.jsxs)(`div`,{className:`mt-1 text-[0.9375rem] text-ink-3 tabular-nums`,children:[a(`about.version`,{v:b}),K?` · ${a(`about.kind.${K}`)}`:``]})]}),i?(0,j.jsxs)(`div`,{className:`mt-5 flex flex-col items-center gap-3 text-center text-[0.875rem] text-ink-2`,children:[p.isPending||k.isPending?(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,j.jsx)(m,{className:`size-4 text-ember-strong`}),a(`about.update.checking`)]}):N?(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[M?(0,j.jsx)(m,{className:`size-4 text-ember-strong`}):null,N]}):_?.newer&&v?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5 font-medium text-ink`,children:[(0,j.jsx)(o,{className:`size-4 shrink-0 text-ember-strong`}),a(`about.update.available`,{v})]}),_.canApply?null:(0,j.jsx)(`p`,{className:`text-ink-3`,children:a(`about.update.manual`)})]}):_?.enabled?_.latest===null?(0,j.jsx)(`p`,{children:a(`about.update.unknown`)}):(0,j.jsxs)(`p`,{children:[a(`about.update.upToDate`),q?(0,j.jsxs)(`span`,{className:`text-ink-4`,children:[` `,`· `,a(`about.update.checkedAt`,{when:q})]}):null]}):(0,j.jsx)(`p`,{children:a(`about.update.off`)}),M||p.isPending?null:(0,j.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-2`,children:[_?.newer&&_.canApply&&_.applying!==`running`?(0,j.jsxs)(g,{size:`sm`,disabled:A.isPending,onClick:()=>A.mutate(),children:[(0,j.jsx)(o,{className:`size-4`}),` `,a(`about.update.install`)]}):null,_?.newer&&_.url?(0,j.jsxs)(g,{size:`sm`,variant:`secondary`,onClick:()=>window.open(_.url??``,`_blank`),children:[a(`about.update.release`),` `,(0,j.jsx)(l,{className:`size-4`})]}):null,_?.enabled===!1?null:(0,j.jsxs)(g,{size:`sm`,variant:`secondary`,disabled:k.isPending,onClick:()=>k.mutate(),children:[(0,j.jsx)(s,{className:y(`size-4`,k.isPending&&`animate-spin`)}),` `,a(`about.update.check`)]})]})]}):null,(0,j.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,j.jsx)(d,{value:I,onChange:V,options:R.map(e=>({id:e,label:z(e)})),label:a(`about.title`)})}),(0,j.jsxs)(`div`,{className:y(`mt-5`,S(H)),children:[I===`new`?P===null?(0,j.jsx)(`div`,{className:`flex justify-center py-6 text-ink-3`,children:(0,j.jsx)(m,{})}):W?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`h3`,{className:`flex items-baseline gap-3 border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:[D(W),(0,j.jsx)(`span`,{className:`font-normal font-sans text-[0.8125rem] text-ink-3 tabular-nums`,children:E(W)})]}),(0,j.jsx)(`div`,{className:`mt-3`,children:(0,j.jsx)(w,{release:W})})]}):(0,j.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:a(`about.changelogEmpty`)}):null,I===`earlier`?(0,j.jsx)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:G.map(e=>(0,j.jsxs)(`details`,{className:`group/r py-2`,children:[(0,j.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-baseline gap-3 text-[0.875rem] [&::-webkit-details-marker]:hidden`,children:[(0,j.jsx)(u,{className:`size-3.5 shrink-0 self-center text-ink-4 transition group-open/r:rotate-90`}),(0,j.jsx)(`span`,{className:`font-medium text-ink tabular-nums`,children:D(e)}),(0,j.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3 tabular-nums`,children:E(e)}),(0,j.jsx)(`span`,{className:`ml-auto text-[0.8125rem] text-ink-4`,children:B(e.commits.length)})]}),(0,j.jsx)(`div`,{className:`mt-2 pl-6`,children:(0,j.jsx)(w,{release:e})})]},e.version??`unreleased`))}):null,I===`credits`?(0,j.jsx)(L,{active:!0}):null]},I)]})}export{V as AboutDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{O as r,r as i}from"./logo-C4V2_3Ar.js";import{C as a,T as o,h as s,p as c,v as l,x as u,y as d}from"./Marketplace-B0Nki6J6.js";import{t as f}from"./useMutation-DKyQXgyj.js";import{Ct as p,Dt as m,F as h,It as g,Mt as _,Nt as v,Qt as y,Vt as b,Wt as x,Yt as S,Zt as C,a as w,at as T,cn as E,ct as D,dt as ee,fn as te,gt as ne,in as re,it as O,lt as k,mn as ie,mt as ae,on as oe,pn as se,pt as ce,qt as le,rt as A,st as ue,tn as de,xt as fe,yt as j}from"./ui-mkL5nF_f.js";import{t as pe}from"./circle-alert-BEDKtkJy.js";import{t as me}from"./lock-Ce2ofIWG.js";import{n as he,r as ge,t as _e}from"./ReadOnly-DiOfNtVr.js";import{t as ve}from"./volume-2-C3GeMqc-.js";import{f as ye,l as be,s as xe,t as Se}from"./session-BuVghS-e.js";import{N as Ce,Q as we,S as Te,U as Ee,V as M,W as De,_ as Oe,b as ke,c as Ae,et as je,h as Me,l as Ne,lt as Pe,ot as Fe,rt as Ie,s as Le,ut as Re,x as ze,y as Be}from"./index-Dq-Wj6Yo.js";import{a as N,c as Ve,d as He,f as Ue,i as P,l as We,n as Ge,o as Ke,r as qe,s as Je,t as Ye,u as Xe}from"./settings-menu-DX0JnPBR.js";import{t as Ze}from"./Harness-_riwRD-c.js";var Qe={name:`ear`,size:24,node:[[`path`,{d:`M6 8.5a6.5 6.5 0 1 1 13 0c0 6-6 6-6 10a3.5 3.5 0 1 1-7 0`,key:`1dfaln`}],[`path`,{d:`M15 8.5a2.5 2.5 0 0 0-5 0v1a2 2 0 1 1 0 4`,key:`1qnva7`}]]};Qe.node;var $e=re(Qe),et={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};et.node;var F=re(et),tt={name:`mail-plus`,size:24,node:[[`path`,{d:`M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8`,key:`12jkf8`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}],[`path`,{d:`M19 16v6`,key:`tddt3s`}],[`path`,{d:`M16 19h6`,key:`xwg31i`}]]};tt.node;var nt=re(tt),rt={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};rt.node;var it=re(rt),at={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};at.node;var ot=re(at),I=e(t(),1),L=e(n(),1);function st(){let e=Ne(),[t,n]=(0,I.useState)(null),[r,i]=(0,I.useState)(null),a=async e=>{n(e??`*`),i(null);try{await Ae(e)}catch(e){i(e.message)}finally{n(null)}};return(0,L.jsxs)(Ce,{title:p(`plugins.title`),hint:e.canReload?p(`plugins.hint`):p(`plugins.hintManaged`),action:e.canReload?(0,L.jsx)(A,{variant:`secondary`,busy:t===`*`,onClick:()=>void a(),children:p(`plugins.rescan`)}):null,children:[e.plugins.length||e.problems.length?null:(0,L.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:p(`plugins.none`)}),(0,L.jsxs)(`ul`,{className:`divide-y divide-border-soft`,children:[e.plugins.map(n=>{let r=e.failed[n.id];return(0,L.jsxs)(`li`,{className:`flex items-start gap-4 py-4 first:pt-0 last:pb-0`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1`,children:[(0,L.jsx)(`span`,{className:`font-medium text-[0.9375rem]`,children:n.name}),n.name===n.id?null:(0,L.jsxs)(`span`,{className:`font-mono text-[0.75rem] text-ink-4`,children:[n.id,` · `,n.version]})]}),n.description?(0,L.jsx)(`p`,{className:`mt-0.5 text-[0.875rem] text-ink-3`,children:n.description}):null,n.tools.length?(0,L.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5 text-[0.75rem] text-ink-3`,children:[p(`plugins.tools`),n.tools.map(e=>(0,L.jsx)(T,{children:e.id},e.id))]}):null,n.error?(0,L.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:p(`plugins.serverFailed`,{error:n.error})}):null,r?(0,L.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:p(`plugins.studioFailed`,{error:r})}):null]}),e.canReload?(0,L.jsx)(D,{label:p(`plugins.reload`),disabled:t!==null,onClick:()=>void a(n.id),children:(0,L.jsx)(it,{className:t===n.id?`size-4 animate-spin`:`size-4`})}):null]},n.id)}),e.problems.map(e=>(0,L.jsxs)(`li`,{className:`py-4 first:pt-0 last:pb-0`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1`,children:[(0,L.jsx)(T,{tone:`warn`,children:p(`plugins.problems`)}),(0,L.jsx)(`span`,{className:`break-all font-mono text-[0.75rem] text-ink-3`,children:e.path})]}),(0,L.jsx)(`p`,{className:`mt-1.5 text-[0.8125rem] text-ink-3`,children:e.message})]},e.path))]}),r?(0,L.jsx)(`p`,{className:`mt-4 text-[0.8125rem] text-rose`,children:r}):null]})}var ct=[`pro-modules`],lt=`/api/studio/plugins/-/pro`,ut={managed:`pro.held.plan`,not_installed:`pro.held.release`,release:`pro.held.release`,unconfirmed:`pro.held.unconfirmed`,plan:`pro.held.plan`},dt=e=>new Date(e).toLocaleDateString(fe===`de`?`de-AT`:`en-GB`,{day:`numeric`,month:`long`});function ft(){let e=r(),{canReload:t}=Ne(),n=i({queryKey:ct,queryFn:()=>w.get(lt),enabled:t}),a=t=>e.setQueryData(ct,t),o=f({mutationFn:()=>w.post(`${lt}/refresh`),onSuccess:a}),s=f({mutationFn:e=>w.post(`${lt}/${e}`),onSuccess:a}),c=f({mutationFn:e=>w.del(`${lt}/${e}`),onSuccess:a}),l=n.data,u=s.isPending||c.isPending,d=s.error??c.error??o.error;return t?(0,L.jsx)(Ce,{title:p(`pro.title`),hint:p(`pro.hint`),action:l?.linked?(0,L.jsx)(A,{variant:`secondary`,busy:o.isPending,onClick:()=>o.mutate(),children:p(`pro.check`)}):null,children:l?l.linked?(0,L.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 text-[0.8125rem] text-ink-3`,children:[(0,L.jsxs)(`span`,{children:[l.plan?p(`pro.plan`,{plan:l.plan.name}):null,l.plan&&l.expiresAt?` · `:null,l.expiresAt?p(`pro.confirmedUntil`,{date:dt(l.expiresAt)}):null]}),(0,L.jsxs)(A,{variant:`ghost`,onClick:()=>M(`${l.accountUrl}/billing`),children:[p(`pro.plans`),` `,(0,L.jsx)(x,{className:`size-4`})]})]}),l.error?(0,L.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:l.error}):null,l.modules.length?(0,L.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:l.modules.map(e=>(0,L.jsxs)(`li`,{className:`flex items-start gap-4 py-4 first:pt-0 last:pb-0`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1`,children:[(0,L.jsx)(`span`,{className:`font-medium text-[0.9375rem]`,children:e.name}),(0,L.jsxs)(`span`,{className:`font-mono text-[0.75rem] text-ink-4`,children:[e.id,` · `,e.installed?.version??e.version]}),e.loaded?(0,L.jsx)(T,{tone:`live`,children:p(`pro.on`)}):null,e.included?null:(0,L.jsx)(T,{children:p(`pro.notInPlan`)}),e.installed&&e.heldBack&&e.included?(0,L.jsx)(T,{tone:`warn`,children:p(ut[e.heldBack])}):null]}),e.description?(0,L.jsx)(`p`,{className:`mt-0.5 text-[0.875rem] text-ink-3`,children:e.description}):null]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[e.included&&(!e.installed||e.update)?(0,L.jsx)(A,{busy:s.isPending&&s.variables===e.id,disabled:u,onClick:()=>s.mutate(e.id),children:e.installed?p(`pro.update`):p(`pro.install`)}):null,e.installed?(0,L.jsx)(A,{variant:`secondary`,busy:c.isPending&&c.variables===e.id,disabled:u,onClick:()=>c.mutate(e.id),children:p(`pro.remove`)}):null]})]},e.id))}):(0,L.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:p(`pro.none`,{runtime:l.runtime})}),d?(0,L.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:d.message}):null]}):(0,L.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:p(`pro.notLinked`)}):(0,L.jsx)(ae,{})}):null}function pt({connector:e}){let[t,n]=(0,I.useState)(!1);return(0,L.jsxs)(`div`,{className:`rounded-lg bg-paper ring-1 ring-border-soft`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`flex w-full items-center gap-3 px-3 py-2 text-left`,children:[(0,L.jsx)(`span`,{className:j(`size-2 shrink-0 rounded-full`,e.usable?`bg-moss`:`bg-ink-4`)}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-[0.8125rem]`,children:[e.name,` `,(0,L.jsx)(`span`,{className:`font-mono text-[0.6875rem] text-ink-4`,children:e.id})]}),(0,L.jsx)(`span`,{className:`shrink-0 text-[0.75rem] text-ink-3`,children:e.usable?p(`connectors.actions`,{n:e.actions.length,r:e.actions.filter(e=>e.group===`read`).length}):p(`connectors.notSetUp`)})]}),t?(0,L.jsxs)(`div`,{className:`border-border-soft border-t px-3 py-2 text-[0.75rem]`,children:[e.missingSetup?(0,L.jsxs)(`p`,{className:`mb-1 text-ink-3`,children:[p(`connectors.setup`),` `,(0,L.jsx)(`span`,{className:`font-mono text-ink-2`,children:e.missingSetup})]}):null,(0,L.jsx)(`p`,{className:`text-ink-4`,children:e.actions.map(e=>e.group===`read`?e.id:`${e.id} (${p(`connectors.group.${e.group}`)})`).join(` · `)})]}):null]})}var mt={none:`connectors.authNone`,oauth2:`connectors.authOauth`,api_key:`connectors.authKey`};function ht({projectId:e,connector:t,readOnly:n}){let i=r(),[a,o]=(0,I.useState)(!1),c=()=>i.invalidateQueries({queryKey:[`connectors`,e]}),l=`/api/studio/projects/${e}/connectors/${t.id}`,u=f({mutationFn:()=>w.post(`${l}/refresh`),onSuccess:c}),d=f({mutationFn:()=>w.del(l),onSuccess:c}),h=t.actions.filter(e=>e.group===`read`).length;return(0,L.jsxs)(`div`,{className:`rounded-lg bg-paper ring-1 ring-border-soft`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 p-3`,children:[(0,L.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-paper-2 text-ink-2`,children:(0,L.jsx)(s,{className:`size-4`})}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:`min-w-0 flex-1 text-left`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`truncate font-medium text-[0.875rem]`,children:t.name}),(0,L.jsx)(`span`,{className:`font-mono text-[0.6875rem] text-ink-4`,children:t.id})]}),(0,L.jsxs)(`div`,{className:`truncate text-[0.75rem] text-ink-3`,children:[t.domain,` · `,t.sourceKind===`mcp`?`MCP`:`OpenAPI`,` ·`,` `,p(mt[t.auth]),` ·`,` `,t.toolsPending?p(`connectors.pending`):p(`connectors.actions`,{n:t.actions.length,r:h})]})]}),n?null:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(D,{label:p(`connectors.refresh`),onClick:()=>u.mutate(),children:u.isPending?(0,L.jsx)(ae,{className:`size-4`}):(0,L.jsx)(_,{className:`size-4`})}),(0,L.jsx)(D,{label:p(`connectors.remove`),className:`hover:text-rose`,onClick:()=>confirm(`${t.name}: ${p(`connectors.remove`)}?`)&&d.mutate(),children:(0,L.jsx)(m,{className:`size-4`})})]})]}),t.needsOAuthClient?(0,L.jsx)(`p`,{className:`border-border-soft border-t px-3 py-2 text-[0.75rem] text-rose`,children:p(`connectors.needsClient`)}):null,u.error??d.error?(0,L.jsx)(`p`,{className:`border-border-soft border-t px-3 py-2 text-[0.75rem] text-rose`,children:(u.error??d.error).message}):null,a&&t.actions.length?(0,L.jsx)(`ul`,{className:`max-h-64 overflow-y-auto border-border-soft border-t px-3 py-2`,children:t.actions.map(e=>(0,L.jsxs)(`li`,{className:`flex items-baseline gap-2 py-1 text-[0.75rem]`,children:[(0,L.jsx)(`span`,{className:j(`w-14 shrink-0 text-[0.6875rem] uppercase tracking-wide`,e.group===`read`?`text-moss`:e.group===`write`?`text-ink-3`:`text-rose`),children:p(`connectors.group.${e.group}`)}),(0,L.jsx)(`span`,{className:`shrink-0 font-mono text-ink-2`,children:e.id}),(0,L.jsx)(`span`,{className:`min-w-0 truncate text-ink-4`,children:e.summary})]},e.id))}):null]})}function gt({projectId:e,domain:t,source:n,taken:i,onDone:a}){let o=r(),[s,c]=(0,I.useState)({id:``,secret:``}),[l,u]=(0,I.useState)(!1),d=i.includes(n.suggestedId),m=f({mutationFn:()=>w.post(`/api/studio/projects/${e}/connectors`,{domain:t,sourceKind:n.sourceKind,sourceUrl:n.sourceUrl,id:n.suggestedId,toolPrefix:n.suggestedToolPrefix,...n.name?{name:n.name}:{},...s.id&&s.secret?{oauthClientId:s.id,oauthClientSecret:s.secret}:{}}),onSuccess:async t=>{await o.invalidateQueries({queryKey:[`connectors`,e]}),a(t.warnings)}});return(0,L.jsxs)(`div`,{className:`rounded-lg bg-card p-3 ring-1 ring-border-soft`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(T,{tone:n.sourceKind===`mcp`?`ember`:`neutral`,children:n.sourceKind===`mcp`?`MCP`:`OpenAPI`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`div`,{className:`truncate text-[0.8125rem]`,children:n.name??n.suggestedId}),(0,L.jsx)(`div`,{className:`truncate font-mono text-[0.6875rem] text-ink-4`,children:n.sourceUrl})]}),n.blocked||d?null:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>u(e=>!e),className:`text-[0.75rem] text-ink-3 hover:text-ink`,children:p(`connectors.ownClient`)}),(0,L.jsx)(A,{size:`sm`,busy:m.isPending,onClick:()=>m.mutate(),children:p(`connectors.import`)})]})]}),n.blocked?(0,L.jsx)(`p`,{className:`mt-2 text-[0.75rem] text-ink-3`,children:n.blocked}):null,d?(0,L.jsx)(`p`,{className:`mt-2 text-[0.75rem] text-ink-3`,children:p(`connectors.exists`)}):null,l?(0,L.jsxs)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-2`,children:[(0,L.jsx)(k,{placeholder:`OAuth Client-ID`,value:s.id,onChange:e=>c(t=>({...t,id:e.target.value}))}),(0,L.jsx)(k,{type:`password`,autoComplete:`off`,placeholder:`OAuth Client-Secret`,value:s.secret,onChange:e=>c(t=>({...t,secret:e.target.value}))})]}):null,m.error?(0,L.jsx)(`p`,{className:`mt-2 text-[0.75rem] text-rose`,children:m.error.message}):null]})}function _t({projectId:e,readOnly:t}){let n=we(`unsetConnectors`),[r,a]=(0,I.useState)(``),[o,s]=(0,I.useState)(null),[l,u]=(0,I.useState)(null),[d,m]=(0,I.useState)([]),h=i({queryKey:[`connectors`,e],queryFn:()=>w.get(`/api/studio/projects/${e}/connectors`)}),g=f({mutationFn:()=>w.post(`/api/studio/connectors/search`,{query:r}),onSuccess:e=>{s(e),u(null),m([])}}),_=f({mutationFn:e=>w.get(`/api/studio/connectors/registry/${encodeURIComponent(e)}`),onSuccess:u}),v=h.data??[],y=v.filter(e=>e.sourceKind===`builtin`&&(n||e.usable)),b=v.filter(e=>e.sourceKind!==`builtin`);return(0,L.jsxs)(O,{className:`p-4 sm:p-6`,children:[(0,L.jsx)(`h2`,{className:`font-display font-semibold text-lg`,children:p(`connectors.title`)}),(0,L.jsx)(`p`,{className:`mt-1 mb-5 text-[0.875rem] text-ink-3`,children:p(`connectors.hint`)}),y.length?(0,L.jsx)(`div`,{className:`mb-5 grid gap-1.5 sm:grid-cols-2`,children:y.map(e=>(0,L.jsx)(pt,{connector:e},e.id))}):null,(0,L.jsx)(`h3`,{className:`mb-2 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.07em]`,children:p(`connectors.imported`)}),b.length?(0,L.jsx)(`div`,{className:`mb-4 flex flex-col gap-2`,children:b.map(n=>(0,L.jsx)(ht,{projectId:e,connector:n,readOnly:t},n.id))}):null,t?b.length?null:(0,L.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:p(`connectors.noneImported`)}):(0,L.jsxs)(`form`,{className:`flex gap-2`,onSubmit:e=>{e.preventDefault(),r.trim()&&g.mutate()},children:[(0,L.jsx)(k,{value:r,placeholder:p(`connectors.search`),onChange:e=>a(e.target.value)}),(0,L.jsxs)(A,{type:`submit`,variant:`secondary`,busy:g.isPending,children:[(0,L.jsx)(c,{className:`size-4`}),` `,p(`connectors.find`)]})]}),g.error?(0,L.jsx)(`p`,{className:`mt-3 text-[0.8125rem] text-rose`,children:g.error.message}):null,o&&!l?(0,L.jsxs)(`div`,{className:`mt-3 flex flex-col gap-1`,children:[o.length?null:(0,L.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:p(`connectors.none`)}),o.map(e=>(0,L.jsxs)(`button`,{type:`button`,disabled:!e.kinds.length,onClick:()=>_.mutate(e.domain),className:`flex items-center gap-3 rounded-lg px-3 py-2 text-left transition hover:bg-paper-2 disabled:opacity-50`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`div`,{className:`truncate text-[0.875rem]`,children:e.domain}),(0,L.jsx)(`div`,{className:`truncate text-[0.75rem] text-ink-3`,children:e.description})]}),(0,L.jsx)(`span`,{className:`text-[0.6875rem] text-ink-4 uppercase`,children:e.kinds.join(` · `)}),(0,L.jsx)(C,{className:`-rotate-90 size-4 text-ink-4`})]},e.domain)),_.isPending?(0,L.jsx)(ae,{className:`mx-auto mt-2 size-4 text-ink-4`}):null,_.error?(0,L.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:_.error.message}):null]}):null,l?(0,L.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,L.jsx)(`div`,{className:`font-medium text-[0.875rem]`,children:l.domain}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>u(null),className:`text-[0.75rem] text-ink-3 hover:text-ink`,children:p(`run.back`)})]}),l.summary?(0,L.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:l.summary}):null,l.sources.map(t=>(0,L.jsx)(gt,{projectId:e,domain:l.domain,source:t,taken:v.map(e=>e.id),onDone:m},`${t.sourceKind}:${t.sourceUrl}`)),l.credentials.filter(e=>e.setup||e.url).map(e=>(0,L.jsxs)(`p`,{className:`text-[0.75rem] text-ink-3`,children:[(0,L.jsxs)(`span`,{className:`text-ink-2`,children:[e.label,`:`]}),` `,e.setup,` `,e.url?(0,L.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:`text-ember underline`,children:e.url}):null]},e.label)),d.map(e=>(0,L.jsx)(`p`,{className:`text-[0.75rem] text-ink-3`,children:e},e))]}):null]})}var R=`engenty-wizards`,vt=`engenty wizards`,yt=`ENGENTY_WIZARDS_KEY`,bt=[{id:`claude-desktop`,name:`Claude Desktop`,widgets:!0,connector:!0},{id:`claude-code`,name:`Claude Code`,widgets:!1},{id:`codex`,name:`Codex · ChatGPT app`,widgets:!1},{id:`cursor`,name:`Cursor`,widgets:!0},{id:`vscode`,name:`VS Code (Copilot)`,widgets:!0},{id:`windsurf`,name:`Windsurf`,widgets:!1},{id:`gemini`,name:`Gemini CLI`,widgets:!1},{id:`goose`,name:`Goose`,widgets:!0},{id:`openclaw`,name:`OpenClaw`,widgets:!1},{id:`lm-studio`,name:`LM Studio`,widgets:!1},{id:`claude-ai`,name:`claude.ai`,widgets:!0,oauth:!0},{id:`chatgpt`,name:`ChatGPT`,widgets:!0,oauth:!0}],xt={"claude-ai":{open:`https://claude.ai/settings/connectors`,where:`integrate.claudeAiWhere`,host:`claude.ai`},"claude-desktop":{where:`integrate.desktopWhere`,host:`claude.ai`},chatgpt:{where:`integrate.chatgptWhere`,host:`chatgpt.com`}};function z({text:e,muted:t}){let[n,r]=(0,I.useState)(!1);return(0,L.jsxs)(`div`,{className:j(`flex items-start gap-2 rounded-lg bg-paper-2 p-3`,t&&`text-ink-3 opacity-80`),children:[(0,L.jsx)(`code`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-all font-mono text-[0.75rem] leading-relaxed`,children:e}),(0,L.jsx)(D,{label:p(n?`settings.copied`:`settings.copy`),onClick:async()=>{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500)},children:n?(0,L.jsx)(y,{className:`size-4`}):(0,L.jsx)(le,{className:`size-4`})})]})}function St(e){try{let t=new URL(e);return t.protocol===`https:`&&!/(^|\.)localhost$/.test(t.hostname)&&!/^(127\.|10\.|192\.168\.|\[::1\])/.test(t.hostname)}catch{return!1}}function B({children:e}){return(0,L.jsx)(`p`,{className:`text-[0.875rem] text-ink-3 leading-relaxed`,children:e})}function V({title:e,children:t}){return(0,L.jsxs)(`section`,{className:`flex flex-col gap-2.5 border-border-soft border-t pt-5 first:border-t-0 first:pt-0`,children:[(0,L.jsx)(`h3`,{className:`font-medium text-[0.9375rem]`,children:e}),t]})}var Ct=`https://github.com/engenty/engenty-wizards-wordpress/releases/latest/download/engenty-wizards.zip`;function wt({managed:e}){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{className:`font-display font-semibold text-[1.375rem] leading-tight tracking-tight`,children:`WordPress`}),(0,L.jsx)(`p`,{className:`mt-1 text-[0.9375rem] text-ink-2`,children:p(`integrate.wpIntro`)})]}),(0,L.jsxs)(O,{className:`flex flex-col gap-5 p-5`,children:[(0,L.jsxs)(V,{title:p(`integrate.wpInstall`),children:[(0,L.jsx)(B,{children:p(`integrate.wpInstallHint`)}),(0,L.jsx)(`div`,{children:(0,L.jsx)(A,{variant:`secondary`,size:`sm`,onClick:()=>window.open(Ct,`_blank`),children:p(`integrate.wpDownload`)})})]}),(0,L.jsx)(V,{title:p(`integrate.wpConnect`),children:(0,L.jsx)(B,{children:p(e?`integrate.wpConnectHint`:`integrate.wpConnectLocal`)})}),(0,L.jsxs)(V,{title:p(`integrate.wpPlace`),children:[(0,L.jsx)(B,{children:p(`integrate.wpPlaceHint`)}),(0,L.jsx)(z,{text:`[engenty_wizard id="ID" mode="modal" label="Anfrage starten"]`})]}),(0,L.jsx)(V,{title:p(`integrate.wpPro`),children:(0,L.jsx)(B,{children:p(`integrate.wpProHint`)})}),(0,L.jsx)(V,{title:p(`integrate.wpLocal`),children:(0,L.jsx)(B,{children:p(`integrate.wpLocalHint`)})})]})]})}function Tt(e,t){return JSON.stringify({[e]:{[R]:t}},null,2)}function Et({id:e,url:t,apiKey:n}){let r=n?`Authorization: Bearer ${n}`:null,i=n?{headers:{Authorization:`Bearer ${n}`}}:{};switch(e){case`claude-code`:{let e=t.replace(/\/api\/mcp$/,`/api/claude-plugin`);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B,{children:p(`mcp.terminal`)}),(0,L.jsx)(z,{text:`claude mcp add --transport http --scope user ${R} ${t}${r?` --header "${r}"`:``}`}),!n&&St(t)?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B,{children:p(`mcp.ccPlugin`)}),(0,L.jsx)(z,{text:`claude plugin marketplace add ${e}/marketplace.json`}),(0,L.jsx)(z,{text:`claude plugin install ${R}@engenty`})]}):null]})}case`codex`:return n?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B,{children:p(`mcp.codexKey`)}),(0,L.jsx)(z,{text:`echo 'export ${yt}=${n}' >> ~/.zshrc && source ~/.zshrc`}),(0,L.jsx)(z,{text:`codex mcp add ${R} --url ${t} --bearer-token-env-var ${yt}`})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B,{children:p(`mcp.terminal`)}),(0,L.jsx)(z,{text:`codex mcp add ${R} --url ${t}`}),(0,L.jsx)(z,{text:`codex mcp login ${R}`})]});case`gemini`:return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B,{children:p(`mcp.terminal`)}),(0,L.jsx)(z,{text:`gemini mcp add --scope user --transport http ${R} ${t}${r?` -H "${r}"`:``}`})]});case`cursor`:return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B,{children:p(`integrate.file`,{file:`~/.cursor/mcp.json`})}),(0,L.jsx)(z,{text:Tt(`mcpServers`,{url:t,...i})})]});case`vscode`:return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B,{children:p(`integrate.vscode`)}),(0,L.jsx)(z,{text:Tt(`servers`,{type:`http`,url:t,...i})})]});case`windsurf`:return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B,{children:p(`integrate.file`,{file:`~/.codeium/windsurf/mcp_config.json`})}),(0,L.jsx)(z,{text:Tt(`mcpServers`,{serverUrl:t,...i})})]});case`lm-studio`:return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B,{children:p(`integrate.file`,{file:`~/.lmstudio/mcp.json`})}),(0,L.jsx)(z,{text:Tt(`mcpServers`,{url:t,...i})})]});case`claude-desktop`:case`claude-ai`:return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B,{children:p(`mcp.claudeAi`)}),(0,L.jsx)(z,{text:t})]});case`chatgpt`:return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B,{children:p(`integrate.chatgpt`)}),(0,L.jsx)(z,{text:t})]});default:return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B,{children:p(`integrate.generic`)}),(0,L.jsx)(z,{text:t}),r?(0,L.jsx)(z,{text:r}):null]})}}function Dt(){let e=r(),t=i({queryKey:[`api-keys`],queryFn:()=>w.get(`/api/studio/api-keys`)}),n=f({mutationFn:e=>w.del(`/api/studio/api-keys/${e}`),onSuccess:()=>e.invalidateQueries({queryKey:[`api-keys`]})});return t.data?.length?(0,L.jsxs)(`section`,{children:[(0,L.jsx)(`h2`,{className:`font-display font-semibold text-lg`,children:p(`mcp.keys`)}),(0,L.jsx)(`p`,{className:`mt-1 mb-4 text-[0.875rem] text-ink-3`,children:p(`mcp.keysHint`)}),(0,L.jsx)(O,{className:`flex flex-col gap-2 p-3`,children:t.data.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg px-3 py-2`,children:[(0,L.jsx)(F,{className:`size-4 shrink-0 text-ink-4`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`div`,{className:`truncate text-[0.875rem]`,children:e.name}),(0,L.jsxs)(`div`,{className:`font-mono text-[0.6875rem] text-ink-4`,children:[e.start,`… ·`,` `,e.lastRequest?p(`settings.lastUsed`,{when:new Date(e.lastRequest).toLocaleString()}):p(`settings.neverUsed`)]})]}),(0,L.jsx)(D,{label:p(`settings.revoke`),onClick:()=>n.mutate(e.id),className:`hover:text-rose`,children:(0,L.jsx)(m,{className:`size-4`})})]},e.id))})]}):null}function Ot(e,t){return t?.toolAt?`works`:e?.connected||t?`added`:`none`}var kt={works:`done`,added:`on`,none:void 0},At={works:`integrate.stateWorks`,added:`integrate.stateAdded`,none:`integrate.stateNone`};function jt({standing:e}){return e===`none`?(0,L.jsx)(`span`,{className:`w-2 text-center text-ink-4 leading-none`,children:`–`}):(0,L.jsx)(`span`,{className:j(`size-2 shrink-0 rounded-full`,e===`works`?`bg-moss`:`bg-ember`)})}function Mt(){return(0,L.jsx)(`div`,{className:`mt-5 flex flex-col gap-1.5 rounded-lg bg-paper-2 px-3 py-2.5 text-[0.75rem] text-ink-3`,children:[`works`,`added`,`none`].map(e=>(0,L.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,L.jsx)(jt,{standing:e}),p(At[e])]},e))})}function H({client:e,signIn:t}){let n=(e,t)=>(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full bg-card px-2.5 py-1 text-[0.8125rem] text-ink-2 ring-1 ring-border-soft`,children:[e,t]}),r=(0,L.jsx)(y,{className:`size-3.5 text-moss`,strokeWidth:3});return(0,L.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[n(r,p(`integrate.outRun`)),e.widgets?n(r,p(`integrate.outWidget`)):n((0,L.jsx)(ge,{className:`size-3.5 text-ink-3`}),p(`integrate.outText`)),t?n((0,L.jsx)(me,{className:`size-3.5 text-ink-3`}),p(`integrate.outSignIn`)):null]})}function U({client:e,works:t,children:n}){return(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,L.jsx)(`h2`,{className:`font-display font-semibold text-[1.375rem] leading-tight tracking-tight`,children:e.name}),t?(0,L.jsx)(T,{tone:`live`,icon:(0,L.jsx)(y,{className:`size-3.5`,strokeWidth:3}),children:p(`integrate.works`)}):null]}),n]})}function W({n:e,state:t,title:n,children:r}){return(0,L.jsxs)(`li`,{"aria-current":t===`now`?`step`:void 0,className:j(`grid grid-cols-[28px_minmax(0,1fr)] gap-x-3.5 rounded-xl px-3 py-3`,t===`now`&&`bg-ember-tint/40 ring-1 ring-ember-strong/25`),children:[(0,L.jsx)(`span`,{className:j(`grid size-7 place-items-center rounded-full font-semibold text-[0.8125rem]`,t===`done`&&`bg-moss text-white`,(t===`now`||t===`todo`)&&`bg-primary text-primary-foreground`,t===`later`&&`bg-paper text-ink-3 ring-1 ring-border`),children:t===`done`?(0,L.jsx)(y,{className:`size-3.5`,strokeWidth:3}):e}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 pt-1`,children:[(0,L.jsx)(`span`,{className:j(`font-medium text-[0.9375rem]`,t===`later`&&`text-ink-2`),children:n}),r?(0,L.jsx)(`div`,{className:j(`flex flex-col gap-2`,t===`later`&&`opacity-70`),children:r}):null]})]})}function Nt({children:e}){return(0,L.jsxs)(O,{className:`p-3 sm:p-4`,children:[(0,L.jsx)(`h3`,{className:`px-3 pt-2 pb-2 font-medium text-[0.9375rem]`,children:p(`integrate.steps`)}),(0,L.jsx)(`ol`,{className:`flex flex-col gap-1`,children:e})]})}function Pt({app:e}){return(0,L.jsxs)(`p`,{className:`flex items-center gap-2 text-[0.8125rem] text-ember-strong`,children:[(0,L.jsx)(`span`,{className:`size-2 rounded-full bg-ember`}),p(`integrate.waiting`,{app:e})]})}function Ft({client:e,seen:t}){let n=(e,t)=>(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[e?(0,L.jsx)(y,{className:`size-3.5 text-moss`,strokeWidth:3}):(0,L.jsx)(`span`,{className:`size-2.5 rounded-full ring-2 ring-ink-4 ring-inset`}),t]});return(0,L.jsxs)(`p`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-[0.8125rem] text-ink-2`,children:[n(!!t,p(`integrate.checkSeen`)),n(!!t?.toolAt,p(`integrate.checkTool`)),e.widgets?n(!!t?.widgetAt,p(`integrate.checkWidget`)):null]})}function It(){let e=ye().data,{project:t}=xe(),n=i({queryKey:[`wizards`,t?.id,!!e?.account],queryFn:()=>w.get(`/api/studio/projects/${t.id}/wizards`),enabled:!!t}).data??[];return n.find(e=>e.published)??n[0]??null}function Lt({client:e,footer:t}){let n=It(),r=n?[{label:p(`integrate.labelRun`),text:p(`integrate.askRun`,{title:n.title})},{label:p(`integrate.labelBuild`),text:p(`integrate.askBuild`)},{label:p(`integrate.labelExplain`),text:p(`integrate.askExplain`,{title:n.title})}]:[{label:p(`integrate.labelAsk`),text:p(`integrate.askTool`)},{label:p(`integrate.labelBuild`),text:p(`integrate.askBuild`)}];return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(O,{className:`flex flex-col gap-4 p-5 sm:p-6`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h3`,{className:`font-medium text-[0.9375rem]`,children:p(`integrate.next`)}),(0,L.jsx)(B,{children:p(`integrate.nextHint`,{app:e.name})})]}),(0,L.jsx)(`ul`,{className:`flex flex-col gap-2`,children:r.map(e=>(0,L.jsxs)(`li`,{className:`grid items-start gap-1 sm:grid-cols-[5.5rem_minmax(0,1fr)] sm:gap-3`,children:[(0,L.jsx)(`span`,{className:`pt-3 text-[0.75rem] text-ink-3`,children:e.label}),(0,L.jsx)(z,{text:e.text})]},e.label))})]}),e.widgets?null:(0,L.jsxs)(`p`,{className:`flex items-start gap-3 rounded-xl bg-paper-2 px-4 py-3 text-[0.875rem] text-ink-2 leading-relaxed`,children:[(0,L.jsx)(ge,{className:`mt-0.5 size-4 shrink-0 text-ink-3`}),p(`integrate.textOnly`,{app:e.name})]}),t]})}function Rt({children:e}){return(0,L.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-[0.8125rem] text-ink-3`,children:e})}var G=`inline-flex items-center gap-1 text-ember-strong underline-offset-2 transition hover:underline`;function zt({client:e,local:t,seen:n,url:i}){let a=r(),[o,s]=(0,I.useState)(!1),[c,l]=(0,I.useState)(null),[u,m]=(0,I.useState)(!1),h=f({mutationFn:t=>w.post(`/api/studio/local/apps/${e.id}`,{connect:t}),onSuccess:e=>l(e),onError:e=>l({ok:!1,message:e.message}),onSettled:()=>a.invalidateQueries({queryKey:[`local-apps`]})}),g=!!t?.connected,_=!!n?.toolAt;if(o)return(0,L.jsx)(Bt,{client:e,seen:n,url:i,onBack:()=>s(!1)});let y=t=>(0,L.jsxs)(L.Fragment,{children:[t?(0,L.jsx)(`span`,{children:p(`integrate.addedIn`,{app:e.name})}):null,(0,L.jsxs)(`button`,{type:`button`,className:G,onClick:()=>m(!u),children:[p(`integrate.details`),(0,L.jsx)(S,{className:j(`size-3.5 transition`,u&&`rotate-90`)})]}),(0,L.jsx)(`button`,{type:`button`,className:G,disabled:h.isPending,onClick:()=>h.mutate(!1),children:p(`mcp.appsDisconnect`)})]}),b=u&&t?.where?(0,L.jsx)(`p`,{className:`w-full font-mono text-[0.6875rem] text-ink-4`,children:t.where}):null;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,L.jsx)(U,{client:e,works:_,children:(0,L.jsx)(H,{client:e})}),_?(0,L.jsx)(Lt,{client:e,footer:(0,L.jsxs)(Rt,{children:[y(!0),b]})}):(0,L.jsxs)(Nt,{children:[(0,L.jsxs)(W,{n:1,state:g?`done`:`now`,title:p(g?`integrate.connected`:`integrate.connect`,{app:e.name}),children:[g?(0,L.jsxs)(Rt,{children:[y(!1),b]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B,{children:t?.installed===!1?p(`integrate.notInstalled`,{app:e.name}):p(`integrate.connectHint`,{app:e.name})}),(0,L.jsx)(`div`,{children:(0,L.jsxs)(A,{busy:h.isPending,onClick:()=>h.mutate(!0),children:[(0,L.jsx)(v,{className:`size-4`}),` `,p(`integrate.connect`,{app:e.name})]})})]}),c&&!c.ok?(0,L.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:c.message}):null,c?.snippet?(0,L.jsx)(z,{text:c.snippet}):null]}),(0,L.jsx)(W,{n:2,state:n?`done`:g?`now`:`later`,title:p(`integrate.restart`,{app:e.name}),children:n?null:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B,{children:p(`integrate.restartHint`)}),g?(0,L.jsx)(Pt,{app:e.name}):null]})}),(0,L.jsxs)(W,{n:3,state:n?`now`:`later`,title:p(`integrate.try`),children:[(0,L.jsx)(B,{children:p(`integrate.tryHint`)}),(0,L.jsx)(z,{text:p(`integrate.askTool`),muted:!n})]})]}),(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-[0.875rem] text-ink-2`,children:[(0,L.jsx)(d,{className:`size-4 text-ink-3`}),p(`integrate.elsewhere`,{app:e.name}),(0,L.jsx)(`button`,{type:`button`,className:G,onClick:()=>s(!0),children:p(`integrate.byAddress`)})]})]})}function Bt({client:e,seen:t,url:n,onBack:i}){let a=r(),[o,s]=(0,I.useState)(),c=f({mutationFn:()=>w.post(`/api/studio/api-keys`,{name:e.name.slice(0,32)}),onSuccess:async e=>{s(e.key),await a.invalidateQueries({queryKey:[`api-keys`]})}}),l=(0,L.jsx)(`p`,{className:`text-[0.875rem]`,children:(0,L.jsxs)(`button`,{type:`button`,className:G,onClick:i,children:[(0,L.jsx)(Ie,{className:`size-4`}),p(`integrate.backHere`)]})});return t?.toolAt?(0,L.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,L.jsx)(U,{client:e,works:!0,children:(0,L.jsx)(H,{client:e})}),(0,L.jsx)(Lt,{client:e,footer:l})]}):(0,L.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,L.jsx)(U,{client:e,works:!1,children:(0,L.jsx)(H,{client:e})}),(0,L.jsxs)(Nt,{children:[(0,L.jsx)(W,{n:1,state:o?`done`:`now`,title:o?p(`integrate.keyReady`):p(`integrate.keyCreate`,{app:e.name}),children:o?null:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B,{children:p(`integrate.keyHint`,{app:e.name})}),(0,L.jsx)(`div`,{children:(0,L.jsxs)(A,{variant:`secondary`,busy:c.isPending,onClick:()=>c.mutate(),children:[(0,L.jsx)(F,{className:`size-4`}),` `,p(`integrate.keyCreate`,{app:e.name})]})})]})}),(0,L.jsx)(W,{n:2,state:o?t?`done`:`now`:`later`,title:p(`integrate.add`),children:o&&!t?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Et,{id:e.id,url:n,apiKey:o}),(0,L.jsx)(`p`,{className:`text-[0.75rem] text-ink-4`,children:p(`integrate.addressLocal`)}),(0,L.jsx)(Pt,{app:e.name})]}):null}),(0,L.jsxs)(W,{n:3,state:t?`now`:`later`,title:p(`integrate.try`),children:[(0,L.jsx)(B,{children:p(`integrate.tryHint`)}),(0,L.jsx)(z,{text:p(`integrate.askTool`),muted:!t})]})]}),l]})}function Vt({app:e,host:t}){return(0,L.jsxs)(`div`,{"aria-hidden":`true`,className:`flex w-56 shrink-0 flex-col items-center gap-2 rounded-xl bg-paper px-4 py-3.5 text-center ring-1 ring-border-soft`,children:[(0,L.jsx)(`span`,{className:`font-display font-semibold text-[0.8125rem] leading-snug`,children:p(`integrate.consentPreview`,{app:e})}),(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[0.6875rem] text-moss`,children:[(0,L.jsx)(me,{className:`size-3`}),t]}),(0,L.jsxs)(`span`,{className:`flex w-full gap-1.5`,children:[(0,L.jsx)(`span`,{className:`h-5 flex-1 rounded-full bg-card ring-1 ring-border`}),(0,L.jsx)(`span`,{className:`h-5 flex-1 rounded-full bg-primary`})]})]})}function Ht({client:e,url:t,seen:n,tracked:r,accountUrl:i}){let a=xt[e.id]??xt[`claude-desktop`],o=e.id===`chatgpt`?`ChatGPT`:`Claude`;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(Nt,{children:[(0,L.jsx)(W,{n:1,state:`todo`,title:p(`integrate.open`,{app:e.name}),children:a.open?(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,L.jsxs)(A,{onClick:()=>M(a.open),children:[p(`integrate.openConnectors`),(0,L.jsx)(x,{className:`size-4`})]}),(0,L.jsx)(B,{children:p(a.where)})]}):(0,L.jsx)(B,{children:p(a.where)})}),(0,L.jsx)(W,{n:2,state:`todo`,title:p(`integrate.nameAddress`),children:(0,L.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`span`,{className:`text-[0.75rem] text-ink-3`,children:p(`integrate.name`)}),(0,L.jsx)(z,{text:vt})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`span`,{className:`text-[0.75rem] text-ink-3`,children:p(`integrate.address`)}),(0,L.jsx)(z,{text:t})]})]})}),(0,L.jsx)(W,{n:3,state:n?`done`:`todo`,title:p(`integrate.allow`),children:n?null:(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,L.jsx)(`p`,{className:`min-w-0 flex-[1_1_16rem] text-[0.875rem] text-ink-3 leading-relaxed`,children:p(`integrate.allowHint`)}),(0,L.jsx)(Vt,{app:o,host:a.host})]})}),(0,L.jsxs)(W,{n:4,state:n?.toolAt?`done`:n?`now`:`later`,title:p(`integrate.try`),children:[n?.toolAt?null:(0,L.jsx)(z,{text:p(`integrate.askTool`),muted:!n}),r?(0,L.jsx)(Ft,{client:e,seen:n}):null]})]}),i?(0,L.jsx)(Ut,{accountUrl:i}):null]})}function Ut({accountUrl:e}){return(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 text-[0.8125rem] text-ink-3`,children:[p(`integrate.revoke`),(0,L.jsxs)(`button`,{type:`button`,className:G,onClick:()=>M(e),children:[p(`integrate.revokeLink`),(0,L.jsx)(de,{className:`size-3.5`})]})]})}function Wt({client:e,me:t,onDesktop:n}){let r=t.account?.signedIn?t.account:null,i=Te(!!r),a=t.features.account===!0;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,L.jsx)(U,{client:e,works:!1,children:(0,L.jsx)(`p`,{className:`mt-2 max-w-2xl text-[0.9375rem] text-ink-2 leading-relaxed`,children:p(`integrate.remoteWhy`,{app:e.name})})}),r?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`p`,{className:`flex items-start gap-2 text-[0.875rem] text-ink-2`,children:[(0,L.jsx)(Re,{className:`mt-0.5 size-4 shrink-0 text-ink-3`}),p(`integrate.linked`,{email:r.email,app:e.name})]}),(0,L.jsx)(Ht,{client:e,url:`${r.cloudUrl}/api/mcp`,tracked:!1,accountUrl:r.url})]}):a?(0,L.jsxs)(O,{className:`flex flex-col gap-5 p-5 sm:p-6`,children:[(0,L.jsx)(`h3`,{className:`font-medium text-[0.9375rem]`,children:p(`integrate.viaAccount`)}),(0,L.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[{icon:Ie,title:p(`integrate.tileHere`),text:p(`integrate.tileHereText`)},{icon:Re,title:`engenty.ai`,text:p(`integrate.tileCloudText`)},{icon:Fe,title:e.name,text:p(`integrate.tileAppText`)}].map(e=>(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-paper px-4 py-3.5`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,L.jsx)(e.icon,{className:`size-4 text-ink-2`}),e.title]}),(0,L.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3 leading-relaxed`,children:e.text})]},e.title))}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,L.jsxs)(A,{busy:i.link.isPending,onClick:()=>i.link.mutate({}),children:[(0,L.jsx)(Re,{className:`size-4`}),` `,p(`integrate.linkAccount`)]}),(0,L.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3`,children:p(`integrate.linkHint`,{app:e.name})})]}),(0,L.jsx)(ze,{...i})]}):null,r?null:(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 rounded-xl bg-paper-2 px-4 py-3 text-[0.875rem] text-ink-2`,children:[p(`integrate.noAccount`),(0,L.jsxs)(`button`,{type:`button`,className:G,onClick:n,children:[p(`integrate.useDesktop`),(0,L.jsx)(de,{className:`size-3.5`})]})]})]})}function Gt({client:e,seen:t,url:n,me:r}){let i=!!t?.toolAt,a=r.manageUrl?`${r.manageUrl}/account`:null;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,L.jsx)(U,{client:e,works:i,children:(0,L.jsx)(H,{client:e,signIn:!0})}),i?(0,L.jsx)(Lt,{client:e}):(0,L.jsxs)(Nt,{children:[(0,L.jsx)(W,{n:1,state:t?`done`:`now`,title:p(`integrate.add`),children:t?null:(0,L.jsx)(Et,{id:e.id,url:n})}),(0,L.jsx)(W,{n:2,state:t?`done`:`later`,title:p(`integrate.allowFirst`),children:t?null:(0,L.jsx)(B,{children:p(`integrate.allowFirstHint`,{app:e.name})})}),(0,L.jsx)(W,{n:3,state:t?`now`:`later`,title:p(`integrate.try`),children:(0,L.jsx)(z,{text:p(`integrate.askTool`),muted:!t})})]}),a?(0,L.jsx)(Ut,{accountUrl:a}):null]})}function Kt({client:e,standing:t,onOpen:n,onConnect:r,busy:i}){return(0,L.jsxs)(O,{className:`flex flex-col gap-3 p-4`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(`span`,{className:`grid size-10 shrink-0 place-items-center rounded-[10px] bg-paper-2 text-ink-2`,children:e.widgets?(0,L.jsx)(o,{className:`size-5`}):(0,L.jsx)(ot,{className:`size-5`})}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`div`,{className:`truncate font-medium`,children:e.name}),(0,L.jsxs)(`div`,{className:j(`flex items-center gap-1.5 text-[0.8125rem]`,t===`works`&&`font-medium text-moss`,t===`added`&&`text-ember-strong`,t===`none`&&`text-ink-3`),children:[t===`works`?(0,L.jsx)(y,{className:`size-3.5`,strokeWidth:3}):null,p(At[t])]})]})]}),(0,L.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[0.75rem] text-ink-3`,children:[e.widgets?(0,L.jsx)(o,{className:`size-3.5`}):(0,L.jsx)(ge,{className:`size-3.5`}),p(e.widgets?`integrate.outWidget`:`integrate.outText`)]}),(0,L.jsx)(`div`,{children:t===`none`&&r?(0,L.jsx)(A,{size:`sm`,variant:`secondary`,busy:i,onClick:r,children:p(`integrate.connectShort`)}):(0,L.jsx)(A,{size:`sm`,variant:t===`added`?`primary`:`secondary`,onClick:n,children:p(t===`works`?`integrate.view`:t===`added`?`integrate.testIt`:`integrate.connectShort`)})})]})}function qt({managed:e,here:t,web:n,standing:i,open:a}){let o=r(),s=f({mutationFn:e=>w.post(`/api/studio/local/apps/${e}`,{connect:!0}),onSettled:()=>o.invalidateQueries({queryKey:[`local-apps`]}),onSuccess:(e,t)=>a(t)}),c=(e,t)=>(0,L.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-[repeat(auto-fill,minmax(15rem,1fr))]`,children:e.map(e=>(0,L.jsx)(Kt,{client:e,standing:i(e.id),onOpen:()=>a(e.id),onConnect:t?()=>s.mutate(e.id):void 0,busy:s.isPending&&s.variables===e.id},e.id))});return(0,L.jsxs)(`div`,{className:`flex flex-col gap-9`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{className:`font-display font-semibold text-[1.625rem] leading-tight tracking-tight`,children:p(`integrate.title`)}),(0,L.jsx)(`p`,{className:`mt-2 max-w-2xl text-[0.9375rem] text-ink-2 leading-relaxed`,children:p(e?`integrate.introManaged`:`integrate.intro`)})]}),e?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(`h3`,{className:`font-display font-semibold text-lg`,children:p(`integrate.groupBrowser`)}),c(n,!1)]}),(0,L.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(`h3`,{className:`font-display font-semibold text-lg`,children:p(`integrate.groupDesktop`)}),c(t,!1)]})]}):(0,L.jsxs)(L.Fragment,{children:[t.length?(0,L.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(`h3`,{className:`font-display font-semibold text-lg`,children:p(`integrate.found`)}),c(t,!0)]}):null,(0,L.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(`h3`,{className:`font-display font-semibold text-lg`,children:p(`integrate.groupCloud`)}),(0,L.jsxs)(O,{className:`flex flex-wrap items-center gap-4 p-5`,children:[(0,L.jsx)(`span`,{className:`grid size-10 shrink-0 place-items-center rounded-[10px] bg-paper-2 text-ink-2`,children:(0,L.jsx)(Re,{className:`size-5`})}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-[1_1_18rem]`,children:[(0,L.jsx)(`div`,{className:`font-medium`,children:p(`integrate.cloudTitle`)}),(0,L.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3 leading-relaxed`,children:p(`integrate.cloudText`)})]}),(0,L.jsx)(A,{variant:`secondary`,onClick:()=>a(`claude-ai`),children:p(`integrate.cloudButton`)})]})]})]})]})}function Jt(){let e=ye(),t=e.data?.mode===`managed`,n=i({queryKey:[`local-apps`],queryFn:()=>w.get(`/api/studio/local/apps`),enabled:e.data?.mode===`local`}),r=i({queryKey:[`integrations-seen`],queryFn:()=>w.get(`/api/studio/integrations/seen`),refetchInterval:2500}),[a,s]=ie(),{narrow:c}=He(),l=a.get(`show`),u=bt.find(e=>e.id===l)??null;if(We(l===`wordpress`?`WordPress`:u?.name??null),!e.data||!t&&!n.data)return null;let f=e=>n.data?.find(t=>t.id===e),m=e=>r.data?.[e],h=e=>Ot(f(e),m(e)),g=e=>s({show:e},{replace:!c}),_=e=>!!(f(e.id)?.installed||f(e.id)?.connected),v=bt.filter(e=>e.oauth),y=bt.filter(e=>!e.oauth&&(t||_(e))),x=t?[]:bt.filter(e=>!e.oauth&&!_(e)),S=e.data.mcpUrl??``,C=e=>(0,L.jsx)(N,{icon:e.oauth?Re:e.widgets?o:ot,label:e.name,tone:kt[h(e.id)],toneLabel:p(At[h(e.id)]),selected:e.id===u?.id,onPick:()=>g(e.id)},e.id),T=e.data.manageUrl?`${e.data.manageUrl}/account`:null,E;return E=l===`wordpress`?(0,L.jsx)(wt,{managed:t}):u?t&&(u.oauth||u.connector)?St(S)?(0,L.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,L.jsx)(U,{client:u,works:!!m(u.id)?.toolAt,children:(0,L.jsx)(H,{client:u,signIn:!0})}),m(u.id)?.toolAt?(0,L.jsx)(Lt,{client:u,footer:T?(0,L.jsx)(Ut,{accountUrl:T}):null}):(0,L.jsx)(Ht,{client:u,url:S,seen:m(u.id),tracked:!0,accountUrl:T})]}):(0,L.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,L.jsx)(U,{client:u,works:!1}),(0,L.jsx)(B,{children:p(`integrate.needsPublic`,{app:u.name})})]}):t?(0,L.jsx)(Gt,{client:u,seen:m(u.id),url:S,me:e.data}):u.oauth?(0,L.jsx)(Wt,{client:u,me:e.data,onDesktop:()=>g(`claude-desktop`)}):(0,L.jsx)(zt,{client:u,local:f(u.id),seen:m(u.id),url:S}):(0,L.jsx)(qt,{managed:t,here:y,web:v,standing:h,open:g}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-10`,children:[(0,L.jsxs)(Je,{children:[(0,L.jsx)(P,{label:p(t?`integrate.groupBrowser`:`integrate.groupHere`),children:(t?v:y).map(C)}),(0,L.jsx)(P,{label:p(t?`integrate.groupDesktop`:`integrate.groupCloud`),children:(t?y:v).map(C)}),x.length?(0,L.jsx)(P,{label:p(`integrate.groupMore`),collapsible:!0,open:x.some(e=>e.id===u?.id),count:x.length,children:x.map(C)}):null,(0,L.jsxs)(P,{label:p(`integrate.groupShare`),children:[(0,L.jsx)(N,{icon:b,label:p(`integrate.shareLink`),badge:(0,L.jsx)(`span`,{className:`text-[0.6875rem] text-ink-4`,children:p(`integrate.soon`)}),selected:!1,disabled:!0}),(0,L.jsx)(N,{icon:d,label:`WordPress`,selected:l===`wordpress`,onPick:()=>g(`wordpress`)}),(0,L.jsx)(N,{icon:d,label:p(`integrate.shareSite`),badge:(0,L.jsx)(`span`,{className:`text-[0.6875rem] text-ink-4`,children:p(`integrate.soon`)}),selected:!1,disabled:!0})]}),(0,L.jsx)(Mt,{})]}),(0,L.jsx)(`div`,{children:E},u?.id??`start`),t||l===`wordpress`?null:(0,L.jsx)(Dt,{})]})}var Yt=[`text`,`image`,`video`,`speech`,`listening`],Xt={text:[`classifier`,`standard`,`high`,`highest`],image:[`image`],video:[`video`],speech:[`speech`],listening:[`audio`]},Zt=`credits`,Qt=`${Zt}:`;function $t(e){return e===`credits`||!!e?.startsWith(Qt)}function en(e){return e?.startsWith(Qt)&&e.slice(Qt.length)||null}function tn(e){return e?`${Qt}${e}`:Zt}function nn(e){return e===`transcription`?`listening`:e}var rn=[`openai`,`anthropic`,`google`,`fal`,`elevenlabs`,`replicate`,`gateway`],K=(e,t)=>({de:e,en:t}),an=[{id:`openai`,name:`OpenAI`,about:K(`GPT-Modelle, GPT Image und Stimmen.`,`GPT models, GPT Image and voices.`),keyUrl:`https://platform.openai.com/api-keys`,keyPlaceholder:`sk-…`,text:{classifier:`openai:gpt-5.4-mini`,standard:`openai:gpt-5.4-mini`,high:`openai:gpt-5.5`,highest:`openai:gpt-5.5`},models:{text:[{ref:`openai:gpt-5.4-mini`,label:`GPT-5.4 mini`,note:K(`schnell`,`fast`)},{ref:`openai:gpt-5.5`,label:`GPT-5.5`,note:K(`gründlich`,`thorough`)}],image:[{ref:`openai:gpt-image-2`,label:`GPT Image 2`,note:K(`vielseitig`,`versatile`)},{ref:`openai:gpt-image-1-mini`,label:`GPT Image 1 mini`,note:K(`günstig`,`low cost`)}],speech:[{ref:`openai:gpt-4o-mini-tts`,label:`GPT-4o mini TTS`,note:K(`günstig`,`low cost`)}],listening:[{ref:`openai:gpt-4o-mini-transcribe`,label:`GPT-4o mini Transcribe`,note:K(`schnell, günstig`,`fast, low cost`)},{ref:`openai:whisper-1`,label:`Whisper`}]}},{id:`anthropic`,name:`Anthropic`,about:K(`Die Claude-Modelle.`,`The Claude models.`),keyUrl:`https://console.anthropic.com/settings/keys`,keyPlaceholder:`sk-ant-…`,text:{classifier:`anthropic:claude-haiku-4-5`,standard:`anthropic:claude-haiku-4-5`,high:`anthropic:claude-sonnet-5-5`,highest:`anthropic:claude-opus-5-5`},models:{text:[{ref:`anthropic:claude-haiku-4-5`,label:`Claude Haiku 4.5`,note:K(`schnell`,`fast`)},{ref:`anthropic:claude-sonnet-5-5`,label:`Claude Sonnet 5.5`},{ref:`anthropic:claude-opus-5-5`,label:`Claude Opus 5.5`,note:K(`am stärksten`,`strongest`)}]}},{id:`google`,name:`Google Gemini`,about:K(`Gemini, Veo für Videos und Stimmen – ein Key aus dem AI Studio.`,`Gemini, Veo for video and voices – one key from AI Studio.`),keyUrl:`https://aistudio.google.com/apikey`,keyPlaceholder:`AIza…`,text:{classifier:`google:gemini-flash-lite-latest`,standard:`google:gemini-flash-latest`,high:`google:gemini-pro-latest`,highest:`google:gemini-pro-latest`},models:{text:[{ref:`google:gemini-flash-lite-latest`,label:`Gemini Flash-Lite`,note:K(`günstig`,`low cost`)},{ref:`google:gemini-flash-latest`,label:`Gemini Flash`},{ref:`google:gemini-pro-latest`,label:`Gemini Pro`,note:K(`gründlich`,`thorough`)}],image:[{ref:`google:gemini-3.1-flash-image-preview`,label:`Gemini 3.1 Flash Image`,note:K(`schnell, bearbeitet Fotos`,`fast, edits photos`)},{ref:`google:gemini-3-pro-image-preview`,label:`Gemini 3 Pro Image`,note:K(`beste Qualität`,`best quality`)}],video:[{ref:`google:veo-3.1-fast-generate-preview`,label:`Veo 3.1 Fast`,note:K(`mit Ton`,`with sound`)},{ref:`google:veo-3.1-generate-preview`,label:`Veo 3.1`,note:K(`beste Qualität`,`best quality`)}],speech:[{ref:`google:gemini-3.8-flash-tts`,label:`Gemini Flash TTS`}],listening:[{ref:`google:gemini-flash-lite-latest`,label:`Gemini Flash-Lite`}]}},{id:`fal`,name:`fal.ai`,about:K(`Hunderte Bild-, Video- und Audio-Modelle mit einem Key: FLUX, Recraft, Veo, Luma, MiniMax.`,`Hundreds of image, video and audio models with one key: FLUX, Recraft, Veo, Luma, MiniMax.`),keyUrl:`https://fal.ai/dashboard/keys`,keyPlaceholder:`xxxxxxxx-…:…`,models:{image:[{ref:`fal:fal-ai/flux/schnell`,label:`FLUX.1 schnell`,note:K(`schnell, günstig`,`fast, low cost`)},{ref:`fal:fal-ai/flux-pro/v1.1`,label:`FLUX 1.1 pro`,note:K(`hohe Qualität`,`high quality`)},{ref:`fal:fal-ai/recraft/v3/text-to-image`,label:`Recraft V3`,note:K(`Grafiken, Logos, Text im Bild`,`graphics, logos, text in images`)},{ref:`fal:fal-ai/imagen4/preview`,label:`Imagen 4`,note:K(`fotorealistisch`,`photorealistic`)}],video:[{ref:`fal:veo3/fast`,label:`Veo 3 Fast`,note:K(`mit Ton`,`with sound`)},{ref:`fal:luma-ray-2-flash`,label:`Luma Ray 2 Flash`,note:K(`schnell`,`fast`)},{ref:`fal:minimax-video`,label:`MiniMax Hailuo`}],speech:[{ref:`fal:fal-ai/minimax/speech-02-turbo`,label:`MiniMax Speech-02 Turbo`,note:K(`schnell`,`fast`)},{ref:`fal:fal-ai/minimax/speech-02-hd`,label:`MiniMax Speech-02 HD`}],listening:[{ref:`fal:wizper`,label:`Wizper`,note:K(`schnell`,`fast`)},{ref:`fal:whisper`,label:`Whisper`}]}},{id:`elevenlabs`,name:`ElevenLabs`,about:K(`Natürliche Stimmen in vielen Sprachen und genaue Transkripte.`,`Natural voices in many languages and accurate transcripts.`),keyUrl:`https://elevenlabs.io/app/settings/api-keys`,keyPlaceholder:`sk_…`,models:{speech:[{ref:`elevenlabs:eleven_multilingual_v2`,label:`Multilingual v2`,note:K(`natürlich, viele Sprachen`,`natural, many languages`)},{ref:`elevenlabs:eleven_flash_v2_5`,label:`Flash v2.5`,note:K(`schnell, günstig`,`fast, low cost`)},{ref:`elevenlabs:eleven_v3`,label:`Eleven v3`,note:K(`ausdrucksstark`,`expressive`)}],listening:[{ref:`elevenlabs:scribe_v2`,label:`Scribe v2`,note:K(`sehr genau`,`very accurate`)}]}},{id:`replicate`,name:`Replicate`,about:K(`Offene Bild- und Video-Modelle, abgerechnet pro Lauf.`,`Open image and video models, billed per run.`),keyUrl:`https://replicate.com/account/api-tokens`,keyPlaceholder:`r8_…`,models:{image:[{ref:`replicate:black-forest-labs/flux-schnell`,label:`FLUX.1 schnell`,note:K(`schnell, günstig`,`fast, low cost`)},{ref:`replicate:black-forest-labs/flux-1.1-pro`,label:`FLUX 1.1 pro`},{ref:`replicate:recraft-ai/recraft-v3`,label:`Recraft V3`}],video:[{ref:`replicate:minimax/video-01`,label:`MiniMax Video-01`}]}},{id:`gateway`,name:`Vercel AI Gateway`,about:K(`Ein Key für die Modelle vieler Anbieter, abgerechnet bei Vercel.`,`One key for many providers' models, billed by Vercel.`),keyUrl:`https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai-gateway%2Fapi-keys`,keyPlaceholder:`vck_…`,text:{classifier:`anthropic/claude-haiku-4.5`,standard:`anthropic/claude-haiku-4.5`,high:`anthropic/claude-sonnet-5.5`,highest:`anthropic/claude-sonnet-5.5`},models:{text:[{ref:`anthropic/claude-haiku-4.5`,label:`Claude Haiku 4.5`,note:K(`schnell`,`fast`)},{ref:`anthropic/claude-sonnet-5.5`,label:`Claude Sonnet 5.5`},{ref:`openai/gpt-5.5`,label:`GPT-5.5`},{ref:`google/gemini-3.5-flash`,label:`Gemini 3.5 Flash`}],image:[{ref:`google/gemini-3.1-flash-image`,label:`Gemini 3.1 Flash Image`}],video:[{ref:`google/veo-3.1-fast-generate-001`,label:`Veo 3.1 Fast`,note:K(`mit Ton`,`with sound`)}],speech:[{ref:`google/gemini-3.8-flash-tts`,label:`Gemini Flash TTS`}],listening:[{ref:`google/gemini-3.5-flash-lite`,label:`Gemini 3.5 Flash-Lite`}]}}];function q(e){return an.find(t=>t.id===e)??null}function on(e){if($t(e))return null;let t=/^([a-z]+):/.exec(e)?.[1];return t?rn.includes(t)?t:null:e?.includes(`/`)?`gateway`:null}function J(e){for(let t of an)for(let n of Object.values(t.models)){let t=n?.find(t=>t.ref===e);if(t)return t.label}return e.replace(/^[a-z]+:/,``)}function sn(e,t){let n=t===`auto`?e.mode===`managed`:t===`cloud`,r=t===`auto`||t===`linked`?e.account??(t===`linked`?{name:e.user.name,email:e.user.email,credits:1250,expiring:[],url:``,cloudUrl:``,signedIn:!0}:null):null;return{cloud:n,account:n?null:r,credits:n||!!r?.signedIn,balance:n?e.credits??(t===`cloud`?1250:null):r?.credits??null,topUp:Me(e),harnesses:n?[]:e.harnesses,canEdit:!n||e.tenant.role!==`member`,ownKeys:!n||e.features.ownKeys!==!1}}var cn={text:g,image:l,video:a,speech:ve,listening:$e},Y={text:`standard`,image:`image`,video:`video`,speech:`speech`,listening:`audio`},X=e=>e===`text`,ln=(e,t)=>e?.[t]??``;function un(e,t){return JSON.stringify(e)===JSON.stringify(t)}function dn(e,t,n){let r=Y[t];if(X(t)&&!n.cloud){if(e.source===`account`)return{kind:`credits`};if(e.source!==`own`)return{kind:`client`,id:e.source}}let i=e.bindings[r];if($t(i))return{kind:`credits`};if(i?.startsWith(`ollama:`))return{kind:`local`,by:`ollama`};if(i?.startsWith(`apple:`))return{kind:`local`,by:`apple`};let a=i?on(i):null;if(a)return{kind:`key`,provider:a};if(i&&/^(claude|codex|gemini|cursor)\//.test(i))return{kind:`client`,id:i.split(`/`)[0]};let o=e.ways[r];switch(o.kind){case`client`:return{kind:`client`,id:o.by};case`key`:return q(o.by??``)?{kind:`key`,provider:o.by}:null;case`local`:return{kind:`local`,by:o.by===`apple`?`apple`:`ollama`};case`credits`:return{kind:`credits`};default:return null}}function fn(e,t,n){if(X(t)&&e.text)return e.text;let r=Y[t],i=n.bindings[r],a=i&&on(i)===e.id?i:e.models[t]?.[0]?.ref;return a?{[r]:a}:{}}function pn(e){return e.version===null?{note:p(`models.noteMissing`),noteTone:`warn`}:e.auth===`none`?{note:p(`models.noteSignedOut`),noteTone:`warn`}:e.auth===`api_key`?{note:p(`models.noteShellKey`)}:{note:p(`models.noteIncluded`),noteTone:`done`}}function mn(e,t){switch(e.kind){case`client`:return{text:t.harnesses.find(t=>t.id===e.by)?.name??e.by??``,tone:`done`};case`key`:return{text:q(e.by??``)?.name??e.by??``,tone:`done`};case`local`:return{text:e.by===`apple`?p(`models.optApple`):p(`models.way.local`),tone:`done`};case`credits`:return{text:t.cloud?p(`models.way.creditsTeam`):p(`models.way.credits`),tone:`ok`};default:return{text:p(`models.way.none`),tone:`warn`}}}function hn(){return i({queryKey:[`models`],queryFn:()=>w.get(`/api/studio/models`)})}function Z(){let e=r();return f({mutationFn:e=>w.put(`/api/studio/models`,e),onSuccess:async t=>{e.setQueryData([`models`],t),await e.invalidateQueries({queryKey:[`me`]})}})}function Q({title:e,aside:t,children:n}){return(0,L.jsxs)(`section`,{className:`flex flex-col gap-3 border-border-soft border-t pt-5 first:border-t-0 first:pt-0`,children:[(0,L.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,L.jsx)(`h3`,{className:`font-medium text-[0.875rem]`,children:e}),t]}),n]})}function $({children:e}){return(0,L.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:e})}function gn({text:e,tone:t}){return(0,L.jsxs)(`span`,{className:j(`inline-flex h-7 shrink-0 items-center gap-1.5 rounded-full px-3 font-medium text-[0.75rem]`,t===`done`&&`bg-moss-tint text-moss`,t===`ok`&&`bg-amber-tint text-ink-2`,t===`warn`&&`bg-paper-2 text-ink-3`),children:[t===`done`?(0,L.jsx)(y,{className:`size-3.5`,strokeWidth:3}):null,t===`ok`?(0,L.jsx)(u,{className:`size-3.5`}):null,t===`warn`?(0,L.jsx)(pe,{className:`size-3.5`}):null,e]})}function _n({icon:e,title:t,lead:n,status:r}){return(0,L.jsxs)(`div`,{className:`flex items-start gap-3 sm:gap-4`,children:[(0,L.jsx)(`span`,{className:`grid size-10 shrink-0 place-items-center rounded-xl bg-ember-tint text-ember-strong`,children:(0,L.jsx)(e,{className:`size-5`})}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,L.jsx)(`h2`,{className:`font-display font-semibold text-[1.375rem] leading-tight tracking-tight`,children:t}),r]}),(0,L.jsx)(`p`,{className:`mt-0.5 text-[0.875rem] text-ink-3`,children:n})]})]})}function vn({label:e,children:t}){return(0,L.jsxs)(`div`,{className:`grid items-start gap-x-4 gap-y-1.5 sm:grid-cols-[7.5rem_minmax(0,1fr)]`,children:[(0,L.jsx)(`span`,{className:`pt-2 text-[0.75rem] text-ink-3`,children:e}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t})]})}function yn({selected:e,title:t,note:n,noteTone:r,disabled:i,onPick:a}){return(0,L.jsxs)(`button`,{type:`button`,onClick:a,disabled:i,"aria-pressed":e,title:n,className:j(`inline-flex h-9 items-center gap-1.5 rounded-full border px-3.5 text-[0.8125rem] transition coarse:h-11`,e?`border-ember bg-ember-tint font-medium text-ink`:r===`done`?`border-input bg-card text-ink hover:border-ink-4`:`border-border-soft border-dashed text-ink-3 hover:border-ink-4 hover:text-ink`,i&&`cursor-not-allowed opacity-50`),children:[r===`done`?(0,L.jsx)(y,{className:`size-3.5 text-moss`,strokeWidth:3}):null,t,(0,L.jsxs)(`span`,{className:`sr-only`,children:[`: `,n]})]})}function bn({provider:e,stored:t,place:n}){let r=Z(),[i,a]=(0,I.useState)(``),[o,s]=(0,I.useState)(!1),[c,l]=(0,I.useState)(null),u=f({mutationFn:t=>w.post(`/api/studio/models/keys/${e.id}/check`,t?{key:t}:{})}),d=async()=>{l(null);let t=await u.mutateAsync(i.trim());if(!t.ok){l({ok:!1,message:t.message??p(`models.keyBad`)});return}await r.mutateAsync({keys:{[e.id]:i.trim()}}),a(``),s(!1),l({ok:!0,message:p(`models.keyOk`)})},m=!t||o;return n.ownKeys?(0,L.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[m?(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(k,{type:`password`,autoComplete:`off`,className:`min-w-0 flex-1 font-mono text-[0.8125rem]`,placeholder:e.keyPlaceholder,value:i,disabled:!n.canEdit,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&i.trim()&&d()}}),(0,L.jsx)(A,{busy:u.isPending||r.isPending,disabled:!i.trim()||!n.canEdit,onClick:()=>void d(),children:p(`models.keySave`)}),o?(0,L.jsx)(A,{variant:`ghost`,onClick:()=>s(!1),children:p(`common.cancel`)}):null]}):(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-2 text-[0.875rem] text-ink-2`,children:[(0,L.jsx)(F,{className:`size-4 text-moss`}),` `,p(`models.keyStored`)]}),(0,L.jsx)(A,{size:`sm`,variant:`ghost`,busy:u.isPending,onClick:async()=>{let e=await u.mutateAsync(void 0);l(e.ok?{ok:!0,message:p(`models.keyOk`)}:{ok:!1,message:e.message??p(`models.keyBad`)})},children:p(`models.keyCheck`)}),n.canEdit?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(A,{size:`sm`,variant:`ghost`,onClick:()=>s(!0),children:p(`models.keyReplace`)}),(0,L.jsx)(A,{size:`sm`,variant:`danger`,busy:r.isPending,onClick:()=>{l(null),r.mutate({keys:{[e.id]:``}})},children:p(`models.keyRemove`)})]}):null]}),c?(0,L.jsxs)(`p`,{className:j(`flex items-center gap-1.5 text-[0.8125rem]`,c.ok?`text-moss`:`text-rose`),children:[c.ok?(0,L.jsx)(y,{className:`size-3.5`,strokeWidth:3}):null,c.message]}):null,(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-[0.75rem] text-ink-4`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>M(e.keyUrl),className:`inline-flex items-center gap-1 font-medium text-ember-strong hover:underline`,children:[p(`models.keyGet`,{name:e.name}),` `,(0,L.jsx)(x,{className:`size-3`})]}),(0,L.jsx)(`span`,{children:n.cloud?p(`models.keyWhereCloud`):p(`models.keyWhereLocal`)})]})]}):(0,L.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:p(`models.ownKeysPlan`)})}var xn=`__custom__`;function Sn({provider:e,cap:t,value:n,onPick:r,disabled:i}){let a=fe,o=e.models[t]??[],s=o.some(e=>e.ref===n),[c,l]=(0,I.useState)(!s&&!!n),[u,d]=(0,I.useState)(s?``:n.replace(/^[a-z]+:/,``)),f=e.id===`gateway`?``:`${e.id}:`;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(ce,{value:c?xn:n,onChange:e=>{if(e===xn){l(!0);return}l(!1),r(e)},options:[...o.map(e=>({value:e.ref,label:e.note?`${e.label} – ${ln(e.note,a)}`:e.label})),{value:xn,label:p(`models.modelCustom`)}]}),c?(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(k,{className:`min-w-0 flex-1 font-mono text-[0.8125rem]`,value:u,disabled:i,placeholder:o[0]?.ref.replace(/^[a-z]+:/,``)??``,onChange:e=>d(e.target.value)}),(0,L.jsx)(A,{variant:`secondary`,disabled:!u.trim()||i,onClick:()=>r(`${f}${u.trim()}`),children:p(`settings.save`)})]}):null]})}function Cn({provider:e,state:t}){let n=n=>J(t.bindings[n]??e.text?.[n]??``);return(0,L.jsxs)(`dl`,{className:`grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-1 text-[0.875rem]`,children:[(0,L.jsx)(`dt`,{className:`text-ink-3`,children:p(`models.textSimple`)}),(0,L.jsx)(`dd`,{className:`truncate font-medium`,children:n(`standard`)}),(0,L.jsx)(`dt`,{className:`text-ink-3`,children:p(`models.textDemanding`)}),(0,L.jsx)(`dd`,{className:`truncate font-medium`,children:n(`high`)})]})}function wn({provider:e,state:t,onPick:n,disabled:r}){return(0,L.jsxs)(`details`,{className:`group rounded-lg ring-1 ring-border-soft`,children:[(0,L.jsx)(`summary`,{className:`cursor-pointer list-none px-3 py-2.5 text-[0.8125rem] text-ink-2 hover:text-ink`,children:(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,L.jsx)(de,{className:`size-3.5 transition group-open:rotate-90`}),p(`models.perClass`)]})}),(0,L.jsx)(`div`,{className:`flex flex-col gap-3 px-3 pt-1 pb-3`,children:h.map(i=>(0,L.jsxs)(`div`,{className:`grid items-center gap-2 sm:grid-cols-[9rem_minmax(0,1fr)]`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-[0.8125rem] text-ink-2`,children:p(`class.${i}`)}),(0,L.jsx)(`div`,{className:`text-[0.6875rem] text-ink-4 leading-snug`,children:p(`class.${i}.hint`)})]}),(0,L.jsx)(Sn,{provider:e,cap:`text`,value:t.bindings[i]??e.text?.[i]??``,disabled:r,onPick:e=>n(i,e)})]},i))})]})}function Tn({cap:e,disabled:t}){let n=Y[e],r=f({mutationFn:()=>w.post(`/api/studio/models/test`,{cls:n,lang:fe})}),i=r.data;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,L.jsx)(A,{variant:`secondary`,busy:r.isPending,disabled:t,onClick:()=>r.mutate(),children:p(`models.try.${e}`)}),(0,L.jsx)(`span`,{className:`text-[0.75rem] text-ink-4`,children:e===`video`?p(`models.tryCostVideo`):X(e)?null:p(`models.tryCost`)})]}),r.isPending&&e!==`text`?(0,L.jsxs)(`p`,{className:`flex items-center gap-2 text-[0.8125rem] text-ink-3`,children:[(0,L.jsx)(ae,{className:`size-3.5`}),` `,p(e===`video`?`models.tryWaitVideo`:`models.tryWait`)]}):null,i?.ok?(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[i.media&&e===`image`?(0,L.jsx)(`img`,{src:i.media,alt:``,className:`size-48 rounded-lg object-cover ring-1 ring-border-soft`}):null,i.media&&e===`speech`?(0,L.jsx)(`audio`,{src:i.media,controls:!0,autoPlay:!0,className:`w-full max-w-sm`}):null,i.media&&e===`video`?(0,L.jsx)(`video`,{src:i.media,controls:!0,autoPlay:!0,muted:!0,className:`w-full max-w-md rounded-lg`}):null,(0,L.jsxs)(`p`,{className:`flex items-start gap-2 text-[0.8125rem] text-ink-2`,children:[(0,L.jsx)(y,{className:`mt-0.5 size-3.5 shrink-0 text-moss`,strokeWidth:3}),(0,L.jsx)(`span`,{children:e===`listening`?i.reply?p(`models.tryHeard`,{text:i.reply}):p(`models.tryHeardNothing`):X(e)?p(`local.testOk`,{s:(i.ms/1e3).toFixed(1),ref:J(i.ref??``),reply:i.reply??``}):p(`models.tryOk`,{s:(i.ms/1e3).toFixed(1),model:J(i.ref??``)})})]})]}):null,i&&!i.ok?(0,L.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:p(`models.tryFailed`,{error:i.error??``})}):null,r.isError?(0,L.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:p(`models.tryFailed`,{error:r.error.message})}):null]})}function En(e){let t=e=>(e<10?Math.round(e*10)/10:Math.ceil(e)).toLocaleString();return e?.creditsPerImage?p(`models.notePerImage`,{n:t(e.creditsPerImage)}):e?.creditsPerSecond?p(`models.notePerSecond`,{n:t(e.creditsPerSecond)}):e?.creditsPer1kCharacters?p(`models.notePer1k`,{n:t(e.creditsPer1kCharacters)}):e?.creditsPerMinute?p(`models.notePerMinute`,{n:t(e.creditsPerMinute)}):p(`models.noteUsage`)}function Dn(e,t){let n=en(t.bindings[Y[e]]);return En((n?t.creditModels.find(e=>e.id===n):null)??t.prices?.[Y[e]])}function On(e,t,n){return e.creditModels.filter(e=>nn(e.kind)===t&&(!n||e.source===n||e.provider===n))}function kn({cap:e,state:t,disabled:n}){let r=Z(),i=Y[e],a=en(t.bindings[i]),o=On(t,e),s=t.prices?.[i]?.model,c=e=>e.source===`ai-gateway`?q(e.provider)?.name??e.provider:q(e.source)?.name??e.source;return(0,L.jsx)(ce,{value:a??``,onChange:e=>r.mutate({bindings:{[i]:tn(e||null)}}),options:[{value:``,label:s?p(`models.creditsAuto`,{model:J(s)}):p(`models.creditsAutoNone`)},...o.map(e=>({value:e.id,label:`${e.name} · ${c(e)} – ${En(e)}`,disabled:n}))]})}function An({models:e,state:t,place:n}){let r=Z();return(0,L.jsx)(`ul`,{className:`flex flex-col divide-y divide-border-soft`,children:e.map(e=>{let i=nn(e.kind),a=Y[i],o=t.bindings[a]===tn(e.id);return(0,L.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 py-2.5`,children:[(0,L.jsx)(u,{className:`size-4 shrink-0 text-ink-3`}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`span`,{className:`block font-medium text-[0.875rem]`,children:e.name}),(0,L.jsxs)(`span`,{className:`block text-[0.75rem] text-ink-3`,children:[p(`models.cap.${i}`),` · `,En(e)]})]}),o?(0,L.jsxs)(`span`,{className:`flex items-center gap-1 font-medium text-[0.75rem] text-moss`,children:[(0,L.jsx)(y,{className:`size-3.5`,strokeWidth:3}),` `,p(`models.inUse`)]}):(0,L.jsx)(A,{size:`sm`,variant:`secondary`,disabled:!n.canEdit||!n.credits,busy:r.isPending&&r.variables?.bindings?.[a]===tn(e.id),onClick:()=>r.mutate({bindings:{[a]:tn(e.id)}}),children:p(`models.useFor`)})]},e.id)})})}function jn({cap:e,state:t,place:n,me:r,onOpen:i}){let a=Z(),o=Y[e],s=t.ways[o],c=dn(t,e,n),[l,d]=(0,I.useState)(!1),f=mn(s,n),m=n.harnesses.filter(t=>(X(e)||e===`image`&&t.images)&&(t.version!==null||c?.kind===`client`&&c.id===t.id)),h=an.filter(t=>t.models[e]?.length),g=r=>{if(d(!1),r.kind===`credits`&&!n.credits){d(!0);return}if(un(r,c))return;let i=Xt[e],s=e=>Object.fromEntries(i.map(t=>[t,e]));switch(r.kind){case`client`:a.mutate(X(e)?{source:r.id}:{bindings:{[o]:`${r.id}/image`}});return;case`key`:{let i=q(r.provider);a.mutate({...X(e)&&!n.cloud?{source:`own`}:{},bindings:fn(i,e,t)});return}case`local`:a.mutate(r.by===`apple`?X(e)?{source:`own`,bindings:Mn(t)}:{bindings:{audio:`apple:transcribe`}}:{source:`own`,bindings:s(`ollama:qwen3`)});return;case`credits`:a.mutate(X(e)&&!n.cloud?{source:`account`}:{bindings:s(Zt)});return}},_=c?.kind===`key`?q(c.provider):null,v=_?!t.keys[_.id]:!1,y=c?.kind===`client`?n.harnesses.find(e=>e.id===c.id):null,b=s.kind!==`none`;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,L.jsx)(_n,{icon:cn[e],title:p(`models.cap.${e}`),lead:p(`models.cap.${e}.hint`),status:(0,L.jsx)(gn,{...f})}),(0,L.jsxs)(O,{className:`flex flex-col gap-6 p-3.5 sm:p-5 sm:p-6`,children:[(0,L.jsxs)(Q,{title:p(`models.who`),children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[m.length?(0,L.jsx)(vn,{label:p(`models.optSubscription`),children:m.map(e=>(0,L.jsx)(yn,{title:e.name,...pn(e),selected:c?.kind===`client`&&c.id===e.id,disabled:!n.canEdit,onPick:()=>g({kind:`client`,id:e.id})},e.id))}):null,(0,L.jsx)(vn,{label:p(`models.optKey`),children:h.map(e=>(0,L.jsx)(yn,{title:e.name,note:t.keys[e.id]?p(`models.noteKey`):p(`models.noteNoKey`),noteTone:t.keys[e.id]?`done`:void 0,selected:c?.kind===`key`&&c.provider===e.id,disabled:!n.canEdit,onPick:()=>g({kind:`key`,provider:e.id})},e.id))}),(0,L.jsxs)(vn,{label:X(e)&&!n.cloud?p(`models.optOther`):p(`models.optCreditsGroup`),children:[(X(e)||e===`listening`)&&!n.cloud&&t.apple?.supported?(0,L.jsx)(yn,{title:p(`models.optApple`),note:X(e)?Nn(t.apple):p(`models.optAppleNote`),noteTone:X(e)&&!t.apple.available?void 0:`done`,selected:c?.kind===`local`&&c.by===`apple`,disabled:!n.canEdit||X(e)&&!t.apple.available,onPick:()=>g({kind:`local`,by:`apple`})}):null,X(e)&&!n.cloud?(0,L.jsx)(yn,{title:p(`models.optLocal`),note:p(`models.optLocalNote`),selected:c?.kind===`local`&&c.by===`ollama`,disabled:!n.canEdit,onPick:()=>g({kind:`local`,by:`ollama`})}):null,(0,L.jsx)(yn,{title:n.cloud?p(`models.creditsTeam`):p(`models.creditsName`),note:n.credits?Dn(e,t):p(`models.noteNeedsAccount`),noteTone:n.credits?`done`:void 0,selected:c?.kind===`credits`,disabled:!n.canEdit,onPick:()=>g({kind:`credits`})})]})]}),l?(0,L.jsxs)(`p`,{className:`text-[0.8125rem] text-ink-2`,children:[p(`local.sourceNeedsAccount`),` `,(0,L.jsx)(zn,{})]}):null,a.isError?(0,L.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:a.error.message}):null]}),_?(0,L.jsxs)(L.Fragment,{children:[v?(0,L.jsxs)(Q,{title:p(`models.keyFor`,{name:_.name}),children:[(0,L.jsx)(bn,{provider:_,stored:!1,place:n}),n.credits?(0,L.jsxs)($,{children:[(0,L.jsx)(u,{className:`mr-1 inline size-3.5 align-[-2px]`}),p(`models.keyFallback`)]}):null]}):null,v&&n.credits&&On(t,e,_.id).length?(0,L.jsx)(Q,{title:p(`models.viaCredits`,{name:_.name}),children:(0,L.jsx)(An,{models:On(t,e,_.id),state:t,place:n})}):null,(0,L.jsx)(Q,{title:p(`models.model`),aside:v?null:(0,L.jsx)(`button`,{type:`button`,onClick:()=>i({type:`provider`,id:_.id}),className:`text-[0.75rem] text-ink-3 hover:text-ink`,children:p(`models.manageKey`,{name:_.name})}),children:X(e)&&_.text?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Cn,{provider:_,state:t}),(0,L.jsx)(wn,{provider:_,state:t,disabled:!n.canEdit,onPick:(e,t)=>a.mutate({bindings:{[e]:t}})})]}):(0,L.jsx)(Sn,{provider:_,cap:e,value:t.bindings[o]??_.models[e]?.[0]?.ref??``,disabled:!n.canEdit,onPick:e=>a.mutate({bindings:{[o]:e}})},`${_.id}:${t.bindings[o]??``}`)})]}):null,c?.kind===`client`&&y?X(e)?(0,L.jsx)(Q,{title:y.name,children:(0,L.jsx)(Ze,{me:r,id:y.id})}):(0,L.jsx)(Q,{title:y.name,children:(0,L.jsx)($,{children:p(`models.clientImages`,{name:y.name,sub:p(`harness.sub.${y.id}`)})})}):null,c?.kind===`local`?c.by===`apple`?(0,L.jsx)(Pn,{cap:e,state:t,place:n}):(0,L.jsx)(Fn,{state:t,disabled:!n.canEdit}):null,c?.kind===`credits`&&n.credits?X(e)?(0,L.jsx)(Q,{title:p(`models.creditsName`),children:(0,L.jsxs)($,{children:[p(`models.creditsPicks`),s.kind===`credits`&&s.ref?` ${p(`models.creditsModel`,{model:J(s.ref)})}`:``]})}):(0,L.jsxs)(Q,{title:p(`models.model`),children:[(0,L.jsx)(kn,{cap:e,state:t,disabled:!n.canEdit}),(0,L.jsx)($,{children:p(`models.creditsPickHint`)})]}):null,s.problem?(0,L.jsxs)(`p`,{className:`flex items-start gap-2 rounded-lg bg-paper-2 px-3 py-2.5 text-[0.8125rem] text-ink-2`,children:[(0,L.jsx)(pe,{className:`mt-0.5 size-3.5 shrink-0 text-ink-3`}),(0,L.jsx)(`span`,{children:(0,L.jsx)(ee,{text:s.problem})})]}):null,c?.kind===`client`&&X(e)?null:(0,L.jsx)(Q,{title:p(`models.try`),children:(0,L.jsx)(Tn,{cap:e,disabled:!b||!n.canEdit},`${e}:${s.ref}`)}),X(e)&&r.subscriptions.includes(`claude`)&&!n.cloud?(0,L.jsx)(In,{me:r}):null]})]})}function Mn(e){let t=t=>{let n=e.bindings[t]??``;return/^(ollama|apple):/.test(n)?``:n};return{classifier:`apple:default`,standard:`apple:default`,high:t(`high`),highest:t(`highest`)}}function Nn(e){if(e.available)return p(`models.optAppleNote`);switch(e.reason){case`off`:return p(`models.appleOff`);case`loading`:return p(`models.appleLoading`);default:return p(`models.appleDevice`)}}function Pn({cap:e,state:t,place:n}){return(0,L.jsx)(Q,{title:p(`models.optApple`),children:(0,L.jsx)($,{children:X(e)?p(`models.appleHint`,{way:mn(t.ways.high,n).text}):p(`models.appleListenHint`)})})}function Fn({state:e,disabled:t}){let n=Z(),[r,i]=(0,I.useState)(e.ollamaUrl),[a,o]=(0,I.useState)((e.bindings.standard??`ollama:qwen3`).replace(/^ollama:/,``));return(0,L.jsxs)(Q,{title:p(`models.optLocal`),children:[(0,L.jsx)($,{children:p(`models.ollamaHint`)}),(0,L.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[minmax(0,1fr)_12rem_auto]`,children:[(0,L.jsx)(k,{className:`font-mono text-[0.8125rem]`,value:r,disabled:t,onChange:e=>i(e.target.value)}),(0,L.jsx)(k,{className:`font-mono text-[0.8125rem]`,value:a,disabled:t,onChange:e=>o(e.target.value)}),(0,L.jsx)(A,{variant:`secondary`,busy:n.isPending,disabled:t||!a.trim(),onClick:()=>n.mutate({ollamaUrl:r,bindings:Object.fromEntries(h.map(e=>[e,`ollama:${a.trim()}`]))}),children:p(`settings.save`)})]})]})}function In({me:e}){let t=r(),n=f({mutationFn:e=>w.put(`/api/studio/local/chat`,{engine:e}),onSuccess:()=>t.invalidateQueries({queryKey:[`me`]})});return(0,L.jsxs)(Q,{title:p(`local.chat`),children:[(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:[`models`,`claude`].map(t=>(0,L.jsx)(`button`,{type:`button`,"aria-pressed":e.chatEngine===t,onClick:()=>n.mutate(t),className:j(`h-9 rounded-full border px-3.5 text-[0.8125rem] transition`,e.chatEngine===t?`border-ember bg-ember-tint text-ink`:`border-input bg-card text-ink-2 hover:text-ink`),children:p(t===`claude`?`local.chatClaude`:`local.chatModels`)},t))}),(0,L.jsx)($,{children:p(`local.subscription`)})]})}function Ln({provider:e,state:t,place:n,onOpen:r}){let i=Z(),a=Yt.filter(t=>e.models[t]?.length),o=t.keys[e.id],s=e.id===`gateway`?[]:t.creditModels.filter(t=>t.source===e.id||t.provider===e.id);return(0,L.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,L.jsx)(_n,{icon:F,title:e.name,lead:ln(e.about,fe),status:(0,L.jsx)(gn,{text:p(o?`models.keyStored`:`models.keyNone`),tone:o?`done`:`warn`})}),(0,L.jsxs)(O,{className:`flex flex-col gap-6 p-3.5 sm:p-5 sm:p-6`,children:[(0,L.jsx)(Q,{title:p(`models.key`),children:(0,L.jsx)(bn,{provider:e,stored:o,place:n})}),(0,L.jsx)(Q,{title:p(`models.uses`),children:(0,L.jsx)(`ul`,{className:`flex flex-col divide-y divide-border-soft`,children:a.map(a=>{let o=cn[a],s=dn(t,a,n),c=s?.kind===`key`&&s.provider===e.id;return(0,L.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 py-2.5`,children:[(0,L.jsx)(o,{className:`size-4 shrink-0 text-ink-3`}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>r({type:`cap`,id:a}),className:`min-w-0 flex-1 text-left`,children:[(0,L.jsx)(`span`,{className:`block font-medium text-[0.875rem]`,children:p(`models.cap.${a}`)}),(0,L.jsx)(`span`,{className:`block truncate text-[0.75rem] text-ink-3`,children:(e.models[a]??[]).map(e=>e.label).join(` · `)})]}),c?(0,L.jsxs)(`span`,{className:`flex items-center gap-1 font-medium text-[0.75rem] text-moss`,children:[(0,L.jsx)(y,{className:`size-3.5`,strokeWidth:3}),` `,p(`models.inUse`)]}):(0,L.jsx)(A,{size:`sm`,variant:`secondary`,disabled:!n.canEdit,busy:i.isPending&&i.variables?.bindings!==void 0,onClick:()=>i.mutate({...X(a)&&!n.cloud?{source:`own`}:{},bindings:fn(e,a,t)}),children:p(`models.useFor`)})]},a)})})}),s.length?(0,L.jsxs)(Q,{title:p(`models.viaCredits`,{name:e.name}),children:[(0,L.jsx)($,{children:n.credits?p(`models.viaCreditsHint`):p(`models.viaCreditsNeedsAccount`)}),(0,L.jsx)(An,{models:s,state:t,place:n})]}):null]})]})}function Rn({me:e,id:t,state:n,place:r}){let i=Z(),a=r.harnesses.find(e=>e.id===t);if(!a)return null;let o=n.source===t,s=a.version!==null&&a.auth!==`none`;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,L.jsx)(_n,{icon:Pe,title:a.name,lead:p(`harness.desc.${t}`),status:(0,L.jsx)(gn,{text:pn(a).note,tone:s?`done`:`warn`})}),(0,L.jsxs)(O,{className:`flex flex-col gap-6 p-3.5 sm:p-5 sm:p-6`,children:[(0,L.jsx)(Q,{title:p(`models.clientSignIn`),children:(0,L.jsx)(Ze,{me:e,id:t})}),(0,L.jsxs)(Q,{title:p(`models.uses`),children:[(0,L.jsx)(`ul`,{className:`flex flex-col divide-y divide-border-soft`,children:[`text`,...a.images?[`image`]:[]].map(e=>{let a=cn[e],o=dn(n,e,r),s=o?.kind===`client`&&o.id===t;return(0,L.jsxs)(`li`,{className:`flex items-center gap-3 py-2.5`,children:[(0,L.jsx)(a,{className:`size-4 shrink-0 text-ink-3`}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 font-medium text-[0.875rem]`,children:p(`models.cap.${e}`)}),s?(0,L.jsxs)(`span`,{className:`flex items-center gap-1 font-medium text-[0.75rem] text-moss`,children:[(0,L.jsx)(y,{className:`size-3.5`,strokeWidth:3}),` `,p(`models.inUse`)]}):(0,L.jsx)(A,{size:`sm`,variant:`secondary`,busy:i.isPending,onClick:()=>i.mutate(e===`text`?{source:t}:{bindings:{image:`${t}/image`}}),children:p(`models.useFor`)})]},e)})}),o?null:(0,L.jsx)($,{children:p(`models.clientNotChosen`,{name:a.name})})]})]})]})}function zn(){return(0,L.jsx)(oe,{to:`/settings/account`,className:`font-medium text-ember-strong underline-offset-2 hover:underline`,children:p(`local.toAccount`)})}function Bn({state:e,place:t,onOpen:n}){let r=Z(),i=Yt.filter(t=>e.ways[Y[t]].kind===`credits`),a=t.cloud?p(`models.creditsTeam`):p(`models.creditsName`);return(0,L.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,L.jsx)(_n,{icon:u,title:a,lead:t.cloud?p(`models.creditsCloudHint`):p(`models.creditsLocalLead`),status:t.balance===null?void 0:(0,L.jsx)(`span`,{className:`font-display font-semibold text-[1.25rem] tabular-nums`,children:p(`nav.credits`,{n:Math.floor(t.balance).toLocaleString()})})}),(0,L.jsxs)(O,{className:`flex flex-col gap-6 p-3.5 sm:p-5 sm:p-6`,children:[!t.cloud&&!t.account?(0,L.jsxs)(Q,{title:p(`models.creditsConnectTitle`),children:[(0,L.jsx)($,{children:p(`models.creditsLocalHint`)}),(0,L.jsx)(`div`,{children:(0,L.jsx)(oe,{to:`/settings/account`,children:(0,L.jsx)(A,{children:p(`models.creditsConnect`)})})})]}):null,t.account&&!t.account.signedIn?(0,L.jsxs)(`p`,{className:`text-[0.8125rem] text-rose`,children:[p(`local.accountExpired`),` `,(0,L.jsx)(zn,{})]}):null,t.account?(0,L.jsx)(Q,{title:p(`models.creditsFallback`),children:(0,L.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,L.jsx)(ne,{checked:e.creditFallback,disabled:!t.canEdit,onChange:e=>r.mutate({creditFallback:e}),label:p(`models.creditsFallback`)}),(0,L.jsx)($,{children:e.creditFallback?p(`models.creditsFallbackOn`):p(`models.creditsFallbackOff`)})]})}):null,t.credits?(0,L.jsx)(Q,{title:p(`models.creditsOn`),aside:t.topUp?(0,L.jsxs)(`a`,{href:t.topUp,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 font-medium text-[0.8125rem] text-ember-strong hover:underline`,children:[p(`models.creditsTopUp`),` `,(0,L.jsx)(x,{className:`size-3`})]}):null,children:i.length?(0,L.jsx)(`ul`,{className:`flex flex-col divide-y divide-border-soft`,children:i.map(t=>{let r=cn[t],i=e.ways[Y[t]];return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{type:`button`,onClick:()=>n({type:`cap`,id:t}),className:`flex w-full items-center gap-3 py-2.5 text-left`,children:[(0,L.jsx)(r,{className:`size-4 shrink-0 text-ink-3`}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 font-medium text-[0.875rem]`,children:p(`models.cap.${t}`)}),(0,L.jsxs)(`span`,{className:`truncate text-[0.75rem] text-ink-3`,children:[i.ref?J(i.ref):``,` · `,Dn(t,e)]})]})},t)})}):(0,L.jsx)($,{children:p(`models.creditsNone`)})}):null]})]})}function Vn(e){return e?e===`credits`?{type:`credits`}:Yt.includes(e)?{type:`cap`,id:e}:q(e)?{type:`provider`,id:e}:{type:`client`,id:e}:{type:`cap`,id:`text`}}var Hn=e=>e.type===`credits`?`credits`:e.id;function Un({view:e,onView:t}){return null}function Wn(e){return e.kind===`none`?`off`:e.kind===`credits`?`credits`:`done`}function Gn(e,t){switch(e.type){case`cap`:return p(`models.cap.${e.id}`);case`provider`:return q(e.id)?.name??e.id;case`client`:return t?.harnesses.find(t=>t.id===e.id)?.name??e.id;default:return t?.mode===`managed`?p(`models.creditsTeam`):p(`models.creditsName`)}}function Kn(){let e=ye(),t=hn(),[n,r]=ie(),[i,a]=(0,I.useState)(`auto`),{narrow:o}=He(),s=n.get(`show`),c=Vn(s);if(We(s||!o?Gn(c,e.data):null),!e.data||!t.data)return t.isError?(0,L.jsx)(`p`,{className:`text-[0.875rem] text-rose`,children:t.error.message}):null;let l=t.data,d=sn(e.data,i),f=e=>r({show:Hn(e)},{replace:!o}),m=e=>!(!s&&o)&&Hn(e)===Hn(c),h=d.harnesses.filter(e=>e.version!==null||l.source===e.id),g=an.filter(e=>l.keys[e.id]),_=an.filter(e=>!l.keys[e.id]);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(Je,{children:[(0,L.jsx)(P,{label:p(`models.groupCaps`),children:Yt.map(e=>{let t=l.ways[Y[e]];return(0,L.jsx)(N,{icon:cn[e],label:p(`models.cap.${e}`),tone:Wn(t),toneLabel:mn(t,d).text,selected:m({type:`cap`,id:e}),onPick:()=>f({type:`cap`,id:e})},e)})}),(0,L.jsxs)(P,{label:p(`models.groupAccess`),children:[(0,L.jsx)(N,{icon:u,label:d.cloud?p(`models.creditsTeam`):p(`models.creditsName`),badge:d.balance===null?null:(0,L.jsx)(`span`,{className:`text-[0.75rem] text-ink-3 tabular-nums`,children:Math.floor(d.balance).toLocaleString()}),tone:d.credits?void 0:`off`,toneLabel:d.credits?void 0:p(`models.noteNeedsAccount`),selected:m({type:`credits`}),onPick:()=>f({type:`credits`})}),h.map(e=>(0,L.jsx)(N,{icon:Pe,label:e.name,tone:e.version!==null&&e.auth===`subscription`?`done`:e.auth===`api_key`?`on`:`off`,toneLabel:pn(e).note,selected:m({type:`client`,id:e.id}),onPick:()=>f({type:`client`,id:e.id})},e.id)),g.map(e=>(0,L.jsx)(N,{icon:F,label:e.name,tone:`done`,toneLabel:p(`models.noteKey`),selected:m({type:`provider`,id:e.id}),onPick:()=>f({type:`provider`,id:e.id})},e.id))]}),_.length?(0,L.jsx)(P,{label:p(`models.groupMore`),collapsible:!0,open:_.some(e=>m({type:`provider`,id:e.id})),count:_.length,children:_.map(e=>(0,L.jsx)(N,{icon:F,label:e.name,selected:m({type:`provider`,id:e.id}),onPick:()=>f({type:`provider`,id:e.id})},e.id))}):null,(0,L.jsx)(Un,{view:i,onView:a})]}),d.canEdit?null:(0,L.jsx)(`p`,{className:`mb-4 rounded-lg bg-paper-2 px-3 py-2 text-[0.8125rem] text-ink-2`,children:p(`models.readOnly`)}),c.type===`cap`?(0,L.jsx)(jn,{cap:c.id,state:l,place:d,me:e.data,onOpen:f},c.id):c.type===`provider`&&q(c.id)?(0,L.jsx)(Ln,{provider:q(c.id),state:l,place:d,onOpen:f},c.id):c.type===`client`?(0,L.jsx)(Rn,{me:e.data,id:c.id,state:l,place:d},c.id):(0,L.jsx)(Bn,{state:l,place:d,onOpen:f})]})}function qn({name:e,image:t}){return t?(0,L.jsx)(`img`,{src:t,alt:``,className:`size-9 shrink-0 rounded-full object-cover`}):(0,L.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-full bg-paper-2 font-medium text-[0.75rem] text-ink-2`,children:Se(e)})}function Jn({me:e}){let t=i({queryKey:[`team`,e.tenant.id],queryFn:()=>w.get(`/api/studio/team`)}),n=t.data,r=n?.plan??e.tenant.plan,a=n?.seats;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-9`,children:[(0,L.jsxs)(Ce,{title:p(`team.title`),hint:p(`team.hint`),children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-3`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`div`,{className:`text-[0.8125rem] text-ink-3`,children:p(`team.plan`)}),(0,L.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`font-medium text-[0.9375rem]`,children:r?.name??p(`team.planFree`)}),a?(0,L.jsx)(T,{children:a.limit===null?p(`team.seatsUnlimited`):p(`team.seats`,{taken:a.taken,limit:a.limit})}):null]})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsxs)(A,{variant:`secondary`,onClick:()=>M(`${e.manageUrl}/billing`),children:[p(`team.changePlan`),` `,(0,L.jsx)(x,{className:`size-4`})]}),n?.canManage?(0,L.jsxs)(A,{onClick:()=>M(`${e.manageUrl}/`),children:[p(`team.manage`),` `,(0,L.jsx)(x,{className:`size-4`})]}):null]})]}),(0,L.jsx)(`p`,{className:`mt-4 text-[0.8125rem] text-ink-3 leading-relaxed`,children:e.tenant.role===`member`?p(`team.memberNote`):p(`team.roles`)})]}),(0,L.jsx)(Ce,{title:p(`team.members`),children:t.isPending?(0,L.jsx)(ae,{}):t.isError||!n?(0,L.jsx)(`p`,{className:`text-[0.875rem] text-rose`,children:p(`team.failed`)}):(0,L.jsxs)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:[n.members.map(t=>(0,L.jsxs)(`div`,{className:`flex items-center gap-3 py-3 first:pt-0 last:pb-0`,children:[(0,L.jsx)(qn,{name:t.name,image:t.image}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`truncate text-[0.9375rem]`,children:[t.name,t.userId===e.user.id?(0,L.jsxs)(`span`,{className:`text-ink-4`,children:[` · `,p(`team.you`)]}):null]}),(0,L.jsx)(`div`,{className:`truncate text-[0.8125rem] text-ink-3`,children:t.email})]}),(0,L.jsx)(T,{tone:t.role===`member`?void 0:`live`,children:p(`team.role.${t.role}`)})]},t.userId)),n.invitations.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center gap-3 py-3 first:pt-0 last:pb-0`,children:[(0,L.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-full bg-paper-2 text-ink-3`,children:(0,L.jsx)(nt,{className:`size-4`})}),(0,L.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-[0.9375rem]`,children:e.email}),(0,L.jsxs)(T,{tone:`warn`,children:[p(`team.invited`),` · `,p(`team.role.${e.role}`)]})]},e.id)),n.members.length===0&&n.invitations.length===0?(0,L.jsxs)(`div`,{className:`flex items-center gap-3 text-[0.875rem] text-ink-3`,children:[(0,L.jsx)(je,{className:`size-4`}),` –`]}):null]})})]})}function Yn(e,t){let n=e.toLowerCase().replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``).replace(/^[^a-z]+/,``).slice(0,24)||`system`,r=n,i=2;for(;t.includes(r);)r=`${n}_${i++}`;return r}function Xn({project:e}){let t=r(),[n,i]=(0,I.useState)(e.mcpServers.map(e=>({...e,auth:e.headers?.Authorization??e.headers?.authorization??``}))),[a,o]=(0,I.useState)(!1),s=e.readOnly,c=f({mutationFn:()=>w.patch(`/api/studio/projects/${e.id}`,{mcpServers:n.filter(e=>e.name&&e.url).map(({auth:e,headers:t,...n})=>({...n,headers:e?{...t,Authorization:e}:void 0}))}),onSuccess:async()=>{await t.invalidateQueries({queryKey:[`projects`]}),o(!0),setTimeout(()=>o(!1),1800)}});return(0,L.jsxs)(O,{className:`p-4 sm:p-6`,children:[(0,L.jsx)(`h2`,{className:`font-display font-semibold text-lg`,children:p(`settings.mcp`)}),(0,L.jsx)(`p`,{className:`mt-1 mb-5 text-[0.875rem] text-ink-3`,children:p(`settings.mcpHint`)}),(0,L.jsxs)(`fieldset`,{disabled:s,className:`flex min-w-0 flex-col gap-3`,children:[n.map((e,t)=>(0,L.jsxs)(`div`,{className:`grid gap-2 rounded-lg bg-paper p-3 ring-1 ring-border-soft sm:grid-cols-[1fr_2fr_auto]`,children:[(0,L.jsx)(k,{placeholder:p(`settings.serverName`),value:e.name,onChange:e=>i(n=>n.map((r,i)=>i===t?{...r,name:e.target.value,id:r.id||Yn(e.target.value,n.map(e=>e.id))}:r))}),(0,L.jsx)(k,{placeholder:`${p(`settings.serverUrl`)} (https://…/mcp)`,value:e.url,onChange:e=>i(n=>n.map((n,r)=>r===t?{...n,url:e.target.value}:n))}),s?(0,L.jsx)(`span`,{}):(0,L.jsx)(D,{label:`Entfernen`,onClick:()=>i(e=>e.filter((e,n)=>n!==t)),className:`hover:text-rose`,children:(0,L.jsx)(m,{className:`size-4`})}),(0,L.jsx)(k,{className:`sm:col-span-2`,placeholder:p(`settings.serverHeader`),value:e.auth??``,onChange:e=>i(n=>n.map((n,r)=>r===t?{...n,auth:e.target.value}:n))}),e.id?(0,L.jsx)(`span`,{className:`self-center font-mono text-[0.6875rem] text-ink-4`,children:e.id}):null]},t)),s?null:(0,L.jsxs)(A,{variant:`secondary`,className:`self-start`,onClick:()=>i(e=>[...e,{id:``,name:``,url:``,auth:``}]),children:[(0,L.jsx)(v,{className:`size-4`}),` `,p(`settings.addServer`)]})]}),s?null:(0,L.jsxs)(`div`,{className:`mt-5 flex items-center justify-end gap-3`,children:[c.error?(0,L.jsx)(`p`,{className:`text-[0.875rem] text-rose`,children:c.error.message}):null,(0,L.jsx)(A,{busy:c.isPending,onClick:()=>c.mutate(),children:p(a?`settings.saved`:`settings.save`)})]})]})}var Zn=new Set([`models`,`integrate`]);function Qn(){let{section:e}=se(),[t]=ie(),n=te(),r=ye(),{project:i,loading:a}=xe(),o=be(),[s,c]=(0,I.useState)(i?.id);(0,I.useEffect)(()=>c(i?.id),[i?.id]);let l=Ne(),u=Xe(),[d,f]=(0,I.useState)(null),[m,h]=(0,I.useState)(null),[g,_]=(0,I.useState)(null),v=De(r.data,l),y=v.find(t=>t.id===e),b=v.map(e=>({...e,to:`/settings/${e.id}`})),x=b.find(t=>t.id===e),S=y?Zn.has(y.id):!1,C=y?S&&!t.get(`show`)?1:2:0,w=u?Math.min(C,1):S&&g!==e?1:0,T=Ue(w),D=Ue(C),ee=(0,I.useMemo)(()=>({slot:d,narrow:u,setDetail:h}),[d,u]);if(Ee(y?.id===`models`?{suggestions:[{label:p(`assistant.suggest.modelsNow`)},{label:p(`assistant.suggest.modelsMissing`)},{label:p(`assistant.suggest.modelsCost`)}]}:y?.id===`account`?{suggestions:[{label:p(`assistant.suggest.credits`)},{label:p(`assistant.suggest.accountWhy`)},{label:p(`assistant.suggest.plans`)}]}:y?.id===`integrate`?{suggestions:[{label:p(`assistant.suggest.integrateWhat`)},{label:p(`assistant.suggest.integrateClaude`)},{label:p(`assistant.suggest.what`)}]}:y?.id===`connectors`?{suggestions:[{label:p(`assistant.suggest.connectorsWhat`)},{label:p(`assistant.suggest.connectorsAdd`),fill:!0},{label:p(`assistant.suggest.what`)}]}:{}),Oe([{label:p(`settings.title`),to:`/settings`},...y?[{label:y.label,to:`/settings/${y.id}`}]:[],...y&&m?[{label:m}]:[]]),!y){if(e===`build`)return(0,L.jsx)(E,{to:`/settings/integrate`,replace:!0});if(e===`project`)return(0,L.jsx)(E,{to:`/space`,replace:!0});if(e!==void 0||!u)return l.status===`ready`||e===void 0?(0,L.jsx)(E,{to:`/settings/account`,replace:!0}):null}let ne=y?.id===`connectors`&&o;return(0,L.jsx)(Ke.Provider,{value:ee,children:(0,L.jsx)(`div`,{className:`animate-rise`,children:(0,L.jsxs)(`div`,{className:`grid gap-6 md:grid-cols-[13.5rem_minmax(0,1fr)] md:gap-8 lg:grid-cols-[15rem_minmax(0,1fr)] lg:gap-10`,children:[(0,L.jsxs)(`aside`,{className:j(`min-w-0 md:sticky md:top-6 md:self-start`,u&&C===2&&`hidden`,u&&D===`back`&&Ve(`back`)),children:[(0,L.jsx)(Ge,{title:p(`settings.title`),open:w===1?x??null:null,onBack:()=>u?n(`/settings`):_(e??null)}),(0,L.jsx)(`div`,{className:j(Ve(T)),children:w===0?(0,L.jsx)(qe,{entries:b,current:u?void 0:x,onPick:()=>_(null)}):(0,L.jsx)(`div`,{ref:f})},w)]}),y?(0,L.jsxs)(`div`,{className:j(`min-w-0`,![`integrate`,`models`].includes(y.id)&&`max-w-2xl`,u&&C<2&&`hidden`,u&&D===`deeper`&&Ve(`deeper`)),children:[u?(0,L.jsx)(`div`,{className:`mb-3`,children:(0,L.jsx)(Ye,{label:S?y.label:p(`settings.title`),onBack:()=>n(S?`/settings/${y.id}`:`/settings`)})}):null,ne?(0,L.jsx)(`div`,{className:`mb-6`,children:(0,L.jsx)(Be,{})}):null,y.id===`connectors`&&i?(0,L.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[i.readOnly?(0,L.jsx)(_e,{children:he(i)}):null,(0,L.jsx)(_t,{projectId:i.id,readOnly:i.readOnly},s),(0,L.jsx)(Xn,{project:i},s)]}):null,y.id===`connectors`&&!i&&!a?(0,L.jsx)(ue,{children:p(`settings.noProject`)}):null,y.id===`models`?(0,L.jsx)(Kn,{}):null,y.id===`integrate`?(0,L.jsx)(Jt,{}):null,y.id===`account`&&r.data?(0,L.jsx)(ke,{me:r.data}):null,y.id===`team`&&r.data?(0,L.jsx)(Jn,{me:r.data}):null,y.id===`plugins`?(0,L.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,L.jsx)(st,{}),(0,L.jsx)(ft,{})]}):null,y.plugin?(0,L.jsx)(Le,{of:y.plugin,children:(0,L.jsx)(y.plugin.component,{})}):null]}):null]})})})}export{Qn as SettingsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{O as r,t as i}from"./logo-C4V2_3Ar.js";import{t as a}from"./useMutation-DKyQXgyj.js";import{Ct as o,Mt as s,Qt as c,a as l,fn as ee,nn as te,rt as ne,tn as u,yt as d}from"./ui-mkL5nF_f.js";import{o as re,r as f,s as ie}from"./brand-CwLcF9JR.js";import{f as ae}from"./session-BuVghS-e.js";import{B as oe,H as p,O as m,Q as h,V as g,Z as se}from"./index-Dq-Wj6Yo.js";import{n as _,t as ce}from"./Harness-_riwRD-c.js";var v=e(t(),1),y=e(n(),1),b=`oklch(50% 0.2 262)`,x=`oklch(32% 0.15 262)`,S=`oklch(90% 0.1 80)`,C=`var(--step-done)`,w=`var(--step-now)`,T=`color-mix(in oklab, var(--on) 38%, transparent)`,E={"--on":`white`,"--tile":`rgb(255 255 255 / 0.1)`,"--tile-hover":`rgb(255 255 255 / 0.15)`,"--tile-ring":`rgb(255 255 255 / 0.15)`,"--panel":`rgb(255 255 255 / 0.07)`,"--panel-ring":`rgb(255 255 255 / 0.12)`,"--pick":`white`,"--pick-ink":x,"--pick-mark":x,"--dot":S,"--step-done":`oklch(88% 0.17 150)`,"--step-now":`oklch(88% 0.14 80)`,"--ready-ink":`oklch(27% 0.09 150)`,"--ink-2":`oklch(96% 0.02 262)`,"--ink-3":`oklch(90% 0.035 262)`,"--ink-4":`oklch(82% 0.05 262)`,"--moss":`oklch(90% 0.14 150)`,"--rose":`oklch(89% 0.09 45)`},D={"--on":`var(--ink)`,"--tile":`var(--card)`,"--tile-hover":`var(--paper-2)`,"--tile-ring":`var(--border-soft)`,"--panel":`var(--card)`,"--panel-ring":`var(--border-soft)`,"--pick":b,"--pick-ink":`white`,"--pick-mark":`white`,"--dot":b,"--step-done":`oklch(52% 0.15 150)`,"--step-now":`oklch(60% 0.15 65)`,"--ready-ink":`white`},O=`ease-[cubic-bezier(0.3,0.7,0.2,1)]`,le=220,ue={codex:`dome`,claude:`oval`,gemini:`wedge`,cursor:`sprout`,own:`bean`,account:`drop`,apple:`pebble`};function de(e){if(e.available)return o(`models.optAppleNote`);switch(e.reason){case`off`:return o(`models.appleOff`);case`loading`:return o(`models.appleLoading`);default:return o(`models.appleDevice`)}}var k=`relative w-fit max-w-full transition-[left,translate] duration-700 ease-[cubic-bezier(0.3,0.7,0.2,1)] motion-reduce:transition-none`,A=`left-1/2 -translate-x-1/2 text-center`,j=`max-lg:left-1/2 max-lg:-translate-x-1/2 max-lg:text-center lg:left-0 lg:translate-x-0 lg:text-left`;function M(){window.matchMedia(`(max-width: 1023px)`).matches&&window.scrollTo({top:0})}var N=`wizards.setup.own`;function P(){try{return sessionStorage.getItem(N)===`1`}catch{return!1}}function F(e){try{e?sessionStorage.setItem(N,`1`):sessionStorage.removeItem(N)}catch{}}function I(){return(0,y.jsxs)(`span`,{className:`inline-flex items-center gap-2.5`,children:[(0,y.jsx)(i,{size:28}),(0,y.jsxs)(`span`,{className:`font-display font-semibold text-[1.0625rem] tracking-tight`,children:[`engenty`,(0,y.jsx)(`span`,{className:`mr-[0.09em] ml-[0.06em] text-(color:--dot)`,children:`.`}),(0,y.jsx)(`span`,{className:`font-normal text-(color:--on)/70`,children:`wizards`})]})]})}function L({selected:e,title:t,description:n,badge:r,note:i,onPick:a}){return(0,y.jsxs)(`button`,{type:`button`,onClick:a,"aria-pressed":e,className:d(`group relative flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left transition-[background-color,color,box-shadow] duration-300`,e?`bg-(color:--pick) text-(color:--pick-ink) shadow-elevated`:`bg-(color:--tile) ring-(color:--tile-ring) ring-1 hover:bg-(color:--tile-hover)`),children:[r?(0,y.jsx)(`span`,{className:`absolute -top-2.5 right-4 rounded-full px-2.5 py-[3px] font-semibold text-[0.6875rem] leading-none tracking-wide shadow-[0_2px_8px_oklch(0%_0_0/0.22)]`,style:{background:S,color:x},children:r}):null,(0,y.jsx)(`span`,{className:d(`flex size-5 shrink-0 items-center justify-center rounded-full border transition-colors duration-300`,e?`border-transparent bg-(color:--pick-mark)`:`border-(color:--on)/40`),children:e?(0,y.jsx)(c,{className:`size-3.5 text-(color:--pick)`}):null}),(0,y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`span`,{className:`block font-medium text-[0.9375rem]`,children:t}),(0,y.jsx)(`span`,{className:d(`mt-0.5 block truncate text-[0.8125rem]`,e?`opacity-70`:`text-(color:--on)/65`),children:n})]}),i?(0,y.jsx)(`span`,{className:d(`shrink-0 text-[0.75rem]`,e?`opacity-70`:`text-(color:--on)/65`),children:i}):null,(0,y.jsx)(u,{className:d(`size-4 shrink-0 transition`,e?`opacity-70`:`text-(color:--on)/40 group-hover:translate-x-0.5 group-hover:text-(color:--on)/80`)})]})}function R({name:e,at:t,done:n}){let r=[o(`setup.stage.connect`),o(`setup.stage.test`),o(`setup.stage.done`)],i=n?r.length:t+1;return(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2 font-medium text-[0.75rem] uppercase tracking-[0.14em]`,children:[(0,y.jsx)(`span`,{className:`text-(color:--on)/70`,children:e}),(0,y.jsx)(`ol`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:r.map((e,r)=>{let i=n||r<t;return(0,y.jsxs)(`li`,{"aria-current":!i&&r===t?`step`:void 0,className:`flex items-center gap-1 transition-colors duration-500`,style:{color:i?C:r===t?w:T},children:[i?(0,y.jsx)(c,{className:`size-3.5`,strokeWidth:3}):null,e]},e)})}),(0,y.jsx)(`span`,{"aria-hidden":`true`,className:`flex gap-1.5`,children:r.map((e,t)=>(0,y.jsx)(`span`,{className:`h-[3px] w-5 rounded-full transition-colors duration-500`,style:{background:t<i?n?C:w:`color-mix(in oklab, var(--on) 22%, transparent)`}},e))})]})}function z({href:e,children:t}){return(0,y.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`transition hover:text-(color:--on)`,onClick:t=>{t.preventDefault(),g(e)},children:t})}function B(){let e=h(`site`),t=ie()===`dark`;re(t?b:null);let n=ae(),i=r(),u=ee(),g=se(),[S,w]=(0,v.useState)(P),[T,N]=(0,v.useState)(!1),B=a({mutationFn:e=>l.put(`/api/studio/local/models`,e===`apple`?{source:`own`,bindings:{classifier:`apple:default`,standard:`apple:default`}}:e===`own`?{source:`own`,bindings:{classifier:``,standard:``}}:{source:e}),onSuccess:async(e,t)=>{await i.invalidateQueries({queryKey:[`me`]}),w(!0),N(!1),M(),F(t===`own`)}}),V=a({mutationFn:()=>Promise.all((n.data?.harnesses??[]).map(e=>l.post(`/api/studio/local/harness/${e.id}/detect`))),onSuccess:()=>i.invalidateQueries({queryKey:[`me`]})});if(!n.data?.models)return null;let H=n.data.models,U=e=>(e.version===null?2:0)+ +!e.app,W=[...n.data.harnesses].sort((e,t)=>U(e)-U(t)),fe=W.filter(e=>e.version!==null),G=n.data.apple,K=H.source===`own`&&H.bindings.standard?.startsWith(`apple:`)?`apple`:S||n.data.setupDone||H.source!==`own`?H.source:null,q=n.data.harnesses.find(e=>e.id===K),J=n.data.setupDone,Y=Object.values(H.keys).some(Boolean),pe=J?2:q?q.auth===`none`?0:1:K===`apple`||Y?1:0,X=J?o(`setup.h.done`):q?q.version===null?o(`setup.h.install`,{name:q.name}):q.auth===`none`?o(`setup.h.signIn`,{name:q.name}):o(`setup.h.test`):o(K===`apple`||Y?`setup.h.test`:`setup.h.keys`),Z=e?g.data?.site:null,Q=K!==null&&!T,$=B.isPending?B.variables??K:K;return(0,y.jsxs)(`div`,{className:`flex min-h-dvh flex-col px-6 text-(color:--on) sm:px-10`,style:t?E:D,children:[(0,y.jsxs)(`header`,{className:`flex items-center justify-between pt-6 sm:pt-8`,children:[(0,y.jsx)(I,{}),(0,y.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(m,{tone:t?`ground`:`surface`}),(0,y.jsx)(p,{tone:t?`ground`:`surface`,ink:x})]})]}),(0,y.jsxs)(`main`,{className:`relative mx-auto flex w-full max-w-6xl flex-1 flex-col pt-6 pb-10 lg:pt-[6vh]`,children:[(0,y.jsx)(`div`,{"aria-hidden":`true`,className:d(`absolute top-6 left-1/2 z-10 origin-top -translate-x-1/2 transition-[opacity,scale,left] duration-500 motion-reduce:transition-none lg:top-[calc(6vh+5.25rem)] lg:origin-center lg:translate-x-0`,O,K?`lg:pointer-events-none lg:left-[calc(50%-560px)] lg:scale-75 lg:opacity-0`:`lg:left-[calc(50%-508px)] lg:scale-100 lg:opacity-100`,Q?`max-lg:pointer-events-none max-lg:scale-[0.4] max-lg:opacity-0`:`max-lg:scale-[0.6] max-lg:opacity-100`),children:(0,y.jsx)(`div`,{className:`animate-rise`,children:(0,y.jsx)(f,{kind:`drop`,size:le,fluffy:!0,coat:`fur`})})}),(0,y.jsx)(`div`,{"aria-hidden":`true`,className:d(`shrink-0 transition-[height] duration-500 motion-reduce:transition-none lg:h-0`,O,Q?`max-lg:h-0`:`max-lg:h-[148px]`)}),(0,y.jsxs)(`div`,{className:`flex flex-col gap-10 lg:flex-row lg:items-start lg:gap-14`,children:[(0,y.jsxs)(`section`,{className:d(`flex w-full shrink-0 animate-rise flex-col lg:w-[32rem] lg:transition-[margin] lg:duration-700 motion-reduce:transition-none`,O,K?`lg:ml-0`:`lg:ml-[calc(50%-16rem)]`,Q?`max-lg:hidden`:``),children:[(0,y.jsxs)(`div`,{className:`flex flex-col lg:min-h-[6.5rem]`,children:[(0,y.jsx)(`p`,{className:d(k,`font-medium text-(color:--on)/70 text-[0.75rem] uppercase tracking-[0.16em]`,K?j:A),children:o(`setup.title`)}),(0,y.jsx)(`h1`,{className:d(k,`mt-2 font-display font-semibold text-[1.625rem] leading-[1.08] tracking-[-0.02em] sm:text-[1.75rem]`,K?j:A),children:o(`setup.source`)}),(0,y.jsx)(`p`,{className:d(k,`mt-2.5 text-(color:--on)/75 text-[0.9375rem] leading-relaxed`,K?j:A),children:o(`setup.sub`)})]}),(0,y.jsxs)(`div`,{className:`mt-5 flex flex-col gap-2.5`,children:[W.map((e,t)=>(0,y.jsx)(L,{selected:$===e.id,title:e.name,description:o(`harness.desc.${e.id}`),badge:t===0?o(`setup.recommended`):void 0,note:e.version===null?o(`harness.notInstalled`):e.auth===`subscription`?o(`harness.ready`):void 0,onPick:()=>B.mutate(e.id)},e.id)),G?.supported?(0,y.jsx)(L,{selected:$===`apple`,title:o(`models.optApple`),description:o(`setup.appleDesc`),note:de(G),onPick:()=>B.mutate(`apple`)}):null,(0,y.jsx)(L,{selected:$===`own`,title:o(`local.sourceOwn`),description:o(`setup.ownDesc`),onPick:()=>B.mutate(`own`)})]}),(0,y.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center justify-center gap-x-2 gap-y-1 text-(color:--on)/60 text-[0.8125rem]`,children:[(0,y.jsx)(`span`,{children:fe.length?null:o(`setup.noHarness`)}),(0,y.jsxs)(ne,{variant:`ghost`,size:`sm`,busy:V.isPending,onClick:()=>V.mutate(),children:[(0,y.jsx)(s,{className:`size-3.5`}),` `,o(`local.recheck`)]})]})]}),K?(0,y.jsxs)(`section`,{className:d(`min-w-0 flex-1 animate-settle`,T?`max-lg:hidden`:``),children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>{N(!0),M()},className:`-ml-1.5 mb-5 inline-flex items-center gap-1.5 rounded-full px-1.5 py-1 text-(color:--on)/80 text-[0.875rem] transition hover:text-(color:--on) lg:hidden`,children:[(0,y.jsx)(te,{className:`size-4`}),` `,o(`run.back`)]}),(0,y.jsxs)(`div`,{className:`relative`,children:[(0,y.jsx)(`div`,{"aria-hidden":`true`,className:`absolute top-6 right-2 z-10`,children:(0,y.jsx)(f,{kind:ue[K],size:120,fluffy:!0,coat:`fur`})}),(0,y.jsxs)(`div`,{className:`min-h-[6.5rem]`,children:[(0,y.jsx)(R,{name:q?.name??o(K===`apple`?`models.optApple`:`local.sourceOwn`),at:pe,done:J}),(0,y.jsx)(`h2`,{className:`mt-2 animate-rise pr-32 font-display font-semibold text-[clamp(28px,3vw,40px)] leading-[1.06] tracking-[-0.03em]`,children:X},X)]}),(0,y.jsx)(`div`,{className:`mt-5 rounded-2xl bg-(color:--panel) p-5 ring-(color:--panel-ring) ring-1 sm:p-6`,children:q?(0,y.jsx)(ce,{me:n.data,id:q.id,autoTest:!J}):K===`apple`?(0,y.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,y.jsx)(`p`,{className:`text-[0.875rem] text-ink-2 leading-relaxed`,children:o(`setup.appleHint`)}),(0,y.jsx)(_,{auto:!J&&G?.available===!0})]}):(0,y.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,y.jsx)(oe,{models:H}),(0,y.jsx)(_,{})]})}),(0,y.jsxs)(`div`,{className:`mt-9`,children:[J?(0,y.jsxs)(`p`,{className:`mb-3 flex animate-rise items-center gap-2 font-medium text-[0.9375rem]`,style:{color:C},children:[(0,y.jsx)(c,{className:`size-4`,strokeWidth:3}),o(`setup.ready`)]}):null,(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,y.jsxs)(`button`,{type:`button`,disabled:!J,onClick:()=>u(`/`,{replace:!0}),className:d(`group inline-flex h-12 items-center gap-2.5 rounded-full px-6 font-semibold text-[1rem] transition-[background-color,color,box-shadow,filter] duration-300`,J?`shadow-[0_6px_24px_oklch(88%_0.17_150/0.35)] hover:brightness-105`:`cursor-not-allowed bg-(color:--on)/20 text-(color:--on)/65`),style:J?{background:C,color:`var(--ready-ink)`}:void 0,children:[o(`setup.done`),(0,y.jsx)(`span`,{"aria-hidden":`true`,className:`transition-transform group-enabled:group-hover:translate-x-0.5`,children:`→`})]}),J?null:(0,y.jsx)(`span`,{className:`text-(color:--on)/65 text-[0.8125rem]`,children:o(`setup.untilWorks`)})]})]})]})]},K):null]})]}),(0,y.jsxs)(`footer`,{className:`mx-auto flex w-full max-w-6xl items-center justify-between gap-4 pb-6 text-(color:--on)/55 text-[0.75rem] sm:pb-8`,children:[(0,y.jsxs)(`span`,{children:[`© `,new Date().getFullYear(),` Thru The Heart Creative GmbH - Matthias Platzer ·`,` `,o(`setup.local`)]}),(0,y.jsxs)(`span`,{className:`flex items-center gap-5`,children:[Z?(0,y.jsx)(z,{href:Z,children:new URL(Z).host}):null,(0,y.jsx)(`span`,{"aria-hidden":`true`,className:`size-[3px] bg-(color:--dot)`})]})]})]})}export{B as SetupPage};
|