@tom2012/cc-web 2026.4.19-q → 2026.4.19-s

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 (28) hide show
  1. package/README.md +1 -1
  2. package/backend/dist/index.d.ts.map +1 -1
  3. package/backend/dist/index.js +0 -22
  4. package/backend/dist/index.js.map +1 -1
  5. package/backend/dist/routes/projects.d.ts.map +1 -1
  6. package/backend/dist/routes/projects.js +0 -6
  7. package/backend/dist/routes/projects.js.map +1 -1
  8. package/frontend/dist/assets/{AssistantMessageContent-DLBIfRoa.js → AssistantMessageContent-DayURBLZ.js} +1 -1
  9. package/frontend/dist/assets/GraphPreview-DqnUioLI.js +8 -0
  10. package/frontend/dist/assets/{MobilePage-j50EdDNc.js → MobilePage-CIA-DkuB.js} +3 -3
  11. package/frontend/dist/assets/{OfficePreview-BFdVaUwH.js → OfficePreview-DsfkiPFS.js} +2 -2
  12. package/frontend/dist/assets/{ProjectPage-C-KJDFbz.js → ProjectPage-eUYt7NVa.js} +5 -5
  13. package/frontend/dist/assets/{SettingsPage-DzSCqUzP.js → SettingsPage-CCk3EySa.js} +2 -2
  14. package/frontend/dist/assets/{SkillHubPage-BWsT-k9U.js → SkillHubPage-CRFSy-Cg.js} +2 -2
  15. package/frontend/dist/assets/{chevron-down-HPq7YAwV.js → chevron-down-9-G7S6iK.js} +1 -1
  16. package/frontend/dist/assets/{chevron-up-BGtmxzk3.js → chevron-up-BnktQ0Ve.js} +1 -1
  17. package/frontend/dist/assets/{index-BjZ5yznR.js → index-B7AIJuGG.js} +1 -1
  18. package/frontend/dist/assets/{index-DvERL7tB.js → index-CboghLS5.js} +1 -1
  19. package/frontend/dist/assets/{index-A-o6g_qw.js → index-Dn-YLcfD.js} +4 -4
  20. package/frontend/dist/assets/index-pG308FQn.css +1 -0
  21. package/frontend/dist/assets/{jszip.min-vX7H_FIl.js → jszip.min-wfpG-66r.js} +1 -1
  22. package/frontend/dist/assets/{search-9lLW2Oo_.js → search-Dq8YTmIg.js} +1 -1
  23. package/frontend/dist/index.html +2 -2
  24. package/package.json +1 -1
  25. package/frontend/dist/assets/GraphPreview-CAHAPSNV.js +0 -2
  26. package/frontend/dist/assets/PlanPanel-BZEXnj25.js +0 -13
  27. package/frontend/dist/assets/index-D7xFwrL6.css +0 -1
  28. package/frontend/dist/assets/maximize-2-DxjkIxPt.js +0 -7
@@ -1,4 +1,4 @@
1
- import{c as e,r as t,aw as n,aq as r,aH as o,j as s,ar as a,au as i,at as l,d as c,aI as d,av as u,aJ as f,aK as p,aL as h,aM as m,aN as x,aO as g,aP as y,aQ as v,G as w,aR as b,V as j,W as N,Y as S,$ as C,a0 as k,B as R,a1 as P,I as A,a2 as D,aS as T,aT as E,aU as O,aV as _,aW as L,ai as I,aX as M,n as H,T as W,ag as z,aY as V,k as B,S as F,aZ as $,ah as K,a_ as q,H as U,A as X,x as Y,X as G,s as Z,t as Q,a$ as J,b0 as ee,b1 as te,b2 as ne,b3 as re,b4 as oe,b5 as se,b6 as ae}from"./index-A-o6g_qw.js";import{u as ie,e as le,d as ce,T as de,a as ue,b as fe,c as pe,S as he}from"./index-DvERL7tB.js";import{C as me}from"./chevron-down-HPq7YAwV.js";import{C as xe}from"./chevron-up-BGtmxzk3.js";
1
+ import{c as e,r as t,aw as n,aq as r,aH as o,j as s,ar as a,au as i,at as l,d as c,aI as d,av as u,aJ as f,aK as p,aL as h,aM as m,aN as x,aO as g,aP as y,aQ as v,G as w,aR as b,W as j,Y as N,$ as S,a0 as C,a1 as k,B as R,a2 as P,I as A,a3 as D,aS as T,aT as E,aU as O,aV as _,aW as L,ai as I,aX as M,n as H,T as W,ag as z,aY as B,k as V,S as F,aZ as $,ah as K,a_ as q,H as U,A as X,x as Y,X as G,s as Z,t as Q,a$ as J,b0 as ee,b1 as te,b2 as ne,b3 as re,b4 as oe,b5 as se,b6 as ae}from"./index-Dn-YLcfD.js";import{u as ie,e as le,d as ce,T as de,a as ue,b as fe,c as pe,S as he}from"./index-CboghLS5.js";import{C as me}from"./chevron-down-9-G7S6iK.js";import{C as xe}from"./chevron-up-BnktQ0Ve.js";
2
2
  /**
3
3
  * @license lucide-react v0.309.0 - ISC
4
4
  *
@@ -10,4 +10,4 @@ import{c as e,r as t,aw as n,aq as r,aH as o,j as s,ar as a,au as i,at as l,d as
10
10
  *
11
11
  * This source code is licensed under the ISC license.
12
12
  * See the LICENSE file in the root directory of this source tree.
13
- */function ke(e){const n=t.useRef({value:e,previous:e});return t.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}function Re(e){const[r,o]=t.useState(void 0);return n(()=>{if(e){o({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const n=t[0];let r,s;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,s=t.blockSize}else r=e.offsetWidth,s=e.offsetHeight;o({width:r,height:s})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}o(void 0)},[e]),r}var Pe="Switch",[Ae]=l(Pe),[De,Te]=Ae(Pe),Ee=t.forwardRef((e,n)=>{const{__scopeSwitch:l,name:c,checked:d,defaultChecked:u,required:f,disabled:p,value:h="on",onCheckedChange:m,form:x,...g}=e,[y,v]=t.useState(null),w=r(n,e=>v(e)),b=t.useRef(!1),j=!y||(x||!!y.closest("form")),[N,S]=o({prop:d,defaultProp:u??!1,onChange:m,caller:Pe});return s.jsxs(De,{scope:l,checked:N,disabled:p,children:[s.jsx(a.button,{type:"button",role:"switch","aria-checked":N,"aria-required":f,"data-state":Ie(N),"data-disabled":p?"":void 0,disabled:p,value:h,...g,ref:w,onClick:i(e.onClick,e=>{S(e=>!e),j&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})}),j&&s.jsx(Le,{control:y,bubbles:!b.current,name:c,value:h,checked:N,required:f,disabled:p,form:x,style:{transform:"translateX(-100%)"}})]})});Ee.displayName=Pe;var Oe="SwitchThumb",_e=t.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=Te(Oe,n);return s.jsx(a.span,{"data-state":Ie(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});_e.displayName=Oe;var Le=t.forwardRef(({__scopeSwitch:e,control:n,checked:o,bubbles:a=!0,...i},l)=>{const c=t.useRef(null),d=r(c,l),u=ke(o),f=Re(n);return t.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==o&&n){const t=new Event("click",{bubbles:a});n.call(e,o),e.dispatchEvent(t)}},[u,o,a]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o,...i,tabIndex:-1,ref:d,style:{...i.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Ie(e){return e?"checked":"unchecked"}Le.displayName="SwitchBubbleInput";var Me=Ee,He=_e;const We=t.forwardRef(({className:e,...t},n)=>s.jsx(Me,{className:c("peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:s.jsx(He,{className:c("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));We.displayName=Me.displayName;const ze=["top","right","bottom","left"],Ve=Math.min,Be=Math.max,Fe=Math.round,$e=Math.floor,Ke=e=>({x:e,y:e}),qe={left:"right",right:"left",bottom:"top",top:"bottom"};function Ue(e,t,n){return Be(e,Ve(t,n))}function Xe(e,t){return"function"==typeof e?e(t):e}function Ye(e){return e.split("-")[0]}function Ge(e){return e.split("-")[1]}function Ze(e){return"x"===e?"y":"x"}function Qe(e){return"y"===e?"height":"width"}function Je(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function et(e){return Ze(Je(e))}function tt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const nt=["left","right"],rt=["right","left"],ot=["top","bottom"],st=["bottom","top"];function at(e,t,n,r){const o=Ge(e);let s=function(e,t,n){switch(e){case"top":case"bottom":return n?t?rt:nt:t?nt:rt;case"left":case"right":return t?ot:st;default:return[]}}(Ye(e),"start"===n,r);return o&&(s=s.map(e=>e+"-"+o),t&&(s=s.concat(s.map(tt)))),s}function it(e){const t=Ye(e);return qe[t]+e.slice(t.length)}function lt(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function ct(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function dt(e,t,n){let{reference:r,floating:o}=e;const s=Je(t),a=et(t),i=Qe(a),l=Ye(t),c="y"===s,d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,f=r[i]/2-o[i]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}switch(Ge(t)){case"start":p[a]-=f*(n&&c?-1:1);break;case"end":p[a]+=f*(n&&c?-1:1)}return p}async function ut(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:s,rects:a,elements:i,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=Xe(t,e),h=lt(p),m=i[f?"floating"===u?"reference":"floating":u],x=ct(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(m)))||n?m:m.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(i.floating)),boundary:c,rootBoundary:d,strategy:l})),g="floating"===u?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==s.getOffsetParent?void 0:s.getOffsetParent(i.floating)),v=await(null==s.isElement?void 0:s.isElement(y))&&await(null==s.getScale?void 0:s.getScale(y))||{x:1,y:1},w=ct(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:g,offsetParent:y,strategy:l}):g);return{top:(x.top-w.top+h.top)/v.y,bottom:(w.bottom-x.bottom+h.bottom)/v.y,left:(x.left-w.left+h.left)/v.x,right:(w.right-x.right+h.right)/v.x}}function ft(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pt(e){return ze.some(t=>e[t]>=0)}const ht=new Set(["left","top"]);function mt(){return"undefined"!=typeof window}function xt(e){return vt(e)?(e.nodeName||"").toLowerCase():"#document"}function gt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function yt(e){var t;return null==(t=(vt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function vt(e){return!!mt()&&(e instanceof Node||e instanceof gt(e).Node)}function wt(e){return!!mt()&&(e instanceof Element||e instanceof gt(e).Element)}function bt(e){return!!mt()&&(e instanceof HTMLElement||e instanceof gt(e).HTMLElement)}function jt(e){return!(!mt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof gt(e).ShadowRoot)}function Nt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ot(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function St(e){return/^(table|td|th)$/.test(xt(e))}function Ct(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}const kt=/transform|translate|scale|rotate|perspective|filter/,Rt=/paint|layout|strict|content/,Pt=e=>!!e&&"none"!==e;let At;function Dt(e){const t=wt(e)?Ot(e):e;return Pt(t.transform)||Pt(t.translate)||Pt(t.scale)||Pt(t.rotate)||Pt(t.perspective)||!Tt()&&(Pt(t.backdropFilter)||Pt(t.filter))||kt.test(t.willChange||"")||Rt.test(t.contain||"")}function Tt(){return null==At&&(At="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),At}function Et(e){return/^(html|body|#document)$/.test(xt(e))}function Ot(e){return gt(e).getComputedStyle(e)}function _t(e){return wt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Lt(e){if("html"===xt(e))return e;const t=e.assignedSlot||e.parentNode||jt(e)&&e.host||yt(e);return jt(t)?t.host:t}function It(e){const t=Lt(e);return Et(t)?e.ownerDocument?e.ownerDocument.body:e.body:bt(t)&&Nt(t)?t:It(t)}function Mt(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=It(e),s=o===(null==(r=e.ownerDocument)?void 0:r.body),a=gt(o);if(s){const e=Ht(a);return t.concat(a,a.visualViewport||[],Nt(o)?o:[],e&&n?Mt(e):[])}return t.concat(o,Mt(o,[],n))}function Ht(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Wt(e){const t=Ot(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=bt(e),s=o?e.offsetWidth:n,a=o?e.offsetHeight:r,i=Fe(n)!==s||Fe(r)!==a;return i&&(n=s,r=a),{width:n,height:r,$:i}}function zt(e){return wt(e)?e:e.contextElement}function Vt(e){const t=zt(e);if(!bt(t))return Ke(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Wt(t);let a=(s?Fe(n.width):n.width)/r,i=(s?Fe(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),i&&Number.isFinite(i)||(i=1),{x:a,y:i}}const Bt=Ke(0);function Ft(e){const t=gt(e);return Tt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Bt}function $t(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),s=zt(e);let a=Ke(1);t&&(r?wt(r)&&(a=Vt(r)):a=Vt(e));const i=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==gt(e))&&t}(s,n,r)?Ft(s):Ke(0);let l=(o.left+i.x)/a.x,c=(o.top+i.y)/a.y,d=o.width/a.x,u=o.height/a.y;if(s){const e=gt(s),t=r&&wt(r)?gt(r):r;let n=e,o=Ht(n);for(;o&&r&&t!==n;){const e=Vt(o),t=o.getBoundingClientRect(),r=Ot(o),s=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=s,c+=a,n=gt(o),o=Ht(n)}}return ct({width:d,height:u,x:l,y:c})}function Kt(e,t){const n=_t(e).scrollLeft;return t?t.left+n:$t(yt(e)).left+n}function qt(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Kt(e,n),y:n.top+t.scrollTop}}function Ut(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=gt(e),r=yt(e),o=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,i=0,l=0;if(o){s=o.width,a=o.height;const e=Tt();(!e||e&&"fixed"===t)&&(i=o.offsetLeft,l=o.offsetTop)}const c=Kt(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=25&&(s-=a)}else c<=25&&(s+=c);return{width:s,height:a,x:i,y:l}}(e,n);else if("document"===t)r=function(e){const t=yt(e),n=_t(e),r=e.ownerDocument.body,o=Be(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Be(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Kt(e);const i=-n.scrollTop;return"rtl"===Ot(r).direction&&(a+=Be(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:a,y:i}}(yt(e));else if(wt(t))r=function(e,t){const n=$t(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=bt(e)?Vt(e):Ke(1);return{width:e.clientWidth*s.x,height:e.clientHeight*s.y,x:o*s.x,y:r*s.y}}(t,n);else{const n=Ft(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ct(r)}function Xt(e,t){const n=Lt(e);return!(n===t||!wt(n)||Et(n))&&("fixed"===Ot(n).position||Xt(n,t))}function Yt(e,t,n){const r=bt(t),o=yt(t),s="fixed"===n,a=$t(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const l=Ke(0);function c(){l.x=Kt(o)}if(r||!r&&!s)if(("body"!==xt(t)||Nt(o))&&(i=_t(t)),r){const e=$t(t,!0,s,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();s&&!r&&o&&c();const d=!o||r||s?Ke(0):qt(o,i);return{x:a.left+i.scrollLeft-l.x-d.x,y:a.top+i.scrollTop-l.y-d.y,width:a.width,height:a.height}}function Gt(e){return"static"===Ot(e).position}function Zt(e,t){if(!bt(e)||"fixed"===Ot(e).position)return null;if(t)return t(e);let n=e.offsetParent;return yt(e)===n&&(n=n.ownerDocument.body),n}function Qt(e,t){const n=gt(e);if(Ct(e))return n;if(!bt(e)){let t=Lt(e);for(;t&&!Et(t);){if(wt(t)&&!Gt(t))return t;t=Lt(t)}return n}let r=Zt(e,t);for(;r&&St(r)&&Gt(r);)r=Zt(r,t);return r&&Et(r)&&Gt(r)&&!Dt(r)?n:r||function(e){let t=Lt(e);for(;bt(t)&&!Et(t);){if(Dt(t))return t;if(Ct(t))return null;t=Lt(t)}return null}(e)||n}const Jt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s="fixed"===o,a=yt(r),i=!!t&&Ct(t.floating);if(r===a||i&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Ke(1);const d=Ke(0),u=bt(r);if((u||!u&&!s)&&(("body"!==xt(r)||Nt(a))&&(l=_t(r)),u)){const e=$t(r);c=Vt(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}const f=!a||u||s?Ke(0):qt(a,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+f.x,y:n.y*c.y-l.scrollTop*c.y+d.y+f.y}},getDocumentElement:yt,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[..."clippingAncestors"===n?Ct(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Mt(e,[],!1).filter(e=>wt(e)&&"body"!==xt(e)),o=null;const s="fixed"===Ot(e).position;let a=s?Lt(e):e;for(;wt(a)&&!Et(a);){const t=Ot(a),n=Dt(a);n||"fixed"!==t.position||(o=null),(s?!n&&!o:!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||Nt(a)&&!n&&Xt(e,a))?r=r.filter(e=>e!==a):o=t,a=Lt(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=Ut(t,s[0],o);let i=a.top,l=a.right,c=a.bottom,d=a.left;for(let u=1;u<s.length;u++){const e=Ut(t,s[u],o);i=Be(e.top,i),l=Ve(e.right,l),c=Ve(e.bottom,c),d=Be(e.left,d)}return{width:l-d,height:c-i,x:d,y:i}},getOffsetParent:Qt,getElementRects:async function(e){const t=this.getOffsetParent||Qt,n=this.getDimensions,r=await n(e.floating);return{reference:Yt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Wt(e);return{width:t,height:n}},getScale:Vt,isElement:wt,isRTL:function(e){return"rtl"===Ot(e).direction}};function en(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tn(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:i="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=zt(e),d=o||s?[...c?Mt(c):[],...t?Mt(t):[]]:[];d.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),s&&e.addEventListener("resize",n)});const u=c&&i?function(e,t){let n,r=null;const o=yt(e);function s(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(i,l){void 0===i&&(i=!1),void 0===l&&(l=1),s();const c=e.getBoundingClientRect(),{left:d,top:u,width:f,height:p}=c;if(i||t(),!f||!p)return;const h={rootMargin:-$e(u)+"px "+-$e(o.clientWidth-(d+f))+"px "+-$e(o.clientHeight-(u+p))+"px "+-$e(d)+"px",threshold:Be(0,Ve(1,l))||1};let m=!0;function x(t){const r=t[0].intersectionRatio;if(r!==l){if(!m)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||en(c,e.getBoundingClientRect())||a(),m=!1}try{r=new IntersectionObserver(x,{...h,root:o.ownerDocument})}catch(g){r=new IntersectionObserver(x,h)}r.observe(e)}(!0),s}(c,n):null;let f,p=-1,h=null;a&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!l&&h.observe(c),t&&h.observe(t));let m=l?$t(e):null;return l&&function t(){const r=$t(e);m&&!en(m,r)&&n();m=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",n),s&&e.removeEventListener("resize",n)}),null==u||u(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const nn=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:a,middlewareData:i}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,s=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=Ye(n),i=Ge(n),l="y"===Je(n),c=ht.has(a)?-1:1,d=s&&l?-1:1,u=Xe(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return i&&"number"==typeof h&&(p="end"===i?-1*h:h),l?{x:p*d,y:f*c}:{x:f*c,y:p*d}}(t,e);return a===(null==(n=i.offset)?void 0:n.placement)&&null!=(r=i.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:a}}}}},rn=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Xe(e,t),d={x:n,y:r},u=await s.detectOverflow(t,c),f=Je(Ye(o)),p=Ze(f);let h=d[p],m=d[f];if(a){const e="y"===p?"bottom":"right";h=Ue(h+u["y"===p?"top":"left"],h,h-u[e])}if(i){const e="y"===f?"bottom":"right";m=Ue(m+u["y"===f?"top":"left"],m,m-u[e])}const x=l.fn({...t,[p]:h,[f]:m});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[p]:a,[f]:i}}}}}},on=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:a,initialPlacement:i,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...x}=Xe(e,t);if(null!=(n=s.arrow)&&n.alignmentOffset)return{};const g=Ye(o),y=Je(i),v=Ye(i)===i,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),b=f||(v||!m?[it(i)]:function(e){const t=it(e);return[tt(e),t,tt(t)]}(i)),j="none"!==h;!f&&j&&b.push(...at(i,m,h,w));const N=[i,...b],S=await l.detectOverflow(t,x),C=[];let k=(null==(r=s.flip)?void 0:r.overflows)||[];if(d&&C.push(S[g]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=Ge(e),o=et(e),s=Qe(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=it(a)),[a,it(a)]}(o,a,w);C.push(S[e[0]],S[e[1]])}if(k=[...k,{placement:o,overflows:C}],!C.every(e=>e<=0)){var R,P;const e=((null==(R=s.flip)?void 0:R.index)||0)+1,t=N[e];if(t){if(!("alignment"===u&&y!==Je(t))||k.every(e=>Je(e.placement)!==y||e.overflows[0]>0))return{data:{index:e,overflows:k},reset:{placement:t}}}let n=null==(P=k.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:P.placement;if(!n)switch(p){case"bestFit":{var A;const e=null==(A=k.filter(e=>{if(j){const t=Je(e.placement);return t===y||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:A[0];e&&(n=e);break}case"initialPlacement":n=i}if(o!==n)return{reset:{placement:n}}}return{}}}},sn=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:a,elements:i}=t,{apply:l=()=>{},...c}=Xe(e,t),d=await a.detectOverflow(t,c),u=Ye(o),f=Ge(o),p="y"===Je(o),{width:h,height:m}=s.floating;let x,g;"top"===u||"bottom"===u?(x=u,g=f===(await(null==a.isRTL?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(g=u,x="end"===f?"top":"bottom");const y=m-d.top-d.bottom,v=h-d.left-d.right,w=Ve(m-d[x],y),b=Ve(h-d[g],v),j=!t.middlewareData.shift;let N=w,S=b;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=v),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(N=y),j&&!f){const e=Be(d.left,0),t=Be(d.right,0),n=Be(d.top,0),r=Be(d.bottom,0);p?S=h-2*(0!==e||0!==t?e+t:Be(d.left,d.right)):N=m-2*(0!==n||0!==r?n+r:Be(d.top,d.bottom))}await l({...t,availableWidth:S,availableHeight:N});const C=await a.getDimensions(i.floating);return h!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}},an=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=Xe(e,t);switch(o){case"referenceHidden":{const e=ft(await r.detectOverflow(t,{...s,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:pt(e)}}}case"escaped":{const e=ft(await r.detectOverflow(t,{...s,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:pt(e)}}}default:return{}}}}},ln=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:a,elements:i,middlewareData:l}=t,{element:c,padding:d=0}=Xe(e,t)||{};if(null==c)return{};const u=lt(d),f={x:n,y:r},p=et(o),h=Qe(p),m=await a.getDimensions(c),x="y"===p,g=x?"top":"left",y=x?"bottom":"right",v=x?"clientHeight":"clientWidth",w=s.reference[h]+s.reference[p]-f[p]-s.floating[h],b=f[p]-s.reference[p],j=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let N=j?j[v]:0;N&&await(null==a.isElement?void 0:a.isElement(j))||(N=i.floating[v]||s.floating[h]);const S=w/2-b/2,C=N/2-m[h]/2-1,k=Ve(u[g],C),R=Ve(u[y],C),P=k,A=N-m[h]-R,D=N/2-m[h]/2+S,T=Ue(P,D,A),E=!l.arrow&&null!=Ge(o)&&D!==T&&s.reference[h]/2-(D<P?k:R)-m[h]/2<0,O=E?D<P?D-P:D-A:0;return{[p]:f[p]+O,data:{[p]:T,centerOffset:D-T-O,...E&&{alignmentOffset:O}},reset:E}}}),cn=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:a}=t,{offset:i=0,mainAxis:l=!0,crossAxis:c=!0}=Xe(e,t),d={x:n,y:r},u=Je(o),f=Ze(u);let p=d[f],h=d[u];const m=Xe(i,t),x="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===f?"height":"width",t=s.reference[f]-s.floating[e]+x.mainAxis,n=s.reference[f]+s.reference[e]-x.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var g,y;const e="y"===f?"width":"height",t=ht.has(Ye(o)),n=s.reference[u]-s.floating[e]+(t&&(null==(g=a.offset)?void 0:g[u])||0)+(t?0:x.crossAxis),r=s.reference[u]+s.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[u])||0)-(t?x.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[f]:p,[u]:h}}}},dn=(e,t,n)=>{const r=new Map,o={platform:Jt,...n},s={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:a}=n,i=a.detectOverflow?a:{...a,detectOverflow:ut},l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=dt(c,r,l),f=r,p=0;const h={};for(let m=0;m<s.length;m++){const n=s[m];if(!n)continue;const{name:x,fn:g}=n,{x:y,y:v,data:w,reset:b}=await g({x:d,y:u,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});d=null!=y?y:d,u=null!=v?v:u,h[x]={...h[x],...w},b&&p<50&&(p++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:d,y:u}=dt(c,f,l))),m=-1)}return{x:d,y:u,placement:f,strategy:o,middlewareData:h}})(e,t,{...o,platform:s})};var un="undefined"!=typeof document?t.useLayoutEffect:function(){};function fn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!fn(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!fn(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function pn(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function hn(e,t){const n=pn(e);return Math.round(t*n)/n}function mn(e){const n=t.useRef(e);return un(()=>{n.current=e}),n}const xn=(e,t)=>{const n=nn(e);return{name:n.name,fn:n.fn,options:[e,t]}},gn=(e,t)=>{const n=rn(e);return{name:n.name,fn:n.fn,options:[e,t]}},yn=(e,t)=>{const n=on(e);return{name:n.name,fn:n.fn,options:[e,t]}},vn=(e,t)=>{const n=sn(e);return{name:n.name,fn:n.fn,options:[e,t]}},wn=(e,t)=>{const n=an(e);return{name:n.name,fn:n.fn,options:[e,t]}},bn=(e,t)=>{const n=(e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?ln({element:n.current,padding:r}).fn(t):{}:n?ln({element:n,padding:r}).fn(t):{};var o}}))(e);return{name:n.name,fn:n.fn,options:[e,t]}};var jn=t.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return s.jsx(a.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});jn.displayName="Arrow";var Nn=jn,Sn="Popper",[Cn,kn]=l(Sn),[Rn,Pn]=Cn(Sn),An=e=>{const{__scopePopper:n,children:r}=e,[o,a]=t.useState(null);return s.jsx(Rn,{scope:n,anchor:o,onAnchorChange:a,children:r})};An.displayName=Sn;var Dn="PopperAnchor",Tn=t.forwardRef((e,n)=>{const{__scopePopper:o,virtualRef:i,...l}=e,c=Pn(Dn,o),d=t.useRef(null),u=r(n,d),f=t.useRef(null);return t.useEffect(()=>{const e=f.current;f.current=(null==i?void 0:i.current)||d.current,e!==f.current&&c.onAnchorChange(f.current)}),i?null:s.jsx(a.div,{...l,ref:u})});Tn.displayName=Dn;var En="PopperContent",[On,_n]=Cn(En),Ln=t.forwardRef((e,o)=>{var i,l,c,f,p,h;const{__scopePopper:m,side:x="bottom",sideOffset:g=0,align:y="center",alignOffset:v=0,arrowPadding:w=0,avoidCollisions:b=!0,collisionBoundary:j=[],collisionPadding:N=0,sticky:S="partial",hideWhenDetached:C=!1,updatePositionStrategy:k="optimized",onPlaced:R,...P}=e,A=Pn(En,m),[D,T]=t.useState(null),E=r(o,e=>T(e)),[O,_]=t.useState(null),L=Re(O),I=(null==L?void 0:L.width)??0,M=(null==L?void 0:L.height)??0,H=x+("center"!==y?"-"+y:""),W="number"==typeof N?N:{top:0,right:0,bottom:0,left:0,...N},z=Array.isArray(j)?j:[j],V=z.length>0,B={padding:W,boundary:z.filter(Wn),altBoundary:V},{refs:F,floatingStyles:$,placement:K,isPositioned:q,middlewareData:U}=function(e){void 0===e&&(e={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:s,elements:{reference:a,floating:i}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[f,p]=t.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[h,m]=t.useState(o);fn(h,o)||m(o);const[x,g]=t.useState(null),[y,v]=t.useState(null),w=t.useCallback(e=>{e!==S.current&&(S.current=e,g(e))},[]),b=t.useCallback(e=>{e!==C.current&&(C.current=e,v(e))},[]),j=a||x,N=i||y,S=t.useRef(null),C=t.useRef(null),k=t.useRef(f),R=null!=c,P=mn(c),A=mn(s),D=mn(u),T=t.useCallback(()=>{if(!S.current||!C.current)return;const e={placement:n,strategy:r,middleware:h};A.current&&(e.platform=A.current),dn(S.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==D.current};E.current&&!fn(k.current,t)&&(k.current=t,d.flushSync(()=>{p(t)}))})},[h,n,r,A,D]);un(()=>{!1===u&&k.current.isPositioned&&(k.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[u]);const E=t.useRef(!1);un(()=>(E.current=!0,()=>{E.current=!1}),[]),un(()=>{if(j&&(S.current=j),N&&(C.current=N),j&&N){if(P.current)return P.current(j,N,T);T()}},[j,N,T,P,R]);const O=t.useMemo(()=>({reference:S,floating:C,setReference:w,setFloating:b}),[w,b]),_=t.useMemo(()=>({reference:j,floating:N}),[j,N]),L=t.useMemo(()=>{const e={position:r,left:0,top:0};if(!_.floating)return e;const t=hn(_.floating,f.x),n=hn(_.floating,f.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...pn(_.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,_.floating,f.x,f.y]);return t.useMemo(()=>({...f,update:T,refs:O,elements:_,floatingStyles:L}),[f,T,O,_,L])}({strategy:"fixed",placement:H,whileElementsMounted:(...e)=>tn(...e,{animationFrame:"always"===k}),elements:{reference:A.anchor},middleware:[xn({mainAxis:g+M,alignmentAxis:v}),b&&gn({mainAxis:!0,crossAxis:!1,limiter:"partial"===S?{fn:cn(X).fn,options:[X,Y]}:void 0,...B}),b&&yn({...B}),vn({...B,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:s}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${s}px`)}}),O&&bn({element:O,padding:w}),zn({arrowWidth:I,arrowHeight:M}),C&&wn({strategy:"referenceHidden",...B})]});var X,Y;const[G,Z]=Vn(K),Q=u(R);n(()=>{q&&(null==Q||Q())},[q,Q]);const J=null==(i=U.arrow)?void 0:i.x,ee=null==(l=U.arrow)?void 0:l.y,te=0!==(null==(c=U.arrow)?void 0:c.centerOffset),[ne,re]=t.useState();return n(()=>{D&&re(window.getComputedStyle(D).zIndex)},[D]),s.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:q?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[null==(f=U.transformOrigin)?void 0:f.x,null==(p=U.transformOrigin)?void 0:p.y].join(" "),...(null==(h=U.hide)?void 0:h.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(On,{scope:m,placedSide:G,onArrowChange:_,arrowX:J,arrowY:ee,shouldHideArrow:te,children:s.jsx(a.div,{"data-side":G,"data-align":Z,...P,ref:E,style:{...P.style,animation:q?void 0:"none"}})})})});Ln.displayName=En;var In="PopperArrow",Mn={top:"bottom",right:"left",bottom:"top",left:"right"},Hn=t.forwardRef(function(e,t){const{__scopePopper:n,...r}=e,o=_n(In,n),a=Mn[o.placedSide];return s.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:s.jsx(Nn,{...r,ref:t,style:{...r.style,display:"block"}})})});function Wn(e){return null!==e}Hn.displayName=In;var zn=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o;const{placement:s,rects:a,middlewareData:i}=t,l=0!==(null==(n=i.arrow)?void 0:n.centerOffset),c=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[u,f]=Vn(s),p={start:"0%",center:"50%",end:"100%"}[f],h=((null==(r=i.arrow)?void 0:r.x)??0)+c/2,m=((null==(o=i.arrow)?void 0:o.y)??0)+d/2;let x="",g="";return"bottom"===u?(x=l?p:`${h}px`,g=-d+"px"):"top"===u?(x=l?p:`${h}px`,g=`${a.floating.height+d}px`):"right"===u?(x=-d+"px",g=l?p:`${m}px`):"left"===u&&(x=`${a.floating.width+d}px`,g=l?p:`${m}px`),{data:{x:x,y:g}}}});function Vn(e){const[t,n="center"]=e.split("-");return[t,n]}var Bn=An,Fn=Tn,$n=Ln,Kn=Hn;function qn(e){const n=Un(e),r=t.forwardRef((e,r)=>{const{children:o,...a}=e,i=t.Children.toArray(o),l=i.find(Yn);if(l){const e=l.props.children,o=i.map(n=>n===l?t.Children.count(e)>1?t.Children.only(null):t.isValidElement(e)?e.props.children:null:n);return s.jsx(n,{...a,ref:r,children:t.isValidElement(e)?t.cloneElement(e,void 0,o):null})}return s.jsx(n,{...a,ref:r,children:o})});return r.displayName=`${e}.Slot`,r}function Un(e){const n=t.forwardRef((e,n)=>{const{children:r,...o}=e;if(t.isValidElement(r)){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}(r),s=function(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...e)=>{const t=s(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...s}:"className"===r&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}(o,r.props);return r.type!==t.Fragment&&(s.ref=n?f(n,e):e),t.cloneElement(r,s)}return t.Children.count(r)>1?t.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var Xn=Symbol("radix.slottable");function Yn(e){return t.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Xn}var Gn=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});t.forwardRef((e,t)=>s.jsx(a.span,{...e,ref:t,style:{...Gn,...e.style}})).displayName="VisuallyHidden";var Zn=[" ","Enter","ArrowUp","ArrowDown"],Qn=[" ","Enter"],Jn="Select",[er,tr,nr]=le(Jn),[rr]=l(Jn,[nr,kn]),or=kn(),[sr,ar]=rr(Jn),[ir,lr]=rr(Jn),cr=e=>{const{__scopeSelect:n,children:r,open:a,defaultOpen:i,onOpenChange:l,value:c,defaultValue:d,onValueChange:u,dir:f,name:h,autoComplete:m,disabled:x,required:g,form:y}=e,v=or(n),[w,b]=t.useState(null),[j,N]=t.useState(null),[S,C]=t.useState(!1),k=ie(f),[R,P]=o({prop:a,defaultProp:i??!1,onChange:l,caller:Jn}),[A,D]=o({prop:c,defaultProp:d,onChange:u,caller:Jn}),T=t.useRef(null),E=!w||(y||!!w.closest("form")),[O,_]=t.useState(new Set),L=Array.from(O).map(e=>e.props.value).join(";");return s.jsx(Bn,{...v,children:s.jsxs(sr,{required:g,scope:n,trigger:w,onTriggerChange:b,valueNode:j,onValueNodeChange:N,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:p(),value:A,onValueChange:D,open:R,onOpenChange:P,dir:k,triggerPointerDownPosRef:T,disabled:x,children:[s.jsx(er.Provider,{scope:n,children:s.jsx(ir,{scope:e.__scopeSelect,onNativeOptionAdd:t.useCallback(e=>{_(t=>new Set(t).add(e))},[]),onNativeOptionRemove:t.useCallback(e=>{_(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:r})}),E?s.jsxs(Yr,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:m,value:A,onChange:e=>D(e.target.value),disabled:x,form:y,children:[void 0===A?s.jsx("option",{value:""}):null,Array.from(O)]},L):null]})})};cr.displayName=Jn;var dr="SelectTrigger",ur=t.forwardRef((e,n)=>{const{__scopeSelect:o,disabled:l=!1,...c}=e,d=or(o),u=ar(dr,o),f=u.disabled||l,p=r(n,u.onTriggerChange),h=tr(o),m=t.useRef("touch"),[x,g,y]=Zr(e=>{const t=h().filter(e=>!e.disabled),n=t.find(e=>e.value===u.value),r=Qr(t,e,n);void 0!==r&&u.onValueChange(r.value)}),v=e=>{f||(u.onOpenChange(!0),y()),e&&(u.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return s.jsx(Fn,{asChild:!0,...d,children:s.jsx(a.button,{type:"button",role:"combobox","aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":Gr(u.value)?"":void 0,...c,ref:p,onClick:i(c.onClick,e=>{e.currentTarget.focus(),"mouse"!==m.current&&v(e)}),onPointerDown:i(c.onPointerDown,e=>{m.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(v(e),e.preventDefault())}),onKeyDown:i(c.onKeyDown,e=>{const t=""!==x.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||g(e.key),t&&" "===e.key||Zn.includes(e.key)&&(v(),e.preventDefault())})})})});ur.displayName=dr;var fr="SelectValue",pr=t.forwardRef((e,t)=>{const{__scopeSelect:o,className:i,style:l,children:c,placeholder:d="",...u}=e,f=ar(fr,o),{onValueNodeHasChildrenChange:p}=f,h=void 0!==c,m=r(t,f.onValueNodeChange);return n(()=>{p(h)},[p,h]),s.jsx(a.span,{...u,ref:m,style:{pointerEvents:"none"},children:Gr(f.value)?s.jsx(s.Fragment,{children:d}):c})});pr.displayName=fr;var hr=t.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return s.jsx(a.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});hr.displayName="SelectIcon";var mr=e=>s.jsx(h,{asChild:!0,...e});mr.displayName="SelectPortal";var xr="SelectContent",gr=t.forwardRef((e,r)=>{const o=ar(xr,e.__scopeSelect),[a,i]=t.useState();if(n(()=>{i(new DocumentFragment)},[]),!o.open){const t=a;return t?d.createPortal(s.jsx(vr,{scope:e.__scopeSelect,children:s.jsx(er.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),t):null}return s.jsx(jr,{...e,ref:r})});gr.displayName=xr;var yr=10,[vr,wr]=rr(xr),br=qn("SelectContent.RemoveScroll"),jr=t.forwardRef((e,n)=>{const{__scopeSelect:o,position:a="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,side:u,sideOffset:f,align:p,alignOffset:h,arrowPadding:w,collisionBoundary:b,collisionPadding:j,sticky:N,hideWhenDetached:S,avoidCollisions:C,...k}=e,R=ar(xr,o),[P,A]=t.useState(null),[D,T]=t.useState(null),E=r(n,e=>A(e)),[O,_]=t.useState(null),[L,I]=t.useState(null),M=tr(o),[H,W]=t.useState(!1),z=t.useRef(!1);t.useEffect(()=>{if(P)return m(P)},[P]),x();const V=t.useCallback(e=>{const[t,...n]=M().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(const s of e){if(s===o)return;if(null==s||s.scrollIntoView({block:"nearest"}),s===t&&D&&(D.scrollTop=0),s===r&&D&&(D.scrollTop=D.scrollHeight),null==s||s.focus(),document.activeElement!==o)return}},[M,D]),B=t.useCallback(()=>V([O,P]),[V,O,P]);t.useEffect(()=>{H&&B()},[H,B]);const{onOpenChange:F,triggerPointerDownPosRef:$}=R;t.useEffect(()=>{if(P){let e={x:0,y:0};const t=t=>{var n,r;e={x:Math.abs(Math.round(t.pageX)-((null==(n=$.current)?void 0:n.x)??0)),y:Math.abs(Math.round(t.pageY)-((null==(r=$.current)?void 0:r.y)??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():P.contains(n.target)||F(!1),document.removeEventListener("pointermove",t),$.current=null};return null!==$.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[P,F,$]),t.useEffect(()=>{const e=()=>F(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[F]);const[K,q]=Zr(e=>{const t=M().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=Qr(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),U=t.useCallback((e,t,n)=>{const r=!z.current&&!n;(void 0!==R.value&&R.value===t||r)&&(_(e),r&&(z.current=!0))},[R.value]),X=t.useCallback(()=>null==P?void 0:P.focus(),[P]),Y=t.useCallback((e,t,n)=>{const r=!z.current&&!n;(void 0!==R.value&&R.value===t||r)&&I(e)},[R.value]),G="popper"===a?Sr:Nr,Z=G===Sr?{side:u,sideOffset:f,align:p,alignOffset:h,arrowPadding:w,collisionBoundary:b,collisionPadding:j,sticky:N,hideWhenDetached:S,avoidCollisions:C}:{};return s.jsx(vr,{scope:o,content:P,viewport:D,onViewportChange:T,itemRefCallback:U,selectedItem:O,onItemLeave:X,itemTextRefCallback:Y,focusSelectedItem:B,selectedItemText:L,position:a,isPositioned:H,searchRef:K,children:s.jsx(g,{as:br,allowPinchZoom:!0,children:s.jsx(y,{asChild:!0,trapped:R.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:i(l,e=>{var t;null==(t=R.trigger)||t.focus({preventScroll:!0}),e.preventDefault()}),children:s.jsx(v,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:s.jsx(G,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:e=>e.preventDefault(),...k,...Z,onPlaced:()=>W(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:i(k.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||q(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=M().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>V(t)),e.preventDefault()}})})})})})})});jr.displayName="SelectContentImpl";var Nr=t.forwardRef((e,o)=>{const{__scopeSelect:i,onPlaced:l,...c}=e,d=ar(xr,i),u=wr(xr,i),[f,p]=t.useState(null),[h,m]=t.useState(null),x=r(o,e=>m(e)),g=tr(i),y=t.useRef(!1),v=t.useRef(!0),{viewport:w,selectedItem:b,selectedItemText:j,focusSelectedItem:N}=u,S=t.useCallback(()=>{if(d.trigger&&d.valueNode&&f&&h&&w&&b&&j){const e=d.trigger.getBoundingClientRect(),t=h.getBoundingClientRect(),n=d.valueNode.getBoundingClientRect(),r=j.getBoundingClientRect();if("rtl"!==d.dir){const o=r.left-t.left,s=n.left-o,a=e.left-s,i=e.width+a,l=Math.max(i,t.width),c=window.innerWidth-yr,d=ce(s,[yr,Math.max(yr,c-l)]);f.style.minWidth=i+"px",f.style.left=d+"px"}else{const o=t.right-r.right,s=window.innerWidth-n.right-o,a=window.innerWidth-e.right-s,i=e.width+a,l=Math.max(i,t.width),c=window.innerWidth-yr,d=ce(s,[yr,Math.max(yr,c-l)]);f.style.minWidth=i+"px",f.style.right=d+"px"}const o=g(),s=window.innerHeight-2*yr,a=w.scrollHeight,i=window.getComputedStyle(h),c=parseInt(i.borderTopWidth,10),u=parseInt(i.paddingTop,10),p=parseInt(i.borderBottomWidth,10),m=c+u+a+parseInt(i.paddingBottom,10)+p,x=Math.min(5*b.offsetHeight,m),v=window.getComputedStyle(w),N=parseInt(v.paddingTop,10),S=parseInt(v.paddingBottom,10),C=e.top+e.height/2-yr,k=s-C,R=b.offsetHeight/2,P=c+u+(b.offsetTop+R),A=m-P;if(P<=C){const e=o.length>0&&b===o[o.length-1].ref.current;f.style.bottom="0px";const t=h.clientHeight-w.offsetTop-w.offsetHeight,n=P+Math.max(k,R+(e?S:0)+t+p);f.style.height=n+"px"}else{const e=o.length>0&&b===o[0].ref.current;f.style.top="0px";const t=Math.max(C,c+w.offsetTop+(e?N:0)+R)+A;f.style.height=t+"px",w.scrollTop=P-C+w.offsetTop}f.style.margin=`${yr}px 0`,f.style.minHeight=x+"px",f.style.maxHeight=s+"px",null==l||l(),requestAnimationFrame(()=>y.current=!0)}},[g,d.trigger,d.valueNode,f,h,w,b,j,d.dir,l]);n(()=>S(),[S]);const[C,k]=t.useState();n(()=>{h&&k(window.getComputedStyle(h).zIndex)},[h]);const R=t.useCallback(e=>{e&&!0===v.current&&(S(),null==N||N(),v.current=!1)},[S,N]);return s.jsx(Cr,{scope:i,contentWrapper:f,shouldExpandOnScrollRef:y,onScrollButtonChange:R,children:s.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:s.jsx(a.div,{...c,ref:x,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});Nr.displayName="SelectItemAlignedPosition";var Sr=t.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=yr,...a}=e,i=or(n);return s.jsx($n,{...i,...a,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Sr.displayName="SelectPopperPosition";var[Cr,kr]=rr(xr,{}),Rr="SelectViewport",Pr=t.forwardRef((e,n)=>{const{__scopeSelect:o,nonce:l,...c}=e,d=wr(Rr,o),u=kr(Rr,o),f=r(n,d.onViewportChange),p=t.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),s.jsx(er.Slot,{scope:o,children:s.jsx(a.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:i(c.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=u;if((null==r?void 0:r.current)&&n){const e=Math.abs(p.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*yr,o=parseFloat(n.style.minHeight),s=parseFloat(n.style.height),a=Math.max(o,s);if(a<r){const o=a+e,s=Math.min(r,o),i=o-s;n.style.height=s+"px","0px"===n.style.bottom&&(t.scrollTop=i>0?i:0,n.style.justifyContent="flex-end")}}}p.current=t.scrollTop})})})]})});Pr.displayName=Rr;var Ar="SelectGroup",[Dr,Tr]=rr(Ar);t.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=p();return s.jsx(Dr,{scope:n,id:o,children:s.jsx(a.div,{role:"group","aria-labelledby":o,...r,ref:t})})}).displayName=Ar;var Er="SelectLabel",Or=t.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Tr(Er,n);return s.jsx(a.div,{id:o.id,...r,ref:t})});Or.displayName=Er;var _r="SelectItem",[Lr,Ir]=rr(_r),Mr=t.forwardRef((e,n)=>{const{__scopeSelect:o,value:l,disabled:c=!1,textValue:d,...u}=e,f=ar(_r,o),h=wr(_r,o),m=f.value===l,[x,g]=t.useState(d??""),[y,v]=t.useState(!1),w=r(n,e=>{var t;return null==(t=h.itemRefCallback)?void 0:t.call(h,e,l,c)}),b=p(),j=t.useRef("touch"),N=()=>{c||(f.onValueChange(l),f.onOpenChange(!1))};if(""===l)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(Lr,{scope:o,value:l,disabled:c,textId:b,isSelected:m,onItemTextChange:t.useCallback(e=>{g(t=>t||((null==e?void 0:e.textContent)??"").trim())},[]),children:s.jsx(er.ItemSlot,{scope:o,value:l,disabled:c,textValue:x,children:s.jsx(a.div,{role:"option","aria-labelledby":b,"data-highlighted":y?"":void 0,"aria-selected":m&&y,"data-state":m?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...u,ref:w,onFocus:i(u.onFocus,()=>v(!0)),onBlur:i(u.onBlur,()=>v(!1)),onClick:i(u.onClick,()=>{"mouse"!==j.current&&N()}),onPointerUp:i(u.onPointerUp,()=>{"mouse"===j.current&&N()}),onPointerDown:i(u.onPointerDown,e=>{j.current=e.pointerType}),onPointerMove:i(u.onPointerMove,e=>{var t;j.current=e.pointerType,c?null==(t=h.onItemLeave)||t.call(h):"mouse"===j.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:i(u.onPointerLeave,e=>{var t;e.currentTarget===document.activeElement&&(null==(t=h.onItemLeave)||t.call(h))}),onKeyDown:i(u.onKeyDown,e=>{var t;""!==(null==(t=h.searchRef)?void 0:t.current)&&" "===e.key||(Qn.includes(e.key)&&N()," "===e.key&&e.preventDefault())})})})})});Mr.displayName=_r;var Hr="SelectItemText",Wr=t.forwardRef((e,o)=>{const{__scopeSelect:i,className:l,style:c,...u}=e,f=ar(Hr,i),p=wr(Hr,i),h=Ir(Hr,i),m=lr(Hr,i),[x,g]=t.useState(null),y=r(o,e=>g(e),h.onItemTextChange,e=>{var t;return null==(t=p.itemTextRefCallback)?void 0:t.call(p,e,h.value,h.disabled)}),v=null==x?void 0:x.textContent,w=t.useMemo(()=>s.jsx("option",{value:h.value,disabled:h.disabled,children:v},h.value),[h.disabled,h.value,v]),{onNativeOptionAdd:b,onNativeOptionRemove:j}=m;return n(()=>(b(w),()=>j(w)),[b,j,w]),s.jsxs(s.Fragment,{children:[s.jsx(a.span,{id:h.textId,...u,ref:y}),h.isSelected&&f.valueNode&&!f.valueNodeHasChildren?d.createPortal(u.children,f.valueNode):null]})});Wr.displayName=Hr;var zr="SelectItemIndicator",Vr=t.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Ir(zr,n).isSelected?s.jsx(a.span,{"aria-hidden":!0,...r,ref:t}):null});Vr.displayName=zr;var Br="SelectScrollUpButton",Fr=t.forwardRef((e,o)=>{const a=wr(Br,e.__scopeSelect),i=kr(Br,e.__scopeSelect),[l,c]=t.useState(!1),d=r(o,i.onScrollButtonChange);return n(()=>{if(a.viewport&&a.isPositioned){let e=function(){const e=t.scrollTop>0;c(e)};const t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),l?s.jsx(qr,{...e,ref:d,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Fr.displayName=Br;var $r="SelectScrollDownButton",Kr=t.forwardRef((e,o)=>{const a=wr($r,e.__scopeSelect),i=kr($r,e.__scopeSelect),[l,c]=t.useState(!1),d=r(o,i.onScrollButtonChange);return n(()=>{if(a.viewport&&a.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;c(n)};const t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),l?s.jsx(qr,{...e,ref:d,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Kr.displayName=$r;var qr=t.forwardRef((e,r)=>{const{__scopeSelect:o,onAutoScroll:l,...c}=e,d=wr("SelectScrollButton",o),u=t.useRef(null),f=tr(o),p=t.useCallback(()=>{null!==u.current&&(window.clearInterval(u.current),u.current=null)},[]);return t.useEffect(()=>()=>p(),[p]),n(()=>{var e;const t=f().find(e=>e.ref.current===document.activeElement);null==(e=null==t?void 0:t.ref.current)||e.scrollIntoView({block:"nearest"})},[f]),s.jsx(a.div,{"aria-hidden":!0,...c,ref:r,style:{flexShrink:0,...c.style},onPointerDown:i(c.onPointerDown,()=>{null===u.current&&(u.current=window.setInterval(l,50))}),onPointerMove:i(c.onPointerMove,()=>{var e;null==(e=d.onItemLeave)||e.call(d),null===u.current&&(u.current=window.setInterval(l,50))}),onPointerLeave:i(c.onPointerLeave,()=>{p()})})}),Ur=t.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(a.div,{"aria-hidden":!0,...r,ref:t})});Ur.displayName="SelectSeparator";var Xr="SelectArrow";t.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=or(n),a=ar(Xr,n),i=wr(Xr,n);return a.open&&"popper"===i.position?s.jsx(Kn,{...o,...r,ref:t}):null}).displayName=Xr;var Yr=t.forwardRef(({__scopeSelect:e,value:n,...o},i)=>{const l=t.useRef(null),c=r(i,l),d=ke(n);return t.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(d!==n&&r){const t=new Event("change",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}},[d,n]),s.jsx(a.select,{...o,style:{...Gn,...o.style},ref:c,defaultValue:n})});function Gr(e){return""===e||void 0===e}function Zr(e){const n=u(e),r=t.useRef(""),o=t.useRef(0),s=t.useCallback(e=>{const t=r.current+e;n(t),function e(t){r.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(t)},[n]),a=t.useCallback(()=>{r.current="",window.clearTimeout(o.current)},[]);return t.useEffect(()=>()=>window.clearTimeout(o.current),[]),[r,s,a]}function Qr(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=(a=e,i=Math.max(o,0),a.map((e,t)=>a[(i+t)%a.length]));var a,i;1===r.length&&(s=s.filter(e=>e!==n));const l=s.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}Yr.displayName="SelectBubbleInput";var Jr=ur,eo=hr,to=mr,no=gr,ro=Pr,oo=Or,so=Mr,ao=Wr,io=Vr,lo=Fr,co=Kr,uo=Ur;const fo=cr,po=pr,ho=t.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(Jr,{ref:r,className:c("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,s.jsx(eo,{asChild:!0,children:s.jsx(me,{className:"h-4 w-4 opacity-50"})})]}));ho.displayName=Jr.displayName;const mo=t.forwardRef(({className:e,...t},n)=>s.jsx(lo,{ref:n,className:c("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(xe,{className:"h-4 w-4"})}));mo.displayName=lo.displayName;const xo=t.forwardRef(({className:e,...t},n)=>s.jsx(co,{ref:n,className:c("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(me,{className:"h-4 w-4"})}));xo.displayName=co.displayName;const go=t.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>s.jsx(to,{children:s.jsxs(no,{ref:o,className:c("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[s.jsx(mo,{}),s.jsx(ro,{className:c("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(xo,{})]})}));go.displayName=no.displayName;t.forwardRef(({className:e,...t},n)=>s.jsx(oo,{ref:n,className:c("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t})).displayName=oo.displayName;const yo=t.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(so,{ref:r,className:c("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(io,{children:s.jsx(w,{className:"h-4 w-4"})})}),s.jsx(ao,{children:t})]}));yo.displayName=so.displayName;t.forwardRef(({className:e,...t},n)=>s.jsx(uo,{ref:n,className:c("-mx-1 my-1 h-px bg-muted",e),...t})).displayName=uo.displayName;const vo={"google-drive":"Google Drive",onedrive:"OneDrive",dropbox:"Dropbox"};function wo({open:e,onOpenChange:n,onAdded:r}){const[o,a]=t.useState([]),[i,l]=t.useState(!1),[c,d]=t.useState(null),[u,f]=t.useState(""),[p,h]=t.useState(""),[m,x]=t.useState(""),[g,y]=t.useState(""),[v,w]=t.useState(!1),[O,_]=t.useState(null);t.useEffect(()=>{e&&b().then(e=>a(e.available)).catch(()=>a([]))},[e]);const L=()=>{l(!1),d(null),f(""),h(""),x(""),y(""),w(!1),_(null)},I=o.length>0;return s.jsx(j,{open:e,onOpenChange:e=>{n(e),e||L()},children:s.jsxs(N,{className:"sm:max-w-md",children:[s.jsxs(S,{children:[s.jsxs(C,{className:"flex items-center gap-2",children:[s.jsx(je,{className:"h-5 w-5"}),"添加云盘账号"]}),s.jsx(k,{children:i?"手动填写 OAuth 凭据连接云盘":"选择云盘类型,点击后跳转登录授权"})]}),i?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-4 py-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(P,{children:"云盘类型"}),s.jsxs(fo,{value:u,onValueChange:f,children:[s.jsx(ho,{children:s.jsx(po,{placeholder:"选择云盘类型"})}),s.jsxs(go,{children:[s.jsx(yo,{value:"google-drive",children:"Google Drive"}),s.jsx(yo,{value:"onedrive",children:"OneDrive"}),s.jsx(yo,{value:"dropbox",children:"Dropbox"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(P,{children:"显示名称"}),s.jsx(A,{placeholder:"例如:我的 Google Drive",value:p,onChange:e=>h(e.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(P,{children:"Client ID"}),s.jsx(A,{placeholder:"OAuth Client ID",value:m,onChange:e=>x(e.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(P,{children:"Client Secret"}),s.jsx(A,{type:"password",placeholder:"OAuth Client Secret",value:g,onChange:e=>y(e.target.value)})]}),O&&s.jsx("p",{className:"text-sm text-destructive",children:O})]}),s.jsxs(D,{children:[s.jsx(R,{variant:"outline",onClick:()=>{l(!1),_(null)},children:"返回"}),s.jsx(R,{onClick:async()=>{if(u&&p&&m&&g){w(!0),_(null);try{const{id:e}=await T({type:u,label:p,clientId:m,clientSecret:g}),{url:t}=await E(e);window.open(t,"_blank"),L(),n(!1),r()}catch(e){_(e instanceof Error?e.message:"添加失败")}finally{w(!1)}}else _("请填写所有字段")},disabled:v,children:v?"添加中...":"添加并授权"})]})]}):s.jsxs("div",{className:"space-y-3 py-2",children:[I?s.jsx(s.Fragment,{children:o.map(e=>s.jsx(R,{variant:"outline",className:"w-full justify-start gap-3 h-12 text-base",onClick:()=>{(async e=>{d(e),_(null);try{const{id:t}=await T({type:e,label:vo[e]||e}),{url:o}=await E(t);window.open(o,"_blank"),L(),n(!1),r()}catch(t){_(t instanceof Error?t.message:"添加失败"),d(null)}})(e)},disabled:null!==c,children:c===e?"连接中...":`连接 ${vo[e]||e}`},e))}):s.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"暂无内置 OAuth 凭据,请使用手动模式添加"}),O&&s.jsx("p",{className:"text-sm text-destructive",children:O}),s.jsx("div",{className:"pt-2 border-t border-border",children:s.jsxs("button",{onClick:()=>{l(!0),_(null)},className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(Se,{className:"h-3.5 w-3.5"}),"手动填写 OAuth 凭据"]})})]})]})})}const bo={"google-drive":"Google Drive",onedrive:"OneDrive",dropbox:"Dropbox"};function jo({type:e}){switch(e){case"google-drive":return s.jsx(Ne,{className:"h-5 w-5 text-blue-500"});case"onedrive":return s.jsx(je,{className:"h-5 w-5 text-sky-500"});case"dropbox":return s.jsx(Ne,{className:"h-5 w-5 text-indigo-500"});default:return s.jsx(je,{className:"h-5 w-5"})}}function No({provider:e,onDelete:n,onReauth:r}){var o;const[a,i]=t.useState(!1),l=t.useRef(null);t.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]);return s.jsxs(O,{children:[s.jsx(_,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(jo,{type:e.type}),s.jsxs("div",{children:[s.jsx(L,{className:"text-base",children:e.label}),s.jsx("p",{className:"text-sm text-muted-foreground",children:bo[e.type]||e.type})]})]}),s.jsx(I,{variant:e.authorized?"default":"destructive",className:e.authorized?"bg-green-600 hover:bg-green-700":"",children:e.authorized?"已授权":"未授权"})]})}),s.jsxs(M,{children:[e.authorized&&(null==(o=e.tokens)?void 0:o.expiry)&&s.jsxs("p",{className:"text-xs text-muted-foreground mb-3",children:["授权到期:",new Date(e.tokens.expiry).toLocaleDateString("zh-CN")]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(R,{variant:"outline",size:"sm",onClick:()=>r(e.id),children:[s.jsx(H,{className:"h-3.5 w-3.5 mr-1"}),"重新授权"]}),s.jsxs(R,{variant:a?"destructive":"outline",size:"sm",onClick:()=>{a?(n(e.id),i(!1)):(i(!0),l.current=setTimeout(()=>i(!1),3e3))},children:[s.jsx(W,{className:"h-3.5 w-3.5 mr-1"}),a?"确认删除?":"删除"]})]})]})]})}const So={success:{label:"成功",icon:we,className:"bg-green-600 hover:bg-green-700"},failed:{label:"失败",icon:Ce,className:"bg-red-600 hover:bg-red-700"},partial:{label:"部分完成",icon:ye,className:"bg-yellow-600 hover:bg-yellow-700"}};function Co(e,t){const n=new Date(t).getTime()-new Date(e).getTime();if(n<1e3)return`${n}ms`;const r=Math.floor(n/1e3);if(r<60)return`${r}秒`;return`${Math.floor(r/60)}分${r%60}秒`}function ko({history:e}){const t=e.slice(0,20);return 0===t.length?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[s.jsx(be,{className:"h-10 w-10 mb-3 opacity-50"}),s.jsx("p",{className:"text-sm",children:"暂无备份记录"})]}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b",children:[s.jsx("th",{className:"text-left py-3 px-2 font-medium text-muted-foreground",children:"时间"}),s.jsx("th",{className:"text-left py-3 px-2 font-medium text-muted-foreground",children:"项目"}),s.jsx("th",{className:"text-left py-3 px-2 font-medium text-muted-foreground",children:"云盘"}),s.jsx("th",{className:"text-left py-3 px-2 font-medium text-muted-foreground",children:"状态"}),s.jsx("th",{className:"text-left py-3 px-2 font-medium text-muted-foreground",children:"文件数"}),s.jsx("th",{className:"text-left py-3 px-2 font-medium text-muted-foreground",children:"耗时"})]})}),s.jsx("tbody",{children:t.map(e=>{const t=So[e.status],n=t.icon;return s.jsxs("tr",{className:"border-b last:border-0 hover:bg-muted/50",children:[s.jsx("td",{className:"py-2.5 px-2 whitespace-nowrap",children:(r=e.startTime,new Date(r).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}))}),s.jsx("td",{className:"py-2.5 px-2",children:e.projectName}),s.jsx("td",{className:"py-2.5 px-2",children:e.providerLabel}),s.jsxs("td",{className:"py-2.5 px-2",children:[s.jsxs(I,{className:t.className,children:[s.jsx(n,{className:"h-3 w-3 mr-1"}),t.label]}),e.error&&s.jsx("p",{className:"text-xs text-destructive mt-1",children:e.error})]}),s.jsxs("td",{className:"py-2.5 px-2 whitespace-nowrap",children:[e.filesUploaded,"/",e.filesTotal]}),s.jsx("td",{className:"py-2.5 px-2 whitespace-nowrap",children:Co(e.startTime,e.endTime)})]},e.id);var r})})]})})}const Ro=["node_modules",".git","dist","build","*.log",".DS_Store","*.tmp",".venv","__pycache__",".env"],Po=[{value:"30",label:"30分钟"},{value:"60",label:"1小时"},{value:"360",label:"6小时"},{value:"720",label:"12小时"},{value:"1440",label:"24小时"}];function Ao(){const e=z(),[n,r]=t.useState([]),[o,a]=t.useState(!0),[i,l]=t.useState(!1),[c,d]=t.useState({enabled:!1,intervalMinutes:60}),[u,f]=t.useState(!0),[p,h]=t.useState([]),[m,x]=t.useState(!0),[g,y]=t.useState(""),[v,w]=t.useState(!1),[b,j]=t.useState(!1),[N,S]=t.useState([]),[C,k]=t.useState(!0),[D,T]=t.useState(()=>V()),[O,_]=t.useState(!1),[L,I]=t.useState({webhookEnabled:!1}),[M,W]=t.useState(""),[ie,le]=t.useState(!1),[ce,me]=t.useState(()=>B(F.usageMonitorTool,"claude")),xe=async()=>{try{const e=await J();r(e)}catch{}finally{a(!1)}},ye=async()=>{try{const e=await ne();S(e)}catch{}finally{k(!1)}};t.useEffect(()=>{xe(),(async()=>{try{const e=await ee();d(e)}catch{}finally{f(!1)}})(),(async()=>{try{const e=await te();h(e.length>0?e:Ro)}catch{h(Ro)}finally{x(!1)}})(),ye(),$().then(e=>{I(e),W(e.webhookUrl??"")}).catch(()=>{})},[]);const we=(e,t)=>{const n=parseInt(t,10);isNaN(n)||n<1||(T(t=>({...t,[e]:n})),_(!0))},be=async e=>{try{await re(e),r(t=>t.filter(t=>t.id!==e))}catch{}},je=async e=>{try{const{url:t}=await E(e);window.open(t,"_blank")}catch{}},Ne=()=>{const e=g.trim();e&&!p.includes(e)&&(h(t=>[...t,e]),y(""),w(!0))};return s.jsx("div",{className:"min-h-screen bg-background",children:s.jsxs("div",{className:"max-w-4xl mx-auto p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsxs(R,{variant:"ghost",size:"sm",onClick:()=>e("/"),children:[s.jsx(K,{className:"h-4 w-4 mr-1"}),"返回"]}),s.jsx("h1",{className:"text-2xl font-bold",children:"设置"})]}),s.jsxs(de,{defaultValue:"providers",children:[s.jsxs(ue,{className:"mb-4",children:[s.jsx(fe,{value:"providers",children:"云盘账号"}),s.jsx(fe,{value:"strategy",children:"备份策略"}),s.jsx(fe,{value:"history",children:"备份记录"}),s.jsxs(fe,{value:"notifications",children:[s.jsx(ve,{className:"h-3.5 w-3.5 mr-1.5"}),"通知"]}),s.jsxs(fe,{value:"pomodoro",children:[s.jsx(q,{className:"h-3.5 w-3.5 mr-1.5"}),"番茄钟"]}),s.jsxs(fe,{value:"usage",children:[s.jsx(ge,{className:"h-3.5 w-3.5 mr-1.5"}),"用量监控"]})]}),s.jsxs(pe,{value:"providers",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex justify-end",children:s.jsxs(R,{onClick:()=>l(!0),children:[s.jsx(U,{className:"h-4 w-4 mr-1"}),"添加云盘"]})}),o?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"加载中..."}):0===n.length?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-12",children:"暂无云盘账号,点击上方按钮添加"}):s.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:n.map(e=>s.jsx(No,{provider:e,onDelete:be,onReauth:je},e.id))})]}),s.jsx(wo,{open:i,onOpenChange:l,onAdded:()=>{xe()}})]}),s.jsx(pe,{value:"strategy",children:s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-medium",children:"排除规则"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"匹配这些模式的文件和目录将不会被备份"}),m?s.jsx("p",{className:"text-sm text-muted-foreground",children:"加载中..."}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex flex-wrap gap-2",children:s.jsx(X,{children:p.map(e=>s.jsxs(Y.span,{layout:!0,initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"inline-flex items-center gap-1 rounded-md bg-muted px-2.5 py-1 text-sm",children:[e,s.jsx("button",{onClick:()=>(e=>{h(t=>t.filter(t=>t!==e)),w(!0)})(e),className:"ml-0.5 rounded-sm hover:bg-muted-foreground/20 p-0.5",children:s.jsx(G,{className:"h-3 w-3"})})]},e))})}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(A,{placeholder:"输入排除模式,例如 *.log",value:g,onChange:e=>y(e.target.value),onKeyDown:e=>{"Enter"===e.key&&Ne()},className:"max-w-xs"}),s.jsx(R,{variant:"outline",size:"sm",onClick:Ne,children:"添加"})]}),v&&s.jsxs(R,{onClick:async()=>{j(!0);try{await oe(p),w(!1)}catch{}finally{j(!1)}},disabled:b,children:[s.jsx(he,{className:"h-4 w-4 mr-1"}),b?"保存中...":"保存"]})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-medium",children:"定时备份"}),u?s.jsx("p",{className:"text-sm text-muted-foreground",children:"加载中..."}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(We,{checked:c.enabled,onCheckedChange:async e=>{const t=c;d({...c,enabled:e});try{await se({enabled:e})}catch{d(t)}}}),s.jsx(P,{children:c.enabled?"已开启":"已关闭"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(P,{children:"备份间隔"}),s.jsxs(fo,{value:String(c.intervalMinutes),onValueChange:async e=>{const t=parseInt(e,10),n=c;d({...c,intervalMinutes:t});try{await se({intervalMinutes:t})}catch{d(n)}},children:[s.jsx(ho,{className:"w-48",children:s.jsx(po,{})}),s.jsx(go,{children:Po.map(e=>s.jsx(yo,{value:e.value,children:e.label},e.value))})]})]})]})]})]})}),s.jsx(pe,{value:"history",children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex justify-end",children:s.jsxs(R,{variant:"outline",size:"sm",onClick:()=>{k(!0),ye()},children:[s.jsx(H,{className:"h-4 w-4 mr-1"}),"刷新"]})}),C?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"加载中..."}):s.jsx(ko,{history:N})]})}),s.jsx(pe,{value:"notifications",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[s.jsx("h3",{className:"text-sm font-medium",children:"浏览器通知"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"当 Claude 完成任务时,浏览器将自动弹出通知。首次打开 Dashboard 时会请求通知权限。"})]}),s.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-3",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium",children:"Webhook 通知"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Claude 完成任务时向指定 URL 发送 POST 请求(JSON: event, projectId, projectName, timestamp)"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(P,{className:"text-xs",children:"Webhook URL"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(A,{placeholder:"https://hooks.slack.com/...",value:M,onChange:e=>W(e.target.value),className:"font-mono text-xs"}),s.jsx(R,{size:"sm",onClick:()=>{(async()=>{le(!0);try{const e=await ae({webhookEnabled:M.trim().length>0,webhookUrl:M.trim()||void 0});I(e),Q.success("Webhook 配置已保存")}catch{Q.error("保存失败")}finally{le(!1)}})()},disabled:ie,children:ie?"保存中…":"保存"})]}),L.webhookEnabled&&L.webhookUrl&&s.jsxs("p",{className:"text-xs text-green-500",children:["已启用 → ",L.webhookUrl]})]})]})]})}),s.jsx(pe,{value:"pomodoro",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium",children:"番茄钟时间设置"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"修改后重新启动番茄钟生效"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-6 max-w-xs",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(P,{className:"text-xs",children:"工作时长(分钟)"}),s.jsx(A,{type:"number",min:1,max:120,value:D.workMinutes,onChange:e=>we("workMinutes",e.target.value),className:"w-full"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(P,{className:"text-xs",children:"休息时长(分钟)"}),s.jsx(A,{type:"number",min:1,max:60,value:D.breakMinutes,onChange:e=>we("breakMinutes",e.target.value),className:"w-full"})]})]}),O&&s.jsxs(R,{size:"sm",onClick:()=>{Z(F.pomodoroConfig,D,!0),_(!1),Q.success("番茄钟设置已保存")},children:[s.jsx(he,{className:"h-3.5 w-3.5 mr-1.5"}),"保存"]})]}),s.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[s.jsx("h3",{className:"text-sm font-medium",children:"使用说明"}),s.jsxs("ul",{className:"text-xs text-muted-foreground space-y-1 list-disc list-inside",children:[s.jsxs("li",{children:["在项目页面 Header 点击 ",s.jsx(q,{className:"h-3 w-3 inline-block mx-0.5"})," 图标启动番茄钟"]}),s.jsx("li",{children:"倒计时以大字体悬浮在屏幕上,不影响操作"}),s.jsx("li",{children:"工作阶段结束后自动切换为休息,并弹出通知"}),s.jsx("li",{children:"休息结束后自动切换回工作阶段"}),s.jsx("li",{children:"再次点击图标可停止并重置"})]})]})]})}),s.jsx(pe,{value:"usage",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium",children:"监控工具"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"选择要监控用量的 CLI 工具,首页和项目页会显示对应的实时用量"})]}),s.jsx("div",{className:"grid gap-3 max-w-md",children:[{key:"claude",label:"Claude Code",desc:"Anthropic API — 5h/7d 用量窗口"},{key:"codex",label:"Codex",desc:"OpenAI — 用量查询暂未实现"},{key:"opencode",label:"OpenCode",desc:"OpenCode — 用量查询暂未实现"},{key:"qwen",label:"Qwen Code",desc:"Qwen — 用量查询暂未实现"},{key:"gemini",label:"Gemini CLI",desc:"Google — 用量查询暂未实现"}].map(e=>s.jsxs("label",{className:"flex items-start gap-3 rounded-lg border p-3 cursor-pointer transition-colors "+(ce===e.key?"border-blue-500/50 bg-blue-500/5":"border-border hover:bg-muted/30"),children:[s.jsx("input",{type:"radio",name:"usageTool",value:e.key,checked:ce===e.key,onChange:()=>{me(e.key),Z(F.usageMonitorTool,e.key),window.dispatchEvent(new Event("ccweb:usage-tool-change")),Q.success(`用量监控已切换为 ${e.label}`)},className:"mt-0.5"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium",children:e.label}),s.jsx("div",{className:"text-xs text-muted-foreground",children:e.desc})]})]},e.key))})]}),s.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[s.jsx("h3",{className:"text-sm font-medium",children:"说明"}),s.jsxs("ul",{className:"text-xs text-muted-foreground space-y-1 list-disc list-inside",children:[s.jsx("li",{children:"用量数据显示在首页 Header 和项目页底部状态栏"}),s.jsx("li",{children:"Claude Code 通过 OAuth API 实时查询,每 5 分钟自动刷新"}),s.jsx("li",{children:"其他工具的用量查询将在后续版本中支持"}),s.jsx("li",{children:"切换后无需刷新页面,用量会自动更新"})]})]})]})})]})]})})}export{Ao as SettingsPage};
13
+ */function ke(e){const n=t.useRef({value:e,previous:e});return t.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}function Re(e){const[r,o]=t.useState(void 0);return n(()=>{if(e){o({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const n=t[0];let r,s;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,s=t.blockSize}else r=e.offsetWidth,s=e.offsetHeight;o({width:r,height:s})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}o(void 0)},[e]),r}var Pe="Switch",[Ae]=l(Pe),[De,Te]=Ae(Pe),Ee=t.forwardRef((e,n)=>{const{__scopeSwitch:l,name:c,checked:d,defaultChecked:u,required:f,disabled:p,value:h="on",onCheckedChange:m,form:x,...g}=e,[y,v]=t.useState(null),w=r(n,e=>v(e)),b=t.useRef(!1),j=!y||(x||!!y.closest("form")),[N,S]=o({prop:d,defaultProp:u??!1,onChange:m,caller:Pe});return s.jsxs(De,{scope:l,checked:N,disabled:p,children:[s.jsx(a.button,{type:"button",role:"switch","aria-checked":N,"aria-required":f,"data-state":Ie(N),"data-disabled":p?"":void 0,disabled:p,value:h,...g,ref:w,onClick:i(e.onClick,e=>{S(e=>!e),j&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})}),j&&s.jsx(Le,{control:y,bubbles:!b.current,name:c,value:h,checked:N,required:f,disabled:p,form:x,style:{transform:"translateX(-100%)"}})]})});Ee.displayName=Pe;var Oe="SwitchThumb",_e=t.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=Te(Oe,n);return s.jsx(a.span,{"data-state":Ie(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});_e.displayName=Oe;var Le=t.forwardRef(({__scopeSwitch:e,control:n,checked:o,bubbles:a=!0,...i},l)=>{const c=t.useRef(null),d=r(c,l),u=ke(o),f=Re(n);return t.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==o&&n){const t=new Event("click",{bubbles:a});n.call(e,o),e.dispatchEvent(t)}},[u,o,a]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o,...i,tabIndex:-1,ref:d,style:{...i.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Ie(e){return e?"checked":"unchecked"}Le.displayName="SwitchBubbleInput";var Me=Ee,He=_e;const We=t.forwardRef(({className:e,...t},n)=>s.jsx(Me,{className:c("peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:s.jsx(He,{className:c("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));We.displayName=Me.displayName;const ze=["top","right","bottom","left"],Be=Math.min,Ve=Math.max,Fe=Math.round,$e=Math.floor,Ke=e=>({x:e,y:e}),qe={left:"right",right:"left",bottom:"top",top:"bottom"};function Ue(e,t,n){return Ve(e,Be(t,n))}function Xe(e,t){return"function"==typeof e?e(t):e}function Ye(e){return e.split("-")[0]}function Ge(e){return e.split("-")[1]}function Ze(e){return"x"===e?"y":"x"}function Qe(e){return"y"===e?"height":"width"}function Je(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function et(e){return Ze(Je(e))}function tt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const nt=["left","right"],rt=["right","left"],ot=["top","bottom"],st=["bottom","top"];function at(e,t,n,r){const o=Ge(e);let s=function(e,t,n){switch(e){case"top":case"bottom":return n?t?rt:nt:t?nt:rt;case"left":case"right":return t?ot:st;default:return[]}}(Ye(e),"start"===n,r);return o&&(s=s.map(e=>e+"-"+o),t&&(s=s.concat(s.map(tt)))),s}function it(e){const t=Ye(e);return qe[t]+e.slice(t.length)}function lt(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function ct(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function dt(e,t,n){let{reference:r,floating:o}=e;const s=Je(t),a=et(t),i=Qe(a),l=Ye(t),c="y"===s,d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,f=r[i]/2-o[i]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}switch(Ge(t)){case"start":p[a]-=f*(n&&c?-1:1);break;case"end":p[a]+=f*(n&&c?-1:1)}return p}async function ut(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:s,rects:a,elements:i,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=Xe(t,e),h=lt(p),m=i[f?"floating"===u?"reference":"floating":u],x=ct(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(m)))||n?m:m.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(i.floating)),boundary:c,rootBoundary:d,strategy:l})),g="floating"===u?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==s.getOffsetParent?void 0:s.getOffsetParent(i.floating)),v=await(null==s.isElement?void 0:s.isElement(y))&&await(null==s.getScale?void 0:s.getScale(y))||{x:1,y:1},w=ct(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:g,offsetParent:y,strategy:l}):g);return{top:(x.top-w.top+h.top)/v.y,bottom:(w.bottom-x.bottom+h.bottom)/v.y,left:(x.left-w.left+h.left)/v.x,right:(w.right-x.right+h.right)/v.x}}function ft(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pt(e){return ze.some(t=>e[t]>=0)}const ht=new Set(["left","top"]);function mt(){return"undefined"!=typeof window}function xt(e){return vt(e)?(e.nodeName||"").toLowerCase():"#document"}function gt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function yt(e){var t;return null==(t=(vt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function vt(e){return!!mt()&&(e instanceof Node||e instanceof gt(e).Node)}function wt(e){return!!mt()&&(e instanceof Element||e instanceof gt(e).Element)}function bt(e){return!!mt()&&(e instanceof HTMLElement||e instanceof gt(e).HTMLElement)}function jt(e){return!(!mt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof gt(e).ShadowRoot)}function Nt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ot(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function St(e){return/^(table|td|th)$/.test(xt(e))}function Ct(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}const kt=/transform|translate|scale|rotate|perspective|filter/,Rt=/paint|layout|strict|content/,Pt=e=>!!e&&"none"!==e;let At;function Dt(e){const t=wt(e)?Ot(e):e;return Pt(t.transform)||Pt(t.translate)||Pt(t.scale)||Pt(t.rotate)||Pt(t.perspective)||!Tt()&&(Pt(t.backdropFilter)||Pt(t.filter))||kt.test(t.willChange||"")||Rt.test(t.contain||"")}function Tt(){return null==At&&(At="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),At}function Et(e){return/^(html|body|#document)$/.test(xt(e))}function Ot(e){return gt(e).getComputedStyle(e)}function _t(e){return wt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Lt(e){if("html"===xt(e))return e;const t=e.assignedSlot||e.parentNode||jt(e)&&e.host||yt(e);return jt(t)?t.host:t}function It(e){const t=Lt(e);return Et(t)?e.ownerDocument?e.ownerDocument.body:e.body:bt(t)&&Nt(t)?t:It(t)}function Mt(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=It(e),s=o===(null==(r=e.ownerDocument)?void 0:r.body),a=gt(o);if(s){const e=Ht(a);return t.concat(a,a.visualViewport||[],Nt(o)?o:[],e&&n?Mt(e):[])}return t.concat(o,Mt(o,[],n))}function Ht(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Wt(e){const t=Ot(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=bt(e),s=o?e.offsetWidth:n,a=o?e.offsetHeight:r,i=Fe(n)!==s||Fe(r)!==a;return i&&(n=s,r=a),{width:n,height:r,$:i}}function zt(e){return wt(e)?e:e.contextElement}function Bt(e){const t=zt(e);if(!bt(t))return Ke(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Wt(t);let a=(s?Fe(n.width):n.width)/r,i=(s?Fe(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),i&&Number.isFinite(i)||(i=1),{x:a,y:i}}const Vt=Ke(0);function Ft(e){const t=gt(e);return Tt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Vt}function $t(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),s=zt(e);let a=Ke(1);t&&(r?wt(r)&&(a=Bt(r)):a=Bt(e));const i=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==gt(e))&&t}(s,n,r)?Ft(s):Ke(0);let l=(o.left+i.x)/a.x,c=(o.top+i.y)/a.y,d=o.width/a.x,u=o.height/a.y;if(s){const e=gt(s),t=r&&wt(r)?gt(r):r;let n=e,o=Ht(n);for(;o&&r&&t!==n;){const e=Bt(o),t=o.getBoundingClientRect(),r=Ot(o),s=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=s,c+=a,n=gt(o),o=Ht(n)}}return ct({width:d,height:u,x:l,y:c})}function Kt(e,t){const n=_t(e).scrollLeft;return t?t.left+n:$t(yt(e)).left+n}function qt(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Kt(e,n),y:n.top+t.scrollTop}}function Ut(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=gt(e),r=yt(e),o=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,i=0,l=0;if(o){s=o.width,a=o.height;const e=Tt();(!e||e&&"fixed"===t)&&(i=o.offsetLeft,l=o.offsetTop)}const c=Kt(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=25&&(s-=a)}else c<=25&&(s+=c);return{width:s,height:a,x:i,y:l}}(e,n);else if("document"===t)r=function(e){const t=yt(e),n=_t(e),r=e.ownerDocument.body,o=Ve(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ve(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Kt(e);const i=-n.scrollTop;return"rtl"===Ot(r).direction&&(a+=Ve(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:a,y:i}}(yt(e));else if(wt(t))r=function(e,t){const n=$t(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=bt(e)?Bt(e):Ke(1);return{width:e.clientWidth*s.x,height:e.clientHeight*s.y,x:o*s.x,y:r*s.y}}(t,n);else{const n=Ft(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ct(r)}function Xt(e,t){const n=Lt(e);return!(n===t||!wt(n)||Et(n))&&("fixed"===Ot(n).position||Xt(n,t))}function Yt(e,t,n){const r=bt(t),o=yt(t),s="fixed"===n,a=$t(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const l=Ke(0);function c(){l.x=Kt(o)}if(r||!r&&!s)if(("body"!==xt(t)||Nt(o))&&(i=_t(t)),r){const e=$t(t,!0,s,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();s&&!r&&o&&c();const d=!o||r||s?Ke(0):qt(o,i);return{x:a.left+i.scrollLeft-l.x-d.x,y:a.top+i.scrollTop-l.y-d.y,width:a.width,height:a.height}}function Gt(e){return"static"===Ot(e).position}function Zt(e,t){if(!bt(e)||"fixed"===Ot(e).position)return null;if(t)return t(e);let n=e.offsetParent;return yt(e)===n&&(n=n.ownerDocument.body),n}function Qt(e,t){const n=gt(e);if(Ct(e))return n;if(!bt(e)){let t=Lt(e);for(;t&&!Et(t);){if(wt(t)&&!Gt(t))return t;t=Lt(t)}return n}let r=Zt(e,t);for(;r&&St(r)&&Gt(r);)r=Zt(r,t);return r&&Et(r)&&Gt(r)&&!Dt(r)?n:r||function(e){let t=Lt(e);for(;bt(t)&&!Et(t);){if(Dt(t))return t;if(Ct(t))return null;t=Lt(t)}return null}(e)||n}const Jt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s="fixed"===o,a=yt(r),i=!!t&&Ct(t.floating);if(r===a||i&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Ke(1);const d=Ke(0),u=bt(r);if((u||!u&&!s)&&(("body"!==xt(r)||Nt(a))&&(l=_t(r)),u)){const e=$t(r);c=Bt(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}const f=!a||u||s?Ke(0):qt(a,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+f.x,y:n.y*c.y-l.scrollTop*c.y+d.y+f.y}},getDocumentElement:yt,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[..."clippingAncestors"===n?Ct(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Mt(e,[],!1).filter(e=>wt(e)&&"body"!==xt(e)),o=null;const s="fixed"===Ot(e).position;let a=s?Lt(e):e;for(;wt(a)&&!Et(a);){const t=Ot(a),n=Dt(a);n||"fixed"!==t.position||(o=null),(s?!n&&!o:!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||Nt(a)&&!n&&Xt(e,a))?r=r.filter(e=>e!==a):o=t,a=Lt(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=Ut(t,s[0],o);let i=a.top,l=a.right,c=a.bottom,d=a.left;for(let u=1;u<s.length;u++){const e=Ut(t,s[u],o);i=Ve(e.top,i),l=Be(e.right,l),c=Be(e.bottom,c),d=Ve(e.left,d)}return{width:l-d,height:c-i,x:d,y:i}},getOffsetParent:Qt,getElementRects:async function(e){const t=this.getOffsetParent||Qt,n=this.getDimensions,r=await n(e.floating);return{reference:Yt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Wt(e);return{width:t,height:n}},getScale:Bt,isElement:wt,isRTL:function(e){return"rtl"===Ot(e).direction}};function en(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tn(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:i="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=zt(e),d=o||s?[...c?Mt(c):[],...t?Mt(t):[]]:[];d.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),s&&e.addEventListener("resize",n)});const u=c&&i?function(e,t){let n,r=null;const o=yt(e);function s(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(i,l){void 0===i&&(i=!1),void 0===l&&(l=1),s();const c=e.getBoundingClientRect(),{left:d,top:u,width:f,height:p}=c;if(i||t(),!f||!p)return;const h={rootMargin:-$e(u)+"px "+-$e(o.clientWidth-(d+f))+"px "+-$e(o.clientHeight-(u+p))+"px "+-$e(d)+"px",threshold:Ve(0,Be(1,l))||1};let m=!0;function x(t){const r=t[0].intersectionRatio;if(r!==l){if(!m)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||en(c,e.getBoundingClientRect())||a(),m=!1}try{r=new IntersectionObserver(x,{...h,root:o.ownerDocument})}catch(g){r=new IntersectionObserver(x,h)}r.observe(e)}(!0),s}(c,n):null;let f,p=-1,h=null;a&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!l&&h.observe(c),t&&h.observe(t));let m=l?$t(e):null;return l&&function t(){const r=$t(e);m&&!en(m,r)&&n();m=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",n),s&&e.removeEventListener("resize",n)}),null==u||u(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const nn=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:a,middlewareData:i}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,s=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=Ye(n),i=Ge(n),l="y"===Je(n),c=ht.has(a)?-1:1,d=s&&l?-1:1,u=Xe(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return i&&"number"==typeof h&&(p="end"===i?-1*h:h),l?{x:p*d,y:f*c}:{x:f*c,y:p*d}}(t,e);return a===(null==(n=i.offset)?void 0:n.placement)&&null!=(r=i.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:a}}}}},rn=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Xe(e,t),d={x:n,y:r},u=await s.detectOverflow(t,c),f=Je(Ye(o)),p=Ze(f);let h=d[p],m=d[f];if(a){const e="y"===p?"bottom":"right";h=Ue(h+u["y"===p?"top":"left"],h,h-u[e])}if(i){const e="y"===f?"bottom":"right";m=Ue(m+u["y"===f?"top":"left"],m,m-u[e])}const x=l.fn({...t,[p]:h,[f]:m});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[p]:a,[f]:i}}}}}},on=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:a,initialPlacement:i,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...x}=Xe(e,t);if(null!=(n=s.arrow)&&n.alignmentOffset)return{};const g=Ye(o),y=Je(i),v=Ye(i)===i,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),b=f||(v||!m?[it(i)]:function(e){const t=it(e);return[tt(e),t,tt(t)]}(i)),j="none"!==h;!f&&j&&b.push(...at(i,m,h,w));const N=[i,...b],S=await l.detectOverflow(t,x),C=[];let k=(null==(r=s.flip)?void 0:r.overflows)||[];if(d&&C.push(S[g]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=Ge(e),o=et(e),s=Qe(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=it(a)),[a,it(a)]}(o,a,w);C.push(S[e[0]],S[e[1]])}if(k=[...k,{placement:o,overflows:C}],!C.every(e=>e<=0)){var R,P;const e=((null==(R=s.flip)?void 0:R.index)||0)+1,t=N[e];if(t){if(!("alignment"===u&&y!==Je(t))||k.every(e=>Je(e.placement)!==y||e.overflows[0]>0))return{data:{index:e,overflows:k},reset:{placement:t}}}let n=null==(P=k.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:P.placement;if(!n)switch(p){case"bestFit":{var A;const e=null==(A=k.filter(e=>{if(j){const t=Je(e.placement);return t===y||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:A[0];e&&(n=e);break}case"initialPlacement":n=i}if(o!==n)return{reset:{placement:n}}}return{}}}},sn=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:a,elements:i}=t,{apply:l=()=>{},...c}=Xe(e,t),d=await a.detectOverflow(t,c),u=Ye(o),f=Ge(o),p="y"===Je(o),{width:h,height:m}=s.floating;let x,g;"top"===u||"bottom"===u?(x=u,g=f===(await(null==a.isRTL?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(g=u,x="end"===f?"top":"bottom");const y=m-d.top-d.bottom,v=h-d.left-d.right,w=Be(m-d[x],y),b=Be(h-d[g],v),j=!t.middlewareData.shift;let N=w,S=b;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=v),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(N=y),j&&!f){const e=Ve(d.left,0),t=Ve(d.right,0),n=Ve(d.top,0),r=Ve(d.bottom,0);p?S=h-2*(0!==e||0!==t?e+t:Ve(d.left,d.right)):N=m-2*(0!==n||0!==r?n+r:Ve(d.top,d.bottom))}await l({...t,availableWidth:S,availableHeight:N});const C=await a.getDimensions(i.floating);return h!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}},an=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=Xe(e,t);switch(o){case"referenceHidden":{const e=ft(await r.detectOverflow(t,{...s,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:pt(e)}}}case"escaped":{const e=ft(await r.detectOverflow(t,{...s,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:pt(e)}}}default:return{}}}}},ln=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:a,elements:i,middlewareData:l}=t,{element:c,padding:d=0}=Xe(e,t)||{};if(null==c)return{};const u=lt(d),f={x:n,y:r},p=et(o),h=Qe(p),m=await a.getDimensions(c),x="y"===p,g=x?"top":"left",y=x?"bottom":"right",v=x?"clientHeight":"clientWidth",w=s.reference[h]+s.reference[p]-f[p]-s.floating[h],b=f[p]-s.reference[p],j=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let N=j?j[v]:0;N&&await(null==a.isElement?void 0:a.isElement(j))||(N=i.floating[v]||s.floating[h]);const S=w/2-b/2,C=N/2-m[h]/2-1,k=Be(u[g],C),R=Be(u[y],C),P=k,A=N-m[h]-R,D=N/2-m[h]/2+S,T=Ue(P,D,A),E=!l.arrow&&null!=Ge(o)&&D!==T&&s.reference[h]/2-(D<P?k:R)-m[h]/2<0,O=E?D<P?D-P:D-A:0;return{[p]:f[p]+O,data:{[p]:T,centerOffset:D-T-O,...E&&{alignmentOffset:O}},reset:E}}}),cn=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:a}=t,{offset:i=0,mainAxis:l=!0,crossAxis:c=!0}=Xe(e,t),d={x:n,y:r},u=Je(o),f=Ze(u);let p=d[f],h=d[u];const m=Xe(i,t),x="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===f?"height":"width",t=s.reference[f]-s.floating[e]+x.mainAxis,n=s.reference[f]+s.reference[e]-x.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var g,y;const e="y"===f?"width":"height",t=ht.has(Ye(o)),n=s.reference[u]-s.floating[e]+(t&&(null==(g=a.offset)?void 0:g[u])||0)+(t?0:x.crossAxis),r=s.reference[u]+s.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[u])||0)-(t?x.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[f]:p,[u]:h}}}},dn=(e,t,n)=>{const r=new Map,o={platform:Jt,...n},s={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:a}=n,i=a.detectOverflow?a:{...a,detectOverflow:ut},l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=dt(c,r,l),f=r,p=0;const h={};for(let m=0;m<s.length;m++){const n=s[m];if(!n)continue;const{name:x,fn:g}=n,{x:y,y:v,data:w,reset:b}=await g({x:d,y:u,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});d=null!=y?y:d,u=null!=v?v:u,h[x]={...h[x],...w},b&&p<50&&(p++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:d,y:u}=dt(c,f,l))),m=-1)}return{x:d,y:u,placement:f,strategy:o,middlewareData:h}})(e,t,{...o,platform:s})};var un="undefined"!=typeof document?t.useLayoutEffect:function(){};function fn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!fn(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!fn(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function pn(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function hn(e,t){const n=pn(e);return Math.round(t*n)/n}function mn(e){const n=t.useRef(e);return un(()=>{n.current=e}),n}const xn=(e,t)=>{const n=nn(e);return{name:n.name,fn:n.fn,options:[e,t]}},gn=(e,t)=>{const n=rn(e);return{name:n.name,fn:n.fn,options:[e,t]}},yn=(e,t)=>{const n=on(e);return{name:n.name,fn:n.fn,options:[e,t]}},vn=(e,t)=>{const n=sn(e);return{name:n.name,fn:n.fn,options:[e,t]}},wn=(e,t)=>{const n=an(e);return{name:n.name,fn:n.fn,options:[e,t]}},bn=(e,t)=>{const n=(e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?ln({element:n.current,padding:r}).fn(t):{}:n?ln({element:n,padding:r}).fn(t):{};var o}}))(e);return{name:n.name,fn:n.fn,options:[e,t]}};var jn=t.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return s.jsx(a.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});jn.displayName="Arrow";var Nn=jn,Sn="Popper",[Cn,kn]=l(Sn),[Rn,Pn]=Cn(Sn),An=e=>{const{__scopePopper:n,children:r}=e,[o,a]=t.useState(null);return s.jsx(Rn,{scope:n,anchor:o,onAnchorChange:a,children:r})};An.displayName=Sn;var Dn="PopperAnchor",Tn=t.forwardRef((e,n)=>{const{__scopePopper:o,virtualRef:i,...l}=e,c=Pn(Dn,o),d=t.useRef(null),u=r(n,d),f=t.useRef(null);return t.useEffect(()=>{const e=f.current;f.current=(null==i?void 0:i.current)||d.current,e!==f.current&&c.onAnchorChange(f.current)}),i?null:s.jsx(a.div,{...l,ref:u})});Tn.displayName=Dn;var En="PopperContent",[On,_n]=Cn(En),Ln=t.forwardRef((e,o)=>{var i,l,c,f,p,h;const{__scopePopper:m,side:x="bottom",sideOffset:g=0,align:y="center",alignOffset:v=0,arrowPadding:w=0,avoidCollisions:b=!0,collisionBoundary:j=[],collisionPadding:N=0,sticky:S="partial",hideWhenDetached:C=!1,updatePositionStrategy:k="optimized",onPlaced:R,...P}=e,A=Pn(En,m),[D,T]=t.useState(null),E=r(o,e=>T(e)),[O,_]=t.useState(null),L=Re(O),I=(null==L?void 0:L.width)??0,M=(null==L?void 0:L.height)??0,H=x+("center"!==y?"-"+y:""),W="number"==typeof N?N:{top:0,right:0,bottom:0,left:0,...N},z=Array.isArray(j)?j:[j],B=z.length>0,V={padding:W,boundary:z.filter(Wn),altBoundary:B},{refs:F,floatingStyles:$,placement:K,isPositioned:q,middlewareData:U}=function(e){void 0===e&&(e={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:s,elements:{reference:a,floating:i}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[f,p]=t.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[h,m]=t.useState(o);fn(h,o)||m(o);const[x,g]=t.useState(null),[y,v]=t.useState(null),w=t.useCallback(e=>{e!==S.current&&(S.current=e,g(e))},[]),b=t.useCallback(e=>{e!==C.current&&(C.current=e,v(e))},[]),j=a||x,N=i||y,S=t.useRef(null),C=t.useRef(null),k=t.useRef(f),R=null!=c,P=mn(c),A=mn(s),D=mn(u),T=t.useCallback(()=>{if(!S.current||!C.current)return;const e={placement:n,strategy:r,middleware:h};A.current&&(e.platform=A.current),dn(S.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==D.current};E.current&&!fn(k.current,t)&&(k.current=t,d.flushSync(()=>{p(t)}))})},[h,n,r,A,D]);un(()=>{!1===u&&k.current.isPositioned&&(k.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[u]);const E=t.useRef(!1);un(()=>(E.current=!0,()=>{E.current=!1}),[]),un(()=>{if(j&&(S.current=j),N&&(C.current=N),j&&N){if(P.current)return P.current(j,N,T);T()}},[j,N,T,P,R]);const O=t.useMemo(()=>({reference:S,floating:C,setReference:w,setFloating:b}),[w,b]),_=t.useMemo(()=>({reference:j,floating:N}),[j,N]),L=t.useMemo(()=>{const e={position:r,left:0,top:0};if(!_.floating)return e;const t=hn(_.floating,f.x),n=hn(_.floating,f.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...pn(_.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,_.floating,f.x,f.y]);return t.useMemo(()=>({...f,update:T,refs:O,elements:_,floatingStyles:L}),[f,T,O,_,L])}({strategy:"fixed",placement:H,whileElementsMounted:(...e)=>tn(...e,{animationFrame:"always"===k}),elements:{reference:A.anchor},middleware:[xn({mainAxis:g+M,alignmentAxis:v}),b&&gn({mainAxis:!0,crossAxis:!1,limiter:"partial"===S?{fn:cn(X).fn,options:[X,Y]}:void 0,...V}),b&&yn({...V}),vn({...V,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:s}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${s}px`)}}),O&&bn({element:O,padding:w}),zn({arrowWidth:I,arrowHeight:M}),C&&wn({strategy:"referenceHidden",...V})]});var X,Y;const[G,Z]=Bn(K),Q=u(R);n(()=>{q&&(null==Q||Q())},[q,Q]);const J=null==(i=U.arrow)?void 0:i.x,ee=null==(l=U.arrow)?void 0:l.y,te=0!==(null==(c=U.arrow)?void 0:c.centerOffset),[ne,re]=t.useState();return n(()=>{D&&re(window.getComputedStyle(D).zIndex)},[D]),s.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:q?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[null==(f=U.transformOrigin)?void 0:f.x,null==(p=U.transformOrigin)?void 0:p.y].join(" "),...(null==(h=U.hide)?void 0:h.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(On,{scope:m,placedSide:G,onArrowChange:_,arrowX:J,arrowY:ee,shouldHideArrow:te,children:s.jsx(a.div,{"data-side":G,"data-align":Z,...P,ref:E,style:{...P.style,animation:q?void 0:"none"}})})})});Ln.displayName=En;var In="PopperArrow",Mn={top:"bottom",right:"left",bottom:"top",left:"right"},Hn=t.forwardRef(function(e,t){const{__scopePopper:n,...r}=e,o=_n(In,n),a=Mn[o.placedSide];return s.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:s.jsx(Nn,{...r,ref:t,style:{...r.style,display:"block"}})})});function Wn(e){return null!==e}Hn.displayName=In;var zn=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o;const{placement:s,rects:a,middlewareData:i}=t,l=0!==(null==(n=i.arrow)?void 0:n.centerOffset),c=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[u,f]=Bn(s),p={start:"0%",center:"50%",end:"100%"}[f],h=((null==(r=i.arrow)?void 0:r.x)??0)+c/2,m=((null==(o=i.arrow)?void 0:o.y)??0)+d/2;let x="",g="";return"bottom"===u?(x=l?p:`${h}px`,g=-d+"px"):"top"===u?(x=l?p:`${h}px`,g=`${a.floating.height+d}px`):"right"===u?(x=-d+"px",g=l?p:`${m}px`):"left"===u&&(x=`${a.floating.width+d}px`,g=l?p:`${m}px`),{data:{x:x,y:g}}}});function Bn(e){const[t,n="center"]=e.split("-");return[t,n]}var Vn=An,Fn=Tn,$n=Ln,Kn=Hn;function qn(e){const n=Un(e),r=t.forwardRef((e,r)=>{const{children:o,...a}=e,i=t.Children.toArray(o),l=i.find(Yn);if(l){const e=l.props.children,o=i.map(n=>n===l?t.Children.count(e)>1?t.Children.only(null):t.isValidElement(e)?e.props.children:null:n);return s.jsx(n,{...a,ref:r,children:t.isValidElement(e)?t.cloneElement(e,void 0,o):null})}return s.jsx(n,{...a,ref:r,children:o})});return r.displayName=`${e}.Slot`,r}function Un(e){const n=t.forwardRef((e,n)=>{const{children:r,...o}=e;if(t.isValidElement(r)){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}(r),s=function(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...e)=>{const t=s(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...s}:"className"===r&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}(o,r.props);return r.type!==t.Fragment&&(s.ref=n?f(n,e):e),t.cloneElement(r,s)}return t.Children.count(r)>1?t.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var Xn=Symbol("radix.slottable");function Yn(e){return t.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Xn}var Gn=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});t.forwardRef((e,t)=>s.jsx(a.span,{...e,ref:t,style:{...Gn,...e.style}})).displayName="VisuallyHidden";var Zn=[" ","Enter","ArrowUp","ArrowDown"],Qn=[" ","Enter"],Jn="Select",[er,tr,nr]=le(Jn),[rr]=l(Jn,[nr,kn]),or=kn(),[sr,ar]=rr(Jn),[ir,lr]=rr(Jn),cr=e=>{const{__scopeSelect:n,children:r,open:a,defaultOpen:i,onOpenChange:l,value:c,defaultValue:d,onValueChange:u,dir:f,name:h,autoComplete:m,disabled:x,required:g,form:y}=e,v=or(n),[w,b]=t.useState(null),[j,N]=t.useState(null),[S,C]=t.useState(!1),k=ie(f),[R,P]=o({prop:a,defaultProp:i??!1,onChange:l,caller:Jn}),[A,D]=o({prop:c,defaultProp:d,onChange:u,caller:Jn}),T=t.useRef(null),E=!w||(y||!!w.closest("form")),[O,_]=t.useState(new Set),L=Array.from(O).map(e=>e.props.value).join(";");return s.jsx(Vn,{...v,children:s.jsxs(sr,{required:g,scope:n,trigger:w,onTriggerChange:b,valueNode:j,onValueNodeChange:N,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:p(),value:A,onValueChange:D,open:R,onOpenChange:P,dir:k,triggerPointerDownPosRef:T,disabled:x,children:[s.jsx(er.Provider,{scope:n,children:s.jsx(ir,{scope:e.__scopeSelect,onNativeOptionAdd:t.useCallback(e=>{_(t=>new Set(t).add(e))},[]),onNativeOptionRemove:t.useCallback(e=>{_(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:r})}),E?s.jsxs(Yr,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:m,value:A,onChange:e=>D(e.target.value),disabled:x,form:y,children:[void 0===A?s.jsx("option",{value:""}):null,Array.from(O)]},L):null]})})};cr.displayName=Jn;var dr="SelectTrigger",ur=t.forwardRef((e,n)=>{const{__scopeSelect:o,disabled:l=!1,...c}=e,d=or(o),u=ar(dr,o),f=u.disabled||l,p=r(n,u.onTriggerChange),h=tr(o),m=t.useRef("touch"),[x,g,y]=Zr(e=>{const t=h().filter(e=>!e.disabled),n=t.find(e=>e.value===u.value),r=Qr(t,e,n);void 0!==r&&u.onValueChange(r.value)}),v=e=>{f||(u.onOpenChange(!0),y()),e&&(u.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return s.jsx(Fn,{asChild:!0,...d,children:s.jsx(a.button,{type:"button",role:"combobox","aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":Gr(u.value)?"":void 0,...c,ref:p,onClick:i(c.onClick,e=>{e.currentTarget.focus(),"mouse"!==m.current&&v(e)}),onPointerDown:i(c.onPointerDown,e=>{m.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(v(e),e.preventDefault())}),onKeyDown:i(c.onKeyDown,e=>{const t=""!==x.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||g(e.key),t&&" "===e.key||Zn.includes(e.key)&&(v(),e.preventDefault())})})})});ur.displayName=dr;var fr="SelectValue",pr=t.forwardRef((e,t)=>{const{__scopeSelect:o,className:i,style:l,children:c,placeholder:d="",...u}=e,f=ar(fr,o),{onValueNodeHasChildrenChange:p}=f,h=void 0!==c,m=r(t,f.onValueNodeChange);return n(()=>{p(h)},[p,h]),s.jsx(a.span,{...u,ref:m,style:{pointerEvents:"none"},children:Gr(f.value)?s.jsx(s.Fragment,{children:d}):c})});pr.displayName=fr;var hr=t.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return s.jsx(a.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});hr.displayName="SelectIcon";var mr=e=>s.jsx(h,{asChild:!0,...e});mr.displayName="SelectPortal";var xr="SelectContent",gr=t.forwardRef((e,r)=>{const o=ar(xr,e.__scopeSelect),[a,i]=t.useState();if(n(()=>{i(new DocumentFragment)},[]),!o.open){const t=a;return t?d.createPortal(s.jsx(vr,{scope:e.__scopeSelect,children:s.jsx(er.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),t):null}return s.jsx(jr,{...e,ref:r})});gr.displayName=xr;var yr=10,[vr,wr]=rr(xr),br=qn("SelectContent.RemoveScroll"),jr=t.forwardRef((e,n)=>{const{__scopeSelect:o,position:a="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,side:u,sideOffset:f,align:p,alignOffset:h,arrowPadding:w,collisionBoundary:b,collisionPadding:j,sticky:N,hideWhenDetached:S,avoidCollisions:C,...k}=e,R=ar(xr,o),[P,A]=t.useState(null),[D,T]=t.useState(null),E=r(n,e=>A(e)),[O,_]=t.useState(null),[L,I]=t.useState(null),M=tr(o),[H,W]=t.useState(!1),z=t.useRef(!1);t.useEffect(()=>{if(P)return m(P)},[P]),x();const B=t.useCallback(e=>{const[t,...n]=M().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(const s of e){if(s===o)return;if(null==s||s.scrollIntoView({block:"nearest"}),s===t&&D&&(D.scrollTop=0),s===r&&D&&(D.scrollTop=D.scrollHeight),null==s||s.focus(),document.activeElement!==o)return}},[M,D]),V=t.useCallback(()=>B([O,P]),[B,O,P]);t.useEffect(()=>{H&&V()},[H,V]);const{onOpenChange:F,triggerPointerDownPosRef:$}=R;t.useEffect(()=>{if(P){let e={x:0,y:0};const t=t=>{var n,r;e={x:Math.abs(Math.round(t.pageX)-((null==(n=$.current)?void 0:n.x)??0)),y:Math.abs(Math.round(t.pageY)-((null==(r=$.current)?void 0:r.y)??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():P.contains(n.target)||F(!1),document.removeEventListener("pointermove",t),$.current=null};return null!==$.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[P,F,$]),t.useEffect(()=>{const e=()=>F(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[F]);const[K,q]=Zr(e=>{const t=M().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=Qr(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),U=t.useCallback((e,t,n)=>{const r=!z.current&&!n;(void 0!==R.value&&R.value===t||r)&&(_(e),r&&(z.current=!0))},[R.value]),X=t.useCallback(()=>null==P?void 0:P.focus(),[P]),Y=t.useCallback((e,t,n)=>{const r=!z.current&&!n;(void 0!==R.value&&R.value===t||r)&&I(e)},[R.value]),G="popper"===a?Sr:Nr,Z=G===Sr?{side:u,sideOffset:f,align:p,alignOffset:h,arrowPadding:w,collisionBoundary:b,collisionPadding:j,sticky:N,hideWhenDetached:S,avoidCollisions:C}:{};return s.jsx(vr,{scope:o,content:P,viewport:D,onViewportChange:T,itemRefCallback:U,selectedItem:O,onItemLeave:X,itemTextRefCallback:Y,focusSelectedItem:V,selectedItemText:L,position:a,isPositioned:H,searchRef:K,children:s.jsx(g,{as:br,allowPinchZoom:!0,children:s.jsx(y,{asChild:!0,trapped:R.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:i(l,e=>{var t;null==(t=R.trigger)||t.focus({preventScroll:!0}),e.preventDefault()}),children:s.jsx(v,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:s.jsx(G,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:e=>e.preventDefault(),...k,...Z,onPlaced:()=>W(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:i(k.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||q(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=M().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>B(t)),e.preventDefault()}})})})})})})});jr.displayName="SelectContentImpl";var Nr=t.forwardRef((e,o)=>{const{__scopeSelect:i,onPlaced:l,...c}=e,d=ar(xr,i),u=wr(xr,i),[f,p]=t.useState(null),[h,m]=t.useState(null),x=r(o,e=>m(e)),g=tr(i),y=t.useRef(!1),v=t.useRef(!0),{viewport:w,selectedItem:b,selectedItemText:j,focusSelectedItem:N}=u,S=t.useCallback(()=>{if(d.trigger&&d.valueNode&&f&&h&&w&&b&&j){const e=d.trigger.getBoundingClientRect(),t=h.getBoundingClientRect(),n=d.valueNode.getBoundingClientRect(),r=j.getBoundingClientRect();if("rtl"!==d.dir){const o=r.left-t.left,s=n.left-o,a=e.left-s,i=e.width+a,l=Math.max(i,t.width),c=window.innerWidth-yr,d=ce(s,[yr,Math.max(yr,c-l)]);f.style.minWidth=i+"px",f.style.left=d+"px"}else{const o=t.right-r.right,s=window.innerWidth-n.right-o,a=window.innerWidth-e.right-s,i=e.width+a,l=Math.max(i,t.width),c=window.innerWidth-yr,d=ce(s,[yr,Math.max(yr,c-l)]);f.style.minWidth=i+"px",f.style.right=d+"px"}const o=g(),s=window.innerHeight-2*yr,a=w.scrollHeight,i=window.getComputedStyle(h),c=parseInt(i.borderTopWidth,10),u=parseInt(i.paddingTop,10),p=parseInt(i.borderBottomWidth,10),m=c+u+a+parseInt(i.paddingBottom,10)+p,x=Math.min(5*b.offsetHeight,m),v=window.getComputedStyle(w),N=parseInt(v.paddingTop,10),S=parseInt(v.paddingBottom,10),C=e.top+e.height/2-yr,k=s-C,R=b.offsetHeight/2,P=c+u+(b.offsetTop+R),A=m-P;if(P<=C){const e=o.length>0&&b===o[o.length-1].ref.current;f.style.bottom="0px";const t=h.clientHeight-w.offsetTop-w.offsetHeight,n=P+Math.max(k,R+(e?S:0)+t+p);f.style.height=n+"px"}else{const e=o.length>0&&b===o[0].ref.current;f.style.top="0px";const t=Math.max(C,c+w.offsetTop+(e?N:0)+R)+A;f.style.height=t+"px",w.scrollTop=P-C+w.offsetTop}f.style.margin=`${yr}px 0`,f.style.minHeight=x+"px",f.style.maxHeight=s+"px",null==l||l(),requestAnimationFrame(()=>y.current=!0)}},[g,d.trigger,d.valueNode,f,h,w,b,j,d.dir,l]);n(()=>S(),[S]);const[C,k]=t.useState();n(()=>{h&&k(window.getComputedStyle(h).zIndex)},[h]);const R=t.useCallback(e=>{e&&!0===v.current&&(S(),null==N||N(),v.current=!1)},[S,N]);return s.jsx(Cr,{scope:i,contentWrapper:f,shouldExpandOnScrollRef:y,onScrollButtonChange:R,children:s.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:s.jsx(a.div,{...c,ref:x,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});Nr.displayName="SelectItemAlignedPosition";var Sr=t.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=yr,...a}=e,i=or(n);return s.jsx($n,{...i,...a,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Sr.displayName="SelectPopperPosition";var[Cr,kr]=rr(xr,{}),Rr="SelectViewport",Pr=t.forwardRef((e,n)=>{const{__scopeSelect:o,nonce:l,...c}=e,d=wr(Rr,o),u=kr(Rr,o),f=r(n,d.onViewportChange),p=t.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),s.jsx(er.Slot,{scope:o,children:s.jsx(a.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:i(c.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=u;if((null==r?void 0:r.current)&&n){const e=Math.abs(p.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*yr,o=parseFloat(n.style.minHeight),s=parseFloat(n.style.height),a=Math.max(o,s);if(a<r){const o=a+e,s=Math.min(r,o),i=o-s;n.style.height=s+"px","0px"===n.style.bottom&&(t.scrollTop=i>0?i:0,n.style.justifyContent="flex-end")}}}p.current=t.scrollTop})})})]})});Pr.displayName=Rr;var Ar="SelectGroup",[Dr,Tr]=rr(Ar);t.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=p();return s.jsx(Dr,{scope:n,id:o,children:s.jsx(a.div,{role:"group","aria-labelledby":o,...r,ref:t})})}).displayName=Ar;var Er="SelectLabel",Or=t.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Tr(Er,n);return s.jsx(a.div,{id:o.id,...r,ref:t})});Or.displayName=Er;var _r="SelectItem",[Lr,Ir]=rr(_r),Mr=t.forwardRef((e,n)=>{const{__scopeSelect:o,value:l,disabled:c=!1,textValue:d,...u}=e,f=ar(_r,o),h=wr(_r,o),m=f.value===l,[x,g]=t.useState(d??""),[y,v]=t.useState(!1),w=r(n,e=>{var t;return null==(t=h.itemRefCallback)?void 0:t.call(h,e,l,c)}),b=p(),j=t.useRef("touch"),N=()=>{c||(f.onValueChange(l),f.onOpenChange(!1))};if(""===l)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(Lr,{scope:o,value:l,disabled:c,textId:b,isSelected:m,onItemTextChange:t.useCallback(e=>{g(t=>t||((null==e?void 0:e.textContent)??"").trim())},[]),children:s.jsx(er.ItemSlot,{scope:o,value:l,disabled:c,textValue:x,children:s.jsx(a.div,{role:"option","aria-labelledby":b,"data-highlighted":y?"":void 0,"aria-selected":m&&y,"data-state":m?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...u,ref:w,onFocus:i(u.onFocus,()=>v(!0)),onBlur:i(u.onBlur,()=>v(!1)),onClick:i(u.onClick,()=>{"mouse"!==j.current&&N()}),onPointerUp:i(u.onPointerUp,()=>{"mouse"===j.current&&N()}),onPointerDown:i(u.onPointerDown,e=>{j.current=e.pointerType}),onPointerMove:i(u.onPointerMove,e=>{var t;j.current=e.pointerType,c?null==(t=h.onItemLeave)||t.call(h):"mouse"===j.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:i(u.onPointerLeave,e=>{var t;e.currentTarget===document.activeElement&&(null==(t=h.onItemLeave)||t.call(h))}),onKeyDown:i(u.onKeyDown,e=>{var t;""!==(null==(t=h.searchRef)?void 0:t.current)&&" "===e.key||(Qn.includes(e.key)&&N()," "===e.key&&e.preventDefault())})})})})});Mr.displayName=_r;var Hr="SelectItemText",Wr=t.forwardRef((e,o)=>{const{__scopeSelect:i,className:l,style:c,...u}=e,f=ar(Hr,i),p=wr(Hr,i),h=Ir(Hr,i),m=lr(Hr,i),[x,g]=t.useState(null),y=r(o,e=>g(e),h.onItemTextChange,e=>{var t;return null==(t=p.itemTextRefCallback)?void 0:t.call(p,e,h.value,h.disabled)}),v=null==x?void 0:x.textContent,w=t.useMemo(()=>s.jsx("option",{value:h.value,disabled:h.disabled,children:v},h.value),[h.disabled,h.value,v]),{onNativeOptionAdd:b,onNativeOptionRemove:j}=m;return n(()=>(b(w),()=>j(w)),[b,j,w]),s.jsxs(s.Fragment,{children:[s.jsx(a.span,{id:h.textId,...u,ref:y}),h.isSelected&&f.valueNode&&!f.valueNodeHasChildren?d.createPortal(u.children,f.valueNode):null]})});Wr.displayName=Hr;var zr="SelectItemIndicator",Br=t.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Ir(zr,n).isSelected?s.jsx(a.span,{"aria-hidden":!0,...r,ref:t}):null});Br.displayName=zr;var Vr="SelectScrollUpButton",Fr=t.forwardRef((e,o)=>{const a=wr(Vr,e.__scopeSelect),i=kr(Vr,e.__scopeSelect),[l,c]=t.useState(!1),d=r(o,i.onScrollButtonChange);return n(()=>{if(a.viewport&&a.isPositioned){let e=function(){const e=t.scrollTop>0;c(e)};const t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),l?s.jsx(qr,{...e,ref:d,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Fr.displayName=Vr;var $r="SelectScrollDownButton",Kr=t.forwardRef((e,o)=>{const a=wr($r,e.__scopeSelect),i=kr($r,e.__scopeSelect),[l,c]=t.useState(!1),d=r(o,i.onScrollButtonChange);return n(()=>{if(a.viewport&&a.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;c(n)};const t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),l?s.jsx(qr,{...e,ref:d,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Kr.displayName=$r;var qr=t.forwardRef((e,r)=>{const{__scopeSelect:o,onAutoScroll:l,...c}=e,d=wr("SelectScrollButton",o),u=t.useRef(null),f=tr(o),p=t.useCallback(()=>{null!==u.current&&(window.clearInterval(u.current),u.current=null)},[]);return t.useEffect(()=>()=>p(),[p]),n(()=>{var e;const t=f().find(e=>e.ref.current===document.activeElement);null==(e=null==t?void 0:t.ref.current)||e.scrollIntoView({block:"nearest"})},[f]),s.jsx(a.div,{"aria-hidden":!0,...c,ref:r,style:{flexShrink:0,...c.style},onPointerDown:i(c.onPointerDown,()=>{null===u.current&&(u.current=window.setInterval(l,50))}),onPointerMove:i(c.onPointerMove,()=>{var e;null==(e=d.onItemLeave)||e.call(d),null===u.current&&(u.current=window.setInterval(l,50))}),onPointerLeave:i(c.onPointerLeave,()=>{p()})})}),Ur=t.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(a.div,{"aria-hidden":!0,...r,ref:t})});Ur.displayName="SelectSeparator";var Xr="SelectArrow";t.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=or(n),a=ar(Xr,n),i=wr(Xr,n);return a.open&&"popper"===i.position?s.jsx(Kn,{...o,...r,ref:t}):null}).displayName=Xr;var Yr=t.forwardRef(({__scopeSelect:e,value:n,...o},i)=>{const l=t.useRef(null),c=r(i,l),d=ke(n);return t.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(d!==n&&r){const t=new Event("change",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}},[d,n]),s.jsx(a.select,{...o,style:{...Gn,...o.style},ref:c,defaultValue:n})});function Gr(e){return""===e||void 0===e}function Zr(e){const n=u(e),r=t.useRef(""),o=t.useRef(0),s=t.useCallback(e=>{const t=r.current+e;n(t),function e(t){r.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(t)},[n]),a=t.useCallback(()=>{r.current="",window.clearTimeout(o.current)},[]);return t.useEffect(()=>()=>window.clearTimeout(o.current),[]),[r,s,a]}function Qr(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=(a=e,i=Math.max(o,0),a.map((e,t)=>a[(i+t)%a.length]));var a,i;1===r.length&&(s=s.filter(e=>e!==n));const l=s.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}Yr.displayName="SelectBubbleInput";var Jr=ur,eo=hr,to=mr,no=gr,ro=Pr,oo=Or,so=Mr,ao=Wr,io=Br,lo=Fr,co=Kr,uo=Ur;const fo=cr,po=pr,ho=t.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(Jr,{ref:r,className:c("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,s.jsx(eo,{asChild:!0,children:s.jsx(me,{className:"h-4 w-4 opacity-50"})})]}));ho.displayName=Jr.displayName;const mo=t.forwardRef(({className:e,...t},n)=>s.jsx(lo,{ref:n,className:c("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(xe,{className:"h-4 w-4"})}));mo.displayName=lo.displayName;const xo=t.forwardRef(({className:e,...t},n)=>s.jsx(co,{ref:n,className:c("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(me,{className:"h-4 w-4"})}));xo.displayName=co.displayName;const go=t.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>s.jsx(to,{children:s.jsxs(no,{ref:o,className:c("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[s.jsx(mo,{}),s.jsx(ro,{className:c("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(xo,{})]})}));go.displayName=no.displayName;t.forwardRef(({className:e,...t},n)=>s.jsx(oo,{ref:n,className:c("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t})).displayName=oo.displayName;const yo=t.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(so,{ref:r,className:c("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(io,{children:s.jsx(w,{className:"h-4 w-4"})})}),s.jsx(ao,{children:t})]}));yo.displayName=so.displayName;t.forwardRef(({className:e,...t},n)=>s.jsx(uo,{ref:n,className:c("-mx-1 my-1 h-px bg-muted",e),...t})).displayName=uo.displayName;const vo={"google-drive":"Google Drive",onedrive:"OneDrive",dropbox:"Dropbox"};function wo({open:e,onOpenChange:n,onAdded:r}){const[o,a]=t.useState([]),[i,l]=t.useState(!1),[c,d]=t.useState(null),[u,f]=t.useState(""),[p,h]=t.useState(""),[m,x]=t.useState(""),[g,y]=t.useState(""),[v,w]=t.useState(!1),[O,_]=t.useState(null);t.useEffect(()=>{e&&b().then(e=>a(e.available)).catch(()=>a([]))},[e]);const L=()=>{l(!1),d(null),f(""),h(""),x(""),y(""),w(!1),_(null)},I=o.length>0;return s.jsx(j,{open:e,onOpenChange:e=>{n(e),e||L()},children:s.jsxs(N,{className:"sm:max-w-md",children:[s.jsxs(S,{children:[s.jsxs(C,{className:"flex items-center gap-2",children:[s.jsx(je,{className:"h-5 w-5"}),"添加云盘账号"]}),s.jsx(k,{children:i?"手动填写 OAuth 凭据连接云盘":"选择云盘类型,点击后跳转登录授权"})]}),i?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-4 py-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(P,{children:"云盘类型"}),s.jsxs(fo,{value:u,onValueChange:f,children:[s.jsx(ho,{children:s.jsx(po,{placeholder:"选择云盘类型"})}),s.jsxs(go,{children:[s.jsx(yo,{value:"google-drive",children:"Google Drive"}),s.jsx(yo,{value:"onedrive",children:"OneDrive"}),s.jsx(yo,{value:"dropbox",children:"Dropbox"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(P,{children:"显示名称"}),s.jsx(A,{placeholder:"例如:我的 Google Drive",value:p,onChange:e=>h(e.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(P,{children:"Client ID"}),s.jsx(A,{placeholder:"OAuth Client ID",value:m,onChange:e=>x(e.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(P,{children:"Client Secret"}),s.jsx(A,{type:"password",placeholder:"OAuth Client Secret",value:g,onChange:e=>y(e.target.value)})]}),O&&s.jsx("p",{className:"text-sm text-destructive",children:O})]}),s.jsxs(D,{children:[s.jsx(R,{variant:"outline",onClick:()=>{l(!1),_(null)},children:"返回"}),s.jsx(R,{onClick:async()=>{if(u&&p&&m&&g){w(!0),_(null);try{const{id:e}=await T({type:u,label:p,clientId:m,clientSecret:g}),{url:t}=await E(e);window.open(t,"_blank"),L(),n(!1),r()}catch(e){_(e instanceof Error?e.message:"添加失败")}finally{w(!1)}}else _("请填写所有字段")},disabled:v,children:v?"添加中...":"添加并授权"})]})]}):s.jsxs("div",{className:"space-y-3 py-2",children:[I?s.jsx(s.Fragment,{children:o.map(e=>s.jsx(R,{variant:"outline",className:"w-full justify-start gap-3 h-12 text-base",onClick:()=>{(async e=>{d(e),_(null);try{const{id:t}=await T({type:e,label:vo[e]||e}),{url:o}=await E(t);window.open(o,"_blank"),L(),n(!1),r()}catch(t){_(t instanceof Error?t.message:"添加失败"),d(null)}})(e)},disabled:null!==c,children:c===e?"连接中...":`连接 ${vo[e]||e}`},e))}):s.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"暂无内置 OAuth 凭据,请使用手动模式添加"}),O&&s.jsx("p",{className:"text-sm text-destructive",children:O}),s.jsx("div",{className:"pt-2 border-t border-border",children:s.jsxs("button",{onClick:()=>{l(!0),_(null)},className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(Se,{className:"h-3.5 w-3.5"}),"手动填写 OAuth 凭据"]})})]})]})})}const bo={"google-drive":"Google Drive",onedrive:"OneDrive",dropbox:"Dropbox"};function jo({type:e}){switch(e){case"google-drive":return s.jsx(Ne,{className:"h-5 w-5 text-blue-500"});case"onedrive":return s.jsx(je,{className:"h-5 w-5 text-sky-500"});case"dropbox":return s.jsx(Ne,{className:"h-5 w-5 text-indigo-500"});default:return s.jsx(je,{className:"h-5 w-5"})}}function No({provider:e,onDelete:n,onReauth:r}){var o;const[a,i]=t.useState(!1),l=t.useRef(null);t.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]);return s.jsxs(O,{children:[s.jsx(_,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(jo,{type:e.type}),s.jsxs("div",{children:[s.jsx(L,{className:"text-base",children:e.label}),s.jsx("p",{className:"text-sm text-muted-foreground",children:bo[e.type]||e.type})]})]}),s.jsx(I,{variant:e.authorized?"default":"destructive",className:e.authorized?"bg-green-600 hover:bg-green-700":"",children:e.authorized?"已授权":"未授权"})]})}),s.jsxs(M,{children:[e.authorized&&(null==(o=e.tokens)?void 0:o.expiry)&&s.jsxs("p",{className:"text-xs text-muted-foreground mb-3",children:["授权到期:",new Date(e.tokens.expiry).toLocaleDateString("zh-CN")]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(R,{variant:"outline",size:"sm",onClick:()=>r(e.id),children:[s.jsx(H,{className:"h-3.5 w-3.5 mr-1"}),"重新授权"]}),s.jsxs(R,{variant:a?"destructive":"outline",size:"sm",onClick:()=>{a?(n(e.id),i(!1)):(i(!0),l.current=setTimeout(()=>i(!1),3e3))},children:[s.jsx(W,{className:"h-3.5 w-3.5 mr-1"}),a?"确认删除?":"删除"]})]})]})]})}const So={success:{label:"成功",icon:we,className:"bg-green-600 hover:bg-green-700"},failed:{label:"失败",icon:Ce,className:"bg-red-600 hover:bg-red-700"},partial:{label:"部分完成",icon:ye,className:"bg-yellow-600 hover:bg-yellow-700"}};function Co(e,t){const n=new Date(t).getTime()-new Date(e).getTime();if(n<1e3)return`${n}ms`;const r=Math.floor(n/1e3);if(r<60)return`${r}秒`;return`${Math.floor(r/60)}分${r%60}秒`}function ko({history:e}){const t=e.slice(0,20);return 0===t.length?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[s.jsx(be,{className:"h-10 w-10 mb-3 opacity-50"}),s.jsx("p",{className:"text-sm",children:"暂无备份记录"})]}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b",children:[s.jsx("th",{className:"text-left py-3 px-2 font-medium text-muted-foreground",children:"时间"}),s.jsx("th",{className:"text-left py-3 px-2 font-medium text-muted-foreground",children:"项目"}),s.jsx("th",{className:"text-left py-3 px-2 font-medium text-muted-foreground",children:"云盘"}),s.jsx("th",{className:"text-left py-3 px-2 font-medium text-muted-foreground",children:"状态"}),s.jsx("th",{className:"text-left py-3 px-2 font-medium text-muted-foreground",children:"文件数"}),s.jsx("th",{className:"text-left py-3 px-2 font-medium text-muted-foreground",children:"耗时"})]})}),s.jsx("tbody",{children:t.map(e=>{const t=So[e.status],n=t.icon;return s.jsxs("tr",{className:"border-b last:border-0 hover:bg-muted/50",children:[s.jsx("td",{className:"py-2.5 px-2 whitespace-nowrap",children:(r=e.startTime,new Date(r).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}))}),s.jsx("td",{className:"py-2.5 px-2",children:e.projectName}),s.jsx("td",{className:"py-2.5 px-2",children:e.providerLabel}),s.jsxs("td",{className:"py-2.5 px-2",children:[s.jsxs(I,{className:t.className,children:[s.jsx(n,{className:"h-3 w-3 mr-1"}),t.label]}),e.error&&s.jsx("p",{className:"text-xs text-destructive mt-1",children:e.error})]}),s.jsxs("td",{className:"py-2.5 px-2 whitespace-nowrap",children:[e.filesUploaded,"/",e.filesTotal]}),s.jsx("td",{className:"py-2.5 px-2 whitespace-nowrap",children:Co(e.startTime,e.endTime)})]},e.id);var r})})]})})}const Ro=["node_modules",".git","dist","build","*.log",".DS_Store","*.tmp",".venv","__pycache__",".env"],Po=[{value:"30",label:"30分钟"},{value:"60",label:"1小时"},{value:"360",label:"6小时"},{value:"720",label:"12小时"},{value:"1440",label:"24小时"}];function Ao(){const e=z(),[n,r]=t.useState([]),[o,a]=t.useState(!0),[i,l]=t.useState(!1),[c,d]=t.useState({enabled:!1,intervalMinutes:60}),[u,f]=t.useState(!0),[p,h]=t.useState([]),[m,x]=t.useState(!0),[g,y]=t.useState(""),[v,w]=t.useState(!1),[b,j]=t.useState(!1),[N,S]=t.useState([]),[C,k]=t.useState(!0),[D,T]=t.useState(()=>B()),[O,_]=t.useState(!1),[L,I]=t.useState({webhookEnabled:!1}),[M,W]=t.useState(""),[ie,le]=t.useState(!1),[ce,me]=t.useState(()=>V(F.usageMonitorTool,"claude")),xe=async()=>{try{const e=await J();r(e)}catch{}finally{a(!1)}},ye=async()=>{try{const e=await ne();S(e)}catch{}finally{k(!1)}};t.useEffect(()=>{xe(),(async()=>{try{const e=await ee();d(e)}catch{}finally{f(!1)}})(),(async()=>{try{const e=await te();h(e.length>0?e:Ro)}catch{h(Ro)}finally{x(!1)}})(),ye(),$().then(e=>{I(e),W(e.webhookUrl??"")}).catch(()=>{})},[]);const we=(e,t)=>{const n=parseInt(t,10);isNaN(n)||n<1||(T(t=>({...t,[e]:n})),_(!0))},be=async e=>{try{await re(e),r(t=>t.filter(t=>t.id!==e))}catch{}},je=async e=>{try{const{url:t}=await E(e);window.open(t,"_blank")}catch{}},Ne=()=>{const e=g.trim();e&&!p.includes(e)&&(h(t=>[...t,e]),y(""),w(!0))};return s.jsx("div",{className:"min-h-screen bg-background",children:s.jsxs("div",{className:"max-w-4xl mx-auto p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsxs(R,{variant:"ghost",size:"sm",onClick:()=>e("/"),children:[s.jsx(K,{className:"h-4 w-4 mr-1"}),"返回"]}),s.jsx("h1",{className:"text-2xl font-bold",children:"设置"})]}),s.jsxs(de,{defaultValue:"providers",children:[s.jsxs(ue,{className:"mb-4",children:[s.jsx(fe,{value:"providers",children:"云盘账号"}),s.jsx(fe,{value:"strategy",children:"备份策略"}),s.jsx(fe,{value:"history",children:"备份记录"}),s.jsxs(fe,{value:"notifications",children:[s.jsx(ve,{className:"h-3.5 w-3.5 mr-1.5"}),"通知"]}),s.jsxs(fe,{value:"pomodoro",children:[s.jsx(q,{className:"h-3.5 w-3.5 mr-1.5"}),"番茄钟"]}),s.jsxs(fe,{value:"usage",children:[s.jsx(ge,{className:"h-3.5 w-3.5 mr-1.5"}),"用量监控"]})]}),s.jsxs(pe,{value:"providers",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex justify-end",children:s.jsxs(R,{onClick:()=>l(!0),children:[s.jsx(U,{className:"h-4 w-4 mr-1"}),"添加云盘"]})}),o?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"加载中..."}):0===n.length?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-12",children:"暂无云盘账号,点击上方按钮添加"}):s.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:n.map(e=>s.jsx(No,{provider:e,onDelete:be,onReauth:je},e.id))})]}),s.jsx(wo,{open:i,onOpenChange:l,onAdded:()=>{xe()}})]}),s.jsx(pe,{value:"strategy",children:s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-medium",children:"排除规则"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"匹配这些模式的文件和目录将不会被备份"}),m?s.jsx("p",{className:"text-sm text-muted-foreground",children:"加载中..."}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex flex-wrap gap-2",children:s.jsx(X,{children:p.map(e=>s.jsxs(Y.span,{layout:!0,initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"inline-flex items-center gap-1 rounded-md bg-muted px-2.5 py-1 text-sm",children:[e,s.jsx("button",{onClick:()=>(e=>{h(t=>t.filter(t=>t!==e)),w(!0)})(e),className:"ml-0.5 rounded-sm hover:bg-muted-foreground/20 p-0.5",children:s.jsx(G,{className:"h-3 w-3"})})]},e))})}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(A,{placeholder:"输入排除模式,例如 *.log",value:g,onChange:e=>y(e.target.value),onKeyDown:e=>{"Enter"===e.key&&Ne()},className:"max-w-xs"}),s.jsx(R,{variant:"outline",size:"sm",onClick:Ne,children:"添加"})]}),v&&s.jsxs(R,{onClick:async()=>{j(!0);try{await oe(p),w(!1)}catch{}finally{j(!1)}},disabled:b,children:[s.jsx(he,{className:"h-4 w-4 mr-1"}),b?"保存中...":"保存"]})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-medium",children:"定时备份"}),u?s.jsx("p",{className:"text-sm text-muted-foreground",children:"加载中..."}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(We,{checked:c.enabled,onCheckedChange:async e=>{const t=c;d({...c,enabled:e});try{await se({enabled:e})}catch{d(t)}}}),s.jsx(P,{children:c.enabled?"已开启":"已关闭"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(P,{children:"备份间隔"}),s.jsxs(fo,{value:String(c.intervalMinutes),onValueChange:async e=>{const t=parseInt(e,10),n=c;d({...c,intervalMinutes:t});try{await se({intervalMinutes:t})}catch{d(n)}},children:[s.jsx(ho,{className:"w-48",children:s.jsx(po,{})}),s.jsx(go,{children:Po.map(e=>s.jsx(yo,{value:e.value,children:e.label},e.value))})]})]})]})]})]})}),s.jsx(pe,{value:"history",children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex justify-end",children:s.jsxs(R,{variant:"outline",size:"sm",onClick:()=>{k(!0),ye()},children:[s.jsx(H,{className:"h-4 w-4 mr-1"}),"刷新"]})}),C?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"加载中..."}):s.jsx(ko,{history:N})]})}),s.jsx(pe,{value:"notifications",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[s.jsx("h3",{className:"text-sm font-medium",children:"浏览器通知"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"当 Claude 完成任务时,浏览器将自动弹出通知。首次打开 Dashboard 时会请求通知权限。"})]}),s.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-3",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium",children:"Webhook 通知"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Claude 完成任务时向指定 URL 发送 POST 请求(JSON: event, projectId, projectName, timestamp)"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(P,{className:"text-xs",children:"Webhook URL"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(A,{placeholder:"https://hooks.slack.com/...",value:M,onChange:e=>W(e.target.value),className:"font-mono text-xs"}),s.jsx(R,{size:"sm",onClick:()=>{(async()=>{le(!0);try{const e=await ae({webhookEnabled:M.trim().length>0,webhookUrl:M.trim()||void 0});I(e),Q.success("Webhook 配置已保存")}catch{Q.error("保存失败")}finally{le(!1)}})()},disabled:ie,children:ie?"保存中…":"保存"})]}),L.webhookEnabled&&L.webhookUrl&&s.jsxs("p",{className:"text-xs text-green-500",children:["已启用 → ",L.webhookUrl]})]})]})]})}),s.jsx(pe,{value:"pomodoro",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium",children:"番茄钟时间设置"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"修改后重新启动番茄钟生效"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-6 max-w-xs",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(P,{className:"text-xs",children:"工作时长(分钟)"}),s.jsx(A,{type:"number",min:1,max:120,value:D.workMinutes,onChange:e=>we("workMinutes",e.target.value),className:"w-full"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(P,{className:"text-xs",children:"休息时长(分钟)"}),s.jsx(A,{type:"number",min:1,max:60,value:D.breakMinutes,onChange:e=>we("breakMinutes",e.target.value),className:"w-full"})]})]}),O&&s.jsxs(R,{size:"sm",onClick:()=>{Z(F.pomodoroConfig,D,!0),_(!1),Q.success("番茄钟设置已保存")},children:[s.jsx(he,{className:"h-3.5 w-3.5 mr-1.5"}),"保存"]})]}),s.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[s.jsx("h3",{className:"text-sm font-medium",children:"使用说明"}),s.jsxs("ul",{className:"text-xs text-muted-foreground space-y-1 list-disc list-inside",children:[s.jsxs("li",{children:["在项目页面 Header 点击 ",s.jsx(q,{className:"h-3 w-3 inline-block mx-0.5"})," 图标启动番茄钟"]}),s.jsx("li",{children:"倒计时以大字体悬浮在屏幕上,不影响操作"}),s.jsx("li",{children:"工作阶段结束后自动切换为休息,并弹出通知"}),s.jsx("li",{children:"休息结束后自动切换回工作阶段"}),s.jsx("li",{children:"再次点击图标可停止并重置"})]})]})]})}),s.jsx(pe,{value:"usage",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium",children:"监控工具"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"选择要监控用量的 CLI 工具,首页和项目页会显示对应的实时用量"})]}),s.jsx("div",{className:"grid gap-3 max-w-md",children:[{key:"claude",label:"Claude Code",desc:"Anthropic API — 5h/7d 用量窗口"},{key:"codex",label:"Codex",desc:"OpenAI — 用量查询暂未实现"},{key:"opencode",label:"OpenCode",desc:"OpenCode — 用量查询暂未实现"},{key:"qwen",label:"Qwen Code",desc:"Qwen — 用量查询暂未实现"},{key:"gemini",label:"Gemini CLI",desc:"Google — 用量查询暂未实现"}].map(e=>s.jsxs("label",{className:"flex items-start gap-3 rounded-lg border p-3 cursor-pointer transition-colors "+(ce===e.key?"border-blue-500/50 bg-blue-500/5":"border-border hover:bg-muted/30"),children:[s.jsx("input",{type:"radio",name:"usageTool",value:e.key,checked:ce===e.key,onChange:()=>{me(e.key),Z(F.usageMonitorTool,e.key),window.dispatchEvent(new Event("ccweb:usage-tool-change")),Q.success(`用量监控已切换为 ${e.label}`)},className:"mt-0.5"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium",children:e.label}),s.jsx("div",{className:"text-xs text-muted-foreground",children:e.desc})]})]},e.key))})]}),s.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[s.jsx("h3",{className:"text-sm font-medium",children:"说明"}),s.jsxs("ul",{className:"text-xs text-muted-foreground space-y-1 list-disc list-inside",children:[s.jsx("li",{children:"用量数据显示在首页 Header 和项目页底部状态栏"}),s.jsx("li",{children:"Claude Code 通过 OAuth API 实时查询,每 5 分钟自动刷新"}),s.jsx("li",{children:"其他工具的用量查询将在后续版本中支持"}),s.jsx("li",{children:"切换后无需刷新页面,用量会自动更新"})]})]})]})})]})]})})}export{Ao as SettingsPage};
@@ -1,4 +1,4 @@
1
- import{c as e,ag as s,r as t,b7 as a,b8 as r,t as l,b9 as n,ba as i,bb as d,j as c,B as o,ah as m,d as x,I as u,T as h,x as p,D as g,Q as f,A as j,bc as b}from"./index-A-o6g_qw.js";import{S as N}from"./search-9lLW2Oo_.js";import{C as y}from"./chevron-down-HPq7YAwV.js";
1
+ import{c as e,ag as s,r as t,b7 as a,b8 as r,t as l,b9 as n,ba as i,bb as d,j as c,B as o,ah as m,d as x,I as u,T as h,x as p,D as g,U as f,A as j,bc as b}from"./index-Dn-YLcfD.js";import{S as N}from"./search-Dq8YTmIg.js";import{C as y}from"./chevron-down-9-G7S6iK.js";
2
2
  /**
3
3
  * @license lucide-react v0.309.0 - ISC
4
4
  *
@@ -10,4 +10,4 @@ import{c as e,ag as s,r as t,b7 as a,b8 as r,t as l,b9 as n,ba as i,bb as d,j as
10
10
  *
11
11
  * This source code is licensed under the ISC license.
12
12
  * See the LICENSE file in the root directory of this source tree.
13
- */function S(){const e=s(),[S,_]=t.useState("skills"),[E,M]=t.useState([]),[z,L]=t.useState([]),[A,H]=t.useState(!1),[I,P]=t.useState(null);t.useEffect(()=>{"plugins"===S&&(H(!0),Promise.all([a().catch(()=>[]),fetch("/api/skillhub/plugins").then(e=>e.ok?e.json():[]).catch(()=>[])]).then(([e,s])=>{M(e),L(s)}).finally(()=>H(!1)))},[S]);const F=t.useCallback(async e=>{if(!I){P(e.id);try{await r(e.downloadUrl),l.success(`已安装 ${e.name}`);const s=await a().catch(()=>[]);M(s)}catch(s){l.error(s instanceof Error?s.message:"安装失败")}finally{P(null)}}},[I]),D=t.useCallback(async e=>{try{await n(e),M(s=>s.filter(s=>s.id!==e)),l.success("已卸载")}catch(s){l.error(s instanceof Error?s.message:"卸载失败")}},[]),O=t.useCallback(async(e,s)=>{try{await i(e,s),M(t=>t.map(t=>t.id===e?{...t,enabled:s}:t))}catch(t){l.error(t instanceof Error?t.message:"操作失败")}},[]),[T,U]=t.useState([]),[Z,$]=t.useState(!0),[B,Q]=t.useState(null),[q,G]=t.useState(""),[J,K]=t.useState(null),[R,V]=t.useState(null),[W,X]=t.useState(null),[Y,ee]=t.useState(new Set);t.useEffect(()=>{d().then(U).catch(e=>Q(e instanceof Error?e.message:"Failed to load SkillHub")).finally(()=>$(!1))},[]);const se=t.useMemo(()=>{const e=new Set;return T.forEach(s=>{var t;return null==(t=s.tags)?void 0:t.forEach(s=>e.add(s))}),Array.from(e).sort()},[T]),te=t.useMemo(()=>T.some(e=>!e.tags||0===e.tags.length),[T]),ae=t.useMemo(()=>{let e=T;if("__untagged__"===J?e=e.filter(e=>!e.tags||0===e.tags.length):J&&(e=e.filter(e=>{var s;return null==(s=e.tags)?void 0:s.includes(J)})),q.trim()){const s=q.toLowerCase();e=e.filter(e=>{var t;return e.label.toLowerCase().includes(s)||e.description.toLowerCase().includes(s)||e.command.toLowerCase().includes(s)||e.author.toLowerCase().includes(s)||(null==(t=e.tags)?void 0:t.some(e=>e.toLowerCase().includes(s)))})}return e},[T,q,J]);return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("header",{className:"border-b sticky top-0 bg-background z-10",children:c.jsxs("div",{className:"max-w-4xl mx-auto px-4 h-14 flex items-center gap-4",children:[c.jsxs(o,{variant:"ghost",size:"sm",onClick:()=>e("/"),children:[c.jsx(m,{className:"h-4 w-4 mr-1"}),"返回"]}),c.jsx("h1",{className:"font-semibold text-lg",children:"SkillHub"}),c.jsxs("div",{className:"flex items-center gap-1 ml-4",children:[c.jsx("button",{onClick:()=>_("skills"),className:x("px-3 py-1 rounded-md text-sm transition-colors","skills"===S?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent"),children:"技能"}),c.jsxs("button",{onClick:()=>_("plugins"),className:x("px-3 py-1 rounded-md text-sm transition-colors flex items-center gap-1","plugins"===S?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent"),children:[c.jsx(w,{className:"h-3.5 w-3.5"}),"插件"]})]}),c.jsx("div",{className:"flex-1"}),c.jsxs("div",{className:"relative w-64",children:[c.jsx(N,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),c.jsx(u,{placeholder:"搜索命令...",value:q,onChange:e=>G(e.target.value),className:"pl-8 h-9"})]})]})}),c.jsxs("main",{className:"max-w-4xl mx-auto px-4 py-6",children:["plugins"===S&&c.jsxs("div",{children:[A&&c.jsx("div",{className:"text-center text-muted-foreground py-20",children:"加载中..."}),!A&&c.jsxs(c.Fragment,{children:[E.length>0&&c.jsxs("div",{className:"mb-8",children:[c.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-3",children:"已安装"}),c.jsx("div",{className:"space-y-2",children:E.map(e=>c.jsxs("div",{className:"rounded-lg border bg-card p-4 flex items-center gap-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium text-sm",children:e.name}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",e.version]}),c.jsx("span",{className:x("text-xs px-1.5 py-0.5 rounded",e.enabled?"bg-green-500/10 text-green-500":"bg-muted text-muted-foreground"),children:e.enabled?"启用":"禁用"})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:e.description}),e.permissions.length>0&&c.jsx("div",{className:"flex gap-1 mt-1 flex-wrap",children:e.permissions.map(e=>c.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400",children:e},e))})]}),c.jsx(o,{size:"sm",variant:"ghost",onClick:()=>O(e.id,!e.enabled),title:e.enabled?"禁用":"启用",children:c.jsx(v,{className:x("h-4 w-4",e.enabled?"text-green-500":"text-muted-foreground")})}),c.jsx(o,{size:"sm",variant:"ghost",onClick:()=>D(e.id),title:"卸载",children:c.jsx(h,{className:"h-4 w-4 text-red-400"})})]},e.id))})]}),c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-3",children:E.length>0?"更多插件":"可用插件"}),0===z.length&&c.jsxs("div",{className:"text-center text-muted-foreground py-20",children:[c.jsx(w,{className:"h-10 w-10 mx-auto mb-3 opacity-30"}),c.jsx("p",{className:"text-sm",children:"插件中心暂无可用插件"})]}),c.jsx("div",{className:"space-y-2",children:z.filter(e=>!E.some(s=>s.id===e.id)).map((e,s)=>{const t=I===e.id;return c.jsxs(p.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.25,delay:.03*s},className:"rounded-lg border bg-card p-4 flex items-center gap-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium text-sm",children:e.name}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",e.version]}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:["by ",e.author]})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.description}),e.permissions.length>0&&c.jsx("div",{className:"flex gap-1 mt-1 flex-wrap",children:e.permissions.map(e=>c.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400",children:e},e))})]}),c.jsxs(o,{size:"sm",disabled:t,onClick:()=>F(e),children:[c.jsx(g,{className:"h-3.5 w-3.5 mr-1"}),t?"安装中...":"安装"]})]},e.id)})})]})]})]}),"skills"===S&&c.jsxs(c.Fragment,{children:[se.length>0&&c.jsxs("div",{className:"flex flex-wrap gap-2 mb-6",children:[c.jsx("button",{className:x("px-3 py-1 rounded-full text-xs font-medium transition-colors",null===J?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"),onClick:()=>K(null),children:"全部"}),se.map(e=>c.jsx("button",{className:x("px-3 py-1 rounded-full text-xs font-medium transition-colors",J===e?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"),onClick:()=>K(J===e?null:e),children:e},e)),te&&c.jsx("button",{className:x("px-3 py-1 rounded-full text-xs font-medium transition-colors","__untagged__"===J?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"),onClick:()=>K("__untagged__"===J?null:"__untagged__"),children:"无标签"})]}),Z&&c.jsx("div",{className:"text-center text-muted-foreground py-20",children:"加载中..."}),B&&c.jsx("div",{className:"text-center text-destructive py-20",children:B}),!Z&&!B&&0===T.length&&c.jsxs("div",{className:"text-center text-muted-foreground py-20",children:[c.jsx("p",{className:"text-lg mb-2",children:"SkillHub 还没有命令"}),c.jsx("p",{className:"text-sm",children:"在快捷命令面板中点击分享按钮来提交第一个命令吧!"})]}),!Z&&!B&&T.length>0&&0===ae.length&&c.jsx("div",{className:"text-center text-muted-foreground py-20",children:"没有匹配的命令"}),c.jsx("div",{className:"space-y-3",children:ae.map((e,s)=>{var t;const a=R===e.id,r=Y.has(e.id),n=W===e.id,i=e.parentId?T.find(s=>s.id===e.parentId):void 0;return c.jsxs(p.div,{layout:!0,initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.25,delay:.03*s,ease:"easeOut"},className:"rounded-lg border bg-card p-4 cursor-pointer hover:border-muted-foreground/30 transition-colors",onClick:()=>V(a?null:e.id),children:[c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h3",{className:"font-medium text-sm truncate",children:e.label}),null==(t=e.tags)?void 0:t.map(e=>c.jsxs("span",{className:"inline-flex items-center gap-0.5 px-2 py-0.5 rounded-full text-xs bg-muted text-muted-foreground",children:[c.jsx(k,{className:"h-2.5 w-2.5"}),e]},e))]}),i&&c.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[c.jsx(f,{className:"h-3 w-3 text-muted-foreground"}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:["继承: ",i.label]})]}),e.description&&c.jsx("p",{className:"text-xs text-muted-foreground mt-1 truncate",children:e.description}),c.jsxs("div",{className:"flex items-center gap-3 mt-2 text-xs text-muted-foreground",children:[c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(C,{className:"h-3 w-3"}),e.author]}),c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(g,{className:"h-3 w-3"}),e.downloads||0]}),c.jsx("span",{children:e.createdAt})]})]}),c.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[c.jsxs(o,{size:"sm",variant:r?"outline":"default",disabled:n||r,onClick:s=>(async(e,s)=>{if(s.stopPropagation(),!W&&!Y.has(e.id)){X(e.id);try{await b(e.id),ee(s=>new Set(s).add(e.id)),U(s=>s.map(s=>s.id===e.id?{...s,downloads:(s.downloads||0)+1}:s))}catch(t){l.error(t instanceof Error?t.message:"Download failed")}finally{X(null)}}})(e,s),title:i?`将同时下载继承的「${i.label}」`:void 0,children:[c.jsx(g,{className:"h-3.5 w-3.5 mr-1"}),r?"已下载":n?"下载中...":"下载"]}),c.jsx(p.span,{animate:{rotate:a?180:0},transition:{duration:.2},children:c.jsx(y,{className:"h-4 w-4 text-muted-foreground"})})]})]}),c.jsx(j,{children:a&&c.jsx(p.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:c.jsx("div",{className:"mt-3 pt-3 border-t",children:c.jsx("pre",{className:"text-xs font-mono bg-muted rounded p-3 whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:e.command})})})})]},e.id)})})]})]})]})}export{S as SkillHubPage};
13
+ */function S(){const e=s(),[S,_]=t.useState("skills"),[E,M]=t.useState([]),[z,L]=t.useState([]),[A,H]=t.useState(!1),[I,P]=t.useState(null);t.useEffect(()=>{"plugins"===S&&(H(!0),Promise.all([a().catch(()=>[]),fetch("/api/skillhub/plugins").then(e=>e.ok?e.json():[]).catch(()=>[])]).then(([e,s])=>{M(e),L(s)}).finally(()=>H(!1)))},[S]);const F=t.useCallback(async e=>{if(!I){P(e.id);try{await r(e.downloadUrl),l.success(`已安装 ${e.name}`);const s=await a().catch(()=>[]);M(s)}catch(s){l.error(s instanceof Error?s.message:"安装失败")}finally{P(null)}}},[I]),U=t.useCallback(async e=>{try{await n(e),M(s=>s.filter(s=>s.id!==e)),l.success("已卸载")}catch(s){l.error(s instanceof Error?s.message:"卸载失败")}},[]),D=t.useCallback(async(e,s)=>{try{await i(e,s),M(t=>t.map(t=>t.id===e?{...t,enabled:s}:t))}catch(t){l.error(t instanceof Error?t.message:"操作失败")}},[]),[O,T]=t.useState([]),[Z,$]=t.useState(!0),[B,q]=t.useState(null),[G,J]=t.useState(""),[K,Q]=t.useState(null),[R,V]=t.useState(null),[W,X]=t.useState(null),[Y,ee]=t.useState(new Set);t.useEffect(()=>{d().then(T).catch(e=>q(e instanceof Error?e.message:"Failed to load SkillHub")).finally(()=>$(!1))},[]);const se=t.useMemo(()=>{const e=new Set;return O.forEach(s=>{var t;return null==(t=s.tags)?void 0:t.forEach(s=>e.add(s))}),Array.from(e).sort()},[O]),te=t.useMemo(()=>O.some(e=>!e.tags||0===e.tags.length),[O]),ae=t.useMemo(()=>{let e=O;if("__untagged__"===K?e=e.filter(e=>!e.tags||0===e.tags.length):K&&(e=e.filter(e=>{var s;return null==(s=e.tags)?void 0:s.includes(K)})),G.trim()){const s=G.toLowerCase();e=e.filter(e=>{var t;return e.label.toLowerCase().includes(s)||e.description.toLowerCase().includes(s)||e.command.toLowerCase().includes(s)||e.author.toLowerCase().includes(s)||(null==(t=e.tags)?void 0:t.some(e=>e.toLowerCase().includes(s)))})}return e},[O,G,K]);return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("header",{className:"border-b sticky top-0 bg-background z-10",children:c.jsxs("div",{className:"max-w-4xl mx-auto px-4 h-14 flex items-center gap-4",children:[c.jsxs(o,{variant:"ghost",size:"sm",onClick:()=>e("/"),children:[c.jsx(m,{className:"h-4 w-4 mr-1"}),"返回"]}),c.jsx("h1",{className:"font-semibold text-lg",children:"SkillHub"}),c.jsxs("div",{className:"flex items-center gap-1 ml-4",children:[c.jsx("button",{onClick:()=>_("skills"),className:x("px-3 py-1 rounded-md text-sm transition-colors","skills"===S?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent"),children:"技能"}),c.jsxs("button",{onClick:()=>_("plugins"),className:x("px-3 py-1 rounded-md text-sm transition-colors flex items-center gap-1","plugins"===S?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent"),children:[c.jsx(w,{className:"h-3.5 w-3.5"}),"插件"]})]}),c.jsx("div",{className:"flex-1"}),c.jsxs("div",{className:"relative w-64",children:[c.jsx(N,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),c.jsx(u,{placeholder:"搜索命令...",value:G,onChange:e=>J(e.target.value),className:"pl-8 h-9"})]})]})}),c.jsxs("main",{className:"max-w-4xl mx-auto px-4 py-6",children:["plugins"===S&&c.jsxs("div",{children:[A&&c.jsx("div",{className:"text-center text-muted-foreground py-20",children:"加载中..."}),!A&&c.jsxs(c.Fragment,{children:[E.length>0&&c.jsxs("div",{className:"mb-8",children:[c.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-3",children:"已安装"}),c.jsx("div",{className:"space-y-2",children:E.map(e=>c.jsxs("div",{className:"rounded-lg border bg-card p-4 flex items-center gap-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium text-sm",children:e.name}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",e.version]}),c.jsx("span",{className:x("text-xs px-1.5 py-0.5 rounded",e.enabled?"bg-green-500/10 text-green-500":"bg-muted text-muted-foreground"),children:e.enabled?"启用":"禁用"})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:e.description}),e.permissions.length>0&&c.jsx("div",{className:"flex gap-1 mt-1 flex-wrap",children:e.permissions.map(e=>c.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400",children:e},e))})]}),c.jsx(o,{size:"sm",variant:"ghost",onClick:()=>D(e.id,!e.enabled),title:e.enabled?"禁用":"启用",children:c.jsx(v,{className:x("h-4 w-4",e.enabled?"text-green-500":"text-muted-foreground")})}),c.jsx(o,{size:"sm",variant:"ghost",onClick:()=>U(e.id),title:"卸载",children:c.jsx(h,{className:"h-4 w-4 text-red-400"})})]},e.id))})]}),c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-3",children:E.length>0?"更多插件":"可用插件"}),0===z.length&&c.jsxs("div",{className:"text-center text-muted-foreground py-20",children:[c.jsx(w,{className:"h-10 w-10 mx-auto mb-3 opacity-30"}),c.jsx("p",{className:"text-sm",children:"插件中心暂无可用插件"})]}),c.jsx("div",{className:"space-y-2",children:z.filter(e=>!E.some(s=>s.id===e.id)).map((e,s)=>{const t=I===e.id;return c.jsxs(p.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.25,delay:.03*s},className:"rounded-lg border bg-card p-4 flex items-center gap-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium text-sm",children:e.name}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",e.version]}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:["by ",e.author]})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.description}),e.permissions.length>0&&c.jsx("div",{className:"flex gap-1 mt-1 flex-wrap",children:e.permissions.map(e=>c.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400",children:e},e))})]}),c.jsxs(o,{size:"sm",disabled:t,onClick:()=>F(e),children:[c.jsx(g,{className:"h-3.5 w-3.5 mr-1"}),t?"安装中...":"安装"]})]},e.id)})})]})]})]}),"skills"===S&&c.jsxs(c.Fragment,{children:[se.length>0&&c.jsxs("div",{className:"flex flex-wrap gap-2 mb-6",children:[c.jsx("button",{className:x("px-3 py-1 rounded-full text-xs font-medium transition-colors",null===K?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"),onClick:()=>Q(null),children:"全部"}),se.map(e=>c.jsx("button",{className:x("px-3 py-1 rounded-full text-xs font-medium transition-colors",K===e?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"),onClick:()=>Q(K===e?null:e),children:e},e)),te&&c.jsx("button",{className:x("px-3 py-1 rounded-full text-xs font-medium transition-colors","__untagged__"===K?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"),onClick:()=>Q("__untagged__"===K?null:"__untagged__"),children:"无标签"})]}),Z&&c.jsx("div",{className:"text-center text-muted-foreground py-20",children:"加载中..."}),B&&c.jsx("div",{className:"text-center text-destructive py-20",children:B}),!Z&&!B&&0===O.length&&c.jsxs("div",{className:"text-center text-muted-foreground py-20",children:[c.jsx("p",{className:"text-lg mb-2",children:"SkillHub 还没有命令"}),c.jsx("p",{className:"text-sm",children:"在快捷命令面板中点击分享按钮来提交第一个命令吧!"})]}),!Z&&!B&&O.length>0&&0===ae.length&&c.jsx("div",{className:"text-center text-muted-foreground py-20",children:"没有匹配的命令"}),c.jsx("div",{className:"space-y-3",children:ae.map((e,s)=>{var t;const a=R===e.id,r=Y.has(e.id),n=W===e.id,i=e.parentId?O.find(s=>s.id===e.parentId):void 0;return c.jsxs(p.div,{layout:!0,initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.25,delay:.03*s,ease:"easeOut"},className:"rounded-lg border bg-card p-4 cursor-pointer hover:border-muted-foreground/30 transition-colors",onClick:()=>V(a?null:e.id),children:[c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h3",{className:"font-medium text-sm truncate",children:e.label}),null==(t=e.tags)?void 0:t.map(e=>c.jsxs("span",{className:"inline-flex items-center gap-0.5 px-2 py-0.5 rounded-full text-xs bg-muted text-muted-foreground",children:[c.jsx(k,{className:"h-2.5 w-2.5"}),e]},e))]}),i&&c.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[c.jsx(f,{className:"h-3 w-3 text-muted-foreground"}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:["继承: ",i.label]})]}),e.description&&c.jsx("p",{className:"text-xs text-muted-foreground mt-1 truncate",children:e.description}),c.jsxs("div",{className:"flex items-center gap-3 mt-2 text-xs text-muted-foreground",children:[c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(C,{className:"h-3 w-3"}),e.author]}),c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(g,{className:"h-3 w-3"}),e.downloads||0]}),c.jsx("span",{children:e.createdAt})]})]}),c.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[c.jsxs(o,{size:"sm",variant:r?"outline":"default",disabled:n||r,onClick:s=>(async(e,s)=>{if(s.stopPropagation(),!W&&!Y.has(e.id)){X(e.id);try{await b(e.id),ee(s=>new Set(s).add(e.id)),T(s=>s.map(s=>s.id===e.id?{...s,downloads:(s.downloads||0)+1}:s))}catch(t){l.error(t instanceof Error?t.message:"Download failed")}finally{X(null)}}})(e,s),title:i?`将同时下载继承的「${i.label}」`:void 0,children:[c.jsx(g,{className:"h-3.5 w-3.5 mr-1"}),r?"已下载":n?"下载中...":"下载"]}),c.jsx(p.span,{animate:{rotate:a?180:0},transition:{duration:.2},children:c.jsx(y,{className:"h-4 w-4 text-muted-foreground"})})]})]}),c.jsx(j,{children:a&&c.jsx(p.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:c.jsx("div",{className:"mt-3 pt-3 border-t",children:c.jsx("pre",{className:"text-xs font-mono bg-muted rounded p-3 whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:e.command})})})})]},e.id)})})]})]})]})}export{S as SkillHubPage};
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-A-o6g_qw.js";
1
+ import{c as o}from"./index-Dn-YLcfD.js";
2
2
  /**
3
3
  * @license lucide-react v0.309.0 - ISC
4
4
  *
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-A-o6g_qw.js";
1
+ import{c as o}from"./index-Dn-YLcfD.js";
2
2
  /**
3
3
  * @license lucide-react v0.309.0 - ISC
4
4
  *