@puddle-code/cli 0.0.41 → 0.0.43

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.
Files changed (30) hide show
  1. package/CHANGELOG.md +10 -2
  2. package/dist/index.js +49 -18
  3. package/dist/public/assets/{Dashboard-C20hVR67.js → Dashboard-CVuyy1FW.js} +1 -1
  4. package/dist/public/assets/{EditorTabClose-CPgOPm84.js → EditorTabClose-Dltbo1Dg.js} +1 -1
  5. package/dist/public/assets/{LazyTerminal-CD8sFfQv.js → LazyTerminal-dx89528B.js} +2 -2
  6. package/dist/public/assets/{ModelRefcount-DyVK1BOY.js → ModelRefcount-CCLXoHn3.js} +1 -1
  7. package/dist/public/assets/{PaneEditorBody-DxVi96UW.js → PaneEditorBody-BEq9lIXk.js} +70 -37
  8. package/dist/public/assets/{SettingsDialog-X7iwtNk6.js → SettingsDialog-cXSqHb2k.js} +1 -1
  9. package/dist/public/assets/Terminal-2XYN3IO5.js +117 -0
  10. package/dist/public/assets/Workspace-DEEiDdYw.js +7 -0
  11. package/dist/public/assets/{buffer-store-DAtSSGqE.js → buffer-store-kyNS3Ffy.js} +3 -3
  12. package/dist/public/assets/{context-menu-DBh8NsHQ.js → context-menu-DsXFpYcn.js} +1 -1
  13. package/dist/public/assets/{cssMode-C04ABJwJ.js → cssMode-CfVFZjxa.js} +1 -1
  14. package/dist/public/assets/{editor-context-S2r8KZeb.js → editor-context-A7YnYVrw.js} +1 -1
  15. package/dist/public/assets/{editor-sync-DIk9CfrV.js → editor-sync-1UzWDCzn.js} +1 -1
  16. package/dist/public/assets/file-links-xHzwSI4k.js +1 -0
  17. package/dist/public/assets/{hotkeys-CcCKpA6Q.js → hotkeys-CA5Pxll4.js} +1 -1
  18. package/dist/public/assets/{htmlMode-DUwMFiZx.js → htmlMode-CwjicKNM.js} +1 -1
  19. package/dist/public/assets/index-BYC57b5y.js +10 -0
  20. package/dist/public/assets/index-Cs421fXN.css +2 -0
  21. package/dist/public/assets/{jsonMode-Bc0OwdCb.js → jsonMode-B9Rj1ARB.js} +1 -1
  22. package/dist/public/assets/{session-seed-ywjbeobZ.js → session-seed-2cbwtTKV.js} +1 -1
  23. package/dist/public/assets/{tsMode-B82MT3Xk.js → tsMode-gVybv0cY.js} +1 -1
  24. package/dist/public/index.html +4 -4
  25. package/package.json +1 -1
  26. package/dist/public/assets/Terminal-B1BtMZ64.js +0 -117
  27. package/dist/public/assets/Workspace-pRk2k8mR.js +0 -7
  28. package/dist/public/assets/index-Bda4aeuf.css +0 -2
  29. package/dist/public/assets/index-CQ1WY5zt.js +0 -10
  30. package/dist/public/assets/ssh-mode-CXuvobAr.js +0 -1
package/CHANGELOG.md CHANGED
@@ -7,8 +7,16 @@ Past releases: see docs/changelogs/.
7
7
 
8
8
  # Changelog
9
9
 
10
- ## [0.0.41] — 2026-08-13
10
+ ## [0.0.43] — 2026-08-13
11
+
12
+ ### Added
13
+
14
+ - Open any daemon-host file or directory from a typed path in the command palette.
11
15
 
12
16
  ### Fixed
13
17
 
14
- - Preserve Codex and OpenCode conversations across daemon restarts by capturing only newly minted top-level agent session refs, repairing legacy refs by creation time, and preventing duplicate `(account, ref)` mappings.
18
+ - Make short file tabs shrink to their visible labels without counting hidden hover-control spacing.
19
+ - Compare symlinked editor files with their resolved target at `HEAD` instead of the link's target-path blob.
20
+ - Prompt for passwords, key passphrases, host confirmation, and 2FA when the desktop app connects or reconnects to an SSH host.
21
+ - Fit the macOS desktop cockpit flush to the work area while retaining native rounded corners and shadow.
22
+ - Make the close control in Monaco's inline dirty-diff viewer respond reliably to pointer input.
package/dist/index.js CHANGED
@@ -4249,7 +4249,7 @@ function openBrowser(url2, platform = process.platform) {
4249
4249
  import { join as join5 } from "node:path";
4250
4250
 
4251
4251
  // ../shared/src/protocol.ts
4252
- var PROTOCOL_VERSION = { major: 15, minor: 3 };
4252
+ var PROTOCOL_VERSION = { major: 16, minor: 0 };
4253
4253
 
4254
4254
  // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
4255
4255
  var external_exports = {};
@@ -19354,13 +19354,14 @@ var editorTabRefSchema = external_exports.object({
19354
19354
  root: external_exports.string().optional(),
19355
19355
  /**
19356
19356
  * How a `file` tab renders: Monaco (`source`, the default when absent), a
19357
- * rendered `preview`, or a `linked` preview a rendered view whose
19358
- * (session, path[, root]) is REWRITTEN to follow the most recently active
19359
- * renderable tab in its layout tree (SPEC §8). Meaningful only for
19360
- * previewable types (markdown, HTML). Not part of the tab's identity:
19361
- * toggling rewrites the tab ref in place.
19357
+ * rendered `preview`, or a following preview: `linked` retargets to the most
19358
+ * recently active renderable tab in its layout tree, while `locked` also
19359
+ * mirrors that driver's normalised vertical scroll position (SPEC §8).
19360
+ * Meaningful only for previewable types (markdown, HTML). The ordinary
19361
+ * source/preview choice is not part of tab identity; each following mode is
19362
+ * a distinct stable slot whose identity does not change when it retargets.
19362
19363
  */
19363
- view: external_exports.enum(["source", "preview", "linked"]).optional()
19364
+ view: external_exports.enum(["source", "preview", "linked", "locked"]).optional()
19364
19365
  });
19365
19366
  var tabRefSchema = external_exports.discriminatedUnion("type", [
19366
19367
  external_exports.object({ type: external_exports.literal("editor"), tab: editorTabRefSchema }),
@@ -19968,7 +19969,7 @@ import { readFileSync } from "node:fs";
19968
19969
  import { dirname, join as join2 } from "node:path";
19969
19970
  import { fileURLToPath } from "node:url";
19970
19971
  function cliVersion() {
19971
- if (true) return "0.0.41";
19972
+ if (true) return "0.0.43";
19972
19973
  const here = dirname(fileURLToPath(import.meta.url));
19973
19974
  for (const candidate of [
19974
19975
  join2(here, "..", "..", "package.json"),
@@ -20644,7 +20645,7 @@ async function openCallbackForward(ssh, port, opts = {}) {
20644
20645
  const child = spawn2(
20645
20646
  opts.sshBinary ?? "ssh",
20646
20647
  ssh.args("-N", "-L", `${port}:127.0.0.1:${port}`, ssh.host),
20647
- { stdio: ["ignore", "ignore", "inherit"] }
20648
+ { stdio: ["ignore", "ignore", "inherit"], env: ssh.spawnEnv() }
20648
20649
  );
20649
20650
  if (!await waitForTcp(port, 5e3)) {
20650
20651
  child.kill("SIGTERM");
@@ -20676,7 +20677,7 @@ async function openTunnel(ssh, remotePort, opts = {}) {
20676
20677
  const child = spawn2(
20677
20678
  sshBinary,
20678
20679
  ssh.args("-N", "-L", `${port}:127.0.0.1:${remotePort}`, ssh.host),
20679
- { stdio: ["ignore", "ignore", "inherit"] }
20680
+ { stdio: ["ignore", "ignore", "inherit"], env: ssh.spawnEnv() }
20680
20681
  );
20681
20682
  state.child = child;
20682
20683
  const ready = await waitForTcp(port, 5e3) && await isReady(port);
@@ -20860,6 +20861,7 @@ var SshTransport = class {
20860
20861
  this.label = host;
20861
20862
  this.ssh = opts.sshBinary ?? "ssh";
20862
20863
  this.scp = opts.scpBinary ?? "scp";
20864
+ this.askpassProgram = opts.askpassProgram;
20863
20865
  const platform = opts.platform ?? process.platform;
20864
20866
  if (platform === "win32") {
20865
20867
  this.controlArgs = [];
@@ -20885,6 +20887,7 @@ var SshTransport = class {
20885
20887
  scp;
20886
20888
  controlArgs;
20887
20889
  keepaliveArgs;
20890
+ askpassProgram;
20888
20891
  get hasControlMaster() {
20889
20892
  return this.controlArgs.length > 0;
20890
20893
  }
@@ -20893,12 +20896,33 @@ var SshTransport = class {
20893
20896
  return [...this.controlArgs, ...this.keepaliveArgs, ...rest];
20894
20897
  }
20895
20898
  /**
20896
- * Open the master interactively — ssh's own prompts go straight to the
20897
- * user's TTY. Exit 0 leaves a live control socket behind.
20899
+ * Environment for every ssh/scp child. `force` is scoped to graphical
20900
+ * embedders that supplied a helper; normal CLI launches still talk to the
20901
+ * inherited TTY exactly as before. OpenSSH also requires DISPLAY to be set
20902
+ * before it considers askpass, even when the helper is not an X11 program.
20903
+ */
20904
+ spawnEnv() {
20905
+ if (this.askpassProgram === void 0) return void 0;
20906
+ return {
20907
+ ...process.env,
20908
+ SSH_ASKPASS: this.askpassProgram,
20909
+ SSH_ASKPASS_REQUIRE: "force",
20910
+ DISPLAY: process.env.DISPLAY ?? "puddle"
20911
+ };
20912
+ }
20913
+ /**
20914
+ * Open the master through the caller's authentication surface: the CLI's
20915
+ * inherited TTY or a graphical embedder's askpass helper. Exit 0 leaves a
20916
+ * live control socket behind.
20898
20917
  */
20899
20918
  open() {
20900
20919
  return new Promise((resolve3, reject) => {
20901
- const child = spawn4(this.ssh, this.args(this.host, "true"), { stdio: "inherit" });
20920
+ const child = spawn4(this.ssh, this.args(this.host, "true"), {
20921
+ // A GUI has no useful inherited terminal; OpenSSH calls its askpass
20922
+ // helper instead. The terminal CLI keeps byte-for-byte inheritance.
20923
+ stdio: this.askpassProgram === void 0 ? "inherit" : "ignore",
20924
+ env: this.spawnEnv()
20925
+ });
20902
20926
  child.on(
20903
20927
  "error",
20904
20928
  (err) => reject(new CliError("ssh_unreachable", `could not run ${this.ssh}: ${err.message}`))
@@ -20921,7 +20945,10 @@ var SshTransport = class {
20921
20945
  isAlive() {
20922
20946
  if (!this.hasControlMaster) return Promise.resolve(true);
20923
20947
  return new Promise((resolve3) => {
20924
- const child = spawn4(this.ssh, this.args("-O", "check", this.host), { stdio: "ignore" });
20948
+ const child = spawn4(this.ssh, this.args("-O", "check", this.host), {
20949
+ stdio: "ignore",
20950
+ env: this.spawnEnv()
20951
+ });
20925
20952
  child.on("error", () => resolve3(false));
20926
20953
  child.on("close", (code) => resolve3(code === 0));
20927
20954
  });
@@ -20939,7 +20966,8 @@ var SshTransport = class {
20939
20966
  return new Promise((resolve3) => {
20940
20967
  const spec = `${localPort}:127.0.0.1:${remotePort}`;
20941
20968
  const child = spawn4(this.ssh, this.args("-O", "cancel", "-L", spec, this.host), {
20942
- stdio: "ignore"
20969
+ stdio: "ignore",
20970
+ env: this.spawnEnv()
20943
20971
  });
20944
20972
  child.on("error", () => resolve3());
20945
20973
  child.on("close", () => resolve3());
@@ -20948,7 +20976,8 @@ var SshTransport = class {
20948
20976
  exec(command, opts = {}) {
20949
20977
  return new Promise((resolve3) => {
20950
20978
  const child = spawn4(this.ssh, this.args(this.host, "--", `sh -c ${shellQuote(command)}`), {
20951
- stdio: ["pipe", "pipe", "pipe"]
20979
+ stdio: ["pipe", "pipe", "pipe"],
20980
+ env: this.spawnEnv()
20952
20981
  });
20953
20982
  let stdout = "";
20954
20983
  let stderr = "";
@@ -20983,7 +21012,8 @@ var SshTransport = class {
20983
21012
  await this.exec(`mkdir -p $(dirname ${destPath})`, { timeoutMs: 15e3 });
20984
21013
  await new Promise((resolve3, reject) => {
20985
21014
  const child = spawn4(this.scp, [...this.controlArgs, localPath, `${this.host}:${destPath}`], {
20986
- stdio: ["ignore", "ignore", "inherit"]
21015
+ stdio: ["ignore", "ignore", "inherit"],
21016
+ env: this.spawnEnv()
20987
21017
  });
20988
21018
  child.on("error", reject);
20989
21019
  child.on("close", (code) => {
@@ -21008,7 +21038,8 @@ async function connectRemote(opts) {
21008
21038
  const ssh = new SshTransport(opts.host, {
21009
21039
  sshBinary: opts.sshBinary,
21010
21040
  scpBinary: opts.scpBinary,
21011
- platform
21041
+ platform,
21042
+ askpassProgram: opts.sshAskpassProgram
21012
21043
  });
21013
21044
  if (platform === "win32") {
21014
21045
  logger.warn(
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{$ as r,Ct as i,_ as a,dt as o,et as s,f as c,gt as l,ot as u,rt as d}from"./hotkeys-CcCKpA6Q.js";import{a as f,g as p,i as m,n as h,o as g,t as _}from"./dialog-B43iKmfK.js";import{a as v,c as y,i as b,o as x,s as S,t as C}from"./LazyTerminal-CD8sFfQv.js";import{t as w}from"./utils-B6KiDbIe.js";import{A as T,M as E,c as D,j as O,k,n as A,r as j,t as M}from"./context-menu-DBh8NsHQ.js";import{r as N}from"./dist-i-QevsUb.js";import{At as P,Ut as F,at as I,ct as L,lt as R,st as z,wt as B}from"./index-CQ1WY5zt.js";var V=e(t(),1),H=n(),U=!1;function W(){let[e,t]=(0,V.useState)(U),[n,r]=(0,V.useState)(null);(0,V.useEffect)(()=>{if(!e)return;let t=!1;return R.spawnShell(i).then(e=>{t||r(e)}),()=>{t=!0}},[e]);let a=()=>{U=!1,t(!1),r(null)};return{open:e,term:n,toggle:()=>{e?(n&&R.killShell(i,n),a()):(U=!0,t(!0))},onExit:a}}function G({term:e,onExit:t}){return(0,H.jsx)(`div`,{className:`h-72 shrink-0 pb-6`,children:(0,H.jsx)(`div`,{className:`mx-auto size-full max-w-4xl px-6`,children:e!==null&&(0,H.jsx)(C,{stream:`home`,term:e,onExit:t})})})}var K=[{status:`running`,colour:`bg-running`},{status:`waiting_input`,colour:`bg-waiting`},{status:`interrupted`,colour:`bg-interrupted`}];function q({projectId:e}){let t=l(e),n=(0,V.useMemo)(()=>{let e=new Map;for(let n of t.data??[])e.set(n.status,(e.get(n.status)??0)+1);return e},[t.data]),r=(t.data??[]).filter(e=>e.status!==`archived`).length;return(0,H.jsxs)(`div`,{className:`flex items-center gap-3 text-2xs text-fg-muted tabular-nums`,children:[(0,H.jsxs)(`span`,{children:[r,` session`,r===1?``:`s`]}),K.map(({status:e,colour:t})=>{let r=n.get(e)??0;return r===0?null:(0,H.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`span`,{className:`size-1.5 rounded-full ${t}`}),r,` `,e.replace(`_`,` `)]},e)})]})}function J({icon:e,label:t,onClick:n}){return(0,H.jsx)(`button`,{type:`button`,"aria-label":t,title:t,onClick:e=>{e.preventDefault(),e.stopPropagation(),n()},className:`flex items-center rounded-md p-1.5 text-fg-muted transition-colors hover:bg-ground hover:text-fg`,children:(0,H.jsx)(e,{className:`size-4`})})}function Y({project:e,repoPath:t,draggable:n,dragging:r,onDragStart:i,onDragEnd:a,onDragOver:o}){let c=s(),[l,u]=(0,V.useState)(!1),[d,x]=(0,V.useState)(e.name),[C,T]=(0,V.useState)(L(e)),k=t=>c.mutate({id:e.id,archived:t},{onError:e=>b(e)}),N=()=>{x(e.name),T(L(e)),u(!0)},P=()=>{let t=d.trim(),n=z(C);if(!t){u(!1);return}let r={...t===e.name?{}:{name:t},...n&&n!==L(e)?{abbrev:n}:{}};if(Object.keys(r).length===0){u(!1);return}c.mutate({id:e.id,...r},{onSuccess:()=>u(!1),onError:e=>b(e)})};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(M,{children:[(0,H.jsx)(D,{asChild:!0,children:(0,H.jsxs)(`div`,{draggable:n,onDragStart:i,onDragEnd:a,onDragOver:o,className:w(`group relative transition-opacity`,r&&`opacity-50`),children:[(0,H.jsxs)(F,{draggable:!1,to:`/project/${e.id}`,className:`block rounded-lg bg-surface p-4 transition-colors hover:bg-elevated`,children:[(0,H.jsx)(`h2`,{className:`truncate pr-16 text-base font-semibold text-fg group-hover:text-accent`,children:e.name}),(0,H.jsx)(`p`,{className:`mt-1 truncate text-2xs text-fg-muted`,children:t??`…`}),(0,H.jsx)(`div`,{className:`mt-3`,children:(0,H.jsx)(q,{projectId:e.id})})]}),(0,H.jsx)(`div`,{className:`absolute right-2 top-2 hidden gap-0.5 group-hover:flex has-[[data-state=open]]:flex pointer-coarse:flex`,children:e.archived?(0,H.jsx)(J,{icon:E,label:`Reopen project`,onClick:()=>k(!1)}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(J,{icon:v,label:`Edit project`,onClick:N}),(0,H.jsx)(J,{icon:O,label:`Archive project`,onClick:()=>k(!0)})]})})]})}),(0,H.jsx)(A,{children:e.archived?(0,H.jsxs)(j,{onSelect:()=>k(!1),children:[(0,H.jsx)(E,{}),` Reopen`]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(j,{onSelect:N,children:[(0,H.jsx)(v,{}),` Edit`]}),(0,H.jsxs)(j,{onSelect:()=>k(!0),children:[(0,H.jsx)(O,{}),` Archive`]})]})})]}),(0,H.jsx)(_,{open:l,onOpenChange:u,children:(0,H.jsxs)(h,{children:[(0,H.jsx)(f,{children:(0,H.jsx)(g,{children:`Edit project`})}),(0,H.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),P()},children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(S,{htmlFor:`project-name-${e.id}`,children:`Name`}),(0,H.jsx)(y,{id:`project-name-${e.id}`,value:d,onChange:e=>x(e.target.value),autoFocus:!0})]}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(S,{htmlFor:`project-abbrev-${e.id}`,children:`Abbreviation`}),(0,H.jsx)(y,{id:`project-abbrev-${e.id}`,maxLength:5,value:C,onChange:e=>T(z(e.target.value)),className:`w-24 uppercase`}),(0,H.jsxs)(`p`,{className:`text-2xs text-fg-muted`,children:[`Up to `,5,` characters — the label on the collapsed sidebar rail.`]})]}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(S,{className:`text-fg-muted`,children:`Path`}),(0,H.jsx)(`p`,{className:`truncate text-2xs text-fg-muted`,children:t??`…`})]}),(0,H.jsxs)(m,{children:[(0,H.jsx)(p,{type:`button`,variant:`ghost`,onClick:()=>u(!1),children:`Cancel`}),(0,H.jsx)(p,{type:`submit`,disabled:!d.trim()||c.isPending,children:`Save`})]})]})]})})]})}function X({icon:e,label:t,hint:n,onClick:r}){return(0,H.jsxs)(`button`,{type:`button`,onClick:r,className:`group flex flex-col rounded-lg bg-surface p-4 text-left transition-colors hover:bg-elevated`,children:[(0,H.jsxs)(`h2`,{className:`flex items-center gap-2 truncate text-base font-semibold text-fg group-hover:text-accent`,children:[(0,H.jsx)(e,{className:`size-4 shrink-0`}),t]}),(0,H.jsx)(`p`,{className:`mt-1 truncate text-2xs text-fg-muted`,children:n})]})}function Z(){let e=a(),t=u(e??void 0),n=o(),i=d(e??void 0),s=r(e??``),[l,f]=(0,V.useState)(!1),[p,m]=(0,V.useState)(null),[h,g]=(0,V.useState)(!1),_=W(),v=c(`palette.toggle`),y=e=>n.data?.find(t=>t.id===e)?.path,b=t.data??[],S=i.data?.projectOrder??[],C=k(b.filter(e=>!e.archived),S),E=b.filter(e=>e.archived),D=(e,t)=>{e!==t&&s.mutate({projectOrder:T(C.map(e=>e.id),e,t)})};return(0,H.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,H.jsxs)(`div`,{className:`mx-auto max-w-4xl p-6`,children:[b.length===0&&(0,H.jsxs)(`div`,{className:`mb-8 mt-16 flex flex-col items-center gap-3 text-center`,children:[(0,H.jsx)(x,{className:`size-8 text-fg-muted`}),(0,H.jsxs)(`p`,{className:`text-sm text-fg-secondary`,children:[`No projects yet — open one below, or press `,v,`.`]})]}),(0,H.jsxs)(`div`,{className:`grid auto-rows-fr grid-cols-1 gap-3 sm:grid-cols-2`,children:[C.map(e=>(0,H.jsx)(Y,{project:e,repoPath:y(e.repo_id),draggable:!0,dragging:p===e.id,onDragStart:()=>m(e.id),onDragEnd:()=>m(null),onDragOver:t=>{t.preventDefault(),p&&p!==e.id&&D(p,e.id)}},e.id)),(0,H.jsx)(X,{icon:P,label:`Open project`,hint:`Point at a repository on this host`,onClick:()=>f(!0)}),(0,H.jsx)(X,{icon:B,label:_.open?`Close terminal`:`Open terminal`,hint:_.open?`End the shell below`:`A shell at ~ for cloning repositories`,onClick:_.toggle})]}),E.length>0&&(0,H.jsxs)(`div`,{className:`mt-6`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>g(e=>!e),className:`flex items-center gap-1.5 px-1 py-1.5 text-2xs uppercase tracking-wide text-fg-muted transition-colors hover:text-fg`,children:[(0,H.jsx)(N,{className:w(`size-3 transition-transform`,h&&`rotate-90`)}),(0,H.jsx)(O,{className:`size-3`}),(0,H.jsx)(`span`,{children:`Archived`}),(0,H.jsx)(`span`,{className:`tabular-nums`,children:E.length})]}),h&&(0,H.jsx)(`div`,{className:`mt-2 grid grid-cols-1 gap-3 sm:grid-cols-2`,children:E.map(e=>(0,H.jsx)(Y,{project:e,repoPath:y(e.repo_id),draggable:!1,dragging:!1,onDragStart:()=>{},onDragEnd:()=>{},onDragOver:()=>{}},e.id))})]})]})}),_.open&&(0,H.jsx)(G,{term:_.term,onExit:_.onExit}),e!==null&&(0,H.jsx)(I,{profileId:e,open:l,onOpenChange:f})]})}export{Z as Dashboard};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{$ as r,Ct as i,_ as a,dt as o,et as s,f as c,gt as l,ot as u,rt as d}from"./hotkeys-CA5Pxll4.js";import{a as f,g as p,i as m,n as h,o as g,t as _}from"./dialog-B43iKmfK.js";import{a as v,c as y,i as b,o as x,s as S,t as C}from"./LazyTerminal-dx89528B.js";import{t as w}from"./utils-B6KiDbIe.js";import{A as T,M as E,c as D,j as O,k,n as A,r as j,t as M}from"./context-menu-DsXFpYcn.js";import{r as N}from"./dist-i-QevsUb.js";import{Tt as P,Wt as F,ct as I,jt as L,lt as R,ot as z,ut as B}from"./index-BYC57b5y.js";var V=e(t(),1),H=n(),U=!1;function W(){let[e,t]=(0,V.useState)(U),[n,r]=(0,V.useState)(null);(0,V.useEffect)(()=>{if(!e)return;let t=!1;return B.spawnShell(i).then(e=>{t||r(e)}),()=>{t=!0}},[e]);let a=()=>{U=!1,t(!1),r(null)};return{open:e,term:n,toggle:()=>{e?(n&&B.killShell(i,n),a()):(U=!0,t(!0))},onExit:a}}function G({term:e,onExit:t}){return(0,H.jsx)(`div`,{className:`h-72 shrink-0 pb-6`,children:(0,H.jsx)(`div`,{className:`mx-auto size-full max-w-4xl px-6`,children:e!==null&&(0,H.jsx)(C,{stream:`home`,term:e,onExit:t})})})}var K=[{status:`running`,colour:`bg-running`},{status:`waiting_input`,colour:`bg-waiting`},{status:`interrupted`,colour:`bg-interrupted`}];function q({projectId:e}){let t=l(e),n=(0,V.useMemo)(()=>{let e=new Map;for(let n of t.data??[])e.set(n.status,(e.get(n.status)??0)+1);return e},[t.data]),r=(t.data??[]).filter(e=>e.status!==`archived`).length;return(0,H.jsxs)(`div`,{className:`flex items-center gap-3 text-2xs text-fg-muted tabular-nums`,children:[(0,H.jsxs)(`span`,{children:[r,` session`,r===1?``:`s`]}),K.map(({status:e,colour:t})=>{let r=n.get(e)??0;return r===0?null:(0,H.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`span`,{className:`size-1.5 rounded-full ${t}`}),r,` `,e.replace(`_`,` `)]},e)})]})}function J({icon:e,label:t,onClick:n}){return(0,H.jsx)(`button`,{type:`button`,"aria-label":t,title:t,onClick:e=>{e.preventDefault(),e.stopPropagation(),n()},className:`flex items-center rounded-md p-1.5 text-fg-muted transition-colors hover:bg-ground hover:text-fg`,children:(0,H.jsx)(e,{className:`size-4`})})}function Y({project:e,repoPath:t,draggable:n,dragging:r,onDragStart:i,onDragEnd:a,onDragOver:o}){let c=s(),[l,u]=(0,V.useState)(!1),[d,x]=(0,V.useState)(e.name),[C,T]=(0,V.useState)(R(e)),k=t=>c.mutate({id:e.id,archived:t},{onError:e=>b(e)}),N=()=>{x(e.name),T(R(e)),u(!0)},P=()=>{let t=d.trim(),n=I(C);if(!t){u(!1);return}let r={...t===e.name?{}:{name:t},...n&&n!==R(e)?{abbrev:n}:{}};if(Object.keys(r).length===0){u(!1);return}c.mutate({id:e.id,...r},{onSuccess:()=>u(!1),onError:e=>b(e)})};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(M,{children:[(0,H.jsx)(D,{asChild:!0,children:(0,H.jsxs)(`div`,{draggable:n,onDragStart:i,onDragEnd:a,onDragOver:o,className:w(`group relative transition-opacity`,r&&`opacity-50`),children:[(0,H.jsxs)(F,{draggable:!1,to:`/project/${e.id}`,className:`block rounded-lg bg-surface p-4 transition-colors hover:bg-elevated`,children:[(0,H.jsx)(`h2`,{className:`truncate pr-16 text-base font-semibold text-fg group-hover:text-accent`,children:e.name}),(0,H.jsx)(`p`,{className:`mt-1 truncate text-2xs text-fg-muted`,children:t??`…`}),(0,H.jsx)(`div`,{className:`mt-3`,children:(0,H.jsx)(q,{projectId:e.id})})]}),(0,H.jsx)(`div`,{className:`absolute right-2 top-2 hidden gap-0.5 group-hover:flex has-[[data-state=open]]:flex pointer-coarse:flex`,children:e.archived?(0,H.jsx)(J,{icon:E,label:`Reopen project`,onClick:()=>k(!1)}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(J,{icon:v,label:`Edit project`,onClick:N}),(0,H.jsx)(J,{icon:O,label:`Archive project`,onClick:()=>k(!0)})]})})]})}),(0,H.jsx)(A,{children:e.archived?(0,H.jsxs)(j,{onSelect:()=>k(!1),children:[(0,H.jsx)(E,{}),` Reopen`]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(j,{onSelect:N,children:[(0,H.jsx)(v,{}),` Edit`]}),(0,H.jsxs)(j,{onSelect:()=>k(!0),children:[(0,H.jsx)(O,{}),` Archive`]})]})})]}),(0,H.jsx)(_,{open:l,onOpenChange:u,children:(0,H.jsxs)(h,{children:[(0,H.jsx)(f,{children:(0,H.jsx)(g,{children:`Edit project`})}),(0,H.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),P()},children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(S,{htmlFor:`project-name-${e.id}`,children:`Name`}),(0,H.jsx)(y,{id:`project-name-${e.id}`,value:d,onChange:e=>x(e.target.value),autoFocus:!0})]}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(S,{htmlFor:`project-abbrev-${e.id}`,children:`Abbreviation`}),(0,H.jsx)(y,{id:`project-abbrev-${e.id}`,maxLength:5,value:C,onChange:e=>T(I(e.target.value)),className:`w-24 uppercase`}),(0,H.jsxs)(`p`,{className:`text-2xs text-fg-muted`,children:[`Up to `,5,` characters — the label on the collapsed sidebar rail.`]})]}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(S,{className:`text-fg-muted`,children:`Path`}),(0,H.jsx)(`p`,{className:`truncate text-2xs text-fg-muted`,children:t??`…`})]}),(0,H.jsxs)(m,{children:[(0,H.jsx)(p,{type:`button`,variant:`ghost`,onClick:()=>u(!1),children:`Cancel`}),(0,H.jsx)(p,{type:`submit`,disabled:!d.trim()||c.isPending,children:`Save`})]})]})]})})]})}function X({icon:e,label:t,hint:n,onClick:r}){return(0,H.jsxs)(`button`,{type:`button`,onClick:r,className:`group flex flex-col rounded-lg bg-surface p-4 text-left transition-colors hover:bg-elevated`,children:[(0,H.jsxs)(`h2`,{className:`flex items-center gap-2 truncate text-base font-semibold text-fg group-hover:text-accent`,children:[(0,H.jsx)(e,{className:`size-4 shrink-0`}),t]}),(0,H.jsx)(`p`,{className:`mt-1 truncate text-2xs text-fg-muted`,children:n})]})}function Z(){let e=a(),t=u(e??void 0),n=o(),i=d(e??void 0),s=r(e??``),[l,f]=(0,V.useState)(!1),[p,m]=(0,V.useState)(null),[h,g]=(0,V.useState)(!1),_=W(),v=c(`palette.toggle`),y=e=>n.data?.find(t=>t.id===e)?.path,b=t.data??[],S=i.data?.projectOrder??[],C=k(b.filter(e=>!e.archived),S),E=b.filter(e=>e.archived),D=(e,t)=>{e!==t&&s.mutate({projectOrder:T(C.map(e=>e.id),e,t)})};return(0,H.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,H.jsxs)(`div`,{className:`mx-auto max-w-4xl p-6`,children:[b.length===0&&(0,H.jsxs)(`div`,{className:`mb-8 mt-16 flex flex-col items-center gap-3 text-center`,children:[(0,H.jsx)(x,{className:`size-8 text-fg-muted`}),(0,H.jsxs)(`p`,{className:`text-sm text-fg-secondary`,children:[`No projects yet — open one below, or press `,v,`.`]})]}),(0,H.jsxs)(`div`,{className:`grid auto-rows-fr grid-cols-1 gap-3 sm:grid-cols-2`,children:[C.map(e=>(0,H.jsx)(Y,{project:e,repoPath:y(e.repo_id),draggable:!0,dragging:p===e.id,onDragStart:()=>m(e.id),onDragEnd:()=>m(null),onDragOver:t=>{t.preventDefault(),p&&p!==e.id&&D(p,e.id)}},e.id)),(0,H.jsx)(X,{icon:L,label:`Open project`,hint:`Point at a repository on this host`,onClick:()=>f(!0)}),(0,H.jsx)(X,{icon:P,label:_.open?`Close terminal`:`Open terminal`,hint:_.open?`End the shell below`:`A shell at ~ for cloning repositories`,onClick:_.toggle})]}),E.length>0&&(0,H.jsxs)(`div`,{className:`mt-6`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>g(e=>!e),className:`flex items-center gap-1.5 px-1 py-1.5 text-2xs uppercase tracking-wide text-fg-muted transition-colors hover:text-fg`,children:[(0,H.jsx)(N,{className:w(`size-3 transition-transform`,h&&`rotate-90`)}),(0,H.jsx)(O,{className:`size-3`}),(0,H.jsx)(`span`,{children:`Archived`}),(0,H.jsx)(`span`,{className:`tabular-nums`,children:E.length})]}),h&&(0,H.jsx)(`div`,{className:`mt-2 grid grid-cols-1 gap-3 sm:grid-cols-2`,children:E.map(e=>(0,H.jsx)(Y,{project:e,repoPath:y(e.repo_id),draggable:!1,dragging:!1,onDragStart:()=>{},onDragEnd:()=>{},onDragOver:()=>{}},e.id))})]})]})}),_.open&&(0,H.jsx)(G,{term:_.term,onExit:_.onExit}),e!==null&&(0,H.jsx)(z,{profileId:e,open:l,onOpenChange:f})]})}export{Z as Dashboard};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{a as r,g as i,h as a,i as o,n as s,o as c,r as l,t as u}from"./dialog-B43iKmfK.js";import{t as d}from"./createLucideIcon-DyMAgLa3.js";import{l as f,r as p,t as m}from"./buffer-store-DAtSSGqE.js";import{s as h,t as g}from"./editor-sync-DIk9CfrV.js";var _=d(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),v=e(t(),1),y=n();function b(e,t,n){let r=m(e,t,n);return(0,v.useSyncExternalStore)((0,v.useCallback)(e=>f(r,e),[r]),()=>p(r))}function x({session:e,path:t,kind:n,root:r}){return b(e,t,r)&&n!==`commit`?(0,y.jsx)(_,{"aria-hidden":!0,className:`size-2 shrink-0 fill-current text-fg-muted group-hover:hidden`}):null}function S({session:e,path:t,kind:n,root:d,label:f,onClose:p}){let m=b(e,t,d)&&n!==`commit`,[_,x]=(0,v.useState)(!1),S=()=>m?x(!0):p();return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`button`,{onClick:e=>{e.stopPropagation(),S()},className:`hidden size-4 items-center justify-center rounded-sm text-fg-muted transition-colors hover:text-fg group-hover:flex pointer-coarse:flex`,"aria-label":`Close ${f}`,children:(0,y.jsx)(a,{className:`size-3`})}),(0,y.jsx)(u,{open:_,onOpenChange:e=>!e&&x(!1),children:(0,y.jsxs)(s,{children:[(0,y.jsxs)(r,{children:[(0,y.jsxs)(c,{children:[`Discard changes to `,f,`?`]}),(0,y.jsx)(l,{children:`This file has unsaved changes. Closing the tab will discard them.`})]}),(0,y.jsxs)(o,{children:[(0,y.jsx)(i,{variant:`ghost`,onClick:()=>x(!1),children:`Keep editing`}),(0,y.jsx)(i,{variant:`danger`,onClick:()=>{h(e,t,d),g(e,t,d),x(!1),p()},children:`Discard`})]})]})})]})}export{x as EditorDirtyDot,S as EditorTabClose};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{a as r,g as i,h as a,i as o,n as s,o as c,r as l,t as u}from"./dialog-B43iKmfK.js";import{t as d}from"./createLucideIcon-DyMAgLa3.js";import{l as f,r as p,t as m}from"./buffer-store-kyNS3Ffy.js";import{s as h,t as g}from"./editor-sync-1UzWDCzn.js";var _=d(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),v=e(t(),1),y=n();function b(e,t,n){let r=m(e,t,n);return(0,v.useSyncExternalStore)((0,v.useCallback)(e=>f(r,e),[r]),()=>p(r))}function x({session:e,path:t,kind:n,root:r}){return b(e,t,r)&&n!==`commit`?(0,y.jsx)(_,{"aria-hidden":!0,className:`size-2 shrink-0 fill-current text-fg-muted group-hover:hidden`}):null}function S({session:e,path:t,kind:n,root:d,label:f,onClose:p}){let m=b(e,t,d)&&n!==`commit`,[_,x]=(0,v.useState)(!1),S=()=>m?x(!0):p();return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`button`,{onClick:e=>{e.stopPropagation(),S()},className:`hidden size-4 items-center justify-center rounded-sm text-fg-muted transition-colors hover:text-fg group-hover:flex pointer-coarse:flex`,"aria-label":`Close ${f}`,children:(0,y.jsx)(a,{className:`size-3`})}),(0,y.jsx)(u,{open:_,onOpenChange:e=>!e&&x(!1),children:(0,y.jsxs)(s,{children:[(0,y.jsxs)(r,{children:[(0,y.jsxs)(c,{children:[`Discard changes to `,f,`?`]}),(0,y.jsx)(l,{children:`This file has unsaved changes. Closing the tab will discard them.`})]}),(0,y.jsxs)(o,{children:[(0,y.jsx)(i,{variant:`ghost`,onClick:()=>x(!1),children:`Keep editing`}),(0,y.jsx)(i,{variant:`danger`,onClick:()=>{h(e,t,d),g(e,t,d),x(!1),p()},children:`Discard`})]})]})})]})}export{x as EditorDirtyDot,S as EditorTabClose};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Terminal-B1BtMZ64.js","assets/rolldown-runtime-QTnfLwEv.js","assets/react-CZI7_Jkm.js","assets/jsx-runtime-ffCh33zF.js","assets/hotkeys-CcCKpA6Q.js","assets/utils-B6KiDbIe.js","assets/index-CQ1WY5zt.js","assets/preload-helper-Czpn1I53.js","assets/dialog-B43iKmfK.js","assets/createLucideIcon-DyMAgLa3.js","assets/index-Bda4aeuf.css","assets/ssh-mode-CXuvobAr.js","assets/Terminal-BrP-ENHg.css"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{n,t as r}from"./jsx-runtime-ffCh33zF.js";import{Bt as i}from"./hotkeys-CcCKpA6Q.js";import{t as a}from"./preload-helper-Czpn1I53.js";import{A as o,C as s,O as c,w as l,x as u}from"./dialog-B43iKmfK.js";import{t as d}from"./utils-B6KiDbIe.js";import{t as f}from"./createLucideIcon-DyMAgLa3.js";var p=e(t(),1),m=[`top`,`right`,`bottom`,`left`],h=Math.min,g=Math.max,_=Math.round,v=Math.floor,y=e=>({x:e,y:e}),b={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function x(e,t,n){return g(e,h(t,n))}function S(e,t){return typeof e==`function`?e(t):e}function C(e){return e.split(`-`)[0]}function w(e){return e.split(`-`)[1]}function T(e){return e===`x`?`y`:`x`}function E(e){return e===`y`?`height`:`width`}function D(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function O(e){return T(D(e))}function k(e,t,n){n===void 0&&(n=!1);let r=w(e),i=O(e),a=E(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=R(o)),[o,R(o)]}function A(e){let t=R(e);return[j(e),t,j(t)]}function j(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var M=[`left`,`right`],N=[`right`,`left`],P=[`top`,`bottom`],F=[`bottom`,`top`];function I(e,t,n){switch(e){case`top`:case`bottom`:return n?t?N:M:t?M:N;case`left`:case`right`:return t?P:F;default:return[]}}function L(e,t,n,r){let i=w(e),a=I(C(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(j)))),a}function R(e){let t=C(e);return b[t]+e.slice(t.length)}function z(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ee(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:z(e)}function B(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function te(e,t,n){let{reference:r,floating:i}=e,a=D(t),o=O(t),s=E(o),c=C(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=w(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ne(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=S(t,e),p=ee(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=B(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=B(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var re=50,ie=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ne},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=te(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<re&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=te(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ae=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=S(e,t)||{};if(l==null)return{};let d=ee(u),f={x:n,y:r},p=O(i),m=E(p),g=await o.getDimensions(l),_=p===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,C=a.reference[m]+a.reference[p]-f[p]-a.floating[m],T=f[p]-a.reference[p],D=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),k=D?D[b]:0;(!k||!await(o.isElement==null?void 0:o.isElement(D)))&&(k=s.floating[b]||a.floating[m]);let A=C/2-T/2,j=k/2-g[m]/2-1,M=h(d[v],j),N=h(d[y],j),P=k-g[m]-N,F=k/2-g[m]/2+A,I=x(M,F,P),L=!c.arrow&&w(i)!=null&&F!==I&&a.reference[m]/2-(F<M?M:N)-g[m]/2<0,R=L?F<M?F-M:F-P:0;return{[p]:f[p]+R,data:{[p]:I,centerOffset:F-I-R,...L&&{alignmentOffset:R}},reset:L}}}),oe=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=S(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=C(r),_=D(o),v=C(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[R(o)]:A(o)),x=p!==`none`;!d&&x&&b.push(...L(o,m,p,y));let w=[o,...b],T=await s.detectOverflow(t,h),E=[],O=i.flip?.overflows||[];if(l&&E.push(T[g]),u){let e=k(r,a,y);E.push(T[e[0]],T[e[1]])}if(O=[...O,{placement:r,overflows:E}],!E.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=w[e];if(t&&(!(u===`alignment`&&_!==D(t))||O.every(e=>D(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:O},reset:{placement:t}};let n=O.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=O.filter(e=>{if(x){let t=D(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function se(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ce(e){return m.some(t=>e[t]>=0)}var le=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=S(e,t);switch(i){case`referenceHidden`:{let e=se(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ce(e)}}}case`escaped`:{let e=se(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ce(e)}}}default:return{}}}}},ue=new Set([`left`,`top`]);async function de(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=C(n),s=w(n),c=D(n)===`y`,l=ue.has(o)?-1:1,u=a&&c?-1:1,d=S(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var fe=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await de(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},pe=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=S(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=D(i),p=T(f),m=u[p],h=u[f],g=(e,t)=>x(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},me=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=S(e,t),u={x:n,y:r},d=D(i),f=T(d),p=u[f],m=u[d],h=S(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ue.has(C(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},he=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=S(e,t),c=await i.detectOverflow(t,s),l=C(n),u=w(n),d=D(n)===`y`,{width:f,height:p}=r.floating,m,_;l===`top`||l===`bottom`?(m=l,_=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(_=l,m=u===`end`?`top`:`bottom`);let v=p-c.top-c.bottom,y=f-c.left-c.right,b=h(p-c[m],v),x=h(f-c[_],y),T=t.middlewareData.shift,E=!T,O=b,k=x;T!=null&&T.enabled.x&&(k=y),T!=null&&T.enabled.y&&(O=v),E&&!u&&(d?k=f-2*g(c.left,c.right):O=p-2*g(c.top,c.bottom)),await o({...t,availableWidth:k,availableHeight:O});let A=await i.getDimensions(a.floating);return f!==A.width||p!==A.height?{reset:{rects:!0}}:{}}}};function ge(){return typeof window<`u`}function V(e){return _e(e)?(e.nodeName||``).toLowerCase():`#document`}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function U(e){return((_e(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function _e(e){return ge()?e instanceof Node||e instanceof H(e).Node:!1}function W(e){return ge()?e instanceof Element||e instanceof H(e).Element:!1}function G(e){return ge()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function ve(e){return!ge()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}function ye(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=J(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function be(e){return/^(table|td|th)$/.test(V(e))}function xe(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Se=/transform|translate|scale|rotate|perspective|filter/,Ce=/paint|layout|strict|content/,K=e=>!!e&&e!==`none`,we;function Te(e){let t=W(e)?J(e):e;return K(t.transform)||K(t.translate)||K(t.scale)||K(t.rotate)||K(t.perspective)||!De()&&(K(t.backdropFilter)||K(t.filter))||Se.test(t.willChange||``)||Ce.test(t.contain||``)}function Ee(e){let t=Y(e);for(;G(t)&&!q(t);){if(Te(t))return t;if(xe(t))return null;t=Y(t)}return null}function De(){return we??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),we}function q(e){return/^(html|body|#document)$/.test(V(e))}function J(e){return H(e).getComputedStyle(e)}function Oe(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Y(e){if(V(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ve(e)&&e.host||U(e);return ve(t)?t.host:t}function ke(e){let t=Y(e);return q(t)?(e.ownerDocument||e).body:G(t)&&ye(t)?t:ke(t)}function X(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ke(e),i=r===e.ownerDocument?.body,a=H(r);if(i){let e=Ae(a);return t.concat(a,a.visualViewport||[],ye(r)?r:[],e&&n?X(e):[])}else return t.concat(r,X(r,[],n))}function Ae(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function je(e){let t=J(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=G(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=_(n)!==a||_(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Me(e){return W(e)?e:e.contextElement}function Z(e){let t=Me(e);if(!G(t))return y(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=je(t),o=(a?_(n.width):n.width)/r,s=(a?_(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ne=y(0);function Pe(e){let t=H(e);return!De()||!t.visualViewport?Ne:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Fe(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===H(e)}function Q(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Me(e),o=y(1);t&&(r?W(r)&&(o=Z(r)):o=Z(e));let s=Fe(a,n,r)?Pe(a):y(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=H(a),t=W(r)?H(r):r,n=e,i=Ae(n);for(;i&&t!==n;){let e=Z(i),t=i.getBoundingClientRect(),r=J(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=H(i),i=Ae(n)}}return B({width:u,height:d,x:c,y:l})}function Ie(e,t){let n=Oe(e).scrollLeft;return t?t.left+n:Q(U(e)).left+n}function Le(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ie(e,n),y:n.top+t.scrollTop}}function Re(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=U(r),s=t?xe(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=y(1),u=y(0),d=G(r);if((d||!a)&&((V(r)!==`body`||ye(o))&&(c=Oe(r)),d)){let e=Q(r);l=Z(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Le(o,c):y(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ze(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Be(e){let t=Oe(e),n=e.ownerDocument.body,r=g(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=g(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Ie(e),o=-t.scrollTop;return J(n).direction===`rtl`&&(a+=g(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Ve=25;function He(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=H(e),a=U(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!De()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Ie(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Ve&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ue(e,t){let n=Q(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Z(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function We(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=He(e,n,t);else if(t===`document`)r=Be(U(e));else if(W(t))r=Ue(t,n);else{let n=Pe(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return B(r)}function Ge(e,t){let n=t.get(e);if(n)return n;let r=X(e,[],!1).filter(e=>W(e)&&V(e)!==`body`),i=null,a=J(e).position===`fixed`,o=a?Y(e):e;for(;W(o)&&!q(o);){let e=J(o),t=Te(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Y(o)}return t.set(e,r),r}function Ke(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?xe(t)?[]:Ge(t,this._c):[].concat(n),r],o=We(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=We(t,a[e],i);s=g(n.top,s),c=h(n.right,c),l=h(n.bottom,l),u=g(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function qe(e){let{width:t,height:n}=je(e);return{width:t,height:n}}function Je(e,t,n){let r=G(t),i=U(t),a=n===`fixed`,o=Q(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=y(0);if((r||!a)&&((V(t)!==`body`||ye(i))&&(s=Oe(t)),r)){let e=Q(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Ie(i));let l=i&&!r&&!a?Le(i,s):y(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Ye(e){return J(e).position===`static`}function Xe(e,t){if(!G(e)||J(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function Ze(e,t){let n=H(e);if(xe(e))return n;if(!G(e)){let t=Y(e);for(;t&&!q(t);){if(W(t)&&!Ye(t))return t;t=Y(t)}return n}let r=Xe(e,t);for(;r&&be(r)&&Ye(r);)r=Xe(r,t);return r&&q(r)&&Ye(r)&&!Te(r)?n:r||Ee(e)||n}var Qe=async function(e){let t=this.getOffsetParent||Ze,n=this.getDimensions,r=await n(e.floating);return{reference:Je(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $e(e){return J(e).direction===`rtl`}var et={convertOffsetParentRelativeRectToViewportRelativeRect:Re,getDocumentElement:U,getClippingRect:Ke,getOffsetParent:Ze,getElementRects:Qe,getClientRects:ze,getDimensions:qe,getScale:Z,isElement:W,isRTL:$e};function tt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function nt(e,t,n){let r=null,i,a=U(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=v(d),_=v(a.clientWidth-(u+f)),y=v(a.clientHeight-(d+p)),b=v(u),x={rootMargin:-m+`px `+-_+`px `+-y+`px `+-b+`px`,threshold:g(0,h(1,c))||1},S=!0;function C(t){let n=t[0].intersectionRatio;if(!tt(l,e.getBoundingClientRect()))return s();if(n!==c){if(!S)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}S=!1}try{r=new IntersectionObserver(C,{...x,root:a.ownerDocument})}catch{r=new IntersectionObserver(C,x)}r.observe(e)}let c=H(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function rt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Me(e),u=i||a?[...l?X(l):[],...t?X(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?nt(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Q(e):null;c&&g();function g(){let t=Q(e);h&&!tt(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var it=fe,at=pe,ot=oe,st=he,ct=le,lt=ae,ut=me,dt=(e,t,n)=>{let r=new Map,i=n??{},a={...et,...i.platform,_c:r};return ie(e,t,{...i,platform:a})},ft=e(n(),1),pt=typeof document<`u`?p.useLayoutEffect:function(){};function mt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!mt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!mt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ht(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gt(e,t){let n=ht(e);return Math.round(t*n)/n}function _t(e){let t=p.useRef(e);return pt(()=>{t.current=e}),t}function vt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=p.useState(r);mt(f,r)||m(r);let[h,g]=p.useState(null),[_,v]=p.useState(null),y=p.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=p.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=p.useRef(null),w=p.useRef(null),T=p.useRef(u),E=c!=null,D=_t(c),O=_t(i),k=_t(l),A=p.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),dt(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!mt(T.current,t)&&(T.current=t,ft.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);pt(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=p.useRef(!1);pt(()=>(j.current=!0,()=>{j.current=!1}),[]),pt(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=p.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=p.useMemo(()=>({reference:x,floating:S}),[x,S]),P=p.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=gt(N.floating,u.x),r=gt(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ht(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return p.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var yt=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:lt({element:r.current,padding:i}).fn(n):r?lt({element:r,padding:i}).fn(n):{}}}},bt=(e,t)=>{let n=it(e);return{name:n.name,fn:n.fn,options:[e,t]}},xt=(e,t)=>{let n=at(e);return{name:n.name,fn:n.fn,options:[e,t]}},St=(e,t)=>({fn:ut(e).fn,options:[e,t]}),Ct=(e,t)=>{let n=ot(e);return{name:n.name,fn:n.fn,options:[e,t]}},wt=(e,t)=>{let n=st(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tt=(e,t)=>{let n=ct(e);return{name:n.name,fn:n.fn,options:[e,t]}},Et=(e,t)=>{let n=yt(e);return{name:n.name,fn:n.fn,options:[e,t]}},$=r(),Dt=`Arrow`,Ot=p.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,$.jsx)(l.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,$.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Ot.displayName=Dt;var kt=Ot;function At(e){let[t,n]=p.useState(void 0);return u(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var jt=`Popper`,[Mt,Nt]=c(jt),[Pt,Ft]=Mt(jt),It=e=>{let{__scopePopper:t,children:n}=e,[r,i]=p.useState(null),[a,o]=p.useState(void 0);return(0,$.jsx)(Pt,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};It.displayName=jt;var Lt=`PopperAnchor`,Rt=p.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Ft(Lt,n),s=p.useRef(null),c=a.onAnchorChange,u=o(t,p.useCallback(e=>{s.current=e,e&&c(e)},[c])),d=p.useRef(null);p.useEffect(()=>{if(!r)return;let e=d.current;d.current=r.current,e!==d.current&&c(d.current)});let f=a.placementState&&Jt(a.placementState),m=f?.[0],h=f?.[1];return r?null:(0,$.jsx)(l.div,{"data-radix-popper-side":m,"data-radix-popper-align":h,...i,ref:u})});Rt.displayName=Lt;var zt=`PopperContent`,[Bt,Vt]=Mt(zt),Ht=p.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:c=0,arrowPadding:d=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:h=0,sticky:g=`partial`,hideWhenDetached:_=!1,updatePositionStrategy:v=`optimized`,onPlaced:y,...b}=e,x=Ft(zt,n),[S,C]=p.useState(null),w=o(t,C),[T,E]=p.useState(null),D=At(T),O=D?.width??0,k=D?.height??0,A=r+(a===`center`?``:`-`+a),j=typeof h==`number`?h:{top:0,right:0,bottom:0,left:0,...h},M=Array.isArray(m)?m:[m],N=M.length>0,P={padding:j,boundary:M.filter(Kt),altBoundary:N},{refs:F,floatingStyles:I,placement:L,isPositioned:R,middlewareData:z}=vt({strategy:`fixed`,placement:A,whileElementsMounted:(...e)=>rt(...e,{animationFrame:v===`always`}),elements:{reference:x.anchor},middleware:[bt({mainAxis:i+k,alignmentAxis:c}),f&&xt({mainAxis:!0,crossAxis:!1,limiter:g===`partial`?St():void 0,...P}),f&&Ct({...P}),wt({...P,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),T&&Et({element:T,padding:d}),qt({arrowWidth:O,arrowHeight:k}),_&&Tt({strategy:`referenceHidden`,...P,boundary:N?P.boundary:void 0})]}),ee=x.setPlacementState;u(()=>(ee(L),()=>{ee(void 0)}),[L,ee]);let[B,te]=Jt(L),ne=s(y);u(()=>{R&&ne?.()},[R,ne]);let re=z.arrow?.x,ie=z.arrow?.y,ae=z.arrow?.centerOffset!==0,[oe,se]=p.useState();return u(()=>{S&&se(window.getComputedStyle(S).zIndex)},[S]),(0,$.jsx)(`div`,{ref:F.setFloating,"data-radix-popper-content-wrapper":``,style:{...I,transform:R?I.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(` `),...z.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,$.jsx)(Bt,{scope:n,placedSide:B,placedAlign:te,onArrowChange:E,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,$.jsx)(l.div,{"data-side":B,"data-align":te,...b,ref:w,style:{...b.style,animation:R?void 0:`none`}})})})});Ht.displayName=zt;var Ut=`PopperArrow`,Wt={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Gt=p.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Vt(Ut,n),a=Wt[i.placedSide];return(0,$.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,$.jsx)(kt,{...r,ref:t,style:{...r.style,display:`block`}})})});Gt.displayName=Ut;function Kt(e){return e!==null}var qt=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Jt(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Jt(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Yt=It,Xt=Rt,Zt=Ht,Qt=Gt,$t=`rounded-md bg-border/50 text-sm text-fg placeholder:text-fg-muted transition-colors hover:bg-border/80 focus:bg-border/80 disabled:cursor-not-allowed disabled:opacity-50`,en=`relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-fg outline-none transition-colors`,tn=`data-[highlighted]:bg-action data-[highlighted]:text-action-ink data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,nn=`data-[selected=true]:bg-action data-[selected=true]:text-action-ink data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50`;function rn({className:e,type:t,...n}){return(0,$.jsx)(`input`,{type:t,className:d(`flex h-8 w-full px-2.5`,$t,e),...n})}function an({className:e,...t}){return(0,$.jsx)(`textarea`,{className:d(`flex min-h-16 w-full px-2.5 py-2`,$t,e),...t})}var on=`Label`,sn=p.forwardRef((e,t)=>(0,$.jsx)(l.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));sn.displayName=on;var cn=sn;function ln({className:e,...t}){return(0,$.jsx)(cn,{className:d(`text-xs font-medium text-fg-secondary peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var un=f(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),dn=f(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]);function fn(e){i.error(pn(e),{id:`err:${pn(e)}`})}function pn(e){return e instanceof Error&&e.message.trim()!==``?e.message:typeof e==`string`&&e.trim()!==``?e:`Something went wrong`}function mn({id:e,value:t,onValueChange:n,onChoose:r,hints:i,placeholder:a,className:o,hintsClassName:s,autoFocus:c}){let[l,u]=(0,p.useState)(!1),[f,m]=(0,p.useState)(0),h=e=>{n(e.value),r?.(e),u(!1)};return(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(rn,{id:e,value:t,onChange:e=>{n(e.target.value),u(!0),m(0)},onFocus:()=>u(!0),onBlur:()=>u(!1),onKeyDown:e=>{if(!(!l||i.length===0))if(e.key===`ArrowDown`)e.preventDefault(),m(e=>(e+1)%i.length);else if(e.key===`ArrowUp`)e.preventDefault(),m(e=>(e-1+i.length)%i.length);else if(e.key===`Enter`||e.key===`Tab`){let t=i[f]??i[0];t&&(e.preventDefault(),h(t))}else e.key===`Escape`&&(e.stopPropagation(),u(!1))},placeholder:a,className:o,autoComplete:`off`,spellCheck:!1,autoFocus:c}),l&&i.length>0&&(0,$.jsx)(`ul`,{className:d(`absolute top-full z-10 mt-1 max-h-56 overflow-y-auto rounded-md bg-elevated p-1 shadow-xl`,s??`w-full`),children:i.map((e,t)=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,onMouseDown:t=>{t.preventDefault(),h(e)},onMouseEnter:()=>m(t),className:d(`relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-fg outline-none transition-colors`,`data-[selected=true]:bg-action data-[selected=true]:text-action-ink data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50`,`w-full text-xs`),"data-selected":t===f,children:[(0,$.jsx)(`span`,{className:`truncate`,children:e.label??e.value}),e.badge&&(0,$.jsx)(`span`,{className:`ml-auto shrink-0 text-2xs opacity-70`,children:e.badge})]})},e.value))})]})}var hn=(0,p.lazy)(()=>a(()=>import(`./Terminal-B1BtMZ64.js`).then(e=>({default:e.Terminal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]))),gn=null;async function _n(){gn=(await a(()=>import(`./Terminal-B1BtMZ64.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]))).Terminal}function vn(e){return gn?(0,$.jsx)(gn,{...e}):(0,$.jsx)(p.Suspense,{fallback:(0,$.jsx)(`div`,{className:`size-full bg-ground`}),children:(0,$.jsx)(hn,{...e})})}export{Yt as _,dn as a,rn as c,nn as d,tn as f,Zt as g,Qt as h,fn as i,an as l,Xt as m,_n as n,un as o,en as p,mn as r,ln as s,vn as t,$t as u,Nt as v,At as y};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Terminal-2XYN3IO5.js","assets/rolldown-runtime-QTnfLwEv.js","assets/react-CZI7_Jkm.js","assets/jsx-runtime-ffCh33zF.js","assets/hotkeys-CA5Pxll4.js","assets/utils-B6KiDbIe.js","assets/index-BYC57b5y.js","assets/preload-helper-Czpn1I53.js","assets/dialog-B43iKmfK.js","assets/createLucideIcon-DyMAgLa3.js","assets/index-Cs421fXN.css","assets/file-links-xHzwSI4k.js","assets/Terminal-BrP-ENHg.css"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{n,t as r}from"./jsx-runtime-ffCh33zF.js";import{Bt as i}from"./hotkeys-CA5Pxll4.js";import{t as a}from"./preload-helper-Czpn1I53.js";import{A as o,C as s,O as c,w as l,x as u}from"./dialog-B43iKmfK.js";import{t as d}from"./utils-B6KiDbIe.js";import{t as f}from"./createLucideIcon-DyMAgLa3.js";var p=e(t(),1),m=[`top`,`right`,`bottom`,`left`],h=Math.min,g=Math.max,_=Math.round,v=Math.floor,y=e=>({x:e,y:e}),b={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function x(e,t,n){return g(e,h(t,n))}function S(e,t){return typeof e==`function`?e(t):e}function C(e){return e.split(`-`)[0]}function w(e){return e.split(`-`)[1]}function T(e){return e===`x`?`y`:`x`}function E(e){return e===`y`?`height`:`width`}function D(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function O(e){return T(D(e))}function k(e,t,n){n===void 0&&(n=!1);let r=w(e),i=O(e),a=E(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=R(o)),[o,R(o)]}function A(e){let t=R(e);return[j(e),t,j(t)]}function j(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var M=[`left`,`right`],N=[`right`,`left`],P=[`top`,`bottom`],F=[`bottom`,`top`];function I(e,t,n){switch(e){case`top`:case`bottom`:return n?t?N:M:t?M:N;case`left`:case`right`:return t?P:F;default:return[]}}function L(e,t,n,r){let i=w(e),a=I(C(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(j)))),a}function R(e){let t=C(e);return b[t]+e.slice(t.length)}function z(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ee(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:z(e)}function B(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function te(e,t,n){let{reference:r,floating:i}=e,a=D(t),o=O(t),s=E(o),c=C(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=w(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ne(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=S(t,e),p=ee(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=B(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=B(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var re=50,ie=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ne},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=te(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<re&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=te(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ae=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=S(e,t)||{};if(l==null)return{};let d=ee(u),f={x:n,y:r},p=O(i),m=E(p),g=await o.getDimensions(l),_=p===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,C=a.reference[m]+a.reference[p]-f[p]-a.floating[m],T=f[p]-a.reference[p],D=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),k=D?D[b]:0;(!k||!await(o.isElement==null?void 0:o.isElement(D)))&&(k=s.floating[b]||a.floating[m]);let A=C/2-T/2,j=k/2-g[m]/2-1,M=h(d[v],j),N=h(d[y],j),P=k-g[m]-N,F=k/2-g[m]/2+A,I=x(M,F,P),L=!c.arrow&&w(i)!=null&&F!==I&&a.reference[m]/2-(F<M?M:N)-g[m]/2<0,R=L?F<M?F-M:F-P:0;return{[p]:f[p]+R,data:{[p]:I,centerOffset:F-I-R,...L&&{alignmentOffset:R}},reset:L}}}),oe=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=S(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=C(r),_=D(o),v=C(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[R(o)]:A(o)),x=p!==`none`;!d&&x&&b.push(...L(o,m,p,y));let w=[o,...b],T=await s.detectOverflow(t,h),E=[],O=i.flip?.overflows||[];if(l&&E.push(T[g]),u){let e=k(r,a,y);E.push(T[e[0]],T[e[1]])}if(O=[...O,{placement:r,overflows:E}],!E.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=w[e];if(t&&(!(u===`alignment`&&_!==D(t))||O.every(e=>D(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:O},reset:{placement:t}};let n=O.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=O.filter(e=>{if(x){let t=D(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function se(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ce(e){return m.some(t=>e[t]>=0)}var le=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=S(e,t);switch(i){case`referenceHidden`:{let e=se(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ce(e)}}}case`escaped`:{let e=se(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ce(e)}}}default:return{}}}}},ue=new Set([`left`,`top`]);async function de(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=C(n),s=w(n),c=D(n)===`y`,l=ue.has(o)?-1:1,u=a&&c?-1:1,d=S(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var fe=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await de(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},pe=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=S(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=D(i),p=T(f),m=u[p],h=u[f],g=(e,t)=>x(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},me=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=S(e,t),u={x:n,y:r},d=D(i),f=T(d),p=u[f],m=u[d],h=S(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ue.has(C(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},he=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=S(e,t),c=await i.detectOverflow(t,s),l=C(n),u=w(n),d=D(n)===`y`,{width:f,height:p}=r.floating,m,_;l===`top`||l===`bottom`?(m=l,_=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(_=l,m=u===`end`?`top`:`bottom`);let v=p-c.top-c.bottom,y=f-c.left-c.right,b=h(p-c[m],v),x=h(f-c[_],y),T=t.middlewareData.shift,E=!T,O=b,k=x;T!=null&&T.enabled.x&&(k=y),T!=null&&T.enabled.y&&(O=v),E&&!u&&(d?k=f-2*g(c.left,c.right):O=p-2*g(c.top,c.bottom)),await o({...t,availableWidth:k,availableHeight:O});let A=await i.getDimensions(a.floating);return f!==A.width||p!==A.height?{reset:{rects:!0}}:{}}}};function ge(){return typeof window<`u`}function V(e){return _e(e)?(e.nodeName||``).toLowerCase():`#document`}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function U(e){return((_e(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function _e(e){return ge()?e instanceof Node||e instanceof H(e).Node:!1}function W(e){return ge()?e instanceof Element||e instanceof H(e).Element:!1}function G(e){return ge()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function ve(e){return!ge()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}function ye(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=J(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function be(e){return/^(table|td|th)$/.test(V(e))}function xe(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Se=/transform|translate|scale|rotate|perspective|filter/,Ce=/paint|layout|strict|content/,K=e=>!!e&&e!==`none`,we;function Te(e){let t=W(e)?J(e):e;return K(t.transform)||K(t.translate)||K(t.scale)||K(t.rotate)||K(t.perspective)||!De()&&(K(t.backdropFilter)||K(t.filter))||Se.test(t.willChange||``)||Ce.test(t.contain||``)}function Ee(e){let t=Y(e);for(;G(t)&&!q(t);){if(Te(t))return t;if(xe(t))return null;t=Y(t)}return null}function De(){return we??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),we}function q(e){return/^(html|body|#document)$/.test(V(e))}function J(e){return H(e).getComputedStyle(e)}function Oe(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Y(e){if(V(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ve(e)&&e.host||U(e);return ve(t)?t.host:t}function ke(e){let t=Y(e);return q(t)?(e.ownerDocument||e).body:G(t)&&ye(t)?t:ke(t)}function X(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ke(e),i=r===e.ownerDocument?.body,a=H(r);if(i){let e=Ae(a);return t.concat(a,a.visualViewport||[],ye(r)?r:[],e&&n?X(e):[])}else return t.concat(r,X(r,[],n))}function Ae(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function je(e){let t=J(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=G(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=_(n)!==a||_(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Me(e){return W(e)?e:e.contextElement}function Z(e){let t=Me(e);if(!G(t))return y(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=je(t),o=(a?_(n.width):n.width)/r,s=(a?_(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ne=y(0);function Pe(e){let t=H(e);return!De()||!t.visualViewport?Ne:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Fe(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===H(e)}function Q(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Me(e),o=y(1);t&&(r?W(r)&&(o=Z(r)):o=Z(e));let s=Fe(a,n,r)?Pe(a):y(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=H(a),t=W(r)?H(r):r,n=e,i=Ae(n);for(;i&&t!==n;){let e=Z(i),t=i.getBoundingClientRect(),r=J(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=H(i),i=Ae(n)}}return B({width:u,height:d,x:c,y:l})}function Ie(e,t){let n=Oe(e).scrollLeft;return t?t.left+n:Q(U(e)).left+n}function Le(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ie(e,n),y:n.top+t.scrollTop}}function Re(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=U(r),s=t?xe(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=y(1),u=y(0),d=G(r);if((d||!a)&&((V(r)!==`body`||ye(o))&&(c=Oe(r)),d)){let e=Q(r);l=Z(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Le(o,c):y(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ze(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Be(e){let t=Oe(e),n=e.ownerDocument.body,r=g(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=g(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Ie(e),o=-t.scrollTop;return J(n).direction===`rtl`&&(a+=g(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Ve=25;function He(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=H(e),a=U(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!De()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Ie(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Ve&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ue(e,t){let n=Q(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Z(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function We(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=He(e,n,t);else if(t===`document`)r=Be(U(e));else if(W(t))r=Ue(t,n);else{let n=Pe(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return B(r)}function Ge(e,t){let n=t.get(e);if(n)return n;let r=X(e,[],!1).filter(e=>W(e)&&V(e)!==`body`),i=null,a=J(e).position===`fixed`,o=a?Y(e):e;for(;W(o)&&!q(o);){let e=J(o),t=Te(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Y(o)}return t.set(e,r),r}function Ke(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?xe(t)?[]:Ge(t,this._c):[].concat(n),r],o=We(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=We(t,a[e],i);s=g(n.top,s),c=h(n.right,c),l=h(n.bottom,l),u=g(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function qe(e){let{width:t,height:n}=je(e);return{width:t,height:n}}function Je(e,t,n){let r=G(t),i=U(t),a=n===`fixed`,o=Q(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=y(0);if((r||!a)&&((V(t)!==`body`||ye(i))&&(s=Oe(t)),r)){let e=Q(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Ie(i));let l=i&&!r&&!a?Le(i,s):y(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Ye(e){return J(e).position===`static`}function Xe(e,t){if(!G(e)||J(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function Ze(e,t){let n=H(e);if(xe(e))return n;if(!G(e)){let t=Y(e);for(;t&&!q(t);){if(W(t)&&!Ye(t))return t;t=Y(t)}return n}let r=Xe(e,t);for(;r&&be(r)&&Ye(r);)r=Xe(r,t);return r&&q(r)&&Ye(r)&&!Te(r)?n:r||Ee(e)||n}var Qe=async function(e){let t=this.getOffsetParent||Ze,n=this.getDimensions,r=await n(e.floating);return{reference:Je(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $e(e){return J(e).direction===`rtl`}var et={convertOffsetParentRelativeRectToViewportRelativeRect:Re,getDocumentElement:U,getClippingRect:Ke,getOffsetParent:Ze,getElementRects:Qe,getClientRects:ze,getDimensions:qe,getScale:Z,isElement:W,isRTL:$e};function tt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function nt(e,t,n){let r=null,i,a=U(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=v(d),_=v(a.clientWidth-(u+f)),y=v(a.clientHeight-(d+p)),b=v(u),x={rootMargin:-m+`px `+-_+`px `+-y+`px `+-b+`px`,threshold:g(0,h(1,c))||1},S=!0;function C(t){let n=t[0].intersectionRatio;if(!tt(l,e.getBoundingClientRect()))return s();if(n!==c){if(!S)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}S=!1}try{r=new IntersectionObserver(C,{...x,root:a.ownerDocument})}catch{r=new IntersectionObserver(C,x)}r.observe(e)}let c=H(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function rt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Me(e),u=i||a?[...l?X(l):[],...t?X(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?nt(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Q(e):null;c&&g();function g(){let t=Q(e);h&&!tt(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var it=fe,at=pe,ot=oe,st=he,ct=le,lt=ae,ut=me,dt=(e,t,n)=>{let r=new Map,i=n??{},a={...et,...i.platform,_c:r};return ie(e,t,{...i,platform:a})},ft=e(n(),1),pt=typeof document<`u`?p.useLayoutEffect:function(){};function mt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!mt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!mt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ht(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gt(e,t){let n=ht(e);return Math.round(t*n)/n}function _t(e){let t=p.useRef(e);return pt(()=>{t.current=e}),t}function vt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=p.useState(r);mt(f,r)||m(r);let[h,g]=p.useState(null),[_,v]=p.useState(null),y=p.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=p.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=p.useRef(null),w=p.useRef(null),T=p.useRef(u),E=c!=null,D=_t(c),O=_t(i),k=_t(l),A=p.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),dt(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!mt(T.current,t)&&(T.current=t,ft.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);pt(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=p.useRef(!1);pt(()=>(j.current=!0,()=>{j.current=!1}),[]),pt(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=p.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=p.useMemo(()=>({reference:x,floating:S}),[x,S]),P=p.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=gt(N.floating,u.x),r=gt(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ht(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return p.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var yt=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:lt({element:r.current,padding:i}).fn(n):r?lt({element:r,padding:i}).fn(n):{}}}},bt=(e,t)=>{let n=it(e);return{name:n.name,fn:n.fn,options:[e,t]}},xt=(e,t)=>{let n=at(e);return{name:n.name,fn:n.fn,options:[e,t]}},St=(e,t)=>({fn:ut(e).fn,options:[e,t]}),Ct=(e,t)=>{let n=ot(e);return{name:n.name,fn:n.fn,options:[e,t]}},wt=(e,t)=>{let n=st(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tt=(e,t)=>{let n=ct(e);return{name:n.name,fn:n.fn,options:[e,t]}},Et=(e,t)=>{let n=yt(e);return{name:n.name,fn:n.fn,options:[e,t]}},$=r(),Dt=`Arrow`,Ot=p.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,$.jsx)(l.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,$.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Ot.displayName=Dt;var kt=Ot;function At(e){let[t,n]=p.useState(void 0);return u(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var jt=`Popper`,[Mt,Nt]=c(jt),[Pt,Ft]=Mt(jt),It=e=>{let{__scopePopper:t,children:n}=e,[r,i]=p.useState(null),[a,o]=p.useState(void 0);return(0,$.jsx)(Pt,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};It.displayName=jt;var Lt=`PopperAnchor`,Rt=p.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Ft(Lt,n),s=p.useRef(null),c=a.onAnchorChange,u=o(t,p.useCallback(e=>{s.current=e,e&&c(e)},[c])),d=p.useRef(null);p.useEffect(()=>{if(!r)return;let e=d.current;d.current=r.current,e!==d.current&&c(d.current)});let f=a.placementState&&Jt(a.placementState),m=f?.[0],h=f?.[1];return r?null:(0,$.jsx)(l.div,{"data-radix-popper-side":m,"data-radix-popper-align":h,...i,ref:u})});Rt.displayName=Lt;var zt=`PopperContent`,[Bt,Vt]=Mt(zt),Ht=p.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:c=0,arrowPadding:d=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:h=0,sticky:g=`partial`,hideWhenDetached:_=!1,updatePositionStrategy:v=`optimized`,onPlaced:y,...b}=e,x=Ft(zt,n),[S,C]=p.useState(null),w=o(t,C),[T,E]=p.useState(null),D=At(T),O=D?.width??0,k=D?.height??0,A=r+(a===`center`?``:`-`+a),j=typeof h==`number`?h:{top:0,right:0,bottom:0,left:0,...h},M=Array.isArray(m)?m:[m],N=M.length>0,P={padding:j,boundary:M.filter(Kt),altBoundary:N},{refs:F,floatingStyles:I,placement:L,isPositioned:R,middlewareData:z}=vt({strategy:`fixed`,placement:A,whileElementsMounted:(...e)=>rt(...e,{animationFrame:v===`always`}),elements:{reference:x.anchor},middleware:[bt({mainAxis:i+k,alignmentAxis:c}),f&&xt({mainAxis:!0,crossAxis:!1,limiter:g===`partial`?St():void 0,...P}),f&&Ct({...P}),wt({...P,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),T&&Et({element:T,padding:d}),qt({arrowWidth:O,arrowHeight:k}),_&&Tt({strategy:`referenceHidden`,...P,boundary:N?P.boundary:void 0})]}),ee=x.setPlacementState;u(()=>(ee(L),()=>{ee(void 0)}),[L,ee]);let[B,te]=Jt(L),ne=s(y);u(()=>{R&&ne?.()},[R,ne]);let re=z.arrow?.x,ie=z.arrow?.y,ae=z.arrow?.centerOffset!==0,[oe,se]=p.useState();return u(()=>{S&&se(window.getComputedStyle(S).zIndex)},[S]),(0,$.jsx)(`div`,{ref:F.setFloating,"data-radix-popper-content-wrapper":``,style:{...I,transform:R?I.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(` `),...z.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,$.jsx)(Bt,{scope:n,placedSide:B,placedAlign:te,onArrowChange:E,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,$.jsx)(l.div,{"data-side":B,"data-align":te,...b,ref:w,style:{...b.style,animation:R?void 0:`none`}})})})});Ht.displayName=zt;var Ut=`PopperArrow`,Wt={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Gt=p.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Vt(Ut,n),a=Wt[i.placedSide];return(0,$.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,$.jsx)(kt,{...r,ref:t,style:{...r.style,display:`block`}})})});Gt.displayName=Ut;function Kt(e){return e!==null}var qt=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Jt(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Jt(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Yt=It,Xt=Rt,Zt=Ht,Qt=Gt,$t=`rounded-md bg-border/50 text-sm text-fg placeholder:text-fg-muted transition-colors hover:bg-border/80 focus:bg-border/80 disabled:cursor-not-allowed disabled:opacity-50`,en=`relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-fg outline-none transition-colors`,tn=`data-[highlighted]:bg-action data-[highlighted]:text-action-ink data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,nn=`data-[selected=true]:bg-action data-[selected=true]:text-action-ink data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50`;function rn({className:e,type:t,...n}){return(0,$.jsx)(`input`,{type:t,className:d(`flex h-8 w-full px-2.5`,$t,e),...n})}function an({className:e,...t}){return(0,$.jsx)(`textarea`,{className:d(`flex min-h-16 w-full px-2.5 py-2`,$t,e),...t})}var on=`Label`,sn=p.forwardRef((e,t)=>(0,$.jsx)(l.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));sn.displayName=on;var cn=sn;function ln({className:e,...t}){return(0,$.jsx)(cn,{className:d(`text-xs font-medium text-fg-secondary peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var un=f(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),dn=f(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]);function fn(e){i.error(pn(e),{id:`err:${pn(e)}`})}function pn(e){return e instanceof Error&&e.message.trim()!==``?e.message:typeof e==`string`&&e.trim()!==``?e:`Something went wrong`}function mn({id:e,value:t,onValueChange:n,onChoose:r,hints:i,placeholder:a,className:o,hintsClassName:s,autoFocus:c}){let[l,u]=(0,p.useState)(!1),[f,m]=(0,p.useState)(0),h=e=>{n(e.value),r?.(e),u(!1)};return(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(rn,{id:e,value:t,onChange:e=>{n(e.target.value),u(!0),m(0)},onFocus:()=>u(!0),onBlur:()=>u(!1),onKeyDown:e=>{if(!(!l||i.length===0))if(e.key===`ArrowDown`)e.preventDefault(),m(e=>(e+1)%i.length);else if(e.key===`ArrowUp`)e.preventDefault(),m(e=>(e-1+i.length)%i.length);else if(e.key===`Enter`||e.key===`Tab`){let t=i[f]??i[0];t&&(e.preventDefault(),h(t))}else e.key===`Escape`&&(e.stopPropagation(),u(!1))},placeholder:a,className:o,autoComplete:`off`,spellCheck:!1,autoFocus:c}),l&&i.length>0&&(0,$.jsx)(`ul`,{className:d(`absolute top-full z-10 mt-1 max-h-56 overflow-y-auto rounded-md bg-elevated p-1 shadow-xl`,s??`w-full`),children:i.map((e,t)=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,onMouseDown:t=>{t.preventDefault(),h(e)},onMouseEnter:()=>m(t),className:d(`relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-fg outline-none transition-colors`,`data-[selected=true]:bg-action data-[selected=true]:text-action-ink data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50`,`w-full text-xs`),"data-selected":t===f,children:[(0,$.jsx)(`span`,{className:`truncate`,children:e.label??e.value}),e.badge&&(0,$.jsx)(`span`,{className:`ml-auto shrink-0 text-2xs opacity-70`,children:e.badge})]})},e.value))})]})}var hn=(0,p.lazy)(()=>a(()=>import(`./Terminal-2XYN3IO5.js`).then(e=>({default:e.Terminal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]))),gn=null;async function _n(){gn=(await a(()=>import(`./Terminal-2XYN3IO5.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]))).Terminal}function vn(e){return gn?(0,$.jsx)(gn,{...e}):(0,$.jsx)(p.Suspense,{fallback:(0,$.jsx)(`div`,{className:`size-full bg-ground`}),children:(0,$.jsx)(hn,{...e})})}export{Yt as _,dn as a,rn as c,nn as d,tn as f,Zt as g,Qt as h,fn as i,an as l,Xt as m,_n as n,un as o,en as p,mn as r,ln as s,vn as t,$t as u,Nt as v,At as y};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{a as n,s as r,t as i}from"./buffer-store-DAtSSGqE.js";var a=e(t(),1);function o({buffers:e}){let t=(0,a.useRef)(new Set);return(0,a.useEffect)(()=>{let a=new Set(e.map(e=>i(e.session,e.path,e.root))),o=t.current;for(let e of a)o.has(e)||(r(e),o.add(e));for(let e of[...o])a.has(e)||(n(e),o.delete(e))},[e]),(0,a.useEffect)(()=>()=>{for(let e of t.current)n(e);t.current.clear()},[]),null}export{o as ModelRefcount};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{a as n,s as r,t as i}from"./buffer-store-kyNS3Ffy.js";var a=e(t(),1);function o({buffers:e}){let t=(0,a.useRef)(new Set);return(0,a.useEffect)(()=>{let a=new Set(e.map(e=>i(e.session,e.path,e.root))),o=t.current;for(let e of a)o.has(e)||(r(e),o.add(e));for(let e of[...o])a.has(e)||(n(e),o.delete(e))},[e]),(0,a.useEffect)(()=>()=>{for(let e of t.current)n(e);t.current.clear()},[]),null}export{o as ModelRefcount};