Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Cancel trial / Cancel plan with a short survey on the plan card (#3747)
Milind Soni4937ff92099c
diff --git a/cancel-plan-preview.html b/cancel-plan-preview.htmlnew file mode 100644index 0000000000..7aef0293a0--- /dev/null+++ b/cancel-plan-preview.html@@ -0,0 +1,12 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <title>Cancel Plan Preview</title>+ </head>+ <body>+ <div id="root"></div>+ <script type="module" src="/src/cancel-plan-preview.tsx"></script>+ </body>+</html>diff --git a/docs/cloud-pro.md b/docs/cloud-pro.mdindex 9aeed0f639..3091e09722 100644--- a/docs/cloud-pro.md+++ b/docs/cloud-pro.md@@ -1663,6 +1663,13 @@ without them works as before; a malformed one is dropped, never the machine):entitlement still decides everything.- `cloud.credit: {grantedUsd, remainingUsd, state}`: the trial's Claudecredit (`active` or `used_up`), shown in Settings here and on the Cloud.+- `clouds[]` (top level): every Cloud the person can open. The app reads one+ thing from it, the plan's renewal (`electron/cloud-home.mjs`+ `parseCloudRenewal`): the account's own primary Cloud's `renewal: {trial,+ endsAt, keptDays}`, which the Admin sends only to the account that pays for+ it while its plan runs. The state carries `renewal: {trial, cancelled,+ renewsAt, endsAt, keptDays, team?}` without the Cloud's id, which stays in+ main. See [Cancel trial / Cancel plan](#cancel-trial--cancel-plan).- `offer` (top level, beside `cloud`): what this account may buy now, onlywhile it can (no plan, no Cloud, no payment being linked). See[Add a Cloud](#add-a-cloud) for its fields.@@ -1691,6 +1698,47 @@ ending, late or ended whenever the Admin says. The page says it showed onewith `cloud-plan:notice-seen`, which names nothing. It is an entry in thenotice queue (below), on this computer's page and on My Cloud's own page.+#### Cancel trial / Cancel plan++Customers couldn't find how to cancel: the plan card only said **Manage in+your browser**. Now, while the session's `renewal` says this account pays for a+plan that runs, the plan card in Settings (Usage & billing → Plan in Simple+mode, MausBot Cloud in Advanced) and on the Cloud's own page in home mode+(`CloudPlanOnCloud`) shows **Cancel trial** during a free trial and **Cancel+plan** otherwise (`src/components/CloudCancelPlan.tsx`). Someone in a team's+Cloud never sees it: the Admin sends no `renewal` for a Cloud they don't pay+for.++Its sheet asks "Before you go: what's the main reason?" with one-tap chips+(Missing a feature, Too expensive, Hard to set up, Didn't work as I expected,+Not using it right now, Something else; tap again to let one go), two optional+boxes ("What did you expect MausBot to do?", "What could we have done+better?"), "Rather talk it through? Book 30 minutes with Milind", and **Keep my+plan** and **Cancel my trial** / **Cancel my plan**. Cancelling never needs an+answer. The page sends only the survey's words: `cloudAccount.cancelPlan` on+this computer's page, `cloudPlan.cancel` on the Cloud's page (only from the+person's click there). Main checks them (`cancelSurvey`: one of the reasons,+words without one kept as `other`, each box at most 2,000 characters), sends+`POST /api/cloud/desktop/feedback` first when anything was said, given 8 s and+let go when it fails or is refused, then `POST+/api/cloud/desktop/clouds/<id>/cancel` for the Cloud the verified session+names, never one a page names. After: "Cancelled. Your trial ends on {date},+and nothing is charged." (a paid plan: "Your plan ends on {date}. You won't be+charged again."), "The Cloud stops then. Its files are kept {N} days, then+deleted." (a Team Cloud: it stops for everyone in the team), and "Changed your+mind? **Keep my plan**" (`keepPlan` / `cloudPlan.keep`, `…/keep`). A plan+already cancelled shows when it ends and **Keep my plan** in place of Cancel,+and the trial's own button then reads as the plain manage button.++An Admin from before these routes sends no `renewal`, so the card stays as it+was (**Manage in your browser**). If the routes are missing anyway (its own+404, 405 or 501, never its `not_found` for the Cloud), main opens the Cloud+page's billing (`/cloud/personal/billing`) in the browser and the sheet says+so. Deploy the Admin before the app release that uses it.++`cancel-plan-preview.html` (dev only, `pnpm dev`) shows the real cards with a+fake bridge: `?view=settings|cloud&plan=trial|paid|team&cancelled=1&admin=old&skin=midnight|daylight&lang=de`.+#### One card at a time: the notice queue`components/AppNotices.tsx` is the one place for the Cloud Pro popup and thediff --git a/electron/cloud-account-ipc.node-test.mjs b/electron/cloud-account-ipc.node-test.mjsindex 0b0625185e..32af05567e 100644--- a/electron/cloud-account-ipc.node-test.mjs+++ b/electron/cloud-account-ipc.node-test.mjs@@ -103,3 +103,29 @@ test("main opens a checkout only for a plan the offer sells now and one of thisawait assert.rejects(handle(event, "pro", "app_card"), /isn't offered/);assert.deepEqual(calls, [["pro", "app_card"], ["pro", "app_onboarding"]]);});++test("Cancel and Keep my plan from Settings carry only the survey's words, and only the exact local main frame may ask", async () => {+ const f = preload();+ await f.bridge.cloudAccount.cancelPlan({ answer: "price", expected: "words" }, { origin: "https://evil.example.test" });+ await f.bridge.cloudAccount.cancelPlan();+ await f.bridge.cloudAccount.keepPlan({ cloudId: "someone-elses" });+ assert.deepEqual(f.invoked, [["cloud-account:cancelPlan", { answer: "price", expected: "words" }], ["cloud-account:cancelPlan", null], ["cloud-account:keepPlan"]]);+ const source = readFileSync(new URL("./main.mjs", import.meta.url), "utf8"), start = source.indexOf("const workspaceOnly ="), end = source.indexOf('ipcMain.handle("organization:settings-opened"', start);+ const handlers = new Map(), calls = [], frame = { url: `${origin}/` }, contents = { mainFrame: frame };+ localOrigin.setLocalOrigin(origin);+ const context = vm.createContext({ ipcMain: { handle: (channel, handler) => handlers.set(channel, handler) },+ localOnly: localOrigin.localOnly, workspaceSenderAllowed: environments.workspaceSenderAllowed, mainWindow: { webContents: contents },+ rendererOrigin: () => origin, environmentsState: { environments: [], activeId: "local" },+ ensureCloudAccount: () => ({ cancelPlan: (...args) => { calls.push(["cancelPlan", ...args]); return { outcome: "cancelled" }; },+ keepPlan: (...args) => { calls.push(["keepPlan", ...args]); return { outcome: "kept" }; } }) });+ vm.runInContext(source.slice(start, end), context);+ const page = { sender: contents, senderFrame: frame };+ await handlers.get("cloud-account:cancelPlan")(page, { answer: "setup" }, "https://evil.example.test");+ await handlers.get("cloud-account:keepPlan")(page, "anything");+ assert.deepEqual(calls, [["cancelPlan", { answer: "setup" }], ["keepPlan"]]);+ for (const channel of ["cloud-account:cancelPlan", "cloud-account:keepPlan"]) {+ for (const sender of [{ sender: contents, senderFrame: { url: `${origin}/subframe` } }, { sender: {}, senderFrame: frame },+ { sender: contents, senderFrame: { url: "https://remote.example.test" } }]) assert.throws(() => handlers.get(channel)(sender, { answer: "price" }), /only available/);+ }+ assert.equal(calls.length, 2);+});diff --git a/electron/cloud-account.d.mts b/electron/cloud-account.d.mtsindex ecbd0d2d85..2e90d88049 100644--- a/electron/cloud-account.d.mts+++ b/electron/cloud-account.d.mts@@ -51,7 +51,21 @@ export interface CloudAccountState {staging?: true;/** Connected: opening My Cloud waits for it to wake. */waking?: true;+ /** Connected: the plan's renewal, only while this account pays for a plan that runs: what Cancel and Keep act on (display only). */+ renewal?: import("./cloud-list.mjs").CloudRenewal;}+/** The cancel sheet's reasons. */+export type CloudCancelAnswer = "feature" | "price" | "setup" | "broken" | "later" | "other";+/** The cancel sheet's survey: one reason (words without one are kept as `other`) and two optional boxes, at most 2,000 characters each. */+export interface CloudCancelSurvey { answer?: CloudCancelAnswer | null; expected?: string; improve?: string }+/** What Cancel or Keep my plan did: `cancelled` (with when it ends, from the Admin's answer, and whether the survey was kept),+ * `kept`, `browser` (this Admin can't do it from the app yet, so the Cloud page's billing opened instead), or `failed`+ * (nothing changed). */+export type CloudRenewalResult =+ | { outcome: "cancelled"; renewal: import("./cloud-list.mjs").CloudRenewal | null; surveyed: boolean; state: CloudAccountState }+ | { outcome: "kept"; state: CloudAccountState }+ | { outcome: "browser" }+ | { outcome: "failed"; state: CloudAccountState };/** The email-code sign-in (cloud-signin.mjs). `sent`: the code is on its* way (`resendAt`: when another may be asked for). `browser`: this Cloud signs* in only in the browser (single sign-on there, or an older Admin). */@@ -139,6 +153,9 @@ export interface CloudAccountBridge {connectHomeForPhone(): Promise<CloudAccountState>;/** Opens a team's Cloud in this window, as the switcher does: one the verified session lists, by its id. Absent on an older app. */openTeam?(teamId: string): Promise<void>;+ /** Cancel trial / Cancel plan, after the survey when it says anything; Keep my plan. The Cloud is the verified session's own, never the page's. Absent on an older app. */+ cancelPlan?(survey: CloudCancelSurvey | null): Promise<CloudRenewalResult>;+ keepPlan?(): Promise<CloudRenewalResult>;onState(callback: (state: CloudAccountState) => void): () => void;files?: import("./cloud-sync.mjs").CloudFilesBridge;}@@ -159,6 +176,8 @@ export interface CloudPlanSnapshot {home?: true;/** Verified, with an active plan: its allowances and their use this month (the usage meter). */usage?: import("./cloud-home.mjs").CloudUsage;+ /** Verified, while this account pays for a plan that runs: what Cancel and Keep act on. */+ renewal?: import("./cloud-list.mjs").CloudRenewal;}export interface CloudPlanBridge {state(): Promise<CloudPlanSnapshot>;@@ -170,6 +189,9 @@ export interface CloudPlanBridge {/** The usage meter's Upgrade: the preview, then the change (only from the person's click). Absent on an older app. */upgradePreview?(plan: string, source: string): Promise<CloudUpgradePreviewResult>;upgrade?(plan: string, source: string): Promise<CloudUpgradeResult>;+ /** Cancel trial / Cancel plan and Keep my plan on the Cloud's own page (only from the person's click). Absent on an older app. */+ cancel?(survey: CloudCancelSurvey | null): Promise<CloudRenewalResult>;+ keep?(): Promise<CloudRenewalResult>;}export declare const CLOUD_ORIGIN: string;@@ -181,6 +203,9 @@ export declare function cloudTarget(env?: Record<string, string | undefined>): {};export declare const CHECKOUT_SOURCES: readonly string[];export declare const UPGRADE_SOURCES: readonly string[];+export declare const CLOUD_CANCEL_ANSWERS: readonly CloudCancelAnswer[];+/** The survey as main sends it (trimmed; words without a reason as `other`), or null when it says nothing or isn't one. */+export declare function cancelSurvey(input: unknown): { answer: CloudCancelAnswer; expected?: string; improve?: string } | null;export declare function checkoutDestination(value: unknown, options?: { fixture?: boolean; staging?: boolean }): string | null;export declare function cloudOrigin(value?: string, fixture?: boolean): string;export interface CloudAccountStore {@@ -224,6 +249,11 @@ export interface CloudAccountClient {upgradePreview(plan: string, source: string): Promise<CloudUpgradePreviewResult>;/** POST /api/cloud/desktop/upgrade with this app's own preview's confirmation, or nothing is asked. */upgrade(plan: string, source: string): Promise<CloudUpgradeResult>;+ /** POST /api/cloud/desktop/feedback when the survey says anything (never in the cancel's way), then POST+ * /api/cloud/desktop/clouds/<the session's own Cloud>/cancel. */+ cancelPlan(survey: unknown): Promise<CloudRenewalResult>;+ /** POST /api/cloud/desktop/clouds/<the session's own Cloud>/keep. */+ keepPlan(): Promise<CloudRenewalResult>;homeTarget(): { origin: string } | null;/** The Admin's last word on a Cloud whose plan sleeps; null for any other. */power(): import("./cloud-power.mjs").CloudPower | null;diff --git a/electron/cloud-account.mjs b/electron/cloud-account.mjsindex 077360d1b9..ff126edf4c 100644--- a/electron/cloud-account.mjs+++ b/electron/cloud-account.mjs@@ -1,6 +1,6 @@import { createManagedDesktopStore, retryDelay, unreadableRecord } from "./managed-desktop.mjs";import { CLOUD_MACHINE_CONNECTABLE, cloudUnreachableText, parseCloudCredit, parseCloudOffer, parseCloudPurchase, parseCloudSummary, parseCloudTeams, parseCloudTrial, parseCloudUsage, parsePairingGrant, parsePublicOffer, withoutTrial } from "./cloud-home.mjs";-import { CLOUD_ID, CLOUD_SWATCHES, cleanCloudListName, otherOwnClouds, ownCloud, parseCloudList, releaseVersion } from "./cloud-list.mjs";+import { CLOUD_ID, CLOUD_SWATCHES, cleanCloudListName, otherOwnClouds, ownCloud, parseCloudList, parseCloudRenewal, releaseVersion } from "./cloud-list.mjs";import { planTeam, teamPlan } from "./cloud-team-plan.mjs";import { cleanCode, cleanEmail, parseSignInStart, SIGN_IN_START, SIGN_IN_TRIES, SIGN_IN_VERIFY, signInIdentity, startFailure, verifyFailure } from "./cloud-signin.mjs";@@ -35,6 +35,21 @@ export const UPGRADE_SOURCES = Object.freeze(["app_usage", "app_settings"]);const UPGRADE_TIERS = Object.freeze(["starter", "personal", "pro", "max"]);const UPGRADE_REFUSALS = Object.freeze(["payment_failed", "not_subscribed", "already_on_plan", "plan_change_unavailable", "confirmation_required", "price_changed", "rate_limited"]);const CONFIRMATION = /^[A-Za-z0-9_-]{43}$/;+/** The cancel sheet's reasons, as the Admin takes them. */+export const CLOUD_CANCEL_ANSWERS = Object.freeze(["feature", "price", "setup", "broken", "later", "other"]);+const SURVEY_TEXT_MAX = 2_000, SURVEY_WAIT_MS = 8_000;+/**+ * The cancel sheet's survey as main sends it: one reason and each box trimmed, at most 2,000 characters. Words without a+ * reason are kept as `other`; null when nothing was said, and for anything that isn't a survey (it is never sent then).+ */+export function cancelSurvey(input) {+ if (!input || typeof input !== "object" || Array.isArray(input)) return null;+ const box = value => typeof value === "string" ? value.trim() : "";+ const answer = CLOUD_CANCEL_ANSWERS.includes(input.answer) ? input.answer : null, expected = box(input.expected), improve = box(input.improve);+ if ((input.answer !== undefined && input.answer !== null && !answer) || expected.length > SURVEY_TEXT_MAX || improve.length > SURVEY_TEXT_MAX) return null;+ if (!answer && !expected && !improve) return null;+ return { answer: answer ?? "other", ...(expected ? { expected } : {}), ...(improve ? { improve } : {}) };+}/** Why the Admin won't open another Cloud's checkout now (POST clouds, 409 `addBlocked`; contract v1). */export const ADD_BLOCKS = Object.freeze(["cap", "checkout_open", "rate", "signups_closed"]);const ADD_INTERVALS = Object.freeze(["month", "year"]);@@ -85,6 +100,8 @@ export function createCloudAccountClient({ store, openBrowser, platform, deviceNlet value = { status: "signed-out", message: "restoring" }, generation = 0, timer = null, closed = false, clearing = null, refreshing = null;let verifiedUntil = 0, restoring = false, controller = new AbortController(), failures = 0;let plan = null, savedHint = null;+ /** The plan's own Cloud that Cancel and Keep act on, as the last verified session names it. */+ let renewalCloud = null;let offerCache = null, offerPending = null, waking = false;/** The checkout this app opened, its address kept here for Reopen and Copy link: never published, never asked for again. */let opened = null;@@ -184,6 +201,18 @@ export function createCloudAccountClient({ store, openBrowser, platform, deviceN}return { outcome: "failed" };}+ /**+ * An Admin without the app's Cancel and Keep (its own 404, 405 or 501) opens the Cloud page's billing instead. Its `not_found`+ * is the Cloud, not the route: the session is read again.+ */+ async function renewalFailure(error, signedIn) {+ if (signInEnded(error)) return { outcome: "failed", state: await refresh().catch(() => state()) };+ if (grant === signedIn && !error?.opaque && [404, 405, 501].includes(error?.status) && error.code !== "not_found") {+ await openBrowser(`${origin}/cloud/personal/billing`);+ return { outcome: "browser" };+ }+ return { outcome: "failed", state: [404, 409].includes(error?.status) ? await refresh().catch(() => state()) : state() };+ }async function revoke(previous) {try { await request("session", { method: "DELETE", body: {}, token: previous.token, signal: AbortSignal.timeout(20_000) }); }catch (error) { if (![401, 403].includes(error?.status) || error.opaque) throw error; }@@ -200,7 +229,7 @@ export function createCloudAccountClient({ store, openBrowser, platform, deviceNfunction forget({ quiet = false } = {}) {if (clearing) return clearing;const previous = grant ?? issued ?? cleanup, stamp = reset();- grant = null; issued = null; cleanup = previous; cleanupNeeded = true; plan = null; savedHint = null; opened = null; adding = null;+ grant = null; issued = null; cleanup = previous; cleanupNeeded = true; plan = null; savedHint = null; opened = null; adding = null; renewalCloud = null;if (!quiet) publish({ status: "signed-out" });const operation = (async () => {const [persisted, revoked] = await Promise.allSettled([Promise.resolve().then(() => store.write(null)), previous ? revoke(previous) : Promise.resolve()]);@@ -229,6 +258,7 @@ export function createCloudAccountClient({ store, openBrowser, platform, deviceNconst trial = parseCloudTrial(result.cloud?.trial), credit = parseCloudCredit(result.cloud?.credit), offer = parseCloudOffer(result.offer);const usage = access.status === "active" ? parseCloudUsage(result.cloud?.usage) : null;const clouds = parseCloudList(result.clouds), more = clouds ? addOffer(result) : null, latest = clouds ? releaseVersion(result.latestVersion) : null;+ const { cloudId: renewingCloud = null, ...renewal } = parseCloudRenewal(result.clouds) ?? {};const hint = access.plan === "pro" ? { ...(access.tier ? { tier: access.tier } : {}), active: access.status === "active" } : null;if (next.expiresAt !== previous.expiresAt) {const replacement = { ...previous, expiresAt: next.expiresAt };@@ -240,6 +270,7 @@ export function createCloudAccountClient({ store, openBrowser, platform, deviceNif (!current(stamp) || grant !== previous) return state();}plan = hint ? { accountId: grant.account.id, ...hint } : null;+ renewalCloud = renewingCloud;failures = 0;// A checkout the Admin still holds open, with none kept here (this app restarted mid-checkout): watched as this// app's own from first sight, so payment, setup and "ready" are followed as closely as before the restart.@@ -255,7 +286,7 @@ export function createCloudAccountClient({ store, openBrowser, platform, deviceNverifiedUntil = Math.min(grant.expiresAt, now() + STEADY_MS,access.status === "active" && access.expiresAt !== null ? access.expiresAt : Infinity);publish({ ...view("connected"), entitlement: access, ...(machine ? { machine } : {}), ...(teams.length ? { teams } : {}), ...(purchase ? { purchase } : {}),- ...(trial ? { trial } : {}), ...(credit ? { credit } : {}), ...(offer ? { offer } : {}), ...(usage ? { usage } : {}),+ ...(trial ? { trial } : {}), ...(credit ? { credit } : {}), ...(offer ? { offer } : {}), ...(usage ? { usage } : {}), ...(renewingCloud ? { renewal } : {}),...(clouds ? { clouds, addCloud: more } : {}), ...(latest ? { latestVersion: latest } : {}), verifiedAt: now(), verifiedUntil });const planCloud = teamPlan(value) ? planTeam(value)?.machine ?? null : machine;const settingUp = planCloud?.status === "provisioning" || (access.status === "active" && !planCloud) || Boolean(purchase) || otherOwnClouds(clouds).some(cloud => cloud.status === "setting_up");@@ -501,6 +532,36 @@ export function createCloudAccountClient({ store, openBrowser, platform, deviceNif (result?.cloudContractVersion !== 1 || !["upgraded", "pending"].includes(result.status)) return { outcome: "failed" };return { outcome: result.status, tier: TIER.test(result.tier ?? "") ? result.tier : plan };},+ /**+ * Cancel trial / Cancel plan: the survey first when the person said anything (given SURVEY_WAIT_MS, and let go when it+ * fails or is refused), then renewal off for the plan's own Cloud, named by the verified session, never by a page.+ * `cancelled`: when it ends, from the Admin's answer (`renewal`), and whether the survey was kept; `browser`: this Admin+ * can't cancel from the app yet, so its Cloud page's billing opened instead; `failed`: nothing changed.+ */+ async cancelPlan(input) {+ const signedIn = grant, cloudId = renewalCloud;+ if (!signedIn || !cloudId || state().status !== "connected") return { outcome: "failed", state: state() };+ const survey = cancelSurvey(input);+ let surveyed = false;+ if (survey) {+ try { await request("feedback", { method: "POST", body: { cloudId, ...survey }, token: signedIn.token, timeoutMs: SURVEY_WAIT_MS }); surveyed = true; }+ catch {}+ }+ if (grant !== signedIn) return { outcome: "failed", state: state() };+ let result;+ try { result = await request(`clouds/${cloudId}/cancel`, { method: "POST", body: {}, token: signedIn.token, timeoutMs: 60_000 }); }+ catch (error) { return renewalFailure(error, signedIn); }+ const { cloudId: answered, ...renewal } = result?.cloudContractVersion === 1 ? parseCloudRenewal([result.cloud]) ?? {} : {};+ return { outcome: "cancelled", renewal: answered === cloudId ? renewal : null, surveyed, state: await refresh().catch(() => state()) };+ },+ /** Keep my plan: renewal back on for the same Cloud, as `cancelPlan` names it. */+ async keepPlan() {+ const signedIn = grant, cloudId = renewalCloud;+ if (!signedIn || !cloudId || state().status !== "connected") return { outcome: "failed", state: state() };+ try { await request(`clouds/${cloudId}/keep`, { method: "POST", body: {}, token: signedIn.token, timeoutMs: 60_000 }); }+ catch (error) { return renewalFailure(error, signedIn); }+ return { outcome: "kept", state: await refresh().catch(() => state()) };+ },async offer() {const current = state();if (current.status === "connected" && current.offer) return current.offer;@@ -802,7 +863,7 @@ export function cloudPlanSnapshot(state, { notice = null } = {}) {const named = typeof tier === "string" ? { tier } : {};const trial = state?.status === "connected"? { ...(state.trial ? { trial: state.trial } : {}), ...(state.credit ? { credit: state.credit } : {}), ...(notice && state.trial ? { notice } : {}),- ...(state.machine?.power?.sleeps ? { sleeps: true } : {}), ...(state.usage ? { usage: state.usage } : {}) } : {};+ ...(state.machine?.power?.sleeps ? { sleeps: true } : {}), ...(state.usage ? { usage: state.usage } : {}), ...(state.renewal ? { renewal: state.renewal } : {}) } : {};if (state?.status === "connected" && state.entitlement?.plan === "pro") return { status: state.entitlement.status === "active" ? "paid" : "attention", ...named, ...trial };if (state?.status === "reauth-required") return { status: "signin", ...(state.lastPlan ? { tier: state.lastPlan.tier ?? "pro" } : {}) };if (state?.status !== "connected" && state?.lastPlan) return { status: "checking", ...named };diff --git a/electron/cloud-account.node-test.mjs b/electron/cloud-account.node-test.mjsindex fa7d887e7e..28340a2dea 100644--- a/electron/cloud-account.node-test.mjs+++ b/electron/cloud-account.node-test.mjs@@ -4,7 +4,7 @@ import { createServer } from "node:http";import { mkdtemp, readFile, rm, stat } from "node:fs/promises";import { tmpdir } from "node:os";import { join } from "node:path";-import { CHECKOUT_SOURCES, checkoutDestination, cloudMenuSublabel, createCloudAccountClient, createCloudAccountStore, cloudOrigin, cloudPlanSnapshot, CLOUD_ORIGIN } from "./cloud-account.mjs";+import { cancelSurvey, CHECKOUT_SOURCES, checkoutDestination, cloudMenuSublabel, createCloudAccountClient, createCloudAccountStore, cloudOrigin, cloudPlanSnapshot, CLOUD_ORIGIN } from "./cloud-account.mjs";const accessToken = `omc_${"T".repeat(43)}`;const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));@@ -15,7 +15,9 @@ async function fixture(t, options = {}) {entitlement: { plan: "free", status: "inactive", expiresAt: null, version: 0 }, timer: null, delay: null, cloud: undefined, expiresIn: 600,disk: { status: 404, body: "<!doctype html>not here" }, x: { status: 404, body: { error: "unsupported" } }, pages: { status: 404, body: { error: "unsupported" } }, sessionPage: null, sessionError: null, tokenPage: null, publicConfig: { status: 404, body: { error: "not_found" } },offer: undefined, checkout: { status: 404, body: "<!doctype html>not here" }, interest: { status: 200, body: { ok: true } },- upgradePreview: { status: 404, body: { error: "not_found" } }, upgrade: { status: 404, body: { error: "not_found" } }, teams: undefined, teamPairing: { status: 404, body: { error: "not_found" } }, moved: { status: 404, body: { error: "not_found" } }, moveStatus: { status: 404, body: { error: "not_found" } } };+ upgradePreview: { status: 404, body: { error: "not_found" } }, upgrade: { status: 404, body: { error: "not_found" } }, teams: undefined, teamPairing: { status: 404, body: { error: "not_found" } }, moved: { status: 404, body: { error: "not_found" } }, moveStatus: { status: 404, body: { error: "not_found" } },+ // An Admin before the app's Cancel and Keep: neither route, and the session's `clouds` absent.+ clouds: undefined, feedback: { status: 404, body: { error: "Not found." } }, renewal: () => ({ status: 404, body: { error: "Not found." } }) };const identity = () => ({ cloudContractVersion: 1, expiresAt: f.now + 86400_000, device: { id: "fixture-device" }, account: { id: "fixture-account", email: "[email protected]" } });const server = createServer(async (req, res) => {let body = ""; for await (const chunk of req) body += chunk;@@ -37,6 +39,9 @@ async function fixture(t, options = {}) {if (req.url === "/api/cloud/desktop/services/pages" && req.headers.authorization === `Bearer ${accessToken}`) return send(f.pages.status, f.pages.body);if (req.url === "/api/cloud/desktop/moved" && req.method === "POST" && req.headers.authorization === `Bearer ${accessToken}`) return send(f.moved.status, f.moved.body);if (req.url === "/api/cloud/desktop/move-status" && req.method === "POST" && req.headers.authorization === `Bearer ${accessToken}`) return send(f.moveStatus.status, f.moveStatus.body);+ if (req.url === "/api/cloud/desktop/feedback" && req.method === "POST" && req.headers.authorization === `Bearer ${accessToken}`) return send(f.feedback.status, f.feedback.body);+ const renewal = /^\/api\/cloud\/desktop\/clouds\/([^/]+)\/(cancel|keep)$/.exec(req.url);+ if (renewal && req.method === "POST" && req.headers.authorization === `Bearer ${accessToken}`) { const answer = f.renewal(renewal[2], renewal[1]); return send(answer.status, answer.body); }for (const [route, answer] of [["/api/cloud/desktop/checkout", f.checkout], ["/api/cloud/desktop/interest", f.interest],["/api/cloud/desktop/upgrade/preview", f.upgradePreview], ["/api/cloud/desktop/upgrade", f.upgrade]]) {if (req.url !== route || req.method !== "POST" || req.headers.authorization !== `Bearer ${accessToken}`) continue;@@ -56,7 +61,7 @@ async function fixture(t, options = {}) {if (f.sessionStatus !== 200) return send(f.sessionStatus, { error: "unavailable" });return send(200, { ...identity(), ...(f.invalidIdentity ? { account: { id: "someone-else", email: "[email protected]" } } : {}),entitlement: f.invalidEntitlement ? { plan: "pro", status: "active" } : f.entitlement, ...(f.cloud === undefined ? {} : { cloud: f.cloud }),- ...(f.offer === undefined ? {} : { offer: f.offer }), ...(f.teams === undefined ? {} : { teams: f.teams }) });+ ...(f.offer === undefined ? {} : { offer: f.offer }), ...(f.teams === undefined ? {} : { teams: f.teams }), ...(f.clouds === undefined ? {} : { clouds: f.clouds }) });}send(404, { error: "not_found" });});@@ -883,3 +888,107 @@ test("usage meter: no usage without an active plan, and none from a malformed anassert.equal(f.client.state().status, "connected");assert.equal(f.client.state().usage, undefined);});++const MY_CLOUD = "3f1c2b4a-5d6e-4f70-8a9b-0c1d2e3f4a5b", TEAM_CLOUD = "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d", DAY = 86_400_000;+/** The session's `clouds` as the Admin lists them: a team Cloud this person is only in, and their own primary Cloud on a trial. */+function renewingClouds(f, renewal = { trial: true, endsAt: null, keptDays: 3 }) {+ return [{ id: TEAM_CLOUD, name: "Acme", role: "member", teamId: "team-acme", primary: false, renewsAt: null, cancelAtPeriodEnd: false },+ { id: MY_CLOUD, name: "My Cloud", role: "owner", teamId: null, primary: true, renewsAt: renewal.endsAt === null ? f.now + 5 * DAY : null, cancelAtPeriodEnd: renewal.endsAt !== null, renewal }];+}+/** An Admin with the app's Cancel and Keep: each turns the Cloud's renewal off or on, and the next session says so. */+function renewalAdmin(f) {+ f.feedback = { status: 201, body: { cloudContractVersion: 1, id: "answer-1" } };+ f.renewal = (action, cloudId) => {+ if (cloudId !== MY_CLOUD) return { status: 404, body: { error: "not_found", errorDescription: "There is no such Cloud on your account." } };+ f.clouds = renewingClouds(f, { trial: true, endsAt: action === "cancel" ? f.now + 5 * DAY : null, keptDays: 3 });+ return { status: 200, body: { cloudContractVersion: 1, cloud: f.clouds[1] } };+ };+}+const posts = f => f.requests.filter(request => request.method === "POST" && /\/(?:feedback|cancel|keep)$/.test(request.route))+ .map(request => [request.route.replace("/api/cloud/desktop/", ""), JSON.parse(request.body || "null"), request.token === `Bearer ${accessToken}`]);++test("the plan's renewal comes from the session's own primary Cloud, for display only; the Cloud's id stays in main", async t => {+ const f = await fixture(t);+ f.entitlement = { plan: "pro", tier: "pro", status: "active", expiresAt: f.now + 30 * DAY, version: 2 };+ f.clouds = renewingClouds(f);+ await f.connect();+ assert.deepEqual(f.client.state().renewal, { trial: true, cancelled: false, renewsAt: f.now + 5 * DAY, endsAt: null, keptDays: 3 });+ assert.equal(JSON.stringify(f.client.state()).includes(MY_CLOUD), false);+ assert.deepEqual(cloudPlanSnapshot(f.client.state()).renewal, f.client.state().renewal);+ // Someone in a team Cloud they don't pay for, and an Admin that doesn't say: no renewal, so nothing to cancel.+ f.clouds = [renewingClouds(f)[0], { ...renewingClouds(f)[1], primary: false }];+ await f.client.refresh();+ assert.equal(f.client.state().renewal, undefined);+ f.clouds = undefined;+ await f.client.refresh();+ assert.equal(f.client.state().renewal, undefined);+ assert.deepEqual(await f.client.cancelPlan({ answer: "price" }), { outcome: "failed", state: f.client.state() });+ assert.deepEqual(posts(f), [], "nothing is asked without a Cloud the session names");+});++test("Cancel plan sends the survey first, then the session's own Cloud's cancel; the survey never blocks it, and Keep turns renewal back on", async t => {+ const f = await fixture(t);+ f.entitlement = { plan: "pro", tier: "pro", status: "active", expiresAt: f.now + 30 * DAY, version: 2 };+ f.clouds = renewingClouds(f);+ renewalAdmin(f);+ await f.connect();+ // The page names no Cloud: a cloudId it sends is never used, and each box is trimmed.+ const cancelled = await f.client.cancelPlan({ answer: "price", expected: " To sort my inbox. ", improve: "", cloudId: TEAM_CLOUD });+ assert.deepEqual(posts(f), [["feedback", { cloudId: MY_CLOUD, answer: "price", expected: "To sort my inbox." }, true], [`clouds/${MY_CLOUD}/cancel`, {}, true]]);+ assert.equal(cancelled.outcome, "cancelled");+ assert.deepEqual(cancelled.renewal, { trial: true, cancelled: true, renewsAt: null, endsAt: f.now + 5 * DAY, keptDays: 3 });+ assert.equal(cancelled.surveyed, true);+ assert.deepEqual(f.client.state().renewal, cancelled.renewal, "the session is read again");+ // Keep my plan: the same Cloud, nothing else sent.+ f.requests.length = 0;+ const kept = await f.client.keepPlan();+ assert.equal(kept.outcome, "kept");+ assert.deepEqual(posts(f), [[`clouds/${MY_CLOUD}/keep`, {}, true]]);+ assert.equal(f.client.state().renewal.cancelled, false);+ // Nothing said: only the cancel. Words without a reason: kept as "other". A refused or failed survey: the cancel goes ahead.+ for (const [survey, sent] of [[null, null], [{}, null], [{ answer: "keep" }, null], ["price", null], [{ improve: "Tell me sooner." }, { answer: "other", improve: "Tell me sooner." }]]) {+ f.requests.length = 0;+ assert.equal((await f.client.cancelPlan(survey)).outcome, "cancelled");+ assert.deepEqual(posts(f), [...sent ? [["feedback", { cloudId: MY_CLOUD, ...sent }, true]] : [], [`clouds/${MY_CLOUD}/cancel`, {}, true]]);+ await f.client.keepPlan();+ }+ for (const refusal of [{ status: 429, body: { error: "rate_limited", interval: 600 } }, { status: 500, body: { error: "unexpected" } }]) {+ f.feedback = refusal; f.requests.length = 0;+ const result = await f.client.cancelPlan({ answer: "setup" });+ assert.deepEqual([result.outcome, result.surveyed], ["cancelled", false]);+ assert.deepEqual(posts(f).map(([route]) => route), ["feedback", `clouds/${MY_CLOUD}/cancel`]);+ await f.client.keepPlan();+ }+});++test("an Admin without the app's Cancel and Keep opens the Cloud page's billing; a refusal changes nothing and reads the session again", async t => {+ const f = await fixture(t);+ f.entitlement = { plan: "pro", tier: "pro", status: "active", expiresAt: f.now + 30 * DAY, version: 2 };+ f.clouds = renewingClouds(f);+ await f.connect();+ f.browsers.length = 0;+ for (const status of [404, 405, 501]) {+ f.renewal = () => ({ status, body: { error: status === 404 ? "Not found." : "unsupported" } });+ assert.deepEqual(await f.client.cancelPlan({ answer: "later" }), { outcome: "browser" });+ assert.deepEqual(await f.client.keepPlan(), { outcome: "browser" });+ }+ assert.deepEqual(f.browsers, Array(6).fill(`${f.origin}/cloud/personal/billing`));+ // The route is there, but refuses: the Cloud isn't this account's (anymore), or there's no plan to change, or Dodo can't be reached.+ for (const [status, error] of [[404, "not_found"], [403, "forbidden"], [409, "not_renewable"], [502, "provider_error"], [429, "rate_limited"]]) {+ f.renewal = () => ({ status, body: { error, errorDescription: "Refused." } });+ const reads = f.requests.filter(request => request.route === "/api/cloud/desktop/session").length;+ const result = await f.client.cancelPlan(null);+ assert.equal(result.outcome, "failed", `${status} ${error}`);+ assert.equal(f.requests.filter(request => request.route === "/api/cloud/desktop/session").length, reads + ([404, 409].includes(status) ? 1 : 0));+ }+ assert.equal(f.browsers.length, 6, "only an Admin without the routes opens the browser");+});++test("the cancel survey as main sends it: one of the reasons, words trimmed and at most 2,000 characters each, never anything else", () => {+ assert.deepEqual(cancelSurvey({ answer: "broken", expected: " a ", improve: " b " }), { answer: "broken", expected: "a", improve: "b" });+ assert.deepEqual(cancelSurvey({ answer: null, expected: "only words" }), { answer: "other", expected: "only words" });+ assert.deepEqual(cancelSurvey({ answer: "later", expected: 7, improve: ["no"] }), { answer: "later" });+ for (const nothing of [null, undefined, "price", ["price"], {}, { answer: null, expected: " " }, { answer: "keep" }, { answer: "price", expected: "x".repeat(2_001) },+ { answer: "price", improve: "y".repeat(2_001) }]) assert.equal(cancelSurvey(nothing), null, JSON.stringify(nothing)?.slice(0, 60));+ assert.equal(cancelSurvey({ answer: "price", expected: "z".repeat(2_000) }).expected.length, 2_000);+});diff --git a/electron/cloud-list.d.mts b/electron/cloud-list.d.mtsindex c6135e5e13..dec3629710 100644--- a/electron/cloud-list.d.mts+++ b/electron/cloud-list.d.mts@@ -26,6 +26,14 @@ export interface CloudListEntry {/** The OpenMausBot version it runs, for an update reminder. */version?: string;}+/**+ * The account's own plan's renewal, as the Admin says it for the account that pays (display only): a free trial (`trial`), its+ * renewal off (`cancelled`), when it renews (`renewsAt`) or, once cancelled, ends (`endsAt`; null: the end of the period paid+ * for), how many days its files are kept once it stops (`keptDays`, parts of a day allowed; null: not known), and a Team Cloud's+ * name (`team`), which stops for everyone in it.+ */+export interface CloudRenewal { trial: boolean; cancelled: boolean; renewsAt: number | null; endsAt: number | null; keptDays: number | null; team?: string }+export declare function parseCloudRenewal(clouds: unknown): (CloudRenewal & { cloudId: string }) | null;export declare const MAX_CLOUDS: number;export declare const CLOUD_LIST_STATUSES: readonly CloudListStatus[];export declare const CLOUD_SWATCH_COLORS: Readonly<Record<CloudSwatch, import("./cloud-buy.mjs").CloudColor | null>>;diff --git a/electron/cloud-list.mjs b/electron/cloud-list.mjsindex 727076a8a3..6098092e19 100644--- a/electron/cloud-list.mjs+++ b/electron/cloud-list.mjs@@ -99,6 +99,24 @@ export function parseCloudList(input) {return clouds;}+/** OMB_CLOUD_STOPPED_HOLD_DAYS allows parts of a day, and at most 60. */+const keptDays = value => value === null ? null : typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= 60 ? value : undefined;+/**+ * The account's own plan's renewal, from the verified session's raw `clouds`: its primary Cloud, only while the Admin says+ * this account pays for it and its plan runs (`renewal`), so never a team's Cloud someone else pays for. Null without one,+ * or from an Admin that doesn't say yet. `cloudId` is for main: Cancel and Keep name the Cloud from here, never from a page.+ */+export function parseCloudRenewal(clouds) {+ if (!Array.isArray(clouds)) return null;+ const own = clouds.slice(0, MAX_CLOUDS).find(entry => record(entry) && entry.primary === true && record(entry.renewal));+ if (!own || typeof own.id !== "string" || !CLOUD_ID.test(own.id) || typeof own.renewal.trial !== "boolean") return null;+ const endsAt = own.renewal.endsAt === null ? null : Number.isSafeInteger(own.renewal.endsAt) && own.renewal.endsAt > 0 ? own.renewal.endsAt : undefined;+ const kept = keptDays(own.renewal.keptDays), team = typeof own.teamId === "string" ? cleanCloudListName(own.name) : null;+ if (endsAt === undefined || kept === undefined) return null;+ return { cloudId: own.id, trial: own.renewal.trial, cancelled: own.cancelAtPeriodEnd === true,+ renewsAt: Number.isSafeInteger(own.renewsAt) && own.renewsAt > 0 ? own.renewsAt : null, endsAt, keptDays: kept, ...(team ? { team } : {}) };+}+/** Every Cloud of the person's own besides the primary (My Cloud): each a place of its own, as a team's Cloud is. */export function otherOwnClouds(clouds) {return Array.isArray(clouds) ? clouds.filter(cloud => ownCloud(cloud) && !cloud.primary) : [];diff --git a/electron/cloud-list.node-test.mjs b/electron/cloud-list.node-test.mjsindex c65ce8389c..b722893c28 100644--- a/electron/cloud-list.node-test.mjs+++ b/electron/cloud-list.node-test.mjs@@ -1,7 +1,7 @@import assert from "node:assert/strict";import test from "node:test";-import { cloudMachine, cloudSetupProgress, listedColors, MAX_CLOUDS, olderRelease, otherOwnClouds, ownCloudPlaces, parseCloudList, releaseVersion, signedInServers, swatchColor } from "./cloud-list.mjs";+import { cloudMachine, cloudSetupProgress, listedColors, MAX_CLOUDS, olderRelease, otherOwnClouds, ownCloudPlaces, parseCloudList, parseCloudRenewal, releaseVersion, signedInServers, swatchColor } from "./cloud-list.mjs";import environments from "./environments.cjs";import { createHomePlaces } from "./home-places.mjs";@@ -152,3 +152,20 @@ test("a release older than the newest one, compared number by number; nothing isfor (const [a, b] of [["0.1.118-dev", "0.1.130"], ["0.1.118", null], [null, "0.1.130"], ["main", "0.1.130"], ["0.1.118", "latest"]]) assert.equal(olderRelease(a, b), false, `${a} ${b}`);assert.deepEqual(["0.1.130", null, "", "<b>", 7].map(releaseVersion), ["0.1.130", null, null, null, null]);});++test("the plan's renewal is the account's own primary Cloud's, only as the Admin says it; anything malformed is none", () => {+ const id = "3f1c2b4a-5d6e-4f70-8a9b-0c1d2e3f4a5b", own = { id, name: "My Cloud", role: "owner", teamId: null, primary: true, renewsAt: 1_900_000_000_000,+ cancelAtPeriodEnd: false, renewal: { trial: false, endsAt: null, keptDays: 1 } };+ const member = { id: "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d", name: "Acme", role: "member", teamId: "t", primary: false, renewsAt: null, cancelAtPeriodEnd: false };+ assert.deepEqual(parseCloudRenewal([member, own]), { cloudId: id, trial: false, cancelled: false, renewsAt: 1_900_000_000_000, endsAt: null, keptDays: 1 });+ assert.deepEqual(parseCloudRenewal([{ ...own, cancelAtPeriodEnd: true, renewsAt: null, renewal: { trial: true, endsAt: 1_900_000_000_000, keptDays: 0.5 } }]),+ { cloudId: id, trial: true, cancelled: true, renewsAt: null, endsAt: 1_900_000_000_000, keptDays: 0.5 });+ // A Team Cloud the account pays for names its team, which stops with it.+ assert.equal(parseCloudRenewal([{ ...own, name: " Acme Studio ", teamId: "t" }]).team, "Acme Studio");+ assert.equal(parseCloudRenewal([{ ...own, renewal: { ...own.renewal, keptDays: null } }]).keptDays, null);+ for (const clouds of [undefined, null, "clouds", {}, [], [member], [{ ...own, primary: false }], [{ ...own, renewal: undefined }], [{ ...own, renewal: null }],+ [{ ...own, id: "../not-a-cloud" }], [{ ...own, id: 7 }], [{ ...own, renewal: { ...own.renewal, trial: "yes" } }], [{ ...own, renewal: { ...own.renewal, endsAt: -1 } }],+ [{ ...own, renewal: { ...own.renewal, keptDays: 61 } }], [{ ...own, renewal: { ...own.renewal, keptDays: "1" } }]]) {+ assert.equal(parseCloudRenewal(clouds), null, JSON.stringify(clouds)?.slice(0, 80));+ }+});diff --git a/electron/cloud-plan-ipc.mjs b/electron/cloud-plan-ipc.mjsindex 8ada665e46..2b10f839c6 100644--- a/electron/cloud-plan-ipc.mjs+++ b/electron/cloud-plan-ipc.mjs@@ -27,4 +27,7 @@ export function installCloudPlanIpc({ ipcMain, pageSender, account, client, noti};ipcMain.handle("cloud-plan:upgrade-preview", (event, plan, source) => pageSender("cloud-plan:upgrade-preview", () => client().upgradePreview(...upgradeArgs(plan, source)))(event));ipcMain.handle("cloud-plan:upgrade", (event, plan, source) => pageSender("cloud-plan:upgrade", () => client().upgrade(...upgradeArgs(plan, source)))(event));+ // Cancel trial / Cancel plan and Keep my plan: the page's survey is checked in main, and the Cloud is the session's own.+ ipcMain.handle("cloud-plan:cancel", (event, survey) => pageSender("cloud-plan:cancel", () => client().cancelPlan(survey))(event));+ ipcMain.handle("cloud-plan:keep", pageSender("cloud-plan:keep", () => client().keepPlan()));}diff --git a/electron/home-window.node-test.mjs b/electron/home-window.node-test.mjsindex da7e5715ca..93d45d5aec 100644--- a/electron/home-window.node-test.mjs+++ b/electron/home-window.node-test.mjs@@ -506,7 +506,9 @@ function pageIpc(overrides = {}) {cloudTrialNotices: () => ({ due: () => null, seen: (...args) => { calls.push(["notice-seen", ...args]); } }),ensureCloudAccount: () => ({ openDashboard: async () => { calls.push(["dashboard"]); return account; }, state: () => account,upgradePreview: async (...args) => { calls.push(["upgrade-preview", ...args]); return { outcome: "failed" }; },- upgrade: async (...args) => { calls.push(["upgrade", ...args]); return { outcome: "failed" }; } }),+ upgrade: async (...args) => { calls.push(["upgrade", ...args]); return { outcome: "failed" }; },+ cancelPlan: async (...args) => { calls.push(["cancel", ...args]); return { outcome: "failed" }; },+ keepPlan: async (...args) => { calls.push(["keep", ...args]); return { outcome: "failed" }; } }),homeWindow: { homePage: () => false },...overrides,});@@ -525,14 +527,14 @@ test("no page gets a control over lending this computer: not My Cloud's, anothertest("Settings on the person's own Cloud shows the plan read only, says when it is home, and can open the Plan page or sign in again; never switch away", async () => {const page = preload(CLOUD);- assert.deepEqual(Object.keys(page.bridge.cloudPlan), ["state", "manage", "signIn", "noticeSeen", "upgradePreview", "upgrade"]);+ assert.deepEqual(Object.keys(page.bridge.cloudPlan), ["state", "manage", "signIn", "noticeSeen", "upgradePreview", "upgrade", "cancel", "keep"]);assert.equal(page.bridge.cloudAccount, undefined, "no account, credential or address reaches the Cloud's page");await page.bridge.cloudPlan.state({ origin: "https://evil.example.test" });await assert.rejects(page.bridge.cloudPlan.manage(), /Choose Manage/);const ipc = pageIpc();const event = { sender: ipc.cloudContents, senderFrame: ipc.cloudFrame };assert.deepEqual(Object.keys(Object.fromEntries(ipc.handlers)), ["cloud-plan:state", "cloud-plan:notice-seen", "cloud-plan:manage",- "cloud-plan:upgrade-preview", "cloud-plan:upgrade"]);+ "cloud-plan:upgrade-preview", "cloud-plan:upgrade", "cloud-plan:cancel", "cloud-plan:keep"]);assert.deepEqual(plain(await ipc.handlers.get("cloud-plan:state")(event, { tier: "personal" })), { status: "paid", tier: "max" });ipc.context.homeWindow = { homePage: (asked) => asked === event };assert.deepEqual(plain(await ipc.handlers.get("cloud-plan:state")(event)), { status: "paid", tier: "max", home: true });@@ -804,6 +806,32 @@ test("the usage meter's Upgrade: only from the person's click, only to a plan thassert.equal(ipc.calls.length, 2);});+test("Cancel and Keep my plan on the Cloud's own page: only from the person's click there, the survey's words only, and the plan's renewal shown read only", async () => {+ const page = preload(CLOUD);+ await assert.rejects(page.bridge.cloudPlan.cancel({ answer: "price" }), /Choose Cancel/, "the Cloud's page cancels only from the person's click");+ await assert.rejects(page.bridge.cloudPlan.keep(), /Choose Keep my plan/);+ const clicked = preload(CLOUD, { activation: true });+ await clicked.bridge.cloudPlan.cancel({ answer: "price", improve: "words" }, { cloudId: "someone-elses" });+ await clicked.bridge.cloudPlan.cancel();+ await clicked.bridge.cloudPlan.keep({ cloudId: "someone-elses" });+ assert.deepEqual(clicked.invoked, [["cloud-plan:cancel", { answer: "price", improve: "words" }], ["cloud-plan:cancel", null], ["cloud-plan:keep"]]);+ const local = preload(LOCAL);+ await local.bridge.cloudPlan.cancel({ answer: "later" });+ await local.bridge.cloudPlan.keep();+ assert.deepEqual(local.invoked, [["cloud-plan:cancel", { answer: "later" }], ["cloud-plan:keep"]]);+ const ipc = pageIpc();+ const event = { sender: ipc.cloudContents, senderFrame: ipc.cloudFrame };+ ipc.account.renewal = { trial: true, cancelled: false, renewsAt: 1_900_000_000_000, endsAt: null, keptDays: 3 };+ assert.deepEqual(plain(await ipc.handlers.get("cloud-plan:state")(event)).renewal, ipc.account.renewal);+ await ipc.handlers.get("cloud-plan:cancel")(event, { answer: "setup" }, "https://evil.example.test");+ await ipc.handlers.get("cloud-plan:keep")(event, { cloudId: "someone-elses" });+ assert.deepEqual(ipc.calls, [["cancel", { answer: "setup" }], ["keep"]]);+ for (const sender of [{ sender: ipc.cloudContents, senderFrame: { url: "https://other.example.test/" } }, { sender: {}, senderFrame: ipc.cloudFrame }]) {+ for (const channel of ["cloud-plan:cancel", "cloud-plan:keep"]) assert.throws(() => ipc.handlers.get(channel)(sender, { answer: "price" }), /only available/);+ }+ assert.equal(ipc.calls.length, 2);+});+test("another Cloud of the person's own is the place asked for by its id, from the session's list; one it no longer lists is simply My Cloud again", () => {const state = { ...connected(), clouds: [{ ...CLIENT_A, id: "c-home", name: "My Cloud", origin: CLOUD, primary: true }, CLIENT_A] };assert.deepEqual(placeOf({ ask: { cloud: "c-a" }, state }), { kind: "own", id: "c-a", name: "Client A", role: "owner", origin: CLIENT, machine: { status: "ready", origin: CLIENT } });diff --git a/electron/main.mjs b/electron/main.mjsindex 6ac8d7ea93..1ec7806fcc 100644--- a/electron/main.mjs+++ b/electron/main.mjs@@ -2574,6 +2574,9 @@ ipcMain.handle("cloud-account:openTeam", localWorkspaceOnly("cloud-account:openTif (!team) throw new Error("You're not in that team.");await showHome({ place: { team: team.id, name: team.name } });}));+// Cancel trial / Cancel plan and Keep my plan: the page sends the survey's words only; the Cloud is the verified session's own.+ipcMain.handle("cloud-account:cancelPlan", localWorkspaceOnly("cloud-account:cancelPlan", (_event, survey) => ensureCloudAccount().cancelPlan(survey)));+ipcMain.handle("cloud-account:keepPlan", localWorkspaceOnly("cloud-account:keepPlan", () => ensureCloudAccount().keepPlan()));ipcMain.handle("organization:settings-opened", localWorkspaceOnly("organization:settings-opened", () => organizationEntry.settingsOpened()));ipcMain.handle("organization:state", localWorkspaceOnly("organization:state", () => ensureManagedDesktop().state()));ipcMain.handle("organization:begin", localWorkspaceOnly("organization:begin", (_event, input) => ensureManagedDesktop().begin(input)));diff --git a/electron/preload.cjs b/electron/preload.cjsindex ff77fa9a6f..9a3f493ca7 100644--- a/electron/preload.cjs+++ b/electron/preload.cjs@@ -392,6 +392,9 @@ const bridge = {connectHome: () => ipcRenderer.invoke("cloud-account:connectHome"),connectHomeForPhone: () => ipcRenderer.invoke("cloud-account:connectHomeForPhone"),openTeam: teamId => ipcRenderer.invoke("cloud-account:openTeam", String(teamId)),+ // Cancel trial / Cancel plan and Keep my plan: the survey's words only; main names the Cloud from the verified session.+ cancelPlan: survey => ipcRenderer.invoke("cloud-account:cancelPlan", survey ?? null),+ keepPlan: () => ipcRenderer.invoke("cloud-account:keepPlan"),onState: cb => {const handler = (_event, state) => cb(state);ipcRenderer.on("cloud-account:state-changed", handler);@@ -450,6 +453,11 @@ const bridge = {? ipcRenderer.invoke("cloud-plan:upgrade-preview", String(plan), String(source)) : Promise.reject(new Error("Choose Upgrade to see the price.")),upgrade: (plan, source) => navigator.userActivation?.isActive === true? ipcRenderer.invoke("cloud-plan:upgrade", String(plan), String(source)) : Promise.reject(new Error("Choose Upgrade to change your plan.")),+ // Cancel trial / Cancel plan and Keep my plan: only from the person's click; the survey's words only, main names the Cloud.+ cancel: survey => isLocalPage || navigator.userActivation?.isActive === true+ ? ipcRenderer.invoke("cloud-plan:cancel", survey ?? null) : Promise.reject(new Error("Choose Cancel to cancel your plan.")),+ keep: () => isLocalPage || navigator.userActivation?.isActive === true+ ? ipcRenderer.invoke("cloud-plan:keep") : Promise.reject(new Error("Choose Keep my plan to keep it.")),} : undefined,organization: process.argv.includes("--omb-company-desktop=1") ? {settingsOpened: () => ipcRenderer.invoke("organization:settings-opened"),diff --git a/src/cancel-plan-preview.tsx b/src/cancel-plan-preview.tsxnew file mode 100644index 0000000000..3c74de90c6--- /dev/null+++ b/src/cancel-plan-preview.tsx@@ -0,0 +1,53 @@+// Dev-only gallery of Cancel trial / Cancel plan, served at /cancel-plan-preview.html; not in the packaged app.+// ?view=settings|cloud&plan=trial|paid|team&cancelled=1&admin=old&skin=midnight|daylight&lang=de+import { StrictMode } from "react";+import { createRoot } from "react-dom/client";+import type { CloudAccountBridge, CloudAccountState, CloudPlanBridge, CloudPlanSnapshot, CloudRenewalResult } from "../electron/cloud-account.mjs";+import type { CloudRenewal } from "../electron/cloud-list.mjs";+import { CloudAccountSettings, CloudPlanOnCloud } from "@/components/CloudAccountSettings";+import { setLocale } from "@/lib/i18n";+import { SKIN_IDS, type SkinId } from "@/lib/skins";+import "./styles.css";++const DAY = 86_400_000, ENDS = Date.UTC(2026, 10, 4, 12);+const params = new URLSearchParams(location.search);+const kind = params.get("plan") === "paid" ? "paid" : params.get("plan") === "team" ? "team" : "trial";+let renewal: CloudRenewal = { trial: kind === "trial", cancelled: false, renewsAt: ENDS, endsAt: null, keptDays: kind === "trial" ? 3 : 1, ...(kind === "team" ? { team: "Acme" } : {}) };+if (params.get("cancelled") === "1") renewal = { ...renewal, cancelled: true, renewsAt: null, endsAt: ENDS };+const state = (): CloudAccountState => ({ status: "connected", account: { id: "preview", email: "[email protected]" },+ entitlement: { plan: "pro", tier: kind === "team" ? "team" : "pro", status: "active", expiresAt: ENDS + 30 * DAY, version: 1 }, verifiedAt: Date.now(), verifiedUntil: Date.now() + DAY,+ ...(kind === "trial" ? { trial: { state: renewal.cancelled ? "ending" : "active", tier: "pro", endsAt: ENDS, amount: 4900, chargeAt: ENDS, holdUntil: null, deleteAt: renewal.cancelled ? ENDS + 3 * DAY : null,+ keep: renewal.cancelled ? "portal" : "none" } } : {}), renewal });+const listeners = new Set<(next: CloudAccountState) => void>();+const settle = (next: CloudRenewal) => { renewal = next; listeners.forEach(listener => listener(state())); };+const wait = () => new Promise(resolve => setTimeout(resolve, 400));+/** As main answers: the Admin turns renewal off or on; an older Admin (`admin=old`) opens the Cloud page's billing instead. */+const cancel = async (): Promise<CloudRenewalResult> => {+ await wait();+ if (params.get("admin") === "old") return { outcome: "browser" };+ const next = { ...renewal, cancelled: true, renewsAt: null, endsAt: ENDS };+ settle(next);+ return { outcome: "cancelled", renewal: next, surveyed: true, state: state() };+};+const keep = async (): Promise<CloudRenewalResult> => { await wait(); settle({ ...renewal, cancelled: false, renewsAt: ENDS, endsAt: null }); return { outcome: "kept", state: state() }; };+const account = { state: async () => state(), begin: async () => state(), signInAgain: async () => state(), reopen: async () => state(), cancel: async () => state(),+ refresh: async () => state(), signOut: async () => state(), openDashboard: async () => state(), connectHome: async () => state(), connectHomeForPhone: async () => state(),+ onState: (listener: (next: CloudAccountState) => void) => { listeners.add(listener); return () => { listeners.delete(listener); }; }, cancelPlan: cancel, keepPlan: keep } satisfies CloudAccountBridge;+const plan = { state: async (): Promise<CloudPlanSnapshot> => ({ status: "paid", tier: "pro", home: true, ...(kind === "trial" ? { trial: state().trial } : {}), renewal }),+ manage: async () => undefined, cancel, keep } satisfies CloudPlanBridge;++function Preview() {+ const skin = (SKIN_IDS as readonly string[]).includes(params.get("skin") ?? "") ? params.get("skin") as SkinId : "midnight";+ document.documentElement.dataset.skin = skin;+ setLocale(params.get("lang") ?? "en");+ const cloudPage = params.get("view") === "cloud";+ return <div className="flex min-h-screen justify-center bg-app p-6 text-ink sm:p-10">+ <div className="flex w-full max-w-[680px] flex-col gap-4">+ <h1 className="text-[20px] font-semibold">{cloudPage ? "Settings · on the Cloud" : "Settings · Usage & billing"}</h1>+ {cloudPage ? <CloudPlanOnCloud bridge={plan} /> : <CloudAccountSettings />}+ </div>+ </div>;+}++window.ogb = { ...window.ogb, cloudAccount: account } as typeof window.ogb;+createRoot(document.getElementById("root")!).render(<StrictMode><Preview /></StrictMode>);diff --git a/src/components/CloudAccountSettings.tsx b/src/components/CloudAccountSettings.tsxindex 49fb23b17b..8fe0b07b71 100644--- a/src/components/CloudAccountSettings.tsx+++ b/src/components/CloudAccountSettings.tsx@@ -9,6 +9,7 @@ import { buyOfferAllowed, cloudCreditLine, cloudPlanLabel, cloudPlanLine, cloudPimport { useCloudOffer } from "@/lib/use-cloud-offer";import type { LocaleKey } from "@/locales";import { Card } from "./SettingsPrimitives";+import { CloudCancelPlan, type CloudRenewalActions } from "./CloudCancelPlan";import { StagingMark } from "./cloud-buy/parts";import { CloudKeepHere } from "./CloudKeepHere";import { CloudSetupSteps } from "./CloudSetupSteps";@@ -122,7 +123,7 @@ function accountMessage(account: CloudAccountState | null, view: CloudPlanView,}function dashboardLabel(account: CloudAccountState, view: CloudPlanView): string {- const trial = account.trial ? cloudTrialView(account.trial).action : null;+ const trial = account.trial && !account.renewal?.cancelled ? cloudTrialView(account.trial).action : null;if (trial) return trial.label;if (view.kind === "paid" || (view.kind === "unverified" && view.label)) return t("cloudAccount.manage");if (account.machine?.status === "payment-problem") return t("cloudAccount.updatePayment");@@ -131,11 +132,13 @@ function dashboardLabel(account: CloudAccountState, view: CloudPlanView): stringexport function CloudPlanOnCloud({ bridge, onConnectPhone }: { bridge: CloudPlanBridge; onConnectPhone?: () => void }) {const [plan, setPlan] = useState<CloudPlanSnapshot | null>(null), [failed, setFailed] = useState(false), [refused, setRefused] = useState(false);+ const [reads, setReads] = useState(0);useEffect(() => {let active = true;void bridge.state().then(next => { if (active) setPlan(next); }).catch(() => { if (active) setRefused(true); });return () => { active = false; };- }, [bridge]);+ }, [bridge, reads]);+ const renewal: CloudRenewalActions | null = bridge.cancel && bridge.keep ? { cancel: survey => bridge.cancel!(survey), keep: () => bridge.keep!() } : null;if (refused) {return <Card title={t("settings.section.cloudAccount")}><p data-cloud-plan="elsewhere" className="text-[13px] text-ink-secondary">{t("cloudAccount.onCloudNone")}</p>@@ -154,9 +157,10 @@ export function CloudPlanOnCloud({ bridge, onConnectPhone }: { bridge: CloudPlan{trialLines(plan?.trial, plan?.credit)}<div className="flex flex-wrap gap-2">{plan?.status === "signin" && bridge.signIn && <button type="button" className="ui-button ui-button-primary" onClick={() => act(() => bridge.signIn!())}>{t("cloudAccount.signInAgain")}</button>}- <button type="button" className="ui-button" onClick={() => act(() => bridge.manage())}>{(plan?.trial && cloudTrialView(plan.trial).action?.label) || t("cloudAccount.manageInBrowser")}</button>+ <button type="button" className="ui-button" onClick={() => act(() => bridge.manage())}>{(plan?.trial && !plan.renewal?.cancelled && cloudTrialView(plan.trial).action?.label) || t("cloudAccount.manageInBrowser")}</button>{plan && onConnectPhone && <button type="button" className="ui-button" onClick={onConnectPhone}>{t("cloudPhone.action")}</button>}</div>+ {plan?.renewal && <CloudCancelPlan renewal={plan.renewal} actions={renewal} onChanged={() => setReads(count => count + 1)} />}{failed && <p role="alert" className="text-[13px] text-danger">{t("cloudAccount.actionFailed")}</p>}</div></Card>;@@ -241,6 +245,7 @@ export function CloudAccountSettings({ linkRequest = 0, cloudHome = false, teamHconst move = moveNotice?.move ? moveLine(moveNotice.move, "local") : null;const moving = move && move.kind !== "done" ? move.text : null;const offer = useCloudOffer(Boolean(account) && buyOfferAllowed(cloudPlanView(account)), account?.offer);+ const renewal: CloudRenewalActions | null = bridge?.cancelPlan && bridge.keepPlan ? { cancel: survey => bridge.cancelPlan!(survey), keep: () => bridge.keepPlan!() } : null;if (!bridge) {const plan = window.ogb?.remoteClient?.active || !cloudHome ? undefined : window.ogb?.cloudPlan;return <>@@ -298,6 +303,7 @@ export function CloudAccountSettings({ linkRequest = 0, cloudHome = false, teamH</>}{!confirm && <button type="button" disabled={busy} className="ui-button" onClick={() => setConfirm(true)}>{t("cloudAccount.signOut")}</button>}</div>+ {account.status === "connected" && account.renewal && <CloudCancelPlan renewal={account.renewal} actions={renewal} />}{view.kind === "free" && !confirm && <p className="text-[12px] text-ink-secondary">{t("cloudAccount.otherEmail")}{" "}<button type="button" disabled={busy} className="underline hover:text-ink" onClick={() => setConfirm(true)}>{t("cloudAccount.useOtherEmail")}</button></p>}{confirm && <div role="group" aria-label={t("cloudAccount.signoutTitle")} className="rounded-lg border border-hairline/40 p-3">diff --git a/src/components/CloudCancelPlan.dom.test.ts b/src/components/CloudCancelPlan.dom.test.tsnew file mode 100644index 0000000000..0fc4569699--- /dev/null+++ b/src/components/CloudCancelPlan.dom.test.ts@@ -0,0 +1,227 @@+// @vitest-environment happy-dom+import { createElement, type ReactElement } from "react";+import { act } from "react";+import { createRoot, type Root } from "react-dom/client";+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";+import type { CloudAccountBridge, CloudAccountState, CloudPlanBridge, CloudRenewalResult } from "../../electron/cloud-account.mjs";+import type { CloudRenewal } from "../../electron/cloud-list.mjs";+import { setLocale } from "@/lib/i18n";++vi.mock("./DesktopCapabilities", () => ({ useDesktopCapabilities: () => ({ capabilities: { host: { platform: "darwin" } }, ready: true }) }));+vi.mock("@/state/store", async original => ({ ...await original<typeof import("@/state/store")>(), useStore: () => ({ state: { bots: [], config: {} }, dispatch: vi.fn() }) }));+import { CLOUD_CALL_URL, CloudCancelPlan, type CloudRenewalActions } from "./CloudCancelPlan";+import { CloudAccountSettings, CloudPlanOnCloud } from "./CloudAccountSettings";++const NOW = Date.UTC(2026, 9, 28, 12), DAY = 86_400_000, END = NOW + 5 * DAY;+const day = (value: number) => new Intl.DateTimeFormat("en", { dateStyle: "medium" }).format(new Date(value));+const trial: CloudRenewal = { trial: true, cancelled: false, renewsAt: END, endsAt: null, keptDays: 3 };+const cancelledTrial: CloudRenewal = { ...trial, cancelled: true, renewsAt: null, endsAt: END };+let container: HTMLDivElement, root: Root;+beforeEach(() => {+ vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT", true);+ setLocale("en");+ container = document.createElement("div"); document.body.append(container); root = createRoot(container);+});+afterEach(async () => { await act(async () => root.unmount()); container.remove(); document.body.innerHTML = ""; vi.unstubAllGlobals(); vi.restoreAllMocks(); });++const settle = async () => { for (let i = 0; i < 4; i++) await act(async () => { await new Promise(resolve => setTimeout(resolve, 0)); }); };+const show = async (element: ReactElement) => { await act(async () => { root.render(element); }); await settle(); };+const sheet = () => document.querySelector<HTMLElement>("[role='dialog']");+const text = () => document.body.textContent ?? "";+const button = (label: string, within: ParentNode = document.body) => [...within.querySelectorAll("button")].find(item => item.textContent === label || item.getAttribute("aria-label") === label);+const click = async (target: Element | null | undefined) => { expect(target).toBeTruthy(); await act(async () => { (target as HTMLElement).click(); }); await settle(); };+const write = async (label: string, value: string) => {+ const box = [...document.querySelectorAll("label")].find(item => item.textContent?.startsWith(label))!.querySelector("textarea")!;+ await act(async () => { Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")!.set!.call(box, value); box.dispatchEvent(new Event("input", { bubbles: true })); });+};+const chips = () => [...sheet()!.querySelectorAll<HTMLButtonElement>("button[aria-pressed]")].map(chip => [chip.textContent, chip.getAttribute("aria-pressed")]);+/** What main answers: a cancel that turns renewal off (when it ends from the Admin), a keep, or as told. */+function actionsFor(results: Partial<{ cancel: CloudRenewalResult; keep: CloudRenewalResult }> = {}) {+ const state = { status: "connected" } as CloudAccountState;+ return {+ cancel: vi.fn(async () => results.cancel ?? { outcome: "cancelled" as const, renewal: cancelledTrial, surveyed: true, state }),+ keep: vi.fn(async () => results.keep ?? { outcome: "kept" as const, state }),+ } satisfies CloudRenewalActions;+}++describe("the cancel sheet", () => {+ it("Cancel trial opens a calm sheet; the reason and both boxes go to main, then when it ends, that nothing is charged, how long its files stay, and Keep my plan", async () => {+ const actions = actionsFor(), changed = vi.fn();+ await show(createElement(CloudCancelPlan, { renewal: trial, actions, onChanged: changed }));+ expect(button("Cancel plan")).toBeUndefined();+ await click(button("Cancel trial"));+ expect(sheet()!.getAttribute("aria-modal")).toBe("true");+ expect(sheet()!.querySelector("h2")?.textContent).toBe("Cancel your trial");+ expect(text()).toContain(`Your trial runs until ${day(END)}. Cancel now and nothing is charged.`);+ expect(sheet()!.querySelector("legend")?.textContent).toBe("Before you go: what's the main reason?");+ expect(chips()).toEqual([["Missing a feature", "false"], ["Too expensive", "false"], ["Hard to set up", "false"], ["Didn't work as I expected", "false"],+ ["Not using it right now", "false"], ["Something else", "false"]]);+ expect(document.activeElement?.textContent).toBe("Missing a feature");+ expect([...sheet()!.querySelectorAll("label")].map(label => label.textContent)).toEqual(["What did you expect MausBot to do? (optional)", "What could we have done better? (optional)"]);+ const call = sheet()!.querySelector<HTMLAnchorElement>(`a[href="${CLOUD_CALL_URL}"]`)!;+ expect([call.textContent, call.getAttribute("target"), call.parentElement!.textContent]).toEqual(["Book 30 minutes with Milind", "_blank", "Rather talk it through? Book 30 minutes with Milind"]);+ // One tap picks a reason; the same tap again lets it go.+ await click(button("Too expensive"));+ await click(button("Too expensive"));+ await click(button("Hard to set up"));+ expect(chips().filter(([, pressed]) => pressed === "true")).toEqual([["Hard to set up", "true"]]);+ await write("What did you expect", "To answer my email by itself.");+ await click(button("Cancel my trial"));+ expect(actions.cancel).toHaveBeenCalledExactlyOnceWith({ answer: "setup", expected: "To answer my email by itself." });+ expect(sheet()!.querySelector("[role='status']")?.textContent).toBe(`Cancelled. Your trial ends on ${day(END)}, and nothing is charged.`);+ expect(text()).toContain("The Cloud stops then. Its files are kept 3 days, then deleted.");+ expect(text()).toContain("Thanks. Milind and Omkar read every answer, and we'll write back if it's something we can build.");+ expect(changed).not.toHaveBeenCalled();+ // Changed your mind? Keep my plan: renewal back on, the sheet closes and the plan is read again.+ expect(text()).toContain("Changed your mind?");+ await click(button("Keep my plan", sheet()!));+ expect(actions.keep).toHaveBeenCalledOnce();+ expect(sheet()).toBeNull();+ expect(changed).toHaveBeenCalledOnce();+ });++ it("cancelling never needs an answer: nothing said sends no survey; words without a reason go as they are; a failure says so and can be tried again", async () => {+ const actions = actionsFor();+ await show(createElement(CloudCancelPlan, { renewal: trial, actions }));+ await click(button("Cancel trial"));+ await click(button("Cancel my trial"));+ expect(actions.cancel).toHaveBeenLastCalledWith(null);+ await click(button("Done"));+ await click(button("Cancel trial"));+ await write("What could we have done better", "Tell me sooner what it needs.");+ await click(button("Cancel my trial"));+ expect(actions.cancel).toHaveBeenLastCalledWith({ answer: null, improve: "Tell me sooner what it needs." });+ await click(button("Done"));+ const failing = actionsFor({ cancel: { outcome: "failed", state: { status: "connected" } } });+ await show(createElement(CloudCancelPlan, { renewal: trial, actions: failing }));+ await click(button("Cancel trial"));+ await click(button("Not using it right now"));+ await click(button("Cancel my trial"));+ expect(sheet()!.querySelector("[role='alert']")?.textContent).toBe("That didn't go through, and nothing changed. Try again in a minute.");+ expect(sheet()!.getAttribute("data-cloud-cancel-sheet")).toBe("ask");+ expect(chips().find(([label]) => label === "Not using it right now")?.[1]).toBe("true");+ failing.cancel.mockRejectedValueOnce(new Error("main went away"));+ await click(button("Cancel my trial"));+ expect(sheet()!.querySelector("[role='alert']")).toBeTruthy();+ expect(failing.cancel).toHaveBeenCalledTimes(2);+ });++ it("Keep my plan before cancelling only closes the sheet; an Admin without Cancel says the Cloud page's Billing opened", async () => {+ const actions = actionsFor({ cancel: { outcome: "browser" } }), changed = vi.fn();+ await show(createElement(CloudCancelPlan, { renewal: trial, actions, onChanged: changed }));+ await click(button("Cancel trial"));+ await click(button("Keep my plan", sheet()!));+ expect([sheet(), actions.cancel.mock.calls.length, actions.keep.mock.calls.length, changed.mock.calls.length]).toEqual([null, 0, 0, 0]);+ await click(button("Cancel trial"));+ await click(button("Cancel my trial"));+ expect(sheet()!.querySelector("[role='status']")?.textContent).toBe("The Cloud page's Billing opened in your browser. You can do it there.");+ await click(button("Done"));+ expect([sheet(), changed.mock.calls.length]).toEqual([null, 0]);+ });++ it("a paid plan says Cancel plan and that nothing more is charged; a team's Cloud stops for everyone in it; files kept in days, a day, hours, or not at all", async () => {+ const paid: CloudRenewal = { trial: false, cancelled: false, renewsAt: END, endsAt: null, keptDays: 1, team: "Acme" };+ const actions = actionsFor({ cancel: { outcome: "cancelled", renewal: { ...paid, cancelled: true, renewsAt: null, endsAt: END }, surveyed: false, state: { status: "connected" } } });+ await show(createElement(CloudCancelPlan, { renewal: paid, actions }));+ expect(button("Cancel trial")).toBeUndefined();+ await click(button("Cancel plan"));+ expect(sheet()!.querySelector("h2")?.textContent).toBe("Cancel your plan");+ expect(text()).toContain(`Your plan runs until ${day(END)}. Cancel now and you won't be charged again. Acme's Cloud stops then, for everyone in the team.`);+ await click(button("Cancel my plan"));+ expect(sheet()!.querySelector("[role='status']")?.textContent).toBe(`Cancelled. Your plan ends on ${day(END)}. You won't be charged again.`);+ expect(text()).toContain("Acme's Cloud stops then, for everyone in the team. Its files are kept 1 day, then deleted.");+ expect(text()).not.toContain("Thanks.");+ const { stopsLine, endedLine } = await import("./CloudCancelPlan");+ expect(stopsLine({ ...paid, team: undefined, keptDays: 0.5 })).toBe("The Cloud stops then. Its files are kept 12 hours, then deleted.");+ expect(stopsLine({ ...paid, team: undefined, keptDays: 0 })).toBe("The Cloud stops then. Its files are deleted when it stops.");+ expect(stopsLine({ ...paid, team: undefined, keptDays: null })).toBe("The Cloud stops then.");+ expect(endedLine({ ...paid, cancelled: true, renewsAt: null, endsAt: null })).toBe("Cancelled. Your plan ends with the period you paid for. You won't be charged again.");+ });++ it("already cancelled: when it ends and Keep my plan, never Cancel; nothing at all without a renewal (someone else pays) or a way to change it", async () => {+ const actions = actionsFor(), changed = vi.fn();+ await show(createElement(CloudCancelPlan, { renewal: cancelledTrial, actions, onChanged: changed }));+ expect(container.querySelector("[data-cloud-cancel]")?.getAttribute("data-cloud-cancel")).toBe("cancelled");+ expect(container.querySelector("[role='status']")?.textContent).toBe(`Cancelled. Your trial ends on ${day(END)}, and nothing is charged.`);+ expect(button("Cancel trial")).toBeUndefined();+ await click(button("Keep my plan"));+ expect([actions.keep.mock.calls.length, changed.mock.calls.length]).toEqual([1, 1]);+ actions.keep.mockResolvedValueOnce({ outcome: "browser" });+ await click(button("Keep my plan"));+ expect(container.textContent).toContain("The Cloud page's Billing opened in your browser.");+ await show(createElement(CloudCancelPlan, { renewal: undefined, actions }));+ expect(container.innerHTML).toBe("");+ await show(createElement(CloudCancelPlan, { renewal: trial, actions: null }));+ expect(container.innerHTML).toBe("");+ });++ it("keeps its sheet open while main's state changes underneath (the plan cancelled), and Escape closes it", async () => {+ const actions = actionsFor();+ await show(createElement(CloudCancelPlan, { renewal: trial, actions }));+ await click(button("Cancel trial"));+ await click(button("Cancel my trial"));+ await show(createElement(CloudCancelPlan, { renewal: cancelledTrial, actions }));+ expect(sheet()!.getAttribute("data-cloud-cancel-sheet")).toBe("done");+ await act(async () => { sheet()!.dispatchEvent(new KeyboardEvent("keydown", { key: "Escape", bubbles: true })); });+ await settle();+ expect(sheet()).toBeNull();+ });+});++describe("the plan cards", () => {+ const paidState = (renewal?: CloudRenewal): CloudAccountState => ({ status: "connected", account: { id: "a", email: "[email protected]" },+ entitlement: { plan: "pro", tier: "pro", status: "active", expiresAt: NOW + 30 * DAY, version: 2 }, verifiedAt: NOW, verifiedUntil: NOW + DAY, ...(renewal ? { renewal } : {}) });+ function accountBridge(state: CloudAccountState): CloudAccountBridge {+ return { state: vi.fn(async () => state), begin: vi.fn(), signInAgain: vi.fn(), reopen: vi.fn(), cancel: vi.fn(), refresh: vi.fn(async () => state), signOut: vi.fn(),+ openDashboard: vi.fn(async () => state), connectHome: vi.fn(), connectHomeForPhone: vi.fn(), onState: vi.fn(() => () => {}),+ cancelPlan: vi.fn(async () => ({ outcome: "browser" as const })), keepPlan: vi.fn(async () => ({ outcome: "kept" as const, state })) } as unknown as CloudAccountBridge;+ }++ it("this computer's Settings: Cancel trial for the account that pays, through main's own bridge; nothing for anyone else", async () => {+ const bridge = accountBridge(paidState(trial));+ vi.stubGlobal("window", Object.assign(window, { ogb: { cloudAccount: bridge } }));+ await show(createElement(CloudAccountSettings));+ expect(text()).toContain("Pro active · verified by MausBot Cloud");+ expect(button("Manage Cloud subscription")).toBeTruthy();+ await click(button("Cancel trial"));+ await click(button("Missing a feature"));+ await click(button("Cancel my trial"));+ expect(bridge.cancelPlan).toHaveBeenCalledExactlyOnceWith({ answer: "feature" });+ expect(text()).toContain("The Cloud page's Billing opened in your browser.");+ await act(async () => root.unmount()); root = createRoot(container);+ vi.stubGlobal("window", Object.assign(window, { ogb: { cloudAccount: accountBridge(paidState()) } }));+ await show(createElement(CloudAccountSettings));+ expect(text()).toContain("Pro active · verified by MausBot Cloud");+ expect(button("Cancel trial")).toBeUndefined();+ expect(button("Cancel plan")).toBeUndefined();+ // Cancelled during the trial: Keep my plan is the way back, so the trial's own button doesn't offer a second one.+ const ending = { ...paidState(cancelledTrial), trial: { state: "ending" as const, tier: "pro", endsAt: END, amount: 4900, chargeAt: null, holdUntil: null, deleteAt: END + 3 * DAY, keep: "portal" as const } };+ await act(async () => root.unmount()); root = createRoot(container);+ vi.stubGlobal("window", Object.assign(window, { ogb: { cloudAccount: accountBridge(ending) } }));+ await show(createElement(CloudAccountSettings));+ expect(button("Keep my plan")).toBeTruthy();+ expect(button("Subscribe to keep it")).toBeUndefined();+ expect(button("Manage Cloud subscription")).toBeTruthy();+ });++ it("the Cloud page in home mode: Cancel trial beside Manage in your browser, and the plan read again after; none without a renewal", async () => {+ let snapshot = { status: "paid" as const, tier: "pro", home: true as const, renewal: trial };+ const plan: CloudPlanBridge = { state: vi.fn(async () => snapshot), manage: vi.fn(async () => undefined),+ cancel: vi.fn(async () => { snapshot = { ...snapshot, renewal: cancelledTrial }; return { outcome: "cancelled" as const, renewal: cancelledTrial, surveyed: false, state: { status: "connected" as const } }; }),+ keep: vi.fn(async () => ({ outcome: "kept" as const, state: { status: "connected" as const } })) };+ await show(createElement(CloudPlanOnCloud, { bridge: plan }));+ expect(button("Manage in your browser")).toBeTruthy();+ await click(button("Cancel trial"));+ await click(button("Cancel my trial"));+ expect(plan.cancel).toHaveBeenCalledExactlyOnceWith(null);+ await click(button("Done"));+ expect(plan.state).toHaveBeenCalledTimes(2);+ expect(container.querySelector("[data-cloud-cancel]")?.getAttribute("data-cloud-cancel")).toBe("cancelled");+ expect(button("Keep my plan")).toBeTruthy();+ snapshot = { status: "paid", tier: "pro", home: true, renewal: undefined as unknown as CloudRenewal };+ await act(async () => root.unmount()); root = createRoot(container);+ await show(createElement(CloudPlanOnCloud, { bridge: plan }));+ expect(button("Manage in your browser")).toBeTruthy();+ expect(container.querySelector("[data-cloud-cancel]")).toBeNull();+ });+});diff --git a/src/components/CloudCancelPlan.tsx b/src/components/CloudCancelPlan.tsxnew file mode 100644index 0000000000..f29a3a84d5--- /dev/null+++ b/src/components/CloudCancelPlan.tsx@@ -0,0 +1,171 @@+import { useEffect, useRef, useState } from "react";+import { createPortal } from "react-dom";+import { X } from "lucide-react";++import type { CloudCancelAnswer, CloudCancelSurvey, CloudRenewalResult } from "../../electron/cloud-account.mjs";+import type { CloudRenewal } from "../../electron/cloud-list.mjs";+import { cn } from "@/lib/cn";+import { activeLocale, t } from "@/lib/i18n";+import type { LocaleKey } from "@/locales";++export const CLOUD_CALL_URL = "https://cal.com/milind-soni-002qed/30min";+const ANSWERS: readonly CloudCancelAnswer[] = ["feature", "price", "setup", "broken", "later", "other"];+const ANSWER_LABEL: Record<CloudCancelAnswer, LocaleKey> = {+ feature: "cloudCancel.answer.feature", price: "cloudCancel.answer.price", setup: "cloudCancel.answer.setup",+ broken: "cloudCancel.answer.broken", later: "cloudCancel.answer.later", other: "cloudCancel.answer.other",+};+const BOX_MAX = 2_000;++/** Main cancels and keeps the plan; the page only says what the person answered. */+export interface CloudRenewalActions {+ cancel(survey: CloudCancelSurvey | null): Promise<CloudRenewalResult>;+ keep(): Promise<CloudRenewalResult>;+}++const day = (value: number) => new Intl.DateTimeFormat(activeLocale(), { dateStyle: "medium" }).format(new Date(value));+const endsAt = (renewal: CloudRenewal) => renewal.endsAt ?? renewal.renewsAt;++export function endedLine(renewal: CloudRenewal): string {+ const at = endsAt(renewal);+ if (renewal.trial) return at ? t("cloudCancel.endedTrial", { date: day(at) }) : t("cloudCancel.endedTrialNoDate");+ return at ? t("cloudCancel.endedPlan", { date: day(at) }) : t("cloudCancel.endedPlanNoDate");+}++export function stopsLine(renewal: CloudRenewal): string {+ const stops = renewal.team ? t("cloudCancel.teamStops", { team: renewal.team }) : t("cloudCancel.stops");+ const kept = renewal.keptDays;+ if (kept === null) return stops;+ const files = kept <= 0 ? t("cloudCancel.keptNone") : !Number.isInteger(kept) ? t("cloudCancel.keptHours", { hours: Math.max(1, Math.round(kept * 24)) })+ : kept === 1 ? t("cloudCancel.keptDay") : t("cloudCancel.keptDays", { days: kept });+ return `${stops} ${files}`;+}++function leadLine(renewal: CloudRenewal): string {+ const runs = renewal.renewsAt ? t(renewal.trial ? "cloudCancel.runsTrial" : "cloudCancel.runsPlan", { date: day(renewal.renewsAt) }) : null;+ return [runs, t(renewal.trial ? "cloudCancel.nothingCharged" : "cloudCancel.noMoreCharges"), renewal.team ? t("cloudCancel.teamStops", { team: renewal.team }) : null]+ .filter(Boolean).join(" ");+}++export function CloudCancelPlan({ renewal, actions, onChanged }: { renewal: CloudRenewal | undefined; actions: CloudRenewalActions | null; onChanged?: () => void }) {+ const [opened, setOpened] = useState<CloudRenewal | null>(null);+ const [keeping, setKeeping] = useState(false), [note, setNote] = useState<"failed" | "browser" | null>(null);+ if (!renewal || !actions) return null;+ const keep = () => {+ setKeeping(true); setNote(null);+ void actions.keep().then(result => {+ if (result.outcome === "kept") onChanged?.();+ else setNote(result.outcome === "browser" ? "browser" : "failed");+ }, () => setNote("failed")).finally(() => setKeeping(false));+ };+ return <>+ {renewal.cancelled+ ? <div data-cloud-cancel="cancelled" className="flex flex-col items-start gap-2 self-start">+ <p role="status" className="text-[13px] text-ink">{endedLine(renewal)}</p>+ <button type="button" className="ui-button" disabled={keeping} onClick={keep}>{t(keeping ? "cloudCancel.keeping" : "cloudCancel.keep")}</button>+ {note && <p role={note === "failed" ? "alert" : "status"} className={cn("text-[13px]", note === "failed" ? "text-danger" : "text-ink-secondary")}>+ {t(note === "failed" ? "cloudCancel.failed" : "cloudCancel.browser")}</p>}+ </div>+ : <button type="button" data-cloud-cancel="renewing" className="ui-button self-start" onClick={() => { setNote(null); setOpened(renewal); }}>+ {t(renewal.trial ? "cloudCancel.cancelTrial" : "cloudCancel.cancelPlan")}</button>}+ {opened && <CloudCancelSheet renewal={opened} actions={actions} onClose={changed => { setOpened(null); if (changed) onChanged?.(); }} />}+ </>;+}++type Step = { step: "ask" } | { step: "done"; renewal: CloudRenewal; surveyed: boolean } | { step: "browser" };++export function CloudCancelSheet({ renewal, actions, onClose }: { renewal: CloudRenewal; actions: CloudRenewalActions; onClose: (changed: boolean) => void }) {+ const [picked, setPicked] = useState<CloudCancelAnswer | null>(null);+ const [expected, setExpected] = useState(""), [improve, setImprove] = useState("");+ const [state, setState] = useState<Step>({ step: "ask" });+ const [busy, setBusy] = useState(false), [failed, setFailed] = useState(false);+ const changed = useRef(false), dialog = useRef<HTMLDivElement>(null);+ const close = () => { if (!busy) onClose(changed.current); };+ useEffect(() => {+ const opener = document.activeElement instanceof HTMLElement ? document.activeElement : null;+ dialog.current?.querySelector<HTMLElement>("button[aria-pressed]")?.focus();+ return () => { if (opener?.isConnected) opener.focus(); };+ }, []);+ const run = (work: () => Promise<void>) => {+ setBusy(true); setFailed(false);+ void work().catch(() => setFailed(true)).finally(() => setBusy(false));+ };+ const cancel = () => run(async () => {+ const said = picked !== null || expected.trim() !== "" || improve.trim() !== "";+ const result = await actions.cancel(said ? { answer: picked, ...(expected.trim() ? { expected } : {}), ...(improve.trim() ? { improve } : {}) } : null);+ if (result.outcome === "cancelled") {+ changed.current = true;+ setState({ step: "done", renewal: result.renewal ?? { ...renewal, cancelled: true, endsAt: renewal.renewsAt, renewsAt: null }, surveyed: result.surveyed });+ } else if (result.outcome === "browser") setState({ step: "browser" });+ else setFailed(true);+ });+ const keep = () => run(async () => {+ const result = await actions.keep();+ if (result.outcome === "kept") { changed.current = true; onClose(true); }+ else if (result.outcome === "browser") setState({ step: "browser" });+ else setFailed(true);+ });+ const title = t(renewal.trial ? "cloudCancel.titleTrial" : "cloudCancel.titlePlan");+ const box = "mt-1.5 w-full rounded-lg border border-hairline/50 bg-inset px-3 py-2 text-[14px] text-ink disabled:opacity-60";+ const alert = failed && <p role="alert" className="mt-3 text-[13px] text-danger">{t("cloudCancel.failed")}</p>;+ return createPortal(+ <div className="fixed inset-0 z-[80] flex items-center justify-center bg-black/55 p-4" onMouseDown={event => { if (event.target === event.currentTarget) close(); }}>+ <div ref={dialog} role="dialog" aria-modal="true" aria-labelledby="cloud-cancel-title" aria-busy={busy} tabIndex={-1} data-cloud-cancel-sheet={state.step}+ className="flex max-h-[90vh] w-full max-w-[480px] flex-col overflow-hidden rounded-2xl border border-hairline/50 bg-panel text-ink shadow-2xl outline-none"+ onKeyDown={event => {+ if (event.key === "Escape") { event.stopPropagation(); close(); }+ if (event.key === "Tab") {+ const controls = dialog.current?.querySelectorAll<HTMLElement>("a[href], textarea:enabled, button:enabled");+ if (!controls?.length) return;+ const first = controls[0]!, last = controls[controls.length - 1]!;+ if (event.shiftKey && document.activeElement === first) { event.preventDefault(); last.focus(); }+ else if (!event.shiftKey && document.activeElement === last) { event.preventDefault(); first.focus(); }+ }+ }}>+ <header className="flex items-start justify-between gap-3 px-6 pb-1 pt-5">+ <h2 id="cloud-cancel-title" className="text-[17px] font-semibold">{title}</h2>+ <button type="button" aria-label={t("cloudCancel.close")} disabled={busy} onClick={close} className="rounded-lg p-1.5 text-ink-secondary hover:bg-raised"><X size={18} /></button>+ </header>+ <div className="min-h-0 flex-1 overflow-y-auto px-6 pb-5 pt-1">+ {state.step === "ask" && <>+ <p className="text-[13px] leading-relaxed text-ink-secondary">{leadLine(renewal)}</p>+ <fieldset className="mt-4" disabled={busy}>+ <legend className="text-[14px] font-medium text-ink">{t("cloudCancel.question")}</legend>+ <div className="mt-2.5 flex flex-wrap gap-2">+ {ANSWERS.map(answer => <button key={answer} type="button" aria-pressed={picked === answer} onClick={() => setPicked(current => current === answer ? null : answer)}+ className={cn("ui-button ui-button-pill", picked === answer && "border-accent bg-accent/10 font-medium")}>{t(ANSWER_LABEL[answer])}</button>)}+ </div>+ </fieldset>+ <label className="mt-4 block text-[13px] text-ink">{t("cloudCancel.expected")} <span className="text-ink-secondary">{t("cloudCancel.optional")}</span>+ <textarea rows={2} maxLength={BOX_MAX} value={expected} disabled={busy} onChange={event => setExpected(event.target.value)} className={box} /></label>+ <label className="mt-3 block text-[13px] text-ink">{t("cloudCancel.improve")} <span className="text-ink-secondary">{t("cloudCancel.optional")}</span>+ <textarea rows={2} maxLength={BOX_MAX} value={improve} disabled={busy} onChange={event => setImprove(event.target.value)} className={box} /></label>+ <p className="mt-3 text-[12px] text-ink-secondary">{t("cloudCancel.talk")}{" "}+ <a href={CLOUD_CALL_URL} target="_blank" rel="noreferrer" className="underline underline-offset-2 hover:text-ink">{t("cloudCancel.book")}</a></p>+ {alert}+ <div className="mt-5 flex flex-wrap justify-end gap-2">+ <button type="button" className="ui-button" disabled={busy} onClick={close}>{t("cloudCancel.keep")}</button>+ <button type="button" data-cloud-cancel-confirm className="ui-button border-transparent bg-danger text-white hover:brightness-110" disabled={busy} onClick={cancel}>+ {t(busy ? "cloudCancel.cancelling" : renewal.trial ? "cloudCancel.confirmTrial" : "cloudCancel.confirmPlan")}</button>+ </div>+ </>}+ {state.step === "done" && <>+ <p role="status" className="text-[14px] font-medium text-ink">{endedLine(state.renewal)}</p>+ <p className="mt-2 text-[13px] leading-relaxed text-ink-secondary">{stopsLine(state.renewal)}</p>+ {state.surveyed && <p className="mt-2 text-[13px] leading-relaxed text-ink-secondary">{t("cloudCancel.thanks")}</p>}+ {alert}+ <div className="mt-5 flex flex-wrap items-center gap-2">+ <span className="text-[13px] text-ink-secondary">{t("cloudCancel.changedMind")}</span>+ <button type="button" className="ui-button" disabled={busy} onClick={keep}>{t(busy ? "cloudCancel.keeping" : "cloudCancel.keep")}</button>+ <button type="button" className="ui-button ui-button-primary ms-auto" disabled={busy} onClick={close}>{t("cloudCancel.done")}</button>+ </div>+ </>}+ {state.step === "browser" && <>+ <p role="status" className="text-[13px] leading-relaxed text-ink">{t("cloudCancel.browser")}</p>+ <div className="mt-5 flex justify-end"><button type="button" className="ui-button ui-button-primary" onClick={close}>{t("cloudCancel.done")}</button></div>+ </>}+ </div>+ </div>+ </div>,+ document.body,+ );+}diff --git a/src/locales/de.json b/src/locales/de.jsonindex 894ea8fd3a..d4f2c1ee17 100644--- a/src/locales/de.json+++ b/src/locales/de.json@@ -223,6 +223,47 @@"cloudTrial.subscribe": "Abonnieren und behalten","cloudTrial.checkPayment": "Zahlungsstatus prüfen","cloudTrial.ok": "OK",+ "cloudCancel.cancelTrial": "Testphase kündigen",+ "cloudCancel.cancelPlan": "Tarif kündigen",+ "cloudCancel.titleTrial": "Testphase kündigen",+ "cloudCancel.titlePlan": "Tarif kündigen",+ "cloudCancel.runsTrial": "Deine Testphase läuft bis {date}.",+ "cloudCancel.runsPlan": "Dein Tarif läuft bis {date}.",+ "cloudCancel.nothingCharged": "Kündigst du jetzt, wird nichts berechnet.",+ "cloudCancel.noMoreCharges": "Kündigst du jetzt, wird dir nichts mehr berechnet.",+ "cloudCancel.teamStops": "Die Cloud von {team} stoppt dann für alle im Team.",+ "cloudCancel.question": "Bevor du gehst: Was ist der Hauptgrund?",+ "cloudCancel.answer.feature": "Eine Funktion fehlt",+ "cloudCancel.answer.price": "Zu teuer",+ "cloudCancel.answer.setup": "Schwer einzurichten",+ "cloudCancel.answer.broken": "Hat nicht wie erwartet funktioniert",+ "cloudCancel.answer.later": "Brauche es gerade nicht",+ "cloudCancel.answer.other": "Etwas anderes",+ "cloudCancel.expected": "Was hast du von MausBot erwartet?",+ "cloudCancel.improve": "Was hätten wir besser machen können?",+ "cloudCancel.optional": "(optional)",+ "cloudCancel.talk": "Lieber kurz darüber sprechen?",+ "cloudCancel.book": "30 Minuten mit Milind buchen",+ "cloudCancel.keep": "Meinen Tarif behalten",+ "cloudCancel.confirmTrial": "Meine Testphase kündigen",+ "cloudCancel.confirmPlan": "Meinen Tarif kündigen",+ "cloudCancel.cancelling": "Wird gekündigt…",+ "cloudCancel.keeping": "Wird behalten…",+ "cloudCancel.endedTrial": "Gekündigt. Deine Testphase endet am {date}, und es wird nichts berechnet.",+ "cloudCancel.endedTrialNoDate": "Gekündigt. Wenn deine Testphase endet, wird nichts berechnet.",+ "cloudCancel.endedPlan": "Gekündigt. Dein Tarif endet am {date}. Dir wird nichts mehr berechnet.",+ "cloudCancel.endedPlanNoDate": "Gekündigt. Dein Tarif endet mit dem bezahlten Zeitraum. Dir wird nichts mehr berechnet.",+ "cloudCancel.stops": "Die Cloud stoppt dann.",+ "cloudCancel.keptDays": "Ihre Dateien werden {days} Tage aufbewahrt und dann gelöscht.",+ "cloudCancel.keptDay": "Ihre Dateien werden 1 Tag aufbewahrt und dann gelöscht.",+ "cloudCancel.keptHours": "Ihre Dateien werden {hours} Stunden aufbewahrt und dann gelöscht.",+ "cloudCancel.keptNone": "Ihre Dateien werden gelöscht, wenn sie stoppt.",+ "cloudCancel.thanks": "Danke. Milind und Omkar lesen jede Antwort, und wir melden uns, wenn wir es bauen können.",+ "cloudCancel.changedMind": "Doch anders überlegt?",+ "cloudCancel.done": "Fertig",+ "cloudCancel.close": "Schließen",+ "cloudCancel.browser": "Die Abrechnung auf der Cloud-Seite wurde in deinem Browser geöffnet. Dort kannst du es erledigen.",+ "cloudCancel.failed": "Das hat nicht geklappt, und nichts wurde geändert. Versuch es in einer Minute noch einmal.","cloudCredit.left": "Claude-Guthaben der Testphase: noch {left} von {granted}. Cloud-Bots nutzen es, bis du dich dort mit deinem eigenen Claude- oder ChatGPT-Konto anmeldest oder einen API-Schlüssel hinzufügst.","cloudCredit.usedUp": "Dein Claude-Guthaben der Testphase ({granted}) ist aufgebraucht. Damit deine Bots weiterarbeiten, melde dich in der Cloud mit deinem eigenen Claude- oder ChatGPT-Konto an oder füge dort einen API-Schlüssel hinzu.","engines.trialCredit": "In deiner kostenlosen Testphase enthalten. Cloud-Bots nutzen es, bis du dich mit deinem eigenen Claude- oder ChatGPT-Konto anmeldest oder einen API-Schlüssel hinzufügst.",diff --git a/src/locales/en.json b/src/locales/en.jsonindex bb69a99218..1bd6e65c28 100644--- a/src/locales/en.json+++ b/src/locales/en.json@@ -746,6 +746,47 @@"cloudTrial.subscribe": "Subscribe to keep it","cloudTrial.checkPayment": "Check payment status","cloudTrial.ok": "OK",+ "cloudCancel.cancelTrial": "Cancel trial",+ "cloudCancel.cancelPlan": "Cancel plan",+ "cloudCancel.titleTrial": "Cancel your trial",+ "cloudCancel.titlePlan": "Cancel your plan",+ "cloudCancel.runsTrial": "Your trial runs until {date}.",+ "cloudCancel.runsPlan": "Your plan runs until {date}.",+ "cloudCancel.nothingCharged": "Cancel now and nothing is charged.",+ "cloudCancel.noMoreCharges": "Cancel now and you won't be charged again.",+ "cloudCancel.teamStops": "{team}'s Cloud stops then, for everyone in the team.",+ "cloudCancel.question": "Before you go: what's the main reason?",+ "cloudCancel.answer.feature": "Missing a feature",+ "cloudCancel.answer.price": "Too expensive",+ "cloudCancel.answer.setup": "Hard to set up",+ "cloudCancel.answer.broken": "Didn't work as I expected",+ "cloudCancel.answer.later": "Not using it right now",+ "cloudCancel.answer.other": "Something else",+ "cloudCancel.expected": "What did you expect MausBot to do?",+ "cloudCancel.improve": "What could we have done better?",+ "cloudCancel.optional": "(optional)",+ "cloudCancel.talk": "Rather talk it through?",+ "cloudCancel.book": "Book 30 minutes with Milind",+ "cloudCancel.keep": "Keep my plan",+ "cloudCancel.confirmTrial": "Cancel my trial",+ "cloudCancel.confirmPlan": "Cancel my plan",+ "cloudCancel.cancelling": "Cancelling…",+ "cloudCancel.keeping": "Keeping…",+ "cloudCancel.endedTrial": "Cancelled. Your trial ends on {date}, and nothing is charged.",+ "cloudCancel.endedTrialNoDate": "Cancelled. Nothing is charged when your trial ends.",+ "cloudCancel.endedPlan": "Cancelled. Your plan ends on {date}. You won't be charged again.",+ "cloudCancel.endedPlanNoDate": "Cancelled. Your plan ends with the period you paid for. You won't be charged again.",+ "cloudCancel.stops": "The Cloud stops then.",+ "cloudCancel.keptDays": "Its files are kept {days} days, then deleted.",+ "cloudCancel.keptDay": "Its files are kept 1 day, then deleted.",+ "cloudCancel.keptHours": "Its files are kept {hours} hours, then deleted.",+ "cloudCancel.keptNone": "Its files are deleted when it stops.",+ "cloudCancel.thanks": "Thanks. Milind and Omkar read every answer, and we'll write back if it's something we can build.",+ "cloudCancel.changedMind": "Changed your mind?",+ "cloudCancel.done": "Done",+ "cloudCancel.close": "Close",+ "cloudCancel.browser": "The Cloud page's Billing opened in your browser. You can do it there.",+ "cloudCancel.failed": "That didn't go through, and nothing changed. Try again in a minute.","cloudCredit.left": "Trial Claude credit: {left} of {granted} left. Cloud bots use it until you sign in there with your own Claude or ChatGPT account, or add an API key.","cloudCredit.usedUp": "Your {granted} trial Claude credit is used up. To keep your bots working, sign in with your own Claude or ChatGPT account in the Cloud, or add an API key there.","engines.trialCredit": "Included with your free trial. Cloud bots use it until you sign in with your own Claude or ChatGPT account, or add an API key.",diff --git a/src/locales/es.json b/src/locales/es.jsonindex 94dd58d95e..69f7d74f4f 100644--- a/src/locales/es.json+++ b/src/locales/es.json@@ -636,6 +636,47 @@"cloudTrial.subscribe": "Suscribirme para conservarlo","cloudTrial.checkPayment": "Ver el estado del pago","cloudTrial.ok": "Aceptar",+ "cloudCancel.cancelTrial": "Cancelar prueba",+ "cloudCancel.cancelPlan": "Cancelar plan",+ "cloudCancel.titleTrial": "Cancelar tu prueba",+ "cloudCancel.titlePlan": "Cancelar tu plan",+ "cloudCancel.runsTrial": "Tu prueba dura hasta el {date}.",+ "cloudCancel.runsPlan": "Tu plan dura hasta el {date}.",+ "cloudCancel.nothingCharged": "Si cancelas ahora, no se cobra nada.",+ "cloudCancel.noMoreCharges": "Si cancelas ahora, no se te volverá a cobrar.",+ "cloudCancel.teamStops": "La Cloud de {team} se detiene entonces para todos en el equipo.",+ "cloudCancel.question": "Antes de irte: ¿cuál es el motivo principal?",+ "cloudCancel.answer.feature": "Falta una función",+ "cloudCancel.answer.price": "Demasiado caro",+ "cloudCancel.answer.setup": "Difícil de configurar",+ "cloudCancel.answer.broken": "No funcionó como esperaba",+ "cloudCancel.answer.later": "No lo uso ahora mismo",+ "cloudCancel.answer.other": "Otra cosa",+ "cloudCancel.expected": "¿Qué esperabas que hiciera MausBot?",+ "cloudCancel.improve": "¿Qué podríamos haber hecho mejor?",+ "cloudCancel.optional": "(opcional)",+ "cloudCancel.talk": "¿Prefieres hablarlo?",+ "cloudCancel.book": "Reserva 30 minutos con Milind",+ "cloudCancel.keep": "Mantener mi plan",+ "cloudCancel.confirmTrial": "Cancelar mi prueba",+ "cloudCancel.confirmPlan": "Cancelar mi plan",+ "cloudCancel.cancelling": "Cancelando…",+ "cloudCancel.keeping": "Manteniendo…",+ "cloudCancel.endedTrial": "Cancelado. Tu prueba termina el {date} y no se cobra nada.",+ "cloudCancel.endedTrialNoDate": "Cancelado. No se cobra nada cuando termine tu prueba.",+ "cloudCancel.endedPlan": "Cancelado. Tu plan termina el {date}. No se te volverá a cobrar.",+ "cloudCancel.endedPlanNoDate": "Cancelado. Tu plan termina con el periodo que pagaste. No se te volverá a cobrar.",+ "cloudCancel.stops": "La Cloud se detiene entonces.",+ "cloudCancel.keptDays": "Sus archivos se conservan {days} días y luego se eliminan.",+ "cloudCancel.keptDay": "Sus archivos se conservan 1 día y luego se eliminan.",+ "cloudCancel.keptHours": "Sus archivos se conservan {hours} horas y luego se eliminan.",+ "cloudCancel.keptNone": "Sus archivos se eliminan cuando se detiene.",+ "cloudCancel.thanks": "Gracias. Milind y Omkar leen cada respuesta, y te escribiremos si es algo que podamos construir.",+ "cloudCancel.changedMind": "¿Cambiaste de idea?",+ "cloudCancel.done": "Listo",+ "cloudCancel.close": "Cerrar",+ "cloudCancel.browser": "La facturación de la página de la Cloud se abrió en tu navegador. Puedes hacerlo allí.",+ "cloudCancel.failed": "No se pudo completar y no cambió nada. Inténtalo de nuevo en un minuto.","cloudCredit.left": "Crédito de Claude de la prueba: quedan {left} de {granted}. Los bots de la Cloud lo usan hasta que inicies sesión allí con tu propia cuenta de Claude o ChatGPT, o añadas una clave de API.","cloudCredit.usedUp": "Se agotó tu crédito de Claude de la prueba ({granted}). Para que tus bots sigan trabajando, inicia sesión con tu propia cuenta de Claude o ChatGPT en la Cloud, o añade allí una clave de API.","engines.trialCredit": "Incluido en tu prueba gratis. Los bots de la Cloud lo usan hasta que inicies sesión con tu propia cuenta de Claude o ChatGPT, o añadas una clave de API.",diff --git a/src/locales/everyday-words.test.ts b/src/locales/everyday-words.test.tsindex 5eef48f7f3..8e26dd3d7d 100644--- a/src/locales/everyday-words.test.ts+++ b/src/locales/everyday-words.test.ts@@ -20,7 +20,7 @@ const EVERYDAY_PREFIXES: Record<string, readonly string[]> = {"computer.screen.", "vm.cloud.", "browser.",],"MausBot Cloud: buying it, setting it up, moving to it and sharing with it": [- "cloudBuy.", "cloudIntro.", "cloudTrial.", "cloudSetup.", "cloudIntent.", "cloudNotice.", "cloudHowTo.", "cloudProPopup.",+ "cloudBuy.", "cloudIntro.", "cloudTrial.", "cloudCancel.", "cloudSetup.", "cloudIntent.", "cloudNotice.", "cloudHowTo.", "cloudProPopup.","cloudCredit.", "cloudPower.", "cloudSignIn.", "cloudAdd.", "cloudHome.", "cloudPhone.", "cloudAccount.", "pro.", "lending.","files.", "usageMeter.",],diff --git a/src/locales/fr.json b/src/locales/fr.jsonindex b3f724ec41..8cb16add9a 100644--- a/src/locales/fr.json+++ b/src/locales/fr.json@@ -143,6 +143,47 @@"cloudTrial.subscribe": "S'abonner pour le garder","cloudTrial.checkPayment": "Vérifier l'état du paiement","cloudTrial.ok": "OK",+ "cloudCancel.cancelTrial": "Annuler l'essai",+ "cloudCancel.cancelPlan": "Résilier le forfait",+ "cloudCancel.titleTrial": "Annuler votre essai",+ "cloudCancel.titlePlan": "Résilier votre forfait",+ "cloudCancel.runsTrial": "Votre essai dure jusqu'au {date}.",+ "cloudCancel.runsPlan": "Votre forfait dure jusqu'au {date}.",+ "cloudCancel.nothingCharged": "Si vous annulez maintenant, rien n'est facturé.",+ "cloudCancel.noMoreCharges": "Si vous résiliez maintenant, vous ne serez plus facturé.",+ "cloudCancel.teamStops": "Le Cloud de {team} s'arrête alors pour toute l'équipe.",+ "cloudCancel.question": "Avant de partir : quelle est la raison principale ?",+ "cloudCancel.answer.feature": "Il manque une fonctionnalité",+ "cloudCancel.answer.price": "Trop cher",+ "cloudCancel.answer.setup": "Difficile à configurer",+ "cloudCancel.answer.broken": "N'a pas marché comme prévu",+ "cloudCancel.answer.later": "Je ne m'en sers pas en ce moment",+ "cloudCancel.answer.other": "Autre chose",+ "cloudCancel.expected": "Qu'attendiez-vous de MausBot ?",+ "cloudCancel.improve": "Qu'aurions-nous pu mieux faire ?",+ "cloudCancel.optional": "(facultatif)",+ "cloudCancel.talk": "Vous préférez en parler ?",+ "cloudCancel.book": "Réservez 30 minutes avec Milind",+ "cloudCancel.keep": "Garder mon forfait",+ "cloudCancel.confirmTrial": "Annuler mon essai",+ "cloudCancel.confirmPlan": "Résilier mon forfait",+ "cloudCancel.cancelling": "Annulation…",+ "cloudCancel.keeping": "Un instant…",+ "cloudCancel.endedTrial": "Annulé. Votre essai se termine le {date}, et rien n'est facturé.",+ "cloudCancel.endedTrialNoDate": "Annulé. Rien n'est facturé à la fin de votre essai.",+ "cloudCancel.endedPlan": "Résilié. Votre forfait se termine le {date}. Vous ne serez plus facturé.",+ "cloudCancel.endedPlanNoDate": "Résilié. Votre forfait se termine avec la période payée. Vous ne serez plus facturé.",+ "cloudCancel.stops": "Le Cloud s'arrête alors.",+ "cloudCancel.keptDays": "Ses fichiers sont conservés {days} jours, puis supprimés.",+ "cloudCancel.keptDay": "Ses fichiers sont conservés 1 jour, puis supprimés.",+ "cloudCancel.keptHours": "Ses fichiers sont conservés {hours} heures, puis supprimés.",+ "cloudCancel.keptNone": "Ses fichiers sont supprimés à son arrêt.",+ "cloudCancel.thanks": "Merci. Milind et Omkar lisent chaque réponse, et nous vous répondrons si c'est quelque chose que nous pouvons construire.",+ "cloudCancel.changedMind": "Vous avez changé d'avis ?",+ "cloudCancel.done": "Terminé",+ "cloudCancel.close": "Fermer",+ "cloudCancel.browser": "La facturation de la page du Cloud s'est ouverte dans votre navigateur. Vous pouvez le faire là-bas.",+ "cloudCancel.failed": "Ça n'a pas abouti, et rien n'a changé. Réessayez dans une minute.","cloudCredit.left": "Crédit Claude de l'essai : {left} sur {granted} restants. Les bots du Cloud l'utilisent jusqu'à ce que vous vous y connectiez avec votre propre compte Claude ou ChatGPT, ou que vous ajoutiez une clé API.","cloudCredit.usedUp": "Votre crédit Claude d'essai de {granted} est épuisé. Pour que vos bots continuent de travailler, connectez-vous avec votre propre compte Claude ou ChatGPT dans le Cloud, ou ajoutez-y une clé API.","engines.trialCredit": "Inclus dans votre essai gratuit. Les bots du Cloud l'utilisent jusqu'à ce que vous vous connectiez avec votre propre compte Claude ou ChatGPT, ou que vous ajoutiez une clé API.",diff --git a/src/locales/hi.json b/src/locales/hi.jsonindex 6ca3827d59..a7f078a234 100644--- a/src/locales/hi.json+++ b/src/locales/hi.json@@ -143,6 +143,47 @@"cloudTrial.subscribe": "इसे बनाए रखने के लिए सदस्यता लें","cloudTrial.checkPayment": "भुगतान की स्थिति देखें","cloudTrial.ok": "ठीक है",+ "cloudCancel.cancelTrial": "ट्रायल रद्द करें",+ "cloudCancel.cancelPlan": "प्लान रद्द करें",+ "cloudCancel.titleTrial": "अपना ट्रायल रद्द करें",+ "cloudCancel.titlePlan": "अपना प्लान रद्द करें",+ "cloudCancel.runsTrial": "आपका ट्रायल {date} तक चलेगा।",+ "cloudCancel.runsPlan": "आपका प्लान {date} तक चलेगा।",+ "cloudCancel.nothingCharged": "अभी रद्द करने पर कुछ भी चार्ज नहीं होगा।",+ "cloudCancel.noMoreCharges": "अभी रद्द करने पर आपसे दोबारा चार्ज नहीं किया जाएगा।",+ "cloudCancel.teamStops": "तब {team} का Cloud टीम के सभी लोगों के लिए रुक जाएगा।",+ "cloudCancel.question": "जाने से पहले: मुख्य वजह क्या है?",+ "cloudCancel.answer.feature": "कोई ज़रूरी फ़ीचर नहीं है",+ "cloudCancel.answer.price": "बहुत महंगा है",+ "cloudCancel.answer.setup": "सेट अप करना मुश्किल था",+ "cloudCancel.answer.broken": "उम्मीद के मुताबिक काम नहीं किया",+ "cloudCancel.answer.later": "अभी इस्तेमाल नहीं कर रहे",+ "cloudCancel.answer.other": "कुछ और",+ "cloudCancel.expected": "आपको MausBot से क्या करने की उम्मीद थी?",+ "cloudCancel.improve": "हम क्या बेहतर कर सकते थे?",+ "cloudCancel.optional": "(वैकल्पिक)",+ "cloudCancel.talk": "बात करके सुलझाना चाहेंगे?",+ "cloudCancel.book": "Milind के साथ 30 मिनट बुक करें",+ "cloudCancel.keep": "मेरा प्लान रखें",+ "cloudCancel.confirmTrial": "मेरा ट्रायल रद्द करें",+ "cloudCancel.confirmPlan": "मेरा प्लान रद्द करें",+ "cloudCancel.cancelling": "रद्द किया जा रहा है…",+ "cloudCancel.keeping": "रखा जा रहा है…",+ "cloudCancel.endedTrial": "रद्द हो गया। आपका ट्रायल {date} को खत्म होगा, और कुछ भी चार्ज नहीं होगा।",+ "cloudCancel.endedTrialNoDate": "रद्द हो गया। आपका ट्रायल खत्म होने पर कुछ भी चार्ज नहीं होगा।",+ "cloudCancel.endedPlan": "रद्द हो गया। आपका प्लान {date} को खत्म होगा। आपसे दोबारा चार्ज नहीं किया जाएगा।",+ "cloudCancel.endedPlanNoDate": "रद्द हो गया। आपका प्लान भुगतान की गई अवधि के साथ खत्म होगा। आपसे दोबारा चार्ज नहीं किया जाएगा।",+ "cloudCancel.stops": "तब Cloud रुक जाएगा।",+ "cloudCancel.keptDays": "उसकी फ़ाइलें {days} दिन तक रखी जाती हैं, फिर हटा दी जाती हैं।",+ "cloudCancel.keptDay": "उसकी फ़ाइलें 1 दिन तक रखी जाती हैं, फिर हटा दी जाती हैं।",+ "cloudCancel.keptHours": "उसकी फ़ाइलें {hours} घंटे तक रखी जाती हैं, फिर हटा दी जाती हैं।",+ "cloudCancel.keptNone": "रुकते ही उसकी फ़ाइलें हटा दी जाती हैं।",+ "cloudCancel.thanks": "धन्यवाद। Milind और Omkar हर जवाब पढ़ते हैं, और अगर यह कुछ ऐसा है जिसे हम बना सकते हैं तो हम आपको जवाब देंगे।",+ "cloudCancel.changedMind": "इरादा बदल गया?",+ "cloudCancel.done": "हो गया",+ "cloudCancel.close": "बंद करें",+ "cloudCancel.browser": "Cloud पेज का बिलिंग आपके ब्राउज़र में खुल गया है। आप वहां यह कर सकते हैं।",+ "cloudCancel.failed": "यह नहीं हो पाया, और कुछ नहीं बदला। एक मिनट में फिर से कोशिश करें।","cloudCredit.left": "ट्रायल का Claude क्रेडिट: {granted} में से {left} बाकी। Cloud के बॉट इसका इस्तेमाल तब तक करते हैं जब तक आप वहाँ अपने Claude या ChatGPT खाते से साइन इन नहीं करते, या API कुंजी नहीं जोड़ते।","cloudCredit.usedUp": "आपका {granted} का ट्रायल Claude क्रेडिट खत्म हो गया है। अपने बॉट चलाते रहने के लिए Cloud में अपने Claude या ChatGPT खाते से साइन इन करें, या वहाँ API कुंजी जोड़ें।","engines.trialCredit": "आपके मुफ़्त ट्रायल में शामिल। Cloud के बॉट इसका इस्तेमाल तब तक करते हैं जब तक आप अपने Claude या ChatGPT खाते से साइन इन नहीं करते, या API कुंजी नहीं जोड़ते।",diff --git a/src/locales/it.json b/src/locales/it.jsonindex 6871b6e304..bf30a6fc27 100644--- a/src/locales/it.json+++ b/src/locales/it.json@@ -697,6 +697,47 @@"cloudTrial.manage": "Gestisci l'abbonamento","cloudTrial.subscribe": "Abbonati per tenerlo","cloudTrial.checkPayment": "Controlla lo stato del pagamento",+ "cloudCancel.cancelTrial": "Annulla la prova",+ "cloudCancel.cancelPlan": "Annulla il piano",+ "cloudCancel.titleTrial": "Annulla la tua prova",+ "cloudCancel.titlePlan": "Annulla il tuo piano",+ "cloudCancel.runsTrial": "La tua prova dura fino al {date}.",+ "cloudCancel.runsPlan": "Il tuo piano dura fino al {date}.",+ "cloudCancel.nothingCharged": "Se annulli ora, non ti viene addebitato nulla.",+ "cloudCancel.noMoreCharges": "Se annulli ora, non ti verrà più addebitato nulla.",+ "cloudCancel.teamStops": "Il Cloud di {team} si ferma allora per tutto il team.",+ "cloudCancel.question": "Prima di andare: qual è il motivo principale?",+ "cloudCancel.answer.feature": "Manca una funzione",+ "cloudCancel.answer.price": "Troppo caro",+ "cloudCancel.answer.setup": "Difficile da configurare",+ "cloudCancel.answer.broken": "Non ha funzionato come mi aspettavo",+ "cloudCancel.answer.later": "Non lo uso in questo momento",+ "cloudCancel.answer.other": "Altro",+ "cloudCancel.expected": "Cosa ti aspettavi che facesse MausBot?",+ "cloudCancel.improve": "Cosa avremmo potuto fare meglio?",+ "cloudCancel.optional": "(facoltativo)",+ "cloudCancel.talk": "Preferisci parlarne?",+ "cloudCancel.book": "Prenota 30 minuti con Milind",+ "cloudCancel.keep": "Tieni il mio piano",+ "cloudCancel.confirmTrial": "Annulla la mia prova",+ "cloudCancel.confirmPlan": "Annulla il mio piano",+ "cloudCancel.cancelling": "Annullamento…",+ "cloudCancel.keeping": "Un momento…",+ "cloudCancel.endedTrial": "Annullato. La tua prova termina il {date} e non ti viene addebitato nulla.",+ "cloudCancel.endedTrialNoDate": "Annullato. Alla fine della prova non ti viene addebitato nulla.",+ "cloudCancel.endedPlan": "Annullato. Il tuo piano termina il {date}. Non ti verrà più addebitato nulla.",+ "cloudCancel.endedPlanNoDate": "Annullato. Il tuo piano termina con il periodo già pagato. Non ti verrà più addebitato nulla.",+ "cloudCancel.stops": "Il Cloud si ferma allora.",+ "cloudCancel.keptDays": "I suoi file vengono conservati per {days} giorni, poi eliminati.",+ "cloudCancel.keptDay": "I suoi file vengono conservati per 1 giorno, poi eliminati.",+ "cloudCancel.keptHours": "I suoi file vengono conservati per {hours} ore, poi eliminati.",+ "cloudCancel.keptNone": "I suoi file vengono eliminati quando si ferma.",+ "cloudCancel.thanks": "Grazie. Milind e Omkar leggono ogni risposta, e ti scriveremo se è qualcosa che possiamo costruire.",+ "cloudCancel.changedMind": "Hai cambiato idea?",+ "cloudCancel.done": "Fatto",+ "cloudCancel.close": "Chiudi",+ "cloudCancel.browser": "La fatturazione della pagina del Cloud si è aperta nel browser. Puoi farlo lì.",+ "cloudCancel.failed": "Non è andato a buon fine e non è cambiato nulla. Riprova tra un minuto.","cloudCredit.left": "Credito Claude di prova: {left} di {granted} rimasti. I bot del Cloud lo usano finché non accedi lì con il tuo account Claude o ChatGPT, o non aggiungi una chiave API.","cloudCredit.usedUp": "Il tuo credito Claude di prova di {granted} è esaurito. Per far continuare i bot, accedi con il tuo account Claude o ChatGPT nel Cloud, o aggiungi lì una chiave API.","engines.trialCredit": "Incluso nella prova gratuita. I bot del Cloud lo usano finché non accedi con il tuo account Claude o ChatGPT, o non aggiungi una chiave API.",diff --git a/src/locales/ja.json b/src/locales/ja.jsonindex 16546f0740..cecd6f788c 100644--- a/src/locales/ja.json+++ b/src/locales/ja.json@@ -715,6 +715,47 @@"cloudTrial.subscribe": "登録して残す","cloudTrial.checkPayment": "支払い状況を確認","cloudTrial.ok": "OK",+ "cloudCancel.cancelTrial": "トライアルを解約",+ "cloudCancel.cancelPlan": "プランを解約",+ "cloudCancel.titleTrial": "トライアルを解約",+ "cloudCancel.titlePlan": "プランを解約",+ "cloudCancel.runsTrial": "トライアルは {date} まで続きます。",+ "cloudCancel.runsPlan": "プランは {date} まで続きます。",+ "cloudCancel.nothingCharged": "今解約すると、料金は一切かかりません。",+ "cloudCancel.noMoreCharges": "今解約すると、今後の請求はありません。",+ "cloudCancel.teamStops": "そのとき {team} の Cloud はチーム全員に対して停止します。",+ "cloudCancel.question": "最後に:いちばんの理由は何ですか?",+ "cloudCancel.answer.feature": "必要な機能がない",+ "cloudCancel.answer.price": "高すぎる",+ "cloudCancel.answer.setup": "設定が難しい",+ "cloudCancel.answer.broken": "期待どおりに動かなかった",+ "cloudCancel.answer.later": "今は使っていない",+ "cloudCancel.answer.other": "その他",+ "cloudCancel.expected": "MausBot に何をしてほしかったですか?",+ "cloudCancel.improve": "私たちは何をもっと良くできたでしょうか?",+ "cloudCancel.optional": "(任意)",+ "cloudCancel.talk": "直接話したいですか?",+ "cloudCancel.book": "Milind と 30 分の通話を予約",+ "cloudCancel.keep": "プランを続ける",+ "cloudCancel.confirmTrial": "トライアルを解約する",+ "cloudCancel.confirmPlan": "プランを解約する",+ "cloudCancel.cancelling": "解約しています…",+ "cloudCancel.keeping": "処理しています…",+ "cloudCancel.endedTrial": "解約しました。トライアルは {date} に終了し、料金はかかりません。",+ "cloudCancel.endedTrialNoDate": "解約しました。トライアル終了時に料金はかかりません。",+ "cloudCancel.endedPlan": "解約しました。プランは {date} に終了します。今後の請求はありません。",+ "cloudCancel.endedPlanNoDate": "解約しました。プランは支払い済みの期間の終わりに終了します。今後の請求はありません。",+ "cloudCancel.stops": "そのとき Cloud は停止します。",+ "cloudCancel.keptDays": "ファイルは {days} 日間保持され、その後削除されます。",+ "cloudCancel.keptDay": "ファイルは 1 日間保持され、その後削除されます。",+ "cloudCancel.keptHours": "ファイルは {hours} 時間保持され、その後削除されます。",+ "cloudCancel.keptNone": "停止するとファイルは削除されます。",+ "cloudCancel.thanks": "ありがとうございます。Milind と Omkar がすべての回答を読み、私たちが作れるものであればご連絡します。",+ "cloudCancel.changedMind": "気が変わりましたか?",+ "cloudCancel.done": "完了",+ "cloudCancel.close": "閉じる",+ "cloudCancel.browser": "ブラウザーで Cloud ページの請求が開きました。そこで手続きできます。",+ "cloudCancel.failed": "うまくいかず、何も変更されていません。1 分後にもう一度お試しください。","cloudCredit.left": "トライアルの Claude クレジット:{granted} のうち残り {left}。Cloud のボットは、そこでご自身の Claude または ChatGPT アカウントでサインインするか、API キーを追加するまで、これを使います。","cloudCredit.usedUp": "トライアルの Claude クレジット({granted})を使い切りました。ボットを動かし続けるには、Cloud でご自身の Claude または ChatGPT アカウントでサインインするか、そこで API キーを追加してください。","engines.trialCredit": "無料トライアルに含まれています。Cloud のボットは、ご自身の Claude または ChatGPT アカウントでサインインするか、API キーを追加するまで、これを使います。",diff --git a/src/locales/pl.json b/src/locales/pl.jsonindex ecf0a631df..937d668fca 100644--- a/src/locales/pl.json+++ b/src/locales/pl.json@@ -708,6 +708,47 @@"cloudTrial.subscribe": "Zasubskrybuj, aby ją zachować","cloudTrial.checkPayment": "Sprawdź status płatności","cloudTrial.ok": "OK",+ "cloudCancel.cancelTrial": "Anuluj okres próbny",+ "cloudCancel.cancelPlan": "Anuluj plan",+ "cloudCancel.titleTrial": "Anuluj okres próbny",+ "cloudCancel.titlePlan": "Anuluj plan",+ "cloudCancel.runsTrial": "Twój okres próbny trwa do {date}.",+ "cloudCancel.runsPlan": "Twój plan trwa do {date}.",+ "cloudCancel.nothingCharged": "Jeśli anulujesz teraz, nic nie zostanie pobrane.",+ "cloudCancel.noMoreCharges": "Jeśli anulujesz teraz, nic więcej nie zostanie pobrane.",+ "cloudCancel.teamStops": "Chmura zespołu {team} zatrzyma się wtedy dla wszystkich w zespole.",+ "cloudCancel.question": "Zanim odejdziesz: jaki jest główny powód?",+ "cloudCancel.answer.feature": "Brakuje funkcji",+ "cloudCancel.answer.price": "Za drogo",+ "cloudCancel.answer.setup": "Trudna konfiguracja",+ "cloudCancel.answer.broken": "Nie działało zgodnie z oczekiwaniami",+ "cloudCancel.answer.later": "Teraz z tego nie korzystam",+ "cloudCancel.answer.other": "Coś innego",+ "cloudCancel.expected": "Co według Ciebie miał robić MausBot?",+ "cloudCancel.improve": "Co mogliśmy zrobić lepiej?",+ "cloudCancel.optional": "(opcjonalnie)",+ "cloudCancel.talk": "Wolisz o tym porozmawiać?",+ "cloudCancel.book": "Zarezerwuj 30 minut z Milindem",+ "cloudCancel.keep": "Zachowaj mój plan",+ "cloudCancel.confirmTrial": "Anuluj mój okres próbny",+ "cloudCancel.confirmPlan": "Anuluj mój plan",+ "cloudCancel.cancelling": "Anulowanie…",+ "cloudCancel.keeping": "Chwileczkę…",+ "cloudCancel.endedTrial": "Anulowano. Twój okres próbny kończy się {date} i nic nie zostanie pobrane.",+ "cloudCancel.endedTrialNoDate": "Anulowano. Po zakończeniu okresu próbnego nic nie zostanie pobrane.",+ "cloudCancel.endedPlan": "Anulowano. Twój plan kończy się {date}. Nic więcej nie zostanie pobrane.",+ "cloudCancel.endedPlanNoDate": "Anulowano. Twój plan kończy się wraz z opłaconym okresem. Nic więcej nie zostanie pobrane.",+ "cloudCancel.stops": "Chmura zatrzyma się wtedy.",+ "cloudCancel.keptDays": "Jej pliki są przechowywane przez {days} dni, a potem usuwane.",+ "cloudCancel.keptDay": "Jej pliki są przechowywane przez 1 dzień, a potem usuwane.",+ "cloudCancel.keptHours": "Jej pliki są przechowywane przez {hours} godz., a potem usuwane.",+ "cloudCancel.keptNone": "Jej pliki są usuwane, gdy się zatrzyma.",+ "cloudCancel.thanks": "Dziękujemy. Milind i Omkar czytają każdą odpowiedź i odezwiemy się, jeśli będziemy mogli to zbudować.",+ "cloudCancel.changedMind": "Zmieniasz zdanie?",+ "cloudCancel.done": "Gotowe",+ "cloudCancel.close": "Zamknij",+ "cloudCancel.browser": "Rozliczenia na stronie Chmury otworzyły się w przeglądarce. Możesz to zrobić tam.",+ "cloudCancel.failed": "Nie udało się i nic się nie zmieniło. Spróbuj ponownie za minutę.","cloudCredit.left": "Kredyty Claude z okresu próbnego: pozostało {left} z {granted}. Boty w Chmurze używają ich, dopóki nie zalogujesz się tam własnym kontem Claude lub ChatGPT albo nie dodasz klucza API.","cloudCredit.usedUp": "Twoje kredyty Claude z okresu próbnego ({granted}) zostały wykorzystane. Aby boty nadal działały, zaloguj się w Chmurze własnym kontem Claude lub ChatGPT albo dodaj tam klucz API.","engines.trialCredit": "Wliczone w bezpłatny okres próbny. Boty w Chmurze używają tego, dopóki nie zalogujesz się własnym kontem Claude lub ChatGPT albo nie dodasz klucza API.",diff --git a/src/locales/pt-br.json b/src/locales/pt-br.jsonindex 612f9e9c06..abd078a6b6 100644--- a/src/locales/pt-br.json+++ b/src/locales/pt-br.json@@ -682,6 +682,47 @@"cloudTrial.subscribe": "Assinar para manter","cloudTrial.checkPayment": "Ver o status do pagamento","cloudTrial.ok": "OK",+ "cloudCancel.cancelTrial": "Cancelar teste",+ "cloudCancel.cancelPlan": "Cancelar plano",+ "cloudCancel.titleTrial": "Cancelar seu teste",+ "cloudCancel.titlePlan": "Cancelar seu plano",+ "cloudCancel.runsTrial": "Seu teste vai até {date}.",+ "cloudCancel.runsPlan": "Seu plano vai até {date}.",+ "cloudCancel.nothingCharged": "Se cancelar agora, nada será cobrado.",+ "cloudCancel.noMoreCharges": "Se cancelar agora, você não será cobrado de novo.",+ "cloudCancel.teamStops": "O Cloud de {team} para nessa data para todos da equipe.",+ "cloudCancel.question": "Antes de ir: qual é o principal motivo?",+ "cloudCancel.answer.feature": "Falta um recurso",+ "cloudCancel.answer.price": "Caro demais",+ "cloudCancel.answer.setup": "Difícil de configurar",+ "cloudCancel.answer.broken": "Não funcionou como eu esperava",+ "cloudCancel.answer.later": "Não estou usando agora",+ "cloudCancel.answer.other": "Outra coisa",+ "cloudCancel.expected": "O que você esperava que o MausBot fizesse?",+ "cloudCancel.improve": "O que poderíamos ter feito melhor?",+ "cloudCancel.optional": "(opcional)",+ "cloudCancel.talk": "Prefere conversar?",+ "cloudCancel.book": "Agende 30 minutos com o Milind",+ "cloudCancel.keep": "Manter meu plano",+ "cloudCancel.confirmTrial": "Cancelar meu teste",+ "cloudCancel.confirmPlan": "Cancelar meu plano",+ "cloudCancel.cancelling": "Cancelando…",+ "cloudCancel.keeping": "Mantendo…",+ "cloudCancel.endedTrial": "Cancelado. Seu teste termina em {date}, e nada será cobrado.",+ "cloudCancel.endedTrialNoDate": "Cancelado. Nada será cobrado quando seu teste terminar.",+ "cloudCancel.endedPlan": "Cancelado. Seu plano termina em {date}. Você não será cobrado de novo.",+ "cloudCancel.endedPlanNoDate": "Cancelado. Seu plano termina com o período já pago. Você não será cobrado de novo.",+ "cloudCancel.stops": "O Cloud para nessa data.",+ "cloudCancel.keptDays": "Os arquivos dele são mantidos por {days} dias e depois excluídos.",+ "cloudCancel.keptDay": "Os arquivos dele são mantidos por 1 dia e depois excluídos.",+ "cloudCancel.keptHours": "Os arquivos dele são mantidos por {hours} horas e depois excluídos.",+ "cloudCancel.keptNone": "Os arquivos dele são excluídos quando ele para.",+ "cloudCancel.thanks": "Obrigado. Milind e Omkar leem cada resposta, e vamos escrever de volta se for algo que possamos construir.",+ "cloudCancel.changedMind": "Mudou de ideia?",+ "cloudCancel.done": "Pronto",+ "cloudCancel.close": "Fechar",+ "cloudCancel.browser": "O faturamento da página do Cloud abriu no seu navegador. Você pode fazer isso lá.",+ "cloudCancel.failed": "Não deu certo, e nada mudou. Tente de novo em um minuto.","cloudCredit.left": "Crédito do Claude do teste: restam {left} de {granted}. Os bots do Cloud o usam até você entrar lá com sua própria conta do Claude ou do ChatGPT, ou adicionar uma chave de API.","cloudCredit.usedUp": "Seu crédito do Claude do teste ({granted}) acabou. Para seus bots continuarem trabalhando, entre com sua própria conta do Claude ou do ChatGPT no Cloud, ou adicione uma chave de API lá.","engines.trialCredit": "Incluído no seu teste grátis. Os bots do Cloud o usam até você entrar com sua própria conta do Claude ou do ChatGPT, ou adicionar uma chave de API.",diff --git a/src/locales/ru.json b/src/locales/ru.jsonindex 18df96803a..d4c175f3d0 100644--- a/src/locales/ru.json+++ b/src/locales/ru.json@@ -714,6 +714,47 @@"cloudTrial.subscribe": "Оформить подписку, чтобы сохранить кредит","cloudTrial.checkPayment": "Проверить статус оплаты","cloudTrial.ok": "ОК",+ "cloudCancel.cancelTrial": "Отменить пробный период",+ "cloudCancel.cancelPlan": "Отменить тариф",+ "cloudCancel.titleTrial": "Отменить пробный период",+ "cloudCancel.titlePlan": "Отменить тариф",+ "cloudCancel.runsTrial": "Пробный период действует до {date}.",+ "cloudCancel.runsPlan": "Тариф действует до {date}.",+ "cloudCancel.nothingCharged": "Если отменить сейчас, ничего не будет списано.",+ "cloudCancel.noMoreCharges": "Если отменить сейчас, больше ничего не будет списано.",+ "cloudCancel.teamStops": "Тогда облако {team} остановится для всех в команде.",+ "cloudCancel.question": "Перед уходом: какова главная причина?",+ "cloudCancel.answer.feature": "Не хватает функции",+ "cloudCancel.answer.price": "Слишком дорого",+ "cloudCancel.answer.setup": "Сложно настроить",+ "cloudCancel.answer.broken": "Работало не так, как ожидалось",+ "cloudCancel.answer.later": "Сейчас не пользуюсь",+ "cloudCancel.answer.other": "Другое",+ "cloudCancel.expected": "Чего вы ждали от MausBot?",+ "cloudCancel.improve": "Что мы могли сделать лучше?",+ "cloudCancel.optional": "(необязательно)",+ "cloudCancel.talk": "Хотите обсудить?",+ "cloudCancel.book": "Забронировать 30 минут с Milind",+ "cloudCancel.keep": "Оставить тариф",+ "cloudCancel.confirmTrial": "Отменить мой пробный период",+ "cloudCancel.confirmPlan": "Отменить мой тариф",+ "cloudCancel.cancelling": "Отменяем…",+ "cloudCancel.keeping": "Сохраняем…",+ "cloudCancel.endedTrial": "Отменено. Пробный период закончится {date}, и ничего не будет списано.",+ "cloudCancel.endedTrialNoDate": "Отменено. Когда пробный период закончится, ничего не будет списано.",+ "cloudCancel.endedPlan": "Отменено. Тариф закончится {date}. Больше ничего не будет списано.",+ "cloudCancel.endedPlanNoDate": "Отменено. Тариф закончится вместе с оплаченным периодом. Больше ничего не будет списано.",+ "cloudCancel.stops": "Тогда облако остановится.",+ "cloudCancel.keptDays": "Его файлы хранятся {days} дн., затем удаляются.",+ "cloudCancel.keptDay": "Его файлы хранятся 1 день, затем удаляются.",+ "cloudCancel.keptHours": "Его файлы хранятся {hours} ч, затем удаляются.",+ "cloudCancel.keptNone": "Его файлы удаляются при остановке.",+ "cloudCancel.thanks": "Спасибо. Milind и Omkar читают каждый ответ, и мы напишем вам, если это то, что мы можем сделать.",+ "cloudCancel.changedMind": "Передумали?",+ "cloudCancel.done": "Готово",+ "cloudCancel.close": "Закрыть",+ "cloudCancel.browser": "Раздел оплаты на странице облака открылся в браузере. Это можно сделать там.",+ "cloudCancel.failed": "Не получилось, ничего не изменилось. Попробуйте ещё раз через минуту.","cloudCredit.left": "Пробный кредит Claude: осталось {left} из {granted}. Боты в Cloud используют его, пока вы не войдёте там со своей учётной записью Claude или ChatGPT либо не добавите ключ API.","cloudCredit.usedUp": "Ваш пробный кредит Claude в размере {granted} израсходован. Чтобы боты продолжали работать, войдите в Cloud со своей учётной записью Claude или ChatGPT либо добавьте там ключ API.","engines.trialCredit": "Входит в ваш бесплатный пробный период. Боты в Cloud используют его, пока вы не войдёте со своей учётной записью Claude или ChatGPT либо не добавите ключ API.",diff --git a/src/locales/tr.json b/src/locales/tr.jsonindex ed12ac4bda..b081952f75 100644--- a/src/locales/tr.json+++ b/src/locales/tr.json@@ -439,6 +439,47 @@"cloudTrial.subscribe": "Saklamak için abone olun","cloudTrial.checkPayment": "Ödeme durumunu kontrol et","cloudTrial.ok": "Tamam",+ "cloudCancel.cancelTrial": "Denemeyi iptal et",+ "cloudCancel.cancelPlan": "Planı iptal et",+ "cloudCancel.titleTrial": "Denemenizi iptal edin",+ "cloudCancel.titlePlan": "Planınızı iptal edin",+ "cloudCancel.runsTrial": "Denemeniz {date} tarihine kadar sürer.",+ "cloudCancel.runsPlan": "Planınız {date} tarihine kadar sürer.",+ "cloudCancel.nothingCharged": "Şimdi iptal ederseniz hiçbir ücret alınmaz.",+ "cloudCancel.noMoreCharges": "Şimdi iptal ederseniz sizden bir daha ücret alınmaz.",+ "cloudCancel.teamStops": "{team} ekibinin Cloud'u o tarihte ekipteki herkes için durur.",+ "cloudCancel.question": "Gitmeden önce: asıl neden nedir?",+ "cloudCancel.answer.feature": "Bir özellik eksik",+ "cloudCancel.answer.price": "Çok pahalı",+ "cloudCancel.answer.setup": "Kurulumu zor",+ "cloudCancel.answer.broken": "Beklediğim gibi çalışmadı",+ "cloudCancel.answer.later": "Şu anda kullanmıyorum",+ "cloudCancel.answer.other": "Başka bir şey",+ "cloudCancel.expected": "MausBot'un ne yapmasını beklediniz?",+ "cloudCancel.improve": "Neyi daha iyi yapabilirdik?",+ "cloudCancel.optional": "(isteğe bağlı)",+ "cloudCancel.talk": "Konuşarak çözmek ister misiniz?",+ "cloudCancel.book": "Milind ile 30 dakikalık görüşme ayarlayın",+ "cloudCancel.keep": "Planımı koru",+ "cloudCancel.confirmTrial": "Denememi iptal et",+ "cloudCancel.confirmPlan": "Planımı iptal et",+ "cloudCancel.cancelling": "İptal ediliyor…",+ "cloudCancel.keeping": "Korunuyor…",+ "cloudCancel.endedTrial": "İptal edildi. Denemeniz {date} tarihinde sona eriyor ve hiçbir ücret alınmıyor.",+ "cloudCancel.endedTrialNoDate": "İptal edildi. Denemeniz bittiğinde hiçbir ücret alınmaz.",+ "cloudCancel.endedPlan": "İptal edildi. Planınız {date} tarihinde sona eriyor. Sizden bir daha ücret alınmaz.",+ "cloudCancel.endedPlanNoDate": "İptal edildi. Planınız ödediğiniz dönemin sonunda sona erer. Sizden bir daha ücret alınmaz.",+ "cloudCancel.stops": "Cloud o tarihte durur.",+ "cloudCancel.keptDays": "Dosyaları {days} gün saklanır, sonra silinir.",+ "cloudCancel.keptDay": "Dosyaları 1 gün saklanır, sonra silinir.",+ "cloudCancel.keptHours": "Dosyaları {hours} saat saklanır, sonra silinir.",+ "cloudCancel.keptNone": "Durduğunda dosyaları silinir.",+ "cloudCancel.thanks": "Teşekkürler. Milind ve Omkar her yanıtı okur; yapabileceğimiz bir şeyse size yazarız.",+ "cloudCancel.changedMind": "Fikrinizi mi değiştirdiniz?",+ "cloudCancel.done": "Tamam",+ "cloudCancel.close": "Kapat",+ "cloudCancel.browser": "Cloud sayfasının Faturalandırma bölümü tarayıcınızda açıldı. İşlemi orada yapabilirsiniz.",+ "cloudCancel.failed": "Bu işlem gerçekleşmedi ve hiçbir şey değişmedi. Bir dakika sonra tekrar deneyin.","cloudCredit.left": "Deneme Claude kredisi: {left} / {granted} kaldı. Cloud botları, orada kendi Claude veya ChatGPT hesabınızla giriş yapana ya da bir API anahtarı ekleyene kadar bu krediyi kullanır.","cloudCredit.usedUp": "{granted} deneme Claude krediniz tükendi. Botlarınızın çalışmaya devam etmesi için Cloud'da kendi Claude veya ChatGPT hesabınızla giriş yapın ya da orada bir API anahtarı ekleyin.","engines.trialCredit": "Ücretsiz denemenize dahildir. Cloud botları, kendi Claude veya ChatGPT hesabınızla giriş yapana ya da bir API anahtarı ekleyene kadar bu krediyi kullanır.",diff --git a/src/locales/uk.json b/src/locales/uk.jsonindex 8ca857d568..e31e86b3d9 100644--- a/src/locales/uk.json+++ b/src/locales/uk.json@@ -234,6 +234,47 @@"cloudTrial.subscribe": "Оформити підписку, щоб зберегти","cloudTrial.checkPayment": "Перевірити статус оплати","cloudTrial.ok": "OK",+ "cloudCancel.cancelTrial": "Скасувати пробний період",+ "cloudCancel.cancelPlan": "Скасувати тариф",+ "cloudCancel.titleTrial": "Скасувати пробний період",+ "cloudCancel.titlePlan": "Скасувати тариф",+ "cloudCancel.runsTrial": "Пробний період триває до {date}.",+ "cloudCancel.runsPlan": "Тариф діє до {date}.",+ "cloudCancel.nothingCharged": "Якщо скасувати зараз, нічого не буде списано.",+ "cloudCancel.noMoreCharges": "Якщо скасувати зараз, більше нічого не буде списано.",+ "cloudCancel.teamStops": "Тоді Cloud {team} зупиниться для всіх у команді.",+ "cloudCancel.question": "Перш ніж піти: яка головна причина?",+ "cloudCancel.answer.feature": "Бракує функції",+ "cloudCancel.answer.price": "Задорого",+ "cloudCancel.answer.setup": "Складно налаштувати",+ "cloudCancel.answer.broken": "Працювало не так, як очікувалося",+ "cloudCancel.answer.later": "Зараз не користуюся",+ "cloudCancel.answer.other": "Інше",+ "cloudCancel.expected": "Чого ви очікували від MausBot?",+ "cloudCancel.improve": "Що ми могли зробити краще?",+ "cloudCancel.optional": "(необов'язково)",+ "cloudCancel.talk": "Хочете обговорити?",+ "cloudCancel.book": "Забронювати 30 хвилин із Milind",+ "cloudCancel.keep": "Залишити мій тариф",+ "cloudCancel.confirmTrial": "Скасувати мій пробний період",+ "cloudCancel.confirmPlan": "Скасувати мій тариф",+ "cloudCancel.cancelling": "Скасовуємо…",+ "cloudCancel.keeping": "Зберігаємо…",+ "cloudCancel.endedTrial": "Скасовано. Пробний період закінчиться {date}, і нічого не буде списано.",+ "cloudCancel.endedTrialNoDate": "Скасовано. Коли пробний період закінчиться, нічого не буде списано.",+ "cloudCancel.endedPlan": "Скасовано. Тариф закінчиться {date}. Більше нічого не буде списано.",+ "cloudCancel.endedPlanNoDate": "Скасовано. Тариф закінчиться разом з оплаченим періодом. Більше нічого не буде списано.",+ "cloudCancel.stops": "Тоді Cloud зупиниться.",+ "cloudCancel.keptDays": "Його файли зберігаються {days} дн., потім видаляються.",+ "cloudCancel.keptDay": "Його файли зберігаються 1 день, потім видаляються.",+ "cloudCancel.keptHours": "Його файли зберігаються {hours} год, потім видаляються.",+ "cloudCancel.keptNone": "Його файли видаляються, коли він зупиняється.",+ "cloudCancel.thanks": "Дякуємо. Milind і Omkar читають кожну відповідь, і ми напишемо вам, якщо це те, що ми можемо зробити.",+ "cloudCancel.changedMind": "Передумали?",+ "cloudCancel.done": "Готово",+ "cloudCancel.close": "Закрити",+ "cloudCancel.browser": "Розділ оплати на сторінці Cloud відкрився у браузері. Це можна зробити там.",+ "cloudCancel.failed": "Не вдалося, нічого не змінилося. Спробуйте ще раз за хвилину.","cloudCredit.left": "Кредит Claude пробного періоду: залишилося {left} з {granted}. Боти в Cloud користуються ним, доки ви не ввійдете там у власний обліковий запис Claude чи ChatGPT або не додасте ключ API.","cloudCredit.usedUp": "Ваш кредит Claude пробного періоду ({granted}) вичерпано. Щоб боти працювали далі, увійдіть у власний обліковий запис Claude чи ChatGPT у Cloud або додайте там ключ API.","engines.trialCredit": "Входить у ваш безкоштовний період. Боти в Cloud користуються ним, доки ви не ввійдете у власний обліковий запис Claude чи ChatGPT або не додасте ключ API.",diff --git a/src/locales/vi.json b/src/locales/vi.jsonindex 45894d0cf6..a61add7f57 100644--- a/src/locales/vi.json+++ b/src/locales/vi.json@@ -439,6 +439,47 @@"cloudTrial.subscribe": "Đăng ký để tiếp tục sử dụng","cloudTrial.checkPayment": "Kiểm tra trạng thái thanh toán","cloudTrial.ok": "OK",+ "cloudCancel.cancelTrial": "Hủy dùng thử",+ "cloudCancel.cancelPlan": "Hủy gói",+ "cloudCancel.titleTrial": "Hủy gói dùng thử",+ "cloudCancel.titlePlan": "Hủy gói của bạn",+ "cloudCancel.runsTrial": "Gói dùng thử của bạn kéo dài đến {date}.",+ "cloudCancel.runsPlan": "Gói của bạn kéo dài đến {date}.",+ "cloudCancel.nothingCharged": "Nếu hủy bây giờ, bạn sẽ không bị tính phí.",+ "cloudCancel.noMoreCharges": "Nếu hủy bây giờ, bạn sẽ không bị tính phí thêm lần nào nữa.",+ "cloudCancel.teamStops": "Khi đó Cloud của {team} sẽ dừng với mọi người trong nhóm.",+ "cloudCancel.question": "Trước khi đi: lý do chính là gì?",+ "cloudCancel.answer.feature": "Thiếu một tính năng",+ "cloudCancel.answer.price": "Quá đắt",+ "cloudCancel.answer.setup": "Khó thiết lập",+ "cloudCancel.answer.broken": "Không hoạt động như tôi mong đợi",+ "cloudCancel.answer.later": "Hiện tôi không dùng",+ "cloudCancel.answer.other": "Lý do khác",+ "cloudCancel.expected": "Bạn mong MausBot làm được gì?",+ "cloudCancel.improve": "Chúng tôi có thể làm tốt hơn ở điểm nào?",+ "cloudCancel.optional": "(không bắt buộc)",+ "cloudCancel.talk": "Muốn trao đổi trực tiếp?",+ "cloudCancel.book": "Đặt lịch 30 phút với Milind",+ "cloudCancel.keep": "Giữ gói của tôi",+ "cloudCancel.confirmTrial": "Hủy gói dùng thử của tôi",+ "cloudCancel.confirmPlan": "Hủy gói của tôi",+ "cloudCancel.cancelling": "Đang hủy…",+ "cloudCancel.keeping": "Đang giữ lại…",+ "cloudCancel.endedTrial": "Đã hủy. Gói dùng thử của bạn kết thúc vào {date} và bạn không bị tính phí.",+ "cloudCancel.endedTrialNoDate": "Đã hủy. Bạn sẽ không bị tính phí khi gói dùng thử kết thúc.",+ "cloudCancel.endedPlan": "Đã hủy. Gói của bạn kết thúc vào {date}. Bạn sẽ không bị tính phí thêm.",+ "cloudCancel.endedPlanNoDate": "Đã hủy. Gói của bạn kết thúc cùng kỳ bạn đã trả tiền. Bạn sẽ không bị tính phí thêm.",+ "cloudCancel.stops": "Khi đó Cloud sẽ dừng.",+ "cloudCancel.keptDays": "Các tệp của nó được giữ {days} ngày, sau đó bị xóa.",+ "cloudCancel.keptDay": "Các tệp của nó được giữ 1 ngày, sau đó bị xóa.",+ "cloudCancel.keptHours": "Các tệp của nó được giữ {hours} giờ, sau đó bị xóa.",+ "cloudCancel.keptNone": "Các tệp của nó bị xóa khi nó dừng.",+ "cloudCancel.thanks": "Cảm ơn bạn. Milind và Omkar đọc mọi câu trả lời, và chúng tôi sẽ phản hồi nếu đó là điều chúng tôi có thể làm.",+ "cloudCancel.changedMind": "Bạn đổi ý?",+ "cloudCancel.done": "Xong",+ "cloudCancel.close": "Đóng",+ "cloudCancel.browser": "Mục Thanh toán trên trang Cloud đã mở trong trình duyệt. Bạn có thể làm việc đó ở đó.",+ "cloudCancel.failed": "Không thực hiện được và chưa có gì thay đổi. Hãy thử lại sau một phút.","cloudCredit.left": "Tín dụng Claude dùng thử: còn {left}/{granted}. Bot trên Cloud sẽ sử dụng khoản tín dụng này cho đến khi bạn đăng nhập vào đó bằng tài khoản Claude hoặc ChatGPT của mình, hoặc thêm khóa API.","cloudCredit.usedUp": "Khoản tín dụng Claude dùng thử {granted} của bạn đã hết. Để giữ cho bot tiếp tục hoạt động, hãy đăng nhập bằng tài khoản Claude hoặc ChatGPT của chính mình trên Cloud, hoặc thêm khóa API ở đó.","engines.trialCredit": "Được bao gồm trong gói dùng thử miễn phí của bạn. Bot trên Cloud sẽ sử dụng khoản tín dụng này cho đến khi bạn đăng nhập bằng tài khoản Claude hoặc ChatGPT của chính mình, hoặc thêm khóa API.",diff --git a/src/locales/zh-tw.json b/src/locales/zh-tw.jsonindex f8046582e5..f3c3c160bd 100644--- a/src/locales/zh-tw.json+++ b/src/locales/zh-tw.json@@ -404,6 +404,47 @@"cloudTrial.subscribe": "訂閱以保留","cloudTrial.checkPayment": "查看付款狀態","cloudTrial.ok": "確定",+ "cloudCancel.cancelTrial": "取消試用",+ "cloudCancel.cancelPlan": "取消方案",+ "cloudCancel.titleTrial": "取消試用",+ "cloudCancel.titlePlan": "取消方案",+ "cloudCancel.runsTrial": "你的試用將持續到 {date}。",+ "cloudCancel.runsPlan": "你的方案將持續到 {date}。",+ "cloudCancel.nothingCharged": "現在取消,不會產生任何費用。",+ "cloudCancel.noMoreCharges": "現在取消,之後不會再向你收費。",+ "cloudCancel.teamStops": "屆時 {team} 的 Cloud 會為團隊中的所有人停止。",+ "cloudCancel.question": "離開前:主要原因是什麼?",+ "cloudCancel.answer.feature": "缺少需要的功能",+ "cloudCancel.answer.price": "太貴了",+ "cloudCancel.answer.setup": "設定太難",+ "cloudCancel.answer.broken": "沒有如預期運作",+ "cloudCancel.answer.later": "暫時用不到",+ "cloudCancel.answer.other": "其他原因",+ "cloudCancel.expected": "你希望 MausBot 能做什麼?",+ "cloudCancel.improve": "我們原本可以在哪些地方做得更好?",+ "cloudCancel.optional": "(選填)",+ "cloudCancel.talk": "想直接聊聊?",+ "cloudCancel.book": "預約與 Milind 通話 30 分鐘",+ "cloudCancel.keep": "保留我的方案",+ "cloudCancel.confirmTrial": "取消我的試用",+ "cloudCancel.confirmPlan": "取消我的方案",+ "cloudCancel.cancelling": "正在取消…",+ "cloudCancel.keeping": "正在保留…",+ "cloudCancel.endedTrial": "已取消。你的試用將於 {date} 結束,不會產生任何費用。",+ "cloudCancel.endedTrialNoDate": "已取消。試用結束時不會產生任何費用。",+ "cloudCancel.endedPlan": "已取消。你的方案將於 {date} 結束。之後不會再向你收費。",+ "cloudCancel.endedPlanNoDate": "已取消。你的方案將在已付費期間結束時結束。之後不會再向你收費。",+ "cloudCancel.stops": "屆時 Cloud 會停止。",+ "cloudCancel.keptDays": "其檔案會保留 {days} 天,然後刪除。",+ "cloudCancel.keptDay": "其檔案會保留 1 天,然後刪除。",+ "cloudCancel.keptHours": "其檔案會保留 {hours} 小時,然後刪除。",+ "cloudCancel.keptNone": "它停止時其檔案會被刪除。",+ "cloudCancel.thanks": "謝謝。Milind 和 Omkar 會閱讀每一則回覆,如果是我們能做的,我們會回信給你。",+ "cloudCancel.changedMind": "改變主意了?",+ "cloudCancel.done": "完成",+ "cloudCancel.close": "關閉",+ "cloudCancel.browser": "已在瀏覽器中開啟 Cloud 頁面的帳單。你可以在那裡操作。",+ "cloudCancel.failed": "操作未完成,也沒有任何變更。請一分鐘後再試。","cloudCredit.left": "試用 Claude 額度:{granted} 中剩餘 {left}。在你於 Cloud 上登入自己的 Claude 或 ChatGPT 帳戶,或新增 API 金鑰之前,Cloud 上的機器人會使用這筆額度。","cloudCredit.usedUp": "你的 {granted} 試用 Claude 額度已用完。若要讓機器人繼續工作,請在 Cloud 上登入你自己的 Claude 或 ChatGPT 帳戶,或在那裡新增 API 金鑰。","engines.trialCredit": "包含在你的免費試用中。在你登入自己的 Claude 或 ChatGPT 帳戶,或新增 API 金鑰之前,Cloud 上的機器人會使用這筆額度。",diff --git a/src/locales/zh.json b/src/locales/zh.jsonindex 5f05666900..cd913f4758 100644--- a/src/locales/zh.json+++ b/src/locales/zh.json@@ -291,6 +291,47 @@"cloudTrial.subscribe": "订阅以保留","cloudTrial.checkPayment": "查看付款状态","cloudTrial.ok": "确定",+ "cloudCancel.cancelTrial": "取消试用",+ "cloudCancel.cancelPlan": "取消方案",+ "cloudCancel.titleTrial": "取消试用",+ "cloudCancel.titlePlan": "取消方案",+ "cloudCancel.runsTrial": "你的试用将持续到 {date}。",+ "cloudCancel.runsPlan": "你的方案将持续到 {date}。",+ "cloudCancel.nothingCharged": "现在取消,不会产生任何费用。",+ "cloudCancel.noMoreCharges": "现在取消,之后不会再向你收费。",+ "cloudCancel.teamStops": "届时 {team} 的 Cloud 会为团队中的所有人停止。",+ "cloudCancel.question": "离开前:主要原因是什么?",+ "cloudCancel.answer.feature": "缺少需要的功能",+ "cloudCancel.answer.price": "太贵了",+ "cloudCancel.answer.setup": "设置太难",+ "cloudCancel.answer.broken": "没有按预期工作",+ "cloudCancel.answer.later": "暂时用不上",+ "cloudCancel.answer.other": "其他原因",+ "cloudCancel.expected": "你希望 MausBot 能做什么?",+ "cloudCancel.improve": "我们本可以在哪些方面做得更好?",+ "cloudCancel.optional": "(可选)",+ "cloudCancel.talk": "想直接聊聊?",+ "cloudCancel.book": "预约与 Milind 通话 30 分钟",+ "cloudCancel.keep": "保留我的方案",+ "cloudCancel.confirmTrial": "取消我的试用",+ "cloudCancel.confirmPlan": "取消我的方案",+ "cloudCancel.cancelling": "正在取消…",+ "cloudCancel.keeping": "正在保留…",+ "cloudCancel.endedTrial": "已取消。你的试用将于 {date} 结束,不会产生任何费用。",+ "cloudCancel.endedTrialNoDate": "已取消。试用结束时不会产生任何费用。",+ "cloudCancel.endedPlan": "已取消。你的方案将于 {date} 结束。之后不会再向你收费。",+ "cloudCancel.endedPlanNoDate": "已取消。你的方案将在已付费周期结束时结束。之后不会再向你收费。",+ "cloudCancel.stops": "届时 Cloud 会停止。",+ "cloudCancel.keptDays": "其文件会保留 {days} 天,然后删除。",+ "cloudCancel.keptDay": "其文件会保留 1 天,然后删除。",+ "cloudCancel.keptHours": "其文件会保留 {hours} 小时,然后删除。",+ "cloudCancel.keptNone": "它停止时其文件会被删除。",+ "cloudCancel.thanks": "谢谢。Milind 和 Omkar 会阅读每一条回复,如果是我们能做的,我们会回信给你。",+ "cloudCancel.changedMind": "改变主意了?",+ "cloudCancel.done": "完成",+ "cloudCancel.close": "关闭",+ "cloudCancel.browser": "已在浏览器中打开 Cloud 页面的账单。你可以在那里操作。",+ "cloudCancel.failed": "操作未完成,也没有任何更改。请一分钟后再试。","cloudCredit.left": "试用 Claude 额度:{granted} 中剩余 {left}。在你于 Cloud 上登录自己的 Claude 或 ChatGPT 账号,或添加 API 密钥之前,Cloud 上的机器人会使用这笔额度。","cloudCredit.usedUp": "你的 {granted} 试用 Claude 额度已用完。如需让机器人继续工作,请在 Cloud 上登录你自己的 Claude 或 ChatGPT 账号,或在那里添加 API 密钥。","engines.trialCredit": "包含在你的免费试用中。在你登录自己的 Claude 或 ChatGPT 账号,或添加 API 密钥之前,Cloud 上的机器人会使用这笔额度。",