modviz 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/README.md +261 -0
  2. package/dist/client/_shell.html +0 -0
  3. package/dist/client/android-chrome-192x192.png +0 -0
  4. package/dist/client/android-chrome-512x512.png +0 -0
  5. package/dist/client/apple-touch-icon.png +0 -0
  6. package/dist/client/assets/app-Sjrldkrg.css +2 -0
  7. package/dist/client/assets/button-aOWckyNs.js +1 -0
  8. package/dist/client/assets/check-C0EQe2S8.js +1 -0
  9. package/dist/client/assets/chevron-down-DrspihmT.js +1 -0
  10. package/dist/client/assets/chevron-right-DIJHr8AN.js +1 -0
  11. package/dist/client/assets/colors-CQoWjU5E.js +1 -0
  12. package/dist/client/assets/command-kkF7_wdz.js +45 -0
  13. package/dist/client/assets/compare-K6jVFsiI.js +1 -0
  14. package/dist/client/assets/compare-TOnoe1EP.js +2 -0
  15. package/dist/client/assets/configure-DnlSnhtN.js +1 -0
  16. package/dist/client/assets/explorer-C7NclVKg.js +2 -0
  17. package/dist/client/assets/explorer-Xu2X6XXF.js +1 -0
  18. package/dist/client/assets/external-link-B9eNA-li.js +1 -0
  19. package/dist/client/assets/flamegraph-CRVZSAlj.js +13 -0
  20. package/dist/client/assets/floating-ui.dom-DLIT5tPE.js +1 -0
  21. package/dist/client/assets/formatting-CiC0SYI8.js +1 -0
  22. package/dist/client/assets/graph-6Vr74V1k.js +2 -0
  23. package/dist/client/assets/graph-CVzypIGU.js +2 -0
  24. package/dist/client/assets/graph-command-menu-D2MoVT2B.js +4 -0
  25. package/dist/client/assets/graph-command-menu-VWiiW3qy.css +1 -0
  26. package/dist/client/assets/hierarchy-C8xxGb_u.js +2 -0
  27. package/dist/client/assets/hierarchy-iO7d4oSK.js +2 -0
  28. package/dist/client/assets/import-display-D-jRyyjM.js +5 -0
  29. package/dist/client/assets/imports-CPggnrs-.js +2 -0
  30. package/dist/client/assets/imports-CodbPyUJ.js +1 -0
  31. package/dist/client/assets/index-Dj_rhLdR.js +12 -0
  32. package/dist/client/assets/input-BCFMF0aR.js +1 -0
  33. package/dist/client/assets/jsx-runtime-DWSWI4JT.js +1 -0
  34. package/dist/client/assets/lazyRouteComponent-PTSyFp1J.js +1 -0
  35. package/dist/client/assets/loading-state-CyC_hrTF.js +1 -0
  36. package/dist/client/assets/modviz-data-BiRqoDI5.js +1 -0
  37. package/dist/client/assets/modviz-layout-Do93E-IB.js +1 -0
  38. package/dist/client/assets/modviz-sigma-Xl8qHaxK.js +312 -0
  39. package/dist/client/assets/portal-BgAm3V3j.js +1 -0
  40. package/dist/client/assets/routes-DBtN8hrZ.js +1 -0
  41. package/dist/client/assets/schemas-B4zfTepZ.js +39 -0
  42. package/dist/client/assets/search-BYHxNrYn.js +1 -0
  43. package/dist/client/assets/search-params-BaZRBvGI.js +1 -0
  44. package/dist/client/assets/setup-view-j1o0TuZz.js +1 -0
  45. package/dist/client/assets/summary-D703Zh3x.js +1 -0
  46. package/dist/client/assets/tooltip-B1VDU9HG.js +1 -0
  47. package/dist/client/assets/trace-B67CM5s2.js +2 -0
  48. package/dist/client/assets/trace-Bwwdw3AM.js +1 -0
  49. package/dist/client/assets/treemap-BZf2shzY.js +5 -0
  50. package/dist/client/assets/treemap-Csroy8Gy.js +2 -0
  51. package/dist/client/assets/utils-DkkZd0ys.js +1 -0
  52. package/dist/client/favicon-16x16.png +0 -0
  53. package/dist/client/favicon-32x32.png +0 -0
  54. package/dist/client/favicon.ico +0 -0
  55. package/dist/client/favicon.png +0 -0
  56. package/dist/client/site.webmanifest +19 -0
  57. package/dist/mod/cli-options.js +225 -0
  58. package/dist/mod/cli.js +519 -0
  59. package/dist/mod/index.js +3 -0
  60. package/dist/mod/llm-analysis.js +29 -0
  61. package/dist/mod/llm-output.js +742 -0
  62. package/dist/mod/module-graph-plugins.js +60 -0
  63. package/dist/mod/production-server.js +103 -0
  64. package/dist/mod/runtime-host.js +217 -0
  65. package/dist/mod/snapshot-history.js +73 -0
  66. package/dist/mod/types.js +3 -0
  67. package/dist/server/assets/__23tanstack-start-plugin-adapters-3QxJs4a0.js +5 -0
  68. package/dist/server/assets/_tanstack-start-manifest_v-DMytuIue.js +188 -0
  69. package/dist/server/assets/button-Bqnnid5i.js +41 -0
  70. package/dist/server/assets/colors-DhAxrYua.js +100 -0
  71. package/dist/server/assets/command-SdxShIbL.js +138 -0
  72. package/dist/server/assets/compare-BFMiiUsB.js +562 -0
  73. package/dist/server/assets/compare-CpOqTpYu.js +10 -0
  74. package/dist/server/assets/configure-Bvd45DTI.js +288 -0
  75. package/dist/server/assets/explorer-C7dODpSv.js +379 -0
  76. package/dist/server/assets/explorer-CpSb0JTa.js +20 -0
  77. package/dist/server/assets/flamegraph-CdW-VG6I.js +198 -0
  78. package/dist/server/assets/formatting-iDlL4tA-.js +4 -0
  79. package/dist/server/assets/graph-C1G9H5O4.js +438 -0
  80. package/dist/server/assets/graph-DAGFGioS.js +45 -0
  81. package/dist/server/assets/graph-command-menu-BV5GtOWx.js +249 -0
  82. package/dist/server/assets/hierarchy-B4K-Zfn9.js +16 -0
  83. package/dist/server/assets/hierarchy-BGpWSG-f.js +104 -0
  84. package/dist/server/assets/import-display-BVIOWcsm.js +124 -0
  85. package/dist/server/assets/imports-B6JBDl_h.js +379 -0
  86. package/dist/server/assets/imports-BGe5tZJT.js +28 -0
  87. package/dist/server/assets/input-C5r-hBix.js +19 -0
  88. package/dist/server/assets/loading-state-CrvCWTtw.js +23 -0
  89. package/dist/server/assets/modviz-data-CUyTorv0.js +197 -0
  90. package/dist/server/assets/modviz-layout-BAH2ogse.js +253 -0
  91. package/dist/server/assets/modviz-server-DoMlAyFW.js +195 -0
  92. package/dist/server/assets/modviz-sigma-XYxARWqd.js +1441 -0
  93. package/dist/server/assets/rolldown-runtime-rSIU-vHC.js +13 -0
  94. package/dist/server/assets/router-DYJ-zDbU.js +353 -0
  95. package/dist/server/assets/routes-DInCacpY.js +244 -0
  96. package/dist/server/assets/search-params-BNApPgkX.js +26 -0
  97. package/dist/server/assets/setup-view-DjI49Iqr.js +91 -0
  98. package/dist/server/assets/start-Ba3KII43.js +4 -0
  99. package/dist/server/assets/summary-z3lXkLCQ.js +208 -0
  100. package/dist/server/assets/tooltip-Ck0DDfF7.js +24 -0
  101. package/dist/server/assets/trace-ColKOf9g.js +16 -0
  102. package/dist/server/assets/trace-eVs-hIZO.js +578 -0
  103. package/dist/server/assets/treemap-BbZ9M4GF.js +17 -0
  104. package/dist/server/assets/treemap-CrgWFoCF.js +912 -0
  105. package/dist/server/assets/utils-BQZm0uva.js +8 -0
  106. package/dist/server/server.js +5259 -0
  107. package/dist/shared/modviz-compare.js +120 -0
  108. package/dist/shared/modviz-trace.js +244 -0
  109. package/package.json +135 -0
@@ -0,0 +1,45 @@
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-DWSWI4JT.js";import{ct as r}from"./modviz-data-BiRqoDI5.js";import{r as i,t as a}from"./utils-DkkZd0ys.js";import{t as o}from"./search-BYHxNrYn.js";import{i as s,n as c,r as l}from"./button-aOWckyNs.js";var u=i(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),d=i(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),f=i(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),p=e(t(),1),m=1,h=.9,g=.8,_=.17,v=.1,y=.999,b=.9999,x=.99,S=/[\\\/_+.#"@\[\(\{&]/,C=/[\\\/_+.#"@\[\(\{&]/g,w=/[\s-]/,T=/[\s-]/g;function E(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?m:x;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,D;l>=0;)d=E(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=m:S.test(e.charAt(l-1))?(d*=g,p=e.slice(i,l-1).match(C),p&&i>0&&(d*=y**+p.length)):w.test(e.charAt(l-1))?(d*=h,D=e.slice(i,l-1).match(T),D&&i>0&&(d*=y**+D.length)):(d*=_,i>0&&(d*=y**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=b)),(d<v&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=E(e,t,n,r,l+1,a+2,o),f*v>d&&(d=f*v)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function D(e){return e.toLowerCase().replace(T,` `)}function ee(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,E(e,t,D(e),D(t),0,0,{})}typeof window<`u`&&window.document&&window.document.createElement;function O(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var k=n();function A(e,t){let n=p.createContext(t),r=e=>{let{children:t,...r}=e,i=p.useMemo(()=>r,Object.values(r));return(0,k.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=p.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function j(e,t=[]){let n=[];function r(t,r){let i=p.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=p.useMemo(()=>o,Object.values(o));return(0,k.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=p.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>p.createContext(e));return function(n){let r=n?.[e]||t;return p.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,te(i,...t)]}function te(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var M=globalThis?.document?p.useLayoutEffect:()=>{},ne=p.useId||(()=>void 0),re=0;function N(e){let[t,n]=p.useState(ne());return M(()=>{e||n(e=>e??String(re++))},[e]),e||(t?`radix-${t}`:``)}var ie=p.useInsertionEffect||M;function P({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=ae({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=p.useRef(e!==void 0);p.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,p.useCallback(t=>{if(s){let n=oe(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function ae({defaultProp:e,onChange:t}){let[n,r]=p.useState(e),i=p.useRef(n),a=p.useRef(t);return ie(()=>{a.current=t},[t]),p.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function oe(e){return typeof e==`function`}var se=e(r(),1);function ce(e){let t=le(e),n=p.forwardRef((e,n)=>{let{children:r,...i}=e,a=p.Children.toArray(r),o=a.find(de);if(o){let e=o.props.children,r=a.map(t=>t===o?p.Children.count(e)>1?p.Children.only(null):p.isValidElement(e)?e.props.children:null:t);return(0,k.jsx)(t,{...i,ref:n,children:p.isValidElement(e)?p.cloneElement(e,void 0,r):null})}return(0,k.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function le(e){let t=p.forwardRef((e,t)=>{let{children:n,...r}=e;if(p.isValidElement(n)){let e=pe(n),i=fe(r,n.props);return n.type!==p.Fragment&&(i.ref=t?l(t,e):e),p.cloneElement(n,i)}return p.Children.count(n)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ue=Symbol(`radix.slottable`);function de(e){return p.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ue}function fe(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function pe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var F=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=ce(`Primitive.${t}`),r=p.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,k.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function me(e,t){e&&se.flushSync(()=>e.dispatchEvent(t))}function I(e){let t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...e)=>t.current?.(...e),[])}function he(e,t=globalThis?.document){let n=I(e);p.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var ge=`DismissableLayer`,_e=`dismissableLayer.update`,ve=`dismissableLayer.pointerDownOutside`,ye=`dismissableLayer.focusOutside`,be,xe=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Se=p.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:c,...l}=e,u=p.useContext(xe),[d,f]=p.useState(null),m=d?.ownerDocument??globalThis?.document,[,h]=p.useState({}),g=s(t,e=>f(e)),_=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=_.indexOf(v),b=d?_.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=Te(e=>{let t=e.target,n=[...u.branches].some(e=>e.contains(t));!S||n||(i?.(e),o?.(e),e.defaultPrevented||c?.())},m),w=Ee(e=>{let t=e.target;[...u.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||c?.())},m);return he(e=>{b===u.layers.size-1&&(r?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},m),p.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(be=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),De(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=be)}},[d,m,n,u]),p.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),De())},[d,u]),p.useEffect(()=>{let e=()=>h({});return document.addEventListener(_e,e),()=>document.removeEventListener(_e,e)},[]),(0,k.jsx)(F.div,{...l,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:O(e.onFocusCapture,w.onFocusCapture),onBlurCapture:O(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:O(e.onPointerDownCapture,C.onPointerDownCapture)})});Se.displayName=ge;var Ce=`DismissableLayerBranch`,we=p.forwardRef((e,t)=>{let n=p.useContext(xe),r=p.useRef(null),i=s(t,r);return p.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,k.jsx)(F.div,{...e,ref:i})});we.displayName=Ce;function Te(e,t=globalThis?.document){let n=I(e),r=p.useRef(!1),i=p.useRef(()=>{});return p.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Oe(ve,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ee(e,t=globalThis?.document){let n=I(e),r=p.useRef(!1);return p.useEffect(()=>{let e=e=>{e.target&&!r.current&&Oe(ye,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function De(){let e=new CustomEvent(_e);document.dispatchEvent(e)}function Oe(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?me(i,a):i.dispatchEvent(a)}var ke=`focusScope.autoFocusOnMount`,Ae=`focusScope.autoFocusOnUnmount`,je={bubbles:!1,cancelable:!0},Me=`FocusScope`,Ne=p.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[c,l]=p.useState(null),u=I(i),d=I(a),f=p.useRef(null),m=s(t,e=>l(e)),h=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let e=function(e){if(h.paused||!c)return;let t=e.target;c.contains(t)?f.current=t:L(f.current,{select:!0})},t=function(e){if(h.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||L(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&L(c)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,h.paused]),p.useEffect(()=>{if(c){Be.add(h);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(ke,je);c.addEventListener(ke,u),c.dispatchEvent(t),t.defaultPrevented||(Pe(Ue(Ie(c)),{select:!0}),document.activeElement===e&&L(c))}return()=>{c.removeEventListener(ke,u),setTimeout(()=>{let t=new CustomEvent(Ae,je);c.addEventListener(Ae,d),c.dispatchEvent(t),t.defaultPrevented||L(e??document.body,{select:!0}),c.removeEventListener(Ae,d),Be.remove(h)},0)}}},[c,u,d,h]);let g=p.useCallback(e=>{if(!n&&!r||h.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Fe(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&L(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&L(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,h.paused]);return(0,k.jsx)(F.div,{tabIndex:-1,...o,ref:m,onKeyDown:g})});Ne.displayName=Me;function Pe(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(L(r,{select:t}),document.activeElement!==n)return}function Fe(e){let t=Ie(e);return[Le(t,e),Le(t.reverse(),e)]}function Ie(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Le(e,t){for(let n of e)if(!Re(n,{upTo:t}))return n}function Re(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function ze(e){return e instanceof HTMLInputElement&&`select`in e}function L(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ze(e)&&t&&e.select()}}var Be=Ve();function Ve(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=He(e,t),e.unshift(t)},remove(t){e=He(e,t),e[0]?.resume()}}}function He(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ue(e){return e.filter(e=>e.tagName!==`A`)}var We=`Portal`,Ge=p.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=p.useState(!1);M(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?se.createPortal((0,k.jsx)(F.div,{...r,ref:t}),o):null});Ge.displayName=We;function Ke(e,t){return p.useReducer((e,n)=>t[e][n]??e,e)}var R=e=>{let{present:t,children:n}=e,r=qe(t),i=typeof n==`function`?n({present:r.isPresent}):p.Children.only(n),a=s(r.ref,Ye(i));return typeof n==`function`||r.isPresent?p.cloneElement(i,{ref:a}):null};R.displayName=`Presence`;function qe(e){let[t,n]=p.useState(),r=p.useRef(null),i=p.useRef(e),a=p.useRef(`none`),[o,s]=Ke(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return p.useEffect(()=>{let e=Je(r.current);a.current=o===`mounted`?e:`none`},[o]),M(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Je(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),M(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Je(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Je(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:p.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Je(e){return e?.animationName||`none`}function Ye(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xe=0;function Ze(){p.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Qe()),document.body.insertAdjacentElement(`beforeend`,e[1]??Qe()),Xe++,()=>{Xe===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Xe--}},[])}function Qe(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var z=function(){return z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},z.apply(this,arguments)};function $e(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function et(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var tt=`right-scroll-bar-position`,nt=`width-before-scroll-bar`,rt=`with-scroll-bars-hidden`,it=`--removed-body-scroll-bar-size`;function at(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ot(e,t){var n=(0,p.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var st=typeof window<`u`?p.useLayoutEffect:p.useEffect,ct=new WeakMap;function lt(e,t){var n=ot(t||null,function(t){return e.forEach(function(e){return at(e,t)})});return st(function(){var t=ct.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||at(e,null)}),i.forEach(function(e){r.has(e)||at(e,a)})}ct.set(n,e)},[e]),n}function ut(e){return e}function dt(e,t){t===void 0&&(t=ut);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function ft(e){e===void 0&&(e={});var t=dt(null);return t.options=z({async:!0,ssr:!1},e),t}var pt=function(e){var t=e.sideCar,n=$e(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return p.createElement(r,z({},n))};pt.isSideCarExport=!0;function mt(e,t){return e.useMedium(t),pt}var ht=ft(),gt=function(){},_t=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:gt,onWheelCapture:gt,onTouchMoveCapture:gt}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=$e(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=lt([n,t]),w=z(z({},x),i);return p.createElement(p.Fragment,null,u&&p.createElement(S,{sideCar:ht,removeScrollBar:l,shards:d,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?p.cloneElement(p.Children.only(s),z(z({},w),{ref:C})):p.createElement(y,z({},w,{className:c,ref:C}),s))});_t.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},_t.classNames={fullWidth:nt,zeroRight:tt};var vt,yt=function(){if(vt)return vt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function bt(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=yt();return t&&e.setAttribute(`nonce`,t),e}function xt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function St(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Ct=function(){var e=0,t=null;return{add:function(n){e==0&&(t=bt())&&(xt(t,n),St(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},wt=function(){var e=Ct();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Tt=function(){var e=wt();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Et={left:0,top:0,right:0,gap:0},Dt=function(e){return parseInt(e||``,10)||0},Ot=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Dt(n),Dt(r),Dt(i)]},kt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Et;var t=Ot(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},At=Tt(),B=`data-scroll-locked`,jt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
+ .${rt} {
3
+ overflow: hidden ${r};
4
+ padding-right: ${s}px ${r};
5
+ }
6
+ body[${B}] {
7
+ overflow: hidden ${r};
8
+ overscroll-behavior: contain;
9
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
10
+ padding-left: ${i}px;
11
+ padding-top: ${a}px;
12
+ padding-right: ${o}px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: ${s}px ${r};
16
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
+ }
18
+
19
+ .${tt} {
20
+ right: ${s}px ${r};
21
+ }
22
+
23
+ .${nt} {
24
+ margin-right: ${s}px ${r};
25
+ }
26
+
27
+ .${tt} .${tt} {
28
+ right: 0 ${r};
29
+ }
30
+
31
+ .${nt} .${nt} {
32
+ margin-right: 0 ${r};
33
+ }
34
+
35
+ body[${B}] {
36
+ ${it}: ${s}px;
37
+ }
38
+ `},Mt=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Nt=function(){p.useEffect(function(){return document.body.setAttribute(B,(Mt()+1).toString()),function(){var e=Mt()-1;e<=0?document.body.removeAttribute(B):document.body.setAttribute(B,e.toString())}},[])},Pt=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Nt();var a=p.useMemo(function(){return kt(i)},[i]);return p.createElement(At,{styles:jt(a,!t,i,n?``:`!important`)})},Ft=!1;if(typeof window<`u`)try{var It=Object.defineProperty({},`passive`,{get:function(){return Ft=!0,!0}});window.addEventListener(`test`,It,It),window.removeEventListener(`test`,It,It)}catch{Ft=!1}var V=Ft?{passive:!1}:!1,Lt=function(e){return e.tagName===`TEXTAREA`},Rt=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Lt(e)&&n[t]===`visible`)},zt=function(e){return Rt(e,`overflowY`)},Bt=function(e){return Rt(e,`overflowX`)},Vt=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Wt(e,r)){var i=Gt(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ht=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Ut=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Wt=function(e,t){return e===`v`?zt(t):Bt(t)},Gt=function(e,t){return e===`v`?Ht(t):Ut(t)},Kt=function(e,t){return e===`h`&&t===`rtl`?-1:1},qt=function(e,t,n,r,i){var a=Kt(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Gt(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Wt(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Jt=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Yt=function(e){return[e.deltaX,e.deltaY]},Xt=function(e){return e&&`current`in e?e.current:e},Zt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Qt=function(e){return`
39
+ .block-interactivity-${e} {pointer-events: none;}
40
+ .allow-interactivity-${e} {pointer-events: all;}
41
+ `},$t=0,H=[];function en(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),i=p.useState($t++)[0],a=p.useState(Tt)[0],o=p.useRef(e);p.useEffect(function(){o.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=et([e.lockRef.current],(e.shards||[]).map(Xt),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=p.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Jt(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Vt(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Vt(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return qt(h,t,e,h===`h`?s:c,!0)},[]),c=p.useCallback(function(e){var n=e;if(!(!H.length||H[H.length-1]!==a)){var r=`deltaY`in n?Yt(n):Jt(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Zt(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Xt).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=p.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:tn(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=p.useCallback(function(e){n.current=Jt(e),r.current=void 0},[]),d=p.useCallback(function(t){l(t.type,Yt(t),t.target,s(t,e.lockRef.current))},[]),f=p.useCallback(function(t){l(t.type,Jt(t),t.target,s(t,e.lockRef.current))},[]);p.useEffect(function(){return H.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,V),document.addEventListener(`touchmove`,c,V),document.addEventListener(`touchstart`,u,V),function(){H=H.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,V),document.removeEventListener(`touchmove`,c,V),document.removeEventListener(`touchstart`,u,V)}},[]);var m=e.removeScrollBar,h=e.inert;return p.createElement(p.Fragment,null,h?p.createElement(a,{styles:Qt(i)}):null,m?p.createElement(Pt,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function tn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var nn=mt(ht,en),rn=p.forwardRef(function(e,t){return p.createElement(_t,z({},e,{ref:t,sideCar:nn}))});rn.classNames=_t.classNames;var an=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},U=new WeakMap,on=new WeakMap,sn={},cn=0,ln=function(e){return e&&(e.host||ln(e.parentNode))},un=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=ln(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},dn=function(e,t,n,r){var i=un(t,Array.isArray(e)?e:[e]);sn[n]||(sn[n]=new WeakMap);var a=sn[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(U.get(e)||0)+1,l=(a.get(e)||0)+1;U.set(e,c),a.set(e,l),o.push(e),c===1&&i&&on.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),cn++,function(){o.forEach(function(e){var t=U.get(e)-1,i=a.get(e)-1;U.set(e,t),a.set(e,i),t||(on.has(e)||e.removeAttribute(r),on.delete(e)),i||e.removeAttribute(n)}),cn--,cn||(U=new WeakMap,U=new WeakMap,on=new WeakMap,sn={})}},fn=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||an(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),dn(r,i,n,`aria-hidden`)):function(){return null}},pn=`Dialog`,[mn,hn]=j(pn),[gn,W]=mn(pn),_n=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=p.useRef(null),c=p.useRef(null),[l,u]=P({prop:r,defaultProp:i??!1,onChange:a,caller:pn});return(0,k.jsx)(gn,{scope:t,triggerRef:s,contentRef:c,contentId:N(),titleId:N(),descriptionId:N(),open:l,onOpenChange:u,onOpenToggle:p.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};_n.displayName=pn;var vn=`DialogTrigger`,yn=p.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=W(vn,n),a=s(t,i.triggerRef);return(0,k.jsx)(F.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Rn(i.open),...r,ref:a,onClick:O(e.onClick,i.onOpenToggle)})});yn.displayName=vn;var bn=`DialogPortal`,[xn,Sn]=mn(bn,{forceMount:void 0}),Cn=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=W(bn,t);return(0,k.jsx)(xn,{scope:t,forceMount:n,children:p.Children.map(r,e=>(0,k.jsx)(R,{present:n||a.open,children:(0,k.jsx)(Ge,{asChild:!0,container:i,children:e})}))})};Cn.displayName=bn;var wn=`DialogOverlay`,Tn=p.forwardRef((e,t)=>{let n=Sn(wn,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=W(wn,e.__scopeDialog);return a.modal?(0,k.jsx)(R,{present:r||a.open,children:(0,k.jsx)(Dn,{...i,ref:t})}):null});Tn.displayName=wn;var En=ce(`DialogOverlay.RemoveScroll`),Dn=p.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=W(wn,n);return(0,k.jsx)(rn,{as:En,allowPinchZoom:!0,shards:[i.contentRef],children:(0,k.jsx)(F.div,{"data-state":Rn(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),G=`DialogContent`,On=p.forwardRef((e,t)=>{let n=Sn(G,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=W(G,e.__scopeDialog);return(0,k.jsx)(R,{present:r||a.open,children:a.modal?(0,k.jsx)(kn,{...i,ref:t}):(0,k.jsx)(An,{...i,ref:t})})});On.displayName=G;var kn=p.forwardRef((e,t)=>{let n=W(G,e.__scopeDialog),r=p.useRef(null),i=s(t,n.contentRef,r);return p.useEffect(()=>{let e=r.current;if(e)return fn(e)},[]),(0,k.jsx)(jn,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:O(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:O(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:O(e.onFocusOutside,e=>e.preventDefault())})}),An=p.forwardRef((e,t)=>{let n=W(G,e.__scopeDialog),r=p.useRef(!1),i=p.useRef(!1);return(0,k.jsx)(jn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),jn=p.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,c=W(G,n),l=p.useRef(null),u=s(t,l);return Ze(),(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Ne,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,k.jsx)(Se,{role:`dialog`,id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Rn(c.open),...o,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Hn,{titleId:c.titleId}),(0,k.jsx)(Wn,{contentRef:l,descriptionId:c.descriptionId})]})]})}),Mn=`DialogTitle`,Nn=p.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=W(Mn,n);return(0,k.jsx)(F.h2,{id:i.titleId,...r,ref:t})});Nn.displayName=Mn;var Pn=`DialogDescription`,Fn=p.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=W(Pn,n);return(0,k.jsx)(F.p,{id:i.descriptionId,...r,ref:t})});Fn.displayName=Pn;var In=`DialogClose`,Ln=p.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=W(In,n);return(0,k.jsx)(F.button,{type:`button`,...r,ref:t,onClick:O(e.onClick,()=>i.onOpenChange(!1))})});Ln.displayName=In;function Rn(e){return e?`open`:`closed`}var zn=`DialogTitleWarning`,[Bn,Vn]=A(zn,{contentName:G,titleName:Mn,docsSlug:`dialog`}),Hn=({titleId:e})=>{let t=Vn(zn),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
42
+
43
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
44
+
45
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Un=`DialogDescriptionWarning`,Wn=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Vn(Un).contentName}}.`;return p.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Gn=_n,Kn=Cn,qn=Tn,Jn=On,Yn=Nn,Xn=Fn,Zn=Ln,K=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=c(`Primitive.${t}`),r=p.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,k.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),q=`[cmdk-group=""]`,Qn=`[cmdk-group-items=""]`,$n=`[cmdk-group-heading=""]`,er=`[cmdk-item=""]`,tr=`${er}:not([aria-disabled="true"])`,nr=`cmdk-item-select`,J=`data-value`,rr=(e,t,n)=>ee(e,t,n),ir=p.createContext(void 0),Y=()=>p.useContext(ir),ar=p.createContext(void 0),or=()=>p.useContext(ar),sr=p.createContext(void 0),cr=p.forwardRef((e,t)=>{let n=Q(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Q(()=>new Set),i=Q(()=>new Map),a=Q(()=>new Map),o=Q(()=>new Set),s=yr(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=N(),b=N(),x=N(),S=p.useRef(null),C=xr();Z(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),Z(()=>{C(6,k)},[]);let w=p.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)O(),D(),C(1,ee);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=A()?.id,w.emit()}),r||C(5,k),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=p.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{O(),D(),n.current.value||ee(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();C(4,()=>{O(),t?.getAttribute(`id`)===e&&ee(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??rr;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;j().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Qn);t?t.appendChild(e.parentElement===t?e:e.closest(`${Qn} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Qn} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${q}[${J}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function ee(){let e=j().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(J);w.setState(`value`,e||void 0)}function O(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function k(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(q)?.querySelector($n))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return S.current?.querySelector(`${er}[aria-selected="true"]`)}function j(){return Array.from(S.current?.querySelectorAll(tr)||[])}function te(e){let t=j()[e];t&&w.setState(`value`,t.getAttribute(J))}function M(e){var t;let n=A(),r=j(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(J))}function ne(e){let t=A()?.closest(q),n;for(;t&&!n;)t=e>0?_r(t,q):vr(t,q),n=t?.querySelector(tr);n?w.setState(`value`,n.getAttribute(J)):M(e)}let re=()=>te(j().length-1),ie=e=>{e.preventDefault(),e.metaKey?re():e.altKey?ne(1):M(1)},P=e=>{e.preventDefault(),e.metaKey?te(0):e.altKey?ne(-1):M(-1)};return p.createElement(K.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&ie(e);break;case`ArrowDown`:ie(e);break;case`p`:case`k`:_&&e.ctrlKey&&P(e);break;case`ArrowUp`:P(e);break;case`Home`:e.preventDefault(),te(0);break;case`End`:e.preventDefault(),re();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(nr);t.dispatchEvent(e)}}}}},p.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:wr},c),Cr(e,e=>p.createElement(ar.Provider,{value:w},p.createElement(ir.Provider,{value:T},e))))}),lr=p.forwardRef((e,t)=>{let n=N(),r=p.useRef(null),i=p.useContext(sr),a=Y(),o=yr(e),s=o.current?.forceMount??i?.forceMount;Z(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=br(n,r,[e.value,e.children,r],e.keywords),u=or(),d=$(e=>e.value&&e.value===c.current),f=$(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);p.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(nr,m),()=>t.removeEventListener(nr,m)},[f,e.onSelect,e.disabled]);function m(){var e,t;h(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function h(){u.setState(`value`,c.current,!0)}if(!f)return null;let{disabled:g,value:_,onSelect:v,forceMount:y,keywords:b,...x}=e;return p.createElement(K.div,{ref:l(r,t),...x,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!g,"aria-selected":!!d,"data-disabled":!!g,"data-selected":!!d,onPointerMove:g||a.getDisablePointerSelection()?void 0:h,onClick:g?void 0:m},e.children)}),ur=p.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=N(),s=p.useRef(null),c=p.useRef(null),u=N(),d=Y(),f=$(e=>i||d.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);Z(()=>d.group(o),[]),br(o,s,[e.value,e.heading,c]);let m=p.useMemo(()=>({id:o,forceMount:i}),[i]);return p.createElement(K.div,{ref:l(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:f?void 0:!0},n&&p.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:u},n),Cr(e,e=>p.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?u:void 0},p.createElement(sr.Provider,{value:m},e))))}),dr=p.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=p.useRef(null),a=$(e=>!e.search);return!n&&!a?null:p.createElement(K.div,{ref:l(i,t),...r,"cmdk-separator":``,role:`separator`})}),fr=p.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=or(),o=$(e=>e.search),s=$(e=>e.selectedItemId),c=Y();return p.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),p.createElement(K.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),pr=p.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=p.useRef(null),o=p.useRef(null),s=$(e=>e.selectedItemId),c=Y();return p.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),p.createElement(K.div,{ref:l(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},Cr(e,e=>p.createElement(`div`,{ref:l(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),mr=p.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return p.createElement(Gn,{open:n,onOpenChange:r},p.createElement(Kn,{container:o},p.createElement(qn,{"cmdk-overlay":``,className:i}),p.createElement(Jn,{"aria-label":e.label,"cmdk-dialog":``,className:a},p.createElement(cr,{ref:t,...s}))))}),hr=p.forwardRef((e,t)=>$(e=>e.filtered.count===0)?p.createElement(K.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),gr=p.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return p.createElement(K.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Cr(e,e=>p.createElement(`div`,{"aria-hidden":!0},e)))}),X=Object.assign(cr,{List:pr,Item:lr,Input:fr,Group:ur,Separator:dr,Dialog:mr,Empty:hr,Loading:gr});function _r(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function vr(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function yr(e){let t=p.useRef(e);return Z(()=>{t.current=e}),t}var Z=typeof window>`u`?p.useEffect:p.useLayoutEffect;function Q(e){let t=p.useRef();return t.current===void 0&&(t.current=e()),t}function $(e){let t=or(),n=()=>e(t.snapshot());return p.useSyncExternalStore(t.subscribe,n,n)}function br(e,t,n,r=[]){let i=p.useRef(),a=Y();return Z(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(J,s),i.current=s}),i}var xr=()=>{let[e,t]=p.useState(),n=Q(()=>new Map);return Z(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Sr(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Cr({asChild:e,children:t},n){return e&&p.isValidElement(t)?p.cloneElement(Sr(t),{ref:t.ref},n(t.props.children)):n(t)}var wr={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Tr({...e}){return(0,k.jsx)(Gn,{"data-slot":`dialog`,...e})}function Er({...e}){return(0,k.jsx)(Kn,{"data-slot":`dialog-portal`,...e})}function Dr({className:e,...t}){return(0,k.jsx)(qn,{"data-slot":`dialog-overlay`,className:a(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50`,e),...t})}function Or({className:e,children:t,showCloseButton:n=!0,...r}){return(0,k.jsxs)(Er,{"data-slot":`dialog-portal`,children:[(0,k.jsx)(Dr,{}),(0,k.jsxs)(Jn,{"data-slot":`dialog-content`,className:a(`bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg`,e),...r,children:[t,n&&(0,k.jsxs)(Zn,{"data-slot":`dialog-close`,className:`ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,k.jsx)(f,{}),(0,k.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function kr({className:e,...t}){return(0,k.jsx)(`div`,{"data-slot":`dialog-header`,className:a(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function Ar({className:e,...t}){return(0,k.jsx)(Yn,{"data-slot":`dialog-title`,className:a(`text-lg leading-none font-semibold`,e),...t})}function jr({className:e,...t}){return(0,k.jsx)(Xn,{"data-slot":`dialog-description`,className:a(`text-muted-foreground text-sm`,e),...t})}function Mr({className:e,...t}){return(0,k.jsx)(X,{"data-slot":`command`,className:a(`bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md`,e),...t})}function Nr({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:r,showCloseButton:i=!0,...o}){return(0,k.jsxs)(Tr,{...o,children:[(0,k.jsxs)(kr,{className:`sr-only`,children:[(0,k.jsx)(Ar,{children:e}),(0,k.jsx)(jr,{children:t})]}),(0,k.jsx)(Or,{className:a(`overflow-hidden p-0`,r),showCloseButton:i,children:(0,k.jsx)(Mr,{className:`[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:n})})]})}function Pr({className:e,...t}){return(0,k.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b px-3`,children:[(0,k.jsx)(o,{className:`size-4 shrink-0 opacity-50`}),(0,k.jsx)(X.Input,{"data-slot":`command-input`,className:a(`placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function Fr({className:e,...t}){return(0,k.jsx)(X.List,{"data-slot":`command-list`,className:a(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...t})}function Ir({...e}){return(0,k.jsx)(X.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function Lr({className:e,...t}){return(0,k.jsx)(X.Group,{"data-slot":`command-group`,className:a(`text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium`,e),...t})}function Rr({className:e,...t}){return(0,k.jsx)(X.Separator,{"data-slot":`command-separator`,className:a(`bg-border -mx-1 h-px`,e),...t})}function zr({className:e,...t}){return(0,k.jsx)(X.Item,{"data-slot":`command-item`,className:a(`data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...t})}export{M as C,d as D,f as E,u as O,N as S,O as T,Se as _,Pr as a,ce as b,Rr as c,fn as d,rn as f,Ne as g,Ge as h,Lr as i,rr as l,R as m,Nr as n,zr as o,Ze as p,Ir as r,Fr as s,Mr as t,X as u,I as v,j as w,P as x,F as y};
@@ -0,0 +1 @@
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-DWSWI4JT.js";import{i as r,p as i,r as a}from"./modviz-data-BiRqoDI5.js";import{t as o}from"./compare-TOnoe1EP.js";import{r as s}from"./utils-DkkZd0ys.js";import{s as c,t as l}from"./modviz-layout-Do93E-IB.js";import{D as u,O as d,a as f,i as p,n as m,o as h,r as g,s as _}from"./command-kkF7_wdz.js";import{t as v}from"./button-aOWckyNs.js";import{i as y,n as b,r as x,t as S}from"./tooltip-B1VDU9HG.js";import{t as C}from"./formatting-CiC0SYI8.js";var w=s(`file-up`,[[`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:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),T=s(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),E=e=>Array.from(e).sort((e,t)=>e.localeCompare(t)),D=e=>new Set(e.nodes.flatMap(e=>e.importees.map(t=>`${e.path} -> ${t}`))),O=(e,t)=>{if(!e.includes(`node_modules`))return t??`external`;if(t&&t!==`node_modules`)return t;let n=e.split(/[\\/]/).filter(Boolean),r=n.lastIndexOf(`node_modules`);if(r===-1)return`node_modules`;let i=n[r+1],a=n[r+2];return i?i.startsWith(`@`)&&a?`${i}/${a}`:i:`node_modules`},k=e=>new Set(e.nodes.filter(e=>e.path.includes(`node_modules`)).map(e=>O(e.path,e.package?.name)).filter(Boolean)),A=e=>new Map(e.nodes.map(e=>[e.path,e])),j=(e,t)=>{let n=new Set;for(let r of e)t.has(r)||n.add(r);return n},M=(e,t)=>{let n=A(e),r=A(t),i=new Set(n.keys()),a=new Set(r.keys()),o=D(e),s=D(t),c=new Set(e.metadata.packages.map(e=>e.name)),l=new Set(t.metadata.packages.map(e=>e.name)),u=k(e),d=k(t),f=[];for(let[e,t]of n.entries()){let n=r.get(e);if(!n)continue;let i=Math.abs(n.importedBy.length-t.importedBy.length)+Math.abs(n.importees.length-t.importees.length)+Math.abs(n.imports.length-t.imports.length);i!==0&&f.push({path:e,baselineIncoming:t.importedBy.length,currentIncoming:n.importedBy.length,baselineOutgoing:t.importees.length,currentOutgoing:n.importees.length,baselineImports:t.imports.length,currentImports:n.imports.length,deltaMagnitude:i})}return f.sort((e,t)=>t.deltaMagnitude-e.deltaMagnitude||e.path.localeCompare(t.path)),{baselineGeneratedAt:e.metadata.generatedAt??null,currentGeneratedAt:t.metadata.generatedAt??null,summary:{baselineEdges:o.size,baselineExternalPackages:u.size,baselineImportStatements:e.nodes.reduce((e,t)=>e+t.imports.length,0),baselineNodes:e.nodes.length,baselineWorkspacePackages:c.size,currentEdges:s.size,currentExternalPackages:d.size,currentImportStatements:t.nodes.reduce((e,t)=>e+t.imports.length,0),currentNodes:t.nodes.length,currentWorkspacePackages:l.size},addedEdges:E(j(s,o)),addedExternalPackages:E(j(d,u)),addedNodes:E(j(a,i)),addedWorkspacePackages:E(j(l,c)),changedNodes:f,removedEdges:E(j(o,s)),removedExternalPackages:E(j(u,d)),removedNodes:E(j(i,a)),removedWorkspacePackages:E(j(c,l))}},N=e(t(),1),P=n(),F=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return!!(t.metadata&&Array.isArray(t.nodes)&&Array.isArray(t.imports))},I=(e,t)=>{let n=t-e;return`${n>0?`+`:``}${C.format(n)}`},L=async e=>{let t=JSON.parse(await e.text());if(!F(t))throw Error(`The selected file is not a valid modviz graph JSON snapshot.`);return{graph:t,label:e.name}};function R(e){let[t,n]=(0,N.useState)(!1);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(v,{variant:`outline`,className:`mt-3 w-full justify-between`,onClick:()=>n(!0),children:[(0,P.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(T,{className:`size-4`}),`Pick from snapshot history`]}),(0,P.jsx)(d,{className:`size-4 opacity-50`})]}),(0,P.jsxs)(m,{open:t,onOpenChange:n,children:[(0,P.jsx)(f,{placeholder:`Search snapshots…`}),(0,P.jsxs)(_,{children:[(0,P.jsx)(g,{children:`No snapshots found.`}),(0,P.jsx)(p,{heading:`Saved snapshots`,children:e.history.map(t=>(0,P.jsx)(h,{value:t.id+` `+(t.label??``),onSelect:()=>{e.onSelect(t.id),n(!1)},children:(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,P.jsx)(`span`,{className:`truncate font-medium`,children:t.label||t.id}),t.generatedAt?(0,P.jsx)(`span`,{className:`truncate text-xs text-slate-500`,children:new Date(t.generatedAt).toLocaleString()}):null]})},t.id))})]})]})]})}function z(e){return(0,P.jsxs)(`section`,{className:`rounded-[24px] border border-slate-200/70 bg-white/90 p-5 shadow-[0_16px_50px_-32px_rgba(15,23,42,0.55)] dark:border-slate-800 dark:bg-slate-950/70`,children:[(0,P.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.2em] text-slate-500 dark:text-slate-400`,children:e.title}),(0,P.jsx)(`h2`,{className:`mt-2 text-lg font-semibold text-slate-900 dark:text-slate-100`,children:e.snapshot?.label??e.label}),(0,P.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-slate-500 dark:text-slate-400`,children:e.description})]}),e.secondaryAction]}),(0,P.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-center justify-center gap-2 rounded-2xl border border-dashed border-slate-300 bg-slate-50 px-4 py-5 text-sm font-medium text-slate-600 transition hover:border-sky-300 hover:bg-sky-50 hover:text-sky-700 dark:border-slate-700 dark:bg-slate-900/70 dark:text-slate-300 dark:hover:border-sky-500/60 dark:hover:bg-sky-500/10 dark:hover:text-sky-200`,children:[(0,P.jsx)(w,{className:`size-4`}),(0,P.jsx)(`span`,{children:`Load JSON snapshot`}),(0,P.jsx)(`input`,{accept:`application/json,.json`,className:`sr-only`,type:`file`,onChange:t=>{let n=t.currentTarget.files?.[0];n&&e.onFileChange(n),t.currentTarget.value=``}})]}),e.history&&e.history.length>0&&e.onHistorySelect?(0,P.jsx)(R,{history:e.history,onSelect:e.onHistorySelect}):null,e.snapshot?(0,P.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-3`,children:[(0,P.jsx)(B,{label:`Nodes`,value:e.snapshot.graph.nodes.length}),(0,P.jsx)(B,{label:`Edges`,value:e.snapshot.graph.nodes.reduce((e,t)=>e+t.importees.length,0)}),(0,P.jsx)(B,{label:`Generated`,valueLabel:new Date(e.snapshot.graph.metadata.generatedAt).toLocaleString()})]}):null]})}function B(e){return(0,P.jsxs)(`div`,{className:`rounded-[20px] bg-slate-50/90 p-4 dark:bg-slate-900/70`,children:[(0,P.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-slate-400`,children:e.label}),(0,P.jsx)(`p`,{className:`mt-2 text-xl font-semibold text-slate-900 dark:text-slate-100`,children:e.valueLabel??C.format(e.value??0)})]})}function V(e){let t=e.current-e.baseline,n=t===0?`text-slate-500 dark:text-slate-400`:t>0?`text-emerald-600 dark:text-emerald-300`:`text-rose-600 dark:text-rose-300`;return(0,P.jsxs)(`div`,{className:`rounded-[24px] border border-slate-200/70 bg-white/90 p-5 shadow-[0_16px_50px_-32px_rgba(15,23,42,0.55)] dark:border-slate-800 dark:bg-slate-950/70`,children:[(0,P.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.2em] text-slate-500 dark:text-slate-400`,children:e.label}),(0,P.jsxs)(`div`,{className:`mt-3 flex items-end justify-between gap-4`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-3xl font-semibold text-slate-900 dark:text-slate-100`,children:C.format(e.current)}),(0,P.jsxs)(`p`,{className:`mt-2 text-sm text-slate-500 dark:text-slate-400`,children:[`was `,C.format(e.baseline)]})]}),(0,P.jsx)(`p`,{className:`text-sm font-semibold ${n}`,children:I(e.baseline,e.current)})]}),(0,P.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-slate-500 dark:text-slate-400`,children:e.note})]})}function H(e){return(0,P.jsxs)(`section`,{className:`rounded-[24px] border border-slate-200/70 bg-white/90 p-5 shadow-[0_16px_50px_-32px_rgba(15,23,42,0.55)] dark:border-slate-800 dark:bg-slate-950/70`,children:[(0,P.jsx)(`h3`,{className:`text-base font-semibold text-slate-900 dark:text-slate-100`,children:e.title}),(0,P.jsx)(`div`,{className:`mt-4 max-h-[20rem] space-y-2 overflow-auto pr-2`,children:e.items.length===0?(0,P.jsx)(`p`,{className:`text-sm text-slate-500 dark:text-slate-400`,children:e.emptyMessage}):e.items.slice(0,80).map(e=>(0,P.jsx)(`div`,{className:`rounded-2xl bg-slate-50 px-3 py-2 font-mono text-xs text-slate-700 dark:bg-slate-900/70 dark:text-slate-200`,children:e},e))})]})}function U(e){let t=(e,t,n=`left`)=>(0,P.jsxs)(S,{children:[(0,P.jsx)(y,{asChild:!0,children:(0,P.jsx)(`button`,{type:`button`,className:`inline-flex items-center gap-1 ${n===`right`?`ml-auto`:``}`,children:e})}),(0,P.jsxs)(x,{children:[(0,P.jsx)(`p`,{children:t}),(0,P.jsx)(b,{})]})]});return(0,P.jsxs)(`section`,{className:`rounded-[24px] border border-slate-200/70 bg-white/90 p-5 shadow-[0_16px_50px_-32px_rgba(15,23,42,0.55)] dark:border-slate-800 dark:bg-slate-950/70`,children:[(0,P.jsx)(`h3`,{className:`text-base font-semibold text-slate-900 dark:text-slate-100`,children:`Modules with the largest direct-graph deltas`}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-slate-500 dark:text-slate-400`,children:`Inbound counts are direct importers of a file, outbound counts are direct importees, and imports are the number of import statements declared in that file.`}),(0,P.jsx)(`div`,{className:`mt-4 overflow-hidden rounded-2xl border border-slate-200/70 dark:border-slate-800`,children:(0,P.jsxs)(`table`,{className:`min-w-full divide-y divide-slate-200 dark:divide-slate-800`,children:[(0,P.jsx)(`thead`,{className:`bg-slate-50/90 dark:bg-slate-900/80`,children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{className:`px-4 py-3 text-left text-xs font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-slate-400`,children:`Path`}),(0,P.jsx)(`th`,{className:`px-4 py-3 text-right text-xs font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-slate-400`,children:t(`Inbound`,`How many direct importers point at this file or module path in each snapshot.`,`right`)}),(0,P.jsx)(`th`,{className:`px-4 py-3 text-right text-xs font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-slate-400`,children:t(`Outbound`,`How many direct importee targets this file imports in each snapshot.`,`right`)}),(0,P.jsx)(`th`,{className:`px-4 py-3 text-right text-xs font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-slate-400`,children:t(`Imports`,`How many import statements were parsed in that file, even if multiple statements resolve to the same outbound module.`,`right`)})]})}),(0,P.jsx)(`tbody`,{className:`divide-y divide-slate-200 bg-white dark:divide-slate-800 dark:bg-slate-950/60`,children:e.rows.length===0?(0,P.jsx)(`tr`,{children:(0,P.jsx)(`td`,{colSpan:4,className:`px-4 py-6 text-sm text-slate-500 dark:text-slate-400`,children:`No direct node-level count changes were detected between these snapshots.`})}):e.rows.slice(0,24).map(e=>(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`td`,{className:`max-w-[32rem] truncate px-4 py-3 font-mono text-xs text-slate-700 dark:text-slate-200`,children:e.path}),(0,P.jsxs)(`td`,{className:`px-4 py-3 text-right text-sm text-slate-700 dark:text-slate-200`,children:[e.baselineIncoming,` → `,e.currentIncoming]}),(0,P.jsxs)(`td`,{className:`px-4 py-3 text-right text-sm text-slate-700 dark:text-slate-200`,children:[e.baselineOutgoing,` → `,e.currentOutgoing]}),(0,P.jsxs)(`td`,{className:`px-4 py-3 text-right text-sm text-slate-700 dark:text-slate-200`,children:[e.baselineImports,` → `,e.currentImports]})]},e.path))})]})})]})}function W(e){let[t,n]=(0,N.useState)(null),[i,o]=(0,N.useState)(!1),s=(0,N.useMemo)(()=>e.currentGraph?{graph:e.currentGraph,label:`Current served snapshot`}:null,[e.currentGraph]),[l,d]=(0,N.useState)(null),[f,p]=(0,N.useState)(null),[m,h]=(0,N.useState)(null),g=t??e.history,_=f??s,y=(e,t)=>{if(e===`baseline`){d(t);return}p(t)},b=async()=>{try{o(!0),h(null),n(await r())}catch(e){h(e instanceof Error?e.message:`Failed to refresh snapshot history.`)}finally{o(!1)}},x=(0,N.useMemo)(()=>!l||!_?null:M(l.graph,_.graph),[l,_]),S=async(e,t)=>{try{h(null),y(e,await L(t))}catch(e){h(e instanceof Error?e.message:`Failed to load the selected snapshot.`)}},C=async(e,t)=>{try{h(null),y(e,{graph:await a(t),label:t})}catch(e){h(e instanceof Error?e.message:`Failed to load snapshot ${t}.`)}};return(0,N.useEffect)(()=>{e.baselineSnapshotId&&C(`baseline`,e.baselineSnapshotId)},[e.baselineSnapshotId]),(0,P.jsxs)(`div`,{className:`space-y-6`,children:[(0,P.jsxs)(`section`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,P.jsx)(z,{description:`Load the older or baseline snapshot you want to compare against.`,history:g,label:`No baseline snapshot loaded yet`,onFileChange:e=>void S(`baseline`,e),onHistorySelect:e=>void C(`baseline`,e),snapshot:l,title:`Baseline`}),(0,P.jsx)(z,{description:`By default this uses the graph currently served by the modviz UI, but you can replace it with another JSON file.`,history:g,label:_?.label??`No current snapshot loaded yet`,onFileChange:e=>void S(`current`,e),onHistorySelect:e=>void C(`current`,e),secondaryAction:(0,P.jsxs)(`div`,{className:`flex gap-2`,children:[(0,P.jsxs)(v,{variant:`outline`,size:`sm`,onClick:()=>{p(null),h(null)},disabled:!s,children:[(0,P.jsx)(u,{className:`size-4`}),`Use served graph`]}),(0,P.jsxs)(v,{variant:`outline`,size:`sm`,onClick:()=>{!l||!_||(d(_),p(l))},disabled:!l||!_,children:[(0,P.jsx)(c,{className:`size-4`}),`Swap`]})]}),snapshot:_,title:`Current`})]}),m?(0,P.jsx)(`section`,{className:`rounded-[24px] border border-rose-200/70 bg-rose-50/80 p-4 text-sm text-rose-700 shadow-[0_16px_50px_-32px_rgba(15,23,42,0.55)] dark:border-rose-500/30 dark:bg-rose-500/10 dark:text-rose-200`,children:m}):null,x?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`section`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-5`,children:[(0,P.jsx)(V,{baseline:x.summary.baselineNodes,current:x.summary.currentNodes,label:`Nodes`,note:`Module paths present in the compared snapshots.`}),(0,P.jsx)(V,{baseline:x.summary.baselineEdges,current:x.summary.currentEdges,label:`Edges`,note:`Direct import relationships between modules.`}),(0,P.jsx)(V,{baseline:x.summary.baselineImportStatements,current:x.summary.currentImportStatements,label:`Import statements`,note:`Raw import entries captured from source analysis.`}),(0,P.jsx)(V,{baseline:x.summary.baselineExternalPackages,current:x.summary.currentExternalPackages,label:`External packages`,note:`Distinct node_modules package names observed in the graph.`}),(0,P.jsx)(V,{baseline:x.summary.baselineWorkspacePackages,current:x.summary.currentWorkspacePackages,label:`Workspace packages`,note:`Monorepo package metadata embedded in the snapshot.`})]}),(0,P.jsx)(U,{rows:x.changedNodes}),(0,P.jsxs)(`section`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,P.jsx)(H,{title:`Added modules`,items:x.addedNodes,emptyMessage:`No new module paths were added.`}),(0,P.jsx)(H,{title:`Removed modules`,items:x.removedNodes,emptyMessage:`No module paths were removed.`})]}),(0,P.jsxs)(`section`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,P.jsx)(H,{title:`Added edges`,items:x.addedEdges,emptyMessage:`No direct import edges were added.`}),(0,P.jsx)(H,{title:`Removed edges`,items:x.removedEdges,emptyMessage:`No direct import edges were removed.`})]}),(0,P.jsxs)(`section`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,P.jsx)(H,{title:`Added packages`,items:[...x.addedWorkspacePackages.map(e=>`workspace: ${e}`),...x.addedExternalPackages.map(e=>`external: ${e}`)],emptyMessage:`No workspace or external packages were added.`}),(0,P.jsx)(H,{title:`Removed packages`,items:[...x.removedWorkspacePackages.map(e=>`workspace: ${e}`),...x.removedExternalPackages.map(e=>`external: ${e}`)],emptyMessage:`No workspace or external packages were removed.`})]})]}):(0,P.jsx)(`section`,{className:`rounded-[24px] border border-dashed border-slate-300 bg-white/80 p-6 text-sm leading-6 text-slate-500 shadow-[0_16px_50px_-32px_rgba(15,23,42,0.55)] dark:border-slate-700 dark:bg-slate-950/60 dark:text-slate-400`,children:(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,P.jsx)(`p`,{children:`Load a baseline snapshot to compare it with the currently served graph or another uploaded JSON file.`}),(0,P.jsxs)(v,{variant:`outline`,size:`sm`,onClick:()=>void b(),disabled:i,children:[(0,P.jsx)(u,{className:`size-4`}),i?`Refreshing history...`:`Refresh history`]})]})})]})}function G(){let e=i(),t=o.useSearch();return(0,P.jsx)(l,{projectTitle:e.projectTitle,title:`Snapshot Compare`,description:`Compare the currently served graph with another modviz JSON snapshot to see which modules, edges, and packages changed.`,children:(0,P.jsx)(W,{baselineSnapshotId:t.baselineSnapshot,currentGraph:e.graph,history:e.history})})}export{G as component};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/compare-K6jVFsiI.js","assets/jsx-runtime-DWSWI4JT.js","assets/modviz-data-BiRqoDI5.js","assets/button-aOWckyNs.js","assets/utils-DkkZd0ys.js","assets/tooltip-B1VDU9HG.js","assets/floating-ui.dom-DLIT5tPE.js","assets/command-kkF7_wdz.js","assets/search-BYHxNrYn.js","assets/modviz-layout-Do93E-IB.js","assets/formatting-CiC0SYI8.js"])))=>i.map(i=>d[i]);
2
+ import{m as e}from"./modviz-data-BiRqoDI5.js";import{n as t,t as n}from"./lazyRouteComponent-PTSyFp1J.js";var r=t(`/compare`)({validateSearch:e=>({baselineSnapshot:typeof e.baselineSnapshot==`string`?e.baselineSnapshot:``}),component:n(()=>e(()=>import(`./compare-K6jVFsiI.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),`component`)});export{r as t};
@@ -0,0 +1 @@
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-DWSWI4JT.js";import{p as r}from"./modviz-data-BiRqoDI5.js";import{r as i}from"./utils-DkkZd0ys.js";import{t as a}from"./modviz-layout-Do93E-IB.js";import{t as o}from"./check-C0EQe2S8.js";import{t as s}from"./button-aOWckyNs.js";import{t as c}from"./input-BCFMF0aR.js";var l=i(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),u=e(t()),d=n(),f={launchUi:!0,outputFile:`modviz.json`,barrelThreshold:3,excludePaths:``,enableLlm:!1,enableAiAnalysis:!1,historyDir:``,includePaths:``,ignoreDynamic:!1,llmModel:`gpt-4.1-mini`,nodeModules:!1,packageQuery:``,nodeQuery:``,snapshotName:``},p=e=>/\s/.test(e)?JSON.stringify(e):e,m=(e,t)=>{let n=[`pnpm`,`exec`,`modviz`,`analyze`,p(e)];return t.outputFile&&t.outputFile!==f.outputFile&&n.push(`--output-file=${p(t.outputFile)}`),t.barrelThreshold!==f.barrelThreshold&&n.push(`--barrel-threshold=${t.barrelThreshold}`),t.includePaths.trim()&&n.push(`--include=${p(t.includePaths.trim())}`),t.excludePaths.trim()&&n.push(`--exclude=${p(t.excludePaths.trim())}`),t.historyDir.trim()&&n.push(`--history-dir=${p(t.historyDir.trim())}`),t.launchUi&&n.push(`--ui`),t.enableLlm&&n.push(`--llm`),t.enableAiAnalysis&&n.push(`--llm-analyze`),t.enableAiAnalysis&&t.llmModel.trim()&&n.push(`--llm-model=${p(t.llmModel.trim())}`),t.ignoreDynamic&&n.push(`--ignore-dynamic`),t.nodeModules&&n.push(`--node-modules`),t.snapshotName.trim()&&n.push(`--snapshot-name=${p(t.snapshotName.trim())}`),t.packageQuery.trim()&&n.push(`--package=${p(t.packageQuery.trim())}`),t.nodeQuery.trim()&&n.push(`--node=${p(t.nodeQuery.trim())}`),n.join(` `)};function h(){let e=r(),[t,n]=(0,u.useState)(f),[i,p]=(0,u.useState)(!1),h=(e,t)=>{n(n=>({...n,[e]:t}))},g=async e=>{await navigator.clipboard.writeText(e),p(!0),window.setTimeout(()=>p(!1),2e3)},_=(0,u.useMemo)(()=>m(e.graph?.metadata.entrypoints[0]||`./src/index.ts`,t),[e.graph?.metadata.entrypoints,t]),v=e.summary;return(0,d.jsx)(a,{projectTitle:e.projectTitle,children:(0,d.jsxs)(`div`,{className:`max-w-3xl space-y-6`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h1`,{className:`text-2xl font-bold text-slate-900 dark:text-slate-100`,children:`Command Configuration`}),(0,d.jsx)(`p`,{className:`mt-1 text-sm text-slate-600 dark:text-slate-400`,children:`Configure and run the analyzer from your terminal.`})]}),(0,d.jsxs)(`section`,{className:`rounded-[16px] border border-slate-200/70 bg-white/90 p-4 shadow-[0_16px_50px_-32px_rgba(15,23,42,0.55)] dark:border-slate-800 dark:bg-slate-950/70`,children:[(0,d.jsx)(`h2`,{className:`text-sm font-semibold text-slate-900 dark:text-slate-100 mb-4`,children:`Build Command`}),(0,d.jsxs)(`div`,{className:`space-y-4`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`label`,{className:`text-xs font-medium text-slate-700 dark:text-slate-300`,children:`Output File`}),(0,d.jsx)(c,{value:t.outputFile,onChange:e=>h(`outputFile`,e.target.value),placeholder:`modviz.json`,className:`mt-1`})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`label`,{className:`text-xs font-medium text-slate-700 dark:text-slate-300`,children:`Barrel threshold`}),(0,d.jsx)(c,{type:`number`,min:`1`,value:String(t.barrelThreshold),onChange:e=>h(`barrelThreshold`,Math.max(1,Number(e.target.value)||f.barrelThreshold)),className:`mt-1`}),(0,d.jsx)(`p`,{className:`mt-1 text-xs text-slate-500 dark:text-slate-400`,children:`Files exporting at least this many symbols are treated as barrel files.`})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`label`,{className:`text-xs font-medium text-slate-700 dark:text-slate-300`,children:`Snapshot name (optional)`}),(0,d.jsx)(c,{value:t.snapshotName,onChange:e=>h(`snapshotName`,e.target.value),placeholder:`before-refactor`,className:`mt-1`})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`label`,{className:`text-xs font-medium text-slate-700 dark:text-slate-300`,children:`Include paths (optional)`}),(0,d.jsx)(c,{value:t.includePaths,onChange:e=>h(`includePaths`,e.target.value),placeholder:`src/routes/**,src/components/**`,className:`mt-1`})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`label`,{className:`text-xs font-medium text-slate-700 dark:text-slate-300`,children:`Exclude paths (optional)`}),(0,d.jsx)(c,{value:t.excludePaths,onChange:e=>h(`excludePaths`,e.target.value),placeholder:`**/*.test.ts,**/*.stories.tsx`,className:`mt-1`})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`label`,{className:`text-xs font-medium text-slate-700 dark:text-slate-300`,children:`History dir (optional)`}),(0,d.jsx)(c,{value:t.historyDir,onChange:e=>h(`historyDir`,e.target.value),placeholder:`.modviz/history`,className:`mt-1`})]}),(0,d.jsx)(`div`,{className:`space-y-2`,children:[{key:`launchUi`,label:`Launch web UI after analyze (--ui)`},{key:`enableLlm`,label:`Enable LLM analysis (--llm)`},{key:`enableAiAnalysis`,label:`Generate AI summary (--llm-analyze)`},{key:`ignoreDynamic`,label:`Ignore dynamic imports (--ignore-dynamic)`},{key:`nodeModules`,label:`Include node_modules (--node-modules)`}].map(e=>(0,d.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2`,children:[(0,d.jsx)(`input`,{type:`checkbox`,checked:t[e.key],onChange:t=>h(e.key,t.target.checked),className:`rounded`}),(0,d.jsx)(`span`,{className:`text-xs font-medium text-slate-700 dark:text-slate-300`,children:e.label})]},e.key))}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`label`,{className:`text-xs font-medium text-slate-700 dark:text-slate-300`,children:`AI model (optional)`}),(0,d.jsx)(c,{value:t.llmModel,onChange:e=>h(`llmModel`,e.target.value),placeholder:`gpt-4.1-mini`,className:`mt-1 text-xs`,disabled:!t.enableAiAnalysis})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`label`,{className:`text-xs font-medium text-slate-700 dark:text-slate-300`,children:`Filter package (optional)`}),(0,d.jsx)(c,{value:t.packageQuery,onChange:e=>h(`packageQuery`,e.target.value),placeholder:`e.g., @namespace/package`,className:`mt-1 text-xs`})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`label`,{className:`text-xs font-medium text-slate-700 dark:text-slate-300`,children:`Filter node (optional)`}),(0,d.jsx)(c,{value:t.nodeQuery,onChange:e=>h(`nodeQuery`,e.target.value),placeholder:`e.g., src/utils`,className:`mt-1 text-xs`})]}),(0,d.jsxs)(`div`,{className:`pt-2 border-t border-slate-200 dark:border-slate-800`,children:[(0,d.jsx)(`p`,{className:`text-xs text-slate-600 dark:text-slate-400 mb-2`,children:`Run this command in your terminal:`}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,d.jsx)(`code`,{className:`flex-1 min-w-0 rounded-lg border border-slate-200 bg-slate-50 px-3 py-2 font-mono text-xs text-slate-800 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-100 overflow-x-auto`,children:_}),(0,d.jsx)(s,{size:`sm`,onClick:()=>void g(_),className:`shrink-0 gap-1.5`,title:`Copy command`,children:i?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o,{className:`size-3.5`}),`Copied`]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(l,{className:`size-3.5`}),`Copy command`]})})]})]})]})]}),(0,d.jsxs)(`section`,{className:`rounded-[16px] border border-slate-200/70 bg-white/90 p-4 shadow-[0_16px_50px_-32px_rgba(15,23,42,0.55)] dark:border-slate-800 dark:bg-slate-950/70`,children:[(0,d.jsx)(`h2`,{className:`text-sm font-semibold text-slate-900 dark:text-slate-100 mb-3`,children:`Current Dataset`}),(0,d.jsxs)(`div`,{className:`grid gap-3 grid-cols-2 sm:grid-cols-4 text-xs`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`font-semibold text-slate-500 dark:text-slate-400`,children:`Nodes`}),(0,d.jsx)(`p`,{className:`text-lg font-bold text-slate-900 dark:text-slate-100`,children:(v?.overview.totalNodes??0).toLocaleString()})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`font-semibold text-slate-500 dark:text-slate-400`,children:`Workspace`}),(0,d.jsx)(`p`,{className:`text-lg font-bold text-slate-900 dark:text-slate-100`,children:(v?.overview.workspaceNodes??0).toLocaleString()})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`font-semibold text-slate-500 dark:text-slate-400`,children:`Packages`}),(0,d.jsx)(`p`,{className:`text-lg font-bold text-slate-900 dark:text-slate-100`,children:(v?.overview.workspacePackages??0).toLocaleString()})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`font-semibold text-slate-500 dark:text-slate-400`,children:`LLM Report`}),(0,d.jsx)(`p`,{className:`text-lg font-bold text-slate-900 dark:text-slate-100`,children:v?.hasLlm?`✓`:`—`})]})]}),e.setup.status===`ready`?null:(0,d.jsx)(`p`,{className:`mt-4 text-sm text-slate-500 dark:text-slate-400`,children:e.setup.message})]})]})})}export{h as component};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/explorer-Xu2X6XXF.js","assets/jsx-runtime-DWSWI4JT.js","assets/modviz-data-BiRqoDI5.js","assets/button-aOWckyNs.js","assets/utils-DkkZd0ys.js","assets/modviz-layout-Do93E-IB.js","assets/chevron-down-DrspihmT.js","assets/chevron-right-DIJHr8AN.js","assets/import-display-D-jRyyjM.js","assets/external-link-B9eNA-li.js","assets/setup-view-j1o0TuZz.js","assets/input-BCFMF0aR.js"])))=>i.map(i=>d[i]);
2
+ import{m as e}from"./modviz-data-BiRqoDI5.js";import{n as t,t as n}from"./lazyRouteComponent-PTSyFp1J.js";import{i as r,n as i,r as a}from"./schemas-B4zfTepZ.js";var o=()=>e(()=>import(`./explorer-Xu2X6XXF.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),s=a({q:r().catch(``),selected:r().catch(``),scope:i([`all`,`workspace`,`external`]).catch(`workspace`)}),c=t(`/explorer`)({validateSearch:e=>s.parse(e),component:n(o,`component`)});export{c as t};
@@ -0,0 +1 @@
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-DWSWI4JT.js";import{_ as r,a as i,d as a,l as o,p as s,u as c}from"./modviz-data-BiRqoDI5.js";import{t as l}from"./explorer-C7NclVKg.js";import{r as u}from"./utils-DkkZd0ys.js";import{t as d}from"./modviz-layout-Do93E-IB.js";import{t as f}from"./chevron-down-DrspihmT.js";import{t as p}from"./chevron-right-DIJHr8AN.js";import{t as m}from"./import-display-D-jRyyjM.js";import{t as h}from"./external-link-B9eNA-li.js";import{t as g}from"./setup-view-j1o0TuZz.js";import{t as _}from"./button-aOWckyNs.js";import{t as v}from"./input-BCFMF0aR.js";var y=u(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),b=u(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),x=u(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),S=e(t(),1),C=n(),w={adjustSizes:!1,cluster:``,externalGrouping:`package`,focus:``,gravity:0,hideClusterLabels:!1,iterations:0,linLogMode:!1,nodeSizeScale:0,outboundAttractionDistribution:!0,scalingRatio:0,scope:`all`,strongGravityMode:!1},T={exclude:``,include:``,mode:`contains`,module:``,preset:``,scope:`all`,symbol:``};function E(e){let{graph:t}=e.bundle,n=(0,S.useMemo)(()=>c(t),[t]),a=(0,S.useMemo)(()=>i(t.nodes,n,e.search.scope),[t.nodes,e.search.scope,n]),s=(0,S.useMemo)(()=>j(a),[a]),l=(0,S.useMemo)(()=>a.find(t=>t.path===e.search.selected)??a[0]??null,[e.search.selected,a]),[u,d]=(0,S.useState)(()=>new Set),f=(0,S.useMemo)(()=>new Set([...u,...l?P(l.path):[]]),[u,l]),p=l==null?`workspace`:o(l,n),g=e.search.q.trim().toLowerCase(),y=(0,S.useMemo)(()=>M(s,g),[g,s]);return(0,C.jsxs)(`div`,{className:`flex h-screen flex-col gap-6 lg:flex-row lg:h-auto`,children:[(0,C.jsxs)(`section`,{className:`flex flex-col rounded-[24px] border border-slate-200/70 bg-white/90 p-5 shadow-[0_16px_50px_-32px_rgba(15,23,42,0.55)] dark:border-slate-800 dark:bg-slate-950/70 lg:w-[35%]`,children:[(0,C.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:[[`all`,`All files`],[`workspace`,`Monorepo`],[`external`,`node_modules`]].map(([t,n])=>(0,C.jsx)(_,{variant:e.search.scope===t?`default`:`outline`,size:`sm`,onClick:()=>e.onSearchChange({scope:t,selected:``}),children:n},t))}),(0,C.jsxs)(`div`,{className:`mt-4 flex gap-3`,children:[(0,C.jsx)(v,{placeholder:`Search file or folder path`,value:e.search.q,onChange:t=>e.onSearchChange({q:t.currentTarget.value})}),(0,C.jsx)(_,{variant:`outline`,onClick:()=>d(new Set),children:`Collapse`}),(0,C.jsx)(_,{variant:`outline`,onClick:()=>d(new Set(N(y))),children:`Expand`})]}),(0,C.jsx)(`div`,{className:`mt-4 flex-1 overflow-auto`,children:(0,C.jsx)(`div`,{className:`space-y-1 pr-2`,children:y.children.map(t=>(0,C.jsx)(A,{node:t,expandedPaths:f,selectedPath:l?.path??``,onToggle:e=>{d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},onSelect:t=>e.onSearchChange({selected:t})},t.id))})})]}),(0,C.jsx)(`section`,{className:`flex flex-col rounded-[24px] border border-slate-200/70 bg-white/90 p-5 shadow-[0_16px_50px_-32px_rgba(15,23,42,0.55)] dark:border-slate-800 dark:bg-slate-950/70 lg:w-[65%] lg:overflow-y-auto`,children:l?(0,C.jsxs)(`div`,{className:`space-y-6`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.22em] text-sky-700 dark:text-sky-300`,children:`Selected file`}),(0,C.jsx)(`h2`,{className:`mt-2 break-words text-lg font-semibold text-slate-900 dark:text-slate-100 sm:text-xl`,children:l.path}),(0,C.jsxs)(`p`,{className:`mt-2 text-sm text-slate-500 dark:text-slate-400`,children:[l.package?.name?`${l.package.name} • `:``,l.cluster??l.type]})]}),(0,C.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,C.jsxs)(r,{to:`/graph`,search:{...w,focus:l.path,scope:p},className:`inline-flex h-9 items-center gap-2 rounded-md border border-slate-200 bg-white px-4 text-sm font-medium text-slate-700 shadow-xs hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-950 dark:text-slate-100`,children:[(0,C.jsx)(h,{className:`size-4`}),`Open in graph`]}),(0,C.jsxs)(r,{to:`/imports`,search:{...T,include:l.path,scope:p},className:`inline-flex h-9 items-center gap-2 rounded-md border border-slate-200 bg-white px-4 text-sm font-medium text-slate-700 shadow-xs hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-950 dark:text-slate-100`,children:[(0,C.jsx)(h,{className:`size-4`}),`Use as importer filter`]}),(0,C.jsxs)(r,{to:`/trace`,search:{package:``,node:l.path,limit:10},className:`inline-flex h-9 items-center gap-2 rounded-md border border-slate-200 bg-white px-4 text-sm font-medium text-slate-700 shadow-xs hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-950 dark:text-slate-100`,children:[(0,C.jsx)(h,{className:`size-4`}),`Trace origins`]})]}),(0,C.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-3`,children:[(0,C.jsx)(D,{label:`Direct imports`,value:l.imports.length}),(0,C.jsx)(D,{label:`Imported by`,value:l.importedBy.length}),(0,C.jsx)(D,{label:`Exports`,value:l.exports.length})]}),(0,C.jsx)(O,{title:`Imports`,description:`Grouped into import statements so scanning looks closer to the source file.`,children:(0,C.jsx)(m,{imports:l.imports,emptyMessage:`No direct imports recorded for this file.`,showViewToggle:!0})}),(0,C.jsx)(O,{title:`Imported by`,description:`Direct inbound edges into this file.`,children:(0,C.jsx)(k,{items:l.importedBy,onSelect:t=>e.onSearchChange({selected:t})})})]}):(0,C.jsx)(`div`,{className:`flex min-h-[24rem] items-center justify-center text-sm text-slate-500 dark:text-slate-400`,children:`No file matched the current explorer scope.`})})]})}function D(e){return(0,C.jsxs)(`div`,{className:`rounded-[20px] bg-slate-50/90 p-4 dark:bg-slate-900/70`,children:[(0,C.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.18em] text-slate-500 dark:text-slate-400`,children:e.label}),(0,C.jsx)(`p`,{className:`mt-2 text-3xl font-semibold text-slate-900 dark:text-slate-100`,children:e.value})]})}function O(e){return(0,C.jsxs)(`details`,{open:!0,className:`group rounded-[24px] border border-slate-200/70 bg-slate-50/80 p-4 dark:border-slate-800 dark:bg-slate-900/70`,children:[(0,C.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-3 text-left`,children:[(0,C.jsx)(f,{className:`size-5 shrink-0 -rotate-90 transition-transform group-open:rotate-0`}),(0,C.jsxs)(`div`,{className:`flex-1`,children:[(0,C.jsx)(`h3`,{className:`text-base font-semibold text-slate-900 dark:text-slate-100`,children:e.title}),(0,C.jsx)(`p`,{className:`mt-1 text-sm text-slate-500 dark:text-slate-400`,children:e.description})]})]}),(0,C.jsx)(`div`,{className:`mt-4`,children:e.children})]})}function k(e){return(0,C.jsx)(`div`,{className:`max-h-[28rem] space-y-2 overflow-auto pr-1`,children:e.items.length?e.items.map(t=>(0,C.jsxs)(`button`,{type:`button`,onClick:()=>e.onSelect(t),className:`flex w-full items-center gap-2 rounded-2xl bg-white px-3 py-3 text-left text-sm text-slate-700 hover:bg-sky-50 hover:text-sky-800 dark:bg-slate-950/80 dark:text-slate-200 dark:hover:bg-sky-500/10 dark:hover:text-sky-200`,children:[(0,C.jsx)(y,{className:`size-4 shrink-0`}),(0,C.jsx)(`span`,{className:`truncate`,children:t})]},t)):(0,C.jsx)(`p`,{className:`rounded-2xl bg-white px-4 py-6 text-sm text-slate-500 dark:bg-slate-950/80 dark:text-slate-400`,children:`No inbound importers recorded for this file.`})})}function A(e){let t=e.depth??0,n=e.expandedPaths.has(e.node.path);return e.node.kind===`file`?(0,C.jsxs)(`button`,{type:`button`,onClick:()=>e.onSelect(e.node.path),className:`flex w-full items-center gap-2 rounded-xl px-3 py-2 text-left text-sm ${e.selectedPath===e.node.path?`bg-sky-100 text-sky-900 dark:bg-sky-500/20 dark:text-sky-100`:`text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-slate-900`}`,style:{paddingLeft:`${t*16+12}px`},children:[(0,C.jsx)(y,{className:`size-4 shrink-0`}),(0,C.jsx)(`span`,{className:`truncate`,children:e.node.label})]}):(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`button`,{type:`button`,onClick:()=>e.onToggle(e.node.path),className:`flex w-full items-center gap-2 rounded-xl px-3 py-2 text-left text-sm text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-slate-900`,style:{paddingLeft:`${t*16+12}px`},children:[n?(0,C.jsx)(f,{className:`size-4`}):(0,C.jsx)(p,{className:`size-4`}),n?(0,C.jsx)(b,{className:`size-4`}):(0,C.jsx)(x,{className:`size-4`}),(0,C.jsx)(`span`,{className:`truncate`,children:e.node.label})]}),n?(0,C.jsx)(`div`,{className:`space-y-1`,children:e.node.children.map(n=>(0,C.jsx)(A,{node:n,expandedPaths:e.expandedPaths,selectedPath:e.selectedPath,onToggle:e.onToggle,onSelect:e.onSelect,depth:t+1},n.id))}):null]})}function j(e){let t={id:`root`,label:`root`,path:``,kind:`folder`,children:[]};for(let n of e){let e=n.path.split(`/`).filter(Boolean),r=t,i=``;e.forEach((t,a)=>{i=i?`${i}/${t}`:t;let o=a===e.length-1,s=r.children.find(e=>e.label===t&&e.kind===(o?`file`:`folder`));s||(s={id:i,label:t,path:i,kind:o?`file`:`folder`,children:[],file:o?n:void 0},r.children.push(s),r.children.sort((e,t)=>e.kind===t.kind?e.label.localeCompare(t.label):e.kind===`folder`?-1:1)),r=s})}return t}function M(e,t){if(!t)return e;if(e.kind===`file`)return e.path.toLowerCase().includes(t)?e:{...e,children:[]};let n=e.children.map(e=>M(e,t)).filter(e=>e.kind===`file`?e.path.toLowerCase().includes(t):e.children.length||e.path.toLowerCase().includes(t));return{...e,children:n}}function N(e){return e.kind===`file`?[]:[e.path,...e.children.flatMap(N)]}function P(e){let t=e.split(`/`).filter(Boolean);return t.map((e,n)=>t.slice(0,n+1).join(`/`))}function F(){let e=s(),t=l.useSearch(),n=l.useNavigate();return(0,C.jsx)(d,{projectTitle:e.projectTitle,title:`File Explorer`,description:`Browse the monorepo or node_modules tree, select any file, then inspect its direct imports and importers without opening the force-directed graph.`,children:a(e)?(0,C.jsx)(E,{bundle:e,search:t,onSearchChange:e=>n({replace:!0,search:t=>({...t,...e})})}):(0,C.jsx)(g,{bundle:e})})}export{F as component};
@@ -0,0 +1 @@
1
+ import{r as e}from"./utils-DkkZd0ys.js";var t=e(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]);export{t};
@@ -0,0 +1,13 @@
1
+ import{a as e,i as t,n,t as r}from"./jsx-runtime-DWSWI4JT.js";function i(e,t=1,n=1){let r=(.6+.4*Math.max(0,Math.cos(e)))*t,i=(.5+.2*Math.max(0,Math.cos(e+Math.PI*2/3)))*n;return`hsl(${e*180/Math.PI}deg, ${Math.round(100*r)}%, ${Math.round(100*i)}%)`}var a,o,s,c,l,u=1,d;function f(e,t,n,r,i){if(!Array.isArray(e))return e;let f=window.devicePixelRatio||1;if(a!==t||o!==f||s!==i){let n=Math.round(64*f)/64;u=i,u=Math.log2(u),u-=Math.floor(u);let r=u,p=Math.min(1,8*r);u=2**u;let m=8*Math.SQRT2/u;a=t,o=f,s=i,c||=document.createElement(`canvas`),l||=c.getContext(`2d`),c.width=c.height=Math.round(64*n),l.scale(n,n),l.fillStyle=e[0],l.fillRect(0,0,64,64),l.globalAlpha=.25,l.fillStyle=e[1],l.fillRect(0,0,64,64),l.globalAlpha=.67,l.strokeStyle=e[1],l.beginPath();for(let e=0;e<=64;e+=16)l.moveTo(e-32,e+32),l.lineTo(e+32,e-32);if(l.lineWidth=m*(1-(p-r)/2),l.stroke(),p+r>0){l.beginPath();for(let e=8;e<64;e+=16)l.moveTo(e-32,e+32),l.lineTo(e+32,e-32);l.lineWidth=m*(p+r)/2,l.stroke()}d=t.createPattern(c,`repeat`),u/=n}return n/=64*u*f,n-=Math.floor(n),n*=64*u*f,d.setTransform(new DOMMatrix([u,0,0,u,n,r])),d}function p(e){return t=>t.id&&e[t.id]||t.color}function m(e,t=1,n=1){let r={};return h(r,e,0,Math.PI*2,t,n),p(r)}function h(e,t,n,r,a=1,o=1){let s=t.size;e[t.id]=i(n+r/2,a,o);for(let i of t.children){let t=i.size/s*r;h(e,i,n,t,a,o),n+=t}}var g=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function _(e=16,t=g){let n=``,r=e,i=t.length;for(;r--;)n+=t[Math.random()*i|0];return n}function v(e,t,n=(e,t)=>t.size-e.size){if(e.__nanovis)return e;let r={...e};return r.id||=_(),r.parent||=t,r.children||=[],r.sizeSelf==null&&r.size!=null&&r.children.length===0?r.sizeSelf=r.size:r.sizeSelf||=0,r.children=(r.children||[]).map(e=>v(e,r,n)),r.size||=r.children.reduce((e,t)=>e+t.size,0)+r.sizeSelf,n&&r.children.sort(n),Object.defineProperty(r,`__nanovis`,{enumerable:!1,value:!0}),r}function y(e){return e.children.length===0?1:Math.max(...e.children.map(e=>y(e)))+1}var b=/\bFirefox\//.test(navigator.userAgent);function x(){return(window.performance||Date).now()}function S(e,t,n,r,i,a){if(b){let o=e.lineWidth,s=o/2;e.fillStyle=t,e.fillRect(n-s,r-s,i+o,o),e.fillRect(n-s,r+s,o,a-o),e.fillRect(n-s,r+a-s,i+o,o),e.fillRect(n+i-s,r+s,o,a-o);return}e.strokeStyle=t,e.strokeRect(n,r,i,a)}function C(e){return window.addEventListener(`wheel`,e,{passive:!1}),()=>window.removeEventListener(`wheel`,e)}function w(e){return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)}try{new Intl.NumberFormat}catch{}var T=()=>({emit(e,...t){for(let n=this.events[e]||[],r=0,i=n.length;r<i;r++)n[r](...t)},events:{},on(e,t){return(this.events[e]||=[]).push(t),()=>{this.events[e]=this.events[e]?.filter(e=>t!==e)}}}),E={getText:e=>e.text,getSubtext:e=>e.subtext,animate:!0,animateDuration:350},D={fallback:`#CCC`,stroke:`#0008`,text:`#222`,hover:`#fff5`,shadow:`#0008`,fg:`#fff`,bg:`#222`},O=46,k=`14px sans-serif`,A=`bold ${k}`,j=class{el;canvas;c;width=0;height=0;ratio=1;root;maxDepth;events;options;palette;disposables;getColor;getText;getSubtext;_animationFrame=null;constructor(e,t){this.options={...E,...t};let{getColor:n=m(e),getText:r=()=>void 0,getSubtext:i=()=>void 0}=this.options;this.palette={...D,...t.palette},this.el=document.createElement(`div`),this.canvas=document.createElement(`canvas`),this.c=this.canvas.getContext(`2d`),this.root=e,this.maxDepth=y(e),this.disposables=[],this.events=T(),this.getColor=n,this.getText=r,this.getSubtext=i,this.setFont(k),t.onClick&&this.events.on(`click`,t.onClick),t.onHover&&this.events.on(`hover`,t.onHover),t.onLeave&&this.events.on(`leave`,t.onLeave),t.onSelect&&this.events.on(`select`,t.onSelect),this.el.addEventListener(`mouseleave`,()=>{this.events.emit(`leave`)})}invalidate(){this._animationFrame===null&&(this._animationFrame=requestAnimationFrame(()=>{this._animationFrame=null,this.tick()}))}tick(){this.draw()}draw(){}resize(){this.ratio=window.devicePixelRatio||1,this.canvas.style.width=`${this.width}px`,this.canvas.style.height=`${this.height}px`,this.canvas.width=Math.round(this.width*this.ratio),this.canvas.height=Math.round(this.height*this.ratio),this.c.scale(this.ratio,this.ratio),this.draw()}select(e,t){this.events.emit(`select`,e)}dispose(){this.disposables.forEach(e=>e()),this.disposables.length=0,this.el.remove()}[Symbol.dispose](){this.dispose()}_font=`14px sans-serif`;_fontWidthCache=new Map;ellipsisWidth=0;getFontCache(){return this._fontWidthCache.has(this._font)||this._fontWidthCache.set(this._font,{}),this._fontWidthCache.get(this._font)}setFont(e){this._font=e,this.c.font=e,this.c.textBaseline=`middle`,this.ellipsisWidth=3*this.charCodeWidth(O)}charCodeWidth(e){let t=this.getFontCache(),n=t[e];return n===void 0&&(n=this.c.measureText(String.fromCharCode(e)).width,t[e]=n),n}textOverflowEllipsis(e,t){if(t<this.ellipsisWidth)return[``,0];let n=0,r=e.length,i=0;for(;i<r;){let r=this.charCodeWidth(e.charCodeAt(i));if(t<n+this.ellipsisWidth+r)return[`${e.slice(0,i)}...`,n+this.ellipsisWidth];n+=r,i++}return[e,n]}},M=24,N=5,P=.01,F=1e3,I=class extends j{mainEl=document.createElement(`div`);totalBytes;viewportMin;viewportMax;zoomedOutMin=0;zoomedOutWidth=0;prevWheelTime=0;prevWheelWasZoom=!1;stripeScaleAdjust=1;hoveredNode=null;selectedNode=null;nodeStartBytes=new Map;animationFromMin=0;animationFromMax=0;animationToMin=0;animationToMax=0;animationStart=0;constructor(e,t={}){super(e,t),this.totalBytes=e.size,this.viewportMin=this.animationFromMin=this.animationToMin=0,this.viewportMax=this.animationFromMax=this.animationToMax=this.totalBytes,Object.assign(this.mainEl.style,{position:`relative`}),Object.assign(this.canvas.style,{position:`absolute`,left:`0`,top:`0`});let n=!1;this.canvas.onmousedown=e=>{if(n=!1,e.button!==2){let t=e.pageX,r=e=>{let r=e.pageX-t;!n&&Math.abs(r)<3||(n=!0,this.modifyViewport(-r,0,null),t=e.pageX)},i=()=>{document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,i)};e.preventDefault(),document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,i)}},this.canvas.onmousemove=e=>{this.updateHover(e)},this.canvas.onmouseout=()=>{this.changeHoveredNode(null)},this.canvas.onclick=e=>{if(n)return;let t=this.hitTestNode(e);this.changeHoveredNode(t),this.changeSelectedNode(t),t&&this.events.emit(`click`,t,e)},this.disposables.push(C(e=>{let t=e.deltaX,n=e.deltaY,r=x(),i=r-this.prevWheelTime<50?this.prevWheelWasZoom:e.ctrlKey||e.metaKey;this.prevWheelTime=r,this.prevWheelWasZoom=i,(i||Math.abs(t)>=Math.abs(n))&&e.preventDefault(),this.modifyViewport(t,n,i?e.pageX:null),this.updateHover(e)})),this.resize(),Promise.resolve().then(()=>this.resize()),this.disposables.push(w(()=>this.resize())),this.mainEl.append(this.canvas),this.el.append(this.mainEl)}tick(){let e=(x()-this.animationStart)/(this.options.animateDuration??E.animateDuration);e<0||e>1?(e=1,this.viewportMin=this.animationToMin,this.viewportMax=this.animationToMax):(e<.5?e*=4*e*e:(e=1-e,e*=4*e*e,e=1-e),this.viewportMin=this.animationFromMin+(this.animationToMin-this.animationFromMin)*e,this.viewportMax=this.animationFromMax+(this.animationToMax-this.animationFromMax)*e,this.invalidate()),this.draw()}draw(){this.c.clearRect(0,0,this.width,this.height),this.drawNode(this.root,0,0,-1/0,1)}changeSelectedNode(e,t=this.options.animate??E.animate){if(this.selectedNode!==e&&(this.selectedNode=e,this.events.emit(`select`,e),e&&this.nodeStartBytes.has(e.id))){let n=this.nodeStartBytes.get(e.id),r=n+e.size;n=Math.max(0,n-e.size*P),r=Math.min(this.totalBytes,r+e.size*P),this.setViewport(n,r,t)}}select(e,t=this.options.animate??E.animate){this.changeSelectedNode(e,t)}resize(){this.width=this.el.clientWidth,this.height=this.maxDepth*M+1,this.zoomedOutMin=this.width-F>>1,this.zoomedOutWidth=this.zoomedOutMin+F,this.zoomedOutMin<0&&(this.zoomedOutMin=0),this.zoomedOutWidth>this.width&&(this.zoomedOutWidth=this.width),this.zoomedOutWidth-=this.zoomedOutMin,this.stripeScaleAdjust=this.totalBytes/this.zoomedOutWidth,this.mainEl.style.height=`${this.height}px`,super.resize()}drawNode(e,t,n,r,i){this.nodeStartBytes.set(e.id,n);let a=this.zoomedOutWidth/(this.viewportMax-this.viewportMin),o=this.zoomedOutMin+(n-this.viewportMin)*a,s=e.size*a,c=o+s;if(c<r+1.5)return r;if(o+s<0||o>this.width)return c;let l=s<2?2:s,u=(o>0?o:0)+N,d=t+M/2,p=this.getText(e)||``,m=this.getSubtext(e)||``,h,g=0,_=s+o-u,v=f(this.getColor(e)||this.palette.fallback,this.c,this.zoomedOutMin-this.viewportMin*a,M,a*this.stripeScaleAdjust),y=this.palette.text,b=-1/0;i&1?(y=this.palette.fg,this.setFont(A)):(this.c.fillStyle=v,this.c.fillRect(o,t,l,M),(i&2||this.hoveredNode&&e.id===this.hoveredNode.id)&&(this.c.fillStyle=this.palette.hover,this.c.fillRect(o,t,l,M),i|=2)),this.ellipsisWidth<_&&(h=this.c.measureText(p).width,h<=_?g+=h:(p=this.textOverflowEllipsis(p,_)[0],g=_),this.c.fillStyle=y,this.c.fillText(p,u,d)),i&1&&this.setFont(k),g+this.ellipsisWidth<_&&(m&&p&&(m=` - ${m}`),h=this.c.measureText(m).width,g+h>_&&(m=this.textOverflowEllipsis(m,_-g)[0]),this.c.globalAlpha=.5,this.c.fillText(m,u+g,d),this.c.globalAlpha=1);for(let r of e.children)b=this.drawNode(r,t+M,n,b,i&-2),n+=r.size;return i&1||S(this.c,this.palette.stroke,o+.5,t+.5,l,M),c}changeHoveredNode(e){this.hoveredNode!==e&&(this.hoveredNode=e,this.canvas.style.cursor=e&&!e.children.length?`pointer`:`auto`,this.invalidate())}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,i=this.viewportMin+(this.viewportMax-this.viewportMin)/this.zoomedOutWidth*(n-this.zoomedOutMin),a=(e,t,n)=>{if(i>=n&&i<n+e.size){if(r>=t&&r<t+M&&e.id)return e;if(r>=t+M)for(let r of e.children){let e=a(r,t+M,n);if(e)return e;n+=r.size}}return null};return a(this.root,0,0)}modifyViewport(e,t,n){let r=this.viewportMin,i=this.viewportMax,a=0;if(n!==null){let e=r+(i-r)/this.zoomedOutWidth*(n-this.zoomedOutMin),a=1.01**t;r=e+(r-e)*a,i=e+(i-e)*a}else a=e*(i-r)/this.zoomedOutWidth;r+a<0?a=-r:i+a>this.totalBytes&&(a=this.totalBytes-i),r+=a,i+=a,r<0&&(r=0),i>this.totalBytes&&(i=this.totalBytes),this.setViewport(r,i,!1)}setViewport(e,t,n){this.animationFromMin=this.viewportMin,this.animationFromMax=this.viewportMax,this.animationToMin=e,this.animationToMax=t,n?this.animationStart=x():this.animationStart=0,this.invalidate()}updateHover(e){let t=this.hitTestNode(e);this.changeHoveredNode(t),this.events.emit(`hover`,t,e)}};-Math.PI/2;var L=4;2*L,20+L;var R=e(n(),1);function z(e,t,n={}){let r=n.maxDepth??6,i=n.maxChildren??24,a=n.includeExternal??!0,o=e.nodes.find(e=>e.path===t),s=new Map;if(e.nodes.forEach(e=>{s.set(e.path,{id:e.path,text:e.path.split(`/`).slice(-2).join(`/`),subtext:e.package?.name,sizeSelf:e.importees.length+1,children:[],meta:{path:e.path,type:e.type,package:e.package?.name,importees:e.importees,imports:e.imports.length,exports:e.exports.length,originalNode:e}})}),!o)return{id:`module-graph-root`,text:`Module Graph`,subtext:`No entrypoints found`,sizeSelf:1,children:[],meta:{path:``,importees:[],imports:0,exports:0,originalNode:{}}};let c=Object.assign({},s.get(t),{children:[]}),l=new Set,u=[{depth:0,nodePath:t,parent:c,visited:new Set([t])}],d=0,f=new Map;for(;u.length>0;){d++;let{depth:e,nodePath:t,parent:n,visited:o}=u.pop(),c=l.has(t);l.add(t);let p=s.get(t);if(!p)continue;let m=Object.assign({},p,{children:c?f.get(t):[]});if(!c&&f.set(t,m.children),n.children&&n.children.push(m),c||e>=r)continue;let h=m.meta.importees.filter(e=>a||!e.includes(`node_modules`)).sort((e,t)=>{let n=s.get(e);return(s.get(t)?.meta.importees.length??0)-(n?.meta.importees.length??0)}),g=h.slice(0,i);g.forEach(t=>{if(o.has(t)){let e=s.get(t);if(!e)return;let n=Object.assign({},e,{children:[]});m.children.push(n);return}o.add(t),u.push({depth:e+1,nodePath:t,parent:m,visited:new Set([...o,t])})}),h.length>g.length&&m.children.push({id:`${t}#truncated`,text:`… ${h.length-g.length} more`,subtext:`pruned`,sizeSelf:1,children:[],meta:{path:`${t}#truncated`,importees:[],imports:0,exports:0,originalNode:m.meta.originalNode}})}return c}var B=t({Flamegraph:()=>H}),V=r(),H=e=>{let t=(0,R.useRef)(null),n=(0,R.useRef)(null),r=(0,R.useRef)(null);return(0,R.useEffect)(()=>{if(!t.current)return;let i=e.entryNodeId??e.output.metadata.entrypoints[0],a=new I(v(z(e.output,i,e.options)));n.current=a;let o=a.events.on(`select`,e=>{console.log(`Selected node:`,{text:e?.text,subtext:e?.subtext,meta:e?.meta})}),s=a.events.on(`hover`,(e,t)=>{r.current&&(e&&e.meta?(r.current.style.display=`block`,t&&(r.current.style.left=`${t.clientX+10}px`,r.current.style.top=`${t.clientY-10}px`),r.current.innerHTML=`
2
+ <div style="font-weight: bold; margin-bottom: 8px; color: #4CAF50;">
3
+ ${e.text||`root`}
4
+ </div>
5
+ ${e.meta.path?`<div style="color: #ddd; font-size: 10px; margin-bottom: 4px;">${e.meta.path}</div>`:``}
6
+ <div style="margin-bottom: 4px;">
7
+ Size: <span style="color: #FFD700;">${e.sizeSelf||0}</span>
8
+ </div>
9
+ ${e.meta.type?`<div style="margin-bottom: 4px;">Type: <span style="color: #87CEEB;">${e.meta.type}</span></div>`:``}
10
+ ${e.meta.package?`<div style="margin-bottom: 4px;">Package: <span style="color: #DDA0DD;">${e.meta.package}</span></div>`:``}
11
+ ${e.meta.imports===void 0?``:`<div style="margin-bottom: 4px;">Imports: <span style="color: #F0E68C;">${e.meta.imports}</span></div>`}
12
+ ${e.meta.exports===void 0?``:`<div>Exports: <span style="color: #F0E68C;">${e.meta.exports}</span></div>`}
13
+ `):r.current.style.display=`none`)});return t.current.innerHTML=``,t.current.appendChild(a.el),()=>{o(),s(),n.current&&=null}},[e.entryNodeId,e.options,e.output]),(0,V.jsxs)(`div`,{className:`relative w-full h-full min-h-0 flex flex-col`,children:[(0,V.jsx)(`div`,{ref:t,className:`flex-1 min-h-0`,style:{minHeight:`400px`}}),(0,V.jsx)(`div`,{ref:r,style:{position:`fixed`,background:`rgba(0, 0, 0, 0.9)`,color:`white`,padding:`12px`,borderRadius:`6px`,fontSize:`12px`,fontFamily:`monospace`,maxWidth:`300px`,boxShadow:`0 4px 8px rgba(0,0,0,0.3)`,pointerEvents:`none`,zIndex:1e3,display:`none`}}),(0,V.jsxs)(`div`,{className:`absolute bottom-4 left-4 bg-black bg-opacity-70 text-white p-3 rounded text-xs font-mono z-10`,children:[(0,V.jsx)(`div`,{className:`font-bold mb-2`,children:`Module Graph Flamegraph`}),(0,V.jsx)(`div`,{children:`Click: Select node`}),(0,V.jsx)(`div`,{children:`Hover: View details`})]})]})};export{B as n,H as t};
@@ -0,0 +1 @@
1
+ import{a as e,n as t}from"./jsx-runtime-DWSWI4JT.js";import{ct as n}from"./modviz-data-BiRqoDI5.js";import{h as r,p as i,u as a,v as o,y as s}from"./button-aOWckyNs.js";function c(e){return e==null?[]:Array.isArray(e)?e:[e]}var l=e=>e[0],u=e=>e[e.length-1],d=(e,t)=>e.indexOf(t)!==-1,f=(e,...t)=>e.concat(t),p=(e,...t)=>e.filter(e=>!t.includes(e)),m=e=>Array.from(new Set(e)),h=(e,t)=>{let n=new Set(t);return e.filter(e=>!n.has(e))},g=(e,t)=>d(e,t)?p(e,t):f(e,t);function _(e,t){return e.reduce(([e,n],r)=>(t(r)?e.push(r):n.push(r),[e,n]),[[],[]])}function v(e){if(!o(e)||e===void 0)return e;let t=Reflect.ownKeys(e).filter(e=>typeof e==`string`),n={};for(let r of t){let t=e[r];t!==void 0&&(n[r]=v(t))}return n}function y(e,t){let n={};for(let r of t){let t=e[r];t!==void 0&&(n[r]=t)}return n}function b(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function x(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function S(e,t){if(e==null)throw Error(t())}function C(e,t,n){let r=[];for(let n of t)e[n]??r.push(n);if(r.length>0)throw Error(`[zag-js${n?` > ${n}`:``}] missing required props: ${r.join(`, `)}`)}var w=`.`,T=`#`,E=new WeakMap,D=new WeakMap;function O(e){return e.join(w)}function k(e){return e.includes(w)}function A(e){return e.startsWith(T)}function j(e){return e.startsWith(w)}function ee(e){return A(e)?e.slice(T.length):e}function M(e,t){return e?`${e}${w}${t}`:t}function te(e){let t=new Map,n=new Map,r=(e,i)=>{t.set(e,i);let a=i.id;a&&(n.has(a)&&x(`[zag-js] Duplicate state id: "${a}"`),n.set(a,e));let o=i.states;if(o){S(i.initial,()=>`[zag-js] Compound state "${e}" has child states but no "initial" property`),i.initial in o||x(`[zag-js] Compound state "${e}" has initial "${String(i.initial)}" which is not a child state`);for(let[t,n]of Object.entries(o))n&&r(M(e,t),n)}};for(let[t,n]of Object.entries(e.states))n&&r(t,n);return{index:t,idIndex:n}}function ne(e){let t=E.get(e);if(t)return t;let{index:n,idIndex:r}=te(e);return E.set(e,n),D.set(e,r),n}function re(e,t){return ne(e),D.get(e)?.get(t)}function ie(e){return e?String(e).split(w).filter(Boolean):[]}function ae(e,t){if(!t)return[];let n=ne(e),r=ie(t),i=[],a=[];for(let e of r){a.push(e);let t=O(a),r=n.get(t);if(!r)break;i.push({path:t,state:r})}return i}function oe(e,t){let n=ne(e),r=ie(t);if(!r.length)return t;let i=[];for(let e of r){i.push(e);let r=O(i);if(!n.has(r))return t}let a=O(i),o=n.get(a);for(;o?.initial;){let e=`${a}${w}${o.initial}`,t=n.get(e);if(!t)break;a=e,o=t}return a}function se(e,t){return ne(e).has(t)}function ce(e,t,n){let r=String(t);if(A(r)){let t=ee(r),n=re(e,t);return S(n,()=>`[zag-js] Unknown state id: "${t}"`),oe(e,n)}if(j(r)&&n)return oe(e,M(n,r.slice(1)));if(!k(r)&&n){let t=ie(n);for(let n=t.length-1;n>=1;n--){let i=M(t.slice(0,n).join(w),r);if(se(e,i))return oe(e,i)}if(se(e,r))return oe(e,r)}return oe(e,r)}function le(e,t,n){let r=ae(e,t);for(let e=r.length-1;e>=0;e--){let t=r[e]?.state.on?.[n];if(t)return{transitions:t,source:r[e]?.path}}return{transitions:e.on?.[n],source:void 0}}function ue(e,t,n,r){let i=t?ae(e,t):[],a=ae(e,n),o=0;for(;o<i.length&&o<a.length&&i[o]?.path===a[o]?.path;)o+=1;let s=i.slice(o).reverse(),c=a.slice(o),l=i.at(-1)?.path===a.at(-1)?.path;return r&&l&&(s=i.slice().reverse(),c=a),{exiting:s,entering:c}}function de(e,t){return e?e===t||e.startsWith(`${t}${w}`):!1}function fe(e,t,n){return ae(e,t).some(e=>e.state.tags?.includes(n))}function pe(){return{and:(...e)=>function(t){return e.every(e=>t.guard(e))},or:(...e)=>function(t){return e.some(e=>t.guard(e))},not:e=>function(t){return!t.guard(e)}}}function me(e){return ne(e),e}function he(){return{guards:pe(),createMachine:e=>me(e),choose:e=>function({choose:t}){return t(e)?.actions}}}var N=(e=>(e.NotStarted=`Not Started`,e.Started=`Started`,e.Stopped=`Stopped`,e))(N||{}),ge=`__init__`,_e=Object.defineProperty,ve=(e,t,n)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ye=(e,t,n)=>ve(e,typeof t==`symbol`?t:t+``,n),be=(e,t)=>e.map((n,r)=>e[(Math.max(t,0)+r)%e.length]),xe=()=>void 0,Se=e=>typeof e==`object`&&!!e,Ce=e=>e?``:void 0,we=e=>e?`true`:void 0,Te=1,Ee=9,De=11,P=e=>Se(e)&&e.nodeType===Te&&typeof e.nodeName==`string`,Oe=e=>Se(e)&&e.nodeType===Ee,ke=e=>Se(e)&&e===e.window,Ae=e=>P(e)?e.localName||``:`#document`;function je(e){return[`html`,`body`,`#document`].includes(Ae(e))}var Me=e=>Se(e)&&e.nodeType!==void 0,F=e=>Me(e)&&e.nodeType===De&&`host`in e,Ne=e=>P(e)&&e.localName===`input`,Pe=e=>!!e?.matches(`a[href]`),Fe=e=>P(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function Ie(e){return e?Ue(e.getRootNode())===e:!1}var Le=/(textarea|select)/;function Re(e){if(e==null||!P(e))return!1;try{return Ne(e)&&e.selectionStart!=null||Le.test(e.localName)||e.isContentEditable||e.getAttribute(`contenteditable`)===`true`||e.getAttribute(`contenteditable`)===``}catch{return!1}}function ze(e,t){if(!e||!t||!P(e)||!Me(t))return!1;if(P(t)&&e===t||e.contains(t))return!0;let n=t.getRootNode?.();if(n&&F(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Be(e){return Oe(e)?e:ke(e)?e.document:e?.ownerDocument??document}function Ve(e){return Be(e).documentElement}function He(e){return F(e)?He(e.host):Oe(e)?e.defaultView??window:P(e)?e.ownerDocument?.defaultView??window:window}function Ue(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(!e||e===t)break;t=e}return t}function We(e){if(Ae(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||F(e)&&e.host||Ve(e);return F(t)?t.host:t}function Ge(e){let t;try{if(t=e.getRootNode({composed:!0}),Oe(t)||F(t))return t}catch{}return e.ownerDocument??document}var Ke=new WeakMap;function qe(e){return Ke.has(e)||Ke.set(e,He(e).getComputedStyle(e)),Ke.get(e)}var Je=()=>typeof document<`u`;function Ye(){return navigator.userAgentData?.platform??navigator.platform}function Xe(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}var Ze=e=>Je()&&e.test(Ye()),Qe=e=>Je()&&e.test(Xe()),$e=e=>Je()&&e.test(navigator.vendor),et=()=>Je()&&!!navigator.maxTouchPoints,tt=()=>Ze(/^iPhone/i),nt=()=>Ze(/^iPad/i)||at()&&navigator.maxTouchPoints>1,rt=()=>tt()||nt(),it=()=>at()||rt(),at=()=>Ze(/^Mac/i),ot=()=>it()&&$e(/apple/i),st=()=>Qe(/Firefox/i),ct=()=>Qe(/Android/i);function lt(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function ut(e){return lt(e)?.[0]??e.target}function dt(e){let t=e.currentTarget;if(!t||!t.matches(`a[href], button[type='submit'], input[type='submit']`))return!1;let n=e.button===1,r=pt(e);return n||r}function ft(e){return St(e).isComposing||e.keyCode===229}function pt(e){return at()?e.metaKey:e.ctrlKey}function mt(e){return e.pointerType===``&&e.isTrusted?!0:ct()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}var ht=e=>e.button===0,gt=e=>e.button===2||at()&&e.ctrlKey&&e.button===0,_t=e=>e.ctrlKey||e.altKey||e.metaKey,vt=e=>`touches`in e&&e.touches.length>0,yt={Up:`ArrowUp`,Down:`ArrowDown`,Esc:`Escape`," ":`Space`,",":`Comma`,Left:`ArrowLeft`,Right:`ArrowRight`},bt={ArrowLeft:`ArrowRight`,ArrowRight:`ArrowLeft`};function xt(e,t={}){let{dir:n=`ltr`,orientation:r=`horizontal`}=t,i=e.key;return i=yt[i]??i,n===`rtl`&&r===`horizontal`&&i in bt&&(i=bt[i]),i}function St(e){return e.nativeEvent??e}var Ct=new Set([`PageUp`,`PageDown`]),wt=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`]);function Tt(e){return e.ctrlKey||e.metaKey?.1:Ct.has(e.key)||e.shiftKey&&wt.has(e.key)?10:1}function Et(e,t=`client`){let n=vt(e)?e.touches[0]||e.changedTouches[0]:e;return{x:n[`${t}X`],y:n[`${t}Y`]}}var Dt=(e,t,n,r)=>{let i=typeof e==`function`?e():e;return i?.addEventListener(t,n,r),()=>{i?.removeEventListener(t,n,r)}},Ot=class e{constructor(){ye(this,`id`,null),ye(this,`fn_cleanup`),ye(this,`cleanup`,()=>{this.cancel()})}static create(){return new e}request(e){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=e?.()})}cancel(){this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),this.fn_cleanup?.(),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function kt(e){let t=Ot.create();return t.request(e),t.cleanup}function At(e){let t=new Set;function n(e){let n=globalThis.requestAnimationFrame(e);t.add(()=>globalThis.cancelAnimationFrame(n))}return n(()=>n(e)),function(){t.forEach(e=>e())}}function jt(e,t,n){let r=kt(()=>{e.removeEventListener(t,i,!0),n()}),i=()=>{r(),n()};return e.addEventListener(t,i,{once:!0,capture:!0}),r}function Mt(e,t,n){let r=e.getAttribute(t),i=r!=null;return r===n?xe:(e.setAttribute(t,n),()=>{i?e.setAttribute(t,r):e.removeAttribute(t)})}function Nt(e,t){if(!e)return xe;let n=Object.keys(t).reduce((t,n)=>(t[n]=e.style.getPropertyValue(n),t),{});return Ft(n,t)?xe:(Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute(`style`)})}function Pt(e,t,n){if(!e)return xe;let r=e.style.getPropertyValue(t);return r===n?xe:(e.style.setProperty(t,n),()=>{e.style.setProperty(t,r),e.style.length===0&&e.removeAttribute(`style`)})}function Ft(e,t){return Object.keys(e).every(n=>e[n]===t[n])}function It(e){let t=()=>e.getRootNode?.()??document,n=()=>Be(t()),r=()=>n().defaultView??window,i=()=>Ue(t()),a=e=>t().getElementById(e);return{...e,getRootNode:t,getDoc:n,getWin:r,getActiveElement:i,isActiveElement:Ie,getById:a}}var Lt=e(n(),1),I=e(t(),1),Rt=globalThis.document===void 0?I.useEffect:I.useLayoutEffect;function zt(e){let t=e().value??e().defaultValue,n=e().isEqual??Object.is,[i]=(0,I.useState)(t),[o,s]=(0,I.useState)(i),c=e().value!==void 0,l=(0,I.useRef)(o);l.current=c?e().value:o;let u=(0,I.useRef)(l.current);Rt(()=>{u.current=l.current},[o,e().value]);let d=t=>{let i=u.current,a=r(t)?t(i):t;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:a,prev:i}),c||s(a),n(a,i)||e().onChange?.(a,i)};function f(){return c?e().value:o}return{initial:i,ref:l,get:f,set(t){(e().sync?Lt.flushSync:a)(()=>d(t))},invoke(t,n){e().onChange?.(t,n)},hash(t){return e().hash?.(t)??String(t)}}}zt.cleanup=e=>{(0,I.useEffect)(()=>e,[])},zt.ref=e=>{let t=(0,I.useRef)(e);return{get:()=>t.current,set:e=>{t.current=e}}};function Bt(e){let t=(0,I.useRef)(e);return{get(e){return t.current[e]},set(e,n){t.current[e]=n}}}var Vt=(e,t)=>{let n=(0,I.useRef)(!1),r=(0,I.useRef)(!1);(0,I.useEffect)(()=>{if(n.current&&r.current)return t();r.current=!0},[...(e??[]).map(e=>typeof e==`function`?e():e)]),(0,I.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[])};function Ht(e,t={}){let n=(0,I.useMemo)(()=>{let{id:e,ids:n,getRootNode:r}=t;return It({id:e,ids:n,getRootNode:r})},[t]),i=(...t)=>{e.debug&&console.log(...t)},a=Wt(e.props?.({props:v(t),scope:n})??t),o=e.context?.({prop:a,bindable:zt,scope:n,flush:Gt,getContext(){return u},getComputed(){return E},getRefs(){return _},getEvent(){return h()}}),l=Ut(o),u={get(e){return l.current?.[e].ref.current},set(e,t){l.current?.[e].set(t)},initial(e){return l.current?.[e].initial},hash(e){let t=l.current?.[e].get();return l.current?.[e].hash(t)}},d=(0,I.useRef)(new Map),f=(0,I.useRef)(null),p=(0,I.useRef)(null),m=(0,I.useRef)({type:``}),h=()=>({...m.current,current(){return m.current},previous(){return p.current}}),g=()=>({...D,matches(...e){return e.some(e=>de(D.ref.current,e))},hasTag(t){return fe(e,D.ref.current,t)}}),_=Bt(e.refs?.({prop:a,context:u})??{}),y=()=>({state:g(),context:u,event:h(),prop:a,send:j,action:x,guard:C,track:Vt,refs:_,computed:E,flush:Gt,scope:n,choose:T}),x=t=>{let n=r(t)?t(y()):t;if(!n)return;let i=n.map(t=>{let n=e.implementations?.actions?.[t];return n||b(`[zag-js] No implementation found for action "${JSON.stringify(t)}"`),n});for(let e of i)e?.(y())},C=t=>r(t)?t(y()):e.implementations?.guards?.[t](y()),w=t=>{let n=r(t)?t(y()):t;if(!n)return;let i=n.map(t=>{let n=e.implementations?.effects?.[t];return n||b(`[zag-js] No implementation found for effect "${JSON.stringify(t)}"`),n}),a=[];for(let e of i){let t=e?.(y());t&&a.push(t)}return()=>a.forEach(e=>e?.())},T=e=>c(e).find(e=>{let t=!e.guard;return s(e.guard)?t=!!C(e.guard):r(e.guard)&&(t=e.guard(y())),t}),E=t=>{S(e.computed,()=>`[zag-js] No computed object found on machine`);let r=e.computed[t];return r({context:u,event:h(),prop:a,refs:_,scope:n,computed:E})},D=zt(()=>({defaultValue:ce(e,e.initialState({prop:a})),onChange(t,n){let{exiting:r,entering:i}=ue(e,n,t,f.current?.reenter);if(r.forEach(e=>{d.current.get(e.path)?.(),d.current.delete(e.path)}),r.forEach(e=>{x(e.state?.exit)}),x(f.current?.actions),i.forEach(e=>{let t=w(e.state?.effects);t&&d.current.set(e.path,t)}),n===`__init__`){x(e.entry);let t=w(e.effects);t&&d.current.set(ge,t)}i.forEach(e=>{x(e.state?.entry)})}})),O=(0,I.useRef)(void 0),k=(0,I.useRef)(N.NotStarted);Rt(()=>{queueMicrotask(()=>{let e=k.current===N.Started;k.current=N.Started,i(e?`rehydrating...`:`initializing...`);let t=O.current??D.initial;D.invoke(t,e?D.get():ge)});let t=d.current;return()=>{let n=A();i(`unmounting...`),O.current=n,k.current=N.Stopped,t.forEach(e=>e?.()),d.current=new Map,f.current=null,queueMicrotask(()=>{x(e.exit),k.current=N.Stopped})}},[]);let A=()=>`ref`in D?D.ref.current:D.get(),j=t=>{queueMicrotask(()=>{if(k.current!==N.Started)return;p.current=m.current,m.current=t;let n=A(),{transitions:r,source:a}=le(e,n,t.type),o=T(r);if(!o)return;f.current=o;let s=ce(e,o.target??n,a);i(`transition`,t.type,o.target||n,`(${o.actions})`),s===n?o.reenter?D.invoke(n,n):x(o.actions??[]):(0,Lt.flushSync)(()=>D.set(s))})};return e.watch?.(y()),{state:g(),send:j,context:u,prop:a,scope:n,refs:_,computed:E,event:h(),getStatus:()=>k.current}}function Ut(e){let t=(0,I.useRef)(e);return t.current=e,t}function Wt(e){let t=Ut(e);return function(e){return t.current[e]}}function Gt(e){queueMicrotask(()=>{(0,Lt.flushSync)(()=>e())})}function Kt(e){return new Proxy({},{get(t,n){return n===`style`?t=>e({style:t}).style:e}})}var qt=Kt(e=>e);function Jt(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Yt(e={}){let{name:t,strict:n=!0,hookName:a=`useContext`,providerName:o=`Provider`,errorMessage:s,defaultValue:c}=e,l=(0,I.createContext)(c);l.displayName=t;function u(){let e=(0,I.useContext)(l);if(!e&&n){let e=Error(s??Jt(a,o));throw e.name=`ContextError`,i(Error,`captureStackTrace`)&&r(Error.captureStackTrace)&&Error.captureStackTrace(e,u),e}return e}return[l.Provider,u,l]}var Xt=()=>(e,t)=>t.reduce((e,t)=>{let[n,r]=e,i=t;return r[i]!==void 0&&(n[i]=r[i]),delete r[i],[n,r]},[{},{...e}]);function Zt(e,t){let{state:n,send:r,context:i}=e,a=n.matches(`mounted`,`unmountSuspended`);return{skip:!i.get(`initial`),present:a,setNode(e){e&&r({type:`NODE.SET`,node:e})},unmount(){r({type:`UNMOUNT`})}}}var Qt=me({props({props:e}){return{...e,present:!!e.present}},initialState({prop:e}){return e(`present`)?`mounted`:`unmounted`},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:[`cleanupNode`],watch({track:e,prop:t,send:n}){e([()=>t(`present`)],()=>{n({type:`PRESENCE.CHANGED`})})},on:{"NODE.SET":{actions:[`setupNode`]},"PRESENCE.CHANGED":{actions:[`setInitial`,`syncPresence`]}},states:{mounted:{on:{UNMOUNT:{target:`unmounted`,actions:[`clearPrevAnimationName`,`invokeOnExitComplete`]},"UNMOUNT.SUSPEND":{target:`unmountSuspended`}}},unmountSuspended:{effects:[`trackAnimationEvents`],on:{MOUNT:{target:`mounted`,actions:[`setPrevAnimationName`]},UNMOUNT:{target:`unmounted`,actions:[`clearPrevAnimationName`,`invokeOnExitComplete`]}}},unmounted:{on:{MOUNT:{target:`mounted`,actions:[`setPrevAnimationName`]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get(`initial`)||queueMicrotask(()=>{e.set(`initial`,!0)})},invokeOnExitComplete:({prop:e,refs:t})=>{e(`onExitComplete`)?.();let n=t.get(`node`);if(!n)return;let r=new(He(n)).CustomEvent(`exitcomplete`,{bubbles:!1});n.dispatchEvent(r)},setupNode:({refs:e,event:t})=>{e.get(`node`)!==t.node&&(e.set(`node`,t.node),e.set(`styles`,qe(t.node)))},cleanupNode:({refs:e})=>{e.set(`node`,null),e.set(`styles`,null)},syncPresence:({context:e,refs:t,send:n,prop:r})=>{let i=r(`present`);if(i)return n({type:`MOUNT`,src:`presence.changed`});let a=t.get(`node`);if(!i&&a?.ownerDocument.visibilityState===`hidden`)return n({type:`UNMOUNT`,src:`visibilitychange`});kt(()=>{if(r(`present`))return;let i=$t(t.get(`styles`));e.set(`unmountAnimationName`,i),i===`none`||i===e.get(`prevAnimationName`)||t.get(`styles`)?.display===`none`||t.get(`styles`)?.animationDuration===`0s`?n({type:`UNMOUNT`,src:`presence.changed`}):n({type:`UNMOUNT.SUSPEND`})})},setPrevAnimationName:({context:e,refs:t})=>{kt(()=>{e.set(`prevAnimationName`,$t(t.get(`styles`)))})},clearPrevAnimationName:({context:e})=>{e.set(`prevAnimationName`,null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n,prop:r})=>{let i=t.get(`node`);if(!i)return;let a=n=>{(n.composedPath?.()?.[0]??n.target)===i&&e.set(`prevAnimationName`,$t(t.get(`styles`)))},o=a=>{let o=$t(t.get(`styles`));ut(a)===i&&o===e.get(`unmountAnimationName`)&&!r(`present`)&&n({type:`UNMOUNT`,src:`animationend`})},s=e=>{ut(e)===i&&!r(`present`)&&n({type:`UNMOUNT`,src:`animationcancel`})};i.addEventListener(`animationstart`,a),i.addEventListener(`animationcancel`,s),i.addEventListener(`animationend`,o);let c=Nt(i,{animationFillMode:`forwards`});return()=>{i.removeEventListener(`animationstart`,a),i.removeEventListener(`animationcancel`,s),i.removeEventListener(`animationend`,o),At(()=>c())}}}}});function $t(e){return e?.animationName||`none`}function en(e,t={}){let{sync:n=!1}=t,r=tn(e);return(0,I.useCallback)((...e)=>n?queueMicrotask(()=>r.current?.(...e)):r.current?.(...e),[n,r])}function tn(e){let t=(0,I.useRef)(e);return t.current=e,t}var nn=(e={})=>{let{lazyMount:t,unmountOnExit:n,present:r,skipAnimationOnMount:i=!1,...a}=e,o=(0,I.useRef)(!1),s=Zt(Ht(Qt,{...a,present:r,onExitComplete:en(e.onExitComplete)}),qt);s.present&&(o.current=!0);let c=!s.present&&!o.current&&t||n&&!s.present&&o.current;return{ref:s.setNode,getPresenceProps:()=>({"data-state":s.skip&&i?void 0:r?`open`:`closed`,hidden:!s.present}),present:s.present,unmounted:c}},[rn,an]=Yt({name:`PresenceContext`,hookName:`usePresenceContext`,providerName:`<PresenceProvider />`}),on=e=>Xt()(e,[`immediate`,`lazyMount`,`onExitComplete`,`present`,`skipAnimationOnMount`,`unmountOnExit`]),[sn,cn]=Yt({name:`EnvironmentContext`,hookName:`useEnvironmentContext`,providerName:`<EnvironmentProvider />`,strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}}),[ln,un]=Yt({name:`LocaleContext`,hookName:`useLocaleContext`,providerName:`<LocaleProvider />`,strict:!1,defaultValue:{dir:`ltr`,locale:`en-US`}}),dn=[`top`,`right`,`bottom`,`left`],L=Math.min,R=Math.max,fn=Math.round,pn=Math.floor,z=e=>({x:e,y:e}),mn={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function hn(e,t,n){return R(e,L(t,n))}function B(e,t){return typeof e==`function`?e(t):e}function V(e){return e.split(`-`)[0]}function H(e){return e.split(`-`)[1]}function gn(e){return e===`x`?`y`:`x`}function _n(e){return e===`y`?`height`:`width`}function U(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function vn(e){return gn(U(e))}function yn(e,t,n){n===void 0&&(n=!1);let r=H(e),i=vn(e),a=_n(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=On(o)),[o,On(o)]}function bn(e){let t=On(e);return[xn(e),t,xn(t)]}function xn(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Sn=[`left`,`right`],Cn=[`right`,`left`],wn=[`top`,`bottom`],Tn=[`bottom`,`top`];function En(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Cn:Sn:t?Sn:Cn;case`left`:case`right`:return t?wn:Tn;default:return[]}}function Dn(e,t,n,r){let i=H(e),a=En(V(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(xn)))),a}function On(e){let t=V(e);return mn[t]+e.slice(t.length)}function kn(e){return{top:0,right:0,bottom:0,left:0,...e}}function An(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:kn(e)}function jn(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 Mn(e,t,n){let{reference:r,floating:i}=e,a=U(t),o=vn(t),s=_n(o),c=V(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}}switch(H(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Nn(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}=B(t,e),p=An(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=jn(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=jn(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 Pn=50,Fn=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Nn},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Mn(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<Pn&&(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}=Mn(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},In=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}=B(e,t)||{};if(l==null)return{};let d=An(u),f={x:n,y:r},p=vn(i),m=_n(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=L(d[_],T),D=L(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=hn(O,A,k),ee=!c.arrow&&H(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,M=ee?A<O?A-O:A-k:0;return{[p]:f[p]+M,data:{[p]:j,centerOffset:A-j-M,...ee&&{alignmentOffset:M}},reset:ee}}}),Ln=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}=B(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=V(r),_=U(o),v=V(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[On(o)]:bn(o)),x=p!==`none`;!d&&x&&b.push(...Dn(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=yn(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`&&_!==U(t))||T.every(e=>U(e.placement)===_?e.overflows[0]>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=U(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 Rn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zn(e){return dn.some(t=>e[t]>=0)}var Bn=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=B(e,t);switch(i){case`referenceHidden`:{let e=Rn(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:zn(e)}}}case`escaped`:{let e=Rn(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:zn(e)}}}default:return{}}}}},Vn=new Set([`left`,`top`]);async function Hn(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=V(n),s=H(n),c=U(n)===`y`,l=Vn.has(o)?-1:1,u=a&&c?-1:1,d=B(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 Un=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 Hn(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}}}}},Wn=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}=B(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=U(V(i)),p=gn(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=hn(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=hn(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Gn=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}=B(e,t),u={x:n,y:r},d=U(i),f=gn(d),p=u[f],m=u[d],h=B(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};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=Vn.has(V(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}}}},Kn=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=B(e,t),u=await o.detectOverflow(t,l),d=V(i),f=H(i),p=U(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=L(h-u[g],v),x=L(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=R(u.left,0),t=R(u.right,0),n=R(u.top,0),r=R(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:R(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:R(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function qn(){return typeof window<`u`}function W(e){return Jn(e)?(e.nodeName||``).toLowerCase():`#document`}function G(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function K(e){return((Jn(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Jn(e){return qn()?e instanceof Node||e instanceof G(e).Node:!1}function q(e){return qn()?e instanceof Element||e instanceof G(e).Element:!1}function J(e){return qn()?e instanceof HTMLElement||e instanceof G(e).HTMLElement:!1}function Yn(e){return!qn()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof G(e).ShadowRoot}function Xn(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Z(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Zn(e){return/^(table|td|th)$/.test(W(e))}function Qn(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var $n=/transform|translate|scale|rotate|perspective|filter/,er=/paint|layout|strict|content/,Y=e=>!!e&&e!==`none`,tr;function nr(e){let t=q(e)?Z(e):e;return Y(t.transform)||Y(t.translate)||Y(t.scale)||Y(t.rotate)||Y(t.perspective)||!ir()&&(Y(t.backdropFilter)||Y(t.filter))||$n.test(t.willChange||``)||er.test(t.contain||``)}function rr(e){let t=Q(e);for(;J(t)&&!X(t);){if(nr(t))return t;if(Qn(t))return null;t=Q(t)}return null}function ir(){return tr??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),tr}function X(e){return/^(html|body|#document)$/.test(W(e))}function Z(e){return G(e).getComputedStyle(e)}function ar(e){return q(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Q(e){if(W(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Yn(e)&&e.host||K(e);return Yn(t)?t.host:t}function or(e){let t=Q(e);return X(t)?e.ownerDocument?e.ownerDocument.body:e.body:J(t)&&Xn(t)?t:or(t)}function sr(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=or(e),i=r===e.ownerDocument?.body,a=G(r);if(i){let e=cr(a);return t.concat(a,a.visualViewport||[],Xn(r)?r:[],e&&n?sr(e):[])}else return t.concat(r,sr(r,[],n))}function cr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lr(e){let t=Z(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=J(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=fn(n)!==a||fn(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ur(e){return q(e)?e:e.contextElement}function dr(e){let t=ur(e);if(!J(t))return z(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=lr(t),o=(a?fn(n.width):n.width)/r,s=(a?fn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var fr=z(0);function pr(e){let t=G(e);return!ir()||!t.visualViewport?fr:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mr(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==G(e)?!1:t}function $(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ur(e),o=z(1);t&&(r?q(r)&&(o=dr(r)):o=dr(e));let s=mr(a,n,r)?pr(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){let e=G(a),t=r&&q(r)?G(r):r,n=e,i=cr(n);for(;i&&r&&t!==n;){let e=dr(i),t=i.getBoundingClientRect(),r=Z(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=G(i),i=cr(n)}}return jn({width:u,height:d,x:c,y:l})}function hr(e,t){let n=ar(e).scrollLeft;return t?t.left+n:$(K(e)).left+n}function gr(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-hr(e,n),y:n.top+t.scrollTop}}function _r(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=K(r),s=t?Qn(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=z(1),u=z(0),d=J(r);if((d||!d&&!a)&&((W(r)!==`body`||Xn(o))&&(c=ar(r)),d)){let e=$(r);l=dr(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?gr(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+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function vr(e){return Array.from(e.getClientRects())}function yr(e){let t=K(e),n=ar(e),r=e.ownerDocument.body,i=R(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=R(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+hr(e),s=-n.scrollTop;return Z(r).direction===`rtl`&&(o+=R(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var br=25;function xr(e,t){let n=G(e),r=K(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=ir();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=hr(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=br&&(a-=o)}else l<=br&&(a+=l);return{width:a,height:o,x:s,y:c}}function Sr(e,t){let n=$(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=J(e)?dr(e):z(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Cr(e,t,n){let r;if(t===`viewport`)r=xr(e,n);else if(t===`document`)r=yr(K(e));else if(q(t))r=Sr(t,n);else{let n=pr(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return jn(r)}function wr(e,t){let n=Q(e);return n===t||!q(n)||X(n)?!1:Z(n).position===`fixed`||wr(n,t)}function Tr(e,t){let n=t.get(e);if(n)return n;let r=sr(e,[],!1).filter(e=>q(e)&&W(e)!==`body`),i=null,a=Z(e).position===`fixed`,o=a?Q(e):e;for(;q(o)&&!X(o);){let t=Z(o),n=nr(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Xn(o)&&!n&&wr(e,o))?r=r.filter(e=>e!==o):i=t,o=Q(o)}return t.set(e,r),r}function Er(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Qn(t)?[]:Tr(t,this._c):[].concat(n),r],o=Cr(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=Cr(t,a[e],i);s=R(n.top,s),c=L(n.right,c),l=L(n.bottom,l),u=R(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Dr(e){let{width:t,height:n}=lr(e);return{width:t,height:n}}function Or(e,t,n){let r=J(t),i=K(t),a=n===`fixed`,o=$(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=z(0);function l(){c.x=hr(i)}if(r||!r&&!a)if((W(t)!==`body`||Xn(i))&&(s=ar(t)),r){let e=$(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?gr(i,s):z(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function kr(e){return Z(e).position===`static`}function Ar(e,t){if(!J(e)||Z(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return K(e)===n&&(n=n.ownerDocument.body),n}function jr(e,t){let n=G(e);if(Qn(e))return n;if(!J(e)){let t=Q(e);for(;t&&!X(t);){if(q(t)&&!kr(t))return t;t=Q(t)}return n}let r=Ar(e,t);for(;r&&Zn(r)&&kr(r);)r=Ar(r,t);return r&&X(r)&&kr(r)&&!nr(r)?n:r||rr(e)||n}var Mr=async function(e){let t=this.getOffsetParent||jr,n=this.getDimensions,r=await n(e.floating);return{reference:Or(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Nr(e){return Z(e).direction===`rtl`}var Pr={convertOffsetParentRelativeRectToViewportRelativeRect:_r,getDocumentElement:K,getClippingRect:Er,getOffsetParent:jr,getElementRects:Mr,getClientRects:vr,getDimensions:Dr,getScale:dr,isElement:q,isRTL:Nr};function Fr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ir(e,t){let n=null,r,i=K(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=pn(d),h=pn(i.clientWidth-(u+f)),g=pn(i.clientHeight-(d+p)),_=pn(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:R(0,L(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Fr(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Lr(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=ur(e),u=i||a?[...l?sr(l):[],...t?sr(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ir(l,n):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?$(e):null;c&&g();function g(){let t=$(e);h&&!Fr(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 Rr=Un,zr=Wn,Br=Ln,Vr=Kn,Hr=Bn,Ur=In,Wr=Gn,Gr=(e,t,n)=>{let r=new Map,i={platform:Pr,...n},a={...i.platform,_c:r};return Fn(e,t,{...i,platform:a})};export{Re as $,ut as A,at as B,At as C,p as Ct,xt as D,Dt as E,_t as F,Ue as G,et as H,dt as I,Ge as J,Be as K,mt as L,ft as M,gt as N,Et as O,ht as P,Oe as Q,st as R,Pt as S,_ as St,kt as T,m as Tt,qe as U,ot as V,ze as W,Ie as X,He as Y,Pe as Z,Yt as _,f as _t,Hr as a,we as at,Mt as b,l as bt,zr as c,pe as ct,cn as d,S as dt,Fe as et,on as f,C as ft,Xt as g,y as gt,nn as h,v as ht,Br as i,F as it,St as j,Tt as k,Vr as l,me as lt,an as m,b as mt,Lr as n,Ne as nt,Wr as o,Ce as ot,rn as p,x as pt,We as q,Gr as r,je as rt,Rr as s,be as st,Ur as t,P as tt,un as u,he as ut,qt as v,g as vt,jt as w,c as wt,Nt as x,u as xt,Ht as y,h as yt,rt as z};
@@ -0,0 +1 @@
1
+ var e=new Intl.NumberFormat(`en-US`);export{e as t};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/modviz-sigma-Xl8qHaxK.js","assets/jsx-runtime-DWSWI4JT.js","assets/modviz-data-BiRqoDI5.js","assets/button-aOWckyNs.js","assets/utils-DkkZd0ys.js","assets/portal-BgAm3V3j.js","assets/floating-ui.dom-DLIT5tPE.js","assets/tooltip-B1VDU9HG.js","assets/graph-command-menu-D2MoVT2B.js","assets/command-kkF7_wdz.js","assets/search-BYHxNrYn.js","assets/graph-command-menu-VWiiW3qy.css","assets/colors-CQoWjU5E.js","assets/check-C0EQe2S8.js","assets/chevron-down-DrspihmT.js","assets/chevron-right-DIJHr8AN.js","assets/loading-state-CyC_hrTF.js","assets/flamegraph-CRVZSAlj.js","assets/input-BCFMF0aR.js"])))=>i.map(i=>d[i]);
2
+ import{a as e,n as t,t as n}from"./jsx-runtime-DWSWI4JT.js";import{a as r,c as i,d as a,m as o,p as s,u as c}from"./modviz-data-BiRqoDI5.js";import{n as l,t as u}from"./graph-CVzypIGU.js";import{d,f,l as p,m,o as h,p as g,s as _,t as v,u as y}from"./graph-command-menu-D2MoVT2B.js";import{r as b}from"./utils-DkkZd0ys.js";import{t as ee}from"./modviz-layout-Do93E-IB.js";import{D as te,E as ne}from"./command-kkF7_wdz.js";import{t as re}from"./setup-view-j1o0TuZz.js";import{t as ie}from"./loading-state-CyC_hrTF.js";import{A as x,C as S,D as ae,E as C,O as w,P as T,T as E,_ as D,ct as oe,d as O,f as k,ft as se,g as ce,gt as A,h as le,k as ue,lt as de,m as fe,ot as j,p as pe,pt as me,tt as he,u as ge,v as _e,y as ve,z as ye}from"./floating-ui.dom-DLIT5tPE.js";import{a as be,c as M,d as xe,o as N,s as Se,t as P}from"./button-aOWckyNs.js";import{t as Ce}from"./portal-BgAm3V3j.js";import{t as we}from"./input-BCFMF0aR.js";var Te=b(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Ee=b(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),F=`default`,De=``,I=new WeakMap;function Oe(e={}){let{target:t,doc:n}=e,r=n??document,i=r.documentElement;return ye()?(F===`default`&&(De=i.style.webkitUserSelect,i.style.webkitUserSelect=`none`),F=`disabled`):t&&(I.set(t,t.style.userSelect),t.style.userSelect=`none`),()=>ke({target:t,doc:r})}function ke(e={}){let{target:t,doc:n}=e,r=(n??document).documentElement;if(ye()){if(F!==`disabled`)return;F=`restoring`,setTimeout(()=>{S(()=>{F===`restoring`&&(r.style.webkitUserSelect===`none`&&(r.style.webkitUserSelect=De||``),De=``,F=`default`)})},300)}else if(t&&I.has(t)){let e=I.get(t);t.style.userSelect===`none`&&(t.style.userSelect=e??``),t.getAttribute(`style`)===``&&t.removeAttribute(`style`),I.delete(t)}}function Ae(e={}){let{defer:t,target:n,...r}=e,i=t?E:e=>e(),a=[];return a.push(i(()=>{let e=typeof n==`function`?n():n;a.push(Oe({...r,target:e}))})),()=>{a.forEach(e=>e?.())}}function je(e,t){let{onPointerMove:n,onPointerUp:r}=t,i=e=>{let t=w(e);if(!(Math.sqrt(t.x**2+t.y**2)<(e.pointerType===`touch`?10:5))){if(e.pointerType===`mouse`&&e.buttons===0){a(e);return}n({point:t,event:e})}},a=e=>{r({point:w(e),event:e})},o=[C(e,`pointermove`,i,!1),C(e,`pointerup`,a,!1),C(e,`pointercancel`,a,!1),C(e,`contextmenu`,a,!1),Ae({doc:e})];return()=>{o.forEach(e=>e())}}var Me=Object.defineProperty,Ne=(e,t,n)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L=(e,t,n)=>Ne(e,typeof t==`symbol`?t:t+``,n),Pe=class e{constructor([t,n,r,i,a,o]=[0,0,0,0,0,0]){L(this,`m00`),L(this,`m01`),L(this,`m02`),L(this,`m10`),L(this,`m11`),L(this,`m12`),L(this,`rotate`,(...t)=>this.prepend(e.rotate(...t))),L(this,`scale`,(...t)=>this.prepend(e.scale(...t))),L(this,`translate`,(...t)=>this.prepend(e.translate(...t))),this.m00=t,this.m01=n,this.m02=r,this.m10=i,this.m11=a,this.m12=o}applyTo(e){let{x:t,y:n}=e,{m00:r,m01:i,m02:a,m10:o,m11:s,m12:c}=this;return{x:r*t+i*n+a,y:o*t+s*n+c}}prepend(t){return new e([this.m00*t.m00+this.m01*t.m10,this.m00*t.m01+this.m01*t.m11,this.m00*t.m02+this.m01*t.m12+this.m02,this.m10*t.m00+this.m11*t.m10,this.m10*t.m01+this.m11*t.m11,this.m10*t.m02+this.m11*t.m12+this.m12])}append(t){return new e([t.m00*this.m00+t.m01*this.m10,t.m00*this.m01+t.m01*this.m11,t.m00*this.m02+t.m01*this.m12+t.m02,t.m10*this.m00+t.m11*this.m10,t.m10*this.m01+t.m11*this.m11,t.m10*this.m02+t.m11*this.m12+t.m12])}get determinant(){return this.m00*this.m11-this.m01*this.m10}get isInvertible(){let e=this.determinant;return isFinite(e)&&isFinite(this.m02)&&isFinite(this.m12)&&e!==0}invert(){let t=this.determinant;return new e([this.m11/t,-this.m01/t,(this.m01*this.m12-this.m11*this.m02)/t,-this.m10/t,this.m00/t,(this.m10*this.m02-this.m00*this.m12)/t])}get array(){return[this.m00,this.m01,this.m02,this.m10,this.m11,this.m12,0,0,1]}get float32Array(){return new Float32Array(this.array)}static get identity(){return new e([1,0,0,0,1,0])}static rotate(t,n){let r=new e([Math.cos(t),-Math.sin(t),0,Math.sin(t),Math.cos(t),0]);return n&&(n.x!==0||n.y!==0)?e.multiply(e.translate(n.x,n.y),r,e.translate(-n.x,-n.y)):r}static scale(t,n=t,r={x:0,y:0}){let i=new e([t,0,0,0,n,0]);return r.x!==0||r.y!==0?e.multiply(e.translate(r.x,r.y),i,e.translate(-r.x,-r.y)):i}static translate(t,n){return new e([1,0,t,0,1,n])}static multiply(...[t,...n]){return t?n.reduce((e,t)=>e.prepend(t),t):e.identity}get a(){return this.m00}get b(){return this.m10}get c(){return this.m01}get d(){return this.m11}get tx(){return this.m02}get ty(){return this.m12}get scaleComponents(){return{x:this.a,y:this.d}}get translationComponents(){return{x:this.tx,y:this.ty}}get skewComponents(){return{x:this.c,y:this.b}}toString(){return`matrix(${this.a}, ${this.b}, ${this.c}, ${this.d}, ${this.tx}, ${this.ty})`}},Fe=(e,t,n)=>Math.min(Math.max(e,t),n),R=(e,t,n)=>({x:Fe(e.x,n.x,n.x+n.width-t.width),y:Fe(e.y,n.y,n.y+n.height-t.height)}),Ie={width:0,height:0},Le={width:1/0,height:1/0},z=(e,t=Ie,n=Le)=>({width:Math.min(Math.max(e.width,t.width),n.width),height:Math.min(Math.max(e.height,t.height),n.height)}),Re=(e,t)=>({x:e,y:t}),ze=(e,t)=>t?Re(e.x-t.x,e.y-t.y):e,Be=(e,t)=>Re(e.x+t.x,e.y+t.y);function B(e){let{x:t,y:n,width:r,height:i}=e,a=t+r/2,o=n+i/2;return{x:t,y:n,width:r,height:i,minX:t,minY:n,maxX:t+r,maxY:n+i,midX:a,midY:o,center:Re(a,o)}}var Ve=(e,t)=>({x:Math.max(t.x,Math.min(e.x,t.x+t.width-e.width)),y:Math.max(t.y,Math.min(e.y,t.y+t.height-e.height)),width:Math.min(e.width,t.width),height:Math.min(e.height,t.height)}),He=(e,t)=>e.width===t?.width&&e.height===t?.height,Ue=(e,t)=>e.x===t?.x&&e.y===t?.y,We=new WeakMap;function Ge(e){if(!We.has(e)){let t=e.ownerDocument.defaultView||window;We.set(e,t.getComputedStyle(e))}return We.get(e)}function Ke(e,t={}){return B(qe(e,t))}function qe(e,t={}){let{excludeScrollbar:n=!1,excludeBorders:r=!1}=t,{x:i,y:a,width:o,height:s}=e.getBoundingClientRect(),c={x:i,y:a,width:o,height:s},{borderLeftWidth:l,borderTopWidth:u,borderRightWidth:d,borderBottomWidth:f}=Ge(e),p=Ye(l,d),m=Ye(u,f);if(r&&(c.width-=p,c.height-=m,c.x+=Je(l),c.y+=Je(u)),n){let t=e.offsetWidth-e.clientWidth-p,n=e.offsetHeight-e.clientHeight-m;c.width-=t,c.height-=n}return c}var Je=e=>parseFloat(e.replace(`px`,``)),Ye=(...e)=>e.reduce((e,t)=>e+(t?Je(t):0),0);function Xe(e,t={}){return B(Ze(e,t))}function Ze(e,t){let{excludeScrollbar:n=!1}=t,{innerWidth:r,innerHeight:i,document:a,visualViewport:o}=e,s={x:0,y:0,width:o?.width||r,height:o?.height||i};if(n){let e=r-a.documentElement.clientWidth,t=i-a.documentElement.clientHeight;s.width-=e,s.height-=t}return s}var Qe={n:{x:.5,y:0},ne:{x:1,y:0},e:{x:1,y:.5},se:{x:1,y:1},s:{x:.5,y:1},sw:{x:0,y:1},w:{x:0,y:.5},nw:{x:0,y:0}},$e={n:`s`,ne:`sw`,e:`w`,se:`nw`,s:`n`,sw:`ne`,w:`e`,nw:`se`},{sign:V,abs:H,min:et}=Math;function tt(e,t){let{minX:n,minY:r,maxX:i,maxY:a,midX:o,midY:s}=e;return{x:t.includes(`w`)?n:t.includes(`e`)?i:o,y:t.includes(`n`)?r:t.includes(`s`)?a:s}}function nt(e){return $e[e]}function rt(e,t,n,r){let{scalingOriginMode:i,lockAspectRatio:a}=r,o=tt(e,n),s=tt(e,nt(n));i===`center`&&(t={x:t.x*2,y:t.y*2});let c={x:o.x+t.x,y:o.y+t.y},l={x:Qe[n].x*2-1,y:Qe[n].y*2-1},u={width:c.x-s.x,height:c.y-s.y},d=l.x*u.width/e.width,f=l.y*u.height/e.height,p=H(d)>H(f)?d:f,m=a?{x:p,y:p}:{x:o.x===s.x?1:d,y:o.y===s.y?1:f};switch(o.y===s.y?m.y=H(m.y):V(m.y)!==V(f)&&(m.y*=-1),o.x===s.x?m.x=H(m.x):V(m.x)!==V(d)&&(m.x*=-1),i){case`extent`:return at(e,Pe.scale(m.x,m.y,s),!1);case`center`:return at(e,Pe.scale(m.x,m.y,{x:e.midX,y:e.midY}),!1)}}function it(e,t,n=!0){return n?{x:et(t.x,e.x),y:et(t.y,e.y),width:H(t.x-e.x),height:H(t.y-e.y)}:{x:e.x,y:e.y,width:t.x-e.x,height:t.y-e.y}}function at(e,t,n=!0){return it(t.applyTo({x:e.minX,y:e.minY}),t.applyTo({x:e.maxX,y:e.maxY}),n)}var U=be(`floating-panel`).parts(`trigger`,`positioner`,`content`,`header`,`body`,`title`,`resizeTrigger`,`dragTrigger`,`stageTrigger`,`closeTrigger`,`control`).build(),ot=e=>e.ids?.trigger??`float:${e.id}:trigger`,st=e=>e.ids?.positioner??`float:${e.id}:positioner`,ct=e=>e.ids?.content??`float:${e.id}:content`,lt=e=>e.ids?.title??`float:${e.id}:title`,ut=e=>e.ids?.header??`float:${e.id}:header`,dt=e=>e.getById(ot(e)),ft=e=>e.getById(st(e)),pt=e=>e.getById(ct(e)),mt=e=>e.getById(ut(e)),W=(e,t,n)=>{let r;return r=he(t)?Ke(t):Xe(e.getWin()),n&&(r=B({x:-r.width,y:r.minY,width:r.width*3,height:r.height*2})),A(r,[`x`,`y`,`width`,`height`])};function ht(e){switch(e){case`n`:return{cursor:`n-resize`,width:`100%`,top:0,left:`50%`,translate:`-50%`};case`e`:return{cursor:`e-resize`,height:`100%`,right:0,top:`50%`,translate:`0 -50%`};case`s`:return{cursor:`s-resize`,width:`100%`,bottom:0,left:`50%`,translate:`-50%`};case`w`:return{cursor:`w-resize`,height:`100%`,left:0,top:`50%`,translate:`0 -50%`};case`se`:return{cursor:`se-resize`,bottom:0,right:0};case`sw`:return{cursor:`sw-resize`,bottom:0,left:0};case`ne`:return{cursor:`ne-resize`,top:0,right:0};case`nw`:return{cursor:`nw-resize`,top:0,left:0};default:throw Error(`Invalid axis: ${e}`)}}var gt=new Set([`minimized`,`maximized`,`default`]);function _t(e,t){let{state:n,send:r,scope:i,prop:a,computed:o,context:s}=e,c=n.hasTag(`open`),l=n.matches(`open.dragging`),u=n.matches(`open.resizing`),d=s.get(`isTopmost`),f=s.get(`size`),p=s.get(`position`),h=o(`isMaximized`),g=o(`isMinimized`),_=o(`isStaged`),v=o(`canResize`),y=o(`canDrag`);return{open:c,resizable:a(`resizable`),draggable:a(`draggable`),setOpen(e){n.hasTag(`open`)!==e&&r({type:e?`OPEN`:`CLOSE`})},dragging:l,resizing:u,position:p,size:f,setPosition(e){r({type:`SET_POSITION`,position:e})},setSize(e){r({type:`SET_SIZE`,size:e})},minimize(){r({type:`MINIMIZE`})},maximize(){r({type:`MAXIMIZE`})},restore(){r({type:`RESTORE`})},getTriggerProps(){return t.button({...U.trigger.attrs,dir:a(`dir`),type:`button`,disabled:a(`disabled`),id:ot(i),"data-state":c?`open`:`closed`,"data-dragging":j(l),"aria-controls":ct(i),onClick(e){e.defaultPrevented||a(`disabled`)||r({type:n.hasTag(`open`)?`CLOSE`:`OPEN`,src:`trigger`})}})},getPositionerProps(){return t.element({...U.positioner.attrs,dir:a(`dir`),id:st(i),style:{"--width":m(f?.width),"--height":m(f?.height),"--x":m(p?.x),"--y":m(p?.y),position:a(`strategy`),top:`var(--y)`,left:`var(--x)`}})},getContentProps(){return t.element({...U.content.attrs,dir:a(`dir`),role:`dialog`,tabIndex:0,hidden:!c,id:ct(i),"aria-labelledby":lt(i),"data-state":c?`open`:`closed`,"data-dragging":j(l),"data-topmost":j(d),"data-behind":j(!d),"data-minimized":j(g),"data-maximized":j(h),"data-staged":j(_),style:{width:`var(--width)`,height:`var(--height)`,overflow:g?`hidden`:void 0},onFocus(){r({type:`CONTENT_FOCUS`})},onKeyDown(e){if(e.defaultPrevented)return;if(e.key===`Escape`&&d){r({type:`ESCAPE`});return}if(e.currentTarget!==x(e))return;let t=ue(e)*a(`gridSize`),n={ArrowLeft(){r({type:`MOVE`,direction:`left`,step:t})},ArrowRight(){r({type:`MOVE`,direction:`right`,step:t})},ArrowUp(){r({type:`MOVE`,direction:`up`,step:t})},ArrowDown(){r({type:`MOVE`,direction:`down`,step:t})}}[ae(e,{dir:a(`dir`)})];n&&(e.preventDefault(),n(e))}})},getCloseTriggerProps(){return t.button({...U.closeTrigger.attrs,dir:a(`dir`),disabled:a(`disabled`),"aria-label":`Close Window`,type:`button`,onClick(e){e.defaultPrevented||r({type:`CLOSE`})}})},getStageTriggerProps(e){if(!gt.has(e.stage))throw Error(`[zag-js] Invalid stage: ${e.stage}. Must be one of: ${Array.from(gt).join(`, `)}`);let n=a(`translations`),i=xe(e.stage,{minimized:()=>({"aria-label":n.minimize,hidden:_}),maximized:()=>({"aria-label":n.maximize,hidden:_}),default:()=>({"aria-label":n.restore,hidden:!_})});return t.button({...U.stageTrigger.attrs,dir:a(`dir`),disabled:a(`disabled`),"data-stage":e.stage,...i,type:`button`,onClick(t){t.defaultPrevented||a(`resizable`)&&r({type:xe(e.stage,{minimized:()=>`MINIMIZE`,maximized:()=>`MAXIMIZE`,default:()=>`RESTORE`}).toUpperCase()})}})},getResizeTriggerProps(e){return t.element({...U.resizeTrigger.attrs,dir:a(`dir`),"data-disabled":j(!v),"data-axis":e.axis,onPointerDown(t){v&&T(t)&&(t.currentTarget.setPointerCapture(t.pointerId),t.stopPropagation(),r({type:`RESIZE_START`,axis:e.axis,position:{x:t.clientX,y:t.clientY}}))},onPointerUp(e){if(!v)return;let t=e.currentTarget;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId)},style:{position:`absolute`,touchAction:`none`,...ht(e.axis)}})},getDragTriggerProps(){return t.element({...U.dragTrigger.attrs,dir:a(`dir`),"data-disabled":j(!y),onPointerDown(e){if(!y||!T(e))return;let t=x(e);t?.closest(`button`)||t?.closest(`[data-no-drag]`)||(e.currentTarget.setPointerCapture(e.pointerId),e.stopPropagation(),r({type:`DRAG_START`,pointerId:e.pointerId,position:{x:e.clientX,y:e.clientY}}))},onPointerUp(e){if(!y)return;let t=e.currentTarget;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId)},onDoubleClick(e){e.defaultPrevented||a(`resizable`)&&r({type:_?`RESTORE`:`MAXIMIZE`})},style:{WebkitUserSelect:`none`,userSelect:`none`,touchAction:`none`,cursor:`move`}})},getControlProps(){return t.element({...U.control.attrs,dir:a(`dir`),"data-disabled":j(a(`disabled`)),"data-stage":s.get(`stage`),"data-minimized":j(g),"data-maximized":j(h),"data-staged":j(_)})},getTitleProps(){return t.element({...U.title.attrs,dir:a(`dir`),id:lt(i)})},getHeaderProps(){return t.element({...U.header.attrs,dir:a(`dir`),id:ut(i),"data-dragging":j(l),"data-topmost":j(d),"data-behind":j(!d),"data-minimized":j(g),"data-maximized":j(h),"data-staged":j(_)})},getBodyProps(){return t.element({...U.body.attrs,dir:a(`dir`),"data-dragging":j(l),"data-minimized":j(g),"data-maximized":j(h),"data-staged":j(_),hidden:g})}}}function vt(){if(typeof globalThis<`u`)return globalThis;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(typeof global<`u`)return global}function yt(e,t){let n=vt();return n?(n[e]||(n[e]=t()),n[e]):t()}var G=yt(`__zag__refSet`,()=>new WeakSet),bt=e=>typeof e==`object`&&!!e&&`$$typeof`in e&&`props`in e,xt=e=>typeof e==`object`&&!!e&&`__v_isVNode`in e,St=e=>typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeName==`string`,Ct=e=>bt(e)||xt(e)||St(e),wt=e=>typeof e==`object`&&!!e,Tt=e=>wt(e)&&!G.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!Ct(e)&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)&&!(e instanceof Promise)&&!(e instanceof File)&&!(e instanceof Blob)&&!(e instanceof AbortController),K=()=>!1,Et=Symbol(),Dt=Object.getPrototypeOf,Ot=new WeakMap,kt=e=>e&&(Ot.has(e)?Ot.get(e):Dt(e)===Object.prototype||Dt(e)===Array.prototype),At=e=>kt(e)&&e[Et]||null,jt=(e,t=!0)=>{Ot.set(e,t)},q=yt(`__zag__proxyStateMap`,()=>new WeakMap),[Mt]=((e=Object.is,t=(e,t)=>new Proxy(e,t),n=new WeakMap,r=(e,t)=>{let r=n.get(e);if(r?.[0]===t)return r[1];let i=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return jt(i,!0),n.set(e,[t,i]),Reflect.ownKeys(e).forEach(t=>{let n=Reflect.get(e,t);G.has(n)?(jt(n,!1),i[t]=n):q.has(n)?i[t]=Ft(n):i[t]=n}),Object.freeze(i)},i=new WeakMap,a=[1,1],o=n=>{if(!wt(n))throw Error(`object required`);let o=i.get(n);if(o)return o;let s=a[0],c=new Set,l=(e,t=++a[0])=>{s!==t&&(s=t,c.forEach(n=>n(e,t)))},u=a[1],d=(e=++a[1])=>(u!==e&&!c.size&&(u=e,p.forEach(([t])=>{let n=t[1](e);n>s&&(s=n)})),s),f=e=>(t,n)=>{let r=[...t];r[1]=[e,...r[1]],l(r,n)},p=new Map,m=(e,t)=>{if(K()&&p.has(e))throw Error(`prop listener already exists`);if(c.size){let n=t[3](f(e));p.set(e,[t,n])}else p.set(e,[t])},h=e=>{let t=p.get(e);t&&(p.delete(e),t[1]?.())},g=e=>(c.add(e),c.size===1&&p.forEach(([e,t],n)=>{if(K()&&t)throw Error(`remove already exists`);let r=e[3](f(n));p.set(n,[e,r])}),()=>{c.delete(e),c.size===0&&p.forEach(([e,t],n)=>{t&&(t(),p.set(n,[e]))})}),_=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n)),v=t(_,{deleteProperty(e,t){let n=Reflect.get(e,t);h(t);let r=Reflect.deleteProperty(e,t);return r&&l([`delete`,[t],n]),r},set(t,n,r,a){let o=Reflect.has(t,n),s=Reflect.get(t,n,a);if(o&&(e(s,r)||i.has(r)&&e(s,i.get(r))))return!0;h(n),wt(r)&&(r=At(r)||r);let c=r;if(!Object.getOwnPropertyDescriptor(t,n)?.set){!q.has(r)&&Tt(r)&&(c=Nt(r));let e=!G.has(c)&&q.get(c);e&&m(n,e)}return Reflect.set(t,n,c,a),l([`set`,[n],r,s]),!0}});i.set(n,v);let y=[_,d,r,g];return q.set(v,y),Reflect.ownKeys(n).forEach(e=>{let t=Object.getOwnPropertyDescriptor(n,e);t.get||t.set?Object.defineProperty(_,e,t):v[e]=n[e]}),v})=>[o,q,G,e,t,Tt,n,r,i,a])();function Nt(e={}){return Mt(e)}function Pt(e,t,n){let r=q.get(e);K()&&!r&&console.warn(`Please use proxy object`);let i,a=[],o=r[3],s=!1,c=o(e=>{if(a.push(e),n){t(a.splice(0));return}i||=Promise.resolve().then(()=>{i=void 0,s&&t(a.splice(0))})});return s=!0,()=>{s=!1,c()}}function Ft(e){let t=q.get(e);K()&&!t&&console.warn(`Please use proxy object`);let[n,r,i]=t;return i(n,r())}var J=Nt({stack:[],count(){return this.stack.length},add(e){this.stack.includes(e)||this.stack.push(e)},remove(e){let t=this.stack.indexOf(e);t<0||this.stack.splice(t,1)},bringToFront(e){this.remove(e),this.add(e)},isTopmost(e){return this.stack[this.stack.length-1]===e},indexOf(e){return this.stack.indexOf(e)}}),{not:It,and:Lt}=oe(),Rt={minimize:`Minimize window`,maximize:`Maximize window`,restore:`Restore window`},zt=Object.freeze({width:320,height:240}),Bt=Object.freeze({x:300,y:100}),Vt=de({props({props:e}){return se(e,[`id`],`floating-panel`),{strategy:`fixed`,gridSize:1,allowOverflow:!0,resizable:!0,draggable:!0,...e,translations:{...Rt,...e.translations}}},initialState({prop:e}){return e(`open`)??e(`defaultOpen`)?`open`:`closed`},context({prop:e,bindable:t}){return{size:t(()=>({defaultValue:e(`defaultSize`)??zt,value:e(`size`),isEqual:He,hash(e){return`W:${e.width} H:${e.height}`},onChange(t){e(`onSizeChange`)?.({size:t})}})),position:t(()=>({defaultValue:e(`defaultPosition`)??Bt,value:e(`position`),isEqual:Ue,hash(e){return`X:${e.x} Y:${e.y}`},onChange(t){e(`onPositionChange`)?.({position:t})}})),stage:t(()=>({defaultValue:`default`,onChange(t){e(`onStageChange`)?.({stage:t})}})),lastEventPosition:t(()=>({defaultValue:null})),prevPosition:t(()=>({defaultValue:null})),prevSize:t(()=>({defaultValue:null})),isTopmost:t(()=>({defaultValue:void 0}))}},computed:{isMaximized:({context:e})=>e.get(`stage`)===`maximized`,isMinimized:({context:e})=>e.get(`stage`)===`minimized`,isStaged:({context:e})=>e.get(`stage`)!==`default`,hasSpecifiedPosition:({prop:e})=>e(`defaultPosition`)!=null||e(`position`)!=null,canResize:({context:e,prop:t})=>t(`resizable`)&&!t(`disabled`)&&e.get(`stage`)===`default`,canDrag:({prop:e,computed:t})=>e(`draggable`)&&!e(`disabled`)&&!t(`isMaximized`)},watch({track:e,context:t,action:n,prop:r}){e([()=>t.hash(`position`)],()=>{n([`setPositionStyle`])}),e([()=>t.hash(`size`)],()=>{n([`setSizeStyle`])}),e([()=>r(`open`)],()=>{n([`toggleVisibility`])})},effects:[`trackPanelStack`],on:{CONTENT_FOCUS:{actions:[`bringToFrontOfPanelStack`]},SET_POSITION:{actions:[`setPosition`]},SET_SIZE:{actions:[`setSize`]}},states:{closed:{tags:[`closed`],on:{"CONTROLLED.OPEN":{target:`open`,actions:[`setAnchorPosition`,`setPositionStyle`,`setSizeStyle`,`setInitialFocus`]},OPEN:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`invokeOnOpen`,`setAnchorPosition`,`setPositionStyle`,`setSizeStyle`,`setInitialFocus`]}]}},open:{tags:[`open`],entry:[`bringToFrontOfPanelStack`],initial:`idle`,on:{"CONTROLLED.CLOSE":{target:`closed`,actions:[`resetRect`,`setFinalFocus`]},CLOSE:[{guard:`isOpenControlled`,target:`closed`,actions:[`invokeOnClose`,`setFinalFocus`]},{target:`closed`,actions:[`invokeOnClose`,`resetRect`,`setFinalFocus`]}]},states:{idle:{effects:[`trackBoundaryRect`],on:{DRAG_START:{guard:It(`isMaximized`),target:`dragging`,actions:[`setPrevPosition`]},RESIZE_START:{guard:It(`isMinimized`),target:`resizing`,actions:[`setPrevSize`]},ESCAPE:[{guard:Lt(`isOpenControlled`,`closeOnEsc`),actions:[`invokeOnClose`]},{guard:`closeOnEsc`,target:`closed`,actions:[`invokeOnClose`,`resetRect`,`setFinalFocus`]}],MINIMIZE:{actions:[`setMinimized`]},MAXIMIZE:{actions:[`setMaximized`]},RESTORE:{actions:[`setRestored`]},MOVE:{actions:[`setPositionFromKeyboard`]}}},dragging:{effects:[`trackPointerMove`],on:{DRAG:{actions:[`setPositionFromDrag`]},DRAG_END:{target:`idle`,actions:[`invokeOnDragEnd`,`clearPrevPosition`]},ESCAPE:{target:`idle`,actions:[`restorePosition`,`clearPrevPosition`]}}},resizing:{effects:[`trackPointerMove`],on:{DRAG:{actions:[`setSizeFromDrag`]},DRAG_END:{target:`idle`,actions:[`invokeOnResizeEnd`,`clearPrevSize`]},ESCAPE:{target:`idle`,actions:[`restoreSize`,`clearPrevSize`]}}}}}},implementations:{guards:{closeOnEsc:({prop:e})=>!!e(`closeOnEscape`),isMaximized:({context:e})=>e.get(`stage`)===`maximized`,isMinimized:({context:e})=>e.get(`stage`)===`minimized`,isOpenControlled:({prop:e})=>e(`open`)!=null},effects:{trackPointerMove({scope:e,send:t,event:n,prop:r}){let i=e.getDoc(),a=r(`getBoundaryEl`)?.(),o=W(e,a,!1);return je(i,{onPointerMove({point:e,event:r}){let{altKey:i,shiftKey:a}=r;t({type:`DRAG`,position:{x:g(e.x,o.x,o.x+o.width),y:g(e.y,o.y,o.y+o.height)},axis:n.axis,altKey:i,shiftKey:a})},onPointerUp(){t({type:`DRAG_END`})}})},trackBoundaryRect({context:e,scope:t,prop:n,computed:r}){let i=t.getWin(),a=!0,o=()=>{if(a){a=!1;return}let i=n(`getBoundaryEl`)?.(),o=W(t,i,!1);r(`isMaximized`)||(o=Ve({...e.get(`position`),...e.get(`size`)},o)),e.set(`size`,A(o,[`width`,`height`])),e.set(`position`,A(o,[`x`,`y`]))},s=n(`getBoundaryEl`)?.();return he(s)?f.observe(s,o):C(i,`resize`,o)},trackPanelStack({context:e,scope:t}){let n=Pt(J,()=>{e.set(`isTopmost`,J.isTopmost(t.id));let n=pt(t);if(!n)return;let r=J.indexOf(t.id);r!==-1&&n.style.setProperty(`--z-index`,`${r+1}`)});return()=>{J.remove(t.id),n()}}},actions:{setPosition({context:e,event:t,prop:n,scope:r}){let i=n(`getBoundaryEl`)?.(),a=W(r,i,n(`allowOverflow`)),o=R(t.position,e.get(`size`),a);e.set(`position`,o)},setSize({context:e,event:t,scope:n,prop:r}){let i=r(`getBoundaryEl`)?.(),a=W(n,i,!1),o=t.size;o=z(o,r(`minSize`),r(`maxSize`)),o=z(o,r(`minSize`),a);let s=R(e.get(`position`),o,a);e.set(`size`,o),e.set(`position`,s)},setAnchorPosition({context:e,computed:t,prop:n,scope:r}){if(t(`hasSpecifiedPosition`))return;let i=e.get(`prevPosition`)||e.get(`prevSize`);if(n(`persistRect`)&&i)return;let a=dt(r),o=W(r,n(`getBoundaryEl`)?.(),!1),s=n(`getAnchorPosition`)?.({triggerRect:a?DOMRect.fromRect(Ke(a)):null,boundaryRect:DOMRect.fromRect(o)});if(!s){let t=e.get(`size`);s={x:o.x+(o.width-t.width)/2,y:o.y+(o.height-t.height)/2}}s&&e.set(`position`,s)},setPrevPosition({context:e,event:t}){e.set(`prevPosition`,{...e.get(`position`)}),e.set(`lastEventPosition`,t.position)},clearPrevPosition({context:e,prop:t}){t(`persistRect`)||e.set(`prevPosition`,null),e.set(`lastEventPosition`,null)},restorePosition({context:e}){let t=e.get(`prevPosition`);t&&e.set(`position`,t)},setPositionFromDrag({context:e,event:t,prop:n,scope:r}){let i=ze(t.position,e.get(`lastEventPosition`));i.x=Math.round(i.x/n(`gridSize`))*n(`gridSize`),i.y=Math.round(i.y/n(`gridSize`))*n(`gridSize`);let a=e.get(`prevPosition`);if(!a)return;let o=Be(a,i),s=n(`getBoundaryEl`)?.(),c=W(r,s,n(`allowOverflow`));o=R(o,e.get(`size`),c),e.set(`position`,o)},setPositionStyle({scope:e,context:t}){let n=ft(e),r=t.get(`position`);n?.style.setProperty(`--x`,`${r.x}px`),n?.style.setProperty(`--y`,`${r.y}px`)},resetRect({context:e,prop:t}){e.set(`stage`,`default`),t(`persistRect`)||(e.set(`position`,e.initial(`position`)),e.set(`size`,e.initial(`size`)))},setPrevSize({context:e,event:t}){e.set(`prevSize`,{...e.get(`size`)}),e.set(`prevPosition`,{...e.get(`position`)}),e.set(`lastEventPosition`,t.position)},clearPrevSize({context:e}){e.set(`prevSize`,null),e.set(`prevPosition`,null),e.set(`lastEventPosition`,null)},restoreSize({context:e}){let t=e.get(`prevSize`);t&&e.set(`size`,t);let n=e.get(`prevPosition`);n&&e.set(`position`,n)},setSizeFromDrag({context:e,event:t,scope:n,prop:r}){let i=e.get(`prevSize`),a=e.get(`prevPosition`),o=e.get(`lastEventPosition`);if(!i||!a||!o)return;let s=rt(B({...a,...i}),ze(t.position,o),t.axis,{scalingOriginMode:t.altKey?`center`:`extent`,lockAspectRatio:!!r(`lockAspectRatio`)||t.shiftKey}),c=A(s,[`width`,`height`]),l=A(s,[`x`,`y`]),u=r(`getBoundaryEl`)?.(),d=W(n,u,!1);if(c=z(c,r(`minSize`),r(`maxSize`)),c=z(c,r(`minSize`),d),e.set(`size`,c),l){let t=R(l,c,d);e.set(`position`,t)}},setSizeStyle({scope:e,context:t}){queueMicrotask(()=>{let n=ft(e),r=t.get(`size`);n?.style.setProperty(`--width`,`${r.width}px`),n?.style.setProperty(`--height`,`${r.height}px`)})},setMaximized({context:e,prop:t,scope:n}){if(e.get(`stage`)===`maximized`)return;let r=e.get(`stage`)===`default`,i=e.get(`size`),a=e.get(`position`),o=t(`getBoundaryEl`)?.(),s=W(n,o,!1),c=A(s,[`x`,`y`]),l=A(s,[`height`,`width`]);e.set(`stage`,`maximized`),r&&(e.set(`prevSize`,i),e.set(`prevPosition`,a)),e.set(`position`,c),e.set(`size`,l)},setMinimized({context:e,scope:t}){if(e.get(`stage`)===`minimized`)return;let n=e.get(`stage`)===`default`,r=e.get(`size`),i=e.get(`position`);e.set(`stage`,`minimized`),n&&(e.set(`prevSize`,r),e.set(`prevPosition`,i));let a=mt(t);if(!a)return;let o={...r,height:a?.offsetHeight};e.set(`size`,o)},setRestored({context:e,prop:t,scope:n}){let r=W(n,t(`getBoundaryEl`)?.(),!1);e.set(`stage`,`default`);let i=e.get(`size`),a=e.get(`prevSize`);a&&(i=z(a,t(`minSize`),t(`maxSize`)),i=z(i,t(`minSize`),r));let o=e.get(`position`),s=e.get(`prevPosition`);s&&(o=R(s,i,r)),e.set(`size`,i),e.set(`position`,o),e.set(`prevSize`,null),e.set(`prevPosition`,null)},setPositionFromKeyboard({context:e,event:t,prop:n,scope:r}){me(t.step==null,`step is required`);let i=e.get(`position`),a=t.step,o=xe(t.direction,{left:{x:i.x-a,y:i.y},right:{x:i.x+a,y:i.y},up:{x:i.x,y:i.y-a},down:{x:i.x,y:i.y+a}}),s=n(`getBoundaryEl`)?.(),c=W(r,s,!1);o=R(o,e.get(`size`),c),e.set(`position`,o)},bringToFrontOfPanelStack({prop:e}){J.bringToFront(e(`id`))},invokeOnOpen({prop:e}){e(`onOpenChange`)?.({open:!0})},invokeOnClose({prop:e}){e(`onOpenChange`)?.({open:!1})},invokeOnDragEnd({context:e,prop:t}){t(`onPositionChangeEnd`)?.({position:e.get(`position`)})},invokeOnResizeEnd({context:e,prop:t}){t(`onSizeChangeEnd`)?.({size:e.get(`size`)})},setFinalFocus({scope:e,prop:t}){t(`restoreFocus`)!==!1&&E(()=>{(t(`finalFocusEl`)?.()??dt(e))?.focus({preventScroll:!0})})},setInitialFocus({scope:e,prop:t}){E(()=>{(t(`initialFocusEl`)?.()??pt(e))?.focus({preventScroll:!0})})},toggleVisibility({send:e,prop:t,event:n}){e({type:t(`open`)?`CONTROLLED.OPEN`:`CONTROLLED.CLOSE`,previousEvent:n})}}}}),[Ht,Y]=D({name:`FloatingPanelContext`,hookName:`useFloatingPanelContext`,providerName:`<FloatingPanelProvider />`}),X=n(),Z=e(t(),1),Ut=(0,Z.forwardRef)((e,t)=>{let n=M(Y().getBodyProps(),e);return(0,X.jsx)(N.div,{...n,ref:t})});Ut.displayName=`FloatingPanelBody`;var Wt=(0,Z.forwardRef)((e,t)=>{let n=Y(),r=fe(),i=M(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:(0,X.jsx)(N.div,{...i,ref:Se(r.ref,t)})});Wt.displayName=`FloatingPanelContent`;var Gt=(0,Z.forwardRef)((e,t)=>{let n=M(Y().getDragTriggerProps(),e);return(0,X.jsx)(N.div,{...n,ref:t})});Gt.displayName=`FloatingPanelDragTrigger`;var Kt=(0,Z.forwardRef)((e,t)=>{let n=M(Y().getHeaderProps(),e);return(0,X.jsx)(N.div,{...n,ref:t})});Kt.displayName=`FloatingPanelHeader`;var qt=(0,Z.forwardRef)((e,t)=>{let n=M(Y().getPositionerProps(),e);return fe().unmounted?null:(0,X.jsx)(N.div,{...n,ref:t})});qt.displayName=`FloatingPanelPositioner`;var Jt=(e={})=>{let{getRootNode:t}=O(),{dir:n}=ge();return _t(ve(Vt,{id:(0,Z.useId)(),dir:n,getRootNode:t,...e}),_e)},Yt=ce(),Xt=e=>{let[t,n]=k(e),[r,i]=Yt(n,`allowOverflow.closeOnEscape.defaultOpen.defaultPosition.defaultSize.dir.disabled.draggable.getAnchorPosition.getBoundaryEl.gridSize.finalFocusEl.id.ids.initialFocusEl.lockAspectRatio.maxSize.minSize.onOpenChange.onPositionChange.onPositionChangeEnd.onSizeChange.onSizeChangeEnd.onStageChange.open.persistRect.position.resizable.restoreFocus.size.strategy.translations`.split(`.`)),a=Jt(r);return(0,X.jsx)(Ht,{value:a,children:(0,X.jsx)(pe,{value:le(M({present:a.open},t)),children:i.children})})},Zt=(0,Z.forwardRef)((e,t)=>{let n=M(Y().getTitleProps(),e);return(0,X.jsx)(N.h2,{...n,ref:t})});Zt.displayName=`FloatingPanelTitle`;var Qt=(e,t)=>e.iterations===t.iterations&&e.gravity===t.gravity&&e.scalingRatio===t.scalingRatio&&e.strongGravityMode===t.strongGravityMode&&e.linLogMode===t.linLogMode&&e.adjustSizes===t.adjustSizes&&e.outboundAttractionDistribution===t.outboundAttractionDistribution&&e.hideClusterLabels===t.hideClusterLabels&&e.nodeSizeScale===t.nodeSizeScale;function Q(e){return(0,X.jsxs)(`label`,{className:`space-y-2 text-sm text-slate-700 dark:text-slate-200`,children:[(0,X.jsxs)(`span`,{className:`flex items-center justify-between gap-3 font-medium`,children:[(0,X.jsx)(`span`,{children:e.label}),(0,X.jsx)(`span`,{className:`text-xs text-slate-500 dark:text-slate-400`,children:e.value})]}),(0,X.jsx)(we,{type:`number`,value:String(e.value),min:e.min,max:e.max,step:e.step,onChange:t=>e.onChange(Number(t.currentTarget.value))}),(0,X.jsx)(`p`,{className:`text-xs leading-5 text-slate-500 dark:text-slate-400`,children:e.help})]})}function $(e){return(0,X.jsxs)(`label`,{className:`flex items-start gap-3 rounded-2xl border border-slate-200/70 bg-slate-50/80 p-3 dark:border-slate-800 dark:bg-slate-900/70`,children:[(0,X.jsx)(`input`,{type:`checkbox`,className:`mt-1 size-4 rounded border-slate-300`,checked:e.checked,onChange:t=>e.onChange(t.currentTarget.checked)}),(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`span`,{className:`block text-sm font-medium text-slate-800 dark:text-slate-100`,children:e.label}),(0,X.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-slate-500 dark:text-slate-400`,children:e.help})]})]})}function $t(e){return e.open?(0,X.jsx)(en,{...e},JSON.stringify(e.settings)):null}function en(e){let[t,n]=(0,Z.useState)(e.settings),r=(0,Z.useMemo)(()=>!Qt(t,e.settings),[t,e.settings]),i=(e,r)=>{n({...t,[e]:r})};return(0,X.jsx)(Xt,{open:!0,defaultSize:{width:420,height:640},minSize:{width:360,height:520},persistRect:!0,lazyMount:!0,children:(0,X.jsx)(Ce,{children:(0,X.jsx)(qt,{className:`z-50`,children:(0,X.jsxs)(Wt,{className:`flex h-full flex-col overflow-hidden rounded-[24px] border border-slate-200 bg-white shadow-[0_24px_80px_-36px_rgba(15,23,42,0.75)] dark:border-slate-800 dark:bg-slate-950`,children:[(0,X.jsx)(Gt,{children:(0,X.jsxs)(Kt,{className:`flex cursor-move items-center justify-between border-b border-slate-200 bg-slate-50/90 px-4 py-3 dark:border-slate-800 dark:bg-slate-900/80`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`div`,{className:`rounded-xl bg-sky-100 p-2 text-sky-700 dark:bg-sky-500/15 dark:text-sky-300`,children:(0,X.jsx)(Ee,{className:`size-4`})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(Zt,{className:`text-sm font-semibold text-slate-900 dark:text-slate-100`,children:`Graph settings`}),(0,X.jsx)(`p`,{className:`text-xs text-slate-500 dark:text-slate-400`,children:`Layout controls for cluster spacing, gravity, and legibility.`})]})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsxs)(P,{variant:`outline`,size:`sm`,onClick:()=>{n(e.onReset())},children:[(0,X.jsx)(te,{className:`size-4`}),`Reset`]}),(0,X.jsx)(P,{size:`sm`,onClick:()=>{r&&e.onSettingsChange(t)},disabled:!r,children:`Apply`}),(0,X.jsx)(P,{variant:`ghost`,size:`icon`,onClick:()=>e.onOpenChange(!1),children:(0,X.jsx)(ne,{className:`size-4`})})]})]})}),(0,X.jsx)(Ut,{className:`flex-1 overflow-y-auto px-4 py-4`,children:(0,X.jsxs)(`div`,{className:`space-y-5`,children:[(0,X.jsx)(Q,{label:`Iterations`,value:t.iterations,min:10,max:500,step:10,onChange:e=>i(`iterations`,Math.max(10,e||10)),help:`Higher values let ForceAtlas2 settle longer before the graph renders.`}),(0,X.jsx)(Q,{label:`Gravity`,value:t.gravity,min:0,max:1500,step:1,onChange:e=>i(`gravity`,Math.max(0,e||0)),help:`Pulls nodes back toward the center. Lower gravity spreads clusters out more.`}),(0,X.jsx)(Q,{label:`Scaling ratio`,value:t.scalingRatio,min:1,max:500,step:1,onChange:e=>i(`scalingRatio`,Math.max(1,e||1)),help:`Primary spacing control. Higher values increase separation between nodes and clusters.`}),(0,X.jsx)(Q,{label:`Node size scale`,value:t.nodeSizeScale,min:.5,max:4,step:.1,onChange:e=>i(`nodeSizeScale`,Math.max(.5,Number(e.toFixed(1))||1)),help:`Amplifies the node size derived from inbound edge count.`}),(0,X.jsxs)(`div`,{className:`grid gap-3`,children:[(0,X.jsx)($,{label:`Strong gravity mode`,checked:t.strongGravityMode,onChange:e=>i(`strongGravityMode`,e),help:`Keeps distant nodes from drifting too far out of frame.`}),(0,X.jsx)($,{label:`LinLog mode`,checked:t.linLogMode,onChange:e=>i(`linLogMode`,e),help:`Often improves community separation in clustered graphs.`}),(0,X.jsx)($,{label:`Adjust sizes`,checked:t.adjustSizes,onChange:e=>i(`adjustSizes`,e),help:`Uses node size during layout to reduce collisions.`}),(0,X.jsx)($,{label:`Outbound attraction distribution`,checked:t.outboundAttractionDistribution,onChange:e=>i(`outboundAttractionDistribution`,e),help:`Balances attraction when hubs create too much pull.`}),(0,X.jsx)($,{label:`Hide cluster labels`,checked:t.hideClusterLabels,onChange:e=>i(`hideClusterLabels`,e),help:`Useful when labels cover dense areas during exploration.`})]})]})})]})})})})}var tn=(0,Z.lazy)(()=>o(()=>import(`./modviz-sigma-Xl8qHaxK.js`).then(e=>({default:e.ModvizSigma})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])));function nn(){let e=s(),t=u.useSearch(),n=u.useNavigate(),[o,f]=(0,Z.useState)(!1),[m,g]=(0,Z.useState)(0),b=d(h),ne=d(p),x=d(y);if(!a(e))return(0,X.jsx)(ee,{title:`Bubble Graph`,description:`Force-directed cluster view for spatial exploration.`,children:(0,X.jsx)(re,{bundle:e})});let S=(0,Z.useMemo)(()=>c(e.graph),[e.graph]),ae=(0,Z.useMemo)(()=>l(e.graph.nodes.length),[e.graph.nodes.length]),C=(0,Z.useMemo)(()=>({adjustSizes:t.adjustSizes,gravity:t.gravity,hideClusterLabels:t.hideClusterLabels,iterations:t.iterations,linLogMode:t.linLogMode,nodeSizeScale:t.nodeSizeScale,outboundAttractionDistribution:t.outboundAttractionDistribution,scalingRatio:t.scalingRatio,strongGravityMode:t.strongGravityMode}),[t]),w=t.scope,T=t.externalGrouping,E=(0,Z.useMemo)(()=>r(e.graph.nodes,S,w),[e.graph.nodes,w,S]),D=(0,Z.useMemo)(()=>t.cluster?E.filter(e=>i(e,S,T)===t.cluster):E,[T,E,t.cluster,S]),oe=(0,Z.useMemo)(()=>JSON.stringify({cluster:t.cluster,externalGrouping:T,layoutSettings:C,refreshNonce:m,scope:w}),[T,C,m,w,t.cluster]),O=e=>n({replace:!0,search:t=>({...t,...e})}),k=e=>{_.set(e),h.set(e),y.set(t=>e?t.includes(e)?t.filter(t=>t!==e):[...t,e]:[])};return(0,Z.useEffect)(()=>{t.focus&&k(t.focus)},[t.focus]),(0,X.jsxs)(ee,{title:`Bubble Graph`,description:`Force-directed cluster view for spatial exploration. Open this only when you need the full graph canvas, then tune spacing and gravity from the floating settings panel.`,actions:(0,X.jsxs)(P,{variant:`outline`,onClick:()=>f(!0),children:[(0,X.jsx)(Ee,{className:`size-4`}),`Layout settings`]}),children:[(0,X.jsxs)(`div`,{className:`flex h-[calc(100vh-14rem)] min-h-[680px] flex-col gap-4`,children:[(0,X.jsxs)(`section`,{className:`flex flex-wrap items-center gap-2 rounded-[24px] border border-slate-200/70 bg-white/90 p-4 shadow-[0_16px_50px_-32px_rgba(15,23,42,0.55)] dark:border-slate-800 dark:bg-slate-950/70`,children:[[[`all`,`All nodes`],[`workspace`,`Monorepo only`],[`external`,`node_modules only`]].map(([e,t])=>(0,X.jsx)(P,{variant:w===e?`default`:`outline`,size:`sm`,onClick:()=>O({scope:e,cluster:``}),children:t},e)),(0,X.jsxs)(`label`,{className:`ml-auto flex items-center gap-2 text-sm text-slate-600 dark:text-slate-300`,children:[(0,X.jsx)(`span`,{children:`External grouping`}),(0,X.jsxs)(`select`,{className:`h-9 rounded-md border border-input bg-transparent px-3 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,value:T,onChange:e=>O({cluster:``,externalGrouping:e.currentTarget.value}),children:[(0,X.jsx)(`option`,{value:`package`,children:`by package`}),(0,X.jsx)(`option`,{value:`combined`,children:`single node_modules cluster`})]})]})]}),(0,X.jsxs)(`section`,{className:`flex flex-wrap items-center gap-3 rounded-[24px] border border-slate-200/70 bg-white/90 p-4 shadow-[0_16px_50px_-32px_rgba(15,23,42,0.55)] dark:border-slate-800 dark:bg-slate-950/70`,children:[(0,X.jsx)(`div`,{className:`min-w-[18rem] flex-1`,children:(0,X.jsx)(v,{nodes:D,onHighlight:e=>{if(!e)return _.set(null);_.set(e)},onSelect:e=>{if(_.set(null),!e){k(null),O({focus:``});return}k(e),O({focus:e})}})}),(0,X.jsxs)(P,{variant:`outline`,onClick:()=>p.set(!0),disabled:!b,children:[(0,X.jsx)(Te,{className:`size-4`}),ne?`Details open`:`Open details`]}),(0,X.jsxs)(P,{variant:`outline`,onClick:()=>k(null),disabled:x.length===0,children:[`Clear selection (`,x.length,`)`]}),(0,X.jsxs)(P,{variant:`outline`,onClick:()=>g(e=>e+1),children:[(0,X.jsx)(te,{className:`size-4`}),`Refresh canvas`]}),b?(0,X.jsx)(P,{variant:`outline`,onClick:()=>{k(null),p.set(!1),O({focus:``})},children:`Clear current node`}):null,(0,X.jsxs)(`div`,{className:`text-sm text-slate-500 dark:text-slate-400`,children:[D.length,` nodes, `,e.graph.metadata.packages.length,` workspace packages`,x.length>0?` • ${x.length} selected`:``,b?` • current ${b.split(`/`).at(-1)}`:``,t.cluster?` • filtered to ${t.cluster}`:``]})]}),(0,X.jsx)(`section`,{className:`min-h-0 flex-1 overflow-hidden rounded-[28px] border border-slate-200/70 bg-white/90 shadow-[0_20px_70px_-36px_rgba(15,23,42,0.55)] dark:border-slate-800 dark:bg-slate-950/70`,children:(0,X.jsx)(Z.Suspense,{fallback:(0,X.jsx)(ie,{label:`Loading graph…`,description:`Preparing the Sigma canvas and layout pass.`}),children:(0,X.jsx)(tn,{output:{...e.graph,nodes:D},entryNode:t.focus||e.graph.metadata.entrypoints[0],externalGrouping:T,layoutSettings:C,packages:e.graph.metadata.packages,nodes:D},oe)})})]}),(0,X.jsx)($t,{open:o,settings:C,onOpenChange:f,onSettingsChange:e=>O(e),onReset:()=>(O(ae),ae)})]})}export{nn as component};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/graph-6Vr74V1k.js","assets/jsx-runtime-DWSWI4JT.js","assets/modviz-data-BiRqoDI5.js","assets/button-aOWckyNs.js","assets/utils-DkkZd0ys.js","assets/portal-BgAm3V3j.js","assets/floating-ui.dom-DLIT5tPE.js","assets/graph-command-menu-D2MoVT2B.js","assets/command-kkF7_wdz.js","assets/search-BYHxNrYn.js","assets/graph-command-menu-VWiiW3qy.css","assets/modviz-layout-Do93E-IB.js","assets/setup-view-j1o0TuZz.js","assets/loading-state-CyC_hrTF.js","assets/input-BCFMF0aR.js"])))=>i.map(i=>d[i]);
2
+ import{m as e}from"./modviz-data-BiRqoDI5.js";import{n as t,t as n}from"./lazyRouteComponent-PTSyFp1J.js";import{t as r}from"./search-params-BaZRBvGI.js";var i=e=>{let t=Math.max(1,Math.sqrt(Math.max(e,1)));return{iterations:Math.min(420,Math.max(220,Math.round(170+t*2.4))),gravity:Number(Math.max(.15,Math.min(1.2,t/90)).toFixed(2)),scalingRatio:Math.min(220,Math.max(40,Math.round(28+t*2.6))),strongGravityMode:!1,linLogMode:!0,adjustSizes:!0,outboundAttractionDistribution:!0,hideClusterLabels:!1,nodeSizeScale:.85}},a=t(`/graph`)({validateSearch:e=>{let t=i(3961);return{adjustSizes:r.boolean(e.adjustSizes,t.adjustSizes),cluster:r.string(e.cluster),externalGrouping:e.externalGrouping===`combined`?`combined`:`package`,focus:r.string(e.focus),gravity:r.number(e.gravity,t.gravity),hideClusterLabels:r.boolean(e.hideClusterLabels,t.hideClusterLabels),iterations:Math.round(r.number(e.iterations,t.iterations)),linLogMode:r.boolean(e.linLogMode,t.linLogMode),nodeSizeScale:r.number(e.nodeSizeScale,t.nodeSizeScale),outboundAttractionDistribution:r.boolean(e.outboundAttractionDistribution,t.outboundAttractionDistribution),scalingRatio:r.number(e.scalingRatio,t.scalingRatio),scope:e.scope===`workspace`||e.scope===`external`?e.scope:`all`,strongGravityMode:r.boolean(e.strongGravityMode,t.strongGravityMode)}},component:n(()=>e(()=>import(`./graph-6Vr74V1k.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])),`component`)});export{i as n,a as t};