@tom2012/cc-web 1.5.145 → 2026.4.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/README.md +1 -1
  2. package/frontend/dist/assets/{GraphPreview-B1fJJ74-.js → GraphPreview-DWbfxQMP.js} +1 -1
  3. package/frontend/dist/assets/{MobilePage-MtWV7lEi.js → MobilePage-B9NDvC5H.js} +3 -3
  4. package/frontend/dist/assets/{OfficePreview-5vfUSlCo.js → OfficePreview-CqPeqE8D.js} +2 -2
  5. package/frontend/dist/assets/{PlanPanel-C9YW2ju9.js → PlanPanel-qMcCdgnB.js} +3 -3
  6. package/frontend/dist/assets/{ProjectPage-KJgvua7n.js → ProjectPage-DaVLIGxq.js} +5 -5
  7. package/frontend/dist/assets/{SettingsPage-D5UpIRYe.js → SettingsPage-vCg2-gp3.js} +1 -1
  8. package/frontend/dist/assets/{ShareViewPage-B9dPy55n.js → ShareViewPage-z8iQsPWi.js} +1 -1
  9. package/frontend/dist/assets/{SkillHubPage-Cm6X56T6.js → SkillHubPage-2wfYYyop.js} +1 -1
  10. package/frontend/dist/assets/{bot-Z5b4_ig-.js → bot-DyFCozBh.js} +1 -1
  11. package/frontend/dist/assets/{chevron-down-jp7Uc7Gi.js → chevron-down-DQbVIYs9.js} +1 -1
  12. package/frontend/dist/assets/{chevron-up-C_E6Sp2t.js → chevron-up-BhJ_vGkt.js} +1 -1
  13. package/frontend/dist/assets/{index-CSy2deIQ.js → index-BHHbhoCX.js} +4 -4
  14. package/frontend/dist/assets/{index-C7NpiHJk.css → index-DkIw9NSk.css} +1 -1
  15. package/frontend/dist/assets/{index-Bk5ouDrl.js → index-gGkPkO5Y.js} +1 -1
  16. package/frontend/dist/assets/{jszip.min-Bpe64b-s.js → jszip.min-BkJCbD1t.js} +1 -1
  17. package/frontend/dist/assets/{matter-DKUW5u87.js → matter-D8YF6GqH.js} +1 -1
  18. package/frontend/dist/assets/{maximize-2-jfXiYz06.js → maximize-2-DNzHISX1.js} +1 -1
  19. package/frontend/dist/assets/{one-light-DjHMR6R3.js → one-light-Cw2fObXu.js} +1 -1
  20. package/frontend/dist/assets/{save-DvA4RsTV.js → save-BfofeeTu.js} +1 -1
  21. package/frontend/dist/assets/{search-esoHp6vV.js → search-BkNB-Hpn.js} +1 -1
  22. package/frontend/dist/assets/{user-B7fVnouu.js → user-CmfEQ_9b.js} +1 -1
  23. package/frontend/dist/index.html +2 -2
  24. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectPage-KJgvua7n.js","assets/purify.es-CgRAQgUo.js","assets/one-light-DjHMR6R3.js","assets/one-light-wklAmtGL.css","assets/save-DvA4RsTV.js","assets/chevron-down-jp7Uc7Gi.js","assets/bot-Z5b4_ig-.js","assets/user-B7fVnouu.js","assets/search-esoHp6vV.js","assets/chevron-up-C_E6Sp2t.js","assets/ProjectPage-9CEnUXvW.css","assets/SettingsPage-D5UpIRYe.js","assets/SkillHubPage-Cm6X56T6.js","assets/ShareViewPage-B9dPy55n.js","assets/MobilePage-MtWV7lEi.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectPage-DaVLIGxq.js","assets/purify.es-CgRAQgUo.js","assets/one-light-Cw2fObXu.js","assets/one-light-wklAmtGL.css","assets/save-BfofeeTu.js","assets/chevron-down-DQbVIYs9.js","assets/bot-DyFCozBh.js","assets/user-CmfEQ_9b.js","assets/search-BkNB-Hpn.js","assets/chevron-up-BhJ_vGkt.js","assets/ProjectPage-9CEnUXvW.css","assets/SettingsPage-vCg2-gp3.js","assets/SkillHubPage-2wfYYyop.js","assets/ShareViewPage-z8iQsPWi.js","assets/MobilePage-B9NDvC5H.js"])))=>i.map(i=>d[i]);
2
2
  var e=Object.defineProperty,t=(t,n,r)=>((t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r)(t,"symbol"!=typeof n?n+"":n,r);function n(e,t){for(var n=0;n<t.length;n++){const r=t[n];if("string"!=typeof r&&!Array.isArray(r))for(const t in r)if("default"!==t&&!(t in e)){const n=Object.getOwnPropertyDescriptor(r,t);n&&Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver(e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)}).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var i={exports:{}},s={},l={exports:{}},u={},c=Symbol.for("react.element"),d=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),g=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),w=Symbol.iterator;var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function j(e,t,n){this.props=e,this.context=t,this.refs=E,this.updater=n||k}function C(){}function P(e,t,n){this.props=e,this.context=t,this.refs=E,this.updater=n||k}j.prototype.isReactComponent={},j.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},j.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},C.prototype=j.prototype;var N=P.prototype=new C;N.constructor=P,S(N,j.prototype),N.isPureReactComponent=!0;var T=Array.isArray,M=Object.prototype.hasOwnProperty,R={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function D(e,t,n){var r,o={},a=null,i=null;if(null!=t)for(r in void 0!==t.ref&&(i=t.ref),void 0!==t.key&&(a=""+t.key),t)M.call(t,r)&&!L.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(1===s)o.children=n;else if(1<s){for(var l=Array(s),u=0;u<s;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(r in s=e.defaultProps)void 0===o[r]&&(o[r]=s[r]);return{$$typeof:c,type:e,key:a,ref:i,props:o,_owner:R.current}}function _(e){return"object"==typeof e&&null!==e&&e.$$typeof===c}var A=/\/+/g;function O(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function I(e,t,n,r,o){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var i=!1;if(null===e)i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case c:case d:i=!0}}if(i)return o=o(i=e),e=""===r?"."+O(i,0):r,T(o)?(n="",null!=e&&(n=e.replace(A,"$&/")+"/"),I(o,t,n,"",function(e){return e})):null!=o&&(_(o)&&(o=function(e,t){return{$$typeof:c,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,n+(!o.key||i&&i.key===o.key?"":(""+o.key).replace(A,"$&/")+"/")+e)),t.push(o)),1;if(i=0,r=""===r?".":r+":",T(e))for(var s=0;s<e.length;s++){var l=r+O(a=e[s],s);i+=I(a,t,n,l,o)}else if(l=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=w&&e[w]||e["@@iterator"])?e:null}(e),"function"==typeof l)for(e=l.call(e),s=0;!(a=e.next()).done;)i+=I(a=a.value,t,n,l=r+O(a,s++),o);else if("object"===a)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function z(e,t,n){if(null==e)return e;var r=[],o=0;return I(e,r,"","",function(e){return t.call(n,e,o++)}),r}function F(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var V={current:null},$={transition:null},B={ReactCurrentDispatcher:V,ReactCurrentBatchConfig:$,ReactCurrentOwner:R};function U(){throw Error("act(...) is not supported in production builds of React.")}u.Children={map:z,forEach:function(e,t,n){z(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return z(e,function(){t++}),t},toArray:function(e){return z(e,function(e){return e})||[]},only:function(e){if(!_(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},u.Component=j,u.Fragment=f,u.Profiler=h,u.PureComponent=P,u.StrictMode=p,u.Suspense=y,u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=B,u.act=U,u.cloneElement=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=S({},e.props),o=e.key,a=e.ref,i=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,i=R.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(l in t)M.call(t,l)&&!L.hasOwnProperty(l)&&(r[l]=void 0===t[l]&&void 0!==s?s[l]:t[l])}var l=arguments.length-2;if(1===l)r.children=n;else if(1<l){s=Array(l);for(var u=0;u<l;u++)s[u]=arguments[u+2];r.children=s}return{$$typeof:c,type:e.type,key:o,ref:a,props:r,_owner:i}},u.createContext=function(e){return(e={$$typeof:g,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:m,_context:e},e.Consumer=e},u.createElement=D,u.createFactory=function(e){var t=D.bind(null,e);return t.type=e,t},u.createRef=function(){return{current:null}},u.forwardRef=function(e){return{$$typeof:v,render:e}},u.isValidElement=_,u.lazy=function(e){return{$$typeof:x,_payload:{_status:-1,_result:e},_init:F}},u.memo=function(e,t){return{$$typeof:b,type:e,compare:void 0===t?null:t}},u.startTransition=function(e){var t=$.transition;$.transition={};try{e()}finally{$.transition=t}},u.unstable_act=U,u.useCallback=function(e,t){return V.current.useCallback(e,t)},u.useContext=function(e){return V.current.useContext(e)},u.useDebugValue=function(){},u.useDeferredValue=function(e){return V.current.useDeferredValue(e)},u.useEffect=function(e,t){return V.current.useEffect(e,t)},u.useId=function(){return V.current.useId()},u.useImperativeHandle=function(e,t,n){return V.current.useImperativeHandle(e,t,n)},u.useInsertionEffect=function(e,t){return V.current.useInsertionEffect(e,t)},u.useLayoutEffect=function(e,t){return V.current.useLayoutEffect(e,t)},u.useMemo=function(e,t){return V.current.useMemo(e,t)},u.useReducer=function(e,t,n){return V.current.useReducer(e,t,n)},u.useRef=function(e){return V.current.useRef(e)},u.useState=function(e){return V.current.useState(e)},u.useSyncExternalStore=function(e,t,n){return V.current.useSyncExternalStore(e,t,n)},u.useTransition=function(){return V.current.useTransition()},u.version="18.3.1",l.exports=u;var W=l.exports;const H=o(W),G=n({__proto__:null,default:H},[W]);
3
3
  /**
4
4
  * @license React
@@ -60,16 +60,16 @@ function Jd(){return Jd=Object.assign?Object.assign.bind():function(e){for(var t
60
60
  * LICENSE.md file in the root directory of this source tree.
61
61
  *
62
62
  * @license MIT
63
- */new Promise(()=>{});try{window.__reactRouterVersion="6"}catch(wT){}const Cf=G.startTransition;function Pf(e){let{basename:t,children:n,future:r,window:o}=e,a=W.useRef();null==a.current&&(a.current=vd({window:o,v5Compat:!0}));let i=a.current,[s,l]=W.useState({action:i.action,location:i.location}),{v7_startTransition:u}=r||{},c=W.useCallback(e=>{u&&Cf?Cf(()=>l(e)):l(e)},[l,u]);return W.useLayoutEffect(()=>i.listen(c),[i,c]),W.useEffect(()=>{return null==(e=r)||e.v7_startTransition,void(null==e||e.v7_relativeSplatPath);var e},[r]),W.createElement(Sf,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:i,future:r})}var Nf,Tf,Mf,Rf;(Tf=Nf||(Nf={})).UseScrollRestoration="useScrollRestoration",Tf.UseSubmit="useSubmit",Tf.UseSubmitFetcher="useSubmitFetcher",Tf.UseFetcher="useFetcher",Tf.useViewTransitionState="useViewTransitionState",(Rf=Mf||(Mf={})).UseFetcher="useFetcher",Rf.UseFetchers="useFetchers",Rf.UseScrollRestoration="useScrollRestoration";const Lf=W.createContext({});function Df(e){const t=W.useRef(null);return null===t.current&&(t.current=e()),t.current}const _f="undefined"!=typeof window?W.useLayoutEffect:W.useEffect,Af=W.createContext(null);function Of(e,t){-1===e.indexOf(t)&&e.push(t)}function If(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const zf=(e,t,n)=>n>t?t:n<e?e:n;const Ff={},Vf=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function $f(e){return"object"==typeof e&&null!==e}const Bf=e=>/^0[^.\s]+$/u.test(e);function Uf(e){let t;return()=>(void 0===t&&(t=e()),t)}const Wf=e=>e,Hf=(e,t)=>n=>t(e(n)),Gf=(...e)=>e.reduce(Hf),Yf=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r};class Kf{constructor(){this.subscriptions=[]}add(e){return Of(this.subscriptions,e),()=>If(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o<r;o++){const r=this.subscriptions[o];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const qf=e=>1e3*e,Xf=e=>e/1e3;function Qf(e,t){return t?e*(1e3/t):0}const Zf=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Jf(e,t,n,r){if(e===t&&n===r)return Wf;const o=t=>function(e,t,n,r,o){let a,i,s=0;do{i=t+(n-t)/2,a=Zf(i,r,o)-e,a>0?n=i:t=i}while(Math.abs(a)>1e-7&&++s<12);return i}(t,0,1,e,n);return e=>0===e||1===e?e:Zf(o(e),t,r)}const ep=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,tp=e=>t=>1-e(1-t),np=Jf(.33,1.53,.69,.99),rp=tp(np),op=ep(rp),ap=e=>e>=1?1:(e*=2)<1?.5*rp(e):.5*(2-Math.pow(2,-10*(e-1))),ip=e=>1-Math.sin(Math.acos(e)),sp=tp(ip),lp=ep(ip),up=Jf(.42,0,1,1),cp=Jf(0,0,.58,1),dp=Jf(.42,0,.58,1),fp=e=>Array.isArray(e)&&"number"==typeof e[0],pp={linear:Wf,easeIn:up,easeInOut:dp,easeOut:cp,circIn:ip,circInOut:lp,circOut:sp,backIn:rp,backInOut:op,backOut:np,anticipate:ap},hp=e=>{if(fp(e)){e.length;const[t,n,r,o]=e;return Jf(t,n,r,o)}return"string"==typeof e?pp[e]:e},mp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function gp(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,i=mp.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,o=!1;const a=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(l.schedule(t),e()),t(i)}const l={schedule:(e,o=!1,i=!1)=>{const s=i&&r?t:n;return o&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(i=e,r)return void(o=!0);r=!0;const a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,o&&(o=!1,l.process(e))}};return l}(a),e),{}),{setup:s,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:f,render:p,postRender:h}=i,m=()=>{const a=Ff.useManualTiming,i=a?o.timestamp:performance.now();n=!1,a||(o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1)),o.timestamp=i,o.isProcessing=!0,s.process(o),l.process(o),u.process(o),c.process(o),d.process(o),f.process(o),p.process(o),h.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(m))};return{schedule:mp.reduce((t,a)=>{const s=i[a];return t[a]=(t,a=!1,i=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(m)),s.schedule(t,a,i)),t},{}),cancel:e=>{for(let t=0;t<mp.length;t++)i[mp[t]].cancel(e)},state:o,steps:i}}const{schedule:vp,cancel:yp,state:bp,steps:xp}=gp("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Wf,!0);let wp;function kp(){wp=void 0}const Sp={now:()=>(void 0===wp&&Sp.set(bp.isProcessing||Ff.useManualTiming?bp.timestamp:performance.now()),wp),set:e=>{wp=e,queueMicrotask(kp)}},Ep=e=>t=>"string"==typeof t&&t.startsWith(e),jp=Ep("--"),Cp=Ep("var(--"),Pp=e=>!!Cp(e)&&Np.test(e.split("/*")[0].trim()),Np=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Tp(e){return"string"==typeof e&&e.split("/*")[0].includes("var(--")}const Mp={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Rp={...Mp,transform:e=>zf(0,1,e)},Lp={...Mp,default:1},Dp=e=>Math.round(1e5*e)/1e5,_p=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Ap=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Op=(e,t)=>n=>Boolean("string"==typeof n&&Ap.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ip=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[o,a,i,s]=r.match(_p);return{[e]:parseFloat(o),[t]:parseFloat(a),[n]:parseFloat(i),alpha:void 0!==s?parseFloat(s):1}},zp={...Mp,transform:e=>Math.round((e=>zf(0,255,e))(e))},Fp={test:Op("rgb","red"),parse:Ip("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+zp.transform(e)+", "+zp.transform(t)+", "+zp.transform(n)+", "+Dp(Rp.transform(r))+")"};const Vp={test:Op("#"),parse:function(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:Fp.transform},$p=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Bp=$p("deg"),Up=$p("%"),Wp=$p("px"),Hp=$p("vh"),Gp=$p("vw"),Yp=(()=>({...Up,parse:e=>Up.parse(e)/100,transform:e=>Up.transform(100*e)}))(),Kp={test:Op("hsl","hue"),parse:Ip("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Up.transform(Dp(t))+", "+Up.transform(Dp(n))+", "+Dp(Rp.transform(r))+")"},qp={test:e=>Fp.test(e)||Vp.test(e)||Kp.test(e),parse:e=>Fp.test(e)?Fp.parse(e):Kp.test(e)?Kp.parse(e):Vp.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?Fp.transform(e):Kp.transform(e),getAnimatableNone:e=>{const t=qp.parse(e);return t.alpha=0,qp.transform(t)}},Xp=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Qp="number",Zp="color",Jp=/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 eh(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let a=0;const i=t.replace(Jp,e=>(qp.test(e)?(r.color.push(a),o.push(Zp),n.push(qp.parse(e))):e.startsWith("var(")?(r.var.push(a),o.push("var"),n.push(e)):(r.number.push(a),o.push(Qp),n.push(parseFloat(e))),++a,"${}")).split("${}");return{values:n,split:i,indexes:r,types:o}}function th({split:e,types:t}){const n=e.length;return r=>{let o="";for(let a=0;a<n;a++)if(o+=e[a],void 0!==r[a]){const e=t[a];o+=e===Qp?Dp(r[a]):e===Zp?qp.transform(r[a]):r[a]}return o}}const nh=(e,t)=>{return"number"==typeof e?(null==t?void 0:t.trim().endsWith("/"))?e:0:"number"==typeof(n=e)?0:qp.test(n)?qp.getAnimatableNone(n):n;var n};const rh={test:function(e){var t,n;return isNaN(e)&&"string"==typeof e&&((null==(t=e.match(_p))?void 0:t.length)||0)+((null==(n=e.match(Xp))?void 0:n.length)||0)>0},parse:function(e){return eh(e).values},createTransformer:function(e){return th(eh(e))},getAnimatableNone:function(e){const t=eh(e);return th(t)(t.values.map((e,n)=>nh(e,t.split[n])))}};function oh(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ah(e,t){return n=>n>0?t:e}const ih=(e,t,n)=>e+(t-e)*n,sh=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},lh=[Vp,Fp,Kp];function uh(e){const t=(n=e,lh.find(e=>e.test(n)));var n;if(!Boolean(t))return!1;let r=t.parse(e);return t===Kp&&(r=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,a=0,i=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;o=oh(s,r,e+1/3),a=oh(s,r,e),i=oh(s,r,e-1/3)}else o=a=i=n;return{red:Math.round(255*o),green:Math.round(255*a),blue:Math.round(255*i),alpha:r}}(r)),r}const ch=(e,t)=>{const n=uh(e),r=uh(t);if(!n||!r)return ah(e,t);const o={...n};return e=>(o.red=sh(n.red,r.red,e),o.green=sh(n.green,r.green,e),o.blue=sh(n.blue,r.blue,e),o.alpha=ih(n.alpha,r.alpha,e),Fp.transform(o))},dh=new Set(["none","hidden"]);function fh(e,t){return n=>ih(e,t,n)}function ph(e){return"number"==typeof e?fh:"string"==typeof e?Pp(e)?ah:qp.test(e)?ch:gh:Array.isArray(e)?hh:"object"==typeof e?qp.test(e)?ch:mh:ah}function hh(e,t){const n=[...e],r=n.length,o=e.map((e,n)=>ph(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=o[t](e);return n}}function mh(e,t){const n={...e,...t},r={};for(const o in n)void 0!==e[o]&&void 0!==t[o]&&(r[o]=ph(e[o])(e[o],t[o]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const gh=(e,t)=>{const n=rh.createTransformer(t),r=eh(e),o=eh(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?dh.has(e)&&!o.values.length||dh.has(t)&&!r.values.length?function(e,t){return dh.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Gf(hh(function(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const a=t.types[o],i=e.indexes[a][r[a]],s=e.values[i]??0;n[o]=s,r[a]++}return n}(r,o),o.values),n):ah(e,t)};function vh(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return ih(e,t,n);return ph(e)(e,t)}const yh=e=>{const t=({timestamp:t})=>e(t);return{start:(e=!0)=>vp.update(t,e),stop:()=>yp(t),now:()=>bp.isProcessing?bp.timestamp:Sp.now()}},bh=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let a=0;a<o;a++)r+=Math.round(1e4*e(a/(o-1)))/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},xh=2e4;function wh(e){let t=0;let n=e.next(t);for(;!n.done&&t<xh;)t+=50,n=e.next(t);return t>=xh?1/0:t}const kh=100,Sh=10,Eh=1,jh=0,Ch=800,Ph=.3,Nh=.3,Th={granular:.01,default:2},Mh={granular:.005,default:.5},Rh=.01,Lh=10,Dh=.05,_h=1;function Ah(e,t){return e*Math.sqrt(1-t*t)}const Oh=.001;const Ih=["duration","bounce"],zh=["stiffness","damping","mass"];function Fh(e,t){return t.some(t=>void 0!==e[t])}function Vh(e){let t={velocity:jh,stiffness:kh,damping:Sh,mass:Eh,isResolvedFromDuration:!1,...e};if(!Fh(e,zh)&&Fh(e,Ih))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(1.2*n),o=r*r,a=2*zf(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Eh,stiffness:o,damping:a}}else{const n=function({duration:e=Ch,bounce:t=Ph,velocity:n=jh,mass:r=Eh}){let o,a,i=1-t;i=zf(Dh,_h,i),e=zf(Rh,Lh,Xf(e)),i<1?(o=t=>{const r=t*i,o=r*e,a=r-n,s=Ah(t,i),l=Math.exp(-o);return Oh-a/s*l},a=t=>{const r=t*i*e,a=r*n+n,s=Math.pow(i,2)*Math.pow(t,2)*e,l=Math.exp(-r),u=Ah(Math.pow(t,2),i);return(-o(t)+Oh>0?-1:1)*((a-s)*l)/u}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,a=t=>Math.exp(-t*e)*(e*e*(n-t)));const s=function(e,t,n){let r=n;for(let o=1;o<12;o++)r-=e(r)/t(r);return r}(o,a,5/e);if(e=qf(e),isNaN(s))return{stiffness:kh,damping:Sh,duration:e};{const t=Math.pow(s,2)*r;return{stiffness:t,damping:2*i*Math.sqrt(r*t),duration:e}}}({...e,velocity:0});t={...t,...n,mass:Eh},t.isResolvedFromDuration=!0}return t}function $h(e=Nh,t=Ph){const n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const a=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:u,mass:c,duration:d,velocity:f,isResolvedFromDuration:p}=Vh({...n,velocity:-Xf(n.velocity||0)}),h=f||0,m=u/(2*Math.sqrt(l*c)),g=i-a,v=Xf(Math.sqrt(l/c)),y=Math.abs(g)<5;let b,x,w,k,S,E;if(r||(r=y?Th.granular:Th.default),o||(o=y?Mh.granular:Mh.default),m<1)w=Ah(v,m),k=(h+m*v*g)/w,b=e=>{const t=Math.exp(-m*v*e);return i-t*(k*Math.sin(w*e)+g*Math.cos(w*e))},S=m*v*k+g*w,E=m*v*g-k*w,x=e=>Math.exp(-m*v*e)*(S*Math.sin(w*e)+E*Math.cos(w*e));else if(1===m){b=e=>i-Math.exp(-v*e)*(g+(h+v*g)*e);const e=h+v*g;x=t=>Math.exp(-v*t)*(v*e*t-h)}else{const e=v*Math.sqrt(m*m-1);b=t=>{const n=Math.exp(-m*v*t),r=Math.min(e*t,300);return i-n*((h+m*v*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};const t=(h+m*v*g)/e,n=m*v*t-g*e,r=m*v*g-t*e;x=t=>{const o=Math.exp(-m*v*t),a=Math.min(e*t,300);return o*(n*Math.sinh(a)+r*Math.cosh(a))}}const j={calculatedDuration:p&&d||null,velocity:e=>qf(x(e)),next:e=>{if(!p&&m<1){const t=Math.exp(-m*v*e),n=Math.sin(w*e),a=Math.cos(w*e),l=i-t*(k*n+g*a),u=qf(t*(S*n+E*a));return s.done=Math.abs(u)<=r&&Math.abs(i-l)<=o,s.value=s.done?i:l,s}const t=b(e);if(p)s.done=e>=d;else{const n=qf(x(e));s.done=Math.abs(n)<=r&&Math.abs(i-t)<=o}return s.value=s.done?i:t,s},toString:()=>{const e=Math.min(wh(j),xh),t=bh(t=>j.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return j}$h.applyToOptions=e=>{const t=function(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(wh(r),xh);return{type:"keyframes",ease:e=>r.next(o*e).value/t,duration:Xf(o)}}(e,100,$h);return e.ease=t.ease,e.duration=qf(t.duration),e.type="keyframes",e};function Bh(e,t,n){const r=Math.max(t-5,0);return Qf(n-e(r),t-r)}function Uh({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:a=500,modifyTarget:i,min:s,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},p=e=>void 0===s?l:void 0===l||Math.abs(s-e)<Math.abs(l-e)?s:l;let h=n*t;const m=d+h,g=void 0===i?m:i(m);g!==m&&(h=g-d);const v=e=>-h*Math.exp(-e/r),y=e=>g+v(e),b=e=>{const t=v(e),n=y(e);f.done=Math.abs(t)<=u,f.value=f.done?g:n};let x,w;const k=e=>{var t;(t=f.value,void 0!==s&&t<s||void 0!==l&&t>l)&&(x=e,w=$h({keyframes:[f.value,p(f.value)],velocity:Bh(y,e,f.value),damping:o,stiffness:a,restDelta:u,restSpeed:c}))};return k(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==x||(t=!0,b(e),k(e)),void 0!==x&&e>=x?w.next(e-x):(!t&&b(e),f)}}}function Wh(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const a=e.length;if(t.length,1===a)return()=>t[0];if(2===a&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const r=[],o=n||Ff.mix||vh,a=e.length-1;for(let i=0;i<a;i++){let n=o(e[i],e[i+1]);if(t){const e=Array.isArray(t)?t[i]||Wf:t;n=Gf(e,n)}r.push(n)}return r}(t,r,o),l=s.length,u=n=>{if(i&&n<e[0])return t[0];let r=0;if(l>1)for(;r<e.length-2&&!(n<e[r+1]);r++);const o=Yf(e[r],e[r+1],n);return s[r](o)};return n?t=>u(zf(e[0],e[a-1],t)):u}function Hh(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Yf(0,t,r);e.push(ih(n,1,o))}}(t,e.length-1),t}function Gh({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(hp):hp(r),a={done:!1,value:t[0]},i=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:Hh(t),e),s=Wh(i,t,{ease:Array.isArray(o)?o:(l=t,u=o,l.map(()=>u||dp).splice(0,l.length-1))});var l,u;return{calculatedDuration:e,next:t=>(a.value=s(t),a.done=t>=e,a)}}const Yh=e=>null!==e;function Kh(e,{repeat:t,repeatType:n="loop"},r,o=1){const a=e.filter(Yh),i=o<0||t&&"loop"!==n&&t%2==1?0:a.length-1;return i&&void 0!==r?r:a[i]}const qh={decay:Uh,inertia:Uh,tween:Gh,keyframes:Gh,spring:$h};function Xh(e){"string"==typeof e.type&&(e.type=qh[e.type])}class Qh{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}const Zh=e=>e/100;class Jh extends Qh{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=()=>{var e,t;const{motionValue:n}=this.options;n&&n.updatedAt!==Sp.now()&&this.tick(Sp.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),null==(t=(e=this.options).onStop)||t.call(e))},this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause()}initAnimation(){const{options:e}=this;Xh(e);const{type:t=Gh,repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:a=0}=e;let{keyframes:i}=e;const s=t||Gh;s!==Gh&&"number"!=typeof i[0]&&(this.mixKeyframes=Gf(Zh,vh(i[0],i[1])),i=[0,100]);const l=s({...e,keyframes:i});"mirror"===o&&(this.mirroredGenerator=s({...e,keyframes:[...i].reverse(),velocity:-a})),null===l.calculatedDuration&&(l.calculatedDuration=wh(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=l}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:n,totalDuration:r,mixKeyframes:o,mirroredGenerator:a,resolvedDuration:i,calculatedDuration:s}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:u,repeat:c,repeatType:d,repeatDelay:f,type:p,onUpdate:h,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=r);let y,b=this.currentTime,x=n;if(c){const e=Math.min(this.currentTime,r)/i;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,c+1);Boolean(t%2)&&("reverse"===d?(n=1-n,f&&(n-=f/i)):"mirror"===d&&(x=a)),b=zf(0,1,n)*i}v?(this.delayState.value=u[0],y=this.delayState):y=x.next(b),o&&!v&&(y.value=o(y.value));let{done:w}=y;v||null===s||(w=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const k=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return k&&p!==Uh&&(y.value=Kh(u,this.options,m,this.speed)),h&&h(y.value),k&&this.finish(),y}then(e,t){return this.finished.then(e,t)}get duration(){return Xf(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Xf(e)}get time(){return Xf(this.currentTime)}set time(e){e=qf(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);return Bh(e=>this.generator.next(e).value,e,this.generator.next(e).value)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Sp.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Xf(this.currentTime))}play(){var e,t;if(this.isStopped)return;const{driver:n=yh,startTime:r}=this.options;this.driver||(this.driver=n(e=>this.tick(e))),null==(t=(e=this.options).onPlay)||t.call(e);const o=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=o):null!==this.holdTime?this.startTime=o-this.holdTime:this.startTime||(this.startTime=r??o),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Sp.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,t;this.notifyFinished(),this.teardown(),this.state="finished",null==(t=(e=this.options).onComplete)||t.call(e)}cancel(){var e,t;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),null==(t=(e=this.options).onCancel)||t.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var t;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),null==(t=this.driver)||t.stop(),e.observe(this)}}const em=e=>180*e/Math.PI,tm=e=>{const t=em(Math.atan2(e[1],e[0]));return rm(t)},nm={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:tm,rotateZ:tm,skewX:e=>em(Math.atan(e[1])),skewY:e=>em(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},rm=e=>((e%=360)<0&&(e+=360),e),om=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),am=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),im={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:om,scaleY:am,scale:e=>(om(e)+am(e))/2,rotateX:e=>rm(em(Math.atan2(e[6],e[5]))),rotateY:e=>rm(em(Math.atan2(-e[2],e[0]))),rotateZ:tm,rotate:tm,skewX:e=>em(Math.atan(e[4])),skewY:e=>em(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function sm(e){return e.includes("scale")?1:0}function lm(e,t){if(!e||"none"===e)return sm(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=im,o=n;else{const t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=nm,o=t}if(!o)return sm(t);const a=r[t],i=o[1].split(",").map(um);return"function"==typeof a?a(i):i[a]}function um(e){return parseFloat(e.trim())}const cm=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],dm=(()=>new Set(cm))(),fm=e=>e===Mp||e===Wp,pm=new Set(["x","y","z"]),hm=cm.filter(e=>!pm.has(e));const mm={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const o=e.max-e.min;return"border-box"===r?o:o-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const o=e.max-e.min;return"border-box"===r?o:o-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})=>lm(t,"x"),y:(e,{transform:t})=>lm(t,"y")};mm.translateX=mm.x,mm.translateY=mm.y;const gm=new Set;let vm=!1,ym=!1,bm=!1;function xm(){if(ym){const e=Array.from(gm).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{const t=function(e){const t=[];return hm.forEach(n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=n.get(e);t&&t.forEach(([t,n])=>{var r;null==(r=e.getValue(t))||r.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}ym=!1,vm=!1,gm.forEach(e=>e.complete(bm)),gm.clear()}function wm(){gm.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ym=!0)})}class km{constructor(e,t,n,r,o,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=o,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(gm.add(this),vm||(vm=!0,vp.read(wm),vp.resolveKeyframes(xm))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(null===e[0]){const o=null==r?void 0:r.get(),a=e[e.length-1];if(void 0!==o)e[0]=o;else if(n&&t){const r=n.readValue(t,a);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=a),r&&void 0===o&&r.set(e[0])}!function(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),gm.delete(this)}cancel(){"scheduled"===this.state&&(gm.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function Sm(e,t,n){(e=>e.startsWith("--"))(t)?e.style.setProperty(t,n):e.style[t]=n}const Em={};function jm(e,t){const n=Uf(e);return()=>Em[t]??n()}const Cm=jm(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Pm=jm(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(wT){return!1}return!0},"linearEasing"),Nm=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Tm={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Nm([0,.65,.55,1]),circOut:Nm([.55,0,1,.45]),backIn:Nm([.31,.01,.66,-.59]),backOut:Nm([.33,1.53,.69,.99])};function Mm(e,t){return e?"function"==typeof e?Pm()?bh(e,t):"ease-out":fp(e)?Nm(e):Array.isArray(e)?e.map(e=>Mm(e,t)||Tm.easeOut):Tm[e]:void 0}function Rm(e,t,n,{delay:r=0,duration:o=300,repeat:a=0,repeatType:i="loop",ease:s="easeOut",times:l}={},u=void 0){const c={[t]:n};l&&(c.offset=l);const d=Mm(s,o);Array.isArray(d)&&(c.easing=d);const f={delay:r,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:"reverse"===i?"alternate":"normal"};u&&(f.pseudoElement=u);return e.animate(c,f)}function Lm(e){return"function"==typeof e&&"applyToOptions"in e}class Dm extends Qh{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:n,keyframes:r,pseudoElement:o,allowFlatten:a=!1,finalKeyframe:i,onComplete:s}=e;this.isPseudoElement=Boolean(o),this.allowFlatten=a,this.options=e,e.type;const l=function({type:e,...t}){return Lm(e)&&Pm()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=Rm(t,n,r,l,o),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const e=Kh(r,this.options,i,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Sm(t,n,e),this.animation.cancel()}null==s||s(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,t;null==(t=(e=this.animation).finish)||t.call(e)}cancel(){try{this.animation.cancel()}catch(wT){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var e,t,n;const r=null==(e=this.options)?void 0:e.element;!this.isPseudoElement&&(null==r?void 0:r.isConnected)&&(null==(n=(t=this.animation).commitStyles)||n.call(t))}get duration(){var e,t;const n=(null==(t=null==(e=this.animation.effect)?void 0:e.getComputedTiming)?void 0:t.call(e).duration)||0;return Xf(Number(n))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Xf(e)}get time(){return Xf(Number(this.animation.currentTime)||0)}set time(e){const t=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=qf(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 null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){var o;return this.allowFlatten&&(null==(o=this.animation.effect)||o.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&Cm()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),Wf):r(this)}}const _m={anticipate:ap,backInOut:op,circInOut:lp};function Am(e){"string"==typeof e.ease&&e.ease in _m&&(e.ease=_m[e.ease])}class Om extends Dm{constructor(e){Am(e),Xh(e),super(e),void 0!==e.startTime&&!1!==e.autoplay&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:t,onUpdate:n,onComplete:r,element:o,...a}=this.options;if(!t)return;if(void 0!==e)return void t.set(e);const i=new Jh({...a,autoplay:!1}),s=Math.max(10,Sp.now()-this.startTime),l=zf(0,10,s-10),u=i.sample(s).value,{name:c}=this.options;o&&c&&Sm(o,c,u),t.setWithVelocity(i.sample(Math.max(0,s-l)).value,u,l),i.stop()}}const Im=(e,t)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!rh.test(e)&&"0"!==e||e.startsWith("url(")));function zm(e){e.duration=0,e.type="keyframes"}const Fm=new Set(["opacity","clipPath","filter","transform"]),Vm=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const $m=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Bm=Uf(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Um(e){var t;const{motionValue:n,name:r,repeatDelay:o,repeatType:a,damping:i,type:s,keyframes:l}=e;if(!((null==(t=null==n?void 0:n.owner)?void 0:t.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:c}=n.owner.getProps();return Bm()&&r&&(Fm.has(r)||$m.has(r)&&function(e){for(let t=0;t<e.length;t++)if("string"==typeof e[t]&&Vm.test(e[t]))return!0;return!1}(l))&&("transform"!==r||!c)&&!u&&!o&&"mirror"!==a&&0!==i&&"inertia"!==s}class Wm extends Qh{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:a="loop",keyframes:i,name:s,motionValue:l,element:u,...c}){var d;super(),this.stop=()=>{var e,t;this._animation&&(this._animation.stop(),null==(e=this.stopTimeline)||e.call(this)),null==(t=this.keyframeResolver)||t.cancel()},this.createdAt=Sp.now();const f={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:o,repeatType:a,name:s,motionValue:l,element:u,...c},p=(null==u?void 0:u.KeyframeResolver)||km;this.keyframeResolver=new p(i,(e,t,n)=>this.onKeyframesResolved(e,t,f,!n),s,l,u),null==(d=this.keyframeResolver)||d.scheduleResolve()}onKeyframesResolved(e,t,n,r){var o,a;this.keyframeResolver=void 0;const{name:i,type:s,velocity:l,delay:u,isHandoff:c,onUpdate:d}=n;this.resolvedAt=Sp.now();let f=!0;(function(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const a=e[e.length-1],i=Im(o,t),s=Im(a,t);return!(!i||!s)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||("spring"===n||Lm(n))&&r)})(e,i,s,l)||(f=!1,!Ff.instantAnimations&&u||null==d||d(Kh(e,n,t)),e[0]=e[e.length-1],zm(n),n.repeat=0);const p={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},h=f&&!c&&Um(p),m=null==(a=null==(o=p.motionValue)?void 0:o.owner)?void 0:a.current;let g;if(h)try{g=new Om({...p,element:m})}catch{g=new Jh(p)}else g=new Jh(p);g.finished.then(()=>{this.notifyFinished()}).catch(Wf),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||(null==(e=this.keyframeResolver)||e.resume(),bm=!0,wm(),xm(),bm=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),null==(e=this.keyframeResolver)||e.cancel()}}function Hm(e,t,n,r=0,o=1){const a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),i=e.size,s=(i-1)*r;return"function"==typeof n?n(a,i):1===o?a*r:s-a*r}const Gm=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ym(e,t,n=1){const[r,o]=function(e){const t=Gm.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const e=a.trim();return Vf(e)?parseFloat(e):e}return Pp(o)?Ym(o,t,n+1):o}const Km={type:"spring",stiffness:500,damping:25,restSpeed:10},qm={type:"keyframes",duration:.8},Xm={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Qm=(e,{keyframes:t})=>t.length>2?qm:dm.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Km:Xm;function Zm(e,t){if((null==e?void 0:e.inherit)&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Jm(e,t){const n=(null==e?void 0:e[t])??(null==e?void 0:e.default)??e;return n!==e?Zm(n,e):n}const eg=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const tg=(e,t,n,r={},o,a)=>i=>{const s=Jm(r,e)||{},l=s.delay||r.delay||0;let{elapsed:u=0}=r;u-=qf(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-u,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{i(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:o};(function(e){for(const t in e)if(!eg.has(t))return!0;return!1})(s)||Object.assign(c,Qm(e,c)),c.duration&&(c.duration=qf(c.duration)),c.repeatDelay&&(c.repeatDelay=qf(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(zm(c),0===c.delay&&(d=!0)),(Ff.instantAnimations||Ff.skipAnimations||(null==o?void 0:o.shouldSkipAnimations))&&(d=!0,zm(c),c.delay=0),c.allowFlatten=!s.type&&!s.ease,d&&!a&&void 0!==t.get()){const e=Kh(c.keyframes,s);if(void 0!==e)return void vp.update(()=>{c.onUpdate(e),c.onComplete()})}return s.isSync?new Jh(c):new Wm(c)};function ng(e){const t=[{},{}];return null==e||e.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function rg(e,t,n,r){if("function"==typeof t){const[o,a]=ng(r);t=t(void 0!==n?n:e.custom,o,a)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,a]=ng(r);t=t(void 0!==n?n:e.custom,o,a)}return t}function og(e,t,n){const r=e.getProps();return rg(r,t,void 0!==n?n:r.custom,e)}const ag=new Set(["width","height","top","left","right","bottom",...cm]);class ig{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{var t;const n=Sp.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(null==(t=this.events.change)||t.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=Sp.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Kf);const n=this.events[e].add(t);return"change"===e?()=>{n(),vp.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;null==(e=this.events.change)||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Sp.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Qf(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(){var e,t;null==(e=this.dependents)||e.clear(),null==(t=this.events.destroy)||t.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function sg(e,t){return new ig(e,t)}const lg=e=>Array.isArray(e);function ug(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,sg(n))}function cg(e){return lg(e)?e[e.length-1]||0:e}const dg=e=>Boolean(e&&e.getVelocity);function fg(e,t){const n=e.getValue("willChange");if(r=n,Boolean(dg(r)&&r.add))return n.add(t);if(!n&&Ff.WillChange){const n=new Ff.WillChange("auto");e.addValue("willChange",n),n.add(t)}var r}function pg(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const hg="data-"+pg("framerAppearId");function mg(e){return e.props[hg]}function gg({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function vg(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:a,transitionEnd:i,...s}=t;const l=e.getDefaultTransition();a=a?Zm(a,l):l;const u=null==a?void 0:a.reduceMotion;r&&(a=r);const c=[],d=o&&e.animationState&&e.animationState.getState()[o];for(const f in s){const t=e.getValue(f,e.latestValues[f]??null),r=s[f];if(void 0===r||d&&gg(d,f))continue;const o={delay:n,...Jm(a||{},f)},i=t.get();if(void 0!==i&&!t.isAnimating()&&!Array.isArray(r)&&r===i&&!o.velocity){vp.update(()=>t.set(r));continue}let l=!1;if(window.MotionHandoffAnimation){const t=mg(e);if(t){const e=window.MotionHandoffAnimation(t,f,vp);null!==e&&(o.startTime=e,l=!0)}}fg(e,f);const p=u??e.shouldReduceMotion;t.start(tg(f,t,r,p&&ag.has(f)?{type:!1}:o,e,l));const h=t.animation;h&&c.push(h)}if(i){const t=()=>vp.update(()=>{i&&function(e,t){const n=og(e,t);let{transitionEnd:r={},transition:o={},...a}=n||{};a={...a,...r};for(const i in a)ug(e,i,cg(a[i]))}(e,i)});c.length?Promise.all(c).then(t):t()}return c}function yg(e,t,n={}){var r;const o=og(e,t,"exit"===n.type?null==(r=e.presenceContext)?void 0:r.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(a=n.transitionOverride);const i=o?()=>Promise.all(vg(e,o,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:i,staggerDirection:s}=a;return function(e,t,n=0,r=0,o=0,a=1,i){const s=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),s.push(yg(l,t,{...i,delay:n+("function"==typeof r?0:r)+Hm(e.variantChildren,l,r,o,a)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(s)}(e,t,r,o,i,s,n)}:()=>Promise.resolve(),{when:l}=a;if(l){const[e,t]="beforeChildren"===l?[i,s]:[s,i];return e().then(()=>t())}return Promise.all([i(),s(n.delay)])}const bg=e=>t=>t.test(e),xg=[Mp,Wp,Up,Bp,Gp,Hp,{test:e=>"auto"===e,parse:e=>e}],wg=e=>xg.find(bg(e));function kg(e){return"number"==typeof e?0===e:null===e||("none"===e||"0"===e||Bf(e))}const Sg=new Set(["brightness","contrast","saturate","opacity"]);function Eg(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(_p)||[];if(!r)return e;const o=n.replace(r,"");let a=Sg.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+o+")"}const jg=/\b([a-z-]*)\(.*?\)/gu,Cg={...rh,getAnimatableNone:e=>{const t=e.match(jg);return t?t.map(Eg).join(" "):e}},Pg={...rh,getAnimatableNone:e=>{const t=rh.parse(e);return rh.createTransformer(e)(t.map(e=>"number"==typeof e?0:"object"==typeof e?{...e,alpha:1}:e))}},Ng={...Mp,transform:Math.round},Tg={borderWidth:Wp,borderTopWidth:Wp,borderRightWidth:Wp,borderBottomWidth:Wp,borderLeftWidth:Wp,borderRadius:Wp,borderTopLeftRadius:Wp,borderTopRightRadius:Wp,borderBottomRightRadius:Wp,borderBottomLeftRadius:Wp,width:Wp,maxWidth:Wp,height:Wp,maxHeight:Wp,top:Wp,right:Wp,bottom:Wp,left:Wp,inset:Wp,insetBlock:Wp,insetBlockStart:Wp,insetBlockEnd:Wp,insetInline:Wp,insetInlineStart:Wp,insetInlineEnd:Wp,padding:Wp,paddingTop:Wp,paddingRight:Wp,paddingBottom:Wp,paddingLeft:Wp,paddingBlock:Wp,paddingBlockStart:Wp,paddingBlockEnd:Wp,paddingInline:Wp,paddingInlineStart:Wp,paddingInlineEnd:Wp,margin:Wp,marginTop:Wp,marginRight:Wp,marginBottom:Wp,marginLeft:Wp,marginBlock:Wp,marginBlockStart:Wp,marginBlockEnd:Wp,marginInline:Wp,marginInlineStart:Wp,marginInlineEnd:Wp,fontSize:Wp,backgroundPositionX:Wp,backgroundPositionY:Wp,...{rotate:Bp,rotateX:Bp,rotateY:Bp,rotateZ:Bp,scale:Lp,scaleX:Lp,scaleY:Lp,scaleZ:Lp,skew:Bp,skewX:Bp,skewY:Bp,distance:Wp,translateX:Wp,translateY:Wp,translateZ:Wp,x:Wp,y:Wp,z:Wp,perspective:Wp,transformPerspective:Wp,opacity:Rp,originX:Yp,originY:Yp,originZ:Wp},zIndex:Ng,fillOpacity:Rp,strokeOpacity:Rp,numOctaves:Ng},Mg={...Tg,color:qp,backgroundColor:qp,outlineColor:qp,fill:qp,stroke:qp,borderColor:qp,borderTopColor:qp,borderRightColor:qp,borderBottomColor:qp,borderLeftColor:qp,filter:Cg,WebkitFilter:Cg,mask:Pg,WebkitMask:Pg},Rg=e=>Mg[e],Lg=new Set([Cg,Pg]);function Dg(e,t){let n=Rg(e);return Lg.has(n)||(n=rh),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const _g=new Set(["auto","none","0"]);class Ag extends km{constructor(e,t,n,r,o){super(e,t,n,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let s=0;s<e.length;s++){let n=e[s];if("string"==typeof n&&(n=n.trim(),Pp(n))){const r=Ym(n,t.current);void 0!==r&&(e[s]=r),s===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!ag.has(n)||2!==e.length)return;const[r,o]=e,a=wg(r),i=wg(o);if(Tp(r)!==Tp(o)&&mm[n])this.needsMeasurement=!0;else if(a!==i)if(fm(a)&&fm(i))for(let s=0;s<e.length;s++){const t=e[s];"string"==typeof t&&(e[s]=parseFloat(t))}else mm[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let r=0;r<e.length;r++)(null===e[r]||kg(e[r]))&&n.push(r);n.length&&function(e,t,n){let r,o=0;for(;o<e.length&&!r;){const t=e[o];"string"==typeof t&&!_g.has(t)&&eh(t).values.length&&(r=e[o]),o++}if(r&&n)for(const a of t)e[a]=Dg(n,r)}(e,n,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=mm[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];void 0!==r&&e.getValue(n,r).jump(r,!1)}measureEndState(){var e;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const a=r.length-1,i=r[a];r[a]=mm[n](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),(null==(e=this.removedTransforms)?void 0:e.length)&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}function Og(e,t,n){if(null==e)return[];if(e instanceof EventTarget)return[e];if("string"==typeof e){let t=document;const r=(null==n?void 0:n[e])??t.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e).filter(e=>null!=e)}const Ig=(e,t)=>t&&"number"==typeof e?t.transform(e):e;function zg(e){return $f(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Fg}=gp(queueMicrotask,!1),Vg={x:!1,y:!1};function $g(){return Vg.x||Vg.y}function Bg(e,t){const n=Og(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Ug(e,t,n={}){const[r,o,a]=Bg(e,n);return r.forEach(e=>{let n,r=!1,a=!1;const i=t=>{n&&(n(t),n=void 0),e.removeEventListener("pointerleave",l)},s=e=>{r=!1,window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s),a&&(a=!1,i(e))},l=e=>{"touch"!==e.pointerType&&(r?a=!0:i(e))};e.addEventListener("pointerenter",r=>{if("touch"===r.pointerType||$g())return;a=!1;const i=t(e,r);"function"==typeof i&&(n=i,e.addEventListener("pointerleave",l,o))},o),e.addEventListener("pointerdown",()=>{r=!0,window.addEventListener("pointerup",s,o),window.addEventListener("pointercancel",s,o)},o)}),a}const Wg=(e,t)=>!!t&&(e===t||Wg(e,t.parentElement)),Hg=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,Gg=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Yg=new Set(["INPUT","SELECT","TEXTAREA"]);const Kg=new WeakSet;function qg(e){return t=>{"Enter"===t.key&&e(t)}}function Xg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function Qg(e){return Hg(e)&&!$g()}const Zg=new WeakSet;function Jg(e,t,n={}){const[r,o,a]=Bg(e,n),i=e=>{const r=e.currentTarget;if(!Qg(e))return;if(Zg.has(e))return;Kg.add(r),n.stopPropagation&&Zg.add(e);const a=t(r,e),i=(e,t)=>{window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",l),Kg.has(r)&&Kg.delete(r),Qg(e)&&"function"==typeof a&&a(e,{success:t})},s=e=>{i(e,r===window||r===document||n.useGlobalTarget||Wg(r,e.target))},l=e=>{i(e,!1)};window.addEventListener("pointerup",s,o),window.addEventListener("pointercancel",l,o)};return r.forEach(e=>{var t;(n.useGlobalTarget?window:e).addEventListener("pointerdown",i,o),zg(e)&&(e.addEventListener("focus",e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const r=qg(()=>{if(Kg.has(n))return;Xg(n,"down");const e=qg(()=>{Xg(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>Xg(n,"cancel"),t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)})(e,o)),t=e,Gg.has(t.tagName)||!0===t.isContentEditable||e.hasAttribute("tabindex")||(e.tabIndex=0))}),a}function ev(e){return $f(e)&&"ownerSVGElement"in e}const tv=new WeakMap;let nv;const rv=(e,t,n)=>(r,o)=>o&&o[0]?o[0][e+"Size"]:ev(r)&&"getBBox"in r?r.getBBox()[t]:r[n],ov=rv("inline","width","offsetWidth"),av=rv("block","height","offsetHeight");function iv({target:e,borderBoxSize:t}){var n;null==(n=tv.get(e))||n.forEach(n=>{n(e,{get width(){return ov(e,t)},get height(){return av(e,t)}})})}function sv(e){e.forEach(iv)}function lv(e,t){nv||"undefined"!=typeof ResizeObserver&&(nv=new ResizeObserver(sv));const n=Og(e);return n.forEach(e=>{let n=tv.get(e);n||(n=new Set,tv.set(e,n)),n.add(t),null==nv||nv.observe(e)}),()=>{n.forEach(e=>{const n=tv.get(e);null==n||n.delete(t),(null==n?void 0:n.size)||null==nv||nv.unobserve(e)})}}const uv=new Set;let cv;function dv(e){return uv.add(e),cv||(cv=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};uv.forEach(t=>t(e))},window.addEventListener("resize",cv)),()=>{uv.delete(e),uv.size||"function"!=typeof cv||(window.removeEventListener("resize",cv),cv=void 0)}}function fv(e,t){return"function"==typeof e?dv(e):lv(e,t)}const pv=[...xg,qp,rh],hv=()=>({x:{min:0,max:0},y:{min:0,max:0}}),mv=new WeakMap;function gv(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function vv(e){return"string"==typeof e||Array.isArray(e)}const yv=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],bv=["initial",...yv];function xv(e){return gv(e.animate)||bv.some(t=>vv(e[t]))}function wv(e){return Boolean(xv(e)||e.variants)}const kv={current:null},Sv={current:!1},Ev="undefined"!=typeof window;const jv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Cv={};function Pv(e){Cv=e}class Nv{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:o,blockInitialAnimation:a,visualState:i},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=km,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=Sp.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,vp.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=i;this.latestValues=l,this.baseTarget={...l},this.initialValues=t.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=o,this.options=s,this.blockInitialAnimation=Boolean(a),this.isControllingVariants=xv(t),this.isVariantNode=wv(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const f in d){const e=d[f];void 0!==l[f]&&dg(e)&&e.set(l[f])}}mount(e){var t,n;if(this.hasBeenMounted)for(const r in this.initialValues)null==(t=this.values.get(r))||t.jump(this.initialValues[r]),this.latestValues[r]=this.initialValues[r];this.current=e,mv.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Sv.current||function(){if(Sv.current=!0,Ev)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>kv.current=e.matches;e.addEventListener("change",t),t()}else kv.current=!1}(),this.shouldReduceMotion=kv.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,null==(n=this.parent)||n.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),yp(this.notifyUpdate),yp(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),null==(e=this.parent)||e.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Fm.has(e)&&this.current instanceof HTMLElement){const{factory:n,keyframes:r,times:o,ease:a,duration:i}=t.accelerate,s=new Dm({element:this.current,name:e,keyframes:r,times:o,ease:a,duration:qf(i)}),l=n(s);return void this.valueSubscriptions.set(e,()=>{l(),s.cancel()})}const n=dm.has(e);n&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&vp.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),o&&o(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in Cv){const t=Cv[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let n=0;n<jv.length;n++){const t=jv[n];this.propEventSubscriptions[t]&&(this.propEventSubscriptions[t](),delete this.propEventSubscriptions[t]);const r=e["on"+t];r&&(this.propEventSubscriptions[t]=this.on(t,r))}this.prevMotionValues=function(e,t,n){for(const r in t){const o=t[r],a=n[r];if(dg(o))e.addValue(r,o);else if(dg(a))e.addValue(r,sg(o,{owner:e}));else if(a!==o)if(e.hasValue(r)){const t=e.getValue(r);!0===t.liveStyle?t.jump(o):t.hasAnimated||t.set(o)}else{const t=e.getStaticValue(r);e.addValue(r,sg(void 0!==t?t:o,{owner:e}))}}for(const r in n)void 0===t[r]&&e.removeValue(r);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=sg(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=void 0===this.latestValues[e]&&this.current?this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];var r;return null!=n&&("string"==typeof n&&(Vf(n)||Bf(n))?n=parseFloat(n):(r=n,!pv.find(bg(r))&&rh.test(t)&&(n=Dg(e,t))),this.setBaseTarget(e,dg(n)?n.get():n)),dg(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const o=rg(this.props,n,null==(t=this.presenceContext)?void 0:t.custom);o&&(r=o[e])}if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||dg(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new Kf),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Fg.render(this.render)}}class Tv extends Nv{constructor(){super(...arguments),this.KeyframeResolver=Ag}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){const n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;dg(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}class Mv{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Rv({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Lv(e){return void 0===e||1===e}function Dv({scale:e,scaleX:t,scaleY:n}){return!Lv(e)||!Lv(t)||!Lv(n)}function _v(e){return Dv(e)||Av(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Av(e){return Ov(e.x)||Ov(e.y)}function Ov(e){return e&&"0%"!==e}function Iv(e,t,n){return n+t*(e-n)}function zv(e,t,n,r,o){return void 0!==o&&(e=Iv(e,o,r)),Iv(e,n,r)+t}function Fv(e,t=0,n=1,r,o){e.min=zv(e.min,t,n,r,o),e.max=zv(e.max,t,n,r,o)}function Vv(e,{x:t,y:n}){Fv(e.x,t.translate,t.scale,t.originPoint),Fv(e.y,n.translate,n.scale,n.originPoint)}const $v=.999999999999,Bv=1.0000000000001;function Uv(e,t){e.min+=t,e.max+=t}function Wv(e,t,n,r,o=.5){Fv(e,t,n,ih(e.min,e.max,o),r)}function Hv(e,t){return"string"==typeof e?parseFloat(e)/100*(t.max-t.min):e}function Gv(e,t,n){const r=n??e;Wv(e.x,Hv(t.x,r.x),t.scaleX,t.scale,t.originX),Wv(e.y,Hv(t.y,r.y),t.scaleY,t.scale,t.originY)}function Yv(e,t){return Rv(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}const Kv={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},qv=cm.length;function Xv(e,t,n){const{style:r,vars:o,transformOrigin:a}=e;let i=!1,s=!1;for(const l in t){const e=t[l];if(dm.has(l))i=!0;else if(jp(l))o[l]=e;else{const t=Ig(e,Tg[l]);l.startsWith("origin")?(s=!0,a[l]=t):r[l]=t}}if(t.transform||(i||n?r.transform=function(e,t,n){let r="",o=!0;for(let a=0;a<qv;a++){const i=cm[a],s=e[i];if(void 0===s)continue;let l=!0;if("number"==typeof s)l=s===(i.startsWith("scale")?1:0);else{const e=parseFloat(s);l=i.startsWith("scale")?1===e:0===e}if(!l||n){const e=Ig(s,Tg[i]);l||(o=!1,r+=`${Kv[i]||i}(${e}) `),n&&(t[i]=e)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}(t,e.transform,n):r.transform&&(r.transform="none")),s){const{originX:e="50%",originY:t="50%",originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function Qv(e,{style:t,vars:n},r,o){const a=e.style;let i;for(i in t)a[i]=t[i];for(i in null==o||o.applyProjectionStyles(a,r),n)a.setProperty(i,n[i])}function Zv(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Jv={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!Wp.test(e))return e;e=parseFloat(e)}return`${Zv(e,t.target.x)}% ${Zv(e,t.target.y)}%`}},ey={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=rh.parse(e);if(o.length>5)return r;const a=rh.createTransformer(e),i="number"!=typeof o[0]?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;o[0+i]/=s,o[1+i]/=l;const u=ih(s,l,.5);return"number"==typeof o[2+i]&&(o[2+i]/=u),"number"==typeof o[3+i]&&(o[3+i]/=u),a(o)}},ty={borderRadius:{...Jv,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Jv,borderTopRightRadius:Jv,borderBottomLeftRadius:Jv,borderBottomRightRadius:Jv,boxShadow:ey};function ny(e,{layout:t,layoutId:n}){return dm.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!ty[e]||"opacity"===e)}function ry(e,t,n){var r;const o=e.style,a=null==t?void 0:t.style,i={};if(!o)return i;for(const s in o)(dg(o[s])||a&&dg(a[s])||ny(s,e)||void 0!==(null==(r=null==n?void 0:n.getValue(s))?void 0:r.liveStyle))&&(i[s]=o[s]);return i}class oy extends Tv{constructor(){super(...arguments),this.type="html",this.renderInstance=Qv}readValueFromInstance(e,t){var n,r;if(dm.has(t))return(null==(n=this.projection)?void 0:n.isProjecting)?sm(t):((e,t)=>{const{transform:n="none"}=getComputedStyle(e);return lm(n,t)})(e,t);{const n=(r=e,window.getComputedStyle(r)),o=(jp(t)?n.getPropertyValue(t):n[t])||0;return"string"==typeof o?o.trim():o}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Yv(e,t)}build(e,t,n){Xv(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return ry(e,t,n)}}const ay={offset:"stroke-dashoffset",array:"stroke-dasharray"},iy={offset:"strokeDashoffset",array:"strokeDasharray"};const sy=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function ly(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:a=1,pathOffset:i=0,...s},l,u,c){if(Xv(e,s,u),l)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=(null==c?void 0:c.transformBox)??"fill-box",delete d.transformBox);for(const p of sy)void 0!==d[p]&&(f[p]=d[p],delete d[p]);void 0!==t&&(d.x=t),void 0!==n&&(d.y=n),void 0!==r&&(d.scale=r),void 0!==o&&function(e,t,n=1,r=0,o=!0){e.pathLength=1;const a=o?ay:iy;e[a.offset]=""+-r,e[a.array]=`${t} ${n}`}(d,o,a,i,!1)}const uy=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"]),cy=e=>"string"==typeof e&&"svg"===e.toLowerCase();function dy(e,t,n){const r=ry(e,t,n);for(const o in e)if(dg(e[o])||dg(t[o])){r[-1!==cm.indexOf(o)?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o]=e[o]}return r}class fy extends Tv{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=hv}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(dm.has(t)){const e=Rg(t);return e&&e.default||0}return t=uy.has(t)?t:pg(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return dy(e,t,n)}build(e,t,n){ly(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){!function(e,t,n,r){Qv(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(uy.has(o)?o:pg(o),t.attrs[o])}(e,t,0,r)}mount(e){this.isSVGTag=cy(e.tagName),super.mount(e)}}const py=bv.length;function hy(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&hy(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<py;n++){const r=bv[n],o=e.props[r];(vv(o)||!1===o)&&(t[r]=o)}return t}function my(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const gy=[...yv].reverse(),vy=yv.length;function yy(e){return t=>Promise.all(t.map(({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map(t=>yg(e,t,n));r=Promise.all(o)}else if("string"==typeof t)r=yg(e,t,n);else{const o="function"==typeof t?og(e,t,n.custom):t;r=Promise.all(vg(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}(e,t,n)))}function by(e){let t=yy(e),n=ky(),r=!0,o=!1;const a=t=>(n,r)=>{var o;const a=og(e,r,"exit"===t?null==(o=e.presenceContext)?void 0:o.custom:void 0);if(a){const{transition:e,transitionEnd:t,...r}=a;n={...n,...r,...t}}return n};function i(i){const{props:s}=e,l=hy(e.parent)||{},u=[],c=new Set;let d={},f=1/0;for(let t=0;t<vy;t++){const p=gy[t],h=n[p],m=void 0!==s[p]?s[p]:l[p],g=vv(m),v=p===i?h.isActive:null;!1===v&&(f=t);let y=m===l[p]&&m!==s[p]&&g;if(y&&(r||o)&&e.manuallyAnimateOnMount&&(y=!1),h.protectedKeys={...d},!h.isActive&&null===v||!m&&!h.prevProp||gv(m)||"boolean"==typeof m)continue;if("exit"===p&&h.isActive&&!0!==v){h.prevResolvedValues&&(d={...d,...h.prevResolvedValues});continue}const b=xy(h.prevProp,m);let x=b||p===i&&h.isActive&&!y&&g||t>f&&g,w=!1;const k=Array.isArray(m)?m:[m];let S=k.reduce(a(p),{});!1===v&&(S={});const{prevResolvedValues:E={}}=h,j={...E,...S},C=t=>{x=!0,c.has(t)&&(w=!0,c.delete(t)),h.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in j){const t=S[e],n=E[e];if(d.hasOwnProperty(e))continue;let r=!1;r=lg(t)&&lg(n)?!my(t,n):t!==n,r?null!=t?C(e):c.add(e):void 0!==t&&c.has(e)?C(e):h.protectedKeys[e]=!0}h.prevProp=m,h.prevResolvedValues=S,h.isActive&&(d={...d,...S}),(r||o)&&e.blockInitialAnimation&&(x=!1);const P=y&&b;x&&(!P||w)&&u.push(...k.map(t=>{const n={type:p};if("string"==typeof t&&(r||o)&&!P&&e.manuallyAnimateOnMount&&e.parent){const{parent:r}=e,o=og(r,t);if(r.enteringChildren&&o){const{delayChildren:t}=o.transition||{};n.delay=Hm(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(c.size){const t={};if("boolean"!=typeof s.initial){const n=og(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}c.forEach(n=>{const r=e.getBaseTarget(n),o=e.getValue(n);o&&(o.liveStyle=!0),t[n]=r??null}),u.push({animation:t})}let p=Boolean(u.length);return!r||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(p=!1),r=!1,o=!1,p?t(u):Promise.resolve()}return{animateChanges:i,setActive:function(t,r){var o;if(n[t].isActive===r)return Promise.resolve();null==(o=e.variantChildren)||o.forEach(e=>{var n;return null==(n=e.animationState)?void 0:n.setActive(t,r)}),n[t].isActive=r;const a=i(t);for(const e in n)n[e].protectedKeys={};return a},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=ky(),o=!0}}}function xy(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!my(t,e)}function wy(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ky(){return{animate:wy(!0),whileInView:wy(),whileHover:wy(),whileTap:wy(),whileDrag:wy(),whileFocus:wy(),exit:wy()}}function Sy(e,t){e.min=t.min,e.max=t.max}function Ey(e,t){Sy(e.x,t.x),Sy(e.y,t.y)}function jy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Cy(e){return e.max-e.min}function Py(e,t,n,r=.5){e.origin=r,e.originPoint=ih(t.min,t.max,e.origin),e.scale=Cy(n)/Cy(t),e.translate=ih(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function Ny(e,t,n,r){Py(e.x,t.x,n.x,r?r.originX:void 0),Py(e.y,t.y,n.y,r?r.originY:void 0)}function Ty(e,t,n,r=0){const o=r?ih(n.min,n.max,r):n.min;e.min=o+t.min,e.max=e.min+Cy(t)}function My(e,t,n,r=0){const o=r?ih(n.min,n.max,r):n.min;e.min=t.min-o,e.max=e.min+Cy(t)}function Ry(e,t,n,r){My(e.x,t.x,n.x,null==r?void 0:r.x),My(e.y,t.y,n.y,null==r?void 0:r.y)}function Ly(e,t,n,r,o){return e=Iv(e-=t,1/n,r),void 0!==o&&(e=Iv(e,1/o,r)),e}function Dy(e,t,[n,r,o],a,i){!function(e,t=0,n=1,r=.5,o,a=e,i=e){Up.test(t)&&(t=parseFloat(t),t=ih(i.min,i.max,t/100)-i.min);if("number"!=typeof t)return;let s=ih(a.min,a.max,r);e===a&&(s-=t),e.min=Ly(e.min,t,n,s,o),e.max=Ly(e.max,t,n,s,o)}(e,t[n],t[r],t[o],t.scale,a,i)}const _y=["x","scaleX","originX"],Ay=["y","scaleY","originY"];function Oy(e,t,n,r){Dy(e.x,t,_y,n?n.x:void 0,r?r.x:void 0),Dy(e.y,t,Ay,n?n.y:void 0,r?r.y:void 0)}function Iy(e){return 0===e.translate&&1===e.scale}function zy(e){return Iy(e.x)&&Iy(e.y)}function Fy(e,t){return e.min===t.min&&e.max===t.max}function Vy(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function $y(e,t){return Vy(e.x,t.x)&&Vy(e.y,t.y)}function By(e){return Cy(e.x)/Cy(e.y)}function Uy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Wy(e){return[e("x"),e("y")]}const Hy=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Gy=Hy.length,Yy=e=>"string"==typeof e?parseFloat(e):e,Ky=e=>"number"==typeof e||Wp.test(e);function qy(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Xy=Zy(0,.5,sp),Qy=Zy(.5,.95,Wf);function Zy(e,t,n){return r=>r<e?0:r>t?1:n(Yf(e,t,r))}function Jy(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const eb=(e,t)=>e.depth-t.depth;class tb{constructor(){this.children=[],this.isDirty=!1}add(e){Of(this.children,e),this.isDirty=!0}remove(e){If(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(eb),this.isDirty=!1,this.children.forEach(e)}}function nb(e){return dg(e)?e.get():e}class rb{constructor(){this.members=[]}add(e){Of(this.members,e);for(let t=this.members.length-1;t>=0;t--){const n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;const r=n.instance;r&&!1!==r.isConnected||n.snapshot||(If(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(If(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){var t;for(let n=this.members.indexOf(e)-1;n>=0;n--){const e=this.members[n];if(!1!==e.isPresent&&!1!==(null==(t=e.instance)?void 0:t.isConnected))return this.promote(e),!0}return!1}promote(e,t){var n;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:o}=r.options,{layoutDependency:a}=e.options;void 0!==o&&o===a||(e.resumeFrom=r,t&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(null==(n=e.root)?void 0:n.isUpdating)&&(e.isLayoutDirty=!0)),!1===e.options.crossfade&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var t,n,r,o,a;null==(n=(t=e.options).onExitComplete)||n.call(t),null==(a=null==(r=e.resumingFrom)?void 0:(o=r.options).onExitComplete)||a.call(o)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(null==(e=this.lead)?void 0:e.snapshot)&&(this.lead.snapshot=void 0)}}const ob={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ab=["","X","Y","Z"];let ib=0;function sb(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function lb(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=mg(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",vp,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&lb(r)}function ub({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=ib++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(fb),this.nodes.forEach(wb),this.nodes.forEach(kb),this.nodes.forEach(pb)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new tb)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Kf),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;var n;this.isSVG=ev(t)&&!(ev(n=t)&&"svg"===n.tagName),this.instance=t;const{layoutId:r,layout:o,visualElement:a}=this.options;if(a&&!a.current&&a.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(o||r)&&(this.isLayoutDirty=!0),e){let n,r=0;const o=()=>this.root.updateBlockedByResize=!1;vp.read(()=>{r=window.innerWidth}),e(t,()=>{const e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=Sp.now(),r=({timestamp:o})=>{const a=o-n;a>=t&&(yp(r),e(a-t))};return vp.setup(r,!0),()=>yp(r)}(o,250),ob.hasAnimatedSinceResize&&(ob.hasAnimatedSinceResize=!1,this.nodes.forEach(xb)))})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&a&&(r||o)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||a.getDefaultTransition()||Nb,{onLayoutAnimationStart:i,onLayoutAnimationComplete:s}=a.getProps(),l=!this.targetLayout||!$y(this.targetLayout,r),u=!t&&n;if(this.options.layoutRoot||this.resumeFrom||u||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const t={...Jm(o,"layout"),onPlay:i,onComplete:s};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,u)}else t||xb(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),yp(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(Sb),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&lb(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let o=0;o<this.path.length;o++){const e=this.path[o];e.shouldResetTransform=!0,"string"!=typeof e.latestValues.x&&"string"!=typeof e.latestValues.y||(e.isLayoutDirty=!0),e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:t,layout:n}=this.options;if(void 0===t&&!n)return;const r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked()){const e=this.updateBlockedByResize;return this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(gb),void this.nodes.forEach(mb)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(vb);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(yb),this.nodes.forEach(bb),this.nodes.forEach(cb),this.nodes.forEach(db)):this.nodes.forEach(vb),this.clearAllSnapshots();const e=Sp.now();bp.delta=zf(0,1e3/60,e-bp.timestamp),bp.timestamp=e,bp.isProcessing=!0,xp.update.process(bp),xp.preRender.process(bp),xp.render.process(bp),bp.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Fg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(hb),this.sharedNodes.forEach(Eb)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,vp.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){vp.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Cy(this.snapshot.measuredBox.x)||Cy(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let n=0;n<this.path.length;n++){this.path[n].updateScroll()}const e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}}),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){const t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!zy(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||_v(this.latestValues)||a)&&(o(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let n=this.removeElementScroll(t);var r;return e&&(n=this.removeTransform(n)),Rb((r=n).x),Rb(r.y),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){var e;const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const n=t.measureViewportBox();if(!((null==(e=this.scroll)?void 0:e.wasRoot)||this.path.some(Db))){const{scroll:e}=this.root;e&&(Uv(n.x,e.offset.x),Uv(n.y,e.offset.y))}return n}removeElementScroll(e){var t;const n={x:{min:0,max:0},y:{min:0,max:0}};if(Ey(n,e),null==(t=this.scroll)?void 0:t.wasRoot)return n;for(let r=0;r<this.path.length;r++){const t=this.path[r],{scroll:o,options:a}=t;t!==this.root&&o&&a.layoutScroll&&(o.wasRoot&&Ey(n,e),Uv(n.x,o.offset.x),Uv(n.y,o.offset.y))}return n}applyTransform(e,t=!1,n){var r,o;const a=n||{x:{min:0,max:0},y:{min:0,max:0}};Ey(a,e);for(let i=0;i<this.path.length;i++){const e=this.path[i];!t&&e.options.layoutScroll&&e.scroll&&e!==e.root&&(Uv(a.x,-e.scroll.offset.x),Uv(a.y,-e.scroll.offset.y)),_v(e.latestValues)&&Gv(a,e.latestValues,null==(r=e.layout)?void 0:r.layoutBox)}return _v(this.latestValues)&&Gv(a,this.latestValues,null==(o=this.layout)?void 0:o.layoutBox),a}removeTransform(e){var t;const n={x:{min:0,max:0},y:{min:0,max:0}};Ey(n,e);for(let r=0;r<this.path.length;r++){const e=this.path[r];if(!_v(e.latestValues))continue;let o;e.instance&&(Dv(e.latestValues)&&e.updateSnapshot(),o=hv(),Ey(o,e.measurePageBox())),Oy(n,e.latestValues,null==(t=e.snapshot)?void 0:t.layoutBox,o)}return _v(this.latestValues)&&Oy(n,this.latestValues),n}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==bp.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const r=Boolean(this.resumingFrom)||this!==n;if(!(e||r&&this.isSharedProjectionDirty||this.isProjectionDirty||(null==(t=this.parent)?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:o,layoutId:a}=this.options;if(!this.layout||!o&&!a)return;this.resolvedRelativeTargetAt=bp.timestamp;const i=this.getClosestProjectingParent();var s,l,u,c;(i&&this.linkedParentVersion!==i.layoutVersion&&!i.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&i&&i.layout?this.createRelativeTarget(i,this.layout.layoutBox,i.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta)&&(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),s=this.target,l=this.relativeTarget,u=this.relativeParent.target,c=this.options.layoutAnchor||void 0,Ty(s.x,l.x,u.x,null==c?void 0:c.x),Ty(s.y,l.y,u.y,null==c?void 0:c.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.applyTransform(this.layout.layoutBox,!1,this.target):Ey(this.target,this.layout.layoutBox),Vv(this.target,this.targetDelta)):Ey(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&i&&Boolean(i.resumingFrom)===Boolean(this.resumingFrom)&&!i.options.layoutScroll&&i.target&&1!==this.animationProgress?this.createRelativeTarget(i,this.target,i.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(this.parent&&!Dv(this.parent.latestValues)&&!Av(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ry(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Ey(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var e;const t=this.getLead(),n=Boolean(this.resumingFrom)||this!==t;let r=!0;if((this.isProjectionDirty||(null==(e=this.parent)?void 0:e.isProjectionDirty))&&(r=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===bp.timestamp&&(r=!1),r)return;const{layout:o,layoutId:a}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!o&&!a)return;Ey(this.layoutCorrected,this.layout.layoutBox);const i=this.treeScale.x,s=this.treeScale.y;!function(e,t,n,r=!1){var o;const a=n.length;if(!a)return;let i,s;t.x=t.y=1;for(let l=0;l<a;l++){i=n[l],s=i.projectionDelta;const{visualElement:a}=i.options;a&&a.props.style&&"contents"===a.props.style.display||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(Uv(e.x,-i.scroll.offset.x),Uv(e.y,-i.scroll.offset.y)),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Vv(e,s)),r&&_v(i.latestValues)&&Gv(e,i.latestValues,null==(o=i.layout)?void 0:o.layoutBox))}t.x<Bv&&t.x>$v&&(t.x=1),t.y<Bv&&t.y>$v&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(jy(this.prevProjectionDelta.x,this.projectionDelta.x),jy(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Ny(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===i&&this.treeScale.y===s&&Uy(this.projectionDelta.x,this.prevProjectionDelta.x)&&Uy(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null==(t=this.options.visualElement)||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},o={...this.latestValues},a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const i={x:{min:0,max:0},y:{min:0,max:0}},s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,c=Boolean(s&&!u&&!0===this.options.crossfade&&!this.path.some(Pb));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,f,p,h;jb(a.x,e.x,n),jb(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ry(i,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),l=this.relativeTarget,f=this.relativeTargetOrigin,p=i,h=n,Cb(l.x,f.x,p.x,h),Cb(l.y,f.y,p.y,h),d&&function(e,t){return Fy(e.x,t.x)&&Fy(e.y,t.y)}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Ey(d,this.relativeTarget)),s&&(this.animationValues=o,function(e,t,n,r,o,a){o?(e.opacity=ih(0,n.opacity??1,Xy(r)),e.opacityExit=ih(t.opacity??1,0,Qy(r))):a&&(e.opacity=ih(t.opacity??1,n.opacity??1,r));for(let i=0;i<Gy;i++){const o=Hy[i];let a=qy(t,o),s=qy(n,o);void 0===a&&void 0===s||(a||(a=0),s||(s=0),0===a||0===s||Ky(a)===Ky(s)?(e[o]=Math.max(ih(Yy(a),Yy(s),r),0),(Up.test(s)||Up.test(a))&&(e[o]+="%")):e[o]=s)}(t.rotate||n.rotate)&&(e.rotate=ih(t.rotate||0,n.rotate||0,r))}(o,r,this.latestValues,n,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){var t,n,r;this.notifyListeners("animationStart"),null==(t=this.currentAnimation)||t.stop(),null==(r=null==(n=this.resumingFrom)?void 0:n.currentAnimation)||r.stop(),this.pendingAnimation&&(yp(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=vp.update(()=>{ob.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=sg(0)),this.motionValue.jump(0,!1),this.currentAnimation=function(e,t,n){const r=dg(e)?e:sg(e);return r.start(tg("",r,t,n)),r.animation}(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&Lb(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=Cy(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=Cy(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Ey(t,n),Gv(t,o),Ny(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new rb);this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null==(e=this.getStack())?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null==(e=this.getStack())?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&sb("z",e,r,this.animationValues);for(let o=0;o<ab.length;o++)sb(`rotate${ab[o]}`,e,r,this.animationValues),sb(`skew${ab[o]}`,e,r,this.animationValues);e.render();for(const o in r)e.setStaticValue(o,r[o]),this.animationValues&&(this.animationValues[o]=r[o]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(e.visibility="hidden");const n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,e.visibility="",e.opacity="",e.pointerEvents=nb(null==t?void 0:t.pointerEvents)||"",void(e.transform=n?n(this.latestValues,""):"none");const r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target)return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=nb(null==t?void 0:t.pointerEvents)||""),void(this.hasProjected&&!_v(this.latestValues)&&(e.transform=n?n({},""):"none",this.hasProjected=!1));e.visibility="";const o=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=function(e,t,n){let r="";const o=e.x.translate/t.x,a=e.y.translate/t.y,i=(null==n?void 0:n.z)||0;if((o||a||i)&&(r=`translate3d(${o}px, ${a}px, ${i}px) `),1===t.x&&1===t.y||(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:e,rotate:t,rotateX:o,rotateY:a,skewX:i,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),o&&(r+=`rotateX(${o}deg) `),a&&(r+=`rotateY(${a}deg) `),i&&(r+=`skewX(${i}deg) `),s&&(r+=`skewY(${s}deg) `)}const s=e.x.scale*t.x,l=e.y.scale*t.y;return 1===s&&1===l||(r+=`scale(${s}, ${l})`),r||"none"}(this.projectionDeltaWithTransform,this.treeScale,o);n&&(a=n(o,a)),e.transform=a;const{x:i,y:s}=this.projectionDelta;e.transformOrigin=`${100*i.origin}% ${100*s.origin}% 0`,r.animationValues?e.opacity=r===this?o.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:o.opacityExit:e.opacity=r===this?void 0!==o.opacity?o.opacity:"":void 0!==o.opacityExit?o.opacityExit:0;for(const l in ty){if(void 0===o[l])continue;const{correct:t,applyTo:n,isCSSVariable:i}=ty[l],s="none"===a?o[l]:t(o[l],r);if(n){const t=n.length;for(let r=0;r<t;r++)e[n[r]]=s}else i?this.options.visualElement.renderState.vars[l]=s:e[l]=s}this.options.layoutId&&(e.pointerEvents=r===this?nb(null==t?void 0:t.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>{var t;return null==(t=e.currentAnimation)?void 0:t.stop()}),this.root.nodes.forEach(mb),this.root.sharedNodes.clear()}}}function cb(e){e.updateLayout()}function db(e){var t;const n=(null==(t=e.resumeFrom)?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:o}=e.options,a=n.source!==e.layout.source;if("size"===o)Wy(e=>{const r=a?n.measuredBox[e]:n.layoutBox[e],o=Cy(r);r.min=t[e].min,r.max=r.min+o});else if("x"===o||"y"===o){const e="x"===o?"y":"x";Sy(a?n.measuredBox[e]:n.layoutBox[e],t[e])}else Lb(o,n.layoutBox,t)&&Wy(r=>{const o=a?n.measuredBox[r]:n.layoutBox[r],i=Cy(t[r]);o.max=o.min+i,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+i)});const i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Ny(i,t,n.layoutBox);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};a?Ny(s,e.applyTransform(r,!0),n.measuredBox):Ny(s,t,n.layoutBox);const l=!zy(i);let u=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:a}=r;if(o&&a){const i=e.options.layoutAnchor||void 0,s={x:{min:0,max:0},y:{min:0,max:0}};Ry(s,n.layoutBox,o.layoutBox,i);const l={x:{min:0,max:0},y:{min:0,max:0}};Ry(l,t,a.layoutBox,i),$y(s,l)||(u=!0),r.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:s,layoutDelta:i,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function fb(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function pb(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function hb(e){e.clearSnapshot()}function mb(e){e.clearMeasurements()}function gb(e){e.isLayoutDirty=!0,e.updateLayout()}function vb(e){e.isLayoutDirty=!1}function yb(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function bb(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function xb(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function wb(e){e.resolveTargetDelta()}function kb(e){e.calcProjection()}function Sb(e){e.resetSkewAndRotation()}function Eb(e){e.removeLeadSnapshot()}function jb(e,t,n){e.translate=ih(t.translate,0,n),e.scale=ih(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Cb(e,t,n,r){e.min=ih(t.min,n.min,r),e.max=ih(t.max,n.max,r)}function Pb(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const Nb={duration:.45,ease:[.4,0,.1,1]},Tb=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Mb=Tb("applewebkit/")&&!Tb("chrome/")?Math.round:Wf;function Rb(e){e.min=Mb(e.min),e.max=Mb(e.max)}function Lb(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=By(t),o=By(n),a=.2,!(Math.abs(r-o)<=a));var r,o,a}function Db(e){var t;return e!==e.root&&(null==(t=e.scroll)?void 0:t.wasRoot)}const _b=ub({attachResizeListener:(e,t)=>Jy(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||(null==(e=document.body)?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||(null==(t=document.body)?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Ab={current:void 0},Ob=ub({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ab.current){const e=new _b({});e.mount(window),e.setOptions({layoutScroll:!0}),Ab.current=e}return Ab.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),Ib=W.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function zb(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Fb(...e){return W.useCallback(function(...e){return t=>{let n=!1;const r=e.map(e=>{const r=zb(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():zb(e[t],null)}}}}(...e),e)}class Vb extends W.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(zg(t)&&e.isPresent&&!this.props.isPresent&&!1!==this.props.pop){const e=t.offsetParent,n=zg(e)&&e.offsetWidth||0,r=zg(e)&&e.offsetHeight||0,o=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.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 $b({children:e,isPresent:t,anchorX:n,anchorY:r,root:o,pop:a}){var i;const s=W.useId(),l=W.useRef(null),u=W.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=W.useContext(Ib),d=(null==(i=e.props)?void 0:i.ref)??(null==e?void 0:e.ref),f=Fb(l,d);return W.useInsertionEffect(()=>{const{width:e,height:i,top:d,left:f,right:p,bottom:h}=u.current;if(t||!1===a||!l.current||!e||!i)return;const m="left"===n?`left: ${f}`:`right: ${p}`,g="bottom"===r?`bottom: ${h}`:`top: ${d}`;l.current.dataset.motionPopId=s;const v=document.createElement("style");c&&(v.nonce=c);const y=o??document.head;return y.appendChild(v),v.sheet&&v.sheet.insertRule(`\n [data-motion-pop-id="${s}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${i}px !important;\n ${m}px !important;\n ${g}px !important;\n }\n `),()=>{var e;null==(e=l.current)||e.removeAttribute("data-motion-pop-id"),y.contains(v)&&y.removeChild(v)}},[t]),ee.jsx(Vb,{isPresent:t,childRef:l,sizeRef:u,pop:a,children:!1===a?e:W.cloneElement(e,{ref:f})})}const Bb=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:a,mode:i,anchorX:s,anchorY:l,root:u})=>{const c=Df(Ub),d=W.useId();let f=!0,p=W.useMemo(()=>(f=!1,{id:d,initial:t,isPresent:n,custom:o,onExitComplete:e=>{c.set(e,!0);for(const t of c.values())if(!t)return;r&&r()},register:e=>(c.set(e,!1),()=>c.delete(e))}),[n,c,r]);return a&&f&&(p={...p}),W.useMemo(()=>{c.forEach((e,t)=>c.set(t,!1))},[n]),W.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),e=ee.jsx($b,{pop:"popLayout"===i,isPresent:n,anchorX:s,anchorY:l,root:u,children:e}),ee.jsx(Af.Provider,{value:p,children:e})};function Ub(){return new Map}function Wb(e=!0){const t=W.useContext(Af);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,a=W.useId();W.useEffect(()=>{if(e)return o(a)},[e]);const i=W.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,i]:[!0]}const Hb=e=>e.key||"";function Gb(e){const t=[];return W.Children.forEach(e,e=>{W.isValidElement(e)&&t.push(e)}),t}const Yb=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:a="sync",propagate:i=!1,anchorX:s="left",anchorY:l="top",root:u})=>{const[c,d]=Wb(i),f=W.useMemo(()=>Gb(e),[e]),p=i&&!c?[]:f.map(Hb),h=W.useRef(!0),m=W.useRef(f),g=Df(()=>new Map),v=W.useRef(new Set),[y,b]=W.useState(f),[x,w]=W.useState(f);_f(()=>{h.current=!1,m.current=f;for(let e=0;e<x.length;e++){const t=Hb(x[e]);p.includes(t)?(g.delete(t),v.current.delete(t)):!0!==g.get(t)&&g.set(t,!1)}},[x,p.length,p.join("-")]);const k=[];if(f!==y){let e=[...f];for(let t=0;t<x.length;t++){const n=x[t],r=Hb(n);p.includes(r)||(e.splice(t,0,n),k.push(n))}return"wait"===a&&k.length&&(e=k),w(Gb(e)),b(f),null}const{forceRender:S}=W.useContext(Lf);return ee.jsx(ee.Fragment,{children:x.map(e=>{const y=Hb(e),b=!(i&&!c)&&(f===x||p.includes(y));return ee.jsx(Bb,{isPresent:b,initial:!(h.current&&!n)&&void 0,custom:t,presenceAffectsLayout:o,mode:a,root:u,onExitComplete:b?void 0:()=>{if(v.current.has(y))return;if(!g.has(y))return;v.current.add(y),g.set(y,!0);let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(null==S||S(),w(m.current),i&&(null==d||d()),r&&r())},anchorX:s,anchorY:l,children:e},y)})})},Kb=W.createContext({strict:!1}),qb={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Xb=!1;function Qb(){return function(){if(Xb)return;const e={};for(const t in qb)e[t]={isEnabled:e=>qb[t].some(t=>!!e[t])};Pv(e),Xb=!0}(),Cv}const Zb=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Jb(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Zb.has(e)}let ex=e=>!Jb(e);try{"function"==typeof(tx=require("@emotion/is-prop-valid").default)&&(ex=e=>e.startsWith("on")?!Jb(e):tx(e))}catch{}var tx;const nx=W.createContext({});function rx(e){const{initial:t,animate:n}=function(e,t){if(xv(e)){const{initial:t,animate:n}=e;return{initial:!1===t||vv(t)?t:void 0,animate:vv(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,W.useContext(nx));return W.useMemo(()=>({initial:t,animate:n}),[ox(t),ox(n)])}function ox(e){return Array.isArray(e)?e.join(" "):e}const ax=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ix(e,t,n){for(const r in t)dg(t[r])||ny(r,n)||(e[r]=t[r])}function sx(e,t){const n={};return ix(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return W.useMemo(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Xv(n,t,e),Object.assign({},n.vars,n.style)},[t])}(e,t)),n}function lx(e,t){const n={},r=sx(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const ux=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function cx(e,t,n,r){const o=W.useMemo(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return ly(n,t,cy(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){const t={};ix(t,e.style,e),o.style={...t,...o.style}}return o}const dx=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function fx(e){return"string"==typeof e&&!e.includes("-")&&!!(dx.indexOf(e)>-1||/[A-Z]/u.test(e))}function px(e,t,n,{latestValues:r},o,a=!1,i){const s=(i??fx(e)?cx:lx)(t,r,o,e),l=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||dg(e[o])||(ex(o)||!0===n&&Jb(o)||!t&&!Jb(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(t,"string"==typeof e,a),u=e!==W.Fragment?{...l,...s,ref:n}:{},{children:c}=t,d=W.useMemo(()=>dg(c)?c.get():c,[c]);return W.createElement(e,{...u,children:d})}function hx(e,t,n,r){const o={},a=r(e,{});for(const f in a)o[f]=nb(a[f]);let{initial:i,animate:s}=e;const l=xv(e),u=wv(e);t&&u&&!l&&!1!==e.inherit&&(void 0===i&&(i=t.initial),void 0===s&&(s=t.animate));let c=!!n&&!1===n.initial;c=c||!1===i;const d=c?s:i;if(d&&"boolean"!=typeof d&&!gv(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){const r=rg(e,t[n]);if(r){const{transitionEnd:e,transition:t,...n}=r;for(const r in n){let e=n[r];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(o[r]=e)}for(const r in e)o[r]=e[r]}}}return o}const mx=e=>(t,n)=>{const r=W.useContext(nx),o=W.useContext(Af),a=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:hx(n,r,o,e),renderState:t()}}(e,t,r,o);return n?a():Df(a)},gx=mx({scrapeMotionValuesFromProps:ry,createRenderState:ax}),vx=mx({scrapeMotionValuesFromProps:dy,createRenderState:ux}),yx=Symbol.for("motionComponentSymbol");function bx(e,t,n){const r=W.useRef(n);W.useInsertionEffect(()=>{r.current=n});const o=W.useRef(null);return W.useCallback(n=>{var a;n&&(null==(a=e.onMount)||a.call(e,n));const i=r.current;if("function"==typeof i)if(n){const e=i(n);"function"==typeof e&&(o.current=e)}else o.current?(o.current(),o.current=null):i(n);else i&&(i.current=n);t&&(n?t.mount(n):t.unmount())},[t])}const xx=W.createContext({});function wx(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function kx(e,t,n,r,o,a){var i,s;const{visualElement:l}=W.useContext(nx),u=W.useContext(Kb),c=W.useContext(Af),d=W.useContext(Ib),f=d.reducedMotion,p=d.skipAnimations,h=W.useRef(null),m=W.useRef(!1);r=r||u.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:l,props:n,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:f,skipAnimations:p,isSVG:a}),m.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const g=h.current,v=W.useContext(xx);!g||g.projection||!o||"html"!==g.type&&"svg"!==g.type||function(e,t,n,r){const{layoutId:o,layout:a,drag:i,dragConstraints:s,layoutScroll:l,layoutRoot:u,layoutAnchor:c,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Sx(e.parent)),e.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:Boolean(i)||s&&wx(s),visualElement:e,animationType:"string"==typeof a?a:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:u,layoutAnchor:c})}(h.current,n,o,v);const y=W.useRef(!1);W.useInsertionEffect(()=>{g&&y.current&&g.update(n,c)});const b=n[hg],x=W.useRef(Boolean(b)&&"undefined"!=typeof window&&!(null==(i=window.MotionHandoffIsComplete)?void 0:i.call(window,b))&&(null==(s=window.MotionHasOptimisedAnimation)?void 0:s.call(window,b)));return _f(()=>{m.current=!0,g&&(y.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),x.current&&g.animationState&&g.animationState.animateChanges())}),W.useEffect(()=>{g&&(!x.current&&g.animationState&&g.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var e;null==(e=window.MotionHandoffMarkAsComplete)||e.call(window,b)}),x.current=!1),g.enteringChildren=void 0)}),g}function Sx(e){if(e)return!1!==e.options.allowProjection?e.projection:Sx(e.parent)}function Ex(e,{forwardMotionProps:t=!1,type:n}={},r,o){r&&function(e){const t=Qb();for(const n in e)t[n]={...t[n],...e[n]};Pv(t)}(r);const a=n?"svg"===n:fx(e),i=a?vx:gx;function s(n,r){let s;const l={...W.useContext(Ib),...n,layoutId:jx(n)},{isStatic:u}=l,c=rx(n),d=i(n,u);if(!u&&"undefined"!=typeof window){W.useContext(Kb).strict;const t=function(e){const t=Qb(),{drag:n,layout:r}=t;if(!n&&!r)return{};const o={...n,...r};return{MeasureLayout:(null==n?void 0:n.isEnabled(e))||(null==r?void 0:r.isEnabled(e))?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}(l);s=t.MeasureLayout,c.visualElement=kx(e,d,l,o,t.ProjectionNode,a)}return ee.jsxs(nx.Provider,{value:c,children:[s&&c.visualElement?ee.jsx(s,{visualElement:c.visualElement,...l}):null,px(e,n,bx(d,c.visualElement,r),d,u,t,a)]})}s.displayName=`motion.${"string"==typeof e?e:`create(${e.displayName??e.name??""})`}`;const l=W.forwardRef(s);return l[yx]=e,l}function jx({layoutId:e}){const t=W.useContext(Lf).id;return t&&void 0!==e?t+"-"+e:e}function Cx(e,t){if("undefined"==typeof Proxy)return Ex;const n=new Map,r=(n,r)=>Ex(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(o,a)=>"create"===a?r:(n.has(a)||n.set(a,Ex(a,void 0,e,t)),n.get(a))})}const Px=(e,t)=>t.isSVG??fx(e)?new fy(t):new oy(t,{allowProjection:e!==W.Fragment});let Nx=0;const Tx={animation:{Feature:class extends Mv{constructor(e){super(e),e.animationState||(e.animationState=by(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();gv(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null==(e=this.unmountControls)||e.call(this)}}},exit:{Feature:class extends Mv{constructor(){super(...arguments),this.id=Nx++,this.isExitComplete=!1}update(){var e;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&!1===r){if(this.isExitComplete){const{initial:t,custom:n}=this.node.getProps();if("string"==typeof t){const r=og(this.node,t,n);if(r){const{transition:t,transitionEnd:n,...o}=r;for(const r in o)null==(e=this.node.getValue(r))||e.jump(o[r])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Mx(e){return{point:{x:e.pageX,y:e.pageY}}}function Rx(e,t,n,r){return Jy(e,t,(e=>t=>Hg(t)&&e(t,Mx(t)))(n),r)}const Lx=({current:e})=>e?e.ownerDocument.defaultView:null,Dx=(e,t)=>Math.abs(e-t);const _x=new Set(["auto","scroll"]);class Ax{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:o=!1,distanceThreshold:a=3,element:i}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ox(this.lastRawMoveEventInfo,this.transformPagePoint));const e=zx(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=Dx(e.x,t.x),r=Dx(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=bp;this.history.push({...r,timestamp:o});const{onStart:a,onMove:i}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),i&&i(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Ox(t,this.transformPagePoint),vp.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:o}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const a=zx("pointercancel"===e.type?this.lastMoveEventInfo:Ox(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Hg(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;const s=Ox(Mx(e),this.transformPagePoint),{point:l}=s,{timestamp:u}=bp;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=t;c&&c(e,zx(s,this.history)),this.removeListeners=Gf(Rx(this.contextWindow,"pointermove",this.handlePointerMove),Rx(this.contextWindow,"pointerup",this.handlePointerUp),Rx(this.contextWindow,"pointercancel",this.handlePointerUp)),i&&this.startScrollTracking(i)}startScrollTracking(e){let t=e.parentElement;for(;t;){const e=getComputedStyle(t);(_x.has(e.overflowX)||_x.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const t=this.scrollPositions.get(e);if(!t)return;const n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},o=r.x-t.x,a=r.y-t.y;0===o&&0===a||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o,this.lastMoveEventInfo.point.y+=a):this.history.length>0&&(this.history[0].x-=o,this.history[0].y-=a),this.scrollPositions.set(e,r),vp.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),yp(this.updatePoint)}}function Ox(e,t){return t?{point:t(e.point)}:e}function Ix(e,t){return{x:e.x-t.x,y:e.y-t.y}}function zx({point:e},t){return{point:e,delta:Ix(e,Vx(t)),offset:Ix(e,Fx(t)),velocity:$x(t,.1)}}function Fx(e){return e[0]}function Vx(e){return e[e.length-1]}function $x(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Vx(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>qf(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&o.timestamp-r.timestamp>2*qf(t)&&(r=e[1]);const a=Xf(o.timestamp-r.timestamp);if(0===a)return{x:0,y:0};const i={x:(o.x-r.x)/a,y:(o.y-r.y)/a};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function Bx(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Ux(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}const Wx=.35;function Hx(e,t,n){return{min:Gx(e,t),max:Gx(e,n)}}function Gx(e,t){return"number"==typeof e?e:e[t]||0}const Yx=new WeakMap;class Kx{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){const{presenceContext:r}=this.visualElement;if(r&&!1===r.isPresent)return;const{dragSnapToOrigin:o}=this.getProps();this.panSession=new Ax(e,{onSessionStart:e=>{t&&this.snapToCursor(Mx(e).point),this.stopAnimation()},onStart:(e,t)=>{const{drag:n,dragPropagation:r,onDragStart:o}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(a=n)||"y"===a?Vg[a]?null:(Vg[a]=!0,()=>{Vg[a]=!1}):Vg.x||Vg.y?null:(Vg.x=Vg.y=!0,()=>{Vg.x=Vg.y=!1}),!this.openDragLock))return;var a;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Wy(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Up.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];if(r){t=Cy(r)*(parseFloat(t)/100)}}}this.originPoint[e]=t}),o&&vp.update(()=>o(e,t),!1,!0),fg(this.visualElement,"transform");const{animationState:i}=this.visualElement;i&&i.setActive("whileDrag",!0)},onMove:(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:i}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(i),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,i),this.updateAxis("y",t.point,i),this.visualElement.render(),a&&vp.update(()=>a(e,t),!1,!0)},onSessionEnd:(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:o,distanceThreshold:n,contextWindow:Lx(this.visualElement),element:this.visualElement.current})}stop(e,t){const n=e||this.latestPointerEvent,r=t||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!r||!n)return;const{velocity:a}=r;this.startAnimation(a);const{onDragEnd:i}=this.getProps();i&&vp.postRender(()=>i(n,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!Xx(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=function(e,{min:t,max:n},r){return void 0!==t&&e<t?e=r?ih(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?ih(n,e,r.max):Math.min(e,n)),e}(a,this.constraints[e],this.elastic[e])),o.set(a)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null==(e=this.visualElement.projection)?void 0:e.layout,o=this.constraints;t&&wx(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:Bx(e.x,n,o),y:Bx(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=Wx){return!1===e?e=0:!0===e&&(e=Wx),{x:Hx(e,"left","right"),y:Hx(e,"top","bottom")}}(n),o!==this.constraints&&!wx(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Wy(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!wx(e))return!1;const n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(e,t,n){const r=Yv(e,n),{scroll:o}=t;return o&&(Uv(r.x,o.offset.x),Uv(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let a=function(e,t){return{x:Ux(e.x,t.x),y:Ux(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(a));this.hasMutatedConstraints=!!e,e&&(a=Rv(e))}return a}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:i}=this.getProps(),s=this.constraints||{},l=Wy(i=>{if(!Xx(i,t,this.currentDirection))return;let l=s&&s[i]||{};!0!==a&&a!==i||(l={min:0,max:0});const u=r?200:1e6,c=r?40:1e7,d={type:"inertia",velocity:n?e[i]:0,bounceStiffness:u,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(i,d)});return Promise.all(l).then(i)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return fg(this.visualElement,e),n.start(tg(e,n,0,t,this.visualElement,!1))}stopAnimation(){Wy(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),r=n[t];return r||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Wy(t=>{const{drag:n}=this.getProps();if(!Xx(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:a}=r.layout.layoutBox[t],i=o.get()||0;o.set(e[t]-ih(n,a,.5)+i)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!wx(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Wy(e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=Cy(e),o=Cy(t);return o>r?n=Yf(t.min,t.max-r,e.min):r>o&&(n=Yf(e.min,e.max-o,t.min)),zf(0,1,n)}({min:n,max:n},this.constraints[e])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Wy(t=>{if(!Xx(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:a}=this.constraints[t];n.set(ih(o,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Yx.set(this.visualElement,this);const e=this.visualElement.current,t=Rx(e,"pointerdown",t=>{const{drag:n,dragListener:r=!0}=this.getProps(),o=t.target,a=o!==e&&function(e){return Yg.has(e.tagName)||!0===e.isContentEditable}(o);n&&r&&!a&&this.start(t)});let n;const r=()=>{const{dragConstraints:t}=this.getProps();wx(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(e,t,n){const r=fv(e,qx(n)),o=fv(t,qx(n));return()=>{r(),o()}}(e,t.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,a=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),vp.read(r);const i=Jy(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Wy(t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())});return()=>{i(),t(),a(),s&&s(),n&&n()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:a=Wx,dragMomentum:i=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:a,dragMomentum:i}}}function qx(e){let t=!0;return()=>{t?t=!1:e()}}function Xx(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const Qx=e=>(t,n)=>{e&&vp.update(()=>e(t,n),!1,!0)};let Zx=!1;class Jx extends W.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),Zx&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ob.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,{projection:a}=n;return a?(a.isPresent=o,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Zx=!0,r||e.layoutDependency!==t||void 0===t||e.isPresent!==o?a.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?a.promote():a.relegate()||vp.postRender(()=>{const e=a.getStack();e&&e.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Fg.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Zx=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function ew(e){const[t,n]=Wb(),r=W.useContext(Lf);return ee.jsx(Jx,{...e,layoutGroup:r,switchLayoutGroup:W.useContext(xx),isPresent:t,safeToRemove:n})}const tw={pan:{Feature:class extends Mv{constructor(){super(...arguments),this.removePointerDownListener=Wf}onPointerDown(e){this.session=new Ax(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Lx(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Qx(e),onStart:Qx(t),onMove:Qx(n),onEnd:(e,t)=>{delete this.session,r&&vp.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Rx(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends Mv{constructor(e){super(e),this.removeGroupControls=Wf,this.removeListeners=Wf,this.controls=new Kx(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Wf}update(){const{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:Ob,MeasureLayout:ew}};function nw(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);const o=r["onHover"+n];o&&vp.postRender(()=>o(t,Mx(t)))}function rw(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap","Start"===n);const o=r["onTap"+("End"===n?"":n)];o&&vp.postRender(()=>o(t,Mx(t)))}const ow=new WeakMap,aw=new WeakMap,iw=e=>{const t=ow.get(e.target);t&&t(e)},sw=e=>{e.forEach(iw)};function lw(e,t,n){const r=function({root:e,...t}){const n=e||document;aw.has(n)||aw.set(n,{});const r=aw.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(sw,{root:e,...t})),r[o]}(t);return ow.set(e,n),r.observe(e),()=>{ow.delete(e),r.unobserve(e)}}const uw={some:0,all:1};const cw={inView:{Feature:class extends Mv{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var e;null==(e=this.stopObserver)||e.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:a}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:"number"==typeof o?o:uw[o]};this.stopObserver=lw(this.node.current,i,e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,a&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),o=t?n:r;o&&o(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){var e;null==(e=this.stopObserver)||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends Mv{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Jg(e,(e,t)=>(rw(this.node,t,"Start"),(e,{success:t})=>rw(this.node,e,t?"End":"Cancel")),{useGlobalTarget:t,stopPropagation:!1===(null==n?void 0:n.tap)})}unmount(){}}},focus:{Feature:class extends Mv{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(wT){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Gf(Jy(this.node.current,"focus",()=>this.onFocus()),Jy(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Mv{mount(){const{current:e}=this.node;e&&(this.unmount=Ug(e,(e,t)=>(nw(this.node,t,"Start"),e=>nw(this.node,e,"End"))))}unmount(){}}}},dw=Cx({...Tx,...cw,...tw,...{layout:{ProjectionNode:Ob,MeasureLayout:ew}}},Px);function fw(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=fw(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function pw(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=fw(e))&&(r&&(r+=" "),r+=t);return r}const hw=e=>{const t=yw(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),mw(n,t)||vw(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},mw=(e,t)=>{var n;if(0===e.length)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),a=o?mw(e.slice(1),o):void 0;if(a)return a;if(0===t.validators.length)return;const i=e.join("-");return null==(n=t.validators.find(({validator:e})=>e(i)))?void 0:n.classGroupId},gw=/^\[(.+)\]$/,vw=e=>{if(gw.test(e)){const t=gw.exec(e)[1],n=null==t?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},yw=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return kw(Object.entries(e.classGroups),n).forEach(([e,n])=>{bw(n,r,e,t)}),r},bw=(e,t,n,r)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:xw(t,e)).classGroupId=n)}if("function"==typeof e)return ww(e)?void bw(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach(([e,o])=>{bw(o,xw(t,e),n,r)})})},xw=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},ww=e=>e.isThemeGetter,kw=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,Sw=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(o(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):o(e,t)}}},Ew=e=>{const{separator:t,experimentalParseClassName:n}=e,r=1===t.length,o=t[0],a=t.length,i=e=>{const n=[];let i,s=0,l=0;for(let d=0;d<e.length;d++){let u=e[d];if(0===s){if(u===o&&(r||e.slice(d,d+a)===t)){n.push(e.slice(l,d)),l=d+a;continue}if("/"===u){i=d;continue}}"["===u?s++:"]"===u&&s--}const u=0===n.length?e:e.substring(l),c=u.startsWith("!");return{modifiers:n,hasImportantModifier:c,baseClassName:c?u.substring(1):u,maybePostfixModifierPosition:i&&i>l?i-l:void 0}};return n?e=>n({className:e,parseClassName:i}):i},jw=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(e=>{"["===e[0]?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},Cw=/\s+/;function Pw(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=Nw(e))&&(r&&(r+=" "),r+=t);return r}const Nw=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Nw(e[r]))&&(n&&(n+=" "),n+=t);return n};function Tw(e,...t){let n,r,o,a=function(s){const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:Sw(e.cacheSize),parseClassName:Ew(e),...hw(e)}))(l),r=n.cache.get,o=n.cache.set,a=i,i(s)};function i(e){const t=r(e);if(t)return t;const a=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,a=[],i=e.trim().split(Cw);let s="";for(let l=i.length-1;l>=0;l-=1){const e=i[l],{modifiers:t,hasImportantModifier:u,baseClassName:c,maybePostfixModifierPosition:d}=n(e);let f=Boolean(d),p=r(f?c.substring(0,d):c);if(!p){if(!f){s=e+(s.length>0?" "+s:s);continue}if(p=r(c),!p){s=e+(s.length>0?" "+s:s);continue}f=!1}const h=jw(t).join(":"),m=u?h+"!":h,g=m+p;if(a.includes(g))continue;a.push(g);const v=o(p,f);for(let n=0;n<v.length;++n){const e=v[n];a.push(m+e)}s=e+(s.length>0?" "+s:s)}return s})(e,n);return o(e,a),a}return function(){return a(Pw.apply(null,arguments))}}const Mw=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},Rw=/^\[(?:([a-z-]+):)?(.+)\]$/i,Lw=/^\d+\/\d+$/,Dw=new Set(["px","full","screen"]),_w=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Aw=/\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$/,Ow=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Iw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fw=e=>$w(e)||Dw.has(e)||Lw.test(e),Vw=e=>ek(e,"length",tk),$w=e=>Boolean(e)&&!Number.isNaN(Number(e)),Bw=e=>ek(e,"number",$w),Uw=e=>Boolean(e)&&Number.isInteger(Number(e)),Ww=e=>e.endsWith("%")&&$w(e.slice(0,-1)),Hw=e=>Rw.test(e),Gw=e=>_w.test(e),Yw=new Set(["length","size","percentage"]),Kw=e=>ek(e,Yw,nk),qw=e=>ek(e,"position",nk),Xw=new Set(["image","url"]),Qw=e=>ek(e,Xw,ok),Zw=e=>ek(e,"",rk),Jw=()=>!0,ek=(e,t,n)=>{const r=Rw.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},tk=e=>Aw.test(e)&&!Ow.test(e),nk=()=>!1,rk=e=>Iw.test(e),ok=e=>zw.test(e),ak=Tw(()=>{const e=Mw("colors"),t=Mw("spacing"),n=Mw("blur"),r=Mw("brightness"),o=Mw("borderColor"),a=Mw("borderRadius"),i=Mw("borderSpacing"),s=Mw("borderWidth"),l=Mw("contrast"),u=Mw("grayscale"),c=Mw("hueRotate"),d=Mw("invert"),f=Mw("gap"),p=Mw("gradientColorStops"),h=Mw("gradientColorStopPositions"),m=Mw("inset"),g=Mw("margin"),v=Mw("opacity"),y=Mw("padding"),b=Mw("saturate"),x=Mw("scale"),w=Mw("sepia"),k=Mw("skew"),S=Mw("space"),E=Mw("translate"),j=()=>["auto",Hw,t],C=()=>[Hw,t],P=()=>["",Fw,Vw],N=()=>["auto",$w,Hw],T=()=>["","0",Hw],M=()=>[$w,Hw];return{cacheSize:500,separator:":",theme:{colors:[Jw],spacing:[Fw,Vw],blur:["none","",Gw,Hw],brightness:M(),borderColor:[e],borderRadius:["none","","full",Gw,Hw],borderSpacing:C(),borderWidth:P(),contrast:M(),grayscale:T(),hueRotate:M(),invert:T(),gap:C(),gradientColorStops:[e],gradientColorStopPositions:[Ww,Vw],inset:j(),margin:j(),opacity:M(),padding:C(),saturate:M(),scale:M(),sepia:T(),skew:M(),space:C(),translate:C()},classGroups:{aspect:[{aspect:["auto","square","video",Hw]}],container:["container"],columns:[{columns:[Gw]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"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"],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:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",Hw]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Uw,Hw]}],basis:[{basis:j()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Hw]}],grow:[{grow:T()}],shrink:[{shrink:T()}],order:[{order:["first","last","none",Uw,Hw]}],"grid-cols":[{"grid-cols":[Jw]}],"col-start-end":[{col:["auto",{span:["full",Uw,Hw]},Hw]}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":[Jw]}],"row-start-end":[{row:["auto",{span:[Uw,Hw]},Hw]}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Hw]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Hw]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Hw,t]}],"min-w":[{"min-w":[Hw,t,"min","max","fit"]}],"max-w":[{"max-w":[Hw,t,"none","full","min","max","fit","prose",{screen:[Gw]},Gw]}],h:[{h:[Hw,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Hw,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Hw,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Hw,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Gw,Vw]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Bw]}],"font-family":[{font:[Jw]}],"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:["tighter","tight","normal","wide","wider","widest",Hw]}],"line-clamp":[{"line-clamp":["none",$w,Bw]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Fw,Hw]}],"list-image":[{"list-image":["none",Hw]}],"list-style-type":[{list:["none","disc","decimal",Hw]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Fw,Vw]}],"underline-offset":[{"underline-offset":["auto",Fw,Hw]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Hw]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Hw]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",qw]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Kw]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Qw]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[Fw,Hw]}],"outline-w":[{outline:[Fw,Vw]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Fw,Vw]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Gw,Zw]}],"shadow-color":[{shadow:[Jw]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Gw,Hw]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Hw]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",Hw]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",Hw]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Uw,Hw]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Hw]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",Hw]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"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",Hw]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Fw,Vw,Bw]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-s","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}});function ik(...e){return ak(pw(e))}const sk=W.forwardRef(({className:e,...t},n)=>ee.jsx("div",{ref:n,className:ik("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));sk.displayName="Card";const lk=W.forwardRef(({className:e,...t},n)=>ee.jsx("div",{ref:n,className:ik("flex flex-col space-y-1.5 p-6",e),...t}));lk.displayName="CardHeader";const uk=W.forwardRef(({className:e,...t},n)=>ee.jsx("h3",{ref:n,className:ik("text-2xl font-semibold leading-none tracking-tight",e),...t}));uk.displayName="CardTitle";const ck=W.forwardRef(({className:e,...t},n)=>ee.jsx("p",{ref:n,className:ik("text-sm text-muted-foreground",e),...t}));ck.displayName="CardDescription";const dk=W.forwardRef(({className:e,...t},n)=>ee.jsx("div",{ref:n,className:ik("p-6 pt-0",e),...t}));dk.displayName="CardContent";const fk=W.forwardRef(({className:e,...t},n)=>ee.jsx("div",{ref:n,className:ik("flex items-center p-6 pt-0",e),...t}));function pk(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function hk(...e){return t=>{let n=!1;const r=e.map(e=>{const r=pk(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():pk(e[t],null)}}}}function mk(...e){return W.useCallback(hk(...e),e)}fk.displayName="CardFooter";var gk=Symbol.for("react.lazy"),vk=G[" use ".trim().toString()];function yk(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===gk&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}function bk(e){const t=wk(e),n=W.forwardRef((e,n)=>{let{children:r,...o}=e;yk(r)&&"function"==typeof vk&&(r=vk(r._payload));const a=W.Children.toArray(r),i=a.find(Sk);if(i){const e=i.props.children,r=a.map(t=>t===i?W.Children.count(e)>1?W.Children.only(null):W.isValidElement(e)?e.props.children:null:t);return ee.jsx(t,{...o,ref:n,children:W.isValidElement(e)?W.cloneElement(e,void 0,r):null})}return ee.jsx(t,{...o,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var xk=bk("Slot");function wk(e){const t=W.forwardRef((e,t)=>{let{children:n,...r}=e;if(yk(n)&&"function"==typeof vk&&(n=vk(n._payload)),W.isValidElement(n)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==W.Fragment&&(o.ref=t?hk(t,e):e),W.cloneElement(n,o)}return W.Children.count(n)>1?W.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kk=Symbol("radix.slottable");function Sk(e){return W.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===kk}const Ek=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,jk=pw,Ck=(e,t)=>n=>{var r;if(null==(null==t?void 0:t.variants))return jk(e,null==n?void 0:n.class,null==n?void 0:n.className);const{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(e=>{const t=null==n?void 0:n[e],r=null==a?void 0:a[e];if(null===t)return null;const i=Ek(t)||Ek(r);return o[e][i]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{}),l=null==t||null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...o}=t;return Object.entries(o).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...a,...s}[t]):{...a,...s}[t]===n})?[...e,n,r]:e},[]);return jk(e,i,l,null==n?void 0:n.class,null==n?void 0:n.className)},Pk=Ck("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Nk=W.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},a)=>{const i=r?xk:"button";return ee.jsx(i,{className:ik(Pk({variant:t,size:n,className:e})),ref:a,...o})});Nk.displayName="Button";const Tk=W.forwardRef(({className:e,type:t,...n},r)=>ee.jsx("input",{type:t,className:ik("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Tk.displayName="Input";var Mk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=bk(`Primitive.${t}`),r=W.forwardRef((e,r)=>{const{asChild:o,...a}=e,i=o?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),ee.jsx(i,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Rk=W.forwardRef((e,t)=>ee.jsx(Mk.label,{...e,ref:t,onMouseDown:t=>{var n;t.target.closest("button, input, select, textarea")||(null==(n=e.onMouseDown)||n.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Rk.displayName="Label";var Lk=Rk;const Dk=Ck("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),_k=W.forwardRef(({className:e,...t},n)=>ee.jsx(Lk,{ref:n,className:ik(Dk(),e),...t}));_k.displayName=Lk.displayName;const Ak=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e))},i=t=e(r,o,a);return a},Ok=e=>e;const Ik=e=>{const t=(e=>e?Ak(e):Ak)(e),n=e=>function(e,t=Ok){const n=H.useSyncExternalStore(e.subscribe,H.useCallback(()=>t(e.getState()),[e,t]),H.useCallback(()=>t(e.getInitialState()),[e,t]));return H.useDebugValue(n),n}(t,e);return Object.assign(n,t),n},zk=e=>e?Ik(e):Ik,Fk={token:"cc_web_token",theme:"cc_web_theme",viewMode:e=>`cc_viewmode_${e}`,panelFileTree:"cc_panel_filetree",panelShortcuts:"cc_panel_shortcuts",fileZoom:"cc_file_zoom",skillhubAuthor:"ccweb_skillhub_author",projectOrder:"cc_project_order",pomodoroConfig:"cc_pomodoro_config",panelLeftWidth:"cc_panel_left_width",panelRightWidth:"cc_panel_right_width",terminalDraft:e=>`cc_terminal_draft_${e}`,usedSkills:"cc_used_skills",projectModel:e=>`cc_project_model_${e}`,draftState:e=>`cc_draft_state_${e}`,usageMonitorTool:"cc_usage_monitor_tool",monitorMode:"cc_monitor_mode",chatOverlay:e=>`cc_chat_overlay_${e}`,chatOverlayPos:e=>`cc_chat_overlay_pos_${e}`};function Vk(e,t,n){try{const r=localStorage.getItem(e);return null===r?t:n?JSON.parse(r):r}catch{return t}}function $k(e,t,n){try{localStorage.setItem(e,n?JSON.stringify(t):String(t))}catch{}}function Bk(e){try{localStorage.removeItem(e)}catch{}}function Uk(e,t,n){const r=(null==n?void 0:n.parse)??!1,[o,a]=W.useState(()=>{try{const n=localStorage.getItem(e);return null===n?t:r?JSON.parse(n):n}catch{return t}});return[o,W.useCallback(t=>{a(n=>{const o="function"==typeof t?t(n):t;try{localStorage.setItem(e,r?JSON.stringify(o):String(o))}catch{}return o})},[e,r])]}const Wk=zk(e=>({token:localStorage.getItem(Fk.token),setToken:t=>{$k(Fk.token,t),e({token:t})},clearToken:()=>{Bk(Fk.token),e({token:null})}}));let Hk=null;const Gk=zk((e,t)=>({projects:[],loading:!1,error:null,hasFetched:!1,fetchProjects:async()=>{if(!t().loading){e({loading:!0,error:null});try{const t=await async function(){if(!Hk){const e=await fd(()=>Promise.resolve().then(()=>DE),void 0);Hk=e.getProjects}return Hk()}();e({projects:t,hasFetched:!0})}catch(n){e({error:n instanceof Error?n.message:"Failed to load projects"})}finally{e({loading:!1})}}},addProject:t=>e(e=>({projects:[...e.projects,t]})),updateProject:t=>e(e=>({projects:e.projects.map(e=>e.id===t.id?t:e)})),removeProject:t=>e(e=>({projects:e.projects.filter(e=>e.id!==t)})),setProjects:t=>e({projects:t})})),Yk={filePreviewPath:null,sessionId:null,shortcutEditorOpen:!1,shortcutEditingId:null,shareHubOpen:!1,shareHubLabel:"",shareHubCommand:""},Kk=zk((e,t)=>({entries:{},get:e=>t().entries[e]??Yk,setFilePreviewPath:(t,n)=>e(e=>({entries:{...e.entries,[t]:{...e.entries[t]??Yk,filePreviewPath:n}}})),setSessionId:(t,n)=>e(e=>({entries:{...e.entries,[t]:{...e.entries[t]??Yk,sessionId:n}}})),setShortcutEditor:(t,n,r=null)=>e(e=>({entries:{...e.entries,[t]:{...e.entries[t]??Yk,shortcutEditorOpen:n,shortcutEditingId:n?r:null}}})),setShareHub:(t,n,r="",o="")=>e(e=>({entries:{...e.entries,[t]:{...e.entries[t]??Yk,shareHubOpen:n,shareHubLabel:n?r:"",shareHubCommand:n?o:""}}}))}));function qk(){return Wk.getState().token}function Xk(){Wk.getState().clearToken()}async function Qk(e,t,n,r=!0,o){const a={"Content-Type":"application/json"};if(r){const e=qk();e&&(a.Authorization=`Bearer ${e}`)}const i=await fetch(`${t}`,{method:e,headers:a,body:void 0!==n?JSON.stringify(n):void 0,signal:o});if(401===i.status)throw Xk(),"/login"!==window.location.pathname&&(window.location.href="/login"),new Error("Unauthorized");if(!i.ok){let e=`HTTP ${i.status}`;try{const t=await i.json();t.error&&(e=t.error)}catch{}throw new Error(e)}return i.json()}async function Zk(e,t){return(await Qk("POST","/api/auth/login",{username:e,password:t},!1)).token}function Jk(){const e=window.location.hostname;return"localhost"===e||"127.0.0.1"===e||"::1"===e}async function eS(){return(await Qk("GET","/api/auth/local-token",void 0,!1)).token}async function tS(){return Qk("GET","/api/projects/users")}async function nS(e,t){return Qk("PUT",`/api/projects/${e}/shares`,{shares:t})}async function rS(e){return Qk("POST","/api/projects",e)}async function oS(e){return Qk("POST","/api/projects/open",{folderPath:e})}async function aS(e){await Qk("DELETE",`/api/projects/${e}`)}async function iS(e){return Qk("PATCH",`/api/projects/${e}/start`)}async function sS(e){return Qk("PATCH",`/api/projects/${e}/archive`)}async function lS(e){return Qk("PATCH",`/api/projects/${e}/unarchive`)}async function uS(e,t){return Qk("GET",`/api/projects/${e}/sessions`,void 0,!0,t)}async function cS(e,t,n){return Qk("GET",`/api/projects/${e}/sessions/${t}`,void 0,!0,n)}async function dS(){return Qk("GET","/api/shortcuts")}async function fS(e){return Qk("POST","/api/shortcuts",e)}async function pS(e,t){return Qk("PUT",`/api/shortcuts/${e}`,t)}async function hS(e){await Qk("DELETE",`/api/shortcuts/${e}`)}async function mS(e){return Qk("GET",`/api/shortcuts/project/${e}`)}async function gS(e,t){return Qk("POST",`/api/shortcuts/project/${e}`,t)}async function vS(e,t,n){return Qk("PUT",`/api/shortcuts/project/${e}/${t}`,n)}async function yS(e,t){await Qk("DELETE",`/api/shortcuts/project/${e}/${t}`)}async function bS(){return Qk("GET","/api/skillhub/skills")}async function xS(e){await Qk("POST","/api/skillhub/submit",e)}async function wS(e){return Qk("POST",`/api/skillhub/download/${e}`)}async function kS(e="claude"){return Qk("GET",`/api/projects/usage?tool=${encodeURIComponent(e)}`)}async function SS(e="claude"){return Qk("GET",`/api/projects/usage?refresh=true&tool=${encodeURIComponent(e)}`)}async function ES(e){return Qk("GET",`/api/filesystem${e?`?path=${encodeURIComponent(e)}`:""}`)}function jS(e){return`/api/filesystem/raw?path=${encodeURIComponent(e)}`}async function CS(e,t){const n=new FormData;n.append("path",e);for(const i of t)n.append("files",i);const r={},o=qk();o&&(r.Authorization=`Bearer ${o}`);const a=await fetch("/api/filesystem/upload",{method:"POST",headers:r,body:n});if(!a.ok){const e=await a.json().catch(()=>({}));throw new Error(e.error||`Upload failed: ${a.status}`)}return a.json()}async function PS(e,t){return Qk("POST","/api/filesystem/mkdir",{path:e,name:t})}async function NS(e){return Qk("GET",`/api/filesystem/file?path=${encodeURIComponent(e)}`)}async function TS(e,t){return Qk("PUT","/api/filesystem/file",{path:e,content:t})}async function MS(e){return Qk("DELETE",`/api/filesystem?path=${encodeURIComponent(e)}`)}async function RS(){return Qk("GET","/api/update/check-running")}async function LS(){return Qk("GET","/api/update/check-version")}async function DS(){return Qk("POST","/api/update/prepare")}async function _S(){return Qk("POST","/api/update/execute")}async function AS(){return Qk("GET","/api/update/status")}async function OS(){return Qk("GET","/api/backup/built-in-oauth")}async function IS(){return Qk("GET","/api/backup/providers")}async function zS(e){return Qk("POST","/api/backup/providers",e)}async function FS(e){await Qk("DELETE",`/api/backup/providers/${e}`)}async function VS(e){return Qk("GET",`/api/backup/auth/${e}/url`)}async function $S(e){return Qk("POST",`/api/backup/run/${e}`)}async function BS(){return Qk("GET","/api/backup/schedule")}async function US(e){return Qk("PUT","/api/backup/schedule",e)}async function WS(){return Qk("GET","/api/backup/excludes")}async function HS(e){return Qk("PUT","/api/backup/excludes",{patterns:e})}async function GS(){return Qk("GET","/api/backup/history")}async function YS(){return Qk("GET","/api/notify/config")}async function KS(e){return Qk("PUT","/api/notify/config",e)}async function qS(e){return Qk("GET",`/api/projects/${e}/git/status`)}async function XS(e,t){return Qk("GET",`/api/projects/${e}/git/diff${t?`?file=${encodeURIComponent(t)}`:""}`)}async function QS(e,t){await Qk("POST",`/api/projects/${e}/git/add`,{files:t})}async function ZS(e,t){await Qk("POST",`/api/projects/${e}/git/commit`,{message:t})}async function JS(e,t=50,n=0){return Qk("GET",`/api/projects/${e}/git/log?limit=${t}&skip=${n}`)}async function eE(e,t){return Qk("PATCH",`/api/projects/${e}/rename`,{name:t})}async function tE(e,t=100){return Qk("GET",`/api/information/${e}/conversations?limit=${t}`)}async function nE(e,t,n,r="user"){const o=new URLSearchParams({source:r});return n&&o.set("version",n),Qk("GET",`/api/information/${e}/conversations/${t}?${o}`)}async function rE(e,t){await Qk("DELETE",`/api/information/${e}/conversations/${t}`)}async function oE(e,t=!1){return Qk("POST",`/api/information/${e}/sync${t?"?force=true":""}`)}async function aE(e,t){return Qk("POST",`/api/information/${e}/conversations/${t}/condense`)}async function iE(e,t){return Qk("POST",`/api/information/${e}/conversations/${t}/reorganize`)}async function sE(e){return Qk("GET",`/api/projects/${e}/disk-size`)}async function lE(e,t){return Qk("POST",`/api/sessions/${e}/share`,{expiryDays:t})}async function uE(e){const t=await fetch(`/api/share/${e}`);if(!t.ok){let e=`HTTP ${t.status}`;try{const n=await t.json();n.error&&(e=n.error)}catch{}throw new Error(e)}return t.json()}async function cE(e){return Qk("GET",`/api/tool/model?tool=${encodeURIComponent(e)}`)}async function dE(e){return Qk("GET",`/api/tool/models?tool=${encodeURIComponent(e)}`)}async function fE(e){return Qk("GET",`/api/tool/skills?tool=${encodeURIComponent(e)}`)}async function pE(){return Qk("GET","/api/plugins")}async function hE(e){return Qk("POST","/api/plugins/install",{downloadUrl:e})}async function mE(e){await Qk("DELETE",`/api/plugins/${e}`)}async function gE(e,t){return Qk("PUT",`/api/plugins/${e}/config`,t)}async function vE(e,t){await Qk("PUT",`/api/plugins/${e}/enabled`,{enabled:t})}async function yE(e){return Qk("GET",`/api/projects/${e}/plan/status`)}async function bE(e){return Qk("POST",`/api/projects/${e}/plan/init`)}async function xE(e){return Qk("POST",`/api/projects/${e}/plan/check`)}async function wE(e){return Qk("POST",`/api/projects/${e}/plan/start`)}async function kE(e){return Qk("POST",`/api/projects/${e}/plan/pause`)}async function SE(e){return Qk("POST",`/api/projects/${e}/plan/resume`)}async function EE(e){return Qk("POST",`/api/projects/${e}/plan/stop`)}async function jE(e){return Qk("GET",`/api/projects/${e}/plan/tree`)}async function CE(e){return Qk("GET",`/api/memory-pool/${e}/status`)}async function PE(e){return Qk("POST",`/api/memory-pool/${e}/init`)}async function NE(e,t){return Qk("GET",`/api/memory-pool/${e}/index`,void 0,!0,t)}async function TE(e){return Qk("POST",`/api/memory-pool/${e}/upgrade`)}async function ME(e,t){return Qk("PUT",`/api/memory-pool/${e}/surface-width`,{surface_width:t})}async function RE(){return Qk("GET","/api/memory-pool/global/index")}async function LE(){return Qk("POST","/api/memory-pool/global/sync")}const DE=Object.freeze(Object.defineProperty({__proto__:null,addBackupProvider:zS,archiveProject:sS,browseFilesystem:ES,checkPlanSyntax:xE,checkRunningProjects:RS,checkVersion:LS,clearToken:Xk,condenseConversation_api:aE,createFolder:PS,createGlobalShortcut:fS,createProject:rS,createProjectShortcut:gS,deleteBackupProvider:FS,deleteConversation:rE,deleteGlobalShortcut:hS,deletePath:MS,deleteProject:aS,deleteProjectShortcut:yS,downloadSkillFromHub:wS,executeUpdate:_S,getAllUsers:tS,getBackupAuthUrl:VS,getBackupExcludes:WS,getBackupHistory:GS,getBackupProviders:IS,getBackupSchedule:BS,getBuiltInOAuthTypes:OS,getClaudeModel:async function(){return Qk("GET","/api/claude/model")},getClaudeSkills:async function(){return Qk("GET","/api/claude/skills")},getConversationDetail:nE,getConversations:tE,getGitDiff:XS,getGitLog:JS,getGitStatus:qS,getGlobalPoolBall:async function(e){return Qk("GET",`/api/memory-pool/global/ball/${e}`)},getGlobalPoolIndex:RE,getGlobalPoolStatus:async function(){return Qk("GET","/api/memory-pool/global/status")},getGlobalShortcuts:dS,getInstalledPlugins:pE,getLastMessages:async function(e,t=10){return Qk("GET",`/api/projects/${e}/last-messages?limit=${t}`)},getLocalToken:eS,getMemoryPoolBall:async function(e,t){return Qk("GET",`/api/memory-pool/${e}/ball/${t}`)},getMemoryPoolIndex:NE,getMemoryPoolSnapshot:async function(e){return Qk("GET",`/api/memory-pool/${e}/snapshot`)},getMemoryPoolStatus:CE,getNotifyConfig:YS,getPlanNodes:async function(e){return Qk("GET",`/api/projects/${e}/plan/nodes`)},getPlanStatus:yE,getPlanTree:jE,getProjectDiskSize:sE,getProjectShortcuts:mS,getProjectTodos:async function(e){return Qk("GET",`/api/projects/${e}/todos`)},getProjects:async function(){return Qk("GET","/api/projects")},getProjectsActivity:async function(e){return Qk("GET","/api/projects/activity",void 0,!0,e)},getRawFileUrl:jS,getSession:cS,getSessions:uS,getSharedSession:uE,getSkillHubSkills:bS,getToken:qk,getToolModel:cE,getToolModels:dE,getToolSkills:fE,getUpdateStatus:AS,getUsage:kS,getWorkspace:async function(){return(await Qk("GET","/api/projects/workspace")).workspace},gitAdd:QS,gitCommit:ZS,initMemoryPool:PE,initPlanControl:bE,installPlugin:hE,isLocalAccess:Jk,login:Zk,openProject:oS,pausePlan:kE,prepareForUpdate:DS,readFile:NS,refreshUsage:SS,renameProject:eE,reorganizeConversation_api:iE,resumePlan:SE,searchSessions:async function(e){return Qk("GET",`/api/projects/sessions/search?q=${encodeURIComponent(e)}`)},setPluginEnabled:vE,setToken:function(e){var t;t=e,Wk.getState().setToken(t)},shareSession:lE,startPlan:wE,startProject:iS,stopPlan:EE,stopProject:async function(e){return Qk("PATCH",`/api/projects/${e}/stop`)},submitSkillToHub:xS,syncConversations:oE,syncGlobalPool:LE,triggerBackup:$S,unarchiveProject:lS,uninstallPlugin:mE,updateBackupExcludes:HS,updateBackupSchedule:US,updateGlobalShortcut:pS,updateNotifyConfig:KS,updatePlugin:async function(e,t){return Qk("POST",`/api/plugins/${e}/update`,{downloadUrl:t})},updatePluginConfig:gE,updateProjectShares:nS,updateProjectShortcut:vS,updateProjectTags:async function(e,t){return Qk("PATCH",`/api/projects/${e}/tags`,{tags:t})},updateSurfaceWidth:ME,upgradeMemoryPool:TE,uploadFiles:CS,writeFile:TS},Symbol.toStringTag,{value:"Module"}));function _E(){const e=cf(),t=Wk(e=>e.setToken),[n,r]=W.useState(""),[o,a]=W.useState(""),[i,s]=W.useState(null),[l,u]=W.useState(!1);W.useEffect(()=>{if(!Jk())return;let n=!1;return(async()=>{try{const r=await eS();n||(t(r),e("/",{replace:!0}))}catch{}})(),()=>{n=!0}},[e,t]);return ee.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:ee.jsx(dw.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4,ease:"easeOut"},className:"w-full max-w-sm",children:ee.jsxs(sk,{children:[ee.jsxs(lk,{className:"text-center",children:[ee.jsx(uk,{className:"text-2xl",children:"CC Web"}),ee.jsx(ck,{children:Jk()?"Connecting locally...":"Sign in to manage your Claude projects"})]}),ee.jsxs("form",{onSubmit:r=>{(async r=>{r.preventDefault(),s(null),u(!0);try{const r=await Zk(n,o);t(r),e("/")}catch(a){s(a instanceof Error?a.message:"Login failed")}finally{u(!1)}})(r)},children:[ee.jsxs(dk,{className:"space-y-4",children:[ee.jsxs("div",{className:"space-y-2",children:[ee.jsx(_k,{htmlFor:"username",children:"Username"}),ee.jsx(Tk,{id:"username",type:"text",autoComplete:"username",value:n,onChange:e=>r(e.target.value),required:!0,autoFocus:!0})]}),ee.jsxs("div",{className:"space-y-2",children:[ee.jsx(_k,{htmlFor:"password",children:"Password"}),ee.jsx(Tk,{id:"password",type:"password",autoComplete:"current-password",value:o,onChange:e=>a(e.target.value),required:!0})]}),ee.jsx(Yb,{children:i&&ee.jsx(dw.p,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},exit:{opacity:0,x:-8},transition:{duration:.2},className:"text-sm text-destructive",children:i})})]}),ee.jsx(fk,{children:ee.jsx(dw.div,{className:"w-full",whileTap:{scale:.98},children:ee.jsx(Nk,{type:"submit",className:"w-full",disabled:l,children:l?"Signing in...":"Sign In"})})})]})]})})})}
63
+ */new Promise(()=>{});try{window.__reactRouterVersion="6"}catch(vT){}const Cf=G.startTransition;function Pf(e){let{basename:t,children:n,future:r,window:o}=e,a=W.useRef();null==a.current&&(a.current=vd({window:o,v5Compat:!0}));let i=a.current,[s,l]=W.useState({action:i.action,location:i.location}),{v7_startTransition:u}=r||{},c=W.useCallback(e=>{u&&Cf?Cf(()=>l(e)):l(e)},[l,u]);return W.useLayoutEffect(()=>i.listen(c),[i,c]),W.useEffect(()=>{return null==(e=r)||e.v7_startTransition,void(null==e||e.v7_relativeSplatPath);var e},[r]),W.createElement(Sf,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:i,future:r})}var Nf,Tf,Mf,Rf;(Tf=Nf||(Nf={})).UseScrollRestoration="useScrollRestoration",Tf.UseSubmit="useSubmit",Tf.UseSubmitFetcher="useSubmitFetcher",Tf.UseFetcher="useFetcher",Tf.useViewTransitionState="useViewTransitionState",(Rf=Mf||(Mf={})).UseFetcher="useFetcher",Rf.UseFetchers="useFetchers",Rf.UseScrollRestoration="useScrollRestoration";const Lf=W.createContext({});function Df(e){const t=W.useRef(null);return null===t.current&&(t.current=e()),t.current}const _f="undefined"!=typeof window?W.useLayoutEffect:W.useEffect,Af=W.createContext(null);function Of(e,t){-1===e.indexOf(t)&&e.push(t)}function If(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const zf=(e,t,n)=>n>t?t:n<e?e:n;const Ff={},Vf=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function $f(e){return"object"==typeof e&&null!==e}const Bf=e=>/^0[^.\s]+$/u.test(e);function Uf(e){let t;return()=>(void 0===t&&(t=e()),t)}const Wf=e=>e,Hf=(e,t)=>n=>t(e(n)),Gf=(...e)=>e.reduce(Hf),Yf=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r};class Kf{constructor(){this.subscriptions=[]}add(e){return Of(this.subscriptions,e),()=>If(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o<r;o++){const r=this.subscriptions[o];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const qf=e=>1e3*e,Xf=e=>e/1e3;function Qf(e,t){return t?e*(1e3/t):0}const Zf=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Jf(e,t,n,r){if(e===t&&n===r)return Wf;const o=t=>function(e,t,n,r,o){let a,i,s=0;do{i=t+(n-t)/2,a=Zf(i,r,o)-e,a>0?n=i:t=i}while(Math.abs(a)>1e-7&&++s<12);return i}(t,0,1,e,n);return e=>0===e||1===e?e:Zf(o(e),t,r)}const ep=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,tp=e=>t=>1-e(1-t),np=Jf(.33,1.53,.69,.99),rp=tp(np),op=ep(rp),ap=e=>e>=1?1:(e*=2)<1?.5*rp(e):.5*(2-Math.pow(2,-10*(e-1))),ip=e=>1-Math.sin(Math.acos(e)),sp=tp(ip),lp=ep(ip),up=Jf(.42,0,1,1),cp=Jf(0,0,.58,1),dp=Jf(.42,0,.58,1),fp=e=>Array.isArray(e)&&"number"==typeof e[0],pp={linear:Wf,easeIn:up,easeInOut:dp,easeOut:cp,circIn:ip,circInOut:lp,circOut:sp,backIn:rp,backInOut:op,backOut:np,anticipate:ap},hp=e=>{if(fp(e)){e.length;const[t,n,r,o]=e;return Jf(t,n,r,o)}return"string"==typeof e?pp[e]:e},mp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function gp(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,i=mp.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,o=!1;const a=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(l.schedule(t),e()),t(i)}const l={schedule:(e,o=!1,i=!1)=>{const s=i&&r?t:n;return o&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(i=e,r)return void(o=!0);r=!0;const a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,o&&(o=!1,l.process(e))}};return l}(a),e),{}),{setup:s,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:f,render:p,postRender:h}=i,m=()=>{const a=Ff.useManualTiming,i=a?o.timestamp:performance.now();n=!1,a||(o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1)),o.timestamp=i,o.isProcessing=!0,s.process(o),l.process(o),u.process(o),c.process(o),d.process(o),f.process(o),p.process(o),h.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(m))};return{schedule:mp.reduce((t,a)=>{const s=i[a];return t[a]=(t,a=!1,i=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(m)),s.schedule(t,a,i)),t},{}),cancel:e=>{for(let t=0;t<mp.length;t++)i[mp[t]].cancel(e)},state:o,steps:i}}const{schedule:vp,cancel:yp,state:bp,steps:xp}=gp("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Wf,!0);let wp;function kp(){wp=void 0}const Sp={now:()=>(void 0===wp&&Sp.set(bp.isProcessing||Ff.useManualTiming?bp.timestamp:performance.now()),wp),set:e=>{wp=e,queueMicrotask(kp)}},Ep=e=>t=>"string"==typeof t&&t.startsWith(e),jp=Ep("--"),Cp=Ep("var(--"),Pp=e=>!!Cp(e)&&Np.test(e.split("/*")[0].trim()),Np=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Tp(e){return"string"==typeof e&&e.split("/*")[0].includes("var(--")}const Mp={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Rp={...Mp,transform:e=>zf(0,1,e)},Lp={...Mp,default:1},Dp=e=>Math.round(1e5*e)/1e5,_p=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Ap=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Op=(e,t)=>n=>Boolean("string"==typeof n&&Ap.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ip=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[o,a,i,s]=r.match(_p);return{[e]:parseFloat(o),[t]:parseFloat(a),[n]:parseFloat(i),alpha:void 0!==s?parseFloat(s):1}},zp={...Mp,transform:e=>Math.round((e=>zf(0,255,e))(e))},Fp={test:Op("rgb","red"),parse:Ip("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+zp.transform(e)+", "+zp.transform(t)+", "+zp.transform(n)+", "+Dp(Rp.transform(r))+")"};const Vp={test:Op("#"),parse:function(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:Fp.transform},$p=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Bp=$p("deg"),Up=$p("%"),Wp=$p("px"),Hp=$p("vh"),Gp=$p("vw"),Yp=(()=>({...Up,parse:e=>Up.parse(e)/100,transform:e=>Up.transform(100*e)}))(),Kp={test:Op("hsl","hue"),parse:Ip("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Up.transform(Dp(t))+", "+Up.transform(Dp(n))+", "+Dp(Rp.transform(r))+")"},qp={test:e=>Fp.test(e)||Vp.test(e)||Kp.test(e),parse:e=>Fp.test(e)?Fp.parse(e):Kp.test(e)?Kp.parse(e):Vp.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?Fp.transform(e):Kp.transform(e),getAnimatableNone:e=>{const t=qp.parse(e);return t.alpha=0,qp.transform(t)}},Xp=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Qp="number",Zp="color",Jp=/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 eh(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let a=0;const i=t.replace(Jp,e=>(qp.test(e)?(r.color.push(a),o.push(Zp),n.push(qp.parse(e))):e.startsWith("var(")?(r.var.push(a),o.push("var"),n.push(e)):(r.number.push(a),o.push(Qp),n.push(parseFloat(e))),++a,"${}")).split("${}");return{values:n,split:i,indexes:r,types:o}}function th({split:e,types:t}){const n=e.length;return r=>{let o="";for(let a=0;a<n;a++)if(o+=e[a],void 0!==r[a]){const e=t[a];o+=e===Qp?Dp(r[a]):e===Zp?qp.transform(r[a]):r[a]}return o}}const nh=(e,t)=>{return"number"==typeof e?(null==t?void 0:t.trim().endsWith("/"))?e:0:"number"==typeof(n=e)?0:qp.test(n)?qp.getAnimatableNone(n):n;var n};const rh={test:function(e){var t,n;return isNaN(e)&&"string"==typeof e&&((null==(t=e.match(_p))?void 0:t.length)||0)+((null==(n=e.match(Xp))?void 0:n.length)||0)>0},parse:function(e){return eh(e).values},createTransformer:function(e){return th(eh(e))},getAnimatableNone:function(e){const t=eh(e);return th(t)(t.values.map((e,n)=>nh(e,t.split[n])))}};function oh(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ah(e,t){return n=>n>0?t:e}const ih=(e,t,n)=>e+(t-e)*n,sh=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},lh=[Vp,Fp,Kp];function uh(e){const t=(n=e,lh.find(e=>e.test(n)));var n;if(!Boolean(t))return!1;let r=t.parse(e);return t===Kp&&(r=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,a=0,i=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;o=oh(s,r,e+1/3),a=oh(s,r,e),i=oh(s,r,e-1/3)}else o=a=i=n;return{red:Math.round(255*o),green:Math.round(255*a),blue:Math.round(255*i),alpha:r}}(r)),r}const ch=(e,t)=>{const n=uh(e),r=uh(t);if(!n||!r)return ah(e,t);const o={...n};return e=>(o.red=sh(n.red,r.red,e),o.green=sh(n.green,r.green,e),o.blue=sh(n.blue,r.blue,e),o.alpha=ih(n.alpha,r.alpha,e),Fp.transform(o))},dh=new Set(["none","hidden"]);function fh(e,t){return n=>ih(e,t,n)}function ph(e){return"number"==typeof e?fh:"string"==typeof e?Pp(e)?ah:qp.test(e)?ch:gh:Array.isArray(e)?hh:"object"==typeof e?qp.test(e)?ch:mh:ah}function hh(e,t){const n=[...e],r=n.length,o=e.map((e,n)=>ph(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=o[t](e);return n}}function mh(e,t){const n={...e,...t},r={};for(const o in n)void 0!==e[o]&&void 0!==t[o]&&(r[o]=ph(e[o])(e[o],t[o]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const gh=(e,t)=>{const n=rh.createTransformer(t),r=eh(e),o=eh(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?dh.has(e)&&!o.values.length||dh.has(t)&&!r.values.length?function(e,t){return dh.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Gf(hh(function(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const a=t.types[o],i=e.indexes[a][r[a]],s=e.values[i]??0;n[o]=s,r[a]++}return n}(r,o),o.values),n):ah(e,t)};function vh(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return ih(e,t,n);return ph(e)(e,t)}const yh=e=>{const t=({timestamp:t})=>e(t);return{start:(e=!0)=>vp.update(t,e),stop:()=>yp(t),now:()=>bp.isProcessing?bp.timestamp:Sp.now()}},bh=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let a=0;a<o;a++)r+=Math.round(1e4*e(a/(o-1)))/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},xh=2e4;function wh(e){let t=0;let n=e.next(t);for(;!n.done&&t<xh;)t+=50,n=e.next(t);return t>=xh?1/0:t}const kh=100,Sh=10,Eh=1,jh=0,Ch=800,Ph=.3,Nh=.3,Th={granular:.01,default:2},Mh={granular:.005,default:.5},Rh=.01,Lh=10,Dh=.05,_h=1;function Ah(e,t){return e*Math.sqrt(1-t*t)}const Oh=.001;const Ih=["duration","bounce"],zh=["stiffness","damping","mass"];function Fh(e,t){return t.some(t=>void 0!==e[t])}function Vh(e){let t={velocity:jh,stiffness:kh,damping:Sh,mass:Eh,isResolvedFromDuration:!1,...e};if(!Fh(e,zh)&&Fh(e,Ih))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(1.2*n),o=r*r,a=2*zf(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Eh,stiffness:o,damping:a}}else{const n=function({duration:e=Ch,bounce:t=Ph,velocity:n=jh,mass:r=Eh}){let o,a,i=1-t;i=zf(Dh,_h,i),e=zf(Rh,Lh,Xf(e)),i<1?(o=t=>{const r=t*i,o=r*e,a=r-n,s=Ah(t,i),l=Math.exp(-o);return Oh-a/s*l},a=t=>{const r=t*i*e,a=r*n+n,s=Math.pow(i,2)*Math.pow(t,2)*e,l=Math.exp(-r),u=Ah(Math.pow(t,2),i);return(-o(t)+Oh>0?-1:1)*((a-s)*l)/u}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,a=t=>Math.exp(-t*e)*(e*e*(n-t)));const s=function(e,t,n){let r=n;for(let o=1;o<12;o++)r-=e(r)/t(r);return r}(o,a,5/e);if(e=qf(e),isNaN(s))return{stiffness:kh,damping:Sh,duration:e};{const t=Math.pow(s,2)*r;return{stiffness:t,damping:2*i*Math.sqrt(r*t),duration:e}}}({...e,velocity:0});t={...t,...n,mass:Eh},t.isResolvedFromDuration=!0}return t}function $h(e=Nh,t=Ph){const n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const a=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:u,mass:c,duration:d,velocity:f,isResolvedFromDuration:p}=Vh({...n,velocity:-Xf(n.velocity||0)}),h=f||0,m=u/(2*Math.sqrt(l*c)),g=i-a,v=Xf(Math.sqrt(l/c)),y=Math.abs(g)<5;let b,x,w,k,S,E;if(r||(r=y?Th.granular:Th.default),o||(o=y?Mh.granular:Mh.default),m<1)w=Ah(v,m),k=(h+m*v*g)/w,b=e=>{const t=Math.exp(-m*v*e);return i-t*(k*Math.sin(w*e)+g*Math.cos(w*e))},S=m*v*k+g*w,E=m*v*g-k*w,x=e=>Math.exp(-m*v*e)*(S*Math.sin(w*e)+E*Math.cos(w*e));else if(1===m){b=e=>i-Math.exp(-v*e)*(g+(h+v*g)*e);const e=h+v*g;x=t=>Math.exp(-v*t)*(v*e*t-h)}else{const e=v*Math.sqrt(m*m-1);b=t=>{const n=Math.exp(-m*v*t),r=Math.min(e*t,300);return i-n*((h+m*v*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};const t=(h+m*v*g)/e,n=m*v*t-g*e,r=m*v*g-t*e;x=t=>{const o=Math.exp(-m*v*t),a=Math.min(e*t,300);return o*(n*Math.sinh(a)+r*Math.cosh(a))}}const j={calculatedDuration:p&&d||null,velocity:e=>qf(x(e)),next:e=>{if(!p&&m<1){const t=Math.exp(-m*v*e),n=Math.sin(w*e),a=Math.cos(w*e),l=i-t*(k*n+g*a),u=qf(t*(S*n+E*a));return s.done=Math.abs(u)<=r&&Math.abs(i-l)<=o,s.value=s.done?i:l,s}const t=b(e);if(p)s.done=e>=d;else{const n=qf(x(e));s.done=Math.abs(n)<=r&&Math.abs(i-t)<=o}return s.value=s.done?i:t,s},toString:()=>{const e=Math.min(wh(j),xh),t=bh(t=>j.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return j}$h.applyToOptions=e=>{const t=function(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(wh(r),xh);return{type:"keyframes",ease:e=>r.next(o*e).value/t,duration:Xf(o)}}(e,100,$h);return e.ease=t.ease,e.duration=qf(t.duration),e.type="keyframes",e};function Bh(e,t,n){const r=Math.max(t-5,0);return Qf(n-e(r),t-r)}function Uh({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:a=500,modifyTarget:i,min:s,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},p=e=>void 0===s?l:void 0===l||Math.abs(s-e)<Math.abs(l-e)?s:l;let h=n*t;const m=d+h,g=void 0===i?m:i(m);g!==m&&(h=g-d);const v=e=>-h*Math.exp(-e/r),y=e=>g+v(e),b=e=>{const t=v(e),n=y(e);f.done=Math.abs(t)<=u,f.value=f.done?g:n};let x,w;const k=e=>{var t;(t=f.value,void 0!==s&&t<s||void 0!==l&&t>l)&&(x=e,w=$h({keyframes:[f.value,p(f.value)],velocity:Bh(y,e,f.value),damping:o,stiffness:a,restDelta:u,restSpeed:c}))};return k(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==x||(t=!0,b(e),k(e)),void 0!==x&&e>=x?w.next(e-x):(!t&&b(e),f)}}}function Wh(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const a=e.length;if(t.length,1===a)return()=>t[0];if(2===a&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const r=[],o=n||Ff.mix||vh,a=e.length-1;for(let i=0;i<a;i++){let n=o(e[i],e[i+1]);if(t){const e=Array.isArray(t)?t[i]||Wf:t;n=Gf(e,n)}r.push(n)}return r}(t,r,o),l=s.length,u=n=>{if(i&&n<e[0])return t[0];let r=0;if(l>1)for(;r<e.length-2&&!(n<e[r+1]);r++);const o=Yf(e[r],e[r+1],n);return s[r](o)};return n?t=>u(zf(e[0],e[a-1],t)):u}function Hh(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Yf(0,t,r);e.push(ih(n,1,o))}}(t,e.length-1),t}function Gh({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(hp):hp(r),a={done:!1,value:t[0]},i=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:Hh(t),e),s=Wh(i,t,{ease:Array.isArray(o)?o:(l=t,u=o,l.map(()=>u||dp).splice(0,l.length-1))});var l,u;return{calculatedDuration:e,next:t=>(a.value=s(t),a.done=t>=e,a)}}const Yh=e=>null!==e;function Kh(e,{repeat:t,repeatType:n="loop"},r,o=1){const a=e.filter(Yh),i=o<0||t&&"loop"!==n&&t%2==1?0:a.length-1;return i&&void 0!==r?r:a[i]}const qh={decay:Uh,inertia:Uh,tween:Gh,keyframes:Gh,spring:$h};function Xh(e){"string"==typeof e.type&&(e.type=qh[e.type])}class Qh{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}const Zh=e=>e/100;class Jh extends Qh{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=()=>{var e,t;const{motionValue:n}=this.options;n&&n.updatedAt!==Sp.now()&&this.tick(Sp.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),null==(t=(e=this.options).onStop)||t.call(e))},this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause()}initAnimation(){const{options:e}=this;Xh(e);const{type:t=Gh,repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:a=0}=e;let{keyframes:i}=e;const s=t||Gh;s!==Gh&&"number"!=typeof i[0]&&(this.mixKeyframes=Gf(Zh,vh(i[0],i[1])),i=[0,100]);const l=s({...e,keyframes:i});"mirror"===o&&(this.mirroredGenerator=s({...e,keyframes:[...i].reverse(),velocity:-a})),null===l.calculatedDuration&&(l.calculatedDuration=wh(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=l}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:n,totalDuration:r,mixKeyframes:o,mirroredGenerator:a,resolvedDuration:i,calculatedDuration:s}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:u,repeat:c,repeatType:d,repeatDelay:f,type:p,onUpdate:h,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=r);let y,b=this.currentTime,x=n;if(c){const e=Math.min(this.currentTime,r)/i;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,c+1);Boolean(t%2)&&("reverse"===d?(n=1-n,f&&(n-=f/i)):"mirror"===d&&(x=a)),b=zf(0,1,n)*i}v?(this.delayState.value=u[0],y=this.delayState):y=x.next(b),o&&!v&&(y.value=o(y.value));let{done:w}=y;v||null===s||(w=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const k=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return k&&p!==Uh&&(y.value=Kh(u,this.options,m,this.speed)),h&&h(y.value),k&&this.finish(),y}then(e,t){return this.finished.then(e,t)}get duration(){return Xf(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Xf(e)}get time(){return Xf(this.currentTime)}set time(e){e=qf(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);return Bh(e=>this.generator.next(e).value,e,this.generator.next(e).value)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Sp.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Xf(this.currentTime))}play(){var e,t;if(this.isStopped)return;const{driver:n=yh,startTime:r}=this.options;this.driver||(this.driver=n(e=>this.tick(e))),null==(t=(e=this.options).onPlay)||t.call(e);const o=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=o):null!==this.holdTime?this.startTime=o-this.holdTime:this.startTime||(this.startTime=r??o),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Sp.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,t;this.notifyFinished(),this.teardown(),this.state="finished",null==(t=(e=this.options).onComplete)||t.call(e)}cancel(){var e,t;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),null==(t=(e=this.options).onCancel)||t.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var t;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),null==(t=this.driver)||t.stop(),e.observe(this)}}const em=e=>180*e/Math.PI,tm=e=>{const t=em(Math.atan2(e[1],e[0]));return rm(t)},nm={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:tm,rotateZ:tm,skewX:e=>em(Math.atan(e[1])),skewY:e=>em(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},rm=e=>((e%=360)<0&&(e+=360),e),om=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),am=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),im={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:om,scaleY:am,scale:e=>(om(e)+am(e))/2,rotateX:e=>rm(em(Math.atan2(e[6],e[5]))),rotateY:e=>rm(em(Math.atan2(-e[2],e[0]))),rotateZ:tm,rotate:tm,skewX:e=>em(Math.atan(e[4])),skewY:e=>em(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function sm(e){return e.includes("scale")?1:0}function lm(e,t){if(!e||"none"===e)return sm(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=im,o=n;else{const t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=nm,o=t}if(!o)return sm(t);const a=r[t],i=o[1].split(",").map(um);return"function"==typeof a?a(i):i[a]}function um(e){return parseFloat(e.trim())}const cm=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],dm=(()=>new Set(cm))(),fm=e=>e===Mp||e===Wp,pm=new Set(["x","y","z"]),hm=cm.filter(e=>!pm.has(e));const mm={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const o=e.max-e.min;return"border-box"===r?o:o-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const o=e.max-e.min;return"border-box"===r?o:o-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})=>lm(t,"x"),y:(e,{transform:t})=>lm(t,"y")};mm.translateX=mm.x,mm.translateY=mm.y;const gm=new Set;let vm=!1,ym=!1,bm=!1;function xm(){if(ym){const e=Array.from(gm).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{const t=function(e){const t=[];return hm.forEach(n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=n.get(e);t&&t.forEach(([t,n])=>{var r;null==(r=e.getValue(t))||r.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}ym=!1,vm=!1,gm.forEach(e=>e.complete(bm)),gm.clear()}function wm(){gm.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ym=!0)})}class km{constructor(e,t,n,r,o,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=o,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(gm.add(this),vm||(vm=!0,vp.read(wm),vp.resolveKeyframes(xm))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(null===e[0]){const o=null==r?void 0:r.get(),a=e[e.length-1];if(void 0!==o)e[0]=o;else if(n&&t){const r=n.readValue(t,a);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=a),r&&void 0===o&&r.set(e[0])}!function(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),gm.delete(this)}cancel(){"scheduled"===this.state&&(gm.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function Sm(e,t,n){(e=>e.startsWith("--"))(t)?e.style.setProperty(t,n):e.style[t]=n}const Em={};function jm(e,t){const n=Uf(e);return()=>Em[t]??n()}const Cm=jm(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Pm=jm(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(vT){return!1}return!0},"linearEasing"),Nm=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Tm={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Nm([0,.65,.55,1]),circOut:Nm([.55,0,1,.45]),backIn:Nm([.31,.01,.66,-.59]),backOut:Nm([.33,1.53,.69,.99])};function Mm(e,t){return e?"function"==typeof e?Pm()?bh(e,t):"ease-out":fp(e)?Nm(e):Array.isArray(e)?e.map(e=>Mm(e,t)||Tm.easeOut):Tm[e]:void 0}function Rm(e,t,n,{delay:r=0,duration:o=300,repeat:a=0,repeatType:i="loop",ease:s="easeOut",times:l}={},u=void 0){const c={[t]:n};l&&(c.offset=l);const d=Mm(s,o);Array.isArray(d)&&(c.easing=d);const f={delay:r,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:"reverse"===i?"alternate":"normal"};u&&(f.pseudoElement=u);return e.animate(c,f)}function Lm(e){return"function"==typeof e&&"applyToOptions"in e}class Dm extends Qh{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:n,keyframes:r,pseudoElement:o,allowFlatten:a=!1,finalKeyframe:i,onComplete:s}=e;this.isPseudoElement=Boolean(o),this.allowFlatten=a,this.options=e,e.type;const l=function({type:e,...t}){return Lm(e)&&Pm()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=Rm(t,n,r,l,o),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const e=Kh(r,this.options,i,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Sm(t,n,e),this.animation.cancel()}null==s||s(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,t;null==(t=(e=this.animation).finish)||t.call(e)}cancel(){try{this.animation.cancel()}catch(vT){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var e,t,n;const r=null==(e=this.options)?void 0:e.element;!this.isPseudoElement&&(null==r?void 0:r.isConnected)&&(null==(n=(t=this.animation).commitStyles)||n.call(t))}get duration(){var e,t;const n=(null==(t=null==(e=this.animation.effect)?void 0:e.getComputedTiming)?void 0:t.call(e).duration)||0;return Xf(Number(n))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Xf(e)}get time(){return Xf(Number(this.animation.currentTime)||0)}set time(e){const t=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=qf(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 null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){var o;return this.allowFlatten&&(null==(o=this.animation.effect)||o.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&Cm()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),Wf):r(this)}}const _m={anticipate:ap,backInOut:op,circInOut:lp};function Am(e){"string"==typeof e.ease&&e.ease in _m&&(e.ease=_m[e.ease])}class Om extends Dm{constructor(e){Am(e),Xh(e),super(e),void 0!==e.startTime&&!1!==e.autoplay&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:t,onUpdate:n,onComplete:r,element:o,...a}=this.options;if(!t)return;if(void 0!==e)return void t.set(e);const i=new Jh({...a,autoplay:!1}),s=Math.max(10,Sp.now()-this.startTime),l=zf(0,10,s-10),u=i.sample(s).value,{name:c}=this.options;o&&c&&Sm(o,c,u),t.setWithVelocity(i.sample(Math.max(0,s-l)).value,u,l),i.stop()}}const Im=(e,t)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!rh.test(e)&&"0"!==e||e.startsWith("url(")));function zm(e){e.duration=0,e.type="keyframes"}const Fm=new Set(["opacity","clipPath","filter","transform"]),Vm=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const $m=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Bm=Uf(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Um(e){var t;const{motionValue:n,name:r,repeatDelay:o,repeatType:a,damping:i,type:s,keyframes:l}=e;if(!((null==(t=null==n?void 0:n.owner)?void 0:t.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:c}=n.owner.getProps();return Bm()&&r&&(Fm.has(r)||$m.has(r)&&function(e){for(let t=0;t<e.length;t++)if("string"==typeof e[t]&&Vm.test(e[t]))return!0;return!1}(l))&&("transform"!==r||!c)&&!u&&!o&&"mirror"!==a&&0!==i&&"inertia"!==s}class Wm extends Qh{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:a="loop",keyframes:i,name:s,motionValue:l,element:u,...c}){var d;super(),this.stop=()=>{var e,t;this._animation&&(this._animation.stop(),null==(e=this.stopTimeline)||e.call(this)),null==(t=this.keyframeResolver)||t.cancel()},this.createdAt=Sp.now();const f={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:o,repeatType:a,name:s,motionValue:l,element:u,...c},p=(null==u?void 0:u.KeyframeResolver)||km;this.keyframeResolver=new p(i,(e,t,n)=>this.onKeyframesResolved(e,t,f,!n),s,l,u),null==(d=this.keyframeResolver)||d.scheduleResolve()}onKeyframesResolved(e,t,n,r){var o,a;this.keyframeResolver=void 0;const{name:i,type:s,velocity:l,delay:u,isHandoff:c,onUpdate:d}=n;this.resolvedAt=Sp.now();let f=!0;(function(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const a=e[e.length-1],i=Im(o,t),s=Im(a,t);return!(!i||!s)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||("spring"===n||Lm(n))&&r)})(e,i,s,l)||(f=!1,!Ff.instantAnimations&&u||null==d||d(Kh(e,n,t)),e[0]=e[e.length-1],zm(n),n.repeat=0);const p={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},h=f&&!c&&Um(p),m=null==(a=null==(o=p.motionValue)?void 0:o.owner)?void 0:a.current;let g;if(h)try{g=new Om({...p,element:m})}catch{g=new Jh(p)}else g=new Jh(p);g.finished.then(()=>{this.notifyFinished()}).catch(Wf),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||(null==(e=this.keyframeResolver)||e.resume(),bm=!0,wm(),xm(),bm=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),null==(e=this.keyframeResolver)||e.cancel()}}function Hm(e,t,n,r=0,o=1){const a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),i=e.size,s=(i-1)*r;return"function"==typeof n?n(a,i):1===o?a*r:s-a*r}const Gm=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ym(e,t,n=1){const[r,o]=function(e){const t=Gm.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const e=a.trim();return Vf(e)?parseFloat(e):e}return Pp(o)?Ym(o,t,n+1):o}const Km={type:"spring",stiffness:500,damping:25,restSpeed:10},qm={type:"keyframes",duration:.8},Xm={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Qm=(e,{keyframes:t})=>t.length>2?qm:dm.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Km:Xm;function Zm(e,t){if((null==e?void 0:e.inherit)&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Jm(e,t){const n=(null==e?void 0:e[t])??(null==e?void 0:e.default)??e;return n!==e?Zm(n,e):n}const eg=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const tg=(e,t,n,r={},o,a)=>i=>{const s=Jm(r,e)||{},l=s.delay||r.delay||0;let{elapsed:u=0}=r;u-=qf(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-u,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{i(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:o};(function(e){for(const t in e)if(!eg.has(t))return!0;return!1})(s)||Object.assign(c,Qm(e,c)),c.duration&&(c.duration=qf(c.duration)),c.repeatDelay&&(c.repeatDelay=qf(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(zm(c),0===c.delay&&(d=!0)),(Ff.instantAnimations||Ff.skipAnimations||(null==o?void 0:o.shouldSkipAnimations))&&(d=!0,zm(c),c.delay=0),c.allowFlatten=!s.type&&!s.ease,d&&!a&&void 0!==t.get()){const e=Kh(c.keyframes,s);if(void 0!==e)return void vp.update(()=>{c.onUpdate(e),c.onComplete()})}return s.isSync?new Jh(c):new Wm(c)};function ng(e){const t=[{},{}];return null==e||e.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function rg(e,t,n,r){if("function"==typeof t){const[o,a]=ng(r);t=t(void 0!==n?n:e.custom,o,a)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,a]=ng(r);t=t(void 0!==n?n:e.custom,o,a)}return t}function og(e,t,n){const r=e.getProps();return rg(r,t,void 0!==n?n:r.custom,e)}const ag=new Set(["width","height","top","left","right","bottom",...cm]);class ig{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{var t;const n=Sp.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(null==(t=this.events.change)||t.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=Sp.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Kf);const n=this.events[e].add(t);return"change"===e?()=>{n(),vp.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;null==(e=this.events.change)||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Sp.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Qf(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(){var e,t;null==(e=this.dependents)||e.clear(),null==(t=this.events.destroy)||t.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function sg(e,t){return new ig(e,t)}const lg=e=>Array.isArray(e);function ug(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,sg(n))}function cg(e){return lg(e)?e[e.length-1]||0:e}const dg=e=>Boolean(e&&e.getVelocity);function fg(e,t){const n=e.getValue("willChange");if(r=n,Boolean(dg(r)&&r.add))return n.add(t);if(!n&&Ff.WillChange){const n=new Ff.WillChange("auto");e.addValue("willChange",n),n.add(t)}var r}function pg(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const hg="data-"+pg("framerAppearId");function mg(e){return e.props[hg]}function gg({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function vg(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:a,transitionEnd:i,...s}=t;const l=e.getDefaultTransition();a=a?Zm(a,l):l;const u=null==a?void 0:a.reduceMotion;r&&(a=r);const c=[],d=o&&e.animationState&&e.animationState.getState()[o];for(const f in s){const t=e.getValue(f,e.latestValues[f]??null),r=s[f];if(void 0===r||d&&gg(d,f))continue;const o={delay:n,...Jm(a||{},f)},i=t.get();if(void 0!==i&&!t.isAnimating()&&!Array.isArray(r)&&r===i&&!o.velocity){vp.update(()=>t.set(r));continue}let l=!1;if(window.MotionHandoffAnimation){const t=mg(e);if(t){const e=window.MotionHandoffAnimation(t,f,vp);null!==e&&(o.startTime=e,l=!0)}}fg(e,f);const p=u??e.shouldReduceMotion;t.start(tg(f,t,r,p&&ag.has(f)?{type:!1}:o,e,l));const h=t.animation;h&&c.push(h)}if(i){const t=()=>vp.update(()=>{i&&function(e,t){const n=og(e,t);let{transitionEnd:r={},transition:o={},...a}=n||{};a={...a,...r};for(const i in a)ug(e,i,cg(a[i]))}(e,i)});c.length?Promise.all(c).then(t):t()}return c}function yg(e,t,n={}){var r;const o=og(e,t,"exit"===n.type?null==(r=e.presenceContext)?void 0:r.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(a=n.transitionOverride);const i=o?()=>Promise.all(vg(e,o,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:i,staggerDirection:s}=a;return function(e,t,n=0,r=0,o=0,a=1,i){const s=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),s.push(yg(l,t,{...i,delay:n+("function"==typeof r?0:r)+Hm(e.variantChildren,l,r,o,a)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(s)}(e,t,r,o,i,s,n)}:()=>Promise.resolve(),{when:l}=a;if(l){const[e,t]="beforeChildren"===l?[i,s]:[s,i];return e().then(()=>t())}return Promise.all([i(),s(n.delay)])}const bg=e=>t=>t.test(e),xg=[Mp,Wp,Up,Bp,Gp,Hp,{test:e=>"auto"===e,parse:e=>e}],wg=e=>xg.find(bg(e));function kg(e){return"number"==typeof e?0===e:null===e||("none"===e||"0"===e||Bf(e))}const Sg=new Set(["brightness","contrast","saturate","opacity"]);function Eg(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(_p)||[];if(!r)return e;const o=n.replace(r,"");let a=Sg.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+o+")"}const jg=/\b([a-z-]*)\(.*?\)/gu,Cg={...rh,getAnimatableNone:e=>{const t=e.match(jg);return t?t.map(Eg).join(" "):e}},Pg={...rh,getAnimatableNone:e=>{const t=rh.parse(e);return rh.createTransformer(e)(t.map(e=>"number"==typeof e?0:"object"==typeof e?{...e,alpha:1}:e))}},Ng={...Mp,transform:Math.round},Tg={borderWidth:Wp,borderTopWidth:Wp,borderRightWidth:Wp,borderBottomWidth:Wp,borderLeftWidth:Wp,borderRadius:Wp,borderTopLeftRadius:Wp,borderTopRightRadius:Wp,borderBottomRightRadius:Wp,borderBottomLeftRadius:Wp,width:Wp,maxWidth:Wp,height:Wp,maxHeight:Wp,top:Wp,right:Wp,bottom:Wp,left:Wp,inset:Wp,insetBlock:Wp,insetBlockStart:Wp,insetBlockEnd:Wp,insetInline:Wp,insetInlineStart:Wp,insetInlineEnd:Wp,padding:Wp,paddingTop:Wp,paddingRight:Wp,paddingBottom:Wp,paddingLeft:Wp,paddingBlock:Wp,paddingBlockStart:Wp,paddingBlockEnd:Wp,paddingInline:Wp,paddingInlineStart:Wp,paddingInlineEnd:Wp,margin:Wp,marginTop:Wp,marginRight:Wp,marginBottom:Wp,marginLeft:Wp,marginBlock:Wp,marginBlockStart:Wp,marginBlockEnd:Wp,marginInline:Wp,marginInlineStart:Wp,marginInlineEnd:Wp,fontSize:Wp,backgroundPositionX:Wp,backgroundPositionY:Wp,...{rotate:Bp,rotateX:Bp,rotateY:Bp,rotateZ:Bp,scale:Lp,scaleX:Lp,scaleY:Lp,scaleZ:Lp,skew:Bp,skewX:Bp,skewY:Bp,distance:Wp,translateX:Wp,translateY:Wp,translateZ:Wp,x:Wp,y:Wp,z:Wp,perspective:Wp,transformPerspective:Wp,opacity:Rp,originX:Yp,originY:Yp,originZ:Wp},zIndex:Ng,fillOpacity:Rp,strokeOpacity:Rp,numOctaves:Ng},Mg={...Tg,color:qp,backgroundColor:qp,outlineColor:qp,fill:qp,stroke:qp,borderColor:qp,borderTopColor:qp,borderRightColor:qp,borderBottomColor:qp,borderLeftColor:qp,filter:Cg,WebkitFilter:Cg,mask:Pg,WebkitMask:Pg},Rg=e=>Mg[e],Lg=new Set([Cg,Pg]);function Dg(e,t){let n=Rg(e);return Lg.has(n)||(n=rh),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const _g=new Set(["auto","none","0"]);class Ag extends km{constructor(e,t,n,r,o){super(e,t,n,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let s=0;s<e.length;s++){let n=e[s];if("string"==typeof n&&(n=n.trim(),Pp(n))){const r=Ym(n,t.current);void 0!==r&&(e[s]=r),s===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!ag.has(n)||2!==e.length)return;const[r,o]=e,a=wg(r),i=wg(o);if(Tp(r)!==Tp(o)&&mm[n])this.needsMeasurement=!0;else if(a!==i)if(fm(a)&&fm(i))for(let s=0;s<e.length;s++){const t=e[s];"string"==typeof t&&(e[s]=parseFloat(t))}else mm[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let r=0;r<e.length;r++)(null===e[r]||kg(e[r]))&&n.push(r);n.length&&function(e,t,n){let r,o=0;for(;o<e.length&&!r;){const t=e[o];"string"==typeof t&&!_g.has(t)&&eh(t).values.length&&(r=e[o]),o++}if(r&&n)for(const a of t)e[a]=Dg(n,r)}(e,n,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=mm[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];void 0!==r&&e.getValue(n,r).jump(r,!1)}measureEndState(){var e;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const a=r.length-1,i=r[a];r[a]=mm[n](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),(null==(e=this.removedTransforms)?void 0:e.length)&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}function Og(e,t,n){if(null==e)return[];if(e instanceof EventTarget)return[e];if("string"==typeof e){let t=document;const r=(null==n?void 0:n[e])??t.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e).filter(e=>null!=e)}const Ig=(e,t)=>t&&"number"==typeof e?t.transform(e):e;function zg(e){return $f(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Fg}=gp(queueMicrotask,!1),Vg={x:!1,y:!1};function $g(){return Vg.x||Vg.y}function Bg(e,t){const n=Og(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Ug(e,t,n={}){const[r,o,a]=Bg(e,n);return r.forEach(e=>{let n,r=!1,a=!1;const i=t=>{n&&(n(t),n=void 0),e.removeEventListener("pointerleave",l)},s=e=>{r=!1,window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s),a&&(a=!1,i(e))},l=e=>{"touch"!==e.pointerType&&(r?a=!0:i(e))};e.addEventListener("pointerenter",r=>{if("touch"===r.pointerType||$g())return;a=!1;const i=t(e,r);"function"==typeof i&&(n=i,e.addEventListener("pointerleave",l,o))},o),e.addEventListener("pointerdown",()=>{r=!0,window.addEventListener("pointerup",s,o),window.addEventListener("pointercancel",s,o)},o)}),a}const Wg=(e,t)=>!!t&&(e===t||Wg(e,t.parentElement)),Hg=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,Gg=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Yg=new Set(["INPUT","SELECT","TEXTAREA"]);const Kg=new WeakSet;function qg(e){return t=>{"Enter"===t.key&&e(t)}}function Xg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function Qg(e){return Hg(e)&&!$g()}const Zg=new WeakSet;function Jg(e,t,n={}){const[r,o,a]=Bg(e,n),i=e=>{const r=e.currentTarget;if(!Qg(e))return;if(Zg.has(e))return;Kg.add(r),n.stopPropagation&&Zg.add(e);const a=t(r,e),i=(e,t)=>{window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",l),Kg.has(r)&&Kg.delete(r),Qg(e)&&"function"==typeof a&&a(e,{success:t})},s=e=>{i(e,r===window||r===document||n.useGlobalTarget||Wg(r,e.target))},l=e=>{i(e,!1)};window.addEventListener("pointerup",s,o),window.addEventListener("pointercancel",l,o)};return r.forEach(e=>{var t;(n.useGlobalTarget?window:e).addEventListener("pointerdown",i,o),zg(e)&&(e.addEventListener("focus",e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const r=qg(()=>{if(Kg.has(n))return;Xg(n,"down");const e=qg(()=>{Xg(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>Xg(n,"cancel"),t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)})(e,o)),t=e,Gg.has(t.tagName)||!0===t.isContentEditable||e.hasAttribute("tabindex")||(e.tabIndex=0))}),a}function ev(e){return $f(e)&&"ownerSVGElement"in e}const tv=new WeakMap;let nv;const rv=(e,t,n)=>(r,o)=>o&&o[0]?o[0][e+"Size"]:ev(r)&&"getBBox"in r?r.getBBox()[t]:r[n],ov=rv("inline","width","offsetWidth"),av=rv("block","height","offsetHeight");function iv({target:e,borderBoxSize:t}){var n;null==(n=tv.get(e))||n.forEach(n=>{n(e,{get width(){return ov(e,t)},get height(){return av(e,t)}})})}function sv(e){e.forEach(iv)}function lv(e,t){nv||"undefined"!=typeof ResizeObserver&&(nv=new ResizeObserver(sv));const n=Og(e);return n.forEach(e=>{let n=tv.get(e);n||(n=new Set,tv.set(e,n)),n.add(t),null==nv||nv.observe(e)}),()=>{n.forEach(e=>{const n=tv.get(e);null==n||n.delete(t),(null==n?void 0:n.size)||null==nv||nv.unobserve(e)})}}const uv=new Set;let cv;function dv(e){return uv.add(e),cv||(cv=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};uv.forEach(t=>t(e))},window.addEventListener("resize",cv)),()=>{uv.delete(e),uv.size||"function"!=typeof cv||(window.removeEventListener("resize",cv),cv=void 0)}}function fv(e,t){return"function"==typeof e?dv(e):lv(e,t)}const pv=[...xg,qp,rh],hv=()=>({x:{min:0,max:0},y:{min:0,max:0}}),mv=new WeakMap;function gv(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function vv(e){return"string"==typeof e||Array.isArray(e)}const yv=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],bv=["initial",...yv];function xv(e){return gv(e.animate)||bv.some(t=>vv(e[t]))}function wv(e){return Boolean(xv(e)||e.variants)}const kv={current:null},Sv={current:!1},Ev="undefined"!=typeof window;const jv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Cv={};function Pv(e){Cv=e}class Nv{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:o,blockInitialAnimation:a,visualState:i},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=km,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=Sp.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,vp.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=i;this.latestValues=l,this.baseTarget={...l},this.initialValues=t.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=o,this.options=s,this.blockInitialAnimation=Boolean(a),this.isControllingVariants=xv(t),this.isVariantNode=wv(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const f in d){const e=d[f];void 0!==l[f]&&dg(e)&&e.set(l[f])}}mount(e){var t,n;if(this.hasBeenMounted)for(const r in this.initialValues)null==(t=this.values.get(r))||t.jump(this.initialValues[r]),this.latestValues[r]=this.initialValues[r];this.current=e,mv.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Sv.current||function(){if(Sv.current=!0,Ev)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>kv.current=e.matches;e.addEventListener("change",t),t()}else kv.current=!1}(),this.shouldReduceMotion=kv.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,null==(n=this.parent)||n.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),yp(this.notifyUpdate),yp(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),null==(e=this.parent)||e.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Fm.has(e)&&this.current instanceof HTMLElement){const{factory:n,keyframes:r,times:o,ease:a,duration:i}=t.accelerate,s=new Dm({element:this.current,name:e,keyframes:r,times:o,ease:a,duration:qf(i)}),l=n(s);return void this.valueSubscriptions.set(e,()=>{l(),s.cancel()})}const n=dm.has(e);n&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&vp.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),o&&o(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in Cv){const t=Cv[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let n=0;n<jv.length;n++){const t=jv[n];this.propEventSubscriptions[t]&&(this.propEventSubscriptions[t](),delete this.propEventSubscriptions[t]);const r=e["on"+t];r&&(this.propEventSubscriptions[t]=this.on(t,r))}this.prevMotionValues=function(e,t,n){for(const r in t){const o=t[r],a=n[r];if(dg(o))e.addValue(r,o);else if(dg(a))e.addValue(r,sg(o,{owner:e}));else if(a!==o)if(e.hasValue(r)){const t=e.getValue(r);!0===t.liveStyle?t.jump(o):t.hasAnimated||t.set(o)}else{const t=e.getStaticValue(r);e.addValue(r,sg(void 0!==t?t:o,{owner:e}))}}for(const r in n)void 0===t[r]&&e.removeValue(r);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=sg(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=void 0===this.latestValues[e]&&this.current?this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];var r;return null!=n&&("string"==typeof n&&(Vf(n)||Bf(n))?n=parseFloat(n):(r=n,!pv.find(bg(r))&&rh.test(t)&&(n=Dg(e,t))),this.setBaseTarget(e,dg(n)?n.get():n)),dg(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const o=rg(this.props,n,null==(t=this.presenceContext)?void 0:t.custom);o&&(r=o[e])}if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||dg(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new Kf),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Fg.render(this.render)}}class Tv extends Nv{constructor(){super(...arguments),this.KeyframeResolver=Ag}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){const n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;dg(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}class Mv{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Rv({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Lv(e){return void 0===e||1===e}function Dv({scale:e,scaleX:t,scaleY:n}){return!Lv(e)||!Lv(t)||!Lv(n)}function _v(e){return Dv(e)||Av(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Av(e){return Ov(e.x)||Ov(e.y)}function Ov(e){return e&&"0%"!==e}function Iv(e,t,n){return n+t*(e-n)}function zv(e,t,n,r,o){return void 0!==o&&(e=Iv(e,o,r)),Iv(e,n,r)+t}function Fv(e,t=0,n=1,r,o){e.min=zv(e.min,t,n,r,o),e.max=zv(e.max,t,n,r,o)}function Vv(e,{x:t,y:n}){Fv(e.x,t.translate,t.scale,t.originPoint),Fv(e.y,n.translate,n.scale,n.originPoint)}const $v=.999999999999,Bv=1.0000000000001;function Uv(e,t){e.min+=t,e.max+=t}function Wv(e,t,n,r,o=.5){Fv(e,t,n,ih(e.min,e.max,o),r)}function Hv(e,t){return"string"==typeof e?parseFloat(e)/100*(t.max-t.min):e}function Gv(e,t,n){const r=n??e;Wv(e.x,Hv(t.x,r.x),t.scaleX,t.scale,t.originX),Wv(e.y,Hv(t.y,r.y),t.scaleY,t.scale,t.originY)}function Yv(e,t){return Rv(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}const Kv={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},qv=cm.length;function Xv(e,t,n){const{style:r,vars:o,transformOrigin:a}=e;let i=!1,s=!1;for(const l in t){const e=t[l];if(dm.has(l))i=!0;else if(jp(l))o[l]=e;else{const t=Ig(e,Tg[l]);l.startsWith("origin")?(s=!0,a[l]=t):r[l]=t}}if(t.transform||(i||n?r.transform=function(e,t,n){let r="",o=!0;for(let a=0;a<qv;a++){const i=cm[a],s=e[i];if(void 0===s)continue;let l=!0;if("number"==typeof s)l=s===(i.startsWith("scale")?1:0);else{const e=parseFloat(s);l=i.startsWith("scale")?1===e:0===e}if(!l||n){const e=Ig(s,Tg[i]);l||(o=!1,r+=`${Kv[i]||i}(${e}) `),n&&(t[i]=e)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}(t,e.transform,n):r.transform&&(r.transform="none")),s){const{originX:e="50%",originY:t="50%",originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function Qv(e,{style:t,vars:n},r,o){const a=e.style;let i;for(i in t)a[i]=t[i];for(i in null==o||o.applyProjectionStyles(a,r),n)a.setProperty(i,n[i])}function Zv(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Jv={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!Wp.test(e))return e;e=parseFloat(e)}return`${Zv(e,t.target.x)}% ${Zv(e,t.target.y)}%`}},ey={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=rh.parse(e);if(o.length>5)return r;const a=rh.createTransformer(e),i="number"!=typeof o[0]?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;o[0+i]/=s,o[1+i]/=l;const u=ih(s,l,.5);return"number"==typeof o[2+i]&&(o[2+i]/=u),"number"==typeof o[3+i]&&(o[3+i]/=u),a(o)}},ty={borderRadius:{...Jv,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Jv,borderTopRightRadius:Jv,borderBottomLeftRadius:Jv,borderBottomRightRadius:Jv,boxShadow:ey};function ny(e,{layout:t,layoutId:n}){return dm.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!ty[e]||"opacity"===e)}function ry(e,t,n){var r;const o=e.style,a=null==t?void 0:t.style,i={};if(!o)return i;for(const s in o)(dg(o[s])||a&&dg(a[s])||ny(s,e)||void 0!==(null==(r=null==n?void 0:n.getValue(s))?void 0:r.liveStyle))&&(i[s]=o[s]);return i}class oy extends Tv{constructor(){super(...arguments),this.type="html",this.renderInstance=Qv}readValueFromInstance(e,t){var n,r;if(dm.has(t))return(null==(n=this.projection)?void 0:n.isProjecting)?sm(t):((e,t)=>{const{transform:n="none"}=getComputedStyle(e);return lm(n,t)})(e,t);{const n=(r=e,window.getComputedStyle(r)),o=(jp(t)?n.getPropertyValue(t):n[t])||0;return"string"==typeof o?o.trim():o}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Yv(e,t)}build(e,t,n){Xv(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return ry(e,t,n)}}const ay={offset:"stroke-dashoffset",array:"stroke-dasharray"},iy={offset:"strokeDashoffset",array:"strokeDasharray"};const sy=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function ly(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:a=1,pathOffset:i=0,...s},l,u,c){if(Xv(e,s,u),l)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=(null==c?void 0:c.transformBox)??"fill-box",delete d.transformBox);for(const p of sy)void 0!==d[p]&&(f[p]=d[p],delete d[p]);void 0!==t&&(d.x=t),void 0!==n&&(d.y=n),void 0!==r&&(d.scale=r),void 0!==o&&function(e,t,n=1,r=0,o=!0){e.pathLength=1;const a=o?ay:iy;e[a.offset]=""+-r,e[a.array]=`${t} ${n}`}(d,o,a,i,!1)}const uy=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"]),cy=e=>"string"==typeof e&&"svg"===e.toLowerCase();function dy(e,t,n){const r=ry(e,t,n);for(const o in e)if(dg(e[o])||dg(t[o])){r[-1!==cm.indexOf(o)?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o]=e[o]}return r}class fy extends Tv{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=hv}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(dm.has(t)){const e=Rg(t);return e&&e.default||0}return t=uy.has(t)?t:pg(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return dy(e,t,n)}build(e,t,n){ly(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){!function(e,t,n,r){Qv(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(uy.has(o)?o:pg(o),t.attrs[o])}(e,t,0,r)}mount(e){this.isSVGTag=cy(e.tagName),super.mount(e)}}const py=bv.length;function hy(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&hy(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<py;n++){const r=bv[n],o=e.props[r];(vv(o)||!1===o)&&(t[r]=o)}return t}function my(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const gy=[...yv].reverse(),vy=yv.length;function yy(e){return t=>Promise.all(t.map(({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map(t=>yg(e,t,n));r=Promise.all(o)}else if("string"==typeof t)r=yg(e,t,n);else{const o="function"==typeof t?og(e,t,n.custom):t;r=Promise.all(vg(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}(e,t,n)))}function by(e){let t=yy(e),n=ky(),r=!0,o=!1;const a=t=>(n,r)=>{var o;const a=og(e,r,"exit"===t?null==(o=e.presenceContext)?void 0:o.custom:void 0);if(a){const{transition:e,transitionEnd:t,...r}=a;n={...n,...r,...t}}return n};function i(i){const{props:s}=e,l=hy(e.parent)||{},u=[],c=new Set;let d={},f=1/0;for(let t=0;t<vy;t++){const p=gy[t],h=n[p],m=void 0!==s[p]?s[p]:l[p],g=vv(m),v=p===i?h.isActive:null;!1===v&&(f=t);let y=m===l[p]&&m!==s[p]&&g;if(y&&(r||o)&&e.manuallyAnimateOnMount&&(y=!1),h.protectedKeys={...d},!h.isActive&&null===v||!m&&!h.prevProp||gv(m)||"boolean"==typeof m)continue;if("exit"===p&&h.isActive&&!0!==v){h.prevResolvedValues&&(d={...d,...h.prevResolvedValues});continue}const b=xy(h.prevProp,m);let x=b||p===i&&h.isActive&&!y&&g||t>f&&g,w=!1;const k=Array.isArray(m)?m:[m];let S=k.reduce(a(p),{});!1===v&&(S={});const{prevResolvedValues:E={}}=h,j={...E,...S},C=t=>{x=!0,c.has(t)&&(w=!0,c.delete(t)),h.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in j){const t=S[e],n=E[e];if(d.hasOwnProperty(e))continue;let r=!1;r=lg(t)&&lg(n)?!my(t,n):t!==n,r?null!=t?C(e):c.add(e):void 0!==t&&c.has(e)?C(e):h.protectedKeys[e]=!0}h.prevProp=m,h.prevResolvedValues=S,h.isActive&&(d={...d,...S}),(r||o)&&e.blockInitialAnimation&&(x=!1);const P=y&&b;x&&(!P||w)&&u.push(...k.map(t=>{const n={type:p};if("string"==typeof t&&(r||o)&&!P&&e.manuallyAnimateOnMount&&e.parent){const{parent:r}=e,o=og(r,t);if(r.enteringChildren&&o){const{delayChildren:t}=o.transition||{};n.delay=Hm(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(c.size){const t={};if("boolean"!=typeof s.initial){const n=og(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}c.forEach(n=>{const r=e.getBaseTarget(n),o=e.getValue(n);o&&(o.liveStyle=!0),t[n]=r??null}),u.push({animation:t})}let p=Boolean(u.length);return!r||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(p=!1),r=!1,o=!1,p?t(u):Promise.resolve()}return{animateChanges:i,setActive:function(t,r){var o;if(n[t].isActive===r)return Promise.resolve();null==(o=e.variantChildren)||o.forEach(e=>{var n;return null==(n=e.animationState)?void 0:n.setActive(t,r)}),n[t].isActive=r;const a=i(t);for(const e in n)n[e].protectedKeys={};return a},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=ky(),o=!0}}}function xy(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!my(t,e)}function wy(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ky(){return{animate:wy(!0),whileInView:wy(),whileHover:wy(),whileTap:wy(),whileDrag:wy(),whileFocus:wy(),exit:wy()}}function Sy(e,t){e.min=t.min,e.max=t.max}function Ey(e,t){Sy(e.x,t.x),Sy(e.y,t.y)}function jy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Cy(e){return e.max-e.min}function Py(e,t,n,r=.5){e.origin=r,e.originPoint=ih(t.min,t.max,e.origin),e.scale=Cy(n)/Cy(t),e.translate=ih(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function Ny(e,t,n,r){Py(e.x,t.x,n.x,r?r.originX:void 0),Py(e.y,t.y,n.y,r?r.originY:void 0)}function Ty(e,t,n,r=0){const o=r?ih(n.min,n.max,r):n.min;e.min=o+t.min,e.max=e.min+Cy(t)}function My(e,t,n,r=0){const o=r?ih(n.min,n.max,r):n.min;e.min=t.min-o,e.max=e.min+Cy(t)}function Ry(e,t,n,r){My(e.x,t.x,n.x,null==r?void 0:r.x),My(e.y,t.y,n.y,null==r?void 0:r.y)}function Ly(e,t,n,r,o){return e=Iv(e-=t,1/n,r),void 0!==o&&(e=Iv(e,1/o,r)),e}function Dy(e,t,[n,r,o],a,i){!function(e,t=0,n=1,r=.5,o,a=e,i=e){Up.test(t)&&(t=parseFloat(t),t=ih(i.min,i.max,t/100)-i.min);if("number"!=typeof t)return;let s=ih(a.min,a.max,r);e===a&&(s-=t),e.min=Ly(e.min,t,n,s,o),e.max=Ly(e.max,t,n,s,o)}(e,t[n],t[r],t[o],t.scale,a,i)}const _y=["x","scaleX","originX"],Ay=["y","scaleY","originY"];function Oy(e,t,n,r){Dy(e.x,t,_y,n?n.x:void 0,r?r.x:void 0),Dy(e.y,t,Ay,n?n.y:void 0,r?r.y:void 0)}function Iy(e){return 0===e.translate&&1===e.scale}function zy(e){return Iy(e.x)&&Iy(e.y)}function Fy(e,t){return e.min===t.min&&e.max===t.max}function Vy(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function $y(e,t){return Vy(e.x,t.x)&&Vy(e.y,t.y)}function By(e){return Cy(e.x)/Cy(e.y)}function Uy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Wy(e){return[e("x"),e("y")]}const Hy=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Gy=Hy.length,Yy=e=>"string"==typeof e?parseFloat(e):e,Ky=e=>"number"==typeof e||Wp.test(e);function qy(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Xy=Zy(0,.5,sp),Qy=Zy(.5,.95,Wf);function Zy(e,t,n){return r=>r<e?0:r>t?1:n(Yf(e,t,r))}function Jy(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const eb=(e,t)=>e.depth-t.depth;class tb{constructor(){this.children=[],this.isDirty=!1}add(e){Of(this.children,e),this.isDirty=!0}remove(e){If(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(eb),this.isDirty=!1,this.children.forEach(e)}}function nb(e){return dg(e)?e.get():e}class rb{constructor(){this.members=[]}add(e){Of(this.members,e);for(let t=this.members.length-1;t>=0;t--){const n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;const r=n.instance;r&&!1!==r.isConnected||n.snapshot||(If(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(If(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){var t;for(let n=this.members.indexOf(e)-1;n>=0;n--){const e=this.members[n];if(!1!==e.isPresent&&!1!==(null==(t=e.instance)?void 0:t.isConnected))return this.promote(e),!0}return!1}promote(e,t){var n;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:o}=r.options,{layoutDependency:a}=e.options;void 0!==o&&o===a||(e.resumeFrom=r,t&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(null==(n=e.root)?void 0:n.isUpdating)&&(e.isLayoutDirty=!0)),!1===e.options.crossfade&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var t,n,r,o,a;null==(n=(t=e.options).onExitComplete)||n.call(t),null==(a=null==(r=e.resumingFrom)?void 0:(o=r.options).onExitComplete)||a.call(o)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(null==(e=this.lead)?void 0:e.snapshot)&&(this.lead.snapshot=void 0)}}const ob={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ab=["","X","Y","Z"];let ib=0;function sb(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function lb(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=mg(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",vp,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&lb(r)}function ub({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=ib++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(fb),this.nodes.forEach(wb),this.nodes.forEach(kb),this.nodes.forEach(pb)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new tb)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Kf),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;var n;this.isSVG=ev(t)&&!(ev(n=t)&&"svg"===n.tagName),this.instance=t;const{layoutId:r,layout:o,visualElement:a}=this.options;if(a&&!a.current&&a.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(o||r)&&(this.isLayoutDirty=!0),e){let n,r=0;const o=()=>this.root.updateBlockedByResize=!1;vp.read(()=>{r=window.innerWidth}),e(t,()=>{const e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=Sp.now(),r=({timestamp:o})=>{const a=o-n;a>=t&&(yp(r),e(a-t))};return vp.setup(r,!0),()=>yp(r)}(o,250),ob.hasAnimatedSinceResize&&(ob.hasAnimatedSinceResize=!1,this.nodes.forEach(xb)))})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&a&&(r||o)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||a.getDefaultTransition()||Nb,{onLayoutAnimationStart:i,onLayoutAnimationComplete:s}=a.getProps(),l=!this.targetLayout||!$y(this.targetLayout,r),u=!t&&n;if(this.options.layoutRoot||this.resumeFrom||u||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const t={...Jm(o,"layout"),onPlay:i,onComplete:s};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,u)}else t||xb(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),yp(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(Sb),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&lb(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let o=0;o<this.path.length;o++){const e=this.path[o];e.shouldResetTransform=!0,"string"!=typeof e.latestValues.x&&"string"!=typeof e.latestValues.y||(e.isLayoutDirty=!0),e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:t,layout:n}=this.options;if(void 0===t&&!n)return;const r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked()){const e=this.updateBlockedByResize;return this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(gb),void this.nodes.forEach(mb)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(vb);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(yb),this.nodes.forEach(bb),this.nodes.forEach(cb),this.nodes.forEach(db)):this.nodes.forEach(vb),this.clearAllSnapshots();const e=Sp.now();bp.delta=zf(0,1e3/60,e-bp.timestamp),bp.timestamp=e,bp.isProcessing=!0,xp.update.process(bp),xp.preRender.process(bp),xp.render.process(bp),bp.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Fg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(hb),this.sharedNodes.forEach(Eb)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,vp.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){vp.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Cy(this.snapshot.measuredBox.x)||Cy(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let n=0;n<this.path.length;n++){this.path[n].updateScroll()}const e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}}),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){const t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!zy(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||_v(this.latestValues)||a)&&(o(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let n=this.removeElementScroll(t);var r;return e&&(n=this.removeTransform(n)),Rb((r=n).x),Rb(r.y),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){var e;const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const n=t.measureViewportBox();if(!((null==(e=this.scroll)?void 0:e.wasRoot)||this.path.some(Db))){const{scroll:e}=this.root;e&&(Uv(n.x,e.offset.x),Uv(n.y,e.offset.y))}return n}removeElementScroll(e){var t;const n={x:{min:0,max:0},y:{min:0,max:0}};if(Ey(n,e),null==(t=this.scroll)?void 0:t.wasRoot)return n;for(let r=0;r<this.path.length;r++){const t=this.path[r],{scroll:o,options:a}=t;t!==this.root&&o&&a.layoutScroll&&(o.wasRoot&&Ey(n,e),Uv(n.x,o.offset.x),Uv(n.y,o.offset.y))}return n}applyTransform(e,t=!1,n){var r,o;const a=n||{x:{min:0,max:0},y:{min:0,max:0}};Ey(a,e);for(let i=0;i<this.path.length;i++){const e=this.path[i];!t&&e.options.layoutScroll&&e.scroll&&e!==e.root&&(Uv(a.x,-e.scroll.offset.x),Uv(a.y,-e.scroll.offset.y)),_v(e.latestValues)&&Gv(a,e.latestValues,null==(r=e.layout)?void 0:r.layoutBox)}return _v(this.latestValues)&&Gv(a,this.latestValues,null==(o=this.layout)?void 0:o.layoutBox),a}removeTransform(e){var t;const n={x:{min:0,max:0},y:{min:0,max:0}};Ey(n,e);for(let r=0;r<this.path.length;r++){const e=this.path[r];if(!_v(e.latestValues))continue;let o;e.instance&&(Dv(e.latestValues)&&e.updateSnapshot(),o=hv(),Ey(o,e.measurePageBox())),Oy(n,e.latestValues,null==(t=e.snapshot)?void 0:t.layoutBox,o)}return _v(this.latestValues)&&Oy(n,this.latestValues),n}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==bp.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const r=Boolean(this.resumingFrom)||this!==n;if(!(e||r&&this.isSharedProjectionDirty||this.isProjectionDirty||(null==(t=this.parent)?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:o,layoutId:a}=this.options;if(!this.layout||!o&&!a)return;this.resolvedRelativeTargetAt=bp.timestamp;const i=this.getClosestProjectingParent();var s,l,u,c;(i&&this.linkedParentVersion!==i.layoutVersion&&!i.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&i&&i.layout?this.createRelativeTarget(i,this.layout.layoutBox,i.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta)&&(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),s=this.target,l=this.relativeTarget,u=this.relativeParent.target,c=this.options.layoutAnchor||void 0,Ty(s.x,l.x,u.x,null==c?void 0:c.x),Ty(s.y,l.y,u.y,null==c?void 0:c.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.applyTransform(this.layout.layoutBox,!1,this.target):Ey(this.target,this.layout.layoutBox),Vv(this.target,this.targetDelta)):Ey(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&i&&Boolean(i.resumingFrom)===Boolean(this.resumingFrom)&&!i.options.layoutScroll&&i.target&&1!==this.animationProgress?this.createRelativeTarget(i,this.target,i.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(this.parent&&!Dv(this.parent.latestValues)&&!Av(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ry(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Ey(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var e;const t=this.getLead(),n=Boolean(this.resumingFrom)||this!==t;let r=!0;if((this.isProjectionDirty||(null==(e=this.parent)?void 0:e.isProjectionDirty))&&(r=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===bp.timestamp&&(r=!1),r)return;const{layout:o,layoutId:a}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!o&&!a)return;Ey(this.layoutCorrected,this.layout.layoutBox);const i=this.treeScale.x,s=this.treeScale.y;!function(e,t,n,r=!1){var o;const a=n.length;if(!a)return;let i,s;t.x=t.y=1;for(let l=0;l<a;l++){i=n[l],s=i.projectionDelta;const{visualElement:a}=i.options;a&&a.props.style&&"contents"===a.props.style.display||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(Uv(e.x,-i.scroll.offset.x),Uv(e.y,-i.scroll.offset.y)),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Vv(e,s)),r&&_v(i.latestValues)&&Gv(e,i.latestValues,null==(o=i.layout)?void 0:o.layoutBox))}t.x<Bv&&t.x>$v&&(t.x=1),t.y<Bv&&t.y>$v&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(jy(this.prevProjectionDelta.x,this.projectionDelta.x),jy(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Ny(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===i&&this.treeScale.y===s&&Uy(this.projectionDelta.x,this.prevProjectionDelta.x)&&Uy(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null==(t=this.options.visualElement)||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},o={...this.latestValues},a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const i={x:{min:0,max:0},y:{min:0,max:0}},s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,c=Boolean(s&&!u&&!0===this.options.crossfade&&!this.path.some(Pb));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,f,p,h;jb(a.x,e.x,n),jb(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ry(i,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),l=this.relativeTarget,f=this.relativeTargetOrigin,p=i,h=n,Cb(l.x,f.x,p.x,h),Cb(l.y,f.y,p.y,h),d&&function(e,t){return Fy(e.x,t.x)&&Fy(e.y,t.y)}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Ey(d,this.relativeTarget)),s&&(this.animationValues=o,function(e,t,n,r,o,a){o?(e.opacity=ih(0,n.opacity??1,Xy(r)),e.opacityExit=ih(t.opacity??1,0,Qy(r))):a&&(e.opacity=ih(t.opacity??1,n.opacity??1,r));for(let i=0;i<Gy;i++){const o=Hy[i];let a=qy(t,o),s=qy(n,o);void 0===a&&void 0===s||(a||(a=0),s||(s=0),0===a||0===s||Ky(a)===Ky(s)?(e[o]=Math.max(ih(Yy(a),Yy(s),r),0),(Up.test(s)||Up.test(a))&&(e[o]+="%")):e[o]=s)}(t.rotate||n.rotate)&&(e.rotate=ih(t.rotate||0,n.rotate||0,r))}(o,r,this.latestValues,n,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){var t,n,r;this.notifyListeners("animationStart"),null==(t=this.currentAnimation)||t.stop(),null==(r=null==(n=this.resumingFrom)?void 0:n.currentAnimation)||r.stop(),this.pendingAnimation&&(yp(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=vp.update(()=>{ob.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=sg(0)),this.motionValue.jump(0,!1),this.currentAnimation=function(e,t,n){const r=dg(e)?e:sg(e);return r.start(tg("",r,t,n)),r.animation}(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&Lb(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=Cy(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=Cy(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Ey(t,n),Gv(t,o),Ny(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new rb);this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null==(e=this.getStack())?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null==(e=this.getStack())?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&sb("z",e,r,this.animationValues);for(let o=0;o<ab.length;o++)sb(`rotate${ab[o]}`,e,r,this.animationValues),sb(`skew${ab[o]}`,e,r,this.animationValues);e.render();for(const o in r)e.setStaticValue(o,r[o]),this.animationValues&&(this.animationValues[o]=r[o]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(e.visibility="hidden");const n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,e.visibility="",e.opacity="",e.pointerEvents=nb(null==t?void 0:t.pointerEvents)||"",void(e.transform=n?n(this.latestValues,""):"none");const r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target)return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=nb(null==t?void 0:t.pointerEvents)||""),void(this.hasProjected&&!_v(this.latestValues)&&(e.transform=n?n({},""):"none",this.hasProjected=!1));e.visibility="";const o=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=function(e,t,n){let r="";const o=e.x.translate/t.x,a=e.y.translate/t.y,i=(null==n?void 0:n.z)||0;if((o||a||i)&&(r=`translate3d(${o}px, ${a}px, ${i}px) `),1===t.x&&1===t.y||(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:e,rotate:t,rotateX:o,rotateY:a,skewX:i,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),o&&(r+=`rotateX(${o}deg) `),a&&(r+=`rotateY(${a}deg) `),i&&(r+=`skewX(${i}deg) `),s&&(r+=`skewY(${s}deg) `)}const s=e.x.scale*t.x,l=e.y.scale*t.y;return 1===s&&1===l||(r+=`scale(${s}, ${l})`),r||"none"}(this.projectionDeltaWithTransform,this.treeScale,o);n&&(a=n(o,a)),e.transform=a;const{x:i,y:s}=this.projectionDelta;e.transformOrigin=`${100*i.origin}% ${100*s.origin}% 0`,r.animationValues?e.opacity=r===this?o.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:o.opacityExit:e.opacity=r===this?void 0!==o.opacity?o.opacity:"":void 0!==o.opacityExit?o.opacityExit:0;for(const l in ty){if(void 0===o[l])continue;const{correct:t,applyTo:n,isCSSVariable:i}=ty[l],s="none"===a?o[l]:t(o[l],r);if(n){const t=n.length;for(let r=0;r<t;r++)e[n[r]]=s}else i?this.options.visualElement.renderState.vars[l]=s:e[l]=s}this.options.layoutId&&(e.pointerEvents=r===this?nb(null==t?void 0:t.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>{var t;return null==(t=e.currentAnimation)?void 0:t.stop()}),this.root.nodes.forEach(mb),this.root.sharedNodes.clear()}}}function cb(e){e.updateLayout()}function db(e){var t;const n=(null==(t=e.resumeFrom)?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:o}=e.options,a=n.source!==e.layout.source;if("size"===o)Wy(e=>{const r=a?n.measuredBox[e]:n.layoutBox[e],o=Cy(r);r.min=t[e].min,r.max=r.min+o});else if("x"===o||"y"===o){const e="x"===o?"y":"x";Sy(a?n.measuredBox[e]:n.layoutBox[e],t[e])}else Lb(o,n.layoutBox,t)&&Wy(r=>{const o=a?n.measuredBox[r]:n.layoutBox[r],i=Cy(t[r]);o.max=o.min+i,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+i)});const i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Ny(i,t,n.layoutBox);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};a?Ny(s,e.applyTransform(r,!0),n.measuredBox):Ny(s,t,n.layoutBox);const l=!zy(i);let u=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:a}=r;if(o&&a){const i=e.options.layoutAnchor||void 0,s={x:{min:0,max:0},y:{min:0,max:0}};Ry(s,n.layoutBox,o.layoutBox,i);const l={x:{min:0,max:0},y:{min:0,max:0}};Ry(l,t,a.layoutBox,i),$y(s,l)||(u=!0),r.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:s,layoutDelta:i,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function fb(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function pb(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function hb(e){e.clearSnapshot()}function mb(e){e.clearMeasurements()}function gb(e){e.isLayoutDirty=!0,e.updateLayout()}function vb(e){e.isLayoutDirty=!1}function yb(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function bb(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function xb(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function wb(e){e.resolveTargetDelta()}function kb(e){e.calcProjection()}function Sb(e){e.resetSkewAndRotation()}function Eb(e){e.removeLeadSnapshot()}function jb(e,t,n){e.translate=ih(t.translate,0,n),e.scale=ih(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Cb(e,t,n,r){e.min=ih(t.min,n.min,r),e.max=ih(t.max,n.max,r)}function Pb(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const Nb={duration:.45,ease:[.4,0,.1,1]},Tb=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Mb=Tb("applewebkit/")&&!Tb("chrome/")?Math.round:Wf;function Rb(e){e.min=Mb(e.min),e.max=Mb(e.max)}function Lb(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=By(t),o=By(n),a=.2,!(Math.abs(r-o)<=a));var r,o,a}function Db(e){var t;return e!==e.root&&(null==(t=e.scroll)?void 0:t.wasRoot)}const _b=ub({attachResizeListener:(e,t)=>Jy(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||(null==(e=document.body)?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||(null==(t=document.body)?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Ab={current:void 0},Ob=ub({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ab.current){const e=new _b({});e.mount(window),e.setOptions({layoutScroll:!0}),Ab.current=e}return Ab.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),Ib=W.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function zb(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Fb(...e){return W.useCallback(function(...e){return t=>{let n=!1;const r=e.map(e=>{const r=zb(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():zb(e[t],null)}}}}(...e),e)}class Vb extends W.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(zg(t)&&e.isPresent&&!this.props.isPresent&&!1!==this.props.pop){const e=t.offsetParent,n=zg(e)&&e.offsetWidth||0,r=zg(e)&&e.offsetHeight||0,o=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.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 $b({children:e,isPresent:t,anchorX:n,anchorY:r,root:o,pop:a}){var i;const s=W.useId(),l=W.useRef(null),u=W.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=W.useContext(Ib),d=(null==(i=e.props)?void 0:i.ref)??(null==e?void 0:e.ref),f=Fb(l,d);return W.useInsertionEffect(()=>{const{width:e,height:i,top:d,left:f,right:p,bottom:h}=u.current;if(t||!1===a||!l.current||!e||!i)return;const m="left"===n?`left: ${f}`:`right: ${p}`,g="bottom"===r?`bottom: ${h}`:`top: ${d}`;l.current.dataset.motionPopId=s;const v=document.createElement("style");c&&(v.nonce=c);const y=o??document.head;return y.appendChild(v),v.sheet&&v.sheet.insertRule(`\n [data-motion-pop-id="${s}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${i}px !important;\n ${m}px !important;\n ${g}px !important;\n }\n `),()=>{var e;null==(e=l.current)||e.removeAttribute("data-motion-pop-id"),y.contains(v)&&y.removeChild(v)}},[t]),ee.jsx(Vb,{isPresent:t,childRef:l,sizeRef:u,pop:a,children:!1===a?e:W.cloneElement(e,{ref:f})})}const Bb=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:a,mode:i,anchorX:s,anchorY:l,root:u})=>{const c=Df(Ub),d=W.useId();let f=!0,p=W.useMemo(()=>(f=!1,{id:d,initial:t,isPresent:n,custom:o,onExitComplete:e=>{c.set(e,!0);for(const t of c.values())if(!t)return;r&&r()},register:e=>(c.set(e,!1),()=>c.delete(e))}),[n,c,r]);return a&&f&&(p={...p}),W.useMemo(()=>{c.forEach((e,t)=>c.set(t,!1))},[n]),W.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),e=ee.jsx($b,{pop:"popLayout"===i,isPresent:n,anchorX:s,anchorY:l,root:u,children:e}),ee.jsx(Af.Provider,{value:p,children:e})};function Ub(){return new Map}function Wb(e=!0){const t=W.useContext(Af);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,a=W.useId();W.useEffect(()=>{if(e)return o(a)},[e]);const i=W.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,i]:[!0]}const Hb=e=>e.key||"";function Gb(e){const t=[];return W.Children.forEach(e,e=>{W.isValidElement(e)&&t.push(e)}),t}const Yb=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:a="sync",propagate:i=!1,anchorX:s="left",anchorY:l="top",root:u})=>{const[c,d]=Wb(i),f=W.useMemo(()=>Gb(e),[e]),p=i&&!c?[]:f.map(Hb),h=W.useRef(!0),m=W.useRef(f),g=Df(()=>new Map),v=W.useRef(new Set),[y,b]=W.useState(f),[x,w]=W.useState(f);_f(()=>{h.current=!1,m.current=f;for(let e=0;e<x.length;e++){const t=Hb(x[e]);p.includes(t)?(g.delete(t),v.current.delete(t)):!0!==g.get(t)&&g.set(t,!1)}},[x,p.length,p.join("-")]);const k=[];if(f!==y){let e=[...f];for(let t=0;t<x.length;t++){const n=x[t],r=Hb(n);p.includes(r)||(e.splice(t,0,n),k.push(n))}return"wait"===a&&k.length&&(e=k),w(Gb(e)),b(f),null}const{forceRender:S}=W.useContext(Lf);return ee.jsx(ee.Fragment,{children:x.map(e=>{const y=Hb(e),b=!(i&&!c)&&(f===x||p.includes(y));return ee.jsx(Bb,{isPresent:b,initial:!(h.current&&!n)&&void 0,custom:t,presenceAffectsLayout:o,mode:a,root:u,onExitComplete:b?void 0:()=>{if(v.current.has(y))return;if(!g.has(y))return;v.current.add(y),g.set(y,!0);let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(null==S||S(),w(m.current),i&&(null==d||d()),r&&r())},anchorX:s,anchorY:l,children:e},y)})})},Kb=W.createContext({strict:!1}),qb={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Xb=!1;function Qb(){return function(){if(Xb)return;const e={};for(const t in qb)e[t]={isEnabled:e=>qb[t].some(t=>!!e[t])};Pv(e),Xb=!0}(),Cv}const Zb=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Jb(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Zb.has(e)}let ex=e=>!Jb(e);try{"function"==typeof(tx=require("@emotion/is-prop-valid").default)&&(ex=e=>e.startsWith("on")?!Jb(e):tx(e))}catch{}var tx;const nx=W.createContext({});function rx(e){const{initial:t,animate:n}=function(e,t){if(xv(e)){const{initial:t,animate:n}=e;return{initial:!1===t||vv(t)?t:void 0,animate:vv(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,W.useContext(nx));return W.useMemo(()=>({initial:t,animate:n}),[ox(t),ox(n)])}function ox(e){return Array.isArray(e)?e.join(" "):e}const ax=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ix(e,t,n){for(const r in t)dg(t[r])||ny(r,n)||(e[r]=t[r])}function sx(e,t){const n={};return ix(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return W.useMemo(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Xv(n,t,e),Object.assign({},n.vars,n.style)},[t])}(e,t)),n}function lx(e,t){const n={},r=sx(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const ux=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function cx(e,t,n,r){const o=W.useMemo(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return ly(n,t,cy(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){const t={};ix(t,e.style,e),o.style={...t,...o.style}}return o}const dx=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function fx(e){return"string"==typeof e&&!e.includes("-")&&!!(dx.indexOf(e)>-1||/[A-Z]/u.test(e))}function px(e,t,n,{latestValues:r},o,a=!1,i){const s=(i??fx(e)?cx:lx)(t,r,o,e),l=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||dg(e[o])||(ex(o)||!0===n&&Jb(o)||!t&&!Jb(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(t,"string"==typeof e,a),u=e!==W.Fragment?{...l,...s,ref:n}:{},{children:c}=t,d=W.useMemo(()=>dg(c)?c.get():c,[c]);return W.createElement(e,{...u,children:d})}function hx(e,t,n,r){const o={},a=r(e,{});for(const f in a)o[f]=nb(a[f]);let{initial:i,animate:s}=e;const l=xv(e),u=wv(e);t&&u&&!l&&!1!==e.inherit&&(void 0===i&&(i=t.initial),void 0===s&&(s=t.animate));let c=!!n&&!1===n.initial;c=c||!1===i;const d=c?s:i;if(d&&"boolean"!=typeof d&&!gv(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){const r=rg(e,t[n]);if(r){const{transitionEnd:e,transition:t,...n}=r;for(const r in n){let e=n[r];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(o[r]=e)}for(const r in e)o[r]=e[r]}}}return o}const mx=e=>(t,n)=>{const r=W.useContext(nx),o=W.useContext(Af),a=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:hx(n,r,o,e),renderState:t()}}(e,t,r,o);return n?a():Df(a)},gx=mx({scrapeMotionValuesFromProps:ry,createRenderState:ax}),vx=mx({scrapeMotionValuesFromProps:dy,createRenderState:ux}),yx=Symbol.for("motionComponentSymbol");function bx(e,t,n){const r=W.useRef(n);W.useInsertionEffect(()=>{r.current=n});const o=W.useRef(null);return W.useCallback(n=>{var a;n&&(null==(a=e.onMount)||a.call(e,n));const i=r.current;if("function"==typeof i)if(n){const e=i(n);"function"==typeof e&&(o.current=e)}else o.current?(o.current(),o.current=null):i(n);else i&&(i.current=n);t&&(n?t.mount(n):t.unmount())},[t])}const xx=W.createContext({});function wx(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function kx(e,t,n,r,o,a){var i,s;const{visualElement:l}=W.useContext(nx),u=W.useContext(Kb),c=W.useContext(Af),d=W.useContext(Ib),f=d.reducedMotion,p=d.skipAnimations,h=W.useRef(null),m=W.useRef(!1);r=r||u.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:l,props:n,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:f,skipAnimations:p,isSVG:a}),m.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const g=h.current,v=W.useContext(xx);!g||g.projection||!o||"html"!==g.type&&"svg"!==g.type||function(e,t,n,r){const{layoutId:o,layout:a,drag:i,dragConstraints:s,layoutScroll:l,layoutRoot:u,layoutAnchor:c,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Sx(e.parent)),e.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:Boolean(i)||s&&wx(s),visualElement:e,animationType:"string"==typeof a?a:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:u,layoutAnchor:c})}(h.current,n,o,v);const y=W.useRef(!1);W.useInsertionEffect(()=>{g&&y.current&&g.update(n,c)});const b=n[hg],x=W.useRef(Boolean(b)&&"undefined"!=typeof window&&!(null==(i=window.MotionHandoffIsComplete)?void 0:i.call(window,b))&&(null==(s=window.MotionHasOptimisedAnimation)?void 0:s.call(window,b)));return _f(()=>{m.current=!0,g&&(y.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),x.current&&g.animationState&&g.animationState.animateChanges())}),W.useEffect(()=>{g&&(!x.current&&g.animationState&&g.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var e;null==(e=window.MotionHandoffMarkAsComplete)||e.call(window,b)}),x.current=!1),g.enteringChildren=void 0)}),g}function Sx(e){if(e)return!1!==e.options.allowProjection?e.projection:Sx(e.parent)}function Ex(e,{forwardMotionProps:t=!1,type:n}={},r,o){r&&function(e){const t=Qb();for(const n in e)t[n]={...t[n],...e[n]};Pv(t)}(r);const a=n?"svg"===n:fx(e),i=a?vx:gx;function s(n,r){let s;const l={...W.useContext(Ib),...n,layoutId:jx(n)},{isStatic:u}=l,c=rx(n),d=i(n,u);if(!u&&"undefined"!=typeof window){W.useContext(Kb).strict;const t=function(e){const t=Qb(),{drag:n,layout:r}=t;if(!n&&!r)return{};const o={...n,...r};return{MeasureLayout:(null==n?void 0:n.isEnabled(e))||(null==r?void 0:r.isEnabled(e))?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}(l);s=t.MeasureLayout,c.visualElement=kx(e,d,l,o,t.ProjectionNode,a)}return ee.jsxs(nx.Provider,{value:c,children:[s&&c.visualElement?ee.jsx(s,{visualElement:c.visualElement,...l}):null,px(e,n,bx(d,c.visualElement,r),d,u,t,a)]})}s.displayName=`motion.${"string"==typeof e?e:`create(${e.displayName??e.name??""})`}`;const l=W.forwardRef(s);return l[yx]=e,l}function jx({layoutId:e}){const t=W.useContext(Lf).id;return t&&void 0!==e?t+"-"+e:e}function Cx(e,t){if("undefined"==typeof Proxy)return Ex;const n=new Map,r=(n,r)=>Ex(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(o,a)=>"create"===a?r:(n.has(a)||n.set(a,Ex(a,void 0,e,t)),n.get(a))})}const Px=(e,t)=>t.isSVG??fx(e)?new fy(t):new oy(t,{allowProjection:e!==W.Fragment});let Nx=0;const Tx={animation:{Feature:class extends Mv{constructor(e){super(e),e.animationState||(e.animationState=by(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();gv(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null==(e=this.unmountControls)||e.call(this)}}},exit:{Feature:class extends Mv{constructor(){super(...arguments),this.id=Nx++,this.isExitComplete=!1}update(){var e;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&!1===r){if(this.isExitComplete){const{initial:t,custom:n}=this.node.getProps();if("string"==typeof t){const r=og(this.node,t,n);if(r){const{transition:t,transitionEnd:n,...o}=r;for(const r in o)null==(e=this.node.getValue(r))||e.jump(o[r])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Mx(e){return{point:{x:e.pageX,y:e.pageY}}}function Rx(e,t,n,r){return Jy(e,t,(e=>t=>Hg(t)&&e(t,Mx(t)))(n),r)}const Lx=({current:e})=>e?e.ownerDocument.defaultView:null,Dx=(e,t)=>Math.abs(e-t);const _x=new Set(["auto","scroll"]);class Ax{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:o=!1,distanceThreshold:a=3,element:i}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ox(this.lastRawMoveEventInfo,this.transformPagePoint));const e=zx(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=Dx(e.x,t.x),r=Dx(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=bp;this.history.push({...r,timestamp:o});const{onStart:a,onMove:i}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),i&&i(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Ox(t,this.transformPagePoint),vp.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:o}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const a=zx("pointercancel"===e.type?this.lastMoveEventInfo:Ox(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Hg(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;const s=Ox(Mx(e),this.transformPagePoint),{point:l}=s,{timestamp:u}=bp;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=t;c&&c(e,zx(s,this.history)),this.removeListeners=Gf(Rx(this.contextWindow,"pointermove",this.handlePointerMove),Rx(this.contextWindow,"pointerup",this.handlePointerUp),Rx(this.contextWindow,"pointercancel",this.handlePointerUp)),i&&this.startScrollTracking(i)}startScrollTracking(e){let t=e.parentElement;for(;t;){const e=getComputedStyle(t);(_x.has(e.overflowX)||_x.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const t=this.scrollPositions.get(e);if(!t)return;const n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},o=r.x-t.x,a=r.y-t.y;0===o&&0===a||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o,this.lastMoveEventInfo.point.y+=a):this.history.length>0&&(this.history[0].x-=o,this.history[0].y-=a),this.scrollPositions.set(e,r),vp.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),yp(this.updatePoint)}}function Ox(e,t){return t?{point:t(e.point)}:e}function Ix(e,t){return{x:e.x-t.x,y:e.y-t.y}}function zx({point:e},t){return{point:e,delta:Ix(e,Vx(t)),offset:Ix(e,Fx(t)),velocity:$x(t,.1)}}function Fx(e){return e[0]}function Vx(e){return e[e.length-1]}function $x(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Vx(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>qf(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&o.timestamp-r.timestamp>2*qf(t)&&(r=e[1]);const a=Xf(o.timestamp-r.timestamp);if(0===a)return{x:0,y:0};const i={x:(o.x-r.x)/a,y:(o.y-r.y)/a};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function Bx(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Ux(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}const Wx=.35;function Hx(e,t,n){return{min:Gx(e,t),max:Gx(e,n)}}function Gx(e,t){return"number"==typeof e?e:e[t]||0}const Yx=new WeakMap;class Kx{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){const{presenceContext:r}=this.visualElement;if(r&&!1===r.isPresent)return;const{dragSnapToOrigin:o}=this.getProps();this.panSession=new Ax(e,{onSessionStart:e=>{t&&this.snapToCursor(Mx(e).point),this.stopAnimation()},onStart:(e,t)=>{const{drag:n,dragPropagation:r,onDragStart:o}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(a=n)||"y"===a?Vg[a]?null:(Vg[a]=!0,()=>{Vg[a]=!1}):Vg.x||Vg.y?null:(Vg.x=Vg.y=!0,()=>{Vg.x=Vg.y=!1}),!this.openDragLock))return;var a;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Wy(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Up.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];if(r){t=Cy(r)*(parseFloat(t)/100)}}}this.originPoint[e]=t}),o&&vp.update(()=>o(e,t),!1,!0),fg(this.visualElement,"transform");const{animationState:i}=this.visualElement;i&&i.setActive("whileDrag",!0)},onMove:(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:i}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(i),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,i),this.updateAxis("y",t.point,i),this.visualElement.render(),a&&vp.update(()=>a(e,t),!1,!0)},onSessionEnd:(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:o,distanceThreshold:n,contextWindow:Lx(this.visualElement),element:this.visualElement.current})}stop(e,t){const n=e||this.latestPointerEvent,r=t||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!r||!n)return;const{velocity:a}=r;this.startAnimation(a);const{onDragEnd:i}=this.getProps();i&&vp.postRender(()=>i(n,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!Xx(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=function(e,{min:t,max:n},r){return void 0!==t&&e<t?e=r?ih(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?ih(n,e,r.max):Math.min(e,n)),e}(a,this.constraints[e],this.elastic[e])),o.set(a)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null==(e=this.visualElement.projection)?void 0:e.layout,o=this.constraints;t&&wx(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:Bx(e.x,n,o),y:Bx(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=Wx){return!1===e?e=0:!0===e&&(e=Wx),{x:Hx(e,"left","right"),y:Hx(e,"top","bottom")}}(n),o!==this.constraints&&!wx(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Wy(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!wx(e))return!1;const n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(e,t,n){const r=Yv(e,n),{scroll:o}=t;return o&&(Uv(r.x,o.offset.x),Uv(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let a=function(e,t){return{x:Ux(e.x,t.x),y:Ux(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(a));this.hasMutatedConstraints=!!e,e&&(a=Rv(e))}return a}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:i}=this.getProps(),s=this.constraints||{},l=Wy(i=>{if(!Xx(i,t,this.currentDirection))return;let l=s&&s[i]||{};!0!==a&&a!==i||(l={min:0,max:0});const u=r?200:1e6,c=r?40:1e7,d={type:"inertia",velocity:n?e[i]:0,bounceStiffness:u,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(i,d)});return Promise.all(l).then(i)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return fg(this.visualElement,e),n.start(tg(e,n,0,t,this.visualElement,!1))}stopAnimation(){Wy(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),r=n[t];return r||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Wy(t=>{const{drag:n}=this.getProps();if(!Xx(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:a}=r.layout.layoutBox[t],i=o.get()||0;o.set(e[t]-ih(n,a,.5)+i)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!wx(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Wy(e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=Cy(e),o=Cy(t);return o>r?n=Yf(t.min,t.max-r,e.min):r>o&&(n=Yf(e.min,e.max-o,t.min)),zf(0,1,n)}({min:n,max:n},this.constraints[e])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Wy(t=>{if(!Xx(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:a}=this.constraints[t];n.set(ih(o,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Yx.set(this.visualElement,this);const e=this.visualElement.current,t=Rx(e,"pointerdown",t=>{const{drag:n,dragListener:r=!0}=this.getProps(),o=t.target,a=o!==e&&function(e){return Yg.has(e.tagName)||!0===e.isContentEditable}(o);n&&r&&!a&&this.start(t)});let n;const r=()=>{const{dragConstraints:t}=this.getProps();wx(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(e,t,n){const r=fv(e,qx(n)),o=fv(t,qx(n));return()=>{r(),o()}}(e,t.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,a=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),vp.read(r);const i=Jy(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Wy(t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())});return()=>{i(),t(),a(),s&&s(),n&&n()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:a=Wx,dragMomentum:i=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:a,dragMomentum:i}}}function qx(e){let t=!0;return()=>{t?t=!1:e()}}function Xx(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const Qx=e=>(t,n)=>{e&&vp.update(()=>e(t,n),!1,!0)};let Zx=!1;class Jx extends W.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),Zx&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ob.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,{projection:a}=n;return a?(a.isPresent=o,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Zx=!0,r||e.layoutDependency!==t||void 0===t||e.isPresent!==o?a.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?a.promote():a.relegate()||vp.postRender(()=>{const e=a.getStack();e&&e.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Fg.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Zx=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function ew(e){const[t,n]=Wb(),r=W.useContext(Lf);return ee.jsx(Jx,{...e,layoutGroup:r,switchLayoutGroup:W.useContext(xx),isPresent:t,safeToRemove:n})}const tw={pan:{Feature:class extends Mv{constructor(){super(...arguments),this.removePointerDownListener=Wf}onPointerDown(e){this.session=new Ax(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Lx(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Qx(e),onStart:Qx(t),onMove:Qx(n),onEnd:(e,t)=>{delete this.session,r&&vp.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Rx(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends Mv{constructor(e){super(e),this.removeGroupControls=Wf,this.removeListeners=Wf,this.controls=new Kx(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Wf}update(){const{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:Ob,MeasureLayout:ew}};function nw(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);const o=r["onHover"+n];o&&vp.postRender(()=>o(t,Mx(t)))}function rw(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap","Start"===n);const o=r["onTap"+("End"===n?"":n)];o&&vp.postRender(()=>o(t,Mx(t)))}const ow=new WeakMap,aw=new WeakMap,iw=e=>{const t=ow.get(e.target);t&&t(e)},sw=e=>{e.forEach(iw)};function lw(e,t,n){const r=function({root:e,...t}){const n=e||document;aw.has(n)||aw.set(n,{});const r=aw.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(sw,{root:e,...t})),r[o]}(t);return ow.set(e,n),r.observe(e),()=>{ow.delete(e),r.unobserve(e)}}const uw={some:0,all:1};const cw={inView:{Feature:class extends Mv{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var e;null==(e=this.stopObserver)||e.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:a}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:"number"==typeof o?o:uw[o]};this.stopObserver=lw(this.node.current,i,e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,a&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),o=t?n:r;o&&o(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){var e;null==(e=this.stopObserver)||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends Mv{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Jg(e,(e,t)=>(rw(this.node,t,"Start"),(e,{success:t})=>rw(this.node,e,t?"End":"Cancel")),{useGlobalTarget:t,stopPropagation:!1===(null==n?void 0:n.tap)})}unmount(){}}},focus:{Feature:class extends Mv{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(vT){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Gf(Jy(this.node.current,"focus",()=>this.onFocus()),Jy(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Mv{mount(){const{current:e}=this.node;e&&(this.unmount=Ug(e,(e,t)=>(nw(this.node,t,"Start"),e=>nw(this.node,e,"End"))))}unmount(){}}}},dw=Cx({...Tx,...cw,...tw,...{layout:{ProjectionNode:Ob,MeasureLayout:ew}}},Px);function fw(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=fw(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function pw(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=fw(e))&&(r&&(r+=" "),r+=t);return r}const hw=e=>{const t=yw(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),mw(n,t)||vw(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},mw=(e,t)=>{var n;if(0===e.length)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),a=o?mw(e.slice(1),o):void 0;if(a)return a;if(0===t.validators.length)return;const i=e.join("-");return null==(n=t.validators.find(({validator:e})=>e(i)))?void 0:n.classGroupId},gw=/^\[(.+)\]$/,vw=e=>{if(gw.test(e)){const t=gw.exec(e)[1],n=null==t?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},yw=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return kw(Object.entries(e.classGroups),n).forEach(([e,n])=>{bw(n,r,e,t)}),r},bw=(e,t,n,r)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:xw(t,e)).classGroupId=n)}if("function"==typeof e)return ww(e)?void bw(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach(([e,o])=>{bw(o,xw(t,e),n,r)})})},xw=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},ww=e=>e.isThemeGetter,kw=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,Sw=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(o(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):o(e,t)}}},Ew=e=>{const{separator:t,experimentalParseClassName:n}=e,r=1===t.length,o=t[0],a=t.length,i=e=>{const n=[];let i,s=0,l=0;for(let d=0;d<e.length;d++){let u=e[d];if(0===s){if(u===o&&(r||e.slice(d,d+a)===t)){n.push(e.slice(l,d)),l=d+a;continue}if("/"===u){i=d;continue}}"["===u?s++:"]"===u&&s--}const u=0===n.length?e:e.substring(l),c=u.startsWith("!");return{modifiers:n,hasImportantModifier:c,baseClassName:c?u.substring(1):u,maybePostfixModifierPosition:i&&i>l?i-l:void 0}};return n?e=>n({className:e,parseClassName:i}):i},jw=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(e=>{"["===e[0]?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},Cw=/\s+/;function Pw(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=Nw(e))&&(r&&(r+=" "),r+=t);return r}const Nw=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Nw(e[r]))&&(n&&(n+=" "),n+=t);return n};function Tw(e,...t){let n,r,o,a=function(s){const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:Sw(e.cacheSize),parseClassName:Ew(e),...hw(e)}))(l),r=n.cache.get,o=n.cache.set,a=i,i(s)};function i(e){const t=r(e);if(t)return t;const a=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,a=[],i=e.trim().split(Cw);let s="";for(let l=i.length-1;l>=0;l-=1){const e=i[l],{modifiers:t,hasImportantModifier:u,baseClassName:c,maybePostfixModifierPosition:d}=n(e);let f=Boolean(d),p=r(f?c.substring(0,d):c);if(!p){if(!f){s=e+(s.length>0?" "+s:s);continue}if(p=r(c),!p){s=e+(s.length>0?" "+s:s);continue}f=!1}const h=jw(t).join(":"),m=u?h+"!":h,g=m+p;if(a.includes(g))continue;a.push(g);const v=o(p,f);for(let n=0;n<v.length;++n){const e=v[n];a.push(m+e)}s=e+(s.length>0?" "+s:s)}return s})(e,n);return o(e,a),a}return function(){return a(Pw.apply(null,arguments))}}const Mw=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},Rw=/^\[(?:([a-z-]+):)?(.+)\]$/i,Lw=/^\d+\/\d+$/,Dw=new Set(["px","full","screen"]),_w=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Aw=/\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$/,Ow=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Iw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fw=e=>$w(e)||Dw.has(e)||Lw.test(e),Vw=e=>ek(e,"length",tk),$w=e=>Boolean(e)&&!Number.isNaN(Number(e)),Bw=e=>ek(e,"number",$w),Uw=e=>Boolean(e)&&Number.isInteger(Number(e)),Ww=e=>e.endsWith("%")&&$w(e.slice(0,-1)),Hw=e=>Rw.test(e),Gw=e=>_w.test(e),Yw=new Set(["length","size","percentage"]),Kw=e=>ek(e,Yw,nk),qw=e=>ek(e,"position",nk),Xw=new Set(["image","url"]),Qw=e=>ek(e,Xw,ok),Zw=e=>ek(e,"",rk),Jw=()=>!0,ek=(e,t,n)=>{const r=Rw.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},tk=e=>Aw.test(e)&&!Ow.test(e),nk=()=>!1,rk=e=>Iw.test(e),ok=e=>zw.test(e),ak=Tw(()=>{const e=Mw("colors"),t=Mw("spacing"),n=Mw("blur"),r=Mw("brightness"),o=Mw("borderColor"),a=Mw("borderRadius"),i=Mw("borderSpacing"),s=Mw("borderWidth"),l=Mw("contrast"),u=Mw("grayscale"),c=Mw("hueRotate"),d=Mw("invert"),f=Mw("gap"),p=Mw("gradientColorStops"),h=Mw("gradientColorStopPositions"),m=Mw("inset"),g=Mw("margin"),v=Mw("opacity"),y=Mw("padding"),b=Mw("saturate"),x=Mw("scale"),w=Mw("sepia"),k=Mw("skew"),S=Mw("space"),E=Mw("translate"),j=()=>["auto",Hw,t],C=()=>[Hw,t],P=()=>["",Fw,Vw],N=()=>["auto",$w,Hw],T=()=>["","0",Hw],M=()=>[$w,Hw];return{cacheSize:500,separator:":",theme:{colors:[Jw],spacing:[Fw,Vw],blur:["none","",Gw,Hw],brightness:M(),borderColor:[e],borderRadius:["none","","full",Gw,Hw],borderSpacing:C(),borderWidth:P(),contrast:M(),grayscale:T(),hueRotate:M(),invert:T(),gap:C(),gradientColorStops:[e],gradientColorStopPositions:[Ww,Vw],inset:j(),margin:j(),opacity:M(),padding:C(),saturate:M(),scale:M(),sepia:T(),skew:M(),space:C(),translate:C()},classGroups:{aspect:[{aspect:["auto","square","video",Hw]}],container:["container"],columns:[{columns:[Gw]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"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"],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:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",Hw]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Uw,Hw]}],basis:[{basis:j()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Hw]}],grow:[{grow:T()}],shrink:[{shrink:T()}],order:[{order:["first","last","none",Uw,Hw]}],"grid-cols":[{"grid-cols":[Jw]}],"col-start-end":[{col:["auto",{span:["full",Uw,Hw]},Hw]}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":[Jw]}],"row-start-end":[{row:["auto",{span:[Uw,Hw]},Hw]}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Hw]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Hw]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Hw,t]}],"min-w":[{"min-w":[Hw,t,"min","max","fit"]}],"max-w":[{"max-w":[Hw,t,"none","full","min","max","fit","prose",{screen:[Gw]},Gw]}],h:[{h:[Hw,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Hw,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Hw,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Hw,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Gw,Vw]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Bw]}],"font-family":[{font:[Jw]}],"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:["tighter","tight","normal","wide","wider","widest",Hw]}],"line-clamp":[{"line-clamp":["none",$w,Bw]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Fw,Hw]}],"list-image":[{"list-image":["none",Hw]}],"list-style-type":[{list:["none","disc","decimal",Hw]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Fw,Vw]}],"underline-offset":[{"underline-offset":["auto",Fw,Hw]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Hw]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Hw]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",qw]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Kw]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Qw]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[Fw,Hw]}],"outline-w":[{outline:[Fw,Vw]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Fw,Vw]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Gw,Zw]}],"shadow-color":[{shadow:[Jw]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Gw,Hw]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Hw]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",Hw]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",Hw]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Uw,Hw]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Hw]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",Hw]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"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",Hw]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Fw,Vw,Bw]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-s","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}});function ik(...e){return ak(pw(e))}const sk=W.forwardRef(({className:e,...t},n)=>ee.jsx("div",{ref:n,className:ik("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));sk.displayName="Card";const lk=W.forwardRef(({className:e,...t},n)=>ee.jsx("div",{ref:n,className:ik("flex flex-col space-y-1.5 p-6",e),...t}));lk.displayName="CardHeader";const uk=W.forwardRef(({className:e,...t},n)=>ee.jsx("h3",{ref:n,className:ik("text-2xl font-semibold leading-none tracking-tight",e),...t}));uk.displayName="CardTitle";const ck=W.forwardRef(({className:e,...t},n)=>ee.jsx("p",{ref:n,className:ik("text-sm text-muted-foreground",e),...t}));ck.displayName="CardDescription";const dk=W.forwardRef(({className:e,...t},n)=>ee.jsx("div",{ref:n,className:ik("p-6 pt-0",e),...t}));dk.displayName="CardContent";const fk=W.forwardRef(({className:e,...t},n)=>ee.jsx("div",{ref:n,className:ik("flex items-center p-6 pt-0",e),...t}));function pk(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function hk(...e){return t=>{let n=!1;const r=e.map(e=>{const r=pk(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():pk(e[t],null)}}}}function mk(...e){return W.useCallback(hk(...e),e)}fk.displayName="CardFooter";var gk=Symbol.for("react.lazy"),vk=G[" use ".trim().toString()];function yk(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===gk&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}function bk(e){const t=wk(e),n=W.forwardRef((e,n)=>{let{children:r,...o}=e;yk(r)&&"function"==typeof vk&&(r=vk(r._payload));const a=W.Children.toArray(r),i=a.find(Sk);if(i){const e=i.props.children,r=a.map(t=>t===i?W.Children.count(e)>1?W.Children.only(null):W.isValidElement(e)?e.props.children:null:t);return ee.jsx(t,{...o,ref:n,children:W.isValidElement(e)?W.cloneElement(e,void 0,r):null})}return ee.jsx(t,{...o,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var xk=bk("Slot");function wk(e){const t=W.forwardRef((e,t)=>{let{children:n,...r}=e;if(yk(n)&&"function"==typeof vk&&(n=vk(n._payload)),W.isValidElement(n)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==W.Fragment&&(o.ref=t?hk(t,e):e),W.cloneElement(n,o)}return W.Children.count(n)>1?W.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kk=Symbol("radix.slottable");function Sk(e){return W.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===kk}const Ek=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,jk=pw,Ck=(e,t)=>n=>{var r;if(null==(null==t?void 0:t.variants))return jk(e,null==n?void 0:n.class,null==n?void 0:n.className);const{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(e=>{const t=null==n?void 0:n[e],r=null==a?void 0:a[e];if(null===t)return null;const i=Ek(t)||Ek(r);return o[e][i]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{}),l=null==t||null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...o}=t;return Object.entries(o).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...a,...s}[t]):{...a,...s}[t]===n})?[...e,n,r]:e},[]);return jk(e,i,l,null==n?void 0:n.class,null==n?void 0:n.className)},Pk=Ck("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Nk=W.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},a)=>{const i=r?xk:"button";return ee.jsx(i,{className:ik(Pk({variant:t,size:n,className:e})),ref:a,...o})});Nk.displayName="Button";const Tk=W.forwardRef(({className:e,type:t,...n},r)=>ee.jsx("input",{type:t,className:ik("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Tk.displayName="Input";var Mk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=bk(`Primitive.${t}`),r=W.forwardRef((e,r)=>{const{asChild:o,...a}=e,i=o?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),ee.jsx(i,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Rk=W.forwardRef((e,t)=>ee.jsx(Mk.label,{...e,ref:t,onMouseDown:t=>{var n;t.target.closest("button, input, select, textarea")||(null==(n=e.onMouseDown)||n.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Rk.displayName="Label";var Lk=Rk;const Dk=Ck("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),_k=W.forwardRef(({className:e,...t},n)=>ee.jsx(Lk,{ref:n,className:ik(Dk(),e),...t}));_k.displayName=Lk.displayName;const Ak=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e))},i=t=e(r,o,a);return a},Ok=e=>e;const Ik=e=>{const t=(e=>e?Ak(e):Ak)(e),n=e=>function(e,t=Ok){const n=H.useSyncExternalStore(e.subscribe,H.useCallback(()=>t(e.getState()),[e,t]),H.useCallback(()=>t(e.getInitialState()),[e,t]));return H.useDebugValue(n),n}(t,e);return Object.assign(n,t),n},zk=e=>e?Ik(e):Ik,Fk={token:"cc_web_token",theme:"cc_web_theme",viewMode:e=>`cc_viewmode_${e}`,panelFileTree:"cc_panel_filetree",panelShortcuts:"cc_panel_shortcuts",fileZoom:"cc_file_zoom",skillhubAuthor:"ccweb_skillhub_author",projectOrder:"cc_project_order",pomodoroConfig:"cc_pomodoro_config",panelLeftWidth:"cc_panel_left_width",panelRightWidth:"cc_panel_right_width",terminalDraft:e=>`cc_terminal_draft_${e}`,usedSkills:"cc_used_skills",projectModel:e=>`cc_project_model_${e}`,draftState:e=>`cc_draft_state_${e}`,usageMonitorTool:"cc_usage_monitor_tool",monitorMode:"cc_monitor_mode",chatOverlay:e=>`cc_chat_overlay_${e}`,chatOverlayPos:e=>`cc_chat_overlay_pos_${e}`};function Vk(e,t,n){try{const r=localStorage.getItem(e);return null===r?t:n?JSON.parse(r):r}catch{return t}}function $k(e,t,n){try{localStorage.setItem(e,n?JSON.stringify(t):String(t))}catch{}}function Bk(e){try{localStorage.removeItem(e)}catch{}}function Uk(e,t,n){const r=(null==n?void 0:n.parse)??!1,[o,a]=W.useState(()=>{try{const n=localStorage.getItem(e);return null===n?t:r?JSON.parse(n):n}catch{return t}});return[o,W.useCallback(t=>{a(n=>{const o="function"==typeof t?t(n):t;try{localStorage.setItem(e,r?JSON.stringify(o):String(o))}catch{}return o})},[e,r])]}const Wk=zk(e=>({token:localStorage.getItem(Fk.token),setToken:t=>{$k(Fk.token,t),e({token:t})},clearToken:()=>{Bk(Fk.token),e({token:null})}}));let Hk=null;const Gk=zk((e,t)=>({projects:[],loading:!1,error:null,hasFetched:!1,fetchProjects:async()=>{if(!t().loading){e({loading:!0,error:null});try{const t=await async function(){if(!Hk){const e=await fd(()=>Promise.resolve().then(()=>RE),void 0);Hk=e.getProjects}return Hk()}();e({projects:t,hasFetched:!0})}catch(n){e({error:n instanceof Error?n.message:"Failed to load projects"})}finally{e({loading:!1})}}},addProject:t=>e(e=>({projects:[...e.projects,t]})),updateProject:t=>e(e=>({projects:e.projects.map(e=>e.id===t.id?t:e)})),removeProject:t=>e(e=>({projects:e.projects.filter(e=>e.id!==t)})),setProjects:t=>e({projects:t})})),Yk={filePreviewPath:null,sessionId:null,shortcutEditorOpen:!1,shortcutEditingId:null,shareHubOpen:!1,shareHubLabel:"",shareHubCommand:""},Kk=zk((e,t)=>({entries:{},get:e=>t().entries[e]??Yk,setFilePreviewPath:(t,n)=>e(e=>({entries:{...e.entries,[t]:{...e.entries[t]??Yk,filePreviewPath:n}}})),setSessionId:(t,n)=>e(e=>({entries:{...e.entries,[t]:{...e.entries[t]??Yk,sessionId:n}}})),setShortcutEditor:(t,n,r=null)=>e(e=>({entries:{...e.entries,[t]:{...e.entries[t]??Yk,shortcutEditorOpen:n,shortcutEditingId:n?r:null}}})),setShareHub:(t,n,r="",o="")=>e(e=>({entries:{...e.entries,[t]:{...e.entries[t]??Yk,shareHubOpen:n,shareHubLabel:n?r:"",shareHubCommand:n?o:""}}}))}));function qk(){return Wk.getState().token}function Xk(){Wk.getState().clearToken()}async function Qk(e,t,n,r=!0,o){const a={"Content-Type":"application/json"};if(r){const e=qk();e&&(a.Authorization=`Bearer ${e}`)}const i=await fetch(`${t}`,{method:e,headers:a,body:void 0!==n?JSON.stringify(n):void 0,signal:o});if(401===i.status)throw Xk(),"/login"!==window.location.pathname&&(window.location.href="/login"),new Error("Unauthorized");if(!i.ok){let e=`HTTP ${i.status}`;try{const t=await i.json();t.error&&(e=t.error)}catch{}throw new Error(e)}return i.json()}async function Zk(e,t){return(await Qk("POST","/api/auth/login",{username:e,password:t},!1)).token}function Jk(){const e=window.location.hostname;return"localhost"===e||"127.0.0.1"===e||"::1"===e}async function eS(){return(await Qk("GET","/api/auth/local-token",void 0,!1)).token}async function tS(){return Qk("GET","/api/projects/users")}async function nS(e,t){return Qk("PUT",`/api/projects/${e}/shares`,{shares:t})}async function rS(e){return Qk("POST","/api/projects",e)}async function oS(e){return Qk("POST","/api/projects/open",{folderPath:e})}async function aS(e){await Qk("DELETE",`/api/projects/${e}`)}async function iS(e){return Qk("PATCH",`/api/projects/${e}/start`)}async function sS(e){return Qk("PATCH",`/api/projects/${e}/archive`)}async function lS(e){return Qk("PATCH",`/api/projects/${e}/unarchive`)}async function uS(e,t){return Qk("GET",`/api/projects/${e}/sessions`,void 0,!0,t)}async function cS(e,t,n){return Qk("GET",`/api/projects/${e}/sessions/${t}`,void 0,!0,n)}async function dS(){return Qk("GET","/api/shortcuts")}async function fS(e){return Qk("POST","/api/shortcuts",e)}async function pS(e,t){return Qk("PUT",`/api/shortcuts/${e}`,t)}async function hS(e){await Qk("DELETE",`/api/shortcuts/${e}`)}async function mS(e){return Qk("GET",`/api/shortcuts/project/${e}`)}async function gS(e,t){return Qk("POST",`/api/shortcuts/project/${e}`,t)}async function vS(e,t,n){return Qk("PUT",`/api/shortcuts/project/${e}/${t}`,n)}async function yS(e,t){await Qk("DELETE",`/api/shortcuts/project/${e}/${t}`)}async function bS(){return Qk("GET","/api/skillhub/skills")}async function xS(e){await Qk("POST","/api/skillhub/submit",e)}async function wS(e){return Qk("POST",`/api/skillhub/download/${e}`)}async function kS(e="claude"){return Qk("GET",`/api/projects/usage?tool=${encodeURIComponent(e)}`)}async function SS(e="claude"){return Qk("GET",`/api/projects/usage?refresh=true&tool=${encodeURIComponent(e)}`)}async function ES(e){return Qk("GET",`/api/filesystem${e?`?path=${encodeURIComponent(e)}`:""}`)}function jS(e){return`/api/filesystem/raw?path=${encodeURIComponent(e)}`}async function CS(e,t){const n=new FormData;n.append("path",e);for(const i of t)n.append("files",i);const r={},o=qk();o&&(r.Authorization=`Bearer ${o}`);const a=await fetch("/api/filesystem/upload",{method:"POST",headers:r,body:n});if(!a.ok){const e=await a.json().catch(()=>({}));throw new Error(e.error||`Upload failed: ${a.status}`)}return a.json()}async function PS(e,t){return Qk("POST","/api/filesystem/mkdir",{path:e,name:t})}async function NS(e){return Qk("GET",`/api/filesystem/file?path=${encodeURIComponent(e)}`)}async function TS(e,t){return Qk("PUT","/api/filesystem/file",{path:e,content:t})}async function MS(e){return Qk("DELETE",`/api/filesystem?path=${encodeURIComponent(e)}`)}async function RS(){return Qk("GET","/api/update/check-version")}async function LS(){return Qk("POST","/api/update/execute")}async function DS(){return Qk("GET","/api/update/status")}async function _S(){return Qk("GET","/api/backup/built-in-oauth")}async function AS(){return Qk("GET","/api/backup/providers")}async function OS(e){return Qk("POST","/api/backup/providers",e)}async function IS(e){await Qk("DELETE",`/api/backup/providers/${e}`)}async function zS(e){return Qk("GET",`/api/backup/auth/${e}/url`)}async function FS(e){return Qk("POST",`/api/backup/run/${e}`)}async function VS(){return Qk("GET","/api/backup/schedule")}async function $S(e){return Qk("PUT","/api/backup/schedule",e)}async function BS(){return Qk("GET","/api/backup/excludes")}async function US(e){return Qk("PUT","/api/backup/excludes",{patterns:e})}async function WS(){return Qk("GET","/api/backup/history")}async function HS(){return Qk("GET","/api/notify/config")}async function GS(e){return Qk("PUT","/api/notify/config",e)}async function YS(e){return Qk("GET",`/api/projects/${e}/git/status`)}async function KS(e,t){return Qk("GET",`/api/projects/${e}/git/diff${t?`?file=${encodeURIComponent(t)}`:""}`)}async function qS(e,t){await Qk("POST",`/api/projects/${e}/git/add`,{files:t})}async function XS(e,t){await Qk("POST",`/api/projects/${e}/git/commit`,{message:t})}async function QS(e,t=50,n=0){return Qk("GET",`/api/projects/${e}/git/log?limit=${t}&skip=${n}`)}async function ZS(e,t){return Qk("PATCH",`/api/projects/${e}/rename`,{name:t})}async function JS(e,t=100){return Qk("GET",`/api/information/${e}/conversations?limit=${t}`)}async function eE(e,t,n,r="user"){const o=new URLSearchParams({source:r});return n&&o.set("version",n),Qk("GET",`/api/information/${e}/conversations/${t}?${o}`)}async function tE(e,t){await Qk("DELETE",`/api/information/${e}/conversations/${t}`)}async function nE(e,t=!1){return Qk("POST",`/api/information/${e}/sync${t?"?force=true":""}`)}async function rE(e,t){return Qk("POST",`/api/information/${e}/conversations/${t}/condense`)}async function oE(e,t){return Qk("POST",`/api/information/${e}/conversations/${t}/reorganize`)}async function aE(e){return Qk("GET",`/api/projects/${e}/disk-size`)}async function iE(e,t){return Qk("POST",`/api/sessions/${e}/share`,{expiryDays:t})}async function sE(e){const t=await fetch(`/api/share/${e}`);if(!t.ok){let e=`HTTP ${t.status}`;try{const n=await t.json();n.error&&(e=n.error)}catch{}throw new Error(e)}return t.json()}async function lE(e){return Qk("GET",`/api/tool/model?tool=${encodeURIComponent(e)}`)}async function uE(e){return Qk("GET",`/api/tool/models?tool=${encodeURIComponent(e)}`)}async function cE(e){return Qk("GET",`/api/tool/skills?tool=${encodeURIComponent(e)}`)}async function dE(){return Qk("GET","/api/plugins")}async function fE(e){return Qk("POST","/api/plugins/install",{downloadUrl:e})}async function pE(e){await Qk("DELETE",`/api/plugins/${e}`)}async function hE(e,t){return Qk("PUT",`/api/plugins/${e}/config`,t)}async function mE(e,t){await Qk("PUT",`/api/plugins/${e}/enabled`,{enabled:t})}async function gE(e){return Qk("GET",`/api/projects/${e}/plan/status`)}async function vE(e){return Qk("POST",`/api/projects/${e}/plan/init`)}async function yE(e){return Qk("POST",`/api/projects/${e}/plan/check`)}async function bE(e){return Qk("POST",`/api/projects/${e}/plan/start`)}async function xE(e){return Qk("POST",`/api/projects/${e}/plan/pause`)}async function wE(e){return Qk("POST",`/api/projects/${e}/plan/resume`)}async function kE(e){return Qk("POST",`/api/projects/${e}/plan/stop`)}async function SE(e){return Qk("GET",`/api/projects/${e}/plan/tree`)}async function EE(e){return Qk("GET",`/api/memory-pool/${e}/status`)}async function jE(e){return Qk("POST",`/api/memory-pool/${e}/init`)}async function CE(e,t){return Qk("GET",`/api/memory-pool/${e}/index`,void 0,!0,t)}async function PE(e){return Qk("POST",`/api/memory-pool/${e}/upgrade`)}async function NE(e,t){return Qk("PUT",`/api/memory-pool/${e}/surface-width`,{surface_width:t})}async function TE(){return Qk("GET","/api/memory-pool/global/index")}async function ME(){return Qk("POST","/api/memory-pool/global/sync")}const RE=Object.freeze(Object.defineProperty({__proto__:null,addBackupProvider:OS,archiveProject:sS,browseFilesystem:ES,checkPlanSyntax:yE,checkRunningProjects:async function(){return Qk("GET","/api/update/check-running")},checkVersion:RS,clearToken:Xk,condenseConversation_api:rE,createFolder:PS,createGlobalShortcut:fS,createProject:rS,createProjectShortcut:gS,deleteBackupProvider:IS,deleteConversation:tE,deleteGlobalShortcut:hS,deletePath:MS,deleteProject:aS,deleteProjectShortcut:yS,downloadSkillFromHub:wS,executeUpdate:LS,getAllUsers:tS,getBackupAuthUrl:zS,getBackupExcludes:BS,getBackupHistory:WS,getBackupProviders:AS,getBackupSchedule:VS,getBuiltInOAuthTypes:_S,getClaudeModel:async function(){return Qk("GET","/api/claude/model")},getClaudeSkills:async function(){return Qk("GET","/api/claude/skills")},getConversationDetail:eE,getConversations:JS,getGitDiff:KS,getGitLog:QS,getGitStatus:YS,getGlobalPoolBall:async function(e){return Qk("GET",`/api/memory-pool/global/ball/${e}`)},getGlobalPoolIndex:TE,getGlobalPoolStatus:async function(){return Qk("GET","/api/memory-pool/global/status")},getGlobalShortcuts:dS,getInstalledPlugins:dE,getLastMessages:async function(e,t=10){return Qk("GET",`/api/projects/${e}/last-messages?limit=${t}`)},getLocalToken:eS,getMemoryPoolBall:async function(e,t){return Qk("GET",`/api/memory-pool/${e}/ball/${t}`)},getMemoryPoolIndex:CE,getMemoryPoolSnapshot:async function(e){return Qk("GET",`/api/memory-pool/${e}/snapshot`)},getMemoryPoolStatus:EE,getNotifyConfig:HS,getPlanNodes:async function(e){return Qk("GET",`/api/projects/${e}/plan/nodes`)},getPlanStatus:gE,getPlanTree:SE,getProjectDiskSize:aE,getProjectShortcuts:mS,getProjectTodos:async function(e){return Qk("GET",`/api/projects/${e}/todos`)},getProjects:async function(){return Qk("GET","/api/projects")},getProjectsActivity:async function(e){return Qk("GET","/api/projects/activity",void 0,!0,e)},getRawFileUrl:jS,getSession:cS,getSessions:uS,getSharedSession:sE,getSkillHubSkills:bS,getToken:qk,getToolModel:lE,getToolModels:uE,getToolSkills:cE,getUpdateStatus:DS,getUsage:kS,getWorkspace:async function(){return(await Qk("GET","/api/projects/workspace")).workspace},gitAdd:qS,gitCommit:XS,initMemoryPool:jE,initPlanControl:vE,installPlugin:fE,isLocalAccess:Jk,login:Zk,openProject:oS,pausePlan:xE,prepareForUpdate:async function(){return Qk("POST","/api/update/prepare")},readFile:NS,refreshUsage:SS,renameProject:ZS,reorganizeConversation_api:oE,resumePlan:wE,searchSessions:async function(e){return Qk("GET",`/api/projects/sessions/search?q=${encodeURIComponent(e)}`)},setPluginEnabled:mE,setToken:function(e){var t;t=e,Wk.getState().setToken(t)},shareSession:iE,startPlan:bE,startProject:iS,stopPlan:kE,stopProject:async function(e){return Qk("PATCH",`/api/projects/${e}/stop`)},submitSkillToHub:xS,syncConversations:nE,syncGlobalPool:ME,triggerBackup:FS,unarchiveProject:lS,uninstallPlugin:pE,updateBackupExcludes:US,updateBackupSchedule:$S,updateGlobalShortcut:pS,updateNotifyConfig:GS,updatePlugin:async function(e,t){return Qk("POST",`/api/plugins/${e}/update`,{downloadUrl:t})},updatePluginConfig:hE,updateProjectShares:nS,updateProjectShortcut:vS,updateProjectTags:async function(e,t){return Qk("PATCH",`/api/projects/${e}/tags`,{tags:t})},updateSurfaceWidth:NE,upgradeMemoryPool:PE,uploadFiles:CS,writeFile:TS},Symbol.toStringTag,{value:"Module"}));function LE(){const e=cf(),t=Wk(e=>e.setToken),[n,r]=W.useState(""),[o,a]=W.useState(""),[i,s]=W.useState(null),[l,u]=W.useState(!1);W.useEffect(()=>{if(!Jk())return;let n=!1;return(async()=>{try{const r=await eS();n||(t(r),e("/",{replace:!0}))}catch{}})(),()=>{n=!0}},[e,t]);return ee.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:ee.jsx(dw.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4,ease:"easeOut"},className:"w-full max-w-sm",children:ee.jsxs(sk,{children:[ee.jsxs(lk,{className:"text-center",children:[ee.jsx(uk,{className:"text-2xl",children:"CC Web"}),ee.jsx(ck,{children:Jk()?"Connecting locally...":"Sign in to manage your Claude projects"})]}),ee.jsxs("form",{onSubmit:r=>{(async r=>{r.preventDefault(),s(null),u(!0);try{const r=await Zk(n,o);t(r),e("/")}catch(a){s(a instanceof Error?a.message:"Login failed")}finally{u(!1)}})(r)},children:[ee.jsxs(dk,{className:"space-y-4",children:[ee.jsxs("div",{className:"space-y-2",children:[ee.jsx(_k,{htmlFor:"username",children:"Username"}),ee.jsx(Tk,{id:"username",type:"text",autoComplete:"username",value:n,onChange:e=>r(e.target.value),required:!0,autoFocus:!0})]}),ee.jsxs("div",{className:"space-y-2",children:[ee.jsx(_k,{htmlFor:"password",children:"Password"}),ee.jsx(Tk,{id:"password",type:"password",autoComplete:"current-password",value:o,onChange:e=>a(e.target.value),required:!0})]}),ee.jsx(Yb,{children:i&&ee.jsx(dw.p,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},exit:{opacity:0,x:-8},transition:{duration:.2},className:"text-sm text-destructive",children:i})})]}),ee.jsx(fk,{children:ee.jsx(dw.div,{className:"w-full",whileTap:{scale:.98},children:ee.jsx(Nk,{type:"submit",className:"w-full",disabled:l,children:l?"Signing in...":"Sign In"})})})]})]})})})}
64
64
  /**
65
65
  * @license lucide-react v0.309.0 - ISC
66
66
  *
67
67
  * This source code is licensed under the ISC license.
68
68
  * See the LICENSE file in the root directory of this source tree.
69
- */var AE={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"};
69
+ */var DE={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"};
70
70
  /**
71
71
  * @license lucide-react v0.309.0 - ISC
72
72
  *
73
73
  * This source code is licensed under the ISC license.
74
74
  * See the LICENSE file in the root directory of this source tree.
75
- */const OE=(e,t)=>{const n=W.forwardRef(({color:n="currentColor",size:r=24,strokeWidth:o=2,absoluteStrokeWidth:a,className:i="",children:s,...l},u)=>{return W.createElement("svg",{ref:u,...AE,width:r,height:r,stroke:n,strokeWidth:a?24*Number(o)/Number(r):o,className:["lucide",`lucide-${c=e,c.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,i].join(" "),...l},[...t.map(([e,t])=>W.createElement(e,t)),...Array.isArray(s)?s:[s]]);var c});return n.displayName=`${e}`,n},IE=OE("AlertCircle",[["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"}]]),zE=OE("ArchiveRestore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]),FE=OE("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"}]]),VE=OE("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),$E=OE("Brain",[["path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z",key:"1mhkh5"}],["path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z",key:"1d6s00"}]]),BE=OE("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),UE=OE("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),WE=OE("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),HE=OE("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]),GE=OE("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),YE=OE("File",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}]]),KE=OE("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),qE=OE("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["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"}]]),XE=OE("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"}]]),QE=OE("GitMerge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]),ZE=OE("GripHorizontal",[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]),JE=OE("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),ej=OE("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]),tj=OE("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),nj=OE("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),rj=OE("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]),oj=OE("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]),aj=OE("Minimize",[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]),ij=OE("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),sj=OE("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),lj=OE("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),uj=OE("Pencil",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),cj=OE("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),dj=OE("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),fj=OE("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),pj=OE("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),hj=OE("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]),mj=OE("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),gj=OE("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]),vj=OE("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]),yj=OE("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),bj=OE("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),xj=OE("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),wj=OE("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),kj=Ck("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Sj({className:e,variant:t,...n}){return ee.jsx("div",{className:ik(kj({variant:t}),e),...n})}function Ej(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function jj(e,t=[]){let n=[];const r=()=>{const t=n.map(e=>W.createContext(e));return function(n){const r=(null==n?void 0:n[e])||t;return W.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){const o=W.createContext(r),a=n.length;n=[...n,r];const i=t=>{var n;const{scope:r,children:i,...s}=t,l=(null==(n=null==r?void 0:r[e])?void 0:n[a])||o,u=W.useMemo(()=>s,Object.values(s));return ee.jsx(l.Provider,{value:u,children:i})};return i.displayName=t+"Provider",[i,function(n,i){var s;const l=(null==(s=null==i?void 0:i[e])?void 0:s[a])||o,u=W.useContext(l);if(u)return u;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},Cj(r,...t)]}function Cj(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const r=n.reduce((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]}),{});return W.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Pj=(null==globalThis?void 0:globalThis.document)?W.useLayoutEffect:()=>{},Nj=G[" useId ".trim().toString()]||(()=>{}),Tj=0;function Mj(e){const[t,n]=W.useState(Nj());return Pj(()=>{n(e=>e??String(Tj++))},[e]),e||(t?`radix-${t}`:"")}var Rj=G[" useInsertionEffect ".trim().toString()]||Pj;function Lj({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,i]=function({defaultProp:e,onChange:t}){const[n,r]=W.useState(e),o=W.useRef(n),a=W.useRef(t);return Rj(()=>{a.current=t},[t]),W.useEffect(()=>{var e;o.current!==n&&(null==(e=a.current)||e.call(a,n),o.current=n)},[n,o]),[n,r,a]}({defaultProp:t,onChange:n}),s=void 0!==e,l=s?e:o;{const t=W.useRef(void 0!==e);W.useEffect(()=>{const e=t.current;if(e!==s){const t=e?"controlled":"uncontrolled",n=s?"controlled":"uncontrolled";console.warn(`${r} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=s},[s,r])}const u=W.useCallback(t=>{var n;if(s){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&(null==(n=i.current)||n.call(i,r))}else a(t)},[s,e,a,i]);return[l,u]}function Dj(e){const t=_j(e),n=W.forwardRef((e,n)=>{const{children:r,...o}=e,a=W.Children.toArray(r),i=a.find(Oj);if(i){const e=i.props.children,r=a.map(t=>t===i?W.Children.count(e)>1?W.Children.only(null):W.isValidElement(e)?e.props.children:null:t);return ee.jsx(t,{...o,ref:n,children:W.isValidElement(e)?W.cloneElement(e,void 0,r):null})}return ee.jsx(t,{...o,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function _j(e){const t=W.forwardRef((e,t)=>{const{children:n,...r}=e;if(W.isValidElement(n)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==W.Fragment&&(o.ref=t?hk(t,e):e),W.cloneElement(n,o)}return W.Children.count(n)>1?W.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Aj=Symbol("radix.slottable");function Oj(e){return W.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Aj}var Ij=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=Dj(`Primitive.${t}`),r=W.forwardRef((e,r)=>{const{asChild:o,...a}=e,i=o?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),ee.jsx(i,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function zj(e){const t=W.useRef(e);return W.useEffect(()=>{t.current=e}),W.useMemo(()=>(...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)},[])}var Fj,Vj="dismissableLayer.update",$j="dismissableLayer.pointerDownOutside",Bj="dismissableLayer.focusOutside",Uj=W.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wj=W.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:i,onDismiss:s,...l}=e,u=W.useContext(Uj),[c,d]=W.useState(null),f=(null==c?void 0:c.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,p]=W.useState({}),h=mk(t,e=>d(e)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=m.indexOf(g),y=c?m.indexOf(c):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,w=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=zj(e),r=W.useRef(!1),o=W.useRef(()=>{});return W.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let r=function(){Gj($j,n,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{const t=e.target,n=[...u.branches].some(e=>e.contains(t));x&&!n&&(null==o||o(e),null==i||i(e),e.defaultPrevented||null==s||s())},f),k=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=zj(e),r=W.useRef(!1);return W.useEffect(()=>{const e=e=>{if(e.target&&!r.current){Gj(Bj,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(null==a||a(e),null==i||i(e),e.defaultPrevented||null==s||s())},f);return function(e,t=(null==globalThis?void 0:globalThis.document)){const n=zj(e);W.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{y===u.layers.size-1&&(null==r||r(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),W.useEffect(()=>{if(c)return n&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(Fj=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),Hj(),()=>{n&&1===u.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=Fj)}},[c,f,n,u]),W.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),Hj())},[c,u]),W.useEffect(()=>{const e=()=>p({});return document.addEventListener(Vj,e),()=>document.removeEventListener(Vj,e)},[]),ee.jsx(Ij.div,{...l,ref:h,style:{pointerEvents:b?x?"auto":"none":void 0,...e.style},onFocusCapture:Ej(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Ej(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Ej(e.onPointerDownCapture,w.onPointerDownCapture)})});Wj.displayName="DismissableLayer";function Hj(){const e=new CustomEvent(Vj);document.dispatchEvent(e)}function Gj(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&ld.flushSync(()=>e.dispatchEvent(t))}(o,a):o.dispatchEvent(a)}W.forwardRef((e,t)=>{const n=W.useContext(Uj),r=W.useRef(null),o=mk(t,r);return W.useEffect(()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),ee.jsx(Ij.div,{...e,ref:o})}).displayName="DismissableLayerBranch";var Yj="focusScope.autoFocusOnMount",Kj="focusScope.autoFocusOnUnmount",qj={bubbles:!1,cancelable:!0},Xj=W.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...i}=e,[s,l]=W.useState(null),u=zj(o),c=zj(a),d=W.useRef(null),f=mk(t,e=>l(e)),p=W.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;W.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;const t=e.target;s.contains(t)?d.current=t:eC(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;const t=e.relatedTarget;null!==t&&(s.contains(t)||eC(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&eC(s)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[r,s,p.paused]),W.useEffect(()=>{if(s){tC.add(p);const t=document.activeElement;if(!s.contains(t)){const n=new CustomEvent(Yj,qj);s.addEventListener(Yj,u),s.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(eC(r,{select:t}),document.activeElement!==n)return}((e=Qj(s),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&eC(s))}return()=>{s.removeEventListener(Yj,u),setTimeout(()=>{const e=new CustomEvent(Kj,qj);s.addEventListener(Kj,c),s.dispatchEvent(e),e.defaultPrevented||eC(t??document.body,{select:!0}),s.removeEventListener(Kj,c),tC.remove(p)},0)}}var e},[s,u,c,p]);const h=W.useCallback(e=>{if(!n&&!r)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,a]=function(e){const t=Qj(e),n=Zj(t,e),r=Zj(t.reverse(),e);return[n,r]}(t);r&&a?e.shiftKey||o!==a?e.shiftKey&&o===r&&(e.preventDefault(),n&&eC(a,{select:!0})):(e.preventDefault(),n&&eC(r,{select:!0})):o===t&&e.preventDefault()}},[n,r,p.paused]);return ee.jsx(Ij.div,{tabIndex:-1,...i,ref:f,onKeyDown:h})});function Qj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Zj(e,t){for(const n of e)if(!Jj(n,{upTo:t}))return n}function Jj(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function eC(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}Xj.displayName="FocusScope";var tC=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=nC(e,t),e.unshift(t)},remove(t){var n;e=nC(e,t),null==(n=e[0])||n.resume()}}}();function nC(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var rC=W.forwardRef((e,t)=>{var n;const{container:r,...o}=e,[a,i]=W.useState(!1);Pj(()=>i(!0),[]);const s=r||a&&(null==(n=null==globalThis?void 0:globalThis.document)?void 0:n.body);return s?ud.createPortal(ee.jsx(Ij.div,{...o,ref:t}),s):null});rC.displayName="Portal";var oC=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=W.useState(),r=W.useRef(null),o=W.useRef(e),a=W.useRef("none"),i=e?"mounted":"unmounted",[s,l]=function(e,t){return W.useReducer((e,n)=>t[e][n]??e,e)}(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return W.useEffect(()=>{const e=aC(r.current);a.current="mounted"===s?e:"none"},[s]),Pj(()=>{const t=r.current,n=o.current;if(n!==e){const r=a.current,i=aC(t);if(e)l("MOUNT");else if("none"===i||"none"===(null==t?void 0:t.display))l("UNMOUNT");else{l(n&&r!==i?"ANIMATION_OUT":"UNMOUNT")}o.current=e}},[e,l]),Pj(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,i=a=>{const i=aC(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&i&&(l("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=aC(r.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:W.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}(t),o="function"==typeof n?n({present:r.isPresent}):W.Children.only(n),a=mk(r.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof n||r.isPresent?W.cloneElement(o,{ref:a}):null};function aC(e){return(null==e?void 0:e.animationName)||"none"}oC.displayName="Presence";var iC=0;function sC(){W.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??lC()),document.body.insertAdjacentElement("beforeend",e[1]??lC()),iC++,()=>{1===iC&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),iC--}},[])}function lC(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var uC=function(){return uC=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},uC.apply(this,arguments)};function cC(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var dC="right-scroll-bar-position",fC="width-before-scroll-bar";function pC(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var hC="undefined"!=typeof window?W.useLayoutEffect:W.useEffect,mC=new WeakMap;function gC(e,t){var n,r,o,a=(n=null,r=function(t){return e.forEach(function(e){return pC(e,t)})},(o=W.useState(function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}})[0]).callback=r,o.facade);return hC(function(){var t=mC.get(a);if(t){var n=new Set(t),r=new Set(e),o=a.current;n.forEach(function(e){r.has(e)||pC(e,null)}),r.forEach(function(e){n.has(e)||pC(e,o)})}mC.set(a,e)},[e]),a}function vC(e){return e}var yC=function(e){var t=e.sideCar,n=cC(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return W.createElement(r,uC({},n))};yC.isSideCarExport=!0;var bC=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=vC);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),n={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=uC({async:!0,ssr:!1},e),t}(),xC=function(){},wC=W.forwardRef(function(e,t){var n=W.useRef(null),r=W.useState({onScrollCapture:xC,onWheelCapture:xC,onTouchMoveCapture:xC}),o=r[0],a=r[1],i=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,h=e.noIsolation,m=e.inert,g=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,b=e.gapMode,x=cC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=f,k=gC([n,t]),S=uC(uC({},x),o);return W.createElement(W.Fragment,null,c&&W.createElement(w,{sideCar:bC,removeScrollBar:u,shards:d,noRelative:p,noIsolation:h,inert:m,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),i?W.cloneElement(W.Children.only(s),uC(uC({},S),{ref:k})):W.createElement(y,uC({},S,{className:l,ref:k}),s))});wC.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},wC.classNames={fullWidth:fC,zeroRight:dC};function kC(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var SC=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=kC())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},EC=function(){var e,t=(e=SC(),function(t,n){W.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},jC={left:0,top:0,right:0,gap:0},CC=function(e){return parseInt(e||"",10)||0},PC=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return jC;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[CC(n),CC(r),CC(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},NC=EC(),TC="data-scroll-locked",MC=function(e,t,n,r){var o=e.left,a=e.top,i=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat(TC,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(dC," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(fC," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(dC," .").concat(dC," {\n right: 0 ").concat(r,";\n }\n \n .").concat(fC," .").concat(fC," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(TC,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},RC=function(){var e=parseInt(document.body.getAttribute(TC)||"0",10);return isFinite(e)?e:0},LC=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;W.useEffect(function(){return document.body.setAttribute(TC,(RC()+1).toString()),function(){var e=RC()-1;e<=0?document.body.removeAttribute(TC):document.body.setAttribute(TC,e.toString())}},[]);var a=W.useMemo(function(){return PC(o)},[o]);return W.createElement(NC,{styles:MC(a,!t,o,n?"":"!important")})},DC=!1;if("undefined"!=typeof window)try{var _C=Object.defineProperty({},"passive",{get:function(){return DC=!0,!0}});window.addEventListener("test",_C,_C),window.removeEventListener("test",_C,_C)}catch(kT){DC=!1}var AC=!!DC&&{passive:!1},OC=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},IC=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),zC(e,r)){var o=FC(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},zC=function(e,t){return"v"===e?function(e){return OC(e,"overflowY")}(t):function(e){return OC(e,"overflowX")}(t)},FC=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},VC=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$C=function(e){return[e.deltaX,e.deltaY]},BC=function(e){return e&&"current"in e?e.current:e},UC=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},WC=0,HC=[];function GC(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const YC=(KC=function(e){var t=W.useRef([]),n=W.useRef([0,0]),r=W.useRef(),o=W.useState(WC++)[0],a=W.useState(EC)[0],i=W.useRef(e);W.useEffect(function(){i.current=e},[e]),W.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(BC),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=W.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var o,a=VC(e),s=n.current,l="deltaX"in e?e.deltaX:s[0]-a[0],u="deltaY"in e?e.deltaY:s[1]-a[1],c=e.target,d=Math.abs(l)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===c||p.contains(c)))return!1;var h=IC(d,c);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=IC(d,c)),!h)return!1;if(!r.current&&"changedTouches"in e&&(l||u)&&(r.current=o),!o)return!0;var m=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*r,i=n.target,s=t.contains(i),l=!1,u=a>0,c=0,d=0;do{if(!i)break;var f=FC(e,i),p=f[0],h=f[1]-f[2]-o*p;(p||h)&&zC(e,i)&&(c+=h,d+=p);var m=i.parentNode;i=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(u&&Math.abs(c)<1||!u&&Math.abs(d)<1)&&(l=!0),l}(m,t,e,"h"===m?l:u)},[]),l=W.useCallback(function(e){var n=e;if(HC.length&&HC[HC.length-1]===a){var r="deltaY"in n?$C(n):VC(n),o=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,o=r,t[0]===o[0]&&t[1]===o[1]);var t,o})[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var l=(i.current.shards||[]).map(BC).filter(Boolean).filter(function(e){return e.contains(n.target)});(l.length>0?s(n,l[0]):!i.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=W.useCallback(function(e,n,r,o){var a={name:e,delta:n,target:r,should:o,shadowParent:GC(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),c=W.useCallback(function(e){n.current=VC(e),r.current=void 0},[]),d=W.useCallback(function(t){u(t.type,$C(t),t.target,s(t,e.lockRef.current))},[]),f=W.useCallback(function(t){u(t.type,VC(t),t.target,s(t,e.lockRef.current))},[]);W.useEffect(function(){return HC.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,AC),document.addEventListener("touchmove",l,AC),document.addEventListener("touchstart",c,AC),function(){HC=HC.filter(function(e){return e!==a}),document.removeEventListener("wheel",l,AC),document.removeEventListener("touchmove",l,AC),document.removeEventListener("touchstart",c,AC)}},[]);var p=e.removeScrollBar,h=e.inert;return W.createElement(W.Fragment,null,h?W.createElement(a,{styles:UC(o)}):null,p?W.createElement(LC,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},bC.useMedium(KC),yC);var KC,qC=W.forwardRef(function(e,t){return W.createElement(wC,uC({},e,{ref:t,sideCar:YC}))});qC.classNames=wC.classNames;var XC=new WeakMap,QC=new WeakMap,ZC={},JC=0,eP=function(e){return e&&(e.host||eP(e.parentNode))},tP=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=eP(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);ZC[n]||(ZC[n]=new WeakMap);var a=ZC[n],i=[],s=new Set,l=new Set(o),u=function(e){e&&!s.has(e)&&(s.add(e),u(e.parentNode))};o.forEach(u);var c=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))c(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(XC.get(e)||0)+1,u=(a.get(e)||0)+1;XC.set(e,l),a.set(e,u),i.push(e),1===l&&o&&QC.set(e,!0),1===u&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(wT){console.error("aria-hidden: cannot operate on ",e,wT)}})};return c(t),s.clear(),JC++,function(){i.forEach(function(e){var t=XC.get(e)-1,o=a.get(e)-1;XC.set(e,t),a.set(e,o),t||(QC.has(e)||e.removeAttribute(r),QC.delete(e)),o||e.removeAttribute(n)}),--JC||(XC=new WeakMap,XC=new WeakMap,QC=new WeakMap,ZC={})}},nP=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),tP(r,o,n,"aria-hidden")):function(){return null}};function rP(e){const t=oP(e),n=W.forwardRef((e,n)=>{const{children:r,...o}=e,a=W.Children.toArray(r),i=a.find(iP);if(i){const e=i.props.children,r=a.map(t=>t===i?W.Children.count(e)>1?W.Children.only(null):W.isValidElement(e)?e.props.children:null:t);return ee.jsx(t,{...o,ref:n,children:W.isValidElement(e)?W.cloneElement(e,void 0,r):null})}return ee.jsx(t,{...o,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function oP(e){const t=W.forwardRef((e,t)=>{const{children:n,...r}=e;if(W.isValidElement(n)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==W.Fragment&&(o.ref=t?hk(t,e):e),W.cloneElement(n,o)}return W.Children.count(n)>1?W.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var aP=Symbol("radix.slottable");function iP(e){return W.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===aP}var sP="Dialog",[lP]=jj(sP),[uP,cP]=lP(sP),dP=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:i=!0}=e,s=W.useRef(null),l=W.useRef(null),[u,c]=Lj({prop:r,defaultProp:o??!1,onChange:a,caller:sP});return ee.jsx(uP,{scope:t,triggerRef:s,contentRef:l,contentId:Mj(),titleId:Mj(),descriptionId:Mj(),open:u,onOpenChange:c,onOpenToggle:W.useCallback(()=>c(e=>!e),[c]),modal:i,children:n})};dP.displayName=sP;var fP="DialogTrigger";W.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=cP(fP,n),a=mk(t,o.triggerRef);return ee.jsx(Ij.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":LP(o.open),...r,ref:a,onClick:Ej(e.onClick,o.onOpenToggle)})}).displayName=fP;var pP="DialogPortal",[hP,mP]=lP(pP,{forceMount:void 0}),gP=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,a=cP(pP,t);return ee.jsx(hP,{scope:t,forceMount:n,children:W.Children.map(r,e=>ee.jsx(oC,{present:n||a.open,children:ee.jsx(rC,{asChild:!0,container:o,children:e})}))})};gP.displayName=pP;var vP="DialogOverlay",yP=W.forwardRef((e,t)=>{const n=mP(vP,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=cP(vP,e.__scopeDialog);return a.modal?ee.jsx(oC,{present:r||a.open,children:ee.jsx(xP,{...o,ref:t})}):null});yP.displayName=vP;var bP=rP("DialogOverlay.RemoveScroll"),xP=W.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=cP(vP,n);return ee.jsx(qC,{as:bP,allowPinchZoom:!0,shards:[o.contentRef],children:ee.jsx(Ij.div,{"data-state":LP(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),wP="DialogContent",kP=W.forwardRef((e,t)=>{const n=mP(wP,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=cP(wP,e.__scopeDialog);return ee.jsx(oC,{present:r||a.open,children:a.modal?ee.jsx(SP,{...o,ref:t}):ee.jsx(EP,{...o,ref:t})})});kP.displayName=wP;var SP=W.forwardRef((e,t)=>{const n=cP(wP,e.__scopeDialog),r=W.useRef(null),o=mk(t,n.contentRef,r);return W.useEffect(()=>{const e=r.current;if(e)return nP(e)},[]),ee.jsx(jP,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ej(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),null==(t=n.triggerRef.current)||t.focus()}),onPointerDownOutside:Ej(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:Ej(e.onFocusOutside,e=>e.preventDefault())})}),EP=W.forwardRef((e,t)=>{const n=cP(wP,e.__scopeDialog),r=W.useRef(!1),o=W.useRef(!1);return ee.jsx(jP,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var a,i;null==(a=e.onCloseAutoFocus)||a.call(e,t),t.defaultPrevented||(r.current||null==(i=n.triggerRef.current)||i.focus(),t.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:t=>{var a,i;null==(a=e.onInteractOutside)||a.call(e,t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));const s=t.target;(null==(i=n.triggerRef.current)?void 0:i.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})}),jP=W.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...i}=e,s=cP(wP,n),l=W.useRef(null),u=mk(t,l);return sC(),ee.jsxs(ee.Fragment,{children:[ee.jsx(Xj,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:ee.jsx(Wj,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":LP(s.open),...i,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),ee.jsxs(ee.Fragment,{children:[ee.jsx(OP,{titleId:s.titleId}),ee.jsx(IP,{contentRef:l,descriptionId:s.descriptionId})]})]})}),CP="DialogTitle",PP=W.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=cP(CP,n);return ee.jsx(Ij.h2,{id:o.titleId,...r,ref:t})});PP.displayName=CP;var NP="DialogDescription",TP=W.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=cP(NP,n);return ee.jsx(Ij.p,{id:o.descriptionId,...r,ref:t})});TP.displayName=NP;var MP="DialogClose",RP=W.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=cP(MP,n);return ee.jsx(Ij.button,{type:"button",...r,ref:t,onClick:Ej(e.onClick,()=>o.onOpenChange(!1))})});function LP(e){return e?"open":"closed"}RP.displayName=MP;var DP="DialogTitleWarning",[_P,AP]=function(e,t){const n=W.createContext(t),r=e=>{const{children:t,...r}=e,o=W.useMemo(()=>r,Object.values(r));return ee.jsx(n.Provider,{value:o,children:t})};return r.displayName=e+"Provider",[r,function(r){const o=W.useContext(n);if(o)return o;if(void 0!==t)return t;throw new Error(`\`${r}\` must be used within \`${e}\``)}]}(DP,{contentName:wP,titleName:CP,docsSlug:"dialog"}),OP=({titleId:e})=>{const t=AP(DP),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return W.useEffect(()=>{if(e){document.getElementById(e)||console.error(n)}},[n,e]),null},IP=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${AP("DialogDescriptionWarning").contentName}}.`;return W.useEffect(()=>{var r;const o=null==(r=e.current)?void 0:r.getAttribute("aria-describedby");if(t&&o){document.getElementById(t)||console.warn(n)}},[n,e,t]),null},zP=yP,FP=kP,VP=PP,$P=TP,BP=RP;const UP=dP,WP=gP,HP=W.forwardRef(({className:e,...t},n)=>ee.jsx(zP,{ref:n,className:ik("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));HP.displayName=zP.displayName;const GP=W.forwardRef(({className:e,children:t,noOverlay:n,...r},o)=>ee.jsxs(WP,{children:[!n&&ee.jsx(HP,{}),ee.jsxs(FP,{ref:o,className:ik("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,ee.jsxs(BP,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[ee.jsx(xj,{className:"h-4 w-4"}),ee.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));GP.displayName=FP.displayName;const YP=({className:e,...t})=>ee.jsx("div",{className:ik("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});YP.displayName="DialogHeader";const KP=({className:e,...t})=>ee.jsx("div",{className:ik("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});KP.displayName="DialogFooter";const qP=W.forwardRef(({className:e,...t},n)=>ee.jsx(VP,{ref:n,className:ik("text-lg font-semibold leading-none tracking-tight",e),...t}));qP.displayName=VP.displayName;const XP=W.forwardRef(({className:e,...t},n)=>ee.jsx($P,{ref:n,className:ik("text-sm text-muted-foreground",e),...t}));function QP({project:e,open:t,onOpenChange:n,onUpdated:r}){const[o,a]=W.useState([]),[i,s]=W.useState([]),[l,u]=W.useState(!1),[c,d]=W.useState(null);W.useEffect(()=>{if(!t)return;a(e.shares?[...e.shares]:[]),d(null);let n=!1;return tS().then(e=>{n||s(e)}).catch(()=>{}),()=>{n=!0}},[t,e.id]);const f=new Set(o.map(e=>e.username)),p=i.filter(t=>t!==e.owner&&!f.has(t));return ee.jsx(UP,{open:t,onOpenChange:n,children:ee.jsxs(GP,{className:"sm:max-w-md",children:[ee.jsxs(YP,{children:[ee.jsxs(qP,{className:"flex items-center gap-2",children:[ee.jsx(bj,{className:"h-4 w-4"}),"共享设置"]}),ee.jsx(XP,{children:"选择用户并设置权限:可见(只读)或可编辑(读写+终端)"})]}),ee.jsxs("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:[0===o.length&&ee.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"尚未共享给任何用户"}),o.map(e=>ee.jsxs("div",{className:"flex items-center justify-between gap-2 px-1",children:[ee.jsx("span",{className:"text-sm font-medium",children:e.username}),ee.jsxs("div",{className:"flex items-center gap-1.5",children:[ee.jsx("button",{onClick:()=>{return t=e.username,void a(e=>e.map(e=>e.username===t?{...e,permission:"view"===e.permission?"edit":"view"}:e));var t},className:"focus:outline-none",children:ee.jsx(Sj,{variant:"edit"===e.permission?"default":"secondary",className:"cursor-pointer text-xs",children:"edit"===e.permission?"可编辑":"可见"})}),ee.jsx(Nk,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>{return t=e.username,void a(e=>e.filter(e=>e.username!==t));var t},children:ee.jsx(yj,{className:"h-3.5 w-3.5"})})]})]},e.username))]}),p.length>0&&ee.jsxs("div",{className:"border-t pt-3",children:[ee.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"添加用户"}),ee.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(e=>ee.jsxs(Nk,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>{return t=e,void a(e=>[...e,{username:t,permission:"view"}]);var t},children:[ee.jsx(cj,{className:"h-3 w-3"}),e]},e))})]}),c&&ee.jsx("p",{className:"text-sm text-destructive",children:c}),ee.jsxs(KP,{children:[ee.jsx(Nk,{variant:"outline",onClick:()=>n(!1),disabled:l,children:"取消"}),ee.jsx(Nk,{onClick:()=>{(async()=>{u(!0),d(null);try{const t=await nS(e.id,o);r(t),n(!1)}catch(kT){d(kT instanceof Error?kT.message:"Failed to update shares")}finally{u(!1)}})()},disabled:l,children:l?"保存中...":"保存"})]})]})})}XP.displayName=$P.displayName;const ZP=Array(12).fill(0),JP=({visible:e,className:t})=>H.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},H.createElement("div",{className:"sonner-spinner"},ZP.map((e,t)=>H.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),eN=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),tN=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},H.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),nN=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),rN=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),oN=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},H.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),H.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}));let aN=1;const iN=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;const{message:n,...r}=e,o="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:aN++,a=this.toasts.find(e=>e.id===o),i=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(t=>t.id===o?(this.publish({...t,...e,id:o,title:n}),{...t,...e,id:o,dismissible:i,title:n}):t):this.addToast({title:n,...r,dismissible:i,id:o}),o},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;void 0!==t.loading&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));const r=Promise.resolve(e instanceof Function?e():e);let o,a=void 0!==n;const i=r.then(async e=>{o=["resolve",e];if(H.isValidElement(e))a=!1,this.create({id:n,type:"default",message:e});else if(sN(e)&&!e.ok){a=!1;const r="function"==typeof t.error?await t.error(`HTTP error! status: ${e.status}`):t.error,o="function"==typeof t.description?await t.description(`HTTP error! status: ${e.status}`):t.description,i="object"==typeof r&&!H.isValidElement(r)?r:{message:r};this.create({id:n,type:"error",description:o,...i})}else if(e instanceof Error){a=!1;const r="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description,i="object"==typeof r&&!H.isValidElement(r)?r:{message:r};this.create({id:n,type:"error",description:o,...i})}else if(void 0!==t.success){a=!1;const r="function"==typeof t.success?await t.success(e):t.success,o="function"==typeof t.description?await t.description(e):t.description,i="object"==typeof r&&!H.isValidElement(r)?r:{message:r};this.create({id:n,type:"success",description:o,...i})}}).catch(async e=>{if(o=["reject",e],void 0!==t.error){a=!1;const r="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description,i="object"==typeof r&&!H.isValidElement(r)?r:{message:r};this.create({id:n,type:"error",description:o,...i})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),null==t.finally||t.finally.call(t)}),s=()=>new Promise((e,t)=>i.then(()=>"reject"===o[0]?t(o[1]):e(o[1])).catch(t));return"string"!=typeof n&&"number"!=typeof n?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{const n=(null==t?void 0:t.id)||aN++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},sN=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,lN=(e,t)=>{const n=(null==t?void 0:t.id)||aN++;return iN.addToast({title:e,...t,id:n}),n},uN=Object.assign(lN,{success:iN.success,info:iN.info,warning:iN.warning,error:iN.error,custom:iN.custom,message:iN.message,promise:iN.promise,dismiss:iN.dismiss,loading:iN.loading},{getHistory:()=>iN.toasts,getToasts:()=>iN.getActiveToasts()});function cN(e){return void 0!==e.label}!function(e){if("undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");const dN=3,fN=14;function pN(...e){return e.filter(Boolean).join(" ")}const hN=e=>{var t,n,r,o,a,i,s,l,u;const{invert:c,toast:d,unstyled:f,interacting:p,setHeights:h,visibleToasts:m,heights:g,index:v,toasts:y,expanded:b,removeToast:x,defaultRichColors:w,closeButton:k,style:S,cancelButtonStyle:E,actionButtonStyle:j,className:C="",descriptionClassName:P="",duration:N,position:T,gap:M,expandByDefault:R,classNames:L,icons:D,closeButtonAriaLabel:_="Close toast"}=e,[A,O]=H.useState(null),[I,z]=H.useState(null),[F,V]=H.useState(!1),[$,B]=H.useState(!1),[U,W]=H.useState(!1),[G,Y]=H.useState(!1),[K,q]=H.useState(!1),[X,Q]=H.useState(0),[Z,J]=H.useState(0),ee=H.useRef(d.duration||N||4e3),te=H.useRef(null),ne=H.useRef(null),re=0===v,oe=v+1<=m,ae=d.type,ie=!1!==d.dismissible,se=d.className||"",le=d.descriptionClassName||"",ue=H.useMemo(()=>g.findIndex(e=>e.toastId===d.id)||0,[g,d.id]),ce=H.useMemo(()=>{var e;return null!=(e=d.closeButton)?e:k},[d.closeButton,k]),de=H.useMemo(()=>d.duration||N||4e3,[d.duration,N]),fe=H.useRef(0),pe=H.useRef(0),he=H.useRef(0),me=H.useRef(null),[ge,ve]=T.split("-"),ye=H.useMemo(()=>g.reduce((e,t,n)=>n>=ue?e:e+t.height,0),[g,ue]),be=(()=>{const[e,t]=H.useState(document.hidden);return H.useEffect(()=>{const e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e})(),xe=d.invert||c,we="loading"===ae;pe.current=H.useMemo(()=>ue*M+ye,[ue,ye]),H.useEffect(()=>{ee.current=de},[de]),H.useEffect(()=>{V(!0)},[]),H.useEffect(()=>{const e=ne.current;if(e){const t=e.getBoundingClientRect().height;return J(t),h(e=>[{toastId:d.id,height:t,position:d.position},...e]),()=>h(e=>e.filter(e=>e.toastId!==d.id))}},[h,d.id]),H.useLayoutEffect(()=>{if(!F)return;const e=ne.current,t=e.style.height;e.style.height="auto";const n=e.getBoundingClientRect().height;e.style.height=t,J(n),h(e=>e.find(e=>e.toastId===d.id)?e.map(e=>e.toastId===d.id?{...e,height:n}:e):[{toastId:d.id,height:n,position:d.position},...e])},[F,d.title,d.description,h,d.id,d.jsx,d.action,d.cancel]);const ke=H.useCallback(()=>{B(!0),Q(pe.current),h(e=>e.filter(e=>e.toastId!==d.id)),setTimeout(()=>{x(d)},200)},[d,x,h,pe]);H.useEffect(()=>{if(d.promise&&"loading"===ae||d.duration===1/0||"loading"===d.type)return;let e;return b||p||be?(()=>{if(he.current<fe.current){const e=(new Date).getTime()-fe.current;ee.current=ee.current-e}he.current=(new Date).getTime()})():ee.current!==1/0&&(fe.current=(new Date).getTime(),e=setTimeout(()=>{null==d.onAutoClose||d.onAutoClose.call(d,d),ke()},ee.current)),()=>clearTimeout(e)},[b,p,d,ae,be,ke]),H.useEffect(()=>{d.delete&&(ke(),null==d.onDismiss||d.onDismiss.call(d,d))},[ke,d.delete]);const Se=d.icon||(null==D?void 0:D[ae])||(e=>{switch(e){case"success":return eN;case"info":return nN;case"warning":return tN;case"error":return rN;default:return null}})(ae);var Ee,je,Ce,Pe;return H.createElement("li",{tabIndex:0,ref:ne,className:pN(C,se,null==L?void 0:L.toast,null==d||null==(t=d.classNames)?void 0:t.toast,null==L?void 0:L.default,null==L?void 0:L[ae],null==d||null==(n=d.classNames)?void 0:n[ae]),"data-sonner-toast":"","data-rich-colors":null!=(Ee=d.richColors)?Ee:w,"data-styled":!Boolean(d.jsx||d.unstyled||f),"data-mounted":F,"data-promise":Boolean(d.promise),"data-swiped":K,"data-removed":$,"data-visible":oe,"data-y-position":ge,"data-x-position":ve,"data-index":v,"data-front":re,"data-swiping":U,"data-dismissible":ie,"data-type":ae,"data-invert":xe,"data-swipe-out":G,"data-swipe-direction":I,"data-expanded":Boolean(b||R&&F),"data-testid":d.testId,style:{"--index":v,"--toasts-before":v,"--z-index":y.length-v,"--offset":`${$?X:pe.current}px`,"--initial-height":R?"auto":`${Z}px`,...S,...d.style},onDragEnd:()=>{W(!1),O(null),me.current=null},onPointerDown:e=>{2!==e.button&&!we&&ie&&(te.current=new Date,Q(pe.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(W(!0),me.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,n;if(G||!ie)return;me.current=null;const r=Number((null==(e=ne.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),o=Number((null==(t=ne.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),a=(new Date).getTime()-(null==(n=te.current)?void 0:n.getTime()),i="x"===A?r:o,s=Math.abs(i)/a;if(Math.abs(i)>=45||s>.11)return Q(pe.current),null==d.onDismiss||d.onDismiss.call(d,d),z("x"===A?r>0?"right":"left":o>0?"down":"up"),ke(),void Y(!0);var l,u;null==(l=ne.current)||l.style.setProperty("--swipe-amount-x","0px"),null==(u=ne.current)||u.style.setProperty("--swipe-amount-y","0px"),q(!1),W(!1),O(null)},onPointerMove:t=>{var n,r,o;if(!me.current||!ie)return;if((null==(n=window.getSelection())?void 0:n.toString().length)>0)return;const a=t.clientY-me.current.y,i=t.clientX-me.current.x;var s;const l=null!=(s=e.swipeDirections)?s:function(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}(T);!A&&(Math.abs(i)>1||Math.abs(a)>1)&&O(Math.abs(i)>Math.abs(a)?"x":"y");let u={x:0,y:0};const c=e=>1/(1.5+Math.abs(e)/20);if("y"===A){if(l.includes("top")||l.includes("bottom"))if(l.includes("top")&&a<0||l.includes("bottom")&&a>0)u.y=a;else{const e=a*c(a);u.y=Math.abs(e)<Math.abs(a)?e:a}}else if("x"===A&&(l.includes("left")||l.includes("right")))if(l.includes("left")&&i<0||l.includes("right")&&i>0)u.x=i;else{const e=i*c(i);u.x=Math.abs(e)<Math.abs(i)?e:i}(Math.abs(u.x)>0||Math.abs(u.y)>0)&&q(!0),null==(r=ne.current)||r.style.setProperty("--swipe-amount-x",`${u.x}px`),null==(o=ne.current)||o.style.setProperty("--swipe-amount-y",`${u.y}px`)}},ce&&!d.jsx&&"loading"!==ae?H.createElement("button",{"aria-label":_,"data-disabled":we,"data-close-button":!0,onClick:we||!ie?()=>{}:()=>{ke(),null==d.onDismiss||d.onDismiss.call(d,d)},className:pN(null==L?void 0:L.closeButton,null==d||null==(r=d.classNames)?void 0:r.closeButton)},null!=(je=null==D?void 0:D.close)?je:oN):null,(ae||d.icon||d.promise)&&null!==d.icon&&(null!==(null==D?void 0:D[ae])||d.icon)?H.createElement("div",{"data-icon":"",className:pN(null==L?void 0:L.icon,null==d||null==(o=d.classNames)?void 0:o.icon)},d.promise||"loading"===d.type&&!d.icon?d.icon||((null==D?void 0:D.loading)?H.createElement("div",{className:pN(null==L?void 0:L.loader,null==d||null==(Pe=d.classNames)?void 0:Pe.loader,"sonner-loader"),"data-visible":"loading"===ae},D.loading):H.createElement(JP,{className:pN(null==L?void 0:L.loader,null==d||null==(Ce=d.classNames)?void 0:Ce.loader),visible:"loading"===ae})):null,"loading"!==d.type?Se:null):null,H.createElement("div",{"data-content":"",className:pN(null==L?void 0:L.content,null==d||null==(a=d.classNames)?void 0:a.content)},H.createElement("div",{"data-title":"",className:pN(null==L?void 0:L.title,null==d||null==(i=d.classNames)?void 0:i.title)},d.jsx?d.jsx:"function"==typeof d.title?d.title():d.title),d.description?H.createElement("div",{"data-description":"",className:pN(P,le,null==L?void 0:L.description,null==d||null==(s=d.classNames)?void 0:s.description)},"function"==typeof d.description?d.description():d.description):null),H.isValidElement(d.cancel)?d.cancel:d.cancel&&cN(d.cancel)?H.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||E,onClick:e=>{cN(d.cancel)&&ie&&(null==d.cancel.onClick||d.cancel.onClick.call(d.cancel,e),ke())},className:pN(null==L?void 0:L.cancelButton,null==d||null==(l=d.classNames)?void 0:l.cancelButton)},d.cancel.label):null,H.isValidElement(d.action)?d.action:d.action&&cN(d.action)?H.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||j,onClick:e=>{cN(d.action)&&(null==d.action.onClick||d.action.onClick.call(d.action,e),e.defaultPrevented||ke())},className:pN(null==L?void 0:L.actionButton,null==d||null==(u=d.classNames)?void 0:u.actionButton)},d.action.label):null)};function mN(){if("undefined"==typeof window)return"ltr";if("undefined"==typeof document)return"ltr";const e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}function gN(e,t){const n={};return[e,t].forEach((e,t)=>{const r=1===t,o=r?"--mobile-offset":"--offset",a=r?"16px":"24px";function i(e){["top","right","bottom","left"].forEach(t=>{n[`${o}-${t}`]="number"==typeof e?`${e}px`:e})}"number"==typeof e||"string"==typeof e?i(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?n[`${o}-${t}`]=a:n[`${o}-${t}`]="number"==typeof e[t]?`${e[t]}px`:e[t]}):i(a)}),n}const vN=H.forwardRef(function(e,t){const{id:n,invert:r,position:o="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:s,className:l,offset:u,mobileOffset:c,theme:d="light",richColors:f,duration:p,style:h,visibleToasts:m=dN,toastOptions:g,dir:v=mN(),gap:y=fN,icons:b,containerAriaLabel:x="Notifications"}=e,[w,k]=H.useState([]),S=H.useMemo(()=>n?w.filter(e=>e.toasterId===n):w.filter(e=>!e.toasterId),[w,n]),E=H.useMemo(()=>Array.from(new Set([o].concat(S.filter(e=>e.position).map(e=>e.position)))),[S,o]),[j,C]=H.useState([]),[P,N]=H.useState(!1),[T,M]=H.useState(!1),[R,L]=H.useState("system"!==d?d:"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),D=H.useRef(null),_=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),A=H.useRef(null),O=H.useRef(!1),I=H.useCallback(e=>{k(t=>{var n;return(null==(n=t.find(t=>t.id===e.id))?void 0:n.delete)||iN.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return H.useEffect(()=>iN.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{k(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{ud.flushSync(()=>{k(t=>{const n=t.findIndex(t=>t.id===e.id);return-1!==n?[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]:[e,...t]})})})}),[w]),H.useEffect(()=>{if("system"!==d)return void L(d);if("system"===d&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),"undefined"==typeof window)return;const e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",({matches:e})=>{L(e?"dark":"light")})}catch(t){e.addListener(({matches:e})=>{try{L(e?"dark":"light")}catch(wT){console.error(wT)}})}},[d]),H.useEffect(()=>{w.length<=1&&N(!1)},[w]),H.useEffect(()=>{const e=e=>{var t;var n;a.every(t=>e[t]||e.code===t)&&(N(!0),null==(n=D.current)||n.focus());"Escape"!==e.code||document.activeElement!==D.current&&!(null==(t=D.current)?void 0:t.contains(document.activeElement))||N(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[a]),H.useEffect(()=>{if(D.current)return()=>{A.current&&(A.current.focus({preventScroll:!0}),A.current=null,O.current=!1)}},[D.current]),H.createElement("section",{ref:t,"aria-label":`${x} ${_}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},E.map((t,n)=>{var o;const[a,d]=t.split("-");return S.length?H.createElement("ol",{key:t,dir:"auto"===v?mN():v,tabIndex:-1,ref:D,className:l,"data-sonner-toaster":!0,"data-sonner-theme":R,"data-y-position":a,"data-x-position":d,style:{"--front-toast-height":`${(null==(o=j[0])?void 0:o.height)||0}px`,"--width":"356px","--gap":`${y}px`,...h,...gN(u,c)},onBlur:e=>{O.current&&!e.currentTarget.contains(e.relatedTarget)&&(O.current=!1,A.current&&(A.current.focus({preventScroll:!0}),A.current=null))},onFocus:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||O.current||(O.current=!0,A.current=e.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{T||N(!1)},onDragEnd:()=>N(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||M(!0)},onPointerUp:()=>M(!1)},S.filter(e=>!e.position&&0===n||e.position===t).map((n,o)=>{var a,l;return H.createElement(hN,{key:n.id,icons:b,index:o,toast:n,defaultRichColors:f,duration:null!=(a=null==g?void 0:g.duration)?a:p,className:null==g?void 0:g.className,descriptionClassName:null==g?void 0:g.descriptionClassName,invert:r,visibleToasts:m,closeButton:null!=(l=null==g?void 0:g.closeButton)?l:s,interacting:T,position:t,style:null==g?void 0:g.style,unstyled:null==g?void 0:g.unstyled,classNames:null==g?void 0:g.classNames,cancelButtonStyle:null==g?void 0:g.cancelButtonStyle,actionButtonStyle:null==g?void 0:g.actionButtonStyle,closeButtonAriaLabel:null==g?void 0:g.closeButtonAriaLabel,removeToast:I,toasts:S.filter(e=>e.position==n.position),heights:j.filter(e=>e.position==n.position),setHeights:C,expandByDefault:i,gap:y,expanded:P,swipeDirections:e.swipeDirections})})):null}))});function yN(e,t){switch(e){case"thinking":return"Thinking…";case"tool_use":return t?`${t}`:"Tool…";case"tool_result":return"Reading…";case"text":return"Writing…"}}function bN({status:e}){return ee.jsx("span",{className:ik("inline-block w-2 h-2 rounded-full",{"bg-green-500":"running"===e,"bg-zinc-400":"stopped"===e,"bg-yellow-400 animate-pulse":"restarting"===e})})}const xN=H.memo(function({project:e,active:t=!1,statusStack:n=[],onDelete:r,onArchive:o,onUnarchive:a,onUpdated:i}){var s,l;const u=cf(),[c,d]=W.useState(!1),[f,p]=W.useState(null),[h,m]=W.useState(!1),[g,v]=W.useState(e.name),y=W.useRef(null),b=!!e._sharedPermission;W.useEffect(()=>{let t=!1;return sE(e.id).then(({bytes:e})=>{t||p(e)}).catch(()=>{}),()=>{t=!0}},[e.id]);const x="view"===e._sharedPermission,w=t=>{t.stopPropagation(),v(e.name),m(!0),setTimeout(()=>{var e;return null==(e=y.current)?void 0:e.select()},0)},k=async()=>{const t=g.trim();if(t&&t!==e.name)try{const n=await eE(e.id,t);null==i||i(n),m(!1)}catch(kT){uN.error("Rename failed",{description:null==kT?void 0:kT.message})}else m(!1)},S=ee.jsx(dw.div,{whileHover:e.archived||t?{}:{y:-2},transition:{duration:.2},children:ee.jsxs(sk,{className:ik("group cursor-pointer transition-colors relative",e.archived?"opacity-60 hover:opacity-80 hover:border-zinc-400":t?"border-transparent hover:border-transparent bg-transparent shadow-none":"hover:border-zinc-400 hover:shadow-md"),onClick:()=>!e.archived&&u(`/projects/${e.id}`),children:[ee.jsxs(lk,{className:"pb-2",children:[ee.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h?ee.jsx("input",{ref:y,className:"text-base leading-tight font-semibold bg-transparent border-b border-primary outline-none w-full min-w-0",value:g,onChange:e=>v(e.target.value),onBlur:()=>{k()},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),k()),"Escape"===e.key&&m(!1)},onClick:e=>e.stopPropagation()}):ee.jsx(uk,{className:ik("text-base leading-tight",e.archived&&"text-muted-foreground"),onDoubleClick:b||e.archived?void 0:w,children:e.name}),ee.jsx("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",children:!b&&ee.jsxs(ee.Fragment,{children:[e.archived?ee.jsx(Nk,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:t=>{t.stopPropagation(),a(e.id)},title:"Restore project",children:ee.jsx(zE,{className:"h-3.5 w-3.5"})}):ee.jsxs(ee.Fragment,{children:[ee.jsx(Nk,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:w,title:"Rename project",children:ee.jsx(uj,{className:"h-3.5 w-3.5"})}),ee.jsx(Nk,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:e=>{e.stopPropagation(),d(!0)},title:"共享设置",children:ee.jsx(bj,{className:"h-3.5 w-3.5"})}),ee.jsx(Nk,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:t=>{t.stopPropagation(),o(e.id)},title:"Archive project",children:ee.jsx(FE,{className:"h-3.5 w-3.5"})})]}),ee.jsx(Nk,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:t=>{t.stopPropagation(),confirm(`Delete project "${e.name}"? This cannot be undone.`)&&r(e.id)},title:"Delete project",children:ee.jsx(yj,{className:"h-3.5 w-3.5"})})]})})]}),ee.jsx("div",{className:"flex items-center gap-1.5",children:e.archived?ee.jsx(Sj,{variant:"secondary",className:"text-xs",children:"Archived"}):ee.jsxs(ee.Fragment,{children:[ee.jsx(bN,{status:e.status}),ee.jsx("span",{className:"text-xs text-muted-foreground capitalize",children:e.status}),t&&n.length>0&&ee.jsx("div",{className:"ml-auto",children:ee.jsx(Yb,{mode:"wait",children:n.slice(-1).map(e=>ee.jsx(dw.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.25,ease:"easeOut"},children:ee.jsx(Sj,{variant:"outline",className:"text-xs font-normal whitespace-nowrap",children:yN(e.phase,e.detail)})},e.id))})})]})})]}),ee.jsxs(dk,{className:"space-y-2",children:[ee.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[ee.jsx(KE,{className:"h-3.5 w-3.5 flex-shrink-0"}),ee.jsx("span",{className:"truncate font-mono",children:e.folderPath}),null!==f&&ee.jsx("span",{className:"flex-shrink-0 ml-auto text-muted-foreground/70",children:(E=f,E>=1073741824?(E/1073741824).toFixed(1)+" GB":E>=1048576?(E/1048576).toFixed(1)+" MB":Math.round(E/1024)+" KB")})]}),ee.jsxs("div",{className:"flex items-center gap-2",children:[ee.jsx(Sj,{variant:"outline",className:"text-xs font-mono",children:e.cliTool??"claude"}),ee.jsx(Sj,{variant:"unlimited"===e.permissionMode?"destructive":"secondary",className:"text-xs",children:"unlimited"===e.permissionMode?"Unlimited":"Limited"}),b&&ee.jsxs(Sj,{variant:"outline",className:"text-xs gap-0.5",children:[x?ee.jsx(GE,{className:"h-3 w-3"}):ee.jsx(uj,{className:"h-3 w-3"}),x?"可见":"可编辑"]}),!b&&e.shares&&e.shares.length>0&&ee.jsxs(Sj,{variant:"outline",className:"text-xs gap-0.5",children:[ee.jsx(bj,{className:"h-3 w-3"}),e.shares.length]}),ee.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(e.createdAt).toLocaleDateString()})]}),(e.tags??[]).length>0&&ee.jsxs("div",{className:"flex flex-wrap gap-1 mt-1",children:[(e.tags??[]).slice(0,3).map(e=>ee.jsxs("span",{className:"px-1.5 py-0 rounded-full text-[10px] bg-muted text-muted-foreground border border-border",children:["#",e]},e)),((null==(s=e.tags)?void 0:s.length)??0)>3&&ee.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["+",((null==(l=e.tags)?void 0:l.length)??0)-3]})]})]})]})});var E;const j=t&&!e.archived?ee.jsx("div",{className:"card-active-glow rounded-lg",children:S}):S;return ee.jsxs(ee.Fragment,{children:[j,!b&&i&&ee.jsx(QP,{project:e,open:c,onOpenChange:d,onUpdated:i})]})});function wN({onSelect:e}){const[t,n]=W.useState(""),[r,o]=W.useState(null),[a,i]=W.useState([]),[s,l]=W.useState(!0),[u,c]=W.useState(null),[d,f]=W.useState(!1),[p,h]=W.useState(""),[m,g]=W.useState(null),[v,y]=W.useState(!1),b=W.useRef(null),x=async e=>{l(!0),c(null);try{const t=await ES(e);n(t.path),o(t.parent),i(t.entries)}catch(kT){c(kT instanceof Error?kT.message:"Failed to load directory")}finally{l(!1)}};W.useEffect(()=>{x()},[]),W.useEffect(()=>{d&&setTimeout(()=>{var e;return null==(e=b.current)?void 0:e.focus()},0)},[d]);const w=()=>{f(!1),h(""),g(null)},k=async()=>{const e=p.trim();if(e){y(!0),g(null);try{const{path:n}=await PS(t,e);f(!1),h(""),await x(t),x(n)}catch(kT){g(kT instanceof Error?kT.message:"Failed to create folder")}finally{y(!1)}}},S=t.split("/").filter(Boolean);return ee.jsxs("div",{className:"flex flex-col h-64 border rounded-md overflow-hidden",children:[ee.jsxs("div",{className:"flex items-center gap-1 px-2 py-2 bg-muted border-b flex-shrink-0",children:[ee.jsx(Nk,{variant:"ghost",size:"sm",className:"h-6 px-1 flex-shrink-0",onClick:()=>{x()},title:"Home",children:ee.jsx(ej,{className:"h-3 w-3"})}),ee.jsx("div",{className:"flex items-center gap-1 flex-1 overflow-x-auto min-w-0",children:S.map((e,t)=>ee.jsxs(H.Fragment,{children:[ee.jsx(WE,{className:"h-3 w-3 text-muted-foreground flex-shrink-0"}),ee.jsx("button",{className:"text-xs hover:text-foreground text-muted-foreground whitespace-nowrap",onClick:()=>(e=>{const t="/"+S.slice(0,e+1).join("/");x(t)})(t),children:e})]},t))}),ee.jsxs(Nk,{variant:"ghost",size:"sm",className:"h-6 px-1.5 flex-shrink-0 gap-1 text-xs",onClick:()=>{h(""),g(null),f(!0)},disabled:d||s||!!u,title:"New folder",children:[ee.jsx(qE,{className:"h-3.5 w-3.5"}),ee.jsx("span",{className:"hidden sm:inline",children:"New folder"})]})]}),ee.jsxs("div",{className:"flex-1 overflow-y-auto",children:[s&&ee.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading..."}),u&&ee.jsx("div",{className:"flex items-center justify-center h-full text-sm text-destructive px-4 text-center",children:u}),!s&&!u&&ee.jsxs("div",{className:"p-1",children:[r&&ee.jsxs("button",{className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded hover:bg-accent hover:text-accent-foreground",onClick:()=>{x(r)},children:[ee.jsx(VE,{className:"h-4 w-4 text-muted-foreground"}),ee.jsx("span",{children:".."})]}),d&&ee.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5",children:[ee.jsx(XE,{className:"h-4 w-4 text-blue-500 flex-shrink-0"}),ee.jsx("input",{ref:b,className:ik("flex-1 text-sm bg-background border rounded px-1.5 py-0.5 outline-none","focus:ring-1 focus:ring-ring",m&&"border-destructive"),placeholder:"Folder name",value:p,onChange:e=>{h(e.target.value),g(null)},onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),k()):"Escape"===e.key&&w()},disabled:v}),ee.jsx("button",{className:"p-1 rounded hover:bg-accent disabled:opacity-50",onClick:()=>{k()},disabled:!p.trim()||v,title:"Create",children:ee.jsx(UE,{className:"h-3.5 w-3.5 text-green-600"})}),ee.jsx("button",{className:"p-1 rounded hover:bg-accent",onClick:w,disabled:v,title:"Cancel",children:ee.jsx(xj,{className:"h-3.5 w-3.5 text-muted-foreground"})})]}),m&&ee.jsx("p",{className:"px-3 pb-1 text-xs text-destructive",children:m}),0===a.length&&!d&&ee.jsx("div",{className:"text-sm text-muted-foreground px-2 py-4 text-center",children:"Empty directory"}),a.map(e=>ee.jsxs("button",{className:ik("flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded text-left","dir"===e.type?"hover:bg-accent hover:text-accent-foreground cursor-pointer":"opacity-40 cursor-not-allowed"),onClick:()=>{"dir"===e.type&&x(e.path)},disabled:"file"===e.type,children:["dir"===e.type?ee.jsx(XE,{className:"h-4 w-4 text-blue-500 flex-shrink-0"}):ee.jsx(YE,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),ee.jsx("span",{className:"truncate",children:e.name})]},e.path))]})]}),ee.jsxs("div",{className:"border-t px-3 py-2 flex items-center justify-between gap-2 flex-shrink-0 bg-background",children:[ee.jsx("span",{className:"text-xs text-muted-foreground truncate flex-1",children:t}),ee.jsx(Nk,{size:"sm",onClick:()=>e(t),disabled:!t,children:"Select this folder"})]})]})}const kN=[{value:"claude",label:"Claude",desc:"Anthropic Claude Code CLI"},{value:"opencode",label:"OpenCode",desc:"OpenCode CLI (sst/opencode)"},{value:"codex",label:"Codex",desc:"OpenAI Codex CLI"},{value:"qwen",label:"Qwen",desc:"Qwen Code CLI (QwenLM)"},{value:"gemini",label:"Gemini",desc:"Google Gemini CLI"},{value:"terminal",label:"Terminal",desc:"Plain shell (no AI CLI)"}],SN={claude:{limited:"claude",unlimited:"claude --dangerously-skip-permissions"},opencode:{limited:"opencode",unlimited:"opencode --dangerously-skip-permissions"},codex:{limited:"codex",unlimited:"codex --ask-for-approval never --sandbox danger-full-access"},qwen:{limited:"qwen-code",unlimited:"qwen-code --yolo"},gemini:{limited:"gemini",unlimited:"gemini --yolo"},terminal:{limited:"$SHELL (interactive)",unlimited:"$SHELL (interactive)"}};function EN({open:e,onOpenChange:t,onCreated:n}){const[r,o]=W.useState("name"),[a,i]=W.useState(""),[s,l]=W.useState(""),[u,c]=W.useState("claude"),[d,f]=W.useState("limited"),[p,h]=W.useState(!1),[m,g]=W.useState(null),v=e=>{e||(o("name"),i(""),l(""),c("claude"),f("limited"),g(null),h(!1)),t(e)},y=()=>{a.trim()?(g(null),o("folder")):g("Please enter a project name")},b=["name","folder","settings"];return ee.jsx(UP,{open:e,onOpenChange:v,children:ee.jsxs(GP,{className:"sm:max-w-lg",children:[ee.jsxs(YP,{children:[ee.jsx(qP,{children:{name:"New Project — Name",folder:"New Project — Select Folder",settings:"New Project — Settings"}[r]}),ee.jsxs(XP,{children:["name"===r&&"Give your project a name.","folder"===r&&"Choose the working directory for this project.","settings"===r&&"Choose the AI coding tool and run mode."]})]}),ee.jsx("div",{className:"flex gap-2 mb-2",children:b.map((e,t)=>ee.jsx("div",{className:"h-1.5 flex-1 rounded-full "+(r===e?"bg-primary":b.indexOf(r)>t?"bg-primary/40":"bg-muted")},e))}),"name"===r&&ee.jsxs("div",{className:"space-y-4",children:[ee.jsxs("div",{className:"space-y-2",children:[ee.jsx(_k,{htmlFor:"project-name",children:"Project Name"}),ee.jsx(Tk,{id:"project-name",placeholder:"My Project",value:a,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key&&y()},autoFocus:!0})]}),m&&ee.jsx("p",{className:"text-sm text-destructive",children:m})]}),"folder"===r&&ee.jsxs("div",{className:"space-y-2",children:[ee.jsx(_k,{children:"Working Directory"}),ee.jsx(wN,{onSelect:e=>{l(e),o("settings")}})]}),"settings"===r&&ee.jsxs("div",{className:"space-y-5",children:[ee.jsxs("div",{className:"space-y-2",children:[ee.jsx(_k,{children:"AI Coding Tool"}),ee.jsx("div",{className:"grid grid-cols-2 gap-2",children:kN.map(e=>ee.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer p-3 rounded-md border transition-colors "+(u===e.value?"border-primary bg-primary/5":"hover:bg-accent"),children:[ee.jsx("input",{type:"radio",name:"cliTool",value:e.value,checked:u===e.value,onChange:()=>c(e.value),className:"accent-primary"}),ee.jsxs("div",{children:[ee.jsx("div",{className:"font-medium text-sm",children:e.label}),ee.jsx("div",{className:"text-xs text-muted-foreground",children:e.desc})]})]},e.value))})]}),"terminal"!==u&&ee.jsxs("div",{className:"space-y-2",children:[ee.jsx(_k,{children:"Permission Mode"}),ee.jsxs("div",{className:"space-y-2",children:[ee.jsxs("label",{className:"flex items-start gap-3 cursor-pointer p-3 rounded-md border hover:bg-accent transition-colors",children:[ee.jsx("input",{type:"radio",name:"permissionMode",value:"limited",checked:"limited"===d,onChange:()=>f("limited"),className:"mt-0.5"}),ee.jsxs("div",{children:[ee.jsx("div",{className:"font-medium text-sm",children:"Limited"}),ee.jsxs("div",{className:"text-xs text-muted-foreground",children:["Runs ",ee.jsx("code",{className:"bg-muted px-1 rounded",children:SN[u].limited})," — asks for permission before file changes."]})]})]}),ee.jsxs("label",{className:"flex items-start gap-3 cursor-pointer p-3 rounded-md border hover:bg-accent transition-colors",children:[ee.jsx("input",{type:"radio",name:"permissionMode",value:"unlimited",checked:"unlimited"===d,onChange:()=>f("unlimited"),className:"mt-0.5"}),ee.jsxs("div",{children:[ee.jsx("div",{className:"font-medium text-sm",children:"Unlimited"}),ee.jsxs("div",{className:"text-xs text-muted-foreground",children:["Runs ",ee.jsx("code",{className:"bg-muted px-1 rounded",children:SN[u].unlimited})," — acts autonomously."]})]})]})]})]}),ee.jsxs("div",{className:"text-xs text-muted-foreground",children:[ee.jsx("span",{className:"font-medium",children:"Folder:"})," ",ee.jsx("span",{className:"font-mono",children:s})]}),m&&ee.jsx("p",{className:"text-sm text-destructive",children:m})]}),ee.jsxs(KP,{children:["name"!==r&&ee.jsx(Nk,{variant:"outline",onClick:()=>o("settings"===r?"folder":"name"),disabled:p,children:"Back"}),"name"===r&&ee.jsx(Nk,{onClick:y,children:"Next"}),"folder"===r&&ee.jsx(Nk,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),"settings"===r&&ee.jsx(Nk,{onClick:()=>{(async()=>{h(!0),g(null);try{const e=await rS({name:a.trim(),folderPath:s,permissionMode:d,cliTool:u});n(e),v(!1)}catch(kT){g(kT instanceof Error?kT.message:"Failed to create project")}finally{h(!1)}})()},disabled:p,children:p?"Creating...":"Create Project"})]})]})})}function jN({open:e,onOpenChange:t,onOpened:n}){const[r,o]=W.useState(""),[a,i]=W.useState(!1),[s,l]=W.useState(null),u=e=>{e||(o(""),l(null),i(!1)),t(e)};return ee.jsx(UP,{open:e,onOpenChange:u,children:ee.jsxs(GP,{className:"sm:max-w-lg",children:[ee.jsxs(YP,{children:[ee.jsx(qP,{children:"Open Existing Project"}),ee.jsxs(XP,{children:["Select a folder that contains a ",ee.jsx("code",{className:"bg-muted px-1 rounded text-xs",children:".ccweb/"})," configuration. The project's history and settings will be restored."]})]}),ee.jsxs("div",{className:"space-y-2",children:[ee.jsx(_k,{children:"Project Folder"}),ee.jsx(wN,{onSelect:e=>{(async e=>{o(e),i(!0),l(null);try{const t=await oS(e);n(t),u(!1)}catch(kT){l(kT instanceof Error?kT.message:"Failed to open project"),i(!1)}})(e)}})]}),s&&ee.jsx("p",{className:"text-sm text-destructive",children:s}),r&&!s&&a&&ee.jsxs("p",{className:"text-sm text-muted-foreground",children:["Opening project from ",r,"..."]}),ee.jsx(KP,{children:ee.jsx(Nk,{variant:"outline",onClick:()=>u(!1),disabled:a,children:"Cancel"})})]})})}const CN={feedback:{main:"#4a6cf7",light:"#6b8cff"},user:{main:"#22c55e",light:"#5ee87a"},project:{main:"#f59e0b",light:"#fbbf4e"},reference:{main:"#a78bfa",light:"#c4b5fd"}};function PN({balls:e,selectedId:t,activeCapacity:n,onClose:r}){var o;const[a,i]=W.useState(t),[s,l]=W.useState(new Map),u=W.useRef(null);W.useEffect(()=>{const e=e=>{"Escape"===e.key&&r()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[r]);const c=500,d=510,f=475,p=W.useMemo(()=>e.map(e=>Math.min(50,Math.max(24,16+.4*e.summary.length))),[e]),h=e.map(e=>`${e.id}:${e.buoyancy.toFixed(2)}`).join(",");W.useEffect(()=>{var t;null==(t=u.current)||t.call(u),u.current=null;let n=!1;return fd(()=>import("./matter-DKUW5u87.js").then(e=>e.m),[]).then(t=>{if(n)return;const{Engine:r,Runner:o,Bodies:a,Composite:i,Body:s,Events:c}=t,h=r.create({gravity:{x:0,y:.8,scale:.001}}),m=30,g={isStatic:!0,restitution:.2,friction:.05},v=a.rectangle(300,10,270,m,g),y=a.rectangle(300,490,570,m,g),b=-150,x=Math.sqrt(225e3)+m,w=Math.atan2(450,b),k=a.rectangle(120,250,x,15,{...g,angle:w}),S=Math.sqrt(225e3)+m,E=Math.atan2(450,150),j=a.rectangle(480,250,S,15,{...g,angle:E}),C=new Array(e.length),P=[],N=e.map((e,t)=>t).sort((t,n)=>e[n].buoyancy-e[t].buoyancy);i.add(h.world,[v,y,k,j]),N.forEach((t,r)=>{const o=setTimeout(()=>{if(n)return;const r=p[t]/2,o=300+(Math.random()-.5)*d*.3,s=f-r-5,l=a.circle(o,s,r,{restitution:.2,friction:.01,frictionAir:.02,label:e[t].id});C[t]=l,i.add(h.world,l)},100*r);P.push(o)}),c.on(h,"beforeUpdate",()=>{for(let t=0;t<e.length;t++){const n=C[t];n&&s.applyForce(n,n.position,{x:0,y:-.001*e[t].buoyancy*n.mass})}});const T=o.create();let M;o.run(T,h);const R=()=>{const t=new Map;for(let n=0;n<e.length;n++){const r=C[n];r&&t.set(e[n].id,{x:r.position.x,y:r.position.y})}l(t),M=requestAnimationFrame(R)};M=requestAnimationFrame(R),u.current=()=>{P.forEach(clearTimeout),cancelAnimationFrame(M),o.stop(T),c.off(h,"beforeUpdate"),i.clear(h.world,!1),r.clear(h)}}),()=>{var e;n=!0,null==(e=u.current)||e.call(u),u.current=null}},[h,n]);const m=e.find(e=>e.id===a),g=Math.min(n,e.length);return ee.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:r,children:ee.jsxs("div",{className:"relative bg-background border border-border rounded-xl shadow-2xl overflow-hidden",style:{width:Math.min(640,window.innerWidth-40),height:Math.min(620,window.innerHeight-40)},onClick:e=>e.stopPropagation(),children:[ee.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border",children:[ee.jsx("span",{className:"text-sm font-medium",children:"记忆池全景"}),ee.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[ee.jsxs("span",{className:"flex items-center gap-1",children:[ee.jsx("span",{className:"w-2 h-2 rounded-full bg-blue-500 inline-block"})," feedback"]}),ee.jsxs("span",{className:"flex items-center gap-1",children:[ee.jsx("span",{className:"w-2 h-2 rounded-full bg-green-500 inline-block"})," user"]}),ee.jsxs("span",{className:"flex items-center gap-1",children:[ee.jsx("span",{className:"w-2 h-2 rounded-full bg-yellow-500 inline-block"})," project"]}),ee.jsxs("span",{className:"flex items-center gap-1",children:[ee.jsx("span",{className:"w-2 h-2 rounded-full bg-purple-400 inline-block"})," reference"]}),ee.jsx("button",{onClick:r,"aria-label":"关闭",className:"ml-2 text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-blue-500 rounded",children:ee.jsx(xj,{className:"w-4 h-4"})})]})]}),ee.jsxs("svg",{width:"100%",height:c,viewBox:"0 0 600 500",children:[ee.jsx("path",{d:"M 195 25 L 405 25 L 555 475 L 45 475 Z",fill:"none",className:"stroke-border",strokeWidth:1.5,strokeLinejoin:"round",opacity:.5}),ee.jsx("line",{x1:199,y1:27,x2:401,y2:27,className:"stroke-blue-500/30",strokeWidth:2}),e.map(e=>e.links.map(t=>{const n=s.get(e.id),r=s.get(t);return n&&r?ee.jsx("line",{x1:n.x,y1:n.y,x2:r.x,y2:r.y,stroke:"#4a6cf744",strokeWidth:1,strokeDasharray:"4,4"},`${e.id}-${t}`):null})),e.map((e,t)=>{const n=s.get(e.id);if(!n)return null;const r=p[t],o=t<g,l=e.id===a,u=CN[e.type]??CN.reference;return ee.jsxs("g",{onClick:()=>i(e.id),className:"cursor-pointer",opacity:o?1:.35,children:[ee.jsx("circle",{cx:n.x,cy:n.y,r:r/2,fill:`url(#grad-${e.type})`,stroke:l?"currentColor":"none",strokeWidth:l?2:0}),r>30&&ee.jsx("text",{x:n.x,y:n.y,textAnchor:"middle",dominantBaseline:"central",fill:"#fff",fontSize:Math.max(9,.15*r),pointerEvents:"none",children:e.summary.slice(0,Math.floor(r/5))}),l&&ee.jsx("circle",{cx:n.x,cy:n.y,r:r/2+4,fill:"none",stroke:u.main,strokeWidth:1.5,opacity:.6})]},e.id)}),ee.jsx("defs",{children:Object.entries(CN).map(([e,{main:t,light:n}])=>ee.jsxs("radialGradient",{id:`grad-${e}`,cx:"35%",cy:"35%",children:[ee.jsx("stop",{offset:"0%",stopColor:n}),ee.jsx("stop",{offset:"100%",stopColor:t})]},e))})]}),m&&ee.jsxs("div",{className:"absolute bottom-0 left-0 right-0 px-4 py-2 bg-background/95 border-t border-border",children:[ee.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[ee.jsx("span",{className:"text-[10px] px-1 py-px rounded text-white",style:{backgroundColor:(null==(o=CN[m.type])?void 0:o.main)??"#888"},children:m.type}),m.permanent&&ee.jsx("span",{className:"text-[10px] px-1 py-px rounded bg-orange-500/20 text-orange-400",children:"permanent"}),ee.jsx("span",{className:"text-xs font-medium text-foreground",children:m.summary})]}),ee.jsxs("div",{className:"flex gap-3 text-[10px] text-muted-foreground",children:[ee.jsxs("span",{children:["B=",m.buoyancy.toFixed(1)]}),ee.jsxs("span",{children:["H=",m.H]}),ee.jsxs("span",{children:["硬度=",m.hardness]}),m.links.length>0&&ee.jsxs("span",{children:["连线: ",m.links.join(", ")]})]})]})]})})}function NN(e,t){uN.success(`项目「${t}」的任务已完成`,{duration:1/0,action:{label:"查看",onClick:()=>{window.location.href=`/projects/${e}`}}})}const TN=`${"https:"===window.location.protocol?"wss:":"ws:"}//${window.location.host}`,MN=3e3;function RN(e,t){const n=W.useRef(null),r=W.useRef(0),o=W.useRef(!0),a=W.useRef(!1),i=W.useRef(null),s=W.useRef(t);s.current=t;const l=W.useRef(!1),u=W.useCallback(e=>{var t;(null==(t=n.current)?void 0:t.readyState)===WebSocket.OPEN&&n.current.send(JSON.stringify(e))},[]),c=W.useCallback((e,t)=>{var r;(null==(r=n.current)?void 0:r.readyState)===WebSocket.OPEN?(n.current.send(JSON.stringify({type:"terminal_subscribe",cols:e,rows:t})),l.current=!1):l.current=!0},[]),d=W.useCallback(e=>{u({type:"terminal_input",data:e})},[u]),f=W.useCallback((e,t)=>{u({type:"terminal_resize",cols:e,rows:t})},[u]),p=W.useCallback(()=>{u({type:"chat_subscribe"})},[u]),h=W.useCallback(()=>{if(!o.current)return;if(a.current)return;const t=qk();if(!t)return void(window.location.href="/login");a.current=!0;const u=new WebSocket(`${TN}/ws/projects/${e}`);n.current=u,u.onopen=()=>{a.current=!1,r.current=0,u.send(JSON.stringify({type:"auth",token:t}))},u.onmessage=e=>{var t,n,r,o,a,i,u,c,d,f,p,h,m,g,v,y,b,x,w,k;let S;try{S=JSON.parse(e.data)}catch{return}switch(S.type){case"connected":l.current=!1,null==(n=(t=s.current).onConnected)||n.call(t);break;case"terminal_data":null==(o=(r=s.current).onTerminalData)||o.call(r,S.data);break;case"status":null==(i=(a=s.current).onStatus)||i.call(a,S.status);break;case"chat_message":{const e=S;null==(c=(u=s.current).onChatMessage)||c.call(u,e);break}case"project_stopped":{const e=S;null==(f=(d=s.current).onProjectStopped)||f.call(d,e.projectId,e.projectName);break}case"plan_status":null==(h=(p=s.current).onPlanStatus)||h.call(p,S);break;case"plan_node_update":null==(g=(m=s.current).onPlanNodeUpdate)||g.call(m,S);break;case"plan_nudge":null==(y=(v=s.current).onPlanNudge)||y.call(v,S);break;case"plan_replan":null==(x=(b=s.current).onPlanReplan)||x.call(b,S);break;case"context_update":null==(k=(w=s.current).onContextUpdate)||k.call(w,S);break;case"error":console.error("[WS] Server error:",S.message)}},u.onclose=()=>{a.current=!1,n.current===u&&(n.current=null),o.current&&r.current<5&&(r.current++,i.current=window.setTimeout(h,MN))},u.onerror=e=>{a.current=!1,console.error("[WS] WebSocket error:",e)}},[e]);return W.useEffect(()=>(o.current=!0,h(),()=>{var e;o.current=!1,i.current&&(clearTimeout(i.current),i.current=null),null==(e=n.current)||e.close(),n.current=null}),[h]),{subscribeTerminal:c,sendTerminalInput:d,sendTerminalResize:f,subscribeChatMessages:p}}function LN(e){const t=W.useRef(null),n=W.useRef(0),r=W.useRef(!0),o=W.useRef(!1),a=W.useRef(null),i=W.useRef(e);i.current=e;const s=W.useCallback(()=>{if(!r.current)return;if(o.current)return;const e=qk();if(!e)return;o.current=!0;const l=new WebSocket(`${TN}/ws/dashboard`);t.current=l,l.onopen=()=>{o.current=!1,n.current=0,l.send(JSON.stringify({type:"auth",token:e}))},l.onmessage=e=>{var t,n;try{const r=JSON.parse(e.data);"activity_update"===r.type?i.current.onActivityUpdate(r):"project_stopped"===r.type&&(null==(n=(t=i.current).onProjectStopped)||n.call(t,r.projectId,r.projectName))}catch{}},l.onclose=()=>{o.current=!1,t.current===l&&(t.current=null),r.current&&n.current<5&&(n.current++,a.current=window.setTimeout(s,MN))},l.onerror=e=>{o.current=!1,console.error("[DashboardWS] Error:",e)}},[]);W.useEffect(()=>(r.current=!0,s(),()=>{var e;r.current=!1,a.current&&(clearTimeout(a.current),a.current=null),null==(e=t.current)||e.close(),t.current=null}),[s])}function DN({projectId:e,enabled:t,onChatMessage:n,onStatusChange:r,onContextUpdate:o}){const a=W.useRef(null),i=W.useRef(!0),s=W.useRef(0),l=W.useRef(null),u=W.useRef(!1),c=W.useRef(!1),d=W.useRef([]),f=W.useRef({onChatMessage:n,onStatusChange:r,onContextUpdate:o});f.current={onChatMessage:n,onStatusChange:r,onContextUpdate:o};const p=W.useCallback(()=>{if(c.current&&a.current&&a.current.readyState===WebSocket.OPEN)for(;d.current.length>0;){const e=d.current.shift();a.current.send(JSON.stringify({type:"terminal_input",data:e}))}},[]),h=W.useCallback(e=>{var t;c.current&&(null==(t=a.current)?void 0:t.readyState)===WebSocket.OPEN?a.current.send(JSON.stringify({type:"terminal_input",data:e})):d.current.push(e)},[]),m=W.useCallback(()=>{if(!i.current||!t)return;if(u.current)return;const n=qk();if(!n)return;u.current=!0,c.current=!1;const r=new WebSocket(`${TN}/ws/projects/${e}`);a.current=r,r.onopen=()=>{u.current=!1,s.current=0,r.send(JSON.stringify({type:"auth",token:n}))},r.onmessage=e=>{var t,n,o,a,i,s;try{const l=JSON.parse(e.data);"connected"===l.type?(r.send(JSON.stringify({type:"chat_subscribe"})),c.current=!0,p()):"chat_message"===l.type?f.current.onChatMessage(l):"status"===l.type&&l.status?null==(n=(t=f.current).onStatusChange)||n.call(t,l.status):"project_stopped"===l.type?null==(a=(o=f.current).onStatusChange)||a.call(o,"stopped"):"context_update"===l.type&&(null==(s=(i=f.current).onContextUpdate)||s.call(i,l))}catch{}},r.onclose=()=>{if(u.current=!1,c.current=!1,a.current===r&&(a.current=null),i.current&&t)if(s.current<5){s.current++;const e=2e3*Math.random();l.current=window.setTimeout(m,MN+e)}else d.current.length>0&&(console.warn("[MonitorWS] Retries exhausted, dropping",d.current.length,"queued messages"),d.current=[])},r.onerror=()=>{u.current=!1}},[e,t,p]);return W.useEffect(()=>(i.current=!0,()=>{i.current=!1,d.current=[]}),[]),W.useEffect(()=>(s.current=0,t&&m(),()=>{var e;c.current=!1,l.current&&(clearTimeout(l.current),l.current=null),null==(e=a.current)||e.close(),a.current=null}),[m,t]),{sendInput:h}}const _N=18e6,AN=6048e5;function ON(e,t=18e6){if(!e||void 0===e.utilization||e.utilization<=0||!e.resetAt)return null;const n=new Date(e.resetAt).getTime()-Date.now();if(n<=0)return null;const r=t-n;return r<=0?null:Math.round(e.utilization/(r/t))}function IN({label:e,bucket:t}){if(!t||void 0===t.utilization)return null;const n=t.utilization,r=n<50?"text-green-400":n<80?"text-yellow-400":"text-red-400",o=function(e){if(!e)return"";const t=new Date(e).getTime()-Date.now();if(t<=0)return"即将重置";const n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);return n>0?`${n}h${r}m`:`${r}m`}(t.resetAt);return ee.jsxs("span",{className:"text-muted-foreground whitespace-nowrap",children:[e," ",ee.jsxs("span",{className:ik("font-medium",r),children:[n,"%"]}),o&&ee.jsxs("span",{className:"text-muted-foreground/70 ml-0.5",children:["(",o,")"]})]})}function zN({className:e}){const[t,n]=W.useState("loading"),[r,o]=W.useState(!1),a=()=>Vk(Fk.usageMonitorTool,"claude");W.useEffect(()=>{const e=async()=>{try{n(await kS(a()))}catch{n(null)}};e();const t=setInterval(()=>{e()},3e5),r=()=>{e()},o=t=>{t.key===Fk.usageMonitorTool&&e()};return window.addEventListener("ccweb:usage-tool-change",r),window.addEventListener("storage",o),()=>{clearInterval(t),window.removeEventListener("ccweb:usage-tool-change",r),window.removeEventListener("storage",o)}},[]);if("loading"===t)return null;if(!t)return null;const i=!!t.fiveHour,s=!!t.sevenDay,l=!!t.sevenDaySonnet,u=!!t.sevenDayOpus,c=i||s||l||u,d=ON(t.fiveHour,_N),f=ON(t.sevenDay,AN),p=ON(t.sevenDaySonnet,AN),h=null!==d||null!==f||null!==p;return ee.jsxs("div",{className:ik("flex items-center gap-1.5 text-xs",e),children:[h&&ee.jsxs("span",{className:"flex items-center gap-1",children:[null!==d&&ee.jsxs("span",{className:ik("font-medium",d<=100?"text-green-400":"text-orange-400"),title:`5h 配速:按当前速率,窗口结束时预计使用 ${d}%`,children:[d,"%"]}),null!==f&&ee.jsxs(ee.Fragment,{children:[ee.jsx("span",{className:"text-muted-foreground/40",children:"/"}),ee.jsxs("span",{className:ik("font-medium",f<=100?"text-green-400":"text-orange-400"),title:`7d 配速:按当前速率,窗口结束时预计使用 ${f}%`,children:[f,"%"]})]}),null!==p&&ee.jsxs(ee.Fragment,{children:[ee.jsx("span",{className:"text-muted-foreground/40",children:"/"}),ee.jsxs("span",{className:ik("font-medium",p<=100?"text-green-400":"text-orange-400"),title:`7d Sonnet 配速:按当前速率,窗口结束时预计使用 ${p}%`,children:[p,"%"]})]})]}),t.planName&&ee.jsx("span",{className:"font-medium text-foreground bg-muted border border-border px-2 py-0.5 rounded-full",children:t.planName}),c&&ee.jsxs(ee.Fragment,{children:[ee.jsx("span",{className:"text-muted-foreground/50",children:"|"}),ee.jsx(IN,{label:"5h",bucket:t.fiveHour}),s&&ee.jsxs(ee.Fragment,{children:[ee.jsx("span",{className:"text-muted-foreground/50",children:"·"}),ee.jsx(IN,{label:"7d",bucket:t.sevenDay})]}),l&&ee.jsxs(ee.Fragment,{children:[ee.jsx("span",{className:"text-muted-foreground/50",children:"·"}),ee.jsx(IN,{label:"7d Sonnet",bucket:t.sevenDaySonnet})]}),u&&ee.jsxs(ee.Fragment,{children:[ee.jsx("span",{className:"text-muted-foreground/50",children:"·"}),ee.jsx(IN,{label:"7d Opus",bucket:t.sevenDayOpus})]})]}),ee.jsx("button",{onClick:()=>{(async()=>{o(!0);try{n(await SS(a()))}catch{n(null)}finally{o(!1)}})()},className:"text-muted-foreground hover:text-foreground transition-colors",title:"刷新用量信息",children:ee.jsx(dj,{className:ik("h-3 w-3",r&&"animate-spin")})})]})}function FN(){const[e,t]=W.useState([]),[n,r]=W.useState(!1),[o,a]=W.useState(""),[i,s]=W.useState(""),[l,u]=W.useState(""),[c,d]=W.useState(null),[f,p]=W.useState(""),[h,m]=W.useState(""),[g,v]=W.useState(""),y=W.useRef(null),b=W.useRef(null);W.useEffect(()=>{dS().then(t).catch(()=>t([]))},[]),W.useEffect(()=>{n&&setTimeout(()=>{var e;return null==(e=y.current)?void 0:e.focus()},0)},[n]),W.useEffect(()=>{c&&setTimeout(()=>{var e;return null==(e=b.current)?void 0:e.focus()},0)},[c]);const x=async()=>{const e=i.trim();if(e)try{const n=await fS({label:o.trim()||e,command:e,...l?{parentId:l}:{}});t(e=>[...e,n]),a(""),s(""),u(""),r(!1)}catch(kT){console.error("[GlobalShortcuts] Failed to add:",kT)}},w=async()=>{const e=h.trim();if(e&&c)try{const n=await pS(c,{label:f.trim()||e,command:e,parentId:g||null});t(e=>e.map(e=>e.id===c?n:e)),d(null)}catch(kT){console.error("[GlobalShortcuts] Failed to save:",kT)}};return ee.jsxs("section",{className:"mt-10",children:[ee.jsxs("div",{className:"flex items-center justify-between mb-4",children:[ee.jsxs("div",{className:"flex items-center gap-2",children:[ee.jsx(wj,{className:"h-4 w-4 text-muted-foreground"}),ee.jsx("h2",{className:"text-lg font-semibold",children:"全局快捷命令"}),ee.jsx("span",{className:"text-xs text-muted-foreground",children:"在所有项目的终端中可用"})]}),ee.jsxs("button",{onClick:()=>{r(e=>!e),d(null)},className:ik("flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-md border transition-colors",n?"border-border text-foreground bg-muted":"border-border text-muted-foreground hover:text-foreground hover:bg-muted"),children:[ee.jsx(cj,{className:"h-3.5 w-3.5"}),"新建"]})]}),n&&ee.jsxs("div",{className:"mb-4 p-4 rounded-lg border border-border bg-background space-y-3",children:[ee.jsx("input",{ref:y,placeholder:"名称(可选)",value:o,onChange:e=>a(e.target.value),className:"w-full text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground placeholder:text-muted-foreground outline-none focus:border-border transition-colors"}),ee.jsx("textarea",{placeholder:"命令内容…",value:i,onChange:e=>s(e.target.value),rows:3,className:"w-full text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground placeholder:text-muted-foreground font-mono outline-none focus:border-border transition-colors resize-none",onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),x()),"Escape"===e.key&&(r(!1),a(""),s(""),u(""))}}),ee.jsxs("div",{className:"flex items-center gap-2",children:[ee.jsx(QE,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),ee.jsxs("select",{value:l,onChange:e=>u(e.target.value),className:"flex-1 text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground outline-none focus:border-border transition-colors",children:[ee.jsx("option",{value:"",children:"无继承"}),e.map(e=>ee.jsx("option",{value:e.id,children:e.label},e.id))]})]}),ee.jsxs("div",{className:"flex items-center justify-between",children:[ee.jsx("span",{className:"text-xs text-muted-foreground",children:"⌘↩ 保存 · Esc 取消"}),ee.jsxs("div",{className:"flex gap-2",children:[ee.jsx("button",{onClick:()=>{r(!1),a(""),s("")},className:"text-sm px-3 py-1 rounded bg-secondary hover:bg-accent text-foreground transition-colors",children:"取消"}),ee.jsx("button",{onClick:()=>{x()},disabled:!i.trim(),className:ik("text-sm px-3 py-1 rounded transition-colors text-white",i.trim()?"bg-blue-600 hover:bg-blue-500":"bg-secondary opacity-40 cursor-not-allowed"),children:"保存"})]})]})]}),0!==e.length||n?ee.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:e.map(n=>c===n.id?ee.jsxs("div",{className:"rounded-lg border border-border bg-background p-3 space-y-2",children:[ee.jsx("input",{ref:b,value:f,onChange:e=>p(e.target.value),placeholder:"名称(可选)",className:"w-full text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground placeholder:text-muted-foreground outline-none focus:border-border transition-colors"}),ee.jsx("textarea",{value:h,onChange:e=>m(e.target.value),rows:3,className:"w-full text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground font-mono outline-none focus:border-border transition-colors resize-none",onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),w()),"Escape"===e.key&&d(null)}}),ee.jsxs("div",{className:"flex items-center gap-2",children:[ee.jsx(QE,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),ee.jsxs("select",{value:g,onChange:e=>v(e.target.value),className:"flex-1 text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground outline-none focus:border-border transition-colors",children:[ee.jsx("option",{value:"",children:"无继承"}),e.filter(e=>e.id!==n.id).map(e=>ee.jsx("option",{value:e.id,children:e.label},e.id))]})]}),ee.jsxs("div",{className:"flex gap-2 justify-end",children:[ee.jsx("button",{onClick:()=>d(null),className:"text-xs px-2.5 py-1 rounded bg-secondary hover:bg-accent text-foreground transition-colors",children:"取消"}),ee.jsx("button",{onClick:()=>{w()},disabled:!h.trim(),className:ik("text-xs px-2.5 py-1 rounded transition-colors text-white",h.trim()?"bg-blue-600 hover:bg-blue-500":"bg-secondary opacity-40 cursor-not-allowed"),children:"保存"})]})]},n.id):ee.jsxs("div",{className:"group relative rounded-lg border border-border bg-background hover:border-muted-foreground/30 transition-colors p-3",children:[ee.jsx("div",{className:"text-sm font-medium text-foreground truncate pr-14",children:n.label}),n.parentId&&(()=>{const t=e.find(e=>e.id===n.parentId);return t?ee.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[ee.jsx(QE,{className:"h-3 w-3 text-muted-foreground"}),ee.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["继承: ",t.label]})]}):null})(),!n.parentId&&n.label!==n.command&&ee.jsx("div",{className:"text-xs text-muted-foreground font-mono truncate mt-1 pr-14",children:n.command}),ee.jsxs("div",{className:"absolute top-2.5 right-2.5 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[ee.jsx("button",{onClick:()=>{d(n.id),p(n.label),m(n.command),v(n.parentId||""),r(!1)},className:"p-1 rounded text-muted-foreground hover:text-blue-400 transition-colors",title:"编辑",children:ee.jsx(uj,{className:"h-3.5 w-3.5"})}),ee.jsx("button",{onClick:()=>{(async e=>{try{await hS(e),t(t=>t.filter(t=>t.id!==e)),c===e&&d(null)}catch(kT){console.error("[GlobalShortcuts] Failed to delete:",kT)}})(n.id)},className:"p-1 rounded text-muted-foreground hover:text-red-400 transition-colors",title:"删除",children:ee.jsx(xj,{className:"h-3.5 w-3.5"})})]})]},n.id))}):ee.jsxs("div",{className:"flex flex-col items-center gap-2 py-10 text-muted-foreground/50 border border-dashed border-border rounded-lg",children:[ee.jsx(wj,{className:"h-6 w-6"}),ee.jsx("p",{className:"text-sm",children:"还没有全局快捷命令"})]})]})}const VN=W.createContext({theme:"system",resolved:"dark",setTheme:()=>{}});function $N(){return W.useSyncExternalStore(e=>{const t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},()=>window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")}function BN({children:e}){const[t,n]=W.useState(()=>Vk(Fk.theme,"system")),r=$N(),o="system"===t?r:t;W.useEffect(()=>{const e=document.documentElement;e.classList.remove("light","dark"),e.classList.add(o)},[o]);return ee.jsx(VN.Provider,{value:{theme:t,resolved:o,setTheme:e=>{n(e),$k(Fk.theme,e)}},children:e})}function UN(){return W.useContext(VN)}function WN(){const{theme:e,setTheme:t}=UN(),n=[{value:"light",icon:mj,label:"浅色"},{value:"dark",icon:lj,label:"深色"},{value:"system",icon:sj,label:"系统"}];return ee.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5",children:n.map(({value:n,icon:r,label:o})=>ee.jsx("button",{onClick:()=>t(n),className:ik("p-1 rounded-sm transition-colors",e===n?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),title:o,children:ee.jsx(r,{className:"h-3.5 w-3.5"})},n))})}const HN={workMinutes:30,breakMinutes:5};function GN(){return Vk(Fk.pomodoroConfig,HN,!0)}const YN=zk(e=>({running:!1,phase:"work",secondsLeft:60*GN().workMinutes,setRunning:t=>e({running:t}),setPhase:t=>e({phase:t}),setSecondsLeft:t=>e({secondsLeft:t})}));function KN(){const{running:e,phase:t,secondsLeft:n,setPhase:r,setSecondsLeft:o}=YN(),a=W.useCallback(e=>{const t=GN();var n;r(e),o("work"===e?60*t.workMinutes:60*t.breakMinutes),n="break"===e?"休息一下 ☕":"该工作了 💻",uN.info(`番茄钟: ${n}`)},[r,o]);return W.useEffect(()=>{if(!e)return;if(0===n)return void a("work"===t?"break":"work");const r=setTimeout(()=>o(n-1),1e3);return()=>clearTimeout(r)},[e,n,t,a,o]),null}function qN(){const{running:e,phase:t,secondsLeft:n}=YN(),r=Math.floor(n/60),o=n%60,a=`${String(r).padStart(2,"0")}:${String(o).padStart(2,"0")}`;return e?ld.createPortal(ee.jsxs("div",{className:"fixed inset-0 flex flex-col items-center justify-center pointer-events-none z-40 select-none",style:{opacity:"work"===t?.1:.6},children:[ee.jsx("div",{className:ik("font-mono font-bold tabular-nums leading-none","work"===t?"text-foreground":"text-blue-400 dark:text-blue-300"),style:{fontSize:"clamp(360px, 90vw, 1100px)"},children:a}),ee.jsx("div",{className:"mt-3 text-muted-foreground font-medium tracking-widest uppercase",style:{fontSize:"clamp(12px, 1.5vw, 20px)"},children:"work"===t?"专注工作":"休息一下"})]}),document.body):null}function XN(){const{running:e,phase:t,secondsLeft:n,setRunning:r,setPhase:o,setSecondsLeft:a}=YN(),i=Math.floor(n/60),s=n%60,l=`${String(i).padStart(2,"0")}:${String(s).padStart(2,"0")}`;return ee.jsx("button",{onClick:()=>{if(e){const e=GN();o("work"),a(60*e.workMinutes)}else{const e=GN();o("work"),a(60*e.workMinutes)}r(!e)},className:ik("p-1 rounded transition-colors",e?"work"===t?"text-red-500 bg-red-500/10 hover:bg-red-500/20":"text-green-500 bg-green-500/10 hover:bg-green-500/20":"text-muted-foreground hover:text-foreground hover:bg-muted"),title:e?"work"===t?`工作中 ${l} — 点击停止`:`休息中 ${l} — 点击停止`:"启动番茄钟",children:ee.jsx(vj,{className:"h-4 w-4"})})}const QN="v1.5.145",ZN=!!window.electronUpdater;function JN(){const[e,t]=W.useState("idle"),[n,r]=W.useState(!1),[o,a]=W.useState(""),[i,s]=W.useState(0),[l,u]=W.useState([]),[c,d]=W.useState([]),[f,p]=W.useState(null),[h,m]=W.useState(null);W.useEffect(()=>{if(!window.electronUpdater)return;return window.electronUpdater.onUpdateStatus(e=>{switch(e.type){case"progress":{const t=e.info;s(Math.round((null==t?void 0:t.percent)??0));break}case"downloaded":t("downloaded");break;case"error":p(e.info||"Download failed"),t("error")}})},[]);const g=W.useCallback(async()=>{t("checking"),p(null),r(!0);try{if(ZN){const e=await window.electronUpdater.checkForUpdate();if(e.error)throw new Error(e.error);if(!e.available)return void t("no_update");a(e.version?`v${e.version}`:"new version")}else{const e=await LS();if(!e.updateAvailable)return void t("no_update");a(`v${e.latest}`)}const e=await RS();u(e.projects),t(e.runningCount>0?"confirm_prepare":"update_available")}catch(kT){p(kT instanceof Error?kT.message:"Check failed"),t("error")}},[]),v=W.useCallback(()=>{const e=3e3,n=Date.now(),r=()=>{if(Date.now()-n>3e5)return p("更新超时(5 分钟)— 请检查服务器状态"),void t("update_failed");AS().then(n=>{n?n.success?(a(n.newVersion?`v${n.newVersion}`:"new version"),t("update_complete")):(p(n.error||"Update failed"),t("update_failed")):setTimeout(r,e)}).catch(()=>{setTimeout(r,e)})};setTimeout(r,e)},[]),y=()=>{r(!1),setTimeout(()=>{t("idle"),a(""),u([]),d([]),p(null),s(0)},200)};return ee.jsxs(ee.Fragment,{children:[ee.jsx(Nk,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>{g()},disabled:"checking"===e||"preparing"===e||"downloading"===e||"executing"===e||"reconnecting"===e,title:"检查更新",children:"checking"===e||"preparing"===e||"downloading"===e||"executing"===e||"reconnecting"===e?ee.jsx(nj,{className:"h-4 w-4 animate-spin"}):ee.jsx(HE,{className:"h-4 w-4"})}),ee.jsx(UP,{open:n,onOpenChange:e=>{e||y()},children:ee.jsxs(GP,{className:"sm:max-w-md",children:[ee.jsxs(YP,{children:[ee.jsxs(qP,{children:["checking"===e&&"Checking for updates...","no_update"===e&&"Up to date","update_available"===e&&`Update ${o} available`,"confirm_prepare"===e&&"Save project memory first","preparing"===e&&"Saving project memory...","downloading"===e&&"Downloading update...","downloaded"===e&&"Update ready to install","executing"===e&&"Updating server...","reconnecting"===e&&"Waiting for server restart...","update_complete"===e&&`Updated to ${o}`,"update_failed"===e&&"Update failed","error"===e&&"Update error"]}),ee.jsxs(XP,{children:["checking"===e&&"Checking for the latest version...","no_update"===e&&`Current version ${QN} is the latest.`,"update_available"===e&&(c.length>0?"All projects saved. Sessions will auto-resume with --continue after update.":"A new version is available. "+(ZN?"Click download to update automatically.":"")),"confirm_prepare"===e&&`${l.length} project(s) running. Each Claude will be asked to save memory. Sessions will auto-resume after update.`,"preparing"===e&&"Sending save commands and waiting for Claude to finish...","downloading"===e&&`Downloading... ${i}%`,"downloaded"===e&&"The update has been downloaded. Click install to restart and apply.","executing"===e&&"Server is shutting down and installing the update. Please wait...","reconnecting"===e&&"Update installed. Waiting for server to restart...","update_complete"===e&&`Successfully updated from ${QN} to ${o}. Click reload to use the new version.`,"update_failed"===e&&(f||"Update failed. You may need to restart the server manually."),"error"===e&&(f||"An error occurred.")]})]}),"downloading"===e&&ee.jsx("div",{className:"w-full bg-muted rounded-full h-2 overflow-hidden",children:ee.jsx("div",{className:"bg-primary h-full transition-all duration-300",style:{width:`${i}%`}})}),"confirm_prepare"===e&&l.length>0&&ee.jsx("div",{className:"space-y-1 text-sm",children:l.map(e=>ee.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded bg-muted",children:[ee.jsx("span",{className:"h-2 w-2 rounded-full bg-green-500 shrink-0"}),ee.jsx("span",{className:"truncate",children:e.name})]},e.id))}),("preparing"===e||"executing"===e||"reconnecting"===e)&&ee.jsx("div",{className:"flex items-center justify-center py-6",children:ee.jsx(nj,{className:"h-8 w-8 animate-spin text-muted-foreground"})}),"update_available"===e&&c.length>0&&ee.jsx("div",{className:"space-y-1 text-sm",children:c.map(e=>ee.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded bg-muted",children:["stopped"===e.status||"ready"===e.status?ee.jsx(BE,{className:"h-4 w-4 text-green-500 shrink-0"}):ee.jsx(IE,{className:"h-4 w-4 text-yellow-500 shrink-0"}),ee.jsx("span",{className:"truncate",children:e.name}),ee.jsx("span",{className:"text-xs text-muted-foreground ml-auto shrink-0",children:e.message})]},e.id))}),ee.jsxs(KP,{children:["no_update"===e&&ee.jsx(Nk,{onClick:y,children:"OK"}),"update_available"===e&&ee.jsxs(ee.Fragment,{children:[ee.jsx(Nk,{variant:"outline",onClick:y,children:"Later"}),ee.jsx(Nk,{onClick:()=>{(async()=>{if(ZN){t("downloading"),s(0);const e=await window.electronUpdater.downloadUpdate();e.success?e.path&&m(e.path):(p(e.error||"Download failed"),t("error"))}else{t("executing");try{await _S(),t("reconnecting"),v()}catch(kT){p(kT instanceof Error?kT.message:"Execute failed"),t("error")}}})()},children:ZN?"Download & Install":`Update to ${o}`})]}),"confirm_prepare"===e&&ee.jsxs(ee.Fragment,{children:[ee.jsx(Nk,{variant:"outline",onClick:y,children:"Cancel"}),ee.jsx(Nk,{onClick:()=>{(async()=>{t("preparing");try{const e=await DS();d(e.results),t("update_available")}catch(kT){p(kT instanceof Error?kT.message:"Prepare failed"),t("error")}})()},children:"Save Memory & Continue"})]}),"downloaded"===e&&ee.jsxs(ee.Fragment,{children:[ee.jsx(Nk,{variant:"outline",onClick:y,children:"Later"}),ee.jsx(Nk,{onClick:()=>{var e;null==(e=window.electronUpdater)||e.quitAndInstall(h||void 0)},children:"Restart & Install"})]}),"update_complete"===e&&ee.jsx(Nk,{onClick:()=>window.location.reload(),children:"Reload Page"}),"update_failed"===e&&ee.jsx(Nk,{onClick:y,children:"Close"}),"error"===e&&ee.jsx(Nk,{onClick:y,children:"Close"})]})]})})]})}function eT(e){return e.filter(e=>"text"===e.type||"tool_use"===e.type||"tool_result"===e.type).map(e=>{if("tool_use"===e.type){return`[工具] ${e.content.length>60?e.content.slice(0,60)+"...":e.content}`}if("tool_result"===e.type){return`→ ${e.content.length>80?e.content.slice(0,80)+"...":e.content}`}return e.content}).join("\n")}const tT=H.memo(function({project:e,externalStatus:t,active:n=!1}){const r=cf(),[o,a]=W.useState("running"===e.status?"live":"stopped"),[i,s]=W.useState([]),[l,u]=W.useState(""),[c,d]=W.useState(!1),f=W.useRef(null),p=W.useRef(null),h=W.useRef(null),m=W.useRef(0),g=W.useCallback(async()=>{try{const t=await tE(e.id,1);if(0===t.length)return;const n=(await nE(e.id,t[0].id,"latest","user")).content.split(/(?=^## [UA]\d+)/m).filter(Boolean),r=[];for(const e of n){const t=e.match(/^## ([UA])(\d+).*\n/);if(!t)continue;const n="U"===t[1]?"user":"assistant",o=e.slice(t[0].length).trim();o&&r.push({role:n,content:o,ts:""})}s(e=>0===e.length?r.slice(-4):e)}catch{}},[e.id]);W.useEffect(()=>{"stopped"===o&&g()},[o,g]);const v=W.useRef(!1);W.useEffect(()=>{if("live"!==o)return void(v.current=!1);const e=setTimeout(()=>{v.current||g()},3e3);return()=>clearTimeout(e)},[o,g]),W.useEffect(()=>{t&&("running"!==t||"stopped"!==o&&"error"!==o?"stopped"===t&&"live"===o&&a("stopped"):(s([]),a("live")))},[t]);const y=W.useCallback(e=>{v.current=!0;const t=eT(e.blocks);t.trim()&&(s(n=>[...n,{role:e.role,content:t,ts:e.timestamp}].slice(-4)),"assistant"===e.role&&(d(!0),setTimeout(()=>d(!1),1e3)))},[]),b=W.useCallback(e=>{"stopped"===e&&a("stopped")},[]),{sendInput:x}=DN({projectId:e.id,enabled:"live"===o||"waking"===o,onChatMessage:y,onStatusChange:b});W.useEffect(()=>{if("live"===o&&f.current){const e=f.current;f.current=null,x(e+"\r")}},[o,x]),W.useEffect(()=>{var e;null==(e=p.current)||e.scrollTo({top:p.current.scrollHeight,behavior:"smooth"})},[i]),W.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const w=W.useCallback(()=>{const t=l.trim();if(t)if(u(""),"live"===o||"waking"===o)x(t+"\r");else if("stopped"===o||"error"===o){f.current=t;const n=++m.current;a("waking"),iS(e.id).then(()=>{n===m.current&&(s([]),a("live"))}).catch(e=>{n===m.current&&(uN.error(`启动失败: ${e instanceof Error?e.message:String(e)}`),a("error"),u(t),f.current=null)}),h.current=setTimeout(()=>{n===m.current&&f.current&&(uN.error("启动超时(10s)"),a("error"),u(f.current),f.current=null)},1e4)}},[l,o,e.id,x]),k="live"===o,S="stopped"===o,E="waking"===o,j=ee.jsxs("div",{className:ik("flex flex-col h-full rounded-lg overflow-hidden bg-background transition-colors duration-300",n?"border-transparent bg-transparent shadow-none":c?"border border-blue-500":"border border-border","error"===o&&"border border-red-500/50"),children:[ee.jsxs("div",{className:"flex items-center gap-1 px-1.5 py-1.5 border-b border-border bg-muted/30 transition-colors",children:[ee.jsx(JE,{className:"h-3.5 w-3.5 text-muted-foreground/40 flex-shrink-0 cursor-grab active:cursor-grabbing"}),ee.jsx("span",{className:"font-medium text-sm truncate flex-1 cursor-pointer hover:text-blue-400 transition-colors",onClick:()=>r(`/projects/${e.id}`),title:"打开项目详情",children:e.name}),ee.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:e.cliTool??"claude"}),ee.jsx("span",{className:ik("w-2 h-2 rounded-full flex-shrink-0",k?"bg-green-500":E?"bg-yellow-400 animate-pulse":"bg-zinc-400")})]}),ee.jsxs("div",{ref:p,className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-0 text-xs",children:[i.map((e,t)=>{const n="user"===e.role;return ee.jsx("div",{className:ik("flex",n?"justify-end":"justify-start"),children:ee.jsx("div",{className:ik("max-w-[85%] rounded-lg px-2.5 py-1.5 whitespace-pre-wrap break-words leading-relaxed",n?"bg-blue-500/15 text-foreground border border-blue-500/20 rounded-br-sm dark:bg-blue-500/20 dark:border-blue-500/25":"bg-secondary text-secondary-foreground border border-border rounded-bl-sm"),children:ee.jsx("div",{className:"line-clamp-6",children:e.content})})},t)}),S&&0===i.length&&ee.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground/40 text-xs",children:"无对话记录"}),E&&ee.jsx("div",{className:"flex items-center justify-center h-full text-yellow-400 text-xs animate-pulse",children:"启动中..."})]}),ee.jsx("div",{className:"border-t border-border p-1.5",children:ee.jsx("input",{type:"text",value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{"Enter"===e.key&&e.shiftKey&&(e.preventDefault(),w())},disabled:E,placeholder:E?"启动中...":S?"输入命令(自动启动)... Shift+⏎":"输入命令... Shift+⏎",className:ik("w-full bg-transparent text-xs font-mono outline-none placeholder:text-muted-foreground/40 px-1.5 py-1",E&&"opacity-50 cursor-not-allowed")})})]});return n?ee.jsx("div",{className:"card-active-glow rounded-lg h-full",children:j}):j}),nT="ccweb:monitor-order";function rT(){try{return JSON.parse(localStorage.getItem(nT)||"[]")}catch{return[]}}function oT({projects:e,projectStatuses:t,activeProjectIds:n}){const r=W.useMemo(()=>e.filter(e=>!e.archived),[e]),[o,a]=W.useState(rT),[i,s]=W.useState(null),[l,u]=W.useState(null),c=W.useRef(null),d=W.useMemo(()=>function(e,t){const n=new Map(t.map((e,t)=>[e,t]));return[...e].sort((e,t)=>{const r=n.get(e.id)??1/0,o=n.get(t.id)??1/0;return r===o?0:r-o})}(r,o),[r,o]);W.useEffect(()=>{var e;o.length>0&&(e=o,localStorage.setItem(nT,JSON.stringify(e)))},[o]);const f=W.useCallback((e,t)=>{s(t),e.dataTransfer.effectAllowed="move";const n=document.createElement("div");n.style.width="1px",n.style.height="1px",n.style.opacity="0.01",document.body.appendChild(n),e.dataTransfer.setDragImage(n,0,0),c.current=n},[]),p=W.useCallback((e,t)=>{e.preventDefault(),e.dataTransfer.dropEffect="move",u(t)},[]),h=W.useCallback((e,t)=>{if(e.preventDefault(),!i||i===t)return s(null),void u(null);const n=d.map(e=>e.id),r=n.indexOf(i),o=n.indexOf(t);if(-1===r||-1===o)return s(null),void u(null);n.splice(r,1),n.splice(o,0,i),a(n),s(null),u(null)},[i,d]),m=W.useCallback(()=>{s(null),u(null),c.current&&(c.current.remove(),c.current=null)},[]),{cols:g,rows:v}=(y=d.length)<=1?{cols:1,rows:1}:y<=2?{cols:2,rows:1}:y<=4?{cols:2,rows:2}:y<=6?{cols:3,rows:2}:y<=9?{cols:3,rows:3}:y<=12?{cols:4,rows:3}:{cols:4,rows:Math.ceil(y/4)};var y;if(0===d.length)return ee.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground/50 text-sm",children:"没有活跃项目"});const b=v<=3;return ee.jsx("div",{className:"h-full w-full p-2 gap-2 overflow-y-auto",style:{display:"grid",gridTemplateColumns:`repeat(${g}, minmax(0, 1fr))`,gridAutoRows:b?`minmax(180px, min(${Math.floor(100/v)}vh, 350px))`:"280px"},children:d.map(e=>ee.jsx("div",{draggable:!0,onDragStart:t=>f(t,e.id),onDragOver:t=>p(t,e.id),onDrop:t=>h(t,e.id),onDragEnd:m,className:ik("transition-all duration-200",i===e.id&&"opacity-40 scale-95",l===e.id&&i!==e.id&&"ring-2 ring-blue-500/50 rounded-lg"),children:ee.jsx(tT,{project:e,externalStatus:t.get(e.id),active:n.has(e.id)})},e.id))})}function aT(){const e=cf(),{projects:t,loading:n,error:r,hasFetched:o,fetchProjects:a,addProject:i,updateProject:s,removeProject:l}=Gk(),u=Wk(e=>e.clearToken),[c,d]=W.useState(!1),[f,p]=W.useState(!1),[h,m]=W.useState(new Set),g=W.useRef(new Map),[v,y]=W.useState(new Map),b=W.useRef(0),[x,w]=W.useState(!!document.fullscreenElement),[k,S]=W.useState(!1),[E,j]=Uk(Fk.monitorMode,!1,{parse:!0}),[C,P]=W.useState(new Map),[N,T]=W.useState(!1),[M,R]=W.useState(null);W.useEffect(()=>{const e=()=>w(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]),W.useEffect(()=>{a()},[a]);LN({onActivityUpdate:W.useCallback(e=>{if(e.status){const t=Gk.getState().projects.find(t=>t.id===e.projectId);t&&t.status!==e.status&&s({...t,status:e.status}),P(t=>{const n=new Map(t);return n.set(e.projectId,e.status),n})}const t=Date.now(),n=g.current;if(e.active){m(t=>t.has(e.projectId)?t:new Set(t).add(e.projectId));const r=n.get(e.projectId)??[];let o=!1;if(e.semantic){const n=r[r.length-1];`${e.semantic.phase}:${e.semantic.detail??""}`!==(n?`${n.phase}:${n.detail??""}`:"")?(r.push({id:b.current++,phase:e.semantic.phase,detail:e.semantic.detail,ts:t}),o=!0):n&&(n.ts=t)}const a=r.filter(e=>t-e.ts<8e3),i=a.length>3?a.slice(-3):a;i.length!==r.length&&(o=!0),n.set(e.projectId,i),o&&y(new Map(n))}else m(t=>{if(!t.has(e.projectId))return t;const n=new Set(t);return n.delete(e.projectId),n}),n.has(e.projectId)&&n.get(e.projectId).length>0&&(n.set(e.projectId,[]),y(new Map(n)))},[s]),onProjectStopped:W.useCallback((e,t)=>{NN(e,t)},[])}),W.useEffect(()=>{const e=setInterval(()=>{const e=Date.now(),t=g.current;let n=!1;for(const[r,o]of t){const a=o.filter(t=>e-t.ts<8e3);a.length!==o.length&&(t.set(r,a),n=!0)}n&&y(new Map(t)),m(e=>{let n=!1;const r=new Set(e);for(const o of e){const e=t.get(o);e&&0!==e.length||(r.delete(o),n=!0)}return n?r:e})},3e3);return()=>clearInterval(e)},[]);const L=W.useMemo(()=>t.filter(e=>!e.archived),[t]),D=W.useMemo(()=>t.filter(e=>e.archived),[t]),_=W.useMemo(()=>Array.from(new Set(t.flatMap(e=>e.tags??[]))),[t]),[A,O]=W.useState([]),I=W.useMemo(()=>0===A.length?L:L.filter(e=>A.some(t=>{var n;return null==(n=e.tags)?void 0:n.includes(t)})),[L,A]),[z,F]=Uk(Fk.projectOrder,[],{parse:!0}),[V,$]=W.useState(null),[B,U]=W.useState(null);W.useEffect(()=>{if(0===L.length)return;const e=L.map(e=>e.id);F(t=>{const n=[...t.filter(t=>e.includes(t)),...e.filter(e=>!t.includes(e))];return n.join(",")===t.join(",")?t:n})},[L]);const H=W.useMemo(()=>0===z.length?I:[...I].sort((e,t)=>{const n=z.indexOf(e.id),r=z.indexOf(t.id);return-1===n?1:-1===r?-1:n-r}),[I,z]),G=W.useCallback(e=>$(e),[]),Y=W.useCallback(()=>{$(null),U(null)},[]),K=W.useCallback((e,t)=>{e.preventDefault(),U(t)},[]),q=W.useCallback((e,t,n)=>{e.preventDefault(),n&&n!==t?(F(e=>{const r=[...e],o=r.indexOf(n),a=r.indexOf(t);return-1===o||-1===a?e:(r.splice(o,1),r.splice(a,0,n),r)}),$(null),U(null)):U(null)},[F]),X={onDelete:e=>{(async e=>{try{await aS(e),l(e)}catch(kT){uN.error(kT instanceof Error?kT.message:"Failed to delete project")}})(e)},onArchive:e=>{(async e=>{try{const t=await sS(e);s(t)}catch(kT){uN.error(kT instanceof Error?kT.message:"Failed to archive project")}})(e)},onUnarchive:e=>{(async e=>{try{const t=await lS(e);s(t)}catch(kT){uN.error(kT instanceof Error?kT.message:"Failed to restore project")}})(e)},onUpdated:s};return ee.jsxs("div",{className:"min-h-screen bg-background",children:[ee.jsx("header",{className:"border-b sticky top-0 bg-background z-10",children:ee.jsxs("div",{className:"max-w-6xl mx-auto px-4 h-14 flex items-center justify-between",children:[ee.jsxs("div",{className:"flex items-center gap-2",children:[ee.jsx(gj,{className:"h-5 w-5"}),ee.jsxs("div",{children:[ee.jsx("span",{className:"font-semibold text-lg leading-tight block",children:"CC Web"}),ee.jsx("span",{className:"text-[10px] text-muted-foreground leading-none",children:QN})]})]}),ee.jsx(zN,{}),ee.jsx(Nk,{variant:"ghost",size:"sm",onClick:async()=>{var e;try{const e=await RE();R(e),T(!0)}catch(kT){(null==(e=null==kT?void 0:kT.message)?void 0:e.includes("404"))||404===(null==kT?void 0:kT.status)?(R(null),T(!0)):uN.error("无法加载全局记忆池",{description:null==kT?void 0:kT.message})}},title:"全局记忆池",children:ee.jsx($E,{className:"h-4 w-4"})}),ee.jsx(Nk,{variant:"ghost",size:"sm",onClick:()=>e("/skillhub"),title:"SkillHub",children:ee.jsx(hj,{className:"h-4 w-4"})}),ee.jsx(Nk,{variant:"ghost",size:"sm",onClick:()=>e("/mobile"),title:"手机界面",children:ee.jsx(pj,{className:"h-4 w-4"})}),ee.jsx(Nk,{variant:"ghost",size:"sm",onClick:()=>e("/settings"),title:"设置",children:ee.jsx(fj,{className:"h-4 w-4"})}),ee.jsx(Nk,{variant:"ghost",size:"sm",onClick:()=>j(!E),title:E?"卡片模式":"监控大屏",className:ik(E&&"text-blue-400 bg-blue-500/10"),children:E?ee.jsx(tj,{className:"h-4 w-4"}):ee.jsx(sj,{className:"h-4 w-4"})}),ee.jsx(Nk,{variant:"ghost",size:"sm",onClick:()=>{document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen()},title:x?"Exit fullscreen":"Fullscreen",children:x?ee.jsx(aj,{className:"h-4 w-4"}):ee.jsx(oj,{className:"h-4 w-4"})}),ee.jsx(JN,{}),ee.jsx(XN,{}),ee.jsx(WN,{}),ee.jsxs(Nk,{variant:"ghost",size:"sm",onClick:()=>{u(),e("/login")},children:[ee.jsx(rj,{className:"h-4 w-4 mr-2"}),"Logout"]})]})}),E&&ee.jsx("div",{className:"flex-1 min-h-0",children:ee.jsx(oT,{projects:t,projectStatuses:C,activeProjectIds:h})}),!E&&ee.jsxs("main",{className:"max-w-6xl mx-auto px-4 py-8",children:[ee.jsxs("div",{className:"flex items-center justify-between mb-6",children:[ee.jsxs("div",{children:[ee.jsx("h1",{className:"text-2xl font-bold",children:"Projects"}),ee.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Each project runs Claude CLI in a dedicated terminal session."})]}),ee.jsxs("div",{className:"flex gap-2",children:[ee.jsxs(Nk,{variant:"outline",onClick:()=>p(!0),children:[ee.jsx(KE,{className:"h-4 w-4 mr-2"}),"Open Project"]}),ee.jsxs(Nk,{onClick:()=>d(!0),children:[ee.jsx(cj,{className:"h-4 w-4 mr-2"}),"New Project"]})]})]}),n&&!o&&ee.jsx("div",{className:"text-center text-muted-foreground py-12",children:"Loading projects..."}),r&&ee.jsx("div",{className:"text-center text-destructive py-12",children:r}),o&&!n&&!r&&0===t.length&&ee.jsxs("div",{className:"text-center py-20",children:[ee.jsx(gj,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),ee.jsx("h2",{className:"text-lg font-semibold mb-2",children:"No projects yet"}),ee.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"Create a new project or open an existing one."}),ee.jsxs("div",{className:"flex gap-2 justify-center",children:[ee.jsxs(Nk,{variant:"outline",onClick:()=>p(!0),children:[ee.jsx(KE,{className:"h-4 w-4 mr-2"}),"Open Project"]}),ee.jsxs(Nk,{onClick:()=>d(!0),children:[ee.jsx(cj,{className:"h-4 w-4 mr-2"}),"New Project"]})]})]}),!n&&!r&&_.length>0&&ee.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-4",children:[_.map(e=>ee.jsxs("button",{onClick:()=>O(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),className:ik("px-2 py-0.5 rounded-full text-xs border transition-colors",A.includes(e)?"bg-blue-500/20 text-blue-400 border-blue-500/40":"bg-muted text-muted-foreground border-border hover:border-muted-foreground/40"),children:["#",e]},e)),A.length>0&&ee.jsx("button",{onClick:()=>O([]),className:"px-2 py-0.5 rounded-full text-xs text-muted-foreground hover:text-foreground transition-colors",children:"清除"})]}),!n&&!r&&H.length>0&&ee.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:H.map((e,t)=>ee.jsx(dw.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.3,delay:Math.min(.05*t,.3),ease:"easeOut"},draggable:!0,onDragStart:()=>G(e.id),onDragOver:t=>K(t,e.id),onDrop:t=>q(t,e.id,V),onDragEnd:Y,style:{opacity:V===e.id?.4:1,cursor:"grab"},className:ik(B===e.id&&V!==e.id&&"ring-2 ring-blue-500/50 rounded-xl"),children:ee.jsx(xN,{project:e,active:h.has(e.id),statusStack:v.get(e.id)??[],...X})},e.id))}),!n&&!r&&D.length>0&&ee.jsxs("div",{className:"mt-10",children:[ee.jsxs("button",{className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors mb-4 group",onClick:()=>S(e=>!e),children:[ee.jsx(dw.span,{animate:{rotate:k?90:0},transition:{duration:.2},children:ee.jsx(WE,{className:"h-4 w-4"})}),ee.jsx("span",{className:"font-medium",children:"Archived"}),ee.jsx("span",{className:"text-xs bg-muted rounded-full px-2 py-0.5",children:D.length})]}),ee.jsx(Yb,{children:k&&ee.jsx(dw.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.25,ease:"easeInOut"},className:"overflow-hidden",children:ee.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:D.map(e=>ee.jsx(xN,{project:e,active:!1,...X},e.id))})})})]}),ee.jsx(FN,{})]}),ee.jsx(EN,{open:c,onOpenChange:d,onCreated:e=>{i(e)}}),ee.jsx(jN,{open:f,onOpenChange:p,onOpened:e=>{i(e)}}),N&&M&&M.balls.length>0&&ee.jsx(PN,{balls:M.balls,activeCapacity:M.active_capacity,onClose:()=>T(!1)}),N&&(!M||0===M.balls.length)&&ee.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>T(!1),children:ee.jsxs("div",{className:"bg-popover border rounded-lg p-6 text-center",onClick:e=>e.stopPropagation(),children:[ee.jsx("p",{className:"text-sm text-muted-foreground",children:"全局记忆池为空"}),ee.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:'在项目记忆池中点击"同步全局"以汇总记忆'}),ee.jsx("button",{onClick:()=>T(!1),className:"mt-3 px-3 py-1 text-xs rounded border hover:bg-muted transition-colors",children:"关闭"})]})})]})}class iT extends H.Component{constructor(){super(...arguments),t(this,"state",{hasError:!1,error:null}),t(this,"handleReset",()=>{var e,t;this.setState({hasError:!1,error:null}),null==(t=(e=this.props).onReset)||t.call(e)})}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("[ErrorBoundary]",e,t.componentStack),uN.error(e.message||"Something went wrong")}render(){return this.state.hasError?this.props.fallback?this.props.fallback:ee.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3 p-4 text-sm text-muted-foreground",children:[ee.jsx("p",{children:"出错了"}),ee.jsx("button",{onClick:this.handleReset,className:"px-3 py-1.5 text-xs rounded-md border border-border hover:bg-muted transition-colors",children:"重新加载"})]}):this.props.children}}function sT({plugin:e,onConfigChange:t,onClose:n}){const{float:r,userConfig:o}=e,[a,i]=W.useState(()=>{var e,t;return{x:(null==(e=o.floatPosition)?void 0:e.x)??.5*window.innerWidth-r.defaultWidth/2,y:(null==(t=o.floatPosition)?void 0:t.y)??.3*window.innerHeight}}),[s,l]=W.useState(()=>{var e,t;return{w:(null==(e=o.floatSize)?void 0:e.w)??r.defaultWidth,h:(null==(t=o.floatSize)?void 0:t.h)??r.defaultHeight}}),[u,c]=W.useState(!1),[d,f]=W.useState(100),p=W.useRef(null),h=W.useRef(null),m=W.useCallback(()=>{f(Date.now()%1e5+100)},[]),g=W.useRef(null),v=W.useCallback(n=>{n.preventDefault(),m(),g.current={sx:n.clientX,sy:n.clientY,ox:a.x,oy:a.y},h.current&&(h.current.style.pointerEvents="none");const r=e=>{if(!g.current)return;const t=Math.max(0,Math.min(window.innerWidth-100,g.current.ox+e.clientX-g.current.sx)),n=Math.max(0,Math.min(window.innerHeight-40,g.current.oy+e.clientY-g.current.sy));p.current&&(p.current.style.left=t+"px",p.current.style.top=n+"px")},o=n=>{if(!g.current)return;const a=Math.max(0,Math.min(window.innerWidth-100,g.current.ox+n.clientX-g.current.sx)),s=Math.max(0,Math.min(window.innerHeight-40,g.current.oy+n.clientY-g.current.sy));g.current=null,h.current&&(h.current.style.pointerEvents=""),i({x:a,y:s}),t(e.id,{floatPosition:{x:a,y:s}}),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",o)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",o)},[a,m,e.id,t]),y=W.useRef(null),b=W.useCallback(n=>{if(!r.resizable)return;n.preventDefault(),n.stopPropagation(),m(),y.current={sx:n.clientX,sy:n.clientY,ow:s.w,oh:s.h},h.current&&(h.current.style.pointerEvents="none");const o=r.minWidth??150,a=r.minHeight??100,i=e=>{if(!y.current)return;const t=Math.max(o,y.current.ow+e.clientX-y.current.sx),n=Math.max(a,y.current.oh+e.clientY-y.current.sy);p.current&&(p.current.style.width=t+"px",p.current.style.height=n+"px")},u=n=>{if(!y.current)return;const r=Math.max(o,y.current.ow+n.clientX-y.current.sx),s=Math.max(a,y.current.oh+n.clientY-y.current.sy);y.current=null,h.current&&(h.current.style.pointerEvents=""),l({w:r,h:s}),t(e.id,{floatSize:{w:r,h:s}}),window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",u)};window.addEventListener("mousemove",i),window.addEventListener("mouseup",u)},[s,r,m,e.id,t]);W.useEffect(()=>{const t=async t=>{var n,r,o,a,i;if(t.source!==(null==(n=h.current)?void 0:n.contentWindow))return;const{callId:s,method:l,args:u}=t.data;if(s&&l)try{const t=qk(),n={"Content-Type":"application/json","X-Plugin-Id":e.id};let a,i;if(t&&(n.Authorization=`Bearer ${t}`),"storage:get"===l)a=`/api/plugin-bridge/storage/${e.id}`,i={method:"GET",headers:n};else if("storage:set"===l)a=`/api/plugin-bridge/storage/${e.id}`,i={method:"PUT",headers:n,body:JSON.stringify(u)};else{const t={"project:status":{path:`/api/plugin-bridge/project/status/${u.projectId}`,httpMethod:"GET"},"project:list":{path:"/api/plugin-bridge/project/list",httpMethod:"GET"},"terminal:send":{path:"/api/plugin-bridge/terminal/send",httpMethod:"POST"},"session:read":{path:`/api/plugin-bridge/session/${u.projectId}`,httpMethod:"GET"},"system:info":{path:"/api/plugin-bridge/system/info",httpMethod:"GET"}};if("backend:api"===l){const{method:t,path:r,body:o}=u;if(!r||!r.startsWith("/")||r.includes(".."))throw new Error("Invalid API path");a=`/api/plugins/${e.id}${r}`,i={method:t||"GET",headers:n},!o||"POST"!==t&&"PUT"!==t||(i.body=JSON.stringify(o))}else{const e=t[l];if(!e)throw new Error(`Unknown method: ${l}`);a=e.path,i={method:e.httpMethod,headers:n},"POST"===e.httpMethod&&(i.body=JSON.stringify(u))}}const c=await fetch(a,i),d=await c.json();null==(o=null==(r=h.current)?void 0:r.contentWindow)||o.postMessage({callId:s,result:d,error:null},window.location.origin)}catch(kT){const t=kT instanceof Error?kT.message:"Bridge error";null==(i=null==(a=h.current)?void 0:a.contentWindow)||i.postMessage({callId:s,result:null,error:t},window.location.origin)}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)},[e.id]);const x=o.clickable??r.clickable.default,w=`/plugins/${e.id}/${e.float?"index.html":""}`;return ee.jsxs(dw.div,{ref:p,className:ik("fixed rounded-lg border border-border shadow-xl overflow-hidden flex flex-col","bg-background/95 backdrop-blur-sm"),style:{left:a.x,top:a.y,width:u?200:s.w,height:u?32:s.h,zIndex:d},initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},onMouseDown:m,children:[ee.jsxs("div",{className:"h-8 flex items-center gap-1 px-2 bg-muted/50 border-b border-border cursor-grab active:cursor-grabbing flex-shrink-0 select-none",onMouseDown:v,children:[ee.jsx(ZE,{className:"h-3 w-3 text-muted-foreground/40 flex-shrink-0"}),ee.jsx("span",{className:"text-xs text-muted-foreground truncate flex-1",children:e.name}),ee.jsx("button",{onClick:()=>c(e=>!e),className:"p-0.5 rounded hover:bg-white/10 text-muted-foreground/60 hover:text-foreground transition-colors",children:ee.jsx(ij,{className:"h-3 w-3"})}),ee.jsx("button",{onClick:()=>n(e.id),className:"p-0.5 rounded hover:bg-red-500/20 text-muted-foreground/60 hover:text-red-400 transition-colors",children:ee.jsx(xj,{className:"h-3 w-3"})})]}),!u&&ee.jsxs("div",{className:"flex-1 min-h-0 relative",children:[ee.jsx("iframe",{ref:h,src:w,sandbox:"allow-scripts allow-same-origin",className:"w-full h-full border-0",style:{pointerEvents:x?"auto":"none"}}),r.resizable&&ee.jsx("div",{className:"absolute bottom-0 right-0 w-3 h-3 cursor-se-resize",onMouseDown:b,children:ee.jsxs("svg",{viewBox:"0 0 12 12",className:"w-3 h-3 text-muted-foreground/30",children:[ee.jsx("path",{d:"M11 1v10H1",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),ee.jsx("path",{d:"M11 5v6H5",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})]})})]})]})}function lT({plugins:e,onPluginsChange:t,onClose:n}){const r=W.useCallback(async(e,n)=>{t(t=>t.map(t=>t.id===e?{...t,userConfig:{...t.userConfig,...n}}:t));try{await gE(e,n)}catch{}},[t]);return 0===e.length?null:ee.jsx(Yb,{children:e.map(e=>ee.jsx(sT,{plugin:e,onConfigChange:r,onClose:n},e.id))})}function uT({onTogglePlugin:e,activeIds:t}){const[n,r]=W.useState([]);return W.useEffect(()=>{pE().then(e=>r(e.filter(e=>e.enabled))).catch(()=>r([]))},[]),W.useEffect(()=>{const e=()=>{pE().then(e=>r(e.filter(e=>e.enabled))).catch(()=>{})};return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[]),0===n.length?null:ee.jsx("div",{className:"fixed top-14 left-1/2 -translate-x-1/2 z-40 pointer-events-none",children:ee.jsx(dw.div,{className:"pointer-events-auto flex items-center gap-1 px-2 py-1 rounded-full bg-background/60 backdrop-blur-md border border-border/50 shadow-lg",initial:{opacity:0,y:-8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:n.map(n=>{const r=t.has(n.id),o=n.name.slice(0,2);return ee.jsxs(dw.button,{onClick:()=>e(n),className:ik("relative flex items-center justify-center w-7 h-7 rounded-full text-[10px] font-medium transition-colors",r?"bg-blue-500/20 text-blue-400":"text-muted-foreground/70 hover:text-foreground hover:bg-muted/80"),whileHover:{scale:1.12},whileTap:{scale:.92},title:n.name+(n.description?` — ${n.description}`:""),children:[o,ee.jsx(Yb,{children:r&&ee.jsx(dw.span,{className:"absolute -bottom-0.5 left-1/2 -translate-x-1/2 h-1 w-1 rounded-full bg-blue-400",initial:{scale:0},animate:{scale:1},exit:{scale:0}})})]},n.id)})})})}const cT=H.lazy(()=>fd(()=>import("./ProjectPage-KJgvua7n.js").then(e=>e.b),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(e=>({default:e.ProjectPage}))),dT=H.lazy(()=>fd(()=>import("./SettingsPage-D5UpIRYe.js"),__vite__mapDeps([11,5,9,4])).then(e=>({default:e.SettingsPage}))),fT=H.lazy(()=>fd(()=>import("./SkillHubPage-Cm6X56T6.js"),__vite__mapDeps([12,8,7,5])).then(e=>({default:e.SkillHubPage}))),pT=H.lazy(()=>fd(()=>import("./ShareViewPage-B9dPy55n.js"),__vite__mapDeps([13,7,6])).then(e=>({default:e.ShareViewPage}))),hT=H.lazy(()=>fd(()=>import("./MobilePage-MtWV7lEi.js"),__vite__mapDeps([14,9,2,3,5])).then(e=>({default:e.MobilePage})));function mT(){return ee.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:ee.jsx("span",{className:"text-muted-foreground text-sm",children:"Loading…"})})}function gT({children:e}){const[t,n]=W.useState(!1),r=Wk(e=>e.token),o=Wk(e=>e.setToken);return W.useEffect(()=>{r?n(!0):Jk()?eS().then(e=>o(e)).catch(()=>{}).finally(()=>n(!0)):n(!0)},[]),t||r?r?ee.jsx(ee.Fragment,{children:e}):ee.jsx(wf,{to:"/login",replace:!0}):null}const vT=window.matchMedia("(pointer: coarse)").matches&&window.innerWidth<768;function yT(){const[e,t]=W.useState([]),[n,r]=W.useState(()=>{try{return new Set(JSON.parse(localStorage.getItem("cc_plugin_open")||"[]"))}catch{return new Set}}),o=lf();W.useEffect(()=>{pE().then(t).catch(()=>t([]))},[]);const a=W.useCallback(e=>{r(t=>{const n=new Set(t);n.has(e.id)?n.delete(e.id):n.add(e.id);try{localStorage.setItem("cc_plugin_open",JSON.stringify([...n]))}catch{}return n})},[]),i=W.useCallback(e=>{r(t=>{const n=new Set(t);n.delete(e);try{localStorage.setItem("cc_plugin_open",JSON.stringify([...n]))}catch{}return n})},[]),s=function(e){if("/"===e||"/dashboard"===e)return{type:"dashboard"};const t=e.match(/^\/projects?\/([^/]+)/);return t?{type:"project",projectId:t[1]}:{type:"other"}}(o.pathname),l=e.filter(e=>{if(!e.enabled||!n.has(e.id))return!1;switch(e.userConfig.scope??e.float.scope.default){case"global":return!0;case"dashboard":return"dashboard"===s.type;case"project":return"project"===s.type;case"project:specific":return"project"===s.type&&(e.userConfig.projectIds??[]).includes(s.projectId??"");default:return!1}}),u="/login"===o.pathname,c="/mobile"===o.pathname;return ee.jsxs(ee.Fragment,{children:[!u&&!c&&!vT&&ee.jsx(uT,{onTogglePlugin:a,activeIds:n}),ee.jsx(lT,{plugins:l,onPluginsChange:t,onClose:i})]})}function bT({children:e}){const t=lf();return vT&&"/"===t.pathname?ee.jsx(wf,{to:"/mobile",replace:!0}):ee.jsx(ee.Fragment,{children:e})}function xT(){return ee.jsxs(BN,{children:[ee.jsx(vN,{richColors:!0,position:"bottom-right"}),ee.jsx(KN,{}),ee.jsx(qN,{}),ee.jsx(iT,{children:ee.jsxs(Pf,{children:[ee.jsx(yT,{}),ee.jsx(bT,{children:ee.jsx(W.Suspense,{fallback:ee.jsx(mT,{}),children:ee.jsxs(Ef,{children:[ee.jsx(kf,{path:"/login",element:ee.jsx(_E,{})}),ee.jsx(kf,{path:"/",element:ee.jsx(gT,{children:ee.jsx(aT,{})})}),ee.jsx(kf,{path:"/projects/:id",element:ee.jsx(gT,{children:ee.jsx(cT,{})})}),ee.jsx(kf,{path:"/settings",element:ee.jsx(gT,{children:ee.jsx(dT,{})})}),ee.jsx(kf,{path:"/skillhub",element:ee.jsx(gT,{children:ee.jsx(fT,{})})}),ee.jsx(kf,{path:"/mobile",element:ee.jsx(gT,{children:ee.jsx(hT,{})})}),ee.jsx(kf,{path:"/share/:token",element:ee.jsx(pT,{})}),ee.jsx(kf,{path:"*",element:ee.jsx(wf,{to:"/",replace:!0})})]})})})]})})]})}te.createRoot(document.getElementById("root")).render(ee.jsx(H.StrictMode,{children:ee.jsx(xT,{})}));export{PN as $,Yb as A,Nk as B,WE as C,HE as D,GE as E,KE as F,ZS as G,CE as H,Tk as I,NE as J,PE as K,ME as L,aj as M,TE as N,LE as O,uj as P,tE as Q,H as R,Fk as S,yj as T,nE as U,oE as V,rE as W,xj as X,aE as Y,iE as Z,fd as _,NS as a,uk as a$,mS as a0,dS as a1,wj as a2,QE as a3,yS as a4,UP as a5,GP as a6,YP as a7,qP as a8,XP as a9,hj as aA,df as aB,Uk as aC,Gk as aD,gj as aE,Pj as aF,mk as aG,Lj as aH,Ij as aI,Ej as aJ,jj as aK,hk as aL,Mj as aM,zj as aN,oC as aO,ld as aP,rC as aQ,nP as aR,sC as aS,qC as aT,Xj as aU,Wj as aV,OS as aW,zS as aX,VS as aY,sk as aZ,lk as a_,_k as aa,KP as ab,vS as ac,gS as ad,xS as ae,uS as af,cS as ag,lE as ah,$E as ai,cf as aj,VE as ak,Sj as al,XN as am,WN as an,nj as ao,$S as ap,iS as aq,NN as ar,RN as as,zN as at,dE as au,cE as av,eT as aw,Bk as ax,fE as ay,ZE as az,ik as b,dk as b0,GN as b1,YS as b2,vj as b3,IS as b4,BS as b5,WS as b6,GS as b7,FS as b8,HS as b9,a as bA,DE as bB,US as ba,KS as bb,pE as bc,hE as bd,mE as be,vE as bf,bS as bg,wS as bh,uE as bi,LN as bj,sj as bk,DN as bl,YE as bm,kS as bn,r as bo,o as bp,yE as bq,jE as br,bE as bs,xE as bt,wE as bu,kE as bv,SE as bw,EE as bx,BE as by,IE as bz,OE as c,oj as d,jS as e,Vk as f,qk as g,Kk as h,ES as i,ee as j,dj as k,MS as l,CS as m,XE as n,dw as o,qS as p,JS as q,W as r,$k as s,uN as t,UN as u,UE as v,TS as w,cj as x,XS as y,QS as z};
75
+ */const _E=(e,t)=>{const n=W.forwardRef(({color:n="currentColor",size:r=24,strokeWidth:o=2,absoluteStrokeWidth:a,className:i="",children:s,...l},u)=>{return W.createElement("svg",{ref:u,...DE,width:r,height:r,stroke:n,strokeWidth:a?24*Number(o)/Number(r):o,className:["lucide",`lucide-${c=e,c.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,i].join(" "),...l},[...t.map(([e,t])=>W.createElement(e,t)),...Array.isArray(s)?s:[s]]);var c});return n.displayName=`${e}`,n},AE=_E("ArchiveRestore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]),OE=_E("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"}]]),IE=_E("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),zE=_E("Brain",[["path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z",key:"1mhkh5"}],["path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z",key:"1d6s00"}]]),FE=_E("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),VE=_E("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),$E=_E("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]),BE=_E("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),UE=_E("File",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}]]),WE=_E("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),HE=_E("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["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"}]]),GE=_E("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"}]]),YE=_E("GitMerge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]),KE=_E("GripHorizontal",[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]),qE=_E("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),XE=_E("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]),QE=_E("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),ZE=_E("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),JE=_E("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]),ej=_E("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]),tj=_E("Minimize",[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]),nj=_E("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),rj=_E("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),oj=_E("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),aj=_E("Pencil",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),ij=_E("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),sj=_E("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),lj=_E("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),uj=_E("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),cj=_E("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]),dj=_E("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),fj=_E("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]),pj=_E("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]),hj=_E("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),mj=_E("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),gj=_E("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),vj=_E("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),yj=Ck("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function bj({className:e,variant:t,...n}){return ee.jsx("div",{className:ik(yj({variant:t}),e),...n})}function xj(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function wj(e,t=[]){let n=[];const r=()=>{const t=n.map(e=>W.createContext(e));return function(n){const r=(null==n?void 0:n[e])||t;return W.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){const o=W.createContext(r),a=n.length;n=[...n,r];const i=t=>{var n;const{scope:r,children:i,...s}=t,l=(null==(n=null==r?void 0:r[e])?void 0:n[a])||o,u=W.useMemo(()=>s,Object.values(s));return ee.jsx(l.Provider,{value:u,children:i})};return i.displayName=t+"Provider",[i,function(n,i){var s;const l=(null==(s=null==i?void 0:i[e])?void 0:s[a])||o,u=W.useContext(l);if(u)return u;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},kj(r,...t)]}function kj(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const r=n.reduce((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]}),{});return W.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Sj=(null==globalThis?void 0:globalThis.document)?W.useLayoutEffect:()=>{},Ej=G[" useId ".trim().toString()]||(()=>{}),jj=0;function Cj(e){const[t,n]=W.useState(Ej());return Sj(()=>{n(e=>e??String(jj++))},[e]),e||(t?`radix-${t}`:"")}var Pj=G[" useInsertionEffect ".trim().toString()]||Sj;function Nj({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,i]=function({defaultProp:e,onChange:t}){const[n,r]=W.useState(e),o=W.useRef(n),a=W.useRef(t);return Pj(()=>{a.current=t},[t]),W.useEffect(()=>{var e;o.current!==n&&(null==(e=a.current)||e.call(a,n),o.current=n)},[n,o]),[n,r,a]}({defaultProp:t,onChange:n}),s=void 0!==e,l=s?e:o;{const t=W.useRef(void 0!==e);W.useEffect(()=>{const e=t.current;if(e!==s){const t=e?"controlled":"uncontrolled",n=s?"controlled":"uncontrolled";console.warn(`${r} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=s},[s,r])}const u=W.useCallback(t=>{var n;if(s){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&(null==(n=i.current)||n.call(i,r))}else a(t)},[s,e,a,i]);return[l,u]}function Tj(e){const t=Mj(e),n=W.forwardRef((e,n)=>{const{children:r,...o}=e,a=W.Children.toArray(r),i=a.find(Lj);if(i){const e=i.props.children,r=a.map(t=>t===i?W.Children.count(e)>1?W.Children.only(null):W.isValidElement(e)?e.props.children:null:t);return ee.jsx(t,{...o,ref:n,children:W.isValidElement(e)?W.cloneElement(e,void 0,r):null})}return ee.jsx(t,{...o,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Mj(e){const t=W.forwardRef((e,t)=>{const{children:n,...r}=e;if(W.isValidElement(n)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==W.Fragment&&(o.ref=t?hk(t,e):e),W.cloneElement(n,o)}return W.Children.count(n)>1?W.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Rj=Symbol("radix.slottable");function Lj(e){return W.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Rj}var Dj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=Tj(`Primitive.${t}`),r=W.forwardRef((e,r)=>{const{asChild:o,...a}=e,i=o?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),ee.jsx(i,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function _j(e){const t=W.useRef(e);return W.useEffect(()=>{t.current=e}),W.useMemo(()=>(...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)},[])}var Aj,Oj="dismissableLayer.update",Ij="dismissableLayer.pointerDownOutside",zj="dismissableLayer.focusOutside",Fj=W.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Vj=W.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:i,onDismiss:s,...l}=e,u=W.useContext(Fj),[c,d]=W.useState(null),f=(null==c?void 0:c.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,p]=W.useState({}),h=mk(t,e=>d(e)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=m.indexOf(g),y=c?m.indexOf(c):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,w=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=_j(e),r=W.useRef(!1),o=W.useRef(()=>{});return W.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let r=function(){Bj(Ij,n,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{const t=e.target,n=[...u.branches].some(e=>e.contains(t));x&&!n&&(null==o||o(e),null==i||i(e),e.defaultPrevented||null==s||s())},f),k=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=_j(e),r=W.useRef(!1);return W.useEffect(()=>{const e=e=>{if(e.target&&!r.current){Bj(zj,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(null==a||a(e),null==i||i(e),e.defaultPrevented||null==s||s())},f);return function(e,t=(null==globalThis?void 0:globalThis.document)){const n=_j(e);W.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{y===u.layers.size-1&&(null==r||r(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),W.useEffect(()=>{if(c)return n&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(Aj=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),$j(),()=>{n&&1===u.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=Aj)}},[c,f,n,u]),W.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),$j())},[c,u]),W.useEffect(()=>{const e=()=>p({});return document.addEventListener(Oj,e),()=>document.removeEventListener(Oj,e)},[]),ee.jsx(Dj.div,{...l,ref:h,style:{pointerEvents:b?x?"auto":"none":void 0,...e.style},onFocusCapture:xj(e.onFocusCapture,k.onFocusCapture),onBlurCapture:xj(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:xj(e.onPointerDownCapture,w.onPointerDownCapture)})});Vj.displayName="DismissableLayer";function $j(){const e=new CustomEvent(Oj);document.dispatchEvent(e)}function Bj(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&ld.flushSync(()=>e.dispatchEvent(t))}(o,a):o.dispatchEvent(a)}W.forwardRef((e,t)=>{const n=W.useContext(Fj),r=W.useRef(null),o=mk(t,r);return W.useEffect(()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),ee.jsx(Dj.div,{...e,ref:o})}).displayName="DismissableLayerBranch";var Uj="focusScope.autoFocusOnMount",Wj="focusScope.autoFocusOnUnmount",Hj={bubbles:!1,cancelable:!0},Gj=W.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...i}=e,[s,l]=W.useState(null),u=_j(o),c=_j(a),d=W.useRef(null),f=mk(t,e=>l(e)),p=W.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;W.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;const t=e.target;s.contains(t)?d.current=t:Xj(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;const t=e.relatedTarget;null!==t&&(s.contains(t)||Xj(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Xj(s)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[r,s,p.paused]),W.useEffect(()=>{if(s){Qj.add(p);const t=document.activeElement;if(!s.contains(t)){const n=new CustomEvent(Uj,Hj);s.addEventListener(Uj,u),s.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Xj(r,{select:t}),document.activeElement!==n)return}((e=Yj(s),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Xj(s))}return()=>{s.removeEventListener(Uj,u),setTimeout(()=>{const e=new CustomEvent(Wj,Hj);s.addEventListener(Wj,c),s.dispatchEvent(e),e.defaultPrevented||Xj(t??document.body,{select:!0}),s.removeEventListener(Wj,c),Qj.remove(p)},0)}}var e},[s,u,c,p]);const h=W.useCallback(e=>{if(!n&&!r)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,a]=function(e){const t=Yj(e),n=Kj(t,e),r=Kj(t.reverse(),e);return[n,r]}(t);r&&a?e.shiftKey||o!==a?e.shiftKey&&o===r&&(e.preventDefault(),n&&Xj(a,{select:!0})):(e.preventDefault(),n&&Xj(r,{select:!0})):o===t&&e.preventDefault()}},[n,r,p.paused]);return ee.jsx(Dj.div,{tabIndex:-1,...i,ref:f,onKeyDown:h})});function Yj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Kj(e,t){for(const n of e)if(!qj(n,{upTo:t}))return n}function qj(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Xj(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}Gj.displayName="FocusScope";var Qj=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=Zj(e,t),e.unshift(t)},remove(t){var n;e=Zj(e,t),null==(n=e[0])||n.resume()}}}();function Zj(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var Jj=W.forwardRef((e,t)=>{var n;const{container:r,...o}=e,[a,i]=W.useState(!1);Sj(()=>i(!0),[]);const s=r||a&&(null==(n=null==globalThis?void 0:globalThis.document)?void 0:n.body);return s?ud.createPortal(ee.jsx(Dj.div,{...o,ref:t}),s):null});Jj.displayName="Portal";var eC=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=W.useState(),r=W.useRef(null),o=W.useRef(e),a=W.useRef("none"),i=e?"mounted":"unmounted",[s,l]=function(e,t){return W.useReducer((e,n)=>t[e][n]??e,e)}(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return W.useEffect(()=>{const e=tC(r.current);a.current="mounted"===s?e:"none"},[s]),Sj(()=>{const t=r.current,n=o.current;if(n!==e){const r=a.current,i=tC(t);if(e)l("MOUNT");else if("none"===i||"none"===(null==t?void 0:t.display))l("UNMOUNT");else{l(n&&r!==i?"ANIMATION_OUT":"UNMOUNT")}o.current=e}},[e,l]),Sj(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,i=a=>{const i=tC(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&i&&(l("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=tC(r.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:W.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}(t),o="function"==typeof n?n({present:r.isPresent}):W.Children.only(n),a=mk(r.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof n||r.isPresent?W.cloneElement(o,{ref:a}):null};function tC(e){return(null==e?void 0:e.animationName)||"none"}eC.displayName="Presence";var nC=0;function rC(){W.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??oC()),document.body.insertAdjacentElement("beforeend",e[1]??oC()),nC++,()=>{1===nC&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),nC--}},[])}function oC(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var aC=function(){return aC=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},aC.apply(this,arguments)};function iC(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var sC="right-scroll-bar-position",lC="width-before-scroll-bar";function uC(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var cC="undefined"!=typeof window?W.useLayoutEffect:W.useEffect,dC=new WeakMap;function fC(e,t){var n,r,o,a=(n=null,r=function(t){return e.forEach(function(e){return uC(e,t)})},(o=W.useState(function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}})[0]).callback=r,o.facade);return cC(function(){var t=dC.get(a);if(t){var n=new Set(t),r=new Set(e),o=a.current;n.forEach(function(e){r.has(e)||uC(e,null)}),r.forEach(function(e){n.has(e)||uC(e,o)})}dC.set(a,e)},[e]),a}function pC(e){return e}var hC=function(e){var t=e.sideCar,n=iC(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return W.createElement(r,aC({},n))};hC.isSideCarExport=!0;var mC=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=pC);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),n={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=aC({async:!0,ssr:!1},e),t}(),gC=function(){},vC=W.forwardRef(function(e,t){var n=W.useRef(null),r=W.useState({onScrollCapture:gC,onWheelCapture:gC,onTouchMoveCapture:gC}),o=r[0],a=r[1],i=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,h=e.noIsolation,m=e.inert,g=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,b=e.gapMode,x=iC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=f,k=fC([n,t]),S=aC(aC({},x),o);return W.createElement(W.Fragment,null,c&&W.createElement(w,{sideCar:mC,removeScrollBar:u,shards:d,noRelative:p,noIsolation:h,inert:m,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),i?W.cloneElement(W.Children.only(s),aC(aC({},S),{ref:k})):W.createElement(y,aC({},S,{className:l,ref:k}),s))});vC.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},vC.classNames={fullWidth:lC,zeroRight:sC};function yC(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var bC=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=yC())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},xC=function(){var e,t=(e=bC(),function(t,n){W.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},wC={left:0,top:0,right:0,gap:0},kC=function(e){return parseInt(e||"",10)||0},SC=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return wC;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[kC(n),kC(r),kC(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},EC=xC(),jC="data-scroll-locked",CC=function(e,t,n,r){var o=e.left,a=e.top,i=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat(jC,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(sC," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(lC," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(sC," .").concat(sC," {\n right: 0 ").concat(r,";\n }\n \n .").concat(lC," .").concat(lC," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(jC,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},PC=function(){var e=parseInt(document.body.getAttribute(jC)||"0",10);return isFinite(e)?e:0},NC=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;W.useEffect(function(){return document.body.setAttribute(jC,(PC()+1).toString()),function(){var e=PC()-1;e<=0?document.body.removeAttribute(jC):document.body.setAttribute(jC,e.toString())}},[]);var a=W.useMemo(function(){return SC(o)},[o]);return W.createElement(EC,{styles:CC(a,!t,o,n?"":"!important")})},TC=!1;if("undefined"!=typeof window)try{var MC=Object.defineProperty({},"passive",{get:function(){return TC=!0,!0}});window.addEventListener("test",MC,MC),window.removeEventListener("test",MC,MC)}catch(yT){TC=!1}var RC=!!TC&&{passive:!1},LC=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},DC=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),_C(e,r)){var o=AC(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},_C=function(e,t){return"v"===e?function(e){return LC(e,"overflowY")}(t):function(e){return LC(e,"overflowX")}(t)},AC=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},OC=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},IC=function(e){return[e.deltaX,e.deltaY]},zC=function(e){return e&&"current"in e?e.current:e},FC=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},VC=0,$C=[];function BC(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const UC=(WC=function(e){var t=W.useRef([]),n=W.useRef([0,0]),r=W.useRef(),o=W.useState(VC++)[0],a=W.useState(xC)[0],i=W.useRef(e);W.useEffect(function(){i.current=e},[e]),W.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(zC),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=W.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var o,a=OC(e),s=n.current,l="deltaX"in e?e.deltaX:s[0]-a[0],u="deltaY"in e?e.deltaY:s[1]-a[1],c=e.target,d=Math.abs(l)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===c||p.contains(c)))return!1;var h=DC(d,c);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=DC(d,c)),!h)return!1;if(!r.current&&"changedTouches"in e&&(l||u)&&(r.current=o),!o)return!0;var m=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*r,i=n.target,s=t.contains(i),l=!1,u=a>0,c=0,d=0;do{if(!i)break;var f=AC(e,i),p=f[0],h=f[1]-f[2]-o*p;(p||h)&&_C(e,i)&&(c+=h,d+=p);var m=i.parentNode;i=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(u&&Math.abs(c)<1||!u&&Math.abs(d)<1)&&(l=!0),l}(m,t,e,"h"===m?l:u)},[]),l=W.useCallback(function(e){var n=e;if($C.length&&$C[$C.length-1]===a){var r="deltaY"in n?IC(n):OC(n),o=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,o=r,t[0]===o[0]&&t[1]===o[1]);var t,o})[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var l=(i.current.shards||[]).map(zC).filter(Boolean).filter(function(e){return e.contains(n.target)});(l.length>0?s(n,l[0]):!i.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=W.useCallback(function(e,n,r,o){var a={name:e,delta:n,target:r,should:o,shadowParent:BC(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),c=W.useCallback(function(e){n.current=OC(e),r.current=void 0},[]),d=W.useCallback(function(t){u(t.type,IC(t),t.target,s(t,e.lockRef.current))},[]),f=W.useCallback(function(t){u(t.type,OC(t),t.target,s(t,e.lockRef.current))},[]);W.useEffect(function(){return $C.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,RC),document.addEventListener("touchmove",l,RC),document.addEventListener("touchstart",c,RC),function(){$C=$C.filter(function(e){return e!==a}),document.removeEventListener("wheel",l,RC),document.removeEventListener("touchmove",l,RC),document.removeEventListener("touchstart",c,RC)}},[]);var p=e.removeScrollBar,h=e.inert;return W.createElement(W.Fragment,null,h?W.createElement(a,{styles:FC(o)}):null,p?W.createElement(NC,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},mC.useMedium(WC),hC);var WC,HC=W.forwardRef(function(e,t){return W.createElement(vC,aC({},e,{ref:t,sideCar:UC}))});HC.classNames=vC.classNames;var GC=new WeakMap,YC=new WeakMap,KC={},qC=0,XC=function(e){return e&&(e.host||XC(e.parentNode))},QC=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=XC(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);KC[n]||(KC[n]=new WeakMap);var a=KC[n],i=[],s=new Set,l=new Set(o),u=function(e){e&&!s.has(e)&&(s.add(e),u(e.parentNode))};o.forEach(u);var c=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))c(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(GC.get(e)||0)+1,u=(a.get(e)||0)+1;GC.set(e,l),a.set(e,u),i.push(e),1===l&&o&&YC.set(e,!0),1===u&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(vT){console.error("aria-hidden: cannot operate on ",e,vT)}})};return c(t),s.clear(),qC++,function(){i.forEach(function(e){var t=GC.get(e)-1,o=a.get(e)-1;GC.set(e,t),a.set(e,o),t||(YC.has(e)||e.removeAttribute(r),YC.delete(e)),o||e.removeAttribute(n)}),--qC||(GC=new WeakMap,GC=new WeakMap,YC=new WeakMap,KC={})}},ZC=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),QC(r,o,n,"aria-hidden")):function(){return null}};function JC(e){const t=eP(e),n=W.forwardRef((e,n)=>{const{children:r,...o}=e,a=W.Children.toArray(r),i=a.find(nP);if(i){const e=i.props.children,r=a.map(t=>t===i?W.Children.count(e)>1?W.Children.only(null):W.isValidElement(e)?e.props.children:null:t);return ee.jsx(t,{...o,ref:n,children:W.isValidElement(e)?W.cloneElement(e,void 0,r):null})}return ee.jsx(t,{...o,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function eP(e){const t=W.forwardRef((e,t)=>{const{children:n,...r}=e;if(W.isValidElement(n)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==W.Fragment&&(o.ref=t?hk(t,e):e),W.cloneElement(n,o)}return W.Children.count(n)>1?W.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tP=Symbol("radix.slottable");function nP(e){return W.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===tP}var rP="Dialog",[oP]=wj(rP),[aP,iP]=oP(rP),sP=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:i=!0}=e,s=W.useRef(null),l=W.useRef(null),[u,c]=Nj({prop:r,defaultProp:o??!1,onChange:a,caller:rP});return ee.jsx(aP,{scope:t,triggerRef:s,contentRef:l,contentId:Cj(),titleId:Cj(),descriptionId:Cj(),open:u,onOpenChange:c,onOpenToggle:W.useCallback(()=>c(e=>!e),[c]),modal:i,children:n})};sP.displayName=rP;var lP="DialogTrigger";W.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=iP(lP,n),a=mk(t,o.triggerRef);return ee.jsx(Dj.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":NP(o.open),...r,ref:a,onClick:xj(e.onClick,o.onOpenToggle)})}).displayName=lP;var uP="DialogPortal",[cP,dP]=oP(uP,{forceMount:void 0}),fP=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,a=iP(uP,t);return ee.jsx(cP,{scope:t,forceMount:n,children:W.Children.map(r,e=>ee.jsx(eC,{present:n||a.open,children:ee.jsx(Jj,{asChild:!0,container:o,children:e})}))})};fP.displayName=uP;var pP="DialogOverlay",hP=W.forwardRef((e,t)=>{const n=dP(pP,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=iP(pP,e.__scopeDialog);return a.modal?ee.jsx(eC,{present:r||a.open,children:ee.jsx(gP,{...o,ref:t})}):null});hP.displayName=pP;var mP=JC("DialogOverlay.RemoveScroll"),gP=W.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=iP(pP,n);return ee.jsx(HC,{as:mP,allowPinchZoom:!0,shards:[o.contentRef],children:ee.jsx(Dj.div,{"data-state":NP(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),vP="DialogContent",yP=W.forwardRef((e,t)=>{const n=dP(vP,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=iP(vP,e.__scopeDialog);return ee.jsx(eC,{present:r||a.open,children:a.modal?ee.jsx(bP,{...o,ref:t}):ee.jsx(xP,{...o,ref:t})})});yP.displayName=vP;var bP=W.forwardRef((e,t)=>{const n=iP(vP,e.__scopeDialog),r=W.useRef(null),o=mk(t,n.contentRef,r);return W.useEffect(()=>{const e=r.current;if(e)return ZC(e)},[]),ee.jsx(wP,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:xj(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),null==(t=n.triggerRef.current)||t.focus()}),onPointerDownOutside:xj(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:xj(e.onFocusOutside,e=>e.preventDefault())})}),xP=W.forwardRef((e,t)=>{const n=iP(vP,e.__scopeDialog),r=W.useRef(!1),o=W.useRef(!1);return ee.jsx(wP,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var a,i;null==(a=e.onCloseAutoFocus)||a.call(e,t),t.defaultPrevented||(r.current||null==(i=n.triggerRef.current)||i.focus(),t.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:t=>{var a,i;null==(a=e.onInteractOutside)||a.call(e,t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));const s=t.target;(null==(i=n.triggerRef.current)?void 0:i.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})}),wP=W.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...i}=e,s=iP(vP,n),l=W.useRef(null),u=mk(t,l);return rC(),ee.jsxs(ee.Fragment,{children:[ee.jsx(Gj,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:ee.jsx(Vj,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":NP(s.open),...i,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),ee.jsxs(ee.Fragment,{children:[ee.jsx(LP,{titleId:s.titleId}),ee.jsx(DP,{contentRef:l,descriptionId:s.descriptionId})]})]})}),kP="DialogTitle",SP=W.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=iP(kP,n);return ee.jsx(Dj.h2,{id:o.titleId,...r,ref:t})});SP.displayName=kP;var EP="DialogDescription",jP=W.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=iP(EP,n);return ee.jsx(Dj.p,{id:o.descriptionId,...r,ref:t})});jP.displayName=EP;var CP="DialogClose",PP=W.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=iP(CP,n);return ee.jsx(Dj.button,{type:"button",...r,ref:t,onClick:xj(e.onClick,()=>o.onOpenChange(!1))})});function NP(e){return e?"open":"closed"}PP.displayName=CP;var TP="DialogTitleWarning",[MP,RP]=function(e,t){const n=W.createContext(t),r=e=>{const{children:t,...r}=e,o=W.useMemo(()=>r,Object.values(r));return ee.jsx(n.Provider,{value:o,children:t})};return r.displayName=e+"Provider",[r,function(r){const o=W.useContext(n);if(o)return o;if(void 0!==t)return t;throw new Error(`\`${r}\` must be used within \`${e}\``)}]}(TP,{contentName:vP,titleName:kP,docsSlug:"dialog"}),LP=({titleId:e})=>{const t=RP(TP),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return W.useEffect(()=>{if(e){document.getElementById(e)||console.error(n)}},[n,e]),null},DP=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${RP("DialogDescriptionWarning").contentName}}.`;return W.useEffect(()=>{var r;const o=null==(r=e.current)?void 0:r.getAttribute("aria-describedby");if(t&&o){document.getElementById(t)||console.warn(n)}},[n,e,t]),null},_P=hP,AP=yP,OP=SP,IP=jP,zP=PP;const FP=sP,VP=fP,$P=W.forwardRef(({className:e,...t},n)=>ee.jsx(_P,{ref:n,className:ik("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));$P.displayName=_P.displayName;const BP=W.forwardRef(({className:e,children:t,noOverlay:n,...r},o)=>ee.jsxs(VP,{children:[!n&&ee.jsx($P,{}),ee.jsxs(AP,{ref:o,className:ik("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,ee.jsxs(zP,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[ee.jsx(gj,{className:"h-4 w-4"}),ee.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));BP.displayName=AP.displayName;const UP=({className:e,...t})=>ee.jsx("div",{className:ik("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});UP.displayName="DialogHeader";const WP=({className:e,...t})=>ee.jsx("div",{className:ik("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});WP.displayName="DialogFooter";const HP=W.forwardRef(({className:e,...t},n)=>ee.jsx(OP,{ref:n,className:ik("text-lg font-semibold leading-none tracking-tight",e),...t}));HP.displayName=OP.displayName;const GP=W.forwardRef(({className:e,...t},n)=>ee.jsx(IP,{ref:n,className:ik("text-sm text-muted-foreground",e),...t}));function YP({project:e,open:t,onOpenChange:n,onUpdated:r}){const[o,a]=W.useState([]),[i,s]=W.useState([]),[l,u]=W.useState(!1),[c,d]=W.useState(null);W.useEffect(()=>{if(!t)return;a(e.shares?[...e.shares]:[]),d(null);let n=!1;return tS().then(e=>{n||s(e)}).catch(()=>{}),()=>{n=!0}},[t,e.id]);const f=new Set(o.map(e=>e.username)),p=i.filter(t=>t!==e.owner&&!f.has(t));return ee.jsx(FP,{open:t,onOpenChange:n,children:ee.jsxs(BP,{className:"sm:max-w-md",children:[ee.jsxs(UP,{children:[ee.jsxs(HP,{className:"flex items-center gap-2",children:[ee.jsx(mj,{className:"h-4 w-4"}),"共享设置"]}),ee.jsx(GP,{children:"选择用户并设置权限:可见(只读)或可编辑(读写+终端)"})]}),ee.jsxs("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:[0===o.length&&ee.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"尚未共享给任何用户"}),o.map(e=>ee.jsxs("div",{className:"flex items-center justify-between gap-2 px-1",children:[ee.jsx("span",{className:"text-sm font-medium",children:e.username}),ee.jsxs("div",{className:"flex items-center gap-1.5",children:[ee.jsx("button",{onClick:()=>{return t=e.username,void a(e=>e.map(e=>e.username===t?{...e,permission:"view"===e.permission?"edit":"view"}:e));var t},className:"focus:outline-none",children:ee.jsx(bj,{variant:"edit"===e.permission?"default":"secondary",className:"cursor-pointer text-xs",children:"edit"===e.permission?"可编辑":"可见"})}),ee.jsx(Nk,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>{return t=e.username,void a(e=>e.filter(e=>e.username!==t));var t},children:ee.jsx(hj,{className:"h-3.5 w-3.5"})})]})]},e.username))]}),p.length>0&&ee.jsxs("div",{className:"border-t pt-3",children:[ee.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"添加用户"}),ee.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(e=>ee.jsxs(Nk,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>{return t=e,void a(e=>[...e,{username:t,permission:"view"}]);var t},children:[ee.jsx(ij,{className:"h-3 w-3"}),e]},e))})]}),c&&ee.jsx("p",{className:"text-sm text-destructive",children:c}),ee.jsxs(WP,{children:[ee.jsx(Nk,{variant:"outline",onClick:()=>n(!1),disabled:l,children:"取消"}),ee.jsx(Nk,{onClick:()=>{(async()=>{u(!0),d(null);try{const t=await nS(e.id,o);r(t),n(!1)}catch(yT){d(yT instanceof Error?yT.message:"Failed to update shares")}finally{u(!1)}})()},disabled:l,children:l?"保存中...":"保存"})]})]})})}GP.displayName=IP.displayName;const KP=Array(12).fill(0),qP=({visible:e,className:t})=>H.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},H.createElement("div",{className:"sonner-spinner"},KP.map((e,t)=>H.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),XP=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),QP=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},H.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),ZP=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),JP=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),eN=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},H.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),H.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}));let tN=1;const nN=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;const{message:n,...r}=e,o="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:tN++,a=this.toasts.find(e=>e.id===o),i=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(t=>t.id===o?(this.publish({...t,...e,id:o,title:n}),{...t,...e,id:o,dismissible:i,title:n}):t):this.addToast({title:n,...r,dismissible:i,id:o}),o},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;void 0!==t.loading&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));const r=Promise.resolve(e instanceof Function?e():e);let o,a=void 0!==n;const i=r.then(async e=>{o=["resolve",e];if(H.isValidElement(e))a=!1,this.create({id:n,type:"default",message:e});else if(rN(e)&&!e.ok){a=!1;const r="function"==typeof t.error?await t.error(`HTTP error! status: ${e.status}`):t.error,o="function"==typeof t.description?await t.description(`HTTP error! status: ${e.status}`):t.description,i="object"==typeof r&&!H.isValidElement(r)?r:{message:r};this.create({id:n,type:"error",description:o,...i})}else if(e instanceof Error){a=!1;const r="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description,i="object"==typeof r&&!H.isValidElement(r)?r:{message:r};this.create({id:n,type:"error",description:o,...i})}else if(void 0!==t.success){a=!1;const r="function"==typeof t.success?await t.success(e):t.success,o="function"==typeof t.description?await t.description(e):t.description,i="object"==typeof r&&!H.isValidElement(r)?r:{message:r};this.create({id:n,type:"success",description:o,...i})}}).catch(async e=>{if(o=["reject",e],void 0!==t.error){a=!1;const r="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description,i="object"==typeof r&&!H.isValidElement(r)?r:{message:r};this.create({id:n,type:"error",description:o,...i})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),null==t.finally||t.finally.call(t)}),s=()=>new Promise((e,t)=>i.then(()=>"reject"===o[0]?t(o[1]):e(o[1])).catch(t));return"string"!=typeof n&&"number"!=typeof n?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{const n=(null==t?void 0:t.id)||tN++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},rN=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,oN=(e,t)=>{const n=(null==t?void 0:t.id)||tN++;return nN.addToast({title:e,...t,id:n}),n},aN=Object.assign(oN,{success:nN.success,info:nN.info,warning:nN.warning,error:nN.error,custom:nN.custom,message:nN.message,promise:nN.promise,dismiss:nN.dismiss,loading:nN.loading},{getHistory:()=>nN.toasts,getToasts:()=>nN.getActiveToasts()});function iN(e){return void 0!==e.label}!function(e){if("undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");const sN=3,lN=14;function uN(...e){return e.filter(Boolean).join(" ")}const cN=e=>{var t,n,r,o,a,i,s,l,u;const{invert:c,toast:d,unstyled:f,interacting:p,setHeights:h,visibleToasts:m,heights:g,index:v,toasts:y,expanded:b,removeToast:x,defaultRichColors:w,closeButton:k,style:S,cancelButtonStyle:E,actionButtonStyle:j,className:C="",descriptionClassName:P="",duration:N,position:T,gap:M,expandByDefault:R,classNames:L,icons:D,closeButtonAriaLabel:_="Close toast"}=e,[A,O]=H.useState(null),[I,z]=H.useState(null),[F,V]=H.useState(!1),[$,B]=H.useState(!1),[U,W]=H.useState(!1),[G,Y]=H.useState(!1),[K,q]=H.useState(!1),[X,Q]=H.useState(0),[Z,J]=H.useState(0),ee=H.useRef(d.duration||N||4e3),te=H.useRef(null),ne=H.useRef(null),re=0===v,oe=v+1<=m,ae=d.type,ie=!1!==d.dismissible,se=d.className||"",le=d.descriptionClassName||"",ue=H.useMemo(()=>g.findIndex(e=>e.toastId===d.id)||0,[g,d.id]),ce=H.useMemo(()=>{var e;return null!=(e=d.closeButton)?e:k},[d.closeButton,k]),de=H.useMemo(()=>d.duration||N||4e3,[d.duration,N]),fe=H.useRef(0),pe=H.useRef(0),he=H.useRef(0),me=H.useRef(null),[ge,ve]=T.split("-"),ye=H.useMemo(()=>g.reduce((e,t,n)=>n>=ue?e:e+t.height,0),[g,ue]),be=(()=>{const[e,t]=H.useState(document.hidden);return H.useEffect(()=>{const e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e})(),xe=d.invert||c,we="loading"===ae;pe.current=H.useMemo(()=>ue*M+ye,[ue,ye]),H.useEffect(()=>{ee.current=de},[de]),H.useEffect(()=>{V(!0)},[]),H.useEffect(()=>{const e=ne.current;if(e){const t=e.getBoundingClientRect().height;return J(t),h(e=>[{toastId:d.id,height:t,position:d.position},...e]),()=>h(e=>e.filter(e=>e.toastId!==d.id))}},[h,d.id]),H.useLayoutEffect(()=>{if(!F)return;const e=ne.current,t=e.style.height;e.style.height="auto";const n=e.getBoundingClientRect().height;e.style.height=t,J(n),h(e=>e.find(e=>e.toastId===d.id)?e.map(e=>e.toastId===d.id?{...e,height:n}:e):[{toastId:d.id,height:n,position:d.position},...e])},[F,d.title,d.description,h,d.id,d.jsx,d.action,d.cancel]);const ke=H.useCallback(()=>{B(!0),Q(pe.current),h(e=>e.filter(e=>e.toastId!==d.id)),setTimeout(()=>{x(d)},200)},[d,x,h,pe]);H.useEffect(()=>{if(d.promise&&"loading"===ae||d.duration===1/0||"loading"===d.type)return;let e;return b||p||be?(()=>{if(he.current<fe.current){const e=(new Date).getTime()-fe.current;ee.current=ee.current-e}he.current=(new Date).getTime()})():ee.current!==1/0&&(fe.current=(new Date).getTime(),e=setTimeout(()=>{null==d.onAutoClose||d.onAutoClose.call(d,d),ke()},ee.current)),()=>clearTimeout(e)},[b,p,d,ae,be,ke]),H.useEffect(()=>{d.delete&&(ke(),null==d.onDismiss||d.onDismiss.call(d,d))},[ke,d.delete]);const Se=d.icon||(null==D?void 0:D[ae])||(e=>{switch(e){case"success":return XP;case"info":return ZP;case"warning":return QP;case"error":return JP;default:return null}})(ae);var Ee,je,Ce,Pe;return H.createElement("li",{tabIndex:0,ref:ne,className:uN(C,se,null==L?void 0:L.toast,null==d||null==(t=d.classNames)?void 0:t.toast,null==L?void 0:L.default,null==L?void 0:L[ae],null==d||null==(n=d.classNames)?void 0:n[ae]),"data-sonner-toast":"","data-rich-colors":null!=(Ee=d.richColors)?Ee:w,"data-styled":!Boolean(d.jsx||d.unstyled||f),"data-mounted":F,"data-promise":Boolean(d.promise),"data-swiped":K,"data-removed":$,"data-visible":oe,"data-y-position":ge,"data-x-position":ve,"data-index":v,"data-front":re,"data-swiping":U,"data-dismissible":ie,"data-type":ae,"data-invert":xe,"data-swipe-out":G,"data-swipe-direction":I,"data-expanded":Boolean(b||R&&F),"data-testid":d.testId,style:{"--index":v,"--toasts-before":v,"--z-index":y.length-v,"--offset":`${$?X:pe.current}px`,"--initial-height":R?"auto":`${Z}px`,...S,...d.style},onDragEnd:()=>{W(!1),O(null),me.current=null},onPointerDown:e=>{2!==e.button&&!we&&ie&&(te.current=new Date,Q(pe.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(W(!0),me.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,n;if(G||!ie)return;me.current=null;const r=Number((null==(e=ne.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),o=Number((null==(t=ne.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),a=(new Date).getTime()-(null==(n=te.current)?void 0:n.getTime()),i="x"===A?r:o,s=Math.abs(i)/a;if(Math.abs(i)>=45||s>.11)return Q(pe.current),null==d.onDismiss||d.onDismiss.call(d,d),z("x"===A?r>0?"right":"left":o>0?"down":"up"),ke(),void Y(!0);var l,u;null==(l=ne.current)||l.style.setProperty("--swipe-amount-x","0px"),null==(u=ne.current)||u.style.setProperty("--swipe-amount-y","0px"),q(!1),W(!1),O(null)},onPointerMove:t=>{var n,r,o;if(!me.current||!ie)return;if((null==(n=window.getSelection())?void 0:n.toString().length)>0)return;const a=t.clientY-me.current.y,i=t.clientX-me.current.x;var s;const l=null!=(s=e.swipeDirections)?s:function(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}(T);!A&&(Math.abs(i)>1||Math.abs(a)>1)&&O(Math.abs(i)>Math.abs(a)?"x":"y");let u={x:0,y:0};const c=e=>1/(1.5+Math.abs(e)/20);if("y"===A){if(l.includes("top")||l.includes("bottom"))if(l.includes("top")&&a<0||l.includes("bottom")&&a>0)u.y=a;else{const e=a*c(a);u.y=Math.abs(e)<Math.abs(a)?e:a}}else if("x"===A&&(l.includes("left")||l.includes("right")))if(l.includes("left")&&i<0||l.includes("right")&&i>0)u.x=i;else{const e=i*c(i);u.x=Math.abs(e)<Math.abs(i)?e:i}(Math.abs(u.x)>0||Math.abs(u.y)>0)&&q(!0),null==(r=ne.current)||r.style.setProperty("--swipe-amount-x",`${u.x}px`),null==(o=ne.current)||o.style.setProperty("--swipe-amount-y",`${u.y}px`)}},ce&&!d.jsx&&"loading"!==ae?H.createElement("button",{"aria-label":_,"data-disabled":we,"data-close-button":!0,onClick:we||!ie?()=>{}:()=>{ke(),null==d.onDismiss||d.onDismiss.call(d,d)},className:uN(null==L?void 0:L.closeButton,null==d||null==(r=d.classNames)?void 0:r.closeButton)},null!=(je=null==D?void 0:D.close)?je:eN):null,(ae||d.icon||d.promise)&&null!==d.icon&&(null!==(null==D?void 0:D[ae])||d.icon)?H.createElement("div",{"data-icon":"",className:uN(null==L?void 0:L.icon,null==d||null==(o=d.classNames)?void 0:o.icon)},d.promise||"loading"===d.type&&!d.icon?d.icon||((null==D?void 0:D.loading)?H.createElement("div",{className:uN(null==L?void 0:L.loader,null==d||null==(Pe=d.classNames)?void 0:Pe.loader,"sonner-loader"),"data-visible":"loading"===ae},D.loading):H.createElement(qP,{className:uN(null==L?void 0:L.loader,null==d||null==(Ce=d.classNames)?void 0:Ce.loader),visible:"loading"===ae})):null,"loading"!==d.type?Se:null):null,H.createElement("div",{"data-content":"",className:uN(null==L?void 0:L.content,null==d||null==(a=d.classNames)?void 0:a.content)},H.createElement("div",{"data-title":"",className:uN(null==L?void 0:L.title,null==d||null==(i=d.classNames)?void 0:i.title)},d.jsx?d.jsx:"function"==typeof d.title?d.title():d.title),d.description?H.createElement("div",{"data-description":"",className:uN(P,le,null==L?void 0:L.description,null==d||null==(s=d.classNames)?void 0:s.description)},"function"==typeof d.description?d.description():d.description):null),H.isValidElement(d.cancel)?d.cancel:d.cancel&&iN(d.cancel)?H.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||E,onClick:e=>{iN(d.cancel)&&ie&&(null==d.cancel.onClick||d.cancel.onClick.call(d.cancel,e),ke())},className:uN(null==L?void 0:L.cancelButton,null==d||null==(l=d.classNames)?void 0:l.cancelButton)},d.cancel.label):null,H.isValidElement(d.action)?d.action:d.action&&iN(d.action)?H.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||j,onClick:e=>{iN(d.action)&&(null==d.action.onClick||d.action.onClick.call(d.action,e),e.defaultPrevented||ke())},className:uN(null==L?void 0:L.actionButton,null==d||null==(u=d.classNames)?void 0:u.actionButton)},d.action.label):null)};function dN(){if("undefined"==typeof window)return"ltr";if("undefined"==typeof document)return"ltr";const e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}function fN(e,t){const n={};return[e,t].forEach((e,t)=>{const r=1===t,o=r?"--mobile-offset":"--offset",a=r?"16px":"24px";function i(e){["top","right","bottom","left"].forEach(t=>{n[`${o}-${t}`]="number"==typeof e?`${e}px`:e})}"number"==typeof e||"string"==typeof e?i(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?n[`${o}-${t}`]=a:n[`${o}-${t}`]="number"==typeof e[t]?`${e[t]}px`:e[t]}):i(a)}),n}const pN=H.forwardRef(function(e,t){const{id:n,invert:r,position:o="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:s,className:l,offset:u,mobileOffset:c,theme:d="light",richColors:f,duration:p,style:h,visibleToasts:m=sN,toastOptions:g,dir:v=dN(),gap:y=lN,icons:b,containerAriaLabel:x="Notifications"}=e,[w,k]=H.useState([]),S=H.useMemo(()=>n?w.filter(e=>e.toasterId===n):w.filter(e=>!e.toasterId),[w,n]),E=H.useMemo(()=>Array.from(new Set([o].concat(S.filter(e=>e.position).map(e=>e.position)))),[S,o]),[j,C]=H.useState([]),[P,N]=H.useState(!1),[T,M]=H.useState(!1),[R,L]=H.useState("system"!==d?d:"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),D=H.useRef(null),_=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),A=H.useRef(null),O=H.useRef(!1),I=H.useCallback(e=>{k(t=>{var n;return(null==(n=t.find(t=>t.id===e.id))?void 0:n.delete)||nN.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return H.useEffect(()=>nN.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{k(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{ud.flushSync(()=>{k(t=>{const n=t.findIndex(t=>t.id===e.id);return-1!==n?[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]:[e,...t]})})})}),[w]),H.useEffect(()=>{if("system"!==d)return void L(d);if("system"===d&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),"undefined"==typeof window)return;const e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",({matches:e})=>{L(e?"dark":"light")})}catch(t){e.addListener(({matches:e})=>{try{L(e?"dark":"light")}catch(vT){console.error(vT)}})}},[d]),H.useEffect(()=>{w.length<=1&&N(!1)},[w]),H.useEffect(()=>{const e=e=>{var t;var n;a.every(t=>e[t]||e.code===t)&&(N(!0),null==(n=D.current)||n.focus());"Escape"!==e.code||document.activeElement!==D.current&&!(null==(t=D.current)?void 0:t.contains(document.activeElement))||N(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[a]),H.useEffect(()=>{if(D.current)return()=>{A.current&&(A.current.focus({preventScroll:!0}),A.current=null,O.current=!1)}},[D.current]),H.createElement("section",{ref:t,"aria-label":`${x} ${_}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},E.map((t,n)=>{var o;const[a,d]=t.split("-");return S.length?H.createElement("ol",{key:t,dir:"auto"===v?dN():v,tabIndex:-1,ref:D,className:l,"data-sonner-toaster":!0,"data-sonner-theme":R,"data-y-position":a,"data-x-position":d,style:{"--front-toast-height":`${(null==(o=j[0])?void 0:o.height)||0}px`,"--width":"356px","--gap":`${y}px`,...h,...fN(u,c)},onBlur:e=>{O.current&&!e.currentTarget.contains(e.relatedTarget)&&(O.current=!1,A.current&&(A.current.focus({preventScroll:!0}),A.current=null))},onFocus:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||O.current||(O.current=!0,A.current=e.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{T||N(!1)},onDragEnd:()=>N(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||M(!0)},onPointerUp:()=>M(!1)},S.filter(e=>!e.position&&0===n||e.position===t).map((n,o)=>{var a,l;return H.createElement(cN,{key:n.id,icons:b,index:o,toast:n,defaultRichColors:f,duration:null!=(a=null==g?void 0:g.duration)?a:p,className:null==g?void 0:g.className,descriptionClassName:null==g?void 0:g.descriptionClassName,invert:r,visibleToasts:m,closeButton:null!=(l=null==g?void 0:g.closeButton)?l:s,interacting:T,position:t,style:null==g?void 0:g.style,unstyled:null==g?void 0:g.unstyled,classNames:null==g?void 0:g.classNames,cancelButtonStyle:null==g?void 0:g.cancelButtonStyle,actionButtonStyle:null==g?void 0:g.actionButtonStyle,closeButtonAriaLabel:null==g?void 0:g.closeButtonAriaLabel,removeToast:I,toasts:S.filter(e=>e.position==n.position),heights:j.filter(e=>e.position==n.position),setHeights:C,expandByDefault:i,gap:y,expanded:P,swipeDirections:e.swipeDirections})})):null}))});function hN(e,t){switch(e){case"thinking":return"Thinking…";case"tool_use":return t?`${t}`:"Tool…";case"tool_result":return"Reading…";case"text":return"Writing…"}}function mN({status:e}){return ee.jsx("span",{className:ik("inline-block w-2 h-2 rounded-full",{"bg-green-500":"running"===e,"bg-zinc-400":"stopped"===e,"bg-yellow-400 animate-pulse":"restarting"===e})})}const gN=H.memo(function({project:e,active:t=!1,statusStack:n=[],onDelete:r,onArchive:o,onUnarchive:a,onUpdated:i}){var s,l;const u=cf(),[c,d]=W.useState(!1),[f,p]=W.useState(null),[h,m]=W.useState(!1),[g,v]=W.useState(e.name),y=W.useRef(null),b=!!e._sharedPermission;W.useEffect(()=>{let t=!1;return aE(e.id).then(({bytes:e})=>{t||p(e)}).catch(()=>{}),()=>{t=!0}},[e.id]);const x="view"===e._sharedPermission,w=t=>{t.stopPropagation(),v(e.name),m(!0),setTimeout(()=>{var e;return null==(e=y.current)?void 0:e.select()},0)},k=async()=>{const t=g.trim();if(t&&t!==e.name)try{const n=await ZS(e.id,t);null==i||i(n),m(!1)}catch(yT){aN.error("Rename failed",{description:null==yT?void 0:yT.message})}else m(!1)},S=ee.jsx(dw.div,{whileHover:e.archived||t?{}:{y:-2},transition:{duration:.2},children:ee.jsxs(sk,{className:ik("group cursor-pointer transition-colors relative",e.archived?"opacity-60 hover:opacity-80 hover:border-zinc-400":t?"border-transparent hover:border-transparent bg-transparent shadow-none":"hover:border-zinc-400 hover:shadow-md"),onClick:()=>!e.archived&&u(`/projects/${e.id}`),children:[ee.jsxs(lk,{className:"pb-2",children:[ee.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h?ee.jsx("input",{ref:y,className:"text-base leading-tight font-semibold bg-transparent border-b border-primary outline-none w-full min-w-0",value:g,onChange:e=>v(e.target.value),onBlur:()=>{k()},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),k()),"Escape"===e.key&&m(!1)},onClick:e=>e.stopPropagation()}):ee.jsx(uk,{className:ik("text-base leading-tight",e.archived&&"text-muted-foreground"),onDoubleClick:b||e.archived?void 0:w,children:e.name}),ee.jsx("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",children:!b&&ee.jsxs(ee.Fragment,{children:[e.archived?ee.jsx(Nk,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:t=>{t.stopPropagation(),a(e.id)},title:"Restore project",children:ee.jsx(AE,{className:"h-3.5 w-3.5"})}):ee.jsxs(ee.Fragment,{children:[ee.jsx(Nk,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:w,title:"Rename project",children:ee.jsx(aj,{className:"h-3.5 w-3.5"})}),ee.jsx(Nk,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:e=>{e.stopPropagation(),d(!0)},title:"共享设置",children:ee.jsx(mj,{className:"h-3.5 w-3.5"})}),ee.jsx(Nk,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:t=>{t.stopPropagation(),o(e.id)},title:"Archive project",children:ee.jsx(OE,{className:"h-3.5 w-3.5"})})]}),ee.jsx(Nk,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:t=>{t.stopPropagation(),confirm(`Delete project "${e.name}"? This cannot be undone.`)&&r(e.id)},title:"Delete project",children:ee.jsx(hj,{className:"h-3.5 w-3.5"})})]})})]}),ee.jsx("div",{className:"flex items-center gap-1.5",children:e.archived?ee.jsx(bj,{variant:"secondary",className:"text-xs",children:"Archived"}):ee.jsxs(ee.Fragment,{children:[ee.jsx(mN,{status:e.status}),ee.jsx("span",{className:"text-xs text-muted-foreground capitalize",children:e.status}),t&&n.length>0&&ee.jsx("div",{className:"ml-auto",children:ee.jsx(Yb,{mode:"wait",children:n.slice(-1).map(e=>ee.jsx(dw.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.25,ease:"easeOut"},children:ee.jsx(bj,{variant:"outline",className:"text-xs font-normal whitespace-nowrap",children:hN(e.phase,e.detail)})},e.id))})})]})})]}),ee.jsxs(dk,{className:"space-y-2",children:[ee.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[ee.jsx(WE,{className:"h-3.5 w-3.5 flex-shrink-0"}),ee.jsx("span",{className:"truncate font-mono",children:e.folderPath}),null!==f&&ee.jsx("span",{className:"flex-shrink-0 ml-auto text-muted-foreground/70",children:(E=f,E>=1073741824?(E/1073741824).toFixed(1)+" GB":E>=1048576?(E/1048576).toFixed(1)+" MB":Math.round(E/1024)+" KB")})]}),ee.jsxs("div",{className:"flex items-center gap-2",children:[ee.jsx(bj,{variant:"outline",className:"text-xs font-mono",children:e.cliTool??"claude"}),ee.jsx(bj,{variant:"unlimited"===e.permissionMode?"destructive":"secondary",className:"text-xs",children:"unlimited"===e.permissionMode?"Unlimited":"Limited"}),b&&ee.jsxs(bj,{variant:"outline",className:"text-xs gap-0.5",children:[x?ee.jsx(BE,{className:"h-3 w-3"}):ee.jsx(aj,{className:"h-3 w-3"}),x?"可见":"可编辑"]}),!b&&e.shares&&e.shares.length>0&&ee.jsxs(bj,{variant:"outline",className:"text-xs gap-0.5",children:[ee.jsx(mj,{className:"h-3 w-3"}),e.shares.length]}),ee.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(e.createdAt).toLocaleDateString()})]}),(e.tags??[]).length>0&&ee.jsxs("div",{className:"flex flex-wrap gap-1 mt-1",children:[(e.tags??[]).slice(0,3).map(e=>ee.jsxs("span",{className:"px-1.5 py-0 rounded-full text-[10px] bg-muted text-muted-foreground border border-border",children:["#",e]},e)),((null==(s=e.tags)?void 0:s.length)??0)>3&&ee.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["+",((null==(l=e.tags)?void 0:l.length)??0)-3]})]})]})]})});var E;const j=t&&!e.archived?ee.jsx("div",{className:"card-active-glow rounded-lg",children:S}):S;return ee.jsxs(ee.Fragment,{children:[j,!b&&i&&ee.jsx(YP,{project:e,open:c,onOpenChange:d,onUpdated:i})]})});function vN({onSelect:e}){const[t,n]=W.useState(""),[r,o]=W.useState(null),[a,i]=W.useState([]),[s,l]=W.useState(!0),[u,c]=W.useState(null),[d,f]=W.useState(!1),[p,h]=W.useState(""),[m,g]=W.useState(null),[v,y]=W.useState(!1),b=W.useRef(null),x=async e=>{l(!0),c(null);try{const t=await ES(e);n(t.path),o(t.parent),i(t.entries)}catch(yT){c(yT instanceof Error?yT.message:"Failed to load directory")}finally{l(!1)}};W.useEffect(()=>{x()},[]),W.useEffect(()=>{d&&setTimeout(()=>{var e;return null==(e=b.current)?void 0:e.focus()},0)},[d]);const w=()=>{f(!1),h(""),g(null)},k=async()=>{const e=p.trim();if(e){y(!0),g(null);try{const{path:n}=await PS(t,e);f(!1),h(""),await x(t),x(n)}catch(yT){g(yT instanceof Error?yT.message:"Failed to create folder")}finally{y(!1)}}},S=t.split("/").filter(Boolean);return ee.jsxs("div",{className:"flex flex-col h-64 border rounded-md overflow-hidden",children:[ee.jsxs("div",{className:"flex items-center gap-1 px-2 py-2 bg-muted border-b flex-shrink-0",children:[ee.jsx(Nk,{variant:"ghost",size:"sm",className:"h-6 px-1 flex-shrink-0",onClick:()=>{x()},title:"Home",children:ee.jsx(XE,{className:"h-3 w-3"})}),ee.jsx("div",{className:"flex items-center gap-1 flex-1 overflow-x-auto min-w-0",children:S.map((e,t)=>ee.jsxs(H.Fragment,{children:[ee.jsx(VE,{className:"h-3 w-3 text-muted-foreground flex-shrink-0"}),ee.jsx("button",{className:"text-xs hover:text-foreground text-muted-foreground whitespace-nowrap",onClick:()=>(e=>{const t="/"+S.slice(0,e+1).join("/");x(t)})(t),children:e})]},t))}),ee.jsxs(Nk,{variant:"ghost",size:"sm",className:"h-6 px-1.5 flex-shrink-0 gap-1 text-xs",onClick:()=>{h(""),g(null),f(!0)},disabled:d||s||!!u,title:"New folder",children:[ee.jsx(HE,{className:"h-3.5 w-3.5"}),ee.jsx("span",{className:"hidden sm:inline",children:"New folder"})]})]}),ee.jsxs("div",{className:"flex-1 overflow-y-auto",children:[s&&ee.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading..."}),u&&ee.jsx("div",{className:"flex items-center justify-center h-full text-sm text-destructive px-4 text-center",children:u}),!s&&!u&&ee.jsxs("div",{className:"p-1",children:[r&&ee.jsxs("button",{className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded hover:bg-accent hover:text-accent-foreground",onClick:()=>{x(r)},children:[ee.jsx(IE,{className:"h-4 w-4 text-muted-foreground"}),ee.jsx("span",{children:".."})]}),d&&ee.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5",children:[ee.jsx(GE,{className:"h-4 w-4 text-blue-500 flex-shrink-0"}),ee.jsx("input",{ref:b,className:ik("flex-1 text-sm bg-background border rounded px-1.5 py-0.5 outline-none","focus:ring-1 focus:ring-ring",m&&"border-destructive"),placeholder:"Folder name",value:p,onChange:e=>{h(e.target.value),g(null)},onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),k()):"Escape"===e.key&&w()},disabled:v}),ee.jsx("button",{className:"p-1 rounded hover:bg-accent disabled:opacity-50",onClick:()=>{k()},disabled:!p.trim()||v,title:"Create",children:ee.jsx(FE,{className:"h-3.5 w-3.5 text-green-600"})}),ee.jsx("button",{className:"p-1 rounded hover:bg-accent",onClick:w,disabled:v,title:"Cancel",children:ee.jsx(gj,{className:"h-3.5 w-3.5 text-muted-foreground"})})]}),m&&ee.jsx("p",{className:"px-3 pb-1 text-xs text-destructive",children:m}),0===a.length&&!d&&ee.jsx("div",{className:"text-sm text-muted-foreground px-2 py-4 text-center",children:"Empty directory"}),a.map(e=>ee.jsxs("button",{className:ik("flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded text-left","dir"===e.type?"hover:bg-accent hover:text-accent-foreground cursor-pointer":"opacity-40 cursor-not-allowed"),onClick:()=>{"dir"===e.type&&x(e.path)},disabled:"file"===e.type,children:["dir"===e.type?ee.jsx(GE,{className:"h-4 w-4 text-blue-500 flex-shrink-0"}):ee.jsx(UE,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),ee.jsx("span",{className:"truncate",children:e.name})]},e.path))]})]}),ee.jsxs("div",{className:"border-t px-3 py-2 flex items-center justify-between gap-2 flex-shrink-0 bg-background",children:[ee.jsx("span",{className:"text-xs text-muted-foreground truncate flex-1",children:t}),ee.jsx(Nk,{size:"sm",onClick:()=>e(t),disabled:!t,children:"Select this folder"})]})]})}const yN=[{value:"claude",label:"Claude",desc:"Anthropic Claude Code CLI"},{value:"opencode",label:"OpenCode",desc:"OpenCode CLI (sst/opencode)"},{value:"codex",label:"Codex",desc:"OpenAI Codex CLI"},{value:"qwen",label:"Qwen",desc:"Qwen Code CLI (QwenLM)"},{value:"gemini",label:"Gemini",desc:"Google Gemini CLI"},{value:"terminal",label:"Terminal",desc:"Plain shell (no AI CLI)"}],bN={claude:{limited:"claude",unlimited:"claude --dangerously-skip-permissions"},opencode:{limited:"opencode",unlimited:"opencode --dangerously-skip-permissions"},codex:{limited:"codex",unlimited:"codex --ask-for-approval never --sandbox danger-full-access"},qwen:{limited:"qwen-code",unlimited:"qwen-code --yolo"},gemini:{limited:"gemini",unlimited:"gemini --yolo"},terminal:{limited:"$SHELL (interactive)",unlimited:"$SHELL (interactive)"}};function xN({open:e,onOpenChange:t,onCreated:n}){const[r,o]=W.useState("name"),[a,i]=W.useState(""),[s,l]=W.useState(""),[u,c]=W.useState("claude"),[d,f]=W.useState("limited"),[p,h]=W.useState(!1),[m,g]=W.useState(null),v=e=>{e||(o("name"),i(""),l(""),c("claude"),f("limited"),g(null),h(!1)),t(e)},y=()=>{a.trim()?(g(null),o("folder")):g("Please enter a project name")},b=["name","folder","settings"];return ee.jsx(FP,{open:e,onOpenChange:v,children:ee.jsxs(BP,{className:"sm:max-w-lg",children:[ee.jsxs(UP,{children:[ee.jsx(HP,{children:{name:"New Project — Name",folder:"New Project — Select Folder",settings:"New Project — Settings"}[r]}),ee.jsxs(GP,{children:["name"===r&&"Give your project a name.","folder"===r&&"Choose the working directory for this project.","settings"===r&&"Choose the AI coding tool and run mode."]})]}),ee.jsx("div",{className:"flex gap-2 mb-2",children:b.map((e,t)=>ee.jsx("div",{className:"h-1.5 flex-1 rounded-full "+(r===e?"bg-primary":b.indexOf(r)>t?"bg-primary/40":"bg-muted")},e))}),"name"===r&&ee.jsxs("div",{className:"space-y-4",children:[ee.jsxs("div",{className:"space-y-2",children:[ee.jsx(_k,{htmlFor:"project-name",children:"Project Name"}),ee.jsx(Tk,{id:"project-name",placeholder:"My Project",value:a,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key&&y()},autoFocus:!0})]}),m&&ee.jsx("p",{className:"text-sm text-destructive",children:m})]}),"folder"===r&&ee.jsxs("div",{className:"space-y-2",children:[ee.jsx(_k,{children:"Working Directory"}),ee.jsx(vN,{onSelect:e=>{l(e),o("settings")}})]}),"settings"===r&&ee.jsxs("div",{className:"space-y-5",children:[ee.jsxs("div",{className:"space-y-2",children:[ee.jsx(_k,{children:"AI Coding Tool"}),ee.jsx("div",{className:"grid grid-cols-2 gap-2",children:yN.map(e=>ee.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer p-3 rounded-md border transition-colors "+(u===e.value?"border-primary bg-primary/5":"hover:bg-accent"),children:[ee.jsx("input",{type:"radio",name:"cliTool",value:e.value,checked:u===e.value,onChange:()=>c(e.value),className:"accent-primary"}),ee.jsxs("div",{children:[ee.jsx("div",{className:"font-medium text-sm",children:e.label}),ee.jsx("div",{className:"text-xs text-muted-foreground",children:e.desc})]})]},e.value))})]}),"terminal"!==u&&ee.jsxs("div",{className:"space-y-2",children:[ee.jsx(_k,{children:"Permission Mode"}),ee.jsxs("div",{className:"space-y-2",children:[ee.jsxs("label",{className:"flex items-start gap-3 cursor-pointer p-3 rounded-md border hover:bg-accent transition-colors",children:[ee.jsx("input",{type:"radio",name:"permissionMode",value:"limited",checked:"limited"===d,onChange:()=>f("limited"),className:"mt-0.5"}),ee.jsxs("div",{children:[ee.jsx("div",{className:"font-medium text-sm",children:"Limited"}),ee.jsxs("div",{className:"text-xs text-muted-foreground",children:["Runs ",ee.jsx("code",{className:"bg-muted px-1 rounded",children:bN[u].limited})," — asks for permission before file changes."]})]})]}),ee.jsxs("label",{className:"flex items-start gap-3 cursor-pointer p-3 rounded-md border hover:bg-accent transition-colors",children:[ee.jsx("input",{type:"radio",name:"permissionMode",value:"unlimited",checked:"unlimited"===d,onChange:()=>f("unlimited"),className:"mt-0.5"}),ee.jsxs("div",{children:[ee.jsx("div",{className:"font-medium text-sm",children:"Unlimited"}),ee.jsxs("div",{className:"text-xs text-muted-foreground",children:["Runs ",ee.jsx("code",{className:"bg-muted px-1 rounded",children:bN[u].unlimited})," — acts autonomously."]})]})]})]})]}),ee.jsxs("div",{className:"text-xs text-muted-foreground",children:[ee.jsx("span",{className:"font-medium",children:"Folder:"})," ",ee.jsx("span",{className:"font-mono",children:s})]}),m&&ee.jsx("p",{className:"text-sm text-destructive",children:m})]}),ee.jsxs(WP,{children:["name"!==r&&ee.jsx(Nk,{variant:"outline",onClick:()=>o("settings"===r?"folder":"name"),disabled:p,children:"Back"}),"name"===r&&ee.jsx(Nk,{onClick:y,children:"Next"}),"folder"===r&&ee.jsx(Nk,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),"settings"===r&&ee.jsx(Nk,{onClick:()=>{(async()=>{h(!0),g(null);try{const e=await rS({name:a.trim(),folderPath:s,permissionMode:d,cliTool:u});n(e),v(!1)}catch(yT){g(yT instanceof Error?yT.message:"Failed to create project")}finally{h(!1)}})()},disabled:p,children:p?"Creating...":"Create Project"})]})]})})}function wN({open:e,onOpenChange:t,onOpened:n}){const[r,o]=W.useState(""),[a,i]=W.useState(!1),[s,l]=W.useState(null),u=e=>{e||(o(""),l(null),i(!1)),t(e)};return ee.jsx(FP,{open:e,onOpenChange:u,children:ee.jsxs(BP,{className:"sm:max-w-lg",children:[ee.jsxs(UP,{children:[ee.jsx(HP,{children:"Open Existing Project"}),ee.jsxs(GP,{children:["Select a folder that contains a ",ee.jsx("code",{className:"bg-muted px-1 rounded text-xs",children:".ccweb/"})," configuration. The project's history and settings will be restored."]})]}),ee.jsxs("div",{className:"space-y-2",children:[ee.jsx(_k,{children:"Project Folder"}),ee.jsx(vN,{onSelect:e=>{(async e=>{o(e),i(!0),l(null);try{const t=await oS(e);n(t),u(!1)}catch(yT){l(yT instanceof Error?yT.message:"Failed to open project"),i(!1)}})(e)}})]}),s&&ee.jsx("p",{className:"text-sm text-destructive",children:s}),r&&!s&&a&&ee.jsxs("p",{className:"text-sm text-muted-foreground",children:["Opening project from ",r,"..."]}),ee.jsx(WP,{children:ee.jsx(Nk,{variant:"outline",onClick:()=>u(!1),disabled:a,children:"Cancel"})})]})})}const kN={feedback:{main:"#4a6cf7",light:"#6b8cff"},user:{main:"#22c55e",light:"#5ee87a"},project:{main:"#f59e0b",light:"#fbbf4e"},reference:{main:"#a78bfa",light:"#c4b5fd"}};function SN({balls:e,selectedId:t,activeCapacity:n,onClose:r}){var o;const[a,i]=W.useState(t),[s,l]=W.useState(new Map),u=W.useRef(null);W.useEffect(()=>{const e=e=>{"Escape"===e.key&&r()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[r]);const c=500,d=510,f=475,p=W.useMemo(()=>e.map(e=>Math.min(50,Math.max(24,16+.4*e.summary.length))),[e]),h=e.map(e=>`${e.id}:${e.buoyancy.toFixed(2)}`).join(",");W.useEffect(()=>{var t;null==(t=u.current)||t.call(u),u.current=null;let n=!1;return fd(()=>import("./matter-D8YF6GqH.js").then(e=>e.m),[]).then(t=>{if(n)return;const{Engine:r,Runner:o,Bodies:a,Composite:i,Body:s,Events:c}=t,h=r.create({gravity:{x:0,y:.8,scale:.001}}),m=30,g={isStatic:!0,restitution:.2,friction:.05},v=a.rectangle(300,10,270,m,g),y=a.rectangle(300,490,570,m,g),b=-150,x=Math.sqrt(225e3)+m,w=Math.atan2(450,b),k=a.rectangle(120,250,x,15,{...g,angle:w}),S=Math.sqrt(225e3)+m,E=Math.atan2(450,150),j=a.rectangle(480,250,S,15,{...g,angle:E}),C=new Array(e.length),P=[],N=e.map((e,t)=>t).sort((t,n)=>e[n].buoyancy-e[t].buoyancy);i.add(h.world,[v,y,k,j]),N.forEach((t,r)=>{const o=setTimeout(()=>{if(n)return;const r=p[t]/2,o=300+(Math.random()-.5)*d*.3,s=f-r-5,l=a.circle(o,s,r,{restitution:.2,friction:.01,frictionAir:.02,label:e[t].id});C[t]=l,i.add(h.world,l)},100*r);P.push(o)}),c.on(h,"beforeUpdate",()=>{for(let t=0;t<e.length;t++){const n=C[t];n&&s.applyForce(n,n.position,{x:0,y:-.001*e[t].buoyancy*n.mass})}});const T=o.create();let M;o.run(T,h);const R=()=>{const t=new Map;for(let n=0;n<e.length;n++){const r=C[n];r&&t.set(e[n].id,{x:r.position.x,y:r.position.y})}l(t),M=requestAnimationFrame(R)};M=requestAnimationFrame(R),u.current=()=>{P.forEach(clearTimeout),cancelAnimationFrame(M),o.stop(T),c.off(h,"beforeUpdate"),i.clear(h.world,!1),r.clear(h)}}),()=>{var e;n=!0,null==(e=u.current)||e.call(u),u.current=null}},[h,n]);const m=e.find(e=>e.id===a),g=Math.min(n,e.length);return ee.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:r,children:ee.jsxs("div",{className:"relative bg-background border border-border rounded-xl shadow-2xl overflow-hidden",style:{width:Math.min(640,window.innerWidth-40),height:Math.min(620,window.innerHeight-40)},onClick:e=>e.stopPropagation(),children:[ee.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border",children:[ee.jsx("span",{className:"text-sm font-medium",children:"记忆池全景"}),ee.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[ee.jsxs("span",{className:"flex items-center gap-1",children:[ee.jsx("span",{className:"w-2 h-2 rounded-full bg-blue-500 inline-block"})," feedback"]}),ee.jsxs("span",{className:"flex items-center gap-1",children:[ee.jsx("span",{className:"w-2 h-2 rounded-full bg-green-500 inline-block"})," user"]}),ee.jsxs("span",{className:"flex items-center gap-1",children:[ee.jsx("span",{className:"w-2 h-2 rounded-full bg-yellow-500 inline-block"})," project"]}),ee.jsxs("span",{className:"flex items-center gap-1",children:[ee.jsx("span",{className:"w-2 h-2 rounded-full bg-purple-400 inline-block"})," reference"]}),ee.jsx("button",{onClick:r,"aria-label":"关闭",className:"ml-2 text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-blue-500 rounded",children:ee.jsx(gj,{className:"w-4 h-4"})})]})]}),ee.jsxs("svg",{width:"100%",height:c,viewBox:"0 0 600 500",children:[ee.jsx("path",{d:"M 195 25 L 405 25 L 555 475 L 45 475 Z",fill:"none",className:"stroke-border",strokeWidth:1.5,strokeLinejoin:"round",opacity:.5}),ee.jsx("line",{x1:199,y1:27,x2:401,y2:27,className:"stroke-blue-500/30",strokeWidth:2}),e.map(e=>e.links.map(t=>{const n=s.get(e.id),r=s.get(t);return n&&r?ee.jsx("line",{x1:n.x,y1:n.y,x2:r.x,y2:r.y,stroke:"#4a6cf744",strokeWidth:1,strokeDasharray:"4,4"},`${e.id}-${t}`):null})),e.map((e,t)=>{const n=s.get(e.id);if(!n)return null;const r=p[t],o=t<g,l=e.id===a,u=kN[e.type]??kN.reference;return ee.jsxs("g",{onClick:()=>i(e.id),className:"cursor-pointer",opacity:o?1:.35,children:[ee.jsx("circle",{cx:n.x,cy:n.y,r:r/2,fill:`url(#grad-${e.type})`,stroke:l?"currentColor":"none",strokeWidth:l?2:0}),r>30&&ee.jsx("text",{x:n.x,y:n.y,textAnchor:"middle",dominantBaseline:"central",fill:"#fff",fontSize:Math.max(9,.15*r),pointerEvents:"none",children:e.summary.slice(0,Math.floor(r/5))}),l&&ee.jsx("circle",{cx:n.x,cy:n.y,r:r/2+4,fill:"none",stroke:u.main,strokeWidth:1.5,opacity:.6})]},e.id)}),ee.jsx("defs",{children:Object.entries(kN).map(([e,{main:t,light:n}])=>ee.jsxs("radialGradient",{id:`grad-${e}`,cx:"35%",cy:"35%",children:[ee.jsx("stop",{offset:"0%",stopColor:n}),ee.jsx("stop",{offset:"100%",stopColor:t})]},e))})]}),m&&ee.jsxs("div",{className:"absolute bottom-0 left-0 right-0 px-4 py-2 bg-background/95 border-t border-border",children:[ee.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[ee.jsx("span",{className:"text-[10px] px-1 py-px rounded text-white",style:{backgroundColor:(null==(o=kN[m.type])?void 0:o.main)??"#888"},children:m.type}),m.permanent&&ee.jsx("span",{className:"text-[10px] px-1 py-px rounded bg-orange-500/20 text-orange-400",children:"permanent"}),ee.jsx("span",{className:"text-xs font-medium text-foreground",children:m.summary})]}),ee.jsxs("div",{className:"flex gap-3 text-[10px] text-muted-foreground",children:[ee.jsxs("span",{children:["B=",m.buoyancy.toFixed(1)]}),ee.jsxs("span",{children:["H=",m.H]}),ee.jsxs("span",{children:["硬度=",m.hardness]}),m.links.length>0&&ee.jsxs("span",{children:["连线: ",m.links.join(", ")]})]})]})]})})}function EN(e,t){aN.success(`项目「${t}」的任务已完成`,{duration:1/0,action:{label:"查看",onClick:()=>{window.location.href=`/projects/${e}`}}})}const jN=`${"https:"===window.location.protocol?"wss:":"ws:"}//${window.location.host}`,CN=3e3;function PN(e,t){const n=W.useRef(null),r=W.useRef(0),o=W.useRef(!0),a=W.useRef(!1),i=W.useRef(null),s=W.useRef(t);s.current=t;const l=W.useRef(!1),u=W.useCallback(e=>{var t;(null==(t=n.current)?void 0:t.readyState)===WebSocket.OPEN&&n.current.send(JSON.stringify(e))},[]),c=W.useCallback((e,t)=>{var r;(null==(r=n.current)?void 0:r.readyState)===WebSocket.OPEN?(n.current.send(JSON.stringify({type:"terminal_subscribe",cols:e,rows:t})),l.current=!1):l.current=!0},[]),d=W.useCallback(e=>{u({type:"terminal_input",data:e})},[u]),f=W.useCallback((e,t)=>{u({type:"terminal_resize",cols:e,rows:t})},[u]),p=W.useCallback(()=>{u({type:"chat_subscribe"})},[u]),h=W.useCallback(()=>{if(!o.current)return;if(a.current)return;const t=qk();if(!t)return void(window.location.href="/login");a.current=!0;const u=new WebSocket(`${jN}/ws/projects/${e}`);n.current=u,u.onopen=()=>{a.current=!1,r.current=0,u.send(JSON.stringify({type:"auth",token:t}))},u.onmessage=e=>{var t,n,r,o,a,i,u,c,d,f,p,h,m,g,v,y,b,x,w,k;let S;try{S=JSON.parse(e.data)}catch{return}switch(S.type){case"connected":l.current=!1,null==(n=(t=s.current).onConnected)||n.call(t);break;case"terminal_data":null==(o=(r=s.current).onTerminalData)||o.call(r,S.data);break;case"status":null==(i=(a=s.current).onStatus)||i.call(a,S.status);break;case"chat_message":{const e=S;null==(c=(u=s.current).onChatMessage)||c.call(u,e);break}case"project_stopped":{const e=S;null==(f=(d=s.current).onProjectStopped)||f.call(d,e.projectId,e.projectName);break}case"plan_status":null==(h=(p=s.current).onPlanStatus)||h.call(p,S);break;case"plan_node_update":null==(g=(m=s.current).onPlanNodeUpdate)||g.call(m,S);break;case"plan_nudge":null==(y=(v=s.current).onPlanNudge)||y.call(v,S);break;case"plan_replan":null==(x=(b=s.current).onPlanReplan)||x.call(b,S);break;case"context_update":null==(k=(w=s.current).onContextUpdate)||k.call(w,S);break;case"error":console.error("[WS] Server error:",S.message)}},u.onclose=()=>{a.current=!1,n.current===u&&(n.current=null),o.current&&r.current<5&&(r.current++,i.current=window.setTimeout(h,CN))},u.onerror=e=>{a.current=!1,console.error("[WS] WebSocket error:",e)}},[e]);return W.useEffect(()=>(o.current=!0,h(),()=>{var e;o.current=!1,i.current&&(clearTimeout(i.current),i.current=null),null==(e=n.current)||e.close(),n.current=null}),[h]),{subscribeTerminal:c,sendTerminalInput:d,sendTerminalResize:f,subscribeChatMessages:p}}function NN(e){const t=W.useRef(null),n=W.useRef(0),r=W.useRef(!0),o=W.useRef(!1),a=W.useRef(null),i=W.useRef(e);i.current=e;const s=W.useCallback(()=>{if(!r.current)return;if(o.current)return;const e=qk();if(!e)return;o.current=!0;const l=new WebSocket(`${jN}/ws/dashboard`);t.current=l,l.onopen=()=>{o.current=!1,n.current=0,l.send(JSON.stringify({type:"auth",token:e}))},l.onmessage=e=>{var t,n;try{const r=JSON.parse(e.data);"activity_update"===r.type?i.current.onActivityUpdate(r):"project_stopped"===r.type&&(null==(n=(t=i.current).onProjectStopped)||n.call(t,r.projectId,r.projectName))}catch{}},l.onclose=()=>{o.current=!1,t.current===l&&(t.current=null),r.current&&n.current<5&&(n.current++,a.current=window.setTimeout(s,CN))},l.onerror=e=>{o.current=!1,console.error("[DashboardWS] Error:",e)}},[]);W.useEffect(()=>(r.current=!0,s(),()=>{var e;r.current=!1,a.current&&(clearTimeout(a.current),a.current=null),null==(e=t.current)||e.close(),t.current=null}),[s])}function TN({projectId:e,enabled:t,onChatMessage:n,onStatusChange:r,onContextUpdate:o}){const a=W.useRef(null),i=W.useRef(!0),s=W.useRef(0),l=W.useRef(null),u=W.useRef(!1),c=W.useRef(!1),d=W.useRef([]),f=W.useRef({onChatMessage:n,onStatusChange:r,onContextUpdate:o});f.current={onChatMessage:n,onStatusChange:r,onContextUpdate:o};const p=W.useCallback(()=>{if(c.current&&a.current&&a.current.readyState===WebSocket.OPEN)for(;d.current.length>0;){const e=d.current.shift();a.current.send(JSON.stringify({type:"terminal_input",data:e}))}},[]),h=W.useCallback(e=>{var t;c.current&&(null==(t=a.current)?void 0:t.readyState)===WebSocket.OPEN?a.current.send(JSON.stringify({type:"terminal_input",data:e})):d.current.push(e)},[]),m=W.useCallback(()=>{if(!i.current||!t)return;if(u.current)return;const n=qk();if(!n)return;u.current=!0,c.current=!1;const r=new WebSocket(`${jN}/ws/projects/${e}`);a.current=r,r.onopen=()=>{u.current=!1,s.current=0,r.send(JSON.stringify({type:"auth",token:n}))},r.onmessage=e=>{var t,n,o,a,i,s;try{const l=JSON.parse(e.data);"connected"===l.type?(r.send(JSON.stringify({type:"chat_subscribe"})),c.current=!0,p()):"chat_message"===l.type?f.current.onChatMessage(l):"status"===l.type&&l.status?null==(n=(t=f.current).onStatusChange)||n.call(t,l.status):"project_stopped"===l.type?null==(a=(o=f.current).onStatusChange)||a.call(o,"stopped"):"context_update"===l.type&&(null==(s=(i=f.current).onContextUpdate)||s.call(i,l))}catch{}},r.onclose=()=>{if(u.current=!1,c.current=!1,a.current===r&&(a.current=null),i.current&&t)if(s.current<5){s.current++;const e=2e3*Math.random();l.current=window.setTimeout(m,CN+e)}else d.current.length>0&&(console.warn("[MonitorWS] Retries exhausted, dropping",d.current.length,"queued messages"),d.current=[])},r.onerror=()=>{u.current=!1}},[e,t,p]);return W.useEffect(()=>(i.current=!0,()=>{i.current=!1,d.current=[]}),[]),W.useEffect(()=>(s.current=0,t&&m(),()=>{var e;c.current=!1,l.current&&(clearTimeout(l.current),l.current=null),null==(e=a.current)||e.close(),a.current=null}),[m,t]),{sendInput:h}}const MN=18e6,RN=6048e5;function LN(e,t=18e6){if(!e||void 0===e.utilization||e.utilization<=0||!e.resetAt)return null;const n=new Date(e.resetAt).getTime()-Date.now();if(n<=0)return null;const r=t-n;return r<=0?null:Math.round(e.utilization/(r/t))}function DN({label:e,bucket:t}){if(!t||void 0===t.utilization)return null;const n=t.utilization,r=n<50?"text-green-400":n<80?"text-yellow-400":"text-red-400",o=function(e){if(!e)return"";const t=new Date(e).getTime()-Date.now();if(t<=0)return"即将重置";const n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);return n>0?`${n}h${r}m`:`${r}m`}(t.resetAt);return ee.jsxs("span",{className:"text-muted-foreground whitespace-nowrap",children:[e," ",ee.jsxs("span",{className:ik("font-medium",r),children:[n,"%"]}),o&&ee.jsxs("span",{className:"text-muted-foreground/70 ml-0.5",children:["(",o,")"]})]})}function _N({className:e}){const[t,n]=W.useState("loading"),[r,o]=W.useState(!1),a=()=>Vk(Fk.usageMonitorTool,"claude");W.useEffect(()=>{const e=async()=>{try{n(await kS(a()))}catch{n(null)}};e();const t=setInterval(()=>{e()},3e5),r=()=>{e()},o=t=>{t.key===Fk.usageMonitorTool&&e()};return window.addEventListener("ccweb:usage-tool-change",r),window.addEventListener("storage",o),()=>{clearInterval(t),window.removeEventListener("ccweb:usage-tool-change",r),window.removeEventListener("storage",o)}},[]);if("loading"===t)return null;if(!t)return null;const i=!!t.fiveHour,s=!!t.sevenDay,l=!!t.sevenDaySonnet,u=!!t.sevenDayOpus,c=i||s||l||u,d=LN(t.fiveHour,MN),f=LN(t.sevenDay,RN),p=LN(t.sevenDaySonnet,RN),h=null!==d||null!==f||null!==p;return ee.jsxs("div",{className:ik("flex items-center gap-1.5 text-xs",e),children:[h&&ee.jsxs("span",{className:"flex items-center gap-1",children:[null!==d&&ee.jsxs("span",{className:ik("font-medium",d<=100?"text-green-400":"text-orange-400"),title:`5h 配速:按当前速率,窗口结束时预计使用 ${d}%`,children:[d,"%"]}),null!==f&&ee.jsxs(ee.Fragment,{children:[ee.jsx("span",{className:"text-muted-foreground/40",children:"/"}),ee.jsxs("span",{className:ik("font-medium",f<=100?"text-green-400":"text-orange-400"),title:`7d 配速:按当前速率,窗口结束时预计使用 ${f}%`,children:[f,"%"]})]}),null!==p&&ee.jsxs(ee.Fragment,{children:[ee.jsx("span",{className:"text-muted-foreground/40",children:"/"}),ee.jsxs("span",{className:ik("font-medium",p<=100?"text-green-400":"text-orange-400"),title:`7d Sonnet 配速:按当前速率,窗口结束时预计使用 ${p}%`,children:[p,"%"]})]})]}),t.planName&&ee.jsx("span",{className:"font-medium text-foreground bg-muted border border-border px-2 py-0.5 rounded-full",children:t.planName}),c&&ee.jsxs(ee.Fragment,{children:[ee.jsx("span",{className:"text-muted-foreground/50",children:"|"}),ee.jsx(DN,{label:"5h",bucket:t.fiveHour}),s&&ee.jsxs(ee.Fragment,{children:[ee.jsx("span",{className:"text-muted-foreground/50",children:"·"}),ee.jsx(DN,{label:"7d",bucket:t.sevenDay})]}),l&&ee.jsxs(ee.Fragment,{children:[ee.jsx("span",{className:"text-muted-foreground/50",children:"·"}),ee.jsx(DN,{label:"7d Sonnet",bucket:t.sevenDaySonnet})]}),u&&ee.jsxs(ee.Fragment,{children:[ee.jsx("span",{className:"text-muted-foreground/50",children:"·"}),ee.jsx(DN,{label:"7d Opus",bucket:t.sevenDayOpus})]})]}),ee.jsx("button",{onClick:()=>{(async()=>{o(!0);try{n(await SS(a()))}catch{n(null)}finally{o(!1)}})()},className:"text-muted-foreground hover:text-foreground transition-colors",title:"刷新用量信息",children:ee.jsx(sj,{className:ik("h-3 w-3",r&&"animate-spin")})})]})}function AN(){const[e,t]=W.useState([]),[n,r]=W.useState(!1),[o,a]=W.useState(""),[i,s]=W.useState(""),[l,u]=W.useState(""),[c,d]=W.useState(null),[f,p]=W.useState(""),[h,m]=W.useState(""),[g,v]=W.useState(""),y=W.useRef(null),b=W.useRef(null);W.useEffect(()=>{dS().then(t).catch(()=>t([]))},[]),W.useEffect(()=>{n&&setTimeout(()=>{var e;return null==(e=y.current)?void 0:e.focus()},0)},[n]),W.useEffect(()=>{c&&setTimeout(()=>{var e;return null==(e=b.current)?void 0:e.focus()},0)},[c]);const x=async()=>{const e=i.trim();if(e)try{const n=await fS({label:o.trim()||e,command:e,...l?{parentId:l}:{}});t(e=>[...e,n]),a(""),s(""),u(""),r(!1)}catch(yT){console.error("[GlobalShortcuts] Failed to add:",yT)}},w=async()=>{const e=h.trim();if(e&&c)try{const n=await pS(c,{label:f.trim()||e,command:e,parentId:g||null});t(e=>e.map(e=>e.id===c?n:e)),d(null)}catch(yT){console.error("[GlobalShortcuts] Failed to save:",yT)}};return ee.jsxs("section",{className:"mt-10",children:[ee.jsxs("div",{className:"flex items-center justify-between mb-4",children:[ee.jsxs("div",{className:"flex items-center gap-2",children:[ee.jsx(vj,{className:"h-4 w-4 text-muted-foreground"}),ee.jsx("h2",{className:"text-lg font-semibold",children:"全局快捷命令"}),ee.jsx("span",{className:"text-xs text-muted-foreground",children:"在所有项目的终端中可用"})]}),ee.jsxs("button",{onClick:()=>{r(e=>!e),d(null)},className:ik("flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-md border transition-colors",n?"border-border text-foreground bg-muted":"border-border text-muted-foreground hover:text-foreground hover:bg-muted"),children:[ee.jsx(ij,{className:"h-3.5 w-3.5"}),"新建"]})]}),n&&ee.jsxs("div",{className:"mb-4 p-4 rounded-lg border border-border bg-background space-y-3",children:[ee.jsx("input",{ref:y,placeholder:"名称(可选)",value:o,onChange:e=>a(e.target.value),className:"w-full text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground placeholder:text-muted-foreground outline-none focus:border-border transition-colors"}),ee.jsx("textarea",{placeholder:"命令内容…",value:i,onChange:e=>s(e.target.value),rows:3,className:"w-full text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground placeholder:text-muted-foreground font-mono outline-none focus:border-border transition-colors resize-none",onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),x()),"Escape"===e.key&&(r(!1),a(""),s(""),u(""))}}),ee.jsxs("div",{className:"flex items-center gap-2",children:[ee.jsx(YE,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),ee.jsxs("select",{value:l,onChange:e=>u(e.target.value),className:"flex-1 text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground outline-none focus:border-border transition-colors",children:[ee.jsx("option",{value:"",children:"无继承"}),e.map(e=>ee.jsx("option",{value:e.id,children:e.label},e.id))]})]}),ee.jsxs("div",{className:"flex items-center justify-between",children:[ee.jsx("span",{className:"text-xs text-muted-foreground",children:"⌘↩ 保存 · Esc 取消"}),ee.jsxs("div",{className:"flex gap-2",children:[ee.jsx("button",{onClick:()=>{r(!1),a(""),s("")},className:"text-sm px-3 py-1 rounded bg-secondary hover:bg-accent text-foreground transition-colors",children:"取消"}),ee.jsx("button",{onClick:()=>{x()},disabled:!i.trim(),className:ik("text-sm px-3 py-1 rounded transition-colors text-white",i.trim()?"bg-blue-600 hover:bg-blue-500":"bg-secondary opacity-40 cursor-not-allowed"),children:"保存"})]})]})]}),0!==e.length||n?ee.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:e.map(n=>c===n.id?ee.jsxs("div",{className:"rounded-lg border border-border bg-background p-3 space-y-2",children:[ee.jsx("input",{ref:b,value:f,onChange:e=>p(e.target.value),placeholder:"名称(可选)",className:"w-full text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground placeholder:text-muted-foreground outline-none focus:border-border transition-colors"}),ee.jsx("textarea",{value:h,onChange:e=>m(e.target.value),rows:3,className:"w-full text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground font-mono outline-none focus:border-border transition-colors resize-none",onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),w()),"Escape"===e.key&&d(null)}}),ee.jsxs("div",{className:"flex items-center gap-2",children:[ee.jsx(YE,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),ee.jsxs("select",{value:g,onChange:e=>v(e.target.value),className:"flex-1 text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground outline-none focus:border-border transition-colors",children:[ee.jsx("option",{value:"",children:"无继承"}),e.filter(e=>e.id!==n.id).map(e=>ee.jsx("option",{value:e.id,children:e.label},e.id))]})]}),ee.jsxs("div",{className:"flex gap-2 justify-end",children:[ee.jsx("button",{onClick:()=>d(null),className:"text-xs px-2.5 py-1 rounded bg-secondary hover:bg-accent text-foreground transition-colors",children:"取消"}),ee.jsx("button",{onClick:()=>{w()},disabled:!h.trim(),className:ik("text-xs px-2.5 py-1 rounded transition-colors text-white",h.trim()?"bg-blue-600 hover:bg-blue-500":"bg-secondary opacity-40 cursor-not-allowed"),children:"保存"})]})]},n.id):ee.jsxs("div",{className:"group relative rounded-lg border border-border bg-background hover:border-muted-foreground/30 transition-colors p-3",children:[ee.jsx("div",{className:"text-sm font-medium text-foreground truncate pr-14",children:n.label}),n.parentId&&(()=>{const t=e.find(e=>e.id===n.parentId);return t?ee.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[ee.jsx(YE,{className:"h-3 w-3 text-muted-foreground"}),ee.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["继承: ",t.label]})]}):null})(),!n.parentId&&n.label!==n.command&&ee.jsx("div",{className:"text-xs text-muted-foreground font-mono truncate mt-1 pr-14",children:n.command}),ee.jsxs("div",{className:"absolute top-2.5 right-2.5 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[ee.jsx("button",{onClick:()=>{d(n.id),p(n.label),m(n.command),v(n.parentId||""),r(!1)},className:"p-1 rounded text-muted-foreground hover:text-blue-400 transition-colors",title:"编辑",children:ee.jsx(aj,{className:"h-3.5 w-3.5"})}),ee.jsx("button",{onClick:()=>{(async e=>{try{await hS(e),t(t=>t.filter(t=>t.id!==e)),c===e&&d(null)}catch(yT){console.error("[GlobalShortcuts] Failed to delete:",yT)}})(n.id)},className:"p-1 rounded text-muted-foreground hover:text-red-400 transition-colors",title:"删除",children:ee.jsx(gj,{className:"h-3.5 w-3.5"})})]})]},n.id))}):ee.jsxs("div",{className:"flex flex-col items-center gap-2 py-10 text-muted-foreground/50 border border-dashed border-border rounded-lg",children:[ee.jsx(vj,{className:"h-6 w-6"}),ee.jsx("p",{className:"text-sm",children:"还没有全局快捷命令"})]})]})}const ON=W.createContext({theme:"system",resolved:"dark",setTheme:()=>{}});function IN(){return W.useSyncExternalStore(e=>{const t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},()=>window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")}function zN({children:e}){const[t,n]=W.useState(()=>Vk(Fk.theme,"system")),r=IN(),o="system"===t?r:t;W.useEffect(()=>{const e=document.documentElement;e.classList.remove("light","dark"),e.classList.add(o)},[o]);return ee.jsx(ON.Provider,{value:{theme:t,resolved:o,setTheme:e=>{n(e),$k(Fk.theme,e)}},children:e})}function FN(){return W.useContext(ON)}function VN(){const{theme:e,setTheme:t}=FN(),n=[{value:"light",icon:dj,label:"浅色"},{value:"dark",icon:oj,label:"深色"},{value:"system",icon:rj,label:"系统"}];return ee.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5",children:n.map(({value:n,icon:r,label:o})=>ee.jsx("button",{onClick:()=>t(n),className:ik("p-1 rounded-sm transition-colors",e===n?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),title:o,children:ee.jsx(r,{className:"h-3.5 w-3.5"})},n))})}const $N={workMinutes:30,breakMinutes:5};function BN(){return Vk(Fk.pomodoroConfig,$N,!0)}const UN=zk(e=>({running:!1,phase:"work",secondsLeft:60*BN().workMinutes,setRunning:t=>e({running:t}),setPhase:t=>e({phase:t}),setSecondsLeft:t=>e({secondsLeft:t})}));function WN(){const{running:e,phase:t,secondsLeft:n,setPhase:r,setSecondsLeft:o}=UN(),a=W.useCallback(e=>{const t=BN();var n;r(e),o("work"===e?60*t.workMinutes:60*t.breakMinutes),n="break"===e?"休息一下 ☕":"该工作了 💻",aN.info(`番茄钟: ${n}`)},[r,o]);return W.useEffect(()=>{if(!e)return;if(0===n)return void a("work"===t?"break":"work");const r=setTimeout(()=>o(n-1),1e3);return()=>clearTimeout(r)},[e,n,t,a,o]),null}function HN(){const{running:e,phase:t,secondsLeft:n}=UN(),r=Math.floor(n/60),o=n%60,a=`${String(r).padStart(2,"0")}:${String(o).padStart(2,"0")}`;return e?ld.createPortal(ee.jsxs("div",{className:"fixed inset-0 flex flex-col items-center justify-center pointer-events-none z-40 select-none",style:{opacity:"work"===t?.1:.6},children:[ee.jsx("div",{className:ik("font-mono font-bold tabular-nums leading-none","work"===t?"text-foreground":"text-blue-400 dark:text-blue-300"),style:{fontSize:"clamp(360px, 90vw, 1100px)"},children:a}),ee.jsx("div",{className:"mt-3 text-muted-foreground font-medium tracking-widest uppercase",style:{fontSize:"clamp(12px, 1.5vw, 20px)"},children:"work"===t?"专注工作":"休息一下"})]}),document.body):null}function GN(){const{running:e,phase:t,secondsLeft:n,setRunning:r,setPhase:o,setSecondsLeft:a}=UN(),i=Math.floor(n/60),s=n%60,l=`${String(i).padStart(2,"0")}:${String(s).padStart(2,"0")}`;return ee.jsx("button",{onClick:()=>{if(e){const e=BN();o("work"),a(60*e.workMinutes)}else{const e=BN();o("work"),a(60*e.workMinutes)}r(!e)},className:ik("p-1 rounded transition-colors",e?"work"===t?"text-red-500 bg-red-500/10 hover:bg-red-500/20":"text-green-500 bg-green-500/10 hover:bg-green-500/20":"text-muted-foreground hover:text-foreground hover:bg-muted"),title:e?"work"===t?`工作中 ${l} — 点击停止`:`休息中 ${l} — 点击停止`:"启动番茄钟",children:ee.jsx(pj,{className:"h-4 w-4"})})}const YN="v2026.4.17",KN=!!window.electronUpdater;function qN(){const[e,t]=W.useState("idle"),[n,r]=W.useState(!1),[o,a]=W.useState(""),[i,s]=W.useState(0),[l,u]=W.useState(null),[c,d]=W.useState(null);W.useEffect(()=>{if(!window.electronUpdater)return;return window.electronUpdater.onUpdateStatus(e=>{switch(e.type){case"progress":{const t=e.info;s(Math.round((null==t?void 0:t.percent)??0));break}case"downloaded":t("downloaded");break;case"error":u(e.info||"Download failed"),t("error")}})},[]);const f=W.useCallback(async()=>{t("checking"),u(null),r(!0);try{if(KN){const e=await window.electronUpdater.checkForUpdate();if(e.error)throw new Error(e.error);if(!e.available)return void t("no_update");a(e.version?`v${e.version}`:"new version")}else{const e=await RS();if(!e.updateAvailable)return void t("no_update");a(`v${e.latest}`)}t("update_available")}catch(yT){u(yT instanceof Error?yT.message:"Check failed"),t("error")}},[]),p=W.useCallback(()=>{const e=3e3,n=Date.now(),r=()=>{if(Date.now()-n>3e5)return u("更新超时(5 分钟)— 请检查服务器状态"),void t("update_failed");DS().then(n=>{n?n.success?(a(n.newVersion?`v${n.newVersion}`:"new version"),t("update_complete")):(u(n.error||"Update failed"),t("update_failed")):setTimeout(r,e)}).catch(()=>{setTimeout(r,e)})};setTimeout(r,e)},[]),h=()=>{r(!1),setTimeout(()=>{t("idle"),a(""),u(null),s(0),d(null)},200)};return ee.jsxs(ee.Fragment,{children:[ee.jsx(Nk,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>{f()},disabled:"checking"===e||"downloading"===e||"executing"===e||"reconnecting"===e,title:"检查更新",children:"checking"===e||"downloading"===e||"executing"===e||"reconnecting"===e?ee.jsx(ZE,{className:"h-4 w-4 animate-spin"}):ee.jsx($E,{className:"h-4 w-4"})}),ee.jsx(FP,{open:n,onOpenChange:e=>{e||h()},children:ee.jsxs(BP,{className:"sm:max-w-md",children:[ee.jsxs(UP,{children:[ee.jsxs(HP,{children:["checking"===e&&"Checking for updates...","no_update"===e&&"Up to date","update_available"===e&&`Update ${o} available`,"downloading"===e&&"Downloading update...","downloaded"===e&&"Update ready to install","executing"===e&&"Updating server...","reconnecting"===e&&"Waiting for server restart...","update_complete"===e&&`Updated to ${o}`,"update_failed"===e&&"Update failed","error"===e&&"Update error"]}),ee.jsxs(GP,{children:["checking"===e&&"Checking for the latest version...","no_update"===e&&`Current version ${YN} is the latest.`,"update_available"===e&&"A new version is available. "+(KN?"Click download to update automatically.":""),"downloading"===e&&`Downloading... ${i}%`,"downloaded"===e&&"The update has been downloaded. Click install to restart and apply.","executing"===e&&"Server is shutting down and installing the update. Please wait...","reconnecting"===e&&"Update installed. Waiting for server to restart...","update_complete"===e&&`Successfully updated from ${YN} to ${o}. Click reload to use the new version.`,"update_failed"===e&&(l||"Update failed. You may need to restart the server manually."),"error"===e&&(l||"An error occurred.")]})]}),"downloading"===e&&ee.jsx("div",{className:"w-full bg-muted rounded-full h-2 overflow-hidden",children:ee.jsx("div",{className:"bg-primary h-full transition-all duration-300",style:{width:`${i}%`}})}),("executing"===e||"reconnecting"===e)&&ee.jsx("div",{className:"flex items-center justify-center py-6",children:ee.jsx(ZE,{className:"h-8 w-8 animate-spin text-muted-foreground"})}),ee.jsxs(WP,{children:["no_update"===e&&ee.jsx(Nk,{onClick:h,children:"OK"}),"update_available"===e&&ee.jsxs(ee.Fragment,{children:[ee.jsx(Nk,{variant:"outline",onClick:h,children:"Later"}),ee.jsx(Nk,{onClick:()=>{(async()=>{if(KN){t("downloading"),s(0);const e=await window.electronUpdater.downloadUpdate();e.success?e.path&&d(e.path):(u(e.error||"Download failed"),t("error"))}else{t("executing");try{await LS(),t("reconnecting"),p()}catch(yT){u(yT instanceof Error?yT.message:"Execute failed"),t("error")}}})()},children:KN?"Download & Install":`Update to ${o}`})]}),"downloaded"===e&&ee.jsxs(ee.Fragment,{children:[ee.jsx(Nk,{variant:"outline",onClick:h,children:"Later"}),ee.jsx(Nk,{onClick:()=>{var e;null==(e=window.electronUpdater)||e.quitAndInstall(c||void 0)},children:"Restart & Install"})]}),"update_complete"===e&&ee.jsx(Nk,{onClick:()=>window.location.reload(),children:"Reload Page"}),"update_failed"===e&&ee.jsx(Nk,{onClick:h,children:"Close"}),"error"===e&&ee.jsx(Nk,{onClick:h,children:"Close"})]})]})})]})}function XN(e){return e.filter(e=>"text"===e.type||"tool_use"===e.type||"tool_result"===e.type).map(e=>{if("tool_use"===e.type){return`[工具] ${e.content.length>60?e.content.slice(0,60)+"...":e.content}`}if("tool_result"===e.type){return`→ ${e.content.length>80?e.content.slice(0,80)+"...":e.content}`}return e.content}).join("\n")}const QN=H.memo(function({project:e,externalStatus:t,active:n=!1}){const r=cf(),[o,a]=W.useState("running"===e.status?"live":"stopped"),[i,s]=W.useState([]),[l,u]=W.useState(""),[c,d]=W.useState(!1),f=W.useRef(null),p=W.useRef(null),h=W.useRef(null),m=W.useRef(0),g=W.useCallback(async()=>{try{const t=await JS(e.id,1);if(0===t.length)return;const n=(await eE(e.id,t[0].id,"latest","user")).content.split(/(?=^## [UA]\d+)/m).filter(Boolean),r=[];for(const e of n){const t=e.match(/^## ([UA])(\d+).*\n/);if(!t)continue;const n="U"===t[1]?"user":"assistant",o=e.slice(t[0].length).trim();o&&r.push({role:n,content:o,ts:""})}s(e=>0===e.length?r.slice(-4):e)}catch{}},[e.id]);W.useEffect(()=>{"stopped"===o&&g()},[o,g]);const v=W.useRef(!1);W.useEffect(()=>{if("live"!==o)return void(v.current=!1);const e=setTimeout(()=>{v.current||g()},3e3);return()=>clearTimeout(e)},[o,g]),W.useEffect(()=>{t&&("running"!==t||"stopped"!==o&&"error"!==o?"stopped"===t&&"live"===o&&a("stopped"):(s([]),a("live")))},[t]);const y=W.useCallback(e=>{v.current=!0;const t=XN(e.blocks);t.trim()&&(s(n=>[...n,{role:e.role,content:t,ts:e.timestamp}].slice(-4)),"assistant"===e.role&&(d(!0),setTimeout(()=>d(!1),1e3)))},[]),b=W.useCallback(e=>{"stopped"===e&&a("stopped")},[]),{sendInput:x}=TN({projectId:e.id,enabled:"live"===o||"waking"===o,onChatMessage:y,onStatusChange:b});W.useEffect(()=>{if("live"===o&&f.current){const e=f.current;f.current=null,x(e+"\r")}},[o,x]),W.useEffect(()=>{var e;null==(e=p.current)||e.scrollTo({top:p.current.scrollHeight,behavior:"smooth"})},[i]),W.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const w=W.useCallback(()=>{const t=l.trim();if(t)if(u(""),"live"===o||"waking"===o)x(t+"\r");else if("stopped"===o||"error"===o){f.current=t;const n=++m.current;a("waking"),iS(e.id).then(()=>{n===m.current&&(s([]),a("live"))}).catch(e=>{n===m.current&&(aN.error(`启动失败: ${e instanceof Error?e.message:String(e)}`),a("error"),u(t),f.current=null)}),h.current=setTimeout(()=>{n===m.current&&f.current&&(aN.error("启动超时(10s)"),a("error"),u(f.current),f.current=null)},1e4)}},[l,o,e.id,x]),k="live"===o,S="stopped"===o,E="waking"===o,j=ee.jsxs("div",{className:ik("flex flex-col h-full rounded-lg overflow-hidden bg-background transition-colors duration-300",n?"border-transparent bg-transparent shadow-none":c?"border border-blue-500":"border border-border","error"===o&&"border border-red-500/50"),children:[ee.jsxs("div",{className:"flex items-center gap-1 px-1.5 py-1.5 border-b border-border bg-muted/30 transition-colors",children:[ee.jsx(qE,{className:"h-3.5 w-3.5 text-muted-foreground/40 flex-shrink-0 cursor-grab active:cursor-grabbing"}),ee.jsx("span",{className:"font-medium text-sm truncate flex-1 cursor-pointer hover:text-blue-400 transition-colors",onClick:()=>r(`/projects/${e.id}`),title:"打开项目详情",children:e.name}),ee.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:e.cliTool??"claude"}),ee.jsx("span",{className:ik("w-2 h-2 rounded-full flex-shrink-0",k?"bg-green-500":E?"bg-yellow-400 animate-pulse":"bg-zinc-400")})]}),ee.jsxs("div",{ref:p,className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-0 text-xs",children:[i.map((e,t)=>{const n="user"===e.role;return ee.jsx("div",{className:ik("flex",n?"justify-end":"justify-start"),children:ee.jsx("div",{className:ik("max-w-[85%] rounded-lg px-2.5 py-1.5 whitespace-pre-wrap break-words leading-relaxed",n?"bg-blue-500/15 text-foreground border border-blue-500/20 rounded-br-sm dark:bg-blue-500/20 dark:border-blue-500/25":"bg-secondary text-secondary-foreground border border-border rounded-bl-sm"),children:ee.jsx("div",{className:"line-clamp-6",children:e.content})})},t)}),S&&0===i.length&&ee.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground/40 text-xs",children:"无对话记录"}),E&&ee.jsx("div",{className:"flex items-center justify-center h-full text-yellow-400 text-xs animate-pulse",children:"启动中..."})]}),ee.jsx("div",{className:"border-t border-border p-1.5",children:ee.jsx("input",{type:"text",value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{"Enter"===e.key&&e.shiftKey&&(e.preventDefault(),w())},disabled:E,placeholder:E?"启动中...":S?"输入命令(自动启动)... Shift+⏎":"输入命令... Shift+⏎",className:ik("w-full bg-transparent text-xs font-mono outline-none placeholder:text-muted-foreground/40 px-1.5 py-1",E&&"opacity-50 cursor-not-allowed")})})]});return n?ee.jsx("div",{className:"card-active-glow rounded-lg h-full",children:j}):j}),ZN="ccweb:monitor-order";function JN(){try{return JSON.parse(localStorage.getItem(ZN)||"[]")}catch{return[]}}function eT({projects:e,projectStatuses:t,activeProjectIds:n}){const r=W.useMemo(()=>e.filter(e=>!e.archived),[e]),[o,a]=W.useState(JN),[i,s]=W.useState(null),[l,u]=W.useState(null),c=W.useRef(null),d=W.useMemo(()=>function(e,t){const n=new Map(t.map((e,t)=>[e,t]));return[...e].sort((e,t)=>{const r=n.get(e.id)??1/0,o=n.get(t.id)??1/0;return r===o?0:r-o})}(r,o),[r,o]);W.useEffect(()=>{var e;o.length>0&&(e=o,localStorage.setItem(ZN,JSON.stringify(e)))},[o]);const f=W.useCallback((e,t)=>{s(t),e.dataTransfer.effectAllowed="move";const n=document.createElement("div");n.style.width="1px",n.style.height="1px",n.style.opacity="0.01",document.body.appendChild(n),e.dataTransfer.setDragImage(n,0,0),c.current=n},[]),p=W.useCallback((e,t)=>{e.preventDefault(),e.dataTransfer.dropEffect="move",u(t)},[]),h=W.useCallback((e,t)=>{if(e.preventDefault(),!i||i===t)return s(null),void u(null);const n=d.map(e=>e.id),r=n.indexOf(i),o=n.indexOf(t);if(-1===r||-1===o)return s(null),void u(null);n.splice(r,1),n.splice(o,0,i),a(n),s(null),u(null)},[i,d]),m=W.useCallback(()=>{s(null),u(null),c.current&&(c.current.remove(),c.current=null)},[]),{cols:g,rows:v}=(y=d.length)<=1?{cols:1,rows:1}:y<=2?{cols:2,rows:1}:y<=4?{cols:2,rows:2}:y<=6?{cols:3,rows:2}:y<=9?{cols:3,rows:3}:y<=12?{cols:4,rows:3}:{cols:4,rows:Math.ceil(y/4)};var y;if(0===d.length)return ee.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground/50 text-sm",children:"没有活跃项目"});const b=v<=3;return ee.jsx("div",{className:"h-full w-full p-2 gap-2 overflow-y-auto",style:{display:"grid",gridTemplateColumns:`repeat(${g}, minmax(0, 1fr))`,gridAutoRows:b?`minmax(180px, min(${Math.floor(100/v)}vh, 350px))`:"280px"},children:d.map(e=>ee.jsx("div",{draggable:!0,onDragStart:t=>f(t,e.id),onDragOver:t=>p(t,e.id),onDrop:t=>h(t,e.id),onDragEnd:m,className:ik("transition-all duration-200",i===e.id&&"opacity-40 scale-95",l===e.id&&i!==e.id&&"ring-2 ring-blue-500/50 rounded-lg"),children:ee.jsx(QN,{project:e,externalStatus:t.get(e.id),active:n.has(e.id)})},e.id))})}function tT(){const e=cf(),{projects:t,loading:n,error:r,hasFetched:o,fetchProjects:a,addProject:i,updateProject:s,removeProject:l}=Gk(),u=Wk(e=>e.clearToken),[c,d]=W.useState(!1),[f,p]=W.useState(!1),[h,m]=W.useState(new Set),g=W.useRef(new Map),[v,y]=W.useState(new Map),b=W.useRef(0),[x,w]=W.useState(!!document.fullscreenElement),[k,S]=W.useState(!1),[E,j]=Uk(Fk.monitorMode,!1,{parse:!0}),[C,P]=W.useState(new Map),[N,T]=W.useState(!1),[M,R]=W.useState(null);W.useEffect(()=>{const e=()=>w(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]),W.useEffect(()=>{a()},[a]);NN({onActivityUpdate:W.useCallback(e=>{if(e.status){const t=Gk.getState().projects.find(t=>t.id===e.projectId);t&&t.status!==e.status&&s({...t,status:e.status}),P(t=>{const n=new Map(t);return n.set(e.projectId,e.status),n})}const t=Date.now(),n=g.current;if(e.active){m(t=>t.has(e.projectId)?t:new Set(t).add(e.projectId));const r=n.get(e.projectId)??[];let o=!1;if(e.semantic){const n=r[r.length-1];`${e.semantic.phase}:${e.semantic.detail??""}`!==(n?`${n.phase}:${n.detail??""}`:"")?(r.push({id:b.current++,phase:e.semantic.phase,detail:e.semantic.detail,ts:t}),o=!0):n&&(n.ts=t)}const a=r.filter(e=>t-e.ts<8e3),i=a.length>3?a.slice(-3):a;i.length!==r.length&&(o=!0),n.set(e.projectId,i),o&&y(new Map(n))}else m(t=>{if(!t.has(e.projectId))return t;const n=new Set(t);return n.delete(e.projectId),n}),n.has(e.projectId)&&n.get(e.projectId).length>0&&(n.set(e.projectId,[]),y(new Map(n)))},[s]),onProjectStopped:W.useCallback((e,t)=>{EN(e,t)},[])}),W.useEffect(()=>{const e=setInterval(()=>{const e=Date.now(),t=g.current;let n=!1;for(const[r,o]of t){const a=o.filter(t=>e-t.ts<8e3);a.length!==o.length&&(t.set(r,a),n=!0)}n&&y(new Map(t)),m(e=>{let n=!1;const r=new Set(e);for(const o of e){const e=t.get(o);e&&0!==e.length||(r.delete(o),n=!0)}return n?r:e})},3e3);return()=>clearInterval(e)},[]);const L=W.useMemo(()=>t.filter(e=>!e.archived),[t]),D=W.useMemo(()=>t.filter(e=>e.archived),[t]),_=W.useMemo(()=>Array.from(new Set(t.flatMap(e=>e.tags??[]))),[t]),[A,O]=W.useState([]),I=W.useMemo(()=>0===A.length?L:L.filter(e=>A.some(t=>{var n;return null==(n=e.tags)?void 0:n.includes(t)})),[L,A]),[z,F]=Uk(Fk.projectOrder,[],{parse:!0}),[V,$]=W.useState(null),[B,U]=W.useState(null);W.useEffect(()=>{if(0===L.length)return;const e=L.map(e=>e.id);F(t=>{const n=[...t.filter(t=>e.includes(t)),...e.filter(e=>!t.includes(e))];return n.join(",")===t.join(",")?t:n})},[L]);const H=W.useMemo(()=>0===z.length?I:[...I].sort((e,t)=>{const n=z.indexOf(e.id),r=z.indexOf(t.id);return-1===n?1:-1===r?-1:n-r}),[I,z]),G=W.useCallback(e=>$(e),[]),Y=W.useCallback(()=>{$(null),U(null)},[]),K=W.useCallback((e,t)=>{e.preventDefault(),U(t)},[]),q=W.useCallback((e,t,n)=>{e.preventDefault(),n&&n!==t?(F(e=>{const r=[...e],o=r.indexOf(n),a=r.indexOf(t);return-1===o||-1===a?e:(r.splice(o,1),r.splice(a,0,n),r)}),$(null),U(null)):U(null)},[F]),X={onDelete:e=>{(async e=>{try{await aS(e),l(e)}catch(yT){aN.error(yT instanceof Error?yT.message:"Failed to delete project")}})(e)},onArchive:e=>{(async e=>{try{const t=await sS(e);s(t)}catch(yT){aN.error(yT instanceof Error?yT.message:"Failed to archive project")}})(e)},onUnarchive:e=>{(async e=>{try{const t=await lS(e);s(t)}catch(yT){aN.error(yT instanceof Error?yT.message:"Failed to restore project")}})(e)},onUpdated:s};return ee.jsxs("div",{className:"min-h-screen bg-background",children:[ee.jsx("header",{className:"border-b sticky top-0 bg-background z-10",children:ee.jsxs("div",{className:"max-w-6xl mx-auto px-4 h-14 flex items-center justify-between",children:[ee.jsxs("div",{className:"flex items-center gap-2",children:[ee.jsx(fj,{className:"h-5 w-5"}),ee.jsxs("div",{children:[ee.jsx("span",{className:"font-semibold text-lg leading-tight block",children:"CC Web"}),ee.jsx("span",{className:"text-[10px] text-muted-foreground leading-none",children:YN})]})]}),ee.jsx(_N,{}),ee.jsx(Nk,{variant:"ghost",size:"sm",onClick:async()=>{var e;try{const e=await TE();R(e),T(!0)}catch(yT){(null==(e=null==yT?void 0:yT.message)?void 0:e.includes("404"))||404===(null==yT?void 0:yT.status)?(R(null),T(!0)):aN.error("无法加载全局记忆池",{description:null==yT?void 0:yT.message})}},title:"全局记忆池",children:ee.jsx(zE,{className:"h-4 w-4"})}),ee.jsx(Nk,{variant:"ghost",size:"sm",onClick:()=>e("/skillhub"),title:"SkillHub",children:ee.jsx(cj,{className:"h-4 w-4"})}),ee.jsx(Nk,{variant:"ghost",size:"sm",onClick:()=>e("/mobile"),title:"手机界面",children:ee.jsx(uj,{className:"h-4 w-4"})}),ee.jsx(Nk,{variant:"ghost",size:"sm",onClick:()=>e("/settings"),title:"设置",children:ee.jsx(lj,{className:"h-4 w-4"})}),ee.jsx(Nk,{variant:"ghost",size:"sm",onClick:()=>j(!E),title:E?"卡片模式":"监控大屏",className:ik(E&&"text-blue-400 bg-blue-500/10"),children:E?ee.jsx(QE,{className:"h-4 w-4"}):ee.jsx(rj,{className:"h-4 w-4"})}),ee.jsx(Nk,{variant:"ghost",size:"sm",onClick:()=>{document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen()},title:x?"Exit fullscreen":"Fullscreen",children:x?ee.jsx(tj,{className:"h-4 w-4"}):ee.jsx(ej,{className:"h-4 w-4"})}),ee.jsx(qN,{}),ee.jsx(GN,{}),ee.jsx(VN,{}),ee.jsxs(Nk,{variant:"ghost",size:"sm",onClick:()=>{u(),e("/login")},children:[ee.jsx(JE,{className:"h-4 w-4 mr-2"}),"Logout"]})]})}),E&&ee.jsx("div",{className:"flex-1 min-h-0",children:ee.jsx(eT,{projects:t,projectStatuses:C,activeProjectIds:h})}),!E&&ee.jsxs("main",{className:"max-w-6xl mx-auto px-4 py-8",children:[ee.jsxs("div",{className:"flex items-center justify-between mb-6",children:[ee.jsxs("div",{children:[ee.jsx("h1",{className:"text-2xl font-bold",children:"Projects"}),ee.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Each project runs Claude CLI in a dedicated terminal session."})]}),ee.jsxs("div",{className:"flex gap-2",children:[ee.jsxs(Nk,{variant:"outline",onClick:()=>p(!0),children:[ee.jsx(WE,{className:"h-4 w-4 mr-2"}),"Open Project"]}),ee.jsxs(Nk,{onClick:()=>d(!0),children:[ee.jsx(ij,{className:"h-4 w-4 mr-2"}),"New Project"]})]})]}),n&&!o&&ee.jsx("div",{className:"text-center text-muted-foreground py-12",children:"Loading projects..."}),r&&ee.jsx("div",{className:"text-center text-destructive py-12",children:r}),o&&!n&&!r&&0===t.length&&ee.jsxs("div",{className:"text-center py-20",children:[ee.jsx(fj,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),ee.jsx("h2",{className:"text-lg font-semibold mb-2",children:"No projects yet"}),ee.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"Create a new project or open an existing one."}),ee.jsxs("div",{className:"flex gap-2 justify-center",children:[ee.jsxs(Nk,{variant:"outline",onClick:()=>p(!0),children:[ee.jsx(WE,{className:"h-4 w-4 mr-2"}),"Open Project"]}),ee.jsxs(Nk,{onClick:()=>d(!0),children:[ee.jsx(ij,{className:"h-4 w-4 mr-2"}),"New Project"]})]})]}),!n&&!r&&_.length>0&&ee.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-4",children:[_.map(e=>ee.jsxs("button",{onClick:()=>O(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),className:ik("px-2 py-0.5 rounded-full text-xs border transition-colors",A.includes(e)?"bg-blue-500/20 text-blue-400 border-blue-500/40":"bg-muted text-muted-foreground border-border hover:border-muted-foreground/40"),children:["#",e]},e)),A.length>0&&ee.jsx("button",{onClick:()=>O([]),className:"px-2 py-0.5 rounded-full text-xs text-muted-foreground hover:text-foreground transition-colors",children:"清除"})]}),!n&&!r&&H.length>0&&ee.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:H.map((e,t)=>ee.jsx(dw.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.3,delay:Math.min(.05*t,.3),ease:"easeOut"},draggable:!0,onDragStart:()=>G(e.id),onDragOver:t=>K(t,e.id),onDrop:t=>q(t,e.id,V),onDragEnd:Y,style:{opacity:V===e.id?.4:1,cursor:"grab"},className:ik(B===e.id&&V!==e.id&&"ring-2 ring-blue-500/50 rounded-xl"),children:ee.jsx(gN,{project:e,active:h.has(e.id),statusStack:v.get(e.id)??[],...X})},e.id))}),!n&&!r&&D.length>0&&ee.jsxs("div",{className:"mt-10",children:[ee.jsxs("button",{className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors mb-4 group",onClick:()=>S(e=>!e),children:[ee.jsx(dw.span,{animate:{rotate:k?90:0},transition:{duration:.2},children:ee.jsx(VE,{className:"h-4 w-4"})}),ee.jsx("span",{className:"font-medium",children:"Archived"}),ee.jsx("span",{className:"text-xs bg-muted rounded-full px-2 py-0.5",children:D.length})]}),ee.jsx(Yb,{children:k&&ee.jsx(dw.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.25,ease:"easeInOut"},className:"overflow-hidden",children:ee.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:D.map(e=>ee.jsx(gN,{project:e,active:!1,...X},e.id))})})})]}),ee.jsx(AN,{})]}),ee.jsx(xN,{open:c,onOpenChange:d,onCreated:e=>{i(e)}}),ee.jsx(wN,{open:f,onOpenChange:p,onOpened:e=>{i(e)}}),N&&M&&M.balls.length>0&&ee.jsx(SN,{balls:M.balls,activeCapacity:M.active_capacity,onClose:()=>T(!1)}),N&&(!M||0===M.balls.length)&&ee.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>T(!1),children:ee.jsxs("div",{className:"bg-popover border rounded-lg p-6 text-center",onClick:e=>e.stopPropagation(),children:[ee.jsx("p",{className:"text-sm text-muted-foreground",children:"全局记忆池为空"}),ee.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:'在项目记忆池中点击"同步全局"以汇总记忆'}),ee.jsx("button",{onClick:()=>T(!1),className:"mt-3 px-3 py-1 text-xs rounded border hover:bg-muted transition-colors",children:"关闭"})]})})]})}class nT extends H.Component{constructor(){super(...arguments),t(this,"state",{hasError:!1,error:null}),t(this,"handleReset",()=>{var e,t;this.setState({hasError:!1,error:null}),null==(t=(e=this.props).onReset)||t.call(e)})}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("[ErrorBoundary]",e,t.componentStack),aN.error(e.message||"Something went wrong")}render(){return this.state.hasError?this.props.fallback?this.props.fallback:ee.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3 p-4 text-sm text-muted-foreground",children:[ee.jsx("p",{children:"出错了"}),ee.jsx("button",{onClick:this.handleReset,className:"px-3 py-1.5 text-xs rounded-md border border-border hover:bg-muted transition-colors",children:"重新加载"})]}):this.props.children}}function rT({plugin:e,onConfigChange:t,onClose:n}){const{float:r,userConfig:o}=e,[a,i]=W.useState(()=>{var e,t;return{x:(null==(e=o.floatPosition)?void 0:e.x)??.5*window.innerWidth-r.defaultWidth/2,y:(null==(t=o.floatPosition)?void 0:t.y)??.3*window.innerHeight}}),[s,l]=W.useState(()=>{var e,t;return{w:(null==(e=o.floatSize)?void 0:e.w)??r.defaultWidth,h:(null==(t=o.floatSize)?void 0:t.h)??r.defaultHeight}}),[u,c]=W.useState(!1),[d,f]=W.useState(100),p=W.useRef(null),h=W.useRef(null),m=W.useCallback(()=>{f(Date.now()%1e5+100)},[]),g=W.useRef(null),v=W.useCallback(n=>{n.preventDefault(),m(),g.current={sx:n.clientX,sy:n.clientY,ox:a.x,oy:a.y},h.current&&(h.current.style.pointerEvents="none");const r=e=>{if(!g.current)return;const t=Math.max(0,Math.min(window.innerWidth-100,g.current.ox+e.clientX-g.current.sx)),n=Math.max(0,Math.min(window.innerHeight-40,g.current.oy+e.clientY-g.current.sy));p.current&&(p.current.style.left=t+"px",p.current.style.top=n+"px")},o=n=>{if(!g.current)return;const a=Math.max(0,Math.min(window.innerWidth-100,g.current.ox+n.clientX-g.current.sx)),s=Math.max(0,Math.min(window.innerHeight-40,g.current.oy+n.clientY-g.current.sy));g.current=null,h.current&&(h.current.style.pointerEvents=""),i({x:a,y:s}),t(e.id,{floatPosition:{x:a,y:s}}),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",o)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",o)},[a,m,e.id,t]),y=W.useRef(null),b=W.useCallback(n=>{if(!r.resizable)return;n.preventDefault(),n.stopPropagation(),m(),y.current={sx:n.clientX,sy:n.clientY,ow:s.w,oh:s.h},h.current&&(h.current.style.pointerEvents="none");const o=r.minWidth??150,a=r.minHeight??100,i=e=>{if(!y.current)return;const t=Math.max(o,y.current.ow+e.clientX-y.current.sx),n=Math.max(a,y.current.oh+e.clientY-y.current.sy);p.current&&(p.current.style.width=t+"px",p.current.style.height=n+"px")},u=n=>{if(!y.current)return;const r=Math.max(o,y.current.ow+n.clientX-y.current.sx),s=Math.max(a,y.current.oh+n.clientY-y.current.sy);y.current=null,h.current&&(h.current.style.pointerEvents=""),l({w:r,h:s}),t(e.id,{floatSize:{w:r,h:s}}),window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",u)};window.addEventListener("mousemove",i),window.addEventListener("mouseup",u)},[s,r,m,e.id,t]);W.useEffect(()=>{const t=async t=>{var n,r,o,a,i;if(t.source!==(null==(n=h.current)?void 0:n.contentWindow))return;const{callId:s,method:l,args:u}=t.data;if(s&&l)try{const t=qk(),n={"Content-Type":"application/json","X-Plugin-Id":e.id};let a,i;if(t&&(n.Authorization=`Bearer ${t}`),"storage:get"===l)a=`/api/plugin-bridge/storage/${e.id}`,i={method:"GET",headers:n};else if("storage:set"===l)a=`/api/plugin-bridge/storage/${e.id}`,i={method:"PUT",headers:n,body:JSON.stringify(u)};else{const t={"project:status":{path:`/api/plugin-bridge/project/status/${u.projectId}`,httpMethod:"GET"},"project:list":{path:"/api/plugin-bridge/project/list",httpMethod:"GET"},"terminal:send":{path:"/api/plugin-bridge/terminal/send",httpMethod:"POST"},"session:read":{path:`/api/plugin-bridge/session/${u.projectId}`,httpMethod:"GET"},"system:info":{path:"/api/plugin-bridge/system/info",httpMethod:"GET"}};if("backend:api"===l){const{method:t,path:r,body:o}=u;if(!r||!r.startsWith("/")||r.includes(".."))throw new Error("Invalid API path");a=`/api/plugins/${e.id}${r}`,i={method:t||"GET",headers:n},!o||"POST"!==t&&"PUT"!==t||(i.body=JSON.stringify(o))}else{const e=t[l];if(!e)throw new Error(`Unknown method: ${l}`);a=e.path,i={method:e.httpMethod,headers:n},"POST"===e.httpMethod&&(i.body=JSON.stringify(u))}}const c=await fetch(a,i),d=await c.json();null==(o=null==(r=h.current)?void 0:r.contentWindow)||o.postMessage({callId:s,result:d,error:null},window.location.origin)}catch(yT){const t=yT instanceof Error?yT.message:"Bridge error";null==(i=null==(a=h.current)?void 0:a.contentWindow)||i.postMessage({callId:s,result:null,error:t},window.location.origin)}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)},[e.id]);const x=o.clickable??r.clickable.default,w=`/plugins/${e.id}/${e.float?"index.html":""}`;return ee.jsxs(dw.div,{ref:p,className:ik("fixed rounded-lg border border-border shadow-xl overflow-hidden flex flex-col","bg-background/95 backdrop-blur-sm"),style:{left:a.x,top:a.y,width:u?200:s.w,height:u?32:s.h,zIndex:d},initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},onMouseDown:m,children:[ee.jsxs("div",{className:"h-8 flex items-center gap-1 px-2 bg-muted/50 border-b border-border cursor-grab active:cursor-grabbing flex-shrink-0 select-none",onMouseDown:v,children:[ee.jsx(KE,{className:"h-3 w-3 text-muted-foreground/40 flex-shrink-0"}),ee.jsx("span",{className:"text-xs text-muted-foreground truncate flex-1",children:e.name}),ee.jsx("button",{onClick:()=>c(e=>!e),className:"p-0.5 rounded hover:bg-white/10 text-muted-foreground/60 hover:text-foreground transition-colors",children:ee.jsx(nj,{className:"h-3 w-3"})}),ee.jsx("button",{onClick:()=>n(e.id),className:"p-0.5 rounded hover:bg-red-500/20 text-muted-foreground/60 hover:text-red-400 transition-colors",children:ee.jsx(gj,{className:"h-3 w-3"})})]}),!u&&ee.jsxs("div",{className:"flex-1 min-h-0 relative",children:[ee.jsx("iframe",{ref:h,src:w,sandbox:"allow-scripts allow-same-origin",className:"w-full h-full border-0",style:{pointerEvents:x?"auto":"none"}}),r.resizable&&ee.jsx("div",{className:"absolute bottom-0 right-0 w-3 h-3 cursor-se-resize",onMouseDown:b,children:ee.jsxs("svg",{viewBox:"0 0 12 12",className:"w-3 h-3 text-muted-foreground/30",children:[ee.jsx("path",{d:"M11 1v10H1",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),ee.jsx("path",{d:"M11 5v6H5",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})]})})]})]})}function oT({plugins:e,onPluginsChange:t,onClose:n}){const r=W.useCallback(async(e,n)=>{t(t=>t.map(t=>t.id===e?{...t,userConfig:{...t.userConfig,...n}}:t));try{await hE(e,n)}catch{}},[t]);return 0===e.length?null:ee.jsx(Yb,{children:e.map(e=>ee.jsx(rT,{plugin:e,onConfigChange:r,onClose:n},e.id))})}function aT({onTogglePlugin:e,activeIds:t}){const[n,r]=W.useState([]);return W.useEffect(()=>{dE().then(e=>r(e.filter(e=>e.enabled))).catch(()=>r([]))},[]),W.useEffect(()=>{const e=()=>{dE().then(e=>r(e.filter(e=>e.enabled))).catch(()=>{})};return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[]),0===n.length?null:ee.jsx("div",{className:"fixed top-14 left-1/2 -translate-x-1/2 z-40 pointer-events-none",children:ee.jsx(dw.div,{className:"pointer-events-auto flex items-center gap-1 px-2 py-1 rounded-full bg-background/60 backdrop-blur-md border border-border/50 shadow-lg",initial:{opacity:0,y:-8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:n.map(n=>{const r=t.has(n.id),o=n.name.slice(0,2);return ee.jsxs(dw.button,{onClick:()=>e(n),className:ik("relative flex items-center justify-center w-7 h-7 rounded-full text-[10px] font-medium transition-colors",r?"bg-blue-500/20 text-blue-400":"text-muted-foreground/70 hover:text-foreground hover:bg-muted/80"),whileHover:{scale:1.12},whileTap:{scale:.92},title:n.name+(n.description?` — ${n.description}`:""),children:[o,ee.jsx(Yb,{children:r&&ee.jsx(dw.span,{className:"absolute -bottom-0.5 left-1/2 -translate-x-1/2 h-1 w-1 rounded-full bg-blue-400",initial:{scale:0},animate:{scale:1},exit:{scale:0}})})]},n.id)})})})}const iT=H.lazy(()=>fd(()=>import("./ProjectPage-DaVLIGxq.js").then(e=>e.b),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(e=>({default:e.ProjectPage}))),sT=H.lazy(()=>fd(()=>import("./SettingsPage-vCg2-gp3.js"),__vite__mapDeps([11,5,9,4])).then(e=>({default:e.SettingsPage}))),lT=H.lazy(()=>fd(()=>import("./SkillHubPage-2wfYYyop.js"),__vite__mapDeps([12,8,7,5])).then(e=>({default:e.SkillHubPage}))),uT=H.lazy(()=>fd(()=>import("./ShareViewPage-z8iQsPWi.js"),__vite__mapDeps([13,7,6])).then(e=>({default:e.ShareViewPage}))),cT=H.lazy(()=>fd(()=>import("./MobilePage-B9NDvC5H.js"),__vite__mapDeps([14,9,2,3,5])).then(e=>({default:e.MobilePage})));function dT(){return ee.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:ee.jsx("span",{className:"text-muted-foreground text-sm",children:"Loading…"})})}function fT({children:e}){const[t,n]=W.useState(!1),r=Wk(e=>e.token),o=Wk(e=>e.setToken);return W.useEffect(()=>{r?n(!0):Jk()?eS().then(e=>o(e)).catch(()=>{}).finally(()=>n(!0)):n(!0)},[]),t||r?r?ee.jsx(ee.Fragment,{children:e}):ee.jsx(wf,{to:"/login",replace:!0}):null}const pT=window.matchMedia("(pointer: coarse)").matches&&window.innerWidth<768;function hT(){const[e,t]=W.useState([]),[n,r]=W.useState(()=>{try{return new Set(JSON.parse(localStorage.getItem("cc_plugin_open")||"[]"))}catch{return new Set}}),o=lf();W.useEffect(()=>{dE().then(t).catch(()=>t([]))},[]);const a=W.useCallback(e=>{r(t=>{const n=new Set(t);n.has(e.id)?n.delete(e.id):n.add(e.id);try{localStorage.setItem("cc_plugin_open",JSON.stringify([...n]))}catch{}return n})},[]),i=W.useCallback(e=>{r(t=>{const n=new Set(t);n.delete(e);try{localStorage.setItem("cc_plugin_open",JSON.stringify([...n]))}catch{}return n})},[]),s=function(e){if("/"===e||"/dashboard"===e)return{type:"dashboard"};const t=e.match(/^\/projects?\/([^/]+)/);return t?{type:"project",projectId:t[1]}:{type:"other"}}(o.pathname),l=e.filter(e=>{if(!e.enabled||!n.has(e.id))return!1;switch(e.userConfig.scope??e.float.scope.default){case"global":return!0;case"dashboard":return"dashboard"===s.type;case"project":return"project"===s.type;case"project:specific":return"project"===s.type&&(e.userConfig.projectIds??[]).includes(s.projectId??"");default:return!1}}),u="/login"===o.pathname,c="/mobile"===o.pathname;return ee.jsxs(ee.Fragment,{children:[!u&&!c&&!pT&&ee.jsx(aT,{onTogglePlugin:a,activeIds:n}),ee.jsx(oT,{plugins:l,onPluginsChange:t,onClose:i})]})}function mT({children:e}){const t=lf();return pT&&"/"===t.pathname?ee.jsx(wf,{to:"/mobile",replace:!0}):ee.jsx(ee.Fragment,{children:e})}function gT(){return ee.jsxs(zN,{children:[ee.jsx(pN,{richColors:!0,position:"bottom-right"}),ee.jsx(WN,{}),ee.jsx(HN,{}),ee.jsx(nT,{children:ee.jsxs(Pf,{children:[ee.jsx(hT,{}),ee.jsx(mT,{children:ee.jsx(W.Suspense,{fallback:ee.jsx(dT,{}),children:ee.jsxs(Ef,{children:[ee.jsx(kf,{path:"/login",element:ee.jsx(LE,{})}),ee.jsx(kf,{path:"/",element:ee.jsx(fT,{children:ee.jsx(tT,{})})}),ee.jsx(kf,{path:"/projects/:id",element:ee.jsx(fT,{children:ee.jsx(iT,{})})}),ee.jsx(kf,{path:"/settings",element:ee.jsx(fT,{children:ee.jsx(sT,{})})}),ee.jsx(kf,{path:"/skillhub",element:ee.jsx(fT,{children:ee.jsx(lT,{})})}),ee.jsx(kf,{path:"/mobile",element:ee.jsx(fT,{children:ee.jsx(cT,{})})}),ee.jsx(kf,{path:"/share/:token",element:ee.jsx(uT,{})}),ee.jsx(kf,{path:"*",element:ee.jsx(wf,{to:"/",replace:!0})})]})})})]})})]})}te.createRoot(document.getElementById("root")).render(ee.jsx(H.StrictMode,{children:ee.jsx(gT,{})}));export{SN as $,Yb as A,Nk as B,VE as C,$E as D,BE as E,WE as F,XS as G,EE as H,Tk as I,CE as J,jE as K,NE as L,tj as M,PE as N,ME as O,aj as P,JS as Q,H as R,Fk as S,hj as T,eE as U,nE as V,tE as W,gj as X,rE as Y,oE as Z,fd as _,NS as a,uk as a$,mS as a0,dS as a1,vj as a2,YE as a3,yS as a4,FP as a5,BP as a6,UP as a7,HP as a8,GP as a9,cj as aA,df as aB,Uk as aC,Gk as aD,fj as aE,Sj as aF,mk as aG,Nj as aH,Dj as aI,xj as aJ,wj as aK,hk as aL,Cj as aM,_j as aN,eC as aO,ld as aP,Jj as aQ,ZC as aR,rC as aS,HC as aT,Gj as aU,Vj as aV,_S as aW,OS as aX,zS as aY,sk as aZ,lk as a_,_k as aa,WP as ab,vS as ac,gS as ad,xS as ae,uS as af,cS as ag,iE as ah,zE as ai,cf as aj,IE as ak,bj as al,GN as am,VN as an,ZE as ao,FS as ap,iS as aq,EN as ar,PN as as,_N as at,uE as au,lE as av,XN as aw,Bk as ax,cE as ay,KE as az,ik as b,dk as b0,BN as b1,HS as b2,pj as b3,AS as b4,VS as b5,BS as b6,WS as b7,IS as b8,US as b9,$S as ba,GS as bb,dE as bc,fE as bd,pE as be,mE as bf,bS as bg,wS as bh,sE as bi,NN as bj,rj as bk,TN as bl,UE as bm,kS as bn,r as bo,o as bp,gE as bq,SE as br,vE as bs,yE as bt,bE as bu,xE as bv,wE as bw,kE as bx,a as by,RE as bz,_E as c,ej as d,jS as e,Vk as f,qk as g,Kk as h,ES as i,ee as j,sj as k,MS as l,CS as m,GE as n,dw as o,YS as p,QS as q,W as r,$k as s,aN as t,FN as u,FE as v,TS as w,ij as x,KS as y,qS as z};