@devness/useai 0.5.3 → 0.5.5

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 (2) hide show
  1. package/dist/index.js +79 -13
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -112,7 +112,7 @@ var VERSION;
112
112
  var init_version = __esm({
113
113
  "../shared/dist/constants/version.js"() {
114
114
  "use strict";
115
- VERSION = "0.5.3";
115
+ VERSION = "0.5.4";
116
116
  }
117
117
  });
118
118
 
@@ -1713,7 +1713,7 @@ function resolveClient(server2, session2) {
1713
1713
  }
1714
1714
  session2.setClient(detectClient());
1715
1715
  }
1716
- function registerTools(server2, session2) {
1716
+ function registerTools(server2, session2, opts) {
1717
1717
  server2.tool(
1718
1718
  "useai_start",
1719
1719
  `Start tracking an AI coding session. Call this at the beginning of every response. Generate a session title from the user's prompt: a generic public "title" (no project/file names) and a detailed "private_title" (can include specifics).`,
@@ -1723,6 +1723,9 @@ function registerTools(server2, session2) {
1723
1723
  private_title: z2.string().optional().describe('Detailed session title for private records. Can include project names and specifics. Example: "Fix JWT refresh in UseAI login flow"')
1724
1724
  },
1725
1725
  async ({ task_type, title, private_title }) => {
1726
+ if (session2.sessionRecordCount > 0 && opts?.sealBeforeReset) {
1727
+ opts.sealBeforeReset();
1728
+ }
1726
1729
  session2.reset();
1727
1730
  resolveClient(server2, session2);
1728
1731
  session2.setTaskType(task_type ?? "coding");
@@ -1863,7 +1866,7 @@ function registerTools(server2, session2) {
1863
1866
  chain_end_hash: endRecord.hash,
1864
1867
  seal_signature: sealSignature
1865
1868
  };
1866
- const sessions2 = getSessions();
1869
+ const sessions2 = getSessions().filter((s) => s.session_id !== seal.session_id);
1867
1870
  sessions2.push(seal);
1868
1871
  writeJson(SESSIONS_FILE, sessions2);
1869
1872
  let milestoneCount = 0;
@@ -1962,14 +1965,14 @@ var $={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"
1962
1965
  *
1963
1966
  * This source code is licensed under the ISC license.
1964
1967
  * See the LICENSE file in the root directory of this source tree.
1965
- */const U=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...s},l)=>f.createElement("svg",{ref:l,...$,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:B("lucide",i),...s},[...o.map(([e,t])=>f.createElement(e,t)),...Array.isArray(a)?a:[a]])),H=(e,t)=>{const n=f.forwardRef(({className:n,...r},i)=>{return f.createElement(U,{ref:i,iconNode:t,className:B(\`lucide-\${a=e,a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}\`,n),...r});var a});return n.displayName=\`\${e}\`,n},W=H("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),q=H("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]),Y=H("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]),X=H("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]),K=H("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Q=H("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),G=H("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),Z=H("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]),J=H("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]),ee=H("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]),te=H("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),ne=H("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]),re=H("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]),ie=H("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]),ae=H("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),oe=H("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]),se=H("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),le=H("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),ue=H("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]),ce=H("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]),de=H("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]),fe=H("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),he=H("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);
1968
+ */const U=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...s},l)=>f.createElement("svg",{ref:l,...$,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:B("lucide",i),...s},[...o.map(([e,t])=>f.createElement(e,t)),...Array.isArray(a)?a:[a]])),H=(e,t)=>{const n=f.forwardRef(({className:n,...r},i)=>{return f.createElement(U,{ref:i,iconNode:t,className:B(\`lucide-\${a=e,a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}\`,n),...r});var a});return n.displayName=\`\${e}\`,n},W=H("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),q=H("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]),Y=H("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]),X=H("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]),K=H("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Q=H("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),G=H("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),Z=H("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]),J=H("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),ee=H("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),te=H("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]),ne=H("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]),re=H("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),ie=H("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]),ae=H("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]),oe=H("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]),se=H("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),le=H("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]),ue=H("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),ce=H("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),de=H("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),fe=H("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]),he=H("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]),pe=H("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]),me=H("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),ge=H("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);
1966
1969
  /**
1967
1970
  * @license lucide-react v0.468.0 - ISC
1968
1971
  *
1969
1972
  * This source code is licensed under the ISC license.
1970
1973
  * See the LICENSE file in the root directory of this source tree.
1971
- */function pe({health:e,timeContextLabel:t}){return s.jsxs("div",{className:"flex items-center justify-between mb-8",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-accent flex items-center justify-center shadow-[0_0_15px_rgba(99,102,241,0.4)]",children:s.jsx("span",{className:"font-mono text-white font-bold text-lg",children:"U"})}),s.jsx("div",{children:s.jsxs("h1",{className:"text-xl font-bold tracking-tight text-text-primary flex items-center gap-2",children:["UseAI",s.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-bg-surface-2 text-text-muted font-mono uppercase tracking-widest border border-border/50",children:"Dashboard"})]})})]}),s.jsxs("div",{className:"flex items-center gap-4",children:[e&&e.active_sessions>0&&s.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-full bg-success/10 border border-success/20",children:[s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"w-2 h-2 rounded-full bg-success animate-ping absolute inset-0"}),s.jsx("div",{className:"w-2 h-2 rounded-full bg-success relative"})]}),s.jsxs("span",{className:"text-xs font-medium text-success",children:[e.active_sessions," active session",1!==e.active_sessions?"s":""]})]}),s.jsxs("div",{className:"flex items-center gap-2 text-xs text-text-muted font-mono bg-bg-surface-1 px-3 py-1.5 rounded-md border border-border",children:[s.jsx(W,{className:"w-3 h-3"}),t]})]})]})}const me=f.createContext({});function ge(e){const t=f.useRef(null);return null===t.current&&(t.current=e()),t.current}const ye="undefined"!=typeof window,ve=ye?f.useLayoutEffect:f.useEffect,be=f.createContext(null);function xe(e,t){-1===e.indexOf(t)&&e.push(t)}function we(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const ke=(e,t,n)=>n>t?t:n<e?e:n;const Se={},Ee=e=>/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(e);function Te(e){return"object"==typeof e&&null!==e}const Ce=e=>/^0[^.\\s]+$/u.test(e);function Pe(e){let t;return()=>(void 0===t&&(t=e()),t)}const je=e=>e,Ne=(e,t)=>n=>t(e(n)),Me=(...e)=>e.reduce(Ne),Le=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r};class Ae{constructor(){this.subscriptions=[]}add(e){return xe(this.subscriptions,e),()=>we(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){const r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const De=e=>1e3*e,_e=e=>e/1e3;function Re(e,t){return t?e*(1e3/t):0}const ze=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Fe(e,t,n,r){if(e===t&&n===r)return je;const i=t=>function(e,t,n,r,i){let a,o,s=0;do{o=t+(n-t)/2,a=ze(o,r,i)-e,a>0?n=o:t=o}while(Math.abs(a)>1e-7&&++s<12);return o}(t,0,1,e,n);return e=>0===e||1===e?e:ze(i(e),t,r)}const Oe=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ve=e=>t=>1-e(1-t),Ie=Fe(.33,1.53,.69,.99),Be=Ve(Ie),$e=Oe(Be),Ue=e=>(e*=2)<1?.5*Be(e):.5*(2-Math.pow(2,-10*(e-1))),He=e=>1-Math.sin(Math.acos(e)),We=Ve(He),qe=Oe(He),Ye=Fe(.42,0,1,1),Xe=Fe(0,0,.58,1),Ke=Fe(.42,0,.58,1),Qe=e=>Array.isArray(e)&&"number"==typeof e[0],Ge={linear:je,easeIn:Ye,easeInOut:Ke,easeOut:Xe,circIn:He,circInOut:qe,circOut:We,backIn:Be,backInOut:$e,backOut:Ie,anticipate:Ue},Ze=e=>{if(Qe(e)){e.length;const[t,n,r,i]=e;return Fe(t,n,r,i)}return"string"==typeof e?Ge[e]:e},Je=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function et(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Je.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,i=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(l.schedule(t),e()),t(o)}const l={schedule:(e,i=!1,o=!1)=>{const s=o&&r?t:n;return i&&a.add(e),s.has(e)||s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{o=e,r?i=!0:(r=!0,[t,n]=[n,t],t.forEach(s),t.clear(),r=!1,i&&(i=!1,l.process(e)))}};return l}(a),e),{}),{setup:s,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:f,render:h,postRender:p}=o,m=()=>{const a=Se.useManualTiming?i.timestamp:performance.now();n=!1,Se.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(a-i.timestamp,40),1)),i.timestamp=a,i.isProcessing=!0,s.process(i),l.process(i),u.process(i),c.process(i),d.process(i),f.process(i),h.process(i),p.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(m))};return{schedule:Je.reduce((t,a)=>{const s=o[a];return t[a]=(t,a=!1,o=!1)=>(n||(n=!0,r=!0,i.isProcessing||e(m)),s.schedule(t,a,o)),t},{}),cancel:e=>{for(let t=0;t<Je.length;t++)o[Je[t]].cancel(e)},state:i,steps:o}}const{schedule:tt,cancel:nt,state:rt,steps:it}=et("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:je,!0);let at;function ot(){at=void 0}const st={now:()=>(void 0===at&&st.set(rt.isProcessing||Se.useManualTiming?rt.timestamp:performance.now()),at),set:e=>{at=e,queueMicrotask(ot)}},lt=e=>t=>"string"==typeof t&&t.startsWith(e),ut=lt("--"),ct=lt("var(--"),dt=e=>!!ct(e)&&ft.test(e.split("/*")[0].trim()),ft=/var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;function ht(e){return"string"==typeof e&&e.split("/*")[0].includes("var(--")}const pt={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},mt={...pt,transform:e=>ke(0,1,e)},gt={...pt,default:1},yt=e=>Math.round(1e5*e)/1e5,vt=/-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;const bt=/^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu,xt=(e,t)=>n=>Boolean("string"==typeof n&&bt.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),wt=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[i,a,o,s]=r.match(vt);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:void 0!==s?parseFloat(s):1}},kt={...pt,transform:e=>Math.round((e=>ke(0,255,e))(e))},St={test:xt("rgb","red"),parse:wt("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+kt.transform(e)+", "+kt.transform(t)+", "+kt.transform(n)+", "+yt(mt.transform(r))+")"};const Et={test:xt("#"),parse:function(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}},transform:St.transform},Tt=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>\`\${t}\${e}\`}),Ct=Tt("deg"),Pt=Tt("%"),jt=Tt("px"),Nt=Tt("vh"),Mt=Tt("vw"),Lt=(()=>({...Pt,parse:e=>Pt.parse(e)/100,transform:e=>Pt.transform(100*e)}))(),At={test:xt("hsl","hue"),parse:wt("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Pt.transform(yt(t))+", "+Pt.transform(yt(n))+", "+yt(mt.transform(r))+")"},Dt={test:e=>St.test(e)||Et.test(e)||At.test(e),parse:e=>St.test(e)?St.parse(e):At.test(e)?At.parse(e):Et.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?St.transform(e):At.transform(e),getAnimatableNone:e=>{const t=Dt.parse(e);return t.alpha=0,Dt.transform(t)}},_t=/(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;const Rt="number",zt="color",Ft=/var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;function Ot(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const o=t.replace(Ft,e=>(Dt.test(e)?(r.color.push(a),i.push(zt),n.push(Dt.parse(e))):e.startsWith("var(")?(r.var.push(a),i.push("var"),n.push(e)):(r.number.push(a),i.push(Rt),n.push(parseFloat(e))),++a,"\${}")).split("\${}");return{values:n,split:o,indexes:r,types:i}}function Vt(e){return Ot(e).values}function It(e){const{split:t,types:n}=Ot(e),r=t.length;return e=>{let i="";for(let a=0;a<r;a++)if(i+=t[a],void 0!==e[a]){const t=n[a];i+=t===Rt?yt(e[a]):t===zt?Dt.transform(e[a]):e[a]}return i}}const Bt=e=>"number"==typeof e?0:Dt.test(e)?Dt.getAnimatableNone(e):e;const $t={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(vt)?.length||0)+(e.match(_t)?.length||0)>0},parse:Vt,createTransformer:It,getAnimatableNone:function(e){const t=Vt(e);return It(e)(t.map(Bt))}};function Ut(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ht(e,t){return n=>n>0?t:e}const Wt=(e,t,n)=>e+(t-e)*n,qt=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Yt=[Et,St,At];function Xt(e){const t=(n=e,Yt.find(e=>e.test(n)));var n;if(!Boolean(t))return!1;let r=t.parse(e);return t===At&&(r=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let i=0,a=0,o=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Ut(s,r,e+1/3),a=Ut(s,r,e),o=Ut(s,r,e-1/3)}else i=a=o=n;return{red:Math.round(255*i),green:Math.round(255*a),blue:Math.round(255*o),alpha:r}}(r)),r}const Kt=(e,t)=>{const n=Xt(e),r=Xt(t);if(!n||!r)return Ht(e,t);const i={...n};return e=>(i.red=qt(n.red,r.red,e),i.green=qt(n.green,r.green,e),i.blue=qt(n.blue,r.blue,e),i.alpha=Wt(n.alpha,r.alpha,e),St.transform(i))},Qt=new Set(["none","hidden"]);function Gt(e,t){return n=>Wt(e,t,n)}function Zt(e){return"number"==typeof e?Gt:"string"==typeof e?dt(e)?Ht:Dt.test(e)?Kt:tn:Array.isArray(e)?Jt:"object"==typeof e?Dt.test(e)?Kt:en:Ht}function Jt(e,t){const n=[...e],r=n.length,i=e.map((e,n)=>Zt(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function en(e,t){const n={...e,...t},r={};for(const i in n)void 0!==e[i]&&void 0!==t[i]&&(r[i]=Zt(e[i])(e[i],t[i]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const tn=(e,t)=>{const n=$t.createTransformer(t),r=Ot(e),i=Ot(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Qt.has(e)&&!i.values.length||Qt.has(t)&&!r.values.length?function(e,t){return Qt.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Me(Jt(function(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}(r,i),i.values),n):Ht(e,t)};function nn(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return Wt(e,t,n);return Zt(e)(e,t)}const rn=e=>{const t=({timestamp:t})=>e(t);return{start:(e=!0)=>tt.update(t,e),stop:()=>nt(t),now:()=>rt.isProcessing?rt.timestamp:st.now()}},an=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)r+=Math.round(1e4*e(a/(i-1)))/1e4+", ";return\`linear(\${r.substring(0,r.length-2)})\`},on=2e4;function sn(e){let t=0;let n=e.next(t);for(;!n.done&&t<on;)t+=50,n=e.next(t);return t>=on?1/0:t}function ln(e,t,n){const r=Math.max(t-5,0);return Re(n-e(r),t-r)}const un=100,cn=10,dn=1,fn=0,hn=800,pn=.3,mn=.3,gn={granular:.01,default:2},yn={granular:.005,default:.5},vn=.01,bn=10,xn=.05,wn=1,kn=.001;function Sn({duration:e=hn,bounce:t=pn,velocity:n=fn,mass:r=dn}){let i,a,o=1-t;o=ke(xn,wn,o),e=ke(vn,bn,_e(e)),o<1?(i=t=>{const r=t*o,i=r*e,a=r-n,s=Tn(t,o),l=Math.exp(-i);return kn-a/s*l},a=t=>{const r=t*o*e,a=r*n+n,s=Math.pow(o,2)*Math.pow(t,2)*e,l=Math.exp(-r),u=Tn(Math.pow(t,2),o);return(-i(t)+kn>0?-1:1)*((a-s)*l)/u}):(i=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,a=t=>Math.exp(-t*e)*(e*e*(n-t)));const s=function(e,t,n){let r=n;for(let i=1;i<En;i++)r-=e(r)/t(r);return r}(i,a,5/e);if(e=De(e),isNaN(s))return{stiffness:un,damping:cn,duration:e};{const t=Math.pow(s,2)*r;return{stiffness:t,damping:2*o*Math.sqrt(r*t),duration:e}}}const En=12;function Tn(e,t){return e*Math.sqrt(1-t*t)}const Cn=["duration","bounce"],Pn=["stiffness","damping","mass"];function jn(e,t){return t.some(t=>void 0!==e[t])}function Nn(e=mn,t=pn){const n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:u,mass:c,duration:d,velocity:f,isResolvedFromDuration:h}=function(e){let t={velocity:fn,stiffness:un,damping:cn,mass:dn,isResolvedFromDuration:!1,...e};if(!jn(e,Pn)&&jn(e,Cn))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(1.2*n),i=r*r,a=2*ke(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:dn,stiffness:i,damping:a}}else{const n=Sn(e);t={...t,...n,mass:dn},t.isResolvedFromDuration=!0}return t}({...n,velocity:-_e(n.velocity||0)}),p=f||0,m=u/(2*Math.sqrt(l*c)),g=o-a,y=_e(Math.sqrt(l/c)),v=Math.abs(g)<5;let b;if(r||(r=v?gn.granular:gn.default),i||(i=v?yn.granular:yn.default),m<1){const e=Tn(y,m);b=t=>{const n=Math.exp(-m*y*t);return o-n*((p+m*y*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}}else if(1===m)b=e=>o-Math.exp(-y*e)*(g+(p+y*g)*e);else{const e=y*Math.sqrt(m*m-1);b=t=>{const n=Math.exp(-m*y*t),r=Math.min(e*t,300);return o-n*((p+m*y*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}const x={calculatedDuration:h&&d||null,next:e=>{const t=b(e);if(h)s.done=e>=d;else{let n=0===e?p:0;m<1&&(n=0===e?De(p):ln(b,e,t));const a=Math.abs(n)<=r,l=Math.abs(o-t)<=i;s.done=a&&l}return s.value=s.done?o:t,s},toString:()=>{const e=Math.min(sn(x),on),t=an(t=>x.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return x}function Mn({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},h=e=>void 0===s?l:void 0===l||Math.abs(s-e)<Math.abs(l-e)?s:l;let p=n*t;const m=d+p,g=void 0===o?m:o(m);g!==m&&(p=g-d);const y=e=>-p*Math.exp(-e/r),v=e=>g+y(e),b=e=>{const t=y(e),n=v(e);f.done=Math.abs(t)<=u,f.value=f.done?g:n};let x,w;const k=e=>{var t;(t=f.value,void 0!==s&&t<s||void 0!==l&&t>l)&&(x=e,w=Nn({keyframes:[f.value,h(f.value)],velocity:ln(v,e,f.value),damping:i,stiffness:a,restDelta:u,restSpeed:c}))};return k(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==x||(t=!0,b(e),k(e)),void 0!==x&&e>=x?w.next(e-x):(!t&&b(e),f)}}}function Ln(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const a=e.length;if(t.length,1===a)return()=>t[0];if(2===a&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const r=[],i=n||Se.mix||nn,a=e.length-1;for(let o=0;o<a;o++){let n=i(e[o],e[o+1]);if(t){const e=Array.isArray(t)?t[o]||je:t;n=Me(e,n)}r.push(n)}return r}(t,r,i),l=s.length,u=n=>{if(o&&n<e[0])return t[0];let r=0;if(l>1)for(;r<e.length-2&&!(n<e[r+1]);r++);const i=Le(e[r],e[r+1],n);return s[r](i)};return n?t=>u(ke(e[0],e[a-1],t)):u}function An(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Le(0,t,r);e.push(Wt(n,1,i))}}(t,e.length-1),t}function Dn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(Ze):Ze(r),a={done:!1,value:t[0]},o=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:An(t),e),s=Ln(o,t,{ease:Array.isArray(i)?i:(l=t,u=i,l.map(()=>u||Ke).splice(0,l.length-1))});var l,u;return{calculatedDuration:e,next:t=>(a.value=s(t),a.done=t>=e,a)}}Nn.applyToOptions=e=>{const t=function(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(sn(r),on);return{type:"keyframes",ease:e=>r.next(i*e).value/t,duration:_e(i)}}(e,100,Nn);return e.ease=t.ease,e.duration=De(t.duration),e.type="keyframes",e};const _n=e=>null!==e;function Rn(e,{repeat:t,repeatType:n="loop"},r,i=1){const a=e.filter(_n),o=i<0||t&&"loop"!==n&&t%2==1?0:a.length-1;return o&&void 0!==r?r:a[o]}const zn={decay:Mn,inertia:Mn,tween:Dn,keyframes:Dn,spring:Nn};function Fn(e){"string"==typeof e.type&&(e.type=zn[e.type])}class On{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}const Vn=e=>e/100;class In extends On{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:e}=this.options;e&&e.updatedAt!==st.now()&&this.tick(st.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause()}initAnimation(){const{options:e}=this;Fn(e);const{type:t=Dn,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e;let{keyframes:o}=e;const s=t||Dn;s!==Dn&&"number"!=typeof o[0]&&(this.mixKeyframes=Me(Vn,nn(o[0],o[1])),o=[0,100]);const l=s({...e,keyframes:o});"mirror"===i&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),null===l.calculatedDuration&&(l.calculatedDuration=sn(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=l}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:u,repeat:c,repeatType:d,repeatDelay:f,type:h,onUpdate:p,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=r);let v=this.currentTime,b=n;if(c){const e=Math.min(this.currentTime,r)/o;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,c+1);Boolean(t%2)&&("reverse"===d?(n=1-n,f&&(n-=f/o)):"mirror"===d&&(b=a)),v=ke(0,1,n)*o}const x=y?{done:!1,value:u[0]}:b.next(v);i&&(x.value=i(x.value));let{done:w}=x;y||null===s||(w=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const k=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return k&&h!==Mn&&(x.value=Rn(u,this.options,m,this.speed)),p&&p(x.value),k&&this.finish(),x}then(e,t){return this.finished.then(e,t)}get duration(){return _e(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+_e(e)}get time(){return _e(this.currentTime)}set time(e){e=De(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(st.now());const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=_e(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=rn,startTime:t}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=t??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(st.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}const Bn=e=>180*e/Math.PI,$n=e=>{const t=Bn(Math.atan2(e[1],e[0]));return Hn(t)},Un={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:$n,rotateZ:$n,skewX:e=>Bn(Math.atan(e[1])),skewY:e=>Bn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Hn=e=>((e%=360)<0&&(e+=360),e),Wn=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),qn=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Yn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Wn,scaleY:qn,scale:e=>(Wn(e)+qn(e))/2,rotateX:e=>Hn(Bn(Math.atan2(e[6],e[5]))),rotateY:e=>Hn(Bn(Math.atan2(-e[2],e[0]))),rotateZ:$n,rotate:$n,skewX:e=>Bn(Math.atan(e[4])),skewY:e=>Bn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Xn(e){return e.includes("scale")?1:0}function Kn(e,t){if(!e||"none"===e)return Xn(t);const n=e.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u);let r,i;if(n)r=Yn,i=n;else{const t=e.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u);r=Un,i=t}if(!i)return Xn(t);const a=r[t],o=i[1].split(",").map(Qn);return"function"==typeof a?a(o):o[a]}function Qn(e){return parseFloat(e.trim())}const Gn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Zn=(()=>new Set(Gn))(),Jn=e=>e===pt||e===jt,er=new Set(["x","y","z"]),tr=Gn.filter(e=>!er.has(e));const nr={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Kn(t,"x"),y:(e,{transform:t})=>Kn(t,"y")};nr.translateX=nr.x,nr.translateY=nr.y;const rr=new Set;let ir=!1,ar=!1,or=!1;function sr(){if(ar){const e=Array.from(rr).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{const t=function(e){const t=[];return tr.forEach(n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}ar=!1,ir=!1,rr.forEach(e=>e.complete(or)),rr.clear()}function lr(){rr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ar=!0)})}class ur{constructor(e,t,n,r,i,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(rr.add(this),ir||(ir=!0,tt.read(lr),tt.resolveKeyframes(sr))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(null===e[0]){const i=r?.get(),a=e[e.length-1];if(void 0!==i)e[0]=i;else if(n&&t){const r=n.readValue(t,a);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=a),r&&void 0===i&&r.set(e[0])}!function(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),rr.delete(this)}cancel(){"scheduled"===this.state&&(rr.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const cr=Pe(()=>void 0!==window.ScrollTimeline),dr={};function fr(e,t){const n=Pe(e);return()=>dr[t]??n()}const hr=fr(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),pr=([e,t,n,r])=>\`cubic-bezier(\${e}, \${t}, \${n}, \${r})\`,mr={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:pr([0,.65,.55,1]),circOut:pr([.55,0,1,.45]),backIn:pr([.31,.01,.66,-.59]),backOut:pr([.33,1.53,.69,.99])};function gr(e,t){return e?"function"==typeof e?hr()?an(e,t):"ease-out":Qe(e)?pr(e):Array.isArray(e)?e.map(e=>gr(e,t)||mr.easeOut):mr[e]:void 0}function yr(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:s="easeOut",times:l}={},u=void 0){const c={[t]:n};l&&(c.offset=l);const d=gr(s,i);Array.isArray(d)&&(c.easing=d);const f={delay:r,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:"reverse"===o?"alternate":"normal"};u&&(f.pseudoElement=u);return e.animate(c,f)}function vr(e){return"function"==typeof e&&"applyToOptions"in e}class br extends On{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=Boolean(i),this.allowFlatten=a,this.options=e,e.type;const l=function({type:e,...t}){return vr(e)&&hr()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=yr(t,n,r,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const e=Rn(r,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(e):function(e,t,n){(e=>e.startsWith("--"))(t)?e.style.setProperty(t,n):e.style[t]=n}(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return _e(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+_e(e)}get time(){return _e(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=De(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:t}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&cr()?(this.animation.timeline=e,je):t(this)}}const xr={anticipate:Ue,backInOut:$e,circInOut:qe};function wr(e){"string"==typeof e.ease&&e.ease in xr&&(e.ease=xr[e.ease])}class kr extends br{constructor(e){wr(e),Fn(e),super(e),void 0!==e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(void 0!==e)return void t.set(e);const o=new In({...a,autoplay:!1}),s=Math.max(10,st.now()-this.startTime),l=ke(0,10,s-10);t.setWithVelocity(o.sample(Math.max(0,s-l)).value,o.sample(s).value,l),o.stop()}}const Sr=(e,t)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!$t.test(e)&&"0"!==e||e.startsWith("url(")));function Er(e){e.duration=0,e.type="keyframes"}const Tr=new Set(["opacity","clipPath","filter","transform"]),Cr=Pe(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Pr extends On{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:a="loop",keyframes:o,name:s,motionValue:l,element:u,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=st.now();const d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:l,element:u,...c},f=u?.KeyframeResolver||ur;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;const{name:i,type:a,velocity:o,delay:s,isHandoff:l,onUpdate:u}=n;this.resolvedAt=st.now(),function(e,t,n,r){const i=e[0];if(null===i)return!1;if("display"===t||"visibility"===t)return!0;const a=e[e.length-1],o=Sr(i,t),s=Sr(a,t);return!(!o||!s)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||("spring"===n||vr(n))&&r)}(e,i,a,o)||(!Se.instantAnimations&&s||u?.(Rn(e,n,t)),e[0]=e[e.length-1],Er(n),n.repeat=0);const c={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},d=!l&&function(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o}=e,s=t?.owner?.current;if(!(s instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=t.owner.getProps();return Cr()&&n&&Tr.has(n)&&("transform"!==n||!u)&&!l&&!r&&"mirror"!==i&&0!==a&&"inertia"!==o}(c),f=c.motionValue?.owner?.current,h=d?new kr({...c,element:f}):new In(c);h.finished.then(()=>{this.notifyFinished()}).catch(je),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),or=!0,lr(),sr(),or=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function jr(e,t,n,r=0,i=1){const a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return"function"==typeof n?n(a,o):1===i?a*r:s-a*r}const Nr=/^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u;function Mr(e,t,n=1){const[r,i]=function(e){const t=Nr.exec(e);if(!t)return[,];const[,n,r,i]=t;return[\`--\${n??r}\`,i]}(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const e=a.trim();return Ee(e)?parseFloat(e):e}return dt(i)?Mr(i,t,n+1):i}const Lr={type:"spring",stiffness:500,damping:25,restSpeed:10},Ar={type:"keyframes",duration:.8},Dr={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},_r=(e,{keyframes:t})=>t.length>2?Ar:Zn.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Lr:Dr,Rr=e=>null!==e;function zr(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Fr(e,t){const n=e?.[t]??e?.default??e;return n!==e?zr(n,e):n}const Or=(e,t,n,r={},i,a)=>o=>{const s=Fr(r,e)||{},l=s.delay||r.delay||0;let{elapsed:u=0}=r;u-=De(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-u,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(s)||Object.assign(c,_r(e,c)),c.duration&&(c.duration=De(c.duration)),c.repeatDelay&&(c.repeatDelay=De(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(Er(c),0===c.delay&&(d=!0)),(Se.instantAnimations||Se.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,Er(c),c.delay=0),c.allowFlatten=!s.type&&!s.ease,d&&!a&&void 0!==t.get()){const e=function(e,{repeat:t,repeatType:n="loop"}){const r=e.filter(Rr);return r[t&&"loop"!==n&&t%2==1?0:r.length-1]}(c.keyframes,s);if(void 0!==e)return void tt.update(()=>{c.onUpdate(e),c.onComplete()})}return s.isSync?new In(c):new Pr(c)};function Vr(e){const t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Ir(e,t,n,r){if("function"==typeof t){const[i,a]=Vr(r);t=t(void 0!==n?n:e.custom,i,a)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[i,a]=Vr(r);t=t(void 0!==n?n:e.custom,i,a)}return t}function Br(e,t,n){const r=e.getProps();return Ir(r,t,void 0!==n?n:r.custom,e)}const $r=new Set(["width","height","top","left","right","bottom",...Gn]);class Ur{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{const t=st.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const n of this.dependents)n.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=st.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Ae);const n=this.events[e].add(t);return"change"===e?()=>{n(),tt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=st.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Re(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Hr(e,t){return new Ur(e,t)}const Wr=e=>Array.isArray(e);function qr(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Hr(n))}function Yr(e){return Wr(e)?e[e.length-1]||0:e}const Xr=e=>Boolean(e&&e.getVelocity);function Kr(e,t){const n=e.getValue("willChange");if(r=n,Boolean(Xr(r)&&r.add))return n.add(t);if(!n&&Se.WillChange){const n=new Se.WillChange("auto");e.addValue("willChange",n),n.add(t)}var r}function Qr(e){return e.replace(/([A-Z])/g,e=>\`-\${e.toLowerCase()}\`)}const Gr="data-"+Qr("framerAppearId");function Zr(e){return e.props[Gr]}function Jr({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function ei(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t;const l=e.getDefaultTransition();a=a?zr(a,l):l;const u=a?.reduceMotion;r&&(a=r);const c=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const f in s){const t=e.getValue(f,e.latestValues[f]??null),r=s[f];if(void 0===r||d&&Jr(d,f))continue;const i={delay:n,...Fr(a||{},f)},o=t.get();if(void 0!==o&&!t.isAnimating&&!Array.isArray(r)&&r===o&&!i.velocity)continue;let l=!1;if(window.MotionHandoffAnimation){const t=Zr(e);if(t){const e=window.MotionHandoffAnimation(t,f,tt);null!==e&&(i.startTime=e,l=!0)}}Kr(e,f);const h=u??e.shouldReduceMotion;t.start(Or(f,t,r,h&&$r.has(f)?{type:!1}:i,e,l));const p=t.animation;p&&c.push(p)}if(o){const t=()=>tt.update(()=>{o&&function(e,t){const n=Br(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const o in a)qr(e,o,Yr(a[o]))}(e,o)});c.length?Promise.all(c).then(t):t()}return c}function ti(e,t,n={}){const r=Br(e,t,"exit"===n.type?e.presenceContext?.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const a=r?()=>Promise.all(ei(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return function(e,t,n=0,r=0,i=0,a=1,o){const s=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),s.push(ti(l,t,{...o,delay:n+("function"==typeof r?0:r)+jr(e.variantChildren,l,r,i,a)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(s)}(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){const[e,t]="beforeChildren"===s?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}const ni=e=>t=>t.test(e),ri=[pt,jt,Pt,Ct,Mt,Nt,{test:e=>"auto"===e,parse:e=>e}],ii=e=>ri.find(ni(e));function ai(e){return"number"==typeof e?0===e:null===e||("none"===e||"0"===e||Ce(e))}const oi=new Set(["brightness","contrast","saturate","opacity"]);function si(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(vt)||[];if(!r)return e;const i=n.replace(r,"");let a=oi.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const li=/\\b([a-z-]*)\\(.*?\\)/gu,ui={...$t,getAnimatableNone:e=>{const t=e.match(li);return t?t.map(si).join(" "):e}},ci={...pt,transform:Math.round},di={borderWidth:jt,borderTopWidth:jt,borderRightWidth:jt,borderBottomWidth:jt,borderLeftWidth:jt,borderRadius:jt,borderTopLeftRadius:jt,borderTopRightRadius:jt,borderBottomRightRadius:jt,borderBottomLeftRadius:jt,width:jt,maxWidth:jt,height:jt,maxHeight:jt,top:jt,right:jt,bottom:jt,left:jt,inset:jt,insetBlock:jt,insetBlockStart:jt,insetBlockEnd:jt,insetInline:jt,insetInlineStart:jt,insetInlineEnd:jt,padding:jt,paddingTop:jt,paddingRight:jt,paddingBottom:jt,paddingLeft:jt,paddingBlock:jt,paddingBlockStart:jt,paddingBlockEnd:jt,paddingInline:jt,paddingInlineStart:jt,paddingInlineEnd:jt,margin:jt,marginTop:jt,marginRight:jt,marginBottom:jt,marginLeft:jt,marginBlock:jt,marginBlockStart:jt,marginBlockEnd:jt,marginInline:jt,marginInlineStart:jt,marginInlineEnd:jt,fontSize:jt,backgroundPositionX:jt,backgroundPositionY:jt,...{rotate:Ct,rotateX:Ct,rotateY:Ct,rotateZ:Ct,scale:gt,scaleX:gt,scaleY:gt,scaleZ:gt,skew:Ct,skewX:Ct,skewY:Ct,distance:jt,translateX:jt,translateY:jt,translateZ:jt,x:jt,y:jt,z:jt,perspective:jt,transformPerspective:jt,opacity:mt,originX:Lt,originY:Lt,originZ:jt},zIndex:ci,fillOpacity:mt,strokeOpacity:mt,numOctaves:ci},fi={...di,color:Dt,backgroundColor:Dt,outlineColor:Dt,fill:Dt,stroke:Dt,borderColor:Dt,borderTopColor:Dt,borderRightColor:Dt,borderBottomColor:Dt,borderLeftColor:Dt,filter:ui,WebkitFilter:ui},hi=e=>fi[e];function pi(e,t){let n=hi(e);return n!==ui&&(n=$t),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const mi=new Set(["auto","none","0"]);class gi extends ur{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let s=0;s<e.length;s++){let n=e[s];if("string"==typeof n&&(n=n.trim(),dt(n))){const r=Mr(n,t.current);void 0!==r&&(e[s]=r),s===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!$r.has(n)||2!==e.length)return;const[r,i]=e,a=ii(r),o=ii(i);if(ht(r)!==ht(i)&&nr[n])this.needsMeasurement=!0;else if(a!==o)if(Jn(a)&&Jn(o))for(let s=0;s<e.length;s++){const t=e[s];"string"==typeof t&&(e[s]=parseFloat(t))}else nr[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let r=0;r<e.length;r++)(null===e[r]||ai(e[r]))&&n.push(r);n.length&&function(e,t,n){let r,i=0;for(;i<e.length&&!r;){const t=e[i];"string"==typeof t&&!mi.has(t)&&Ot(t).values.length&&(r=e[i]),i++}if(r&&n)for(const a of t)e[a]=pi(n,r)}(e,n,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=nr[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];void 0!==r&&e.getValue(n,r).jump(r,!1)}measureEndState(){const{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;const r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);const i=n.length-1,a=n[i];n[i]=nr[t](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==a&&void 0===this.finalKeyframe&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const yi=new Set(["opacity","clipPath","filter","transform"]);function vi(e,t,n){if(null==e)return[];if(e instanceof EventTarget)return[e];if("string"==typeof e){let t=document;const r=n?.[e]??t.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e).filter(e=>null!=e)}const bi=(e,t)=>t&&"number"==typeof e?t.transform(e):e;function xi(e){return Te(e)&&"offsetHeight"in e}const{schedule:wi}=et(queueMicrotask,!1),ki={x:!1,y:!1};function Si(){return ki.x||ki.y}function Ei(e,t){const n=vi(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Ti(e,t,n={}){const[r,i,a]=Ei(e,n);return r.forEach(e=>{let n,r=!1,a=!1;const o=t=>{n&&(n(t),n=void 0),e.removeEventListener("pointerleave",l)},s=e=>{r=!1,window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s),a&&(a=!1,o(e))},l=e=>{"touch"!==e.pointerType&&(r?a=!0:o(e))};e.addEventListener("pointerenter",r=>{if("touch"===r.pointerType||Si())return;a=!1;const o=t(e,r);"function"==typeof o&&(n=o,e.addEventListener("pointerleave",l,i))},i),e.addEventListener("pointerdown",()=>{r=!0,window.addEventListener("pointerup",s,i),window.addEventListener("pointercancel",s,i)},i)}),a}const Ci=(e,t)=>!!t&&(e===t||Ci(e,t.parentElement)),Pi=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,ji=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Ni=new Set(["INPUT","SELECT","TEXTAREA"]);const Mi=new WeakSet;function Li(e){return t=>{"Enter"===t.key&&e(t)}}function Ai(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function Di(e){return Pi(e)&&!Si()}const _i=new WeakSet;function Ri(e,t,n={}){const[r,i,a]=Ei(e,n),o=e=>{const r=e.currentTarget;if(!Di(e))return;if(_i.has(e))return;Mi.add(r),n.stopPropagation&&_i.add(e);const a=t(r,e),o=(e,t)=>{window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",l),Mi.has(r)&&Mi.delete(r),Di(e)&&"function"==typeof a&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||Ci(r,e.target))},l=e=>{o(e,!1)};window.addEventListener("pointerup",s,i),window.addEventListener("pointercancel",l,i)};return r.forEach(e=>{var t;(n.useGlobalTarget?window:e).addEventListener("pointerdown",o,i),xi(e)&&(e.addEventListener("focus",e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const r=Li(()=>{if(Mi.has(n))return;Ai(n,"down");const e=Li(()=>{Ai(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>Ai(n,"cancel"),t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)})(e,i)),t=e,ji.has(t.tagName)||!0===t.isContentEditable||e.hasAttribute("tabindex")||(e.tabIndex=0))}),a}function zi(e){return Te(e)&&"ownerSVGElement"in e}const Fi=new WeakMap;let Oi;const Vi=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+"Size"]:zi(r)&&"getBBox"in r?r.getBBox()[t]:r[n],Ii=Vi("inline","width","offsetWidth"),Bi=Vi("block","height","offsetHeight");function $i({target:e,borderBoxSize:t}){Fi.get(e)?.forEach(n=>{n(e,{get width(){return Ii(e,t)},get height(){return Bi(e,t)}})})}function Ui(e){e.forEach($i)}function Hi(e,t){Oi||"undefined"!=typeof ResizeObserver&&(Oi=new ResizeObserver(Ui));const n=vi(e);return n.forEach(e=>{let n=Fi.get(e);n||(n=new Set,Fi.set(e,n)),n.add(t),Oi?.observe(e)}),()=>{n.forEach(e=>{const n=Fi.get(e);n?.delete(t),n?.size||Oi?.unobserve(e)})}}const Wi=new Set;let qi;function Yi(e){return Wi.add(e),qi||(qi=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Wi.forEach(t=>t(e))},window.addEventListener("resize",qi)),()=>{Wi.delete(e),Wi.size||"function"!=typeof qi||(window.removeEventListener("resize",qi),qi=void 0)}}function Xi(e,t){return"function"==typeof e?Yi(e):Hi(e,t)}const Ki=[...ri,Dt,$t],Qi=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Gi=new WeakMap;function Zi(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function Ji(e){return"string"==typeof e||Array.isArray(e)}const ea=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ta=["initial",...ea];function na(e){return Zi(e.animate)||ta.some(t=>Ji(e[t]))}function ra(e){return Boolean(na(e)||e.variants)}const ia={current:null},aa={current:!1},oa="undefined"!=typeof window;const sa=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let la={};function ua(e){la=e}class ca{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ur,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=st.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,tt.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=t.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=Boolean(a),this.isControllingVariants=na(t),this.isVariantNode=ra(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const f in d){const e=d[f];void 0!==l[f]&&Xr(e)&&e.set(l[f])}}mount(e){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=e,Gi.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(aa.current||function(){if(aa.current=!0,oa)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ia.current=e.matches;e.addEventListener("change",t),t()}else ia.current=!1}(),this.shouldReduceMotion=ia.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),nt(this.notifyUpdate),nt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&yi.has(e)&&this.current instanceof HTMLElement){const{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new br({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:De(o)}),l=n(s);return void this.valueSubscriptions.set(e,()=>{l(),s.cancel()})}const n=Zn.has(e);n&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&tt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in la){const t=la[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let n=0;n<sa.length;n++){const t=sa[n];this.propEventSubscriptions[t]&&(this.propEventSubscriptions[t](),delete this.propEventSubscriptions[t]);const r=e["on"+t];r&&(this.propEventSubscriptions[t]=this.on(t,r))}this.prevMotionValues=function(e,t,n){for(const r in t){const i=t[r],a=n[r];if(Xr(i))e.addValue(r,i);else if(Xr(a))e.addValue(r,Hr(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){const t=e.getValue(r);!0===t.liveStyle?t.jump(i):t.hasAnimated||t.set(i)}else{const t=e.getStaticValue(r);e.addValue(r,Hr(void 0!==t?t:i,{owner:e}))}}for(const r in n)void 0===t[r]&&e.removeValue(r);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=Hr(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=void 0===this.latestValues[e]&&this.current?this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];var r;return null!=n&&("string"==typeof n&&(Ee(n)||Ce(n))?n=parseFloat(n):(r=n,!Ki.find(ni(r))&&$t.test(t)&&(n=pi(e,t))),this.setBaseTarget(e,Xr(n)?n.get():n)),Xr(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){const{initial:t}=this.props;let n;if("string"==typeof t||"object"==typeof t){const r=Ir(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&void 0!==n)return n;const r=this.getBaseTargetFromProps(this.props,e);return void 0===r||Xr(r)?void 0!==this.initialValues[e]&&void 0===n?void 0:this.baseTarget[e]:r}on(e,t){return this.events[e]||(this.events[e]=new Ae),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){wi.render(this.render)}}class da extends ca{constructor(){super(...arguments),this.KeyframeResolver=gi}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){const n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Xr(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=\`\${e}\`)}))}}class fa{constructor(e){this.isMounted=!1,this.node=e}update(){}}function ha({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function pa(e){return void 0===e||1===e}function ma({scale:e,scaleX:t,scaleY:n}){return!pa(e)||!pa(t)||!pa(n)}function ga(e){return ma(e)||ya(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ya(e){return va(e.x)||va(e.y)}function va(e){return e&&"0%"!==e}function ba(e,t,n){return n+t*(e-n)}function xa(e,t,n,r,i){return void 0!==i&&(e=ba(e,i,r)),ba(e,n,r)+t}function wa(e,t=0,n=1,r,i){e.min=xa(e.min,t,n,r,i),e.max=xa(e.max,t,n,r,i)}function ka(e,{x:t,y:n}){wa(e.x,t.translate,t.scale,t.originPoint),wa(e.y,n.translate,n.scale,n.originPoint)}const Sa=.999999999999,Ea=1.0000000000001;function Ta(e,t){e.min=e.min+t,e.max=e.max+t}function Ca(e,t,n,r,i=.5){wa(e,t,n,Wt(e.min,e.max,i),r)}function Pa(e,t){Ca(e.x,t.x,t.scaleX,t.scale,t.originX),Ca(e.y,t.y,t.scaleY,t.scale,t.originY)}function ja(e,t){return ha(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}const Na={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ma=Gn.length;function La(e,t,n){const{style:r,vars:i,transformOrigin:a}=e;let o=!1,s=!1;for(const l in t){const e=t[l];if(Zn.has(l))o=!0;else if(ut(l))i[l]=e;else{const t=bi(e,di[l]);l.startsWith("origin")?(s=!0,a[l]=t):r[l]=t}}if(t.transform||(o||n?r.transform=function(e,t,n){let r="",i=!0;for(let a=0;a<Ma;a++){const o=Gn[a],s=e[o];if(void 0===s)continue;let l=!0;if("number"==typeof s)l=s===(o.startsWith("scale")?1:0);else{const e=parseFloat(s);l=o.startsWith("scale")?1===e:0===e}if(!l||n){const e=bi(s,di[o]);l||(i=!1,r+=\`\${Na[o]||o}(\${e}) \`),n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}(t,e.transform,n):r.transform&&(r.transform="none")),s){const{originX:e="50%",originY:t="50%",originZ:n=0}=a;r.transformOrigin=\`\${e} \${t} \${n}\`}}function Aa(e,{style:t,vars:n},r,i){const a=e.style;let o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Da(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const _a={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!jt.test(e))return e;e=parseFloat(e)}return\`\${Da(e,t.target.x)}% \${Da(e,t.target.y)}%\`}},Ra={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=$t.parse(e);if(i.length>5)return r;const a=$t.createTransformer(e),o="number"!=typeof i[0]?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=l;const u=Wt(s,l,.5);return"number"==typeof i[2+o]&&(i[2+o]/=u),"number"==typeof i[3+o]&&(i[3+o]/=u),a(i)}},za={borderRadius:{..._a,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:_a,borderTopRightRadius:_a,borderBottomLeftRadius:_a,borderBottomRightRadius:_a,boxShadow:Ra};function Fa(e,{layout:t,layoutId:n}){return Zn.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!za[e]||"opacity"===e)}function Oa(e,t,n){const r=e.style,i=t?.style,a={};if(!r)return a;for(const o in r)(Xr(r[o])||i&&Xr(i[o])||Fa(o,e)||void 0!==n?.getValue(o)?.liveStyle)&&(a[o]=r[o]);return a}class Va extends da{constructor(){super(...arguments),this.type="html",this.renderInstance=Aa}readValueFromInstance(e,t){if(Zn.has(t))return this.projection?.isProjecting?Xn(t):((e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Kn(n,t)})(e,t);{const r=(n=e,window.getComputedStyle(n)),i=(ut(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return ja(e,t)}build(e,t,n){La(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Oa(e,t,n)}}const Ia={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ba={offset:"strokeDashoffset",array:"strokeDasharray"};const $a=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ua(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},l,u,c){if(La(e,s,u),l)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=c?.transformBox??"fill-box",delete d.transformBox);for(const h of $a)void 0!==d[h]&&(f[h]=d[h],delete d[h]);void 0!==t&&(d.x=t),void 0!==n&&(d.y=n),void 0!==r&&(d.scale=r),void 0!==i&&function(e,t,n=1,r=0,i=!0){e.pathLength=1;const a=i?Ia:Ba;e[a.offset]=""+-r,e[a.array]=\`\${t} \${n}\`}(d,i,a,o,!1)}const Ha=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Wa=e=>"string"==typeof e&&"svg"===e.toLowerCase();function qa(e,t,n){const r=Oa(e,t,n);for(const i in e)if(Xr(e[i])||Xr(t[i])){r[-1!==Gn.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=e[i]}return r}class Ya extends da{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Qi}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Zn.has(t)){const e=hi(t);return e&&e.default||0}return t=Ha.has(t)?t:Qr(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return qa(e,t,n)}build(e,t,n){Ua(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){!function(e,t,n,r){Aa(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Ha.has(i)?i:Qr(i),t.attrs[i])}(e,t,0,r)}mount(e){this.isSVGTag=Wa(e.tagName),super.mount(e)}}const Xa=ta.length;function Ka(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&Ka(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<Xa;n++){const r=ta[n],i=e.props[r];(Ji(i)||!1===i)&&(t[r]=i)}return t}function Qa(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Ga=[...ea].reverse(),Za=ea.length;function Ja(e){return t=>Promise.all(t.map(({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const i=t.map(t=>ti(e,t,n));r=Promise.all(i)}else if("string"==typeof t)r=ti(e,t,n);else{const i="function"==typeof t?Br(e,t,n.custom):t;r=Promise.all(ei(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}(e,t,n)))}function eo(e){let t=Ja(e),n=ro(),r=!0;const i=t=>(n,r)=>{const i=Br(e,r,"exit"===t?e.presenceContext?.custom:void 0);if(i){const{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function a(a){const{props:o}=e,s=Ka(e.parent)||{},l=[],u=new Set;let c={},d=1/0;for(let t=0;t<Za;t++){const f=Ga[t],h=n[f],p=void 0!==o[f]?o[f]:s[f],m=Ji(p),g=f===a?h.isActive:null;!1===g&&(d=t);let y=p===s[f]&&p!==o[f]&&m;if(y&&r&&e.manuallyAnimateOnMount&&(y=!1),h.protectedKeys={...c},!h.isActive&&null===g||!p&&!h.prevProp||Zi(p)||"boolean"==typeof p)continue;if("exit"===f&&h.isActive&&!0!==g){h.prevResolvedValues&&(c={...c,...h.prevResolvedValues});continue}const v=to(h.prevProp,p);let b=v||f===a&&h.isActive&&!y&&m||t>d&&m,x=!1;const w=Array.isArray(p)?p:[p];let k=w.reduce(i(f),{});!1===g&&(k={});const{prevResolvedValues:S={}}=h,E={...S,...k},T=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),h.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in E){const t=k[e],n=S[e];if(c.hasOwnProperty(e))continue;let r=!1;r=Wr(t)&&Wr(n)?!Qa(t,n):t!==n,r?null!=t?T(e):u.add(e):void 0!==t&&u.has(e)?T(e):h.protectedKeys[e]=!0}h.prevProp=p,h.prevResolvedValues=k,h.isActive&&(c={...c,...k}),r&&e.blockInitialAnimation&&(b=!1);const C=y&&v;b&&(!C||x)&&l.push(...w.map(t=>{const n={type:f};if("string"==typeof t&&r&&!C&&e.manuallyAnimateOnMount&&e.parent){const{parent:r}=e,i=Br(r,t);if(r.enteringChildren&&i){const{delayChildren:t}=i.transition||{};n.delay=jr(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){const t={};if("boolean"!=typeof o.initial){const n=Br(e,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{const r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let f=Boolean(l.length);return!r||!1!==o.initial&&o.initial!==o.animate||e.manuallyAnimateOnMount||(f=!1),r=!1,f?t(l):Promise.resolve()}return{animateChanges:a,setActive:function(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;const i=a(t);for(const e in n)n[e].protectedKeys={};return i},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=ro()}}}function to(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!Qa(t,e)}function no(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ro(){return{animate:no(!0),whileInView:no(),whileHover:no(),whileTap:no(),whileDrag:no(),whileFocus:no(),exit:no()}}function io(e,t){e.min=t.min,e.max=t.max}function ao(e,t){io(e.x,t.x),io(e.y,t.y)}function oo(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function so(e){return e.max-e.min}function lo(e,t,n,r=.5){e.origin=r,e.originPoint=Wt(t.min,t.max,e.origin),e.scale=so(n)/so(t),e.translate=Wt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function uo(e,t,n,r){lo(e.x,t.x,n.x,r?r.originX:void 0),lo(e.y,t.y,n.y,r?r.originY:void 0)}function co(e,t,n){e.min=n.min+t.min,e.max=e.min+so(t)}function fo(e,t,n){e.min=t.min-n.min,e.max=e.min+so(t)}function ho(e,t,n){fo(e.x,t.x,n.x),fo(e.y,t.y,n.y)}function po(e,t,n,r,i){return e=ba(e-=t,1/n,r),void 0!==i&&(e=ba(e,1/i,r)),e}function mo(e,t,[n,r,i],a,o){!function(e,t=0,n=1,r=.5,i,a=e,o=e){Pt.test(t)&&(t=parseFloat(t),t=Wt(o.min,o.max,t/100)-o.min);if("number"!=typeof t)return;let s=Wt(a.min,a.max,r);e===a&&(s-=t),e.min=po(e.min,t,n,s,i),e.max=po(e.max,t,n,s,i)}(e,t[n],t[r],t[i],t.scale,a,o)}const go=["x","scaleX","originX"],yo=["y","scaleY","originY"];function vo(e,t,n,r){mo(e.x,t,go,n?n.x:void 0,r?r.x:void 0),mo(e.y,t,yo,n?n.y:void 0,r?r.y:void 0)}function bo(e){return 0===e.translate&&1===e.scale}function xo(e){return bo(e.x)&&bo(e.y)}function wo(e,t){return e.min===t.min&&e.max===t.max}function ko(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function So(e,t){return ko(e.x,t.x)&&ko(e.y,t.y)}function Eo(e){return so(e.x)/so(e.y)}function To(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Co(e){return[e("x"),e("y")]}const Po=["TopLeft","TopRight","BottomLeft","BottomRight"],jo=Po.length,No=e=>"string"==typeof e?parseFloat(e):e,Mo=e=>"number"==typeof e||jt.test(e);function Lo(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Ao=_o(0,.5,We),Do=_o(.5,.95,je);function _o(e,t,n){return r=>r<e?0:r>t?1:n(Le(e,t,r))}function Ro(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const zo=(e,t)=>e.depth-t.depth;class Fo{constructor(){this.children=[],this.isDirty=!1}add(e){xe(this.children,e),this.isDirty=!0}remove(e){we(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(zo),this.isDirty=!1,this.children.forEach(e)}}function Oo(e){return Xr(e)?e.get():e}class Vo{constructor(){this.members=[]}add(e){xe(this.members,e);for(let t=this.members.length-1;t>=0;t--){const n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;const r=n.instance;r&&!1===r.isConnected&&!1!==n.isPresent&&!n.snapshot&&we(this.members,n)}e.scheduleRender()}remove(e){if(we(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex(t=>e===t);if(0===t)return!1;let n;for(let r=t;r>=0;r--){const e=this.members[r],t=e.instance;if(!1!==e.isPresent&&(!t||!1!==t.isConnected)){n=e;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender();const r=n.options.layoutDependency,i=e.options.layoutDependency;if(!(void 0!==r&&void 0!==i&&r===i)){const r=n.instance;r&&!1===r.isConnected&&!n.snapshot||(e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0))}const{crossfade:a}=e.options;!1===a&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Io={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Bo=["","X","Y","Z"];let $o=0;function Uo(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Ho(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Zr(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",tt,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Ho(r)}function Wo({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=$o++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Xo),this.nodes.forEach(ts),this.nodes.forEach(ns),this.nodes.forEach(Ko)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Fo)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Ae),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;var n;this.isSVG=zi(t)&&!(zi(n=t)&&"svg"===n.tagName),this.instance=t;const{layoutId:r,layout:i,visualElement:a}=this.options;if(a&&!a.current&&a.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(i||r)&&(this.isLayoutDirty=!0),e){let n,r=0;const i=()=>this.root.updateBlockedByResize=!1;tt.read(()=>{r=window.innerWidth}),e(t,()=>{const e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=st.now(),r=({timestamp:i})=>{const a=i-n;a>=t&&(nt(r),e(a-t))};return tt.setup(r,!0),()=>nt(r)}(i,250),Io.hasAnimatedSinceResize&&(Io.hasAnimatedSinceResize=!1,this.nodes.forEach(es)))})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&a&&(r||i)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const i=this.options.transition||a.getDefaultTransition()||ls,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=a.getProps(),l=!this.targetLayout||!So(this.targetLayout,r),u=!t&&n;if(this.options.layoutRoot||this.resumeFrom||u||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const t={...Fr(i,"layout"),onPlay:o,onComplete:s};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,u)}else t||es(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),nt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(rs),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ho(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let i=0;i<this.path.length;i++){const e=this.path[i];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:t,layout:n}=this.options;if(void 0===t&&!n)return;const r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(Go);if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(Zo);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Jo),this.nodes.forEach(qo),this.nodes.forEach(Yo)):this.nodes.forEach(Zo),this.clearAllSnapshots();const e=st.now();rt.delta=ke(0,1e3/60,e-rt.timestamp),rt.timestamp=e,rt.isProcessing=!0,it.update.process(rt),it.preRender.process(rt),it.render.process(rt),rt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,wi.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Qo),this.sharedNodes.forEach(is)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,tt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){tt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||so(this.snapshot.measuredBox.x)||so(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let n=0;n<this.path.length;n++){this.path[n].updateScroll()}const e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){const t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;const e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!xo(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||ga(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let n=this.removeElementScroll(t);var r;return e&&(n=this.removeTransform(n)),ds((r=n).x),ds(r.y),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:e}=this.options;if(!e)return{x:{min:0,max:0},y:{min:0,max:0}};const t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(hs))){const{scroll:e}=this.root;e&&(Ta(t.x,e.offset.x),Ta(t.y,e.offset.y))}return t}removeElementScroll(e){const t={x:{min:0,max:0},y:{min:0,max:0}};if(ao(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){const r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&ao(t,e),Ta(t.x,i.offset.x),Ta(t.y,i.offset.y))}return t}applyTransform(e,t=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};ao(n,e);for(let r=0;r<this.path.length;r++){const e=this.path[r];!t&&e.options.layoutScroll&&e.scroll&&e!==e.root&&Pa(n,{x:-e.scroll.offset.x,y:-e.scroll.offset.y}),ga(e.latestValues)&&Pa(n,e.latestValues)}return ga(this.latestValues)&&Pa(n,this.latestValues),n}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};ao(t,e);for(let n=0;n<this.path.length;n++){const e=this.path[n];if(!e.instance)continue;if(!ga(e.latestValues))continue;ma(e.latestValues)&&e.updateSnapshot();const r=Qi();ao(r,e.measurePageBox()),vo(t,e.latestValues,e.snapshot?e.snapshot.layoutBox:void 0,r)}return ga(this.latestValues)&&vo(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==rt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){const t=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=t.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=t.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=t.isSharedProjectionDirty);const n=Boolean(this.resumingFrom)||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:r,layoutId:i}=this.options;if(!this.layout||!r&&!i)return;this.resolvedRelativeTargetAt=rt.timestamp;const a=this.getClosestProjectingParent();var o,s,l;(a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta)&&(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),o=this.target,s=this.relativeTarget,l=this.relativeParent.target,co(o.x,s.x,l.x),co(o.y,s.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):ao(this.target,this.layout.layoutBox),ka(this.target,this.targetDelta)):ao(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,a&&Boolean(a.resumingFrom)===Boolean(this.resumingFrom)&&!a.options.layoutScroll&&a.target&&1!==this.animationProgress?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(this.parent&&!ma(this.parent.latestValues)&&!ya(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},ho(this.relativeTargetOrigin,t,n),ao(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const e=this.getLead(),t=Boolean(this.resumingFrom)||this!==e;let n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===rt.timestamp&&(n=!1),n)return;const{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!r&&!i)return;ao(this.layoutCorrected,this.layout.layoutBox);const a=this.treeScale.x,o=this.treeScale.y;!function(e,t,n,r=!1){const i=n.length;if(!i)return;let a,o;t.x=t.y=1;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;const{visualElement:i}=a.options;i&&i.props.style&&"contents"===i.props.style.display||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Pa(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ka(e,o)),r&&ga(a.latestValues)&&Pa(e,a.latestValues))}t.x<Ea&&t.x>Sa&&(t.x=1),t.y<Ea&&t.y>Sa&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,t),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox,e.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:s}=e;s?(this.projectionDelta&&this.prevProjectionDelta?(oo(this.prevProjectionDelta.x,this.projectionDelta.x),oo(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),uo(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===a&&this.treeScale.y===o&&To(this.projectionDelta.x,this.prevProjectionDelta.x)&&To(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",s))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const o={x:{min:0,max:0},y:{min:0,max:0}},s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,c=Boolean(s&&!u&&!0===this.options.crossfade&&!this.path.some(ss));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,f,h,p,m,g;as(a.x,e.x,n),as(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ho(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),h=this.relativeTarget,p=this.relativeTargetOrigin,m=o,g=n,os(h.x,p.x,m.x,g),os(h.y,p.y,m.y,g),d&&(l=this.relativeTarget,f=d,wo(l.x,f.x)&&wo(l.y,f.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),ao(d,this.relativeTarget)),s&&(this.animationValues=i,function(e,t,n,r,i,a){i?(e.opacity=Wt(0,n.opacity??1,Ao(r)),e.opacityExit=Wt(t.opacity??1,0,Do(r))):a&&(e.opacity=Wt(t.opacity??1,n.opacity??1,r));for(let o=0;o<jo;o++){const i=\`border\${Po[o]}Radius\`;let a=Lo(t,i),s=Lo(n,i);void 0===a&&void 0===s||(a||(a=0),s||(s=0),0===a||0===s||Mo(a)===Mo(s)?(e[i]=Math.max(Wt(No(a),No(s),r),0),(Pt.test(s)||Pt.test(a))&&(e[i]+="%")):e[i]=s)}(t.rotate||n.rotate)&&(e.rotate=Wt(t.rotate||0,n.rotate||0,r))}(i,r,this.latestValues,n,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(nt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=tt.update(()=>{Io.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Hr(0)),this.currentAnimation=function(e,t,n){const r=Xr(e)?e:Hr(e);return r.start(Or("",r,t,n)),r.animation}(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&fs(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=so(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=so(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}ao(t,n),Pa(t,i),uo(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Vo);this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){const{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&Uo("z",e,r,this.animationValues);for(let i=0;i<Bo.length;i++)Uo(\`rotate\${Bo[i]}\`,e,r,this.animationValues),Uo(\`skew\${Bo[i]}\`,e,r,this.animationValues);e.render();for(const i in r)e.setStaticValue(i,r[i]),this.animationValues&&(this.animationValues[i]=r[i]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(e.visibility="hidden");const n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,e.visibility="",e.opacity="",e.pointerEvents=Oo(t?.pointerEvents)||"",void(e.transform=n?n(this.latestValues,""):"none");const r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target)return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=Oo(t?.pointerEvents)||""),void(this.hasProjected&&!ga(this.latestValues)&&(e.transform=n?n({},""):"none",this.hasProjected=!1));e.visibility="";const i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=function(e,t,n){let r="";const i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=\`translate3d(\${i}px, \${a}px, \${o}px) \`),1===t.x&&1===t.y||(r+=\`scale(\${1/t.x}, \${1/t.y}) \`),n){const{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=\`perspective(\${e}px) \${r}\`),t&&(r+=\`rotate(\${t}deg) \`),i&&(r+=\`rotateX(\${i}deg) \`),a&&(r+=\`rotateY(\${a}deg) \`),o&&(r+=\`skewX(\${o}deg) \`),s&&(r+=\`skewY(\${s}deg) \`)}const s=e.x.scale*t.x,l=e.y.scale*t.y;return 1===s&&1===l||(r+=\`scale(\${s}, \${l})\`),r||"none"}(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;const{x:o,y:s}=this.projectionDelta;e.transformOrigin=\`\${100*o.origin}% \${100*s.origin}% 0\`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?void 0!==i.opacity?i.opacity:"":void 0!==i.opacityExit?i.opacityExit:0;for(const l in za){if(void 0===i[l])continue;const{correct:t,applyTo:n,isCSSVariable:o}=za[l],s="none"===a?i[l]:t(i[l],r);if(n){const t=n.length;for(let r=0;r<t;r++)e[n[r]]=s}else o?this.options.visualElement.renderState.vars[l]=s:e[l]=s}this.options.layoutId&&(e.pointerEvents=r===this?Oo(t?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Go),this.root.sharedNodes.clear()}}}function qo(e){e.updateLayout()}function Yo(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;"size"===i?Co(e=>{const r=a?t.measuredBox[e]:t.layoutBox[e],i=so(r);r.min=n[e].min,r.max=r.min+i}):fs(i,t.layoutBox,n)&&Co(r=>{const i=a?t.measuredBox[r]:t.layoutBox[r],o=so(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});const o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};uo(o,n,t.layoutBox);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};a?uo(s,e.applyTransform(r,!0),t.measuredBox):uo(s,n,t.layoutBox);const l=!xo(o);let u=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:i,layout:a}=r;if(i&&a){const o={x:{min:0,max:0},y:{min:0,max:0}};ho(o,t.layoutBox,i.layoutBox);const s={x:{min:0,max:0},y:{min:0,max:0}};ho(s,n,a.layoutBox),So(o,s)||(u=!0),r.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=o,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Xo(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Ko(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Qo(e){e.clearSnapshot()}function Go(e){e.clearMeasurements()}function Zo(e){e.isLayoutDirty=!1}function Jo(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function es(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ts(e){e.resolveTargetDelta()}function ns(e){e.calcProjection()}function rs(e){e.resetSkewAndRotation()}function is(e){e.removeLeadSnapshot()}function as(e,t,n){e.translate=Wt(t.translate,0,n),e.scale=Wt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function os(e,t,n,r){e.min=Wt(t.min,n.min,r),e.max=Wt(t.max,n.max,r)}function ss(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const ls={duration:.45,ease:[.4,0,.1,1]},us=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),cs=us("applewebkit/")&&!us("chrome/")?Math.round:je;function ds(e){e.min=cs(e.min),e.max=cs(e.max)}function fs(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=Eo(t),i=Eo(n),a=.2,!(Math.abs(r-i)<=a));var r,i,a}function hs(e){return e!==e.root&&e.scroll?.wasRoot}const ps=Wo({attachResizeListener:(e,t)=>Ro(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),ms={current:void 0},gs=Wo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ms.current){const e=new ps({});e.mount(window),e.setOptions({layoutScroll:!0}),ms.current=e}return ms.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),ys=f.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function vs(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function bs(...e){return f.useCallback(function(...e){return t=>{let n=!1;const r=e.map(e=>{const r=vs(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():vs(e[t],null)}}}}(...e),e)}class xs extends f.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent&&!1!==this.props.pop){const e=t.offsetParent,n=xi(e)&&e.offsetWidth||0,r=xi(e)&&e.offsetHeight||0,i=this.props.sizeRef.current;i.height=t.offsetHeight||0,i.width=t.offsetWidth||0,i.top=t.offsetTop,i.left=t.offsetLeft,i.right=n-i.width-i.left,i.bottom=r-i.height-i.top}return null}componentDidUpdate(){}render(){return this.props.children}}function ws({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){const o=f.useId(),l=f.useRef(null),u=f.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=f.useContext(ys),d=e.props?.ref??e?.ref,h=bs(l,d);return f.useInsertionEffect(()=>{const{width:e,height:s,top:d,left:f,right:h,bottom:p}=u.current;if(t||!1===a||!l.current||!e||!s)return;const m="left"===n?\`left: \${f}\`:\`right: \${h}\`,g="bottom"===r?\`bottom: \${p}\`:\`top: \${d}\`;l.current.dataset.motionPopId=o;const y=document.createElement("style");c&&(y.nonce=c);const v=i??document.head;return v.appendChild(y),y.sheet&&y.sheet.insertRule(\`\\n [data-motion-pop-id="\${o}"] {\\n position: absolute !important;\\n width: \${e}px !important;\\n height: \${s}px !important;\\n \${m}px !important;\\n \${g}px !important;\\n }\\n \`),()=>{v.contains(y)&&v.removeChild(y)}},[t]),s.jsx(xs,{isPresent:t,childRef:l,sizeRef:u,pop:a,children:!1===a?e:f.cloneElement(e,{ref:h})})}const ks=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:l,anchorY:u,root:c})=>{const d=ge(Ss),h=f.useId();let p=!0,m=f.useMemo(()=>(p=!1,{id:h,initial:t,isPresent:n,custom:i,onExitComplete:e=>{d.set(e,!0);for(const t of d.values())if(!t)return;r&&r()},register:e=>(d.set(e,!1),()=>d.delete(e))}),[n,d,r]);return a&&p&&(m={...m}),f.useMemo(()=>{d.forEach((e,t)=>d.set(t,!1))},[n]),f.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),e=s.jsx(ws,{pop:"popLayout"===o,isPresent:n,anchorX:l,anchorY:u,root:c,children:e}),s.jsx(be.Provider,{value:m,children:e})};function Ss(){return new Map}function Es(e=!0){const t=f.useContext(be);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,a=f.useId();f.useEffect(()=>{if(e)return i(a)},[e]);const o=f.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const Ts=e=>e.key||"";function Cs(e){const t=[];return f.Children.forEach(e,e=>{f.isValidElement(e)&&t.push(e)}),t}const Ps=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a="sync",propagate:o=!1,anchorX:l="left",anchorY:u="top",root:c})=>{const[d,h]=Es(o),p=f.useMemo(()=>Cs(e),[e]),m=o&&!d?[]:p.map(Ts),g=f.useRef(!0),y=f.useRef(p),v=ge(()=>new Map),b=f.useRef(new Set),[x,w]=f.useState(p),[k,S]=f.useState(p);ve(()=>{g.current=!1,y.current=p;for(let e=0;e<k.length;e++){const t=Ts(k[e]);m.includes(t)?(v.delete(t),b.current.delete(t)):!0!==v.get(t)&&v.set(t,!1)}},[k,m.length,m.join("-")]);const E=[];if(p!==x){let e=[...p];for(let t=0;t<k.length;t++){const n=k[t],r=Ts(n);m.includes(r)||(e.splice(t,0,n),E.push(n))}return"wait"===a&&E.length&&(e=E),S(Cs(e)),w(p),null}const{forceRender:T}=f.useContext(me);return s.jsx(s.Fragment,{children:k.map(e=>{const f=Ts(e),x=!(o&&!d)&&(p===k||m.includes(f));return s.jsx(ks,{isPresent:x,initial:!(g.current&&!n)&&void 0,custom:t,presenceAffectsLayout:i,mode:a,root:c,onExitComplete:x?void 0:()=>{if(b.current.has(f))return;if(b.current.add(f),!v.has(f))return;v.set(f,!0);let e=!0;v.forEach(t=>{t||(e=!1)}),e&&(T?.(),S(y.current),o&&h?.(),r&&r())},anchorX:l,anchorY:u,children:e},f)})})},js=f.createContext({strict:!1}),Ns={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Ms=!1;function Ls(){return function(){if(Ms)return;const e={};for(const t in Ns)e[t]={isEnabled:e=>Ns[t].some(t=>!!e[t])};ua(e),Ms=!0}(),la}const As=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Ds(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||As.has(e)}let _s=e=>!Ds(e);try{"function"==typeof(Rs=require("@emotion/is-prop-valid").default)&&(_s=e=>e.startsWith("on")?!Ds(e):Rs(e))}catch{}var Rs;const zs=f.createContext({});function Fs(e){const{initial:t,animate:n}=function(e,t){if(na(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Ji(t)?t:void 0,animate:Ji(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,f.useContext(zs));return f.useMemo(()=>({initial:t,animate:n}),[Os(t),Os(n)])}function Os(e){return Array.isArray(e)?e.join(" "):e}const Vs=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Is(e,t,n){for(const r in t)Xr(t[r])||Fa(r,n)||(e[r]=t[r])}function Bs(e,t){const n={};return Is(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return f.useMemo(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return La(n,t,e),Object.assign({},n.vars,n.style)},[t])}(e,t)),n}function $s(e,t){const n={},r=Bs(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Us=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function Hs(e,t,n,r){const i=f.useMemo(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Ua(n,t,Wa(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){const t={};Is(t,e.style,e),i.style={...t,...i.style}}return i}const Ws=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function qs(e){return"string"==typeof e&&!e.includes("-")&&!!(Ws.indexOf(e)>-1||/[A-Z]/u.test(e))}function Ys(e,t,n,{latestValues:r},i,a=!1,o){const s=(o??qs(e)?Hs:$s)(t,r,i,e),l=function(e,t,n){const r={};for(const i in e)"values"===i&&"object"==typeof e.values||(_s(i)||!0===n&&Ds(i)||!t&&!Ds(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}(t,"string"==typeof e,a),u=e!==f.Fragment?{...l,...s,ref:n}:{},{children:c}=t,d=f.useMemo(()=>Xr(c)?c.get():c,[c]);return f.createElement(e,{...u,children:d})}function Xs(e,t,n,r){const i={},a=r(e,{});for(const f in a)i[f]=Oo(a[f]);let{initial:o,animate:s}=e;const l=na(e),u=ra(e);t&&u&&!l&&!1!==e.inherit&&(void 0===o&&(o=t.initial),void 0===s&&(s=t.animate));let c=!!n&&!1===n.initial;c=c||!1===o;const d=c?s:o;if(d&&"boolean"!=typeof d&&!Zi(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){const r=Ir(e,t[n]);if(r){const{transitionEnd:e,transition:t,...n}=r;for(const r in n){let e=n[r];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(i[r]=e)}for(const r in e)i[r]=e[r]}}}return i}const Ks=e=>(t,n)=>{const r=f.useContext(zs),i=f.useContext(be),a=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Xs(n,r,i,e),renderState:t()}}(e,t,r,i);return n?a():ge(a)},Qs=Ks({scrapeMotionValuesFromProps:Oa,createRenderState:Vs}),Gs=Ks({scrapeMotionValuesFromProps:qa,createRenderState:Us}),Zs=Symbol.for("motionComponentSymbol");function Js(e,t,n){const r=f.useRef(n);f.useInsertionEffect(()=>{r.current=n});const i=f.useRef(null);return f.useCallback(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());const a=r.current;if("function"==typeof a)if(n){const e=a(n);"function"==typeof e&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n)},[t])}const el=f.createContext({});function tl(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function nl(e,t,n,r,i,a){const{visualElement:o}=f.useContext(zs),s=f.useContext(js),l=f.useContext(be),u=f.useContext(ys),c=u.reducedMotion,d=u.skipAnimations,h=f.useRef(null),p=f.useRef(!1);r=r||s.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:o,props:n,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:c,skipAnimations:d,isSVG:a}),p.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const m=h.current,g=f.useContext(el);!m||m.projection||!i||"html"!==m.type&&"svg"!==m.type||function(e,t,n,r){const{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:rl(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:Boolean(o)||s&&tl(s),visualElement:e,animationType:"string"==typeof a?a:"both",initialPromotionConfig:r,crossfade:c,layoutScroll:l,layoutRoot:u})}(h.current,n,i,g);const y=f.useRef(!1);f.useInsertionEffect(()=>{m&&y.current&&m.update(n,l)});const v=n[Gr],b=f.useRef(Boolean(v)&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return ve(()=>{p.current=!0,m&&(y.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),b.current&&m.animationState&&m.animationState.animateChanges())}),f.useEffect(()=>{m&&(!b.current&&m.animationState&&m.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),b.current=!1),m.enteringChildren=void 0)}),m}function rl(e){if(e)return!1!==e.options.allowProjection?e.projection:rl(e.parent)}function il(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&function(e){const t=Ls();for(const n in e)t[n]={...t[n],...e[n]};ua(t)}(r);const a=n?"svg"===n:qs(e),o=a?Gs:Qs;function l(n,r){let l;const u={...f.useContext(ys),...n,layoutId:al(n)},{isStatic:c}=u,d=Fs(n),h=o(n,c);if(!c&&ye){f.useContext(js).strict;const t=function(e){const t=Ls(),{drag:n,layout:r}=t;if(!n&&!r)return{};const i={...n,...r};return{MeasureLayout:n?.isEnabled(e)||r?.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(u);l=t.MeasureLayout,d.visualElement=nl(e,h,u,i,t.ProjectionNode,a)}return s.jsxs(zs.Provider,{value:d,children:[l&&d.visualElement?s.jsx(l,{visualElement:d.visualElement,...u}):null,Ys(e,n,Js(h,d.visualElement,r),h,c,t,a)]})}l.displayName=\`motion.\${"string"==typeof e?e:\`create(\${e.displayName??e.name??""})\`}\`;const u=f.forwardRef(l);return u[Zs]=e,u}function al({layoutId:e}){const t=f.useContext(me).id;return t&&void 0!==e?t+"-"+e:e}function ol(e,t){if("undefined"==typeof Proxy)return il;const n=new Map,r=(n,r)=>il(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>"create"===a?r:(n.has(a)||n.set(a,il(a,void 0,e,t)),n.get(a))})}const sl=(e,t)=>t.isSVG??qs(e)?new Ya(t):new Va(t,{allowProjection:e!==f.Fragment});let ll=0;const ul={animation:{Feature:class extends fa{constructor(e){super(e),e.animationState||(e.animationState=eo(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Zi(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends fa{constructor(){super(...arguments),this.id=ll++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then(()=>{t(this.id)})}mount(){const{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function cl(e){return{point:{x:e.pageX,y:e.pageY}}}function dl(e,t,n,r){return Ro(e,t,(e=>t=>Pi(t)&&e(t,cl(t)))(n),r)}const fl=({current:e})=>e?e.ownerDocument.defaultView:null,hl=(e,t)=>Math.abs(e-t);const pl=new Set(["auto","scroll"]);class ml{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=vl(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=hl(e.x,t.x),r=hl(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;const{point:r}=e,{timestamp:i}=rt;this.history.push({...r,timestamp:i});const{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=gl(t,this.transformPagePoint),tt.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||i&&i(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const a=vl("pointercancel"===e.type?this.lastMoveEventInfo:gl(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Pi(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;const s=gl(cl(e),this.transformPagePoint),{point:l}=s,{timestamp:u}=rt;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=t;c&&c(e,vl(s,this.history)),this.removeListeners=Me(dl(this.contextWindow,"pointermove",this.handlePointerMove),dl(this.contextWindow,"pointerup",this.handlePointerUp),dl(this.contextWindow,"pointercancel",this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){const e=getComputedStyle(t);(pl.has(e.overflowX)||pl.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const t=this.scrollPositions.get(e);if(!t)return;const n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i=r.x-t.x,a=r.y-t.y;0===i&&0===a||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i,this.lastMoveEventInfo.point.y+=a):this.history.length>0&&(this.history[0].x-=i,this.history[0].y-=a),this.scrollPositions.set(e,r),tt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),nt(this.updatePoint)}}function gl(e,t){return t?{point:t(e.point)}:e}function yl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function vl({point:e},t){return{point:e,delta:yl(e,xl(t)),offset:yl(e,bl(t)),velocity:wl(t,.1)}}function bl(e){return e[0]}function xl(e){return e[e.length-1]}function wl(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=xl(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>De(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>2*De(t)&&(r=e[1]);const a=_e(i.timestamp-r.timestamp);if(0===a)return{x:0,y:0};const o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function kl(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Sl(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}const El=.35;function Tl(e,t,n){return{min:Cl(e,t),max:Cl(e,n)}}function Cl(e,t){return"number"==typeof e?e:e[t]||0}const Pl=new WeakMap;class jl{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){const{presenceContext:r}=this.visualElement;if(r&&!1===r.isPresent)return;const{dragSnapToOrigin:i}=this.getProps();this.panSession=new ml(e,{onSessionStart:e=>{t&&this.snapToCursor(cl(e).point),this.stopAnimation()},onStart:(e,t)=>{const{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(a=n)||"y"===a?ki[a]?null:(ki[a]=!0,()=>{ki[a]=!1}):ki.x||ki.y?null:(ki.x=ki.y=!0,()=>{ki.x=ki.y=!1}),!this.openDragLock))return;var a;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Co(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Pt.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];if(r){t=so(r)*(parseFloat(t)/100)}}}this.originPoint[e]=t}),i&&tt.update(()=>i(e,t),!1,!0),Kr(this.visualElement,"transform");const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:o}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(o),void(null!==this.currentDirection&&i&&i(this.currentDirection));this.updateAxis("x",t.point,o),this.updateAxis("y",t.point,o),this.visualElement.render(),a&&tt.update(()=>a(e,t),!1,!0)},onSessionEnd:(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,distanceThreshold:n,contextWindow:fl(this.visualElement),element:this.visualElement.current})}stop(e,t){const n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;const{velocity:a}=r;this.startAnimation(a);const{onDragEnd:o}=this.getProps();o&&tt.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!Ml(e,r,this.currentDirection))return;const i=this.getAxisMotionValue(e);let a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=function(e,{min:t,max:n},r){return void 0!==t&&e<t?e=r?Wt(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?Wt(n,e,r.max):Math.min(e,n)),e}(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){const{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&tl(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!n)&&function(e,{top:t,left:n,bottom:r,right:i}){return{x:kl(e.x,n,i),y:kl(e.y,t,r)}}(n.layoutBox,e),this.elastic=function(e=El){return!1===e?e=0:!0===e&&(e=El),{x:Tl(e,"left","right"),y:Tl(e,"top","bottom")}}(t),r!==this.constraints&&!tl(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Co(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!tl(e))return!1;const n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const i=function(e,t,n){const r=ja(e,n),{scroll:i}=t;return i&&(Ta(r.x,i.offset.x),Ta(r.y,i.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let a=function(e,t){return{x:Sl(e.x,t.x),y:Sl(e.y,t.y)}}(r.layout.layoutBox,i);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(a));this.hasMutatedConstraints=!!e,e&&(a=ha(e))}return a}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},l=Co(o=>{if(!Ml(o,t,this.currentDirection))return;let l=s&&s[o]||{};a&&(l={min:0,max:0});const u=r?200:1e6,c=r?40:1e7,d={type:"inertia",velocity:n?e[o]:0,bounceStiffness:u,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(o,d)});return Promise.all(l).then(o)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return Kr(this.visualElement,e),n.start(Or(e,n,0,t,this.visualElement,!1))}stopAnimation(){Co(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const t=\`_drag\${e.toUpperCase()}\`,n=this.visualElement.getProps(),r=n[t];return r||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Co(t=>{const{drag:n}=this.getProps();if(!Ml(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-Wt(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!tl(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Co(e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=so(e),i=so(t);return i>r?n=Le(t.min,t.max-r,e.min):r>i&&(n=Le(e.min,e.max-i,t.min)),ke(0,1,n)}({min:n,max:n},this.constraints[e])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Co(t=>{if(!Ml(t,e,null))return;const n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(Wt(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Pl.set(this.visualElement,this);const e=this.visualElement.current,t=dl(e,"pointerdown",t=>{const{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&function(e){return Ni.has(e.tagName)||!0===e.isContentEditable}(i);n&&r&&!a&&this.start(t)});let n;const r=()=>{const{dragConstraints:t}=this.getProps();tl(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(e,t,n){const r=Xi(e,Nl(n)),i=Xi(t,Nl(n));return()=>{r(),i()}}(e,t.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,a=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),tt.read(r);const o=Ro(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Co(t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())});return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=El,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}}function Nl(e){let t=!0;return()=>{t?t=!1:e()}}function Ml(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const Ll=e=>(t,n)=>{e&&tt.update(()=>e(t,n),!1,!0)};let Al=!1;class Dl extends f.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Al&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Io.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Al=!0,r||e.layoutDependency!==t||void 0===t||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||tt.postRender(()=>{const e=a.getStack();e&&e.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),wi.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Al=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function _l(e){const[t,n]=Es(),r=f.useContext(me);return s.jsx(Dl,{...e,layoutGroup:r,switchLayoutGroup:f.useContext(el),isPresent:t,safeToRemove:n})}const Rl={pan:{Feature:class extends fa{constructor(){super(...arguments),this.removePointerDownListener=je}onPointerDown(e){this.session=new ml(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:fl(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Ll(e),onStart:Ll(t),onMove:Ll(n),onEnd:(e,t)=>{delete this.session,r&&tt.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=dl(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends fa{constructor(e){super(e),this.removeGroupControls=je,this.removeListeners=je,this.controls=new jl(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||je}update(){const{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:gs,MeasureLayout:_l}};function zl(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);const i=r["onHover"+n];i&&tt.postRender(()=>i(t,cl(t)))}function Fl(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap","Start"===n);const i=r["onTap"+("End"===n?"":n)];i&&tt.postRender(()=>i(t,cl(t)))}const Ol=new WeakMap,Vl=new WeakMap,Il=e=>{const t=Ol.get(e.target);t&&t(e)},Bl=e=>{e.forEach(Il)};function $l(e,t,n){const r=function({root:e,...t}){const n=e||document;Vl.has(n)||Vl.set(n,{});const r=Vl.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Bl,{root:e,...t})),r[i]}(t);return Ol.set(e,n),r.observe(e),()=>{Ol.delete(e),r.unobserve(e)}}const Ul={some:0,all:1};const Hl=ol({...ul,...{inView:{Feature:class extends fa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Ul[r]};return $l(this.node.current,a,e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,i&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends fa{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Ri(e,(e,t)=>(Fl(this.node,t,"Start"),(e,{success:t})=>Fl(this.node,e,t?"End":"Cancel")),{useGlobalTarget:t,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends fa{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Me(Ro(this.node.current,"focus",()=>this.onFocus()),Ro(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends fa{mount(){const{current:e}=this.node;e&&(this.unmount=Ti(e,(e,t)=>(zl(this.node,t,"Start"),e=>zl(this.node,e,"End"))))}unmount(){}}}},...Rl,...{layout:{ProjectionNode:gs,MeasureLayout:_l}}},sl);function Wl({label:e,value:t,suffix:n,decimals:r=0,icon:i,delay:a=0}){const o=f.useRef(null),l=f.useRef(0);return f.useEffect(()=>{o.current&&t!==l.current&&(!function(e,t,n){let r=null;requestAnimationFrame(function i(a){r||(r=a);const o=Math.min((a-r)/800,1),s=1-Math.pow(1-o,4),l=t*s;e.textContent=n>0?l.toFixed(n):String(Math.round(l)),o<1&&requestAnimationFrame(i)})}(o.current,t,r),l.current=t)},[t,r]),s.jsxs(Hl.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:a},className:"flex-1 min-w-[140px] p-4 rounded-xl bg-bg-surface-1 border border-border/50 flex flex-col gap-2 group hover:border-accent/30 transition-all duration-300",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"p-2 rounded-lg bg-bg-surface-2 group-hover:bg-accent/10 transition-colors",children:s.jsx(i,{className:"w-4 h-4 text-text-muted group-hover:text-accent transition-colors"})}),s.jsx("span",{className:"text-[10px] font-mono text-text-muted uppercase tracking-wider",children:e})]}),s.jsxs("div",{className:"flex items-baseline gap-1 mt-1",children:[s.jsx("span",{ref:o,className:"text-2xl font-bold text-text-primary tracking-tight",children:r>0?t.toFixed(r):t}),n&&s.jsx("span",{className:"text-xs text-text-muted font-medium",children:n})]})]})}function ql({totalHours:e,featuresShipped:t,bugsFixed:n,complexSolved:r,currentStreak:i,filesTouched:a}){return s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-8",children:[s.jsx(Wl,{label:"Active Hours",value:e,suffix:"hrs",decimals:1,icon:Z,delay:.1}),s.jsx(Wl,{label:"Features",value:t,icon:oe,delay:.15}),s.jsx(Wl,{label:"Bugs Fixed",value:n,icon:Y,delay:.2}),s.jsx(Wl,{label:"Complex",value:r,icon:q,delay:.25}),s.jsx(Wl,{label:"Streak",value:i,suffix:"days",icon:he,delay:.3}),s.jsx(Wl,{label:"Files",value:a,icon:J,delay:.35})]})}const Yl={"claude-code":"#d4a04a",cursor:"#00b4d8",copilot:"#6e40c9",windsurf:"#38bdf8","github-copilot":"#6e40c9",aider:"#4ade80",continue:"#f97316",cody:"#ff6b6b",tabby:"#a78bfa",roo:"#f472b6"},Xl={"claude-code":"Claude Code",cursor:"Cursor",copilot:"GitHub Copilot",windsurf:"Windsurf","github-copilot":"GitHub Copilot",aider:"Aider",continue:"Continue",cody:"Sourcegraph Cody",tabby:"TabbyML",roo:"Roo Code",mcp:"MCP Client","gemini-cli":"Gemini CLI"},Kl={"claude-code":"CC",cursor:"Cu",copilot:"CP",windsurf:"WS","github-copilot":"CP",aider:"Ai",continue:"Co",cody:"Cy",tabby:"Tb",roo:"Ro",mcp:"MC","gemini-cli":"GC"},Ql={feature:"#4ade80",bugfix:"#f87171",refactor:"#a78bfa",test:"#38bdf8",docs:"#fbbf24",setup:"#6b655c",deployment:"#f97316",other:"#9c9588"};function Gl(e){const t=e/3600;return t<.1?\`\${t.toFixed(2)}h\`:\`\${t.toFixed(1)}h\`}function Zl(e,t){return Object.entries(e).sort((e,t)=>t[1]-e[1]).slice(0,t)}function Jl({label:e,children:t}){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-widest font-bold whitespace-nowrap",children:e}),s.jsx("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-1 no-scrollbar",children:t})]})}function eu({stats:e}){const t=Zl(e.byClient,4),n=Zl(e.byLanguage,4);return 0===t.length&&0===n.length?null:s.jsxs("div",{className:"flex flex-col gap-4 mb-8 p-4 rounded-xl bg-bg-surface-1/30 border border-border/50",children:[t.length>0&&s.jsx(Jl,{label:"Top Clients",children:t.map(([e,t])=>{const n=Yl[e];return s.jsxs("span",{className:"text-[11px] font-mono px-2.5 py-1 rounded-full bg-bg-surface-1 border border-border hover:border-accent/40 transition-colors shadow-sm whitespace-nowrap group cursor-default",style:n?{borderLeftWidth:"3px",borderLeftColor:n}:void 0,title:Gl(t),children:[Xl[e]??e,s.jsx("span",{className:"ml-1.5 text-text-muted opacity-0 group-hover:opacity-100 transition-opacity",children:Gl(t)})]},e)})}),n.length>0&&s.jsx(Jl,{label:"Languages",children:n.map(([e,t])=>s.jsxs("span",{className:"text-[11px] font-mono px-2.5 py-1 rounded-full bg-bg-surface-1 border border-border hover:border-accent/40 transition-colors shadow-sm whitespace-nowrap group cursor-default",title:Gl(t),children:[e,s.jsx("span",{className:"ml-1.5 text-text-muted opacity-0 group-hover:opacity-100 transition-opacity",children:Gl(t)})]},e))})]})}const tu={coding:"#6366f1",debugging:"#f87171",testing:"#60a5fa",planning:"#a78bfa",reviewing:"#34d399",documenting:"#fbbf24",learning:"#f472b6",other:"#94a3b8"};function nu(e){if(e<60)return"<1m";const t=Math.round(e/60);if(t<60)return\`\${t}m\`;return\`\${(e/3600).toFixed(1)}h\`}function ru({byTaskType:e}){const t=Object.entries(e).filter(([,e])=>e>0).sort((e,t)=>t[1]-e[1]);if(0===t.length)return null;const n=t[0][1];return s.jsxs("div",{className:"rounded-xl bg-bg-surface-1 border border-border/50 p-4 mb-8",children:[s.jsx("h2",{className:"text-sm font-bold text-text-muted uppercase tracking-widest mb-4 px-1",children:"Task Types"}),s.jsx("div",{className:"space-y-2.5",children:t.map(([e,t],r)=>{const i=tu[e]??tu.other,a=t/n*100;return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-xs text-text-secondary font-medium w-24 text-right shrink-0",children:(o=e,o.charAt(0).toUpperCase()+o.slice(1))}),s.jsx("div",{className:"flex-1 h-5 rounded bg-bg-surface-2/50 overflow-hidden",children:s.jsx(Hl.div,{className:"h-full rounded",style:{backgroundColor:i},initial:{width:0},animate:{width:\`\${a}%\`},transition:{duration:.6,delay:.05*r,ease:[.22,1,.36,1]}})}),s.jsx("span",{className:"text-xs text-text-muted font-mono w-12 text-right shrink-0",children:nu(t)})]},e);var o})})]})}function iu({label:e,active:t,onClick:n}){return s.jsx("button",{onClick:n,className:"text-[10px] font-bold uppercase tracking-wider px-3 py-1.5 rounded-full transition-all duration-200 cursor-pointer border "+(t?"bg-accent text-white border-accent shadow-[0_2px_10px_rgba(99,102,241,0.4)] scale-105":"bg-bg-surface-1 border-border text-text-muted hover:text-text-primary hover:border-text-muted/50"),children:e})}function au({sessions:e,filters:t,onFilterChange:n}){const r=f.useMemo(()=>[...new Set(e.map(e=>e.client))].sort(),[e]),i=f.useMemo(()=>[...new Set(e.flatMap(e=>e.languages))].sort(),[e]),a=f.useMemo(()=>[...new Set(e.map(e=>e.project).filter(e=>{if(!e)return!1;const t=e.trim().toLowerCase();return!["untitled","mcp","unknown","default","none"].includes(t)}))].sort(),[e]);return r.length>0||i.length>0||a.length>0?s.jsxs("div",{className:"flex flex-col gap-3 mb-6",children:[s.jsxs("div",{className:"flex items-center gap-2 px-1",children:[s.jsx(ee,{className:"w-3.5 h-3.5 text-text-muted"}),s.jsx("span",{className:"text-[10px] font-bold text-text-muted uppercase tracking-widest",children:"Filters"})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-1",children:[s.jsx(iu,{label:"All",active:"all"===t.client&&"all"===t.language&&"all"===t.project,onClick:()=>{n("client","all"),n("language","all"),n("project","all")}}),r.map(e=>s.jsx(iu,{label:Xl[e]??e,active:t.client===e,onClick:()=>n("client",t.client===e?"all":e)},e)),i.map(e=>s.jsx(iu,{label:e,active:t.language===e,onClick:()=>n("language",t.language===e?"all":e)},e)),a.map(e=>s.jsx(iu,{label:e,active:t.project===e,onClick:()=>n("project",t.project===e?"all":e)},e))]})]}):null}function ou(e,t){const n=e=>new Date(e).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0});return\`\${n(e)} \u2014 \${n(t)}\`}function su(e){if(e<60)return\`\${e}s\`;const t=Math.round(e/60);if(t<60)return\`\${t}m\`;const n=Math.floor(t/60),r=t%60;return r>0?\`\${n}h \${r}m\`:\`\${n}h\`}const lu={feature:"bg-success/10 text-success border-success/20",bugfix:"bg-error/10 text-error border-error/20",refactor:"bg-purple/10 text-purple border-purple/20",test:"bg-blue/10 text-blue border-blue/20",docs:"bg-accent/10 text-accent border-accent/20",setup:"bg-text-muted/10 text-text-muted border-text-muted/20",deployment:"bg-emerald/10 text-emerald border-emerald/20"};function uu({category:e}){const t=lu[e]??"bg-bg-surface-2 text-text-secondary border-border";return s.jsx("span",{className:\`text-[10px] px-2 py-0.5 rounded-full border font-medium uppercase tracking-wider \${t}\`,children:e})}function cu({session:e,milestones:t,defaultExpanded:n=!1}){const[r,i]=f.useState(n),a=Yl[e.client]??"#91919a",o=Kl[e.client]??e.client.slice(0,2).toUpperCase(),l=t.length>0,u=e.project?.trim()||"",c=!u||["untitled","mcp","unknown","default","none","null","undefined"].includes(u.toLowerCase()),d=t[0];let h=u||"Untitled Session",p=!1;if(e.private_title)h=e.private_title,p=!0;else if(e.title)h=e.title;else if(c&&d)h=d.private_title||d.title,p=!!d.private_title;else if(c&&!d){h=\`\${Xl[e.client]??e.client} \${e.task_type.charAt(0).toUpperCase()+e.task_type.slice(1)}\`}return s.jsxs("div",{className:"mb-1.5 rounded-lg border transition-all duration-200 "+(r?"bg-bg-surface-1 border-border-accent":"bg-bg-surface-1/30 border-border hover:border-border-accent/50"),children:[s.jsxs("button",{className:"w-full flex items-center gap-3 px-3 py-2 text-left",onClick:()=>l&&i(!r),style:{cursor:l?"pointer":"default"},children:[s.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center text-[11px] font-bold font-mono flex-shrink-0",style:{backgroundColor:\`\${a}15\`,color:a,border:\`1px solid \${a}20\`},children:o}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[p&&s.jsx(te,{className:"w-3 h-3 text-accent-dim flex-shrink-0"}),s.jsx("span",{className:"text-sm font-bold truncate text-text-primary",children:h}),s.jsx("span",{className:"text-[10px] text-text-muted font-mono bg-bg-surface-2 px-1.5 rounded uppercase tracking-tighter",children:e.client}),e.evaluation&&s.jsx("span",{className:"text-[9px] font-bold px-1.5 py-0.5 rounded border "+("completed"===e.evaluation.task_outcome?"bg-success/10 text-success border-success/20":"partial"===e.evaluation.task_outcome?"bg-accent/10 text-accent border-accent/20":"bg-error/10 text-error border-error/20"),children:"completed"===e.evaluation.task_outcome?"\u2713":"partial"===e.evaluation.task_outcome?"~":"\u2717"})]}),s.jsxs("div",{className:"flex items-center gap-3 text-xs text-text-muted font-medium mt-0.5",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Z,{className:"w-3.5 h-3.5 opacity-70"}),su(e.duration_seconds)]}),e.duration_seconds>=900&&(()=>{const t=Math.floor(e.duration_seconds/900),n=t>0?Math.min(e.heartbeat_count/t,1):0,r=n>=.8?"text-success":n>=.5?"text-accent":"text-text-muted";return s.jsxs("span",{className:\`flex items-center gap-0.5 text-[10px] font-mono \${r}\`,title:\`Focus: \${Math.round(100*n)}%\`,children:[s.jsx(he,{className:"w-3 h-3"}),Math.round(100*n),"%"]})})(),s.jsx("span",{className:"text-[10px] opacity-60 font-mono",children:ou(e.started_at,e.ended_at).split(" \u2014 ")[0]})]})]}),s.jsxs("div",{className:"hidden sm:flex items-center gap-2 mr-1",children:[e.languages.length>0&&s.jsx("span",{className:"text-[10px] font-mono text-text-muted/70 bg-bg-surface-2/50 px-1.5 py-0.5 rounded",children:e.languages[0]}),l&&s.jsx("span",{className:"text-[10px] font-bold text-accent/80 bg-accent/5 px-2 py-0.5 rounded border border-accent/10",children:t.length})]}),l&&s.jsx("div",{className:"transition-transform duration-200 "+(r?"rotate-180 text-accent":"text-text-muted"),children:s.jsx(K,{className:"w-4 h-4"})})]}),s.jsx(Ps,{children:r&&l&&s.jsx(Hl.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:s.jsxs("div",{className:"px-3 pb-3 pt-1 space-y-1",children:[s.jsx("div",{className:"h-px bg-border/30 mb-2 mx-1"}),e.evaluation&&s.jsxs("div",{className:"flex items-center gap-3 px-2 py-1.5 text-[10px] text-text-muted font-mono",children:[s.jsxs("span",{children:["prompt: ",e.evaluation.prompt_quality,"/5"]}),s.jsxs("span",{children:["context: ",e.evaluation.context_provided,"/5"]}),s.jsxs("span",{children:["scope: ",e.evaluation.scope_quality,"/5"]}),s.jsxs("span",{children:["turns: ",e.evaluation.iteration_count]})]}),t.map(e=>{const t=!!e.private_title?e.private_title:e.title,n=function(e){if(!e||e<=0)return"";if(e<60)return\`\${e}m\`;const t=Math.floor(e/60),n=e%60;return n>0?\`\${t}h \${n}m\`:\`\${t}h\`}(e.duration_minutes);return s.jsxs("div",{className:"group flex items-center gap-3 p-1.5 rounded-md hover:bg-bg-surface-2/40 transition-colors",children:[s.jsx("div",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{backgroundColor:Ql[e.category]??"#9c9588"}}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-text-secondary group-hover:text-text-primary truncate",children:t}),s.jsx(uu,{category:e.category})]})}),n&&s.jsx("span",{className:"text-[10px] text-text-muted font-mono",children:n})]},e.id)})]})})})]})}function du(e){if(e<60)return\`\${e}s\`;const t=Math.round(e/60);if(t<60)return\`\${t}m\`;const n=Math.floor(t/60),r=t%60;return r>0?\`\${n}h \${r}m\`:\`\${n}h\`}function fu({group:e,defaultExpanded:t}){const[n,r]=f.useState(t);if(1===e.sessions.length){const n=e.sessions[0];return s.jsx(cu,{session:n.session,milestones:n.milestones,defaultExpanded:t&&n.milestones.length>0})}const i=Yl[e.sessions[0].session.client]??"#91919a",a=e.aggregateEval,o=e.sessions[0].session,l=o.private_title||o.title||o.project||"Conversation";return s.jsxs("div",{className:"rounded-lg border border-accent/20 bg-bg-surface-1/20 overflow-hidden",children:[s.jsxs("button",{className:"w-full flex items-center gap-3 px-3 py-2 text-left hover:bg-bg-surface-1/40 transition-colors",onClick:()=>r(!n),children:[s.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center flex-shrink-0",style:{backgroundColor:\`\${i}10\`,border:\`1px solid \${i}20\`},children:s.jsx(re,{className:"w-4 h-4",style:{color:i}})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm font-bold truncate text-text-primary",children:l}),s.jsxs("span",{className:"text-[10px] font-bold text-accent/80 bg-accent/5 px-1.5 py-0.5 rounded border border-accent/10",children:[e.sessions.length," prompts"]}),a&&s.jsxs("span",{className:"text-[9px] font-bold px-1.5 py-0.5 rounded border "+((a.outcomes.completed??0)===a.session_count?"bg-success/10 text-success border-success/20":(a.outcomes.completed??0)>0?"bg-accent/10 text-accent border-accent/20":"bg-error/10 text-error border-error/20"),children:[a.outcomes.completed??0,"/",a.session_count]})]}),s.jsxs("div",{className:"flex items-center gap-3 text-xs text-text-muted font-medium mt-0.5",children:[s.jsx("span",{className:"font-mono",children:du(e.totalDuration)}),e.totalMilestones>0&&s.jsxs("span",{className:"text-[10px] text-accent/70",children:[e.totalMilestones," milestone",1!==e.totalMilestones?"s":""]}),a&&s.jsxs("span",{className:"text-[10px] font-mono text-text-muted/60",children:["avg prompt: ",a.prompt_quality,"/5"]})]})]}),s.jsx("div",{className:"transition-transform duration-200 "+(n?"rotate-180 text-accent":"text-text-muted"),children:s.jsx(K,{className:"w-4 h-4"})})]}),s.jsx(Ps,{children:n&&s.jsx(Hl.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:s.jsxs("div",{className:"px-3 pb-2 relative",children:[s.jsx("div",{className:"absolute left-[1.65rem] top-0 bottom-2 w-px",style:{backgroundColor:\`\${i}25\`}}),s.jsx("div",{className:"space-y-1 pl-6",children:e.sessions.map((e,t)=>s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute -left-[1.15rem] top-4 w-2 h-2 rounded-full border-2",style:{backgroundColor:i,borderColor:\`\${i}40\`}}),s.jsx(cu,{session:e.session,milestones:e.milestones,defaultExpanded:0===t&&e.milestones.length>0})]},e.session.session_id))})]})})})]})}function hu({sessions:e,milestones:t,filters:n}){const r=f.useMemo(()=>e.filter(e=>("all"===n.client||e.client===n.client)&&(!("all"!==n.language&&!e.languages.includes(n.language))&&("all"===n.project||(e.project??"")===n.project))),[e,n]),i=f.useMemo(()=>"all"===n.category?t:t.filter(e=>e.category===n.category),[t,n.category]),a=f.useMemo(()=>{const e=function(e,t){const n=new Map;for(const i of t){const e=n.get(i.session_id);e?e.push(i):n.set(i.session_id,[i])}const r=e.map(e=>({session:e,milestones:n.get(e.session_id)??[]}));return r.sort((e,t)=>new Date(t.session.started_at).getTime()-new Date(e.session.started_at).getTime()),r}(r,i);return function(e){const t=new Map,n=[];for(const i of e){const e=i.session.conversation_id;if(e){const n=t.get(e);n?n.push(i):t.set(e,[i])}else n.push(i)}const r=[];for(const[i,a]of t){a.sort((e,t)=>(e.session.conversation_index??0)-(t.session.conversation_index??0));const e=a.reduce((e,t)=>e+t.session.duration_seconds,0),t=a.reduce((e,t)=>e+t.milestones.length,0),n=a[0].session.started_at,o=a[a.length-1].session.ended_at;r.push({conversationId:i,sessions:a,aggregateEval:I(a),totalDuration:e,totalMilestones:t,startedAt:n,endedAt:o})}for(const i of n)r.push({conversationId:null,sessions:[i],aggregateEval:i.session.evaluation?I([i]):null,totalDuration:i.session.duration_seconds,totalMilestones:i.milestones.length,startedAt:i.session.started_at,endedAt:i.session.ended_at});return r.sort((e,t)=>new Date(t.startedAt).getTime()-new Date(e.startedAt).getTime()),r}(e)},[r,i]);return 0===a.length?s.jsx("div",{className:"text-center text-text-muted py-8 text-sm mb-4",children:"No sessions in this window"}):s.jsx("div",{className:"space-y-1.5 mb-4",children:a.map((e,t)=>s.jsx(fu,{group:e,defaultExpanded:0===t},e.conversationId??e.sessions[0].session.session_id))})}function pu({sessions:e,timeScale:t,effectiveTime:n,isLive:r,onDayClick:i,highlightDate:a}){const o="24h"===t||"12h"===t,l=new Date(n).toISOString().slice(0,10),u=f.useMemo(()=>o?function(e,t){const n=new Date(\`\${t}T00:00:00\`).getTime(),r=n+864e5,i=[];for(let a=0;a<24;a++)i.push({hour:a,minutes:0});for(const a of e){const e=new Date(a.started_at).getTime(),t=new Date(a.ended_at).getTime();if(t<n||e>r)continue;const o=Math.max(e,n),s=Math.min(t,r);for(let r=0;r<24;r++){const e=n+36e5*r,t=e+36e5,a=Math.max(o,e),l=Math.min(s,t);l>a&&(i[r].minutes+=(l-a)/6e4)}}return i}(e,l):[],[e,l,o]),c=f.useMemo(()=>o?[]:function(e,t){const n=new Date,r=[];for(let i=t-1;i>=0;i--){const t=new Date(n);t.setDate(t.getDate()-i);const a=t.toISOString().slice(0,10);let o=0;for(const n of e)n.started_at.slice(0,10)===a&&(o+=n.duration_seconds);r.push({date:a,hours:o/3600})}return r}(e,7),[e,o]),d=o?\`Hourly \u2014 \${new Date(n).toLocaleDateString([],{month:"short",day:"numeric"})}\`:"Last 7 Days";if(o){const e=Math.max(...u.map(e=>e.minutes),1);return s.jsxs("div",{className:"mb-8 p-5 rounded-2xl bg-bg-surface-1/50 border border-border/50",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4 px-1",children:[s.jsx("div",{className:"text-xs text-text-muted uppercase tracking-widest font-bold",children:d}),s.jsxs("div",{className:"text-[10px] text-text-muted font-mono bg-bg-surface-2 px-2 py-0.5 rounded",children:[e.toFixed(0),"m peak"]})]}),s.jsx("div",{className:"flex items-end gap-[3px] h-16",children:u.map((t,n)=>{const r=e>0?t.minutes/e*100:0;return s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-end h-full group relative",children:[s.jsx("div",{className:"absolute -top-10 left-1/2 -translate-x-1/2 opacity-0 group-hover:opacity-100 transition-opacity z-20 pointer-events-none",children:s.jsxs("div",{className:"bg-bg-surface-3 text-text-primary text-[10px] font-mono px-2 py-1.5 rounded-lg shadow-xl whitespace-nowrap border border-border flex flex-col items-center",children:[s.jsxs("span",{className:"font-bold",children:[t.hour,":00"]}),s.jsxs("span",{className:"text-accent",children:[t.minutes.toFixed(0),"m active"]}),s.jsx("div",{className:"absolute -bottom-1 left-1/2 -translate-x-1/2 w-2 h-2 bg-bg-surface-3 border-r border-b border-border rotate-45"})]})}),s.jsx(Hl.div,{initial:{height:0},animate:{height:\`\${Math.max(r,t.minutes>0?8:0)}%\`},transition:{delay:.01*n,duration:.5},className:"w-full rounded-t-sm transition-all duration-300 group-hover:bg-accent relative overflow-hidden",style:{minHeight:t.minutes>0?"4px":"0px",backgroundColor:t.minutes>0?\`rgba(99, 102, 241, \${.4+t.minutes/e*.6})\`:"var(--color-bg-surface-2)"},children:t.minutes>.5*e&&s.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-transparent to-white/10"})})]},t.hour)})}),s.jsx("div",{className:"flex gap-[3px] mt-2 border-t border-border/30 pt-2",children:u.map(e=>s.jsx("div",{className:"flex-1 text-center",children:e.hour%6==0&&s.jsx("span",{className:"text-[9px] text-text-muted font-bold font-mono uppercase",children:0===e.hour?"12a":e.hour<12?\`\${e.hour}a\`:12===e.hour?"12p":e.hour-12+"p"})},e.hour))})]})}const h=Math.max(...c.map(e=>e.hours),.1);return s.jsxs("div",{className:"mb-8 p-5 rounded-2xl bg-bg-surface-1/50 border border-border/50",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4 px-1",children:[s.jsx("div",{className:"text-xs text-text-muted uppercase tracking-widest font-bold",children:d}),s.jsx("div",{className:"text-[10px] text-text-muted font-mono bg-bg-surface-2 px-2 py-0.5 rounded",children:"Last 7 days"})]}),s.jsx("div",{className:"flex items-end gap-2 h-16",children:c.map((e,t)=>{const n=h>0?e.hours/h*100:0,r=e.date===a;return s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-end h-full group relative",children:[s.jsx("div",{className:"absolute -top-10 left-1/2 -translate-x-1/2 opacity-0 group-hover:opacity-100 transition-opacity z-20 pointer-events-none",children:s.jsxs("div",{className:"bg-bg-surface-3 text-text-primary text-[10px] font-mono px-2 py-1.5 rounded-lg shadow-xl whitespace-nowrap border border-border flex flex-col items-center",children:[s.jsx("span",{className:"font-bold",children:e.date}),s.jsxs("span",{className:"text-accent",children:[e.hours.toFixed(1),"h active"]}),s.jsx("div",{className:"absolute -bottom-1 left-1/2 -translate-x-1/2 w-2 h-2 bg-bg-surface-3 border-r border-b border-border rotate-45"})]})}),s.jsx(Hl.div,{initial:{height:0},animate:{height:\`\${Math.max(n,e.hours>0?8:0)}%\`},transition:{delay:.05*t,duration:.5},className:"w-full rounded-t-md cursor-pointer transition-all duration-300 group-hover:scale-x-110 origin-bottom "+(r?"ring-2 ring-accent ring-offset-2 ring-offset-bg-base":""),style:{minHeight:e.hours>0?"4px":"0px",backgroundColor:r?"var(--color-accent-bright)":e.hours>0?\`rgba(99, 102, 241, \${.4+e.hours/h*.6})\`:"var(--color-bg-surface-2)"},onClick:()=>i?.(e.date)})]},e.date)})}),s.jsx("div",{className:"flex gap-2 mt-2 border-t border-border/30 pt-2",children:c.map(e=>s.jsx("div",{className:"flex-1 text-center",children:s.jsx("span",{className:"text-[10px] text-text-muted font-bold uppercase tracking-tighter",children:new Date(e.date+"T12:00:00").toLocaleDateString([],{weekday:"short"})})},e.date))})]})}function mu(e){if(!e)return"Never synced";const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"Just now";if(n<60)return\`\${n}m ago\`;const r=Math.floor(n/60);if(r<24)return\`\${r}h ago\`;return\`\${Math.floor(r/24)}d ago\`}function gu({config:e,onRefresh:t}){const[n,r]=f.useState(""),[i,a]=f.useState(""),[o,l]=f.useState("email"),[u,c]=f.useState(!1),[d,h]=f.useState(null);if(!e)return null;if(e.authenticated){const n=async()=>{c(!0),h(null);try{const e=await R("/api/local/sync");e.success?(h("Synced!"),t(),setTimeout(()=>h(null),3e3)):h(e.error??"Sync failed")}catch(e){h(e.message)}finally{c(!1)}};return s.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 p-4 mt-12 bg-bg-surface-1/50 rounded-2xl border border-border/50 backdrop-blur-sm",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-8 h-8 rounded-full bg-accent/10 flex items-center justify-center border border-accent/20",children:s.jsx(fe,{className:"w-4 h-4 text-accent"})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"text-xs font-bold text-text-primary",children:e.email}),s.jsxs("span",{className:"text-[10px] text-text-muted font-mono uppercase tracking-tighter",children:["Last sync: ",mu(e.last_sync_at)]})]})]}),s.jsxs("div",{className:"flex items-center gap-4",children:[d&&s.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest "+("Synced!"===d?"text-success":"text-error"),children:d}),s.jsxs("button",{onClick:n,disabled:u,className:"group flex items-center gap-2 px-4 py-2 bg-accent hover:bg-accent-bright text-white text-xs font-bold rounded-lg transition-all duration-300 shadow-lg shadow-accent/20 disabled:opacity-50 cursor-pointer overflow-hidden relative",children:[s.jsx(ae,{className:"w-3.5 h-3.5 "+(u?"animate-spin":"group-hover:rotate-180 transition-transform duration-500")}),u?"Syncing...":"Sync Now"]})]})]})}const p=f.useCallback(async()=>{if(n.includes("@")){c(!0),h(null);try{await function(e){return R("/api/local/auth/send-otp",{email:e})}(n),l("otp")}catch(e){h(e.message)}finally{c(!1)}}},[n]),m=f.useCallback(async()=>{if(/^\\d{6}$/.test(i)){c(!0),h(null);try{await function(e,t){return R("/api/local/auth/verify-otp",{email:e,code:t})}(n,i),t()}catch(e){h(e.message)}finally{c(!1)}}},[n,i,t]);return s.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 p-4 mt-12 bg-bg-surface-1/50 rounded-2xl border border-border/50 backdrop-blur-sm",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-8 h-8 rounded-full bg-bg-surface-2 flex items-center justify-center border border-border",children:s.jsx(le,{className:"w-4 h-4 text-text-muted"})}),s.jsx("span",{className:"text-xs font-bold text-text-secondary uppercase tracking-widest",children:"Sign in to sync"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[d&&s.jsx("span",{className:"text-[10px] font-bold text-error uppercase tracking-widest mr-2",children:d}),"email"===o?s.jsxs("div",{className:"flex items-center bg-bg-base border border-border rounded-lg overflow-hidden focus-within:border-accent/50 focus-within:ring-1 focus-within:ring-accent/50 transition-all",children:[s.jsx("div",{className:"pl-3 py-2",children:s.jsx(ne,{className:"w-3.5 h-3.5 text-text-muted"})}),s.jsx("input",{type:"email",placeholder:"you@email.com",value:n,onChange:e=>r(e.target.value),onKeyDown:e=>"Enter"===e.key&&p(),className:"px-3 py-2 text-xs bg-transparent text-text-primary outline-none w-40 placeholder:text-text-muted/50"}),s.jsx("button",{onClick:p,disabled:u||!n.includes("@"),className:"px-4 py-2 bg-bg-surface-2 hover:bg-bg-surface-3 text-text-primary text-[10px] font-bold uppercase tracking-wider transition-colors disabled:opacity-50 cursor-pointer border-l border-border",children:u?"...":"Send"})]}):s.jsxs("div",{className:"flex items-center bg-bg-base border border-border rounded-lg overflow-hidden focus-within:border-accent/50 focus-within:ring-1 focus-within:ring-accent/50 transition-all",children:[s.jsx("input",{type:"text",maxLength:6,placeholder:"000000",inputMode:"numeric",autoComplete:"one-time-code",value:i,onChange:e=>a(e.target.value),onKeyDown:e=>"Enter"===e.key&&m(),autoFocus:!0,className:"px-4 py-2 text-xs bg-transparent text-text-primary text-center font-mono tracking-widest outline-none w-32 placeholder:text-text-muted/50"}),s.jsx("button",{onClick:m,disabled:u||6!==i.length,className:"px-4 py-2 bg-accent hover:bg-accent-bright text-white text-[10px] font-bold uppercase tracking-wider transition-colors disabled:opacity-50 cursor-pointer",children:u?"...":"Verify"})]})]})]})}var yu=j();const vu={"15m":{visibleDuration:9e5,majorTickInterval:3e5,minorTickInterval:6e4,labelFormat:e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})},"30m":{visibleDuration:18e5,majorTickInterval:6e5,minorTickInterval:12e4,labelFormat:e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})},"1h":{visibleDuration:36e5,majorTickInterval:9e5,minorTickInterval:3e5,labelFormat:e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})},"12h":{visibleDuration:432e5,majorTickInterval:72e5,minorTickInterval:18e5,labelFormat:e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})},"24h":{visibleDuration:864e5,majorTickInterval:144e5,minorTickInterval:36e5,labelFormat:e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})},"7d":{visibleDuration:6048e5,majorTickInterval:864e5,minorTickInterval:216e5,labelFormat:e=>e.toLocaleDateString([],{weekday:"short",month:"short",day:"numeric"})},"30d":{visibleDuration:2592e6,majorTickInterval:6048e5,minorTickInterval:864e5,labelFormat:e=>e.toLocaleDateString([],{month:"short",day:"numeric"})}};function bu(e){if(e<60)return\`\${e}s\`;const t=Math.round(e/60);if(t<60)return\`\${t}m\`;const n=Math.floor(t/60),r=t%60;return r>0?\`\${n}h \${r}m\`:\`\${n}h\`}function xu({value:e,onChange:t,scale:n,sessions:r=[],milestones:i=[]}){const a=f.useRef(null),[o,l]=f.useState(0);f.useEffect(()=>{if(!a.current)return;const e=new ResizeObserver(e=>{for(const t of e)l(t.contentRect.width)});return e.observe(a.current),l(a.current.getBoundingClientRect().width),()=>e.disconnect()},[]);const u=vu[n],c=o>0?o/u.visibleDuration:0,[d,h]=f.useState(!1),p=f.useRef(0),m=f.useCallback(e=>{h(!0),p.current=e.clientX,e.currentTarget.setPointerCapture(e.pointerId)},[]),g=f.useCallback(n=>{if(!d||0===c)return;const r=n.clientX-p.current;p.current=n.clientX,t(e+-r/c)},[d,c,e,t]),y=f.useCallback(()=>{h(!1)},[]),v=f.useMemo(()=>{if(!o||0===c)return[];const t=u.visibleDuration/2,n=e+t,r=e-t-u.majorTickInterval,i=n+u.majorTickInterval,a=[];for(let o=Math.ceil(r/u.majorTickInterval)*u.majorTickInterval;o<=i;o+=u.majorTickInterval)a.push({type:"major",time:o,position:(o-e)*c,label:u.labelFormat(new Date(o))});for(let o=Math.ceil(r/u.minorTickInterval)*u.minorTickInterval;o<=i;o+=u.minorTickInterval)o%u.majorTickInterval!==0&&a.push({type:"minor",time:o,position:(o-e)*c});return a},[e,o,c,u]),b=f.useMemo(()=>r.map(e=>({session:e,start:new Date(e.started_at).getTime(),end:new Date(e.ended_at).getTime()})),[r]),x=f.useMemo(()=>{if(!o||0===c)return[];const t=u.visibleDuration/2,n=e-t,r=e+t;return b.filter(e=>e.start<=r&&e.end>=n).map(t=>({session:t.session,leftOffset:(Math.max(t.start,n)-e)*c,width:(Math.min(t.end,r)-Math.max(t.start,n))*c}))},[b,e,o,c,u]),w=f.useMemo(()=>i.map(e=>({milestone:e,time:new Date(e.created_at).getTime()})).sort((e,t)=>e.time-t.time),[i]),k=f.useMemo(()=>{if(!o||0===c||!w.length)return[];const t=u.visibleDuration/2,n=e-t,r=e+t;let i=0,a=w.length;for(;i<a;){const e=i+a>>1;w[e].time<n?i=e+1:a=e}const s=i;for(a=w.length;i<a;){const e=i+a>>1;w[e].time<=r?i=e+1:a=e}const l=i,d=[];for(let o=s;o<l;o++){const t=w[o];d.push({...t,offset:(t.time-e)*c})}return d},[w,e,o,c,u]),[S,E]=f.useState(null),T=f.useRef(e);return f.useEffect(()=>{S&&Math.abs(e-T.current)>1e3&&E(null),T.current=e},[e,S]),s.jsxs("div",{className:"relative h-20",children:[s.jsxs("div",{className:"absolute inset-0 bg-transparent border-t border-border/50 overflow-hidden select-none touch-none cursor-grab active:cursor-grabbing",ref:a,onPointerDown:m,onPointerMove:g,onPointerUp:y,style:{touchAction:"none"},children:[s.jsxs("div",{className:"absolute left-1/2 top-0 bottom-0 w-[2px] bg-accent z-30 -translate-x-1/2 shadow-[0_0_15px_rgba(99,102,241,0.5)]",children:[s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-3 h-3 bg-accent rounded-b-full"}),s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-3 h-3 bg-accent rounded-t-full"})]}),s.jsxs("div",{className:"absolute inset-0 left-1/2 top-0 bottom-0 pointer-events-none",children:[v.map(e=>s.jsx("div",{className:"absolute top-0 border-l "+("major"===e.type?"border-border/60":"border-border/30"),style:{left:e.position,height:"major"===e.type?"100%":"35%",bottom:0},children:"major"===e.type&&e.label&&s.jsx("span",{className:"absolute top-3 left-2 text-[9px] font-bold text-text-muted uppercase tracking-wider whitespace-nowrap bg-bg-surface-1/80 px-1 py-0.5 rounded",children:e.label})},e.time)),x.map(e=>s.jsx("div",{className:"absolute bottom-0 rounded-t-md pointer-events-auto cursor-pointer transition-opacity hover:opacity-80",style:{left:e.leftOffset,width:Math.max(e.width,3),height:"45%",backgroundColor:"rgba(99, 102, 241, 0.15)",borderTop:"2px solid rgba(99, 102, 241, 0.5)",boxShadow:"inset 0 1px 10px rgba(99, 102, 241, 0.05)"},onMouseEnter:t=>{const n=t.currentTarget.getBoundingClientRect();E({type:"session",data:e.session,x:n.left+n.width/2,y:n.top})},onMouseLeave:()=>E(null)},e.session.session_id)),k.map((e,n)=>s.jsx("div",{className:"absolute bottom-3 pointer-events-auto cursor-pointer z-40 transition-transform hover:scale-125",style:{left:e.offset,transform:"translateX(-50%)"},onMouseEnter:t=>{const n=t.currentTarget.getBoundingClientRect();E({type:"milestone",data:e.milestone,x:n.left+n.width/2,y:n.top})},onMouseLeave:()=>E(null),onClick:n=>{n.stopPropagation(),t(e.time)},children:s.jsx("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-bg-surface-1 shadow-lg",style:{backgroundColor:Ql[e.milestone.category]??"#9c9588",boxShadow:\`0 0 10px \${Ql[e.milestone.category]}50\`}})},n))]})]}),S&&yu.createPortal(s.jsx("div",{className:"fixed z-[9999] pointer-events-none",style:{left:S.x,top:S.y,transform:"translate(-50%, -100%)"},children:s.jsxs("div",{className:"mb-3 bg-bg-surface-3/95 backdrop-blur-md text-text-primary rounded-xl shadow-2xl px-3 py-2.5 text-[11px] min-w-[180px] max-w-[280px] border border-border/50 animate-in fade-in zoom-in-95 duration-200",children:["session"===S.type?s.jsx(wu,{session:S.data}):s.jsx(ku,{milestone:S.data}),s.jsx("div",{className:"absolute -bottom-1.5 left-1/2 -translate-x-1/2 w-3 h-3 bg-bg-surface-3/95 border-r border-b border-border/50 rotate-45"})]})}),document.body)]})}function wu({session:e}){const t=Xl[e.client]??e.client,n=e.project?.trim(),r=!n||["untitled","mcp","unknown","default","none"].includes(n.toLowerCase())?\`\${t} \${e.task_type.charAt(0).toUpperCase()+e.task_type.slice(1)}\`:n;return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"font-bold text-xs text-accent uppercase tracking-widest",children:t}),s.jsx("span",{className:"text-[10px] text-text-muted font-mono",children:bu(e.duration_seconds)})]}),s.jsx("div",{className:"h-px bg-border/50 my-0.5"}),s.jsx("div",{className:"text-text-primary font-medium",children:r}),s.jsx("div",{className:"text-text-secondary capitalize text-[10px]",children:e.task_type})]})}function ku({milestone:e}){const t=e.private_title??e.title;return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"font-bold text-[10px] uppercase tracking-widest",style:{color:Ql[e.category]??"#9c9588"},children:e.category}),e.complexity&&s.jsx("span",{className:"text-[9px] font-mono text-text-muted font-bold border border-border/50 px-1 rounded uppercase",children:e.complexity})]}),s.jsx("div",{className:"h-px bg-border/50 my-0.5"}),s.jsx("div",{className:"font-bold text-xs break-words text-text-primary",children:t}),e.private_title&&s.jsxs("div",{className:"text-[10px] text-text-muted italic opacity-70",children:["Public: ",e.title]})]})}const Su={"15m":9e5,"30m":18e5,"1h":36e5,"12h":432e5,"24h":864e5,"7d":6048e5,"30d":2592e6},Eu={"15m":"15 Minutes","30m":"30 Minutes","1h":"1 Hour","12h":"12 Hours","24h":"24 Hours","7d":"7 Days","30d":"30 Days"};function Tu(e,t){const n=e.trim();if(!n)return null;const r=new Date(t),i=n.match(/^(\\d{1,2}):(\\d{2})(?::(\\d{2}))?\\s*(AM|PM)$/i);if(i){let e=parseInt(i[1],10);const t=parseInt(i[2],10),n=i[3]?parseInt(i[3],10):0,a=i[4].toUpperCase();return e<1||e>12||t>59||n>59?null:("AM"===a&&12===e&&(e=0),"PM"===a&&12!==e&&(e+=12),r.setHours(e,t,n,0),r.getTime())}const a=n.match(/^(\\d{1,2}):(\\d{2})(?::(\\d{2}))?$/);if(a){const e=parseInt(a[1],10),t=parseInt(a[2],10),n=a[3]?parseInt(a[3],10):0;return e>23||t>59||n>59?null:(r.setHours(e,t,n,0),r.getTime())}return null}const Cu=["15m","30m","1h","12h","24h","7d","30d"];function Pu({value:e,onChange:t,scale:n,onScaleChange:r,sessions:i,milestones:a}){const o=null===e,[l,u]=f.useState(Date.now());f.useEffect(()=>{if(!o)return;const e=setInterval(()=>u(Date.now()),1e3);return()=>clearInterval(e)},[o]);const c=o?l:e,[d,h]=f.useState(!1),[p,m]=f.useState(""),g=f.useRef(null),y=f.useRef(!1),v=f.useRef(""),b=f.useRef(!1),x=f.useRef(0),w=f.useCallback(e=>{const n=Date.now();if(e>=n-2e3)return b.current=!0,x.current=n,void t(null);b.current&&n-x.current<300||b.current&&e>=n-1e4?t(null):(b.current=!1,t(e))},[t]),k=e=>{const n=c,r=Math.min(n+e,Date.now());t(r)},S=()=>{y.current=o,t(c);const e=new Date(c).toLocaleTimeString([],{hour12:!0,hour:"2-digit",minute:"2-digit",second:"2-digit"});v.current=e,m(e),h(!0),requestAnimationFrame(()=>g.current?.select())},E=()=>{if(h(!1),y.current&&p===v.current)return void t(null);const e=Tu(p,c);null!==e&&t(Math.min(e,Date.now()))};return s.jsxs("div",{className:"flex flex-col bg-bg-surface-1/40 border border-border/50 rounded-2xl overflow-hidden mb-8 shadow-xl backdrop-blur-md",children:[s.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between px-6 py-5 border-b border-border/50 gap-6",children:[s.jsxs("div",{className:"flex flex-col items-start gap-1.5",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2 h-8",children:[d?s.jsx("input",{ref:g,type:"text",value:p,onChange:e=>m(e.target.value),onBlur:E,onKeyDown:e=>{if("Enter"===e.key)return void E();if("Escape"===e.key)return e.preventDefault(),h(!1),void(y.current&&t(null));if("ArrowUp"!==e.key&&"ArrowDown"!==e.key)return;e.preventDefault();const n=g.current;if(!n)return;const r=n.selectionStart??0,i="ArrowUp"===e.key?1:-1,a=Tu(p,c);if(null===a)return;const o=p.indexOf(":"),s=p.indexOf(":",o+1),l=p.lastIndexOf(" ");let u;u=r<=o?36e5*i:s>-1&&r<=s?6e4*i:l>-1&&r<=l?1e3*i:12*i*36e5;const d=Math.min(a+u,Date.now()),f=new Date(d).toLocaleTimeString([],{hour12:!0,hour:"2-digit",minute:"2-digit",second:"2-digit"});m(f),t(d),requestAnimationFrame(()=>{n&&n.setSelectionRange(r,r)})},className:"text-2xl font-mono font-bold tracking-tight bg-bg-surface-2 border border-accent rounded-lg px-2 -ml-2 w-[165px] outline-none text-text-primary shadow-[0_0_10px_rgba(99,102,241,0.2)]"}):s.jsxs("button",{onClick:S,className:"group flex items-center gap-2 hover:bg-bg-surface-2/50 rounded-lg px-2 -ml-2 py-1 transition-all cursor-text",title:"Click to edit time",children:[s.jsx(Z,{className:"w-5 h-5 "+(o?"text-text-muted":"text-accent")}),s.jsx("span",{className:"text-2xl font-mono font-bold tracking-tight tabular-nums "+(o?"text-text-primary":"text-accent"),children:new Date(c).toLocaleTimeString([],{hour12:!0,hour:"2-digit",minute:"2-digit",second:"2-digit"})})]}),s.jsx("button",{onClick:d?E:S,className:"p-1.5 rounded-lg transition-colors flex-shrink-0 "+(d?"bg-accent text-white hover:bg-accent-bright":"text-text-muted hover:text-text-primary hover:bg-bg-surface-2"),title:d?"Confirm time":"Edit time",children:s.jsx(ie,{className:"w-3.5 h-3.5"})})]}),o?s.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 text-[10px] font-bold uppercase tracking-widest bg-success/10 text-success rounded-full border border-success/20 shadow-[0_0_10px_rgba(16,185,129,0.1)]",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-success animate-pulse"}),"Live"]}):s.jsx("div",{className:"flex items-center gap-1.5 px-2.5 py-1 text-[10px] font-bold uppercase tracking-widest bg-accent/10 text-accent rounded-full border border-accent/20",children:"History"})]}),s.jsxs("div",{className:"flex items-center gap-2 text-sm text-text-secondary font-medium px-0.5",children:[s.jsx(X,{className:"w-3.5 h-3.5 text-text-muted"}),new Date(c).toLocaleDateString([],{weekday:"short",month:"long",day:"numeric",year:"numeric"})]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-4",children:[s.jsx("div",{className:"flex items-center bg-bg-surface-2/50 border border-border/50 rounded-xl p-1 shadow-inner",children:Cu.map(e=>s.jsx("button",{onClick:()=>r(e),className:"px-3 py-1.5 text-[10px] font-bold uppercase tracking-wider rounded-lg transition-all "+(n===e?"bg-accent text-white shadow-lg shadow-accent/20":"text-text-muted hover:text-text-primary hover:bg-bg-surface-2"),title:Eu[e],children:e},e))}),s.jsxs("div",{className:"flex items-center gap-2",children:[!o&&s.jsxs("button",{onClick:()=>t(null),className:"group flex items-center gap-2 px-4 py-2 text-[10px] font-bold uppercase tracking-widest bg-accent/10 hover:bg-accent text-accent hover:text-white rounded-xl transition-all border border-accent/20",children:[s.jsx(se,{className:"w-3.5 h-3.5 group-hover:-rotate-90 transition-transform duration-500"}),"Live"]}),s.jsxs("div",{className:"flex items-center gap-1 bg-bg-surface-2/50 border border-border/50 rounded-xl p-1",children:[s.jsx("button",{onClick:()=>k(-Su[n]),className:"p-2 text-text-muted hover:text-text-primary hover:bg-bg-surface-2 rounded-lg transition-colors",title:\`Back \${Eu[n]}\`,children:s.jsx(Q,{className:"w-4 h-4"})}),s.jsx("button",{onClick:()=>k(Su[n]),className:"p-2 text-text-muted hover:text-text-primary hover:bg-bg-surface-2 rounded-lg transition-colors disabled:opacity-20 disabled:cursor-not-allowed",title:\`Forward \${Eu[n]}\`,disabled:o||c>=Date.now()-1e3,children:s.jsx(G,{className:"w-4 h-4"})})]})]})]})]}),s.jsx(xu,{value:c,onChange:w,scale:n,sessions:i,milestones:a})]})}const ju={feature:{verb:"shipped",noun:"feature",plural:"features"},bugfix:{verb:"fixed",noun:"bug",plural:"bugs"},refactor:{verb:"refactored",noun:"module",plural:"modules"},test:{verb:"added",noun:"test suite",plural:"test suites"},docs:{verb:"wrote",noun:"doc",plural:"docs"},setup:{verb:"configured",noun:"setup",plural:"setups"},deployment:{verb:"deployed",noun:"release",plural:"releases"},other:{verb:"completed",noun:"task",plural:"tasks"}};function Nu({children:e}){return s.jsx("span",{className:"text-text-primary font-medium",children:e})}function Mu({sessions:e,milestones:t}){const n=f.useMemo(()=>function(e,t){if(0===e.length)return s.jsx("span",{className:"text-text-muted",children:"No sessions in this time window."});const n=[],r=e.reduce((e,t)=>e+t.duration_seconds,0)/3600,i=r<.1?"<0.1":r.toFixed(1);if(n.push(s.jsxs("span",{children:[s.jsx(Nu,{children:e.length})," ",1===e.length?"session":"sessions",","," ",s.jsx(Nu,{children:i})," hrs"]},"sessions")),t.length>0){const e={};let r=0;for(const n of t)e[n.category]=(e[n.category]??0)+1,"feature"===n.category&&"complex"===n.complexity&&r++;const i=[],a=["feature","bugfix","refactor","test","docs","setup","deployment","other"];for(const t of a){const n=e[t];if(!n)continue;const a=ju[t]??ju.other,o=1===n?a.noun:a.plural,l="feature"===t&&r>0?s.jsxs("span",{children:[" ","(",s.jsx(Nu,{children:r})," complex)"]},\`\${t}-complex\`):null;i.push(s.jsxs("span",{children:[a.verb," ",s.jsx(Nu,{children:n})," ",o,l]},t))}if(i.length>0){n.push(s.jsx("span",{children:" \u2014 "},"milestone-sep"));for(let e=0;e<i.length;e++)e>0&&n.push(s.jsx("span",{children:", "},\`sep-\${e}\`)),n.push(i[e])}}const a={};for(const s of e)s.client&&(a[s.client]=(a[s.client]??0)+1);const o=Object.entries(a).sort((e,t)=>t[1]-e[1])[0];if(o){const e=Xl[o[0]]??o[0];n.push(s.jsxs("span",{children:[". Most active: ",s.jsx(Nu,{children:e})]},"client"))}const l={};for(const s of e){const e=s.languages?.[0];e&&(l[e]=(l[e]??0)+1)}const u=Object.entries(l).sort((e,t)=>t[1]-e[1])[0];if(u){const e=u[0].charAt(0).toUpperCase()+u[0].slice(1);n.push(s.jsxs("span",{children:[". Primary: ",s.jsx(Nu,{children:e})]},"lang"))}return n.push(s.jsx("span",{children:"."},"end")),s.jsx(s.Fragment,{children:n})}(e,t),[e,t]);return s.jsx(Hl.div,{initial:{opacity:0},animate:{opacity:1},className:"rounded-xl bg-bg-surface-1 border border-border/50 px-4 py-3 mb-4",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(ue,{className:"w-4 h-4 text-accent flex-shrink-0 mt-0.5"}),s.jsx("p",{className:"text-sm text-text-secondary leading-relaxed",children:n})]})})}function Lu({sessions:e}){const{scores:t,summaryLine:n}=f.useMemo(()=>{const t=e.filter(e=>null!=e.evaluation);if(0===t.length)return{scores:null,summaryLine:null};let n=0,r=0,i=0,a=0,o=0,s=0;for(const e of t){const t=e.evaluation;n+=t.prompt_quality,r+=t.context_provided,i+=t.independence_level,a+=t.scope_quality,s+=t.iteration_count,"completed"===t.task_outcome&&o++}const l=t.length,u=Math.round(o/l*100);return{scores:[{label:"Prompt Quality",value:n/l,max:5},{label:"Context",value:r/l,max:5},{label:"Independence",value:i/l,max:5},{label:"Scope",value:a/l,max:5},{label:"Completion",value:u/20,max:5}],summaryLine:\`\${l} session\${1===l?"":"s"} evaluated \xB7 \${u}% completed \xB7 avg \${(s/l).toFixed(1)} iterations\`}},[e]);return s.jsxs(Hl.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.1},className:"rounded-xl bg-bg-surface-1 border border-border/50 p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx("div",{className:"p-1.5 rounded-lg bg-bg-surface-2",children:s.jsx(ce,{className:"w-3.5 h-3.5 text-text-muted"})}),s.jsx("h2",{className:"text-sm font-bold text-text-muted uppercase tracking-widest",children:"AI Proficiency"})]}),null===t?s.jsx("p",{className:"text-xs text-text-muted py-2",children:"No evaluation data yet"}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"space-y-3",children:t.map((e,t)=>{const n=e.value/e.max*100,r="Completion"===e.label?\`\${Math.round(n)}%\`:e.value.toFixed(1);return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-xs text-text-secondary font-medium w-28 text-right shrink-0",children:e.label}),s.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-bg-surface-2/50 overflow-hidden",children:s.jsx(Hl.div,{className:"h-full rounded-full",style:{backgroundColor:(i=e.value,i>=4?"var(--color-accent)":i>=3?"var(--color-success)":"var(--color-text-muted)")},initial:{width:0},animate:{width:\`\${n}%\`},transition:{duration:.6,delay:.05*t,ease:[.22,1,.36,1]}})}),s.jsx("span",{className:"text-xs text-text-muted font-mono w-10 text-right shrink-0",children:r})]},e.label);var i})}),s.jsx("p",{className:"text-[10px] text-text-muted mt-4 px-1 font-mono",children:n})]})]})}const Au=["Output","Efficiency","Prompts","Consistency","Breadth"];function Du(e,t,n,r,i){const a=2*Math.PI*e/5-Math.PI/2;return[n+i*t*Math.cos(a),r+i*t*Math.sin(a)]}function _u(e,t,n,r){const i=[];for(let a=0;a<5;a++){const[o,s]=Du(a,e,t,n,r);i.push(\`\${o},\${s}\`)}return i.join(" ")}function Ru({sessions:e,milestones:t,streak:n}){const{values:r,hasEvalData:i}=f.useMemo(()=>{const r={simple:1,medium:2,complex:4};let i=0;for(const e of t)i+=r[e.complexity]??1;const a=Math.min(1,i/10),o=e.reduce((e,t)=>e+t.files_touched,0),s=e.reduce((e,t)=>e+t.duration_seconds,0)/3600,l=Math.min(1,o/Math.max(s,1)/20),u=e.filter(e=>null!=e.evaluation);let c=0;const d=u.length>0;if(d){c=u.reduce((e,t)=>e+t.evaluation.prompt_quality,0)/u.length/5}const f=Math.min(1,n/14),h=new Set;for(const t of e)for(const e of t.languages)h.add(e);return{values:[a,l,c,f,Math.min(1,h.size/5)],hasEvalData:d}},[e,t,n]),a=100,o=100,l=[];for(let s=0;s<5;s++){const e=Math.max(r[s],.02),[t,n]=Du(s,e,a,o,70);l.push(\`\${t},\${n}\`)}const u=l.join(" ");return s.jsxs(Hl.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.15},className:"rounded-xl bg-bg-surface-1 border border-border/50 p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("div",{className:"p-1.5 rounded-lg bg-bg-surface-2",children:s.jsx(q,{className:"w-3.5 h-3.5 text-text-muted"})}),s.jsx("h2",{className:"text-sm font-bold text-text-muted uppercase tracking-widest",children:"Skill Profile"})]}),s.jsx("div",{className:"flex justify-center",children:s.jsxs("svg",{viewBox:"0 0 200 200",width:200,height:200,className:"overflow-visible",children:[[.33,.66,1].map(e=>s.jsx("polygon",{points:_u(e,a,o,70),fill:"none",stroke:"var(--color-bg-surface-3)",strokeWidth:.5,opacity:.6},e)),Array.from({length:5}).map((e,t)=>{const[n,r]=Du(t,1,a,o,70);return s.jsx("line",{x1:a,y1:o,x2:n,y2:r,stroke:"var(--color-bg-surface-3)",strokeWidth:.5,opacity:.4},\`axis-\${t}\`)}),s.jsx(Hl.polygon,{points:u,fill:"var(--color-accent)",fillOpacity:.2,stroke:"var(--color-accent)",strokeWidth:1.5,strokeLinejoin:"round",initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},transition:{duration:.6,ease:[.22,1,.36,1]},style:{transformOrigin:"100px 100px"}}),r.map((e,t)=>{const n=Math.max(e,.02),[r,l]=Du(t,n,a,o,70),u=2===t&&!i;return s.jsx("circle",{cx:r,cy:l,r:2.5,fill:u?"var(--color-text-muted)":"var(--color-accent-bright)",opacity:u?.4:1},\`point-\${t}\`)}),Au.map((e,t)=>{const n=function(e,t,n,r){const[i,a]=Du(e,1.28,t,n,r);let o="middle";return 1!==e&&2!==e||(o="start"),3!==e&&4!==e||(o="end"),{x:i,y:a,anchor:o}}(t,a,o,70),r=2===t&&!i;return s.jsx("text",{x:n.x,y:n.y,textAnchor:n.anchor,dominantBaseline:"central",className:"text-[9px] font-medium",fill:r?"var(--color-text-muted)":"var(--color-text-secondary)",opacity:r?.5:1,children:e},e)})]})}),s.jsx("div",{className:"flex justify-center gap-3 mt-2 flex-wrap",children:Au.map((e,t)=>{const n=2===t&&!i,a=Math.round(100*r[t]);return s.jsxs("span",{className:"text-[10px] font-mono "+(n?"text-text-muted/50":"text-text-muted"),children:[a,"%"]},e)})})]})}const zu={feature:"bg-success/10 text-success border-success/20",bugfix:"bg-error/10 text-error border-error/20",refactor:"bg-purple/10 text-purple border-purple/20",test:"bg-blue/10 text-blue border-blue/20",docs:"bg-accent/10 text-accent border-accent/20",setup:"bg-text-muted/10 text-text-muted border-text-muted/20",deployment:"bg-emerald/10 text-emerald border-emerald/20"};function Fu(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return\`\${n}m ago\`;const r=Math.floor(n/60);if(r<24)return\`\${r}h ago\`;const i=Math.floor(r/24);return 1===i?"yesterday":i<7?\`\${i}d ago\`:new Date(e).toLocaleDateString([],{month:"short",day:"numeric"})}function Ou({milestones:e}){const t=[...e].sort((e,t)=>new Date(t.created_at).getTime()-new Date(e.created_at).getTime()).slice(0,8);return s.jsxs(Hl.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.35,ease:[.22,1,.36,1]},className:"rounded-xl bg-bg-surface-1 border border-border/50 p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3 px-1",children:[s.jsx(de,{className:"w-4 h-4 text-accent"}),s.jsx("h2",{className:"text-sm font-bold text-text-muted uppercase tracking-widest",children:"Recent Achievements"}),s.jsxs("span",{className:"text-[10px] text-text-muted font-mono bg-bg-surface-2 px-2 py-0.5 rounded ml-auto",children:[e.length," total"]})]}),0===t.length?s.jsx("div",{className:"text-sm text-text-muted text-center py-6",children:"No milestones yet \u2014 complete your first session!"}):s.jsx("div",{className:"space-y-0.5",children:t.map((e,t)=>{const n=Ql[e.category]??"#9c9588",r=zu[e.category]??"bg-bg-surface-2 text-text-secondary border-border",i=Kl[e.client]??e.client.slice(0,2).toUpperCase(),a=Yl[e.client]??"#91919a",o=e.private_title||e.title,l="complex"===e.complexity;return s.jsxs(Hl.div,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:{duration:.25,delay:.04*t},className:"flex items-center gap-3 py-2 px-2 rounded-lg hover:bg-bg-surface-2/40 transition-colors",children:[s.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:n}}),s.jsx("span",{className:"text-sm font-medium text-text-secondary hover:text-text-primary truncate flex-1 min-w-0",children:o}),s.jsx("span",{className:\`text-[9px] uppercase tracking-wider font-bold px-1.5 py-0.5 rounded-full border flex-shrink-0 \${r}\`,children:e.category}),l&&s.jsxs("span",{className:"flex items-center gap-0.5 text-[9px] uppercase tracking-wider font-bold px-1.5 py-0.5 rounded-full border bg-purple/10 text-purple border-purple/20 flex-shrink-0",children:[s.jsx(q,{className:"w-2.5 h-2.5"}),"complex"]}),s.jsx("span",{className:"text-[10px] text-text-muted font-mono flex-shrink-0",children:Fu(e.created_at)}),s.jsx("div",{className:"w-5 h-5 rounded flex items-center justify-center text-[8px] font-bold font-mono flex-shrink-0",style:{backgroundColor:\`\${a}15\`,color:a,border:\`1px solid \${a}20\`},children:i})]},e.id)})})]})}function Vu(){const{sessions:e,milestones:t,config:n,health:r,loading:i,timeTravelTime:a,timeScale:o,filters:l,loadAll:u,loadHealth:c,setTimeTravelTime:d,setTimeScale:h,setFilter:p}=F();f.useEffect(()=>{u(),c()},[u,c]),f.useEffect(()=>{const e=setInterval(c,3e4);if(null!==a)return()=>clearInterval(e);const t=setInterval(u,3e4);return()=>{clearInterval(e),clearInterval(t)}},[a,u,c]);const m=null===a,g=a??Date.now(),y=z[o]/2,v=g-y,b=g+y,x=f.useMemo(()=>function(e,t,n){return e.filter(e=>{const r=new Date(e.started_at).getTime(),i=new Date(e.ended_at).getTime();return r<=n&&i>=t})}(e,v,b),[e,v,b]),w=f.useMemo(()=>function(e,t,n){return e.filter(e=>{const r=new Date(e.created_at).getTime();return r>=t&&r<=n})}(t,v,b),[t,v,b]),k=f.useMemo(()=>function(e,t=[]){let n=0,r=0;const i={},a={},o={},s={};for(const u of e){n+=u.duration_seconds,r+=u.files_touched,i[u.client]=(i[u.client]??0)+u.duration_seconds;for(const e of u.languages)a[e]=(a[e]??0)+u.duration_seconds;o[u.task_type]=(o[u.task_type]??0)+u.duration_seconds,u.project&&(s[u.project]=(s[u.project]??0)+u.duration_seconds)}const l=function(e){let t=0,n=0,r=0;for(const i of e)"feature"===i.category&&t++,"bugfix"===i.category&&n++,"complex"===i.complexity&&r++;return{featuresShipped:t,bugsFixed:n,complexSolved:r}}(t);return{totalHours:n/3600,totalSessions:e.length,currentStreak:V(e),filesTouched:r,...l,byClient:i,byLanguage:a,byTaskType:o,byProject:s}}(x,w),[x,w]),S=f.useMemo(()=>function(e,t,n){if(n)return"Live";const r=new Date((e+t)/2),i=new Date,a=new Date(Date.now()-864e5);return r.toDateString()===i.toDateString()?"Today":r.toDateString()===a.toDateString()?"Yesterday":r.toLocaleDateString([],{month:"short",day:"numeric"})}(v,b,m),[v,b,m]),E=f.useMemo(()=>{if(!m)return new Date(g).toISOString().slice(0,10)},[m,g]);return i?s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsx("div",{className:"text-text-muted text-sm",children:"Loading..."})}):s.jsx("div",{className:"min-h-screen bg-bg-base selection:bg-accent/30 selection:text-text-primary",children:s.jsxs("div",{className:"max-w-[1000px] mx-auto px-6 py-10",children:[s.jsx(pe,{health:r,timeContextLabel:S}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Pu,{value:a,onChange:d,scale:o,onScaleChange:h,sessions:e,milestones:t}),s.jsx(Mu,{sessions:x,milestones:w,isLive:m,windowStart:v,windowEnd:b}),s.jsx(ql,{totalHours:k.totalHours,totalSessions:k.totalSessions,currentStreak:k.currentStreak,filesTouched:k.filesTouched,featuresShipped:k.featuresShipped,bugsFixed:k.bugsFixed,complexSolved:k.complexSolved}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[s.jsx(Lu,{sessions:x}),s.jsx(Ru,{sessions:x,milestones:w,streak:k.currentStreak})]}),s.jsx(Ou,{milestones:w}),s.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-1 gap-8",children:s.jsxs("div",{children:[s.jsx(eu,{stats:k}),s.jsx(ru,{byTaskType:k.byTaskType}),s.jsx(au,{sessions:x,filters:l,onFilterChange:p}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between px-1",children:[s.jsx("h2",{className:"text-sm font-bold text-text-muted uppercase tracking-widest",children:"Activity Feed"}),s.jsxs("span",{className:"text-[10px] text-text-muted font-mono bg-bg-surface-2 px-2 py-0.5 rounded",children:[x.length," Sessions"]})]}),s.jsx(hu,{sessions:x,milestones:w,filters:l})]})]})}),s.jsx("div",{className:"mt-12",children:s.jsx(pu,{sessions:e,timeScale:o,effectiveTime:g,isLive:m,onDayClick:e=>{const t=new Date(\`\${e}T12:00:00\`).getTime();d(t),h("24h")},highlightDate:E})}),s.jsx(gu,{config:n,onRefresh:u})]})]})})}M.createRoot(document.getElementById("root")).render(s.jsx(f.StrictMode,{children:s.jsx(Vu,{})}));</script>
1972
- <style rel="stylesheet" crossorigin>/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:"Geist Mono","JetBrains Mono","SF Mono","Fira Code",ui-monospace,monospace;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-bold:700;--tracking-tighter:-.05em;--tracking-tight:-.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0,0,.2,1)infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--font-body:"Inter",system-ui,-apple-system,sans-serif;--color-bg-base:#09090b;--color-bg-surface-1:#18181b;--color-bg-surface-2:#27272a;--color-bg-surface-3:#3f3f46;--color-text-primary:#fafafa;--color-text-secondary:#a1a1aa;--color-text-muted:#71717a;--color-accent:#6366f1;--color-accent-bright:#818cf8;--color-accent-dim:#3730a3;--color-border:#27272a;--color-border-accent:#6366f133;--color-success:#10b981;--color-error:#ef4444;--color-blue:#3b82f6;--color-purple:#8b5cf6}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--color-border)}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.-top-10{top:calc(var(--spacing)*-10)}.top-0{top:calc(var(--spacing)*0)}.top-3{top:calc(var(--spacing)*3)}.top-4{top:calc(var(--spacing)*4)}.-bottom-1{bottom:calc(var(--spacing)*-1)}.-bottom-1\\.5{bottom:calc(var(--spacing)*-1.5)}.bottom-0{bottom:calc(var(--spacing)*0)}.bottom-2{bottom:calc(var(--spacing)*2)}.bottom-3{bottom:calc(var(--spacing)*3)}.-left-\\[1\\.15rem\\]{left:-1.15rem}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-\\[1\\.65rem\\]{left:1.65rem}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-\\[9999\\]{z-index:9999}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-auto{margin-inline:auto}.my-0\\.5{margin-block:calc(var(--spacing)*.5)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-12{margin-top:calc(var(--spacing)*12)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-1\\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.-ml-2{margin-left:calc(var(--spacing)*-2)}.ml-1\\.5{margin-left:calc(var(--spacing)*1.5)}.ml-auto{margin-left:auto}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.h-1\\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-2\\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-8{height:calc(var(--spacing)*8)}.h-16{height:calc(var(--spacing)*16)}.h-20{height:calc(var(--spacing)*20)}.h-full{height:100%}.h-px{height:1px}.min-h-screen{min-height:100vh}.w-1\\.5{width:calc(var(--spacing)*1.5)}.w-2{width:calc(var(--spacing)*2)}.w-2\\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-8{width:calc(var(--spacing)*8)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-24{width:calc(var(--spacing)*24)}.w-28{width:calc(var(--spacing)*28)}.w-32{width:calc(var(--spacing)*32)}.w-40{width:calc(var(--spacing)*40)}.w-\\[2px\\]{width:2px}.w-\\[165px\\]{width:165px}.w-full{width:100%}.w-px{width:1px}.max-w-\\[280px\\]{max-width:280px}.max-w-\\[1000px\\]{max-width:1000px}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[140px\\]{min-width:140px}.min-w-\\[180px\\]{min-width:180px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.origin-bottom{transform-origin:bottom}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-105{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x)var(--tw-scale-y)}.rotate-45{rotate:45deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.touch-none{touch-action:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-8{gap:calc(var(--spacing)*8)}.gap-\\[3px\\]{gap:3px}:where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t-full{border-top-left-radius:3.40282e38px;border-top-right-radius:3.40282e38px}.rounded-t-md{border-top-left-radius:var(--radius-md);border-top-right-radius:var(--radius-md)}.rounded-t-sm{border-top-left-radius:var(--radius-sm);border-top-right-radius:var(--radius-sm)}.rounded-b-full{border-bottom-right-radius:3.40282e38px;border-bottom-left-radius:3.40282e38px}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-accent{border-color:var(--color-accent)}.border-accent\\/10{border-color:#6366f11a}@supports (color:color-mix(in lab,red,red)){.border-accent\\/10{border-color:color-mix(in oklab,var(--color-accent)10%,transparent)}}.border-accent\\/20{border-color:#6366f133}@supports (color:color-mix(in lab,red,red)){.border-accent\\/20{border-color:color-mix(in oklab,var(--color-accent)20%,transparent)}}.border-bg-surface-1{border-color:var(--color-bg-surface-1)}.border-blue\\/20{border-color:#3b82f633}@supports (color:color-mix(in lab,red,red)){.border-blue\\/20{border-color:color-mix(in oklab,var(--color-blue)20%,transparent)}}.border-border{border-color:var(--color-border)}.border-border-accent{border-color:var(--color-border-accent)}.border-border\\/30{border-color:#27272a4d}@supports (color:color-mix(in lab,red,red)){.border-border\\/30{border-color:color-mix(in oklab,var(--color-border)30%,transparent)}}.border-border\\/50{border-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.border-border\\/50{border-color:color-mix(in oklab,var(--color-border)50%,transparent)}}.border-border\\/60{border-color:#27272a99}@supports (color:color-mix(in lab,red,red)){.border-border\\/60{border-color:color-mix(in oklab,var(--color-border)60%,transparent)}}.border-error\\/20{border-color:#ef444433}@supports (color:color-mix(in lab,red,red)){.border-error\\/20{border-color:color-mix(in oklab,var(--color-error)20%,transparent)}}.border-purple\\/20{border-color:#8b5cf633}@supports (color:color-mix(in lab,red,red)){.border-purple\\/20{border-color:color-mix(in oklab,var(--color-purple)20%,transparent)}}.border-success\\/20{border-color:#10b98133}@supports (color:color-mix(in lab,red,red)){.border-success\\/20{border-color:color-mix(in oklab,var(--color-success)20%,transparent)}}.border-text-muted\\/20{border-color:#71717a33}@supports (color:color-mix(in lab,red,red)){.border-text-muted\\/20{border-color:color-mix(in oklab,var(--color-text-muted)20%,transparent)}}.bg-accent{background-color:var(--color-accent)}.bg-accent\\/5{background-color:#6366f10d}@supports (color:color-mix(in lab,red,red)){.bg-accent\\/5{background-color:color-mix(in oklab,var(--color-accent)5%,transparent)}}.bg-accent\\/10{background-color:#6366f11a}@supports (color:color-mix(in lab,red,red)){.bg-accent\\/10{background-color:color-mix(in oklab,var(--color-accent)10%,transparent)}}.bg-bg-base{background-color:var(--color-bg-base)}.bg-bg-surface-1{background-color:var(--color-bg-surface-1)}.bg-bg-surface-1\\/20{background-color:#18181b33}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface-1\\/20{background-color:color-mix(in oklab,var(--color-bg-surface-1)20%,transparent)}}.bg-bg-surface-1\\/30{background-color:#18181b4d}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface-1\\/30{background-color:color-mix(in oklab,var(--color-bg-surface-1)30%,transparent)}}.bg-bg-surface-1\\/40{background-color:#18181b66}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface-1\\/40{background-color:color-mix(in oklab,var(--color-bg-surface-1)40%,transparent)}}.bg-bg-surface-1\\/50{background-color:#18181b80}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface-1\\/50{background-color:color-mix(in oklab,var(--color-bg-surface-1)50%,transparent)}}.bg-bg-surface-1\\/80{background-color:#18181bcc}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface-1\\/80{background-color:color-mix(in oklab,var(--color-bg-surface-1)80%,transparent)}}.bg-bg-surface-2{background-color:var(--color-bg-surface-2)}.bg-bg-surface-2\\/50{background-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface-2\\/50{background-color:color-mix(in oklab,var(--color-bg-surface-2)50%,transparent)}}.bg-bg-surface-3{background-color:var(--color-bg-surface-3)}.bg-bg-surface-3\\/95{background-color:#3f3f46f2}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface-3\\/95{background-color:color-mix(in oklab,var(--color-bg-surface-3)95%,transparent)}}.bg-blue\\/10{background-color:#3b82f61a}@supports (color:color-mix(in lab,red,red)){.bg-blue\\/10{background-color:color-mix(in oklab,var(--color-blue)10%,transparent)}}.bg-border\\/30{background-color:#27272a4d}@supports (color:color-mix(in lab,red,red)){.bg-border\\/30{background-color:color-mix(in oklab,var(--color-border)30%,transparent)}}.bg-border\\/50{background-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.bg-border\\/50{background-color:color-mix(in oklab,var(--color-border)50%,transparent)}}.bg-error\\/10{background-color:#ef44441a}@supports (color:color-mix(in lab,red,red)){.bg-error\\/10{background-color:color-mix(in oklab,var(--color-error)10%,transparent)}}.bg-purple\\/10{background-color:#8b5cf61a}@supports (color:color-mix(in lab,red,red)){.bg-purple\\/10{background-color:color-mix(in oklab,var(--color-purple)10%,transparent)}}.bg-success{background-color:var(--color-success)}.bg-success\\/10{background-color:#10b9811a}@supports (color:color-mix(in lab,red,red)){.bg-success\\/10{background-color:color-mix(in oklab,var(--color-success)10%,transparent)}}.bg-text-muted\\/10{background-color:#71717a1a}@supports (color:color-mix(in lab,red,red)){.bg-text-muted\\/10{background-color:color-mix(in oklab,var(--color-text-muted)10%,transparent)}}.bg-transparent{background-color:#0000}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-transparent{--tw-gradient-from:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-white\\/10{--tw-gradient-to:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.to-white\\/10{--tw-gradient-to:color-mix(in oklab,var(--color-white)10%,transparent)}}.to-white\\/10{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.p-1{padding:calc(var(--spacing)*1)}.p-1\\.5{padding:calc(var(--spacing)*1.5)}.p-2{padding:calc(var(--spacing)*2)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.px-0\\.5{padding-inline:calc(var(--spacing)*.5)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-5{padding-block:calc(var(--spacing)*5)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-10{padding-block:calc(var(--spacing)*10)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pl-3{padding-left:calc(var(--spacing)*3)}.pl-6{padding-left:calc(var(--spacing)*6)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[8px\\]{font-size:8px}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-tighter{--tw-tracking:var(--tracking-tighter);letter-spacing:var(--tracking-tighter)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.text-accent{color:var(--color-accent)}.text-accent-dim{color:var(--color-accent-dim)}.text-accent\\/70{color:#6366f1b3}@supports (color:color-mix(in lab,red,red)){.text-accent\\/70{color:color-mix(in oklab,var(--color-accent)70%,transparent)}}.text-accent\\/80{color:#6366f1cc}@supports (color:color-mix(in lab,red,red)){.text-accent\\/80{color:color-mix(in oklab,var(--color-accent)80%,transparent)}}.text-blue{color:var(--color-blue)}.text-error{color:var(--color-error)}.text-purple{color:var(--color-purple)}.text-success{color:var(--color-success)}.text-text-muted{color:var(--color-text-muted)}.text-text-muted\\/50{color:#71717a80}@supports (color:color-mix(in lab,red,red)){.text-text-muted\\/50{color:color-mix(in oklab,var(--color-text-muted)50%,transparent)}}.text-text-muted\\/60{color:#71717a99}@supports (color:color-mix(in lab,red,red)){.text-text-muted\\/60{color:color-mix(in oklab,var(--color-text-muted)60%,transparent)}}.text-text-muted\\/70{color:#71717ab3}@supports (color:color-mix(in lab,red,red)){.text-text-muted\\/70{color:color-mix(in oklab,var(--color-text-muted)70%,transparent)}}.text-text-primary{color:var(--color-text-primary)}.text-text-secondary{color:var(--color-text-secondary)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.opacity-0{opacity:0}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_10px_rgba\\(16\\,185\\,129\\,0\\.1\\)\\]{--tw-shadow:0 0 10px var(--tw-shadow-color,#10b9811a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_10px_rgba\\(99\\,102\\,241\\,0\\.2\\)\\]{--tw-shadow:0 0 10px var(--tw-shadow-color,#6366f133);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_15px_rgba\\(99\\,102\\,241\\,0\\.4\\)\\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#6366f166);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_15px_rgba\\(99\\,102\\,241\\,0\\.5\\)\\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#6366f180);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_2px_10px_rgba\\(99\\,102\\,241\\,0\\.4\\)\\]{--tw-shadow:0 2px 10px var(--tw-shadow-color,#6366f166);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-accent\\/20{--tw-shadow-color:#6366f133}@supports (color:color-mix(in lab,red,red)){.shadow-accent\\/20{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-accent)20%,transparent)var(--tw-shadow-alpha),transparent)}}.ring-accent{--tw-ring-color:var(--color-accent)}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.ring-offset-bg-base{--tw-ring-offset-color:var(--color-bg-base)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\\:scale-x-110:is(:where(.group):hover *){--tw-scale-x:110%;scale:var(--tw-scale-x)var(--tw-scale-y)}.group-hover\\:-rotate-90:is(:where(.group):hover *){rotate:-90deg}.group-hover\\:rotate-180:is(:where(.group):hover *){rotate:180deg}.group-hover\\:bg-accent:is(:where(.group):hover *){background-color:var(--color-accent)}.group-hover\\:bg-accent\\/10:is(:where(.group):hover *){background-color:#6366f11a}@supports (color:color-mix(in lab,red,red)){.group-hover\\:bg-accent\\/10:is(:where(.group):hover *){background-color:color-mix(in oklab,var(--color-accent)10%,transparent)}}.group-hover\\:text-accent:is(:where(.group):hover *){color:var(--color-accent)}.group-hover\\:text-text-primary:is(:where(.group):hover *){color:var(--color-text-primary)}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}.selection\\:bg-accent\\/30 ::selection{background-color:#6366f14d}@supports (color:color-mix(in lab,red,red)){.selection\\:bg-accent\\/30 ::selection{background-color:color-mix(in oklab,var(--color-accent)30%,transparent)}}.selection\\:bg-accent\\/30::selection{background-color:#6366f14d}@supports (color:color-mix(in lab,red,red)){.selection\\:bg-accent\\/30::selection{background-color:color-mix(in oklab,var(--color-accent)30%,transparent)}}.selection\\:text-text-primary ::selection{color:var(--color-text-primary)}.selection\\:text-text-primary::selection{color:var(--color-text-primary)}.placeholder\\:text-text-muted\\/50::placeholder{color:#71717a80}@supports (color:color-mix(in lab,red,red)){.placeholder\\:text-text-muted\\/50::placeholder{color:color-mix(in oklab,var(--color-text-muted)50%,transparent)}}.focus-within\\:border-accent\\/50:focus-within{border-color:#6366f180}@supports (color:color-mix(in lab,red,red)){.focus-within\\:border-accent\\/50:focus-within{border-color:color-mix(in oklab,var(--color-accent)50%,transparent)}}.focus-within\\:ring-1:focus-within{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-within\\:ring-accent\\/50:focus-within{--tw-ring-color:#6366f180}@supports (color:color-mix(in lab,red,red)){.focus-within\\:ring-accent\\/50:focus-within{--tw-ring-color:color-mix(in oklab,var(--color-accent)50%,transparent)}}@media(hover:hover){.hover\\:scale-125:hover{--tw-scale-x:125%;--tw-scale-y:125%;--tw-scale-z:125%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\\:border-accent\\/30:hover{border-color:#6366f14d}@supports (color:color-mix(in lab,red,red)){.hover\\:border-accent\\/30:hover{border-color:color-mix(in oklab,var(--color-accent)30%,transparent)}}.hover\\:border-accent\\/40:hover{border-color:#6366f166}@supports (color:color-mix(in lab,red,red)){.hover\\:border-accent\\/40:hover{border-color:color-mix(in oklab,var(--color-accent)40%,transparent)}}.hover\\:border-border-accent\\/50:hover{border-color:#6366f11a}@supports (color:color-mix(in lab,red,red)){.hover\\:border-border-accent\\/50:hover{border-color:color-mix(in oklab,var(--color-border-accent)50%,transparent)}}.hover\\:border-text-muted\\/50:hover{border-color:#71717a80}@supports (color:color-mix(in lab,red,red)){.hover\\:border-text-muted\\/50:hover{border-color:color-mix(in oklab,var(--color-text-muted)50%,transparent)}}.hover\\:bg-accent:hover{background-color:var(--color-accent)}.hover\\:bg-accent-bright:hover{background-color:var(--color-accent-bright)}.hover\\:bg-bg-surface-1\\/40:hover{background-color:#18181b66}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-bg-surface-1\\/40:hover{background-color:color-mix(in oklab,var(--color-bg-surface-1)40%,transparent)}}.hover\\:bg-bg-surface-2:hover{background-color:var(--color-bg-surface-2)}.hover\\:bg-bg-surface-2\\/40:hover{background-color:#27272a66}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-bg-surface-2\\/40:hover{background-color:color-mix(in oklab,var(--color-bg-surface-2)40%,transparent)}}.hover\\:bg-bg-surface-2\\/50:hover{background-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-bg-surface-2\\/50:hover{background-color:color-mix(in oklab,var(--color-bg-surface-2)50%,transparent)}}.hover\\:bg-bg-surface-3:hover{background-color:var(--color-bg-surface-3)}.hover\\:text-text-primary:hover{color:var(--color-text-primary)}.hover\\:text-white:hover{color:var(--color-white)}.hover\\:opacity-80:hover{opacity:.8}}.active\\:cursor-grabbing:active{cursor:grabbing}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-20:disabled{opacity:.2}.disabled\\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\\:flex{display:flex}.sm\\:flex-row{flex-direction:row}}@media(min-width:48rem){.md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\\:flex-row{flex-direction:row}.md\\:items-center{align-items:center}}@media(min-width:64rem){.lg\\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.lg\\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}}::selection{color:var(--color-text-primary);background:#6366f14d}::-webkit-scrollbar{width:5px;height:5px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--color-bg-surface-3);border-radius:10px}::-webkit-scrollbar-thumb:hover{background:var(--color-text-muted)}body{font-family:var(--font-body);background:var(--color-bg-base);color:var(--color-text-primary);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;min-height:100vh;margin:0;line-height:1.6}.glass-card{-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);background:#18181bb3;border:1px solid #ffffff0d;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.subtle-glow{position:relative}.subtle-glow:after{content:"";border-radius:inherit;z-index:-1;pointer-events:none;background:linear-gradient(45deg,#0000,#6366f11a,#0000);position:absolute;inset:-1px}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}</style>
1974
+ */function ye({health:e,timeContextLabel:t}){return s.jsxs("div",{className:"flex items-center justify-between mb-8",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-accent flex items-center justify-center shadow-[0_0_15px_rgba(99,102,241,0.4)]",children:s.jsx("span",{className:"font-mono text-white font-bold text-lg",children:"U"})}),s.jsx("div",{children:s.jsxs("h1",{className:"text-xl font-bold tracking-tight text-text-primary flex items-center gap-2",children:["UseAI",s.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-bg-surface-2 text-text-muted font-mono uppercase tracking-widest border border-border/50",children:"Dashboard"})]})})]}),s.jsxs("div",{className:"flex items-center gap-4",children:[e&&e.active_sessions>0&&s.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-full bg-success/10 border border-success/20",children:[s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"w-2 h-2 rounded-full bg-success animate-ping absolute inset-0"}),s.jsx("div",{className:"w-2 h-2 rounded-full bg-success relative"})]}),s.jsxs("span",{className:"text-xs font-medium text-success",children:[e.active_sessions," active session",1!==e.active_sessions?"s":""]})]}),s.jsxs("div",{className:"flex items-center gap-2 text-xs text-text-muted font-mono bg-bg-surface-1 px-3 py-1.5 rounded-md border border-border",children:[s.jsx(W,{className:"w-3 h-3"}),t]})]})]})}const ve=f.createContext({});function be(e){const t=f.useRef(null);return null===t.current&&(t.current=e()),t.current}const xe="undefined"!=typeof window,we=xe?f.useLayoutEffect:f.useEffect,ke=f.createContext(null);function Se(e,t){-1===e.indexOf(t)&&e.push(t)}function Ee(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Te=(e,t,n)=>n>t?t:n<e?e:n;const Ce={},Pe=e=>/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(e);function je(e){return"object"==typeof e&&null!==e}const Ne=e=>/^0[^.\\s]+$/u.test(e);function Me(e){let t;return()=>(void 0===t&&(t=e()),t)}const Le=e=>e,Ae=(e,t)=>n=>t(e(n)),De=(...e)=>e.reduce(Ae),_e=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r};class Re{constructor(){this.subscriptions=[]}add(e){return Se(this.subscriptions,e),()=>Ee(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){const r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ze=e=>1e3*e,Fe=e=>e/1e3;function Oe(e,t){return t?e*(1e3/t):0}const Ve=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Ie(e,t,n,r){if(e===t&&n===r)return Le;const i=t=>function(e,t,n,r,i){let a,o,s=0;do{o=t+(n-t)/2,a=Ve(o,r,i)-e,a>0?n=o:t=o}while(Math.abs(a)>1e-7&&++s<12);return o}(t,0,1,e,n);return e=>0===e||1===e?e:Ve(i(e),t,r)}const Be=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,$e=e=>t=>1-e(1-t),Ue=Ie(.33,1.53,.69,.99),He=$e(Ue),We=Be(He),qe=e=>(e*=2)<1?.5*He(e):.5*(2-Math.pow(2,-10*(e-1))),Ye=e=>1-Math.sin(Math.acos(e)),Xe=$e(Ye),Ke=Be(Ye),Qe=Ie(.42,0,1,1),Ge=Ie(0,0,.58,1),Ze=Ie(.42,0,.58,1),Je=e=>Array.isArray(e)&&"number"==typeof e[0],et={linear:Le,easeIn:Qe,easeInOut:Ze,easeOut:Ge,circIn:Ye,circInOut:Ke,circOut:Xe,backIn:He,backInOut:We,backOut:Ue,anticipate:qe},tt=e=>{if(Je(e)){e.length;const[t,n,r,i]=e;return Ie(t,n,r,i)}return"string"==typeof e?et[e]:e},nt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function rt(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=nt.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,i=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(l.schedule(t),e()),t(o)}const l={schedule:(e,i=!1,o=!1)=>{const s=o&&r?t:n;return i&&a.add(e),s.has(e)||s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{o=e,r?i=!0:(r=!0,[t,n]=[n,t],t.forEach(s),t.clear(),r=!1,i&&(i=!1,l.process(e)))}};return l}(a),e),{}),{setup:s,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:f,render:h,postRender:p}=o,m=()=>{const a=Ce.useManualTiming?i.timestamp:performance.now();n=!1,Ce.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(a-i.timestamp,40),1)),i.timestamp=a,i.isProcessing=!0,s.process(i),l.process(i),u.process(i),c.process(i),d.process(i),f.process(i),h.process(i),p.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(m))};return{schedule:nt.reduce((t,a)=>{const s=o[a];return t[a]=(t,a=!1,o=!1)=>(n||(n=!0,r=!0,i.isProcessing||e(m)),s.schedule(t,a,o)),t},{}),cancel:e=>{for(let t=0;t<nt.length;t++)o[nt[t]].cancel(e)},state:i,steps:o}}const{schedule:it,cancel:at,state:ot,steps:st}=rt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Le,!0);let lt;function ut(){lt=void 0}const ct={now:()=>(void 0===lt&&ct.set(ot.isProcessing||Ce.useManualTiming?ot.timestamp:performance.now()),lt),set:e=>{lt=e,queueMicrotask(ut)}},dt=e=>t=>"string"==typeof t&&t.startsWith(e),ft=dt("--"),ht=dt("var(--"),pt=e=>!!ht(e)&&mt.test(e.split("/*")[0].trim()),mt=/var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;function gt(e){return"string"==typeof e&&e.split("/*")[0].includes("var(--")}const yt={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},vt={...yt,transform:e=>Te(0,1,e)},bt={...yt,default:1},xt=e=>Math.round(1e5*e)/1e5,wt=/-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;const kt=/^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu,St=(e,t)=>n=>Boolean("string"==typeof n&&kt.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),Et=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[i,a,o,s]=r.match(wt);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:void 0!==s?parseFloat(s):1}},Tt={...yt,transform:e=>Math.round((e=>Te(0,255,e))(e))},Ct={test:St("rgb","red"),parse:Et("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Tt.transform(e)+", "+Tt.transform(t)+", "+Tt.transform(n)+", "+xt(vt.transform(r))+")"};const Pt={test:St("#"),parse:function(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}},transform:Ct.transform},jt=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>\`\${t}\${e}\`}),Nt=jt("deg"),Mt=jt("%"),Lt=jt("px"),At=jt("vh"),Dt=jt("vw"),_t=(()=>({...Mt,parse:e=>Mt.parse(e)/100,transform:e=>Mt.transform(100*e)}))(),Rt={test:St("hsl","hue"),parse:Et("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Mt.transform(xt(t))+", "+Mt.transform(xt(n))+", "+xt(vt.transform(r))+")"},zt={test:e=>Ct.test(e)||Pt.test(e)||Rt.test(e),parse:e=>Ct.test(e)?Ct.parse(e):Rt.test(e)?Rt.parse(e):Pt.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?Ct.transform(e):Rt.transform(e),getAnimatableNone:e=>{const t=zt.parse(e);return t.alpha=0,zt.transform(t)}},Ft=/(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;const Ot="number",Vt="color",It=/var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;function Bt(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const o=t.replace(It,e=>(zt.test(e)?(r.color.push(a),i.push(Vt),n.push(zt.parse(e))):e.startsWith("var(")?(r.var.push(a),i.push("var"),n.push(e)):(r.number.push(a),i.push(Ot),n.push(parseFloat(e))),++a,"\${}")).split("\${}");return{values:n,split:o,indexes:r,types:i}}function $t(e){return Bt(e).values}function Ut(e){const{split:t,types:n}=Bt(e),r=t.length;return e=>{let i="";for(let a=0;a<r;a++)if(i+=t[a],void 0!==e[a]){const t=n[a];i+=t===Ot?xt(e[a]):t===Vt?zt.transform(e[a]):e[a]}return i}}const Ht=e=>"number"==typeof e?0:zt.test(e)?zt.getAnimatableNone(e):e;const Wt={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(wt)?.length||0)+(e.match(Ft)?.length||0)>0},parse:$t,createTransformer:Ut,getAnimatableNone:function(e){const t=$t(e);return Ut(e)(t.map(Ht))}};function qt(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Yt(e,t){return n=>n>0?t:e}const Xt=(e,t,n)=>e+(t-e)*n,Kt=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Qt=[Pt,Ct,Rt];function Gt(e){const t=(n=e,Qt.find(e=>e.test(n)));var n;if(!Boolean(t))return!1;let r=t.parse(e);return t===Rt&&(r=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let i=0,a=0,o=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=qt(s,r,e+1/3),a=qt(s,r,e),o=qt(s,r,e-1/3)}else i=a=o=n;return{red:Math.round(255*i),green:Math.round(255*a),blue:Math.round(255*o),alpha:r}}(r)),r}const Zt=(e,t)=>{const n=Gt(e),r=Gt(t);if(!n||!r)return Yt(e,t);const i={...n};return e=>(i.red=Kt(n.red,r.red,e),i.green=Kt(n.green,r.green,e),i.blue=Kt(n.blue,r.blue,e),i.alpha=Xt(n.alpha,r.alpha,e),Ct.transform(i))},Jt=new Set(["none","hidden"]);function en(e,t){return n=>Xt(e,t,n)}function tn(e){return"number"==typeof e?en:"string"==typeof e?pt(e)?Yt:zt.test(e)?Zt:an:Array.isArray(e)?nn:"object"==typeof e?zt.test(e)?Zt:rn:Yt}function nn(e,t){const n=[...e],r=n.length,i=e.map((e,n)=>tn(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function rn(e,t){const n={...e,...t},r={};for(const i in n)void 0!==e[i]&&void 0!==t[i]&&(r[i]=tn(e[i])(e[i],t[i]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const an=(e,t)=>{const n=Wt.createTransformer(t),r=Bt(e),i=Bt(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Jt.has(e)&&!i.values.length||Jt.has(t)&&!r.values.length?function(e,t){return Jt.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):De(nn(function(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}(r,i),i.values),n):Yt(e,t)};function on(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return Xt(e,t,n);return tn(e)(e,t)}const sn=e=>{const t=({timestamp:t})=>e(t);return{start:(e=!0)=>it.update(t,e),stop:()=>at(t),now:()=>ot.isProcessing?ot.timestamp:ct.now()}},ln=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)r+=Math.round(1e4*e(a/(i-1)))/1e4+", ";return\`linear(\${r.substring(0,r.length-2)})\`},un=2e4;function cn(e){let t=0;let n=e.next(t);for(;!n.done&&t<un;)t+=50,n=e.next(t);return t>=un?1/0:t}function dn(e,t,n){const r=Math.max(t-5,0);return Oe(n-e(r),t-r)}const fn=100,hn=10,pn=1,mn=0,gn=800,yn=.3,vn=.3,bn={granular:.01,default:2},xn={granular:.005,default:.5},wn=.01,kn=10,Sn=.05,En=1,Tn=.001;function Cn({duration:e=gn,bounce:t=yn,velocity:n=mn,mass:r=pn}){let i,a,o=1-t;o=Te(Sn,En,o),e=Te(wn,kn,Fe(e)),o<1?(i=t=>{const r=t*o,i=r*e,a=r-n,s=jn(t,o),l=Math.exp(-i);return Tn-a/s*l},a=t=>{const r=t*o*e,a=r*n+n,s=Math.pow(o,2)*Math.pow(t,2)*e,l=Math.exp(-r),u=jn(Math.pow(t,2),o);return(-i(t)+Tn>0?-1:1)*((a-s)*l)/u}):(i=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,a=t=>Math.exp(-t*e)*(e*e*(n-t)));const s=function(e,t,n){let r=n;for(let i=1;i<Pn;i++)r-=e(r)/t(r);return r}(i,a,5/e);if(e=ze(e),isNaN(s))return{stiffness:fn,damping:hn,duration:e};{const t=Math.pow(s,2)*r;return{stiffness:t,damping:2*o*Math.sqrt(r*t),duration:e}}}const Pn=12;function jn(e,t){return e*Math.sqrt(1-t*t)}const Nn=["duration","bounce"],Mn=["stiffness","damping","mass"];function Ln(e,t){return t.some(t=>void 0!==e[t])}function An(e=vn,t=yn){const n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:u,mass:c,duration:d,velocity:f,isResolvedFromDuration:h}=function(e){let t={velocity:mn,stiffness:fn,damping:hn,mass:pn,isResolvedFromDuration:!1,...e};if(!Ln(e,Mn)&&Ln(e,Nn))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(1.2*n),i=r*r,a=2*Te(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:pn,stiffness:i,damping:a}}else{const n=Cn(e);t={...t,...n,mass:pn},t.isResolvedFromDuration=!0}return t}({...n,velocity:-Fe(n.velocity||0)}),p=f||0,m=u/(2*Math.sqrt(l*c)),g=o-a,y=Fe(Math.sqrt(l/c)),v=Math.abs(g)<5;let b;if(r||(r=v?bn.granular:bn.default),i||(i=v?xn.granular:xn.default),m<1){const e=jn(y,m);b=t=>{const n=Math.exp(-m*y*t);return o-n*((p+m*y*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}}else if(1===m)b=e=>o-Math.exp(-y*e)*(g+(p+y*g)*e);else{const e=y*Math.sqrt(m*m-1);b=t=>{const n=Math.exp(-m*y*t),r=Math.min(e*t,300);return o-n*((p+m*y*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}const x={calculatedDuration:h&&d||null,next:e=>{const t=b(e);if(h)s.done=e>=d;else{let n=0===e?p:0;m<1&&(n=0===e?ze(p):dn(b,e,t));const a=Math.abs(n)<=r,l=Math.abs(o-t)<=i;s.done=a&&l}return s.value=s.done?o:t,s},toString:()=>{const e=Math.min(cn(x),un),t=ln(t=>x.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return x}function Dn({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},h=e=>void 0===s?l:void 0===l||Math.abs(s-e)<Math.abs(l-e)?s:l;let p=n*t;const m=d+p,g=void 0===o?m:o(m);g!==m&&(p=g-d);const y=e=>-p*Math.exp(-e/r),v=e=>g+y(e),b=e=>{const t=y(e),n=v(e);f.done=Math.abs(t)<=u,f.value=f.done?g:n};let x,w;const k=e=>{var t;(t=f.value,void 0!==s&&t<s||void 0!==l&&t>l)&&(x=e,w=An({keyframes:[f.value,h(f.value)],velocity:dn(v,e,f.value),damping:i,stiffness:a,restDelta:u,restSpeed:c}))};return k(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==x||(t=!0,b(e),k(e)),void 0!==x&&e>=x?w.next(e-x):(!t&&b(e),f)}}}function _n(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const a=e.length;if(t.length,1===a)return()=>t[0];if(2===a&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const r=[],i=n||Ce.mix||on,a=e.length-1;for(let o=0;o<a;o++){let n=i(e[o],e[o+1]);if(t){const e=Array.isArray(t)?t[o]||Le:t;n=De(e,n)}r.push(n)}return r}(t,r,i),l=s.length,u=n=>{if(o&&n<e[0])return t[0];let r=0;if(l>1)for(;r<e.length-2&&!(n<e[r+1]);r++);const i=_e(e[r],e[r+1],n);return s[r](i)};return n?t=>u(Te(e[0],e[a-1],t)):u}function Rn(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=_e(0,t,r);e.push(Xt(n,1,i))}}(t,e.length-1),t}function zn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(tt):tt(r),a={done:!1,value:t[0]},o=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:Rn(t),e),s=_n(o,t,{ease:Array.isArray(i)?i:(l=t,u=i,l.map(()=>u||Ze).splice(0,l.length-1))});var l,u;return{calculatedDuration:e,next:t=>(a.value=s(t),a.done=t>=e,a)}}An.applyToOptions=e=>{const t=function(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(cn(r),un);return{type:"keyframes",ease:e=>r.next(i*e).value/t,duration:Fe(i)}}(e,100,An);return e.ease=t.ease,e.duration=ze(t.duration),e.type="keyframes",e};const Fn=e=>null!==e;function On(e,{repeat:t,repeatType:n="loop"},r,i=1){const a=e.filter(Fn),o=i<0||t&&"loop"!==n&&t%2==1?0:a.length-1;return o&&void 0!==r?r:a[o]}const Vn={decay:Dn,inertia:Dn,tween:zn,keyframes:zn,spring:An};function In(e){"string"==typeof e.type&&(e.type=Vn[e.type])}class Bn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}const $n=e=>e/100;class Un extends Bn{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:e}=this.options;e&&e.updatedAt!==ct.now()&&this.tick(ct.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause()}initAnimation(){const{options:e}=this;In(e);const{type:t=zn,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e;let{keyframes:o}=e;const s=t||zn;s!==zn&&"number"!=typeof o[0]&&(this.mixKeyframes=De($n,on(o[0],o[1])),o=[0,100]);const l=s({...e,keyframes:o});"mirror"===i&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),null===l.calculatedDuration&&(l.calculatedDuration=cn(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=l}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:u,repeat:c,repeatType:d,repeatDelay:f,type:h,onUpdate:p,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=r);let v=this.currentTime,b=n;if(c){const e=Math.min(this.currentTime,r)/o;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,c+1);Boolean(t%2)&&("reverse"===d?(n=1-n,f&&(n-=f/o)):"mirror"===d&&(b=a)),v=Te(0,1,n)*o}const x=y?{done:!1,value:u[0]}:b.next(v);i&&(x.value=i(x.value));let{done:w}=x;y||null===s||(w=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const k=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return k&&h!==Dn&&(x.value=On(u,this.options,m,this.speed)),p&&p(x.value),k&&this.finish(),x}then(e,t){return this.finished.then(e,t)}get duration(){return Fe(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Fe(e)}get time(){return Fe(this.currentTime)}set time(e){e=ze(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(ct.now());const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Fe(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=sn,startTime:t}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=t??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ct.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}const Hn=e=>180*e/Math.PI,Wn=e=>{const t=Hn(Math.atan2(e[1],e[0]));return Yn(t)},qn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Wn,rotateZ:Wn,skewX:e=>Hn(Math.atan(e[1])),skewY:e=>Hn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Yn=e=>((e%=360)<0&&(e+=360),e),Xn=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Kn=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Qn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Xn,scaleY:Kn,scale:e=>(Xn(e)+Kn(e))/2,rotateX:e=>Yn(Hn(Math.atan2(e[6],e[5]))),rotateY:e=>Yn(Hn(Math.atan2(-e[2],e[0]))),rotateZ:Wn,rotate:Wn,skewX:e=>Hn(Math.atan(e[4])),skewY:e=>Hn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Gn(e){return e.includes("scale")?1:0}function Zn(e,t){if(!e||"none"===e)return Gn(t);const n=e.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u);let r,i;if(n)r=Qn,i=n;else{const t=e.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u);r=qn,i=t}if(!i)return Gn(t);const a=r[t],o=i[1].split(",").map(Jn);return"function"==typeof a?a(o):o[a]}function Jn(e){return parseFloat(e.trim())}const er=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],tr=(()=>new Set(er))(),nr=e=>e===yt||e===Lt,rr=new Set(["x","y","z"]),ir=er.filter(e=>!rr.has(e));const ar={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Zn(t,"x"),y:(e,{transform:t})=>Zn(t,"y")};ar.translateX=ar.x,ar.translateY=ar.y;const or=new Set;let sr=!1,lr=!1,ur=!1;function cr(){if(lr){const e=Array.from(or).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{const t=function(e){const t=[];return ir.forEach(n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}lr=!1,sr=!1,or.forEach(e=>e.complete(ur)),or.clear()}function dr(){or.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(lr=!0)})}class fr{constructor(e,t,n,r,i,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(or.add(this),sr||(sr=!0,it.read(dr),it.resolveKeyframes(cr))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(null===e[0]){const i=r?.get(),a=e[e.length-1];if(void 0!==i)e[0]=i;else if(n&&t){const r=n.readValue(t,a);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=a),r&&void 0===i&&r.set(e[0])}!function(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),or.delete(this)}cancel(){"scheduled"===this.state&&(or.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const hr=Me(()=>void 0!==window.ScrollTimeline),pr={};function mr(e,t){const n=Me(e);return()=>pr[t]??n()}const gr=mr(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),yr=([e,t,n,r])=>\`cubic-bezier(\${e}, \${t}, \${n}, \${r})\`,vr={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:yr([0,.65,.55,1]),circOut:yr([.55,0,1,.45]),backIn:yr([.31,.01,.66,-.59]),backOut:yr([.33,1.53,.69,.99])};function br(e,t){return e?"function"==typeof e?gr()?ln(e,t):"ease-out":Je(e)?yr(e):Array.isArray(e)?e.map(e=>br(e,t)||vr.easeOut):vr[e]:void 0}function xr(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:s="easeOut",times:l}={},u=void 0){const c={[t]:n};l&&(c.offset=l);const d=br(s,i);Array.isArray(d)&&(c.easing=d);const f={delay:r,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:"reverse"===o?"alternate":"normal"};u&&(f.pseudoElement=u);return e.animate(c,f)}function wr(e){return"function"==typeof e&&"applyToOptions"in e}class kr extends Bn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=Boolean(i),this.allowFlatten=a,this.options=e,e.type;const l=function({type:e,...t}){return wr(e)&&gr()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=xr(t,n,r,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const e=On(r,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(e):function(e,t,n){(e=>e.startsWith("--"))(t)?e.style.setProperty(t,n):e.style[t]=n}(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return Fe(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Fe(e)}get time(){return Fe(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ze(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:t}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&hr()?(this.animation.timeline=e,Le):t(this)}}const Sr={anticipate:qe,backInOut:We,circInOut:Ke};function Er(e){"string"==typeof e.ease&&e.ease in Sr&&(e.ease=Sr[e.ease])}class Tr extends kr{constructor(e){Er(e),In(e),super(e),void 0!==e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(void 0!==e)return void t.set(e);const o=new Un({...a,autoplay:!1}),s=Math.max(10,ct.now()-this.startTime),l=Te(0,10,s-10);t.setWithVelocity(o.sample(Math.max(0,s-l)).value,o.sample(s).value,l),o.stop()}}const Cr=(e,t)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Wt.test(e)&&"0"!==e||e.startsWith("url(")));function Pr(e){e.duration=0,e.type="keyframes"}const jr=new Set(["opacity","clipPath","filter","transform"]),Nr=Me(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Mr extends Bn{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:a="loop",keyframes:o,name:s,motionValue:l,element:u,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ct.now();const d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:l,element:u,...c},f=u?.KeyframeResolver||fr;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;const{name:i,type:a,velocity:o,delay:s,isHandoff:l,onUpdate:u}=n;this.resolvedAt=ct.now(),function(e,t,n,r){const i=e[0];if(null===i)return!1;if("display"===t||"visibility"===t)return!0;const a=e[e.length-1],o=Cr(i,t),s=Cr(a,t);return!(!o||!s)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||("spring"===n||wr(n))&&r)}(e,i,a,o)||(!Ce.instantAnimations&&s||u?.(On(e,n,t)),e[0]=e[e.length-1],Pr(n),n.repeat=0);const c={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},d=!l&&function(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o}=e,s=t?.owner?.current;if(!(s instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=t.owner.getProps();return Nr()&&n&&jr.has(n)&&("transform"!==n||!u)&&!l&&!r&&"mirror"!==i&&0!==a&&"inertia"!==o}(c),f=c.motionValue?.owner?.current,h=d?new Tr({...c,element:f}):new Un(c);h.finished.then(()=>{this.notifyFinished()}).catch(Le),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ur=!0,dr(),cr(),ur=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Lr(e,t,n,r=0,i=1){const a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return"function"==typeof n?n(a,o):1===i?a*r:s-a*r}const Ar=/^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u;function Dr(e,t,n=1){const[r,i]=function(e){const t=Ar.exec(e);if(!t)return[,];const[,n,r,i]=t;return[\`--\${n??r}\`,i]}(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const e=a.trim();return Pe(e)?parseFloat(e):e}return pt(i)?Dr(i,t,n+1):i}const _r={type:"spring",stiffness:500,damping:25,restSpeed:10},Rr={type:"keyframes",duration:.8},zr={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fr=(e,{keyframes:t})=>t.length>2?Rr:tr.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:_r:zr,Or=e=>null!==e;function Vr(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Ir(e,t){const n=e?.[t]??e?.default??e;return n!==e?Vr(n,e):n}const Br=(e,t,n,r={},i,a)=>o=>{const s=Ir(r,e)||{},l=s.delay||r.delay||0;let{elapsed:u=0}=r;u-=ze(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-u,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(s)||Object.assign(c,Fr(e,c)),c.duration&&(c.duration=ze(c.duration)),c.repeatDelay&&(c.repeatDelay=ze(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(Pr(c),0===c.delay&&(d=!0)),(Ce.instantAnimations||Ce.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,Pr(c),c.delay=0),c.allowFlatten=!s.type&&!s.ease,d&&!a&&void 0!==t.get()){const e=function(e,{repeat:t,repeatType:n="loop"}){const r=e.filter(Or);return r[t&&"loop"!==n&&t%2==1?0:r.length-1]}(c.keyframes,s);if(void 0!==e)return void it.update(()=>{c.onUpdate(e),c.onComplete()})}return s.isSync?new Un(c):new Mr(c)};function $r(e){const t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Ur(e,t,n,r){if("function"==typeof t){const[i,a]=$r(r);t=t(void 0!==n?n:e.custom,i,a)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[i,a]=$r(r);t=t(void 0!==n?n:e.custom,i,a)}return t}function Hr(e,t,n){const r=e.getProps();return Ur(r,t,void 0!==n?n:r.custom,e)}const Wr=new Set(["width","height","top","left","right","bottom",...er]);class qr{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{const t=ct.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const n of this.dependents)n.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=ct.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Re);const n=this.events[e].add(t);return"change"===e?()=>{n(),it.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=ct.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Oe(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Yr(e,t){return new qr(e,t)}const Xr=e=>Array.isArray(e);function Kr(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Yr(n))}function Qr(e){return Xr(e)?e[e.length-1]||0:e}const Gr=e=>Boolean(e&&e.getVelocity);function Zr(e,t){const n=e.getValue("willChange");if(r=n,Boolean(Gr(r)&&r.add))return n.add(t);if(!n&&Ce.WillChange){const n=new Ce.WillChange("auto");e.addValue("willChange",n),n.add(t)}var r}function Jr(e){return e.replace(/([A-Z])/g,e=>\`-\${e.toLowerCase()}\`)}const ei="data-"+Jr("framerAppearId");function ti(e){return e.props[ei]}function ni({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function ri(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t;const l=e.getDefaultTransition();a=a?Vr(a,l):l;const u=a?.reduceMotion;r&&(a=r);const c=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const f in s){const t=e.getValue(f,e.latestValues[f]??null),r=s[f];if(void 0===r||d&&ni(d,f))continue;const i={delay:n,...Ir(a||{},f)},o=t.get();if(void 0!==o&&!t.isAnimating&&!Array.isArray(r)&&r===o&&!i.velocity)continue;let l=!1;if(window.MotionHandoffAnimation){const t=ti(e);if(t){const e=window.MotionHandoffAnimation(t,f,it);null!==e&&(i.startTime=e,l=!0)}}Zr(e,f);const h=u??e.shouldReduceMotion;t.start(Br(f,t,r,h&&Wr.has(f)?{type:!1}:i,e,l));const p=t.animation;p&&c.push(p)}if(o){const t=()=>it.update(()=>{o&&function(e,t){const n=Hr(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const o in a)Kr(e,o,Qr(a[o]))}(e,o)});c.length?Promise.all(c).then(t):t()}return c}function ii(e,t,n={}){const r=Hr(e,t,"exit"===n.type?e.presenceContext?.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const a=r?()=>Promise.all(ri(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return function(e,t,n=0,r=0,i=0,a=1,o){const s=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),s.push(ii(l,t,{...o,delay:n+("function"==typeof r?0:r)+Lr(e.variantChildren,l,r,i,a)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(s)}(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){const[e,t]="beforeChildren"===s?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}const ai=e=>t=>t.test(e),oi=[yt,Lt,Mt,Nt,Dt,At,{test:e=>"auto"===e,parse:e=>e}],si=e=>oi.find(ai(e));function li(e){return"number"==typeof e?0===e:null===e||("none"===e||"0"===e||Ne(e))}const ui=new Set(["brightness","contrast","saturate","opacity"]);function ci(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(wt)||[];if(!r)return e;const i=n.replace(r,"");let a=ui.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const di=/\\b([a-z-]*)\\(.*?\\)/gu,fi={...Wt,getAnimatableNone:e=>{const t=e.match(di);return t?t.map(ci).join(" "):e}},hi={...yt,transform:Math.round},pi={borderWidth:Lt,borderTopWidth:Lt,borderRightWidth:Lt,borderBottomWidth:Lt,borderLeftWidth:Lt,borderRadius:Lt,borderTopLeftRadius:Lt,borderTopRightRadius:Lt,borderBottomRightRadius:Lt,borderBottomLeftRadius:Lt,width:Lt,maxWidth:Lt,height:Lt,maxHeight:Lt,top:Lt,right:Lt,bottom:Lt,left:Lt,inset:Lt,insetBlock:Lt,insetBlockStart:Lt,insetBlockEnd:Lt,insetInline:Lt,insetInlineStart:Lt,insetInlineEnd:Lt,padding:Lt,paddingTop:Lt,paddingRight:Lt,paddingBottom:Lt,paddingLeft:Lt,paddingBlock:Lt,paddingBlockStart:Lt,paddingBlockEnd:Lt,paddingInline:Lt,paddingInlineStart:Lt,paddingInlineEnd:Lt,margin:Lt,marginTop:Lt,marginRight:Lt,marginBottom:Lt,marginLeft:Lt,marginBlock:Lt,marginBlockStart:Lt,marginBlockEnd:Lt,marginInline:Lt,marginInlineStart:Lt,marginInlineEnd:Lt,fontSize:Lt,backgroundPositionX:Lt,backgroundPositionY:Lt,...{rotate:Nt,rotateX:Nt,rotateY:Nt,rotateZ:Nt,scale:bt,scaleX:bt,scaleY:bt,scaleZ:bt,skew:Nt,skewX:Nt,skewY:Nt,distance:Lt,translateX:Lt,translateY:Lt,translateZ:Lt,x:Lt,y:Lt,z:Lt,perspective:Lt,transformPerspective:Lt,opacity:vt,originX:_t,originY:_t,originZ:Lt},zIndex:hi,fillOpacity:vt,strokeOpacity:vt,numOctaves:hi},mi={...pi,color:zt,backgroundColor:zt,outlineColor:zt,fill:zt,stroke:zt,borderColor:zt,borderTopColor:zt,borderRightColor:zt,borderBottomColor:zt,borderLeftColor:zt,filter:fi,WebkitFilter:fi},gi=e=>mi[e];function yi(e,t){let n=gi(e);return n!==fi&&(n=Wt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const vi=new Set(["auto","none","0"]);class bi extends fr{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let s=0;s<e.length;s++){let n=e[s];if("string"==typeof n&&(n=n.trim(),pt(n))){const r=Dr(n,t.current);void 0!==r&&(e[s]=r),s===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!Wr.has(n)||2!==e.length)return;const[r,i]=e,a=si(r),o=si(i);if(gt(r)!==gt(i)&&ar[n])this.needsMeasurement=!0;else if(a!==o)if(nr(a)&&nr(o))for(let s=0;s<e.length;s++){const t=e[s];"string"==typeof t&&(e[s]=parseFloat(t))}else ar[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let r=0;r<e.length;r++)(null===e[r]||li(e[r]))&&n.push(r);n.length&&function(e,t,n){let r,i=0;for(;i<e.length&&!r;){const t=e[i];"string"==typeof t&&!vi.has(t)&&Bt(t).values.length&&(r=e[i]),i++}if(r&&n)for(const a of t)e[a]=yi(n,r)}(e,n,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ar[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];void 0!==r&&e.getValue(n,r).jump(r,!1)}measureEndState(){const{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;const r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);const i=n.length-1,a=n[i];n[i]=ar[t](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==a&&void 0===this.finalKeyframe&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const xi=new Set(["opacity","clipPath","filter","transform"]);function wi(e,t,n){if(null==e)return[];if(e instanceof EventTarget)return[e];if("string"==typeof e){let t=document;const r=n?.[e]??t.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e).filter(e=>null!=e)}const ki=(e,t)=>t&&"number"==typeof e?t.transform(e):e;function Si(e){return je(e)&&"offsetHeight"in e}const{schedule:Ei}=rt(queueMicrotask,!1),Ti={x:!1,y:!1};function Ci(){return Ti.x||Ti.y}function Pi(e,t){const n=wi(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function ji(e,t,n={}){const[r,i,a]=Pi(e,n);return r.forEach(e=>{let n,r=!1,a=!1;const o=t=>{n&&(n(t),n=void 0),e.removeEventListener("pointerleave",l)},s=e=>{r=!1,window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s),a&&(a=!1,o(e))},l=e=>{"touch"!==e.pointerType&&(r?a=!0:o(e))};e.addEventListener("pointerenter",r=>{if("touch"===r.pointerType||Ci())return;a=!1;const o=t(e,r);"function"==typeof o&&(n=o,e.addEventListener("pointerleave",l,i))},i),e.addEventListener("pointerdown",()=>{r=!0,window.addEventListener("pointerup",s,i),window.addEventListener("pointercancel",s,i)},i)}),a}const Ni=(e,t)=>!!t&&(e===t||Ni(e,t.parentElement)),Mi=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,Li=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Ai=new Set(["INPUT","SELECT","TEXTAREA"]);const Di=new WeakSet;function _i(e){return t=>{"Enter"===t.key&&e(t)}}function Ri(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function zi(e){return Mi(e)&&!Ci()}const Fi=new WeakSet;function Oi(e,t,n={}){const[r,i,a]=Pi(e,n),o=e=>{const r=e.currentTarget;if(!zi(e))return;if(Fi.has(e))return;Di.add(r),n.stopPropagation&&Fi.add(e);const a=t(r,e),o=(e,t)=>{window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",l),Di.has(r)&&Di.delete(r),zi(e)&&"function"==typeof a&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||Ni(r,e.target))},l=e=>{o(e,!1)};window.addEventListener("pointerup",s,i),window.addEventListener("pointercancel",l,i)};return r.forEach(e=>{var t;(n.useGlobalTarget?window:e).addEventListener("pointerdown",o,i),Si(e)&&(e.addEventListener("focus",e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const r=_i(()=>{if(Di.has(n))return;Ri(n,"down");const e=_i(()=>{Ri(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>Ri(n,"cancel"),t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)})(e,i)),t=e,Li.has(t.tagName)||!0===t.isContentEditable||e.hasAttribute("tabindex")||(e.tabIndex=0))}),a}function Vi(e){return je(e)&&"ownerSVGElement"in e}const Ii=new WeakMap;let Bi;const $i=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+"Size"]:Vi(r)&&"getBBox"in r?r.getBBox()[t]:r[n],Ui=$i("inline","width","offsetWidth"),Hi=$i("block","height","offsetHeight");function Wi({target:e,borderBoxSize:t}){Ii.get(e)?.forEach(n=>{n(e,{get width(){return Ui(e,t)},get height(){return Hi(e,t)}})})}function qi(e){e.forEach(Wi)}function Yi(e,t){Bi||"undefined"!=typeof ResizeObserver&&(Bi=new ResizeObserver(qi));const n=wi(e);return n.forEach(e=>{let n=Ii.get(e);n||(n=new Set,Ii.set(e,n)),n.add(t),Bi?.observe(e)}),()=>{n.forEach(e=>{const n=Ii.get(e);n?.delete(t),n?.size||Bi?.unobserve(e)})}}const Xi=new Set;let Ki;function Qi(e){return Xi.add(e),Ki||(Ki=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Xi.forEach(t=>t(e))},window.addEventListener("resize",Ki)),()=>{Xi.delete(e),Xi.size||"function"!=typeof Ki||(window.removeEventListener("resize",Ki),Ki=void 0)}}function Gi(e,t){return"function"==typeof e?Qi(e):Yi(e,t)}const Zi=[...oi,zt,Wt],Ji=()=>({x:{min:0,max:0},y:{min:0,max:0}}),ea=new WeakMap;function ta(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function na(e){return"string"==typeof e||Array.isArray(e)}const ra=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ia=["initial",...ra];function aa(e){return ta(e.animate)||ia.some(t=>na(e[t]))}function oa(e){return Boolean(aa(e)||e.variants)}const sa={current:null},la={current:!1},ua="undefined"!=typeof window;const ca=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let da={};function fa(e){da=e}class ha{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=fr,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=ct.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,it.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=t.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=Boolean(a),this.isControllingVariants=aa(t),this.isVariantNode=oa(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const f in d){const e=d[f];void 0!==l[f]&&Gr(e)&&e.set(l[f])}}mount(e){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=e,ea.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(la.current||function(){if(la.current=!0,ua)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>sa.current=e.matches;e.addEventListener("change",t),t()}else sa.current=!1}(),this.shouldReduceMotion=sa.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),at(this.notifyUpdate),at(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&xi.has(e)&&this.current instanceof HTMLElement){const{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new kr({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:ze(o)}),l=n(s);return void this.valueSubscriptions.set(e,()=>{l(),s.cancel()})}const n=tr.has(e);n&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&it.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in da){const t=da[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let n=0;n<ca.length;n++){const t=ca[n];this.propEventSubscriptions[t]&&(this.propEventSubscriptions[t](),delete this.propEventSubscriptions[t]);const r=e["on"+t];r&&(this.propEventSubscriptions[t]=this.on(t,r))}this.prevMotionValues=function(e,t,n){for(const r in t){const i=t[r],a=n[r];if(Gr(i))e.addValue(r,i);else if(Gr(a))e.addValue(r,Yr(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){const t=e.getValue(r);!0===t.liveStyle?t.jump(i):t.hasAnimated||t.set(i)}else{const t=e.getStaticValue(r);e.addValue(r,Yr(void 0!==t?t:i,{owner:e}))}}for(const r in n)void 0===t[r]&&e.removeValue(r);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=Yr(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=void 0===this.latestValues[e]&&this.current?this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];var r;return null!=n&&("string"==typeof n&&(Pe(n)||Ne(n))?n=parseFloat(n):(r=n,!Zi.find(ai(r))&&Wt.test(t)&&(n=yi(e,t))),this.setBaseTarget(e,Gr(n)?n.get():n)),Gr(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){const{initial:t}=this.props;let n;if("string"==typeof t||"object"==typeof t){const r=Ur(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&void 0!==n)return n;const r=this.getBaseTargetFromProps(this.props,e);return void 0===r||Gr(r)?void 0!==this.initialValues[e]&&void 0===n?void 0:this.baseTarget[e]:r}on(e,t){return this.events[e]||(this.events[e]=new Re),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Ei.render(this.render)}}class pa extends ha{constructor(){super(...arguments),this.KeyframeResolver=bi}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){const n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Gr(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=\`\${e}\`)}))}}class ma{constructor(e){this.isMounted=!1,this.node=e}update(){}}function ga({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ya(e){return void 0===e||1===e}function va({scale:e,scaleX:t,scaleY:n}){return!ya(e)||!ya(t)||!ya(n)}function ba(e){return va(e)||xa(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function xa(e){return wa(e.x)||wa(e.y)}function wa(e){return e&&"0%"!==e}function ka(e,t,n){return n+t*(e-n)}function Sa(e,t,n,r,i){return void 0!==i&&(e=ka(e,i,r)),ka(e,n,r)+t}function Ea(e,t=0,n=1,r,i){e.min=Sa(e.min,t,n,r,i),e.max=Sa(e.max,t,n,r,i)}function Ta(e,{x:t,y:n}){Ea(e.x,t.translate,t.scale,t.originPoint),Ea(e.y,n.translate,n.scale,n.originPoint)}const Ca=.999999999999,Pa=1.0000000000001;function ja(e,t){e.min=e.min+t,e.max=e.max+t}function Na(e,t,n,r,i=.5){Ea(e,t,n,Xt(e.min,e.max,i),r)}function Ma(e,t){Na(e.x,t.x,t.scaleX,t.scale,t.originX),Na(e.y,t.y,t.scaleY,t.scale,t.originY)}function La(e,t){return ga(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}const Aa={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Da=er.length;function _a(e,t,n){const{style:r,vars:i,transformOrigin:a}=e;let o=!1,s=!1;for(const l in t){const e=t[l];if(tr.has(l))o=!0;else if(ft(l))i[l]=e;else{const t=ki(e,pi[l]);l.startsWith("origin")?(s=!0,a[l]=t):r[l]=t}}if(t.transform||(o||n?r.transform=function(e,t,n){let r="",i=!0;for(let a=0;a<Da;a++){const o=er[a],s=e[o];if(void 0===s)continue;let l=!0;if("number"==typeof s)l=s===(o.startsWith("scale")?1:0);else{const e=parseFloat(s);l=o.startsWith("scale")?1===e:0===e}if(!l||n){const e=ki(s,pi[o]);l||(i=!1,r+=\`\${Aa[o]||o}(\${e}) \`),n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}(t,e.transform,n):r.transform&&(r.transform="none")),s){const{originX:e="50%",originY:t="50%",originZ:n=0}=a;r.transformOrigin=\`\${e} \${t} \${n}\`}}function Ra(e,{style:t,vars:n},r,i){const a=e.style;let o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function za(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Fa={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!Lt.test(e))return e;e=parseFloat(e)}return\`\${za(e,t.target.x)}% \${za(e,t.target.y)}%\`}},Oa={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Wt.parse(e);if(i.length>5)return r;const a=Wt.createTransformer(e),o="number"!=typeof i[0]?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=l;const u=Xt(s,l,.5);return"number"==typeof i[2+o]&&(i[2+o]/=u),"number"==typeof i[3+o]&&(i[3+o]/=u),a(i)}},Va={borderRadius:{...Fa,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fa,borderTopRightRadius:Fa,borderBottomLeftRadius:Fa,borderBottomRightRadius:Fa,boxShadow:Oa};function Ia(e,{layout:t,layoutId:n}){return tr.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!Va[e]||"opacity"===e)}function Ba(e,t,n){const r=e.style,i=t?.style,a={};if(!r)return a;for(const o in r)(Gr(r[o])||i&&Gr(i[o])||Ia(o,e)||void 0!==n?.getValue(o)?.liveStyle)&&(a[o]=r[o]);return a}class $a extends pa{constructor(){super(...arguments),this.type="html",this.renderInstance=Ra}readValueFromInstance(e,t){if(tr.has(t))return this.projection?.isProjecting?Gn(t):((e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Zn(n,t)})(e,t);{const r=(n=e,window.getComputedStyle(n)),i=(ft(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return La(e,t)}build(e,t,n){_a(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Ba(e,t,n)}}const Ua={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ha={offset:"strokeDashoffset",array:"strokeDasharray"};const Wa=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function qa(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},l,u,c){if(_a(e,s,u),l)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=c?.transformBox??"fill-box",delete d.transformBox);for(const h of Wa)void 0!==d[h]&&(f[h]=d[h],delete d[h]);void 0!==t&&(d.x=t),void 0!==n&&(d.y=n),void 0!==r&&(d.scale=r),void 0!==i&&function(e,t,n=1,r=0,i=!0){e.pathLength=1;const a=i?Ua:Ha;e[a.offset]=""+-r,e[a.array]=\`\${t} \${n}\`}(d,i,a,o,!1)}const Ya=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Xa=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Ka(e,t,n){const r=Ba(e,t,n);for(const i in e)if(Gr(e[i])||Gr(t[i])){r[-1!==er.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=e[i]}return r}class Qa extends pa{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ji}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(tr.has(t)){const e=gi(t);return e&&e.default||0}return t=Ya.has(t)?t:Jr(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Ka(e,t,n)}build(e,t,n){qa(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){!function(e,t,n,r){Ra(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Ya.has(i)?i:Jr(i),t.attrs[i])}(e,t,0,r)}mount(e){this.isSVGTag=Xa(e.tagName),super.mount(e)}}const Ga=ia.length;function Za(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&Za(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<Ga;n++){const r=ia[n],i=e.props[r];(na(i)||!1===i)&&(t[r]=i)}return t}function Ja(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const eo=[...ra].reverse(),to=ra.length;function no(e){return t=>Promise.all(t.map(({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const i=t.map(t=>ii(e,t,n));r=Promise.all(i)}else if("string"==typeof t)r=ii(e,t,n);else{const i="function"==typeof t?Hr(e,t,n.custom):t;r=Promise.all(ri(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}(e,t,n)))}function ro(e){let t=no(e),n=oo(),r=!0;const i=t=>(n,r)=>{const i=Hr(e,r,"exit"===t?e.presenceContext?.custom:void 0);if(i){const{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function a(a){const{props:o}=e,s=Za(e.parent)||{},l=[],u=new Set;let c={},d=1/0;for(let t=0;t<to;t++){const f=eo[t],h=n[f],p=void 0!==o[f]?o[f]:s[f],m=na(p),g=f===a?h.isActive:null;!1===g&&(d=t);let y=p===s[f]&&p!==o[f]&&m;if(y&&r&&e.manuallyAnimateOnMount&&(y=!1),h.protectedKeys={...c},!h.isActive&&null===g||!p&&!h.prevProp||ta(p)||"boolean"==typeof p)continue;if("exit"===f&&h.isActive&&!0!==g){h.prevResolvedValues&&(c={...c,...h.prevResolvedValues});continue}const v=io(h.prevProp,p);let b=v||f===a&&h.isActive&&!y&&m||t>d&&m,x=!1;const w=Array.isArray(p)?p:[p];let k=w.reduce(i(f),{});!1===g&&(k={});const{prevResolvedValues:S={}}=h,E={...S,...k},T=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),h.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in E){const t=k[e],n=S[e];if(c.hasOwnProperty(e))continue;let r=!1;r=Xr(t)&&Xr(n)?!Ja(t,n):t!==n,r?null!=t?T(e):u.add(e):void 0!==t&&u.has(e)?T(e):h.protectedKeys[e]=!0}h.prevProp=p,h.prevResolvedValues=k,h.isActive&&(c={...c,...k}),r&&e.blockInitialAnimation&&(b=!1);const C=y&&v;b&&(!C||x)&&l.push(...w.map(t=>{const n={type:f};if("string"==typeof t&&r&&!C&&e.manuallyAnimateOnMount&&e.parent){const{parent:r}=e,i=Hr(r,t);if(r.enteringChildren&&i){const{delayChildren:t}=i.transition||{};n.delay=Lr(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){const t={};if("boolean"!=typeof o.initial){const n=Hr(e,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{const r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let f=Boolean(l.length);return!r||!1!==o.initial&&o.initial!==o.animate||e.manuallyAnimateOnMount||(f=!1),r=!1,f?t(l):Promise.resolve()}return{animateChanges:a,setActive:function(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;const i=a(t);for(const e in n)n[e].protectedKeys={};return i},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=oo()}}}function io(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!Ja(t,e)}function ao(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function oo(){return{animate:ao(!0),whileInView:ao(),whileHover:ao(),whileTap:ao(),whileDrag:ao(),whileFocus:ao(),exit:ao()}}function so(e,t){e.min=t.min,e.max=t.max}function lo(e,t){so(e.x,t.x),so(e.y,t.y)}function uo(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function co(e){return e.max-e.min}function fo(e,t,n,r=.5){e.origin=r,e.originPoint=Xt(t.min,t.max,e.origin),e.scale=co(n)/co(t),e.translate=Xt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function ho(e,t,n,r){fo(e.x,t.x,n.x,r?r.originX:void 0),fo(e.y,t.y,n.y,r?r.originY:void 0)}function po(e,t,n){e.min=n.min+t.min,e.max=e.min+co(t)}function mo(e,t,n){e.min=t.min-n.min,e.max=e.min+co(t)}function go(e,t,n){mo(e.x,t.x,n.x),mo(e.y,t.y,n.y)}function yo(e,t,n,r,i){return e=ka(e-=t,1/n,r),void 0!==i&&(e=ka(e,1/i,r)),e}function vo(e,t,[n,r,i],a,o){!function(e,t=0,n=1,r=.5,i,a=e,o=e){Mt.test(t)&&(t=parseFloat(t),t=Xt(o.min,o.max,t/100)-o.min);if("number"!=typeof t)return;let s=Xt(a.min,a.max,r);e===a&&(s-=t),e.min=yo(e.min,t,n,s,i),e.max=yo(e.max,t,n,s,i)}(e,t[n],t[r],t[i],t.scale,a,o)}const bo=["x","scaleX","originX"],xo=["y","scaleY","originY"];function wo(e,t,n,r){vo(e.x,t,bo,n?n.x:void 0,r?r.x:void 0),vo(e.y,t,xo,n?n.y:void 0,r?r.y:void 0)}function ko(e){return 0===e.translate&&1===e.scale}function So(e){return ko(e.x)&&ko(e.y)}function Eo(e,t){return e.min===t.min&&e.max===t.max}function To(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Co(e,t){return To(e.x,t.x)&&To(e.y,t.y)}function Po(e){return co(e.x)/co(e.y)}function jo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function No(e){return[e("x"),e("y")]}const Mo=["TopLeft","TopRight","BottomLeft","BottomRight"],Lo=Mo.length,Ao=e=>"string"==typeof e?parseFloat(e):e,Do=e=>"number"==typeof e||Lt.test(e);function _o(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Ro=Fo(0,.5,Xe),zo=Fo(.5,.95,Le);function Fo(e,t,n){return r=>r<e?0:r>t?1:n(_e(e,t,r))}function Oo(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const Vo=(e,t)=>e.depth-t.depth;class Io{constructor(){this.children=[],this.isDirty=!1}add(e){Se(this.children,e),this.isDirty=!0}remove(e){Ee(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Vo),this.isDirty=!1,this.children.forEach(e)}}function Bo(e){return Gr(e)?e.get():e}class $o{constructor(){this.members=[]}add(e){Se(this.members,e);for(let t=this.members.length-1;t>=0;t--){const n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;const r=n.instance;r&&!1===r.isConnected&&!1!==n.isPresent&&!n.snapshot&&Ee(this.members,n)}e.scheduleRender()}remove(e){if(Ee(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex(t=>e===t);if(0===t)return!1;let n;for(let r=t;r>=0;r--){const e=this.members[r],t=e.instance;if(!1!==e.isPresent&&(!t||!1!==t.isConnected)){n=e;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender();const r=n.options.layoutDependency,i=e.options.layoutDependency;if(!(void 0!==r&&void 0!==i&&r===i)){const r=n.instance;r&&!1===r.isConnected&&!n.snapshot||(e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0))}const{crossfade:a}=e.options;!1===a&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Uo={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ho=["","X","Y","Z"];let Wo=0;function qo(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Yo(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=ti(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",it,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Yo(r)}function Xo({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Wo++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Go),this.nodes.forEach(is),this.nodes.forEach(as),this.nodes.forEach(Zo)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Io)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Re),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;var n;this.isSVG=Vi(t)&&!(Vi(n=t)&&"svg"===n.tagName),this.instance=t;const{layoutId:r,layout:i,visualElement:a}=this.options;if(a&&!a.current&&a.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(i||r)&&(this.isLayoutDirty=!0),e){let n,r=0;const i=()=>this.root.updateBlockedByResize=!1;it.read(()=>{r=window.innerWidth}),e(t,()=>{const e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=ct.now(),r=({timestamp:i})=>{const a=i-n;a>=t&&(at(r),e(a-t))};return it.setup(r,!0),()=>at(r)}(i,250),Uo.hasAnimatedSinceResize&&(Uo.hasAnimatedSinceResize=!1,this.nodes.forEach(rs)))})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&a&&(r||i)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const i=this.options.transition||a.getDefaultTransition()||ds,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=a.getProps(),l=!this.targetLayout||!Co(this.targetLayout,r),u=!t&&n;if(this.options.layoutRoot||this.resumeFrom||u||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const t={...Ir(i,"layout"),onPlay:o,onComplete:s};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,u)}else t||rs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),at(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(os),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Yo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let i=0;i<this.path.length;i++){const e=this.path[i];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:t,layout:n}=this.options;if(void 0===t&&!n)return;const r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(es);if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(ts);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ns),this.nodes.forEach(Ko),this.nodes.forEach(Qo)):this.nodes.forEach(ts),this.clearAllSnapshots();const e=ct.now();ot.delta=Te(0,1e3/60,e-ot.timestamp),ot.timestamp=e,ot.isProcessing=!0,st.update.process(ot),st.preRender.process(ot),st.render.process(ot),ot.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ei.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Jo),this.sharedNodes.forEach(ss)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,it.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){it.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||co(this.snapshot.measuredBox.x)||co(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let n=0;n<this.path.length;n++){this.path[n].updateScroll()}const e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){const t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;const e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!So(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||ba(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let n=this.removeElementScroll(t);var r;return e&&(n=this.removeTransform(n)),ps((r=n).x),ps(r.y),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:e}=this.options;if(!e)return{x:{min:0,max:0},y:{min:0,max:0}};const t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(gs))){const{scroll:e}=this.root;e&&(ja(t.x,e.offset.x),ja(t.y,e.offset.y))}return t}removeElementScroll(e){const t={x:{min:0,max:0},y:{min:0,max:0}};if(lo(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){const r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&lo(t,e),ja(t.x,i.offset.x),ja(t.y,i.offset.y))}return t}applyTransform(e,t=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};lo(n,e);for(let r=0;r<this.path.length;r++){const e=this.path[r];!t&&e.options.layoutScroll&&e.scroll&&e!==e.root&&Ma(n,{x:-e.scroll.offset.x,y:-e.scroll.offset.y}),ba(e.latestValues)&&Ma(n,e.latestValues)}return ba(this.latestValues)&&Ma(n,this.latestValues),n}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};lo(t,e);for(let n=0;n<this.path.length;n++){const e=this.path[n];if(!e.instance)continue;if(!ba(e.latestValues))continue;va(e.latestValues)&&e.updateSnapshot();const r=Ji();lo(r,e.measurePageBox()),wo(t,e.latestValues,e.snapshot?e.snapshot.layoutBox:void 0,r)}return ba(this.latestValues)&&wo(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ot.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){const t=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=t.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=t.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=t.isSharedProjectionDirty);const n=Boolean(this.resumingFrom)||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:r,layoutId:i}=this.options;if(!this.layout||!r&&!i)return;this.resolvedRelativeTargetAt=ot.timestamp;const a=this.getClosestProjectingParent();var o,s,l;(a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta)&&(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),o=this.target,s=this.relativeTarget,l=this.relativeParent.target,po(o.x,s.x,l.x),po(o.y,s.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):lo(this.target,this.layout.layoutBox),Ta(this.target,this.targetDelta)):lo(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,a&&Boolean(a.resumingFrom)===Boolean(this.resumingFrom)&&!a.options.layoutScroll&&a.target&&1!==this.animationProgress?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(this.parent&&!va(this.parent.latestValues)&&!xa(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},go(this.relativeTargetOrigin,t,n),lo(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const e=this.getLead(),t=Boolean(this.resumingFrom)||this!==e;let n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===ot.timestamp&&(n=!1),n)return;const{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!r&&!i)return;lo(this.layoutCorrected,this.layout.layoutBox);const a=this.treeScale.x,o=this.treeScale.y;!function(e,t,n,r=!1){const i=n.length;if(!i)return;let a,o;t.x=t.y=1;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;const{visualElement:i}=a.options;i&&i.props.style&&"contents"===i.props.style.display||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Ma(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Ta(e,o)),r&&ba(a.latestValues)&&Ma(e,a.latestValues))}t.x<Pa&&t.x>Ca&&(t.x=1),t.y<Pa&&t.y>Ca&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,t),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox,e.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:s}=e;s?(this.projectionDelta&&this.prevProjectionDelta?(uo(this.prevProjectionDelta.x,this.projectionDelta.x),uo(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),ho(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===a&&this.treeScale.y===o&&jo(this.projectionDelta.x,this.prevProjectionDelta.x)&&jo(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",s))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const o={x:{min:0,max:0},y:{min:0,max:0}},s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,c=Boolean(s&&!u&&!0===this.options.crossfade&&!this.path.some(cs));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,f,h,p,m,g;ls(a.x,e.x,n),ls(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(go(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),h=this.relativeTarget,p=this.relativeTargetOrigin,m=o,g=n,us(h.x,p.x,m.x,g),us(h.y,p.y,m.y,g),d&&(l=this.relativeTarget,f=d,Eo(l.x,f.x)&&Eo(l.y,f.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),lo(d,this.relativeTarget)),s&&(this.animationValues=i,function(e,t,n,r,i,a){i?(e.opacity=Xt(0,n.opacity??1,Ro(r)),e.opacityExit=Xt(t.opacity??1,0,zo(r))):a&&(e.opacity=Xt(t.opacity??1,n.opacity??1,r));for(let o=0;o<Lo;o++){const i=\`border\${Mo[o]}Radius\`;let a=_o(t,i),s=_o(n,i);void 0===a&&void 0===s||(a||(a=0),s||(s=0),0===a||0===s||Do(a)===Do(s)?(e[i]=Math.max(Xt(Ao(a),Ao(s),r),0),(Mt.test(s)||Mt.test(a))&&(e[i]+="%")):e[i]=s)}(t.rotate||n.rotate)&&(e.rotate=Xt(t.rotate||0,n.rotate||0,r))}(i,r,this.latestValues,n,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(at(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=it.update(()=>{Uo.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Yr(0)),this.currentAnimation=function(e,t,n){const r=Gr(e)?e:Yr(e);return r.start(Br("",r,t,n)),r.animation}(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&ms(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=co(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=co(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}lo(t,n),Ma(t,i),ho(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new $o);this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){const{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&qo("z",e,r,this.animationValues);for(let i=0;i<Ho.length;i++)qo(\`rotate\${Ho[i]}\`,e,r,this.animationValues),qo(\`skew\${Ho[i]}\`,e,r,this.animationValues);e.render();for(const i in r)e.setStaticValue(i,r[i]),this.animationValues&&(this.animationValues[i]=r[i]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(e.visibility="hidden");const n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,e.visibility="",e.opacity="",e.pointerEvents=Bo(t?.pointerEvents)||"",void(e.transform=n?n(this.latestValues,""):"none");const r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target)return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=Bo(t?.pointerEvents)||""),void(this.hasProjected&&!ba(this.latestValues)&&(e.transform=n?n({},""):"none",this.hasProjected=!1));e.visibility="";const i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=function(e,t,n){let r="";const i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=\`translate3d(\${i}px, \${a}px, \${o}px) \`),1===t.x&&1===t.y||(r+=\`scale(\${1/t.x}, \${1/t.y}) \`),n){const{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=\`perspective(\${e}px) \${r}\`),t&&(r+=\`rotate(\${t}deg) \`),i&&(r+=\`rotateX(\${i}deg) \`),a&&(r+=\`rotateY(\${a}deg) \`),o&&(r+=\`skewX(\${o}deg) \`),s&&(r+=\`skewY(\${s}deg) \`)}const s=e.x.scale*t.x,l=e.y.scale*t.y;return 1===s&&1===l||(r+=\`scale(\${s}, \${l})\`),r||"none"}(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;const{x:o,y:s}=this.projectionDelta;e.transformOrigin=\`\${100*o.origin}% \${100*s.origin}% 0\`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?void 0!==i.opacity?i.opacity:"":void 0!==i.opacityExit?i.opacityExit:0;for(const l in Va){if(void 0===i[l])continue;const{correct:t,applyTo:n,isCSSVariable:o}=Va[l],s="none"===a?i[l]:t(i[l],r);if(n){const t=n.length;for(let r=0;r<t;r++)e[n[r]]=s}else o?this.options.visualElement.renderState.vars[l]=s:e[l]=s}this.options.layoutId&&(e.pointerEvents=r===this?Bo(t?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(es),this.root.sharedNodes.clear()}}}function Ko(e){e.updateLayout()}function Qo(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;"size"===i?No(e=>{const r=a?t.measuredBox[e]:t.layoutBox[e],i=co(r);r.min=n[e].min,r.max=r.min+i}):ms(i,t.layoutBox,n)&&No(r=>{const i=a?t.measuredBox[r]:t.layoutBox[r],o=co(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});const o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};ho(o,n,t.layoutBox);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};a?ho(s,e.applyTransform(r,!0),t.measuredBox):ho(s,n,t.layoutBox);const l=!So(o);let u=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:i,layout:a}=r;if(i&&a){const o={x:{min:0,max:0},y:{min:0,max:0}};go(o,t.layoutBox,i.layoutBox);const s={x:{min:0,max:0},y:{min:0,max:0}};go(s,n,a.layoutBox),Co(o,s)||(u=!0),r.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=o,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Go(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Zo(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Jo(e){e.clearSnapshot()}function es(e){e.clearMeasurements()}function ts(e){e.isLayoutDirty=!1}function ns(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function rs(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function is(e){e.resolveTargetDelta()}function as(e){e.calcProjection()}function os(e){e.resetSkewAndRotation()}function ss(e){e.removeLeadSnapshot()}function ls(e,t,n){e.translate=Xt(t.translate,0,n),e.scale=Xt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function us(e,t,n,r){e.min=Xt(t.min,n.min,r),e.max=Xt(t.max,n.max,r)}function cs(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const ds={duration:.45,ease:[.4,0,.1,1]},fs=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),hs=fs("applewebkit/")&&!fs("chrome/")?Math.round:Le;function ps(e){e.min=hs(e.min),e.max=hs(e.max)}function ms(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=Po(t),i=Po(n),a=.2,!(Math.abs(r-i)<=a));var r,i,a}function gs(e){return e!==e.root&&e.scroll?.wasRoot}const ys=Xo({attachResizeListener:(e,t)=>Oo(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),vs={current:void 0},bs=Xo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!vs.current){const e=new ys({});e.mount(window),e.setOptions({layoutScroll:!0}),vs.current=e}return vs.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),xs=f.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function ws(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function ks(...e){return f.useCallback(function(...e){return t=>{let n=!1;const r=e.map(e=>{const r=ws(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():ws(e[t],null)}}}}(...e),e)}class Ss extends f.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent&&!1!==this.props.pop){const e=t.offsetParent,n=Si(e)&&e.offsetWidth||0,r=Si(e)&&e.offsetHeight||0,i=this.props.sizeRef.current;i.height=t.offsetHeight||0,i.width=t.offsetWidth||0,i.top=t.offsetTop,i.left=t.offsetLeft,i.right=n-i.width-i.left,i.bottom=r-i.height-i.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Es({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){const o=f.useId(),l=f.useRef(null),u=f.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=f.useContext(xs),d=e.props?.ref??e?.ref,h=ks(l,d);return f.useInsertionEffect(()=>{const{width:e,height:s,top:d,left:f,right:h,bottom:p}=u.current;if(t||!1===a||!l.current||!e||!s)return;const m="left"===n?\`left: \${f}\`:\`right: \${h}\`,g="bottom"===r?\`bottom: \${p}\`:\`top: \${d}\`;l.current.dataset.motionPopId=o;const y=document.createElement("style");c&&(y.nonce=c);const v=i??document.head;return v.appendChild(y),y.sheet&&y.sheet.insertRule(\`\\n [data-motion-pop-id="\${o}"] {\\n position: absolute !important;\\n width: \${e}px !important;\\n height: \${s}px !important;\\n \${m}px !important;\\n \${g}px !important;\\n }\\n \`),()=>{v.contains(y)&&v.removeChild(y)}},[t]),s.jsx(Ss,{isPresent:t,childRef:l,sizeRef:u,pop:a,children:!1===a?e:f.cloneElement(e,{ref:h})})}const Ts=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:l,anchorY:u,root:c})=>{const d=be(Cs),h=f.useId();let p=!0,m=f.useMemo(()=>(p=!1,{id:h,initial:t,isPresent:n,custom:i,onExitComplete:e=>{d.set(e,!0);for(const t of d.values())if(!t)return;r&&r()},register:e=>(d.set(e,!1),()=>d.delete(e))}),[n,d,r]);return a&&p&&(m={...m}),f.useMemo(()=>{d.forEach((e,t)=>d.set(t,!1))},[n]),f.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),e=s.jsx(Es,{pop:"popLayout"===o,isPresent:n,anchorX:l,anchorY:u,root:c,children:e}),s.jsx(ke.Provider,{value:m,children:e})};function Cs(){return new Map}function Ps(e=!0){const t=f.useContext(ke);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,a=f.useId();f.useEffect(()=>{if(e)return i(a)},[e]);const o=f.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const js=e=>e.key||"";function Ns(e){const t=[];return f.Children.forEach(e,e=>{f.isValidElement(e)&&t.push(e)}),t}const Ms=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a="sync",propagate:o=!1,anchorX:l="left",anchorY:u="top",root:c})=>{const[d,h]=Ps(o),p=f.useMemo(()=>Ns(e),[e]),m=o&&!d?[]:p.map(js),g=f.useRef(!0),y=f.useRef(p),v=be(()=>new Map),b=f.useRef(new Set),[x,w]=f.useState(p),[k,S]=f.useState(p);we(()=>{g.current=!1,y.current=p;for(let e=0;e<k.length;e++){const t=js(k[e]);m.includes(t)?(v.delete(t),b.current.delete(t)):!0!==v.get(t)&&v.set(t,!1)}},[k,m.length,m.join("-")]);const E=[];if(p!==x){let e=[...p];for(let t=0;t<k.length;t++){const n=k[t],r=js(n);m.includes(r)||(e.splice(t,0,n),E.push(n))}return"wait"===a&&E.length&&(e=E),S(Ns(e)),w(p),null}const{forceRender:T}=f.useContext(ve);return s.jsx(s.Fragment,{children:k.map(e=>{const f=js(e),x=!(o&&!d)&&(p===k||m.includes(f));return s.jsx(Ts,{isPresent:x,initial:!(g.current&&!n)&&void 0,custom:t,presenceAffectsLayout:i,mode:a,root:c,onExitComplete:x?void 0:()=>{if(b.current.has(f))return;if(b.current.add(f),!v.has(f))return;v.set(f,!0);let e=!0;v.forEach(t=>{t||(e=!1)}),e&&(T?.(),S(y.current),o&&h?.(),r&&r())},anchorX:l,anchorY:u,children:e},f)})})},Ls=f.createContext({strict:!1}),As={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Ds=!1;function _s(){return function(){if(Ds)return;const e={};for(const t in As)e[t]={isEnabled:e=>As[t].some(t=>!!e[t])};fa(e),Ds=!0}(),da}const Rs=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function zs(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Rs.has(e)}let Fs=e=>!zs(e);try{"function"==typeof(Os=require("@emotion/is-prop-valid").default)&&(Fs=e=>e.startsWith("on")?!zs(e):Os(e))}catch{}var Os;const Vs=f.createContext({});function Is(e){const{initial:t,animate:n}=function(e,t){if(aa(e)){const{initial:t,animate:n}=e;return{initial:!1===t||na(t)?t:void 0,animate:na(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,f.useContext(Vs));return f.useMemo(()=>({initial:t,animate:n}),[Bs(t),Bs(n)])}function Bs(e){return Array.isArray(e)?e.join(" "):e}const $s=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Us(e,t,n){for(const r in t)Gr(t[r])||Ia(r,n)||(e[r]=t[r])}function Hs(e,t){const n={};return Us(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return f.useMemo(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return _a(n,t,e),Object.assign({},n.vars,n.style)},[t])}(e,t)),n}function Ws(e,t){const n={},r=Hs(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const qs=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function Ys(e,t,n,r){const i=f.useMemo(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return qa(n,t,Xa(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){const t={};Us(t,e.style,e),i.style={...t,...i.style}}return i}const Xs=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ks(e){return"string"==typeof e&&!e.includes("-")&&!!(Xs.indexOf(e)>-1||/[A-Z]/u.test(e))}function Qs(e,t,n,{latestValues:r},i,a=!1,o){const s=(o??Ks(e)?Ys:Ws)(t,r,i,e),l=function(e,t,n){const r={};for(const i in e)"values"===i&&"object"==typeof e.values||(Fs(i)||!0===n&&zs(i)||!t&&!zs(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}(t,"string"==typeof e,a),u=e!==f.Fragment?{...l,...s,ref:n}:{},{children:c}=t,d=f.useMemo(()=>Gr(c)?c.get():c,[c]);return f.createElement(e,{...u,children:d})}function Gs(e,t,n,r){const i={},a=r(e,{});for(const f in a)i[f]=Bo(a[f]);let{initial:o,animate:s}=e;const l=aa(e),u=oa(e);t&&u&&!l&&!1!==e.inherit&&(void 0===o&&(o=t.initial),void 0===s&&(s=t.animate));let c=!!n&&!1===n.initial;c=c||!1===o;const d=c?s:o;if(d&&"boolean"!=typeof d&&!ta(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){const r=Ur(e,t[n]);if(r){const{transitionEnd:e,transition:t,...n}=r;for(const r in n){let e=n[r];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(i[r]=e)}for(const r in e)i[r]=e[r]}}}return i}const Zs=e=>(t,n)=>{const r=f.useContext(Vs),i=f.useContext(ke),a=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Gs(n,r,i,e),renderState:t()}}(e,t,r,i);return n?a():be(a)},Js=Zs({scrapeMotionValuesFromProps:Ba,createRenderState:$s}),el=Zs({scrapeMotionValuesFromProps:Ka,createRenderState:qs}),tl=Symbol.for("motionComponentSymbol");function nl(e,t,n){const r=f.useRef(n);f.useInsertionEffect(()=>{r.current=n});const i=f.useRef(null);return f.useCallback(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());const a=r.current;if("function"==typeof a)if(n){const e=a(n);"function"==typeof e&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n)},[t])}const rl=f.createContext({});function il(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function al(e,t,n,r,i,a){const{visualElement:o}=f.useContext(Vs),s=f.useContext(Ls),l=f.useContext(ke),u=f.useContext(xs),c=u.reducedMotion,d=u.skipAnimations,h=f.useRef(null),p=f.useRef(!1);r=r||s.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:o,props:n,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:c,skipAnimations:d,isSVG:a}),p.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const m=h.current,g=f.useContext(rl);!m||m.projection||!i||"html"!==m.type&&"svg"!==m.type||function(e,t,n,r){const{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:ol(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:Boolean(o)||s&&il(s),visualElement:e,animationType:"string"==typeof a?a:"both",initialPromotionConfig:r,crossfade:c,layoutScroll:l,layoutRoot:u})}(h.current,n,i,g);const y=f.useRef(!1);f.useInsertionEffect(()=>{m&&y.current&&m.update(n,l)});const v=n[ei],b=f.useRef(Boolean(v)&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return we(()=>{p.current=!0,m&&(y.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),b.current&&m.animationState&&m.animationState.animateChanges())}),f.useEffect(()=>{m&&(!b.current&&m.animationState&&m.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),b.current=!1),m.enteringChildren=void 0)}),m}function ol(e){if(e)return!1!==e.options.allowProjection?e.projection:ol(e.parent)}function sl(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&function(e){const t=_s();for(const n in e)t[n]={...t[n],...e[n]};fa(t)}(r);const a=n?"svg"===n:Ks(e),o=a?el:Js;function l(n,r){let l;const u={...f.useContext(xs),...n,layoutId:ll(n)},{isStatic:c}=u,d=Is(n),h=o(n,c);if(!c&&xe){f.useContext(Ls).strict;const t=function(e){const t=_s(),{drag:n,layout:r}=t;if(!n&&!r)return{};const i={...n,...r};return{MeasureLayout:n?.isEnabled(e)||r?.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(u);l=t.MeasureLayout,d.visualElement=al(e,h,u,i,t.ProjectionNode,a)}return s.jsxs(Vs.Provider,{value:d,children:[l&&d.visualElement?s.jsx(l,{visualElement:d.visualElement,...u}):null,Qs(e,n,nl(h,d.visualElement,r),h,c,t,a)]})}l.displayName=\`motion.\${"string"==typeof e?e:\`create(\${e.displayName??e.name??""})\`}\`;const u=f.forwardRef(l);return u[tl]=e,u}function ll({layoutId:e}){const t=f.useContext(ve).id;return t&&void 0!==e?t+"-"+e:e}function ul(e,t){if("undefined"==typeof Proxy)return sl;const n=new Map,r=(n,r)=>sl(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>"create"===a?r:(n.has(a)||n.set(a,sl(a,void 0,e,t)),n.get(a))})}const cl=(e,t)=>t.isSVG??Ks(e)?new Qa(t):new $a(t,{allowProjection:e!==f.Fragment});let dl=0;const fl={animation:{Feature:class extends ma{constructor(e){super(e),e.animationState||(e.animationState=ro(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();ta(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends ma{constructor(){super(...arguments),this.id=dl++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then(()=>{t(this.id)})}mount(){const{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function hl(e){return{point:{x:e.pageX,y:e.pageY}}}function pl(e,t,n,r){return Oo(e,t,(e=>t=>Mi(t)&&e(t,hl(t)))(n),r)}const ml=({current:e})=>e?e.ownerDocument.defaultView:null,gl=(e,t)=>Math.abs(e-t);const yl=new Set(["auto","scroll"]);class vl{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=wl(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=gl(e.x,t.x),r=gl(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;const{point:r}=e,{timestamp:i}=ot;this.history.push({...r,timestamp:i});const{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=bl(t,this.transformPagePoint),it.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||i&&i(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const a=wl("pointercancel"===e.type?this.lastMoveEventInfo:bl(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Mi(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;const s=bl(hl(e),this.transformPagePoint),{point:l}=s,{timestamp:u}=ot;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=t;c&&c(e,wl(s,this.history)),this.removeListeners=De(pl(this.contextWindow,"pointermove",this.handlePointerMove),pl(this.contextWindow,"pointerup",this.handlePointerUp),pl(this.contextWindow,"pointercancel",this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){const e=getComputedStyle(t);(yl.has(e.overflowX)||yl.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const t=this.scrollPositions.get(e);if(!t)return;const n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i=r.x-t.x,a=r.y-t.y;0===i&&0===a||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i,this.lastMoveEventInfo.point.y+=a):this.history.length>0&&(this.history[0].x-=i,this.history[0].y-=a),this.scrollPositions.set(e,r),it.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),at(this.updatePoint)}}function bl(e,t){return t?{point:t(e.point)}:e}function xl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function wl({point:e},t){return{point:e,delta:xl(e,Sl(t)),offset:xl(e,kl(t)),velocity:El(t,.1)}}function kl(e){return e[0]}function Sl(e){return e[e.length-1]}function El(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=Sl(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>ze(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>2*ze(t)&&(r=e[1]);const a=Fe(i.timestamp-r.timestamp);if(0===a)return{x:0,y:0};const o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Tl(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Cl(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}const Pl=.35;function jl(e,t,n){return{min:Nl(e,t),max:Nl(e,n)}}function Nl(e,t){return"number"==typeof e?e:e[t]||0}const Ml=new WeakMap;class Ll{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){const{presenceContext:r}=this.visualElement;if(r&&!1===r.isPresent)return;const{dragSnapToOrigin:i}=this.getProps();this.panSession=new vl(e,{onSessionStart:e=>{t&&this.snapToCursor(hl(e).point),this.stopAnimation()},onStart:(e,t)=>{const{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(a=n)||"y"===a?Ti[a]?null:(Ti[a]=!0,()=>{Ti[a]=!1}):Ti.x||Ti.y?null:(Ti.x=Ti.y=!0,()=>{Ti.x=Ti.y=!1}),!this.openDragLock))return;var a;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),No(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Mt.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];if(r){t=co(r)*(parseFloat(t)/100)}}}this.originPoint[e]=t}),i&&it.update(()=>i(e,t),!1,!0),Zr(this.visualElement,"transform");const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:o}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(o),void(null!==this.currentDirection&&i&&i(this.currentDirection));this.updateAxis("x",t.point,o),this.updateAxis("y",t.point,o),this.visualElement.render(),a&&it.update(()=>a(e,t),!1,!0)},onSessionEnd:(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,distanceThreshold:n,contextWindow:ml(this.visualElement),element:this.visualElement.current})}stop(e,t){const n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;const{velocity:a}=r;this.startAnimation(a);const{onDragEnd:o}=this.getProps();o&&it.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!Dl(e,r,this.currentDirection))return;const i=this.getAxisMotionValue(e);let a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=function(e,{min:t,max:n},r){return void 0!==t&&e<t?e=r?Xt(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?Xt(n,e,r.max):Math.min(e,n)),e}(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){const{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&il(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!n)&&function(e,{top:t,left:n,bottom:r,right:i}){return{x:Tl(e.x,n,i),y:Tl(e.y,t,r)}}(n.layoutBox,e),this.elastic=function(e=Pl){return!1===e?e=0:!0===e&&(e=Pl),{x:jl(e,"left","right"),y:jl(e,"top","bottom")}}(t),r!==this.constraints&&!il(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&No(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!il(e))return!1;const n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const i=function(e,t,n){const r=La(e,n),{scroll:i}=t;return i&&(ja(r.x,i.offset.x),ja(r.y,i.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let a=function(e,t){return{x:Cl(e.x,t.x),y:Cl(e.y,t.y)}}(r.layout.layoutBox,i);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(a));this.hasMutatedConstraints=!!e,e&&(a=ga(e))}return a}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},l=No(o=>{if(!Dl(o,t,this.currentDirection))return;let l=s&&s[o]||{};a&&(l={min:0,max:0});const u=r?200:1e6,c=r?40:1e7,d={type:"inertia",velocity:n?e[o]:0,bounceStiffness:u,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(o,d)});return Promise.all(l).then(o)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return Zr(this.visualElement,e),n.start(Br(e,n,0,t,this.visualElement,!1))}stopAnimation(){No(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const t=\`_drag\${e.toUpperCase()}\`,n=this.visualElement.getProps(),r=n[t];return r||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){No(t=>{const{drag:n}=this.getProps();if(!Dl(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-Xt(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!il(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};No(e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=co(e),i=co(t);return i>r?n=_e(t.min,t.max-r,e.min):r>i&&(n=_e(e.min,e.max-i,t.min)),Te(0,1,n)}({min:n,max:n},this.constraints[e])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),No(t=>{if(!Dl(t,e,null))return;const n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(Xt(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Ml.set(this.visualElement,this);const e=this.visualElement.current,t=pl(e,"pointerdown",t=>{const{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&function(e){return Ai.has(e.tagName)||!0===e.isContentEditable}(i);n&&r&&!a&&this.start(t)});let n;const r=()=>{const{dragConstraints:t}=this.getProps();il(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(e,t,n){const r=Gi(e,Al(n)),i=Gi(t,Al(n));return()=>{r(),i()}}(e,t.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,a=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),it.read(r);const o=Oo(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(No(t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())});return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Pl,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}}function Al(e){let t=!0;return()=>{t?t=!1:e()}}function Dl(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const _l=e=>(t,n)=>{e&&it.update(()=>e(t,n),!1,!0)};let Rl=!1;class zl extends f.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Rl&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Uo.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Rl=!0,r||e.layoutDependency!==t||void 0===t||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||it.postRender(()=>{const e=a.getStack();e&&e.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Ei.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Rl=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Fl(e){const[t,n]=Ps(),r=f.useContext(ve);return s.jsx(zl,{...e,layoutGroup:r,switchLayoutGroup:f.useContext(rl),isPresent:t,safeToRemove:n})}const Ol={pan:{Feature:class extends ma{constructor(){super(...arguments),this.removePointerDownListener=Le}onPointerDown(e){this.session=new vl(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ml(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:_l(e),onStart:_l(t),onMove:_l(n),onEnd:(e,t)=>{delete this.session,r&&it.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=pl(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends ma{constructor(e){super(e),this.removeGroupControls=Le,this.removeListeners=Le,this.controls=new Ll(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Le}update(){const{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:bs,MeasureLayout:Fl}};function Vl(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);const i=r["onHover"+n];i&&it.postRender(()=>i(t,hl(t)))}function Il(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap","Start"===n);const i=r["onTap"+("End"===n?"":n)];i&&it.postRender(()=>i(t,hl(t)))}const Bl=new WeakMap,$l=new WeakMap,Ul=e=>{const t=Bl.get(e.target);t&&t(e)},Hl=e=>{e.forEach(Ul)};function Wl(e,t,n){const r=function({root:e,...t}){const n=e||document;$l.has(n)||$l.set(n,{});const r=$l.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Hl,{root:e,...t})),r[i]}(t);return Bl.set(e,n),r.observe(e),()=>{Bl.delete(e),r.unobserve(e)}}const ql={some:0,all:1};const Yl=ul({...fl,...{inView:{Feature:class extends ma{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:ql[r]};return Wl(this.node.current,a,e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,i&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends ma{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Oi(e,(e,t)=>(Il(this.node,t,"Start"),(e,{success:t})=>Il(this.node,e,t?"End":"Cancel")),{useGlobalTarget:t,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends ma{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=De(Oo(this.node.current,"focus",()=>this.onFocus()),Oo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ma{mount(){const{current:e}=this.node;e&&(this.unmount=ji(e,(e,t)=>(Vl(this.node,t,"Start"),e=>Vl(this.node,e,"End"))))}unmount(){}}}},...Ol,...{layout:{ProjectionNode:bs,MeasureLayout:Fl}}},cl);function Xl({label:e,value:t,suffix:n,decimals:r=0,icon:i,delay:a=0}){const o=f.useRef(null),l=f.useRef(0);return f.useEffect(()=>{o.current&&t!==l.current&&(!function(e,t,n){let r=null;requestAnimationFrame(function i(a){r||(r=a);const o=Math.min((a-r)/800,1),s=1-Math.pow(1-o,4),l=t*s;e.textContent=n>0?l.toFixed(n):String(Math.round(l)),o<1&&requestAnimationFrame(i)})}(o.current,t,r),l.current=t)},[t,r]),s.jsxs(Yl.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:a},className:"flex-1 min-w-[140px] p-4 rounded-xl bg-bg-surface-1 border border-border/50 flex flex-col gap-2 group hover:border-accent/30 transition-all duration-300",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"p-2 rounded-lg bg-bg-surface-2 group-hover:bg-accent/10 transition-colors",children:s.jsx(i,{className:"w-4 h-4 text-text-muted group-hover:text-accent transition-colors"})}),s.jsx("span",{className:"text-[10px] font-mono text-text-muted uppercase tracking-wider",children:e})]}),s.jsxs("div",{className:"flex items-baseline gap-1 mt-1",children:[s.jsx("span",{ref:o,className:"text-2xl font-bold text-text-primary tracking-tight",children:r>0?t.toFixed(r):t}),n&&s.jsx("span",{className:"text-xs text-text-muted font-medium",children:n})]})]})}function Kl({totalHours:e,featuresShipped:t,bugsFixed:n,complexSolved:r,currentStreak:i,filesTouched:a}){return s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-8",children:[s.jsx(Xl,{label:"Active Hours",value:e,suffix:"hrs",decimals:1,icon:Z,delay:.1}),s.jsx(Xl,{label:"Features",value:t,icon:le,delay:.15}),s.jsx(Xl,{label:"Bugs Fixed",value:n,icon:Y,delay:.2}),s.jsx(Xl,{label:"Complex",value:r,icon:q,delay:.25}),s.jsx(Xl,{label:"Streak",value:i,suffix:"days",icon:ge,delay:.3}),s.jsx(Xl,{label:"Files",value:a,icon:te,delay:.35})]})}const Ql={"claude-code":"#d4a04a",cursor:"#00b4d8",copilot:"#6e40c9",windsurf:"#38bdf8","github-copilot":"#6e40c9",aider:"#4ade80",continue:"#f97316",cody:"#ff6b6b",tabby:"#a78bfa",roo:"#f472b6"},Gl={"claude-code":"Claude Code",cursor:"Cursor",copilot:"GitHub Copilot",windsurf:"Windsurf","github-copilot":"GitHub Copilot",aider:"Aider",continue:"Continue",cody:"Sourcegraph Cody",tabby:"TabbyML",roo:"Roo Code",mcp:"MCP Client","gemini-cli":"Gemini CLI"},Zl={"claude-code":"CC",cursor:"Cu",copilot:"CP",windsurf:"WS","github-copilot":"CP",aider:"Ai",continue:"Co",cody:"Cy",tabby:"Tb",roo:"Ro",mcp:"MC","gemini-cli":"GC"},Jl={feature:"#4ade80",bugfix:"#f87171",refactor:"#a78bfa",test:"#38bdf8",docs:"#fbbf24",setup:"#6b655c",deployment:"#f97316",other:"#9c9588"};function eu(e){const t=e/3600;return t<.1?\`\${t.toFixed(2)}h\`:\`\${t.toFixed(1)}h\`}function tu(e,t){return Object.entries(e).sort((e,t)=>t[1]-e[1]).slice(0,t)}function nu({label:e,children:t}){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-widest font-bold whitespace-nowrap",children:e}),s.jsx("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-1 no-scrollbar",children:t})]})}function ru({stats:e}){const t=tu(e.byClient,4),n=tu(e.byLanguage,4);return 0===t.length&&0===n.length?null:s.jsxs("div",{className:"flex flex-col gap-4 mb-8 p-4 rounded-xl bg-bg-surface-1/30 border border-border/50",children:[t.length>0&&s.jsx(nu,{label:"Top Clients",children:t.map(([e,t])=>{const n=Ql[e];return s.jsxs("span",{className:"text-[11px] font-mono px-2.5 py-1 rounded-full bg-bg-surface-1 border border-border hover:border-accent/40 transition-colors shadow-sm whitespace-nowrap group cursor-default",style:n?{borderLeftWidth:"3px",borderLeftColor:n}:void 0,title:eu(t),children:[Gl[e]??e,s.jsx("span",{className:"ml-1.5 text-text-muted opacity-0 group-hover:opacity-100 transition-opacity",children:eu(t)})]},e)})}),n.length>0&&s.jsx(nu,{label:"Languages",children:n.map(([e,t])=>s.jsxs("span",{className:"text-[11px] font-mono px-2.5 py-1 rounded-full bg-bg-surface-1 border border-border hover:border-accent/40 transition-colors shadow-sm whitespace-nowrap group cursor-default",title:eu(t),children:[e,s.jsx("span",{className:"ml-1.5 text-text-muted opacity-0 group-hover:opacity-100 transition-opacity",children:eu(t)})]},e))})]})}const iu={coding:"#6366f1",debugging:"#f87171",testing:"#60a5fa",planning:"#a78bfa",reviewing:"#34d399",documenting:"#fbbf24",learning:"#f472b6",other:"#94a3b8"};function au(e){if(e<60)return"<1m";const t=Math.round(e/60);if(t<60)return\`\${t}m\`;return\`\${(e/3600).toFixed(1)}h\`}function ou({byTaskType:e}){const t=Object.entries(e).filter(([,e])=>e>0).sort((e,t)=>t[1]-e[1]);if(0===t.length)return null;const n=t[0][1];return s.jsxs("div",{className:"rounded-xl bg-bg-surface-1 border border-border/50 p-4 mb-8",children:[s.jsx("h2",{className:"text-sm font-bold text-text-muted uppercase tracking-widest mb-4 px-1",children:"Task Types"}),s.jsx("div",{className:"space-y-2.5",children:t.map(([e,t],r)=>{const i=iu[e]??iu.other,a=t/n*100;return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-xs text-text-secondary font-medium w-24 text-right shrink-0",children:(o=e,o.charAt(0).toUpperCase()+o.slice(1))}),s.jsx("div",{className:"flex-1 h-5 rounded bg-bg-surface-2/50 overflow-hidden",children:s.jsx(Yl.div,{className:"h-full rounded",style:{backgroundColor:i},initial:{width:0},animate:{width:\`\${a}%\`},transition:{duration:.6,delay:.05*r,ease:[.22,1,.36,1]}})}),s.jsx("span",{className:"text-xs text-text-muted font-mono w-12 text-right shrink-0",children:au(t)})]},e);var o})})]})}function su({label:e,active:t,onClick:n}){return s.jsx("button",{onClick:n,className:"text-[10px] font-bold uppercase tracking-wider px-3 py-1.5 rounded-full transition-all duration-200 cursor-pointer border "+(t?"bg-accent text-white border-accent shadow-[0_2px_10px_rgba(99,102,241,0.4)] scale-105":"bg-bg-surface-1 border-border text-text-muted hover:text-text-primary hover:border-text-muted/50"),children:e})}function lu({sessions:e,filters:t,onFilterChange:n}){const r=f.useMemo(()=>[...new Set(e.map(e=>e.client))].sort(),[e]),i=f.useMemo(()=>[...new Set(e.flatMap(e=>e.languages))].sort(),[e]),a=f.useMemo(()=>[...new Set(e.map(e=>e.project).filter(e=>{if(!e)return!1;const t=e.trim().toLowerCase();return!["untitled","mcp","unknown","default","none"].includes(t)}))].sort(),[e]);return r.length>0||i.length>0||a.length>0?s.jsxs("div",{className:"flex flex-col gap-3 mb-6",children:[s.jsxs("div",{className:"flex items-center gap-2 px-1",children:[s.jsx(ne,{className:"w-3.5 h-3.5 text-text-muted"}),s.jsx("span",{className:"text-[10px] font-bold text-text-muted uppercase tracking-widest",children:"Filters"})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-1",children:[s.jsx(su,{label:"All",active:"all"===t.client&&"all"===t.language&&"all"===t.project,onClick:()=>{n("client","all"),n("language","all"),n("project","all")}}),r.map(e=>s.jsx(su,{label:Gl[e]??e,active:t.client===e,onClick:()=>n("client",t.client===e?"all":e)},e)),i.map(e=>s.jsx(su,{label:e,active:t.language===e,onClick:()=>n("language",t.language===e?"all":e)},e)),a.map(e=>s.jsx(su,{label:e,active:t.project===e,onClick:()=>n("project",t.project===e?"all":e)},e))]})]}):null}function uu(e,t){const n=e=>new Date(e).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0});return\`\${n(e)} \u2014 \${n(t)}\`}function cu(e){if(e<60)return\`\${e}s\`;const t=Math.round(e/60);if(t<60)return\`\${t}m\`;const n=Math.floor(t/60),r=t%60;return r>0?\`\${n}h \${r}m\`:\`\${n}h\`}const du={feature:"bg-success/15 text-success border-success/30",bugfix:"bg-error/15 text-error border-error/30",refactor:"bg-purple/15 text-purple border-purple/30",test:"bg-blue/15 text-blue border-blue/30",docs:"bg-accent/15 text-accent border-accent/30",setup:"bg-text-muted/15 text-text-muted border-text-muted/20",deployment:"bg-emerald/15 text-emerald border-emerald/30"};function fu({category:e}){const t=du[e]??"bg-bg-surface-2 text-text-secondary border-border";return s.jsx("span",{className:\`text-[10px] px-1.5 py-0.5 rounded-full border font-bold uppercase tracking-wider \${t}\`,children:e})}function hu({session:e,milestones:t,defaultExpanded:n=!1}){const[r,i]=f.useState(n),[a,o]=f.useState(!1),l=Ql[e.client]??"#91919a",u=Zl[e.client]??e.client.slice(0,2).toUpperCase(),c=t.length>0,d=e.project?.trim()||"",h=!d||["untitled","mcp","unknown","default","none","null","undefined"].includes(d.toLowerCase()),p=t[0];let m=e.private_title||e.title||d||"Untitled Session",g=e.title||(h&&p?p.title:d)||"Untitled Session";!e.private_title&&h&&p?.private_title&&(m=p.private_title);const y=m!==g;return s.jsxs("div",{className:"mb-1 rounded-lg border transition-all duration-200 "+(r?"bg-bg-surface-1 border-accent/30 shadow-md":"bg-bg-surface-1/30 border-border/50 hover:border-accent/30"),children:[s.jsxs("div",{className:"flex items-center",children:[s.jsxs("button",{className:"flex-1 flex items-center gap-3 px-3 py-2 text-left min-w-0",onClick:()=>c&&i(!r),style:{cursor:c?"pointer":"default"},children:[s.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center text-[11px] font-black font-mono flex-shrink-0 shadow-sm",style:{backgroundColor:\`\${l}15\`,color:l,border:\`1px solid \${l}30\`},title:Gl[e.client]??e.client,children:u}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[s.jsx("div",{className:"flex items-center gap-1.5 min-w-0",children:s.jsx(Ms,{mode:"wait",children:s.jsxs(Yl.div,{initial:{opacity:0,x:-5},animate:{opacity:1,x:0},exit:{opacity:0,x:5},transition:{duration:.1},className:"flex items-center gap-1.5 min-w-0",children:[a?s.jsx(de,{className:"w-3 h-3 text-success/60 flex-shrink-0"}):s.jsx(re,{className:"w-3 h-3 text-accent/60 flex-shrink-0"}),s.jsx("span",{className:"text-sm font-bold truncate text-text-primary tracking-tight",children:a?g:m})]},a?"public":"private")})}),s.jsx("span",{className:"text-[9px] font-bold text-text-muted font-mono bg-bg-surface-2/60 px-1.5 rounded uppercase tracking-tighter border border-border/30 flex-shrink-0",children:e.client}),e.evaluation&&s.jsx("span",{className:"text-[9px] font-black px-1.5 py-0.5 rounded border flex-shrink-0 "+("completed"===e.evaluation.task_outcome?"bg-success/10 text-success border-success/20":"partial"===e.evaluation.task_outcome?"bg-accent/10 text-accent border-accent/20":"bg-error/10 text-error border-error/20"),children:"completed"===e.evaluation.task_outcome?"DONE":"partial"===e.evaluation.task_outcome?"PART":"FAIL"})]}),s.jsxs("div",{className:"flex items-center gap-3 text-[11px] text-text-muted font-semibold",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Z,{className:"w-3 h-3 opacity-60"}),cu(e.duration_seconds)]}),e.duration_seconds>=900&&(()=>{const t=Math.floor(e.duration_seconds/900),n=t>0?Math.min(e.heartbeat_count/t,1):0,r=n>=.8?"text-success":n>=.5?"text-accent":"text-text-muted";return s.jsxs("span",{className:\`flex items-center gap-0.5 font-mono \${r}\`,title:\`Focus: \${Math.round(100*n)}%\`,children:[s.jsx(ge,{className:"w-2.5 h-2.5 fill-current opacity-70"}),Math.round(100*n),"%"]})})(),s.jsx("span",{className:"opacity-50 font-mono tracking-tight",children:uu(e.started_at,e.ended_at).split(" \u2014 ")[0]})]})]})]}),s.jsxs("div",{className:"flex items-center px-2 gap-1.5 border-l border-border/30 h-8 self-center",children:[y&&s.jsx("button",{onClick:e=>{e.stopPropagation(),o(!a)},className:"p-1.5 rounded-lg transition-all "+(a?"bg-success/10 text-success":"text-text-muted hover:bg-bg-surface-2"),title:a?"Public Mode":"Private Mode",children:a?s.jsx(ee,{className:"w-3.5 h-3.5"}):s.jsx(J,{className:"w-3.5 h-3.5"})}),c&&s.jsx("button",{onClick:()=>i(!r),className:"p-1.5 rounded-lg transition-all "+(r?"text-accent bg-accent/5":"text-text-muted hover:bg-bg-surface-2"),children:s.jsx(K,{className:"w-4 h-4 transition-transform duration-200 "+(r?"rotate-180":"")})})]})]}),s.jsx(Ms,{children:r&&c&&s.jsx(Yl.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:s.jsxs("div",{className:"px-3 pb-3 pt-1 space-y-1",children:[s.jsx("div",{className:"h-px bg-border/20 mb-2 mx-1"}),e.evaluation&&s.jsxs("div",{className:"flex items-center gap-3 px-2 py-1 text-[9px] text-text-muted font-mono bg-bg-surface-2/30 rounded-md mb-2",children:[s.jsxs("span",{children:["P: ",e.evaluation.prompt_quality,"/5"]}),s.jsxs("span",{children:["C: ",e.evaluation.context_provided,"/5"]}),s.jsxs("span",{children:["S: ",e.evaluation.scope_quality,"/5"]}),s.jsxs("span",{children:["T: ",e.evaluation.iteration_count]})]}),s.jsx("div",{className:"space-y-0.5",children:t.map(e=>{e.private_title;const t=a?e.title:e.private_title||e.title,n=function(e){if(!e||e<=0)return"";if(e<60)return\`\${e}m\`;const t=Math.floor(e/60),n=e%60;return n>0?\`\${t}h \${n}m\`:\`\${t}h\`}(e.duration_minutes);return s.jsxs("div",{className:"group flex items-center gap-2 p-1.5 rounded-md hover:bg-bg-surface-2/40 transition-colors",children:[s.jsx("div",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{backgroundColor:Jl[e.category]??"#9c9588"}}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-text-secondary group-hover:text-text-primary truncate",children:t}),s.jsx(fu,{category:e.category})]})}),n&&s.jsx("span",{className:"text-[10px] text-text-muted font-mono",children:n})]},e.id)})})]})})})]})}function pu(e){if(e<60)return\`\${e}s\`;const t=Math.round(e/60);if(t<60)return\`\${t}m\`;const n=Math.floor(t/60),r=t%60;return r>0?\`\${n}h \${r}m\`:\`\${n}h\`}function mu({group:e,defaultExpanded:t}){const[n,r]=f.useState(t);if(1===e.sessions.length){const n=e.sessions[0];return s.jsx(hu,{session:n.session,milestones:n.milestones,defaultExpanded:t&&n.milestones.length>0})}const i=Ql[e.sessions[0].session.client]??"#91919a",a=e.aggregateEval,o=e.sessions[0].session,l=o.private_title||o.title||o.project||"Conversation";return s.jsxs("div",{className:"rounded-lg border border-accent/20 bg-bg-surface-1/20 overflow-hidden",children:[s.jsxs("button",{className:"w-full flex items-center gap-3 px-3 py-2 text-left hover:bg-bg-surface-1/40 transition-colors",onClick:()=>r(!n),children:[s.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center flex-shrink-0",style:{backgroundColor:\`\${i}10\`,border:\`1px solid \${i}20\`},children:s.jsx(ae,{className:"w-4 h-4",style:{color:i}})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm font-bold truncate text-text-primary",children:l}),s.jsxs("span",{className:"text-[10px] font-bold text-accent/80 bg-accent/5 px-1.5 py-0.5 rounded border border-accent/10",children:[e.sessions.length," prompts"]}),a&&s.jsxs("span",{className:"text-[9px] font-bold px-1.5 py-0.5 rounded border "+((a.outcomes.completed??0)===a.session_count?"bg-success/10 text-success border-success/20":(a.outcomes.completed??0)>0?"bg-accent/10 text-accent border-accent/20":"bg-error/10 text-error border-error/20"),children:[a.outcomes.completed??0,"/",a.session_count]})]}),s.jsxs("div",{className:"flex items-center gap-3 text-xs text-text-muted font-medium mt-0.5",children:[s.jsx("span",{className:"font-mono",children:pu(e.totalDuration)}),e.totalMilestones>0&&s.jsxs("span",{className:"text-[10px] text-accent/70",children:[e.totalMilestones," milestone",1!==e.totalMilestones?"s":""]}),a&&s.jsxs("span",{className:"text-[10px] font-mono text-text-muted/60",children:["avg prompt: ",a.prompt_quality,"/5"]})]})]}),s.jsx("div",{className:"transition-transform duration-200 "+(n?"rotate-180 text-accent":"text-text-muted"),children:s.jsx(K,{className:"w-4 h-4"})})]}),s.jsx(Ms,{children:n&&s.jsx(Yl.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:s.jsxs("div",{className:"px-3 pb-2 relative",children:[s.jsx("div",{className:"absolute left-[1.65rem] top-0 bottom-2 w-px",style:{backgroundColor:\`\${i}25\`}}),s.jsx("div",{className:"space-y-1 pl-6",children:e.sessions.map((e,t)=>s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute -left-[1.15rem] top-4 w-2 h-2 rounded-full border-2",style:{backgroundColor:i,borderColor:\`\${i}40\`}}),s.jsx(hu,{session:e.session,milestones:e.milestones,defaultExpanded:0===t&&e.milestones.length>0})]},e.session.session_id))})]})})})]})}function gu({sessions:e,milestones:t,filters:n}){const r=f.useMemo(()=>e.filter(e=>("all"===n.client||e.client===n.client)&&(!("all"!==n.language&&!e.languages.includes(n.language))&&("all"===n.project||(e.project??"")===n.project))),[e,n]),i=f.useMemo(()=>"all"===n.category?t:t.filter(e=>e.category===n.category),[t,n.category]),a=f.useMemo(()=>{const e=function(e,t){const n=new Map;for(const i of t){const e=n.get(i.session_id);e?e.push(i):n.set(i.session_id,[i])}const r=e.map(e=>({session:e,milestones:n.get(e.session_id)??[]}));return r.sort((e,t)=>new Date(t.session.started_at).getTime()-new Date(e.session.started_at).getTime()),r}(r,i);return function(e){const t=new Map,n=[];for(const i of e){const e=i.session.conversation_id;if(e){const n=t.get(e);n?n.push(i):t.set(e,[i])}else n.push(i)}const r=[];for(const[i,a]of t){a.sort((e,t)=>(e.session.conversation_index??0)-(t.session.conversation_index??0));const e=a.reduce((e,t)=>e+t.session.duration_seconds,0),t=a.reduce((e,t)=>e+t.milestones.length,0),n=a[0].session.started_at,o=a[a.length-1].session.ended_at;r.push({conversationId:i,sessions:a,aggregateEval:I(a),totalDuration:e,totalMilestones:t,startedAt:n,endedAt:o})}for(const i of n)r.push({conversationId:null,sessions:[i],aggregateEval:i.session.evaluation?I([i]):null,totalDuration:i.session.duration_seconds,totalMilestones:i.milestones.length,startedAt:i.session.started_at,endedAt:i.session.ended_at});return r.sort((e,t)=>new Date(t.startedAt).getTime()-new Date(e.startedAt).getTime()),r}(e)},[r,i]);return 0===a.length?s.jsx("div",{className:"text-center text-text-muted py-8 text-sm mb-4",children:"No sessions in this window"}):s.jsx("div",{className:"space-y-1.5 mb-4",children:a.map((e,t)=>s.jsx(mu,{group:e,defaultExpanded:0===t},e.conversationId??e.sessions[0].session.session_id))})}function yu({sessions:e,timeScale:t,effectiveTime:n,isLive:r,onDayClick:i,highlightDate:a}){const o="24h"===t||"12h"===t,l=new Date(n).toISOString().slice(0,10),u=f.useMemo(()=>o?function(e,t){const n=new Date(\`\${t}T00:00:00\`).getTime(),r=n+864e5,i=[];for(let a=0;a<24;a++)i.push({hour:a,minutes:0});for(const a of e){const e=new Date(a.started_at).getTime(),t=new Date(a.ended_at).getTime();if(t<n||e>r)continue;const o=Math.max(e,n),s=Math.min(t,r);for(let r=0;r<24;r++){const e=n+36e5*r,t=e+36e5,a=Math.max(o,e),l=Math.min(s,t);l>a&&(i[r].minutes+=(l-a)/6e4)}}return i}(e,l):[],[e,l,o]),c=f.useMemo(()=>o?[]:function(e,t){const n=new Date,r=[];for(let i=t-1;i>=0;i--){const t=new Date(n);t.setDate(t.getDate()-i);const a=t.toISOString().slice(0,10);let o=0;for(const n of e)n.started_at.slice(0,10)===a&&(o+=n.duration_seconds);r.push({date:a,hours:o/3600})}return r}(e,7),[e,o]),d=o?\`Hourly \u2014 \${new Date(n).toLocaleDateString([],{month:"short",day:"numeric"})}\`:"Last 7 Days";if(o){const e=Math.max(...u.map(e=>e.minutes),1);return s.jsxs("div",{className:"mb-8 p-5 rounded-2xl bg-bg-surface-1/50 border border-border/50",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4 px-1",children:[s.jsx("div",{className:"text-xs text-text-muted uppercase tracking-widest font-bold",children:d}),s.jsxs("div",{className:"text-[10px] text-text-muted font-mono bg-bg-surface-2 px-2 py-0.5 rounded",children:[e.toFixed(0),"m peak"]})]}),s.jsx("div",{className:"flex items-end gap-[3px] h-16",children:u.map((t,n)=>{const r=e>0?t.minutes/e*100:0;return s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-end h-full group relative",children:[s.jsx("div",{className:"absolute -top-10 left-1/2 -translate-x-1/2 opacity-0 group-hover:opacity-100 transition-opacity z-20 pointer-events-none",children:s.jsxs("div",{className:"bg-bg-surface-3 text-text-primary text-[10px] font-mono px-2 py-1.5 rounded-lg shadow-xl whitespace-nowrap border border-border flex flex-col items-center",children:[s.jsxs("span",{className:"font-bold",children:[t.hour,":00"]}),s.jsxs("span",{className:"text-accent",children:[t.minutes.toFixed(0),"m active"]}),s.jsx("div",{className:"absolute -bottom-1 left-1/2 -translate-x-1/2 w-2 h-2 bg-bg-surface-3 border-r border-b border-border rotate-45"})]})}),s.jsx(Yl.div,{initial:{height:0},animate:{height:\`\${Math.max(r,t.minutes>0?8:0)}%\`},transition:{delay:.01*n,duration:.5},className:"w-full rounded-t-sm transition-all duration-300 group-hover:bg-accent relative overflow-hidden",style:{minHeight:t.minutes>0?"4px":"0px",backgroundColor:t.minutes>0?\`rgba(99, 102, 241, \${.4+t.minutes/e*.6})\`:"var(--color-bg-surface-2)"},children:t.minutes>.5*e&&s.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-transparent to-white/10"})})]},t.hour)})}),s.jsx("div",{className:"flex gap-[3px] mt-2 border-t border-border/30 pt-2",children:u.map(e=>s.jsx("div",{className:"flex-1 text-center",children:e.hour%6==0&&s.jsx("span",{className:"text-[9px] text-text-muted font-bold font-mono uppercase",children:0===e.hour?"12a":e.hour<12?\`\${e.hour}a\`:12===e.hour?"12p":e.hour-12+"p"})},e.hour))})]})}const h=Math.max(...c.map(e=>e.hours),.1);return s.jsxs("div",{className:"mb-8 p-5 rounded-2xl bg-bg-surface-1/50 border border-border/50",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4 px-1",children:[s.jsx("div",{className:"text-xs text-text-muted uppercase tracking-widest font-bold",children:d}),s.jsx("div",{className:"text-[10px] text-text-muted font-mono bg-bg-surface-2 px-2 py-0.5 rounded",children:"Last 7 days"})]}),s.jsx("div",{className:"flex items-end gap-2 h-16",children:c.map((e,t)=>{const n=h>0?e.hours/h*100:0,r=e.date===a;return s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-end h-full group relative",children:[s.jsx("div",{className:"absolute -top-10 left-1/2 -translate-x-1/2 opacity-0 group-hover:opacity-100 transition-opacity z-20 pointer-events-none",children:s.jsxs("div",{className:"bg-bg-surface-3 text-text-primary text-[10px] font-mono px-2 py-1.5 rounded-lg shadow-xl whitespace-nowrap border border-border flex flex-col items-center",children:[s.jsx("span",{className:"font-bold",children:e.date}),s.jsxs("span",{className:"text-accent",children:[e.hours.toFixed(1),"h active"]}),s.jsx("div",{className:"absolute -bottom-1 left-1/2 -translate-x-1/2 w-2 h-2 bg-bg-surface-3 border-r border-b border-border rotate-45"})]})}),s.jsx(Yl.div,{initial:{height:0},animate:{height:\`\${Math.max(n,e.hours>0?8:0)}%\`},transition:{delay:.05*t,duration:.5},className:"w-full rounded-t-md cursor-pointer transition-all duration-300 group-hover:scale-x-110 origin-bottom "+(r?"ring-2 ring-accent ring-offset-2 ring-offset-bg-base":""),style:{minHeight:e.hours>0?"4px":"0px",backgroundColor:r?"var(--color-accent-bright)":e.hours>0?\`rgba(99, 102, 241, \${.4+e.hours/h*.6})\`:"var(--color-bg-surface-2)"},onClick:()=>i?.(e.date)})]},e.date)})}),s.jsx("div",{className:"flex gap-2 mt-2 border-t border-border/30 pt-2",children:c.map(e=>s.jsx("div",{className:"flex-1 text-center",children:s.jsx("span",{className:"text-[10px] text-text-muted font-bold uppercase tracking-tighter",children:new Date(e.date+"T12:00:00").toLocaleDateString([],{weekday:"short"})})},e.date))})]})}function vu(e){if(!e)return"Never synced";const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"Just now";if(n<60)return\`\${n}m ago\`;const r=Math.floor(n/60);if(r<24)return\`\${r}h ago\`;return\`\${Math.floor(r/24)}d ago\`}function bu({config:e,onRefresh:t}){const[n,r]=f.useState(""),[i,a]=f.useState(""),[o,l]=f.useState("email"),[u,c]=f.useState(!1),[d,h]=f.useState(null);if(!e)return null;if(e.authenticated){const n=async()=>{c(!0),h(null);try{const e=await R("/api/local/sync");e.success?(h("Synced!"),t(),setTimeout(()=>h(null),3e3)):h(e.error??"Sync failed")}catch(e){h(e.message)}finally{c(!1)}};return s.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 p-4 mt-12 bg-bg-surface-1/50 rounded-2xl border border-border/50 backdrop-blur-sm",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-8 h-8 rounded-full bg-accent/10 flex items-center justify-center border border-accent/20",children:s.jsx(me,{className:"w-4 h-4 text-accent"})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"text-xs font-bold text-text-primary",children:e.email}),s.jsxs("span",{className:"text-[10px] text-text-muted font-mono uppercase tracking-tighter",children:["Last sync: ",vu(e.last_sync_at)]})]})]}),s.jsxs("div",{className:"flex items-center gap-4",children:[d&&s.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest "+("Synced!"===d?"text-success":"text-error"),children:d}),s.jsxs("button",{onClick:n,disabled:u,className:"group flex items-center gap-2 px-4 py-2 bg-accent hover:bg-accent-bright text-white text-xs font-bold rounded-lg transition-all duration-300 shadow-lg shadow-accent/20 disabled:opacity-50 cursor-pointer overflow-hidden relative",children:[s.jsx(se,{className:"w-3.5 h-3.5 "+(u?"animate-spin":"group-hover:rotate-180 transition-transform duration-500")}),u?"Syncing...":"Sync Now"]})]})]})}const p=f.useCallback(async()=>{if(n.includes("@")){c(!0),h(null);try{await function(e){return R("/api/local/auth/send-otp",{email:e})}(n),l("otp")}catch(e){h(e.message)}finally{c(!1)}}},[n]),m=f.useCallback(async()=>{if(/^\\d{6}$/.test(i)){c(!0),h(null);try{await function(e,t){return R("/api/local/auth/verify-otp",{email:e,code:t})}(n,i),t()}catch(e){h(e.message)}finally{c(!1)}}},[n,i,t]);return s.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 p-4 mt-12 bg-bg-surface-1/50 rounded-2xl border border-border/50 backdrop-blur-sm",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-8 h-8 rounded-full bg-bg-surface-2 flex items-center justify-center border border-border",children:s.jsx(ce,{className:"w-4 h-4 text-text-muted"})}),s.jsx("span",{className:"text-xs font-bold text-text-secondary uppercase tracking-widest",children:"Sign in to sync"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[d&&s.jsx("span",{className:"text-[10px] font-bold text-error uppercase tracking-widest mr-2",children:d}),"email"===o?s.jsxs("div",{className:"flex items-center bg-bg-base border border-border rounded-lg overflow-hidden focus-within:border-accent/50 focus-within:ring-1 focus-within:ring-accent/50 transition-all",children:[s.jsx("div",{className:"pl-3 py-2",children:s.jsx(ie,{className:"w-3.5 h-3.5 text-text-muted"})}),s.jsx("input",{type:"email",placeholder:"you@email.com",value:n,onChange:e=>r(e.target.value),onKeyDown:e=>"Enter"===e.key&&p(),className:"px-3 py-2 text-xs bg-transparent text-text-primary outline-none w-40 placeholder:text-text-muted/50"}),s.jsx("button",{onClick:p,disabled:u||!n.includes("@"),className:"px-4 py-2 bg-bg-surface-2 hover:bg-bg-surface-3 text-text-primary text-[10px] font-bold uppercase tracking-wider transition-colors disabled:opacity-50 cursor-pointer border-l border-border",children:u?"...":"Send"})]}):s.jsxs("div",{className:"flex items-center bg-bg-base border border-border rounded-lg overflow-hidden focus-within:border-accent/50 focus-within:ring-1 focus-within:ring-accent/50 transition-all",children:[s.jsx("input",{type:"text",maxLength:6,placeholder:"000000",inputMode:"numeric",autoComplete:"one-time-code",value:i,onChange:e=>a(e.target.value),onKeyDown:e=>"Enter"===e.key&&m(),autoFocus:!0,className:"px-4 py-2 text-xs bg-transparent text-text-primary text-center font-mono tracking-widest outline-none w-32 placeholder:text-text-muted/50"}),s.jsx("button",{onClick:m,disabled:u||6!==i.length,className:"px-4 py-2 bg-accent hover:bg-accent-bright text-white text-[10px] font-bold uppercase tracking-wider transition-colors disabled:opacity-50 cursor-pointer",children:u?"...":"Verify"})]})]})]})}var xu=j();const wu={"15m":{visibleDuration:9e5,majorTickInterval:3e5,minorTickInterval:6e4,labelFormat:e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})},"30m":{visibleDuration:18e5,majorTickInterval:6e5,minorTickInterval:12e4,labelFormat:e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})},"1h":{visibleDuration:36e5,majorTickInterval:9e5,minorTickInterval:3e5,labelFormat:e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})},"12h":{visibleDuration:432e5,majorTickInterval:72e5,minorTickInterval:18e5,labelFormat:e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})},"24h":{visibleDuration:864e5,majorTickInterval:144e5,minorTickInterval:36e5,labelFormat:e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})},"7d":{visibleDuration:6048e5,majorTickInterval:864e5,minorTickInterval:216e5,labelFormat:e=>e.toLocaleDateString([],{weekday:"short",month:"short",day:"numeric"})},"30d":{visibleDuration:2592e6,majorTickInterval:6048e5,minorTickInterval:864e5,labelFormat:e=>e.toLocaleDateString([],{month:"short",day:"numeric"})}};function ku(e){if(e<60)return\`\${e}s\`;const t=Math.round(e/60);if(t<60)return\`\${t}m\`;const n=Math.floor(t/60),r=t%60;return r>0?\`\${n}h \${r}m\`:\`\${n}h\`}function Su({value:e,onChange:t,scale:n,sessions:r=[],milestones:i=[]}){const a=f.useRef(null),[o,l]=f.useState(0);f.useEffect(()=>{if(!a.current)return;const e=new ResizeObserver(e=>{for(const t of e)l(t.contentRect.width)});return e.observe(a.current),l(a.current.getBoundingClientRect().width),()=>e.disconnect()},[]);const u=wu[n],c=o>0?o/u.visibleDuration:0,[d,h]=f.useState(!1),p=f.useRef(0),m=f.useCallback(e=>{h(!0),p.current=e.clientX,e.currentTarget.setPointerCapture(e.pointerId)},[]),g=f.useCallback(n=>{if(!d||0===c)return;const r=n.clientX-p.current;p.current=n.clientX,t(e+-r/c)},[d,c,e,t]),y=f.useCallback(()=>{h(!1)},[]),v=f.useMemo(()=>{if(!o||0===c)return[];const t=u.visibleDuration/2,n=e+t,r=e-t-u.majorTickInterval,i=n+u.majorTickInterval,a=[];for(let o=Math.ceil(r/u.majorTickInterval)*u.majorTickInterval;o<=i;o+=u.majorTickInterval)a.push({type:"major",time:o,position:(o-e)*c,label:u.labelFormat(new Date(o))});for(let o=Math.ceil(r/u.minorTickInterval)*u.minorTickInterval;o<=i;o+=u.minorTickInterval)o%u.majorTickInterval!==0&&a.push({type:"minor",time:o,position:(o-e)*c});return a},[e,o,c,u]),b=f.useMemo(()=>r.map(e=>({session:e,start:new Date(e.started_at).getTime(),end:new Date(e.ended_at).getTime()})),[r]),x=f.useMemo(()=>{if(!o||0===c)return[];const t=u.visibleDuration/2,n=e-t,r=e+t;return b.filter(e=>e.start<=r&&e.end>=n).map(t=>({session:t.session,leftOffset:(Math.max(t.start,n)-e)*c,width:(Math.min(t.end,r)-Math.max(t.start,n))*c}))},[b,e,o,c,u]),w=f.useMemo(()=>i.map(e=>({milestone:e,time:new Date(e.created_at).getTime()})).sort((e,t)=>e.time-t.time),[i]),k=f.useMemo(()=>{if(!o||0===c||!w.length)return[];const t=u.visibleDuration/2,n=e-t,r=e+t;let i=0,a=w.length;for(;i<a;){const e=i+a>>1;w[e].time<n?i=e+1:a=e}const s=i;for(a=w.length;i<a;){const e=i+a>>1;w[e].time<=r?i=e+1:a=e}const l=i,d=[];for(let o=s;o<l;o++){const t=w[o];d.push({...t,offset:(t.time-e)*c})}return d},[w,e,o,c,u]),[S,E]=f.useState(null),T=f.useRef(e);return f.useEffect(()=>{S&&Math.abs(e-T.current)>1e3&&E(null),T.current=e},[e,S]),s.jsxs("div",{className:"relative h-20",children:[s.jsxs("div",{className:"absolute inset-0 bg-transparent border-t border-border/50 overflow-hidden select-none touch-none cursor-grab active:cursor-grabbing",ref:a,onPointerDown:m,onPointerMove:g,onPointerUp:y,style:{touchAction:"none"},children:[s.jsxs("div",{className:"absolute left-1/2 top-0 bottom-0 w-[2px] bg-accent z-30 -translate-x-1/2 shadow-[0_0_15px_rgba(99,102,241,0.5)]",children:[s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-3 h-3 bg-accent rounded-b-full"}),s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-3 h-3 bg-accent rounded-t-full"})]}),s.jsxs("div",{className:"absolute inset-0 left-1/2 top-0 bottom-0 pointer-events-none",children:[v.map(e=>s.jsx("div",{className:"absolute top-0 border-l "+("major"===e.type?"border-border/60":"border-border/30"),style:{left:e.position,height:"major"===e.type?"100%":"35%",bottom:0},children:"major"===e.type&&e.label&&s.jsx("span",{className:"absolute top-3 left-2 text-[9px] font-bold text-text-muted uppercase tracking-wider whitespace-nowrap bg-bg-surface-1/80 px-1 py-0.5 rounded",children:e.label})},e.time)),x.map(e=>s.jsx("div",{className:"absolute bottom-0 rounded-t-md pointer-events-auto cursor-pointer transition-opacity hover:opacity-80",style:{left:e.leftOffset,width:Math.max(e.width,3),height:"45%",backgroundColor:"rgba(99, 102, 241, 0.15)",borderTop:"2px solid rgba(99, 102, 241, 0.5)",boxShadow:"inset 0 1px 10px rgba(99, 102, 241, 0.05)"},onMouseEnter:t=>{const n=t.currentTarget.getBoundingClientRect();E({type:"session",data:e.session,x:n.left+n.width/2,y:n.top})},onMouseLeave:()=>E(null)},e.session.session_id)),k.map((e,n)=>s.jsx("div",{className:"absolute bottom-3 pointer-events-auto cursor-pointer z-40 transition-transform hover:scale-125",style:{left:e.offset,transform:"translateX(-50%)"},onMouseEnter:t=>{const n=t.currentTarget.getBoundingClientRect();E({type:"milestone",data:e.milestone,x:n.left+n.width/2,y:n.top})},onMouseLeave:()=>E(null),onClick:n=>{n.stopPropagation(),t(e.time)},children:s.jsx("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-bg-surface-1 shadow-lg",style:{backgroundColor:Jl[e.milestone.category]??"#9c9588",boxShadow:\`0 0 10px \${Jl[e.milestone.category]}50\`}})},n))]})]}),S&&xu.createPortal(s.jsx("div",{className:"fixed z-[9999] pointer-events-none",style:{left:S.x,top:S.y,transform:"translate(-50%, -100%)"},children:s.jsxs("div",{className:"mb-3 bg-bg-surface-3/95 backdrop-blur-md text-text-primary rounded-xl shadow-2xl px-3 py-2.5 text-[11px] min-w-[180px] max-w-[280px] border border-border/50 animate-in fade-in zoom-in-95 duration-200",children:["session"===S.type?s.jsx(Eu,{session:S.data}):s.jsx(Tu,{milestone:S.data}),s.jsx("div",{className:"absolute -bottom-1.5 left-1/2 -translate-x-1/2 w-3 h-3 bg-bg-surface-3/95 border-r border-b border-border/50 rotate-45"})]})}),document.body)]})}function Eu({session:e}){const t=Gl[e.client]??e.client,n=e.project?.trim(),r=!n||["untitled","mcp","unknown","default","none"].includes(n.toLowerCase())?\`\${t} \${e.task_type.charAt(0).toUpperCase()+e.task_type.slice(1)}\`:n;return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"font-bold text-xs text-accent uppercase tracking-widest",children:t}),s.jsx("span",{className:"text-[10px] text-text-muted font-mono",children:ku(e.duration_seconds)})]}),s.jsx("div",{className:"h-px bg-border/50 my-0.5"}),s.jsx("div",{className:"text-text-primary font-medium",children:r}),s.jsx("div",{className:"text-text-secondary capitalize text-[10px]",children:e.task_type})]})}function Tu({milestone:e}){const t=e.private_title??e.title;return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"font-bold text-[10px] uppercase tracking-widest",style:{color:Jl[e.category]??"#9c9588"},children:e.category}),e.complexity&&s.jsx("span",{className:"text-[9px] font-mono text-text-muted font-bold border border-border/50 px-1 rounded uppercase",children:e.complexity})]}),s.jsx("div",{className:"h-px bg-border/50 my-0.5"}),s.jsx("div",{className:"font-bold text-xs break-words text-text-primary",children:t}),e.private_title&&s.jsxs("div",{className:"text-[10px] text-text-muted italic opacity-70",children:["Public: ",e.title]})]})}const Cu={"15m":9e5,"30m":18e5,"1h":36e5,"12h":432e5,"24h":864e5,"7d":6048e5,"30d":2592e6},Pu={"15m":"15 Minutes","30m":"30 Minutes","1h":"1 Hour","12h":"12 Hours","24h":"24 Hours","7d":"7 Days","30d":"30 Days"};function ju(e,t){const n=e.trim();if(!n)return null;const r=new Date(t),i=n.match(/^(\\d{1,2}):(\\d{2})(?::(\\d{2}))?\\s*(AM|PM)$/i);if(i){let e=parseInt(i[1],10);const t=parseInt(i[2],10),n=i[3]?parseInt(i[3],10):0,a=i[4].toUpperCase();return e<1||e>12||t>59||n>59?null:("AM"===a&&12===e&&(e=0),"PM"===a&&12!==e&&(e+=12),r.setHours(e,t,n,0),r.getTime())}const a=n.match(/^(\\d{1,2}):(\\d{2})(?::(\\d{2}))?$/);if(a){const e=parseInt(a[1],10),t=parseInt(a[2],10),n=a[3]?parseInt(a[3],10):0;return e>23||t>59||n>59?null:(r.setHours(e,t,n,0),r.getTime())}return null}const Nu=["15m","30m","1h","12h","24h","7d","30d"];function Mu({value:e,onChange:t,scale:n,onScaleChange:r,sessions:i,milestones:a}){const o=null===e,[l,u]=f.useState(Date.now());f.useEffect(()=>{if(!o)return;const e=setInterval(()=>u(Date.now()),1e3);return()=>clearInterval(e)},[o]);const c=o?l:e,[d,h]=f.useState(!1),[p,m]=f.useState(""),g=f.useRef(null),y=f.useRef(!1),v=f.useRef(""),b=f.useRef(!1),x=f.useRef(0),w=f.useCallback(e=>{const n=Date.now();if(e>=n-2e3)return b.current=!0,x.current=n,void t(null);b.current&&n-x.current<300||b.current&&e>=n-1e4?t(null):(b.current=!1,t(e))},[t]),k=e=>{const n=c,r=Math.min(n+e,Date.now());t(r)},S=()=>{y.current=o,t(c);const e=new Date(c).toLocaleTimeString([],{hour12:!0,hour:"2-digit",minute:"2-digit",second:"2-digit"});v.current=e,m(e),h(!0),requestAnimationFrame(()=>g.current?.select())},E=()=>{if(h(!1),y.current&&p===v.current)return void t(null);const e=ju(p,c);null!==e&&t(Math.min(e,Date.now()))};return s.jsxs("div",{className:"flex flex-col bg-bg-surface-1/40 border border-border/50 rounded-2xl overflow-hidden mb-8 shadow-xl backdrop-blur-md",children:[s.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between px-6 py-5 border-b border-border/50 gap-6",children:[s.jsxs("div",{className:"flex flex-col items-start gap-1.5",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2 h-8",children:[d?s.jsx("input",{ref:g,type:"text",value:p,onChange:e=>m(e.target.value),onBlur:E,onKeyDown:e=>{if("Enter"===e.key)return void E();if("Escape"===e.key)return e.preventDefault(),h(!1),void(y.current&&t(null));if("ArrowUp"!==e.key&&"ArrowDown"!==e.key)return;e.preventDefault();const n=g.current;if(!n)return;const r=n.selectionStart??0,i="ArrowUp"===e.key?1:-1,a=ju(p,c);if(null===a)return;const o=p.indexOf(":"),s=p.indexOf(":",o+1),l=p.lastIndexOf(" ");let u;u=r<=o?36e5*i:s>-1&&r<=s?6e4*i:l>-1&&r<=l?1e3*i:12*i*36e5;const d=Math.min(a+u,Date.now()),f=new Date(d).toLocaleTimeString([],{hour12:!0,hour:"2-digit",minute:"2-digit",second:"2-digit"});m(f),t(d),requestAnimationFrame(()=>{n&&n.setSelectionRange(r,r)})},className:"text-2xl font-mono font-bold tracking-tight bg-bg-surface-2 border border-accent rounded-lg px-2 -ml-2 w-[165px] outline-none text-text-primary shadow-[0_0_10px_rgba(99,102,241,0.2)]"}):s.jsxs("button",{onClick:S,className:"group flex items-center gap-2 hover:bg-bg-surface-2/50 rounded-lg px-2 -ml-2 py-1 transition-all cursor-text",title:"Click to edit time",children:[s.jsx(Z,{className:"w-5 h-5 "+(o?"text-text-muted":"text-accent")}),s.jsx("span",{className:"text-2xl font-mono font-bold tracking-tight tabular-nums "+(o?"text-text-primary":"text-accent"),children:new Date(c).toLocaleTimeString([],{hour12:!0,hour:"2-digit",minute:"2-digit",second:"2-digit"})})]}),s.jsx("button",{onClick:d?E:S,className:"p-1.5 rounded-lg transition-colors flex-shrink-0 "+(d?"bg-accent text-white hover:bg-accent-bright":"text-text-muted hover:text-text-primary hover:bg-bg-surface-2"),title:d?"Confirm time":"Edit time",children:s.jsx(oe,{className:"w-3.5 h-3.5"})})]}),o?s.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 text-[10px] font-bold uppercase tracking-widest bg-success/10 text-success rounded-full border border-success/20 shadow-[0_0_10px_rgba(16,185,129,0.1)]",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-success animate-pulse"}),"Live"]}):s.jsx("div",{className:"flex items-center gap-1.5 px-2.5 py-1 text-[10px] font-bold uppercase tracking-widest bg-accent/10 text-accent rounded-full border border-accent/20",children:"History"})]}),s.jsxs("div",{className:"flex items-center gap-2 text-sm text-text-secondary font-medium px-0.5",children:[s.jsx(X,{className:"w-3.5 h-3.5 text-text-muted"}),new Date(c).toLocaleDateString([],{weekday:"short",month:"long",day:"numeric",year:"numeric"})]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-4",children:[s.jsx("div",{className:"flex items-center bg-bg-surface-2/50 border border-border/50 rounded-xl p-1 shadow-inner",children:Nu.map(e=>s.jsx("button",{onClick:()=>r(e),className:"px-3 py-1.5 text-[10px] font-bold uppercase tracking-wider rounded-lg transition-all "+(n===e?"bg-accent text-white shadow-lg shadow-accent/20":"text-text-muted hover:text-text-primary hover:bg-bg-surface-2"),title:Pu[e],children:e},e))}),s.jsxs("div",{className:"flex items-center gap-2",children:[!o&&s.jsxs("button",{onClick:()=>t(null),className:"group flex items-center gap-2 px-4 py-2 text-[10px] font-bold uppercase tracking-widest bg-accent/10 hover:bg-accent text-accent hover:text-white rounded-xl transition-all border border-accent/20",children:[s.jsx(ue,{className:"w-3.5 h-3.5 group-hover:-rotate-90 transition-transform duration-500"}),"Live"]}),s.jsxs("div",{className:"flex items-center gap-1 bg-bg-surface-2/50 border border-border/50 rounded-xl p-1",children:[s.jsx("button",{onClick:()=>k(-Cu[n]),className:"p-2 text-text-muted hover:text-text-primary hover:bg-bg-surface-2 rounded-lg transition-colors",title:\`Back \${Pu[n]}\`,children:s.jsx(Q,{className:"w-4 h-4"})}),s.jsx("button",{onClick:()=>k(Cu[n]),className:"p-2 text-text-muted hover:text-text-primary hover:bg-bg-surface-2 rounded-lg transition-colors disabled:opacity-20 disabled:cursor-not-allowed",title:\`Forward \${Pu[n]}\`,disabled:o||c>=Date.now()-1e3,children:s.jsx(G,{className:"w-4 h-4"})})]})]})]})]}),s.jsx(Su,{value:c,onChange:w,scale:n,sessions:i,milestones:a})]})}const Lu={feature:{verb:"shipped",noun:"feature",plural:"features"},bugfix:{verb:"fixed",noun:"bug",plural:"bugs"},refactor:{verb:"refactored",noun:"module",plural:"modules"},test:{verb:"added",noun:"test suite",plural:"test suites"},docs:{verb:"wrote",noun:"doc",plural:"docs"},setup:{verb:"configured",noun:"setup",plural:"setups"},deployment:{verb:"deployed",noun:"release",plural:"releases"},other:{verb:"completed",noun:"task",plural:"tasks"}};function Au({children:e}){return s.jsx("span",{className:"text-text-primary font-medium",children:e})}function Du({sessions:e,milestones:t}){const n=f.useMemo(()=>function(e,t){if(0===e.length)return s.jsx("span",{className:"text-text-muted",children:"No sessions in this time window."});const n=[],r=e.reduce((e,t)=>e+t.duration_seconds,0)/3600,i=r<.1?"<0.1":r.toFixed(1);if(n.push(s.jsxs("span",{children:[s.jsx(Au,{children:e.length})," ",1===e.length?"session":"sessions",","," ",s.jsx(Au,{children:i})," hrs"]},"sessions")),t.length>0){const e={};let r=0;for(const n of t)e[n.category]=(e[n.category]??0)+1,"feature"===n.category&&"complex"===n.complexity&&r++;const i=[],a=["feature","bugfix","refactor","test","docs","setup","deployment","other"];for(const t of a){const n=e[t];if(!n)continue;const a=Lu[t]??Lu.other,o=1===n?a.noun:a.plural,l="feature"===t&&r>0?s.jsxs("span",{children:[" ","(",s.jsx(Au,{children:r})," complex)"]},\`\${t}-complex\`):null;i.push(s.jsxs("span",{children:[a.verb," ",s.jsx(Au,{children:n})," ",o,l]},t))}if(i.length>0){n.push(s.jsx("span",{children:" \u2014 "},"milestone-sep"));for(let e=0;e<i.length;e++)e>0&&n.push(s.jsx("span",{children:", "},\`sep-\${e}\`)),n.push(i[e])}}const a={};for(const s of e)s.client&&(a[s.client]=(a[s.client]??0)+1);const o=Object.entries(a).sort((e,t)=>t[1]-e[1])[0];if(o){const e=Gl[o[0]]??o[0];n.push(s.jsxs("span",{children:[". Most active: ",s.jsx(Au,{children:e})]},"client"))}const l={};for(const s of e){const e=s.languages?.[0];e&&(l[e]=(l[e]??0)+1)}const u=Object.entries(l).sort((e,t)=>t[1]-e[1])[0];if(u){const e=u[0].charAt(0).toUpperCase()+u[0].slice(1);n.push(s.jsxs("span",{children:[". Primary: ",s.jsx(Au,{children:e})]},"lang"))}return n.push(s.jsx("span",{children:"."},"end")),s.jsx(s.Fragment,{children:n})}(e,t),[e,t]);return s.jsx(Yl.div,{initial:{opacity:0},animate:{opacity:1},className:"rounded-xl bg-bg-surface-1 border border-border/50 px-4 py-3 mb-4",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(fe,{className:"w-4 h-4 text-accent flex-shrink-0 mt-0.5"}),s.jsx("p",{className:"text-sm text-text-secondary leading-relaxed",children:n})]})})}function _u({sessions:e}){const{scores:t,summaryLine:n}=f.useMemo(()=>{const t=e.filter(e=>null!=e.evaluation);if(0===t.length)return{scores:null,summaryLine:null};let n=0,r=0,i=0,a=0,o=0,s=0;for(const e of t){const t=e.evaluation;n+=t.prompt_quality,r+=t.context_provided,i+=t.independence_level,a+=t.scope_quality,s+=t.iteration_count,"completed"===t.task_outcome&&o++}const l=t.length,u=Math.round(o/l*100);return{scores:[{label:"Prompt Quality",value:n/l,max:5},{label:"Context",value:r/l,max:5},{label:"Independence",value:i/l,max:5},{label:"Scope",value:a/l,max:5},{label:"Completion",value:u/20,max:5}],summaryLine:\`\${l} session\${1===l?"":"s"} evaluated \xB7 \${u}% completed \xB7 avg \${(s/l).toFixed(1)} iterations\`}},[e]);return s.jsxs(Yl.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.1},className:"rounded-xl bg-bg-surface-1 border border-border/50 p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx("div",{className:"p-1.5 rounded-lg bg-bg-surface-2",children:s.jsx(he,{className:"w-3.5 h-3.5 text-text-muted"})}),s.jsx("h2",{className:"text-sm font-bold text-text-muted uppercase tracking-widest",children:"AI Proficiency"})]}),null===t?s.jsx("p",{className:"text-xs text-text-muted py-2",children:"No evaluation data yet"}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"space-y-3",children:t.map((e,t)=>{const n=e.value/e.max*100,r="Completion"===e.label?\`\${Math.round(n)}%\`:e.value.toFixed(1);return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-xs text-text-secondary font-medium w-28 text-right shrink-0",children:e.label}),s.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-bg-surface-2/50 overflow-hidden",children:s.jsx(Yl.div,{className:"h-full rounded-full",style:{backgroundColor:(i=e.value,i>=4?"var(--color-accent)":i>=3?"var(--color-success)":"var(--color-text-muted)")},initial:{width:0},animate:{width:\`\${n}%\`},transition:{duration:.6,delay:.05*t,ease:[.22,1,.36,1]}})}),s.jsx("span",{className:"text-xs text-text-muted font-mono w-10 text-right shrink-0",children:r})]},e.label);var i})}),s.jsx("p",{className:"text-[10px] text-text-muted mt-4 px-1 font-mono",children:n})]})]})}const Ru=["Output","Efficiency","Prompts","Consistency","Breadth"];function zu(e,t,n,r,i){const a=2*Math.PI*e/5-Math.PI/2;return[n+i*t*Math.cos(a),r+i*t*Math.sin(a)]}function Fu(e,t,n,r){const i=[];for(let a=0;a<5;a++){const[o,s]=zu(a,e,t,n,r);i.push(\`\${o},\${s}\`)}return i.join(" ")}function Ou({sessions:e,milestones:t,streak:n}){const{values:r,hasEvalData:i}=f.useMemo(()=>{const r={simple:1,medium:2,complex:4};let i=0;for(const e of t)i+=r[e.complexity]??1;const a=Math.min(1,i/10),o=e.reduce((e,t)=>e+t.files_touched,0),s=e.reduce((e,t)=>e+t.duration_seconds,0)/3600,l=Math.min(1,o/Math.max(s,1)/20),u=e.filter(e=>null!=e.evaluation);let c=0;const d=u.length>0;if(d){c=u.reduce((e,t)=>e+t.evaluation.prompt_quality,0)/u.length/5}const f=Math.min(1,n/14),h=new Set;for(const t of e)for(const e of t.languages)h.add(e);return{values:[a,l,c,f,Math.min(1,h.size/5)],hasEvalData:d}},[e,t,n]),a=100,o=100,l=[];for(let s=0;s<5;s++){const e=Math.max(r[s],.02),[t,n]=zu(s,e,a,o,70);l.push(\`\${t},\${n}\`)}const u=l.join(" ");return s.jsxs(Yl.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.15},className:"rounded-xl bg-bg-surface-1 border border-border/50 p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("div",{className:"p-1.5 rounded-lg bg-bg-surface-2",children:s.jsx(q,{className:"w-3.5 h-3.5 text-text-muted"})}),s.jsx("h2",{className:"text-sm font-bold text-text-muted uppercase tracking-widest",children:"Skill Profile"})]}),s.jsx("div",{className:"flex justify-center",children:s.jsxs("svg",{viewBox:"0 0 200 200",width:200,height:200,className:"overflow-visible",children:[[.33,.66,1].map(e=>s.jsx("polygon",{points:Fu(e,a,o,70),fill:"none",stroke:"var(--color-bg-surface-3)",strokeWidth:.5,opacity:.6},e)),Array.from({length:5}).map((e,t)=>{const[n,r]=zu(t,1,a,o,70);return s.jsx("line",{x1:a,y1:o,x2:n,y2:r,stroke:"var(--color-bg-surface-3)",strokeWidth:.5,opacity:.4},\`axis-\${t}\`)}),s.jsx(Yl.polygon,{points:u,fill:"var(--color-accent)",fillOpacity:.2,stroke:"var(--color-accent)",strokeWidth:1.5,strokeLinejoin:"round",initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},transition:{duration:.6,ease:[.22,1,.36,1]},style:{transformOrigin:"100px 100px"}}),r.map((e,t)=>{const n=Math.max(e,.02),[r,l]=zu(t,n,a,o,70),u=2===t&&!i;return s.jsx("circle",{cx:r,cy:l,r:2.5,fill:u?"var(--color-text-muted)":"var(--color-accent-bright)",opacity:u?.4:1},\`point-\${t}\`)}),Ru.map((e,t)=>{const n=function(e,t,n,r){const[i,a]=zu(e,1.28,t,n,r);let o="middle";return 1!==e&&2!==e||(o="start"),3!==e&&4!==e||(o="end"),{x:i,y:a,anchor:o}}(t,a,o,70),r=2===t&&!i;return s.jsx("text",{x:n.x,y:n.y,textAnchor:n.anchor,dominantBaseline:"central",className:"text-[9px] font-medium",fill:r?"var(--color-text-muted)":"var(--color-text-secondary)",opacity:r?.5:1,children:e},e)})]})}),s.jsx("div",{className:"flex justify-center gap-3 mt-2 flex-wrap",children:Ru.map((e,t)=>{const n=2===t&&!i,a=Math.round(100*r[t]);return s.jsxs("span",{className:"text-[10px] font-mono "+(n?"text-text-muted/50":"text-text-muted"),children:[a,"%"]},e)})})]})}const Vu={feature:"bg-success/10 text-success border-success/20",bugfix:"bg-error/10 text-error border-error/20",refactor:"bg-purple/10 text-purple border-purple/20",test:"bg-blue/10 text-blue border-blue/20",docs:"bg-accent/10 text-accent border-accent/20",setup:"bg-text-muted/10 text-text-muted border-text-muted/20",deployment:"bg-emerald/10 text-emerald border-emerald/20"};function Iu(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return\`\${n}m ago\`;const r=Math.floor(n/60);if(r<24)return\`\${r}h ago\`;const i=Math.floor(r/24);return 1===i?"yesterday":i<7?\`\${i}d ago\`:new Date(e).toLocaleDateString([],{month:"short",day:"numeric"})}function Bu({milestones:e}){const t=[...e].sort((e,t)=>new Date(t.created_at).getTime()-new Date(e.created_at).getTime()).slice(0,8);return s.jsxs(Yl.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.35,ease:[.22,1,.36,1]},className:"rounded-xl bg-bg-surface-1 border border-border/50 p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3 px-1",children:[s.jsx(pe,{className:"w-4 h-4 text-accent"}),s.jsx("h2",{className:"text-sm font-bold text-text-muted uppercase tracking-widest",children:"Recent Achievements"}),s.jsxs("span",{className:"text-[10px] text-text-muted font-mono bg-bg-surface-2 px-2 py-0.5 rounded ml-auto",children:[e.length," total"]})]}),0===t.length?s.jsx("div",{className:"text-sm text-text-muted text-center py-6",children:"No milestones yet \u2014 complete your first session!"}):s.jsx("div",{className:"space-y-0.5",children:t.map((e,t)=>{const n=Jl[e.category]??"#9c9588",r=Vu[e.category]??"bg-bg-surface-2 text-text-secondary border-border",i=Zl[e.client]??e.client.slice(0,2).toUpperCase(),a=Ql[e.client]??"#91919a",o=e.private_title||e.title,l="complex"===e.complexity;return s.jsxs(Yl.div,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:{duration:.25,delay:.04*t},className:"flex items-center gap-3 py-2 px-2 rounded-lg hover:bg-bg-surface-2/40 transition-colors",children:[s.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:n}}),s.jsx("span",{className:"text-sm font-medium text-text-secondary hover:text-text-primary truncate flex-1 min-w-0",children:o}),s.jsx("span",{className:\`text-[9px] uppercase tracking-wider font-bold px-1.5 py-0.5 rounded-full border flex-shrink-0 \${r}\`,children:e.category}),l&&s.jsxs("span",{className:"flex items-center gap-0.5 text-[9px] uppercase tracking-wider font-bold px-1.5 py-0.5 rounded-full border bg-purple/10 text-purple border-purple/20 flex-shrink-0",children:[s.jsx(q,{className:"w-2.5 h-2.5"}),"complex"]}),s.jsx("span",{className:"text-[10px] text-text-muted font-mono flex-shrink-0",children:Iu(e.created_at)}),s.jsx("div",{className:"w-5 h-5 rounded flex items-center justify-center text-[8px] font-bold font-mono flex-shrink-0",style:{backgroundColor:\`\${a}15\`,color:a,border:\`1px solid \${a}20\`},children:i})]},e.id)})})]})}function $u(){const{sessions:e,milestones:t,config:n,health:r,loading:i,timeTravelTime:a,timeScale:o,filters:l,loadAll:u,loadHealth:c,setTimeTravelTime:d,setTimeScale:h,setFilter:p}=F();f.useEffect(()=>{u(),c()},[u,c]),f.useEffect(()=>{const e=setInterval(c,3e4);if(null!==a)return()=>clearInterval(e);const t=setInterval(u,3e4);return()=>{clearInterval(e),clearInterval(t)}},[a,u,c]);const m=null===a,g=a??Date.now(),y=z[o]/2,v=g-y,b=g+y,x=f.useMemo(()=>function(e,t,n){return e.filter(e=>{const r=new Date(e.started_at).getTime(),i=new Date(e.ended_at).getTime();return r<=n&&i>=t})}(e,v,b),[e,v,b]),w=f.useMemo(()=>function(e,t,n){return e.filter(e=>{const r=new Date(e.created_at).getTime();return r>=t&&r<=n})}(t,v,b),[t,v,b]),k=f.useMemo(()=>function(e,t=[]){let n=0,r=0;const i={},a={},o={},s={};for(const u of e){n+=u.duration_seconds,r+=u.files_touched,i[u.client]=(i[u.client]??0)+u.duration_seconds;for(const e of u.languages)a[e]=(a[e]??0)+u.duration_seconds;o[u.task_type]=(o[u.task_type]??0)+u.duration_seconds,u.project&&(s[u.project]=(s[u.project]??0)+u.duration_seconds)}const l=function(e){let t=0,n=0,r=0;for(const i of e)"feature"===i.category&&t++,"bugfix"===i.category&&n++,"complex"===i.complexity&&r++;return{featuresShipped:t,bugsFixed:n,complexSolved:r}}(t);return{totalHours:n/3600,totalSessions:e.length,currentStreak:V(e),filesTouched:r,...l,byClient:i,byLanguage:a,byTaskType:o,byProject:s}}(x,w),[x,w]),S=f.useMemo(()=>function(e,t,n){if(n)return"Live";const r=new Date((e+t)/2),i=new Date,a=new Date(Date.now()-864e5);return r.toDateString()===i.toDateString()?"Today":r.toDateString()===a.toDateString()?"Yesterday":r.toLocaleDateString([],{month:"short",day:"numeric"})}(v,b,m),[v,b,m]),E=f.useMemo(()=>{if(!m)return new Date(g).toISOString().slice(0,10)},[m,g]);return i?s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsx("div",{className:"text-text-muted text-sm",children:"Loading..."})}):s.jsx("div",{className:"min-h-screen bg-bg-base selection:bg-accent/30 selection:text-text-primary",children:s.jsxs("div",{className:"max-w-[1000px] mx-auto px-6 py-10",children:[s.jsx(ye,{health:r,timeContextLabel:S}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Mu,{value:a,onChange:d,scale:o,onScaleChange:h,sessions:e,milestones:t}),s.jsx(Du,{sessions:x,milestones:w,isLive:m,windowStart:v,windowEnd:b}),s.jsx(Kl,{totalHours:k.totalHours,totalSessions:k.totalSessions,currentStreak:k.currentStreak,filesTouched:k.filesTouched,featuresShipped:k.featuresShipped,bugsFixed:k.bugsFixed,complexSolved:k.complexSolved}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[s.jsx(_u,{sessions:x}),s.jsx(Ou,{sessions:x,milestones:w,streak:k.currentStreak})]}),s.jsx(Bu,{milestones:w}),s.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-1 gap-8",children:s.jsxs("div",{children:[s.jsx(ru,{stats:k}),s.jsx(ou,{byTaskType:k.byTaskType}),s.jsx(lu,{sessions:x,filters:l,onFilterChange:p}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between px-1",children:[s.jsx("h2",{className:"text-sm font-bold text-text-muted uppercase tracking-widest",children:"Activity Feed"}),s.jsxs("span",{className:"text-[10px] text-text-muted font-mono bg-bg-surface-2 px-2 py-0.5 rounded",children:[x.length," Sessions"]})]}),s.jsx(gu,{sessions:x,milestones:w,filters:l})]})]})}),s.jsx("div",{className:"mt-12",children:s.jsx(yu,{sessions:e,timeScale:o,effectiveTime:g,isLive:m,onDayClick:e=>{const t=new Date(\`\${e}T12:00:00\`).getTime();d(t),h("24h")},highlightDate:E})}),s.jsx(bu,{config:n,onRefresh:u})]})]})})}M.createRoot(document.getElementById("root")).render(s.jsx(f.StrictMode,{children:s.jsx($u,{})}));</script>
1975
+ <style rel="stylesheet" crossorigin>/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:"Geist Mono","JetBrains Mono","SF Mono","Fira Code",ui-monospace,monospace;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-black:900;--tracking-tighter:-.05em;--tracking-tight:-.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0,0,.2,1)infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--font-body:"Inter",system-ui,-apple-system,sans-serif;--color-bg-base:var(--bg-base);--color-bg-surface-1:var(--bg-surface-1);--color-bg-surface-2:var(--bg-surface-2);--color-bg-surface-3:var(--bg-surface-3);--color-text-primary:var(--text-primary);--color-text-secondary:var(--text-secondary);--color-text-muted:var(--text-muted);--color-accent:var(--accent);--color-accent-bright:var(--accent-bright);--color-border:var(--border);--color-success:#10b981;--color-error:#ef4444;--color-blue:#3b82f6;--color-purple:#8b5cf6}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--color-border)}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.-top-10{top:calc(var(--spacing)*-10)}.top-0{top:calc(var(--spacing)*0)}.top-3{top:calc(var(--spacing)*3)}.top-4{top:calc(var(--spacing)*4)}.-bottom-1{bottom:calc(var(--spacing)*-1)}.-bottom-1\\.5{bottom:calc(var(--spacing)*-1.5)}.bottom-0{bottom:calc(var(--spacing)*0)}.bottom-2{bottom:calc(var(--spacing)*2)}.bottom-3{bottom:calc(var(--spacing)*3)}.-left-\\[1\\.15rem\\]{left:-1.15rem}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-\\[1\\.65rem\\]{left:1.65rem}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-\\[9999\\]{z-index:9999}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-auto{margin-inline:auto}.my-0\\.5{margin-block:calc(var(--spacing)*.5)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-12{margin-top:calc(var(--spacing)*12)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-0\\.5{margin-bottom:calc(var(--spacing)*.5)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.-ml-2{margin-left:calc(var(--spacing)*-2)}.ml-1\\.5{margin-left:calc(var(--spacing)*1.5)}.ml-auto{margin-left:auto}.flex{display:flex}.grid{display:grid}.inline{display:inline}.h-1\\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-2\\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-8{height:calc(var(--spacing)*8)}.h-16{height:calc(var(--spacing)*16)}.h-20{height:calc(var(--spacing)*20)}.h-full{height:100%}.h-px{height:1px}.min-h-screen{min-height:100vh}.w-1\\.5{width:calc(var(--spacing)*1.5)}.w-2{width:calc(var(--spacing)*2)}.w-2\\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-8{width:calc(var(--spacing)*8)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-24{width:calc(var(--spacing)*24)}.w-28{width:calc(var(--spacing)*28)}.w-32{width:calc(var(--spacing)*32)}.w-40{width:calc(var(--spacing)*40)}.w-\\[2px\\]{width:2px}.w-\\[165px\\]{width:165px}.w-full{width:100%}.w-px{width:1px}.max-w-\\[280px\\]{max-width:280px}.max-w-\\[1000px\\]{max-width:1000px}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[140px\\]{min-width:140px}.min-w-\\[180px\\]{min-width:180px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.origin-bottom{transform-origin:bottom}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-105{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x)var(--tw-scale-y)}.rotate-45{rotate:45deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.touch-none{touch-action:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-8{gap:calc(var(--spacing)*8)}.gap-\\[3px\\]{gap:3px}:where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}.self-center{align-self:center}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t-full{border-top-left-radius:3.40282e38px;border-top-right-radius:3.40282e38px}.rounded-t-md{border-top-left-radius:var(--radius-md);border-top-right-radius:var(--radius-md)}.rounded-t-sm{border-top-left-radius:var(--radius-sm);border-top-right-radius:var(--radius-sm)}.rounded-b-full{border-bottom-right-radius:3.40282e38px;border-bottom-left-radius:3.40282e38px}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-accent,.border-accent\\/10{border-color:var(--color-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\\/10{border-color:color-mix(in oklab,var(--color-accent)10%,transparent)}}.border-accent\\/20{border-color:var(--color-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\\/20{border-color:color-mix(in oklab,var(--color-accent)20%,transparent)}}.border-accent\\/30{border-color:var(--color-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\\/30{border-color:color-mix(in oklab,var(--color-accent)30%,transparent)}}.border-bg-surface-1{border-color:var(--color-bg-surface-1)}.border-blue\\/20{border-color:#3b82f633}@supports (color:color-mix(in lab,red,red)){.border-blue\\/20{border-color:color-mix(in oklab,var(--color-blue)20%,transparent)}}.border-blue\\/30{border-color:#3b82f64d}@supports (color:color-mix(in lab,red,red)){.border-blue\\/30{border-color:color-mix(in oklab,var(--color-blue)30%,transparent)}}.border-border,.border-border\\/30{border-color:var(--color-border)}@supports (color:color-mix(in lab,red,red)){.border-border\\/30{border-color:color-mix(in oklab,var(--color-border)30%,transparent)}}.border-border\\/50{border-color:var(--color-border)}@supports (color:color-mix(in lab,red,red)){.border-border\\/50{border-color:color-mix(in oklab,var(--color-border)50%,transparent)}}.border-border\\/60{border-color:var(--color-border)}@supports (color:color-mix(in lab,red,red)){.border-border\\/60{border-color:color-mix(in oklab,var(--color-border)60%,transparent)}}.border-error\\/20{border-color:#ef444433}@supports (color:color-mix(in lab,red,red)){.border-error\\/20{border-color:color-mix(in oklab,var(--color-error)20%,transparent)}}.border-error\\/30{border-color:#ef44444d}@supports (color:color-mix(in lab,red,red)){.border-error\\/30{border-color:color-mix(in oklab,var(--color-error)30%,transparent)}}.border-purple\\/20{border-color:#8b5cf633}@supports (color:color-mix(in lab,red,red)){.border-purple\\/20{border-color:color-mix(in oklab,var(--color-purple)20%,transparent)}}.border-purple\\/30{border-color:#8b5cf64d}@supports (color:color-mix(in lab,red,red)){.border-purple\\/30{border-color:color-mix(in oklab,var(--color-purple)30%,transparent)}}.border-success\\/20{border-color:#10b98133}@supports (color:color-mix(in lab,red,red)){.border-success\\/20{border-color:color-mix(in oklab,var(--color-success)20%,transparent)}}.border-success\\/30{border-color:#10b9814d}@supports (color:color-mix(in lab,red,red)){.border-success\\/30{border-color:color-mix(in oklab,var(--color-success)30%,transparent)}}.border-text-muted\\/20{border-color:var(--color-text-muted)}@supports (color:color-mix(in lab,red,red)){.border-text-muted\\/20{border-color:color-mix(in oklab,var(--color-text-muted)20%,transparent)}}.bg-accent,.bg-accent\\/5{background-color:var(--color-accent)}@supports (color:color-mix(in lab,red,red)){.bg-accent\\/5{background-color:color-mix(in oklab,var(--color-accent)5%,transparent)}}.bg-accent\\/10{background-color:var(--color-accent)}@supports (color:color-mix(in lab,red,red)){.bg-accent\\/10{background-color:color-mix(in oklab,var(--color-accent)10%,transparent)}}.bg-accent\\/15{background-color:var(--color-accent)}@supports (color:color-mix(in lab,red,red)){.bg-accent\\/15{background-color:color-mix(in oklab,var(--color-accent)15%,transparent)}}.bg-bg-base{background-color:var(--color-bg-base)}.bg-bg-surface-1,.bg-bg-surface-1\\/20{background-color:var(--color-bg-surface-1)}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface-1\\/20{background-color:color-mix(in oklab,var(--color-bg-surface-1)20%,transparent)}}.bg-bg-surface-1\\/30{background-color:var(--color-bg-surface-1)}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface-1\\/30{background-color:color-mix(in oklab,var(--color-bg-surface-1)30%,transparent)}}.bg-bg-surface-1\\/40{background-color:var(--color-bg-surface-1)}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface-1\\/40{background-color:color-mix(in oklab,var(--color-bg-surface-1)40%,transparent)}}.bg-bg-surface-1\\/50{background-color:var(--color-bg-surface-1)}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface-1\\/50{background-color:color-mix(in oklab,var(--color-bg-surface-1)50%,transparent)}}.bg-bg-surface-1\\/80{background-color:var(--color-bg-surface-1)}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface-1\\/80{background-color:color-mix(in oklab,var(--color-bg-surface-1)80%,transparent)}}.bg-bg-surface-2,.bg-bg-surface-2\\/30{background-color:var(--color-bg-surface-2)}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface-2\\/30{background-color:color-mix(in oklab,var(--color-bg-surface-2)30%,transparent)}}.bg-bg-surface-2\\/50{background-color:var(--color-bg-surface-2)}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface-2\\/50{background-color:color-mix(in oklab,var(--color-bg-surface-2)50%,transparent)}}.bg-bg-surface-2\\/60{background-color:var(--color-bg-surface-2)}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface-2\\/60{background-color:color-mix(in oklab,var(--color-bg-surface-2)60%,transparent)}}.bg-bg-surface-3,.bg-bg-surface-3\\/95{background-color:var(--color-bg-surface-3)}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface-3\\/95{background-color:color-mix(in oklab,var(--color-bg-surface-3)95%,transparent)}}.bg-blue\\/10{background-color:#3b82f61a}@supports (color:color-mix(in lab,red,red)){.bg-blue\\/10{background-color:color-mix(in oklab,var(--color-blue)10%,transparent)}}.bg-blue\\/15{background-color:#3b82f626}@supports (color:color-mix(in lab,red,red)){.bg-blue\\/15{background-color:color-mix(in oklab,var(--color-blue)15%,transparent)}}.bg-border\\/20{background-color:var(--color-border)}@supports (color:color-mix(in lab,red,red)){.bg-border\\/20{background-color:color-mix(in oklab,var(--color-border)20%,transparent)}}.bg-border\\/50{background-color:var(--color-border)}@supports (color:color-mix(in lab,red,red)){.bg-border\\/50{background-color:color-mix(in oklab,var(--color-border)50%,transparent)}}.bg-error\\/10{background-color:#ef44441a}@supports (color:color-mix(in lab,red,red)){.bg-error\\/10{background-color:color-mix(in oklab,var(--color-error)10%,transparent)}}.bg-error\\/15{background-color:#ef444426}@supports (color:color-mix(in lab,red,red)){.bg-error\\/15{background-color:color-mix(in oklab,var(--color-error)15%,transparent)}}.bg-purple\\/10{background-color:#8b5cf61a}@supports (color:color-mix(in lab,red,red)){.bg-purple\\/10{background-color:color-mix(in oklab,var(--color-purple)10%,transparent)}}.bg-purple\\/15{background-color:#8b5cf626}@supports (color:color-mix(in lab,red,red)){.bg-purple\\/15{background-color:color-mix(in oklab,var(--color-purple)15%,transparent)}}.bg-success{background-color:var(--color-success)}.bg-success\\/10{background-color:#10b9811a}@supports (color:color-mix(in lab,red,red)){.bg-success\\/10{background-color:color-mix(in oklab,var(--color-success)10%,transparent)}}.bg-success\\/15{background-color:#10b98126}@supports (color:color-mix(in lab,red,red)){.bg-success\\/15{background-color:color-mix(in oklab,var(--color-success)15%,transparent)}}.bg-text-muted\\/10{background-color:var(--color-text-muted)}@supports (color:color-mix(in lab,red,red)){.bg-text-muted\\/10{background-color:color-mix(in oklab,var(--color-text-muted)10%,transparent)}}.bg-text-muted\\/15{background-color:var(--color-text-muted)}@supports (color:color-mix(in lab,red,red)){.bg-text-muted\\/15{background-color:color-mix(in oklab,var(--color-text-muted)15%,transparent)}}.bg-transparent{background-color:#0000}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-transparent{--tw-gradient-from:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-white\\/10{--tw-gradient-to:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.to-white\\/10{--tw-gradient-to:color-mix(in oklab,var(--color-white)10%,transparent)}}.to-white\\/10{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.fill-current{fill:currentColor}.p-1{padding:calc(var(--spacing)*1)}.p-1\\.5{padding:calc(var(--spacing)*1.5)}.p-2{padding:calc(var(--spacing)*2)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.px-0\\.5{padding-inline:calc(var(--spacing)*.5)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-5{padding-block:calc(var(--spacing)*5)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-10{padding-block:calc(var(--spacing)*10)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pl-3{padding-left:calc(var(--spacing)*3)}.pl-6{padding-left:calc(var(--spacing)*6)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[8px\\]{font-size:8px}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-tighter{--tw-tracking:var(--tracking-tighter);letter-spacing:var(--tracking-tighter)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.text-accent,.text-accent\\/60{color:var(--color-accent)}@supports (color:color-mix(in lab,red,red)){.text-accent\\/60{color:color-mix(in oklab,var(--color-accent)60%,transparent)}}.text-accent\\/70{color:var(--color-accent)}@supports (color:color-mix(in lab,red,red)){.text-accent\\/70{color:color-mix(in oklab,var(--color-accent)70%,transparent)}}.text-accent\\/80{color:var(--color-accent)}@supports (color:color-mix(in lab,red,red)){.text-accent\\/80{color:color-mix(in oklab,var(--color-accent)80%,transparent)}}.text-blue{color:var(--color-blue)}.text-error{color:var(--color-error)}.text-purple{color:var(--color-purple)}.text-success{color:var(--color-success)}.text-success\\/60{color:#10b98199}@supports (color:color-mix(in lab,red,red)){.text-success\\/60{color:color-mix(in oklab,var(--color-success)60%,transparent)}}.text-text-muted,.text-text-muted\\/50{color:var(--color-text-muted)}@supports (color:color-mix(in lab,red,red)){.text-text-muted\\/50{color:color-mix(in oklab,var(--color-text-muted)50%,transparent)}}.text-text-muted\\/60{color:var(--color-text-muted)}@supports (color:color-mix(in lab,red,red)){.text-text-muted\\/60{color:color-mix(in oklab,var(--color-text-muted)60%,transparent)}}.text-text-primary{color:var(--color-text-primary)}.text-text-secondary{color:var(--color-text-secondary)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_10px_rgba\\(16\\,185\\,129\\,0\\.1\\)\\]{--tw-shadow:0 0 10px var(--tw-shadow-color,#10b9811a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_10px_rgba\\(99\\,102\\,241\\,0\\.2\\)\\]{--tw-shadow:0 0 10px var(--tw-shadow-color,#6366f133);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_15px_rgba\\(99\\,102\\,241\\,0\\.4\\)\\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#6366f166);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_15px_rgba\\(99\\,102\\,241\\,0\\.5\\)\\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#6366f180);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_2px_10px_rgba\\(99\\,102\\,241\\,0\\.4\\)\\]{--tw-shadow:0 2px 10px var(--tw-shadow-color,#6366f166);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-accent\\/20{--tw-shadow-color:var(--color-accent)}@supports (color:color-mix(in lab,red,red)){.shadow-accent\\/20{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-accent)20%,transparent)var(--tw-shadow-alpha),transparent)}}.ring-accent{--tw-ring-color:var(--color-accent)}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.ring-offset-bg-base{--tw-ring-offset-color:var(--color-bg-base)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\\:scale-x-110:is(:where(.group):hover *){--tw-scale-x:110%;scale:var(--tw-scale-x)var(--tw-scale-y)}.group-hover\\:-rotate-90:is(:where(.group):hover *){rotate:-90deg}.group-hover\\:rotate-180:is(:where(.group):hover *){rotate:180deg}.group-hover\\:bg-accent:is(:where(.group):hover *),.group-hover\\:bg-accent\\/10:is(:where(.group):hover *){background-color:var(--color-accent)}@supports (color:color-mix(in lab,red,red)){.group-hover\\:bg-accent\\/10:is(:where(.group):hover *){background-color:color-mix(in oklab,var(--color-accent)10%,transparent)}}.group-hover\\:text-accent:is(:where(.group):hover *){color:var(--color-accent)}.group-hover\\:text-text-primary:is(:where(.group):hover *){color:var(--color-text-primary)}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}.selection\\:bg-accent\\/30 ::selection{background-color:var(--color-accent)}@supports (color:color-mix(in lab,red,red)){.selection\\:bg-accent\\/30 ::selection{background-color:color-mix(in oklab,var(--color-accent)30%,transparent)}}.selection\\:bg-accent\\/30::selection{background-color:var(--color-accent)}@supports (color:color-mix(in lab,red,red)){.selection\\:bg-accent\\/30::selection{background-color:color-mix(in oklab,var(--color-accent)30%,transparent)}}.selection\\:text-text-primary ::selection{color:var(--color-text-primary)}.selection\\:text-text-primary::selection{color:var(--color-text-primary)}.placeholder\\:text-text-muted\\/50::placeholder{color:var(--color-text-muted)}@supports (color:color-mix(in lab,red,red)){.placeholder\\:text-text-muted\\/50::placeholder{color:color-mix(in oklab,var(--color-text-muted)50%,transparent)}}.focus-within\\:border-accent\\/50:focus-within{border-color:var(--color-accent)}@supports (color:color-mix(in lab,red,red)){.focus-within\\:border-accent\\/50:focus-within{border-color:color-mix(in oklab,var(--color-accent)50%,transparent)}}.focus-within\\:ring-1:focus-within{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-within\\:ring-accent\\/50:focus-within{--tw-ring-color:var(--color-accent)}@supports (color:color-mix(in lab,red,red)){.focus-within\\:ring-accent\\/50:focus-within{--tw-ring-color:color-mix(in oklab,var(--color-accent)50%,transparent)}}@media(hover:hover){.hover\\:scale-125:hover{--tw-scale-x:125%;--tw-scale-y:125%;--tw-scale-z:125%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\\:border-accent\\/30:hover{border-color:var(--color-accent)}@supports (color:color-mix(in lab,red,red)){.hover\\:border-accent\\/30:hover{border-color:color-mix(in oklab,var(--color-accent)30%,transparent)}}.hover\\:border-accent\\/40:hover{border-color:var(--color-accent)}@supports (color:color-mix(in lab,red,red)){.hover\\:border-accent\\/40:hover{border-color:color-mix(in oklab,var(--color-accent)40%,transparent)}}.hover\\:border-text-muted\\/50:hover{border-color:var(--color-text-muted)}@supports (color:color-mix(in lab,red,red)){.hover\\:border-text-muted\\/50:hover{border-color:color-mix(in oklab,var(--color-text-muted)50%,transparent)}}.hover\\:bg-accent:hover{background-color:var(--color-accent)}.hover\\:bg-accent-bright:hover{background-color:var(--color-accent-bright)}.hover\\:bg-bg-surface-1\\/40:hover{background-color:var(--color-bg-surface-1)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-bg-surface-1\\/40:hover{background-color:color-mix(in oklab,var(--color-bg-surface-1)40%,transparent)}}.hover\\:bg-bg-surface-2:hover,.hover\\:bg-bg-surface-2\\/40:hover{background-color:var(--color-bg-surface-2)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-bg-surface-2\\/40:hover{background-color:color-mix(in oklab,var(--color-bg-surface-2)40%,transparent)}}.hover\\:bg-bg-surface-2\\/50:hover{background-color:var(--color-bg-surface-2)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-bg-surface-2\\/50:hover{background-color:color-mix(in oklab,var(--color-bg-surface-2)50%,transparent)}}.hover\\:bg-bg-surface-3:hover{background-color:var(--color-bg-surface-3)}.hover\\:text-text-primary:hover{color:var(--color-text-primary)}.hover\\:text-white:hover{color:var(--color-white)}.hover\\:opacity-80:hover{opacity:.8}}.active\\:cursor-grabbing:active{cursor:grabbing}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-20:disabled{opacity:.2}.disabled\\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\\:flex-row{flex-direction:row}}@media(min-width:48rem){.md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\\:flex-row{flex-direction:row}.md\\:items-center{align-items:center}}@media(min-width:64rem){.lg\\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.lg\\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}}:root{--bg-base:#09090b;--bg-surface-1:#18181b;--bg-surface-2:#27272a;--bg-surface-3:#3f3f46;--text-primary:#fafafa;--text-secondary:#a1a1aa;--text-muted:#71717a;--accent:#6366f1;--accent-bright:#818cf8;--accent-dim:#3730a3;--border:#27272a;--border-accent:#6366f133;--glass-bg:#18181bb3;--glass-border:#ffffff0d}@media(prefers-color-scheme:light){:root{--bg-base:#fff;--bg-surface-1:#f4f4f5;--bg-surface-2:#e4e4e7;--bg-surface-3:#d4d4d8;--text-primary:#09090b;--text-secondary:#52525b;--text-muted:#71717a;--accent:#4f46e5;--accent-bright:#6366f1;--accent-dim:#e0e7ff;--border:#e4e4e7;--border-accent:#4f46e51a;--glass-bg:#ffffffb3;--glass-border:#0000000d}}::selection{color:var(--color-text-primary);background:#6366f14d}::-webkit-scrollbar{width:5px;height:5px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--color-bg-surface-3);border-radius:10px}::-webkit-scrollbar-thumb:hover{background:var(--color-text-muted)}body{font-family:var(--font-body);background:var(--color-bg-base);color:var(--color-text-primary);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;min-height:100vh;margin:0;line-height:1.6}.glass-card{background:var(--glass-bg);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border:1px solid var(--glass-border);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.subtle-glow{position:relative}.subtle-glow:after{content:"";border-radius:inherit;z-index:-1;pointer-events:none;background:linear-gradient(45deg,#0000,#6366f11a,#0000);position:absolute;inset:-1px}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}</style>
1973
1976
  </head>
1974
1977
  <body>
1975
1978
  <div id="root"></div>
@@ -2250,6 +2253,9 @@ function sealOrphanFile(sessionId) {
2250
2253
  const client = startData["client"] ?? "unknown";
2251
2254
  const taskType = startData["task_type"] ?? "coding";
2252
2255
  const startTime = firstRecord.timestamp;
2256
+ const orphanTitle = startData["title"] ?? void 0;
2257
+ const orphanPrivateTitle = startData["private_title"] ?? void 0;
2258
+ const orphanProject = startData["project"] ?? void 0;
2253
2259
  let heartbeatCount = 0;
2254
2260
  for (const line of lines) {
2255
2261
  try {
@@ -2297,12 +2303,19 @@ function sealOrphanFile(sessionId) {
2297
2303
  renameSync3(filePath, join7(SEALED_DIR, `${sessionId}.jsonl`));
2298
2304
  } catch {
2299
2305
  }
2306
+ const convId = startData["conversation_id"] ?? void 0;
2307
+ const convIdx = startData["conversation_index"] ?? void 0;
2300
2308
  const seal = {
2301
2309
  session_id: sessionId,
2310
+ conversation_id: convId,
2311
+ conversation_index: convIdx,
2302
2312
  client,
2303
2313
  task_type: taskType,
2304
2314
  languages: [],
2305
2315
  files_touched: 0,
2316
+ project: orphanProject,
2317
+ title: orphanTitle,
2318
+ private_title: orphanPrivateTitle,
2306
2319
  started_at: startTime,
2307
2320
  ended_at: now,
2308
2321
  duration_seconds: duration,
@@ -2312,9 +2325,7 @@ function sealOrphanFile(sessionId) {
2312
2325
  chain_end_hash: endRecord.hash,
2313
2326
  seal_signature: sealSignature
2314
2327
  };
2315
- const allSessions = readJson(SESSIONS_FILE, []);
2316
- allSessions.push(seal);
2317
- writeJson(SESSIONS_FILE, allSessions);
2328
+ upsertSessionSeal(seal);
2318
2329
  } catch {
2319
2330
  }
2320
2331
  }
@@ -2340,6 +2351,45 @@ function isSessionAlreadySealed(session2) {
2340
2351
  const activePath = join7(ACTIVE_DIR, `${session2.sessionId}.jsonl`);
2341
2352
  return !existsSync8(activePath);
2342
2353
  }
2354
+ function sealRichness(s) {
2355
+ let score = 0;
2356
+ if (s.title) score += 10;
2357
+ if (s.private_title) score += 10;
2358
+ if (s.conversation_id) score += 20;
2359
+ if (s.evaluation) score += 20;
2360
+ if (s.languages && s.languages.length > 0) score += 5;
2361
+ if (s.files_touched > 0) score += 5;
2362
+ if (s.project && !["untitled", "mcp", "unknown"].includes(s.project)) score += 5;
2363
+ return score;
2364
+ }
2365
+ function deduplicateSessionsIndex() {
2366
+ const allSessions = readJson(SESSIONS_FILE, []);
2367
+ if (allSessions.length === 0) return;
2368
+ const seen = /* @__PURE__ */ new Map();
2369
+ for (const s of allSessions) {
2370
+ const existing = seen.get(s.session_id);
2371
+ if (!existing || sealRichness(s) > sealRichness(existing)) {
2372
+ seen.set(s.session_id, s);
2373
+ }
2374
+ }
2375
+ const deduped = [...seen.values()];
2376
+ if (deduped.length < allSessions.length) {
2377
+ console.log(`Deduplicated sessions.json: ${allSessions.length} \u2192 ${deduped.length} entries`);
2378
+ writeJson(SESSIONS_FILE, deduped);
2379
+ }
2380
+ }
2381
+ function upsertSessionSeal(seal) {
2382
+ const allSessions = readJson(SESSIONS_FILE, []);
2383
+ const existingIdx = allSessions.findIndex((s) => s.session_id === seal.session_id);
2384
+ if (existingIdx >= 0) {
2385
+ if (sealRichness(seal) >= sealRichness(allSessions[existingIdx])) {
2386
+ allSessions[existingIdx] = seal;
2387
+ }
2388
+ } else {
2389
+ allSessions.push(seal);
2390
+ }
2391
+ writeJson(SESSIONS_FILE, allSessions);
2392
+ }
2343
2393
  function autoSealSession(active) {
2344
2394
  const { session: session2 } = active;
2345
2395
  if (session2.sessionRecordCount === 0) return;
@@ -2362,6 +2412,9 @@ function autoSealSession(active) {
2362
2412
  task_type: session2.sessionTaskType,
2363
2413
  languages: [],
2364
2414
  files_touched: 0,
2415
+ project: session2.project ?? void 0,
2416
+ title: session2.sessionTitle ?? void 0,
2417
+ private_title: session2.sessionPrivateTitle ?? void 0,
2365
2418
  started_at: new Date(session2.sessionStartTime).toISOString(),
2366
2419
  ended_at: now,
2367
2420
  duration_seconds: duration,
@@ -2395,6 +2448,9 @@ function autoSealSession(active) {
2395
2448
  task_type: session2.sessionTaskType,
2396
2449
  languages: [],
2397
2450
  files_touched: 0,
2451
+ project: session2.project ?? void 0,
2452
+ title: session2.sessionTitle ?? void 0,
2453
+ private_title: session2.sessionPrivateTitle ?? void 0,
2398
2454
  started_at: new Date(session2.sessionStartTime).toISOString(),
2399
2455
  ended_at: now,
2400
2456
  duration_seconds: duration,
@@ -2404,9 +2460,7 @@ function autoSealSession(active) {
2404
2460
  chain_end_hash: endRecord.hash,
2405
2461
  seal_signature: sealSignature
2406
2462
  };
2407
- const allSessions = readJson(SESSIONS_FILE, []);
2408
- allSessions.push(seal);
2409
- writeJson(SESSIONS_FILE, allSessions);
2463
+ upsertSessionSeal(seal);
2410
2464
  }
2411
2465
  function sealSessionData(active) {
2412
2466
  autoSealSession(active);
@@ -2476,6 +2530,7 @@ async function startDaemon(port) {
2476
2530
  }
2477
2531
  } catch {
2478
2532
  }
2533
+ deduplicateSessionsIndex();
2479
2534
  sealOrphanedSessions();
2480
2535
  const sweepInterval = setInterval(sealOrphanedSessions, ORPHAN_SWEEP_INTERVAL_MS);
2481
2536
  sweepInterval.unref();
@@ -2573,7 +2628,18 @@ async function startDaemon(port) {
2573
2628
  name: "UseAI",
2574
2629
  version: VERSION
2575
2630
  });
2576
- registerTools(mcpServer, sessionState);
2631
+ registerTools(mcpServer, sessionState, {
2632
+ sealBeforeReset: () => {
2633
+ for (const [, active] of sessions) {
2634
+ if (active.session === sessionState) {
2635
+ if (active.session.sessionRecordCount > 0 && !isSessionAlreadySealed(active.session)) {
2636
+ autoSealSession(active);
2637
+ }
2638
+ break;
2639
+ }
2640
+ }
2641
+ }
2642
+ });
2577
2643
  const transport = new StreamableHTTPServerTransport({
2578
2644
  sessionIdGenerator: () => randomUUID4(),
2579
2645
  onsessioninitialized: (newSid) => {