dorkos 0.92.0 → 0.94.0

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 (95) hide show
  1. package/core-extensions/hello-world/index.ts +69 -4
  2. package/dist/bin/cli.js +3617 -959
  3. package/dist/client/assets/{AboutPage-CtAhGJVI.js → AboutPage-ESdr5ej6.js} +1 -1
  4. package/dist/client/assets/{AdapterIcon-DTXuj6Zu.js → AdapterIcon-C2oG4Wi0.js} +1 -1
  5. package/dist/client/assets/{AppearancePage-EJF8LarY.js → AppearancePage-BkLDttbk.js} +1 -1
  6. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-COy_dBa2.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-DrUBXr8b.js} +24 -24
  7. package/dist/client/assets/{BlintzCanvas-Bb84mtl-.js → BlintzCanvas-BqJDhl-U.js} +1 -1
  8. package/dist/client/assets/{CanvasCsvContent-D1y22lqg.js → CanvasCsvContent-DAsWhu2A.js} +1 -1
  9. package/dist/client/assets/{CanvasFileContent-CbOnIUPF.js → CanvasFileContent-CFpGh9lB.js} +2 -2
  10. package/dist/client/assets/{CanvasModel3dContent-Bv86PZ-y.js → CanvasModel3dContent-DorTDn1y.js} +2 -2
  11. package/dist/client/assets/{CodeMirrorDiff-CXqMnztG.js → CodeMirrorDiff-ChMTPEBY.js} +1 -1
  12. package/dist/client/assets/{CodeMirrorEditor-DHSY565t.js → CodeMirrorEditor-DtYzxmC5.js} +1 -1
  13. package/dist/client/assets/{ConnectionAccessLists-D5Qo1i-D.js → ConnectionAccessLists-DnxFiJIp.js} +1 -1
  14. package/dist/client/assets/{ConnectionsPage-DFvJRdx7.js → ConnectionsPage-Exq_5IiP.js} +2 -2
  15. package/dist/client/assets/ConventionPage-DXnlTX8j.js +11 -0
  16. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-BDQA6n2J.js → FloatingTanStackRouterDevtools-CqogiFob-CEzhHBdz.js} +1 -1
  17. package/dist/client/assets/HandlePage-C1AzkGxs.js +1 -0
  18. package/dist/client/assets/{LexicalField-a7Ov2ETq.js → LexicalField-DJfTqKnT.js} +1 -1
  19. package/dist/client/assets/{ManagesPage-Czapr6qD.js → ManagesPage-BAYoqzuu.js} +1 -1
  20. package/dist/client/assets/{Model3dViewer-C_lFbWIi.js → Model3dViewer-DgKQPqJb.js} +1 -1
  21. package/dist/client/assets/NamePage-BDAAuJFs.js +1 -0
  22. package/dist/client/assets/{NotificationsPage-CdQCyMJk.js → NotificationsPage-CrGzgL1F.js} +1 -1
  23. package/dist/client/assets/{PermissionsPage-DLT-RkUE.js → PermissionsPage-CRq4hxB-.js} +1 -1
  24. package/dist/client/assets/{PersonalityPopover-BeOdD7eK.js → PersonalityPopover-CoJNGa7f.js} +1 -1
  25. package/dist/client/assets/PhotoPage-DFLk5ALL.js +1 -0
  26. package/dist/client/assets/{RoomsPage-CuZJdN_k.js → RoomsPage-DfJvCi90.js} +1 -1
  27. package/dist/client/assets/{RunsOnPopover-DspQEAdG.js → RunsOnPopover-UixmCBm5.js} +1 -1
  28. package/dist/client/assets/{SessionsPage-Ctwlg7GN.js → SessionsPage-D8BzdYL7.js} +2 -2
  29. package/dist/client/assets/{SkillsPage-DJdFnWfL.js → SkillsPage-B6yHwhAp.js} +1 -1
  30. package/dist/client/assets/{TasksPage-9jCfZB7f.js → TasksPage-KFUMW7h0.js} +1 -1
  31. package/dist/client/assets/{ToolsPage-W7zK5P0s.js → ToolsPage-Dd7DXlpE.js} +2 -2
  32. package/dist/client/assets/{TopologyGraph-CQga4Nuw.js → TopologyGraph-CJj2myGV.js} +5 -5
  33. package/dist/client/assets/{agent-browser-CoSmBP5N.js → agent-browser-C48rts1h.js} +1 -1
  34. package/dist/client/assets/{highlighted-body-KPVGNVTW-Bq_O6Zlj.js → highlighted-body-KPVGNVTW-CvHOdigG.js} +1 -1
  35. package/dist/client/assets/{index-DT9R_NnS.js → index-1tkVhrNa.js} +1 -1
  36. package/dist/client/assets/{index-Bj32H2Xz.js → index-3nUBnton.js} +3 -3
  37. package/dist/client/assets/{index-nztBriGg.js → index-672L_-Ce.js} +3 -3
  38. package/dist/client/assets/{index-D4nkiaT7.js → index-9lsrtJLf.js} +1 -1
  39. package/dist/client/assets/{index-THAVeZRE.js → index-B1N7_mWs.js} +1 -1
  40. package/dist/client/assets/index-B4Z9VBPe.js +1678 -0
  41. package/dist/client/assets/{index-DrD7x9EL.js → index-BK5zyBqg.js} +1 -1
  42. package/dist/client/assets/{index-Bat0bq64.js → index-BNO2TT-L.js} +1 -1
  43. package/dist/client/assets/{index-ULWpcSAZ.js → index-BSj4LDYi.js} +1 -1
  44. package/dist/client/assets/{index-cNE108-h.js → index-B_0gazbk.js} +1 -1
  45. package/dist/client/assets/{index-E7ZNee_E.js → index-BgBnbdck.js} +1 -1
  46. package/dist/client/assets/{index-CKY7hz-9.js → index-BhxMJfLU.js} +1 -1
  47. package/dist/client/assets/{index-B4oYDFdX.js → index-BlNzH0bV.js} +1 -1
  48. package/dist/client/assets/{index-Dx0uYGgf.js → index-BmYSSGWx.js} +1 -1
  49. package/dist/client/assets/{index-DcwZU98u.js → index-Brd8Hs2R.js} +1 -1
  50. package/dist/client/assets/{index-OidZkt6z.js → index-Bu5-0YcT.js} +1 -1
  51. package/dist/client/assets/{index-EmzeTf1X.js → index-C0YR9sBs.js} +1 -1
  52. package/dist/client/assets/{index-CmQbhXN6.js → index-CEQe58ON.js} +1 -1
  53. package/dist/client/assets/{index-DCmzSFWM.js → index-CEU2IWuT.js} +1 -1
  54. package/dist/client/assets/{index-BuAy0fEx.js → index-CMKnOlvn.js} +1 -1
  55. package/dist/client/assets/index-CMlp38oa.js +1 -0
  56. package/dist/client/assets/{index-CFdScmIU.js → index-CNPnwL--.js} +1 -1
  57. package/dist/client/assets/index-Clh_1xLD.js +1 -0
  58. package/dist/client/assets/{index-BiqiwP26.js → index-CpAbafE9.js} +4 -4
  59. package/dist/client/assets/{index-B7fRxuTQ.js → index-CpFgghxb.js} +1 -1
  60. package/dist/client/assets/{index-BI051zYq.js → index-Cum2QlPd.js} +2 -2
  61. package/dist/client/assets/index-D8mgsoST.css +1 -0
  62. package/dist/client/assets/{index-CpCOMkMm.js → index-DDGf-Mnk.js} +1 -1
  63. package/dist/client/assets/{index-DV_54TKu.js → index-DEuOFjz7.js} +1 -1
  64. package/dist/client/assets/{index-BfoOBbWz.js → index-DSDJttSW.js} +1 -1
  65. package/dist/client/assets/{index-ahTVwxpJ.js → index-DmA6ple3.js} +1 -1
  66. package/dist/client/assets/{index-Bn-vRpKY.js → index-DrkFww9Q.js} +1 -1
  67. package/dist/client/assets/{index-7AN8MIhq.js → index-O5pHJ17K.js} +1 -1
  68. package/dist/client/assets/{index-9RHYMIP_.js → index-PA-V6bdB.js} +1 -1
  69. package/dist/client/assets/{index-CdNENSm7.js → index-XMua1laL.js} +1 -1
  70. package/dist/client/assets/{index-CIPmtIuV.js → index-ZBeb8ExW.js} +1 -1
  71. package/dist/client/assets/{index-BBMfKdj-.js → index-ngTGZK5T.js} +1 -1
  72. package/dist/client/assets/{room-files-source-CMj0pEdy.js → room-files-source-CWB8LgHN.js} +2 -2
  73. package/dist/client/assets/{soul-file-C_AT0A8U.js → soul-file-BTDnNMG7.js} +1 -1
  74. package/dist/client/assets/{use-personality-commit-ClM-Ahk5.js → use-personality-commit-CzT0Fy-T.js} +1 -1
  75. package/dist/client/index.html +2 -2
  76. package/dist/drizzle/0132_connection_access_levels.sql +84 -0
  77. package/dist/drizzle/0134_query_indexes.sql +8 -0
  78. package/dist/drizzle/0135_session_started_by.sql +13 -0
  79. package/dist/drizzle/0136_mirror_timeline_order.sql +23 -0
  80. package/dist/drizzle/meta/0132_snapshot.json +10075 -0
  81. package/dist/drizzle/meta/0134_snapshot.json +10095 -0
  82. package/dist/drizzle/meta/0135_snapshot.json +10176 -0
  83. package/dist/drizzle/meta/0136_snapshot.json +10232 -0
  84. package/dist/drizzle/meta/_journal.json +28 -0
  85. package/dist/server/index.js +20889 -14309
  86. package/dist/server/index.js.map +2 -2
  87. package/package.json +8 -6
  88. package/dist/client/assets/ConventionPage-fMfStY8d.js +0 -11
  89. package/dist/client/assets/HandlePage-8Gv3fBBC.js +0 -1
  90. package/dist/client/assets/NamePage-CrZUfKVe.js +0 -1
  91. package/dist/client/assets/PhotoPage-C2mHVHvV.js +0 -1
  92. package/dist/client/assets/index-B0qJNUoh.css +0 -1
  93. package/dist/client/assets/index-CtxpF7aO.js +0 -1
  94. package/dist/client/assets/index-N8BCc19i.js +0 -1
  95. package/dist/client/assets/index-bYhLX3oQ.js +0 -1669
@@ -1 +1 @@
1
- import{u as N,d as v,j as e,a as w,r as d,X as k,I as C,B as D,P as S}from"./index-bYhLX3oQ.js";function b({children:i}){return e.jsx("div",{className:"text-muted-foreground text-3xs font-medium tracking-wider uppercase",children:i})}function A({agent:i,onUpdate:t}){const[a,l]=d.useState(!1),[o,u]=d.useState(""),n=i.capabilities??[];function c(){const s=o.trim();s&&!n.includes(s)&&t({capabilities:[...n,s]}),u(""),l(!1)}return e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{children:"Capabilities"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[n.map(s=>e.jsxs("span",{className:"bg-accent text-accent-foreground inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs",children:[s,e.jsx("button",{type:"button",onClick:()=>t({capabilities:n.filter(m=>m!==s)}),className:"hover:text-destructive transition-colors","aria-label":`Remove capability ${s}`,children:e.jsx(k,{"aria-hidden":!0,className:"size-3"})})]},s)),a?e.jsx(C,{autoFocus:!0,value:o,onChange:s=>u(s.target.value),onBlur:c,onKeyDown:s=>{s.key==="Enter"&&c(),s.key==="Escape"&&l(!1)},className:"h-6 w-28 text-xs",placeholder:"capability name","aria-label":"New capability"}):e.jsxs(D,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(!0),className:"text-muted-foreground hover:text-foreground h-auto gap-0.5 px-1 py-0 text-xs",children:[e.jsx(S,{"aria-hidden":!0,className:"size-3"})," Add"]})]})]})}function j({label:i,value:t,placeholder:a,multiline:l,testId:o,onCommit:u}){const[n,c]=d.useState(t),[s,m]=d.useState(t),[p,f]=d.useState(null);s!==t&&(m(t),c(t));function x(){const r=n.trim();if(r===t.trim())return;const g=u(r);if(typeof g!="string")return f(null);c(t),f(g)}const h="border-input bg-background placeholder:text-muted-foreground focus-visible:ring-ring w-full rounded-md border px-3 py-2 text-sm focus-visible:ring-2 focus-visible:outline-none",y=p?e.jsx("p",{role:"status",className:"text-destructive text-xs",children:p}):null;return e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{children:i}),l?e.jsx("textarea",{value:n,rows:4,"data-testid":o,"aria-label":i,placeholder:a,onChange:r=>{f(null),c(r.target.value)},onBlur:x,onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),x())},className:h}):e.jsx("input",{value:n,"data-testid":o,"aria-label":i,placeholder:a,onChange:r=>{f(null),c(r.target.value)},onBlur:x,onKeyDown:r=>{r.key==="Enter"&&x()},className:h}),y]})}function P({member:i,roster:t}){const{agent:a,isPending:l,update:o}=N(i),u=v(i,t)==="managed";return l?e.jsx(w,{className:"h-16 w-full"}):!u||!a?e.jsx(E,{member:i,agent:a}):e.jsxs("div",{className:"flex flex-col gap-4","data-slot":"profile-about",children:[e.jsx(j,{label:"Name",value:a.displayName??a.name,placeholder:"What you call this agent",testId:"agent-name-field",onCommit:n=>{if(!n)return"An agent needs a name, so this one kept the one it had.";o({displayName:n})}}),e.jsx(j,{multiline:!0,label:"Description",value:a.description??"",placeholder:"What is this agent for?",testId:"agent-description-field",onCommit:n=>o({description:n})}),e.jsx(A,{agent:a,onUpdate:o})]})}function E({member:i,agent:t}){var l;const a=(l=t==null?void 0:t.description)==null?void 0:l.trim();return a?e.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:a}):e.jsxs("p",{className:"text-muted-foreground text-sm",children:[i.displayName," hasn’t said what it’s for yet."]})}export{P as AboutPage};
1
+ import{u as N,d as v,j as e,a as w,r as d,X as k,I as C,B as D,P as S}from"./index-B4Z9VBPe.js";function b({children:i}){return e.jsx("div",{className:"text-muted-foreground text-3xs font-medium tracking-wider uppercase",children:i})}function A({agent:i,onUpdate:t}){const[a,l]=d.useState(!1),[o,u]=d.useState(""),n=i.capabilities??[];function c(){const s=o.trim();s&&!n.includes(s)&&t({capabilities:[...n,s]}),u(""),l(!1)}return e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{children:"Capabilities"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[n.map(s=>e.jsxs("span",{className:"bg-accent text-accent-foreground inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs",children:[s,e.jsx("button",{type:"button",onClick:()=>t({capabilities:n.filter(m=>m!==s)}),className:"hover:text-destructive transition-colors","aria-label":`Remove capability ${s}`,children:e.jsx(k,{"aria-hidden":!0,className:"size-3"})})]},s)),a?e.jsx(C,{autoFocus:!0,value:o,onChange:s=>u(s.target.value),onBlur:c,onKeyDown:s=>{s.key==="Enter"&&c(),s.key==="Escape"&&l(!1)},className:"h-6 w-28 text-xs",placeholder:"capability name","aria-label":"New capability"}):e.jsxs(D,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(!0),className:"text-muted-foreground hover:text-foreground h-auto gap-0.5 px-1 py-0 text-xs",children:[e.jsx(S,{"aria-hidden":!0,className:"size-3"})," Add"]})]})]})}function j({label:i,value:t,placeholder:a,multiline:l,testId:o,onCommit:u}){const[n,c]=d.useState(t),[s,m]=d.useState(t),[p,f]=d.useState(null);s!==t&&(m(t),c(t));function x(){const r=n.trim();if(r===t.trim())return;const g=u(r);if(typeof g!="string")return f(null);c(t),f(g)}const h="border-input bg-background placeholder:text-muted-foreground focus-visible:ring-ring w-full rounded-md border px-3 py-2 text-sm focus-visible:ring-2 focus-visible:outline-none",y=p?e.jsx("p",{role:"status",className:"text-destructive text-xs",children:p}):null;return e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{children:i}),l?e.jsx("textarea",{value:n,rows:4,"data-testid":o,"aria-label":i,placeholder:a,onChange:r=>{f(null),c(r.target.value)},onBlur:x,onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),x())},className:h}):e.jsx("input",{value:n,"data-testid":o,"aria-label":i,placeholder:a,onChange:r=>{f(null),c(r.target.value)},onBlur:x,onKeyDown:r=>{r.key==="Enter"&&x()},className:h}),y]})}function P({member:i,roster:t}){const{agent:a,isPending:l,update:o}=N(i),u=v(i,t)==="managed";return l?e.jsx(w,{className:"h-16 w-full"}):!u||!a?e.jsx(E,{member:i,agent:a}):e.jsxs("div",{className:"flex flex-col gap-4","data-slot":"profile-about",children:[e.jsx(j,{label:"Name",value:a.displayName??a.name,placeholder:"What you call this agent",testId:"agent-name-field",onCommit:n=>{if(!n)return"An agent needs a name, so this one kept the one it had.";o({displayName:n})}}),e.jsx(j,{multiline:!0,label:"Description",value:a.description??"",placeholder:"What is this agent for?",testId:"agent-description-field",onCommit:n=>o({description:n})}),e.jsx(A,{agent:a,onUpdate:o})]})}function E({member:i,agent:t}){var l;const a=(l=t==null?void 0:t.description)==null?void 0:l.trim();return a?e.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:a}):e.jsxs("p",{className:"text-muted-foreground text-sm",children:[i.displayName," hasn’t said what it’s for yet."]})}export{P as AboutPage};
@@ -1 +1 @@
1
- import{b5 as n,b6 as r,j as c,b7 as s,b8 as A}from"./index-bYhLX3oQ.js";const g={connected:n.success,disconnected:n.neutral,error:n.error,starting:`${n.warning} ${r}`,stopping:`${n.warning} ${r}`,reconnecting:`${n.warning} ${r}`},_={connected:"Connected",disconnected:"Ready",error:"Error",starting:"Connecting…",stopping:"Stopping…",reconnecting:"Reconnecting…"};function d({iconId:i,adapterType:a,size:t=16,className:o}){const e=s[i??""]??s[a??""];return e?c.jsx(e,{size:t,className:o}):c.jsx(A,{className:o,style:{width:t,height:t}})}export{d as A,g as a,_ as b};
1
+ import{aO as n,aP as r,j as c,aQ as s,aR as A}from"./index-B4Z9VBPe.js";const g={connected:n.success,disconnected:n.neutral,error:n.error,starting:`${n.warning} ${r}`,stopping:`${n.warning} ${r}`,reconnecting:`${n.warning} ${r}`},_={connected:"Connected",disconnected:"Ready",error:"Error",starting:"Connecting…",stopping:"Stopping…",reconnecting:"Reconnecting…"};function d({iconId:a,adapterType:i,size:t=16,className:o}){const e=s[a??""]??s[i??""];return e?c.jsx(e,{size:t,className:o}):c.jsx(A,{className:o,style:{width:t,height:t}})}export{d as A,g as a,_ as b};
@@ -1 +1 @@
1
- import{j as e,cJ as F,cK as U,al as v,J as m,cL as b,cM as $,cN as B,cO as G,an as D,r as u,cP as E,B as W,X as J,cQ as V,u as K,a as q,t as Q,b as X,z as Y}from"./index-bYhLX3oQ.js";import{u as Z}from"./use-personality-commit-ClM-Ahk5.js";import"./soul-file-C_AT0A8U.js";const H={hidden:{},visible:{transition:{staggerChildren:.04}}},I={hidden:{opacity:0,scale:.5},visible:{opacity:1,scale:1,transition:{type:"spring",stiffness:500,damping:25}}};function O(){return e.jsx(m.span,{className:"pointer-events-none absolute inset-0 flex items-center justify-center",initial:{scale:0,opacity:1},animate:{scale:1,opacity:0},transition:{duration:.6,ease:[.34,1.56,.64,1]},"aria-hidden":!0,children:e.jsx(D,{className:"size-4 text-white drop-shadow-md",strokeWidth:3})})}function _({celebratory:s,className:t,children:a}){return s?e.jsx(m.div,{className:t,variants:H,initial:"hidden",animate:"visible",children:a}):e.jsx("div",{className:t,children:a})}function A({celebratory:s,children:t}){return s?e.jsx(m.div,{variants:I,children:t}):t}const ee=e.jsx("span",{className:"text-3xs leading-none font-bold",children:"A"}),te="ring-muted-foreground/50 ring-dashed ring-2 ring-offset-2",se="Select default color";function ae({value:s,autoColor:t,onSelect:a,onHoverChange:i,justSelectedKey:o,celebratory:n=!1,autoIcon:r=ee,autoActiveRing:c=te,autoLabel:d=se}){const x=s!=null;return e.jsxs(_,{celebratory:n,className:"flex flex-wrap items-center gap-2",children:[e.jsx(A,{celebratory:n,children:e.jsx(T,{active:!x,activeRing:c,color:t,label:d,tooltip:"Unique, derived from agent name",onClick:()=>a(null),onHoverChange:i,justSelected:o==="auto",celebratory:n,children:r})}),e.jsx("div",{className:"bg-border mx-0.5 h-5 w-px"}),F.map(l=>e.jsx(A,{celebratory:n,children:e.jsx(T,{active:s===l.hex,activeRing:"ring-foreground ring-2 ring-offset-2",color:l.hex,label:`Select ${l.name}`,tooltip:l.name,onClick:()=>a(l.hex),onHoverChange:i,justSelected:o===l.hex,celebratory:n})},l.hex))]})}function T({active:s,activeRing:t,color:a,label:i,tooltip:o,tooltipSide:n="bottom",onClick:r,onHoverChange:c,justSelected:d,celebratory:x,children:l}){const h=e.jsxs("button",{type:"button",onClick:r,onMouseEnter:()=>c==null?void 0:c(a),onMouseLeave:()=>c==null?void 0:c(null),className:v("group/swatch relative size-8 rounded-full transition-[scale,box-shadow] duration-150",s?t:"hover:scale-110"),style:{backgroundColor:a},"aria-label":i,children:[l&&e.jsx("span",{className:"bg-background/80 text-foreground absolute inset-0 flex items-center justify-center rounded-full",children:l}),x&&e.jsx("span",{className:"absolute inset-[-4px] -z-10 rounded-full opacity-0 blur-md transition-opacity duration-200 group-hover/swatch:opacity-50",style:{backgroundColor:a},"aria-hidden":!0}),e.jsx(b,{children:d&&e.jsx(O,{})})]});return x?e.jsxs($,{children:[e.jsx(B,{asChild:!0,children:h}),e.jsx(G,{side:n,className:"text-3xs",children:o})]}):h}function ne({value:s,autoEmoji:t,hasOverride:a,onSelect:i,justSelectedKey:o,celebratory:n=!1}){return e.jsx(_,{celebratory:n,className:"grid grid-cols-6 gap-1.5",children:U.map(r=>{const c=r===s,d=r===t&&!a,x=v("relative flex size-9 items-center justify-center rounded-md text-lg transition-colors duration-150",c?v(d?"bg-accent ring-muted-foreground/50 ring-1":"bg-accent ring-foreground ring-1",d&&!n&&"ring-dashed"):"hover:bg-accent/50 active:scale-90");return e.jsx(ie,{celebratory:n,onClick:()=>i(r),className:x,ariaLabel:`Select icon ${r}`,justSelected:o===`emoji-${r}`,children:r},r)})})}function ie({celebratory:s,onClick:t,className:a,ariaLabel:i,justSelected:o,children:n}){const r=e.jsx(b,{children:o&&e.jsx(O,{})});return s?e.jsxs(m.button,{type:"button",onClick:t,className:a,"aria-label":i,variants:I,whileHover:{scale:1.25},whileTap:{scale:.85},transition:{type:"spring",stiffness:500,damping:20},children:[n,r]}):e.jsxs("button",{type:"button",onClick:t,className:a,"aria-label":i,children:[n,r]})}const re=e.jsx(V,{className:"size-3"}),oe="ring-muted-foreground/50 ring-2 ring-offset-2",ce="Select unique auto-generated color",C="dorkos:avatar-first-customization",le={hidden:{},visible:{transition:{staggerChildren:.04}}},w={hidden:{opacity:0,y:4},visible:{opacity:1,y:0,transition:{duration:.2,ease:"easeOut"}}};function ue(){const[s]=u.useState(()=>Array.from({length:14},(a,i)=>{const o=Math.PI*2*i/14,n=28+Math.random()*20,r=360*i/14;return{x:Math.cos(o)*n,y:Math.sin(o)*n,size:3+Math.random()*3,hue:r,delay:i*.02}}));return e.jsx("div",{className:"pointer-events-none absolute inset-0 z-50 overflow-visible","aria-hidden":!0,children:s.map((t,a)=>e.jsx(m.span,{className:"absolute top-1/2 left-1/2 rounded-full",style:{width:t.size,height:t.size,background:`hsl(${t.hue}, 80%, 70%)`,boxShadow:`0 0 6px hsl(${t.hue}, 80%, 70%)`},initial:{x:"-50%",y:"-50%",scale:0,opacity:1},animate:{x:t.x,y:t.y,scale:1,opacity:0},transition:{duration:.6,ease:"easeOut",delay:t.delay}},a))})}function de({agent:s,onUpdate:t,onPreviewColor:a,title:i,onClose:o}){const n=u.useMemo(()=>E(s.id),[s.id]),r=n.color,c=n.icon,d=s.icon??c,x=s.color!=null,l=s.icon!=null,h=x||l,[y,S]=u.useState(null),p=u.useRef(null),[z,k]=u.useState(!1),N=u.useRef(!1);u.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const g=u.useCallback(()=>{if(!N.current){try{if(localStorage.getItem(C))return;localStorage.setItem(C,"true")}catch{return}N.current=!0,k(!0),setTimeout(()=>k(!1),800)}},[]),j=u.useCallback(f=>{p.current&&clearTimeout(p.current),S(f),p.current=setTimeout(()=>S(null),600)},[]),R=u.useCallback(()=>{t({color:null,icon:null})},[t]),L=u.useCallback(f=>{t({color:f}),a(null),j(f??"auto"),g()},[t,a,j,g]),M=u.useCallback(f=>{t({icon:f===c?null:f}),j(`emoji-${f}`),g()},[t,c,j,g]),P=u.useCallback(f=>{a(f)},[a]);return e.jsxs("div",{className:"flex flex-1 flex-col overflow-auto","data-testid":"avatar-picker-panel",children:[(i||o||h)&&e.jsxs("div",{className:v("flex items-center justify-between px-4 py-2",(i||o)&&"border-b"),children:[i&&e.jsx("span",{className:"text-xs font-semibold",children:i}),e.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[e.jsx(b,{children:h&&e.jsx(m.button,{type:"button",onClick:R,className:"text-muted-foreground hover:text-foreground text-3xs transition-colors",initial:{opacity:0,x:8},animate:{opacity:1,x:0},exit:{opacity:0,x:8},transition:{duration:.2},children:"Reset to defaults"})}),o&&e.jsx(W,{variant:"ghost",size:"icon-md",className:"size-6",onClick:o,"aria-label":"Close appearance picker",children:e.jsx(J,{className:"size-3.5"})})]})]}),e.jsxs(m.div,{className:"space-y-5 p-4",variants:le,initial:"hidden",animate:"visible",children:[e.jsxs(m.div,{variants:w,children:[e.jsx("div",{className:"text-muted-foreground text-3xs mb-2 font-medium tracking-wider uppercase",children:"Color"}),e.jsx(ae,{value:s.color,autoColor:r,onSelect:L,onHoverChange:P,justSelectedKey:y,celebratory:!0,autoIcon:re,autoActiveRing:oe,autoLabel:ce})]}),e.jsxs(m.div,{variants:w,children:[e.jsx("div",{className:"text-muted-foreground text-3xs mb-2 font-medium tracking-wider uppercase",children:"Icon"}),e.jsx(ne,{value:d,autoEmoji:c,hasOverride:l,onSelect:M,justSelectedKey:y,celebratory:!0})]})]}),e.jsx(b,{children:z&&e.jsx(ue,{})})]})}function xe({children:s}){return e.jsx("h3",{className:"text-muted-foreground text-3xs font-medium tracking-wider uppercase",children:s})}function ge({member:s}){const{agent:t,isPending:a,update:i}=K(s),o=Z(t,i),[n,r]=u.useState(null);if(a)return e.jsx(q,{className:"h-64 w-full"});if(!t)return e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this agent’s appearance."});const c=Q(s),d=E(t.id),x=n??t.color??d.color,l=t.icon??d.icon;return e.jsxs("div",{className:"flex flex-col gap-5","data-slot":"profile-appearance",children:[e.jsx("div",{className:"flex justify-center pt-1",children:e.jsx(X,{size:"lg",kind:c.kind,color:x,emoji:l,fallback:c.fallback,origin:c.origin})}),e.jsx(de,{agent:t,onUpdate:i,onPreviewColor:r}),e.jsxs("div",{className:"space-y-2 border-t pt-4",children:[e.jsx(xe,{children:"Personality"}),e.jsx(Y,{traits:o.traits,onTraitsChange:o.onTraitsChange,compact:!0})]})]})}export{ge as AppearancePage};
1
+ import{j as e,cq as F,cr as U,al as v,J as m,cs as b,ct as $,cu as B,cv as G,an as D,r as u,cw as E,B as W,X as V,cx as q,u as J,a as K,t as X,b as Y,z as Z}from"./index-B4Z9VBPe.js";import{u as Q}from"./use-personality-commit-CzT0Fy-T.js";import"./soul-file-BTDnNMG7.js";const H={hidden:{},visible:{transition:{staggerChildren:.04}}},I={hidden:{opacity:0,scale:.5},visible:{opacity:1,scale:1,transition:{type:"spring",stiffness:500,damping:25}}};function _(){return e.jsx(m.span,{className:"pointer-events-none absolute inset-0 flex items-center justify-center",initial:{scale:0,opacity:1},animate:{scale:1,opacity:0},transition:{duration:.6,ease:[.34,1.56,.64,1]},"aria-hidden":!0,children:e.jsx(D,{className:"size-4 text-white drop-shadow-md",strokeWidth:3})})}function O({celebratory:s,className:t,children:a}){return s?e.jsx(m.div,{className:t,variants:H,initial:"hidden",animate:"visible",children:a}):e.jsx("div",{className:t,children:a})}function A({celebratory:s,children:t}){return s?e.jsx(m.div,{variants:I,children:t}):t}const ee=e.jsx("span",{className:"text-3xs leading-none font-bold",children:"A"}),te="ring-muted-foreground/50 ring-dashed ring-2 ring-offset-2",se="Select default color";function ae({value:s,autoColor:t,onSelect:a,onHoverChange:i,justSelectedKey:o,celebratory:n=!1,autoIcon:r=ee,autoActiveRing:c=te,autoLabel:d=se}){const x=s!=null;return e.jsxs(O,{celebratory:n,className:"flex flex-wrap items-center gap-2",children:[e.jsx(A,{celebratory:n,children:e.jsx(T,{active:!x,activeRing:c,color:t,label:d,tooltip:"Unique, derived from agent name",onClick:()=>a(null),onHoverChange:i,justSelected:o==="auto",celebratory:n,children:r})}),e.jsx("div",{className:"bg-border mx-0.5 h-5 w-px"}),F.map(l=>e.jsx(A,{celebratory:n,children:e.jsx(T,{active:s===l.hex,activeRing:"ring-foreground ring-2 ring-offset-2",color:l.hex,label:`Select ${l.name}`,tooltip:l.name,onClick:()=>a(l.hex),onHoverChange:i,justSelected:o===l.hex,celebratory:n})},l.hex))]})}function T({active:s,activeRing:t,color:a,label:i,tooltip:o,tooltipSide:n="bottom",onClick:r,onHoverChange:c,justSelected:d,celebratory:x,children:l}){const h=e.jsxs("button",{type:"button",onClick:r,onMouseEnter:()=>c==null?void 0:c(a),onMouseLeave:()=>c==null?void 0:c(null),className:v("group/swatch relative size-8 rounded-full transition-[scale,box-shadow] duration-150",s?t:"hover:scale-110"),style:{backgroundColor:a},"aria-label":i,children:[l&&e.jsx("span",{className:"bg-background/80 text-foreground absolute inset-0 flex items-center justify-center rounded-full",children:l}),x&&e.jsx("span",{className:"absolute inset-[-4px] -z-10 rounded-full opacity-0 blur-md transition-opacity duration-200 group-hover/swatch:opacity-50",style:{backgroundColor:a},"aria-hidden":!0}),e.jsx(b,{children:d&&e.jsx(_,{})})]});return x?e.jsxs($,{children:[e.jsx(B,{asChild:!0,children:h}),e.jsx(G,{side:n,className:"text-3xs",children:o})]}):h}function ne({value:s,autoEmoji:t,hasOverride:a,onSelect:i,justSelectedKey:o,celebratory:n=!1}){return e.jsx(O,{celebratory:n,className:"grid grid-cols-6 gap-1.5",children:U.map(r=>{const c=r===s,d=r===t&&!a,x=v("relative flex size-9 items-center justify-center rounded-md text-lg transition-colors duration-150",c?v(d?"bg-accent ring-muted-foreground/50 ring-1":"bg-accent ring-foreground ring-1",d&&!n&&"ring-dashed"):"hover:bg-accent/50 active:scale-90");return e.jsx(ie,{celebratory:n,onClick:()=>i(r),className:x,ariaLabel:`Select icon ${r}`,justSelected:o===`emoji-${r}`,children:r},r)})})}function ie({celebratory:s,onClick:t,className:a,ariaLabel:i,justSelected:o,children:n}){const r=e.jsx(b,{children:o&&e.jsx(_,{})});return s?e.jsxs(m.button,{type:"button",onClick:t,className:a,"aria-label":i,variants:I,whileHover:{scale:1.25},whileTap:{scale:.85},transition:{type:"spring",stiffness:500,damping:20},children:[n,r]}):e.jsxs("button",{type:"button",onClick:t,className:a,"aria-label":i,children:[n,r]})}const re=e.jsx(q,{className:"size-3"}),oe="ring-muted-foreground/50 ring-2 ring-offset-2",ce="Select unique auto-generated color",C="dorkos:avatar-first-customization",le={hidden:{},visible:{transition:{staggerChildren:.04}}},w={hidden:{opacity:0,y:4},visible:{opacity:1,y:0,transition:{duration:.2,ease:"easeOut"}}};function ue(){const[s]=u.useState(()=>Array.from({length:14},(a,i)=>{const o=Math.PI*2*i/14,n=28+Math.random()*20,r=360*i/14;return{x:Math.cos(o)*n,y:Math.sin(o)*n,size:3+Math.random()*3,hue:r,delay:i*.02}}));return e.jsx("div",{className:"pointer-events-none absolute inset-0 z-50 overflow-visible","aria-hidden":!0,children:s.map((t,a)=>e.jsx(m.span,{className:"absolute top-1/2 left-1/2 rounded-full",style:{width:t.size,height:t.size,background:`hsl(${t.hue}, 80%, 70%)`,boxShadow:`0 0 6px hsl(${t.hue}, 80%, 70%)`},initial:{x:"-50%",y:"-50%",scale:0,opacity:1},animate:{x:t.x,y:t.y,scale:1,opacity:0},transition:{duration:.6,ease:"easeOut",delay:t.delay}},a))})}function de({agent:s,onUpdate:t,onPreviewColor:a,title:i,onClose:o}){const n=u.useMemo(()=>E(s.id),[s.id]),r=n.color,c=n.icon,d=s.icon??c,x=s.color!=null,l=s.icon!=null,h=x||l,[y,S]=u.useState(null),p=u.useRef(null),[z,k]=u.useState(!1),N=u.useRef(!1);u.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const g=u.useCallback(()=>{if(!N.current){try{if(localStorage.getItem(C))return;localStorage.setItem(C,"true")}catch{return}N.current=!0,k(!0),setTimeout(()=>k(!1),800)}},[]),j=u.useCallback(f=>{p.current&&clearTimeout(p.current),S(f),p.current=setTimeout(()=>S(null),600)},[]),R=u.useCallback(()=>{t({color:null,icon:null})},[t]),L=u.useCallback(f=>{t({color:f}),a(null),j(f??"auto"),g()},[t,a,j,g]),M=u.useCallback(f=>{t({icon:f===c?null:f}),j(`emoji-${f}`),g()},[t,c,j,g]),P=u.useCallback(f=>{a(f)},[a]);return e.jsxs("div",{className:"flex flex-1 flex-col overflow-auto","data-testid":"avatar-picker-panel",children:[(i||o||h)&&e.jsxs("div",{className:v("flex items-center justify-between px-4 py-2",(i||o)&&"border-b"),children:[i&&e.jsx("span",{className:"text-xs font-semibold",children:i}),e.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[e.jsx(b,{children:h&&e.jsx(m.button,{type:"button",onClick:R,className:"text-muted-foreground hover:text-foreground text-3xs transition-colors",initial:{opacity:0,x:8},animate:{opacity:1,x:0},exit:{opacity:0,x:8},transition:{duration:.2},children:"Reset to defaults"})}),o&&e.jsx(W,{variant:"ghost",size:"icon-md",className:"size-6",onClick:o,"aria-label":"Close appearance picker",children:e.jsx(V,{className:"size-3.5"})})]})]}),e.jsxs(m.div,{className:"space-y-5 p-4",variants:le,initial:"hidden",animate:"visible",children:[e.jsxs(m.div,{variants:w,children:[e.jsx("div",{className:"text-muted-foreground text-3xs mb-2 font-medium tracking-wider uppercase",children:"Color"}),e.jsx(ae,{value:s.color,autoColor:r,onSelect:L,onHoverChange:P,justSelectedKey:y,celebratory:!0,autoIcon:re,autoActiveRing:oe,autoLabel:ce})]}),e.jsxs(m.div,{variants:w,children:[e.jsx("div",{className:"text-muted-foreground text-3xs mb-2 font-medium tracking-wider uppercase",children:"Icon"}),e.jsx(ne,{value:d,autoEmoji:c,hasOverride:l,onSelect:M,justSelectedKey:y,celebratory:!0})]})]}),e.jsx(b,{children:z&&e.jsx(ue,{})})]})}function xe({children:s}){return e.jsx("h3",{className:"text-muted-foreground text-3xs font-medium tracking-wider uppercase",children:s})}function ge({member:s}){const{agent:t,isPending:a,update:i}=J(s),o=Q(t,i),[n,r]=u.useState(null);if(a)return e.jsx(K,{className:"h-64 w-full"});if(!t)return e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this agent’s appearance."});const c=X(s),d=E(t.id),x=n??t.color??d.color,l=t.icon??d.icon;return e.jsxs("div",{className:"flex flex-col gap-5","data-slot":"profile-appearance",children:[e.jsx("div",{className:"flex justify-center pt-1",children:e.jsx(Y,{size:"lg",kind:c.kind,color:x,emoji:l,fallback:c.fallback,origin:c.origin})}),e.jsx(de,{agent:t,onUpdate:i,onPreviewColor:r}),e.jsxs("div",{className:"space-y-2 border-t pt-4",children:[e.jsx(xe,{children:"Personality"}),e.jsx(Z,{traits:o.traits,onTraitsChange:o.onTraitsChange,compact:!0})]})]})}export{ge as AppearancePage};
@@ -1,4 +1,4 @@
1
- import{u as _t,c as Q,a as Te,b as U,s as ht,m as Je,i as g,k as Ft,e as w,f as s,d as S,l as L,M as He,j as le,F as zt,S as Et,n as pt,t as E,o as It,p as mt,q as Dt,r as $t,v as Ke}from"./index-BI051zYq.js";import{cD as Bt,cE as be,ar as V,cF as st,cG as Tt,cH as At,cI as Rt}from"./index-bYhLX3oQ.js";let Mt={data:""},Pt=r=>{if(typeof window=="object"){let e=(r?r.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return e.nonce=window.__nonce__,e.parentNode||(r||document.head).appendChild(e),e.firstChild}return r||Mt},Lt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Ot=/\/\*[^]*?\*\/| +/g,lt=/\n+/g,ae=(r,e)=>{let i="",t="",c="";for(let a in r){let l=r[a];a[0]=="@"?a[1]=="i"?i=a+" "+l+";":t+=a[1]=="f"?ae(l,a):a+"{"+ae(l,a[1]=="k"?"":e)+"}":typeof l=="object"?t+=ae(l,e?e.replace(/([^,])+/g,v=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,u=>/&/.test(u)?u.replace(/&/g,v):v?v+" "+u:u)):a):l!=null&&(a=a[1]=="-"?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),c+=ae.p?ae.p(a,l):a+":"+l+";")}return i+(e&&c?e+"{"+c+"}":c)+t},ne={},bt=r=>{if(typeof r=="object"){let e="";for(let i in r)e+=i+bt(r[i]);return e}return r},jt=(r,e,i,t,c)=>{let a=bt(r),l=ne[a]||(ne[a]=(u=>{let o=0,n=11;for(;o<u.length;)n=101*n+u.charCodeAt(o++)>>>0;return"go"+n})(a));if(!ne[l]){let u=a!==r?r:(o=>{let n,k,m=[{}];for(;n=Lt.exec(o.replace(Ot,""));)n[4]?m.shift():n[3]?(k=n[3].replace(lt," ").trim(),m.unshift(m[0][k]=m[0][k]||{})):m[0][n[1]]=n[2].replace(lt," ").trim();return m[0]})(r);ne[l]=ae(c?{["@keyframes "+l]:u}:u,i?"":"."+l)}let v=i&&ne.g;return i&&(ne.g=ne[l]),((u,o,n,k)=>{k?o.data=o.data.replace(k,u):o.data.indexOf(u)===-1&&(o.data=n?u+o.data:o.data+u)})(ne[l],e,t,v),l},Ht=(r,e,i)=>r.reduce((t,c,a)=>{let l=e[a];if(l&&l.call){let v=l(i),u=v&&v.props&&v.props.className||/^go/.test(v)&&v;l=u?"."+u:v&&typeof v=="object"?v.props?"":ae(v,""):v===!1?"":v}return t+c+(l??"")},"");function ue(r){let e=this||{},i=r.call?r(e.p):r;return jt(i.unshift?i.raw?Ht(i,[].slice.call(arguments,1),e.p):i.reduce((t,c)=>Object.assign(t,c&&c.call?c(e.p):c),{}):i,Pt(e.target),e.g,e.o,e.k)}ue.bind({g:1});ue.bind({k:1});var B={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",70:"b3",20:"33"},font:{size:{"2xs":"calc(var(--tsrd-font-size) * 0.625)",xs:"calc(var(--tsrd-font-size) * 0.75)",sm:"calc(var(--tsrd-font-size) * 0.875)",md:"var(--tsrd-font-size)"},lineHeight:{xs:"calc(var(--tsrd-font-size) * 1)",sm:"calc(var(--tsrd-font-size) * 1.25)"},weight:{normal:"400",medium:"500",semibold:"600",bold:"700"},fontFamily:{sans:"ui-sans-serif, Inter, system-ui, sans-serif, sans-serif",mono:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace"}},border:{radius:{xs:"calc(var(--tsrd-font-size) * 0.125)",sm:"calc(var(--tsrd-font-size) * 0.25)",md:"calc(var(--tsrd-font-size) * 0.375)",full:"9999px"}},size:{0:"0px",.5:"calc(var(--tsrd-font-size) * 0.125)",1:"calc(var(--tsrd-font-size) * 0.25)",1.5:"calc(var(--tsrd-font-size) * 0.375)",2:"calc(var(--tsrd-font-size) * 0.5)",2.5:"calc(var(--tsrd-font-size) * 0.625)",3:"calc(var(--tsrd-font-size) * 0.75)",3.5:"calc(var(--tsrd-font-size) * 0.875)",4:"calc(var(--tsrd-font-size) * 1)",5:"calc(var(--tsrd-font-size) * 1.25)",8:"calc(var(--tsrd-font-size) * 2)"}},Gt=r=>{const{colors:e,font:i,size:t,alpha:c,border:a}=B,{fontFamily:l,lineHeight:v,size:u}=i,o=r?ue.bind({target:r}):ue;return{devtoolsPanelContainer:o`
1
+ import{u as _t,c as Q,a as Te,b as U,s as ht,m as Je,i as g,k as Ft,e as w,f as s,d as S,l as L,M as He,j as le,F as zt,S as Et,n as pt,t as E,o as It,p as mt,q as Bt,r as $t,v as Ke}from"./index-Cum2QlPd.js";import{ck as Dt,cl as be,ar as V,cm as st,cn as Tt,co as At,cp as Rt}from"./index-B4Z9VBPe.js";let Mt={data:""},Pt=r=>{if(typeof window=="object"){let e=(r?r.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return e.nonce=window.__nonce__,e.parentNode||(r||document.head).appendChild(e),e.firstChild}return r||Mt},Lt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Ot=/\/\*[^]*?\*\/| +/g,lt=/\n+/g,ae=(r,e)=>{let i="",t="",c="";for(let a in r){let l=r[a];a[0]=="@"?a[1]=="i"?i=a+" "+l+";":t+=a[1]=="f"?ae(l,a):a+"{"+ae(l,a[1]=="k"?"":e)+"}":typeof l=="object"?t+=ae(l,e?e.replace(/([^,])+/g,v=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,u=>/&/.test(u)?u.replace(/&/g,v):v?v+" "+u:u)):a):l!=null&&(a=a[1]=="-"?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),c+=ae.p?ae.p(a,l):a+":"+l+";")}return i+(e&&c?e+"{"+c+"}":c)+t},ne={},bt=r=>{if(typeof r=="object"){let e="";for(let i in r)e+=i+bt(r[i]);return e}return r},jt=(r,e,i,t,c)=>{let a=bt(r),l=ne[a]||(ne[a]=(u=>{let o=0,n=11;for(;o<u.length;)n=101*n+u.charCodeAt(o++)>>>0;return"go"+n})(a));if(!ne[l]){let u=a!==r?r:(o=>{let n,k,m=[{}];for(;n=Lt.exec(o.replace(Ot,""));)n[4]?m.shift():n[3]?(k=n[3].replace(lt," ").trim(),m.unshift(m[0][k]=m[0][k]||{})):m[0][n[1]]=n[2].replace(lt," ").trim();return m[0]})(r);ne[l]=ae(c?{["@keyframes "+l]:u}:u,i?"":"."+l)}let v=i&&ne.g;return i&&(ne.g=ne[l]),((u,o,n,k)=>{k?o.data=o.data.replace(k,u):o.data.indexOf(u)===-1&&(o.data=n?u+o.data:o.data+u)})(ne[l],e,t,v),l},Ht=(r,e,i)=>r.reduce((t,c,a)=>{let l=e[a];if(l&&l.call){let v=l(i),u=v&&v.props&&v.props.className||/^go/.test(v)&&v;l=u?"."+u:v&&typeof v=="object"?v.props?"":ae(v,""):v===!1?"":v}return t+c+(l??"")},"");function ue(r){let e=this||{},i=r.call?r(e.p):r;return jt(i.unshift?i.raw?Ht(i,[].slice.call(arguments,1),e.p):i.reduce((t,c)=>Object.assign(t,c&&c.call?c(e.p):c),{}):i,Pt(e.target),e.g,e.o,e.k)}ue.bind({g:1});ue.bind({k:1});var D={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",70:"b3",20:"33"},font:{size:{"2xs":"calc(var(--tsrd-font-size) * 0.625)",xs:"calc(var(--tsrd-font-size) * 0.75)",sm:"calc(var(--tsrd-font-size) * 0.875)",md:"var(--tsrd-font-size)"},lineHeight:{xs:"calc(var(--tsrd-font-size) * 1)",sm:"calc(var(--tsrd-font-size) * 1.25)"},weight:{normal:"400",medium:"500",semibold:"600",bold:"700"},fontFamily:{sans:"ui-sans-serif, Inter, system-ui, sans-serif, sans-serif",mono:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace"}},border:{radius:{xs:"calc(var(--tsrd-font-size) * 0.125)",sm:"calc(var(--tsrd-font-size) * 0.25)",md:"calc(var(--tsrd-font-size) * 0.375)",full:"9999px"}},size:{0:"0px",.5:"calc(var(--tsrd-font-size) * 0.125)",1:"calc(var(--tsrd-font-size) * 0.25)",1.5:"calc(var(--tsrd-font-size) * 0.375)",2:"calc(var(--tsrd-font-size) * 0.5)",2.5:"calc(var(--tsrd-font-size) * 0.625)",3:"calc(var(--tsrd-font-size) * 0.75)",3.5:"calc(var(--tsrd-font-size) * 0.875)",4:"calc(var(--tsrd-font-size) * 1)",5:"calc(var(--tsrd-font-size) * 1.25)",8:"calc(var(--tsrd-font-size) * 2)"}},Gt=r=>{const{colors:e,font:i,size:t,alpha:c,border:a}=D,{fontFamily:l,lineHeight:v,size:u}=i,o=r?ue.bind({target:r}):ue;return{devtoolsPanelContainer:o`
2
2
  direction: ltr;
3
3
  position: fixed;
4
4
  bottom: 0;
@@ -27,7 +27,7 @@ import{u as _t,c as Q,a as Te,b as U,s as ht,m as Je,i as g,k as Ft,e as w,f as
27
27
  background-color: transparent;
28
28
  border: none;
29
29
  font-family: ${l.sans};
30
- gap: ${B.size[.5]};
30
+ gap: ${D.size[.5]};
31
31
  padding: 0px;
32
32
  &:hover {
33
33
  opacity: 0.7;
@@ -88,12 +88,12 @@ import{u as _t,c as Q,a as Te,b as U,s as ht,m as Je,i as g,k as Ft,e as w,f as
88
88
  overflow-y: auto;
89
89
  flex: 1;
90
90
  `,routerExplorer:o`
91
- padding: ${B.size[2]};
91
+ padding: ${D.size[2]};
92
92
  `,row:o`
93
93
  display: flex;
94
94
  align-items: center;
95
- padding: ${B.size[2]} ${B.size[2.5]};
96
- gap: ${B.size[2.5]};
95
+ padding: ${D.size[2]} ${D.size[2.5]};
96
+ gap: ${D.size[2.5]};
97
97
  border-bottom: ${e.darkGray[500]} 1px solid;
98
98
  align-items: center;
99
99
  `,detailsHeader:o`
@@ -102,10 +102,10 @@ import{u as _t,c as Q,a as Te,b as U,s as ht,m as Je,i as g,k as Ft,e as w,f as
102
102
  top: 0;
103
103
  z-index: 2;
104
104
  background-color: ${e.darkGray[600]};
105
- padding: 0px ${B.size[2]};
105
+ padding: 0px ${D.size[2]};
106
106
  font-weight: ${i.weight.medium};
107
107
  font-size: ${i.size.xs};
108
- min-height: ${B.size[8]};
108
+ min-height: ${D.size[8]};
109
109
  line-height: ${i.lineHeight.xs};
110
110
  text-align: left;
111
111
  display: flex;
@@ -114,7 +114,7 @@ import{u as _t,c as Q,a as Te,b as U,s as ht,m as Je,i as g,k as Ft,e as w,f as
114
114
  background: ${e.yellow[900]}${c[70]};
115
115
  color: ${e.yellow[300]};
116
116
  display: inline-block;
117
- padding: ${B.size[0]} ${B.size[2.5]};
117
+ padding: ${D.size[0]} ${D.size[2.5]};
118
118
  border-radius: ${a.radius.full};
119
119
  font-size: ${i.size.xs};
120
120
  font-weight: ${i.weight.normal};
@@ -122,7 +122,7 @@ import{u as _t,c as Q,a as Te,b as U,s as ht,m as Je,i as g,k as Ft,e as w,f as
122
122
  `,maskedLocation:o`
123
123
  color: ${e.yellow[300]};
124
124
  `,detailsContent:o`
125
- padding: ${B.size[1.5]} ${B.size[2]};
125
+ padding: ${D.size[1.5]} ${D.size[2]};
126
126
  display: flex;
127
127
  align-items: center;
128
128
  justify-content: space-between;
@@ -149,7 +149,7 @@ import{u as _t,c as Q,a as Te,b as U,s as ht,m as Je,i as g,k as Ft,e as w,f as
149
149
  color: ${e.gray[500]};
150
150
  background: ${e.darkGray[800]}${c[20]};
151
151
  `;m.push(A)}return k&&m.push(o`
152
- border-right: 1px solid ${B.colors.gray[500]};
152
+ border-right: 1px solid ${D.colors.gray[500]};
153
153
  `),m},detailsHeaderInfo:o`
154
154
  flex: 1;
155
155
  justify-content: flex-end;
@@ -274,7 +274,7 @@ import{u as _t,c as Q,a as Te,b as U,s as ht,m as Je,i as g,k as Ft,e as w,f as
274
274
  max-height: 50%;
275
275
  `,historyOverflowContainer:o`
276
276
  padding: ${t[1]} ${t[2]};
277
- font-size: ${B.font.size.xs};
277
+ font-size: ${D.font.size.xs};
278
278
  `,maskedBadgeContainer:o`
279
279
  flex: 1;
280
280
  justify-content: flex-end;
@@ -282,21 +282,21 @@ import{u as _t,c as Q,a as Te,b as U,s as ht,m as Je,i as g,k as Ft,e as w,f as
282
282
  `,matchDetails:o`
283
283
  display: flex;
284
284
  flex-direction: column;
285
- padding: ${B.size[2]};
286
- font-size: ${B.font.size.xs};
287
- color: ${B.colors.gray[300]};
288
- line-height: ${B.font.lineHeight.sm};
285
+ padding: ${D.size[2]};
286
+ font-size: ${D.font.size.xs};
287
+ color: ${D.colors.gray[300]};
288
+ line-height: ${D.font.lineHeight.sm};
289
289
  `,matchStatus:(n,k)=>{const m=k&&n==="success"?k==="beforeLoad"?"purple":"blue":{pending:"yellow",success:"green",error:"red",notFound:"purple"}[n];return o`
290
290
  display: flex;
291
291
  justify-content: center;
292
292
  align-items: center;
293
293
  height: 40px;
294
- border-radius: ${B.border.radius.sm};
295
- font-weight: ${B.font.weight.normal};
296
- background-color: ${B.colors[m][900]}${B.alpha[90]};
297
- color: ${B.colors[m][300]};
298
- border: 1px solid ${B.colors[m][600]};
299
- margin-bottom: ${B.size[2]};
294
+ border-radius: ${D.border.radius.sm};
295
+ font-weight: ${D.font.weight.normal};
296
+ background-color: ${D.colors[m][900]}${D.alpha[90]};
297
+ color: ${D.colors[m][300]};
298
+ border: 1px solid ${D.colors[m][600]};
299
+ margin-bottom: ${D.size[2]};
300
300
  transition: all 0.25s ease-out;
301
301
  `},matchDetailsInfo:o`
302
302
  display: flex;
@@ -349,7 +349,7 @@ import{u as _t,c as Q,a as Te,b as U,s as ht,m as Je,i as g,k as Ft,e as w,f as
349
349
  white-space: nowrap;
350
350
  `,mainCloseBtnDivider:o`
351
351
  width: 1px;
352
- background: ${B.colors.gray[600]};
352
+ background: ${D.colors.gray[600]};
353
353
  height: 100%;
354
354
  border-radius: 999999px;
355
355
  color: transparent;
@@ -425,7 +425,7 @@ import{u as _t,c as Q,a as Te,b as U,s as ht,m as Je,i as g,k as Ft,e as w,f as
425
425
  &:hover {
426
426
  color: ${e.blue[300]};
427
427
  }
428
- `}};function xe(){const[r]=Q(Gt(pt($t)));return r}var Nt=r=>{try{const e=localStorage.getItem(r);return typeof e=="string"?JSON.parse(e):void 0}catch{return}};function dt(r,e){const[i,t]=Q();return Te(()=>{const a=Nt(r);t(typeof a>"u"||a===null?typeof e=="function"?e():e:a)}),[i,a=>{t(l=>{let v=a;typeof a=="function"&&(v=a(l));try{localStorage.setItem(r,JSON.stringify(v))}catch{}return v})}]}var Vt=typeof window>"u";function Ue(r){return r.isFetching&&r.status==="success"?r.isFetching==="beforeLoad"?"purple":"blue":{pending:"yellow",success:"green",error:"red",notFound:"purple"}[r.status]}function Ut(r,e){const i=r.find(t=>t.routeId===e.id);return i?Ue(i):"gray"}function zr(){const[r,e]=Q(!1);return(Vt?Te:w)(()=>{e(!0)}),r}var Jt=Symbol.for("tanstack.rsc.stream"),ct=Symbol.for("tanstack.rsc.renderable"),Ae=Symbol.for("tanstack.rsc.slotUsages");function Kt(r){let e=r.length;for(;e>0&&r[e-1]===void 0;)e--;return e===0||e===r.length?r:r.slice(0,e)}var Ye=r=>(typeof r=="object"||typeof r=="function")&&r!==null&&Jt in r,yt=r=>{if(!Ye(r))return null;const e=r;return ct in e&&e[ct]===!0?"renderableValue":"compositeSource"},xt=r=>{if(!Ye(r))return[];const e=r,i=[];if(Ae in e){const t=e[Ae];if(Array.isArray(t))for(const c of t){const a=c==null?void 0:c.slot;typeof a=="string"&&!i.includes(a)&&i.push(a)}}return i},Yt=r=>{if(!Ye(r))return[];const e=r;if(!(Ae in e))return[];const i=e[Ae];return Array.isArray(i)?i.filter(t=>t&&typeof t=="object"&&typeof t.slot=="string"&&(t.args===void 0||Array.isArray(t.args))):[]},qt=r=>{const e=Yt(r),i={};for(const t of e){const c=Kt(t.args??[]),a=i[t.slot]??(i[t.slot]={count:0,invocations:[]});a.count++,a.invocations.push(c)}return i},Ge=r=>{if(r==="React element")return"React element";const e=yt(r);if(e==="compositeSource"){const c=xt(r);return c.length>0?`RSC composite source (${c.length} ${c.length===1?"slot":"slots"})`:"RSC composite source"}if(e==="renderableValue")return"RSC renderable value";const i=Object.getOwnPropertyNames(Object(r)),t=typeof r=="bigint"?`${r.toString()}n`:r;try{return JSON.stringify(t,i)}catch{return"unable to stringify"}};function Wt(r,e=[i=>i]){return r.map((i,t)=>[i,t]).sort(([i,t],[c,a])=>{for(const l of e){const v=l(i),u=l(c);if(typeof v>"u"){if(typeof u>"u")continue;return 1}if(v!==u)return v>u?1:-1}return t-a}).map(([i])=>i)}var Zt=E('<span><svg xmlns=http://www.w3.org/2000/svg width=12 height=12 fill=none viewBox="0 0 24 24"><path stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M9 18l6-6-6-6">'),ze=E("<div>"),Qt=E("<button><span>:</span><span>"),Xt=E("<div><span>slots</span><div>"),ut=E("<span>:"),ft=E("<span>"),er=E("<button><span> "),tr=E("<div><div><button> [<!> ... <!>]"),rr=E("<button><span></span> 🔄 "),Ne=({expanded:r,style:e={}})=>{const i=Ct();return(()=>{var t=Zt(),c=t.firstChild;return w(a=>{var l=i().expander,v=V(i().expanderIcon(r));return l!==a.e&&s(t,a.e=l),v!==a.t&&le(c,"class",a.t=v),a},{e:void 0,t:void 0}),t})()};function nr(r,e){if(e<1)return[];let i=0;const t=[];for(;i<r.length;)t.push(r.slice(i,i+e)),i=i+e;return t}function ir(r){return Symbol.iterator in r}function or(r){if(!r||typeof r!="object")return!1;const e=Object.getPrototypeOf(r);return e===Object.prototype||e===null}function se({value:r,defaultExpanded:e,pageSize:i=100,filterSubEntries:t,...c}){const[a,l]=Q(!!e),v=()=>l(O=>!O),u=U(()=>typeof r()),o=U(()=>{let O=[];const Z=f=>{const y=e===!0?{[f.label]:!0}:e==null?void 0:e[f.label];return{...f,value:()=>f.value,defaultExpanded:y}};if(Array.isArray(r())&&r().length===2&&r()[0]==="React element"&&or(r()[1])){const f=r();O=[Z({label:"0",value:f[0]}),...Object.entries(f[1]).map(([y,j])=>Z({label:y,value:j}))]}else Array.isArray(r())?O=r().map((f,y)=>Z({label:y.toString(),value:f})):r()!==null&&typeof r()=="object"&&ir(r())&&typeof r()[Symbol.iterator]=="function"?O=Array.from(r(),(f,y)=>Z({label:y.toString(),value:f})):typeof r()=="object"&&r()!==null&&(O=Object.entries(r()).map(([f,y])=>Z({label:f,value:y})));return t?t(O):O}),n=U(()=>nr(o(),i)),[k,m]=Q([]),[A,N]=Q(void 0),p=Ct(),R=()=>{N(r()())},K=O=>S(se,Je({value:r,filterSubEntries:t},c,O)),W=U(()=>yt(r())),Ce=U(()=>xt(r())),Re=U(()=>qt(r())),Me=U(()=>W()==="compositeSource"&&Ce().length>0);return(()=>{var O=ze();return g(O,(()=>{var Z=L(()=>W()!==null);return()=>Z()?L(()=>!!Me())()?[(()=>{var f=Qt(),y=f.firstChild,j=y.firstChild,b=y.nextSibling;return f.$$click=()=>v(),g(f,S(Ne,{get expanded(){return a()??!1}}),y),g(y,()=>c.label,j),g(b,()=>Ge(r())),w(H=>{var M=p().expandButton,X=p().compositeComponent;return M!==H.e&&s(f,H.e=M),X!==H.t&&s(b,H.t=X),H},{e:void 0,t:void 0}),f})(),L(()=>L(()=>!!(a()??!1))()?(()=>{var f=Xt(),y=f.firstChild,j=y.nextSibling;return g(j,()=>Ce().map(b=>{const H=Re()[b];return H?S(se,{label:`${b}:`,value:()=>H.invocations.map(M=>M.length===1?M[0]:M)}):null})),w(b=>{var H=p().rscMetaRow,M=p().rscMetaLabel,X=p().subEntries;return H!==b.e&&s(f,b.e=H),M!==b.t&&s(y,b.t=M),X!==b.a&&s(j,b.a=X),b},{e:void 0,t:void 0,a:void 0}),f})():null)]:[(()=>{var f=ut(),y=f.firstChild;return g(f,()=>c.label,y),f})()," ",(()=>{var f=ft();return g(f,()=>Ge(r())),w(()=>s(f,W()==="compositeSource"?p().compositeComponent:p().renderableComponent)),f})()]:L(()=>!!n().length)()?[(()=>{var f=er(),y=f.firstChild,j=y.firstChild;return f.$$click=()=>v(),g(f,S(Ne,{get expanded(){return a()??!1}}),y),g(f,()=>c.label,y),g(y,()=>String(u).toLowerCase()==="iterable"?"(Iterable) ":"",j),g(y,()=>o().length,j),g(y,()=>o().length>1?"items":"item",null),w(b=>{var H=p().expandButton,M=p().info;return H!==b.e&&s(f,b.e=H),M!==b.t&&s(y,b.t=M),b},{e:void 0,t:void 0}),f})(),L(()=>L(()=>!!(a()??!1))()?L(()=>n().length===1)()?(()=>{var f=ze();return g(f,()=>o().map((y,j)=>K(y))),w(()=>s(f,p().subEntries)),f})():(()=>{var f=ze();return g(f,()=>n().map((y,j)=>(()=>{var b=tr(),H=b.firstChild,M=H.firstChild,X=M.firstChild,fe=X.nextSibling,we=fe.nextSibling.nextSibling;return we.nextSibling,M.$$click=()=>m(Y=>Y.includes(j)?Y.filter(C=>C!==j):[...Y,j]),g(M,S(Ne,{get expanded(){return k().includes(j)}}),X),g(M,j*i,fe),g(M,j*i+i-1,we),g(H,(()=>{var Y=L(()=>!!k().includes(j));return()=>Y()?(()=>{var C=ze();return g(C,()=>y.map(P=>K(P))),w(()=>s(C,p().subEntries)),C})():null})(),null),w(Y=>{var C=p().entry,P=V(p().labelButton,"labelButton");return C!==Y.e&&s(H,Y.e=C),P!==Y.t&&s(M,Y.t=P),Y},{e:void 0,t:void 0}),b})())),w(()=>s(f,p().subEntries)),f})():null)]:L(()=>u()==="function")()?S(se,{get label(){return(()=>{var f=rr(),y=f.firstChild;return f.$$click=R,g(y,()=>c.label),w(()=>s(f,p().refreshValueBtn)),f})()},value:A,defaultExpanded:{}}):[(()=>{var f=ut(),y=f.firstChild;return g(f,()=>c.label,y),f})()," ",(()=>{var f=ft();return g(f,()=>Ge(r())),w(()=>s(f,p().value)),f})()]})()),w(()=>s(O,p().entry)),O})()}var ar=r=>{const{colors:e,font:i,size:t,border:c}=B,{fontFamily:a,lineHeight:l,size:v}=i,u=r?ue.bind({target:r}):ue;return{entry:u`
428
+ `}};function xe(){const[r]=Q(Gt(pt($t)));return r}var Nt=r=>{try{const e=localStorage.getItem(r);return typeof e=="string"?JSON.parse(e):void 0}catch{return}};function dt(r,e){const[i,t]=Q();return Te(()=>{const a=Nt(r);t(typeof a>"u"||a===null?typeof e=="function"?e():e:a)}),[i,a=>{t(l=>{let v=a;typeof a=="function"&&(v=a(l));try{localStorage.setItem(r,JSON.stringify(v))}catch{}return v})}]}var Vt=typeof window>"u";function Ue(r){return r.isFetching&&r.status==="success"?r.isFetching==="beforeLoad"?"purple":"blue":{pending:"yellow",success:"green",error:"red",notFound:"purple"}[r.status]}function Ut(r,e){const i=r.find(t=>t.routeId===e.id);return i?Ue(i):"gray"}function zr(){const[r,e]=Q(!1);return(Vt?Te:w)(()=>{e(!0)}),r}var Jt=Symbol.for("tanstack.rsc.stream"),ct=Symbol.for("tanstack.rsc.renderable"),Ae=Symbol.for("tanstack.rsc.slotUsages");function Kt(r){let e=r.length;for(;e>0&&r[e-1]===void 0;)e--;return e===0||e===r.length?r:r.slice(0,e)}var Ye=r=>(typeof r=="object"||typeof r=="function")&&r!==null&&Jt in r,yt=r=>{if(!Ye(r))return null;const e=r;return ct in e&&e[ct]===!0?"renderableValue":"compositeSource"},xt=r=>{if(!Ye(r))return[];const e=r,i=[];if(Ae in e){const t=e[Ae];if(Array.isArray(t))for(const c of t){const a=c==null?void 0:c.slot;typeof a=="string"&&!i.includes(a)&&i.push(a)}}return i},Yt=r=>{if(!Ye(r))return[];const e=r;if(!(Ae in e))return[];const i=e[Ae];return Array.isArray(i)?i.filter(t=>t&&typeof t=="object"&&typeof t.slot=="string"&&(t.args===void 0||Array.isArray(t.args))):[]},qt=r=>{const e=Yt(r),i={};for(const t of e){const c=Kt(t.args??[]),a=i[t.slot]??(i[t.slot]={count:0,invocations:[]});a.count++,a.invocations.push(c)}return i},Ge=r=>{if(r==="React element")return"React element";const e=yt(r);if(e==="compositeSource"){const c=xt(r);return c.length>0?`RSC composite source (${c.length} ${c.length===1?"slot":"slots"})`:"RSC composite source"}if(e==="renderableValue")return"RSC renderable value";const i=Object.getOwnPropertyNames(Object(r)),t=typeof r=="bigint"?`${r.toString()}n`:r;try{return JSON.stringify(t,i)}catch{return"unable to stringify"}};function Wt(r,e=[i=>i]){return r.map((i,t)=>[i,t]).sort(([i,t],[c,a])=>{for(const l of e){const v=l(i),u=l(c);if(typeof v>"u"){if(typeof u>"u")continue;return 1}if(v!==u)return v>u?1:-1}return t-a}).map(([i])=>i)}var Zt=E('<span><svg xmlns=http://www.w3.org/2000/svg width=12 height=12 fill=none viewBox="0 0 24 24"><path stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M9 18l6-6-6-6">'),ze=E("<div>"),Qt=E("<button><span>:</span><span>"),Xt=E("<div><span>slots</span><div>"),ut=E("<span>:"),ft=E("<span>"),er=E("<button><span> "),tr=E("<div><div><button> [<!> ... <!>]"),rr=E("<button><span></span> 🔄 "),Ne=({expanded:r,style:e={}})=>{const i=Ct();return(()=>{var t=Zt(),c=t.firstChild;return w(a=>{var l=i().expander,v=V(i().expanderIcon(r));return l!==a.e&&s(t,a.e=l),v!==a.t&&le(c,"class",a.t=v),a},{e:void 0,t:void 0}),t})()};function nr(r,e){if(e<1)return[];let i=0;const t=[];for(;i<r.length;)t.push(r.slice(i,i+e)),i=i+e;return t}function ir(r){return Symbol.iterator in r}function or(r){if(!r||typeof r!="object")return!1;const e=Object.getPrototypeOf(r);return e===Object.prototype||e===null}function se({value:r,defaultExpanded:e,pageSize:i=100,filterSubEntries:t,...c}){const[a,l]=Q(!!e),v=()=>l(O=>!O),u=U(()=>typeof r()),o=U(()=>{let O=[];const Z=f=>{const y=e===!0?{[f.label]:!0}:e==null?void 0:e[f.label];return{...f,value:()=>f.value,defaultExpanded:y}};if(Array.isArray(r())&&r().length===2&&r()[0]==="React element"&&or(r()[1])){const f=r();O=[Z({label:"0",value:f[0]}),...Object.entries(f[1]).map(([y,j])=>Z({label:y,value:j}))]}else Array.isArray(r())?O=r().map((f,y)=>Z({label:y.toString(),value:f})):r()!==null&&typeof r()=="object"&&ir(r())&&typeof r()[Symbol.iterator]=="function"?O=Array.from(r(),(f,y)=>Z({label:y.toString(),value:f})):typeof r()=="object"&&r()!==null&&(O=Object.entries(r()).map(([f,y])=>Z({label:f,value:y})));return t?t(O):O}),n=U(()=>nr(o(),i)),[k,m]=Q([]),[A,N]=Q(void 0),p=Ct(),R=()=>{N(r()())},K=O=>S(se,Je({value:r,filterSubEntries:t},c,O)),W=U(()=>yt(r())),Ce=U(()=>xt(r())),Re=U(()=>qt(r())),Me=U(()=>W()==="compositeSource"&&Ce().length>0);return(()=>{var O=ze();return g(O,(()=>{var Z=L(()=>W()!==null);return()=>Z()?L(()=>!!Me())()?[(()=>{var f=Qt(),y=f.firstChild,j=y.firstChild,b=y.nextSibling;return f.$$click=()=>v(),g(f,S(Ne,{get expanded(){return a()??!1}}),y),g(y,()=>c.label,j),g(b,()=>Ge(r())),w(H=>{var M=p().expandButton,X=p().compositeComponent;return M!==H.e&&s(f,H.e=M),X!==H.t&&s(b,H.t=X),H},{e:void 0,t:void 0}),f})(),L(()=>L(()=>!!(a()??!1))()?(()=>{var f=Xt(),y=f.firstChild,j=y.nextSibling;return g(j,()=>Ce().map(b=>{const H=Re()[b];return H?S(se,{label:`${b}:`,value:()=>H.invocations.map(M=>M.length===1?M[0]:M)}):null})),w(b=>{var H=p().rscMetaRow,M=p().rscMetaLabel,X=p().subEntries;return H!==b.e&&s(f,b.e=H),M!==b.t&&s(y,b.t=M),X!==b.a&&s(j,b.a=X),b},{e:void 0,t:void 0,a:void 0}),f})():null)]:[(()=>{var f=ut(),y=f.firstChild;return g(f,()=>c.label,y),f})()," ",(()=>{var f=ft();return g(f,()=>Ge(r())),w(()=>s(f,W()==="compositeSource"?p().compositeComponent:p().renderableComponent)),f})()]:L(()=>!!n().length)()?[(()=>{var f=er(),y=f.firstChild,j=y.firstChild;return f.$$click=()=>v(),g(f,S(Ne,{get expanded(){return a()??!1}}),y),g(f,()=>c.label,y),g(y,()=>String(u).toLowerCase()==="iterable"?"(Iterable) ":"",j),g(y,()=>o().length,j),g(y,()=>o().length>1?"items":"item",null),w(b=>{var H=p().expandButton,M=p().info;return H!==b.e&&s(f,b.e=H),M!==b.t&&s(y,b.t=M),b},{e:void 0,t:void 0}),f})(),L(()=>L(()=>!!(a()??!1))()?L(()=>n().length===1)()?(()=>{var f=ze();return g(f,()=>o().map((y,j)=>K(y))),w(()=>s(f,p().subEntries)),f})():(()=>{var f=ze();return g(f,()=>n().map((y,j)=>(()=>{var b=tr(),H=b.firstChild,M=H.firstChild,X=M.firstChild,fe=X.nextSibling,we=fe.nextSibling.nextSibling;return we.nextSibling,M.$$click=()=>m(Y=>Y.includes(j)?Y.filter(C=>C!==j):[...Y,j]),g(M,S(Ne,{get expanded(){return k().includes(j)}}),X),g(M,j*i,fe),g(M,j*i+i-1,we),g(H,(()=>{var Y=L(()=>!!k().includes(j));return()=>Y()?(()=>{var C=ze();return g(C,()=>y.map(P=>K(P))),w(()=>s(C,p().subEntries)),C})():null})(),null),w(Y=>{var C=p().entry,P=V(p().labelButton,"labelButton");return C!==Y.e&&s(H,Y.e=C),P!==Y.t&&s(M,Y.t=P),Y},{e:void 0,t:void 0}),b})())),w(()=>s(f,p().subEntries)),f})():null)]:L(()=>u()==="function")()?S(se,{get label(){return(()=>{var f=rr(),y=f.firstChild;return f.$$click=R,g(y,()=>c.label),w(()=>s(f,p().refreshValueBtn)),f})()},value:A,defaultExpanded:{}}):[(()=>{var f=ut(),y=f.firstChild;return g(f,()=>c.label,y),f})()," ",(()=>{var f=ft();return g(f,()=>Ge(r())),w(()=>s(f,p().value)),f})()]})()),w(()=>s(O,p().entry)),O})()}var ar=r=>{const{colors:e,font:i,size:t,border:c}=D,{fontFamily:a,lineHeight:l,size:v}=i,u=r?ue.bind({target:r}):ue;return{entry:u`
429
429
  font-family: ${a.mono};
430
430
  font-size: ${v.xs};
431
431
  line-height: ${l.sm};
@@ -536,4 +536,4 @@ import{u as _t,c as Q,a as Te,b as U,s as ht,m as Je,i as g,k as Ft,e as w,f as
536
536
  padding: 0;
537
537
  font-family: ${a.mono};
538
538
  font-size: ${v.xs};
539
- `}};function Ct(){const[r]=Q(ar(pt($t)));return r}Ke(["click"]);var sr=E("<div><div></div><div>/</div><div></div><div>/</div><div>");function Ve(r){const e=["s","min","h","d"],i=[r/1e3,r/6e4,r/36e5,r/864e5];let t=0;for(let c=1;c<i.length&&!(i[c]<1);c++)t=c;return new Intl.NumberFormat(navigator.language,{compactDisplay:"short",notation:"compact",maximumFractionDigits:0}).format(i[t])+e[t]}function Ee({match:r,router:e}){const i=xe();if(!r)return null;const t=e().routesById[r.routeId];if(!t.options.loader)return null;const c=Date.now()-r.updatedAt,a=t.options.staleTime??e().options.defaultStaleTime??0,l=t.options.gcTime??e().options.defaultGcTime??3e5;return(()=>{var v=sr(),u=v.firstChild,o=u.nextSibling.nextSibling,n=o.nextSibling.nextSibling;return g(u,()=>Ve(c)),g(o,()=>Ve(a)),g(n,()=>Ve(l)),w(()=>s(v,V(i().ageTicker(c>a)))),v})()}var lr=E("<button type=button>➔");function Ie({to:r,params:e,search:i,router:t}){const c=xe();return(()=>{var a=lr();return a.$$click=l=>{l.stopPropagation(),t().navigate({to:r,params:e,search:i})},le(a,"title",`Navigate to ${r}`),w(()=>s(a,c().navigateButton)),a})()}Ke(["click"]);var dr=E("<button><div>TANSTACK</div><div>TanStack Router v1"),cr=E("<div style=display:flex;align-items:center;width:100%><div style=flex-grow:1;min-width:0>"),ur=E("<code> "),ye=E("<code>"),fr=E("<div><div role=button><div>"),De=E("<div>"),gr=E("<div><ul>"),vr=E('<div><button><svg xmlns=http://www.w3.org/2000/svg width=10 height=6 fill=none viewBox="0 0 10 6"><path stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=1.667 d="M1 1l4 4 4-4"></path></svg></button><div><div></div><div><div></div></div></div><div><div><div><span>Pathname</span></div><div><code></code></div><div><div><button type=button>Routes</button><button type=button>Matches</button><button type=button>History</button></div><div><div>age / staleTime / gcTime</div></div></div><div>'),hr=E("<div><span>masked"),gt=E("<div role=button><div>"),pr=E("<li><div>"),mr=E("<li>This panel displays the most recent 15 navigations."),$r=E("<div><div><div>Cached Matches</div><div>age / staleTime / gcTime</div></div><div>"),br=E("<div><div>Match Details</div><div><div><div><div></div></div><div><div>ID:</div><div><code></code></div></div><div><div>State:</div><div></div></div><div><div>Last Updated:</div><div></div></div></div></div><div>Explorer</div><div>"),yr=E("<div>Loader Data"),xr=E("<div><div><span>Search Params</span></div><div>"),Cr=E("<span style=margin-left:0.5rem>"),wr=E('<button type=button aria-label="Copy value to clipboard"style=cursor:pointer>'),vt=15;function kr(r){const{className:e,...i}=r,t=xe();return(()=>{var c=dr(),a=c.firstChild,l=a.nextSibling;return ht(c,Je(i,{get class(){return V(t().logo,e?e():"")}}),!1,!0),w(v=>{var u=t().tanstackLogo,o=t().routerLogo;return u!==v.e&&s(a,v.e=u),o!==v.t&&s(l,v.t=o),v},{e:void 0,t:void 0}),c})()}function Be(r){return(()=>{var e=cr(),i=e.firstChild;return g(e,()=>r.left,i),g(i,()=>r.children),g(e,()=>r.right,null),w(()=>s(e,r.class)),e})()}function wt({routerState:r,pendingMatches:e,router:i,route:t,isRoot:c,activeId:a,setActiveId:l}){const v=xe(),u=U(()=>e().length?e():r().matches),o=U(()=>r().matches.find(m=>m.routeId===t.id)),n=U(()=>{var m,A;try{if((m=o())!=null&&m.params){const N=(A=o())==null?void 0:A.params,p=t.path||st(t.id);if(p.startsWith("$")){const R=p.slice(1);if(N[R])return`(${N[R]})`}}return""}catch{return""}}),k=U(()=>{if(c||!t.path)return;const m=Object.assign({},...u().map(p=>p.params)),A=Tt(t),N=A?At(t.fullPath,A,m,i().pathParamsDecoder):t.fullPath;return A&&Rt(A,m)?void 0:N});return(()=>{var m=fr(),A=m.firstChild,N=A.firstChild;return A.$$click=()=>{o()&&l(a()===t.id?"":t.id)},g(A,S(Be,{get class(){return V(v().routesRow(!!o()))},get left(){return S(It,{get when(){return k()},children:p=>S(Ie,{get to(){return p()},router:i})})},get right(){return S(Ee,{get match(){return o()},router:i})},get children(){return[(()=>{var p=ur(),R=p.firstChild;return g(p,()=>c?be:t.path||st(t.id),R),w(()=>s(p,v().code)),p})(),(()=>{var p=ye();return g(p,n),w(()=>s(p,v().routeParamInfo)),p})()]}}),null),g(m,(()=>{var p=L(()=>{var R;return!!((R=t.children)!=null&&R.length)});return()=>p()?(()=>{var R=De();return g(R,()=>[...t.children].sort((K,W)=>K.rank-W.rank).map(K=>S(wt,{routerState:r,pendingMatches:e,router:i,route:K,activeId:a,setActiveId:l}))),w(()=>s(R,v().nestedRouteRow(!!c))),R})():null})(),null),w(p=>{var R=`Open match details for ${t.id}`,K=V(v().routesRowContainer(t.id===a(),!!o())),W=V(v().matchIndicator(Ut(u(),t)));return R!==p.e&&le(A,"aria-label",p.e=R),K!==p.t&&s(A,p.t=K),W!==p.a&&s(N,p.a=W),p},{e:void 0,t:void 0,a:void 0}),m})()}var Er=function({...e}){const{isOpen:i=!0,setIsOpen:t,handleDragStart:c,router:a,routerState:l,shadowDOMTarget:v,...u}=e,{onCloseClick:o}=_t(),n=xe(),{className:k,style:m,...A}=u,[N,p]=dt("tanstackRouterDevtoolsActiveTab","routes"),[R,K]=dt("tanstackRouterDevtoolsActiveRouteId",""),[W,Ce]=Q([]),[Re,Me]=Q(!1),O=()=>{const C=l().matches;return C.some(P=>P.status==="pending")?C:[]};let Z=a()._cache,f=[...Z.values()];const[y,j]=Q(f);Te(()=>{const C=()=>{const ee=a()._cache;let q=ee.size!==f.length;if(!q){let ie=0;for(const de of ee.values())if(de!==f[ie++]){q=!0;break}}(ee!==Z||q)&&(Z=ee,f=[...ee.values()],j(f))};C();const P=setInterval(C,500);mt(()=>clearInterval(P))}),Te(()=>{const C=l().matches,P=C[C.length-1];if(!P)return;const ee=Dt(()=>W()),q=ee[0],ie=q&&q.pathname===P.pathname&&JSON.stringify(q.search??{})===JSON.stringify(P.search??{});(!q||!ie)&&(ee.length>=vt&&Me(!0),Ce(de=>{const ge=[P,...de];return ge.splice(vt),ge}))});const b=U(()=>[...O(),...l().matches,...y()].find(C=>C.routeId===R()||C.id===R())),H=U(()=>Bt(l().location.search)),M=U(()=>({...a(),state:l()})),X=U(()=>Object.fromEntries(Wt(Object.keys(M()),["state","routesById","routesByPath","options","manifest"].map(C=>P=>P!==C)).map(C=>[C,M()[C]]).filter(C=>typeof C[1]!="function"&&!["stores","basepath","subscribers","_scroll","tempLocationKey","latestLocation","routeTree","history"].includes(C[0])))),fe=U(()=>{var C;return(C=b())==null?void 0:C.loaderData}),we=U(()=>b()),Y=U(()=>l().location.search);return(()=>{var C=vr(),P=C.firstChild,ee=P.firstChild,q=P.nextSibling,ie=q.firstChild,de=ie.nextSibling,ge=de.firstChild,Pe=q.nextSibling,qe=Pe.firstChild,ke=qe.firstChild;ke.firstChild;var Se=ke.nextSibling,kt=Se.firstChild,Le=Se.nextSibling,Oe=Le.firstChild,_e=Oe.firstChild,Fe=_e.nextSibling,je=Fe.nextSibling,St=Oe.nextSibling,We=Le.nextSibling;return ht(C,Je({get class(){return V(n().devtoolsPanel,"TanStackRouterDevtoolsPanel",k?k():"")},get style(){return m?m():""}},A),!1,!0),g(C,c?(()=>{var d=De();return Ft(d,"mousedown",c,!0),w(()=>s(d,n().dragHandle)),d})():null,P),P.$$click=d=>{t&&t(!1),o(d)},g(ie,S(kr,{"aria-hidden":!0,onClick:d=>{t&&t(!1),o(d)}})),g(ge,S(se,{label:"Router",value:X,defaultExpanded:{state:{},context:{},options:{}},filterSubEntries:d=>d.filter($=>typeof $.value()!="function")})),g(ke,(()=>{var d=L(()=>!!l().location.maskedLocation);return()=>d()?(()=>{var $=hr(),F=$.firstChild;return w(I=>{var _=n().maskedBadgeContainer,h=n().maskedBadge;return _!==I.e&&s($,I.e=_),h!==I.t&&s(F,I.t=h),I},{e:void 0,t:void 0}),$})():null})(),null),g(kt,()=>l().location.pathname),g(Se,(()=>{var d=L(()=>!!l().location.maskedLocation);return()=>d()?(()=>{var $=ye();return g($,()=>{var F;return(F=l().location.maskedLocation)==null?void 0:F.pathname}),w(()=>s($,n().maskedLocation)),$})():null})(),null),_e.$$click=()=>{p("routes")},Fe.$$click=()=>{p("matches")},je.$$click=()=>{p("history")},g(We,S(Et,{get children(){return[S(He,{get when(){return N()==="routes"},get children(){return S(wt,{routerState:l,pendingMatches:O,router:a,get route(){return a().routeTree},isRoot:!0,activeId:R,setActiveId:K})}}),S(He,{get when(){return N()==="matches"},get children(){var d=De();return g(d,()=>(O().length?O():l().matches).map(($,F)=>(()=>{var I=gt(),_=I.firstChild;return I.$$click=()=>K(R()===$.id?"":$.id),g(I,S(Be,{get left(){return S(Ie,{get to(){return $.pathname},get params(){return $.params},get search(){return $.search},router:a})},get right(){return S(Ee,{match:$,router:a})},get children(){var h=ye();return g(h,()=>`${$.routeId===be?be:$.pathname}`),w(()=>s(h,n().matchID)),h}}),null),w(h=>{var z=`Open match details for ${$.id}`,G=V(n().matchRow($===b())),T=V(n().matchIndicator(Ue($)));return z!==h.e&&le(I,"aria-label",h.e=z),G!==h.t&&s(I,h.t=G),T!==h.a&&s(_,h.a=T),h},{e:void 0,t:void 0,a:void 0}),I})())),d}}),S(He,{get when(){return N()==="history"},get children(){var d=gr(),$=d.firstChild;return g($,S(zt,{get each(){return W()},children:(F,I)=>(()=>{var _=pr(),h=_.firstChild;return g(_,S(Be,{get left(){return S(Ie,{get to(){return F.pathname},get params(){return F.params},get search(){return F.search},router:a})},get right(){return S(Ee,{match:F,router:a})},get children(){var z=ye();return g(z,()=>`${F.routeId===be?be:F.pathname}`),w(()=>s(z,n().matchID)),z}}),null),w(z=>{var G=V(n().matchRow(F===b())),T=V(n().matchIndicator(I()===0?"green":"gray"));return G!==z.e&&s(_,z.e=G),T!==z.t&&s(h,z.t=T),z},{e:void 0,t:void 0}),_})()}),null),g($,(()=>{var F=L(()=>!!Re());return()=>F()?(()=>{var I=mr();return w(()=>s(I,n().historyOverflowContainer)),I})():null})(),null),d}})]}})),g(Pe,(()=>{var d=L(()=>!!y().length);return()=>d()?(()=>{var $=$r(),F=$.firstChild,I=F.firstChild.nextSibling,_=F.nextSibling;return g(_,()=>y().map(h=>(()=>{var z=gt(),G=z.firstChild;return z.$$click=()=>K(R()===h.id?"":h.id),g(z,S(Be,{get left(){return S(Ie,{get to(){return h.pathname},get params(){return h.params},get search(){return h.search},router:a})},get right(){return S(Ee,{match:h,router:a})},get children(){var T=ye();return g(T,()=>`${h.id}`),w(()=>s(T,n().matchID)),T}}),null),w(T=>{var oe=`Open match details for ${h.id}`,te=V(n().matchRow(h===b())),re=V(n().matchIndicator(Ue(h)));return oe!==T.e&&le(z,"aria-label",T.e=oe),te!==T.t&&s(z,T.t=te),re!==T.a&&s(G,T.a=re),T},{e:void 0,t:void 0,a:void 0}),z})())),w(h=>{var z=n().cachedMatchesContainer,G=n().detailsHeader,T=n().detailsHeaderInfo;return z!==h.e&&s($,h.e=z),G!==h.t&&s(F,h.t=G),T!==h.a&&s(I,h.a=T),h},{e:void 0,t:void 0,a:void 0}),$})():null})(),null),g(C,(()=>{var d=L(()=>{var $;return!!(b()&&(($=b())!=null&&$.status))});return()=>d()?(()=>{var $=br(),F=$.firstChild,I=F.nextSibling,_=I.firstChild,h=_.firstChild,z=h.firstChild,G=h.nextSibling,T=G.firstChild.nextSibling,oe=T.firstChild,te=G.nextSibling,re=te.firstChild.nextSibling,ve=te.nextSibling,he=ve.firstChild.nextSibling,ce=I.nextSibling,pe=ce.nextSibling;return g(z,(()=>{var x=L(()=>{var D,J;return!!(((D=b())==null?void 0:D.status)==="success"&&((J=b())!=null&&J.isFetching))});return()=>{var D;return x()?"fetching":(D=b())==null?void 0:D.status}})()),g(oe,()=>{var x;return(x=b())==null?void 0:x.id}),g(re,(()=>{var x=L(()=>!!O().find(D=>{var J;return D.id===((J=b())==null?void 0:J.id)}));return()=>x()?"Pending":l().matches.find(D=>{var J;return D.id===((J=b())==null?void 0:J.id)})?"Active":"Cached"})()),g(he,(()=>{var x=L(()=>{var D;return!!((D=b())!=null&&D.updatedAt)});return()=>{var D;return x()?new Date((D=b())==null?void 0:D.updatedAt).toLocaleTimeString():"N/A"}})()),g($,(()=>{var x=L(()=>!!fe());return()=>x()?[(()=>{var D=yr();return w(()=>s(D,n().detailsHeader)),D})(),(()=>{var D=De();return g(D,S(se,{label:"loaderData",value:fe,defaultExpanded:{}})),w(()=>s(D,n().detailsContent)),D})()]:null})(),ce),g(pe,S(se,{label:"Match",value:we,defaultExpanded:{}})),w(x=>{var ot,at;var D=n().thirdContainer,J=n().detailsHeader,me=n().matchDetails,$e=n().matchStatus((ot=b())==null?void 0:ot.status,(at=b())==null?void 0:at.isFetching),Ze=n().matchDetailsInfoLabel,Qe=n().matchDetailsInfo,Xe=n().matchDetailsInfoLabel,et=n().matchDetailsInfo,tt=n().matchDetailsInfoLabel,rt=n().matchDetailsInfo,nt=n().detailsHeader,it=n().detailsContent;return D!==x.e&&s($,x.e=D),J!==x.t&&s(F,x.t=J),me!==x.a&&s(_,x.a=me),$e!==x.o&&s(h,x.o=$e),Ze!==x.i&&s(G,x.i=Ze),Qe!==x.n&&s(T,x.n=Qe),Xe!==x.s&&s(te,x.s=Xe),et!==x.h&&s(re,x.h=et),tt!==x.r&&s(ve,x.r=tt),rt!==x.d&&s(he,x.d=rt),nt!==x.l&&s(ce,x.l=nt),it!==x.u&&s(pe,x.u=it),x},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0}),$})():null})(),null),g(C,(()=>{var d=L(()=>!!H());return()=>d()?(()=>{var $=xr(),F=$.firstChild;F.firstChild;var I=F.nextSibling;return g(F,typeof navigator<"u"?(()=>{var _=Cr();return g(_,S(Sr,{getValue:()=>{const h=l().location.search;return JSON.stringify(h)}})),_})():null,null),g(I,S(se,{value:Y,get defaultExpanded(){return Object.keys(l().location.search).reduce((_,h)=>(_[h]={},_),{})}})),w(_=>{var h=n().fourthContainer,z=n().detailsHeader,G=n().detailsContent;return h!==_.e&&s($,_.e=h),z!==_.t&&s(F,_.t=z),G!==_.a&&s(I,_.a=G),_},{e:void 0,t:void 0,a:void 0}),$})():null})(),null),w(d=>{var $=n().panelCloseBtn,F=n().panelCloseBtnIcon,I=n().firstContainer,_=n().row,h=n().routerExplorerContainer,z=n().routerExplorer,G=n().secondContainer,T=n().matchesContainer,oe=n().detailsHeader,te=n().detailsContent,re=n().detailsHeader,ve=n().routeMatchesToggle,he=N()==="routes",ce=V(n().routeMatchesToggleBtn(N()==="routes",!0)),pe=N()==="matches",x=V(n().routeMatchesToggleBtn(N()==="matches",!0)),D=N()==="history",J=V(n().routeMatchesToggleBtn(N()==="history",!1)),me=n().detailsHeaderInfo,$e=V(n().routesContainer);return $!==d.e&&s(P,d.e=$),F!==d.t&&le(ee,"class",d.t=F),I!==d.a&&s(q,d.a=I),_!==d.o&&s(ie,d.o=_),h!==d.i&&s(de,d.i=h),z!==d.n&&s(ge,d.n=z),G!==d.s&&s(Pe,d.s=G),T!==d.h&&s(qe,d.h=T),oe!==d.r&&s(ke,d.r=oe),te!==d.d&&s(Se,d.d=te),re!==d.l&&s(Le,d.l=re),ve!==d.u&&s(Oe,d.u=ve),he!==d.c&&(_e.disabled=d.c=he),ce!==d.w&&s(_e,d.w=ce),pe!==d.m&&(Fe.disabled=d.m=pe),x!==d.f&&s(Fe,d.f=x),D!==d.y&&(je.disabled=d.y=D),J!==d.g&&s(je,d.g=J),me!==d.p&&s(St,d.p=me),$e!==d.b&&s(We,d.b=$e),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0,b:void 0}),C})()};function Sr({getValue:r}){const[e,i]=Q(!1);let t=null;const c=async()=>{var a;if(typeof navigator>"u"||!((a=navigator.clipboard)!=null&&a.writeText)){console.warn("TanStack Router Devtools: Clipboard API unavailable");return}try{const l=r();await navigator.clipboard.writeText(l),i(!0),t&&clearTimeout(t),t=setTimeout(()=>i(!1),2500)}catch(l){console.error("TanStack Router Devtools: Failed to copy",l)}};return mt(()=>{t&&clearTimeout(t)}),(()=>{var a=wr();return a.$$click=c,g(a,()=>e()?"✅":"📋"),w(()=>le(a,"title",e()?"Copied!":"Copy")),a})()}Ke(["click","mousedown"]);export{Er as BaseTanStackRouterDevtoolsPanel,Er as default,dt as n,xe as r,zr as t};
539
+ `}};function Ct(){const[r]=Q(ar(pt($t)));return r}Ke(["click"]);var sr=E("<div><div></div><div>/</div><div></div><div>/</div><div>");function Ve(r){const e=["s","min","h","d"],i=[r/1e3,r/6e4,r/36e5,r/864e5];let t=0;for(let c=1;c<i.length&&!(i[c]<1);c++)t=c;return new Intl.NumberFormat(navigator.language,{compactDisplay:"short",notation:"compact",maximumFractionDigits:0}).format(i[t])+e[t]}function Ee({match:r,router:e}){const i=xe();if(!r)return null;const t=e().routesById[r.routeId];if(!t.options.loader)return null;const c=Date.now()-r.updatedAt,a=t.options.staleTime??e().options.defaultStaleTime??0,l=t.options.gcTime??e().options.defaultGcTime??3e5;return(()=>{var v=sr(),u=v.firstChild,o=u.nextSibling.nextSibling,n=o.nextSibling.nextSibling;return g(u,()=>Ve(c)),g(o,()=>Ve(a)),g(n,()=>Ve(l)),w(()=>s(v,V(i().ageTicker(c>a)))),v})()}var lr=E("<button type=button>➔");function Ie({to:r,params:e,search:i,router:t}){const c=xe();return(()=>{var a=lr();return a.$$click=l=>{l.stopPropagation(),t().navigate({to:r,params:e,search:i})},le(a,"title",`Navigate to ${r}`),w(()=>s(a,c().navigateButton)),a})()}Ke(["click"]);var dr=E("<button><div>TANSTACK</div><div>TanStack Router v1"),cr=E("<div style=display:flex;align-items:center;width:100%><div style=flex-grow:1;min-width:0>"),ur=E("<code> "),ye=E("<code>"),fr=E("<div><div role=button><div>"),Be=E("<div>"),gr=E("<div><ul>"),vr=E('<div><button><svg xmlns=http://www.w3.org/2000/svg width=10 height=6 fill=none viewBox="0 0 10 6"><path stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=1.667 d="M1 1l4 4 4-4"></path></svg></button><div><div></div><div><div></div></div></div><div><div><div><span>Pathname</span></div><div><code></code></div><div><div><button type=button>Routes</button><button type=button>Matches</button><button type=button>History</button></div><div><div>age / staleTime / gcTime</div></div></div><div>'),hr=E("<div><span>masked"),gt=E("<div role=button><div>"),pr=E("<li><div>"),mr=E("<li>This panel displays the most recent 15 navigations."),$r=E("<div><div><div>Cached Matches</div><div>age / staleTime / gcTime</div></div><div>"),br=E("<div><div>Match Details</div><div><div><div><div></div></div><div><div>ID:</div><div><code></code></div></div><div><div>State:</div><div></div></div><div><div>Last Updated:</div><div></div></div></div></div><div>Explorer</div><div>"),yr=E("<div>Loader Data"),xr=E("<div><div><span>Search Params</span></div><div>"),Cr=E("<span style=margin-left:0.5rem>"),wr=E('<button type=button aria-label="Copy value to clipboard"style=cursor:pointer>'),vt=15;function kr(r){const{className:e,...i}=r,t=xe();return(()=>{var c=dr(),a=c.firstChild,l=a.nextSibling;return ht(c,Je(i,{get class(){return V(t().logo,e?e():"")}}),!1,!0),w(v=>{var u=t().tanstackLogo,o=t().routerLogo;return u!==v.e&&s(a,v.e=u),o!==v.t&&s(l,v.t=o),v},{e:void 0,t:void 0}),c})()}function De(r){return(()=>{var e=cr(),i=e.firstChild;return g(e,()=>r.left,i),g(i,()=>r.children),g(e,()=>r.right,null),w(()=>s(e,r.class)),e})()}function wt({routerState:r,pendingMatches:e,router:i,route:t,isRoot:c,activeId:a,setActiveId:l}){const v=xe(),u=U(()=>e().length?e():r().matches),o=U(()=>r().matches.find(m=>m.routeId===t.id)),n=U(()=>{var m,A;try{if((m=o())!=null&&m.params){const N=(A=o())==null?void 0:A.params,p=t.path||st(t.id);if(p.startsWith("$")){const R=p.slice(1);if(N[R])return`(${N[R]})`}}return""}catch{return""}}),k=U(()=>{if(c||!t.path)return;const m=Object.assign({},...u().map(p=>p.params)),A=Tt(t),N=A?At(t.fullPath,A,m,i().pathParamsDecoder):t.fullPath;return A&&Rt(A,m)?void 0:N});return(()=>{var m=fr(),A=m.firstChild,N=A.firstChild;return A.$$click=()=>{o()&&l(a()===t.id?"":t.id)},g(A,S(De,{get class(){return V(v().routesRow(!!o()))},get left(){return S(It,{get when(){return k()},children:p=>S(Ie,{get to(){return p()},router:i})})},get right(){return S(Ee,{get match(){return o()},router:i})},get children(){return[(()=>{var p=ur(),R=p.firstChild;return g(p,()=>c?be:t.path||st(t.id),R),w(()=>s(p,v().code)),p})(),(()=>{var p=ye();return g(p,n),w(()=>s(p,v().routeParamInfo)),p})()]}}),null),g(m,(()=>{var p=L(()=>{var R;return!!((R=t.children)!=null&&R.length)});return()=>p()?(()=>{var R=Be();return g(R,()=>[...t.children].sort((K,W)=>K.rank-W.rank).map(K=>S(wt,{routerState:r,pendingMatches:e,router:i,route:K,activeId:a,setActiveId:l}))),w(()=>s(R,v().nestedRouteRow(!!c))),R})():null})(),null),w(p=>{var R=`Open match details for ${t.id}`,K=V(v().routesRowContainer(t.id===a(),!!o())),W=V(v().matchIndicator(Ut(u(),t)));return R!==p.e&&le(A,"aria-label",p.e=R),K!==p.t&&s(A,p.t=K),W!==p.a&&s(N,p.a=W),p},{e:void 0,t:void 0,a:void 0}),m})()}var Er=function({...e}){const{isOpen:i=!0,setIsOpen:t,handleDragStart:c,router:a,routerState:l,shadowDOMTarget:v,...u}=e,{onCloseClick:o}=_t(),n=xe(),{className:k,style:m,...A}=u,[N,p]=dt("tanstackRouterDevtoolsActiveTab","routes"),[R,K]=dt("tanstackRouterDevtoolsActiveRouteId",""),[W,Ce]=Q([]),[Re,Me]=Q(!1),O=()=>{const C=l().matches;return C.some(P=>P.status==="pending")?C:[]};let Z=a()._cache,f=[...Z.values()];const[y,j]=Q(f);Te(()=>{const C=()=>{const ee=a()._cache;let q=ee.size!==f.length;if(!q){let ie=0;for(const de of ee.values())if(de!==f[ie++]){q=!0;break}}(ee!==Z||q)&&(Z=ee,f=[...ee.values()],j(f))};C();const P=setInterval(C,500);mt(()=>clearInterval(P))}),Te(()=>{const C=l().matches,P=C[C.length-1];if(!P)return;const ee=Bt(()=>W()),q=ee[0],ie=q&&q.pathname===P.pathname&&JSON.stringify(q.search??{})===JSON.stringify(P.search??{});(!q||!ie)&&(ee.length>=vt&&Me(!0),Ce(de=>{const ge=[P,...de];return ge.splice(vt),ge}))});const b=U(()=>[...O(),...l().matches,...y()].find(C=>C.routeId===R()||C.id===R())),H=U(()=>Dt(l().location.search)),M=U(()=>({...a(),state:l()})),X=U(()=>Object.fromEntries(Wt(Object.keys(M()),["state","routesById","routesByPath","options","manifest"].map(C=>P=>P!==C)).map(C=>[C,M()[C]]).filter(C=>typeof C[1]!="function"&&!["stores","basepath","subscribers","_scroll","tempLocationKey","latestLocation","routeTree","history"].includes(C[0])))),fe=U(()=>{var C;return(C=b())==null?void 0:C.loaderData}),we=U(()=>b()),Y=U(()=>l().location.search);return(()=>{var C=vr(),P=C.firstChild,ee=P.firstChild,q=P.nextSibling,ie=q.firstChild,de=ie.nextSibling,ge=de.firstChild,Pe=q.nextSibling,qe=Pe.firstChild,ke=qe.firstChild;ke.firstChild;var Se=ke.nextSibling,kt=Se.firstChild,Le=Se.nextSibling,Oe=Le.firstChild,_e=Oe.firstChild,Fe=_e.nextSibling,je=Fe.nextSibling,St=Oe.nextSibling,We=Le.nextSibling;return ht(C,Je({get class(){return V(n().devtoolsPanel,"TanStackRouterDevtoolsPanel",k?k():"")},get style(){return m?m():""}},A),!1,!0),g(C,c?(()=>{var d=Be();return Ft(d,"mousedown",c,!0),w(()=>s(d,n().dragHandle)),d})():null,P),P.$$click=d=>{t&&t(!1),o(d)},g(ie,S(kr,{"aria-hidden":!0,onClick:d=>{t&&t(!1),o(d)}})),g(ge,S(se,{label:"Router",value:X,defaultExpanded:{state:{},context:{},options:{}},filterSubEntries:d=>d.filter($=>typeof $.value()!="function")})),g(ke,(()=>{var d=L(()=>!!l().location.maskedLocation);return()=>d()?(()=>{var $=hr(),F=$.firstChild;return w(I=>{var _=n().maskedBadgeContainer,h=n().maskedBadge;return _!==I.e&&s($,I.e=_),h!==I.t&&s(F,I.t=h),I},{e:void 0,t:void 0}),$})():null})(),null),g(kt,()=>l().location.pathname),g(Se,(()=>{var d=L(()=>!!l().location.maskedLocation);return()=>d()?(()=>{var $=ye();return g($,()=>{var F;return(F=l().location.maskedLocation)==null?void 0:F.pathname}),w(()=>s($,n().maskedLocation)),$})():null})(),null),_e.$$click=()=>{p("routes")},Fe.$$click=()=>{p("matches")},je.$$click=()=>{p("history")},g(We,S(Et,{get children(){return[S(He,{get when(){return N()==="routes"},get children(){return S(wt,{routerState:l,pendingMatches:O,router:a,get route(){return a().routeTree},isRoot:!0,activeId:R,setActiveId:K})}}),S(He,{get when(){return N()==="matches"},get children(){var d=Be();return g(d,()=>(O().length?O():l().matches).map(($,F)=>(()=>{var I=gt(),_=I.firstChild;return I.$$click=()=>K(R()===$.id?"":$.id),g(I,S(De,{get left(){return S(Ie,{get to(){return $.pathname},get params(){return $.params},get search(){return $.search},router:a})},get right(){return S(Ee,{match:$,router:a})},get children(){var h=ye();return g(h,()=>`${$.routeId===be?be:$.pathname}`),w(()=>s(h,n().matchID)),h}}),null),w(h=>{var z=`Open match details for ${$.id}`,G=V(n().matchRow($===b())),T=V(n().matchIndicator(Ue($)));return z!==h.e&&le(I,"aria-label",h.e=z),G!==h.t&&s(I,h.t=G),T!==h.a&&s(_,h.a=T),h},{e:void 0,t:void 0,a:void 0}),I})())),d}}),S(He,{get when(){return N()==="history"},get children(){var d=gr(),$=d.firstChild;return g($,S(zt,{get each(){return W()},children:(F,I)=>(()=>{var _=pr(),h=_.firstChild;return g(_,S(De,{get left(){return S(Ie,{get to(){return F.pathname},get params(){return F.params},get search(){return F.search},router:a})},get right(){return S(Ee,{match:F,router:a})},get children(){var z=ye();return g(z,()=>`${F.routeId===be?be:F.pathname}`),w(()=>s(z,n().matchID)),z}}),null),w(z=>{var G=V(n().matchRow(F===b())),T=V(n().matchIndicator(I()===0?"green":"gray"));return G!==z.e&&s(_,z.e=G),T!==z.t&&s(h,z.t=T),z},{e:void 0,t:void 0}),_})()}),null),g($,(()=>{var F=L(()=>!!Re());return()=>F()?(()=>{var I=mr();return w(()=>s(I,n().historyOverflowContainer)),I})():null})(),null),d}})]}})),g(Pe,(()=>{var d=L(()=>!!y().length);return()=>d()?(()=>{var $=$r(),F=$.firstChild,I=F.firstChild.nextSibling,_=F.nextSibling;return g(_,()=>y().map(h=>(()=>{var z=gt(),G=z.firstChild;return z.$$click=()=>K(R()===h.id?"":h.id),g(z,S(De,{get left(){return S(Ie,{get to(){return h.pathname},get params(){return h.params},get search(){return h.search},router:a})},get right(){return S(Ee,{match:h,router:a})},get children(){var T=ye();return g(T,()=>`${h.id}`),w(()=>s(T,n().matchID)),T}}),null),w(T=>{var oe=`Open match details for ${h.id}`,te=V(n().matchRow(h===b())),re=V(n().matchIndicator(Ue(h)));return oe!==T.e&&le(z,"aria-label",T.e=oe),te!==T.t&&s(z,T.t=te),re!==T.a&&s(G,T.a=re),T},{e:void 0,t:void 0,a:void 0}),z})())),w(h=>{var z=n().cachedMatchesContainer,G=n().detailsHeader,T=n().detailsHeaderInfo;return z!==h.e&&s($,h.e=z),G!==h.t&&s(F,h.t=G),T!==h.a&&s(I,h.a=T),h},{e:void 0,t:void 0,a:void 0}),$})():null})(),null),g(C,(()=>{var d=L(()=>{var $;return!!(b()&&(($=b())!=null&&$.status))});return()=>d()?(()=>{var $=br(),F=$.firstChild,I=F.nextSibling,_=I.firstChild,h=_.firstChild,z=h.firstChild,G=h.nextSibling,T=G.firstChild.nextSibling,oe=T.firstChild,te=G.nextSibling,re=te.firstChild.nextSibling,ve=te.nextSibling,he=ve.firstChild.nextSibling,ce=I.nextSibling,pe=ce.nextSibling;return g(z,(()=>{var x=L(()=>{var B,J;return!!(((B=b())==null?void 0:B.status)==="success"&&((J=b())!=null&&J.isFetching))});return()=>{var B;return x()?"fetching":(B=b())==null?void 0:B.status}})()),g(oe,()=>{var x;return(x=b())==null?void 0:x.id}),g(re,(()=>{var x=L(()=>!!O().find(B=>{var J;return B.id===((J=b())==null?void 0:J.id)}));return()=>x()?"Pending":l().matches.find(B=>{var J;return B.id===((J=b())==null?void 0:J.id)})?"Active":"Cached"})()),g(he,(()=>{var x=L(()=>{var B;return!!((B=b())!=null&&B.updatedAt)});return()=>{var B;return x()?new Date((B=b())==null?void 0:B.updatedAt).toLocaleTimeString():"N/A"}})()),g($,(()=>{var x=L(()=>!!fe());return()=>x()?[(()=>{var B=yr();return w(()=>s(B,n().detailsHeader)),B})(),(()=>{var B=Be();return g(B,S(se,{label:"loaderData",value:fe,defaultExpanded:{}})),w(()=>s(B,n().detailsContent)),B})()]:null})(),ce),g(pe,S(se,{label:"Match",value:we,defaultExpanded:{}})),w(x=>{var ot,at;var B=n().thirdContainer,J=n().detailsHeader,me=n().matchDetails,$e=n().matchStatus((ot=b())==null?void 0:ot.status,(at=b())==null?void 0:at.isFetching),Ze=n().matchDetailsInfoLabel,Qe=n().matchDetailsInfo,Xe=n().matchDetailsInfoLabel,et=n().matchDetailsInfo,tt=n().matchDetailsInfoLabel,rt=n().matchDetailsInfo,nt=n().detailsHeader,it=n().detailsContent;return B!==x.e&&s($,x.e=B),J!==x.t&&s(F,x.t=J),me!==x.a&&s(_,x.a=me),$e!==x.o&&s(h,x.o=$e),Ze!==x.i&&s(G,x.i=Ze),Qe!==x.n&&s(T,x.n=Qe),Xe!==x.s&&s(te,x.s=Xe),et!==x.h&&s(re,x.h=et),tt!==x.r&&s(ve,x.r=tt),rt!==x.d&&s(he,x.d=rt),nt!==x.l&&s(ce,x.l=nt),it!==x.u&&s(pe,x.u=it),x},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0}),$})():null})(),null),g(C,(()=>{var d=L(()=>!!H());return()=>d()?(()=>{var $=xr(),F=$.firstChild;F.firstChild;var I=F.nextSibling;return g(F,typeof navigator<"u"?(()=>{var _=Cr();return g(_,S(Sr,{getValue:()=>{const h=l().location.search;return JSON.stringify(h)}})),_})():null,null),g(I,S(se,{value:Y,get defaultExpanded(){return Object.keys(l().location.search).reduce((_,h)=>(_[h]={},_),{})}})),w(_=>{var h=n().fourthContainer,z=n().detailsHeader,G=n().detailsContent;return h!==_.e&&s($,_.e=h),z!==_.t&&s(F,_.t=z),G!==_.a&&s(I,_.a=G),_},{e:void 0,t:void 0,a:void 0}),$})():null})(),null),w(d=>{var $=n().panelCloseBtn,F=n().panelCloseBtnIcon,I=n().firstContainer,_=n().row,h=n().routerExplorerContainer,z=n().routerExplorer,G=n().secondContainer,T=n().matchesContainer,oe=n().detailsHeader,te=n().detailsContent,re=n().detailsHeader,ve=n().routeMatchesToggle,he=N()==="routes",ce=V(n().routeMatchesToggleBtn(N()==="routes",!0)),pe=N()==="matches",x=V(n().routeMatchesToggleBtn(N()==="matches",!0)),B=N()==="history",J=V(n().routeMatchesToggleBtn(N()==="history",!1)),me=n().detailsHeaderInfo,$e=V(n().routesContainer);return $!==d.e&&s(P,d.e=$),F!==d.t&&le(ee,"class",d.t=F),I!==d.a&&s(q,d.a=I),_!==d.o&&s(ie,d.o=_),h!==d.i&&s(de,d.i=h),z!==d.n&&s(ge,d.n=z),G!==d.s&&s(Pe,d.s=G),T!==d.h&&s(qe,d.h=T),oe!==d.r&&s(ke,d.r=oe),te!==d.d&&s(Se,d.d=te),re!==d.l&&s(Le,d.l=re),ve!==d.u&&s(Oe,d.u=ve),he!==d.c&&(_e.disabled=d.c=he),ce!==d.w&&s(_e,d.w=ce),pe!==d.m&&(Fe.disabled=d.m=pe),x!==d.f&&s(Fe,d.f=x),B!==d.y&&(je.disabled=d.y=B),J!==d.g&&s(je,d.g=J),me!==d.p&&s(St,d.p=me),$e!==d.b&&s(We,d.b=$e),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0,b:void 0}),C})()};function Sr({getValue:r}){const[e,i]=Q(!1);let t=null;const c=async()=>{var a;if(typeof navigator>"u"||!((a=navigator.clipboard)!=null&&a.writeText)){console.warn("TanStack Router Devtools: Clipboard API unavailable");return}try{const l=r();await navigator.clipboard.writeText(l),i(!0),t&&clearTimeout(t),t=setTimeout(()=>i(!1),2500)}catch(l){console.error("TanStack Router Devtools: Failed to copy",l)}};return mt(()=>{t&&clearTimeout(t)}),(()=>{var a=wr();return a.$$click=c,g(a,()=>e()?"✅":"📋"),w(()=>le(a,"title",e()?"Copied!":"Copy")),a})()}Ke(["click","mousedown"]);export{Er as BaseTanStackRouterDevtoolsPanel,Er as default,dt as n,xe as r,zr as t};
@@ -1,4 +1,4 @@
1
- var Fy=Object.defineProperty;var Am=r=>{throw TypeError(r)};var Hy=(r,e,t)=>e in r?Fy(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var We=(r,e,t)=>Hy(r,typeof e!="symbol"?e+"":e,t),Nu=(r,e,t)=>e.has(r)||Am("Cannot "+t);var C=(r,e,t)=>(Nu(r,e,"read from private field"),t?t.call(r):e.get(r)),P=(r,e,t)=>e.has(r)?Am("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),I=(r,e,t,n)=>(Nu(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),ui=(r,e,t)=>(Nu(r,e,"access private method"),t);import{gP as Nm,gQ as _y,gR as qy,gS as Ed,gT as $y,gU as jy,gV as Vy,r as B,gW as I4,gy as Ll,gX as Dd,gY as Od,gZ as Qi,g_ as Em,g$ as Wy,h0 as Uy,h1 as qr,h2 as Vh,h3 as Ki,dN as Ky,h4 as f0,h5 as wr,h6 as Gy,h7 as Yy,h8 as Dm,h9 as Gs,ha as Jy,hb as p0,j as z,ah as Xy,al as Zy}from"./index-bYhLX3oQ.js";import{aw as Qy,ax as e7,ab as t7,ac as r7,ad as n7,ae as i7,af as o7,ag as z4,ah as s7,q as P0,ai as a7,aj as L4,ar as l7,ak as c7,al as u7,am as d7,an as h7,ao as f7,ap as p7,aq as m7,Z as Wh,a4 as g7,a5 as B4,a6 as y7,a7 as v7,a8 as b7,a9 as w7,aa as x7,E as ta,as as k7,t as rt,at as S7,n as C7,C as Om}from"./index-Bj32H2Xz.js";const M7={}.hasOwnProperty;function P4(r,e){let t=-1,n;if(e.extensions)for(;++t<e.extensions.length;)P4(r,e.extensions[t]);for(n in e)if(M7.call(e,n))switch(n){case"extensions":break;case"unsafe":{Rm(r[n],e[n]);break}case"join":{Rm(r[n],e[n]);break}case"handlers":{T7(r[n],e[n]);break}default:r.options[n]=e[n]}return r}function Rm(r,e){e&&r.push(...e)}function T7(r,e){e&&Object.assign(r,e)}const A7=[N7];function N7(r,e,t,n){if(e.type==="code"&&Nm(e,n)&&(r.type==="list"||r.type===e.type&&Nm(r,n)))return!1;if("spread"in t&&typeof t.spread=="boolean")return r.type==="paragraph"&&(r.type===e.type||e.type==="definition"||e.type==="heading"&&_y(e,n))?void 0:t.spread?1:0}const di=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],E7=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
1
+ var Fy=Object.defineProperty;var Am=r=>{throw TypeError(r)};var Hy=(r,e,t)=>e in r?Fy(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var We=(r,e,t)=>Hy(r,typeof e!="symbol"?e+"":e,t),Nu=(r,e,t)=>e.has(r)||Am("Cannot "+t);var C=(r,e,t)=>(Nu(r,e,"read from private field"),t?t.call(r):e.get(r)),P=(r,e,t)=>e.has(r)?Am("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),I=(r,e,t,n)=>(Nu(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),ui=(r,e,t)=>(Nu(r,e,"access private method"),t);import{gR as Nm,gS as _y,gT as qy,gU as Ed,gV as $y,gW as jy,gX as Vy,r as B,gY as I4,gA as Ll,gZ as Dd,g_ as Od,g$ as Qi,h0 as Em,h1 as Wy,h2 as Uy,h3 as qr,h4 as Vh,h5 as Ki,dP as Ky,h6 as f0,h7 as wr,h8 as Gy,h9 as Yy,ha as Dm,hb as Gs,hc as Jy,hd as p0,j as z,ah as Xy,al as Zy}from"./index-B4Z9VBPe.js";import{aw as Qy,ax as e7,ab as t7,ac as r7,ad as n7,ae as i7,af as o7,ag as z4,ah as s7,q as P0,ai as a7,aj as L4,ar as l7,ak as c7,al as u7,am as d7,an as h7,ao as f7,ap as p7,aq as m7,Z as Wh,a4 as g7,a5 as B4,a6 as y7,a7 as v7,a8 as b7,a9 as w7,aa as x7,E as ta,as as k7,t as rt,at as S7,n as C7,C as Om}from"./index-3nUBnton.js";const M7={}.hasOwnProperty;function P4(r,e){let t=-1,n;if(e.extensions)for(;++t<e.extensions.length;)P4(r,e.extensions[t]);for(n in e)if(M7.call(e,n))switch(n){case"extensions":break;case"unsafe":{Rm(r[n],e[n]);break}case"join":{Rm(r[n],e[n]);break}case"handlers":{T7(r[n],e[n]);break}default:r.options[n]=e[n]}return r}function Rm(r,e){e&&r.push(...e)}function T7(r,e){e&&Object.assign(r,e)}const A7=[N7];function N7(r,e,t,n){if(e.type==="code"&&Nm(e,n)&&(r.type==="list"||r.type===e.type&&Nm(r,n)))return!1;if("spread"in t&&typeof t.spread=="boolean")return r.type==="paragraph"&&(r.type===e.type||e.type==="definition"||e.type==="heading"&&_y(e,n))?void 0:t.spread?1:0}const di=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],E7=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
2
2
  `,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:di},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
3
3
  ]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:di},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
4
4
  *])`},{character:"*",inConstruct:"phrasing",notInConstruct:di},{atBreak:!0,character:"+",after:`(?:[ \r
@@ -1,4 +1,4 @@
1
- import{dN as Ee,af as xe,ag as Re,r as ve,aq as Se,ai as Ce,j,dO as Oe,al as Te}from"./index-bYhLX3oQ.js";var he={exports:{}};/* @license
1
+ import{dP as Ee,af as xe,ag as Re,r as ve,aq as Se,ai as Ce,j,dQ as Oe,al as Te}from"./index-B4Z9VBPe.js";var he={exports:{}};/* @license
2
2
  Papa Parse
3
3
  v5.7.0
4
4
  https://github.com/mholt/PapaParse
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-DHSY565t.js","assets/index-bYhLX3oQ.js","assets/index-B0qJNUoh.css","assets/index-cNE108-h.js","assets/index-Bj32H2Xz.js","assets/BlintzCanvas-Bb84mtl-.js","assets/BlintzCanvas-GgiCXV7C.css"])))=>i.map(i=>d[i]);
2
- import{af as A,ag as b,ah as D,ai as B,r as n,j as t,aj as M,ak as Q,al as q,B as y,am as H,an as K,ao as V,ap as P}from"./index-bYhLX3oQ.js";const $=n.lazy(()=>P(()=>import("./CodeMirrorEditor-DHSY565t.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeMirrorEditor}))),U=n.lazy(()=>P(()=>import("./BlintzCanvas-Bb84mtl-.js"),__vite__mapDeps([5,1,2,4,6])).then(e=>({default:e.BlintzCanvas}))),Y=500;function _(e,i){return["canvas-file",e,i]}function G(e,i){return i==="markdown"||/\.(md|markdown|mdx)$/i.test(e)}function I(e){switch(e==null?void 0:e.code){case"NOT_FOUND":return"This file doesn’t exist.";case"NOT_A_FILE":return"This path is a directory, not a file.";case"TOO_LARGE":return"This file is too large to open here.";case"BINARY_FILE":return"This file isn’t text and can’t be shown in the editor.";default:return"This file couldn’t be loaded."}}function J(e){switch(e){case"saving":return"Saving…";case"saved":return"Saved";case"error":return"Couldn’t save";default:return null}}function Z({content:e,documentId:i}){const m=A(),l=b(r=>r.selectedCwd),C=b(r=>r.setDocumentEditing),a=b(r=>{var d;return((d=r.openDocuments.find(j=>j.id===i))==null?void 0:d.editing)??!1}),h=D(),{data:c,error:x,isLoading:T}=B({queryKey:_(l,e.sourcePath),enabled:l!==null,queryFn:()=>m.readFileContent(l,e.sourcePath),staleTime:3e4,retry:!1}),[u,v]=n.useState(null),p=r=>{v(r&&c?{pinnedHash:c.hash}:null)};if(l===null)return t.jsx(R,{children:"Open a session to view files."});if(T)return t.jsx(R,{children:"Loading file…"});if(x||!c)return t.jsx(R,{children:I(x)});const o=u!==null&&a,s=(o?u==null?void 0:u.pinnedHash:null)??c.hash;return t.jsx(W,{content:e,documentId:i,cwd:l,loaded:c.content,theme:h,isEditing:o,onEditingChange:p,setDocumentEditing:C},`${e.sourcePath}:${s}`)}function W({content:e,documentId:i,cwd:m,loaded:l,theme:C,isEditing:a,onEditingChange:h,setDocumentEditing:c}){const x=e.readOnly!==!0,T=G(e.sourcePath,e.language),u=M(),[v,p]=n.useState(l),o=Q({sourcePath:e.sourcePath,cwd:m,loadedContent:l}),s=n.useRef(null),r=n.useRef(v),d=n.useRef(o.save),j=n.useRef(h);n.useEffect(()=>{r.current=v,d.current=o.save,j.current=h});const k=n.useCallback(f=>{p(f),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=null,d.current(r.current)},Y)},[]),z=()=>{p(l),h(!0),c(i,!0)},O=async()=>{s.current&&(clearTimeout(s.current),s.current=null);const f=await d.current(r.current);if(f==="conflict"||f==="error")return;const g=o.getConfirmedBase();g.hash!==null&&g.content===r.current&&u.setQueryData(_(m,e.sourcePath),N=>N&&{...N,content:g.content,hash:g.hash}),h(!1),c(i,!1)},L=()=>{u.invalidateQueries({queryKey:_(m,e.sourcePath)})};n.useEffect(()=>{a||!s.current||(clearTimeout(s.current),s.current=null)},[a]),n.useEffect(()=>()=>{s.current&&(clearTimeout(s.current),d.current(r.current)),c(i,!1),j.current(!1)},[i,c]);const S=()=>{const f=o.adoptDisk();f!=null&&p(f)},F=()=>{o.overwrite(r.current)},w=J(o.status),E=a?v:l;return t.jsxs("div",{className:"relative flex h-full flex-col",children:[t.jsxs("div",{className:"sticky top-0 z-10 flex h-0 items-start justify-end gap-2 pr-2",children:[x&&w&&t.jsx("span",{className:q("mt-3 text-xs",o.status==="error"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",children:w}),!a&&t.jsx(y,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground mt-2",onClick:L,"aria-label":"Refresh from disk",children:t.jsx(H,{className:"size-4"})}),x&&t.jsx(y,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground mt-2",onClick:a?()=>void O():z,"aria-label":a?"Finish editing":"Edit file",children:a?t.jsx(K,{className:"size-4"}):t.jsx(V,{className:"size-4"})})]}),o.status==="conflict"&&t.jsxs("div",{className:"bg-destructive/10 text-destructive mx-2 mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md px-3 py-2 text-sm",children:[t.jsx("span",{className:"flex-1",children:"This file changed on disk since you opened it."}),t.jsx(y,{type:"button",variant:"ghost",size:"sm",className:"h-7",onClick:S,children:"Reload"}),t.jsx(y,{type:"button",variant:"destructive",size:"sm",className:"h-7",onClick:F,children:"Overwrite"})]}),t.jsx("div",{className:"min-h-0 flex-1",children:t.jsx(n.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading editor…"}),children:T?t.jsx("div",{className:"px-2 pb-6",children:t.jsx(U,{value:E,editable:a,onChange:a?k:void 0})}):t.jsx($,{value:E,editable:a,filename:e.sourcePath,languageHint:e.language,theme:C,onChange:a?k:void 0})})})]})}function R({children:e}){return t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:e})})}export{Z as CanvasFileContent};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-DtYzxmC5.js","assets/index-B4Z9VBPe.js","assets/index-D8mgsoST.css","assets/index-B_0gazbk.js","assets/index-3nUBnton.js","assets/BlintzCanvas-BqJDhl-U.js","assets/BlintzCanvas-GgiCXV7C.css"])))=>i.map(i=>d[i]);
2
+ import{af as A,ag as b,ah as D,ai as B,r as n,j as t,aj as M,ak as Q,al as q,B as y,am as H,an as K,ao as V,ap as P}from"./index-B4Z9VBPe.js";const $=n.lazy(()=>P(()=>import("./CodeMirrorEditor-DtYzxmC5.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeMirrorEditor}))),U=n.lazy(()=>P(()=>import("./BlintzCanvas-BqJDhl-U.js"),__vite__mapDeps([5,1,2,4,6])).then(e=>({default:e.BlintzCanvas}))),Y=500;function _(e,i){return["canvas-file",e,i]}function G(e,i){return i==="markdown"||/\.(md|markdown|mdx)$/i.test(e)}function I(e){switch(e==null?void 0:e.code){case"NOT_FOUND":return"This file doesn’t exist.";case"NOT_A_FILE":return"This path is a directory, not a file.";case"TOO_LARGE":return"This file is too large to open here.";case"BINARY_FILE":return"This file isn’t text and can’t be shown in the editor.";default:return"This file couldn’t be loaded."}}function J(e){switch(e){case"saving":return"Saving…";case"saved":return"Saved";case"error":return"Couldn’t save";default:return null}}function Z({content:e,documentId:i}){const m=A(),l=b(r=>r.selectedCwd),C=b(r=>r.setDocumentEditing),a=b(r=>{var d;return((d=r.openDocuments.find(j=>j.id===i))==null?void 0:d.editing)??!1}),h=D(),{data:c,error:x,isLoading:T}=B({queryKey:_(l,e.sourcePath),enabled:l!==null,queryFn:()=>m.readFileContent(l,e.sourcePath),staleTime:3e4,retry:!1}),[u,v]=n.useState(null),p=r=>{v(r&&c?{pinnedHash:c.hash}:null)};if(l===null)return t.jsx(R,{children:"Open a session to view files."});if(T)return t.jsx(R,{children:"Loading file…"});if(x||!c)return t.jsx(R,{children:I(x)});const o=u!==null&&a,s=(o?u==null?void 0:u.pinnedHash:null)??c.hash;return t.jsx(W,{content:e,documentId:i,cwd:l,loaded:c.content,theme:h,isEditing:o,onEditingChange:p,setDocumentEditing:C},`${e.sourcePath}:${s}`)}function W({content:e,documentId:i,cwd:m,loaded:l,theme:C,isEditing:a,onEditingChange:h,setDocumentEditing:c}){const x=e.readOnly!==!0,T=G(e.sourcePath,e.language),u=M(),[v,p]=n.useState(l),o=Q({sourcePath:e.sourcePath,cwd:m,loadedContent:l}),s=n.useRef(null),r=n.useRef(v),d=n.useRef(o.save),j=n.useRef(h);n.useEffect(()=>{r.current=v,d.current=o.save,j.current=h});const k=n.useCallback(f=>{p(f),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=null,d.current(r.current)},Y)},[]),z=()=>{p(l),h(!0),c(i,!0)},O=async()=>{s.current&&(clearTimeout(s.current),s.current=null);const f=await d.current(r.current);if(f==="conflict"||f==="error")return;const g=o.getConfirmedBase();g.hash!==null&&g.content===r.current&&u.setQueryData(_(m,e.sourcePath),N=>N&&{...N,content:g.content,hash:g.hash}),h(!1),c(i,!1)},L=()=>{u.invalidateQueries({queryKey:_(m,e.sourcePath)})};n.useEffect(()=>{a||!s.current||(clearTimeout(s.current),s.current=null)},[a]),n.useEffect(()=>()=>{s.current&&(clearTimeout(s.current),d.current(r.current)),c(i,!1),j.current(!1)},[i,c]);const S=()=>{const f=o.adoptDisk();f!=null&&p(f)},F=()=>{o.overwrite(r.current)},w=J(o.status),E=a?v:l;return t.jsxs("div",{className:"relative flex h-full flex-col",children:[t.jsxs("div",{className:"sticky top-0 z-10 flex h-0 items-start justify-end gap-2 pr-2",children:[x&&w&&t.jsx("span",{className:q("mt-3 text-xs",o.status==="error"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",children:w}),!a&&t.jsx(y,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground mt-2",onClick:L,"aria-label":"Refresh from disk",children:t.jsx(H,{className:"size-4"})}),x&&t.jsx(y,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground mt-2",onClick:a?()=>void O():z,"aria-label":a?"Finish editing":"Edit file",children:a?t.jsx(K,{className:"size-4"}):t.jsx(V,{className:"size-4"})})]}),o.status==="conflict"&&t.jsxs("div",{className:"bg-destructive/10 text-destructive mx-2 mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md px-3 py-2 text-sm",children:[t.jsx("span",{className:"flex-1",children:"This file changed on disk since you opened it."}),t.jsx(y,{type:"button",variant:"ghost",size:"sm",className:"h-7",onClick:S,children:"Reload"}),t.jsx(y,{type:"button",variant:"destructive",size:"sm",className:"h-7",onClick:F,children:"Overwrite"})]}),t.jsx("div",{className:"min-h-0 flex-1",children:t.jsx(n.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading editor…"}),children:T?t.jsx("div",{className:"px-2 pb-6",children:t.jsx(U,{value:E,editable:a,onChange:a?k:void 0})}):t.jsx($,{value:E,editable:a,filename:e.sourcePath,languageHint:e.language,theme:C,onChange:a?k:void 0})})})]})}function R({children:e}){return t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:e})})}export{Z as CanvasFileContent};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Model3dViewer-C_lFbWIi.js","assets/index-bYhLX3oQ.js","assets/index-B0qJNUoh.css"])))=>i.map(i=>d[i]);
2
- import{af as u,ag as d,r as l,aq as i,j as t,ap as f}from"./index-bYhLX3oQ.js";const c=l.lazy(()=>f(()=>import("./Model3dViewer-C_lFbWIi.js"),__vite__mapDeps([0,1,2])).then(r=>({default:r.Model3dViewer})));function m(r){var s;const e=(s=r.split(".").pop())==null?void 0:s.toLowerCase();return e==="glb"||e==="gltf"?"gltf":e==="stl"?"stl":e==="obj"?"obj":e==="3mf"?"3mf":e==="ply"?"ply":e==="fbx"?"fbx":e==="dae"?"dae":null}function x({content:r}){const e=u(),s=d(a=>a.selectedCwd),n=l.useMemo(()=>i(r.src,a=>e.mediaUrl(s??"",a)),[r.src,e,s]),o=l.useMemo(()=>m(r.src),[r.src]);return n.url===null||o===null?t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:"This 3D model can’t be displayed here."})}):t.jsx("div",{className:"bg-muted/40 h-full w-full",children:t.jsx(l.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading 3D viewer…"}),children:t.jsx(c,{url:n.url,format:o,label:r.title??"Canvas 3D model"})})})}export{x as CanvasModel3dContent,m as formatOf};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Model3dViewer-DgKQPqJb.js","assets/index-B4Z9VBPe.js","assets/index-D8mgsoST.css"])))=>i.map(i=>d[i]);
2
+ import{af as u,ag as d,r as l,aq as i,j as t,ap as f}from"./index-B4Z9VBPe.js";const c=l.lazy(()=>f(()=>import("./Model3dViewer-DgKQPqJb.js"),__vite__mapDeps([0,1,2])).then(r=>({default:r.Model3dViewer})));function m(r){var s;const e=(s=r.split(".").pop())==null?void 0:s.toLowerCase();return e==="glb"||e==="gltf"?"gltf":e==="stl"?"stl":e==="obj"?"obj":e==="3mf"?"3mf":e==="ply"?"ply":e==="fbx"?"fbx":e==="dae"?"dae":null}function x({content:r}){const e=u(),s=d(a=>a.selectedCwd),n=l.useMemo(()=>i(r.src,a=>e.mediaUrl(s??"",a)),[r.src,e,s]),o=l.useMemo(()=>m(r.src),[r.src]);return n.url===null||o===null?t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:"This 3D model can’t be displayed here."})}):t.jsx("div",{className:"bg-muted/40 h-full w-full",children:t.jsx(l.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading 3D viewer…"}),children:t.jsx(c,{url:n.url,format:o,label:r.title??"Canvas 3D model"})})})}export{x as CanvasModel3dContent,m as formatOf};
@@ -1,3 +1,3 @@
1
- import{j as J,r as T}from"./index-bYhLX3oQ.js";import{R as lt}from"./index-cNE108-h.js";import{o as Q,E as B,q as ne,C as Ge,S as G,r as Ne,u as Fe,v as st,w as H,x as M,V as ot,F as Ve,y as je,R as N,W as Y,G as oe,z as at,A as ft,B as Ie,H as dt,m as ht,n as ct}from"./index-Bj32H2Xz.js";class v{constructor(e,n,l,i){this.fromA=e,this.toA=n,this.fromB=l,this.toB=i}offset(e,n=e){return new v(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function y(t,e,n,l,i,r){if(t==l)return[];let s=fe(t,e,n,l,i,r),o=de(t,e+s,n,l,i+s,r);e+=s,n-=o,i+=s,r-=o;let f=n-e,h=r-i;if(!f||!h)return[new v(e,n,i,r)];if(f>h){let d=t.slice(e,n).indexOf(l.slice(i,r));if(d>-1)return[new v(e,e+d,i,i),new v(e+d+h,n,r,r)]}else if(h>f){let d=l.slice(i,r).indexOf(t.slice(e,n));if(d>-1)return[new v(e,e,i,i+d),new v(n,n,i+d+f,r)]}if(f==1||h==1)return[new v(e,n,i,r)];let a=He(t,e,n,l,i,r);if(a){let[d,c,u]=a;return y(t,e,d,l,i,c).concat(y(t,d+u,n,l,c+u,r))}return ut(t,e,n,l,i,r)}let I=1e9,U=0,ae=!1;function ut(t,e,n,l,i,r){let s=n-e,o=r-i;if(I<1e9&&Math.min(s,o)>I*16||U>0&&Date.now()>U)return Math.min(s,o)>I*64?[new v(e,n,i,r)]:ge(t,e,n,l,i,r);let f=Math.ceil((s+o)/2);ee.reset(f),te.reset(f);let h=(u,m)=>t.charCodeAt(e+u)==l.charCodeAt(i+m),a=(u,m)=>t.charCodeAt(n-u-1)==l.charCodeAt(r-m-1),d=(s-o)%2!=0?te:null,c=d?null:ee;for(let u=0;u<f;u++){if(u>I||U>0&&!(u&63)&&Date.now()>U)return ge(t,e,n,l,i,r);let m=ee.advance(u,s,o,f,d,!1,h)||te.advance(u,s,o,f,c,!0,a);if(m)return mt(t,e,n,e+m[0],l,i,r,i+m[1])}return[new v(e,n,i,r)]}class Ue{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,n,l,i,r,s,o){for(let f=-e+this.start;f<=e-this.end;f+=2){let h=i+f,a=f==-e||f!=e&&this.vec[h-1]<this.vec[h+1]?this.vec[h+1]:this.vec[h-1]+1,d=a-f;for(;a<n&&d<l&&o(a,d);)a++,d++;if(this.vec[h]=a,a>n)this.end+=2;else if(d>l)this.start+=2;else if(r){let c=i+(n-l)-f;if(c>=0&&c<this.len&&r.vec[c]!=-1)if(s){let u=r.vec[c];if(u>=n-a)return[u,i+u-c]}else{let u=n-r.vec[c];if(a>=u)return[a,d]}}}return null}}const ee=new Ue,te=new Ue;function mt(t,e,n,l,i,r,s,o){let f=!1;return!F(t,l)&&++l==n&&(f=!0),!F(i,o)&&++o==s&&(f=!0),f?[new v(e,n,r,s)]:y(t,e,l,i,r,o).concat(y(t,l,n,i,o,s))}function We(t,e){let n=1,l=Math.min(t,e);for(;n<l;)n=n<<1;return n}function fe(t,e,n,l,i,r){if(e==n||e==r||t.charCodeAt(e)!=l.charCodeAt(i))return 0;let s=We(n-e,r-i);for(let o=e,f=i;;){let h=o+s,a=f+s;if(h>n||a>r||t.slice(o,h)!=l.slice(f,a)){if(s==1)return o-e-(F(t,o)?0:1);s=s>>1}else{if(h==n||a==r)return h-e;o=h,f=a}}}function de(t,e,n,l,i,r){if(e==n||i==r||t.charCodeAt(n-1)!=l.charCodeAt(r-1))return 0;let s=We(n-e,r-i);for(let o=n,f=r;;){let h=o-s,a=f-s;if(h<e||a<i||t.slice(h,o)!=l.slice(a,f)){if(s==1)return n-o-(F(t,o)?0:1);s=s>>1}else{if(h==e||a==i)return n-h;o=h,f=a}}}function re(t,e,n,l,i,r,s,o){let f=l.slice(i,r),h=null;for(;;){if(h||s<o)return h;for(let a=e+s;;){F(t,a)||a++;let d=a+s;if(F(t,d)||(d+=d==a+1?1:-1),d>=n)break;let c=t.slice(a,d),u=-1;for(;(u=f.indexOf(c,u+1))!=-1;){let m=fe(t,d,n,l,i+u+c.length,r),p=de(t,e,a,l,i,i+u),g=c.length+m+p;(!h||h[2]<g)&&(h=[a-p,i+u-p,g])}a=d}if(o<0)return h;s=s>>1}}function He(t,e,n,l,i,r){let s=n-e,o=r-i;if(s<o){let f=He(l,i,r,t,e,n);return f&&[f[1],f[0],f[2]]}return s<4||o*2<s?null:re(t,e,n,l,i,r,Math.floor(s/4),-1)}function ge(t,e,n,l,i,r){ae=!0;let s=n-e,o=r-i,f;if(s<o){let c=re(l,i,r,t,e,n,Math.floor(s/6),50);f=c&&[c[1],c[0],c[2]]}else f=re(t,e,n,l,i,r,Math.floor(o/6),50);if(!f)return[new v(e,n,i,r)];let[h,a,d]=f;return y(t,e,h,l,i,a).concat(y(t,h+d,n,l,a+d,r))}function ze(t,e){for(let n=1;n<t.length;n++){let l=t[n-1],i=t[n];l.toA>i.fromA-e&&l.toB>i.fromB-e&&(t[n-1]=new v(l.fromA,i.toA,l.fromB,i.toB),t.splice(n--,1))}}function gt(t,e,n){for(;;){ze(n,1);let l=!1;for(let i=0;i<n.length;i++){let r=n[i],s,o;(s=fe(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA+s,r.toA,r.fromB+s,r.toB)),(o=de(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA,r.toA-o,r.fromB,r.toB-o));let f=r.toA-r.fromA,h=r.toB-r.fromB;if(f&&h)continue;let a=r.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:t.length)-r.toA;if(!a||!d)continue;let c=f?t.slice(r.fromA,r.toA):e.slice(r.fromB,r.toB);a<=c.length&&t.slice(r.fromA-a,r.fromA)==c.slice(c.length-a)?(n[i]=new v(r.fromA-a,r.toA-a,r.fromB-a,r.toB-a),l=!0):d<=c.length&&t.slice(r.toA,r.toA+d)==c.slice(0,d)&&(n[i]=new v(r.fromA+d,r.toA+d,r.fromB+d,r.toB+d),l=!0)}if(!l)break}return n}function pt(t,e,n){for(let l=0,i=0;i<t.length;i++){let r=t[i],s=r.toA-r.fromA,o=r.toB-r.fromB;if(s&&o||s>3||o>3){let f=i==t.length-1?e.length:t[i+1].fromA,h=r.fromA-l,a=f-r.toA,d=Ce(e,r.fromA,h),c=pe(e,r.toA,a),u=r.fromA-d,m=c-r.toA;if((!s||!o)&&u&&m){let p=Math.max(s,o),[g,C,S]=s?[e,r.fromA,r.toA]:[n,r.fromB,r.toB];p>u&&e.slice(d,r.fromA)==g.slice(S-u,S)?(r=t[i]=new v(d,d+s,r.fromB-u,r.toB-u),d=r.fromA,c=pe(e,r.toA,f-r.toA)):p>m&&e.slice(r.toA,c)==g.slice(C,C+m)&&(r=t[i]=new v(c-s,c,r.fromB+m,r.toB+m),c=r.toA,d=Ce(e,r.fromA,r.fromA-l)),u=r.fromA-d,m=c-r.toA}if(u||m)r=t[i]=new v(r.fromA-u,r.toA+m,r.fromB-u,r.toB+m);else if(s){if(!o){let p=Ae(e,r.fromA,r.toA),g,C=p<0?-1:ve(e,r.toA,r.fromA);p>-1&&(g=p-r.fromA)<=a&&e.slice(r.fromA,p)==e.slice(r.toA,r.toA+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toA-C)<=h&&e.slice(r.fromA-g,r.fromA)==e.slice(C,r.toA)&&(r=t[i]=r.offset(-g))}}else{let p=Ae(n,r.fromB,r.toB),g,C=p<0?-1:ve(n,r.toB,r.fromB);p>-1&&(g=p-r.fromB)<=a&&n.slice(r.fromB,p)==n.slice(r.toB,r.toB+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toB-C)<=h&&n.slice(r.fromB-g,r.fromB)==n.slice(C,r.toB)&&(r=t[i]=r.offset(-g))}}l=r.toA}return ze(t,3),t}let E;try{E=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Pe(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function qe(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?Pe(n)?1:0:E?!Je(n)||e==t.length-1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e,e+2))?2:0:0}function _e(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?Pe(n)?1:0:E?!Ke(n)||e==1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e-2,e))?2:0:0}const $e=8;function pe(t,e,n){if(e==t.length||!_e(t,e))return e;for(let l=e,i=e+n,r=0;r<$e;r++){let s=qe(t,l);if(!s||l+s>i)return l;l+=s}return e}function Ce(t,e,n){if(!e||!qe(t,e))return e;for(let l=e,i=e-n,r=0;r<$e;r++){let s=_e(t,l);if(!s||l-s<i)return l;l-=s}return e}function ve(t,e,n){for(;e!=n;e--)if(t.charCodeAt(e-1)==10)return e;return-1}function Ae(t,e,n){for(;e!=n;e++)if(t.charCodeAt(e)==10)return e;return-1}const Je=t=>t>=55296&&t<=56319,Ke=t=>t>=56320&&t<=57343;function F(t,e){return!e||e==t.length||!Je(t.charCodeAt(e-1))||!Ke(t.charCodeAt(e))}function Ct(t,e,n){var l;let i=n==null?void 0:n.override;return i?i(t,e):(I=((l=n==null?void 0:n.scanLimit)!==null&&l!==void 0?l:1e9)>>1,U=n!=null&&n.timeout?Date.now()+n.timeout:0,ae=!1,gt(t,e,y(t,0,t.length,e,0,e.length)))}function Qe(){return!ae}function Ye(t,e,n){return pt(Ct(t,e,n),t,e)}const b=Ve.define({combine:t=>t[0]}),ie=G.define(),Ze=Ve.define(),k=H.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(ie)&&(t=n.value);for(let n of e.state.facet(Ze))t=n(t,e);return t}});function vt(t){let e=t.field(k,!1);if(!e)return null;let n=t.facet(b);return{chunks:e,side:n?n.side:null}}class O{constructor(e,n,l,i,r,s=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=i,this.toB=r,this.precise=s}offset(e,n){return e||n?new O(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,l){let i=Ye(e.toString(),n.toString(),l);return Xe(i,e,n,0,0,Qe())}static updateA(e,n,l,i,r){return be(Be(e,i,!0,l.length),e,n,l,r)}static updateB(e,n,l,i,r){return be(Be(e,i,!1,n.length),e,n,l,r)}}function xe(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.to==t&&r.to==e&&t<n.length&&e<l.length?[t+1,e+1]:[i.from,r.from]}function we(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.from==t&&r.from==e?[t,e]:[i.to+1,r.to+1]}function Xe(t,e,n,l,i,r){let s=[];for(let o=0;o<t.length;o++){let f=t[o],[h,a]=xe(f.fromA+l,f.fromB+i,e,n),[d,c]=we(f.toA+l,f.toB+i,e,n),u=[f.offset(-h+l,-a+i)];for(;o<t.length-1;){let m=t[o+1],[p,g]=xe(m.fromA+l,m.fromB+i,e,n);if(p>d+1&&g>c+1)break;u.push(m.offset(-h+l,-a+i)),[d,c]=we(m.toA+l,m.toB+i,e,n),o++}s.push(new O(u,h,Math.max(h,d),a,Math.max(a,c),r))}return s}const z=1e3;function ke(t,e,n,l){let i=0,r=t.length;for(;;){if(i==r){let a=0,d=0;i&&({toA:a,toB:d}=t[i-1]);let c=e-(n?a:d);return[a+c,d+c]}let s=i+r>>1,o=t[s],[f,h]=n?[o.fromA,o.toA]:[o.fromB,o.toB];if(f>e)r=s;else if(h<=e)i=s+1;else return l?[o.fromA,o.fromB]:[o.toA,o.toB]}}function Be(t,e,n,l){let i=[];return e.iterChangedRanges((r,s,o,f)=>{let h=0,a=n?e.length:l,d=0,c=n?l:e.length;r>z&&([h,d]=ke(t,r-z,n,!0)),s<e.length-z&&([a,c]=ke(t,s+z,n,!1));let u=f-o-(s-r),m,[p,g]=n?[u,0]:[0,u];i.length&&(m=i[i.length-1]).toA>=h?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:a,toB:c,diffA:m.diffA+p,diffB:m.diffB+g}:i.push({fromA:h,toA:a,fromB:d,toB:c,diffA:p,diffB:g})}),i}function be(t,e,n,l,i){if(!t.length)return e;let r=[];for(let s=0,o=0,f=0,h=0;;s++){let a=s==t.length?null:t[s],d=a?a.fromA+o:n.length,c=a?a.fromB+f:l.length;for(;h<e.length;){let g=e[h];if(a&&(g.toA+o>d||g.toB+f>c))break;r.push(g.offset(o,f)),h++}if(!a)break;let u=a.toA+o+a.diffA,m=a.toB+f+a.diffB,p=Ye(n.sliceString(d,u),l.sliceString(c,m),i);for(let g of Xe(p,n,l,d,c,Qe()))r.push(g);for(o+=a.diffA,f+=a.diffB;h<e.length;){let g=e[h];if(g.fromA+o>u&&g.fromB+f>m)break;h++}}return r}const et={scanLimit:500},Z=ot.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Le(t))}update(t){(t.docChanged||t.viewportChanged||At(t.startState,t.state)||xt(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Le(t.view))}},{decorations:t=>t.deco}),P=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty}}));function At(t,e){return t.field(k,!1)!=e.field(k,!1)}function xt(t,e){return t.facet(b)!=e.facet(b)}const Me=M.line({class:"cm-changedLine"}),tt=M.mark({class:"cm-changedText"}),wt=M.mark({tagName:"ins",class:"cm-insertedLine"}),kt=M.mark({tagName:"del",class:"cm-deletedLine"}),De=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function Bt(t,e,n,l,i,r){let s=n?t.fromA:t.fromB,o=n?t.toA:t.toB,f=0;if(s!=o){i.add(s,s,Me),i.add(s,o,n?kt:wt),r&&r.add(s,s,De);for(let h=e.iterRange(s,o-1),a=s;!h.next().done;){if(h.lineBreak){a++,i.add(a,a,Me),r&&r.add(a,a,De);continue}let d=a+h.value.length;if(l)for(;f<t.changes.length;){let c=t.changes[f],u=s+(n?c.fromA:c.fromB),m=s+(n?c.toA:c.toB),p=Math.max(a,u),g=Math.min(d,m);if(p<g&&i.add(p,g,tt),m<d)f++;else break}a=d}}}function Le(t){let e=t.state.field(k),{side:n,highlightChanges:l,markGutter:i,overrideChunk:r}=t.state.facet(b),s=n=="a",o=new N,f=i?new N:null,{from:h,to:a}=t.viewport;for(let d of e){if((s?d.fromA:d.fromB)>=a)break;(s?d.toA:d.toB)>h&&(!r||!r(t.state,d,o,f))&&Bt(d,t.state.doc,s,l,o,f)}return{deco:o.finish(),gutter:f&&f.finish()}}class q extends Y{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const K=G.define({map:(t,e)=>t.map(e)}),W=H.define({create:()=>M.none,update:(t,e)=>{for(let n of e.effects)if(n.is(K))return n.value;return t.map(e.changes)},provide:t=>B.decorations.from(t)}),_=.01;function Se(t,e){if(t.size!=e.size)return!1;let n=t.iter(),l=e.iter();for(;n.value;){if(n.from!=l.from||Math.abs(n.value.spec.widget.height-l.value.spec.widget.height)>1)return!1;n.next(),l.next()}return!0}function bt(t,e,n){let l=new N,i=new N,r=t.state.field(W).iter(),s=e.state.field(W).iter(),o=0,f=0,h=0,a=0,d=t.viewport,c=e.viewport;for(let g=0;;g++){let C=g<n.length?n[g]:null,S=C?C.fromA:t.state.doc.length,R=C?C.fromB:e.state.doc.length;if(o<S){let x=t.lineBlockAt(o).top+h,D=e.lineBlockAt(f).top+a,w=x-D;w<-_?(h-=w,l.add(o,o,M.widget({widget:new q(-w),block:!0,side:-1}))):w>_&&(a+=w,i.add(f,f,M.widget({widget:new q(w),block:!0,side:-1})))}if(S>o+1e3&&o<d.from&&S>d.from&&f<c.from&&R>c.from){let x=Math.min(d.from-o,c.from-f);o+=x,f+=x,g--}else if(C)o=C.toA,f=C.toB;else break;for(;r.value&&r.from<o;)h-=r.value.spec.widget.height,r.next();for(;s.value&&s.from<f;)a-=s.value.spec.widget.height,s.next()}for(;r.value;)h-=r.value.spec.widget.height,r.next();for(;s.value;)a-=s.value.spec.widget.height,s.next();let u=t.contentHeight+h-(e.contentHeight+a);u<_?l.add(t.state.doc.length,t.state.doc.length,M.widget({widget:new q(-u),block:!0,side:1})):u>_&&i.add(e.state.doc.length,e.state.doc.length,M.widget({widget:new q(u),block:!0,side:1}));let m=l.finish(),p=i.finish();Se(m,t.state.field(W))||t.dispatch({effects:K.of(m)}),Se(p,e.state.field(W))||e.dispatch({effects:K.of(p)})}const le=G.define({map:(t,e)=>e.mapPos(t)});class Mt extends Y{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let i=e.posAtDOM(l.target);e.dispatch({effects:le.of(i)});let{side:r,sibling:s}=e.state.facet(b);s&&s().dispatch({effects:le.of(Dt(i,e.state.field(k),r=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function Dt(t,e,n){let l=0,i=0;for(let r=0;;r++){let s=r<e.length?e[r]:null;if(!s||(n?s.fromA:s.fromB)>=t)return i+(t-l);[l,i]=n?[s.toA,s.toB]:[s.toB,s.toA]}}const Lt=H.define({create(t){return M.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(le)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(k)!=e.startState.field(k,!1)){let n=e.state.facet(b).side=="a",l=[];for(let i of e.state.field(k))t.between(n?i.fromA:i.fromB,n?i.toA:i.toB,r=>{l.push(r)});l.length&&(t=t.update({filter:i=>l.indexOf(i)<0}))}return t},provide:t=>B.decorations.from(t)});function se({margin:t=3,minSize:e=4}){return Lt.init(n=>St(n,t,e))}function St(t,e,n){let l=new N,i=t.facet(b).side=="a",r=t.field(k),s=1;for(let o=0;;o++){let f=o<r.length?r[o]:null,h=o?s+e:1,a=f?t.doc.lineAt(i?f.fromA:f.fromB).number-1-e:t.doc.lines,d=a-h+1;if(d>=n&&l.add(t.doc.line(h).from,t.doc.line(a).to,M.replace({widget:new Mt(d),block:!0})),!f)break;s=t.doc.lineAt(Math.min(t.doc.length,i?f.toA:f.toB)).number}return l.finish()}const Ot=B.styleModule.of(new st({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),nt=B.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),Oe=new Ge,$=new Ge;class Et{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||et;let n=[Q.low(Z),nt,Ot,W,B.updateListener.of(d=>{this.measuring<0&&(d.heightChanged||d.viewportChanged)&&!d.transactions.some(c=>c.effects.some(u=>u.is(K)))&&this.measure()})],l=[b.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&l.push(P);let i=ne.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],B.editorAttributes.of({class:"cm-merge-a"}),$.of(l),n]}),r=[b.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&r.push(P);let s=ne.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],B.editorAttributes.of({class:"cm-merge-b"}),$.of(r),n]});this.chunks=O.build(i.doc,s.doc,this.diffConf);let o=[k.init(()=>this.chunks),Oe.of(e.collapseUnchanged?se(e.collapseUnchanged):[])];i=i.update({effects:G.appendConfig.of(o)}).state,s=s.update({effects:G.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let f=e.orientation||"a-b",h=document.createElement("div");h.className="cm-mergeViewEditor";let a=document.createElement("div");a.className="cm-mergeViewEditor",this.editorDOM.appendChild(f=="a-b"?h:a),this.editorDOM.appendChild(f=="a-b"?a:h),this.a=new B({state:i,parent:h,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.a)}),this.b=new B({state:s,parent:a,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,n){if(e.some(l=>l.docChanged)){let l=e[e.length-1],i=e.reduce((s,o)=>s.compose(o.changes),Ne.empty(e[0].startState.doc.length));this.chunks=n==this.a?O.updateA(this.chunks,l.newDoc,this.b.state.doc,i,this.diffConf):O.updateB(this.chunks,this.a.state.doc,l.newDoc,i,this.diffConf),n.update([...e,l.state.update({effects:ie.of(this.chunks)})]);let r=n==this.a?this.b:this.a;r.update([r.state.update({effects:ie.of(this.chunks)})]),this.scheduleMeasure()}else n.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let r=e.orientation!="b-a";if(r!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,o=this.b.dom.parentNode;s.remove(),o.remove(),this.editorDOM.insertBefore(r?s:o,this.editorDOM.firstChild),this.editorDOM.appendChild(r?o:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let r=!!this.revertDOM,s=this.revertToA,o=this.renderRevert;"revertControls"in e&&(r=!!e.revertControls,s=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(r,s,o)}let n="highlightChanges"in e,l="gutter"in e,i="collapseUnchanged"in e;if(n||l||i){let r=[],s=[];if(n||l){let o=this.a.state.facet(b),f=l?e.gutter!==!1:o.markGutter,h=n?e.highlightChanges!==!1:o.highlightChanges;r.push($.reconfigure([b.of({side:"a",sibling:()=>this.b,highlightChanges:h,markGutter:f}),f?P:[]])),s.push($.reconfigure([b.of({side:"b",sibling:()=>this.a,highlightChanges:h,markGutter:f}),f?P:[]]))}if(i){let o=Oe.reconfigure(e.collapseUnchanged?se(e.collapseUnchanged):[]);r.push(o),s.push(o)}this.a.dispatch({effects:r}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(e,n,l){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=l,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",i=>this.revertClicked(i)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){bt(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,n=e.firstChild,l=this.a.viewport,i=this.b.viewport;for(let r=0;r<this.chunks.length;r++){let s=this.chunks[r];if(s.fromA>l.to||s.fromB>i.to)break;if(s.fromA<l.from||s.fromB<i.from)continue;let o=this.a.lineBlockAt(s.fromA).top+"px";for(;n&&+n.dataset.chunk<r;)n=Ee(n);n&&n.dataset.chunk==String(r)?(n.style.top!=o&&(n.style.top=o),n=n.nextSibling):e.insertBefore(this.renderRevertButton(o,r),n)}for(;n;)n=Ee(n)}renderRevertButton(e,n){let l;if(this.renderRevert)l=this.renderRevert();else{l=document.createElement("button");let i=this.a.state.phrase("Revert this chunk");l.setAttribute("aria-label",i),l.setAttribute("title",i),l.textContent=this.revertToLeft?"⇜":"⇝"}return l.style.top=e,l.setAttribute("data-chunk",String(n)),l}revertClicked(e){let n=e.target,l;for(;n&&n.parentNode!=this.revertDOM;)n=n.parentNode;if(n&&(l=this.chunks[n.dataset.chunk])){let[i,r,s,o,f,h]=this.revertToA?[this.b,this.a,l.fromB,l.toB,l.fromA,l.toA]:[this.a,this.b,l.fromA,l.toA,l.fromB,l.toB],a=i.state.sliceDoc(s,Math.max(s,o-1));s!=o&&h<=r.state.doc.length&&(a+=i.state.lineBreak),r.dispatch({changes:{from:f,to:Math.min(r.state.doc.length,h),insert:a},userEvent:"revert"}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function Ee(t){let e=t.nextSibling;return t.remove(),e}const yt=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Rt=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty},widgetMarker:(t,e)=>e instanceof rt?yt:null}));function Tt(t){var e;let n=typeof t.original=="string"?Fe.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||et;return[Q.low(Z),Vt,nt,B.editorAttributes.of({class:"cm-merge-b"}),Ze.of((i,r)=>{let s=r.effects.find(o=>o.is(he));return s&&(i=O.updateA(i,s.value.doc,r.startState.doc,s.value.changes,l)),r.docChanged&&(i=O.updateB(i,r.state.field(V),r.newDoc,r.changes,l)),i}),b.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:t.allowInlineDiffs?Wt:void 0,side:"b"}),V.init(()=>n),t.gutter!==!1?Rt:[],t.collapseUnchanged?se(t.collapseUnchanged):[],k.init(i=>O.build(n,i.doc,l))]}const he=G.define(),V=H.define({create:()=>Fe.empty,update(t,e){for(let n of e.effects)n.is(he)&&(t=n.value.doc);return t}}),ye=new WeakMap;class rt extends Y{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function Gt(t,e,n){let l=ye.get(e.changes);if(l)return l;let i=s=>{let{highlightChanges:o,syntaxHighlightDeletions:f,syntaxHighlightDeletionsMaxLength:h,mergeControls:a}=t.facet(b),d=document.createElement("div");if(d.className="cm-deletedChunk",a){let x=d.appendChild(document.createElement("div"));x.className="cm-chunkButtons";let D=A=>{A.preventDefault(),Nt(s,s.posAtDOM(d))},w=A=>{A.preventDefault(),Ft(s,s.posAtDOM(d))};if(typeof a=="function")x.appendChild(a("accept",D)),x.appendChild(a("reject",w));else{let A=x.appendChild(document.createElement("button"));A.name="accept",A.textContent=t.phrase("Accept"),A.onmousedown=D;let L=x.appendChild(document.createElement("button"));L.name="reject",L.textContent=t.phrase("Reject"),L.onmousedown=w}}if(n||e.fromA>=e.toA)return d;let c=s.state.field(V).sliceString(e.fromA,e.endA),u=f&&t.facet(at),m=S(),p=e.changes,g=0,C=!1;function S(){let x=d.appendChild(document.createElement("div"));return x.className="cm-deletedLine",x.appendChild(document.createElement("del"))}function R(x,D,w){for(let A=x;A<D;){if(c.charAt(A)==`
1
+ import{j as J,r as T}from"./index-B4Z9VBPe.js";import{R as lt}from"./index-B_0gazbk.js";import{o as Q,E as B,q as ne,C as Ge,S as G,r as Ne,u as Fe,v as st,w as H,x as M,V as ot,F as Ve,y as je,R as N,W as Y,G as oe,z as at,A as ft,B as Ie,H as dt,m as ht,n as ct}from"./index-3nUBnton.js";class v{constructor(e,n,l,i){this.fromA=e,this.toA=n,this.fromB=l,this.toB=i}offset(e,n=e){return new v(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function y(t,e,n,l,i,r){if(t==l)return[];let s=fe(t,e,n,l,i,r),o=de(t,e+s,n,l,i+s,r);e+=s,n-=o,i+=s,r-=o;let f=n-e,h=r-i;if(!f||!h)return[new v(e,n,i,r)];if(f>h){let d=t.slice(e,n).indexOf(l.slice(i,r));if(d>-1)return[new v(e,e+d,i,i),new v(e+d+h,n,r,r)]}else if(h>f){let d=l.slice(i,r).indexOf(t.slice(e,n));if(d>-1)return[new v(e,e,i,i+d),new v(n,n,i+d+f,r)]}if(f==1||h==1)return[new v(e,n,i,r)];let a=He(t,e,n,l,i,r);if(a){let[d,c,u]=a;return y(t,e,d,l,i,c).concat(y(t,d+u,n,l,c+u,r))}return ut(t,e,n,l,i,r)}let I=1e9,U=0,ae=!1;function ut(t,e,n,l,i,r){let s=n-e,o=r-i;if(I<1e9&&Math.min(s,o)>I*16||U>0&&Date.now()>U)return Math.min(s,o)>I*64?[new v(e,n,i,r)]:ge(t,e,n,l,i,r);let f=Math.ceil((s+o)/2);ee.reset(f),te.reset(f);let h=(u,m)=>t.charCodeAt(e+u)==l.charCodeAt(i+m),a=(u,m)=>t.charCodeAt(n-u-1)==l.charCodeAt(r-m-1),d=(s-o)%2!=0?te:null,c=d?null:ee;for(let u=0;u<f;u++){if(u>I||U>0&&!(u&63)&&Date.now()>U)return ge(t,e,n,l,i,r);let m=ee.advance(u,s,o,f,d,!1,h)||te.advance(u,s,o,f,c,!0,a);if(m)return mt(t,e,n,e+m[0],l,i,r,i+m[1])}return[new v(e,n,i,r)]}class Ue{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,n,l,i,r,s,o){for(let f=-e+this.start;f<=e-this.end;f+=2){let h=i+f,a=f==-e||f!=e&&this.vec[h-1]<this.vec[h+1]?this.vec[h+1]:this.vec[h-1]+1,d=a-f;for(;a<n&&d<l&&o(a,d);)a++,d++;if(this.vec[h]=a,a>n)this.end+=2;else if(d>l)this.start+=2;else if(r){let c=i+(n-l)-f;if(c>=0&&c<this.len&&r.vec[c]!=-1)if(s){let u=r.vec[c];if(u>=n-a)return[u,i+u-c]}else{let u=n-r.vec[c];if(a>=u)return[a,d]}}}return null}}const ee=new Ue,te=new Ue;function mt(t,e,n,l,i,r,s,o){let f=!1;return!F(t,l)&&++l==n&&(f=!0),!F(i,o)&&++o==s&&(f=!0),f?[new v(e,n,r,s)]:y(t,e,l,i,r,o).concat(y(t,l,n,i,o,s))}function We(t,e){let n=1,l=Math.min(t,e);for(;n<l;)n=n<<1;return n}function fe(t,e,n,l,i,r){if(e==n||e==r||t.charCodeAt(e)!=l.charCodeAt(i))return 0;let s=We(n-e,r-i);for(let o=e,f=i;;){let h=o+s,a=f+s;if(h>n||a>r||t.slice(o,h)!=l.slice(f,a)){if(s==1)return o-e-(F(t,o)?0:1);s=s>>1}else{if(h==n||a==r)return h-e;o=h,f=a}}}function de(t,e,n,l,i,r){if(e==n||i==r||t.charCodeAt(n-1)!=l.charCodeAt(r-1))return 0;let s=We(n-e,r-i);for(let o=n,f=r;;){let h=o-s,a=f-s;if(h<e||a<i||t.slice(h,o)!=l.slice(a,f)){if(s==1)return n-o-(F(t,o)?0:1);s=s>>1}else{if(h==e||a==i)return n-h;o=h,f=a}}}function re(t,e,n,l,i,r,s,o){let f=l.slice(i,r),h=null;for(;;){if(h||s<o)return h;for(let a=e+s;;){F(t,a)||a++;let d=a+s;if(F(t,d)||(d+=d==a+1?1:-1),d>=n)break;let c=t.slice(a,d),u=-1;for(;(u=f.indexOf(c,u+1))!=-1;){let m=fe(t,d,n,l,i+u+c.length,r),p=de(t,e,a,l,i,i+u),g=c.length+m+p;(!h||h[2]<g)&&(h=[a-p,i+u-p,g])}a=d}if(o<0)return h;s=s>>1}}function He(t,e,n,l,i,r){let s=n-e,o=r-i;if(s<o){let f=He(l,i,r,t,e,n);return f&&[f[1],f[0],f[2]]}return s<4||o*2<s?null:re(t,e,n,l,i,r,Math.floor(s/4),-1)}function ge(t,e,n,l,i,r){ae=!0;let s=n-e,o=r-i,f;if(s<o){let c=re(l,i,r,t,e,n,Math.floor(s/6),50);f=c&&[c[1],c[0],c[2]]}else f=re(t,e,n,l,i,r,Math.floor(o/6),50);if(!f)return[new v(e,n,i,r)];let[h,a,d]=f;return y(t,e,h,l,i,a).concat(y(t,h+d,n,l,a+d,r))}function ze(t,e){for(let n=1;n<t.length;n++){let l=t[n-1],i=t[n];l.toA>i.fromA-e&&l.toB>i.fromB-e&&(t[n-1]=new v(l.fromA,i.toA,l.fromB,i.toB),t.splice(n--,1))}}function gt(t,e,n){for(;;){ze(n,1);let l=!1;for(let i=0;i<n.length;i++){let r=n[i],s,o;(s=fe(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA+s,r.toA,r.fromB+s,r.toB)),(o=de(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA,r.toA-o,r.fromB,r.toB-o));let f=r.toA-r.fromA,h=r.toB-r.fromB;if(f&&h)continue;let a=r.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:t.length)-r.toA;if(!a||!d)continue;let c=f?t.slice(r.fromA,r.toA):e.slice(r.fromB,r.toB);a<=c.length&&t.slice(r.fromA-a,r.fromA)==c.slice(c.length-a)?(n[i]=new v(r.fromA-a,r.toA-a,r.fromB-a,r.toB-a),l=!0):d<=c.length&&t.slice(r.toA,r.toA+d)==c.slice(0,d)&&(n[i]=new v(r.fromA+d,r.toA+d,r.fromB+d,r.toB+d),l=!0)}if(!l)break}return n}function pt(t,e,n){for(let l=0,i=0;i<t.length;i++){let r=t[i],s=r.toA-r.fromA,o=r.toB-r.fromB;if(s&&o||s>3||o>3){let f=i==t.length-1?e.length:t[i+1].fromA,h=r.fromA-l,a=f-r.toA,d=Ce(e,r.fromA,h),c=pe(e,r.toA,a),u=r.fromA-d,m=c-r.toA;if((!s||!o)&&u&&m){let p=Math.max(s,o),[g,C,S]=s?[e,r.fromA,r.toA]:[n,r.fromB,r.toB];p>u&&e.slice(d,r.fromA)==g.slice(S-u,S)?(r=t[i]=new v(d,d+s,r.fromB-u,r.toB-u),d=r.fromA,c=pe(e,r.toA,f-r.toA)):p>m&&e.slice(r.toA,c)==g.slice(C,C+m)&&(r=t[i]=new v(c-s,c,r.fromB+m,r.toB+m),c=r.toA,d=Ce(e,r.fromA,r.fromA-l)),u=r.fromA-d,m=c-r.toA}if(u||m)r=t[i]=new v(r.fromA-u,r.toA+m,r.fromB-u,r.toB+m);else if(s){if(!o){let p=Ae(e,r.fromA,r.toA),g,C=p<0?-1:ve(e,r.toA,r.fromA);p>-1&&(g=p-r.fromA)<=a&&e.slice(r.fromA,p)==e.slice(r.toA,r.toA+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toA-C)<=h&&e.slice(r.fromA-g,r.fromA)==e.slice(C,r.toA)&&(r=t[i]=r.offset(-g))}}else{let p=Ae(n,r.fromB,r.toB),g,C=p<0?-1:ve(n,r.toB,r.fromB);p>-1&&(g=p-r.fromB)<=a&&n.slice(r.fromB,p)==n.slice(r.toB,r.toB+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toB-C)<=h&&n.slice(r.fromB-g,r.fromB)==n.slice(C,r.toB)&&(r=t[i]=r.offset(-g))}}l=r.toA}return ze(t,3),t}let E;try{E=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Pe(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function qe(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?Pe(n)?1:0:E?!Je(n)||e==t.length-1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e,e+2))?2:0:0}function _e(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?Pe(n)?1:0:E?!Ke(n)||e==1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e-2,e))?2:0:0}const $e=8;function pe(t,e,n){if(e==t.length||!_e(t,e))return e;for(let l=e,i=e+n,r=0;r<$e;r++){let s=qe(t,l);if(!s||l+s>i)return l;l+=s}return e}function Ce(t,e,n){if(!e||!qe(t,e))return e;for(let l=e,i=e-n,r=0;r<$e;r++){let s=_e(t,l);if(!s||l-s<i)return l;l-=s}return e}function ve(t,e,n){for(;e!=n;e--)if(t.charCodeAt(e-1)==10)return e;return-1}function Ae(t,e,n){for(;e!=n;e++)if(t.charCodeAt(e)==10)return e;return-1}const Je=t=>t>=55296&&t<=56319,Ke=t=>t>=56320&&t<=57343;function F(t,e){return!e||e==t.length||!Je(t.charCodeAt(e-1))||!Ke(t.charCodeAt(e))}function Ct(t,e,n){var l;let i=n==null?void 0:n.override;return i?i(t,e):(I=((l=n==null?void 0:n.scanLimit)!==null&&l!==void 0?l:1e9)>>1,U=n!=null&&n.timeout?Date.now()+n.timeout:0,ae=!1,gt(t,e,y(t,0,t.length,e,0,e.length)))}function Qe(){return!ae}function Ye(t,e,n){return pt(Ct(t,e,n),t,e)}const b=Ve.define({combine:t=>t[0]}),ie=G.define(),Ze=Ve.define(),k=H.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(ie)&&(t=n.value);for(let n of e.state.facet(Ze))t=n(t,e);return t}});function vt(t){let e=t.field(k,!1);if(!e)return null;let n=t.facet(b);return{chunks:e,side:n?n.side:null}}class O{constructor(e,n,l,i,r,s=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=i,this.toB=r,this.precise=s}offset(e,n){return e||n?new O(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,l){let i=Ye(e.toString(),n.toString(),l);return Xe(i,e,n,0,0,Qe())}static updateA(e,n,l,i,r){return be(Be(e,i,!0,l.length),e,n,l,r)}static updateB(e,n,l,i,r){return be(Be(e,i,!1,n.length),e,n,l,r)}}function xe(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.to==t&&r.to==e&&t<n.length&&e<l.length?[t+1,e+1]:[i.from,r.from]}function we(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.from==t&&r.from==e?[t,e]:[i.to+1,r.to+1]}function Xe(t,e,n,l,i,r){let s=[];for(let o=0;o<t.length;o++){let f=t[o],[h,a]=xe(f.fromA+l,f.fromB+i,e,n),[d,c]=we(f.toA+l,f.toB+i,e,n),u=[f.offset(-h+l,-a+i)];for(;o<t.length-1;){let m=t[o+1],[p,g]=xe(m.fromA+l,m.fromB+i,e,n);if(p>d+1&&g>c+1)break;u.push(m.offset(-h+l,-a+i)),[d,c]=we(m.toA+l,m.toB+i,e,n),o++}s.push(new O(u,h,Math.max(h,d),a,Math.max(a,c),r))}return s}const z=1e3;function ke(t,e,n,l){let i=0,r=t.length;for(;;){if(i==r){let a=0,d=0;i&&({toA:a,toB:d}=t[i-1]);let c=e-(n?a:d);return[a+c,d+c]}let s=i+r>>1,o=t[s],[f,h]=n?[o.fromA,o.toA]:[o.fromB,o.toB];if(f>e)r=s;else if(h<=e)i=s+1;else return l?[o.fromA,o.fromB]:[o.toA,o.toB]}}function Be(t,e,n,l){let i=[];return e.iterChangedRanges((r,s,o,f)=>{let h=0,a=n?e.length:l,d=0,c=n?l:e.length;r>z&&([h,d]=ke(t,r-z,n,!0)),s<e.length-z&&([a,c]=ke(t,s+z,n,!1));let u=f-o-(s-r),m,[p,g]=n?[u,0]:[0,u];i.length&&(m=i[i.length-1]).toA>=h?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:a,toB:c,diffA:m.diffA+p,diffB:m.diffB+g}:i.push({fromA:h,toA:a,fromB:d,toB:c,diffA:p,diffB:g})}),i}function be(t,e,n,l,i){if(!t.length)return e;let r=[];for(let s=0,o=0,f=0,h=0;;s++){let a=s==t.length?null:t[s],d=a?a.fromA+o:n.length,c=a?a.fromB+f:l.length;for(;h<e.length;){let g=e[h];if(a&&(g.toA+o>d||g.toB+f>c))break;r.push(g.offset(o,f)),h++}if(!a)break;let u=a.toA+o+a.diffA,m=a.toB+f+a.diffB,p=Ye(n.sliceString(d,u),l.sliceString(c,m),i);for(let g of Xe(p,n,l,d,c,Qe()))r.push(g);for(o+=a.diffA,f+=a.diffB;h<e.length;){let g=e[h];if(g.fromA+o>u&&g.fromB+f>m)break;h++}}return r}const et={scanLimit:500},Z=ot.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Le(t))}update(t){(t.docChanged||t.viewportChanged||At(t.startState,t.state)||xt(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Le(t.view))}},{decorations:t=>t.deco}),P=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty}}));function At(t,e){return t.field(k,!1)!=e.field(k,!1)}function xt(t,e){return t.facet(b)!=e.facet(b)}const Me=M.line({class:"cm-changedLine"}),tt=M.mark({class:"cm-changedText"}),wt=M.mark({tagName:"ins",class:"cm-insertedLine"}),kt=M.mark({tagName:"del",class:"cm-deletedLine"}),De=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function Bt(t,e,n,l,i,r){let s=n?t.fromA:t.fromB,o=n?t.toA:t.toB,f=0;if(s!=o){i.add(s,s,Me),i.add(s,o,n?kt:wt),r&&r.add(s,s,De);for(let h=e.iterRange(s,o-1),a=s;!h.next().done;){if(h.lineBreak){a++,i.add(a,a,Me),r&&r.add(a,a,De);continue}let d=a+h.value.length;if(l)for(;f<t.changes.length;){let c=t.changes[f],u=s+(n?c.fromA:c.fromB),m=s+(n?c.toA:c.toB),p=Math.max(a,u),g=Math.min(d,m);if(p<g&&i.add(p,g,tt),m<d)f++;else break}a=d}}}function Le(t){let e=t.state.field(k),{side:n,highlightChanges:l,markGutter:i,overrideChunk:r}=t.state.facet(b),s=n=="a",o=new N,f=i?new N:null,{from:h,to:a}=t.viewport;for(let d of e){if((s?d.fromA:d.fromB)>=a)break;(s?d.toA:d.toB)>h&&(!r||!r(t.state,d,o,f))&&Bt(d,t.state.doc,s,l,o,f)}return{deco:o.finish(),gutter:f&&f.finish()}}class q extends Y{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const K=G.define({map:(t,e)=>t.map(e)}),W=H.define({create:()=>M.none,update:(t,e)=>{for(let n of e.effects)if(n.is(K))return n.value;return t.map(e.changes)},provide:t=>B.decorations.from(t)}),_=.01;function Se(t,e){if(t.size!=e.size)return!1;let n=t.iter(),l=e.iter();for(;n.value;){if(n.from!=l.from||Math.abs(n.value.spec.widget.height-l.value.spec.widget.height)>1)return!1;n.next(),l.next()}return!0}function bt(t,e,n){let l=new N,i=new N,r=t.state.field(W).iter(),s=e.state.field(W).iter(),o=0,f=0,h=0,a=0,d=t.viewport,c=e.viewport;for(let g=0;;g++){let C=g<n.length?n[g]:null,S=C?C.fromA:t.state.doc.length,R=C?C.fromB:e.state.doc.length;if(o<S){let x=t.lineBlockAt(o).top+h,D=e.lineBlockAt(f).top+a,w=x-D;w<-_?(h-=w,l.add(o,o,M.widget({widget:new q(-w),block:!0,side:-1}))):w>_&&(a+=w,i.add(f,f,M.widget({widget:new q(w),block:!0,side:-1})))}if(S>o+1e3&&o<d.from&&S>d.from&&f<c.from&&R>c.from){let x=Math.min(d.from-o,c.from-f);o+=x,f+=x,g--}else if(C)o=C.toA,f=C.toB;else break;for(;r.value&&r.from<o;)h-=r.value.spec.widget.height,r.next();for(;s.value&&s.from<f;)a-=s.value.spec.widget.height,s.next()}for(;r.value;)h-=r.value.spec.widget.height,r.next();for(;s.value;)a-=s.value.spec.widget.height,s.next();let u=t.contentHeight+h-(e.contentHeight+a);u<_?l.add(t.state.doc.length,t.state.doc.length,M.widget({widget:new q(-u),block:!0,side:1})):u>_&&i.add(e.state.doc.length,e.state.doc.length,M.widget({widget:new q(u),block:!0,side:1}));let m=l.finish(),p=i.finish();Se(m,t.state.field(W))||t.dispatch({effects:K.of(m)}),Se(p,e.state.field(W))||e.dispatch({effects:K.of(p)})}const le=G.define({map:(t,e)=>e.mapPos(t)});class Mt extends Y{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let i=e.posAtDOM(l.target);e.dispatch({effects:le.of(i)});let{side:r,sibling:s}=e.state.facet(b);s&&s().dispatch({effects:le.of(Dt(i,e.state.field(k),r=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function Dt(t,e,n){let l=0,i=0;for(let r=0;;r++){let s=r<e.length?e[r]:null;if(!s||(n?s.fromA:s.fromB)>=t)return i+(t-l);[l,i]=n?[s.toA,s.toB]:[s.toB,s.toA]}}const Lt=H.define({create(t){return M.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(le)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(k)!=e.startState.field(k,!1)){let n=e.state.facet(b).side=="a",l=[];for(let i of e.state.field(k))t.between(n?i.fromA:i.fromB,n?i.toA:i.toB,r=>{l.push(r)});l.length&&(t=t.update({filter:i=>l.indexOf(i)<0}))}return t},provide:t=>B.decorations.from(t)});function se({margin:t=3,minSize:e=4}){return Lt.init(n=>St(n,t,e))}function St(t,e,n){let l=new N,i=t.facet(b).side=="a",r=t.field(k),s=1;for(let o=0;;o++){let f=o<r.length?r[o]:null,h=o?s+e:1,a=f?t.doc.lineAt(i?f.fromA:f.fromB).number-1-e:t.doc.lines,d=a-h+1;if(d>=n&&l.add(t.doc.line(h).from,t.doc.line(a).to,M.replace({widget:new Mt(d),block:!0})),!f)break;s=t.doc.lineAt(Math.min(t.doc.length,i?f.toA:f.toB)).number}return l.finish()}const Ot=B.styleModule.of(new st({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),nt=B.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),Oe=new Ge,$=new Ge;class Et{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||et;let n=[Q.low(Z),nt,Ot,W,B.updateListener.of(d=>{this.measuring<0&&(d.heightChanged||d.viewportChanged)&&!d.transactions.some(c=>c.effects.some(u=>u.is(K)))&&this.measure()})],l=[b.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&l.push(P);let i=ne.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],B.editorAttributes.of({class:"cm-merge-a"}),$.of(l),n]}),r=[b.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&r.push(P);let s=ne.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],B.editorAttributes.of({class:"cm-merge-b"}),$.of(r),n]});this.chunks=O.build(i.doc,s.doc,this.diffConf);let o=[k.init(()=>this.chunks),Oe.of(e.collapseUnchanged?se(e.collapseUnchanged):[])];i=i.update({effects:G.appendConfig.of(o)}).state,s=s.update({effects:G.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let f=e.orientation||"a-b",h=document.createElement("div");h.className="cm-mergeViewEditor";let a=document.createElement("div");a.className="cm-mergeViewEditor",this.editorDOM.appendChild(f=="a-b"?h:a),this.editorDOM.appendChild(f=="a-b"?a:h),this.a=new B({state:i,parent:h,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.a)}),this.b=new B({state:s,parent:a,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,n){if(e.some(l=>l.docChanged)){let l=e[e.length-1],i=e.reduce((s,o)=>s.compose(o.changes),Ne.empty(e[0].startState.doc.length));this.chunks=n==this.a?O.updateA(this.chunks,l.newDoc,this.b.state.doc,i,this.diffConf):O.updateB(this.chunks,this.a.state.doc,l.newDoc,i,this.diffConf),n.update([...e,l.state.update({effects:ie.of(this.chunks)})]);let r=n==this.a?this.b:this.a;r.update([r.state.update({effects:ie.of(this.chunks)})]),this.scheduleMeasure()}else n.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let r=e.orientation!="b-a";if(r!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,o=this.b.dom.parentNode;s.remove(),o.remove(),this.editorDOM.insertBefore(r?s:o,this.editorDOM.firstChild),this.editorDOM.appendChild(r?o:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let r=!!this.revertDOM,s=this.revertToA,o=this.renderRevert;"revertControls"in e&&(r=!!e.revertControls,s=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(r,s,o)}let n="highlightChanges"in e,l="gutter"in e,i="collapseUnchanged"in e;if(n||l||i){let r=[],s=[];if(n||l){let o=this.a.state.facet(b),f=l?e.gutter!==!1:o.markGutter,h=n?e.highlightChanges!==!1:o.highlightChanges;r.push($.reconfigure([b.of({side:"a",sibling:()=>this.b,highlightChanges:h,markGutter:f}),f?P:[]])),s.push($.reconfigure([b.of({side:"b",sibling:()=>this.a,highlightChanges:h,markGutter:f}),f?P:[]]))}if(i){let o=Oe.reconfigure(e.collapseUnchanged?se(e.collapseUnchanged):[]);r.push(o),s.push(o)}this.a.dispatch({effects:r}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(e,n,l){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=l,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",i=>this.revertClicked(i)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){bt(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,n=e.firstChild,l=this.a.viewport,i=this.b.viewport;for(let r=0;r<this.chunks.length;r++){let s=this.chunks[r];if(s.fromA>l.to||s.fromB>i.to)break;if(s.fromA<l.from||s.fromB<i.from)continue;let o=this.a.lineBlockAt(s.fromA).top+"px";for(;n&&+n.dataset.chunk<r;)n=Ee(n);n&&n.dataset.chunk==String(r)?(n.style.top!=o&&(n.style.top=o),n=n.nextSibling):e.insertBefore(this.renderRevertButton(o,r),n)}for(;n;)n=Ee(n)}renderRevertButton(e,n){let l;if(this.renderRevert)l=this.renderRevert();else{l=document.createElement("button");let i=this.a.state.phrase("Revert this chunk");l.setAttribute("aria-label",i),l.setAttribute("title",i),l.textContent=this.revertToLeft?"⇜":"⇝"}return l.style.top=e,l.setAttribute("data-chunk",String(n)),l}revertClicked(e){let n=e.target,l;for(;n&&n.parentNode!=this.revertDOM;)n=n.parentNode;if(n&&(l=this.chunks[n.dataset.chunk])){let[i,r,s,o,f,h]=this.revertToA?[this.b,this.a,l.fromB,l.toB,l.fromA,l.toA]:[this.a,this.b,l.fromA,l.toA,l.fromB,l.toB],a=i.state.sliceDoc(s,Math.max(s,o-1));s!=o&&h<=r.state.doc.length&&(a+=i.state.lineBreak),r.dispatch({changes:{from:f,to:Math.min(r.state.doc.length,h),insert:a},userEvent:"revert"}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function Ee(t){let e=t.nextSibling;return t.remove(),e}const yt=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Rt=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty},widgetMarker:(t,e)=>e instanceof rt?yt:null}));function Tt(t){var e;let n=typeof t.original=="string"?Fe.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||et;return[Q.low(Z),Vt,nt,B.editorAttributes.of({class:"cm-merge-b"}),Ze.of((i,r)=>{let s=r.effects.find(o=>o.is(he));return s&&(i=O.updateA(i,s.value.doc,r.startState.doc,s.value.changes,l)),r.docChanged&&(i=O.updateB(i,r.state.field(V),r.newDoc,r.changes,l)),i}),b.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:t.allowInlineDiffs?Wt:void 0,side:"b"}),V.init(()=>n),t.gutter!==!1?Rt:[],t.collapseUnchanged?se(t.collapseUnchanged):[],k.init(i=>O.build(n,i.doc,l))]}const he=G.define(),V=H.define({create:()=>Fe.empty,update(t,e){for(let n of e.effects)n.is(he)&&(t=n.value.doc);return t}}),ye=new WeakMap;class rt extends Y{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function Gt(t,e,n){let l=ye.get(e.changes);if(l)return l;let i=s=>{let{highlightChanges:o,syntaxHighlightDeletions:f,syntaxHighlightDeletionsMaxLength:h,mergeControls:a}=t.facet(b),d=document.createElement("div");if(d.className="cm-deletedChunk",a){let x=d.appendChild(document.createElement("div"));x.className="cm-chunkButtons";let D=A=>{A.preventDefault(),Nt(s,s.posAtDOM(d))},w=A=>{A.preventDefault(),Ft(s,s.posAtDOM(d))};if(typeof a=="function")x.appendChild(a("accept",D)),x.appendChild(a("reject",w));else{let A=x.appendChild(document.createElement("button"));A.name="accept",A.textContent=t.phrase("Accept"),A.onmousedown=D;let L=x.appendChild(document.createElement("button"));L.name="reject",L.textContent=t.phrase("Reject"),L.onmousedown=w}}if(n||e.fromA>=e.toA)return d;let c=s.state.field(V).sliceString(e.fromA,e.endA),u=f&&t.facet(at),m=S(),p=e.changes,g=0,C=!1;function S(){let x=d.appendChild(document.createElement("div"));return x.className="cm-deletedLine",x.appendChild(document.createElement("del"))}function R(x,D,w){for(let A=x;A<D;){if(c.charAt(A)==`
2
2
  `){m.firstChild||m.appendChild(document.createElement("br")),m=S(),A++;continue}let L=D,ce=w+(C?" cm-deletedText":""),ue=!1,X=c.indexOf(`
3
3
  `,A);if(X>-1&&X<D&&(L=X),o&&g<p.length){let j=Math.max(0,C?p[g].toA:p[g].fromA);j<=L&&(L=j,C&&g++,ue=!0)}if(L>A){let j=document.createTextNode(c.slice(A,L));if(ce){let me=m.appendChild(document.createElement("span"));me.className=ce,me.appendChild(j)}else m.appendChild(j);A=L}ue&&(C=!C)}}if(u&&e.toA-e.fromA<=h){let x=u.parser.parse(c),D=0;ft(x,{style:w=>dt(t,w)},(w,A,L)=>{w>D&&R(D,w,""),R(w,A,L),D=A}),R(D,c.length,"")}else R(0,c.length,"");return m.firstChild||m.appendChild(document.createElement("br")),d},r=M.widget({block:!0,side:-1,widget:new rt(i)});return ye.set(e.changes,r),r}function Nt(t,e){let{state:n}=t,l=e??n.selection.main.head,i=t.state.field(k).find(f=>f.fromB<=l&&f.endB>=l);if(!i)return!1;let r=t.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),s=t.state.field(V);i.fromB!=i.toB&&i.toA<=s.length&&(r+=t.state.lineBreak);let o=Ne.of({from:i.fromA,to:Math.min(s.length,i.toA),insert:r},s.length);return t.dispatch({effects:he.of({doc:o.apply(s),changes:o}),userEvent:"accept"}),!0}function Ft(t,e){let{state:n}=t,l=e??n.selection.main.head,i=n.field(k).find(o=>o.fromB<=l&&o.endB>=l);if(!i)return!1;let s=n.field(V).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=n.doc.length&&(s+=n.lineBreak),t.dispatch({changes:{from:i.fromB,to:Math.min(n.doc.length,i.toB),insert:s},userEvent:"revert"}),!0}function Re(t){let e=new N;for(let n of t.field(k)){let l=t.facet(b).overrideChunk&&it(t,n);e.add(n.fromB,n.fromB,Gt(t,n,!!l))}return e.finish()}const Vt=H.define({create:t=>Re(t),update(t,e){return e.state.field(k,!1)!=e.startState.field(k,!1)?Re(e.state):t},provide:t=>B.decorations.from(t)}),Te=new WeakMap;function it(t,e){let n=Te.get(e);if(n!==void 0)return n;n=null;let l=t.field(V),i=t.doc,r=l.lineAt(e.endA).number-l.lineAt(e.fromA).number+1,s=i.lineAt(e.endB).number-i.lineAt(e.fromB).number+1;e:if(r==s&&r<10){let o=[],f=0,h=e.fromA,a=e.fromB;for(let d of e.changes){if(d.fromA<d.toA){f+=d.toA-d.fromA;let c=l.sliceString(h+d.fromA,h+d.toA);if(/\n/.test(c))break e;o.push(M.widget({widget:new jt(c),side:-1}).range(a+d.fromB))}d.fromB<d.toB&&o.push(tt.range(a+d.fromB,a+d.toB))}f<e.endA-e.fromA-r*2&&(n=o)}return Te.set(e,n),n}class jt extends Y{constructor(e){super(),this.text=e}eq(e){return this.text==e.text}toDOM(e){let n=document.createElement("del");return n.className="cm-deletedText",n.textContent=this.text,n}}const It=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-inlineChangedLineGutter"}},Ut=M.line({class:"cm-inlineChangedLine"});function Wt(t,e,n,l){let i=it(t,e),r=0;if(!i)return!1;for(let s=t.doc.lineAt(e.fromB);;){for(l&&l.add(s.from,s.from,It),n.add(s.from,s.from,Ut);r<i.length&&i[r].to<=s.to;){let o=i[r++];n.add(o.from,o.to,o.value)}if(s.to>=e.endB)break;s=t.doc.lineAt(s.to+1)}return!0}function Ht(t){const[e,n]=T.useState([]);return T.useEffect(()=>{let l=!1;const i=ht.matchFilename(ct,t);if(!i){n([]);return}return i.load().then(r=>{l||n([r])}).catch(()=>{l||n([])}),()=>{l=!0}},[t]),e}function Kt({baseline:t,current:e,theme:n,filename:l,sideBySide:i,onRejectHunk:r,onHunkCountChange:s}){const o=Ht(l);return i?J.jsx(Pt,{baseline:t,current:e,theme:n,languageExtension:o}):J.jsx(zt,{baseline:t,current:e,theme:n,languageExtension:o,onRejectHunk:r,onHunkCountChange:s})}function zt({baseline:t,current:e,theme:n,languageExtension:l,onRejectHunk:i,onHunkCountChange:r}){const s=T.useRef(-1),o=T.useMemo(()=>[B.lineWrapping,Tt({original:t,gutter:!0,mergeControls:!0,collapseUnchanged:{margin:3,minSize:4}}),...l],[t,l]);return J.jsx(lt,{value:e,editable:!1,readOnly:!0,theme:n,height:"100%",className:"desktop:select-text h-full text-sm",extensions:o,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},onChange:f=>i(f),onUpdate:f=>{var a;const h=((a=vt(f.state))==null?void 0:a.chunks.length)??null;h!==null&&h!==s.current&&(s.current=h,r(h))}})}function Pt({baseline:t,current:e,theme:n,languageExtension:l}){const i=T.useRef(null);return T.useEffect(()=>{const r=i.current;if(!r)return;const s=[B.editable.of(!1),ne.readOnly.of(!0),B.lineWrapping,...n==="dark"?[qt()]:[],...l],o=new Et({a:{doc:t,extensions:s},b:{doc:e,extensions:s},parent:r,collapseUnchanged:{margin:3,minSize:4},highlightChanges:!0,gutter:!0});return()=>o.destroy()},[t,e,n,l]),J.jsx("div",{ref:i,className:"cm-diff-split h-full overflow-auto text-sm"})}function qt(){return B.theme({"&":{backgroundColor:"transparent",color:"inherit"}},{dark:!0})}export{Kt as CodeMirrorDiff};
@@ -1 +1 @@
1
- import{r as n,j as f}from"./index-bYhLX3oQ.js";import{R as l}from"./index-cNE108-h.js";import{m as a,n as c,E as x}from"./index-Bj32H2Xz.js";function j({value:u,editable:t,filename:i,languageHint:e,theme:h,onChange:m}){const[g,r]=n.useState([]);return n.useEffect(()=>{let s=!1;const o=e?a.matchLanguageName(c,e,!0):a.matchFilename(c,i);if(!o){r([]);return}return o.load().then(p=>{s||r([p])}).catch(()=>{s||r([])}),()=>{s=!0}},[i,e]),f.jsx(l,{value:u,editable:t,readOnly:!t,onChange:m,theme:h,height:"100%",className:"desktop:select-text h-full text-sm",extensions:[x.lineWrapping,...g],basicSetup:{highlightActiveLine:t,highlightActiveLineGutter:t}})}export{j as CodeMirrorEditor};
1
+ import{r as n,j as f}from"./index-B4Z9VBPe.js";import{R as l}from"./index-B_0gazbk.js";import{m as a,n as c,E as x}from"./index-3nUBnton.js";function j({value:u,editable:t,filename:i,languageHint:e,theme:h,onChange:m}){const[g,r]=n.useState([]);return n.useEffect(()=>{let s=!1;const o=e?a.matchLanguageName(c,e,!0):a.matchFilename(c,i);if(!o){r([]);return}return o.load().then(p=>{s||r([p])}).catch(()=>{s||r([])}),()=>{s=!0}},[i,e]),f.jsx(l,{value:u,editable:t,readOnly:!t,onChange:m,theme:h,height:"100%",className:"desktop:select-text h-full text-sm",extensions:[x.lineWrapping,...g],basicSetup:{highlightActiveLine:t,highlightActiveLineGutter:t}})}export{j as CodeMirrorEditor};