@cuongtran001/kanna 1.41.2 → 1.41.3

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 (55) hide show
  1. package/dist/client/assets/{arc-BjpfMxgS.js → arc-2NesLEd4.js} +1 -1
  2. package/dist/client/assets/{architectureDiagram-3BPJPVTR-BUHVFhDO.js → architectureDiagram-3BPJPVTR-CNT9oKci.js} +1 -1
  3. package/dist/client/assets/{blockDiagram-GPEHLZMM-C42kXW-r.js → blockDiagram-GPEHLZMM-CbGZXIsE.js} +1 -1
  4. package/dist/client/assets/{c4Diagram-AAUBKEIU-N0iKjkPj.js → c4Diagram-AAUBKEIU-9wAtOabE.js} +1 -1
  5. package/dist/client/assets/channel-CP89iStm.js +1 -0
  6. package/dist/client/assets/{chunk-2J33WTMH-KK-LRvfb.js → chunk-2J33WTMH-BWT6j9Gb.js} +1 -1
  7. package/dist/client/assets/{chunk-4BX2VUAB-Bn9bYLtB.js → chunk-4BX2VUAB-CzEDCbat.js} +1 -1
  8. package/dist/client/assets/{chunk-55IACEB6-CJERiQXe.js → chunk-55IACEB6-C7bjO6-8.js} +1 -1
  9. package/dist/client/assets/{chunk-727SXJPM-Dgid5beD.js → chunk-727SXJPM-JjLDzKnC.js} +1 -1
  10. package/dist/client/assets/{chunk-AQP2D5EJ-CrBUb80H.js → chunk-AQP2D5EJ-2QWoxT_t.js} +1 -1
  11. package/dist/client/assets/{chunk-FMBD7UC4-BHYf0WjD.js → chunk-FMBD7UC4-C5E8nihw.js} +1 -1
  12. package/dist/client/assets/{chunk-ND2GUHAM-DB_eDch5.js → chunk-ND2GUHAM-CZfKotvF.js} +1 -1
  13. package/dist/client/assets/{chunk-QZHKN3VN-D_QoJmDX.js → chunk-QZHKN3VN-BZqUeqhp.js} +1 -1
  14. package/dist/client/assets/classDiagram-4FO5ZUOK-BQnQ6nWR.js +1 -0
  15. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-BQnQ6nWR.js +1 -0
  16. package/dist/client/assets/{cose-bilkent-S5V4N54A-DohLT3sP.js → cose-bilkent-S5V4N54A-CFpV7Gnq.js} +1 -1
  17. package/dist/client/assets/{dagre-BM42HDAG-CHvbggmQ.js → dagre-BM42HDAG-C_AgD2lo.js} +1 -1
  18. package/dist/client/assets/{diagram-2AECGRRQ-GaVcQ5o0.js → diagram-2AECGRRQ-DVWdRwq5.js} +1 -1
  19. package/dist/client/assets/{diagram-5GNKFQAL-V-xTJaTx.js → diagram-5GNKFQAL-Ka3o2iQf.js} +1 -1
  20. package/dist/client/assets/{diagram-KO2AKTUF-B1beqOTW.js → diagram-KO2AKTUF-H2ZXROX4.js} +1 -1
  21. package/dist/client/assets/{diagram-LMA3HP47-DFim9Wgm.js → diagram-LMA3HP47-DFO68n_N.js} +1 -1
  22. package/dist/client/assets/{diagram-OG6HWLK6-DTXkLNS5.js → diagram-OG6HWLK6-DBudPrax.js} +1 -1
  23. package/dist/client/assets/{erDiagram-TEJ5UH35-rTdCCoMI.js → erDiagram-TEJ5UH35-CQpIto02.js} +1 -1
  24. package/dist/client/assets/{flowDiagram-I6XJVG4X-CNOsM7BH.js → flowDiagram-I6XJVG4X-uthoQEw1.js} +1 -1
  25. package/dist/client/assets/{ganttDiagram-6RSMTGT7-B5wwTLMw.js → ganttDiagram-6RSMTGT7-BiAxvwgY.js} +1 -1
  26. package/dist/client/assets/{gitGraphDiagram-PVQCEYII-xoqlhaUB.js → gitGraphDiagram-PVQCEYII-2OaQBWIt.js} +1 -1
  27. package/dist/client/assets/{index-CbfAvmid.js → index-B_CVPOY8.js} +1 -1
  28. package/dist/client/assets/{index-DxxsM33V.js → index-J8bLuFmc.js} +2 -2
  29. package/dist/client/assets/{infoDiagram-5YYISTIA-DHPSFURC.js → infoDiagram-5YYISTIA-C18U0QZi.js} +1 -1
  30. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-C3Bun_7L.js → ishikawaDiagram-YF4QCWOH-BQpvmUjP.js} +1 -1
  31. package/dist/client/assets/{journeyDiagram-JHISSGLW-BFgSHdrE.js → journeyDiagram-JHISSGLW-B3a-WnZz.js} +1 -1
  32. package/dist/client/assets/{kanban-definition-UN3LZRKU-CO3ZCqeg.js → kanban-definition-UN3LZRKU-D6vM74-0.js} +1 -1
  33. package/dist/client/assets/{linear-ghdlcjF_.js → linear-D8Rvwjic.js} +1 -1
  34. package/dist/client/assets/{mermaid.core-htyOC5rr.js → mermaid.core-BTsaN5I_.js} +4 -4
  35. package/dist/client/assets/{mindmap-definition-RKZ34NQL-BVeJs4LU.js → mindmap-definition-RKZ34NQL-BM16DTmG.js} +1 -1
  36. package/dist/client/assets/{pieDiagram-4H26LBE5-BzPxIZE3.js → pieDiagram-4H26LBE5-lUKtP1Rt.js} +1 -1
  37. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-4A3EVVmd.js → quadrantDiagram-W4KKPZXB-DaugxhU_.js} +1 -1
  38. package/dist/client/assets/{requirementDiagram-4Y6WPE33-DUtc-5Xs.js → requirementDiagram-4Y6WPE33-MlYcjN4y.js} +1 -1
  39. package/dist/client/assets/{sankeyDiagram-5OEKKPKP-zVvX9qXj.js → sankeyDiagram-5OEKKPKP-BsnqpTsH.js} +1 -1
  40. package/dist/client/assets/{sequenceDiagram-3UESZ5HK-CwuZ1y2d.js → sequenceDiagram-3UESZ5HK-CIFZIJ6Q.js} +1 -1
  41. package/dist/client/assets/{stateDiagram-AJRCARHV-DcAKaJp9.js → stateDiagram-AJRCARHV-B7idm6ER.js} +1 -1
  42. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-CDOEw6mf.js +1 -0
  43. package/dist/client/assets/{timeline-definition-PNZ67QCA-BTqiioOE.js → timeline-definition-PNZ67QCA-B94_WES8.js} +1 -1
  44. package/dist/client/assets/{vennDiagram-CIIHVFJN-C2K8ITbO.js → vennDiagram-CIIHVFJN-CKbASP46.js} +1 -1
  45. package/dist/client/assets/{wardley-L42UT6IY-D8NDkHkL.js → wardley-L42UT6IY-Durvz2BX.js} +1 -1
  46. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-9p9h3HEo.js → wardleyDiagram-YWT4CUSO-D5rcBY_J.js} +1 -1
  47. package/dist/client/assets/{xychartDiagram-2RQKCTM6-CjF6Foj-.js → xychartDiagram-2RQKCTM6-CgEhDpsY.js} +1 -1
  48. package/dist/client/index.html +1 -1
  49. package/package.json +1 -1
  50. package/src/server/claude-session-runner.test.ts +73 -0
  51. package/src/server/claude-session-runner.ts +2 -1
  52. package/dist/client/assets/channel-SPxCM3v3.js +0 -1
  53. package/dist/client/assets/classDiagram-4FO5ZUOK-BOI_EPhE.js +0 -1
  54. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-BOI_EPhE.js +0 -1
  55. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-DPR0HY0t.js +0 -1
@@ -828,7 +828,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
828
828
  `)!==n.readPathDeny.join(`
829
829
  `)&&(w.readPathDeny=x),y.join(`
830
830
  `)!==n.writePathDeny.join(`
831
- `)&&(w.writePathDeny=y),Object.keys(w).length===0?null:w}function g(){r(m())}function v(){r(null)}return c.jsxs(c.Fragment,{children:[c.jsx(La,{open:e,onOpenChange:x=>{x||i()},children:c.jsxs(ra,{className:"max-w-2xl",children:[c.jsxs($a,{children:["Permissions — ",t]}),c.jsxs(vl,{className:"space-y-5",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"text-sm font-medium",children:"Default action"}),c.jsxs("div",{className:"text-xs text-muted-foreground",children:["Behaviour when a tool call has no explicit allow/deny rule. ",c.jsx("strong",{children:"auto-allow"})," bypasses prompts and runs untrusted shell commands without supervision — use a worktree."]}),c.jsx(Ji,{value:s,onValueChange:h,options:[{value:"ask",label:"Ask"},{value:"auto-allow",label:"Auto-allow (unsafe)"},{value:"auto-deny",label:"Auto-deny"}]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"text-sm font-medium",children:"Read-path deny list"}),c.jsx("div",{className:"text-xs text-muted-foreground",children:"One glob per line. The model cannot read paths matching any entry. Defaults shown below — edit to add or remove."}),c.jsx("textarea",{value:o,onChange:x=>f.getState().setReadDenyText(x.target.value),rows:8,className:"w-full rounded-md border border-border bg-background px-3 py-2 font-mono text-xs",spellCheck:!1})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"text-sm font-medium",children:"Write-path deny list"}),c.jsx("div",{className:"text-xs text-muted-foreground",children:"One glob per line. The model cannot edit or write paths matching any entry."}),c.jsx("textarea",{value:a,onChange:x=>f.getState().setWriteDenyText(x.target.value),rows:8,className:"w-full rounded-md border border-border bg-background px-3 py-2 font-mono text-xs",spellCheck:!1})]})]}),c.jsxs(ju,{className:"justify-between",children:[c.jsx(Ee,{variant:"ghost",onClick:v,children:"Reset to defaults"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Ee,{variant:"ghost",onClick:i,children:"Cancel"}),c.jsx(Ee,{onClick:g,children:"Apply"})]})]})]})}),c.jsx(La,{open:l,onOpenChange:x=>{x||(f.getState().setConfirmUnsafeOpen(!1),f.getState().setPendingDefaultAction(null))},children:c.jsxs(ra,{className:"max-w-md",children:[c.jsx($a,{children:"Enable auto-allow for this chat?"}),c.jsxs(vl,{className:"space-y-3 text-sm",children:[c.jsx("p",{children:"Auto-allow disables tool-call prompts. The model can run shell commands, write files, and edit code without asking. Read/write deny lists still apply."}),c.jsx("p",{className:"text-warning",children:"Use a worktree for risky tasks."})]}),c.jsxs(ju,{className:"justify-end gap-2",children:[c.jsx(Ee,{variant:"ghost",onClick:()=>{f.getState().setConfirmUnsafeOpen(!1),f.getState().setPendingDefaultAction(null)},children:"Cancel"}),c.jsx(Ee,{variant:"destructive",onClick:()=>{const x=f.getState();u&&x.setDefaultAction(u),x.setConfirmUnsafeOpen(!1),x.setPendingDefaultAction(null)},children:"Enable auto-allow"})]})]})})]})}const w_e={defaultAction:"ask",bash:{autoAllowVerbs:["ls","pwd","git status","git diff","git log"]},readPathDeny:["~/.ssh","~/.aws","~/.gcp","~/.config/gh","~/.claude","~/.kanna","~/Library/Keychains","/etc/shadow","/etc/sudoers","~/.gnupg","~/.gitconfig","**/.git/config","~/.npmrc","~/.netrc","~/.docker/config.json","**/.env","**/.env.*","**/credentials*","**/*.pem","**/*.key","**/id_rsa*","**/id_ed25519*"],writePathDeny:["/etc/**","/usr/**","/System/**","~/.ssh/**","~/.aws/**","~/.config/gh/**","~/.claude/**","~/.kanna/**","~/.gnupg/**","~/.gitconfig","**/.git/config"],toolDenyList:[{tool:"mcp__kanna__bash",pattern:"rm\\s+-rf\\s+(/|~|\\$HOME)(?:\\b|$|\\s)"},{tool:"mcp__kanna__bash",pattern:"git\\s+push\\b.*--force"}],toolAllowList:[]},Jn={setTimeout(e,t){return window.setTimeout(e,t)},clearTimeout(e){window.clearTimeout(e)},setInterval(e,t){return window.setInterval(e,t)},clearInterval(e){window.clearInterval(e)},requestAnimationFrame(e){return window.requestAnimationFrame(e)},cancelAnimationFrame(e){window.cancelAnimationFrame(e)}},Bt=_.forwardRef(({className:e,type:t,...n},r)=>c.jsx("input",{ref:r,type:t,className:ce("flex w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e),...n}));Bt.displayName="Input";const JY=_.createContext(null);function C_e({children:e,ports:t={}}){const n=t.timer??Jn,[r,i]=_.useState(null),[s,o]=_.useState(""),a=_.useRef(null);_.useEffect(()=>{(r==null?void 0:r.kind)==="prompt"&&(o(r.options.initialValue??""),n.setTimeout(()=>{var y,w;(y=a.current)==null||y.focus(),(w=a.current)==null||w.select()},0))},[r,n]);const l=_.useCallback(()=>{i(null),o("")},[]),u=_.useCallback(()=>{r&&(r.kind==="confirm"?r.resolve(!1):r.kind==="prompt"?r.resolve(null):r.resolve(),l())},[l,r]),f=_.useCallback(()=>{r&&(r.kind==="confirm"?r.resolve(!0):r.kind==="prompt"?r.resolve(s.trim()||null):r.resolve(),l())},[l,r,s]),h=_.useCallback(y=>new Promise(w=>{i({kind:"confirm",options:y,resolve:w})}),[]),m=_.useCallback(y=>new Promise(w=>{i({kind:"prompt",options:y,resolve:w})}),[]),g=_.useCallback(y=>new Promise(w=>{i({kind:"alert",options:y,resolve:w})}),[]),v=_.useMemo(()=>({confirm:h,prompt:m,alert:g}),[g,h,m]);let x="Confirm";return r&&(r.kind==="alert"?x=r.options.closeLabel??"OK":"confirmLabel"in r.options&&(x=r.options.confirmLabel??"Confirm")),c.jsxs(JY.Provider,{value:v,children:[e,c.jsx(La,{open:r!==null,onOpenChange:y=>{y||!r||u()},children:c.jsx(ra,{size:"sm",onKeyDown:y=>{y.key!=="Enter"||y.shiftKey||!r||r.kind!=="confirm"||(y.preventDefault(),f())},children:r?c.jsxs(c.Fragment,{children:[c.jsxs(vl,{className:"space-y-4",children:[c.jsx($a,{children:r.options.title}),r.options.description?c.jsx(h0,{children:r.options.description}):null,r.kind==="prompt"?c.jsx(Bt,{ref:a,type:"text",value:s,onChange:y=>o(y.target.value),onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),f())},placeholder:r.options.placeholder}):null]}),c.jsxs(ju,{children:[c.jsx(Ee,{variant:"ghost",size:"sm",onClick:u,className:r.kind==="alert"?"hidden":void 0,children:"cancelLabel"in r.options?r.options.cancelLabel??"Cancel":"Cancel"}),c.jsx(Ee,{variant:r.kind==="confirm"?r.options.confirmVariant??"default":"secondary",size:"sm",onClick:f,disabled:r.kind==="prompt"&&!s.trim(),children:x})]})]}):null})})]})}function $E(){const e=_.useContext(JY);if(!e)throw new Error("useAppDialog must be used within AppDialogProvider");return e}const qD=_.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ce("bg-card text-card-foreground",e),...t}));qD.displayName="Card";const YD=_.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ce("flex flex-col space-y-1.5 p-2",e),...t}));YD.displayName="CardHeader";const ZY=_.forwardRef(({className:e,...t},n)=>c.jsx("h3",{ref:n,className:ce("text-2xl font-semibold leading-none tracking-tight",e),...t}));ZY.displayName="CardTitle";const eX=_.forwardRef(({className:e,...t},n)=>c.jsx("p",{ref:n,className:ce("text-sm text-muted-foreground",e),...t}));eX.displayName="CardDescription";const XD=_.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ce("p-6 pt-0",e),...t}));XD.displayName="CardContent";const k_e=_.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ce("flex items-center p-6 pt-0",e),...t}));k_e.displayName="CardFooter";const E_e={info:{dotVar:"var(--info)",bgClass:"bg-info/[0.06]"},warning:{dotVar:"var(--warning)",bgClass:"bg-warning/[0.06]"},success:{dotVar:"var(--success)",bgClass:"bg-success/[0.06]"},error:{dotVar:"var(--destructive)",bgClass:"bg-destructive/[0.06]"}};function N_e({variant:e,children:t,dot:n=!0,className:r}){const i=E_e[e];return c.jsxs("div",{role:"status",className:ce("flex flex-wrap items-center justify-center gap-x-2 gap-y-1 border-b border-border px-4 py-2 text-xs leading-tight",i.bgClass,r),children:[n?c.jsx("span",{"aria-hidden":"true",className:"inline-block size-1.5 shrink-0 rounded-full",style:{backgroundColor:i.dotVar}}):null,t]})}const T_e="modulepreload",A_e=function(e){return"/"+e},T6={},Z=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let o=function(u){return Promise.all(u.map(f=>Promise.resolve(f).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=o(n.map(u=>{if(u=A_e(u),u in T6)return;T6[u]=!0;const f=u.endsWith(".css"),h=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${h}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":T_e,f||(m.as="script"),m.crossOrigin="",m.href=u,l&&m.setAttribute("nonce",l),document.head.appendChild(m),f)return new Promise((g,v)=>{m.addEventListener("load",g),m.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})},j_e=_.lazy(()=>Z(()=>import("./index-CbfAvmid.js"),[]).then(e=>({default:e.Toaster})));function R_e(){return c.jsx(_.Suspense,{fallback:null,children:c.jsx(j_e,{position:"bottom-right",theme:"system",closeButton:!0,duration:6e3})})}const M_e="1.41.2",P_e={version:M_e},Vr="Kanna",A6="kanna",I_e=".kanna",O_e=".kanna-dev",D_e="KANNA_RUNTIME_PROFILE",QD=`kanna/${P_e.version}`,L_e="[kanna]",$_e=`~/${Vr}`;function BE(){const e=Reflect.get(globalThis,"process");return e==null?void 0:e.env}function B_e(e=BE()){var t;return((t=e==null?void 0:e[D_e])==null?void 0:t.trim().toLowerCase())==="dev"?"dev":"prod"}function F_e(e=BE()){return B_e(e)==="dev"?O_e:I_e}function z_e(e=BE()){return`~/${F_e(e)}`}function U_e(e=BE()){return`${z_e(e)}/keybindings.json`}function ww(e){return e?`${A6} ${e}`:A6}const tX="always",nX="funk",H_e=[{value:"blow",label:"Blow"},{value:"bottle",label:"Bottle"},{value:"frog",label:"Frog"},{value:"funk",label:"Funk"},{value:"glass",label:"Glass"},{value:"ping",label:"Ping"},{value:"pop",label:"Pop"},{value:"purr",label:"Purr"},{value:"tink",label:"Tink"}];function W_e(e){switch(e){case"never":case"unfocused":case"always":return e;default:return tX}}function V_e(e){switch(e){case"blow":case"bottle":case"frog":case"funk":case"glass":case"ping":case"pop":case"purr":case"tink":return e;default:return nX}}const np=Yt()(e=>({chatSoundPreference:tX,chatSoundId:nX,setChatSoundPreference:t=>e({chatSoundPreference:W_e(t)}),setChatSoundId:t=>e({chatSoundId:V_e(t)})})),K_e={blow:"/chat-sounds/Blow.mp3",bottle:"/chat-sounds/Bottle.mp3",frog:"/chat-sounds/Frog.mp3",funk:"/chat-sounds/Funk.mp3",glass:"/chat-sounds/Glass.mp3",ping:"/chat-sounds/Ping.mp3",pop:"/chat-sounds/Pop.mp3",purr:"/chat-sounds/Purr.mp3",tink:"/chat-sounds/Tink.mp3"};function G_e(e=Et){return e.getVisibilityState()!=="visible"||!e.hasFocus()}function q_e(e){const t=new Audio(K_e[e]);return t.preload="auto",t.play()}async function vM(e,t,n=Jn){if(t<=0)return;const r=Array.from({length:t},(i,s)=>new Promise(o=>{n.setTimeout(()=>{q_e(e).catch(()=>{}).finally(()=>o())},s*90)}));await Promise.all(r)}function Y_e(e,t=Et){return e==="never"?!1:e==="always"?!0:G_e(t)}function X_e(e){return e.projectGroups.reduce((t,n)=>t+n.chats.reduce((r,i)=>r+(i.unread?1:0)+(i.status==="waiting_for_user"?1:0),0),0)}function j6(e){let t=0;const n=new Set;for(const r of e.projectGroups)for(const i of r.chats)i.unread&&(t+=1),i.status==="waiting_for_user"&&n.add(i.chatId);return{unreadCount:t,waitingChatIds:n}}function Q_e(e,t){if(!e)return 0;const n=j6(e),r=j6(t),i=Math.max(0,r.unreadCount-n.unreadCount);let s=0;for(const o of r.waitingChatIds)n.waitingChatIds.has(o)||(s+=1);return i+s}const rX="h-[var(--shell-top-band)] max-h-[var(--shell-top-band)]",J_e="md:my-2 md:mr-2 md:rounded-2xl md:border md:border-border",Z_e="flex min-h-0 flex-1 flex-col overflow-y-auto";function hu({tooltip:e,children:t,className:n,inline:r=!1,side:i}){const s=ce("truncate",n);return c.jsx(v0,{children:c.jsxs(gi,{children:[c.jsx(vi,{asChild:!0,children:r?c.jsx("span",{className:s,children:t}):c.jsx("div",{className:s,children:t})}),c.jsx(si,{side:i,children:e})]})})}function ia({label:e,children:t,side:n}){return c.jsx(v0,{children:c.jsxs(gi,{children:[c.jsx(vi,{asChild:!0,children:t}),c.jsx(si,{side:n,children:e})]})})}const e0e=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi;function t0e(e){const t=e.match(e0e);return!t||t.length===0?null:t[t.length-1].toLowerCase()}function n0e(e){const t=[];for(const n of e.split(/[\s,]+/)){if(!n)continue;const r=t0e(n);r&&!t.includes(r)&&t.push(r)}return t}const bM=Yt()(e=>({text:"",setText:t=>e({text:t}),resetForOpen:()=>e({text:""})})),r0e=()=>bM(e=>e.text),Ma=_.forwardRef(({className:e,...t},n)=>c.jsx("textarea",{"data-gramm":"false","data-gramm_editor":"false","data-enable-grammarly":"false","data-1p-ignore":!0,autoComplete:"off",className:ce("flex w-full rounded-lg border border-border bg-background px-2.5 py-2 text-sm placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Ma.displayName="Textarea";function i0e({open:e,busy:t,onClose:n,onImportAll:r,onImportSessions:i}){const s=r0e(),o=bM(m=>m.setText),a=bM(m=>m.resetForOpen);_.useEffect(()=>{e&&a()},[e,a]);const l=_.useMemo(()=>n0e(s),[s]),f=s.trim().length>0&&l.length===0,h=()=>{l.length===0||t||i(l)};return c.jsx(La,{open:e,onOpenChange:m=>{m||n()},children:c.jsxs(ra,{size:"sm",children:[c.jsxs(vl,{className:"space-y-3",children:[c.jsx($a,{children:"Import Claude sessions"}),c.jsx(Ma,{value:s,onChange:m=>o(m.target.value),placeholder:"Paste one or more session ids (uuid, filename, or full path)…",rows:4}),f?c.jsx("p",{className:"text-xs text-destructive",children:"No valid session id found in the pasted text."}):null,c.jsx("p",{className:"text-xs text-muted-foreground",children:"Empty input imports ALL sessions (full scan). Active sessions import as a live view — sending a message there takes over the session."})]}),c.jsxs(ju,{children:[c.jsx(Ee,{variant:"ghost",size:"sm",onClick:n,disabled:t,children:"Cancel"}),c.jsx(Ee,{variant:"ghost",size:"sm",onClick:r,disabled:t,children:"Import all"}),c.jsxs(Ee,{variant:"secondary",size:"sm",onClick:h,disabled:l.length===0||t,children:["Import ",l.length===1?"session":"sessions"]})]})]})})}function xM(e){return e.split(/[\s_-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const s0e=[/^(?:\/usr\/bin\/env\s+)?(?:\/bin\/)?(?:bash|zsh|sh)\s+(?:-[a-zA-Z]*c|-c)\s+(['"])([\s\S]*)\1$/,/^(?:\/usr\/bin\/env\s+)?(?:\/bin\/)?(?:bash|zsh|sh)\s+(?:-[a-zA-Z]*c|-c)\s+(.+)$/,/^(?:\/usr\/bin\/env\s+)?(?:cmd(?:\.exe)?)\s+\/c\s+(['"])([\s\S]*)\1$/i,/^(?:\/usr\/bin\/env\s+)?(?:cmd(?:\.exe)?)\s+\/c\s+(.+)$/i,/^(?:\/usr\/bin\/env\s+)?(?:powershell(?:\.exe)?|pwsh)\s+(?:-NoProfile\s+)?-Command\s+(['"])([\s\S]*)\1$/i,/^(?:\/usr\/bin\/env\s+)?(?:powershell(?:\.exe)?|pwsh)\s+(?:-NoProfile\s+)?-Command\s+(.+)$/i];function iX(e){const t=e.trim();for(const n of s0e){const r=t.match(n);if(!r)continue;const i=(r[2]??r[1]??"").trim();if(i)return i}return t}function b0(e){return e.split("/").pop()||e}const o0e=1440*6e4;function a0e(e,t){const n=Math.max(0,t-e),r=Math.floor(n/1e3),i=Math.floor(r/3600),s=Math.floor(r%3600/60),o=r%60;return i>0?`${i}h ${s}m`:s>0?`${s}m ${o}s`:`${o}s`}function l0e(e){const t=new Date(e),n=t.getHours().toString().padStart(2,"0"),r=t.getMinutes().toString().padStart(2,"0");return`${n}:${r}`}function c0e(e,t){if(e===void 0)return null;const n=Math.max(0,t-e),r=6e4,i=60*r,s=o0e,o=7*s;return n<r?"now":n<i?`${Math.floor(n/r)}m`:n<s?`${Math.floor(n/i)}h`:n<o?`${Math.floor(n/s)}d`:`${Math.floor(n/o)}w`}function sX(e,t){return e.length<=t?e:`${e.slice(0,t-1).trimEnd()}…`}const u0e=80;function d0e(e){return sX(e,u0e)}function f0e(e){return e.lastMessageAt??e._creationTime}const FE=1e3,Sy=60*FE,rp=60*Sy,WC=24*rp;function xo(e){const t=Math.max(0,e);if(t<Sy)return`${Math.floor(t/FE)}s`;if(t<rp)return`${Math.floor(t/Sy)}m`;if(t<WC){const i=Math.floor(t/rp),s=Math.floor(t%rp/Sy);return s===0?`${i}h`:`${i}h ${s}m`}const n=Math.floor(t/WC),r=Math.floor(t%WC/rp);return r===0?`${n}d`:`${n}d ${r}h`}function h0e(e){const t=Math.max(0,e),n=Math.ceil(t/FE);if(n<60)return`${String(n)}s`;const r=Math.ceil(t/Sy);if(r<60)return`${String(r)}m`;const i=Math.ceil(t/rp);return i<24?`${String(i)}h`:`${String(Math.ceil(t/WC))}d`}function Pu(e){const t=Math.max(0,e);if(t>=rp)return xo(t);const n=Math.floor(t/FE),r=Math.floor(n/60),i=n%60;return`${r}:${i.toString().padStart(2,"0")}`}function kf(e){switch(e){case"idle":return"Idle";case"starting":return"Starting";case"running":return"Running";case"waiting_for_user":return"Waiting";case"failed":return"Failed"}}function R6(e){switch(e){case"running":return"active";case"waiting_for_user":return"attention";case"failed":return"destructive";case"idle":case"starting":default:return"muted"}}function Jy(e){switch(e){case"active":return"text-emerald-500 dark:text-emerald-400";case"attention":return"text-amber-500 dark:text-amber-400";case"destructive":return"text-destructive";case"muted":default:return"text-muted-foreground"}}function oX(e){switch(e){case"active":return"bg-emerald-500 dark:bg-emerald-400";case"attention":return"bg-amber-500 dark:bg-amber-400";case"destructive":return"bg-destructive";case"muted":default:return"bg-muted-foreground"}}function p0e(e){switch(e){case"running":return"Running";case"completed":return"Completed";case"failed":return"Failed";case"killed":return"Killed";case"unknown":return"Unknown"}}function aX(e){switch(e){case"running":return"active";case"failed":return"destructive";case"killed":return"attention";case"completed":case"unknown":default:return"muted"}}function zE(e){return e.status==="running"||e.status==="starting"?{tone:"warning",label:kf(e.status)}:e.status==="waiting_for_user"?{tone:"info",label:kf(e.status)}:e.status==="failed"?{tone:"destructive",label:kf(e.status)}:e.unread?{tone:"success",label:"Unread"}:null}function UE(e){switch(e){case"warning":return"bg-warning";case"info":return"bg-info";case"success":return"bg-success";case"destructive":return"bg-destructive";case"muted":return"bg-muted-foreground";default:return""}}function lX(e){switch(e){case"warning":return"text-warning";case"info":return"text-info";case"success":return"text-success";case"destructive":return"text-destructive";case"muted":default:return"text-muted-foreground"}}function cX(e){switch(e){case"active":return{glyph:"●",toneClass:"text-success",title:"Claude PTY session active"};case"warming":return{glyph:"◐",toneClass:"text-warning",title:"Claude PTY session warming"};case"idle":return{glyph:"○",toneClass:"text-muted-foreground",title:"Claude PTY session idle"};case"cooling":return{glyph:"◌",toneClass:"text-muted-foreground",title:"Claude PTY session cooling down"};case"cold":default:return null}}function JD(e){const t=e+"CollectionProvider",[n,r]=qu(t),[i,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=x=>{const{scope:y,children:w}=x,C=Dn.useRef(null),k=Dn.useRef(new Map).current;return c.jsx(i,{scope:y,itemMap:k,collectionRef:C,children:w})};o.displayName=t;const a=e+"CollectionSlot",l=Ip(a),u=Dn.forwardRef((x,y)=>{const{scope:w,children:C}=x,k=s(a,w),E=Un(y,k.collectionRef);return c.jsx(l,{ref:E,children:C})});u.displayName=a;const f=e+"CollectionItemSlot",h="data-radix-collection-item",m=Ip(f),g=Dn.forwardRef((x,y)=>{const{scope:w,children:C,...k}=x,E=Dn.useRef(null),N=Un(y,E),T=s(f,w);return Dn.useEffect(()=>(T.itemMap.set(E,{ref:E,...k}),()=>void T.itemMap.delete(E))),c.jsx(m,{[h]:"",ref:N,children:C})});g.displayName=f;function v(x){const y=s(e+"CollectionConsumer",x);return Dn.useCallback(()=>{const C=y.collectionRef.current;if(!C)return[];const k=Array.from(C.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((T,R)=>k.indexOf(T.ref.current)-k.indexOf(R.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:u,ItemSlot:g},v,r]}var m0e=_.createContext(void 0);function ZD(e){const t=_.useContext(m0e);return e||t||"ltr"}var jA="rovingFocusGroup.onEntryFocus",g0e={bubbles:!1,cancelable:!0},x0="RovingFocusGroup",[yM,uX,v0e]=JD(x0),[b0e,dX]=qu(x0,[v0e]),[x0e,y0e]=b0e(x0),fX=_.forwardRef((e,t)=>c.jsx(yM.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(yM.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(_0e,{...e,ref:t})})}));fX.displayName=x0;var _0e=_.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...h}=e,m=_.useRef(null),g=Un(t,m),v=ZD(s),[x,y]=Rv({prop:o,defaultProp:a??null,onChange:l,caller:x0}),[w,C]=_.useState(!1),k=gl(u),E=uX(n),N=_.useRef(!1),[T,R]=_.useState(0);return _.useEffect(()=>{const M=m.current;if(M)return M.addEventListener(jA,k),()=>M.removeEventListener(jA,k)},[k]),c.jsx(x0e,{scope:n,orientation:r,dir:v,loop:i,currentTabStopId:x,onItemFocus:_.useCallback(M=>y(M),[y]),onItemShiftTab:_.useCallback(()=>C(!0),[]),onFocusableItemAdd:_.useCallback(()=>R(M=>M+1),[]),onFocusableItemRemove:_.useCallback(()=>R(M=>M-1),[]),children:c.jsx(wn.div,{tabIndex:w||T===0?-1:0,"data-orientation":r,...h,ref:g,style:{outline:"none",...e.style},onMouseDown:st(e.onMouseDown,()=>{N.current=!0}),onFocus:st(e.onFocus,M=>{const P=!N.current;if(M.target===M.currentTarget&&P&&!w){const B=new CustomEvent(jA,g0e);if(M.currentTarget.dispatchEvent(B),!B.defaultPrevented){const U=E().filter(z=>z.focusable),D=U.find(z=>z.active),$=U.find(z=>z.id===x),V=[D,$,...U].filter(Boolean).map(z=>z.ref.current);mX(V,f)}}N.current=!1}),onBlur:st(e.onBlur,()=>C(!1))})})}),hX="RovingFocusGroupItem",pX=_.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,children:o,...a}=e,l=ku(),u=s||l,f=y0e(hX,n),h=f.currentTabStopId===u,m=uX(n),{onFocusableItemAdd:g,onFocusableItemRemove:v,currentTabStopId:x}=f;return _.useEffect(()=>{if(r)return g(),()=>v()},[r,g,v]),c.jsx(yM.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:c.jsx(wn.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...a,ref:t,onMouseDown:st(e.onMouseDown,y=>{r?f.onItemFocus(u):y.preventDefault()}),onFocus:st(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:st(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const w=C0e(y,f.orientation,f.dir);if(w!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let k=m().filter(E=>E.focusable).map(E=>E.ref.current);if(w==="last")k.reverse();else if(w==="prev"||w==="next"){w==="prev"&&k.reverse();const E=k.indexOf(y.currentTarget);k=f.loop?k0e(k,E+1):k.slice(E+1)}setTimeout(()=>mX(k))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:x!=null}):o})})});pX.displayName=hX;var S0e={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function w0e(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function C0e(e,t,n){const r=w0e(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return S0e[r]}function mX(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function k0e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var E0e=fX,N0e=pX,_M=["Enter"," "],T0e=["ArrowDown","PageUp","Home"],gX=["ArrowUp","PageDown","End"],A0e=[...T0e,...gX],j0e={ltr:[..._M,"ArrowRight"],rtl:[..._M,"ArrowLeft"]},R0e={ltr:["ArrowLeft"],rtl:["ArrowRight"]},y0="Menu",[Zy,M0e,P0e]=JD(y0),[lm,vX]=qu(y0,[P0e,Gf,dX]),HE=Gf(),bX=dX(),[I0e,cm]=lm(y0),[O0e,_0]=lm(y0),xX=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=e,a=HE(t),[l,u]=_.useState(null),f=_.useRef(!1),h=gl(s),m=ZD(i);return _.useEffect(()=>{const g=()=>{f.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>f.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),c.jsx(PE,{...a,children:c.jsx(I0e,{scope:t,open:n,onOpenChange:h,content:l,onContentChange:u,children:c.jsx(O0e,{scope:t,onClose:_.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:f,dir:m,modal:o,children:r})})})};xX.displayName=y0;var D0e="MenuAnchor",eL=_.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=HE(n);return c.jsx(m0,{...i,...r,ref:t})});eL.displayName=D0e;var tL="MenuPortal",[L0e,yX]=lm(tL,{forceMount:void 0}),_X=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,s=cm(tL,t);return c.jsx(L0e,{scope:t,forceMount:n,children:c.jsx(Ga,{present:n||s.open,children:c.jsx(db,{asChild:!0,container:i,children:r})})})};_X.displayName=tL;var Pa="MenuContent",[$0e,nL]=lm(Pa),SX=_.forwardRef((e,t)=>{const n=yX(Pa,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=cm(Pa,e.__scopeMenu),o=_0(Pa,e.__scopeMenu);return c.jsx(Zy.Provider,{scope:e.__scopeMenu,children:c.jsx(Ga,{present:r||s.open,children:c.jsx(Zy.Slot,{scope:e.__scopeMenu,children:o.modal?c.jsx(B0e,{...i,ref:t}):c.jsx(F0e,{...i,ref:t})})})})}),B0e=_.forwardRef((e,t)=>{const n=cm(Pa,e.__scopeMenu),r=_.useRef(null),i=Un(t,r);return _.useEffect(()=>{const s=r.current;if(s)return NE(s)},[]),c.jsx(rL,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:st(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),F0e=_.forwardRef((e,t)=>{const n=cm(Pa,e.__scopeMenu);return c.jsx(rL,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),z0e=Ip("MenuContent.ScrollLock"),rL=_.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,disableOutsideScroll:v,...x}=e,y=cm(Pa,n),w=_0(Pa,n),C=HE(n),k=bX(n),E=M0e(n),[N,T]=_.useState(null),R=_.useRef(null),M=Un(t,R,y.onContentChange),P=_.useRef(0),B=_.useRef(""),U=_.useRef(0),D=_.useRef(null),$=_.useRef("right"),I=_.useRef(0),V=v?f0:_.Fragment,z=v?{as:z0e,allowPinchZoom:!0}:void 0,H=Y=>{var oe,ge;const F=B.current+Y,O=E().filter(ne=>!ne.disabled),X=document.activeElement,te=(oe=O.find(ne=>ne.ref.current===X))==null?void 0:oe.textValue,ie=O.map(ne=>ne.textValue),ue=Z0e(ie,F,te),se=(ge=O.find(ne=>ne.textValue===ue))==null?void 0:ge.ref.current;(function ne(de){B.current=de,window.clearTimeout(P.current),de!==""&&(P.current=window.setTimeout(()=>ne(""),1e3))})(F),se&&setTimeout(()=>se.focus())};_.useEffect(()=>()=>window.clearTimeout(P.current),[]),kE();const W=_.useCallback(Y=>{var O,X;return $.current===((O=D.current)==null?void 0:O.side)&&tSe(Y,(X=D.current)==null?void 0:X.area)},[]);return c.jsx($0e,{scope:n,searchRef:B,onItemEnter:_.useCallback(Y=>{W(Y)&&Y.preventDefault()},[W]),onItemLeave:_.useCallback(Y=>{var F;W(Y)||((F=R.current)==null||F.focus(),T(null))},[W]),onTriggerLeave:_.useCallback(Y=>{W(Y)&&Y.preventDefault()},[W]),pointerGraceTimerRef:U,onPointerGraceIntentChange:_.useCallback(Y=>{D.current=Y},[]),children:c.jsx(V,{...z,children:c.jsx(d0,{asChild:!0,trapped:i,onMountAutoFocus:st(s,Y=>{var F;Y.preventDefault(),(F=R.current)==null||F.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:c.jsx(ub,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:c.jsx(E0e,{asChild:!0,...k,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:N,onCurrentTabStopIdChange:T,onEntryFocus:st(l,Y=>{w.isUsingKeyboardRef.current||Y.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(IE,{role:"menu","aria-orientation":"vertical","data-state":$X(y.open),"data-radix-menu-content":"",dir:w.dir,...C,...x,ref:M,style:{outline:"none",...x.style},onKeyDown:st(x.onKeyDown,Y=>{const O=Y.target.closest("[data-radix-menu-content]")===Y.currentTarget,X=Y.ctrlKey||Y.altKey||Y.metaKey,te=Y.key.length===1;O&&(Y.key==="Tab"&&Y.preventDefault(),!X&&te&&H(Y.key));const ie=R.current;if(Y.target!==ie||!A0e.includes(Y.key))return;Y.preventDefault();const se=E().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);gX.includes(Y.key)&&se.reverse(),Q0e(se)}),onBlur:st(e.onBlur,Y=>{Y.currentTarget.contains(Y.target)||(window.clearTimeout(P.current),B.current="")}),onPointerMove:st(e.onPointerMove,e_(Y=>{const F=Y.target,O=I.current!==Y.clientX;if(Y.currentTarget.contains(F)&&O){const X=Y.clientX>I.current?"right":"left";$.current=X,I.current=Y.clientX}}))})})})})})})});SX.displayName=Pa;var U0e="MenuGroup",iL=_.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(wn.div,{role:"group",...r,ref:t})});iL.displayName=U0e;var H0e="MenuLabel",wX=_.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(wn.div,{...r,ref:t})});wX.displayName=H0e;var q1="MenuItem",M6="menu.itemSelect",WE=_.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,s=_.useRef(null),o=_0(q1,e.__scopeMenu),a=nL(q1,e.__scopeMenu),l=Un(t,s),u=_.useRef(!1),f=()=>{const h=s.current;if(!n&&h){const m=new CustomEvent(M6,{bubbles:!0,cancelable:!0});h.addEventListener(M6,g=>r==null?void 0:r(g),{once:!0}),Oq(h,m),m.defaultPrevented?u.current=!1:o.onClose()}};return c.jsx(CX,{...i,ref:l,disabled:n,onClick:st(e.onClick,f),onPointerDown:h=>{var m;(m=e.onPointerDown)==null||m.call(e,h),u.current=!0},onPointerUp:st(e.onPointerUp,h=>{var m;u.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:st(e.onKeyDown,h=>{const m=a.searchRef.current!=="";n||m&&h.key===" "||_M.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});WE.displayName=q1;var CX=_.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=e,o=nL(q1,n),a=bX(n),l=_.useRef(null),u=Un(t,l),[f,h]=_.useState(!1),[m,g]=_.useState("");return _.useEffect(()=>{const v=l.current;v&&g((v.textContent??"").trim())},[s.children]),c.jsx(Zy.ItemSlot,{scope:n,disabled:r,textValue:i??m,children:c.jsx(N0e,{asChild:!0,...a,focusable:!r,children:c.jsx(wn.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:st(e.onPointerMove,e_(v=>{r?o.onItemLeave(v):(o.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:st(e.onPointerLeave,e_(v=>o.onItemLeave(v))),onFocus:st(e.onFocus,()=>h(!0)),onBlur:st(e.onBlur,()=>h(!1))})})})}),W0e="MenuCheckboxItem",kX=_.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return c.jsx(jX,{scope:e.__scopeMenu,checked:n,children:c.jsx(WE,{role:"menuitemcheckbox","aria-checked":Y1(n)?"mixed":n,...i,ref:t,"data-state":oL(n),onSelect:st(i.onSelect,()=>r==null?void 0:r(Y1(n)?!0:!n),{checkForDefaultPrevented:!1})})})});kX.displayName=W0e;var EX="MenuRadioGroup",[V0e,K0e]=lm(EX,{value:void 0,onValueChange:()=>{}}),NX=_.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,s=gl(r);return c.jsx(V0e,{scope:e.__scopeMenu,value:n,onValueChange:s,children:c.jsx(iL,{...i,ref:t})})});NX.displayName=EX;var TX="MenuRadioItem",AX=_.forwardRef((e,t)=>{const{value:n,...r}=e,i=K0e(TX,e.__scopeMenu),s=n===i.value;return c.jsx(jX,{scope:e.__scopeMenu,checked:s,children:c.jsx(WE,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":oL(s),onSelect:st(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});AX.displayName=TX;var sL="MenuItemIndicator",[jX,G0e]=lm(sL,{checked:!1}),RX=_.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,s=G0e(sL,n);return c.jsx(Ga,{present:r||Y1(s.checked)||s.checked===!0,children:c.jsx(wn.span,{...i,ref:t,"data-state":oL(s.checked)})})});RX.displayName=sL;var q0e="MenuSeparator",MX=_.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(wn.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});MX.displayName=q0e;var Y0e="MenuArrow",PX=_.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=HE(n);return c.jsx(OE,{...i,...r,ref:t})});PX.displayName=Y0e;var X0e="MenuSub",[jet,IX]=lm(X0e),Qx="MenuSubTrigger",OX=_.forwardRef((e,t)=>{const n=cm(Qx,e.__scopeMenu),r=_0(Qx,e.__scopeMenu),i=IX(Qx,e.__scopeMenu),s=nL(Qx,e.__scopeMenu),o=_.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,u={__scopeMenu:e.__scopeMenu},f=_.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return _.useEffect(()=>f,[f]),_.useEffect(()=>{const h=a.current;return()=>{window.clearTimeout(h),l(null)}},[a,l]),c.jsx(eL,{asChild:!0,...u,children:c.jsx(CX,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":$X(n.open),...e,ref:jD(t,i.onTriggerChange),onClick:h=>{var m;(m=e.onClick)==null||m.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:st(e.onPointerMove,e_(h=>{s.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:st(e.onPointerLeave,e_(h=>{var g,v;f();const m=(g=n.content)==null?void 0:g.getBoundingClientRect();if(m){const x=(v=n.content)==null?void 0:v.dataset.side,y=x==="right",w=y?-5:5,C=m[y?"left":"right"],k=m[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:h.clientX+w,y:h.clientY},{x:C,y:m.top},{x:k,y:m.top},{x:k,y:m.bottom},{x:C,y:m.bottom}],side:x}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(h),h.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:st(e.onKeyDown,h=>{var g;const m=s.searchRef.current!=="";e.disabled||m&&h.key===" "||j0e[r.dir].includes(h.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),h.preventDefault())})})})});OX.displayName=Qx;var DX="MenuSubContent",LX=_.forwardRef((e,t)=>{const n=yX(Pa,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=cm(Pa,e.__scopeMenu),o=_0(Pa,e.__scopeMenu),a=IX(DX,e.__scopeMenu),l=_.useRef(null),u=Un(t,l);return c.jsx(Zy.Provider,{scope:e.__scopeMenu,children:c.jsx(Ga,{present:r||s.open,children:c.jsx(Zy.Slot,{scope:e.__scopeMenu,children:c.jsx(rL,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var h;o.isUsingKeyboardRef.current&&((h=l.current)==null||h.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:st(e.onFocusOutside,f=>{f.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:st(e.onEscapeKeyDown,f=>{o.onClose(),f.preventDefault()}),onKeyDown:st(e.onKeyDown,f=>{var g;const h=f.currentTarget.contains(f.target),m=R0e[o.dir].includes(f.key);h&&m&&(s.onOpenChange(!1),(g=a.trigger)==null||g.focus(),f.preventDefault())})})})})})});LX.displayName=DX;function $X(e){return e?"open":"closed"}function Y1(e){return e==="indeterminate"}function oL(e){return Y1(e)?"indeterminate":e?"checked":"unchecked"}function Q0e(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function J0e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Z0e(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let o=J0e(e,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function eSe(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s],l=t[o],u=a.x,f=a.y,h=l.x,m=l.y;f>r!=m>r&&n<(h-u)*(r-f)/(m-f)+u&&(i=!i)}return i}function tSe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return eSe(n,t)}function e_(e){return t=>t.pointerType==="mouse"?e(t):void 0}var nSe=xX,rSe=eL,iSe=_X,sSe=SX,oSe=iL,aSe=wX,lSe=WE,cSe=kX,uSe=NX,dSe=AX,fSe=RX,hSe=MX,pSe=PX,mSe=OX,gSe=LX,aL="ContextMenu",[vSe]=qu(aL,[vX]),io=vX(),[bSe,BX]=vSe(aL),FX=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:s=!0}=e,[o,a]=_.useState(!1),l=io(t),u=gl(r),f=_.useCallback(h=>{a(h),u(h)},[u]);return c.jsx(bSe,{scope:t,open:o,onOpenChange:f,modal:s,children:c.jsx(nSe,{...l,dir:i,open:o,onOpenChange:f,modal:s,children:n})})};FX.displayName=aL;var zX="ContextMenuTrigger",UX=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...i}=e,s=BX(zX,n),o=io(n),a=_.useRef({x:0,y:0}),l=_.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),u=_.useRef(0),f=_.useCallback(()=>window.clearTimeout(u.current),[]),h=m=>{a.current={x:m.clientX,y:m.clientY},s.onOpenChange(!0)};return _.useEffect(()=>f,[f]),_.useEffect(()=>void(r&&f()),[r,f]),c.jsxs(c.Fragment,{children:[c.jsx(rSe,{...o,virtualRef:l}),c.jsx(wn.span,{"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,...i,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:st(e.onContextMenu,m=>{f(),h(m),m.preventDefault()}),onPointerDown:r?e.onPointerDown:st(e.onPointerDown,Cw(m=>{f(),u.current=window.setTimeout(()=>h(m),700)})),onPointerMove:r?e.onPointerMove:st(e.onPointerMove,Cw(f)),onPointerCancel:r?e.onPointerCancel:st(e.onPointerCancel,Cw(f)),onPointerUp:r?e.onPointerUp:st(e.onPointerUp,Cw(f))})]})});UX.displayName=zX;var xSe="ContextMenuPortal",HX=e=>{const{__scopeContextMenu:t,...n}=e,r=io(t);return c.jsx(iSe,{...r,...n})};HX.displayName=xSe;var WX="ContextMenuContent",VX=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=BX(WX,n),s=io(n),o=_.useRef(!1);return c.jsx(sSe,{...s,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{var l;(l=e.onCloseAutoFocus)==null||l.call(e,a),!a.defaultPrevented&&o.current&&a.preventDefault(),o.current=!1},onInteractOutside:a=>{var l;(l=e.onInteractOutside)==null||l.call(e,a),!a.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});VX.displayName=WX;var ySe="ContextMenuGroup",_Se=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(oSe,{...i,...r,ref:t})});_Se.displayName=ySe;var SSe="ContextMenuLabel",wSe=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(aSe,{...i,...r,ref:t})});wSe.displayName=SSe;var CSe="ContextMenuItem",KX=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(lSe,{...i,...r,ref:t})});KX.displayName=CSe;var kSe="ContextMenuCheckboxItem",ESe=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(cSe,{...i,...r,ref:t})});ESe.displayName=kSe;var NSe="ContextMenuRadioGroup",TSe=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(uSe,{...i,...r,ref:t})});TSe.displayName=NSe;var ASe="ContextMenuRadioItem",jSe=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(dSe,{...i,...r,ref:t})});jSe.displayName=ASe;var RSe="ContextMenuItemIndicator",MSe=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(fSe,{...i,...r,ref:t})});MSe.displayName=RSe;var PSe="ContextMenuSeparator",GX=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(hSe,{...i,...r,ref:t})});GX.displayName=PSe;var ISe="ContextMenuArrow",OSe=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(pSe,{...i,...r,ref:t})});OSe.displayName=ISe;var DSe="ContextMenuSubTrigger",LSe=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(mSe,{...i,...r,ref:t})});LSe.displayName=DSe;var $Se="ContextMenuSubContent",BSe=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(gSe,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});BSe.displayName=$Se;function Cw(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var FSe=FX,zSe=UX,USe=HX,qX=VX,YX=KX,XX=GX;const QX=_.createContext(null);function qf({onOpenChange:e,...t}){const[n,r]=_.useState(0),i=_.useCallback(()=>{r(s=>s+1),e==null||e(!1)},[e]);return c.jsx(QX.Provider,{value:i,children:c.jsx(FSe,{onOpenChange:e,...t},n)})}const Yf=zSe,Xu=_.forwardRef(({className:e,...t},n)=>c.jsx(USe,{children:c.jsx(qX,{ref:n,className:ce("z-50 min-w-[170px] overflow-hidden rounded-xl border border-border bg-background p-1 shadow-lg outline-hidden animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e),...t})}));Xu.displayName=qX.displayName;const Xn=_.forwardRef(({className:e,onSelect:t,...n},r)=>{const i=_.useContext(QX);return c.jsx(YX,{ref:r,className:ce("relative flex cursor-default select-none items-center gap-2.5 rounded-lg px-3 py-2 text-xs font-medium text-foreground outline-hidden transition-colors hover:bg-muted focus:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),onSelect:s=>{t==null||t(s),i==null||i()},...n})});Xn.displayName=YX.displayName;const VE=_.forwardRef(({className:e,...t},n)=>c.jsx(XX,{ref:n,className:ce("-mx-1 my-1 h-px bg-border",e),...t}));VE.displayName=XX.displayName;var KE="Popover",[JX]=qu(KE,[Gf]),S0=Gf(),[HSe,Xf]=JX(KE),ZX=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=e,a=S0(t),l=_.useRef(null),[u,f]=_.useState(!1),[h,m]=Rv({prop:r,defaultProp:i??!1,onChange:s,caller:KE});return c.jsx(PE,{...a,children:c.jsx(HSe,{scope:t,contentId:ku(),triggerRef:l,open:h,onOpenChange:m,onOpenToggle:_.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:u,onCustomAnchorAdd:_.useCallback(()=>f(!0),[]),onCustomAnchorRemove:_.useCallback(()=>f(!1),[]),modal:o,children:n})})};ZX.displayName=KE;var eQ="PopoverAnchor",WSe=_.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Xf(eQ,n),s=S0(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=i;return _.useEffect(()=>(o(),()=>a()),[o,a]),c.jsx(m0,{...s,...r,ref:t})});WSe.displayName=eQ;var tQ="PopoverTrigger",nQ=_.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Xf(tQ,n),s=S0(n),o=Un(t,i.triggerRef),a=c.jsx(wn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":aQ(i.open),...r,ref:o,onClick:st(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:c.jsx(m0,{asChild:!0,...s,children:a})});nQ.displayName=tQ;var lL="PopoverPortal",[VSe,KSe]=JX(lL,{forceMount:void 0}),rQ=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,s=Xf(lL,t);return c.jsx(VSe,{scope:t,forceMount:n,children:c.jsx(Ga,{present:n||s.open,children:c.jsx(db,{asChild:!0,container:i,children:r})})})};rQ.displayName=lL;var Iv="PopoverContent",iQ=_.forwardRef((e,t)=>{const n=KSe(Iv,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,s=Xf(Iv,e.__scopePopover);return c.jsx(Ga,{present:r||s.open,children:s.modal?c.jsx(qSe,{...i,ref:t}):c.jsx(YSe,{...i,ref:t})})});iQ.displayName=Iv;var GSe=Ip("PopoverContent.RemoveScroll"),qSe=_.forwardRef((e,t)=>{const n=Xf(Iv,e.__scopePopover),r=_.useRef(null),i=Un(t,r),s=_.useRef(!1);return _.useEffect(()=>{const o=r.current;if(o)return NE(o)},[]),c.jsx(f0,{as:GSe,allowPinchZoom:!0,children:c.jsx(sQ,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:st(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:st(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,u=a.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:st(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),YSe=_.forwardRef((e,t)=>{const n=Xf(Iv,e.__scopePopover),r=_.useRef(!1),i=_.useRef(!1);return c.jsx(sQ,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),sQ=_.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:f,...h}=e,m=Xf(Iv,n),g=S0(n);return kE(),c.jsx(d0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:c.jsx(ub,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:c.jsx(IE,{"data-state":aQ(m.open),role:"dialog",id:m.contentId,...g,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),oQ="PopoverClose",XSe=_.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Xf(oQ,n);return c.jsx(wn.button,{type:"button",...r,ref:t,onClick:st(e.onClick,()=>i.onOpenChange(!1))})});XSe.displayName=oQ;var QSe="PopoverArrow",JSe=_.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=S0(n);return c.jsx(OE,{...i,...r,ref:t})});JSe.displayName=QSe;function aQ(e){return e?"open":"closed"}var ZSe=ZX,ewe=nQ,twe=rQ,lQ=iQ;const _c=ZSe,Sc=ewe,Nl=_.forwardRef(({className:e,align:t="center",sideOffset:n=4,ports:r={},...i},s)=>{const o=r.dom??Et;return c.jsx(twe,{children:c.jsx(lQ,{ref:s,align:t,sideOffset:n,[z1]:"",onCloseAutoFocus:a=>{var l;a.preventDefault(),o.dispatchCustomWindowEvent(DD),(l=i.onCloseAutoFocus)==null||l.call(i,a)},className:ce("z-50 w-72 rounded-xl border border-border bg-background p-4 shadow-lg outline-hidden animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...i})})});Nl.displayName=lQ.displayName;const SM=Xt("StackActionsPopover",()=>e=>({open:!1,setOpen:t=>e({open:t})}));function nwe({editorLabel:e,onOpenBoards:t,starred:n,onCopyPath:r,onShowArchived:i,onOpenInFinder:s,onOpenInEditor:o,onToggleStar:a,onHide:l,children:u}){return c.jsxs(qf,{children:[c.jsx(Yf,{asChild:!0,children:u}),c.jsxs(Xu,{children:[t?c.jsxs(c.Fragment,{children:[c.jsxs(Xn,{onSelect:f=>{f.stopPropagation(),t()},children:[c.jsx(_E,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Boards"})]}),c.jsx(VE,{})]}):null,c.jsxs(Xn,{onSelect:f=>{f.stopPropagation(),a()},children:[n?c.jsx(Wge,{className:"h-3.5 w-3.5"}):c.jsx(mq,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:n?"Unstar project":"Star project"})]}),c.jsxs(Xn,{onSelect:f=>{f.stopPropagation(),r()},children:[c.jsx(na,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Copy Path"})]}),c.jsxs(Xn,{onSelect:f=>{f.stopPropagation(),i()},children:[c.jsx(bD,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Show Archived"})]}),c.jsxs(Xn,{onSelect:f=>{f.stopPropagation(),s()},children:[c.jsx(yE,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Show in Finder"})]}),c.jsxs(Xn,{onSelect:f=>{f.stopPropagation(),o()},children:[c.jsx(xD,{className:"h-3.5 w-3.5"}),c.jsxs("span",{className:"text-xs font-medium",children:["Open in ",e]})]}),c.jsxs(Xn,{onSelect:f=>{f.stopPropagation(),l()},className:"text-destructive hover:bg-destructive/10 focus:bg-destructive/10",children:[c.jsx(Ape,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Hide"})]})]})]})}function rwe({canFork:e,onRename:t,onOpenInFinder:n,onFork:r,onArchive:i,onDelete:s,onEditPermissions:o,children:a}){return c.jsxs(qf,{children:[c.jsx(Yf,{asChild:!0,children:a}),c.jsxs(Xu,{children:[c.jsxs(Xn,{onSelect:l=>{l.preventDefault(),t()},children:[c.jsx(om,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Rename"})]}),c.jsxs(Xn,{onSelect:l=>{l.preventDefault(),n()},children:[c.jsx(yE,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Open in Finder"})]}),c.jsxs(Xn,{disabled:!e,onSelect:l=>{l.preventDefault(),e&&r()},children:[c.jsx(hq,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Fork"})]}),o?c.jsxs(Xn,{onSelect:l=>{l.preventDefault(),o()},children:[c.jsx(kD,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Permissions…"})]}):null,c.jsxs(Xn,{onSelect:l=>{l.preventDefault(),i()},children:[c.jsx(bD,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Archive"})]}),c.jsxs(Xn,{onSelect:l=>{l.preventDefault(),s()},className:"text-destructive dark:text-red-400 hover:bg-destructive/10 focus:bg-destructive/10 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",children:[c.jsx(xc,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Delete"})]})]})]})}function iwe({stackTitle:e,onOpenBoards:t,onRename:n,onEditMembers:r,onDelete:i,children:s}){const o=SM.useScopedStore(u=>u.open),a=SM.useScopedStore(u=>u.setOpen);function l(u){return()=>{a(!1),u()}}return c.jsxs(_c,{open:o,onOpenChange:a,children:[c.jsx(Sc,{asChild:!0,children:s}),c.jsxs(Nl,{align:"end",sideOffset:4,className:"w-44 p-1",role:"menu","aria-label":`Actions for ${e}`,children:[t?c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",role:"menuitem",onClick:l(t),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs font-medium hover:bg-muted focus-visible:bg-muted outline-hidden",children:[c.jsx(_E,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Boards"})]}),c.jsx("div",{className:"my-1 h-px bg-border"})]}):null,c.jsxs("button",{type:"button",role:"menuitem",onClick:l(n),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs font-medium hover:bg-muted focus-visible:bg-muted outline-hidden",children:[c.jsx(om,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Rename"})]}),c.jsxs("button",{type:"button",role:"menuitem",onClick:l(r),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs font-medium hover:bg-muted focus-visible:bg-muted outline-hidden",children:[c.jsx(vq,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Edit members"})]}),c.jsxs("button",{type:"button",role:"menuitem",onClick:l(i),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs font-medium text-destructive dark:text-red-400 hover:bg-destructive/10 focus-visible:bg-destructive/10 dark:hover:bg-red-500/20 dark:focus-visible:bg-red-500/20 outline-hidden",children:[c.jsx(xc,{className:"h-3.5 w-3.5"}),c.jsxs("span",{children:["Delete ",e]})]})]})]})}function swe({stackTitle:e,onOpenBoards:t,onRename:n,onEditMembers:r,onDelete:i,children:s}){return c.jsx(SM.Provider,{init:{},children:c.jsx(iwe,{stackTitle:e,onOpenBoards:t,onRename:n,onEditMembers:r,onDelete:i,children:s})})}function owe({stackTitle:e,onOpenBoards:t,onRename:n,onEditMembers:r,onDelete:i,children:s}){return c.jsxs(qf,{children:[c.jsx(Yf,{asChild:!0,children:s}),c.jsxs(Xu,{children:[t?c.jsxs(c.Fragment,{children:[c.jsxs(Xn,{onSelect:o=>{o.stopPropagation(),t()},children:[c.jsx(_E,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Boards"})]}),c.jsx(VE,{})]}):null,c.jsxs(Xn,{onSelect:o=>{o.preventDefault(),n()},children:[c.jsx(om,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Rename"})]}),c.jsxs(Xn,{onSelect:o=>{o.preventDefault(),r()},children:[c.jsx(vq,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Edit members"})]}),c.jsxs(Xn,{onSelect:o=>{o.preventDefault(),i()},className:"text-destructive dark:text-red-400 hover:bg-destructive/10 focus:bg-destructive/10 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",children:[c.jsx(xc,{className:"h-3.5 w-3.5"}),c.jsxs("span",{className:"text-xs font-medium",children:["Delete ",e]})]})]})]})}function awe({chat:e,activeChatId:t,nowMs:n,shortcutHint:r=null,showShortcutHint:i=!1,onSelectChat:s,onRenameChat:o,onOpenInFinder:a,onForkChat:l,onArchiveChat:u,onDeleteChat:f,onEditPermissions:h,silent:m=!1}){var R;const g=(e.status==="running"||e.status==="waiting_for_user")&&e.stateEnteredAt!=null,v=g&&e.stateEnteredAt!=null?`${kf(e.status)} ${Pu(n-e.stateEnteredAt)}`:xo(n-(e.lastMessageAt??e._creationTime)),x=i&&r?r:v,y=i&&!!r,w=rbe(e.chatId),C=t===w,k=((R=zE(e))==null?void 0:R.tone)??null,E=e.canFork?"min-w-12":"min-w-6";let N=null;x&&(y?N=c.jsx("span",{className:"hidden md:flex items-center justify-end pr-0.5 text-11 text-foreground transition-opacity duration-150 group-hover:opacity-0",children:c.jsx(XY,{className:"h-4 min-w-4 rounded-sm border-border/50 bg-transparent px-1 text-10",children:r})}):N=c.jsx("span",{className:ce("hidden md:flex items-center justify-end pr-1 text-11 tabular-nums transition-opacity duration-150 group-hover:opacity-0 whitespace-nowrap",g?lX(k):"text-muted-foreground"),children:x}));const T=c.jsxs("div",{"data-chat-id":w,className:ce("group flex items-center gap-2 pl-2 pr-1 py-1.5 rounded-md cursor-pointer transition-colors duration-150",C?"bg-muted":"hover:bg-muted/40"),onClick:()=>s(e.chatId),children:[c.jsx("span",{className:"relative flex h-3.5 w-3.5 shrink-0 items-center justify-center","aria-hidden":!0,children:k?c.jsx("span",{className:ce("h-2 w-2 rounded-full",UE(k))}):null}),(()=>{const M=cX(e.sessionState);return M?c.jsx(ia,{label:M.title,children:c.jsx("span",{className:ce("shrink-0 text-10 leading-none",M.toneClass),"aria-label":M.title,children:M.glyph})}):null})(),e.hasPolicyOverride?c.jsx(kD,{className:"size-3 shrink-0 text-warning","aria-label":"Per-chat permission override active"}):null,c.jsx("span",{className:ce("truncate flex-1 text-sm",C?"text-foreground font-medium":"text-foreground/90",e.status==="idle"&&!e.unread&&!C?"text-muted-foreground":""),children:e.title}),c.jsxs("div",{className:ce("relative flex items-center justify-end gap-1.5 h-6 shrink-0",E),children:[m?c.jsx(XG,{className:ce("size-3 shrink-0 text-muted-foreground transition-opacity duration-150",x?"group-hover:opacity-0":""),"aria-label":"Silenced"}):null,N,c.jsxs("div",{className:ce("absolute inset-0 flex items-center justify-end gap-0 transition-opacity duration-150",x?"opacity-100 md:opacity-0 md:group-hover:opacity-100":"opacity-100"),children:[e.canFork?c.jsx(Ee,{variant:"ghost",size:"icon",className:"h-6 w-6 cursor-pointer rounded-sm hover:!bg-transparent !border-0",onClick:M=>{M.stopPropagation(),l(e.chatId)},title:"Fork chat",children:c.jsx(hq,{className:"size-3.5"})}):null,c.jsx(Ee,{variant:"ghost",size:"icon",className:"h-6 w-6 cursor-pointer rounded-sm hover:!bg-transparent !border-0",onClick:M=>{M.stopPropagation(),u(e.chatId)},title:"Archive chat",children:c.jsx(bD,{className:"size-3.5"})})]})]})]},e._id);return c.jsx(rwe,{canFork:e.canFork,onRename:()=>o(e.chatId),onOpenInFinder:()=>a(e.localPath),onFork:()=>l(e.chatId),onArchive:()=>u(e.chatId),onDelete:()=>f(e.chatId),onEditPermissions:h?()=>h(e.chatId):void 0,children:T})}const lwe=_.memo(awe);function cwe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return _.useMemo(()=>r=>{t.forEach(i=>i(r))},t)}const GE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function pb(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function cL(e){return"nodeType"in e}function Ao(e){var t,n;return e?pb(e)?e:cL(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function uL(e){const{Document:t}=Ao(e);return e instanceof t}function w0(e){return pb(e)?!1:e instanceof Ao(e).HTMLElement}function cQ(e){return e instanceof Ao(e).SVGElement}function mb(e){return e?pb(e)?e.document:cL(e)?uL(e)?e:w0(e)||cQ(e)?e.ownerDocument:document:document:document}const fc=GE?_.useLayoutEffect:_.useEffect;function dL(e){const t=_.useRef(e);return fc(()=>{t.current=e}),_.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function uwe(){const e=_.useRef(null),t=_.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=_.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function t_(e,t){t===void 0&&(t=[e]);const n=_.useRef(e);return fc(()=>{n.current!==e&&(n.current=e)},t),n}function C0(e,t){const n=_.useRef();return _.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function X1(e){const t=dL(e),n=_.useRef(null),r=_.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function wM(e){const t=_.useRef();return _.useEffect(()=>{t.current=e},[e]),t.current}let RA={};function k0(e,t){return _.useMemo(()=>{if(t)return t;const n=RA[e]==null?0:RA[e]+1;return RA[e]=n,e+"-"+n},[e,t])}function uQ(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((s,o)=>{const a=Object.entries(o);for(const[l,u]of a){const f=s[l];f!=null&&(s[l]=f+e*u)}return s},{...t})}}const Jg=uQ(1),Q1=uQ(-1);function dwe(e){return"clientX"in e&&"clientY"in e}function fL(e){if(!e)return!1;const{KeyboardEvent:t}=Ao(e.target);return t&&e instanceof t}function fwe(e){if(!e)return!1;const{TouchEvent:t}=Ao(e.target);return t&&e instanceof t}function CM(e){if(fwe(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return dwe(e)?{x:e.clientX,y:e.clientY}:null}const n_=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[n_.Translate.toString(e),n_.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),P6="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function hwe(e){return e.matches(P6)?e:e.querySelector(P6)}const pwe={display:"none"};function mwe(e){let{id:t,value:n}=e;return Dn.createElement("div",{id:t,style:pwe},n)}function gwe(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Dn.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function vwe(){const[e,t]=_.useState("");return{announce:_.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const dQ=_.createContext(null);function bwe(e){const t=_.useContext(dQ);_.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function xwe(){const[e]=_.useState(()=>new Set),t=_.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[_.useCallback(r=>{let{type:i,event:s}=r;e.forEach(o=>{var a;return(a=o[i])==null?void 0:a.call(o,s)})},[e]),t]}const ywe={draggable:`
831
+ `)&&(w.writePathDeny=y),Object.keys(w).length===0?null:w}function g(){r(m())}function v(){r(null)}return c.jsxs(c.Fragment,{children:[c.jsx(La,{open:e,onOpenChange:x=>{x||i()},children:c.jsxs(ra,{className:"max-w-2xl",children:[c.jsxs($a,{children:["Permissions — ",t]}),c.jsxs(vl,{className:"space-y-5",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"text-sm font-medium",children:"Default action"}),c.jsxs("div",{className:"text-xs text-muted-foreground",children:["Behaviour when a tool call has no explicit allow/deny rule. ",c.jsx("strong",{children:"auto-allow"})," bypasses prompts and runs untrusted shell commands without supervision — use a worktree."]}),c.jsx(Ji,{value:s,onValueChange:h,options:[{value:"ask",label:"Ask"},{value:"auto-allow",label:"Auto-allow (unsafe)"},{value:"auto-deny",label:"Auto-deny"}]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"text-sm font-medium",children:"Read-path deny list"}),c.jsx("div",{className:"text-xs text-muted-foreground",children:"One glob per line. The model cannot read paths matching any entry. Defaults shown below — edit to add or remove."}),c.jsx("textarea",{value:o,onChange:x=>f.getState().setReadDenyText(x.target.value),rows:8,className:"w-full rounded-md border border-border bg-background px-3 py-2 font-mono text-xs",spellCheck:!1})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"text-sm font-medium",children:"Write-path deny list"}),c.jsx("div",{className:"text-xs text-muted-foreground",children:"One glob per line. The model cannot edit or write paths matching any entry."}),c.jsx("textarea",{value:a,onChange:x=>f.getState().setWriteDenyText(x.target.value),rows:8,className:"w-full rounded-md border border-border bg-background px-3 py-2 font-mono text-xs",spellCheck:!1})]})]}),c.jsxs(ju,{className:"justify-between",children:[c.jsx(Ee,{variant:"ghost",onClick:v,children:"Reset to defaults"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Ee,{variant:"ghost",onClick:i,children:"Cancel"}),c.jsx(Ee,{onClick:g,children:"Apply"})]})]})]})}),c.jsx(La,{open:l,onOpenChange:x=>{x||(f.getState().setConfirmUnsafeOpen(!1),f.getState().setPendingDefaultAction(null))},children:c.jsxs(ra,{className:"max-w-md",children:[c.jsx($a,{children:"Enable auto-allow for this chat?"}),c.jsxs(vl,{className:"space-y-3 text-sm",children:[c.jsx("p",{children:"Auto-allow disables tool-call prompts. The model can run shell commands, write files, and edit code without asking. Read/write deny lists still apply."}),c.jsx("p",{className:"text-warning",children:"Use a worktree for risky tasks."})]}),c.jsxs(ju,{className:"justify-end gap-2",children:[c.jsx(Ee,{variant:"ghost",onClick:()=>{f.getState().setConfirmUnsafeOpen(!1),f.getState().setPendingDefaultAction(null)},children:"Cancel"}),c.jsx(Ee,{variant:"destructive",onClick:()=>{const x=f.getState();u&&x.setDefaultAction(u),x.setConfirmUnsafeOpen(!1),x.setPendingDefaultAction(null)},children:"Enable auto-allow"})]})]})})]})}const w_e={defaultAction:"ask",bash:{autoAllowVerbs:["ls","pwd","git status","git diff","git log"]},readPathDeny:["~/.ssh","~/.aws","~/.gcp","~/.config/gh","~/.claude","~/.kanna","~/Library/Keychains","/etc/shadow","/etc/sudoers","~/.gnupg","~/.gitconfig","**/.git/config","~/.npmrc","~/.netrc","~/.docker/config.json","**/.env","**/.env.*","**/credentials*","**/*.pem","**/*.key","**/id_rsa*","**/id_ed25519*"],writePathDeny:["/etc/**","/usr/**","/System/**","~/.ssh/**","~/.aws/**","~/.config/gh/**","~/.claude/**","~/.kanna/**","~/.gnupg/**","~/.gitconfig","**/.git/config"],toolDenyList:[{tool:"mcp__kanna__bash",pattern:"rm\\s+-rf\\s+(/|~|\\$HOME)(?:\\b|$|\\s)"},{tool:"mcp__kanna__bash",pattern:"git\\s+push\\b.*--force"}],toolAllowList:[]},Jn={setTimeout(e,t){return window.setTimeout(e,t)},clearTimeout(e){window.clearTimeout(e)},setInterval(e,t){return window.setInterval(e,t)},clearInterval(e){window.clearInterval(e)},requestAnimationFrame(e){return window.requestAnimationFrame(e)},cancelAnimationFrame(e){window.cancelAnimationFrame(e)}},Bt=_.forwardRef(({className:e,type:t,...n},r)=>c.jsx("input",{ref:r,type:t,className:ce("flex w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e),...n}));Bt.displayName="Input";const JY=_.createContext(null);function C_e({children:e,ports:t={}}){const n=t.timer??Jn,[r,i]=_.useState(null),[s,o]=_.useState(""),a=_.useRef(null);_.useEffect(()=>{(r==null?void 0:r.kind)==="prompt"&&(o(r.options.initialValue??""),n.setTimeout(()=>{var y,w;(y=a.current)==null||y.focus(),(w=a.current)==null||w.select()},0))},[r,n]);const l=_.useCallback(()=>{i(null),o("")},[]),u=_.useCallback(()=>{r&&(r.kind==="confirm"?r.resolve(!1):r.kind==="prompt"?r.resolve(null):r.resolve(),l())},[l,r]),f=_.useCallback(()=>{r&&(r.kind==="confirm"?r.resolve(!0):r.kind==="prompt"?r.resolve(s.trim()||null):r.resolve(),l())},[l,r,s]),h=_.useCallback(y=>new Promise(w=>{i({kind:"confirm",options:y,resolve:w})}),[]),m=_.useCallback(y=>new Promise(w=>{i({kind:"prompt",options:y,resolve:w})}),[]),g=_.useCallback(y=>new Promise(w=>{i({kind:"alert",options:y,resolve:w})}),[]),v=_.useMemo(()=>({confirm:h,prompt:m,alert:g}),[g,h,m]);let x="Confirm";return r&&(r.kind==="alert"?x=r.options.closeLabel??"OK":"confirmLabel"in r.options&&(x=r.options.confirmLabel??"Confirm")),c.jsxs(JY.Provider,{value:v,children:[e,c.jsx(La,{open:r!==null,onOpenChange:y=>{y||!r||u()},children:c.jsx(ra,{size:"sm",onKeyDown:y=>{y.key!=="Enter"||y.shiftKey||!r||r.kind!=="confirm"||(y.preventDefault(),f())},children:r?c.jsxs(c.Fragment,{children:[c.jsxs(vl,{className:"space-y-4",children:[c.jsx($a,{children:r.options.title}),r.options.description?c.jsx(h0,{children:r.options.description}):null,r.kind==="prompt"?c.jsx(Bt,{ref:a,type:"text",value:s,onChange:y=>o(y.target.value),onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),f())},placeholder:r.options.placeholder}):null]}),c.jsxs(ju,{children:[c.jsx(Ee,{variant:"ghost",size:"sm",onClick:u,className:r.kind==="alert"?"hidden":void 0,children:"cancelLabel"in r.options?r.options.cancelLabel??"Cancel":"Cancel"}),c.jsx(Ee,{variant:r.kind==="confirm"?r.options.confirmVariant??"default":"secondary",size:"sm",onClick:f,disabled:r.kind==="prompt"&&!s.trim(),children:x})]})]}):null})})]})}function $E(){const e=_.useContext(JY);if(!e)throw new Error("useAppDialog must be used within AppDialogProvider");return e}const qD=_.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ce("bg-card text-card-foreground",e),...t}));qD.displayName="Card";const YD=_.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ce("flex flex-col space-y-1.5 p-2",e),...t}));YD.displayName="CardHeader";const ZY=_.forwardRef(({className:e,...t},n)=>c.jsx("h3",{ref:n,className:ce("text-2xl font-semibold leading-none tracking-tight",e),...t}));ZY.displayName="CardTitle";const eX=_.forwardRef(({className:e,...t},n)=>c.jsx("p",{ref:n,className:ce("text-sm text-muted-foreground",e),...t}));eX.displayName="CardDescription";const XD=_.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ce("p-6 pt-0",e),...t}));XD.displayName="CardContent";const k_e=_.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ce("flex items-center p-6 pt-0",e),...t}));k_e.displayName="CardFooter";const E_e={info:{dotVar:"var(--info)",bgClass:"bg-info/[0.06]"},warning:{dotVar:"var(--warning)",bgClass:"bg-warning/[0.06]"},success:{dotVar:"var(--success)",bgClass:"bg-success/[0.06]"},error:{dotVar:"var(--destructive)",bgClass:"bg-destructive/[0.06]"}};function N_e({variant:e,children:t,dot:n=!0,className:r}){const i=E_e[e];return c.jsxs("div",{role:"status",className:ce("flex flex-wrap items-center justify-center gap-x-2 gap-y-1 border-b border-border px-4 py-2 text-xs leading-tight",i.bgClass,r),children:[n?c.jsx("span",{"aria-hidden":"true",className:"inline-block size-1.5 shrink-0 rounded-full",style:{backgroundColor:i.dotVar}}):null,t]})}const T_e="modulepreload",A_e=function(e){return"/"+e},T6={},Z=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let o=function(u){return Promise.all(u.map(f=>Promise.resolve(f).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=o(n.map(u=>{if(u=A_e(u),u in T6)return;T6[u]=!0;const f=u.endsWith(".css"),h=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${h}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":T_e,f||(m.as="script"),m.crossOrigin="",m.href=u,l&&m.setAttribute("nonce",l),document.head.appendChild(m),f)return new Promise((g,v)=>{m.addEventListener("load",g),m.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})},j_e=_.lazy(()=>Z(()=>import("./index-B_CVPOY8.js"),[]).then(e=>({default:e.Toaster})));function R_e(){return c.jsx(_.Suspense,{fallback:null,children:c.jsx(j_e,{position:"bottom-right",theme:"system",closeButton:!0,duration:6e3})})}const M_e="1.41.3",P_e={version:M_e},Vr="Kanna",A6="kanna",I_e=".kanna",O_e=".kanna-dev",D_e="KANNA_RUNTIME_PROFILE",QD=`kanna/${P_e.version}`,L_e="[kanna]",$_e=`~/${Vr}`;function BE(){const e=Reflect.get(globalThis,"process");return e==null?void 0:e.env}function B_e(e=BE()){var t;return((t=e==null?void 0:e[D_e])==null?void 0:t.trim().toLowerCase())==="dev"?"dev":"prod"}function F_e(e=BE()){return B_e(e)==="dev"?O_e:I_e}function z_e(e=BE()){return`~/${F_e(e)}`}function U_e(e=BE()){return`${z_e(e)}/keybindings.json`}function ww(e){return e?`${A6} ${e}`:A6}const tX="always",nX="funk",H_e=[{value:"blow",label:"Blow"},{value:"bottle",label:"Bottle"},{value:"frog",label:"Frog"},{value:"funk",label:"Funk"},{value:"glass",label:"Glass"},{value:"ping",label:"Ping"},{value:"pop",label:"Pop"},{value:"purr",label:"Purr"},{value:"tink",label:"Tink"}];function W_e(e){switch(e){case"never":case"unfocused":case"always":return e;default:return tX}}function V_e(e){switch(e){case"blow":case"bottle":case"frog":case"funk":case"glass":case"ping":case"pop":case"purr":case"tink":return e;default:return nX}}const np=Yt()(e=>({chatSoundPreference:tX,chatSoundId:nX,setChatSoundPreference:t=>e({chatSoundPreference:W_e(t)}),setChatSoundId:t=>e({chatSoundId:V_e(t)})})),K_e={blow:"/chat-sounds/Blow.mp3",bottle:"/chat-sounds/Bottle.mp3",frog:"/chat-sounds/Frog.mp3",funk:"/chat-sounds/Funk.mp3",glass:"/chat-sounds/Glass.mp3",ping:"/chat-sounds/Ping.mp3",pop:"/chat-sounds/Pop.mp3",purr:"/chat-sounds/Purr.mp3",tink:"/chat-sounds/Tink.mp3"};function G_e(e=Et){return e.getVisibilityState()!=="visible"||!e.hasFocus()}function q_e(e){const t=new Audio(K_e[e]);return t.preload="auto",t.play()}async function vM(e,t,n=Jn){if(t<=0)return;const r=Array.from({length:t},(i,s)=>new Promise(o=>{n.setTimeout(()=>{q_e(e).catch(()=>{}).finally(()=>o())},s*90)}));await Promise.all(r)}function Y_e(e,t=Et){return e==="never"?!1:e==="always"?!0:G_e(t)}function X_e(e){return e.projectGroups.reduce((t,n)=>t+n.chats.reduce((r,i)=>r+(i.unread?1:0)+(i.status==="waiting_for_user"?1:0),0),0)}function j6(e){let t=0;const n=new Set;for(const r of e.projectGroups)for(const i of r.chats)i.unread&&(t+=1),i.status==="waiting_for_user"&&n.add(i.chatId);return{unreadCount:t,waitingChatIds:n}}function Q_e(e,t){if(!e)return 0;const n=j6(e),r=j6(t),i=Math.max(0,r.unreadCount-n.unreadCount);let s=0;for(const o of r.waitingChatIds)n.waitingChatIds.has(o)||(s+=1);return i+s}const rX="h-[var(--shell-top-band)] max-h-[var(--shell-top-band)]",J_e="md:my-2 md:mr-2 md:rounded-2xl md:border md:border-border",Z_e="flex min-h-0 flex-1 flex-col overflow-y-auto";function hu({tooltip:e,children:t,className:n,inline:r=!1,side:i}){const s=ce("truncate",n);return c.jsx(v0,{children:c.jsxs(gi,{children:[c.jsx(vi,{asChild:!0,children:r?c.jsx("span",{className:s,children:t}):c.jsx("div",{className:s,children:t})}),c.jsx(si,{side:i,children:e})]})})}function ia({label:e,children:t,side:n}){return c.jsx(v0,{children:c.jsxs(gi,{children:[c.jsx(vi,{asChild:!0,children:t}),c.jsx(si,{side:n,children:e})]})})}const e0e=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi;function t0e(e){const t=e.match(e0e);return!t||t.length===0?null:t[t.length-1].toLowerCase()}function n0e(e){const t=[];for(const n of e.split(/[\s,]+/)){if(!n)continue;const r=t0e(n);r&&!t.includes(r)&&t.push(r)}return t}const bM=Yt()(e=>({text:"",setText:t=>e({text:t}),resetForOpen:()=>e({text:""})})),r0e=()=>bM(e=>e.text),Ma=_.forwardRef(({className:e,...t},n)=>c.jsx("textarea",{"data-gramm":"false","data-gramm_editor":"false","data-enable-grammarly":"false","data-1p-ignore":!0,autoComplete:"off",className:ce("flex w-full rounded-lg border border-border bg-background px-2.5 py-2 text-sm placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Ma.displayName="Textarea";function i0e({open:e,busy:t,onClose:n,onImportAll:r,onImportSessions:i}){const s=r0e(),o=bM(m=>m.setText),a=bM(m=>m.resetForOpen);_.useEffect(()=>{e&&a()},[e,a]);const l=_.useMemo(()=>n0e(s),[s]),f=s.trim().length>0&&l.length===0,h=()=>{l.length===0||t||i(l)};return c.jsx(La,{open:e,onOpenChange:m=>{m||n()},children:c.jsxs(ra,{size:"sm",children:[c.jsxs(vl,{className:"space-y-3",children:[c.jsx($a,{children:"Import Claude sessions"}),c.jsx(Ma,{value:s,onChange:m=>o(m.target.value),placeholder:"Paste one or more session ids (uuid, filename, or full path)…",rows:4}),f?c.jsx("p",{className:"text-xs text-destructive",children:"No valid session id found in the pasted text."}):null,c.jsx("p",{className:"text-xs text-muted-foreground",children:"Empty input imports ALL sessions (full scan). Active sessions import as a live view — sending a message there takes over the session."})]}),c.jsxs(ju,{children:[c.jsx(Ee,{variant:"ghost",size:"sm",onClick:n,disabled:t,children:"Cancel"}),c.jsx(Ee,{variant:"ghost",size:"sm",onClick:r,disabled:t,children:"Import all"}),c.jsxs(Ee,{variant:"secondary",size:"sm",onClick:h,disabled:l.length===0||t,children:["Import ",l.length===1?"session":"sessions"]})]})]})})}function xM(e){return e.split(/[\s_-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const s0e=[/^(?:\/usr\/bin\/env\s+)?(?:\/bin\/)?(?:bash|zsh|sh)\s+(?:-[a-zA-Z]*c|-c)\s+(['"])([\s\S]*)\1$/,/^(?:\/usr\/bin\/env\s+)?(?:\/bin\/)?(?:bash|zsh|sh)\s+(?:-[a-zA-Z]*c|-c)\s+(.+)$/,/^(?:\/usr\/bin\/env\s+)?(?:cmd(?:\.exe)?)\s+\/c\s+(['"])([\s\S]*)\1$/i,/^(?:\/usr\/bin\/env\s+)?(?:cmd(?:\.exe)?)\s+\/c\s+(.+)$/i,/^(?:\/usr\/bin\/env\s+)?(?:powershell(?:\.exe)?|pwsh)\s+(?:-NoProfile\s+)?-Command\s+(['"])([\s\S]*)\1$/i,/^(?:\/usr\/bin\/env\s+)?(?:powershell(?:\.exe)?|pwsh)\s+(?:-NoProfile\s+)?-Command\s+(.+)$/i];function iX(e){const t=e.trim();for(const n of s0e){const r=t.match(n);if(!r)continue;const i=(r[2]??r[1]??"").trim();if(i)return i}return t}function b0(e){return e.split("/").pop()||e}const o0e=1440*6e4;function a0e(e,t){const n=Math.max(0,t-e),r=Math.floor(n/1e3),i=Math.floor(r/3600),s=Math.floor(r%3600/60),o=r%60;return i>0?`${i}h ${s}m`:s>0?`${s}m ${o}s`:`${o}s`}function l0e(e){const t=new Date(e),n=t.getHours().toString().padStart(2,"0"),r=t.getMinutes().toString().padStart(2,"0");return`${n}:${r}`}function c0e(e,t){if(e===void 0)return null;const n=Math.max(0,t-e),r=6e4,i=60*r,s=o0e,o=7*s;return n<r?"now":n<i?`${Math.floor(n/r)}m`:n<s?`${Math.floor(n/i)}h`:n<o?`${Math.floor(n/s)}d`:`${Math.floor(n/o)}w`}function sX(e,t){return e.length<=t?e:`${e.slice(0,t-1).trimEnd()}…`}const u0e=80;function d0e(e){return sX(e,u0e)}function f0e(e){return e.lastMessageAt??e._creationTime}const FE=1e3,Sy=60*FE,rp=60*Sy,WC=24*rp;function xo(e){const t=Math.max(0,e);if(t<Sy)return`${Math.floor(t/FE)}s`;if(t<rp)return`${Math.floor(t/Sy)}m`;if(t<WC){const i=Math.floor(t/rp),s=Math.floor(t%rp/Sy);return s===0?`${i}h`:`${i}h ${s}m`}const n=Math.floor(t/WC),r=Math.floor(t%WC/rp);return r===0?`${n}d`:`${n}d ${r}h`}function h0e(e){const t=Math.max(0,e),n=Math.ceil(t/FE);if(n<60)return`${String(n)}s`;const r=Math.ceil(t/Sy);if(r<60)return`${String(r)}m`;const i=Math.ceil(t/rp);return i<24?`${String(i)}h`:`${String(Math.ceil(t/WC))}d`}function Pu(e){const t=Math.max(0,e);if(t>=rp)return xo(t);const n=Math.floor(t/FE),r=Math.floor(n/60),i=n%60;return`${r}:${i.toString().padStart(2,"0")}`}function kf(e){switch(e){case"idle":return"Idle";case"starting":return"Starting";case"running":return"Running";case"waiting_for_user":return"Waiting";case"failed":return"Failed"}}function R6(e){switch(e){case"running":return"active";case"waiting_for_user":return"attention";case"failed":return"destructive";case"idle":case"starting":default:return"muted"}}function Jy(e){switch(e){case"active":return"text-emerald-500 dark:text-emerald-400";case"attention":return"text-amber-500 dark:text-amber-400";case"destructive":return"text-destructive";case"muted":default:return"text-muted-foreground"}}function oX(e){switch(e){case"active":return"bg-emerald-500 dark:bg-emerald-400";case"attention":return"bg-amber-500 dark:bg-amber-400";case"destructive":return"bg-destructive";case"muted":default:return"bg-muted-foreground"}}function p0e(e){switch(e){case"running":return"Running";case"completed":return"Completed";case"failed":return"Failed";case"killed":return"Killed";case"unknown":return"Unknown"}}function aX(e){switch(e){case"running":return"active";case"failed":return"destructive";case"killed":return"attention";case"completed":case"unknown":default:return"muted"}}function zE(e){return e.status==="running"||e.status==="starting"?{tone:"warning",label:kf(e.status)}:e.status==="waiting_for_user"?{tone:"info",label:kf(e.status)}:e.status==="failed"?{tone:"destructive",label:kf(e.status)}:e.unread?{tone:"success",label:"Unread"}:null}function UE(e){switch(e){case"warning":return"bg-warning";case"info":return"bg-info";case"success":return"bg-success";case"destructive":return"bg-destructive";case"muted":return"bg-muted-foreground";default:return""}}function lX(e){switch(e){case"warning":return"text-warning";case"info":return"text-info";case"success":return"text-success";case"destructive":return"text-destructive";case"muted":default:return"text-muted-foreground"}}function cX(e){switch(e){case"active":return{glyph:"●",toneClass:"text-success",title:"Claude PTY session active"};case"warming":return{glyph:"◐",toneClass:"text-warning",title:"Claude PTY session warming"};case"idle":return{glyph:"○",toneClass:"text-muted-foreground",title:"Claude PTY session idle"};case"cooling":return{glyph:"◌",toneClass:"text-muted-foreground",title:"Claude PTY session cooling down"};case"cold":default:return null}}function JD(e){const t=e+"CollectionProvider",[n,r]=qu(t),[i,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=x=>{const{scope:y,children:w}=x,C=Dn.useRef(null),k=Dn.useRef(new Map).current;return c.jsx(i,{scope:y,itemMap:k,collectionRef:C,children:w})};o.displayName=t;const a=e+"CollectionSlot",l=Ip(a),u=Dn.forwardRef((x,y)=>{const{scope:w,children:C}=x,k=s(a,w),E=Un(y,k.collectionRef);return c.jsx(l,{ref:E,children:C})});u.displayName=a;const f=e+"CollectionItemSlot",h="data-radix-collection-item",m=Ip(f),g=Dn.forwardRef((x,y)=>{const{scope:w,children:C,...k}=x,E=Dn.useRef(null),N=Un(y,E),T=s(f,w);return Dn.useEffect(()=>(T.itemMap.set(E,{ref:E,...k}),()=>void T.itemMap.delete(E))),c.jsx(m,{[h]:"",ref:N,children:C})});g.displayName=f;function v(x){const y=s(e+"CollectionConsumer",x);return Dn.useCallback(()=>{const C=y.collectionRef.current;if(!C)return[];const k=Array.from(C.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((T,R)=>k.indexOf(T.ref.current)-k.indexOf(R.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:u,ItemSlot:g},v,r]}var m0e=_.createContext(void 0);function ZD(e){const t=_.useContext(m0e);return e||t||"ltr"}var jA="rovingFocusGroup.onEntryFocus",g0e={bubbles:!1,cancelable:!0},x0="RovingFocusGroup",[yM,uX,v0e]=JD(x0),[b0e,dX]=qu(x0,[v0e]),[x0e,y0e]=b0e(x0),fX=_.forwardRef((e,t)=>c.jsx(yM.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(yM.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(_0e,{...e,ref:t})})}));fX.displayName=x0;var _0e=_.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...h}=e,m=_.useRef(null),g=Un(t,m),v=ZD(s),[x,y]=Rv({prop:o,defaultProp:a??null,onChange:l,caller:x0}),[w,C]=_.useState(!1),k=gl(u),E=uX(n),N=_.useRef(!1),[T,R]=_.useState(0);return _.useEffect(()=>{const M=m.current;if(M)return M.addEventListener(jA,k),()=>M.removeEventListener(jA,k)},[k]),c.jsx(x0e,{scope:n,orientation:r,dir:v,loop:i,currentTabStopId:x,onItemFocus:_.useCallback(M=>y(M),[y]),onItemShiftTab:_.useCallback(()=>C(!0),[]),onFocusableItemAdd:_.useCallback(()=>R(M=>M+1),[]),onFocusableItemRemove:_.useCallback(()=>R(M=>M-1),[]),children:c.jsx(wn.div,{tabIndex:w||T===0?-1:0,"data-orientation":r,...h,ref:g,style:{outline:"none",...e.style},onMouseDown:st(e.onMouseDown,()=>{N.current=!0}),onFocus:st(e.onFocus,M=>{const P=!N.current;if(M.target===M.currentTarget&&P&&!w){const B=new CustomEvent(jA,g0e);if(M.currentTarget.dispatchEvent(B),!B.defaultPrevented){const U=E().filter(z=>z.focusable),D=U.find(z=>z.active),$=U.find(z=>z.id===x),V=[D,$,...U].filter(Boolean).map(z=>z.ref.current);mX(V,f)}}N.current=!1}),onBlur:st(e.onBlur,()=>C(!1))})})}),hX="RovingFocusGroupItem",pX=_.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,children:o,...a}=e,l=ku(),u=s||l,f=y0e(hX,n),h=f.currentTabStopId===u,m=uX(n),{onFocusableItemAdd:g,onFocusableItemRemove:v,currentTabStopId:x}=f;return _.useEffect(()=>{if(r)return g(),()=>v()},[r,g,v]),c.jsx(yM.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:c.jsx(wn.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...a,ref:t,onMouseDown:st(e.onMouseDown,y=>{r?f.onItemFocus(u):y.preventDefault()}),onFocus:st(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:st(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const w=C0e(y,f.orientation,f.dir);if(w!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let k=m().filter(E=>E.focusable).map(E=>E.ref.current);if(w==="last")k.reverse();else if(w==="prev"||w==="next"){w==="prev"&&k.reverse();const E=k.indexOf(y.currentTarget);k=f.loop?k0e(k,E+1):k.slice(E+1)}setTimeout(()=>mX(k))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:x!=null}):o})})});pX.displayName=hX;var S0e={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function w0e(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function C0e(e,t,n){const r=w0e(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return S0e[r]}function mX(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function k0e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var E0e=fX,N0e=pX,_M=["Enter"," "],T0e=["ArrowDown","PageUp","Home"],gX=["ArrowUp","PageDown","End"],A0e=[...T0e,...gX],j0e={ltr:[..._M,"ArrowRight"],rtl:[..._M,"ArrowLeft"]},R0e={ltr:["ArrowLeft"],rtl:["ArrowRight"]},y0="Menu",[Zy,M0e,P0e]=JD(y0),[lm,vX]=qu(y0,[P0e,Gf,dX]),HE=Gf(),bX=dX(),[I0e,cm]=lm(y0),[O0e,_0]=lm(y0),xX=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=e,a=HE(t),[l,u]=_.useState(null),f=_.useRef(!1),h=gl(s),m=ZD(i);return _.useEffect(()=>{const g=()=>{f.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>f.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),c.jsx(PE,{...a,children:c.jsx(I0e,{scope:t,open:n,onOpenChange:h,content:l,onContentChange:u,children:c.jsx(O0e,{scope:t,onClose:_.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:f,dir:m,modal:o,children:r})})})};xX.displayName=y0;var D0e="MenuAnchor",eL=_.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=HE(n);return c.jsx(m0,{...i,...r,ref:t})});eL.displayName=D0e;var tL="MenuPortal",[L0e,yX]=lm(tL,{forceMount:void 0}),_X=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,s=cm(tL,t);return c.jsx(L0e,{scope:t,forceMount:n,children:c.jsx(Ga,{present:n||s.open,children:c.jsx(db,{asChild:!0,container:i,children:r})})})};_X.displayName=tL;var Pa="MenuContent",[$0e,nL]=lm(Pa),SX=_.forwardRef((e,t)=>{const n=yX(Pa,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=cm(Pa,e.__scopeMenu),o=_0(Pa,e.__scopeMenu);return c.jsx(Zy.Provider,{scope:e.__scopeMenu,children:c.jsx(Ga,{present:r||s.open,children:c.jsx(Zy.Slot,{scope:e.__scopeMenu,children:o.modal?c.jsx(B0e,{...i,ref:t}):c.jsx(F0e,{...i,ref:t})})})})}),B0e=_.forwardRef((e,t)=>{const n=cm(Pa,e.__scopeMenu),r=_.useRef(null),i=Un(t,r);return _.useEffect(()=>{const s=r.current;if(s)return NE(s)},[]),c.jsx(rL,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:st(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),F0e=_.forwardRef((e,t)=>{const n=cm(Pa,e.__scopeMenu);return c.jsx(rL,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),z0e=Ip("MenuContent.ScrollLock"),rL=_.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,disableOutsideScroll:v,...x}=e,y=cm(Pa,n),w=_0(Pa,n),C=HE(n),k=bX(n),E=M0e(n),[N,T]=_.useState(null),R=_.useRef(null),M=Un(t,R,y.onContentChange),P=_.useRef(0),B=_.useRef(""),U=_.useRef(0),D=_.useRef(null),$=_.useRef("right"),I=_.useRef(0),V=v?f0:_.Fragment,z=v?{as:z0e,allowPinchZoom:!0}:void 0,H=Y=>{var oe,ge;const F=B.current+Y,O=E().filter(ne=>!ne.disabled),X=document.activeElement,te=(oe=O.find(ne=>ne.ref.current===X))==null?void 0:oe.textValue,ie=O.map(ne=>ne.textValue),ue=Z0e(ie,F,te),se=(ge=O.find(ne=>ne.textValue===ue))==null?void 0:ge.ref.current;(function ne(de){B.current=de,window.clearTimeout(P.current),de!==""&&(P.current=window.setTimeout(()=>ne(""),1e3))})(F),se&&setTimeout(()=>se.focus())};_.useEffect(()=>()=>window.clearTimeout(P.current),[]),kE();const W=_.useCallback(Y=>{var O,X;return $.current===((O=D.current)==null?void 0:O.side)&&tSe(Y,(X=D.current)==null?void 0:X.area)},[]);return c.jsx($0e,{scope:n,searchRef:B,onItemEnter:_.useCallback(Y=>{W(Y)&&Y.preventDefault()},[W]),onItemLeave:_.useCallback(Y=>{var F;W(Y)||((F=R.current)==null||F.focus(),T(null))},[W]),onTriggerLeave:_.useCallback(Y=>{W(Y)&&Y.preventDefault()},[W]),pointerGraceTimerRef:U,onPointerGraceIntentChange:_.useCallback(Y=>{D.current=Y},[]),children:c.jsx(V,{...z,children:c.jsx(d0,{asChild:!0,trapped:i,onMountAutoFocus:st(s,Y=>{var F;Y.preventDefault(),(F=R.current)==null||F.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:c.jsx(ub,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:c.jsx(E0e,{asChild:!0,...k,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:N,onCurrentTabStopIdChange:T,onEntryFocus:st(l,Y=>{w.isUsingKeyboardRef.current||Y.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(IE,{role:"menu","aria-orientation":"vertical","data-state":$X(y.open),"data-radix-menu-content":"",dir:w.dir,...C,...x,ref:M,style:{outline:"none",...x.style},onKeyDown:st(x.onKeyDown,Y=>{const O=Y.target.closest("[data-radix-menu-content]")===Y.currentTarget,X=Y.ctrlKey||Y.altKey||Y.metaKey,te=Y.key.length===1;O&&(Y.key==="Tab"&&Y.preventDefault(),!X&&te&&H(Y.key));const ie=R.current;if(Y.target!==ie||!A0e.includes(Y.key))return;Y.preventDefault();const se=E().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);gX.includes(Y.key)&&se.reverse(),Q0e(se)}),onBlur:st(e.onBlur,Y=>{Y.currentTarget.contains(Y.target)||(window.clearTimeout(P.current),B.current="")}),onPointerMove:st(e.onPointerMove,e_(Y=>{const F=Y.target,O=I.current!==Y.clientX;if(Y.currentTarget.contains(F)&&O){const X=Y.clientX>I.current?"right":"left";$.current=X,I.current=Y.clientX}}))})})})})})})});SX.displayName=Pa;var U0e="MenuGroup",iL=_.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(wn.div,{role:"group",...r,ref:t})});iL.displayName=U0e;var H0e="MenuLabel",wX=_.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(wn.div,{...r,ref:t})});wX.displayName=H0e;var q1="MenuItem",M6="menu.itemSelect",WE=_.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,s=_.useRef(null),o=_0(q1,e.__scopeMenu),a=nL(q1,e.__scopeMenu),l=Un(t,s),u=_.useRef(!1),f=()=>{const h=s.current;if(!n&&h){const m=new CustomEvent(M6,{bubbles:!0,cancelable:!0});h.addEventListener(M6,g=>r==null?void 0:r(g),{once:!0}),Oq(h,m),m.defaultPrevented?u.current=!1:o.onClose()}};return c.jsx(CX,{...i,ref:l,disabled:n,onClick:st(e.onClick,f),onPointerDown:h=>{var m;(m=e.onPointerDown)==null||m.call(e,h),u.current=!0},onPointerUp:st(e.onPointerUp,h=>{var m;u.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:st(e.onKeyDown,h=>{const m=a.searchRef.current!=="";n||m&&h.key===" "||_M.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});WE.displayName=q1;var CX=_.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=e,o=nL(q1,n),a=bX(n),l=_.useRef(null),u=Un(t,l),[f,h]=_.useState(!1),[m,g]=_.useState("");return _.useEffect(()=>{const v=l.current;v&&g((v.textContent??"").trim())},[s.children]),c.jsx(Zy.ItemSlot,{scope:n,disabled:r,textValue:i??m,children:c.jsx(N0e,{asChild:!0,...a,focusable:!r,children:c.jsx(wn.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:st(e.onPointerMove,e_(v=>{r?o.onItemLeave(v):(o.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:st(e.onPointerLeave,e_(v=>o.onItemLeave(v))),onFocus:st(e.onFocus,()=>h(!0)),onBlur:st(e.onBlur,()=>h(!1))})})})}),W0e="MenuCheckboxItem",kX=_.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return c.jsx(jX,{scope:e.__scopeMenu,checked:n,children:c.jsx(WE,{role:"menuitemcheckbox","aria-checked":Y1(n)?"mixed":n,...i,ref:t,"data-state":oL(n),onSelect:st(i.onSelect,()=>r==null?void 0:r(Y1(n)?!0:!n),{checkForDefaultPrevented:!1})})})});kX.displayName=W0e;var EX="MenuRadioGroup",[V0e,K0e]=lm(EX,{value:void 0,onValueChange:()=>{}}),NX=_.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,s=gl(r);return c.jsx(V0e,{scope:e.__scopeMenu,value:n,onValueChange:s,children:c.jsx(iL,{...i,ref:t})})});NX.displayName=EX;var TX="MenuRadioItem",AX=_.forwardRef((e,t)=>{const{value:n,...r}=e,i=K0e(TX,e.__scopeMenu),s=n===i.value;return c.jsx(jX,{scope:e.__scopeMenu,checked:s,children:c.jsx(WE,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":oL(s),onSelect:st(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});AX.displayName=TX;var sL="MenuItemIndicator",[jX,G0e]=lm(sL,{checked:!1}),RX=_.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,s=G0e(sL,n);return c.jsx(Ga,{present:r||Y1(s.checked)||s.checked===!0,children:c.jsx(wn.span,{...i,ref:t,"data-state":oL(s.checked)})})});RX.displayName=sL;var q0e="MenuSeparator",MX=_.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(wn.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});MX.displayName=q0e;var Y0e="MenuArrow",PX=_.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=HE(n);return c.jsx(OE,{...i,...r,ref:t})});PX.displayName=Y0e;var X0e="MenuSub",[jet,IX]=lm(X0e),Qx="MenuSubTrigger",OX=_.forwardRef((e,t)=>{const n=cm(Qx,e.__scopeMenu),r=_0(Qx,e.__scopeMenu),i=IX(Qx,e.__scopeMenu),s=nL(Qx,e.__scopeMenu),o=_.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,u={__scopeMenu:e.__scopeMenu},f=_.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return _.useEffect(()=>f,[f]),_.useEffect(()=>{const h=a.current;return()=>{window.clearTimeout(h),l(null)}},[a,l]),c.jsx(eL,{asChild:!0,...u,children:c.jsx(CX,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":$X(n.open),...e,ref:jD(t,i.onTriggerChange),onClick:h=>{var m;(m=e.onClick)==null||m.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:st(e.onPointerMove,e_(h=>{s.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:st(e.onPointerLeave,e_(h=>{var g,v;f();const m=(g=n.content)==null?void 0:g.getBoundingClientRect();if(m){const x=(v=n.content)==null?void 0:v.dataset.side,y=x==="right",w=y?-5:5,C=m[y?"left":"right"],k=m[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:h.clientX+w,y:h.clientY},{x:C,y:m.top},{x:k,y:m.top},{x:k,y:m.bottom},{x:C,y:m.bottom}],side:x}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(h),h.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:st(e.onKeyDown,h=>{var g;const m=s.searchRef.current!=="";e.disabled||m&&h.key===" "||j0e[r.dir].includes(h.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),h.preventDefault())})})})});OX.displayName=Qx;var DX="MenuSubContent",LX=_.forwardRef((e,t)=>{const n=yX(Pa,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=cm(Pa,e.__scopeMenu),o=_0(Pa,e.__scopeMenu),a=IX(DX,e.__scopeMenu),l=_.useRef(null),u=Un(t,l);return c.jsx(Zy.Provider,{scope:e.__scopeMenu,children:c.jsx(Ga,{present:r||s.open,children:c.jsx(Zy.Slot,{scope:e.__scopeMenu,children:c.jsx(rL,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var h;o.isUsingKeyboardRef.current&&((h=l.current)==null||h.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:st(e.onFocusOutside,f=>{f.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:st(e.onEscapeKeyDown,f=>{o.onClose(),f.preventDefault()}),onKeyDown:st(e.onKeyDown,f=>{var g;const h=f.currentTarget.contains(f.target),m=R0e[o.dir].includes(f.key);h&&m&&(s.onOpenChange(!1),(g=a.trigger)==null||g.focus(),f.preventDefault())})})})})})});LX.displayName=DX;function $X(e){return e?"open":"closed"}function Y1(e){return e==="indeterminate"}function oL(e){return Y1(e)?"indeterminate":e?"checked":"unchecked"}function Q0e(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function J0e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Z0e(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let o=J0e(e,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function eSe(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s],l=t[o],u=a.x,f=a.y,h=l.x,m=l.y;f>r!=m>r&&n<(h-u)*(r-f)/(m-f)+u&&(i=!i)}return i}function tSe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return eSe(n,t)}function e_(e){return t=>t.pointerType==="mouse"?e(t):void 0}var nSe=xX,rSe=eL,iSe=_X,sSe=SX,oSe=iL,aSe=wX,lSe=WE,cSe=kX,uSe=NX,dSe=AX,fSe=RX,hSe=MX,pSe=PX,mSe=OX,gSe=LX,aL="ContextMenu",[vSe]=qu(aL,[vX]),io=vX(),[bSe,BX]=vSe(aL),FX=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:s=!0}=e,[o,a]=_.useState(!1),l=io(t),u=gl(r),f=_.useCallback(h=>{a(h),u(h)},[u]);return c.jsx(bSe,{scope:t,open:o,onOpenChange:f,modal:s,children:c.jsx(nSe,{...l,dir:i,open:o,onOpenChange:f,modal:s,children:n})})};FX.displayName=aL;var zX="ContextMenuTrigger",UX=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...i}=e,s=BX(zX,n),o=io(n),a=_.useRef({x:0,y:0}),l=_.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),u=_.useRef(0),f=_.useCallback(()=>window.clearTimeout(u.current),[]),h=m=>{a.current={x:m.clientX,y:m.clientY},s.onOpenChange(!0)};return _.useEffect(()=>f,[f]),_.useEffect(()=>void(r&&f()),[r,f]),c.jsxs(c.Fragment,{children:[c.jsx(rSe,{...o,virtualRef:l}),c.jsx(wn.span,{"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,...i,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:st(e.onContextMenu,m=>{f(),h(m),m.preventDefault()}),onPointerDown:r?e.onPointerDown:st(e.onPointerDown,Cw(m=>{f(),u.current=window.setTimeout(()=>h(m),700)})),onPointerMove:r?e.onPointerMove:st(e.onPointerMove,Cw(f)),onPointerCancel:r?e.onPointerCancel:st(e.onPointerCancel,Cw(f)),onPointerUp:r?e.onPointerUp:st(e.onPointerUp,Cw(f))})]})});UX.displayName=zX;var xSe="ContextMenuPortal",HX=e=>{const{__scopeContextMenu:t,...n}=e,r=io(t);return c.jsx(iSe,{...r,...n})};HX.displayName=xSe;var WX="ContextMenuContent",VX=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=BX(WX,n),s=io(n),o=_.useRef(!1);return c.jsx(sSe,{...s,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{var l;(l=e.onCloseAutoFocus)==null||l.call(e,a),!a.defaultPrevented&&o.current&&a.preventDefault(),o.current=!1},onInteractOutside:a=>{var l;(l=e.onInteractOutside)==null||l.call(e,a),!a.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});VX.displayName=WX;var ySe="ContextMenuGroup",_Se=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(oSe,{...i,...r,ref:t})});_Se.displayName=ySe;var SSe="ContextMenuLabel",wSe=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(aSe,{...i,...r,ref:t})});wSe.displayName=SSe;var CSe="ContextMenuItem",KX=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(lSe,{...i,...r,ref:t})});KX.displayName=CSe;var kSe="ContextMenuCheckboxItem",ESe=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(cSe,{...i,...r,ref:t})});ESe.displayName=kSe;var NSe="ContextMenuRadioGroup",TSe=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(uSe,{...i,...r,ref:t})});TSe.displayName=NSe;var ASe="ContextMenuRadioItem",jSe=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(dSe,{...i,...r,ref:t})});jSe.displayName=ASe;var RSe="ContextMenuItemIndicator",MSe=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(fSe,{...i,...r,ref:t})});MSe.displayName=RSe;var PSe="ContextMenuSeparator",GX=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(hSe,{...i,...r,ref:t})});GX.displayName=PSe;var ISe="ContextMenuArrow",OSe=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(pSe,{...i,...r,ref:t})});OSe.displayName=ISe;var DSe="ContextMenuSubTrigger",LSe=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(mSe,{...i,...r,ref:t})});LSe.displayName=DSe;var $Se="ContextMenuSubContent",BSe=_.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=io(n);return c.jsx(gSe,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});BSe.displayName=$Se;function Cw(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var FSe=FX,zSe=UX,USe=HX,qX=VX,YX=KX,XX=GX;const QX=_.createContext(null);function qf({onOpenChange:e,...t}){const[n,r]=_.useState(0),i=_.useCallback(()=>{r(s=>s+1),e==null||e(!1)},[e]);return c.jsx(QX.Provider,{value:i,children:c.jsx(FSe,{onOpenChange:e,...t},n)})}const Yf=zSe,Xu=_.forwardRef(({className:e,...t},n)=>c.jsx(USe,{children:c.jsx(qX,{ref:n,className:ce("z-50 min-w-[170px] overflow-hidden rounded-xl border border-border bg-background p-1 shadow-lg outline-hidden animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e),...t})}));Xu.displayName=qX.displayName;const Xn=_.forwardRef(({className:e,onSelect:t,...n},r)=>{const i=_.useContext(QX);return c.jsx(YX,{ref:r,className:ce("relative flex cursor-default select-none items-center gap-2.5 rounded-lg px-3 py-2 text-xs font-medium text-foreground outline-hidden transition-colors hover:bg-muted focus:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),onSelect:s=>{t==null||t(s),i==null||i()},...n})});Xn.displayName=YX.displayName;const VE=_.forwardRef(({className:e,...t},n)=>c.jsx(XX,{ref:n,className:ce("-mx-1 my-1 h-px bg-border",e),...t}));VE.displayName=XX.displayName;var KE="Popover",[JX]=qu(KE,[Gf]),S0=Gf(),[HSe,Xf]=JX(KE),ZX=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=e,a=S0(t),l=_.useRef(null),[u,f]=_.useState(!1),[h,m]=Rv({prop:r,defaultProp:i??!1,onChange:s,caller:KE});return c.jsx(PE,{...a,children:c.jsx(HSe,{scope:t,contentId:ku(),triggerRef:l,open:h,onOpenChange:m,onOpenToggle:_.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:u,onCustomAnchorAdd:_.useCallback(()=>f(!0),[]),onCustomAnchorRemove:_.useCallback(()=>f(!1),[]),modal:o,children:n})})};ZX.displayName=KE;var eQ="PopoverAnchor",WSe=_.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Xf(eQ,n),s=S0(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=i;return _.useEffect(()=>(o(),()=>a()),[o,a]),c.jsx(m0,{...s,...r,ref:t})});WSe.displayName=eQ;var tQ="PopoverTrigger",nQ=_.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Xf(tQ,n),s=S0(n),o=Un(t,i.triggerRef),a=c.jsx(wn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":aQ(i.open),...r,ref:o,onClick:st(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:c.jsx(m0,{asChild:!0,...s,children:a})});nQ.displayName=tQ;var lL="PopoverPortal",[VSe,KSe]=JX(lL,{forceMount:void 0}),rQ=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,s=Xf(lL,t);return c.jsx(VSe,{scope:t,forceMount:n,children:c.jsx(Ga,{present:n||s.open,children:c.jsx(db,{asChild:!0,container:i,children:r})})})};rQ.displayName=lL;var Iv="PopoverContent",iQ=_.forwardRef((e,t)=>{const n=KSe(Iv,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,s=Xf(Iv,e.__scopePopover);return c.jsx(Ga,{present:r||s.open,children:s.modal?c.jsx(qSe,{...i,ref:t}):c.jsx(YSe,{...i,ref:t})})});iQ.displayName=Iv;var GSe=Ip("PopoverContent.RemoveScroll"),qSe=_.forwardRef((e,t)=>{const n=Xf(Iv,e.__scopePopover),r=_.useRef(null),i=Un(t,r),s=_.useRef(!1);return _.useEffect(()=>{const o=r.current;if(o)return NE(o)},[]),c.jsx(f0,{as:GSe,allowPinchZoom:!0,children:c.jsx(sQ,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:st(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:st(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,u=a.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:st(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),YSe=_.forwardRef((e,t)=>{const n=Xf(Iv,e.__scopePopover),r=_.useRef(!1),i=_.useRef(!1);return c.jsx(sQ,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),sQ=_.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:f,...h}=e,m=Xf(Iv,n),g=S0(n);return kE(),c.jsx(d0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:c.jsx(ub,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:c.jsx(IE,{"data-state":aQ(m.open),role:"dialog",id:m.contentId,...g,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),oQ="PopoverClose",XSe=_.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Xf(oQ,n);return c.jsx(wn.button,{type:"button",...r,ref:t,onClick:st(e.onClick,()=>i.onOpenChange(!1))})});XSe.displayName=oQ;var QSe="PopoverArrow",JSe=_.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=S0(n);return c.jsx(OE,{...i,...r,ref:t})});JSe.displayName=QSe;function aQ(e){return e?"open":"closed"}var ZSe=ZX,ewe=nQ,twe=rQ,lQ=iQ;const _c=ZSe,Sc=ewe,Nl=_.forwardRef(({className:e,align:t="center",sideOffset:n=4,ports:r={},...i},s)=>{const o=r.dom??Et;return c.jsx(twe,{children:c.jsx(lQ,{ref:s,align:t,sideOffset:n,[z1]:"",onCloseAutoFocus:a=>{var l;a.preventDefault(),o.dispatchCustomWindowEvent(DD),(l=i.onCloseAutoFocus)==null||l.call(i,a)},className:ce("z-50 w-72 rounded-xl border border-border bg-background p-4 shadow-lg outline-hidden animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...i})})});Nl.displayName=lQ.displayName;const SM=Xt("StackActionsPopover",()=>e=>({open:!1,setOpen:t=>e({open:t})}));function nwe({editorLabel:e,onOpenBoards:t,starred:n,onCopyPath:r,onShowArchived:i,onOpenInFinder:s,onOpenInEditor:o,onToggleStar:a,onHide:l,children:u}){return c.jsxs(qf,{children:[c.jsx(Yf,{asChild:!0,children:u}),c.jsxs(Xu,{children:[t?c.jsxs(c.Fragment,{children:[c.jsxs(Xn,{onSelect:f=>{f.stopPropagation(),t()},children:[c.jsx(_E,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Boards"})]}),c.jsx(VE,{})]}):null,c.jsxs(Xn,{onSelect:f=>{f.stopPropagation(),a()},children:[n?c.jsx(Wge,{className:"h-3.5 w-3.5"}):c.jsx(mq,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:n?"Unstar project":"Star project"})]}),c.jsxs(Xn,{onSelect:f=>{f.stopPropagation(),r()},children:[c.jsx(na,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Copy Path"})]}),c.jsxs(Xn,{onSelect:f=>{f.stopPropagation(),i()},children:[c.jsx(bD,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Show Archived"})]}),c.jsxs(Xn,{onSelect:f=>{f.stopPropagation(),s()},children:[c.jsx(yE,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Show in Finder"})]}),c.jsxs(Xn,{onSelect:f=>{f.stopPropagation(),o()},children:[c.jsx(xD,{className:"h-3.5 w-3.5"}),c.jsxs("span",{className:"text-xs font-medium",children:["Open in ",e]})]}),c.jsxs(Xn,{onSelect:f=>{f.stopPropagation(),l()},className:"text-destructive hover:bg-destructive/10 focus:bg-destructive/10",children:[c.jsx(Ape,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Hide"})]})]})]})}function rwe({canFork:e,onRename:t,onOpenInFinder:n,onFork:r,onArchive:i,onDelete:s,onEditPermissions:o,children:a}){return c.jsxs(qf,{children:[c.jsx(Yf,{asChild:!0,children:a}),c.jsxs(Xu,{children:[c.jsxs(Xn,{onSelect:l=>{l.preventDefault(),t()},children:[c.jsx(om,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Rename"})]}),c.jsxs(Xn,{onSelect:l=>{l.preventDefault(),n()},children:[c.jsx(yE,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Open in Finder"})]}),c.jsxs(Xn,{disabled:!e,onSelect:l=>{l.preventDefault(),e&&r()},children:[c.jsx(hq,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Fork"})]}),o?c.jsxs(Xn,{onSelect:l=>{l.preventDefault(),o()},children:[c.jsx(kD,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Permissions…"})]}):null,c.jsxs(Xn,{onSelect:l=>{l.preventDefault(),i()},children:[c.jsx(bD,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Archive"})]}),c.jsxs(Xn,{onSelect:l=>{l.preventDefault(),s()},className:"text-destructive dark:text-red-400 hover:bg-destructive/10 focus:bg-destructive/10 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",children:[c.jsx(xc,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Delete"})]})]})]})}function iwe({stackTitle:e,onOpenBoards:t,onRename:n,onEditMembers:r,onDelete:i,children:s}){const o=SM.useScopedStore(u=>u.open),a=SM.useScopedStore(u=>u.setOpen);function l(u){return()=>{a(!1),u()}}return c.jsxs(_c,{open:o,onOpenChange:a,children:[c.jsx(Sc,{asChild:!0,children:s}),c.jsxs(Nl,{align:"end",sideOffset:4,className:"w-44 p-1",role:"menu","aria-label":`Actions for ${e}`,children:[t?c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",role:"menuitem",onClick:l(t),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs font-medium hover:bg-muted focus-visible:bg-muted outline-hidden",children:[c.jsx(_E,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Boards"})]}),c.jsx("div",{className:"my-1 h-px bg-border"})]}):null,c.jsxs("button",{type:"button",role:"menuitem",onClick:l(n),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs font-medium hover:bg-muted focus-visible:bg-muted outline-hidden",children:[c.jsx(om,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Rename"})]}),c.jsxs("button",{type:"button",role:"menuitem",onClick:l(r),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs font-medium hover:bg-muted focus-visible:bg-muted outline-hidden",children:[c.jsx(vq,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Edit members"})]}),c.jsxs("button",{type:"button",role:"menuitem",onClick:l(i),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs font-medium text-destructive dark:text-red-400 hover:bg-destructive/10 focus-visible:bg-destructive/10 dark:hover:bg-red-500/20 dark:focus-visible:bg-red-500/20 outline-hidden",children:[c.jsx(xc,{className:"h-3.5 w-3.5"}),c.jsxs("span",{children:["Delete ",e]})]})]})]})}function swe({stackTitle:e,onOpenBoards:t,onRename:n,onEditMembers:r,onDelete:i,children:s}){return c.jsx(SM.Provider,{init:{},children:c.jsx(iwe,{stackTitle:e,onOpenBoards:t,onRename:n,onEditMembers:r,onDelete:i,children:s})})}function owe({stackTitle:e,onOpenBoards:t,onRename:n,onEditMembers:r,onDelete:i,children:s}){return c.jsxs(qf,{children:[c.jsx(Yf,{asChild:!0,children:s}),c.jsxs(Xu,{children:[t?c.jsxs(c.Fragment,{children:[c.jsxs(Xn,{onSelect:o=>{o.stopPropagation(),t()},children:[c.jsx(_E,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Boards"})]}),c.jsx(VE,{})]}):null,c.jsxs(Xn,{onSelect:o=>{o.preventDefault(),n()},children:[c.jsx(om,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Rename"})]}),c.jsxs(Xn,{onSelect:o=>{o.preventDefault(),r()},children:[c.jsx(vq,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"text-xs font-medium",children:"Edit members"})]}),c.jsxs(Xn,{onSelect:o=>{o.preventDefault(),i()},className:"text-destructive dark:text-red-400 hover:bg-destructive/10 focus:bg-destructive/10 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",children:[c.jsx(xc,{className:"h-3.5 w-3.5"}),c.jsxs("span",{className:"text-xs font-medium",children:["Delete ",e]})]})]})]})}function awe({chat:e,activeChatId:t,nowMs:n,shortcutHint:r=null,showShortcutHint:i=!1,onSelectChat:s,onRenameChat:o,onOpenInFinder:a,onForkChat:l,onArchiveChat:u,onDeleteChat:f,onEditPermissions:h,silent:m=!1}){var R;const g=(e.status==="running"||e.status==="waiting_for_user")&&e.stateEnteredAt!=null,v=g&&e.stateEnteredAt!=null?`${kf(e.status)} ${Pu(n-e.stateEnteredAt)}`:xo(n-(e.lastMessageAt??e._creationTime)),x=i&&r?r:v,y=i&&!!r,w=rbe(e.chatId),C=t===w,k=((R=zE(e))==null?void 0:R.tone)??null,E=e.canFork?"min-w-12":"min-w-6";let N=null;x&&(y?N=c.jsx("span",{className:"hidden md:flex items-center justify-end pr-0.5 text-11 text-foreground transition-opacity duration-150 group-hover:opacity-0",children:c.jsx(XY,{className:"h-4 min-w-4 rounded-sm border-border/50 bg-transparent px-1 text-10",children:r})}):N=c.jsx("span",{className:ce("hidden md:flex items-center justify-end pr-1 text-11 tabular-nums transition-opacity duration-150 group-hover:opacity-0 whitespace-nowrap",g?lX(k):"text-muted-foreground"),children:x}));const T=c.jsxs("div",{"data-chat-id":w,className:ce("group flex items-center gap-2 pl-2 pr-1 py-1.5 rounded-md cursor-pointer transition-colors duration-150",C?"bg-muted":"hover:bg-muted/40"),onClick:()=>s(e.chatId),children:[c.jsx("span",{className:"relative flex h-3.5 w-3.5 shrink-0 items-center justify-center","aria-hidden":!0,children:k?c.jsx("span",{className:ce("h-2 w-2 rounded-full",UE(k))}):null}),(()=>{const M=cX(e.sessionState);return M?c.jsx(ia,{label:M.title,children:c.jsx("span",{className:ce("shrink-0 text-10 leading-none",M.toneClass),"aria-label":M.title,children:M.glyph})}):null})(),e.hasPolicyOverride?c.jsx(kD,{className:"size-3 shrink-0 text-warning","aria-label":"Per-chat permission override active"}):null,c.jsx("span",{className:ce("truncate flex-1 text-sm",C?"text-foreground font-medium":"text-foreground/90",e.status==="idle"&&!e.unread&&!C?"text-muted-foreground":""),children:e.title}),c.jsxs("div",{className:ce("relative flex items-center justify-end gap-1.5 h-6 shrink-0",E),children:[m?c.jsx(XG,{className:ce("size-3 shrink-0 text-muted-foreground transition-opacity duration-150",x?"group-hover:opacity-0":""),"aria-label":"Silenced"}):null,N,c.jsxs("div",{className:ce("absolute inset-0 flex items-center justify-end gap-0 transition-opacity duration-150",x?"opacity-100 md:opacity-0 md:group-hover:opacity-100":"opacity-100"),children:[e.canFork?c.jsx(Ee,{variant:"ghost",size:"icon",className:"h-6 w-6 cursor-pointer rounded-sm hover:!bg-transparent !border-0",onClick:M=>{M.stopPropagation(),l(e.chatId)},title:"Fork chat",children:c.jsx(hq,{className:"size-3.5"})}):null,c.jsx(Ee,{variant:"ghost",size:"icon",className:"h-6 w-6 cursor-pointer rounded-sm hover:!bg-transparent !border-0",onClick:M=>{M.stopPropagation(),u(e.chatId)},title:"Archive chat",children:c.jsx(bD,{className:"size-3.5"})})]})]})]},e._id);return c.jsx(rwe,{canFork:e.canFork,onRename:()=>o(e.chatId),onOpenInFinder:()=>a(e.localPath),onFork:()=>l(e.chatId),onArchive:()=>u(e.chatId),onDelete:()=>f(e.chatId),onEditPermissions:h?()=>h(e.chatId):void 0,children:T})}const lwe=_.memo(awe);function cwe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return _.useMemo(()=>r=>{t.forEach(i=>i(r))},t)}const GE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function pb(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function cL(e){return"nodeType"in e}function Ao(e){var t,n;return e?pb(e)?e:cL(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function uL(e){const{Document:t}=Ao(e);return e instanceof t}function w0(e){return pb(e)?!1:e instanceof Ao(e).HTMLElement}function cQ(e){return e instanceof Ao(e).SVGElement}function mb(e){return e?pb(e)?e.document:cL(e)?uL(e)?e:w0(e)||cQ(e)?e.ownerDocument:document:document:document}const fc=GE?_.useLayoutEffect:_.useEffect;function dL(e){const t=_.useRef(e);return fc(()=>{t.current=e}),_.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function uwe(){const e=_.useRef(null),t=_.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=_.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function t_(e,t){t===void 0&&(t=[e]);const n=_.useRef(e);return fc(()=>{n.current!==e&&(n.current=e)},t),n}function C0(e,t){const n=_.useRef();return _.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function X1(e){const t=dL(e),n=_.useRef(null),r=_.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function wM(e){const t=_.useRef();return _.useEffect(()=>{t.current=e},[e]),t.current}let RA={};function k0(e,t){return _.useMemo(()=>{if(t)return t;const n=RA[e]==null?0:RA[e]+1;return RA[e]=n,e+"-"+n},[e,t])}function uQ(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((s,o)=>{const a=Object.entries(o);for(const[l,u]of a){const f=s[l];f!=null&&(s[l]=f+e*u)}return s},{...t})}}const Jg=uQ(1),Q1=uQ(-1);function dwe(e){return"clientX"in e&&"clientY"in e}function fL(e){if(!e)return!1;const{KeyboardEvent:t}=Ao(e.target);return t&&e instanceof t}function fwe(e){if(!e)return!1;const{TouchEvent:t}=Ao(e.target);return t&&e instanceof t}function CM(e){if(fwe(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return dwe(e)?{x:e.clientX,y:e.clientY}:null}const n_=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[n_.Translate.toString(e),n_.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),P6="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function hwe(e){return e.matches(P6)?e:e.querySelector(P6)}const pwe={display:"none"};function mwe(e){let{id:t,value:n}=e;return Dn.createElement("div",{id:t,style:pwe},n)}function gwe(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Dn.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function vwe(){const[e,t]=_.useState("");return{announce:_.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const dQ=_.createContext(null);function bwe(e){const t=_.useContext(dQ);_.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function xwe(){const[e]=_.useState(()=>new Set),t=_.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[_.useCallback(r=>{let{type:i,event:s}=r;e.forEach(o=>{var a;return(a=o[i])==null?void 0:a.call(o,s)})},[e]),t]}const ywe={draggable:`
832
832
  To pick up a draggable item, press the space bar.
833
833
  While dragging, use the arrow keys to move the item.
834
834
  Press space again to drop the item in its new position, or press escape to cancel.
@@ -2750,7 +2750,7 @@ XID_Start XIDS`.split(/\s/).map(e=>[hN(e),e])),Bje=new Map([["s",Ni(383)],[Ni(38
2750
2750
  `:"").join("");return c.jsx(qre,{source:r,lang:n},Bi())}if(Ot(e)){const n=e.getListType(),r=Dd(e),i=Bi();return n==="number"?c.jsx("ol",{className:"list-decimal ml-5 my-2",children:r},i):c.jsx("ul",{className:"list-disc ml-5 my-2",children:r},i)}if(Sn(e)){const n=e.getChecked(),r=Dd(e),i=Bi();return n!==void 0?c.jsxs("li",{className:"my-0.5 list-none flex items-start gap-1.5",children:[c.jsx("input",{type:"checkbox",readOnly:!0,checked:n,className:"mt-[3px] shrink-0"}),c.jsx("span",{children:r})]},i):c.jsx("li",{className:"my-0.5",children:r},i)}if(bo(e)||nf(e)){const n=e.getURL();return c.jsx("a",{href:n,className:"transition-all underline decoration-2 text-logo decoration-logo/50 hover:text-logo/70 dark:text-logo dark:decoration-logo/70 dark:hover:text-logo/60 dark:hover:decoration-logo/40",target:"_blank",rel:"noopener noreferrer",children:Dd(e)},Bi())}if(hr(e)){const n=e.getChildren(),r=n[0],i=r!==void 0&&lr(r)&&r.getChildren().every(a=>kt(a)&&(a.getHeaderStyles()&An.ROW)!==0),s=i?r:void 0,o=i?n.slice(1):n;return c.jsx("div",{className:"border border-border rounded-xl overflow-x-auto",children:c.jsxs("table",{className:"table-auto min-w-full divide-y divide-border bg-background",children:[s!==void 0&&c.jsx("thead",{children:c.jsx("tr",{children:s.getChildren().map(a=>c.jsx("th",{className:"text-left text-xs uppercase text-muted-foreground tracking-wider p-2 pl-0 first:pl-3 bg-muted dark:bg-card [&_*]:font-semibold",children:Dd(a)},Bi()))})}),c.jsx("tbody",{className:"divide-y divide-border",children:o.map(a=>lr(a)?c.jsx("tr",{children:a.getChildren().map(l=>kt(l)?c.jsx("td",{className:"text-left p-2 pl-0 first:pl-3 [&_*]:font-normal",children:Dd(l)},Bi()):null)},Bi()):null)})]})},Bi())}if(bi(e))return c.jsx("br",{},Bi());if($e(e))return J3e(e);if(Yv(e))return c.jsx("code",{className:"break-all px-1 bg-border/60 py-0.5 rounded text-sm",children:e.getTextContent()},Bi());const t=e.getTextContent();return t?c.jsx("span",{children:t},Bi()):null}function J3e(e){const t=e.getFormat(),n=e.getTextContent(),r=(t&w_)!==0,i=(t&C_)!==0,s=(t&k_)!==0,o=(t&x5)!==0;let a=n;return o?c.jsx("code",{className:"break-all px-1 bg-border/60 py-0.5 rounded text-sm",children:n},Bi()):(s&&(a=c.jsx("del",{className:"line-through",children:a},Bi())),i&&(a=c.jsx("em",{className:"italic",children:a},Bi())),r&&(a=c.jsx("strong",{className:"font-semibold",children:a},Bi())),!r&&!i&&!s?n:a)}function Dd(e){return e.getChildren().map(Xre)}function Z3e(){Yre=0;const t=Mn().getChildren();return c.jsx(c.Fragment,{children:t.map(Xre)})}function Yp(e,t=Vre){const n=one(m3({namespace:"kanna-md-renderer",nodes:Q3e,editable:!1}));return n.update(()=>{Ire(e,t,void 0,!0)},{discrete:!0}),n.getEditorState().read(()=>Z3e())}const vI=Xt("ThinkingBlock",()=>e=>({expanded:!1,setExpanded:t=>e({expanded:t})}));function e$e({content:e}){const t=vI.useScopedStore(i=>i.expanded),n=vI.useScopedStore(i=>i.setExpanded),r=e.trim();return r.length===0?null:c.jsxs("div",{className:"my-3 first:mt-0 last:mb-0",children:[c.jsxs("button",{type:"button",onClick:()=>n(!t),"aria-expanded":t,className:"group/thinking flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[c.jsx(BC,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"font-medium uppercase tracking-wider",children:"Thinking"}),c.jsx(Da,{className:ce("h-3.5 w-3.5 transition-transform duration-200",t&&"rotate-90")})]}),t&&c.jsx("div",{className:"mt-2 border-l-2 border-muted-foreground/20 pl-3 text-sm text-muted-foreground italic prose prose-sm dark:prose-invert max-w-[70ch]",children:Yp(r)})]})}const KN=_.memo(({content:e})=>c.jsx(vI.Provider,{init:void 0,children:c.jsx(e$e,{content:e})}));class z_ extends ed{constructor(n,r,i,s,o=Et){super(s);K(this,"__mentionKind");K(this,"__value");K(this,"__label");K(this,"__dom");this.__mentionKind=n,this.__value=r,this.__label=i,this.__dom=o}static getType(){return"kanna-mention"}static clone(n){return new z_(n.__mentionKind,n.__value,n.__label,n.__key,n.__dom)}static importJSON(n){return bI({mentionKind:n.mentionKind,value:n.value,label:n.label})}exportJSON(){return{type:z_.getType(),version:1,mentionKind:this.__mentionKind,value:this.__value,label:this.__label}}createDOM(n,r){const i=this.__dom.createElement("span");return i.dataset.lexicalDecorator="true",i}updateDOM(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}getTextContent(){return this.__mentionKind==="agent"?`@agent/${this.__value}`:`@${this.__value}`}decorate(n,r){const i=this.__label;return this.__mentionKind==="agent"?c.jsx("span",{className:ce("inline-flex items-center rounded px-1 text-sm","bg-primary/10 text-primary border border-primary/20"),children:i}):c.jsx("span",{className:ce("inline-flex items-center rounded px-1 text-sm","bg-muted text-muted-foreground border border-border"),children:i})}}function bI(e){return yi(new z_(e.mentionKind,e.value,e.label))}class U_ extends ed{constructor(n,r,i,s=Et){super(i);K(this,"__commandName");K(this,"__hasArgument");K(this,"__dom");this.__commandName=n,this.__hasArgument=r,this.__dom=s}static getType(){return"kanna-slash-command"}static clone(n){return new U_(n.__commandName,n.__hasArgument,n.__key,n.__dom)}static importJSON(n){return Qre({commandName:n.commandName,hasArgument:n.hasArgument})}exportJSON(){return{type:U_.getType(),version:1,commandName:this.__commandName,hasArgument:this.__hasArgument}}createDOM(n,r){const i=this.__dom.createElement("span");return i.dataset.lexicalDecorator="true",i}updateDOM(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}getTextContent(){return this.__hasArgument?`/${this.__commandName} `:`/${this.__commandName}`}decorate(n,r){return c.jsx("span",{className:ce("inline-flex items-center rounded px-1 text-sm font-mono","bg-muted text-muted-foreground border border-border"),children:`/${this.__commandName}`})}}function Qre(e){return yi(new U_(e.commandName,e.hasArgument))}class Jv extends ed{constructor(n,r,i=Et){super(r);K(this,"__attachment");K(this,"__dom");this.__attachment=n,this.__dom=i}static getType(){return"kanna-attachment"}static clone(n){return new Jv(n.__attachment,n.__key,n.__dom)}static importJSON(n){return g3(n.attachment)}getAttachment(){return this.getLatest().__attachment}isInline(){return!0}isKeyboardSelectable(){return!0}getTextContent(){return""}createDOM(n,r){return this.__dom.createElement("span")}updateDOM(){return!1}exportJSON(){return{type:Jv.getType(),version:1,attachment:this.__attachment}}decorate(n,r){const i=this.getLatest().__attachment;return i.kind==="image"&&i.contentUrl?c.jsx(vN,{attachment:i,size:"composer"}):c.jsx(ea,{attachment:i})}}function g3(e){return yi(new Jv(e))}function t$e(){return sOe(Jv)}const n$e=.25,r$e=8,cW=.25;function uW(e){return Math.min(r$e,Math.max(n$e,e))}function i$e(){return e=>({scale:1,offset:{x:0,y:0},drag:null,zoomIn:()=>e(t=>{const n=uW(t.scale+cW);return n===t.scale?t:{scale:n}}),zoomOut:()=>e(t=>{const n=uW(t.scale-cW);return n===t.scale?t:{scale:n}}),resetView:()=>e({scale:1,offset:{x:0,y:0}}),beginDrag:(t,n)=>e(r=>({drag:{x:t-r.offset.x,y:n-r.offset.y}})),dragTo:(t,n)=>e(r=>r.drag?{offset:{x:t-r.drag.x,y:n-r.drag.y}}:r),endDrag:()=>e({drag:null})})}const su=Xt("MermaidZoomModal",i$e);function s$e({svg:e,onClose:t,ports:n}){const r=(n==null?void 0:n.dom)??Et,i=su.useScopedStore(v=>v.scale),s=su.useScopedStore(v=>v.offset),o=su.useScopedStore(v=>v.zoomIn),a=su.useScopedStore(v=>v.zoomOut),l=su.useScopedStore(v=>v.resetView),u=su.useScopedStore(v=>v.beginDrag),f=su.useScopedStore(v=>v.dragTo),h=su.useScopedStore(v=>v.endDrag);_.useEffect(()=>{const v=x=>{x.key==="Escape"&&t()};return r.addWindowListener("keydown",v)},[t,r]);const m=v=>u(v.clientX,v.clientY),g=v=>f(v.clientX,v.clientY);return to.createPortal(c.jsxs("div",{className:"fixed inset-0 z-[100] flex flex-col bg-background/95",role:"dialog","aria-modal":"true","aria-label":"Diagram zoom view",children:[c.jsxs("div",{className:"flex justify-end gap-1 p-2",children:[c.jsx(Ee,{variant:"ghost",size:"icon","aria-label":"Zoom out",className:"h-9 w-9",onClick:a,children:c.jsx(lq,{className:"h-4 w-4"})}),c.jsx(Ee,{variant:"ghost",size:"icon","aria-label":"Zoom in",className:"h-9 w-9",onClick:o,children:c.jsx(No,{className:"h-4 w-4"})}),c.jsx(Ee,{variant:"ghost",size:"icon","aria-label":"Reset view",className:"h-9 w-9",onClick:l,children:c.jsx(dge,{className:"h-4 w-4"})}),c.jsx(Ee,{variant:"ghost",size:"icon","aria-label":"Close",className:"h-9 w-9",onClick:t,children:c.jsx(xi,{className:"h-4 w-4"})})]}),c.jsx("div",{className:"flex-1 overflow-hidden touch-none cursor-grab active:cursor-grabbing",onPointerDown:m,onPointerMove:g,onPointerUp:h,onPointerLeave:h,children:c.jsx("div",{"data-mermaid-stage":!0,className:"w-full h-full flex items-center justify-center",style:{transform:`translate(${s.x}px, ${s.y}px) scale(${i})`},dangerouslySetInnerHTML:{__html:e}})})]}),r.getBodyElement())}function o$e({svg:e,onClose:t,ports:n}){return c.jsx(su.Provider,{init:void 0,children:c.jsx(s$e,{svg:e,onClose:t,ports:n})})}const ou=Xt("MermaidDiagram",()=>e=>({renderState:{status:"loading"},showSource:!1,zoomOpen:!1,copied:!1,setRenderState:t=>e({renderState:t}),setShowSource:t=>e({showSource:t}),setZoomOpen:t=>e({zoomOpen:t}),setCopied:t=>e({copied:t})})),dW=/error on line (\d+)\s*[.:]?\s*(.*)$/i,a$e=/^[\s-]*\^\s*$/;function fW(e){return e.map(t=>t.trim()).filter(t=>t.length>0).join(" ")}function l$e(e){const t=e.trim();if(t.length===0)return{line:null,summary:"Unknown error",excerpt:null};const n=t.split(`
2751
2751
  `),r=n.findIndex(h=>dW.test(h)),i=r===-1?null:dW.exec(n[r]??"");if(i===null)return{line:null,summary:fW(n),excerpt:null};const s=Number(i[1]),o=n.slice(r+1),a=o.findIndex(h=>a$e.test(h)),l=a===-1?null:o.slice(0,a+1).join(`
2752
2752
  `),u=a===-1?o:o.slice(a+1),f=fW([i[2]??"",...u]);return{line:Number.isInteger(s)?s:null,summary:f.length>0?f:`Parse error on line ${String(s)}`,excerpt:l}}const c$e=[{from:"-.x",to:"-.-x"},{from:"-.o",to:"-.-o"}],fC={"[":"]","(":")","{":"}"};function u$e(e){const t=[];let n="",r=1,i=0,s=!1,o=!1,a=!1;const l=[];for(;i<e.length;){const u=e[i]??"";if(u===`
2753
- `){o=!1,a=!1,s=!1,l.length=0,r+=1,n+=u,i+=1;continue}if(o){n+=u,i+=1;continue}if(s){u==='"'&&(s=!1),n+=u,i+=1;continue}if(u==='"'){s=!0,n+=u,i+=1;continue}if(e.startsWith("%%",i)){o=!0,n+="%%",i+=2;continue}if(l.length>0){u===l[l.length-1]?l.pop():fC[u]&&l.push(fC[u]),n+=u,i+=1;continue}if(fC[u]){l.push(fC[u]),n+=u,i+=1;continue}if(u==="|"){a=!a,n+=u,i+=1;continue}if(a){n+=u,i+=1;continue}const f=c$e.find(h=>e.startsWith(h.from,i));if(f){n+=f.to,t.push({line:r,from:f.from,to:f.to}),i+=f.from.length;continue}n+=u,i+=1}return{source:n,repairs:t}}const d$e=["failed to fetch dynamically imported module","error loading dynamically imported module","importing a module script failed"];function f$e(e){const t=e.message.toLowerCase();return d$e.some(n=>t.includes(n))}function h$e(e){let t=null;return()=>(t||(t=e().catch(n=>{throw t=null,m5(n)})),t)}const p$e=h$e(()=>Z(()=>import("./mermaid.core-htyOC5rr.js").then(e=>e.bm),[]).then(e=>e.default));async function m$e(e,t,n){try{const{svg:r}=await e.render(t,n);return{svg:r,repairs:[]}}catch(r){const i=u$e(n);if(i.repairs.length===0)throw r;try{const{svg:s}=await e.render(`${t}-repaired`,i.source);return{svg:s,repairs:i.repairs}}catch{throw r}}}function g$e(e){const t=[];for(const n of e){const r=`${n.from} → ${n.to}`;t.includes(r)||t.push(r)}return t.join(", ")}function v$e({source:e,ports:t}){const{resolvedTheme:n}=VN(),r=n==="dark"?"dark":"default",i=ou.useScopedStore(k=>k.renderState),s=i.status==="error"?i.message:void 0,o=i.status==="error"&&i.kind==="stale-chunk",a=ou.useScopedStore(k=>k.showSource),l=ou.useScopedStore(k=>k.zoomOpen),u=ou.useScopedStore(k=>k.copied),f=ou.useScopedStore(k=>k.setRenderState),h=ou.useScopedStore(k=>k.setShowSource),m=ou.useScopedStore(k=>k.setZoomOpen),g=ou.useScopedStore(k=>k.setCopied),x=`mermaid-${_.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,y=_.useCallback(()=>m(!1),[m]),w=async()=>{await((t==null?void 0:t.clipboard)??aa).writeText(e),g(!0),((t==null?void 0:t.timer)??Jn).setTimeout(()=>g(!1),2e3)},C=(t==null?void 0:t.loadMermaid)??p$e;if(_.useEffect(()=>{let k=!1;return C().then(async E=>{E.initialize({startOnLoad:!1,securityLevel:"strict",theme:r});const{svg:N,repairs:T}=await m$e(E,x,e);k||f({status:"ready",svg:N,repairs:T})}).catch(E=>{if(k)return;const N=m5(E);if(f$e(N)){f({status:"error",kind:"stale-chunk"});return}f({status:"error",message:N.message})}),()=>{k=!0}},[e,r,x,f,C]),o)return c.jsxs("div",{className:"my-3",children:[c.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground mb-1",children:[c.jsx(Mf,{className:"size-3.5 shrink-0"}),c.jsx("span",{children:"This diagram needs the latest version of the app."}),c.jsxs(Ee,{variant:"ghost",size:"sm","aria-label":"Reload the app",className:"h-6 px-2 text-xs",onClick:()=>((t==null?void 0:t.dom)??Et).reload(),children:[c.jsx(u0,{className:"size-3 mr-1"}),"Reload"]})]}),c.jsx(Jw,{source:e})]});if(i.status==="error"){const k=l$e(s??"");return c.jsxs("div",{className:"my-3",children:[c.jsxs("div",{className:"flex items-start gap-1.5 text-xs text-destructive mb-1",children:[c.jsx(Mf,{className:"size-3.5 shrink-0 mt-px"}),c.jsxs("div",{className:"min-w-0",children:[c.jsxs("span",{children:["Couldn't render this Mermaid diagram",k.line!==null?c.jsxs("span",{className:"text-muted-foreground",children:[" — line ",c.jsx("span",{className:"tabular-nums",children:k.line})]}):null]}),c.jsx("div",{className:"text-muted-foreground",children:k.summary}),k.excerpt?c.jsx("pre",{className:"mt-1 overflow-x-auto rounded-md border border-border bg-muted px-2 py-1 font-mono text-xs leading-snug whitespace-pre text-muted-foreground",children:k.excerpt}):null]})]}),c.jsx(Jw,{source:e,highlightLine:k.line??void 0})]})}return i.status==="loading"?c.jsx("div",{className:"relative group/mermaid",children:c.jsx(Jw,{source:e})}):a?c.jsxs("div",{className:"relative group/mermaid",children:[c.jsx(Jw,{source:e}),c.jsx(hW,{showSource:a,onToggleSource:()=>h(!a),onCopy:w,copied:u,onZoom:void 0})]}):c.jsxs("div",{className:"relative group/mermaid my-3",children:[i.repairs.length>0&&c.jsxs("div",{className:"flex items-start gap-1.5 text-xs text-muted-foreground mb-1",children:[c.jsx(cve,{className:"size-3.5 shrink-0 mt-px"}),c.jsxs("span",{children:["Corrected ",c.jsx("span",{className:"tabular-nums",children:i.repairs.length}),i.repairs.length===1?" invalid link":" invalid links"," to render this (",c.jsx("span",{className:"font-mono",children:g$e(i.repairs)}),"). The source is unchanged."]})]}),c.jsx("div",{className:"flex justify-center overflow-x-auto",dangerouslySetInnerHTML:{__html:i.svg}}),c.jsx(hW,{showSource:a,onToggleSource:()=>h(!a),onCopy:w,copied:u,onZoom:()=>m(!0)}),l&&c.jsx(o$e,{svg:i.svg,onClose:y})]})}function Jre({source:e,ports:t}){return c.jsx(ou.Provider,{init:void 0,children:c.jsx(v$e,{source:e,ports:t})})}function hW({showSource:e,onToggleSource:t,onCopy:n,copied:r,onZoom:i}){return c.jsxs("div",{className:"absolute top-1.5 right-1.5 flex gap-1 opacity-100 md:opacity-0 md:group-hover/mermaid:opacity-100 transition-opacity [@media(hover:none)]:!opacity-100",children:[i&&!e&&c.jsx(Ee,{variant:"ghost",size:"icon","aria-label":"Zoom diagram",className:"h-8 w-8 rounded-md text-muted-foreground hover:text-foreground",onClick:i,children:c.jsx(Pme,{className:"h-4 w-4"})}),c.jsx(Ee,{variant:"ghost",size:"icon","aria-label":e?"View rendered diagram":"View diagram source",className:"h-8 w-8 rounded-md text-muted-foreground hover:text-foreground",onClick:t,children:c.jsx(aM,{className:"h-4 w-4"})}),c.jsx(Ee,{variant:"ghost",size:"icon","aria-label":r?"Copied":"Copy diagram source",className:ce("h-8 w-8 rounded-md text-muted-foreground",!r&&"hover:text-foreground",r&&"hover:!bg-transparent"),onClick:n,children:r?c.jsx(Cs,{className:"h-4 w-4 text-success"}):c.jsx(na,{className:"h-4 w-4"})})]})}class zf extends ed{constructor(n,r,i=Et){super(r);K(this,"__source");K(this,"__dom");this.__source=n,this.__dom=i}static getType(){return"kanna-mermaid"}static clone(n){return new zf(n.__source,n.__key,n.__dom)}static importJSON(n){return Zre(n.source)}exportJSON(){return{type:zf.getType(),version:1,source:this.__source}}createDOM(n,r){return this.__dom.createElement("div")}updateDOM(){return!1}isInline(){return!1}getTextContent(){return this.__source}decorate(n,r){return c.jsx(Jre,{source:this.__source})}}function Zre(e){return yi(new zf(e))}function b$e(e){return e instanceof zf}function x$e(e,t=28){if(e.length<=t)return e;const n="…",r=e.lastIndexOf("."),i=r>0&&e.length-r<=6,s=i?e.slice(r):"",o=i?e.slice(0,r):e,a=t-n.length-s.length;if(a<=2){const f=t-n.length,h=Math.ceil(f/2),m=Math.floor(f/2);return`${e.slice(0,h)}${n}${e.slice(e.length-m)}`}const l=Math.ceil(a/2),u=a-l;return`${o.slice(0,l)}${n}${o.slice(o.length-u)}${s}`}const y$e=new Set([".c",".cc",".cfg",".conf",".cpp",".cs",".css",".diff",".env",".go",".graphql",".h",".hpp",".html",".ini",".java",".js",".json",".jsonc",".jsx",".kt",".log",".lua",".md",".mjs",".patch",".php",".pl",".properties",".py",".rb",".rs",".scss",".sh",".sql",".swift",".toml",".ts",".tsx",".txt",".vue",".xml",".yaml",".yml",".zsh"]),_$e=new Set([".gitignore",".npmrc",".prettierrc",".python-version",".ruby-version",".tool-versions","Dockerfile","Gemfile","Makefile","Procfile"]);function hC(e){if(!e)return;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function pW(e){var r,i;const t=/^(?<path>\/.+?)#L(?<line>\d+)(?:C(?<column>\d+))?$/.exec(e);if((r=t==null?void 0:t.groups)!=null&&r.path)return{path:t.groups.path,line:hC(t.groups.line),column:hC(t.groups.column)};const n=/^(?<path>\/.+?):(?<line>\d+)(?::(?<column>\d+))?$/.exec(e);return(i=n==null?void 0:n.groups)!=null&&i.path?{path:n.groups.path,line:hC(n.groups.line),column:hC(n.groups.column)}:e.startsWith("/")?{path:e}:null}function S$e(e,t=Et){if(!e)return null;const n=e.trim();if(!n||/^(mailto:|ftp:|file:)/i.test(n))return null;if(/^https?:/i.test(n))try{const r=new URL(n);return r.origin!==t.getOrigin()||!r.pathname.startsWith("/")?null:pW(`${r.pathname}${r.hash}`)}catch{return null}return pW(n)}function w$e(e){const t=e.split(/[\\/]/);for(;t.length>0&&t[t.length-1]==="";)t.pop();const n=t.length>0?t[t.length-1]:e;if(_$e.has(n))return!0;const r=n.lastIndexOf(".");if(r<0)return!0;const i=n.slice(r).toLowerCase();return y$e.has(i)}const C$e=["/Users/","/home/","/private/","/tmp/","/var/","/opt/","/root/"];function k$e(e){return e?e.startsWith("file://")?!0:C$e.some(t=>e.startsWith(t)):!1}function eie(e){let t=e;if(t.startsWith("file://"))try{t=decodeURIComponent(new URL(t).pathname)}catch{t=t.slice(7)}return`/api/local-file?path=${encodeURIComponent(t)}`}function bf(e,t){if(!e)return"";if(t){const n=t.endsWith("/")?t:`${t}/`;if(e.startsWith(n))return e.slice(n.length);if(e===t)return""}return e.replace(/^\/home\/user\/workspace\//,"")}function Ab(e,t){return{id:e.id,contentUrl:e.contentUrl,displayName:e.displayName,fileName:e.displayName,relativePath:e.relativePath,mimeType:e.mimeType,size:e.size,origin:t}}const sy=Xt("LocalFileLinkCard",()=>e=>({probe:{kind:"loading"},previewOpen:!1,setProbe:t=>e({probe:t}),setPreviewOpen:t=>e({previewOpen:t})}));function E$e(e){const t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function N$e({path:e,linkText:t}){const n=_.useMemo(()=>eie(e),[e]),r=sy.useScopedStore(T=>T.probe),i=sy.useScopedStore(T=>T.previewOpen),s=sy.useScopedStore(T=>T.setProbe),o=sy.useScopedStore(T=>T.setPreviewOpen);_.useEffect(()=>{const T=new AbortController;return g5(n,{signal:T.signal}).then(R=>{T.signal.aborted||s(R)}),()=>T.abort()},[n,s]);const a=E$e(e),l=t||a,u=x$e(l,28),f=r.kind==="ready"?r.mimeType:"application/octet-stream",h=r.kind==="ready"?r.size:0,m={id:`local-file-${n}`,kind:"file",displayName:u,absolutePath:e,relativePath:e,contentUrl:n,mimeType:f,size:h};if(r.kind==="missing")return c.jsx("span",{className:"inline-flex align-bottom","data-testid":"local-file-link",children:c.jsx(ea,{attachment:m,disabledReason:"File no longer available"})});const g=mm(m),v=P0(g,f),x=h>0?gm(h):null,y=r.kind==="loading",w=r.kind==="error";let C;y?C=c.jsx("span",{className:"text-muted-foreground",children:"Fetching…"}):w?C=c.jsx("span",{className:"text-muted-foreground",children:"Unable to load"}):C=c.jsxs(c.Fragment,{children:[v,x?c.jsxs(c.Fragment,{children:[" · ",c.jsx("span",{className:"tabular-nums",children:x})]}):null]});const k=r.kind==="ready"?_b(m):null,E=k!==null&&!k.openInNewTab,N=[E?"Preview":"Download",l,v,x].filter(T=>!!T);return E?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"inline-flex align-bottom","data-testid":"local-file-link",children:c.jsx(ea,{attachment:m,onClick:()=>o(!0),meta:C,ariaLabel:N.join(", ")})}),c.jsx(Sm,{source:i?Ab(m,"local_file_link"):null,open:i,onOpenChange:o})]}):c.jsx("span",{className:"inline-flex align-bottom","data-testid":"local-file-link",children:c.jsx(ea,{attachment:m,href:n,download:a,meta:C,ariaLabel:N.join(", ")})})}function T$e({path:e,linkText:t}){return c.jsx(sy.Provider,{init:void 0,children:c.jsx(N$e,{path:e,linkText:t})})}class Uf extends ed{constructor(n,r,i,s,o=Et){super(s);K(this,"__path");K(this,"__line");K(this,"__column");K(this,"__dom");this.__path=n,this.__line=r,this.__column=i,this.__dom=o}static getType(){return"kanna-local-file-link"}static clone(n){return new Uf(n.__path,n.__line,n.__column,n.__key,n.__dom)}static importJSON(n){return tie({path:n.path,line:n.line,column:n.column})}exportJSON(){const n={type:Uf.getType(),version:1,path:this.__path};return this.__line!==void 0&&(n.line=this.__line),this.__column!==void 0&&(n.column=this.__column),n}createDOM(n,r){return this.__dom.createElement("span")}updateDOM(){return!1}isInline(){return!0}getTextContent(){return this.__path}decorate(n,r){const i=this.__line!==void 0?`${this.__path}:${this.__line}${this.__column!==void 0?`:${this.__column}`:""}`:void 0;return c.jsx(T$e,{path:this.__path,linkText:i})}}function tie(e){return yi(new Uf(e.path,e.line,e.column))}function A$e(e){return e instanceof Uf}class H_ extends ed{constructor(n,r,i=Et){super(r);K(this,"__content");K(this,"__dom");this.__content=n,this.__dom=i}static getType(){return"kanna-thinking"}static clone(n){return new H_(n.__content,n.__key,n.__dom)}static importJSON(n){return j$e(n.content)}exportJSON(){return{type:H_.getType(),version:1,content:this.__content}}createDOM(n,r){return this.__dom.createElement("div")}updateDOM(){return!1}isInline(){return!1}getTextContent(){return this.__content}decorate(n,r){return c.jsx(KN,{content:this.__content})}}function j$e(e){return yi(new H_(e))}const R$e=[z_,U_,Jv],M$e=[zf,Uf,H_],P$e=/^[ \t]*(`{3,})[ \t]*mermaid[ \t]*$/i,I$e=/^[ \t]*`{3,}[ \t]*$/;function O$e(e){return new RegExp(`^[ \\t]*\`{${String(e)},}[ \\t]*$`)}function D$e(e,t,n){const r=O$e(n.length),i=[];let s=t;for(let o=t+1;o<e.length;o++){const a=e[o];if(a===void 0||(s=o,r.test(a)))break;i.push(a)}return{source:i.join(`
2753
+ `){o=!1,a=!1,s=!1,l.length=0,r+=1,n+=u,i+=1;continue}if(o){n+=u,i+=1;continue}if(s){u==='"'&&(s=!1),n+=u,i+=1;continue}if(u==='"'){s=!0,n+=u,i+=1;continue}if(e.startsWith("%%",i)){o=!0,n+="%%",i+=2;continue}if(l.length>0){u===l[l.length-1]?l.pop():fC[u]&&l.push(fC[u]),n+=u,i+=1;continue}if(fC[u]){l.push(fC[u]),n+=u,i+=1;continue}if(u==="|"){a=!a,n+=u,i+=1;continue}if(a){n+=u,i+=1;continue}const f=c$e.find(h=>e.startsWith(h.from,i));if(f){n+=f.to,t.push({line:r,from:f.from,to:f.to}),i+=f.from.length;continue}n+=u,i+=1}return{source:n,repairs:t}}const d$e=["failed to fetch dynamically imported module","error loading dynamically imported module","importing a module script failed"];function f$e(e){const t=e.message.toLowerCase();return d$e.some(n=>t.includes(n))}function h$e(e){let t=null;return()=>(t||(t=e().catch(n=>{throw t=null,m5(n)})),t)}const p$e=h$e(()=>Z(()=>import("./mermaid.core-BTsaN5I_.js").then(e=>e.bm),[]).then(e=>e.default));async function m$e(e,t,n){try{const{svg:r}=await e.render(t,n);return{svg:r,repairs:[]}}catch(r){const i=u$e(n);if(i.repairs.length===0)throw r;try{const{svg:s}=await e.render(`${t}-repaired`,i.source);return{svg:s,repairs:i.repairs}}catch{throw r}}}function g$e(e){const t=[];for(const n of e){const r=`${n.from} → ${n.to}`;t.includes(r)||t.push(r)}return t.join(", ")}function v$e({source:e,ports:t}){const{resolvedTheme:n}=VN(),r=n==="dark"?"dark":"default",i=ou.useScopedStore(k=>k.renderState),s=i.status==="error"?i.message:void 0,o=i.status==="error"&&i.kind==="stale-chunk",a=ou.useScopedStore(k=>k.showSource),l=ou.useScopedStore(k=>k.zoomOpen),u=ou.useScopedStore(k=>k.copied),f=ou.useScopedStore(k=>k.setRenderState),h=ou.useScopedStore(k=>k.setShowSource),m=ou.useScopedStore(k=>k.setZoomOpen),g=ou.useScopedStore(k=>k.setCopied),x=`mermaid-${_.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,y=_.useCallback(()=>m(!1),[m]),w=async()=>{await((t==null?void 0:t.clipboard)??aa).writeText(e),g(!0),((t==null?void 0:t.timer)??Jn).setTimeout(()=>g(!1),2e3)},C=(t==null?void 0:t.loadMermaid)??p$e;if(_.useEffect(()=>{let k=!1;return C().then(async E=>{E.initialize({startOnLoad:!1,securityLevel:"strict",theme:r});const{svg:N,repairs:T}=await m$e(E,x,e);k||f({status:"ready",svg:N,repairs:T})}).catch(E=>{if(k)return;const N=m5(E);if(f$e(N)){f({status:"error",kind:"stale-chunk"});return}f({status:"error",message:N.message})}),()=>{k=!0}},[e,r,x,f,C]),o)return c.jsxs("div",{className:"my-3",children:[c.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground mb-1",children:[c.jsx(Mf,{className:"size-3.5 shrink-0"}),c.jsx("span",{children:"This diagram needs the latest version of the app."}),c.jsxs(Ee,{variant:"ghost",size:"sm","aria-label":"Reload the app",className:"h-6 px-2 text-xs",onClick:()=>((t==null?void 0:t.dom)??Et).reload(),children:[c.jsx(u0,{className:"size-3 mr-1"}),"Reload"]})]}),c.jsx(Jw,{source:e})]});if(i.status==="error"){const k=l$e(s??"");return c.jsxs("div",{className:"my-3",children:[c.jsxs("div",{className:"flex items-start gap-1.5 text-xs text-destructive mb-1",children:[c.jsx(Mf,{className:"size-3.5 shrink-0 mt-px"}),c.jsxs("div",{className:"min-w-0",children:[c.jsxs("span",{children:["Couldn't render this Mermaid diagram",k.line!==null?c.jsxs("span",{className:"text-muted-foreground",children:[" — line ",c.jsx("span",{className:"tabular-nums",children:k.line})]}):null]}),c.jsx("div",{className:"text-muted-foreground",children:k.summary}),k.excerpt?c.jsx("pre",{className:"mt-1 overflow-x-auto rounded-md border border-border bg-muted px-2 py-1 font-mono text-xs leading-snug whitespace-pre text-muted-foreground",children:k.excerpt}):null]})]}),c.jsx(Jw,{source:e,highlightLine:k.line??void 0})]})}return i.status==="loading"?c.jsx("div",{className:"relative group/mermaid",children:c.jsx(Jw,{source:e})}):a?c.jsxs("div",{className:"relative group/mermaid",children:[c.jsx(Jw,{source:e}),c.jsx(hW,{showSource:a,onToggleSource:()=>h(!a),onCopy:w,copied:u,onZoom:void 0})]}):c.jsxs("div",{className:"relative group/mermaid my-3",children:[i.repairs.length>0&&c.jsxs("div",{className:"flex items-start gap-1.5 text-xs text-muted-foreground mb-1",children:[c.jsx(cve,{className:"size-3.5 shrink-0 mt-px"}),c.jsxs("span",{children:["Corrected ",c.jsx("span",{className:"tabular-nums",children:i.repairs.length}),i.repairs.length===1?" invalid link":" invalid links"," to render this (",c.jsx("span",{className:"font-mono",children:g$e(i.repairs)}),"). The source is unchanged."]})]}),c.jsx("div",{className:"flex justify-center overflow-x-auto",dangerouslySetInnerHTML:{__html:i.svg}}),c.jsx(hW,{showSource:a,onToggleSource:()=>h(!a),onCopy:w,copied:u,onZoom:()=>m(!0)}),l&&c.jsx(o$e,{svg:i.svg,onClose:y})]})}function Jre({source:e,ports:t}){return c.jsx(ou.Provider,{init:void 0,children:c.jsx(v$e,{source:e,ports:t})})}function hW({showSource:e,onToggleSource:t,onCopy:n,copied:r,onZoom:i}){return c.jsxs("div",{className:"absolute top-1.5 right-1.5 flex gap-1 opacity-100 md:opacity-0 md:group-hover/mermaid:opacity-100 transition-opacity [@media(hover:none)]:!opacity-100",children:[i&&!e&&c.jsx(Ee,{variant:"ghost",size:"icon","aria-label":"Zoom diagram",className:"h-8 w-8 rounded-md text-muted-foreground hover:text-foreground",onClick:i,children:c.jsx(Pme,{className:"h-4 w-4"})}),c.jsx(Ee,{variant:"ghost",size:"icon","aria-label":e?"View rendered diagram":"View diagram source",className:"h-8 w-8 rounded-md text-muted-foreground hover:text-foreground",onClick:t,children:c.jsx(aM,{className:"h-4 w-4"})}),c.jsx(Ee,{variant:"ghost",size:"icon","aria-label":r?"Copied":"Copy diagram source",className:ce("h-8 w-8 rounded-md text-muted-foreground",!r&&"hover:text-foreground",r&&"hover:!bg-transparent"),onClick:n,children:r?c.jsx(Cs,{className:"h-4 w-4 text-success"}):c.jsx(na,{className:"h-4 w-4"})})]})}class zf extends ed{constructor(n,r,i=Et){super(r);K(this,"__source");K(this,"__dom");this.__source=n,this.__dom=i}static getType(){return"kanna-mermaid"}static clone(n){return new zf(n.__source,n.__key,n.__dom)}static importJSON(n){return Zre(n.source)}exportJSON(){return{type:zf.getType(),version:1,source:this.__source}}createDOM(n,r){return this.__dom.createElement("div")}updateDOM(){return!1}isInline(){return!1}getTextContent(){return this.__source}decorate(n,r){return c.jsx(Jre,{source:this.__source})}}function Zre(e){return yi(new zf(e))}function b$e(e){return e instanceof zf}function x$e(e,t=28){if(e.length<=t)return e;const n="…",r=e.lastIndexOf("."),i=r>0&&e.length-r<=6,s=i?e.slice(r):"",o=i?e.slice(0,r):e,a=t-n.length-s.length;if(a<=2){const f=t-n.length,h=Math.ceil(f/2),m=Math.floor(f/2);return`${e.slice(0,h)}${n}${e.slice(e.length-m)}`}const l=Math.ceil(a/2),u=a-l;return`${o.slice(0,l)}${n}${o.slice(o.length-u)}${s}`}const y$e=new Set([".c",".cc",".cfg",".conf",".cpp",".cs",".css",".diff",".env",".go",".graphql",".h",".hpp",".html",".ini",".java",".js",".json",".jsonc",".jsx",".kt",".log",".lua",".md",".mjs",".patch",".php",".pl",".properties",".py",".rb",".rs",".scss",".sh",".sql",".swift",".toml",".ts",".tsx",".txt",".vue",".xml",".yaml",".yml",".zsh"]),_$e=new Set([".gitignore",".npmrc",".prettierrc",".python-version",".ruby-version",".tool-versions","Dockerfile","Gemfile","Makefile","Procfile"]);function hC(e){if(!e)return;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function pW(e){var r,i;const t=/^(?<path>\/.+?)#L(?<line>\d+)(?:C(?<column>\d+))?$/.exec(e);if((r=t==null?void 0:t.groups)!=null&&r.path)return{path:t.groups.path,line:hC(t.groups.line),column:hC(t.groups.column)};const n=/^(?<path>\/.+?):(?<line>\d+)(?::(?<column>\d+))?$/.exec(e);return(i=n==null?void 0:n.groups)!=null&&i.path?{path:n.groups.path,line:hC(n.groups.line),column:hC(n.groups.column)}:e.startsWith("/")?{path:e}:null}function S$e(e,t=Et){if(!e)return null;const n=e.trim();if(!n||/^(mailto:|ftp:|file:)/i.test(n))return null;if(/^https?:/i.test(n))try{const r=new URL(n);return r.origin!==t.getOrigin()||!r.pathname.startsWith("/")?null:pW(`${r.pathname}${r.hash}`)}catch{return null}return pW(n)}function w$e(e){const t=e.split(/[\\/]/);for(;t.length>0&&t[t.length-1]==="";)t.pop();const n=t.length>0?t[t.length-1]:e;if(_$e.has(n))return!0;const r=n.lastIndexOf(".");if(r<0)return!0;const i=n.slice(r).toLowerCase();return y$e.has(i)}const C$e=["/Users/","/home/","/private/","/tmp/","/var/","/opt/","/root/"];function k$e(e){return e?e.startsWith("file://")?!0:C$e.some(t=>e.startsWith(t)):!1}function eie(e){let t=e;if(t.startsWith("file://"))try{t=decodeURIComponent(new URL(t).pathname)}catch{t=t.slice(7)}return`/api/local-file?path=${encodeURIComponent(t)}`}function bf(e,t){if(!e)return"";if(t){const n=t.endsWith("/")?t:`${t}/`;if(e.startsWith(n))return e.slice(n.length);if(e===t)return""}return e.replace(/^\/home\/user\/workspace\//,"")}function Ab(e,t){return{id:e.id,contentUrl:e.contentUrl,displayName:e.displayName,fileName:e.displayName,relativePath:e.relativePath,mimeType:e.mimeType,size:e.size,origin:t}}const sy=Xt("LocalFileLinkCard",()=>e=>({probe:{kind:"loading"},previewOpen:!1,setProbe:t=>e({probe:t}),setPreviewOpen:t=>e({previewOpen:t})}));function E$e(e){const t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function N$e({path:e,linkText:t}){const n=_.useMemo(()=>eie(e),[e]),r=sy.useScopedStore(T=>T.probe),i=sy.useScopedStore(T=>T.previewOpen),s=sy.useScopedStore(T=>T.setProbe),o=sy.useScopedStore(T=>T.setPreviewOpen);_.useEffect(()=>{const T=new AbortController;return g5(n,{signal:T.signal}).then(R=>{T.signal.aborted||s(R)}),()=>T.abort()},[n,s]);const a=E$e(e),l=t||a,u=x$e(l,28),f=r.kind==="ready"?r.mimeType:"application/octet-stream",h=r.kind==="ready"?r.size:0,m={id:`local-file-${n}`,kind:"file",displayName:u,absolutePath:e,relativePath:e,contentUrl:n,mimeType:f,size:h};if(r.kind==="missing")return c.jsx("span",{className:"inline-flex align-bottom","data-testid":"local-file-link",children:c.jsx(ea,{attachment:m,disabledReason:"File no longer available"})});const g=mm(m),v=P0(g,f),x=h>0?gm(h):null,y=r.kind==="loading",w=r.kind==="error";let C;y?C=c.jsx("span",{className:"text-muted-foreground",children:"Fetching…"}):w?C=c.jsx("span",{className:"text-muted-foreground",children:"Unable to load"}):C=c.jsxs(c.Fragment,{children:[v,x?c.jsxs(c.Fragment,{children:[" · ",c.jsx("span",{className:"tabular-nums",children:x})]}):null]});const k=r.kind==="ready"?_b(m):null,E=k!==null&&!k.openInNewTab,N=[E?"Preview":"Download",l,v,x].filter(T=>!!T);return E?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"inline-flex align-bottom","data-testid":"local-file-link",children:c.jsx(ea,{attachment:m,onClick:()=>o(!0),meta:C,ariaLabel:N.join(", ")})}),c.jsx(Sm,{source:i?Ab(m,"local_file_link"):null,open:i,onOpenChange:o})]}):c.jsx("span",{className:"inline-flex align-bottom","data-testid":"local-file-link",children:c.jsx(ea,{attachment:m,href:n,download:a,meta:C,ariaLabel:N.join(", ")})})}function T$e({path:e,linkText:t}){return c.jsx(sy.Provider,{init:void 0,children:c.jsx(N$e,{path:e,linkText:t})})}class Uf extends ed{constructor(n,r,i,s,o=Et){super(s);K(this,"__path");K(this,"__line");K(this,"__column");K(this,"__dom");this.__path=n,this.__line=r,this.__column=i,this.__dom=o}static getType(){return"kanna-local-file-link"}static clone(n){return new Uf(n.__path,n.__line,n.__column,n.__key,n.__dom)}static importJSON(n){return tie({path:n.path,line:n.line,column:n.column})}exportJSON(){const n={type:Uf.getType(),version:1,path:this.__path};return this.__line!==void 0&&(n.line=this.__line),this.__column!==void 0&&(n.column=this.__column),n}createDOM(n,r){return this.__dom.createElement("span")}updateDOM(){return!1}isInline(){return!0}getTextContent(){return this.__path}decorate(n,r){const i=this.__line!==void 0?`${this.__path}:${this.__line}${this.__column!==void 0?`:${this.__column}`:""}`:void 0;return c.jsx(T$e,{path:this.__path,linkText:i})}}function tie(e){return yi(new Uf(e.path,e.line,e.column))}function A$e(e){return e instanceof Uf}class H_ extends ed{constructor(n,r,i=Et){super(r);K(this,"__content");K(this,"__dom");this.__content=n,this.__dom=i}static getType(){return"kanna-thinking"}static clone(n){return new H_(n.__content,n.__key,n.__dom)}static importJSON(n){return j$e(n.content)}exportJSON(){return{type:H_.getType(),version:1,content:this.__content}}createDOM(n,r){return this.__dom.createElement("div")}updateDOM(){return!1}isInline(){return!1}getTextContent(){return this.__content}decorate(n,r){return c.jsx(KN,{content:this.__content})}}function j$e(e){return yi(new H_(e))}const R$e=[z_,U_,Jv],M$e=[zf,Uf,H_],P$e=/^[ \t]*(`{3,})[ \t]*mermaid[ \t]*$/i,I$e=/^[ \t]*`{3,}[ \t]*$/;function O$e(e){return new RegExp(`^[ \\t]*\`{${String(e)},}[ \\t]*$`)}function D$e(e,t,n){const r=O$e(n.length),i=[];let s=t;for(let o=t+1;o<e.length;o++){const a=e[o];if(a===void 0||(s=o,r.test(a)))break;i.push(a)}return{source:i.join(`
2754
2754
  `),lastLineIndex:s}}const L$e={type:"multiline-element",dependencies:[zf],regExpStart:P$e,regExpEnd:{optional:!0,regExp:I$e},handleImportAfterStartMatch({lines:e,rootNode:t,startLineIndex:n,startMatch:r}){const{source:i,lastLineIndex:s}=D$e(e,n,r[1]??"```");return t.append(Zre(i)),[!0,s]},replace(e,t,n,r,i,s){return!1},export(e){return e instanceof zf?`\`\`\`mermaid
2755
2755
  ${e.getTextContent()}
2756
2756
  \`\`\``:null}},nie="(?:file://|/(?:Users|home|private|tmp|var|opt|root)/)",$$e=new RegExp(`\\[(.+?)\\]\\((${nie}[^)\\s]*)\\)`),B$e=new RegExp(`\\[([^[\\]]+)\\]\\((${nie}[^)\\s]*)\\)$`),F$e={type:"text-match",dependencies:[Uf],importRegExp:$$e,regExp:B$e,trigger:")",replace(e,t){const n=t[2];if(!n)return;const r=S$e(n);if(!r||!k$e(r.path)&&!n.startsWith("/"))return;const i=tie({path:r.path,line:r.line,column:r.column});e.replace(i)},export(e){if(!(e instanceof Uf))return null;const t=e.getTextContent();return`[${t}](${t})`}},z$e=[L$e,F$e,...Vre],U$e=[Tb,Nb,rd,Cc,Eb,q0,Jf,zN,Wu,_m,mc,...M$e];let rie=0;function ui(){return String(rie++)}let Ug=null,Hg=null;const mW={h1:"text-20 font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",h2:"text-18 font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",h3:"text-16 font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",h4:"text-16 font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",h5:"text-16 font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",h6:"text-16 font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0"};function iie(e){if(b$e(e)&&Ug&&Hg)return c.jsx("span",{children:e.decorate(Ug,Hg)},ui());if(A$e(e)&&Ug&&Hg)return c.jsx("span",{children:e.decorate(Ug,Hg)},ui());if(h3(e)){const n=e.getTag(),r=Ld(e),i=mW[n]??mW.h1,s=ui();switch(n){case"h1":return c.jsx("h1",{className:i,children:r},s);case"h2":return c.jsx("h2",{className:i,children:r},s);case"h3":return c.jsx("h3",{className:i,children:r},s);case"h4":return c.jsx("h4",{className:i,children:r},s);case"h5":return c.jsx("h5",{className:i,children:r},s);default:return c.jsx("h6",{className:i,children:r},s)}}if(B_(e))return c.jsx("blockquote",{className:"my-2 mt-5 mb-3 first:mt-0 last:mb-0 border-l-2 border-border/80 pl-2 text-muted-foreground",children:Ld(e)},ui());if(qa(e))return c.jsx("p",{className:"break-words mt-5 mb-3 first:mt-0 last:mb-0",children:Ld(e)},ui());if(G0(e)){const n=e.getLanguage()??"",r=e.getChildren().map(i=>$e(i)||Yv(i)?i.getTextContent():bi(i)?`
@@ -1,2 +1,2 @@
1
- import{_ as a,l as s,L as o,e as i}from"./mermaid.core-htyOC5rr.js";import{p as g}from"./wardley-L42UT6IY-D8NDkHkL.js";import"./index-DxxsM33V.js";var p={parse:a(async r=>{const e=await g("info",r);s.debug(e)},"parse")},v={version:"11.15.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,n)=>{s.debug(`rendering info diagram
1
+ import{_ as a,l as s,L as o,e as i}from"./mermaid.core-BTsaN5I_.js";import{p as g}from"./wardley-L42UT6IY-Durvz2BX.js";import"./index-J8bLuFmc.js";var p={parse:a(async r=>{const e=await g("info",r);s.debug(e)},"parse")},v={version:"11.15.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,n)=>{s.debug(`rendering info diagram
2
2
  `+r);const t=o(e);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw"),l={draw:c},b={parser:p,db:m,renderer:l};export{b as diagram};
@@ -1,4 +1,4 @@
1
- import{_ as o,c as ot,a4 as ut,L as dt,al as yt,A as ft,k as pt,q as it,a as gt,b as kt,g as mt,s as wt,t as _t,e as bt}from"./mermaid.core-htyOC5rr.js";import"./index-DxxsM33V.js";var tt=(function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],N={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],p=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function j(P){i.length=i.length-2*P,p.length=p.length-P,n.length=n.length-P}o(j,"popStack");function z(){var P;return P=u.pop()||b.lex()||E,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}o(z,"lex");for(var A,W,B,K,H={},X,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?B=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=z()),B=v[W]&&v[W][A]),typeof B>"u"||!B.length||!B[0]){var Q="";Y=[];for(X in v[W])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
1
+ import{_ as o,c as ot,a4 as ut,L as dt,al as yt,A as ft,k as pt,q as it,a as gt,b as kt,g as mt,s as wt,t as _t,e as bt}from"./mermaid.core-BTsaN5I_.js";import"./index-J8bLuFmc.js";var tt=(function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],N={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],p=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function j(P){i.length=i.length-2*P,p.length=p.length-P,n.length=n.length-P}o(j,"popStack");function z(){var P;return P=u.pop()||b.lex()||E,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}o(z,"lex");for(var A,W,B,K,H={},X,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?B=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=z()),B=v[W]&&v[W][A]),typeof B>"u"||!B.length||!B[0]){var Q="";Y=[];for(X in v[W])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
2
2
  `+b.showPosition()+`
3
3
  Expecting `+Y.join(", ")+", got '"+(this.terminals_[A]||A)+"'":Q="Parse error on line "+(I+1)+": Unexpected "+(A==E?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(Q,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:T,expected:Y})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(B[0]){case 1:i.push(A),p.push(b.yytext),n.push(b.yylloc),i.push(B[1]),A=null,S=b.yyleng,w=b.yytext,I=b.yylineno,T=b.yylloc;break;case 2:if(V=this.productions_[B[1]][1],H.$=p[p.length-V],H._$={first_line:n[n.length-(V||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(V||1)].first_column,last_column:n[n.length-1].last_column},D&&(H._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),K=this.performAction.apply(H,[w,S,I,C.yy,B[1],p,n].concat(R)),typeof K<"u")return K;V&&(i=i.slice(0,-1*V*2),p=p.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[B[1]][0]),p.push(H.$),n.push(H._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=(function(){var M={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{g as gt}from"./chunk-FMBD7UC4-BHYf0WjD.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-ND2GUHAM-DB_eDch5.js";import{g as _t,s as vt,a as bt,b as wt,t as Tt,q as St,_ as s,c as R,d as X,e as $t,A as Mt}from"./mermaid.core-htyOC5rr.js";import{d as it}from"./arc-BjpfMxgS.js";import"./index-DxxsM33V.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
1
+ import{g as gt}from"./chunk-FMBD7UC4-C5E8nihw.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-ND2GUHAM-CZfKotvF.js";import{g as _t,s as vt,a as bt,b as wt,t as Tt,q as St,_ as s,c as R,d as X,e as $t,A as Mt}from"./mermaid.core-BTsaN5I_.js";import{d as it}from"./arc-2NesLEd4.js";import"./index-J8bLuFmc.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
2
2
  `+_.showPosition()+`
3
3
  Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":H="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(H,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=(function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{_ as c,l as te,c as W,L as fe,ah as ye,ai as be,aj as me,af as _e,I as Y,i as G,v as ke,J as Ee,ac as Se,ad as le,ae as ce}from"./mermaid.core-htyOC5rr.js";import{g as Ne}from"./chunk-FMBD7UC4-BHYf0WjD.js";import"./index-DxxsM33V.js";var $=(function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],j=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],M=[1,35],U=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:j}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:M,11:U}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:j}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:M,11:U}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;e.push(q);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,Q,F={},X,I,oe,K;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=B[R]&&B[R][E]),typeof v>"u"||!v.length||!v[0]){var Z="";K=[];for(X in B[R])this.terminals_[X]&&X>ue&&K.push("'"+this.terminals_[X]+"'");m.showPosition?Z="Parse error on line "+(z+1)+`:
1
+ import{_ as c,l as te,c as W,L as fe,ah as ye,ai as be,aj as me,af as _e,I as Y,i as G,v as ke,J as Ee,ac as Se,ad as le,ae as ce}from"./mermaid.core-BTsaN5I_.js";import{g as Ne}from"./chunk-FMBD7UC4-C5E8nihw.js";import"./index-J8bLuFmc.js";var $=(function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],j=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],M=[1,35],U=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:j}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:M,11:U}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:j}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:M,11:U}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;e.push(q);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,Q,F={},X,I,oe,K;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=B[R]&&B[R][E]),typeof v>"u"||!v.length||!v[0]){var Z="";K=[];for(X in B[R])this.terminals_[X]&&X>ue&&K.push("'"+this.terminals_[X]+"'");m.showPosition?Z="Parse error on line "+(z+1)+`:
2
2
  `+m.showPosition()+`
3
3
  Expecting `+K.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Z="Parse error on line "+(z+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Z,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:q,expected:K})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+E);switch(v[0]){case 1:a.push(E),u.push(m.yytext),e.push(m.yylloc),a.push(v[1]),E=null,ie=m.yyleng,l=m.yytext,z=m.yylineno,q=m.yylloc;break;case 2:if(I=this.productions_[v[1]][1],F.$=u[u.length-I],F._$={first_line:e[e.length-(I||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(I||1)].first_column,last_column:e[e.length-1].last_column},de&&(F._$.range=[e[e.length-(I||1)].range[0],e[e.length-1].range[1]]),Q=this.performAction.apply(F,[l,ie,z,T.yy,v[1],u,e].concat(ge)),typeof Q<"u")return Q;I&&(a=a.slice(0,-1*I*2),u=u.slice(0,-1*I),e=e.slice(0,-1*I)),a.push(this.productions_[v[1]][0]),u.push(F.$),e.push(F._$),oe=B[a[a.length-2]][a[a.length-1]],a.push(oe);break;case 3:return!0}}return!0},"parse")},y=(function(){var _={EOF:1,parseError:c(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:c(function(s,n){return this.yy=n||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:c(function(s){var n=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:c(function(s){this.unput(this.match.slice(s))},"less"),pastInput:c(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{b7 as j,b8 as p,b9 as w,ba as k,bb as q}from"./mermaid.core-htyOC5rr.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function E(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function G(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function H(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function J(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function K(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=d(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function L(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function Q(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=d(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function d(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?L:J(r)?H:Array.isArray(r)?K:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Q:p)(n,r)}function U(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function W(n){return Math.max(0,-g(Math.abs(n)))}function X(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Y(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function Z(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function N(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:Z(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=N(u,e),f=t(a,f)):(e=N(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=N(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=x(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=d,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t};
1
+ import{b7 as j,b8 as p,b9 as w,ba as k,bb as q}from"./mermaid.core-BTsaN5I_.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function E(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function G(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function H(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function J(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function K(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=d(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function L(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function Q(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=d(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function d(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?L:J(r)?H:Array.isArray(r)?K:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Q:p)(n,r)}function U(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function W(n){return Math.max(0,-g(Math.abs(n)))}function X(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Y(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function Z(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function N(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:Z(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=N(u,e),f=t(a,f)):(e=N(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=N(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=x(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=d,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t};