@devness/useai 0.5.18 → 0.5.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +20 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2681,7 +2681,7 @@ var VERSION;
|
|
|
2681
2681
|
var init_version = __esm({
|
|
2682
2682
|
"../shared/dist/constants/version.js"() {
|
|
2683
2683
|
"use strict";
|
|
2684
|
-
VERSION = "0.5.
|
|
2684
|
+
VERSION = "0.5.20";
|
|
2685
2685
|
}
|
|
2686
2686
|
});
|
|
2687
2687
|
|
|
@@ -36239,6 +36239,9 @@ var init_session_state = __esm({
|
|
|
36239
36239
|
detectProject() {
|
|
36240
36240
|
this.project = basename(process.cwd());
|
|
36241
36241
|
}
|
|
36242
|
+
setProject(project) {
|
|
36243
|
+
this.project = project;
|
|
36244
|
+
}
|
|
36242
36245
|
setClient(name) {
|
|
36243
36246
|
this.clientName = name;
|
|
36244
36247
|
}
|
|
@@ -36369,14 +36372,16 @@ function registerTools(server2, session2, opts) {
|
|
|
36369
36372
|
{
|
|
36370
36373
|
task_type: external_exports.enum(["coding", "debugging", "testing", "planning", "reviewing", "documenting", "learning", "other"]).optional().describe("What kind of task is the developer working on?"),
|
|
36371
36374
|
title: external_exports.string().optional().describe(`Short public session title derived from the user's prompt. No project names, file paths, or identifying details. Example: "Fix authentication bug"`),
|
|
36372
|
-
private_title: external_exports.string().optional().describe('Detailed session title for private records. Can include project names and specifics. Example: "Fix JWT refresh in UseAI login flow"')
|
|
36375
|
+
private_title: external_exports.string().optional().describe('Detailed session title for private records. Can include project names and specifics. Example: "Fix JWT refresh in UseAI login flow"'),
|
|
36376
|
+
project: external_exports.string().optional().describe('Project name for this session. Typically the root directory name of the codebase being worked on. Example: "goodpass", "useai"')
|
|
36373
36377
|
},
|
|
36374
|
-
async ({ task_type, title, private_title }) => {
|
|
36378
|
+
async ({ task_type, title, private_title, project }) => {
|
|
36375
36379
|
if (session2.sessionRecordCount > 0 && opts?.sealBeforeReset) {
|
|
36376
36380
|
opts.sealBeforeReset();
|
|
36377
36381
|
}
|
|
36378
36382
|
session2.reset();
|
|
36379
36383
|
resolveClient(server2, session2);
|
|
36384
|
+
if (project) session2.setProject(project);
|
|
36380
36385
|
session2.setTaskType(task_type ?? "coding");
|
|
36381
36386
|
session2.setTitle(title ?? null);
|
|
36382
36387
|
session2.setPrivateTitle(private_title ?? null);
|
|
@@ -36634,7 +36639,7 @@ var U={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"
|
|
|
36634
36639
|
*
|
|
36635
36640
|
* This source code is licensed under the ISC license.
|
|
36636
36641
|
* See the LICENSE file in the root directory of this source tree.
|
|
36637
|
-
*/function je({activeTab:e,onTabChange:t}){return s.jsx("div",{className:"flex gap-0.5 p-0.5 rounded-lg bg-bg-surface-1 border border-border/40",children:Ee.map(({id:n,label:r})=>{const i=e===n;return s.jsx("button",{onClick:()=>t(n),className:\`\\n px-3 py-1 rounded-md text-xs font-medium transition-all duration-150\\n \${i?"bg-bg-surface-2 text-text-primary shadow-sm":"text-text-muted hover:text-text-primary"}\\n \`,children:r},n)})})}function Pe({className:e}){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 611.54 143.47",className:e,children:[s.jsxs("g",{fill:"var(--text-primary)",children:[s.jsx("path",{d:"M21.4,121.85c-4.57-4.57-6.85-10.02-6.85-16.37V17.23c0-3.1,1.55-4.65,4.64-4.65h25.55c3.1,0,4.65,1.55,4.65,4.65v76.64c0,3.25,1.12,6,3.37,8.25,2.24,2.25,4.99,3.37,8.25,3.37h27.87c3.25,0,6-1.12,8.25-3.37,2.24-2.24,3.37-4.99,3.37-8.25V17.23c0-3.1,1.55-4.65,4.64-4.65h25.55c3.1,0,4.65,1.55,4.65,4.65v88.25c0,6.35-2.29,11.81-6.85,16.37-4.57,4.57-10.03,6.85-16.37,6.85H37.78c-6.35,0-11.81-2.28-16.37-6.85Z"}),s.jsx("path",{d:"M146.93,124.06v-13.93c0-3.1,1.55-4.65,4.64-4.65h69.67c3.25,0,6-1.12,8.25-3.37,2.24-2.24,3.37-4.99,3.37-8.25s-1.12-6-3.37-8.25c-2.25-2.24-4.99-3.37-8.25-3.37h-51.09c-6.35,0-11.81-2.28-16.37-6.85-4.57-4.57-6.85-10.02-6.85-16.37v-23.22c0-6.35,2.28-11.81,6.85-16.37,4.56-4.57,10.02-6.85,16.37-6.85h92.9c3.1,0,4.65,1.55,4.65,4.65v13.94c0,3.1-1.55,4.65-4.65,4.65h-69.67c-3.25,0-6,1.12-8.25,3.37-2.25,2.25-3.37,4.99-3.37,8.25s1.12,6,3.37,8.25c2.24,2.25,4.99,3.37,8.25,3.37h51.09c6.35,0,11.8,2.29,16.37,6.85,4.57,4.57,6.85,10.03,6.85,16.37v23.22c0,6.35-2.29,11.81-6.85,16.37-4.57,4.57-10.03,6.85-16.37,6.85h-92.9c-3.1,0-4.64-1.55-4.64-4.65Z"}),s.jsx("path",{d:"M286.16,121.85c-4.57-4.57-6.85-10.02-6.85-16.37V35.81c0-6.35,2.28-11.81,6.85-16.37,4.56-4.57,10.02-6.85,16.37-6.85h74.32c6.35,0,11.8,2.29,16.37,6.85,4.57,4.57,6.85,10.03,6.85,16.37v23.22c0,6.35-2.29,11.81-6.85,16.37-4.57,4.57-10.03,6.85-16.37,6.85h-62.71v11.61c0,3.25,1.12,6,3.37,8.25,2.24,2.25,4.99,3.37,8.25,3.37h69.67c3.1,0,4.65,1.55,4.65,4.65v13.93c0,3.1-1.55,4.65-4.65,4.65h-92.9c-6.35,0-11.81-2.28-16.37-6.85ZM361.87,55.66c2.24-2.24,3.37-4.99,3.37-8.25s-1.12-6-3.37-8.25c-2.25-2.24-4.99-3.37-8.25-3.37h-27.87c-3.25,0-6,1.12-8.25,3.37-2.25,2.25-3.37,4.99-3.37,8.25v11.61h39.48c3.25,0,6-1.12,8.25-3.37Z"})]}),s.jsxs("g",{fill:"var(--accent)",children:[s.jsx("path",{d:"M432.08,126.44c-4.76-4.76-7.14-10.44-7.14-17.06v-24.2c0-6.61,2.38-12.3,7.14-17.06,4.76-4.76,10.44-7.14,17.06-7.14h65.34v-12.1c0-3.39-1.17-6.25-3.51-8.59-2.34-2.34-5.2-3.51-8.59-3.51h-72.6c-3.23,0-4.84-1.61-4.84-4.84v-14.52c0-3.23,1.61-4.84,4.84-4.84h96.8c6.61,0,12.3,2.38,17.06,7.14,4.76,4.76,7.14,10.45,7.14,17.06v72.6c0,6.62-2.38,12.3-7.14,17.06-4.76,4.76-10.45,7.14-17.06,7.14h-77.44c-6.62,0-12.3-2.38-17.06-7.14ZM510.97,105.87c2.34-2.34,3.51-5.2,3.51-8.59v-12.1h-41.14c-3.39,0-6.25,1.17-8.59,3.51-2.34,2.34-3.51,5.2-3.51,8.59s1.17,6.25,3.51,8.59c2.34,2.34,5.2,3.51,8.59,3.51h29.04c3.39,0,6.25-1.17,8.59-3.51Z"}),s.jsx("path",{d:"M562.87,128.74V17.42c0-3.23,1.61-4.84,4.84-4.84h26.62c3.23,0,4.84,1.61,4.84,4.84v111.32c0,3.23-1.61,4.84-4.84,4.84h-26.62c-3.23,0-4.84-1.61-4.84-4.84Z"})]})]})}function Ne({health:e,timeContextLabel:t,activeTab:n,onTabChange:r}){return s.jsxs("div",{className:"sticky top-0 z-50 relative flex items-center justify-between mb-4 py-3 -mx-6 px-6 bg-bg-base/80 backdrop-blur-md border-b border-transparent",style:{borderImage:"linear-gradient(to right, transparent, var(--border), transparent) 1"},children:[s.jsx("div",{className:"flex items-center gap-3",children:s.jsx(Pe,{className:"h-6"})}),s.jsx("div",{className:"absolute left-1/2 -translate-x-1/2",children:s.jsx(je,{activeTab:n,onTabChange:r})}),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(q,{className:"w-3 h-3"}),t]})]})]})}const Me=f.createContext({});function De(e){const t=f.useRef(null);return null===t.current&&(t.current=e()),t.current}const Le="undefined"!=typeof window,Ae=Le?f.useLayoutEffect:f.useEffect,_e=f.createContext(null);function ze(e,t){-1===e.indexOf(t)&&e.push(t)}function Re(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Fe=(e,t,n)=>n>t?t:n<e?e:n;const Oe={},Ve=e=>/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(e);function Ie(e){return"object"==typeof e&&null!==e}const $e=e=>/^0[^.\\s]+$/u.test(e);function Be(e){let t;return()=>(void 0===t&&(t=e()),t)}const Ue=e=>e,He=(e,t)=>n=>t(e(n)),We=(...e)=>e.reduce(He),qe=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r};class Ye{constructor(){this.subscriptions=[]}add(e){return ze(this.subscriptions,e),()=>Re(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 Xe=e=>1e3*e,Ke=e=>e/1e3;function Qe(e,t){return t?e*(1e3/t):0}const Ge=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Ze(e,t,n,r){if(e===t&&n===r)return Ue;const i=t=>function(e,t,n,r,i){let a,o,s=0;do{o=t+(n-t)/2,a=Ge(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:Ge(i(e),t,r)}const Je=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,et=e=>t=>1-e(1-t),tt=Ze(.33,1.53,.69,.99),nt=et(tt),rt=Je(nt),it=e=>(e*=2)<1?.5*nt(e):.5*(2-Math.pow(2,-10*(e-1))),at=e=>1-Math.sin(Math.acos(e)),ot=et(at),st=Je(at),lt=Ze(.42,0,1,1),ut=Ze(0,0,.58,1),ct=Ze(.42,0,.58,1),dt=e=>Array.isArray(e)&&"number"==typeof e[0],ft={linear:Ue,easeIn:lt,easeInOut:ct,easeOut:ut,circIn:at,circInOut:st,circOut:ot,backIn:nt,backInOut:rt,backOut:tt,anticipate:it},ht=e=>{if(dt(e)){e.length;const[t,n,r,i]=e;return Ze(t,n,r,i)}return"string"==typeof e?ft[e]:e},pt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function mt(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=pt.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=Oe.useManualTiming?i.timestamp:performance.now();n=!1,Oe.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:pt.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<pt.length;t++)o[pt[t]].cancel(e)},state:i,steps:o}}const{schedule:gt,cancel:yt,state:vt,steps:bt}=mt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Ue,!0);let xt;function wt(){xt=void 0}const kt={now:()=>(void 0===xt&&kt.set(vt.isProcessing||Oe.useManualTiming?vt.timestamp:performance.now()),xt),set:e=>{xt=e,queueMicrotask(wt)}},St=e=>t=>"string"==typeof t&&t.startsWith(e),Ct=St("--"),Tt=St("var(--"),Et=e=>!!Tt(e)&&jt.test(e.split("/*")[0].trim()),jt=/var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;function Pt(e){return"string"==typeof e&&e.split("/*")[0].includes("var(--")}const Nt={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Mt={...Nt,transform:e=>Fe(0,1,e)},Dt={...Nt,default:1},Lt=e=>Math.round(1e5*e)/1e5,At=/-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;const _t=/^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu,zt=(e,t)=>n=>Boolean("string"==typeof n&&_t.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),Rt=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[i,a,o,s]=r.match(At);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:void 0!==s?parseFloat(s):1}},Ft={...Nt,transform:e=>Math.round((e=>Fe(0,255,e))(e))},Ot={test:zt("rgb","red"),parse:Rt("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ft.transform(e)+", "+Ft.transform(t)+", "+Ft.transform(n)+", "+Lt(Mt.transform(r))+")"};const Vt={test:zt("#"),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:Ot.transform},It=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>\`\${t}\${e}\`}),$t=It("deg"),Bt=It("%"),Ut=It("px"),Ht=It("vh"),Wt=It("vw"),qt=(()=>({...Bt,parse:e=>Bt.parse(e)/100,transform:e=>Bt.transform(100*e)}))(),Yt={test:zt("hsl","hue"),parse:Rt("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Bt.transform(Lt(t))+", "+Bt.transform(Lt(n))+", "+Lt(Mt.transform(r))+")"},Xt={test:e=>Ot.test(e)||Vt.test(e)||Yt.test(e),parse:e=>Ot.test(e)?Ot.parse(e):Yt.test(e)?Yt.parse(e):Vt.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?Ot.transform(e):Yt.transform(e),getAnimatableNone:e=>{const t=Xt.parse(e);return t.alpha=0,Xt.transform(t)}},Kt=/(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;const Qt="number",Gt="color",Zt=/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 Jt(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const o=t.replace(Zt,e=>(Xt.test(e)?(r.color.push(a),i.push(Gt),n.push(Xt.parse(e))):e.startsWith("var(")?(r.var.push(a),i.push("var"),n.push(e)):(r.number.push(a),i.push(Qt),n.push(parseFloat(e))),++a,"\${}")).split("\${}");return{values:n,split:o,indexes:r,types:i}}function en(e){return Jt(e).values}function tn(e){const{split:t,types:n}=Jt(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===Qt?Lt(e[a]):t===Gt?Xt.transform(e[a]):e[a]}return i}}const nn=e=>"number"==typeof e?0:Xt.test(e)?Xt.getAnimatableNone(e):e;const rn={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(At)?.length||0)+(e.match(Kt)?.length||0)>0},parse:en,createTransformer:tn,getAnimatableNone:function(e){const t=en(e);return tn(e)(t.map(nn))}};function an(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 on(e,t){return n=>n>0?t:e}const sn=(e,t,n)=>e+(t-e)*n,ln=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},un=[Vt,Ot,Yt];function cn(e){const t=(n=e,un.find(e=>e.test(n)));var n;if(!Boolean(t))return!1;let r=t.parse(e);return t===Yt&&(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=an(s,r,e+1/3),a=an(s,r,e),o=an(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 dn=(e,t)=>{const n=cn(e),r=cn(t);if(!n||!r)return on(e,t);const i={...n};return e=>(i.red=ln(n.red,r.red,e),i.green=ln(n.green,r.green,e),i.blue=ln(n.blue,r.blue,e),i.alpha=sn(n.alpha,r.alpha,e),Ot.transform(i))},fn=new Set(["none","hidden"]);function hn(e,t){return n=>sn(e,t,n)}function pn(e){return"number"==typeof e?hn:"string"==typeof e?Et(e)?on:Xt.test(e)?dn:yn:Array.isArray(e)?mn:"object"==typeof e?Xt.test(e)?dn:gn:on}function mn(e,t){const n=[...e],r=n.length,i=e.map((e,n)=>pn(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function gn(e,t){const n={...e,...t},r={};for(const i in n)void 0!==e[i]&&void 0!==t[i]&&(r[i]=pn(e[i])(e[i],t[i]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const yn=(e,t)=>{const n=rn.createTransformer(t),r=Jt(e),i=Jt(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?fn.has(e)&&!i.values.length||fn.has(t)&&!r.values.length?function(e,t){return fn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):We(mn(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):on(e,t)};function vn(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return sn(e,t,n);return pn(e)(e,t)}const bn=e=>{const t=({timestamp:t})=>e(t);return{start:(e=!0)=>gt.update(t,e),stop:()=>yt(t),now:()=>vt.isProcessing?vt.timestamp:kt.now()}},xn=(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)})\`},wn=2e4;function kn(e){let t=0;let n=e.next(t);for(;!n.done&&t<wn;)t+=50,n=e.next(t);return t>=wn?1/0:t}function Sn(e,t,n){const r=Math.max(t-5,0);return Qe(n-e(r),t-r)}const Cn=100,Tn=10,En=1,jn=0,Pn=800,Nn=.3,Mn=.3,Dn={granular:.01,default:2},Ln={granular:.005,default:.5},An=.01,_n=10,zn=.05,Rn=1,Fn=.001;function On({duration:e=Pn,bounce:t=Nn,velocity:n=jn,mass:r=En}){let i,a,o=1-t;o=Fe(zn,Rn,o),e=Fe(An,_n,Ke(e)),o<1?(i=t=>{const r=t*o,i=r*e,a=r-n,s=In(t,o),l=Math.exp(-i);return Fn-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=In(Math.pow(t,2),o);return(-i(t)+Fn>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<Vn;i++)r-=e(r)/t(r);return r}(i,a,5/e);if(e=Xe(e),isNaN(s))return{stiffness:Cn,damping:Tn,duration:e};{const t=Math.pow(s,2)*r;return{stiffness:t,damping:2*o*Math.sqrt(r*t),duration:e}}}const Vn=12;function In(e,t){return e*Math.sqrt(1-t*t)}const $n=["duration","bounce"],Bn=["stiffness","damping","mass"];function Un(e,t){return t.some(t=>void 0!==e[t])}function Hn(e=Mn,t=Nn){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:jn,stiffness:Cn,damping:Tn,mass:En,isResolvedFromDuration:!1,...e};if(!Un(e,Bn)&&Un(e,$n))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(1.2*n),i=r*r,a=2*Fe(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:En,stiffness:i,damping:a}}else{const n=On(e);t={...t,...n,mass:En},t.isResolvedFromDuration=!0}return t}({...n,velocity:-Ke(n.velocity||0)}),p=f||0,m=u/(2*Math.sqrt(l*c)),g=o-a,y=Ke(Math.sqrt(l/c)),v=Math.abs(g)<5;let b;if(r||(r=v?Dn.granular:Dn.default),i||(i=v?Ln.granular:Ln.default),m<1){const e=In(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?Xe(p):Sn(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(kn(x),wn),t=xn(t=>x.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return x}function Wn({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=Hn({keyframes:[f.value,h(f.value)],velocity:Sn(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 qn(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||Oe.mix||vn,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]||Ue:t;n=We(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=qe(e[r],e[r+1],n);return s[r](i)};return n?t=>u(Fe(e[0],e[a-1],t)):u}function Yn(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=qe(0,t,r);e.push(sn(n,1,i))}}(t,e.length-1),t}function Xn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(ht):ht(r),a={done:!1,value:t[0]},o=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:Yn(t),e),s=qn(o,t,{ease:Array.isArray(i)?i:(l=t,u=i,l.map(()=>u||ct).splice(0,l.length-1))});var l,u;return{calculatedDuration:e,next:t=>(a.value=s(t),a.done=t>=e,a)}}Hn.applyToOptions=e=>{const t=function(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(kn(r),wn);return{type:"keyframes",ease:e=>r.next(i*e).value/t,duration:Ke(i)}}(e,100,Hn);return e.ease=t.ease,e.duration=Xe(t.duration),e.type="keyframes",e};const Kn=e=>null!==e;function Qn(e,{repeat:t,repeatType:n="loop"},r,i=1){const a=e.filter(Kn),o=i<0||t&&"loop"!==n&&t%2==1?0:a.length-1;return o&&void 0!==r?r:a[o]}const Gn={decay:Wn,inertia:Wn,tween:Xn,keyframes:Xn,spring:Hn};function Zn(e){"string"==typeof e.type&&(e.type=Gn[e.type])}class Jn{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 er=e=>e/100;class tr extends Jn{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!==kt.now()&&this.tick(kt.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;Zn(e);const{type:t=Xn,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e;let{keyframes:o}=e;const s=t||Xn;s!==Xn&&"number"!=typeof o[0]&&(this.mixKeyframes=We(er,vn(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=kn(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=Fe(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!==Wn&&(x.value=Qn(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 Ke(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ke(e)}get time(){return Ke(this.currentTime)}set time(e){e=Xe(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(kt.now());const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Ke(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=bn,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(kt.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 nr=e=>180*e/Math.PI,rr=e=>{const t=nr(Math.atan2(e[1],e[0]));return ar(t)},ir={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:rr,rotateZ:rr,skewX:e=>nr(Math.atan(e[1])),skewY:e=>nr(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ar=e=>((e%=360)<0&&(e+=360),e),or=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),sr=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),lr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:or,scaleY:sr,scale:e=>(or(e)+sr(e))/2,rotateX:e=>ar(nr(Math.atan2(e[6],e[5]))),rotateY:e=>ar(nr(Math.atan2(-e[2],e[0]))),rotateZ:rr,rotate:rr,skewX:e=>nr(Math.atan(e[4])),skewY:e=>nr(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ur(e){return e.includes("scale")?1:0}function cr(e,t){if(!e||"none"===e)return ur(t);const n=e.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u);let r,i;if(n)r=lr,i=n;else{const t=e.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u);r=ir,i=t}if(!i)return ur(t);const a=r[t],o=i[1].split(",").map(dr);return"function"==typeof a?a(o):o[a]}function dr(e){return parseFloat(e.trim())}const fr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],hr=(()=>new Set(fr))(),pr=e=>e===Nt||e===Ut,mr=new Set(["x","y","z"]),gr=fr.filter(e=>!mr.has(e));const yr={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})=>cr(t,"x"),y:(e,{transform:t})=>cr(t,"y")};yr.translateX=yr.x,yr.translateY=yr.y;const vr=new Set;let br=!1,xr=!1,wr=!1;function kr(){if(xr){const e=Array.from(vr).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 gr.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)})}xr=!1,br=!1,vr.forEach(e=>e.complete(wr)),vr.clear()}function Sr(){vr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(xr=!0)})}class Cr{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?(vr.add(this),br||(br=!0,gt.read(Sr),gt.resolveKeyframes(kr))):(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),vr.delete(this)}cancel(){"scheduled"===this.state&&(vr.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Tr=Be(()=>void 0!==window.ScrollTimeline),Er={};function jr(e,t){const n=Be(e);return()=>Er[t]??n()}const Pr=jr(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),Nr=([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:Nr([0,.65,.55,1]),circOut:Nr([.55,0,1,.45]),backIn:Nr([.31,.01,.66,-.59]),backOut:Nr([.33,1.53,.69,.99])};function Dr(e,t){return e?"function"==typeof e?Pr()?xn(e,t):"ease-out":dt(e)?Nr(e):Array.isArray(e)?e.map(e=>Dr(e,t)||Mr.easeOut):Mr[e]:void 0}function Lr(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=Dr(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 Ar(e){return"function"==typeof e&&"applyToOptions"in e}class _r extends Jn{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 Ar(e)&&Pr()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=Lr(t,n,r,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const e=Qn(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 Ke(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ke(e)}get time(){return Ke(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Xe(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&&Tr()?(this.animation.timeline=e,Ue):t(this)}}const zr={anticipate:it,backInOut:rt,circInOut:st};function Rr(e){"string"==typeof e.ease&&e.ease in zr&&(e.ease=zr[e.ease])}class Fr extends _r{constructor(e){Rr(e),Zn(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 tr({...a,autoplay:!1}),s=Math.max(10,kt.now()-this.startTime),l=Fe(0,10,s-10);t.setWithVelocity(o.sample(Math.max(0,s-l)).value,o.sample(s).value,l),o.stop()}}const Or=(e,t)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!rn.test(e)&&"0"!==e||e.startsWith("url(")));function Vr(e){e.duration=0,e.type="keyframes"}const Ir=new Set(["opacity","clipPath","filter","transform"]),$r=Be(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Br extends Jn{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=kt.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||Cr;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=kt.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=Or(i,t),s=Or(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||Ar(n))&&r)}(e,i,a,o)||(!Oe.instantAnimations&&s||u?.(Qn(e,n,t)),e[0]=e[e.length-1],Vr(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 $r()&&n&&Ir.has(n)&&("transform"!==n||!u)&&!l&&!r&&"mirror"!==i&&0!==a&&"inertia"!==o}(c),f=c.motionValue?.owner?.current,h=d?new Fr({...c,element:f}):new tr(c);h.finished.then(()=>{this.notifyFinished()}).catch(Ue),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(),wr=!0,Sr(),kr(),wr=!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 Ur(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 Hr=/^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u;function Wr(e,t,n=1){const[r,i]=function(e){const t=Hr.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 Ve(e)?parseFloat(e):e}return Et(i)?Wr(i,t,n+1):i}const qr={type:"spring",stiffness:500,damping:25,restSpeed:10},Yr={type:"keyframes",duration:.8},Xr={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Kr=(e,{keyframes:t})=>t.length>2?Yr:hr.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:qr:Xr,Qr=e=>null!==e;function Gr(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Zr(e,t){const n=e?.[t]??e?.default??e;return n!==e?Gr(n,e):n}const Jr=(e,t,n,r={},i,a)=>o=>{const s=Zr(r,e)||{},l=s.delay||r.delay||0;let{elapsed:u=0}=r;u-=Xe(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,Kr(e,c)),c.duration&&(c.duration=Xe(c.duration)),c.repeatDelay&&(c.repeatDelay=Xe(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(Vr(c),0===c.delay&&(d=!0)),(Oe.instantAnimations||Oe.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,Vr(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(Qr);return r[t&&"loop"!==n&&t%2==1?0:r.length-1]}(c.keyframes,s);if(void 0!==e)return void gt.update(()=>{c.onUpdate(e),c.onComplete()})}return s.isSync?new tr(c):new Br(c)};function ei(e){const t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function ti(e,t,n,r){if("function"==typeof t){const[i,a]=ei(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]=ei(r);t=t(void 0!==n?n:e.custom,i,a)}return t}function ni(e,t,n){const r=e.getProps();return ti(r,t,void 0!==n?n:r.custom,e)}const ri=new Set(["width","height","top","left","right","bottom",...fr]);class ii{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{const t=kt.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=kt.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 Ye);const n=this.events[e].add(t);return"change"===e?()=>{n(),gt.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=kt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Qe(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 ai(e,t){return new ii(e,t)}const oi=e=>Array.isArray(e);function si(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ai(n))}function li(e){return oi(e)?e[e.length-1]||0:e}const ui=e=>Boolean(e&&e.getVelocity);function ci(e,t){const n=e.getValue("willChange");if(r=n,Boolean(ui(r)&&r.add))return n.add(t);if(!n&&Oe.WillChange){const n=new Oe.WillChange("auto");e.addValue("willChange",n),n.add(t)}var r}function di(e){return e.replace(/([A-Z])/g,e=>\`-\${e.toLowerCase()}\`)}const fi="data-"+di("framerAppearId");function hi(e){return e.props[fi]}function pi({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function mi(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t;const l=e.getDefaultTransition();a=a?Gr(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&&pi(d,f))continue;const i={delay:n,...Zr(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=hi(e);if(t){const e=window.MotionHandoffAnimation(t,f,gt);null!==e&&(i.startTime=e,l=!0)}}ci(e,f);const h=u??e.shouldReduceMotion;t.start(Jr(f,t,r,h&&ri.has(f)?{type:!1}:i,e,l));const p=t.animation;p&&c.push(p)}if(o){const t=()=>gt.update(()=>{o&&function(e,t){const n=ni(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const o in a)si(e,o,li(a[o]))}(e,o)});c.length?Promise.all(c).then(t):t()}return c}function gi(e,t,n={}){const r=ni(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(mi(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(gi(l,t,{...o,delay:n+("function"==typeof r?0:r)+Ur(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 yi=e=>t=>t.test(e),vi=[Nt,Ut,Bt,$t,Wt,Ht,{test:e=>"auto"===e,parse:e=>e}],bi=e=>vi.find(yi(e));function xi(e){return"number"==typeof e?0===e:null===e||("none"===e||"0"===e||$e(e))}const wi=new Set(["brightness","contrast","saturate","opacity"]);function ki(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(At)||[];if(!r)return e;const i=n.replace(r,"");let a=wi.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const Si=/\\b([a-z-]*)\\(.*?\\)/gu,Ci={...rn,getAnimatableNone:e=>{const t=e.match(Si);return t?t.map(ki).join(" "):e}},Ti={...Nt,transform:Math.round},Ei={borderWidth:Ut,borderTopWidth:Ut,borderRightWidth:Ut,borderBottomWidth:Ut,borderLeftWidth:Ut,borderRadius:Ut,borderTopLeftRadius:Ut,borderTopRightRadius:Ut,borderBottomRightRadius:Ut,borderBottomLeftRadius:Ut,width:Ut,maxWidth:Ut,height:Ut,maxHeight:Ut,top:Ut,right:Ut,bottom:Ut,left:Ut,inset:Ut,insetBlock:Ut,insetBlockStart:Ut,insetBlockEnd:Ut,insetInline:Ut,insetInlineStart:Ut,insetInlineEnd:Ut,padding:Ut,paddingTop:Ut,paddingRight:Ut,paddingBottom:Ut,paddingLeft:Ut,paddingBlock:Ut,paddingBlockStart:Ut,paddingBlockEnd:Ut,paddingInline:Ut,paddingInlineStart:Ut,paddingInlineEnd:Ut,margin:Ut,marginTop:Ut,marginRight:Ut,marginBottom:Ut,marginLeft:Ut,marginBlock:Ut,marginBlockStart:Ut,marginBlockEnd:Ut,marginInline:Ut,marginInlineStart:Ut,marginInlineEnd:Ut,fontSize:Ut,backgroundPositionX:Ut,backgroundPositionY:Ut,...{rotate:$t,rotateX:$t,rotateY:$t,rotateZ:$t,scale:Dt,scaleX:Dt,scaleY:Dt,scaleZ:Dt,skew:$t,skewX:$t,skewY:$t,distance:Ut,translateX:Ut,translateY:Ut,translateZ:Ut,x:Ut,y:Ut,z:Ut,perspective:Ut,transformPerspective:Ut,opacity:Mt,originX:qt,originY:qt,originZ:Ut},zIndex:Ti,fillOpacity:Mt,strokeOpacity:Mt,numOctaves:Ti},ji={...Ei,color:Xt,backgroundColor:Xt,outlineColor:Xt,fill:Xt,stroke:Xt,borderColor:Xt,borderTopColor:Xt,borderRightColor:Xt,borderBottomColor:Xt,borderLeftColor:Xt,filter:Ci,WebkitFilter:Ci},Pi=e=>ji[e];function Ni(e,t){let n=Pi(e);return n!==Ci&&(n=rn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Mi=new Set(["auto","none","0"]);class Di extends Cr{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(),Et(n))){const r=Wr(n,t.current);void 0!==r&&(e[s]=r),s===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!ri.has(n)||2!==e.length)return;const[r,i]=e,a=bi(r),o=bi(i);if(Pt(r)!==Pt(i)&&yr[n])this.needsMeasurement=!0;else if(a!==o)if(pr(a)&&pr(o))for(let s=0;s<e.length;s++){const t=e[s];"string"==typeof t&&(e[s]=parseFloat(t))}else yr[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let r=0;r<e.length;r++)(null===e[r]||xi(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)&&Jt(t).values.length&&(r=e[i]),i++}if(r&&n)for(const a of t)e[a]=Ni(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=yr[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]=yr[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 Li=new Set(["opacity","clipPath","filter","transform"]);function Ai(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 _i=(e,t)=>t&&"number"==typeof e?t.transform(e):e;function zi(e){return Ie(e)&&"offsetHeight"in e}const{schedule:Ri}=mt(queueMicrotask,!1),Fi={x:!1,y:!1};function Oi(){return Fi.x||Fi.y}function Vi(e,t){const n=Ai(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Ii(e,t,n={}){const[r,i,a]=Vi(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||Oi())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 $i=(e,t)=>!!t&&(e===t||$i(e,t.parentElement)),Bi=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,Ui=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Hi=new Set(["INPUT","SELECT","TEXTAREA"]);const Wi=new WeakSet;function qi(e){return t=>{"Enter"===t.key&&e(t)}}function Yi(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function Xi(e){return Bi(e)&&!Oi()}const Ki=new WeakSet;function Qi(e,t,n={}){const[r,i,a]=Vi(e,n),o=e=>{const r=e.currentTarget;if(!Xi(e))return;if(Ki.has(e))return;Wi.add(r),n.stopPropagation&&Ki.add(e);const a=t(r,e),o=(e,t)=>{window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",l),Wi.has(r)&&Wi.delete(r),Xi(e)&&"function"==typeof a&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||$i(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),zi(e)&&(e.addEventListener("focus",e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const r=qi(()=>{if(Wi.has(n))return;Yi(n,"down");const e=qi(()=>{Yi(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>Yi(n,"cancel"),t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)})(e,i)),t=e,Ui.has(t.tagName)||!0===t.isContentEditable||e.hasAttribute("tabindex")||(e.tabIndex=0))}),a}function Gi(e){return Ie(e)&&"ownerSVGElement"in e}const Zi=new WeakMap;let Ji;const ea=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+"Size"]:Gi(r)&&"getBBox"in r?r.getBBox()[t]:r[n],ta=ea("inline","width","offsetWidth"),na=ea("block","height","offsetHeight");function ra({target:e,borderBoxSize:t}){Zi.get(e)?.forEach(n=>{n(e,{get width(){return ta(e,t)},get height(){return na(e,t)}})})}function ia(e){e.forEach(ra)}function aa(e,t){Ji||"undefined"!=typeof ResizeObserver&&(Ji=new ResizeObserver(ia));const n=Ai(e);return n.forEach(e=>{let n=Zi.get(e);n||(n=new Set,Zi.set(e,n)),n.add(t),Ji?.observe(e)}),()=>{n.forEach(e=>{const n=Zi.get(e);n?.delete(t),n?.size||Ji?.unobserve(e)})}}const oa=new Set;let sa;function la(e){return oa.add(e),sa||(sa=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};oa.forEach(t=>t(e))},window.addEventListener("resize",sa)),()=>{oa.delete(e),oa.size||"function"!=typeof sa||(window.removeEventListener("resize",sa),sa=void 0)}}function ua(e,t){return"function"==typeof e?la(e):aa(e,t)}const ca=[...vi,Xt,rn],da=()=>({x:{min:0,max:0},y:{min:0,max:0}}),fa=new WeakMap;function ha(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function pa(e){return"string"==typeof e||Array.isArray(e)}const ma=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ga=["initial",...ma];function ya(e){return ha(e.animate)||ga.some(t=>pa(e[t]))}function va(e){return Boolean(ya(e)||e.variants)}const ba={current:null},xa={current:!1},wa="undefined"!=typeof window;const ka=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Sa={};function Ca(e){Sa=e}class Ta{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=Cr,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=kt.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,gt.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=ya(t),this.isVariantNode=va(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]&&ui(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,fa.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:(xa.current||function(){if(xa.current=!0,wa)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ba.current=e.matches;e.addEventListener("change",t),t()}else ba.current=!1}(),this.shouldReduceMotion=ba.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(),yt(this.notifyUpdate),yt(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&&Li.has(e)&&this.current instanceof HTMLElement){const{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new _r({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Xe(o)}),l=n(s);return void this.valueSubscriptions.set(e,()=>{l(),s.cancel()})}const n=hr.has(e);n&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&>.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 Sa){const t=Sa[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<ka.length;n++){const t=ka[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(ui(i))e.addValue(r,i);else if(ui(a))e.addValue(r,ai(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,ai(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=ai(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&&(Ve(n)||$e(n))?n=parseFloat(n):(r=n,!ca.find(yi(r))&&rn.test(t)&&(n=Ni(e,t))),this.setBaseTarget(e,ui(n)?n.get():n)),ui(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=ti(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||ui(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 Ye),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Ri.render(this.render)}}class Ea extends Ta{constructor(){super(...arguments),this.KeyframeResolver=Di}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;ui(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=\`\${e}\`)}))}}class ja{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Pa({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Na(e){return void 0===e||1===e}function Ma({scale:e,scaleX:t,scaleY:n}){return!Na(e)||!Na(t)||!Na(n)}function Da(e){return Ma(e)||La(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function La(e){return Aa(e.x)||Aa(e.y)}function Aa(e){return e&&"0%"!==e}function _a(e,t,n){return n+t*(e-n)}function za(e,t,n,r,i){return void 0!==i&&(e=_a(e,i,r)),_a(e,n,r)+t}function Ra(e,t=0,n=1,r,i){e.min=za(e.min,t,n,r,i),e.max=za(e.max,t,n,r,i)}function Fa(e,{x:t,y:n}){Ra(e.x,t.translate,t.scale,t.originPoint),Ra(e.y,n.translate,n.scale,n.originPoint)}const Oa=.999999999999,Va=1.0000000000001;function Ia(e,t){e.min=e.min+t,e.max=e.max+t}function $a(e,t,n,r,i=.5){Ra(e,t,n,sn(e.min,e.max,i),r)}function Ba(e,t){$a(e.x,t.x,t.scaleX,t.scale,t.originX),$a(e.y,t.y,t.scaleY,t.scale,t.originY)}function Ua(e,t){return Pa(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 Ha={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Wa=fr.length;function qa(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(hr.has(l))o=!0;else if(Ct(l))i[l]=e;else{const t=_i(e,Ei[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<Wa;a++){const o=fr[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=_i(s,Ei[o]);l||(i=!1,r+=\`\${Ha[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 Ya(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 Xa(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ka={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!Ut.test(e))return e;e=parseFloat(e)}return\`\${Xa(e,t.target.x)}% \${Xa(e,t.target.y)}%\`}},Qa={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=rn.parse(e);if(i.length>5)return r;const a=rn.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=sn(s,l,.5);return"number"==typeof i[2+o]&&(i[2+o]/=u),"number"==typeof i[3+o]&&(i[3+o]/=u),a(i)}},Ga={borderRadius:{...Ka,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ka,borderTopRightRadius:Ka,borderBottomLeftRadius:Ka,borderBottomRightRadius:Ka,boxShadow:Qa};function Za(e,{layout:t,layoutId:n}){return hr.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!Ga[e]||"opacity"===e)}function Ja(e,t,n){const r=e.style,i=t?.style,a={};if(!r)return a;for(const o in r)(ui(r[o])||i&&ui(i[o])||Za(o,e)||void 0!==n?.getValue(o)?.liveStyle)&&(a[o]=r[o]);return a}class eo extends Ea{constructor(){super(...arguments),this.type="html",this.renderInstance=Ya}readValueFromInstance(e,t){if(hr.has(t))return this.projection?.isProjecting?ur(t):((e,t)=>{const{transform:n="none"}=getComputedStyle(e);return cr(n,t)})(e,t);{const r=(n=e,window.getComputedStyle(n)),i=(Ct(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return Ua(e,t)}build(e,t,n){qa(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Ja(e,t,n)}}const to={offset:"stroke-dashoffset",array:"stroke-dasharray"},no={offset:"strokeDashoffset",array:"strokeDasharray"};const ro=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function io(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},l,u,c){if(qa(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 ro)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?to:no;e[a.offset]=""+-r,e[a.array]=\`\${t} \${n}\`}(d,i,a,o,!1)}const ao=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"]),oo=e=>"string"==typeof e&&"svg"===e.toLowerCase();function so(e,t,n){const r=Ja(e,t,n);for(const i in e)if(ui(e[i])||ui(t[i])){r[-1!==fr.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=e[i]}return r}class lo extends Ea{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=da}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(hr.has(t)){const e=Pi(t);return e&&e.default||0}return t=ao.has(t)?t:di(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return so(e,t,n)}build(e,t,n){io(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){!function(e,t,n,r){Ya(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(ao.has(i)?i:di(i),t.attrs[i])}(e,t,0,r)}mount(e){this.isSVGTag=oo(e.tagName),super.mount(e)}}const uo=ga.length;function co(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&co(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<uo;n++){const r=ga[n],i=e.props[r];(pa(i)||!1===i)&&(t[r]=i)}return t}function fo(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 ho=[...ma].reverse(),po=ma.length;function mo(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=>gi(e,t,n));r=Promise.all(i)}else if("string"==typeof t)r=gi(e,t,n);else{const i="function"==typeof t?ni(e,t,n.custom):t;r=Promise.all(mi(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}(e,t,n)))}function go(e){let t=mo(e),n=bo(),r=!0;const i=t=>(n,r)=>{const i=ni(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=co(e.parent)||{},l=[],u=new Set;let c={},d=1/0;for(let t=0;t<po;t++){const f=ho[t],h=n[f],p=void 0!==o[f]?o[f]:s[f],m=pa(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||ha(p)||"boolean"==typeof p)continue;if("exit"===f&&h.isActive&&!0!==g){h.prevResolvedValues&&(c={...c,...h.prevResolvedValues});continue}const v=yo(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,C={...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 C){const t=k[e],n=S[e];if(c.hasOwnProperty(e))continue;let r=!1;r=oi(t)&&oi(n)?!fo(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 E=y&&v;b&&(!E||x)&&l.push(...w.map(t=>{const n={type:f};if("string"==typeof t&&r&&!E&&e.manuallyAnimateOnMount&&e.parent){const{parent:r}=e,i=ni(r,t);if(r.enteringChildren&&i){const{delayChildren:t}=i.transition||{};n.delay=Ur(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){const t={};if("boolean"!=typeof o.initial){const n=ni(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=bo()}}}function yo(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!fo(t,e)}function vo(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function bo(){return{animate:vo(!0),whileInView:vo(),whileHover:vo(),whileTap:vo(),whileDrag:vo(),whileFocus:vo(),exit:vo()}}function xo(e,t){e.min=t.min,e.max=t.max}function wo(e,t){xo(e.x,t.x),xo(e.y,t.y)}function ko(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 Co(e,t,n,r=.5){e.origin=r,e.originPoint=sn(t.min,t.max,e.origin),e.scale=So(n)/So(t),e.translate=sn(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 To(e,t,n,r){Co(e.x,t.x,n.x,r?r.originX:void 0),Co(e.y,t.y,n.y,r?r.originY:void 0)}function Eo(e,t,n){e.min=n.min+t.min,e.max=e.min+So(t)}function jo(e,t,n){e.min=t.min-n.min,e.max=e.min+So(t)}function Po(e,t,n){jo(e.x,t.x,n.x),jo(e.y,t.y,n.y)}function No(e,t,n,r,i){return e=_a(e-=t,1/n,r),void 0!==i&&(e=_a(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){Bt.test(t)&&(t=parseFloat(t),t=sn(o.min,o.max,t/100)-o.min);if("number"!=typeof t)return;let s=sn(a.min,a.max,r);e===a&&(s-=t),e.min=No(e.min,t,n,s,i),e.max=No(e.max,t,n,s,i)}(e,t[n],t[r],t[i],t.scale,a,o)}const Do=["x","scaleX","originX"],Lo=["y","scaleY","originY"];function Ao(e,t,n,r){Mo(e.x,t,Do,n?n.x:void 0,r?r.x:void 0),Mo(e.y,t,Lo,n?n.y:void 0,r?r.y:void 0)}function _o(e){return 0===e.translate&&1===e.scale}function zo(e){return _o(e.x)&&_o(e.y)}function Ro(e,t){return e.min===t.min&&e.max===t.max}function Fo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Oo(e,t){return Fo(e.x,t.x)&&Fo(e.y,t.y)}function Vo(e){return So(e.x)/So(e.y)}function Io(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function $o(e){return[e("x"),e("y")]}const Bo=["TopLeft","TopRight","BottomLeft","BottomRight"],Uo=Bo.length,Ho=e=>"string"==typeof e?parseFloat(e):e,Wo=e=>"number"==typeof e||Ut.test(e);function qo(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Yo=Ko(0,.5,ot),Xo=Ko(.5,.95,Ue);function Ko(e,t,n){return r=>r<e?0:r>t?1:n(qe(e,t,r))}function Qo(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const Go=(e,t)=>e.depth-t.depth;class Zo{constructor(){this.children=[],this.isDirty=!1}add(e){ze(this.children,e),this.isDirty=!0}remove(e){Re(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Go),this.isDirty=!1,this.children.forEach(e)}}function Jo(e){return ui(e)?e.get():e}class es{constructor(){this.members=[]}add(e){ze(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&&Re(this.members,n)}e.scheduleRender()}remove(e){if(Re(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 ts={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ns=["","X","Y","Z"];let rs=0;function is(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function as(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=hi(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",gt,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&as(r)}function os({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=rs++,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(us),this.nodes.forEach(gs),this.nodes.forEach(ys),this.nodes.forEach(cs)},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 Zo)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Ye),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=Gi(t)&&!(Gi(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;gt.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=kt.now(),r=({timestamp:i})=>{const a=i-n;a>=t&&(yt(r),e(a-t))};return gt.setup(r,!0),()=>yt(r)}(i,250),ts.hasAnimatedSinceResize&&(ts.hasAnimatedSinceResize=!1,this.nodes.forEach(ms)))})}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()||Ss,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=a.getProps(),l=!this.targetLayout||!Oo(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={...Zr(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||ms(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(),yt(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(vs),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&&as(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(fs);if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(hs);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ps),this.nodes.forEach(ss),this.nodes.forEach(ls)):this.nodes.forEach(hs),this.clearAllSnapshots();const e=kt.now();vt.delta=Fe(0,1e3/60,e-vt.timestamp),vt.timestamp=e,vt.isProcessing=!0,bt.update.process(vt),bt.preRender.process(vt),bt.render.process(vt),vt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ri.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ds),this.sharedNodes.forEach(bs)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,gt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){gt.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&&!zo(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Da(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)),Es((r=n).x),Es(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(Ps))){const{scroll:e}=this.root;e&&(Ia(t.x,e.offset.x),Ia(t.y,e.offset.y))}return t}removeElementScroll(e){const t={x:{min:0,max:0},y:{min:0,max:0}};if(wo(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&&wo(t,e),Ia(t.x,i.offset.x),Ia(t.y,i.offset.y))}return t}applyTransform(e,t=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};wo(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&&Ba(n,{x:-e.scroll.offset.x,y:-e.scroll.offset.y}),Da(e.latestValues)&&Ba(n,e.latestValues)}return Da(this.latestValues)&&Ba(n,this.latestValues),n}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};wo(t,e);for(let n=0;n<this.path.length;n++){const e=this.path[n];if(!e.instance)continue;if(!Da(e.latestValues))continue;Ma(e.latestValues)&&e.updateSnapshot();const r=da();wo(r,e.measurePageBox()),Ao(t,e.latestValues,e.snapshot?e.snapshot.layoutBox:void 0,r)}return Da(this.latestValues)&&Ao(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!==vt.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=vt.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,Eo(o.x,s.x,l.x),Eo(o.y,s.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):wo(this.target,this.layout.layoutBox),Fa(this.target,this.targetDelta)):wo(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)&&!La(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}},Po(this.relativeTargetOrigin,t,n),wo(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===vt.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;wo(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&&Ba(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Fa(e,o)),r&&Da(a.latestValues)&&Ba(e,a.latestValues))}t.x<Va&&t.x>Oa&&(t.x=1),t.y<Va&&t.y>Oa&&(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?(ko(this.prevProjectionDelta.x,this.projectionDelta.x),ko(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),To(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===a&&this.treeScale.y===o&&Io(this.projectionDelta.x,this.prevProjectionDelta.x)&&Io(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(ks));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,f,h,p,m,g;xs(a.x,e.x,n),xs(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Po(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),h=this.relativeTarget,p=this.relativeTargetOrigin,m=o,g=n,ws(h.x,p.x,m.x,g),ws(h.y,p.y,m.y,g),d&&(l=this.relativeTarget,f=d,Ro(l.x,f.x)&&Ro(l.y,f.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),wo(d,this.relativeTarget)),s&&(this.animationValues=i,function(e,t,n,r,i,a){i?(e.opacity=sn(0,n.opacity??1,Yo(r)),e.opacityExit=sn(t.opacity??1,0,Xo(r))):a&&(e.opacity=sn(t.opacity??1,n.opacity??1,r));for(let o=0;o<Uo;o++){const i=\`border\${Bo[o]}Radius\`;let a=qo(t,i),s=qo(n,i);void 0===a&&void 0===s||(a||(a=0),s||(s=0),0===a||0===s||Wo(a)===Wo(s)?(e[i]=Math.max(sn(Ho(a),Ho(s),r),0),(Bt.test(s)||Bt.test(a))&&(e[i]+="%")):e[i]=s)}(t.rotate||n.rotate)&&(e.rotate=sn(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&&(yt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=gt.update(()=>{ts.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ai(0)),this.currentAnimation=function(e,t,n){const r=ui(e)?e:ai(e);return r.start(Jr("",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&&js(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}wo(t,n),Ba(t,i),To(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new es);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&&is("z",e,r,this.animationValues);for(let i=0;i<ns.length;i++)is(\`rotate\${ns[i]}\`,e,r,this.animationValues),is(\`skew\${ns[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=Jo(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=Jo(t?.pointerEvents)||""),void(this.hasProjected&&!Da(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 Ga){if(void 0===i[l])continue;const{correct:t,applyTo:n,isCSSVariable:o}=Ga[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?Jo(t?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(fs),this.root.sharedNodes.clear()}}}function ss(e){e.updateLayout()}function ls(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?$o(e=>{const r=a?t.measuredBox[e]:t.layoutBox[e],i=So(r);r.min=n[e].min,r.max=r.min+i}):js(i,t.layoutBox,n)&&$o(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}};To(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?To(s,e.applyTransform(r,!0),t.measuredBox):To(s,n,t.layoutBox);const l=!zo(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}};Po(o,t.layoutBox,i.layoutBox);const s={x:{min:0,max:0},y:{min:0,max:0}};Po(s,n,a.layoutBox),Oo(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 us(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 cs(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ds(e){e.clearSnapshot()}function fs(e){e.clearMeasurements()}function hs(e){e.isLayoutDirty=!1}function ps(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ms(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function gs(e){e.resolveTargetDelta()}function ys(e){e.calcProjection()}function vs(e){e.resetSkewAndRotation()}function bs(e){e.removeLeadSnapshot()}function xs(e,t,n){e.translate=sn(t.translate,0,n),e.scale=sn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ws(e,t,n,r){e.min=sn(t.min,n.min,r),e.max=sn(t.max,n.max,r)}function ks(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const Ss={duration:.45,ease:[.4,0,.1,1]},Cs=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ts=Cs("applewebkit/")&&!Cs("chrome/")?Math.round:Ue;function Es(e){e.min=Ts(e.min),e.max=Ts(e.max)}function js(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=Vo(t),i=Vo(n),a=.2,!(Math.abs(r-i)<=a));var r,i,a}function Ps(e){return e!==e.root&&e.scroll?.wasRoot}const Ns=os({attachResizeListener:(e,t)=>Qo(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},Ds=os({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ms.current){const e=new Ns({});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)}),Ls=f.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function As(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function _s(...e){return f.useCallback(function(...e){return t=>{let n=!1;const r=e.map(e=>{const r=As(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():As(e[t],null)}}}}(...e),e)}class zs 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=zi(e)&&e.offsetWidth||0,r=zi(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 Rs({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(Ls),d=e.props?.ref??e?.ref,h=_s(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(zs,{isPresent:t,childRef:l,sizeRef:u,pop:a,children:!1===a?e:f.cloneElement(e,{ref:h})})}const Fs=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:l,anchorY:u,root:c})=>{const d=De(Os),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(Rs,{pop:"popLayout"===o,isPresent:n,anchorX:l,anchorY:u,root:c,children:e}),s.jsx(_e.Provider,{value:m,children:e})};function Os(){return new Map}function Vs(e=!0){const t=f.useContext(_e);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 Is=e=>e.key||"";function $s(e){const t=[];return f.Children.forEach(e,e=>{f.isValidElement(e)&&t.push(e)}),t}const Bs=({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]=Vs(o),p=f.useMemo(()=>$s(e),[e]),m=o&&!d?[]:p.map(Is),g=f.useRef(!0),y=f.useRef(p),v=De(()=>new Map),b=f.useRef(new Set),[x,w]=f.useState(p),[k,S]=f.useState(p);Ae(()=>{g.current=!1,y.current=p;for(let e=0;e<k.length;e++){const t=Is(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 C=[];if(p!==x){let e=[...p];for(let t=0;t<k.length;t++){const n=k[t],r=Is(n);m.includes(r)||(e.splice(t,0,n),C.push(n))}return"wait"===a&&C.length&&(e=C),S($s(e)),w(p),null}const{forceRender:T}=f.useContext(Me);return s.jsx(s.Fragment,{children:k.map(e=>{const f=Is(e),x=!(o&&!d)&&(p===k||m.includes(f));return s.jsx(Fs,{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)})})},Us=f.createContext({strict:!1}),Hs={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 Ws=!1;function qs(){return function(){if(Ws)return;const e={};for(const t in Hs)e[t]={isEnabled:e=>Hs[t].some(t=>!!e[t])};Ca(e),Ws=!0}(),Sa}const Ys=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 Xs(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Ys.has(e)}let Ks=e=>!Xs(e);try{"function"==typeof(Qs=require("@emotion/is-prop-valid").default)&&(Ks=e=>e.startsWith("on")?!Xs(e):Qs(e))}catch{}var Qs;const Gs=f.createContext({});function Zs(e){const{initial:t,animate:n}=function(e,t){if(ya(e)){const{initial:t,animate:n}=e;return{initial:!1===t||pa(t)?t:void 0,animate:pa(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,f.useContext(Gs));return f.useMemo(()=>({initial:t,animate:n}),[Js(t),Js(n)])}function Js(e){return Array.isArray(e)?e.join(" "):e}const el=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function tl(e,t,n){for(const r in t)ui(t[r])||Za(r,n)||(e[r]=t[r])}function nl(e,t){const n={};return tl(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return f.useMemo(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return qa(n,t,e),Object.assign({},n.vars,n.style)},[t])}(e,t)),n}function rl(e,t){const n={},r=nl(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 il=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function al(e,t,n,r){const i=f.useMemo(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return io(n,t,oo(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){const t={};tl(t,e.style,e),i.style={...t,...i.style}}return i}const ol=["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 sl(e){return"string"==typeof e&&!e.includes("-")&&!!(ol.indexOf(e)>-1||/[A-Z]/u.test(e))}function ll(e,t,n,{latestValues:r},i,a=!1,o){const s=(o??sl(e)?al:rl)(t,r,i,e),l=function(e,t,n){const r={};for(const i in e)"values"===i&&"object"==typeof e.values||(Ks(i)||!0===n&&Xs(i)||!t&&!Xs(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(()=>ui(c)?c.get():c,[c]);return f.createElement(e,{...u,children:d})}function ul(e,t,n,r){const i={},a=r(e,{});for(const f in a)i[f]=Jo(a[f]);let{initial:o,animate:s}=e;const l=ya(e),u=va(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&&!ha(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){const r=ti(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 cl=e=>(t,n)=>{const r=f.useContext(Gs),i=f.useContext(_e),a=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:ul(n,r,i,e),renderState:t()}}(e,t,r,i);return n?a():De(a)},dl=cl({scrapeMotionValuesFromProps:Ja,createRenderState:el}),fl=cl({scrapeMotionValuesFromProps:so,createRenderState:il}),hl=Symbol.for("motionComponentSymbol");function pl(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 ml=f.createContext({});function gl(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function yl(e,t,n,r,i,a){const{visualElement:o}=f.useContext(Gs),s=f.useContext(Us),l=f.useContext(_e),u=f.useContext(Ls),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(ml);!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:vl(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:Boolean(o)||s&&gl(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[fi],b=f.useRef(Boolean(v)&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return Ae(()=>{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 vl(e){if(e)return!1!==e.options.allowProjection?e.projection:vl(e.parent)}function bl(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&function(e){const t=qs();for(const n in e)t[n]={...t[n],...e[n]};Ca(t)}(r);const a=n?"svg"===n:sl(e),o=a?fl:dl;function l(n,r){let l;const u={...f.useContext(Ls),...n,layoutId:xl(n)},{isStatic:c}=u,d=Zs(n),h=o(n,c);if(!c&&Le){f.useContext(Us).strict;const t=function(e){const t=qs(),{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=yl(e,h,u,i,t.ProjectionNode,a)}return s.jsxs(Gs.Provider,{value:d,children:[l&&d.visualElement?s.jsx(l,{visualElement:d.visualElement,...u}):null,ll(e,n,pl(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[hl]=e,u}function xl({layoutId:e}){const t=f.useContext(Me).id;return t&&void 0!==e?t+"-"+e:e}function wl(e,t){if("undefined"==typeof Proxy)return bl;const n=new Map,r=(n,r)=>bl(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>"create"===a?r:(n.has(a)||n.set(a,bl(a,void 0,e,t)),n.get(a))})}const kl=(e,t)=>t.isSVG??sl(e)?new lo(t):new eo(t,{allowProjection:e!==f.Fragment});let Sl=0;const Cl={animation:{Feature:class extends ja{constructor(e){super(e),e.animationState||(e.animationState=go(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();ha(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 ja{constructor(){super(...arguments),this.id=Sl++}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 Tl(e){return{point:{x:e.pageX,y:e.pageY}}}function El(e,t,n,r){return Qo(e,t,(e=>t=>Bi(t)&&e(t,Tl(t)))(n),r)}const jl=({current:e})=>e?e.ownerDocument.defaultView:null,Pl=(e,t)=>Math.abs(e-t);const Nl=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=Al(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=Pl(e.x,t.x),r=Pl(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}=vt;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=Dl(t,this.transformPagePoint),gt.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=Al("pointercancel"===e.type?this.lastMoveEventInfo:Dl(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Bi(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;const s=Dl(Tl(e),this.transformPagePoint),{point:l}=s,{timestamp:u}=vt;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=t;c&&c(e,Al(s,this.history)),this.removeListeners=We(El(this.contextWindow,"pointermove",this.handlePointerMove),El(this.contextWindow,"pointerup",this.handlePointerUp),El(this.contextWindow,"pointercancel",this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){const e=getComputedStyle(t);(Nl.has(e.overflowX)||Nl.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),gt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),yt(this.updatePoint)}}function Dl(e,t){return t?{point:t(e.point)}:e}function Ll(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Al({point:e},t){return{point:e,delta:Ll(e,zl(t)),offset:Ll(e,_l(t)),velocity:Rl(t,.1)}}function _l(e){return e[0]}function zl(e){return e[e.length-1]}function Rl(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=zl(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Xe(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>2*Xe(t)&&(r=e[1]);const a=Ke(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 Fl(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 Ol(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 Vl=.35;function Il(e,t,n){return{min:$l(e,t),max:$l(e,n)}}function $l(e,t){return"number"==typeof e?e:e[t]||0}const Bl=new WeakMap;class Ul{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(Tl(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?Fi[a]?null:(Fi[a]=!0,()=>{Fi[a]=!1}):Fi.x||Fi.y?null:(Fi.x=Fi.y=!0,()=>{Fi.x=Fi.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),$o(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Bt.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&>.update(()=>i(e,t),!1,!0),ci(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&>.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:jl(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&>.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||!Wl(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?sn(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?sn(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&&gl(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!n)&&function(e,{top:t,left:n,bottom:r,right:i}){return{x:Fl(e.x,n,i),y:Fl(e.y,t,r)}}(n.layoutBox,e),this.elastic=function(e=Vl){return!1===e?e=0:!0===e&&(e=Vl),{x:Il(e,"left","right"),y:Il(e,"top","bottom")}}(t),r!==this.constraints&&!gl(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&$o(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||!gl(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=Ua(e,n),{scroll:i}=t;return i&&(Ia(r.x,i.offset.x),Ia(r.y,i.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let a=function(e,t){return{x:Ol(e.x,t.x),y:Ol(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=Pa(e))}return a}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},l=$o(o=>{if(!Wl(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 ci(this.visualElement,e),n.start(Jr(e,n,0,t,this.visualElement,!1))}stopAnimation(){$o(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){$o(t=>{const{drag:n}=this.getProps();if(!Wl(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]-sn(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!gl(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};$o(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=qe(t.min,t.max-r,e.min):r>i&&(n=qe(e.min,e.max-i,t.min)),Fe(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(),$o(t=>{if(!Wl(t,e,null))return;const n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(sn(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Bl.set(this.visualElement,this);const e=this.visualElement.current,t=El(e,"pointerdown",t=>{const{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&function(e){return Hi.has(e.tagName)||!0===e.isContentEditable}(i);n&&r&&!a&&this.start(t)});let n;const r=()=>{const{dragConstraints:t}=this.getProps();gl(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(e,t,n){const r=ua(e,Hl(n)),i=ua(t,Hl(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()),gt.read(r);const o=Qo(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&($o(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=Vl,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}}function Hl(e){let t=!0;return()=>{t?t=!1:e()}}function Wl(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const ql=e=>(t,n)=>{e&>.update(()=>e(t,n),!1,!0)};let Yl=!1;class Xl 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),Yl&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ts.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}),Yl=!0,r||e.layoutDependency!==t||void 0===t||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||gt.postRender(()=>{const e=a.getStack();e&&e.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Ri.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Yl=!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 Kl(e){const[t,n]=Vs(),r=f.useContext(Me);return s.jsx(Xl,{...e,layoutGroup:r,switchLayoutGroup:f.useContext(ml),isPresent:t,safeToRemove:n})}const Ql={pan:{Feature:class extends ja{constructor(){super(...arguments),this.removePointerDownListener=Ue}onPointerDown(e){this.session=new Ml(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:jl(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:ql(e),onStart:ql(t),onMove:ql(n),onEnd:(e,t)=>{delete this.session,r&>.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=El(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 ja{constructor(e){super(e),this.removeGroupControls=Ue,this.removeListeners=Ue,this.controls=new Ul(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ue}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:Ds,MeasureLayout:Kl}};function Gl(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);const i=r["onHover"+n];i&>.postRender(()=>i(t,Tl(t)))}function Zl(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&>.postRender(()=>i(t,Tl(t)))}const Jl=new WeakMap,eu=new WeakMap,tu=e=>{const t=Jl.get(e.target);t&&t(e)},nu=e=>{e.forEach(tu)};function ru(e,t,n){const r=function({root:e,...t}){const n=e||document;eu.has(n)||eu.set(n,{});const r=eu.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(nu,{root:e,...t})),r[i]}(t);return Jl.set(e,n),r.observe(e),()=>{Jl.delete(e),r.unobserve(e)}}const iu={some:0,all:1};const au=wl({...Cl,...{inView:{Feature:class extends ja{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:iu[r]};return ru(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 ja{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Qi(e,(e,t)=>(Zl(this.node,t,"Start"),(e,{success:t})=>Zl(this.node,e,t?"End":"Cancel")),{useGlobalTarget:t,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends ja{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=We(Qo(this.node.current,"focus",()=>this.onFocus()),Qo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ja{mount(){const{current:e}=this.node;e&&(this.unmount=Ii(e,(e,t)=>(Gl(this.node,t,"Start"),e=>Gl(this.node,e,"End"))))}unmount(){}}}},...Ql,...{layout:{ProjectionNode:Ds,MeasureLayout:Kl}}},kl);function ou({label:e,value:t,suffix:n,decimals:r=0,icon:i,delay:a=0,variant:o="default",clickable:l=!1,selected:u=!1,onClick:c}){const d=f.useRef(null),h=f.useRef(0);f.useEffect(()=>{d.current&&t!==h.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)})}(d.current,t,r),h.current=t)},[t,r]);const p="accent"===o;return s.jsxs(au.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{delay:a},onClick:l&&t>0?c:void 0,className:\`px-3 py-2 rounded-lg border flex items-center gap-2.5 group transition-all duration-300 \${p?"shrink-0 bg-bg-surface-1 border-border/50 hover:border-accent/30":"flex-1 min-w-[120px] bg-bg-surface-1 border-border/50 hover:border-accent/30"} \${l&&t>0?"cursor-pointer":""} \${u?"border-accent/50 bg-accent/5":""}\`,children:[s.jsx("div",{className:"p-1.5 rounded-md transition-colors "+(u?"bg-accent/15":"bg-bg-surface-2 group-hover:bg-accent/10"),children:s.jsx(i,{className:"w-3.5 h-3.5 transition-colors "+(u?"text-accent":"text-text-muted group-hover:text-accent")})}),s.jsxs("div",{className:"flex flex-col min-w-0",children:[s.jsxs("div",{className:"flex items-baseline gap-0.5",children:[s.jsx("span",{ref:d,className:"text-lg font-bold text-text-primary tracking-tight leading-none",children:r>0?t.toFixed(r):t}),n&&s.jsx("span",{className:"text-[10px] text-text-muted font-medium",children:n})]}),s.jsx("span",{className:"text-[9px] font-mono text-text-muted uppercase tracking-wider leading-none mt-0.5",children:e})]})]})}function su({totalHours:e,featuresShipped:t,bugsFixed:n,complexSolved:r,currentStreak:i,filesTouched:a,selectedCard:o,onCardClick:l}){const u=e=>{l?.(o===e?null:e)};return s.jsxs("div",{className:"flex gap-2 mb-4",children:[s.jsxs("div",{className:"grid grid-cols-3 lg:grid-cols-5 gap-2 flex-1",children:[s.jsx(ou,{label:"Active Hours",value:e,suffix:"hrs",decimals:1,icon:ee,delay:.1}),s.jsx(ou,{label:"Features",value:t,icon:pe,delay:.15,clickable:!0,selected:"features"===o,onClick:()=>u("features")}),s.jsx(ou,{label:"Bugs Fixed",value:n,icon:X,delay:.2,clickable:!0,selected:"bugs"===o,onClick:()=>u("bugs")}),s.jsx(ou,{label:"Complex",value:r,icon:Y,delay:.25,clickable:!0,selected:"complex"===o,onClick:()=>u("complex")}),s.jsx(ou,{label:"Files",value:a,icon:ie,delay:.3})]}),s.jsx("div",{className:"w-px bg-border/30 self-stretch my-1"}),s.jsx(ou,{label:"Streak",value:i,suffix:"days",icon:Te,delay:.35,variant:"accent"})]})}const lu={"claude-code":"#d4a04a",cursor:"#00b4d8",copilot:"#6e40c9",windsurf:"#38bdf8","github-copilot":"#6e40c9",aider:"#4ade80",continue:"#f97316",cody:"#ff6b6b",tabby:"#a78bfa",roo:"#f472b6",gemini:"#4285f4"},uu={"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:"Gemini"},cu={"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:"Ge"},du={"claude-code":\`data:image/svg+xml,\${encodeURIComponent('<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"/></svg>')}\`,gemini:\`data:image/svg+xml,\${encodeURIComponent('<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"/></svg>')}\`},fu=Object.keys(lu);function hu(e){if(lu[e])return e;return fu.filter(t=>e.startsWith(t)).sort((e,t)=>t.length-e.length)[0]??e}const pu={feature:"#4ade80",bugfix:"#f87171",refactor:"#a78bfa",test:"#38bdf8",docs:"#fbbf24",setup:"#6b655c",deployment:"#f97316",other:"#9c9588"},mu={features:{title:"Features Shipped",icon:pe,filter:e=>"feature"===e.category,emptyText:"No features shipped in this time window.",accentColor:"#4ade80"},bugs:{title:"Bugs Fixed",icon:X,filter:e=>"bugfix"===e.category,emptyText:"No bugs fixed in this time window.",accentColor:"#f87171"},complex:{title:"Complex Tasks",icon:Y,filter:e=>"complex"===e.complexity,emptyText:"No complex tasks in this time window.",accentColor:"#a78bfa"}},gu={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 yu(e){const t=new Date(e),n=(new Date).getTime()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return"just now";if(r<60)return\`\${r}m ago\`;const i=Math.floor(r/60);if(i<24)return\`\${i}h ago\`;const a=Math.floor(i/24);return 1===a?"yesterday":a<7?\`\${a}d ago\`:t.toLocaleDateString([],{month:"short",day:"numeric"})}function vu({type:e,milestones:t,showPublic:n=!1,onClose:r}){if(f.useEffect(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[e]),!e)return null;const i=mu[e],a=i.icon,o=t.filter(i.filter).sort((e,t)=>new Date(t.created_at).getTime()-new Date(e.created_at).getTime()),l=new Map;for(const s of o){const e=new Date(s.created_at).toLocaleDateString([],{weekday:"short",month:"short",day:"numeric"}),t=l.get(e);t?t.push(s):l.set(e,[s])}return s.jsx(Bs,{children:e&&s.jsxs(s.Fragment,{children:[s.jsx(au.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 bg-black/40 backdrop-blur-sm z-40",onClick:r}),s.jsxs(au.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:30,stiffness:300},className:"fixed top-0 right-0 h-full w-full max-w-md bg-bg-base border-l border-border/50 z-50 flex flex-col shadow-2xl",children:[s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border/50",children:[s.jsx("div",{className:"p-2 rounded-lg",style:{backgroundColor:\`\${i.accentColor}15\`},children:s.jsx(a,{className:"w-4 h-4",style:{color:i.accentColor}})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h2",{className:"text-sm font-bold text-text-primary",children:i.title}),s.jsxs("span",{className:"text-[10px] font-mono text-text-muted",children:[o.length," ",1===o.length?"item":"items"," in window"]})]}),s.jsx("button",{onClick:r,className:"p-1.5 rounded-md hover:bg-bg-surface-2 text-text-muted hover:text-text-primary transition-colors",children:s.jsx(Ce,{className:"w-4 h-4"})})]}),s.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain px-5 py-4",children:0===o.length?s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[s.jsx(ve,{className:"w-8 h-8 text-text-muted/30 mb-3"}),s.jsx("p",{className:"text-sm text-text-muted",children:i.emptyText})]}):s.jsx("div",{className:"space-y-5",children:[...l.entries()].map(([t,r])=>s.jsxs("div",{children:[s.jsx("div",{className:"text-[10px] font-mono text-text-muted uppercase tracking-wider mb-2 px-1",children:t}),s.jsx("div",{className:"space-y-1",children:r.map((t,r)=>{const i=pu[t.category]??"#9c9588",a=gu[t.category]??"bg-bg-surface-2 text-text-secondary border-border",o=cu[t.client]??t.client.slice(0,2).toUpperCase(),l=lu[t.client]??"#91919a",u=n?t.title:t.private_title||t.title,c="complex"===t.complexity;return s.jsxs(au.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,delay:.03*r},className:"flex items-start gap-2.5 py-2 px-2 rounded-lg hover:bg-bg-surface-1 transition-colors group",children:[s.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0 mt-1.5",style:{backgroundColor:i}}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm text-text-secondary group-hover:text-text-primary transition-colors leading-snug",children:u}),s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:["complex"===e&&s.jsx("span",{className:\`text-[8px] uppercase tracking-wider font-bold px-1.5 py-0.5 rounded-full border \${a}\`,children:t.category}),c&&"complex"!==e&&s.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] uppercase tracking-wider font-bold px-1.5 py-0.5 rounded-full border bg-purple/10 text-purple border-purple/20",children:[s.jsx(Y,{className:"w-2 h-2"}),"complex"]}),s.jsx("span",{className:"text-[10px] text-text-muted font-mono",children:yu(t.created_at)}),t.languages.length>0&&s.jsx("span",{className:"text-[9px] text-text-muted font-mono",children:t.languages.join(", ")}),s.jsx("div",{className:"w-4 h-4 rounded flex items-center justify-center text-[7px] font-bold font-mono flex-shrink-0 ml-auto",style:{backgroundColor:\`\${l}15\`,color:l,border:\`1px solid \${l}20\`},children:o})]})]})]},t.id)})})]},t))})})]})]})})}function bu(e){const t=e/3600;return t<.1?\`\${t.toFixed(2)}h\`:\`\${t.toFixed(1)}h\`}function xu(e,t){return Object.entries(e).sort((e,t)=>t[1]-e[1]).slice(0,t)}function wu({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 ku({stats:e}){const t=xu(e.byClient,4),n=xu(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(wu,{label:"Top Clients",children:t.map(([e,t])=>{const n=lu[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:bu(t),children:[uu[e]??e,s.jsx("span",{className:"ml-1.5 text-text-muted opacity-0 group-hover:opacity-100 transition-opacity",children:bu(t)})]},e)})}),n.length>0&&s.jsx(wu,{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:bu(t),children:[e,s.jsx("span",{className:"ml-1.5 text-text-muted opacity-0 group-hover:opacity-100 transition-opacity",children:bu(t)})]},e))})]})}const Su={coding:"#b4f82c",debugging:"#f87171",testing:"#60a5fa",planning:"#a78bfa",reviewing:"#34d399",documenting:"#fbbf24",learning:"#f472b6",other:"#94a3b8"};function Cu(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 Tu({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=Su[e]??Su.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(au.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:Cu(t)})]},e);var o})})]})}function Eu({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 scale-105":"bg-bg-surface-1 border-border text-text-muted hover:text-text-primary hover:border-text-muted/50"),style:t?{boxShadow:"0 2px 10px rgba(var(--accent-rgb), 0.4)"}:void 0,children:e})}function ju({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-wrap items-center gap-2 px-1",children:[s.jsx(Eu,{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(Eu,{label:uu[e]??e,active:t.client===e,onClick:()=>n("client",t.client===e?"all":e)},e)),i.map(e=>s.jsx(Eu,{label:e,active:t.language===e,onClick:()=>n("language",t.language===e?"all":e)},e)),a.map(e=>s.jsx(Eu,{label:e,active:t.project===e,onClick:()=>n("project",t.project===e?"all":e)},e))]}):null}function Pu({onDelete:e,size:t="md",className:n=""}){const[r,i]=f.useState(!1),a=f.useRef(void 0);f.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);const o=t=>{t.stopPropagation(),a.current&&clearTimeout(a.current),i(!1),e()},l=e=>{e.stopPropagation(),a.current&&clearTimeout(a.current),i(!1)},u="sm"===t?"w-3 h-3":"w-3.5 h-3.5",c="sm"===t?"p-1":"p-1.5";return r?s.jsxs("span",{className:\`inline-flex items-center gap-0.5 \${n}\`,onClick:e=>e.stopPropagation(),children:[s.jsx("button",{onClick:o,className:\`\${c} rounded-lg transition-all bg-error/15 text-error hover:bg-error/25\`,title:"Confirm delete",children:s.jsx(Q,{className:u})}),s.jsx("button",{onClick:l,className:\`\${c} rounded-lg transition-all text-text-muted hover:bg-bg-surface-2\`,title:"Cancel",children:s.jsx(Ce,{className:u})})]}):s.jsx("button",{onClick:e=>{e.stopPropagation(),i(!0),a.current=setTimeout(()=>i(!1),5e3)},className:\`\${c} rounded-lg transition-all text-text-muted hover:text-error/70 hover:bg-error/5 \${n}\`,title:"Delete",children:s.jsx(xe,{className:u})})}function Nu(e,t){const n=e=>new Date(e).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0});return\`\${n(e)} \u2014 \${n(t)}\`}function Mu(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 Lu({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 Au({score:e}){const t=e/5*100,n=e>=4?"bg-success":e>=3?"bg-accent":"bg-error",r=e>=4?"bg-success/15":e>=3?"bg-accent/15":"bg-error/15";return s.jsx("span",{className:\`w-7 h-[4px] rounded-full \${r} flex-shrink-0 overflow-hidden\`,title:\`Quality: \${e.toFixed(1)}/5\`,children:s.jsx("span",{className:\`block h-full rounded-full \${n}\`,style:{width:\`\${t}%\`}})})}function _u({evaluation:e,showPublic:t=!1}){const n=[{label:"Prompt",value:e.prompt_quality,reason:e.prompt_quality_reason,Icon:de},{label:"Context",value:e.context_provided,reason:e.context_provided_reason,Icon:ae},{label:"Scope",value:e.scope_quality,reason:e.scope_quality_reason,Icon:be},{label:"Independence",value:e.independence_level,reason:e.independence_level_reason,Icon:te}],r=n.some(e=>e.reason)||e.task_outcome_reason;return s.jsxs("div",{className:"px-2 py-1.5 bg-bg-surface-2/30 rounded-md mb-2",children:[s.jsx("div",{className:"grid grid-cols-2 gap-x-6 gap-y-1.5",children:n.map(({label:e,value:t,Icon:n})=>s.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",children:[s.jsx(n,{className:"w-3 h-3 text-text-muted/50 flex-shrink-0"}),s.jsx("span",{className:"text-text-muted min-w-[58px]",children:e}),s.jsx(Au,{score:t})]},e))}),!t&&r&&s.jsxs("div",{className:"mt-1.5 pt-1.5 border-t border-border/15 space-y-1",children:[e.task_outcome_reason&&s.jsxs("div",{className:"flex items-start gap-1.5 text-[10px]",children:[s.jsx("span",{className:"text-error font-bold flex-shrink-0",children:"Outcome:"}),s.jsx("span",{className:"text-text-muted leading-tight",children:e.task_outcome_reason})]}),n.filter(e=>e.reason).map(({label:e,reason:t})=>s.jsxs("div",{className:"flex items-start gap-1.5 text-[10px]",children:[s.jsxs("span",{className:"text-accent font-bold flex-shrink-0",children:[e,":"]}),s.jsx("span",{className:"text-text-muted leading-tight",children:t})]},e))]}),s.jsxs("div",{className:"flex items-center gap-4 mt-1.5 pt-1.5 border-t border-border/15",children:[s.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",children:[s.jsx(he,{className:"w-3 h-3 text-text-muted/50"}),s.jsx("span",{className:"text-text-muted",children:"Iterations"}),s.jsx("span",{className:"text-text-secondary font-mono font-bold ml-0.5",children:e.iteration_count})]}),s.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",children:[s.jsx(Se,{className:"w-3 h-3 text-text-muted/50"}),s.jsx("span",{className:"text-text-muted",children:"Tools"}),s.jsx("span",{className:"text-text-secondary font-mono font-bold ml-0.5",children:e.tools_leveraged})]})]})]})}function zu({session:e,milestones:t,defaultExpanded:n=!1,externalShowPublic:r,hideClientAvatar:i=!1,hideProject:a=!1,onDeleteSession:o,onDeleteMilestone:l}){const[u,c]=f.useState(n),[d,h]=f.useState(!1),p=r??d,m=h,g=hu(e.client),y=lu[g]??"#91919a",v=cu[g]??g.slice(0,2).toUpperCase(),b=du[g],x=t.length>0,w=e.project?.trim()||"",k=!w||["untitled","mcp","unknown","default","none","null","undefined"].includes(w.toLowerCase()),S=t[0],C=k&&S?S.title:w,T=k&&S?S.private_title||S.title:w;let E=e.private_title||e.title||T||"Untitled Session",j=e.title||C||"Untitled Session";const P=E!==j;return s.jsxs("div",{className:"group/card mb-1 rounded-lg border transition-all duration-200 "+(u?"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:()=>x&&c(!u),style:{cursor:x?"pointer":"default"},children:[!i&&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:\`\${y}15\`,color:y,border:\`1px solid \${y}30\`},title:uu[g]??g,children:b?s.jsx("div",{className:"w-4 h-4",style:{backgroundColor:y,maskImage:\`url(\${b})\`,maskSize:"contain",maskRepeat:"no-repeat",maskPosition:"center",WebkitMaskImage:\`url(\${b})\`,WebkitMaskSize:"contain",WebkitMaskRepeat:"no-repeat",WebkitMaskPosition:"center"}}):v}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("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(Bs,{mode:"wait",children:s.jsxs(au.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:[p?s.jsx(ye,{className:"w-3 h-3 text-success/60 flex-shrink-0"}):s.jsx(ue,{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:p?j:E})]},p?"public":"private")})})}),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(ee,{className:"w-3 h-3 opacity-60"}),Mu(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(Te,{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:Nu(e.started_at,e.ended_at).split(" \u2014 ")[0]}),!p&&!k&&!a&&s.jsxs("span",{className:"flex items-center gap-0.5 text-text-muted/70",title:\`Project: \${w}\`,children:[s.jsx(le,{className:"w-2.5 h-2.5 opacity-60"}),s.jsx("span",{className:"max-w-[100px] truncate",children:w})]}),t.length>0&&s.jsxs("span",{className:"flex items-center gap-0.5",title:\`\${t.length} milestone\${1!==t.length?"s":""}\`,children:[s.jsx(se,{className:"w-2.5 h-2.5 opacity-60"}),t.length]}),e.evaluation&&s.jsx(Au,{score:(N=e.evaluation,(N.prompt_quality+N.context_provided+N.scope_quality+N.independence_level)/4)})]})]})]}),s.jsxs("div",{className:"flex items-center px-2 gap-1.5 border-l border-border/30 h-8 self-center",children:[o&&s.jsx(Pu,{onDelete:()=>o(e.session_id),className:"opacity-0 group-hover/card:opacity-100"}),P&&void 0===r&&s.jsx("button",{onClick:e=>{e.stopPropagation(),m(!p)},className:"p-1.5 rounded-lg transition-all "+(p?"bg-success/10 text-success":"text-text-muted hover:bg-bg-surface-2"),title:p?"Public Mode":"Private Mode",children:p?s.jsx(re,{className:"w-3.5 h-3.5"}):s.jsx(ne,{className:"w-3.5 h-3.5"})}),x&&s.jsx("button",{onClick:()=>c(!u),className:"p-1.5 rounded-lg transition-all "+(u?"text-accent bg-accent/5":"text-text-muted hover:bg-bg-surface-2"),children:s.jsx(G,{className:"w-4 h-4 transition-transform duration-200 "+(u?"rotate-180":"")})})]})]}),s.jsx(Bs,{children:u&&x&&s.jsx(au.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.jsx(_u,{evaluation:e.evaluation,showPublic:p}),s.jsx("div",{className:"space-y-0.5",children:t.map(e=>{e.private_title;const t=p?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:pu[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(Lu,{category:e.category})]})}),n&&s.jsx("span",{className:"text-[10px] text-text-muted font-mono",children:n}),l&&s.jsx(Pu,{onDelete:()=>l(e.id),size:"sm",className:"opacity-0 group-hover:opacity-100"})]},e.id)})})]})})})]});var N}function Ru(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({score:e}){const t=e/5*100,n=e>=4?"bg-success":e>=3?"bg-accent":"bg-error",r=e>=4?"bg-success/15":e>=3?"bg-accent/15":"bg-error/15";return s.jsx("span",{className:\`w-7 h-[4px] rounded-full \${r} flex-shrink-0 overflow-hidden\`,title:\`Quality: \${e.toFixed(1)}/5\`,children:s.jsx("span",{className:\`block h-full rounded-full \${n}\`,style:{width:\`\${t}%\`}})})}function Ou({group:e,defaultExpanded:t,globalShowPublic:n,onDeleteSession:r,onDeleteMilestone:i,onDeleteConversation:a}){const[o,l]=f.useState(t),[u,c]=f.useState(!1),d=n||u;if(1===e.sessions.length){const a=e.sessions[0];return s.jsx(zu,{session:a.session,milestones:a.milestones,defaultExpanded:t&&a.milestones.length>0,externalShowPublic:n||void 0,onDeleteSession:r,onDeleteMilestone:i})}const h=hu(e.sessions[0].session.client),p=lu[h]??"#91919a",m=cu[h]??h.slice(0,2).toUpperCase(),g=du[h],y=e.aggregateEval,v=y?(y.prompt_quality+y.context_provided+y.scope_quality+y.independence_level)/4:0,b=e.sessions[0].session,x=b.private_title||b.title||b.project||"Conversation",w=b.title||b.project||"Conversation",k=x!==w,S=b.project?.trim()||"",C=!!S&&!["untitled","mcp","unknown","default","none","null","undefined"].includes(S.toLowerCase());return s.jsxs("div",{className:"group/conv mb-1 rounded-lg border transition-all duration-200 "+(o?"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:()=>l(!o),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:\`\${p}15\`,color:p,border:\`1px solid \${p}30\`},title:uu[h]??h,children:g?s.jsx("div",{className:"w-4 h-4",style:{backgroundColor:p,maskImage:\`url(\${g})\`,maskSize:"contain",maskRepeat:"no-repeat",maskPosition:"center",WebkitMaskImage:\`url(\${g})\`,WebkitMaskSize:"contain",WebkitMaskRepeat:"no-repeat",WebkitMaskPosition:"center"}}):m}),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(Bs,{mode:"wait",children:s.jsxs(au.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:[d?s.jsx(ye,{className:"w-3 h-3 text-success/60 flex-shrink-0"}):s.jsx(ue,{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:d?w:x})]},d?"public":"private")})}),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 flex-shrink-0",children:[e.sessions.length," prompts"]})]}),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(ee,{className:"w-3 h-3 opacity-60"}),Ru(e.totalDuration)]}),s.jsx("span",{className:"opacity-50 font-mono tracking-tight",children:(T=e.startedAt,new Date(T).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0}))}),!d&&C&&s.jsxs("span",{className:"flex items-center gap-0.5 text-text-muted/70",title:\`Project: \${S}\`,children:[s.jsx(le,{className:"w-2.5 h-2.5 opacity-60"}),s.jsx("span",{className:"max-w-[100px] truncate",children:S})]}),e.totalMilestones>0&&s.jsxs("span",{className:"flex items-center gap-0.5",title:\`\${e.totalMilestones} milestone\${1!==e.totalMilestones?"s":""}\`,children:[s.jsx(se,{className:"w-2.5 h-2.5 opacity-60"}),e.totalMilestones]}),y&&s.jsx(Fu,{score:v})]})]})]}),s.jsxs("div",{className:"flex items-center px-2 gap-1.5 border-l border-border/30 h-8 self-center",children:[a&&e.conversationId&&s.jsx(Pu,{onDelete:()=>a(e.conversationId),className:"opacity-0 group-hover/conv:opacity-100"}),k&&!n&&s.jsx("button",{onClick:()=>c(!u),className:"p-1.5 rounded-lg transition-all "+(d?"bg-success/10 text-success":"text-text-muted hover:bg-bg-surface-2"),title:d?"Public Mode":"Private Mode",children:d?s.jsx(re,{className:"w-3.5 h-3.5"}):s.jsx(ne,{className:"w-3.5 h-3.5"})}),s.jsx("button",{onClick:()=>l(!o),className:"p-1.5 rounded-lg transition-all "+(o?"text-accent bg-accent/5":"text-text-muted hover:bg-bg-surface-2"),children:s.jsx(G,{className:"w-4 h-4 transition-transform duration-200 "+(o?"rotate-180":"")})})]})]}),s.jsx(Bs,{children:o&&s.jsx(au.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.75rem] top-0 bottom-2 w-px",style:{backgroundColor:\`\${p}25\`}}),s.jsx("div",{className:"space-y-1 pl-10",children:e.sessions.map((e,t)=>s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute -left-7 top-5 w-2 h-2 rounded-full border-2",style:{backgroundColor:p,borderColor:\`\${p}40\`}}),s.jsx(zu,{session:e.session,milestones:e.milestones,defaultExpanded:!1,externalShowPublic:d||void 0,hideClientAvatar:!0,hideProject:!0,onDeleteSession:r,onDeleteMilestone:i})]},e.session.session_id))})]})})})]});var T}function Vu({sessions:e,milestones:t,filters:n,globalShowPublic:r,onDeleteSession:i,onDeleteConversation:a,onDeleteMilestone:o}){const l=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]),u=f.useMemo(()=>"all"===n.category?t:t.filter(e=>e.category===n.category),[t,n.category]),c=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}(l,u);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:$(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]):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)},[l,u]);return 0===c.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:c.map((e,t)=>s.jsx(Ou,{group:e,defaultExpanded:!1,globalShowPublic:r,onDeleteSession:i,onDeleteMilestone:o,onDeleteConversation:a},e.conversationId??e.sessions[0].session.session_id))})}function Iu({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(au.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(var(--accent-rgb), \${.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(au.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(var(--accent-rgb), \${.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 $u(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 z("/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(ke,{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: ",$u(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(he,{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 z("/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 z("/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(ge,{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(ce,{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 Uu=P();const Hu={"15m":{visibleDuration:9e5,majorTickInterval:3e5,minorTickInterval:6e4,labelFormat:e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})},"30m":{visibleDuration:18e5,majorTickInterval:6e5,minorTickInterval:12e4,labelFormat:e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})},"1h":{visibleDuration:36e5,majorTickInterval:9e5,minorTickInterval:3e5,labelFormat:e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})},"12h":{visibleDuration:432e5,majorTickInterval:72e5,minorTickInterval:18e5,labelFormat:e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})},"24h":{visibleDuration:864e5,majorTickInterval:144e5,minorTickInterval:36e5,labelFormat:e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})},"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 Wu(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 qu({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=Hu[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=e-u.visibleDuration,n=e,r=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=e-u.visibleDuration,n=e;return b.filter(e=>e.start<=n&&e.end>=t).map(r=>({session:r.session,leftOffset:(Math.max(r.start,t)-e)*c,width:(Math.min(r.end,n)-Math.max(r.start,t))*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=e-u.visibleDuration,n=e;let r=0,i=w.length;for(;r<i;){const e=r+i>>1;w[e].time<t?r=e+1:i=e}const a=r;for(i=w.length;r<i;){const e=r+i>>1;w[e].time<=n?r=e+1:i=e}const s=r,l=[];for(let o=a;o<s;o++){const t=w[o];l.push({...t,offset:(t.time-e)*c})}return l},[w,e,o,c,u]),[S,C]=f.useState(null),T=f.useRef(e);return f.useEffect(()=>{S&&Math.abs(e-T.current)>1e3&&C(null),T.current=e},[e,S]),s.jsxs("div",{className:"relative h-16",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.jsx("div",{className:"absolute right-0 top-0 bottom-0 w-[2px] bg-accent/40 z-30"}),s.jsxs("div",{className:"absolute right-0 top-0 bottom-0 w-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-2 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(var(--accent-rgb), 0.15)",borderTop:"2px solid rgba(var(--accent-rgb), 0.5)",boxShadow:"inset 0 1px 10px rgba(var(--accent-rgb), 0.05)"},onMouseEnter:t=>{const n=t.currentTarget.getBoundingClientRect();C({type:"session",data:e.session,x:n.left+n.width/2,y:n.top})},onMouseLeave:()=>C(null)},e.session.session_id)),k.map((e,n)=>s.jsx("div",{className:"absolute bottom-2 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();C({type:"milestone",data:e.milestone,x:n.left+n.width/2,y:n.top})},onMouseLeave:()=>C(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:pu[e.milestone.category]??"#9c9588",boxShadow:\`0 0 10px \${pu[e.milestone.category]}50\`}})},n))]})]}),S&&Uu.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(Yu,{session:S.data}):s.jsx(Xu,{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 Yu({session:e}){const t=uu[e.client]??e.client,n=e.private_title||e.title||e.project||\`\${t} Session\`;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:Wu(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:n}),s.jsx("div",{className:"text-text-secondary capitalize text-[10px]",children:e.task_type})]})}function Xu({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:pu[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 Ku={"15m":9e5,"30m":18e5,"1h":36e5,"12h":432e5,"24h":864e5,"7d":6048e5,"30d":2592e6},Qu={"15m":"15 Minutes","30m":"30 Minutes","1h":"1 Hour","12h":"12 Hours","24h":"24 Hours","7d":"7 Days","30d":"30 Days"};function Gu(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 Zu=["15m","30m","1h","12h","24h","7d","30d"];function Ju({value:e,onChange:t,scale:n,onScaleChange:r,sessions:i}){const a=null===e,[o,l]=f.useState(Date.now());f.useEffect(()=>{if(!a)return;const e=setInterval(()=>l(Date.now()),1e3);return()=>clearInterval(e)},[a]);const u=a?o:e,[c,d]=f.useState(!1),[h,p]=f.useState(""),m=f.useRef(null),g=f.useRef(!1),y=f.useRef(""),v=f.useRef(!1),b=f.useRef(0),x=f.useCallback(e=>{const n=Date.now();if(e>=n-2e3)return v.current=!0,b.current=n,void t(null);v.current&&n-b.current<300||v.current&&e>=n-1e4?t(null):(v.current=!1,t(e))},[t]),w=e=>{const n=u,r=Math.min(n+e,Date.now());t(r)},k=()=>{g.current=a,t(u);const e=new Date(u).toLocaleTimeString([],{hour12:!0,hour:"2-digit",minute:"2-digit",second:"2-digit"});y.current=e,p(e),d(!0),requestAnimationFrame(()=>m.current?.select())},S=()=>{if(d(!1),g.current&&h===y.current)return void t(null);const e=Gu(h,u);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-3 border-b border-border/50 gap-4",children:[s.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2 h-8",children:[c?s.jsx("input",{ref:m,type:"text",value:h,onChange:e=>p(e.target.value),onBlur:S,onKeyDown:e=>{if("Enter"===e.key)return void S();if("Escape"===e.key)return e.preventDefault(),d(!1),void(g.current&&t(null));if("ArrowUp"!==e.key&&"ArrowDown"!==e.key)return;e.preventDefault();const n=m.current;if(!n)return;const r=n.selectionStart??0,i="ArrowUp"===e.key?1:-1,a=Gu(h,u);if(null===a)return;const o=h.indexOf(":"),s=h.indexOf(":",o+1),l=h.lastIndexOf(" ");let c;c=r<=o?36e5*i:s>-1&&r<=s?6e4*i:l>-1&&r<=l?1e3*i:12*i*36e5;const f=Math.min(a+c,Date.now()),y=new Date(f).toLocaleTimeString([],{hour12:!0,hour:"2-digit",minute:"2-digit",second:"2-digit"});p(y),t(f),requestAnimationFrame(()=>{n&&n.setSelectionRange(r,r)})},className:"text-xl font-mono font-bold tracking-tight bg-bg-surface-2 border rounded-lg px-2 -ml-2 w-[155px] outline-none text-text-primary "+(a?"border-accent":"border-history"),style:{boxShadow:a?"0 0 10px rgba(var(--accent-rgb), 0.2)":"0 0 10px rgba(var(--history-rgb), 0.2)"}}):s.jsxs("button",{onClick:k,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(ee,{className:"w-5 h-5 "+(a?"text-text-muted":"text-history")}),s.jsx("span",{className:"text-xl font-mono font-bold tracking-tight tabular-nums "+(a?"text-text-primary":"text-history"),children:new Date(u).toLocaleTimeString([],{hour12:!0,hour:"2-digit",minute:"2-digit",second:"2-digit"})})]}),s.jsx("button",{onClick:c?S:k,className:"p-1.5 rounded-lg transition-colors flex-shrink-0 "+(c?a?"bg-accent text-white hover:bg-accent-bright":"bg-history text-white hover:brightness-110":"text-text-muted hover:text-text-primary hover:bg-bg-surface-2"),title:c?"Confirm time":"Edit time",children:s.jsx(fe,{className:"w-3.5 h-3.5"})})]}),a?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",style:{boxShadow:"0 0 10px rgba(var(--accent-rgb), 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-history/10 text-history rounded-full border border-history/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(K,{className:"w-3.5 h-3.5 text-text-muted"}),new Date(u).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:Zu.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-bg-surface-3 text-text-primary shadow-sm":"text-text-muted hover:text-text-primary hover:bg-bg-surface-2"),title:Qu[e],children:e},e))}),s.jsxs("div",{className:"flex items-center gap-2",children:[!a&&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-history/10 hover:bg-history text-history hover:text-white rounded-xl transition-all border border-history/20",children:[s.jsx(me,{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:()=>w(-Ku[n]),className:"p-2 text-text-muted hover:text-text-primary hover:bg-bg-surface-2 rounded-lg transition-colors",title:\`Back \${Qu[n]}\`,children:s.jsx(Z,{className:"w-4 h-4"})}),s.jsx("button",{onClick:()=>w(Ku[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 \${Qu[n]}\`,disabled:a||u>=Date.now()-1e3,children:s.jsx(J,{className:"w-4 h-4"})})]})]})]})]}),s.jsx(qu,{value:u,onChange:x,scale:n,sessions:i,milestones:void 0})]})}const ec={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 tc({children:e}){return s.jsx("span",{className:"text-text-primary font-medium",children:e})}function nc({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(tc,{children:e.length})," ",1===e.length?"session":"sessions",","," ",s.jsx(tc,{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=ec[t]??ec.other,o=1===n?a.noun:a.plural,l="feature"===t&&r>0?s.jsxs("span",{children:[" ","(",s.jsx(tc,{children:r})," complex)"]},\`\${t}-complex\`):null;i.push(s.jsxs("span",{children:[a.verb," ",s.jsx(tc,{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=uu[o[0]]??o[0];n.push(s.jsxs("span",{children:[". Most active: ",s.jsx(tc,{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(tc,{children:e})]},"lang"))}return n.push(s.jsx("span",{children:"."},"end")),s.jsx(s.Fragment,{children:n})}(e,t),[e,t]);return s.jsx(au.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(ve,{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 rc({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(au.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(be,{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(au.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 ic=["Output","Efficiency","Prompts","Consistency","Breadth"];function ac(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 oc(e,t,n,r){const i=[];for(let a=0;a<5;a++){const[o,s]=ac(a,e,t,n,r);i.push(\`\${o},\${s}\`)}return i.join(" ")}function sc({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]=ac(s,e,a,o,70);l.push(\`\${t},\${n}\`)}const u=l.join(" ");return s.jsxs(au.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(Y,{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:oc(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]=ac(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(au.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]=ac(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}\`)}),ic.map((e,t)=>{const n=function(e,t,n,r){const[i,a]=ac(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:ic.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 lc={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 uc(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 cc({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(au.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(we,{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=pu[e.category]??"#9c9588",r=lc[e.category]??"bg-bg-surface-2 text-text-secondary border-border",i=cu[e.client]??e.client.slice(0,2).toUpperCase(),a=lu[e.client]??"#91919a",o=e.private_title||e.title,l="complex"===e.complexity;return s.jsxs(au.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(Y,{className:"w-2.5 h-2.5"}),"complex"]}),s.jsx("span",{className:"text-[10px] text-text-muted font-mono flex-shrink-0",children:uc(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 dc({filteredSessions:e,filteredMilestones:t,filters:n,onFilterChange:r,onDeleteSession:i,onDeleteConversation:a,onDeleteMilestone:o,globalShowPublic:l,onToggleShowPublic:u}){const[c,d]=f.useState(!1),h="all"!==n.client||"all"!==n.language||"all"!==n.project;return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between px-1",children:[s.jsxs("div",{className:"flex items-center gap-2",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:[e.length," Sessions"]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:u,className:"p-1.5 rounded-md border transition-all duration-200 "+(l?"bg-success/10 border-success/30 text-success":"bg-bg-surface-1 border-border/50 text-text-muted hover:text-text-primary hover:border-text-muted/50"),title:l?"Showing public titles":"Showing private titles",children:l?s.jsx(re,{className:"w-3.5 h-3.5"}):s.jsx(ne,{className:"w-3.5 h-3.5"})}),s.jsx("button",{onClick:()=>d(e=>!e),className:"p-1.5 rounded-md border transition-all duration-200 "+(c||h?"bg-accent/10 border-accent/30 text-accent":"bg-bg-surface-1 border-border/50 text-text-muted hover:text-text-primary hover:border-text-muted/50"),children:s.jsx(oe,{className:"w-3.5 h-3.5"})})]})]}),c&&s.jsx(ju,{sessions:e,filters:n,onFilterChange:r}),s.jsx(Vu,{sessions:e,milestones:t,filters:n,globalShowPublic:l,onDeleteSession:i,onDeleteConversation:a,onDeleteMilestone:o})]})}function fc(){const{sessions:e,milestones:t,config:n,health:r,loading:i,timeTravelTime:a,timeScale:o,filters:l,activeTab:u,loadAll:c,loadHealth:d,setTimeTravelTime:h,setTimeScale:p,setFilter:m,setActiveTab:g,deleteSession:y,deleteConversation:v,deleteMilestone:b}=O();f.useEffect(()=>{c(),d()},[c,d]),f.useEffect(()=>{const e=setInterval(d,3e4);if(null!==a)return()=>clearInterval(e);const t=setInterval(c,3e4);return()=>{clearInterval(e),clearInterval(t)}},[a,c,d]);const[x,w]=f.useState(null),[k,S]=f.useState(!1),C=null===a,T=a??Date.now(),E=T-F[o],j=T,P=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,E,j),[e,E,j]),N=f.useMemo(()=>function(e,t,n){return e.filter(e=>{const r=new Date(e.created_at).getTime();return r>=t&&r<=n})}(t,E,j),[t,E,j]),M=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:I(e),filesTouched:r,...l,byClient:i,byLanguage:a,byTaskType:o,byProject:s}}(P,N),[P,N]),D=f.useMemo(()=>I(e),[e]),L=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"})}(E,j,C),[E,j,C]),A=f.useMemo(()=>{if(!C)return new Date(T).toISOString().slice(0,10)},[C,T]);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 pb-6",children:[s.jsx(Ne,{health:r,timeContextLabel:L,activeTab:u,onTabChange:g}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ju,{value:a,onChange:h,scale:o,onScaleChange:p,sessions:e,milestones:t}),s.jsx(su,{totalHours:M.totalHours,totalSessions:M.totalSessions,currentStreak:D,filesTouched:M.filesTouched,featuresShipped:M.featuresShipped,bugsFixed:M.bugsFixed,complexSolved:M.complexSolved,selectedCard:x,onCardClick:w}),s.jsx(vu,{type:x,milestones:N,showPublic:k,onClose:()=>w(null)}),"sessions"===u&&s.jsx(dc,{filteredSessions:P,filteredMilestones:N,filters:l,onFilterChange:m,onDeleteSession:y,onDeleteConversation:v,onDeleteMilestone:b,globalShowPublic:k,onToggleShowPublic:()=>S(e=>!e)}),"insights"===u&&s.jsxs("div",{className:"space-y-4 pt-2",children:[s.jsx(nc,{sessions:P,milestones:N,isLive:C,windowStart:E,windowEnd:j}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsx(rc,{sessions:P}),s.jsx(sc,{sessions:P,milestones:N,streak:D})]}),s.jsx(Tu,{byTaskType:M.byTaskType}),s.jsx(Iu,{sessions:e,timeScale:o,effectiveTime:T,isLive:C,onDayClick:e=>{const t=new Date(\`\${e}T23:59:59\`).getTime();h(t),p("24h")},highlightDate:A}),s.jsx(cc,{milestones:N}),s.jsx(ku,{stats:M})]}),s.jsx(Bu,{config:n,onRefresh:c})]})]})})}M.createRoot(document.getElementById("root")).render(s.jsx(f.StrictMode,{children:s.jsx(fc,{})}));</script>
|
|
36642
|
+
*/function je({activeTab:e,onTabChange:t}){return s.jsx("div",{className:"flex gap-0.5 p-0.5 rounded-lg bg-bg-surface-1 border border-border/40",children:Ee.map(({id:n,label:r})=>{const i=e===n;return s.jsx("button",{onClick:()=>t(n),className:\`\\n px-3 py-1 rounded-md text-xs font-medium transition-all duration-150\\n \${i?"bg-bg-surface-2 text-text-primary shadow-sm":"text-text-muted hover:text-text-primary"}\\n \`,children:r},n)})})}function Pe({className:e}){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 611.54 143.47",className:e,children:[s.jsxs("g",{fill:"var(--text-primary)",children:[s.jsx("path",{d:"M21.4,121.85c-4.57-4.57-6.85-10.02-6.85-16.37V17.23c0-3.1,1.55-4.65,4.64-4.65h25.55c3.1,0,4.65,1.55,4.65,4.65v76.64c0,3.25,1.12,6,3.37,8.25,2.24,2.25,4.99,3.37,8.25,3.37h27.87c3.25,0,6-1.12,8.25-3.37,2.24-2.24,3.37-4.99,3.37-8.25V17.23c0-3.1,1.55-4.65,4.64-4.65h25.55c3.1,0,4.65,1.55,4.65,4.65v88.25c0,6.35-2.29,11.81-6.85,16.37-4.57,4.57-10.03,6.85-16.37,6.85H37.78c-6.35,0-11.81-2.28-16.37-6.85Z"}),s.jsx("path",{d:"M146.93,124.06v-13.93c0-3.1,1.55-4.65,4.64-4.65h69.67c3.25,0,6-1.12,8.25-3.37,2.24-2.24,3.37-4.99,3.37-8.25s-1.12-6-3.37-8.25c-2.25-2.24-4.99-3.37-8.25-3.37h-51.09c-6.35,0-11.81-2.28-16.37-6.85-4.57-4.57-6.85-10.02-6.85-16.37v-23.22c0-6.35,2.28-11.81,6.85-16.37,4.56-4.57,10.02-6.85,16.37-6.85h92.9c3.1,0,4.65,1.55,4.65,4.65v13.94c0,3.1-1.55,4.65-4.65,4.65h-69.67c-3.25,0-6,1.12-8.25,3.37-2.25,2.25-3.37,4.99-3.37,8.25s1.12,6,3.37,8.25c2.24,2.25,4.99,3.37,8.25,3.37h51.09c6.35,0,11.8,2.29,16.37,6.85,4.57,4.57,6.85,10.03,6.85,16.37v23.22c0,6.35-2.29,11.81-6.85,16.37-4.57,4.57-10.03,6.85-16.37,6.85h-92.9c-3.1,0-4.64-1.55-4.64-4.65Z"}),s.jsx("path",{d:"M286.16,121.85c-4.57-4.57-6.85-10.02-6.85-16.37V35.81c0-6.35,2.28-11.81,6.85-16.37,4.56-4.57,10.02-6.85,16.37-6.85h74.32c6.35,0,11.8,2.29,16.37,6.85,4.57,4.57,6.85,10.03,6.85,16.37v23.22c0,6.35-2.29,11.81-6.85,16.37-4.57,4.57-10.03,6.85-16.37,6.85h-62.71v11.61c0,3.25,1.12,6,3.37,8.25,2.24,2.25,4.99,3.37,8.25,3.37h69.67c3.1,0,4.65,1.55,4.65,4.65v13.93c0,3.1-1.55,4.65-4.65,4.65h-92.9c-6.35,0-11.81-2.28-16.37-6.85ZM361.87,55.66c2.24-2.24,3.37-4.99,3.37-8.25s-1.12-6-3.37-8.25c-2.25-2.24-4.99-3.37-8.25-3.37h-27.87c-3.25,0-6,1.12-8.25,3.37-2.25,2.25-3.37,4.99-3.37,8.25v11.61h39.48c3.25,0,6-1.12,8.25-3.37Z"})]}),s.jsxs("g",{fill:"var(--accent)",children:[s.jsx("path",{d:"M432.08,126.44c-4.76-4.76-7.14-10.44-7.14-17.06v-24.2c0-6.61,2.38-12.3,7.14-17.06,4.76-4.76,10.44-7.14,17.06-7.14h65.34v-12.1c0-3.39-1.17-6.25-3.51-8.59-2.34-2.34-5.2-3.51-8.59-3.51h-72.6c-3.23,0-4.84-1.61-4.84-4.84v-14.52c0-3.23,1.61-4.84,4.84-4.84h96.8c6.61,0,12.3,2.38,17.06,7.14,4.76,4.76,7.14,10.45,7.14,17.06v72.6c0,6.62-2.38,12.3-7.14,17.06-4.76,4.76-10.45,7.14-17.06,7.14h-77.44c-6.62,0-12.3-2.38-17.06-7.14ZM510.97,105.87c2.34-2.34,3.51-5.2,3.51-8.59v-12.1h-41.14c-3.39,0-6.25,1.17-8.59,3.51-2.34,2.34-3.51,5.2-3.51,8.59s1.17,6.25,3.51,8.59c2.34,2.34,5.2,3.51,8.59,3.51h29.04c3.39,0,6.25-1.17,8.59-3.51Z"}),s.jsx("path",{d:"M562.87,128.74V17.42c0-3.23,1.61-4.84,4.84-4.84h26.62c3.23,0,4.84,1.61,4.84,4.84v111.32c0,3.23-1.61,4.84-4.84,4.84h-26.62c-3.23,0-4.84-1.61-4.84-4.84Z"})]})]})}function Ne({health:e,timeContextLabel:t,activeTab:n,onTabChange:r}){return s.jsxs("div",{className:"sticky top-0 z-50 relative flex items-center justify-between mb-4 py-3 -mx-6 px-6 bg-bg-base/80 backdrop-blur-md border-b border-transparent",style:{borderImage:"linear-gradient(to right, transparent, var(--border), transparent) 1"},children:[s.jsx("div",{className:"flex items-center gap-3",children:s.jsx(Pe,{className:"h-6"})}),s.jsx("div",{className:"absolute left-1/2 -translate-x-1/2",children:s.jsx(je,{activeTab:n,onTabChange:r})}),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(q,{className:"w-3 h-3"}),t]})]})]})}const Me=f.createContext({});function De(e){const t=f.useRef(null);return null===t.current&&(t.current=e()),t.current}const Le="undefined"!=typeof window,Ae=Le?f.useLayoutEffect:f.useEffect,_e=f.createContext(null);function ze(e,t){-1===e.indexOf(t)&&e.push(t)}function Re(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Fe=(e,t,n)=>n>t?t:n<e?e:n;const Oe={},Ve=e=>/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(e);function Ie(e){return"object"==typeof e&&null!==e}const $e=e=>/^0[^.\\s]+$/u.test(e);function Be(e){let t;return()=>(void 0===t&&(t=e()),t)}const Ue=e=>e,He=(e,t)=>n=>t(e(n)),We=(...e)=>e.reduce(He),qe=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r};class Ye{constructor(){this.subscriptions=[]}add(e){return ze(this.subscriptions,e),()=>Re(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 Xe=e=>1e3*e,Ke=e=>e/1e3;function Qe(e,t){return t?e*(1e3/t):0}const Ge=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Ze(e,t,n,r){if(e===t&&n===r)return Ue;const i=t=>function(e,t,n,r,i){let a,o,s=0;do{o=t+(n-t)/2,a=Ge(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:Ge(i(e),t,r)}const Je=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,et=e=>t=>1-e(1-t),tt=Ze(.33,1.53,.69,.99),nt=et(tt),rt=Je(nt),it=e=>(e*=2)<1?.5*nt(e):.5*(2-Math.pow(2,-10*(e-1))),at=e=>1-Math.sin(Math.acos(e)),ot=et(at),st=Je(at),lt=Ze(.42,0,1,1),ut=Ze(0,0,.58,1),ct=Ze(.42,0,.58,1),dt=e=>Array.isArray(e)&&"number"==typeof e[0],ft={linear:Ue,easeIn:lt,easeInOut:ct,easeOut:ut,circIn:at,circInOut:st,circOut:ot,backIn:nt,backInOut:rt,backOut:tt,anticipate:it},ht=e=>{if(dt(e)){e.length;const[t,n,r,i]=e;return Ze(t,n,r,i)}return"string"==typeof e?ft[e]:e},pt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function mt(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=pt.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=Oe.useManualTiming?i.timestamp:performance.now();n=!1,Oe.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:pt.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<pt.length;t++)o[pt[t]].cancel(e)},state:i,steps:o}}const{schedule:gt,cancel:yt,state:vt,steps:bt}=mt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Ue,!0);let xt;function wt(){xt=void 0}const kt={now:()=>(void 0===xt&&kt.set(vt.isProcessing||Oe.useManualTiming?vt.timestamp:performance.now()),xt),set:e=>{xt=e,queueMicrotask(wt)}},St=e=>t=>"string"==typeof t&&t.startsWith(e),Ct=St("--"),Tt=St("var(--"),Et=e=>!!Tt(e)&&jt.test(e.split("/*")[0].trim()),jt=/var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;function Pt(e){return"string"==typeof e&&e.split("/*")[0].includes("var(--")}const Nt={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Mt={...Nt,transform:e=>Fe(0,1,e)},Dt={...Nt,default:1},Lt=e=>Math.round(1e5*e)/1e5,At=/-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;const _t=/^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu,zt=(e,t)=>n=>Boolean("string"==typeof n&&_t.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),Rt=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[i,a,o,s]=r.match(At);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:void 0!==s?parseFloat(s):1}},Ft={...Nt,transform:e=>Math.round((e=>Fe(0,255,e))(e))},Ot={test:zt("rgb","red"),parse:Rt("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ft.transform(e)+", "+Ft.transform(t)+", "+Ft.transform(n)+", "+Lt(Mt.transform(r))+")"};const Vt={test:zt("#"),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:Ot.transform},It=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>\`\${t}\${e}\`}),$t=It("deg"),Bt=It("%"),Ut=It("px"),Ht=It("vh"),Wt=It("vw"),qt=(()=>({...Bt,parse:e=>Bt.parse(e)/100,transform:e=>Bt.transform(100*e)}))(),Yt={test:zt("hsl","hue"),parse:Rt("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Bt.transform(Lt(t))+", "+Bt.transform(Lt(n))+", "+Lt(Mt.transform(r))+")"},Xt={test:e=>Ot.test(e)||Vt.test(e)||Yt.test(e),parse:e=>Ot.test(e)?Ot.parse(e):Yt.test(e)?Yt.parse(e):Vt.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?Ot.transform(e):Yt.transform(e),getAnimatableNone:e=>{const t=Xt.parse(e);return t.alpha=0,Xt.transform(t)}},Kt=/(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;const Qt="number",Gt="color",Zt=/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 Jt(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const o=t.replace(Zt,e=>(Xt.test(e)?(r.color.push(a),i.push(Gt),n.push(Xt.parse(e))):e.startsWith("var(")?(r.var.push(a),i.push("var"),n.push(e)):(r.number.push(a),i.push(Qt),n.push(parseFloat(e))),++a,"\${}")).split("\${}");return{values:n,split:o,indexes:r,types:i}}function en(e){return Jt(e).values}function tn(e){const{split:t,types:n}=Jt(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===Qt?Lt(e[a]):t===Gt?Xt.transform(e[a]):e[a]}return i}}const nn=e=>"number"==typeof e?0:Xt.test(e)?Xt.getAnimatableNone(e):e;const rn={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(At)?.length||0)+(e.match(Kt)?.length||0)>0},parse:en,createTransformer:tn,getAnimatableNone:function(e){const t=en(e);return tn(e)(t.map(nn))}};function an(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 on(e,t){return n=>n>0?t:e}const sn=(e,t,n)=>e+(t-e)*n,ln=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},un=[Vt,Ot,Yt];function cn(e){const t=(n=e,un.find(e=>e.test(n)));var n;if(!Boolean(t))return!1;let r=t.parse(e);return t===Yt&&(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=an(s,r,e+1/3),a=an(s,r,e),o=an(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 dn=(e,t)=>{const n=cn(e),r=cn(t);if(!n||!r)return on(e,t);const i={...n};return e=>(i.red=ln(n.red,r.red,e),i.green=ln(n.green,r.green,e),i.blue=ln(n.blue,r.blue,e),i.alpha=sn(n.alpha,r.alpha,e),Ot.transform(i))},fn=new Set(["none","hidden"]);function hn(e,t){return n=>sn(e,t,n)}function pn(e){return"number"==typeof e?hn:"string"==typeof e?Et(e)?on:Xt.test(e)?dn:yn:Array.isArray(e)?mn:"object"==typeof e?Xt.test(e)?dn:gn:on}function mn(e,t){const n=[...e],r=n.length,i=e.map((e,n)=>pn(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function gn(e,t){const n={...e,...t},r={};for(const i in n)void 0!==e[i]&&void 0!==t[i]&&(r[i]=pn(e[i])(e[i],t[i]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const yn=(e,t)=>{const n=rn.createTransformer(t),r=Jt(e),i=Jt(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?fn.has(e)&&!i.values.length||fn.has(t)&&!r.values.length?function(e,t){return fn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):We(mn(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):on(e,t)};function vn(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return sn(e,t,n);return pn(e)(e,t)}const bn=e=>{const t=({timestamp:t})=>e(t);return{start:(e=!0)=>gt.update(t,e),stop:()=>yt(t),now:()=>vt.isProcessing?vt.timestamp:kt.now()}},xn=(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)})\`},wn=2e4;function kn(e){let t=0;let n=e.next(t);for(;!n.done&&t<wn;)t+=50,n=e.next(t);return t>=wn?1/0:t}function Sn(e,t,n){const r=Math.max(t-5,0);return Qe(n-e(r),t-r)}const Cn=100,Tn=10,En=1,jn=0,Pn=800,Nn=.3,Mn=.3,Dn={granular:.01,default:2},Ln={granular:.005,default:.5},An=.01,_n=10,zn=.05,Rn=1,Fn=.001;function On({duration:e=Pn,bounce:t=Nn,velocity:n=jn,mass:r=En}){let i,a,o=1-t;o=Fe(zn,Rn,o),e=Fe(An,_n,Ke(e)),o<1?(i=t=>{const r=t*o,i=r*e,a=r-n,s=In(t,o),l=Math.exp(-i);return Fn-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=In(Math.pow(t,2),o);return(-i(t)+Fn>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<Vn;i++)r-=e(r)/t(r);return r}(i,a,5/e);if(e=Xe(e),isNaN(s))return{stiffness:Cn,damping:Tn,duration:e};{const t=Math.pow(s,2)*r;return{stiffness:t,damping:2*o*Math.sqrt(r*t),duration:e}}}const Vn=12;function In(e,t){return e*Math.sqrt(1-t*t)}const $n=["duration","bounce"],Bn=["stiffness","damping","mass"];function Un(e,t){return t.some(t=>void 0!==e[t])}function Hn(e=Mn,t=Nn){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:jn,stiffness:Cn,damping:Tn,mass:En,isResolvedFromDuration:!1,...e};if(!Un(e,Bn)&&Un(e,$n))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(1.2*n),i=r*r,a=2*Fe(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:En,stiffness:i,damping:a}}else{const n=On(e);t={...t,...n,mass:En},t.isResolvedFromDuration=!0}return t}({...n,velocity:-Ke(n.velocity||0)}),p=f||0,m=u/(2*Math.sqrt(l*c)),g=o-a,y=Ke(Math.sqrt(l/c)),v=Math.abs(g)<5;let b;if(r||(r=v?Dn.granular:Dn.default),i||(i=v?Ln.granular:Ln.default),m<1){const e=In(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?Xe(p):Sn(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(kn(x),wn),t=xn(t=>x.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return x}function Wn({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=Hn({keyframes:[f.value,h(f.value)],velocity:Sn(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 qn(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||Oe.mix||vn,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]||Ue:t;n=We(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=qe(e[r],e[r+1],n);return s[r](i)};return n?t=>u(Fe(e[0],e[a-1],t)):u}function Yn(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=qe(0,t,r);e.push(sn(n,1,i))}}(t,e.length-1),t}function Xn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(ht):ht(r),a={done:!1,value:t[0]},o=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:Yn(t),e),s=qn(o,t,{ease:Array.isArray(i)?i:(l=t,u=i,l.map(()=>u||ct).splice(0,l.length-1))});var l,u;return{calculatedDuration:e,next:t=>(a.value=s(t),a.done=t>=e,a)}}Hn.applyToOptions=e=>{const t=function(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(kn(r),wn);return{type:"keyframes",ease:e=>r.next(i*e).value/t,duration:Ke(i)}}(e,100,Hn);return e.ease=t.ease,e.duration=Xe(t.duration),e.type="keyframes",e};const Kn=e=>null!==e;function Qn(e,{repeat:t,repeatType:n="loop"},r,i=1){const a=e.filter(Kn),o=i<0||t&&"loop"!==n&&t%2==1?0:a.length-1;return o&&void 0!==r?r:a[o]}const Gn={decay:Wn,inertia:Wn,tween:Xn,keyframes:Xn,spring:Hn};function Zn(e){"string"==typeof e.type&&(e.type=Gn[e.type])}class Jn{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 er=e=>e/100;class tr extends Jn{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!==kt.now()&&this.tick(kt.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;Zn(e);const{type:t=Xn,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e;let{keyframes:o}=e;const s=t||Xn;s!==Xn&&"number"!=typeof o[0]&&(this.mixKeyframes=We(er,vn(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=kn(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=Fe(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!==Wn&&(x.value=Qn(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 Ke(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ke(e)}get time(){return Ke(this.currentTime)}set time(e){e=Xe(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(kt.now());const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Ke(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=bn,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(kt.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 nr=e=>180*e/Math.PI,rr=e=>{const t=nr(Math.atan2(e[1],e[0]));return ar(t)},ir={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:rr,rotateZ:rr,skewX:e=>nr(Math.atan(e[1])),skewY:e=>nr(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ar=e=>((e%=360)<0&&(e+=360),e),or=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),sr=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),lr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:or,scaleY:sr,scale:e=>(or(e)+sr(e))/2,rotateX:e=>ar(nr(Math.atan2(e[6],e[5]))),rotateY:e=>ar(nr(Math.atan2(-e[2],e[0]))),rotateZ:rr,rotate:rr,skewX:e=>nr(Math.atan(e[4])),skewY:e=>nr(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ur(e){return e.includes("scale")?1:0}function cr(e,t){if(!e||"none"===e)return ur(t);const n=e.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u);let r,i;if(n)r=lr,i=n;else{const t=e.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u);r=ir,i=t}if(!i)return ur(t);const a=r[t],o=i[1].split(",").map(dr);return"function"==typeof a?a(o):o[a]}function dr(e){return parseFloat(e.trim())}const fr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],hr=(()=>new Set(fr))(),pr=e=>e===Nt||e===Ut,mr=new Set(["x","y","z"]),gr=fr.filter(e=>!mr.has(e));const yr={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})=>cr(t,"x"),y:(e,{transform:t})=>cr(t,"y")};yr.translateX=yr.x,yr.translateY=yr.y;const vr=new Set;let br=!1,xr=!1,wr=!1;function kr(){if(xr){const e=Array.from(vr).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 gr.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)})}xr=!1,br=!1,vr.forEach(e=>e.complete(wr)),vr.clear()}function Sr(){vr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(xr=!0)})}class Cr{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?(vr.add(this),br||(br=!0,gt.read(Sr),gt.resolveKeyframes(kr))):(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),vr.delete(this)}cancel(){"scheduled"===this.state&&(vr.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Tr=Be(()=>void 0!==window.ScrollTimeline),Er={};function jr(e,t){const n=Be(e);return()=>Er[t]??n()}const Pr=jr(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),Nr=([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:Nr([0,.65,.55,1]),circOut:Nr([.55,0,1,.45]),backIn:Nr([.31,.01,.66,-.59]),backOut:Nr([.33,1.53,.69,.99])};function Dr(e,t){return e?"function"==typeof e?Pr()?xn(e,t):"ease-out":dt(e)?Nr(e):Array.isArray(e)?e.map(e=>Dr(e,t)||Mr.easeOut):Mr[e]:void 0}function Lr(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=Dr(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 Ar(e){return"function"==typeof e&&"applyToOptions"in e}class _r extends Jn{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 Ar(e)&&Pr()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=Lr(t,n,r,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const e=Qn(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 Ke(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ke(e)}get time(){return Ke(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Xe(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&&Tr()?(this.animation.timeline=e,Ue):t(this)}}const zr={anticipate:it,backInOut:rt,circInOut:st};function Rr(e){"string"==typeof e.ease&&e.ease in zr&&(e.ease=zr[e.ease])}class Fr extends _r{constructor(e){Rr(e),Zn(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 tr({...a,autoplay:!1}),s=Math.max(10,kt.now()-this.startTime),l=Fe(0,10,s-10);t.setWithVelocity(o.sample(Math.max(0,s-l)).value,o.sample(s).value,l),o.stop()}}const Or=(e,t)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!rn.test(e)&&"0"!==e||e.startsWith("url(")));function Vr(e){e.duration=0,e.type="keyframes"}const Ir=new Set(["opacity","clipPath","filter","transform"]),$r=Be(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Br extends Jn{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=kt.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||Cr;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=kt.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=Or(i,t),s=Or(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||Ar(n))&&r)}(e,i,a,o)||(!Oe.instantAnimations&&s||u?.(Qn(e,n,t)),e[0]=e[e.length-1],Vr(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 $r()&&n&&Ir.has(n)&&("transform"!==n||!u)&&!l&&!r&&"mirror"!==i&&0!==a&&"inertia"!==o}(c),f=c.motionValue?.owner?.current,h=d?new Fr({...c,element:f}):new tr(c);h.finished.then(()=>{this.notifyFinished()}).catch(Ue),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(),wr=!0,Sr(),kr(),wr=!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 Ur(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 Hr=/^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u;function Wr(e,t,n=1){const[r,i]=function(e){const t=Hr.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 Ve(e)?parseFloat(e):e}return Et(i)?Wr(i,t,n+1):i}const qr={type:"spring",stiffness:500,damping:25,restSpeed:10},Yr={type:"keyframes",duration:.8},Xr={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Kr=(e,{keyframes:t})=>t.length>2?Yr:hr.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:qr:Xr,Qr=e=>null!==e;function Gr(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Zr(e,t){const n=e?.[t]??e?.default??e;return n!==e?Gr(n,e):n}const Jr=(e,t,n,r={},i,a)=>o=>{const s=Zr(r,e)||{},l=s.delay||r.delay||0;let{elapsed:u=0}=r;u-=Xe(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,Kr(e,c)),c.duration&&(c.duration=Xe(c.duration)),c.repeatDelay&&(c.repeatDelay=Xe(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(Vr(c),0===c.delay&&(d=!0)),(Oe.instantAnimations||Oe.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,Vr(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(Qr);return r[t&&"loop"!==n&&t%2==1?0:r.length-1]}(c.keyframes,s);if(void 0!==e)return void gt.update(()=>{c.onUpdate(e),c.onComplete()})}return s.isSync?new tr(c):new Br(c)};function ei(e){const t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function ti(e,t,n,r){if("function"==typeof t){const[i,a]=ei(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]=ei(r);t=t(void 0!==n?n:e.custom,i,a)}return t}function ni(e,t,n){const r=e.getProps();return ti(r,t,void 0!==n?n:r.custom,e)}const ri=new Set(["width","height","top","left","right","bottom",...fr]);class ii{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{const t=kt.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=kt.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 Ye);const n=this.events[e].add(t);return"change"===e?()=>{n(),gt.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=kt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Qe(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 ai(e,t){return new ii(e,t)}const oi=e=>Array.isArray(e);function si(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ai(n))}function li(e){return oi(e)?e[e.length-1]||0:e}const ui=e=>Boolean(e&&e.getVelocity);function ci(e,t){const n=e.getValue("willChange");if(r=n,Boolean(ui(r)&&r.add))return n.add(t);if(!n&&Oe.WillChange){const n=new Oe.WillChange("auto");e.addValue("willChange",n),n.add(t)}var r}function di(e){return e.replace(/([A-Z])/g,e=>\`-\${e.toLowerCase()}\`)}const fi="data-"+di("framerAppearId");function hi(e){return e.props[fi]}function pi({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function mi(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t;const l=e.getDefaultTransition();a=a?Gr(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&&pi(d,f))continue;const i={delay:n,...Zr(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=hi(e);if(t){const e=window.MotionHandoffAnimation(t,f,gt);null!==e&&(i.startTime=e,l=!0)}}ci(e,f);const h=u??e.shouldReduceMotion;t.start(Jr(f,t,r,h&&ri.has(f)?{type:!1}:i,e,l));const p=t.animation;p&&c.push(p)}if(o){const t=()=>gt.update(()=>{o&&function(e,t){const n=ni(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const o in a)si(e,o,li(a[o]))}(e,o)});c.length?Promise.all(c).then(t):t()}return c}function gi(e,t,n={}){const r=ni(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(mi(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(gi(l,t,{...o,delay:n+("function"==typeof r?0:r)+Ur(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 yi=e=>t=>t.test(e),vi=[Nt,Ut,Bt,$t,Wt,Ht,{test:e=>"auto"===e,parse:e=>e}],bi=e=>vi.find(yi(e));function xi(e){return"number"==typeof e?0===e:null===e||("none"===e||"0"===e||$e(e))}const wi=new Set(["brightness","contrast","saturate","opacity"]);function ki(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(At)||[];if(!r)return e;const i=n.replace(r,"");let a=wi.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const Si=/\\b([a-z-]*)\\(.*?\\)/gu,Ci={...rn,getAnimatableNone:e=>{const t=e.match(Si);return t?t.map(ki).join(" "):e}},Ti={...Nt,transform:Math.round},Ei={borderWidth:Ut,borderTopWidth:Ut,borderRightWidth:Ut,borderBottomWidth:Ut,borderLeftWidth:Ut,borderRadius:Ut,borderTopLeftRadius:Ut,borderTopRightRadius:Ut,borderBottomRightRadius:Ut,borderBottomLeftRadius:Ut,width:Ut,maxWidth:Ut,height:Ut,maxHeight:Ut,top:Ut,right:Ut,bottom:Ut,left:Ut,inset:Ut,insetBlock:Ut,insetBlockStart:Ut,insetBlockEnd:Ut,insetInline:Ut,insetInlineStart:Ut,insetInlineEnd:Ut,padding:Ut,paddingTop:Ut,paddingRight:Ut,paddingBottom:Ut,paddingLeft:Ut,paddingBlock:Ut,paddingBlockStart:Ut,paddingBlockEnd:Ut,paddingInline:Ut,paddingInlineStart:Ut,paddingInlineEnd:Ut,margin:Ut,marginTop:Ut,marginRight:Ut,marginBottom:Ut,marginLeft:Ut,marginBlock:Ut,marginBlockStart:Ut,marginBlockEnd:Ut,marginInline:Ut,marginInlineStart:Ut,marginInlineEnd:Ut,fontSize:Ut,backgroundPositionX:Ut,backgroundPositionY:Ut,...{rotate:$t,rotateX:$t,rotateY:$t,rotateZ:$t,scale:Dt,scaleX:Dt,scaleY:Dt,scaleZ:Dt,skew:$t,skewX:$t,skewY:$t,distance:Ut,translateX:Ut,translateY:Ut,translateZ:Ut,x:Ut,y:Ut,z:Ut,perspective:Ut,transformPerspective:Ut,opacity:Mt,originX:qt,originY:qt,originZ:Ut},zIndex:Ti,fillOpacity:Mt,strokeOpacity:Mt,numOctaves:Ti},ji={...Ei,color:Xt,backgroundColor:Xt,outlineColor:Xt,fill:Xt,stroke:Xt,borderColor:Xt,borderTopColor:Xt,borderRightColor:Xt,borderBottomColor:Xt,borderLeftColor:Xt,filter:Ci,WebkitFilter:Ci},Pi=e=>ji[e];function Ni(e,t){let n=Pi(e);return n!==Ci&&(n=rn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Mi=new Set(["auto","none","0"]);class Di extends Cr{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(),Et(n))){const r=Wr(n,t.current);void 0!==r&&(e[s]=r),s===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!ri.has(n)||2!==e.length)return;const[r,i]=e,a=bi(r),o=bi(i);if(Pt(r)!==Pt(i)&&yr[n])this.needsMeasurement=!0;else if(a!==o)if(pr(a)&&pr(o))for(let s=0;s<e.length;s++){const t=e[s];"string"==typeof t&&(e[s]=parseFloat(t))}else yr[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let r=0;r<e.length;r++)(null===e[r]||xi(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)&&Jt(t).values.length&&(r=e[i]),i++}if(r&&n)for(const a of t)e[a]=Ni(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=yr[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]=yr[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 Li=new Set(["opacity","clipPath","filter","transform"]);function Ai(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 _i=(e,t)=>t&&"number"==typeof e?t.transform(e):e;function zi(e){return Ie(e)&&"offsetHeight"in e}const{schedule:Ri}=mt(queueMicrotask,!1),Fi={x:!1,y:!1};function Oi(){return Fi.x||Fi.y}function Vi(e,t){const n=Ai(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Ii(e,t,n={}){const[r,i,a]=Vi(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||Oi())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 $i=(e,t)=>!!t&&(e===t||$i(e,t.parentElement)),Bi=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,Ui=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Hi=new Set(["INPUT","SELECT","TEXTAREA"]);const Wi=new WeakSet;function qi(e){return t=>{"Enter"===t.key&&e(t)}}function Yi(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function Xi(e){return Bi(e)&&!Oi()}const Ki=new WeakSet;function Qi(e,t,n={}){const[r,i,a]=Vi(e,n),o=e=>{const r=e.currentTarget;if(!Xi(e))return;if(Ki.has(e))return;Wi.add(r),n.stopPropagation&&Ki.add(e);const a=t(r,e),o=(e,t)=>{window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",l),Wi.has(r)&&Wi.delete(r),Xi(e)&&"function"==typeof a&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||$i(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),zi(e)&&(e.addEventListener("focus",e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const r=qi(()=>{if(Wi.has(n))return;Yi(n,"down");const e=qi(()=>{Yi(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>Yi(n,"cancel"),t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)})(e,i)),t=e,Ui.has(t.tagName)||!0===t.isContentEditable||e.hasAttribute("tabindex")||(e.tabIndex=0))}),a}function Gi(e){return Ie(e)&&"ownerSVGElement"in e}const Zi=new WeakMap;let Ji;const ea=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+"Size"]:Gi(r)&&"getBBox"in r?r.getBBox()[t]:r[n],ta=ea("inline","width","offsetWidth"),na=ea("block","height","offsetHeight");function ra({target:e,borderBoxSize:t}){Zi.get(e)?.forEach(n=>{n(e,{get width(){return ta(e,t)},get height(){return na(e,t)}})})}function ia(e){e.forEach(ra)}function aa(e,t){Ji||"undefined"!=typeof ResizeObserver&&(Ji=new ResizeObserver(ia));const n=Ai(e);return n.forEach(e=>{let n=Zi.get(e);n||(n=new Set,Zi.set(e,n)),n.add(t),Ji?.observe(e)}),()=>{n.forEach(e=>{const n=Zi.get(e);n?.delete(t),n?.size||Ji?.unobserve(e)})}}const oa=new Set;let sa;function la(e){return oa.add(e),sa||(sa=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};oa.forEach(t=>t(e))},window.addEventListener("resize",sa)),()=>{oa.delete(e),oa.size||"function"!=typeof sa||(window.removeEventListener("resize",sa),sa=void 0)}}function ua(e,t){return"function"==typeof e?la(e):aa(e,t)}const ca=[...vi,Xt,rn],da=()=>({x:{min:0,max:0},y:{min:0,max:0}}),fa=new WeakMap;function ha(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function pa(e){return"string"==typeof e||Array.isArray(e)}const ma=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ga=["initial",...ma];function ya(e){return ha(e.animate)||ga.some(t=>pa(e[t]))}function va(e){return Boolean(ya(e)||e.variants)}const ba={current:null},xa={current:!1},wa="undefined"!=typeof window;const ka=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Sa={};function Ca(e){Sa=e}class Ta{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=Cr,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=kt.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,gt.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=ya(t),this.isVariantNode=va(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]&&ui(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,fa.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:(xa.current||function(){if(xa.current=!0,wa)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ba.current=e.matches;e.addEventListener("change",t),t()}else ba.current=!1}(),this.shouldReduceMotion=ba.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(),yt(this.notifyUpdate),yt(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&&Li.has(e)&&this.current instanceof HTMLElement){const{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new _r({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Xe(o)}),l=n(s);return void this.valueSubscriptions.set(e,()=>{l(),s.cancel()})}const n=hr.has(e);n&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&>.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 Sa){const t=Sa[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<ka.length;n++){const t=ka[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(ui(i))e.addValue(r,i);else if(ui(a))e.addValue(r,ai(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,ai(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=ai(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&&(Ve(n)||$e(n))?n=parseFloat(n):(r=n,!ca.find(yi(r))&&rn.test(t)&&(n=Ni(e,t))),this.setBaseTarget(e,ui(n)?n.get():n)),ui(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=ti(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||ui(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 Ye),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Ri.render(this.render)}}class Ea extends Ta{constructor(){super(...arguments),this.KeyframeResolver=Di}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;ui(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=\`\${e}\`)}))}}class ja{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Pa({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Na(e){return void 0===e||1===e}function Ma({scale:e,scaleX:t,scaleY:n}){return!Na(e)||!Na(t)||!Na(n)}function Da(e){return Ma(e)||La(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function La(e){return Aa(e.x)||Aa(e.y)}function Aa(e){return e&&"0%"!==e}function _a(e,t,n){return n+t*(e-n)}function za(e,t,n,r,i){return void 0!==i&&(e=_a(e,i,r)),_a(e,n,r)+t}function Ra(e,t=0,n=1,r,i){e.min=za(e.min,t,n,r,i),e.max=za(e.max,t,n,r,i)}function Fa(e,{x:t,y:n}){Ra(e.x,t.translate,t.scale,t.originPoint),Ra(e.y,n.translate,n.scale,n.originPoint)}const Oa=.999999999999,Va=1.0000000000001;function Ia(e,t){e.min=e.min+t,e.max=e.max+t}function $a(e,t,n,r,i=.5){Ra(e,t,n,sn(e.min,e.max,i),r)}function Ba(e,t){$a(e.x,t.x,t.scaleX,t.scale,t.originX),$a(e.y,t.y,t.scaleY,t.scale,t.originY)}function Ua(e,t){return Pa(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 Ha={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Wa=fr.length;function qa(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(hr.has(l))o=!0;else if(Ct(l))i[l]=e;else{const t=_i(e,Ei[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<Wa;a++){const o=fr[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=_i(s,Ei[o]);l||(i=!1,r+=\`\${Ha[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 Ya(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 Xa(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ka={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!Ut.test(e))return e;e=parseFloat(e)}return\`\${Xa(e,t.target.x)}% \${Xa(e,t.target.y)}%\`}},Qa={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=rn.parse(e);if(i.length>5)return r;const a=rn.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=sn(s,l,.5);return"number"==typeof i[2+o]&&(i[2+o]/=u),"number"==typeof i[3+o]&&(i[3+o]/=u),a(i)}},Ga={borderRadius:{...Ka,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ka,borderTopRightRadius:Ka,borderBottomLeftRadius:Ka,borderBottomRightRadius:Ka,boxShadow:Qa};function Za(e,{layout:t,layoutId:n}){return hr.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!Ga[e]||"opacity"===e)}function Ja(e,t,n){const r=e.style,i=t?.style,a={};if(!r)return a;for(const o in r)(ui(r[o])||i&&ui(i[o])||Za(o,e)||void 0!==n?.getValue(o)?.liveStyle)&&(a[o]=r[o]);return a}class eo extends Ea{constructor(){super(...arguments),this.type="html",this.renderInstance=Ya}readValueFromInstance(e,t){if(hr.has(t))return this.projection?.isProjecting?ur(t):((e,t)=>{const{transform:n="none"}=getComputedStyle(e);return cr(n,t)})(e,t);{const r=(n=e,window.getComputedStyle(n)),i=(Ct(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return Ua(e,t)}build(e,t,n){qa(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Ja(e,t,n)}}const to={offset:"stroke-dashoffset",array:"stroke-dasharray"},no={offset:"strokeDashoffset",array:"strokeDasharray"};const ro=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function io(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},l,u,c){if(qa(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 ro)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?to:no;e[a.offset]=""+-r,e[a.array]=\`\${t} \${n}\`}(d,i,a,o,!1)}const ao=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"]),oo=e=>"string"==typeof e&&"svg"===e.toLowerCase();function so(e,t,n){const r=Ja(e,t,n);for(const i in e)if(ui(e[i])||ui(t[i])){r[-1!==fr.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=e[i]}return r}class lo extends Ea{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=da}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(hr.has(t)){const e=Pi(t);return e&&e.default||0}return t=ao.has(t)?t:di(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return so(e,t,n)}build(e,t,n){io(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){!function(e,t,n,r){Ya(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(ao.has(i)?i:di(i),t.attrs[i])}(e,t,0,r)}mount(e){this.isSVGTag=oo(e.tagName),super.mount(e)}}const uo=ga.length;function co(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&co(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<uo;n++){const r=ga[n],i=e.props[r];(pa(i)||!1===i)&&(t[r]=i)}return t}function fo(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 ho=[...ma].reverse(),po=ma.length;function mo(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=>gi(e,t,n));r=Promise.all(i)}else if("string"==typeof t)r=gi(e,t,n);else{const i="function"==typeof t?ni(e,t,n.custom):t;r=Promise.all(mi(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}(e,t,n)))}function go(e){let t=mo(e),n=bo(),r=!0;const i=t=>(n,r)=>{const i=ni(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=co(e.parent)||{},l=[],u=new Set;let c={},d=1/0;for(let t=0;t<po;t++){const f=ho[t],h=n[f],p=void 0!==o[f]?o[f]:s[f],m=pa(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||ha(p)||"boolean"==typeof p)continue;if("exit"===f&&h.isActive&&!0!==g){h.prevResolvedValues&&(c={...c,...h.prevResolvedValues});continue}const v=yo(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,C={...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 C){const t=k[e],n=S[e];if(c.hasOwnProperty(e))continue;let r=!1;r=oi(t)&&oi(n)?!fo(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 E=y&&v;b&&(!E||x)&&l.push(...w.map(t=>{const n={type:f};if("string"==typeof t&&r&&!E&&e.manuallyAnimateOnMount&&e.parent){const{parent:r}=e,i=ni(r,t);if(r.enteringChildren&&i){const{delayChildren:t}=i.transition||{};n.delay=Ur(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){const t={};if("boolean"!=typeof o.initial){const n=ni(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=bo()}}}function yo(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!fo(t,e)}function vo(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function bo(){return{animate:vo(!0),whileInView:vo(),whileHover:vo(),whileTap:vo(),whileDrag:vo(),whileFocus:vo(),exit:vo()}}function xo(e,t){e.min=t.min,e.max=t.max}function wo(e,t){xo(e.x,t.x),xo(e.y,t.y)}function ko(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 Co(e,t,n,r=.5){e.origin=r,e.originPoint=sn(t.min,t.max,e.origin),e.scale=So(n)/So(t),e.translate=sn(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 To(e,t,n,r){Co(e.x,t.x,n.x,r?r.originX:void 0),Co(e.y,t.y,n.y,r?r.originY:void 0)}function Eo(e,t,n){e.min=n.min+t.min,e.max=e.min+So(t)}function jo(e,t,n){e.min=t.min-n.min,e.max=e.min+So(t)}function Po(e,t,n){jo(e.x,t.x,n.x),jo(e.y,t.y,n.y)}function No(e,t,n,r,i){return e=_a(e-=t,1/n,r),void 0!==i&&(e=_a(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){Bt.test(t)&&(t=parseFloat(t),t=sn(o.min,o.max,t/100)-o.min);if("number"!=typeof t)return;let s=sn(a.min,a.max,r);e===a&&(s-=t),e.min=No(e.min,t,n,s,i),e.max=No(e.max,t,n,s,i)}(e,t[n],t[r],t[i],t.scale,a,o)}const Do=["x","scaleX","originX"],Lo=["y","scaleY","originY"];function Ao(e,t,n,r){Mo(e.x,t,Do,n?n.x:void 0,r?r.x:void 0),Mo(e.y,t,Lo,n?n.y:void 0,r?r.y:void 0)}function _o(e){return 0===e.translate&&1===e.scale}function zo(e){return _o(e.x)&&_o(e.y)}function Ro(e,t){return e.min===t.min&&e.max===t.max}function Fo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Oo(e,t){return Fo(e.x,t.x)&&Fo(e.y,t.y)}function Vo(e){return So(e.x)/So(e.y)}function Io(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function $o(e){return[e("x"),e("y")]}const Bo=["TopLeft","TopRight","BottomLeft","BottomRight"],Uo=Bo.length,Ho=e=>"string"==typeof e?parseFloat(e):e,Wo=e=>"number"==typeof e||Ut.test(e);function qo(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Yo=Ko(0,.5,ot),Xo=Ko(.5,.95,Ue);function Ko(e,t,n){return r=>r<e?0:r>t?1:n(qe(e,t,r))}function Qo(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const Go=(e,t)=>e.depth-t.depth;class Zo{constructor(){this.children=[],this.isDirty=!1}add(e){ze(this.children,e),this.isDirty=!0}remove(e){Re(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Go),this.isDirty=!1,this.children.forEach(e)}}function Jo(e){return ui(e)?e.get():e}class es{constructor(){this.members=[]}add(e){ze(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&&Re(this.members,n)}e.scheduleRender()}remove(e){if(Re(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 ts={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ns=["","X","Y","Z"];let rs=0;function is(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function as(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=hi(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",gt,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&as(r)}function os({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=rs++,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(us),this.nodes.forEach(gs),this.nodes.forEach(ys),this.nodes.forEach(cs)},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 Zo)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Ye),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=Gi(t)&&!(Gi(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;gt.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=kt.now(),r=({timestamp:i})=>{const a=i-n;a>=t&&(yt(r),e(a-t))};return gt.setup(r,!0),()=>yt(r)}(i,250),ts.hasAnimatedSinceResize&&(ts.hasAnimatedSinceResize=!1,this.nodes.forEach(ms)))})}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()||Ss,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=a.getProps(),l=!this.targetLayout||!Oo(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={...Zr(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||ms(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(),yt(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(vs),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&&as(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(fs);if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(hs);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ps),this.nodes.forEach(ss),this.nodes.forEach(ls)):this.nodes.forEach(hs),this.clearAllSnapshots();const e=kt.now();vt.delta=Fe(0,1e3/60,e-vt.timestamp),vt.timestamp=e,vt.isProcessing=!0,bt.update.process(vt),bt.preRender.process(vt),bt.render.process(vt),vt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ri.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ds),this.sharedNodes.forEach(bs)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,gt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){gt.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&&!zo(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Da(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)),Es((r=n).x),Es(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(Ps))){const{scroll:e}=this.root;e&&(Ia(t.x,e.offset.x),Ia(t.y,e.offset.y))}return t}removeElementScroll(e){const t={x:{min:0,max:0},y:{min:0,max:0}};if(wo(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&&wo(t,e),Ia(t.x,i.offset.x),Ia(t.y,i.offset.y))}return t}applyTransform(e,t=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};wo(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&&Ba(n,{x:-e.scroll.offset.x,y:-e.scroll.offset.y}),Da(e.latestValues)&&Ba(n,e.latestValues)}return Da(this.latestValues)&&Ba(n,this.latestValues),n}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};wo(t,e);for(let n=0;n<this.path.length;n++){const e=this.path[n];if(!e.instance)continue;if(!Da(e.latestValues))continue;Ma(e.latestValues)&&e.updateSnapshot();const r=da();wo(r,e.measurePageBox()),Ao(t,e.latestValues,e.snapshot?e.snapshot.layoutBox:void 0,r)}return Da(this.latestValues)&&Ao(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!==vt.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=vt.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,Eo(o.x,s.x,l.x),Eo(o.y,s.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):wo(this.target,this.layout.layoutBox),Fa(this.target,this.targetDelta)):wo(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)&&!La(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}},Po(this.relativeTargetOrigin,t,n),wo(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===vt.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;wo(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&&Ba(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Fa(e,o)),r&&Da(a.latestValues)&&Ba(e,a.latestValues))}t.x<Va&&t.x>Oa&&(t.x=1),t.y<Va&&t.y>Oa&&(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?(ko(this.prevProjectionDelta.x,this.projectionDelta.x),ko(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),To(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===a&&this.treeScale.y===o&&Io(this.projectionDelta.x,this.prevProjectionDelta.x)&&Io(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(ks));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,f,h,p,m,g;xs(a.x,e.x,n),xs(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Po(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),h=this.relativeTarget,p=this.relativeTargetOrigin,m=o,g=n,ws(h.x,p.x,m.x,g),ws(h.y,p.y,m.y,g),d&&(l=this.relativeTarget,f=d,Ro(l.x,f.x)&&Ro(l.y,f.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),wo(d,this.relativeTarget)),s&&(this.animationValues=i,function(e,t,n,r,i,a){i?(e.opacity=sn(0,n.opacity??1,Yo(r)),e.opacityExit=sn(t.opacity??1,0,Xo(r))):a&&(e.opacity=sn(t.opacity??1,n.opacity??1,r));for(let o=0;o<Uo;o++){const i=\`border\${Bo[o]}Radius\`;let a=qo(t,i),s=qo(n,i);void 0===a&&void 0===s||(a||(a=0),s||(s=0),0===a||0===s||Wo(a)===Wo(s)?(e[i]=Math.max(sn(Ho(a),Ho(s),r),0),(Bt.test(s)||Bt.test(a))&&(e[i]+="%")):e[i]=s)}(t.rotate||n.rotate)&&(e.rotate=sn(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&&(yt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=gt.update(()=>{ts.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ai(0)),this.currentAnimation=function(e,t,n){const r=ui(e)?e:ai(e);return r.start(Jr("",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&&js(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}wo(t,n),Ba(t,i),To(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new es);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&&is("z",e,r,this.animationValues);for(let i=0;i<ns.length;i++)is(\`rotate\${ns[i]}\`,e,r,this.animationValues),is(\`skew\${ns[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=Jo(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=Jo(t?.pointerEvents)||""),void(this.hasProjected&&!Da(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 Ga){if(void 0===i[l])continue;const{correct:t,applyTo:n,isCSSVariable:o}=Ga[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?Jo(t?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(fs),this.root.sharedNodes.clear()}}}function ss(e){e.updateLayout()}function ls(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?$o(e=>{const r=a?t.measuredBox[e]:t.layoutBox[e],i=So(r);r.min=n[e].min,r.max=r.min+i}):js(i,t.layoutBox,n)&&$o(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}};To(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?To(s,e.applyTransform(r,!0),t.measuredBox):To(s,n,t.layoutBox);const l=!zo(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}};Po(o,t.layoutBox,i.layoutBox);const s={x:{min:0,max:0},y:{min:0,max:0}};Po(s,n,a.layoutBox),Oo(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 us(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 cs(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ds(e){e.clearSnapshot()}function fs(e){e.clearMeasurements()}function hs(e){e.isLayoutDirty=!1}function ps(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ms(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function gs(e){e.resolveTargetDelta()}function ys(e){e.calcProjection()}function vs(e){e.resetSkewAndRotation()}function bs(e){e.removeLeadSnapshot()}function xs(e,t,n){e.translate=sn(t.translate,0,n),e.scale=sn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ws(e,t,n,r){e.min=sn(t.min,n.min,r),e.max=sn(t.max,n.max,r)}function ks(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const Ss={duration:.45,ease:[.4,0,.1,1]},Cs=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ts=Cs("applewebkit/")&&!Cs("chrome/")?Math.round:Ue;function Es(e){e.min=Ts(e.min),e.max=Ts(e.max)}function js(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=Vo(t),i=Vo(n),a=.2,!(Math.abs(r-i)<=a));var r,i,a}function Ps(e){return e!==e.root&&e.scroll?.wasRoot}const Ns=os({attachResizeListener:(e,t)=>Qo(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},Ds=os({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ms.current){const e=new Ns({});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)}),Ls=f.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function As(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function _s(...e){return f.useCallback(function(...e){return t=>{let n=!1;const r=e.map(e=>{const r=As(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():As(e[t],null)}}}}(...e),e)}class zs 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=zi(e)&&e.offsetWidth||0,r=zi(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 Rs({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(Ls),d=e.props?.ref??e?.ref,h=_s(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(zs,{isPresent:t,childRef:l,sizeRef:u,pop:a,children:!1===a?e:f.cloneElement(e,{ref:h})})}const Fs=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:l,anchorY:u,root:c})=>{const d=De(Os),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(Rs,{pop:"popLayout"===o,isPresent:n,anchorX:l,anchorY:u,root:c,children:e}),s.jsx(_e.Provider,{value:m,children:e})};function Os(){return new Map}function Vs(e=!0){const t=f.useContext(_e);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 Is=e=>e.key||"";function $s(e){const t=[];return f.Children.forEach(e,e=>{f.isValidElement(e)&&t.push(e)}),t}const Bs=({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]=Vs(o),p=f.useMemo(()=>$s(e),[e]),m=o&&!d?[]:p.map(Is),g=f.useRef(!0),y=f.useRef(p),v=De(()=>new Map),b=f.useRef(new Set),[x,w]=f.useState(p),[k,S]=f.useState(p);Ae(()=>{g.current=!1,y.current=p;for(let e=0;e<k.length;e++){const t=Is(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 C=[];if(p!==x){let e=[...p];for(let t=0;t<k.length;t++){const n=k[t],r=Is(n);m.includes(r)||(e.splice(t,0,n),C.push(n))}return"wait"===a&&C.length&&(e=C),S($s(e)),w(p),null}const{forceRender:T}=f.useContext(Me);return s.jsx(s.Fragment,{children:k.map(e=>{const f=Is(e),x=!(o&&!d)&&(p===k||m.includes(f));return s.jsx(Fs,{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)})})},Us=f.createContext({strict:!1}),Hs={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 Ws=!1;function qs(){return function(){if(Ws)return;const e={};for(const t in Hs)e[t]={isEnabled:e=>Hs[t].some(t=>!!e[t])};Ca(e),Ws=!0}(),Sa}const Ys=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 Xs(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Ys.has(e)}let Ks=e=>!Xs(e);try{"function"==typeof(Qs=require("@emotion/is-prop-valid").default)&&(Ks=e=>e.startsWith("on")?!Xs(e):Qs(e))}catch{}var Qs;const Gs=f.createContext({});function Zs(e){const{initial:t,animate:n}=function(e,t){if(ya(e)){const{initial:t,animate:n}=e;return{initial:!1===t||pa(t)?t:void 0,animate:pa(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,f.useContext(Gs));return f.useMemo(()=>({initial:t,animate:n}),[Js(t),Js(n)])}function Js(e){return Array.isArray(e)?e.join(" "):e}const el=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function tl(e,t,n){for(const r in t)ui(t[r])||Za(r,n)||(e[r]=t[r])}function nl(e,t){const n={};return tl(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return f.useMemo(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return qa(n,t,e),Object.assign({},n.vars,n.style)},[t])}(e,t)),n}function rl(e,t){const n={},r=nl(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 il=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function al(e,t,n,r){const i=f.useMemo(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return io(n,t,oo(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){const t={};tl(t,e.style,e),i.style={...t,...i.style}}return i}const ol=["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 sl(e){return"string"==typeof e&&!e.includes("-")&&!!(ol.indexOf(e)>-1||/[A-Z]/u.test(e))}function ll(e,t,n,{latestValues:r},i,a=!1,o){const s=(o??sl(e)?al:rl)(t,r,i,e),l=function(e,t,n){const r={};for(const i in e)"values"===i&&"object"==typeof e.values||(Ks(i)||!0===n&&Xs(i)||!t&&!Xs(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(()=>ui(c)?c.get():c,[c]);return f.createElement(e,{...u,children:d})}function ul(e,t,n,r){const i={},a=r(e,{});for(const f in a)i[f]=Jo(a[f]);let{initial:o,animate:s}=e;const l=ya(e),u=va(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&&!ha(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){const r=ti(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 cl=e=>(t,n)=>{const r=f.useContext(Gs),i=f.useContext(_e),a=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:ul(n,r,i,e),renderState:t()}}(e,t,r,i);return n?a():De(a)},dl=cl({scrapeMotionValuesFromProps:Ja,createRenderState:el}),fl=cl({scrapeMotionValuesFromProps:so,createRenderState:il}),hl=Symbol.for("motionComponentSymbol");function pl(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 ml=f.createContext({});function gl(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function yl(e,t,n,r,i,a){const{visualElement:o}=f.useContext(Gs),s=f.useContext(Us),l=f.useContext(_e),u=f.useContext(Ls),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(ml);!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:vl(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:Boolean(o)||s&&gl(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[fi],b=f.useRef(Boolean(v)&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return Ae(()=>{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 vl(e){if(e)return!1!==e.options.allowProjection?e.projection:vl(e.parent)}function bl(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&function(e){const t=qs();for(const n in e)t[n]={...t[n],...e[n]};Ca(t)}(r);const a=n?"svg"===n:sl(e),o=a?fl:dl;function l(n,r){let l;const u={...f.useContext(Ls),...n,layoutId:xl(n)},{isStatic:c}=u,d=Zs(n),h=o(n,c);if(!c&&Le){f.useContext(Us).strict;const t=function(e){const t=qs(),{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=yl(e,h,u,i,t.ProjectionNode,a)}return s.jsxs(Gs.Provider,{value:d,children:[l&&d.visualElement?s.jsx(l,{visualElement:d.visualElement,...u}):null,ll(e,n,pl(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[hl]=e,u}function xl({layoutId:e}){const t=f.useContext(Me).id;return t&&void 0!==e?t+"-"+e:e}function wl(e,t){if("undefined"==typeof Proxy)return bl;const n=new Map,r=(n,r)=>bl(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>"create"===a?r:(n.has(a)||n.set(a,bl(a,void 0,e,t)),n.get(a))})}const kl=(e,t)=>t.isSVG??sl(e)?new lo(t):new eo(t,{allowProjection:e!==f.Fragment});let Sl=0;const Cl={animation:{Feature:class extends ja{constructor(e){super(e),e.animationState||(e.animationState=go(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();ha(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 ja{constructor(){super(...arguments),this.id=Sl++}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 Tl(e){return{point:{x:e.pageX,y:e.pageY}}}function El(e,t,n,r){return Qo(e,t,(e=>t=>Bi(t)&&e(t,Tl(t)))(n),r)}const jl=({current:e})=>e?e.ownerDocument.defaultView:null,Pl=(e,t)=>Math.abs(e-t);const Nl=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=Al(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=Pl(e.x,t.x),r=Pl(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}=vt;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=Dl(t,this.transformPagePoint),gt.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=Al("pointercancel"===e.type?this.lastMoveEventInfo:Dl(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Bi(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;const s=Dl(Tl(e),this.transformPagePoint),{point:l}=s,{timestamp:u}=vt;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=t;c&&c(e,Al(s,this.history)),this.removeListeners=We(El(this.contextWindow,"pointermove",this.handlePointerMove),El(this.contextWindow,"pointerup",this.handlePointerUp),El(this.contextWindow,"pointercancel",this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){const e=getComputedStyle(t);(Nl.has(e.overflowX)||Nl.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),gt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),yt(this.updatePoint)}}function Dl(e,t){return t?{point:t(e.point)}:e}function Ll(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Al({point:e},t){return{point:e,delta:Ll(e,zl(t)),offset:Ll(e,_l(t)),velocity:Rl(t,.1)}}function _l(e){return e[0]}function zl(e){return e[e.length-1]}function Rl(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=zl(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Xe(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>2*Xe(t)&&(r=e[1]);const a=Ke(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 Fl(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 Ol(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 Vl=.35;function Il(e,t,n){return{min:$l(e,t),max:$l(e,n)}}function $l(e,t){return"number"==typeof e?e:e[t]||0}const Bl=new WeakMap;class Ul{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(Tl(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?Fi[a]?null:(Fi[a]=!0,()=>{Fi[a]=!1}):Fi.x||Fi.y?null:(Fi.x=Fi.y=!0,()=>{Fi.x=Fi.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),$o(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Bt.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&>.update(()=>i(e,t),!1,!0),ci(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&>.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:jl(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&>.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||!Wl(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?sn(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?sn(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&&gl(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!n)&&function(e,{top:t,left:n,bottom:r,right:i}){return{x:Fl(e.x,n,i),y:Fl(e.y,t,r)}}(n.layoutBox,e),this.elastic=function(e=Vl){return!1===e?e=0:!0===e&&(e=Vl),{x:Il(e,"left","right"),y:Il(e,"top","bottom")}}(t),r!==this.constraints&&!gl(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&$o(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||!gl(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=Ua(e,n),{scroll:i}=t;return i&&(Ia(r.x,i.offset.x),Ia(r.y,i.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let a=function(e,t){return{x:Ol(e.x,t.x),y:Ol(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=Pa(e))}return a}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},l=$o(o=>{if(!Wl(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 ci(this.visualElement,e),n.start(Jr(e,n,0,t,this.visualElement,!1))}stopAnimation(){$o(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){$o(t=>{const{drag:n}=this.getProps();if(!Wl(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]-sn(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!gl(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};$o(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=qe(t.min,t.max-r,e.min):r>i&&(n=qe(e.min,e.max-i,t.min)),Fe(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(),$o(t=>{if(!Wl(t,e,null))return;const n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(sn(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Bl.set(this.visualElement,this);const e=this.visualElement.current,t=El(e,"pointerdown",t=>{const{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&function(e){return Hi.has(e.tagName)||!0===e.isContentEditable}(i);n&&r&&!a&&this.start(t)});let n;const r=()=>{const{dragConstraints:t}=this.getProps();gl(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(e,t,n){const r=ua(e,Hl(n)),i=ua(t,Hl(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()),gt.read(r);const o=Qo(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&($o(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=Vl,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}}function Hl(e){let t=!0;return()=>{t?t=!1:e()}}function Wl(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const ql=e=>(t,n)=>{e&>.update(()=>e(t,n),!1,!0)};let Yl=!1;class Xl 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),Yl&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ts.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}),Yl=!0,r||e.layoutDependency!==t||void 0===t||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||gt.postRender(()=>{const e=a.getStack();e&&e.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Ri.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Yl=!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 Kl(e){const[t,n]=Vs(),r=f.useContext(Me);return s.jsx(Xl,{...e,layoutGroup:r,switchLayoutGroup:f.useContext(ml),isPresent:t,safeToRemove:n})}const Ql={pan:{Feature:class extends ja{constructor(){super(...arguments),this.removePointerDownListener=Ue}onPointerDown(e){this.session=new Ml(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:jl(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:ql(e),onStart:ql(t),onMove:ql(n),onEnd:(e,t)=>{delete this.session,r&>.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=El(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 ja{constructor(e){super(e),this.removeGroupControls=Ue,this.removeListeners=Ue,this.controls=new Ul(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ue}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:Ds,MeasureLayout:Kl}};function Gl(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);const i=r["onHover"+n];i&>.postRender(()=>i(t,Tl(t)))}function Zl(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&>.postRender(()=>i(t,Tl(t)))}const Jl=new WeakMap,eu=new WeakMap,tu=e=>{const t=Jl.get(e.target);t&&t(e)},nu=e=>{e.forEach(tu)};function ru(e,t,n){const r=function({root:e,...t}){const n=e||document;eu.has(n)||eu.set(n,{});const r=eu.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(nu,{root:e,...t})),r[i]}(t);return Jl.set(e,n),r.observe(e),()=>{Jl.delete(e),r.unobserve(e)}}const iu={some:0,all:1};const au=wl({...Cl,...{inView:{Feature:class extends ja{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:iu[r]};return ru(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 ja{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Qi(e,(e,t)=>(Zl(this.node,t,"Start"),(e,{success:t})=>Zl(this.node,e,t?"End":"Cancel")),{useGlobalTarget:t,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends ja{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=We(Qo(this.node.current,"focus",()=>this.onFocus()),Qo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ja{mount(){const{current:e}=this.node;e&&(this.unmount=Ii(e,(e,t)=>(Gl(this.node,t,"Start"),e=>Gl(this.node,e,"End"))))}unmount(){}}}},...Ql,...{layout:{ProjectionNode:Ds,MeasureLayout:Kl}}},kl);function ou({label:e,value:t,suffix:n,decimals:r=0,icon:i,delay:a=0,variant:o="default",clickable:l=!1,selected:u=!1,onClick:c}){const d=f.useRef(null),h=f.useRef(0);f.useEffect(()=>{d.current&&t!==h.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)})}(d.current,t,r),h.current=t)},[t,r]);const p="accent"===o;return s.jsxs(au.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{delay:a},onClick:l&&t>0?c:void 0,className:\`px-3 py-2 rounded-lg border flex items-center gap-2.5 group transition-all duration-300 \${p?"shrink-0 bg-bg-surface-1 border-border/50 hover:border-accent/30":"flex-1 min-w-[120px] bg-bg-surface-1 border-border/50 hover:border-accent/30"} \${l&&t>0?"cursor-pointer":""} \${u?"border-accent/50 bg-accent/5":""}\`,children:[s.jsx("div",{className:"p-1.5 rounded-md transition-colors "+(u?"bg-accent/15":"bg-bg-surface-2 group-hover:bg-accent/10"),children:s.jsx(i,{className:"w-3.5 h-3.5 transition-colors "+(u?"text-accent":"text-text-muted group-hover:text-accent")})}),s.jsxs("div",{className:"flex flex-col min-w-0",children:[s.jsxs("div",{className:"flex items-baseline gap-0.5",children:[s.jsx("span",{ref:d,className:"text-lg font-bold text-text-primary tracking-tight leading-none",children:r>0?t.toFixed(r):t}),n&&s.jsx("span",{className:"text-[10px] text-text-muted font-medium",children:n})]}),s.jsx("span",{className:"text-[9px] font-mono text-text-muted uppercase tracking-wider leading-none mt-0.5",children:e})]})]})}function su({totalHours:e,featuresShipped:t,bugsFixed:n,complexSolved:r,currentStreak:i,filesTouched:a,selectedCard:o,onCardClick:l}){const u=e=>{l?.(o===e?null:e)};return s.jsxs("div",{className:"flex gap-2 mb-4",children:[s.jsxs("div",{className:"grid grid-cols-3 lg:grid-cols-5 gap-2 flex-1",children:[s.jsx(ou,{label:"Active Hours",value:e,suffix:"hrs",decimals:1,icon:ee,delay:.1}),s.jsx(ou,{label:"Features",value:t,icon:pe,delay:.15,clickable:!0,selected:"features"===o,onClick:()=>u("features")}),s.jsx(ou,{label:"Bugs Fixed",value:n,icon:X,delay:.2,clickable:!0,selected:"bugs"===o,onClick:()=>u("bugs")}),s.jsx(ou,{label:"Complex",value:r,icon:Y,delay:.25,clickable:!0,selected:"complex"===o,onClick:()=>u("complex")}),s.jsx(ou,{label:"Files",value:a,icon:ie,delay:.3})]}),s.jsx("div",{className:"w-px bg-border/30 self-stretch my-1"}),s.jsx(ou,{label:"Streak",value:i,suffix:"days",icon:Te,delay:.35,variant:"accent"})]})}const lu={"claude-code":"#d4a04a",cursor:"#00b4d8",copilot:"#6e40c9",windsurf:"#38bdf8","github-copilot":"#6e40c9",aider:"#4ade80",continue:"#f97316",cody:"#ff6b6b",tabby:"#a78bfa",roo:"#f472b6",gemini:"#4285f4"},uu={"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:"Gemini"},cu={"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:"Ge"},du={"claude-code":\`data:image/svg+xml,\${encodeURIComponent('<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"/></svg>')}\`,gemini:\`data:image/svg+xml,\${encodeURIComponent('<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"/></svg>')}\`},fu=Object.keys(lu);function hu(e){if(lu[e])return e;return fu.filter(t=>e.startsWith(t)).sort((e,t)=>t.length-e.length)[0]??e}const pu={feature:"#4ade80",bugfix:"#f87171",refactor:"#a78bfa",test:"#38bdf8",docs:"#fbbf24",setup:"#6b655c",deployment:"#f97316",other:"#9c9588"},mu={features:{title:"Features Shipped",icon:pe,filter:e=>"feature"===e.category,emptyText:"No features shipped in this time window.",accentColor:"#4ade80"},bugs:{title:"Bugs Fixed",icon:X,filter:e=>"bugfix"===e.category,emptyText:"No bugs fixed in this time window.",accentColor:"#f87171"},complex:{title:"Complex Tasks",icon:Y,filter:e=>"complex"===e.complexity,emptyText:"No complex tasks in this time window.",accentColor:"#a78bfa"}},gu={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 yu(e){const t=new Date(e),n=(new Date).getTime()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return"just now";if(r<60)return\`\${r}m ago\`;const i=Math.floor(r/60);if(i<24)return\`\${i}h ago\`;const a=Math.floor(i/24);return 1===a?"yesterday":a<7?\`\${a}d ago\`:t.toLocaleDateString([],{month:"short",day:"numeric"})}function vu({type:e,milestones:t,showPublic:n=!1,onClose:r}){if(f.useEffect(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[e]),!e)return null;const i=mu[e],a=i.icon,o=t.filter(i.filter).sort((e,t)=>new Date(t.created_at).getTime()-new Date(e.created_at).getTime()),l=new Map;for(const s of o){const e=new Date(s.created_at).toLocaleDateString([],{weekday:"short",month:"short",day:"numeric"}),t=l.get(e);t?t.push(s):l.set(e,[s])}return s.jsx(Bs,{children:e&&s.jsxs(s.Fragment,{children:[s.jsx(au.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 bg-black/40 backdrop-blur-sm z-40",onClick:r}),s.jsxs(au.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:30,stiffness:300},className:"fixed top-0 right-0 h-full w-full max-w-md bg-bg-base border-l border-border/50 z-50 flex flex-col shadow-2xl",children:[s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border/50",children:[s.jsx("div",{className:"p-2 rounded-lg",style:{backgroundColor:\`\${i.accentColor}15\`},children:s.jsx(a,{className:"w-4 h-4",style:{color:i.accentColor}})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h2",{className:"text-sm font-bold text-text-primary",children:i.title}),s.jsxs("span",{className:"text-[10px] font-mono text-text-muted",children:[o.length," ",1===o.length?"item":"items"," in window"]})]}),s.jsx("button",{onClick:r,className:"p-1.5 rounded-md hover:bg-bg-surface-2 text-text-muted hover:text-text-primary transition-colors",children:s.jsx(Ce,{className:"w-4 h-4"})})]}),s.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain px-5 py-4",children:0===o.length?s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[s.jsx(ve,{className:"w-8 h-8 text-text-muted/30 mb-3"}),s.jsx("p",{className:"text-sm text-text-muted",children:i.emptyText})]}):s.jsx("div",{className:"space-y-5",children:[...l.entries()].map(([t,r])=>s.jsxs("div",{children:[s.jsx("div",{className:"text-[10px] font-mono text-text-muted uppercase tracking-wider mb-2 px-1",children:t}),s.jsx("div",{className:"space-y-1",children:r.map((t,r)=>{const i=pu[t.category]??"#9c9588",a=gu[t.category]??"bg-bg-surface-2 text-text-secondary border-border",o=cu[t.client]??t.client.slice(0,2).toUpperCase(),l=lu[t.client]??"#91919a",u=n?t.title:t.private_title||t.title,c="complex"===t.complexity;return s.jsxs(au.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,delay:.03*r},className:"flex items-start gap-2.5 py-2 px-2 rounded-lg hover:bg-bg-surface-1 transition-colors group",children:[s.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0 mt-1.5",style:{backgroundColor:i}}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm text-text-secondary group-hover:text-text-primary transition-colors leading-snug",children:u}),s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:["complex"===e&&s.jsx("span",{className:\`text-[8px] uppercase tracking-wider font-bold px-1.5 py-0.5 rounded-full border \${a}\`,children:t.category}),c&&"complex"!==e&&s.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] uppercase tracking-wider font-bold px-1.5 py-0.5 rounded-full border bg-purple/10 text-purple border-purple/20",children:[s.jsx(Y,{className:"w-2 h-2"}),"complex"]}),s.jsx("span",{className:"text-[10px] text-text-muted font-mono",children:yu(t.created_at)}),t.languages.length>0&&s.jsx("span",{className:"text-[9px] text-text-muted font-mono",children:t.languages.join(", ")}),s.jsx("div",{className:"w-4 h-4 rounded flex items-center justify-center text-[7px] font-bold font-mono flex-shrink-0 ml-auto",style:{backgroundColor:\`\${l}15\`,color:l,border:\`1px solid \${l}20\`},children:o})]})]})]},t.id)})})]},t))})})]})]})})}function bu(e){const t=e/3600;return t<.1?\`\${t.toFixed(2)}h\`:\`\${t.toFixed(1)}h\`}function xu(e,t){return Object.entries(e).sort((e,t)=>t[1]-e[1]).slice(0,t)}function wu({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 ku({stats:e}){const t=xu(e.byClient,4),n=xu(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(wu,{label:"Top Clients",children:t.map(([e,t])=>{const n=lu[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:bu(t),children:[uu[e]??e,s.jsx("span",{className:"ml-1.5 text-text-muted opacity-0 group-hover:opacity-100 transition-opacity",children:bu(t)})]},e)})}),n.length>0&&s.jsx(wu,{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:bu(t),children:[e,s.jsx("span",{className:"ml-1.5 text-text-muted opacity-0 group-hover:opacity-100 transition-opacity",children:bu(t)})]},e))})]})}const Su={coding:"#b4f82c",debugging:"#f87171",testing:"#60a5fa",planning:"#a78bfa",reviewing:"#34d399",documenting:"#fbbf24",learning:"#f472b6",other:"#94a3b8"};function Cu(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 Tu({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=Su[e]??Su.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(au.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:Cu(t)})]},e);var o})})]})}function Eu({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 scale-105":"bg-bg-surface-1 border-border text-text-muted hover:text-text-primary hover:border-text-muted/50"),style:t?{boxShadow:"0 2px 10px rgba(var(--accent-rgb), 0.4)"}:void 0,children:e})}function ju({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-wrap items-center gap-2 px-1",children:[s.jsx(Eu,{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(Eu,{label:uu[e]??e,active:t.client===e,onClick:()=>n("client",t.client===e?"all":e)},e)),i.map(e=>s.jsx(Eu,{label:e,active:t.language===e,onClick:()=>n("language",t.language===e?"all":e)},e)),a.map(e=>s.jsx(Eu,{label:e,active:t.project===e,onClick:()=>n("project",t.project===e?"all":e)},e))]}):null}function Pu({onDelete:e,size:t="md",className:n=""}){const[r,i]=f.useState(!1),a=f.useRef(void 0);f.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);const o=t=>{t.stopPropagation(),a.current&&clearTimeout(a.current),i(!1),e()},l=e=>{e.stopPropagation(),a.current&&clearTimeout(a.current),i(!1)},u="sm"===t?"w-3 h-3":"w-3.5 h-3.5",c="sm"===t?"p-1":"p-1.5";return r?s.jsxs("span",{className:\`inline-flex items-center gap-0.5 \${n}\`,onClick:e=>e.stopPropagation(),children:[s.jsx("button",{onClick:o,className:\`\${c} rounded-lg transition-all bg-error/15 text-error hover:bg-error/25\`,title:"Confirm delete",children:s.jsx(Q,{className:u})}),s.jsx("button",{onClick:l,className:\`\${c} rounded-lg transition-all text-text-muted hover:bg-bg-surface-2\`,title:"Cancel",children:s.jsx(Ce,{className:u})})]}):s.jsx("button",{onClick:e=>{e.stopPropagation(),i(!0),a.current=setTimeout(()=>i(!1),5e3)},className:\`\${c} rounded-lg transition-all text-text-muted hover:text-error/70 hover:bg-error/5 \${n}\`,title:"Delete",children:s.jsx(xe,{className:u})})}function Nu(e,t){const n=e=>new Date(e).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0});return\`\${n(e)} \u2014 \${n(t)}\`}function Mu(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 Lu({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 Au({score:e}){const t=e/5*100,n=e>=4?"bg-success":e>=3?"bg-accent":"bg-error",r=e>=4?"bg-success/15":e>=3?"bg-accent/15":"bg-error/15";return s.jsx("span",{className:\`w-7 h-[4px] rounded-full \${r} flex-shrink-0 overflow-hidden\`,title:\`Quality: \${e.toFixed(1)}/5\`,children:s.jsx("span",{className:\`block h-full rounded-full \${n}\`,style:{width:\`\${t}%\`}})})}function _u({evaluation:e,showPublic:t=!1}){const n=[{label:"Prompt",value:e.prompt_quality,reason:e.prompt_quality_reason,Icon:de},{label:"Context",value:e.context_provided,reason:e.context_provided_reason,Icon:ae},{label:"Scope",value:e.scope_quality,reason:e.scope_quality_reason,Icon:be},{label:"Independence",value:e.independence_level,reason:e.independence_level_reason,Icon:te}],r=n.some(e=>e.reason)||e.task_outcome_reason;return s.jsxs("div",{className:"px-2 py-1.5 bg-bg-surface-2/30 rounded-md mb-2",children:[s.jsx("div",{className:"grid grid-cols-2 gap-x-6 gap-y-1.5",children:n.map(({label:e,value:t,Icon:n})=>s.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",children:[s.jsx(n,{className:"w-3 h-3 text-text-muted/50 flex-shrink-0"}),s.jsx("span",{className:"text-text-muted min-w-[58px]",children:e}),s.jsx(Au,{score:t})]},e))}),!t&&r&&s.jsxs("div",{className:"mt-1.5 pt-1.5 border-t border-border/15 space-y-1",children:[e.task_outcome_reason&&s.jsxs("div",{className:"flex items-start gap-1.5 text-[10px]",children:[s.jsx("span",{className:"text-error font-bold flex-shrink-0",children:"Outcome:"}),s.jsx("span",{className:"text-text-muted leading-tight",children:e.task_outcome_reason})]}),n.filter(e=>e.reason).map(({label:e,reason:t})=>s.jsxs("div",{className:"flex items-start gap-1.5 text-[10px]",children:[s.jsxs("span",{className:"text-accent font-bold flex-shrink-0",children:[e,":"]}),s.jsx("span",{className:"text-text-muted leading-tight",children:t})]},e))]}),s.jsxs("div",{className:"flex items-center gap-4 mt-1.5 pt-1.5 border-t border-border/15",children:[s.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",children:[s.jsx(he,{className:"w-3 h-3 text-text-muted/50"}),s.jsx("span",{className:"text-text-muted",children:"Iterations"}),s.jsx("span",{className:"text-text-secondary font-mono font-bold ml-0.5",children:e.iteration_count})]}),s.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",children:[s.jsx(Se,{className:"w-3 h-3 text-text-muted/50"}),s.jsx("span",{className:"text-text-muted",children:"Tools"}),s.jsx("span",{className:"text-text-secondary font-mono font-bold ml-0.5",children:e.tools_leveraged})]})]})]})}function zu({session:e,milestones:t,defaultExpanded:n=!1,externalShowPublic:r,hideClientAvatar:i=!1,hideProject:a=!1,onDeleteSession:o,onDeleteMilestone:l}){const[u,c]=f.useState(n),[d,h]=f.useState(!1),p=r??d,m=h,g=hu(e.client),y=lu[g]??"#91919a",v=cu[g]??g.slice(0,2).toUpperCase(),b=du[g],x=t.length>0,w=e.project?.trim()||"",k=!w||["untitled","mcp","unknown","default","none","null","undefined"].includes(w.toLowerCase()),S=t[0],C=k&&S?S.title:w,T=k&&S?S.private_title||S.title:w;let E=e.private_title||e.title||T||"Untitled Session",j=e.title||C||"Untitled Session";const P=E!==j;return s.jsxs("div",{className:"group/card mb-1 rounded-lg border transition-all duration-200 "+(u?"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:()=>x&&c(!u),style:{cursor:x?"pointer":"default"},children:[!i&&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:\`\${y}15\`,color:y,border:\`1px solid \${y}30\`},title:uu[g]??g,children:b?s.jsx("div",{className:"w-4 h-4",style:{backgroundColor:y,maskImage:\`url(\${b})\`,maskSize:"contain",maskRepeat:"no-repeat",maskPosition:"center",WebkitMaskImage:\`url(\${b})\`,WebkitMaskSize:"contain",WebkitMaskRepeat:"no-repeat",WebkitMaskPosition:"center"}}):v}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("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(Bs,{mode:"wait",children:s.jsxs(au.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:[p?s.jsx(ye,{className:"w-3 h-3 text-success/60 flex-shrink-0"}):s.jsx(ue,{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:p?j:E})]},p?"public":"private")})})}),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(ee,{className:"w-3 h-3 opacity-60"}),Mu(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(Te,{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:Nu(e.started_at,e.ended_at).split(" \u2014 ")[0]}),!p&&!k&&!a&&s.jsxs("span",{className:"flex items-center gap-0.5 text-text-muted/70",title:\`Project: \${w}\`,children:[s.jsx(le,{className:"w-2.5 h-2.5 opacity-60"}),s.jsx("span",{className:"max-w-[100px] truncate",children:w})]}),t.length>0&&s.jsxs("span",{className:"flex items-center gap-0.5",title:\`\${t.length} milestone\${1!==t.length?"s":""}\`,children:[s.jsx(se,{className:"w-2.5 h-2.5 opacity-60"}),t.length]}),e.evaluation&&s.jsx(Au,{score:(N=e.evaluation,(N.prompt_quality+N.context_provided+N.scope_quality+N.independence_level)/4)})]})]})]}),s.jsxs("div",{className:"flex items-center px-2 gap-1.5 border-l border-border/30 h-8 self-center",children:[o&&s.jsx(Pu,{onDelete:()=>o(e.session_id),className:"opacity-0 group-hover/card:opacity-100"}),P&&void 0===r&&s.jsx("button",{onClick:e=>{e.stopPropagation(),m(!p)},className:"p-1.5 rounded-lg transition-all "+(p?"bg-success/10 text-success":"text-text-muted hover:bg-bg-surface-2"),title:p?"Public Mode":"Private Mode",children:p?s.jsx(re,{className:"w-3.5 h-3.5"}):s.jsx(ne,{className:"w-3.5 h-3.5"})}),x&&s.jsx("button",{onClick:()=>c(!u),className:"p-1.5 rounded-lg transition-all "+(u?"text-accent bg-accent/5":"text-text-muted hover:bg-bg-surface-2"),children:s.jsx(G,{className:"w-4 h-4 transition-transform duration-200 "+(u?"rotate-180":"")})})]})]}),s.jsx(Bs,{children:u&&x&&s.jsx(au.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.jsx(_u,{evaluation:e.evaluation,showPublic:p}),s.jsx("div",{className:"space-y-0.5",children:t.map(e=>{e.private_title;const t=p?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:pu[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(Lu,{category:e.category})]})}),n&&s.jsx("span",{className:"text-[10px] text-text-muted font-mono",children:n}),l&&s.jsx(Pu,{onDelete:()=>l(e.id),size:"sm",className:"opacity-0 group-hover:opacity-100"})]},e.id)})})]})})})]});var N}function Ru(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({score:e}){const t=e/5*100,n=e>=4?"bg-success":e>=3?"bg-accent":"bg-error",r=e>=4?"bg-success/15":e>=3?"bg-accent/15":"bg-error/15";return s.jsx("span",{className:\`w-7 h-[4px] rounded-full \${r} flex-shrink-0 overflow-hidden\`,title:\`Quality: \${e.toFixed(1)}/5\`,children:s.jsx("span",{className:\`block h-full rounded-full \${n}\`,style:{width:\`\${t}%\`}})})}function Ou({group:e,defaultExpanded:t,globalShowPublic:n,onDeleteSession:r,onDeleteMilestone:i,onDeleteConversation:a}){const[o,l]=f.useState(t),[u,c]=f.useState(!1),d=n||u;if(1===e.sessions.length){const a=e.sessions[0];return s.jsx(zu,{session:a.session,milestones:a.milestones,defaultExpanded:t&&a.milestones.length>0,externalShowPublic:n||void 0,onDeleteSession:r,onDeleteMilestone:i})}const h=hu(e.sessions[0].session.client),p=lu[h]??"#91919a",m=cu[h]??h.slice(0,2).toUpperCase(),g=du[h],y=e.aggregateEval,v=y?(y.prompt_quality+y.context_provided+y.scope_quality+y.independence_level)/4:0,b=e.sessions[0].session,x=b.private_title||b.title||b.project||"Conversation",w=b.title||b.project||"Conversation",k=x!==w,S=b.project?.trim()||"",C=!!S&&!["untitled","mcp","unknown","default","none","null","undefined"].includes(S.toLowerCase());return s.jsxs("div",{className:"group/conv mb-1 rounded-lg border transition-all duration-200 "+(o?"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:()=>l(!o),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:\`\${p}15\`,color:p,border:\`1px solid \${p}30\`},title:uu[h]??h,children:g?s.jsx("div",{className:"w-4 h-4",style:{backgroundColor:p,maskImage:\`url(\${g})\`,maskSize:"contain",maskRepeat:"no-repeat",maskPosition:"center",WebkitMaskImage:\`url(\${g})\`,WebkitMaskSize:"contain",WebkitMaskRepeat:"no-repeat",WebkitMaskPosition:"center"}}):m}),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(Bs,{mode:"wait",children:s.jsxs(au.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:[d?s.jsx(ye,{className:"w-3 h-3 text-success/60 flex-shrink-0"}):s.jsx(ue,{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:d?w:x})]},d?"public":"private")})}),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 flex-shrink-0",children:[e.sessions.length," prompts"]})]}),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(ee,{className:"w-3 h-3 opacity-60"}),Ru(e.totalDuration)]}),s.jsx("span",{className:"opacity-50 font-mono tracking-tight",children:(T=e.startedAt,new Date(T).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0}))}),!d&&C&&s.jsxs("span",{className:"flex items-center gap-0.5 text-text-muted/70",title:\`Project: \${S}\`,children:[s.jsx(le,{className:"w-2.5 h-2.5 opacity-60"}),s.jsx("span",{className:"max-w-[100px] truncate",children:S})]}),e.totalMilestones>0&&s.jsxs("span",{className:"flex items-center gap-0.5",title:\`\${e.totalMilestones} milestone\${1!==e.totalMilestones?"s":""}\`,children:[s.jsx(se,{className:"w-2.5 h-2.5 opacity-60"}),e.totalMilestones]}),y&&s.jsx(Fu,{score:v})]})]})]}),s.jsxs("div",{className:"flex items-center px-2 gap-1.5 border-l border-border/30 h-8 self-center",children:[a&&e.conversationId&&s.jsx(Pu,{onDelete:()=>a(e.conversationId),className:"opacity-0 group-hover/conv:opacity-100"}),k&&!n&&s.jsx("button",{onClick:()=>c(!u),className:"p-1.5 rounded-lg transition-all "+(d?"bg-success/10 text-success":"text-text-muted hover:bg-bg-surface-2"),title:d?"Public Mode":"Private Mode",children:d?s.jsx(re,{className:"w-3.5 h-3.5"}):s.jsx(ne,{className:"w-3.5 h-3.5"})}),s.jsx("button",{onClick:()=>l(!o),className:"p-1.5 rounded-lg transition-all "+(o?"text-accent bg-accent/5":"text-text-muted hover:bg-bg-surface-2"),children:s.jsx(G,{className:"w-4 h-4 transition-transform duration-200 "+(o?"rotate-180":"")})})]})]}),s.jsx(Bs,{children:o&&s.jsx(au.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.75rem] top-0 bottom-2 w-px",style:{backgroundColor:\`\${p}25\`}}),s.jsx("div",{className:"space-y-1 pl-10",children:e.sessions.map((e,t)=>s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute -left-7 top-5 w-2 h-2 rounded-full border-2",style:{backgroundColor:p,borderColor:\`\${p}40\`}}),s.jsx(zu,{session:e.session,milestones:e.milestones,defaultExpanded:!1,externalShowPublic:d||void 0,hideClientAvatar:!0,hideProject:!0,onDeleteSession:r,onDeleteMilestone:i})]},e.session.session_id))})]})})})]});var T}function Vu({sessions:e,milestones:t,filters:n,globalShowPublic:r,onDeleteSession:i,onDeleteConversation:a,onDeleteMilestone:o}){const l=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]),u=f.useMemo(()=>"all"===n.category?t:t.filter(e=>e.category===n.category),[t,n.category]),c=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}(l,u);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:$(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]):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)},[l,u]);return 0===c.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:c.map((e,t)=>s.jsx(Ou,{group:e,defaultExpanded:!1,globalShowPublic:r,onDeleteSession:i,onDeleteMilestone:o,onDeleteConversation:a},e.conversationId??e.sessions[0].session.session_id))})}function Iu({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(au.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(var(--accent-rgb), \${.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(au.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(var(--accent-rgb), \${.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 $u(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 z("/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(ke,{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: ",$u(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(he,{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 z("/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 z("/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(ge,{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(ce,{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 Uu=P();const Hu={"15m":{visibleDuration:9e5,majorTickInterval:3e5,minorTickInterval:6e4,labelFormat:e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})},"30m":{visibleDuration:18e5,majorTickInterval:6e5,minorTickInterval:12e4,labelFormat:e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})},"1h":{visibleDuration:36e5,majorTickInterval:9e5,minorTickInterval:3e5,labelFormat:e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})},"12h":{visibleDuration:432e5,majorTickInterval:72e5,minorTickInterval:18e5,labelFormat:e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})},"24h":{visibleDuration:864e5,majorTickInterval:144e5,minorTickInterval:36e5,labelFormat:e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})},"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 Wu(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 qu({value:e,onChange:t,scale:n,sessions:r=[],milestones:i=[],showPublic:a=!1}){const o=f.useRef(null),[l,u]=f.useState(0);f.useEffect(()=>{if(!o.current)return;const e=new ResizeObserver(e=>{for(const t of e)u(t.contentRect.width)});return e.observe(o.current),u(o.current.getBoundingClientRect().width),()=>e.disconnect()},[]);const c=Hu[n],d=l>0?l/c.visibleDuration:0,[h,p]=f.useState(!1),m=f.useRef(0),g=f.useCallback(e=>{p(!0),m.current=e.clientX,e.currentTarget.setPointerCapture(e.pointerId)},[]),y=f.useCallback(n=>{if(!h||0===d)return;const r=n.clientX-m.current;m.current=n.clientX,t(e+-r/d)},[h,d,e,t]),v=f.useCallback(()=>{p(!1)},[]),b=f.useMemo(()=>{if(!l||0===d)return[];const t=e-c.visibleDuration,n=e,r=t-c.majorTickInterval,i=n+c.majorTickInterval,a=[];for(let o=Math.ceil(r/c.majorTickInterval)*c.majorTickInterval;o<=i;o+=c.majorTickInterval)a.push({type:"major",time:o,position:(o-e)*d,label:c.labelFormat(new Date(o))});for(let o=Math.ceil(r/c.minorTickInterval)*c.minorTickInterval;o<=i;o+=c.minorTickInterval)o%c.majorTickInterval!==0&&a.push({type:"minor",time:o,position:(o-e)*d});return a},[e,l,d,c]),x=f.useMemo(()=>r.map(e=>({session:e,start:new Date(e.started_at).getTime(),end:new Date(e.ended_at).getTime()})),[r]),w=f.useMemo(()=>{if(!l||0===d)return[];const t=e-c.visibleDuration,n=e;return x.filter(e=>e.start<=n&&e.end>=t).map(r=>({session:r.session,leftOffset:(Math.max(r.start,t)-e)*d,width:(Math.min(r.end,n)-Math.max(r.start,t))*d}))},[x,e,l,d,c]),k=f.useMemo(()=>i.map(e=>({milestone:e,time:new Date(e.created_at).getTime()})).sort((e,t)=>e.time-t.time),[i]),S=f.useMemo(()=>{if(!l||0===d||!k.length)return[];const t=e-c.visibleDuration,n=e;let r=0,i=k.length;for(;r<i;){const e=r+i>>1;k[e].time<t?r=e+1:i=e}const a=r;for(i=k.length;r<i;){const e=r+i>>1;k[e].time<=n?r=e+1:i=e}const o=r,s=[];for(let l=a;l<o;l++){const t=k[l];s.push({...t,offset:(t.time-e)*d})}return s},[k,e,l,d,c]),[C,T]=f.useState(null),E=f.useRef(e);return f.useEffect(()=>{C&&Math.abs(e-E.current)>1e3&&T(null),E.current=e},[e,C]),s.jsxs("div",{className:"relative h-16",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:o,onPointerDown:g,onPointerMove:y,onPointerUp:v,style:{touchAction:"none"},children:[s.jsx("div",{className:"absolute right-0 top-0 bottom-0 w-[2px] bg-accent/40 z-30"}),s.jsxs("div",{className:"absolute right-0 top-0 bottom-0 w-0 pointer-events-none",children:[b.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-2 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)),w.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(var(--accent-rgb), 0.15)",borderTop:"2px solid rgba(var(--accent-rgb), 0.5)",boxShadow:"inset 0 1px 10px rgba(var(--accent-rgb), 0.05)"},onMouseEnter:t=>{const n=t.currentTarget.getBoundingClientRect();T({type:"session",data:e.session,x:n.left+n.width/2,y:n.top})},onMouseLeave:()=>T(null)},e.session.session_id)),S.map((e,n)=>s.jsx("div",{className:"absolute bottom-2 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();T({type:"milestone",data:e.milestone,x:n.left+n.width/2,y:n.top})},onMouseLeave:()=>T(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:pu[e.milestone.category]??"#9c9588",boxShadow:\`0 0 10px \${pu[e.milestone.category]}50\`}})},n))]})]}),C&&Uu.createPortal(s.jsx("div",{className:"fixed z-[9999] pointer-events-none",style:{left:C.x,top:C.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"===C.type?s.jsx(Yu,{session:C.data,showPublic:a}):s.jsx(Xu,{milestone:C.data,showPublic:a}),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 Yu({session:e,showPublic:t}){const n=uu[e.client]??e.client,r=t?e.title||e.project||\`\${n} Session\`:e.private_title||e.title||e.project||\`\${n} Session\`;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:n}),s.jsx("span",{className:"text-[10px] text-text-muted font-mono",children:Wu(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 Xu({milestone:e,showPublic:t}){const n=t?e.title: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:pu[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:n}),!t&&e.private_title&&s.jsxs("div",{className:"text-[10px] text-text-muted italic opacity-70",children:["Public: ",e.title]})]})}const Ku={"15m":9e5,"30m":18e5,"1h":36e5,"12h":432e5,"24h":864e5,"7d":6048e5,"30d":2592e6},Qu={"15m":"15 Minutes","30m":"30 Minutes","1h":"1 Hour","12h":"12 Hours","24h":"24 Hours","7d":"7 Days","30d":"30 Days"};function Gu(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 Zu=["15m","30m","1h","12h","24h","7d","30d"];function Ju({value:e,onChange:t,scale:n,onScaleChange:r,sessions:i,showPublic:a=!1}){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())},C=()=>{if(h(!1),y.current&&p===v.current)return void t(null);const e=Gu(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-3 border-b border-border/50 gap-4",children:[s.jsxs("div",{className:"flex flex-col items-start gap-0.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:C,onKeyDown:e=>{if("Enter"===e.key)return void C();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=Gu(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-xl font-mono font-bold tracking-tight bg-bg-surface-2 border rounded-lg px-2 -ml-2 w-[155px] outline-none text-text-primary "+(o?"border-accent":"border-history"),style:{boxShadow:o?"0 0 10px rgba(var(--accent-rgb), 0.2)":"0 0 10px rgba(var(--history-rgb), 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(ee,{className:"w-5 h-5 "+(o?"text-text-muted":"text-history")}),s.jsx("span",{className:"text-xl font-mono font-bold tracking-tight tabular-nums "+(o?"text-text-primary":"text-history"),children:new Date(c).toLocaleTimeString([],{hour12:!0,hour:"2-digit",minute:"2-digit",second:"2-digit"})})]}),s.jsx("button",{onClick:d?C:S,className:"p-1.5 rounded-lg transition-colors flex-shrink-0 "+(d?o?"bg-accent text-white hover:bg-accent-bright":"bg-history text-white hover:brightness-110":"text-text-muted hover:text-text-primary hover:bg-bg-surface-2"),title:d?"Confirm time":"Edit time",children:s.jsx(fe,{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",style:{boxShadow:"0 0 10px rgba(var(--accent-rgb), 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-history/10 text-history rounded-full border border-history/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(K,{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:Zu.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-bg-surface-3 text-text-primary shadow-sm":"text-text-muted hover:text-text-primary hover:bg-bg-surface-2"),title:Qu[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-history/10 hover:bg-history text-history hover:text-white rounded-xl transition-all border border-history/20",children:[s.jsx(me,{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(-Ku[n]),className:"p-2 text-text-muted hover:text-text-primary hover:bg-bg-surface-2 rounded-lg transition-colors",title:\`Back \${Qu[n]}\`,children:s.jsx(Z,{className:"w-4 h-4"})}),s.jsx("button",{onClick:()=>k(Ku[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 \${Qu[n]}\`,disabled:o||c>=Date.now()-1e3,children:s.jsx(J,{className:"w-4 h-4"})})]})]})]})]}),s.jsx(qu,{value:c,onChange:w,scale:n,sessions:i,milestones:void 0,showPublic:a})]})}const ec={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 tc({children:e}){return s.jsx("span",{className:"text-text-primary font-medium",children:e})}function nc({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(tc,{children:e.length})," ",1===e.length?"session":"sessions",","," ",s.jsx(tc,{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=ec[t]??ec.other,o=1===n?a.noun:a.plural,l="feature"===t&&r>0?s.jsxs("span",{children:[" ","(",s.jsx(tc,{children:r})," complex)"]},\`\${t}-complex\`):null;i.push(s.jsxs("span",{children:[a.verb," ",s.jsx(tc,{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=uu[o[0]]??o[0];n.push(s.jsxs("span",{children:[". Most active: ",s.jsx(tc,{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(tc,{children:e})]},"lang"))}return n.push(s.jsx("span",{children:"."},"end")),s.jsx(s.Fragment,{children:n})}(e,t),[e,t]);return s.jsx(au.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(ve,{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 rc({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(au.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(be,{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(au.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 ic=["Output","Efficiency","Prompts","Consistency","Breadth"];function ac(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 oc(e,t,n,r){const i=[];for(let a=0;a<5;a++){const[o,s]=ac(a,e,t,n,r);i.push(\`\${o},\${s}\`)}return i.join(" ")}function sc({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]=ac(s,e,a,o,70);l.push(\`\${t},\${n}\`)}const u=l.join(" ");return s.jsxs(au.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(Y,{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:oc(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]=ac(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(au.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]=ac(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}\`)}),ic.map((e,t)=>{const n=function(e,t,n,r){const[i,a]=ac(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:ic.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 lc={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 uc(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 cc({milestones:e,showPublic:t=!1}){const n=[...e].sort((e,t)=>new Date(t.created_at).getTime()-new Date(e.created_at).getTime()).slice(0,8);return s.jsxs(au.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(we,{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===n.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:n.map((e,n)=>{const r=pu[e.category]??"#9c9588",i=lc[e.category]??"bg-bg-surface-2 text-text-secondary border-border",a=cu[e.client]??e.client.slice(0,2).toUpperCase(),o=lu[e.client]??"#91919a",l=t?e.title:e.private_title||e.title,u="complex"===e.complexity;return s.jsxs(au.div,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:{duration:.25,delay:.04*n},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:r}}),s.jsx("span",{className:"text-sm font-medium text-text-secondary hover:text-text-primary truncate flex-1 min-w-0",children:l}),s.jsx("span",{className:\`text-[9px] uppercase tracking-wider font-bold px-1.5 py-0.5 rounded-full border flex-shrink-0 \${i}\`,children:e.category}),u&&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(Y,{className:"w-2.5 h-2.5"}),"complex"]}),s.jsx("span",{className:"text-[10px] text-text-muted font-mono flex-shrink-0",children:uc(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:\`\${o}15\`,color:o,border:\`1px solid \${o}20\`},children:a})]},e.id)})})]})}function dc({filteredSessions:e,filteredMilestones:t,filters:n,onFilterChange:r,onDeleteSession:i,onDeleteConversation:a,onDeleteMilestone:o,globalShowPublic:l,onToggleShowPublic:u}){const[c,d]=f.useState(!1),h="all"!==n.client||"all"!==n.language||"all"!==n.project;return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between px-1",children:[s.jsxs("div",{className:"flex items-center gap-2",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:[e.length," Sessions"]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:u,className:"p-1.5 rounded-md border transition-all duration-200 "+(l?"bg-success/10 border-success/30 text-success":"bg-bg-surface-1 border-border/50 text-text-muted hover:text-text-primary hover:border-text-muted/50"),title:l?"Showing public titles":"Showing private titles",children:l?s.jsx(re,{className:"w-3.5 h-3.5"}):s.jsx(ne,{className:"w-3.5 h-3.5"})}),s.jsx("button",{onClick:()=>d(e=>!e),className:"p-1.5 rounded-md border transition-all duration-200 "+(c||h?"bg-accent/10 border-accent/30 text-accent":"bg-bg-surface-1 border-border/50 text-text-muted hover:text-text-primary hover:border-text-muted/50"),children:s.jsx(oe,{className:"w-3.5 h-3.5"})})]})]}),c&&s.jsx(ju,{sessions:e,filters:n,onFilterChange:r}),s.jsx(Vu,{sessions:e,milestones:t,filters:n,globalShowPublic:l,onDeleteSession:i,onDeleteConversation:a,onDeleteMilestone:o})]})}function fc(){const{sessions:e,milestones:t,config:n,health:r,loading:i,timeTravelTime:a,timeScale:o,filters:l,activeTab:u,loadAll:c,loadHealth:d,setTimeTravelTime:h,setTimeScale:p,setFilter:m,setActiveTab:g,deleteSession:y,deleteConversation:v,deleteMilestone:b}=O();f.useEffect(()=>{c(),d()},[c,d]),f.useEffect(()=>{const e=setInterval(d,3e4);if(null!==a)return()=>clearInterval(e);const t=setInterval(c,3e4);return()=>{clearInterval(e),clearInterval(t)}},[a,c,d]);const[x,w]=f.useState(null),[k,S]=f.useState(!1),C=null===a,T=a??Date.now(),E=T-F[o],j=T,P=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,E,j),[e,E,j]),N=f.useMemo(()=>function(e,t,n){return e.filter(e=>{const r=new Date(e.created_at).getTime();return r>=t&&r<=n})}(t,E,j),[t,E,j]),M=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:I(e),filesTouched:r,...l,byClient:i,byLanguage:a,byTaskType:o,byProject:s}}(P,N),[P,N]),D=f.useMemo(()=>I(e),[e]),L=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"})}(E,j,C),[E,j,C]),A=f.useMemo(()=>{if(!C)return new Date(T).toISOString().slice(0,10)},[C,T]);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 pb-6",children:[s.jsx(Ne,{health:r,timeContextLabel:L,activeTab:u,onTabChange:g}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ju,{value:a,onChange:h,scale:o,onScaleChange:p,sessions:e,milestones:t,showPublic:k}),s.jsx(su,{totalHours:M.totalHours,totalSessions:M.totalSessions,currentStreak:D,filesTouched:M.filesTouched,featuresShipped:M.featuresShipped,bugsFixed:M.bugsFixed,complexSolved:M.complexSolved,selectedCard:x,onCardClick:w}),s.jsx(vu,{type:x,milestones:N,showPublic:k,onClose:()=>w(null)}),"sessions"===u&&s.jsx(dc,{filteredSessions:P,filteredMilestones:N,filters:l,onFilterChange:m,onDeleteSession:y,onDeleteConversation:v,onDeleteMilestone:b,globalShowPublic:k,onToggleShowPublic:()=>S(e=>!e)}),"insights"===u&&s.jsxs("div",{className:"space-y-4 pt-2",children:[s.jsx(nc,{sessions:P,milestones:N,isLive:C,windowStart:E,windowEnd:j}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsx(rc,{sessions:P}),s.jsx(sc,{sessions:P,milestones:N,streak:D})]}),s.jsx(Tu,{byTaskType:M.byTaskType}),s.jsx(Iu,{sessions:e,timeScale:o,effectiveTime:T,isLive:C,onDayClick:e=>{const t=new Date(\`\${e}T23:59:59\`).getTime();h(t),p("24h")},highlightDate:A}),s.jsx(cc,{milestones:N,showPublic:k}),s.jsx(ku,{stats:M})]}),s.jsx(Bu,{config:n,onRefresh:c})]})]})})}M.createRoot(document.getElementById("root")).render(s.jsx(f.StrictMode,{children:s.jsx(fc,{})}));</script>
|
|
36638
36643
|
<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-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--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-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--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);--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-tight:1.25;--leading-snug:1.375;--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-history:var(--history);--color-success:var(--accent);--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}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.-top-10{top:calc(var(--spacing)*-10)}.top-0{top:calc(var(--spacing)*0)}.top-2{top:calc(var(--spacing)*2)}.top-5{top:calc(var(--spacing)*5)}.right-0{right:calc(var(--spacing)*0)}.-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)}.-left-7{left:calc(var(--spacing)*-7)}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-\\[1\\.75rem\\]{left:1.75rem}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.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-6{margin-inline:calc(var(--spacing)*-6)}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-auto{margin-inline:auto}.my-0\\.5{margin-block:calc(var(--spacing)*.5)}.my-1{margin-block:calc(var(--spacing)*1)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\\.5{margin-top:calc(var(--spacing)*1.5)}.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-8{margin-bottom:calc(var(--spacing)*8)}.-ml-2{margin-left:calc(var(--spacing)*-2)}.ml-0\\.5{margin-left:calc(var(--spacing)*.5)}.ml-1\\.5{margin-left:calc(var(--spacing)*1.5)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.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-6{height:calc(var(--spacing)*6)}.h-8{height:calc(var(--spacing)*8)}.h-16{height:calc(var(--spacing)*16)}.h-\\[4px\\]{height:4px}.h-full{height:100%}.h-px{height:1px}.min-h-screen{min-height:100vh}.w-0{width:calc(var(--spacing)*0)}.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-7{width:calc(var(--spacing)*7)}.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-\\[155px\\]{width:155px}.w-full{width:100%}.w-px{width:1px}.max-w-\\[100px\\]{max-width:100px}.max-w-\\[280px\\]{max-width:280px}.max-w-\\[1000px\\]{max-width:1000px}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[58px\\]{min-width:58px}.min-w-\\[120px\\]{min-width:120px}.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))}.grid-cols-3{grid-template-columns:repeat(3,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-2\\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.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)))}:where(.space-y-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)))}.gap-x-6{column-gap:calc(var(--spacing)*6)}.gap-y-1\\.5{row-gap:calc(var(--spacing)*1.5)}.self-center{align-self:center}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.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-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)}.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-accent\\/50{border-color:var(--color-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\\/50{border-color:color-mix(in oklab,var(--color-accent)50%,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\\/15{border-color:var(--color-border)}@supports (color:color-mix(in lab,red,red)){.border-border\\/15{border-color:color-mix(in oklab,var(--color-border)15%,transparent)}}.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\\/40{border-color:var(--color-border)}@supports (color:color-mix(in lab,red,red)){.border-border\\/40{border-color:color-mix(in oklab,var(--color-border)40%,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-history,.border-history\\/20{border-color:var(--color-history)}@supports (color:color-mix(in lab,red,red)){.border-history\\/20{border-color:color-mix(in oklab,var(--color-history)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-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:var(--color-success)}@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:var(--color-success)}@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)}}.border-transparent{border-color:#0000}.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-accent\\/40{background-color:var(--color-accent)}@supports (color:color-mix(in lab,red,red)){.bg-accent\\/40{background-color:color-mix(in oklab,var(--color-accent)40%,transparent)}}.bg-bg-base,.bg-bg-base\\/80{background-color:var(--color-bg-base)}@supports (color:color-mix(in lab,red,red)){.bg-bg-base\\/80{background-color:color-mix(in oklab,var(--color-bg-base)80%,transparent)}}.bg-bg-surface-1,.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-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-black\\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\\/40{background-color:color-mix(in oklab,var(--color-black)40%,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\\/30{background-color:var(--color-border)}@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: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{background-color:var(--color-error)}.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-history,.bg-history\\/10{background-color:var(--color-history)}@supports (color:color-mix(in lab,red,red)){.bg-history\\/10{background-color:color-mix(in oklab,var(--color-history)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-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,.bg-success\\/10{background-color:var(--color-success)}@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:var(--color-success)}@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-0\\.5{padding:calc(var(--spacing)*.5)}.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-5{padding-inline:calc(var(--spacing)*5)}.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-4{padding-block:calc(var(--spacing)*4)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-16{padding-block:calc(var(--spacing)*16)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-1\\.5{padding-top:calc(var(--spacing)*1.5)}.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)}.pb-6{padding-bottom:calc(var(--spacing)*6)}.pl-3{padding-left:calc(var(--spacing)*3)}.pl-10{padding-left:calc(var(--spacing)*10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.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-\\[7px\\]{font-size:7px}.text-\\[8px\\]{font-size:8px}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.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\\/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-history{color:var(--color-history)}.text-purple{color:var(--color-purple)}.text-success,.text-success\\/60{color:var(--color-success)}@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\\/30{color:var(--color-text-muted)}@supports (color:color-mix(in lab,red,red)){.text-text-muted\\/30{color:color-mix(in oklab,var(--color-text-muted)30%,transparent)}}.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\\/70{color:var(--color-text-muted)}@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-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-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{--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)}.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)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.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-150{--tw-duration:.15s;transition-duration:.15s}.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 *),.group-hover\\/card\\:opacity-100:is(:where(.group\\/card):hover *),.group-hover\\/conv\\:opacity-100:is(:where(.group\\/conv):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-bright:hover{background-color:var(--color-accent-bright)}.hover\\:bg-bg-surface-1:hover{background-color:var(--color-bg-surface-1)}.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\\:bg-error\\/5:hover{background-color:#ef44440d}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-error\\/5:hover{background-color:color-mix(in oklab,var(--color-error)5%,transparent)}}.hover\\:bg-error\\/25:hover{background-color:#ef444440}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-error\\/25:hover{background-color:color-mix(in oklab,var(--color-error)25%,transparent)}}.hover\\:bg-history:hover{background-color:var(--color-history)}.hover\\:text-error\\/70:hover{color:#ef4444b3}@supports (color:color-mix(in lab,red,red)){.hover\\:text-error\\/70:hover{color:color-mix(in oklab,var(--color-error)70%,transparent)}}.hover\\:text-text-primary:hover{color:var(--color-text-primary)}.hover\\:text-white:hover{color:var(--color-white)}.hover\\:opacity-80:hover{opacity:.8}.hover\\:brightness-110:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}}.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\\:flex-row{flex-direction:row}.md\\:items-center{align-items:center}}@media(min-width:64rem){.lg\\:grid-cols-5{grid-template-columns:repeat(5,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:#b4f82c;--accent-rgb:180,248,44;--accent-bright:#d4fc6e;--accent-dim:#4d7c0f;--border:#27272a;--border-accent:rgba(var(--accent-rgb),.2);--glass-bg:#18181bb3;--glass-border:#ffffff0d;--streak:#f59e0b;--streak-bg:#f59e0b0f;--streak-border:#f59e0b33;--streak-muted:#f59e0b80;--history:#60a5fa;--history-rgb:96,165,250}@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:#65a30d;--accent-rgb:101,163,13;--accent-bright:#84cc16;--accent-dim:#f7fee7;--border:#e4e4e7;--border-accent:rgba(var(--accent-rgb),.1);--glass-bg:#ffffffb3;--glass-border:#0000000d;--streak:#b45309;--streak-bg:#b453090f;--streak-border:#b4530933;--streak-muted:#b4530980;--history:#2563eb;--history-rgb:37,99,235}}::selection{background:rgba(var(--accent-rgb),.3);color:var(--color-text-primary)}::-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:"";background:linear-gradient(45deg,transparent,rgba(var(--accent-rgb),.1),transparent);border-radius:inherit;z-index:-1;pointer-events:none;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-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@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>
|
|
36639
36644
|
</head>
|
|
36640
36645
|
<body>
|
|
@@ -36945,7 +36950,7 @@ __export(daemon_exports, {
|
|
|
36945
36950
|
});
|
|
36946
36951
|
import { createServer } from "http";
|
|
36947
36952
|
import { createHash as createHash4, randomUUID as randomUUID4 } from "crypto";
|
|
36948
|
-
import { existsSync as existsSync11, readdirSync, readFileSync as readFileSync5, appendFileSync as appendFileSync2, renameSync as renameSync3, writeFileSync as writeFileSync5, unlinkSync as unlinkSync6 } from "fs";
|
|
36953
|
+
import { existsSync as existsSync11, readdirSync, readFileSync as readFileSync5, appendFileSync as appendFileSync2, renameSync as renameSync3, writeFileSync as writeFileSync5, unlinkSync as unlinkSync6, statSync } from "fs";
|
|
36949
36954
|
import { join as join10 } from "path";
|
|
36950
36955
|
function getActiveUseaiSessionIds() {
|
|
36951
36956
|
const ids = /* @__PURE__ */ new Set();
|
|
@@ -37055,12 +37060,22 @@ function sealOrphanFile(sessionId) {
|
|
|
37055
37060
|
function sealOrphanedSessions() {
|
|
37056
37061
|
if (!existsSync11(ACTIVE_DIR)) return;
|
|
37057
37062
|
const activeIds = getActiveUseaiSessionIds();
|
|
37063
|
+
const mcpMap = readMcpMap();
|
|
37064
|
+
const mappedUseaiIds = new Set(Object.values(mcpMap));
|
|
37058
37065
|
let sealed = 0;
|
|
37059
37066
|
try {
|
|
37060
37067
|
const files = readdirSync(ACTIVE_DIR).filter((f) => f.endsWith(".jsonl"));
|
|
37061
37068
|
for (const file of files) {
|
|
37062
37069
|
const sessionId = file.replace(".jsonl", "");
|
|
37063
37070
|
if (activeIds.has(sessionId)) continue;
|
|
37071
|
+
if (mappedUseaiIds.has(sessionId)) {
|
|
37072
|
+
try {
|
|
37073
|
+
const mtime = statSync(join10(ACTIVE_DIR, file)).mtimeMs;
|
|
37074
|
+
if (Date.now() - mtime < IDLE_TIMEOUT_MS) continue;
|
|
37075
|
+
} catch {
|
|
37076
|
+
continue;
|
|
37077
|
+
}
|
|
37078
|
+
}
|
|
37064
37079
|
sealOrphanFile(sessionId);
|
|
37065
37080
|
sealed++;
|
|
37066
37081
|
}
|