agentmast 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +15 -15
- package/dist/{bot-PIWTZVU6.js → bot-HTAE3OOZ.js} +5 -5
- package/dist/{bus-NKXT3JWW.js → bus-6EDCL6C2.js} +1 -1
- package/dist/{chunk-IU75ISXR.js → chunk-SNKD4OK2.js} +2 -2
- package/dist/{chunk-WBDMHW7H.js → chunk-UZGN4SDK.js} +2 -2
- package/dist/{chunk-VDPOIHPJ.js → chunk-XFF5UE5F.js} +1 -1
- package/dist/{config-OOQXKXZZ.js → config-MJRV3XTY.js} +2 -2
- package/dist/{hook-transport-RLSLV56I.js → hook-transport-RECZISPK.js} +2 -2
- package/dist/hook.js +2 -2
- package/dist/{hooks-AALI75O7.js → hooks-GYQZJCWH.js} +3 -3
- package/dist/{local-state-4SIAMX2F.js → local-state-K2T7BJTT.js} +1 -1
- package/dist/{pairing-SAMT2H37.js → pairing-RQBLIMDP.js} +5 -5
- package/dist/{server-XMPT35QI.js → server-NJK23UFH.js} +1 -1
- package/dist/web/assets/{index-DXwpAjuO.js → index-CiSHj7dg.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -5,7 +5,7 @@ import { spawn } from "child_process";
|
|
|
5
5
|
import { existsSync } from "fs";
|
|
6
6
|
import { dirname, join, resolve } from "path";
|
|
7
7
|
import { fileURLToPath } from "url";
|
|
8
|
-
var VERSION = "0.1.
|
|
8
|
+
var VERSION = "0.1.1";
|
|
9
9
|
var here = dirname(fileURLToPath(import.meta.url));
|
|
10
10
|
function parseArgs(argv) {
|
|
11
11
|
const [cmd2 = "help", ...rest] = argv;
|
|
@@ -39,14 +39,14 @@ function openBrowser(url) {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
var banner = (url, extra = "") => console.log(`
|
|
42
|
-
\u25A3
|
|
42
|
+
\u25A3 AgentMast v${VERSION}${extra}
|
|
43
43
|
\u279C ${url}
|
|
44
44
|
`);
|
|
45
45
|
async function cmdUp(flags2) {
|
|
46
46
|
const [{ Bus }, { startServer }, { DEFAULT_PORT, loadOrCreateToken, stateDir, writeAtomically }] = await Promise.all([
|
|
47
|
-
import("./bus-
|
|
48
|
-
import("./server-
|
|
49
|
-
import("./local-state-
|
|
47
|
+
import("./bus-6EDCL6C2.js"),
|
|
48
|
+
import("./server-NJK23UFH.js"),
|
|
49
|
+
import("./local-state-K2T7BJTT.js")
|
|
50
50
|
]);
|
|
51
51
|
const port = Number(flags2.port ?? DEFAULT_PORT);
|
|
52
52
|
if (flags2.port === true || !Number.isInteger(port) || port < 0 || port > 65535) throw new Error("Invalid port");
|
|
@@ -64,15 +64,15 @@ async function cmdUp(flags2) {
|
|
|
64
64
|
}
|
|
65
65
|
banner(srv.url, " \u2014 live mode");
|
|
66
66
|
if (!flags2["no-open"]) openBrowser(srv.url);
|
|
67
|
-
void import("./config-
|
|
67
|
+
void import("./config-MJRV3XTY.js").then(async ({ loadTelegramConfig }) => {
|
|
68
68
|
const telegram = loadTelegramConfig();
|
|
69
|
-
if (telegram) await (await import("./bot-
|
|
69
|
+
if (telegram) await (await import("./bot-HTAE3OOZ.js")).runTelegram(telegram, bus);
|
|
70
70
|
}).catch((error) => console.warn(error instanceof Error ? error.message : "Telegram integration stopped."));
|
|
71
71
|
}
|
|
72
72
|
async function cmdDemo(flags2) {
|
|
73
73
|
const [{ Bus }, { startServer }, { ScenarioPlayer }, { scenarios }] = await Promise.all([
|
|
74
|
-
import("./bus-
|
|
75
|
-
import("./server-
|
|
74
|
+
import("./bus-6EDCL6C2.js"),
|
|
75
|
+
import("./server-NJK23UFH.js"),
|
|
76
76
|
import("./replay-4LHZWBSJ.js"),
|
|
77
77
|
import("./video-RJZII4N6.js")
|
|
78
78
|
]);
|
|
@@ -103,21 +103,21 @@ async function cmdDemo(flags2) {
|
|
|
103
103
|
if (!flags2["no-open"]) openBrowser(srv.url);
|
|
104
104
|
}
|
|
105
105
|
async function cmdHooks(flags2, install) {
|
|
106
|
-
const { updateClaudeHooks, updateCodexHooks, updateZCodeHooks, updateAntigravityHooks } = await import("./hooks-
|
|
106
|
+
const { updateClaudeHooks, updateCodexHooks, updateZCodeHooks, updateAntigravityHooks } = await import("./hooks-GYQZJCWH.js");
|
|
107
107
|
const installers = { codex: updateCodexHooks, zcode: updateZCodeHooks, antigravity: updateAntigravityHooks };
|
|
108
108
|
const selected = Object.keys(installers).filter((provider2) => flags2[provider2]);
|
|
109
109
|
if (selected.length > 1) throw new Error("Choose one hook provider per command.");
|
|
110
110
|
const provider = selected[0];
|
|
111
111
|
const hookPath = install ? [join(here, "hook.js"), resolve(here, "../dist/hook.js")].find((path) => existsSync(path)) : void 0;
|
|
112
|
-
if (install && !hookPath) throw new Error("
|
|
112
|
+
if (install && !hookPath) throw new Error("AgentMast hook executable is missing. Run npm run build first.");
|
|
113
113
|
const update = provider ? installers[provider] : updateClaudeHooks;
|
|
114
114
|
console.log(update(Boolean(flags2.project), hookPath));
|
|
115
|
-
if (install && provider === "codex") console.log("Open /hooks in a new Codex session to review and trust the
|
|
115
|
+
if (install && provider === "codex") console.log("Open /hooks in a new Codex session to review and trust the AgentMast hooks.");
|
|
116
116
|
if (install && provider === "zcode") console.log("Check Settings \u2192 Hooks in ZCode and review workspace hooks before starting a new session.");
|
|
117
117
|
if (install && provider === "antigravity") console.log("Start a new Antigravity conversation. Use /hooks in the CLI to check the installed hooks.");
|
|
118
118
|
}
|
|
119
119
|
function help() {
|
|
120
|
-
console.log(`
|
|
120
|
+
console.log(`AgentMast v${VERSION}
|
|
121
121
|
|
|
122
122
|
Usage:
|
|
123
123
|
agentmast demo [--scenario video] [--loop] [--speed 1] [--delay 1.5] [--port 7788] [--no-open]
|
|
@@ -137,9 +137,9 @@ var commands = {
|
|
|
137
137
|
"uninstall-hooks": () => cmdHooks(flags, false),
|
|
138
138
|
telegram: async () => {
|
|
139
139
|
if (positional[0] !== "setup") return help();
|
|
140
|
-
await (await import("./pairing-
|
|
140
|
+
await (await import("./pairing-RQBLIMDP.js")).setupTelegram();
|
|
141
141
|
},
|
|
142
|
-
hook: async () => (await import("./hook-transport-
|
|
142
|
+
hook: async () => (await import("./hook-transport-RECZISPK.js")).runHook(positional),
|
|
143
143
|
help,
|
|
144
144
|
"--help": help,
|
|
145
145
|
"-h": help,
|
|
@@ -46,7 +46,7 @@ function resultText(item) {
|
|
|
46
46
|
}
|
|
47
47
|
function renderApprovals(header, items) {
|
|
48
48
|
const text = items.map((item) => {
|
|
49
|
-
const body = item.actionable ? item.fullText : "Open
|
|
49
|
+
const body = item.actionable ? item.fullText : "Open AgentMast to review the complete permission request.";
|
|
50
50
|
return `${body}
|
|
51
51
|
${resultText(item)}`;
|
|
52
52
|
});
|
|
@@ -118,11 +118,11 @@ function installTelegramApprovals(bot, config, bus, report = console.warn) {
|
|
|
118
118
|
if (request.risk === "low" || pending.has(request.id) || request.expiresAt <= Date.now()) return;
|
|
119
119
|
const session = bus.snapshot().sessions.find((item2) => item2.id === request.sessionId);
|
|
120
120
|
const title = session?.title ?? request.sessionId;
|
|
121
|
-
const fullHeader = `
|
|
121
|
+
const fullHeader = `AgentMast \xB7 ${title}${session?.cwd ? `
|
|
122
122
|
${session.cwd}` : ""}`;
|
|
123
123
|
const fullText = approvalText(request);
|
|
124
124
|
const actionable = fullText !== void 0 && /^[\w-]+$/.test(request.id) && Buffer.byteLength(`a:${request.id}:approve`) <= 64 && fullHeader.length + fullText.length + 100 <= MESSAGE_BUDGET;
|
|
125
|
-
const header = actionable ? fullHeader : `
|
|
125
|
+
const header = actionable ? fullHeader : `AgentMast \xB7 ${title.slice(0, 120)}`;
|
|
126
126
|
const item = { request, fullText: fullText ?? "", actionable };
|
|
127
127
|
let group = active.get(request.sessionId);
|
|
128
128
|
if (!group || group.header !== header || request.createdAt - group.createdAt > 1e4 || group.items.every((entry) => entry.decision) || renderApprovals(group.header, [...group.items, item]).text.length + (group.items.length + 1) * 80 > MESSAGE_BUDGET) {
|
|
@@ -150,7 +150,7 @@ ${session.cwd}` : ""}`;
|
|
|
150
150
|
else report("Ignored an update from an unpaired Telegram chat.");
|
|
151
151
|
});
|
|
152
152
|
bot.command("start", async (ctx) => {
|
|
153
|
-
if (!ctx.match.trim()) await ctx.reply("
|
|
153
|
+
if (!ctx.match.trim()) await ctx.reply("AgentMast is paired to this chat. New approval requests will appear here.");
|
|
154
154
|
});
|
|
155
155
|
bot.callbackQuery(/^a:([\w-]+):(approve|reject|reply)$/, async (ctx) => {
|
|
156
156
|
const [, approvalId, action] = ctx.match;
|
|
@@ -162,7 +162,7 @@ ${session.cwd}` : ""}`;
|
|
|
162
162
|
}
|
|
163
163
|
if (action === "reply") {
|
|
164
164
|
const alreadyPrompted = [...replies.values()].includes(approvalId);
|
|
165
|
-
await ctx.answerCallbackQuery(alreadyPrompted ? "Reply to the existing
|
|
165
|
+
await ctx.answerCallbackQuery(alreadyPrompted ? "Reply to the existing AgentMast prompt." : "Send a reply to AgentMast.");
|
|
166
166
|
if (!alreadyPrompted) {
|
|
167
167
|
const prompt = await ctx.reply("Reply with feedback. This will decline the current request and send your reason to the agent.", {
|
|
168
168
|
reply_markup: { force_reply: true, input_field_placeholder: "Tell the agent what to change" },
|
|
@@ -9,7 +9,7 @@ var DEFAULT_PORT = 7788;
|
|
|
9
9
|
var stateDir = () => resolve(process.env.AGENTDECK_STATE_DIR || join(homedir(), ".agentdeck"));
|
|
10
10
|
function readToken() {
|
|
11
11
|
const token = readFileSync(join(stateDir(), "token"), "utf8").trim();
|
|
12
|
-
if (!/^[a-f0-9]{64}$/.test(token)) throw new Error("Invalid
|
|
12
|
+
if (!/^[a-f0-9]{64}$/.test(token)) throw new Error("Invalid AgentMast token");
|
|
13
13
|
return token;
|
|
14
14
|
}
|
|
15
15
|
function temporaryFile(path, contents, mode) {
|
|
@@ -53,7 +53,7 @@ function readDaemonPort() {
|
|
|
53
53
|
if (error.code === "ENOENT") return DEFAULT_PORT;
|
|
54
54
|
throw error;
|
|
55
55
|
}
|
|
56
|
-
if (!Number.isInteger(port) || port < 1 || port > 65535) throw new Error("Invalid
|
|
56
|
+
if (!Number.isInteger(port) || port < 1 || port > 65535) throw new Error("Invalid AgentMast port");
|
|
57
57
|
return port;
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
readDaemonPort,
|
|
16
16
|
readToken
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-SNKD4OK2.js";
|
|
18
18
|
import {
|
|
19
19
|
MAX_APPROVAL_REPLY_LENGTH
|
|
20
20
|
} from "./chunk-LOCISTVR.js";
|
|
@@ -64,7 +64,7 @@ function nativePermissionOutput(value) {
|
|
|
64
64
|
const { approvalId, action, by, text } = value;
|
|
65
65
|
if (typeof approvalId !== "string" || !approvalId || by !== "web" && by !== "telegram") return;
|
|
66
66
|
const reply = typeof text === "string" && text.length <= MAX_APPROVAL_REPLY_LENGTH ? text.trim() : "";
|
|
67
|
-
const decision = action === "approve" ? { behavior: "allow" } : action === "reject" ? { behavior: "deny", message: "Rejected in
|
|
67
|
+
const decision = action === "approve" ? { behavior: "allow" } : action === "reject" ? { behavior: "deny", message: "Rejected in AgentMast." } : action === "reply" && reply ? { behavior: "deny", message: reply } : void 0;
|
|
68
68
|
if (decision) return { hookSpecificOutput: { hookEventName: "PermissionRequest", decision } };
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
runHook
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UZGN4SDK.js";
|
|
5
5
|
import "./chunk-FRKDGPVA.js";
|
|
6
6
|
import "./chunk-QCSXSHRA.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-SNKD4OK2.js";
|
|
8
8
|
import "./chunk-LOCISTVR.js";
|
|
9
9
|
export {
|
|
10
10
|
runHook
|
package/dist/hook.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
runHook
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UZGN4SDK.js";
|
|
5
5
|
import "./chunk-FRKDGPVA.js";
|
|
6
6
|
import "./chunk-QCSXSHRA.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-SNKD4OK2.js";
|
|
8
8
|
import "./chunk-LOCISTVR.js";
|
|
9
9
|
|
|
10
10
|
// src/hook-entry.ts
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-QCSXSHRA.js";
|
|
12
12
|
import {
|
|
13
13
|
writeAtomically
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-SNKD4OK2.js";
|
|
15
15
|
|
|
16
16
|
// src/install/hooks.ts
|
|
17
17
|
import { execFileSync } from "child_process";
|
|
@@ -204,7 +204,7 @@ function updateHooks(source, settingsPath, hookPath) {
|
|
|
204
204
|
const original = backup && backup.toString("utf8") !== "null\n" ? parseSettings(backup, backupPath) : void 0;
|
|
205
205
|
const { next, hadManaged } = editHooks(source, settings, hookPath, original);
|
|
206
206
|
if (!hookPath && !hadManaged || isDeepStrictEqual(settings, next)) {
|
|
207
|
-
return hookPath ? `
|
|
207
|
+
return hookPath ? `AgentMast hooks are already installed in ${settingsPath}` : `No AgentMast hooks found in ${settingsPath}`;
|
|
208
208
|
}
|
|
209
209
|
if (hookPath && !hadManaged) {
|
|
210
210
|
mkdirSync(dirname(settingsPath), { recursive: true, mode: 448 });
|
|
@@ -221,7 +221,7 @@ function updateHooks(source, settingsPath, hookPath) {
|
|
|
221
221
|
`;
|
|
222
222
|
writeAtomically(target, contents, before ? statSync(target).mode & 511 : 384);
|
|
223
223
|
}
|
|
224
|
-
return hookPath ? `Installed
|
|
224
|
+
return hookPath ? `Installed AgentMast hooks in ${settingsPath}` : `Removed AgentMast hooks from ${settingsPath}`;
|
|
225
225
|
}
|
|
226
226
|
export {
|
|
227
227
|
updateAntigravityHooks,
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
loadTelegramConfig,
|
|
4
4
|
saveTelegramConfig,
|
|
5
5
|
validBotToken
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-XFF5UE5F.js";
|
|
7
|
+
import "./chunk-SNKD4OK2.js";
|
|
8
8
|
import {
|
|
9
9
|
botApiSignal,
|
|
10
10
|
createTelegramBot,
|
|
@@ -30,11 +30,11 @@ function installPairing(bot, code, startsAt, finish) {
|
|
|
30
30
|
}
|
|
31
31
|
const supplied = ctx.match.trim();
|
|
32
32
|
if (!supplied) {
|
|
33
|
-
await ctx.reply("Send /start followed by the pairing code shown in your
|
|
33
|
+
await ctx.reply("Send /start followed by the pairing code shown in your AgentMast terminal.");
|
|
34
34
|
} else if (supplied === code) {
|
|
35
35
|
completed = true;
|
|
36
36
|
const saved = finish({ chatId: ctx.chat.id, userId: ctx.from.id });
|
|
37
|
-
await ctx.reply(saved ? "
|
|
37
|
+
await ctx.reply(saved ? "AgentMast paired. Approval requests will appear in this chat when AgentMast is running." : "AgentMast could not save this pairing.");
|
|
38
38
|
} else {
|
|
39
39
|
attempts++;
|
|
40
40
|
completed = attempts >= MAX_ATTEMPTS;
|
|
@@ -106,7 +106,7 @@ async function setupTelegram() {
|
|
|
106
106
|
await pollTelegram(bot, ["message"], controller.signal, console.warn);
|
|
107
107
|
if (storageError) throw new Error("Could not save the Telegram pairing.");
|
|
108
108
|
if (!paired) throw new Error("Pairing ended. Run agentmast telegram setup for a new code.");
|
|
109
|
-
console.log("Telegram paired. Start
|
|
109
|
+
console.log("Telegram paired. Start AgentMast with agentmast up.");
|
|
110
110
|
} finally {
|
|
111
111
|
clearTimeout(expire);
|
|
112
112
|
process.removeListener("SIGINT", interrupt);
|
|
@@ -413,7 +413,7 @@ function startServer(opts) {
|
|
|
413
413
|
const dir = opts.webDir;
|
|
414
414
|
if (!dir || !existsSync(join(dir, "index.html"))) {
|
|
415
415
|
res.writeHead(200, { "content-type": "text/plain; charset=utf-8" });
|
|
416
|
-
return res.end("
|
|
416
|
+
return res.end("AgentMast daemon is running. Web UI not built \u2014 run `npm run build`, or use the Vite dev server.");
|
|
417
417
|
}
|
|
418
418
|
const safe = normalize(decodeURIComponent(path)).replace(/^(\.\.[/\\])+/, "");
|
|
419
419
|
let file = join(dir, safe);
|
|
@@ -45,4 +45,4 @@ Error generating stack: `+c.message+`
|
|
|
45
45
|
top: ${m}px !important;
|
|
46
46
|
left: ${g}px !important;
|
|
47
47
|
}
|
|
48
|
-
`),()=>{document.head.removeChild(y)}},[i]),v.jsx(wy,{isPresent:i,childRef:l,sizeRef:u,children:F.cloneElement(n,{ref:l})})}const ky=({children:n,initial:i,isPresent:s,onExitComplete:l,custom:u,presenceAffectsLayout:f,mode:d})=>{const h=Zs(Ty),m=F.useId(),g=F.useCallback(w=>{h.set(w,!0);for(const k of h.values())if(!k)return;l&&l()},[h,l]),y=F.useMemo(()=>({id:m,initial:i,isPresent:s,custom:u,onExitComplete:g,register:w=>(h.set(w,!1),()=>h.delete(w))}),f?[Math.random(),g]:[s,g]);return F.useMemo(()=>{h.forEach((w,k)=>h.set(k,!1))},[s]),F.useEffect(()=>{!s&&!h.size&&l&&l()},[s]),d==="popLayout"&&(n=v.jsx(Sy,{isPresent:s,children:n})),v.jsx(qs.Provider,{value:y,children:n})};function Ty(){return new Map}function zh(n=!0){const i=F.useContext(qs);if(i===null)return[!0,null];const{isPresent:s,onExitComplete:l,register:u}=i,f=F.useId();F.useEffect(()=>{n&&u(f)},[n]);const d=F.useCallback(()=>n&&l&&l(f),[f,l,n]);return!s&&l?[!1,d]:[!0]}const Vs=n=>n.key||"";function yf(n){const i=[];return F.Children.forEach(n,s=>{F.isValidElement(s)&&i.push(s)}),i}const _a=typeof window<"u",Fh=_a?F.useLayoutEffect:F.useEffect,Fn=({children:n,custom:i,initial:s=!0,onExitComplete:l,presenceAffectsLayout:u=!0,mode:f="sync",propagate:d=!1})=>{const[h,m]=zh(d),g=F.useMemo(()=>yf(n),[n]),y=d&&!h?[]:g.map(Vs),w=F.useRef(!0),k=F.useRef(g),R=Zs(()=>new Map),[A,j]=F.useState(g),[M,D]=F.useState(g);Fh(()=>{w.current=!1,k.current=g;for(let Q=0;Q<M.length;Q++){const U=Vs(M[Q]);y.includes(U)?R.delete(U):R.get(U)!==!0&&R.set(U,!1)}},[M,y.length,y.join("-")]);const O=[];if(g!==A){let Q=[...g];for(let U=0;U<M.length;U++){const X=M[U],re=Vs(X);y.includes(re)||(Q.splice(U,0,X),O.push(X))}f==="wait"&&O.length&&(Q=O),D(yf(Q)),j(g);return}const{forceRender:$}=F.useContext(La);return v.jsx(v.Fragment,{children:M.map(Q=>{const U=Vs(Q),X=d&&!h?!1:g===M||y.includes(U),re=()=>{if(R.has(U))R.set(U,!0);else return;let Z=!0;R.forEach(ge=>{ge||(Z=!1)}),Z&&($==null||$(),D(k.current),d&&(m==null||m()),l&&l())};return v.jsx(ky,{isPresent:X,initial:!w.current||s?void 0:!1,custom:X?void 0:i,presenceAffectsLayout:u,mode:f,onExitComplete:X?void 0:re,children:Q},U)})})},dt=n=>n;let Ih=dt;const Py={useManualTiming:!1};function Cy(n){let i=new Set,s=new Set,l=!1,u=!1;const f=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function h(g){f.has(g)&&(m.schedule(g),n()),g(d)}const m={schedule:(g,y=!1,w=!1)=>{const R=w&&l?i:s;return y&&f.add(g),R.has(g)||R.add(g),g},cancel:g=>{s.delete(g),f.delete(g)},process:g=>{if(d=g,l){u=!0;return}l=!0,[i,s]=[s,i],i.forEach(h),i.clear(),l=!1,u&&(u=!1,m.process(g))}};return m}const zs=["read","resolveKeyframes","update","preRender","render","postRender"],Ey=40;function Oh(n,i){let s=!1,l=!0;const u={delta:0,timestamp:0,isProcessing:!1},f=()=>s=!0,d=zs.reduce((D,O)=>(D[O]=Cy(f),D),{}),{read:h,resolveKeyframes:m,update:g,preRender:y,render:w,postRender:k}=d,R=()=>{const D=performance.now();s=!1,u.delta=l?1e3/60:Math.max(Math.min(D-u.timestamp,Ey),1),u.timestamp=D,u.isProcessing=!0,h.process(u),m.process(u),g.process(u),y.process(u),w.process(u),k.process(u),u.isProcessing=!1,s&&i&&(l=!1,n(R))},A=()=>{s=!0,l=!0,u.isProcessing||n(R)};return{schedule:zs.reduce((D,O)=>{const $=d[O];return D[O]=(Q,U=!1,X=!1)=>(s||A(),$.schedule(Q,U,X)),D},{}),cancel:D=>{for(let O=0;O<zs.length;O++)d[zs[O]].cancel(D)},state:u,steps:d}}const{schedule:xe,cancel:gn,state:Be,steps:ra}=Oh(typeof requestAnimationFrame<"u"?requestAnimationFrame:dt,!0),Bh=F.createContext({strict:!1}),vf={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},mr={};for(const n in vf)mr[n]={isEnabled:i=>vf[n].some(s=>!!i[s])};function jy(n){for(const i in n)mr[i]={...mr[i],...n[i]}}const Ny=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function $s(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||Ny.has(n)}let Uh=n=>!$s(n);function $h(n){n&&(Uh=i=>i.startsWith("on")?!$s(i):n(i))}try{$h(require("@emotion/is-prop-valid").default)}catch{}function Ry(n,i,s){const l={};for(const u in n)u==="values"&&typeof n.values=="object"||(Uh(u)||s===!0&&$s(u)||!i&&!$s(u)||n.draggable&&u.startsWith("onDrag"))&&(l[u]=n[u]);return l}function Ay({children:n,isValidProp:i,...s}){i&&$h(i),s={...F.useContext(pi),...s},s.isStatic=Zs(()=>s.isStatic);const l=F.useMemo(()=>s,[JSON.stringify(s.transition),s.transformPagePoint,s.reducedMotion]);return v.jsx(pi.Provider,{value:l,children:n})}function My(n){if(typeof Proxy>"u")return n;const i=new Map,s=(...l)=>n(...l);return new Proxy(s,{get:(l,u)=>u==="create"?n:(i.has(u)||i.set(u,n(u)),i.get(u))})}const Js=F.createContext({});function mi(n){return typeof n=="string"||Array.isArray(n)}function eo(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const Va=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],za=["initial",...Va];function to(n){return eo(n.animate)||za.some(i=>mi(n[i]))}function Wh(n){return!!(to(n)||n.variants)}function Dy(n,i){if(to(n)){const{initial:s,animate:l}=n;return{initial:s===!1||mi(s)?s:void 0,animate:mi(l)?l:void 0}}return n.inherit!==!1?i:{}}function Ly(n){const{initial:i,animate:s}=Dy(n,F.useContext(Js));return F.useMemo(()=>({initial:i,animate:s}),[xf(i),xf(s)])}function xf(n){return Array.isArray(n)?n.join(" "):n}const _y=Symbol.for("motionComponentSymbol");function cr(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function Vy(n,i,s){return F.useCallback(l=>{l&&n.onMount&&n.onMount(l),i&&(l?i.mount(l):i.unmount()),s&&(typeof s=="function"?s(l):cr(s)&&(s.current=l))},[i])}const Fa=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),zy="framerAppearId",bh="data-"+Fa(zy),{schedule:Ia}=Oh(queueMicrotask,!1),Hh=F.createContext({});function Fy(n,i,s,l,u){var f,d;const{visualElement:h}=F.useContext(Js),m=F.useContext(Bh),g=F.useContext(qs),y=F.useContext(pi).reducedMotion,w=F.useRef(null);l=l||m.renderer,!w.current&&l&&(w.current=l(n,{visualState:i,parent:h,props:s,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:y}));const k=w.current,R=F.useContext(Hh);k&&!k.projection&&u&&(k.type==="html"||k.type==="svg")&&Iy(w.current,s,u,R);const A=F.useRef(!1);F.useInsertionEffect(()=>{k&&A.current&&k.update(s,g)});const j=s[bh],M=F.useRef(!!j&&!(!((f=window.MotionHandoffIsComplete)===null||f===void 0)&&f.call(window,j))&&((d=window.MotionHasOptimisedAnimation)===null||d===void 0?void 0:d.call(window,j)));return Fh(()=>{k&&(A.current=!0,window.MotionIsMounted=!0,k.updateFeatures(),Ia.render(k.render),M.current&&k.animationState&&k.animationState.animateChanges())}),F.useEffect(()=>{k&&(!M.current&&k.animationState&&k.animationState.animateChanges(),M.current&&(queueMicrotask(()=>{var D;(D=window.MotionHandoffMarkAsComplete)===null||D===void 0||D.call(window,j)}),M.current=!1))}),k}function Iy(n,i,s,l){const{layoutId:u,layout:f,drag:d,dragConstraints:h,layoutScroll:m,layoutRoot:g}=i;n.projection=new s(n.latestValues,i["data-framer-portal-id"]?void 0:Kh(n.parent)),n.projection.setOptions({layoutId:u,layout:f,alwaysMeasureLayout:!!d||h&&cr(h),visualElement:n,animationType:typeof f=="string"?f:"both",initialPromotionConfig:l,layoutScroll:m,layoutRoot:g})}function Kh(n){if(n)return n.options.allowProjection!==!1?n.projection:Kh(n.parent)}function Oy({preloadedFeatures:n,createVisualElement:i,useRender:s,useVisualState:l,Component:u}){var f,d;n&&jy(n);function h(g,y){let w;const k={...F.useContext(pi),...g,layoutId:By(g)},{isStatic:R}=k,A=Ly(g),j=l(g,R);if(!R&&_a){Uy();const M=$y(k);w=M.MeasureLayout,A.visualElement=Fy(u,j,k,i,M.ProjectionNode)}return v.jsxs(Js.Provider,{value:A,children:[w&&A.visualElement?v.jsx(w,{visualElement:A.visualElement,...k}):null,s(u,g,Vy(j,A.visualElement,y),j,R,A.visualElement)]})}h.displayName=`motion.${typeof u=="string"?u:`create(${(d=(f=u.displayName)!==null&&f!==void 0?f:u.name)!==null&&d!==void 0?d:""})`}`;const m=F.forwardRef(h);return m[_y]=u,m}function By({layoutId:n}){const i=F.useContext(La).id;return i&&n!==void 0?i+"-"+n:n}function Uy(n,i){F.useContext(Bh).strict}function $y(n){const{drag:i,layout:s}=mr;if(!i&&!s)return{};const l={...i,...s};return{MeasureLayout:i!=null&&i.isEnabled(n)||s!=null&&s.isEnabled(n)?l.MeasureLayout:void 0,ProjectionNode:l.ProjectionNode}}const Wy=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Oa(n){return typeof n!="string"||n.includes("-")?!1:!!(Wy.indexOf(n)>-1||/[A-Z]/u.test(n))}function wf(n){const i=[{},{}];return n==null||n.values.forEach((s,l)=>{i[0][l]=s.get(),i[1][l]=s.getVelocity()}),i}function Ba(n,i,s,l){if(typeof i=="function"){const[u,f]=wf(l);i=i(s!==void 0?s:n.custom,u,f)}if(typeof i=="string"&&(i=n.variants&&n.variants[i]),typeof i=="function"){const[u,f]=wf(l);i=i(s!==void 0?s:n.custom,u,f)}return i}const ya=n=>Array.isArray(n),by=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),Hy=n=>ya(n)?n[n.length-1]||0:n,Ke=n=>!!(n&&n.getVelocity);function Os(n){const i=Ke(n)?n.get():n;return by(i)?i.toValue():i}function Ky({scrapeMotionValuesFromProps:n,createRenderState:i,onUpdate:s},l,u,f){const d={latestValues:Gy(l,u,f,n),renderState:i()};return s&&(d.onMount=h=>s({props:l,current:h,...d}),d.onUpdate=h=>s(h)),d}const Gh=n=>(i,s)=>{const l=F.useContext(Js),u=F.useContext(qs),f=()=>Ky(n,i,l,u);return s?f():Zs(f)};function Gy(n,i,s,l){const u={},f=l(n,{});for(const k in f)u[k]=Os(f[k]);let{initial:d,animate:h}=n;const m=to(n),g=Wh(n);i&&g&&!m&&n.inherit!==!1&&(d===void 0&&(d=i.initial),h===void 0&&(h=i.animate));let y=s?s.initial===!1:!1;y=y||d===!1;const w=y?h:d;if(w&&typeof w!="boolean"&&!eo(w)){const k=Array.isArray(w)?w:[w];for(let R=0;R<k.length;R++){const A=Ba(n,k[R]);if(A){const{transitionEnd:j,transition:M,...D}=A;for(const O in D){let $=D[O];if(Array.isArray($)){const Q=y?$.length-1:0;$=$[Q]}$!==null&&(u[O]=$)}for(const O in j)u[O]=j[O]}}}return u}const vr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],In=new Set(vr),Qh=n=>i=>typeof i=="string"&&i.startsWith(n),Yh=Qh("--"),Qy=Qh("var(--"),Ua=n=>Qy(n)?Yy.test(n.split("/*")[0].trim()):!1,Yy=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Xh=(n,i)=>i&&typeof n=="number"?i.transform(n):n,Qt=(n,i,s)=>s>i?i:s<n?n:s,xr={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},gi={...xr,transform:n=>Qt(0,1,n)},Fs={...xr,default:1},wi=n=>({test:i=>typeof i=="string"&&i.endsWith(n)&&i.split(" ").length===1,parse:parseFloat,transform:i=>`${i}${n}`}),mn=wi("deg"),zt=wi("%"),te=wi("px"),Xy=wi("vh"),Zy=wi("vw"),Sf={...zt,parse:n=>zt.parse(n)/100,transform:n=>zt.transform(n*100)},qy={borderWidth:te,borderTopWidth:te,borderRightWidth:te,borderBottomWidth:te,borderLeftWidth:te,borderRadius:te,radius:te,borderTopLeftRadius:te,borderTopRightRadius:te,borderBottomRightRadius:te,borderBottomLeftRadius:te,width:te,maxWidth:te,height:te,maxHeight:te,top:te,right:te,bottom:te,left:te,padding:te,paddingTop:te,paddingRight:te,paddingBottom:te,paddingLeft:te,margin:te,marginTop:te,marginRight:te,marginBottom:te,marginLeft:te,backgroundPositionX:te,backgroundPositionY:te},Jy={rotate:mn,rotateX:mn,rotateY:mn,rotateZ:mn,scale:Fs,scaleX:Fs,scaleY:Fs,scaleZ:Fs,skew:mn,skewX:mn,skewY:mn,distance:te,translateX:te,translateY:te,translateZ:te,x:te,y:te,z:te,perspective:te,transformPerspective:te,opacity:gi,originX:Sf,originY:Sf,originZ:te},kf={...xr,transform:Math.round},$a={...qy,...Jy,zIndex:kf,size:te,fillOpacity:gi,strokeOpacity:gi,numOctaves:kf},e0={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},t0=vr.length;function n0(n,i,s){let l="",u=!0;for(let f=0;f<t0;f++){const d=vr[f],h=n[d];if(h===void 0)continue;let m=!0;if(typeof h=="number"?m=h===(d.startsWith("scale")?1:0):m=parseFloat(h)===0,!m||s){const g=Xh(h,$a[d]);if(!m){u=!1;const y=e0[d]||d;l+=`${y}(${g}) `}s&&(i[d]=g)}}return l=l.trim(),s?l=s(i,u?"":l):u&&(l="none"),l}function Wa(n,i,s){const{style:l,vars:u,transformOrigin:f}=n;let d=!1,h=!1;for(const m in i){const g=i[m];if(In.has(m)){d=!0;continue}else if(Yh(m)){u[m]=g;continue}else{const y=Xh(g,$a[m]);m.startsWith("origin")?(h=!0,f[m]=y):l[m]=y}}if(i.transform||(d||s?l.transform=n0(i,n.transform,s):l.transform&&(l.transform="none")),h){const{originX:m="50%",originY:g="50%",originZ:y=0}=f;l.transformOrigin=`${m} ${g} ${y}`}}const r0={offset:"stroke-dashoffset",array:"stroke-dasharray"},i0={offset:"strokeDashoffset",array:"strokeDasharray"};function s0(n,i,s=1,l=0,u=!0){n.pathLength=1;const f=u?r0:i0;n[f.offset]=te.transform(-l);const d=te.transform(i),h=te.transform(s);n[f.array]=`${d} ${h}`}function Tf(n,i,s){return typeof n=="string"?n:te.transform(i+s*n)}function o0(n,i,s){const l=Tf(i,n.x,n.width),u=Tf(s,n.y,n.height);return`${l} ${u}`}function ba(n,{attrX:i,attrY:s,attrScale:l,originX:u,originY:f,pathLength:d,pathSpacing:h=1,pathOffset:m=0,...g},y,w){if(Wa(n,g,w),y){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:k,style:R,dimensions:A}=n;k.transform&&(A&&(R.transform=k.transform),delete k.transform),A&&(u!==void 0||f!==void 0||R.transform)&&(R.transformOrigin=o0(A,u!==void 0?u:.5,f!==void 0?f:.5)),i!==void 0&&(k.x=i),s!==void 0&&(k.y=s),l!==void 0&&(k.scale=l),d!==void 0&&s0(k,d,h,m,!1)}const Ha=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Zh=()=>({...Ha(),attrs:{}}),Ka=n=>typeof n=="string"&&n.toLowerCase()==="svg";function qh(n,{style:i,vars:s},l,u){Object.assign(n.style,i,u&&u.getProjectionStyles(l));for(const f in s)n.style.setProperty(f,s[f])}const Jh=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ep(n,i,s,l){qh(n,i,void 0,l);for(const u in i.attrs)n.setAttribute(Jh.has(u)?u:Fa(u),i.attrs[u])}const Ws={};function l0(n){Object.assign(Ws,n)}function tp(n,{layout:i,layoutId:s}){return In.has(n)||n.startsWith("origin")||(i||s!==void 0)&&(!!Ws[n]||n==="opacity")}function Ga(n,i,s){var l;const{style:u}=n,f={};for(const d in u)(Ke(u[d])||i.style&&Ke(i.style[d])||tp(d,n)||((l=s==null?void 0:s.getValue(d))===null||l===void 0?void 0:l.liveStyle)!==void 0)&&(f[d]=u[d]);return f}function np(n,i,s){const l=Ga(n,i,s);for(const u in n)if(Ke(n[u])||Ke(i[u])){const f=vr.indexOf(u)!==-1?"attr"+u.charAt(0).toUpperCase()+u.substring(1):u;l[f]=n[u]}return l}function a0(n,i){try{i.dimensions=typeof n.getBBox=="function"?n.getBBox():n.getBoundingClientRect()}catch{i.dimensions={x:0,y:0,width:0,height:0}}}const Pf=["x","y","width","height","cx","cy","r"],u0={useVisualState:Gh({scrapeMotionValuesFromProps:np,createRenderState:Zh,onUpdate:({props:n,prevProps:i,current:s,renderState:l,latestValues:u})=>{if(!s)return;let f=!!n.drag;if(!f){for(const h in u)if(In.has(h)){f=!0;break}}if(!f)return;let d=!i;if(i)for(let h=0;h<Pf.length;h++){const m=Pf[h];n[m]!==i[m]&&(d=!0)}d&&xe.read(()=>{a0(s,l),xe.render(()=>{ba(l,u,Ka(s.tagName),n.transformTemplate),ep(s,l)})})}})},c0={useVisualState:Gh({scrapeMotionValuesFromProps:Ga,createRenderState:Ha})};function rp(n,i,s){for(const l in i)!Ke(i[l])&&!tp(l,s)&&(n[l]=i[l])}function d0({transformTemplate:n},i){return F.useMemo(()=>{const s=Ha();return Wa(s,i,n),Object.assign({},s.vars,s.style)},[i])}function f0(n,i){const s=n.style||{},l={};return rp(l,s,n),Object.assign(l,d0(n,i)),l}function h0(n,i){const s={},l=f0(n,i);return n.drag&&n.dragListener!==!1&&(s.draggable=!1,l.userSelect=l.WebkitUserSelect=l.WebkitTouchCallout="none",l.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(s.tabIndex=0),s.style=l,s}function p0(n,i,s,l){const u=F.useMemo(()=>{const f=Zh();return ba(f,i,Ka(l),n.transformTemplate),{...f.attrs,style:{...f.style}}},[i]);if(n.style){const f={};rp(f,n.style,n),u.style={...f,...u.style}}return u}function m0(n=!1){return(s,l,u,{latestValues:f},d)=>{const m=(Oa(s)?p0:h0)(l,f,d,s),g=Ry(l,typeof s=="string",n),y=s!==F.Fragment?{...g,...m,ref:u}:{},{children:w}=l,k=F.useMemo(()=>Ke(w)?w.get():w,[w]);return F.createElement(s,{...y,children:k})}}function g0(n,i){return function(l,{forwardMotionProps:u}={forwardMotionProps:!1}){const d={...Oa(l)?u0:c0,preloadedFeatures:n,useRender:m0(u),createVisualElement:i,Component:l};return Oy(d)}}function ip(n,i){if(!Array.isArray(i))return!1;const s=i.length;if(s!==n.length)return!1;for(let l=0;l<s;l++)if(i[l]!==n[l])return!1;return!0}function no(n,i,s){const l=n.getProps();return Ba(l,i,s!==void 0?s:l.custom,n)}function Qa(n,i){return n?n[i]||n.default||n:void 0}const sp=new Set(["width","height","top","left","right","bottom",...vr]);let Bs;function y0(){Bs=void 0}const Ft={now:()=>(Bs===void 0&&Ft.set(Be.isProcessing||Py.useManualTiming?Be.timestamp:performance.now()),Bs),set:n=>{Bs=n,queueMicrotask(y0)}};function Ya(n,i){n.indexOf(i)===-1&&n.push(i)}function Xa(n,i){const s=n.indexOf(i);s>-1&&n.splice(s,1)}class Za{constructor(){this.subscriptions=[]}add(i){return Ya(this.subscriptions,i),()=>Xa(this.subscriptions,i)}notify(i,s,l){const u=this.subscriptions.length;if(u)if(u===1)this.subscriptions[0](i,s,l);else for(let f=0;f<u;f++){const d=this.subscriptions[f];d&&d(i,s,l)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function op(n,i){return i?n*(1e3/i):0}const Cf=30,v0=n=>!isNaN(parseFloat(n));class x0{constructor(i,s={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(l,u=!0)=>{const f=Ft.now();this.updatedAt!==f&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(l),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),u&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(i),this.owner=s.owner}setCurrent(i){this.current=i,this.updatedAt=Ft.now(),this.canTrackVelocity===null&&i!==void 0&&(this.canTrackVelocity=v0(this.current))}setPrevFrameValue(i=this.current){this.prevFrameValue=i,this.prevUpdatedAt=this.updatedAt}onChange(i){return this.on("change",i)}on(i,s){this.events[i]||(this.events[i]=new Za);const l=this.events[i].add(s);return i==="change"?()=>{l(),xe.read(()=>{this.events.change.getSize()||this.stop()})}:l}clearListeners(){for(const i in this.events)this.events[i].clear()}attach(i,s){this.passiveEffect=i,this.stopPassiveEffect=s}set(i,s=!0){!s||!this.passiveEffect?this.updateAndNotify(i,s):this.passiveEffect(i,this.updateAndNotify)}setWithVelocity(i,s,l){this.set(s),this.prev=void 0,this.prevFrameValue=i,this.prevUpdatedAt=this.updatedAt-l}jump(i,s=!0){this.updateAndNotify(i),this.prev=i,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const i=Ft.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||i-this.updatedAt>Cf)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,Cf);return op(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(i){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=i(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function yi(n,i){return new x0(n,i)}function w0(n,i,s){n.hasValue(i)?n.getValue(i).set(s):n.addValue(i,yi(s))}function S0(n,i){const s=no(n,i);let{transitionEnd:l={},transition:u={},...f}=s||{};f={...f,...l};for(const d in f){const h=Hy(f[d]);w0(n,d,h)}}function k0(n){return!!(Ke(n)&&n.add)}function va(n,i){const s=n.getValue("willChange");if(k0(s))return s.add(i)}function lp(n){return n.props[bh]}function qa(n){let i;return()=>(i===void 0&&(i=n()),i)}const T0=qa(()=>window.ScrollTimeline!==void 0);class P0{constructor(i){this.stop=()=>this.runAll("stop"),this.animations=i.filter(Boolean)}get finished(){return Promise.all(this.animations.map(i=>"finished"in i?i.finished:i))}getAll(i){return this.animations[0][i]}setAll(i,s){for(let l=0;l<this.animations.length;l++)this.animations[l][i]=s}attachTimeline(i,s){const l=this.animations.map(u=>{if(T0()&&u.attachTimeline)return u.attachTimeline(i);if(typeof s=="function")return s(u)});return()=>{l.forEach((u,f)=>{u&&u(),this.animations[f].stop()})}}get time(){return this.getAll("time")}set time(i){this.setAll("time",i)}get speed(){return this.getAll("speed")}set speed(i){this.setAll("speed",i)}get startTime(){return this.getAll("startTime")}get duration(){let i=0;for(let s=0;s<this.animations.length;s++)i=Math.max(i,this.animations[s].duration);return i}runAll(i){this.animations.forEach(s=>s[i]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class C0 extends P0{then(i,s){return Promise.all(this.animations).then(i).catch(s)}}const Kt=n=>n*1e3,Gt=n=>n/1e3;function Ja(n){return typeof n=="function"}function Ef(n,i){n.timeline=i,n.onfinish=null}const eu=n=>Array.isArray(n)&&typeof n[0]=="number",E0={linearEasing:void 0};function j0(n,i){const s=qa(n);return()=>{var l;return(l=E0[i])!==null&&l!==void 0?l:s()}}const bs=j0(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),gr=(n,i,s)=>{const l=i-n;return l===0?1:(s-n)/l},ap=(n,i,s=10)=>{let l="";const u=Math.max(Math.round(i/s),2);for(let f=0;f<u;f++)l+=n(gr(0,u-1,f))+", ";return`linear(${l.substring(0,l.length-2)})`};function up(n){return!!(typeof n=="function"&&bs()||!n||typeof n=="string"&&(n in xa||bs())||eu(n)||Array.isArray(n)&&n.every(up))}const li=([n,i,s,l])=>`cubic-bezier(${n}, ${i}, ${s}, ${l})`,xa={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:li([0,.65,.55,1]),circOut:li([.55,0,1,.45]),backIn:li([.31,.01,.66,-.59]),backOut:li([.33,1.53,.69,.99])};function cp(n,i){if(n)return typeof n=="function"&&bs()?ap(n,i):eu(n)?li(n):Array.isArray(n)?n.map(s=>cp(s,i)||xa.easeOut):xa[n]}const dp=(n,i,s)=>(((1-3*s+3*i)*n+(3*s-6*i))*n+3*i)*n,N0=1e-7,R0=12;function A0(n,i,s,l,u){let f,d,h=0;do d=i+(s-i)/2,f=dp(d,l,u)-n,f>0?s=d:i=d;while(Math.abs(f)>N0&&++h<R0);return d}function Si(n,i,s,l){if(n===i&&s===l)return dt;const u=f=>A0(f,0,1,n,s);return f=>f===0||f===1?f:dp(u(f),i,l)}const fp=n=>i=>i<=.5?n(2*i)/2:(2-n(2*(1-i)))/2,hp=n=>i=>1-n(1-i),pp=Si(.33,1.53,.69,.99),tu=hp(pp),mp=fp(tu),gp=n=>(n*=2)<1?.5*tu(n):.5*(2-Math.pow(2,-10*(n-1))),nu=n=>1-Math.sin(Math.acos(n)),yp=hp(nu),vp=fp(nu),xp=n=>/^0[^.\s]+$/u.test(n);function M0(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||xp(n):!0}const ci=n=>Math.round(n*1e5)/1e5,ru=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function D0(n){return n==null}const L0=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,iu=(n,i)=>s=>!!(typeof s=="string"&&L0.test(s)&&s.startsWith(n)||i&&!D0(s)&&Object.prototype.hasOwnProperty.call(s,i)),wp=(n,i,s)=>l=>{if(typeof l!="string")return l;const[u,f,d,h]=l.match(ru);return{[n]:parseFloat(u),[i]:parseFloat(f),[s]:parseFloat(d),alpha:h!==void 0?parseFloat(h):1}},_0=n=>Qt(0,255,n),ia={...xr,transform:n=>Math.round(_0(n))},Vn={test:iu("rgb","red"),parse:wp("red","green","blue"),transform:({red:n,green:i,blue:s,alpha:l=1})=>"rgba("+ia.transform(n)+", "+ia.transform(i)+", "+ia.transform(s)+", "+ci(gi.transform(l))+")"};function V0(n){let i="",s="",l="",u="";return n.length>5?(i=n.substring(1,3),s=n.substring(3,5),l=n.substring(5,7),u=n.substring(7,9)):(i=n.substring(1,2),s=n.substring(2,3),l=n.substring(3,4),u=n.substring(4,5),i+=i,s+=s,l+=l,u+=u),{red:parseInt(i,16),green:parseInt(s,16),blue:parseInt(l,16),alpha:u?parseInt(u,16)/255:1}}const wa={test:iu("#"),parse:V0,transform:Vn.transform},dr={test:iu("hsl","hue"),parse:wp("hue","saturation","lightness"),transform:({hue:n,saturation:i,lightness:s,alpha:l=1})=>"hsla("+Math.round(n)+", "+zt.transform(ci(i))+", "+zt.transform(ci(s))+", "+ci(gi.transform(l))+")"},He={test:n=>Vn.test(n)||wa.test(n)||dr.test(n),parse:n=>Vn.test(n)?Vn.parse(n):dr.test(n)?dr.parse(n):wa.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Vn.transform(n):dr.transform(n)},z0=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function F0(n){var i,s;return isNaN(n)&&typeof n=="string"&&(((i=n.match(ru))===null||i===void 0?void 0:i.length)||0)+(((s=n.match(z0))===null||s===void 0?void 0:s.length)||0)>0}const Sp="number",kp="color",I0="var",O0="var(",jf="${}",B0=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function vi(n){const i=n.toString(),s=[],l={color:[],number:[],var:[]},u=[];let f=0;const h=i.replace(B0,m=>(He.test(m)?(l.color.push(f),u.push(kp),s.push(He.parse(m))):m.startsWith(O0)?(l.var.push(f),u.push(I0),s.push(m)):(l.number.push(f),u.push(Sp),s.push(parseFloat(m))),++f,jf)).split(jf);return{values:s,split:h,indexes:l,types:u}}function Tp(n){return vi(n).values}function Pp(n){const{split:i,types:s}=vi(n),l=i.length;return u=>{let f="";for(let d=0;d<l;d++)if(f+=i[d],u[d]!==void 0){const h=s[d];h===Sp?f+=ci(u[d]):h===kp?f+=He.transform(u[d]):f+=u[d]}return f}}const U0=n=>typeof n=="number"?0:n;function $0(n){const i=Tp(n);return Pp(n)(i.map(U0))}const yn={test:F0,parse:Tp,createTransformer:Pp,getAnimatableNone:$0},W0=new Set(["brightness","contrast","saturate","opacity"]);function b0(n){const[i,s]=n.slice(0,-1).split("(");if(i==="drop-shadow")return n;const[l]=s.match(ru)||[];if(!l)return n;const u=s.replace(l,"");let f=W0.has(i)?1:0;return l!==s&&(f*=100),i+"("+f+u+")"}const H0=/\b([a-z-]*)\(.*?\)/gu,Sa={...yn,getAnimatableNone:n=>{const i=n.match(H0);return i?i.map(b0).join(" "):n}},K0={...$a,color:He,backgroundColor:He,outlineColor:He,fill:He,stroke:He,borderColor:He,borderTopColor:He,borderRightColor:He,borderBottomColor:He,borderLeftColor:He,filter:Sa,WebkitFilter:Sa},su=n=>K0[n];function Cp(n,i){let s=su(n);return s!==Sa&&(s=yn),s.getAnimatableNone?s.getAnimatableNone(i):void 0}const G0=new Set(["auto","none","0"]);function Q0(n,i,s){let l=0,u;for(;l<n.length&&!u;){const f=n[l];typeof f=="string"&&!G0.has(f)&&vi(f).values.length&&(u=n[l]),l++}if(u&&s)for(const f of i)n[f]=Cp(s,u)}const Nf=n=>n===xr||n===te,Rf=(n,i)=>parseFloat(n.split(", ")[i]),Af=(n,i)=>(s,{transform:l})=>{if(l==="none"||!l)return 0;const u=l.match(/^matrix3d\((.+)\)$/u);if(u)return Rf(u[1],i);{const f=l.match(/^matrix\((.+)\)$/u);return f?Rf(f[1],n):0}},Y0=new Set(["x","y","z"]),X0=vr.filter(n=>!Y0.has(n));function Z0(n){const i=[];return X0.forEach(s=>{const l=n.getValue(s);l!==void 0&&(i.push([s,l.get()]),l.set(s.startsWith("scale")?1:0))}),i}const yr={width:({x:n},{paddingLeft:i="0",paddingRight:s="0"})=>n.max-n.min-parseFloat(i)-parseFloat(s),height:({y:n},{paddingTop:i="0",paddingBottom:s="0"})=>n.max-n.min-parseFloat(i)-parseFloat(s),top:(n,{top:i})=>parseFloat(i),left:(n,{left:i})=>parseFloat(i),bottom:({y:n},{top:i})=>parseFloat(i)+(n.max-n.min),right:({x:n},{left:i})=>parseFloat(i)+(n.max-n.min),x:Af(4,13),y:Af(5,14)};yr.translateX=yr.x;yr.translateY=yr.y;const zn=new Set;let ka=!1,Ta=!1;function Ep(){if(Ta){const n=Array.from(zn).filter(l=>l.needsMeasurement),i=new Set(n.map(l=>l.element)),s=new Map;i.forEach(l=>{const u=Z0(l);u.length&&(s.set(l,u),l.render())}),n.forEach(l=>l.measureInitialState()),i.forEach(l=>{l.render();const u=s.get(l);u&&u.forEach(([f,d])=>{var h;(h=l.getValue(f))===null||h===void 0||h.set(d)})}),n.forEach(l=>l.measureEndState()),n.forEach(l=>{l.suspendedScrollY!==void 0&&window.scrollTo(0,l.suspendedScrollY)})}Ta=!1,ka=!1,zn.forEach(n=>n.complete()),zn.clear()}function jp(){zn.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(Ta=!0)})}function q0(){jp(),Ep()}class ou{constructor(i,s,l,u,f,d=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...i],this.onComplete=s,this.name=l,this.motionValue=u,this.element=f,this.isAsync=d}scheduleResolve(){this.isScheduled=!0,this.isAsync?(zn.add(this),ka||(ka=!0,xe.read(jp),xe.resolveKeyframes(Ep))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:i,name:s,element:l,motionValue:u}=this;for(let f=0;f<i.length;f++)if(i[f]===null)if(f===0){const d=u==null?void 0:u.get(),h=i[i.length-1];if(d!==void 0)i[0]=d;else if(l&&s){const m=l.readValue(s,h);m!=null&&(i[0]=m)}i[0]===void 0&&(i[0]=h),u&&d===void 0&&u.set(i[0])}else i[f]=i[f-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),zn.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,zn.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Np=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),J0=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ev(n){const i=J0.exec(n);if(!i)return[,];const[,s,l,u]=i;return[`--${s??l}`,u]}function Rp(n,i,s=1){const[l,u]=ev(n);if(!l)return;const f=window.getComputedStyle(i).getPropertyValue(l);if(f){const d=f.trim();return Np(d)?parseFloat(d):d}return Ua(u)?Rp(u,i,s+1):u}const Ap=n=>i=>i.test(n),tv={test:n=>n==="auto",parse:n=>n},Mp=[xr,te,zt,mn,Zy,Xy,tv],Mf=n=>Mp.find(Ap(n));class Dp extends ou{constructor(i,s,l,u,f){super(i,s,l,u,f,!0)}readKeyframes(){const{unresolvedKeyframes:i,element:s,name:l}=this;if(!s||!s.current)return;super.readKeyframes();for(let m=0;m<i.length;m++){let g=i[m];if(typeof g=="string"&&(g=g.trim(),Ua(g))){const y=Rp(g,s.current);y!==void 0&&(i[m]=y),m===i.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!sp.has(l)||i.length!==2)return;const[u,f]=i,d=Mf(u),h=Mf(f);if(d!==h)if(Nf(d)&&Nf(h))for(let m=0;m<i.length;m++){const g=i[m];typeof g=="string"&&(i[m]=parseFloat(g))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:i,name:s}=this,l=[];for(let u=0;u<i.length;u++)M0(i[u])&&l.push(u);l.length&&Q0(i,l,s)}measureInitialState(){const{element:i,unresolvedKeyframes:s,name:l}=this;if(!i||!i.current)return;l==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=yr[l](i.measureViewportBox(),window.getComputedStyle(i.current)),s[0]=this.measuredOrigin;const u=s[s.length-1];u!==void 0&&i.getValue(l,u).jump(u,!1)}measureEndState(){var i;const{element:s,name:l,unresolvedKeyframes:u}=this;if(!s||!s.current)return;const f=s.getValue(l);f&&f.jump(this.measuredOrigin,!1);const d=u.length-1,h=u[d];u[d]=yr[l](s.measureViewportBox(),window.getComputedStyle(s.current)),h!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=h),!((i=this.removedTransforms)===null||i===void 0)&&i.length&&this.removedTransforms.forEach(([m,g])=>{s.getValue(m).set(g)}),this.resolveNoneKeyframes()}}const Df=(n,i)=>i==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(yn.test(n)||n==="0")&&!n.startsWith("url("));function nv(n){const i=n[0];if(n.length===1)return!0;for(let s=0;s<n.length;s++)if(n[s]!==i)return!0}function rv(n,i,s,l){const u=n[0];if(u===null)return!1;if(i==="display"||i==="visibility")return!0;const f=n[n.length-1],d=Df(u,i),h=Df(f,i);return!d||!h?!1:nv(n)||(s==="spring"||Ja(s))&&l}const iv=n=>n!==null;function ro(n,{repeat:i,repeatType:s="loop"},l){const u=n.filter(iv),f=i&&s!=="loop"&&i%2===1?0:u.length-1;return!f||l===void 0?u[f]:l}const sv=40;class Lp{constructor({autoplay:i=!0,delay:s=0,type:l="keyframes",repeat:u=0,repeatDelay:f=0,repeatType:d="loop",...h}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ft.now(),this.options={autoplay:i,delay:s,type:l,repeat:u,repeatDelay:f,repeatType:d,...h},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>sv?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&q0(),this._resolved}onKeyframesResolved(i,s){this.resolvedAt=Ft.now(),this.hasAttemptedResolve=!0;const{name:l,type:u,velocity:f,delay:d,onComplete:h,onUpdate:m,isGenerator:g}=this.options;if(!g&&!rv(i,l,u,f))if(d)this.options.duration=0;else{m&&m(ro(i,this.options,s)),h&&h(),this.resolveFinishedPromise();return}const y=this.initPlayback(i,s);y!==!1&&(this._resolved={keyframes:i,finalKeyframe:s,...y},this.onPostResolved())}onPostResolved(){}then(i,s){return this.currentFinishedPromise.then(i,s)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(i=>{this.resolveFinishedPromise=i})}}const Pa=2e4;function _p(n){let i=0;const s=50;let l=n.next(i);for(;!l.done&&i<Pa;)i+=s,l=n.next(i);return i>=Pa?1/0:i}const Ce=(n,i,s)=>n+(i-n)*s;function sa(n,i,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?n+(i-n)*6*s:s<1/2?i:s<2/3?n+(i-n)*(2/3-s)*6:n}function ov({hue:n,saturation:i,lightness:s,alpha:l}){n/=360,i/=100,s/=100;let u=0,f=0,d=0;if(!i)u=f=d=s;else{const h=s<.5?s*(1+i):s+i-s*i,m=2*s-h;u=sa(m,h,n+1/3),f=sa(m,h,n),d=sa(m,h,n-1/3)}return{red:Math.round(u*255),green:Math.round(f*255),blue:Math.round(d*255),alpha:l}}function Hs(n,i){return s=>s>0?i:n}const oa=(n,i,s)=>{const l=n*n,u=s*(i*i-l)+l;return u<0?0:Math.sqrt(u)},lv=[wa,Vn,dr],av=n=>lv.find(i=>i.test(n));function Lf(n){const i=av(n);if(!i)return!1;let s=i.parse(n);return i===dr&&(s=ov(s)),s}const _f=(n,i)=>{const s=Lf(n),l=Lf(i);if(!s||!l)return Hs(n,i);const u={...s};return f=>(u.red=oa(s.red,l.red,f),u.green=oa(s.green,l.green,f),u.blue=oa(s.blue,l.blue,f),u.alpha=Ce(s.alpha,l.alpha,f),Vn.transform(u))},uv=(n,i)=>s=>i(n(s)),ki=(...n)=>n.reduce(uv),Ca=new Set(["none","hidden"]);function cv(n,i){return Ca.has(n)?s=>s<=0?n:i:s=>s>=1?i:n}function dv(n,i){return s=>Ce(n,i,s)}function lu(n){return typeof n=="number"?dv:typeof n=="string"?Ua(n)?Hs:He.test(n)?_f:pv:Array.isArray(n)?Vp:typeof n=="object"?He.test(n)?_f:fv:Hs}function Vp(n,i){const s=[...n],l=s.length,u=n.map((f,d)=>lu(f)(f,i[d]));return f=>{for(let d=0;d<l;d++)s[d]=u[d](f);return s}}function fv(n,i){const s={...n,...i},l={};for(const u in s)n[u]!==void 0&&i[u]!==void 0&&(l[u]=lu(n[u])(n[u],i[u]));return u=>{for(const f in l)s[f]=l[f](u);return s}}function hv(n,i){var s;const l=[],u={color:0,var:0,number:0};for(let f=0;f<i.values.length;f++){const d=i.types[f],h=n.indexes[d][u[d]],m=(s=n.values[h])!==null&&s!==void 0?s:0;l[f]=m,u[d]++}return l}const pv=(n,i)=>{const s=yn.createTransformer(i),l=vi(n),u=vi(i);return l.indexes.var.length===u.indexes.var.length&&l.indexes.color.length===u.indexes.color.length&&l.indexes.number.length>=u.indexes.number.length?Ca.has(n)&&!u.values.length||Ca.has(i)&&!l.values.length?cv(n,i):ki(Vp(hv(l,u),u.values),s):Hs(n,i)};function zp(n,i,s){return typeof n=="number"&&typeof i=="number"&&typeof s=="number"?Ce(n,i,s):lu(n)(n,i)}const mv=5;function Fp(n,i,s){const l=Math.max(i-mv,0);return op(s-n(l),i-l)}const Ne={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},la=.001;function gv({duration:n=Ne.duration,bounce:i=Ne.bounce,velocity:s=Ne.velocity,mass:l=Ne.mass}){let u,f,d=1-i;d=Qt(Ne.minDamping,Ne.maxDamping,d),n=Qt(Ne.minDuration,Ne.maxDuration,Gt(n)),d<1?(u=g=>{const y=g*d,w=y*n,k=y-s,R=Ea(g,d),A=Math.exp(-w);return la-k/R*A},f=g=>{const w=g*d*n,k=w*s+s,R=Math.pow(d,2)*Math.pow(g,2)*n,A=Math.exp(-w),j=Ea(Math.pow(g,2),d);return(-u(g)+la>0?-1:1)*((k-R)*A)/j}):(u=g=>{const y=Math.exp(-g*n),w=(g-s)*n+1;return-la+y*w},f=g=>{const y=Math.exp(-g*n),w=(s-g)*(n*n);return y*w});const h=5/n,m=vv(u,f,h);if(n=Kt(n),isNaN(m))return{stiffness:Ne.stiffness,damping:Ne.damping,duration:n};{const g=Math.pow(m,2)*l;return{stiffness:g,damping:d*2*Math.sqrt(l*g),duration:n}}}const yv=12;function vv(n,i,s){let l=s;for(let u=1;u<yv;u++)l=l-n(l)/i(l);return l}function Ea(n,i){return n*Math.sqrt(1-i*i)}const xv=["duration","bounce"],wv=["stiffness","damping","mass"];function Vf(n,i){return i.some(s=>n[s]!==void 0)}function Sv(n){let i={velocity:Ne.velocity,stiffness:Ne.stiffness,damping:Ne.damping,mass:Ne.mass,isResolvedFromDuration:!1,...n};if(!Vf(n,wv)&&Vf(n,xv))if(n.visualDuration){const s=n.visualDuration,l=2*Math.PI/(s*1.2),u=l*l,f=2*Qt(.05,1,1-(n.bounce||0))*Math.sqrt(u);i={...i,mass:Ne.mass,stiffness:u,damping:f}}else{const s=gv(n);i={...i,...s,mass:Ne.mass},i.isResolvedFromDuration=!0}return i}function Ip(n=Ne.visualDuration,i=Ne.bounce){const s=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:i}:n;let{restSpeed:l,restDelta:u}=s;const f=s.keyframes[0],d=s.keyframes[s.keyframes.length-1],h={done:!1,value:f},{stiffness:m,damping:g,mass:y,duration:w,velocity:k,isResolvedFromDuration:R}=Sv({...s,velocity:-Gt(s.velocity||0)}),A=k||0,j=g/(2*Math.sqrt(m*y)),M=d-f,D=Gt(Math.sqrt(m/y)),O=Math.abs(M)<5;l||(l=O?Ne.restSpeed.granular:Ne.restSpeed.default),u||(u=O?Ne.restDelta.granular:Ne.restDelta.default);let $;if(j<1){const U=Ea(D,j);$=X=>{const re=Math.exp(-j*D*X);return d-re*((A+j*D*M)/U*Math.sin(U*X)+M*Math.cos(U*X))}}else if(j===1)$=U=>d-Math.exp(-D*U)*(M+(A+D*M)*U);else{const U=D*Math.sqrt(j*j-1);$=X=>{const re=Math.exp(-j*D*X),Z=Math.min(U*X,300);return d-re*((A+j*D*M)*Math.sinh(Z)+U*M*Math.cosh(Z))/U}}const Q={calculatedDuration:R&&w||null,next:U=>{const X=$(U);if(R)h.done=U>=w;else{let re=0;j<1&&(re=U===0?Kt(A):Fp($,U,X));const Z=Math.abs(re)<=l,ge=Math.abs(d-X)<=u;h.done=Z&&ge}return h.value=h.done?d:X,h},toString:()=>{const U=Math.min(_p(Q),Pa),X=ap(re=>Q.next(U*re).value,U,30);return U+"ms "+X}};return Q}function zf({keyframes:n,velocity:i=0,power:s=.8,timeConstant:l=325,bounceDamping:u=10,bounceStiffness:f=500,modifyTarget:d,min:h,max:m,restDelta:g=.5,restSpeed:y}){const w=n[0],k={done:!1,value:w},R=Z=>h!==void 0&&Z<h||m!==void 0&&Z>m,A=Z=>h===void 0?m:m===void 0||Math.abs(h-Z)<Math.abs(m-Z)?h:m;let j=s*i;const M=w+j,D=d===void 0?M:d(M);D!==M&&(j=D-w);const O=Z=>-j*Math.exp(-Z/l),$=Z=>D+O(Z),Q=Z=>{const ge=O(Z),Ee=$(Z);k.done=Math.abs(ge)<=g,k.value=k.done?D:Ee};let U,X;const re=Z=>{R(k.value)&&(U=Z,X=Ip({keyframes:[k.value,A(k.value)],velocity:Fp($,Z,k.value),damping:u,stiffness:f,restDelta:g,restSpeed:y}))};return re(0),{calculatedDuration:null,next:Z=>{let ge=!1;return!X&&U===void 0&&(ge=!0,Q(Z),re(Z)),U!==void 0&&Z>=U?X.next(Z-U):(!ge&&Q(Z),k)}}}const kv=Si(.42,0,1,1),Tv=Si(0,0,.58,1),Op=Si(.42,0,.58,1),Pv=n=>Array.isArray(n)&&typeof n[0]!="number",Cv={linear:dt,easeIn:kv,easeInOut:Op,easeOut:Tv,circIn:nu,circInOut:vp,circOut:yp,backIn:tu,backInOut:mp,backOut:pp,anticipate:gp},Ff=n=>{if(eu(n)){Ih(n.length===4);const[i,s,l,u]=n;return Si(i,s,l,u)}else if(typeof n=="string")return Cv[n];return n};function Ev(n,i,s){const l=[],u=s||zp,f=n.length-1;for(let d=0;d<f;d++){let h=u(n[d],n[d+1]);if(i){const m=Array.isArray(i)?i[d]||dt:i;h=ki(m,h)}l.push(h)}return l}function jv(n,i,{clamp:s=!0,ease:l,mixer:u}={}){const f=n.length;if(Ih(f===i.length),f===1)return()=>i[0];if(f===2&&i[0]===i[1])return()=>i[1];const d=n[0]===n[1];n[0]>n[f-1]&&(n=[...n].reverse(),i=[...i].reverse());const h=Ev(i,l,u),m=h.length,g=y=>{if(d&&y<n[0])return i[0];let w=0;if(m>1)for(;w<n.length-2&&!(y<n[w+1]);w++);const k=gr(n[w],n[w+1],y);return h[w](k)};return s?y=>g(Qt(n[0],n[f-1],y)):g}function Nv(n,i){const s=n[n.length-1];for(let l=1;l<=i;l++){const u=gr(0,i,l);n.push(Ce(s,1,u))}}function Rv(n){const i=[0];return Nv(i,n.length-1),i}function Av(n,i){return n.map(s=>s*i)}function Mv(n,i){return n.map(()=>i||Op).splice(0,n.length-1)}function Ks({duration:n=300,keyframes:i,times:s,ease:l="easeInOut"}){const u=Pv(l)?l.map(Ff):Ff(l),f={done:!1,value:i[0]},d=Av(s&&s.length===i.length?s:Rv(i),n),h=jv(d,i,{ease:Array.isArray(u)?u:Mv(i,u)});return{calculatedDuration:n,next:m=>(f.value=h(m),f.done=m>=n,f)}}const Dv=n=>{const i=({timestamp:s})=>n(s);return{start:()=>xe.update(i,!0),stop:()=>gn(i),now:()=>Be.isProcessing?Be.timestamp:Ft.now()}},Lv={decay:zf,inertia:zf,tween:Ks,keyframes:Ks,spring:Ip},_v=n=>n/100;class au extends Lp{constructor(i){super(i),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:m}=this.options;m&&m()};const{name:s,motionValue:l,element:u,keyframes:f}=this.options,d=(u==null?void 0:u.KeyframeResolver)||ou,h=(m,g)=>this.onKeyframesResolved(m,g);this.resolver=new d(f,h,s,l,u),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(i){const{type:s="keyframes",repeat:l=0,repeatDelay:u=0,repeatType:f,velocity:d=0}=this.options,h=Ja(s)?s:Lv[s]||Ks;let m,g;h!==Ks&&typeof i[0]!="number"&&(m=ki(_v,zp(i[0],i[1])),i=[0,100]);const y=h({...this.options,keyframes:i});f==="mirror"&&(g=h({...this.options,keyframes:[...i].reverse(),velocity:-d})),y.calculatedDuration===null&&(y.calculatedDuration=_p(y));const{calculatedDuration:w}=y,k=w+u,R=k*(l+1)-u;return{generator:y,mirroredGenerator:g,mapPercentToKeyframes:m,calculatedDuration:w,resolvedDuration:k,totalDuration:R}}onPostResolved(){const{autoplay:i=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!i?this.pause():this.state=this.pendingPlayState}tick(i,s=!1){const{resolved:l}=this;if(!l){const{keyframes:Z}=this.options;return{done:!0,value:Z[Z.length-1]}}const{finalKeyframe:u,generator:f,mirroredGenerator:d,mapPercentToKeyframes:h,keyframes:m,calculatedDuration:g,totalDuration:y,resolvedDuration:w}=l;if(this.startTime===null)return f.next(0);const{delay:k,repeat:R,repeatType:A,repeatDelay:j,onUpdate:M}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,i):this.speed<0&&(this.startTime=Math.min(i-y/this.speed,this.startTime)),s?this.currentTime=i:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(i-this.startTime)*this.speed;const D=this.currentTime-k*(this.speed>=0?1:-1),O=this.speed>=0?D<0:D>y;this.currentTime=Math.max(D,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=y);let $=this.currentTime,Q=f;if(R){const Z=Math.min(this.currentTime,y)/w;let ge=Math.floor(Z),Ee=Z%1;!Ee&&Z>=1&&(Ee=1),Ee===1&&ge--,ge=Math.min(ge,R+1),!!(ge%2)&&(A==="reverse"?(Ee=1-Ee,j&&(Ee-=j/w)):A==="mirror"&&(Q=d)),$=Qt(0,1,Ee)*w}const U=O?{done:!1,value:m[0]}:Q.next($);h&&(U.value=h(U.value));let{done:X}=U;!O&&g!==null&&(X=this.speed>=0?this.currentTime>=y:this.currentTime<=0);const re=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&X);return re&&u!==void 0&&(U.value=ro(m,this.options,u)),M&&M(U.value),re&&this.finish(),U}get duration(){const{resolved:i}=this;return i?Gt(i.calculatedDuration):0}get time(){return Gt(this.currentTime)}set time(i){i=Kt(i),this.currentTime=i,this.holdTime!==null||this.speed===0?this.holdTime=i:this.driver&&(this.startTime=this.driver.now()-i/this.speed)}get speed(){return this.playbackSpeed}set speed(i){const s=this.playbackSpeed!==i;this.playbackSpeed=i,s&&(this.time=Gt(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:i=Dv,onPlay:s,startTime:l}=this.options;this.driver||(this.driver=i(f=>this.tick(f))),s&&s();const u=this.driver.now();this.holdTime!==null?this.startTime=u-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=u):this.startTime=l??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var i;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(i=this.currentTime)!==null&&i!==void 0?i:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:i}=this.options;i&&i()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(i){return this.startTime=0,this.tick(i,!0)}}const Vv=new Set(["opacity","clipPath","filter","transform"]);function zv(n,i,s,{delay:l=0,duration:u=300,repeat:f=0,repeatType:d="loop",ease:h="easeInOut",times:m}={}){const g={[i]:s};m&&(g.offset=m);const y=cp(h,u);return Array.isArray(y)&&(g.easing=y),n.animate(g,{delay:l,duration:u,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:f+1,direction:d==="reverse"?"alternate":"normal"})}const Fv=qa(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Gs=10,Iv=2e4;function Ov(n){return Ja(n.type)||n.type==="spring"||!up(n.ease)}function Bv(n,i){const s=new au({...i,keyframes:n,repeat:0,delay:0,isGenerator:!0});let l={done:!1,value:n[0]};const u=[];let f=0;for(;!l.done&&f<Iv;)l=s.sample(f),u.push(l.value),f+=Gs;return{times:void 0,keyframes:u,duration:f-Gs,ease:"linear"}}const Bp={anticipate:gp,backInOut:mp,circInOut:vp};function Uv(n){return n in Bp}class If extends Lp{constructor(i){super(i);const{name:s,motionValue:l,element:u,keyframes:f}=this.options;this.resolver=new Dp(f,(d,h)=>this.onKeyframesResolved(d,h),s,l,u),this.resolver.scheduleResolve()}initPlayback(i,s){let{duration:l=300,times:u,ease:f,type:d,motionValue:h,name:m,startTime:g}=this.options;if(!h.owner||!h.owner.current)return!1;if(typeof f=="string"&&bs()&&Uv(f)&&(f=Bp[f]),Ov(this.options)){const{onComplete:w,onUpdate:k,motionValue:R,element:A,...j}=this.options,M=Bv(i,j);i=M.keyframes,i.length===1&&(i[1]=i[0]),l=M.duration,u=M.times,f=M.ease,d="keyframes"}const y=zv(h.owner.current,m,i,{...this.options,duration:l,times:u,ease:f});return y.startTime=g??this.calcStartTime(),this.pendingTimeline?(Ef(y,this.pendingTimeline),this.pendingTimeline=void 0):y.onfinish=()=>{const{onComplete:w}=this.options;h.set(ro(i,this.options,s)),w&&w(),this.cancel(),this.resolveFinishedPromise()},{animation:y,duration:l,times:u,type:d,ease:f,keyframes:i}}get duration(){const{resolved:i}=this;if(!i)return 0;const{duration:s}=i;return Gt(s)}get time(){const{resolved:i}=this;if(!i)return 0;const{animation:s}=i;return Gt(s.currentTime||0)}set time(i){const{resolved:s}=this;if(!s)return;const{animation:l}=s;l.currentTime=Kt(i)}get speed(){const{resolved:i}=this;if(!i)return 1;const{animation:s}=i;return s.playbackRate}set speed(i){const{resolved:s}=this;if(!s)return;const{animation:l}=s;l.playbackRate=i}get state(){const{resolved:i}=this;if(!i)return"idle";const{animation:s}=i;return s.playState}get startTime(){const{resolved:i}=this;if(!i)return null;const{animation:s}=i;return s.startTime}attachTimeline(i){if(!this._resolved)this.pendingTimeline=i;else{const{resolved:s}=this;if(!s)return dt;const{animation:l}=s;Ef(l,i)}return dt}play(){if(this.isStopped)return;const{resolved:i}=this;if(!i)return;const{animation:s}=i;s.playState==="finished"&&this.updateFinishedPromise(),s.play()}pause(){const{resolved:i}=this;if(!i)return;const{animation:s}=i;s.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:i}=this;if(!i)return;const{animation:s,keyframes:l,duration:u,type:f,ease:d,times:h}=i;if(s.playState==="idle"||s.playState==="finished")return;if(this.time){const{motionValue:g,onUpdate:y,onComplete:w,element:k,...R}=this.options,A=new au({...R,keyframes:l,duration:u,type:f,ease:d,times:h,isGenerator:!0}),j=Kt(this.time);g.setWithVelocity(A.sample(j-Gs).value,A.sample(j).value,Gs)}const{onStop:m}=this.options;m&&m(),this.cancel()}complete(){const{resolved:i}=this;i&&i.animation.finish()}cancel(){const{resolved:i}=this;i&&i.animation.cancel()}static supports(i){const{motionValue:s,name:l,repeatDelay:u,repeatType:f,damping:d,type:h}=i;if(!s||!s.owner||!(s.owner.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:g}=s.owner.getProps();return Fv()&&l&&Vv.has(l)&&!m&&!g&&!u&&f!=="mirror"&&d!==0&&h!=="inertia"}}const $v={type:"spring",stiffness:500,damping:25,restSpeed:10},Wv=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),bv={type:"keyframes",duration:.8},Hv={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Kv=(n,{keyframes:i})=>i.length>2?bv:In.has(n)?n.startsWith("scale")?Wv(i[1]):$v:Hv;function Gv({when:n,delay:i,delayChildren:s,staggerChildren:l,staggerDirection:u,repeat:f,repeatType:d,repeatDelay:h,from:m,elapsed:g,...y}){return!!Object.keys(y).length}const uu=(n,i,s,l={},u,f)=>d=>{const h=Qa(l,n)||{},m=h.delay||l.delay||0;let{elapsed:g=0}=l;g=g-Kt(m);let y={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:i.getVelocity(),...h,delay:-g,onUpdate:k=>{i.set(k),h.onUpdate&&h.onUpdate(k)},onComplete:()=>{d(),h.onComplete&&h.onComplete()},name:n,motionValue:i,element:f?void 0:u};Gv(h)||(y={...y,...Kv(n,y)}),y.duration&&(y.duration=Kt(y.duration)),y.repeatDelay&&(y.repeatDelay=Kt(y.repeatDelay)),y.from!==void 0&&(y.keyframes[0]=y.from);let w=!1;if((y.type===!1||y.duration===0&&!y.repeatDelay)&&(y.duration=0,y.delay===0&&(w=!0)),w&&!f&&i.get()!==void 0){const k=ro(y.keyframes,h);if(k!==void 0)return xe.update(()=>{y.onUpdate(k),y.onComplete()}),new C0([])}return!f&&If.supports(y)?new If(y):new au(y)};function Qv({protectedKeys:n,needsAnimating:i},s){const l=n.hasOwnProperty(s)&&i[s]!==!0;return i[s]=!1,l}function Up(n,i,{delay:s=0,transitionOverride:l,type:u}={}){var f;let{transition:d=n.getDefaultTransition(),transitionEnd:h,...m}=i;l&&(d=l);const g=[],y=u&&n.animationState&&n.animationState.getState()[u];for(const w in m){const k=n.getValue(w,(f=n.latestValues[w])!==null&&f!==void 0?f:null),R=m[w];if(R===void 0||y&&Qv(y,w))continue;const A={delay:s,...Qa(d||{},w)};let j=!1;if(window.MotionHandoffAnimation){const D=lp(n);if(D){const O=window.MotionHandoffAnimation(D,w,xe);O!==null&&(A.startTime=O,j=!0)}}va(n,w),k.start(uu(w,k,R,n.shouldReduceMotion&&sp.has(w)?{type:!1}:A,n,j));const M=k.animation;M&&g.push(M)}return h&&Promise.all(g).then(()=>{xe.update(()=>{h&&S0(n,h)})}),g}function ja(n,i,s={}){var l;const u=no(n,i,s.type==="exit"?(l=n.presenceContext)===null||l===void 0?void 0:l.custom:void 0);let{transition:f=n.getDefaultTransition()||{}}=u||{};s.transitionOverride&&(f=s.transitionOverride);const d=u?()=>Promise.all(Up(n,u,s)):()=>Promise.resolve(),h=n.variantChildren&&n.variantChildren.size?(g=0)=>{const{delayChildren:y=0,staggerChildren:w,staggerDirection:k}=f;return Yv(n,i,y+g,w,k,s)}:()=>Promise.resolve(),{when:m}=f;if(m){const[g,y]=m==="beforeChildren"?[d,h]:[h,d];return g().then(()=>y())}else return Promise.all([d(),h(s.delay)])}function Yv(n,i,s=0,l=0,u=1,f){const d=[],h=(n.variantChildren.size-1)*l,m=u===1?(g=0)=>g*l:(g=0)=>h-g*l;return Array.from(n.variantChildren).sort(Xv).forEach((g,y)=>{g.notify("AnimationStart",i),d.push(ja(g,i,{...f,delay:s+m(y)}).then(()=>g.notify("AnimationComplete",i)))}),Promise.all(d)}function Xv(n,i){return n.sortNodePosition(i)}function Zv(n,i,s={}){n.notify("AnimationStart",i);let l;if(Array.isArray(i)){const u=i.map(f=>ja(n,f,s));l=Promise.all(u)}else if(typeof i=="string")l=ja(n,i,s);else{const u=typeof i=="function"?no(n,i,s.custom):i;l=Promise.all(Up(n,u,s))}return l.then(()=>{n.notify("AnimationComplete",i)})}const qv=za.length;function $p(n){if(!n)return;if(!n.isControllingVariants){const s=n.parent?$p(n.parent)||{}:{};return n.props.initial!==void 0&&(s.initial=n.props.initial),s}const i={};for(let s=0;s<qv;s++){const l=za[s],u=n.props[l];(mi(u)||u===!1)&&(i[l]=u)}return i}const Jv=[...Va].reverse(),ex=Va.length;function tx(n){return i=>Promise.all(i.map(({animation:s,options:l})=>Zv(n,s,l)))}function nx(n){let i=tx(n),s=Of(),l=!0;const u=m=>(g,y)=>{var w;const k=no(n,y,m==="exit"?(w=n.presenceContext)===null||w===void 0?void 0:w.custom:void 0);if(k){const{transition:R,transitionEnd:A,...j}=k;g={...g,...j,...A}}return g};function f(m){i=m(n)}function d(m){const{props:g}=n,y=$p(n.parent)||{},w=[],k=new Set;let R={},A=1/0;for(let M=0;M<ex;M++){const D=Jv[M],O=s[D],$=g[D]!==void 0?g[D]:y[D],Q=mi($),U=D===m?O.isActive:null;U===!1&&(A=M);let X=$===y[D]&&$!==g[D]&&Q;if(X&&l&&n.manuallyAnimateOnMount&&(X=!1),O.protectedKeys={...R},!O.isActive&&U===null||!$&&!O.prevProp||eo($)||typeof $=="boolean")continue;const re=rx(O.prevProp,$);let Z=re||D===m&&O.isActive&&!X&&Q||M>A&&Q,ge=!1;const Ee=Array.isArray($)?$:[$];let Ze=Ee.reduce(u(D),{});U===!1&&(Ze={});const{prevResolvedValues:st={}}=O,Ge={...st,...Ze},qe=se=>{Z=!0,k.has(se)&&(ge=!0,k.delete(se)),O.needsAnimating[se]=!0;const B=n.getValue(se);B&&(B.liveStyle=!1)};for(const se in Ge){const B=Ze[se],q=st[se];if(R.hasOwnProperty(se))continue;let b=!1;ya(B)&&ya(q)?b=!ip(B,q):b=B!==q,b?B!=null?qe(se):k.add(se):B!==void 0&&k.has(se)?qe(se):O.protectedKeys[se]=!0}O.prevProp=$,O.prevResolvedValues=Ze,O.isActive&&(R={...R,...Ze}),l&&n.blockInitialAnimation&&(Z=!1),Z&&(!(X&&re)||ge)&&w.push(...Ee.map(se=>({animation:se,options:{type:D}})))}if(k.size){const M={};k.forEach(D=>{const O=n.getBaseTarget(D),$=n.getValue(D);$&&($.liveStyle=!0),M[D]=O??null}),w.push({animation:M})}let j=!!w.length;return l&&(g.initial===!1||g.initial===g.animate)&&!n.manuallyAnimateOnMount&&(j=!1),l=!1,j?i(w):Promise.resolve()}function h(m,g){var y;if(s[m].isActive===g)return Promise.resolve();(y=n.variantChildren)===null||y===void 0||y.forEach(k=>{var R;return(R=k.animationState)===null||R===void 0?void 0:R.setActive(m,g)}),s[m].isActive=g;const w=d(m);for(const k in s)s[k].protectedKeys={};return w}return{animateChanges:d,setActive:h,setAnimateFunction:f,getState:()=>s,reset:()=>{s=Of(),l=!0}}}function rx(n,i){return typeof i=="string"?i!==n:Array.isArray(i)?!ip(i,n):!1}function Dn(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Of(){return{animate:Dn(!0),whileInView:Dn(),whileHover:Dn(),whileTap:Dn(),whileDrag:Dn(),whileFocus:Dn(),exit:Dn()}}class vn{constructor(i){this.isMounted=!1,this.node=i}update(){}}class ix extends vn{constructor(i){super(i),i.animationState||(i.animationState=nx(i))}updateAnimationControlsSubscription(){const{animate:i}=this.node.getProps();eo(i)&&(this.unmountControls=i.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:i}=this.node.getProps(),{animate:s}=this.node.prevProps||{};i!==s&&this.updateAnimationControlsSubscription()}unmount(){var i;this.node.animationState.reset(),(i=this.unmountControls)===null||i===void 0||i.call(this)}}let sx=0;class ox extends vn{constructor(){super(...arguments),this.id=sx++}update(){if(!this.node.presenceContext)return;const{isPresent:i,onExitComplete:s}=this.node.presenceContext,{isPresent:l}=this.node.prevPresenceContext||{};if(!this.node.animationState||i===l)return;const u=this.node.animationState.setActive("exit",!i);s&&!i&&u.then(()=>s(this.id))}mount(){const{register:i}=this.node.presenceContext||{};i&&(this.unmount=i(this.id))}unmount(){}}const lx={animation:{Feature:ix},exit:{Feature:ox}},At={x:!1,y:!1};function Wp(){return At.x||At.y}function ax(n){return n==="x"||n==="y"?At[n]?null:(At[n]=!0,()=>{At[n]=!1}):At.x||At.y?null:(At.x=At.y=!0,()=>{At.x=At.y=!1})}const cu=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function xi(n,i,s,l={passive:!0}){return n.addEventListener(i,s,l),()=>n.removeEventListener(i,s)}function Ti(n){return{point:{x:n.pageX,y:n.pageY}}}const ux=n=>i=>cu(i)&&n(i,Ti(i));function di(n,i,s,l){return xi(n,i,ux(s),l)}const Bf=(n,i)=>Math.abs(n-i);function cx(n,i){const s=Bf(n.x,i.x),l=Bf(n.y,i.y);return Math.sqrt(s**2+l**2)}class bp{constructor(i,s,{transformPagePoint:l,contextWindow:u,dragSnapToOrigin:f=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=ua(this.lastMoveEventInfo,this.history),k=this.startEvent!==null,R=cx(w.offset,{x:0,y:0})>=3;if(!k&&!R)return;const{point:A}=w,{timestamp:j}=Be;this.history.push({...A,timestamp:j});const{onStart:M,onMove:D}=this.handlers;k||(M&&M(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),D&&D(this.lastMoveEvent,w)},this.handlePointerMove=(w,k)=>{this.lastMoveEvent=w,this.lastMoveEventInfo=aa(k,this.transformPagePoint),xe.update(this.updatePoint,!0)},this.handlePointerUp=(w,k)=>{this.end();const{onEnd:R,onSessionEnd:A,resumeAnimation:j}=this.handlers;if(this.dragSnapToOrigin&&j&&j(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const M=ua(w.type==="pointercancel"?this.lastMoveEventInfo:aa(k,this.transformPagePoint),this.history);this.startEvent&&R&&R(w,M),A&&A(w,M)},!cu(i))return;this.dragSnapToOrigin=f,this.handlers=s,this.transformPagePoint=l,this.contextWindow=u||window;const d=Ti(i),h=aa(d,this.transformPagePoint),{point:m}=h,{timestamp:g}=Be;this.history=[{...m,timestamp:g}];const{onSessionStart:y}=s;y&&y(i,ua(h,this.history)),this.removeListeners=ki(di(this.contextWindow,"pointermove",this.handlePointerMove),di(this.contextWindow,"pointerup",this.handlePointerUp),di(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(i){this.handlers=i}end(){this.removeListeners&&this.removeListeners(),gn(this.updatePoint)}}function aa(n,i){return i?{point:i(n.point)}:n}function Uf(n,i){return{x:n.x-i.x,y:n.y-i.y}}function ua({point:n},i){return{point:n,delta:Uf(n,Hp(i)),offset:Uf(n,dx(i)),velocity:fx(i,.1)}}function dx(n){return n[0]}function Hp(n){return n[n.length-1]}function fx(n,i){if(n.length<2)return{x:0,y:0};let s=n.length-1,l=null;const u=Hp(n);for(;s>=0&&(l=n[s],!(u.timestamp-l.timestamp>Kt(i)));)s--;if(!l)return{x:0,y:0};const f=Gt(u.timestamp-l.timestamp);if(f===0)return{x:0,y:0};const d={x:(u.x-l.x)/f,y:(u.y-l.y)/f};return d.x===1/0&&(d.x=0),d.y===1/0&&(d.y=0),d}const Kp=1e-4,hx=1-Kp,px=1+Kp,Gp=.01,mx=0-Gp,gx=0+Gp;function ft(n){return n.max-n.min}function yx(n,i,s){return Math.abs(n-i)<=s}function $f(n,i,s,l=.5){n.origin=l,n.originPoint=Ce(i.min,i.max,n.origin),n.scale=ft(s)/ft(i),n.translate=Ce(s.min,s.max,n.origin)-n.originPoint,(n.scale>=hx&&n.scale<=px||isNaN(n.scale))&&(n.scale=1),(n.translate>=mx&&n.translate<=gx||isNaN(n.translate))&&(n.translate=0)}function fi(n,i,s,l){$f(n.x,i.x,s.x,l?l.originX:void 0),$f(n.y,i.y,s.y,l?l.originY:void 0)}function Wf(n,i,s){n.min=s.min+i.min,n.max=n.min+ft(i)}function vx(n,i,s){Wf(n.x,i.x,s.x),Wf(n.y,i.y,s.y)}function bf(n,i,s){n.min=i.min-s.min,n.max=n.min+ft(i)}function hi(n,i,s){bf(n.x,i.x,s.x),bf(n.y,i.y,s.y)}function xx(n,{min:i,max:s},l){return i!==void 0&&n<i?n=l?Ce(i,n,l.min):Math.max(n,i):s!==void 0&&n>s&&(n=l?Ce(s,n,l.max):Math.min(n,s)),n}function Hf(n,i,s){return{min:i!==void 0?n.min+i:void 0,max:s!==void 0?n.max+s-(n.max-n.min):void 0}}function wx(n,{top:i,left:s,bottom:l,right:u}){return{x:Hf(n.x,s,u),y:Hf(n.y,i,l)}}function Kf(n,i){let s=i.min-n.min,l=i.max-n.max;return i.max-i.min<n.max-n.min&&([s,l]=[l,s]),{min:s,max:l}}function Sx(n,i){return{x:Kf(n.x,i.x),y:Kf(n.y,i.y)}}function kx(n,i){let s=.5;const l=ft(n),u=ft(i);return u>l?s=gr(i.min,i.max-l,n.min):l>u&&(s=gr(n.min,n.max-u,i.min)),Qt(0,1,s)}function Tx(n,i){const s={};return i.min!==void 0&&(s.min=i.min-n.min),i.max!==void 0&&(s.max=i.max-n.min),s}const Na=.35;function Px(n=Na){return n===!1?n=0:n===!0&&(n=Na),{x:Gf(n,"left","right"),y:Gf(n,"top","bottom")}}function Gf(n,i,s){return{min:Qf(n,i),max:Qf(n,s)}}function Qf(n,i){return typeof n=="number"?n:n[i]||0}const Yf=()=>({translate:0,scale:1,origin:0,originPoint:0}),fr=()=>({x:Yf(),y:Yf()}),Xf=()=>({min:0,max:0}),Me=()=>({x:Xf(),y:Xf()});function wt(n){return[n("x"),n("y")]}function Qp({top:n,left:i,right:s,bottom:l}){return{x:{min:i,max:s},y:{min:n,max:l}}}function Cx({x:n,y:i}){return{top:i.min,right:n.max,bottom:i.max,left:n.min}}function Ex(n,i){if(!i)return n;const s=i({x:n.left,y:n.top}),l=i({x:n.right,y:n.bottom});return{top:s.y,left:s.x,bottom:l.y,right:l.x}}function ca(n){return n===void 0||n===1}function Ra({scale:n,scaleX:i,scaleY:s}){return!ca(n)||!ca(i)||!ca(s)}function Ln(n){return Ra(n)||Yp(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function Yp(n){return Zf(n.x)||Zf(n.y)}function Zf(n){return n&&n!=="0%"}function Qs(n,i,s){const l=n-s,u=i*l;return s+u}function qf(n,i,s,l,u){return u!==void 0&&(n=Qs(n,u,l)),Qs(n,s,l)+i}function Aa(n,i=0,s=1,l,u){n.min=qf(n.min,i,s,l,u),n.max=qf(n.max,i,s,l,u)}function Xp(n,{x:i,y:s}){Aa(n.x,i.translate,i.scale,i.originPoint),Aa(n.y,s.translate,s.scale,s.originPoint)}const Jf=.999999999999,eh=1.0000000000001;function jx(n,i,s,l=!1){const u=s.length;if(!u)return;i.x=i.y=1;let f,d;for(let h=0;h<u;h++){f=s[h],d=f.projectionDelta;const{visualElement:m}=f.options;m&&m.props.style&&m.props.style.display==="contents"||(l&&f.options.layoutScroll&&f.scroll&&f!==f.root&&pr(n,{x:-f.scroll.offset.x,y:-f.scroll.offset.y}),d&&(i.x*=d.x.scale,i.y*=d.y.scale,Xp(n,d)),l&&Ln(f.latestValues)&&pr(n,f.latestValues))}i.x<eh&&i.x>Jf&&(i.x=1),i.y<eh&&i.y>Jf&&(i.y=1)}function hr(n,i){n.min=n.min+i,n.max=n.max+i}function th(n,i,s,l,u=.5){const f=Ce(n.min,n.max,u);Aa(n,i,s,f,l)}function pr(n,i){th(n.x,i.x,i.scaleX,i.scale,i.originX),th(n.y,i.y,i.scaleY,i.scale,i.originY)}function Zp(n,i){return Qp(Ex(n.getBoundingClientRect(),i))}function Nx(n,i,s){const l=Zp(n,s),{scroll:u}=i;return u&&(hr(l.x,u.offset.x),hr(l.y,u.offset.y)),l}const qp=({current:n})=>n?n.ownerDocument.defaultView:null,Rx=new WeakMap;class Ax{constructor(i){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Me(),this.visualElement=i}start(i,{snapToCursor:s=!1}={}){const{presenceContext:l}=this.visualElement;if(l&&l.isPresent===!1)return;const u=y=>{const{dragSnapToOrigin:w}=this.getProps();w?this.pauseAnimation():this.stopAnimation(),s&&this.snapToCursor(Ti(y).point)},f=(y,w)=>{const{drag:k,dragPropagation:R,onDragStart:A}=this.getProps();if(k&&!R&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ax(k),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),wt(M=>{let D=this.getAxisMotionValue(M).get()||0;if(zt.test(D)){const{projection:O}=this.visualElement;if(O&&O.layout){const $=O.layout.layoutBox[M];$&&(D=ft($)*(parseFloat(D)/100))}}this.originPoint[M]=D}),A&&xe.postRender(()=>A(y,w)),va(this.visualElement,"transform");const{animationState:j}=this.visualElement;j&&j.setActive("whileDrag",!0)},d=(y,w)=>{const{dragPropagation:k,dragDirectionLock:R,onDirectionLock:A,onDrag:j}=this.getProps();if(!k&&!this.openDragLock)return;const{offset:M}=w;if(R&&this.currentDirection===null){this.currentDirection=Mx(M),this.currentDirection!==null&&A&&A(this.currentDirection);return}this.updateAxis("x",w.point,M),this.updateAxis("y",w.point,M),this.visualElement.render(),j&&j(y,w)},h=(y,w)=>this.stop(y,w),m=()=>wt(y=>{var w;return this.getAnimationState(y)==="paused"&&((w=this.getAxisMotionValue(y).animation)===null||w===void 0?void 0:w.play())}),{dragSnapToOrigin:g}=this.getProps();this.panSession=new bp(i,{onSessionStart:u,onStart:f,onMove:d,onSessionEnd:h,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:qp(this.visualElement)})}stop(i,s){const l=this.isDragging;if(this.cancel(),!l)return;const{velocity:u}=s;this.startAnimation(u);const{onDragEnd:f}=this.getProps();f&&xe.postRender(()=>f(i,s))}cancel(){this.isDragging=!1;const{projection:i,animationState:s}=this.visualElement;i&&(i.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:l}=this.getProps();!l&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}updateAxis(i,s,l){const{drag:u}=this.getProps();if(!l||!Is(i,u,this.currentDirection))return;const f=this.getAxisMotionValue(i);let d=this.originPoint[i]+l[i];this.constraints&&this.constraints[i]&&(d=xx(d,this.constraints[i],this.elastic[i])),f.set(d)}resolveConstraints(){var i;const{dragConstraints:s,dragElastic:l}=this.getProps(),u=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)===null||i===void 0?void 0:i.layout,f=this.constraints;s&&cr(s)?this.constraints||(this.constraints=this.resolveRefConstraints()):s&&u?this.constraints=wx(u.layoutBox,s):this.constraints=!1,this.elastic=Px(l),f!==this.constraints&&u&&this.constraints&&!this.hasMutatedConstraints&&wt(d=>{this.constraints!==!1&&this.getAxisMotionValue(d)&&(this.constraints[d]=Tx(u.layoutBox[d],this.constraints[d]))})}resolveRefConstraints(){const{dragConstraints:i,onMeasureDragConstraints:s}=this.getProps();if(!i||!cr(i))return!1;const l=i.current,{projection:u}=this.visualElement;if(!u||!u.layout)return!1;const f=Nx(l,u.root,this.visualElement.getTransformPagePoint());let d=Sx(u.layout.layoutBox,f);if(s){const h=s(Cx(d));this.hasMutatedConstraints=!!h,h&&(d=Qp(h))}return d}startAnimation(i){const{drag:s,dragMomentum:l,dragElastic:u,dragTransition:f,dragSnapToOrigin:d,onDragTransitionEnd:h}=this.getProps(),m=this.constraints||{},g=wt(y=>{if(!Is(y,s,this.currentDirection))return;let w=m&&m[y]||{};d&&(w={min:0,max:0});const k=u?200:1e6,R=u?40:1e7,A={type:"inertia",velocity:l?i[y]:0,bounceStiffness:k,bounceDamping:R,timeConstant:750,restDelta:1,restSpeed:10,...f,...w};return this.startAxisValueAnimation(y,A)});return Promise.all(g).then(h)}startAxisValueAnimation(i,s){const l=this.getAxisMotionValue(i);return va(this.visualElement,i),l.start(uu(i,l,0,s,this.visualElement,!1))}stopAnimation(){wt(i=>this.getAxisMotionValue(i).stop())}pauseAnimation(){wt(i=>{var s;return(s=this.getAxisMotionValue(i).animation)===null||s===void 0?void 0:s.pause()})}getAnimationState(i){var s;return(s=this.getAxisMotionValue(i).animation)===null||s===void 0?void 0:s.state}getAxisMotionValue(i){const s=`_drag${i.toUpperCase()}`,l=this.visualElement.getProps(),u=l[s];return u||this.visualElement.getValue(i,(l.initial?l.initial[i]:void 0)||0)}snapToCursor(i){wt(s=>{const{drag:l}=this.getProps();if(!Is(s,l,this.currentDirection))return;const{projection:u}=this.visualElement,f=this.getAxisMotionValue(s);if(u&&u.layout){const{min:d,max:h}=u.layout.layoutBox[s];f.set(i[s]-Ce(d,h,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:i,dragConstraints:s}=this.getProps(),{projection:l}=this.visualElement;if(!cr(s)||!l||!this.constraints)return;this.stopAnimation();const u={x:0,y:0};wt(d=>{const h=this.getAxisMotionValue(d);if(h&&this.constraints!==!1){const m=h.get();u[d]=kx({min:m,max:m},this.constraints[d])}});const{transformTemplate:f}=this.visualElement.getProps();this.visualElement.current.style.transform=f?f({},""):"none",l.root&&l.root.updateScroll(),l.updateLayout(),this.resolveConstraints(),wt(d=>{if(!Is(d,i,null))return;const h=this.getAxisMotionValue(d),{min:m,max:g}=this.constraints[d];h.set(Ce(m,g,u[d]))})}addListeners(){if(!this.visualElement.current)return;Rx.set(this.visualElement,this);const i=this.visualElement.current,s=di(i,"pointerdown",m=>{const{drag:g,dragListener:y=!0}=this.getProps();g&&y&&this.start(m)}),l=()=>{const{dragConstraints:m}=this.getProps();cr(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:u}=this.visualElement,f=u.addEventListener("measure",l);u&&!u.layout&&(u.root&&u.root.updateScroll(),u.updateLayout()),xe.read(l);const d=xi(window,"resize",()=>this.scalePositionWithinConstraints()),h=u.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(wt(y=>{const w=this.getAxisMotionValue(y);w&&(this.originPoint[y]+=m[y].translate,w.set(w.get()+m[y].translate))}),this.visualElement.render())}));return()=>{d(),s(),f(),h&&h()}}getProps(){const i=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:l=!1,dragPropagation:u=!1,dragConstraints:f=!1,dragElastic:d=Na,dragMomentum:h=!0}=i;return{...i,drag:s,dragDirectionLock:l,dragPropagation:u,dragConstraints:f,dragElastic:d,dragMomentum:h}}}function Is(n,i,s){return(i===!0||i===n)&&(s===null||s===n)}function Mx(n,i=10){let s=null;return Math.abs(n.y)>i?s="y":Math.abs(n.x)>i&&(s="x"),s}class Dx extends vn{constructor(i){super(i),this.removeGroupControls=dt,this.removeListeners=dt,this.controls=new Ax(i)}mount(){const{dragControls:i}=this.node.getProps();i&&(this.removeGroupControls=i.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||dt}unmount(){this.removeGroupControls(),this.removeListeners()}}const nh=n=>(i,s)=>{n&&xe.postRender(()=>n(i,s))};class Lx extends vn{constructor(){super(...arguments),this.removePointerDownListener=dt}onPointerDown(i){this.session=new bp(i,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:qp(this.node)})}createPanHandlers(){const{onPanSessionStart:i,onPanStart:s,onPan:l,onPanEnd:u}=this.node.getProps();return{onSessionStart:nh(i),onStart:nh(s),onMove:l,onEnd:(f,d)=>{delete this.session,u&&xe.postRender(()=>u(f,d))}}}mount(){this.removePointerDownListener=di(this.node.current,"pointerdown",i=>this.onPointerDown(i))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Us={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function rh(n,i){return i.max===i.min?0:n/(i.max-i.min)*100}const oi={correct:(n,i)=>{if(!i.target)return n;if(typeof n=="string")if(te.test(n))n=parseFloat(n);else return n;const s=rh(n,i.target.x),l=rh(n,i.target.y);return`${s}% ${l}%`}},_x={correct:(n,{treeScale:i,projectionDelta:s})=>{const l=n,u=yn.parse(n);if(u.length>5)return l;const f=yn.createTransformer(n),d=typeof u[0]!="number"?1:0,h=s.x.scale*i.x,m=s.y.scale*i.y;u[0+d]/=h,u[1+d]/=m;const g=Ce(h,m,.5);return typeof u[2+d]=="number"&&(u[2+d]/=g),typeof u[3+d]=="number"&&(u[3+d]/=g),f(u)}};class Vx extends F.Component{componentDidMount(){const{visualElement:i,layoutGroup:s,switchLayoutGroup:l,layoutId:u}=this.props,{projection:f}=i;l0(zx),f&&(s.group&&s.group.add(f),l&&l.register&&u&&l.register(f),f.root.didUpdate(),f.addEventListener("animationComplete",()=>{this.safeToRemove()}),f.setOptions({...f.options,onExitComplete:()=>this.safeToRemove()})),Us.hasEverUpdated=!0}getSnapshotBeforeUpdate(i){const{layoutDependency:s,visualElement:l,drag:u,isPresent:f}=this.props,d=l.projection;return d&&(d.isPresent=f,u||i.layoutDependency!==s||s===void 0?d.willUpdate():this.safeToRemove(),i.isPresent!==f&&(f?d.promote():d.relegate()||xe.postRender(()=>{const h=d.getStack();(!h||!h.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:i}=this.props.visualElement;i&&(i.root.didUpdate(),Ia.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:i,layoutGroup:s,switchLayoutGroup:l}=this.props,{projection:u}=i;u&&(u.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(u),l&&l.deregister&&l.deregister(u))}safeToRemove(){const{safeToRemove:i}=this.props;i&&i()}render(){return null}}function Jp(n){const[i,s]=zh(),l=F.useContext(La);return v.jsx(Vx,{...n,layoutGroup:l,switchLayoutGroup:F.useContext(Hh),isPresent:i,safeToRemove:s})}const zx={borderRadius:{...oi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:oi,borderTopRightRadius:oi,borderBottomLeftRadius:oi,borderBottomRightRadius:oi,boxShadow:_x};function Fx(n,i,s){const l=Ke(n)?n:yi(n);return l.start(uu("",l,i,s)),l.animation}function Ix(n){return n instanceof SVGElement&&n.tagName!=="svg"}const Ox=(n,i)=>n.depth-i.depth;class Bx{constructor(){this.children=[],this.isDirty=!1}add(i){Ya(this.children,i),this.isDirty=!0}remove(i){Xa(this.children,i),this.isDirty=!0}forEach(i){this.isDirty&&this.children.sort(Ox),this.isDirty=!1,this.children.forEach(i)}}function Ux(n,i){const s=Ft.now(),l=({timestamp:u})=>{const f=u-s;f>=i&&(gn(l),n(f-i))};return xe.read(l,!0),()=>gn(l)}const em=["TopLeft","TopRight","BottomLeft","BottomRight"],$x=em.length,ih=n=>typeof n=="string"?parseFloat(n):n,sh=n=>typeof n=="number"||te.test(n);function Wx(n,i,s,l,u,f){u?(n.opacity=Ce(0,s.opacity!==void 0?s.opacity:1,bx(l)),n.opacityExit=Ce(i.opacity!==void 0?i.opacity:1,0,Hx(l))):f&&(n.opacity=Ce(i.opacity!==void 0?i.opacity:1,s.opacity!==void 0?s.opacity:1,l));for(let d=0;d<$x;d++){const h=`border${em[d]}Radius`;let m=oh(i,h),g=oh(s,h);if(m===void 0&&g===void 0)continue;m||(m=0),g||(g=0),m===0||g===0||sh(m)===sh(g)?(n[h]=Math.max(Ce(ih(m),ih(g),l),0),(zt.test(g)||zt.test(m))&&(n[h]+="%")):n[h]=g}(i.rotate||s.rotate)&&(n.rotate=Ce(i.rotate||0,s.rotate||0,l))}function oh(n,i){return n[i]!==void 0?n[i]:n.borderRadius}const bx=tm(0,.5,yp),Hx=tm(.5,.95,dt);function tm(n,i,s){return l=>l<n?0:l>i?1:s(gr(n,i,l))}function lh(n,i){n.min=i.min,n.max=i.max}function xt(n,i){lh(n.x,i.x),lh(n.y,i.y)}function ah(n,i){n.translate=i.translate,n.scale=i.scale,n.originPoint=i.originPoint,n.origin=i.origin}function uh(n,i,s,l,u){return n-=i,n=Qs(n,1/s,l),u!==void 0&&(n=Qs(n,1/u,l)),n}function Kx(n,i=0,s=1,l=.5,u,f=n,d=n){if(zt.test(i)&&(i=parseFloat(i),i=Ce(d.min,d.max,i/100)-d.min),typeof i!="number")return;let h=Ce(f.min,f.max,l);n===f&&(h-=i),n.min=uh(n.min,i,s,h,u),n.max=uh(n.max,i,s,h,u)}function ch(n,i,[s,l,u],f,d){Kx(n,i[s],i[l],i[u],i.scale,f,d)}const Gx=["x","scaleX","originX"],Qx=["y","scaleY","originY"];function dh(n,i,s,l){ch(n.x,i,Gx,s?s.x:void 0,l?l.x:void 0),ch(n.y,i,Qx,s?s.y:void 0,l?l.y:void 0)}function fh(n){return n.translate===0&&n.scale===1}function nm(n){return fh(n.x)&&fh(n.y)}function hh(n,i){return n.min===i.min&&n.max===i.max}function Yx(n,i){return hh(n.x,i.x)&&hh(n.y,i.y)}function ph(n,i){return Math.round(n.min)===Math.round(i.min)&&Math.round(n.max)===Math.round(i.max)}function rm(n,i){return ph(n.x,i.x)&&ph(n.y,i.y)}function mh(n){return ft(n.x)/ft(n.y)}function gh(n,i){return n.translate===i.translate&&n.scale===i.scale&&n.originPoint===i.originPoint}class Xx{constructor(){this.members=[]}add(i){Ya(this.members,i),i.scheduleRender()}remove(i){if(Xa(this.members,i),i===this.prevLead&&(this.prevLead=void 0),i===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(i){const s=this.members.findIndex(u=>i===u);if(s===0)return!1;let l;for(let u=s;u>=0;u--){const f=this.members[u];if(f.isPresent!==!1){l=f;break}}return l?(this.promote(l),!0):!1}promote(i,s){const l=this.lead;if(i!==l&&(this.prevLead=l,this.lead=i,i.show(),l)){l.instance&&l.scheduleRender(),i.scheduleRender(),i.resumeFrom=l,s&&(i.resumeFrom.preserveOpacity=!0),l.snapshot&&(i.snapshot=l.snapshot,i.snapshot.latestValues=l.animationValues||l.latestValues),i.root&&i.root.isUpdating&&(i.isLayoutDirty=!0);const{crossfade:u}=i.options;u===!1&&l.hide()}}exitAnimationComplete(){this.members.forEach(i=>{const{options:s,resumingFrom:l}=i;s.onExitComplete&&s.onExitComplete(),l&&l.options.onExitComplete&&l.options.onExitComplete()})}scheduleRender(){this.members.forEach(i=>{i.instance&&i.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Zx(n,i,s){let l="";const u=n.x.translate/i.x,f=n.y.translate/i.y,d=(s==null?void 0:s.z)||0;if((u||f||d)&&(l=`translate3d(${u}px, ${f}px, ${d}px) `),(i.x!==1||i.y!==1)&&(l+=`scale(${1/i.x}, ${1/i.y}) `),s){const{transformPerspective:g,rotate:y,rotateX:w,rotateY:k,skewX:R,skewY:A}=s;g&&(l=`perspective(${g}px) ${l}`),y&&(l+=`rotate(${y}deg) `),w&&(l+=`rotateX(${w}deg) `),k&&(l+=`rotateY(${k}deg) `),R&&(l+=`skewX(${R}deg) `),A&&(l+=`skewY(${A}deg) `)}const h=n.x.scale*i.x,m=n.y.scale*i.y;return(h!==1||m!==1)&&(l+=`scale(${h}, ${m})`),l||"none"}const _n={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},ai=typeof window<"u"&&window.MotionDebug!==void 0,da=["","X","Y","Z"],qx={visibility:"hidden"},yh=1e3;let Jx=0;function fa(n,i,s,l){const{latestValues:u}=i;u[n]&&(s[n]=u[n],i.setStaticValue(n,0),l&&(l[n]=0))}function im(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:i}=n.options;if(!i)return;const s=lp(i);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:u,layoutId:f}=n.options;window.MotionCancelOptimisedAnimation(s,"transform",xe,!(u||f))}const{parent:l}=n;l&&!l.hasCheckedOptimisedAppear&&im(l)}function sm({attachResizeListener:n,defaultParent:i,measureScroll:s,checkIsScrollRoot:l,resetTransform:u}){return class{constructor(d={},h=i==null?void 0:i()){this.id=Jx++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,ai&&(_n.totalNodes=_n.resolvedTargetDeltas=_n.recalculatedProjection=0),this.nodes.forEach(n1),this.nodes.forEach(l1),this.nodes.forEach(a1),this.nodes.forEach(r1),ai&&window.MotionDebug.record(_n)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=d,this.root=h?h.root||h:this,this.path=h?[...h.path,h]:[],this.parent=h,this.depth=h?h.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new Bx)}addEventListener(d,h){return this.eventHandlers.has(d)||this.eventHandlers.set(d,new Za),this.eventHandlers.get(d).add(h)}notifyListeners(d,...h){const m=this.eventHandlers.get(d);m&&m.notify(...h)}hasListeners(d){return this.eventHandlers.has(d)}mount(d,h=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Ix(d),this.instance=d;const{layoutId:m,layout:g,visualElement:y}=this.options;if(y&&!y.current&&y.mount(d),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),h&&(g||m)&&(this.isLayoutDirty=!0),n){let w;const k=()=>this.root.updateBlockedByResize=!1;n(d,()=>{this.root.updateBlockedByResize=!0,w&&w(),w=Ux(k,250),Us.hasAnimatedSinceResize&&(Us.hasAnimatedSinceResize=!1,this.nodes.forEach(xh))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&y&&(m||g)&&this.addEventListener("didUpdate",({delta:w,hasLayoutChanged:k,hasRelativeTargetChanged:R,layout:A})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const j=this.options.transition||y.getDefaultTransition()||h1,{onLayoutAnimationStart:M,onLayoutAnimationComplete:D}=y.getProps(),O=!this.targetLayout||!rm(this.targetLayout,A)||R,$=!k&&R;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||$||k&&(O||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(w,$);const Q={...Qa(j,"layout"),onPlay:M,onComplete:D};(y.shouldReduceMotion||this.options.layoutRoot)&&(Q.delay=0,Q.type=!1),this.startAnimation(Q)}else k||xh(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=A})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const d=this.getStack();d&&d.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,gn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(u1),this.animationId++)}getTransformTemplate(){const{visualElement:d}=this.options;return d&&d.getProps().transformTemplate}willUpdate(d=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&im(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let y=0;y<this.path.length;y++){const w=this.path[y];w.shouldResetTransform=!0,w.updateScroll("snapshot"),w.options.layoutRoot&&w.willUpdate(!1)}const{layoutId:h,layout:m}=this.options;if(h===void 0&&!m)return;const g=this.getTransformTemplate();this.prevTransformTemplateValue=g?g(this.latestValues,""):void 0,this.updateSnapshot(),d&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(vh);return}this.isUpdating||this.nodes.forEach(s1),this.isUpdating=!1,this.nodes.forEach(o1),this.nodes.forEach(e1),this.nodes.forEach(t1),this.clearAllSnapshots();const h=Ft.now();Be.delta=Qt(0,1e3/60,h-Be.timestamp),Be.timestamp=h,Be.isProcessing=!0,ra.update.process(Be),ra.preRender.process(Be),ra.render.process(Be),Be.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ia.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(i1),this.sharedNodes.forEach(c1)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,xe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){xe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let m=0;m<this.path.length;m++)this.path[m].updateScroll();const d=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Me(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:h}=this.options;h&&h.notify("LayoutMeasure",this.layout.layoutBox,d?d.layoutBox:void 0)}updateScroll(d="measure"){let h=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===d&&(h=!1),h){const m=l(this.instance);this.scroll={animationId:this.root.animationId,phase:d,isRoot:m,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!u)return;const d=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,h=this.projectionDelta&&!nm(this.projectionDelta),m=this.getTransformTemplate(),g=m?m(this.latestValues,""):void 0,y=g!==this.prevTransformTemplateValue;d&&(h||Ln(this.latestValues)||y)&&(u(this.instance,g),this.shouldResetTransform=!1,this.scheduleRender())}measure(d=!0){const h=this.measurePageBox();let m=this.removeElementScroll(h);return d&&(m=this.removeTransform(m)),p1(m),{animationId:this.root.animationId,measuredBox:h,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:h}=this.options;if(!h)return Me();const m=h.measureViewportBox();if(!(((d=this.scroll)===null||d===void 0?void 0:d.wasRoot)||this.path.some(m1))){const{scroll:y}=this.root;y&&(hr(m.x,y.offset.x),hr(m.y,y.offset.y))}return m}removeElementScroll(d){var h;const m=Me();if(xt(m,d),!((h=this.scroll)===null||h===void 0)&&h.wasRoot)return m;for(let g=0;g<this.path.length;g++){const y=this.path[g],{scroll:w,options:k}=y;y!==this.root&&w&&k.layoutScroll&&(w.wasRoot&&xt(m,d),hr(m.x,w.offset.x),hr(m.y,w.offset.y))}return m}applyTransform(d,h=!1){const m=Me();xt(m,d);for(let g=0;g<this.path.length;g++){const y=this.path[g];!h&&y.options.layoutScroll&&y.scroll&&y!==y.root&&pr(m,{x:-y.scroll.offset.x,y:-y.scroll.offset.y}),Ln(y.latestValues)&&pr(m,y.latestValues)}return Ln(this.latestValues)&&pr(m,this.latestValues),m}removeTransform(d){const h=Me();xt(h,d);for(let m=0;m<this.path.length;m++){const g=this.path[m];if(!g.instance||!Ln(g.latestValues))continue;Ra(g.latestValues)&&g.updateSnapshot();const y=Me(),w=g.measurePageBox();xt(y,w),dh(h,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,y)}return Ln(this.latestValues)&&dh(h,this.latestValues),h}setTargetDelta(d){this.targetDelta=d,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(d){this.options={...this.options,...d,crossfade:d.crossfade!==void 0?d.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Be.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(d=!1){var h;const m=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=m.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=m.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=m.isSharedProjectionDirty);const g=!!this.resumingFrom||this!==m;if(!(d||g&&this.isSharedProjectionDirty||this.isProjectionDirty||!((h=this.parent)===null||h===void 0)&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:w,layoutId:k}=this.options;if(!(!this.layout||!(w||k))){if(this.resolvedRelativeTargetAt=Be.timestamp,!this.targetDelta&&!this.relativeTarget){const R=this.getClosestProjectingParent();R&&R.layout&&this.animationProgress!==1?(this.relativeParent=R,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Me(),this.relativeTargetOrigin=Me(),hi(this.relativeTargetOrigin,this.layout.layoutBox,R.layout.layoutBox),xt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Me(),this.targetWithTransforms=Me()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),vx(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):xt(this.target,this.layout.layoutBox),Xp(this.target,this.targetDelta)):xt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const R=this.getClosestProjectingParent();R&&!!R.resumingFrom==!!this.resumingFrom&&!R.options.layoutScroll&&R.target&&this.animationProgress!==1?(this.relativeParent=R,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Me(),this.relativeTargetOrigin=Me(),hi(this.relativeTargetOrigin,this.target,R.target),xt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}ai&&_n.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Ra(this.parent.latestValues)||Yp(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var d;const h=this.getLead(),m=!!this.resumingFrom||this!==h;let g=!0;if((this.isProjectionDirty||!((d=this.parent)===null||d===void 0)&&d.isProjectionDirty)&&(g=!1),m&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(g=!1),this.resolvedRelativeTargetAt===Be.timestamp&&(g=!1),g)return;const{layout:y,layoutId:w}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(y||w))return;xt(this.layoutCorrected,this.layout.layoutBox);const k=this.treeScale.x,R=this.treeScale.y;jx(this.layoutCorrected,this.treeScale,this.path,m),h.layout&&!h.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(h.target=h.layout.layoutBox,h.targetWithTransforms=Me());const{target:A}=h;if(!A){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ah(this.prevProjectionDelta.x,this.projectionDelta.x),ah(this.prevProjectionDelta.y,this.projectionDelta.y)),fi(this.projectionDelta,this.layoutCorrected,A,this.latestValues),(this.treeScale.x!==k||this.treeScale.y!==R||!gh(this.projectionDelta.x,this.prevProjectionDelta.x)||!gh(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",A)),ai&&_n.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(d=!0){var h;if((h=this.options.visualElement)===null||h===void 0||h.scheduleRender(),d){const m=this.getStack();m&&m.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=fr(),this.projectionDelta=fr(),this.projectionDeltaWithTransform=fr()}setAnimationOrigin(d,h=!1){const m=this.snapshot,g=m?m.latestValues:{},y={...this.latestValues},w=fr();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!h;const k=Me(),R=m?m.source:void 0,A=this.layout?this.layout.source:void 0,j=R!==A,M=this.getStack(),D=!M||M.members.length<=1,O=!!(j&&!D&&this.options.crossfade===!0&&!this.path.some(f1));this.animationProgress=0;let $;this.mixTargetDelta=Q=>{const U=Q/1e3;wh(w.x,d.x,U),wh(w.y,d.y,U),this.setTargetDelta(w),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(hi(k,this.layout.layoutBox,this.relativeParent.layout.layoutBox),d1(this.relativeTarget,this.relativeTargetOrigin,k,U),$&&Yx(this.relativeTarget,$)&&(this.isProjectionDirty=!1),$||($=Me()),xt($,this.relativeTarget)),j&&(this.animationValues=y,Wx(y,g,this.latestValues,U,O,D)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=U},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(d){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(gn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=xe.update(()=>{Us.hasAnimatedSinceResize=!0,this.currentAnimation=Fx(0,yh,{...d,onUpdate:h=>{this.mixTargetDelta(h),d.onUpdate&&d.onUpdate(h)},onComplete:()=>{d.onComplete&&d.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const d=this.getStack();d&&d.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(yh),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const d=this.getLead();let{targetWithTransforms:h,target:m,layout:g,latestValues:y}=d;if(!(!h||!m||!g)){if(this!==d&&this.layout&&g&&om(this.options.animationType,this.layout.layoutBox,g.layoutBox)){m=this.target||Me();const w=ft(this.layout.layoutBox.x);m.x.min=d.target.x.min,m.x.max=m.x.min+w;const k=ft(this.layout.layoutBox.y);m.y.min=d.target.y.min,m.y.max=m.y.min+k}xt(h,m),pr(h,y),fi(this.projectionDeltaWithTransform,this.layoutCorrected,h,y)}}registerSharedNode(d,h){this.sharedNodes.has(d)||this.sharedNodes.set(d,new Xx),this.sharedNodes.get(d).add(h);const g=h.options.initialPromotionConfig;h.promote({transition:g?g.transition:void 0,preserveFollowOpacity:g&&g.shouldPreserveFollowOpacity?g.shouldPreserveFollowOpacity(h):void 0})}isLead(){const d=this.getStack();return d?d.lead===this:!0}getLead(){var d;const{layoutId:h}=this.options;return h?((d=this.getStack())===null||d===void 0?void 0:d.lead)||this:this}getPrevLead(){var d;const{layoutId:h}=this.options;return h?(d=this.getStack())===null||d===void 0?void 0:d.prevLead:void 0}getStack(){const{layoutId:d}=this.options;if(d)return this.root.sharedNodes.get(d)}promote({needsReset:d,transition:h,preserveFollowOpacity:m}={}){const g=this.getStack();g&&g.promote(this,m),d&&(this.projectionDelta=void 0,this.needsReset=!0),h&&this.setOptions({transition:h})}relegate(){const d=this.getStack();return d?d.relegate(this):!1}resetSkewAndRotation(){const{visualElement:d}=this.options;if(!d)return;let h=!1;const{latestValues:m}=d;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(h=!0),!h)return;const g={};m.z&&fa("z",d,g,this.animationValues);for(let y=0;y<da.length;y++)fa(`rotate${da[y]}`,d,g,this.animationValues),fa(`skew${da[y]}`,d,g,this.animationValues);d.render();for(const y in g)d.setStaticValue(y,g[y]),this.animationValues&&(this.animationValues[y]=g[y]);d.scheduleRender()}getProjectionStyles(d){var h,m;if(!this.instance||this.isSVG)return;if(!this.isVisible)return qx;const g={visibility:""},y=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=Os(d==null?void 0:d.pointerEvents)||"",g.transform=y?y(this.latestValues,""):"none",g;const w=this.getLead();if(!this.projectionDelta||!this.layout||!w.target){const j={};return this.options.layoutId&&(j.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,j.pointerEvents=Os(d==null?void 0:d.pointerEvents)||""),this.hasProjected&&!Ln(this.latestValues)&&(j.transform=y?y({},""):"none",this.hasProjected=!1),j}const k=w.animationValues||w.latestValues;this.applyTransformsToTarget(),g.transform=Zx(this.projectionDeltaWithTransform,this.treeScale,k),y&&(g.transform=y(k,g.transform));const{x:R,y:A}=this.projectionDelta;g.transformOrigin=`${R.origin*100}% ${A.origin*100}% 0`,w.animationValues?g.opacity=w===this?(m=(h=k.opacity)!==null&&h!==void 0?h:this.latestValues.opacity)!==null&&m!==void 0?m:1:this.preserveOpacity?this.latestValues.opacity:k.opacityExit:g.opacity=w===this?k.opacity!==void 0?k.opacity:"":k.opacityExit!==void 0?k.opacityExit:0;for(const j in Ws){if(k[j]===void 0)continue;const{correct:M,applyTo:D}=Ws[j],O=g.transform==="none"?k[j]:M(k[j],w);if(D){const $=D.length;for(let Q=0;Q<$;Q++)g[D[Q]]=O}else g[j]=O}return this.options.layoutId&&(g.pointerEvents=w===this?Os(d==null?void 0:d.pointerEvents)||"":"none"),g}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(d=>{var h;return(h=d.currentAnimation)===null||h===void 0?void 0:h.stop()}),this.root.nodes.forEach(vh),this.root.sharedNodes.clear()}}}function e1(n){n.updateLayout()}function t1(n){var i;const s=((i=n.resumeFrom)===null||i===void 0?void 0:i.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&s&&n.hasListeners("didUpdate")){const{layoutBox:l,measuredBox:u}=n.layout,{animationType:f}=n.options,d=s.source!==n.layout.source;f==="size"?wt(w=>{const k=d?s.measuredBox[w]:s.layoutBox[w],R=ft(k);k.min=l[w].min,k.max=k.min+R}):om(f,s.layoutBox,l)&&wt(w=>{const k=d?s.measuredBox[w]:s.layoutBox[w],R=ft(l[w]);k.max=k.min+R,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[w].max=n.relativeTarget[w].min+R)});const h=fr();fi(h,l,s.layoutBox);const m=fr();d?fi(m,n.applyTransform(u,!0),s.measuredBox):fi(m,l,s.layoutBox);const g=!nm(h);let y=!1;if(!n.resumeFrom){const w=n.getClosestProjectingParent();if(w&&!w.resumeFrom){const{snapshot:k,layout:R}=w;if(k&&R){const A=Me();hi(A,s.layoutBox,k.layoutBox);const j=Me();hi(j,l,R.layoutBox),rm(A,j)||(y=!0),w.options.layoutRoot&&(n.relativeTarget=j,n.relativeTargetOrigin=A,n.relativeParent=w)}}}n.notifyListeners("didUpdate",{layout:l,snapshot:s,delta:m,layoutDelta:h,hasLayoutChanged:g,hasRelativeTargetChanged:y})}else if(n.isLead()){const{onExitComplete:l}=n.options;l&&l()}n.options.transition=void 0}function n1(n){ai&&_n.totalNodes++,n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function r1(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function i1(n){n.clearSnapshot()}function vh(n){n.clearMeasurements()}function s1(n){n.isLayoutDirty=!1}function o1(n){const{visualElement:i}=n.options;i&&i.getProps().onBeforeLayoutMeasure&&i.notify("BeforeLayoutMeasure"),n.resetTransform()}function xh(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function l1(n){n.resolveTargetDelta()}function a1(n){n.calcProjection()}function u1(n){n.resetSkewAndRotation()}function c1(n){n.removeLeadSnapshot()}function wh(n,i,s){n.translate=Ce(i.translate,0,s),n.scale=Ce(i.scale,1,s),n.origin=i.origin,n.originPoint=i.originPoint}function Sh(n,i,s,l){n.min=Ce(i.min,s.min,l),n.max=Ce(i.max,s.max,l)}function d1(n,i,s,l){Sh(n.x,i.x,s.x,l),Sh(n.y,i.y,s.y,l)}function f1(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const h1={duration:.45,ease:[.4,0,.1,1]},kh=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),Th=kh("applewebkit/")&&!kh("chrome/")?Math.round:dt;function Ph(n){n.min=Th(n.min),n.max=Th(n.max)}function p1(n){Ph(n.x),Ph(n.y)}function om(n,i,s){return n==="position"||n==="preserve-aspect"&&!yx(mh(i),mh(s),.2)}function m1(n){var i;return n!==n.root&&((i=n.scroll)===null||i===void 0?void 0:i.wasRoot)}const g1=sm({attachResizeListener:(n,i)=>xi(n,"resize",i),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ha={current:void 0},lm=sm({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!ha.current){const n=new g1({});n.mount(window),n.setOptions({layoutScroll:!0}),ha.current=n}return ha.current},resetTransform:(n,i)=>{n.style.transform=i!==void 0?i:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),y1={pan:{Feature:Lx},drag:{Feature:Dx,ProjectionNode:lm,MeasureLayout:Jp}};function v1(n,i,s){var l;if(n instanceof Element)return[n];if(typeof n=="string"){let u=document;const f=(l=void 0)!==null&&l!==void 0?l:u.querySelectorAll(n);return f?Array.from(f):[]}return Array.from(n)}function am(n,i){const s=v1(n),l=new AbortController,u={passive:!0,...i,signal:l.signal};return[s,u,()=>l.abort()]}function Ch(n){return i=>{i.pointerType==="touch"||Wp()||n(i)}}function x1(n,i,s={}){const[l,u,f]=am(n,s),d=Ch(h=>{const{target:m}=h,g=i(h);if(typeof g!="function"||!m)return;const y=Ch(w=>{g(w),m.removeEventListener("pointerleave",y)});m.addEventListener("pointerleave",y,u)});return l.forEach(h=>{h.addEventListener("pointerenter",d,u)}),f}function Eh(n,i,s){const{props:l}=n;n.animationState&&l.whileHover&&n.animationState.setActive("whileHover",s==="Start");const u="onHover"+s,f=l[u];f&&xe.postRender(()=>f(i,Ti(i)))}class w1 extends vn{mount(){const{current:i}=this.node;i&&(this.unmount=x1(i,s=>(Eh(this.node,s,"Start"),l=>Eh(this.node,l,"End"))))}unmount(){}}class S1 extends vn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let i=!1;try{i=this.node.current.matches(":focus-visible")}catch{i=!0}!i||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ki(xi(this.node.current,"focus",()=>this.onFocus()),xi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const um=(n,i)=>i?n===i?!0:um(n,i.parentElement):!1,k1=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function T1(n){return k1.has(n.tagName)||n.tabIndex!==-1}const ui=new WeakSet;function jh(n){return i=>{i.key==="Enter"&&n(i)}}function pa(n,i){n.dispatchEvent(new PointerEvent("pointer"+i,{isPrimary:!0,bubbles:!0}))}const P1=(n,i)=>{const s=n.currentTarget;if(!s)return;const l=jh(()=>{if(ui.has(s))return;pa(s,"down");const u=jh(()=>{pa(s,"up")}),f=()=>pa(s,"cancel");s.addEventListener("keyup",u,i),s.addEventListener("blur",f,i)});s.addEventListener("keydown",l,i),s.addEventListener("blur",()=>s.removeEventListener("keydown",l),i)};function Nh(n){return cu(n)&&!Wp()}function C1(n,i,s={}){const[l,u,f]=am(n,s),d=h=>{const m=h.currentTarget;if(!Nh(h)||ui.has(m))return;ui.add(m);const g=i(h),y=(R,A)=>{window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",k),!(!Nh(R)||!ui.has(m))&&(ui.delete(m),typeof g=="function"&&g(R,{success:A}))},w=R=>{y(R,s.useGlobalTarget||um(m,R.target))},k=R=>{y(R,!1)};window.addEventListener("pointerup",w,u),window.addEventListener("pointercancel",k,u)};return l.forEach(h=>{!T1(h)&&h.getAttribute("tabindex")===null&&(h.tabIndex=0),(s.useGlobalTarget?window:h).addEventListener("pointerdown",d,u),h.addEventListener("focus",g=>P1(g,u),u)}),f}function Rh(n,i,s){const{props:l}=n;n.animationState&&l.whileTap&&n.animationState.setActive("whileTap",s==="Start");const u="onTap"+(s==="End"?"":s),f=l[u];f&&xe.postRender(()=>f(i,Ti(i)))}class E1 extends vn{mount(){const{current:i}=this.node;i&&(this.unmount=C1(i,s=>(Rh(this.node,s,"Start"),(l,{success:u})=>Rh(this.node,l,u?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ma=new WeakMap,ma=new WeakMap,j1=n=>{const i=Ma.get(n.target);i&&i(n)},N1=n=>{n.forEach(j1)};function R1({root:n,...i}){const s=n||document;ma.has(s)||ma.set(s,{});const l=ma.get(s),u=JSON.stringify(i);return l[u]||(l[u]=new IntersectionObserver(N1,{root:n,...i})),l[u]}function A1(n,i,s){const l=R1(i);return Ma.set(n,s),l.observe(n),()=>{Ma.delete(n),l.unobserve(n)}}const M1={some:0,all:1};class D1 extends vn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:i={}}=this.node.getProps(),{root:s,margin:l,amount:u="some",once:f}=i,d={root:s?s.current:void 0,rootMargin:l,threshold:typeof u=="number"?u:M1[u]},h=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,f&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:y,onViewportLeave:w}=this.node.getProps(),k=g?y:w;k&&k(m)};return A1(this.node.current,d,h)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:i,prevProps:s}=this.node;["amount","margin","root"].some(L1(i,s))&&this.startObserver()}unmount(){}}function L1({viewport:n={}},{viewport:i={}}={}){return s=>n[s]!==i[s]}const _1={inView:{Feature:D1},tap:{Feature:E1},focus:{Feature:S1},hover:{Feature:w1}},V1={layout:{ProjectionNode:lm,MeasureLayout:Jp}},Ys={current:null},du={current:!1};function cm(){if(du.current=!0,!!_a)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),i=()=>Ys.current=n.matches;n.addListener(i),i()}else Ys.current=!1}const z1=[...Mp,He,yn],F1=n=>z1.find(Ap(n)),Ah=new WeakMap;function I1(n,i,s){for(const l in i){const u=i[l],f=s[l];if(Ke(u))n.addValue(l,u);else if(Ke(f))n.addValue(l,yi(u,{owner:n}));else if(f!==u)if(n.hasValue(l)){const d=n.getValue(l);d.liveStyle===!0?d.jump(u):d.hasAnimated||d.set(u)}else{const d=n.getStaticValue(l);n.addValue(l,yi(d!==void 0?d:u,{owner:n}))}}for(const l in s)i[l]===void 0&&n.removeValue(l);return i}const Mh=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class O1{scrapeMotionValuesFromProps(i,s,l){return{}}constructor({parent:i,props:s,presenceContext:l,reducedMotionConfig:u,blockInitialAnimation:f,visualState:d},h={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ou,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const R=Ft.now();this.renderScheduledAt<R&&(this.renderScheduledAt=R,xe.render(this.render,!1,!0))};const{latestValues:m,renderState:g,onUpdate:y}=d;this.onUpdate=y,this.latestValues=m,this.baseTarget={...m},this.initialValues=s.initial?{...m}:{},this.renderState=g,this.parent=i,this.props=s,this.presenceContext=l,this.depth=i?i.depth+1:0,this.reducedMotionConfig=u,this.options=h,this.blockInitialAnimation=!!f,this.isControllingVariants=to(s),this.isVariantNode=Wh(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(i&&i.current);const{willChange:w,...k}=this.scrapeMotionValuesFromProps(s,{},this);for(const R in k){const A=k[R];m[R]!==void 0&&Ke(A)&&A.set(m[R],!1)}}mount(i){this.current=i,Ah.set(i,this),this.projection&&!this.projection.instance&&this.projection.mount(i),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,l)=>this.bindToMotionValue(l,s)),du.current||cm(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Ys.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ah.delete(this.current),this.projection&&this.projection.unmount(),gn(this.notifyUpdate),gn(this.render),this.valueSubscriptions.forEach(i=>i()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const i in this.events)this.events[i].clear();for(const i in this.features){const s=this.features[i];s&&(s.unmount(),s.isMounted=!1)}this.current=null}bindToMotionValue(i,s){this.valueSubscriptions.has(i)&&this.valueSubscriptions.get(i)();const l=In.has(i),u=s.on("change",h=>{this.latestValues[i]=h,this.props.onUpdate&&xe.preRender(this.notifyUpdate),l&&this.projection&&(this.projection.isTransformDirty=!0)}),f=s.on("renderRequest",this.scheduleRender);let d;window.MotionCheckAppearSync&&(d=window.MotionCheckAppearSync(this,i,s)),this.valueSubscriptions.set(i,()=>{u(),f(),d&&d(),s.owner&&s.stop()})}sortNodePosition(i){return!this.current||!this.sortInstanceNodePosition||this.type!==i.type?0:this.sortInstanceNodePosition(this.current,i.current)}updateFeatures(){let i="animation";for(i in mr){const s=mr[i];if(!s)continue;const{isEnabled:l,Feature:u}=s;if(!this.features[i]&&u&&l(this.props)&&(this.features[i]=new u(this)),this.features[i]){const f=this.features[i];f.isMounted?f.update():(f.mount(),f.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Me()}getStaticValue(i){return this.latestValues[i]}setStaticValue(i,s){this.latestValues[i]=s}update(i,s){(i.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=i,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let l=0;l<Mh.length;l++){const u=Mh[l];this.propEventSubscriptions[u]&&(this.propEventSubscriptions[u](),delete this.propEventSubscriptions[u]);const f="on"+u,d=i[f];d&&(this.propEventSubscriptions[u]=this.on(u,d))}this.prevMotionValues=I1(this,this.scrapeMotionValuesFromProps(i,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(i){return this.props.variants?this.props.variants[i]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(i){const s=this.getClosestVariantNode();if(s)return s.variantChildren&&s.variantChildren.add(i),()=>s.variantChildren.delete(i)}addValue(i,s){const l=this.values.get(i);s!==l&&(l&&this.removeValue(i),this.bindToMotionValue(i,s),this.values.set(i,s),this.latestValues[i]=s.get())}removeValue(i){this.values.delete(i);const s=this.valueSubscriptions.get(i);s&&(s(),this.valueSubscriptions.delete(i)),delete this.latestValues[i],this.removeValueFromRenderState(i,this.renderState)}hasValue(i){return this.values.has(i)}getValue(i,s){if(this.props.values&&this.props.values[i])return this.props.values[i];let l=this.values.get(i);return l===void 0&&s!==void 0&&(l=yi(s===null?void 0:s,{owner:this}),this.addValue(i,l)),l}readValue(i,s){var l;let u=this.latestValues[i]!==void 0||!this.current?this.latestValues[i]:(l=this.getBaseTargetFromProps(this.props,i))!==null&&l!==void 0?l:this.readValueFromInstance(this.current,i,this.options);return u!=null&&(typeof u=="string"&&(Np(u)||xp(u))?u=parseFloat(u):!F1(u)&&yn.test(s)&&(u=Cp(i,s)),this.setBaseTarget(i,Ke(u)?u.get():u)),Ke(u)?u.get():u}setBaseTarget(i,s){this.baseTarget[i]=s}getBaseTarget(i){var s;const{initial:l}=this.props;let u;if(typeof l=="string"||typeof l=="object"){const d=Ba(this.props,l,(s=this.presenceContext)===null||s===void 0?void 0:s.custom);d&&(u=d[i])}if(l&&u!==void 0)return u;const f=this.getBaseTargetFromProps(this.props,i);return f!==void 0&&!Ke(f)?f:this.initialValues[i]!==void 0&&u===void 0?void 0:this.baseTarget[i]}on(i,s){return this.events[i]||(this.events[i]=new Za),this.events[i].add(s)}notify(i,...s){this.events[i]&&this.events[i].notify(...s)}}class dm extends O1{constructor(){super(...arguments),this.KeyframeResolver=Dp}sortInstanceNodePosition(i,s){return i.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(i,s){return i.style?i.style[s]:void 0}removeValueFromRenderState(i,{vars:s,style:l}){delete s[i],delete l[i]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:i}=this.props;Ke(i)&&(this.childSubscription=i.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}function B1(n){return window.getComputedStyle(n)}class U1 extends dm{constructor(){super(...arguments),this.type="html",this.renderInstance=qh}readValueFromInstance(i,s){if(In.has(s)){const l=su(s);return l&&l.default||0}else{const l=B1(i),u=(Yh(s)?l.getPropertyValue(s):l[s])||0;return typeof u=="string"?u.trim():u}}measureInstanceViewportBox(i,{transformPagePoint:s}){return Zp(i,s)}build(i,s,l){Wa(i,s,l.transformTemplate)}scrapeMotionValuesFromProps(i,s,l){return Ga(i,s,l)}}class $1 extends dm{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Me}getBaseTargetFromProps(i,s){return i[s]}readValueFromInstance(i,s){if(In.has(s)){const l=su(s);return l&&l.default||0}return s=Jh.has(s)?s:Fa(s),i.getAttribute(s)}scrapeMotionValuesFromProps(i,s,l){return np(i,s,l)}build(i,s,l){ba(i,s,this.isSVGTag,l.transformTemplate)}renderInstance(i,s,l,u){ep(i,s,l,u)}mount(i){this.isSVGTag=Ka(i.tagName),super.mount(i)}}const W1=(n,i)=>Oa(n)?new $1(i):new U1(i,{allowProjection:n!==F.Fragment}),b1=g0({...lx,..._1,...y1,...V1},W1),St=My(b1);function fu(){!du.current&&cm();const[n]=F.useState(Ys.current);return n}const H1={check:v.jsx("path",{d:"m5 12 4 4L19 6"}),chevron:v.jsx("path",{d:"m6 9 6 6 6-6"}),clock:v.jsxs(v.Fragment,{children:[v.jsx("circle",{cx:"12",cy:"12",r:"9"}),v.jsx("path",{d:"M12 7v5l3 2"})]}),close:v.jsx("path",{d:"m6 6 12 12M18 6 6 18"}),layers:v.jsxs(v.Fragment,{children:[v.jsx("path",{d:"m12 3 9 5-9 5-9-5 9-5Z"}),v.jsx("path",{d:"m3 12 9 5 9-5M3 16l9 5 9-5"})]}),phone:v.jsxs(v.Fragment,{children:[v.jsx("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2.5"}),v.jsx("path",{d:"M11 18.5h2"})]}),reply:v.jsx("path",{d:"m9 5-6 6 6 6v-4h4a6 6 0 0 1 6 6v-3a6 6 0 0 0-6-6H9V5Z"}),restart:v.jsx(v.Fragment,{children:v.jsx("path",{d:"M3 12a9 9 0 1 1 2.5 6.2M3 4v8h8"})}),send:v.jsx(v.Fragment,{children:v.jsx("path",{d:"m21 3-7 18-3.5-7.5L3 10l18-7ZM21 3 10.5 13.5"})}),terminal:v.jsxs(v.Fragment,{children:[v.jsx("rect",{x:"3",y:"5",width:"18",height:"14",rx:"3"}),v.jsx("path",{d:"m7 9 3 3-3 3m6 0h4"})]}),warning:v.jsxs(v.Fragment,{children:[v.jsx("path",{d:"m10.2 5-7 12a2 2 0 0 0 1.7 3h14.2a2 2 0 0 0 1.7-3l-7-12a2 2 0 0 0-3.6 0Z"}),v.jsx("path",{d:"M12 9v4m0 3h.01"})]})};function ke({name:n,...i}){return v.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.65",strokeLinecap:"round",strokeLinejoin:"round",...i,children:H1[n]})}function K1({mode:n,connected:i,sessions:s,showPhone:l,onTogglePhone:u,onRestart:f}){const d=[{label:"Running",count:s.filter(h=>h.status==="running").length,dot:"bg-emerald-400",text:"text-emerald-300"},{label:"Waiting",count:s.filter(h=>h.status.startsWith("waiting_")).length,dot:"bg-amber-400",text:"text-amber-300"},{label:"Done",count:s.filter(h=>h.status==="done").length,dot:"bg-violet-400",text:"text-violet-300"}];return v.jsx("header",{className:"deck-header",children:v.jsxs("div",{className:"deck-header-inner",children:[v.jsxs("div",{className:"flex items-center gap-2.5",children:[v.jsxs("span",{"aria-hidden":"true",className:"brand-mark",children:[v.jsx("i",{}),v.jsx("i",{}),v.jsx("i",{}),v.jsx("i",{})]}),v.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"AgentDeck"})]}),v.jsx("ul",{className:"status-strip","aria-label":"Session status counts",children:d.map(h=>v.jsxs("li",{className:"flex items-center gap-2 whitespace-nowrap px-2.5 py-1.5 text-xs text-zinc-300 sm:px-3.5",children:[h.label==="Done"?v.jsx(ke,{name:"check",className:"size-3.5 text-violet-300"}):v.jsx("span",{"aria-hidden":"true",className:`size-1.5 rounded-full ${h.dot}`}),v.jsx("span",{className:`tabular font-mono font-semibold ${h.text}`,children:h.count})," ",h.label]},h.label))}),v.jsxs("div",{className:"header-controls flex min-w-0 flex-wrap items-center justify-end gap-2.5",children:[v.jsx("span",{className:`rounded-md border px-2 py-1 font-mono text-[10px] font-semibold uppercase tracking-wider ${n==="demo"?"border-amber-400/25 bg-amber-400/10 text-amber-200":"border-emerald-400/25 bg-emerald-400/10 text-emerald-200"}`,children:n}),v.jsxs("span",{role:"status",className:"flex items-center gap-1.5 text-xs text-zinc-300",children:[v.jsx("span",{className:`size-1.5 rounded-full ${i?"bg-emerald-400":"bg-zinc-500"}`,"aria-hidden":"true"}),i?"Connected":"Offline"]}),n==="demo"&&v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsxs("button",{type:"button",className:"deck-button","aria-label":"Toggle phone preview","aria-pressed":l,"aria-keyshortcuts":"P",onClick:u,children:[v.jsx(ke,{name:"phone",className:`size-3.5 ${l?"text-sky-300":""}`})," ",v.jsx("kbd",{children:"P"})]}),v.jsxs("button",{type:"button",className:"deck-button","aria-label":"Restart demo","aria-keyshortcuts":"R",onClick:f,disabled:!i,children:[v.jsx(ke,{name:"restart",className:"size-3.5"})," ",v.jsx("kbd",{children:"R"})]})]})]})]})})}const ga=["input","output","cacheRead","cacheCreation"],fm=2e3,hm=n=>n>=1e6?`${(n/1e6).toFixed(2)}M`:n>=1e3?`${(n/1e3).toFixed(1)}k`:String(Math.round(n)),Dh=n=>{const i=Math.max(0,Math.floor(n/1e3)),s=Math.floor(i/60);return s>0?`${s}m ${String(i%60).padStart(2,"0")}s`:`${i}s`},G1={running:{label:"Running",dot:"bg-emerald-400",text:"text-emerald-300",border:"border-emerald-500/30",glow:"shadow-emerald-500/10"},waiting_approval:{label:"Waiting Approval",dot:"bg-amber-400",text:"text-amber-300",border:"border-amber-400/70",glow:"shadow-amber-500/25"},waiting_input:{label:"Waiting Input",dot:"bg-sky-400",text:"text-sky-300",border:"border-sky-500/40",glow:"shadow-sky-500/10"},idle:{label:"Idle",dot:"bg-zinc-500",text:"text-zinc-400",border:"border-zinc-700",glow:"shadow-black/0"},done:{label:"Done",dot:"bg-violet-400",text:"text-violet-300",border:"border-violet-500/30",glow:"shadow-violet-500/10"},waiting_terminal:{label:"Waiting Terminal",dot:"bg-orange-400",text:"text-orange-300",border:"border-orange-500/40",glow:"shadow-orange-500/10"}},pm={unrated:"bg-zinc-700 text-zinc-200",low:"bg-zinc-700 text-zinc-200",medium:"bg-amber-500/20 text-amber-300 ring-1 ring-amber-500/40",high:"bg-red-500/20 text-red-300 ring-1 ring-red-500/50"},Xs={"claude-code":"Claude Code",codex:"Codex",zcode:"ZCode",antigravity:"Antigravity",generic:"CLI"};function Q1({approval:n,decision:i}){if(!i)return;if(i.by==="timeout")return{label:"Timed out · Return to terminal",style:"text-amber-200"};if(i.by==="session_end")return{label:"Session ended",style:"text-zinc-300"};if(i.by==="cancelled")return{label:"Cancelled",style:"text-zinc-300"};if(i.action==="defer")return{label:"Continue in Codex",style:"text-zinc-300"};const s={approve:"Approved",reject:"Rejected",reply:"Reply sent"}[i.action],l=i.by==="telegram"?" · via Telegram":i.by==="web"?" · via Web":"",u=i.resolvedAt===void 0?"":` · ${(Math.max(0,i.resolvedAt-n.createdAt)/1e3).toFixed(1)}s`;return{label:s+u+l,style:i.action==="reject"?"text-zinc-300":"text-emerald-200"}}function Y1({text:n,durationMs:i}){const s=fu(),[l,u]=F.useState(0),f=Array.from(n),d=f.length;return F.useEffect(()=>{if(s||!d)return;const h=performance.now();let m=0;function g(y){const w=Math.min(1,(y-h)/i);u(Math.ceil(w*d)),w<1&&(m=requestAnimationFrame(g))}return m=requestAnimationFrame(g),()=>cancelAnimationFrame(m)},[i,d,s]),v.jsxs("p",{className:"phone-input min-h-10","aria-label":n,children:[s?n:f.slice(0,l).join(""),v.jsx("span",{"aria-hidden":"true",className:"phone-caret"})]})}function X1({messages:n,replayReply:i,connected:s,onDecide:l}){const[u,f]=F.useState(),d=F.useRef(null),h=F.useRef(null),m=u&&n.find(A=>A.approval.id===u.approvalId&&!A.decision),g=i&&n.find(A=>A.approval.id===i.approvalId&&!A.decision),y=m??g,w=y==null?void 0:y.approval.id,k=n.filter(A=>!A.decision).length;F.useEffect(()=>{u&&!m&&f(void 0)},[u,m]),F.useLayoutEffect(()=>{var A;m&&((A=h.current)==null||A.focus({preventScroll:!0}))},[m==null?void 0:m.approval.id]),F.useLayoutEffect(()=>{if(d.current)if(w){const A=Array.from(d.current.children).find(M=>M.getAttribute("data-approval-id")===w),j=d.current.getBoundingClientRect();if(A){const M=A.getBoundingClientRect();M.top<j.top?d.current.scrollTop+=M.top-j.top-12:M.bottom>j.bottom&&(d.current.scrollTop+=M.bottom-j.bottom+12)}}else d.current.scrollTop=d.current.scrollHeight},[n,w]);function R(A){A.preventDefault();const j=u==null?void 0:u.text.trim();m&&j&&s&&l(m.approval.id,"reply",j)}return v.jsxs("section",{"aria-labelledby":"phone-title",className:"phone-panel panel rounded-2xl px-4 pt-4 sm:px-5 xl:px-6",children:[v.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(ke,{name:"phone",className:"size-4 text-sky-300"}),v.jsx("h2",{id:"phone-title",className:"section-title",children:"Telegram preview"})]}),v.jsx("span",{className:"rounded-md border border-sky-400/20 bg-sky-400/10 px-2 py-1 font-mono text-[10px] font-medium uppercase tracking-wider text-sky-200",children:"Simulated"})]}),v.jsx("div",{className:"phone-frame",children:v.jsxs("div",{className:"phone-screen",children:[v.jsx("div",{className:"phone-hardware","aria-hidden":"true",children:v.jsx("span",{})}),v.jsxs("div",{className:"phone-chat-header",children:[v.jsx("span",{className:"grid size-9 shrink-0 place-items-center rounded-full bg-sky-500 text-white",children:v.jsx(ke,{name:"send",className:"size-4.5"})}),v.jsxs("div",{className:"min-w-0",children:[v.jsx("p",{className:"truncate text-sm font-semibold text-slate-50",children:"AgentDeck Bot"}),v.jsx("p",{className:"text-[11px] text-sky-200/80",children:k?`${k} pending ${k===1?"approval":"approvals"}`:"Telegram bot"})]})]}),v.jsxs("ol",{ref:d,className:"phone-feed","aria-label":"Approval messages",children:[!n.length&&v.jsx("li",{className:"m-auto max-w-52 rounded-xl bg-slate-950/55 px-3 py-2 text-center text-xs leading-relaxed text-slate-200",children:"Approval requests will appear in this chat."}),v.jsx(Fn,{initial:!1,children:n.map(A=>{const{approval:j,sessionTitle:M,decision:D}=A,O=Q1(A);return v.jsxs(St.li,{"data-approval-id":j.id,initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0},transition:{duration:.2},children:[v.jsxs("div",{className:"phone-bubble",children:[v.jsxs("div",{className:"flex items-center justify-between gap-2",children:[v.jsx("p",{className:"truncate text-xs font-semibold text-sky-200",title:M,children:M}),v.jsx("span",{className:`shrink-0 rounded px-1.5 py-0.5 font-mono text-[9px] font-semibold uppercase ${pm[j.risk]}`,children:j.risk})]}),v.jsx("p",{className:"mt-1 text-sm font-medium text-slate-100",children:j.summary}),v.jsx("code",{className:"mt-1 block break-all font-mono text-[11px] text-slate-300",children:j.detail.command??j.detail.filePath??j.detail.tool}),O&&v.jsxs(St.p,{initial:{opacity:0},animate:{opacity:1},className:`mt-2 flex items-center gap-1.5 border-t border-slate-600/60 pt-2 text-[11px] font-medium ${O.style}`,children:[v.jsx(ke,{name:(D==null?void 0:D.action)==="approve"?"check":(D==null?void 0:D.action)==="reply"?"reply":(D==null?void 0:D.by)==="timeout"?"clock":"close",className:"size-3.5 shrink-0"}),O.label]})]}),!D&&v.jsxs("div",{className:"phone-actions",children:[v.jsxs("button",{type:"button",disabled:!s,onClick:()=>l(j.id,"approve"),children:[v.jsx(ke,{name:"check",className:"size-3.5"}),"Approve"]}),v.jsx("button",{type:"button",disabled:!s,onClick:()=>l(j.id,"reject"),children:"Reject"}),v.jsxs("button",{type:"button",disabled:!s,"aria-expanded":w===j.id,onClick:()=>f($=>($==null?void 0:$.approvalId)===j.id?void 0:{approvalId:j.id,text:""}),children:[v.jsx(ke,{name:"reply",className:"size-3.5"}),"Reply"]})]}),(D==null?void 0:D.action)==="reply"&&D.text&&v.jsxs("p",{className:"phone-outgoing",children:[D.text," ",v.jsx(ke,{name:"check",className:"ml-1 inline size-3.5 text-sky-200"})]})]},j.id)})})]}),v.jsx(Fn,{initial:!1,children:y&&v.jsxs(St.form,{className:"phone-composer",initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:8},transition:{duration:.18},onSubmit:R,children:[v.jsxs("div",{className:"mb-2 flex items-center gap-2 text-xs text-sky-200",children:[v.jsx(ke,{name:"reply",className:"size-3.5 shrink-0"}),v.jsxs("span",{className:"truncate",children:["Replying to ",v.jsx("strong",{children:y.sessionTitle})]}),m&&v.jsx("button",{type:"button","aria-label":"Cancel reply",className:"ml-auto rounded p-0.5 text-slate-300 hover:text-white",onClick:()=>f(void 0),children:v.jsx(ke,{name:"close",className:"size-4"})})]}),v.jsxs("div",{className:"flex items-end gap-2",children:[m?v.jsx("textarea",{ref:h,rows:2,maxLength:fm,"aria-label":"Telegram reply",placeholder:"Write a reply…",className:"phone-input resize-none",value:(u==null?void 0:u.text)??"",onChange:A=>f({approvalId:m.approval.id,text:A.target.value})}):i&&v.jsx(Y1,{text:i.text,durationMs:i.durationMs},i.approvalId),v.jsx("button",{type:"submit","aria-label":"Send Telegram reply",disabled:!m||!s||!(u!=null&&u.text.trim()),className:"grid size-9 shrink-0 place-items-center rounded-full bg-sky-400 text-slate-950 hover:bg-sky-300 disabled:opacity-55",children:v.jsx(ke,{name:"send",className:"size-4.5"})})]})]},w)}),v.jsx("div",{className:"phone-home","aria-hidden":"true",children:v.jsx("span",{})})]})})]})}function Lh({approval:n,connected:i,onDecide:s}){const[l,u]=F.useState(!1),[f,d]=F.useState(""),h=n.origin?Xs[n.origin]:void 0,m=n.detail.command??n.detail.filePath??n.detail.tool;return v.jsxs("div",{className:"rounded-xl border border-amber-500/25 bg-amber-400/[0.045] p-3.5",children:[v.jsxs("div",{className:"flex items-start gap-2.5",children:[v.jsx("span",{className:`mt-0.5 shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold uppercase ${pm[n.risk]}`,children:h?"Native":n.risk}),v.jsx("p",{className:"min-w-0 break-words text-sm font-medium text-amber-100",children:n.summary})]}),n.detail.description&&v.jsx("p",{className:"mt-2 break-words text-xs text-zinc-300",children:n.detail.description}),v.jsx("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono text-xs leading-5 text-zinc-300",children:v.jsx("code",{children:n.detail.diffPreview&&h?n.detail.diffPreview:m})}),n.detail.context&&v.jsxs("details",{className:"mt-2 rounded-md border border-zinc-700/70 px-2.5 py-1.5 text-xs text-zinc-300",children:[v.jsx("summary",{className:"cursor-pointer",children:n.detail.command||n.detail.diffPreview?"Additional request details":"Tool arguments"}),v.jsx("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono",children:n.detail.context})]}),v.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[v.jsx("button",{type:"button",disabled:!i,className:"deck-button deck-button-approve",onClick:()=>s(n.id,"approve"),children:"Approve"}),v.jsx("button",{type:"button",disabled:!i,className:"deck-button",onClick:()=>s(n.id,"reject"),children:"Reject"}),v.jsxs("button",{type:"button",disabled:!i,className:"deck-button","aria-expanded":l,onClick:()=>u(g=>!g),children:[v.jsx(ke,{name:"reply",className:"size-3.5"})," Reply"]}),h&&v.jsxs("button",{type:"button",disabled:!i,className:"deck-button",onClick:()=>s(n.id,"defer"),children:["Use ",h]})]}),l&&v.jsxs("form",{className:"mt-3 flex flex-wrap items-end gap-2",onSubmit:g=>{g.preventDefault();const y=f.trim();y&&i&&s(n.id,"reply",y)},children:[v.jsx("textarea",{autoFocus:!0,rows:2,maxLength:fm,"aria-label":"Reply to agent",placeholder:h?`Decline and tell ${h} what to change`:"Tell the agent what to change",value:f,onChange:g=>d(g.target.value),className:"min-w-36 grow rounded-lg border border-zinc-700 bg-zinc-950 p-2 text-sm text-zinc-100 placeholder:text-zinc-400"}),v.jsx("button",{disabled:!i||!f.trim(),className:"deck-button deck-button-approve",children:"Send reply"})]})]})}function Z1({approvals:n,connected:i,onDecide:s}){const[l,u]=F.useState(!1),f=F.useId(),[d,...h]=n;return d?v.jsxs("div",{className:"mt-4",children:[v.jsx(Lh,{approval:d,connected:i,onDecide:s},d.id),h.length>0&&v.jsxs(v.Fragment,{children:[v.jsxs("button",{type:"button","aria-expanded":l,"aria-controls":f,className:"approval-stack",onClick:()=>u(m=>!m),children:[v.jsx(ke,{name:"layers",className:"size-4"}),v.jsx("span",{children:l?"Show only the first approval":`+${h.length} more ${h.length===1?"approval":"approvals"}`}),v.jsx(ke,{name:"chevron",className:`ml-auto size-4 transition-transform ${l?"rotate-180":""}`})]}),v.jsx("div",{id:f,hidden:!l,className:"mt-2.5 space-y-2.5",children:l&&h.map(m=>v.jsx(Lh,{approval:m,connected:i,onDecide:s},m.id))})]})]}):null}const q1={input:"Input",output:"Output",cacheRead:"Cache read",cacheCreation:"Cache write"};function J1({session:n,approvals:i,connected:s,now:l,onDecide:u}){const f=G1[n.status],d=fu(),h=n.status==="waiting_approval",m=n.status==="waiting_terminal",g=(n.status==="running"||n.status.startsWith("waiting_"))&&l-n.lastEventAt>10*6e4,y=ga.some(R=>n.tokens[R]!==void 0),w=ga.reduce((R,A)=>R+(n.tokens[A]??0),0),k=(n.status==="done"?n.lastEventAt:l)-n.startedAt;return v.jsxs(St.article,{layout:"position",initial:{opacity:0,y:12},animate:h&&!g&&!d?{opacity:1,y:0,x:[0,-5,5,-3,3,0]}:{opacity:1,y:0,x:0},transition:{duration:.45},className:`session-card relative flex min-w-0 flex-col rounded-2xl border p-4 sm:p-5 xl:p-6 ${f.border} ${f.glow} ${h&&!g?"ring-pulse":""}`,children:[v.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-start gap-3",children:[v.jsxs("div",{className:"min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2.5",children:[v.jsx("span",{className:"shrink-0 rounded-md border border-zinc-700/70 bg-zinc-800/75 px-2 py-1 font-mono text-[10px] font-semibold uppercase tracking-wider text-zinc-300",children:Xs[n.kind]}),v.jsx("span",{className:"truncate font-mono text-xs text-zinc-400",title:n.cwd,children:n.cwd})]}),v.jsx("h3",{className:"mt-2.5 break-words text-lg font-semibold tracking-tight xl:text-[22px]",children:n.title})]}),v.jsxs(St.div,{initial:{scale:.85,opacity:0},animate:{scale:1,opacity:1},className:`flex shrink-0 items-center gap-2 rounded-full border border-current/20 bg-zinc-900/75 px-2.5 py-1.5 text-xs font-medium ${f.text}`,children:[n.status==="done"?v.jsx(ke,{name:"check",className:"size-3.5"}):v.jsx("span",{className:`size-1.5 rounded-full ${f.dot} ${!g&&(n.status==="running"||h)?"breathe":""}`}),f.label,h&&i.length>1?` · ${i.length}`:""]},n.status)]}),v.jsx("div",{className:"relative mt-4 h-10 overflow-hidden rounded-lg border border-zinc-800/90 bg-black/35 px-3 font-mono text-[12px] leading-[38px] text-zinc-300",title:n.lastAction,children:v.jsx(Fn,{mode:"popLayout",initial:!1,children:v.jsxs(St.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},exit:{y:-20,opacity:0},transition:{duration:.25},className:"truncate",children:[v.jsx("span",{className:`mr-1.5 ${f.text}`,children:"›"}),n.lastAction??"Waiting for activity"]},n.lastAction??"none")})}),v.jsx(Fn,{initial:!1,children:h&&i.length>0&&v.jsx(St.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0},transition:{duration:.18},children:v.jsx(Z1,{approvals:i,connected:s,onDecide:u})},"approvals")}),m&&v.jsxs("div",{className:"mt-4 flex items-start gap-2.5 rounded-xl border border-orange-500/25 bg-orange-400/5 px-3.5 py-3 text-sm text-orange-200",children:[v.jsx(ke,{name:"terminal",className:"mt-0.5 size-4 shrink-0 text-orange-300"}),v.jsxs("p",{children:["Respond to the permission prompt ",n.kind==="codex"||n.kind==="zcode"?`in ${Xs[n.kind]}`:"in your terminal","."]})]}),v.jsx("div",{className:"mt-auto pt-4",children:v.jsxs("div",{className:"flex flex-wrap items-start gap-x-3 gap-y-2 border-t border-zinc-800/80 pt-3 text-xs text-zinc-400",children:[v.jsxs("span",{className:"tabular inline-flex items-center gap-1.5 font-mono",title:"Session duration",children:[v.jsx(ke,{name:"clock",className:"size-3.5"})," ",Dh(k)]}),g&&v.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-orange-500/25 bg-orange-400/10 px-1.5 py-0.5 text-orange-200",title:`No events for ${Dh(l-n.lastEventAt)}`,children:[v.jsx(ke,{name:"warning",className:"size-3.5"})," Stale ",v.jsx("span",{className:"sr-only",children:"No events for more than 10 minutes"})]}),y?v.jsxs("details",{className:"ml-auto font-mono",children:[v.jsxs("summary",{className:"tabular ml-auto w-fit cursor-pointer rounded px-1 focus-visible:outline-2 focus-visible:outline-emerald-400",children:[v.jsx("span",{className:"text-zinc-200",children:hm(w)})," tokens"]}),v.jsx("dl",{className:"tabular mt-2 grid min-w-40 grid-cols-[1fr_auto] gap-x-3 gap-y-1 rounded-lg border border-zinc-700 bg-zinc-900 p-3",children:ga.map(R=>{var A;return v.jsxs("div",{className:"contents",children:[v.jsx("dt",{children:q1[R]}),v.jsx("dd",{className:"text-right text-zinc-200",children:((A=n.tokens[R])==null?void 0:A.toLocaleString("en-US"))??"—"})]},R)})})]}):v.jsx("span",{className:"ml-auto font-mono",children:"Token usage unavailable"})]})})]})}const ew={success:{icon:"check",color:"text-emerald-300 border-emerald-400/25 bg-emerald-400/10"},warning:{icon:"warning",color:"text-amber-200 border-amber-400/25 bg-amber-400/10"},info:{icon:"terminal",color:"text-sky-200 border-sky-400/25 bg-sky-400/10"}};function tw({toast:n,dismiss:i}){const[s,l]=F.useState(!1),[u,f]=F.useState(!1),d=ew[n.tone];return F.useEffect(()=>{if(s||u)return;const h=window.setTimeout(()=>i(n.id),4500);return()=>window.clearTimeout(h)},[n.id,i,s,u]),v.jsxs(St.div,{layout:"position",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:6},onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onFocus:()=>f(!0),onBlur:()=>f(!1),className:"pointer-events-auto flex items-center gap-3 rounded-xl border border-zinc-700 bg-zinc-900 p-3 shadow-xl shadow-black/40",children:[v.jsx("span",{className:`grid size-8 shrink-0 place-items-center rounded-lg border ${d.color}`,children:v.jsx(ke,{name:d.icon,className:"size-4"})}),v.jsx("p",{className:"min-w-0 break-words text-sm text-zinc-100",children:n.text}),v.jsx("button",{type:"button","aria-label":"Dismiss notification",onClick:()=>i(n.id),className:"ml-auto shrink-0 rounded-md p-1 text-zinc-400 hover:bg-zinc-800 hover:text-white",children:v.jsx(ke,{name:"close",className:"size-4"})})]})}function nw({toasts:n,onDismiss:i}){return v.jsx("div",{role:"status","aria-atomic":"false","aria-relevant":"additions",className:"pointer-events-none fixed inset-x-4 bottom-4 z-20 flex flex-col gap-2 sm:right-auto sm:bottom-6 sm:left-6 sm:w-[360px]",children:v.jsx(Fn,{initial:!1,children:n.map(s=>v.jsx(tw,{toast:s,dismiss:i},s.id))})})}function rw(n,i){if(n.length===0)return 0;if(i<=n[0].t)return n[0].cumulative;for(let s=1;s<n.length;s++){const l=n[s-1],u=n[s];if(i<=u.t)return l.cumulative+(u.cumulative-l.cumulative)*(i-l.t)/(u.t-l.t||1)}return n[n.length-1].cumulative}const _h=["from-rose-500 to-orange-400","from-emerald-500 to-teal-300","from-sky-500 to-indigo-400"],iw=[["input","Input"],["output","Output"],["cacheRead","Cache read"],["cacheCreation","Cache creation"]],sw=n=>`$${n.toFixed(n>0&&n<.01?4:2)}`;function ow({dataset:n,t:i}){var j,M,D;const[s,l]=F.useState(!1),u=F.useId(),f=fu(),d=(n==null?void 0:n.metric)==="cost_usd",h=O=>d?sw(O):hm(O),m=Math.max(0,...(n==null?void 0:n.variants.map(O=>{var $;return(($=O.samples.at(-1))==null?void 0:$.t)??0}))??[]),g=i??m,y=g>=m-1e-6,w=((M=(j=n==null?void 0:n.variants[0])==null?void 0:j.samples.at(-1))==null?void 0:M.cumulative)??0,k=n==null?void 0:n.variants.at(-1),R=(D=k==null?void 0:k.samples.at(-1))==null?void 0:D.cumulative,A=w>0&&R!==void 0?1-R/w:0;return v.jsxs("section",{"aria-labelledby":"race-title",className:"panel rounded-2xl p-4 sm:p-5 xl:p-6",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2.5",children:[v.jsx("h2",{id:"race-title",className:"section-title",children:"Token Race"}),n&&v.jsxs("span",{className:`rounded-md border px-2 py-1 font-mono text-[11px] font-medium ${n.measured?"border-emerald-500/25 bg-emerald-500/10 text-emerald-300":"border-zinc-700 bg-zinc-800/70 text-zinc-300"}`,title:n.measured?"Recorded from benchmark runs":"Illustrative replay data",children:[n.measured?"measured":"simulated"," · ",d?"cost":"tokens"]})]}),n!=null&&n.variants.length?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"mt-3",children:[v.jsx("h3",{className:"text-base font-semibold leading-snug text-zinc-100",children:n.task}),v.jsxs("p",{className:"mt-1 font-mono text-xs text-zinc-400",children:[n.model," ",v.jsx("span",{"aria-hidden":"true",children:"·"})," ",d?"USD":"Context tokens"]})]}),v.jsx("div",{className:"mt-4 space-y-3.5",children:n.variants.map((O,$)=>{const Q=rw(O.samples,g),U=n.limitBudget>0?Q/n.limitBudget:0,X=U>=.8,re=X&&!y&&!f;return v.jsxs("div",{children:[v.jsxs("div",{className:"mb-1.5 flex items-baseline justify-between gap-2",children:[v.jsx("span",{className:"text-sm font-medium text-zinc-200",children:O.label}),v.jsx("span",{className:`tabular shrink-0 font-mono text-xl font-semibold leading-none ${X?"text-rose-300":"text-zinc-100"}`,children:h(Q)})]}),v.jsxs(St.div,{animate:re?{x:[0,-2,2,0]}:{x:0},transition:{repeat:re?1/0:0,duration:.25},className:"relative h-2.5 overflow-hidden rounded-full bg-zinc-800","aria-hidden":"true",children:[v.jsx("div",{className:`h-full rounded-full bg-gradient-to-r ${_h[$%_h.length]} transition-[width] duration-100 ease-linear`,style:{width:`${Math.max(0,Math.min(1,U))*100}%`}}),v.jsx("div",{className:"absolute inset-y-0 left-[80%] w-px bg-rose-300/65"})]}),v.jsxs("div",{className:"mt-1 flex flex-wrap items-center justify-between gap-x-3 text-[11px] text-zinc-400",children:[v.jsxs("span",{className:"tabular font-mono",children:[Math.round(U*100),"% of illustrative budget"]}),X&&v.jsxs("span",{className:"inline-flex items-center gap-1 text-rose-300",children:[v.jsx(ke,{name:"warning",className:"size-3"})," ",U>1?"Over budget":"Near budget"]})]})]},O.id)})}),v.jsxs("div",{className:`relative mt-4 flex min-h-14 flex-wrap items-center justify-between gap-x-3 gap-y-2 rounded-xl border px-3.5 py-2 transition-colors ${y&&A>0?"border-emerald-400/20 bg-emerald-400/[.06]":"border-zinc-800/90 bg-zinc-950/35"}`,children:[v.jsx(Fn,{mode:"popLayout",initial:!1,children:y&&A>0&&n.variants.length>1?v.jsxs(St.p,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0},className:"flex flex-wrap items-baseline gap-x-2 text-xs text-emerald-200",children:[v.jsxs("strong",{className:"tabular font-mono text-3xl leading-none font-semibold tracking-tight text-emerald-300",children:["−",Math.round(A*100),"%"]}),v.jsxs("span",{children:[n.variants.length>2&&`${k==null?void 0:k.label} · `,d?"cost vs baseline":"context tokens vs baseline"]})]},"saving"):v.jsxs(St.p,{exit:{opacity:0},className:"text-xs text-zinc-400",children:["Illustrative budget ",v.jsx("span",{className:"tabular font-mono text-zinc-200",children:h(n.limitBudget)})]},"budget")}),v.jsxs("button",{type:"button","aria-expanded":s,"aria-controls":u,onClick:()=>l(O=>!O),className:"deck-button ml-auto shrink-0",children:["Token breakdown ",v.jsx(ke,{name:"chevron",className:`size-3.5 transition-transform ${s?"rotate-180":""}`})]})]}),v.jsxs("div",{id:u,hidden:!s,className:"mt-3 space-y-2.5",children:[v.jsx("p",{className:"text-xs text-zinc-400",children:"Token totals for completed runs"}),n.variants.map(O=>v.jsxs("div",{className:"rounded-xl border border-zinc-800 bg-zinc-950/35 p-3",children:[v.jsx("h4",{className:"text-xs font-semibold text-zinc-200",children:O.label}),v.jsx("dl",{className:"mt-2 grid grid-cols-2 gap-x-3 gap-y-2 min-[480px]:grid-cols-4",children:iw.map(([$,Q])=>{var U,X;return v.jsxs("div",{children:[v.jsx("dt",{className:"text-[11px] text-zinc-400",children:Q}),v.jsx("dd",{className:"tabular mt-0.5 font-mono text-xs text-zinc-200",children:((X=(U=O.totals)==null?void 0:U[$])==null?void 0:X.toLocaleString("en-US"))??"—"})]},$)})})]},O.id))]})]}):v.jsxs("div",{className:"mt-4 rounded-xl border border-dashed border-zinc-700 bg-zinc-950/35 p-5",children:[v.jsx("p",{className:"text-sm font-medium text-zinc-200",children:"No benchmark data"}),v.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:"Load a benchmark dataset to compare usage across runs."})]})]})}function lw(n,i,s){const{action:l,by:u}=n;if(u==="session_end")return;if(u==="cancelled")return{tone:"info",text:`${i} · Approval cancelled`};const f=s?Xs[s]:"the terminal";if(u==="timeout")return{tone:"warning",text:`${i} · Approval timed out. Continue in ${f}.`};if(l==="defer")return{tone:"info",text:`${i} · Continue in ${f}`};const d={approve:"Approved",reject:"Rejected",reply:"Reply sent"}[l];return{tone:l==="reject"?"info":"success",text:`${i} · ${d}${u==="telegram"?" · via Telegram":u==="web"?" · via Web":""}`}}const aw={connected:!1,mode:"live",sessions:{},order:[],approvals:{},datasets:{},raceT:{},toasts:[],toastSequence:0,phone:[]};function Vh(n,i){if(!i)return{toasts:n.toasts,toastSequence:n.toastSequence};const s=n.toastSequence+1;return{toasts:[...n.toasts.slice(-2),{id:s,...i}],toastSequence:s}}function uw(n,i){var l,u,f;if(i.type==="connected")return{...n,connected:i.value};if(i.type==="dismiss_toast")return{...n,toasts:n.toasts.filter(d=>d.id!==i.id)};const s=i.msg;switch(s.type){case"snapshot":{const d=Object.fromEntries(s.sessions.map(h=>[h.id,h]));return{...n,mode:s.mode,sessions:d,order:s.sessions.map(h=>h.id),approvals:Object.fromEntries(s.approvals.map(h=>[h.id,h])),phone:s.approvals.map(h=>{var m;return{approval:h,sessionTitle:((m=d[h.sessionId])==null?void 0:m.title)??h.sessionId}}),demoReply:void 0,toasts:[]}}case"session_update":{const d=s.session;return{...n,sessions:{...n.sessions,[d.id]:d},order:n.order.includes(d.id)?n.order:[...n.order,d.id]}}case"session_removed":{const{[s.sessionId]:d,...h}=n.sessions;return{...n,sessions:h,order:n.order.filter(m=>m!==s.sessionId)}}case"approval_created":return{...n,approvals:{...n.approvals,[s.approval.id]:s.approval},phone:[...n.phone.filter((d,h)=>!d.decision||h>=n.phone.length-5),{approval:s.approval,sessionTitle:((l=n.sessions[s.approval.sessionId])==null?void 0:l.title)??s.approval.sessionId}]};case"approval_resolved":{const{[s.decision.approvalId]:d,...h}=n.approvals;return{...n,approvals:h,...Vh(n,d&&lw(s.decision,((u=n.sessions[d.sessionId])==null?void 0:u.title)??d.sessionId,d.origin)),demoReply:((f=n.demoReply)==null?void 0:f.approvalId)===s.decision.approvalId?void 0:n.demoReply,phone:n.phone.map(m=>m.approval.id===s.decision.approvalId?{...m,decision:s.decision}:m)}}case"token_dataset":return{...n,datasets:{...n.datasets,[s.dataset.id]:s.dataset}};case"token_tick":return{...n,raceT:{...n.raceT,[s.datasetId]:s.t}};case"demo_phone_reply":return n.approvals[s.approvalId]?{...n,demoReply:s}:n;case"toast":return{...n,...Vh(n,{tone:"info",text:s.text})}}return n}function cw(){const[n,i]=F.useReducer(uw,aw),s=F.useRef(null);F.useEffect(()=>{let f=!1,d;const h=()=>{const m=location.protocol==="https:"?"wss":"ws",g=new WebSocket(`${m}://${location.host}/ws`);s.current=g,g.onopen=()=>{f||i({type:"connected",value:!0})},g.onmessage=y=>{f||i({type:"server",msg:JSON.parse(y.data)})},g.onclose=()=>{f||(i({type:"connected",value:!1}),d=setTimeout(h,1e3))}};return h(),()=>{var m;f=!0,clearTimeout(d),(m=s.current)==null||m.close()}},[]);const l=F.useCallback(f=>{const d=s.current;(d==null?void 0:d.readyState)===WebSocket.OPEN&&d.send(JSON.stringify(f))},[]),u=F.useCallback(f=>i({type:"dismiss_toast",id:f}),[]);return{state:n,send:l,dismissToast:u}}function dw(){const{state:n,send:i,dismissToast:s}=cw(),[l,u]=F.useState(!0),[f,d]=F.useState(Date.now),h=n.mode==="demo",m=F.useCallback(()=>u(j=>!j),[]),g=F.useCallback(()=>i({type:"demo_restart"}),[i]);F.useEffect(()=>{const j=window.setInterval(()=>d(Date.now()),1e3);return()=>window.clearInterval(j)},[]),F.useEffect(()=>{if(!h)return;const j=M=>{M.defaultPrevented||M.repeat||M.isComposing||M.altKey||M.ctrlKey||M.metaKey||M.shiftKey||M.target instanceof HTMLElement&&(M.target.isContentEditable||M.target.closest("input, textarea, select"))||(M.key.toLowerCase()==="r"&&g(),M.key.toLowerCase()==="p"&&m())};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[h,g,m]);const y=(j,M,D)=>i({type:"decide",decision:{approvalId:j,action:M,text:D}}),w=(j,M,D)=>i({type:"decide",source:"phone_mock",decision:{approvalId:j,action:M,text:D}}),k=n.order.map(j=>n.sessions[j]),R=Object.values(n.datasets),A=R.find(j=>j.metric==="cost_usd"&&j.measured)??R.find(j=>j.metric==="cost_usd")??R[0];return v.jsxs(Ay,{reducedMotion:"user",children:[v.jsx(K1,{mode:n.mode,connected:n.connected,sessions:k,showPhone:l,onTogglePhone:m,onRestart:g}),v.jsxs("main",{className:"deck-grid",children:[v.jsxs("section",{"aria-labelledby":"sessions-title",className:"min-w-0",children:[v.jsxs("div",{className:"mb-4 flex items-baseline justify-between gap-3 border-b border-zinc-800/80 pb-3.5",children:[v.jsx("h2",{id:"sessions-title",className:"text-2xl font-semibold tracking-tight",children:"Sessions"}),v.jsxs("span",{className:"tabular font-mono text-xs text-zinc-400",children:[k.length," total"]})]}),k.length?v.jsx("div",{className:"session-grid",children:k.map(j=>v.jsx(J1,{session:j,approvals:j.pendingApprovalIds.flatMap(M=>n.approvals[M]?[n.approvals[M]]:[]),connected:n.connected,now:f,onDecide:y},j.id))}):v.jsx("div",{className:"panel flex min-h-64 items-center justify-center rounded-2xl border-dashed p-6 text-center",children:v.jsxs("div",{className:"max-w-xs",children:[v.jsx("span",{className:"mx-auto mb-4 grid size-11 place-items-center rounded-xl border border-zinc-700 bg-zinc-800/70 text-emerald-300",children:v.jsx(ke,{name:"terminal",className:"size-5"})}),v.jsx("h3",{className:"text-base font-semibold",children:n.connected?h?"Waiting for the demo":"No sessions yet":"Connecting to AgentDeck"}),v.jsx("p",{className:"mt-1.5 text-sm leading-relaxed text-zinc-400",children:n.connected?h?"Sessions will appear when playback starts.":v.jsxs(v.Fragment,{children:["Run ",v.jsx("code",{className:"font-mono text-zinc-200",children:"agentmast install-hooks"})," for Claude Code. Add ",v.jsx("code",{className:"font-mono text-zinc-200",children:"--codex"}),", ",v.jsx("code",{className:"font-mono text-zinc-200",children:"--zcode"})," or ",v.jsx("code",{className:"font-mono text-zinc-200",children:"--antigravity"})," for the corresponding agent."]}):v.jsxs(v.Fragment,{children:["Start the local daemon with ",v.jsx("code",{className:"font-mono text-zinc-200",children:"agentmast up"})," if it is offline."]})})]})})]}),v.jsxs("aside",{"aria-label":"Usage and approval preview",className:"min-w-0 space-y-4",children:[v.jsx(ow,{dataset:A,t:A?n.raceT[A.id]??(h?0:void 0):void 0},A==null?void 0:A.id),v.jsx(Fn,{initial:!1,children:h&&l&&v.jsx(St.div,{initial:{opacity:0,y:16,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:12,scale:.98},transition:{duration:.22},className:"origin-top",children:v.jsx(X1,{messages:n.phone,replayReply:n.demoReply,connected:n.connected,onDecide:w})},"phone")})]})]}),v.jsx(nw,{toasts:n.toasts,onDismiss:s})]})}xy.createRoot(document.getElementById("root")).render(v.jsx(F.StrictMode,{children:v.jsx(dw,{})}));
|
|
48
|
+
`),()=>{document.head.removeChild(y)}},[i]),v.jsx(wy,{isPresent:i,childRef:l,sizeRef:u,children:F.cloneElement(n,{ref:l})})}const ky=({children:n,initial:i,isPresent:s,onExitComplete:l,custom:u,presenceAffectsLayout:f,mode:d})=>{const h=Zs(Ty),m=F.useId(),g=F.useCallback(w=>{h.set(w,!0);for(const k of h.values())if(!k)return;l&&l()},[h,l]),y=F.useMemo(()=>({id:m,initial:i,isPresent:s,custom:u,onExitComplete:g,register:w=>(h.set(w,!1),()=>h.delete(w))}),f?[Math.random(),g]:[s,g]);return F.useMemo(()=>{h.forEach((w,k)=>h.set(k,!1))},[s]),F.useEffect(()=>{!s&&!h.size&&l&&l()},[s]),d==="popLayout"&&(n=v.jsx(Sy,{isPresent:s,children:n})),v.jsx(qs.Provider,{value:y,children:n})};function Ty(){return new Map}function zh(n=!0){const i=F.useContext(qs);if(i===null)return[!0,null];const{isPresent:s,onExitComplete:l,register:u}=i,f=F.useId();F.useEffect(()=>{n&&u(f)},[n]);const d=F.useCallback(()=>n&&l&&l(f),[f,l,n]);return!s&&l?[!1,d]:[!0]}const Vs=n=>n.key||"";function yf(n){const i=[];return F.Children.forEach(n,s=>{F.isValidElement(s)&&i.push(s)}),i}const _a=typeof window<"u",Fh=_a?F.useLayoutEffect:F.useEffect,Fn=({children:n,custom:i,initial:s=!0,onExitComplete:l,presenceAffectsLayout:u=!0,mode:f="sync",propagate:d=!1})=>{const[h,m]=zh(d),g=F.useMemo(()=>yf(n),[n]),y=d&&!h?[]:g.map(Vs),w=F.useRef(!0),k=F.useRef(g),R=Zs(()=>new Map),[A,j]=F.useState(g),[M,D]=F.useState(g);Fh(()=>{w.current=!1,k.current=g;for(let Q=0;Q<M.length;Q++){const U=Vs(M[Q]);y.includes(U)?R.delete(U):R.get(U)!==!0&&R.set(U,!1)}},[M,y.length,y.join("-")]);const O=[];if(g!==A){let Q=[...g];for(let U=0;U<M.length;U++){const X=M[U],re=Vs(X);y.includes(re)||(Q.splice(U,0,X),O.push(X))}f==="wait"&&O.length&&(Q=O),D(yf(Q)),j(g);return}const{forceRender:$}=F.useContext(La);return v.jsx(v.Fragment,{children:M.map(Q=>{const U=Vs(Q),X=d&&!h?!1:g===M||y.includes(U),re=()=>{if(R.has(U))R.set(U,!0);else return;let Z=!0;R.forEach(ge=>{ge||(Z=!1)}),Z&&($==null||$(),D(k.current),d&&(m==null||m()),l&&l())};return v.jsx(ky,{isPresent:X,initial:!w.current||s?void 0:!1,custom:X?void 0:i,presenceAffectsLayout:u,mode:f,onExitComplete:X?void 0:re,children:Q},U)})})},dt=n=>n;let Ih=dt;const Py={useManualTiming:!1};function Cy(n){let i=new Set,s=new Set,l=!1,u=!1;const f=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function h(g){f.has(g)&&(m.schedule(g),n()),g(d)}const m={schedule:(g,y=!1,w=!1)=>{const R=w&&l?i:s;return y&&f.add(g),R.has(g)||R.add(g),g},cancel:g=>{s.delete(g),f.delete(g)},process:g=>{if(d=g,l){u=!0;return}l=!0,[i,s]=[s,i],i.forEach(h),i.clear(),l=!1,u&&(u=!1,m.process(g))}};return m}const zs=["read","resolveKeyframes","update","preRender","render","postRender"],Ey=40;function Oh(n,i){let s=!1,l=!0;const u={delta:0,timestamp:0,isProcessing:!1},f=()=>s=!0,d=zs.reduce((D,O)=>(D[O]=Cy(f),D),{}),{read:h,resolveKeyframes:m,update:g,preRender:y,render:w,postRender:k}=d,R=()=>{const D=performance.now();s=!1,u.delta=l?1e3/60:Math.max(Math.min(D-u.timestamp,Ey),1),u.timestamp=D,u.isProcessing=!0,h.process(u),m.process(u),g.process(u),y.process(u),w.process(u),k.process(u),u.isProcessing=!1,s&&i&&(l=!1,n(R))},A=()=>{s=!0,l=!0,u.isProcessing||n(R)};return{schedule:zs.reduce((D,O)=>{const $=d[O];return D[O]=(Q,U=!1,X=!1)=>(s||A(),$.schedule(Q,U,X)),D},{}),cancel:D=>{for(let O=0;O<zs.length;O++)d[zs[O]].cancel(D)},state:u,steps:d}}const{schedule:xe,cancel:gn,state:Be,steps:ra}=Oh(typeof requestAnimationFrame<"u"?requestAnimationFrame:dt,!0),Bh=F.createContext({strict:!1}),vf={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},mr={};for(const n in vf)mr[n]={isEnabled:i=>vf[n].some(s=>!!i[s])};function jy(n){for(const i in n)mr[i]={...mr[i],...n[i]}}const Ny=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function $s(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||Ny.has(n)}let Uh=n=>!$s(n);function $h(n){n&&(Uh=i=>i.startsWith("on")?!$s(i):n(i))}try{$h(require("@emotion/is-prop-valid").default)}catch{}function Ry(n,i,s){const l={};for(const u in n)u==="values"&&typeof n.values=="object"||(Uh(u)||s===!0&&$s(u)||!i&&!$s(u)||n.draggable&&u.startsWith("onDrag"))&&(l[u]=n[u]);return l}function Ay({children:n,isValidProp:i,...s}){i&&$h(i),s={...F.useContext(pi),...s},s.isStatic=Zs(()=>s.isStatic);const l=F.useMemo(()=>s,[JSON.stringify(s.transition),s.transformPagePoint,s.reducedMotion]);return v.jsx(pi.Provider,{value:l,children:n})}function My(n){if(typeof Proxy>"u")return n;const i=new Map,s=(...l)=>n(...l);return new Proxy(s,{get:(l,u)=>u==="create"?n:(i.has(u)||i.set(u,n(u)),i.get(u))})}const Js=F.createContext({});function mi(n){return typeof n=="string"||Array.isArray(n)}function eo(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const Va=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],za=["initial",...Va];function to(n){return eo(n.animate)||za.some(i=>mi(n[i]))}function Wh(n){return!!(to(n)||n.variants)}function Dy(n,i){if(to(n)){const{initial:s,animate:l}=n;return{initial:s===!1||mi(s)?s:void 0,animate:mi(l)?l:void 0}}return n.inherit!==!1?i:{}}function Ly(n){const{initial:i,animate:s}=Dy(n,F.useContext(Js));return F.useMemo(()=>({initial:i,animate:s}),[xf(i),xf(s)])}function xf(n){return Array.isArray(n)?n.join(" "):n}const _y=Symbol.for("motionComponentSymbol");function cr(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function Vy(n,i,s){return F.useCallback(l=>{l&&n.onMount&&n.onMount(l),i&&(l?i.mount(l):i.unmount()),s&&(typeof s=="function"?s(l):cr(s)&&(s.current=l))},[i])}const Fa=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),zy="framerAppearId",bh="data-"+Fa(zy),{schedule:Ia}=Oh(queueMicrotask,!1),Hh=F.createContext({});function Fy(n,i,s,l,u){var f,d;const{visualElement:h}=F.useContext(Js),m=F.useContext(Bh),g=F.useContext(qs),y=F.useContext(pi).reducedMotion,w=F.useRef(null);l=l||m.renderer,!w.current&&l&&(w.current=l(n,{visualState:i,parent:h,props:s,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:y}));const k=w.current,R=F.useContext(Hh);k&&!k.projection&&u&&(k.type==="html"||k.type==="svg")&&Iy(w.current,s,u,R);const A=F.useRef(!1);F.useInsertionEffect(()=>{k&&A.current&&k.update(s,g)});const j=s[bh],M=F.useRef(!!j&&!(!((f=window.MotionHandoffIsComplete)===null||f===void 0)&&f.call(window,j))&&((d=window.MotionHasOptimisedAnimation)===null||d===void 0?void 0:d.call(window,j)));return Fh(()=>{k&&(A.current=!0,window.MotionIsMounted=!0,k.updateFeatures(),Ia.render(k.render),M.current&&k.animationState&&k.animationState.animateChanges())}),F.useEffect(()=>{k&&(!M.current&&k.animationState&&k.animationState.animateChanges(),M.current&&(queueMicrotask(()=>{var D;(D=window.MotionHandoffMarkAsComplete)===null||D===void 0||D.call(window,j)}),M.current=!1))}),k}function Iy(n,i,s,l){const{layoutId:u,layout:f,drag:d,dragConstraints:h,layoutScroll:m,layoutRoot:g}=i;n.projection=new s(n.latestValues,i["data-framer-portal-id"]?void 0:Kh(n.parent)),n.projection.setOptions({layoutId:u,layout:f,alwaysMeasureLayout:!!d||h&&cr(h),visualElement:n,animationType:typeof f=="string"?f:"both",initialPromotionConfig:l,layoutScroll:m,layoutRoot:g})}function Kh(n){if(n)return n.options.allowProjection!==!1?n.projection:Kh(n.parent)}function Oy({preloadedFeatures:n,createVisualElement:i,useRender:s,useVisualState:l,Component:u}){var f,d;n&&jy(n);function h(g,y){let w;const k={...F.useContext(pi),...g,layoutId:By(g)},{isStatic:R}=k,A=Ly(g),j=l(g,R);if(!R&&_a){Uy();const M=$y(k);w=M.MeasureLayout,A.visualElement=Fy(u,j,k,i,M.ProjectionNode)}return v.jsxs(Js.Provider,{value:A,children:[w&&A.visualElement?v.jsx(w,{visualElement:A.visualElement,...k}):null,s(u,g,Vy(j,A.visualElement,y),j,R,A.visualElement)]})}h.displayName=`motion.${typeof u=="string"?u:`create(${(d=(f=u.displayName)!==null&&f!==void 0?f:u.name)!==null&&d!==void 0?d:""})`}`;const m=F.forwardRef(h);return m[_y]=u,m}function By({layoutId:n}){const i=F.useContext(La).id;return i&&n!==void 0?i+"-"+n:n}function Uy(n,i){F.useContext(Bh).strict}function $y(n){const{drag:i,layout:s}=mr;if(!i&&!s)return{};const l={...i,...s};return{MeasureLayout:i!=null&&i.isEnabled(n)||s!=null&&s.isEnabled(n)?l.MeasureLayout:void 0,ProjectionNode:l.ProjectionNode}}const Wy=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Oa(n){return typeof n!="string"||n.includes("-")?!1:!!(Wy.indexOf(n)>-1||/[A-Z]/u.test(n))}function wf(n){const i=[{},{}];return n==null||n.values.forEach((s,l)=>{i[0][l]=s.get(),i[1][l]=s.getVelocity()}),i}function Ba(n,i,s,l){if(typeof i=="function"){const[u,f]=wf(l);i=i(s!==void 0?s:n.custom,u,f)}if(typeof i=="string"&&(i=n.variants&&n.variants[i]),typeof i=="function"){const[u,f]=wf(l);i=i(s!==void 0?s:n.custom,u,f)}return i}const ya=n=>Array.isArray(n),by=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),Hy=n=>ya(n)?n[n.length-1]||0:n,Ke=n=>!!(n&&n.getVelocity);function Os(n){const i=Ke(n)?n.get():n;return by(i)?i.toValue():i}function Ky({scrapeMotionValuesFromProps:n,createRenderState:i,onUpdate:s},l,u,f){const d={latestValues:Gy(l,u,f,n),renderState:i()};return s&&(d.onMount=h=>s({props:l,current:h,...d}),d.onUpdate=h=>s(h)),d}const Gh=n=>(i,s)=>{const l=F.useContext(Js),u=F.useContext(qs),f=()=>Ky(n,i,l,u);return s?f():Zs(f)};function Gy(n,i,s,l){const u={},f=l(n,{});for(const k in f)u[k]=Os(f[k]);let{initial:d,animate:h}=n;const m=to(n),g=Wh(n);i&&g&&!m&&n.inherit!==!1&&(d===void 0&&(d=i.initial),h===void 0&&(h=i.animate));let y=s?s.initial===!1:!1;y=y||d===!1;const w=y?h:d;if(w&&typeof w!="boolean"&&!eo(w)){const k=Array.isArray(w)?w:[w];for(let R=0;R<k.length;R++){const A=Ba(n,k[R]);if(A){const{transitionEnd:j,transition:M,...D}=A;for(const O in D){let $=D[O];if(Array.isArray($)){const Q=y?$.length-1:0;$=$[Q]}$!==null&&(u[O]=$)}for(const O in j)u[O]=j[O]}}}return u}const vr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],In=new Set(vr),Qh=n=>i=>typeof i=="string"&&i.startsWith(n),Yh=Qh("--"),Qy=Qh("var(--"),Ua=n=>Qy(n)?Yy.test(n.split("/*")[0].trim()):!1,Yy=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Xh=(n,i)=>i&&typeof n=="number"?i.transform(n):n,Qt=(n,i,s)=>s>i?i:s<n?n:s,xr={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},gi={...xr,transform:n=>Qt(0,1,n)},Fs={...xr,default:1},wi=n=>({test:i=>typeof i=="string"&&i.endsWith(n)&&i.split(" ").length===1,parse:parseFloat,transform:i=>`${i}${n}`}),mn=wi("deg"),zt=wi("%"),te=wi("px"),Xy=wi("vh"),Zy=wi("vw"),Sf={...zt,parse:n=>zt.parse(n)/100,transform:n=>zt.transform(n*100)},qy={borderWidth:te,borderTopWidth:te,borderRightWidth:te,borderBottomWidth:te,borderLeftWidth:te,borderRadius:te,radius:te,borderTopLeftRadius:te,borderTopRightRadius:te,borderBottomRightRadius:te,borderBottomLeftRadius:te,width:te,maxWidth:te,height:te,maxHeight:te,top:te,right:te,bottom:te,left:te,padding:te,paddingTop:te,paddingRight:te,paddingBottom:te,paddingLeft:te,margin:te,marginTop:te,marginRight:te,marginBottom:te,marginLeft:te,backgroundPositionX:te,backgroundPositionY:te},Jy={rotate:mn,rotateX:mn,rotateY:mn,rotateZ:mn,scale:Fs,scaleX:Fs,scaleY:Fs,scaleZ:Fs,skew:mn,skewX:mn,skewY:mn,distance:te,translateX:te,translateY:te,translateZ:te,x:te,y:te,z:te,perspective:te,transformPerspective:te,opacity:gi,originX:Sf,originY:Sf,originZ:te},kf={...xr,transform:Math.round},$a={...qy,...Jy,zIndex:kf,size:te,fillOpacity:gi,strokeOpacity:gi,numOctaves:kf},e0={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},t0=vr.length;function n0(n,i,s){let l="",u=!0;for(let f=0;f<t0;f++){const d=vr[f],h=n[d];if(h===void 0)continue;let m=!0;if(typeof h=="number"?m=h===(d.startsWith("scale")?1:0):m=parseFloat(h)===0,!m||s){const g=Xh(h,$a[d]);if(!m){u=!1;const y=e0[d]||d;l+=`${y}(${g}) `}s&&(i[d]=g)}}return l=l.trim(),s?l=s(i,u?"":l):u&&(l="none"),l}function Wa(n,i,s){const{style:l,vars:u,transformOrigin:f}=n;let d=!1,h=!1;for(const m in i){const g=i[m];if(In.has(m)){d=!0;continue}else if(Yh(m)){u[m]=g;continue}else{const y=Xh(g,$a[m]);m.startsWith("origin")?(h=!0,f[m]=y):l[m]=y}}if(i.transform||(d||s?l.transform=n0(i,n.transform,s):l.transform&&(l.transform="none")),h){const{originX:m="50%",originY:g="50%",originZ:y=0}=f;l.transformOrigin=`${m} ${g} ${y}`}}const r0={offset:"stroke-dashoffset",array:"stroke-dasharray"},i0={offset:"strokeDashoffset",array:"strokeDasharray"};function s0(n,i,s=1,l=0,u=!0){n.pathLength=1;const f=u?r0:i0;n[f.offset]=te.transform(-l);const d=te.transform(i),h=te.transform(s);n[f.array]=`${d} ${h}`}function Tf(n,i,s){return typeof n=="string"?n:te.transform(i+s*n)}function o0(n,i,s){const l=Tf(i,n.x,n.width),u=Tf(s,n.y,n.height);return`${l} ${u}`}function ba(n,{attrX:i,attrY:s,attrScale:l,originX:u,originY:f,pathLength:d,pathSpacing:h=1,pathOffset:m=0,...g},y,w){if(Wa(n,g,w),y){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:k,style:R,dimensions:A}=n;k.transform&&(A&&(R.transform=k.transform),delete k.transform),A&&(u!==void 0||f!==void 0||R.transform)&&(R.transformOrigin=o0(A,u!==void 0?u:.5,f!==void 0?f:.5)),i!==void 0&&(k.x=i),s!==void 0&&(k.y=s),l!==void 0&&(k.scale=l),d!==void 0&&s0(k,d,h,m,!1)}const Ha=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Zh=()=>({...Ha(),attrs:{}}),Ka=n=>typeof n=="string"&&n.toLowerCase()==="svg";function qh(n,{style:i,vars:s},l,u){Object.assign(n.style,i,u&&u.getProjectionStyles(l));for(const f in s)n.style.setProperty(f,s[f])}const Jh=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ep(n,i,s,l){qh(n,i,void 0,l);for(const u in i.attrs)n.setAttribute(Jh.has(u)?u:Fa(u),i.attrs[u])}const Ws={};function l0(n){Object.assign(Ws,n)}function tp(n,{layout:i,layoutId:s}){return In.has(n)||n.startsWith("origin")||(i||s!==void 0)&&(!!Ws[n]||n==="opacity")}function Ga(n,i,s){var l;const{style:u}=n,f={};for(const d in u)(Ke(u[d])||i.style&&Ke(i.style[d])||tp(d,n)||((l=s==null?void 0:s.getValue(d))===null||l===void 0?void 0:l.liveStyle)!==void 0)&&(f[d]=u[d]);return f}function np(n,i,s){const l=Ga(n,i,s);for(const u in n)if(Ke(n[u])||Ke(i[u])){const f=vr.indexOf(u)!==-1?"attr"+u.charAt(0).toUpperCase()+u.substring(1):u;l[f]=n[u]}return l}function a0(n,i){try{i.dimensions=typeof n.getBBox=="function"?n.getBBox():n.getBoundingClientRect()}catch{i.dimensions={x:0,y:0,width:0,height:0}}}const Pf=["x","y","width","height","cx","cy","r"],u0={useVisualState:Gh({scrapeMotionValuesFromProps:np,createRenderState:Zh,onUpdate:({props:n,prevProps:i,current:s,renderState:l,latestValues:u})=>{if(!s)return;let f=!!n.drag;if(!f){for(const h in u)if(In.has(h)){f=!0;break}}if(!f)return;let d=!i;if(i)for(let h=0;h<Pf.length;h++){const m=Pf[h];n[m]!==i[m]&&(d=!0)}d&&xe.read(()=>{a0(s,l),xe.render(()=>{ba(l,u,Ka(s.tagName),n.transformTemplate),ep(s,l)})})}})},c0={useVisualState:Gh({scrapeMotionValuesFromProps:Ga,createRenderState:Ha})};function rp(n,i,s){for(const l in i)!Ke(i[l])&&!tp(l,s)&&(n[l]=i[l])}function d0({transformTemplate:n},i){return F.useMemo(()=>{const s=Ha();return Wa(s,i,n),Object.assign({},s.vars,s.style)},[i])}function f0(n,i){const s=n.style||{},l={};return rp(l,s,n),Object.assign(l,d0(n,i)),l}function h0(n,i){const s={},l=f0(n,i);return n.drag&&n.dragListener!==!1&&(s.draggable=!1,l.userSelect=l.WebkitUserSelect=l.WebkitTouchCallout="none",l.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(s.tabIndex=0),s.style=l,s}function p0(n,i,s,l){const u=F.useMemo(()=>{const f=Zh();return ba(f,i,Ka(l),n.transformTemplate),{...f.attrs,style:{...f.style}}},[i]);if(n.style){const f={};rp(f,n.style,n),u.style={...f,...u.style}}return u}function m0(n=!1){return(s,l,u,{latestValues:f},d)=>{const m=(Oa(s)?p0:h0)(l,f,d,s),g=Ry(l,typeof s=="string",n),y=s!==F.Fragment?{...g,...m,ref:u}:{},{children:w}=l,k=F.useMemo(()=>Ke(w)?w.get():w,[w]);return F.createElement(s,{...y,children:k})}}function g0(n,i){return function(l,{forwardMotionProps:u}={forwardMotionProps:!1}){const d={...Oa(l)?u0:c0,preloadedFeatures:n,useRender:m0(u),createVisualElement:i,Component:l};return Oy(d)}}function ip(n,i){if(!Array.isArray(i))return!1;const s=i.length;if(s!==n.length)return!1;for(let l=0;l<s;l++)if(i[l]!==n[l])return!1;return!0}function no(n,i,s){const l=n.getProps();return Ba(l,i,s!==void 0?s:l.custom,n)}function Qa(n,i){return n?n[i]||n.default||n:void 0}const sp=new Set(["width","height","top","left","right","bottom",...vr]);let Bs;function y0(){Bs=void 0}const Ft={now:()=>(Bs===void 0&&Ft.set(Be.isProcessing||Py.useManualTiming?Be.timestamp:performance.now()),Bs),set:n=>{Bs=n,queueMicrotask(y0)}};function Ya(n,i){n.indexOf(i)===-1&&n.push(i)}function Xa(n,i){const s=n.indexOf(i);s>-1&&n.splice(s,1)}class Za{constructor(){this.subscriptions=[]}add(i){return Ya(this.subscriptions,i),()=>Xa(this.subscriptions,i)}notify(i,s,l){const u=this.subscriptions.length;if(u)if(u===1)this.subscriptions[0](i,s,l);else for(let f=0;f<u;f++){const d=this.subscriptions[f];d&&d(i,s,l)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function op(n,i){return i?n*(1e3/i):0}const Cf=30,v0=n=>!isNaN(parseFloat(n));class x0{constructor(i,s={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(l,u=!0)=>{const f=Ft.now();this.updatedAt!==f&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(l),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),u&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(i),this.owner=s.owner}setCurrent(i){this.current=i,this.updatedAt=Ft.now(),this.canTrackVelocity===null&&i!==void 0&&(this.canTrackVelocity=v0(this.current))}setPrevFrameValue(i=this.current){this.prevFrameValue=i,this.prevUpdatedAt=this.updatedAt}onChange(i){return this.on("change",i)}on(i,s){this.events[i]||(this.events[i]=new Za);const l=this.events[i].add(s);return i==="change"?()=>{l(),xe.read(()=>{this.events.change.getSize()||this.stop()})}:l}clearListeners(){for(const i in this.events)this.events[i].clear()}attach(i,s){this.passiveEffect=i,this.stopPassiveEffect=s}set(i,s=!0){!s||!this.passiveEffect?this.updateAndNotify(i,s):this.passiveEffect(i,this.updateAndNotify)}setWithVelocity(i,s,l){this.set(s),this.prev=void 0,this.prevFrameValue=i,this.prevUpdatedAt=this.updatedAt-l}jump(i,s=!0){this.updateAndNotify(i),this.prev=i,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const i=Ft.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||i-this.updatedAt>Cf)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,Cf);return op(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(i){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=i(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function yi(n,i){return new x0(n,i)}function w0(n,i,s){n.hasValue(i)?n.getValue(i).set(s):n.addValue(i,yi(s))}function S0(n,i){const s=no(n,i);let{transitionEnd:l={},transition:u={},...f}=s||{};f={...f,...l};for(const d in f){const h=Hy(f[d]);w0(n,d,h)}}function k0(n){return!!(Ke(n)&&n.add)}function va(n,i){const s=n.getValue("willChange");if(k0(s))return s.add(i)}function lp(n){return n.props[bh]}function qa(n){let i;return()=>(i===void 0&&(i=n()),i)}const T0=qa(()=>window.ScrollTimeline!==void 0);class P0{constructor(i){this.stop=()=>this.runAll("stop"),this.animations=i.filter(Boolean)}get finished(){return Promise.all(this.animations.map(i=>"finished"in i?i.finished:i))}getAll(i){return this.animations[0][i]}setAll(i,s){for(let l=0;l<this.animations.length;l++)this.animations[l][i]=s}attachTimeline(i,s){const l=this.animations.map(u=>{if(T0()&&u.attachTimeline)return u.attachTimeline(i);if(typeof s=="function")return s(u)});return()=>{l.forEach((u,f)=>{u&&u(),this.animations[f].stop()})}}get time(){return this.getAll("time")}set time(i){this.setAll("time",i)}get speed(){return this.getAll("speed")}set speed(i){this.setAll("speed",i)}get startTime(){return this.getAll("startTime")}get duration(){let i=0;for(let s=0;s<this.animations.length;s++)i=Math.max(i,this.animations[s].duration);return i}runAll(i){this.animations.forEach(s=>s[i]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class C0 extends P0{then(i,s){return Promise.all(this.animations).then(i).catch(s)}}const Kt=n=>n*1e3,Gt=n=>n/1e3;function Ja(n){return typeof n=="function"}function Ef(n,i){n.timeline=i,n.onfinish=null}const eu=n=>Array.isArray(n)&&typeof n[0]=="number",E0={linearEasing:void 0};function j0(n,i){const s=qa(n);return()=>{var l;return(l=E0[i])!==null&&l!==void 0?l:s()}}const bs=j0(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),gr=(n,i,s)=>{const l=i-n;return l===0?1:(s-n)/l},ap=(n,i,s=10)=>{let l="";const u=Math.max(Math.round(i/s),2);for(let f=0;f<u;f++)l+=n(gr(0,u-1,f))+", ";return`linear(${l.substring(0,l.length-2)})`};function up(n){return!!(typeof n=="function"&&bs()||!n||typeof n=="string"&&(n in xa||bs())||eu(n)||Array.isArray(n)&&n.every(up))}const li=([n,i,s,l])=>`cubic-bezier(${n}, ${i}, ${s}, ${l})`,xa={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:li([0,.65,.55,1]),circOut:li([.55,0,1,.45]),backIn:li([.31,.01,.66,-.59]),backOut:li([.33,1.53,.69,.99])};function cp(n,i){if(n)return typeof n=="function"&&bs()?ap(n,i):eu(n)?li(n):Array.isArray(n)?n.map(s=>cp(s,i)||xa.easeOut):xa[n]}const dp=(n,i,s)=>(((1-3*s+3*i)*n+(3*s-6*i))*n+3*i)*n,N0=1e-7,R0=12;function A0(n,i,s,l,u){let f,d,h=0;do d=i+(s-i)/2,f=dp(d,l,u)-n,f>0?s=d:i=d;while(Math.abs(f)>N0&&++h<R0);return d}function Si(n,i,s,l){if(n===i&&s===l)return dt;const u=f=>A0(f,0,1,n,s);return f=>f===0||f===1?f:dp(u(f),i,l)}const fp=n=>i=>i<=.5?n(2*i)/2:(2-n(2*(1-i)))/2,hp=n=>i=>1-n(1-i),pp=Si(.33,1.53,.69,.99),tu=hp(pp),mp=fp(tu),gp=n=>(n*=2)<1?.5*tu(n):.5*(2-Math.pow(2,-10*(n-1))),nu=n=>1-Math.sin(Math.acos(n)),yp=hp(nu),vp=fp(nu),xp=n=>/^0[^.\s]+$/u.test(n);function M0(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||xp(n):!0}const ci=n=>Math.round(n*1e5)/1e5,ru=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function D0(n){return n==null}const L0=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,iu=(n,i)=>s=>!!(typeof s=="string"&&L0.test(s)&&s.startsWith(n)||i&&!D0(s)&&Object.prototype.hasOwnProperty.call(s,i)),wp=(n,i,s)=>l=>{if(typeof l!="string")return l;const[u,f,d,h]=l.match(ru);return{[n]:parseFloat(u),[i]:parseFloat(f),[s]:parseFloat(d),alpha:h!==void 0?parseFloat(h):1}},_0=n=>Qt(0,255,n),ia={...xr,transform:n=>Math.round(_0(n))},Vn={test:iu("rgb","red"),parse:wp("red","green","blue"),transform:({red:n,green:i,blue:s,alpha:l=1})=>"rgba("+ia.transform(n)+", "+ia.transform(i)+", "+ia.transform(s)+", "+ci(gi.transform(l))+")"};function V0(n){let i="",s="",l="",u="";return n.length>5?(i=n.substring(1,3),s=n.substring(3,5),l=n.substring(5,7),u=n.substring(7,9)):(i=n.substring(1,2),s=n.substring(2,3),l=n.substring(3,4),u=n.substring(4,5),i+=i,s+=s,l+=l,u+=u),{red:parseInt(i,16),green:parseInt(s,16),blue:parseInt(l,16),alpha:u?parseInt(u,16)/255:1}}const wa={test:iu("#"),parse:V0,transform:Vn.transform},dr={test:iu("hsl","hue"),parse:wp("hue","saturation","lightness"),transform:({hue:n,saturation:i,lightness:s,alpha:l=1})=>"hsla("+Math.round(n)+", "+zt.transform(ci(i))+", "+zt.transform(ci(s))+", "+ci(gi.transform(l))+")"},He={test:n=>Vn.test(n)||wa.test(n)||dr.test(n),parse:n=>Vn.test(n)?Vn.parse(n):dr.test(n)?dr.parse(n):wa.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Vn.transform(n):dr.transform(n)},z0=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function F0(n){var i,s;return isNaN(n)&&typeof n=="string"&&(((i=n.match(ru))===null||i===void 0?void 0:i.length)||0)+(((s=n.match(z0))===null||s===void 0?void 0:s.length)||0)>0}const Sp="number",kp="color",I0="var",O0="var(",jf="${}",B0=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function vi(n){const i=n.toString(),s=[],l={color:[],number:[],var:[]},u=[];let f=0;const h=i.replace(B0,m=>(He.test(m)?(l.color.push(f),u.push(kp),s.push(He.parse(m))):m.startsWith(O0)?(l.var.push(f),u.push(I0),s.push(m)):(l.number.push(f),u.push(Sp),s.push(parseFloat(m))),++f,jf)).split(jf);return{values:s,split:h,indexes:l,types:u}}function Tp(n){return vi(n).values}function Pp(n){const{split:i,types:s}=vi(n),l=i.length;return u=>{let f="";for(let d=0;d<l;d++)if(f+=i[d],u[d]!==void 0){const h=s[d];h===Sp?f+=ci(u[d]):h===kp?f+=He.transform(u[d]):f+=u[d]}return f}}const U0=n=>typeof n=="number"?0:n;function $0(n){const i=Tp(n);return Pp(n)(i.map(U0))}const yn={test:F0,parse:Tp,createTransformer:Pp,getAnimatableNone:$0},W0=new Set(["brightness","contrast","saturate","opacity"]);function b0(n){const[i,s]=n.slice(0,-1).split("(");if(i==="drop-shadow")return n;const[l]=s.match(ru)||[];if(!l)return n;const u=s.replace(l,"");let f=W0.has(i)?1:0;return l!==s&&(f*=100),i+"("+f+u+")"}const H0=/\b([a-z-]*)\(.*?\)/gu,Sa={...yn,getAnimatableNone:n=>{const i=n.match(H0);return i?i.map(b0).join(" "):n}},K0={...$a,color:He,backgroundColor:He,outlineColor:He,fill:He,stroke:He,borderColor:He,borderTopColor:He,borderRightColor:He,borderBottomColor:He,borderLeftColor:He,filter:Sa,WebkitFilter:Sa},su=n=>K0[n];function Cp(n,i){let s=su(n);return s!==Sa&&(s=yn),s.getAnimatableNone?s.getAnimatableNone(i):void 0}const G0=new Set(["auto","none","0"]);function Q0(n,i,s){let l=0,u;for(;l<n.length&&!u;){const f=n[l];typeof f=="string"&&!G0.has(f)&&vi(f).values.length&&(u=n[l]),l++}if(u&&s)for(const f of i)n[f]=Cp(s,u)}const Nf=n=>n===xr||n===te,Rf=(n,i)=>parseFloat(n.split(", ")[i]),Af=(n,i)=>(s,{transform:l})=>{if(l==="none"||!l)return 0;const u=l.match(/^matrix3d\((.+)\)$/u);if(u)return Rf(u[1],i);{const f=l.match(/^matrix\((.+)\)$/u);return f?Rf(f[1],n):0}},Y0=new Set(["x","y","z"]),X0=vr.filter(n=>!Y0.has(n));function Z0(n){const i=[];return X0.forEach(s=>{const l=n.getValue(s);l!==void 0&&(i.push([s,l.get()]),l.set(s.startsWith("scale")?1:0))}),i}const yr={width:({x:n},{paddingLeft:i="0",paddingRight:s="0"})=>n.max-n.min-parseFloat(i)-parseFloat(s),height:({y:n},{paddingTop:i="0",paddingBottom:s="0"})=>n.max-n.min-parseFloat(i)-parseFloat(s),top:(n,{top:i})=>parseFloat(i),left:(n,{left:i})=>parseFloat(i),bottom:({y:n},{top:i})=>parseFloat(i)+(n.max-n.min),right:({x:n},{left:i})=>parseFloat(i)+(n.max-n.min),x:Af(4,13),y:Af(5,14)};yr.translateX=yr.x;yr.translateY=yr.y;const zn=new Set;let ka=!1,Ta=!1;function Ep(){if(Ta){const n=Array.from(zn).filter(l=>l.needsMeasurement),i=new Set(n.map(l=>l.element)),s=new Map;i.forEach(l=>{const u=Z0(l);u.length&&(s.set(l,u),l.render())}),n.forEach(l=>l.measureInitialState()),i.forEach(l=>{l.render();const u=s.get(l);u&&u.forEach(([f,d])=>{var h;(h=l.getValue(f))===null||h===void 0||h.set(d)})}),n.forEach(l=>l.measureEndState()),n.forEach(l=>{l.suspendedScrollY!==void 0&&window.scrollTo(0,l.suspendedScrollY)})}Ta=!1,ka=!1,zn.forEach(n=>n.complete()),zn.clear()}function jp(){zn.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(Ta=!0)})}function q0(){jp(),Ep()}class ou{constructor(i,s,l,u,f,d=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...i],this.onComplete=s,this.name=l,this.motionValue=u,this.element=f,this.isAsync=d}scheduleResolve(){this.isScheduled=!0,this.isAsync?(zn.add(this),ka||(ka=!0,xe.read(jp),xe.resolveKeyframes(Ep))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:i,name:s,element:l,motionValue:u}=this;for(let f=0;f<i.length;f++)if(i[f]===null)if(f===0){const d=u==null?void 0:u.get(),h=i[i.length-1];if(d!==void 0)i[0]=d;else if(l&&s){const m=l.readValue(s,h);m!=null&&(i[0]=m)}i[0]===void 0&&(i[0]=h),u&&d===void 0&&u.set(i[0])}else i[f]=i[f-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),zn.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,zn.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Np=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),J0=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ev(n){const i=J0.exec(n);if(!i)return[,];const[,s,l,u]=i;return[`--${s??l}`,u]}function Rp(n,i,s=1){const[l,u]=ev(n);if(!l)return;const f=window.getComputedStyle(i).getPropertyValue(l);if(f){const d=f.trim();return Np(d)?parseFloat(d):d}return Ua(u)?Rp(u,i,s+1):u}const Ap=n=>i=>i.test(n),tv={test:n=>n==="auto",parse:n=>n},Mp=[xr,te,zt,mn,Zy,Xy,tv],Mf=n=>Mp.find(Ap(n));class Dp extends ou{constructor(i,s,l,u,f){super(i,s,l,u,f,!0)}readKeyframes(){const{unresolvedKeyframes:i,element:s,name:l}=this;if(!s||!s.current)return;super.readKeyframes();for(let m=0;m<i.length;m++){let g=i[m];if(typeof g=="string"&&(g=g.trim(),Ua(g))){const y=Rp(g,s.current);y!==void 0&&(i[m]=y),m===i.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!sp.has(l)||i.length!==2)return;const[u,f]=i,d=Mf(u),h=Mf(f);if(d!==h)if(Nf(d)&&Nf(h))for(let m=0;m<i.length;m++){const g=i[m];typeof g=="string"&&(i[m]=parseFloat(g))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:i,name:s}=this,l=[];for(let u=0;u<i.length;u++)M0(i[u])&&l.push(u);l.length&&Q0(i,l,s)}measureInitialState(){const{element:i,unresolvedKeyframes:s,name:l}=this;if(!i||!i.current)return;l==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=yr[l](i.measureViewportBox(),window.getComputedStyle(i.current)),s[0]=this.measuredOrigin;const u=s[s.length-1];u!==void 0&&i.getValue(l,u).jump(u,!1)}measureEndState(){var i;const{element:s,name:l,unresolvedKeyframes:u}=this;if(!s||!s.current)return;const f=s.getValue(l);f&&f.jump(this.measuredOrigin,!1);const d=u.length-1,h=u[d];u[d]=yr[l](s.measureViewportBox(),window.getComputedStyle(s.current)),h!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=h),!((i=this.removedTransforms)===null||i===void 0)&&i.length&&this.removedTransforms.forEach(([m,g])=>{s.getValue(m).set(g)}),this.resolveNoneKeyframes()}}const Df=(n,i)=>i==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(yn.test(n)||n==="0")&&!n.startsWith("url("));function nv(n){const i=n[0];if(n.length===1)return!0;for(let s=0;s<n.length;s++)if(n[s]!==i)return!0}function rv(n,i,s,l){const u=n[0];if(u===null)return!1;if(i==="display"||i==="visibility")return!0;const f=n[n.length-1],d=Df(u,i),h=Df(f,i);return!d||!h?!1:nv(n)||(s==="spring"||Ja(s))&&l}const iv=n=>n!==null;function ro(n,{repeat:i,repeatType:s="loop"},l){const u=n.filter(iv),f=i&&s!=="loop"&&i%2===1?0:u.length-1;return!f||l===void 0?u[f]:l}const sv=40;class Lp{constructor({autoplay:i=!0,delay:s=0,type:l="keyframes",repeat:u=0,repeatDelay:f=0,repeatType:d="loop",...h}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ft.now(),this.options={autoplay:i,delay:s,type:l,repeat:u,repeatDelay:f,repeatType:d,...h},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>sv?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&q0(),this._resolved}onKeyframesResolved(i,s){this.resolvedAt=Ft.now(),this.hasAttemptedResolve=!0;const{name:l,type:u,velocity:f,delay:d,onComplete:h,onUpdate:m,isGenerator:g}=this.options;if(!g&&!rv(i,l,u,f))if(d)this.options.duration=0;else{m&&m(ro(i,this.options,s)),h&&h(),this.resolveFinishedPromise();return}const y=this.initPlayback(i,s);y!==!1&&(this._resolved={keyframes:i,finalKeyframe:s,...y},this.onPostResolved())}onPostResolved(){}then(i,s){return this.currentFinishedPromise.then(i,s)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(i=>{this.resolveFinishedPromise=i})}}const Pa=2e4;function _p(n){let i=0;const s=50;let l=n.next(i);for(;!l.done&&i<Pa;)i+=s,l=n.next(i);return i>=Pa?1/0:i}const Ce=(n,i,s)=>n+(i-n)*s;function sa(n,i,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?n+(i-n)*6*s:s<1/2?i:s<2/3?n+(i-n)*(2/3-s)*6:n}function ov({hue:n,saturation:i,lightness:s,alpha:l}){n/=360,i/=100,s/=100;let u=0,f=0,d=0;if(!i)u=f=d=s;else{const h=s<.5?s*(1+i):s+i-s*i,m=2*s-h;u=sa(m,h,n+1/3),f=sa(m,h,n),d=sa(m,h,n-1/3)}return{red:Math.round(u*255),green:Math.round(f*255),blue:Math.round(d*255),alpha:l}}function Hs(n,i){return s=>s>0?i:n}const oa=(n,i,s)=>{const l=n*n,u=s*(i*i-l)+l;return u<0?0:Math.sqrt(u)},lv=[wa,Vn,dr],av=n=>lv.find(i=>i.test(n));function Lf(n){const i=av(n);if(!i)return!1;let s=i.parse(n);return i===dr&&(s=ov(s)),s}const _f=(n,i)=>{const s=Lf(n),l=Lf(i);if(!s||!l)return Hs(n,i);const u={...s};return f=>(u.red=oa(s.red,l.red,f),u.green=oa(s.green,l.green,f),u.blue=oa(s.blue,l.blue,f),u.alpha=Ce(s.alpha,l.alpha,f),Vn.transform(u))},uv=(n,i)=>s=>i(n(s)),ki=(...n)=>n.reduce(uv),Ca=new Set(["none","hidden"]);function cv(n,i){return Ca.has(n)?s=>s<=0?n:i:s=>s>=1?i:n}function dv(n,i){return s=>Ce(n,i,s)}function lu(n){return typeof n=="number"?dv:typeof n=="string"?Ua(n)?Hs:He.test(n)?_f:pv:Array.isArray(n)?Vp:typeof n=="object"?He.test(n)?_f:fv:Hs}function Vp(n,i){const s=[...n],l=s.length,u=n.map((f,d)=>lu(f)(f,i[d]));return f=>{for(let d=0;d<l;d++)s[d]=u[d](f);return s}}function fv(n,i){const s={...n,...i},l={};for(const u in s)n[u]!==void 0&&i[u]!==void 0&&(l[u]=lu(n[u])(n[u],i[u]));return u=>{for(const f in l)s[f]=l[f](u);return s}}function hv(n,i){var s;const l=[],u={color:0,var:0,number:0};for(let f=0;f<i.values.length;f++){const d=i.types[f],h=n.indexes[d][u[d]],m=(s=n.values[h])!==null&&s!==void 0?s:0;l[f]=m,u[d]++}return l}const pv=(n,i)=>{const s=yn.createTransformer(i),l=vi(n),u=vi(i);return l.indexes.var.length===u.indexes.var.length&&l.indexes.color.length===u.indexes.color.length&&l.indexes.number.length>=u.indexes.number.length?Ca.has(n)&&!u.values.length||Ca.has(i)&&!l.values.length?cv(n,i):ki(Vp(hv(l,u),u.values),s):Hs(n,i)};function zp(n,i,s){return typeof n=="number"&&typeof i=="number"&&typeof s=="number"?Ce(n,i,s):lu(n)(n,i)}const mv=5;function Fp(n,i,s){const l=Math.max(i-mv,0);return op(s-n(l),i-l)}const Ne={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},la=.001;function gv({duration:n=Ne.duration,bounce:i=Ne.bounce,velocity:s=Ne.velocity,mass:l=Ne.mass}){let u,f,d=1-i;d=Qt(Ne.minDamping,Ne.maxDamping,d),n=Qt(Ne.minDuration,Ne.maxDuration,Gt(n)),d<1?(u=g=>{const y=g*d,w=y*n,k=y-s,R=Ea(g,d),A=Math.exp(-w);return la-k/R*A},f=g=>{const w=g*d*n,k=w*s+s,R=Math.pow(d,2)*Math.pow(g,2)*n,A=Math.exp(-w),j=Ea(Math.pow(g,2),d);return(-u(g)+la>0?-1:1)*((k-R)*A)/j}):(u=g=>{const y=Math.exp(-g*n),w=(g-s)*n+1;return-la+y*w},f=g=>{const y=Math.exp(-g*n),w=(s-g)*(n*n);return y*w});const h=5/n,m=vv(u,f,h);if(n=Kt(n),isNaN(m))return{stiffness:Ne.stiffness,damping:Ne.damping,duration:n};{const g=Math.pow(m,2)*l;return{stiffness:g,damping:d*2*Math.sqrt(l*g),duration:n}}}const yv=12;function vv(n,i,s){let l=s;for(let u=1;u<yv;u++)l=l-n(l)/i(l);return l}function Ea(n,i){return n*Math.sqrt(1-i*i)}const xv=["duration","bounce"],wv=["stiffness","damping","mass"];function Vf(n,i){return i.some(s=>n[s]!==void 0)}function Sv(n){let i={velocity:Ne.velocity,stiffness:Ne.stiffness,damping:Ne.damping,mass:Ne.mass,isResolvedFromDuration:!1,...n};if(!Vf(n,wv)&&Vf(n,xv))if(n.visualDuration){const s=n.visualDuration,l=2*Math.PI/(s*1.2),u=l*l,f=2*Qt(.05,1,1-(n.bounce||0))*Math.sqrt(u);i={...i,mass:Ne.mass,stiffness:u,damping:f}}else{const s=gv(n);i={...i,...s,mass:Ne.mass},i.isResolvedFromDuration=!0}return i}function Ip(n=Ne.visualDuration,i=Ne.bounce){const s=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:i}:n;let{restSpeed:l,restDelta:u}=s;const f=s.keyframes[0],d=s.keyframes[s.keyframes.length-1],h={done:!1,value:f},{stiffness:m,damping:g,mass:y,duration:w,velocity:k,isResolvedFromDuration:R}=Sv({...s,velocity:-Gt(s.velocity||0)}),A=k||0,j=g/(2*Math.sqrt(m*y)),M=d-f,D=Gt(Math.sqrt(m/y)),O=Math.abs(M)<5;l||(l=O?Ne.restSpeed.granular:Ne.restSpeed.default),u||(u=O?Ne.restDelta.granular:Ne.restDelta.default);let $;if(j<1){const U=Ea(D,j);$=X=>{const re=Math.exp(-j*D*X);return d-re*((A+j*D*M)/U*Math.sin(U*X)+M*Math.cos(U*X))}}else if(j===1)$=U=>d-Math.exp(-D*U)*(M+(A+D*M)*U);else{const U=D*Math.sqrt(j*j-1);$=X=>{const re=Math.exp(-j*D*X),Z=Math.min(U*X,300);return d-re*((A+j*D*M)*Math.sinh(Z)+U*M*Math.cosh(Z))/U}}const Q={calculatedDuration:R&&w||null,next:U=>{const X=$(U);if(R)h.done=U>=w;else{let re=0;j<1&&(re=U===0?Kt(A):Fp($,U,X));const Z=Math.abs(re)<=l,ge=Math.abs(d-X)<=u;h.done=Z&&ge}return h.value=h.done?d:X,h},toString:()=>{const U=Math.min(_p(Q),Pa),X=ap(re=>Q.next(U*re).value,U,30);return U+"ms "+X}};return Q}function zf({keyframes:n,velocity:i=0,power:s=.8,timeConstant:l=325,bounceDamping:u=10,bounceStiffness:f=500,modifyTarget:d,min:h,max:m,restDelta:g=.5,restSpeed:y}){const w=n[0],k={done:!1,value:w},R=Z=>h!==void 0&&Z<h||m!==void 0&&Z>m,A=Z=>h===void 0?m:m===void 0||Math.abs(h-Z)<Math.abs(m-Z)?h:m;let j=s*i;const M=w+j,D=d===void 0?M:d(M);D!==M&&(j=D-w);const O=Z=>-j*Math.exp(-Z/l),$=Z=>D+O(Z),Q=Z=>{const ge=O(Z),Ee=$(Z);k.done=Math.abs(ge)<=g,k.value=k.done?D:Ee};let U,X;const re=Z=>{R(k.value)&&(U=Z,X=Ip({keyframes:[k.value,A(k.value)],velocity:Fp($,Z,k.value),damping:u,stiffness:f,restDelta:g,restSpeed:y}))};return re(0),{calculatedDuration:null,next:Z=>{let ge=!1;return!X&&U===void 0&&(ge=!0,Q(Z),re(Z)),U!==void 0&&Z>=U?X.next(Z-U):(!ge&&Q(Z),k)}}}const kv=Si(.42,0,1,1),Tv=Si(0,0,.58,1),Op=Si(.42,0,.58,1),Pv=n=>Array.isArray(n)&&typeof n[0]!="number",Cv={linear:dt,easeIn:kv,easeInOut:Op,easeOut:Tv,circIn:nu,circInOut:vp,circOut:yp,backIn:tu,backInOut:mp,backOut:pp,anticipate:gp},Ff=n=>{if(eu(n)){Ih(n.length===4);const[i,s,l,u]=n;return Si(i,s,l,u)}else if(typeof n=="string")return Cv[n];return n};function Ev(n,i,s){const l=[],u=s||zp,f=n.length-1;for(let d=0;d<f;d++){let h=u(n[d],n[d+1]);if(i){const m=Array.isArray(i)?i[d]||dt:i;h=ki(m,h)}l.push(h)}return l}function jv(n,i,{clamp:s=!0,ease:l,mixer:u}={}){const f=n.length;if(Ih(f===i.length),f===1)return()=>i[0];if(f===2&&i[0]===i[1])return()=>i[1];const d=n[0]===n[1];n[0]>n[f-1]&&(n=[...n].reverse(),i=[...i].reverse());const h=Ev(i,l,u),m=h.length,g=y=>{if(d&&y<n[0])return i[0];let w=0;if(m>1)for(;w<n.length-2&&!(y<n[w+1]);w++);const k=gr(n[w],n[w+1],y);return h[w](k)};return s?y=>g(Qt(n[0],n[f-1],y)):g}function Nv(n,i){const s=n[n.length-1];for(let l=1;l<=i;l++){const u=gr(0,i,l);n.push(Ce(s,1,u))}}function Rv(n){const i=[0];return Nv(i,n.length-1),i}function Av(n,i){return n.map(s=>s*i)}function Mv(n,i){return n.map(()=>i||Op).splice(0,n.length-1)}function Ks({duration:n=300,keyframes:i,times:s,ease:l="easeInOut"}){const u=Pv(l)?l.map(Ff):Ff(l),f={done:!1,value:i[0]},d=Av(s&&s.length===i.length?s:Rv(i),n),h=jv(d,i,{ease:Array.isArray(u)?u:Mv(i,u)});return{calculatedDuration:n,next:m=>(f.value=h(m),f.done=m>=n,f)}}const Dv=n=>{const i=({timestamp:s})=>n(s);return{start:()=>xe.update(i,!0),stop:()=>gn(i),now:()=>Be.isProcessing?Be.timestamp:Ft.now()}},Lv={decay:zf,inertia:zf,tween:Ks,keyframes:Ks,spring:Ip},_v=n=>n/100;class au extends Lp{constructor(i){super(i),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:m}=this.options;m&&m()};const{name:s,motionValue:l,element:u,keyframes:f}=this.options,d=(u==null?void 0:u.KeyframeResolver)||ou,h=(m,g)=>this.onKeyframesResolved(m,g);this.resolver=new d(f,h,s,l,u),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(i){const{type:s="keyframes",repeat:l=0,repeatDelay:u=0,repeatType:f,velocity:d=0}=this.options,h=Ja(s)?s:Lv[s]||Ks;let m,g;h!==Ks&&typeof i[0]!="number"&&(m=ki(_v,zp(i[0],i[1])),i=[0,100]);const y=h({...this.options,keyframes:i});f==="mirror"&&(g=h({...this.options,keyframes:[...i].reverse(),velocity:-d})),y.calculatedDuration===null&&(y.calculatedDuration=_p(y));const{calculatedDuration:w}=y,k=w+u,R=k*(l+1)-u;return{generator:y,mirroredGenerator:g,mapPercentToKeyframes:m,calculatedDuration:w,resolvedDuration:k,totalDuration:R}}onPostResolved(){const{autoplay:i=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!i?this.pause():this.state=this.pendingPlayState}tick(i,s=!1){const{resolved:l}=this;if(!l){const{keyframes:Z}=this.options;return{done:!0,value:Z[Z.length-1]}}const{finalKeyframe:u,generator:f,mirroredGenerator:d,mapPercentToKeyframes:h,keyframes:m,calculatedDuration:g,totalDuration:y,resolvedDuration:w}=l;if(this.startTime===null)return f.next(0);const{delay:k,repeat:R,repeatType:A,repeatDelay:j,onUpdate:M}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,i):this.speed<0&&(this.startTime=Math.min(i-y/this.speed,this.startTime)),s?this.currentTime=i:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(i-this.startTime)*this.speed;const D=this.currentTime-k*(this.speed>=0?1:-1),O=this.speed>=0?D<0:D>y;this.currentTime=Math.max(D,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=y);let $=this.currentTime,Q=f;if(R){const Z=Math.min(this.currentTime,y)/w;let ge=Math.floor(Z),Ee=Z%1;!Ee&&Z>=1&&(Ee=1),Ee===1&&ge--,ge=Math.min(ge,R+1),!!(ge%2)&&(A==="reverse"?(Ee=1-Ee,j&&(Ee-=j/w)):A==="mirror"&&(Q=d)),$=Qt(0,1,Ee)*w}const U=O?{done:!1,value:m[0]}:Q.next($);h&&(U.value=h(U.value));let{done:X}=U;!O&&g!==null&&(X=this.speed>=0?this.currentTime>=y:this.currentTime<=0);const re=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&X);return re&&u!==void 0&&(U.value=ro(m,this.options,u)),M&&M(U.value),re&&this.finish(),U}get duration(){const{resolved:i}=this;return i?Gt(i.calculatedDuration):0}get time(){return Gt(this.currentTime)}set time(i){i=Kt(i),this.currentTime=i,this.holdTime!==null||this.speed===0?this.holdTime=i:this.driver&&(this.startTime=this.driver.now()-i/this.speed)}get speed(){return this.playbackSpeed}set speed(i){const s=this.playbackSpeed!==i;this.playbackSpeed=i,s&&(this.time=Gt(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:i=Dv,onPlay:s,startTime:l}=this.options;this.driver||(this.driver=i(f=>this.tick(f))),s&&s();const u=this.driver.now();this.holdTime!==null?this.startTime=u-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=u):this.startTime=l??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var i;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(i=this.currentTime)!==null&&i!==void 0?i:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:i}=this.options;i&&i()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(i){return this.startTime=0,this.tick(i,!0)}}const Vv=new Set(["opacity","clipPath","filter","transform"]);function zv(n,i,s,{delay:l=0,duration:u=300,repeat:f=0,repeatType:d="loop",ease:h="easeInOut",times:m}={}){const g={[i]:s};m&&(g.offset=m);const y=cp(h,u);return Array.isArray(y)&&(g.easing=y),n.animate(g,{delay:l,duration:u,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:f+1,direction:d==="reverse"?"alternate":"normal"})}const Fv=qa(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Gs=10,Iv=2e4;function Ov(n){return Ja(n.type)||n.type==="spring"||!up(n.ease)}function Bv(n,i){const s=new au({...i,keyframes:n,repeat:0,delay:0,isGenerator:!0});let l={done:!1,value:n[0]};const u=[];let f=0;for(;!l.done&&f<Iv;)l=s.sample(f),u.push(l.value),f+=Gs;return{times:void 0,keyframes:u,duration:f-Gs,ease:"linear"}}const Bp={anticipate:gp,backInOut:mp,circInOut:vp};function Uv(n){return n in Bp}class If extends Lp{constructor(i){super(i);const{name:s,motionValue:l,element:u,keyframes:f}=this.options;this.resolver=new Dp(f,(d,h)=>this.onKeyframesResolved(d,h),s,l,u),this.resolver.scheduleResolve()}initPlayback(i,s){let{duration:l=300,times:u,ease:f,type:d,motionValue:h,name:m,startTime:g}=this.options;if(!h.owner||!h.owner.current)return!1;if(typeof f=="string"&&bs()&&Uv(f)&&(f=Bp[f]),Ov(this.options)){const{onComplete:w,onUpdate:k,motionValue:R,element:A,...j}=this.options,M=Bv(i,j);i=M.keyframes,i.length===1&&(i[1]=i[0]),l=M.duration,u=M.times,f=M.ease,d="keyframes"}const y=zv(h.owner.current,m,i,{...this.options,duration:l,times:u,ease:f});return y.startTime=g??this.calcStartTime(),this.pendingTimeline?(Ef(y,this.pendingTimeline),this.pendingTimeline=void 0):y.onfinish=()=>{const{onComplete:w}=this.options;h.set(ro(i,this.options,s)),w&&w(),this.cancel(),this.resolveFinishedPromise()},{animation:y,duration:l,times:u,type:d,ease:f,keyframes:i}}get duration(){const{resolved:i}=this;if(!i)return 0;const{duration:s}=i;return Gt(s)}get time(){const{resolved:i}=this;if(!i)return 0;const{animation:s}=i;return Gt(s.currentTime||0)}set time(i){const{resolved:s}=this;if(!s)return;const{animation:l}=s;l.currentTime=Kt(i)}get speed(){const{resolved:i}=this;if(!i)return 1;const{animation:s}=i;return s.playbackRate}set speed(i){const{resolved:s}=this;if(!s)return;const{animation:l}=s;l.playbackRate=i}get state(){const{resolved:i}=this;if(!i)return"idle";const{animation:s}=i;return s.playState}get startTime(){const{resolved:i}=this;if(!i)return null;const{animation:s}=i;return s.startTime}attachTimeline(i){if(!this._resolved)this.pendingTimeline=i;else{const{resolved:s}=this;if(!s)return dt;const{animation:l}=s;Ef(l,i)}return dt}play(){if(this.isStopped)return;const{resolved:i}=this;if(!i)return;const{animation:s}=i;s.playState==="finished"&&this.updateFinishedPromise(),s.play()}pause(){const{resolved:i}=this;if(!i)return;const{animation:s}=i;s.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:i}=this;if(!i)return;const{animation:s,keyframes:l,duration:u,type:f,ease:d,times:h}=i;if(s.playState==="idle"||s.playState==="finished")return;if(this.time){const{motionValue:g,onUpdate:y,onComplete:w,element:k,...R}=this.options,A=new au({...R,keyframes:l,duration:u,type:f,ease:d,times:h,isGenerator:!0}),j=Kt(this.time);g.setWithVelocity(A.sample(j-Gs).value,A.sample(j).value,Gs)}const{onStop:m}=this.options;m&&m(),this.cancel()}complete(){const{resolved:i}=this;i&&i.animation.finish()}cancel(){const{resolved:i}=this;i&&i.animation.cancel()}static supports(i){const{motionValue:s,name:l,repeatDelay:u,repeatType:f,damping:d,type:h}=i;if(!s||!s.owner||!(s.owner.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:g}=s.owner.getProps();return Fv()&&l&&Vv.has(l)&&!m&&!g&&!u&&f!=="mirror"&&d!==0&&h!=="inertia"}}const $v={type:"spring",stiffness:500,damping:25,restSpeed:10},Wv=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),bv={type:"keyframes",duration:.8},Hv={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Kv=(n,{keyframes:i})=>i.length>2?bv:In.has(n)?n.startsWith("scale")?Wv(i[1]):$v:Hv;function Gv({when:n,delay:i,delayChildren:s,staggerChildren:l,staggerDirection:u,repeat:f,repeatType:d,repeatDelay:h,from:m,elapsed:g,...y}){return!!Object.keys(y).length}const uu=(n,i,s,l={},u,f)=>d=>{const h=Qa(l,n)||{},m=h.delay||l.delay||0;let{elapsed:g=0}=l;g=g-Kt(m);let y={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:i.getVelocity(),...h,delay:-g,onUpdate:k=>{i.set(k),h.onUpdate&&h.onUpdate(k)},onComplete:()=>{d(),h.onComplete&&h.onComplete()},name:n,motionValue:i,element:f?void 0:u};Gv(h)||(y={...y,...Kv(n,y)}),y.duration&&(y.duration=Kt(y.duration)),y.repeatDelay&&(y.repeatDelay=Kt(y.repeatDelay)),y.from!==void 0&&(y.keyframes[0]=y.from);let w=!1;if((y.type===!1||y.duration===0&&!y.repeatDelay)&&(y.duration=0,y.delay===0&&(w=!0)),w&&!f&&i.get()!==void 0){const k=ro(y.keyframes,h);if(k!==void 0)return xe.update(()=>{y.onUpdate(k),y.onComplete()}),new C0([])}return!f&&If.supports(y)?new If(y):new au(y)};function Qv({protectedKeys:n,needsAnimating:i},s){const l=n.hasOwnProperty(s)&&i[s]!==!0;return i[s]=!1,l}function Up(n,i,{delay:s=0,transitionOverride:l,type:u}={}){var f;let{transition:d=n.getDefaultTransition(),transitionEnd:h,...m}=i;l&&(d=l);const g=[],y=u&&n.animationState&&n.animationState.getState()[u];for(const w in m){const k=n.getValue(w,(f=n.latestValues[w])!==null&&f!==void 0?f:null),R=m[w];if(R===void 0||y&&Qv(y,w))continue;const A={delay:s,...Qa(d||{},w)};let j=!1;if(window.MotionHandoffAnimation){const D=lp(n);if(D){const O=window.MotionHandoffAnimation(D,w,xe);O!==null&&(A.startTime=O,j=!0)}}va(n,w),k.start(uu(w,k,R,n.shouldReduceMotion&&sp.has(w)?{type:!1}:A,n,j));const M=k.animation;M&&g.push(M)}return h&&Promise.all(g).then(()=>{xe.update(()=>{h&&S0(n,h)})}),g}function ja(n,i,s={}){var l;const u=no(n,i,s.type==="exit"?(l=n.presenceContext)===null||l===void 0?void 0:l.custom:void 0);let{transition:f=n.getDefaultTransition()||{}}=u||{};s.transitionOverride&&(f=s.transitionOverride);const d=u?()=>Promise.all(Up(n,u,s)):()=>Promise.resolve(),h=n.variantChildren&&n.variantChildren.size?(g=0)=>{const{delayChildren:y=0,staggerChildren:w,staggerDirection:k}=f;return Yv(n,i,y+g,w,k,s)}:()=>Promise.resolve(),{when:m}=f;if(m){const[g,y]=m==="beforeChildren"?[d,h]:[h,d];return g().then(()=>y())}else return Promise.all([d(),h(s.delay)])}function Yv(n,i,s=0,l=0,u=1,f){const d=[],h=(n.variantChildren.size-1)*l,m=u===1?(g=0)=>g*l:(g=0)=>h-g*l;return Array.from(n.variantChildren).sort(Xv).forEach((g,y)=>{g.notify("AnimationStart",i),d.push(ja(g,i,{...f,delay:s+m(y)}).then(()=>g.notify("AnimationComplete",i)))}),Promise.all(d)}function Xv(n,i){return n.sortNodePosition(i)}function Zv(n,i,s={}){n.notify("AnimationStart",i);let l;if(Array.isArray(i)){const u=i.map(f=>ja(n,f,s));l=Promise.all(u)}else if(typeof i=="string")l=ja(n,i,s);else{const u=typeof i=="function"?no(n,i,s.custom):i;l=Promise.all(Up(n,u,s))}return l.then(()=>{n.notify("AnimationComplete",i)})}const qv=za.length;function $p(n){if(!n)return;if(!n.isControllingVariants){const s=n.parent?$p(n.parent)||{}:{};return n.props.initial!==void 0&&(s.initial=n.props.initial),s}const i={};for(let s=0;s<qv;s++){const l=za[s],u=n.props[l];(mi(u)||u===!1)&&(i[l]=u)}return i}const Jv=[...Va].reverse(),ex=Va.length;function tx(n){return i=>Promise.all(i.map(({animation:s,options:l})=>Zv(n,s,l)))}function nx(n){let i=tx(n),s=Of(),l=!0;const u=m=>(g,y)=>{var w;const k=no(n,y,m==="exit"?(w=n.presenceContext)===null||w===void 0?void 0:w.custom:void 0);if(k){const{transition:R,transitionEnd:A,...j}=k;g={...g,...j,...A}}return g};function f(m){i=m(n)}function d(m){const{props:g}=n,y=$p(n.parent)||{},w=[],k=new Set;let R={},A=1/0;for(let M=0;M<ex;M++){const D=Jv[M],O=s[D],$=g[D]!==void 0?g[D]:y[D],Q=mi($),U=D===m?O.isActive:null;U===!1&&(A=M);let X=$===y[D]&&$!==g[D]&&Q;if(X&&l&&n.manuallyAnimateOnMount&&(X=!1),O.protectedKeys={...R},!O.isActive&&U===null||!$&&!O.prevProp||eo($)||typeof $=="boolean")continue;const re=rx(O.prevProp,$);let Z=re||D===m&&O.isActive&&!X&&Q||M>A&&Q,ge=!1;const Ee=Array.isArray($)?$:[$];let Ze=Ee.reduce(u(D),{});U===!1&&(Ze={});const{prevResolvedValues:st={}}=O,Ge={...st,...Ze},qe=se=>{Z=!0,k.has(se)&&(ge=!0,k.delete(se)),O.needsAnimating[se]=!0;const B=n.getValue(se);B&&(B.liveStyle=!1)};for(const se in Ge){const B=Ze[se],q=st[se];if(R.hasOwnProperty(se))continue;let b=!1;ya(B)&&ya(q)?b=!ip(B,q):b=B!==q,b?B!=null?qe(se):k.add(se):B!==void 0&&k.has(se)?qe(se):O.protectedKeys[se]=!0}O.prevProp=$,O.prevResolvedValues=Ze,O.isActive&&(R={...R,...Ze}),l&&n.blockInitialAnimation&&(Z=!1),Z&&(!(X&&re)||ge)&&w.push(...Ee.map(se=>({animation:se,options:{type:D}})))}if(k.size){const M={};k.forEach(D=>{const O=n.getBaseTarget(D),$=n.getValue(D);$&&($.liveStyle=!0),M[D]=O??null}),w.push({animation:M})}let j=!!w.length;return l&&(g.initial===!1||g.initial===g.animate)&&!n.manuallyAnimateOnMount&&(j=!1),l=!1,j?i(w):Promise.resolve()}function h(m,g){var y;if(s[m].isActive===g)return Promise.resolve();(y=n.variantChildren)===null||y===void 0||y.forEach(k=>{var R;return(R=k.animationState)===null||R===void 0?void 0:R.setActive(m,g)}),s[m].isActive=g;const w=d(m);for(const k in s)s[k].protectedKeys={};return w}return{animateChanges:d,setActive:h,setAnimateFunction:f,getState:()=>s,reset:()=>{s=Of(),l=!0}}}function rx(n,i){return typeof i=="string"?i!==n:Array.isArray(i)?!ip(i,n):!1}function Dn(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Of(){return{animate:Dn(!0),whileInView:Dn(),whileHover:Dn(),whileTap:Dn(),whileDrag:Dn(),whileFocus:Dn(),exit:Dn()}}class vn{constructor(i){this.isMounted=!1,this.node=i}update(){}}class ix extends vn{constructor(i){super(i),i.animationState||(i.animationState=nx(i))}updateAnimationControlsSubscription(){const{animate:i}=this.node.getProps();eo(i)&&(this.unmountControls=i.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:i}=this.node.getProps(),{animate:s}=this.node.prevProps||{};i!==s&&this.updateAnimationControlsSubscription()}unmount(){var i;this.node.animationState.reset(),(i=this.unmountControls)===null||i===void 0||i.call(this)}}let sx=0;class ox extends vn{constructor(){super(...arguments),this.id=sx++}update(){if(!this.node.presenceContext)return;const{isPresent:i,onExitComplete:s}=this.node.presenceContext,{isPresent:l}=this.node.prevPresenceContext||{};if(!this.node.animationState||i===l)return;const u=this.node.animationState.setActive("exit",!i);s&&!i&&u.then(()=>s(this.id))}mount(){const{register:i}=this.node.presenceContext||{};i&&(this.unmount=i(this.id))}unmount(){}}const lx={animation:{Feature:ix},exit:{Feature:ox}},At={x:!1,y:!1};function Wp(){return At.x||At.y}function ax(n){return n==="x"||n==="y"?At[n]?null:(At[n]=!0,()=>{At[n]=!1}):At.x||At.y?null:(At.x=At.y=!0,()=>{At.x=At.y=!1})}const cu=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function xi(n,i,s,l={passive:!0}){return n.addEventListener(i,s,l),()=>n.removeEventListener(i,s)}function Ti(n){return{point:{x:n.pageX,y:n.pageY}}}const ux=n=>i=>cu(i)&&n(i,Ti(i));function di(n,i,s,l){return xi(n,i,ux(s),l)}const Bf=(n,i)=>Math.abs(n-i);function cx(n,i){const s=Bf(n.x,i.x),l=Bf(n.y,i.y);return Math.sqrt(s**2+l**2)}class bp{constructor(i,s,{transformPagePoint:l,contextWindow:u,dragSnapToOrigin:f=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=ua(this.lastMoveEventInfo,this.history),k=this.startEvent!==null,R=cx(w.offset,{x:0,y:0})>=3;if(!k&&!R)return;const{point:A}=w,{timestamp:j}=Be;this.history.push({...A,timestamp:j});const{onStart:M,onMove:D}=this.handlers;k||(M&&M(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),D&&D(this.lastMoveEvent,w)},this.handlePointerMove=(w,k)=>{this.lastMoveEvent=w,this.lastMoveEventInfo=aa(k,this.transformPagePoint),xe.update(this.updatePoint,!0)},this.handlePointerUp=(w,k)=>{this.end();const{onEnd:R,onSessionEnd:A,resumeAnimation:j}=this.handlers;if(this.dragSnapToOrigin&&j&&j(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const M=ua(w.type==="pointercancel"?this.lastMoveEventInfo:aa(k,this.transformPagePoint),this.history);this.startEvent&&R&&R(w,M),A&&A(w,M)},!cu(i))return;this.dragSnapToOrigin=f,this.handlers=s,this.transformPagePoint=l,this.contextWindow=u||window;const d=Ti(i),h=aa(d,this.transformPagePoint),{point:m}=h,{timestamp:g}=Be;this.history=[{...m,timestamp:g}];const{onSessionStart:y}=s;y&&y(i,ua(h,this.history)),this.removeListeners=ki(di(this.contextWindow,"pointermove",this.handlePointerMove),di(this.contextWindow,"pointerup",this.handlePointerUp),di(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(i){this.handlers=i}end(){this.removeListeners&&this.removeListeners(),gn(this.updatePoint)}}function aa(n,i){return i?{point:i(n.point)}:n}function Uf(n,i){return{x:n.x-i.x,y:n.y-i.y}}function ua({point:n},i){return{point:n,delta:Uf(n,Hp(i)),offset:Uf(n,dx(i)),velocity:fx(i,.1)}}function dx(n){return n[0]}function Hp(n){return n[n.length-1]}function fx(n,i){if(n.length<2)return{x:0,y:0};let s=n.length-1,l=null;const u=Hp(n);for(;s>=0&&(l=n[s],!(u.timestamp-l.timestamp>Kt(i)));)s--;if(!l)return{x:0,y:0};const f=Gt(u.timestamp-l.timestamp);if(f===0)return{x:0,y:0};const d={x:(u.x-l.x)/f,y:(u.y-l.y)/f};return d.x===1/0&&(d.x=0),d.y===1/0&&(d.y=0),d}const Kp=1e-4,hx=1-Kp,px=1+Kp,Gp=.01,mx=0-Gp,gx=0+Gp;function ft(n){return n.max-n.min}function yx(n,i,s){return Math.abs(n-i)<=s}function $f(n,i,s,l=.5){n.origin=l,n.originPoint=Ce(i.min,i.max,n.origin),n.scale=ft(s)/ft(i),n.translate=Ce(s.min,s.max,n.origin)-n.originPoint,(n.scale>=hx&&n.scale<=px||isNaN(n.scale))&&(n.scale=1),(n.translate>=mx&&n.translate<=gx||isNaN(n.translate))&&(n.translate=0)}function fi(n,i,s,l){$f(n.x,i.x,s.x,l?l.originX:void 0),$f(n.y,i.y,s.y,l?l.originY:void 0)}function Wf(n,i,s){n.min=s.min+i.min,n.max=n.min+ft(i)}function vx(n,i,s){Wf(n.x,i.x,s.x),Wf(n.y,i.y,s.y)}function bf(n,i,s){n.min=i.min-s.min,n.max=n.min+ft(i)}function hi(n,i,s){bf(n.x,i.x,s.x),bf(n.y,i.y,s.y)}function xx(n,{min:i,max:s},l){return i!==void 0&&n<i?n=l?Ce(i,n,l.min):Math.max(n,i):s!==void 0&&n>s&&(n=l?Ce(s,n,l.max):Math.min(n,s)),n}function Hf(n,i,s){return{min:i!==void 0?n.min+i:void 0,max:s!==void 0?n.max+s-(n.max-n.min):void 0}}function wx(n,{top:i,left:s,bottom:l,right:u}){return{x:Hf(n.x,s,u),y:Hf(n.y,i,l)}}function Kf(n,i){let s=i.min-n.min,l=i.max-n.max;return i.max-i.min<n.max-n.min&&([s,l]=[l,s]),{min:s,max:l}}function Sx(n,i){return{x:Kf(n.x,i.x),y:Kf(n.y,i.y)}}function kx(n,i){let s=.5;const l=ft(n),u=ft(i);return u>l?s=gr(i.min,i.max-l,n.min):l>u&&(s=gr(n.min,n.max-u,i.min)),Qt(0,1,s)}function Tx(n,i){const s={};return i.min!==void 0&&(s.min=i.min-n.min),i.max!==void 0&&(s.max=i.max-n.min),s}const Na=.35;function Px(n=Na){return n===!1?n=0:n===!0&&(n=Na),{x:Gf(n,"left","right"),y:Gf(n,"top","bottom")}}function Gf(n,i,s){return{min:Qf(n,i),max:Qf(n,s)}}function Qf(n,i){return typeof n=="number"?n:n[i]||0}const Yf=()=>({translate:0,scale:1,origin:0,originPoint:0}),fr=()=>({x:Yf(),y:Yf()}),Xf=()=>({min:0,max:0}),Me=()=>({x:Xf(),y:Xf()});function wt(n){return[n("x"),n("y")]}function Qp({top:n,left:i,right:s,bottom:l}){return{x:{min:i,max:s},y:{min:n,max:l}}}function Cx({x:n,y:i}){return{top:i.min,right:n.max,bottom:i.max,left:n.min}}function Ex(n,i){if(!i)return n;const s=i({x:n.left,y:n.top}),l=i({x:n.right,y:n.bottom});return{top:s.y,left:s.x,bottom:l.y,right:l.x}}function ca(n){return n===void 0||n===1}function Ra({scale:n,scaleX:i,scaleY:s}){return!ca(n)||!ca(i)||!ca(s)}function Ln(n){return Ra(n)||Yp(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function Yp(n){return Zf(n.x)||Zf(n.y)}function Zf(n){return n&&n!=="0%"}function Qs(n,i,s){const l=n-s,u=i*l;return s+u}function qf(n,i,s,l,u){return u!==void 0&&(n=Qs(n,u,l)),Qs(n,s,l)+i}function Aa(n,i=0,s=1,l,u){n.min=qf(n.min,i,s,l,u),n.max=qf(n.max,i,s,l,u)}function Xp(n,{x:i,y:s}){Aa(n.x,i.translate,i.scale,i.originPoint),Aa(n.y,s.translate,s.scale,s.originPoint)}const Jf=.999999999999,eh=1.0000000000001;function jx(n,i,s,l=!1){const u=s.length;if(!u)return;i.x=i.y=1;let f,d;for(let h=0;h<u;h++){f=s[h],d=f.projectionDelta;const{visualElement:m}=f.options;m&&m.props.style&&m.props.style.display==="contents"||(l&&f.options.layoutScroll&&f.scroll&&f!==f.root&&pr(n,{x:-f.scroll.offset.x,y:-f.scroll.offset.y}),d&&(i.x*=d.x.scale,i.y*=d.y.scale,Xp(n,d)),l&&Ln(f.latestValues)&&pr(n,f.latestValues))}i.x<eh&&i.x>Jf&&(i.x=1),i.y<eh&&i.y>Jf&&(i.y=1)}function hr(n,i){n.min=n.min+i,n.max=n.max+i}function th(n,i,s,l,u=.5){const f=Ce(n.min,n.max,u);Aa(n,i,s,f,l)}function pr(n,i){th(n.x,i.x,i.scaleX,i.scale,i.originX),th(n.y,i.y,i.scaleY,i.scale,i.originY)}function Zp(n,i){return Qp(Ex(n.getBoundingClientRect(),i))}function Nx(n,i,s){const l=Zp(n,s),{scroll:u}=i;return u&&(hr(l.x,u.offset.x),hr(l.y,u.offset.y)),l}const qp=({current:n})=>n?n.ownerDocument.defaultView:null,Rx=new WeakMap;class Ax{constructor(i){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Me(),this.visualElement=i}start(i,{snapToCursor:s=!1}={}){const{presenceContext:l}=this.visualElement;if(l&&l.isPresent===!1)return;const u=y=>{const{dragSnapToOrigin:w}=this.getProps();w?this.pauseAnimation():this.stopAnimation(),s&&this.snapToCursor(Ti(y).point)},f=(y,w)=>{const{drag:k,dragPropagation:R,onDragStart:A}=this.getProps();if(k&&!R&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ax(k),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),wt(M=>{let D=this.getAxisMotionValue(M).get()||0;if(zt.test(D)){const{projection:O}=this.visualElement;if(O&&O.layout){const $=O.layout.layoutBox[M];$&&(D=ft($)*(parseFloat(D)/100))}}this.originPoint[M]=D}),A&&xe.postRender(()=>A(y,w)),va(this.visualElement,"transform");const{animationState:j}=this.visualElement;j&&j.setActive("whileDrag",!0)},d=(y,w)=>{const{dragPropagation:k,dragDirectionLock:R,onDirectionLock:A,onDrag:j}=this.getProps();if(!k&&!this.openDragLock)return;const{offset:M}=w;if(R&&this.currentDirection===null){this.currentDirection=Mx(M),this.currentDirection!==null&&A&&A(this.currentDirection);return}this.updateAxis("x",w.point,M),this.updateAxis("y",w.point,M),this.visualElement.render(),j&&j(y,w)},h=(y,w)=>this.stop(y,w),m=()=>wt(y=>{var w;return this.getAnimationState(y)==="paused"&&((w=this.getAxisMotionValue(y).animation)===null||w===void 0?void 0:w.play())}),{dragSnapToOrigin:g}=this.getProps();this.panSession=new bp(i,{onSessionStart:u,onStart:f,onMove:d,onSessionEnd:h,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:qp(this.visualElement)})}stop(i,s){const l=this.isDragging;if(this.cancel(),!l)return;const{velocity:u}=s;this.startAnimation(u);const{onDragEnd:f}=this.getProps();f&&xe.postRender(()=>f(i,s))}cancel(){this.isDragging=!1;const{projection:i,animationState:s}=this.visualElement;i&&(i.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:l}=this.getProps();!l&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}updateAxis(i,s,l){const{drag:u}=this.getProps();if(!l||!Is(i,u,this.currentDirection))return;const f=this.getAxisMotionValue(i);let d=this.originPoint[i]+l[i];this.constraints&&this.constraints[i]&&(d=xx(d,this.constraints[i],this.elastic[i])),f.set(d)}resolveConstraints(){var i;const{dragConstraints:s,dragElastic:l}=this.getProps(),u=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)===null||i===void 0?void 0:i.layout,f=this.constraints;s&&cr(s)?this.constraints||(this.constraints=this.resolveRefConstraints()):s&&u?this.constraints=wx(u.layoutBox,s):this.constraints=!1,this.elastic=Px(l),f!==this.constraints&&u&&this.constraints&&!this.hasMutatedConstraints&&wt(d=>{this.constraints!==!1&&this.getAxisMotionValue(d)&&(this.constraints[d]=Tx(u.layoutBox[d],this.constraints[d]))})}resolveRefConstraints(){const{dragConstraints:i,onMeasureDragConstraints:s}=this.getProps();if(!i||!cr(i))return!1;const l=i.current,{projection:u}=this.visualElement;if(!u||!u.layout)return!1;const f=Nx(l,u.root,this.visualElement.getTransformPagePoint());let d=Sx(u.layout.layoutBox,f);if(s){const h=s(Cx(d));this.hasMutatedConstraints=!!h,h&&(d=Qp(h))}return d}startAnimation(i){const{drag:s,dragMomentum:l,dragElastic:u,dragTransition:f,dragSnapToOrigin:d,onDragTransitionEnd:h}=this.getProps(),m=this.constraints||{},g=wt(y=>{if(!Is(y,s,this.currentDirection))return;let w=m&&m[y]||{};d&&(w={min:0,max:0});const k=u?200:1e6,R=u?40:1e7,A={type:"inertia",velocity:l?i[y]:0,bounceStiffness:k,bounceDamping:R,timeConstant:750,restDelta:1,restSpeed:10,...f,...w};return this.startAxisValueAnimation(y,A)});return Promise.all(g).then(h)}startAxisValueAnimation(i,s){const l=this.getAxisMotionValue(i);return va(this.visualElement,i),l.start(uu(i,l,0,s,this.visualElement,!1))}stopAnimation(){wt(i=>this.getAxisMotionValue(i).stop())}pauseAnimation(){wt(i=>{var s;return(s=this.getAxisMotionValue(i).animation)===null||s===void 0?void 0:s.pause()})}getAnimationState(i){var s;return(s=this.getAxisMotionValue(i).animation)===null||s===void 0?void 0:s.state}getAxisMotionValue(i){const s=`_drag${i.toUpperCase()}`,l=this.visualElement.getProps(),u=l[s];return u||this.visualElement.getValue(i,(l.initial?l.initial[i]:void 0)||0)}snapToCursor(i){wt(s=>{const{drag:l}=this.getProps();if(!Is(s,l,this.currentDirection))return;const{projection:u}=this.visualElement,f=this.getAxisMotionValue(s);if(u&&u.layout){const{min:d,max:h}=u.layout.layoutBox[s];f.set(i[s]-Ce(d,h,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:i,dragConstraints:s}=this.getProps(),{projection:l}=this.visualElement;if(!cr(s)||!l||!this.constraints)return;this.stopAnimation();const u={x:0,y:0};wt(d=>{const h=this.getAxisMotionValue(d);if(h&&this.constraints!==!1){const m=h.get();u[d]=kx({min:m,max:m},this.constraints[d])}});const{transformTemplate:f}=this.visualElement.getProps();this.visualElement.current.style.transform=f?f({},""):"none",l.root&&l.root.updateScroll(),l.updateLayout(),this.resolveConstraints(),wt(d=>{if(!Is(d,i,null))return;const h=this.getAxisMotionValue(d),{min:m,max:g}=this.constraints[d];h.set(Ce(m,g,u[d]))})}addListeners(){if(!this.visualElement.current)return;Rx.set(this.visualElement,this);const i=this.visualElement.current,s=di(i,"pointerdown",m=>{const{drag:g,dragListener:y=!0}=this.getProps();g&&y&&this.start(m)}),l=()=>{const{dragConstraints:m}=this.getProps();cr(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:u}=this.visualElement,f=u.addEventListener("measure",l);u&&!u.layout&&(u.root&&u.root.updateScroll(),u.updateLayout()),xe.read(l);const d=xi(window,"resize",()=>this.scalePositionWithinConstraints()),h=u.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(wt(y=>{const w=this.getAxisMotionValue(y);w&&(this.originPoint[y]+=m[y].translate,w.set(w.get()+m[y].translate))}),this.visualElement.render())}));return()=>{d(),s(),f(),h&&h()}}getProps(){const i=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:l=!1,dragPropagation:u=!1,dragConstraints:f=!1,dragElastic:d=Na,dragMomentum:h=!0}=i;return{...i,drag:s,dragDirectionLock:l,dragPropagation:u,dragConstraints:f,dragElastic:d,dragMomentum:h}}}function Is(n,i,s){return(i===!0||i===n)&&(s===null||s===n)}function Mx(n,i=10){let s=null;return Math.abs(n.y)>i?s="y":Math.abs(n.x)>i&&(s="x"),s}class Dx extends vn{constructor(i){super(i),this.removeGroupControls=dt,this.removeListeners=dt,this.controls=new Ax(i)}mount(){const{dragControls:i}=this.node.getProps();i&&(this.removeGroupControls=i.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||dt}unmount(){this.removeGroupControls(),this.removeListeners()}}const nh=n=>(i,s)=>{n&&xe.postRender(()=>n(i,s))};class Lx extends vn{constructor(){super(...arguments),this.removePointerDownListener=dt}onPointerDown(i){this.session=new bp(i,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:qp(this.node)})}createPanHandlers(){const{onPanSessionStart:i,onPanStart:s,onPan:l,onPanEnd:u}=this.node.getProps();return{onSessionStart:nh(i),onStart:nh(s),onMove:l,onEnd:(f,d)=>{delete this.session,u&&xe.postRender(()=>u(f,d))}}}mount(){this.removePointerDownListener=di(this.node.current,"pointerdown",i=>this.onPointerDown(i))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Us={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function rh(n,i){return i.max===i.min?0:n/(i.max-i.min)*100}const oi={correct:(n,i)=>{if(!i.target)return n;if(typeof n=="string")if(te.test(n))n=parseFloat(n);else return n;const s=rh(n,i.target.x),l=rh(n,i.target.y);return`${s}% ${l}%`}},_x={correct:(n,{treeScale:i,projectionDelta:s})=>{const l=n,u=yn.parse(n);if(u.length>5)return l;const f=yn.createTransformer(n),d=typeof u[0]!="number"?1:0,h=s.x.scale*i.x,m=s.y.scale*i.y;u[0+d]/=h,u[1+d]/=m;const g=Ce(h,m,.5);return typeof u[2+d]=="number"&&(u[2+d]/=g),typeof u[3+d]=="number"&&(u[3+d]/=g),f(u)}};class Vx extends F.Component{componentDidMount(){const{visualElement:i,layoutGroup:s,switchLayoutGroup:l,layoutId:u}=this.props,{projection:f}=i;l0(zx),f&&(s.group&&s.group.add(f),l&&l.register&&u&&l.register(f),f.root.didUpdate(),f.addEventListener("animationComplete",()=>{this.safeToRemove()}),f.setOptions({...f.options,onExitComplete:()=>this.safeToRemove()})),Us.hasEverUpdated=!0}getSnapshotBeforeUpdate(i){const{layoutDependency:s,visualElement:l,drag:u,isPresent:f}=this.props,d=l.projection;return d&&(d.isPresent=f,u||i.layoutDependency!==s||s===void 0?d.willUpdate():this.safeToRemove(),i.isPresent!==f&&(f?d.promote():d.relegate()||xe.postRender(()=>{const h=d.getStack();(!h||!h.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:i}=this.props.visualElement;i&&(i.root.didUpdate(),Ia.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:i,layoutGroup:s,switchLayoutGroup:l}=this.props,{projection:u}=i;u&&(u.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(u),l&&l.deregister&&l.deregister(u))}safeToRemove(){const{safeToRemove:i}=this.props;i&&i()}render(){return null}}function Jp(n){const[i,s]=zh(),l=F.useContext(La);return v.jsx(Vx,{...n,layoutGroup:l,switchLayoutGroup:F.useContext(Hh),isPresent:i,safeToRemove:s})}const zx={borderRadius:{...oi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:oi,borderTopRightRadius:oi,borderBottomLeftRadius:oi,borderBottomRightRadius:oi,boxShadow:_x};function Fx(n,i,s){const l=Ke(n)?n:yi(n);return l.start(uu("",l,i,s)),l.animation}function Ix(n){return n instanceof SVGElement&&n.tagName!=="svg"}const Ox=(n,i)=>n.depth-i.depth;class Bx{constructor(){this.children=[],this.isDirty=!1}add(i){Ya(this.children,i),this.isDirty=!0}remove(i){Xa(this.children,i),this.isDirty=!0}forEach(i){this.isDirty&&this.children.sort(Ox),this.isDirty=!1,this.children.forEach(i)}}function Ux(n,i){const s=Ft.now(),l=({timestamp:u})=>{const f=u-s;f>=i&&(gn(l),n(f-i))};return xe.read(l,!0),()=>gn(l)}const em=["TopLeft","TopRight","BottomLeft","BottomRight"],$x=em.length,ih=n=>typeof n=="string"?parseFloat(n):n,sh=n=>typeof n=="number"||te.test(n);function Wx(n,i,s,l,u,f){u?(n.opacity=Ce(0,s.opacity!==void 0?s.opacity:1,bx(l)),n.opacityExit=Ce(i.opacity!==void 0?i.opacity:1,0,Hx(l))):f&&(n.opacity=Ce(i.opacity!==void 0?i.opacity:1,s.opacity!==void 0?s.opacity:1,l));for(let d=0;d<$x;d++){const h=`border${em[d]}Radius`;let m=oh(i,h),g=oh(s,h);if(m===void 0&&g===void 0)continue;m||(m=0),g||(g=0),m===0||g===0||sh(m)===sh(g)?(n[h]=Math.max(Ce(ih(m),ih(g),l),0),(zt.test(g)||zt.test(m))&&(n[h]+="%")):n[h]=g}(i.rotate||s.rotate)&&(n.rotate=Ce(i.rotate||0,s.rotate||0,l))}function oh(n,i){return n[i]!==void 0?n[i]:n.borderRadius}const bx=tm(0,.5,yp),Hx=tm(.5,.95,dt);function tm(n,i,s){return l=>l<n?0:l>i?1:s(gr(n,i,l))}function lh(n,i){n.min=i.min,n.max=i.max}function xt(n,i){lh(n.x,i.x),lh(n.y,i.y)}function ah(n,i){n.translate=i.translate,n.scale=i.scale,n.originPoint=i.originPoint,n.origin=i.origin}function uh(n,i,s,l,u){return n-=i,n=Qs(n,1/s,l),u!==void 0&&(n=Qs(n,1/u,l)),n}function Kx(n,i=0,s=1,l=.5,u,f=n,d=n){if(zt.test(i)&&(i=parseFloat(i),i=Ce(d.min,d.max,i/100)-d.min),typeof i!="number")return;let h=Ce(f.min,f.max,l);n===f&&(h-=i),n.min=uh(n.min,i,s,h,u),n.max=uh(n.max,i,s,h,u)}function ch(n,i,[s,l,u],f,d){Kx(n,i[s],i[l],i[u],i.scale,f,d)}const Gx=["x","scaleX","originX"],Qx=["y","scaleY","originY"];function dh(n,i,s,l){ch(n.x,i,Gx,s?s.x:void 0,l?l.x:void 0),ch(n.y,i,Qx,s?s.y:void 0,l?l.y:void 0)}function fh(n){return n.translate===0&&n.scale===1}function nm(n){return fh(n.x)&&fh(n.y)}function hh(n,i){return n.min===i.min&&n.max===i.max}function Yx(n,i){return hh(n.x,i.x)&&hh(n.y,i.y)}function ph(n,i){return Math.round(n.min)===Math.round(i.min)&&Math.round(n.max)===Math.round(i.max)}function rm(n,i){return ph(n.x,i.x)&&ph(n.y,i.y)}function mh(n){return ft(n.x)/ft(n.y)}function gh(n,i){return n.translate===i.translate&&n.scale===i.scale&&n.originPoint===i.originPoint}class Xx{constructor(){this.members=[]}add(i){Ya(this.members,i),i.scheduleRender()}remove(i){if(Xa(this.members,i),i===this.prevLead&&(this.prevLead=void 0),i===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(i){const s=this.members.findIndex(u=>i===u);if(s===0)return!1;let l;for(let u=s;u>=0;u--){const f=this.members[u];if(f.isPresent!==!1){l=f;break}}return l?(this.promote(l),!0):!1}promote(i,s){const l=this.lead;if(i!==l&&(this.prevLead=l,this.lead=i,i.show(),l)){l.instance&&l.scheduleRender(),i.scheduleRender(),i.resumeFrom=l,s&&(i.resumeFrom.preserveOpacity=!0),l.snapshot&&(i.snapshot=l.snapshot,i.snapshot.latestValues=l.animationValues||l.latestValues),i.root&&i.root.isUpdating&&(i.isLayoutDirty=!0);const{crossfade:u}=i.options;u===!1&&l.hide()}}exitAnimationComplete(){this.members.forEach(i=>{const{options:s,resumingFrom:l}=i;s.onExitComplete&&s.onExitComplete(),l&&l.options.onExitComplete&&l.options.onExitComplete()})}scheduleRender(){this.members.forEach(i=>{i.instance&&i.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Zx(n,i,s){let l="";const u=n.x.translate/i.x,f=n.y.translate/i.y,d=(s==null?void 0:s.z)||0;if((u||f||d)&&(l=`translate3d(${u}px, ${f}px, ${d}px) `),(i.x!==1||i.y!==1)&&(l+=`scale(${1/i.x}, ${1/i.y}) `),s){const{transformPerspective:g,rotate:y,rotateX:w,rotateY:k,skewX:R,skewY:A}=s;g&&(l=`perspective(${g}px) ${l}`),y&&(l+=`rotate(${y}deg) `),w&&(l+=`rotateX(${w}deg) `),k&&(l+=`rotateY(${k}deg) `),R&&(l+=`skewX(${R}deg) `),A&&(l+=`skewY(${A}deg) `)}const h=n.x.scale*i.x,m=n.y.scale*i.y;return(h!==1||m!==1)&&(l+=`scale(${h}, ${m})`),l||"none"}const _n={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},ai=typeof window<"u"&&window.MotionDebug!==void 0,da=["","X","Y","Z"],qx={visibility:"hidden"},yh=1e3;let Jx=0;function fa(n,i,s,l){const{latestValues:u}=i;u[n]&&(s[n]=u[n],i.setStaticValue(n,0),l&&(l[n]=0))}function im(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:i}=n.options;if(!i)return;const s=lp(i);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:u,layoutId:f}=n.options;window.MotionCancelOptimisedAnimation(s,"transform",xe,!(u||f))}const{parent:l}=n;l&&!l.hasCheckedOptimisedAppear&&im(l)}function sm({attachResizeListener:n,defaultParent:i,measureScroll:s,checkIsScrollRoot:l,resetTransform:u}){return class{constructor(d={},h=i==null?void 0:i()){this.id=Jx++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,ai&&(_n.totalNodes=_n.resolvedTargetDeltas=_n.recalculatedProjection=0),this.nodes.forEach(n1),this.nodes.forEach(l1),this.nodes.forEach(a1),this.nodes.forEach(r1),ai&&window.MotionDebug.record(_n)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=d,this.root=h?h.root||h:this,this.path=h?[...h.path,h]:[],this.parent=h,this.depth=h?h.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new Bx)}addEventListener(d,h){return this.eventHandlers.has(d)||this.eventHandlers.set(d,new Za),this.eventHandlers.get(d).add(h)}notifyListeners(d,...h){const m=this.eventHandlers.get(d);m&&m.notify(...h)}hasListeners(d){return this.eventHandlers.has(d)}mount(d,h=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Ix(d),this.instance=d;const{layoutId:m,layout:g,visualElement:y}=this.options;if(y&&!y.current&&y.mount(d),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),h&&(g||m)&&(this.isLayoutDirty=!0),n){let w;const k=()=>this.root.updateBlockedByResize=!1;n(d,()=>{this.root.updateBlockedByResize=!0,w&&w(),w=Ux(k,250),Us.hasAnimatedSinceResize&&(Us.hasAnimatedSinceResize=!1,this.nodes.forEach(xh))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&y&&(m||g)&&this.addEventListener("didUpdate",({delta:w,hasLayoutChanged:k,hasRelativeTargetChanged:R,layout:A})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const j=this.options.transition||y.getDefaultTransition()||h1,{onLayoutAnimationStart:M,onLayoutAnimationComplete:D}=y.getProps(),O=!this.targetLayout||!rm(this.targetLayout,A)||R,$=!k&&R;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||$||k&&(O||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(w,$);const Q={...Qa(j,"layout"),onPlay:M,onComplete:D};(y.shouldReduceMotion||this.options.layoutRoot)&&(Q.delay=0,Q.type=!1),this.startAnimation(Q)}else k||xh(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=A})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const d=this.getStack();d&&d.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,gn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(u1),this.animationId++)}getTransformTemplate(){const{visualElement:d}=this.options;return d&&d.getProps().transformTemplate}willUpdate(d=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&im(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let y=0;y<this.path.length;y++){const w=this.path[y];w.shouldResetTransform=!0,w.updateScroll("snapshot"),w.options.layoutRoot&&w.willUpdate(!1)}const{layoutId:h,layout:m}=this.options;if(h===void 0&&!m)return;const g=this.getTransformTemplate();this.prevTransformTemplateValue=g?g(this.latestValues,""):void 0,this.updateSnapshot(),d&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(vh);return}this.isUpdating||this.nodes.forEach(s1),this.isUpdating=!1,this.nodes.forEach(o1),this.nodes.forEach(e1),this.nodes.forEach(t1),this.clearAllSnapshots();const h=Ft.now();Be.delta=Qt(0,1e3/60,h-Be.timestamp),Be.timestamp=h,Be.isProcessing=!0,ra.update.process(Be),ra.preRender.process(Be),ra.render.process(Be),Be.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ia.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(i1),this.sharedNodes.forEach(c1)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,xe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){xe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let m=0;m<this.path.length;m++)this.path[m].updateScroll();const d=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Me(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:h}=this.options;h&&h.notify("LayoutMeasure",this.layout.layoutBox,d?d.layoutBox:void 0)}updateScroll(d="measure"){let h=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===d&&(h=!1),h){const m=l(this.instance);this.scroll={animationId:this.root.animationId,phase:d,isRoot:m,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!u)return;const d=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,h=this.projectionDelta&&!nm(this.projectionDelta),m=this.getTransformTemplate(),g=m?m(this.latestValues,""):void 0,y=g!==this.prevTransformTemplateValue;d&&(h||Ln(this.latestValues)||y)&&(u(this.instance,g),this.shouldResetTransform=!1,this.scheduleRender())}measure(d=!0){const h=this.measurePageBox();let m=this.removeElementScroll(h);return d&&(m=this.removeTransform(m)),p1(m),{animationId:this.root.animationId,measuredBox:h,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:h}=this.options;if(!h)return Me();const m=h.measureViewportBox();if(!(((d=this.scroll)===null||d===void 0?void 0:d.wasRoot)||this.path.some(m1))){const{scroll:y}=this.root;y&&(hr(m.x,y.offset.x),hr(m.y,y.offset.y))}return m}removeElementScroll(d){var h;const m=Me();if(xt(m,d),!((h=this.scroll)===null||h===void 0)&&h.wasRoot)return m;for(let g=0;g<this.path.length;g++){const y=this.path[g],{scroll:w,options:k}=y;y!==this.root&&w&&k.layoutScroll&&(w.wasRoot&&xt(m,d),hr(m.x,w.offset.x),hr(m.y,w.offset.y))}return m}applyTransform(d,h=!1){const m=Me();xt(m,d);for(let g=0;g<this.path.length;g++){const y=this.path[g];!h&&y.options.layoutScroll&&y.scroll&&y!==y.root&&pr(m,{x:-y.scroll.offset.x,y:-y.scroll.offset.y}),Ln(y.latestValues)&&pr(m,y.latestValues)}return Ln(this.latestValues)&&pr(m,this.latestValues),m}removeTransform(d){const h=Me();xt(h,d);for(let m=0;m<this.path.length;m++){const g=this.path[m];if(!g.instance||!Ln(g.latestValues))continue;Ra(g.latestValues)&&g.updateSnapshot();const y=Me(),w=g.measurePageBox();xt(y,w),dh(h,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,y)}return Ln(this.latestValues)&&dh(h,this.latestValues),h}setTargetDelta(d){this.targetDelta=d,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(d){this.options={...this.options,...d,crossfade:d.crossfade!==void 0?d.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Be.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(d=!1){var h;const m=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=m.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=m.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=m.isSharedProjectionDirty);const g=!!this.resumingFrom||this!==m;if(!(d||g&&this.isSharedProjectionDirty||this.isProjectionDirty||!((h=this.parent)===null||h===void 0)&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:w,layoutId:k}=this.options;if(!(!this.layout||!(w||k))){if(this.resolvedRelativeTargetAt=Be.timestamp,!this.targetDelta&&!this.relativeTarget){const R=this.getClosestProjectingParent();R&&R.layout&&this.animationProgress!==1?(this.relativeParent=R,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Me(),this.relativeTargetOrigin=Me(),hi(this.relativeTargetOrigin,this.layout.layoutBox,R.layout.layoutBox),xt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Me(),this.targetWithTransforms=Me()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),vx(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):xt(this.target,this.layout.layoutBox),Xp(this.target,this.targetDelta)):xt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const R=this.getClosestProjectingParent();R&&!!R.resumingFrom==!!this.resumingFrom&&!R.options.layoutScroll&&R.target&&this.animationProgress!==1?(this.relativeParent=R,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Me(),this.relativeTargetOrigin=Me(),hi(this.relativeTargetOrigin,this.target,R.target),xt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}ai&&_n.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Ra(this.parent.latestValues)||Yp(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var d;const h=this.getLead(),m=!!this.resumingFrom||this!==h;let g=!0;if((this.isProjectionDirty||!((d=this.parent)===null||d===void 0)&&d.isProjectionDirty)&&(g=!1),m&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(g=!1),this.resolvedRelativeTargetAt===Be.timestamp&&(g=!1),g)return;const{layout:y,layoutId:w}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(y||w))return;xt(this.layoutCorrected,this.layout.layoutBox);const k=this.treeScale.x,R=this.treeScale.y;jx(this.layoutCorrected,this.treeScale,this.path,m),h.layout&&!h.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(h.target=h.layout.layoutBox,h.targetWithTransforms=Me());const{target:A}=h;if(!A){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ah(this.prevProjectionDelta.x,this.projectionDelta.x),ah(this.prevProjectionDelta.y,this.projectionDelta.y)),fi(this.projectionDelta,this.layoutCorrected,A,this.latestValues),(this.treeScale.x!==k||this.treeScale.y!==R||!gh(this.projectionDelta.x,this.prevProjectionDelta.x)||!gh(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",A)),ai&&_n.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(d=!0){var h;if((h=this.options.visualElement)===null||h===void 0||h.scheduleRender(),d){const m=this.getStack();m&&m.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=fr(),this.projectionDelta=fr(),this.projectionDeltaWithTransform=fr()}setAnimationOrigin(d,h=!1){const m=this.snapshot,g=m?m.latestValues:{},y={...this.latestValues},w=fr();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!h;const k=Me(),R=m?m.source:void 0,A=this.layout?this.layout.source:void 0,j=R!==A,M=this.getStack(),D=!M||M.members.length<=1,O=!!(j&&!D&&this.options.crossfade===!0&&!this.path.some(f1));this.animationProgress=0;let $;this.mixTargetDelta=Q=>{const U=Q/1e3;wh(w.x,d.x,U),wh(w.y,d.y,U),this.setTargetDelta(w),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(hi(k,this.layout.layoutBox,this.relativeParent.layout.layoutBox),d1(this.relativeTarget,this.relativeTargetOrigin,k,U),$&&Yx(this.relativeTarget,$)&&(this.isProjectionDirty=!1),$||($=Me()),xt($,this.relativeTarget)),j&&(this.animationValues=y,Wx(y,g,this.latestValues,U,O,D)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=U},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(d){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(gn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=xe.update(()=>{Us.hasAnimatedSinceResize=!0,this.currentAnimation=Fx(0,yh,{...d,onUpdate:h=>{this.mixTargetDelta(h),d.onUpdate&&d.onUpdate(h)},onComplete:()=>{d.onComplete&&d.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const d=this.getStack();d&&d.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(yh),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const d=this.getLead();let{targetWithTransforms:h,target:m,layout:g,latestValues:y}=d;if(!(!h||!m||!g)){if(this!==d&&this.layout&&g&&om(this.options.animationType,this.layout.layoutBox,g.layoutBox)){m=this.target||Me();const w=ft(this.layout.layoutBox.x);m.x.min=d.target.x.min,m.x.max=m.x.min+w;const k=ft(this.layout.layoutBox.y);m.y.min=d.target.y.min,m.y.max=m.y.min+k}xt(h,m),pr(h,y),fi(this.projectionDeltaWithTransform,this.layoutCorrected,h,y)}}registerSharedNode(d,h){this.sharedNodes.has(d)||this.sharedNodes.set(d,new Xx),this.sharedNodes.get(d).add(h);const g=h.options.initialPromotionConfig;h.promote({transition:g?g.transition:void 0,preserveFollowOpacity:g&&g.shouldPreserveFollowOpacity?g.shouldPreserveFollowOpacity(h):void 0})}isLead(){const d=this.getStack();return d?d.lead===this:!0}getLead(){var d;const{layoutId:h}=this.options;return h?((d=this.getStack())===null||d===void 0?void 0:d.lead)||this:this}getPrevLead(){var d;const{layoutId:h}=this.options;return h?(d=this.getStack())===null||d===void 0?void 0:d.prevLead:void 0}getStack(){const{layoutId:d}=this.options;if(d)return this.root.sharedNodes.get(d)}promote({needsReset:d,transition:h,preserveFollowOpacity:m}={}){const g=this.getStack();g&&g.promote(this,m),d&&(this.projectionDelta=void 0,this.needsReset=!0),h&&this.setOptions({transition:h})}relegate(){const d=this.getStack();return d?d.relegate(this):!1}resetSkewAndRotation(){const{visualElement:d}=this.options;if(!d)return;let h=!1;const{latestValues:m}=d;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(h=!0),!h)return;const g={};m.z&&fa("z",d,g,this.animationValues);for(let y=0;y<da.length;y++)fa(`rotate${da[y]}`,d,g,this.animationValues),fa(`skew${da[y]}`,d,g,this.animationValues);d.render();for(const y in g)d.setStaticValue(y,g[y]),this.animationValues&&(this.animationValues[y]=g[y]);d.scheduleRender()}getProjectionStyles(d){var h,m;if(!this.instance||this.isSVG)return;if(!this.isVisible)return qx;const g={visibility:""},y=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=Os(d==null?void 0:d.pointerEvents)||"",g.transform=y?y(this.latestValues,""):"none",g;const w=this.getLead();if(!this.projectionDelta||!this.layout||!w.target){const j={};return this.options.layoutId&&(j.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,j.pointerEvents=Os(d==null?void 0:d.pointerEvents)||""),this.hasProjected&&!Ln(this.latestValues)&&(j.transform=y?y({},""):"none",this.hasProjected=!1),j}const k=w.animationValues||w.latestValues;this.applyTransformsToTarget(),g.transform=Zx(this.projectionDeltaWithTransform,this.treeScale,k),y&&(g.transform=y(k,g.transform));const{x:R,y:A}=this.projectionDelta;g.transformOrigin=`${R.origin*100}% ${A.origin*100}% 0`,w.animationValues?g.opacity=w===this?(m=(h=k.opacity)!==null&&h!==void 0?h:this.latestValues.opacity)!==null&&m!==void 0?m:1:this.preserveOpacity?this.latestValues.opacity:k.opacityExit:g.opacity=w===this?k.opacity!==void 0?k.opacity:"":k.opacityExit!==void 0?k.opacityExit:0;for(const j in Ws){if(k[j]===void 0)continue;const{correct:M,applyTo:D}=Ws[j],O=g.transform==="none"?k[j]:M(k[j],w);if(D){const $=D.length;for(let Q=0;Q<$;Q++)g[D[Q]]=O}else g[j]=O}return this.options.layoutId&&(g.pointerEvents=w===this?Os(d==null?void 0:d.pointerEvents)||"":"none"),g}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(d=>{var h;return(h=d.currentAnimation)===null||h===void 0?void 0:h.stop()}),this.root.nodes.forEach(vh),this.root.sharedNodes.clear()}}}function e1(n){n.updateLayout()}function t1(n){var i;const s=((i=n.resumeFrom)===null||i===void 0?void 0:i.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&s&&n.hasListeners("didUpdate")){const{layoutBox:l,measuredBox:u}=n.layout,{animationType:f}=n.options,d=s.source!==n.layout.source;f==="size"?wt(w=>{const k=d?s.measuredBox[w]:s.layoutBox[w],R=ft(k);k.min=l[w].min,k.max=k.min+R}):om(f,s.layoutBox,l)&&wt(w=>{const k=d?s.measuredBox[w]:s.layoutBox[w],R=ft(l[w]);k.max=k.min+R,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[w].max=n.relativeTarget[w].min+R)});const h=fr();fi(h,l,s.layoutBox);const m=fr();d?fi(m,n.applyTransform(u,!0),s.measuredBox):fi(m,l,s.layoutBox);const g=!nm(h);let y=!1;if(!n.resumeFrom){const w=n.getClosestProjectingParent();if(w&&!w.resumeFrom){const{snapshot:k,layout:R}=w;if(k&&R){const A=Me();hi(A,s.layoutBox,k.layoutBox);const j=Me();hi(j,l,R.layoutBox),rm(A,j)||(y=!0),w.options.layoutRoot&&(n.relativeTarget=j,n.relativeTargetOrigin=A,n.relativeParent=w)}}}n.notifyListeners("didUpdate",{layout:l,snapshot:s,delta:m,layoutDelta:h,hasLayoutChanged:g,hasRelativeTargetChanged:y})}else if(n.isLead()){const{onExitComplete:l}=n.options;l&&l()}n.options.transition=void 0}function n1(n){ai&&_n.totalNodes++,n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function r1(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function i1(n){n.clearSnapshot()}function vh(n){n.clearMeasurements()}function s1(n){n.isLayoutDirty=!1}function o1(n){const{visualElement:i}=n.options;i&&i.getProps().onBeforeLayoutMeasure&&i.notify("BeforeLayoutMeasure"),n.resetTransform()}function xh(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function l1(n){n.resolveTargetDelta()}function a1(n){n.calcProjection()}function u1(n){n.resetSkewAndRotation()}function c1(n){n.removeLeadSnapshot()}function wh(n,i,s){n.translate=Ce(i.translate,0,s),n.scale=Ce(i.scale,1,s),n.origin=i.origin,n.originPoint=i.originPoint}function Sh(n,i,s,l){n.min=Ce(i.min,s.min,l),n.max=Ce(i.max,s.max,l)}function d1(n,i,s,l){Sh(n.x,i.x,s.x,l),Sh(n.y,i.y,s.y,l)}function f1(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const h1={duration:.45,ease:[.4,0,.1,1]},kh=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),Th=kh("applewebkit/")&&!kh("chrome/")?Math.round:dt;function Ph(n){n.min=Th(n.min),n.max=Th(n.max)}function p1(n){Ph(n.x),Ph(n.y)}function om(n,i,s){return n==="position"||n==="preserve-aspect"&&!yx(mh(i),mh(s),.2)}function m1(n){var i;return n!==n.root&&((i=n.scroll)===null||i===void 0?void 0:i.wasRoot)}const g1=sm({attachResizeListener:(n,i)=>xi(n,"resize",i),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ha={current:void 0},lm=sm({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!ha.current){const n=new g1({});n.mount(window),n.setOptions({layoutScroll:!0}),ha.current=n}return ha.current},resetTransform:(n,i)=>{n.style.transform=i!==void 0?i:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),y1={pan:{Feature:Lx},drag:{Feature:Dx,ProjectionNode:lm,MeasureLayout:Jp}};function v1(n,i,s){var l;if(n instanceof Element)return[n];if(typeof n=="string"){let u=document;const f=(l=void 0)!==null&&l!==void 0?l:u.querySelectorAll(n);return f?Array.from(f):[]}return Array.from(n)}function am(n,i){const s=v1(n),l=new AbortController,u={passive:!0,...i,signal:l.signal};return[s,u,()=>l.abort()]}function Ch(n){return i=>{i.pointerType==="touch"||Wp()||n(i)}}function x1(n,i,s={}){const[l,u,f]=am(n,s),d=Ch(h=>{const{target:m}=h,g=i(h);if(typeof g!="function"||!m)return;const y=Ch(w=>{g(w),m.removeEventListener("pointerleave",y)});m.addEventListener("pointerleave",y,u)});return l.forEach(h=>{h.addEventListener("pointerenter",d,u)}),f}function Eh(n,i,s){const{props:l}=n;n.animationState&&l.whileHover&&n.animationState.setActive("whileHover",s==="Start");const u="onHover"+s,f=l[u];f&&xe.postRender(()=>f(i,Ti(i)))}class w1 extends vn{mount(){const{current:i}=this.node;i&&(this.unmount=x1(i,s=>(Eh(this.node,s,"Start"),l=>Eh(this.node,l,"End"))))}unmount(){}}class S1 extends vn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let i=!1;try{i=this.node.current.matches(":focus-visible")}catch{i=!0}!i||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ki(xi(this.node.current,"focus",()=>this.onFocus()),xi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const um=(n,i)=>i?n===i?!0:um(n,i.parentElement):!1,k1=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function T1(n){return k1.has(n.tagName)||n.tabIndex!==-1}const ui=new WeakSet;function jh(n){return i=>{i.key==="Enter"&&n(i)}}function pa(n,i){n.dispatchEvent(new PointerEvent("pointer"+i,{isPrimary:!0,bubbles:!0}))}const P1=(n,i)=>{const s=n.currentTarget;if(!s)return;const l=jh(()=>{if(ui.has(s))return;pa(s,"down");const u=jh(()=>{pa(s,"up")}),f=()=>pa(s,"cancel");s.addEventListener("keyup",u,i),s.addEventListener("blur",f,i)});s.addEventListener("keydown",l,i),s.addEventListener("blur",()=>s.removeEventListener("keydown",l),i)};function Nh(n){return cu(n)&&!Wp()}function C1(n,i,s={}){const[l,u,f]=am(n,s),d=h=>{const m=h.currentTarget;if(!Nh(h)||ui.has(m))return;ui.add(m);const g=i(h),y=(R,A)=>{window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",k),!(!Nh(R)||!ui.has(m))&&(ui.delete(m),typeof g=="function"&&g(R,{success:A}))},w=R=>{y(R,s.useGlobalTarget||um(m,R.target))},k=R=>{y(R,!1)};window.addEventListener("pointerup",w,u),window.addEventListener("pointercancel",k,u)};return l.forEach(h=>{!T1(h)&&h.getAttribute("tabindex")===null&&(h.tabIndex=0),(s.useGlobalTarget?window:h).addEventListener("pointerdown",d,u),h.addEventListener("focus",g=>P1(g,u),u)}),f}function Rh(n,i,s){const{props:l}=n;n.animationState&&l.whileTap&&n.animationState.setActive("whileTap",s==="Start");const u="onTap"+(s==="End"?"":s),f=l[u];f&&xe.postRender(()=>f(i,Ti(i)))}class E1 extends vn{mount(){const{current:i}=this.node;i&&(this.unmount=C1(i,s=>(Rh(this.node,s,"Start"),(l,{success:u})=>Rh(this.node,l,u?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ma=new WeakMap,ma=new WeakMap,j1=n=>{const i=Ma.get(n.target);i&&i(n)},N1=n=>{n.forEach(j1)};function R1({root:n,...i}){const s=n||document;ma.has(s)||ma.set(s,{});const l=ma.get(s),u=JSON.stringify(i);return l[u]||(l[u]=new IntersectionObserver(N1,{root:n,...i})),l[u]}function A1(n,i,s){const l=R1(i);return Ma.set(n,s),l.observe(n),()=>{Ma.delete(n),l.unobserve(n)}}const M1={some:0,all:1};class D1 extends vn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:i={}}=this.node.getProps(),{root:s,margin:l,amount:u="some",once:f}=i,d={root:s?s.current:void 0,rootMargin:l,threshold:typeof u=="number"?u:M1[u]},h=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,f&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:y,onViewportLeave:w}=this.node.getProps(),k=g?y:w;k&&k(m)};return A1(this.node.current,d,h)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:i,prevProps:s}=this.node;["amount","margin","root"].some(L1(i,s))&&this.startObserver()}unmount(){}}function L1({viewport:n={}},{viewport:i={}}={}){return s=>n[s]!==i[s]}const _1={inView:{Feature:D1},tap:{Feature:E1},focus:{Feature:S1},hover:{Feature:w1}},V1={layout:{ProjectionNode:lm,MeasureLayout:Jp}},Ys={current:null},du={current:!1};function cm(){if(du.current=!0,!!_a)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),i=()=>Ys.current=n.matches;n.addListener(i),i()}else Ys.current=!1}const z1=[...Mp,He,yn],F1=n=>z1.find(Ap(n)),Ah=new WeakMap;function I1(n,i,s){for(const l in i){const u=i[l],f=s[l];if(Ke(u))n.addValue(l,u);else if(Ke(f))n.addValue(l,yi(u,{owner:n}));else if(f!==u)if(n.hasValue(l)){const d=n.getValue(l);d.liveStyle===!0?d.jump(u):d.hasAnimated||d.set(u)}else{const d=n.getStaticValue(l);n.addValue(l,yi(d!==void 0?d:u,{owner:n}))}}for(const l in s)i[l]===void 0&&n.removeValue(l);return i}const Mh=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class O1{scrapeMotionValuesFromProps(i,s,l){return{}}constructor({parent:i,props:s,presenceContext:l,reducedMotionConfig:u,blockInitialAnimation:f,visualState:d},h={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ou,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const R=Ft.now();this.renderScheduledAt<R&&(this.renderScheduledAt=R,xe.render(this.render,!1,!0))};const{latestValues:m,renderState:g,onUpdate:y}=d;this.onUpdate=y,this.latestValues=m,this.baseTarget={...m},this.initialValues=s.initial?{...m}:{},this.renderState=g,this.parent=i,this.props=s,this.presenceContext=l,this.depth=i?i.depth+1:0,this.reducedMotionConfig=u,this.options=h,this.blockInitialAnimation=!!f,this.isControllingVariants=to(s),this.isVariantNode=Wh(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(i&&i.current);const{willChange:w,...k}=this.scrapeMotionValuesFromProps(s,{},this);for(const R in k){const A=k[R];m[R]!==void 0&&Ke(A)&&A.set(m[R],!1)}}mount(i){this.current=i,Ah.set(i,this),this.projection&&!this.projection.instance&&this.projection.mount(i),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,l)=>this.bindToMotionValue(l,s)),du.current||cm(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Ys.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ah.delete(this.current),this.projection&&this.projection.unmount(),gn(this.notifyUpdate),gn(this.render),this.valueSubscriptions.forEach(i=>i()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const i in this.events)this.events[i].clear();for(const i in this.features){const s=this.features[i];s&&(s.unmount(),s.isMounted=!1)}this.current=null}bindToMotionValue(i,s){this.valueSubscriptions.has(i)&&this.valueSubscriptions.get(i)();const l=In.has(i),u=s.on("change",h=>{this.latestValues[i]=h,this.props.onUpdate&&xe.preRender(this.notifyUpdate),l&&this.projection&&(this.projection.isTransformDirty=!0)}),f=s.on("renderRequest",this.scheduleRender);let d;window.MotionCheckAppearSync&&(d=window.MotionCheckAppearSync(this,i,s)),this.valueSubscriptions.set(i,()=>{u(),f(),d&&d(),s.owner&&s.stop()})}sortNodePosition(i){return!this.current||!this.sortInstanceNodePosition||this.type!==i.type?0:this.sortInstanceNodePosition(this.current,i.current)}updateFeatures(){let i="animation";for(i in mr){const s=mr[i];if(!s)continue;const{isEnabled:l,Feature:u}=s;if(!this.features[i]&&u&&l(this.props)&&(this.features[i]=new u(this)),this.features[i]){const f=this.features[i];f.isMounted?f.update():(f.mount(),f.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Me()}getStaticValue(i){return this.latestValues[i]}setStaticValue(i,s){this.latestValues[i]=s}update(i,s){(i.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=i,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let l=0;l<Mh.length;l++){const u=Mh[l];this.propEventSubscriptions[u]&&(this.propEventSubscriptions[u](),delete this.propEventSubscriptions[u]);const f="on"+u,d=i[f];d&&(this.propEventSubscriptions[u]=this.on(u,d))}this.prevMotionValues=I1(this,this.scrapeMotionValuesFromProps(i,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(i){return this.props.variants?this.props.variants[i]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(i){const s=this.getClosestVariantNode();if(s)return s.variantChildren&&s.variantChildren.add(i),()=>s.variantChildren.delete(i)}addValue(i,s){const l=this.values.get(i);s!==l&&(l&&this.removeValue(i),this.bindToMotionValue(i,s),this.values.set(i,s),this.latestValues[i]=s.get())}removeValue(i){this.values.delete(i);const s=this.valueSubscriptions.get(i);s&&(s(),this.valueSubscriptions.delete(i)),delete this.latestValues[i],this.removeValueFromRenderState(i,this.renderState)}hasValue(i){return this.values.has(i)}getValue(i,s){if(this.props.values&&this.props.values[i])return this.props.values[i];let l=this.values.get(i);return l===void 0&&s!==void 0&&(l=yi(s===null?void 0:s,{owner:this}),this.addValue(i,l)),l}readValue(i,s){var l;let u=this.latestValues[i]!==void 0||!this.current?this.latestValues[i]:(l=this.getBaseTargetFromProps(this.props,i))!==null&&l!==void 0?l:this.readValueFromInstance(this.current,i,this.options);return u!=null&&(typeof u=="string"&&(Np(u)||xp(u))?u=parseFloat(u):!F1(u)&&yn.test(s)&&(u=Cp(i,s)),this.setBaseTarget(i,Ke(u)?u.get():u)),Ke(u)?u.get():u}setBaseTarget(i,s){this.baseTarget[i]=s}getBaseTarget(i){var s;const{initial:l}=this.props;let u;if(typeof l=="string"||typeof l=="object"){const d=Ba(this.props,l,(s=this.presenceContext)===null||s===void 0?void 0:s.custom);d&&(u=d[i])}if(l&&u!==void 0)return u;const f=this.getBaseTargetFromProps(this.props,i);return f!==void 0&&!Ke(f)?f:this.initialValues[i]!==void 0&&u===void 0?void 0:this.baseTarget[i]}on(i,s){return this.events[i]||(this.events[i]=new Za),this.events[i].add(s)}notify(i,...s){this.events[i]&&this.events[i].notify(...s)}}class dm extends O1{constructor(){super(...arguments),this.KeyframeResolver=Dp}sortInstanceNodePosition(i,s){return i.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(i,s){return i.style?i.style[s]:void 0}removeValueFromRenderState(i,{vars:s,style:l}){delete s[i],delete l[i]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:i}=this.props;Ke(i)&&(this.childSubscription=i.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}function B1(n){return window.getComputedStyle(n)}class U1 extends dm{constructor(){super(...arguments),this.type="html",this.renderInstance=qh}readValueFromInstance(i,s){if(In.has(s)){const l=su(s);return l&&l.default||0}else{const l=B1(i),u=(Yh(s)?l.getPropertyValue(s):l[s])||0;return typeof u=="string"?u.trim():u}}measureInstanceViewportBox(i,{transformPagePoint:s}){return Zp(i,s)}build(i,s,l){Wa(i,s,l.transformTemplate)}scrapeMotionValuesFromProps(i,s,l){return Ga(i,s,l)}}class $1 extends dm{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Me}getBaseTargetFromProps(i,s){return i[s]}readValueFromInstance(i,s){if(In.has(s)){const l=su(s);return l&&l.default||0}return s=Jh.has(s)?s:Fa(s),i.getAttribute(s)}scrapeMotionValuesFromProps(i,s,l){return np(i,s,l)}build(i,s,l){ba(i,s,this.isSVGTag,l.transformTemplate)}renderInstance(i,s,l,u){ep(i,s,l,u)}mount(i){this.isSVGTag=Ka(i.tagName),super.mount(i)}}const W1=(n,i)=>Oa(n)?new $1(i):new U1(i,{allowProjection:n!==F.Fragment}),b1=g0({...lx,..._1,...y1,...V1},W1),St=My(b1);function fu(){!du.current&&cm();const[n]=F.useState(Ys.current);return n}const H1={check:v.jsx("path",{d:"m5 12 4 4L19 6"}),chevron:v.jsx("path",{d:"m6 9 6 6 6-6"}),clock:v.jsxs(v.Fragment,{children:[v.jsx("circle",{cx:"12",cy:"12",r:"9"}),v.jsx("path",{d:"M12 7v5l3 2"})]}),close:v.jsx("path",{d:"m6 6 12 12M18 6 6 18"}),layers:v.jsxs(v.Fragment,{children:[v.jsx("path",{d:"m12 3 9 5-9 5-9-5 9-5Z"}),v.jsx("path",{d:"m3 12 9 5 9-5M3 16l9 5 9-5"})]}),phone:v.jsxs(v.Fragment,{children:[v.jsx("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2.5"}),v.jsx("path",{d:"M11 18.5h2"})]}),reply:v.jsx("path",{d:"m9 5-6 6 6 6v-4h4a6 6 0 0 1 6 6v-3a6 6 0 0 0-6-6H9V5Z"}),restart:v.jsx(v.Fragment,{children:v.jsx("path",{d:"M3 12a9 9 0 1 1 2.5 6.2M3 4v8h8"})}),send:v.jsx(v.Fragment,{children:v.jsx("path",{d:"m21 3-7 18-3.5-7.5L3 10l18-7ZM21 3 10.5 13.5"})}),terminal:v.jsxs(v.Fragment,{children:[v.jsx("rect",{x:"3",y:"5",width:"18",height:"14",rx:"3"}),v.jsx("path",{d:"m7 9 3 3-3 3m6 0h4"})]}),warning:v.jsxs(v.Fragment,{children:[v.jsx("path",{d:"m10.2 5-7 12a2 2 0 0 0 1.7 3h14.2a2 2 0 0 0 1.7-3l-7-12a2 2 0 0 0-3.6 0Z"}),v.jsx("path",{d:"M12 9v4m0 3h.01"})]})};function ke({name:n,...i}){return v.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.65",strokeLinecap:"round",strokeLinejoin:"round",...i,children:H1[n]})}function K1({mode:n,connected:i,sessions:s,showPhone:l,onTogglePhone:u,onRestart:f}){const d=[{label:"Running",count:s.filter(h=>h.status==="running").length,dot:"bg-emerald-400",text:"text-emerald-300"},{label:"Waiting",count:s.filter(h=>h.status.startsWith("waiting_")).length,dot:"bg-amber-400",text:"text-amber-300"},{label:"Done",count:s.filter(h=>h.status==="done").length,dot:"bg-violet-400",text:"text-violet-300"}];return v.jsx("header",{className:"deck-header",children:v.jsxs("div",{className:"deck-header-inner",children:[v.jsxs("div",{className:"flex items-center gap-2.5",children:[v.jsxs("span",{"aria-hidden":"true",className:"brand-mark",children:[v.jsx("i",{}),v.jsx("i",{}),v.jsx("i",{}),v.jsx("i",{})]}),v.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"AgentMast"})]}),v.jsx("ul",{className:"status-strip","aria-label":"Session status counts",children:d.map(h=>v.jsxs("li",{className:"flex items-center gap-2 whitespace-nowrap px-2.5 py-1.5 text-xs text-zinc-300 sm:px-3.5",children:[h.label==="Done"?v.jsx(ke,{name:"check",className:"size-3.5 text-violet-300"}):v.jsx("span",{"aria-hidden":"true",className:`size-1.5 rounded-full ${h.dot}`}),v.jsx("span",{className:`tabular font-mono font-semibold ${h.text}`,children:h.count})," ",h.label]},h.label))}),v.jsxs("div",{className:"header-controls flex min-w-0 flex-wrap items-center justify-end gap-2.5",children:[v.jsx("span",{className:`rounded-md border px-2 py-1 font-mono text-[10px] font-semibold uppercase tracking-wider ${n==="demo"?"border-amber-400/25 bg-amber-400/10 text-amber-200":"border-emerald-400/25 bg-emerald-400/10 text-emerald-200"}`,children:n}),v.jsxs("span",{role:"status",className:"flex items-center gap-1.5 text-xs text-zinc-300",children:[v.jsx("span",{className:`size-1.5 rounded-full ${i?"bg-emerald-400":"bg-zinc-500"}`,"aria-hidden":"true"}),i?"Connected":"Offline"]}),n==="demo"&&v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsxs("button",{type:"button",className:"deck-button","aria-label":"Toggle phone preview","aria-pressed":l,"aria-keyshortcuts":"P",onClick:u,children:[v.jsx(ke,{name:"phone",className:`size-3.5 ${l?"text-sky-300":""}`})," ",v.jsx("kbd",{children:"P"})]}),v.jsxs("button",{type:"button",className:"deck-button","aria-label":"Restart demo","aria-keyshortcuts":"R",onClick:f,disabled:!i,children:[v.jsx(ke,{name:"restart",className:"size-3.5"})," ",v.jsx("kbd",{children:"R"})]})]})]})]})})}const ga=["input","output","cacheRead","cacheCreation"],fm=2e3,hm=n=>n>=1e6?`${(n/1e6).toFixed(2)}M`:n>=1e3?`${(n/1e3).toFixed(1)}k`:String(Math.round(n)),Dh=n=>{const i=Math.max(0,Math.floor(n/1e3)),s=Math.floor(i/60);return s>0?`${s}m ${String(i%60).padStart(2,"0")}s`:`${i}s`},G1={running:{label:"Running",dot:"bg-emerald-400",text:"text-emerald-300",border:"border-emerald-500/30",glow:"shadow-emerald-500/10"},waiting_approval:{label:"Waiting Approval",dot:"bg-amber-400",text:"text-amber-300",border:"border-amber-400/70",glow:"shadow-amber-500/25"},waiting_input:{label:"Waiting Input",dot:"bg-sky-400",text:"text-sky-300",border:"border-sky-500/40",glow:"shadow-sky-500/10"},idle:{label:"Idle",dot:"bg-zinc-500",text:"text-zinc-400",border:"border-zinc-700",glow:"shadow-black/0"},done:{label:"Done",dot:"bg-violet-400",text:"text-violet-300",border:"border-violet-500/30",glow:"shadow-violet-500/10"},waiting_terminal:{label:"Waiting Terminal",dot:"bg-orange-400",text:"text-orange-300",border:"border-orange-500/40",glow:"shadow-orange-500/10"}},pm={unrated:"bg-zinc-700 text-zinc-200",low:"bg-zinc-700 text-zinc-200",medium:"bg-amber-500/20 text-amber-300 ring-1 ring-amber-500/40",high:"bg-red-500/20 text-red-300 ring-1 ring-red-500/50"},Xs={"claude-code":"Claude Code",codex:"Codex",zcode:"ZCode",antigravity:"Antigravity",generic:"CLI"};function Q1({approval:n,decision:i}){if(!i)return;if(i.by==="timeout")return{label:"Timed out · Return to terminal",style:"text-amber-200"};if(i.by==="session_end")return{label:"Session ended",style:"text-zinc-300"};if(i.by==="cancelled")return{label:"Cancelled",style:"text-zinc-300"};if(i.action==="defer")return{label:"Continue in Codex",style:"text-zinc-300"};const s={approve:"Approved",reject:"Rejected",reply:"Reply sent"}[i.action],l=i.by==="telegram"?" · via Telegram":i.by==="web"?" · via Web":"",u=i.resolvedAt===void 0?"":` · ${(Math.max(0,i.resolvedAt-n.createdAt)/1e3).toFixed(1)}s`;return{label:s+u+l,style:i.action==="reject"?"text-zinc-300":"text-emerald-200"}}function Y1({text:n,durationMs:i}){const s=fu(),[l,u]=F.useState(0),f=Array.from(n),d=f.length;return F.useEffect(()=>{if(s||!d)return;const h=performance.now();let m=0;function g(y){const w=Math.min(1,(y-h)/i);u(Math.ceil(w*d)),w<1&&(m=requestAnimationFrame(g))}return m=requestAnimationFrame(g),()=>cancelAnimationFrame(m)},[i,d,s]),v.jsxs("p",{className:"phone-input min-h-10","aria-label":n,children:[s?n:f.slice(0,l).join(""),v.jsx("span",{"aria-hidden":"true",className:"phone-caret"})]})}function X1({messages:n,replayReply:i,connected:s,onDecide:l}){const[u,f]=F.useState(),d=F.useRef(null),h=F.useRef(null),m=u&&n.find(A=>A.approval.id===u.approvalId&&!A.decision),g=i&&n.find(A=>A.approval.id===i.approvalId&&!A.decision),y=m??g,w=y==null?void 0:y.approval.id,k=n.filter(A=>!A.decision).length;F.useEffect(()=>{u&&!m&&f(void 0)},[u,m]),F.useLayoutEffect(()=>{var A;m&&((A=h.current)==null||A.focus({preventScroll:!0}))},[m==null?void 0:m.approval.id]),F.useLayoutEffect(()=>{if(d.current)if(w){const A=Array.from(d.current.children).find(M=>M.getAttribute("data-approval-id")===w),j=d.current.getBoundingClientRect();if(A){const M=A.getBoundingClientRect();M.top<j.top?d.current.scrollTop+=M.top-j.top-12:M.bottom>j.bottom&&(d.current.scrollTop+=M.bottom-j.bottom+12)}}else d.current.scrollTop=d.current.scrollHeight},[n,w]);function R(A){A.preventDefault();const j=u==null?void 0:u.text.trim();m&&j&&s&&l(m.approval.id,"reply",j)}return v.jsxs("section",{"aria-labelledby":"phone-title",className:"phone-panel panel rounded-2xl px-4 pt-4 sm:px-5 xl:px-6",children:[v.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(ke,{name:"phone",className:"size-4 text-sky-300"}),v.jsx("h2",{id:"phone-title",className:"section-title",children:"Telegram preview"})]}),v.jsx("span",{className:"rounded-md border border-sky-400/20 bg-sky-400/10 px-2 py-1 font-mono text-[10px] font-medium uppercase tracking-wider text-sky-200",children:"Simulated"})]}),v.jsx("div",{className:"phone-frame",children:v.jsxs("div",{className:"phone-screen",children:[v.jsx("div",{className:"phone-hardware","aria-hidden":"true",children:v.jsx("span",{})}),v.jsxs("div",{className:"phone-chat-header",children:[v.jsx("span",{className:"grid size-9 shrink-0 place-items-center rounded-full bg-sky-500 text-white",children:v.jsx(ke,{name:"send",className:"size-4.5"})}),v.jsxs("div",{className:"min-w-0",children:[v.jsx("p",{className:"truncate text-sm font-semibold text-slate-50",children:"AgentMast Bot"}),v.jsx("p",{className:"text-[11px] text-sky-200/80",children:k?`${k} pending ${k===1?"approval":"approvals"}`:"Telegram bot"})]})]}),v.jsxs("ol",{ref:d,className:"phone-feed","aria-label":"Approval messages",children:[!n.length&&v.jsx("li",{className:"m-auto max-w-52 rounded-xl bg-slate-950/55 px-3 py-2 text-center text-xs leading-relaxed text-slate-200",children:"Approval requests will appear in this chat."}),v.jsx(Fn,{initial:!1,children:n.map(A=>{const{approval:j,sessionTitle:M,decision:D}=A,O=Q1(A);return v.jsxs(St.li,{"data-approval-id":j.id,initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0},transition:{duration:.2},children:[v.jsxs("div",{className:"phone-bubble",children:[v.jsxs("div",{className:"flex items-center justify-between gap-2",children:[v.jsx("p",{className:"truncate text-xs font-semibold text-sky-200",title:M,children:M}),v.jsx("span",{className:`shrink-0 rounded px-1.5 py-0.5 font-mono text-[9px] font-semibold uppercase ${pm[j.risk]}`,children:j.risk})]}),v.jsx("p",{className:"mt-1 text-sm font-medium text-slate-100",children:j.summary}),v.jsx("code",{className:"mt-1 block break-all font-mono text-[11px] text-slate-300",children:j.detail.command??j.detail.filePath??j.detail.tool}),O&&v.jsxs(St.p,{initial:{opacity:0},animate:{opacity:1},className:`mt-2 flex items-center gap-1.5 border-t border-slate-600/60 pt-2 text-[11px] font-medium ${O.style}`,children:[v.jsx(ke,{name:(D==null?void 0:D.action)==="approve"?"check":(D==null?void 0:D.action)==="reply"?"reply":(D==null?void 0:D.by)==="timeout"?"clock":"close",className:"size-3.5 shrink-0"}),O.label]})]}),!D&&v.jsxs("div",{className:"phone-actions",children:[v.jsxs("button",{type:"button",disabled:!s,onClick:()=>l(j.id,"approve"),children:[v.jsx(ke,{name:"check",className:"size-3.5"}),"Approve"]}),v.jsx("button",{type:"button",disabled:!s,onClick:()=>l(j.id,"reject"),children:"Reject"}),v.jsxs("button",{type:"button",disabled:!s,"aria-expanded":w===j.id,onClick:()=>f($=>($==null?void 0:$.approvalId)===j.id?void 0:{approvalId:j.id,text:""}),children:[v.jsx(ke,{name:"reply",className:"size-3.5"}),"Reply"]})]}),(D==null?void 0:D.action)==="reply"&&D.text&&v.jsxs("p",{className:"phone-outgoing",children:[D.text," ",v.jsx(ke,{name:"check",className:"ml-1 inline size-3.5 text-sky-200"})]})]},j.id)})})]}),v.jsx(Fn,{initial:!1,children:y&&v.jsxs(St.form,{className:"phone-composer",initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:8},transition:{duration:.18},onSubmit:R,children:[v.jsxs("div",{className:"mb-2 flex items-center gap-2 text-xs text-sky-200",children:[v.jsx(ke,{name:"reply",className:"size-3.5 shrink-0"}),v.jsxs("span",{className:"truncate",children:["Replying to ",v.jsx("strong",{children:y.sessionTitle})]}),m&&v.jsx("button",{type:"button","aria-label":"Cancel reply",className:"ml-auto rounded p-0.5 text-slate-300 hover:text-white",onClick:()=>f(void 0),children:v.jsx(ke,{name:"close",className:"size-4"})})]}),v.jsxs("div",{className:"flex items-end gap-2",children:[m?v.jsx("textarea",{ref:h,rows:2,maxLength:fm,"aria-label":"Telegram reply",placeholder:"Write a reply…",className:"phone-input resize-none",value:(u==null?void 0:u.text)??"",onChange:A=>f({approvalId:m.approval.id,text:A.target.value})}):i&&v.jsx(Y1,{text:i.text,durationMs:i.durationMs},i.approvalId),v.jsx("button",{type:"submit","aria-label":"Send Telegram reply",disabled:!m||!s||!(u!=null&&u.text.trim()),className:"grid size-9 shrink-0 place-items-center rounded-full bg-sky-400 text-slate-950 hover:bg-sky-300 disabled:opacity-55",children:v.jsx(ke,{name:"send",className:"size-4.5"})})]})]},w)}),v.jsx("div",{className:"phone-home","aria-hidden":"true",children:v.jsx("span",{})})]})})]})}function Lh({approval:n,connected:i,onDecide:s}){const[l,u]=F.useState(!1),[f,d]=F.useState(""),h=n.origin?Xs[n.origin]:void 0,m=n.detail.command??n.detail.filePath??n.detail.tool;return v.jsxs("div",{className:"rounded-xl border border-amber-500/25 bg-amber-400/[0.045] p-3.5",children:[v.jsxs("div",{className:"flex items-start gap-2.5",children:[v.jsx("span",{className:`mt-0.5 shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold uppercase ${pm[n.risk]}`,children:h?"Native":n.risk}),v.jsx("p",{className:"min-w-0 break-words text-sm font-medium text-amber-100",children:n.summary})]}),n.detail.description&&v.jsx("p",{className:"mt-2 break-words text-xs text-zinc-300",children:n.detail.description}),v.jsx("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono text-xs leading-5 text-zinc-300",children:v.jsx("code",{children:n.detail.diffPreview&&h?n.detail.diffPreview:m})}),n.detail.context&&v.jsxs("details",{className:"mt-2 rounded-md border border-zinc-700/70 px-2.5 py-1.5 text-xs text-zinc-300",children:[v.jsx("summary",{className:"cursor-pointer",children:n.detail.command||n.detail.diffPreview?"Additional request details":"Tool arguments"}),v.jsx("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono",children:n.detail.context})]}),v.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[v.jsx("button",{type:"button",disabled:!i,className:"deck-button deck-button-approve",onClick:()=>s(n.id,"approve"),children:"Approve"}),v.jsx("button",{type:"button",disabled:!i,className:"deck-button",onClick:()=>s(n.id,"reject"),children:"Reject"}),v.jsxs("button",{type:"button",disabled:!i,className:"deck-button","aria-expanded":l,onClick:()=>u(g=>!g),children:[v.jsx(ke,{name:"reply",className:"size-3.5"})," Reply"]}),h&&v.jsxs("button",{type:"button",disabled:!i,className:"deck-button",onClick:()=>s(n.id,"defer"),children:["Use ",h]})]}),l&&v.jsxs("form",{className:"mt-3 flex flex-wrap items-end gap-2",onSubmit:g=>{g.preventDefault();const y=f.trim();y&&i&&s(n.id,"reply",y)},children:[v.jsx("textarea",{autoFocus:!0,rows:2,maxLength:fm,"aria-label":"Reply to agent",placeholder:h?`Decline and tell ${h} what to change`:"Tell the agent what to change",value:f,onChange:g=>d(g.target.value),className:"min-w-36 grow rounded-lg border border-zinc-700 bg-zinc-950 p-2 text-sm text-zinc-100 placeholder:text-zinc-400"}),v.jsx("button",{disabled:!i||!f.trim(),className:"deck-button deck-button-approve",children:"Send reply"})]})]})}function Z1({approvals:n,connected:i,onDecide:s}){const[l,u]=F.useState(!1),f=F.useId(),[d,...h]=n;return d?v.jsxs("div",{className:"mt-4",children:[v.jsx(Lh,{approval:d,connected:i,onDecide:s},d.id),h.length>0&&v.jsxs(v.Fragment,{children:[v.jsxs("button",{type:"button","aria-expanded":l,"aria-controls":f,className:"approval-stack",onClick:()=>u(m=>!m),children:[v.jsx(ke,{name:"layers",className:"size-4"}),v.jsx("span",{children:l?"Show only the first approval":`+${h.length} more ${h.length===1?"approval":"approvals"}`}),v.jsx(ke,{name:"chevron",className:`ml-auto size-4 transition-transform ${l?"rotate-180":""}`})]}),v.jsx("div",{id:f,hidden:!l,className:"mt-2.5 space-y-2.5",children:l&&h.map(m=>v.jsx(Lh,{approval:m,connected:i,onDecide:s},m.id))})]})]}):null}const q1={input:"Input",output:"Output",cacheRead:"Cache read",cacheCreation:"Cache write"};function J1({session:n,approvals:i,connected:s,now:l,onDecide:u}){const f=G1[n.status],d=fu(),h=n.status==="waiting_approval",m=n.status==="waiting_terminal",g=(n.status==="running"||n.status.startsWith("waiting_"))&&l-n.lastEventAt>10*6e4,y=ga.some(R=>n.tokens[R]!==void 0),w=ga.reduce((R,A)=>R+(n.tokens[A]??0),0),k=(n.status==="done"?n.lastEventAt:l)-n.startedAt;return v.jsxs(St.article,{layout:"position",initial:{opacity:0,y:12},animate:h&&!g&&!d?{opacity:1,y:0,x:[0,-5,5,-3,3,0]}:{opacity:1,y:0,x:0},transition:{duration:.45},className:`session-card relative flex min-w-0 flex-col rounded-2xl border p-4 sm:p-5 xl:p-6 ${f.border} ${f.glow} ${h&&!g?"ring-pulse":""}`,children:[v.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-start gap-3",children:[v.jsxs("div",{className:"min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2.5",children:[v.jsx("span",{className:"shrink-0 rounded-md border border-zinc-700/70 bg-zinc-800/75 px-2 py-1 font-mono text-[10px] font-semibold uppercase tracking-wider text-zinc-300",children:Xs[n.kind]}),v.jsx("span",{className:"truncate font-mono text-xs text-zinc-400",title:n.cwd,children:n.cwd})]}),v.jsx("h3",{className:"mt-2.5 break-words text-lg font-semibold tracking-tight xl:text-[22px]",children:n.title})]}),v.jsxs(St.div,{initial:{scale:.85,opacity:0},animate:{scale:1,opacity:1},className:`flex shrink-0 items-center gap-2 rounded-full border border-current/20 bg-zinc-900/75 px-2.5 py-1.5 text-xs font-medium ${f.text}`,children:[n.status==="done"?v.jsx(ke,{name:"check",className:"size-3.5"}):v.jsx("span",{className:`size-1.5 rounded-full ${f.dot} ${!g&&(n.status==="running"||h)?"breathe":""}`}),f.label,h&&i.length>1?` · ${i.length}`:""]},n.status)]}),v.jsx("div",{className:"relative mt-4 h-10 overflow-hidden rounded-lg border border-zinc-800/90 bg-black/35 px-3 font-mono text-[12px] leading-[38px] text-zinc-300",title:n.lastAction,children:v.jsx(Fn,{mode:"popLayout",initial:!1,children:v.jsxs(St.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},exit:{y:-20,opacity:0},transition:{duration:.25},className:"truncate",children:[v.jsx("span",{className:`mr-1.5 ${f.text}`,children:"›"}),n.lastAction??"Waiting for activity"]},n.lastAction??"none")})}),v.jsx(Fn,{initial:!1,children:h&&i.length>0&&v.jsx(St.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0},transition:{duration:.18},children:v.jsx(Z1,{approvals:i,connected:s,onDecide:u})},"approvals")}),m&&v.jsxs("div",{className:"mt-4 flex items-start gap-2.5 rounded-xl border border-orange-500/25 bg-orange-400/5 px-3.5 py-3 text-sm text-orange-200",children:[v.jsx(ke,{name:"terminal",className:"mt-0.5 size-4 shrink-0 text-orange-300"}),v.jsxs("p",{children:["Respond to the permission prompt ",n.kind==="codex"||n.kind==="zcode"?`in ${Xs[n.kind]}`:"in your terminal","."]})]}),v.jsx("div",{className:"mt-auto pt-4",children:v.jsxs("div",{className:"flex flex-wrap items-start gap-x-3 gap-y-2 border-t border-zinc-800/80 pt-3 text-xs text-zinc-400",children:[v.jsxs("span",{className:"tabular inline-flex items-center gap-1.5 font-mono",title:"Session duration",children:[v.jsx(ke,{name:"clock",className:"size-3.5"})," ",Dh(k)]}),g&&v.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-orange-500/25 bg-orange-400/10 px-1.5 py-0.5 text-orange-200",title:`No events for ${Dh(l-n.lastEventAt)}`,children:[v.jsx(ke,{name:"warning",className:"size-3.5"})," Stale ",v.jsx("span",{className:"sr-only",children:"No events for more than 10 minutes"})]}),y?v.jsxs("details",{className:"ml-auto font-mono",children:[v.jsxs("summary",{className:"tabular ml-auto w-fit cursor-pointer rounded px-1 focus-visible:outline-2 focus-visible:outline-emerald-400",children:[v.jsx("span",{className:"text-zinc-200",children:hm(w)})," tokens"]}),v.jsx("dl",{className:"tabular mt-2 grid min-w-40 grid-cols-[1fr_auto] gap-x-3 gap-y-1 rounded-lg border border-zinc-700 bg-zinc-900 p-3",children:ga.map(R=>{var A;return v.jsxs("div",{className:"contents",children:[v.jsx("dt",{children:q1[R]}),v.jsx("dd",{className:"text-right text-zinc-200",children:((A=n.tokens[R])==null?void 0:A.toLocaleString("en-US"))??"—"})]},R)})})]}):v.jsx("span",{className:"ml-auto font-mono",children:"Token usage unavailable"})]})})]})}const ew={success:{icon:"check",color:"text-emerald-300 border-emerald-400/25 bg-emerald-400/10"},warning:{icon:"warning",color:"text-amber-200 border-amber-400/25 bg-amber-400/10"},info:{icon:"terminal",color:"text-sky-200 border-sky-400/25 bg-sky-400/10"}};function tw({toast:n,dismiss:i}){const[s,l]=F.useState(!1),[u,f]=F.useState(!1),d=ew[n.tone];return F.useEffect(()=>{if(s||u)return;const h=window.setTimeout(()=>i(n.id),4500);return()=>window.clearTimeout(h)},[n.id,i,s,u]),v.jsxs(St.div,{layout:"position",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:6},onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onFocus:()=>f(!0),onBlur:()=>f(!1),className:"pointer-events-auto flex items-center gap-3 rounded-xl border border-zinc-700 bg-zinc-900 p-3 shadow-xl shadow-black/40",children:[v.jsx("span",{className:`grid size-8 shrink-0 place-items-center rounded-lg border ${d.color}`,children:v.jsx(ke,{name:d.icon,className:"size-4"})}),v.jsx("p",{className:"min-w-0 break-words text-sm text-zinc-100",children:n.text}),v.jsx("button",{type:"button","aria-label":"Dismiss notification",onClick:()=>i(n.id),className:"ml-auto shrink-0 rounded-md p-1 text-zinc-400 hover:bg-zinc-800 hover:text-white",children:v.jsx(ke,{name:"close",className:"size-4"})})]})}function nw({toasts:n,onDismiss:i}){return v.jsx("div",{role:"status","aria-atomic":"false","aria-relevant":"additions",className:"pointer-events-none fixed inset-x-4 bottom-4 z-20 flex flex-col gap-2 sm:right-auto sm:bottom-6 sm:left-6 sm:w-[360px]",children:v.jsx(Fn,{initial:!1,children:n.map(s=>v.jsx(tw,{toast:s,dismiss:i},s.id))})})}function rw(n,i){if(n.length===0)return 0;if(i<=n[0].t)return n[0].cumulative;for(let s=1;s<n.length;s++){const l=n[s-1],u=n[s];if(i<=u.t)return l.cumulative+(u.cumulative-l.cumulative)*(i-l.t)/(u.t-l.t||1)}return n[n.length-1].cumulative}const _h=["from-rose-500 to-orange-400","from-emerald-500 to-teal-300","from-sky-500 to-indigo-400"],iw=[["input","Input"],["output","Output"],["cacheRead","Cache read"],["cacheCreation","Cache creation"]],sw=n=>`$${n.toFixed(n>0&&n<.01?4:2)}`;function ow({dataset:n,t:i}){var j,M,D;const[s,l]=F.useState(!1),u=F.useId(),f=fu(),d=(n==null?void 0:n.metric)==="cost_usd",h=O=>d?sw(O):hm(O),m=Math.max(0,...(n==null?void 0:n.variants.map(O=>{var $;return(($=O.samples.at(-1))==null?void 0:$.t)??0}))??[]),g=i??m,y=g>=m-1e-6,w=((M=(j=n==null?void 0:n.variants[0])==null?void 0:j.samples.at(-1))==null?void 0:M.cumulative)??0,k=n==null?void 0:n.variants.at(-1),R=(D=k==null?void 0:k.samples.at(-1))==null?void 0:D.cumulative,A=w>0&&R!==void 0?1-R/w:0;return v.jsxs("section",{"aria-labelledby":"race-title",className:"panel rounded-2xl p-4 sm:p-5 xl:p-6",children:[v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2.5",children:[v.jsx("h2",{id:"race-title",className:"section-title",children:"Token Race"}),n&&v.jsxs("span",{className:`rounded-md border px-2 py-1 font-mono text-[11px] font-medium ${n.measured?"border-emerald-500/25 bg-emerald-500/10 text-emerald-300":"border-zinc-700 bg-zinc-800/70 text-zinc-300"}`,title:n.measured?"Recorded from benchmark runs":"Illustrative replay data",children:[n.measured?"measured":"simulated"," · ",d?"cost":"tokens"]})]}),n!=null&&n.variants.length?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"mt-3",children:[v.jsx("h3",{className:"text-base font-semibold leading-snug text-zinc-100",children:n.task}),v.jsxs("p",{className:"mt-1 font-mono text-xs text-zinc-400",children:[n.model," ",v.jsx("span",{"aria-hidden":"true",children:"·"})," ",d?"USD":"Context tokens"]})]}),v.jsx("div",{className:"mt-4 space-y-3.5",children:n.variants.map((O,$)=>{const Q=rw(O.samples,g),U=n.limitBudget>0?Q/n.limitBudget:0,X=U>=.8,re=X&&!y&&!f;return v.jsxs("div",{children:[v.jsxs("div",{className:"mb-1.5 flex items-baseline justify-between gap-2",children:[v.jsx("span",{className:"text-sm font-medium text-zinc-200",children:O.label}),v.jsx("span",{className:`tabular shrink-0 font-mono text-xl font-semibold leading-none ${X?"text-rose-300":"text-zinc-100"}`,children:h(Q)})]}),v.jsxs(St.div,{animate:re?{x:[0,-2,2,0]}:{x:0},transition:{repeat:re?1/0:0,duration:.25},className:"relative h-2.5 overflow-hidden rounded-full bg-zinc-800","aria-hidden":"true",children:[v.jsx("div",{className:`h-full rounded-full bg-gradient-to-r ${_h[$%_h.length]} transition-[width] duration-100 ease-linear`,style:{width:`${Math.max(0,Math.min(1,U))*100}%`}}),v.jsx("div",{className:"absolute inset-y-0 left-[80%] w-px bg-rose-300/65"})]}),v.jsxs("div",{className:"mt-1 flex flex-wrap items-center justify-between gap-x-3 text-[11px] text-zinc-400",children:[v.jsxs("span",{className:"tabular font-mono",children:[Math.round(U*100),"% of illustrative budget"]}),X&&v.jsxs("span",{className:"inline-flex items-center gap-1 text-rose-300",children:[v.jsx(ke,{name:"warning",className:"size-3"})," ",U>1?"Over budget":"Near budget"]})]})]},O.id)})}),v.jsxs("div",{className:`relative mt-4 flex min-h-14 flex-wrap items-center justify-between gap-x-3 gap-y-2 rounded-xl border px-3.5 py-2 transition-colors ${y&&A>0?"border-emerald-400/20 bg-emerald-400/[.06]":"border-zinc-800/90 bg-zinc-950/35"}`,children:[v.jsx(Fn,{mode:"popLayout",initial:!1,children:y&&A>0&&n.variants.length>1?v.jsxs(St.p,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0},className:"flex flex-wrap items-baseline gap-x-2 text-xs text-emerald-200",children:[v.jsxs("strong",{className:"tabular font-mono text-3xl leading-none font-semibold tracking-tight text-emerald-300",children:["−",Math.round(A*100),"%"]}),v.jsxs("span",{children:[n.variants.length>2&&`${k==null?void 0:k.label} · `,d?"cost vs baseline":"context tokens vs baseline"]})]},"saving"):v.jsxs(St.p,{exit:{opacity:0},className:"text-xs text-zinc-400",children:["Illustrative budget ",v.jsx("span",{className:"tabular font-mono text-zinc-200",children:h(n.limitBudget)})]},"budget")}),v.jsxs("button",{type:"button","aria-expanded":s,"aria-controls":u,onClick:()=>l(O=>!O),className:"deck-button ml-auto shrink-0",children:["Token breakdown ",v.jsx(ke,{name:"chevron",className:`size-3.5 transition-transform ${s?"rotate-180":""}`})]})]}),v.jsxs("div",{id:u,hidden:!s,className:"mt-3 space-y-2.5",children:[v.jsx("p",{className:"text-xs text-zinc-400",children:"Token totals for completed runs"}),n.variants.map(O=>v.jsxs("div",{className:"rounded-xl border border-zinc-800 bg-zinc-950/35 p-3",children:[v.jsx("h4",{className:"text-xs font-semibold text-zinc-200",children:O.label}),v.jsx("dl",{className:"mt-2 grid grid-cols-2 gap-x-3 gap-y-2 min-[480px]:grid-cols-4",children:iw.map(([$,Q])=>{var U,X;return v.jsxs("div",{children:[v.jsx("dt",{className:"text-[11px] text-zinc-400",children:Q}),v.jsx("dd",{className:"tabular mt-0.5 font-mono text-xs text-zinc-200",children:((X=(U=O.totals)==null?void 0:U[$])==null?void 0:X.toLocaleString("en-US"))??"—"})]},$)})})]},O.id))]})]}):v.jsxs("div",{className:"mt-4 rounded-xl border border-dashed border-zinc-700 bg-zinc-950/35 p-5",children:[v.jsx("p",{className:"text-sm font-medium text-zinc-200",children:"No benchmark data"}),v.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:"Load a benchmark dataset to compare usage across runs."})]})]})}function lw(n,i,s){const{action:l,by:u}=n;if(u==="session_end")return;if(u==="cancelled")return{tone:"info",text:`${i} · Approval cancelled`};const f=s?Xs[s]:"the terminal";if(u==="timeout")return{tone:"warning",text:`${i} · Approval timed out. Continue in ${f}.`};if(l==="defer")return{tone:"info",text:`${i} · Continue in ${f}`};const d={approve:"Approved",reject:"Rejected",reply:"Reply sent"}[l];return{tone:l==="reject"?"info":"success",text:`${i} · ${d}${u==="telegram"?" · via Telegram":u==="web"?" · via Web":""}`}}const aw={connected:!1,mode:"live",sessions:{},order:[],approvals:{},datasets:{},raceT:{},toasts:[],toastSequence:0,phone:[]};function Vh(n,i){if(!i)return{toasts:n.toasts,toastSequence:n.toastSequence};const s=n.toastSequence+1;return{toasts:[...n.toasts.slice(-2),{id:s,...i}],toastSequence:s}}function uw(n,i){var l,u,f;if(i.type==="connected")return{...n,connected:i.value};if(i.type==="dismiss_toast")return{...n,toasts:n.toasts.filter(d=>d.id!==i.id)};const s=i.msg;switch(s.type){case"snapshot":{const d=Object.fromEntries(s.sessions.map(h=>[h.id,h]));return{...n,mode:s.mode,sessions:d,order:s.sessions.map(h=>h.id),approvals:Object.fromEntries(s.approvals.map(h=>[h.id,h])),phone:s.approvals.map(h=>{var m;return{approval:h,sessionTitle:((m=d[h.sessionId])==null?void 0:m.title)??h.sessionId}}),demoReply:void 0,toasts:[]}}case"session_update":{const d=s.session;return{...n,sessions:{...n.sessions,[d.id]:d},order:n.order.includes(d.id)?n.order:[...n.order,d.id]}}case"session_removed":{const{[s.sessionId]:d,...h}=n.sessions;return{...n,sessions:h,order:n.order.filter(m=>m!==s.sessionId)}}case"approval_created":return{...n,approvals:{...n.approvals,[s.approval.id]:s.approval},phone:[...n.phone.filter((d,h)=>!d.decision||h>=n.phone.length-5),{approval:s.approval,sessionTitle:((l=n.sessions[s.approval.sessionId])==null?void 0:l.title)??s.approval.sessionId}]};case"approval_resolved":{const{[s.decision.approvalId]:d,...h}=n.approvals;return{...n,approvals:h,...Vh(n,d&&lw(s.decision,((u=n.sessions[d.sessionId])==null?void 0:u.title)??d.sessionId,d.origin)),demoReply:((f=n.demoReply)==null?void 0:f.approvalId)===s.decision.approvalId?void 0:n.demoReply,phone:n.phone.map(m=>m.approval.id===s.decision.approvalId?{...m,decision:s.decision}:m)}}case"token_dataset":return{...n,datasets:{...n.datasets,[s.dataset.id]:s.dataset}};case"token_tick":return{...n,raceT:{...n.raceT,[s.datasetId]:s.t}};case"demo_phone_reply":return n.approvals[s.approvalId]?{...n,demoReply:s}:n;case"toast":return{...n,...Vh(n,{tone:"info",text:s.text})}}return n}function cw(){const[n,i]=F.useReducer(uw,aw),s=F.useRef(null);F.useEffect(()=>{let f=!1,d;const h=()=>{const m=location.protocol==="https:"?"wss":"ws",g=new WebSocket(`${m}://${location.host}/ws`);s.current=g,g.onopen=()=>{f||i({type:"connected",value:!0})},g.onmessage=y=>{f||i({type:"server",msg:JSON.parse(y.data)})},g.onclose=()=>{f||(i({type:"connected",value:!1}),d=setTimeout(h,1e3))}};return h(),()=>{var m;f=!0,clearTimeout(d),(m=s.current)==null||m.close()}},[]);const l=F.useCallback(f=>{const d=s.current;(d==null?void 0:d.readyState)===WebSocket.OPEN&&d.send(JSON.stringify(f))},[]),u=F.useCallback(f=>i({type:"dismiss_toast",id:f}),[]);return{state:n,send:l,dismissToast:u}}function dw(){const{state:n,send:i,dismissToast:s}=cw(),[l,u]=F.useState(!0),[f,d]=F.useState(Date.now),h=n.mode==="demo",m=F.useCallback(()=>u(j=>!j),[]),g=F.useCallback(()=>i({type:"demo_restart"}),[i]);F.useEffect(()=>{const j=window.setInterval(()=>d(Date.now()),1e3);return()=>window.clearInterval(j)},[]),F.useEffect(()=>{if(!h)return;const j=M=>{M.defaultPrevented||M.repeat||M.isComposing||M.altKey||M.ctrlKey||M.metaKey||M.shiftKey||M.target instanceof HTMLElement&&(M.target.isContentEditable||M.target.closest("input, textarea, select"))||(M.key.toLowerCase()==="r"&&g(),M.key.toLowerCase()==="p"&&m())};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[h,g,m]);const y=(j,M,D)=>i({type:"decide",decision:{approvalId:j,action:M,text:D}}),w=(j,M,D)=>i({type:"decide",source:"phone_mock",decision:{approvalId:j,action:M,text:D}}),k=n.order.map(j=>n.sessions[j]),R=Object.values(n.datasets),A=R.find(j=>j.metric==="cost_usd"&&j.measured)??R.find(j=>j.metric==="cost_usd")??R[0];return v.jsxs(Ay,{reducedMotion:"user",children:[v.jsx(K1,{mode:n.mode,connected:n.connected,sessions:k,showPhone:l,onTogglePhone:m,onRestart:g}),v.jsxs("main",{className:"deck-grid",children:[v.jsxs("section",{"aria-labelledby":"sessions-title",className:"min-w-0",children:[v.jsxs("div",{className:"mb-4 flex items-baseline justify-between gap-3 border-b border-zinc-800/80 pb-3.5",children:[v.jsx("h2",{id:"sessions-title",className:"text-2xl font-semibold tracking-tight",children:"Sessions"}),v.jsxs("span",{className:"tabular font-mono text-xs text-zinc-400",children:[k.length," total"]})]}),k.length?v.jsx("div",{className:"session-grid",children:k.map(j=>v.jsx(J1,{session:j,approvals:j.pendingApprovalIds.flatMap(M=>n.approvals[M]?[n.approvals[M]]:[]),connected:n.connected,now:f,onDecide:y},j.id))}):v.jsx("div",{className:"panel flex min-h-64 items-center justify-center rounded-2xl border-dashed p-6 text-center",children:v.jsxs("div",{className:"max-w-xs",children:[v.jsx("span",{className:"mx-auto mb-4 grid size-11 place-items-center rounded-xl border border-zinc-700 bg-zinc-800/70 text-emerald-300",children:v.jsx(ke,{name:"terminal",className:"size-5"})}),v.jsx("h3",{className:"text-base font-semibold",children:n.connected?h?"Waiting for the demo":"No sessions yet":"Connecting to AgentMast"}),v.jsx("p",{className:"mt-1.5 text-sm leading-relaxed text-zinc-400",children:n.connected?h?"Sessions will appear when playback starts.":v.jsxs(v.Fragment,{children:["Run ",v.jsx("code",{className:"font-mono text-zinc-200",children:"agentmast install-hooks"})," for Claude Code. Add ",v.jsx("code",{className:"font-mono text-zinc-200",children:"--codex"}),", ",v.jsx("code",{className:"font-mono text-zinc-200",children:"--zcode"})," or ",v.jsx("code",{className:"font-mono text-zinc-200",children:"--antigravity"})," for the corresponding agent."]}):v.jsxs(v.Fragment,{children:["Start the local daemon with ",v.jsx("code",{className:"font-mono text-zinc-200",children:"agentmast up"})," if it is offline."]})})]})})]}),v.jsxs("aside",{"aria-label":"Usage and approval preview",className:"min-w-0 space-y-4",children:[v.jsx(ow,{dataset:A,t:A?n.raceT[A.id]??(h?0:void 0):void 0},A==null?void 0:A.id),v.jsx(Fn,{initial:!1,children:h&&l&&v.jsx(St.div,{initial:{opacity:0,y:16,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:12,scale:.98},transition:{duration:.22},className:"origin-top",children:v.jsx(X1,{messages:n.phone,replayReply:n.demoReply,connected:n.connected,onDecide:w})},"phone")})]})]}),v.jsx(nw,{toasts:n.toasts,onDismiss:s})]})}xy.createRoot(document.getElementById("root")).render(v.jsx(F.StrictMode,{children:v.jsx(dw,{})}));
|
package/dist/web/index.html
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><rect width='32' height='32' rx='8' fill='%2310b981'/><rect x='7' y='7' width='8' height='8' rx='2' fill='white'/><rect x='17' y='7' width='8' height='8' rx='2' fill='white' opacity='.6'/><rect x='7' y='17' width='8' height='8' rx='2' fill='white' opacity='.6'/><rect x='17' y='17' width='8' height='8' rx='2' fill='%23f59e0b'/></svg>" />
|
|
7
|
-
<title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<title>AgentMast</title>
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-CiSHj7dg.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-CMw6GB5R.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/package.json
CHANGED