@tom2012/cc-web 2026.4.19-d → 2026.4.19-e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/frontend/dist/assets/{GraphPreview-C5CcQObB.js → GraphPreview-CgbKuYId.js} +1 -1
- package/frontend/dist/assets/{MobilePage-6cREwmBa.js → MobilePage-DB1T18RD.js} +4 -4
- package/frontend/dist/assets/{OfficePreview--1oOT9ZU.js → OfficePreview-8M2OleSY.js} +2 -2
- package/frontend/dist/assets/{PlanPanel-CdSWGxcV.js → PlanPanel-DbOKMsR8.js} +1 -1
- package/frontend/dist/assets/{ProjectPage-Cf4g2qQ-.js → ProjectPage-BVhFZMDi.js} +6 -5
- package/frontend/dist/assets/SettingsPage-Bx7llLhW.js +13 -0
- package/frontend/dist/assets/{ShareViewPage-kZMLxzcO.js → ShareViewPage-UykL1neX.js} +1 -1
- package/frontend/dist/assets/{SkillHubPage-D2ndKohD.js → SkillHubPage-D2S-aO3j.js} +2 -2
- package/frontend/dist/assets/{bot-DvJ1HJ6o.js → bot-mb2XSuWA.js} +1 -1
- package/frontend/dist/assets/{chevron-down-DPoGo9Zk.js → chevron-down-wfOXaRaa.js} +1 -1
- package/frontend/dist/assets/{chevron-up-BTJoI0tp.js → chevron-up-CwtRQk-w.js} +1 -1
- package/frontend/dist/assets/index-Beev1a0a.js +7 -0
- package/frontend/dist/assets/{index-CSDDVTf8.js → index-CeIo8jzU.js} +4 -4
- package/frontend/dist/assets/{index-D1Xu7j2q.js → index-Cr-aW4iI.js} +1 -1
- package/frontend/dist/assets/index-DmPZY6Ja.css +1 -0
- package/frontend/dist/assets/{jszip.min-B5bWTUER.js → jszip.min-DFNYC8ee.js} +1 -1
- package/frontend/dist/assets/{matter-BiBUyTZL.js → matter-TZvDV9Rh.js} +1 -1
- package/frontend/dist/assets/{maximize-2-2QtBGqNT.js → maximize-2-C33nlgA2.js} +1 -1
- package/frontend/dist/assets/{one-light-CYgSBsrf.js → one-light-B0A_xzYF.js} +1 -1
- package/frontend/dist/assets/{search-DhudjqqR.js → search-DboZ70b5.js} +1 -1
- package/frontend/dist/assets/{user-B0_zs2Ff.js → user-D94-hxj0.js} +1 -1
- package/frontend/dist/index.html +2 -2
- package/package.json +1 -1
- package/frontend/dist/assets/SettingsPage-aitdnrNZ.js +0 -13
- package/frontend/dist/assets/index-CSO7BFUu.css +0 -1
- package/frontend/dist/assets/save-d1zUSkQ5.js +0 -7
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{c as e,r as t,aB as n,av as r,aM as o,j as s,aw as a,az as i,ay as l,b as c,aN as d,R as u,aO as f,aA as p,ax as h,aP as m,aQ as x,aR as g,aS as v,aT as y,aU as w,aV as b,z as j,aW as N,a7 as S,a8 as C,a9 as k,aa as R,ab as T,B as A,ac as D,I as E,ad as P,aX as _,aY as O,aZ as I,a_ as M,a$ as L,am as F,b0 as H,m as V,T as z,ak as W,b1 as B,f as $,S as K,b2 as U,al as q,b3 as G,G as X,A as Y,v as Z,X as Q,s as J,t as ee,b4 as te,b5 as ne,b6 as re,b7 as oe,b8 as se,b9 as ae,ba as ie,bb as le}from"./index-CeIo8jzU.js";import{u as ce,c as de,S as ue}from"./index-Beev1a0a.js";import{C as fe}from"./chevron-down-wfOXaRaa.js";import{C as pe}from"./chevron-up-CwtRQk-w.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license lucide-react v0.309.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/const he=e("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]),me=e("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),xe=e("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]),ge=e("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),ve=e("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]),ye=e("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]),we=e("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]),be=e("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]),je=e("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);
|
|
8
|
+
/**
|
|
9
|
+
* @license lucide-react v0.309.0 - ISC
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the ISC license.
|
|
12
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/function Ne(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 Se(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 Ce="Switch",[ke]=l(Ce),[Re,Te]=ke(Ce),Ae=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,[v,y]=t.useState(null),w=r(n,e=>y(e)),b=t.useRef(!1),j=!v||(x||!!v.closest("form")),[N,S]=o({prop:d,defaultProp:u??!1,onChange:m,caller:Ce});return s.jsxs(Re,{scope:l,checked:N,disabled:p,children:[s.jsx(a.button,{type:"button",role:"switch","aria-checked":N,"aria-required":f,"data-state":_e(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(Pe,{control:v,bubbles:!b.current,name:c,value:h,checked:N,required:f,disabled:p,form:x,style:{transform:"translateX(-100%)"}})]})});Ae.displayName=Ce;var De="SwitchThumb",Ee=t.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=Te(De,n);return s.jsx(a.span,{"data-state":_e(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});Ee.displayName=De;var Pe=t.forwardRef(({__scopeSwitch:e,control:n,checked:o,bubbles:a=!0,...i},l)=>{const c=t.useRef(null),d=r(c,l),u=Ne(o),f=Se(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 _e(e){return e?"checked":"unchecked"}Pe.displayName="SwitchBubbleInput";var Oe=Ae,Ie=Ee;const Me=t.forwardRef(({className:e,...t},n)=>s.jsx(Oe,{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(Ie,{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")})}));function Le(e){const n=Fe(e),r=t.forwardRef((e,r)=>{const{children:o,...a}=e,i=t.Children.toArray(o),l=i.find(Ve);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 Fe(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?d(n,e):e),t.cloneElement(r,s)}return t.Children.count(r)>1?t.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}Me.displayName=Oe.displayName;var He=Symbol("radix.slottable");function Ve(e){return t.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===He}function ze(e){const t=e+"CollectionProvider",[n,o]=l(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=e=>{const{scope:t,children:n}=e,r=u.useRef(null),o=u.useRef(new Map).current;return s.jsx(a,{scope:t,itemMap:o,collectionRef:r,children:n})};c.displayName=t;const d=e+"CollectionSlot",f=Le(d),p=u.forwardRef((e,t)=>{const{scope:n,children:o}=e,a=i(d,n),l=r(t,a.collectionRef);return s.jsx(f,{ref:l,children:o})});p.displayName=d;const h=e+"CollectionItemSlot",m="data-radix-collection-item",x=Le(h),g=u.forwardRef((e,t)=>{const{scope:n,children:o,...a}=e,l=u.useRef(null),c=r(t,l),d=i(h,n);return u.useEffect(()=>(d.itemMap.set(l,{ref:l,...a}),()=>{d.itemMap.delete(l)})),s.jsx(x,{[m]:"",ref:c,children:o})});return g.displayName=h,[{Provider:c,Slot:p,ItemSlot:g},function(t){const n=i(e+"CollectionConsumer",t);return u.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])},o]}var We="rovingFocusGroup.onEntryFocus",Be={bubbles:!1,cancelable:!0},$e="RovingFocusGroup",[Ke,Ue,qe]=ze($e),[Ge,Xe]=l($e,[qe]),[Ye,Ze]=Ge($e),Qe=t.forwardRef((e,t)=>s.jsx(Ke.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Ke.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Je,{...e,ref:t})})}));Qe.displayName=$e;var Je=t.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:l,orientation:c,loop:d=!1,dir:u,currentTabStopId:f,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:m,onEntryFocus:x,preventScrollOnEntryFocus:g=!1,...v}=e,y=t.useRef(null),w=r(n,y),b=ce(u),[j,N]=o({prop:f,defaultProp:h??null,onChange:m,caller:$e}),[S,C]=t.useState(!1),k=p(x),R=Ue(l),T=t.useRef(!1),[A,D]=t.useState(0);return t.useEffect(()=>{const e=y.current;if(e)return e.addEventListener(We,k),()=>e.removeEventListener(We,k)},[k]),s.jsx(Ye,{scope:l,orientation:c,dir:b,loop:d,currentTabStopId:j,onItemFocus:t.useCallback(e=>N(e),[N]),onItemShiftTab:t.useCallback(()=>C(!0),[]),onFocusableItemAdd:t.useCallback(()=>D(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>D(e=>e-1),[]),children:s.jsx(a.div,{tabIndex:S||0===A?-1:0,"data-orientation":c,...v,ref:w,style:{outline:"none",...e.style},onMouseDown:i(e.onMouseDown,()=>{T.current=!0}),onFocus:i(e.onFocus,e=>{const t=!T.current;if(e.target===e.currentTarget&&t&&!S){const t=new CustomEvent(We,Be);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=R().filter(e=>e.focusable);rt([e.find(e=>e.active),e.find(e=>e.id===j),...e].filter(Boolean).map(e=>e.ref.current),g)}}T.current=!1}),onBlur:i(e.onBlur,()=>C(!1))})})}),et="RovingFocusGroupItem",tt=t.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:l=!1,tabStopId:c,children:d,...u}=e,p=f(),h=c||p,m=Ze(et,r),x=m.currentTabStopId===h,g=Ue(r),{onFocusableItemAdd:v,onFocusableItemRemove:y,currentTabStopId:w}=m;return t.useEffect(()=>{if(o)return v(),()=>y()},[o,v,y]),s.jsx(Ke.ItemSlot,{scope:r,id:h,focusable:o,active:l,children:s.jsx(a.span,{tabIndex:x?0:-1,"data-orientation":m.orientation,...u,ref:n,onMouseDown:i(e.onMouseDown,e=>{o?m.onItemFocus(h):e.preventDefault()}),onFocus:i(e.onFocus,()=>m.onItemFocus(h)),onKeyDown:i(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void m.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:nt[r]}(e,m.orientation,m.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=g().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const s=o.indexOf(e.currentTarget);o=m.loop?(r=s+1,(n=o).map((e,t)=>n[(r+t)%n.length])):o.slice(s+1)}setTimeout(()=>rt(o))}var n,r}),children:"function"==typeof d?d({isCurrentTabStop:x,hasTabStop:null!=w}):d})})});tt.displayName=et;var nt={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function rt(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var ot=Qe,st=tt,at="Tabs",[it]=l(at,[Xe]),lt=Xe(),[ct,dt]=it(at),ut=t.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:l,orientation:c="horizontal",dir:d,activationMode:u="automatic",...p}=e,h=ce(d),[m,x]=o({prop:r,onChange:i,defaultProp:l??"",caller:at});return s.jsx(ct,{scope:n,baseId:f(),value:m,onValueChange:x,orientation:c,dir:h,activationMode:u,children:s.jsx(a.div,{dir:h,"data-orientation":c,...p,ref:t})})});ut.displayName=at;var ft="TabsList",pt=t.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=dt(ft,n),l=lt(n);return s.jsx(ot,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:s.jsx(a.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});pt.displayName=ft;var ht="TabsTrigger",mt=t.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...l}=e,c=dt(ht,n),d=lt(n),u=vt(c.baseId,r),f=yt(c.baseId,r),p=r===c.value;return s.jsx(st,{asChild:!0,...d,focusable:!o,active:p,children:s.jsx(a.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...l,ref:t,onMouseDown:i(e.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():c.onValueChange(r)}),onKeyDown:i(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&c.onValueChange(r)}),onFocus:i(e.onFocus,()=>{const e="manual"!==c.activationMode;p||o||!e||c.onValueChange(r)})})})});mt.displayName=ht;var xt="TabsContent",gt=t.forwardRef((e,n)=>{const{__scopeTabs:r,value:o,forceMount:i,children:l,...c}=e,d=dt(xt,r),u=vt(d.baseId,o),f=yt(d.baseId,o),p=o===d.value,m=t.useRef(p);return t.useEffect(()=>{const e=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(e)},[]),s.jsx(h,{present:i||p,children:({present:t})=>s.jsx(a.div,{"data-state":p?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":u,hidden:!t,id:f,tabIndex:0,...c,ref:n,style:{...e.style,animationDuration:m.current?"0s":void 0},children:t&&l})})});function vt(e,t){return`${e}-trigger-${t}`}function yt(e,t){return`${e}-content-${t}`}gt.displayName=xt;var wt=pt,bt=mt,jt=gt;const Nt=ut,St=t.forwardRef(({className:e,...t},n)=>s.jsx(wt,{ref:n,className:c("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));St.displayName=wt.displayName;const Ct=t.forwardRef(({className:e,...t},n)=>s.jsx(bt,{ref:n,className:c("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Ct.displayName=bt.displayName;const kt=t.forwardRef(({className:e,...t},n)=>s.jsx(jt,{ref:n,className:c("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));kt.displayName=jt.displayName;const Rt=["top","right","bottom","left"],Tt=Math.min,At=Math.max,Dt=Math.round,Et=Math.floor,Pt=e=>({x:e,y:e}),_t={left:"right",right:"left",bottom:"top",top:"bottom"};function Ot(e,t,n){return At(e,Tt(t,n))}function It(e,t){return"function"==typeof e?e(t):e}function Mt(e){return e.split("-")[0]}function Lt(e){return e.split("-")[1]}function Ft(e){return"x"===e?"y":"x"}function Ht(e){return"y"===e?"height":"width"}function Vt(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function zt(e){return Ft(Vt(e))}function Wt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Bt=["left","right"],$t=["right","left"],Kt=["top","bottom"],Ut=["bottom","top"];function qt(e,t,n,r){const o=Lt(e);let s=function(e,t,n){switch(e){case"top":case"bottom":return n?t?$t:Bt:t?Bt:$t;case"left":case"right":return t?Kt:Ut;default:return[]}}(Mt(e),"start"===n,r);return o&&(s=s.map(e=>e+"-"+o),t&&(s=s.concat(s.map(Wt)))),s}function Gt(e){const t=Mt(e);return _t[t]+e.slice(t.length)}function Xt(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 Yt(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 Zt(e,t,n){let{reference:r,floating:o}=e;const s=Vt(t),a=zt(t),i=Ht(a),l=Mt(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(Lt(t)){case"start":p[a]-=f*(n&&c?-1:1);break;case"end":p[a]+=f*(n&&c?-1:1)}return p}async function Qt(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}=It(t,e),h=Xt(p),m=i[f?"floating"===u?"reference":"floating":u],x=Yt(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,v=await(null==s.getOffsetParent?void 0:s.getOffsetParent(i.floating)),y=await(null==s.isElement?void 0:s.isElement(v))&&await(null==s.getScale?void 0:s.getScale(v))||{x:1,y:1},w=Yt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:g,offsetParent:v,strategy:l}):g);return{top:(x.top-w.top+h.top)/y.y,bottom:(w.bottom-x.bottom+h.bottom)/y.y,left:(x.left-w.left+h.left)/y.x,right:(w.right-x.right+h.right)/y.x}}function Jt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function en(e){return Rt.some(t=>e[t]>=0)}const tn=new Set(["left","top"]);function nn(){return"undefined"!=typeof window}function rn(e){return an(e)?(e.nodeName||"").toLowerCase():"#document"}function on(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function sn(e){var t;return null==(t=(an(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function an(e){return!!nn()&&(e instanceof Node||e instanceof on(e).Node)}function ln(e){return!!nn()&&(e instanceof Element||e instanceof on(e).Element)}function cn(e){return!!nn()&&(e instanceof HTMLElement||e instanceof on(e).HTMLElement)}function dn(e){return!(!nn()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof on(e).ShadowRoot)}function un(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=bn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function fn(e){return/^(table|td|th)$/.test(rn(e))}function pn(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}const hn=/transform|translate|scale|rotate|perspective|filter/,mn=/paint|layout|strict|content/,xn=e=>!!e&&"none"!==e;let gn;function vn(e){const t=ln(e)?bn(e):e;return xn(t.transform)||xn(t.translate)||xn(t.scale)||xn(t.rotate)||xn(t.perspective)||!yn()&&(xn(t.backdropFilter)||xn(t.filter))||hn.test(t.willChange||"")||mn.test(t.contain||"")}function yn(){return null==gn&&(gn="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),gn}function wn(e){return/^(html|body|#document)$/.test(rn(e))}function bn(e){return on(e).getComputedStyle(e)}function jn(e){return ln(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Nn(e){if("html"===rn(e))return e;const t=e.assignedSlot||e.parentNode||dn(e)&&e.host||sn(e);return dn(t)?t.host:t}function Sn(e){const t=Nn(e);return wn(t)?e.ownerDocument?e.ownerDocument.body:e.body:cn(t)&&un(t)?t:Sn(t)}function Cn(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Sn(e),s=o===(null==(r=e.ownerDocument)?void 0:r.body),a=on(o);if(s){const e=kn(a);return t.concat(a,a.visualViewport||[],un(o)?o:[],e&&n?Cn(e):[])}return t.concat(o,Cn(o,[],n))}function kn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Rn(e){const t=bn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=cn(e),s=o?e.offsetWidth:n,a=o?e.offsetHeight:r,i=Dt(n)!==s||Dt(r)!==a;return i&&(n=s,r=a),{width:n,height:r,$:i}}function Tn(e){return ln(e)?e:e.contextElement}function An(e){const t=Tn(e);if(!cn(t))return Pt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Rn(t);let a=(s?Dt(n.width):n.width)/r,i=(s?Dt(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),i&&Number.isFinite(i)||(i=1),{x:a,y:i}}const Dn=Pt(0);function En(e){const t=on(e);return yn()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Dn}function Pn(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),s=Tn(e);let a=Pt(1);t&&(r?ln(r)&&(a=An(r)):a=An(e));const i=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==on(e))&&t}(s,n,r)?En(s):Pt(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=on(s),t=r&&ln(r)?on(r):r;let n=e,o=kn(n);for(;o&&r&&t!==n;){const e=An(o),t=o.getBoundingClientRect(),r=bn(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=on(o),o=kn(n)}}return Yt({width:d,height:u,x:l,y:c})}function _n(e,t){const n=jn(e).scrollLeft;return t?t.left+n:Pn(sn(e)).left+n}function On(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-_n(e,n),y:n.top+t.scrollTop}}function In(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=on(e),r=sn(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=yn();(!e||e&&"fixed"===t)&&(i=o.offsetLeft,l=o.offsetTop)}const c=_n(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=sn(e),n=jn(e),r=e.ownerDocument.body,o=At(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=At(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+_n(e);const i=-n.scrollTop;return"rtl"===bn(r).direction&&(a+=At(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:a,y:i}}(sn(e));else if(ln(t))r=function(e,t){const n=Pn(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=cn(e)?An(e):Pt(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=En(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Yt(r)}function Mn(e,t){const n=Nn(e);return!(n===t||!ln(n)||wn(n))&&("fixed"===bn(n).position||Mn(n,t))}function Ln(e,t,n){const r=cn(t),o=sn(t),s="fixed"===n,a=Pn(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const l=Pt(0);function c(){l.x=_n(o)}if(r||!r&&!s)if(("body"!==rn(t)||un(o))&&(i=jn(t)),r){const e=Pn(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?Pt(0):On(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 Fn(e){return"static"===bn(e).position}function Hn(e,t){if(!cn(e)||"fixed"===bn(e).position)return null;if(t)return t(e);let n=e.offsetParent;return sn(e)===n&&(n=n.ownerDocument.body),n}function Vn(e,t){const n=on(e);if(pn(e))return n;if(!cn(e)){let t=Nn(e);for(;t&&!wn(t);){if(ln(t)&&!Fn(t))return t;t=Nn(t)}return n}let r=Hn(e,t);for(;r&&fn(r)&&Fn(r);)r=Hn(r,t);return r&&wn(r)&&Fn(r)&&!vn(r)?n:r||function(e){let t=Nn(e);for(;cn(t)&&!wn(t);){if(vn(t))return t;if(pn(t))return null;t=Nn(t)}return null}(e)||n}const zn={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s="fixed"===o,a=sn(r),i=!!t&&pn(t.floating);if(r===a||i&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Pt(1);const d=Pt(0),u=cn(r);if((u||!u&&!s)&&(("body"!==rn(r)||un(a))&&(l=jn(r)),u)){const e=Pn(r);c=An(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}const f=!a||u||s?Pt(0):On(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:sn,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[..."clippingAncestors"===n?pn(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Cn(e,[],!1).filter(e=>ln(e)&&"body"!==rn(e)),o=null;const s="fixed"===bn(e).position;let a=s?Nn(e):e;for(;ln(a)&&!wn(a);){const t=bn(a),n=vn(a);n||"fixed"!==t.position||(o=null),(s?!n&&!o:!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||un(a)&&!n&&Mn(e,a))?r=r.filter(e=>e!==a):o=t,a=Nn(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=In(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=In(t,s[u],o);i=At(e.top,i),l=Tt(e.right,l),c=Tt(e.bottom,c),d=At(e.left,d)}return{width:l-d,height:c-i,x:d,y:i}},getOffsetParent:Vn,getElementRects:async function(e){const t=this.getOffsetParent||Vn,n=this.getDimensions,r=await n(e.floating);return{reference:Ln(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}=Rn(e);return{width:t,height:n}},getScale:An,isElement:ln,isRTL:function(e){return"rtl"===bn(e).direction}};function Wn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Bn(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=Tn(e),d=o||s?[...c?Cn(c):[],...t?Cn(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=sn(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:-Et(u)+"px "+-Et(o.clientWidth-(d+f))+"px "+-Et(o.clientHeight-(u+p))+"px "+-Et(d)+"px",threshold:At(0,Tt(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||Wn(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?Pn(e):null;return l&&function t(){const r=Pn(e);m&&!Wn(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 $n=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=Mt(n),i=Lt(n),l="y"===Vt(n),c=tn.has(a)?-1:1,d=s&&l?-1:1,u=It(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}}}}},Kn=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}=It(e,t),d={x:n,y:r},u=await s.detectOverflow(t,c),f=Vt(Mt(o)),p=Ft(f);let h=d[p],m=d[f];if(a){const e="y"===p?"bottom":"right";h=Ot(h+u["y"===p?"top":"left"],h,h-u[e])}if(i){const e="y"===f?"bottom":"right";m=Ot(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}}}}}},Un=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}=It(e,t);if(null!=(n=s.arrow)&&n.alignmentOffset)return{};const g=Mt(o),v=Vt(i),y=Mt(i)===i,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),b=f||(y||!m?[Gt(i)]:function(e){const t=Gt(e);return[Wt(e),t,Wt(t)]}(i)),j="none"!==h;!f&&j&&b.push(...qt(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=Lt(e),o=zt(e),s=Ht(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Gt(a)),[a,Gt(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,T;const e=((null==(R=s.flip)?void 0:R.index)||0)+1,t=N[e];if(t){if(!("alignment"===u&&v!==Vt(t))||k.every(e=>Vt(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:k},reset:{placement:t}}}let n=null==(T=k.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:T.placement;if(!n)switch(p){case"bestFit":{var A;const e=null==(A=k.filter(e=>{if(j){const t=Vt(e.placement);return t===v||"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{}}}},qn=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}=It(e,t),d=await a.detectOverflow(t,c),u=Mt(o),f=Lt(o),p="y"===Vt(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 v=m-d.top-d.bottom,y=h-d.left-d.right,w=Tt(m-d[x],v),b=Tt(h-d[g],y),j=!t.middlewareData.shift;let N=w,S=b;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=y),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(N=v),j&&!f){const e=At(d.left,0),t=At(d.right,0),n=At(d.top,0),r=At(d.bottom,0);p?S=h-2*(0!==e||0!==t?e+t:At(d.left,d.right)):N=m-2*(0!==n||0!==r?n+r:At(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}}:{}}}},Gn=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=It(e,t);switch(o){case"referenceHidden":{const e=Jt(await r.detectOverflow(t,{...s,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:en(e)}}}case"escaped":{const e=Jt(await r.detectOverflow(t,{...s,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:en(e)}}}default:return{}}}}},Xn=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}=It(e,t)||{};if(null==c)return{};const u=Xt(d),f={x:n,y:r},p=zt(o),h=Ht(p),m=await a.getDimensions(c),x="y"===p,g=x?"top":"left",v=x?"bottom":"right",y=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[y]:0;N&&await(null==a.isElement?void 0:a.isElement(j))||(N=i.floating[y]||s.floating[h]);const S=w/2-b/2,C=N/2-m[h]/2-1,k=Tt(u[g],C),R=Tt(u[v],C),T=k,A=N-m[h]-R,D=N/2-m[h]/2+S,E=Ot(T,D,A),P=!l.arrow&&null!=Lt(o)&&D!==E&&s.reference[h]/2-(D<T?k:R)-m[h]/2<0,_=P?D<T?D-T:D-A:0;return{[p]:f[p]+_,data:{[p]:E,centerOffset:D-E-_,...P&&{alignmentOffset:_}},reset:P}}}),Yn=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}=It(e,t),d={x:n,y:r},u=Vt(o),f=Ft(u);let p=d[f],h=d[u];const m=It(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,v;const e="y"===f?"width":"height",t=tn.has(Mt(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==(v=a.offset)?void 0:v[u])||0)-(t?x.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[f]:p,[u]:h}}}},Zn=(e,t,n)=>{const r=new Map,o={platform:zn,...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:Qt},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}=Zt(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:v,y:y,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!=v?v:d,u=null!=y?y: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}=Zt(c,f,l))),m=-1)}return{x:d,y:u,placement:f,strategy:o,middlewareData:h}})(e,t,{...o,platform:s})};var Qn="undefined"!=typeof document?t.useLayoutEffect:function(){};function Jn(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(!Jn(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)&&!Jn(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function er(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tr(e,t){const n=er(e);return Math.round(t*n)/n}function nr(e){const n=t.useRef(e);return Qn(()=>{n.current=e}),n}const rr=(e,t)=>{const n=$n(e);return{name:n.name,fn:n.fn,options:[e,t]}},or=(e,t)=>{const n=Kn(e);return{name:n.name,fn:n.fn,options:[e,t]}},sr=(e,t)=>{const n=Un(e);return{name:n.name,fn:n.fn,options:[e,t]}},ar=(e,t)=>{const n=qn(e);return{name:n.name,fn:n.fn,options:[e,t]}},ir=(e,t)=>{const n=Gn(e);return{name:n.name,fn:n.fn,options:[e,t]}},lr=(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?Xn({element:n.current,padding:r}).fn(t):{}:n?Xn({element:n,padding:r}).fn(t):{};var o}}))(e);return{name:n.name,fn:n.fn,options:[e,t]}};var cr=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"})})});cr.displayName="Arrow";var dr=cr,ur="Popper",[fr,pr]=l(ur),[hr,mr]=fr(ur),xr=e=>{const{__scopePopper:n,children:r}=e,[o,a]=t.useState(null);return s.jsx(hr,{scope:n,anchor:o,onAnchorChange:a,children:r})};xr.displayName=ur;var gr="PopperAnchor",vr=t.forwardRef((e,n)=>{const{__scopePopper:o,virtualRef:i,...l}=e,c=mr(gr,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})});vr.displayName=gr;var yr="PopperContent",[wr,br]=fr(yr),jr=t.forwardRef((e,o)=>{var i,l,c,d,u,f;const{__scopePopper:h,side:x="bottom",sideOffset:g=0,align:v="center",alignOffset:y=0,arrowPadding:w=0,avoidCollisions:b=!0,collisionBoundary:j=[],collisionPadding:N=0,sticky:S="partial",hideWhenDetached:C=!1,updatePositionStrategy:k="optimized",onPlaced:R,...T}=e,A=mr(yr,h),[D,E]=t.useState(null),P=r(o,e=>E(e)),[_,O]=t.useState(null),I=Se(_),M=(null==I?void 0:I.width)??0,L=(null==I?void 0:I.height)??0,F=x+("center"!==v?"-"+v:""),H="number"==typeof N?N:{top:0,right:0,bottom:0,left:0,...N},V=Array.isArray(j)?j:[j],z=V.length>0,W={padding:H,boundary:V.filter(kr),altBoundary:z},{refs:B,floatingStyles:$,placement:K,isPositioned:U,middlewareData:q}=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:d}=e,[u,f]=t.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[p,h]=t.useState(o);Jn(p,o)||h(o);const[x,g]=t.useState(null),[v,y]=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,y(e))},[]),j=a||x,N=i||v,S=t.useRef(null),C=t.useRef(null),k=t.useRef(u),R=null!=c,T=nr(c),A=nr(s),D=nr(d),E=t.useCallback(()=>{if(!S.current||!C.current)return;const e={placement:n,strategy:r,middleware:p};A.current&&(e.platform=A.current),Zn(S.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==D.current};P.current&&!Jn(k.current,t)&&(k.current=t,m.flushSync(()=>{f(t)}))})},[p,n,r,A,D]);Qn(()=>{!1===d&&k.current.isPositioned&&(k.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[d]);const P=t.useRef(!1);Qn(()=>(P.current=!0,()=>{P.current=!1}),[]),Qn(()=>{if(j&&(S.current=j),N&&(C.current=N),j&&N){if(T.current)return T.current(j,N,E);E()}},[j,N,E,T,R]);const _=t.useMemo(()=>({reference:S,floating:C,setReference:w,setFloating:b}),[w,b]),O=t.useMemo(()=>({reference:j,floating:N}),[j,N]),I=t.useMemo(()=>{const e={position:r,left:0,top:0};if(!O.floating)return e;const t=tr(O.floating,u.x),n=tr(O.floating,u.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...er(O.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,O.floating,u.x,u.y]);return t.useMemo(()=>({...u,update:E,refs:_,elements:O,floatingStyles:I}),[u,E,_,O,I])}({strategy:"fixed",placement:F,whileElementsMounted:(...e)=>Bn(...e,{animationFrame:"always"===k}),elements:{reference:A.anchor},middleware:[rr({mainAxis:g+L,alignmentAxis:y}),b&&or({mainAxis:!0,crossAxis:!1,limiter:"partial"===S?{fn:Yn(G).fn,options:[G,X]}:void 0,...W}),b&&sr({...W}),ar({...W,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`)}}),_&&lr({element:_,padding:w}),Rr({arrowWidth:M,arrowHeight:L}),C&&ir({strategy:"referenceHidden",...W})]});var G,X;const[Y,Z]=Tr(K),Q=p(R);n(()=>{U&&(null==Q||Q())},[U,Q]);const J=null==(i=q.arrow)?void 0:i.x,ee=null==(l=q.arrow)?void 0:l.y,te=0!==(null==(c=q.arrow)?void 0:c.centerOffset),[ne,re]=t.useState();return n(()=>{D&&re(window.getComputedStyle(D).zIndex)},[D]),s.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:U?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[null==(d=q.transformOrigin)?void 0:d.x,null==(u=q.transformOrigin)?void 0:u.y].join(" "),...(null==(f=q.hide)?void 0:f.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(wr,{scope:h,placedSide:Y,onArrowChange:O,arrowX:J,arrowY:ee,shouldHideArrow:te,children:s.jsx(a.div,{"data-side":Y,"data-align":Z,...T,ref:P,style:{...T.style,animation:U?void 0:"none"}})})})});jr.displayName=yr;var Nr="PopperArrow",Sr={top:"bottom",right:"left",bottom:"top",left:"right"},Cr=t.forwardRef(function(e,t){const{__scopePopper:n,...r}=e,o=br(Nr,n),a=Sr[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(dr,{...r,ref:t,style:{...r.style,display:"block"}})})});function kr(e){return null!==e}Cr.displayName=Nr;var Rr=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]=Tr(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 Tr(e){const[t,n="center"]=e.split("-");return[t,n]}var Ar=xr,Dr=vr,Er=jr,Pr=Cr;function _r(e){const n=Or(e),r=t.forwardRef((e,r)=>{const{children:o,...a}=e,i=t.Children.toArray(o),l=i.find(Mr);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 Or(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?d(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 Ir=Symbol("radix.slottable");function Mr(e){return t.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Ir}var Lr=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:{...Lr,...e.style}})).displayName="VisuallyHidden";var Fr=[" ","Enter","ArrowUp","ArrowDown"],Hr=[" ","Enter"],Vr="Select",[zr,Wr,Br]=ze(Vr),[$r]=l(Vr,[Br,pr]),Kr=pr(),[Ur,qr]=$r(Vr),[Gr,Xr]=$r(Vr),Yr=e=>{const{__scopeSelect:n,children:r,open:a,defaultOpen:i,onOpenChange:l,value:c,defaultValue:d,onValueChange:u,dir:p,name:h,autoComplete:m,disabled:x,required:g,form:v}=e,y=Kr(n),[w,b]=t.useState(null),[j,N]=t.useState(null),[S,C]=t.useState(!1),k=ce(p),[R,T]=o({prop:a,defaultProp:i??!1,onChange:l,caller:Vr}),[A,D]=o({prop:c,defaultProp:d,onChange:u,caller:Vr}),E=t.useRef(null),P=!w||(v||!!w.closest("form")),[_,O]=t.useState(new Set),I=Array.from(_).map(e=>e.props.value).join(";");return s.jsx(Ar,{...y,children:s.jsxs(Ur,{required:g,scope:n,trigger:w,onTriggerChange:b,valueNode:j,onValueNodeChange:N,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:f(),value:A,onValueChange:D,open:R,onOpenChange:T,dir:k,triggerPointerDownPosRef:E,disabled:x,children:[s.jsx(zr.Provider,{scope:n,children:s.jsx(Gr,{scope:e.__scopeSelect,onNativeOptionAdd:t.useCallback(e=>{O(t=>new Set(t).add(e))},[]),onNativeOptionRemove:t.useCallback(e=>{O(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:r})}),P?s.jsxs(Lo,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:m,value:A,onChange:e=>D(e.target.value),disabled:x,form:v,children:[void 0===A?s.jsx("option",{value:""}):null,Array.from(_)]},I):null]})})};Yr.displayName=Vr;var Zr="SelectTrigger",Qr=t.forwardRef((e,n)=>{const{__scopeSelect:o,disabled:l=!1,...c}=e,d=Kr(o),u=qr(Zr,o),f=u.disabled||l,p=r(n,u.onTriggerChange),h=Wr(o),m=t.useRef("touch"),[x,g,v]=Ho(e=>{const t=h().filter(e=>!e.disabled),n=t.find(e=>e.value===u.value),r=Vo(t,e,n);void 0!==r&&u.onValueChange(r.value)}),y=e=>{f||(u.onOpenChange(!0),v()),e&&(u.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return s.jsx(Dr,{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":Fo(u.value)?"":void 0,...c,ref:p,onClick:i(c.onClick,e=>{e.currentTarget.focus(),"mouse"!==m.current&&y(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&&(y(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||Fr.includes(e.key)&&(y(),e.preventDefault())})})})});Qr.displayName=Zr;var Jr="SelectValue",eo=t.forwardRef((e,t)=>{const{__scopeSelect:o,className:i,style:l,children:c,placeholder:d="",...u}=e,f=qr(Jr,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:Fo(f.value)?s.jsx(s.Fragment,{children:d}):c})});eo.displayName=Jr;var to=t.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return s.jsx(a.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});to.displayName="SelectIcon";var no=e=>s.jsx(x,{asChild:!0,...e});no.displayName="SelectPortal";var ro="SelectContent",oo=t.forwardRef((e,r)=>{const o=qr(ro,e.__scopeSelect),[a,i]=t.useState();if(n(()=>{i(new DocumentFragment)},[]),!o.open){const t=a;return t?m.createPortal(s.jsx(ao,{scope:e.__scopeSelect,children:s.jsx(zr.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),t):null}return s.jsx(co,{...e,ref:r})});oo.displayName=ro;var so=10,[ao,io]=$r(ro),lo=_r("SelectContent.RemoveScroll"),co=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:m,collisionBoundary:x,collisionPadding:j,sticky:N,hideWhenDetached:S,avoidCollisions:C,...k}=e,R=qr(ro,o),[T,A]=t.useState(null),[D,E]=t.useState(null),P=r(n,e=>A(e)),[_,O]=t.useState(null),[I,M]=t.useState(null),L=Wr(o),[F,H]=t.useState(!1),V=t.useRef(!1);t.useEffect(()=>{if(T)return g(T)},[T]),v();const z=t.useCallback(e=>{const[t,...n]=L().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}},[L,D]),W=t.useCallback(()=>z([_,T]),[z,_,T]);t.useEffect(()=>{F&&W()},[F,W]);const{onOpenChange:B,triggerPointerDownPosRef:$}=R;t.useEffect(()=>{if(T){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():T.contains(n.target)||B(!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})}}},[T,B,$]),t.useEffect(()=>{const e=()=>B(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[B]);const[K,U]=Ho(e=>{const t=L().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=Vo(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),q=t.useCallback((e,t,n)=>{const r=!V.current&&!n;(void 0!==R.value&&R.value===t||r)&&(O(e),r&&(V.current=!0))},[R.value]),G=t.useCallback(()=>null==T?void 0:T.focus(),[T]),X=t.useCallback((e,t,n)=>{const r=!V.current&&!n;(void 0!==R.value&&R.value===t||r)&&M(e)},[R.value]),Y="popper"===a?fo:uo,Z=Y===fo?{side:u,sideOffset:f,align:p,alignOffset:h,arrowPadding:m,collisionBoundary:x,collisionPadding:j,sticky:N,hideWhenDetached:S,avoidCollisions:C}:{};return s.jsx(ao,{scope:o,content:T,viewport:D,onViewportChange:E,itemRefCallback:q,selectedItem:_,onItemLeave:G,itemTextRefCallback:X,focusSelectedItem:W,selectedItemText:I,position:a,isPositioned:F,searchRef:K,children:s.jsx(y,{as:lo,allowPinchZoom:!0,children:s.jsx(w,{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(b,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:s.jsx(Y,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:e=>e.preventDefault(),...k,...Z,onPlaced:()=>H(!0),ref:P,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||U(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=L().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(()=>z(t)),e.preventDefault()}})})})})})})});co.displayName="SelectContentImpl";var uo=t.forwardRef((e,o)=>{const{__scopeSelect:i,onPlaced:l,...c}=e,d=qr(ro,i),u=io(ro,i),[f,p]=t.useState(null),[h,m]=t.useState(null),x=r(o,e=>m(e)),g=Wr(i),v=t.useRef(!1),y=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-so,d=de(s,[so,Math.max(so,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-so,d=de(s,[so,Math.max(so,c-l)]);f.style.minWidth=i+"px",f.style.right=d+"px"}const o=g(),s=window.innerHeight-2*so,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),y=window.getComputedStyle(w),N=parseInt(y.paddingTop,10),S=parseInt(y.paddingBottom,10),C=e.top+e.height/2-so,k=s-C,R=b.offsetHeight/2,T=c+u+(b.offsetTop+R),A=m-T;if(T<=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=T+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=T-C+w.offsetTop}f.style.margin=`${so}px 0`,f.style.minHeight=x+"px",f.style.maxHeight=s+"px",null==l||l(),requestAnimationFrame(()=>v.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===y.current&&(S(),null==N||N(),y.current=!1)},[S,N]);return s.jsx(po,{scope:i,contentWrapper:f,shouldExpandOnScrollRef:v,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}})})})});uo.displayName="SelectItemAlignedPosition";var fo=t.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=so,...a}=e,i=Kr(n);return s.jsx(Er,{...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)"}})});fo.displayName="SelectPopperPosition";var[po,ho]=$r(ro,{}),mo="SelectViewport",xo=t.forwardRef((e,n)=>{const{__scopeSelect:o,nonce:l,...c}=e,d=io(mo,o),u=ho(mo,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(zr.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*so,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})})})]})});xo.displayName=mo;var go="SelectGroup",[vo,yo]=$r(go);t.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=f();return s.jsx(vo,{scope:n,id:o,children:s.jsx(a.div,{role:"group","aria-labelledby":o,...r,ref:t})})}).displayName=go;var wo="SelectLabel",bo=t.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=yo(wo,n);return s.jsx(a.div,{id:o.id,...r,ref:t})});bo.displayName=wo;var jo="SelectItem",[No,So]=$r(jo),Co=t.forwardRef((e,n)=>{const{__scopeSelect:o,value:l,disabled:c=!1,textValue:d,...u}=e,p=qr(jo,o),h=io(jo,o),m=p.value===l,[x,g]=t.useState(d??""),[v,y]=t.useState(!1),w=r(n,e=>{var t;return null==(t=h.itemRefCallback)?void 0:t.call(h,e,l,c)}),b=f(),j=t.useRef("touch"),N=()=>{c||(p.onValueChange(l),p.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(No,{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(zr.ItemSlot,{scope:o,value:l,disabled:c,textValue:x,children:s.jsx(a.div,{role:"option","aria-labelledby":b,"data-highlighted":v?"":void 0,"aria-selected":m&&v,"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,()=>y(!0)),onBlur:i(u.onBlur,()=>y(!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||(Hr.includes(e.key)&&N()," "===e.key&&e.preventDefault())})})})})});Co.displayName=jo;var ko="SelectItemText",Ro=t.forwardRef((e,o)=>{const{__scopeSelect:i,className:l,style:c,...d}=e,u=qr(ko,i),f=io(ko,i),p=So(ko,i),h=Xr(ko,i),[x,g]=t.useState(null),v=r(o,e=>g(e),p.onItemTextChange,e=>{var t;return null==(t=f.itemTextRefCallback)?void 0:t.call(f,e,p.value,p.disabled)}),y=null==x?void 0:x.textContent,w=t.useMemo(()=>s.jsx("option",{value:p.value,disabled:p.disabled,children:y},p.value),[p.disabled,p.value,y]),{onNativeOptionAdd:b,onNativeOptionRemove:j}=h;return n(()=>(b(w),()=>j(w)),[b,j,w]),s.jsxs(s.Fragment,{children:[s.jsx(a.span,{id:p.textId,...d,ref:v}),p.isSelected&&u.valueNode&&!u.valueNodeHasChildren?m.createPortal(d.children,u.valueNode):null]})});Ro.displayName=ko;var To="SelectItemIndicator",Ao=t.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return So(To,n).isSelected?s.jsx(a.span,{"aria-hidden":!0,...r,ref:t}):null});Ao.displayName=To;var Do="SelectScrollUpButton",Eo=t.forwardRef((e,o)=>{const a=io(Do,e.__scopeSelect),i=ho(Do,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(Oo,{...e,ref:d,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Eo.displayName=Do;var Po="SelectScrollDownButton",_o=t.forwardRef((e,o)=>{const a=io(Po,e.__scopeSelect),i=ho(Po,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(Oo,{...e,ref:d,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});_o.displayName=Po;var Oo=t.forwardRef((e,r)=>{const{__scopeSelect:o,onAutoScroll:l,...c}=e,d=io("SelectScrollButton",o),u=t.useRef(null),f=Wr(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()})})}),Io=t.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(a.div,{"aria-hidden":!0,...r,ref:t})});Io.displayName="SelectSeparator";var Mo="SelectArrow";t.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Kr(n),a=qr(Mo,n),i=io(Mo,n);return a.open&&"popper"===i.position?s.jsx(Pr,{...o,...r,ref:t}):null}).displayName=Mo;var Lo=t.forwardRef(({__scopeSelect:e,value:n,...o},i)=>{const l=t.useRef(null),c=r(i,l),d=Ne(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:{...Lr,...o.style},ref:c,defaultValue:n})});function Fo(e){return""===e||void 0===e}function Ho(e){const n=p(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 Vo(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}Lo.displayName="SelectBubbleInput";var zo=Qr,Wo=to,Bo=no,$o=oo,Ko=xo,Uo=bo,qo=Co,Go=Ro,Xo=Ao,Yo=Eo,Zo=_o,Qo=Io;const Jo=Yr,es=eo,ts=t.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(zo,{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(Wo,{asChild:!0,children:s.jsx(fe,{className:"h-4 w-4 opacity-50"})})]}));ts.displayName=zo.displayName;const ns=t.forwardRef(({className:e,...t},n)=>s.jsx(Yo,{ref:n,className:c("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(pe,{className:"h-4 w-4"})}));ns.displayName=Yo.displayName;const rs=t.forwardRef(({className:e,...t},n)=>s.jsx(Zo,{ref:n,className:c("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(fe,{className:"h-4 w-4"})}));rs.displayName=Zo.displayName;const os=t.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>s.jsx(Bo,{children:s.jsxs($o,{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(ns,{}),s.jsx(Ko,{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(rs,{})]})}));os.displayName=$o.displayName;t.forwardRef(({className:e,...t},n)=>s.jsx(Uo,{ref:n,className:c("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t})).displayName=Uo.displayName;const ss=t.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(qo,{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(Xo,{children:s.jsx(j,{className:"h-4 w-4"})})}),s.jsx(Go,{children:t})]}));ss.displayName=qo.displayName;t.forwardRef(({className:e,...t},n)=>s.jsx(Qo,{ref:n,className:c("-mx-1 my-1 h-px bg-muted",e),...t})).displayName=Qo.displayName;const as={"google-drive":"Google Drive",onedrive:"OneDrive",dropbox:"Dropbox"};function is({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,v]=t.useState(""),[y,w]=t.useState(!1),[b,j]=t.useState(null);t.useEffect(()=>{e&&N().then(e=>a(e.available)).catch(()=>a([]))},[e]);const I=()=>{l(!1),d(null),f(""),h(""),x(""),v(""),w(!1),j(null)},M=o.length>0;return s.jsx(S,{open:e,onOpenChange:e=>{n(e),e||I()},children:s.jsxs(C,{className:"sm:max-w-md",children:[s.jsxs(k,{children:[s.jsxs(R,{className:"flex items-center gap-2",children:[s.jsx(ye,{className:"h-5 w-5"}),"添加云盘账号"]}),s.jsx(T,{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(D,{children:"云盘类型"}),s.jsxs(Jo,{value:u,onValueChange:f,children:[s.jsx(ts,{children:s.jsx(es,{placeholder:"选择云盘类型"})}),s.jsxs(os,{children:[s.jsx(ss,{value:"google-drive",children:"Google Drive"}),s.jsx(ss,{value:"onedrive",children:"OneDrive"}),s.jsx(ss,{value:"dropbox",children:"Dropbox"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(D,{children:"显示名称"}),s.jsx(E,{placeholder:"例如:我的 Google Drive",value:p,onChange:e=>h(e.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(D,{children:"Client ID"}),s.jsx(E,{placeholder:"OAuth Client ID",value:m,onChange:e=>x(e.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(D,{children:"Client Secret"}),s.jsx(E,{type:"password",placeholder:"OAuth Client Secret",value:g,onChange:e=>v(e.target.value)})]}),b&&s.jsx("p",{className:"text-sm text-destructive",children:b})]}),s.jsxs(P,{children:[s.jsx(A,{variant:"outline",onClick:()=>{l(!1),j(null)},children:"返回"}),s.jsx(A,{onClick:async()=>{if(u&&p&&m&&g){w(!0),j(null);try{const{id:e}=await _({type:u,label:p,clientId:m,clientSecret:g}),{url:t}=await O(e);window.open(t,"_blank"),I(),n(!1),r()}catch(e){j(e instanceof Error?e.message:"添加失败")}finally{w(!1)}}else j("请填写所有字段")},disabled:y,children:y?"添加中...":"添加并授权"})]})]}):s.jsxs("div",{className:"space-y-3 py-2",children:[M?s.jsx(s.Fragment,{children:o.map(e=>s.jsx(A,{variant:"outline",className:"w-full justify-start gap-3 h-12 text-base",onClick:()=>{(async e=>{d(e),j(null);try{const{id:t}=await _({type:e,label:as[e]||e}),{url:o}=await O(t);window.open(o,"_blank"),I(),n(!1),r()}catch(t){j(t instanceof Error?t.message:"添加失败"),d(null)}})(e)},disabled:null!==c,children:c===e?"连接中...":`连接 ${as[e]||e}`},e))}):s.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"暂无内置 OAuth 凭据,请使用手动模式添加"}),b&&s.jsx("p",{className:"text-sm text-destructive",children:b}),s.jsx("div",{className:"pt-2 border-t border-border",children:s.jsxs("button",{onClick:()=>{l(!0),j(null)},className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(be,{className:"h-3.5 w-3.5"}),"手动填写 OAuth 凭据"]})})]})]})})}const ls={"google-drive":"Google Drive",onedrive:"OneDrive",dropbox:"Dropbox"};function cs({type:e}){switch(e){case"google-drive":return s.jsx(we,{className:"h-5 w-5 text-blue-500"});case"onedrive":return s.jsx(ye,{className:"h-5 w-5 text-sky-500"});case"dropbox":return s.jsx(we,{className:"h-5 w-5 text-indigo-500"});default:return s.jsx(ye,{className:"h-5 w-5"})}}function ds({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(I,{children:[s.jsx(M,{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(cs,{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:ls[e.type]||e.type})]})]}),s.jsx(F,{variant:e.authorized?"default":"destructive",className:e.authorized?"bg-green-600 hover:bg-green-700":"",children:e.authorized?"已授权":"未授权"})]})}),s.jsxs(H,{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(A,{variant:"outline",size:"sm",onClick:()=>r(e.id),children:[s.jsx(V,{className:"h-3.5 w-3.5 mr-1"}),"重新授权"]}),s.jsxs(A,{variant:a?"destructive":"outline",size:"sm",onClick:()=>{a?(n(e.id),i(!1)):(i(!0),l.current=setTimeout(()=>i(!1),3e3))},children:[s.jsx(z,{className:"h-3.5 w-3.5 mr-1"}),a?"确认删除?":"删除"]})]})]})]})}const us={success:{label:"成功",icon:ge,className:"bg-green-600 hover:bg-green-700"},failed:{label:"失败",icon:je,className:"bg-red-600 hover:bg-red-700"},partial:{label:"部分完成",icon:me,className:"bg-yellow-600 hover:bg-yellow-700"}};function fs(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 ps({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(ve,{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=us[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(F,{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:fs(e.startTime,e.endTime)})]},e.id);var r})})]})})}const hs=["node_modules",".git","dist","build","*.log",".DS_Store","*.tmp",".venv","__pycache__",".env"],ms=[{value:"30",label:"30分钟"},{value:"60",label:"1小时"},{value:"360",label:"6小时"},{value:"720",label:"12小时"},{value:"1440",label:"24小时"}];function xs(){const e=W(),[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,v]=t.useState(""),[y,w]=t.useState(!1),[b,j]=t.useState(!1),[N,S]=t.useState([]),[C,k]=t.useState(!0),[R,T]=t.useState(()=>B()),[P,_]=t.useState(!1),[I,M]=t.useState({webhookEnabled:!1}),[L,F]=t.useState(""),[H,z]=t.useState(!1),[ce,de]=t.useState(()=>$(K.usageMonitorTool,"claude")),fe=async()=>{try{const e=await te();r(e)}catch{}finally{a(!1)}},pe=async()=>{try{const e=await oe();S(e)}catch{}finally{k(!1)}};t.useEffect(()=>{fe(),(async()=>{try{const e=await ne();d(e)}catch{}finally{f(!1)}})(),(async()=>{try{const e=await re();h(e.length>0?e:hs)}catch{h(hs)}finally{x(!1)}})(),pe(),U().then(e=>{M(e),F(e.webhookUrl??"")}).catch(()=>{})},[]);const me=(e,t)=>{const n=parseInt(t,10);isNaN(n)||n<1||(T(t=>({...t,[e]:n})),_(!0))},ge=async e=>{try{await se(e),r(t=>t.filter(t=>t.id!==e))}catch{}},ve=async e=>{try{const{url:t}=await O(e);window.open(t,"_blank")}catch{}},ye=()=>{const e=g.trim();e&&!p.includes(e)&&(h(t=>[...t,e]),v(""),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(A,{variant:"ghost",size:"sm",onClick:()=>e("/"),children:[s.jsx(q,{className:"h-4 w-4 mr-1"}),"返回"]}),s.jsx("h1",{className:"text-2xl font-bold",children:"设置"})]}),s.jsxs(Nt,{defaultValue:"providers",children:[s.jsxs(St,{className:"mb-4",children:[s.jsx(Ct,{value:"providers",children:"云盘账号"}),s.jsx(Ct,{value:"strategy",children:"备份策略"}),s.jsx(Ct,{value:"history",children:"备份记录"}),s.jsxs(Ct,{value:"notifications",children:[s.jsx(xe,{className:"h-3.5 w-3.5 mr-1.5"}),"通知"]}),s.jsxs(Ct,{value:"pomodoro",children:[s.jsx(G,{className:"h-3.5 w-3.5 mr-1.5"}),"番茄钟"]}),s.jsxs(Ct,{value:"usage",children:[s.jsx(he,{className:"h-3.5 w-3.5 mr-1.5"}),"用量监控"]})]}),s.jsxs(kt,{value:"providers",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex justify-end",children:s.jsxs(A,{onClick:()=>l(!0),children:[s.jsx(X,{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(ds,{provider:e,onDelete:ge,onReauth:ve},e.id))})]}),s.jsx(is,{open:i,onOpenChange:l,onAdded:()=>{fe()}})]}),s.jsx(kt,{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(Y,{children:p.map(e=>s.jsxs(Z.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(Q,{className:"h-3 w-3"})})]},e))})}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(E,{placeholder:"输入排除模式,例如 *.log",value:g,onChange:e=>v(e.target.value),onKeyDown:e=>{"Enter"===e.key&&ye()},className:"max-w-xs"}),s.jsx(A,{variant:"outline",size:"sm",onClick:ye,children:"添加"})]}),y&&s.jsxs(A,{onClick:async()=>{j(!0);try{await ae(p),w(!1)}catch{}finally{j(!1)}},disabled:b,children:[s.jsx(ue,{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(Me,{checked:c.enabled,onCheckedChange:async e=>{const t=c;d({...c,enabled:e});try{await ie({enabled:e})}catch{d(t)}}}),s.jsx(D,{children:c.enabled?"已开启":"已关闭"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(D,{children:"备份间隔"}),s.jsxs(Jo,{value:String(c.intervalMinutes),onValueChange:async e=>{const t=parseInt(e,10),n=c;d({...c,intervalMinutes:t});try{await ie({intervalMinutes:t})}catch{d(n)}},children:[s.jsx(ts,{className:"w-48",children:s.jsx(es,{})}),s.jsx(os,{children:ms.map(e=>s.jsx(ss,{value:e.value,children:e.label},e.value))})]})]})]})]})]})}),s.jsx(kt,{value:"history",children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex justify-end",children:s.jsxs(A,{variant:"outline",size:"sm",onClick:()=>{k(!0),pe()},children:[s.jsx(V,{className:"h-4 w-4 mr-1"}),"刷新"]})}),C?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"加载中..."}):s.jsx(ps,{history:N})]})}),s.jsx(kt,{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(D,{className:"text-xs",children:"Webhook URL"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(E,{placeholder:"https://hooks.slack.com/...",value:L,onChange:e=>F(e.target.value),className:"font-mono text-xs"}),s.jsx(A,{size:"sm",onClick:()=>{(async()=>{z(!0);try{const e=await le({webhookEnabled:L.trim().length>0,webhookUrl:L.trim()||void 0});M(e),ee.success("Webhook 配置已保存")}catch{ee.error("保存失败")}finally{z(!1)}})()},disabled:H,children:H?"保存中…":"保存"})]}),I.webhookEnabled&&I.webhookUrl&&s.jsxs("p",{className:"text-xs text-green-500",children:["已启用 → ",I.webhookUrl]})]})]})]})}),s.jsx(kt,{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(D,{className:"text-xs",children:"工作时长(分钟)"}),s.jsx(E,{type:"number",min:1,max:120,value:R.workMinutes,onChange:e=>me("workMinutes",e.target.value),className:"w-full"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(D,{className:"text-xs",children:"休息时长(分钟)"}),s.jsx(E,{type:"number",min:1,max:60,value:R.breakMinutes,onChange:e=>me("breakMinutes",e.target.value),className:"w-full"})]})]}),P&&s.jsxs(A,{size:"sm",onClick:()=>{J(K.pomodoroConfig,R,!0),_(!1),ee.success("番茄钟设置已保存")},children:[s.jsx(ue,{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(G,{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(kt,{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:()=>{de(e.key),J(K.usageMonitorTool,e.key),window.dispatchEvent(new Event("ccweb:usage-tool-change")),ee.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{xs as SettingsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{aI as e,r as s,bi as t,j as r,b as a}from"./index-CeIo8jzU.js";import{U as n}from"./user-D94-hxj0.js";import{B as c}from"./bot-mb2XSuWA.js";function l(){const{token:l}=e(),[i,d]=s.useState(!0),[m,x]=s.useState(null),[o,u]=s.useState(null),[g,h]=s.useState("");if(s.useEffect(()=>{l&&(d(!0),t(l).then(e=>{document.title=e.projectName+" — cc-web",u(e.session),h(e.projectName)}).catch(e=>x(e.message||"链接无效或已过期")).finally(()=>d(!1)))},[l]),i)return r.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:r.jsx("span",{className:"text-muted-foreground text-sm",children:"加载中…"})});if(m||!o)return r.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:r.jsxs("div",{className:"text-center space-y-2",children:[r.jsx("p",{className:"text-foreground font-medium",children:"无法加载会话"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:m??"链接无效或已过期"})]})});const f=new Date(o.startedAt).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"});return r.jsx("div",{className:"min-h-screen bg-background text-foreground",children:r.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-8",children:[r.jsxs("div",{className:"mb-6",children:[r.jsx("h1",{className:"text-lg font-semibold text-foreground",children:g}),r.jsxs("div",{className:"flex items-center gap-3 mt-1 text-sm text-muted-foreground",children:[r.jsx("span",{children:f}),r.jsx("span",{children:"·"}),r.jsxs("span",{children:[o.messageCount," 条消息"]})]})]}),r.jsxs("div",{className:"space-y-4",children:[0===o.messages.length&&r.jsx("p",{className:"text-xs text-muted-foreground text-center py-8",children:"本次会话暂无记录"}),o.messages.map((e,s)=>r.jsxs("div",{className:a("flex gap-2.5","user"===e.role?"flex-row-reverse":"flex-row"),children:[r.jsx("div",{className:a("flex-shrink-0 w-7 h-7 rounded-full flex items-center justify-center mt-0.5","user"===e.role?"bg-blue-500/10":"bg-muted"),children:"user"===e.role?r.jsx(n,{className:"h-3.5 w-3.5 text-blue-400"}):r.jsx(c,{className:"h-3.5 w-3.5 text-muted-foreground"})}),r.jsx("div",{className:a("max-w-[85%] text-sm rounded-lg px-3 py-2 whitespace-pre-wrap break-words","user"===e.role?"bg-blue-500/10 text-blue-400":"bg-muted text-foreground"),children:e.content})]},s))]})]})})}export{l as ShareViewPage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as e,
|
|
1
|
+
import{c as e,ak as s,r as t,bc as a,bd as r,t as l,be as n,bf as i,bg as d,j as c,B as o,al as m,b as x,I as u,T as h,v as p,D as g,a5 as f,A as j,bh as b}from"./index-CeIo8jzU.js";import{S as N}from"./search-DboZ70b5.js";import{U as v}from"./user-D94-hxj0.js";import{C as y}from"./chevron-down-wfOXaRaa.js";
|
|
2
2
|
/**
|
|
3
3
|
* @license lucide-react v0.309.0 - ISC
|
|
4
4
|
*
|
|
@@ -10,4 +10,4 @@ import{c as e,ah as s,r as t,b9 as a,ba as r,t as n,bb as l,bc as i,bd 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,z]=t.useState([]),[L,M]=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])=>{z(e),M(s)}).finally(()=>H(!1)))},[S]);const F=t.useCallback(async e=>{if(!I){P(e.id);try{await r(e.downloadUrl),n.success(`已安装 ${e.name}`);const s=await a().catch(()=>[]);z(s)}catch(s){n.error(s instanceof Error?s.message:"安装失败")}finally{P(null)}}},[I]),D=t.useCallback(async e=>{try{await l(e),z(s=>s.filter(s=>s.id!==e)),n.success("已卸载")}catch(s){n.error(s instanceof Error?s.message:"卸载失败")}},[]),O=t.useCallback(async(e,s)=>{try{await i(e,s),z(t=>t.map(t=>t.id===e?{...t,enabled:s}:t))}catch(t){n.error(t instanceof Error?t.message:"操作失败")}},[]),[T,U]=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(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__"===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},[T,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(k,{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:()=>O(e.id,!e.enabled),title:e.enabled?"禁用":"启用",children:c.jsx(w,{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===L.length&&c.jsxs("div",{className:"text-center text-muted-foreground py-20",children:[c.jsx(k,{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:L.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===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),l=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(C,{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(v,{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:l||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){n.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?"已下载":l?"下载中...":"下载"]}),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,z]=t.useState([]),[L,M]=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])=>{z(e),M(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(()=>[]);z(s)}catch(s){l.error(s instanceof Error?s.message:"安装失败")}finally{P(null)}}},[I]),D=t.useCallback(async e=>{try{await n(e),z(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),z(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),[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(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__"===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},[T,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(k,{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:()=>O(e.id,!e.enabled),title:e.enabled?"禁用":"启用",children:c.jsx(w,{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===L.length&&c.jsxs("div",{className:"text-center text-muted-foreground py-20",children:[c.jsx(k,{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:L.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===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(C,{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(v,{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};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{c as t,r as n}from"./index-CeIo8jzU.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license lucide-react v0.309.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/const a=t("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);var o=n.createContext(void 0);function e(t){const a=n.useContext(o);return t||a||"ltr"}function r(t,[n,a]){return Math.min(a,Math.max(n,t))}export{a as S,r as c,e as u};
|