@winspan/claude-forge 1.52.1 → 1.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/convention/convention-manager.d.ts.map +1 -1
- package/dist/convention/convention-manager.js +4 -1
- package/dist/convention/convention-manager.js.map +1 -1
- package/dist/daemon/handlers/stages/09-pipeline-active.d.ts.map +1 -1
- package/dist/daemon/handlers/stages/09-pipeline-active.js +18 -12
- package/dist/daemon/handlers/stages/09-pipeline-active.js.map +1 -1
- package/dist/pipeline/index.d.ts +2 -1
- package/dist/pipeline/index.d.ts.map +1 -1
- package/dist/pipeline/index.js +84 -19
- package/dist/pipeline/index.js.map +1 -1
- package/dist/storage/sqlite.d.ts.map +1 -1
- package/dist/storage/sqlite.js +9 -1
- package/dist/storage/sqlite.js.map +1 -1
- package/dist/web/routes/node-types.d.ts.map +1 -1
- package/dist/web/routes/node-types.js +20 -1
- package/dist/web/routes/node-types.js.map +1 -1
- package/dist/web-static/assets/{index-BZZGGDAf.js → index-IOh9Pj5N.js} +2 -2
- package/dist/web-static/index.html +1 -1
- package/package.json +1 -1
|
@@ -16,7 +16,7 @@ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}
|
|
|
16
16
|
`);return e===-1?``:t.stack.slice(e+1)})();try{if(!e.stack)e.stack=n;else if(n){let t=n.indexOf(`
|
|
17
17
|
`),r=t===-1?-1:n.indexOf(`
|
|
18
18
|
`,t+1),i=r===-1?``:n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+=`
|
|
19
|
-
`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=No(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&ss.assertOptions(n,{silentJSONParsing:cs.transitional(cs.boolean),forcedJSONParsing:cs.transitional(cs.boolean),clarifyTimeoutError:cs.transitional(cs.boolean),legacyInterceptorReqResOrdering:cs.transitional(cs.boolean)},!1),r!=null&&(V.isFunction(r)?t.paramsSerializer={serialize:r}:ss.assertOptions(r,{encode:cs.function,serialize:cs.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),ss.assertOptions(t,{baseUrl:cs.spelling(`baseURL`),withXsrfToken:cs.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&V.merge(i.common,i[t.method]);i&&V.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`common`],e=>{delete i[e]}),t.headers=go.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||Ba;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[ns.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=ns.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=No(this.defaults,e),Ra(jo(e.baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};V.forEach([`delete`,`get`,`head`,`options`],function(e){ls.prototype[e]=function(t,n){return this.request(No(n||{},{method:e,url:t,data:(n||{}).data}))}}),V.forEach([`post`,`put`,`patch`],function(e){function t(t){return function(n,r,i){return this.request(No(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}ls.prototype[e]=t(),ls.prototype[e+`Form`]=t(!0)});var us=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new yo(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function ds(e){return function(t){return e.apply(null,t)}}function fs(e){return V.isObject(e)&&e.isAxiosError===!0}var ps={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ps).forEach(([e,t])=>{ps[t]=e});function ms(e){let t=new ls(e),n=_i(ls.prototype.request,t);return V.extend(n,ls.prototype,t,{allOwnKeys:!0}),V.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return ms(No(e,t))},n}var hs=ms(to);hs.Axios=ls,hs.CanceledError=yo,hs.CancelToken=us,hs.isCancel=vo,hs.VERSION=rs,hs.toFormData=Na,hs.AxiosError=H,hs.Cancel=hs.CanceledError,hs.all=function(e){return Promise.all(e)},hs.spread=ds,hs.isAxiosError=fs,hs.mergeConfig=No,hs.AxiosHeaders=go,hs.formToJSON=e=>Qa(V.isHTMLForm(e)?new FormData(e):e),hs.getAdapter=es.getAdapter,hs.HttpStatusCode=ps,hs.default=hs;var gs=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),_s=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),vs=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),ys=e=>{let t=vs(e);return t.charAt(0).toUpperCase()+t.slice(1)},bs={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},xs=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Ss=(0,z.createContext)({}),Cs=()=>(0,z.useContext)(Ss),ws=(0,z.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Cs()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,z.createElement)(`svg`,{ref:c,...bs,width:t??l??bs.width,height:t??l??bs.height,stroke:e??f,strokeWidth:m,className:gs(`lucide`,p,i),...!a&&!xs(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,z.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),U=(e,t)=>{let n=(0,z.forwardRef)(({className:n,...r},i)=>(0,z.createElement)(ws,{ref:i,iconNode:t,className:gs(`lucide-${_s(ys(e))}`,`lucide-${e}`,n),...r}));return n.displayName=ys(e),n},Ts=U(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),Es=U(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),Ds=U(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Os=U(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),ks=U(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),As=U(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),js=U(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Ms=U(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),Ns=U(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),Ps=U(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),Fs=U(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),Is=U(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),Ls=U(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Rs=U(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),zs=U(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Bs=U(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Vs=U(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Hs=U(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Us=U(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Ws=U(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Gs=U(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Ks=U(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),qs=U(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Js=U(`command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),Ys=U(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Xs=U(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),Zs=U(`dollar-sign`,[[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`22`,key:`7eqyqh`}],[`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`,key:`1b0p4s`}]]),Qs=U(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),$s=U(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),ec=U(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),tc=U(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),nc=U(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),rc=U(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),ic=U(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),ac=U(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),oc=U(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),sc=U(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),cc=U(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]),lc=U(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),uc=U(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),dc=U(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),fc=U(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),pc=U(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),mc=U(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),hc=U(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),gc=U(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),_c=U(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),vc=U(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),yc=U(`pen`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),bc=U(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),xc=U(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Sc=U(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Cc=U(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),wc=U(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Tc=U(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Ec=U(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Dc=U(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Oc=U(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),kc=U(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Ac=U(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),jc=U(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Mc=U(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),Nc=U(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Pc=U(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),Fc=U(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Ic=U(`test-tube`,[[`path`,{d:`M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2`,key:`125lnx`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}],[`path`,{d:`M14.5 16h-5`,key:`1ox875`}]]),Lc=U(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Rc=U(`trending-up`,[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]),zc=U(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Bc=U(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Vc=U(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),Hc=U(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Uc=U(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Wc=U(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),Gc=u(y(),1),Kc=u(_(),1),qc=(0,z.createContext)({toast:()=>{}}),Jc=()=>{};function Yc(e,t=`error`){Jc(e,t)}function Xc({children:e}){let[t,n]=(0,z.useState)([]),r={current:0},i=(0,z.useCallback)((e,t=`error`)=>{let i=++r.current;n(n=>[...n,{id:i,type:t,message:e}]),setTimeout(()=>n(e=>e.filter(e=>e.id!==i)),4e3)},[]);(0,z.useEffect)(()=>{Jc=i},[i]);let a={success:Us,error:Gs,warning:zc},o={success:`bg-green-50 border-green-200 text-green-800`,error:`bg-red-50 border-red-200 text-red-800`,warning:`bg-yellow-50 border-yellow-200 text-yellow-800`},s={success:`text-green-500`,error:`text-red-500`,warning:`text-yellow-500`};return(0,B.jsxs)(qc.Provider,{value:{toast:i},children:[e,(0,Kc.createPortal)((0,B.jsx)(`div`,{className:`fixed bottom-4 right-4 z-[9999] flex flex-col gap-2 max-w-sm`,children:t.map(e=>{let t=a[e.type];return(0,B.jsxs)(`div`,{className:`flex items-start gap-3 px-4 py-3 rounded-lg border shadow-lg text-sm ${o[e.type]}`,children:[(0,B.jsx)(t,{className:`h-4 w-4 mt-0.5 flex-shrink-0 ${s[e.type]}`}),(0,B.jsx)(`span`,{className:`flex-1`,children:e.message}),(0,B.jsx)(`button`,{onClick:()=>n(t=>t.filter(t=>t.id!==e.id)),children:(0,B.jsx)(Uc,{className:`h-3.5 w-3.5 opacity-60 hover:opacity-100`})})]},e.id)})}),document.body)]})}var W=hs.create({baseURL:`/api`,timeout:3e4});W.interceptors.response.use(e=>e,e=>(Yc(e.response?.data?.error||e.response?.data?.message||e.message||`请求失败`,`error`),Promise.reject(e)));var Zc=()=>W.get(`/health`),Qc=()=>W.get(`/config`),$c=e=>W.put(`/config`,e),el=()=>W.get(`/config/history`),tl=e=>W.get(`/sessions`,{params:e}),nl=e=>W.get(`/sessions/${e}`),rl=e=>W.delete(`/sessions/${e}`),il=e=>W.delete(`/sessions`,{data:{ids:e}}),al=e=>W.get(`/events`,{params:e}),ol=e=>W.get(`/events/stats`,{params:{project_path:e}}),sl=e=>W.get(`/pipelines`,{params:e}),cl=e=>W.get(`/pipelines/${e}`),ll=e=>W.get(`/quality/history`,{params:e}),ul=e=>W.get(`/quality/unresolved`,{params:{project_path:e}}),dl=()=>W.get(`/stats/roi`),fl=()=>W.get(`/stats/overview`),pl=(e,t,n)=>W.get(`/knowledge/search`,{params:{q:e,project_path:t,node_type:n}}),ml=e=>W.get(`/knowledge/overview`,{params:{project_path:e}}),hl=(e,t)=>W.get(`/knowledge/neighbors`,{params:{node_id:e,project_path:t}}),gl=(e,t)=>W.get(`/knowledge/graph`,{params:{project_path:e,node_type:t}}),_l=e=>W.post(`/knowledge/nodes`,e),vl=(e,t)=>W.put(`/knowledge/nodes/${e}`,t),yl=e=>W.delete(`/knowledge/nodes/${e}`),bl=e=>W.post(`/pipelines/${e}/close`),xl=e=>W.post(`/pipelines/batch-close`,{ids:e}),Sl=()=>W.post(`/pipelines/close-expired`),Cl=()=>W.get(`/pipelines/active`),wl=e=>W.post(`/pipelines/${e}/resume`),Tl=e=>W.get(`/projects`,{params:e}),El=e=>W.get(`/projects/${e}`),Dl=e=>W.delete(`/projects/${e}`),Ol=e=>W.post(`/convention/init`,{path:e},{timeout:18e4}),kl=e=>W.get(`/projects/${e}/conventions`),Al=(e,t)=>W.post(`/projects/${e}/conventions/bind`,{conventionId:t}),jl=(e,t)=>W.delete(`/projects/${e}/conventions/${encodeURIComponent(t)}`),Ml=e=>W.get(`/projects/${e}/conventions/custom/yaml`),Nl=(e,t)=>W.put(`/projects/${e}/conventions/custom`,{yaml:t}),Pl=e=>W.post(`/projects/${e}/conventions/distill`,{},{timeout:12e4}),Fl=e=>W.get(`/claudemd/${e}`),Il=(e,t)=>W.put(`/claudemd/${e}`,{content:t}),Ll=e=>W.get(`/claudemd/${e}/profile`),Rl=e=>W.get(`/claudemd/${e}/modules`),zl=e=>W.post(`/claudemd/${e}/distill`,void 0,{timeout:18e4}),Bl=e=>W.post(`/claudemd/${e}/init`,void 0,{timeout:18e4}),Vl=e=>W.post(`/quality/${e}/resolve`),Hl=e=>W.post(`/quality/${e}/dismiss`),Ul=e=>W.post(`/quality/batch-dismiss`,{ids:e}),Wl=()=>W.post(`/quality/resolve-all`),Gl=e=>W.get(`/quality/${e}/context`),Kl=()=>W.get(`/daemon/status`),ql=()=>W.post(`/daemon/restart`),Jl=()=>W.get(`/daemon/diagnose`),Yl=()=>W.post(`/daemon/repair`),Xl=()=>W.post(`/config/backup`),Zl=()=>W.get(`/config/backups`),Ql=e=>`/api/config/backups/${encodeURIComponent(e)}`,$l=e=>W.post(`/events/purge`,{retentionDays:e}),eu=e=>W.get(`/stats/api-usage`,{params:{days:e}}),tu=e=>W.get(`/skills`,{params:e}),nu=()=>W.get(`/skills/status`),ru=e=>W.get(`/skills/${encodeURIComponent(e)}`),iu=(e,t)=>W.post(`/skills/search`,{query:e,...t},{timeout:3e4}),au=e=>W.post(`/skills/install`,{url:e},{timeout:6e4}),ou=e=>W.delete(`/skills/${encodeURIComponent(e)}`),su=e=>W.post(`/skills/batch-delete`,{names:e}),cu=()=>W.post(`/skills/evolve`,{},{timeout:12e4}),lu=()=>W.post(`/skills/distill`,{},{timeout:12e4}),uu=()=>W.post(`/skills/repair`,{},{timeout:6e4}),du=()=>W.get(`/conventions`),fu=e=>W.get(`/conventions/${encodeURIComponent(e)}`),pu=()=>W.post(`/conventions/sync-official`),mu=e=>W.post(`/conventions/install`,{url:e},{timeout:3e4}),hu=e=>W.delete(`/conventions/${encodeURIComponent(e)}`),gu=()=>W.get(`/conventions/usage-stats`),_u=e=>W.get(`/conventions/${encodeURIComponent(e)}/evolution-history`),vu=e=>W.post(`/conventions/batch-evolve`,{conventionIds:e},{timeout:12e4}),yu=e=>W.get(`/conventions/${encodeURIComponent(e)}/yaml`),bu=(e,t)=>W.put(`/conventions/${encodeURIComponent(e)}/yaml`,{yaml:t}),xu=()=>W.get(`/node-types`),Su=e=>W.get(`/node-types/${encodeURIComponent(e)}`);function Cu(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Cu(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function wu(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Cu(e))&&(r&&(r+=` `),r+=t);return r}var Tu=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Eu=(e,t)=>({classGroupId:e,validator:t}),Du=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ou=`-`,ku=[],Au=`arbitrary..`,ju=e=>{let t=Pu(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Nu(e);let n=e.split(Ou);return Mu(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Tu(i,t):t:i||ku}return n[e]||ku}}},Mu=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Mu(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Ou):e.slice(t).join(Ou),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Nu=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Au+r:void 0})(),Pu=e=>{let{theme:t,classGroups:n}=e;return Fu(n,t)},Fu=(e,t)=>{let n=Du();for(let r in e){let i=e[r];Iu(i,n,r,t)}return n},Iu=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Lu(i,t,n,r)}},Lu=(e,t,n,r)=>{if(typeof e==`string`){Ru(e,t,n);return}if(typeof e==`function`){zu(e,t,n,r);return}Bu(e,t,n,r)},Ru=(e,t,n)=>{let r=e===``?t:Vu(t,e);r.classGroupId=n},zu=(e,t,n,r)=>{if(Hu(e)){Iu(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Eu(n,e))},Bu=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Iu(o,Vu(t,a),n,r)}},Vu=(e,t)=>{let n=e,r=t.split(Ou),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Du(),n.nextPart.set(t,i)),n=i}return n},Hu=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Uu=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Wu=`!`,Gu=`:`,Ku=[],qu=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ju=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Gu){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Wu)?(c=s.slice(0,-1),l=!0):s.startsWith(Wu)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return qu(t,l,c,u)};if(t){let e=t+Gu,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):qu(Ku,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Yu=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Xu=e=>({cache:Uu(e.cacheSize),parseClassName:Ju(e),sortModifiers:Yu(e),...ju(e)}),Zu=/\s+/,Qu=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(Zu),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+Wu:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},$u=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=ed(n))&&(i&&(i+=` `),i+=r);return i},ed=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=ed(e[r]))&&(n&&(n+=` `),n+=t);return n},td=(e,...t)=>{let n,r,i,a,o=o=>(n=Xu(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Qu(e,n);return i(e,a),a};return a=o,(...e)=>a($u(...e))},nd=[],rd=e=>{let t=t=>t[e]||nd;return t.isThemeGetter=!0,t},id=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ad=/^\((?:(\w[\w-]*):)?(.+)\)$/i,od=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,sd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cd=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ld=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ud=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fd=e=>od.test(e),pd=e=>!!e&&!Number.isNaN(Number(e)),md=e=>!!e&&Number.isInteger(Number(e)),hd=e=>e.endsWith(`%`)&&pd(e.slice(0,-1)),gd=e=>sd.test(e),_d=()=>!0,vd=e=>cd.test(e)&&!ld.test(e),yd=()=>!1,bd=e=>ud.test(e),xd=e=>dd.test(e),Sd=e=>!G(e)&&!K(e),Cd=e=>Rd(e,Hd,yd),G=e=>id.test(e),wd=e=>Rd(e,Ud,vd),Td=e=>Rd(e,Wd,pd),Ed=e=>Rd(e,Kd,_d),Dd=e=>Rd(e,Gd,yd),Od=e=>Rd(e,Bd,yd),kd=e=>Rd(e,Vd,xd),Ad=e=>Rd(e,qd,bd),K=e=>ad.test(e),jd=e=>zd(e,Ud),Md=e=>zd(e,Gd),Nd=e=>zd(e,Bd),Pd=e=>zd(e,Hd),Fd=e=>zd(e,Vd),Id=e=>zd(e,qd,!0),Ld=e=>zd(e,Kd,!0),Rd=(e,t,n)=>{let r=id.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},zd=(e,t,n=!1)=>{let r=ad.exec(e);return r?r[1]?t(r[1]):n:!1},Bd=e=>e===`position`||e===`percentage`,Vd=e=>e===`image`||e===`url`,Hd=e=>e===`length`||e===`size`||e===`bg-size`,Ud=e=>e===`length`,Wd=e=>e===`number`,Gd=e=>e===`family-name`,Kd=e=>e===`number`||e===`weight`,qd=e=>e===`shadow`,Jd=td(()=>{let e=rd(`color`),t=rd(`font`),n=rd(`text`),r=rd(`font-weight`),i=rd(`tracking`),a=rd(`leading`),o=rd(`breakpoint`),s=rd(`container`),c=rd(`spacing`),l=rd(`radius`),u=rd(`shadow`),d=rd(`inset-shadow`),f=rd(`text-shadow`),p=rd(`drop-shadow`),m=rd(`blur`),h=rd(`perspective`),g=rd(`aspect`),_=rd(`ease`),v=rd(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),K,G],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[K,G,c],T=()=>[fd,`full`,`auto`,...w()],E=()=>[md,`none`,`subgrid`,K,G],D=()=>[`auto`,{span:[`full`,md,K,G]},md,K,G],O=()=>[md,`auto`,K,G],k=()=>[`auto`,`min`,`max`,`fr`,K,G],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[fd,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ee=()=>[fd,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],P=()=>[fd,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],F=()=>[e,K,G],I=()=>[...b(),Nd,Od,{position:[K,G]}],te=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ne=()=>[`auto`,`cover`,`contain`,Pd,Cd,{size:[K,G]}],re=()=>[hd,jd,wd],L=()=>[``,`none`,`full`,l,K,G],R=()=>[``,pd,jd,wd],ie=()=>[`solid`,`dashed`,`dotted`,`double`],ae=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],oe=()=>[pd,hd,Nd,Od],se=()=>[``,`none`,m,K,G],ce=()=>[`none`,pd,K,G],le=()=>[`none`,pd,K,G],ue=()=>[pd,K,G],de=()=>[fd,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[gd],breakpoint:[gd],color:[_d],container:[gd],"drop-shadow":[gd],ease:[`in`,`out`,`in-out`],font:[Sd],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[gd],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[gd],shadow:[gd],spacing:[`px`,pd],text:[gd],"text-shadow":[gd],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,fd,G,K,g]}],container:[`container`],columns:[{columns:[pd,G,K,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[md,`auto`,K,G]}],basis:[{basis:[fd,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[pd,fd,`auto`,`initial`,`none`,G]}],grow:[{grow:[``,pd,K,G]}],shrink:[{shrink:[``,pd,K,G]}],order:[{order:[md,`first`,`last`,`none`,K,G]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...ee()]}],"min-inline-size":[{"min-inline":[`auto`,...ee()]}],"max-inline-size":[{"max-inline":[`none`,...ee()]}],"block-size":[{block:[`auto`,...P()]}],"min-block-size":[{"min-block":[`auto`,...P()]}],"max-block-size":[{"max-block":[`none`,...P()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,jd,wd]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Ld,Ed]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,hd,G]}],"font-family":[{font:[Md,Dd,t]}],"font-features":[{"font-features":[G]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,K,G]}],"line-clamp":[{"line-clamp":[pd,`none`,K,Td]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,K,G]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,K,G]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ie(),`wavy`]}],"text-decoration-thickness":[{decoration:[pd,`from-font`,`auto`,K,wd]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[pd,`auto`,K,G]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,K,G]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,K,G]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:ne()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},md,K,G],radial:[``,K,G],conic:[md,K,G]},Fd,kd]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:R()}],"border-w-x":[{"border-x":R()}],"border-w-y":[{"border-y":R()}],"border-w-s":[{"border-s":R()}],"border-w-e":[{"border-e":R()}],"border-w-bs":[{"border-bs":R()}],"border-w-be":[{"border-be":R()}],"border-w-t":[{"border-t":R()}],"border-w-r":[{"border-r":R()}],"border-w-b":[{"border-b":R()}],"border-w-l":[{"border-l":R()}],"divide-x":[{"divide-x":R()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":R()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ie(),`hidden`,`none`]}],"divide-style":[{divide:[...ie(),`hidden`,`none`]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-bs":[{"border-bs":F()}],"border-color-be":[{"border-be":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...ie(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[pd,K,G]}],"outline-w":[{outline:[``,pd,jd,wd]}],"outline-color":[{outline:F()}],shadow:[{shadow:[``,`none`,u,Id,Ad]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":[`none`,d,Id,Ad]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:R()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[pd,wd]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":R()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":[`none`,f,Id,Ad]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[pd,K,G]}],"mix-blend":[{"mix-blend":[...ae(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[pd]}],"mask-image-linear-from-pos":[{"mask-linear-from":oe()}],"mask-image-linear-to-pos":[{"mask-linear-to":oe()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":oe()}],"mask-image-t-to-pos":[{"mask-t-to":oe()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":oe()}],"mask-image-r-to-pos":[{"mask-r-to":oe()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":oe()}],"mask-image-b-to-pos":[{"mask-b-to":oe()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":oe()}],"mask-image-l-to-pos":[{"mask-l-to":oe()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":oe()}],"mask-image-x-to-pos":[{"mask-x-to":oe()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":oe()}],"mask-image-y-to-pos":[{"mask-y-to":oe()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[K,G]}],"mask-image-radial-from-pos":[{"mask-radial-from":oe()}],"mask-image-radial-to-pos":[{"mask-radial-to":oe()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[pd]}],"mask-image-conic-from-pos":[{"mask-conic-from":oe()}],"mask-image-conic-to-pos":[{"mask-conic-to":oe()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:ne()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,K,G]}],filter:[{filter:[``,`none`,K,G]}],blur:[{blur:se()}],brightness:[{brightness:[pd,K,G]}],contrast:[{contrast:[pd,K,G]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Id,Ad]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:[``,pd,K,G]}],"hue-rotate":[{"hue-rotate":[pd,K,G]}],invert:[{invert:[``,pd,K,G]}],saturate:[{saturate:[pd,K,G]}],sepia:[{sepia:[``,pd,K,G]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,K,G]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[pd,K,G]}],"backdrop-contrast":[{"backdrop-contrast":[pd,K,G]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,pd,K,G]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[pd,K,G]}],"backdrop-invert":[{"backdrop-invert":[``,pd,K,G]}],"backdrop-opacity":[{"backdrop-opacity":[pd,K,G]}],"backdrop-saturate":[{"backdrop-saturate":[pd,K,G]}],"backdrop-sepia":[{"backdrop-sepia":[``,pd,K,G]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,K,G]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[pd,`initial`,K,G]}],ease:[{ease:[`linear`,`initial`,_,K,G]}],delay:[{delay:[pd,K,G]}],animate:[{animate:[`none`,v,K,G]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,K,G]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:le()}],"scale-x":[{"scale-x":le()}],"scale-y":[{"scale-y":le()}],"scale-z":[{"scale-z":le()}],"scale-3d":[`scale-3d`],skew:[{skew:ue()}],"skew-x":[{"skew-x":ue()}],"skew-y":[{"skew-y":ue()}],transform:[{transform:[K,G,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:de()}],"translate-x":[{"translate-x":de()}],"translate-y":[{"translate-y":de()}],"translate-z":[{"translate-z":de()}],"translate-none":[`translate-none`],accent:[{accent:F()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,K,G]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,K,G]}],fill:[{fill:[`none`,...F()]}],"stroke-w":[{stroke:[pd,jd,wd,Td]}],stroke:[{stroke:[`none`,...F()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function q(...e){return Jd(wu(e))}function Yd(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),r=Math.floor(n/60),i=Math.floor(r/24);return i>0?`${i}天${r%24}小时`:r>0?`${r}小时${n%60}分钟`:n>0?`${n}分钟${t%60}秒`:`${t}秒`}function Xd(e){return e>=1e9?`${(e/1e9).toFixed(1)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function Zd(e){let t={active:`text-green-600 bg-green-50`,completed:`text-blue-600 bg-blue-50`,failed:`text-red-600 bg-red-50`,interrupted:`text-yellow-600 bg-yellow-50`,pending:`text-gray-600 bg-gray-50`};return t[e]||t.pending}function Qd(e){return e?e.endsWith(`Z`)||/[+-]\d{2}:\d{2}$/.test(e)?new Date(e):new Date(e+`Z`):new Date}var $d=[{path:`/dashboard`,label:`仪表盘`,icon:uc},{path:`/projects`,label:`项目管理`,icon:ac},{path:`/sessions`,label:`会话管理`,icon:Ts},{path:`/events`,label:`事件流`,icon:Ps},{path:`/pipelines`,label:`流水线`,icon:sc},{path:`/quality`,label:`质量门禁`,icon:Oc},{path:`/knowledge`,label:`知识图谱`,icon:Ns},{path:`/skills`,label:`技能管理`,icon:_c},{path:`/conventions`,label:`规范管理`,icon:As},{path:`/node-types`,label:`节点类型`,icon:Ms},{path:`/analytics`,label:`数据分析`,icon:Fs},{path:`/config`,label:`系统配置`,icon:Dc}];function ef({children:e}){let[t,n]=(0,z.useState)(()=>localStorage.getItem(`sidebar-collapsed`)===`true`),r=jn();(0,z.useEffect)(()=>{localStorage.setItem(`sidebar-collapsed`,String(t))},[t]);let{data:i}=ct({queryKey:[`health`],queryFn:()=>Zc().then(e=>e.data),refetchInterval:15e3}),a=$d.find(e=>r.pathname.startsWith(e.path));return(0,B.jsxs)(`div`,{className:`flex min-h-screen bg-gray-50`,children:[(0,B.jsxs)(`aside`,{className:q(`fixed top-0 left-0 bottom-0 z-50 flex flex-col transition-all duration-300`,`bg-gradient-to-b from-slate-900 to-slate-800`,t?`w-16`:`w-60`),children:[(0,B.jsxs)(`div`,{className:q(`flex items-center border-b border-white/10 h-16`,t?`justify-center px-2`:`justify-between px-5`),children:[!t&&(0,B.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,B.jsx)(`div`,{className:`flex items-center justify-center w-8 h-8 rounded-lg bg-gradient-to-br from-blue-500 to-purple-600`,children:(0,B.jsx)(Wc,{className:`h-5 w-5 text-white`})}),(0,B.jsx)(`span`,{className:`text-white font-bold text-lg tracking-tight`,children:`Forge`})]}),(0,B.jsx)(`button`,{onClick:()=>n(!t),className:`p-1.5 rounded-lg text-white/60 hover:text-white hover:bg-white/10 transition-colors`,children:t?(0,B.jsx)(mc,{className:`h-5 w-5`}):(0,B.jsx)(zs,{className:`h-5 w-5`})})]}),(0,B.jsx)(`nav`,{className:`flex-1 py-4 space-y-1 px-2`,children:$d.map(e=>(0,B.jsxs)(ei,{to:e.path,className:({isActive:e})=>q(`flex items-center gap-3 rounded-lg transition-all duration-200`,t?`justify-center p-3`:`px-3 py-2.5`,e?`bg-blue-600/20 text-blue-400`:`text-white/60 hover:text-white hover:bg-white/5`),children:[(0,B.jsx)(e.icon,{className:`h-5 w-5 flex-shrink-0`}),!t&&(0,B.jsx)(`span`,{className:`text-sm font-medium`,children:e.label})]},e.path))}),(0,B.jsx)(`div`,{className:q(`border-t border-white/10 py-4`,t?`px-2`:`px-5`),children:(0,B.jsxs)(`div`,{className:q(`flex items-center gap-2`,t?`justify-center`:``),children:[(0,B.jsx)(`div`,{className:q(`w-2 h-2 rounded-full`,i?.status===`ok`?`bg-green-400 animate-pulse`:`bg-red-400`)}),!t&&(0,B.jsx)(`span`,{className:`text-xs text-white/40`,children:i?.status===`ok`?`Daemon 运行中`:`连接断开`})]})})]}),(0,B.jsxs)(`main`,{className:q(`flex-1 transition-all duration-300`,t?`ml-16`:`ml-60`),children:[(0,B.jsxs)(`header`,{className:`sticky top-0 z-40 bg-white/80 backdrop-blur-md border-b border-gray-200/50 h-16 flex items-center justify-between px-8`,children:[(0,B.jsx)(`h1`,{className:`text-xl font-semibold text-gray-900`,children:a?.label||`Claude Forge`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,B.jsxs)(`button`,{className:`hidden sm:flex items-center gap-2 px-3 py-1.5 text-sm text-gray-600 hover:text-gray-900 hover:bg-gray-100 rounded-lg transition-colors`,onClick:()=>{let e=new KeyboardEvent(`keydown`,{key:`k`,metaKey:!0});window.dispatchEvent(e)},children:[(0,B.jsx)(Js,{className:`h-4 w-4`}),(0,B.jsx)(`span`,{children:`命令面板`}),(0,B.jsx)(`kbd`,{className:`px-2 py-0.5 text-xs bg-gray-100 rounded border border-gray-200`,children:`⌘K`})]}),(0,B.jsxs)(`span`,{className:`text-sm text-gray-500`,children:[`v`,`1.52.1`]}),(0,B.jsxs)(`div`,{className:q(`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-semibold`,i?.status===`ok`?`bg-green-50 text-green-700 border border-green-200`:`bg-red-50 text-red-700 border border-red-200`),children:[(0,B.jsx)(`div`,{className:q(`w-1.5 h-1.5 rounded-full`,i?.status===`ok`?`bg-green-500`:`bg-red-500`)}),i?.status===`ok`?`在线`:`离线`]})]})]}),(0,B.jsx)(`div`,{className:`p-8 overflow-x-hidden`,children:e})]})]})}var tf=(0,z.createContext)({});function nf(e){let t=(0,z.useRef)(null);return t.current===null&&(t.current=e()),t.current}var rf=typeof window<`u`?z.useLayoutEffect:z.useEffect,af=(0,z.createContext)(null);function of(e,t){e.indexOf(t)===-1&&e.push(t)}function sf(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var cf=(e,t,n)=>n>t?t:n<e?e:n,lf={},uf=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function df(e){return typeof e==`object`&&!!e}var ff=e=>/^0[^.\s]+$/u.test(e);function pf(e){let t;return()=>(t===void 0&&(t=e()),t)}var mf=e=>e,hf=(e,t)=>n=>t(e(n)),gf=(...e)=>e.reduce(hf),_f=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},vf=class{constructor(){this.subscriptions=[]}add(e){return of(this.subscriptions,e),()=>sf(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},yf=e=>e*1e3,bf=e=>e/1e3;function xf(e,t){return t?1e3/t*e:0}var Sf=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Cf=1e-7,wf=12;function Tf(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Sf(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Cf&&++s<wf);return o}function Ef(e,t,n,r){if(e===t&&n===r)return mf;let i=t=>Tf(t,0,1,e,n);return e=>e===0||e===1?e:Sf(i(e),t,r)}var Df=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Of=e=>t=>1-e(1-t),kf=Ef(.33,1.53,.69,.99),Af=Of(kf),jf=Df(Af),Mf=e=>e>=1?1:(e*=2)<1?.5*Af(e):.5*(2-2**(-10*(e-1))),Nf=e=>1-Math.sin(Math.acos(e)),Pf=Of(Nf),Ff=Df(Nf),If=Ef(.42,0,1,1),Lf=Ef(0,0,.58,1),Rf=Ef(.42,0,.58,1),zf=e=>Array.isArray(e)&&typeof e[0]!=`number`,Bf=e=>Array.isArray(e)&&typeof e[0]==`number`,Vf={linear:mf,easeIn:If,easeInOut:Rf,easeOut:Lf,circIn:Nf,circInOut:Ff,circOut:Pf,backIn:Af,backInOut:jf,backOut:kf,anticipate:Mf},Hf=e=>typeof e==`string`,Uf=e=>{if(Bf(e)){e.length;let[t,n,r,i]=e;return Ef(t,n,r,i)}else if(Hf(e))return Vf[e],`${e}`,Vf[e];return e},Wf=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],Gf={value:null,addProjectionMetrics:null};function Kf(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0;let o=n;n=r,r=o,n.forEach(l),t&&Gf.value&&Gf.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var qf=40;function Jf(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Wf.reduce((e,n)=>(e[n]=Kf(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=lf.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,qf),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Wf.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Wf.length;t++)o[Wf[t]].cancel(e)},state:i,steps:o}}var{schedule:Yf,cancel:Xf,state:Zf,steps:Qf}=Jf(typeof requestAnimationFrame<`u`?requestAnimationFrame:mf,!0),$f;function ep(){$f=void 0}var tp={now:()=>($f===void 0&&tp.set(Zf.isProcessing||lf.useManualTiming?Zf.timestamp:performance.now()),$f),set:e=>{$f=e,queueMicrotask(ep)}},np={layout:0,mainThread:0,waapi:0},rp=e=>t=>typeof t==`string`&&t.startsWith(e),ip=rp(`--`),ap=rp(`var(--`),op=e=>ap(e)?sp.test(e.split(`/*`)[0].trim()):!1,sp=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function cp(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var lp={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},up={...lp,transform:e=>cf(0,1,e)},dp={...lp,default:1},fp=e=>Math.round(e*1e5)/1e5,pp=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function mp(e){return e==null}var hp=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,gp=(e,t)=>n=>!!(typeof n==`string`&&hp.test(n)&&n.startsWith(e)||t&&!mp(n)&&Object.prototype.hasOwnProperty.call(n,t)),_p=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(pp);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},vp=e=>cf(0,255,e),yp={...lp,transform:e=>Math.round(vp(e))},bp={test:gp(`rgb`,`red`),parse:_p(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+yp.transform(e)+`, `+yp.transform(t)+`, `+yp.transform(n)+`, `+fp(up.transform(r))+`)`};function xp(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}}var Sp={test:gp(`#`),parse:xp,transform:bp.transform},Cp=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),wp=Cp(`deg`),Tp=Cp(`%`),J=Cp(`px`),Ep=Cp(`vh`),Dp=Cp(`vw`),Op={...Tp,parse:e=>Tp.parse(e)/100,transform:e=>Tp.transform(e*100)},kp={test:gp(`hsl`,`hue`),parse:_p(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Tp.transform(fp(t))+`, `+Tp.transform(fp(n))+`, `+fp(up.transform(r))+`)`},Ap={test:e=>bp.test(e)||Sp.test(e)||kp.test(e),parse:e=>bp.test(e)?bp.parse(e):kp.test(e)?kp.parse(e):Sp.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?bp.transform(e):kp.transform(e),getAnimatableNone:e=>{let t=Ap.parse(e);return t.alpha=0,Ap.transform(t)}},jp=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Mp(e){return isNaN(e)&&typeof e==`string`&&(e.match(pp)?.length||0)+(e.match(jp)?.length||0)>0}var Np=`number`,Pp=`color`,Fp=`var`,Ip=`var(`,Lp="${}",Rp=/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 zp(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Rp,e=>(Ap.test(e)?(r.color.push(a),i.push(Pp),n.push(Ap.parse(e))):e.startsWith(Ip)?(r.var.push(a),i.push(Fp),n.push(e)):(r.number.push(a),i.push(Np),n.push(parseFloat(e))),++a,Lp)).split(Lp),indexes:r,types:i}}function Bp(e){return zp(e).values}function Vp({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];e===Np?i+=fp(r[a]):e===Pp?i+=Ap.transform(r[a]):i+=r[a]}return i}}function Hp(e){return Vp(zp(e))}var Up=e=>typeof e==`number`?0:Ap.test(e)?Ap.getAnimatableNone(e):e,Wp=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Up(e);function Gp(e){let t=zp(e);return Vp(t)(t.values.map((e,n)=>Wp(e,t.split[n])))}var Kp={test:Mp,parse:Bp,createTransformer:Hp,getAnimatableNone:Gp};function qp(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Jp({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=qp(s,r,e+1/3),a=qp(s,r,e),o=qp(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Yp(e,t){return n=>n>0?t:e}var Xp=(e,t,n)=>e+(t-e)*n,Zp=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Qp=[Sp,bp,kp],$p=e=>Qp.find(t=>t.test(e));function em(e){let t=$p(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===kp&&(n=Jp(n)),n}var tm=(e,t)=>{let n=em(e),r=em(t);if(!n||!r)return Yp(e,t);let i={...n};return e=>(i.red=Zp(n.red,r.red,e),i.green=Zp(n.green,r.green,e),i.blue=Zp(n.blue,r.blue,e),i.alpha=Xp(n.alpha,r.alpha,e),bp.transform(i))},nm=new Set([`none`,`hidden`]);function rm(e,t){return nm.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function im(e,t){return n=>Xp(e,t,n)}function am(e){return typeof e==`number`?im:typeof e==`string`?op(e)?Yp:Ap.test(e)?tm:nee:Array.isArray(e)?om:typeof e==`object`?Ap.test(e)?tm:eee:Yp}function om(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>am(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function eee(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=am(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function tee(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var nee=(e,t)=>{let n=Kp.createTransformer(t),r=zp(e),i=zp(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?nm.has(e)&&!i.values.length||nm.has(t)&&!r.values.length?rm(e,t):gf(om(tee(r,i),i.values),n):(`${e}${t}`,Yp(e,t))};function sm(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?Xp(e,t,n):am(e)(e,t)}var cm=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Yf.update(t,e),stop:()=>Xf(t),now:()=>Zf.isProcessing?Zf.timestamp:tp.now()}},lm=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},um=2e4;function dm(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function fm(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(dm(r),um);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:bf(i)}}var pm={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function mm(e,t){return e*Math.sqrt(1-t*t)}var hm=12;function gm(e,t,n){let r=n;for(let n=1;n<hm;n++)r-=e(r)/t(r);return r}var _m=.001;function ree({duration:e=pm.duration,bounce:t=pm.bounce,velocity:n=pm.velocity,mass:r=pm.mass}){let i,a;pm.maxDuration;let o=1-t;o=cf(pm.minDamping,pm.maxDamping,o),e=cf(pm.minDuration,pm.maxDuration,bf(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=mm(t,o),c=Math.exp(-i);return _m-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=mm(t**2,o);return(-i(t)+_m>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-_m+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=gm(i,a,s);if(e=yf(e),isNaN(c))return{stiffness:pm.stiffness,damping:pm.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var iee=[`duration`,`bounce`],aee=[`stiffness`,`damping`,`mass`];function vm(e,t){return t.some(t=>e[t]!==void 0)}function oee(e){let t={velocity:pm.velocity,stiffness:pm.stiffness,damping:pm.damping,mass:pm.mass,isResolvedFromDuration:!1,...e};if(!vm(e,aee)&&vm(e,iee))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*cf(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:pm.mass,stiffness:i,damping:a}}else{let n=ree({...e,velocity:0});t={...t,...n,mass:pm.mass},t.isResolvedFromDuration=!0}return t}function ym(e=pm.visualDuration,t=pm.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=oee({...n,velocity:-bf(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=bf(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?pm.restSpeed.granular:pm.restSpeed.default,i||=v?pm.restDelta.granular:pm.restDelta.default;let y,b,x,S,C,w;if(h<1)x=mm(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(S*Math.sin(x*e)+g*Math.cos(x*e)),C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>yf(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=yf(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=yf(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(dm(T),um),t=lm(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}ym.applyToOptions=e=>{let t=fm(e,100,ym);return e.ease=t.ease,e.duration=yf(t.duration),e.type=`keyframes`,e};var see=5;function bm(e,t,n){let r=Math.max(t-see,0);return xf(n-e(r),t-r)}function xm({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=ym({keyframes:[f.value,m(f.value)],velocity:bm(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function Sm(e,t,n){let r=[],i=n||lf.mix||sm,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=gf(Array.isArray(t)?t[n]||mf:t,a)),r.push(a)}return r}function Cm(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Sm(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=_f(e[r],e[r+1],n);return s[r](i)};return n?t=>l(cf(e[0],e[a-1],t)):l}function wm(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=_f(0,t,r);e.push(Xp(n,1,i))}}function Tm(e){let t=[0];return wm(t,e.length-1),t}function Em(e,t){return e.map(e=>e*t)}function Dm(e,t){return e.map(()=>t||Rf).splice(0,e.length-1)}function Om({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=zf(r)?r.map(Uf):Uf(r),a={done:!1,value:t[0]},o=Cm(Em(n&&n.length===t.length?n:Tm(t),e),t,{ease:Array.isArray(i)?i:Dm(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var km=e=>e!==null;function Am(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(km),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var jm={decay:xm,inertia:xm,tween:Om,keyframes:Om,spring:ym};function Mm(e){typeof e.type==`string`&&(e.type=jm[e.type])}var Nm=class{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)}},Pm=e=>e/100,Fm=class extends Nm{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==tp.now()&&this.tick(tp.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},np.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Mm(e);let{type:t=Om,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Om;s!==Om&&typeof o[0]!=`number`&&(this.mixKeyframes=gf(Pm,sm(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=dm(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=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);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=cf(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==xm&&(b.value=Am(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return bf(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+bf(e)}get time(){return bf(this.currentTime)}set time(e){e=yf(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return bm(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(tp.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=bf(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=cm,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(tp.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&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,np.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),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)}};function Im(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var Lm=e=>e*180/Math.PI,Rm=e=>Bm(Lm(Math.atan2(e[1],e[0]))),zm={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Rm,rotateZ:Rm,skewX:e=>Lm(Math.atan(e[1])),skewY:e=>Lm(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Bm=e=>(e%=360,e<0&&(e+=360),e),Vm=Rm,Hm=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Um=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),cee={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Hm,scaleY:Um,scale:e=>(Hm(e)+Um(e))/2,rotateX:e=>Bm(Lm(Math.atan2(e[6],e[5]))),rotateY:e=>Bm(Lm(Math.atan2(-e[2],e[0]))),rotateZ:Vm,rotate:Vm,skewX:e=>Lm(Math.atan(e[4])),skewY:e=>Lm(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Wm(e){return+!!e.includes(`scale`)}function Gm(e,t){if(!e||e===`none`)return Wm(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=cee,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=zm,i=t}if(!i)return Wm(t);let a=r[t],o=i[1].split(`,`).map(uee);return typeof a==`function`?a(o):o[a]}var lee=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Gm(n,t)};function uee(e){return parseFloat(e.trim())}var Km=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],qm=new Set(Km),Jm=e=>e===lp||e===J,Ym=new Set([`x`,`y`,`z`]),Xm=Km.filter(e=>!Ym.has(e));function Zm(e){let t=[];return Xm.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var Qm={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-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})=>Gm(t,`x`),y:(e,{transform:t})=>Gm(t,`y`)};Qm.translateX=Qm.x,Qm.translateY=Qm.y;var $m=new Set,eh=!1,th=!1,nh=!1;function rh(){if(th){let e=Array.from($m).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=Zm(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}th=!1,eh=!1,$m.forEach(e=>e.complete(nh)),$m.clear()}function ih(){$m.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(th=!0)})}function ah(){nh=!0,ih(),rh(),nh=!1}var oh=class{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?($m.add(this),eh||(eh=!0,Yf.read(ih),Yf.resolveKeyframes(rh))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Im(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),$m.delete(this)}cancel(){this.state===`scheduled`&&($m.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},sh=e=>e.startsWith(`--`);function ch(e,t,n){sh(t)?e.style.setProperty(t,n):e.style[t]=n}var lh={};function uh(e,t){let n=pf(e);return()=>lh[t]??n()}var dh=uh(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),fh=uh(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),ph=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,mh={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:ph([0,.65,.55,1]),circOut:ph([.55,0,1,.45]),backIn:ph([.31,.01,.66,-.59]),backOut:ph([.33,1.53,.69,.99])};function hh(e,t){if(e)return typeof e==`function`?fh()?lm(e,t):`ease-out`:Bf(e)?ph(e):Array.isArray(e)?e.map(e=>hh(e,t)||mh.easeOut):mh[e]}function gh(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=hh(s,i);Array.isArray(d)&&(u.easing=d),Gf.value&&np.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return Gf.value&&p.finished.finally(()=>{np.waapi--}),p}function _h(e){return typeof e==`function`&&`applyToOptions`in e}function vh({type:e,...t}){return _h(e)&&fh()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var yh=class extends Nm{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=vh(e);this.animation=gh(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Am(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),ch(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return bf(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+bf(e)}get time(){return bf(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=yf(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&dh()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),mf):r(this)}},bh={anticipate:Mf,backInOut:jf,circInOut:Ff};function xh(e){return e in bh}function Sh(e){typeof e.ease==`string`&&xh(e.ease)&&(e.ease=bh[e.ease])}var Ch=10,wh=class extends yh{constructor(e){Sh(e),Mm(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Fm({...a,autoplay:!1}),s=Math.max(Ch,tp.now()-this.startTime),c=cf(0,Ch,s-Ch),l=o.sample(s).value,{name:u}=this.options;i&&u&&ch(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},Th=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Kp.test(e)||e===`0`)&&!e.startsWith(`url(`));function Eh(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Dh(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Th(i,t),s=Th(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:Eh(e)||(n===`spring`||_h(n))&&r}function Oh(e){e.duration=0,e.type=`keyframes`}var kh=new Set([`opacity`,`clipPath`,`filter`,`transform`]),Ah=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function dee(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&Ah.test(e[t]))return!0;return!1}var fee=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),pee=pf(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function mee(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return pee()&&n&&(kh.has(n)||fee.has(n)&&dee(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var hee=40,gee=class extends Nm{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=tp.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u};this.keyframeResolver=new(l?.KeyframeResolver||oh)(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=tp.now();let u=!0;Dh(e,i,a,o)||(u=!1,(lf.instantAnimations||!s)&&l?.(Am(e,n,t)),e[0]=e[e.length-1],Oh(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>hee?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&mee(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new wh({...d,element:p})}catch{m=new Fm(d)}else m=new Fm(d);m.finished.then(()=>{this.notifyFinished()}).catch(mf),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}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(),ah()),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 jh(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var _ee=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function vee(e){let t=_ee.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Mh(e,t,n=1){`${e}`;let[r,i]=vee(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return uf(e)?parseFloat(e):e}return op(i)?Mh(i,t,n+1):i}var yee={type:`spring`,stiffness:500,damping:25,restSpeed:10},bee=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),xee={type:`keyframes`,duration:.8},See={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Cee=(e,{keyframes:t})=>t.length>2?xee:qm.has(e)?e.startsWith(`scale`)?bee(t[1]):yee:See;function Nh(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Ph(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Nh(n,e)}var wee=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Tee(e){for(let t in e)if(!wee.has(t))return!0;return!1}var Fh=(e,t,n,r={},i,a)=>o=>{let s=Ph(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=yf(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,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};Tee(s)||Object.assign(u,Cee(e,u)),u.duration&&=yf(u.duration),u.repeatDelay&&=yf(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Oh(u),u.delay===0&&(d=!0)),(lf.instantAnimations||lf.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,Oh(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Am(u.keyframes,s);if(e!==void 0){Yf.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Fm(u):new gee(u)};function Ih(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Lh(e,t,n,r){if(typeof t==`function`){let[i,a]=Ih(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=Ih(r);t=t(n===void 0?e.custom:n,i,a)}return t}function Rh(e,t,n){let r=e.getProps();return Lh(r,t,n===void 0?r.custom:n,e)}var zh=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Km]),Bh=30,Eee=e=>!isNaN(parseFloat(e)),Vh={current:void 0},Dee=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=tp.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(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=tp.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Eee(this.current))}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 vf);let n=this.events[e].add(t);return e===`change`?()=>{n(),Yf.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let 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||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Vh.current&&Vh.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=tp.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Bh)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Bh);return xf(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 Hh(e,t){return new Dee(e,t)}var Uh=e=>Array.isArray(e);function Wh(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Hh(n))}function Gh(e){return Uh(e)?e[e.length-1]||0:e}function Kh(e,t){let{transitionEnd:n={},transition:r={},...i}=Rh(e,t)||{};i={...i,...n};for(let t in i)Wh(e,t,Gh(i[t]))}var qh=e=>!!(e&&e.getVelocity);function Jh(e){return!!(qh(e)&&e.add)}function Yh(e,t){let n=e.getValue(`willChange`);if(Jh(n))return n.add(t);if(!n&&lf.WillChange){let n=new lf.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Xh(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Zh=`data-`+Xh(`framerAppearId`);function Qh(e){return e.props[Zh]}function $h({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function eg(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Nh(a,c):c;let l=a?.reduceMotion;r&&(a=r);let u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||d&&$h(d,t))continue;let o={delay:n,...Ph(a||{},t)},c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){Yf.update(()=>r.set(i));continue}let f=!1;if(window.MotionHandoffAnimation){let n=Qh(e);if(n){let e=window.MotionHandoffAnimation(n,t,Yf);e!==null&&(o.startTime=e,f=!0)}}Yh(e,t);let p=l??e.shouldReduceMotion;r.start(Fh(t,r,i,p&&zh.has(t)?{type:!1}:o,e,f));let m=r.animation;m&&u.push(m)}if(o){let t=()=>Yf.update(()=>{o&&Kh(e,o)});u.length?Promise.all(u).then(t):t()}return u}function tg(e,t,n={}){let r=Rh(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(eg(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return ng(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function ng(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(tg(c,t,{...o,delay:n+(typeof r==`function`?0:r)+jh(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function rg(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>tg(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=tg(e,t,n);else{let i=typeof t==`function`?Rh(e,t,n.custom):t;r=Promise.all(eg(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var ig={test:e=>e===`auto`,parse:e=>e},ag=e=>t=>t.test(e),og=[lp,J,Tp,wp,Dp,Ep,ig],sg=e=>og.find(ag(e));function cg(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||ff(e)}var lg=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function ug(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(pp)||[];if(!r)return e;let i=n.replace(r,``),a=+!!lg.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var dg=/\b([a-z-]*)\(.*?\)/gu,fg={...Kp,getAnimatableNone:e=>{let t=e.match(dg);return t?t.map(ug).join(` `):e}},pg={...Kp,getAnimatableNone:e=>{let t=Kp.parse(e);return Kp.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},mg={...lp,transform:Math.round},hg={borderWidth:J,borderTopWidth:J,borderRightWidth:J,borderBottomWidth:J,borderLeftWidth:J,borderRadius:J,borderTopLeftRadius:J,borderTopRightRadius:J,borderBottomRightRadius:J,borderBottomLeftRadius:J,width:J,maxWidth:J,height:J,maxHeight:J,top:J,right:J,bottom:J,left:J,inset:J,insetBlock:J,insetBlockStart:J,insetBlockEnd:J,insetInline:J,insetInlineStart:J,insetInlineEnd:J,padding:J,paddingTop:J,paddingRight:J,paddingBottom:J,paddingLeft:J,paddingBlock:J,paddingBlockStart:J,paddingBlockEnd:J,paddingInline:J,paddingInlineStart:J,paddingInlineEnd:J,margin:J,marginTop:J,marginRight:J,marginBottom:J,marginLeft:J,marginBlock:J,marginBlockStart:J,marginBlockEnd:J,marginInline:J,marginInlineStart:J,marginInlineEnd:J,fontSize:J,backgroundPositionX:J,backgroundPositionY:J,rotate:wp,rotateX:wp,rotateY:wp,rotateZ:wp,scale:dp,scaleX:dp,scaleY:dp,scaleZ:dp,skew:wp,skewX:wp,skewY:wp,distance:J,translateX:J,translateY:J,translateZ:J,x:J,y:J,z:J,perspective:J,transformPerspective:J,opacity:up,originX:Op,originY:Op,originZ:J,zIndex:mg,fillOpacity:up,strokeOpacity:up,numOctaves:mg},gg={...hg,color:Ap,backgroundColor:Ap,outlineColor:Ap,fill:Ap,stroke:Ap,borderColor:Ap,borderTopColor:Ap,borderRightColor:Ap,borderBottomColor:Ap,borderLeftColor:Ap,filter:fg,WebkitFilter:fg,mask:pg,WebkitMask:pg},_g=e=>gg[e],vg=new Set([fg,pg]);function yg(e,t){let n=_g(e);return vg.has(n)||(n=Kp),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var bg=new Set([`auto`,`none`,`0`]);function xg(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!bg.has(t)&&zp(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=yg(n,i)}var Sg=class extends oh{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),op(r))){let i=Mh(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!zh.has(n)||e.length!==2)return;let[r,i]=e,a=sg(r),o=sg(i);if(cp(r)!==cp(i)&&Qm[n]){this.needsMeasurement=!0;return}if(a!==o)if(Jm(a)&&Jm(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Qm[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||cg(e[t]))&&n.push(t);n.length&&xg(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Qm[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=Qm[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function Cg(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var wg=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function Tg(e){return df(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:Eg,cancel:Oee}=Jf(queueMicrotask,!1),Dg={x:!1,y:!1};function Og(){return Dg.x||Dg.y}function kg(e){return e===`x`||e===`y`?Dg[e]?null:(Dg[e]=!0,()=>{Dg[e]=!1}):Dg.x||Dg.y?null:(Dg.x=Dg.y=!0,()=>{Dg.x=Dg.y=!1})}function Ag(e,t){let n=Cg(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function jg(e){return!(e.pointerType===`touch`||Og())}function Mg(e,t,n={}){let[r,i,a]=Ag(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!jg(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var Ng=(e,t)=>t?e===t?!0:Ng(e,t.parentElement):!1,Pg=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Fg=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Ig(e){return Fg.has(e.tagName)||e.isContentEditable===!0}var Lg=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Rg(e){return Lg.has(e.tagName)||e.isContentEditable===!0}var zg=new WeakSet;function Bg(e){return t=>{t.key===`Enter`&&e(t)}}function Vg(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var Hg=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=Bg(()=>{if(zg.has(n))return;Vg(n,`down`);let e=Bg(()=>{Vg(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>Vg(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function Ug(e){return Pg(e)&&!Og()}var Wg=new WeakSet;function Gg(e,t,n={}){let[r,i,a]=Ag(e,n),o=e=>{let r=e.currentTarget;if(!Ug(e)||Wg.has(e))return;zg.add(r),n.stopPropagation&&Wg.add(e);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),zg.has(r)&&zg.delete(r),Ug(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||Ng(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Tg(e)&&(e.addEventListener(`focus`,e=>Hg(e,i)),!Ig(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function Kg(e){return df(e)&&`ownerSVGElement`in e}var qg=new WeakMap,Jg,Yg=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Kg(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Xg=Yg(`inline`,`width`,`offsetWidth`),Zg=Yg(`block`,`height`,`offsetHeight`);function Qg({target:e,borderBoxSize:t}){qg.get(e)?.forEach(n=>{n(e,{get width(){return Xg(e,t)},get height(){return Zg(e,t)}})})}function $g(e){e.forEach(Qg)}function e_(){typeof ResizeObserver>`u`||(Jg=new ResizeObserver($g))}function t_(e,t){Jg||e_();let n=Cg(e);return n.forEach(e=>{let n=qg.get(e);n||(n=new Set,qg.set(e,n)),n.add(t),Jg?.observe(e)}),()=>{n.forEach(e=>{let n=qg.get(e);n?.delete(t),n?.size||Jg?.unobserve(e)})}}var n_=new Set,r_;function kee(){r_=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};n_.forEach(t=>t(e))},window.addEventListener(`resize`,r_)}function Aee(e){return n_.add(e),r_||kee(),()=>{n_.delete(e),!n_.size&&typeof r_==`function`&&(window.removeEventListener(`resize`,r_),r_=void 0)}}function i_(e,t){return typeof e==`function`?Aee(e):t_(e,t)}function jee(e){return Kg(e)&&e.tagName===`svg`}var Mee=[...og,Ap,Kp],Nee=e=>Mee.find(ag(e)),a_=()=>({translate:0,scale:1,origin:0,originPoint:0}),o_=()=>({x:a_(),y:a_()}),s_=()=>({min:0,max:0}),c_=()=>({x:s_(),y:s_()}),Pee=new WeakMap;function l_(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function u_(e){return typeof e==`string`||Array.isArray(e)}var d_=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],f_=[`initial`,...d_];function p_(e){return l_(e.animate)||f_.some(t=>u_(e[t]))}function m_(e){return!!(p_(e)||e.variants)}function Fee(e,t,n){for(let r in t){let i=t[r],a=n[r];if(qh(i))e.addValue(r,i);else if(qh(a))e.addValue(r,Hh(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Hh(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var h_={current:null},g_={current:!1},Iee=typeof window<`u`;function Lee(){if(g_.current=!0,Iee)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>h_.current=e.matches;e.addEventListener(`change`,t),t()}else h_.current=!1}var __=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],v_={};function y_(e){v_=e}function Ree(){return v_}var zee=class{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=oh,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=()=>{let e=tp.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Yf.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,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=!!a,this.isControllingVariants=p_(t),this.isVariantNode=m_(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&qh(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,Pee.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)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(g_.current||Lee(),this.shouldReduceMotion=h_.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(),Xf(this.notifyUpdate),Xf(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),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&&kh.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new yh({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:yf(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=qm.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&Yf.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&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?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in v_){let t=v_[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let 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):c_()}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 t=0;t<__.length;t++){let n=__[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Fee(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){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let 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);let 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 n===void 0&&t!==void 0&&(n=Hh(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(uf(n)||ff(n))?n=parseFloat(n):!Nee(n)&&Kp.test(t)&&(n=yg(e,t)),this.setBaseTarget(e,qh(n)?n.get():n)),qh(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Lh(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!qh(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new vf),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Eg.render(this.render)}},b_=class extends zee{constructor(){super(...arguments),this.KeyframeResolver=Sg}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let 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);let{children:e}=this.props;qh(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},x_=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function S_({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Bee({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Vee(e,t){if(!t)return e;let 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}}function C_(e){return e===void 0||e===1}function w_({scale:e,scaleX:t,scaleY:n}){return!C_(e)||!C_(t)||!C_(n)}function T_(e){return w_(e)||E_(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function E_(e){return D_(e.x)||D_(e.y)}function D_(e){return e&&e!==`0%`}function O_(e,t,n){return n+t*(e-n)}function k_(e,t,n,r,i){return i!==void 0&&(e=O_(e,i,r)),O_(e,n,r)+t}function A_(e,t=0,n=1,r,i){e.min=k_(e.min,t,n,r,i),e.max=k_(e.max,t,n,r,i)}function j_(e,{x:t,y:n}){A_(e.x,t.translate,t.scale,t.originPoint),A_(e.y,n.translate,n.scale,n.originPoint)}var M_=.999999999999,N_=1.0000000000001;function P_(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(F_(e.x,-a.scroll.offset.x),F_(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,j_(e,o)),r&&T_(a.latestValues)&&R_(e,a.latestValues,a.layout?.layoutBox))}t.x<N_&&t.x>M_&&(t.x=1),t.y<N_&&t.y>M_&&(t.y=1)}function F_(e,t){e.min+=t,e.max+=t}function I_(e,t,n,r,i=.5){A_(e,t,n,Xp(e.min,e.max,i),r)}function L_(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function R_(e,t,n){let r=n??e;I_(e.x,L_(t.x,r.x),t.scaleX,t.scale,t.originX),I_(e.y,L_(t.y,r.y),t.scaleY,t.scale,t.originY)}function z_(e,t){return S_(Vee(e.getBoundingClientRect(),t))}function B_(e,t,n){let r=z_(e,n),{scroll:i}=t;return i&&(F_(r.x,i.offset.x),F_(r.y,i.offset.y)),r}var V_={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},H_=Km.length;function U_(e,t,n){let r=``,i=!0;for(let a=0;a<H_;a++){let o=Km[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=wg(s,hg[o]);if(!c){i=!1;let t=V_[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function W_(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(qm.has(e)){o=!0;continue}else if(ip(e)){i[e]=n;continue}else{let t=wg(n,hg[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=U_(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function G_(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function K_(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var q_={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(J.test(e))e=parseFloat(e);else return e;return`${K_(e,t.target.x)}% ${K_(e,t.target.y)}%`}},J_={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Kp.parse(e);if(i.length>5)return r;let a=Kp.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Xp(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Y_={borderRadius:{...q_,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:q_,borderTopRightRadius:q_,borderBottomLeftRadius:q_,borderBottomRightRadius:q_,boxShadow:J_};function X_(e,{layout:t,layoutId:n}){return qm.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Y_[e]||e===`opacity`)}function Z_(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(qh(r[t])||i&&qh(i[t])||X_(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Q_(e){return window.getComputedStyle(e)}var $_=class extends b_{constructor(){super(...arguments),this.type=`html`,this.renderInstance=G_}readValueFromInstance(e,t){if(qm.has(t))return this.projection?.isProjecting?Wm(t):lee(e,t);{let n=Q_(e),r=(ip(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return z_(e,t)}build(e,t,n){W_(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Z_(e,t,n)}},ev={offset:`stroke-dashoffset`,array:`stroke-dasharray`},tv={offset:`strokeDashoffset`,array:`strokeDasharray`};function nv(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?ev:tv;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var rv=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function iv(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(W_(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{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=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of rv)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&nv(d,i,a,o,!1)}var av=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`]),ov=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function sv(e,t,n,r){G_(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(av.has(n)?n:Xh(n),t.attrs[n])}function cv(e,t,n){let r=Z_(e,t,n);for(let n in e)if(qh(e[n])||qh(t[n])){let t=Km.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var lv=class extends b_{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=c_}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(qm.has(t)){let e=_g(t);return e&&e.default||0}return t=av.has(t)?t:Xh(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return cv(e,t,n)}build(e,t,n){iv(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){sv(e,t,n,r)}mount(e){this.isSVGTag=ov(e.tagName),super.mount(e)}},uv=f_.length;function dv(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&dv(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<uv;n++){let r=f_[n],i=e.props[r];(u_(i)||i===!1)&&(t[r]=i)}return t}function fv(e,t){if(!Array.isArray(t))return!1;let 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}var pv=[...d_].reverse(),mv=d_.length;function hv(e){return t=>Promise.all(t.map(({animation:t,options:n})=>rg(e,t,n)))}function gv(e){let t=hv(e),n=yv(),r=!0,i=!1,a=t=>(n,r)=>{let i=Rh(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=dv(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<mv;t++){let p=pv[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=u_(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||l_(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=_v(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Uh(t)&&Uh(n)?!fv(t,n):t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=Rh(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=jh(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=Rh(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=yv(),i=!0}}}function _v(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!fv(t,e):!1}function vv(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function yv(){return{animate:vv(!0),whileInView:vv(),whileHover:vv(),whileTap:vv(),whileDrag:vv(),whileFocus:vv(),exit:vv()}}function bv(e,t){e.min=t.min,e.max=t.max}function xv(e,t){bv(e.x,t.x),bv(e.y,t.y)}function Sv(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Cv=1e-4,wv=1-Cv,Tv=1+Cv,Ev=.01,Dv=0-Ev,Ov=0+Ev;function kv(e){return e.max-e.min}function Av(e,t,n){return Math.abs(e-t)<=n}function jv(e,t,n,r=.5){e.origin=r,e.originPoint=Xp(t.min,t.max,e.origin),e.scale=kv(n)/kv(t),e.translate=Xp(n.min,n.max,e.origin)-e.originPoint,(e.scale>=wv&&e.scale<=Tv||isNaN(e.scale))&&(e.scale=1),(e.translate>=Dv&&e.translate<=Ov||isNaN(e.translate))&&(e.translate=0)}function Mv(e,t,n,r){jv(e.x,t.x,n.x,r?r.originX:void 0),jv(e.y,t.y,n.y,r?r.originY:void 0)}function Nv(e,t,n,r=0){e.min=(r?Xp(n.min,n.max,r):n.min)+t.min,e.max=e.min+kv(t)}function Pv(e,t,n,r){Nv(e.x,t.x,n.x,r?.x),Nv(e.y,t.y,n.y,r?.y)}function Fv(e,t,n,r=0){let i=r?Xp(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+kv(t)}function Iv(e,t,n,r){Fv(e.x,t.x,n.x,r?.x),Fv(e.y,t.y,n.y,r?.y)}function Lv(e,t,n,r,i){return e-=t,e=O_(e,1/n,r),i!==void 0&&(e=O_(e,1/i,r)),e}function Rv(e,t=0,n=1,r=.5,i,a=e,o=e){if(Tp.test(t)&&(t=parseFloat(t),t=Xp(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Xp(a.min,a.max,r);e===a&&(s-=t),e.min=Lv(e.min,t,n,s,i),e.max=Lv(e.max,t,n,s,i)}function zv(e,t,[n,r,i],a,o){Rv(e,t[n],t[r],t[i],t.scale,a,o)}var Bv=[`x`,`scaleX`,`originX`],Vv=[`y`,`scaleY`,`originY`];function Hv(e,t,n,r){zv(e.x,t,Bv,n?n.x:void 0,r?r.x:void 0),zv(e.y,t,Vv,n?n.y:void 0,r?r.y:void 0)}function Uv(e){return e.translate===0&&e.scale===1}function Wv(e){return Uv(e.x)&&Uv(e.y)}function Gv(e,t){return e.min===t.min&&e.max===t.max}function Kv(e,t){return Gv(e.x,t.x)&&Gv(e.y,t.y)}function qv(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Jv(e,t){return qv(e.x,t.x)&&qv(e.y,t.y)}function Yv(e){return kv(e.x)/kv(e.y)}function Xv(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Zv(e){return[e(`x`),e(`y`)]}function Qv(e,t,n){let r=``,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) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{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) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var $v=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],ey=$v.length,ty=e=>typeof e==`string`?parseFloat(e):e,ny=e=>typeof e==`number`||J.test(e);function ry(e,t,n,r,i,a){i?(e.opacity=Xp(0,n.opacity??1,ay(r)),e.opacityExit=Xp(t.opacity??1,0,oy(r))):a&&(e.opacity=Xp(t.opacity??1,n.opacity??1,r));for(let i=0;i<ey;i++){let a=$v[i],o=iy(t,a),s=iy(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||ny(o)===ny(s)?(e[a]=Math.max(Xp(ty(o),ty(s),r),0),(Tp.test(s)||Tp.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Xp(t.rotate||0,n.rotate||0,r))}function iy(e,t){return e[t]===void 0?e.borderRadius:e[t]}var ay=sy(0,.5,Pf),oy=sy(.5,.95,mf);function sy(e,t,n){return r=>r<e?0:r>t?1:n(_f(e,t,r))}function cy(e,t,n){let r=qh(e)?e:Hh(e);return r.start(Fh(``,r,t,n)),r.animation}function ly(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var uy=(e,t)=>e.depth-t.depth,dy=class{constructor(){this.children=[],this.isDirty=!1}add(e){of(this.children,e),this.isDirty=!0}remove(e){sf(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(uy),this.isDirty=!1,this.children.forEach(e)}};function fy(e,t){let n=tp.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Xf(r),e(a-t))};return Yf.setup(r,!0),()=>Xf(r)}function py(e){return qh(e)?e.get():e}var my=class{constructor(){this.members=[]}add(e){of(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(sf(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(sf(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},hy={hasAnimatedSinceResize:!0,hasEverUpdated:!1},gy={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},_y=[``,`X`,`Y`,`Z`],vy=1e3,yy=0;function by(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function xy(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Qh(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,Yf,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&xy(r)}function Sy({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=yy++,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,Gf.value&&(gy.nodes=gy.calculatedTargetDeltas=gy.calculatedProjections=0),this.nodes.forEach(Ty),this.nodes.forEach(Py),this.nodes.forEach(Fy),this.nodes.forEach(Ey),Gf.addProjectionMetrics&&Gf.addProjectionMetrics(gy)},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 e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new dy)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new vf),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=Kg(t)&&!jee(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;Yf.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=fy(i,250),hy.hasAnimatedSinceResize&&(hy.hasAnimatedSinceResize=!1,this.nodes.forEach(Ny)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Hy,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Jv(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Ph(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||Ny(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Xf(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(Iy),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&xy(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(ky),this.nodes.forEach(Oy);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ay);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(jy),this.nodes.forEach(My),this.nodes.forEach(Cy),this.nodes.forEach(wy)):this.nodes.forEach(Ay),this.clearAllSnapshots();let e=tp.now();Zf.delta=cf(0,1e3/60,e-Zf.timestamp),Zf.timestamp=e,Zf.isProcessing=!0,Qf.update.process(Zf),Qf.preRender.process(Zf),Qf.render.process(Zf),Zf.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Eg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Dy),this.sharedNodes.forEach(Ly)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Yf.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Yf.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!kv(this.snapshot.measuredBox.x)&&!kv(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=c_(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let 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;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Wv(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||T_(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Ky(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return c_();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Jy))){let{scroll:e}=this.root;e&&(F_(t.x,e.offset.x),F_(t.y,e.offset.y))}return t}removeElementScroll(e){let t=c_();if(xv(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&xv(t,e),F_(t.x,i.offset.x),F_(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||c_();xv(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(F_(r.x,-n.scroll.offset.x),F_(r.y,-n.scroll.offset.y)),T_(n.latestValues)&&R_(r,n.latestValues,n.layout?.layoutBox)}return T_(this.latestValues)&&R_(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=c_();xv(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!T_(n.latestValues))continue;let r;n.instance&&(w_(n.latestValues)&&n.updateSnapshot(),r=c_(),xv(r,n.measurePageBox())),Hv(t,n.latestValues,n.snapshot?.layoutBox,r)}return T_(this.latestValues)&&Hv(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0: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!==Zf.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=Zf.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=c_(),this.targetWithTransforms=c_()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Pv(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):xv(this.target,this.layout.layoutBox),j_(this.target,this.targetDelta)):xv(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Gf.value&&gy.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||w_(this.parent.latestValues)||E_(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=c_(),this.relativeTargetOrigin=c_(),Iv(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),xv(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Zf.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;xv(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;P_(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=c_());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Sv(this.prevProjectionDelta.x,this.projectionDelta.x),Sv(this.prevProjectionDelta.y,this.projectionDelta.y)),Mv(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Xv(this.projectionDelta.x,this.prevProjectionDelta.x)||!Xv(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Gf.value&&gy.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=o_(),this.projectionDelta=o_(),this.projectionDeltaWithTransform=o_()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=o_();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=c_(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(Vy));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;Ry(a.x,e.x,n),Ry(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Iv(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),By(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&Kv(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=c_(),xv(d,this.relativeTarget)),s&&(this.animationValues=i,ry(i,r,this.latestValues,n,u,l)),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&&=(Xf(this.pendingAnimation),void 0),this.pendingAnimation=Yf.update(()=>{hy.hasAnimatedSinceResize=!0,np.layout++,this.motionValue||=Hh(0),this.motionValue.jump(0,!1),this.currentAnimation=cy(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{np.layout--},onComplete:()=>{np.layout--,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);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(vy),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&qy(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||c_();let t=kv(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=kv(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}xv(t,n),R_(t,i),Mv(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new my),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&by(`z`,e,r,this.animationValues);for(let t=0;t<_y.length;t++)by(`rotate${_y[t]}`,e,r,this.animationValues),by(`skew${_y[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=py(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=py(t?.pointerEvents)||``),this.hasProjected&&!T_(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Qv(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Y_){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Y_[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?py(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Oy),this.root.sharedNodes.clear()}}}function Cy(e){e.updateLayout()}function wy(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)Zv(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=kv(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;bv(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else qy(i,t.layoutBox,n)&&Zv(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=kv(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=o_();Mv(o,n,t.layoutBox);let s=o_();a?Mv(s,e.applyTransform(r,!0),t.measuredBox):Mv(s,n,t.layoutBox);let c=!Wv(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=c_();Iv(s,t.layoutBox,i.layoutBox,o);let c=c_();Iv(c,n,a.layoutBox,o),Jv(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Ty(e){Gf.value&&gy.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Ey(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Dy(e){e.clearSnapshot()}function Oy(e){e.clearMeasurements()}function ky(e){e.isLayoutDirty=!0,e.updateLayout()}function Ay(e){e.isLayoutDirty=!1}function jy(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function My(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Ny(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Py(e){e.resolveTargetDelta()}function Fy(e){e.calcProjection()}function Iy(e){e.resetSkewAndRotation()}function Ly(e){e.removeLeadSnapshot()}function Ry(e,t,n){e.translate=Xp(t.translate,0,n),e.scale=Xp(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function zy(e,t,n,r){e.min=Xp(t.min,n.min,r),e.max=Xp(t.max,n.max,r)}function By(e,t,n,r){zy(e.x,t.x,n.x,r),zy(e.y,t.y,n.y,r)}function Vy(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Hy={duration:.45,ease:[.4,0,.1,1]},Uy=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Wy=Uy(`applewebkit/`)&&!Uy(`chrome/`)?Math.round:mf;function Gy(e){e.min=Wy(e.min),e.max=Wy(e.max)}function Ky(e){Gy(e.x),Gy(e.y)}function qy(e,t,n){return e===`position`||e===`preserve-aspect`&&!Av(Yv(t),Yv(n),.2)}function Jy(e){return e!==e.root&&e.scroll?.wasRoot}var Yy=Sy({attachResizeListener:(e,t)=>ly(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Xy={current:void 0},Zy=Sy({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Xy.current){let e=new Yy({});e.mount(window),e.setOptions({layoutScroll:!0}),Xy.current=e}return Xy.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Qy=(0,z.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function $y(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Hee(...e){return t=>{let n=!1,r=e.map(e=>{let r=$y(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():$y(e[t],null)}}}}function Uee(...e){return z.useCallback(Hee(...e),e)}var Wee=class extends z.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(Tg(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=Tg(e)&&e.offsetWidth||0,r=Tg(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}};function Gee({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,z.useId)(),s=(0,z.useRef)(null),c=(0,z.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:l}=(0,z.useContext)(Qy),u=Uee(s,e.props?.ref??e?.ref);return(0,z.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m}=c.current;if(t||a===!1||!s.current||!e||!u)return;let h=n===`left`?`left: ${f}`:`right: ${p}`,g=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let _=document.createElement(`style`);l&&(_.nonce=l);let v=i??document.head;return v.appendChild(_),_.sheet&&_.sheet.insertRule(`
|
|
19
|
+
`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=No(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&ss.assertOptions(n,{silentJSONParsing:cs.transitional(cs.boolean),forcedJSONParsing:cs.transitional(cs.boolean),clarifyTimeoutError:cs.transitional(cs.boolean),legacyInterceptorReqResOrdering:cs.transitional(cs.boolean)},!1),r!=null&&(V.isFunction(r)?t.paramsSerializer={serialize:r}:ss.assertOptions(r,{encode:cs.function,serialize:cs.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),ss.assertOptions(t,{baseUrl:cs.spelling(`baseURL`),withXsrfToken:cs.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&V.merge(i.common,i[t.method]);i&&V.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`common`],e=>{delete i[e]}),t.headers=go.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||Ba;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[ns.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=ns.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=No(this.defaults,e),Ra(jo(e.baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};V.forEach([`delete`,`get`,`head`,`options`],function(e){ls.prototype[e]=function(t,n){return this.request(No(n||{},{method:e,url:t,data:(n||{}).data}))}}),V.forEach([`post`,`put`,`patch`],function(e){function t(t){return function(n,r,i){return this.request(No(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}ls.prototype[e]=t(),ls.prototype[e+`Form`]=t(!0)});var us=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new yo(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function ds(e){return function(t){return e.apply(null,t)}}function fs(e){return V.isObject(e)&&e.isAxiosError===!0}var ps={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ps).forEach(([e,t])=>{ps[t]=e});function ms(e){let t=new ls(e),n=_i(ls.prototype.request,t);return V.extend(n,ls.prototype,t,{allOwnKeys:!0}),V.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return ms(No(e,t))},n}var hs=ms(to);hs.Axios=ls,hs.CanceledError=yo,hs.CancelToken=us,hs.isCancel=vo,hs.VERSION=rs,hs.toFormData=Na,hs.AxiosError=H,hs.Cancel=hs.CanceledError,hs.all=function(e){return Promise.all(e)},hs.spread=ds,hs.isAxiosError=fs,hs.mergeConfig=No,hs.AxiosHeaders=go,hs.formToJSON=e=>Qa(V.isHTMLForm(e)?new FormData(e):e),hs.getAdapter=es.getAdapter,hs.HttpStatusCode=ps,hs.default=hs;var gs=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),_s=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),vs=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),ys=e=>{let t=vs(e);return t.charAt(0).toUpperCase()+t.slice(1)},bs={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},xs=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Ss=(0,z.createContext)({}),Cs=()=>(0,z.useContext)(Ss),ws=(0,z.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Cs()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,z.createElement)(`svg`,{ref:c,...bs,width:t??l??bs.width,height:t??l??bs.height,stroke:e??f,strokeWidth:m,className:gs(`lucide`,p,i),...!a&&!xs(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,z.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),U=(e,t)=>{let n=(0,z.forwardRef)(({className:n,...r},i)=>(0,z.createElement)(ws,{ref:i,iconNode:t,className:gs(`lucide-${_s(ys(e))}`,`lucide-${e}`,n),...r}));return n.displayName=ys(e),n},Ts=U(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),Es=U(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),Ds=U(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Os=U(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),ks=U(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),As=U(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),js=U(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Ms=U(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),Ns=U(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),Ps=U(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),Fs=U(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),Is=U(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),Ls=U(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Rs=U(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),zs=U(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Bs=U(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Vs=U(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Hs=U(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Us=U(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Ws=U(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Gs=U(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Ks=U(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),qs=U(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Js=U(`command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),Ys=U(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Xs=U(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),Zs=U(`dollar-sign`,[[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`22`,key:`7eqyqh`}],[`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`,key:`1b0p4s`}]]),Qs=U(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),$s=U(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),ec=U(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),tc=U(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),nc=U(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),rc=U(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),ic=U(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),ac=U(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),oc=U(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),sc=U(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),cc=U(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]),lc=U(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),uc=U(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),dc=U(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),fc=U(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),pc=U(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),mc=U(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),hc=U(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),gc=U(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),_c=U(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),vc=U(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),yc=U(`pen`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),bc=U(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),xc=U(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Sc=U(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Cc=U(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),wc=U(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Tc=U(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Ec=U(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Dc=U(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Oc=U(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),kc=U(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Ac=U(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),jc=U(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Mc=U(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),Nc=U(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Pc=U(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),Fc=U(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Ic=U(`test-tube`,[[`path`,{d:`M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2`,key:`125lnx`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}],[`path`,{d:`M14.5 16h-5`,key:`1ox875`}]]),Lc=U(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Rc=U(`trending-up`,[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]),zc=U(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Bc=U(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Vc=U(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),Hc=U(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Uc=U(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Wc=U(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),Gc=u(y(),1),Kc=u(_(),1),qc=(0,z.createContext)({toast:()=>{}}),Jc=()=>{};function Yc(e,t=`error`){Jc(e,t)}function Xc({children:e}){let[t,n]=(0,z.useState)([]),r={current:0},i=(0,z.useCallback)((e,t=`error`)=>{let i=++r.current;n(n=>[...n,{id:i,type:t,message:e}]),setTimeout(()=>n(e=>e.filter(e=>e.id!==i)),4e3)},[]);(0,z.useEffect)(()=>{Jc=i},[i]);let a={success:Us,error:Gs,warning:zc},o={success:`bg-green-50 border-green-200 text-green-800`,error:`bg-red-50 border-red-200 text-red-800`,warning:`bg-yellow-50 border-yellow-200 text-yellow-800`},s={success:`text-green-500`,error:`text-red-500`,warning:`text-yellow-500`};return(0,B.jsxs)(qc.Provider,{value:{toast:i},children:[e,(0,Kc.createPortal)((0,B.jsx)(`div`,{className:`fixed bottom-4 right-4 z-[9999] flex flex-col gap-2 max-w-sm`,children:t.map(e=>{let t=a[e.type];return(0,B.jsxs)(`div`,{className:`flex items-start gap-3 px-4 py-3 rounded-lg border shadow-lg text-sm ${o[e.type]}`,children:[(0,B.jsx)(t,{className:`h-4 w-4 mt-0.5 flex-shrink-0 ${s[e.type]}`}),(0,B.jsx)(`span`,{className:`flex-1`,children:e.message}),(0,B.jsx)(`button`,{onClick:()=>n(t=>t.filter(t=>t.id!==e.id)),children:(0,B.jsx)(Uc,{className:`h-3.5 w-3.5 opacity-60 hover:opacity-100`})})]},e.id)})}),document.body)]})}var W=hs.create({baseURL:`/api`,timeout:3e4});W.interceptors.response.use(e=>e,e=>(Yc(e.response?.data?.error||e.response?.data?.message||e.message||`请求失败`,`error`),Promise.reject(e)));var Zc=()=>W.get(`/health`),Qc=()=>W.get(`/config`),$c=e=>W.put(`/config`,e),el=()=>W.get(`/config/history`),tl=e=>W.get(`/sessions`,{params:e}),nl=e=>W.get(`/sessions/${e}`),rl=e=>W.delete(`/sessions/${e}`),il=e=>W.delete(`/sessions`,{data:{ids:e}}),al=e=>W.get(`/events`,{params:e}),ol=e=>W.get(`/events/stats`,{params:{project_path:e}}),sl=e=>W.get(`/pipelines`,{params:e}),cl=e=>W.get(`/pipelines/${e}`),ll=e=>W.get(`/quality/history`,{params:e}),ul=e=>W.get(`/quality/unresolved`,{params:{project_path:e}}),dl=()=>W.get(`/stats/roi`),fl=()=>W.get(`/stats/overview`),pl=(e,t,n)=>W.get(`/knowledge/search`,{params:{q:e,project_path:t,node_type:n}}),ml=e=>W.get(`/knowledge/overview`,{params:{project_path:e}}),hl=(e,t)=>W.get(`/knowledge/neighbors`,{params:{node_id:e,project_path:t}}),gl=(e,t)=>W.get(`/knowledge/graph`,{params:{project_path:e,node_type:t}}),_l=e=>W.post(`/knowledge/nodes`,e),vl=(e,t)=>W.put(`/knowledge/nodes/${e}`,t),yl=e=>W.delete(`/knowledge/nodes/${e}`),bl=e=>W.post(`/pipelines/${e}/close`),xl=e=>W.post(`/pipelines/batch-close`,{ids:e}),Sl=()=>W.post(`/pipelines/close-expired`),Cl=()=>W.get(`/pipelines/active`),wl=e=>W.post(`/pipelines/${e}/resume`),Tl=e=>W.get(`/projects`,{params:e}),El=e=>W.get(`/projects/${e}`),Dl=e=>W.delete(`/projects/${e}`),Ol=e=>W.post(`/convention/init`,{path:e},{timeout:18e4}),kl=e=>W.get(`/projects/${e}/conventions`),Al=(e,t)=>W.post(`/projects/${e}/conventions/bind`,{conventionId:t}),jl=(e,t)=>W.delete(`/projects/${e}/conventions/${encodeURIComponent(t)}`),Ml=e=>W.get(`/projects/${e}/conventions/custom/yaml`),Nl=(e,t)=>W.put(`/projects/${e}/conventions/custom`,{yaml:t}),Pl=e=>W.post(`/projects/${e}/conventions/distill`,{},{timeout:12e4}),Fl=e=>W.get(`/claudemd/${e}`),Il=(e,t)=>W.put(`/claudemd/${e}`,{content:t}),Ll=e=>W.get(`/claudemd/${e}/profile`),Rl=e=>W.get(`/claudemd/${e}/modules`),zl=e=>W.post(`/claudemd/${e}/distill`,void 0,{timeout:18e4}),Bl=e=>W.post(`/claudemd/${e}/init`,void 0,{timeout:18e4}),Vl=e=>W.post(`/quality/${e}/resolve`),Hl=e=>W.post(`/quality/${e}/dismiss`),Ul=e=>W.post(`/quality/batch-dismiss`,{ids:e}),Wl=()=>W.post(`/quality/resolve-all`),Gl=e=>W.get(`/quality/${e}/context`),Kl=()=>W.get(`/daemon/status`),ql=()=>W.post(`/daemon/restart`),Jl=()=>W.get(`/daemon/diagnose`),Yl=()=>W.post(`/daemon/repair`),Xl=()=>W.post(`/config/backup`),Zl=()=>W.get(`/config/backups`),Ql=e=>`/api/config/backups/${encodeURIComponent(e)}`,$l=e=>W.post(`/events/purge`,{retentionDays:e}),eu=e=>W.get(`/stats/api-usage`,{params:{days:e}}),tu=e=>W.get(`/skills`,{params:e}),nu=()=>W.get(`/skills/status`),ru=e=>W.get(`/skills/${encodeURIComponent(e)}`),iu=(e,t)=>W.post(`/skills/search`,{query:e,...t},{timeout:3e4}),au=e=>W.post(`/skills/install`,{url:e},{timeout:6e4}),ou=e=>W.delete(`/skills/${encodeURIComponent(e)}`),su=e=>W.post(`/skills/batch-delete`,{names:e}),cu=()=>W.post(`/skills/evolve`,{},{timeout:12e4}),lu=()=>W.post(`/skills/distill`,{},{timeout:12e4}),uu=()=>W.post(`/skills/repair`,{},{timeout:6e4}),du=()=>W.get(`/conventions`),fu=e=>W.get(`/conventions/${encodeURIComponent(e)}`),pu=()=>W.post(`/conventions/sync-official`),mu=e=>W.post(`/conventions/install`,{url:e},{timeout:3e4}),hu=e=>W.delete(`/conventions/${encodeURIComponent(e)}`),gu=()=>W.get(`/conventions/usage-stats`),_u=e=>W.get(`/conventions/${encodeURIComponent(e)}/evolution-history`),vu=e=>W.post(`/conventions/batch-evolve`,{conventionIds:e},{timeout:12e4}),yu=e=>W.get(`/conventions/${encodeURIComponent(e)}/yaml`),bu=(e,t)=>W.put(`/conventions/${encodeURIComponent(e)}/yaml`,{yaml:t}),xu=e=>W.get(`/node-types`,{params:e?{projectPath:e}:void 0}),Su=e=>W.get(`/node-types/${encodeURIComponent(e)}`);function Cu(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Cu(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function wu(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Cu(e))&&(r&&(r+=` `),r+=t);return r}var Tu=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Eu=(e,t)=>({classGroupId:e,validator:t}),Du=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ou=`-`,ku=[],Au=`arbitrary..`,ju=e=>{let t=Pu(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Nu(e);let n=e.split(Ou);return Mu(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Tu(i,t):t:i||ku}return n[e]||ku}}},Mu=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Mu(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Ou):e.slice(t).join(Ou),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Nu=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Au+r:void 0})(),Pu=e=>{let{theme:t,classGroups:n}=e;return Fu(n,t)},Fu=(e,t)=>{let n=Du();for(let r in e){let i=e[r];Iu(i,n,r,t)}return n},Iu=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Lu(i,t,n,r)}},Lu=(e,t,n,r)=>{if(typeof e==`string`){Ru(e,t,n);return}if(typeof e==`function`){zu(e,t,n,r);return}Bu(e,t,n,r)},Ru=(e,t,n)=>{let r=e===``?t:Vu(t,e);r.classGroupId=n},zu=(e,t,n,r)=>{if(Hu(e)){Iu(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Eu(n,e))},Bu=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Iu(o,Vu(t,a),n,r)}},Vu=(e,t)=>{let n=e,r=t.split(Ou),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Du(),n.nextPart.set(t,i)),n=i}return n},Hu=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Uu=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Wu=`!`,Gu=`:`,Ku=[],qu=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ju=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Gu){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Wu)?(c=s.slice(0,-1),l=!0):s.startsWith(Wu)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return qu(t,l,c,u)};if(t){let e=t+Gu,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):qu(Ku,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Yu=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Xu=e=>({cache:Uu(e.cacheSize),parseClassName:Ju(e),sortModifiers:Yu(e),...ju(e)}),Zu=/\s+/,Qu=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(Zu),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+Wu:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},$u=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=ed(n))&&(i&&(i+=` `),i+=r);return i},ed=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=ed(e[r]))&&(n&&(n+=` `),n+=t);return n},td=(e,...t)=>{let n,r,i,a,o=o=>(n=Xu(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Qu(e,n);return i(e,a),a};return a=o,(...e)=>a($u(...e))},nd=[],rd=e=>{let t=t=>t[e]||nd;return t.isThemeGetter=!0,t},id=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ad=/^\((?:(\w[\w-]*):)?(.+)\)$/i,od=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,sd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cd=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ld=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ud=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fd=e=>od.test(e),pd=e=>!!e&&!Number.isNaN(Number(e)),md=e=>!!e&&Number.isInteger(Number(e)),hd=e=>e.endsWith(`%`)&&pd(e.slice(0,-1)),gd=e=>sd.test(e),_d=()=>!0,vd=e=>cd.test(e)&&!ld.test(e),yd=()=>!1,bd=e=>ud.test(e),xd=e=>dd.test(e),Sd=e=>!G(e)&&!K(e),Cd=e=>Rd(e,Hd,yd),G=e=>id.test(e),wd=e=>Rd(e,Ud,vd),Td=e=>Rd(e,Wd,pd),Ed=e=>Rd(e,Kd,_d),Dd=e=>Rd(e,Gd,yd),Od=e=>Rd(e,Bd,yd),kd=e=>Rd(e,Vd,xd),Ad=e=>Rd(e,qd,bd),K=e=>ad.test(e),jd=e=>zd(e,Ud),Md=e=>zd(e,Gd),Nd=e=>zd(e,Bd),Pd=e=>zd(e,Hd),Fd=e=>zd(e,Vd),Id=e=>zd(e,qd,!0),Ld=e=>zd(e,Kd,!0),Rd=(e,t,n)=>{let r=id.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},zd=(e,t,n=!1)=>{let r=ad.exec(e);return r?r[1]?t(r[1]):n:!1},Bd=e=>e===`position`||e===`percentage`,Vd=e=>e===`image`||e===`url`,Hd=e=>e===`length`||e===`size`||e===`bg-size`,Ud=e=>e===`length`,Wd=e=>e===`number`,Gd=e=>e===`family-name`,Kd=e=>e===`number`||e===`weight`,qd=e=>e===`shadow`,Jd=td(()=>{let e=rd(`color`),t=rd(`font`),n=rd(`text`),r=rd(`font-weight`),i=rd(`tracking`),a=rd(`leading`),o=rd(`breakpoint`),s=rd(`container`),c=rd(`spacing`),l=rd(`radius`),u=rd(`shadow`),d=rd(`inset-shadow`),f=rd(`text-shadow`),p=rd(`drop-shadow`),m=rd(`blur`),h=rd(`perspective`),g=rd(`aspect`),_=rd(`ease`),v=rd(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),K,G],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[K,G,c],T=()=>[fd,`full`,`auto`,...w()],E=()=>[md,`none`,`subgrid`,K,G],D=()=>[`auto`,{span:[`full`,md,K,G]},md,K,G],O=()=>[md,`auto`,K,G],k=()=>[`auto`,`min`,`max`,`fr`,K,G],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[fd,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ee=()=>[fd,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],P=()=>[fd,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],F=()=>[e,K,G],I=()=>[...b(),Nd,Od,{position:[K,G]}],te=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ne=()=>[`auto`,`cover`,`contain`,Pd,Cd,{size:[K,G]}],re=()=>[hd,jd,wd],L=()=>[``,`none`,`full`,l,K,G],R=()=>[``,pd,jd,wd],ie=()=>[`solid`,`dashed`,`dotted`,`double`],ae=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],oe=()=>[pd,hd,Nd,Od],se=()=>[``,`none`,m,K,G],ce=()=>[`none`,pd,K,G],le=()=>[`none`,pd,K,G],ue=()=>[pd,K,G],de=()=>[fd,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[gd],breakpoint:[gd],color:[_d],container:[gd],"drop-shadow":[gd],ease:[`in`,`out`,`in-out`],font:[Sd],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[gd],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[gd],shadow:[gd],spacing:[`px`,pd],text:[gd],"text-shadow":[gd],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,fd,G,K,g]}],container:[`container`],columns:[{columns:[pd,G,K,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[md,`auto`,K,G]}],basis:[{basis:[fd,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[pd,fd,`auto`,`initial`,`none`,G]}],grow:[{grow:[``,pd,K,G]}],shrink:[{shrink:[``,pd,K,G]}],order:[{order:[md,`first`,`last`,`none`,K,G]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...ee()]}],"min-inline-size":[{"min-inline":[`auto`,...ee()]}],"max-inline-size":[{"max-inline":[`none`,...ee()]}],"block-size":[{block:[`auto`,...P()]}],"min-block-size":[{"min-block":[`auto`,...P()]}],"max-block-size":[{"max-block":[`none`,...P()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,jd,wd]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Ld,Ed]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,hd,G]}],"font-family":[{font:[Md,Dd,t]}],"font-features":[{"font-features":[G]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,K,G]}],"line-clamp":[{"line-clamp":[pd,`none`,K,Td]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,K,G]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,K,G]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ie(),`wavy`]}],"text-decoration-thickness":[{decoration:[pd,`from-font`,`auto`,K,wd]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[pd,`auto`,K,G]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,K,G]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,K,G]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:ne()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},md,K,G],radial:[``,K,G],conic:[md,K,G]},Fd,kd]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:R()}],"border-w-x":[{"border-x":R()}],"border-w-y":[{"border-y":R()}],"border-w-s":[{"border-s":R()}],"border-w-e":[{"border-e":R()}],"border-w-bs":[{"border-bs":R()}],"border-w-be":[{"border-be":R()}],"border-w-t":[{"border-t":R()}],"border-w-r":[{"border-r":R()}],"border-w-b":[{"border-b":R()}],"border-w-l":[{"border-l":R()}],"divide-x":[{"divide-x":R()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":R()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ie(),`hidden`,`none`]}],"divide-style":[{divide:[...ie(),`hidden`,`none`]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-bs":[{"border-bs":F()}],"border-color-be":[{"border-be":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...ie(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[pd,K,G]}],"outline-w":[{outline:[``,pd,jd,wd]}],"outline-color":[{outline:F()}],shadow:[{shadow:[``,`none`,u,Id,Ad]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":[`none`,d,Id,Ad]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:R()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[pd,wd]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":R()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":[`none`,f,Id,Ad]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[pd,K,G]}],"mix-blend":[{"mix-blend":[...ae(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[pd]}],"mask-image-linear-from-pos":[{"mask-linear-from":oe()}],"mask-image-linear-to-pos":[{"mask-linear-to":oe()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":oe()}],"mask-image-t-to-pos":[{"mask-t-to":oe()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":oe()}],"mask-image-r-to-pos":[{"mask-r-to":oe()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":oe()}],"mask-image-b-to-pos":[{"mask-b-to":oe()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":oe()}],"mask-image-l-to-pos":[{"mask-l-to":oe()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":oe()}],"mask-image-x-to-pos":[{"mask-x-to":oe()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":oe()}],"mask-image-y-to-pos":[{"mask-y-to":oe()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[K,G]}],"mask-image-radial-from-pos":[{"mask-radial-from":oe()}],"mask-image-radial-to-pos":[{"mask-radial-to":oe()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[pd]}],"mask-image-conic-from-pos":[{"mask-conic-from":oe()}],"mask-image-conic-to-pos":[{"mask-conic-to":oe()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:ne()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,K,G]}],filter:[{filter:[``,`none`,K,G]}],blur:[{blur:se()}],brightness:[{brightness:[pd,K,G]}],contrast:[{contrast:[pd,K,G]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Id,Ad]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:[``,pd,K,G]}],"hue-rotate":[{"hue-rotate":[pd,K,G]}],invert:[{invert:[``,pd,K,G]}],saturate:[{saturate:[pd,K,G]}],sepia:[{sepia:[``,pd,K,G]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,K,G]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[pd,K,G]}],"backdrop-contrast":[{"backdrop-contrast":[pd,K,G]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,pd,K,G]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[pd,K,G]}],"backdrop-invert":[{"backdrop-invert":[``,pd,K,G]}],"backdrop-opacity":[{"backdrop-opacity":[pd,K,G]}],"backdrop-saturate":[{"backdrop-saturate":[pd,K,G]}],"backdrop-sepia":[{"backdrop-sepia":[``,pd,K,G]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,K,G]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[pd,`initial`,K,G]}],ease:[{ease:[`linear`,`initial`,_,K,G]}],delay:[{delay:[pd,K,G]}],animate:[{animate:[`none`,v,K,G]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,K,G]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:le()}],"scale-x":[{"scale-x":le()}],"scale-y":[{"scale-y":le()}],"scale-z":[{"scale-z":le()}],"scale-3d":[`scale-3d`],skew:[{skew:ue()}],"skew-x":[{"skew-x":ue()}],"skew-y":[{"skew-y":ue()}],transform:[{transform:[K,G,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:de()}],"translate-x":[{"translate-x":de()}],"translate-y":[{"translate-y":de()}],"translate-z":[{"translate-z":de()}],"translate-none":[`translate-none`],accent:[{accent:F()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,K,G]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,K,G]}],fill:[{fill:[`none`,...F()]}],"stroke-w":[{stroke:[pd,jd,wd,Td]}],stroke:[{stroke:[`none`,...F()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function q(...e){return Jd(wu(e))}function Yd(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),r=Math.floor(n/60),i=Math.floor(r/24);return i>0?`${i}天${r%24}小时`:r>0?`${r}小时${n%60}分钟`:n>0?`${n}分钟${t%60}秒`:`${t}秒`}function Xd(e){return e>=1e9?`${(e/1e9).toFixed(1)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function Zd(e){let t={active:`text-green-600 bg-green-50`,completed:`text-blue-600 bg-blue-50`,failed:`text-red-600 bg-red-50`,interrupted:`text-yellow-600 bg-yellow-50`,pending:`text-gray-600 bg-gray-50`};return t[e]||t.pending}function Qd(e){return e?e.endsWith(`Z`)||/[+-]\d{2}:\d{2}$/.test(e)?new Date(e):new Date(e+`Z`):new Date}var $d=[{path:`/dashboard`,label:`仪表盘`,icon:uc},{path:`/projects`,label:`项目管理`,icon:ac},{path:`/sessions`,label:`会话管理`,icon:Ts},{path:`/events`,label:`事件流`,icon:Ps},{path:`/pipelines`,label:`流水线`,icon:sc},{path:`/quality`,label:`质量门禁`,icon:Oc},{path:`/knowledge`,label:`知识图谱`,icon:Ns},{path:`/skills`,label:`技能管理`,icon:_c},{path:`/conventions`,label:`规范管理`,icon:As},{path:`/node-types`,label:`节点类型`,icon:Ms},{path:`/analytics`,label:`数据分析`,icon:Fs},{path:`/config`,label:`系统配置`,icon:Dc}];function ef({children:e}){let[t,n]=(0,z.useState)(()=>localStorage.getItem(`sidebar-collapsed`)===`true`),r=jn();(0,z.useEffect)(()=>{localStorage.setItem(`sidebar-collapsed`,String(t))},[t]);let{data:i}=ct({queryKey:[`health`],queryFn:()=>Zc().then(e=>e.data),refetchInterval:15e3}),a=$d.find(e=>r.pathname.startsWith(e.path));return(0,B.jsxs)(`div`,{className:`flex min-h-screen bg-gray-50`,children:[(0,B.jsxs)(`aside`,{className:q(`fixed top-0 left-0 bottom-0 z-50 flex flex-col transition-all duration-300`,`bg-gradient-to-b from-slate-900 to-slate-800`,t?`w-16`:`w-60`),children:[(0,B.jsxs)(`div`,{className:q(`flex items-center border-b border-white/10 h-16`,t?`justify-center px-2`:`justify-between px-5`),children:[!t&&(0,B.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,B.jsx)(`div`,{className:`flex items-center justify-center w-8 h-8 rounded-lg bg-gradient-to-br from-blue-500 to-purple-600`,children:(0,B.jsx)(Wc,{className:`h-5 w-5 text-white`})}),(0,B.jsx)(`span`,{className:`text-white font-bold text-lg tracking-tight`,children:`Forge`})]}),(0,B.jsx)(`button`,{onClick:()=>n(!t),className:`p-1.5 rounded-lg text-white/60 hover:text-white hover:bg-white/10 transition-colors`,children:t?(0,B.jsx)(mc,{className:`h-5 w-5`}):(0,B.jsx)(zs,{className:`h-5 w-5`})})]}),(0,B.jsx)(`nav`,{className:`flex-1 py-4 space-y-1 px-2`,children:$d.map(e=>(0,B.jsxs)(ei,{to:e.path,className:({isActive:e})=>q(`flex items-center gap-3 rounded-lg transition-all duration-200`,t?`justify-center p-3`:`px-3 py-2.5`,e?`bg-blue-600/20 text-blue-400`:`text-white/60 hover:text-white hover:bg-white/5`),children:[(0,B.jsx)(e.icon,{className:`h-5 w-5 flex-shrink-0`}),!t&&(0,B.jsx)(`span`,{className:`text-sm font-medium`,children:e.label})]},e.path))}),(0,B.jsx)(`div`,{className:q(`border-t border-white/10 py-4`,t?`px-2`:`px-5`),children:(0,B.jsxs)(`div`,{className:q(`flex items-center gap-2`,t?`justify-center`:``),children:[(0,B.jsx)(`div`,{className:q(`w-2 h-2 rounded-full`,i?.status===`ok`?`bg-green-400 animate-pulse`:`bg-red-400`)}),!t&&(0,B.jsx)(`span`,{className:`text-xs text-white/40`,children:i?.status===`ok`?`Daemon 运行中`:`连接断开`})]})})]}),(0,B.jsxs)(`main`,{className:q(`flex-1 transition-all duration-300`,t?`ml-16`:`ml-60`),children:[(0,B.jsxs)(`header`,{className:`sticky top-0 z-40 bg-white/80 backdrop-blur-md border-b border-gray-200/50 h-16 flex items-center justify-between px-8`,children:[(0,B.jsx)(`h1`,{className:`text-xl font-semibold text-gray-900`,children:a?.label||`Claude Forge`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,B.jsxs)(`button`,{className:`hidden sm:flex items-center gap-2 px-3 py-1.5 text-sm text-gray-600 hover:text-gray-900 hover:bg-gray-100 rounded-lg transition-colors`,onClick:()=>{let e=new KeyboardEvent(`keydown`,{key:`k`,metaKey:!0});window.dispatchEvent(e)},children:[(0,B.jsx)(Js,{className:`h-4 w-4`}),(0,B.jsx)(`span`,{children:`命令面板`}),(0,B.jsx)(`kbd`,{className:`px-2 py-0.5 text-xs bg-gray-100 rounded border border-gray-200`,children:`⌘K`})]}),(0,B.jsxs)(`span`,{className:`text-sm text-gray-500`,children:[`v`,`1.53.0`]}),(0,B.jsxs)(`div`,{className:q(`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-semibold`,i?.status===`ok`?`bg-green-50 text-green-700 border border-green-200`:`bg-red-50 text-red-700 border border-red-200`),children:[(0,B.jsx)(`div`,{className:q(`w-1.5 h-1.5 rounded-full`,i?.status===`ok`?`bg-green-500`:`bg-red-500`)}),i?.status===`ok`?`在线`:`离线`]})]})]}),(0,B.jsx)(`div`,{className:`p-8 overflow-x-hidden`,children:e})]})]})}var tf=(0,z.createContext)({});function nf(e){let t=(0,z.useRef)(null);return t.current===null&&(t.current=e()),t.current}var rf=typeof window<`u`?z.useLayoutEffect:z.useEffect,af=(0,z.createContext)(null);function of(e,t){e.indexOf(t)===-1&&e.push(t)}function sf(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var cf=(e,t,n)=>n>t?t:n<e?e:n,lf={},uf=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function df(e){return typeof e==`object`&&!!e}var ff=e=>/^0[^.\s]+$/u.test(e);function pf(e){let t;return()=>(t===void 0&&(t=e()),t)}var mf=e=>e,hf=(e,t)=>n=>t(e(n)),gf=(...e)=>e.reduce(hf),_f=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},vf=class{constructor(){this.subscriptions=[]}add(e){return of(this.subscriptions,e),()=>sf(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},yf=e=>e*1e3,bf=e=>e/1e3;function xf(e,t){return t?1e3/t*e:0}var Sf=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Cf=1e-7,wf=12;function Tf(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Sf(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Cf&&++s<wf);return o}function Ef(e,t,n,r){if(e===t&&n===r)return mf;let i=t=>Tf(t,0,1,e,n);return e=>e===0||e===1?e:Sf(i(e),t,r)}var Df=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Of=e=>t=>1-e(1-t),kf=Ef(.33,1.53,.69,.99),Af=Of(kf),jf=Df(Af),Mf=e=>e>=1?1:(e*=2)<1?.5*Af(e):.5*(2-2**(-10*(e-1))),Nf=e=>1-Math.sin(Math.acos(e)),Pf=Of(Nf),Ff=Df(Nf),If=Ef(.42,0,1,1),Lf=Ef(0,0,.58,1),Rf=Ef(.42,0,.58,1),zf=e=>Array.isArray(e)&&typeof e[0]!=`number`,Bf=e=>Array.isArray(e)&&typeof e[0]==`number`,Vf={linear:mf,easeIn:If,easeInOut:Rf,easeOut:Lf,circIn:Nf,circInOut:Ff,circOut:Pf,backIn:Af,backInOut:jf,backOut:kf,anticipate:Mf},Hf=e=>typeof e==`string`,Uf=e=>{if(Bf(e)){e.length;let[t,n,r,i]=e;return Ef(t,n,r,i)}else if(Hf(e))return Vf[e],`${e}`,Vf[e];return e},Wf=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],Gf={value:null,addProjectionMetrics:null};function Kf(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0;let o=n;n=r,r=o,n.forEach(l),t&&Gf.value&&Gf.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var qf=40;function Jf(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Wf.reduce((e,n)=>(e[n]=Kf(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=lf.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,qf),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Wf.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Wf.length;t++)o[Wf[t]].cancel(e)},state:i,steps:o}}var{schedule:Yf,cancel:Xf,state:Zf,steps:Qf}=Jf(typeof requestAnimationFrame<`u`?requestAnimationFrame:mf,!0),$f;function ep(){$f=void 0}var tp={now:()=>($f===void 0&&tp.set(Zf.isProcessing||lf.useManualTiming?Zf.timestamp:performance.now()),$f),set:e=>{$f=e,queueMicrotask(ep)}},np={layout:0,mainThread:0,waapi:0},rp=e=>t=>typeof t==`string`&&t.startsWith(e),ip=rp(`--`),ap=rp(`var(--`),op=e=>ap(e)?sp.test(e.split(`/*`)[0].trim()):!1,sp=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function cp(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var lp={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},up={...lp,transform:e=>cf(0,1,e)},dp={...lp,default:1},fp=e=>Math.round(e*1e5)/1e5,pp=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function mp(e){return e==null}var hp=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,gp=(e,t)=>n=>!!(typeof n==`string`&&hp.test(n)&&n.startsWith(e)||t&&!mp(n)&&Object.prototype.hasOwnProperty.call(n,t)),_p=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(pp);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},vp=e=>cf(0,255,e),yp={...lp,transform:e=>Math.round(vp(e))},bp={test:gp(`rgb`,`red`),parse:_p(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+yp.transform(e)+`, `+yp.transform(t)+`, `+yp.transform(n)+`, `+fp(up.transform(r))+`)`};function xp(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}}var Sp={test:gp(`#`),parse:xp,transform:bp.transform},Cp=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),wp=Cp(`deg`),Tp=Cp(`%`),J=Cp(`px`),Ep=Cp(`vh`),Dp=Cp(`vw`),Op={...Tp,parse:e=>Tp.parse(e)/100,transform:e=>Tp.transform(e*100)},kp={test:gp(`hsl`,`hue`),parse:_p(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Tp.transform(fp(t))+`, `+Tp.transform(fp(n))+`, `+fp(up.transform(r))+`)`},Ap={test:e=>bp.test(e)||Sp.test(e)||kp.test(e),parse:e=>bp.test(e)?bp.parse(e):kp.test(e)?kp.parse(e):Sp.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?bp.transform(e):kp.transform(e),getAnimatableNone:e=>{let t=Ap.parse(e);return t.alpha=0,Ap.transform(t)}},jp=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Mp(e){return isNaN(e)&&typeof e==`string`&&(e.match(pp)?.length||0)+(e.match(jp)?.length||0)>0}var Np=`number`,Pp=`color`,Fp=`var`,Ip=`var(`,Lp="${}",Rp=/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 zp(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Rp,e=>(Ap.test(e)?(r.color.push(a),i.push(Pp),n.push(Ap.parse(e))):e.startsWith(Ip)?(r.var.push(a),i.push(Fp),n.push(e)):(r.number.push(a),i.push(Np),n.push(parseFloat(e))),++a,Lp)).split(Lp),indexes:r,types:i}}function Bp(e){return zp(e).values}function Vp({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];e===Np?i+=fp(r[a]):e===Pp?i+=Ap.transform(r[a]):i+=r[a]}return i}}function Hp(e){return Vp(zp(e))}var Up=e=>typeof e==`number`?0:Ap.test(e)?Ap.getAnimatableNone(e):e,Wp=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Up(e);function Gp(e){let t=zp(e);return Vp(t)(t.values.map((e,n)=>Wp(e,t.split[n])))}var Kp={test:Mp,parse:Bp,createTransformer:Hp,getAnimatableNone:Gp};function qp(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Jp({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=qp(s,r,e+1/3),a=qp(s,r,e),o=qp(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Yp(e,t){return n=>n>0?t:e}var Xp=(e,t,n)=>e+(t-e)*n,Zp=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Qp=[Sp,bp,kp],$p=e=>Qp.find(t=>t.test(e));function em(e){let t=$p(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===kp&&(n=Jp(n)),n}var tm=(e,t)=>{let n=em(e),r=em(t);if(!n||!r)return Yp(e,t);let i={...n};return e=>(i.red=Zp(n.red,r.red,e),i.green=Zp(n.green,r.green,e),i.blue=Zp(n.blue,r.blue,e),i.alpha=Xp(n.alpha,r.alpha,e),bp.transform(i))},nm=new Set([`none`,`hidden`]);function rm(e,t){return nm.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function im(e,t){return n=>Xp(e,t,n)}function am(e){return typeof e==`number`?im:typeof e==`string`?op(e)?Yp:Ap.test(e)?tm:nee:Array.isArray(e)?om:typeof e==`object`?Ap.test(e)?tm:eee:Yp}function om(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>am(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function eee(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=am(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function tee(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var nee=(e,t)=>{let n=Kp.createTransformer(t),r=zp(e),i=zp(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?nm.has(e)&&!i.values.length||nm.has(t)&&!r.values.length?rm(e,t):gf(om(tee(r,i),i.values),n):(`${e}${t}`,Yp(e,t))};function sm(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?Xp(e,t,n):am(e)(e,t)}var cm=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Yf.update(t,e),stop:()=>Xf(t),now:()=>Zf.isProcessing?Zf.timestamp:tp.now()}},lm=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},um=2e4;function dm(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function fm(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(dm(r),um);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:bf(i)}}var pm={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function mm(e,t){return e*Math.sqrt(1-t*t)}var hm=12;function gm(e,t,n){let r=n;for(let n=1;n<hm;n++)r-=e(r)/t(r);return r}var _m=.001;function ree({duration:e=pm.duration,bounce:t=pm.bounce,velocity:n=pm.velocity,mass:r=pm.mass}){let i,a;pm.maxDuration;let o=1-t;o=cf(pm.minDamping,pm.maxDamping,o),e=cf(pm.minDuration,pm.maxDuration,bf(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=mm(t,o),c=Math.exp(-i);return _m-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=mm(t**2,o);return(-i(t)+_m>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-_m+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=gm(i,a,s);if(e=yf(e),isNaN(c))return{stiffness:pm.stiffness,damping:pm.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var iee=[`duration`,`bounce`],aee=[`stiffness`,`damping`,`mass`];function vm(e,t){return t.some(t=>e[t]!==void 0)}function oee(e){let t={velocity:pm.velocity,stiffness:pm.stiffness,damping:pm.damping,mass:pm.mass,isResolvedFromDuration:!1,...e};if(!vm(e,aee)&&vm(e,iee))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*cf(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:pm.mass,stiffness:i,damping:a}}else{let n=ree({...e,velocity:0});t={...t,...n,mass:pm.mass},t.isResolvedFromDuration=!0}return t}function ym(e=pm.visualDuration,t=pm.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=oee({...n,velocity:-bf(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=bf(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?pm.restSpeed.granular:pm.restSpeed.default,i||=v?pm.restDelta.granular:pm.restDelta.default;let y,b,x,S,C,w;if(h<1)x=mm(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(S*Math.sin(x*e)+g*Math.cos(x*e)),C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>yf(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=yf(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=yf(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(dm(T),um),t=lm(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}ym.applyToOptions=e=>{let t=fm(e,100,ym);return e.ease=t.ease,e.duration=yf(t.duration),e.type=`keyframes`,e};var see=5;function bm(e,t,n){let r=Math.max(t-see,0);return xf(n-e(r),t-r)}function xm({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=ym({keyframes:[f.value,m(f.value)],velocity:bm(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function Sm(e,t,n){let r=[],i=n||lf.mix||sm,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=gf(Array.isArray(t)?t[n]||mf:t,a)),r.push(a)}return r}function Cm(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Sm(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=_f(e[r],e[r+1],n);return s[r](i)};return n?t=>l(cf(e[0],e[a-1],t)):l}function wm(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=_f(0,t,r);e.push(Xp(n,1,i))}}function Tm(e){let t=[0];return wm(t,e.length-1),t}function Em(e,t){return e.map(e=>e*t)}function Dm(e,t){return e.map(()=>t||Rf).splice(0,e.length-1)}function Om({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=zf(r)?r.map(Uf):Uf(r),a={done:!1,value:t[0]},o=Cm(Em(n&&n.length===t.length?n:Tm(t),e),t,{ease:Array.isArray(i)?i:Dm(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var km=e=>e!==null;function Am(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(km),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var jm={decay:xm,inertia:xm,tween:Om,keyframes:Om,spring:ym};function Mm(e){typeof e.type==`string`&&(e.type=jm[e.type])}var Nm=class{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)}},Pm=e=>e/100,Fm=class extends Nm{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==tp.now()&&this.tick(tp.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},np.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Mm(e);let{type:t=Om,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Om;s!==Om&&typeof o[0]!=`number`&&(this.mixKeyframes=gf(Pm,sm(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=dm(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=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);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=cf(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==xm&&(b.value=Am(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return bf(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+bf(e)}get time(){return bf(this.currentTime)}set time(e){e=yf(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return bm(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(tp.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=bf(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=cm,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(tp.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&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,np.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),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)}};function Im(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var Lm=e=>e*180/Math.PI,Rm=e=>Bm(Lm(Math.atan2(e[1],e[0]))),zm={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Rm,rotateZ:Rm,skewX:e=>Lm(Math.atan(e[1])),skewY:e=>Lm(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Bm=e=>(e%=360,e<0&&(e+=360),e),Vm=Rm,Hm=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Um=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),cee={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Hm,scaleY:Um,scale:e=>(Hm(e)+Um(e))/2,rotateX:e=>Bm(Lm(Math.atan2(e[6],e[5]))),rotateY:e=>Bm(Lm(Math.atan2(-e[2],e[0]))),rotateZ:Vm,rotate:Vm,skewX:e=>Lm(Math.atan(e[4])),skewY:e=>Lm(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Wm(e){return+!!e.includes(`scale`)}function Gm(e,t){if(!e||e===`none`)return Wm(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=cee,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=zm,i=t}if(!i)return Wm(t);let a=r[t],o=i[1].split(`,`).map(uee);return typeof a==`function`?a(o):o[a]}var lee=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Gm(n,t)};function uee(e){return parseFloat(e.trim())}var Km=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],qm=new Set(Km),Jm=e=>e===lp||e===J,Ym=new Set([`x`,`y`,`z`]),Xm=Km.filter(e=>!Ym.has(e));function Zm(e){let t=[];return Xm.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var Qm={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-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})=>Gm(t,`x`),y:(e,{transform:t})=>Gm(t,`y`)};Qm.translateX=Qm.x,Qm.translateY=Qm.y;var $m=new Set,eh=!1,th=!1,nh=!1;function rh(){if(th){let e=Array.from($m).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=Zm(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}th=!1,eh=!1,$m.forEach(e=>e.complete(nh)),$m.clear()}function ih(){$m.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(th=!0)})}function ah(){nh=!0,ih(),rh(),nh=!1}var oh=class{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?($m.add(this),eh||(eh=!0,Yf.read(ih),Yf.resolveKeyframes(rh))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Im(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),$m.delete(this)}cancel(){this.state===`scheduled`&&($m.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},sh=e=>e.startsWith(`--`);function ch(e,t,n){sh(t)?e.style.setProperty(t,n):e.style[t]=n}var lh={};function uh(e,t){let n=pf(e);return()=>lh[t]??n()}var dh=uh(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),fh=uh(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),ph=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,mh={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:ph([0,.65,.55,1]),circOut:ph([.55,0,1,.45]),backIn:ph([.31,.01,.66,-.59]),backOut:ph([.33,1.53,.69,.99])};function hh(e,t){if(e)return typeof e==`function`?fh()?lm(e,t):`ease-out`:Bf(e)?ph(e):Array.isArray(e)?e.map(e=>hh(e,t)||mh.easeOut):mh[e]}function gh(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=hh(s,i);Array.isArray(d)&&(u.easing=d),Gf.value&&np.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return Gf.value&&p.finished.finally(()=>{np.waapi--}),p}function _h(e){return typeof e==`function`&&`applyToOptions`in e}function vh({type:e,...t}){return _h(e)&&fh()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var yh=class extends Nm{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=vh(e);this.animation=gh(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Am(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),ch(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return bf(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+bf(e)}get time(){return bf(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=yf(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&dh()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),mf):r(this)}},bh={anticipate:Mf,backInOut:jf,circInOut:Ff};function xh(e){return e in bh}function Sh(e){typeof e.ease==`string`&&xh(e.ease)&&(e.ease=bh[e.ease])}var Ch=10,wh=class extends yh{constructor(e){Sh(e),Mm(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Fm({...a,autoplay:!1}),s=Math.max(Ch,tp.now()-this.startTime),c=cf(0,Ch,s-Ch),l=o.sample(s).value,{name:u}=this.options;i&&u&&ch(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},Th=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Kp.test(e)||e===`0`)&&!e.startsWith(`url(`));function Eh(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Dh(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Th(i,t),s=Th(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:Eh(e)||(n===`spring`||_h(n))&&r}function Oh(e){e.duration=0,e.type=`keyframes`}var kh=new Set([`opacity`,`clipPath`,`filter`,`transform`]),Ah=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function dee(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&Ah.test(e[t]))return!0;return!1}var fee=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),pee=pf(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function mee(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return pee()&&n&&(kh.has(n)||fee.has(n)&&dee(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var hee=40,gee=class extends Nm{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=tp.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u};this.keyframeResolver=new(l?.KeyframeResolver||oh)(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=tp.now();let u=!0;Dh(e,i,a,o)||(u=!1,(lf.instantAnimations||!s)&&l?.(Am(e,n,t)),e[0]=e[e.length-1],Oh(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>hee?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&mee(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new wh({...d,element:p})}catch{m=new Fm(d)}else m=new Fm(d);m.finished.then(()=>{this.notifyFinished()}).catch(mf),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}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(),ah()),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 jh(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var _ee=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function vee(e){let t=_ee.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Mh(e,t,n=1){`${e}`;let[r,i]=vee(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return uf(e)?parseFloat(e):e}return op(i)?Mh(i,t,n+1):i}var yee={type:`spring`,stiffness:500,damping:25,restSpeed:10},bee=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),xee={type:`keyframes`,duration:.8},See={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Cee=(e,{keyframes:t})=>t.length>2?xee:qm.has(e)?e.startsWith(`scale`)?bee(t[1]):yee:See;function Nh(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Ph(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Nh(n,e)}var wee=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Tee(e){for(let t in e)if(!wee.has(t))return!0;return!1}var Fh=(e,t,n,r={},i,a)=>o=>{let s=Ph(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=yf(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,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};Tee(s)||Object.assign(u,Cee(e,u)),u.duration&&=yf(u.duration),u.repeatDelay&&=yf(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Oh(u),u.delay===0&&(d=!0)),(lf.instantAnimations||lf.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,Oh(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Am(u.keyframes,s);if(e!==void 0){Yf.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Fm(u):new gee(u)};function Ih(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Lh(e,t,n,r){if(typeof t==`function`){let[i,a]=Ih(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=Ih(r);t=t(n===void 0?e.custom:n,i,a)}return t}function Rh(e,t,n){let r=e.getProps();return Lh(r,t,n===void 0?r.custom:n,e)}var zh=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Km]),Bh=30,Eee=e=>!isNaN(parseFloat(e)),Vh={current:void 0},Dee=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=tp.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(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=tp.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Eee(this.current))}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 vf);let n=this.events[e].add(t);return e===`change`?()=>{n(),Yf.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let 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||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Vh.current&&Vh.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=tp.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Bh)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Bh);return xf(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 Hh(e,t){return new Dee(e,t)}var Uh=e=>Array.isArray(e);function Wh(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Hh(n))}function Gh(e){return Uh(e)?e[e.length-1]||0:e}function Kh(e,t){let{transitionEnd:n={},transition:r={},...i}=Rh(e,t)||{};i={...i,...n};for(let t in i)Wh(e,t,Gh(i[t]))}var qh=e=>!!(e&&e.getVelocity);function Jh(e){return!!(qh(e)&&e.add)}function Yh(e,t){let n=e.getValue(`willChange`);if(Jh(n))return n.add(t);if(!n&&lf.WillChange){let n=new lf.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Xh(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Zh=`data-`+Xh(`framerAppearId`);function Qh(e){return e.props[Zh]}function $h({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function eg(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Nh(a,c):c;let l=a?.reduceMotion;r&&(a=r);let u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||d&&$h(d,t))continue;let o={delay:n,...Ph(a||{},t)},c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){Yf.update(()=>r.set(i));continue}let f=!1;if(window.MotionHandoffAnimation){let n=Qh(e);if(n){let e=window.MotionHandoffAnimation(n,t,Yf);e!==null&&(o.startTime=e,f=!0)}}Yh(e,t);let p=l??e.shouldReduceMotion;r.start(Fh(t,r,i,p&&zh.has(t)?{type:!1}:o,e,f));let m=r.animation;m&&u.push(m)}if(o){let t=()=>Yf.update(()=>{o&&Kh(e,o)});u.length?Promise.all(u).then(t):t()}return u}function tg(e,t,n={}){let r=Rh(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(eg(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return ng(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function ng(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(tg(c,t,{...o,delay:n+(typeof r==`function`?0:r)+jh(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function rg(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>tg(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=tg(e,t,n);else{let i=typeof t==`function`?Rh(e,t,n.custom):t;r=Promise.all(eg(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var ig={test:e=>e===`auto`,parse:e=>e},ag=e=>t=>t.test(e),og=[lp,J,Tp,wp,Dp,Ep,ig],sg=e=>og.find(ag(e));function cg(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||ff(e)}var lg=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function ug(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(pp)||[];if(!r)return e;let i=n.replace(r,``),a=+!!lg.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var dg=/\b([a-z-]*)\(.*?\)/gu,fg={...Kp,getAnimatableNone:e=>{let t=e.match(dg);return t?t.map(ug).join(` `):e}},pg={...Kp,getAnimatableNone:e=>{let t=Kp.parse(e);return Kp.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},mg={...lp,transform:Math.round},hg={borderWidth:J,borderTopWidth:J,borderRightWidth:J,borderBottomWidth:J,borderLeftWidth:J,borderRadius:J,borderTopLeftRadius:J,borderTopRightRadius:J,borderBottomRightRadius:J,borderBottomLeftRadius:J,width:J,maxWidth:J,height:J,maxHeight:J,top:J,right:J,bottom:J,left:J,inset:J,insetBlock:J,insetBlockStart:J,insetBlockEnd:J,insetInline:J,insetInlineStart:J,insetInlineEnd:J,padding:J,paddingTop:J,paddingRight:J,paddingBottom:J,paddingLeft:J,paddingBlock:J,paddingBlockStart:J,paddingBlockEnd:J,paddingInline:J,paddingInlineStart:J,paddingInlineEnd:J,margin:J,marginTop:J,marginRight:J,marginBottom:J,marginLeft:J,marginBlock:J,marginBlockStart:J,marginBlockEnd:J,marginInline:J,marginInlineStart:J,marginInlineEnd:J,fontSize:J,backgroundPositionX:J,backgroundPositionY:J,rotate:wp,rotateX:wp,rotateY:wp,rotateZ:wp,scale:dp,scaleX:dp,scaleY:dp,scaleZ:dp,skew:wp,skewX:wp,skewY:wp,distance:J,translateX:J,translateY:J,translateZ:J,x:J,y:J,z:J,perspective:J,transformPerspective:J,opacity:up,originX:Op,originY:Op,originZ:J,zIndex:mg,fillOpacity:up,strokeOpacity:up,numOctaves:mg},gg={...hg,color:Ap,backgroundColor:Ap,outlineColor:Ap,fill:Ap,stroke:Ap,borderColor:Ap,borderTopColor:Ap,borderRightColor:Ap,borderBottomColor:Ap,borderLeftColor:Ap,filter:fg,WebkitFilter:fg,mask:pg,WebkitMask:pg},_g=e=>gg[e],vg=new Set([fg,pg]);function yg(e,t){let n=_g(e);return vg.has(n)||(n=Kp),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var bg=new Set([`auto`,`none`,`0`]);function xg(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!bg.has(t)&&zp(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=yg(n,i)}var Sg=class extends oh{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),op(r))){let i=Mh(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!zh.has(n)||e.length!==2)return;let[r,i]=e,a=sg(r),o=sg(i);if(cp(r)!==cp(i)&&Qm[n]){this.needsMeasurement=!0;return}if(a!==o)if(Jm(a)&&Jm(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Qm[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||cg(e[t]))&&n.push(t);n.length&&xg(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Qm[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=Qm[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function Cg(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var wg=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function Tg(e){return df(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:Eg,cancel:Oee}=Jf(queueMicrotask,!1),Dg={x:!1,y:!1};function Og(){return Dg.x||Dg.y}function kg(e){return e===`x`||e===`y`?Dg[e]?null:(Dg[e]=!0,()=>{Dg[e]=!1}):Dg.x||Dg.y?null:(Dg.x=Dg.y=!0,()=>{Dg.x=Dg.y=!1})}function Ag(e,t){let n=Cg(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function jg(e){return!(e.pointerType===`touch`||Og())}function Mg(e,t,n={}){let[r,i,a]=Ag(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!jg(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var Ng=(e,t)=>t?e===t?!0:Ng(e,t.parentElement):!1,Pg=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Fg=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Ig(e){return Fg.has(e.tagName)||e.isContentEditable===!0}var Lg=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Rg(e){return Lg.has(e.tagName)||e.isContentEditable===!0}var zg=new WeakSet;function Bg(e){return t=>{t.key===`Enter`&&e(t)}}function Vg(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var Hg=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=Bg(()=>{if(zg.has(n))return;Vg(n,`down`);let e=Bg(()=>{Vg(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>Vg(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function Ug(e){return Pg(e)&&!Og()}var Wg=new WeakSet;function Gg(e,t,n={}){let[r,i,a]=Ag(e,n),o=e=>{let r=e.currentTarget;if(!Ug(e)||Wg.has(e))return;zg.add(r),n.stopPropagation&&Wg.add(e);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),zg.has(r)&&zg.delete(r),Ug(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||Ng(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Tg(e)&&(e.addEventListener(`focus`,e=>Hg(e,i)),!Ig(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function Kg(e){return df(e)&&`ownerSVGElement`in e}var qg=new WeakMap,Jg,Yg=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Kg(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Xg=Yg(`inline`,`width`,`offsetWidth`),Zg=Yg(`block`,`height`,`offsetHeight`);function Qg({target:e,borderBoxSize:t}){qg.get(e)?.forEach(n=>{n(e,{get width(){return Xg(e,t)},get height(){return Zg(e,t)}})})}function $g(e){e.forEach(Qg)}function e_(){typeof ResizeObserver>`u`||(Jg=new ResizeObserver($g))}function t_(e,t){Jg||e_();let n=Cg(e);return n.forEach(e=>{let n=qg.get(e);n||(n=new Set,qg.set(e,n)),n.add(t),Jg?.observe(e)}),()=>{n.forEach(e=>{let n=qg.get(e);n?.delete(t),n?.size||Jg?.unobserve(e)})}}var n_=new Set,r_;function kee(){r_=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};n_.forEach(t=>t(e))},window.addEventListener(`resize`,r_)}function Aee(e){return n_.add(e),r_||kee(),()=>{n_.delete(e),!n_.size&&typeof r_==`function`&&(window.removeEventListener(`resize`,r_),r_=void 0)}}function i_(e,t){return typeof e==`function`?Aee(e):t_(e,t)}function jee(e){return Kg(e)&&e.tagName===`svg`}var Mee=[...og,Ap,Kp],Nee=e=>Mee.find(ag(e)),a_=()=>({translate:0,scale:1,origin:0,originPoint:0}),o_=()=>({x:a_(),y:a_()}),s_=()=>({min:0,max:0}),c_=()=>({x:s_(),y:s_()}),Pee=new WeakMap;function l_(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function u_(e){return typeof e==`string`||Array.isArray(e)}var d_=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],f_=[`initial`,...d_];function p_(e){return l_(e.animate)||f_.some(t=>u_(e[t]))}function m_(e){return!!(p_(e)||e.variants)}function Fee(e,t,n){for(let r in t){let i=t[r],a=n[r];if(qh(i))e.addValue(r,i);else if(qh(a))e.addValue(r,Hh(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Hh(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var h_={current:null},g_={current:!1},Iee=typeof window<`u`;function Lee(){if(g_.current=!0,Iee)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>h_.current=e.matches;e.addEventListener(`change`,t),t()}else h_.current=!1}var __=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],v_={};function y_(e){v_=e}function Ree(){return v_}var zee=class{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=oh,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=()=>{let e=tp.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Yf.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,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=!!a,this.isControllingVariants=p_(t),this.isVariantNode=m_(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&qh(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,Pee.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)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(g_.current||Lee(),this.shouldReduceMotion=h_.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(),Xf(this.notifyUpdate),Xf(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),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&&kh.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new yh({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:yf(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=qm.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&Yf.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&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?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in v_){let t=v_[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let 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):c_()}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 t=0;t<__.length;t++){let n=__[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Fee(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){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let 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);let 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 n===void 0&&t!==void 0&&(n=Hh(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(uf(n)||ff(n))?n=parseFloat(n):!Nee(n)&&Kp.test(t)&&(n=yg(e,t)),this.setBaseTarget(e,qh(n)?n.get():n)),qh(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Lh(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!qh(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new vf),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Eg.render(this.render)}},b_=class extends zee{constructor(){super(...arguments),this.KeyframeResolver=Sg}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let 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);let{children:e}=this.props;qh(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},x_=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function S_({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Bee({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Vee(e,t){if(!t)return e;let 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}}function C_(e){return e===void 0||e===1}function w_({scale:e,scaleX:t,scaleY:n}){return!C_(e)||!C_(t)||!C_(n)}function T_(e){return w_(e)||E_(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function E_(e){return D_(e.x)||D_(e.y)}function D_(e){return e&&e!==`0%`}function O_(e,t,n){return n+t*(e-n)}function k_(e,t,n,r,i){return i!==void 0&&(e=O_(e,i,r)),O_(e,n,r)+t}function A_(e,t=0,n=1,r,i){e.min=k_(e.min,t,n,r,i),e.max=k_(e.max,t,n,r,i)}function j_(e,{x:t,y:n}){A_(e.x,t.translate,t.scale,t.originPoint),A_(e.y,n.translate,n.scale,n.originPoint)}var M_=.999999999999,N_=1.0000000000001;function P_(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(F_(e.x,-a.scroll.offset.x),F_(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,j_(e,o)),r&&T_(a.latestValues)&&R_(e,a.latestValues,a.layout?.layoutBox))}t.x<N_&&t.x>M_&&(t.x=1),t.y<N_&&t.y>M_&&(t.y=1)}function F_(e,t){e.min+=t,e.max+=t}function I_(e,t,n,r,i=.5){A_(e,t,n,Xp(e.min,e.max,i),r)}function L_(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function R_(e,t,n){let r=n??e;I_(e.x,L_(t.x,r.x),t.scaleX,t.scale,t.originX),I_(e.y,L_(t.y,r.y),t.scaleY,t.scale,t.originY)}function z_(e,t){return S_(Vee(e.getBoundingClientRect(),t))}function B_(e,t,n){let r=z_(e,n),{scroll:i}=t;return i&&(F_(r.x,i.offset.x),F_(r.y,i.offset.y)),r}var V_={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},H_=Km.length;function U_(e,t,n){let r=``,i=!0;for(let a=0;a<H_;a++){let o=Km[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=wg(s,hg[o]);if(!c){i=!1;let t=V_[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function W_(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(qm.has(e)){o=!0;continue}else if(ip(e)){i[e]=n;continue}else{let t=wg(n,hg[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=U_(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function G_(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function K_(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var q_={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(J.test(e))e=parseFloat(e);else return e;return`${K_(e,t.target.x)}% ${K_(e,t.target.y)}%`}},J_={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Kp.parse(e);if(i.length>5)return r;let a=Kp.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Xp(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Y_={borderRadius:{...q_,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:q_,borderTopRightRadius:q_,borderBottomLeftRadius:q_,borderBottomRightRadius:q_,boxShadow:J_};function X_(e,{layout:t,layoutId:n}){return qm.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Y_[e]||e===`opacity`)}function Z_(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(qh(r[t])||i&&qh(i[t])||X_(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Q_(e){return window.getComputedStyle(e)}var $_=class extends b_{constructor(){super(...arguments),this.type=`html`,this.renderInstance=G_}readValueFromInstance(e,t){if(qm.has(t))return this.projection?.isProjecting?Wm(t):lee(e,t);{let n=Q_(e),r=(ip(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return z_(e,t)}build(e,t,n){W_(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Z_(e,t,n)}},ev={offset:`stroke-dashoffset`,array:`stroke-dasharray`},tv={offset:`strokeDashoffset`,array:`strokeDasharray`};function nv(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?ev:tv;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var rv=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function iv(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(W_(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{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=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of rv)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&nv(d,i,a,o,!1)}var av=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`]),ov=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function sv(e,t,n,r){G_(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(av.has(n)?n:Xh(n),t.attrs[n])}function cv(e,t,n){let r=Z_(e,t,n);for(let n in e)if(qh(e[n])||qh(t[n])){let t=Km.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var lv=class extends b_{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=c_}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(qm.has(t)){let e=_g(t);return e&&e.default||0}return t=av.has(t)?t:Xh(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return cv(e,t,n)}build(e,t,n){iv(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){sv(e,t,n,r)}mount(e){this.isSVGTag=ov(e.tagName),super.mount(e)}},uv=f_.length;function dv(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&dv(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<uv;n++){let r=f_[n],i=e.props[r];(u_(i)||i===!1)&&(t[r]=i)}return t}function fv(e,t){if(!Array.isArray(t))return!1;let 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}var pv=[...d_].reverse(),mv=d_.length;function hv(e){return t=>Promise.all(t.map(({animation:t,options:n})=>rg(e,t,n)))}function gv(e){let t=hv(e),n=yv(),r=!0,i=!1,a=t=>(n,r)=>{let i=Rh(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=dv(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<mv;t++){let p=pv[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=u_(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||l_(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=_v(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Uh(t)&&Uh(n)?!fv(t,n):t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=Rh(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=jh(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=Rh(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=yv(),i=!0}}}function _v(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!fv(t,e):!1}function vv(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function yv(){return{animate:vv(!0),whileInView:vv(),whileHover:vv(),whileTap:vv(),whileDrag:vv(),whileFocus:vv(),exit:vv()}}function bv(e,t){e.min=t.min,e.max=t.max}function xv(e,t){bv(e.x,t.x),bv(e.y,t.y)}function Sv(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Cv=1e-4,wv=1-Cv,Tv=1+Cv,Ev=.01,Dv=0-Ev,Ov=0+Ev;function kv(e){return e.max-e.min}function Av(e,t,n){return Math.abs(e-t)<=n}function jv(e,t,n,r=.5){e.origin=r,e.originPoint=Xp(t.min,t.max,e.origin),e.scale=kv(n)/kv(t),e.translate=Xp(n.min,n.max,e.origin)-e.originPoint,(e.scale>=wv&&e.scale<=Tv||isNaN(e.scale))&&(e.scale=1),(e.translate>=Dv&&e.translate<=Ov||isNaN(e.translate))&&(e.translate=0)}function Mv(e,t,n,r){jv(e.x,t.x,n.x,r?r.originX:void 0),jv(e.y,t.y,n.y,r?r.originY:void 0)}function Nv(e,t,n,r=0){e.min=(r?Xp(n.min,n.max,r):n.min)+t.min,e.max=e.min+kv(t)}function Pv(e,t,n,r){Nv(e.x,t.x,n.x,r?.x),Nv(e.y,t.y,n.y,r?.y)}function Fv(e,t,n,r=0){let i=r?Xp(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+kv(t)}function Iv(e,t,n,r){Fv(e.x,t.x,n.x,r?.x),Fv(e.y,t.y,n.y,r?.y)}function Lv(e,t,n,r,i){return e-=t,e=O_(e,1/n,r),i!==void 0&&(e=O_(e,1/i,r)),e}function Rv(e,t=0,n=1,r=.5,i,a=e,o=e){if(Tp.test(t)&&(t=parseFloat(t),t=Xp(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Xp(a.min,a.max,r);e===a&&(s-=t),e.min=Lv(e.min,t,n,s,i),e.max=Lv(e.max,t,n,s,i)}function zv(e,t,[n,r,i],a,o){Rv(e,t[n],t[r],t[i],t.scale,a,o)}var Bv=[`x`,`scaleX`,`originX`],Vv=[`y`,`scaleY`,`originY`];function Hv(e,t,n,r){zv(e.x,t,Bv,n?n.x:void 0,r?r.x:void 0),zv(e.y,t,Vv,n?n.y:void 0,r?r.y:void 0)}function Uv(e){return e.translate===0&&e.scale===1}function Wv(e){return Uv(e.x)&&Uv(e.y)}function Gv(e,t){return e.min===t.min&&e.max===t.max}function Kv(e,t){return Gv(e.x,t.x)&&Gv(e.y,t.y)}function qv(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Jv(e,t){return qv(e.x,t.x)&&qv(e.y,t.y)}function Yv(e){return kv(e.x)/kv(e.y)}function Xv(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Zv(e){return[e(`x`),e(`y`)]}function Qv(e,t,n){let r=``,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) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{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) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var $v=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],ey=$v.length,ty=e=>typeof e==`string`?parseFloat(e):e,ny=e=>typeof e==`number`||J.test(e);function ry(e,t,n,r,i,a){i?(e.opacity=Xp(0,n.opacity??1,ay(r)),e.opacityExit=Xp(t.opacity??1,0,oy(r))):a&&(e.opacity=Xp(t.opacity??1,n.opacity??1,r));for(let i=0;i<ey;i++){let a=$v[i],o=iy(t,a),s=iy(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||ny(o)===ny(s)?(e[a]=Math.max(Xp(ty(o),ty(s),r),0),(Tp.test(s)||Tp.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Xp(t.rotate||0,n.rotate||0,r))}function iy(e,t){return e[t]===void 0?e.borderRadius:e[t]}var ay=sy(0,.5,Pf),oy=sy(.5,.95,mf);function sy(e,t,n){return r=>r<e?0:r>t?1:n(_f(e,t,r))}function cy(e,t,n){let r=qh(e)?e:Hh(e);return r.start(Fh(``,r,t,n)),r.animation}function ly(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var uy=(e,t)=>e.depth-t.depth,dy=class{constructor(){this.children=[],this.isDirty=!1}add(e){of(this.children,e),this.isDirty=!0}remove(e){sf(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(uy),this.isDirty=!1,this.children.forEach(e)}};function fy(e,t){let n=tp.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Xf(r),e(a-t))};return Yf.setup(r,!0),()=>Xf(r)}function py(e){return qh(e)?e.get():e}var my=class{constructor(){this.members=[]}add(e){of(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(sf(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(sf(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},hy={hasAnimatedSinceResize:!0,hasEverUpdated:!1},gy={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},_y=[``,`X`,`Y`,`Z`],vy=1e3,yy=0;function by(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function xy(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Qh(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,Yf,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&xy(r)}function Sy({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=yy++,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,Gf.value&&(gy.nodes=gy.calculatedTargetDeltas=gy.calculatedProjections=0),this.nodes.forEach(Ty),this.nodes.forEach(Py),this.nodes.forEach(Fy),this.nodes.forEach(Ey),Gf.addProjectionMetrics&&Gf.addProjectionMetrics(gy)},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 e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new dy)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new vf),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=Kg(t)&&!jee(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;Yf.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=fy(i,250),hy.hasAnimatedSinceResize&&(hy.hasAnimatedSinceResize=!1,this.nodes.forEach(Ny)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Hy,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Jv(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Ph(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||Ny(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Xf(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(Iy),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&xy(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(ky),this.nodes.forEach(Oy);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ay);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(jy),this.nodes.forEach(My),this.nodes.forEach(Cy),this.nodes.forEach(wy)):this.nodes.forEach(Ay),this.clearAllSnapshots();let e=tp.now();Zf.delta=cf(0,1e3/60,e-Zf.timestamp),Zf.timestamp=e,Zf.isProcessing=!0,Qf.update.process(Zf),Qf.preRender.process(Zf),Qf.render.process(Zf),Zf.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Eg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Dy),this.sharedNodes.forEach(Ly)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Yf.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Yf.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!kv(this.snapshot.measuredBox.x)&&!kv(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=c_(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let 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;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Wv(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||T_(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Ky(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return c_();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Jy))){let{scroll:e}=this.root;e&&(F_(t.x,e.offset.x),F_(t.y,e.offset.y))}return t}removeElementScroll(e){let t=c_();if(xv(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&xv(t,e),F_(t.x,i.offset.x),F_(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||c_();xv(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(F_(r.x,-n.scroll.offset.x),F_(r.y,-n.scroll.offset.y)),T_(n.latestValues)&&R_(r,n.latestValues,n.layout?.layoutBox)}return T_(this.latestValues)&&R_(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=c_();xv(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!T_(n.latestValues))continue;let r;n.instance&&(w_(n.latestValues)&&n.updateSnapshot(),r=c_(),xv(r,n.measurePageBox())),Hv(t,n.latestValues,n.snapshot?.layoutBox,r)}return T_(this.latestValues)&&Hv(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0: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!==Zf.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=Zf.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=c_(),this.targetWithTransforms=c_()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Pv(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):xv(this.target,this.layout.layoutBox),j_(this.target,this.targetDelta)):xv(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Gf.value&&gy.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||w_(this.parent.latestValues)||E_(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=c_(),this.relativeTargetOrigin=c_(),Iv(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),xv(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Zf.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;xv(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;P_(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=c_());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Sv(this.prevProjectionDelta.x,this.projectionDelta.x),Sv(this.prevProjectionDelta.y,this.projectionDelta.y)),Mv(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Xv(this.projectionDelta.x,this.prevProjectionDelta.x)||!Xv(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Gf.value&&gy.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=o_(),this.projectionDelta=o_(),this.projectionDeltaWithTransform=o_()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=o_();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=c_(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(Vy));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;Ry(a.x,e.x,n),Ry(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Iv(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),By(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&Kv(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=c_(),xv(d,this.relativeTarget)),s&&(this.animationValues=i,ry(i,r,this.latestValues,n,u,l)),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&&=(Xf(this.pendingAnimation),void 0),this.pendingAnimation=Yf.update(()=>{hy.hasAnimatedSinceResize=!0,np.layout++,this.motionValue||=Hh(0),this.motionValue.jump(0,!1),this.currentAnimation=cy(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{np.layout--},onComplete:()=>{np.layout--,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);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(vy),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&qy(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||c_();let t=kv(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=kv(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}xv(t,n),R_(t,i),Mv(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new my),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&by(`z`,e,r,this.animationValues);for(let t=0;t<_y.length;t++)by(`rotate${_y[t]}`,e,r,this.animationValues),by(`skew${_y[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=py(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=py(t?.pointerEvents)||``),this.hasProjected&&!T_(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Qv(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Y_){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Y_[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?py(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Oy),this.root.sharedNodes.clear()}}}function Cy(e){e.updateLayout()}function wy(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)Zv(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=kv(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;bv(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else qy(i,t.layoutBox,n)&&Zv(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=kv(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=o_();Mv(o,n,t.layoutBox);let s=o_();a?Mv(s,e.applyTransform(r,!0),t.measuredBox):Mv(s,n,t.layoutBox);let c=!Wv(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=c_();Iv(s,t.layoutBox,i.layoutBox,o);let c=c_();Iv(c,n,a.layoutBox,o),Jv(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Ty(e){Gf.value&&gy.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Ey(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Dy(e){e.clearSnapshot()}function Oy(e){e.clearMeasurements()}function ky(e){e.isLayoutDirty=!0,e.updateLayout()}function Ay(e){e.isLayoutDirty=!1}function jy(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function My(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Ny(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Py(e){e.resolveTargetDelta()}function Fy(e){e.calcProjection()}function Iy(e){e.resetSkewAndRotation()}function Ly(e){e.removeLeadSnapshot()}function Ry(e,t,n){e.translate=Xp(t.translate,0,n),e.scale=Xp(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function zy(e,t,n,r){e.min=Xp(t.min,n.min,r),e.max=Xp(t.max,n.max,r)}function By(e,t,n,r){zy(e.x,t.x,n.x,r),zy(e.y,t.y,n.y,r)}function Vy(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Hy={duration:.45,ease:[.4,0,.1,1]},Uy=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Wy=Uy(`applewebkit/`)&&!Uy(`chrome/`)?Math.round:mf;function Gy(e){e.min=Wy(e.min),e.max=Wy(e.max)}function Ky(e){Gy(e.x),Gy(e.y)}function qy(e,t,n){return e===`position`||e===`preserve-aspect`&&!Av(Yv(t),Yv(n),.2)}function Jy(e){return e!==e.root&&e.scroll?.wasRoot}var Yy=Sy({attachResizeListener:(e,t)=>ly(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Xy={current:void 0},Zy=Sy({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Xy.current){let e=new Yy({});e.mount(window),e.setOptions({layoutScroll:!0}),Xy.current=e}return Xy.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Qy=(0,z.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function $y(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Hee(...e){return t=>{let n=!1,r=e.map(e=>{let r=$y(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():$y(e[t],null)}}}}function Uee(...e){return z.useCallback(Hee(...e),e)}var Wee=class extends z.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(Tg(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=Tg(e)&&e.offsetWidth||0,r=Tg(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}};function Gee({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,z.useId)(),s=(0,z.useRef)(null),c=(0,z.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:l}=(0,z.useContext)(Qy),u=Uee(s,e.props?.ref??e?.ref);return(0,z.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m}=c.current;if(t||a===!1||!s.current||!e||!u)return;let h=n===`left`?`left: ${f}`:`right: ${p}`,g=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let _=document.createElement(`style`);l&&(_.nonce=l);let v=i??document.head;return v.appendChild(_),_.sheet&&_.sheet.insertRule(`
|
|
20
20
|
[data-motion-pop-id="${o}"] {
|
|
21
21
|
position: absolute !important;
|
|
22
22
|
width: ${e}px !important;
|
|
@@ -73,4 +73,4 @@ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}
|
|
|
73
73
|
`,`
|
|
74
74
|
+`).split(`
|
|
75
75
|
`));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,z.useEffect)(()=>{let n=t?.target??R7,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&T5(e))return!1;let n=V7(e.code,s);if(a.current.add(e[n]),B7(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=V7(e.code,s);B7(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function B7(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function V7(e,t){return t.includes(e)?`code`:`key`}var Tce=()=>{let e=D7();return(0,z.useMemo)(()=>({zoomIn:t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):Promise.resolve(!1)},zoomOut:t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):Promise.resolve(!1)},zoomTo:(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=h5(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return f5(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=p5(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function H7(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)Ece(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function Ece(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes===`width`)&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes===`height`)&&(t.height=e.dimensions.height))),typeof e.resizing==`boolean`&&(t.resizing=e.resizing);break}}function U7(e,t){return H7(e,t)}function W7(e,t){return H7(e,t)}function G7(e,t){return{id:e,type:`select`,selected:t}}function K7(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);!(a.selected===void 0&&!e)&&a.selected!==e&&(n&&(a.selected=e),r.push(G7(a.id,e)))}return r}function q7({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function J7(e){return{id:e.id,type:`remove`}}var Y7=e=>ise(e),Dce=e=>G8(e);function X7(e){return(0,z.forwardRef)(e)}function Z7(e){let[t,n]=(0,z.useState)(BigInt(0)),[r]=(0,z.useState)(()=>Oce(()=>n(e=>e+BigInt(1))));return N7(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function Oce(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var Q7=(0,z.createContext)(null);function kce({children:e}){let t=D7(),n=Z7((0,z.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=q7({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=Z7((0,z.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(q7({items:s,lookup:o}))},[])),i=(0,z.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,B.jsx)(Q7.Provider,{value:i,children:e})}function Ace(){let e=(0,z.useContext)(Q7);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var jce=e=>!!e.panZoom;function $7(){let e=Tce(),t=D7(),n=Ace(),r=E7(jce),i=(0,z.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=Y7(e)?e:n.get(e.id),a=i.parentId?b5(i.position,i.measured,i.parentId,n,r):i.position;return a5({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&Y7(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&Dce(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await lse({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(J7);o?.(f),c(e)}if(m){let e=d.map(J7);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=l5(e),o=i?e:a(e),s=r!==void 0;return o?(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let c=a5(s?r:a),l=c5(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=l5(e)?e:a(e);if(!r)return!1;let i=c5(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return ase(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??pse();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,z.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var e9=e=>e.selected,Mce=typeof window<`u`?window:void 0;function Nce({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=D7(),{deleteElements:r}=$7(),i=z7(e,{actInsideInputWithModifier:!1}),a=z7(t,{target:Mce});(0,z.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(e9),edges:e.filter(e9)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,z.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function Pce(e){let t=D7();(0,z.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=C5(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,M8.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t&&e.current&&t.unobserve(e.current)}}},[])}var t9={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},Fce=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Ice({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=L8.Free,zoomOnDoubleClick:o=!0,panOnDrag:s=!0,defaultViewport:c,translateExtent:l,minZoom:u,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:p=!0,children:m,noWheelClassName:h,noPanClassName:g,onViewportChange:_,isControlledViewport:v,paneClickDistance:y,selectionOnDrag:b}){let x=D7(),S=(0,z.useRef)(null),{userSelectionActive:C,lib:w,connectionInProgress:T}=E7(Fce,C7),E=z7(f),D=(0,z.useRef)();Pce(S);let O=(0,z.useCallback)(e=>{_?.({x:e[0],y:e[1],zoom:e[2]}),v||x.setState({transform:e})},[_,v]);return(0,z.useEffect)(()=>{if(S.current){D.current=Xse({domNode:S.current,minZoom:u,maxZoom:d,translateExtent:l,viewport:c,onDraggingChange:e=>x.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=x.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=x.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=x.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=D.current.getViewport();return x.setState({panZoom:D.current,transform:[e,t,n],domNode:S.current.closest(`.react-flow`)}),()=>{D.current?.destroy()}}},[]),(0,z.useEffect)(()=>{D.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:s,zoomActivationKeyPressed:E,preventScrolling:p,noPanClassName:g,userSelectionActive:C,noWheelClassName:h,lib:w,onTransformChange:O,connectionInProgress:T,selectionOnDrag:b,paneClickDistance:y})},[e,t,n,r,i,a,o,s,E,p,g,C,h,w,O,T,b,y]),(0,B.jsx)(`div`,{className:`react-flow__renderer`,ref:S,style:t9,children:m})}var Lce=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Rce(){let{userSelectionActive:e,userSelectionRect:t}=E7(Lce,C7);return e&&t?(0,B.jsx)(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var n9=(e,t)=>n=>{n.target===t.current&&e?.(n)},zce=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function Bce({isSelecting:e,selectionKeyPressed:t,selectionMode:n=R8.Full,panOnDrag:r,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:s,onPaneClick:c,onPaneContextMenu:l,onPaneScroll:u,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:p,children:m}){let h=D7(),{userSelectionActive:g,elementsSelectable:_,dragging:v,connectionInProgress:y}=E7(zce,C7),b=_&&(e||g),x=(0,z.useRef)(null),S=(0,z.useRef)(),C=(0,z.useRef)(new Set),w=(0,z.useRef)(new Set),T=(0,z.useRef)(!1),E=e=>{if(T.current||y){T.current=!1;return}c?.(e),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},D=e=>{if(Array.isArray(r)&&r?.includes(2)){e.preventDefault();return}l?.(e)},O=u?e=>u(e):void 0;return(0,B.jsxs)(`div`,{className:w3([`react-flow__pane`,{draggable:r===!0||Array.isArray(r)&&r.includes(0),dragging:v,selection:e}]),onClick:b?void 0:n9(E,x),onContextMenu:n9(D,x),onWheel:n9(O,x),onPointerEnter:b?void 0:d,onPointerMove:b?e=>{let{userSelectionRect:r,transform:a,nodeLookup:s,edgeLookup:c,connectionLookup:l,triggerNodeChanges:u,triggerEdgeChanges:d,defaultEdgeOptions:f,resetSelectedElements:p}=h.getState();if(!S.current||!r)return;let{x:m,y:g}=D5(e.nativeEvent,S.current),{startX:_,startY:v}=r;if(!T.current){let n=t?0:i;if(Math.hypot(m-_,g-v)<=n)return;p(),o?.(e)}T.current=!0;let y={startX:_,startY:v,x:m<_?m:_,y:g<v?g:v,width:Math.abs(m-_),height:Math.abs(g-v)},b=C.current,x=w.current;C.current=new Set(Y8(s,y,a,n===R8.Partial,!0).map(e=>e.id)),w.current=new Set;let E=f?.selectable??!0;for(let e of C.current){let t=l.get(e);if(t)for(let{edgeId:e}of t.values()){let t=c.get(e);t&&(t.selectable??E)&&w.current.add(e)}}x5(b,C.current)||u(K7(s,C.current,!0)),x5(x,w.current)||d(K7(c,w.current)),h.setState({userSelectionRect:y,userSelectionActive:!0,nodesSelectionActive:!1})}:f,onPointerUp:b?e=>{e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!g&&e.target===x.current&&h.getState().userSelectionRect&&E?.(e),h.setState({userSelectionActive:!1,userSelectionRect:null}),T.current&&(s?.(e),h.setState({nodesSelectionActive:C.current.size>0})))}:void 0,onPointerDownCapture:b?n=>{let{domNode:r}=h.getState();if(S.current=r?.getBoundingClientRect(),!S.current)return;let i=n.target===x.current;if(!i&&n.target.closest(`.nokey`)||!e||!(a&&i||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),T.current=!1;let{x:o,y:s}=D5(n.nativeEvent,S.current);h.setState({userSelectionRect:{width:0,height:0,startX:o,startY:s,x:o,y:s}}),i||(n.stopPropagation(),n.preventDefault())}:void 0,onClickCapture:b?e=>{T.current&&=(e.stopPropagation(),!1)}:void 0,onPointerLeave:p,ref:x,style:t9,children:[m,(0,B.jsx)(Rce,{})]})}function r9({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);if(!l){c?.(`012`,M8.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function i9({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=D7(),[c,l]=(0,z.useState)(!1),u=(0,z.useRef)();return(0,z.useEffect)(()=>{u.current=Ise({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{r9({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}})},[]),(0,z.useEffect)(()=>{if(!(t||!e.current||!u.current))return u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o}),()=>{u.current?.destroy()}},[n,r,t,a,e,i,o]),c}var Vce=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function a9(){let e=D7();return(0,z.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=Vce(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=d5(t,i));let{position:a,positionAbsolute:s}=X8({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var o9=(0,z.createContext)(null),Hce=o9.Provider;o9.Consumer;var s9=()=>(0,z.useContext)(o9),Uce=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Wce=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o,u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===I8.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function Gce({type:e=`source`,position:t=H8.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let m=o||null,h=e===`target`,g=D7(),_=s9(),{connectOnClick:v,noPanClassName:y,rfId:b}=E7(Uce,C7),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=E7(Wce(_,m,e),C7);_||g.getState().onError?.(`010`,M8.error010());let O=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t}=g.getState();t(bse(i,e))}n?.(i),s?.(i)},k=e=>{if(!_)return;let t=E5(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();o7.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:_,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:O,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,B.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:w3([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,y,l,{source:!h,target:h,connectable:r,connectablestart:i,connectableend:a,clickconnecting:C,connectingfrom:x,connectingto:S,valid:D,connectionindicator:r&&(!T||w)&&(T||E?a:i)}]),onMouseDown:k,onTouchStart:k,onClick:v?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!_||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:_,handleId:m,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:_,type:e,id:m}});return}let p=w5(t.target),h=n||c,{connection:v,isValid:y}=o7.isValid(t.nativeEvent,{handle:{nodeId:_,id:m,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:h,flowId:u,doc:p,lib:l,nodeLookup:d});y&&v&&O(v);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var c9=(0,z.memo)(X7(Gce));function Kce({data:e,isConnectable:t,sourcePosition:n=H8.Bottom}){return(0,B.jsxs)(B.Fragment,{children:[e?.label,(0,B.jsx)(c9,{type:`source`,position:n,isConnectable:t})]})}function qce({data:e,isConnectable:t,targetPosition:n=H8.Top,sourcePosition:r=H8.Bottom}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(c9,{type:`target`,position:n,isConnectable:t}),e?.label,(0,B.jsx)(c9,{type:`source`,position:r,isConnectable:t})]})}function Jce(){return null}function Yce({data:e,isConnectable:t,targetPosition:n=H8.Top}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(c9,{type:`target`,position:n,isConnectable:t}),e?.label]})}var l9={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},u9={input:Kce,default:qce,output:Yce,group:Jce};function Xce(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var Zce=e=>{let{width:t,height:n,x:r,y:i}=J8(e.nodeLookup,{filter:e=>!!e.selected});return{width:u5(t)?t:null,height:u5(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function Qce({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=D7(),{width:i,height:a,transformString:o,userSelectionActive:s}=E7(Zce,C7),c=a9(),l=(0,z.useRef)(null);(0,z.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(i9({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,B.jsx)(`div`,{className:w3([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,B.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(l9,e.key)&&(e.preventDefault(),c({direction:l9[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var d9=typeof window<`u`?window:void 0,$ce=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function f9({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:w,defaultViewport:T,translateExtent:E,minZoom:D,maxZoom:O,preventScrolling:k,onSelectionContextMenu:A,noWheelClassName:j,noPanClassName:M,disableKeyboardA11y:N,onViewportChange:ee,isControlledViewport:P}){let{nodesSelectionActive:F,userSelectionActive:I}=E7($ce,C7),te=z7(l,{target:d9}),ne=z7(h,{target:d9}),re=ne||w,L=ne||b,R=u&&re!==!0,ie=te||I||R;return Nce({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,B.jsx)(Ice,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:L,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!te&&re,defaultViewport:T,translateExtent:E,minZoom:D,maxZoom:O,zoomActivationKeyCode:g,preventScrolling:k,noWheelClassName:j,noPanClassName:M,onViewportChange:ee,isControlledViewport:P,paneClickDistance:s,selectionOnDrag:R,children:(0,B.jsxs)(Bce,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:re,isSelecting:!!ie,selectionMode:d,selectionKeyPressed:te,paneClickDistance:s,selectionOnDrag:R,children:[e,F&&(0,B.jsx)(Qce,{onSelectionContextMenu:A,noPanClassName:M,disableKeyboardA11y:N})]})})}f9.displayName=`FlowRenderer`;var ele=(0,z.memo)(f9),tle=e=>t=>e?Y8(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function nle(e){return E7((0,z.useCallback)(tle(e),[e]),C7)}var rle=e=>e.updateNodeInternals;function ile(){let e=E7(rle),[t]=(0,z.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,z.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function ale({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=D7(),a=(0,z.useRef)(null),o=(0,z.useRef)(null),s=(0,z.useRef)(e.sourcePosition),c=(0,z.useRef)(e.targetPosition),l=(0,z.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,z.useEffect)(()=>{a.current&&!e.hidden&&(!u||o.current!==a.current)&&(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,z.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,z.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function ole({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:h,nodeTypes:g,nodeClickDistance:_,onError:v}){let{node:y,internals:b,isParent:x}=E7(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},C7),S=y.type||`default`,C=g?.[S]||u9[S];C===void 0&&(v?.(`003`,M8.error003(S)),S=`default`,C=g?.default||u9.default);let w=!!(y.draggable||s&&y.draggable===void 0),T=!!(y.selectable||c&&y.selectable===void 0),E=!!(y.connectable||l&&y.connectable===void 0),D=!!(y.focusable||u&&y.focusable===void 0),O=D7(),k=y5(y),A=ale({node:y,nodeType:S,hasDimensions:k,resizeObserver:d}),j=i9({nodeRef:A,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),M=a9();if(y.hidden)return null;let N=v5(y),ee=Xce(y),P=T||w||t||n||r||i,F=n?e=>n(e,{...b.userNode}):void 0,I=r?e=>r(e,{...b.userNode}):void 0,te=i?e=>i(e,{...b.userNode}):void 0,ne=a?e=>a(e,{...b.userNode}):void 0,re=o?e=>o(e,{...b.userNode}):void 0,L=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=O.getState();T&&(!r||!w||i>0)&&r9({id:e,store:O,nodeRef:A}),t&&t(n,{...b.userNode})},R=t=>{if(!(T5(t.nativeEvent)||m)){if(P8.includes(t.key)&&T)r9({id:e,store:O,unselect:t.key===`Escape`,nodeRef:A});else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(l9,t.key)){t.preventDefault();let{ariaLabelConfig:e}=O.getState();O.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),M({direction:l9[t.key],factor:t.shiftKey?4:1})}}},ie=()=>{if(m||!A.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=O.getState();i&&(Y8(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+N.width/2,y.position.y+N.height/2,{zoom:t[2]}))};return(0,B.jsx)(`div`,{className:w3([`react-flow__node`,`react-flow__node-${S}`,{[p]:w},y.className,{selected:y.selected,selectable:T,parent:x,draggable:w,dragging:j}]),ref:A,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:P?`all`:`none`,visibility:k?`visible`:`hidden`,...y.style,...ee},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:F,onMouseMove:I,onMouseLeave:te,onContextMenu:ne,onClick:L,onDoubleClick:re,onKeyDown:D?R:void 0,tabIndex:D?0:void 0,onFocus:D?ie:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${k7}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,B.jsx)(Hce,{value:e,children:(0,B.jsx)(C,{id:e,data:y.data,type:S,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:y.selected??!1,selectable:T,draggable:w,deletable:y.deletable??!0,isConnectable:E,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:j,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...N})})})}var sle=(0,z.memo)(ole),cle=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function p9(e){let{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=E7(cle,C7),o=nle(e.onlyRenderVisibleElements),s=ile();return(0,B.jsx)(`div`,{className:`react-flow__nodes`,style:t9,children:o.map(o=>(0,B.jsx)(sle,{id:o,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},o))})}p9.displayName=`NodeRenderer`;var lle=(0,z.memo)(p9);function ule(e){return E7((0,z.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&_se({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),C7)}var dle=({color:e=`none`,strokeWidth:t=1})=>(0,B.jsx)(`polyline`,{className:`arrow`,style:{strokeWidth:t,...e&&{stroke:e}},strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`}),fle=({color:e=`none`,strokeWidth:t=1})=>(0,B.jsx)(`polyline`,{className:`arrowclosed`,style:{strokeWidth:t,...e&&{stroke:e,fill:e}},strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`}),m9={[V8.Arrow]:dle,[V8.ArrowClosed]:fle};function ple(e){let t=D7();return(0,z.useMemo)(()=>Object.prototype.hasOwnProperty.call(m9,e)?m9[e]:(t.getState().onError?.(`009`,M8.error009(e)),null),[e])}var mle=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=ple(t);return c?(0,B.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,B.jsx)(c,{color:n,strokeWidth:o})}):null},h9=({defaultColor:e,rfId:t})=>{let n=E7(e=>e.edges),r=E7(e=>e.defaultEdgeOptions),i=(0,z.useMemo)(()=>Tse(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,B.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,B.jsx)(`defs`,{children:i.map(e=>(0,B.jsx)(mle,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};h9.displayName=`MarkerDefinitions`;var hle=(0,z.memo)(h9);function g9({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,z.useState)({x:1,y:0,width:0,height:0}),p=w3([`react-flow__edge-textwrapper`,l]),m=(0,z.useRef)(null);return(0,z.useEffect)(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,B.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,B.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,B.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}g9.displayName=`EdgeText`;var gle=(0,z.memo)(g9);function _9({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`path`,{...u,d:e,fill:`none`,className:w3([`react-flow__edge-path`,u.className])}),l?(0,B.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&u5(t)&&u5(n)?(0,B.jsx)(gle,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function v9({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===H8.Left||e===H8.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function y9({sourceX:e,sourceY:t,sourcePosition:n=H8.Bottom,targetX:r,targetY:i,targetPosition:a=H8.Top}){let[o,s]=v9({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=v9({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=k5({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function b9(e){return(0,z.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})=>{let[v,y,b]=y9({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s});return(0,B.jsx)(_9,{id:e.isInternal?void 0:t,path:v,labelX:y,labelY:b,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})})}var _le=b9({isInternal:!1}),x9=b9({isInternal:!0});_le.displayName=`SimpleBezierEdge`,x9.displayName=`SimpleBezierEdgeInternal`;function S9(e){return(0,z.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=H8.Bottom,targetPosition:m=H8.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=L5({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition});return(0,B.jsx)(_9,{id:e.isInternal?void 0:t,path:y,labelX:b,labelY:x,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}var C9=S9({isInternal:!1}),w9=S9({isInternal:!0});C9.displayName=`SmoothStepEdge`,w9.displayName=`SmoothStepEdgeInternal`;function T9(e){return(0,z.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,B.jsx)(C9,{...n,id:r,pathOptions:(0,z.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var vle=T9({isInternal:!1}),E9=T9({isInternal:!0});vle.displayName=`StepEdge`,E9.displayName=`StepEdgeInternal`;function D9(e){return(0,z.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{let[g,_,v]=P5({sourceX:n,sourceY:r,targetX:i,targetY:a});return(0,B.jsx)(_9,{id:e.isInternal?void 0:t,path:g,labelX:_,labelY:v,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}var yle=D9({isInternal:!1}),O9=D9({isInternal:!0});yle.displayName=`StraightEdge`,O9.displayName=`StraightEdgeInternal`;function k9(e){return(0,z.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=H8.Bottom,targetPosition:s=H8.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=M5({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature});return(0,B.jsx)(_9,{id:e.isInternal?void 0:t,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:v})})}var ble=k9({isInternal:!1}),A9=k9({isInternal:!0});ble.displayName=`BezierEdge`,A9.displayName=`BezierEdgeInternal`;var j9={default:A9,straight:O9,step:E9,smoothstep:w9,simplebezier:x9},M9={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},xle=(e,t,n)=>n===H8.Left?e-t:n===H8.Right?e+t:e,Sle=(e,t,n)=>n===H8.Top?e-t:n===H8.Bottom?e+t:e,N9=`react-flow__edgeupdater`;function P9({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,B.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:w3([N9,`${N9}-${s}`]),cx:xle(t,r,e),cy:Sle(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function Cle({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let m=D7(),h=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:h,rfId:g,panBy:_,updateConnection:v}=m.getState(),y=t.type===`target`;o7.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>m.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>m.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),_=e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),v=()=>p(!0),y=()=>p(!1);return(0,B.jsxs)(B.Fragment,{children:[(e===!0||e===`source`)&&(0,B.jsx)(P9,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,B.jsx)(P9,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function wle({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:h,noPanClassName:g,onError:_,disableKeyboardA11y:v}){let y=E7(t=>t.edgeLookup.get(e)),b=E7(e=>e.defaultEdgeOptions);y=b?{...b,...y}:y;let x=y.type||`default`,S=h?.[x]||j9[x];S===void 0&&(_?.(`011`,M8.error011(x)),x=`default`,S=h?.default||j9.default);let C=!!(y.focusable||t&&y.focusable===void 0),w=d!==void 0&&(y.reconnectable||n&&y.reconnectable===void 0),T=!!(y.selectable||r&&y.selectable===void 0),E=(0,z.useRef)(null),[D,O]=(0,z.useState)(!1),[k,A]=(0,z.useState)(!1),j=D7(),{zIndex:M,sourceX:N,sourceY:ee,targetX:P,targetY:F,sourcePosition:I,targetPosition:te}=E7((0,z.useCallback)(t=>{let n=t.nodeLookup.get(y.source),r=t.nodeLookup.get(y.target);if(!n||!r)return{zIndex:y.zIndex,...M9};let i=wse({id:e,sourceNode:n,targetNode:r,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:t.connectionMode,onError:_});return{zIndex:gse({selected:y.selected,zIndex:y.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode}),...i||M9}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),C7),ne=(0,z.useMemo)(()=>y.markerStart?`url('#${H5(y.markerStart,m)}')`:void 0,[y.markerStart,m]),re=(0,z.useMemo)(()=>y.markerEnd?`url('#${H5(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||N===null||ee===null||P===null||F===null)return null;let L=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=j.getState();T&&(j.setState({nodesSelectionActive:!1}),y.selected&&a?(r({nodes:[],edges:[y]}),E.current?.blur()):n([e])),i&&i(t,y)},R=a?e=>{a(e,{...y})}:void 0,ie=o?e=>{o(e,{...y})}:void 0,ae=s?e=>{s(e,{...y})}:void 0,oe=c?e=>{c(e,{...y})}:void 0,se=l?e=>{l(e,{...y})}:void 0;return(0,B.jsx)(`svg`,{style:{zIndex:M},children:(0,B.jsxs)(`g`,{className:w3([`react-flow__edge`,`react-flow__edge-${x}`,y.className,g,{selected:y.selected,animated:y.animated,inactive:!T&&!i,updating:D,selectable:T}]),onClick:L,onDoubleClick:R,onContextMenu:ie,onMouseEnter:ae,onMouseMove:oe,onMouseLeave:se,onKeyDown:C?t=>{if(!v&&P8.includes(t.key)&&T){let{unselectNodesAndEdges:n,addSelectedEdges:r}=j.getState();t.key===`Escape`?(E.current?.blur(),n({edges:[y]})):r([e])}}:void 0,tabIndex:C?0:void 0,role:y.ariaRole??(C?`group`:`img`),"aria-roledescription":`edge`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":C?`${A7}-${m}`:void 0,ref:E,...y.domAttributes,children:[!k&&(0,B.jsx)(S,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:T,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:N,sourceY:ee,targetX:P,targetY:F,sourcePosition:I,targetPosition:te,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:ne,markerEnd:re,pathOptions:`pathOptions`in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),w&&(0,B.jsx)(Cle,{edge:y,isReconnectable:w,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:N,sourceY:ee,targetX:P,targetY:F,sourcePosition:I,targetPosition:te,setUpdateHover:O,setReconnecting:A})]})})}var Tle=(0,z.memo)(wle),Ele=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function F9({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:h}){let{edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,onError:y}=E7(Ele,C7),b=ule(t);return(0,B.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,B.jsx)(hle,{defaultColor:e,rfId:n}),b.map(e=>(0,B.jsx)(Tle,{id:e,edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:h},e))]})}F9.displayName=`EdgeRenderer`;var Dle=(0,z.memo)(F9),Ole=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function kle({children:e}){return(0,B.jsx)(`div`,{className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:E7(Ole)},children:e})}function Ale(e){let t=$7(),n=(0,z.useRef)(!1);(0,z.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var jle=e=>e.panZoom?.syncViewport;function Mle(e){let t=E7(jle),n=D7();return(0,z.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function I9(e){return e.connection.inProgress?{...e.connection,to:f5(e.connection.to,e.transform)}:{...e.connection}}function Nle(e){return e?t=>e(I9(t)):I9}function Ple(e){return E7(Nle(e),C7)}var Fle=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Ile({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=E7(Fle,C7);return a&&i&&c?(0,B.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,B.jsx)(`g`,{className:w3([`react-flow__connection`,W8(s)]),children:(0,B.jsx)(L9,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var L9=({style:e,type:t=B8.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:p}=Ple();if(!i)return;if(n)return(0,B.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:W8(r),toNode:u,toHandle:d,pointer:p});let m=``,h={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case B8.Bezier:[m]=M5(h);break;case B8.SimpleBezier:[m]=y9(h);break;case B8.Step:[m]=L5({...h,borderRadius:0});break;case B8.SmoothStep:[m]=L5(h);break;default:[m]=P5(h)}return(0,B.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};L9.displayName=`ConnectionLine`;var Lle={};function R9(e=Lle){(0,z.useRef)(e),D7(),(0,z.useEffect)(()=>{},[e])}function Rle(){D7(),(0,z.useRef)(!1),(0,z.useEffect)(()=>{},[])}function z9({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:h,connectionLineComponent:g,connectionLineContainerStyle:_,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:w,onlyRenderVisibleElements:T,elementsSelectable:E,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,preventScrolling:j,defaultMarkerColor:M,zoomOnScroll:N,zoomOnPinch:ee,panOnScroll:P,panOnScrollSpeed:F,panOnScrollMode:I,zoomOnDoubleClick:te,panOnDrag:ne,onPaneClick:re,onPaneMouseEnter:L,onPaneMouseMove:R,onPaneMouseLeave:ie,onPaneScroll:ae,onPaneContextMenu:oe,paneClickDistance:se,nodeClickDistance:ce,onEdgeContextMenu:le,onEdgeMouseEnter:ue,onEdgeMouseMove:de,onEdgeMouseLeave:fe,reconnectRadius:pe,onReconnect:me,onReconnectStart:he,onReconnectEnd:ge,noDragClassName:_e,noWheelClassName:ve,noPanClassName:ye,disableKeyboardA11y:be,nodeExtent:xe,rfId:Se,viewport:Ce,onViewportChange:we}){return R9(e),R9(t),Rle(),Ale(n),Mle(Ce),(0,B.jsx)(ele,{onPaneClick:re,onPaneMouseEnter:L,onPaneMouseMove:R,onPaneMouseLeave:ie,onPaneContextMenu:oe,onPaneScroll:ae,paneClickDistance:se,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:N,zoomOnPinch:ee,zoomOnDoubleClick:te,panOnScroll:P,panOnScrollSpeed:F,panOnScrollMode:I,panOnDrag:ne,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:_e,noWheelClassName:ve,noPanClassName:ye,disableKeyboardA11y:be,onViewportChange:we,isControlledViewport:!!Ce,children:(0,B.jsxs)(kle,{children:[(0,B.jsx)(Dle,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:me,onReconnectStart:he,onReconnectEnd:ge,onlyRenderVisibleElements:T,onEdgeContextMenu:le,onEdgeMouseEnter:ue,onEdgeMouseMove:de,onEdgeMouseLeave:fe,reconnectRadius:pe,defaultMarkerColor:M,noPanClassName:ye,disableKeyboardA11y:be,rfId:Se}),(0,B.jsx)(Ile,{style:h,type:m,component:g,containerStyle:_}),(0,B.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,B.jsx)(lle,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:ce,onlyRenderVisibleElements:T,noPanClassName:ye,noDragClassName:_e,disableKeyboardA11y:be,nodeExtent:xe,rfId:Se}),(0,B.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}z9.displayName=`GraphView`;var zle=(0,z.memo)(z9),B9=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??N8;Q5(h,g,_);let{nodesInitialized:x}=q5(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=h5(J8(p,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:N8,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:I8.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...z8},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:use,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:F8,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Ble=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>sce((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await cse({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...B9({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,elevateNodesOnSelect:i,fitViewQueued:a,zIndexMode:o,nodesSelectionActive:s}=m(),{nodesInitialized:c,hasSelectedNodes:l}=q5(e,t,n,{nodeOrigin:r,nodeExtent:d,elevateNodesOnSelect:i,checkEquality:!0,zIndexMode:o}),u=s&&l;a&&c?(h(),p({nodes:e,nodesInitialized:c,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:u})):p({nodes:e,nodesInitialized:c,nodesSelectionActive:u})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();Q5(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=Mse(e,n,r,i,a,o,l);d&&(Ose(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=B5(e,o.fromHandle,H8.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=X5(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(U7(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(W7(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){i(e.map(e=>G7(e,!0)));return}i(K7(r,new Set([...e]),!0)),a(K7(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>G7(e,!0)));return}a(K7(n,new Set([...e]))),i(K7(r,new Set,!0))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s){if(!e.selected)continue;let t=i.get(e.id);t&&(t.selected=!1),l.push(G7(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(G7(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,G7(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,G7(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();e[0][0]===o[0][0]&&e[0][1]===o[0][1]&&e[1][0]===o[1][0]&&e[1][1]===o[1][1]||(q5(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return Nse({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return Promise.resolve(!1);let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{p({connection:{...z8}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...B9()})}},Object.is);function Vle({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[m]=(0,z.useState)(()=>Ble({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,B.jsx)(cce,{value:m,children:(0,B.jsx)(kce,{children:p})})}function Hle({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,z.useContext)(w7)?(0,B.jsx)(B.Fragment,{children:e}):(0,B.jsx)(Vle,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}var Ule={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function Wle({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onNodesDelete:E,onEdgesDelete:D,onDelete:O,onSelectionChange:k,onSelectionDragStart:A,onSelectionDrag:j,onSelectionDragStop:M,onSelectionContextMenu:N,onSelectionStart:ee,onSelectionEnd:P,onBeforeDelete:F,connectionMode:I,connectionLineType:te=B8.Bezier,connectionLineStyle:ne,connectionLineComponent:re,connectionLineContainerStyle:L,deleteKeyCode:R=`Backspace`,selectionKeyCode:ie=`Shift`,selectionOnDrag:ae=!1,selectionMode:oe=R8.Full,panActivationKeyCode:se=`Space`,multiSelectionKeyCode:ce=g5()?`Meta`:`Control`,zoomActivationKeyCode:le=g5()?`Meta`:`Control`,snapToGrid:ue,snapGrid:de,onlyRenderVisibleElements:fe=!1,selectNodesOnDrag:pe,nodesDraggable:me,autoPanOnNodeFocus:he,nodesConnectable:ge,nodesFocusable:_e,nodeOrigin:ve=P7,edgesFocusable:ye,edgesReconnectable:be,elementsSelectable:xe=!0,defaultViewport:Se=xce,minZoom:Ce=.5,maxZoom:we=2,translateExtent:Te=N8,preventScrolling:Ee=!0,nodeExtent:De,defaultMarkerColor:Oe=`#b1b1b7`,zoomOnScroll:ke=!0,zoomOnPinch:Ae=!0,panOnScroll:je=!1,panOnScrollSpeed:Me=.5,panOnScrollMode:Ne=L8.Free,zoomOnDoubleClick:Pe=!0,panOnDrag:Fe=!0,onPaneClick:Ie,onPaneMouseEnter:Le,onPaneMouseMove:Re,onPaneMouseLeave:ze,onPaneScroll:Be,onPaneContextMenu:Ve,paneClickDistance:He=1,nodeClickDistance:Ue=0,children:We,onReconnect:Ge,onReconnectStart:Ke,onReconnectEnd:qe,onEdgeContextMenu:Je,onEdgeDoubleClick:Ye,onEdgeMouseEnter:Xe,onEdgeMouseMove:Ze,onEdgeMouseLeave:Qe,reconnectRadius:$e=10,onNodesChange:et,onEdgesChange:tt,noDragClassName:nt=`nodrag`,noWheelClassName:rt=`nowheel`,noPanClassName:it=`nopan`,fitView:at,fitViewOptions:ot,connectOnClick:st,attributionPosition:ct,proOptions:lt,defaultEdgeOptions:ut,elevateNodesOnSelect:dt=!0,elevateEdgesOnSelect:ft=!1,disableKeyboardA11y:pt=!1,autoPanOnConnect:mt,autoPanOnNodeDrag:ht,autoPanSpeed:gt,connectionRadius:_t,isValidConnection:vt,onError:yt,style:bt,id:xt,nodeDragThreshold:St,connectionDragThreshold:Ct,viewport:wt,onViewportChange:Tt,width:Et,height:Dt,colorMode:Ot=`light`,debug:kt,onScroll:At,ariaLabelConfig:jt,zIndexMode:Mt=`basic`,...Nt},Pt){let Ft=xt||`1`,It=wce(Ot),Lt=(0,z.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),At?.(e)},[At]);return(0,B.jsx)(`div`,{"data-testid":`rf__wrapper`,...Nt,onScroll:Lt,style:{...bt,...Ule},ref:Pt,className:w3([`react-flow`,i,It]),id:xt,role:`application`,children:(0,B.jsxs)(Hle,{nodes:e,edges:t,width:Et,height:Dt,fitView:at,fitViewOptions:ot,minZoom:Ce,maxZoom:we,nodeOrigin:ve,nodeExtent:De,zIndexMode:Mt,children:[(0,B.jsx)(Cce,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:me,autoPanOnNodeFocus:he,nodesConnectable:ge,nodesFocusable:_e,edgesFocusable:ye,edgesReconnectable:be,elementsSelectable:xe,elevateNodesOnSelect:dt,elevateEdgesOnSelect:ft,minZoom:Ce,maxZoom:we,nodeExtent:De,onNodesChange:et,onEdgesChange:tt,snapToGrid:ue,snapGrid:de,connectionMode:I,translateExtent:Te,connectOnClick:st,defaultEdgeOptions:ut,fitView:at,fitViewOptions:ot,onNodesDelete:E,onEdgesDelete:D,onDelete:O,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onSelectionDrag:j,onSelectionDragStart:A,onSelectionDragStop:M,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:it,nodeOrigin:ve,rfId:Ft,autoPanOnConnect:mt,autoPanOnNodeDrag:ht,autoPanSpeed:gt,onError:yt,connectionRadius:_t,isValidConnection:vt,selectNodesOnDrag:pe,nodeDragThreshold:St,connectionDragThreshold:Ct,onBeforeDelete:F,debug:kt,ariaLabelConfig:jt,zIndexMode:Mt}),(0,B.jsx)(zle,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,nodeTypes:a,edgeTypes:o,connectionLineType:te,connectionLineStyle:ne,connectionLineComponent:re,connectionLineContainerStyle:L,selectionKeyCode:ie,selectionOnDrag:ae,selectionMode:oe,deleteKeyCode:R,multiSelectionKeyCode:ce,panActivationKeyCode:se,zoomActivationKeyCode:le,onlyRenderVisibleElements:fe,defaultViewport:Se,translateExtent:Te,minZoom:Ce,maxZoom:we,preventScrolling:Ee,zoomOnScroll:ke,zoomOnPinch:Ae,zoomOnDoubleClick:Pe,panOnScroll:je,panOnScrollSpeed:Me,panOnScrollMode:Ne,panOnDrag:Fe,onPaneClick:Ie,onPaneMouseEnter:Le,onPaneMouseMove:Re,onPaneMouseLeave:ze,onPaneScroll:Be,onPaneContextMenu:Ve,paneClickDistance:He,nodeClickDistance:Ue,onSelectionContextMenu:N,onSelectionStart:ee,onSelectionEnd:P,onReconnect:Ge,onReconnectStart:Ke,onReconnectEnd:qe,onEdgeContextMenu:Je,onEdgeDoubleClick:Ye,onEdgeMouseEnter:Xe,onEdgeMouseMove:Ze,onEdgeMouseLeave:Qe,reconnectRadius:$e,defaultMarkerColor:Oe,noDragClassName:nt,noWheelClassName:rt,noPanClassName:it,rfId:Ft,disableKeyboardA11y:pt,nodeExtent:De,viewport:wt,onViewportChange:Tt}),(0,B.jsx)(bce,{onSelectionChange:k}),We,(0,B.jsx)(hce,{proOptions:lt,position:ct}),(0,B.jsx)(mce,{rfId:Ft,disableKeyboardA11y:pt})]})})}var Gle=X7(Wle);function Kle(e){let[t,n]=(0,z.useState)(e);return[t,n,(0,z.useCallback)(e=>n(t=>U7(e,t)),[])]}function qle(e){let[t,n]=(0,z.useState)(e);return[t,n,(0,z.useCallback)(e=>n(t=>W7(e,t)),[])]}M8.error014();function Jle({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,B.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:w3([`react-flow__background-pattern`,n,r])})}function Yle({radius:e,className:t}){return(0,B.jsx)(`circle`,{cx:e,cy:e,r:e,className:w3([`react-flow__background-pattern`,`dots`,t])})}var V9;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(V9||={});var Xle={[V9.Dots]:1,[V9.Lines]:1,[V9.Cross]:6},Zle=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function H9({id:e,variant:t=V9.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,z.useRef)(null),{transform:f,patternId:p}=E7(Zle,C7),m=r||Xle[t],h=t===V9.Dots,g=t===V9.Cross,_=Array.isArray(n)?n:[n,n],v=[_[0]*f[2]||1,_[1]*f[2]||1],y=m*f[2],b=Array.isArray(a)?a:[a,a],x=g?[y,y]:v,S=[b[0]*f[2]||1+x[0]/2,b[1]*f[2]||1+x[1]/2],C=`${p}${e||``}`;return(0,B.jsxs)(`svg`,{className:w3([`react-flow__background`,l]),style:{...c,...t9,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,B.jsx)(`pattern`,{id:C,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${S[0]},-${S[1]})`,children:h?(0,B.jsx)(Yle,{radius:y/2,className:u}):(0,B.jsx)(Jle,{dimensions:x,lineWidth:i,variant:t,className:u})}),(0,B.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${C})`})]})}H9.displayName=`Background`;var Qle=(0,z.memo)(H9);function $le(){return(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,B.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function eue(){return(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,B.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function tue(){return(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,B.jsx)(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function nue(){return(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,B.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function rue(){return(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,B.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function U9({children:e,className:t,...n}){return(0,B.jsx)(`button`,{type:`button`,className:w3([`react-flow__controls-button`,t]),...n,children:e})}var iue=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function W9({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p}){let m=D7(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=E7(iue,C7),{zoomIn:y,zoomOut:b,fitView:x}=$7();return(0,B.jsxs)(j7,{className:w3([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??v[`controls.ariaLabel`],children:[t&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(U9,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,B.jsx)($le,{})}),(0,B.jsx)(U9,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,B.jsx)(eue,{})})]}),n&&(0,B.jsx)(U9,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,B.jsx)(tue,{})}),r&&(0,B.jsx)(U9,{className:`react-flow__controls-interactive`,onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),c?.(!h)},title:v[`controls.interactive.ariaLabel`],"aria-label":v[`controls.interactive.ariaLabel`],children:h?(0,B.jsx)(rue,{}):(0,B.jsx)(nue,{})}),u]})}W9.displayName=`Controls`;var aue=(0,z.memo)(W9);function oue({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:m,backgroundColor:h}=a||{},g=o||m||h;return(0,B.jsx)(`rect`,{className:w3([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:g,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var sue=(0,z.memo)(oue),G9=e=>e.nodes.map(e=>e.id),K9=e=>e instanceof Function?e:()=>e;function cue({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=sue,onClick:o}){let s=E7(G9,C7),c=K9(t),l=K9(e),u=K9(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,B.jsx)(B.Fragment,{children:s.map(e=>(0,B.jsx)(uue,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function lue({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=E7(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=v5(r);return{node:r,x:i,y:a,width:o,height:s}},C7);return!l||l.hidden||!y5(l)?null:(0,B.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var uue=(0,z.memo)(lue),due=(0,z.memo)(cue),fue=200,pue=150,mue=e=>!e.hidden,hue=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?s5(J8(e.nodeLookup,{filter:mue}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},gue=`react-flow__minimap-desc`;function q9({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:p,onNodeClick:m,pannable:h=!1,zoomable:g=!1,ariaLabel:_,inversePan:v,zoomStep:y=1,offsetScale:b=5}){let x=D7(),S=(0,z.useRef)(null),{boundingRect:C,viewBB:w,rfId:T,panZoom:E,translateExtent:D,flowWidth:O,flowHeight:k,ariaLabelConfig:A}=E7(hue,C7),j=e?.width??fue,M=e?.height??pue,N=C.width/j,ee=C.height/M,P=Math.max(N,ee),F=P*j,I=P*M,te=b*P,ne=C.x-(F-C.width)/2-te,re=C.y-(I-C.height)/2-te,L=F+te*2,R=I+te*2,ie=`${gue}-${T}`,ae=(0,z.useRef)(0),oe=(0,z.useRef)();ae.current=P,(0,z.useEffect)(()=>{if(S.current&&E)return oe.current=Hse({domNode:S.current,panZoom:E,getTransform:()=>x.getState().transform,getViewScale:()=>ae.current}),()=>{oe.current?.destroy()}},[E]),(0,z.useEffect)(()=>{oe.current?.update({translateExtent:D,width:O,height:k,inversePan:v,pannable:h,zoomStep:y,zoomable:g})},[h,g,v,y,D,O,k]);let se=p?e=>{let[t,n]=oe.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,ce=m?(0,z.useCallback)((e,t)=>{let n=x.getState().nodeLookup.get(t).internals.userNode;m(e,n)},[]):void 0,le=_??A[`minimap.ariaLabel`];return(0,B.jsx)(j7,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*P:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`number`?o:void 0},className:w3([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,B.jsxs)(`svg`,{width:j,height:M,viewBox:`${ne} ${re} ${L} ${R}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":ie,ref:S,onClick:se,children:[le&&(0,B.jsx)(`title`,{id:ie,children:le}),(0,B.jsx)(due,{onClick:ce,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,B.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${ne-te},${re-te}h${L+te*2}v${R+te*2}h${-L-te*2}z
|
|
76
|
-
M${w.x},${w.y}h${w.width}v${w.height}h${-w.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}q9.displayName=`MiniMap`;var _ue=(0,z.memo)(q9),vue=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,yue={[p7.Line]:`right`,[p7.Handle]:`bottom-right`};function bue({nodeId:e,position:t,variant:n=p7.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:h,onResize:g,onResizeEnd:_}){let v=s9(),y=typeof e==`string`?e:v,b=D7(),x=(0,z.useRef)(null),S=n===p7.Handle,C=E7((0,z.useCallback)(vue(S&&p),[S,p]),C7),w=(0,z.useRef)(null),T=t??yue[n];return(0,z.useEffect)(()=>{if(!(!x.current||!y))return w.current||=nce({domNode:x.current,nodeId:y,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=b.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=b.getState(),o=[],s={x:e.x,y:e.y},c=r.get(y);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=X5([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...b5({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:y,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:y,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:y,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};b.getState().triggerNodeChanges([n])}}),w.current.update({controlPosition:T,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:_,shouldResize:m}),()=>{w.current?.destroy()}},[T,s,c,l,u,d,h,g,_,m]),(0,B.jsx)(`div`,{className:w3([`react-flow__resize-control`,`nodrag`,...T.split(`-`),n,r]),ref:x,style:{...i,scale:C,...o&&{[S?`backgroundColor`:`borderColor`]:o}},children:a})}(0,z.memo)(bue);var J9={requirement:`#3b82f6`,decision:`#8b5cf6`,code_change:`#10b981`,outcome:`#f59e0b`};function xue({nodes:e,edges:t,onNodeClick:n}){let r=(0,z.useMemo)(()=>e.map((e,t)=>({id:e.id,type:`default`,data:{label:(0,B.jsxs)(`div`,{className:`text-xs`,children:[(0,B.jsx)(`div`,{className:`font-semibold truncate max-w-[120px]`,children:e.title}),(0,B.jsx)(`div`,{className:`text-gray-500 text-[10px]`,children:e.node_type})]})},position:{x:t%5*200+Math.sin(t)*30,y:Math.floor(t/5)*150+Math.cos(t)*20},style:{background:J9[e.node_type]||`#6b7280`,color:`#fff`,border:`none`,borderRadius:`8px`,padding:`8px 12px`,minWidth:`140px`}})),[e]),i=(0,z.useMemo)(()=>t.map(e=>({id:e.id,source:e.from_node_id,target:e.to_node_id,label:e.edge_type,labelStyle:{fontSize:10,fill:`#6b7280`},style:{stroke:`#d1d5db`,strokeWidth:Math.max(1,e.weight)},markerEnd:{type:V8.ArrowClosed,color:`#d1d5db`}})),[t]),[a,,o]=Kle(r),[s,,c]=qle(i),l=(0,z.useCallback)((e,t)=>{n?.(t.id)},[n]);return e.length===0?(0,B.jsx)(`div`,{className:`flex items-center justify-center h-full text-gray-400 text-sm`,children:`暂无知识节点`}):(0,B.jsxs)(Gle,{nodes:a,edges:s,onNodesChange:o,onEdgesChange:c,onNodeClick:l,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[(0,B.jsx)(Qle,{color:`#f3f4f6`,gap:20}),(0,B.jsx)(aue,{}),(0,B.jsx)(_ue,{nodeColor:t=>J9[e.find(e=>e.id===t.id)?.node_type||``]||`#6b7280`,style:{background:`#f9fafb`}})]})}var Y9={requirement:ic,decision:dc,code_change:qs,outcome:Us},X9={requirement:`#3b82f6`,decision:`#8b5cf6`,code_change:`#10b981`,outcome:`#f59e0b`},Z9=[`#3b82f6`,`#8b5cf6`,`#10b981`,`#f59e0b`,`#ef4444`,`#06b6d4`];function Sue(){let e=qe(),[t,n]=(0,z.useState)(``),[r,i]=(0,z.useState)(``),[a,o]=(0,z.useState)(null),[s,c]=(0,z.useState)(1),[l,u]=(0,z.useState)(20),[d,f]=(0,z.useState)(!1),[p,m]=(0,z.useState)(!1),[h,g]=(0,z.useState)(null),[_,v]=(0,z.useState)(``),[y,b]=(0,z.useState)(`list`),[x,S]=(0,z.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),{data:C}=ct({queryKey:[`knowledge-overview`],queryFn:()=>ml().then(e=>e.data)}),{data:w}=ct({queryKey:[`knowledge-search`,t,r,_],queryFn:()=>pl(t,_||void 0,r||void 0).then(e=>e.data),enabled:t.length>0}),{data:T}=ct({queryKey:[`knowledge-all`],queryFn:()=>pl(``).then(e=>e.data)}),{data:E}=ct({queryKey:[`knowledge-filtered`,r,_],queryFn:()=>pl(``,_||void 0,r||void 0).then(e=>e.data),enabled:t.length===0&&(!!r||!!_)}),{data:D}=ct({queryKey:[`knowledge-neighbors`,a],queryFn:()=>hl(a).then(e=>e.data),enabled:!!a}),{data:O}=ct({queryKey:[`knowledge-graph`,_,r],queryFn:()=>gl(_||void 0,r||void 0).then(e=>e.data),enabled:y===`graph`}),k=lt({mutationFn:_l,onSuccess:()=>{e.invalidateQueries({queryKey:[`knowledge-all`]}),e.invalidateQueries({queryKey:[`knowledge-filtered`]}),e.invalidateQueries({queryKey:[`knowledge-search`]}),e.invalidateQueries({queryKey:[`knowledge-overview`]}),f(!1)}}),A=lt({mutationFn:({id:e,data:t})=>vl(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:[`knowledge-all`]}),e.invalidateQueries({queryKey:[`knowledge-filtered`]}),e.invalidateQueries({queryKey:[`knowledge-search`]}),m(!1),g(null)}}),j=lt({mutationFn:yl,onSuccess:()=>{e.invalidateQueries({queryKey:[`knowledge-all`]}),e.invalidateQueries({queryKey:[`knowledge-filtered`]}),e.invalidateQueries({queryKey:[`knowledge-search`]}),e.invalidateQueries({queryKey:[`knowledge-overview`]}),o(null)}}),M=t?w?.items:r||_?E?.items:T?.items,N=Array.from(new Set(T?.items.map(e=>e.node_type)||[])),ee=Array.from(new Set(T?.items.map(e=>e.project_path||``).filter(Boolean)||[])),P=C?.byType?Object.entries(C.byType).map(([e,t])=>({name:e,value:t})):[],F=Math.ceil((M?.length||0)/l),I=M?.slice((s-1)*l,s*l),te=e=>{e.preventDefault();let t=new FormData(e.currentTarget);k.mutate({title:t.get(`title`),content:t.get(`content`),node_type:t.get(`node_type`),project_path:t.get(`project_path`),tags:t.get(`tags`)})},ne=e=>{if(e.preventDefault(),!h)return;let t=new FormData(e.currentTarget);A.mutate({id:h.id,data:{title:t.get(`title`),content:t.get(`content`),tags:t.get(`tags`)}})},re=e=>{S({open:!0,title:`删除知识节点`,description:`确认删除此知识节点?关联的边也会被删除。`,onConfirm:()=>{j.mutate(e),S(e=>({...e,open:!1}))}})};return(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsx)(X,{children:(0,B.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,B.jsxs)(`div`,{className:`relative flex-1`,children:[(0,B.jsx)(Ec,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,B.jsx)(`input`,{type:`text`,placeholder:`搜索知识节点(需求、决策、代码变更、结果)...`,value:t,onChange:e=>{n(e.target.value),c(1)},className:`w-full pl-10 pr-4 py-3 border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-500 text-lg`})]}),(0,B.jsxs)(`select`,{value:r,onChange:e=>{i(e.target.value),c(1)},className:`px-3 py-3 border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,B.jsx)(`option`,{value:``,children:`全部类型`}),N.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))]}),(0,B.jsxs)(`select`,{value:_,onChange:e=>{v(e.target.value),c(1)},className:`px-3 py-3 border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,B.jsx)(`option`,{value:``,children:`全部项目`}),ee.map(e=>(0,B.jsx)(`option`,{value:e,children:e.split(`/`).pop()},e))]}),(0,B.jsx)(Y,{variant:`primary`,size:`sm`,icon:xc,onClick:()=>f(!0),children:`创建节点`}),(0,B.jsxs)(`div`,{className:`flex border border-gray-200 rounded-lg overflow-hidden`,children:[(0,B.jsx)(`button`,{onClick:()=>b(`list`),className:`px-3 py-2 text-sm transition-colors ${y===`list`?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`}`,children:`列表`}),(0,B.jsxs)(`button`,{onClick:()=>b(`graph`),className:`px-3 py-2 text-sm transition-colors flex items-center gap-1 ${y===`graph`?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`}`,children:[(0,B.jsx)(gc,{className:`h-4 w-4`}),`图谱`]})]})]})}),(0,B.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,B.jsx)(X,{title:`知识图谱概览`,children:(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 mb-4`,children:[(0,B.jsxs)(`div`,{className:`text-center p-4 bg-blue-50 rounded-xl`,children:[(0,B.jsx)(Ns,{className:`h-8 w-8 text-blue-500 mx-auto mb-2`}),(0,B.jsx)(`div`,{className:`text-3xl font-bold text-blue-600`,children:C?.totalNodes||0}),(0,B.jsx)(`div`,{className:`text-sm text-gray-600`,children:`知识节点`})]}),(0,B.jsxs)(`div`,{className:`text-center p-4 bg-purple-50 rounded-xl`,children:[(0,B.jsx)(sc,{className:`h-8 w-8 text-purple-500 mx-auto mb-2`}),(0,B.jsx)(`div`,{className:`text-3xl font-bold text-purple-600`,children:P.length}),(0,B.jsx)(`div`,{className:`text-sm text-gray-600`,children:`节点类型`})]})]})}),(0,B.jsx)(X,{title:`节点类型分布`,children:P.length>0?(0,B.jsx)(dk,{width:`100%`,height:200,children:(0,B.jsxs)(p2,{children:[(0,B.jsx)(BJ,{data:P,cx:`50%`,cy:`50%`,innerRadius:50,outerRadius:80,dataKey:`value`,label:({name:e,percent:t})=>`${e} ${(t*100).toFixed(0)}%`,children:P.map((e,t)=>(0,B.jsx)(UW,{fill:Z9[t%Z9.length]},t))}),(0,B.jsx)(HW,{})]})}):(0,B.jsx)(`div`,{className:`flex items-center justify-center h-48 text-gray-400`,children:`暂无数据`})})]}),y===`graph`&&(0,B.jsx)(X,{title:`知识图谱`,children:(0,B.jsx)(`div`,{className:`h-[600px] border border-gray-200 rounded-lg overflow-hidden`,children:O?(0,B.jsx)(xue,{nodes:O.nodes,edges:O.edges,onNodeClick:o}):(0,B.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,B.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})})})}),y===`list`&&(0,B.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-6`,children:[(0,B.jsx)(`div`,{className:`lg:col-span-2`,children:(0,B.jsxs)(X,{title:`知识节点 (${M?.length||0})`,action:M&&M.length>0?(0,B.jsx)(Y,{variant:`secondary`,size:`sm`,icon:Qs,onClick:()=>{if(!M||M.length===0)return;let e=[`ID`,`标题`,`类型`,`内容`,`标签`,`项目路径`],t=M.map(e=>[e.id,e.title,e.node_type,e.content,e.tags||``,e.project_path||``]);A4(`knowledge-nodes-${C4(new Date,`yyyyMMdd-HHmmss`)}.csv`,e,t)},children:`导出 CSV`}):void 0,children:[(0,B.jsxs)(`div`,{className:`space-y-2`,children:[I?.map((e,t)=>{let n=Y9[e.node_type]||Ns,r=X9[e.node_type]||`#6b7280`;return(0,B.jsx)(ux.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:t*.03},className:`p-4 rounded-lg border cursor-pointer transition-all group ${a===e.id?`border-blue-300 bg-blue-50 shadow-sm`:`border-gray-100 hover:border-gray-200 hover:bg-gray-50`}`,onClick:()=>o(e.id),children:(0,B.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,B.jsx)(`div`,{className:`p-2 rounded-lg`,style:{backgroundColor:`${r}15`},children:(0,B.jsx)(n,{className:`h-5 w-5`,style:{color:r}})}),(0,B.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`font-semibold text-gray-900 truncate`,children:e.title}),(0,B.jsx)(px,{size:`sm`,variant:e.node_type===`outcome`?`success`:e.node_type===`decision`?`info`:`default`,children:e.node_type})]}),(0,B.jsx)(`p`,{className:`text-sm text-gray-600 mt-1 line-clamp-2`,children:e.content}),e.tags&&e.tags.trim()&&(0,B.jsx)(`div`,{className:`flex gap-1 mt-2`,children:e.tags.split(`,`).filter(e=>e.trim()).slice(0,3).map(e=>(0,B.jsx)(`span`,{className:`text-xs px-2 py-0.5 bg-gray-100 rounded-full text-gray-600`,children:e.trim()},e))})]}),(0,B.jsxs)(`div`,{className:`flex gap-1 flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity`,children:[(0,B.jsx)(`button`,{onClick:t=>{t.stopPropagation(),g({id:e.id,title:e.title,content:e.content,tags:e.tags||``}),m(!0)},className:`p-1.5 rounded hover:bg-gray-200 text-gray-400 hover:text-gray-600`,children:(0,B.jsx)(Mc,{className:`h-3.5 w-3.5`})}),(0,B.jsx)(`button`,{onClick:t=>{t.stopPropagation(),re(e.id)},className:`p-1.5 rounded hover:bg-red-100 text-gray-400 hover:text-red-600`,children:(0,B.jsx)(Lc,{className:`h-3.5 w-3.5`})})]})]})},e.id)}),(!I||I.length===0)&&(0,B.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 text-gray-400`,children:[(0,B.jsx)(Ns,{className:`h-12 w-12 mb-4`}),(0,B.jsx)(`p`,{children:`暂无知识节点`}),(0,B.jsx)(`p`,{className:`text-sm mt-1`,children:`使用 Claude Code 进行开发后,知识会自动沉淀`})]})]}),M&&M.length>0&&(0,B.jsx)(`div`,{className:`mt-4`,children:(0,B.jsx)(k4,{currentPage:s,totalPages:F,onPageChange:c,pageSize:l,onPageSizeChange:e=>{u(e),c(1)},totalItems:M.length})})]})}),(0,B.jsx)(`div`,{children:(0,B.jsx)(X,{title:`节点详情`,children:a&&M?(()=>{let e=M.find(e=>e.id===a);if(!e)return(0,B.jsx)(`div`,{className:`text-gray-400 text-center py-8`,children:`节点未找到`});let t=Y9[e.node_type]||Ns,n=X9[e.node_type]||`#6b7280`;return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(`div`,{className:`p-3 rounded-xl`,style:{backgroundColor:`${n}15`},children:(0,B.jsx)(t,{className:`h-6 w-6`,style:{color:n}})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`font-bold text-gray-900`,children:e.title}),(0,B.jsx)(px,{size:`sm`,children:e.node_type})]})]}),(0,B.jsx)(`div`,{className:`p-3 bg-gray-50 rounded-lg text-sm text-gray-700 whitespace-pre-wrap`,children:e.content}),e.tags&&e.tags.trim()&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`text-xs font-semibold text-gray-500 mb-2`,children:`标签`}),(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.tags.split(`,`).filter(e=>e.trim()).map(e=>(0,B.jsx)(`span`,{className:`text-xs px-2 py-1 bg-blue-50 text-blue-600 rounded-full`,children:e.trim()},e))})]}),D&&D.items.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`text-xs font-semibold text-gray-500 mb-2`,children:[`关联节点 (`,D.total,`)`]}),(0,B.jsx)(`div`,{className:`space-y-2`,children:D.items.map((e,t)=>(0,B.jsxs)(`div`,{className:`p-2 bg-gray-50 rounded-lg text-sm cursor-pointer hover:bg-gray-100`,onClick:()=>o(e.id),children:[(0,B.jsx)(`div`,{className:`font-medium`,children:e.title}),(0,B.jsxs)(`div`,{className:`text-xs text-gray-500`,children:[e.edge_type,` · `,e.node_type]})]},t))})]})]})})():(0,B.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 text-gray-400`,children:[(0,B.jsx)(Ec,{className:`h-8 w-8 mb-3`}),(0,B.jsx)(`p`,{className:`text-sm`,children:`点击左侧节点查看详情`})]})})})]}),d&&(0,B.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,onClick:()=>f(!1),children:(0,B.jsxs)(`div`,{className:`bg-white rounded-xl p-6 w-full max-w-2xl max-h-[90vh] overflow-y-auto`,onClick:e=>e.stopPropagation(),children:[(0,B.jsx)(`h3`,{className:`text-xl font-bold mb-4`,children:`创建知识节点`}),(0,B.jsxs)(`form`,{onSubmit:te,className:`space-y-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标题 *`}),(0,B.jsx)(`input`,{type:`text`,name:`title`,required:!0,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`内容 *`}),(0,B.jsx)(`textarea`,{name:`content`,required:!0,rows:6,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`类型 *`}),(0,B.jsxs)(`select`,{name:`node_type`,required:!0,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,B.jsx)(`option`,{value:`requirement`,children:`需求 (requirement)`}),(0,B.jsx)(`option`,{value:`decision`,children:`决策 (decision)`}),(0,B.jsx)(`option`,{value:`code_change`,children:`代码变更 (code_change)`}),(0,B.jsx)(`option`,{value:`outcome`,children:`结果 (outcome)`})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`项目路径 *`}),(0,B.jsx)(`input`,{type:`text`,name:`project_path`,required:!0,placeholder:`/path/to/project`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标签(逗号分隔)`}),(0,B.jsx)(`input`,{type:`text`,name:`tags`,placeholder:`tag1, tag2, tag3`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,B.jsxs)(`div`,{className:`flex gap-2 justify-end pt-2`,children:[(0,B.jsx)(Y,{type:`button`,variant:`secondary`,onClick:()=>f(!1),children:`取消`}),(0,B.jsx)(Y,{type:`submit`,variant:`primary`,loading:k.isPending,children:`创建`})]})]})]})}),p&&h&&(0,B.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,onClick:()=>m(!1),children:(0,B.jsxs)(`div`,{className:`bg-white rounded-xl p-6 w-full max-w-2xl max-h-[90vh] overflow-y-auto`,onClick:e=>e.stopPropagation(),children:[(0,B.jsx)(`h3`,{className:`text-xl font-bold mb-4`,children:`编辑知识节点`}),(0,B.jsxs)(`form`,{onSubmit:ne,className:`space-y-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标题`}),(0,B.jsx)(`input`,{type:`text`,name:`title`,defaultValue:h.title,required:!0,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`内容`}),(0,B.jsx)(`textarea`,{name:`content`,defaultValue:h.content,required:!0,rows:6,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标签(逗号分隔)`}),(0,B.jsx)(`input`,{type:`text`,name:`tags`,defaultValue:h.tags,placeholder:`tag1, tag2, tag3`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,B.jsxs)(`div`,{className:`flex gap-2 justify-end pt-2`,children:[(0,B.jsx)(Y,{type:`button`,variant:`secondary`,onClick:()=>m(!1),children:`取消`}),(0,B.jsx)(Y,{type:`submit`,variant:`primary`,loading:A.isPending,children:`保存`})]})]})]})}),(0,B.jsx)(E4,{open:x.open,title:x.title,description:x.description,variant:`danger`,onConfirm:x.onConfirm,onCancel:()=>S({...x,open:!1})})]})}function Cue(){let e=Pn(),t=qe(),[n,r]=(0,z.useState)(``),[i,a]=(0,z.useState)(1),[o,s]=(0,z.useState)(12),[c,l]=(0,z.useState)(`lastActivity`),[u,d]=(0,z.useState)(!1),[f,p]=(0,z.useState)(!1),[m,h]=(0,z.useState)(null),[g,_]=(0,z.useState)(``),[v,y]=(0,z.useState)(``),[b,x]=(0,z.useState)(new Set),[S,C]=(0,z.useState)(!1),[w,T]=(0,z.useState)(``),[E,D]=(0,z.useState)(!1),{data:O}=ct({queryKey:[`project-meta-all`],queryFn:()=>W.get(`/projects/meta/all`).then(e=>e.data),staleTime:3e4}),k=O||{},A=lt({mutationFn:({projectPath:e,meta:t})=>W.put(`/projects/${encodeURIComponent(e)}/meta`,t),onSuccess:()=>{t.invalidateQueries({queryKey:[`project-meta-all`]})},onError:e=>Yc(e.message||`操作失败`,`error`)}),j=(e,t)=>{t.stopPropagation();let n=k[e]||{notes:``,tags:[],archived:!1};_(n.notes),y(n.tags.join(`, `)),h(e)},M=()=>{if(!m)return;let e=k[m]||{notes:``,tags:[],archived:!1};A.mutate({projectPath:m,meta:{notes:g.trim(),tags:v.split(`,`).map(e=>e.trim()).filter(Boolean),archived:e.archived}}),h(null)},N=(e,t)=>{t.stopPropagation();let n=k[e]||{notes:``,tags:[],archived:!1};A.mutate({projectPath:e,meta:{...n,archived:!n.archived}})},ee=(e,t)=>{t.stopPropagation(),x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},P=()=>{for(let e of b){let t=k[e]||{notes:``,tags:[],archived:!1};A.mutate({projectPath:e,meta:{...t,archived:!0}})}Yc(`已归档 ${b.size} 个项目`,`success`),x(new Set)},F=async()=>{D(!0);let e=0;for(let t of b)try{await Dl(encodeURIComponent(t)),e++}catch{}D(!1),C(!1),T(``),x(new Set),t.invalidateQueries({queryKey:[`projects`]}),Yc(`已删除 ${e} 个项目`,`success`)},{data:I,isLoading:te}=ct({queryKey:[`projects`],queryFn:()=>Tl({limit:1e3}).then(e=>e.data),refetchInterval:3e4});if(te)return(0,B.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,B.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})});let ne=I?.items||[],re=e=>{c===e?d(e=>!e):(l(e),d(!1)),a(1)},L=ne.filter(e=>{if(k[e.projectPath]?.archived&&!f)return!1;if(!n)return!0;let t=n.toLowerCase();return e.projectName.toLowerCase().includes(t)||e.projectPath.toLowerCase().includes(t)}).sort((e,t)=>{let n=0;return c===`name`?n=e.projectName.localeCompare(t.projectName):c===`lastActivity`?n=(e.lastActivity||``).localeCompare(t.lastActivity||``):c===`sessionCount`?n=e.sessionCount-t.sessionCount:c===`totalEvents`&&(n=e.totalEvents-t.totalEvents),u?n:-n}),R=Math.ceil(L.length/o),ie=L.slice((i-1)*o,i*o);return(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`项目管理`}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:`查看所有被 Forge 管理的项目`})]}),(0,B.jsx)(`div`,{className:`flex items-center gap-3`,children:b.size>0?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(px,{variant:`info`,children:[b.size,` 个已选`]}),(0,B.jsxs)(`button`,{onClick:P,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors`,children:[(0,B.jsx)(Es,{className:`h-4 w-4`}),`批量归档`]}),(0,B.jsxs)(`button`,{onClick:()=>C(!0),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors`,children:[(0,B.jsx)(Lc,{className:`h-4 w-4`}),`批量删除`]}),(0,B.jsxs)(`button`,{onClick:()=>x(new Set),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-600 hover:bg-gray-50 rounded-lg transition-colors`,children:[(0,B.jsx)(Uc,{className:`h-4 w-4`}),`取消选择`]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(px,{variant:`info`,children:[L.length,` 个项目`]}),(0,B.jsxs)(`button`,{onClick:()=>p(!f),className:q(`flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg transition-colors`,f?`bg-blue-50 text-blue-600`:`text-gray-600 hover:bg-gray-50`),children:[(0,B.jsx)(Es,{className:`h-4 w-4`}),f?`隐藏归档`:`显示归档`]}),(0,B.jsxs)(`button`,{onClick:()=>{let e=[`项目名称`,`项目路径`,`会话数`,`Pipeline 数`,`质量问题数`,`总事件数`,`最近活动`],t=L.map(e=>[e.projectName,e.projectPath,e.sessionCount,e.pipelineCount,e.qualityIssueCount,e.totalEvents,e.lastActivity||``]);A4(`projects-${new Date().toISOString().slice(0,10)}.csv`,e,t)},className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-600 hover:bg-gray-50 rounded-lg transition-colors`,children:[(0,B.jsx)(Qs,{className:`h-4 w-4`}),`导出 CSV`]})]})})]}),(0,B.jsx)(X,{children:(0,B.jsxs)(`div`,{className:`flex gap-3 items-center`,children:[(0,B.jsxs)(`div`,{className:`relative flex-1`,children:[(0,B.jsx)(Ec,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,B.jsx)(`input`,{type:`text`,placeholder:`搜索项目名称或路径...`,value:n,onChange:e=>{r(e.target.value),a(1)},className:`w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`text-gray-500`,children:`排序:`}),[{key:`name`,label:`名称`},{key:`lastActivity`,label:`活动时间`},{key:`sessionCount`,label:`会话数`},{key:`totalEvents`,label:`事件数`}].map(({key:e,label:t})=>(0,B.jsxs)(`button`,{onClick:()=>re(e),className:q(`px-3 py-1.5 rounded-lg transition-colors flex items-center gap-1`,c===e?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`),children:[t,c===e&&(0,B.jsx)(ks,{className:q(`h-3 w-3`,u&&`rotate-180`)})]},e))]})]})}),(0,B.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:ie.map((t,n)=>{let r=t.projectPath,i=k[r]||{notes:``,tags:[],archived:!1};return(0,B.jsx)(ux.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:n*.03},children:(0,B.jsx)(X,{className:q(`!p-0 overflow-hidden cursor-pointer hover:shadow-md transition-shadow h-full flex flex-col`,i.archived&&`opacity-60`),onClick:()=>e(`/projects/${encodeURIComponent(r)}`),children:(0,B.jsxs)(`div`,{className:`p-4 flex-1 flex flex-col`,children:[(0,B.jsxs)(`div`,{className:`flex items-start gap-3 mb-3`,children:[(0,B.jsx)(`div`,{className:`flex items-center justify-center w-10 h-10 rounded-lg bg-blue-50 flex-shrink-0`,children:(0,B.jsx)(ac,{className:`h-5 w-5 text-blue-600`})}),(0,B.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(`h3`,{className:`font-semibold text-gray-900 truncate`,children:t.projectName}),i.archived&&(0,B.jsx)(Es,{className:`h-3.5 w-3.5 text-gray-400 flex-shrink-0`})]}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500 truncate`,children:r}),i.tags.length>0&&(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1`,children:i.tags.map(e=>(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 px-1.5 py-0.5 bg-blue-50 text-blue-600 text-xs rounded`,children:[(0,B.jsx)(Pc,{className:`h-2.5 w-2.5`}),e]},e))}),i.notes&&(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mt-1 truncate`,children:i.notes})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-1 flex-shrink-0`,children:[(0,B.jsx)(`button`,{onClick:e=>ee(r,e),className:q(`p-1 rounded transition-colors`,b.has(r)?`text-blue-600`:`text-gray-300 hover:text-gray-500`),title:`选择`,children:b.has(r)?(0,B.jsx)(jc,{className:`h-3.5 w-3.5`}):(0,B.jsx)(Nc,{className:`h-3.5 w-3.5`})}),(0,B.jsx)(`button`,{onClick:e=>N(r,e),className:`p-1 text-gray-400 hover:text-gray-600 rounded`,title:i.archived?`取消归档`:`归档`,children:(0,B.jsx)(Es,{className:`h-3.5 w-3.5`})}),(0,B.jsx)(`button`,{onClick:e=>j(r,e),className:`p-1 text-gray-400 hover:text-gray-600 rounded`,title:`项目设置`,children:(0,B.jsx)(Dc,{className:`h-3.5 w-3.5`})})]})]}),(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-sm flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,B.jsx)(Ts,{className:`h-4 w-4 flex-shrink-0`}),(0,B.jsxs)(`span`,{children:[t.sessionCount,` 会话`]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,B.jsx)(sc,{className:`h-4 w-4 flex-shrink-0`}),(0,B.jsxs)(`span`,{children:[t.pipelineCount,` Pipeline`]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,B.jsx)(Oc,{className:`h-4 w-4 flex-shrink-0`}),(0,B.jsxs)(`span`,{children:[t.qualityIssueCount,` 质量`]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,B.jsx)(Ns,{className:`h-4 w-4 flex-shrink-0`}),(0,B.jsxs)(`span`,{children:[t.totalEvents,` 事件`]})]})]}),t.lastActivity&&(0,B.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-gray-400 mt-3 pt-3 border-t border-gray-100`,children:[(0,B.jsx)(Ks,{className:`h-3 w-3 flex-shrink-0`}),(0,B.jsxs)(`span`,{children:[`最近活动:`,C4(Qd(t.lastActivity),`MM-dd HH:mm`)]})]})]})})},r)})}),L.length===0&&(0,B.jsxs)(`div`,{className:`text-center py-12`,children:[(0,B.jsx)(ac,{className:`h-12 w-12 text-gray-300 mx-auto mb-3`}),(0,B.jsx)(`p`,{className:`text-gray-500`,children:`暂无项目`}),(0,B.jsx)(`p`,{className:`text-sm text-gray-400 mt-1`,children:`在任意目录使用 Claude Code 后,项目将自动出现在这里`})]}),L.length>0&&(0,B.jsx)(k4,{currentPage:i,totalPages:R,onPageChange:a,pageSize:o,onPageSizeChange:e=>{s(e),a(1)},totalItems:L.length}),S&&(0,B.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onClick:()=>{C(!1),T(``)},children:(0,B.jsxs)(`div`,{className:`bg-white rounded-xl shadow-xl w-full max-w-md p-6`,onClick:e=>e.stopPropagation(),children:[(0,B.jsxs)(`h3`,{className:`text-lg font-bold text-red-600 mb-3 flex items-center gap-2`,children:[(0,B.jsx)(Lc,{className:`h-5 w-5`}),`危险操作:批量删除项目`]}),(0,B.jsxs)(`div`,{className:`bg-red-50 border border-red-200 rounded-lg p-3 mb-4`,children:[(0,B.jsxs)(`p`,{className:`text-sm text-red-800 font-medium mb-2`,children:[`⚠️ 此操作将永久删除 `,(0,B.jsxs)(`strong`,{children:[b.size,` 个项目`]}),` 的所有监控数据:`]}),(0,B.jsxs)(`ul`,{className:`text-xs text-red-700 space-y-1 ml-4 list-disc`,children:[(0,B.jsx)(`li`,{children:`所有会话记录`}),(0,B.jsx)(`li`,{children:`所有 Pipeline 历史`}),(0,B.jsx)(`li`,{children:`所有质量问题记录`}),(0,B.jsx)(`li`,{children:`所有事件日志`}),(0,B.jsx)(`li`,{children:`所有知识节点`})]}),(0,B.jsx)(`p`,{className:`text-xs text-red-800 font-bold mt-2`,children:`此操作无法撤销,无法恢复!`})]}),(0,B.jsxs)(`div`,{className:`mb-4`,children:[(0,B.jsxs)(`label`,{className:`block text-sm font-medium text-gray-700 mb-2`,children:[`请输入 `,(0,B.jsx)(`code`,{className:`px-1.5 py-0.5 bg-gray-100 rounded text-red-600`,children:`删除`}),` 以确认批量删除:`]}),(0,B.jsx)(`input`,{type:`text`,value:w,onChange:e=>T(e.target.value),placeholder:`输入「删除」二字`,className:`w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-red-500`,autoFocus:!0})]}),(0,B.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,B.jsx)(`button`,{onClick:()=>{C(!1),T(``)},className:`px-4 py-2 text-sm text-gray-600 hover:bg-gray-50 rounded-lg`,children:`取消`}),(0,B.jsx)(`button`,{disabled:w!==`删除`||E,onClick:F,className:`px-4 py-2 text-sm bg-red-600 text-white rounded-lg hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed`,children:E?`删除中...`:`确认删除`})]})]})}),m&&(0,B.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40`,onClick:()=>h(null),children:(0,B.jsxs)(`div`,{className:`bg-white rounded-xl shadow-xl w-full max-w-md p-6`,onClick:e=>e.stopPropagation(),children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,B.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`项目设置`}),(0,B.jsx)(`button`,{onClick:()=>h(null),className:`text-gray-400 hover:text-gray-600`,children:(0,B.jsx)(Uc,{className:`h-5 w-5`})})]}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500 mb-4 truncate`,children:m}),(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标签(逗号分隔)`}),(0,B.jsx)(`input`,{type:`text`,value:v,onChange:e=>y(e.target.value),placeholder:`前端, 工具, 实验...`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`备注`}),(0,B.jsx)(`textarea`,{value:g,onChange:e=>_(e.target.value),rows:3,placeholder:`项目说明、注意事项...`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none`})]})]}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2 mt-5`,children:[(0,B.jsx)(`button`,{onClick:()=>h(null),className:`px-4 py-2 text-sm text-gray-600 hover:bg-gray-50 rounded-lg`,children:`取消`}),(0,B.jsx)(`button`,{onClick:M,className:`px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700`,children:`保存`})]})]})})]})}var wue={spec:{label:`规格`,icon:ic,color:`text-blue-600`,bg:`bg-blue-50`,border:`border-blue-200`},security:{label:`安全`,icon:kc,color:`text-red-600`,bg:`bg-red-50`,border:`border-red-200`},quality:{label:`质量`,icon:nc,color:`text-purple-600`,bg:`bg-purple-50`,border:`border-purple-200`},test:{label:`测试`,icon:Ic,color:`text-green-600`,bg:`bg-green-50`,border:`border-green-200`},performance:{label:`性能`,icon:Wc,color:`text-orange-600`,bg:`bg-orange-50`,border:`border-orange-200`}},Tue={fail:{label:`失败`,icon:Gs,color:`text-red-600`,bg:`bg-red-50`,border:`border-red-300`},warn:{label:`警告`,icon:zc,color:`text-yellow-600`,bg:`bg-yellow-50`,border:`border-yellow-300`},pass:{label:`通过`,icon:Us,color:`text-green-600`,bg:`bg-green-50`,border:`border-green-300`}};function Eue({level:e}){let t=Tue[e];if(!t)return(0,B.jsx)(px,{size:`sm`,children:e});let n=t.icon;return(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border ${t.bg} ${t.color} ${t.border}`,children:[(0,B.jsx)(n,{className:`h-3 w-3`}),t.label]})}function Due({category:e}){let t=wue[e];if(!t)return(0,B.jsx)(px,{size:`sm`,children:e});let n=t.icon;return(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border ${t.bg} ${t.color} ${t.border}`,children:[(0,B.jsx)(n,{className:`h-3 w-3`}),t.label]})}function Oue(){let{encodedPath:e}=In(),t=Pn(),n=qe(),[r,i]=(0,z.useState)(`sessions`),[a,o]=(0,z.useState)(!1),[s,c]=(0,z.useState)(``),[l,u]=(0,z.useState)(!1),[d,f]=(0,z.useState)(``),[p,m]=(0,z.useState)(null),[h,g]=(0,z.useState)(1),[_,v]=(0,z.useState)(20),[y,b]=(0,z.useState)(null),x=async e=>{try{let t=await Gl(e);await navigator.clipboard.writeText(t.data.context),b(e),Yc(`上下文已复制,请粘贴到 Claude Code 进行修复`,`success`),setTimeout(()=>b(null),3e3)}catch{Yc(`复制失败`,`error`)}},{data:S,isLoading:C,isError:w,error:T}=ct({queryKey:[`project`,e],queryFn:()=>El(encodeURIComponent(decodeURIComponent(e))).then(e=>e.data),enabled:!!e}),{data:E}=ct({queryKey:[`claudemd`,e],queryFn:()=>Fl(encodeURIComponent(decodeURIComponent(e))).then(e=>e.data),enabled:!!e&&r===`claudemd`}),{data:D}=ct({queryKey:[`claudemd-modules`,e],queryFn:()=>Rl(encodeURIComponent(decodeURIComponent(e))).then(e=>e.data),enabled:!!e&&r===`claudemd`}),O=lt({mutationFn:()=>Dl(encodeURIComponent(decodeURIComponent(e))),onSuccess:()=>{n.invalidateQueries({queryKey:[`projects`]}),t(`/projects`)},onError:e=>Yc(e.message||`删除失败`,`error`)}),k=lt({mutationFn:t=>Il(encodeURIComponent(decodeURIComponent(e)),t),onSuccess:()=>{n.invalidateQueries({queryKey:[`claudemd`,e]}),u(!1)},onError:e=>Yc(e.message||`保存失败`,`error`)}),A=lt({mutationFn:()=>zl(encodeURIComponent(decodeURIComponent(e))),onSuccess:t=>{n.invalidateQueries({queryKey:[`claudemd`,e]}),m({success:!0,message:t.data.distilled?`蒸馏完成,压缩 ${t.data.reduction}%(${t.data.before} → ${t.data.after} 字符):${t.data.summary}`:t.data.message??`无需蒸馏`})},onError:e=>{m({success:!1,message:e.message})}}),[j,M]=(0,z.useState)(null),[N,ee]=(0,z.useState)(!1),[P,F]=(0,z.useState)(!1),[I,te]=(0,z.useState)(null),[ne,re]=(0,z.useState)(!1),[L,R]=(0,z.useState)(null);return w?(0,B.jsxs)(`div`,{className:`flex items-center justify-center h-96 text-red-500`,children:[`加载失败:`,T?.message||`未知错误`]}):C||!S?(0,B.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,B.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})}):(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsx)(N4,{items:[{label:`项目列表`,path:`/projects`},{label:S.projectName}]}),(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,B.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Ds,onClick:()=>t(`/projects`),children:`返回`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(`div`,{className:`flex items-center justify-center w-10 h-10 rounded-lg bg-blue-50`,children:(0,B.jsx)(ac,{className:`h-5 w-5 text-blue-600`})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-xl font-bold text-gray-900`,children:S.projectName}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:S.projectPath})]})]})]}),(0,B.jsx)(Y,{variant:`danger`,size:`sm`,icon:Lc,onClick:()=>o(!0),children:`删除项目`})]}),a&&(0,B.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,children:(0,B.jsxs)(X,{className:`max-w-md`,children:[(0,B.jsxs)(`h3`,{className:`text-lg font-bold text-red-600 mb-3 flex items-center gap-2`,children:[(0,B.jsx)(zc,{className:`h-5 w-5`}),`危险操作:删除项目`]}),(0,B.jsxs)(`div`,{className:`bg-red-50 border border-red-200 rounded-lg p-3 mb-4`,children:[(0,B.jsxs)(`p`,{className:`text-sm text-red-800 font-medium mb-2`,children:[`⚠️ 此操作将永久删除项目 `,(0,B.jsx)(`strong`,{children:S.projectName}),` 的所有监控数据:`]}),(0,B.jsxs)(`ul`,{className:`text-xs text-red-700 space-y-1 ml-4 list-disc`,children:[(0,B.jsx)(`li`,{children:`所有会话记录`}),(0,B.jsx)(`li`,{children:`所有 Pipeline 历史`}),(0,B.jsx)(`li`,{children:`所有质量问题记录`}),(0,B.jsx)(`li`,{children:`所有事件日志`}),(0,B.jsx)(`li`,{children:`所有知识节点`})]}),(0,B.jsx)(`p`,{className:`text-xs text-red-800 font-bold mt-2`,children:`此操作无法撤销,无法恢复!`})]}),(0,B.jsxs)(`div`,{className:`mb-4`,children:[(0,B.jsxs)(`label`,{className:`block text-sm font-medium text-gray-700 mb-2`,children:[`请输入项目名称 `,(0,B.jsx)(`code`,{className:`px-1.5 py-0.5 bg-gray-100 rounded text-red-600`,children:S.projectName}),` 以确认删除:`]}),(0,B.jsx)(`input`,{type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`输入项目名称`,className:`w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-red-500`,autoFocus:!0})]}),(0,B.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,B.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:()=>{o(!1),c(``)},children:`取消`}),(0,B.jsx)(Y,{variant:`danger`,size:`sm`,disabled:s!==S.projectName,onClick:()=>{s===S.projectName&&(O.mutate(),o(!1),c(``))},children:`确认删除`})]})]})}),(0,B.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-5 gap-4`,children:[(0,B.jsx)(X,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>i(`sessions`),children:(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(Ts,{className:`h-8 w-8 text-blue-500`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:S.sessions.total}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:`会话`})]})]})}),(0,B.jsx)(X,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>i(`pipelines`),children:(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(sc,{className:`h-8 w-8 text-green-500`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:S.pipelines.total}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:`Pipeline`})]})]})}),(0,B.jsx)(X,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>i(`api`),children:(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(Fc,{className:`h-8 w-8 text-purple-500`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:S.events.total}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:`事件`})]})]})}),(0,B.jsx)(X,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>i(`quality`),children:(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(Oc,{className:`h-8 w-8 text-orange-500`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:S.quality.total}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:`质量`})]})]})}),(0,B.jsx)(X,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>i(`knowledge`),children:(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(Ns,{className:`h-8 w-8 text-pink-500`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:S.knowledge.total}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:`知识`})]})]})})]}),(0,B.jsx)(`div`,{className:`flex gap-1 bg-gray-100 p-1 rounded-lg w-fit flex-wrap`,children:[{key:`sessions`,label:`会话`},{key:`pipelines`,label:`Pipeline`},{key:`quality`,label:`质量问题`},{key:`knowledge`,label:`知识文档`},{key:`rules`,label:`规则管理`},{key:`convention`,label:`自定义规范`},{key:`claudemd`,label:`CLAUDE.md`},{key:`environment`,label:`环境初始化`}].map(e=>(0,B.jsx)(`button`,{onClick:()=>i(e.key),className:`px-4 py-2 rounded-md text-sm font-medium transition-colors ${r===e.key?`bg-white text-gray-900 shadow-sm`:`text-gray-600 hover:text-gray-900`}`,children:e.label},e.key))}),r===`sessions`&&(0,B.jsxs)(X,{children:[(0,B.jsx)(`div`,{className:`overflow-x-auto`,children:(0,B.jsxs)(`table`,{className:`w-full`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`会话 ID`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`首条对话`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`状态`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`开始时间`})]})}),(0,B.jsx)(`tbody`,{className:`text-sm`,children:(()=>{let n=S.sessions.items;return Math.ceil(n.length/_),(0,B.jsxs)(B.Fragment,{children:[n.slice((h-1)*_,h*_).map(n=>(0,B.jsxs)(`tr`,{onClick:()=>t(`/sessions/${n.session_id}`,{state:{from:`/projects/${encodeURIComponent(decodeURIComponent(e))}`}}),className:`border-t border-gray-50 hover:bg-blue-50 cursor-pointer transition-colors`,children:[(0,B.jsx)(`td`,{className:`py-3 font-mono text-xs`,children:n.session_id.slice(0,12)}),(0,B.jsx)(`td`,{className:`py-3 text-gray-700 max-w-md truncate`,title:n.first_requirement,children:n.first_requirement?n.first_requirement:`(无对话记录)`}),(0,B.jsx)(`td`,{className:`py-3`,children:(0,B.jsx)(px,{size:`sm`,className:Zd(n.status),children:n.status})}),(0,B.jsx)(`td`,{className:`py-3 text-gray-500`,children:C4(Qd(n.start_time),`MM-dd HH:mm`)})]},n.session_id)),n.length===0&&(0,B.jsx)(`tr`,{children:(0,B.jsx)(`td`,{colSpan:4,className:`py-8 text-center text-gray-400`,children:`暂无会话记录`})})]})})()})]})}),(()=>{let e=S.sessions.items,t=Math.ceil(e.length/_);return e.length>_?(0,B.jsx)(`div`,{className:`mt-4`,children:(0,B.jsx)(k4,{currentPage:h,totalPages:t,onPageChange:g,pageSize:_,onPageSizeChange:e=>{v(e),g(1)},totalItems:e.length})}):null})()]}),r===`pipelines`&&(0,B.jsx)(X,{children:(0,B.jsx)(`div`,{className:`overflow-x-auto`,children:(0,B.jsxs)(`table`,{className:`w-full`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`需求`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`阶段`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`时间`})]})}),(0,B.jsx)(`tbody`,{className:`text-sm`,children:S.pipelines.items.map(n=>(0,B.jsxs)(`tr`,{onClick:()=>t(`/pipelines/${n.id}`,{state:{from:`/projects/${encodeURIComponent(decodeURIComponent(e))}`}}),className:`border-t border-gray-50 hover:bg-blue-50 cursor-pointer transition-colors`,children:[(0,B.jsx)(`td`,{className:`py-3 max-w-xs truncate`,children:n.requirement}),(0,B.jsx)(`td`,{className:`py-3`,children:(0,B.jsx)(px,{size:`sm`,children:n.phase})}),(0,B.jsx)(`td`,{className:`py-3 text-gray-500`,children:C4(Qd(n.updated_at),`MM-dd HH:mm`)})]},n.id))})]})})}),r===`quality`&&(0,B.jsxs)(X,{children:[(0,B.jsx)(`div`,{className:`flex items-center justify-between mb-4`,children:(0,B.jsxs)(`p`,{className:`text-sm text-gray-600`,children:[`共 `,S.quality.total,` 个质量问题`]})}),(0,B.jsx)(`div`,{className:`overflow-x-auto`,children:(0,B.jsxs)(`table`,{className:`w-full`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`问题`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`级别`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`分类`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`状态`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`时间`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`})]})}),(0,B.jsx)(`tbody`,{className:`text-sm`,children:S.quality.items.map(e=>(0,B.jsxs)(`tr`,{className:`border-t border-gray-50 hover:bg-blue-50 transition-colors`,children:[(0,B.jsx)(`td`,{className:`py-3 max-w-xs truncate`,children:e.message}),(0,B.jsx)(`td`,{className:`py-3`,children:(0,B.jsx)(Eue,{level:e.level})}),(0,B.jsx)(`td`,{className:`py-3`,children:(0,B.jsx)(Due,{category:e.category})}),(0,B.jsx)(`td`,{className:`py-3`,children:(0,B.jsx)(px,{size:`sm`,variant:e.resolved?`success`:`default`,children:e.resolved?`已解决`:`未解决`})}),(0,B.jsx)(`td`,{className:`py-3 text-gray-500`,children:C4(Qd(e.created_at),`MM-dd HH:mm`)}),(0,B.jsx)(`td`,{className:`py-3`,children:!e.resolved&&(0,B.jsxs)(`button`,{onClick:()=>x(e.id),className:`flex items-center gap-1 px-2 py-1 text-xs text-gray-500 hover:text-blue-600 hover:bg-blue-50 rounded transition-colors`,title:`复制上下文到剪贴板`,children:[y===e.id?(0,B.jsx)(Is,{className:`h-3.5 w-3.5 text-green-500`}):(0,B.jsx)(Ys,{className:`h-3.5 w-3.5`}),y===e.id?`已复制`:`复制`]})})]},e.id))})]})})]}),r===`knowledge`&&(0,B.jsx)(X,{children:(0,B.jsx)(`div`,{className:`space-y-3`,children:S.knowledge.items.map(e=>(0,B.jsx)(`div`,{className:`p-4 border border-gray-100 rounded-lg hover:bg-blue-50 cursor-pointer transition-colors`,children:(0,B.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,B.jsx)(ic,{className:`h-5 w-5 text-blue-500 flex-shrink-0 mt-0.5`}),(0,B.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,B.jsx)(`h4`,{className:`font-medium text-gray-900 mb-1`,children:e.title}),(0,B.jsxs)(`p`,{className:`text-sm text-gray-600 line-clamp-2`,children:[e.content?.substring(0,150),`...`]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-gray-400`,children:[(0,B.jsx)(px,{size:`sm`,children:e.node_type}),(0,B.jsxs)(`span`,{children:[`更新于 `,C4(Qd(e.updated_at),`MM-dd HH:mm`)]})]})]})]})},e.id))})}),r===`rules`&&(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsx)(X,{title:`意图识别规则`,children:(0,B.jsx)(`div`,{className:`space-y-2`,children:S.rules.intentRules.slice(0,10).map(e=>(0,B.jsx)(`div`,{className:`flex items-center justify-between p-3 border border-gray-100 rounded-lg`,children:(0,B.jsxs)(`div`,{className:`flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(px,{size:`sm`,children:e.rule_type}),(0,B.jsx)(`code`,{className:`text-xs text-gray-600`,children:e.pattern})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-3 mt-1 text-xs text-gray-400`,children:[(0,B.jsxs)(`span`,{children:[`命中 `,e.hit_count,` 次`]}),(0,B.jsxs)(`span`,{children:[`置信度 `,(e.confidence*100).toFixed(0),`%`]})]})]})},e.id))})}),(0,B.jsx)(X,{title:`任务模式`,children:(0,B.jsx)(`div`,{className:`space-y-2`,children:S.rules.taskPatterns.slice(0,10).map(e=>(0,B.jsxs)(`div`,{className:`p-3 border border-gray-100 rounded-lg`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,B.jsx)(px,{size:`sm`,children:e.task_type}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-gray-500`,children:[(0,B.jsx)(Rc,{className:`h-3 w-3`}),(0,B.jsxs)(`span`,{children:[`效果 `,(e.effectiveness_score*100).toFixed(0),`%`]})]})]}),(0,B.jsx)(`p`,{className:`text-sm text-gray-600 mb-1`,children:e.failure_pattern}),(0,B.jsxs)(`p`,{className:`text-xs text-gray-500`,children:[`策略:`,e.prevention_strategy]})]},e.id))})})]}),r===`convention`&&e&&(0,B.jsx)(kue,{encodedPath:encodeURIComponent(decodeURIComponent(e))}),r===`claudemd`&&(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(X,{children:(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(ic,{className:`h-5 w-5 text-blue-500`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:`CLAUDE.md`}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500`,children:E?.exists?`${(E.size/1024).toFixed(1)} KB · ${E.hasAutoSection?`含自动区块`:`纯用户内容`}`:`文件不存在`})]})]}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Cc,onClick:()=>n.invalidateQueries({queryKey:[`claudemd`,e]}),children:`刷新`}),E?.exists&&(0,B.jsx)(Y,{variant:`secondary`,size:`sm`,icon:Wc,onClick:()=>{m(null),A.mutate()},disabled:A.isPending,title:`AI 蒸馏:压缩冗余内容,保留核心规范`,children:A.isPending?`蒸馏中...`:`蒸馏`}),E?.exists&&!l&&(0,B.jsx)(Y,{size:`sm`,icon:yc,onClick:()=>{f(E.content||``),u(!0)},children:`编辑`})]})]})}),p&&(0,B.jsx)(X,{children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsx)(`p`,{className:`text-sm ${p.success?`text-gray-900`:`text-red-600`}`,children:p.message}),(0,B.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Uc,onClick:()=>m(null)})]})}),l&&(0,B.jsxs)(X,{children:[(0,B.jsx)(`textarea`,{className:`w-full px-3 py-2 text-sm border border-gray-200 rounded-md font-mono h-96 resize-y`,value:d,onChange:e=>f(e.target.value)}),(0,B.jsxs)(`div`,{className:`flex gap-2 justify-end mt-3`,children:[(0,B.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Uc,onClick:()=>u(!1),children:`取消`}),(0,B.jsx)(Y,{size:`sm`,icon:Ls,onClick:()=>k.mutate(d),children:`保存`})]})]}),!l&&E?.exists&&(0,B.jsx)(X,{title:`内容预览`,children:(0,B.jsx)(`pre`,{className:`text-xs text-gray-700 bg-gray-50 p-4 rounded-md overflow-auto max-h-96 whitespace-pre-wrap font-mono`,children:E.content})}),(0,B.jsx)(X,{title:`子模块 (${D?.total??0})`,children:D?.items.length===0?(0,B.jsx)(`p`,{className:`text-sm text-gray-400`,children:`未检测到子模块`}):(0,B.jsx)(`div`,{className:`space-y-2`,children:D?.items.map(e=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between p-3 border border-gray-100 rounded-lg`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(ac,{className:`h-4 w-4 text-gray-400`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:e.name}),(0,B.jsx)(`p`,{className:`text-xs text-gray-400`,children:e.relativePath})]})]}),(0,B.jsx)(px,{size:`sm`,variant:e.hasClaudeMd?`success`:`default`,children:e.hasClaudeMd?`已有 CLAUDE.md`:`未生成`})]},e.path))})})]}),r===`environment`&&(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(X,{children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`font-medium text-gray-900 mb-1`,children:`环境检测 & 项目初始化`}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:`检测项目技术栈、创建 .claude-forge 目录、自动生成 CLAUDE.md(如不存在)`})]}),(0,B.jsxs)(`div`,{className:`flex gap-2 flex-shrink-0`,children:[(0,B.jsx)(Y,{variant:`secondary`,size:`sm`,icon:Dc,onClick:async()=>{ee(!0),M(null);try{M((await Ll(encodeURIComponent(decodeURIComponent(e)))).data.profile)}catch(e){M({error:String(e)})}finally{ee(!1)}},disabled:N,children:N?`检测中...`:`环境检测`}),(0,B.jsx)(Y,{size:`sm`,icon:Wc,onClick:async()=>{F(!0),te(null);try{let t=await Bl(encodeURIComponent(decodeURIComponent(e)));te({success:t.data.success,message:t.data.message,claudeMdGenerated:t.data.claudeMdGenerated}),M(t.data.profile),n.invalidateQueries({queryKey:[`claudemd`,e]}),n.invalidateQueries({queryKey:[`project`,e]})}catch(e){te({success:!1,message:String(e)})}finally{F(!1)}},disabled:P,children:P?`初始化中...`:`一键初始化`}),(0,B.jsx)(Y,{size:`sm`,icon:ic,onClick:async()=>{re(!0),R(null);try{let t=await Ol(encodeURIComponent(decodeURIComponent(e)));R({success:t.data.success,message:t.data.message}),t.data.skipped||(n.invalidateQueries({queryKey:[`conventions`,e]}),n.invalidateQueries({queryKey:[`claudemd`,e]}))}catch(e){R({success:!1,message:String(e)})}finally{re(!1)}},disabled:ne,children:ne?`生成中...`:`初始化规范`})]})]})}),I&&(0,B.jsx)(X,{children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex items-start gap-2`,children:[I.success?(0,B.jsx)(Ls,{className:`h-4 w-4 text-green-500 mt-0.5 flex-shrink-0`}):(0,B.jsx)(Uc,{className:`h-4 w-4 text-red-500 mt-0.5 flex-shrink-0`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-sm font-medium ${I.success?`text-gray-900`:`text-red-600`}`,children:I.message}),I.claudeMdGenerated&&(0,B.jsx)(`p`,{className:`text-xs text-green-600 mt-0.5`,children:`CLAUDE.md 已自动生成`})]})]}),(0,B.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Uc,onClick:()=>te(null)})]})}),L&&(0,B.jsx)(X,{children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex items-start gap-2`,children:[L.success?(0,B.jsx)(Ls,{className:`h-4 w-4 text-green-500 mt-0.5 flex-shrink-0`}):(0,B.jsx)(Uc,{className:`h-4 w-4 text-red-500 mt-0.5 flex-shrink-0`}),(0,B.jsx)(`p`,{className:q(`text-sm font-medium`,L.success?`text-gray-900`:`text-red-600`),children:L.message})]}),(0,B.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Uc,onClick:()=>R(null)})]})}),j&&!(`error`in j)&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(X,{title:`技术栈`,children:(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 text-sm`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`项目名称`}),(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:j.projectName})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`包管理器`}),(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:j.packageManager||`未检测到`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`测试框架`}),(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:j.testFramework||`未检测到`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`构建工具`}),(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:j.buildTool||`未检测到`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`Linter`}),(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:j.linter||`未检测到`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`Formatter`}),(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:j.formatter||`未检测到`})]})]})}),j.languages.length>0&&(0,B.jsx)(X,{title:`检测到的语言`,children:(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:j.languages.map((e,t)=>(0,B.jsxs)(px,{size:`sm`,children:[e.name,e.version?` ${e.version}`:``]},t))})}),j.frameworks.length>0&&(0,B.jsx)(X,{title:`检测到的框架`,children:(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:j.frameworks.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-1 bg-blue-50 rounded-md`,children:[(0,B.jsx)(`span`,{className:`text-sm font-medium text-blue-700`,children:e.name}),(0,B.jsx)(`span`,{className:`text-xs text-blue-400`,children:e.category})]},t))})}),Object.keys(j.scripts).length>0&&(0,B.jsx)(X,{title:`常用脚本`,children:(0,B.jsx)(`div`,{className:`space-y-1`,children:Object.entries(j.scripts).map(([e,t])=>(0,B.jsxs)(`div`,{className:`flex items-start gap-3 text-sm py-1 border-b border-gray-50 last:border-0`,children:[(0,B.jsx)(`span`,{className:`font-mono text-blue-600 flex-shrink-0 w-24`,children:e}),(0,B.jsx)(`span`,{className:`text-gray-600 font-mono text-xs break-all`,children:t})]},e))})}),j.keyDirectories.length>0&&(0,B.jsx)(X,{title:`关键目录`,children:(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:j.keyDirectories.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-1 bg-gray-50 rounded-md`,children:[(0,B.jsx)(ac,{className:`h-3.5 w-3.5 text-gray-400`}),(0,B.jsx)(`span`,{className:`text-sm text-gray-700 font-mono`,children:e})]},t))})})]}),j&&`error`in j&&(0,B.jsx)(X,{children:(0,B.jsxs)(`p`,{className:`text-sm text-red-600`,children:[`检测失败:`,j.error]})})]})]})}function kue({encodedPath:e}){let[t,n]=(0,z.useState)(`bindings`),[r,i]=(0,z.useState)(!1),[a,o]=(0,z.useState)(``),[s,c]=(0,z.useState)(!1),l=qe(),{data:u,isLoading:d}=ct({queryKey:[`project-conventions`,e],queryFn:()=>kl(e).then(e=>e.data)}),{data:f}=ct({queryKey:[`global-conventions`],queryFn:()=>du().then(e=>e.data),enabled:r}),{data:p}=ct({queryKey:[`project-custom-yaml`,e],queryFn:()=>Ml(e).then(e=>e.data),enabled:s}),m=lt({mutationFn:t=>Al(e,t).then(e=>e.data),onSuccess:t=>{Yc(`已绑定:${t.convention.name}`,`success`),i(!1),l.invalidateQueries({queryKey:[`project-conventions`,e]})}}),h=lt({mutationFn:t=>jl(e,t).then(e=>e.data),onSuccess:()=>{Yc(`已解绑`,`success`),l.invalidateQueries({queryKey:[`project-conventions`,e]})}}),g=lt({mutationFn:()=>Pl(e).then(e=>e.data),onSuccess:t=>{Yc(t.isIncremental?`增量蒸馏完成,版本 ${t.convention.version}`:`蒸馏完成,生成 ${t.convention.name}`,`success`),l.invalidateQueries({queryKey:[`project-conventions`,e]}),n(`custom`)}}),_=lt({mutationFn:t=>Nl(e,t).then(e=>e.data),onSuccess:()=>{Yc(`保存成功`,`success`),c(!1),l.invalidateQueries({queryKey:[`project-conventions`,e]})}}),v=u?.bindings||[],y=u?.custom,b=(f?.items||[]).filter(e=>!v.some(t=>t.id===e.id)),x={official:`bg-amber-50 text-amber-700`,user:`bg-blue-50 text-blue-700`,community:`bg-purple-50 text-purple-700`},S={official:`官方`,user:`用户`,community:`社区`};return d?(0,B.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,B.jsx)(Cc,{className:`h-6 w-6 animate-spin text-blue-500`})}):(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(`div`,{className:`flex gap-1 bg-gray-100 rounded-lg p-1`,children:[`bindings`,`custom`].map(e=>(0,B.jsx)(`button`,{onClick:()=>n(e),className:`px-4 py-1.5 text-sm font-medium rounded-md transition-colors flex items-center gap-1.5 ${t===e?`bg-white text-gray-900 shadow-sm`:`text-gray-500 hover:text-gray-700`}`,children:e===`bindings`?`绑定的规范 (${v.length})`:(0,B.jsxs)(B.Fragment,{children:[`蒸馏规范`,y&&(0,B.jsx)(`span`,{className:`inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700`,children:`实际生效`})]})},e))}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[t===`bindings`&&(0,B.jsxs)(`button`,{onClick:()=>i(!r),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors`,children:[(0,B.jsx)(fc,{className:`h-3.5 w-3.5`}),`绑定规范`]}),t===`custom`&&(0,B.jsxs)(`button`,{onClick:()=>g.mutate(),disabled:g.isPending||v.length===0,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-purple-600 text-white rounded-lg hover:bg-purple-700 disabled:opacity-50 transition-colors`,title:v.length===0?`请先绑定至少一个规范`:``,children:[(0,B.jsx)(Wc,{className:`h-3.5 w-3.5 ${g.isPending?`animate-pulse`:``}`}),g.isPending?`蒸馏中...`:y?`重新蒸馏`:`生成蒸馏规范`]})]})]}),r&&(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-blue-200 p-4 space-y-3`,children:[(0,B.jsx)(`div`,{className:`text-sm font-medium text-gray-700`,children:`从全局规范库选择绑定`}),b.length===0?(0,B.jsx)(`p`,{className:`text-sm text-gray-400`,children:`所有全局规范已全部绑定`}):(0,B.jsx)(`div`,{className:`grid gap-2`,children:b.map(e=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between p-3 bg-gray-50 rounded-lg`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`text-sm font-medium text-gray-900`,children:e.name}),(0,B.jsx)(`span`,{className:`px-1.5 py-0.5 text-xs rounded-full ${x[e.source]||`bg-gray-100 text-gray-600`}`,children:S[e.source]||e.source}),(0,B.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`v`,e.version]})]}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:e.description})]}),(0,B.jsx)(`button`,{onClick:()=>m.mutate(e.id),disabled:m.isPending,className:`px-3 py-1.5 text-xs bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:`绑定`})]},e.id))}),(0,B.jsx)(`button`,{onClick:()=>i(!1),className:`text-xs text-gray-400 hover:text-gray-600`,children:`关闭`})]}),t===`bindings`&&(0,B.jsx)(`div`,{className:`space-y-3`,children:v.length===0?(0,B.jsxs)(`div`,{className:`text-center py-12 bg-white rounded-xl border border-gray-200`,children:[(0,B.jsx)(As,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,B.jsx)(`p`,{className:`text-gray-500 text-sm`,children:`尚未绑定任何规范`}),(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:`点击「绑定规范」从全局规范库选择`})]}):v.map(e=>(0,B.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,B.jsx)(`span`,{className:`font-medium text-gray-900`,children:e.name}),(0,B.jsx)(`span`,{className:`px-1.5 py-0.5 text-xs rounded-full font-medium ${x[e.source]||`bg-gray-100 text-gray-600`}`,children:S[e.source]||e.source}),(0,B.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`v`,e.version]})]}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500`,children:e.description}),(0,B.jsxs)(`div`,{className:`flex gap-3 mt-2 text-xs text-gray-400`,children:[(0,B.jsxs)(`span`,{children:[e.roles?Object.keys(e.roles).length:0,` 个角色`]}),(0,B.jsxs)(`span`,{children:[e.quality_standards?.length||0,` 条质量标准`]})]})]}),(0,B.jsx)(`button`,{onClick:()=>h.mutate(e.id),disabled:h.isPending,className:`ml-4 p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors`,title:`解绑`,children:(0,B.jsx)(Uc,{className:`h-4 w-4`})})]})},e.id))}),t===`custom`&&(0,B.jsx)(`div`,{className:`space-y-4`,children:y?(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 overflow-hidden`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between px-5 py-4 border-b border-gray-100`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`font-semibold text-gray-900`,children:y.name}),(0,B.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`v`,y.version]}),(0,B.jsx)(`span`,{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700 border border-green-200`,children:`项目真实规范`})]}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:y.description})]}),!s&&(0,B.jsxs)(`button`,{onClick:()=>{o(p?.yaml||``),c(!0)},className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-gray-100 text-gray-700 hover:bg-gray-200 rounded-lg transition-colors`,children:[(0,B.jsx)(yc,{className:`h-3.5 w-3.5`}),`编辑 YAML`]})]}),(0,B.jsx)(`div`,{className:`p-5`,children:s?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(`textarea`,{value:a||p?.yaml||``,onChange:e=>o(e.target.value),rows:24,className:`w-full px-3 py-2 text-xs border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono`}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsxs)(`button`,{onClick:()=>_.mutate(a),disabled:_.isPending,className:`flex items-center gap-1.5 px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:[(0,B.jsx)(Tc,{className:`h-3.5 w-3.5`}),_.isPending?`保存中...`:`保存`]}),(0,B.jsx)(`button`,{onClick:()=>c(!1),className:`px-4 py-2 text-sm bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors`,children:`取消`})]})]}):(0,B.jsxs)(`div`,{className:`space-y-4 text-sm`,children:[y.principles&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`text-xs font-medium text-gray-500 uppercase tracking-wide mb-2`,children:`核心原则`}),(0,B.jsx)(`pre`,{className:`text-xs text-gray-700 bg-gray-50 rounded-lg p-3 whitespace-pre-wrap border border-gray-100 max-h-48 overflow-y-auto`,children:typeof y.principles==`string`?y.principles:JSON.stringify(y.principles,null,2)})]}),y.quality_standards&&y.quality_standards.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`text-xs font-medium text-gray-500 uppercase tracking-wide mb-2`,children:[`质量标准 (`,y.quality_standards.length,`)`]}),(0,B.jsxs)(`div`,{className:`space-y-1`,children:[y.quality_standards.slice(0,5).map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-start gap-2 text-xs text-gray-600`,children:[(0,B.jsx)(`span`,{className:`mt-0.5 px-1.5 py-0.5 rounded text-xs font-medium ${e.severity===`must`?`bg-red-50 text-red-600`:e.severity===`should`?`bg-yellow-50 text-yellow-600`:`bg-gray-100 text-gray-500`}`,children:e.severity||`rule`}),(0,B.jsx)(`span`,{children:e.rule||String(e)})]},t)),y.quality_standards.length>5&&(0,B.jsxs)(`p`,{className:`text-xs text-gray-400`,children:[`...还有 `,y.quality_standards.length-5,` 条`]})]})]})]})})]}):(0,B.jsxs)(`div`,{className:`text-center py-12 bg-white rounded-xl border border-gray-200`,children:[(0,B.jsx)(Wc,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,B.jsx)(`p`,{className:`text-gray-500 text-sm`,children:`尚未生成蒸馏规范`}),(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:v.length>0?`点击「生成蒸馏规范」将绑定的规范融合为项目专属规范`:`请先绑定至少一个规范,再生成蒸馏规范`})]})})]})}var Q9={local:`bg-blue-50 text-blue-700`,remote:`bg-purple-50 text-purple-700`,generated:`bg-green-50 text-green-700`,official:`bg-amber-50 text-amber-700`,user:`bg-pink-50 text-pink-700`},$9={local:`本地`,remote:`远程`,generated:`AI生成`,official:`官方`,user:`用户`};function Aue(){let[e,t]=(0,z.useState)(`list`),[n,r]=(0,z.useState)(``),[i,a]=(0,z.useState)(``),[o,s]=(0,z.useState)(new Set),[c,l]=(0,z.useState)(``),[u,d]=(0,z.useState)(null),[f,p]=(0,z.useState)(!1),[m,h]=(0,z.useState)(null),[g,_]=(0,z.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),v=qe(),{data:y,isLoading:b}=ct({queryKey:[`skills`,n,i],queryFn:()=>tu({source:n||void 0,tag:i||void 0}).then(e=>e.data),refetchInterval:3e4}),{data:x}=ct({queryKey:[`skills-status`],queryFn:()=>nu().then(e=>e.data),refetchInterval:3e4}),S=lt({mutationFn:e=>iu(e).then(e=>e.data),onSuccess:e=>{d(e),Yc(`找到 ${e.github.length+e.npm.length} 个结果`,`success`)}}),C=lt({mutationFn:e=>au(e).then(e=>e.data),onSuccess:e=>{Yc(`已安装: ${e.skill.name}`,`success`),v.invalidateQueries({queryKey:[`skills`]}),v.invalidateQueries({queryKey:[`skills-status`]})}}),w=lt({mutationFn:e=>ou(e).then(e=>e.data),onSuccess:(e,t)=>{Yc(`已删除: ${t}`,`success`),s(e=>{let n=new Set(e);return n.delete(t),n}),v.invalidateQueries({queryKey:[`skills`]}),v.invalidateQueries({queryKey:[`skills-status`]})}}),T=lt({mutationFn:e=>su(e).then(e=>e.data),onSuccess:e=>{Yc(`已删除 ${e.success.length} 个技能`,`success`),s(new Set),v.invalidateQueries({queryKey:[`skills`]}),v.invalidateQueries({queryKey:[`skills-status`]})}}),E=lt({mutationFn:()=>cu().then(e=>e.data),onSuccess:e=>{Yc(`进化完成:${e.repaired.length+e.retired.length+e.optimized.length+e.generated.length} 项变更`,`success`),v.invalidateQueries({queryKey:[`skills`]}),v.invalidateQueries({queryKey:[`skills-status`]})}}),D=lt({mutationFn:()=>lu().then(e=>e.data),onSuccess:e=>{Yc(`蒸馏完成:新增 ${e.distilled.length} 个技能`,`success`),v.invalidateQueries({queryKey:[`skills`]}),v.invalidateQueries({queryKey:[`skills-status`]})}}),O=lt({mutationFn:()=>uu().then(e=>e.data),onSuccess:e=>{Yc(`修复完成:${e.repaired.length} 个技能已修复`,`success`),v.invalidateQueries({queryKey:[`skills`]})}}),k=y?.items||[],A=k.length>0&&o.size===k.length,j=e=>{s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`技能管理`}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:`管理 Claude Code 技能库,搜索安装、进化优化`})]}),x&&(0,B.jsx)(`div`,{className:`flex items-center gap-3`,children:[{label:`全部`,value:x.total,color:`text-gray-700`},{label:`官方`,value:x.official,color:`text-amber-600`},{label:`本地`,value:x.local,color:`text-blue-600`},{label:`AI生成`,value:x.generated,color:`text-green-600`}].map(({label:e,value:t,color:n})=>(0,B.jsxs)(`div`,{className:`text-center`,children:[(0,B.jsx)(`div`,{className:q(`text-xl font-bold`,n),children:t}),(0,B.jsx)(`div`,{className:`text-xs text-gray-500`,children:e})]},e))})]}),(0,B.jsx)(`div`,{className:`border-b border-gray-200`,children:(0,B.jsx)(`nav`,{className:`flex gap-1`,children:[{key:`list`,label:`技能列表`},{key:`search`,label:`搜索安装`},{key:`evolve`,label:`进化管理`},{key:`sources`,label:`技能源`}].map(n=>(0,B.jsx)(`button`,{onClick:()=>t(n.key),className:q(`px-4 py-2.5 text-sm font-medium border-b-2 transition-colors`,e===n.key?`border-blue-600 text-blue-600`:`border-transparent text-gray-500 hover:text-gray-700`),children:n.label},n.key))})}),e===`list`&&(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsxs)(`button`,{onClick:()=>p(!f),className:q(`flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg transition-colors`,f?`bg-blue-50 text-blue-600`:`text-gray-600 hover:bg-gray-50`),children:[(0,B.jsx)(oc,{className:`h-4 w-4`}),`筛选`,(0,B.jsx)(Rs,{className:q(`h-3.5 w-3.5 transition-transform`,f&&`rotate-180`)})]}),(0,B.jsxs)(`span`,{className:`text-sm text-gray-500`,children:[k.length,` 个技能`]}),o.size>0&&(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,B.jsxs)(`span`,{className:`text-sm text-gray-600`,children:[`已选 `,o.size,` 个`]}),(0,B.jsxs)(`button`,{onClick:()=>{_({open:!0,title:`批量删除技能`,description:`确定要删除选中的 ${o.size} 个技能吗?此操作不可恢复。`,onConfirm:()=>{T.mutate(Array.from(o)),_(e=>({...e,open:!1}))}})},disabled:T.isPending,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-red-50 text-red-600 hover:bg-red-100 rounded-lg transition-colors`,children:[(0,B.jsx)(Lc,{className:`h-3.5 w-3.5`}),`批量删除`]})]})]}),f&&(0,B.jsxs)(`div`,{className:`flex gap-3 mt-3 pt-3 border-t border-gray-100`,children:[(0,B.jsxs)(`select`,{value:n,onChange:e=>r(e.target.value),className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,B.jsx)(`option`,{value:``,children:`全部来源`}),(0,B.jsx)(`option`,{value:`local`,children:`本地`}),(0,B.jsx)(`option`,{value:`official`,children:`官方`}),(0,B.jsx)(`option`,{value:`remote`,children:`远程`}),(0,B.jsx)(`option`,{value:`generated`,children:`AI生成`}),(0,B.jsx)(`option`,{value:`user`,children:`用户`})]}),(0,B.jsx)(`input`,{type:`text`,placeholder:`按标签筛选...`,value:i,onChange:e=>a(e.target.value),className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]})]}),b?(0,B.jsx)(`div`,{className:`flex items-center justify-center h-48`,children:(0,B.jsx)(pc,{className:`h-8 w-8 animate-spin text-blue-500`})}):(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 overflow-hidden`,children:[(0,B.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,B.jsx)(`thead`,{className:`bg-gray-50 border-b border-gray-200`,children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{className:`w-10 px-4 py-3`,children:(0,B.jsx)(`input`,{type:`checkbox`,checked:A,onChange:()=>{s(A?new Set:new Set(k.map(e=>e.name)))},className:`rounded`})}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`技能名称`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`来源`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`版本`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`调用次数`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`成功率`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`最近使用`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`操作`})]})}),(0,B.jsx)(`tbody`,{className:`divide-y divide-gray-100`,children:k.map(e=>(0,B.jsxs)(`tr`,{className:`hover:bg-gray-50 transition-colors`,children:[(0,B.jsx)(`td`,{className:`px-4 py-3`,children:(0,B.jsx)(`input`,{type:`checkbox`,checked:o.has(e.name),onChange:()=>j(e.name),className:`rounded`})}),(0,B.jsxs)(`td`,{className:`px-4 py-3`,children:[(0,B.jsx)(`button`,{onClick:()=>h(e.name),className:`font-medium text-blue-600 hover:text-blue-700 cursor-pointer`,children:e.name}),(0,B.jsx)(`div`,{className:`text-xs text-gray-500 truncate max-w-xs`,children:e.description}),e.tags&&e.tags.length>0&&(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1`,children:e.tags.map(e=>(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 px-1.5 py-0.5 bg-gray-100 text-gray-600 text-xs rounded`,children:[(0,B.jsx)(Pc,{className:`h-2.5 w-2.5`}),e]},e))})]}),(0,B.jsx)(`td`,{className:`px-4 py-3`,children:(0,B.jsx)(`span`,{className:q(`px-2 py-0.5 text-xs rounded-full font-medium`,Q9[e.source]||`bg-gray-100 text-gray-600`),children:$9[e.source]||e.source})}),(0,B.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.version}),(0,B.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.stats.callCount}),(0,B.jsx)(`td`,{className:`px-4 py-3`,children:e.stats.callCount>0?(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(`div`,{className:`w-16 h-1.5 bg-gray-200 rounded-full overflow-hidden`,children:(0,B.jsx)(`div`,{className:q(`h-full rounded-full`,e.stats.successRate>=.8?`bg-green-500`:e.stats.successRate>=.5?`bg-yellow-500`:`bg-red-500`),style:{width:`${e.stats.successRate*100}%`}})}),(0,B.jsxs)(`span`,{className:`text-xs text-gray-600`,children:[(e.stats.successRate*100).toFixed(0),`%`]})]}):(0,B.jsx)(`span`,{className:`text-xs text-gray-400`,children:`未使用`})}),(0,B.jsx)(`td`,{className:`px-4 py-3 text-xs text-gray-500`,children:e.stats.lastUsed?new Date(e.stats.lastUsed).toLocaleDateString(`zh-CN`):`—`}),(0,B.jsx)(`td`,{className:`px-4 py-3`,children:(0,B.jsx)(`button`,{onClick:()=>{_({open:!0,title:`删除技能`,description:`确定要删除技能 "${e.name}" 吗?此操作不可恢复。`,onConfirm:()=>{w.mutate(e.name),_(e=>({...e,open:!1}))}})},disabled:w.isPending,className:`p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors`,title:`删除`,children:(0,B.jsx)(Lc,{className:`h-4 w-4`})})})]},e.name))})]}),k.length===0&&(0,B.jsxs)(`div`,{className:`text-center py-12`,children:[(0,B.jsx)(_c,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,B.jsx)(`p`,{className:`text-gray-500`,children:`暂无技能`})]})]}),x&&(x.topUsed.length>0||x.topRated.length>0)&&(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[x.topUsed.length>0&&(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,B.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3 flex items-center gap-2`,children:[(0,B.jsx)(Rc,{className:`h-4 w-4 text-blue-500`}),`最常用技能`]}),(0,B.jsx)(`div`,{className:`space-y-2`,children:x.topUsed.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`text-xs text-gray-400 w-4`,children:t+1}),(0,B.jsx)(`span`,{className:`text-gray-700`,children:e.name})]}),(0,B.jsxs)(`span`,{className:`text-gray-500`,children:[e.calls,` 次`]})]},e.name))})]}),x.topRated.length>0&&(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,B.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3 flex items-center gap-2`,children:[(0,B.jsx)(Ws,{className:`h-4 w-4 text-green-500`}),`评分最高技能`]}),(0,B.jsx)(`div`,{className:`space-y-2`,children:x.topRated.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`text-xs text-gray-400 w-4`,children:t+1}),(0,B.jsx)(`span`,{className:`text-gray-700`,children:e.name})]}),(0,B.jsxs)(`span`,{className:`text-gray-500`,children:[(e.rating*100).toFixed(0),`%`]})]},e.name))})]})]})]}),e===`search`&&(0,B.jsx)(Mue,{searchQuery:c,setSearchQuery:l,searchResults:u,onSearch:()=>S.mutate(c),onInstall:e=>C.mutate(e),isSearching:S.isPending,isInstalling:C.isPending}),e===`evolve`&&(0,B.jsx)(Nue,{onEvolve:()=>E.mutate(),onDistill:()=>D.mutate(),onRepair:()=>O.mutate(),isEvolving:E.isPending,isDistilling:D.isPending,isRepairing:O.isPending,evolveResult:E.data,distillResult:D.data,repairResult:O.data}),e===`sources`&&(0,B.jsx)(Pue,{}),m&&(0,B.jsx)(jue,{name:m,onClose:()=>h(null)}),(0,B.jsx)(E4,{open:g.open,title:g.title,description:g.description,onConfirm:g.onConfirm,onCancel:()=>_(e=>({...e,open:!1}))})]})}function jue({name:e,onClose:t}){let[n,r]=(0,z.useState)(`content`),{data:i,isLoading:a}=ct({queryKey:[`skill-detail`,e],queryFn:()=>ru(e).then(e=>e.data)});return(0,B.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/40`,onClick:t,children:(0,B.jsxs)(`div`,{className:`bg-white rounded-2xl shadow-2xl w-full max-w-3xl max-h-[85vh] flex flex-col`,onClick:e=>e.stopPropagation(),children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between px-6 py-4 border-b border-gray-100`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(_c,{className:`h-5 w-5 text-blue-500`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-lg font-semibold text-gray-900`,children:e}),i&&(0,B.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:i.description})]})]}),(0,B.jsx)(`button`,{onClick:t,className:`p-1.5 text-gray-400 hover:text-gray-600 rounded-lg transition-colors`,children:(0,B.jsx)(Uc,{className:`h-5 w-5`})})]}),(0,B.jsx)(`div`,{className:`flex gap-1 px-6 pt-3 border-b border-gray-100`,children:[`content`,`stats`].map(e=>(0,B.jsx)(`button`,{onClick:()=>r(e),className:`px-3 py-1.5 text-sm font-medium border-b-2 transition-colors ${n===e?`border-blue-600 text-blue-600`:`border-transparent text-gray-500 hover:text-gray-700`}`,children:e===`content`?`技能内容`:`使用情况`},e))}),(0,B.jsx)(`div`,{className:`flex-1 overflow-y-auto px-6 py-5`,children:a?(0,B.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,B.jsx)(pc,{className:`h-6 w-6 animate-spin text-blue-500`})}):i?n===`content`?(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[(0,B.jsx)(`span`,{className:`px-2 py-0.5 text-xs rounded-full font-medium ${Q9[i.source]||`bg-gray-100 text-gray-600`}`,children:$9[i.source]||i.source}),(0,B.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`v`,i.version]}),i.requires?.bins&&i.requires.bins.length>0&&(0,B.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`需要:`,i.requires.bins.join(`, `)]}),i.filePath&&(0,B.jsx)(`span`,{className:`text-xs text-gray-400 font-mono truncate max-w-xs`,children:i.filePath})]}),i.tags&&i.tags.length>0&&(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.tags.map(e=>(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 bg-blue-50 text-blue-700 text-xs rounded-full`,children:[(0,B.jsx)(Pc,{className:`h-2.5 w-2.5`}),e]},e))}),i.content?(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`text-xs text-gray-500 mb-2 flex items-center gap-1`,children:[(0,B.jsx)(ic,{className:`h-3.5 w-3.5`}),`技能文件内容`]}),(0,B.jsx)(`pre`,{className:`text-xs text-gray-800 bg-gray-50 rounded-lg p-4 overflow-auto whitespace-pre-wrap border border-gray-200 max-h-[50vh] leading-relaxed`,children:i.content})]}):(0,B.jsx)(`div`,{className:`text-center py-8 text-gray-400 text-sm`,children:`暂无文件内容`}),i.sourceUrl&&(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm`,children:[(0,B.jsx)($s,{className:`h-3.5 w-3.5 text-gray-400`}),(0,B.jsx)(`a`,{href:i.sourceUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-600 hover:underline truncate`,children:i.sourceUrl})]})]}):(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsxs)(`div`,{className:`grid grid-cols-3 gap-4`,children:[(0,B.jsxs)(`div`,{className:`bg-blue-50 rounded-xl p-4 text-center`,children:[(0,B.jsx)(`div`,{className:`text-2xl font-bold text-blue-700`,children:i.stats.callCount}),(0,B.jsx)(`div`,{className:`text-xs text-blue-600 mt-1`,children:`总调用次数`})]}),(0,B.jsxs)(`div`,{className:`bg-green-50 rounded-xl p-4 text-center`,children:[(0,B.jsx)(`div`,{className:`text-2xl font-bold text-green-700`,children:i.stats.callCount>0?`${(i.stats.successRate*100).toFixed(0)}%`:`—`}),(0,B.jsx)(`div`,{className:`text-xs text-green-600 mt-1`,children:`成功率`})]}),(0,B.jsxs)(`div`,{className:`bg-purple-50 rounded-xl p-4 text-center`,children:[(0,B.jsx)(`div`,{className:`text-2xl font-bold text-purple-700`,children:i.stats.userFeedback.positive+i.stats.userFeedback.negative>0?`${i.stats.userFeedback.positive} / ${i.stats.userFeedback.negative}`:`—`}),(0,B.jsx)(`div`,{className:`text-xs text-purple-600 mt-1`,children:`用户反馈(正向/负向)`})]})]}),i.stats.callCount>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`flex justify-between text-xs text-gray-500 mb-1.5`,children:[(0,B.jsx)(`span`,{children:`成功率`}),(0,B.jsxs)(`span`,{children:[(i.stats.successRate*100).toFixed(1),`%`]})]}),(0,B.jsx)(`div`,{className:`w-full h-2 bg-gray-200 rounded-full overflow-hidden`,children:(0,B.jsx)(`div`,{className:`h-full rounded-full transition-all ${i.stats.successRate>=.8?`bg-green-500`:i.stats.successRate>=.5?`bg-yellow-500`:`bg-red-500`}`,style:{width:`${i.stats.successRate*100}%`}})})]}),(0,B.jsxs)(`div`,{className:`bg-gray-50 rounded-xl p-4`,children:[(0,B.jsx)(`div`,{className:`text-xs text-gray-500 mb-1`,children:`最近使用时间`}),(0,B.jsx)(`div`,{className:`text-sm font-medium text-gray-900`,children:i.stats.lastUsed?new Date(i.stats.lastUsed).toLocaleString(`zh-CN`):`从未使用`})]}),i.stats.callCount===0&&(0,B.jsx)(`div`,{className:`text-center py-8 text-gray-400 text-sm`,children:`该技能尚未被调用过`})]}):(0,B.jsx)(`div`,{className:`text-center py-16 text-gray-500`,children:`技能不存在`})})]})})}function Mue({searchQuery:e,setSearchQuery:t,searchResults:n,onSearch:r,onInstall:i,isSearching:a,isInstalling:o}){return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:(0,B.jsxs)(`div`,{className:`flex gap-3`,children:[(0,B.jsx)(`input`,{type:`text`,placeholder:`搜索技能(GitHub / npm)...`,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>e.key===`Enter`&&r(),className:`flex-1 px-4 py-2.5 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,B.jsxs)(`button`,{onClick:r,disabled:a||!e.trim(),className:`flex items-center gap-2 px-6 py-2.5 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,children:[a?(0,B.jsx)(pc,{className:`h-4 w-4 animate-spin`}):(0,B.jsx)(Ec,{className:`h-4 w-4`}),`搜索`]})]})}),n&&(0,B.jsxs)(`div`,{className:`space-y-6`,children:[n.github.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3`,children:[`GitHub 结果 (`,n.github.length,`)`]}),(0,B.jsx)(`div`,{className:`grid gap-3`,children:n.github.map((e,t)=>(0,B.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4 hover:border-blue-300 transition-colors`,children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,B.jsx)(`h4`,{className:`font-semibold text-gray-900`,children:e.skill.name}),(0,B.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`v`,e.skill.version]})]}),(0,B.jsx)(`p`,{className:`text-sm text-gray-600 mb-2`,children:e.skill.description}),(0,B.jsxs)(`a`,{href:e.sourceUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-xs text-blue-600 hover:underline`,children:[(0,B.jsx)($s,{className:`h-3 w-3`}),e.sourceUrl]})]}),(0,B.jsxs)(`button`,{onClick:()=>i(e.sourceUrl),disabled:o,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-blue-50 text-blue-600 hover:bg-blue-100 rounded-lg transition-colors`,children:[(0,B.jsx)(Qs,{className:`h-3.5 w-3.5`}),`安装`]})]})},t))})]}),n.npm.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3`,children:[`npm 结果 (`,n.npm.length,`)`]}),(0,B.jsx)(`div`,{className:`grid gap-3`,children:n.npm.map((e,t)=>(0,B.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4 hover:border-purple-300 transition-colors`,children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,B.jsx)(`h4`,{className:`font-semibold text-gray-900`,children:e.skill.name}),(0,B.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`v`,e.skill.version]})]}),(0,B.jsx)(`p`,{className:`text-sm text-gray-600 mb-2`,children:e.skill.description}),e.installCommand&&(0,B.jsx)(`code`,{className:`text-xs bg-gray-100 px-2 py-1 rounded`,children:e.installCommand})]}),(0,B.jsxs)(`button`,{onClick:()=>i(e.sourceUrl),disabled:o,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-purple-50 text-purple-600 hover:bg-purple-100 rounded-lg transition-colors`,children:[(0,B.jsx)(Qs,{className:`h-3.5 w-3.5`}),`安装`]})]})},t))})]}),n.github.length===0&&n.npm.length===0&&(0,B.jsxs)(`div`,{className:`text-center py-12 bg-white rounded-xl border border-gray-200`,children:[(0,B.jsx)(Ec,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,B.jsx)(`p`,{className:`text-gray-500`,children:`未找到匹配的技能`})]})]})]})}function Nue({onEvolve:e,onDistill:t,onRepair:n,isEvolving:r,isDistilling:i,isRepairing:a,evolveResult:o,distillResult:s,repairResult:c}){return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`grid grid-cols-3 gap-4`,children:[(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,B.jsx)(`div`,{className:`p-2 bg-blue-50 rounded-lg`,children:(0,B.jsx)(Ac,{className:`h-5 w-5 text-blue-600`})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`技能进化`}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500`,children:`淘汰、优化、生成`})]})]}),(0,B.jsxs)(`button`,{onClick:e,disabled:r,className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:[r?(0,B.jsx)(pc,{className:`h-4 w-4 animate-spin`}):(0,B.jsx)(Cc,{className:`h-4 w-4`}),r?`进化中...`:`开始进化`]}),o&&(0,B.jsxs)(`div`,{className:`mt-4 space-y-2 text-sm`,children:[o.repaired?.length>0&&(0,B.jsxs)(`div`,{className:`text-green-600`,children:[`✔ 修复 `,o.repaired.length,` 个`]}),o.retired?.length>0&&(0,B.jsxs)(`div`,{className:`text-red-600`,children:[`- 淘汰 `,o.retired.length,` 个`]}),o.optimized?.length>0&&(0,B.jsxs)(`div`,{className:`text-blue-600`,children:[`↑ 优化 `,o.optimized.length,` 个`]}),o.generated?.length>0&&(0,B.jsxs)(`div`,{className:`text-green-600`,children:[`+ 生成 `,o.generated.length,` 个`]})]})]}),(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,B.jsx)(`div`,{className:`p-2 bg-purple-50 rounded-lg`,children:(0,B.jsx)(Qs,{className:`h-5 w-5 text-purple-600`})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`社区蒸馏`}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500`,children:`从精选源采集`})]})]}),(0,B.jsxs)(`button`,{onClick:t,disabled:i,className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-purple-600 text-white rounded-lg hover:bg-purple-700 disabled:opacity-50 transition-colors`,children:[i?(0,B.jsx)(pc,{className:`h-4 w-4 animate-spin`}):(0,B.jsx)(Qs,{className:`h-4 w-4`}),i?`蒸馏中...`:`开始蒸馏`]}),s&&s.distilled?.length>0&&(0,B.jsxs)(`div`,{className:`mt-4 text-sm text-purple-600`,children:[`✦ 新增 `,s.distilled.length,` 个技能`]})]}),(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,B.jsx)(`div`,{className:`p-2 bg-amber-50 rounded-lg`,children:(0,B.jsx)(Hc,{className:`h-5 w-5 text-amber-600`})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`修复残缺`}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500`,children:`AI 修复低质量技能`})]})]}),(0,B.jsxs)(`button`,{onClick:n,disabled:a,className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-amber-600 text-white rounded-lg hover:bg-amber-700 disabled:opacity-50 transition-colors`,children:[a?(0,B.jsx)(pc,{className:`h-4 w-4 animate-spin`}):(0,B.jsx)(Hc,{className:`h-4 w-4`}),a?`修复中...`:`开始修复`]}),c&&c.repaired?.length>0&&(0,B.jsxs)(`div`,{className:`mt-4 text-sm text-amber-600`,children:[`✔ 修复 `,c.repaired.length,` 个技能`]})]})]}),(0,B.jsxs)(`div`,{className:`bg-blue-50 rounded-xl border border-blue-200 p-4`,children:[(0,B.jsx)(`h4`,{className:`text-sm font-semibold text-blue-900 mb-2`,children:`进化机制说明`}),(0,B.jsxs)(`ul`,{className:`text-sm text-blue-700 space-y-1`,children:[(0,B.jsxs)(`li`,{children:[`• `,(0,B.jsx)(`strong`,{children:`技能进化`}),`:根据使用统计自动淘汰低效技能、优化高频技能、生成新技能`]}),(0,B.jsxs)(`li`,{children:[`• `,(0,B.jsx)(`strong`,{children:`社区蒸馏`}),`:从 GitHub 精选仓库采集优质技能并蒸馏为官方技能`]}),(0,B.jsxs)(`li`,{children:[`• `,(0,B.jsx)(`strong`,{children:`修复残缺`}),`:检测并修复缺少描述、版本号或格式错误的技能文件`]})]})]})]})}function Pue(){let e=qe(),[t,n]=(0,z.useState)(!1),[r,i]=(0,z.useState)({repo:``,dir:``,branch:`main`,format:`command-md`,description:``}),{data:a}=ct({queryKey:[`skill-sources`],queryFn:()=>W.get(`/skills/sources`).then(e=>e.data)}),o=lt({mutationFn:e=>W.post(`/skills/sources`,e).then(e=>e.data),onSuccess:()=>{Yc(`技能源已添加`,`success`),n(!1),i({repo:``,dir:``,branch:`main`,format:`command-md`,description:``}),e.invalidateQueries({queryKey:[`skill-sources`]})}}),s=lt({mutationFn:e=>W.delete(`/skills/sources/${encodeURIComponent(e)}`).then(e=>e.data),onSuccess:()=>{Yc(`技能源已删除`,`success`),e.invalidateQueries({queryKey:[`skill-sources`]})}}),c=a?.builtIn||[],l=a?.user||[];return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(`div`,{className:`flex justify-end`,children:(0,B.jsxs)(`button`,{onClick:()=>n(!t),className:`flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors`,children:[(0,B.jsx)(Qs,{className:`h-4 w-4`}),`添加技能源`]})}),t&&(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:[(0,B.jsx)(`h3`,{className:`font-semibold text-gray-900 mb-4`,children:`添加自定义技能源`}),(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,B.jsx)(`input`,{type:`text`,placeholder:`仓库 (owner/repo)`,value:r.repo,onChange:e=>i({...r,repo:e.target.value}),className:`px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,B.jsx)(`input`,{type:`text`,placeholder:`目录路径`,value:r.dir,onChange:e=>i({...r,dir:e.target.value}),className:`px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,B.jsx)(`input`,{type:`text`,placeholder:`分支 (默认 main)`,value:r.branch,onChange:e=>i({...r,branch:e.target.value}),className:`px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,B.jsxs)(`select`,{value:r.format,onChange:e=>i({...r,format:e.target.value}),className:`px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,B.jsx)(`option`,{value:`command-md`,children:`command-md`}),(0,B.jsx)(`option`,{value:`skill-md`,children:`skill-md`})]}),(0,B.jsx)(`input`,{type:`text`,placeholder:`描述`,value:r.description,onChange:e=>i({...r,description:e.target.value}),className:`col-span-2 px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,B.jsxs)(`div`,{className:`flex gap-2 mt-4`,children:[(0,B.jsx)(`button`,{onClick:()=>o.mutate(r),disabled:!r.repo||!r.dir||o.isPending,className:`px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:o.isPending?`添加中...`:`确认添加`}),(0,B.jsx)(`button`,{onClick:()=>n(!1),className:`px-4 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors`,children:`取消`})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3`,children:`内置技能源`}),(0,B.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 divide-y divide-gray-100`,children:c.map((e,t)=>(0,B.jsxs)(`div`,{className:`p-4 flex items-center justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`font-medium text-gray-900`,children:[e.repo,`/`,e.dir]}),(0,B.jsx)(`div`,{className:`text-sm text-gray-500`,children:e.description})]}),(0,B.jsx)(`span`,{className:`px-2 py-1 bg-gray-100 text-gray-600 text-xs rounded`,children:`内置`})]},t))})]}),l.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3`,children:`用户自定义源`}),(0,B.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 divide-y divide-gray-100`,children:l.map((e,t)=>(0,B.jsxs)(`div`,{className:`p-4 flex items-center justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`font-medium text-gray-900`,children:[e.repo,`/`,e.dir]}),(0,B.jsx)(`div`,{className:`text-sm text-gray-500`,children:e.description})]}),(0,B.jsx)(`button`,{onClick:()=>s.mutate(e.repo),disabled:s.isPending,className:`p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors`,children:(0,B.jsx)(Lc,{className:`h-4 w-4`})})]},t))})]})]})}function Fue(){let[e,t]=(0,z.useState)(`library`),[n,r]=(0,z.useState)(`all`),[i,a]=(0,z.useState)(``),[o,s]=(0,z.useState)(new Set),[c,l]=(0,z.useState)(null),[u,d]=(0,z.useState)(``),[f,p]=(0,z.useState)(!1),[m,h]=(0,z.useState)(null),g=qe(),{data:_,isLoading:v}=ct({queryKey:[`global-conventions`],queryFn:()=>du().then(e=>e.data),refetchInterval:6e4}),{data:y}=ct({queryKey:[`convention-usage-stats`],queryFn:()=>gu().then(e=>e.data),enabled:e===`usage`}),b=lt({mutationFn:()=>pu().then(e=>e.data),onSuccess:e=>{Yc(e.added.length+e.updated.length>0?`同步完成:新增 ${e.added.length},更新 ${e.updated.length}`:`已是最新`,`success`),g.invalidateQueries({queryKey:[`global-conventions`]})}}),x=lt({mutationFn:e=>mu(e).then(e=>e.data),onSuccess:e=>{Yc(`已安装:${e.convention.name}`,`success`),d(``),p(!1),g.invalidateQueries({queryKey:[`global-conventions`]})}}),S=lt({mutationFn:e=>hu(e).then(e=>e.data),onSuccess:(e,t)=>{Yc(`规范已删除`,`success`),h(null),g.invalidateQueries({queryKey:[`global-conventions`]})}}),C=lt({mutationFn:e=>vu(e.length>0?e:void 0).then(e=>e.data),onSuccess:e=>{Yc(`进化完成:${e.results.success.length} 个规范已更新`,`success`),g.invalidateQueries({queryKey:[`global-conventions`]})}}),w=(_?.items||[]).filter(e=>!(n!==`all`&&e.source!==n||i&&!e.name.toLowerCase().includes(i.toLowerCase()))),T=e=>{s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},E=w.length>0&&o.size===w.length,D=()=>s(E?new Set:new Set(w.map(e=>e.id))),O={official:`bg-amber-50 text-amber-700`,user:`bg-blue-50 text-blue-700`,community:`bg-purple-50 text-purple-700`},k={official:`官方`,user:`用户`,community:`社区`};return(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`规范管理`}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:`管理全局规范模板,绑定到项目,追踪使用情况`})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsxs)(`button`,{onClick:()=>b.mutate(),disabled:b.isPending,className:`flex items-center gap-1.5 px-3 py-2 text-sm bg-amber-50 text-amber-700 hover:bg-amber-100 rounded-lg transition-colors`,children:[(0,B.jsx)(Cc,{className:`h-4 w-4 ${b.isPending?`animate-spin`:``}`}),`同步官方规范`]}),(0,B.jsxs)(`button`,{onClick:()=>p(!f),className:`flex items-center gap-1.5 px-3 py-2 text-sm bg-blue-600 text-white hover:bg-blue-700 rounded-lg transition-colors`,children:[(0,B.jsx)(Qs,{className:`h-4 w-4`}),`从 URL 安装`]})]})]}),f&&(0,B.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:(0,B.jsxs)(`div`,{className:`flex gap-3`,children:[(0,B.jsx)(`input`,{type:`text`,placeholder:`规范 YAML 文件 URL...`,value:u,onChange:e=>d(e.target.value),onKeyDown:e=>e.key===`Enter`&&u.trim()&&x.mutate(u.trim()),className:`flex-1 px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,B.jsx)(`button`,{onClick:()=>x.mutate(u.trim()),disabled:!u.trim()||x.isPending,className:`px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:x.isPending?`安装中...`:`安装`}),(0,B.jsx)(`button`,{onClick:()=>p(!1),className:`p-2 text-gray-400 hover:text-gray-600 rounded-lg`,children:(0,B.jsx)(Uc,{className:`h-4 w-4`})})]})}),(0,B.jsx)(`div`,{className:`border-b border-gray-200`,children:(0,B.jsx)(`nav`,{className:`flex gap-1`,children:[{key:`library`,label:`规范库`},{key:`usage`,label:`使用统计`},{key:`evolution`,label:`进化历史`}].map(n=>(0,B.jsx)(`button`,{onClick:()=>t(n.key),className:`px-4 py-2.5 text-sm font-medium border-b-2 transition-colors ${e===n.key?`border-blue-600 text-blue-600`:`border-transparent text-gray-500 hover:text-gray-700`}`,children:n.label},n.key))})}),e===`library`&&(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4 flex items-center gap-3 flex-wrap`,children:[(0,B.jsx)(`div`,{className:`flex gap-1`,children:[`all`,`official`,`user`,`community`].map(e=>(0,B.jsx)(`button`,{onClick:()=>r(e),className:`px-3 py-1.5 text-xs rounded-lg transition-colors ${n===e?`bg-blue-600 text-white`:`bg-gray-100 text-gray-600 hover:bg-gray-200`}`,children:{all:`全部`,official:`官方`,user:`用户`,community:`社区`}[e]},e))}),(0,B.jsxs)(`div`,{className:`relative`,children:[(0,B.jsx)(Ec,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-gray-400`}),(0,B.jsx)(`input`,{type:`text`,placeholder:`搜索规范名称...`,value:i,onChange:e=>a(e.target.value),className:`pl-8 pr-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 w-48`})]}),(0,B.jsxs)(`span`,{className:`text-sm text-gray-500`,children:[w.length,` 个规范`]}),o.size>0&&(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,B.jsxs)(`span`,{className:`text-sm text-gray-600`,children:[`已选 `,o.size,` 个`]}),(0,B.jsxs)(`button`,{onClick:()=>C.mutate(Array.from(o)),disabled:C.isPending,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-green-50 text-green-600 hover:bg-green-100 rounded-lg transition-colors`,children:[(0,B.jsx)(Cc,{className:`h-3.5 w-3.5 ${C.isPending?`animate-spin`:``}`}),`批量进化`]})]})]}),v?(0,B.jsx)(`div`,{className:`flex items-center justify-center h-48 bg-white rounded-xl border border-gray-200`,children:(0,B.jsx)(Cc,{className:`h-8 w-8 animate-spin text-blue-500`})}):(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 overflow-hidden`,children:[(0,B.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,B.jsx)(`thead`,{className:`bg-gray-50 border-b border-gray-200`,children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{className:`w-10 px-4 py-3`,children:(0,B.jsx)(`input`,{type:`checkbox`,checked:E,onChange:D,className:`rounded`})}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`规范名称`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`来源`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`版本`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`角色数`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`质量标准`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`操作`})]})}),(0,B.jsx)(`tbody`,{className:`divide-y divide-gray-100`,children:w.map(e=>(0,B.jsxs)(`tr`,{className:`hover:bg-gray-50 transition-colors`,children:[(0,B.jsx)(`td`,{className:`px-4 py-3`,children:(0,B.jsx)(`input`,{type:`checkbox`,checked:o.has(e.id),onChange:()=>T(e.id),className:`rounded`})}),(0,B.jsxs)(`td`,{className:`px-4 py-3`,children:[(0,B.jsx)(`button`,{onClick:()=>l(e.id),className:`font-medium text-blue-600 hover:text-blue-700 text-left`,children:e.name}),(0,B.jsx)(`div`,{className:`text-xs text-gray-500 truncate max-w-xs mt-0.5`,children:e.description})]}),(0,B.jsx)(`td`,{className:`px-4 py-3`,children:(0,B.jsx)(`span`,{className:`px-2 py-0.5 text-xs rounded-full font-medium ${O[e.source]||`bg-gray-100 text-gray-600`}`,children:k[e.source]||e.source})}),(0,B.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.version||`—`}),(0,B.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.roles?Object.keys(e.roles).length:0}),(0,B.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.quality_standards?.length||0}),(0,B.jsx)(`td`,{className:`px-4 py-3`,children:(0,B.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(`button`,{onClick:()=>l(e.id),className:`p-1.5 text-gray-400 hover:text-blue-500 rounded transition-colors`,title:`查看/编辑`,children:(0,B.jsx)(ic,{className:`h-4 w-4`})}),e.source!==`official`&&(0,B.jsx)(`button`,{onClick:()=>h(e),className:`p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors`,title:`删除`,children:(0,B.jsx)(Lc,{className:`h-4 w-4`})})]})})]},e.id))})]}),w.length===0&&(0,B.jsxs)(`div`,{className:`text-center py-12`,children:[(0,B.jsx)(As,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,B.jsx)(`p`,{className:`text-gray-500`,children:`暂无规范`}),(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:`点击「同步官方规范」获取内置规范`})]})]})]}),e===`usage`&&(0,B.jsx)(Iue,{data:y?.items||[]}),e===`evolution`&&(0,B.jsx)(Lue,{conventions:_?.items||[]}),c&&(0,B.jsx)(Rue,{id:c,onClose:()=>l(null)}),m&&(0,B.jsx)(E4,{title:`删除规范`,message:`确定要删除规范「${m.name}」吗?此操作不可撤销。`,onConfirm:()=>S.mutate(m.id),onCancel:()=>h(null)})]})}function Iue({data:e}){let[t,n]=(0,z.useState)(null);return(0,B.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 overflow-hidden`,children:e.length===0?(0,B.jsxs)(`div`,{className:`text-center py-12`,children:[(0,B.jsx)(Rc,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,B.jsx)(`p`,{className:`text-gray-500`,children:`暂无使用数据`})]}):(0,B.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,B.jsx)(`thead`,{className:`bg-gray-50 border-b border-gray-200`,children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`规范名称`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`来源`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`使用项目数`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`操作`})]})}),(0,B.jsx)(`tbody`,{className:`divide-y divide-gray-100`,children:e.map(e=>(0,B.jsxs)(z.Fragment,{children:[(0,B.jsxs)(`tr`,{className:`hover:bg-gray-50 transition-colors`,children:[(0,B.jsx)(`td`,{className:`px-4 py-3 font-medium text-gray-900`,children:e.name}),(0,B.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.source}),(0,B.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.projectCount}),(0,B.jsx)(`td`,{className:`px-4 py-3`,children:(0,B.jsx)(`button`,{onClick:()=>n(t===e.id?null:e.id),className:`text-xs text-blue-600 hover:text-blue-700`,children:t===e.id?`收起`:`查看项目`})})]}),t===e.id&&(0,B.jsx)(`tr`,{children:(0,B.jsx)(`td`,{colSpan:4,className:`px-4 py-3 bg-gray-50`,children:(0,B.jsx)(`div`,{className:`text-xs text-gray-600 space-y-1`,children:e.projects.map((e,t)=>(0,B.jsx)(`div`,{className:`font-mono`,children:e},t))})})})]},e.id))})]})})}function Lue({conventions:e}){let[t,n]=(0,z.useState)(null),{data:r,isLoading:i}=ct({queryKey:[`convention-evolution`,t],queryFn:()=>t?_u(t).then(e=>e.data):null,enabled:!!t});return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-2`,children:`选择规范`}),(0,B.jsxs)(`select`,{value:t||``,onChange:e=>n(e.target.value||null),className:`w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,B.jsx)(`option`,{value:``,children:`— 请选择 —`}),e.map(e=>(0,B.jsxs)(`option`,{value:e.id,children:[e.name,` (v`,e.version,`)`]},e.id))]})]}),t&&(0,B.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:i?(0,B.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,B.jsx)(Cc,{className:`h-8 w-8 animate-spin text-blue-500`})}):!r||r.history.length===0?(0,B.jsxs)(`div`,{className:`text-center py-12`,children:[(0,B.jsx)(Ks,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,B.jsx)(`p`,{className:`text-gray-500`,children:`暂无进化记录`})]}):(0,B.jsx)(`div`,{className:`space-y-4`,children:r.history.map((e,t)=>(0,B.jsxs)(`div`,{className:`border-l-2 border-blue-200 pl-4 pb-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,B.jsx)(Us,{className:`h-4 w-4 text-green-500`}),(0,B.jsxs)(`span`,{className:`text-sm font-medium text-gray-900`,children:[e.previousVersion,` → `,e.newVersion]}),(0,B.jsx)(`span`,{className:`text-xs text-gray-500`,children:new Date(e.timestamp).toLocaleString(`zh-CN`)})]}),e.changes.length>0&&(0,B.jsx)(`ul`,{className:`text-sm text-gray-600 space-y-1 ml-6`,children:e.changes.map((e,t)=>(0,B.jsx)(`li`,{className:`list-disc`,children:e},t))})]},t))})})]})}function Rue({id:e,onClose:t}){let[n,r]=(0,z.useState)(``),[i,a]=(0,z.useState)(!1),o=qe(),{data:s,isLoading:c}=ct({queryKey:[`global-convention`,e],queryFn:()=>fu(e).then(e=>e.data)}),{data:l}=ct({queryKey:[`convention-yaml`,e],queryFn:()=>yu(e).then(e=>e.data),enabled:i});(0,z.useEffect)(()=>{l?.yaml!==void 0&&r(l.yaml)},[l]);let u=lt({mutationFn:t=>bu(e,t).then(e=>e.data),onSuccess:()=>{Yc(`保存成功`,`success`),a(!1),o.invalidateQueries({queryKey:[`global-convention`,e]}),o.invalidateQueries({queryKey:[`global-conventions`]})},onError:()=>{Yc(`保存失败`,`error`)}}),d=lt({mutationFn:()=>vu([e]).then(e=>e.data),onSuccess:t=>{t.results.success.length>0?(Yc(`规范已进化更新`,`success`),o.invalidateQueries({queryKey:[`global-convention`,e]}),o.invalidateQueries({queryKey:[`global-conventions`]})):Yc(`进化失败:`+(t.results.failed[0]?.error||`未知错误`),`error`)},onError:()=>{Yc(`进化失败`,`error`)}});if(c)return(0,B.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,children:(0,B.jsx)(`div`,{className:`bg-white rounded-xl p-8`,children:(0,B.jsx)(Cc,{className:`h-8 w-8 animate-spin text-blue-500 mx-auto`})})});if(!s)return null;let f=s.source===`official`;return(0,B.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4`,onClick:t,children:(0,B.jsxs)(`div`,{className:`bg-white rounded-xl max-w-4xl w-full max-h-[90vh] overflow-hidden flex flex-col`,onClick:e=>e.stopPropagation(),children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between p-6 border-b border-gray-200`,children:[(0,B.jsxs)(`div`,{className:`flex-1`,children:[(0,B.jsx)(`h2`,{className:`text-xl font-bold text-gray-900`,children:s.name}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:s.description})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 ml-4`,children:[(0,B.jsxs)(`button`,{onClick:()=>d.mutate(),disabled:d.isPending,className:`flex items-center gap-1.5 px-3 py-2 text-sm bg-green-50 text-green-600 hover:bg-green-100 rounded-lg transition-colors disabled:opacity-50`,title:`AI 进化优化`,children:[(0,B.jsx)(Cc,{className:`h-4 w-4 ${d.isPending?`animate-spin`:``}`}),d.isPending?`进化中...`:`手动进化`]}),(0,B.jsx)(`button`,{onClick:t,className:`p-2 text-gray-400 hover:text-gray-600 rounded-lg transition-colors`,children:(0,B.jsx)(Uc,{className:`h-5 w-5`})})]})]}),(0,B.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-6 space-y-4`,children:[(0,B.jsxs)(`div`,{className:`grid grid-cols-3 gap-4 text-sm`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`text-gray-500`,children:`版本`}),(0,B.jsx)(`div`,{className:`font-medium text-gray-900 mt-1`,children:s.version})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`text-gray-500`,children:`来源`}),(0,B.jsx)(`div`,{className:`font-medium text-gray-900 mt-1`,children:s.source===`official`?`官方`:s.source===`user`?`用户`:`社区`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`text-gray-500`,children:`角色数`}),(0,B.jsx)(`div`,{className:`font-medium text-gray-900 mt-1`,children:s.roles?Object.keys(s.roles).length:0})]})]}),i?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(`label`,{className:`text-sm font-medium text-gray-700`,children:`YAML 内容`}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsxs)(`button`,{onClick:()=>u.mutate(n),disabled:u.isPending,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:[(0,B.jsx)(Tc,{className:`h-3.5 w-3.5`}),u.isPending?`保存中...`:`保存`]}),(0,B.jsx)(`button`,{onClick:()=>a(!1),className:`px-3 py-1.5 text-sm bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors`,children:`取消`})]})]}),(0,B.jsx)(`textarea`,{value:n,onChange:e=>r(e.target.value),rows:20,className:`w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono`})]}):(0,B.jsxs)(`div`,{className:`space-y-4`,children:[s.principles&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`text-sm font-medium text-gray-700 mb-2`,children:`核心原则`}),(0,B.jsx)(`pre`,{className:`text-sm text-gray-600 bg-gray-50 p-3 rounded-lg overflow-x-auto whitespace-pre-wrap`,children:s.principles})]}),s.roles&&Object.keys(s.roles).length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`text-sm font-medium text-gray-700 mb-2`,children:`角色定义`}),(0,B.jsx)(`div`,{className:`space-y-2`,children:Object.entries(s.roles).map(([e,t])=>(0,B.jsxs)(`div`,{className:`bg-gray-50 p-3 rounded-lg`,children:[(0,B.jsx)(`div`,{className:`font-medium text-gray-900 text-sm`,children:t.name||e}),t.responsibilities&&(0,B.jsxs)(`div`,{className:`text-xs text-gray-600 mt-1`,children:[`职责:`,t.responsibilities]}),t.constraints&&(0,B.jsxs)(`div`,{className:`text-xs text-gray-500 mt-1`,children:[`约束:`,t.constraints]})]},e))})]}),s.quality_standards&&s.quality_standards.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`text-sm font-medium text-gray-700 mb-2`,children:`质量标准`}),(0,B.jsx)(`div`,{className:`space-y-1.5`,children:s.quality_standards.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-start gap-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`px-1.5 py-0.5 text-xs rounded font-medium ${e.severity===`must`?`bg-red-50 text-red-600`:e.severity===`should`?`bg-amber-50 text-amber-600`:`bg-blue-50 text-blue-600`}`,children:e.severity===`must`?`必须`:e.severity===`should`?`应该`:`可以`}),(0,B.jsxs)(`span`,{className:`text-gray-500`,children:[`[`,e.category,`]`]}),(0,B.jsx)(`span`,{className:`text-gray-700 flex-1`,children:e.rule})]},t))})]}),s.active_prompt&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`text-sm font-medium text-gray-700 mb-2`,children:`Active Prompt`}),(0,B.jsx)(`pre`,{className:`text-xs text-gray-600 bg-gray-50 p-3 rounded-lg overflow-x-auto whitespace-pre-wrap`,children:s.active_prompt})]}),!f&&(0,B.jsxs)(`button`,{onClick:()=>a(!0),className:`flex items-center gap-1.5 px-3 py-2 text-sm bg-blue-50 text-blue-600 hover:bg-blue-100 rounded-lg transition-colors`,children:[(0,B.jsx)(ic,{className:`h-4 w-4`}),`编辑 YAML`]})]})]})]})})}function zue(){let[e,t]=(0,z.useState)(null),[n,r]=(0,z.useState)(!1),{data:i,isLoading:a}=ct({queryKey:[`node-types`],queryFn:xu}),{data:o,isLoading:s}=ct({queryKey:[`node-type`,e],queryFn:()=>Su(e),enabled:!!e}),c=i?.data.items||[],l=o?.data,u=e=>({analysis:`bg-blue-100 text-blue-700`,design:`bg-purple-100 text-purple-700`,implementation:`bg-green-100 text-green-700`,validation:`bg-orange-100 text-orange-700`})[e]||`bg-gray-100 text-gray-700`;return(0,B.jsxs)(`div`,{className:`p-6 max-w-7xl mx-auto`,children:[(0,B.jsxs)(`div`,{className:`mb-6`,children:[(0,B.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`流水线节点类型管理`}),(0,B.jsx)(`p`,{className:`text-sm text-gray-600 mt-1`,children:`浏览所有可用的节点类型,点击查看详细配置`})]}),a?(0,B.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,B.jsx)(pc,{className:`h-6 w-6 animate-spin text-gray-400`})}):(0,B.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-6`,children:[(0,B.jsx)(`div`,{className:`space-y-3`,children:c.map(n=>(0,B.jsxs)(`div`,{onClick:()=>{t(n.id),r(!1)},className:`p-4 border rounded-lg cursor-pointer transition-all ${e===n.id?`border-blue-500 bg-blue-50 shadow-sm`:`border-gray-200 hover:border-gray-300 hover:shadow-sm`}`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(Ms,{className:`h-5 w-5 text-gray-600`}),(0,B.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:n.name})]}),(0,B.jsx)(`span`,{className:`px-2 py-0.5 text-xs rounded-full ${u(n.semanticCategory)}`,children:n.semanticCategory})]}),(0,B.jsx)(`p`,{className:`text-sm text-gray-600 mt-2`,children:n.description}),(0,B.jsxs)(`div`,{className:`flex items-center gap-4 mt-3 text-xs text-gray-500`,children:[n.isBuiltin&&(0,B.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(Us,{className:`h-3 w-3`}),`内置`]}),n.defaultSkills.length>0&&(0,B.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(Wc,{className:`h-3 w-3`}),n.defaultSkills.length,` 个默认技能`]})]})]},n.id))}),(0,B.jsx)(`div`,{className:`lg:sticky lg:top-6 lg:self-start`,children:e?s?(0,B.jsx)(`div`,{className:`border border-gray-200 rounded-lg p-8 flex items-center justify-center`,children:(0,B.jsx)(pc,{className:`h-6 w-6 animate-spin text-gray-400`})}):l?(0,B.jsxs)(`div`,{className:`border border-gray-200 rounded-lg p-6 space-y-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,B.jsx)(`h2`,{className:`text-xl font-bold text-gray-900`,children:l.name}),(0,B.jsx)(`span`,{className:`px-2 py-1 text-xs rounded-full ${u(l.semanticCategory)}`,children:l.semanticCategory})]}),(0,B.jsx)(`p`,{className:`text-sm text-gray-600`,children:l.description}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 mt-2 text-xs text-gray-500`,children:[(0,B.jsx)(`code`,{className:`bg-gray-100 px-2 py-0.5 rounded`,children:l.id}),l.isBuiltin&&(0,B.jsxs)(`span`,{className:`flex items-center gap-1 text-green-600`,children:[(0,B.jsx)(Us,{className:`h-3 w-3`}),`内置节点`]})]})]}),l.defaultSkills.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-2 flex items-center gap-1`,children:[(0,B.jsx)(Wc,{className:`h-4 w-4`}),`默认技能`]}),(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:l.defaultSkills.map(e=>(0,B.jsx)(`span`,{className:`px-2 py-1 bg-blue-50 text-blue-700 text-xs rounded`,children:e},e))})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-2 flex items-center gap-1`,children:[(0,B.jsx)(Us,{className:`h-4 w-4`}),`完成条件`]}),(0,B.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[l.completion.explicitSignal&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`text-gray-600`,children:`显式信号:`}),(0,B.jsx)(`code`,{className:`ml-2 bg-gray-100 px-2 py-0.5 rounded text-xs`,children:l.completion.explicitSignal})]}),l.completion.requireWrite!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`text-gray-600`,children:`需要写入操作:`}),(0,B.jsx)(`span`,{className:`ml-2 text-gray-900`,children:l.completion.requireWrite?`是`:`否`})]}),l.completion.keywords.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`text-gray-600`,children:`关键词:`}),(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1`,children:l.completion.keywords.map((e,t)=>(0,B.jsx)(`code`,{className:`bg-gray-100 px-2 py-0.5 rounded text-xs`,children:e},t))})]}),l.completion.filePatterns.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`text-gray-600`,children:`文件模式:`}),(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1`,children:l.completion.filePatterns.map((e,t)=>(0,B.jsx)(`code`,{className:`bg-gray-100 px-2 py-0.5 rounded text-xs`,children:e},t))})]})]})]}),(l.activityThreshold.minToolCalls!==void 0||l.activityThreshold.stagnationStrategy)&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-2 flex items-center gap-1`,children:[(0,B.jsx)(ic,{className:`h-4 w-4`}),`活跃度阈值`]}),(0,B.jsxs)(`div`,{className:`space-y-1 text-sm`,children:[l.activityThreshold.minToolCalls!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`text-gray-600`,children:`最小工具调用次数:`}),(0,B.jsx)(`span`,{className:`ml-2 text-gray-900`,children:l.activityThreshold.minToolCalls})]}),l.activityThreshold.stagnationStrategy&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`text-gray-600`,children:`停滞策略:`}),(0,B.jsx)(`code`,{className:`ml-2 bg-gray-100 px-2 py-0.5 rounded text-xs`,children:l.activityThreshold.stagnationStrategy})]})]})]}),l.heuristic&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`button`,{onClick:()=>r(!n),className:`flex items-center gap-2 text-sm font-semibold text-gray-700 hover:text-gray-900`,children:[n?(0,B.jsx)(Vs,{className:`h-4 w-4`}):(0,B.jsx)(Rs,{className:`h-4 w-4`}),`原始配置(JSON)`]}),n&&(0,B.jsx)(`pre`,{className:`mt-2 p-3 bg-gray-50 rounded text-xs overflow-auto max-h-64`,children:JSON.stringify(l.heuristic,null,2)})]})]}):null:(0,B.jsxs)(`div`,{className:`border border-gray-200 rounded-lg p-8 text-center text-gray-500`,children:[(0,B.jsx)(Ms,{className:`h-12 w-12 mx-auto mb-3 text-gray-300`}),(0,B.jsx)(`p`,{children:`选择左侧节点类型查看详细信息`})]})})]})]})}function Bue(){return(0,B.jsx)(mx,{children:(0,B.jsxs)(Xc,{children:[(0,B.jsx)(dx,{}),(0,B.jsx)(ef,{children:(0,B.jsxs)(lr,{children:[(0,B.jsx)(sr,{path:`/`,element:(0,B.jsx)(or,{to:`/dashboard`,replace:!0})}),(0,B.jsx)(sr,{path:`/dashboard`,element:(0,B.jsx)(O4,{})}),(0,B.jsx)(sr,{path:`/sessions`,element:(0,B.jsx)(M4,{})}),(0,B.jsx)(sr,{path:`/sessions/:id`,element:(0,B.jsx)(P4,{})}),(0,B.jsx)(sr,{path:`/events`,element:(0,B.jsx)(r3,{})}),(0,B.jsx)(sr,{path:`/pipelines`,element:(0,B.jsx)(i3,{})}),(0,B.jsx)(sr,{path:`/pipelines/:id`,element:(0,B.jsx)(f3,{})}),(0,B.jsx)(sr,{path:`/projects`,element:(0,B.jsx)(Cue,{})}),(0,B.jsx)(sr,{path:`/projects/:encodedPath`,element:(0,B.jsx)(Oue,{})}),(0,B.jsx)(sr,{path:`/quality`,element:(0,B.jsx)(_3,{})}),(0,B.jsx)(sr,{path:`/analytics`,element:(0,B.jsx)(C3,{})}),(0,B.jsx)(sr,{path:`/knowledge`,element:(0,B.jsx)(Sue,{})}),(0,B.jsx)(sr,{path:`/skills`,element:(0,B.jsx)(Aue,{})}),(0,B.jsx)(sr,{path:`/conventions`,element:(0,B.jsx)(Fue,{})}),(0,B.jsx)(sr,{path:`/node-types`,element:(0,B.jsx)(zue,{})}),(0,B.jsx)(sr,{path:`/config`,element:(0,B.jsx)(y3,{})})]})})]})})}var Vue=new Ue({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1,staleTime:3e4}}});Gc.createRoot(document.getElementById(`root`)).render((0,B.jsx)(z.StrictMode,{children:(0,B.jsx)(Je,{client:Vue,children:(0,B.jsx)(Xr,{children:(0,B.jsx)(Bue,{})})})}));
|
|
76
|
+
M${w.x},${w.y}h${w.width}v${w.height}h${-w.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}q9.displayName=`MiniMap`;var _ue=(0,z.memo)(q9),vue=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,yue={[p7.Line]:`right`,[p7.Handle]:`bottom-right`};function bue({nodeId:e,position:t,variant:n=p7.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:h,onResize:g,onResizeEnd:_}){let v=s9(),y=typeof e==`string`?e:v,b=D7(),x=(0,z.useRef)(null),S=n===p7.Handle,C=E7((0,z.useCallback)(vue(S&&p),[S,p]),C7),w=(0,z.useRef)(null),T=t??yue[n];return(0,z.useEffect)(()=>{if(!(!x.current||!y))return w.current||=nce({domNode:x.current,nodeId:y,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=b.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=b.getState(),o=[],s={x:e.x,y:e.y},c=r.get(y);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=X5([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...b5({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:y,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:y,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:y,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};b.getState().triggerNodeChanges([n])}}),w.current.update({controlPosition:T,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:_,shouldResize:m}),()=>{w.current?.destroy()}},[T,s,c,l,u,d,h,g,_,m]),(0,B.jsx)(`div`,{className:w3([`react-flow__resize-control`,`nodrag`,...T.split(`-`),n,r]),ref:x,style:{...i,scale:C,...o&&{[S?`backgroundColor`:`borderColor`]:o}},children:a})}(0,z.memo)(bue);var J9={requirement:`#3b82f6`,decision:`#8b5cf6`,code_change:`#10b981`,outcome:`#f59e0b`};function xue({nodes:e,edges:t,onNodeClick:n}){let r=(0,z.useMemo)(()=>e.map((e,t)=>({id:e.id,type:`default`,data:{label:(0,B.jsxs)(`div`,{className:`text-xs`,children:[(0,B.jsx)(`div`,{className:`font-semibold truncate max-w-[120px]`,children:e.title}),(0,B.jsx)(`div`,{className:`text-gray-500 text-[10px]`,children:e.node_type})]})},position:{x:t%5*200+Math.sin(t)*30,y:Math.floor(t/5)*150+Math.cos(t)*20},style:{background:J9[e.node_type]||`#6b7280`,color:`#fff`,border:`none`,borderRadius:`8px`,padding:`8px 12px`,minWidth:`140px`}})),[e]),i=(0,z.useMemo)(()=>t.map(e=>({id:e.id,source:e.from_node_id,target:e.to_node_id,label:e.edge_type,labelStyle:{fontSize:10,fill:`#6b7280`},style:{stroke:`#d1d5db`,strokeWidth:Math.max(1,e.weight)},markerEnd:{type:V8.ArrowClosed,color:`#d1d5db`}})),[t]),[a,,o]=Kle(r),[s,,c]=qle(i),l=(0,z.useCallback)((e,t)=>{n?.(t.id)},[n]);return e.length===0?(0,B.jsx)(`div`,{className:`flex items-center justify-center h-full text-gray-400 text-sm`,children:`暂无知识节点`}):(0,B.jsxs)(Gle,{nodes:a,edges:s,onNodesChange:o,onEdgesChange:c,onNodeClick:l,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[(0,B.jsx)(Qle,{color:`#f3f4f6`,gap:20}),(0,B.jsx)(aue,{}),(0,B.jsx)(_ue,{nodeColor:t=>J9[e.find(e=>e.id===t.id)?.node_type||``]||`#6b7280`,style:{background:`#f9fafb`}})]})}var Y9={requirement:ic,decision:dc,code_change:qs,outcome:Us},X9={requirement:`#3b82f6`,decision:`#8b5cf6`,code_change:`#10b981`,outcome:`#f59e0b`},Z9=[`#3b82f6`,`#8b5cf6`,`#10b981`,`#f59e0b`,`#ef4444`,`#06b6d4`];function Sue(){let e=qe(),[t,n]=(0,z.useState)(``),[r,i]=(0,z.useState)(``),[a,o]=(0,z.useState)(null),[s,c]=(0,z.useState)(1),[l,u]=(0,z.useState)(20),[d,f]=(0,z.useState)(!1),[p,m]=(0,z.useState)(!1),[h,g]=(0,z.useState)(null),[_,v]=(0,z.useState)(``),[y,b]=(0,z.useState)(`list`),[x,S]=(0,z.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),{data:C}=ct({queryKey:[`knowledge-overview`],queryFn:()=>ml().then(e=>e.data)}),{data:w}=ct({queryKey:[`knowledge-search`,t,r,_],queryFn:()=>pl(t,_||void 0,r||void 0).then(e=>e.data),enabled:t.length>0}),{data:T}=ct({queryKey:[`knowledge-all`],queryFn:()=>pl(``).then(e=>e.data)}),{data:E}=ct({queryKey:[`knowledge-filtered`,r,_],queryFn:()=>pl(``,_||void 0,r||void 0).then(e=>e.data),enabled:t.length===0&&(!!r||!!_)}),{data:D}=ct({queryKey:[`knowledge-neighbors`,a],queryFn:()=>hl(a).then(e=>e.data),enabled:!!a}),{data:O}=ct({queryKey:[`knowledge-graph`,_,r],queryFn:()=>gl(_||void 0,r||void 0).then(e=>e.data),enabled:y===`graph`}),k=lt({mutationFn:_l,onSuccess:()=>{e.invalidateQueries({queryKey:[`knowledge-all`]}),e.invalidateQueries({queryKey:[`knowledge-filtered`]}),e.invalidateQueries({queryKey:[`knowledge-search`]}),e.invalidateQueries({queryKey:[`knowledge-overview`]}),f(!1)}}),A=lt({mutationFn:({id:e,data:t})=>vl(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:[`knowledge-all`]}),e.invalidateQueries({queryKey:[`knowledge-filtered`]}),e.invalidateQueries({queryKey:[`knowledge-search`]}),m(!1),g(null)}}),j=lt({mutationFn:yl,onSuccess:()=>{e.invalidateQueries({queryKey:[`knowledge-all`]}),e.invalidateQueries({queryKey:[`knowledge-filtered`]}),e.invalidateQueries({queryKey:[`knowledge-search`]}),e.invalidateQueries({queryKey:[`knowledge-overview`]}),o(null)}}),M=t?w?.items:r||_?E?.items:T?.items,N=Array.from(new Set(T?.items.map(e=>e.node_type)||[])),ee=Array.from(new Set(T?.items.map(e=>e.project_path||``).filter(Boolean)||[])),P=C?.byType?Object.entries(C.byType).map(([e,t])=>({name:e,value:t})):[],F=Math.ceil((M?.length||0)/l),I=M?.slice((s-1)*l,s*l),te=e=>{e.preventDefault();let t=new FormData(e.currentTarget);k.mutate({title:t.get(`title`),content:t.get(`content`),node_type:t.get(`node_type`),project_path:t.get(`project_path`),tags:t.get(`tags`)})},ne=e=>{if(e.preventDefault(),!h)return;let t=new FormData(e.currentTarget);A.mutate({id:h.id,data:{title:t.get(`title`),content:t.get(`content`),tags:t.get(`tags`)}})},re=e=>{S({open:!0,title:`删除知识节点`,description:`确认删除此知识节点?关联的边也会被删除。`,onConfirm:()=>{j.mutate(e),S(e=>({...e,open:!1}))}})};return(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsx)(X,{children:(0,B.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,B.jsxs)(`div`,{className:`relative flex-1`,children:[(0,B.jsx)(Ec,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,B.jsx)(`input`,{type:`text`,placeholder:`搜索知识节点(需求、决策、代码变更、结果)...`,value:t,onChange:e=>{n(e.target.value),c(1)},className:`w-full pl-10 pr-4 py-3 border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-500 text-lg`})]}),(0,B.jsxs)(`select`,{value:r,onChange:e=>{i(e.target.value),c(1)},className:`px-3 py-3 border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,B.jsx)(`option`,{value:``,children:`全部类型`}),N.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))]}),(0,B.jsxs)(`select`,{value:_,onChange:e=>{v(e.target.value),c(1)},className:`px-3 py-3 border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,B.jsx)(`option`,{value:``,children:`全部项目`}),ee.map(e=>(0,B.jsx)(`option`,{value:e,children:e.split(`/`).pop()},e))]}),(0,B.jsx)(Y,{variant:`primary`,size:`sm`,icon:xc,onClick:()=>f(!0),children:`创建节点`}),(0,B.jsxs)(`div`,{className:`flex border border-gray-200 rounded-lg overflow-hidden`,children:[(0,B.jsx)(`button`,{onClick:()=>b(`list`),className:`px-3 py-2 text-sm transition-colors ${y===`list`?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`}`,children:`列表`}),(0,B.jsxs)(`button`,{onClick:()=>b(`graph`),className:`px-3 py-2 text-sm transition-colors flex items-center gap-1 ${y===`graph`?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`}`,children:[(0,B.jsx)(gc,{className:`h-4 w-4`}),`图谱`]})]})]})}),(0,B.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,B.jsx)(X,{title:`知识图谱概览`,children:(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 mb-4`,children:[(0,B.jsxs)(`div`,{className:`text-center p-4 bg-blue-50 rounded-xl`,children:[(0,B.jsx)(Ns,{className:`h-8 w-8 text-blue-500 mx-auto mb-2`}),(0,B.jsx)(`div`,{className:`text-3xl font-bold text-blue-600`,children:C?.totalNodes||0}),(0,B.jsx)(`div`,{className:`text-sm text-gray-600`,children:`知识节点`})]}),(0,B.jsxs)(`div`,{className:`text-center p-4 bg-purple-50 rounded-xl`,children:[(0,B.jsx)(sc,{className:`h-8 w-8 text-purple-500 mx-auto mb-2`}),(0,B.jsx)(`div`,{className:`text-3xl font-bold text-purple-600`,children:P.length}),(0,B.jsx)(`div`,{className:`text-sm text-gray-600`,children:`节点类型`})]})]})}),(0,B.jsx)(X,{title:`节点类型分布`,children:P.length>0?(0,B.jsx)(dk,{width:`100%`,height:200,children:(0,B.jsxs)(p2,{children:[(0,B.jsx)(BJ,{data:P,cx:`50%`,cy:`50%`,innerRadius:50,outerRadius:80,dataKey:`value`,label:({name:e,percent:t})=>`${e} ${(t*100).toFixed(0)}%`,children:P.map((e,t)=>(0,B.jsx)(UW,{fill:Z9[t%Z9.length]},t))}),(0,B.jsx)(HW,{})]})}):(0,B.jsx)(`div`,{className:`flex items-center justify-center h-48 text-gray-400`,children:`暂无数据`})})]}),y===`graph`&&(0,B.jsx)(X,{title:`知识图谱`,children:(0,B.jsx)(`div`,{className:`h-[600px] border border-gray-200 rounded-lg overflow-hidden`,children:O?(0,B.jsx)(xue,{nodes:O.nodes,edges:O.edges,onNodeClick:o}):(0,B.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,B.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})})})}),y===`list`&&(0,B.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-6`,children:[(0,B.jsx)(`div`,{className:`lg:col-span-2`,children:(0,B.jsxs)(X,{title:`知识节点 (${M?.length||0})`,action:M&&M.length>0?(0,B.jsx)(Y,{variant:`secondary`,size:`sm`,icon:Qs,onClick:()=>{if(!M||M.length===0)return;let e=[`ID`,`标题`,`类型`,`内容`,`标签`,`项目路径`],t=M.map(e=>[e.id,e.title,e.node_type,e.content,e.tags||``,e.project_path||``]);A4(`knowledge-nodes-${C4(new Date,`yyyyMMdd-HHmmss`)}.csv`,e,t)},children:`导出 CSV`}):void 0,children:[(0,B.jsxs)(`div`,{className:`space-y-2`,children:[I?.map((e,t)=>{let n=Y9[e.node_type]||Ns,r=X9[e.node_type]||`#6b7280`;return(0,B.jsx)(ux.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:t*.03},className:`p-4 rounded-lg border cursor-pointer transition-all group ${a===e.id?`border-blue-300 bg-blue-50 shadow-sm`:`border-gray-100 hover:border-gray-200 hover:bg-gray-50`}`,onClick:()=>o(e.id),children:(0,B.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,B.jsx)(`div`,{className:`p-2 rounded-lg`,style:{backgroundColor:`${r}15`},children:(0,B.jsx)(n,{className:`h-5 w-5`,style:{color:r}})}),(0,B.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`font-semibold text-gray-900 truncate`,children:e.title}),(0,B.jsx)(px,{size:`sm`,variant:e.node_type===`outcome`?`success`:e.node_type===`decision`?`info`:`default`,children:e.node_type})]}),(0,B.jsx)(`p`,{className:`text-sm text-gray-600 mt-1 line-clamp-2`,children:e.content}),e.tags&&e.tags.trim()&&(0,B.jsx)(`div`,{className:`flex gap-1 mt-2`,children:e.tags.split(`,`).filter(e=>e.trim()).slice(0,3).map(e=>(0,B.jsx)(`span`,{className:`text-xs px-2 py-0.5 bg-gray-100 rounded-full text-gray-600`,children:e.trim()},e))})]}),(0,B.jsxs)(`div`,{className:`flex gap-1 flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity`,children:[(0,B.jsx)(`button`,{onClick:t=>{t.stopPropagation(),g({id:e.id,title:e.title,content:e.content,tags:e.tags||``}),m(!0)},className:`p-1.5 rounded hover:bg-gray-200 text-gray-400 hover:text-gray-600`,children:(0,B.jsx)(Mc,{className:`h-3.5 w-3.5`})}),(0,B.jsx)(`button`,{onClick:t=>{t.stopPropagation(),re(e.id)},className:`p-1.5 rounded hover:bg-red-100 text-gray-400 hover:text-red-600`,children:(0,B.jsx)(Lc,{className:`h-3.5 w-3.5`})})]})]})},e.id)}),(!I||I.length===0)&&(0,B.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 text-gray-400`,children:[(0,B.jsx)(Ns,{className:`h-12 w-12 mb-4`}),(0,B.jsx)(`p`,{children:`暂无知识节点`}),(0,B.jsx)(`p`,{className:`text-sm mt-1`,children:`使用 Claude Code 进行开发后,知识会自动沉淀`})]})]}),M&&M.length>0&&(0,B.jsx)(`div`,{className:`mt-4`,children:(0,B.jsx)(k4,{currentPage:s,totalPages:F,onPageChange:c,pageSize:l,onPageSizeChange:e=>{u(e),c(1)},totalItems:M.length})})]})}),(0,B.jsx)(`div`,{children:(0,B.jsx)(X,{title:`节点详情`,children:a&&M?(()=>{let e=M.find(e=>e.id===a);if(!e)return(0,B.jsx)(`div`,{className:`text-gray-400 text-center py-8`,children:`节点未找到`});let t=Y9[e.node_type]||Ns,n=X9[e.node_type]||`#6b7280`;return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(`div`,{className:`p-3 rounded-xl`,style:{backgroundColor:`${n}15`},children:(0,B.jsx)(t,{className:`h-6 w-6`,style:{color:n}})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`font-bold text-gray-900`,children:e.title}),(0,B.jsx)(px,{size:`sm`,children:e.node_type})]})]}),(0,B.jsx)(`div`,{className:`p-3 bg-gray-50 rounded-lg text-sm text-gray-700 whitespace-pre-wrap`,children:e.content}),e.tags&&e.tags.trim()&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`text-xs font-semibold text-gray-500 mb-2`,children:`标签`}),(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.tags.split(`,`).filter(e=>e.trim()).map(e=>(0,B.jsx)(`span`,{className:`text-xs px-2 py-1 bg-blue-50 text-blue-600 rounded-full`,children:e.trim()},e))})]}),D&&D.items.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`text-xs font-semibold text-gray-500 mb-2`,children:[`关联节点 (`,D.total,`)`]}),(0,B.jsx)(`div`,{className:`space-y-2`,children:D.items.map((e,t)=>(0,B.jsxs)(`div`,{className:`p-2 bg-gray-50 rounded-lg text-sm cursor-pointer hover:bg-gray-100`,onClick:()=>o(e.id),children:[(0,B.jsx)(`div`,{className:`font-medium`,children:e.title}),(0,B.jsxs)(`div`,{className:`text-xs text-gray-500`,children:[e.edge_type,` · `,e.node_type]})]},t))})]})]})})():(0,B.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 text-gray-400`,children:[(0,B.jsx)(Ec,{className:`h-8 w-8 mb-3`}),(0,B.jsx)(`p`,{className:`text-sm`,children:`点击左侧节点查看详情`})]})})})]}),d&&(0,B.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,onClick:()=>f(!1),children:(0,B.jsxs)(`div`,{className:`bg-white rounded-xl p-6 w-full max-w-2xl max-h-[90vh] overflow-y-auto`,onClick:e=>e.stopPropagation(),children:[(0,B.jsx)(`h3`,{className:`text-xl font-bold mb-4`,children:`创建知识节点`}),(0,B.jsxs)(`form`,{onSubmit:te,className:`space-y-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标题 *`}),(0,B.jsx)(`input`,{type:`text`,name:`title`,required:!0,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`内容 *`}),(0,B.jsx)(`textarea`,{name:`content`,required:!0,rows:6,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`类型 *`}),(0,B.jsxs)(`select`,{name:`node_type`,required:!0,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,B.jsx)(`option`,{value:`requirement`,children:`需求 (requirement)`}),(0,B.jsx)(`option`,{value:`decision`,children:`决策 (decision)`}),(0,B.jsx)(`option`,{value:`code_change`,children:`代码变更 (code_change)`}),(0,B.jsx)(`option`,{value:`outcome`,children:`结果 (outcome)`})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`项目路径 *`}),(0,B.jsx)(`input`,{type:`text`,name:`project_path`,required:!0,placeholder:`/path/to/project`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标签(逗号分隔)`}),(0,B.jsx)(`input`,{type:`text`,name:`tags`,placeholder:`tag1, tag2, tag3`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,B.jsxs)(`div`,{className:`flex gap-2 justify-end pt-2`,children:[(0,B.jsx)(Y,{type:`button`,variant:`secondary`,onClick:()=>f(!1),children:`取消`}),(0,B.jsx)(Y,{type:`submit`,variant:`primary`,loading:k.isPending,children:`创建`})]})]})]})}),p&&h&&(0,B.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,onClick:()=>m(!1),children:(0,B.jsxs)(`div`,{className:`bg-white rounded-xl p-6 w-full max-w-2xl max-h-[90vh] overflow-y-auto`,onClick:e=>e.stopPropagation(),children:[(0,B.jsx)(`h3`,{className:`text-xl font-bold mb-4`,children:`编辑知识节点`}),(0,B.jsxs)(`form`,{onSubmit:ne,className:`space-y-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标题`}),(0,B.jsx)(`input`,{type:`text`,name:`title`,defaultValue:h.title,required:!0,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`内容`}),(0,B.jsx)(`textarea`,{name:`content`,defaultValue:h.content,required:!0,rows:6,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标签(逗号分隔)`}),(0,B.jsx)(`input`,{type:`text`,name:`tags`,defaultValue:h.tags,placeholder:`tag1, tag2, tag3`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,B.jsxs)(`div`,{className:`flex gap-2 justify-end pt-2`,children:[(0,B.jsx)(Y,{type:`button`,variant:`secondary`,onClick:()=>m(!1),children:`取消`}),(0,B.jsx)(Y,{type:`submit`,variant:`primary`,loading:A.isPending,children:`保存`})]})]})]})}),(0,B.jsx)(E4,{open:x.open,title:x.title,description:x.description,variant:`danger`,onConfirm:x.onConfirm,onCancel:()=>S({...x,open:!1})})]})}function Cue(){let e=Pn(),t=qe(),[n,r]=(0,z.useState)(``),[i,a]=(0,z.useState)(1),[o,s]=(0,z.useState)(12),[c,l]=(0,z.useState)(`lastActivity`),[u,d]=(0,z.useState)(!1),[f,p]=(0,z.useState)(!1),[m,h]=(0,z.useState)(null),[g,_]=(0,z.useState)(``),[v,y]=(0,z.useState)(``),[b,x]=(0,z.useState)(new Set),[S,C]=(0,z.useState)(!1),[w,T]=(0,z.useState)(``),[E,D]=(0,z.useState)(!1),{data:O}=ct({queryKey:[`project-meta-all`],queryFn:()=>W.get(`/projects/meta/all`).then(e=>e.data),staleTime:3e4}),k=O||{},A=lt({mutationFn:({projectPath:e,meta:t})=>W.put(`/projects/${encodeURIComponent(e)}/meta`,t),onSuccess:()=>{t.invalidateQueries({queryKey:[`project-meta-all`]})},onError:e=>Yc(e.message||`操作失败`,`error`)}),j=(e,t)=>{t.stopPropagation();let n=k[e]||{notes:``,tags:[],archived:!1};_(n.notes),y(n.tags.join(`, `)),h(e)},M=()=>{if(!m)return;let e=k[m]||{notes:``,tags:[],archived:!1};A.mutate({projectPath:m,meta:{notes:g.trim(),tags:v.split(`,`).map(e=>e.trim()).filter(Boolean),archived:e.archived}}),h(null)},N=(e,t)=>{t.stopPropagation();let n=k[e]||{notes:``,tags:[],archived:!1};A.mutate({projectPath:e,meta:{...n,archived:!n.archived}})},ee=(e,t)=>{t.stopPropagation(),x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},P=()=>{for(let e of b){let t=k[e]||{notes:``,tags:[],archived:!1};A.mutate({projectPath:e,meta:{...t,archived:!0}})}Yc(`已归档 ${b.size} 个项目`,`success`),x(new Set)},F=async()=>{D(!0);let e=0;for(let t of b)try{await Dl(encodeURIComponent(t)),e++}catch{}D(!1),C(!1),T(``),x(new Set),t.invalidateQueries({queryKey:[`projects`]}),Yc(`已删除 ${e} 个项目`,`success`)},{data:I,isLoading:te}=ct({queryKey:[`projects`],queryFn:()=>Tl({limit:1e3}).then(e=>e.data),refetchInterval:3e4});if(te)return(0,B.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,B.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})});let ne=I?.items||[],re=e=>{c===e?d(e=>!e):(l(e),d(!1)),a(1)},L=ne.filter(e=>{if(k[e.projectPath]?.archived&&!f)return!1;if(!n)return!0;let t=n.toLowerCase();return e.projectName.toLowerCase().includes(t)||e.projectPath.toLowerCase().includes(t)}).sort((e,t)=>{let n=0;return c===`name`?n=e.projectName.localeCompare(t.projectName):c===`lastActivity`?n=(e.lastActivity||``).localeCompare(t.lastActivity||``):c===`sessionCount`?n=e.sessionCount-t.sessionCount:c===`totalEvents`&&(n=e.totalEvents-t.totalEvents),u?n:-n}),R=Math.ceil(L.length/o),ie=L.slice((i-1)*o,i*o);return(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`项目管理`}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:`查看所有被 Forge 管理的项目`})]}),(0,B.jsx)(`div`,{className:`flex items-center gap-3`,children:b.size>0?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(px,{variant:`info`,children:[b.size,` 个已选`]}),(0,B.jsxs)(`button`,{onClick:P,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors`,children:[(0,B.jsx)(Es,{className:`h-4 w-4`}),`批量归档`]}),(0,B.jsxs)(`button`,{onClick:()=>C(!0),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors`,children:[(0,B.jsx)(Lc,{className:`h-4 w-4`}),`批量删除`]}),(0,B.jsxs)(`button`,{onClick:()=>x(new Set),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-600 hover:bg-gray-50 rounded-lg transition-colors`,children:[(0,B.jsx)(Uc,{className:`h-4 w-4`}),`取消选择`]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(px,{variant:`info`,children:[L.length,` 个项目`]}),(0,B.jsxs)(`button`,{onClick:()=>p(!f),className:q(`flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg transition-colors`,f?`bg-blue-50 text-blue-600`:`text-gray-600 hover:bg-gray-50`),children:[(0,B.jsx)(Es,{className:`h-4 w-4`}),f?`隐藏归档`:`显示归档`]}),(0,B.jsxs)(`button`,{onClick:()=>{let e=[`项目名称`,`项目路径`,`会话数`,`Pipeline 数`,`质量问题数`,`总事件数`,`最近活动`],t=L.map(e=>[e.projectName,e.projectPath,e.sessionCount,e.pipelineCount,e.qualityIssueCount,e.totalEvents,e.lastActivity||``]);A4(`projects-${new Date().toISOString().slice(0,10)}.csv`,e,t)},className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-600 hover:bg-gray-50 rounded-lg transition-colors`,children:[(0,B.jsx)(Qs,{className:`h-4 w-4`}),`导出 CSV`]})]})})]}),(0,B.jsx)(X,{children:(0,B.jsxs)(`div`,{className:`flex gap-3 items-center`,children:[(0,B.jsxs)(`div`,{className:`relative flex-1`,children:[(0,B.jsx)(Ec,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,B.jsx)(`input`,{type:`text`,placeholder:`搜索项目名称或路径...`,value:n,onChange:e=>{r(e.target.value),a(1)},className:`w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`text-gray-500`,children:`排序:`}),[{key:`name`,label:`名称`},{key:`lastActivity`,label:`活动时间`},{key:`sessionCount`,label:`会话数`},{key:`totalEvents`,label:`事件数`}].map(({key:e,label:t})=>(0,B.jsxs)(`button`,{onClick:()=>re(e),className:q(`px-3 py-1.5 rounded-lg transition-colors flex items-center gap-1`,c===e?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`),children:[t,c===e&&(0,B.jsx)(ks,{className:q(`h-3 w-3`,u&&`rotate-180`)})]},e))]})]})}),(0,B.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:ie.map((t,n)=>{let r=t.projectPath,i=k[r]||{notes:``,tags:[],archived:!1};return(0,B.jsx)(ux.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:n*.03},children:(0,B.jsx)(X,{className:q(`!p-0 overflow-hidden cursor-pointer hover:shadow-md transition-shadow h-full flex flex-col`,i.archived&&`opacity-60`),onClick:()=>e(`/projects/${encodeURIComponent(r)}`),children:(0,B.jsxs)(`div`,{className:`p-4 flex-1 flex flex-col`,children:[(0,B.jsxs)(`div`,{className:`flex items-start gap-3 mb-3`,children:[(0,B.jsx)(`div`,{className:`flex items-center justify-center w-10 h-10 rounded-lg bg-blue-50 flex-shrink-0`,children:(0,B.jsx)(ac,{className:`h-5 w-5 text-blue-600`})}),(0,B.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(`h3`,{className:`font-semibold text-gray-900 truncate`,children:t.projectName}),i.archived&&(0,B.jsx)(Es,{className:`h-3.5 w-3.5 text-gray-400 flex-shrink-0`})]}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500 truncate`,children:r}),i.tags.length>0&&(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1`,children:i.tags.map(e=>(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 px-1.5 py-0.5 bg-blue-50 text-blue-600 text-xs rounded`,children:[(0,B.jsx)(Pc,{className:`h-2.5 w-2.5`}),e]},e))}),i.notes&&(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mt-1 truncate`,children:i.notes})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-1 flex-shrink-0`,children:[(0,B.jsx)(`button`,{onClick:e=>ee(r,e),className:q(`p-1 rounded transition-colors`,b.has(r)?`text-blue-600`:`text-gray-300 hover:text-gray-500`),title:`选择`,children:b.has(r)?(0,B.jsx)(jc,{className:`h-3.5 w-3.5`}):(0,B.jsx)(Nc,{className:`h-3.5 w-3.5`})}),(0,B.jsx)(`button`,{onClick:e=>N(r,e),className:`p-1 text-gray-400 hover:text-gray-600 rounded`,title:i.archived?`取消归档`:`归档`,children:(0,B.jsx)(Es,{className:`h-3.5 w-3.5`})}),(0,B.jsx)(`button`,{onClick:e=>j(r,e),className:`p-1 text-gray-400 hover:text-gray-600 rounded`,title:`项目设置`,children:(0,B.jsx)(Dc,{className:`h-3.5 w-3.5`})})]})]}),(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-sm flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,B.jsx)(Ts,{className:`h-4 w-4 flex-shrink-0`}),(0,B.jsxs)(`span`,{children:[t.sessionCount,` 会话`]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,B.jsx)(sc,{className:`h-4 w-4 flex-shrink-0`}),(0,B.jsxs)(`span`,{children:[t.pipelineCount,` Pipeline`]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,B.jsx)(Oc,{className:`h-4 w-4 flex-shrink-0`}),(0,B.jsxs)(`span`,{children:[t.qualityIssueCount,` 质量`]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,B.jsx)(Ns,{className:`h-4 w-4 flex-shrink-0`}),(0,B.jsxs)(`span`,{children:[t.totalEvents,` 事件`]})]})]}),t.lastActivity&&(0,B.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-gray-400 mt-3 pt-3 border-t border-gray-100`,children:[(0,B.jsx)(Ks,{className:`h-3 w-3 flex-shrink-0`}),(0,B.jsxs)(`span`,{children:[`最近活动:`,C4(Qd(t.lastActivity),`MM-dd HH:mm`)]})]})]})})},r)})}),L.length===0&&(0,B.jsxs)(`div`,{className:`text-center py-12`,children:[(0,B.jsx)(ac,{className:`h-12 w-12 text-gray-300 mx-auto mb-3`}),(0,B.jsx)(`p`,{className:`text-gray-500`,children:`暂无项目`}),(0,B.jsx)(`p`,{className:`text-sm text-gray-400 mt-1`,children:`在任意目录使用 Claude Code 后,项目将自动出现在这里`})]}),L.length>0&&(0,B.jsx)(k4,{currentPage:i,totalPages:R,onPageChange:a,pageSize:o,onPageSizeChange:e=>{s(e),a(1)},totalItems:L.length}),S&&(0,B.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onClick:()=>{C(!1),T(``)},children:(0,B.jsxs)(`div`,{className:`bg-white rounded-xl shadow-xl w-full max-w-md p-6`,onClick:e=>e.stopPropagation(),children:[(0,B.jsxs)(`h3`,{className:`text-lg font-bold text-red-600 mb-3 flex items-center gap-2`,children:[(0,B.jsx)(Lc,{className:`h-5 w-5`}),`危险操作:批量删除项目`]}),(0,B.jsxs)(`div`,{className:`bg-red-50 border border-red-200 rounded-lg p-3 mb-4`,children:[(0,B.jsxs)(`p`,{className:`text-sm text-red-800 font-medium mb-2`,children:[`⚠️ 此操作将永久删除 `,(0,B.jsxs)(`strong`,{children:[b.size,` 个项目`]}),` 的所有监控数据:`]}),(0,B.jsxs)(`ul`,{className:`text-xs text-red-700 space-y-1 ml-4 list-disc`,children:[(0,B.jsx)(`li`,{children:`所有会话记录`}),(0,B.jsx)(`li`,{children:`所有 Pipeline 历史`}),(0,B.jsx)(`li`,{children:`所有质量问题记录`}),(0,B.jsx)(`li`,{children:`所有事件日志`}),(0,B.jsx)(`li`,{children:`所有知识节点`})]}),(0,B.jsx)(`p`,{className:`text-xs text-red-800 font-bold mt-2`,children:`此操作无法撤销,无法恢复!`})]}),(0,B.jsxs)(`div`,{className:`mb-4`,children:[(0,B.jsxs)(`label`,{className:`block text-sm font-medium text-gray-700 mb-2`,children:[`请输入 `,(0,B.jsx)(`code`,{className:`px-1.5 py-0.5 bg-gray-100 rounded text-red-600`,children:`删除`}),` 以确认批量删除:`]}),(0,B.jsx)(`input`,{type:`text`,value:w,onChange:e=>T(e.target.value),placeholder:`输入「删除」二字`,className:`w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-red-500`,autoFocus:!0})]}),(0,B.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,B.jsx)(`button`,{onClick:()=>{C(!1),T(``)},className:`px-4 py-2 text-sm text-gray-600 hover:bg-gray-50 rounded-lg`,children:`取消`}),(0,B.jsx)(`button`,{disabled:w!==`删除`||E,onClick:F,className:`px-4 py-2 text-sm bg-red-600 text-white rounded-lg hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed`,children:E?`删除中...`:`确认删除`})]})]})}),m&&(0,B.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40`,onClick:()=>h(null),children:(0,B.jsxs)(`div`,{className:`bg-white rounded-xl shadow-xl w-full max-w-md p-6`,onClick:e=>e.stopPropagation(),children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,B.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`项目设置`}),(0,B.jsx)(`button`,{onClick:()=>h(null),className:`text-gray-400 hover:text-gray-600`,children:(0,B.jsx)(Uc,{className:`h-5 w-5`})})]}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500 mb-4 truncate`,children:m}),(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标签(逗号分隔)`}),(0,B.jsx)(`input`,{type:`text`,value:v,onChange:e=>y(e.target.value),placeholder:`前端, 工具, 实验...`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`备注`}),(0,B.jsx)(`textarea`,{value:g,onChange:e=>_(e.target.value),rows:3,placeholder:`项目说明、注意事项...`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none`})]})]}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2 mt-5`,children:[(0,B.jsx)(`button`,{onClick:()=>h(null),className:`px-4 py-2 text-sm text-gray-600 hover:bg-gray-50 rounded-lg`,children:`取消`}),(0,B.jsx)(`button`,{onClick:M,className:`px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700`,children:`保存`})]})]})})]})}var wue={spec:{label:`规格`,icon:ic,color:`text-blue-600`,bg:`bg-blue-50`,border:`border-blue-200`},security:{label:`安全`,icon:kc,color:`text-red-600`,bg:`bg-red-50`,border:`border-red-200`},quality:{label:`质量`,icon:nc,color:`text-purple-600`,bg:`bg-purple-50`,border:`border-purple-200`},test:{label:`测试`,icon:Ic,color:`text-green-600`,bg:`bg-green-50`,border:`border-green-200`},performance:{label:`性能`,icon:Wc,color:`text-orange-600`,bg:`bg-orange-50`,border:`border-orange-200`}},Tue={fail:{label:`失败`,icon:Gs,color:`text-red-600`,bg:`bg-red-50`,border:`border-red-300`},warn:{label:`警告`,icon:zc,color:`text-yellow-600`,bg:`bg-yellow-50`,border:`border-yellow-300`},pass:{label:`通过`,icon:Us,color:`text-green-600`,bg:`bg-green-50`,border:`border-green-300`}};function Eue({level:e}){let t=Tue[e];if(!t)return(0,B.jsx)(px,{size:`sm`,children:e});let n=t.icon;return(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border ${t.bg} ${t.color} ${t.border}`,children:[(0,B.jsx)(n,{className:`h-3 w-3`}),t.label]})}function Due({category:e}){let t=wue[e];if(!t)return(0,B.jsx)(px,{size:`sm`,children:e});let n=t.icon;return(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border ${t.bg} ${t.color} ${t.border}`,children:[(0,B.jsx)(n,{className:`h-3 w-3`}),t.label]})}function Oue(){let{encodedPath:e}=In(),t=Pn(),n=qe(),[r,i]=(0,z.useState)(`sessions`),[a,o]=(0,z.useState)(!1),[s,c]=(0,z.useState)(``),[l,u]=(0,z.useState)(!1),[d,f]=(0,z.useState)(``),[p,m]=(0,z.useState)(null),[h,g]=(0,z.useState)(1),[_,v]=(0,z.useState)(20),[y,b]=(0,z.useState)(null),x=async e=>{try{let t=await Gl(e);await navigator.clipboard.writeText(t.data.context),b(e),Yc(`上下文已复制,请粘贴到 Claude Code 进行修复`,`success`),setTimeout(()=>b(null),3e3)}catch{Yc(`复制失败`,`error`)}},{data:S,isLoading:C,isError:w,error:T}=ct({queryKey:[`project`,e],queryFn:()=>El(encodeURIComponent(decodeURIComponent(e))).then(e=>e.data),enabled:!!e}),{data:E}=ct({queryKey:[`claudemd`,e],queryFn:()=>Fl(encodeURIComponent(decodeURIComponent(e))).then(e=>e.data),enabled:!!e&&r===`claudemd`}),{data:D}=ct({queryKey:[`claudemd-modules`,e],queryFn:()=>Rl(encodeURIComponent(decodeURIComponent(e))).then(e=>e.data),enabled:!!e&&r===`claudemd`}),O=lt({mutationFn:()=>Dl(encodeURIComponent(decodeURIComponent(e))),onSuccess:()=>{n.invalidateQueries({queryKey:[`projects`]}),t(`/projects`)},onError:e=>Yc(e.message||`删除失败`,`error`)}),k=lt({mutationFn:t=>Il(encodeURIComponent(decodeURIComponent(e)),t),onSuccess:()=>{n.invalidateQueries({queryKey:[`claudemd`,e]}),u(!1)},onError:e=>Yc(e.message||`保存失败`,`error`)}),A=lt({mutationFn:()=>zl(encodeURIComponent(decodeURIComponent(e))),onSuccess:t=>{n.invalidateQueries({queryKey:[`claudemd`,e]}),m({success:!0,message:t.data.distilled?`蒸馏完成,压缩 ${t.data.reduction}%(${t.data.before} → ${t.data.after} 字符):${t.data.summary}`:t.data.message??`无需蒸馏`})},onError:e=>{m({success:!1,message:e.message})}}),[j,M]=(0,z.useState)(null),[N,ee]=(0,z.useState)(!1),[P,F]=(0,z.useState)(!1),[I,te]=(0,z.useState)(null),[ne,re]=(0,z.useState)(!1),[L,R]=(0,z.useState)(null);return w?(0,B.jsxs)(`div`,{className:`flex items-center justify-center h-96 text-red-500`,children:[`加载失败:`,T?.message||`未知错误`]}):C||!S?(0,B.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,B.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})}):(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsx)(N4,{items:[{label:`项目列表`,path:`/projects`},{label:S.projectName}]}),(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,B.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Ds,onClick:()=>t(`/projects`),children:`返回`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(`div`,{className:`flex items-center justify-center w-10 h-10 rounded-lg bg-blue-50`,children:(0,B.jsx)(ac,{className:`h-5 w-5 text-blue-600`})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-xl font-bold text-gray-900`,children:S.projectName}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:S.projectPath})]})]})]}),(0,B.jsx)(Y,{variant:`danger`,size:`sm`,icon:Lc,onClick:()=>o(!0),children:`删除项目`})]}),a&&(0,B.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,children:(0,B.jsxs)(X,{className:`max-w-md`,children:[(0,B.jsxs)(`h3`,{className:`text-lg font-bold text-red-600 mb-3 flex items-center gap-2`,children:[(0,B.jsx)(zc,{className:`h-5 w-5`}),`危险操作:删除项目`]}),(0,B.jsxs)(`div`,{className:`bg-red-50 border border-red-200 rounded-lg p-3 mb-4`,children:[(0,B.jsxs)(`p`,{className:`text-sm text-red-800 font-medium mb-2`,children:[`⚠️ 此操作将永久删除项目 `,(0,B.jsx)(`strong`,{children:S.projectName}),` 的所有监控数据:`]}),(0,B.jsxs)(`ul`,{className:`text-xs text-red-700 space-y-1 ml-4 list-disc`,children:[(0,B.jsx)(`li`,{children:`所有会话记录`}),(0,B.jsx)(`li`,{children:`所有 Pipeline 历史`}),(0,B.jsx)(`li`,{children:`所有质量问题记录`}),(0,B.jsx)(`li`,{children:`所有事件日志`}),(0,B.jsx)(`li`,{children:`所有知识节点`})]}),(0,B.jsx)(`p`,{className:`text-xs text-red-800 font-bold mt-2`,children:`此操作无法撤销,无法恢复!`})]}),(0,B.jsxs)(`div`,{className:`mb-4`,children:[(0,B.jsxs)(`label`,{className:`block text-sm font-medium text-gray-700 mb-2`,children:[`请输入项目名称 `,(0,B.jsx)(`code`,{className:`px-1.5 py-0.5 bg-gray-100 rounded text-red-600`,children:S.projectName}),` 以确认删除:`]}),(0,B.jsx)(`input`,{type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`输入项目名称`,className:`w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-red-500`,autoFocus:!0})]}),(0,B.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,B.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:()=>{o(!1),c(``)},children:`取消`}),(0,B.jsx)(Y,{variant:`danger`,size:`sm`,disabled:s!==S.projectName,onClick:()=>{s===S.projectName&&(O.mutate(),o(!1),c(``))},children:`确认删除`})]})]})}),(0,B.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-5 gap-4`,children:[(0,B.jsx)(X,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>i(`sessions`),children:(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(Ts,{className:`h-8 w-8 text-blue-500`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:S.sessions.total}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:`会话`})]})]})}),(0,B.jsx)(X,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>i(`pipelines`),children:(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(sc,{className:`h-8 w-8 text-green-500`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:S.pipelines.total}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:`Pipeline`})]})]})}),(0,B.jsx)(X,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>i(`api`),children:(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(Fc,{className:`h-8 w-8 text-purple-500`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:S.events.total}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:`事件`})]})]})}),(0,B.jsx)(X,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>i(`quality`),children:(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(Oc,{className:`h-8 w-8 text-orange-500`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:S.quality.total}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:`质量`})]})]})}),(0,B.jsx)(X,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>i(`knowledge`),children:(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(Ns,{className:`h-8 w-8 text-pink-500`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:S.knowledge.total}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:`知识`})]})]})})]}),(0,B.jsx)(`div`,{className:`flex gap-1 bg-gray-100 p-1 rounded-lg w-fit flex-wrap`,children:[{key:`sessions`,label:`会话`},{key:`pipelines`,label:`Pipeline`},{key:`quality`,label:`质量问题`},{key:`knowledge`,label:`知识文档`},{key:`rules`,label:`规则管理`},{key:`convention`,label:`自定义规范`},{key:`claudemd`,label:`CLAUDE.md`},{key:`environment`,label:`环境初始化`}].map(e=>(0,B.jsx)(`button`,{onClick:()=>i(e.key),className:`px-4 py-2 rounded-md text-sm font-medium transition-colors ${r===e.key?`bg-white text-gray-900 shadow-sm`:`text-gray-600 hover:text-gray-900`}`,children:e.label},e.key))}),r===`sessions`&&(0,B.jsxs)(X,{children:[(0,B.jsx)(`div`,{className:`overflow-x-auto`,children:(0,B.jsxs)(`table`,{className:`w-full`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`会话 ID`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`首条对话`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`状态`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`开始时间`})]})}),(0,B.jsx)(`tbody`,{className:`text-sm`,children:(()=>{let n=S.sessions.items;return Math.ceil(n.length/_),(0,B.jsxs)(B.Fragment,{children:[n.slice((h-1)*_,h*_).map(n=>(0,B.jsxs)(`tr`,{onClick:()=>t(`/sessions/${n.session_id}`,{state:{from:`/projects/${encodeURIComponent(decodeURIComponent(e))}`}}),className:`border-t border-gray-50 hover:bg-blue-50 cursor-pointer transition-colors`,children:[(0,B.jsx)(`td`,{className:`py-3 font-mono text-xs`,children:n.session_id.slice(0,12)}),(0,B.jsx)(`td`,{className:`py-3 text-gray-700 max-w-md truncate`,title:n.first_requirement,children:n.first_requirement?n.first_requirement:`(无对话记录)`}),(0,B.jsx)(`td`,{className:`py-3`,children:(0,B.jsx)(px,{size:`sm`,className:Zd(n.status),children:n.status})}),(0,B.jsx)(`td`,{className:`py-3 text-gray-500`,children:C4(Qd(n.start_time),`MM-dd HH:mm`)})]},n.session_id)),n.length===0&&(0,B.jsx)(`tr`,{children:(0,B.jsx)(`td`,{colSpan:4,className:`py-8 text-center text-gray-400`,children:`暂无会话记录`})})]})})()})]})}),(()=>{let e=S.sessions.items,t=Math.ceil(e.length/_);return e.length>_?(0,B.jsx)(`div`,{className:`mt-4`,children:(0,B.jsx)(k4,{currentPage:h,totalPages:t,onPageChange:g,pageSize:_,onPageSizeChange:e=>{v(e),g(1)},totalItems:e.length})}):null})()]}),r===`pipelines`&&(0,B.jsx)(X,{children:(0,B.jsx)(`div`,{className:`overflow-x-auto`,children:(0,B.jsxs)(`table`,{className:`w-full`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`需求`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`阶段`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`时间`})]})}),(0,B.jsx)(`tbody`,{className:`text-sm`,children:S.pipelines.items.map(n=>(0,B.jsxs)(`tr`,{onClick:()=>t(`/pipelines/${n.id}`,{state:{from:`/projects/${encodeURIComponent(decodeURIComponent(e))}`}}),className:`border-t border-gray-50 hover:bg-blue-50 cursor-pointer transition-colors`,children:[(0,B.jsx)(`td`,{className:`py-3 max-w-xs truncate`,children:n.requirement}),(0,B.jsx)(`td`,{className:`py-3`,children:(0,B.jsx)(px,{size:`sm`,children:n.phase})}),(0,B.jsx)(`td`,{className:`py-3 text-gray-500`,children:C4(Qd(n.updated_at),`MM-dd HH:mm`)})]},n.id))})]})})}),r===`quality`&&(0,B.jsxs)(X,{children:[(0,B.jsx)(`div`,{className:`flex items-center justify-between mb-4`,children:(0,B.jsxs)(`p`,{className:`text-sm text-gray-600`,children:[`共 `,S.quality.total,` 个质量问题`]})}),(0,B.jsx)(`div`,{className:`overflow-x-auto`,children:(0,B.jsxs)(`table`,{className:`w-full`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`问题`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`级别`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`分类`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`状态`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`时间`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`})]})}),(0,B.jsx)(`tbody`,{className:`text-sm`,children:S.quality.items.map(e=>(0,B.jsxs)(`tr`,{className:`border-t border-gray-50 hover:bg-blue-50 transition-colors`,children:[(0,B.jsx)(`td`,{className:`py-3 max-w-xs truncate`,children:e.message}),(0,B.jsx)(`td`,{className:`py-3`,children:(0,B.jsx)(Eue,{level:e.level})}),(0,B.jsx)(`td`,{className:`py-3`,children:(0,B.jsx)(Due,{category:e.category})}),(0,B.jsx)(`td`,{className:`py-3`,children:(0,B.jsx)(px,{size:`sm`,variant:e.resolved?`success`:`default`,children:e.resolved?`已解决`:`未解决`})}),(0,B.jsx)(`td`,{className:`py-3 text-gray-500`,children:C4(Qd(e.created_at),`MM-dd HH:mm`)}),(0,B.jsx)(`td`,{className:`py-3`,children:!e.resolved&&(0,B.jsxs)(`button`,{onClick:()=>x(e.id),className:`flex items-center gap-1 px-2 py-1 text-xs text-gray-500 hover:text-blue-600 hover:bg-blue-50 rounded transition-colors`,title:`复制上下文到剪贴板`,children:[y===e.id?(0,B.jsx)(Is,{className:`h-3.5 w-3.5 text-green-500`}):(0,B.jsx)(Ys,{className:`h-3.5 w-3.5`}),y===e.id?`已复制`:`复制`]})})]},e.id))})]})})]}),r===`knowledge`&&(0,B.jsx)(X,{children:(0,B.jsx)(`div`,{className:`space-y-3`,children:S.knowledge.items.map(e=>(0,B.jsx)(`div`,{className:`p-4 border border-gray-100 rounded-lg hover:bg-blue-50 cursor-pointer transition-colors`,children:(0,B.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,B.jsx)(ic,{className:`h-5 w-5 text-blue-500 flex-shrink-0 mt-0.5`}),(0,B.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,B.jsx)(`h4`,{className:`font-medium text-gray-900 mb-1`,children:e.title}),(0,B.jsxs)(`p`,{className:`text-sm text-gray-600 line-clamp-2`,children:[e.content?.substring(0,150),`...`]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-gray-400`,children:[(0,B.jsx)(px,{size:`sm`,children:e.node_type}),(0,B.jsxs)(`span`,{children:[`更新于 `,C4(Qd(e.updated_at),`MM-dd HH:mm`)]})]})]})]})},e.id))})}),r===`rules`&&(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsx)(X,{title:`意图识别规则`,children:(0,B.jsx)(`div`,{className:`space-y-2`,children:S.rules.intentRules.slice(0,10).map(e=>(0,B.jsx)(`div`,{className:`flex items-center justify-between p-3 border border-gray-100 rounded-lg`,children:(0,B.jsxs)(`div`,{className:`flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(px,{size:`sm`,children:e.rule_type}),(0,B.jsx)(`code`,{className:`text-xs text-gray-600`,children:e.pattern})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-3 mt-1 text-xs text-gray-400`,children:[(0,B.jsxs)(`span`,{children:[`命中 `,e.hit_count,` 次`]}),(0,B.jsxs)(`span`,{children:[`置信度 `,(e.confidence*100).toFixed(0),`%`]})]})]})},e.id))})}),(0,B.jsx)(X,{title:`任务模式`,children:(0,B.jsx)(`div`,{className:`space-y-2`,children:S.rules.taskPatterns.slice(0,10).map(e=>(0,B.jsxs)(`div`,{className:`p-3 border border-gray-100 rounded-lg`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,B.jsx)(px,{size:`sm`,children:e.task_type}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-gray-500`,children:[(0,B.jsx)(Rc,{className:`h-3 w-3`}),(0,B.jsxs)(`span`,{children:[`效果 `,(e.effectiveness_score*100).toFixed(0),`%`]})]})]}),(0,B.jsx)(`p`,{className:`text-sm text-gray-600 mb-1`,children:e.failure_pattern}),(0,B.jsxs)(`p`,{className:`text-xs text-gray-500`,children:[`策略:`,e.prevention_strategy]})]},e.id))})})]}),r===`convention`&&e&&(0,B.jsx)(kue,{encodedPath:encodeURIComponent(decodeURIComponent(e))}),r===`claudemd`&&(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(X,{children:(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(ic,{className:`h-5 w-5 text-blue-500`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:`CLAUDE.md`}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500`,children:E?.exists?`${(E.size/1024).toFixed(1)} KB · ${E.hasAutoSection?`含自动区块`:`纯用户内容`}`:`文件不存在`})]})]}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Cc,onClick:()=>n.invalidateQueries({queryKey:[`claudemd`,e]}),children:`刷新`}),E?.exists&&(0,B.jsx)(Y,{variant:`secondary`,size:`sm`,icon:Wc,onClick:()=>{m(null),A.mutate()},disabled:A.isPending,title:`AI 蒸馏:压缩冗余内容,保留核心规范`,children:A.isPending?`蒸馏中...`:`蒸馏`}),E?.exists&&!l&&(0,B.jsx)(Y,{size:`sm`,icon:yc,onClick:()=>{f(E.content||``),u(!0)},children:`编辑`})]})]})}),p&&(0,B.jsx)(X,{children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsx)(`p`,{className:`text-sm ${p.success?`text-gray-900`:`text-red-600`}`,children:p.message}),(0,B.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Uc,onClick:()=>m(null)})]})}),l&&(0,B.jsxs)(X,{children:[(0,B.jsx)(`textarea`,{className:`w-full px-3 py-2 text-sm border border-gray-200 rounded-md font-mono h-96 resize-y`,value:d,onChange:e=>f(e.target.value)}),(0,B.jsxs)(`div`,{className:`flex gap-2 justify-end mt-3`,children:[(0,B.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Uc,onClick:()=>u(!1),children:`取消`}),(0,B.jsx)(Y,{size:`sm`,icon:Ls,onClick:()=>k.mutate(d),children:`保存`})]})]}),!l&&E?.exists&&(0,B.jsx)(X,{title:`内容预览`,children:(0,B.jsx)(`pre`,{className:`text-xs text-gray-700 bg-gray-50 p-4 rounded-md overflow-auto max-h-96 whitespace-pre-wrap font-mono`,children:E.content})}),(0,B.jsx)(X,{title:`子模块 (${D?.total??0})`,children:D?.items.length===0?(0,B.jsx)(`p`,{className:`text-sm text-gray-400`,children:`未检测到子模块`}):(0,B.jsx)(`div`,{className:`space-y-2`,children:D?.items.map(e=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between p-3 border border-gray-100 rounded-lg`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(ac,{className:`h-4 w-4 text-gray-400`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:e.name}),(0,B.jsx)(`p`,{className:`text-xs text-gray-400`,children:e.relativePath})]})]}),(0,B.jsx)(px,{size:`sm`,variant:e.hasClaudeMd?`success`:`default`,children:e.hasClaudeMd?`已有 CLAUDE.md`:`未生成`})]},e.path))})})]}),r===`environment`&&(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(X,{children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`font-medium text-gray-900 mb-1`,children:`环境检测 & 项目初始化`}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:`检测项目技术栈、创建 .claude-forge 目录、自动生成 CLAUDE.md(如不存在)`})]}),(0,B.jsxs)(`div`,{className:`flex gap-2 flex-shrink-0`,children:[(0,B.jsx)(Y,{variant:`secondary`,size:`sm`,icon:Dc,onClick:async()=>{ee(!0),M(null);try{M((await Ll(encodeURIComponent(decodeURIComponent(e)))).data.profile)}catch(e){M({error:String(e)})}finally{ee(!1)}},disabled:N,children:N?`检测中...`:`环境检测`}),(0,B.jsx)(Y,{size:`sm`,icon:Wc,onClick:async()=>{F(!0),te(null);try{let t=await Bl(encodeURIComponent(decodeURIComponent(e)));te({success:t.data.success,message:t.data.message,claudeMdGenerated:t.data.claudeMdGenerated}),M(t.data.profile),n.invalidateQueries({queryKey:[`claudemd`,e]}),n.invalidateQueries({queryKey:[`project`,e]})}catch(e){te({success:!1,message:String(e)})}finally{F(!1)}},disabled:P,children:P?`初始化中...`:`一键初始化`}),(0,B.jsx)(Y,{size:`sm`,icon:ic,onClick:async()=>{re(!0),R(null);try{let t=await Ol(encodeURIComponent(decodeURIComponent(e)));R({success:t.data.success,message:t.data.message}),t.data.skipped||(n.invalidateQueries({queryKey:[`conventions`,e]}),n.invalidateQueries({queryKey:[`claudemd`,e]}))}catch(e){R({success:!1,message:String(e)})}finally{re(!1)}},disabled:ne,children:ne?`生成中...`:`初始化规范`})]})]})}),I&&(0,B.jsx)(X,{children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex items-start gap-2`,children:[I.success?(0,B.jsx)(Ls,{className:`h-4 w-4 text-green-500 mt-0.5 flex-shrink-0`}):(0,B.jsx)(Uc,{className:`h-4 w-4 text-red-500 mt-0.5 flex-shrink-0`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-sm font-medium ${I.success?`text-gray-900`:`text-red-600`}`,children:I.message}),I.claudeMdGenerated&&(0,B.jsx)(`p`,{className:`text-xs text-green-600 mt-0.5`,children:`CLAUDE.md 已自动生成`})]})]}),(0,B.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Uc,onClick:()=>te(null)})]})}),L&&(0,B.jsx)(X,{children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex items-start gap-2`,children:[L.success?(0,B.jsx)(Ls,{className:`h-4 w-4 text-green-500 mt-0.5 flex-shrink-0`}):(0,B.jsx)(Uc,{className:`h-4 w-4 text-red-500 mt-0.5 flex-shrink-0`}),(0,B.jsx)(`p`,{className:q(`text-sm font-medium`,L.success?`text-gray-900`:`text-red-600`),children:L.message})]}),(0,B.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Uc,onClick:()=>R(null)})]})}),j&&!(`error`in j)&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(X,{title:`技术栈`,children:(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 text-sm`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`项目名称`}),(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:j.projectName})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`包管理器`}),(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:j.packageManager||`未检测到`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`测试框架`}),(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:j.testFramework||`未检测到`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`构建工具`}),(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:j.buildTool||`未检测到`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`Linter`}),(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:j.linter||`未检测到`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`Formatter`}),(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:j.formatter||`未检测到`})]})]})}),j.languages.length>0&&(0,B.jsx)(X,{title:`检测到的语言`,children:(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:j.languages.map((e,t)=>(0,B.jsxs)(px,{size:`sm`,children:[e.name,e.version?` ${e.version}`:``]},t))})}),j.frameworks.length>0&&(0,B.jsx)(X,{title:`检测到的框架`,children:(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:j.frameworks.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-1 bg-blue-50 rounded-md`,children:[(0,B.jsx)(`span`,{className:`text-sm font-medium text-blue-700`,children:e.name}),(0,B.jsx)(`span`,{className:`text-xs text-blue-400`,children:e.category})]},t))})}),Object.keys(j.scripts).length>0&&(0,B.jsx)(X,{title:`常用脚本`,children:(0,B.jsx)(`div`,{className:`space-y-1`,children:Object.entries(j.scripts).map(([e,t])=>(0,B.jsxs)(`div`,{className:`flex items-start gap-3 text-sm py-1 border-b border-gray-50 last:border-0`,children:[(0,B.jsx)(`span`,{className:`font-mono text-blue-600 flex-shrink-0 w-24`,children:e}),(0,B.jsx)(`span`,{className:`text-gray-600 font-mono text-xs break-all`,children:t})]},e))})}),j.keyDirectories.length>0&&(0,B.jsx)(X,{title:`关键目录`,children:(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:j.keyDirectories.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-1 bg-gray-50 rounded-md`,children:[(0,B.jsx)(ac,{className:`h-3.5 w-3.5 text-gray-400`}),(0,B.jsx)(`span`,{className:`text-sm text-gray-700 font-mono`,children:e})]},t))})})]}),j&&`error`in j&&(0,B.jsx)(X,{children:(0,B.jsxs)(`p`,{className:`text-sm text-red-600`,children:[`检测失败:`,j.error]})})]})]})}function kue({encodedPath:e}){let[t,n]=(0,z.useState)(`bindings`),[r,i]=(0,z.useState)(!1),[a,o]=(0,z.useState)(``),[s,c]=(0,z.useState)(!1),l=qe(),{data:u,isLoading:d}=ct({queryKey:[`project-conventions`,e],queryFn:()=>kl(e).then(e=>e.data)}),{data:f}=ct({queryKey:[`global-conventions`],queryFn:()=>du().then(e=>e.data),enabled:r}),{data:p}=ct({queryKey:[`project-custom-yaml`,e],queryFn:()=>Ml(e).then(e=>e.data),enabled:s}),m=lt({mutationFn:t=>Al(e,t).then(e=>e.data),onSuccess:t=>{Yc(`已绑定:${t.convention.name}`,`success`),i(!1),l.invalidateQueries({queryKey:[`project-conventions`,e]})}}),h=lt({mutationFn:t=>jl(e,t).then(e=>e.data),onSuccess:()=>{Yc(`已解绑`,`success`),l.invalidateQueries({queryKey:[`project-conventions`,e]})}}),g=lt({mutationFn:()=>Pl(e).then(e=>e.data),onSuccess:t=>{Yc(t.isIncremental?`增量蒸馏完成,版本 ${t.convention.version}`:`蒸馏完成,生成 ${t.convention.name}`,`success`),l.invalidateQueries({queryKey:[`project-conventions`,e]}),n(`custom`)}}),_=lt({mutationFn:t=>Nl(e,t).then(e=>e.data),onSuccess:()=>{Yc(`保存成功`,`success`),c(!1),l.invalidateQueries({queryKey:[`project-conventions`,e]})}}),v=u?.bindings||[],y=u?.custom,b=(f?.items||[]).filter(e=>!v.some(t=>t.id===e.id)),x={official:`bg-amber-50 text-amber-700`,user:`bg-blue-50 text-blue-700`,community:`bg-purple-50 text-purple-700`},S={official:`官方`,user:`用户`,community:`社区`};return d?(0,B.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,B.jsx)(Cc,{className:`h-6 w-6 animate-spin text-blue-500`})}):(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(`div`,{className:`flex gap-1 bg-gray-100 rounded-lg p-1`,children:[`bindings`,`custom`].map(e=>(0,B.jsx)(`button`,{onClick:()=>n(e),className:`px-4 py-1.5 text-sm font-medium rounded-md transition-colors flex items-center gap-1.5 ${t===e?`bg-white text-gray-900 shadow-sm`:`text-gray-500 hover:text-gray-700`}`,children:e===`bindings`?`绑定的规范 (${v.length})`:(0,B.jsxs)(B.Fragment,{children:[`蒸馏规范`,y&&(0,B.jsx)(`span`,{className:`inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700`,children:`实际生效`})]})},e))}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[t===`bindings`&&(0,B.jsxs)(`button`,{onClick:()=>i(!r),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors`,children:[(0,B.jsx)(fc,{className:`h-3.5 w-3.5`}),`绑定规范`]}),t===`custom`&&(0,B.jsxs)(`button`,{onClick:()=>g.mutate(),disabled:g.isPending||v.length===0,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-purple-600 text-white rounded-lg hover:bg-purple-700 disabled:opacity-50 transition-colors`,title:v.length===0?`请先绑定至少一个规范`:``,children:[(0,B.jsx)(Wc,{className:`h-3.5 w-3.5 ${g.isPending?`animate-pulse`:``}`}),g.isPending?`蒸馏中...`:y?`重新蒸馏`:`生成蒸馏规范`]})]})]}),r&&(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-blue-200 p-4 space-y-3`,children:[(0,B.jsx)(`div`,{className:`text-sm font-medium text-gray-700`,children:`从全局规范库选择绑定`}),b.length===0?(0,B.jsx)(`p`,{className:`text-sm text-gray-400`,children:`所有全局规范已全部绑定`}):(0,B.jsx)(`div`,{className:`grid gap-2`,children:b.map(e=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between p-3 bg-gray-50 rounded-lg`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`text-sm font-medium text-gray-900`,children:e.name}),(0,B.jsx)(`span`,{className:`px-1.5 py-0.5 text-xs rounded-full ${x[e.source]||`bg-gray-100 text-gray-600`}`,children:S[e.source]||e.source}),(0,B.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`v`,e.version]})]}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:e.description})]}),(0,B.jsx)(`button`,{onClick:()=>m.mutate(e.id),disabled:m.isPending,className:`px-3 py-1.5 text-xs bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:`绑定`})]},e.id))}),(0,B.jsx)(`button`,{onClick:()=>i(!1),className:`text-xs text-gray-400 hover:text-gray-600`,children:`关闭`})]}),t===`bindings`&&(0,B.jsx)(`div`,{className:`space-y-3`,children:v.length===0?(0,B.jsxs)(`div`,{className:`text-center py-12 bg-white rounded-xl border border-gray-200`,children:[(0,B.jsx)(As,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,B.jsx)(`p`,{className:`text-gray-500 text-sm`,children:`尚未绑定任何规范`}),(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:`点击「绑定规范」从全局规范库选择`})]}):v.map(e=>(0,B.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,B.jsx)(`span`,{className:`font-medium text-gray-900`,children:e.name}),(0,B.jsx)(`span`,{className:`px-1.5 py-0.5 text-xs rounded-full font-medium ${x[e.source]||`bg-gray-100 text-gray-600`}`,children:S[e.source]||e.source}),(0,B.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`v`,e.version]})]}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500`,children:e.description}),(0,B.jsxs)(`div`,{className:`flex gap-3 mt-2 text-xs text-gray-400`,children:[(0,B.jsxs)(`span`,{children:[e.roles?Object.keys(e.roles).length:0,` 个角色`]}),(0,B.jsxs)(`span`,{children:[e.quality_standards?.length||0,` 条质量标准`]})]})]}),(0,B.jsx)(`button`,{onClick:()=>h.mutate(e.id),disabled:h.isPending,className:`ml-4 p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors`,title:`解绑`,children:(0,B.jsx)(Uc,{className:`h-4 w-4`})})]})},e.id))}),t===`custom`&&(0,B.jsx)(`div`,{className:`space-y-4`,children:y?(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 overflow-hidden`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between px-5 py-4 border-b border-gray-100`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`font-semibold text-gray-900`,children:y.name}),(0,B.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`v`,y.version]}),(0,B.jsx)(`span`,{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700 border border-green-200`,children:`项目真实规范`})]}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:y.description})]}),!s&&(0,B.jsxs)(`button`,{onClick:()=>{o(p?.yaml||``),c(!0)},className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-gray-100 text-gray-700 hover:bg-gray-200 rounded-lg transition-colors`,children:[(0,B.jsx)(yc,{className:`h-3.5 w-3.5`}),`编辑 YAML`]})]}),(0,B.jsx)(`div`,{className:`p-5`,children:s?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(`textarea`,{value:a||p?.yaml||``,onChange:e=>o(e.target.value),rows:24,className:`w-full px-3 py-2 text-xs border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono`}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsxs)(`button`,{onClick:()=>_.mutate(a),disabled:_.isPending,className:`flex items-center gap-1.5 px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:[(0,B.jsx)(Tc,{className:`h-3.5 w-3.5`}),_.isPending?`保存中...`:`保存`]}),(0,B.jsx)(`button`,{onClick:()=>c(!1),className:`px-4 py-2 text-sm bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors`,children:`取消`})]})]}):(0,B.jsxs)(`div`,{className:`space-y-4 text-sm`,children:[y.principles&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`text-xs font-medium text-gray-500 uppercase tracking-wide mb-2`,children:`核心原则`}),(0,B.jsx)(`pre`,{className:`text-xs text-gray-700 bg-gray-50 rounded-lg p-3 whitespace-pre-wrap border border-gray-100 max-h-48 overflow-y-auto`,children:typeof y.principles==`string`?y.principles:JSON.stringify(y.principles,null,2)})]}),y.quality_standards&&y.quality_standards.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`text-xs font-medium text-gray-500 uppercase tracking-wide mb-2`,children:[`质量标准 (`,y.quality_standards.length,`)`]}),(0,B.jsxs)(`div`,{className:`space-y-1`,children:[y.quality_standards.slice(0,5).map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-start gap-2 text-xs text-gray-600`,children:[(0,B.jsx)(`span`,{className:`mt-0.5 px-1.5 py-0.5 rounded text-xs font-medium ${e.severity===`must`?`bg-red-50 text-red-600`:e.severity===`should`?`bg-yellow-50 text-yellow-600`:`bg-gray-100 text-gray-500`}`,children:e.severity||`rule`}),(0,B.jsx)(`span`,{children:e.rule||String(e)})]},t)),y.quality_standards.length>5&&(0,B.jsxs)(`p`,{className:`text-xs text-gray-400`,children:[`...还有 `,y.quality_standards.length-5,` 条`]})]})]})]})})]}):(0,B.jsxs)(`div`,{className:`text-center py-12 bg-white rounded-xl border border-gray-200`,children:[(0,B.jsx)(Wc,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,B.jsx)(`p`,{className:`text-gray-500 text-sm`,children:`尚未生成蒸馏规范`}),(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:v.length>0?`点击「生成蒸馏规范」将绑定的规范融合为项目专属规范`:`请先绑定至少一个规范,再生成蒸馏规范`})]})})]})}var Q9={local:`bg-blue-50 text-blue-700`,remote:`bg-purple-50 text-purple-700`,generated:`bg-green-50 text-green-700`,official:`bg-amber-50 text-amber-700`,user:`bg-pink-50 text-pink-700`},$9={local:`本地`,remote:`远程`,generated:`AI生成`,official:`官方`,user:`用户`};function Aue(){let[e,t]=(0,z.useState)(`list`),[n,r]=(0,z.useState)(``),[i,a]=(0,z.useState)(``),[o,s]=(0,z.useState)(new Set),[c,l]=(0,z.useState)(``),[u,d]=(0,z.useState)(null),[f,p]=(0,z.useState)(!1),[m,h]=(0,z.useState)(null),[g,_]=(0,z.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),v=qe(),{data:y,isLoading:b}=ct({queryKey:[`skills`,n,i],queryFn:()=>tu({source:n||void 0,tag:i||void 0}).then(e=>e.data),refetchInterval:3e4}),{data:x}=ct({queryKey:[`skills-status`],queryFn:()=>nu().then(e=>e.data),refetchInterval:3e4}),S=lt({mutationFn:e=>iu(e).then(e=>e.data),onSuccess:e=>{d(e),Yc(`找到 ${e.github.length+e.npm.length} 个结果`,`success`)}}),C=lt({mutationFn:e=>au(e).then(e=>e.data),onSuccess:e=>{Yc(`已安装: ${e.skill.name}`,`success`),v.invalidateQueries({queryKey:[`skills`]}),v.invalidateQueries({queryKey:[`skills-status`]})}}),w=lt({mutationFn:e=>ou(e).then(e=>e.data),onSuccess:(e,t)=>{Yc(`已删除: ${t}`,`success`),s(e=>{let n=new Set(e);return n.delete(t),n}),v.invalidateQueries({queryKey:[`skills`]}),v.invalidateQueries({queryKey:[`skills-status`]})}}),T=lt({mutationFn:e=>su(e).then(e=>e.data),onSuccess:e=>{Yc(`已删除 ${e.success.length} 个技能`,`success`),s(new Set),v.invalidateQueries({queryKey:[`skills`]}),v.invalidateQueries({queryKey:[`skills-status`]})}}),E=lt({mutationFn:()=>cu().then(e=>e.data),onSuccess:e=>{Yc(`进化完成:${e.repaired.length+e.retired.length+e.optimized.length+e.generated.length} 项变更`,`success`),v.invalidateQueries({queryKey:[`skills`]}),v.invalidateQueries({queryKey:[`skills-status`]})}}),D=lt({mutationFn:()=>lu().then(e=>e.data),onSuccess:e=>{Yc(`蒸馏完成:新增 ${e.distilled.length} 个技能`,`success`),v.invalidateQueries({queryKey:[`skills`]}),v.invalidateQueries({queryKey:[`skills-status`]})}}),O=lt({mutationFn:()=>uu().then(e=>e.data),onSuccess:e=>{Yc(`修复完成:${e.repaired.length} 个技能已修复`,`success`),v.invalidateQueries({queryKey:[`skills`]})}}),k=y?.items||[],A=k.length>0&&o.size===k.length,j=e=>{s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`技能管理`}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:`管理 Claude Code 技能库,搜索安装、进化优化`})]}),x&&(0,B.jsx)(`div`,{className:`flex items-center gap-3`,children:[{label:`全部`,value:x.total,color:`text-gray-700`},{label:`官方`,value:x.official,color:`text-amber-600`},{label:`本地`,value:x.local,color:`text-blue-600`},{label:`AI生成`,value:x.generated,color:`text-green-600`}].map(({label:e,value:t,color:n})=>(0,B.jsxs)(`div`,{className:`text-center`,children:[(0,B.jsx)(`div`,{className:q(`text-xl font-bold`,n),children:t}),(0,B.jsx)(`div`,{className:`text-xs text-gray-500`,children:e})]},e))})]}),(0,B.jsx)(`div`,{className:`border-b border-gray-200`,children:(0,B.jsx)(`nav`,{className:`flex gap-1`,children:[{key:`list`,label:`技能列表`},{key:`search`,label:`搜索安装`},{key:`evolve`,label:`进化管理`},{key:`sources`,label:`技能源`}].map(n=>(0,B.jsx)(`button`,{onClick:()=>t(n.key),className:q(`px-4 py-2.5 text-sm font-medium border-b-2 transition-colors`,e===n.key?`border-blue-600 text-blue-600`:`border-transparent text-gray-500 hover:text-gray-700`),children:n.label},n.key))})}),e===`list`&&(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsxs)(`button`,{onClick:()=>p(!f),className:q(`flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg transition-colors`,f?`bg-blue-50 text-blue-600`:`text-gray-600 hover:bg-gray-50`),children:[(0,B.jsx)(oc,{className:`h-4 w-4`}),`筛选`,(0,B.jsx)(Rs,{className:q(`h-3.5 w-3.5 transition-transform`,f&&`rotate-180`)})]}),(0,B.jsxs)(`span`,{className:`text-sm text-gray-500`,children:[k.length,` 个技能`]}),o.size>0&&(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,B.jsxs)(`span`,{className:`text-sm text-gray-600`,children:[`已选 `,o.size,` 个`]}),(0,B.jsxs)(`button`,{onClick:()=>{_({open:!0,title:`批量删除技能`,description:`确定要删除选中的 ${o.size} 个技能吗?此操作不可恢复。`,onConfirm:()=>{T.mutate(Array.from(o)),_(e=>({...e,open:!1}))}})},disabled:T.isPending,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-red-50 text-red-600 hover:bg-red-100 rounded-lg transition-colors`,children:[(0,B.jsx)(Lc,{className:`h-3.5 w-3.5`}),`批量删除`]})]})]}),f&&(0,B.jsxs)(`div`,{className:`flex gap-3 mt-3 pt-3 border-t border-gray-100`,children:[(0,B.jsxs)(`select`,{value:n,onChange:e=>r(e.target.value),className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,B.jsx)(`option`,{value:``,children:`全部来源`}),(0,B.jsx)(`option`,{value:`local`,children:`本地`}),(0,B.jsx)(`option`,{value:`official`,children:`官方`}),(0,B.jsx)(`option`,{value:`remote`,children:`远程`}),(0,B.jsx)(`option`,{value:`generated`,children:`AI生成`}),(0,B.jsx)(`option`,{value:`user`,children:`用户`})]}),(0,B.jsx)(`input`,{type:`text`,placeholder:`按标签筛选...`,value:i,onChange:e=>a(e.target.value),className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]})]}),b?(0,B.jsx)(`div`,{className:`flex items-center justify-center h-48`,children:(0,B.jsx)(pc,{className:`h-8 w-8 animate-spin text-blue-500`})}):(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 overflow-hidden`,children:[(0,B.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,B.jsx)(`thead`,{className:`bg-gray-50 border-b border-gray-200`,children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{className:`w-10 px-4 py-3`,children:(0,B.jsx)(`input`,{type:`checkbox`,checked:A,onChange:()=>{s(A?new Set:new Set(k.map(e=>e.name)))},className:`rounded`})}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`技能名称`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`来源`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`版本`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`调用次数`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`成功率`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`最近使用`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`操作`})]})}),(0,B.jsx)(`tbody`,{className:`divide-y divide-gray-100`,children:k.map(e=>(0,B.jsxs)(`tr`,{className:`hover:bg-gray-50 transition-colors`,children:[(0,B.jsx)(`td`,{className:`px-4 py-3`,children:(0,B.jsx)(`input`,{type:`checkbox`,checked:o.has(e.name),onChange:()=>j(e.name),className:`rounded`})}),(0,B.jsxs)(`td`,{className:`px-4 py-3`,children:[(0,B.jsx)(`button`,{onClick:()=>h(e.name),className:`font-medium text-blue-600 hover:text-blue-700 cursor-pointer`,children:e.name}),(0,B.jsx)(`div`,{className:`text-xs text-gray-500 truncate max-w-xs`,children:e.description}),e.tags&&e.tags.length>0&&(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1`,children:e.tags.map(e=>(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 px-1.5 py-0.5 bg-gray-100 text-gray-600 text-xs rounded`,children:[(0,B.jsx)(Pc,{className:`h-2.5 w-2.5`}),e]},e))})]}),(0,B.jsx)(`td`,{className:`px-4 py-3`,children:(0,B.jsx)(`span`,{className:q(`px-2 py-0.5 text-xs rounded-full font-medium`,Q9[e.source]||`bg-gray-100 text-gray-600`),children:$9[e.source]||e.source})}),(0,B.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.version}),(0,B.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.stats.callCount}),(0,B.jsx)(`td`,{className:`px-4 py-3`,children:e.stats.callCount>0?(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(`div`,{className:`w-16 h-1.5 bg-gray-200 rounded-full overflow-hidden`,children:(0,B.jsx)(`div`,{className:q(`h-full rounded-full`,e.stats.successRate>=.8?`bg-green-500`:e.stats.successRate>=.5?`bg-yellow-500`:`bg-red-500`),style:{width:`${e.stats.successRate*100}%`}})}),(0,B.jsxs)(`span`,{className:`text-xs text-gray-600`,children:[(e.stats.successRate*100).toFixed(0),`%`]})]}):(0,B.jsx)(`span`,{className:`text-xs text-gray-400`,children:`未使用`})}),(0,B.jsx)(`td`,{className:`px-4 py-3 text-xs text-gray-500`,children:e.stats.lastUsed?new Date(e.stats.lastUsed).toLocaleDateString(`zh-CN`):`—`}),(0,B.jsx)(`td`,{className:`px-4 py-3`,children:(0,B.jsx)(`button`,{onClick:()=>{_({open:!0,title:`删除技能`,description:`确定要删除技能 "${e.name}" 吗?此操作不可恢复。`,onConfirm:()=>{w.mutate(e.name),_(e=>({...e,open:!1}))}})},disabled:w.isPending,className:`p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors`,title:`删除`,children:(0,B.jsx)(Lc,{className:`h-4 w-4`})})})]},e.name))})]}),k.length===0&&(0,B.jsxs)(`div`,{className:`text-center py-12`,children:[(0,B.jsx)(_c,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,B.jsx)(`p`,{className:`text-gray-500`,children:`暂无技能`})]})]}),x&&(x.topUsed.length>0||x.topRated.length>0)&&(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[x.topUsed.length>0&&(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,B.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3 flex items-center gap-2`,children:[(0,B.jsx)(Rc,{className:`h-4 w-4 text-blue-500`}),`最常用技能`]}),(0,B.jsx)(`div`,{className:`space-y-2`,children:x.topUsed.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`text-xs text-gray-400 w-4`,children:t+1}),(0,B.jsx)(`span`,{className:`text-gray-700`,children:e.name})]}),(0,B.jsxs)(`span`,{className:`text-gray-500`,children:[e.calls,` 次`]})]},e.name))})]}),x.topRated.length>0&&(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,B.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3 flex items-center gap-2`,children:[(0,B.jsx)(Ws,{className:`h-4 w-4 text-green-500`}),`评分最高技能`]}),(0,B.jsx)(`div`,{className:`space-y-2`,children:x.topRated.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`text-xs text-gray-400 w-4`,children:t+1}),(0,B.jsx)(`span`,{className:`text-gray-700`,children:e.name})]}),(0,B.jsxs)(`span`,{className:`text-gray-500`,children:[(e.rating*100).toFixed(0),`%`]})]},e.name))})]})]})]}),e===`search`&&(0,B.jsx)(Mue,{searchQuery:c,setSearchQuery:l,searchResults:u,onSearch:()=>S.mutate(c),onInstall:e=>C.mutate(e),isSearching:S.isPending,isInstalling:C.isPending}),e===`evolve`&&(0,B.jsx)(Nue,{onEvolve:()=>E.mutate(),onDistill:()=>D.mutate(),onRepair:()=>O.mutate(),isEvolving:E.isPending,isDistilling:D.isPending,isRepairing:O.isPending,evolveResult:E.data,distillResult:D.data,repairResult:O.data}),e===`sources`&&(0,B.jsx)(Pue,{}),m&&(0,B.jsx)(jue,{name:m,onClose:()=>h(null)}),(0,B.jsx)(E4,{open:g.open,title:g.title,description:g.description,onConfirm:g.onConfirm,onCancel:()=>_(e=>({...e,open:!1}))})]})}function jue({name:e,onClose:t}){let[n,r]=(0,z.useState)(`content`),{data:i,isLoading:a}=ct({queryKey:[`skill-detail`,e],queryFn:()=>ru(e).then(e=>e.data)});return(0,B.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/40`,onClick:t,children:(0,B.jsxs)(`div`,{className:`bg-white rounded-2xl shadow-2xl w-full max-w-3xl max-h-[85vh] flex flex-col`,onClick:e=>e.stopPropagation(),children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between px-6 py-4 border-b border-gray-100`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(_c,{className:`h-5 w-5 text-blue-500`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-lg font-semibold text-gray-900`,children:e}),i&&(0,B.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:i.description})]})]}),(0,B.jsx)(`button`,{onClick:t,className:`p-1.5 text-gray-400 hover:text-gray-600 rounded-lg transition-colors`,children:(0,B.jsx)(Uc,{className:`h-5 w-5`})})]}),(0,B.jsx)(`div`,{className:`flex gap-1 px-6 pt-3 border-b border-gray-100`,children:[`content`,`stats`].map(e=>(0,B.jsx)(`button`,{onClick:()=>r(e),className:`px-3 py-1.5 text-sm font-medium border-b-2 transition-colors ${n===e?`border-blue-600 text-blue-600`:`border-transparent text-gray-500 hover:text-gray-700`}`,children:e===`content`?`技能内容`:`使用情况`},e))}),(0,B.jsx)(`div`,{className:`flex-1 overflow-y-auto px-6 py-5`,children:a?(0,B.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,B.jsx)(pc,{className:`h-6 w-6 animate-spin text-blue-500`})}):i?n===`content`?(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[(0,B.jsx)(`span`,{className:`px-2 py-0.5 text-xs rounded-full font-medium ${Q9[i.source]||`bg-gray-100 text-gray-600`}`,children:$9[i.source]||i.source}),(0,B.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`v`,i.version]}),i.requires?.bins&&i.requires.bins.length>0&&(0,B.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`需要:`,i.requires.bins.join(`, `)]}),i.filePath&&(0,B.jsx)(`span`,{className:`text-xs text-gray-400 font-mono truncate max-w-xs`,children:i.filePath})]}),i.tags&&i.tags.length>0&&(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.tags.map(e=>(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 bg-blue-50 text-blue-700 text-xs rounded-full`,children:[(0,B.jsx)(Pc,{className:`h-2.5 w-2.5`}),e]},e))}),i.content?(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`text-xs text-gray-500 mb-2 flex items-center gap-1`,children:[(0,B.jsx)(ic,{className:`h-3.5 w-3.5`}),`技能文件内容`]}),(0,B.jsx)(`pre`,{className:`text-xs text-gray-800 bg-gray-50 rounded-lg p-4 overflow-auto whitespace-pre-wrap border border-gray-200 max-h-[50vh] leading-relaxed`,children:i.content})]}):(0,B.jsx)(`div`,{className:`text-center py-8 text-gray-400 text-sm`,children:`暂无文件内容`}),i.sourceUrl&&(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm`,children:[(0,B.jsx)($s,{className:`h-3.5 w-3.5 text-gray-400`}),(0,B.jsx)(`a`,{href:i.sourceUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-600 hover:underline truncate`,children:i.sourceUrl})]})]}):(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsxs)(`div`,{className:`grid grid-cols-3 gap-4`,children:[(0,B.jsxs)(`div`,{className:`bg-blue-50 rounded-xl p-4 text-center`,children:[(0,B.jsx)(`div`,{className:`text-2xl font-bold text-blue-700`,children:i.stats.callCount}),(0,B.jsx)(`div`,{className:`text-xs text-blue-600 mt-1`,children:`总调用次数`})]}),(0,B.jsxs)(`div`,{className:`bg-green-50 rounded-xl p-4 text-center`,children:[(0,B.jsx)(`div`,{className:`text-2xl font-bold text-green-700`,children:i.stats.callCount>0?`${(i.stats.successRate*100).toFixed(0)}%`:`—`}),(0,B.jsx)(`div`,{className:`text-xs text-green-600 mt-1`,children:`成功率`})]}),(0,B.jsxs)(`div`,{className:`bg-purple-50 rounded-xl p-4 text-center`,children:[(0,B.jsx)(`div`,{className:`text-2xl font-bold text-purple-700`,children:i.stats.userFeedback.positive+i.stats.userFeedback.negative>0?`${i.stats.userFeedback.positive} / ${i.stats.userFeedback.negative}`:`—`}),(0,B.jsx)(`div`,{className:`text-xs text-purple-600 mt-1`,children:`用户反馈(正向/负向)`})]})]}),i.stats.callCount>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`flex justify-between text-xs text-gray-500 mb-1.5`,children:[(0,B.jsx)(`span`,{children:`成功率`}),(0,B.jsxs)(`span`,{children:[(i.stats.successRate*100).toFixed(1),`%`]})]}),(0,B.jsx)(`div`,{className:`w-full h-2 bg-gray-200 rounded-full overflow-hidden`,children:(0,B.jsx)(`div`,{className:`h-full rounded-full transition-all ${i.stats.successRate>=.8?`bg-green-500`:i.stats.successRate>=.5?`bg-yellow-500`:`bg-red-500`}`,style:{width:`${i.stats.successRate*100}%`}})})]}),(0,B.jsxs)(`div`,{className:`bg-gray-50 rounded-xl p-4`,children:[(0,B.jsx)(`div`,{className:`text-xs text-gray-500 mb-1`,children:`最近使用时间`}),(0,B.jsx)(`div`,{className:`text-sm font-medium text-gray-900`,children:i.stats.lastUsed?new Date(i.stats.lastUsed).toLocaleString(`zh-CN`):`从未使用`})]}),i.stats.callCount===0&&(0,B.jsx)(`div`,{className:`text-center py-8 text-gray-400 text-sm`,children:`该技能尚未被调用过`})]}):(0,B.jsx)(`div`,{className:`text-center py-16 text-gray-500`,children:`技能不存在`})})]})})}function Mue({searchQuery:e,setSearchQuery:t,searchResults:n,onSearch:r,onInstall:i,isSearching:a,isInstalling:o}){return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:(0,B.jsxs)(`div`,{className:`flex gap-3`,children:[(0,B.jsx)(`input`,{type:`text`,placeholder:`搜索技能(GitHub / npm)...`,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>e.key===`Enter`&&r(),className:`flex-1 px-4 py-2.5 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,B.jsxs)(`button`,{onClick:r,disabled:a||!e.trim(),className:`flex items-center gap-2 px-6 py-2.5 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,children:[a?(0,B.jsx)(pc,{className:`h-4 w-4 animate-spin`}):(0,B.jsx)(Ec,{className:`h-4 w-4`}),`搜索`]})]})}),n&&(0,B.jsxs)(`div`,{className:`space-y-6`,children:[n.github.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3`,children:[`GitHub 结果 (`,n.github.length,`)`]}),(0,B.jsx)(`div`,{className:`grid gap-3`,children:n.github.map((e,t)=>(0,B.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4 hover:border-blue-300 transition-colors`,children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,B.jsx)(`h4`,{className:`font-semibold text-gray-900`,children:e.skill.name}),(0,B.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`v`,e.skill.version]})]}),(0,B.jsx)(`p`,{className:`text-sm text-gray-600 mb-2`,children:e.skill.description}),(0,B.jsxs)(`a`,{href:e.sourceUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-xs text-blue-600 hover:underline`,children:[(0,B.jsx)($s,{className:`h-3 w-3`}),e.sourceUrl]})]}),(0,B.jsxs)(`button`,{onClick:()=>i(e.sourceUrl),disabled:o,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-blue-50 text-blue-600 hover:bg-blue-100 rounded-lg transition-colors`,children:[(0,B.jsx)(Qs,{className:`h-3.5 w-3.5`}),`安装`]})]})},t))})]}),n.npm.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3`,children:[`npm 结果 (`,n.npm.length,`)`]}),(0,B.jsx)(`div`,{className:`grid gap-3`,children:n.npm.map((e,t)=>(0,B.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4 hover:border-purple-300 transition-colors`,children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,B.jsx)(`h4`,{className:`font-semibold text-gray-900`,children:e.skill.name}),(0,B.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`v`,e.skill.version]})]}),(0,B.jsx)(`p`,{className:`text-sm text-gray-600 mb-2`,children:e.skill.description}),e.installCommand&&(0,B.jsx)(`code`,{className:`text-xs bg-gray-100 px-2 py-1 rounded`,children:e.installCommand})]}),(0,B.jsxs)(`button`,{onClick:()=>i(e.sourceUrl),disabled:o,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-purple-50 text-purple-600 hover:bg-purple-100 rounded-lg transition-colors`,children:[(0,B.jsx)(Qs,{className:`h-3.5 w-3.5`}),`安装`]})]})},t))})]}),n.github.length===0&&n.npm.length===0&&(0,B.jsxs)(`div`,{className:`text-center py-12 bg-white rounded-xl border border-gray-200`,children:[(0,B.jsx)(Ec,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,B.jsx)(`p`,{className:`text-gray-500`,children:`未找到匹配的技能`})]})]})]})}function Nue({onEvolve:e,onDistill:t,onRepair:n,isEvolving:r,isDistilling:i,isRepairing:a,evolveResult:o,distillResult:s,repairResult:c}){return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`grid grid-cols-3 gap-4`,children:[(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,B.jsx)(`div`,{className:`p-2 bg-blue-50 rounded-lg`,children:(0,B.jsx)(Ac,{className:`h-5 w-5 text-blue-600`})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`技能进化`}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500`,children:`淘汰、优化、生成`})]})]}),(0,B.jsxs)(`button`,{onClick:e,disabled:r,className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:[r?(0,B.jsx)(pc,{className:`h-4 w-4 animate-spin`}):(0,B.jsx)(Cc,{className:`h-4 w-4`}),r?`进化中...`:`开始进化`]}),o&&(0,B.jsxs)(`div`,{className:`mt-4 space-y-2 text-sm`,children:[o.repaired?.length>0&&(0,B.jsxs)(`div`,{className:`text-green-600`,children:[`✔ 修复 `,o.repaired.length,` 个`]}),o.retired?.length>0&&(0,B.jsxs)(`div`,{className:`text-red-600`,children:[`- 淘汰 `,o.retired.length,` 个`]}),o.optimized?.length>0&&(0,B.jsxs)(`div`,{className:`text-blue-600`,children:[`↑ 优化 `,o.optimized.length,` 个`]}),o.generated?.length>0&&(0,B.jsxs)(`div`,{className:`text-green-600`,children:[`+ 生成 `,o.generated.length,` 个`]})]})]}),(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,B.jsx)(`div`,{className:`p-2 bg-purple-50 rounded-lg`,children:(0,B.jsx)(Qs,{className:`h-5 w-5 text-purple-600`})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`社区蒸馏`}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500`,children:`从精选源采集`})]})]}),(0,B.jsxs)(`button`,{onClick:t,disabled:i,className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-purple-600 text-white rounded-lg hover:bg-purple-700 disabled:opacity-50 transition-colors`,children:[i?(0,B.jsx)(pc,{className:`h-4 w-4 animate-spin`}):(0,B.jsx)(Qs,{className:`h-4 w-4`}),i?`蒸馏中...`:`开始蒸馏`]}),s&&s.distilled?.length>0&&(0,B.jsxs)(`div`,{className:`mt-4 text-sm text-purple-600`,children:[`✦ 新增 `,s.distilled.length,` 个技能`]})]}),(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,B.jsx)(`div`,{className:`p-2 bg-amber-50 rounded-lg`,children:(0,B.jsx)(Hc,{className:`h-5 w-5 text-amber-600`})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`修复残缺`}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500`,children:`AI 修复低质量技能`})]})]}),(0,B.jsxs)(`button`,{onClick:n,disabled:a,className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-amber-600 text-white rounded-lg hover:bg-amber-700 disabled:opacity-50 transition-colors`,children:[a?(0,B.jsx)(pc,{className:`h-4 w-4 animate-spin`}):(0,B.jsx)(Hc,{className:`h-4 w-4`}),a?`修复中...`:`开始修复`]}),c&&c.repaired?.length>0&&(0,B.jsxs)(`div`,{className:`mt-4 text-sm text-amber-600`,children:[`✔ 修复 `,c.repaired.length,` 个技能`]})]})]}),(0,B.jsxs)(`div`,{className:`bg-blue-50 rounded-xl border border-blue-200 p-4`,children:[(0,B.jsx)(`h4`,{className:`text-sm font-semibold text-blue-900 mb-2`,children:`进化机制说明`}),(0,B.jsxs)(`ul`,{className:`text-sm text-blue-700 space-y-1`,children:[(0,B.jsxs)(`li`,{children:[`• `,(0,B.jsx)(`strong`,{children:`技能进化`}),`:根据使用统计自动淘汰低效技能、优化高频技能、生成新技能`]}),(0,B.jsxs)(`li`,{children:[`• `,(0,B.jsx)(`strong`,{children:`社区蒸馏`}),`:从 GitHub 精选仓库采集优质技能并蒸馏为官方技能`]}),(0,B.jsxs)(`li`,{children:[`• `,(0,B.jsx)(`strong`,{children:`修复残缺`}),`:检测并修复缺少描述、版本号或格式错误的技能文件`]})]})]})]})}function Pue(){let e=qe(),[t,n]=(0,z.useState)(!1),[r,i]=(0,z.useState)({repo:``,dir:``,branch:`main`,format:`command-md`,description:``}),{data:a}=ct({queryKey:[`skill-sources`],queryFn:()=>W.get(`/skills/sources`).then(e=>e.data)}),o=lt({mutationFn:e=>W.post(`/skills/sources`,e).then(e=>e.data),onSuccess:()=>{Yc(`技能源已添加`,`success`),n(!1),i({repo:``,dir:``,branch:`main`,format:`command-md`,description:``}),e.invalidateQueries({queryKey:[`skill-sources`]})}}),s=lt({mutationFn:e=>W.delete(`/skills/sources/${encodeURIComponent(e)}`).then(e=>e.data),onSuccess:()=>{Yc(`技能源已删除`,`success`),e.invalidateQueries({queryKey:[`skill-sources`]})}}),c=a?.builtIn||[],l=a?.user||[];return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(`div`,{className:`flex justify-end`,children:(0,B.jsxs)(`button`,{onClick:()=>n(!t),className:`flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors`,children:[(0,B.jsx)(Qs,{className:`h-4 w-4`}),`添加技能源`]})}),t&&(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:[(0,B.jsx)(`h3`,{className:`font-semibold text-gray-900 mb-4`,children:`添加自定义技能源`}),(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,B.jsx)(`input`,{type:`text`,placeholder:`仓库 (owner/repo)`,value:r.repo,onChange:e=>i({...r,repo:e.target.value}),className:`px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,B.jsx)(`input`,{type:`text`,placeholder:`目录路径`,value:r.dir,onChange:e=>i({...r,dir:e.target.value}),className:`px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,B.jsx)(`input`,{type:`text`,placeholder:`分支 (默认 main)`,value:r.branch,onChange:e=>i({...r,branch:e.target.value}),className:`px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,B.jsxs)(`select`,{value:r.format,onChange:e=>i({...r,format:e.target.value}),className:`px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,B.jsx)(`option`,{value:`command-md`,children:`command-md`}),(0,B.jsx)(`option`,{value:`skill-md`,children:`skill-md`})]}),(0,B.jsx)(`input`,{type:`text`,placeholder:`描述`,value:r.description,onChange:e=>i({...r,description:e.target.value}),className:`col-span-2 px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,B.jsxs)(`div`,{className:`flex gap-2 mt-4`,children:[(0,B.jsx)(`button`,{onClick:()=>o.mutate(r),disabled:!r.repo||!r.dir||o.isPending,className:`px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:o.isPending?`添加中...`:`确认添加`}),(0,B.jsx)(`button`,{onClick:()=>n(!1),className:`px-4 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors`,children:`取消`})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3`,children:`内置技能源`}),(0,B.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 divide-y divide-gray-100`,children:c.map((e,t)=>(0,B.jsxs)(`div`,{className:`p-4 flex items-center justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`font-medium text-gray-900`,children:[e.repo,`/`,e.dir]}),(0,B.jsx)(`div`,{className:`text-sm text-gray-500`,children:e.description})]}),(0,B.jsx)(`span`,{className:`px-2 py-1 bg-gray-100 text-gray-600 text-xs rounded`,children:`内置`})]},t))})]}),l.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3`,children:`用户自定义源`}),(0,B.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 divide-y divide-gray-100`,children:l.map((e,t)=>(0,B.jsxs)(`div`,{className:`p-4 flex items-center justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`font-medium text-gray-900`,children:[e.repo,`/`,e.dir]}),(0,B.jsx)(`div`,{className:`text-sm text-gray-500`,children:e.description})]}),(0,B.jsx)(`button`,{onClick:()=>s.mutate(e.repo),disabled:s.isPending,className:`p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors`,children:(0,B.jsx)(Lc,{className:`h-4 w-4`})})]},t))})]})]})}function Fue(){let[e,t]=(0,z.useState)(`library`),[n,r]=(0,z.useState)(`all`),[i,a]=(0,z.useState)(``),[o,s]=(0,z.useState)(new Set),[c,l]=(0,z.useState)(null),[u,d]=(0,z.useState)(``),[f,p]=(0,z.useState)(!1),[m,h]=(0,z.useState)(null),g=qe(),{data:_,isLoading:v}=ct({queryKey:[`global-conventions`],queryFn:()=>du().then(e=>e.data),refetchInterval:6e4}),{data:y}=ct({queryKey:[`convention-usage-stats`],queryFn:()=>gu().then(e=>e.data),enabled:e===`usage`}),b=lt({mutationFn:()=>pu().then(e=>e.data),onSuccess:e=>{Yc(e.added.length+e.updated.length>0?`同步完成:新增 ${e.added.length},更新 ${e.updated.length}`:`已是最新`,`success`),g.invalidateQueries({queryKey:[`global-conventions`]})}}),x=lt({mutationFn:e=>mu(e).then(e=>e.data),onSuccess:e=>{Yc(`已安装:${e.convention.name}`,`success`),d(``),p(!1),g.invalidateQueries({queryKey:[`global-conventions`]})}}),S=lt({mutationFn:e=>hu(e).then(e=>e.data),onSuccess:(e,t)=>{Yc(`规范已删除`,`success`),h(null),g.invalidateQueries({queryKey:[`global-conventions`]})}}),C=lt({mutationFn:e=>vu(e.length>0?e:void 0).then(e=>e.data),onSuccess:e=>{Yc(`进化完成:${e.results.success.length} 个规范已更新`,`success`),g.invalidateQueries({queryKey:[`global-conventions`]})}}),w=(_?.items||[]).filter(e=>!(n!==`all`&&e.source!==n||i&&!e.name.toLowerCase().includes(i.toLowerCase()))),T=e=>{s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},E=w.length>0&&o.size===w.length,D=()=>s(E?new Set:new Set(w.map(e=>e.id))),O={official:`bg-amber-50 text-amber-700`,user:`bg-blue-50 text-blue-700`,community:`bg-purple-50 text-purple-700`},k={official:`官方`,user:`用户`,community:`社区`};return(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`规范管理`}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:`管理全局规范模板,绑定到项目,追踪使用情况`})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsxs)(`button`,{onClick:()=>b.mutate(),disabled:b.isPending,className:`flex items-center gap-1.5 px-3 py-2 text-sm bg-amber-50 text-amber-700 hover:bg-amber-100 rounded-lg transition-colors`,children:[(0,B.jsx)(Cc,{className:`h-4 w-4 ${b.isPending?`animate-spin`:``}`}),`同步官方规范`]}),(0,B.jsxs)(`button`,{onClick:()=>p(!f),className:`flex items-center gap-1.5 px-3 py-2 text-sm bg-blue-600 text-white hover:bg-blue-700 rounded-lg transition-colors`,children:[(0,B.jsx)(Qs,{className:`h-4 w-4`}),`从 URL 安装`]})]})]}),f&&(0,B.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:(0,B.jsxs)(`div`,{className:`flex gap-3`,children:[(0,B.jsx)(`input`,{type:`text`,placeholder:`规范 YAML 文件 URL...`,value:u,onChange:e=>d(e.target.value),onKeyDown:e=>e.key===`Enter`&&u.trim()&&x.mutate(u.trim()),className:`flex-1 px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,B.jsx)(`button`,{onClick:()=>x.mutate(u.trim()),disabled:!u.trim()||x.isPending,className:`px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:x.isPending?`安装中...`:`安装`}),(0,B.jsx)(`button`,{onClick:()=>p(!1),className:`p-2 text-gray-400 hover:text-gray-600 rounded-lg`,children:(0,B.jsx)(Uc,{className:`h-4 w-4`})})]})}),(0,B.jsx)(`div`,{className:`border-b border-gray-200`,children:(0,B.jsx)(`nav`,{className:`flex gap-1`,children:[{key:`library`,label:`规范库`},{key:`usage`,label:`使用统计`},{key:`evolution`,label:`进化历史`}].map(n=>(0,B.jsx)(`button`,{onClick:()=>t(n.key),className:`px-4 py-2.5 text-sm font-medium border-b-2 transition-colors ${e===n.key?`border-blue-600 text-blue-600`:`border-transparent text-gray-500 hover:text-gray-700`}`,children:n.label},n.key))})}),e===`library`&&(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4 flex items-center gap-3 flex-wrap`,children:[(0,B.jsx)(`div`,{className:`flex gap-1`,children:[`all`,`official`,`user`,`community`].map(e=>(0,B.jsx)(`button`,{onClick:()=>r(e),className:`px-3 py-1.5 text-xs rounded-lg transition-colors ${n===e?`bg-blue-600 text-white`:`bg-gray-100 text-gray-600 hover:bg-gray-200`}`,children:{all:`全部`,official:`官方`,user:`用户`,community:`社区`}[e]},e))}),(0,B.jsxs)(`div`,{className:`relative`,children:[(0,B.jsx)(Ec,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-gray-400`}),(0,B.jsx)(`input`,{type:`text`,placeholder:`搜索规范名称...`,value:i,onChange:e=>a(e.target.value),className:`pl-8 pr-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 w-48`})]}),(0,B.jsxs)(`span`,{className:`text-sm text-gray-500`,children:[w.length,` 个规范`]}),o.size>0&&(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,B.jsxs)(`span`,{className:`text-sm text-gray-600`,children:[`已选 `,o.size,` 个`]}),(0,B.jsxs)(`button`,{onClick:()=>C.mutate(Array.from(o)),disabled:C.isPending,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-green-50 text-green-600 hover:bg-green-100 rounded-lg transition-colors`,children:[(0,B.jsx)(Cc,{className:`h-3.5 w-3.5 ${C.isPending?`animate-spin`:``}`}),`批量进化`]})]})]}),v?(0,B.jsx)(`div`,{className:`flex items-center justify-center h-48 bg-white rounded-xl border border-gray-200`,children:(0,B.jsx)(Cc,{className:`h-8 w-8 animate-spin text-blue-500`})}):(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 overflow-hidden`,children:[(0,B.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,B.jsx)(`thead`,{className:`bg-gray-50 border-b border-gray-200`,children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{className:`w-10 px-4 py-3`,children:(0,B.jsx)(`input`,{type:`checkbox`,checked:E,onChange:D,className:`rounded`})}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`规范名称`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`来源`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`版本`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`角色数`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`质量标准`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`操作`})]})}),(0,B.jsx)(`tbody`,{className:`divide-y divide-gray-100`,children:w.map(e=>(0,B.jsxs)(`tr`,{className:`hover:bg-gray-50 transition-colors`,children:[(0,B.jsx)(`td`,{className:`px-4 py-3`,children:(0,B.jsx)(`input`,{type:`checkbox`,checked:o.has(e.id),onChange:()=>T(e.id),className:`rounded`})}),(0,B.jsxs)(`td`,{className:`px-4 py-3`,children:[(0,B.jsx)(`button`,{onClick:()=>l(e.id),className:`font-medium text-blue-600 hover:text-blue-700 text-left`,children:e.name}),(0,B.jsx)(`div`,{className:`text-xs text-gray-500 truncate max-w-xs mt-0.5`,children:e.description})]}),(0,B.jsx)(`td`,{className:`px-4 py-3`,children:(0,B.jsx)(`span`,{className:`px-2 py-0.5 text-xs rounded-full font-medium ${O[e.source]||`bg-gray-100 text-gray-600`}`,children:k[e.source]||e.source})}),(0,B.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.version||`—`}),(0,B.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.roles?Object.keys(e.roles).length:0}),(0,B.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.quality_standards?.length||0}),(0,B.jsx)(`td`,{className:`px-4 py-3`,children:(0,B.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(`button`,{onClick:()=>l(e.id),className:`p-1.5 text-gray-400 hover:text-blue-500 rounded transition-colors`,title:`查看/编辑`,children:(0,B.jsx)(ic,{className:`h-4 w-4`})}),e.source!==`official`&&(0,B.jsx)(`button`,{onClick:()=>h(e),className:`p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors`,title:`删除`,children:(0,B.jsx)(Lc,{className:`h-4 w-4`})})]})})]},e.id))})]}),w.length===0&&(0,B.jsxs)(`div`,{className:`text-center py-12`,children:[(0,B.jsx)(As,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,B.jsx)(`p`,{className:`text-gray-500`,children:`暂无规范`}),(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:`点击「同步官方规范」获取内置规范`})]})]})]}),e===`usage`&&(0,B.jsx)(Iue,{data:y?.items||[]}),e===`evolution`&&(0,B.jsx)(Lue,{conventions:_?.items||[]}),c&&(0,B.jsx)(Rue,{id:c,onClose:()=>l(null)}),m&&(0,B.jsx)(E4,{title:`删除规范`,message:`确定要删除规范「${m.name}」吗?此操作不可撤销。`,onConfirm:()=>S.mutate(m.id),onCancel:()=>h(null)})]})}function Iue({data:e}){let[t,n]=(0,z.useState)(null);return(0,B.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 overflow-hidden`,children:e.length===0?(0,B.jsxs)(`div`,{className:`text-center py-12`,children:[(0,B.jsx)(Rc,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,B.jsx)(`p`,{className:`text-gray-500`,children:`暂无使用数据`})]}):(0,B.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,B.jsx)(`thead`,{className:`bg-gray-50 border-b border-gray-200`,children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`规范名称`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`来源`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`使用项目数`}),(0,B.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`操作`})]})}),(0,B.jsx)(`tbody`,{className:`divide-y divide-gray-100`,children:e.map(e=>(0,B.jsxs)(z.Fragment,{children:[(0,B.jsxs)(`tr`,{className:`hover:bg-gray-50 transition-colors`,children:[(0,B.jsx)(`td`,{className:`px-4 py-3 font-medium text-gray-900`,children:e.name}),(0,B.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.source}),(0,B.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.projectCount}),(0,B.jsx)(`td`,{className:`px-4 py-3`,children:(0,B.jsx)(`button`,{onClick:()=>n(t===e.id?null:e.id),className:`text-xs text-blue-600 hover:text-blue-700`,children:t===e.id?`收起`:`查看项目`})})]}),t===e.id&&(0,B.jsx)(`tr`,{children:(0,B.jsx)(`td`,{colSpan:4,className:`px-4 py-3 bg-gray-50`,children:(0,B.jsx)(`div`,{className:`text-xs text-gray-600 space-y-1`,children:e.projects.map((e,t)=>(0,B.jsx)(`div`,{className:`font-mono`,children:e},t))})})})]},e.id))})]})})}function Lue({conventions:e}){let[t,n]=(0,z.useState)(null),{data:r,isLoading:i}=ct({queryKey:[`convention-evolution`,t],queryFn:()=>t?_u(t).then(e=>e.data):null,enabled:!!t});return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,B.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-2`,children:`选择规范`}),(0,B.jsxs)(`select`,{value:t||``,onChange:e=>n(e.target.value||null),className:`w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,B.jsx)(`option`,{value:``,children:`— 请选择 —`}),e.map(e=>(0,B.jsxs)(`option`,{value:e.id,children:[e.name,` (v`,e.version,`)`]},e.id))]})]}),t&&(0,B.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:i?(0,B.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,B.jsx)(Cc,{className:`h-8 w-8 animate-spin text-blue-500`})}):!r||r.history.length===0?(0,B.jsxs)(`div`,{className:`text-center py-12`,children:[(0,B.jsx)(Ks,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,B.jsx)(`p`,{className:`text-gray-500`,children:`暂无进化记录`})]}):(0,B.jsx)(`div`,{className:`space-y-4`,children:r.history.map((e,t)=>(0,B.jsxs)(`div`,{className:`border-l-2 border-blue-200 pl-4 pb-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,B.jsx)(Us,{className:`h-4 w-4 text-green-500`}),(0,B.jsxs)(`span`,{className:`text-sm font-medium text-gray-900`,children:[e.previousVersion,` → `,e.newVersion]}),(0,B.jsx)(`span`,{className:`text-xs text-gray-500`,children:new Date(e.timestamp).toLocaleString(`zh-CN`)})]}),e.changes.length>0&&(0,B.jsx)(`ul`,{className:`text-sm text-gray-600 space-y-1 ml-6`,children:e.changes.map((e,t)=>(0,B.jsx)(`li`,{className:`list-disc`,children:e},t))})]},t))})})]})}function Rue({id:e,onClose:t}){let[n,r]=(0,z.useState)(``),[i,a]=(0,z.useState)(!1),o=qe(),{data:s,isLoading:c}=ct({queryKey:[`global-convention`,e],queryFn:()=>fu(e).then(e=>e.data)}),{data:l}=ct({queryKey:[`convention-yaml`,e],queryFn:()=>yu(e).then(e=>e.data),enabled:i});(0,z.useEffect)(()=>{l?.yaml!==void 0&&r(l.yaml)},[l]);let u=lt({mutationFn:t=>bu(e,t).then(e=>e.data),onSuccess:()=>{Yc(`保存成功`,`success`),a(!1),o.invalidateQueries({queryKey:[`global-convention`,e]}),o.invalidateQueries({queryKey:[`global-conventions`]})},onError:()=>{Yc(`保存失败`,`error`)}}),d=lt({mutationFn:()=>vu([e]).then(e=>e.data),onSuccess:t=>{t.results.success.length>0?(Yc(`规范已进化更新`,`success`),o.invalidateQueries({queryKey:[`global-convention`,e]}),o.invalidateQueries({queryKey:[`global-conventions`]})):Yc(`进化失败:`+(t.results.failed[0]?.error||`未知错误`),`error`)},onError:()=>{Yc(`进化失败`,`error`)}});if(c)return(0,B.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,children:(0,B.jsx)(`div`,{className:`bg-white rounded-xl p-8`,children:(0,B.jsx)(Cc,{className:`h-8 w-8 animate-spin text-blue-500 mx-auto`})})});if(!s)return null;let f=s.source===`official`;return(0,B.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4`,onClick:t,children:(0,B.jsxs)(`div`,{className:`bg-white rounded-xl max-w-4xl w-full max-h-[90vh] overflow-hidden flex flex-col`,onClick:e=>e.stopPropagation(),children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between p-6 border-b border-gray-200`,children:[(0,B.jsxs)(`div`,{className:`flex-1`,children:[(0,B.jsx)(`h2`,{className:`text-xl font-bold text-gray-900`,children:s.name}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:s.description})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 ml-4`,children:[(0,B.jsxs)(`button`,{onClick:()=>d.mutate(),disabled:d.isPending,className:`flex items-center gap-1.5 px-3 py-2 text-sm bg-green-50 text-green-600 hover:bg-green-100 rounded-lg transition-colors disabled:opacity-50`,title:`AI 进化优化`,children:[(0,B.jsx)(Cc,{className:`h-4 w-4 ${d.isPending?`animate-spin`:``}`}),d.isPending?`进化中...`:`手动进化`]}),(0,B.jsx)(`button`,{onClick:t,className:`p-2 text-gray-400 hover:text-gray-600 rounded-lg transition-colors`,children:(0,B.jsx)(Uc,{className:`h-5 w-5`})})]})]}),(0,B.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-6 space-y-4`,children:[(0,B.jsxs)(`div`,{className:`grid grid-cols-3 gap-4 text-sm`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`text-gray-500`,children:`版本`}),(0,B.jsx)(`div`,{className:`font-medium text-gray-900 mt-1`,children:s.version})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`text-gray-500`,children:`来源`}),(0,B.jsx)(`div`,{className:`font-medium text-gray-900 mt-1`,children:s.source===`official`?`官方`:s.source===`user`?`用户`:`社区`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`text-gray-500`,children:`角色数`}),(0,B.jsx)(`div`,{className:`font-medium text-gray-900 mt-1`,children:s.roles?Object.keys(s.roles).length:0})]})]}),i?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(`label`,{className:`text-sm font-medium text-gray-700`,children:`YAML 内容`}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsxs)(`button`,{onClick:()=>u.mutate(n),disabled:u.isPending,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:[(0,B.jsx)(Tc,{className:`h-3.5 w-3.5`}),u.isPending?`保存中...`:`保存`]}),(0,B.jsx)(`button`,{onClick:()=>a(!1),className:`px-3 py-1.5 text-sm bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors`,children:`取消`})]})]}),(0,B.jsx)(`textarea`,{value:n,onChange:e=>r(e.target.value),rows:20,className:`w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono`})]}):(0,B.jsxs)(`div`,{className:`space-y-4`,children:[s.principles&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`text-sm font-medium text-gray-700 mb-2`,children:`核心原则`}),(0,B.jsx)(`pre`,{className:`text-sm text-gray-600 bg-gray-50 p-3 rounded-lg overflow-x-auto whitespace-pre-wrap`,children:s.principles})]}),s.roles&&Object.keys(s.roles).length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`text-sm font-medium text-gray-700 mb-2`,children:`角色定义`}),(0,B.jsx)(`div`,{className:`space-y-2`,children:Object.entries(s.roles).map(([e,t])=>(0,B.jsxs)(`div`,{className:`bg-gray-50 p-3 rounded-lg`,children:[(0,B.jsx)(`div`,{className:`font-medium text-gray-900 text-sm`,children:t.name||e}),t.responsibilities&&(0,B.jsxs)(`div`,{className:`text-xs text-gray-600 mt-1`,children:[`职责:`,t.responsibilities]}),t.constraints&&(0,B.jsxs)(`div`,{className:`text-xs text-gray-500 mt-1`,children:[`约束:`,t.constraints]})]},e))})]}),s.quality_standards&&s.quality_standards.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`text-sm font-medium text-gray-700 mb-2`,children:`质量标准`}),(0,B.jsx)(`div`,{className:`space-y-1.5`,children:s.quality_standards.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-start gap-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`px-1.5 py-0.5 text-xs rounded font-medium ${e.severity===`must`?`bg-red-50 text-red-600`:e.severity===`should`?`bg-amber-50 text-amber-600`:`bg-blue-50 text-blue-600`}`,children:e.severity===`must`?`必须`:e.severity===`should`?`应该`:`可以`}),(0,B.jsxs)(`span`,{className:`text-gray-500`,children:[`[`,e.category,`]`]}),(0,B.jsx)(`span`,{className:`text-gray-700 flex-1`,children:e.rule})]},t))})]}),s.active_prompt&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`text-sm font-medium text-gray-700 mb-2`,children:`Active Prompt`}),(0,B.jsx)(`pre`,{className:`text-xs text-gray-600 bg-gray-50 p-3 rounded-lg overflow-x-auto whitespace-pre-wrap`,children:s.active_prompt})]}),!f&&(0,B.jsxs)(`button`,{onClick:()=>a(!0),className:`flex items-center gap-1.5 px-3 py-2 text-sm bg-blue-50 text-blue-600 hover:bg-blue-100 rounded-lg transition-colors`,children:[(0,B.jsx)(ic,{className:`h-4 w-4`}),`编辑 YAML`]})]})]})]})})}function zue(){let[e,t]=(0,z.useState)(null),[n,r]=(0,z.useState)(!1),[i,a]=(0,z.useState)(void 0),{data:o}=ct({queryKey:[`projects`],queryFn:Tl});(0,z.useEffect)(()=>{o?.data?.items?.[0]?.projectPath&&a(o.data.items[0].projectPath)},[o]);let{data:s,isLoading:c}=ct({queryKey:[`node-types`,i],queryFn:()=>xu(i),enabled:!!i}),{data:l,isLoading:u}=ct({queryKey:[`node-type`,e],queryFn:()=>Su(e),enabled:!!e}),d=s?.data.items||[],f=l?.data,p=e=>({analysis:`bg-blue-100 text-blue-700`,design:`bg-purple-100 text-purple-700`,implementation:`bg-green-100 text-green-700`,validation:`bg-orange-100 text-orange-700`})[e]||`bg-gray-100 text-gray-700`;return(0,B.jsxs)(`div`,{className:`p-6 max-w-7xl mx-auto`,children:[(0,B.jsxs)(`div`,{className:`mb-6`,children:[(0,B.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`流水线节点类型管理`}),(0,B.jsx)(`p`,{className:`text-sm text-gray-600 mt-1`,children:`浏览所有可用的节点类型,点击查看详细配置`})]}),c?(0,B.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,B.jsx)(pc,{className:`h-6 w-6 animate-spin text-gray-400`})}):(0,B.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-6`,children:[(0,B.jsx)(`div`,{className:`space-y-3`,children:d.map(n=>(0,B.jsxs)(`div`,{onClick:()=>{t(n.id),r(!1)},className:`p-4 border rounded-lg cursor-pointer transition-all ${e===n.id?`border-blue-500 bg-blue-50 shadow-sm`:`border-gray-200 hover:border-gray-300 hover:shadow-sm`}`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(Ms,{className:`h-5 w-5 text-gray-600`}),(0,B.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:n.name})]}),(0,B.jsx)(`span`,{className:`px-2 py-0.5 text-xs rounded-full ${p(n.semanticCategory)}`,children:n.semanticCategory})]}),(0,B.jsx)(`p`,{className:`text-sm text-gray-600 mt-2`,children:n.description}),(0,B.jsxs)(`div`,{className:`flex items-center gap-4 mt-3 text-xs text-gray-500`,children:[n.isBuiltin&&(0,B.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(Us,{className:`h-3 w-3`}),`内置`]}),n.defaultSkills.length>0&&(0,B.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(Wc,{className:`h-3 w-3`}),n.defaultSkills.length,` 个默认技能`]})]})]},n.id))}),(0,B.jsx)(`div`,{className:`lg:sticky lg:top-6 lg:self-start`,children:e?u?(0,B.jsx)(`div`,{className:`border border-gray-200 rounded-lg p-8 flex items-center justify-center`,children:(0,B.jsx)(pc,{className:`h-6 w-6 animate-spin text-gray-400`})}):f?(0,B.jsxs)(`div`,{className:`border border-gray-200 rounded-lg p-6 space-y-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,B.jsx)(`h2`,{className:`text-xl font-bold text-gray-900`,children:f.name}),(0,B.jsx)(`span`,{className:`px-2 py-1 text-xs rounded-full ${p(f.semanticCategory)}`,children:f.semanticCategory})]}),(0,B.jsx)(`p`,{className:`text-sm text-gray-600`,children:f.description}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 mt-2 text-xs text-gray-500`,children:[(0,B.jsx)(`code`,{className:`bg-gray-100 px-2 py-0.5 rounded`,children:f.id}),f.isBuiltin&&(0,B.jsxs)(`span`,{className:`flex items-center gap-1 text-green-600`,children:[(0,B.jsx)(Us,{className:`h-3 w-3`}),`内置节点`]})]})]}),f.defaultSkills.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-2 flex items-center gap-1`,children:[(0,B.jsx)(Wc,{className:`h-4 w-4`}),`默认技能`]}),(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:f.defaultSkills.map(e=>(0,B.jsx)(`span`,{className:`px-2 py-1 bg-blue-50 text-blue-700 text-xs rounded`,children:e},e))})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-2 flex items-center gap-1`,children:[(0,B.jsx)(Us,{className:`h-4 w-4`}),`完成条件`]}),(0,B.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[f.completion.explicitSignal&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`text-gray-600`,children:`显式信号:`}),(0,B.jsx)(`code`,{className:`ml-2 bg-gray-100 px-2 py-0.5 rounded text-xs`,children:f.completion.explicitSignal})]}),f.completion.requireWrite!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`text-gray-600`,children:`需要写入操作:`}),(0,B.jsx)(`span`,{className:`ml-2 text-gray-900`,children:f.completion.requireWrite?`是`:`否`})]}),f.completion.keywords.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`text-gray-600`,children:`关键词:`}),(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1`,children:f.completion.keywords.map((e,t)=>(0,B.jsx)(`code`,{className:`bg-gray-100 px-2 py-0.5 rounded text-xs`,children:e},t))})]}),f.completion.filePatterns.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`text-gray-600`,children:`文件模式:`}),(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1`,children:f.completion.filePatterns.map((e,t)=>(0,B.jsx)(`code`,{className:`bg-gray-100 px-2 py-0.5 rounded text-xs`,children:e},t))})]})]})]}),(f.activityThreshold.minToolCalls!==void 0||f.activityThreshold.stagnationStrategy)&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-2 flex items-center gap-1`,children:[(0,B.jsx)(ic,{className:`h-4 w-4`}),`活跃度阈值`]}),(0,B.jsxs)(`div`,{className:`space-y-1 text-sm`,children:[f.activityThreshold.minToolCalls!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`text-gray-600`,children:`最小工具调用次数:`}),(0,B.jsx)(`span`,{className:`ml-2 text-gray-900`,children:f.activityThreshold.minToolCalls})]}),f.activityThreshold.stagnationStrategy&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`text-gray-600`,children:`停滞策略:`}),(0,B.jsx)(`code`,{className:`ml-2 bg-gray-100 px-2 py-0.5 rounded text-xs`,children:f.activityThreshold.stagnationStrategy})]})]})]}),f.heuristic&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`button`,{onClick:()=>r(!n),className:`flex items-center gap-2 text-sm font-semibold text-gray-700 hover:text-gray-900`,children:[n?(0,B.jsx)(Vs,{className:`h-4 w-4`}):(0,B.jsx)(Rs,{className:`h-4 w-4`}),`原始配置(JSON)`]}),n&&(0,B.jsx)(`pre`,{className:`mt-2 p-3 bg-gray-50 rounded text-xs overflow-auto max-h-64`,children:JSON.stringify(f.heuristic,null,2)})]})]}):null:(0,B.jsxs)(`div`,{className:`border border-gray-200 rounded-lg p-8 text-center text-gray-500`,children:[(0,B.jsx)(Ms,{className:`h-12 w-12 mx-auto mb-3 text-gray-300`}),(0,B.jsx)(`p`,{children:`选择左侧节点类型查看详细信息`})]})})]})]})}function Bue(){return(0,B.jsx)(mx,{children:(0,B.jsxs)(Xc,{children:[(0,B.jsx)(dx,{}),(0,B.jsx)(ef,{children:(0,B.jsxs)(lr,{children:[(0,B.jsx)(sr,{path:`/`,element:(0,B.jsx)(or,{to:`/dashboard`,replace:!0})}),(0,B.jsx)(sr,{path:`/dashboard`,element:(0,B.jsx)(O4,{})}),(0,B.jsx)(sr,{path:`/sessions`,element:(0,B.jsx)(M4,{})}),(0,B.jsx)(sr,{path:`/sessions/:id`,element:(0,B.jsx)(P4,{})}),(0,B.jsx)(sr,{path:`/events`,element:(0,B.jsx)(r3,{})}),(0,B.jsx)(sr,{path:`/pipelines`,element:(0,B.jsx)(i3,{})}),(0,B.jsx)(sr,{path:`/pipelines/:id`,element:(0,B.jsx)(f3,{})}),(0,B.jsx)(sr,{path:`/projects`,element:(0,B.jsx)(Cue,{})}),(0,B.jsx)(sr,{path:`/projects/:encodedPath`,element:(0,B.jsx)(Oue,{})}),(0,B.jsx)(sr,{path:`/quality`,element:(0,B.jsx)(_3,{})}),(0,B.jsx)(sr,{path:`/analytics`,element:(0,B.jsx)(C3,{})}),(0,B.jsx)(sr,{path:`/knowledge`,element:(0,B.jsx)(Sue,{})}),(0,B.jsx)(sr,{path:`/skills`,element:(0,B.jsx)(Aue,{})}),(0,B.jsx)(sr,{path:`/conventions`,element:(0,B.jsx)(Fue,{})}),(0,B.jsx)(sr,{path:`/node-types`,element:(0,B.jsx)(zue,{})}),(0,B.jsx)(sr,{path:`/config`,element:(0,B.jsx)(y3,{})})]})})]})})}var Vue=new Ue({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1,staleTime:3e4}}});Gc.createRoot(document.getElementById(`root`)).render((0,B.jsx)(z.StrictMode,{children:(0,B.jsx)(Je,{client:Vue,children:(0,B.jsx)(Xr,{children:(0,B.jsx)(Bue,{})})})}));
|