@mrpatronz/nexusflow 2.3.1 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +15 -1
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/open.d.ts.map +1 -1
- package/dist/commands/open.js +66 -21
- package/dist/commands/open.js.map +1 -1
- package/dist/core/refresh.d.ts.map +1 -1
- package/dist/core/refresh.js +31 -0
- package/dist/core/refresh.js.map +1 -1
- package/dist/core/workspace.d.ts.map +1 -1
- package/dist/core/workspace.js +34 -13
- package/dist/core/workspace.js.map +1 -1
- package/dist/gui/antigravity-logo.png +0 -0
- package/dist/gui/assets/AgentsPage-BNHR9qux.js +3 -0
- package/dist/gui/assets/CSPContext-BG7no5S_.js +1 -0
- package/dist/gui/assets/DashboardPage-BScH3Cxp.js +1 -0
- package/dist/gui/assets/{GettingStartedPage-BJvrh67p.js → GettingStartedPage-AWlI-176.js} +1 -1
- package/dist/gui/assets/ProjectsPage-Bojj7gxI.js +1 -0
- package/dist/gui/assets/ScaffoldRepoInline-DJMbeHVM.js +1 -0
- package/dist/gui/assets/SettingsPage-BAdXO8X0.js +1 -0
- package/dist/gui/assets/SkillsPage-CF6Db1FA.js +6 -0
- package/dist/gui/assets/StartWorkPage-BQid3uIw.js +1 -0
- package/dist/gui/assets/{StrategiesPage-CWMrYI29.js → StrategiesPage-nGbR9TAc.js} +2 -2
- package/dist/gui/assets/WorkspacesPage-7XRtVJNF.js +2 -0
- package/dist/gui/assets/{alert-dialog-CroDe9HW.js → alert-dialog-67uzXJi4.js} +1 -1
- package/dist/gui/assets/antigravity-logo-DRKQga2U.png +0 -0
- package/dist/gui/assets/{badge-BnkhqVEF.js → badge-CAohJGj6.js} +1 -1
- package/dist/gui/assets/{bot-wH0FKlic.js → bot-C2HWrAft.js} +1 -1
- package/dist/gui/assets/{button-cPldH5S4.js → button-BDDZnIHx.js} +1 -1
- package/dist/gui/assets/card-BKXzd_5L.js +1 -0
- package/dist/gui/assets/chevron-down-qTL8HPug.js +1 -0
- package/dist/gui/assets/{circle-plus-C0PNc7h4.js → circle-plus-lmU1yNJd.js} +1 -1
- package/dist/gui/assets/{code-xml-Chu1p81J.js → code-xml-jFAa3-TT.js} +1 -1
- package/dist/gui/assets/{cpu-CPUNnHRM.js → cpu-Cdwd84Jz.js} +1 -1
- package/dist/gui/assets/{empty-DWyDwDYB.js → empty-BdlgbifD.js} +1 -1
- package/dist/gui/assets/{git-branch-Dw55pQWa.js → git-branch-Cfj9D8yW.js} +1 -1
- package/dist/gui/assets/index-CZoZQkeC.css +2 -0
- package/dist/gui/assets/index-V1dDX1O_.js +50 -0
- package/dist/gui/assets/isElementDisabled-D_fu2zfc.js +1 -0
- package/dist/gui/assets/{label-JFgMNsTn.js → label-CG5exjag.js} +1 -1
- package/dist/gui/assets/square-DlIYnlSq.js +1 -0
- package/dist/gui/assets/store-D7ixdVck.js +3 -0
- package/dist/gui/assets/styles-CVwNuFCx.js +1 -0
- package/dist/gui/assets/textarea-BNRuIXNs.js +1 -0
- package/dist/gui/assets/{trash-2-Da8F2gKd.js → trash-2-CtR35_eF.js} +1 -1
- package/dist/gui/assets/useAriaLabelledBy-DfRdwH8a.js +1 -0
- package/dist/gui/assets/useValueChanged-CStSGSsD.js +1 -0
- package/dist/gui/assets/vsc-Di05BTNr.js +1 -0
- package/dist/gui/assets/{zap-FQrDnrgb.js → zap-CWG_Lvki.js} +1 -1
- package/dist/gui/index.html +9 -7
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +129 -22
- package/dist/server.js.map +1 -1
- package/dist/server.test.js +178 -6
- package/dist/server.test.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/detect-editors.d.ts +1 -7
- package/dist/utils/detect-editors.d.ts.map +1 -1
- package/dist/utils/detect-editors.js +12 -10
- package/dist/utils/detect-editors.js.map +1 -1
- package/dist/utils/detect-editors.test.js +58 -25
- package/dist/utils/detect-editors.test.js.map +1 -1
- package/dist/utils/open-editor.d.ts +1 -1
- package/dist/utils/open-editor.d.ts.map +1 -1
- package/dist/utils/open-editor.js +11 -2
- package/dist/utils/open-editor.js.map +1 -1
- package/dist/utils/prompts.d.ts +5 -1
- package/dist/utils/prompts.d.ts.map +1 -1
- package/dist/utils/prompts.js +16 -0
- package/dist/utils/prompts.js.map +1 -1
- package/dist/utils/session-finder.d.ts +9 -0
- package/dist/utils/session-finder.d.ts.map +1 -1
- package/dist/utils/session-finder.js +108 -48
- package/dist/utils/session-finder.js.map +1 -1
- package/dist/utils/session-finder.test.js +105 -1
- package/dist/utils/session-finder.test.js.map +1 -1
- package/dist/utils/terminal-launch.d.ts +39 -0
- package/dist/utils/terminal-launch.d.ts.map +1 -0
- package/dist/utils/terminal-launch.js +205 -0
- package/dist/utils/terminal-launch.js.map +1 -0
- package/dist/utils/terminal-launch.test.d.ts +2 -0
- package/dist/utils/terminal-launch.test.d.ts.map +1 -0
- package/dist/utils/terminal-launch.test.js +117 -0
- package/dist/utils/terminal-launch.test.js.map +1 -0
- package/dist/utils/workspace-launch.d.ts.map +1 -1
- package/dist/utils/workspace-launch.js +3 -1
- package/dist/utils/workspace-launch.js.map +1 -1
- package/package.json +1 -1
- package/dist/gui/assets/AgentsPage-C7wGK7q-.js +0 -3
- package/dist/gui/assets/DashboardPage-DqZRdOF3.js +0 -1
- package/dist/gui/assets/ProjectsPage-B0VFV1vX.js +0 -1
- package/dist/gui/assets/ScaffoldRepoInline-DSt_6QLb.js +0 -1
- package/dist/gui/assets/Separator-Chx6O62Y.js +0 -1
- package/dist/gui/assets/SettingsPage-DO5HasvS.js +0 -1
- package/dist/gui/assets/SkillsPage-CvRIKdsQ.js +0 -6
- package/dist/gui/assets/StartWorkPage-CK5QF6Oa.js +0 -1
- package/dist/gui/assets/WorkspaceLauncher-EIY_u44S.js +0 -1
- package/dist/gui/assets/WorkspacesPage-CHUfqrA6.js +0 -6
- package/dist/gui/assets/card-82INhRRE.js +0 -1
- package/dist/gui/assets/chevron-down-DDmhvRLr.js +0 -1
- package/dist/gui/assets/index-Bq5NL5AJ.css +0 -2
- package/dist/gui/assets/index-CcIOIZ24.js +0 -52
- package/dist/gui/assets/search-ChVovkOL.js +0 -1
- package/dist/gui/assets/skeleton-CCPbfn1L.js +0 -1
- package/dist/gui/assets/spinner-BCEaGbib.js +0 -1
- package/dist/gui/assets/terminal-gK6BMl3E.js +0 -1
- package/dist/gui/assets/textarea-D3-elOAa.js +0 -1
- package/dist/gui/assets/useAriaLabelledBy-DmwmZIqb.js +0 -1
- package/dist/gui/assets/useCompositeListItem-CZnlZ-eF.js +0 -1
- package/dist/gui/assets/useValueChanged-BfI2s7NX.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,b as t,c as n,f as r,g as i,i as a,p as o,s}from"./button-BDDZnIHx.js";import{$t as c,Bt as l,Cn as u,Dn as d,En as f,Et as p,Ft as m,Gt as h,Ht as g,It as _,Ln as v,Lt as y,Mt as b,Nn as x,Nt as S,O as C,Qn as w,Rt as T,Sn as E,Tn as D,Tt as ee,Ut as O,V as te,Vt as k,Wn as A,Wt as ne,Zt as j,_n as re,_t as ie,bn as M,bt as ae,dn as N,f as P,fn as F,gn as I,gt as oe,hn as se,in as ce,kt as le,ln as L,lt as ue,mn as de,nn as R,nt as fe,ot as pe,pn as z,qn as me,qt as B,tn as V,tt as he,u as ge,un as H,vn as U,vt as _e,wn as ve,xn as W,xt as G,yn as K,yt as q,zt as ye}from"./CSPContext-BG7no5S_.js";import{t as be}from"./useValueChanged-CStSGSsD.js";var J=t(e(),1),xe=J.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function Se(){return J.useContext(xe)}var Ce=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function we(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=Se(),f=J.useRef(-1),[p,m]=J.useState(a??(i===Ce.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=J.useRef(null),g=J.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return L(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),L(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),{ref:g,index:p}}var Te=[`top`,`right`,`bottom`,`left`],Ee=Math.min,Y=Math.max,X=Math.round,De=Math.floor,Z=e=>({x:e,y:e}),Oe={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ke(e,t,n){return Y(e,Ee(t,n))}function Ae(e,t){return typeof e==`function`?e(t):e}function Q(e){return e.split(`-`)[0]}function je(e){return e.split(`-`)[1]}function Me(e){return e===`x`?`y`:`x`}function Ne(e){return e===`y`?`height`:`width`}function $(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Pe(e){return Me($(e))}function Fe(e,t,n){n===void 0&&(n=!1);let r=je(e),i=Pe(e),a=Ne(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=We(o)),[o,We(o)]}function Ie(e){let t=We(e);return[Le(e),t,Le(t)]}function Le(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Re=[`left`,`right`],ze=[`right`,`left`],Be=[`top`,`bottom`],Ve=[`bottom`,`top`];function He(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ze:Re:t?Re:ze;case`left`:case`right`:return t?Be:Ve;default:return[]}}function Ue(e,t,n,r){let i=je(e),a=He(Q(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Le)))),a}function We(e){let t=Q(e);return Oe[t]+e.slice(t.length)}function Ge(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Ke(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ge(e)}function qe(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Je(e,t={}){let{enabled:r=!0,event:i=`click`,toggle:a=!0,ignoreMouse:o=!1,stickIfOpen:s=!0,touchOpenDelay:l=0,reason:u=A}=t,d=`rootStore`in e?e.rootStore:e,f=d.context.dataRef,p=J.useRef(void 0),m=j(),h=B(),_=J.useMemo(()=>{function e(e,t,n,r){let i=c(u,t,n);e&&r===`touch`&&l>0?h.start(l,()=>{d.setOpen(!0,i)}):d.setOpen(e,i)}function t(e,t,n){let r=f.current.openEvent,i=d.select(`domReferenceElement`)!==t;return e&&i||!e||!a?!0:r&&s?!n(r.type):!1}return{onPointerDown(e){p.current=e.pointerType},onMouseDown(n){let r=p.current,a=n.nativeEvent,s=d.select(`open`);if(n.button!==0||i===`click`||g(r,!0)&&o)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),l=y(a);if(S(l)){e(c,a,l,r);return}let u=n.currentTarget;m.request(()=>{e(c,a,u,r)})},onClick(n){if(i===`mousedown-only`)return;let r=p.current;if(i===`mousedown`&&r){p.current=void 0;return}g(r,!0)&&o||e(t(d.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,r)},onKeyDown(){p.current=void 0}}},[f,i,o,u,d,s,a,m,h,l]);return J.useMemo(()=>r?{reference:_}:n,[r,_])}function Ye(e,t,n){let{reference:r,floating:i}=e,a=$(t),o=Pe(t),s=Ne(o),c=Q(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=je(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Xe(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Ae(t,e),p=Ke(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=qe(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=qe(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ze=50,Qe=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Xe},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ye(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ze&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Ye(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},$e=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Ae(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Q(r),_=$(o),v=Q(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[We(o)]:Ie(o)),x=p!==`none`;!d&&x&&b.push(...Ue(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Fe(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==$(t))||T.every(e=>$(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=$(e.placement);return t===_||t===`y`}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]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function et(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tt(e){return Te.some(t=>e[t]>=0)}var nt=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Ae(e,t);switch(i){case`referenceHidden`:{let e=et(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:tt(e)}}}case`escaped`:{let e=et(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:tt(e)}}}default:return{}}}}},rt=new Set([`left`,`top`]);async function it(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Q(n),s=je(n),c=$(n)===`y`,l=rt.has(o)?-1:1,u=a&&c?-1:1,d=Ae(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var at=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await it(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ot=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Ae(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=$(i),p=Me(f),m=u[p],h=u[f],g=(e,t)=>ke(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},st=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Ae(e,t),u={x:n,y:r},d=$(i),f=Me(d),p=u[f],m=u[d],h=Ae(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=rt.has(Q(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ct=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Ae(e,t),c=await i.detectOverflow(t,s),l=Q(n),u=je(n),d=$(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Ee(p-c[m],g),y=Ee(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Y(c.left,c.right):S=p-2*Y(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function lt(e){let t=N(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=E(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=X(n)!==a||X(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ut(e){return W(e)?e:e.contextElement}function dt(e){let t=ut(e);if(!E(t))return Z(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=lt(t),o=(a?X(n.width):n.width)/r,s=(a?X(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ft=Z(0);function pt(e){let t=K(e);return!d()||!t.visualViewport?ft:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===K(e)}function ht(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ut(e),o=Z(1);t&&(r?W(r)&&(o=dt(r)):o=dt(e));let s=mt(a,n,r)?pt(a):Z(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=K(a),t=W(r)?K(r):r,n=e,i=de(n);for(;i&&t!==n;){let e=dt(i),t=i.getBoundingClientRect(),r=N(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=K(i),i=de(n)}}return qe({width:u,height:d,x:c,y:l})}function gt(e,t){let n=I(e).scrollLeft;return t?t.left+n:ht(z(e)).left+n}function _t(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-gt(e,n),y:n.top+t.scrollTop}}function vt(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=z(r),s=t?f(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Z(1),u=Z(0),d=E(r);if((d||!a)&&((se(r)!==`body`||ve(o))&&(c=I(r)),d)){let e=ht(r);l=dt(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let p=o&&!d&&!a?_t(o,c):Z(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:n.y*l.y-c.scrollTop*l.y+u.y+p.y}}function yt(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function bt(e){let t=I(e),n=e.ownerDocument.body,r=Y(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Y(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+gt(e),o=-t.scrollTop;return N(n).direction===`rtl`&&(a+=Y(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var xt=25;function St(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=K(e),a=z(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!d()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(gt(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=xt&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ct(e,t){let n=ht(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=dt(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function wt(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=St(e,n,t);else if(t===`document`)r=bt(z(e));else if(W(t))r=Ct(t,n);else{let n=pt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return qe(r)}function Tt(e,t){let n=t.get(e);if(n)return n;let r=re(e,[],!1).filter(e=>W(e)&&se(e)!==`body`),i=null,a=N(e).position===`fixed`,o=a?U(e):e;for(;W(o)&&!u(o);){let e=N(o),t=M(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=U(o)}return t.set(e,r),r}function Et(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?f(t)?[]:Tt(t,this._c):[].concat(n),r],o=wt(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=wt(t,a[e],i);s=Y(n.top,s),c=Ee(n.right,c),l=Ee(n.bottom,l),u=Y(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Dt(e){let{width:t,height:n}=lt(e);return{width:t,height:n}}function Ot(e,t,n){let r=E(t),i=z(t),a=n===`fixed`,o=ht(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Z(0);if((r||!a)&&((se(t)!==`body`||ve(i))&&(s=I(t)),r)){let e=ht(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=gt(i));let l=i&&!r&&!a?_t(i,s):Z(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function kt(e){return N(e).position===`static`}function At(e,t){if(!E(e)||N(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return z(e)===n&&(n=n.ownerDocument.body),n}function jt(e,t){let n=K(e);if(f(e))return n;if(!E(e)){let t=U(e);for(;t&&!u(t);){if(W(t)&&!kt(t))return t;t=U(t)}return n}let r=At(e,t);for(;r&&D(r)&&kt(r);)r=At(r,t);return r&&u(r)&&kt(r)&&!M(r)?n:r||F(e)||n}var Mt=async function(e){let t=this.getOffsetParent||jt,n=this.getDimensions,r=await n(e.floating);return{reference:Ot(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Nt(e){return N(e).direction===`rtl`}var Pt={convertOffsetParentRelativeRectToViewportRelativeRect:vt,getDocumentElement:z,getClippingRect:Et,getOffsetParent:jt,getElementRects:Mt,getClientRects:yt,getDimensions:Dt,getScale:dt,isElement:W,isRTL:Nt};function Ft(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function It(e,t,n){let r=null,i,a=z(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=De(d),h=De(a.clientWidth-(u+f)),g=De(a.clientHeight-(d+p)),_=De(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Y(0,Ee(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ft(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=K(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Lt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ut(e),u=i||a?[...l?re(l):[],...t?re(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?It(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?ht(e):null;c&&g();function g(){let t=ht(e);h&&!Ft(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Rt=at,zt=ot,Bt=$e,Vt=ct,Ht=nt,Ut=st,Wt=(e,t,n)=>{let r=new Map,i=n??{},a={...Pt,...i.platform,_c:r};return Qe(e,t,{...i,platform:a})},Gt=t(w(),1),Kt=typeof document<`u`?J.useLayoutEffect:function(){};function qt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!qt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!qt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Jt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yt(e,t){let n=Jt(e);return Math.round(t*n)/n}function Xt(e){let t=J.useRef(e);return Kt(()=>{t.current=e}),t}function Zt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=J.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=J.useState(r);qt(f,r)||p(r);let[m,h]=J.useState(null),[g,_]=J.useState(null),v=J.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=J.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=J.useRef(null),C=J.useRef(null),w=J.useRef(u),T=c!=null,E=Xt(c),D=Xt(i),ee=Xt(l),O=J.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Wt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:ee.current!==!1};te.current&&!qt(w.current,t)&&(w.current=t,Gt.flushSync(()=>{d(t)}))})},[f,t,n,D,ee]);Kt(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let te=J.useRef(!1);Kt(()=>(te.current=!0,()=>{te.current=!1}),[]),Kt(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,O);O()}},[b,x,O,E,T]);let k=J.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),A=J.useMemo(()=>({reference:b,floating:x}),[b,x]),ne=J.useMemo(()=>{let e={position:n,left:0,top:0};if(!A.floating)return e;let t=Yt(A.floating,u.x),r=Yt(A.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Jt(A.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,A.floating,u.x,u.y]);return J.useMemo(()=>({...u,update:O,refs:k,elements:A,floatingStyles:ne}),[u,O,k,A,ne])}var Qt=(e,t)=>{let n=Rt(e);return{name:n.name,fn:n.fn,options:[e,t]}},$t=(e,t)=>{let n=zt(e);return{name:n.name,fn:n.fn,options:[e,t]}},en=(e,t)=>({fn:Ut(e).fn,options:[e,t]}),tn=(e,t)=>{let n=Bt(e);return{name:n.name,fn:n.fn,options:[e,t]}},nn=(e,t)=>{let n=Vt(e);return{name:n.name,fn:n.fn,options:[e,t]}},rn=(e,t)=>{let n=Ht(e);return{name:n.name,fn:n.fn,options:[e,t]}};function an(e){let{open:t=!1,onOpenChange:n,elements:i={}}=e,a=V(),o=he()!=null,s=r(()=>new te({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:i.reference??null,floatingElement:i.floating??null,triggerElements:new C,floatingId:a,syncOnly:!1,nested:o})).current;return L(()=>{let e={open:t,floatingId:a};i.reference!==void 0&&(e.referenceElement=i.reference,e.domReferenceElement=W(i.reference)?i.reference:null),i.floating!==void 0&&(e.floatingElement=i.floating),s.update(e)},[t,a,i.reference,i.floating,s]),s.context.onOpenChange=n,s.context.nested=o,s}function on(e={}){let{nodeId:t,externalTree:n}=e,r=an(e),i=e.rootContext||r,a=i.useState(`referenceElement`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.useState(`open`),l=i.useState(`floatingId`),[u,d]=J.useState(null),[f,p]=J.useState(void 0),[m,h]=J.useState(void 0),g=J.useRef(null),_=fe(n),v=J.useMemo(()=>({reference:a,floating:o,domReference:s}),[a,o,s]),y=Zt({...e,elements:{...v,...u&&{reference:u}}}),b=W(f)?f:null,x=m===void 0?i.state.floatingElement:m;i.useSyncedValue(`referenceElement`,f??null),i.useSyncedValue(`domReferenceElement`,f===void 0?s:b),i.useSyncedValue(`floatingElement`,x);let S=J.useCallback(e=>{let t=W(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),y.refs.setReference(t)},[y.refs]),C=J.useCallback(e=>{(W(e)||e===null)&&(g.current=e,p(e)),(W(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!W(e))&&y.refs.setReference(e)},[y.refs,p]),w=J.useCallback(e=>{h(e),y.refs.setFloating(e)},[y.refs]),T=J.useMemo(()=>({...y.refs,setReference:C,setFloating:w,setPositionReference:S,domReference:g}),[y.refs,C,w,S]),E=J.useMemo(()=>({...y.elements,domReference:s}),[y.elements,s]),D=J.useMemo(()=>({...y,dataRef:i.context.dataRef,open:c,onOpenChange:i.setOpen,events:i.context.events,floatingId:l,refs:T,elements:E,nodeId:t,rootStore:i}),[y,T,E,t,i,c,l]);return L(()=>{s&&(g.current=s)},[s]),L(()=>{i.context.dataRef.current.floatingContext=D;let e=_?.nodesRef.current.find(e=>e.id===t);e&&(e.context=D)}),J.useMemo(()=>({...y,context:D,refs:T,elements:E,rootStore:i}),[y,T,E,D,i])}var sn=`Escape`;function cn(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function ln(e,t){return cn(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function un(e,t,n){return cn(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function dn(e,t,n){return cn(t,n?e===ye:e===l,e===T)}function fn(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===sn:cn(t,n?e===l:e===ye,e===k)}function pn(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:l=!1,nested:u=!1,rtl:d=!1,virtual:f=!1,focusItemOnOpen:g=`auto`,focusItemOnHover:S=!0,openOnArrowKeyDown:C=!0,disabledIndices:w=void 0,orientation:T=`vertical`,parentOrientation:D,id:te,resetOnPointerLeave:k=!0,externalTree:A,grid:re}=t,M=re!=null,N=`rootStore`in e?e.rootStore:e,P=N.useState(`open`),F=N.useState(`floatingElement`),I=N.useState(`domReferenceElement`),se=N.context.dataRef,ce=le(F),de=b(I),R=p(ce),pe=he(),z=fe(A),me=J.useRef(g),B=J.useRef(o??-1),V=J.useRef(null),ge=J.useRef(!0),U=H(e=>{i(B.current===-1?null:B.current,e)}),ve=J.useRef(!!F),W=J.useRef(P),G=J.useRef(!1),K=J.useRef(!1),q=J.useRef(null),ye=p(w),be=p(P),xe=p(o),Se=p(k),Ce=j(),we=j(),Te=H(()=>{function e(e){f?z?.events.emit(`virtualfocus`,e):q.current=ue(e,{sync:G.current,preventScroll:!0})}let t=n.current[B.current],r=K.current;t&&e(t),(G.current?e=>e():e=>Ce.request(e))(()=>{let i=n.current[B.current]||t;i&&(t||e(i),Oe&&(r||!ge.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});L(()=>{se.current.orientation=T},[se,T]),L(()=>{a&&(P&&F?(B.current=o??-1,me.current&&o!=null&&(K.current=!0,U())):ve.current&&(B.current=-1,U()))},[a,P,F,o,U]),L(()=>{if(a){if(!P){G.current=!1;return}if(F)if(r==null){if(G.current=!1,xe.current!=null)return;if(ve.current&&(B.current=-1,Te()),(!W.current||!ve.current)&&me.current&&(V.current!=null||me.current===!0&&V.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>we.request(e):queueMicrotask)(t),e+=1):(B.current=V.current==null||un(V.current,T,d)||u?_e(n):ie(n),V.current=null,U())};t()}}else ae(n.current,r)||(B.current=r,Te(),K.current=!1)}},[a,P,F,r,xe,u,n,T,d,U,Te,we]),L(()=>{if(!a||F||!z||f||!ve.current)return;let e=z.nodesRef.current,t=e.find(e=>e.id===pe)?.context?.elements.floating,n=m(ee(I??t??null)),r=e.some(e=>e.context&&_(e.context.elements.floating,n));t&&!r&&ge.current&&t.focus({preventScroll:!0})},[a,F,I,z,pe,f]),L(()=>{W.current=P,ve.current=!!F}),L(()=>{P||(V.current=null,me.current=g)},[P,g]);let Ee=r!=null,Y=H(e=>{if(!be.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(B.current!==t||r!==t)&&(B.current=t,U(e))}),X=H(()=>D??z?.nodesRef.current.find(e=>e.id===pe)?.context?.dataRef?.current.orientation),De=H(()=>_e(n,ye.current)),Z=H(e=>{if(ge.current=!1,G.current=!0,e.which===229||!be.current&&e.currentTarget===R.current)return;if(u&&fn(e.key,T,d,M)){ln(e.key,X())||h(e),N.setOpen(!1,c(v,e.nativeEvent)),E(I)&&(f?z?.events.emit(`virtualfocus`,I):I.focus());return}let t=B.current,r=_e(n,w),i=ie(n,w);if(de||(e.key===`Home`&&(h(e),B.current=r,U(e)),e.key===`End`&&(h(e),B.current=i,U(e))),re!=null){let t=re(e,B.current,n,T,l,d,w,r,i);if(t!=null&&(B.current=t,U(e)),T===`both`)return}if(ln(e.key,T)){if(h(e),P&&!f&&m(e.currentTarget.ownerDocument)===e.currentTarget){B.current=un(e.key,T,d)?r:i,U(e);return}un(e.key,T,d)?l?t>=i?s&&t!==n.current.length?B.current=-1:(G.current=!1,B.current=r):B.current=oe(n.current,{startingIndex:t,disabledIndices:w}):B.current=Math.min(i,oe(n.current,{startingIndex:t,disabledIndices:w})):l?t<=r?s&&t!==-1?B.current=n.current.length:(G.current=!1,B.current=i):B.current=oe(n.current,{startingIndex:t,decrement:!0,disabledIndices:w}):B.current=Math.max(r,oe(n.current,{startingIndex:t,decrement:!0,disabledIndices:w})),ae(n.current,B.current)&&(B.current=-1),U(e)}}),Oe=J.useMemo(()=>({onFocus(e){G.current=!0,Y(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){G.current=!0,K.current=!1,S&&Y(e)},onPointerLeave(e){if(!be.current||!ge.current||e.pointerType===`touch`)return;G.current=!0;let t=e.relatedTarget;if(!(!S||n.current.includes(t))&&Se.current&&(q.current?.(),q.current=null,B.current=-1,U(e),!f)){let e=R.current,t=m(ee(e));e&&_(e,t)&&e.focus({preventScroll:!0})}}}),[Y,be,R,S,n,U,Se,f]),ke=J.useMemo(()=>f&&P&&Ee&&{"aria-activedescendant":`${te}-${r}`},[f,P,Ee,te,r]),Ae=J.useMemo(()=>({"aria-orientation":T===`both`?void 0:T,...de?{}:ke,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&P&&!f){let t=y(e.nativeEvent);if(t&&!_(R.current,t))return;h(e),N.setOpen(!1,c(x,e.nativeEvent)),E(I)&&I.focus();return}Z(e)},onPointerMove(){ge.current=!0}}),[ke,Z,R,T,de,N,P,f,I]),Q=J.useMemo(()=>{function e(e){N.setOpen(!0,c(v,e.nativeEvent,e.currentTarget))}function t(e){g===`auto`&&O(e.nativeEvent)&&(me.current=!f)}function n(e){me.current=g,g===`auto`&&ne(e.nativeEvent)&&(me.current=!0)}return{onKeyDown(t){let n=N.select(`open`);ge.current=!1;let r=t.key.startsWith(`Arrow`),i=dn(t.key,X(),d),a=ln(t.key,T),o=(u?i:a)||t.key===`Enter`||t.key.trim()===``;if(f&&n)return Z(t);if(!(!n&&!C&&r)){if(o){let e=ln(t.key,X());V.current=u&&e?null:t.key}if(u){i&&(h(t),n?(B.current=De(),U(t)):e(t));return}a&&(xe.current!=null&&(B.current=xe.current),h(t),!n&&C?e(t):Z(t),n&&U(t))}},onFocus(e){N.select(`open`)&&!f&&(B.current=-1,U(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[Z,g,De,u,U,N,C,T,X,d,xe,f]),je=J.useMemo(()=>({...ke,...Q}),[ke,Q]);return J.useMemo(()=>a?{reference:je,floating:Ae,item:Oe,trigger:Q}:{},[a,je,Ae,Q,Oe])}function mn(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:c,enabled:l=!0,resetMs:u=750,selectedIndex:d=null}=t,f=`rootStore`in e?e.rootStore:e,p=f.useState(`open`),m=B(),g=J.useRef(``),v=J.useRef(d??i??-1),y=J.useRef(null),b=H(e=>{function t(e){let t=r?.current[e];return!t||q(t)}function l(e){return t(e)?o==null||!G(s,e,o):!1}function f(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(!(!e[n]?.toLowerCase().startsWith(i)||!l(n)))return n}return-1}let _=n.current;if(g.current.length>0&&e.key===` `&&(h(e),c?.(!0)),g.current.length>0&&g.current[0]!==` `&&f(_,g.current)===-1&&e.key!==` `&&c?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;p&&e.key!==` `&&(h(e),c?.(!0));let b=g.current===``;b&&(v.current=d??i??-1),_.every((e,t)=>e&&l(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&g.current===e.key&&(g.current=``,v.current=y.current),g.current+=e.key,m.start(u,()=>{g.current=``,v.current=y.current,c?.(!1)});let x=((b?d??i??-1:v.current)??0)+1,S=f(_,g.current,x);S===-1?e.key!==` `&&(g.current=``,c?.(!1)):(a?.(S),y.current=S)}),x=H(e=>{let t=e.relatedTarget,n=f.select(`domReferenceElement`),r=f.select(`floatingElement`);_(n,t)||_(r,t)||(m.clear(),g.current=``,v.current=y.current,c?.(!1))});L(()=>{!p&&d!==null||(m.clear(),y.current=null,g.current!==``&&(g.current=``))},[p,d,m]),L(()=>{p&&g.current===``&&(v.current=d??i??-1)},[p,d,i]);let S=J.useMemo(()=>({onKeyDown:b,onBlur:x}),[b,x]);return J.useMemo(()=>l?{reference:S,floating:S}:{},[l,S])}var hn=J.createContext(void 0);function gn(e){let t=J.useContext(hn);if(t===void 0&&!e)throw Error(o(69));return t}var _n=i();function vn(e){return e===`starting`?pe:n}var yn=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=Ae(e,t)||{};if(l==null)return{};let f=Ke(u),p={x:n,y:r},m=Pe(i),h=Ne(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),ee=Math.min(f[y],E),O=D,te=w-g[h]-ee,k=w/2-g[h]/2+T,A=ke(O,k,te),ne=!c.arrow&&je(i)!=null&&k!==A&&a.reference[h]/2-(k<O?D:ee)-g[h]/2<0,j=ne?k<O?k-O:k-te:0;return{[m]:p[m]+j,data:{[m]:A,centerOffset:k-A-j,...ne&&{alignmentOffset:j}},reset:ne}}}),bn=(e,t)=>({...yn(e),options:[e,t]}),xn=rn().fn,Sn={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await xn(e)).data?.referenceHidden||a}}}},Cn={sideX:`left`,sideY:`top`},wn={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=K(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:Cn};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=ee(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=Q(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:Cn.sideX,g=f===`top`?`bottom`:Cn.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function Tn(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function En(e,t,n){let{rects:r,placement:i}=e;return{side:Tn(t,Q(i),n),align:je(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Dn(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,inline:f,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shiftCrossAxis:v=!1,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,[C,w]=J.useState(null);!g&&C!==null&&w(null);let T=_.side||`flip`,E=_.align||`flip`,D=_.fallbackAxisSide||`end`,O=typeof t==`function`?t:void 0,te=H(O),k=O?te:t,A=p(t),ne=p(g),j=P()===`rtl`,re=C||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":j?`left`:`right`,"inline-start":j?`right`:`left`}[r],ie=a===`center`?re:`${re}-${a}`,M=c,ae=+(r===`bottom`),N=+(r===`top`),F=+(r===`right`),I=+(r===`left`);typeof M==`number`?M={top:M+ae,right:M+I,bottom:M+N,left:M+F}:M&&={top:(M.top||0)+ae,right:(M.right||0)+I,bottom:(M.bottom||0)+N,left:(M.left||0)+F};let oe={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:M},se=J.useRef(null),ce=p(i),le=p(o),ue=typeof i==`function`?0:i,de=typeof o==`function`?0:o,R=[];f&&R.push(f),R.push(Qt(e=>{let t=En(e,r,j),n=typeof ce.current==`function`?ce.current(t):ce.current,i=typeof le.current==`function`?le.current(t):le.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[ue,de,j,r]));let fe=E===`none`&&T!==`shift`,pe=!fe&&(l||v||T===`shift`),z=T===`none`?null:tn({...oe,padding:{top:M.top+1,right:M.right+1,bottom:M.bottom+1,left:M.left+1},mainAxis:!v&&T===`flip`,crossAxis:E===`flip`&&`alignment`,fallbackAxisSideDirection:D}),me=fe?null:$t(e=>{let t=ee(e.elements.floating).documentElement;return{...oe,rootBoundary:v?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:E!==`none`,crossAxis:pe,limiter:l||v?void 0:en(e=>{if(!se.current)return{};let{width:t,height:n}=se.current.getBoundingClientRect(),r=$(Q(e.placement)),i=r===`y`?t:n,a=r===`y`?M.left+M.right:M.top+M.bottom;return{offset:i/2+a/2}})}},[oe,l,v,M,E]);T===`shift`||E===`shift`||a===`center`?R.push(me,z):R.push(z,me),R.push(nn({...oe,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!ne.current)return;let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=K(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),bn(e=>({element:se.current||ee(e.elements.floating).createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=Q(a),l=$(c),u=se.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(En(e,r,j)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,pe&&l===`y`&&b?S:x),{}}},Sn,b),L(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let B=J.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:V,elements:he,x:ge,y:U,middlewareData:_e,update:ve,placement:W,context:G,isPositioned:q,floatingStyles:ye}=on({rootContext:h,open:m?g:void 0,placement:ie,middleware:R,strategy:n,whileElementsMounted:m?void 0:(...e)=>Lt(...e,B),nodeId:y,externalTree:S}),{sideX:be,sideY:xe}=_e.adaptiveOrigin||Cn,Se=q?n:`fixed`,Ce=J.useMemo(()=>{let e=b?{position:Se,[be]:ge,[xe]:U}:{position:Se,...ye};return q||(e.opacity=0),e},[b,Se,be,ge,xe,U,ye,q]),we=J.useRef(null);L(()=>{if(!g)return;let e=A.current,t=typeof e==`function`?e():e,n=(On(t)?t.current:t)||null;n!==we.current&&(V.setPositionReference(n),we.current=n)},[g,V,k,A]),J.useEffect(()=>{if(!g)return;let e=A.current;typeof e!=`function`&&On(e)&&e.current!==we.current&&(V.setPositionReference(e.current),we.current=e.current)},[g,V,k,A]),J.useEffect(()=>{if(m&&g&&he.reference&&he.floating)return Lt(he.reference,he.floating,ve,B)},[m,g,he,ve,B]);let Te=Q(W),Ee=Tn(r,Te,j),Y=je(W)||`center`,X=!!_e.hide?.referenceHidden;L(()=>{x&&g&&q&&w(Te)},[x,g,q,Te]);let De=J.useMemo(()=>({position:`absolute`,top:_e.arrow?.y,left:_e.arrow?.x}),[_e.arrow]),Z=_e.arrow?.centerOffset!==0;return J.useMemo(()=>({positionerStyles:Ce,arrowStyles:De,arrowRef:se,arrowUncentered:Z,side:Ee,align:Y,physicalSide:Te,anchorHidden:X,refs:V,context:G,isPositioned:q,update:ve}),[Ce,De,se,Z,Ee,Y,Te,X,V,G,q,ve])}function On(e){return e!=null&&`current`in e}function kn(e){let{children:t,elementsRef:n,labelsRef:i,onMapChange:a}=e,o=H(a),s=J.useRef(0),c=r(jn).current,l=r(An).current,[u,d]=J.useState(0),f=J.useRef(u),p=H((e,t)=>{l.set(e,t??null),f.current+=1,d(f.current)}),m=H(e=>{l.delete(e),f.current+=1,d(f.current)}),h=J.useMemo(()=>{let e=new Map;return Array.from(l.keys()).filter(e=>e.isConnected).sort(Mn).forEach((t,n)=>{let r=l.get(t)??{};e.set(t,{...r,index:n})}),e},[l,u]);L(()=>{if(typeof MutationObserver!=`function`||h.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(f.current+=1,d(f.current))});return h.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[h]),L(()=>{f.current===u&&(n.current.length!==h.size&&(n.current.length=h.size),i&&i.current.length!==h.size&&(i.current.length=h.size),s.current=h.size),o(h)},[o,h,n,i,u]),L(()=>()=>{n.current=[]},[n]),L(()=>()=>{i&&(i.current=[])},[i]);let g=H(e=>(c.add(e),()=>{c.delete(e)}));L(()=>{c.forEach(e=>e(h))},[c,h]);let _=J.useMemo(()=>({register:p,unregister:m,subscribeMapChange:g,elementsRef:n,labelsRef:i,nextIndexRef:s}),[p,m,g,n,i,s]);return(0,_n.jsx)(xe.Provider,{value:_,children:t})}function An(){return new Map}function jn(){return new Set}function Mn(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function Nn(e,t,{styles:n,transitionStatus:r,props:i,refs:o,hidden:s,inert:c=!1}){let l={...n};return c&&(l.pointerEvents=`none`),a(`div`,e,{state:t,ref:o,props:[{role:`presentation`,hidden:s,style:l},vn(r),i],stateAttributesMapping:me})}var Pn=20;function Fn(e,t,n,r){let[i,a]=J.useState(!1);L(()=>{if(!e||!t||n==null){a(!1);return}let r=ee(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Pn)},[e,t,n]),ge(e&&(!t||i),r)}function In(e){let t=J.useRef(``),n=J.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:J.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function Ln(e,t){let{onClick:n,onPointerDown:r}=In(H((n,r)=>{(typeof e==`function`?e():e)||t(r||(ce?`touch`:``))}));return J.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Rn(e){let[t,n]=J.useState(null),r=Ln(e,n);return be(e,t=>{t&&!e&&n(null)}),J.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function zn(e){let t=e.getBoundingClientRect(),n=K(e);if(R)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(!(r.content!==`none`||i.content!==`none`))return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function Bn(e){let[t,n]=J.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}function Vn(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}export{Je as _,Ln as a,Ce as b,kn as c,vn as d,gn as f,Pt as g,an as h,Rn as i,Dn as l,pn as m,Bn as n,Fn as o,mn as p,zn as r,Nn as s,Vn as t,wn as u,qe as v,we as x,X as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as e,
|
|
1
|
+
import{m as e,o as t,r as n}from"./button-BDDZnIHx.js";function r({className:r,render:i,...a}){return n({defaultTagName:`label`,props:t({className:e(`inline-flex items-center gap-2 text-base/4.5 sm:text-sm/4 font-medium text-foreground`,r),"data-slot":`label`},a),render:i})}export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e}from"./button-BDDZnIHx.js";var t=e(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),n=e(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),r=e(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),i=e(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),a=e(`git-pull-request`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]),o=e(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),s=e(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),c=e(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),l=e(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),u=e(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]);export{o as a,r as c,s as i,n as l,l as n,a as o,c as r,i as s,u as t,t as u};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{_ as e,b as t,c as n,h as r}from"./button-BDDZnIHx.js";import{J as i,O as a,V as o}from"./CSPContext-BG7no5S_.js";var s=r(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),c=r(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),l=t(e(),1),u=`modulepreload`,d=function(e){return`/`+e},f={},p=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=d(t,n),t=s(t),t in f)return;f[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:u,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},m=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,h=/^[\\/]{2}/;function g(e,t){return t+e.replace(/\\/g,`/`)}var _=`popstate`;function v(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function y(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=E(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),w(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:T(t))}function r(e,t){x(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return ee(t,n,r,e)}function b(e,t){if(e===!1||e==null)throw Error(t)}function x(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function S(){return Math.random().toString(36).substring(2,10)}function C(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function w(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?E(t):t,state:n,key:t&&t.key||r||S(),mask:i}}function T({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function E(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function ee(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=v(e)?e:w(h.location,e,t);n&&n(r,e),l=u()+1;let d=C(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=v(e)?e:w(h.location,e,t);n&&n(r,e),l=u();let i=C(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return te(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(_,d),c=e,()=>{i.removeEventListener(_,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function te(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),b(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:T(t);return i=i.replace(/ $/,`%20`),!n&&h.test(i)&&(i=r+i),new URL(i,r)}function D(e,t,n=`/`){return ne(e,t,n,!1)}function ne(e,t,n,r,i){let a=k((typeof t==`string`?E(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ie(e),s=null,c=be(a);for(let e=0;s==null&&e<o.length;++e)s=_e(o[e],c,r);return s}function re(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function ie(e){let t=ae(e);return se(t),t}function ae(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;b(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=N([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(b(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ae(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:he(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=ye(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of oe(e.path))a(e,t,!0,n)}),t}function oe(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=oe(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function se(e){e.sort((e,t)=>e.score===t.score?ge(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ce=/^:[\w-]+$/,le=3,ue=2,de=1,fe=10,pe=-2,me=e=>e===`*`;function he(e,t){let n=e.split(`/`),r=n.length;return n.some(me)&&(r+=pe),t&&(r+=ue),n.filter(e=>!me(e)).reduce((e,t)=>e+(ce.test(t)?le:t===``?de:fe),r)}function ge(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function _e(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?ve(u,l,s.matcher,s.compiledParams):O(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=O({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:N([a,d.pathname]),pathnameBase:Te(N([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=N([a,d.pathnameBase]))}return o}function O(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ye(e.path,e.caseSensitive,e.end);return ve(e,t,n,r)}function ve(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function ye(e,t=!1,n=!0){x(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function be(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return x(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function k(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function xe(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?E(e):e,a;return n?(n=we(n),a=n.startsWith(`/`)?Se(n.substring(1),`/`):Se(n,t)):a=t,{pathname:a,search:Ee(r),hash:De(i)}}function Se(e,t){let n=P(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function A(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ce(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function j(e){let t=Ce(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function M(e,t,n,r=!1){let i;typeof e==`string`?i=E(e):(i={...e},b(!i.pathname||!i.pathname.includes(`?`),A(`?`,`pathname`,`search`,i)),b(!i.pathname||!i.pathname.includes(`#`),A(`#`,`pathname`,`hash`,i)),b(!i.search||!i.search.includes(`#`),A(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=xe(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var we=e=>e.replace(/[\\/]{2,}/g,`/`),N=e=>we(e.join(`/`)),P=e=>e.replace(/\/+$/,``),Te=e=>P(e).replace(/^\/*/,`/`),Ee=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,De=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Oe=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ke(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ae(e){return N(e.map(e=>e.route.path).filter(Boolean))||`/`}var je=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Me(e,t){let n=e;if(typeof n!=`string`||!m.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(je)try{let e=new URL(window.location.href),r=h.test(n)?new URL(g(n,e.protocol)):new URL(n),a=k(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{x(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Ne=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Ne);var Pe=[`GET`,...Ne];new Set(Pe);var Fe=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Ie(e){try{return Fe.includes(new URL(e).protocol)}catch{return!1}}var F=l.createContext(null);F.displayName=`DataRouter`;var I=l.createContext(null);I.displayName=`DataRouterState`;var Le=l.createContext(!1);function Re(){return l.useContext(Le)}var ze=l.createContext({isTransitioning:!1});ze.displayName=`ViewTransition`;var Be=l.createContext(new Map);Be.displayName=`Fetchers`;var Ve=l.createContext(null);Ve.displayName=`Await`;var L=l.createContext(null);L.displayName=`Navigation`;var R=l.createContext(null);R.displayName=`Location`;var z=l.createContext({outlet:null,matches:[],isDataRoute:!1});z.displayName=`Route`;var He=l.createContext(null);He.displayName=`RouteError`;var Ue=`REACT_ROUTER_ERROR`,We=`REDIRECT`,Ge=`ROUTE_ERROR_RESPONSE`;function Ke(e){if(e.startsWith(`${Ue}:${We}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function qe(e){if(e.startsWith(`${Ue}:${Ge}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Oe(t.status,t.statusText,t.data)}catch{}}function Je(e,{relative:t}={}){b(B(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=l.useContext(L),{hash:i,pathname:a,search:o}=U(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:N([n,a])),r.createHref({pathname:s,search:o,hash:i})}function B(){return l.useContext(R)!=null}function V(){return b(B(),`useLocation() may be used only in the context of a <Router> component.`),l.useContext(R).location}var Ye=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Xe(e){l.useContext(L).static||l.useLayoutEffect(e)}function H(){let{isDataRoute:e}=l.useContext(z);return e?gt():Ze()}function Ze(){b(B(),`useNavigate() may be used only in the context of a <Router> component.`);let e=l.useContext(F),{basename:t,navigator:n}=l.useContext(L),{matches:r}=l.useContext(z),{pathname:i}=V(),a=JSON.stringify(j(r)),o=l.useRef(!1);return Xe(()=>{o.current=!0}),l.useCallback((r,s={})=>{if(x(o.current,Ye),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=M(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:N([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}l.createContext(null);function U(e,{relative:t}={}){let{matches:n}=l.useContext(z),{pathname:r}=V(),i=JSON.stringify(j(n));return l.useMemo(()=>M(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Qe(e,t){return $e(e,t)}function $e(e,t,n){b(B(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=l.useContext(L),{matches:i}=l.useContext(z),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,u=a&&a.route;{let e=u&&u.path||``;vt(s,!u||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
2
|
+
|
|
3
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=V(),f;if(t){let e=typeof t==`string`?E(t):t;b(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=d;let p=f.pathname||`/`,m=p;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);m=`/`+p.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let h=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):D(e,{pathname:m});x(u||h!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),x(h==null||h[h.length-1].route.element!==void 0||h[h.length-1].route.Component!==void 0||h[h.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=ot(h&&h.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:N([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:N([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&g?l.createElement(R.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},g):g}function et(){let e=ht(),t=ke(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=l.createElement(l.Fragment,null,l.createElement(`p`,null,`💿 Hey developer 👋`),l.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,l.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,l.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),l.createElement(l.Fragment,null,l.createElement(`h2`,null,`Unexpected Application Error!`),l.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?l.createElement(`pre`,{style:i},n):null,o)}var tt=l.createElement(et,null),nt=class extends l.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=qe(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:l.createElement(z.Provider,{value:this.props.routeContext},l.createElement(He.Provider,{value:e,children:this.props.component}));return this.context?l.createElement(it,{error:e},t):t}};nt.contextType=Le;var rt=new WeakMap;function it({children:e,error:t}){let{basename:n}=l.useContext(L);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Ke(t.digest);if(e){let r=rt.get(t);if(r)throw r;let i=Me(e.location,n),a=i.absoluteURL||i.to;if(Ie(a))throw Error(`Invalid redirect location`);if(je&&!rt.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw rt.set(t,n),n}return l.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function at({routeContext:e,match:t,children:n}){let r=l.useContext(F);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),l.createElement(z.Provider,{value:e},n)}function ot(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);b(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,u=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Ae(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let d,f=!1,p=null,m=null;r&&(d=a&&n.route.id?a[n.route.id]:void 0,p=n.route.errorElement||tt,o&&(s<0&&c===0?(vt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):s===c&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,c+1)),g=()=>{let t;return t=d?p:f?m:n.route.Component?l.createElement(n.route.Component,null):n.route.element?n.route.element:e,l.createElement(at,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?l.createElement(nt,{location:r.location,revalidation:r.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function st(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ct(e){let t=l.useContext(F);return b(t,st(e)),t}function lt(e){let t=l.useContext(I);return b(t,st(e)),t}function ut(e){let t=l.useContext(z);return b(t,st(e)),t}function dt(e){let t=ut(e),n=t.matches[t.matches.length-1];return b(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function ft(){return dt(`useRouteId`)}function pt(){let e=lt(`useNavigation`);return l.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function mt(){let{matches:e,loaderData:t}=lt(`useMatches`);return l.useMemo(()=>e.map(e=>re(e,t)),[e,t])}function ht(){let e=l.useContext(He),t=lt(`useRouteError`),n=dt(`useRouteError`);return e===void 0?t.errors?.[n]:e}function gt(){let{router:e}=ct(`useNavigate`),t=dt(`useNavigate`),n=l.useRef(!1);return Xe(()=>{n.current=!0}),l.useCallback(async(r,i={})=>{x(n.current,Ye),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var _t={};function vt(e,t,n){!t&&!_t[e]&&(_t[e]=!0,x(!1,n))}l.memo(yt);function yt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return $e(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function bt({to:e,replace:t,state:n,relative:r}){b(B(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=l.useContext(L);x(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=l.useContext(z),{pathname:o}=V(),s=H(),c=M(e,j(a),o,r===`path`),u=JSON.stringify(c);return l.useEffect(()=>{s(JSON.parse(u),{replace:t,state:n,relative:r})},[s,u,r,t,n]),null}function xt(e){b(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function St({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){b(!B(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=l.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=E(n));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`,mask:h}=n,g=l.useMemo(()=>{let e=k(u,s);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m,mask:h},navigationType:r}},[s,u,d,f,p,m,r,h]);return x(g!=null,`<Router basename="${s}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:l.createElement(L.Provider,{value:c},l.createElement(R.Provider,{children:t,value:g}))}function Ct({children:e,location:t}){return Qe(wt(e),t)}l.Component;function wt(e,t=[]){let n=[];return l.Children.forEach(e,(e,r)=>{if(!l.isValidElement(e))return;let i=[...t,r];if(e.type===l.Fragment){n.push.apply(n,wt(e.props.children,i));return}b(e.type===xt,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),b(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=wt(e.props.children,i)),n.push(a)}),n}var W=`get`,G=`application/x-www-form-urlencoded`;function K(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Tt(e){return K(e)&&e.tagName.toLowerCase()===`button`}function Et(e){return K(e)&&e.tagName.toLowerCase()===`form`}function Dt(e){return K(e)&&e.tagName.toLowerCase()===`input`}function Ot(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function kt(e,t){return e.button===0&&(!t||t===`_self`)&&!Ot(e)}function At(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function jt(e,t){let n=At(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var q=null;function Mt(){if(q===null)try{new FormData(document.createElement(`form`),0),q=!1}catch{q=!0}return q}var Nt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Pt(e){return e!=null&&!Nt.has(e)?(x(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${G}"`),null):e}function Ft(e,t){let n,r,i,a,o;if(Et(e)){let o=e.getAttribute(`action`);r=o?k(o,t):null,n=e.getAttribute(`method`)||W,i=Pt(e.getAttribute(`enctype`))||G,a=new FormData(e)}else if(Tt(e)||Dt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?k(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||W,i=Pt(e.getAttribute(`formenctype`))||Pt(o.getAttribute(`enctype`))||G,a=new FormData(o,e),!Mt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(K(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=W,r=null,i=G,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var It={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Lt=/[&><\u2028\u2029]/g;function Rt(e){return e.replace(Lt,e=>It[e])}function zt(e,t){if(e===!1||e==null)throw Error(t)}function Bt(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&k(i.pathname,t)===`/`?i.pathname=`${P(t)}/_root.${r}`:i.pathname=`${P(i.pathname)}.${r}`,i}async function Vt(e,t){if(e.id in t)return t[e.id];try{let n=await p(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ht(e){return e!=null&&typeof e.page==`string`}function Ut(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Wt(e,t,n){return Yt((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Vt(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Ut).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Gt(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Kt(e,t,{includeHydrateFallback:n}={}){return qt(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function qt(e){return[...new Set(e)]}function Jt(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Yt(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Ht(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Jt(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Xt(){let e=l.useContext(F);return zt(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Zt(){let e=l.useContext(I);return zt(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var J=l.createContext(void 0);J.displayName=`FrameworkContext`;function Y(){let e=l.useContext(J);return zt(e,`You must render this element inside a <HydratedRouter> element`),e}function Qt(e,t){let n=l.useContext(J),[r,i]=l.useState(!1),[a,o]=l.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=l.useRef(null);l.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),l.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,p,{onFocus:X(s,m),onBlur:X(c,h),onMouseEnter:X(u,m),onMouseLeave:X(d,h),onTouchStart:X(f,m)}]:[a,p,{}]:[!1,p,{}]}function X(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function $t({page:e,...t}){let n=Re(),{nonce:r}=Y(),{router:i}=Xt(),a=l.useMemo(()=>D(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?l.createElement(tn,{page:e,matches:a,...t}):l.createElement(nn,{page:e,matches:a,...t})):null}function en(e){let{manifest:t,routeModules:n}=Y(),[r,i]=l.useState([]);return l.useEffect(()=>{let r=!1;return Wt(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function tn({page:e,matches:t,...n}){let r=V(),{future:i}=Y(),{basename:a}=Xt(),o=l.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Bt(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return l.createElement(l.Fragment,null,o.map(e=>l.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function nn({page:e,matches:t,...n}){let r=V(),{future:i,manifest:a,routeModules:o}=Y(),{basename:s}=Xt(),{loaderData:c,matches:u}=Zt(),d=l.useMemo(()=>Gt(e,t,u,a,r,`data`),[e,t,u,a,r]),f=l.useMemo(()=>Gt(e,t,u,a,r,`assets`),[e,t,u,a,r]),p=l.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let u=Bt(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,d,t,e,o]),m=l.useMemo(()=>Kt(f,a),[f,a]),h=en(f);return l.createElement(l.Fragment,null,p.map(e=>l.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>l.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>l.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function rn(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}l.Component;var an=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{an&&(window.__reactRouterVersion=`7.18.1`)}catch{}function on({basename:e,children:t,useTransitions:n,window:r}){let i=l.useRef();i.current??=y({window:r,v5Compat:!0});let a=i.current,[o,s]=l.useState({action:a.action,location:a.location}),c=l.useCallback(e=>{n===!1?s(e):l.startTransition(()=>s(e))},[n]);return l.useLayoutEffect(()=>a.listen(c),[a,c]),l.createElement(St,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function sn({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=l.useState({action:n.action,location:n.location}),o=l.useCallback(e=>{r===!1?a(e):l.startTransition(()=>a(e))},[r]);return l.useLayoutEffect(()=>n.listen(o),[n,o]),l.createElement(St,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}sn.displayName=`unstable_HistoryRouter`;var cn=l.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...h},g){let{basename:_,navigator:v,useTransitions:y}=l.useContext(L),b=typeof u==`string`&&m.test(u),x=Me(u,_);u=x.to;let S=Je(u,{relative:r}),C=V(),w=null;if(o){let e=M(o,[],C.mask?C.mask.pathname:`/`,!0);_!==`/`&&(e.pathname=e.pathname===`/`?_:N([_,e.pathname])),w=v.createHref(e)}let[T,E,ee]=Qt(n,h),te=hn(u,{replace:a,mask:o,state:s,target:c,preventScrollReset:d,relative:r,viewTransition:f,defaultShouldRevalidate:p,useTransitions:y});function D(t){e&&e(t),t.defaultPrevented||te(t)}let ne=!(x.isExternal||i),re=l.createElement(`a`,{...h,...ee,href:(ne?w:void 0)||x.absoluteURL||S,onClick:ne?D:e,ref:rn(g,E),target:c,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?l.createElement(l.Fragment,null,re,l.createElement($t,{page:S})):re});cn.displayName=`Link`;var ln=l.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},u){let d=U(a,{relative:c.relative}),f=V(),p=l.useContext(I),{navigator:m,basename:h}=l.useContext(L),g=p!=null&&Tn(d)&&o===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=k(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return l.createElement(cn,{...c,"aria-current":w,className:T,ref:u,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});ln.displayName=`NavLink`;var un=l.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=W,action:s,onSubmit:c,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...h},g)=>{let{useTransitions:_}=l.useContext(L),v=yn(),y=bn(s,{relative:u}),b=o.toLowerCase()===`get`?`get`:`post`,x=typeof s==`string`&&m.test(s);return l.createElement(`form`,{ref:g,method:b,action:y,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,m=()=>v(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p});_&&n!==!1?l.startTransition(()=>m()):m()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});un.displayName=`Form`;function dn({getKey:e,storageKey:t,...n}){let r=l.useContext(J),{basename:i}=l.useContext(L),a=V(),o=mt();Cn({getKey:e,storageKey:t});let s=l.useMemo(()=>{if(!r||!e)return null;let t=Sn(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),l.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Rt(JSON.stringify(t||xn))}, ${Rt(JSON.stringify(s))})`}})}dn.displayName=`ScrollRestoration`;function fn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function pn(e){let t=l.useContext(F);return b(t,fn(e)),t}function mn(e){let t=l.useContext(I);return b(t,fn(e)),t}function hn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:u}={}){let d=H(),f=V(),p=U(e,{relative:o});return l.useCallback(m=>{if(kt(m,t)){m.preventDefault();let t=n===void 0?T(f)===T(p):n,h=()=>d(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});u?l.startTransition(()=>h()):h()}},[f,d,p,n,r,i,t,e,a,o,s,c,u])}function gn(e){x(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=l.useRef(At(e)),n=l.useRef(!1),r=V(),i=l.useMemo(()=>jt(r.search,n.current?null:t.current),[r.search]),a=H();return[i,l.useCallback((e,t)=>{let r=At(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var _n=0,vn=()=>`__${String(++_n)}__`;function yn(){let{router:e}=pn(`useSubmit`),{basename:t}=l.useContext(L),n=ft(),r=e.fetch,i=e.navigate;return l.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Ft(e,t);if(a.navigate===!1){let e=a.fetcherKey||vn();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function bn(e,{relative:t}={}){let{basename:n}=l.useContext(L),r=l.useContext(z);b(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...U(e||`.`,{relative:t})},o=V();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:N([n,a.pathname])),T(a)}var xn=`react-router-scroll-positions`,Z={};function Sn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:k(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Cn({getKey:e,storageKey:t}={}){let{router:n}=pn(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=mn(`useScrollRestoration`),{basename:a}=l.useContext(L),o=V(),s=mt(),c=pt();l.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),wn(l.useCallback(()=>{if(c.state===`idle`){let t=Sn(o,s,a,e);Z[t]=window.scrollY}try{sessionStorage.setItem(t||xn,JSON.stringify(Z))}catch(e){x(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(l.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||xn);e&&(Z=JSON.parse(e))}catch{}},[t]),l.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Z,()=>window.scrollY,e?(t,n)=>Sn(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),l.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{x(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function wn(e,t){let{capture:n}=t||{};l.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Tn(e,{relative:t}={}){let n=l.useContext(ze);b(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=pn(`useViewTransitionState`),i=U(e,{relative:t});if(!n.isTransitioning)return!1;let a=k(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=k(n.nextLocation.pathname,r)||n.nextLocation.pathname;return O(i.pathname,o)!=null||O(i.pathname,a)!=null}function En(){return new o({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new a,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Dn(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:En(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:n,inactiveTriggerProps:n,popupProps:n}}function On(e,t,n=!1){return new o({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var Q=i(e=>e.triggerIdProp??e.activeTriggerId),$=i(e=>e.openProp??e.open),kn=i(e=>(e.popupElement?.id??e.floatingId)||void 0);function An(e,t){return t!==void 0&&$(e)&&Q(e)===t}function jn(e,t){return An(e,t)?!0:t!==void 0&&$(e)&&Q(e)==null&&e.triggerCount===1}var Mn={open:$,mounted:i(e=>e.mounted),transitionStatus:i(e=>e.transitionStatus),floatingRootContext:i(e=>e.floatingRootContext),triggerCount:i(e=>e.triggerCount),preventUnmountingOnClose:i(e=>e.preventUnmountingOnClose),payload:i(e=>e.payload),activeTriggerId:Q,activeTriggerElement:i(e=>e.mounted?e.activeTriggerElement:null),popupId:kn,isTriggerActive:i((e,t)=>t!==void 0&&Q(e)===t),isOpenedByTrigger:i((e,t)=>An(e,t)),isMountedByTrigger:i((e,t)=>t!==void 0&&Q(e)===t&&e.mounted),triggerProps:i((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:i((e,t)=>jn(e,t)?kn(e):void 0),popupProps:i(e=>e.popupProps),popupElement:i(e=>e.popupElement),positionerElement:i(e=>e.positionerElement)};export{cn as a,xt as c,H as d,gn as f,s as h,on as i,Ct as l,c as m,On as n,ln as o,p,Mn as r,bt as s,Dn as t,V as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e}from"./button-BDDZnIHx.js";function t(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function n(e,t){return Math.max(0,e-t)}function r(e,n){if(n<=0)return 0;let r=t(e,0,n),i=r,a=n-r,o=i<=1,s=a<=1;return o&&s?i<=a?0:n:o?0:s?n:r}var i=e(),a=`base-ui-disable-scrollbar`,o={className:a,getElement(e){return(0,i.jsx)(`style`,{nonce:e,href:a,precedence:`base-ui:low`,children:`.${a}{scrollbar-width:none}.${a}::-webkit-scrollbar{display:none}`})}};export{t as i,n,r,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e,m as t,o as n}from"./button-BDDZnIHx.js";import{r}from"./CSPContext-BG7no5S_.js";var i=e();function a({className:e,size:a=`default`,unstyled:o=!1,...s}){return(0,i.jsx)(`span`,{className:t(!o&&`relative inline-flex w-full rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none has-focus-visible:ring-[3px] not-has-disabled:has-not-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] sm:text-sm dark:bg-input/32 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:has-not-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]`,e)||void 0,"data-size":a,"data-slot":`textarea-control`,children:(0,i.jsx)(r,{render:e=>(0,i.jsx)(`textarea`,{className:t(`field-sizing-content min-h-17.5 w-full rounded-[inherit] px-[calc(--spacing(3)-1px)] py-[calc(--spacing(1.5)-1px)] outline-none max-sm:min-h-20.5`,a===`sm`&&`min-h-16.5 px-[calc(--spacing(2.5)-1px)] py-[calc(--spacing(1)-1px)] max-sm:min-h-19.5`,a===`lg`&&`min-h-18.5 py-[calc(--spacing(2)-1px)] max-sm:min-h-21.5`),"data-slot":`textarea`,...n(e,s)})})})}export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e}from"./button-
|
|
1
|
+
import{h as e}from"./button-BDDZnIHx.js";var t=e(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,b as t}from"./button-BDDZnIHx.js";import{en as n,ln as r}from"./CSPContext-BG7no5S_.js";var i=t(e(),1);function a(e,t,a,s=!0,c){let[l,u]=i.useState(),d=n(c?`${c}-label`:void 0),f=e??t??l;return r(()=>{let n=e||t||!s?void 0:o(a.current,d);l!==n&&u(n)}),f}function o(e,t){let n=s(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function s(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}export{a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,b as t}from"./button-BDDZnIHx.js";import{ln as n,un as r}from"./CSPContext-BG7no5S_.js";var i=t(e(),1);function a(e,t){let a=i.useRef(e),o=r(t);n(()=>{a.current!==e&&o(a.current)},[e,o]),n(()=>{a.current=e},[e])}export{a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{kt as e}from"./index-V1dDX1O_.js";function t(t){return e({tag:`svg`,attr:{viewBox:`0 0 16 16`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M15.434 1.72887L12.14 0.144875C12.002 0.078875 11.855 0.046875 11.709 0.046875C11.353 0.046875 11.18 0.211875 11.155 0.228875C11.073 0.270875 11.005 0.337875 11.004 0.338875L4.698 6.08888L1.951 4.00488C1.832 3.91388 1.69 3.86987 1.548 3.86987C1.387 3.86987 1.226 3.92788 1.1 4.04288L0.219 4.84387C0.074 4.97587 0.001 5.15688 0.001 5.33687C0.001 5.51687 0.073 5.69688 0.218 5.82888L2.6 8.00088L0.217 10.1719C0.072 10.3039 0 10.4839 0 10.6639C0 10.8439 0.073 11.0249 0.218 11.1569L1.099 11.9579C1.226 12.0729 1.386 12.1309 1.547 12.1309C1.688 12.1309 1.83 12.0859 1.95 11.9959L4.697 9.91187L11.003 15.6619C11.003 15.6619 11.072 15.7299 11.155 15.7719C11.179 15.7889 11.353 15.9529 11.709 15.9529C11.855 15.9529 12.003 15.9209 12.141 15.8549L15.435 14.2709C15.781 14.1049 16.001 13.7539 16.001 13.3699V2.62888C16.001 2.24487 15.781 1.89488 15.435 1.72787L15.434 1.72887ZM7.217 7.99988L12.002 4.36987V11.6299L7.217 7.99988Z`},child:[]}]})(t)}function n(t){return e({tag:`svg`,attr:{viewBox:`0 0 16 16`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8.045 7.37722L5.449 5.40722L10.636 0.676223C10.685 0.631223 10.735 0.617223 10.778 0.617223C10.786 0.617223 10.999 0.627223 10.999 0.837223V5.13222L8.044 7.37622L8.045 7.37722ZM0.217 10.1762C0.072 10.3082 0 10.4882 0 10.6682C0 10.8482 0.073 11.0292 0.218 11.1612L1.099 11.9622C1.226 12.0772 1.386 12.1352 1.547 12.1352C1.688 12.1352 1.83 12.0902 1.95 12.0002L3.887 10.5312L1.858 8.68122L0.218 10.1762H0.217ZM1.95 4.00822C1.83 3.91722 1.689 3.87322 1.547 3.87322C1.386 3.87322 1.225 3.93122 1.099 4.04622L0.218 4.84722C0.073 4.97922 0 5.16022 0 5.34022C0 5.52022 0.072 5.70022 0.217 5.83222L2.202 7.64222L10.634 15.3332C10.684 15.3792 10.735 15.3922 10.779 15.3922C10.888 15.3922 11 15.3142 11 15.1752V10.8762L1.95 4.00822ZM15.434 1.73322L12.14 0.149223C12.002 0.0832227 11.855 0.0532227 11.709 0.0532227H11.704C11.888 0.268223 12.003 0.537223 12.003 0.837223V15.1752C12.004 15.4702 11.894 15.7342 11.716 15.9472H11.734C11.748 15.9472 11.761 15.9472 11.775 15.9472C11.962 15.9472 12.123 15.8682 12.14 15.8602L15.434 14.2762C15.78 14.1102 16 13.7592 16 13.3752V2.63422C16 2.25022 15.78 1.90022 15.434 1.73322Z`},child:[]}]})(t)}export{n,t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e}from"./button-
|
|
1
|
+
import{h as e}from"./button-BDDZnIHx.js";var t=e(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);export{t};
|
package/dist/gui/index.html
CHANGED
|
@@ -16,13 +16,15 @@
|
|
|
16
16
|
} catch (e) { /* ignore */ }
|
|
17
17
|
})();
|
|
18
18
|
</script>
|
|
19
|
-
<script type="module" crossorigin src="/assets/index-
|
|
20
|
-
<link rel="modulepreload" crossorigin href="/assets/button-
|
|
21
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
22
|
-
<link rel="modulepreload" crossorigin href="/assets/chevron-down-
|
|
23
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
24
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
25
|
-
<link rel="
|
|
19
|
+
<script type="module" crossorigin src="/assets/index-V1dDX1O_.js"></script>
|
|
20
|
+
<link rel="modulepreload" crossorigin href="/assets/button-BDDZnIHx.js">
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/assets/CSPContext-BG7no5S_.js">
|
|
22
|
+
<link rel="modulepreload" crossorigin href="/assets/chevron-down-qTL8HPug.js">
|
|
23
|
+
<link rel="modulepreload" crossorigin href="/assets/store-D7ixdVck.js">
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/assets/useValueChanged-CStSGSsD.js">
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/assets/isElementDisabled-D_fu2zfc.js">
|
|
26
|
+
<link rel="modulepreload" crossorigin href="/assets/styles-CVwNuFCx.js">
|
|
27
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CZoZQkeC.css">
|
|
26
28
|
</head>
|
|
27
29
|
<body>
|
|
28
30
|
<div id="root"></div>
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AA4C5B,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AA4EjF,eAAO,MAAM,GAAG,4EAAa,CAAC;AAc9B,mGAAmG;AACnG,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAE,GACvD,MAAM,GAAG,IAAI,CAUf;AAED,gFAAgF;AAChF,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAS;IAEhB,QAAQ,IAAI,OAAO;IAMnB,MAAM,IAAI,IAAI;IAId,QAAQ,IAAI,OAAO;CAG3B;AAuKD,yEAAyE;AACzE,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,OAAO,SAA2B;CAI/C;AAcD,kFAAkF;AAClF,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAE9E;AAID;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,YAAY,GAAE,MAAM,CAAC,YAA2B,EAChD,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,eAAe,GAAE,MAAM,OAMtB,GACA,OAAO,CAeT;AA8BD,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE/E;AAsDD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAc7D;AAmnED,wBAAgB,WAAW,CACzB,IAAI,SAAO,EACX,IAAI,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,GAClC,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,GAAG,CAAA;CAAE,CAAC,CA0BxC"}
|
package/dist/server.js
CHANGED
|
@@ -30,6 +30,8 @@ import { generateContextFiles } from './generators/index.js';
|
|
|
30
30
|
import { detectAIAssistants } from './utils/detect-ai.js';
|
|
31
31
|
import { detectEditors } from './utils/detect-editors.js';
|
|
32
32
|
import { buildWorkspaceLaunchPrompt, detectWorkspaceLaunchTargets, launchTargetIdForEditorCommand, launchWorkspaceTarget, } from './utils/workspace-launch.js';
|
|
33
|
+
import { isBinaryOnPath, launchWorkspaceTerminal, SUPPORTED_ASSISTANTS } from './utils/terminal-launch.js';
|
|
34
|
+
import { openInEditor } from './utils/open-editor.js';
|
|
33
35
|
import { canOpenCodexSessionInWorkspace, canTransferClaudeSessionInWorkspace, findSessions, getSessionTranscript, } from './utils/session-finder.js';
|
|
34
36
|
import { ProviderRegistry } from './agent/adapters.js';
|
|
35
37
|
import { isValidSessionUuid } from './agent/session.js';
|
|
@@ -291,7 +293,15 @@ const DESKTOP_HANDOFF_SCAN_LIMIT = 20;
|
|
|
291
293
|
* Claude's documented `/desktop` transfer is narrower than its URI handler:
|
|
292
294
|
* it requires macOS or x64 Windows, a subscription login, and a usable CLI.
|
|
293
295
|
*/
|
|
294
|
-
export function canOfferClaudeDesktopTransfer(platform = process.platform, architecture = process.arch, env = process.env, isCliConfigured = () =>
|
|
296
|
+
export function canOfferClaudeDesktopTransfer(platform = process.platform, architecture = process.arch, env = process.env, isCliConfigured = () => {
|
|
297
|
+
try {
|
|
298
|
+
const provider = ProviderRegistry.getProvider('claude-cli');
|
|
299
|
+
if (provider?.isConfigured())
|
|
300
|
+
return true;
|
|
301
|
+
}
|
|
302
|
+
catch { }
|
|
303
|
+
return isBinaryOnPath('claude');
|
|
304
|
+
}) {
|
|
295
305
|
const supportedPlatform = platform === 'darwin' || (platform === 'win32' && architecture === 'x64');
|
|
296
306
|
const usesUnsupportedAuth = Boolean(env.ANTHROPIC_API_KEY
|
|
297
307
|
|| env.ANTHROPIC_AUTH_TOKEN
|
|
@@ -425,6 +435,17 @@ app.use('/api/*', cors({
|
|
|
425
435
|
}
|
|
426
436
|
},
|
|
427
437
|
}));
|
|
438
|
+
// Enforce trusted local origin on all mutating HTTP methods across /api/* to defend against
|
|
439
|
+
// cross-site request forgery and browser form posts from untrusted web pages.
|
|
440
|
+
app.use('/api/*', async (c, next) => {
|
|
441
|
+
if (['POST', 'PUT', 'DELETE', 'PATCH'].includes(c.req.method)) {
|
|
442
|
+
const origin = c.req.header('origin');
|
|
443
|
+
if (origin && !hasTrustedLocalOrigin(origin)) {
|
|
444
|
+
return c.json({ error: 'Forbidden cross-origin request.' }, 403);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
await next();
|
|
448
|
+
});
|
|
428
449
|
// ─── API Endpoints ────────────────────────────────────────────────────────
|
|
429
450
|
// Status checks may execute a trusted local CLI from PATH. Keep that work
|
|
430
451
|
// behind a non-simple, same-machine POST so a remote page cannot trigger it
|
|
@@ -596,11 +617,16 @@ app.delete('/api/projects/:id', async (c) => {
|
|
|
596
617
|
return errorResponse(c, error);
|
|
597
618
|
}
|
|
598
619
|
});
|
|
599
|
-
// 4. List existing workspaces
|
|
620
|
+
// 4. List existing workspaces (ordered by newest creation date first)
|
|
600
621
|
app.get('/api/workspaces', async (c) => {
|
|
601
622
|
try {
|
|
602
623
|
const config = await loadConfig();
|
|
603
624
|
const workspaces = await listWorkspaces(config.workspacesDir);
|
|
625
|
+
workspaces.sort((a, b) => {
|
|
626
|
+
const aTime = new Date(a.createdAt || 0).getTime();
|
|
627
|
+
const bTime = new Date(b.createdAt || 0).getTime();
|
|
628
|
+
return bTime - aTime;
|
|
629
|
+
});
|
|
604
630
|
return c.json(workspaces);
|
|
605
631
|
}
|
|
606
632
|
catch (error) {
|
|
@@ -806,6 +832,13 @@ async function runCreationJob(jobId, body, config) {
|
|
|
806
832
|
// dir). One stable step id for both modes — only the wording differs.
|
|
807
833
|
updateJobStep(jobId, 'workspace', 'running', inPlace ? 'Registering workspace...' : 'Creating git worktrees...');
|
|
808
834
|
await createWorkspace(feature, body.repos);
|
|
835
|
+
if (Array.isArray(body.enabledSkills) || Array.isArray(body.enabledAgents) || Array.isArray(body.enabledCategories)) {
|
|
836
|
+
await saveWorkspaceSkillsConfig(workspacePath, {
|
|
837
|
+
enabledSkills: Array.isArray(body.enabledSkills) ? body.enabledSkills : [],
|
|
838
|
+
enabledAgents: Array.isArray(body.enabledAgents) ? body.enabledAgents : [],
|
|
839
|
+
enabledCategories: Array.isArray(body.enabledCategories) ? body.enabledCategories : [],
|
|
840
|
+
});
|
|
841
|
+
}
|
|
809
842
|
updateJobStep(jobId, 'workspace', 'completed', inPlace ? 'Workspace registered — working in-place in the source repos.' : 'Git worktrees created successfully.');
|
|
810
843
|
// Step 2: Analyze repos — against the worktrees, or the source repos in-place.
|
|
811
844
|
updateJobStep(jobId, 'analysis', 'running', 'Analyzing projects and dependencies...');
|
|
@@ -1011,6 +1044,10 @@ app.get('/api/workspace-launch-targets', async (c) => {
|
|
|
1011
1044
|
});
|
|
1012
1045
|
// 8a. Open a real NexusFlow workspace in a selected desktop app or editor.
|
|
1013
1046
|
app.post('/api/workspace/:id/launch', async (c) => {
|
|
1047
|
+
const origin = c.req.header('origin');
|
|
1048
|
+
if (origin && !hasTrustedLocalOrigin(origin)) {
|
|
1049
|
+
return c.json({ error: 'Forbidden cross-origin request.' }, 403);
|
|
1050
|
+
}
|
|
1014
1051
|
try {
|
|
1015
1052
|
const id = decodeURIComponent(c.req.param('id'));
|
|
1016
1053
|
const { targetId, action = 'new', sessionId } = await c.req.json().catch(() => ({}));
|
|
@@ -1072,12 +1109,74 @@ app.post('/api/workspace/:id/launch', async (c) => {
|
|
|
1072
1109
|
return errorResponse(c, error);
|
|
1073
1110
|
}
|
|
1074
1111
|
});
|
|
1075
|
-
// 8b.
|
|
1112
|
+
// 8b. Launch an external interactive terminal for a workspace or AI session.
|
|
1113
|
+
app.post('/api/workspace/:id/terminal', async (c) => {
|
|
1114
|
+
const origin = c.req.header('origin');
|
|
1115
|
+
if (origin && !hasTrustedLocalOrigin(origin)) {
|
|
1116
|
+
return c.json({ error: 'Forbidden cross-origin request.' }, 403);
|
|
1117
|
+
}
|
|
1118
|
+
try {
|
|
1119
|
+
const id = decodeURIComponent(c.req.param('id'));
|
|
1120
|
+
const { command, assistant, sessionId, title } = await c.req.json().catch(() => ({}));
|
|
1121
|
+
if (assistant !== undefined) {
|
|
1122
|
+
if (typeof assistant !== 'string' || !SUPPORTED_ASSISTANTS.has(assistant.trim().toLowerCase())) {
|
|
1123
|
+
return c.json({ error: 'Invalid or unsupported assistant parameter.' }, 400);
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
if (sessionId !== undefined) {
|
|
1127
|
+
if (typeof sessionId !== 'string' || !isValidSessionUuid(sessionId)) {
|
|
1128
|
+
return c.json({ error: 'Invalid session UUID format.' }, 400);
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
if (command !== undefined && (typeof command !== 'string' || !command.trim())) {
|
|
1132
|
+
return c.json({ error: 'Command must be a non-empty string.' }, 400);
|
|
1133
|
+
}
|
|
1134
|
+
if (title !== undefined && typeof title !== 'string') {
|
|
1135
|
+
return c.json({ error: 'Title must be a string.' }, 400);
|
|
1136
|
+
}
|
|
1137
|
+
const config = await loadConfig();
|
|
1138
|
+
const requestedWorkspacePath = resolveWorkspacePath(config.workspacesDir, id);
|
|
1139
|
+
let workspacePath;
|
|
1140
|
+
try {
|
|
1141
|
+
workspacePath = await resolveExactLaunchWorkspace(config.workspacesDir, requestedWorkspacePath);
|
|
1142
|
+
}
|
|
1143
|
+
catch (error) {
|
|
1144
|
+
if (error instanceof PathAccessError)
|
|
1145
|
+
throw error;
|
|
1146
|
+
return c.json({ error: 'Workspace configuration not found.' }, 404);
|
|
1147
|
+
}
|
|
1148
|
+
if (!workspacePath) {
|
|
1149
|
+
return c.json({ error: 'Workspace configuration not found.' }, 404);
|
|
1150
|
+
}
|
|
1151
|
+
const res = await launchWorkspaceTerminal(workspacePath, {
|
|
1152
|
+
command: typeof command === 'string' ? command : undefined,
|
|
1153
|
+
assistant: typeof assistant === 'string' ? assistant : undefined,
|
|
1154
|
+
sessionId: typeof sessionId === 'string' ? sessionId : undefined,
|
|
1155
|
+
title: typeof title === 'string' ? title : undefined,
|
|
1156
|
+
});
|
|
1157
|
+
return c.json({ success: true, command: res.command });
|
|
1158
|
+
}
|
|
1159
|
+
catch (error) {
|
|
1160
|
+
return errorResponse(c, error);
|
|
1161
|
+
}
|
|
1162
|
+
});
|
|
1163
|
+
// 8c. Legacy editor route retained for older GUI clients using recognized
|
|
1076
1164
|
// graphical editors. Interactive terminal editors are intentionally rejected:
|
|
1077
1165
|
// a detached HTTP request cannot safely provide their required TTY.
|
|
1078
1166
|
app.post('/api/open-editor', async (c) => {
|
|
1167
|
+
const origin = c.req.header('origin');
|
|
1168
|
+
if (origin && !hasTrustedLocalOrigin(origin)) {
|
|
1169
|
+
return c.json({ error: 'Forbidden cross-origin request.' }, 403);
|
|
1170
|
+
}
|
|
1079
1171
|
try {
|
|
1080
|
-
const
|
|
1172
|
+
const body = await c.req.json().catch(() => ({}));
|
|
1173
|
+
const { workspacePath, command } = body;
|
|
1174
|
+
if (typeof workspacePath !== 'string' || !workspacePath.trim()) {
|
|
1175
|
+
return c.json({ error: 'Workspace path does not exist' }, 400);
|
|
1176
|
+
}
|
|
1177
|
+
if (typeof command !== 'string' || !command.trim()) {
|
|
1178
|
+
return c.json({ error: 'Forbidden editor command' }, 400);
|
|
1179
|
+
}
|
|
1081
1180
|
const targetId = launchTargetIdForEditorCommand(command);
|
|
1082
1181
|
if (!ALLOWED_EDITORS.has(command) || !targetId) {
|
|
1083
1182
|
return c.json({ error: 'Forbidden editor command' }, 400);
|
|
@@ -1322,10 +1421,10 @@ app.get('/api/workspace/:id/changes', async (c) => {
|
|
|
1322
1421
|
});
|
|
1323
1422
|
const numstatLines = numstatRaw.split('\n').filter(Boolean);
|
|
1324
1423
|
for (const numLine of numstatLines) {
|
|
1325
|
-
const
|
|
1326
|
-
if (
|
|
1327
|
-
const [add, del, file] =
|
|
1328
|
-
numstatMap.set(file, {
|
|
1424
|
+
const match = numLine.trim().match(/^(\d+|-)\s+(\d+|-)\s+(.*)$/);
|
|
1425
|
+
if (match) {
|
|
1426
|
+
const [, add, del, file] = match;
|
|
1427
|
+
numstatMap.set(file.trim(), {
|
|
1329
1428
|
additions: add === '-' ? 0 : parseInt(add, 10) || 0,
|
|
1330
1429
|
deletions: del === '-' ? 0 : parseInt(del, 10) || 0,
|
|
1331
1430
|
});
|
|
@@ -1560,6 +1659,10 @@ app.post('/api/workspace/:id/commit', async (c) => {
|
|
|
1560
1659
|
});
|
|
1561
1660
|
// 14. Resume session in workspace (copies CLI resume command and opens editor)
|
|
1562
1661
|
app.post('/api/workspace/:id/resume', async (c) => {
|
|
1662
|
+
const origin = c.req.header('origin');
|
|
1663
|
+
if (origin && !hasTrustedLocalOrigin(origin)) {
|
|
1664
|
+
return c.json({ error: 'Forbidden cross-origin request.' }, 403);
|
|
1665
|
+
}
|
|
1563
1666
|
try {
|
|
1564
1667
|
const id = decodeURIComponent(c.req.param('id'));
|
|
1565
1668
|
const config = await loadConfig();
|
|
@@ -1570,8 +1673,14 @@ app.post('/api/workspace/:id/resume', async (c) => {
|
|
|
1570
1673
|
return c.json({ error: 'Workspace configuration not found.' }, 404);
|
|
1571
1674
|
}
|
|
1572
1675
|
const body = await c.req.json().catch(() => ({}));
|
|
1573
|
-
const targetSessionId = body.sessionId;
|
|
1574
|
-
|
|
1676
|
+
const targetSessionId = typeof body.sessionId === 'string' && isValidSessionUuid(body.sessionId) ? body.sessionId : undefined;
|
|
1677
|
+
if (body.sessionId !== undefined && targetSessionId === undefined) {
|
|
1678
|
+
return c.json({ error: 'Invalid session UUID format.' }, 400);
|
|
1679
|
+
}
|
|
1680
|
+
if (body.command !== undefined && (typeof body.command !== 'string' || !ALLOWED_EDITORS.has(body.command))) {
|
|
1681
|
+
return c.json({ error: 'Forbidden editor command' }, 400);
|
|
1682
|
+
}
|
|
1683
|
+
const targetAssistant = typeof body.assistant === 'string' ? body.assistant : undefined;
|
|
1575
1684
|
// Find the session to resume
|
|
1576
1685
|
let resumeCommand = '';
|
|
1577
1686
|
let selectedAssistant = targetAssistant || feature.assistants[0] || 'antigravity';
|
|
@@ -1621,17 +1730,12 @@ app.post('/api/workspace/:id/resume', async (c) => {
|
|
|
1621
1730
|
if (!ALLOWED_EDITORS.has(body.command)) {
|
|
1622
1731
|
return c.json({ error: 'Forbidden editor command' }, 400);
|
|
1623
1732
|
}
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
shell: isWin,
|
|
1629
|
-
cleanup: false,
|
|
1630
|
-
});
|
|
1631
|
-
child.unref();
|
|
1632
|
-
child.catch((err) => {
|
|
1733
|
+
try {
|
|
1734
|
+
await openInEditor(body.command, workspacePath);
|
|
1735
|
+
}
|
|
1736
|
+
catch (err) {
|
|
1633
1737
|
console.error(`Failed to launch editor ${body.command} for path ${workspacePath}:`, err);
|
|
1634
|
-
}
|
|
1738
|
+
}
|
|
1635
1739
|
}
|
|
1636
1740
|
// Where the resume command should be run: the workspace dir, or the repo
|
|
1637
1741
|
// root for single-repo in-place features.
|
|
@@ -1719,8 +1823,11 @@ app.get('/api/session/:assistant/:sessionId/transcript', async (c) => {
|
|
|
1719
1823
|
const assistant = c.req.param('assistant');
|
|
1720
1824
|
const sessionId = c.req.param('sessionId');
|
|
1721
1825
|
try {
|
|
1722
|
-
if (
|
|
1723
|
-
return c.json({ error:
|
|
1826
|
+
if (!SUPPORTED_ASSISTANTS.has(assistant.trim().toLowerCase())) {
|
|
1827
|
+
return c.json({ error: `Unsupported assistant: "${assistant}".` }, 400);
|
|
1828
|
+
}
|
|
1829
|
+
if (!isValidSessionUuid(sessionId)) {
|
|
1830
|
+
return c.json({ error: 'Invalid session UUID format.' }, 400);
|
|
1724
1831
|
}
|
|
1725
1832
|
const messages = await getSessionTranscript(assistant, sessionId);
|
|
1726
1833
|
return c.json({ messages });
|