@karmaniverous/jeeves-server 3.5.1 → 3.6.0

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 (77) hide show
  1. package/.tsbuildinfo +1 -1
  2. package/CHANGELOG.md +32 -1
  3. package/client/package.json +0 -1
  4. package/client/src/components/DirectoryRow.tsx +5 -1
  5. package/client/src/components/FileContentView.tsx +7 -0
  6. package/client/src/components/MarkdownView.tsx +63 -22
  7. package/client/src/components/TocSection.tsx +74 -0
  8. package/client/src/components/renderableUtils.ts +2 -2
  9. package/client/src/components/tocUtils.ts +65 -0
  10. package/client/src/index.css +36 -0
  11. package/client/src/lib/api.ts +2 -1
  12. package/dist/client/assets/{CodeViewer-Cegj3cEn.js → CodeViewer-D5fJ1Z6_.js} +1 -1
  13. package/dist/client/assets/{index-DrBXupPz.js → index-BXy6kgl7.js} +2 -2
  14. package/dist/client/assets/index-Ch0vkF39.css +2 -0
  15. package/dist/client/index.html +2 -2
  16. package/dist/src/cli/index.js +4 -1
  17. package/dist/src/cli/start-server.js +12 -2
  18. package/dist/src/config/index.js +16 -2
  19. package/dist/src/config/loadConfig.test.js +66 -1
  20. package/dist/src/config/resolve.js +0 -4
  21. package/dist/src/config/resolve.test.js +0 -2
  22. package/dist/src/config/schema.js +7 -21
  23. package/dist/src/config/substituteEnvVars.js +2 -0
  24. package/dist/src/descriptor.js +9 -2
  25. package/dist/src/routes/api/auth-status.js +1 -1
  26. package/dist/src/routes/api/directory.js +46 -24
  27. package/dist/src/routes/api/directory.test.js +65 -0
  28. package/dist/src/routes/api/export.js +5 -1
  29. package/dist/src/routes/api/export.test.js +46 -0
  30. package/dist/src/routes/api/fileContent.js +26 -4
  31. package/dist/src/routes/api/runner.js +2 -3
  32. package/dist/src/routes/api/runner.test.js +29 -0
  33. package/dist/src/routes/api/search.js +4 -9
  34. package/dist/src/routes/api/search.test.js +28 -0
  35. package/dist/src/routes/config.test.js +0 -1
  36. package/dist/src/routes/status.js +4 -4
  37. package/dist/src/routes/status.test.js +10 -4
  38. package/dist/src/server.js +4 -2
  39. package/dist/src/services/csv.js +114 -0
  40. package/dist/src/services/csv.test.js +107 -0
  41. package/dist/src/services/markdown.js +21 -1
  42. package/dist/src/services/markdown.test.js +43 -0
  43. package/dist/src/util/packageVersion.js +3 -13
  44. package/guides/deployment.md +1 -1
  45. package/guides/setup.md +14 -10
  46. package/knip.json +2 -1
  47. package/package.json +5 -4
  48. package/src/cli/index.ts +8 -2
  49. package/src/cli/start-server.ts +17 -3
  50. package/src/config/index.ts +22 -2
  51. package/src/config/loadConfig.test.ts +77 -1
  52. package/src/config/resolve.test.ts +0 -2
  53. package/src/config/resolve.ts +0 -4
  54. package/src/config/schema.ts +8 -21
  55. package/src/config/substituteEnvVars.ts +2 -0
  56. package/src/config/types.ts +0 -4
  57. package/src/descriptor.ts +9 -1
  58. package/src/routes/api/auth-status.ts +1 -1
  59. package/src/routes/api/directory.test.ts +77 -0
  60. package/src/routes/api/directory.ts +59 -22
  61. package/src/routes/api/export.test.ts +56 -0
  62. package/src/routes/api/export.ts +5 -1
  63. package/src/routes/api/fileContent.ts +27 -3
  64. package/src/routes/api/runner.test.ts +39 -0
  65. package/src/routes/api/runner.ts +2 -5
  66. package/src/routes/api/search.test.ts +36 -0
  67. package/src/routes/api/search.ts +4 -9
  68. package/src/routes/config.test.ts +0 -1
  69. package/src/routes/status.test.ts +13 -4
  70. package/src/routes/status.ts +4 -4
  71. package/src/server.ts +4 -2
  72. package/src/services/csv.test.ts +127 -0
  73. package/src/services/csv.ts +115 -0
  74. package/src/services/markdown.test.ts +54 -0
  75. package/src/services/markdown.ts +21 -1
  76. package/src/util/packageVersion.ts +3 -18
  77. package/dist/client/assets/index-Dk_myGs4.css +0 -2
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeEditor-Brh86AGF.js","assets/theme-CPpIxvB0.js","assets/CodeViewer-Cegj3cEn.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeEditor-Brh86AGF.js","assets/theme-CPpIxvB0.js","assets/CodeViewer-D5fJ1Z6_.js"])))=>i.map(i=>d[i]);
2
2
  import{a as e,i as t,l as n,n as r,o as i,r as a,s as o,t as s}from"./theme-CPpIxvB0.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var c=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function ee(){return g?!0:!(e.unstable_now()-T<w)}function E(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ee());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(E)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,k=O.port2;O.port1.onmessage=E,D=function(){k.postMessage(null)}}else D=function(){_(E,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),l=o(((e,t)=>{t.exports=c()})),u=o((e=>{var t=i();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.4`})),d=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=u()})),f=o((e=>{var t=l(),n=i(),r=d();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(s(e)!==e)throw Error(a(188))}function p(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return f(i),e;if(o===r)return f(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),A=Symbol.iterator;function j(e){return typeof e!=`object`||!e?null:(e=A&&e[A]||e[`@@iterator`],typeof e==`function`?e:null)}var te=Symbol.for(`react.client.reference`);function ne(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case ee:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?ne(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return ne(e(t))}catch{}}return null}var re=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},ae=[],oe=-1;function P(e){return{current:e}}function F(e){0>oe||(e.current=ae[oe],ae[oe]=null,oe--)}function I(e,t){oe++,ae[oe]=e.current,e.current=t}var se=P(null),ce=P(null),le=P(null),ue=P(null);function de(e,t){switch(I(le,t),I(ce,e),I(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}F(se),I(se,e)}function fe(){F(se),F(ce),F(le)}function pe(e){e.memoizedState!==null&&I(ue,e);var t=se.current,n=Hd(t,e.type);t!==n&&(I(ce,e),I(se,n))}function me(e){ce.current===e&&(F(se),F(ce)),ue.current===e&&(F(ue),Qf._currentValue=ie)}var he,ge;function _e(e){if(he===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);he=t&&t[1]||``,ge=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+he+e+ge}var ve=!1;function ye(e,t){if(!e||ve)return``;ve=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
@@ -59,4 +59,4 @@ You can add a description to the \`${Do}\` by passing a \`${Po}\` component as a
59
59
 
60
60
  Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Do}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
61
61
 
62
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return m.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},Vo=bo,Ho=wo,Uo=Eo,Wo=jo,Go=Lo,Ko=zo,qo=No,Jo=Fo;function Yo(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Yo(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Xo(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Yo(e))&&(r&&(r+=` `),r+=t);return r}var Zo=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Qo=(e,t)=>({classGroupId:e,validator:t}),$o=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),es=`-`,ts=[],ns=`arbitrary..`,rs=e=>{let t=os(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return as(e);let n=e.split(es);return is(n,n[0]===``&&n.length>1?1:0,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Zo(i,t):t:i||ts}return n[e]||ts}}},is=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=is(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(es):e.slice(t).join(es),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},as=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?ns+r:void 0})(),os=e=>{let{theme:t,classGroups:n}=e;return ss(n,t)},ss=(e,t)=>{let n=$o();for(let r in e){let i=e[r];cs(i,n,r,t)}return n},cs=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];ls(i,t,n,r)}},ls=(e,t,n,r)=>{if(typeof e==`string`){us(e,t,n);return}if(typeof e==`function`){ds(e,t,n,r);return}fs(e,t,n,r)},us=(e,t,n)=>{let r=e===``?t:ps(t,e);r.classGroupId=n},ds=(e,t,n,r)=>{if(ms(e)){cs(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Qo(n,e))},fs=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];cs(o,ps(t,a),n,r)}},ps=(e,t)=>{let n=e,r=t.split(es),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=$o(),n.nextPart.set(t,i)),n=i}return n},ms=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,hs=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},gs=`!`,_s=`:`,vs=[],ys=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),bs=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===_s){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(gs)?(c=s.slice(0,-1),l=!0):s.startsWith(gs)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return ys(t,l,c,u)};if(t){let e=t+_s,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):ys(vs,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},xs=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Ss=e=>({cache:hs(e.cacheSize),parseClassName:bs(e),sortModifiers:xs(e),...rs(e)}),Cs=/\s+/,ws=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(Cs),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+gs:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},Ts=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Es(n))&&(i&&(i+=` `),i+=r);return i},Es=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Es(e[r]))&&(n&&(n+=` `),n+=t);return n},Ds=(e,...t)=>{let n,r,i,a,o=o=>(n=Ss(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=ws(e,n);return i(e,a),a};return a=o,(...e)=>a(Ts(...e))},Os=[],ks=e=>{let t=t=>t[e]||Os;return t.isThemeGetter=!0,t},As=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,js=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ms=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ns=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ps=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Fs=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Is=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ls=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rs=e=>Ms.test(e),H=e=>!!e&&!Number.isNaN(Number(e)),zs=e=>!!e&&Number.isInteger(Number(e)),Bs=e=>e.endsWith(`%`)&&H(e.slice(0,-1)),Vs=e=>Ns.test(e),Hs=()=>!0,Us=e=>Ps.test(e)&&!Fs.test(e),Ws=()=>!1,Gs=e=>Is.test(e),Ks=e=>Ls.test(e),qs=e=>!U(e)&&!W(e),Js=e=>lc(e,pc,Ws),U=e=>As.test(e),Ys=e=>lc(e,mc,Us),Xs=e=>lc(e,hc,H),Zs=e=>lc(e,_c,Hs),Qs=e=>lc(e,gc,Ws),$s=e=>lc(e,dc,Ws),ec=e=>lc(e,fc,Ks),tc=e=>lc(e,vc,Gs),W=e=>js.test(e),nc=e=>uc(e,mc),rc=e=>uc(e,gc),ic=e=>uc(e,dc),ac=e=>uc(e,pc),oc=e=>uc(e,fc),sc=e=>uc(e,vc,!0),cc=e=>uc(e,_c,!0),lc=(e,t,n)=>{let r=As.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},uc=(e,t,n=!1)=>{let r=js.exec(e);return r?r[1]?t(r[1]):n:!1},dc=e=>e===`position`||e===`percentage`,fc=e=>e===`image`||e===`url`,pc=e=>e===`length`||e===`size`||e===`bg-size`,mc=e=>e===`length`,hc=e=>e===`number`,gc=e=>e===`family-name`,_c=e=>e===`number`||e===`weight`,vc=e=>e===`shadow`,yc=Ds(()=>{let e=ks(`color`),t=ks(`font`),n=ks(`text`),r=ks(`font-weight`),i=ks(`tracking`),a=ks(`leading`),o=ks(`breakpoint`),s=ks(`container`),c=ks(`spacing`),l=ks(`radius`),u=ks(`shadow`),d=ks(`inset-shadow`),f=ks(`text-shadow`),p=ks(`drop-shadow`),m=ks(`blur`),h=ks(`perspective`),g=ks(`aspect`),_=ks(`ease`),v=ks(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),W,U],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[W,U,c],T=()=>[Rs,`full`,`auto`,...w()],ee=()=>[zs,`none`,`subgrid`,W,U],E=()=>[`auto`,{span:[`full`,zs,W,U]},zs,W,U],D=()=>[zs,`auto`,W,U],O=()=>[`auto`,`min`,`max`,`fr`,W,U],k=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],A=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],j=()=>[`auto`,...w()],te=()=>[Rs,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ne=()=>[Rs,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],re=()=>[Rs,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],M=()=>[e,W,U],N=()=>[...b(),ic,$s,{position:[W,U]}],ie=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ae=()=>[`auto`,`cover`,`contain`,ac,Js,{size:[W,U]}],oe=()=>[Bs,nc,Ys],P=()=>[``,`none`,`full`,l,W,U],F=()=>[``,H,nc,Ys],I=()=>[`solid`,`dashed`,`dotted`,`double`],se=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ce=()=>[H,Bs,ic,$s],le=()=>[``,`none`,m,W,U],ue=()=>[`none`,H,W,U],de=()=>[`none`,H,W,U],fe=()=>[H,W,U],pe=()=>[Rs,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Vs],breakpoint:[Vs],color:[Hs],container:[Vs],"drop-shadow":[Vs],ease:[`in`,`out`,`in-out`],font:[qs],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Vs],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Vs],shadow:[Vs],spacing:[`px`,H],text:[Vs],"text-shadow":[Vs],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Rs,U,W,g]}],container:[`container`],columns:[{columns:[H,U,W,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[zs,`auto`,W,U]}],basis:[{basis:[Rs,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[H,Rs,`auto`,`initial`,`none`,U]}],grow:[{grow:[``,H,W,U]}],shrink:[{shrink:[``,H,W,U]}],order:[{order:[zs,`first`,`last`,`none`,W,U]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...k(),`normal`]}],"justify-items":[{"justify-items":[...A(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...A()]}],"align-content":[{content:[`normal`,...k()]}],"align-items":[{items:[...A(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...A(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...A(),`baseline`]}],"place-self":[{"place-self":[`auto`,...A()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:te()}],"inline-size":[{inline:[`auto`,...ne()]}],"min-inline-size":[{"min-inline":[`auto`,...ne()]}],"max-inline-size":[{"max-inline":[`none`,...ne()]}],"block-size":[{block:[`auto`,...re()]}],"min-block-size":[{"min-block":[`auto`,...re()]}],"max-block-size":[{"max-block":[`none`,...re()]}],w:[{w:[s,`screen`,...te()]}],"min-w":[{"min-w":[s,`screen`,`none`,...te()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...te()]}],h:[{h:[`screen`,`lh`,...te()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...te()]}],"max-h":[{"max-h":[`screen`,`lh`,...te()]}],"font-size":[{text:[`base`,n,nc,Ys]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,cc,Zs]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Bs,U]}],"font-family":[{font:[rc,Qs,t]}],"font-features":[{"font-features":[U]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,W,U]}],"line-clamp":[{"line-clamp":[H,`none`,W,Xs]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,W,U]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,W,U]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...I(),`wavy`]}],"text-decoration-thickness":[{decoration:[H,`from-font`,`auto`,W,Ys]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[H,`auto`,W,U]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,W,U]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,W,U]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},zs,W,U],radial:[``,W,U],conic:[zs,W,U]},oc,ec]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-bs":[{"border-bs":F()}],"border-w-be":[{"border-be":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":F()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...I(),`hidden`,`none`]}],"divide-style":[{divide:[...I(),`hidden`,`none`]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...I(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[H,W,U]}],"outline-w":[{outline:[``,H,nc,Ys]}],"outline-color":[{outline:M()}],shadow:[{shadow:[``,`none`,u,sc,tc]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":[`none`,d,sc,tc]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:F()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[H,Ys]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":[`none`,f,sc,tc]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[H,W,U]}],"mix-blend":[{"mix-blend":[...se(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[H]}],"mask-image-linear-from-pos":[{"mask-linear-from":ce()}],"mask-image-linear-to-pos":[{"mask-linear-to":ce()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":ce()}],"mask-image-t-to-pos":[{"mask-t-to":ce()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":ce()}],"mask-image-r-to-pos":[{"mask-r-to":ce()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":ce()}],"mask-image-b-to-pos":[{"mask-b-to":ce()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":ce()}],"mask-image-l-to-pos":[{"mask-l-to":ce()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":ce()}],"mask-image-x-to-pos":[{"mask-x-to":ce()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":ce()}],"mask-image-y-to-pos":[{"mask-y-to":ce()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[W,U]}],"mask-image-radial-from-pos":[{"mask-radial-from":ce()}],"mask-image-radial-to-pos":[{"mask-radial-to":ce()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[H]}],"mask-image-conic-from-pos":[{"mask-conic-from":ce()}],"mask-image-conic-to-pos":[{"mask-conic-to":ce()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,W,U]}],filter:[{filter:[``,`none`,W,U]}],blur:[{blur:le()}],brightness:[{brightness:[H,W,U]}],contrast:[{contrast:[H,W,U]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,sc,tc]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:[``,H,W,U]}],"hue-rotate":[{"hue-rotate":[H,W,U]}],invert:[{invert:[``,H,W,U]}],saturate:[{saturate:[H,W,U]}],sepia:[{sepia:[``,H,W,U]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,W,U]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[H,W,U]}],"backdrop-contrast":[{"backdrop-contrast":[H,W,U]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,H,W,U]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[H,W,U]}],"backdrop-invert":[{"backdrop-invert":[``,H,W,U]}],"backdrop-opacity":[{"backdrop-opacity":[H,W,U]}],"backdrop-saturate":[{"backdrop-saturate":[H,W,U]}],"backdrop-sepia":[{"backdrop-sepia":[``,H,W,U]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,W,U]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[H,`initial`,W,U]}],ease:[{ease:[`linear`,`initial`,_,W,U]}],delay:[{delay:[H,W,U]}],animate:[{animate:[`none`,v,W,U]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,W,U]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":[`scale-3d`],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[W,U,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:pe()}],"translate-x":[{"translate-x":pe()}],"translate-y":[{"translate-y":pe()}],"translate-z":[{"translate-z":pe()}],"translate-none":[`translate-none`],accent:[{accent:M()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,W,U]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,W,U]}],fill:[{fill:[`none`,...M()]}],"stroke-w":[{stroke:[H,nc,Ys,Xs]}],stroke:[{stroke:[`none`,...M()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function bc(...e){return yc(Xo(e))}var xc=Vo,Sc=Ho,Cc=m.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Uo,{className:bc(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));Cc.displayName=Uo.displayName;var wc=m.forwardRef(({className:e,...t},n)=>(0,L.jsxs)(Sc,{children:[(0,L.jsx)(Cc,{}),(0,L.jsx)(Wo,{ref:n,className:bc(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...t})]}));wc.displayName=Wo.displayName;var Tc=m.forwardRef(({className:e,...t},n)=>(0,L.jsx)(qo,{ref:n,className:bc(`text-lg font-semibold`,e),...t}));Tc.displayName=qo.displayName;var Ec=m.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Jo,{ref:n,className:bc(`text-sm text-muted-foreground`,e),...t}));Ec.displayName=Jo.displayName;var Dc=m.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Go,{ref:n,className:bc(`inline-flex h-10 items-center justify-center rounded-md bg-destructive px-4 py-2 text-sm font-semibold text-white ring-offset-background transition-colors hover:bg-destructive/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,e),...t}));Dc.displayName=Go.displayName;var Oc=m.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Ko,{ref:n,className:bc(`inline-flex h-10 items-center justify-center rounded-md border border-border bg-background px-4 py-2 text-sm font-semibold ring-offset-background transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,e),...t}));Oc.displayName=Ko.displayName;function kc({open:e,onOpenChange:t,title:n,description:r,confirmLabel:i=`Continue`,onConfirm:a}){return(0,L.jsx)(xc,{open:e,onOpenChange:t,children:(0,L.jsxs)(wc,{children:[(0,L.jsx)(Tc,{children:n}),(0,L.jsx)(Ec,{children:r}),(0,L.jsxs)(`div`,{className:`flex justify-end gap-2 mt-2`,children:[(0,L.jsx)(Oc,{children:`Cancel`}),(0,L.jsx)(Dc,{onClick:a,children:i})]})]})})}var Ac=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),jc=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Mc=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Nc=e=>{let t=Mc(e);return t.charAt(0).toUpperCase()+t.slice(1)},Pc={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Fc=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Ic=(0,m.createContext)({}),Lc=()=>(0,m.useContext)(Ic),Rc=(0,m.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Lc()??{},h=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,m.createElement)(`svg`,{ref:c,...Pc,width:t??l??Pc.width,height:t??l??Pc.height,stroke:e??f,strokeWidth:h,className:Ac(`lucide`,p,i),...!a&&!Fc(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,m.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),G=(e,t)=>{let n=(0,m.forwardRef)(({className:n,...r},i)=>(0,m.createElement)(Rc,{ref:i,iconNode:t,className:Ac(`lucide-${jc(Nc(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Nc(e),n},zc=G(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),Bc=G(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Vc=G(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Hc=G(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),Uc=G(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Wc=G(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),Gc=G(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Kc=G(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),qc=G(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Jc=G(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),Yc=G(`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`}]]),Xc=G(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Zc=G(`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`}]]),Qc=G(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),$c=G(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),el=G(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),tl=G(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),nl=G(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),rl=G(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),il=G(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),al=G(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),ol=G(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),sl=G(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),cl=G(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),ll=G(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),ul=G(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),dl=G(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),fl=G(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),pl=G(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),ml=G(`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`}]]),hl=G(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),gl=G(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),_l=G(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),vl=G(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function yl(e){let t=e+`CollectionProvider`,[n,r]=nr(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=m.useRef(null),a=m.useRef(new Map).current;return(0,L.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=gr(s),l=m.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,L.jsx)(c,{ref:or(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=gr(u),p=m.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=m.useRef(null),s=or(t,o),c=a(u,n);return m.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,L.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function h(t){let n=a(e+`CollectionConsumer`,t);return m.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},h,r]}var bl=m.createContext(void 0);function xl(e){let t=m.useContext(bl);return e||t||`ltr`}var Sl=[`top`,`right`,`bottom`,`left`],Cl=Math.min,wl=Math.max,Tl=Math.round,El=Math.floor,Dl=e=>({x:e,y:e}),Ol={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function kl(e,t,n){return wl(e,Cl(t,n))}function Al(e,t){return typeof e==`function`?e(t):e}function jl(e){return e.split(`-`)[0]}function Ml(e){return e.split(`-`)[1]}function Nl(e){return e===`x`?`y`:`x`}function Pl(e){return e===`y`?`height`:`width`}function Fl(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Il(e){return Nl(Fl(e))}function Ll(e,t,n){n===void 0&&(n=!1);let r=Ml(e),i=Il(e),a=Pl(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Vl(o)),[o,Vl(o)]}function Rl(e){let t=Vl(e);return[K(e),t,K(t)]}function K(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var q=[`left`,`right`],J=[`right`,`left`],Y=[`top`,`bottom`],X=[`bottom`,`top`];function zl(e,t,n){switch(e){case`top`:case`bottom`:return n?t?J:q:t?q:J;case`left`:case`right`:return t?Y:X;default:return[]}}function Bl(e,t,n,r){let i=Ml(e),a=zl(jl(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(K)))),a}function Vl(e){let t=jl(e);return Ol[t]+e.slice(t.length)}function Hl(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ul(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Hl(e)}function Wl(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 Gl(e,t,n){let{reference:r,floating:i}=e,a=Fl(t),o=Il(t),s=Pl(o),c=jl(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(Ml(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 Kl(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}=Al(t,e),p=Ul(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Wl(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=Wl(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 ql=50,Jl=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Kl},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Gl(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<ql&&(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}=Gl(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Yl=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}=Al(e,t)||{};if(l==null)return{};let d=Ul(u),f={x:n,y:r},p=Il(i),m=Pl(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,ee=Cl(d[_],T),E=Cl(d[v],T),D=ee,O=C-h[m]-E,k=C/2-h[m]/2+w,A=kl(D,k,O),j=!c.arrow&&Ml(i)!=null&&k!==A&&a.reference[m]/2-(k<D?ee:E)-h[m]/2<0,te=j?k<D?k-D:k-O:0;return{[p]:f[p]+te,data:{[p]:A,centerOffset:k-A-te,...j&&{alignmentOffset:te}},reset:j}}}),Xl=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}=Al(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=jl(r),_=Fl(o),v=jl(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Vl(o)]:Rl(o)),x=p!==`none`;!d&&x&&b.push(...Bl(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=Ll(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`&&_!==Fl(t))||T.every(e=>Fl(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=Fl(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 Zl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ql(e){return Sl.some(t=>e[t]>=0)}var $l=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Al(e,t);switch(i){case`referenceHidden`:{let e=Zl(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ql(e)}}}case`escaped`:{let e=Zl(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ql(e)}}}default:return{}}}}},eu=new Set([`left`,`top`]);async function tu(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=jl(n),s=Ml(n),c=Fl(n)===`y`,l=eu.has(o)?-1:1,u=a&&c?-1:1,d=Al(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 nu=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 tu(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}}}}},ru=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}=Al(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Fl(jl(i)),p=Nl(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=kl(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=kl(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}}}}}},iu=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}=Al(e,t),u={x:n,y:r},d=Fl(i),f=Nl(d),p=u[f],m=u[d],h=Al(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=eu.has(jl(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}}}},au=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}=Al(e,t),u=await o.detectOverflow(t,l),d=jl(i),f=Ml(i),p=Fl(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=Cl(h-u[g],v),x=Cl(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=wl(u.left,0),t=wl(u.right,0),n=wl(u.top,0),r=wl(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:wl(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:wl(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 ou(){return typeof window<`u`}function su(e){return uu(e)?(e.nodeName||``).toLowerCase():`#document`}function cu(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function lu(e){return((uu(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function uu(e){return ou()?e instanceof Node||e instanceof cu(e).Node:!1}function du(e){return ou()?e instanceof Element||e instanceof cu(e).Element:!1}function fu(e){return ou()?e instanceof HTMLElement||e instanceof cu(e).HTMLElement:!1}function pu(e){return!ou()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof cu(e).ShadowRoot}function mu(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Tu(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function hu(e){return/^(table|td|th)$/.test(su(e))}function gu(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var _u=/transform|translate|scale|rotate|perspective|filter/,vu=/paint|layout|strict|content/,yu=e=>!!e&&e!==`none`,bu;function xu(e){let t=du(e)?Tu(e):e;return yu(t.transform)||yu(t.translate)||yu(t.scale)||yu(t.rotate)||yu(t.perspective)||!Cu()&&(yu(t.backdropFilter)||yu(t.filter))||_u.test(t.willChange||``)||vu.test(t.contain||``)}function Su(e){let t=Du(e);for(;fu(t)&&!wu(t);){if(xu(t))return t;if(gu(t))return null;t=Du(t)}return null}function Cu(){return bu??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),bu}function wu(e){return/^(html|body|#document)$/.test(su(e))}function Tu(e){return cu(e).getComputedStyle(e)}function Eu(e){return du(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Du(e){if(su(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||pu(e)&&e.host||lu(e);return pu(t)?t.host:t}function Ou(e){let t=Du(e);return wu(t)?e.ownerDocument?e.ownerDocument.body:e.body:fu(t)&&mu(t)?t:Ou(t)}function ku(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ou(e),i=r===e.ownerDocument?.body,a=cu(r);if(i){let e=Au(a);return t.concat(a,a.visualViewport||[],mu(r)?r:[],e&&n?ku(e):[])}else return t.concat(r,ku(r,[],n))}function Au(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ju(e){let t=Tu(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=fu(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Tl(n)!==a||Tl(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Mu(e){return du(e)?e:e.contextElement}function Nu(e){let t=Mu(e);if(!fu(t))return Dl(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ju(t),o=(a?Tl(n.width):n.width)/r,s=(a?Tl(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Pu=Dl(0);function Fu(e){let t=cu(e);return!Cu()||!t.visualViewport?Pu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Iu(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==cu(e)?!1:t}function Lu(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Mu(e),o=Dl(1);t&&(r?du(r)&&(o=Nu(r)):o=Nu(e));let s=Iu(a,n,r)?Fu(a):Dl(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=cu(a),t=r&&du(r)?cu(r):r,n=e,i=Au(n);for(;i&&r&&t!==n;){let e=Nu(i),t=i.getBoundingClientRect(),r=Tu(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=cu(i),i=Au(n)}}return Wl({width:u,height:d,x:c,y:l})}function Ru(e,t){let n=Eu(e).scrollLeft;return t?t.left+n:Lu(lu(e)).left+n}function zu(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ru(e,n),y:n.top+t.scrollTop}}function Bu(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=lu(r),s=t?gu(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Dl(1),u=Dl(0),d=fu(r);if((d||!d&&!a)&&((su(r)!==`body`||mu(o))&&(c=Eu(r)),d)){let e=Lu(r);l=Nu(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?zu(o,c):Dl(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 Vu(e){return Array.from(e.getClientRects())}function Hu(e){let t=lu(e),n=Eu(e),r=e.ownerDocument.body,i=wl(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=wl(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Ru(e),s=-n.scrollTop;return Tu(r).direction===`rtl`&&(o+=wl(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Uu=25;function Wu(e,t){let n=cu(e),r=lu(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Cu();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Ru(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<=Uu&&(a-=o)}else l<=Uu&&(a+=l);return{width:a,height:o,x:s,y:c}}function Z(e,t){let n=Lu(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=fu(e)?Nu(e):Dl(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Gu(e,t,n){let r;if(t===`viewport`)r=Wu(e,n);else if(t===`document`)r=Hu(lu(e));else if(du(t))r=Z(t,n);else{let n=Fu(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Wl(r)}function Ku(e,t){let n=Du(e);return n===t||!du(n)||wu(n)?!1:Tu(n).position===`fixed`||Ku(n,t)}function qu(e,t){let n=t.get(e);if(n)return n;let r=ku(e,[],!1).filter(e=>du(e)&&su(e)!==`body`),i=null,a=Tu(e).position===`fixed`,o=a?Du(e):e;for(;du(o)&&!wu(o);){let t=Tu(o),n=xu(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||mu(o)&&!n&&Ku(e,o))?r=r.filter(e=>e!==o):i=t,o=Du(o)}return t.set(e,r),r}function Ju(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?gu(t)?[]:qu(t,this._c):[].concat(n),r],o=Gu(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=Gu(t,a[e],i);s=wl(n.top,s),c=Cl(n.right,c),l=Cl(n.bottom,l),u=wl(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Yu(e){let{width:t,height:n}=ju(e);return{width:t,height:n}}function Xu(e,t,n){let r=fu(t),i=lu(t),a=n===`fixed`,o=Lu(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Dl(0);function l(){c.x=Ru(i)}if(r||!r&&!a)if((su(t)!==`body`||mu(i))&&(s=Eu(t)),r){let e=Lu(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?zu(i,s):Dl(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 Zu(e){return Tu(e).position===`static`}function Qu(e,t){if(!fu(e)||Tu(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return lu(e)===n&&(n=n.ownerDocument.body),n}function $u(e,t){let n=cu(e);if(gu(e))return n;if(!fu(e)){let t=Du(e);for(;t&&!wu(t);){if(du(t)&&!Zu(t))return t;t=Du(t)}return n}let r=Qu(e,t);for(;r&&hu(r)&&Zu(r);)r=Qu(r,t);return r&&wu(r)&&Zu(r)&&!xu(r)?n:r||Su(e)||n}var ed=async function(e){let t=this.getOffsetParent||$u,n=this.getDimensions,r=await n(e.floating);return{reference:Xu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function td(e){return Tu(e).direction===`rtl`}var nd={convertOffsetParentRelativeRectToViewportRelativeRect:Bu,getDocumentElement:lu,getClippingRect:Ju,getOffsetParent:$u,getElementRects:ed,getClientRects:Vu,getDimensions:Yu,getScale:Nu,isElement:du,isRTL:td};function rd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function id(e,t){let n=null,r,i=lu(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=El(d),h=El(i.clientWidth-(u+f)),g=El(i.clientHeight-(d+p)),_=El(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:wl(0,Cl(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&&!rd(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 ad(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=Mu(e),u=i||a?[...l?ku(l):[],...t?ku(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?id(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?Lu(e):null;c&&g();function g(){let t=Lu(e);h&&!rd(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 od=nu,sd=ru,cd=Xl,ld=au,ud=$l,dd=Yl,fd=iu,pd=(e,t,n)=>{let r=new Map,i={platform:nd,...n},a={...i.platform,_c:r};return Jl(e,t,{...i,platform:a})},md=typeof document<`u`?m.useLayoutEffect:function(){};function hd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!hd(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!hd(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function gd(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _d(e,t){let n=gd(e);return Math.round(t*n)/n}function vd(e){let t=m.useRef(e);return md(()=>{t.current=e}),t}function yd(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(r);hd(f,r)||p(r);let[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=m.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=m.useRef(null),w=m.useRef(null),T=m.useRef(u),ee=c!=null,E=vd(c),D=vd(i),O=vd(l),k=m.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),pd(C.current,w.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!hd(T.current,t)&&(T.current=t,hr.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);md(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=m.useRef(!1);md(()=>(A.current=!0,()=>{A.current=!1}),[]),md(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(E.current)return E.current(x,S,k);k()}},[x,S,k,E,ee]);let j=m.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),te=m.useMemo(()=>({reference:x,floating:S}),[x,S]),ne=m.useMemo(()=>{let e={position:n,left:0,top:0};if(!te.floating)return e;let t=_d(te.floating,u.x),r=_d(te.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...gd(te.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,te.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:k,refs:j,elements:te,floatingStyles:ne}),[u,k,j,te,ne])}var Q=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:dd({element:r.current,padding:i}).fn(n):r?dd({element:r,padding:i}).fn(n):{}}}},bd=(e,t)=>{let n=od(e);return{name:n.name,fn:n.fn,options:[e,t]}},xd=(e,t)=>{let n=sd(e);return{name:n.name,fn:n.fn,options:[e,t]}},Sd=(e,t)=>({fn:fd(e).fn,options:[e,t]}),Cd=(e,t)=>{let n=cd(e);return{name:n.name,fn:n.fn,options:[e,t]}},wd=(e,t)=>{let n=ld(e);return{name:n.name,fn:n.fn,options:[e,t]}},Td=(e,t)=>{let n=ud(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ed=(e,t)=>{let n=Q(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dd=`Arrow`,Od=m.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,L.jsx)(Cr.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,L.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Od.displayName=Dd;var kd=Od;function Ad(e){let[t,n]=m.useState(void 0);return sr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var jd=`Popper`,[Md,$]=nr(jd),[Nd,Pd]=Md(jd),Fd=e=>{let{__scopePopper:t,children:n}=e,[r,i]=m.useState(null);return(0,L.jsx)(Nd,{scope:t,anchor:r,onAnchorChange:i,children:n})};Fd.displayName=jd;var Id=`PopperAnchor`,Ld=m.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Pd(Id,n),o=m.useRef(null),s=or(t,o),c=m.useRef(null);return m.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,L.jsx)(Cr.div,{...i,ref:s})});Ld.displayName=Id;var Rd=`PopperContent`,[zd,Bd]=Md(Rd),Vd=m.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:h,...g}=e,_=Pd(Rd,n),[v,y]=m.useState(null),b=or(t,e=>y(e)),[x,S]=m.useState(null),C=Ad(x),w=C?.width??0,T=C?.height??0,ee=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(Gd),altBoundary:O},{refs:A,floatingStyles:j,placement:te,isPositioned:ne,middlewareData:re}=yd({strategy:`fixed`,placement:ee,whileElementsMounted:(...e)=>ad(...e,{animationFrame:p===`always`}),elements:{reference:_.anchor},middleware:[bd({mainAxis:i+T,alignmentAxis:o}),c&&xd({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Sd():void 0,...k}),c&&Cd({...k}),wd({...k,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&Ed({element:x,padding:s}),Kd({arrowWidth:w,arrowHeight:T}),f&&Td({strategy:`referenceHidden`,...k})]}),[M,N]=qd(te),ie=Tr(h);sr(()=>{ne&&ie?.()},[ne,ie]);let ae=re.arrow?.x,oe=re.arrow?.y,P=re.arrow?.centerOffset!==0,[F,I]=m.useState();return sr(()=>{v&&I(window.getComputedStyle(v).zIndex)},[v]),(0,L.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:ne?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:F,"--radix-popper-transform-origin":[re.transformOrigin?.x,re.transformOrigin?.y].join(` `),...re.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,L.jsx)(zd,{scope:n,placedSide:M,onArrowChange:S,arrowX:ae,arrowY:oe,shouldHideArrow:P,children:(0,L.jsx)(Cr.div,{"data-side":M,"data-align":N,...g,ref:b,style:{...g.style,animation:ne?void 0:`none`}})})})});Vd.displayName=Rd;var Hd=`PopperArrow`,Ud={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Wd=m.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Bd(Hd,n),a=Ud[i.placedSide];return(0,L.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,L.jsx)(kd,{...r,ref:t,style:{...r.style,display:`block`}})})});Wd.displayName=Hd;function Gd(e){return e!==null}var Kd=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=qd(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function qd(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Jd=Fd,Yd=Ld,Xd=Vd,Zd=Wd,Qd=`rovingFocusGroup.onEntryFocus`,$d={bubbles:!1,cancelable:!0},ef=`RovingFocusGroup`,[tf,nf,rf]=yl(ef),[af,of]=nr(ef,[rf]),[sf,cf]=af(ef),lf=m.forwardRef((e,t)=>(0,L.jsx)(tf.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(tf.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(uf,{...e,ref:t})})}));lf.displayName=ef;var uf=m.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=m.useRef(null),p=or(t,f),h=xl(a),[g,_]=fr({prop:o,defaultProp:s??null,onChange:c,caller:ef}),[v,y]=m.useState(!1),b=Tr(l),x=nf(n),S=m.useRef(!1),[C,w]=m.useState(0);return m.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Qd,b),()=>e.removeEventListener(Qd,b)},[b]),(0,L.jsx)(sf,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:m.useCallback(e=>_(e),[_]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:m.useCallback(()=>w(e=>e-1),[]),children:(0,L.jsx)(Cr.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:R(e.onMouseDown,()=>{S.current=!0}),onFocus:R(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(Qd,$d);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);gf([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:R(e.onBlur,()=>y(!1))})})}),df=`RovingFocusGroupItem`,ff=m.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=ur(),l=a||c,u=cf(df,n),d=u.currentTabStopId===l,f=nf(n),{onFocusableItemAdd:p,onFocusableItemRemove:h,currentTabStopId:g}=u;return m.useEffect(()=>{if(r)return p(),()=>h()},[r,p,h]),(0,L.jsx)(tf.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,L.jsx)(Cr.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:R(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:R(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:R(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=hf(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?_f(n,r+1):n.slice(r+1)}setTimeout(()=>gf(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:g!=null}):o})})});ff.displayName=df;var pf={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function mf(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function hf(e,t,n){let r=mf(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return pf[r]}function gf(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function _f(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var vf=lf,yf=ff,bf=[`Enter`,` `],xf=[`ArrowDown`,`PageUp`,`Home`],Sf=[`ArrowUp`,`PageDown`,`End`],Cf=[...xf,...Sf],wf={ltr:[...bf,`ArrowRight`],rtl:[...bf,`ArrowLeft`]},Tf={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Ef=`Menu`,[Df,Of,kf]=yl(Ef),[Af,jf]=nr(Ef,[kf,$,of]),Mf=$(),Nf=of(),[Pf,Ff]=Af(Ef),[If,Lf]=Af(Ef),Rf=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Mf(t),[c,l]=m.useState(null),u=m.useRef(!1),d=Tr(a),f=xl(i);return m.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,L.jsx)(Jd,{...s,children:(0,L.jsx)(Pf,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,L.jsx)(If,{scope:t,onClose:m.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Rf.displayName=Ef;var zf=`MenuAnchor`,Bf=m.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Mf(n);return(0,L.jsx)(Yd,{...i,...r,ref:t})});Bf.displayName=zf;var Vf=`MenuPortal`,[Hf,Uf]=Af(Vf,{forceMount:void 0}),Wf=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Ff(Vf,t);return(0,L.jsx)(Hf,{scope:t,forceMount:n,children:(0,L.jsx)(ai,{present:n||a.open,children:(0,L.jsx)(ri,{asChild:!0,container:i,children:r})})})};Wf.displayName=Vf;var Gf=`MenuContent`,[Kf,qf]=Af(Gf),Jf=m.forwardRef((e,t)=>{let n=Uf(Gf,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ff(Gf,e.__scopeMenu),o=Lf(Gf,e.__scopeMenu);return(0,L.jsx)(Df.Provider,{scope:e.__scopeMenu,children:(0,L.jsx)(ai,{present:r||a.open,children:(0,L.jsx)(Df.Slot,{scope:e.__scopeMenu,children:o.modal?(0,L.jsx)(Yf,{...i,ref:t}):(0,L.jsx)(Xf,{...i,ref:t})})})})}),Yf=m.forwardRef((e,t)=>{let n=Ff(Gf,e.__scopeMenu),r=m.useRef(null),i=or(t,r);return m.useEffect(()=>{let e=r.current;if(e)return Oa(e)},[]),(0,L.jsx)(Qf,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:R(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Xf=m.forwardRef((e,t)=>{let n=Ff(Gf,e.__scopeMenu);return(0,L.jsx)(Qf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Zf=gr(`MenuContent.ScrollLock`),Qf=m.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:h,...g}=e,_=Ff(Gf,n),v=Lf(Gf,n),y=Mf(n),b=Nf(n),x=Of(n),[S,C]=m.useState(null),w=m.useRef(null),T=or(t,w,_.onContentChange),ee=m.useRef(0),E=m.useRef(``),D=m.useRef(0),O=m.useRef(null),k=m.useRef(`right`),A=m.useRef(0),j=h?ya:m.Fragment,te=h?{as:Zf,allowPinchZoom:!0}:void 0,ne=e=>{let t=E.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Ip(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(ee.current),t!==``&&(ee.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};m.useEffect(()=>()=>window.clearTimeout(ee.current),[]),ui();let re=m.useCallback(e=>k.current===O.current?.side&&Rp(e,O.current?.area),[]);return(0,L.jsx)(Kf,{scope:n,searchRef:E,onItemEnter:m.useCallback(e=>{re(e)&&e.preventDefault()},[re]),onItemLeave:m.useCallback(e=>{re(e)||(w.current?.focus(),C(null))},[re]),onTriggerLeave:m.useCallback(e=>{re(e)&&e.preventDefault()},[re]),pointerGraceTimerRef:D,onPointerGraceIntentChange:m.useCallback(e=>{O.current=e},[]),children:(0,L.jsx)(j,{...te,children:(0,L.jsx)(Wr,{asChild:!0,trapped:i,onMountAutoFocus:R(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,L.jsx)(Nr,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,L.jsx)(vf,{asChild:!0,...b,dir:v.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:R(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,L.jsx)(Xd,{role:`menu`,"aria-orientation":`vertical`,"data-state":jp(_.open),"data-radix-menu-content":``,dir:v.dir,...y,...g,ref:T,style:{outline:`none`,...g.style},onKeyDown:R(g.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ne(e.key));let i=w.current;if(e.target!==i||!Cf.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);Sf.includes(e.key)&&a.reverse(),Pp(a)}),onBlur:R(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(ee.current),E.current=``)}),onPointerMove:R(e.onPointerMove,zp(e=>{let t=e.target,n=A.current!==e.clientX;e.currentTarget.contains(t)&&n&&(k.current=e.clientX>A.current?`right`:`left`,A.current=e.clientX)}))})})})})})})});Jf.displayName=Gf;var $f=`MenuGroup`,ep=m.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,L.jsx)(Cr.div,{role:`group`,...r,ref:t})});ep.displayName=$f;var tp=`MenuLabel`,np=m.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,L.jsx)(Cr.div,{...r,ref:t})});np.displayName=tp;var rp=`MenuItem`,ip=`menu.itemSelect`,ap=m.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=m.useRef(null),o=Lf(rp,e.__scopeMenu),s=qf(rp,e.__scopeMenu),c=or(t,a),l=m.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(ip,{bubbles:!0,cancelable:!0});e.addEventListener(ip,e=>r?.(e),{once:!0}),wr(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,L.jsx)(op,{...i,ref:c,disabled:n,onClick:R(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:R(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:R(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||bf.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});ap.displayName=rp;var op=m.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=qf(rp,n),s=Nf(n),c=m.useRef(null),l=or(t,c),[u,d]=m.useState(!1),[f,p]=m.useState(``);return m.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,L.jsx)(Df.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,L.jsx)(yf,{asChild:!0,...s,focusable:!r,children:(0,L.jsx)(Cr.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:R(e.onPointerMove,zp(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:R(e.onPointerLeave,zp(e=>o.onItemLeave(e))),onFocus:R(e.onFocus,()=>d(!0)),onBlur:R(e.onBlur,()=>d(!1))})})})}),sp=`MenuCheckboxItem`,cp=m.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,L.jsx)(gp,{scope:e.__scopeMenu,checked:n,children:(0,L.jsx)(ap,{role:`menuitemcheckbox`,"aria-checked":Mp(n)?`mixed`:n,...i,ref:t,"data-state":Np(n),onSelect:R(i.onSelect,()=>r?.(Mp(n)?!0:!n),{checkForDefaultPrevented:!1})})})});cp.displayName=sp;var lp=`MenuRadioGroup`,[up,dp]=Af(lp,{value:void 0,onValueChange:()=>{}}),fp=m.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=Tr(r);return(0,L.jsx)(up,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,L.jsx)(ep,{...i,ref:t})})});fp.displayName=lp;var pp=`MenuRadioItem`,mp=m.forwardRef((e,t)=>{let{value:n,...r}=e,i=dp(pp,e.__scopeMenu),a=n===i.value;return(0,L.jsx)(gp,{scope:e.__scopeMenu,checked:a,children:(0,L.jsx)(ap,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":Np(a),onSelect:R(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});mp.displayName=pp;var hp=`MenuItemIndicator`,[gp,_p]=Af(hp,{checked:!1}),vp=m.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=_p(hp,n);return(0,L.jsx)(ai,{present:r||Mp(a.checked)||a.checked===!0,children:(0,L.jsx)(Cr.span,{...i,ref:t,"data-state":Np(a.checked)})})});vp.displayName=hp;var yp=`MenuSeparator`,bp=m.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,L.jsx)(Cr.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});bp.displayName=yp;var xp=`MenuArrow`,Sp=m.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Mf(n);return(0,L.jsx)(Zd,{...i,...r,ref:t})});Sp.displayName=xp;var Cp=`MenuSub`,[wp,Tp]=Af(Cp),Ep=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Ff(Cp,t),o=Mf(t),[s,c]=m.useState(null),[l,u]=m.useState(null),d=Tr(i);return m.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,L.jsx)(Jd,{...o,children:(0,L.jsx)(Pf,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,L.jsx)(wp,{scope:t,contentId:ur(),triggerId:ur(),trigger:s,onTriggerChange:c,children:n})})})};Ep.displayName=Cp;var Dp=`MenuSubTrigger`,Op=m.forwardRef((e,t)=>{let n=Ff(Dp,e.__scopeMenu),r=Lf(Dp,e.__scopeMenu),i=Tp(Dp,e.__scopeMenu),a=qf(Dp,e.__scopeMenu),o=m.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=m.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return m.useEffect(()=>u,[u]),m.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,L.jsx)(Bf,{asChild:!0,...l,children:(0,L.jsx)(op,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":jp(n.open),...e,ref:ar(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:R(e.onPointerMove,zp(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:R(e.onPointerLeave,zp(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:R(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||wf[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Op.displayName=Dp;var kp=`MenuSubContent`,Ap=m.forwardRef((e,t)=>{let n=Uf(Gf,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ff(Gf,e.__scopeMenu),o=Lf(Gf,e.__scopeMenu),s=Tp(kp,e.__scopeMenu),c=m.useRef(null),l=or(t,c);return(0,L.jsx)(Df.Provider,{scope:e.__scopeMenu,children:(0,L.jsx)(ai,{present:r||a.open,children:(0,L.jsx)(Df.Slot,{scope:e.__scopeMenu,children:(0,L.jsx)(Qf,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:R(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:R(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:R(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Tf[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});Ap.displayName=kp;function jp(e){return e?`open`:`closed`}function Mp(e){return e===`indeterminate`}function Np(e){return Mp(e)?`indeterminate`:e?`checked`:`unchecked`}function Pp(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Fp(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Ip(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Fp(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Lp(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Rp(e,t){return t?Lp({x:e.clientX,y:e.clientY},t):!1}function zp(e){return t=>t.pointerType===`mouse`?e(t):void 0}var Bp=Rf,Vp=Bf,Hp=Wf,Up=Jf,Wp=ep,Gp=np,Kp=ap,qp=cp,Jp=fp,Yp=mp,Xp=vp,Zp=bp,Qp=Sp,$p=Op,em=Ap,tm=`DropdownMenu`,[nm,rm]=nr(tm,[jf]),im=jf(),[am,om]=nm(tm),sm=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=im(t),l=m.useRef(null),[u,d]=fr({prop:i,defaultProp:a??!1,onChange:o,caller:tm});return(0,L.jsx)(am,{scope:t,triggerId:ur(),triggerRef:l,contentId:ur(),open:u,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,L.jsx)(Bp,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};sm.displayName=tm;var cm=`DropdownMenuTrigger`,lm=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=om(cm,n),o=im(n);return(0,L.jsx)(Vp,{asChild:!0,...o,children:(0,L.jsx)(Cr.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:ar(t,a.triggerRef),onPointerDown:R(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:R(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});lm.displayName=cm;var um=`DropdownMenuPortal`,dm=e=>{let{__scopeDropdownMenu:t,...n}=e,r=im(t);return(0,L.jsx)(Hp,{...r,...n})};dm.displayName=um;var fm=`DropdownMenuContent`,pm=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=om(fm,n),a=im(n),o=m.useRef(!1);return(0,L.jsx)(Up,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:R(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:R(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});pm.displayName=fm;var mm=`DropdownMenuGroup`,hm=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)(Wp,{...i,...r,ref:t})});hm.displayName=mm;var gm=`DropdownMenuLabel`,_m=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)(Gp,{...i,...r,ref:t})});_m.displayName=gm;var vm=`DropdownMenuItem`,ym=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)(Kp,{...i,...r,ref:t})});ym.displayName=vm;var bm=`DropdownMenuCheckboxItem`,xm=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)(qp,{...i,...r,ref:t})});xm.displayName=bm;var Sm=`DropdownMenuRadioGroup`,Cm=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)(Jp,{...i,...r,ref:t})});Cm.displayName=Sm;var wm=`DropdownMenuRadioItem`,Tm=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)(Yp,{...i,...r,ref:t})});Tm.displayName=wm;var Em=`DropdownMenuItemIndicator`,Dm=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)(Xp,{...i,...r,ref:t})});Dm.displayName=Em;var Om=`DropdownMenuSeparator`,km=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)(Zp,{...i,...r,ref:t})});km.displayName=Om;var Am=`DropdownMenuArrow`,jm=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)(Qp,{...i,...r,ref:t})});jm.displayName=Am;var Mm=`DropdownMenuSubTrigger`,Nm=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)($p,{...i,...r,ref:t})});Nm.displayName=Mm;var Pm=`DropdownMenuSubContent`,Fm=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)(em,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Fm.displayName=Pm;var Im=sm,Lm=lm,Rm=dm,zm=pm,Bm=_m,Vm=ym,Hm=km,Um=Im,Wm=Lm,Gm=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,L.jsx)(Rm,{children:(0,L.jsx)(zm,{ref:r,sideOffset:t,className:bc(`z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md`,`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));Gm.displayName=zm.displayName;var Km=m.forwardRef(({className:e,inset:t,...n},r)=>(0,L.jsx)(Vm,{ref:r,className:bc(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t&&`pl-8`,e),...n}));Km.displayName=Vm.displayName;var qm=m.forwardRef(({className:e,inset:t,...n},r)=>(0,L.jsx)(Bm,{ref:r,className:bc(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));qm.displayName=Bm.displayName;var Jm=m.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Hm,{ref:n,className:bc(`-mx-1 my-1 h-px bg-muted`,e),...t}));Jm.displayName=Hm.displayName;var Ym=(0,m.forwardRef)(({className:e,variant:t=`default`,size:n=`default`,...r},i)=>(0,L.jsx)(`button`,{className:bc(`inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`disabled:pointer-events-none disabled:opacity-50`,{"bg-primary text-primary-foreground hover:bg-primary/90":t===`default`,"border border-border bg-background hover:bg-accent hover:text-accent-foreground":t===`outline`,"hover:bg-accent hover:text-accent-foreground":t===`ghost`,"text-primary underline-offset-4 hover:underline":t===`link`},{"h-10 px-4 py-2":n===`default`,"h-9 rounded-md px-3":n===`sm`,"h-11 rounded-md px-8":n===`lg`,"h-10 w-10":n===`icon`},e),ref:i,...r}));Ym.displayName=`Button`;function Xm({icon:e,label:t,title:n,variant:r=`default`,compact:i,state:a,disabled:o,children:s,errorSlot:c,align:l=`end`,contentClass:u,onOpenChange:d}){let f=a??`idle`,p=r===`menuItem`,m=i?`h-3.5 w-3.5`:`h-4 w-4`,h=i?`h-7 w-7`:`h-8 w-8`,g=f===`done`?Gc:f===`error`?vl:f===`loading`?tl:e,_=f===`done`?`text-green-500`:f===`error`?`text-red-500`:``;return(0,L.jsxs)(Um,{onOpenChange:d,children:[(0,L.jsx)(Wm,{asChild:!0,children:p?(0,L.jsxs)(`button`,{className:`flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-accent transition-colors w-full text-left`,disabled:o||f===`loading`,children:[(0,L.jsx)(g,{className:`h-4 w-4 shrink-0 ${_} ${f===`loading`?`animate-spin`:``}`}),t]}):(0,L.jsx)(Ym,{variant:`ghost`,size:`icon`,className:`${h} ${_||(r===`header`?`text-zinc-300 hover:text-white hover:bg-white/10`:`text-muted-foreground hover:text-foreground`)}`,disabled:o||f===`loading`,title:n,children:(0,L.jsx)(g,{className:`${m} ${f===`loading`?`animate-spin`:``}`})})}),(0,L.jsxs)(Gm,{align:l,className:u,children:[c&&(0,L.jsxs)(L.Fragment,{children:[c,(0,L.jsx)(Jm,{})]}),s]})]})}function Zm({message:e}){return e?(0,L.jsx)(`div`,{className:`px-2 py-1.5 text-xs text-red-500 bg-red-500/10 rounded mx-1 mb-1`,children:e}):null}function Qm(e,t){let[n,r]=(0,m.useState)(`idle`),[i,a]=(0,m.useState)(null),o=e=>{r(e),t?.(e)};return{state:n,errorMsg:i,handleAction:async t=>{o(`loading`),a(null);try{await t(),o(`done`),setTimeout(()=>o(`idle`),1500)}catch(t){let n=t instanceof Error?t.message:`Action failed`;a(n),o(`error`),e?.(n)}},resetOnClose:e=>{!e&&n===`error`&&(o(`idle`),a(null))}}}function $m(e,t,n){let r=[];if(n||!t)return r.push({label:`ZIP`,href:`/api/export/${e}?format=zip`,filename:`${e.split(`/`).pop()??`archive`}.zip`}),r;let i=t.fileName.replace(/\.[^.]+$/,``);return r.push({label:`Raw`,href:`/api/raw/${e}`,filename:t.fileName}),(t.type===`markdown`||t.type===`.md`)&&(r.push({label:`PDF`,href:`/api/export/${e}?format=pdf`,filename:`${i}.pdf`}),r.push({label:`DOCX`,href:`/api/export/${e}?format=docx`,filename:`${i}.docx`})),(t.type===`mermaid`||t.type===`.mmd`)&&(r.push({label:`SVG`,href:`/api/mermaid-export/${e}?format=svg`,filename:`${i}.svg`}),r.push({label:`PNG`,href:`/api/mermaid-export/${e}?format=png`,filename:`${i}.png`}),r.push({label:`PDF`,href:`/api/mermaid-export/${e}?format=pdf`,filename:`${i}.pdf`})),(t.type===`plantuml`||[`.puml`,`.plantuml`,`.pu`].includes(t.type))&&(r.push({label:`SVG`,href:`/api/plantuml-export/${e}?format=svg`,filename:`${i}.svg`}),r.push({label:`PNG`,href:`/api/plantuml-export/${e}?format=png`,filename:`${i}.png`}),r.push({label:`PDF`,href:`/api/plantuml-export/${e}?format=pdf`,filename:`${i}.pdf`}),r.push({label:`EPS`,href:`/api/plantuml-export/${e}?format=eps`,filename:`${i}.eps`})),r}async function eh(e,t){let n=await fetch(Rn(e),{credentials:`include`});if(!n.ok){let e=await n.text().catch(()=>``);throw Error(e||`Download failed (${String(n.status)})`)}let r=await n.blob(),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}function th({reqPath:e,file:t,isDirectory:n,isInsider:r,compact:i,variant:a=`default`,onError:o,onStateChange:s}){let{state:c,errorMsg:l,handleAction:u,resetOnClose:d}=Qm(e=>{o?.(e),alert(`Download failed: ${e}`)},s),f=$m(e,t,n);return f.length===0?null:(0,L.jsxs)(Xm,{icon:Jc,label:`Download`,title:`Download`,variant:a,compact:i,state:c,onOpenChange:d,errorSlot:(0,L.jsx)(Zm,{message:l}),children:[f.map(e=>(0,L.jsx)(Km,{onSelect:()=>void u(()=>eh(e.href,e.filename)),className:`cursor-pointer`,children:e.label},e.label)),r&&!n&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Jm,{}),(0,L.jsx)(Km,{onSelect:()=>void u(async()=>{await Zn(e)}),className:`cursor-pointer text-muted-foreground`,children:`Clear Cache`})]})]})}async function nh(e,t,n,r){let i;if(t.expiry){let e=t.expiry.match(/^(\d+)([hdw])$/i);if(e){let t=parseInt(e[1],10),n=e[2].toLowerCase();i=String(Date.now()+t*{h:36e5,d:864e5,w:6048e5}[n])}}let a=!r&&t.depth>0?t.depth:void 0,o=!r&&t.dirs?!0:void 0,s=await qn(e,i,a,o);if(!s.url)throw Error(`No URL returned`);let c=window.location.origin+s.url;if(n===`raw`){let e=new URL(c);e.pathname=e.pathname.replace(`/browse/`,`/api/raw/`),c=e.toString()}else n===`event`&&(c=window.location.origin+`/event?key=`+s.url.split(`key=`)[1]);await navigator.clipboard.writeText(c)}var rh=[{label:`Never`,value:``},{label:`1 hour`,value:`1h`},{label:`24 hours`,value:`24h`},{label:`7 days`,value:`7d`},{label:`30 days`,value:`30d`}];function ih({path:e,shareSettings:t,onShareSettingsChange:n,showEvent:r,showRaw:i,compact:a,isDirectory:o,variant:s=`default`,onError:c,onStateChange:l}){let{state:u,errorMsg:d,handleAction:f,resetOnClose:p}=Qm(c,l),m=[{label:`Page`,type:`page`}];return i&&m.push({label:`Raw`,type:`raw`}),r&&m.push({label:`Event`,type:`event`}),(0,L.jsxs)(Xm,{icon:el,label:`Share`,title:`Copy share link`,variant:s,compact:a,state:u,contentClass:`w-52`,onOpenChange:p,errorSlot:(0,L.jsx)(Zm,{message:d}),children:[m.map(n=>(0,L.jsxs)(Km,{onSelect:()=>void f(()=>nh(e,t,n.type,o)),className:`cursor-pointer`,children:[`Copy `,n.label,` Link`]},n.type)),(0,L.jsx)(Jm,{}),(0,L.jsxs)(`div`,{className:`px-2 py-1 flex items-center justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap`,children:`Expires`}),(0,L.jsx)(`select`,{className:`text-xs bg-popover text-popover-foreground border border-border rounded px-1 py-0.5 focus:outline-none focus:ring-1 focus:ring-ring min-w-0`,value:t.expiry,onChange:e=>n({...t,expiry:e.target.value}),onClick:e=>e.stopPropagation(),children:rh.map(e=>(0,L.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),!o&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`px-2 py-1 flex items-center justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap`,children:`Depth`}),(0,L.jsx)(`input`,{type:`number`,min:0,max:10,className:`text-xs bg-popover text-popover-foreground border border-border rounded px-1 py-0.5 w-14 text-right focus:outline-none focus:ring-1 focus:ring-ring`,value:t.depth,onChange:e=>n({...t,depth:Math.max(0,parseInt(e.target.value,10)||0)}),onClick:e=>e.stopPropagation()})]}),(0,L.jsxs)(`div`,{className:`px-2 py-1 flex items-center justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap`,children:`Directories`}),(0,L.jsx)(`input`,{type:`checkbox`,className:`rounded border-border`,checked:t.dirs,onChange:e=>n({...t,dirs:e.target.checked}),onClick:e=>e.stopPropagation()})]})]})]})}function ah(e){if(e===null)return`-`;if(e===0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=Math.floor(Math.log(e)/Math.log(1024)),r=e/1024**n;return`${r<10?r.toFixed(1):Math.round(r)} ${t[n]}`}function oh({entry:e,basePath:t,isInsider:n,shareSettings:r,onShareSettingsChange:i}){let a=t?`${t}/${e.name}`:e.name,o=e.type===`directory`,s=!o,c=`/${a}`,l=o?`Directory`:e.ext?e.ext.slice(1).toUpperCase():`File`;return(0,L.jsxs)(`tr`,{className:`border-b border-border last:border-0 hover:bg-accent/50 transition-colors`,children:[(0,L.jsx)(`td`,{className:`px-4 py-2.5`,children:(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(mn,{to:`/browse/${a}`,className:`text-blue-500 hover:underline flex items-center gap-2 min-w-0`,children:[o?(0,L.jsx)(Zc,{className:`h-4 w-4 text-yellow-500 shrink-0`}):(0,L.jsx)(Xc,{className:`h-4 w-4 text-zinc-400 shrink-0`}),(0,L.jsx)(`span`,{className:`truncate`,children:e.name})]}),n&&(0,L.jsxs)(`div`,{className:`ml-auto flex items-center gap-0.5 shrink-0`,children:[(0,L.jsx)(ih,{path:c,shareSettings:r,onShareSettingsChange:i,showRaw:s,compact:!0,isDirectory:o}),(0,L.jsx)(th,{reqPath:a,file:o?null:{fileName:e.name,type:e.ext},isDirectory:o,isInsider:n,compact:!0})]})]})}),(0,L.jsx)(`td`,{className:`px-4 py-2.5 text-muted-foreground text-sm`,children:l}),(0,L.jsx)(`td`,{className:`px-4 py-2.5 text-muted-foreground text-sm`,children:ah(e.size)}),(0,L.jsx)(`td`,{className:`px-4 py-2.5 text-muted-foreground text-sm`,children:e.mtime??`-`})]})}function sh({entries:e,basePath:t,isInsider:n,shareSettings:r,onShareSettingsChange:i}){return(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`p`,{className:`text-muted-foreground text-sm mb-4`,children:[e.length,` items`]}),(0,L.jsx)(`div`,{className:`bg-muted/50 rounded-lg overflow-hidden border border-border`,children:(0,L.jsxs)(`table`,{className:`w-full`,children:[(0,L.jsx)(`thead`,{children:(0,L.jsxs)(`tr`,{className:`border-b border-border`,children:[(0,L.jsx)(`th`,{className:`text-left px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:`Name`}),(0,L.jsx)(`th`,{className:`text-left px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:`Type`}),(0,L.jsx)(`th`,{className:`text-left px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:`Size`}),(0,L.jsx)(`th`,{className:`text-left px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:`Modified`})]})}),(0,L.jsx)(`tbody`,{children:e.map(e=>(0,L.jsx)(oh,{entry:e,basePath:t,isInsider:n,shareSettings:r,onShareSettingsChange:i},e.name))})]})})]})}function ch({drives:e,isInsider:t,shareSettings:n,onShareSettingsChange:r}){return(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`p`,{className:`text-muted-foreground text-sm mb-4`,children:[e.length,` drives`]}),(0,L.jsx)(`div`,{className:`bg-muted/50 rounded-lg overflow-hidden border border-border`,children:(0,L.jsxs)(`table`,{className:`w-full`,children:[(0,L.jsx)(`thead`,{children:(0,L.jsxs)(`tr`,{className:`border-b border-border`,children:[(0,L.jsx)(`th`,{className:`text-left px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:`Name`}),(0,L.jsx)(`th`,{className:`text-left px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:`Type`})]})}),(0,L.jsx)(`tbody`,{children:e.map(e=>{let i=`/${e.letter.toLowerCase()}`;return(0,L.jsxs)(`tr`,{className:`border-b border-border last:border-0 hover:bg-accent/50 transition-colors`,children:[(0,L.jsx)(`td`,{className:`px-4 py-2.5`,children:(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(mn,{to:`/browse/${e.letter.toLowerCase()}`,className:`text-blue-500 hover:underline flex items-center gap-2 min-w-0`,children:[`💾 `,e.letter,`:\\`,e.label?` (${e.label})`:``]}),t&&(0,L.jsx)(`div`,{className:`ml-auto flex items-center gap-0.5 shrink-0`,children:(0,L.jsx)(ih,{path:i,shareSettings:n,onShareSettingsChange:r,compact:!0,isDirectory:!0})})]})}),(0,L.jsx)(`td`,{className:`px-4 py-2.5 text-muted-foreground text-sm`,children:`Drive`})]},e.letter)})})]})})]})}var lh=function(){return lh=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},lh.apply(this,arguments)};typeof window<`u`&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window.CustomEvent!=`function`&&(window.CustomEvent=function(e,t){t||={bubbles:!1,cancelable:!1,detail:null};var n=document.createEvent(`CustomEvent`);return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}));var uh=typeof document<`u`&&!!document.documentMode,dh;function fh(){return dh||=document.createElement(`div`).style}var ph=[`webkit`,`moz`,`ms`],mh={};function hh(e){if(mh[e])return mh[e];var t=fh();if(e in t)return mh[e]=e;for(var n=e[0].toUpperCase()+e.slice(1),r=ph.length;r--;){var i=`${ph[r]}${n}`;if(i in t)return mh[e]=i}}function gh(e,t){return parseFloat(t[hh(e)])||0}function _h(e,t,n){n===void 0&&(n=window.getComputedStyle(e));var r=t===`border`?`Width`:``;return{left:gh(`${t}Left${r}`,n),right:gh(`${t}Right${r}`,n),top:gh(`${t}Top${r}`,n),bottom:gh(`${t}Bottom${r}`,n)}}function vh(e,t,n){e.style[hh(t)]=n}function yh(e,t){vh(e,`transition`,`${hh(`transform`)} ${t.duration}ms ${t.easing}`)}function bh(e,t,n){var r=t.x,i=t.y,a=t.scale,o=t.isSVG;if(vh(e,`transform`,`scale(${a}) translate(${r}px, ${i}px)`),o&&uh){var s=window.getComputedStyle(e).getPropertyValue(`transform`);e.setAttribute(`transform`,s)}}function xh(e){var t=e.parentNode,n=window.getComputedStyle(e),r=window.getComputedStyle(t),i=e.getBoundingClientRect(),a=t.getBoundingClientRect();return{elem:{style:n,width:i.width,height:i.height,top:i.top,bottom:i.bottom,left:i.left,right:i.right,margin:_h(e,`margin`,n),border:_h(e,`border`,n)},parent:{style:r,width:a.width,height:a.height,top:a.top,bottom:a.bottom,left:a.left,right:a.right,padding:_h(t,`padding`,r),border:_h(t,`border`,r)}}}var Sh={down:`mousedown`,move:`mousemove`,up:`mouseup mouseleave`};typeof window<`u`&&(typeof window.PointerEvent==`function`?Sh={down:`pointerdown`,move:`pointermove`,up:`pointerup pointerleave pointercancel`}:typeof window.TouchEvent==`function`&&(Sh={down:`touchstart`,move:`touchmove`,up:`touchend touchcancel`}));function Ch(e,t,n,r){Sh[e].split(` `).forEach(function(e){t.addEventListener(e,n,r)})}function wh(e,t,n){Sh[e].split(` `).forEach(function(e){t.removeEventListener(e,n)})}function Th(e,t){for(var n=e.length;n--;)if(e[n].pointerId===t.pointerId)return n;return-1}function Eh(e,t){var n;if(t.touches){n=0;for(var r=0,i=t.touches;r<i.length;r++){var a=i[r];a.pointerId=n++,Eh(e,a)}return}n=Th(e,t),n>-1&&e.splice(n,1),e.push(t)}function Dh(e,t){if(t.touches){for(;e.length;)e.pop();return}var n=Th(e,t);n>-1&&e.splice(n,1)}function Oh(e){e=e.slice(0);for(var t=e.pop(),n;n=e.pop();)t={clientX:(n.clientX-t.clientX)/2+t.clientX,clientY:(n.clientY-t.clientY)/2+t.clientY};return t}function kh(e){if(e.length<2)return 0;var t=e[0],n=e[1];return Math.sqrt(Math.abs(n.clientX-t.clientX)**2+Math.abs(n.clientY-t.clientY)**2)}function Ah(e){for(var t=e;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1}function jh(e){return(e.getAttribute(`class`)||``).trim()}function Mh(e,t){return e.nodeType===1&&` ${jh(e)} `.indexOf(` ${t} `)>-1}function Nh(e,t){for(var n=e;n!=null;n=n.parentNode)if(Mh(n,t.excludeClass)||t.exclude.indexOf(n)>-1)return!0;return!1}var Ph=/^http:[\w\.\/]+svg$/;function Fh(e){return Ph.test(e.namespaceURI)&&e.nodeName.toLowerCase()!==`svg`}function Ih(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var Lh={animate:!1,canvas:!1,cursor:`move`,disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:`ease-in-out`,exclude:[],excludeClass:`panzoom-exclude`,handleStartEvent:function(e){e.preventDefault(),e.stopPropagation()},maxScale:4,minScale:.125,overflow:`hidden`,panOnlyWhenZoomed:!1,pinchAndPan:!1,relative:!1,setTransform:bh,startX:0,startY:0,startScale:1,step:.3,touchAction:`none`};function Rh(e,t){if(!e)throw Error(`Panzoom requires an element as an argument`);if(e.nodeType!==1)throw Error(`Panzoom requires an element with a nodeType of 1`);if(!Ah(e))throw Error(`Panzoom should be called on elements that have been attached to the DOM`);t=lh(lh({},Lh),t);var n=Fh(e),r=e.parentNode;r.style.overflow=t.overflow,r.style.userSelect=`none`,r.style.touchAction=t.touchAction,(t.canvas?r:e).style.cursor=t.cursor,e.style.userSelect=`none`,e.style.touchAction=t.touchAction,vh(e,`transformOrigin`,typeof t.origin==`string`?t.origin:n?`0 0`:`50% 50%`);function i(){r.style.overflow=``,r.style.userSelect=``,r.style.touchAction=``,r.style.cursor=``,e.style.cursor=``,e.style.userSelect=``,e.style.touchAction=``,vh(e,`transformOrigin`,``)}function a(n){for(var i in n===void 0&&(n={}),n)n.hasOwnProperty(i)&&(t[i]=n[i]);(n.hasOwnProperty(`cursor`)||n.hasOwnProperty(`canvas`))&&(r.style.cursor=e.style.cursor=``,(t.canvas?r:e).style.cursor=t.cursor),n.hasOwnProperty(`overflow`)&&(r.style.overflow=n.overflow),n.hasOwnProperty(`touchAction`)&&(r.style.touchAction=n.touchAction,e.style.touchAction=n.touchAction)}var o=0,s=0,c=1,l=!1;h(t.startScale,{animate:!1,force:!0}),setTimeout(function(){m(t.startX,t.startY,{animate:!1,force:!0})});function u(t,n,r){if(!r.silent){var i=new CustomEvent(t,{detail:n});e.dispatchEvent(i)}}function d(t,r,i){var a={x:o,y:s,scale:c,isSVG:n,originalEvent:i};return requestAnimationFrame(function(){typeof r.animate==`boolean`&&(r.animate?yh(e,r):vh(e,`transition`,`none`)),r.setTransform(e,a,r),u(t,a,r),u(`panzoomchange`,a,r)}),a}function f(n,r,i,a){var l=lh(lh({},t),a),u={x:o,y:s,opts:l};if(!a?.force&&(l.disablePan||l.panOnlyWhenZoomed&&c===l.startScale))return u;if(n=parseFloat(n),r=parseFloat(r),l.disableXAxis||(u.x=(l.relative?o:0)+n),l.disableYAxis||(u.y=(l.relative?s:0)+r),l.contain){var d=xh(e),f=d.elem.width/c,p=d.elem.height/c,m=f*i,h=p*i,g=(m-f)/2,_=(h-p)/2;if(l.contain===`inside`){var v=(-d.elem.margin.left-d.parent.padding.left+g)/i,y=(d.parent.width-m-d.parent.padding.left-d.elem.margin.left-d.parent.border.left-d.parent.border.right+g)/i;u.x=Math.max(Math.min(u.x,y),v);var b=(-d.elem.margin.top-d.parent.padding.top+_)/i,x=(d.parent.height-h-d.parent.padding.top-d.elem.margin.top-d.parent.border.top-d.parent.border.bottom+_)/i;u.y=Math.max(Math.min(u.y,x),b)}else if(l.contain===`outside`){var v=(-(m-d.parent.width)-d.parent.padding.left-d.parent.border.left-d.parent.border.right+g)/i,y=(g-d.parent.padding.left)/i;u.x=Math.max(Math.min(u.x,y),v);var b=(-(h-d.parent.height)-d.parent.padding.top-d.parent.border.top-d.parent.border.bottom+_)/i,x=(_-d.parent.padding.top)/i;u.y=Math.max(Math.min(u.y,x),b)}}return l.roundPixels&&(u.x=Math.round(u.x),u.y=Math.round(u.y)),u}function p(n,r){var i=lh(lh({},t),r),a={scale:c,opts:i};if(!r?.force&&i.disableZoom)return a;var o=t.minScale,s=t.maxScale;if(i.contain){var l=xh(e),u=l.elem.width/c,d=l.elem.height/c;if(u>1&&d>1){var f=l.parent.width-l.parent.border.left-l.parent.border.right,p=l.parent.height-l.parent.border.top-l.parent.border.bottom,m=f/u,h=p/d;t.contain===`inside`?s=Math.min(s,m,h):t.contain===`outside`&&(o=Math.max(o,m,h))}}return a.scale=Math.min(Math.max(n,o),s),a}function m(e,t,r,i){var a=f(e,t,c,r);return o!==a.x||s!==a.y?(o=a.x,s=a.y,d(`panzoompan`,a.opts,i)):{x:o,y:s,scale:c,isSVG:n,originalEvent:i}}function h(e,t,n){var r=p(e,t),i=r.opts;if(!(!t?.force&&i.disableZoom)){e=r.scale;var a=o,l=s;if(i.focal){var u=i.focal;a=(u.x/e-u.x/c+o*e)/e,l=(u.y/e-u.y/c+s*e)/e}var m=f(a,l,e,{relative:!1,force:!0});return o=m.x,s=m.y,c=e,d(`panzoomzoom`,i,n)}}function g(e,n){var r=lh(lh(lh({},t),{animate:!0}),n);return h(c*Math.exp((e?1:-1)*r.step),r)}function _(e){return g(!0,e)}function v(e){return g(!1,e)}function y(t,r,i,a){var o=xh(e),s={width:o.parent.width-o.parent.padding.left-o.parent.padding.right-o.parent.border.left-o.parent.border.right,height:o.parent.height-o.parent.padding.top-o.parent.padding.bottom-o.parent.border.top-o.parent.border.bottom},l=r.clientX-o.parent.left-o.parent.padding.left-o.parent.border.left-o.elem.margin.left,u=r.clientY-o.parent.top-o.parent.padding.top-o.parent.border.top-o.elem.margin.top;n||(l-=o.elem.width/c/2,u-=o.elem.height/c/2);var d={x:l/s.width*(s.width*t),y:u/s.height*(s.height*t)};return h(t,lh(lh({},i),{animate:!1,focal:d}),a)}function b(e,n){e.preventDefault();var r=lh(lh(lh({},t),n),{animate:!1}),i=(e.deltaY===0&&e.deltaX?e.deltaX:e.deltaY)<0?1:-1,a=p(c*Math.exp(i*r.step/3),r).scale;return y(a,e,r,e)}function x(e){var n=lh(lh(lh({},t),{animate:!0,force:!0}),e);c=p(n.startScale,n).scale;var r=f(n.startX,n.startY,c,n);return o=r.x,s=r.y,d(`panzoomreset`,n)}var S,C,w,T,ee,E,D=[];function O(e){if(!Nh(e.target,t)){Eh(D,e),l=!0,t.handleStartEvent(e),S=o,C=s,u(`panzoomstart`,{x:o,y:s,scale:c,isSVG:n,originalEvent:e},t);var r=Oh(D);w=r.clientX,T=r.clientY,ee=c,E=kh(D)}}function k(e){if(!(!l||S===void 0||C===void 0||w===void 0||T===void 0)){Eh(D,e);var n=Oh(D),r=D.length>1,i=c;r&&(E===0&&(E=kh(D)),i=p((kh(D)-E)*t.step/80+ee).scale,y(i,n,{animate:!1},e)),(!r||t.pinchAndPan)&&m(S+(n.clientX-w)/i,C+(n.clientY-T)/i,{animate:!1},e)}}function A(e){D.length===1&&u(`panzoomend`,{x:o,y:s,scale:c,isSVG:n,originalEvent:e},t),Dh(D,e),l&&(l=!1,S=C=w=T=void 0)}var j=!1;function te(){j||(j=!0,Ch(`down`,t.canvas?r:e,O),Ch(`move`,document,k,{passive:!0}),Ch(`up`,document,A,{passive:!0}))}function ne(){j=!1,wh(`down`,t.canvas?r:e,O),wh(`move`,document,k),wh(`up`,document,A)}return t.noBind||te(),{bind:te,destroy:ne,eventNames:Sh,getPan:function(){return{x:o,y:s}},getScale:function(){return c},getOptions:function(){return Ih(t)},handleDown:O,handleMove:k,handleUp:A,pan:m,reset:x,resetStyle:i,setOptions:a,setStyle:function(t,n){return vh(e,t,n)},zoom:h,zoomIn:_,zoomOut:v,zoomToPoint:y,zoomWithWheel:b}}Rh.defaultOptions=Lh;function zh(e){let t=new DOMParser().parseFromString(e,`image/svg+xml`),n=t.querySelector(`svg`);if(!n)return e;let r=0,i=0,a=n.getAttribute(`viewBox`);if(a){let e=a.split(/[\s,]+/).map(Number);e.length===4&&(r=e[2],i=e[3])}return(r<=0||i<=0)&&(r=parseFloat(n.getAttribute(`width`)??`0`),i=parseFloat(n.getAttribute(`height`)??`0`)),!n.getAttribute(`viewBox`)&&r>0&&i>0&&n.setAttribute(`viewBox`,`0 0 ${r} ${i}`),n.getAttribute(`preserveAspectRatio`)===`none`&&n.setAttribute(`preserveAspectRatio`,`xMidYMid meet`),n.removeAttribute(`height`),n.style.removeProperty(`width`),n.style.removeProperty(`height`),n.style.removeProperty(`background`),n.setAttribute(`width`,`100%`),new XMLSerializer().serializeToString(t)}function Bh(e){let t=zh(e),n=new DOMParser().parseFromString(t,`image/svg+xml`),r=n.querySelector(`svg`);return r?(r.setAttribute(`preserveAspectRatio`,`xMidYMid meet`),r.setAttribute(`height`,`100%`),r.style.display=`block`,new XMLSerializer().serializeToString(n)):t}function Vh({content:e}){let t=(0,m.useRef)(null),n=(0,m.useRef)(null),r=(0,m.useRef)(null),i=(0,m.useRef)(null),[a,o]=(0,m.useState)(!1),s=(0,m.useMemo)(()=>Bh(e),[e]),c=(0,m.useCallback)(()=>{if(i.current?.(),i.current=null,r.current&&=(r.current.destroy(),null),!n.current||!t.current)return;let e=t.current,a=n.current,s=e.clientWidth,c=e.clientHeight;if(s===0||c===0)return;a.style.width=`${s}px`,a.style.height=`${c}px`;let l=Rh(a,{maxScale:20,minScale:.1,startScale:1});r.current=l;let u=e=>{l.zoomWithWheel(e)};e.addEventListener(`wheel`,u,{passive:!1}),i.current=()=>e.removeEventListener(`wheel`,u),o(!0)},[]);return(0,m.useEffect)(()=>{let e=t.current;if(!e)return;let n=new ResizeObserver(()=>{c()});return n.observe(e),()=>{n.disconnect(),i.current?.(),r.current?.destroy()}},[s,c]),(0,L.jsx)(`div`,{className:`relative bg-white rounded-lg border border-border overflow-hidden`,children:(0,L.jsx)(`div`,{ref:t,className:`overflow-hidden cursor-grab active:cursor-grabbing w-full h-[calc(100vh-8rem)]`,children:(0,L.jsx)(`div`,{ref:n,className:a?``:`invisible`,dangerouslySetInnerHTML:{__html:s}})})})}function Hh({html:e,content:t}){return e?(0,L.jsx)(Vh,{content:e}):(0,L.jsxs)(`div`,{className:`p-4 bg-red-950/20 border border-red-800 rounded-lg`,children:[(0,L.jsx)(`div`,{className:`text-red-400 text-sm font-medium mb-2`,children:`Mermaid render failed`}),(0,L.jsx)(`pre`,{className:`text-red-300 text-xs overflow-x-auto`,children:t})]})}function Uh({html:e,content:t}){return e?(0,L.jsx)(Vh,{content:e}):(0,L.jsxs)(`div`,{className:`p-4 bg-red-950/20 border border-red-800 rounded-lg`,children:[(0,L.jsx)(`div`,{className:`text-red-400 text-sm font-medium mb-2`,children:`PlantUML render failed`}),(0,L.jsx)(`pre`,{className:`text-red-300 text-xs overflow-x-auto`,children:t})]})}var Wh={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},Gh=([e,t,n])=>{let r=document.createElementNS(`http://www.w3.org/2000/svg`,e);return Object.keys(t).forEach(e=>{r.setAttribute(e,String(t[e]))}),n?.length&&n.forEach(e=>{let t=Gh(e);r.appendChild(t)}),r},Kh=(e,t={})=>Gh([`svg`,{...Wh,...t},e]),qh=[[`path`,{d:`M20 6 9 17l-5-5`}]],Jh=[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}]],Yh=[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`}]],Xh=[[`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`}],[`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`}],[`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`}],[`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`}]],Zh=`relative bg-white rounded-lg border border-border overflow-hidden my-4`,Qh=`fixed inset-0 z-[100] bg-white flex flex-col`,$h=`overflow-hidden w-full`,eg=`overflow-hidden w-full h-full flex-1`,tg=`flex items-center justify-center p-4 [&>svg]:max-w-full [&>svg]:h-auto`,ng=`p-4`,rg=`absolute top-2 right-2 z-10 p-1.5 bg-zinc-800/70 hover:bg-zinc-700 text-white rounded transition-colors`,ig=`text-xs text-muted-foreground text-center py-1 opacity-60`,ag=`text-muted-foreground text-xs text-center py-2 pointer-events-none`,og=`Scroll to zoom · Drag to pan`,sg=`Scroll to zoom · Drag to pan · Esc to close`;function cg(e){return Kh(e,{size:16})}function lg(e,t){e.innerHTML=``,e.appendChild(cg(t))}function ug(e){let t=e.getAttribute(`viewBox`);if(t){let e=t.split(/[\s,]+/).map(Number);if(e[2]&&e[3])return{w:e[2],h:e[3]}}return{w:e.clientWidth||1e3,h:e.clientHeight||800}}function dg(e,t,n,r){let i=Math.min(n/e,r/t,1),a=e*i,o=t*i;return{fitScale:i,fittedW:a,fittedH:o,startX:(n-a)/2,startY:(r-o)/2}}function fg(e,t,n){let r=n?.wrapperExtraClass?`${n.wrapperExtraClass} ${Zh}`:Zh,i=document.createElement(`div`);i.className=r,i.style.cursor=`grab`;let a=document.createElement(`div`);a.className=$h,n?.viewportMinHeight&&(a.style.minHeight=n.viewportMinHeight);let o=document.createElement(`div`);o.className=tg,o.appendChild(e),a.appendChild(o);let s=document.createElement(`button`);s.className=rg,s.title=`Fullscreen`,lg(s,Yh);let c=document.createElement(`div`);c.className=ig,c.textContent=og,i.appendChild(a),i.appendChild(s),i.appendChild(c);let l=null,u=e=>{l?.zoomWithWheel(e)};a.addEventListener(`wheel`,u,{passive:!1});let d=()=>{l||=Rh(o,{maxScale:20,contain:`outside`})},f=!1,p=()=>{f=!0,i.dataset.origClass=i.className,i.className=Qh,i.style.cursor=`grab`,a.className=eg,n?.viewportMinHeight&&(a.style.minHeight=``),o.className=ng,c.textContent=sg,c.className=ag,s.title=`Exit fullscreen`,lg(s,Xh),l?.destroy(),l=null,requestAnimationFrame(()=>{requestAnimationFrame(()=>{setTimeout(()=>{let e=o.querySelector(`svg`);if(e&&a.clientWidth&&a.clientHeight){let{w:t,h:n}=ug(e),{fitScale:r,fittedW:i,fittedH:s,startX:c,startY:u}=dg(t,n,a.clientWidth,a.clientHeight);e.setAttribute(`width`,String(Math.round(i))),e.setAttribute(`height`,String(Math.round(s))),e.style.width=`${String(Math.round(i))}px`,e.style.height=`${String(Math.round(s))}px`,l=Rh(o,{maxScale:20/r,minScale:.5,startScale:1,startX:c,startY:u})}else l=Rh(o,{maxScale:20,minScale:.1})},50)})})},m=()=>{f=!1;let e=o.querySelector(`svg`);e&&(e.setAttribute(`width`,`100%`),e.removeAttribute(`height`),e.style.width=``,e.style.height=``),i.className=i.dataset.origClass??r,i.style.cursor=`grab`,a.className=$h,n?.viewportMinHeight&&(a.style.minHeight=n.viewportMinHeight),o.className=tg,c.textContent=og,c.className=ig,s.title=`Fullscreen`,lg(s,Yh),l?.destroy(),l=Rh(o,{maxScale:20,contain:`outside`,startScale:1})};s.addEventListener(`click`,()=>{f?m():p()});let h=e=>{e.key===`Escape`&&f&&m()};return document.addEventListener(`keydown`,h),{wrapper:i,initPanzoom:d,enterFullscreen:p,exitFullscreen:m,cleanup:()=>{a.removeEventListener(`wheel`,u),document.removeEventListener(`keydown`,h),l?.destroy()}}}function pg(e){let t=[],n=e.querySelectorAll(`.embedded-diagram-rendered`);for(let e of n){let n=e.querySelector(`svg`);if(!n)continue;let{wrapper:r,initPanzoom:i,cleanup:a}=fg(n,e,{wrapperExtraClass:`embedded-diagram-panzoom`});e.replaceWith(r),i(),t.push(a)}return()=>{for(let e of t)e()}}function mg(e){let t=[],n=e.querySelectorAll(`.embedded-diagram-lazy`);if(n.length===0)return()=>{};for(let e of n)e.innerHTML=`<div class="embedded-diagram-loading"><div class="diagram-spinner"></div><span>Rendering ${e.dataset.diagramType??`diagram`} diagram…</span></div>`,hg(e,t);return()=>{for(let e of t)e()}}async function hg(e,t){let n=e.dataset.diagramType,r=e.dataset.diagramHash;if(!(!n||!r))try{let i=Rn(`/api/diagram/${n}/${r}.svg`),a=await fetch(i);if(!a.ok){let e=await a.json().catch(()=>({error:`Render failed`}));throw Error(e.error??`HTTP ${String(a.status)}`)}let o=zh(await a.text()),s=document.createElement(`div`);s.className=`embedded-diagram-rendered`,s.dataset.type=n,s.innerHTML=o;let c=s.querySelector(`svg`);if(!c){e.replaceWith(s);return}let{wrapper:l,initPanzoom:u,cleanup:d}=fg(c,s,{wrapperExtraClass:`embedded-diagram-panzoom`});e.replaceWith(l),u(),t.push(d)}catch(r){let i=r instanceof Error?r.message:`Unknown error`,a=n?n.charAt(0).toUpperCase()+n.slice(1):`Diagram`,o=Number(e.dataset.retryCount??`0`),s=o>0?`<div class="diagram-reload-hint">Still failing? Try reloading the page — the diagram source may have changed.</div>`:``;e.innerHTML=`<div class="embedded-diagram-error" data-type="${n}"><div class="diagram-error-label">${a} render failed: ${gg(i)}</div>${s}<button class="diagram-retry-btn">Retry</button></div>`,e.querySelector(`.diagram-retry-btn`)?.addEventListener(`click`,()=>{e.dataset.retryCount=String(o+1),e.innerHTML=`<div class="embedded-diagram-loading"><div class="diagram-spinner"></div><span>Rendering ${n} diagram…</span></div>`,hg(e,t)})}}function gg(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function _g(e){let t=[],n=Array.from(e.querySelectorAll(`img`)).filter(e=>/\.svg(\?|&|$)/i.test(e.getAttribute(`src`)??``));for(let e of n){let n=e.getAttribute(`src`);if(!n)continue;let r=n.includes(`raw=1`)?n:n.includes(`?`)?`${n}&raw=1`:`${n}?raw=1`,i=document.createElement(`div`);i.className=`inline-svg-panzoom relative bg-white rounded-lg border border-border overflow-hidden my-4`,i.style.cursor=`grab`,i.innerHTML=`<div class="overflow-hidden w-full min-h-[200px]"><div class="flex items-center justify-center p-4">Loading SVG…</div></div>`,e.parentElement?.replaceChild(i,e),fetch(Rn(r)).then(e=>{if(!e.ok)throw Error(`Failed to fetch SVG: ${String(e.status)}`);return e.text()}).then(e=>{let n=document.createElement(`div`);n.innerHTML=e;let r=n.querySelector(`svg`);if(!r)throw Error(`No SVG element found`);let{wrapper:a,initPanzoom:o,cleanup:s}=fg(r,i,{wrapperExtraClass:`inline-svg-panzoom`,viewportMinHeight:`200px`});i.replaceWith(a),o(),t.push(s)}).catch(()=>{i.replaceWith(e)})}return()=>{for(let e of t)e()}}function vg(e){let t=/language-(\w+)/.exec(e);if(!t)return null;let n=t[1];return{javascript:`js`,typescript:`ts`,python:`py`,json:`json`,yaml:`yaml`,yml:`yaml`,html:`html`,css:`css`,xml:`xml`,java:`java`,rust:`rs`,sql:`sql`,php:`php`,cpp:`cpp`,c:`c`,markdown:`md`,jsx:`jsx`,tsx:`tsx`,scss:`scss`,bash:`sh`,shell:`sh`,sh:`sh`,plaintext:``,text:``}[n]??n}function yg(e,t=`dark`){let n=[],r=e.querySelectorAll(`pre`),i=[];for(let e of r){let r=e.querySelector(`code`);if(!r||e.closest(`.embedded-diagram-lazy`)||e.closest(`.embedded-diagram-rendered`))continue;let a=vg(r.className)??``,o=r.textContent??``;if(!o.trim())continue;let s=document.createElement(`div`);s.className=`cm6-embedded-code`,e.replaceWith(s),i.push(bg(s,o,a,t,n))}return Promise.all(i).then(()=>{e.setAttribute(`data-cm6-ready`,`true`)}),()=>{for(let e of n)e()}}async function bg(e,t,n,i,o){try{let{EditorView:s,EditorState:c,basicSetup:l,oneDark:u}=await a(),d=await r(n);if(!e.isConnected)return;let f=[l,c.readOnly.of(!0),s.editable.of(!1),...i===`dark`?[u]:[],s.theme({"&":{fontSize:`14px`,borderRadius:`0.5rem`,overflow:`hidden`,border:`1px solid var(--color-border)`},".cm-scroller":{overflow:`auto`},".cm-content":{fontFamily:`'JetBrains Mono', 'Fira Code', 'Consolas', monospace`,padding:`0.75rem 0`},".cm-gutters":{fontFamily:`'JetBrains Mono', 'Fira Code', 'Consolas', monospace`,backgroundColor:`var(--color-muted)`,borderRight:`1px solid var(--color-border)`,color:`var(--color-muted-foreground)`},"&.cm-editor":{backgroundColor:`var(--color-muted)`},".cm-cursor":{display:`none`},".cm-activeLineGutter":{backgroundColor:`transparent`},".cm-activeLine":{backgroundColor:`transparent`}})];d&&f.push(d);let p=new s({state:c.create({doc:t,extensions:f}),parent:e});o.push(()=>p.destroy())}catch{e.innerHTML=`<pre class="hljs rounded-lg overflow-x-auto text-sm border border-border p-4 bg-muted text-foreground"><code>${xg(t)}</code></pre>`}}function xg(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Sg(e,t=14){return Kh(e,{size:t})}function Cg(e){e.querySelectorAll(`pre`).forEach(e=>{if(e.querySelector(`.code-copy-btn`))return;e.style.position=`relative`;let t=document.createElement(`button`);t.className=`code-copy-btn`,t.title=`Copy to clipboard`,t.innerHTML=``,t.appendChild(Sg(Jh)),t.addEventListener(`click`,()=>{let n=e.querySelector(`code`)?.textContent??e.textContent??``;navigator.clipboard.writeText(n).then(()=>{t.innerHTML=``;let e=Sg(qh);t.appendChild(e),t.style.color=`#4ade80`,setTimeout(()=>{t.innerHTML=``,t.appendChild(Sg(Jh)),t.style.color=``},1500)})}),e.appendChild(t)})}var wg=600;function Tg(e,t){let n=e===window,r=n?window.scrollY:e.scrollTop,i=t-r;if(Math.abs(i)<2)return;let a=performance.now();function o(t){let s=t-a,c=Math.min(s/wg,1),l=c<.5?4*c*c*c:1-(-2*c+2)**3/2;n?window.scrollTo(0,r+i*l):e.scrollTop=r+i*l,c<1&&requestAnimationFrame(o)}requestAnimationFrame(o)}function Eg(e,t){let n=document.getElementById(t);if(n&&e){let r=n.getBoundingClientRect(),i=e.getBoundingClientRect();Tg(e,e.scrollTop+(r.top-i.top)-16),window.history.replaceState(null,``,`#${t}`)}}function Dg({fileRendered:e,proseWidth:t,topBarHeight:n,mainRef:r,mobileTocOpen:i,setMobileTocOpen:a}){let[o]=s(),c=new URLSearchParams(window.location.search).has(`plain_code`),l=e.headings&&e.headings.length>2;return(0,L.jsxs)(L.Fragment,{children:[i&&l&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`lg:hidden fixed inset-0 z-40`,onClick:()=>a(!1)}),(0,L.jsx)(`div`,{className:`lg:hidden fixed left-2 right-2 z-50 bg-popover text-popover-foreground border border-border rounded-lg shadow-lg max-h-[60vh] overflow-y-auto px-4 py-3`,style:{top:`${n+4}px`},children:(0,L.jsx)(`nav`,{children:e.headings.map(e=>(0,L.jsx)(`button`,{type:`button`,onClick:()=>{Eg(r.current,e.slug),a(!1)},className:`block text-left text-sm text-muted-foreground hover:text-foreground cursor-pointer py-1 transition-colors w-full`,style:{paddingLeft:`${(e.level-1)*.75}rem`},children:e.text},e.slug))})})]}),(0,L.jsxs)(`div`,{className:`flex gap-6`,children:[l&&(0,L.jsxs)(`aside`,{className:`toc-sidebar hidden lg:block w-56 shrink-0`,style:{maxHeight:`calc(100vh - ${n+32}px)`},children:[(0,L.jsx)(`div`,{className:`text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2`,children:`Contents`}),(0,L.jsx)(`nav`,{className:`border-l border-border pl-3`,children:e.headings.map(e=>(0,L.jsx)(`button`,{type:`button`,onClick:()=>Eg(r.current,e.slug),className:`block text-left text-sm text-muted-foreground hover:text-foreground cursor-pointer py-0.5 transition-colors`,style:{paddingLeft:`${(e.level-1)*.75}rem`},children:e.text},e.slug))})]}),(0,L.jsx)(`article`,{ref:e=>{e&&(c||yg(e,o),Cg(e),_g(e),pg(e),mg(e))},className:`prose bg-background p-6 rounded-lg border border-border min-w-0 flex-1 ${t===`narrow`?`max-w-prose`:t===`medium`?`max-w-5xl`:`max-w-none`}`,style:{"--tw-prose-body":`var(--foreground)`,"--tw-prose-headings":`var(--foreground)`,"--tw-prose-bold":`var(--foreground)`,"--tw-prose-links":`#3b82f6`,"--tw-prose-code":`var(--foreground)`,"--tw-prose-pre-bg":`var(--muted)`,"--tw-prose-pre-code":`var(--foreground)`,"--tw-prose-hr":`var(--border)`,"--tw-prose-quotes":`var(--muted-foreground)`,"--tw-prose-quote-borders":`var(--border)`,"--tw-prose-th-borders":`var(--border)`,"--tw-prose-td-borders":`var(--border)`},dangerouslySetInnerHTML:{__html:e.html},onClick:e=>{let t=e.target.closest(`a`)?.getAttribute(`href`);t?.startsWith(`#`)&&(e.preventDefault(),Eg(r.current,t.slice(1)))}})]})]})}var Og=new Set([`.md`,`.svg`,`.mmd`,`.puml`,`.plantuml`,`.pu`]);function kg(e){return e.type===`markdown`||e.type===`svg`||e.type===`mermaid`||e.type===`plantuml`||!!e.html}function Ag(e){let t=e?`.${e.split(`.`).pop()?.toLowerCase()}`:``;return Og.has(t)}function jg(e,t,n=!0){let r=(0,m.useRef)(0),i=(0,m.useRef)(0);(0,m.useEffect)(()=>{let a=e.current,o=t.current;if(!a||!o||!n)return;r.current=o.scrollHeight,i.current=a.scrollTop;let s=()=>{i.current=a.scrollTop};a.addEventListener(`scroll`,s,{passive:!0});let c=new ResizeObserver(()=>{let e=o.scrollHeight,t=e-r.current;if(Math.abs(t)>0&&i.current>0){let e=a.scrollTop;e===i.current&&t>0&&(a.scrollTop=e+t),i.current=a.scrollTop}r.current=e});return c.observe(o),()=>{a.removeEventListener(`scroll`,s),c.disconnect()}},[e,t,n])}var Mg=(0,m.lazy)(()=>e(()=>import(`./CodeEditor-Brh86AGF.js`).then(e=>({default:e.CodeEditor})),__vite__mapDeps([0,1]))),Ng=(0,m.lazy)(()=>e(()=>import(`./CodeViewer-Cegj3cEn.js`).then(e=>({default:e.CodeViewer})),__vite__mapDeps([2,1])));function Pg({reqPath:e,file:t,fileRaw:n,fileRendered:r,viewTab:i,editing:a,setEditing:o,proseWidth:s,topBarHeight:c,mainRef:l,mobileTocOpen:u,setMobileTocOpen:d,onSave:f}){let p=(0,m.useRef)(null);jg(l,p);let h=t?kg(t):!1,g=h?i:`raw`,_=!t;return(0,m.useEffect)(()=>{let e=window.location.hash.slice(1);if(e&&t){let t=setTimeout(()=>Eg(l.current,e),100);return()=>clearTimeout(t)}},[t,l]),(0,L.jsxs)(`div`,{ref:p,className:`px-4 md:px-6 pt-4`,children:[_&&(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground text-sm py-8 justify-center`,children:[(0,L.jsx)(tl,{className:`h-4 w-4 animate-spin`}),` Loading...`]}),(n??t)?.content&&g===`raw`&&!a&&(0,L.jsx)(m.Suspense,{fallback:(0,L.jsx)(`pre`,{className:`rounded-lg overflow-x-auto text-sm border border-border p-4 bg-muted text-foreground`,children:(0,L.jsxs)(`code`,{children:[(n??t).content.slice(0,500),`…`]})}),children:(0,L.jsx)(Ng,{content:(n??t).content,fileName:(n??t).fileName})}),a&&(n??t)?.content!=null&&g===`raw`&&(0,L.jsx)(m.Suspense,{fallback:(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground text-sm py-8 justify-center`,children:[(0,L.jsx)(tl,{className:`h-4 w-4 animate-spin`}),` Loading editor…`]}),children:(0,L.jsx)(`div`,{style:{height:`calc(100vh - ${c+16}px)`},children:(0,L.jsx)(Mg,{content:(n??t).content,fileName:(n??t).fileName,onSave:f,onCancel:()=>o(!1)})})}),!r&&h&&g===`rendered`&&!_&&(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground text-sm py-8 justify-center`,children:[(0,L.jsx)(tl,{className:`h-4 w-4 animate-spin`}),` Rendering...`]}),r?.type===`markdown`&&r.html&&g===`rendered`&&(0,L.jsx)(Dg,{fileRendered:r,proseWidth:s,topBarHeight:c,mainRef:l,mobileTocOpen:u,setMobileTocOpen:d}),r?.type===`svg`&&r.content&&g===`rendered`&&(0,L.jsx)(Vh,{content:r.content}),r?.type===`mermaid`&&g===`rendered`&&(0,L.jsx)(Hh,{html:r.html??null,content:r.content??``}),r?.type===`plantuml`&&g===`rendered`&&(0,L.jsx)(Uh,{html:r.html??null,content:r.content??``}),t?.type===`image`&&(0,L.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,L.jsx)(`img`,{src:`/api/raw/${e}`,alt:t.fileName,className:`max-w-full rounded-lg shadow-md`})}),t?.type===`binary`&&(0,L.jsxs)(`div`,{className:`text-center p-8`,children:[(0,L.jsx)(`p`,{className:`text-muted-foreground mb-4`,children:t.fileName}),(0,L.jsx)(`a`,{href:`/api/raw/${e}`,download:t.fileName,className:`inline-flex items-center gap-2 px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90`,children:`Download`})]})]})}var Fg={"bp-400":`min-[400px]:hidden`,"bp-480":`min-[480px]:hidden`,sm:`sm:hidden`,md:`md:hidden`,lg:`lg:hidden`};function Ig({collapsedItems:e=[]}){let{authenticated:t,email:n,picture:r}=$n(),[i,a]=(0,m.useState)(!1),o=(0,m.useRef)(null),[s,c]=(0,m.useState)(null),[l,u]=(0,m.useState)(null);(0,m.useEffect)(()=>{fetch(`/api/content-link/privacy`).then(e=>e.json()).then(e=>{e.url&&c(e.url)}).catch(()=>{}),fetch(`/api/content-link/terms`).then(e=>e.json()).then(e=>{e.url&&u(e.url)}).catch(()=>{})},[]);let d=(0,m.useCallback)(()=>!!document.querySelector(`[data-radix-popper-content-wrapper]`),[]);if((0,m.useEffect)(()=>{if(!i)return;function e(e){let t=e.target;o.current?.contains(t)||d()||t.closest?.(`[data-radix-popper-content-wrapper]`)||t.closest?.(`[role="menu"]`)||a(!1)}return document.addEventListener(`pointerdown`,e,!0),document.addEventListener(`mousedown`,e,!0),()=>{document.removeEventListener(`pointerdown`,e,!0),document.removeEventListener(`mousedown`,e,!0)}},[i,d]),!t)return null;let f=n?n[0].toUpperCase():`?`;return(0,L.jsxs)(`div`,{className:`relative`,ref:o,children:[(0,L.jsx)(`button`,{onClick:()=>a(!i),className:`flex items-center gap-2 px-2 py-1 rounded-md hover:bg-zinc-700 transition-colors`,title:n??`Account`,children:r?(0,L.jsx)(`img`,{src:r,alt:``,className:`h-7 w-7 rounded-full`,referrerPolicy:`no-referrer`}):(0,L.jsx)(`div`,{className:`h-7 w-7 rounded-full bg-blue-600 flex items-center justify-center text-white text-xs font-semibold`,children:f})}),i&&(0,L.jsxs)(`div`,{className:`absolute right-0 top-full mt-1 w-56 bg-popover border border-border rounded-lg shadow-lg z-50 py-1`,children:[(0,L.jsxs)(`a`,{href:`https://myaccount.google.com/`,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 px-3 py-2 border-b border-border hover:bg-accent transition-colors`,children:[(0,L.jsx)(_l,{className:`h-4 w-4 text-foreground`}),(0,L.jsx)(`span`,{className:`text-sm text-foreground truncate`,children:n})]}),e.map((e,t)=>(0,L.jsx)(`div`,{className:Fg[e.breakpoint],children:typeof e.node==`function`?e.node(()=>a(!1)):e.node},t)),e.length>0&&(0,L.jsx)(`div`,{className:`border-b border-border`}),(0,L.jsxs)(`a`,{href:`/auth/logout`,className:`flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-accent transition-colors`,children:[(0,L.jsx)(nl,{className:`h-4 w-4`}),`Sign out`]}),(s??l)&&(0,L.jsxs)(`div`,{className:`border-t border-border mt-1 pt-1`,children:[s&&(0,L.jsxs)(`a`,{href:s,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent transition-colors`,children:[(0,L.jsx)(Yc,{className:`h-3 w-3`}),`Privacy`]}),l&&(0,L.jsxs)(`a`,{href:l,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent transition-colors`,children:[(0,L.jsx)(Yc,{className:`h-3 w-3`}),`Terms`]})]})]})]})}var Lg=8;function Rg(e){return e.filter(e=>{let t=String(e??``);return!(!t||!t.trim()||t.includes(`[object Object]`)||/^\$\{.*\}$/.test(t))})}function zg(e){return e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function Bg({label:e,values:t,selected:n,onToggle:r,onRemove:i}){return(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground font-medium`,children:[e,`:`]}),t.map(e=>(0,L.jsx)(`button`,{onClick:()=>r(e),className:`text-xs px-2 py-0.5 rounded-full border transition-colors ${n.has(e)?`bg-primary text-primary-foreground border-primary`:`bg-muted text-muted-foreground border-border hover:bg-accent`}`,children:e},e)),(0,L.jsx)(`button`,{onClick:i,className:`text-muted-foreground hover:text-foreground ml-0.5`,title:`Remove ${e} filter`,children:(0,L.jsx)(vl,{className:`h-3 w-3`})})]})}function Vg({label:e,values:t,selected:n,onToggle:r,multi:i,onRemove:a}){let[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(``),u=(0,m.useRef)(null);(0,m.useEffect)(()=>{if(!o)return;let e=e=>{u.current&&!u.current.contains(e.target)&&(s(!1),l(``))};return document.addEventListener(`mousedown`,e,!0),()=>document.removeEventListener(`mousedown`,e,!0)},[o]);let d=c?t.filter(e=>e.toLowerCase().includes(c.toLowerCase())):t,f=n.size===0?`All`:n.size<=2?[...n].join(`, `):`${n.size} selected`;return(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5`,ref:u,children:[(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground font-medium`,children:[e,`:`]}),(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsxs)(`button`,{onClick:()=>s(!o),className:`text-xs px-2 py-0.5 rounded border transition-colors flex items-center gap-1 min-w-[100px] ${n.size>0?`bg-primary/10 text-primary border-primary`:`bg-muted text-muted-foreground border-border hover:bg-accent`}`,children:[(0,L.jsx)(`span`,{className:`truncate max-w-[200px]`,children:f}),(0,L.jsx)(Kc,{className:`h-3 w-3 shrink-0`})]}),o&&(0,L.jsxs)(`div`,{className:`absolute top-full left-0 mt-1 z-50 bg-background border border-border rounded shadow-lg w-64 max-h-48 flex flex-col`,children:[(0,L.jsx)(`div`,{className:`p-1.5 border-b border-border`,children:(0,L.jsx)(`input`,{type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:`Search...`,className:`text-xs w-full px-2 py-1 rounded border border-border bg-muted text-foreground placeholder:text-muted-foreground outline-none focus:border-primary`,autoFocus:!0})}),(0,L.jsxs)(`div`,{className:`overflow-y-auto flex-1`,children:[d.length===0&&(0,L.jsx)(`div`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:`No matches`}),d.map(e=>(0,L.jsxs)(`button`,{onClick:()=>{r(e),i||(s(!1),l(``))},className:`w-full text-left text-xs px-3 py-1.5 hover:bg-accent transition-colors flex items-center gap-2 ${n.has(e)?`bg-primary/10 text-primary`:`text-foreground`}`,children:[i&&(0,L.jsx)(`span`,{className:`w-3 h-3 rounded-sm border flex items-center justify-center shrink-0 ${n.has(e)?`bg-primary border-primary`:`border-border`}`,children:n.has(e)&&(0,L.jsx)(`span`,{className:`text-[8px] text-primary-foreground`,children:`✓`})}),(0,L.jsx)(`span`,{className:`truncate`,children:e})]},e))]})]})]}),n.size>0&&n.size<=5&&[...n].map(e=>(0,L.jsxs)(`button`,{onClick:()=>r(e),className:`text-xs px-1.5 py-0.5 rounded-full bg-primary/10 text-primary border border-primary/30 hover:bg-primary/20 flex items-center gap-0.5`,title:`Remove ${e}`,children:[(0,L.jsx)(`span`,{className:`truncate max-w-[120px]`,children:e}),(0,L.jsx)(vl,{className:`h-2.5 w-2.5 shrink-0`})]},e)),(0,L.jsx)(`button`,{onClick:a,className:`text-muted-foreground hover:text-foreground ml-0.5`,title:`Remove ${e} filter`,children:(0,L.jsx)(vl,{className:`h-3 w-3`})})]})}function Hg({label:e,value:t,onChange:n,inputType:r=`text`,onRemove:i}){return(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground font-medium`,children:[e,`:`]}),(0,L.jsx)(`input`,{type:r,value:t,onChange:e=>n(e.target.value),placeholder:`Filter by ${e.toLowerCase()}...`,className:`text-xs px-2 py-0.5 rounded border border-border bg-muted text-foreground placeholder:text-muted-foreground w-64 outline-none focus:border-primary`}),(0,L.jsx)(`button`,{onClick:i,className:`text-muted-foreground hover:text-foreground`,title:`Remove ${e} filter`,children:(0,L.jsx)(vl,{className:`h-3 w-3`})})]})}var Ug=4,Wg=new Set([`file_path`,`chunk_text`,`chunk_index`,`total_chunks`,`content_hash`,`embedded_at`]);function Gg(e,t){let n=e.metadata??{},r=[],i=new Map(t.map(e=>[e.field,e]));for(let[e,t]of Object.entries(n)){if(Wg.has(e))continue;let n=i.get(e);if(!n)continue;let a=Array.isArray(t)?t.map(String):[String(t)],o=n.uiHint!==`text`&&n.uiHint!==`number`?n.values.length:1/0;for(let t of a)!t||t===`undefined`||t===`null`||r.push({field:e,label:zg(e),value:t,cardinality:o})}return r.sort((e,t)=>e.cardinality-t.cardinality),r}function Kg({result:e,facets:t,onNavigate:n,onChipClick:r}){let[i,a]=(0,m.useState)(!1),o=e.chunks[0]?.text??``,s=o.length>150?o.slice(0,150)+`…`:o,c=Gg(e,t),l=c.slice(0,Ug),u=c.length>Ug,d=(e,t)=>{let n=e.value.length>30?e.value.slice(0,28)+`…`:e.value;return(0,L.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),r(e.field,e.value)},className:`text-[10px] px-1.5 py-0.5 rounded bg-muted text-foreground border border-border hover:bg-primary/10 hover:border-primary/30 transition-colors cursor-pointer truncate max-w-[200px]`,title:`${e.label}: ${e.value} — click to filter`,children:[(0,L.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.label,`:`]}),` `,n]},`${e.field}-${t}`)};return(0,L.jsx)(`div`,{className:`border-b border-border last:border-0 px-4 py-2`,children:(0,L.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,L.jsx)(Xc,{className:`h-4 w-4 text-zinc-400 shrink-0 mt-1`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`button`,{onClick:()=>n(`/browse/${e.browsePath}`),className:`text-blue-500 hover:underline text-sm font-medium truncate`,children:e.fileName}),(0,L.jsxs)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:[(e.bestScore*100).toFixed(0),`%`]}),(0,L.jsxs)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:[e.chunks.length,` chunk`,e.chunks.length===1?``:`s`]}),e.mtime&&(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:new Date(e.mtime).toLocaleDateString()}),(0,L.jsx)(`button`,{onClick:()=>a(!i),className:`ml-auto text-muted-foreground hover:text-foreground shrink-0`,title:i?`Collapse chunks`:`Expand chunks`,children:i?(0,L.jsx)(Kc,{className:`h-4 w-4`}):(0,L.jsx)(qc,{className:`h-4 w-4`})})]}),(0,L.jsx)(`div`,{className:`text-xs text-muted-foreground mt-0.5 break-words leading-relaxed`,children:e.browsePath}),!i&&l.length>0&&(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 mt-1`,children:[l.map((e,t)=>d(e,t)),u&&(0,L.jsxs)(`button`,{onClick:()=>a(!0),className:`text-[10px] text-blue-500 hover:underline cursor-pointer`,children:[`+`,c.length-Ug,` more`]})]}),!i&&l.length===0&&(0,L.jsx)(`div`,{className:`text-sm text-foreground/70 mt-1 truncate`,children:s}),i&&(0,L.jsxs)(L.Fragment,{children:[c.length>0&&(0,L.jsx)(`div`,{className:`flex flex-wrap items-center gap-1 mt-1.5 mb-2`,children:c.map((e,t)=>d(e,t))}),(0,L.jsx)(`div`,{className:`max-h-48 overflow-y-auto border border-border rounded bg-muted/30 divide-y divide-border`,children:e.chunks.map((e,t)=>(0,L.jsxs)(`div`,{className:`px-3 py-2 text-sm text-foreground/80 leading-relaxed`,children:[(0,L.jsxs)(`span`,{className:`text-[10px] text-muted-foreground mr-2`,children:[`#`,e.index]}),e.text]},t))})]})]})]})})}function qg({open:e,onClose:t}){let[n,r]=(0,m.useState)(``),[i,a]=(0,m.useState)([]),[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(null),[u,d]=(0,m.useState)([]),[f,p]=(0,m.useState)(!1),h=(0,m.useRef)(!1),[g,_]=(0,m.useState)({}),[v,y]=(0,m.useState)({}),[b,x]=(0,m.useState)(new Set),[S,C]=(0,m.useState)([]),[w,T]=(0,m.useState)(!1),[ee,E]=(0,m.useState)(!1),[D,O]=(0,m.useState)(``),k=(0,m.useRef)(null),A=(0,m.useRef)(null),j=Je(),te=(0,m.useRef)(void 0);(0,m.useEffect)(()=>{if(!ee)return;let e=e=>{k.current&&!k.current.contains(e.target)&&(E(!1),O(``))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[ee]);let ne=(0,m.useCallback)(async()=>{if(!h.current){h.current=!0,p(!0);try{let e=await Xn(),t=[],n=[];for(let r of e.facets){if(r.uiHint===`hidden`)continue;if(r.uiHint===`text`||r.uiHint===`number`){t.push({...r,values:[]});continue}let e=Rg(r.values),i=r.values.filter(t=>!e.includes(t));if(i.length>0){let e=i.map(e=>!e||!String(e).trim()?`empty`:String(e).includes(`[object Object]`)?`object-to-string`:/^\$\{.*\}$/.test(String(e))?`unresolved-template`:`unknown`);n.push({field:r.field,removed:i.map((t,n)=>`${JSON.stringify(t)} (${e[n]})`),reason:[...new Set(e)].join(`, `)})}e.length>0?t.push({...r,values:e}):n.push({field:r.field,removed:i.length>0?[`(all values filtered)`]:[`(no values)`],reason:i.length>0?`no valid values remain`:`empty values array`})}console.log(`[SearchModal] Loaded facets:`,t.length,`clean,`,n.length,`garbage entries`),d(t),C(n)}catch(e){console.error(`Failed to load facets:`,e),d([])}finally{p(!1)}}},[]);(0,m.useEffect)(()=>{e&&(setTimeout(()=>A.current?.focus(),50),ne())},[e,ne]);let re=(0,m.useCallback)(()=>{r(``),a([]),l(null),_({}),y({}),x(new Set),T(!1),A.current?.focus()},[]),M=(0,m.useCallback)(async e=>{if(!e.trim()){a([]);return}s(!0),l(null);try{let t=[];for(let[e,n]of Object.entries(g))n.size>0&&t.push({key:e,match:{any:[...n]}});for(let[e,n]of Object.entries(v))n.trim()&&t.push({key:e,match:{text:n.trim()}});a((await Yn(e,30,t.length>0?{must:t}:void 0)).results)}catch(e){let t=String(e);t.includes(`502`)||t.includes(`Watcher unreachable`)?l(`Search service is unavailable. Please try again later.`):t.includes(`501`)||t.includes(`not configured`)?l(`Search is not configured on this server.`):t.includes(`403`)?l(`You do not have permission to search.`):t.includes(`400`)?l(`Invalid search query. Please revise and try again.`):l(`Search failed. Please try again later.`)}finally{s(!1)}},[g,v]),N=(0,m.useCallback)(e=>{r(e),te.current&&clearTimeout(te.current),te.current=setTimeout(()=>void M(e),400)},[M]),ie=(0,m.useCallback)(e=>{t(),j(e)},[j,t]),ae=(0,m.useCallback)((e,t)=>{x(t=>new Set([...t,e]));let n=u.find(t=>t.field===e);n&&(n.uiHint===`text`||n.uiHint===`number`)?y(n=>({...n,[e]:t})):_(n=>{let r=n[e]??new Set,i=new Set(r);return i.add(t),{...n,[e]:i}})},[u]),oe=(0,m.useCallback)((e,t)=>{_(n=>{let r=n[e]??new Set,i=new Set(r);return i.has(t)?i.delete(t):i.add(t),{...n,[e]:i}})},[]),P=(0,m.useCallback)(e=>{x(t=>new Set([...t,e]))},[]),F=(0,m.useCallback)(e=>{x(t=>{let n=new Set(t);return n.delete(e),n}),_(t=>{let n={...t};return delete n[e],n}),y(t=>{let n={...t};return delete n[e],n})},[]);(0,m.useEffect)(()=>{n.trim()&&M(n)},[g,v]);let I=u.filter(e=>b.has(e.field)),se=u.filter(e=>!b.has(e.field)),ce=D?se.filter(e=>zg(e.field).toLowerCase().includes(D.toLowerCase())):se;function le(e){let t=zg(e.field),n=()=>F(e.field);if(e.uiHint===`text`||e.uiHint===`number`)return(0,L.jsx)(Hg,{label:t,value:v[e.field]??``,onChange:t=>y(n=>({...n,[e.field]:t})),inputType:e.uiHint===`number`?`number`:`text`,onRemove:n},e.field);let r=g[e.field]??new Set;return e.values.length<=Lg?(0,L.jsx)(Bg,{label:t,values:e.values,selected:r,onToggle:t=>oe(e.field,t),onRemove:n},e.field):(0,L.jsx)(Vg,{label:t,values:e.values,selected:r,onToggle:t=>oe(e.field,t),multi:e.uiHint===`multiselect`,onRemove:n},e.field)}return e?(0,L.jsxs)(`div`,{className:`fixed inset-0 z-[100] flex items-start justify-center pt-[5vh]`,onClick:t,children:[(0,L.jsx)(`div`,{className:`absolute inset-0 bg-black/50 backdrop-blur-sm`}),(0,L.jsxs)(`div`,{className:`relative bg-background border border-border rounded-lg shadow-2xl w-full max-w-4xl max-h-[85vh] flex flex-col`,onClick:e=>e.stopPropagation(),children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3 border-b border-border`,children:[(0,L.jsx)(hl,{className:`h-5 w-5 text-muted-foreground shrink-0`}),(0,L.jsx)(`input`,{ref:A,type:`text`,value:n,onChange:e=>N(e.target.value),onKeyDown:e=>{e.key===`Escape`&&t()},placeholder:`Search documents...`,className:`flex-1 bg-transparent outline-none text-foreground placeholder:text-muted-foreground`}),o&&(0,L.jsx)(`div`,{className:`h-4 w-4 border-2 border-primary border-t-transparent rounded-full animate-spin`}),(n||i.length>0)&&(0,L.jsx)(`button`,{onClick:re,className:`text-muted-foreground hover:text-foreground`,title:`Reset search`,children:(0,L.jsx)(ml,{className:`h-4 w-4`})}),(0,L.jsx)(`button`,{onClick:t,className:`text-muted-foreground hover:text-foreground`,title:`Close (Esc)`,children:(0,L.jsx)(vl,{className:`h-5 w-5`})})]}),(0,L.jsxs)(`div`,{className:`px-4 py-2 border-b border-border flex flex-col gap-1.5`,children:[I.map(le),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(`div`,{className:`relative`,ref:k,children:[(0,L.jsxs)(`button`,{onClick:()=>{ee||ne(),E(!ee)},className:`text-xs px-2 py-0.5 rounded border border-dashed border-border text-muted-foreground hover:text-foreground hover:border-foreground transition-colors flex items-center gap-1`,children:[(0,L.jsx)(ul,{className:`h-3 w-3`}),f?`Loading filters...`:`Add filter`]}),ee&&(0,L.jsxs)(`div`,{className:`absolute top-full left-0 mt-1 z-50 bg-background border border-border rounded shadow-lg w-56 max-h-48 flex flex-col`,children:[(0,L.jsx)(`div`,{className:`p-1.5 border-b border-border`,children:(0,L.jsx)(`input`,{type:`text`,value:D,onChange:e=>O(e.target.value),placeholder:`Search filters...`,className:`text-xs w-full px-2 py-1 rounded border border-border bg-muted text-foreground placeholder:text-muted-foreground outline-none focus:border-primary`,autoFocus:!0})}),(0,L.jsxs)(`div`,{className:`overflow-y-auto flex-1`,children:[f&&(0,L.jsxs)(`div`,{className:`px-3 py-2 text-xs text-muted-foreground flex items-center gap-2`,children:[(0,L.jsx)(`div`,{className:`h-3 w-3 border-2 border-primary border-t-transparent rounded-full animate-spin`}),`Loading...`]}),!f&&ce.length===0&&(0,L.jsx)(`div`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:u.length===0?`No filters available`:`All filters active`}),ce.map(e=>(0,L.jsxs)(`button`,{onClick:()=>{P(e.field),E(!1),O(``)},className:`w-full text-left text-xs px-3 py-1.5 hover:bg-accent transition-colors flex items-center justify-between`,children:[(0,L.jsx)(`span`,{className:`text-foreground`,children:zg(e.field)}),(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.uiHint===`text`||e.uiHint===`number`?e.uiHint:`${e.values.length}`})]},e.field))]})]})]}),S.length>0&&(0,L.jsxs)(`button`,{onClick:()=>T(!w),className:`text-[10px] px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-600 border border-amber-500/30 hover:bg-amber-500/20 transition-colors`,title:`Show inference rule issues`,children:[S.length,` issue`,S.length===1?``:`s`]})]}),w&&S.length>0&&(0,L.jsxs)(`div`,{className:`mt-1 p-2 rounded border border-amber-500/30 bg-amber-500/5 text-xs max-h-32 overflow-y-auto`,children:[(0,L.jsx)(`div`,{className:`text-amber-600 font-medium mb-1`,children:`Filtered facet values (inference rule issues):`}),S.map(e=>(0,L.jsxs)(`div`,{className:`mb-1`,children:[(0,L.jsx)(`span`,{className:`text-foreground font-medium`,children:zg(e.field)}),(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:`: `}),e.removed.map((e,t)=>(0,L.jsxs)(`span`,{className:`text-amber-700`,children:[t>0&&`, `,(0,L.jsx)(`code`,{className:`bg-amber-500/10 px-0.5 rounded`,children:e})]},t))]},e.field))]})]}),(0,L.jsxs)(`div`,{className:`overflow-y-auto flex-1`,children:[c&&(0,L.jsx)(`div`,{className:`px-4 py-3 text-sm text-red-500`,children:c}),!c&&i.length===0&&n.trim()&&!o&&(0,L.jsx)(`div`,{className:`px-4 py-8 text-center text-muted-foreground text-sm`,children:`No results found`}),!c&&!n.trim()&&!o&&(0,L.jsx)(`div`,{className:`px-4 py-8 text-center text-muted-foreground text-sm`,children:`Type a query to search across all documents`}),i.map(e=>(0,L.jsx)(Kg,{result:e,facets:u,onNavigate:ie,onChipClick:ae},e.browsePath))]}),i.length>0&&(0,L.jsxs)(`div`,{className:`px-4 py-2 border-t border-border text-xs text-muted-foreground`,children:[i.length,` result`,i.length===1?``:`s`]})]})]}):null}var Jg=`https://github.com/karmaniverous/jeeves-server`;function Yg({breadcrumbs:e=[],isInsider:t,searchEnabled:n,theme:r,onToggleTheme:i,keyAge:a,onRotateKey:o,downloadDropdown:s,linkControls:c,downloadMenuItem:l,linkMenuItem:u}){let d=t&&o,[f,p]=(0,m.useState)(null),[h,g]=(0,m.useState)(!1),_=(0,m.useCallback)(e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),g(!0))},[]);(0,m.useEffect)(()=>{if(n&&t)return window.addEventListener(`keydown`,_),()=>window.removeEventListener(`keydown`,_)},[n,t,_]),(0,m.useEffect)(()=>{fetch(`/api/readme-link`).then(e=>e.ok?e.json():null).then(e=>{e?.url&&p(e.url)}).catch(()=>{})},[]);let v=[],y=`flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-accent transition-colors w-full text-left cursor-pointer`;return u&&v.push({breakpoint:`bp-400`,node:u,hasNestedDropdown:!0}),l&&v.push({breakpoint:`bp-480`,node:l,hasNestedDropdown:!0}),d&&v.push({breakpoint:`sm`,node:(0,L.jsxs)(`button`,{onClick:o,className:y,children:[(0,L.jsx)($c,{className:`h-4 w-4 shrink-0`}),`Rotate key`,a?` (${a})`:``]})}),t&&v.push({breakpoint:`md`,node:(0,L.jsxs)(mn,{to:`/runner`,className:y,children:[(0,L.jsx)(zc,{className:`h-4 w-4 shrink-0`}),`Runner`]})}),f&&v.push({breakpoint:`md`,node:(0,L.jsxs)(`a`,{href:f,className:y,children:[(0,L.jsx)(Wc,{className:`h-4 w-4 shrink-0`}),`README`]})}),v.push({breakpoint:`md`,node:(0,L.jsxs)(`a`,{href:Jg,target:`_blank`,rel:`noopener noreferrer`,className:y,children:[(0,L.jsx)(Qc,{className:`h-4 w-4 shrink-0`}),`GitHub`]})}),v.push({breakpoint:`md`,node:(0,L.jsxs)(`button`,{onClick:i,className:y,children:[r===`dark`?(0,L.jsx)(gl,{className:`h-4 w-4 shrink-0`}):(0,L.jsx)(sl,{className:`h-4 w-4 shrink-0`}),r===`dark`?`Light mode`:`Dark mode`]})}),(0,L.jsxs)(`header`,{className:`bg-zinc-800 text-white px-4 py-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center min-w-0 flex-1`,children:[(0,L.jsx)(mn,{to:`/browse`,className:`text-3xl no-underline shrink-0 mr-1`,title:`Jeeves Server`,children:`🎩`}),(0,L.jsx)(`nav`,{className:`flex items-center gap-1 min-w-0 overflow-x-auto overflow-y-hidden scrollbar-thin`,children:e.map((t,n)=>(0,L.jsxs)(`span`,{className:`flex items-center gap-1 shrink-0`,children:[(0,L.jsx)(`span`,{className:`text-zinc-500 mx-0.5`,children:`/`}),n===e.length-1?(0,L.jsx)(`span`,{className:`text-zinc-300 truncate max-w-48`,children:t.label}):(0,L.jsx)(mn,{to:`/browse/${t.path}`,className:`text-blue-400 hover:underline truncate max-w-48`,children:t.label})]},t.path))})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[n&&t&&(0,L.jsx)(Ym,{variant:`ghost`,size:`icon`,className:`text-zinc-300 hover:text-white hover:bg-white/10 h-8 w-8`,title:`Search (Ctrl+K)`,onClick:()=>g(!0),children:(0,L.jsx)(hl,{className:`h-4 w-4`})}),c&&(0,L.jsx)(`div`,{className:`hidden min-[400px]:flex items-center`,children:c}),s&&(0,L.jsx)(`div`,{className:`hidden min-[480px]:flex items-center`,children:s}),d&&(0,L.jsxs)(`div`,{className:`hidden sm:flex items-center gap-1`,children:[(0,L.jsx)(Ym,{variant:`ghost`,size:`icon`,className:`text-zinc-300 hover:text-white hover:bg-white/10 h-8 w-8`,title:`Rotate key (invalidates all your shares)`,onClick:o,children:(0,L.jsx)($c,{className:`h-4 w-4`})}),a&&(0,L.jsx)(`span`,{className:`text-xs text-zinc-500`,children:a})]}),t&&(0,L.jsx)(mn,{to:`/runner`,title:`Runner Dashboard`,className:`hidden md:inline-flex`,children:(0,L.jsx)(Ym,{variant:`ghost`,size:`icon`,className:`text-zinc-300 hover:text-white hover:bg-white/10 h-8 w-8`,children:(0,L.jsx)(zc,{className:`h-4 w-4`})})}),f&&(0,L.jsx)(`a`,{href:f,title:`README`,className:`hidden md:inline-flex`,children:(0,L.jsx)(Ym,{variant:`ghost`,size:`icon`,className:`text-zinc-300 hover:text-white hover:bg-white/10 h-8 w-8`,children:(0,L.jsx)(Wc,{className:`h-4 w-4`})})}),(0,L.jsx)(`a`,{href:Jg,target:`_blank`,rel:`noopener noreferrer`,title:`GitHub`,className:`hidden md:inline-flex`,children:(0,L.jsx)(Ym,{variant:`ghost`,size:`icon`,className:`text-zinc-300 hover:text-white hover:bg-white/10 h-8 w-8`,children:(0,L.jsx)(Qc,{className:`h-4 w-4`})})}),(0,L.jsx)(Ym,{variant:`ghost`,size:`icon`,className:`text-zinc-300 hover:text-white hover:bg-white/10 h-8 w-8 hidden md:inline-flex`,title:`Toggle theme`,onClick:i,children:r===`dark`?(0,L.jsx)(gl,{className:`h-4 w-4`}):(0,L.jsx)(sl,{className:`h-4 w-4`})}),(0,L.jsx)(Ig,{theme:r,onToggleTheme:i,collapsedItems:v})]})]}),n&&t&&(0,L.jsx)(qg,{open:h,onClose:()=>g(!1)})]})}function Xg({reqPath:e,file:t,fileRendered:n,viewTab:r,setViewTab:i,proseWidth:a,toggleProseWidth:o,isInsider:s,editing:c,setEditing:l,mobileTocOpen:u,setMobileTocOpen:d,loading:f}){if(!t&&!f)return null;let p=(n?kg(n):!1)||(t?kg(t):Ag(e)),m=p?r:`raw`;return(0,L.jsxs)(`div`,{className:`flex items-center gap-1 border-b border-border bg-background px-4 md:px-6`,children:[n?.headings&&n.headings.length>2&&(0,L.jsx)(`button`,{onClick:()=>d(!u),className:`lg:hidden p-1.5 mr-1 text-muted-foreground hover:text-foreground transition-colors`,title:`Table of contents`,children:u?(0,L.jsx)(vl,{className:`h-4 w-4`}):(0,L.jsx)(il,{className:`h-4 w-4`})}),p&&(0,L.jsx)(`button`,{onClick:()=>i(`rendered`),className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${m===`rendered`?`border-blue-500 text-blue-500`:`border-transparent text-muted-foreground hover:text-foreground`}`,children:`Rendered`}),(0,L.jsx)(`button`,{onClick:()=>i(`raw`),className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${m===`raw`?`border-blue-500 text-blue-500`:`border-transparent text-muted-foreground hover:text-foreground`}`,children:`Raw`}),t?.type===`markdown`&&m===`rendered`&&(0,L.jsx)(`div`,{className:`hidden md:flex items-center ml-2 border border-border rounded-md overflow-hidden`,children:[`narrow`,`medium`,`wide`].map(e=>(0,L.jsx)(`button`,{onClick:()=>o(e),className:`p-1.5 transition-colors ${a===e?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`}`,title:`${e.charAt(0).toUpperCase()+e.slice(1)} width`,children:e===`narrow`?(0,L.jsx)(al,{className:`h-3.5 w-3.5`}):e===`medium`?(0,L.jsx)(ol,{className:`h-3.5 w-3.5`}):(0,L.jsx)(rl,{className:`h-3.5 w-3.5`})},e))}),s&&m===`raw`&&t?.content!=null&&!c&&(0,L.jsxs)(`button`,{onClick:()=>l(!0),className:`ml-2 flex items-center gap-1 px-2 py-1 text-sm text-muted-foreground hover:text-foreground border border-border rounded transition-colors`,title:`Edit file`,children:[(0,L.jsx)(cl,{className:`h-3.5 w-3.5`}),` Edit`]})]})}function Zg(e,t){let[n,r]=(0,m.useState)(null),[i,a]=(0,m.useState)(null),[o,s]=(0,m.useState)(null),[c,l]=(0,m.useState)(null),[u,d]=(0,m.useState)(!0),[f,p]=(0,m.useState)(null),[h,g]=(0,m.useState)(!1),[_,v]=(0,m.useState)(t.get(`tab`)===`raw`?`raw`:`rendered`),y=c??o,b=(0,m.useCallback)(async(e,t)=>{if(d(!0),p(null),r(null),a(null),s(null),l(null),g(!1),v(t.get(`tab`)===`raw`?`raw`:`rendered`),e)try{let t=await Un(e);`entries`in t?(a(t),d(!1)):(Gn(e).then(e=>{s(e),d(!1)}).catch(()=>{}),Wn(e).then(l).catch(()=>{}))}catch{Gn(e).then(e=>{s(e),d(!1)}).catch(e=>{p(e.message),d(!1)}),Wn(e).then(l).catch(()=>{})}else try{r(await Hn())}catch(e){p(e.message)}finally{d(!1)}},[]);return(0,m.useEffect)(()=>{b(e,t)},[b,e]),{drives:n,directory:i,fileRaw:o,fileRendered:c,file:y,loading:u,error:f,editing:h,setEditing:g,viewTab:_,setViewTab:v,handleSave:async t=>{await Jn(e,t),s(await Gn(e));try{l(await Wn(e))}catch{}g(!1)}}}function Qg(){let e=localStorage.getItem(`jeeves-share-settings`);if(e)try{return JSON.parse(e)}catch{}return{expiry:localStorage.getItem(`jeeves-share-expiry`)??``,depth:0,dirs:!1}}function $g(){let[e,t]=(0,m.useState)(Qg);return(0,m.useEffect)(()=>{localStorage.setItem(`jeeves-share-settings`,JSON.stringify(e))},[e]),{shareSettings:e,setShareSettings:t}}function e_(e=``){let t=(0,m.useRef)(null),n=(0,m.useRef)(null),[r,i]=(0,m.useState)(96),a=(0,m.useCallback)(()=>{t.current&&i(t.current.offsetHeight)},[]);return(0,m.useEffect)(()=>(a(),window.addEventListener(`resize`,a),()=>window.removeEventListener(`resize`,a)),[a]),(0,m.useEffect)(()=>{a()},[a,e]),{topBarRef:t,mainRef:n,topBarHeight:r}}function t_(e){let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<60)return`${String(n)}m ago`;let r=Math.floor(n/60);if(r<24)return`${String(r)}h ago`;let i=Math.floor(r/24);return`${String(i)}d ago`}function n_(){let e=Xe()[`*`]??``,[t,n]=Sn(),[r,i]=s();(0,m.useEffect)(()=>{let t=`Jeeves Server`,n=e.split(`/`).filter(Boolean),r=n.length?n[n.length-1]:``,i=r?decodeURIComponent(r):``;document.title=i?`${i} - ${t}`:t},[e]);let{drives:a,directory:o,fileRaw:c,fileRendered:l,file:u,loading:d,error:f,editing:p,setEditing:h,viewTab:g,setViewTab:_,handleSave:v}=Zg(e,t),y=e=>{_(e),n(t=>{let n=new URLSearchParams(t);return e===`rendered`?n.delete(`tab`):n.set(`tab`,e),n},{replace:!0})},{shareSettings:b,setShareSettings:x}=$g(),[S,C]=(0,m.useState)(!1),[w,T]=(0,m.useState)(()=>localStorage.getItem(`jeeves-prose-width`)??`medium`),ee=e=>{T(e),localStorage.setItem(`jeeves-prose-width`,e)},{isInsider:E,searchEnabled:D,keyCreatedAt:O,rotateKey:k}=$n(),A=o?.breadcrumbs??u?.breadcrumbs??[],j=o?.isInsider??u?.isInsider??E,te=O?t_(O):null,[ne,re]=(0,m.useState)(!1),M=()=>re(!0),N=async()=>{re(!1),await k()},{topBarRef:ie,mainRef:ae,topBarHeight:oe}=e_(JSON.stringify([u,o,a]));return{reqPath:e,theme:r,toggleTheme:i,shareSettings:b,setShareSettings:x,mobileTocOpen:S,setMobileTocOpen:C,proseWidth:w,toggleProseWidth:ee,drives:a,directory:o,fileRaw:c,fileRendered:l,file:u,loading:d,error:f,editing:p,setEditing:h,viewTab:g,setViewTab:y,breadcrumbs:A,isInsider:j,searchEnabled:D,keyAge:te,rotateKeyDialogOpen:ne,setRotateKeyDialogOpen:re,handleRotateKey:M,confirmRotateKey:N,topBarRef:ie,mainRef:ae,topBarHeight:oe,handleSave:v}}function r_(){let{reqPath:e,theme:t,toggleTheme:n,shareSettings:r,setShareSettings:i,mobileTocOpen:a,setMobileTocOpen:o,proseWidth:s,toggleProseWidth:c,drives:l,directory:u,fileRaw:d,fileRendered:f,file:p,loading:m,error:h,editing:g,setEditing:_,viewTab:v,setViewTab:y,breadcrumbs:b,isInsider:x,searchEnabled:S,keyAge:C,rotateKeyDialogOpen:w,setRotateKeyDialogOpen:T,handleRotateKey:ee,confirmRotateKey:E,topBarRef:D,mainRef:O,topBarHeight:k,handleSave:A}=n_(),j=p||m&&!!e;return(0,L.jsxs)(`div`,{className:`min-h-screen bg-background text-foreground`,children:[(0,L.jsxs)(`div`,{ref:D,className:`fixed top-0 left-0 right-0 z-50`,children:[(0,L.jsx)(Yg,{breadcrumbs:b,isInsider:x,searchEnabled:S,theme:t,onToggleTheme:n,keyAge:g?void 0:C,onRotateKey:g?void 0:ee,downloadDropdown:g?void 0:p?(0,L.jsx)(th,{reqPath:e,file:p,isInsider:x,variant:`header`}):u?(0,L.jsx)(th,{reqPath:e,file:null,isDirectory:!0,isInsider:x,variant:`header`}):void 0,downloadMenuItem:g?void 0:p?(t=>(0,L.jsx)(th,{reqPath:e,file:p,isInsider:x,variant:`menuItem`,onStateChange:e=>{e===`done`&&setTimeout(t,800)}})):u?(t=>(0,L.jsx)(th,{reqPath:e,file:null,isDirectory:!0,isInsider:x,variant:`menuItem`,onStateChange:e=>{e===`done`&&setTimeout(t,800)}})):void 0,linkControls:g?void 0:x?(0,L.jsx)(ih,{path:`/${e}`,shareSettings:r,onShareSettingsChange:i,showEvent:!0,showRaw:!!p,variant:`header`,isDirectory:!p}):void 0,linkMenuItem:g?void 0:x?(t=>(0,L.jsx)(ih,{path:`/${e}`,shareSettings:r,onShareSettingsChange:i,showEvent:!0,showRaw:!!p,variant:`menuItem`,isDirectory:!p,onStateChange:e=>{e===`done`&&setTimeout(t,800)}})):void 0}),j&&(0,L.jsx)(Xg,{reqPath:e,file:p,fileRendered:f,viewTab:v,setViewTab:y,proseWidth:s,toggleProseWidth:c,isInsider:x,editing:g,setEditing:_,mobileTocOpen:a,setMobileTocOpen:o,loading:m})]}),(0,L.jsxs)(`main`,{ref:O,className:j?`px-0 pb-32 overflow-y-auto`:`p-4 pb-32 md:px-6 md:pt-6 overflow-y-auto`,style:{marginTop:`${k}px`,height:`calc(100vh - ${k}px)`},children:[m&&!e&&(0,L.jsx)(`div`,{className:`text-muted-foreground text-sm`,children:`Loading...`}),h&&(0,L.jsxs)(`div`,{className:`text-destructive text-sm`,children:[`Error: `,h]}),!m&&!h&&l&&(0,L.jsx)(ch,{drives:l,isInsider:x,shareSettings:r,onShareSettingsChange:i}),!m&&!h&&u&&(0,L.jsx)(sh,{entries:u.entries,basePath:e,isInsider:x,shareSettings:r,onShareSettingsChange:i}),!h&&j&&(0,L.jsx)(Pg,{reqPath:e,file:p,fileRaw:d,fileRendered:f,viewTab:v,editing:g,setEditing:_,proseWidth:s,topBarHeight:k,mainRef:O,mobileTocOpen:a,setMobileTocOpen:o,onSave:A,loading:m})]}),(0,L.jsx)(kc,{open:w,onOpenChange:T,title:`Rotate insider key?`,description:`This will invalidate ALL existing share links generated with your current key. This action cannot be undone.`,confirmLabel:`Rotate Key`,onConfirm:()=>void E()})]})}function i_(){let{loading:e,authenticated:t}=$n(),n=Je();return(0,m.useEffect)(()=>{!e&&t&&n(`/browse`,{replace:!0})},[e,t,n]),e?(0,L.jsx)(`div`,{className:`min-h-screen bg-background flex items-center justify-center`,children:(0,L.jsx)(`div`,{className:`text-muted-foreground text-sm`,children:`Loading...`})}):(0,L.jsx)(`div`,{className:`min-h-screen bg-background flex items-center justify-center`,children:(0,L.jsxs)(`div`,{className:`text-center space-y-6`,children:[(0,L.jsx)(`div`,{className:`text-6xl mb-2`,children:`🎩`}),(0,L.jsx)(`h1`,{className:`text-2xl font-semibold text-foreground`,children:`Jeeves`}),(0,L.jsx)(`p`,{className:`text-muted-foreground text-sm max-w-xs mx-auto`,children:`File browser and document server`}),(0,L.jsxs)(`a`,{href:`/auth/login?returnTo=/browse`,className:`inline-flex items-center gap-3 px-6 py-3 bg-white text-zinc-800 rounded-lg shadow-md hover:shadow-lg transition-shadow font-medium text-sm border border-zinc-200`,children:[(0,L.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`20`,height:`20`,className:`shrink-0`,children:[(0,L.jsx)(`path`,{fill:`#4285F4`,d:`M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z`}),(0,L.jsx)(`path`,{fill:`#34A853`,d:`M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z`}),(0,L.jsx)(`path`,{fill:`#FBBC05`,d:`M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z`}),(0,L.jsx)(`path`,{fill:`#EA4335`,d:`M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z`})]}),`Sign in with Google`]})]})})}var a_={ok:`bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400`,error:`bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400`,running:`bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400`,disabled:`bg-zinc-100 text-zinc-500 dark:bg-zinc-800 dark:text-zinc-400`,pending:`bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400`},o_=`bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300`;function s_({status:e}){let t=e??`pending`;return(0,L.jsx)(`span`,{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ${a_[t]??o_}`,children:t})}var c_={name:`w-[30%] px-3 py-2`,type:`w-[10%] px-3 py-2`,schedule:`w-[15%] px-3 py-2`,status:`w-[12%] px-3 py-2`,lastRun:`w-[25%] px-3 py-2`,action:`w-[8%] px-3 py-2`};function l_(e){if(!e)return`—`;try{return new Date(e).toLocaleString()}catch{return e}}function u_({column:e,sort:t}){return t.column===e?t.direction===`asc`?(0,L.jsx)(Uc,{className:`h-3 w-3`}):(0,L.jsx)(Bc,{className:`h-3 w-3`}):(0,L.jsx)(Hc,{className:`h-3 w-3 opacity-40`})}var d_=[{key:`name`,label:`Name`},{key:`type`,label:`Type`},{key:`schedule`,label:`Schedule`},{key:`status`,label:`Status`},{key:`lastRun`,label:`Last Run`}];function f_({sort:e,onSort:t}){return(0,L.jsx)(`div`,{className:`overflow-x-auto`,children:(0,L.jsx)(`table`,{className:`w-full text-sm`,children:(0,L.jsx)(`thead`,{children:(0,L.jsxs)(`tr`,{className:`border-b border-border text-left`,children:[d_.map(n=>(0,L.jsx)(`th`,{className:`${c_[n.key]} font-medium text-muted-foreground cursor-pointer select-none hover:text-foreground transition-colors`,onClick:()=>t(n.key),children:(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[n.label,(0,L.jsx)(u_,{column:n.key,sort:e})]})},n.key)),(0,L.jsx)(`th`,{className:`${c_.action} font-medium text-muted-foreground`})]})})})})}function p_({jobs:e,onRunNow:t}){let n=Je();return e.length===0?(0,L.jsx)(`div`,{className:`text-center py-8 text-muted-foreground`,children:`No jobs found`}):(0,L.jsx)(`div`,{className:`overflow-x-auto`,children:(0,L.jsx)(`table`,{className:`w-full text-sm`,children:(0,L.jsx)(`tbody`,{children:e.map(e=>(0,L.jsxs)(`tr`,{className:`border-b border-border hover:bg-muted/50 cursor-pointer transition-colors`,onClick:()=>n(`/runner/${e.id}`),children:[(0,L.jsx)(`td`,{className:`${c_.name} font-medium`,children:e.name}),(0,L.jsx)(`td`,{className:`${c_.type} text-muted-foreground`,children:e.type}),(0,L.jsx)(`td`,{className:`${c_.schedule} font-mono text-xs text-muted-foreground`,children:e.schedule}),(0,L.jsx)(`td`,{className:c_.status,children:(0,L.jsx)(s_,{status:e.enabled?e.status:`disabled`})}),(0,L.jsx)(`td`,{className:`${c_.lastRun} text-muted-foreground text-xs`,children:l_(e.lastRun)}),(0,L.jsx)(`td`,{className:c_.action,children:(0,L.jsx)(Ym,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,title:`Run Now`,onClick:n=>{n.stopPropagation(),t(e.id)},children:(0,L.jsx)(ll,{className:`h-3.5 w-3.5`})})})]},e.id))})})})}function m_(e,t){return[...e].sort((e,n)=>{if(t.column){let r=h_(e,n,t.column);if(r!==0)return t.direction===`asc`?r:-r}let r=g_(e.lastRun,n.lastRun);return r===0?e.name.localeCompare(n.name):-r})}function h_(e,t,n){switch(n){case`name`:return e.name.localeCompare(t.name);case`type`:return e.type.localeCompare(t.type);case`schedule`:return e.schedule.localeCompare(t.schedule);case`status`:{let n=e.enabled?e.status??``:`disabled`,r=t.enabled?t.status??``:`disabled`;return n.localeCompare(r)}case`lastRun`:return g_(e.lastRun,t.lastRun);default:return 0}}function g_(e,t){return!e&&!t?0:e?t?e<t?-1:e>t?1:0:1:-1}function __(e,t){return e.column===t?e.direction===`desc`?{column:t,direction:`asc`}:{column:null,direction:`desc`}:{column:t,direction:`desc`}}function v_({label:e,value:t,color:n}){return(0,L.jsxs)(`div`,{className:`flex flex-col items-center px-3 py-1`,children:[(0,L.jsx)(`span`,{className:`text-lg font-bold leading-tight ${n}`,children:t}),(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e})]})}function y_({stats:e}){return e?(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 px-2 py-1 bg-muted/50 rounded-lg`,children:[(0,L.jsx)(v_,{label:`Total`,value:e.totalJobs,color:`text-foreground`}),(0,L.jsx)(v_,{label:`Running`,value:e.running,color:`text-yellow-600 dark:text-yellow-400`}),(0,L.jsx)(v_,{label:`OK (1h)`,value:e.okLastHour,color:`text-green-600 dark:text-green-400`}),(0,L.jsx)(v_,{label:`Errors (1h)`,value:e.errorsLastHour,color:`text-red-600 dark:text-red-400`})]}):(0,L.jsx)(`div`,{className:`flex items-center gap-4 p-4 bg-muted/50 rounded-lg`,children:(0,L.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Loading stats...`})})}var b_=`/api/runner`;async function x_(e,t){let n=await fetch(Rn(`${b_}${e}`),{...t,credentials:`same-origin`});if(n.status===401)throw window.location.href=`/auth/login?returnTo=${encodeURIComponent(window.location.pathname)}`,Error(`Unauthorized`);if(!n.ok){let e=await n.text();throw Error(`Runner API error ${String(n.status)}: ${e}`)}return n.json()}function S_(e){return{id:e.id,name:e.name,type:e.type,schedule:e.schedule,enabled:e.enabled===1,overlapPolicy:e.overlap_policy,status:e.last_status,lastRun:e.last_run,description:e.description}}function C_(e){return{id:e.id,jobId:e.job_id,status:e.status,trigger:e.trigger,startedAt:e.started_at,finishedAt:e.finished_at,durationMs:e.duration_ms,exitCode:e.exit_code,stdoutTail:e.stdout_tail,stderrTail:e.stderr_tail}}async function w_(){return await x_(`/status`)}async function T_(){return(await x_(`/jobs`)).jobs.map(S_)}async function E_(e){return S_((await x_(`/jobs/${encodeURIComponent(e)}`)).job)}async function D_(e,t=20){return(await x_(`/jobs/${encodeURIComponent(e)}/runs?limit=${String(t)}`)).runs.map(C_)}async function O_(e){return x_(`/jobs/${encodeURIComponent(e)}/run`,{method:`POST`})}async function k_(e){return x_(`/jobs/${encodeURIComponent(e)}/enable`,{method:`POST`})}async function A_(e){return x_(`/jobs/${encodeURIComponent(e)}/disable`,{method:`POST`})}var j_=1e4;function M_(){let[e,t]=(0,m.useState)([]),[n,r]=(0,m.useState)(null),[i,a]=(0,m.useState)(null),[o,c]=(0,m.useState)(!0),[l,u]=(0,m.useState)(!0),[d,f]=(0,m.useState)({column:null,direction:`desc`}),p=(0,m.useRef)(null),[h,g]=s(),{isInsider:_,searchEnabled:v,keyCreatedAt:y,rotateKey:b}=$n(),x=y?`${Math.floor((Date.now()-new Date(y).getTime())/864e5)}d`:null,S=(0,m.useCallback)(async()=>{try{let[e,n]=await Promise.all([T_(),w_()]);t(e),r(n),a(null)}catch(e){a(e instanceof Error?e.message:`Failed to fetch runner data`)}finally{c(!1)}},[]);(0,m.useEffect)(()=>{S()},[S]),(0,m.useEffect)(()=>(l&&(p.current=setInterval(()=>void S(),j_)),()=>{p.current&&clearInterval(p.current)}),[l,S]);let C=(0,m.useCallback)(async e=>{try{await O_(e),await S()}catch{await S()}},[S]),w=(0,m.useCallback)(e=>{f(t=>__(t,e))},[]),T=(0,m.useMemo)(()=>m_(e,d),[e,d]);return(0,L.jsx)(`div`,{className:`h-screen overflow-hidden ${h===`dark`?`dark`:``}`,children:(0,L.jsxs)(`div`,{className:`h-full flex flex-col bg-background text-foreground`,children:[(0,L.jsx)(Yg,{breadcrumbs:[{label:`Runner`,path:`runner`}],isInsider:_,searchEnabled:v,theme:h,onToggleTheme:g,keyAge:x,onRotateKey:b}),(0,L.jsxs)(`div`,{className:`shrink-0 max-w-6xl mx-auto w-full px-4 pt-2 pb-1 flex items-center justify-between`,children:[!o&&(0,L.jsx)(y_,{stats:n}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,L.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:l,onChange:e=>u(e.target.checked),className:`rounded`}),`Auto-refresh`]}),(0,L.jsx)(Ym,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,title:`Refresh now`,onClick:()=>void S(),children:(0,L.jsx)(pl,{className:`h-3.5 w-3.5`})})]})]}),i&&(0,L.jsx)(`div`,{className:`shrink-0 max-w-6xl mx-auto w-full px-4 pt-2`,children:(0,L.jsx)(`div`,{className:`bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 text-red-700 dark:text-red-400 px-4 py-3 rounded-lg text-sm`,children:i})}),o?(0,L.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-muted-foreground`,children:`Loading...`}):(0,L.jsx)(`div`,{className:`flex-1 min-h-0 max-w-6xl mx-auto w-full px-4 pt-1 flex flex-col`,children:(0,L.jsxs)(`div`,{className:`flex-1 min-h-0 bg-card border border-border rounded-lg flex flex-col`,children:[(0,L.jsx)(`div`,{className:`shrink-0`,children:(0,L.jsx)(f_,{sort:d,onSort:w})}),(0,L.jsx)(`div`,{className:`flex-1 overflow-y-auto pb-32`,children:(0,L.jsx)(p_,{jobs:T,onRunNow:e=>void C(e)})})]})})]})})}function N_(e){if(e===null)return`—`;if(e<1e3)return`${String(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;let n=Math.floor(t/60),r=Math.round(t%60);return`${String(n)}m ${String(r)}s`}function P_(e){if(!e)return`—`;try{return new Date(e).toLocaleString()}catch{return e}}function F_({runs:e}){let[t,n]=(0,m.useState)(new Set),r=e=>{let t=String(e);n(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})};return e.length===0?(0,L.jsx)(`div`,{className:`text-center py-6 text-muted-foreground text-sm`,children:`No runs yet`}):(0,L.jsx)(`div`,{className:`overflow-x-auto`,children:(0,L.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,L.jsx)(`thead`,{children:(0,L.jsxs)(`tr`,{className:`border-b border-border text-left`,children:[(0,L.jsx)(`th`,{className:`px-3 py-2 w-8`}),(0,L.jsx)(`th`,{className:`px-3 py-2 font-medium text-muted-foreground`,children:`Status`}),(0,L.jsx)(`th`,{className:`px-3 py-2 font-medium text-muted-foreground`,children:`Trigger`}),(0,L.jsx)(`th`,{className:`px-3 py-2 font-medium text-muted-foreground`,children:`Started`}),(0,L.jsx)(`th`,{className:`px-3 py-2 font-medium text-muted-foreground`,children:`Duration`}),(0,L.jsx)(`th`,{className:`px-3 py-2 font-medium text-muted-foreground`,children:`Exit`})]})}),(0,L.jsx)(`tbody`,{children:e.map(e=>(0,L.jsx)(I_,{run:e,isExpanded:t.has(String(e.id)),onToggle:()=>r(e.id)},e.id))})]})})}function I_({run:e,isExpanded:t,onToggle:n}){let r=e.stdoutTail||e.stderrTail;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`tr`,{className:`border-b border-border transition-colors ${r?`cursor-pointer hover:bg-muted/50`:``}`,onClick:r?n:void 0,children:[(0,L.jsx)(`td`,{className:`px-3 py-2`,children:r&&(t?(0,L.jsx)(Kc,{className:`h-4 w-4 text-muted-foreground`}):(0,L.jsx)(qc,{className:`h-4 w-4 text-muted-foreground`}))}),(0,L.jsx)(`td`,{className:`px-3 py-2`,children:(0,L.jsx)(s_,{status:e.status})}),(0,L.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground`,children:e.trigger}),(0,L.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground text-xs`,children:P_(e.startedAt)}),(0,L.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground text-xs`,children:N_(e.durationMs)}),(0,L.jsx)(`td`,{className:`px-3 py-2 font-mono text-xs`,children:e.exitCode===null?`—`:String(e.exitCode)})]}),t&&r&&(0,L.jsx)(`tr`,{children:(0,L.jsxs)(`td`,{colSpan:6,className:`px-3 py-2 bg-muted/30`,children:[(0,L.jsx)(L_,{label:`stdout`,content:e.stdoutTail}),(0,L.jsx)(L_,{label:`stderr`,content:e.stderrTail})]})})]})}function L_({label:e,content:t}){return t?(0,L.jsxs)(`div`,{className:`mb-2 last:mb-0`,children:[(0,L.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground mb-1`,children:e}),(0,L.jsx)(`pre`,{className:`text-xs bg-zinc-900 text-zinc-200 p-2 rounded overflow-x-auto max-h-48 whitespace-pre-wrap`,children:t})]}):null}function R_(){let{jobId:e}=Xe(),[t,n]=(0,m.useState)(null),[r,i]=(0,m.useState)([]),[a,o]=(0,m.useState)(null),[c,l]=(0,m.useState)(!0),[u,d]=s(),{isInsider:f,searchEnabled:p,keyCreatedAt:h,rotateKey:g}=$n(),_=h?`${Math.floor((Date.now()-new Date(h).getTime())/864e5)}d`:null,v=(0,m.useCallback)(async()=>{if(e)try{let[t,r]=await Promise.all([E_(e),D_(e,50)]);n(t),i(r),o(null)}catch(e){o(e instanceof Error?e.message:`Failed to fetch job`)}finally{l(!1)}},[e]);(0,m.useEffect)(()=>{v()},[v]);let y=(0,m.useCallback)(async()=>{if(t)try{t.enabled?await A_(t.id):await k_(t.id),await v()}catch{await v()}},[t,v]),b=(0,m.useCallback)(async()=>{if(t)try{await O_(t.id),setTimeout(()=>void v(),500)}catch{await v()}},[t,v]),x=[{label:`Runner`,path:`runner`},{label:t?.name??e??``,path:`runner/${e}`}];return(0,L.jsx)(`div`,{className:`h-screen overflow-hidden ${u===`dark`?`dark`:``}`,children:(0,L.jsxs)(`div`,{className:`h-full flex flex-col bg-background text-foreground`,children:[(0,L.jsx)(Yg,{breadcrumbs:x,isInsider:f,searchEnabled:p,theme:u,onToggleTheme:d,keyAge:_,onRotateKey:g}),(0,L.jsxs)(`div`,{className:`flex-1 overflow-y-auto max-w-4xl mx-auto px-4 py-6 pb-32 space-y-6 w-full`,children:[(0,L.jsxs)(mn,{to:`/runner`,className:`inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors`,children:[(0,L.jsx)(Vc,{className:`h-4 w-4`}),`Back to jobs`]}),a&&(0,L.jsx)(`div`,{className:`bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 text-red-700 dark:text-red-400 px-4 py-3 rounded-lg text-sm`,children:a}),c?(0,L.jsx)(`div`,{className:`text-center py-12 text-muted-foreground`,children:`Loading...`}):t?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`bg-card border border-border rounded-lg p-4 space-y-4`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-xl font-semibold`,children:t.name}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-sm text-muted-foreground`,children:[(0,L.jsxs)(`span`,{children:[`Type: `,(0,L.jsx)(`span`,{className:`text-foreground`,children:t.type})]}),(0,L.jsxs)(`span`,{children:[`Schedule: `,(0,L.jsx)(`code`,{className:`text-xs bg-muted px-1 py-0.5 rounded`,children:t.schedule})]}),(0,L.jsxs)(`span`,{children:[`Overlap: `,(0,L.jsx)(`span`,{className:`text-foreground`,children:t.overlapPolicy})]})]})]}),(0,L.jsx)(s_,{status:t.enabled?t.status:`disabled`})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 pt-2 border-t border-border`,children:[(0,L.jsx)(Ym,{variant:`outline`,size:`sm`,onClick:()=>void y(),className:`gap-1.5`,children:t.enabled?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(dl,{className:`h-3.5 w-3.5`}),` Disable`]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(fl,{className:`h-3.5 w-3.5`}),` Enable`]})}),(0,L.jsxs)(Ym,{variant:`outline`,size:`sm`,onClick:()=>void b(),className:`gap-1.5`,children:[(0,L.jsx)(ll,{className:`h-3.5 w-3.5`}),`Run Now`]})]})]}),(0,L.jsxs)(`div`,{className:`bg-card border border-border rounded-lg overflow-hidden`,children:[(0,L.jsx)(`div`,{className:`px-4 py-3 border-b border-border`,children:(0,L.jsx)(`h2`,{className:`text-sm font-medium text-muted-foreground`,children:`Run History`})}),(0,L.jsx)(F_,{runs:r})]})]}):(0,L.jsx)(`div`,{className:`text-center py-12 text-muted-foreground`,children:`Job not found`})]})]})})}function z_(){return(0,L.jsx)(er,{children:(0,L.jsx)(dn,{children:(0,L.jsxs)(St,{children:[(0,L.jsx)(bt,{path:`/runner/:jobId`,element:(0,L.jsx)(R_,{})}),(0,L.jsx)(bt,{path:`/runner`,element:(0,L.jsx)(M_,{})}),(0,L.jsx)(bt,{path:`/browse/*`,element:(0,L.jsx)(r_,{})}),(0,L.jsx)(bt,{path:`/`,element:(0,L.jsx)(i_,{})})]})})})}(0,Nn.createRoot)(document.getElementById(`root`)).render((0,L.jsx)(m.StrictMode,{children:(0,L.jsx)(z_,{})}));export{G as n,Gc as t};
62
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return m.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},Vo=bo,Ho=wo,Uo=Eo,Wo=jo,Go=Lo,Ko=zo,qo=No,Jo=Fo;function Yo(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Yo(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Xo(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Yo(e))&&(r&&(r+=` `),r+=t);return r}var Zo=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Qo=(e,t)=>({classGroupId:e,validator:t}),$o=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),es=`-`,ts=[],ns=`arbitrary..`,rs=e=>{let t=os(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return as(e);let n=e.split(es);return is(n,n[0]===``&&n.length>1?1:0,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Zo(i,t):t:i||ts}return n[e]||ts}}},is=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=is(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(es):e.slice(t).join(es),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},as=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?ns+r:void 0})(),os=e=>{let{theme:t,classGroups:n}=e;return ss(n,t)},ss=(e,t)=>{let n=$o();for(let r in e){let i=e[r];cs(i,n,r,t)}return n},cs=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];ls(i,t,n,r)}},ls=(e,t,n,r)=>{if(typeof e==`string`){us(e,t,n);return}if(typeof e==`function`){ds(e,t,n,r);return}fs(e,t,n,r)},us=(e,t,n)=>{let r=e===``?t:ps(t,e);r.classGroupId=n},ds=(e,t,n,r)=>{if(ms(e)){cs(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Qo(n,e))},fs=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];cs(o,ps(t,a),n,r)}},ps=(e,t)=>{let n=e,r=t.split(es),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=$o(),n.nextPart.set(t,i)),n=i}return n},ms=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,hs=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},gs=`!`,_s=`:`,vs=[],ys=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),bs=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===_s){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(gs)?(c=s.slice(0,-1),l=!0):s.startsWith(gs)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return ys(t,l,c,u)};if(t){let e=t+_s,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):ys(vs,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},xs=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Ss=e=>({cache:hs(e.cacheSize),parseClassName:bs(e),sortModifiers:xs(e),...rs(e)}),Cs=/\s+/,ws=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(Cs),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+gs:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},Ts=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Es(n))&&(i&&(i+=` `),i+=r);return i},Es=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Es(e[r]))&&(n&&(n+=` `),n+=t);return n},Ds=(e,...t)=>{let n,r,i,a,o=o=>(n=Ss(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=ws(e,n);return i(e,a),a};return a=o,(...e)=>a(Ts(...e))},Os=[],ks=e=>{let t=t=>t[e]||Os;return t.isThemeGetter=!0,t},As=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,js=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ms=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ns=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ps=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Fs=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Is=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ls=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rs=e=>Ms.test(e),H=e=>!!e&&!Number.isNaN(Number(e)),zs=e=>!!e&&Number.isInteger(Number(e)),Bs=e=>e.endsWith(`%`)&&H(e.slice(0,-1)),Vs=e=>Ns.test(e),Hs=()=>!0,Us=e=>Ps.test(e)&&!Fs.test(e),Ws=()=>!1,Gs=e=>Is.test(e),Ks=e=>Ls.test(e),qs=e=>!U(e)&&!W(e),Js=e=>lc(e,pc,Ws),U=e=>As.test(e),Ys=e=>lc(e,mc,Us),Xs=e=>lc(e,hc,H),Zs=e=>lc(e,_c,Hs),Qs=e=>lc(e,gc,Ws),$s=e=>lc(e,dc,Ws),ec=e=>lc(e,fc,Ks),tc=e=>lc(e,vc,Gs),W=e=>js.test(e),nc=e=>uc(e,mc),rc=e=>uc(e,gc),ic=e=>uc(e,dc),ac=e=>uc(e,pc),oc=e=>uc(e,fc),sc=e=>uc(e,vc,!0),cc=e=>uc(e,_c,!0),lc=(e,t,n)=>{let r=As.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},uc=(e,t,n=!1)=>{let r=js.exec(e);return r?r[1]?t(r[1]):n:!1},dc=e=>e===`position`||e===`percentage`,fc=e=>e===`image`||e===`url`,pc=e=>e===`length`||e===`size`||e===`bg-size`,mc=e=>e===`length`,hc=e=>e===`number`,gc=e=>e===`family-name`,_c=e=>e===`number`||e===`weight`,vc=e=>e===`shadow`,yc=Ds(()=>{let e=ks(`color`),t=ks(`font`),n=ks(`text`),r=ks(`font-weight`),i=ks(`tracking`),a=ks(`leading`),o=ks(`breakpoint`),s=ks(`container`),c=ks(`spacing`),l=ks(`radius`),u=ks(`shadow`),d=ks(`inset-shadow`),f=ks(`text-shadow`),p=ks(`drop-shadow`),m=ks(`blur`),h=ks(`perspective`),g=ks(`aspect`),_=ks(`ease`),v=ks(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),W,U],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[W,U,c],T=()=>[Rs,`full`,`auto`,...w()],ee=()=>[zs,`none`,`subgrid`,W,U],E=()=>[`auto`,{span:[`full`,zs,W,U]},zs,W,U],D=()=>[zs,`auto`,W,U],O=()=>[`auto`,`min`,`max`,`fr`,W,U],k=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],A=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],j=()=>[`auto`,...w()],te=()=>[Rs,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ne=()=>[Rs,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],re=()=>[Rs,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],M=()=>[e,W,U],N=()=>[...b(),ic,$s,{position:[W,U]}],ie=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ae=()=>[`auto`,`cover`,`contain`,ac,Js,{size:[W,U]}],oe=()=>[Bs,nc,Ys],P=()=>[``,`none`,`full`,l,W,U],F=()=>[``,H,nc,Ys],I=()=>[`solid`,`dashed`,`dotted`,`double`],se=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ce=()=>[H,Bs,ic,$s],le=()=>[``,`none`,m,W,U],ue=()=>[`none`,H,W,U],de=()=>[`none`,H,W,U],fe=()=>[H,W,U],pe=()=>[Rs,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Vs],breakpoint:[Vs],color:[Hs],container:[Vs],"drop-shadow":[Vs],ease:[`in`,`out`,`in-out`],font:[qs],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Vs],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Vs],shadow:[Vs],spacing:[`px`,H],text:[Vs],"text-shadow":[Vs],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Rs,U,W,g]}],container:[`container`],columns:[{columns:[H,U,W,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[zs,`auto`,W,U]}],basis:[{basis:[Rs,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[H,Rs,`auto`,`initial`,`none`,U]}],grow:[{grow:[``,H,W,U]}],shrink:[{shrink:[``,H,W,U]}],order:[{order:[zs,`first`,`last`,`none`,W,U]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...k(),`normal`]}],"justify-items":[{"justify-items":[...A(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...A()]}],"align-content":[{content:[`normal`,...k()]}],"align-items":[{items:[...A(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...A(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...A(),`baseline`]}],"place-self":[{"place-self":[`auto`,...A()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:te()}],"inline-size":[{inline:[`auto`,...ne()]}],"min-inline-size":[{"min-inline":[`auto`,...ne()]}],"max-inline-size":[{"max-inline":[`none`,...ne()]}],"block-size":[{block:[`auto`,...re()]}],"min-block-size":[{"min-block":[`auto`,...re()]}],"max-block-size":[{"max-block":[`none`,...re()]}],w:[{w:[s,`screen`,...te()]}],"min-w":[{"min-w":[s,`screen`,`none`,...te()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...te()]}],h:[{h:[`screen`,`lh`,...te()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...te()]}],"max-h":[{"max-h":[`screen`,`lh`,...te()]}],"font-size":[{text:[`base`,n,nc,Ys]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,cc,Zs]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Bs,U]}],"font-family":[{font:[rc,Qs,t]}],"font-features":[{"font-features":[U]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,W,U]}],"line-clamp":[{"line-clamp":[H,`none`,W,Xs]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,W,U]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,W,U]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...I(),`wavy`]}],"text-decoration-thickness":[{decoration:[H,`from-font`,`auto`,W,Ys]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[H,`auto`,W,U]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,W,U]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,W,U]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},zs,W,U],radial:[``,W,U],conic:[zs,W,U]},oc,ec]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-bs":[{"border-bs":F()}],"border-w-be":[{"border-be":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":F()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...I(),`hidden`,`none`]}],"divide-style":[{divide:[...I(),`hidden`,`none`]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...I(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[H,W,U]}],"outline-w":[{outline:[``,H,nc,Ys]}],"outline-color":[{outline:M()}],shadow:[{shadow:[``,`none`,u,sc,tc]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":[`none`,d,sc,tc]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:F()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[H,Ys]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":[`none`,f,sc,tc]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[H,W,U]}],"mix-blend":[{"mix-blend":[...se(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[H]}],"mask-image-linear-from-pos":[{"mask-linear-from":ce()}],"mask-image-linear-to-pos":[{"mask-linear-to":ce()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":ce()}],"mask-image-t-to-pos":[{"mask-t-to":ce()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":ce()}],"mask-image-r-to-pos":[{"mask-r-to":ce()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":ce()}],"mask-image-b-to-pos":[{"mask-b-to":ce()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":ce()}],"mask-image-l-to-pos":[{"mask-l-to":ce()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":ce()}],"mask-image-x-to-pos":[{"mask-x-to":ce()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":ce()}],"mask-image-y-to-pos":[{"mask-y-to":ce()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[W,U]}],"mask-image-radial-from-pos":[{"mask-radial-from":ce()}],"mask-image-radial-to-pos":[{"mask-radial-to":ce()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[H]}],"mask-image-conic-from-pos":[{"mask-conic-from":ce()}],"mask-image-conic-to-pos":[{"mask-conic-to":ce()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,W,U]}],filter:[{filter:[``,`none`,W,U]}],blur:[{blur:le()}],brightness:[{brightness:[H,W,U]}],contrast:[{contrast:[H,W,U]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,sc,tc]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:[``,H,W,U]}],"hue-rotate":[{"hue-rotate":[H,W,U]}],invert:[{invert:[``,H,W,U]}],saturate:[{saturate:[H,W,U]}],sepia:[{sepia:[``,H,W,U]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,W,U]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[H,W,U]}],"backdrop-contrast":[{"backdrop-contrast":[H,W,U]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,H,W,U]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[H,W,U]}],"backdrop-invert":[{"backdrop-invert":[``,H,W,U]}],"backdrop-opacity":[{"backdrop-opacity":[H,W,U]}],"backdrop-saturate":[{"backdrop-saturate":[H,W,U]}],"backdrop-sepia":[{"backdrop-sepia":[``,H,W,U]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,W,U]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[H,`initial`,W,U]}],ease:[{ease:[`linear`,`initial`,_,W,U]}],delay:[{delay:[H,W,U]}],animate:[{animate:[`none`,v,W,U]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,W,U]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":[`scale-3d`],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[W,U,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:pe()}],"translate-x":[{"translate-x":pe()}],"translate-y":[{"translate-y":pe()}],"translate-z":[{"translate-z":pe()}],"translate-none":[`translate-none`],accent:[{accent:M()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,W,U]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,W,U]}],fill:[{fill:[`none`,...M()]}],"stroke-w":[{stroke:[H,nc,Ys,Xs]}],stroke:[{stroke:[`none`,...M()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function bc(...e){return yc(Xo(e))}var xc=Vo,Sc=Ho,Cc=m.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Uo,{className:bc(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));Cc.displayName=Uo.displayName;var wc=m.forwardRef(({className:e,...t},n)=>(0,L.jsxs)(Sc,{children:[(0,L.jsx)(Cc,{}),(0,L.jsx)(Wo,{ref:n,className:bc(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...t})]}));wc.displayName=Wo.displayName;var Tc=m.forwardRef(({className:e,...t},n)=>(0,L.jsx)(qo,{ref:n,className:bc(`text-lg font-semibold`,e),...t}));Tc.displayName=qo.displayName;var Ec=m.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Jo,{ref:n,className:bc(`text-sm text-muted-foreground`,e),...t}));Ec.displayName=Jo.displayName;var Dc=m.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Go,{ref:n,className:bc(`inline-flex h-10 items-center justify-center rounded-md bg-destructive px-4 py-2 text-sm font-semibold text-white ring-offset-background transition-colors hover:bg-destructive/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,e),...t}));Dc.displayName=Go.displayName;var Oc=m.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Ko,{ref:n,className:bc(`inline-flex h-10 items-center justify-center rounded-md border border-border bg-background px-4 py-2 text-sm font-semibold ring-offset-background transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,e),...t}));Oc.displayName=Ko.displayName;function kc({open:e,onOpenChange:t,title:n,description:r,confirmLabel:i=`Continue`,onConfirm:a}){return(0,L.jsx)(xc,{open:e,onOpenChange:t,children:(0,L.jsxs)(wc,{children:[(0,L.jsx)(Tc,{children:n}),(0,L.jsx)(Ec,{children:r}),(0,L.jsxs)(`div`,{className:`flex justify-end gap-2 mt-2`,children:[(0,L.jsx)(Oc,{children:`Cancel`}),(0,L.jsx)(Dc,{onClick:a,children:i})]})]})})}var Ac=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),jc=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Mc=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Nc=e=>{let t=Mc(e);return t.charAt(0).toUpperCase()+t.slice(1)},Pc={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Fc=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Ic=(0,m.createContext)({}),Lc=()=>(0,m.useContext)(Ic),Rc=(0,m.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Lc()??{},h=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,m.createElement)(`svg`,{ref:c,...Pc,width:t??l??Pc.width,height:t??l??Pc.height,stroke:e??f,strokeWidth:h,className:Ac(`lucide`,p,i),...!a&&!Fc(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,m.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),G=(e,t)=>{let n=(0,m.forwardRef)(({className:n,...r},i)=>(0,m.createElement)(Rc,{ref:i,iconNode:t,className:Ac(`lucide-${jc(Nc(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Nc(e),n},zc=G(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),Bc=G(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Vc=G(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Hc=G(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),Uc=G(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Wc=G(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),Gc=G(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Kc=G(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),qc=G(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Jc=G(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),Yc=G(`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`}]]),Xc=G(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Zc=G(`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`}]]),Qc=G(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),$c=G(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),el=G(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),tl=G(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),nl=G(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),rl=G(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),il=G(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),al=G(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),ol=G(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),sl=G(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),cl=G(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),ll=G(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),ul=G(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),dl=G(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),fl=G(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),pl=G(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),ml=G(`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`}]]),hl=G(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),gl=G(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),_l=G(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),vl=G(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function yl(e){let t=e+`CollectionProvider`,[n,r]=nr(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=m.useRef(null),a=m.useRef(new Map).current;return(0,L.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=gr(s),l=m.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,L.jsx)(c,{ref:or(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=gr(u),p=m.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=m.useRef(null),s=or(t,o),c=a(u,n);return m.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,L.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function h(t){let n=a(e+`CollectionConsumer`,t);return m.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},h,r]}var bl=m.createContext(void 0);function xl(e){let t=m.useContext(bl);return e||t||`ltr`}var Sl=[`top`,`right`,`bottom`,`left`],Cl=Math.min,wl=Math.max,Tl=Math.round,El=Math.floor,Dl=e=>({x:e,y:e}),Ol={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function kl(e,t,n){return wl(e,Cl(t,n))}function Al(e,t){return typeof e==`function`?e(t):e}function jl(e){return e.split(`-`)[0]}function Ml(e){return e.split(`-`)[1]}function Nl(e){return e===`x`?`y`:`x`}function Pl(e){return e===`y`?`height`:`width`}function Fl(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Il(e){return Nl(Fl(e))}function Ll(e,t,n){n===void 0&&(n=!1);let r=Ml(e),i=Il(e),a=Pl(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Vl(o)),[o,Vl(o)]}function Rl(e){let t=Vl(e);return[K(e),t,K(t)]}function K(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var q=[`left`,`right`],J=[`right`,`left`],Y=[`top`,`bottom`],X=[`bottom`,`top`];function zl(e,t,n){switch(e){case`top`:case`bottom`:return n?t?J:q:t?q:J;case`left`:case`right`:return t?Y:X;default:return[]}}function Bl(e,t,n,r){let i=Ml(e),a=zl(jl(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(K)))),a}function Vl(e){let t=jl(e);return Ol[t]+e.slice(t.length)}function Hl(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ul(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Hl(e)}function Wl(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 Gl(e,t,n){let{reference:r,floating:i}=e,a=Fl(t),o=Il(t),s=Pl(o),c=jl(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(Ml(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 Kl(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}=Al(t,e),p=Ul(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Wl(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=Wl(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 ql=50,Jl=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Kl},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Gl(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<ql&&(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}=Gl(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Yl=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}=Al(e,t)||{};if(l==null)return{};let d=Ul(u),f={x:n,y:r},p=Il(i),m=Pl(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,ee=Cl(d[_],T),E=Cl(d[v],T),D=ee,O=C-h[m]-E,k=C/2-h[m]/2+w,A=kl(D,k,O),j=!c.arrow&&Ml(i)!=null&&k!==A&&a.reference[m]/2-(k<D?ee:E)-h[m]/2<0,te=j?k<D?k-D:k-O:0;return{[p]:f[p]+te,data:{[p]:A,centerOffset:k-A-te,...j&&{alignmentOffset:te}},reset:j}}}),Xl=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}=Al(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=jl(r),_=Fl(o),v=jl(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Vl(o)]:Rl(o)),x=p!==`none`;!d&&x&&b.push(...Bl(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=Ll(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`&&_!==Fl(t))||T.every(e=>Fl(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=Fl(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 Zl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ql(e){return Sl.some(t=>e[t]>=0)}var $l=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Al(e,t);switch(i){case`referenceHidden`:{let e=Zl(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ql(e)}}}case`escaped`:{let e=Zl(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ql(e)}}}default:return{}}}}},eu=new Set([`left`,`top`]);async function tu(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=jl(n),s=Ml(n),c=Fl(n)===`y`,l=eu.has(o)?-1:1,u=a&&c?-1:1,d=Al(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 nu=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 tu(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}}}}},ru=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}=Al(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Fl(jl(i)),p=Nl(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=kl(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=kl(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}}}}}},iu=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}=Al(e,t),u={x:n,y:r},d=Fl(i),f=Nl(d),p=u[f],m=u[d],h=Al(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=eu.has(jl(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}}}},au=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}=Al(e,t),u=await o.detectOverflow(t,l),d=jl(i),f=Ml(i),p=Fl(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=Cl(h-u[g],v),x=Cl(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=wl(u.left,0),t=wl(u.right,0),n=wl(u.top,0),r=wl(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:wl(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:wl(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 ou(){return typeof window<`u`}function su(e){return uu(e)?(e.nodeName||``).toLowerCase():`#document`}function cu(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function lu(e){return((uu(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function uu(e){return ou()?e instanceof Node||e instanceof cu(e).Node:!1}function du(e){return ou()?e instanceof Element||e instanceof cu(e).Element:!1}function fu(e){return ou()?e instanceof HTMLElement||e instanceof cu(e).HTMLElement:!1}function pu(e){return!ou()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof cu(e).ShadowRoot}function mu(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Tu(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function hu(e){return/^(table|td|th)$/.test(su(e))}function gu(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var _u=/transform|translate|scale|rotate|perspective|filter/,vu=/paint|layout|strict|content/,yu=e=>!!e&&e!==`none`,bu;function xu(e){let t=du(e)?Tu(e):e;return yu(t.transform)||yu(t.translate)||yu(t.scale)||yu(t.rotate)||yu(t.perspective)||!Cu()&&(yu(t.backdropFilter)||yu(t.filter))||_u.test(t.willChange||``)||vu.test(t.contain||``)}function Su(e){let t=Du(e);for(;fu(t)&&!wu(t);){if(xu(t))return t;if(gu(t))return null;t=Du(t)}return null}function Cu(){return bu??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),bu}function wu(e){return/^(html|body|#document)$/.test(su(e))}function Tu(e){return cu(e).getComputedStyle(e)}function Eu(e){return du(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Du(e){if(su(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||pu(e)&&e.host||lu(e);return pu(t)?t.host:t}function Ou(e){let t=Du(e);return wu(t)?e.ownerDocument?e.ownerDocument.body:e.body:fu(t)&&mu(t)?t:Ou(t)}function ku(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ou(e),i=r===e.ownerDocument?.body,a=cu(r);if(i){let e=Au(a);return t.concat(a,a.visualViewport||[],mu(r)?r:[],e&&n?ku(e):[])}else return t.concat(r,ku(r,[],n))}function Au(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ju(e){let t=Tu(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=fu(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Tl(n)!==a||Tl(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Mu(e){return du(e)?e:e.contextElement}function Nu(e){let t=Mu(e);if(!fu(t))return Dl(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ju(t),o=(a?Tl(n.width):n.width)/r,s=(a?Tl(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Pu=Dl(0);function Fu(e){let t=cu(e);return!Cu()||!t.visualViewport?Pu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Iu(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==cu(e)?!1:t}function Lu(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Mu(e),o=Dl(1);t&&(r?du(r)&&(o=Nu(r)):o=Nu(e));let s=Iu(a,n,r)?Fu(a):Dl(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=cu(a),t=r&&du(r)?cu(r):r,n=e,i=Au(n);for(;i&&r&&t!==n;){let e=Nu(i),t=i.getBoundingClientRect(),r=Tu(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=cu(i),i=Au(n)}}return Wl({width:u,height:d,x:c,y:l})}function Ru(e,t){let n=Eu(e).scrollLeft;return t?t.left+n:Lu(lu(e)).left+n}function zu(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ru(e,n),y:n.top+t.scrollTop}}function Bu(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=lu(r),s=t?gu(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Dl(1),u=Dl(0),d=fu(r);if((d||!d&&!a)&&((su(r)!==`body`||mu(o))&&(c=Eu(r)),d)){let e=Lu(r);l=Nu(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?zu(o,c):Dl(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 Vu(e){return Array.from(e.getClientRects())}function Hu(e){let t=lu(e),n=Eu(e),r=e.ownerDocument.body,i=wl(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=wl(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Ru(e),s=-n.scrollTop;return Tu(r).direction===`rtl`&&(o+=wl(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Uu=25;function Wu(e,t){let n=cu(e),r=lu(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Cu();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Ru(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<=Uu&&(a-=o)}else l<=Uu&&(a+=l);return{width:a,height:o,x:s,y:c}}function Z(e,t){let n=Lu(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=fu(e)?Nu(e):Dl(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Gu(e,t,n){let r;if(t===`viewport`)r=Wu(e,n);else if(t===`document`)r=Hu(lu(e));else if(du(t))r=Z(t,n);else{let n=Fu(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Wl(r)}function Ku(e,t){let n=Du(e);return n===t||!du(n)||wu(n)?!1:Tu(n).position===`fixed`||Ku(n,t)}function qu(e,t){let n=t.get(e);if(n)return n;let r=ku(e,[],!1).filter(e=>du(e)&&su(e)!==`body`),i=null,a=Tu(e).position===`fixed`,o=a?Du(e):e;for(;du(o)&&!wu(o);){let t=Tu(o),n=xu(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||mu(o)&&!n&&Ku(e,o))?r=r.filter(e=>e!==o):i=t,o=Du(o)}return t.set(e,r),r}function Ju(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?gu(t)?[]:qu(t,this._c):[].concat(n),r],o=Gu(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=Gu(t,a[e],i);s=wl(n.top,s),c=Cl(n.right,c),l=Cl(n.bottom,l),u=wl(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Yu(e){let{width:t,height:n}=ju(e);return{width:t,height:n}}function Xu(e,t,n){let r=fu(t),i=lu(t),a=n===`fixed`,o=Lu(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Dl(0);function l(){c.x=Ru(i)}if(r||!r&&!a)if((su(t)!==`body`||mu(i))&&(s=Eu(t)),r){let e=Lu(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?zu(i,s):Dl(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 Zu(e){return Tu(e).position===`static`}function Qu(e,t){if(!fu(e)||Tu(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return lu(e)===n&&(n=n.ownerDocument.body),n}function $u(e,t){let n=cu(e);if(gu(e))return n;if(!fu(e)){let t=Du(e);for(;t&&!wu(t);){if(du(t)&&!Zu(t))return t;t=Du(t)}return n}let r=Qu(e,t);for(;r&&hu(r)&&Zu(r);)r=Qu(r,t);return r&&wu(r)&&Zu(r)&&!xu(r)?n:r||Su(e)||n}var ed=async function(e){let t=this.getOffsetParent||$u,n=this.getDimensions,r=await n(e.floating);return{reference:Xu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function td(e){return Tu(e).direction===`rtl`}var nd={convertOffsetParentRelativeRectToViewportRelativeRect:Bu,getDocumentElement:lu,getClippingRect:Ju,getOffsetParent:$u,getElementRects:ed,getClientRects:Vu,getDimensions:Yu,getScale:Nu,isElement:du,isRTL:td};function rd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function id(e,t){let n=null,r,i=lu(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=El(d),h=El(i.clientWidth-(u+f)),g=El(i.clientHeight-(d+p)),_=El(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:wl(0,Cl(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&&!rd(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 ad(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=Mu(e),u=i||a?[...l?ku(l):[],...t?ku(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?id(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?Lu(e):null;c&&g();function g(){let t=Lu(e);h&&!rd(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 od=nu,sd=ru,cd=Xl,ld=au,ud=$l,dd=Yl,fd=iu,pd=(e,t,n)=>{let r=new Map,i={platform:nd,...n},a={...i.platform,_c:r};return Jl(e,t,{...i,platform:a})},md=typeof document<`u`?m.useLayoutEffect:function(){};function hd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!hd(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!hd(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function gd(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _d(e,t){let n=gd(e);return Math.round(t*n)/n}function vd(e){let t=m.useRef(e);return md(()=>{t.current=e}),t}function yd(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(r);hd(f,r)||p(r);let[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=m.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=m.useRef(null),w=m.useRef(null),T=m.useRef(u),ee=c!=null,E=vd(c),D=vd(i),O=vd(l),k=m.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),pd(C.current,w.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!hd(T.current,t)&&(T.current=t,hr.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);md(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=m.useRef(!1);md(()=>(A.current=!0,()=>{A.current=!1}),[]),md(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(E.current)return E.current(x,S,k);k()}},[x,S,k,E,ee]);let j=m.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),te=m.useMemo(()=>({reference:x,floating:S}),[x,S]),ne=m.useMemo(()=>{let e={position:n,left:0,top:0};if(!te.floating)return e;let t=_d(te.floating,u.x),r=_d(te.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...gd(te.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,te.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:k,refs:j,elements:te,floatingStyles:ne}),[u,k,j,te,ne])}var Q=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:dd({element:r.current,padding:i}).fn(n):r?dd({element:r,padding:i}).fn(n):{}}}},bd=(e,t)=>{let n=od(e);return{name:n.name,fn:n.fn,options:[e,t]}},xd=(e,t)=>{let n=sd(e);return{name:n.name,fn:n.fn,options:[e,t]}},Sd=(e,t)=>({fn:fd(e).fn,options:[e,t]}),Cd=(e,t)=>{let n=cd(e);return{name:n.name,fn:n.fn,options:[e,t]}},wd=(e,t)=>{let n=ld(e);return{name:n.name,fn:n.fn,options:[e,t]}},Td=(e,t)=>{let n=ud(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ed=(e,t)=>{let n=Q(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dd=`Arrow`,Od=m.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,L.jsx)(Cr.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,L.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Od.displayName=Dd;var kd=Od;function Ad(e){let[t,n]=m.useState(void 0);return sr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var jd=`Popper`,[Md,$]=nr(jd),[Nd,Pd]=Md(jd),Fd=e=>{let{__scopePopper:t,children:n}=e,[r,i]=m.useState(null);return(0,L.jsx)(Nd,{scope:t,anchor:r,onAnchorChange:i,children:n})};Fd.displayName=jd;var Id=`PopperAnchor`,Ld=m.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Pd(Id,n),o=m.useRef(null),s=or(t,o),c=m.useRef(null);return m.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,L.jsx)(Cr.div,{...i,ref:s})});Ld.displayName=Id;var Rd=`PopperContent`,[zd,Bd]=Md(Rd),Vd=m.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:h,...g}=e,_=Pd(Rd,n),[v,y]=m.useState(null),b=or(t,e=>y(e)),[x,S]=m.useState(null),C=Ad(x),w=C?.width??0,T=C?.height??0,ee=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(Gd),altBoundary:O},{refs:A,floatingStyles:j,placement:te,isPositioned:ne,middlewareData:re}=yd({strategy:`fixed`,placement:ee,whileElementsMounted:(...e)=>ad(...e,{animationFrame:p===`always`}),elements:{reference:_.anchor},middleware:[bd({mainAxis:i+T,alignmentAxis:o}),c&&xd({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Sd():void 0,...k}),c&&Cd({...k}),wd({...k,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&Ed({element:x,padding:s}),Kd({arrowWidth:w,arrowHeight:T}),f&&Td({strategy:`referenceHidden`,...k})]}),[M,N]=qd(te),ie=Tr(h);sr(()=>{ne&&ie?.()},[ne,ie]);let ae=re.arrow?.x,oe=re.arrow?.y,P=re.arrow?.centerOffset!==0,[F,I]=m.useState();return sr(()=>{v&&I(window.getComputedStyle(v).zIndex)},[v]),(0,L.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:ne?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:F,"--radix-popper-transform-origin":[re.transformOrigin?.x,re.transformOrigin?.y].join(` `),...re.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,L.jsx)(zd,{scope:n,placedSide:M,onArrowChange:S,arrowX:ae,arrowY:oe,shouldHideArrow:P,children:(0,L.jsx)(Cr.div,{"data-side":M,"data-align":N,...g,ref:b,style:{...g.style,animation:ne?void 0:`none`}})})})});Vd.displayName=Rd;var Hd=`PopperArrow`,Ud={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Wd=m.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Bd(Hd,n),a=Ud[i.placedSide];return(0,L.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,L.jsx)(kd,{...r,ref:t,style:{...r.style,display:`block`}})})});Wd.displayName=Hd;function Gd(e){return e!==null}var Kd=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=qd(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function qd(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Jd=Fd,Yd=Ld,Xd=Vd,Zd=Wd,Qd=`rovingFocusGroup.onEntryFocus`,$d={bubbles:!1,cancelable:!0},ef=`RovingFocusGroup`,[tf,nf,rf]=yl(ef),[af,of]=nr(ef,[rf]),[sf,cf]=af(ef),lf=m.forwardRef((e,t)=>(0,L.jsx)(tf.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(tf.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(uf,{...e,ref:t})})}));lf.displayName=ef;var uf=m.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=m.useRef(null),p=or(t,f),h=xl(a),[g,_]=fr({prop:o,defaultProp:s??null,onChange:c,caller:ef}),[v,y]=m.useState(!1),b=Tr(l),x=nf(n),S=m.useRef(!1),[C,w]=m.useState(0);return m.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Qd,b),()=>e.removeEventListener(Qd,b)},[b]),(0,L.jsx)(sf,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:m.useCallback(e=>_(e),[_]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:m.useCallback(()=>w(e=>e-1),[]),children:(0,L.jsx)(Cr.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:R(e.onMouseDown,()=>{S.current=!0}),onFocus:R(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(Qd,$d);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);gf([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:R(e.onBlur,()=>y(!1))})})}),df=`RovingFocusGroupItem`,ff=m.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=ur(),l=a||c,u=cf(df,n),d=u.currentTabStopId===l,f=nf(n),{onFocusableItemAdd:p,onFocusableItemRemove:h,currentTabStopId:g}=u;return m.useEffect(()=>{if(r)return p(),()=>h()},[r,p,h]),(0,L.jsx)(tf.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,L.jsx)(Cr.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:R(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:R(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:R(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=hf(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?_f(n,r+1):n.slice(r+1)}setTimeout(()=>gf(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:g!=null}):o})})});ff.displayName=df;var pf={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function mf(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function hf(e,t,n){let r=mf(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return pf[r]}function gf(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function _f(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var vf=lf,yf=ff,bf=[`Enter`,` `],xf=[`ArrowDown`,`PageUp`,`Home`],Sf=[`ArrowUp`,`PageDown`,`End`],Cf=[...xf,...Sf],wf={ltr:[...bf,`ArrowRight`],rtl:[...bf,`ArrowLeft`]},Tf={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Ef=`Menu`,[Df,Of,kf]=yl(Ef),[Af,jf]=nr(Ef,[kf,$,of]),Mf=$(),Nf=of(),[Pf,Ff]=Af(Ef),[If,Lf]=Af(Ef),Rf=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Mf(t),[c,l]=m.useState(null),u=m.useRef(!1),d=Tr(a),f=xl(i);return m.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,L.jsx)(Jd,{...s,children:(0,L.jsx)(Pf,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,L.jsx)(If,{scope:t,onClose:m.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Rf.displayName=Ef;var zf=`MenuAnchor`,Bf=m.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Mf(n);return(0,L.jsx)(Yd,{...i,...r,ref:t})});Bf.displayName=zf;var Vf=`MenuPortal`,[Hf,Uf]=Af(Vf,{forceMount:void 0}),Wf=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Ff(Vf,t);return(0,L.jsx)(Hf,{scope:t,forceMount:n,children:(0,L.jsx)(ai,{present:n||a.open,children:(0,L.jsx)(ri,{asChild:!0,container:i,children:r})})})};Wf.displayName=Vf;var Gf=`MenuContent`,[Kf,qf]=Af(Gf),Jf=m.forwardRef((e,t)=>{let n=Uf(Gf,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ff(Gf,e.__scopeMenu),o=Lf(Gf,e.__scopeMenu);return(0,L.jsx)(Df.Provider,{scope:e.__scopeMenu,children:(0,L.jsx)(ai,{present:r||a.open,children:(0,L.jsx)(Df.Slot,{scope:e.__scopeMenu,children:o.modal?(0,L.jsx)(Yf,{...i,ref:t}):(0,L.jsx)(Xf,{...i,ref:t})})})})}),Yf=m.forwardRef((e,t)=>{let n=Ff(Gf,e.__scopeMenu),r=m.useRef(null),i=or(t,r);return m.useEffect(()=>{let e=r.current;if(e)return Oa(e)},[]),(0,L.jsx)(Qf,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:R(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Xf=m.forwardRef((e,t)=>{let n=Ff(Gf,e.__scopeMenu);return(0,L.jsx)(Qf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Zf=gr(`MenuContent.ScrollLock`),Qf=m.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:h,...g}=e,_=Ff(Gf,n),v=Lf(Gf,n),y=Mf(n),b=Nf(n),x=Of(n),[S,C]=m.useState(null),w=m.useRef(null),T=or(t,w,_.onContentChange),ee=m.useRef(0),E=m.useRef(``),D=m.useRef(0),O=m.useRef(null),k=m.useRef(`right`),A=m.useRef(0),j=h?ya:m.Fragment,te=h?{as:Zf,allowPinchZoom:!0}:void 0,ne=e=>{let t=E.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Ip(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(ee.current),t!==``&&(ee.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};m.useEffect(()=>()=>window.clearTimeout(ee.current),[]),ui();let re=m.useCallback(e=>k.current===O.current?.side&&Rp(e,O.current?.area),[]);return(0,L.jsx)(Kf,{scope:n,searchRef:E,onItemEnter:m.useCallback(e=>{re(e)&&e.preventDefault()},[re]),onItemLeave:m.useCallback(e=>{re(e)||(w.current?.focus(),C(null))},[re]),onTriggerLeave:m.useCallback(e=>{re(e)&&e.preventDefault()},[re]),pointerGraceTimerRef:D,onPointerGraceIntentChange:m.useCallback(e=>{O.current=e},[]),children:(0,L.jsx)(j,{...te,children:(0,L.jsx)(Wr,{asChild:!0,trapped:i,onMountAutoFocus:R(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,L.jsx)(Nr,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,L.jsx)(vf,{asChild:!0,...b,dir:v.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:R(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,L.jsx)(Xd,{role:`menu`,"aria-orientation":`vertical`,"data-state":jp(_.open),"data-radix-menu-content":``,dir:v.dir,...y,...g,ref:T,style:{outline:`none`,...g.style},onKeyDown:R(g.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ne(e.key));let i=w.current;if(e.target!==i||!Cf.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);Sf.includes(e.key)&&a.reverse(),Pp(a)}),onBlur:R(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(ee.current),E.current=``)}),onPointerMove:R(e.onPointerMove,zp(e=>{let t=e.target,n=A.current!==e.clientX;e.currentTarget.contains(t)&&n&&(k.current=e.clientX>A.current?`right`:`left`,A.current=e.clientX)}))})})})})})})});Jf.displayName=Gf;var $f=`MenuGroup`,ep=m.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,L.jsx)(Cr.div,{role:`group`,...r,ref:t})});ep.displayName=$f;var tp=`MenuLabel`,np=m.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,L.jsx)(Cr.div,{...r,ref:t})});np.displayName=tp;var rp=`MenuItem`,ip=`menu.itemSelect`,ap=m.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=m.useRef(null),o=Lf(rp,e.__scopeMenu),s=qf(rp,e.__scopeMenu),c=or(t,a),l=m.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(ip,{bubbles:!0,cancelable:!0});e.addEventListener(ip,e=>r?.(e),{once:!0}),wr(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,L.jsx)(op,{...i,ref:c,disabled:n,onClick:R(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:R(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:R(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||bf.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});ap.displayName=rp;var op=m.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=qf(rp,n),s=Nf(n),c=m.useRef(null),l=or(t,c),[u,d]=m.useState(!1),[f,p]=m.useState(``);return m.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,L.jsx)(Df.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,L.jsx)(yf,{asChild:!0,...s,focusable:!r,children:(0,L.jsx)(Cr.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:R(e.onPointerMove,zp(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:R(e.onPointerLeave,zp(e=>o.onItemLeave(e))),onFocus:R(e.onFocus,()=>d(!0)),onBlur:R(e.onBlur,()=>d(!1))})})})}),sp=`MenuCheckboxItem`,cp=m.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,L.jsx)(gp,{scope:e.__scopeMenu,checked:n,children:(0,L.jsx)(ap,{role:`menuitemcheckbox`,"aria-checked":Mp(n)?`mixed`:n,...i,ref:t,"data-state":Np(n),onSelect:R(i.onSelect,()=>r?.(Mp(n)?!0:!n),{checkForDefaultPrevented:!1})})})});cp.displayName=sp;var lp=`MenuRadioGroup`,[up,dp]=Af(lp,{value:void 0,onValueChange:()=>{}}),fp=m.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=Tr(r);return(0,L.jsx)(up,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,L.jsx)(ep,{...i,ref:t})})});fp.displayName=lp;var pp=`MenuRadioItem`,mp=m.forwardRef((e,t)=>{let{value:n,...r}=e,i=dp(pp,e.__scopeMenu),a=n===i.value;return(0,L.jsx)(gp,{scope:e.__scopeMenu,checked:a,children:(0,L.jsx)(ap,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":Np(a),onSelect:R(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});mp.displayName=pp;var hp=`MenuItemIndicator`,[gp,_p]=Af(hp,{checked:!1}),vp=m.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=_p(hp,n);return(0,L.jsx)(ai,{present:r||Mp(a.checked)||a.checked===!0,children:(0,L.jsx)(Cr.span,{...i,ref:t,"data-state":Np(a.checked)})})});vp.displayName=hp;var yp=`MenuSeparator`,bp=m.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,L.jsx)(Cr.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});bp.displayName=yp;var xp=`MenuArrow`,Sp=m.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Mf(n);return(0,L.jsx)(Zd,{...i,...r,ref:t})});Sp.displayName=xp;var Cp=`MenuSub`,[wp,Tp]=Af(Cp),Ep=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Ff(Cp,t),o=Mf(t),[s,c]=m.useState(null),[l,u]=m.useState(null),d=Tr(i);return m.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,L.jsx)(Jd,{...o,children:(0,L.jsx)(Pf,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,L.jsx)(wp,{scope:t,contentId:ur(),triggerId:ur(),trigger:s,onTriggerChange:c,children:n})})})};Ep.displayName=Cp;var Dp=`MenuSubTrigger`,Op=m.forwardRef((e,t)=>{let n=Ff(Dp,e.__scopeMenu),r=Lf(Dp,e.__scopeMenu),i=Tp(Dp,e.__scopeMenu),a=qf(Dp,e.__scopeMenu),o=m.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=m.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return m.useEffect(()=>u,[u]),m.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,L.jsx)(Bf,{asChild:!0,...l,children:(0,L.jsx)(op,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":jp(n.open),...e,ref:ar(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:R(e.onPointerMove,zp(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:R(e.onPointerLeave,zp(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:R(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||wf[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Op.displayName=Dp;var kp=`MenuSubContent`,Ap=m.forwardRef((e,t)=>{let n=Uf(Gf,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ff(Gf,e.__scopeMenu),o=Lf(Gf,e.__scopeMenu),s=Tp(kp,e.__scopeMenu),c=m.useRef(null),l=or(t,c);return(0,L.jsx)(Df.Provider,{scope:e.__scopeMenu,children:(0,L.jsx)(ai,{present:r||a.open,children:(0,L.jsx)(Df.Slot,{scope:e.__scopeMenu,children:(0,L.jsx)(Qf,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:R(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:R(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:R(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Tf[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});Ap.displayName=kp;function jp(e){return e?`open`:`closed`}function Mp(e){return e===`indeterminate`}function Np(e){return Mp(e)?`indeterminate`:e?`checked`:`unchecked`}function Pp(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Fp(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Ip(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Fp(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Lp(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Rp(e,t){return t?Lp({x:e.clientX,y:e.clientY},t):!1}function zp(e){return t=>t.pointerType===`mouse`?e(t):void 0}var Bp=Rf,Vp=Bf,Hp=Wf,Up=Jf,Wp=ep,Gp=np,Kp=ap,qp=cp,Jp=fp,Yp=mp,Xp=vp,Zp=bp,Qp=Sp,$p=Op,em=Ap,tm=`DropdownMenu`,[nm,rm]=nr(tm,[jf]),im=jf(),[am,om]=nm(tm),sm=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=im(t),l=m.useRef(null),[u,d]=fr({prop:i,defaultProp:a??!1,onChange:o,caller:tm});return(0,L.jsx)(am,{scope:t,triggerId:ur(),triggerRef:l,contentId:ur(),open:u,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,L.jsx)(Bp,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};sm.displayName=tm;var cm=`DropdownMenuTrigger`,lm=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=om(cm,n),o=im(n);return(0,L.jsx)(Vp,{asChild:!0,...o,children:(0,L.jsx)(Cr.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:ar(t,a.triggerRef),onPointerDown:R(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:R(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});lm.displayName=cm;var um=`DropdownMenuPortal`,dm=e=>{let{__scopeDropdownMenu:t,...n}=e,r=im(t);return(0,L.jsx)(Hp,{...r,...n})};dm.displayName=um;var fm=`DropdownMenuContent`,pm=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=om(fm,n),a=im(n),o=m.useRef(!1);return(0,L.jsx)(Up,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:R(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:R(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});pm.displayName=fm;var mm=`DropdownMenuGroup`,hm=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)(Wp,{...i,...r,ref:t})});hm.displayName=mm;var gm=`DropdownMenuLabel`,_m=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)(Gp,{...i,...r,ref:t})});_m.displayName=gm;var vm=`DropdownMenuItem`,ym=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)(Kp,{...i,...r,ref:t})});ym.displayName=vm;var bm=`DropdownMenuCheckboxItem`,xm=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)(qp,{...i,...r,ref:t})});xm.displayName=bm;var Sm=`DropdownMenuRadioGroup`,Cm=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)(Jp,{...i,...r,ref:t})});Cm.displayName=Sm;var wm=`DropdownMenuRadioItem`,Tm=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)(Yp,{...i,...r,ref:t})});Tm.displayName=wm;var Em=`DropdownMenuItemIndicator`,Dm=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)(Xp,{...i,...r,ref:t})});Dm.displayName=Em;var Om=`DropdownMenuSeparator`,km=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)(Zp,{...i,...r,ref:t})});km.displayName=Om;var Am=`DropdownMenuArrow`,jm=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)(Qp,{...i,...r,ref:t})});jm.displayName=Am;var Mm=`DropdownMenuSubTrigger`,Nm=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)($p,{...i,...r,ref:t})});Nm.displayName=Mm;var Pm=`DropdownMenuSubContent`,Fm=m.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=im(n);return(0,L.jsx)(em,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Fm.displayName=Pm;var Im=sm,Lm=lm,Rm=dm,zm=pm,Bm=_m,Vm=ym,Hm=km,Um=Im,Wm=Lm,Gm=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,L.jsx)(Rm,{children:(0,L.jsx)(zm,{ref:r,sideOffset:t,className:bc(`z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md`,`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));Gm.displayName=zm.displayName;var Km=m.forwardRef(({className:e,inset:t,...n},r)=>(0,L.jsx)(Vm,{ref:r,className:bc(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t&&`pl-8`,e),...n}));Km.displayName=Vm.displayName;var qm=m.forwardRef(({className:e,inset:t,...n},r)=>(0,L.jsx)(Bm,{ref:r,className:bc(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));qm.displayName=Bm.displayName;var Jm=m.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Hm,{ref:n,className:bc(`-mx-1 my-1 h-px bg-muted`,e),...t}));Jm.displayName=Hm.displayName;var Ym=(0,m.forwardRef)(({className:e,variant:t=`default`,size:n=`default`,...r},i)=>(0,L.jsx)(`button`,{className:bc(`inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`disabled:pointer-events-none disabled:opacity-50`,{"bg-primary text-primary-foreground hover:bg-primary/90":t===`default`,"border border-border bg-background hover:bg-accent hover:text-accent-foreground":t===`outline`,"hover:bg-accent hover:text-accent-foreground":t===`ghost`,"text-primary underline-offset-4 hover:underline":t===`link`},{"h-10 px-4 py-2":n===`default`,"h-9 rounded-md px-3":n===`sm`,"h-11 rounded-md px-8":n===`lg`,"h-10 w-10":n===`icon`},e),ref:i,...r}));Ym.displayName=`Button`;function Xm({icon:e,label:t,title:n,variant:r=`default`,compact:i,state:a,disabled:o,children:s,errorSlot:c,align:l=`end`,contentClass:u,onOpenChange:d}){let f=a??`idle`,p=r===`menuItem`,m=i?`h-3.5 w-3.5`:`h-4 w-4`,h=i?`h-7 w-7`:`h-8 w-8`,g=f===`done`?Gc:f===`error`?vl:f===`loading`?tl:e,_=f===`done`?`text-green-500`:f===`error`?`text-red-500`:``;return(0,L.jsxs)(Um,{onOpenChange:d,children:[(0,L.jsx)(Wm,{asChild:!0,children:p?(0,L.jsxs)(`button`,{className:`flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-accent transition-colors w-full text-left`,disabled:o||f===`loading`,children:[(0,L.jsx)(g,{className:`h-4 w-4 shrink-0 ${_} ${f===`loading`?`animate-spin`:``}`}),t]}):(0,L.jsx)(Ym,{variant:`ghost`,size:`icon`,className:`${h} ${_||(r===`header`?`text-zinc-300 hover:text-white hover:bg-white/10`:`text-muted-foreground hover:text-foreground`)}`,disabled:o||f===`loading`,title:n,children:(0,L.jsx)(g,{className:`${m} ${f===`loading`?`animate-spin`:``}`})})}),(0,L.jsxs)(Gm,{align:l,className:u,children:[c&&(0,L.jsxs)(L.Fragment,{children:[c,(0,L.jsx)(Jm,{})]}),s]})]})}function Zm({message:e}){return e?(0,L.jsx)(`div`,{className:`px-2 py-1.5 text-xs text-red-500 bg-red-500/10 rounded mx-1 mb-1`,children:e}):null}function Qm(e,t){let[n,r]=(0,m.useState)(`idle`),[i,a]=(0,m.useState)(null),o=e=>{r(e),t?.(e)};return{state:n,errorMsg:i,handleAction:async t=>{o(`loading`),a(null);try{await t(),o(`done`),setTimeout(()=>o(`idle`),1500)}catch(t){let n=t instanceof Error?t.message:`Action failed`;a(n),o(`error`),e?.(n)}},resetOnClose:e=>{!e&&n===`error`&&(o(`idle`),a(null))}}}function $m(e,t,n){let r=[];if(n||!t)return r.push({label:`ZIP`,href:`/api/export/${e}?format=zip`,filename:`${e.split(`/`).pop()??`archive`}.zip`}),r;let i=t.fileName.replace(/\.[^.]+$/,``);return r.push({label:`Raw`,href:`/api/raw/${e}`,filename:t.fileName}),(t.type===`markdown`||t.type===`.md`)&&(r.push({label:`PDF`,href:`/api/export/${e}?format=pdf`,filename:`${i}.pdf`}),r.push({label:`DOCX`,href:`/api/export/${e}?format=docx`,filename:`${i}.docx`})),(t.type===`mermaid`||t.type===`.mmd`)&&(r.push({label:`SVG`,href:`/api/mermaid-export/${e}?format=svg`,filename:`${i}.svg`}),r.push({label:`PNG`,href:`/api/mermaid-export/${e}?format=png`,filename:`${i}.png`}),r.push({label:`PDF`,href:`/api/mermaid-export/${e}?format=pdf`,filename:`${i}.pdf`})),(t.type===`plantuml`||[`.puml`,`.plantuml`,`.pu`].includes(t.type))&&(r.push({label:`SVG`,href:`/api/plantuml-export/${e}?format=svg`,filename:`${i}.svg`}),r.push({label:`PNG`,href:`/api/plantuml-export/${e}?format=png`,filename:`${i}.png`}),r.push({label:`PDF`,href:`/api/plantuml-export/${e}?format=pdf`,filename:`${i}.pdf`}),r.push({label:`EPS`,href:`/api/plantuml-export/${e}?format=eps`,filename:`${i}.eps`})),r}async function eh(e,t){let n=await fetch(Rn(e),{credentials:`include`});if(!n.ok){let e=await n.text().catch(()=>``);throw Error(e||`Download failed (${String(n.status)})`)}let r=await n.blob(),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}function th({reqPath:e,file:t,isDirectory:n,isInsider:r,compact:i,variant:a=`default`,onError:o,onStateChange:s}){let{state:c,errorMsg:l,handleAction:u,resetOnClose:d}=Qm(e=>{o?.(e),alert(`Download failed: ${e}`)},s),f=$m(e,t,n);return f.length===0?null:(0,L.jsxs)(Xm,{icon:Jc,label:`Download`,title:`Download`,variant:a,compact:i,state:c,onOpenChange:d,errorSlot:(0,L.jsx)(Zm,{message:l}),children:[f.map(e=>(0,L.jsx)(Km,{onSelect:()=>void u(()=>eh(e.href,e.filename)),className:`cursor-pointer`,children:e.label},e.label)),r&&!n&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Jm,{}),(0,L.jsx)(Km,{onSelect:()=>void u(async()=>{await Zn(e)}),className:`cursor-pointer text-muted-foreground`,children:`Clear Cache`})]})]})}async function nh(e,t,n,r){let i;if(t.expiry){let e=t.expiry.match(/^(\d+)([hdw])$/i);if(e){let t=parseInt(e[1],10),n=e[2].toLowerCase();i=String(Date.now()+t*{h:36e5,d:864e5,w:6048e5}[n])}}let a=!r&&t.depth>0?t.depth:void 0,o=!r&&t.dirs?!0:void 0,s=await qn(e,i,a,o);if(!s.url)throw Error(`No URL returned`);let c=window.location.origin+s.url;if(n===`raw`){let e=new URL(c);e.pathname=e.pathname.replace(`/browse/`,`/api/raw/`),c=e.toString()}else n===`event`&&(c=window.location.origin+`/event?key=`+s.url.split(`key=`)[1]);await navigator.clipboard.writeText(c)}var rh=[{label:`Never`,value:``},{label:`1 hour`,value:`1h`},{label:`24 hours`,value:`24h`},{label:`7 days`,value:`7d`},{label:`30 days`,value:`30d`}];function ih({path:e,shareSettings:t,onShareSettingsChange:n,showEvent:r,showRaw:i,compact:a,isDirectory:o,variant:s=`default`,onError:c,onStateChange:l}){let{state:u,errorMsg:d,handleAction:f,resetOnClose:p}=Qm(c,l),m=[{label:`Page`,type:`page`}];return i&&m.push({label:`Raw`,type:`raw`}),r&&m.push({label:`Event`,type:`event`}),(0,L.jsxs)(Xm,{icon:el,label:`Share`,title:`Copy share link`,variant:s,compact:a,state:u,contentClass:`w-52`,onOpenChange:p,errorSlot:(0,L.jsx)(Zm,{message:d}),children:[m.map(n=>(0,L.jsxs)(Km,{onSelect:()=>void f(()=>nh(e,t,n.type,o)),className:`cursor-pointer`,children:[`Copy `,n.label,` Link`]},n.type)),(0,L.jsx)(Jm,{}),(0,L.jsxs)(`div`,{className:`px-2 py-1 flex items-center justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap`,children:`Expires`}),(0,L.jsx)(`select`,{className:`text-xs bg-popover text-popover-foreground border border-border rounded px-1 py-0.5 focus:outline-none focus:ring-1 focus:ring-ring min-w-0`,value:t.expiry,onChange:e=>n({...t,expiry:e.target.value}),onClick:e=>e.stopPropagation(),children:rh.map(e=>(0,L.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),!o&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`px-2 py-1 flex items-center justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap`,children:`Depth`}),(0,L.jsx)(`input`,{type:`number`,min:0,max:10,className:`text-xs bg-popover text-popover-foreground border border-border rounded px-1 py-0.5 w-14 text-right focus:outline-none focus:ring-1 focus:ring-ring`,value:t.depth,onChange:e=>n({...t,depth:Math.max(0,parseInt(e.target.value,10)||0)}),onClick:e=>e.stopPropagation()})]}),(0,L.jsxs)(`div`,{className:`px-2 py-1 flex items-center justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap`,children:`Directories`}),(0,L.jsx)(`input`,{type:`checkbox`,className:`rounded border-border`,checked:t.dirs,onChange:e=>n({...t,dirs:e.target.checked}),onClick:e=>e.stopPropagation()})]})]})]})}function ah(e){if(e===null)return`-`;if(e===0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=Math.floor(Math.log(e)/Math.log(1024)),r=e/1024**n;return`${r<10?r.toFixed(1):Math.round(r)} ${t[n]}`}function oh({entry:e,basePath:t,isInsider:n,shareSettings:r,onShareSettingsChange:i}){let a=t?`${t}/${e.name}`:e.name,o=e.type===`directory`,s=!o,c=`/${a}`,l=o?`Directory`:e.ext?e.ext.slice(1).toUpperCase():`File`;return(0,L.jsxs)(`tr`,{className:`border-b border-border last:border-0 hover:bg-accent/50 transition-colors`,children:[(0,L.jsx)(`td`,{className:`px-4 py-2.5`,children:(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(mn,{to:`/browse/${a}`,className:`text-blue-500 hover:underline flex items-center gap-2 min-w-0`,children:[o?(0,L.jsx)(Zc,{className:`h-4 w-4 text-yellow-500 shrink-0`}):(0,L.jsx)(Xc,{className:`h-4 w-4 text-zinc-400 shrink-0`}),(0,L.jsx)(`span`,{className:`truncate`,children:e.name})]}),n&&(0,L.jsxs)(`div`,{className:`ml-auto flex items-center gap-0.5 shrink-0`,children:[(0,L.jsx)(ih,{path:c,shareSettings:r,onShareSettingsChange:i,showRaw:s,compact:!0,isDirectory:o}),(0,L.jsx)(th,{reqPath:a,file:o?null:{fileName:e.name,type:e.ext},isDirectory:o,isInsider:n,compact:!0})]})]})}),(0,L.jsx)(`td`,{className:`px-4 py-2.5 text-muted-foreground text-sm`,children:l}),(0,L.jsx)(`td`,{className:`px-4 py-2.5 text-muted-foreground text-sm`,children:o?e.itemCount==null?`-`:`${e.itemCount} ${e.itemCount===1?`item`:`items`}`:ah(e.size)}),(0,L.jsx)(`td`,{className:`px-4 py-2.5 text-muted-foreground text-sm`,children:e.mtime??`-`})]})}function sh({entries:e,basePath:t,isInsider:n,shareSettings:r,onShareSettingsChange:i}){return(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`p`,{className:`text-muted-foreground text-sm mb-4`,children:[e.length,` items`]}),(0,L.jsx)(`div`,{className:`bg-muted/50 rounded-lg overflow-hidden border border-border`,children:(0,L.jsxs)(`table`,{className:`w-full`,children:[(0,L.jsx)(`thead`,{children:(0,L.jsxs)(`tr`,{className:`border-b border-border`,children:[(0,L.jsx)(`th`,{className:`text-left px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:`Name`}),(0,L.jsx)(`th`,{className:`text-left px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:`Type`}),(0,L.jsx)(`th`,{className:`text-left px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:`Size`}),(0,L.jsx)(`th`,{className:`text-left px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:`Modified`})]})}),(0,L.jsx)(`tbody`,{children:e.map(e=>(0,L.jsx)(oh,{entry:e,basePath:t,isInsider:n,shareSettings:r,onShareSettingsChange:i},e.name))})]})})]})}function ch({drives:e,isInsider:t,shareSettings:n,onShareSettingsChange:r}){return(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`p`,{className:`text-muted-foreground text-sm mb-4`,children:[e.length,` drives`]}),(0,L.jsx)(`div`,{className:`bg-muted/50 rounded-lg overflow-hidden border border-border`,children:(0,L.jsxs)(`table`,{className:`w-full`,children:[(0,L.jsx)(`thead`,{children:(0,L.jsxs)(`tr`,{className:`border-b border-border`,children:[(0,L.jsx)(`th`,{className:`text-left px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:`Name`}),(0,L.jsx)(`th`,{className:`text-left px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:`Type`})]})}),(0,L.jsx)(`tbody`,{children:e.map(e=>{let i=`/${e.letter.toLowerCase()}`;return(0,L.jsxs)(`tr`,{className:`border-b border-border last:border-0 hover:bg-accent/50 transition-colors`,children:[(0,L.jsx)(`td`,{className:`px-4 py-2.5`,children:(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(mn,{to:`/browse/${e.letter.toLowerCase()}`,className:`text-blue-500 hover:underline flex items-center gap-2 min-w-0`,children:[`💾 `,e.letter,`:\\`,e.label?` (${e.label})`:``]}),t&&(0,L.jsx)(`div`,{className:`ml-auto flex items-center gap-0.5 shrink-0`,children:(0,L.jsx)(ih,{path:i,shareSettings:n,onShareSettingsChange:r,compact:!0,isDirectory:!0})})]})}),(0,L.jsx)(`td`,{className:`px-4 py-2.5 text-muted-foreground text-sm`,children:`Drive`})]},e.letter)})})]})})]})}var lh=function(){return lh=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},lh.apply(this,arguments)};typeof window<`u`&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window.CustomEvent!=`function`&&(window.CustomEvent=function(e,t){t||={bubbles:!1,cancelable:!1,detail:null};var n=document.createEvent(`CustomEvent`);return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}));var uh=typeof document<`u`&&!!document.documentMode,dh;function fh(){return dh||=document.createElement(`div`).style}var ph=[`webkit`,`moz`,`ms`],mh={};function hh(e){if(mh[e])return mh[e];var t=fh();if(e in t)return mh[e]=e;for(var n=e[0].toUpperCase()+e.slice(1),r=ph.length;r--;){var i=`${ph[r]}${n}`;if(i in t)return mh[e]=i}}function gh(e,t){return parseFloat(t[hh(e)])||0}function _h(e,t,n){n===void 0&&(n=window.getComputedStyle(e));var r=t===`border`?`Width`:``;return{left:gh(`${t}Left${r}`,n),right:gh(`${t}Right${r}`,n),top:gh(`${t}Top${r}`,n),bottom:gh(`${t}Bottom${r}`,n)}}function vh(e,t,n){e.style[hh(t)]=n}function yh(e,t){vh(e,`transition`,`${hh(`transform`)} ${t.duration}ms ${t.easing}`)}function bh(e,t,n){var r=t.x,i=t.y,a=t.scale,o=t.isSVG;if(vh(e,`transform`,`scale(${a}) translate(${r}px, ${i}px)`),o&&uh){var s=window.getComputedStyle(e).getPropertyValue(`transform`);e.setAttribute(`transform`,s)}}function xh(e){var t=e.parentNode,n=window.getComputedStyle(e),r=window.getComputedStyle(t),i=e.getBoundingClientRect(),a=t.getBoundingClientRect();return{elem:{style:n,width:i.width,height:i.height,top:i.top,bottom:i.bottom,left:i.left,right:i.right,margin:_h(e,`margin`,n),border:_h(e,`border`,n)},parent:{style:r,width:a.width,height:a.height,top:a.top,bottom:a.bottom,left:a.left,right:a.right,padding:_h(t,`padding`,r),border:_h(t,`border`,r)}}}var Sh={down:`mousedown`,move:`mousemove`,up:`mouseup mouseleave`};typeof window<`u`&&(typeof window.PointerEvent==`function`?Sh={down:`pointerdown`,move:`pointermove`,up:`pointerup pointerleave pointercancel`}:typeof window.TouchEvent==`function`&&(Sh={down:`touchstart`,move:`touchmove`,up:`touchend touchcancel`}));function Ch(e,t,n,r){Sh[e].split(` `).forEach(function(e){t.addEventListener(e,n,r)})}function wh(e,t,n){Sh[e].split(` `).forEach(function(e){t.removeEventListener(e,n)})}function Th(e,t){for(var n=e.length;n--;)if(e[n].pointerId===t.pointerId)return n;return-1}function Eh(e,t){var n;if(t.touches){n=0;for(var r=0,i=t.touches;r<i.length;r++){var a=i[r];a.pointerId=n++,Eh(e,a)}return}n=Th(e,t),n>-1&&e.splice(n,1),e.push(t)}function Dh(e,t){if(t.touches){for(;e.length;)e.pop();return}var n=Th(e,t);n>-1&&e.splice(n,1)}function Oh(e){e=e.slice(0);for(var t=e.pop(),n;n=e.pop();)t={clientX:(n.clientX-t.clientX)/2+t.clientX,clientY:(n.clientY-t.clientY)/2+t.clientY};return t}function kh(e){if(e.length<2)return 0;var t=e[0],n=e[1];return Math.sqrt(Math.abs(n.clientX-t.clientX)**2+Math.abs(n.clientY-t.clientY)**2)}function Ah(e){for(var t=e;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1}function jh(e){return(e.getAttribute(`class`)||``).trim()}function Mh(e,t){return e.nodeType===1&&` ${jh(e)} `.indexOf(` ${t} `)>-1}function Nh(e,t){for(var n=e;n!=null;n=n.parentNode)if(Mh(n,t.excludeClass)||t.exclude.indexOf(n)>-1)return!0;return!1}var Ph=/^http:[\w\.\/]+svg$/;function Fh(e){return Ph.test(e.namespaceURI)&&e.nodeName.toLowerCase()!==`svg`}function Ih(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var Lh={animate:!1,canvas:!1,cursor:`move`,disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:`ease-in-out`,exclude:[],excludeClass:`panzoom-exclude`,handleStartEvent:function(e){e.preventDefault(),e.stopPropagation()},maxScale:4,minScale:.125,overflow:`hidden`,panOnlyWhenZoomed:!1,pinchAndPan:!1,relative:!1,setTransform:bh,startX:0,startY:0,startScale:1,step:.3,touchAction:`none`};function Rh(e,t){if(!e)throw Error(`Panzoom requires an element as an argument`);if(e.nodeType!==1)throw Error(`Panzoom requires an element with a nodeType of 1`);if(!Ah(e))throw Error(`Panzoom should be called on elements that have been attached to the DOM`);t=lh(lh({},Lh),t);var n=Fh(e),r=e.parentNode;r.style.overflow=t.overflow,r.style.userSelect=`none`,r.style.touchAction=t.touchAction,(t.canvas?r:e).style.cursor=t.cursor,e.style.userSelect=`none`,e.style.touchAction=t.touchAction,vh(e,`transformOrigin`,typeof t.origin==`string`?t.origin:n?`0 0`:`50% 50%`);function i(){r.style.overflow=``,r.style.userSelect=``,r.style.touchAction=``,r.style.cursor=``,e.style.cursor=``,e.style.userSelect=``,e.style.touchAction=``,vh(e,`transformOrigin`,``)}function a(n){for(var i in n===void 0&&(n={}),n)n.hasOwnProperty(i)&&(t[i]=n[i]);(n.hasOwnProperty(`cursor`)||n.hasOwnProperty(`canvas`))&&(r.style.cursor=e.style.cursor=``,(t.canvas?r:e).style.cursor=t.cursor),n.hasOwnProperty(`overflow`)&&(r.style.overflow=n.overflow),n.hasOwnProperty(`touchAction`)&&(r.style.touchAction=n.touchAction,e.style.touchAction=n.touchAction)}var o=0,s=0,c=1,l=!1;h(t.startScale,{animate:!1,force:!0}),setTimeout(function(){m(t.startX,t.startY,{animate:!1,force:!0})});function u(t,n,r){if(!r.silent){var i=new CustomEvent(t,{detail:n});e.dispatchEvent(i)}}function d(t,r,i){var a={x:o,y:s,scale:c,isSVG:n,originalEvent:i};return requestAnimationFrame(function(){typeof r.animate==`boolean`&&(r.animate?yh(e,r):vh(e,`transition`,`none`)),r.setTransform(e,a,r),u(t,a,r),u(`panzoomchange`,a,r)}),a}function f(n,r,i,a){var l=lh(lh({},t),a),u={x:o,y:s,opts:l};if(!a?.force&&(l.disablePan||l.panOnlyWhenZoomed&&c===l.startScale))return u;if(n=parseFloat(n),r=parseFloat(r),l.disableXAxis||(u.x=(l.relative?o:0)+n),l.disableYAxis||(u.y=(l.relative?s:0)+r),l.contain){var d=xh(e),f=d.elem.width/c,p=d.elem.height/c,m=f*i,h=p*i,g=(m-f)/2,_=(h-p)/2;if(l.contain===`inside`){var v=(-d.elem.margin.left-d.parent.padding.left+g)/i,y=(d.parent.width-m-d.parent.padding.left-d.elem.margin.left-d.parent.border.left-d.parent.border.right+g)/i;u.x=Math.max(Math.min(u.x,y),v);var b=(-d.elem.margin.top-d.parent.padding.top+_)/i,x=(d.parent.height-h-d.parent.padding.top-d.elem.margin.top-d.parent.border.top-d.parent.border.bottom+_)/i;u.y=Math.max(Math.min(u.y,x),b)}else if(l.contain===`outside`){var v=(-(m-d.parent.width)-d.parent.padding.left-d.parent.border.left-d.parent.border.right+g)/i,y=(g-d.parent.padding.left)/i;u.x=Math.max(Math.min(u.x,y),v);var b=(-(h-d.parent.height)-d.parent.padding.top-d.parent.border.top-d.parent.border.bottom+_)/i,x=(_-d.parent.padding.top)/i;u.y=Math.max(Math.min(u.y,x),b)}}return l.roundPixels&&(u.x=Math.round(u.x),u.y=Math.round(u.y)),u}function p(n,r){var i=lh(lh({},t),r),a={scale:c,opts:i};if(!r?.force&&i.disableZoom)return a;var o=t.minScale,s=t.maxScale;if(i.contain){var l=xh(e),u=l.elem.width/c,d=l.elem.height/c;if(u>1&&d>1){var f=l.parent.width-l.parent.border.left-l.parent.border.right,p=l.parent.height-l.parent.border.top-l.parent.border.bottom,m=f/u,h=p/d;t.contain===`inside`?s=Math.min(s,m,h):t.contain===`outside`&&(o=Math.max(o,m,h))}}return a.scale=Math.min(Math.max(n,o),s),a}function m(e,t,r,i){var a=f(e,t,c,r);return o!==a.x||s!==a.y?(o=a.x,s=a.y,d(`panzoompan`,a.opts,i)):{x:o,y:s,scale:c,isSVG:n,originalEvent:i}}function h(e,t,n){var r=p(e,t),i=r.opts;if(!(!t?.force&&i.disableZoom)){e=r.scale;var a=o,l=s;if(i.focal){var u=i.focal;a=(u.x/e-u.x/c+o*e)/e,l=(u.y/e-u.y/c+s*e)/e}var m=f(a,l,e,{relative:!1,force:!0});return o=m.x,s=m.y,c=e,d(`panzoomzoom`,i,n)}}function g(e,n){var r=lh(lh(lh({},t),{animate:!0}),n);return h(c*Math.exp((e?1:-1)*r.step),r)}function _(e){return g(!0,e)}function v(e){return g(!1,e)}function y(t,r,i,a){var o=xh(e),s={width:o.parent.width-o.parent.padding.left-o.parent.padding.right-o.parent.border.left-o.parent.border.right,height:o.parent.height-o.parent.padding.top-o.parent.padding.bottom-o.parent.border.top-o.parent.border.bottom},l=r.clientX-o.parent.left-o.parent.padding.left-o.parent.border.left-o.elem.margin.left,u=r.clientY-o.parent.top-o.parent.padding.top-o.parent.border.top-o.elem.margin.top;n||(l-=o.elem.width/c/2,u-=o.elem.height/c/2);var d={x:l/s.width*(s.width*t),y:u/s.height*(s.height*t)};return h(t,lh(lh({},i),{animate:!1,focal:d}),a)}function b(e,n){e.preventDefault();var r=lh(lh(lh({},t),n),{animate:!1}),i=(e.deltaY===0&&e.deltaX?e.deltaX:e.deltaY)<0?1:-1,a=p(c*Math.exp(i*r.step/3),r).scale;return y(a,e,r,e)}function x(e){var n=lh(lh(lh({},t),{animate:!0,force:!0}),e);c=p(n.startScale,n).scale;var r=f(n.startX,n.startY,c,n);return o=r.x,s=r.y,d(`panzoomreset`,n)}var S,C,w,T,ee,E,D=[];function O(e){if(!Nh(e.target,t)){Eh(D,e),l=!0,t.handleStartEvent(e),S=o,C=s,u(`panzoomstart`,{x:o,y:s,scale:c,isSVG:n,originalEvent:e},t);var r=Oh(D);w=r.clientX,T=r.clientY,ee=c,E=kh(D)}}function k(e){if(!(!l||S===void 0||C===void 0||w===void 0||T===void 0)){Eh(D,e);var n=Oh(D),r=D.length>1,i=c;r&&(E===0&&(E=kh(D)),i=p((kh(D)-E)*t.step/80+ee).scale,y(i,n,{animate:!1},e)),(!r||t.pinchAndPan)&&m(S+(n.clientX-w)/i,C+(n.clientY-T)/i,{animate:!1},e)}}function A(e){D.length===1&&u(`panzoomend`,{x:o,y:s,scale:c,isSVG:n,originalEvent:e},t),Dh(D,e),l&&(l=!1,S=C=w=T=void 0)}var j=!1;function te(){j||(j=!0,Ch(`down`,t.canvas?r:e,O),Ch(`move`,document,k,{passive:!0}),Ch(`up`,document,A,{passive:!0}))}function ne(){j=!1,wh(`down`,t.canvas?r:e,O),wh(`move`,document,k),wh(`up`,document,A)}return t.noBind||te(),{bind:te,destroy:ne,eventNames:Sh,getPan:function(){return{x:o,y:s}},getScale:function(){return c},getOptions:function(){return Ih(t)},handleDown:O,handleMove:k,handleUp:A,pan:m,reset:x,resetStyle:i,setOptions:a,setStyle:function(t,n){return vh(e,t,n)},zoom:h,zoomIn:_,zoomOut:v,zoomToPoint:y,zoomWithWheel:b}}Rh.defaultOptions=Lh;function zh(e){let t=new DOMParser().parseFromString(e,`image/svg+xml`),n=t.querySelector(`svg`);if(!n)return e;let r=0,i=0,a=n.getAttribute(`viewBox`);if(a){let e=a.split(/[\s,]+/).map(Number);e.length===4&&(r=e[2],i=e[3])}return(r<=0||i<=0)&&(r=parseFloat(n.getAttribute(`width`)??`0`),i=parseFloat(n.getAttribute(`height`)??`0`)),!n.getAttribute(`viewBox`)&&r>0&&i>0&&n.setAttribute(`viewBox`,`0 0 ${r} ${i}`),n.getAttribute(`preserveAspectRatio`)===`none`&&n.setAttribute(`preserveAspectRatio`,`xMidYMid meet`),n.removeAttribute(`height`),n.style.removeProperty(`width`),n.style.removeProperty(`height`),n.style.removeProperty(`background`),n.setAttribute(`width`,`100%`),new XMLSerializer().serializeToString(t)}function Bh(e){let t=zh(e),n=new DOMParser().parseFromString(t,`image/svg+xml`),r=n.querySelector(`svg`);return r?(r.setAttribute(`preserveAspectRatio`,`xMidYMid meet`),r.setAttribute(`height`,`100%`),r.style.display=`block`,new XMLSerializer().serializeToString(n)):t}function Vh({content:e}){let t=(0,m.useRef)(null),n=(0,m.useRef)(null),r=(0,m.useRef)(null),i=(0,m.useRef)(null),[a,o]=(0,m.useState)(!1),s=(0,m.useMemo)(()=>Bh(e),[e]),c=(0,m.useCallback)(()=>{if(i.current?.(),i.current=null,r.current&&=(r.current.destroy(),null),!n.current||!t.current)return;let e=t.current,a=n.current,s=e.clientWidth,c=e.clientHeight;if(s===0||c===0)return;a.style.width=`${s}px`,a.style.height=`${c}px`;let l=Rh(a,{maxScale:20,minScale:.1,startScale:1});r.current=l;let u=e=>{l.zoomWithWheel(e)};e.addEventListener(`wheel`,u,{passive:!1}),i.current=()=>e.removeEventListener(`wheel`,u),o(!0)},[]);return(0,m.useEffect)(()=>{let e=t.current;if(!e)return;let n=new ResizeObserver(()=>{c()});return n.observe(e),()=>{n.disconnect(),i.current?.(),r.current?.destroy()}},[s,c]),(0,L.jsx)(`div`,{className:`relative bg-white rounded-lg border border-border overflow-hidden`,children:(0,L.jsx)(`div`,{ref:t,className:`overflow-hidden cursor-grab active:cursor-grabbing w-full h-[calc(100vh-8rem)]`,children:(0,L.jsx)(`div`,{ref:n,className:a?``:`invisible`,dangerouslySetInnerHTML:{__html:s}})})})}function Hh({html:e,content:t}){return e?(0,L.jsx)(Vh,{content:e}):(0,L.jsxs)(`div`,{className:`p-4 bg-red-950/20 border border-red-800 rounded-lg`,children:[(0,L.jsx)(`div`,{className:`text-red-400 text-sm font-medium mb-2`,children:`Mermaid render failed`}),(0,L.jsx)(`pre`,{className:`text-red-300 text-xs overflow-x-auto`,children:t})]})}function Uh({html:e,content:t}){return e?(0,L.jsx)(Vh,{content:e}):(0,L.jsxs)(`div`,{className:`p-4 bg-red-950/20 border border-red-800 rounded-lg`,children:[(0,L.jsx)(`div`,{className:`text-red-400 text-sm font-medium mb-2`,children:`PlantUML render failed`}),(0,L.jsx)(`pre`,{className:`text-red-300 text-xs overflow-x-auto`,children:t})]})}var Wh={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},Gh=([e,t,n])=>{let r=document.createElementNS(`http://www.w3.org/2000/svg`,e);return Object.keys(t).forEach(e=>{r.setAttribute(e,String(t[e]))}),n?.length&&n.forEach(e=>{let t=Gh(e);r.appendChild(t)}),r},Kh=(e,t={})=>Gh([`svg`,{...Wh,...t},e]),qh=[[`path`,{d:`M20 6 9 17l-5-5`}]],Jh=[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}]],Yh=[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`}]],Xh=[[`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`}],[`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`}],[`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`}],[`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`}]],Zh=`relative bg-white rounded-lg border border-border overflow-hidden my-4`,Qh=`fixed inset-0 z-[100] bg-white flex flex-col`,$h=`overflow-hidden w-full`,eg=`overflow-hidden w-full h-full flex-1`,tg=`flex items-center justify-center p-4 [&>svg]:max-w-full [&>svg]:h-auto`,ng=`p-4`,rg=`absolute top-2 right-2 z-10 p-1.5 bg-zinc-800/70 hover:bg-zinc-700 text-white rounded transition-colors`,ig=`text-xs text-muted-foreground text-center py-1 opacity-60`,ag=`text-muted-foreground text-xs text-center py-2 pointer-events-none`,og=`Scroll to zoom · Drag to pan`,sg=`Scroll to zoom · Drag to pan · Esc to close`;function cg(e){return Kh(e,{size:16})}function lg(e,t){e.innerHTML=``,e.appendChild(cg(t))}function ug(e){let t=e.getAttribute(`viewBox`);if(t){let e=t.split(/[\s,]+/).map(Number);if(e[2]&&e[3])return{w:e[2],h:e[3]}}return{w:e.clientWidth||1e3,h:e.clientHeight||800}}function dg(e,t,n,r){let i=Math.min(n/e,r/t,1),a=e*i,o=t*i;return{fitScale:i,fittedW:a,fittedH:o,startX:(n-a)/2,startY:(r-o)/2}}function fg(e,t,n){let r=n?.wrapperExtraClass?`${n.wrapperExtraClass} ${Zh}`:Zh,i=document.createElement(`div`);i.className=r,i.style.cursor=`grab`;let a=document.createElement(`div`);a.className=$h,n?.viewportMinHeight&&(a.style.minHeight=n.viewportMinHeight);let o=document.createElement(`div`);o.className=tg,o.appendChild(e),a.appendChild(o);let s=document.createElement(`button`);s.className=rg,s.title=`Fullscreen`,lg(s,Yh);let c=document.createElement(`div`);c.className=ig,c.textContent=og,i.appendChild(a),i.appendChild(s),i.appendChild(c);let l=null,u=e=>{l?.zoomWithWheel(e)};a.addEventListener(`wheel`,u,{passive:!1});let d=()=>{l||=Rh(o,{maxScale:20,contain:`outside`})},f=!1,p=()=>{f=!0,i.dataset.origClass=i.className,i.className=Qh,i.style.cursor=`grab`,a.className=eg,n?.viewportMinHeight&&(a.style.minHeight=``),o.className=ng,c.textContent=sg,c.className=ag,s.title=`Exit fullscreen`,lg(s,Xh),l?.destroy(),l=null,requestAnimationFrame(()=>{requestAnimationFrame(()=>{setTimeout(()=>{let e=o.querySelector(`svg`);if(e&&a.clientWidth&&a.clientHeight){let{w:t,h:n}=ug(e),{fitScale:r,fittedW:i,fittedH:s,startX:c,startY:u}=dg(t,n,a.clientWidth,a.clientHeight);e.setAttribute(`width`,String(Math.round(i))),e.setAttribute(`height`,String(Math.round(s))),e.style.width=`${String(Math.round(i))}px`,e.style.height=`${String(Math.round(s))}px`,l=Rh(o,{maxScale:20/r,minScale:.5,startScale:1,startX:c,startY:u})}else l=Rh(o,{maxScale:20,minScale:.1})},50)})})},m=()=>{f=!1;let e=o.querySelector(`svg`);e&&(e.setAttribute(`width`,`100%`),e.removeAttribute(`height`),e.style.width=``,e.style.height=``),i.className=i.dataset.origClass??r,i.style.cursor=`grab`,a.className=$h,n?.viewportMinHeight&&(a.style.minHeight=n.viewportMinHeight),o.className=tg,c.textContent=og,c.className=ig,s.title=`Fullscreen`,lg(s,Yh),l?.destroy(),l=Rh(o,{maxScale:20,contain:`outside`,startScale:1})};s.addEventListener(`click`,()=>{f?m():p()});let h=e=>{e.key===`Escape`&&f&&m()};return document.addEventListener(`keydown`,h),{wrapper:i,initPanzoom:d,enterFullscreen:p,exitFullscreen:m,cleanup:()=>{a.removeEventListener(`wheel`,u),document.removeEventListener(`keydown`,h),l?.destroy()}}}function pg(e){let t=[],n=e.querySelectorAll(`.embedded-diagram-rendered`);for(let e of n){let n=e.querySelector(`svg`);if(!n)continue;let{wrapper:r,initPanzoom:i,cleanup:a}=fg(n,e,{wrapperExtraClass:`embedded-diagram-panzoom`});e.replaceWith(r),i(),t.push(a)}return()=>{for(let e of t)e()}}function mg(e){let t=[],n=e.querySelectorAll(`.embedded-diagram-lazy`);if(n.length===0)return()=>{};for(let e of n)e.innerHTML=`<div class="embedded-diagram-loading"><div class="diagram-spinner"></div><span>Rendering ${e.dataset.diagramType??`diagram`} diagram…</span></div>`,hg(e,t);return()=>{for(let e of t)e()}}async function hg(e,t){let n=e.dataset.diagramType,r=e.dataset.diagramHash;if(!(!n||!r))try{let i=Rn(`/api/diagram/${n}/${r}.svg`),a=await fetch(i);if(!a.ok){let e=await a.json().catch(()=>({error:`Render failed`}));throw Error(e.error??`HTTP ${String(a.status)}`)}let o=zh(await a.text()),s=document.createElement(`div`);s.className=`embedded-diagram-rendered`,s.dataset.type=n,s.innerHTML=o;let c=s.querySelector(`svg`);if(!c){e.replaceWith(s);return}let{wrapper:l,initPanzoom:u,cleanup:d}=fg(c,s,{wrapperExtraClass:`embedded-diagram-panzoom`});e.replaceWith(l),u(),t.push(d)}catch(r){let i=r instanceof Error?r.message:`Unknown error`,a=n?n.charAt(0).toUpperCase()+n.slice(1):`Diagram`,o=Number(e.dataset.retryCount??`0`),s=o>0?`<div class="diagram-reload-hint">Still failing? Try reloading the page — the diagram source may have changed.</div>`:``;e.innerHTML=`<div class="embedded-diagram-error" data-type="${n}"><div class="diagram-error-label">${a} render failed: ${gg(i)}</div>${s}<button class="diagram-retry-btn">Retry</button></div>`,e.querySelector(`.diagram-retry-btn`)?.addEventListener(`click`,()=>{e.dataset.retryCount=String(o+1),e.innerHTML=`<div class="embedded-diagram-loading"><div class="diagram-spinner"></div><span>Rendering ${n} diagram…</span></div>`,hg(e,t)})}}function gg(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function _g(e){let t=[],n=Array.from(e.querySelectorAll(`img`)).filter(e=>/\.svg(\?|&|$)/i.test(e.getAttribute(`src`)??``));for(let e of n){let n=e.getAttribute(`src`);if(!n)continue;let r=n.includes(`raw=1`)?n:n.includes(`?`)?`${n}&raw=1`:`${n}?raw=1`,i=document.createElement(`div`);i.className=`inline-svg-panzoom relative bg-white rounded-lg border border-border overflow-hidden my-4`,i.style.cursor=`grab`,i.innerHTML=`<div class="overflow-hidden w-full min-h-[200px]"><div class="flex items-center justify-center p-4">Loading SVG…</div></div>`,e.parentElement?.replaceChild(i,e),fetch(Rn(r)).then(e=>{if(!e.ok)throw Error(`Failed to fetch SVG: ${String(e.status)}`);return e.text()}).then(e=>{let n=document.createElement(`div`);n.innerHTML=e;let r=n.querySelector(`svg`);if(!r)throw Error(`No SVG element found`);let{wrapper:a,initPanzoom:o,cleanup:s}=fg(r,i,{wrapperExtraClass:`inline-svg-panzoom`,viewportMinHeight:`200px`});i.replaceWith(a),o(),t.push(s)}).catch(()=>{i.replaceWith(e)})}return()=>{for(let e of t)e()}}function vg({node:e,collapsed:t,toggleCollapse:n,activeSlug:r,scrollTo:i}){let a=e.children.length>0,o=t.has(e.heading.slug),s=r===e.heading.slug;return(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`flex items-center`,children:[a?(0,L.jsx)(`button`,{type:`button`,onClick:()=>n(e.heading.slug),className:`w-4 h-4 flex items-center justify-center text-muted-foreground shrink-0`,children:(0,L.jsx)(qc,{className:`h-3 w-3 transition-transform ${o?``:`rotate-90`}`})}):(0,L.jsx)(`span`,{className:`w-4 shrink-0`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>i(e.heading.slug),className:`text-left text-sm py-0.5 transition-colors truncate ${s?`text-foreground font-medium`:`text-muted-foreground hover:text-foreground`}`,style:{paddingLeft:`${(e.heading.level-1)*.75}rem`},children:e.heading.text})]}),a&&!o&&(0,L.jsx)(`div`,{children:e.children.map(e=>(0,L.jsx)(vg,{node:e,collapsed:t,toggleCollapse:n,activeSlug:r,scrollTo:i},e.heading.slug))})]})}function yg(e){let t=[],n=[];for(let r of e){let e={heading:r,children:[]};for(;n.length>0&&n[n.length-1].heading.level>=r.level;)n.pop();n.length===0?t.push(e):n[n.length-1].children.push(e),n.push(e)}return t}function bg(e,t){let n=[];function r(e){for(let i of e){if(i.heading.slug===t||(n.push(i.heading.slug),r(i.children)))return!0;n.pop()}return!1}return r(e),n}function xg(e){let t=/language-(\w+)/.exec(e);if(!t)return null;let n=t[1];return{javascript:`js`,typescript:`ts`,python:`py`,json:`json`,yaml:`yaml`,yml:`yaml`,html:`html`,css:`css`,xml:`xml`,java:`java`,rust:`rs`,sql:`sql`,php:`php`,cpp:`cpp`,c:`c`,markdown:`md`,jsx:`jsx`,tsx:`tsx`,scss:`scss`,bash:`sh`,shell:`sh`,sh:`sh`,plaintext:``,text:``}[n]??n}function Sg(e,t=`dark`){let n=[],r=e.querySelectorAll(`pre`),i=[];for(let e of r){let r=e.querySelector(`code`);if(!r||e.closest(`.embedded-diagram-lazy`)||e.closest(`.embedded-diagram-rendered`))continue;let a=xg(r.className)??``,o=r.textContent??``;if(!o.trim())continue;let s=document.createElement(`div`);s.className=`cm6-embedded-code`,e.replaceWith(s),i.push(Cg(s,o,a,t,n))}return Promise.all(i).then(()=>{e.setAttribute(`data-cm6-ready`,`true`)}),()=>{for(let e of n)e()}}async function Cg(e,t,n,i,o){try{let{EditorView:s,EditorState:c,basicSetup:l,oneDark:u}=await a(),d=await r(n);if(!e.isConnected)return;let f=[l,c.readOnly.of(!0),s.editable.of(!1),...i===`dark`?[u]:[],s.theme({"&":{fontSize:`14px`,borderRadius:`0.5rem`,overflow:`hidden`,border:`1px solid var(--color-border)`},".cm-scroller":{overflow:`auto`},".cm-content":{fontFamily:`'JetBrains Mono', 'Fira Code', 'Consolas', monospace`,padding:`0.75rem 0`},".cm-gutters":{fontFamily:`'JetBrains Mono', 'Fira Code', 'Consolas', monospace`,backgroundColor:`var(--color-muted)`,borderRight:`1px solid var(--color-border)`,color:`var(--color-muted-foreground)`},"&.cm-editor":{backgroundColor:`var(--color-muted)`},".cm-cursor":{display:`none`},".cm-activeLineGutter":{backgroundColor:`transparent`},".cm-activeLine":{backgroundColor:`transparent`}})];d&&f.push(d);let p=new s({state:c.create({doc:t,extensions:f}),parent:e});o.push(()=>p.destroy())}catch{e.innerHTML=`<pre class="hljs rounded-lg overflow-x-auto text-sm border border-border p-4 bg-muted text-foreground"><code>${wg(t)}</code></pre>`}}function wg(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Tg(e,t=14){return Kh(e,{size:t})}function Eg(e){e.querySelectorAll(`pre`).forEach(e=>{if(e.querySelector(`.code-copy-btn`))return;e.style.position=`relative`;let t=document.createElement(`button`);t.className=`code-copy-btn`,t.title=`Copy to clipboard`,t.innerHTML=``,t.appendChild(Tg(Jh)),t.addEventListener(`click`,()=>{let n=e.querySelector(`code`)?.textContent??e.textContent??``;navigator.clipboard.writeText(n).then(()=>{t.innerHTML=``;let e=Tg(qh);t.appendChild(e),t.style.color=`#4ade80`,setTimeout(()=>{t.innerHTML=``,t.appendChild(Tg(Jh)),t.style.color=``},1500)})}),e.appendChild(t)})}var Dg=600;function Og(e,t){let n=e===window,r=n?window.scrollY:e.scrollTop,i=t-r;if(Math.abs(i)<2)return;let a=performance.now();function o(t){let s=t-a,c=Math.min(s/Dg,1),l=c<.5?4*c*c*c:1-(-2*c+2)**3/2;n?window.scrollTo(0,r+i*l):e.scrollTop=r+i*l,c<1&&requestAnimationFrame(o)}requestAnimationFrame(o)}function kg(e,t){let n=document.getElementById(t);if(n&&e){let r=n.getBoundingClientRect(),i=e.getBoundingClientRect();Og(e,e.scrollTop+(r.top-i.top)-16),window.history.replaceState(null,``,`#${t}`)}}function Ag({fileRendered:e,proseWidth:t,topBarHeight:n,mainRef:r,mobileTocOpen:i,setMobileTocOpen:a}){let[o]=s(),c=new URLSearchParams(window.location.search).has(`plain_code`),l=e.headings&&e.headings.length>2,u=(0,m.useMemo)(()=>l?yg(e.headings):[],[e.headings,l]),[d,f]=(0,m.useState)(()=>new Set),p=(0,m.useCallback)(e=>{f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),h=(0,m.useCallback)(e=>{let t=bg(u,e);t.some(e=>d.has(e))&&f(e=>{let n=new Set(e);for(let e of t)n.delete(e);return n}),kg(r.current,e)},[u,d,r]),g=(0,m.useCallback)(e=>{h(e),a(!1)},[h,a]);return(0,L.jsxs)(L.Fragment,{children:[i&&l&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`lg:hidden fixed inset-0 z-40`,onClick:()=>a(!1)}),(0,L.jsx)(`div`,{className:`lg:hidden fixed left-2 right-2 z-50 bg-popover text-popover-foreground border border-border rounded-lg shadow-lg max-h-[60vh] overflow-y-auto px-4 py-3`,style:{top:`${n+4}px`},children:(0,L.jsx)(`nav`,{children:u.map(e=>(0,L.jsx)(vg,{node:e,collapsed:d,toggleCollapse:p,scrollTo:g},e.heading.slug))})})]}),(0,L.jsxs)(`div`,{className:`flex gap-6`,children:[l&&(0,L.jsxs)(`aside`,{className:`toc-sidebar hidden lg:block w-56 shrink-0`,style:{maxHeight:`calc(100vh - ${n+32}px)`},children:[(0,L.jsx)(`div`,{className:`text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2`,children:`Contents`}),(0,L.jsx)(`nav`,{className:`border-l border-border pl-3`,children:u.map(e=>(0,L.jsx)(vg,{node:e,collapsed:d,toggleCollapse:p,scrollTo:h},e.heading.slug))})]}),(0,L.jsx)(`article`,{ref:e=>{e&&(c||Sg(e,o),Eg(e),_g(e),pg(e),mg(e))},className:`prose bg-background p-6 rounded-lg border border-border min-w-0 flex-1 ${t===`narrow`?`max-w-prose`:t===`medium`?`max-w-5xl`:`max-w-none`}`,style:{"--tw-prose-body":`var(--foreground)`,"--tw-prose-headings":`var(--foreground)`,"--tw-prose-bold":`var(--foreground)`,"--tw-prose-links":`#3b82f6`,"--tw-prose-code":`var(--foreground)`,"--tw-prose-pre-bg":`var(--muted)`,"--tw-prose-pre-code":`var(--foreground)`,"--tw-prose-hr":`var(--border)`,"--tw-prose-quotes":`var(--muted-foreground)`,"--tw-prose-quote-borders":`var(--border)`,"--tw-prose-th-borders":`var(--border)`,"--tw-prose-td-borders":`var(--border)`},dangerouslySetInnerHTML:{__html:e.html},onClick:e=>{let t=e.target.closest(`a`)?.getAttribute(`href`);t?.startsWith(`#`)&&(e.preventDefault(),kg(r.current,t.slice(1)))}})]})]})}var jg=new Set([`.md`,`.csv`,`.svg`,`.mmd`,`.puml`,`.plantuml`,`.pu`]);function Mg(e){return e.type===`markdown`||e.type===`csv`||e.type===`svg`||e.type===`mermaid`||e.type===`plantuml`||!!e.html}function Ng(e){let t=e?`.${e.split(`.`).pop()?.toLowerCase()}`:``;return jg.has(t)}function Pg(e,t,n=!0){let r=(0,m.useRef)(0),i=(0,m.useRef)(0);(0,m.useEffect)(()=>{let a=e.current,o=t.current;if(!a||!o||!n)return;r.current=o.scrollHeight,i.current=a.scrollTop;let s=()=>{i.current=a.scrollTop};a.addEventListener(`scroll`,s,{passive:!0});let c=new ResizeObserver(()=>{let e=o.scrollHeight,t=e-r.current;if(Math.abs(t)>0&&i.current>0){let e=a.scrollTop;e===i.current&&t>0&&(a.scrollTop=e+t),i.current=a.scrollTop}r.current=e});return c.observe(o),()=>{a.removeEventListener(`scroll`,s),c.disconnect()}},[e,t,n])}var Fg=(0,m.lazy)(()=>e(()=>import(`./CodeEditor-Brh86AGF.js`).then(e=>({default:e.CodeEditor})),__vite__mapDeps([0,1]))),Ig=(0,m.lazy)(()=>e(()=>import(`./CodeViewer-D5fJ1Z6_.js`).then(e=>({default:e.CodeViewer})),__vite__mapDeps([2,1])));function Lg({reqPath:e,file:t,fileRaw:n,fileRendered:r,viewTab:i,editing:a,setEditing:o,proseWidth:s,topBarHeight:c,mainRef:l,mobileTocOpen:u,setMobileTocOpen:d,onSave:f}){let p=(0,m.useRef)(null);Pg(l,p);let h=t?Mg(t):!1,g=h?i:`raw`,_=!t;return(0,m.useEffect)(()=>{let e=window.location.hash.slice(1);if(e&&t){let t=setTimeout(()=>kg(l.current,e),100);return()=>clearTimeout(t)}},[t,l]),(0,L.jsxs)(`div`,{ref:p,className:`px-4 md:px-6 pt-4`,children:[_&&(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground text-sm py-8 justify-center`,children:[(0,L.jsx)(tl,{className:`h-4 w-4 animate-spin`}),` Loading...`]}),(n??t)?.content&&g===`raw`&&!a&&(0,L.jsx)(m.Suspense,{fallback:(0,L.jsx)(`pre`,{className:`rounded-lg overflow-x-auto text-sm border border-border p-4 bg-muted text-foreground`,children:(0,L.jsxs)(`code`,{children:[(n??t).content.slice(0,500),`…`]})}),children:(0,L.jsx)(Ig,{content:(n??t).content,fileName:(n??t).fileName})}),a&&(n??t)?.content!=null&&g===`raw`&&(0,L.jsx)(m.Suspense,{fallback:(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground text-sm py-8 justify-center`,children:[(0,L.jsx)(tl,{className:`h-4 w-4 animate-spin`}),` Loading editor…`]}),children:(0,L.jsx)(`div`,{style:{height:`calc(100vh - ${c+16}px)`},children:(0,L.jsx)(Fg,{content:(n??t).content,fileName:(n??t).fileName,onSave:f,onCancel:()=>o(!1)})})}),!r&&h&&g===`rendered`&&!_&&(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground text-sm py-8 justify-center`,children:[(0,L.jsx)(tl,{className:`h-4 w-4 animate-spin`}),` Rendering...`]}),r?.type===`markdown`&&r.html&&g===`rendered`&&(0,L.jsx)(Ag,{fileRendered:r,proseWidth:s,topBarHeight:c,mainRef:l,mobileTocOpen:u,setMobileTocOpen:d}),r?.type===`csv`&&r.html&&g===`rendered`&&(0,L.jsx)(`div`,{className:`prose prose-sm dark:prose-invert max-w-none ${s===`narrow`?`max-w-prose mx-auto`:s===`medium`?`max-w-4xl mx-auto`:``}`,children:(0,L.jsx)(`div`,{className:`overflow-x-auto`,dangerouslySetInnerHTML:{__html:r.html}})}),r?.type===`svg`&&r.content&&g===`rendered`&&(0,L.jsx)(Vh,{content:r.content}),r?.type===`mermaid`&&g===`rendered`&&(0,L.jsx)(Hh,{html:r.html??null,content:r.content??``}),r?.type===`plantuml`&&g===`rendered`&&(0,L.jsx)(Uh,{html:r.html??null,content:r.content??``}),t?.type===`image`&&(0,L.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,L.jsx)(`img`,{src:`/api/raw/${e}`,alt:t.fileName,className:`max-w-full rounded-lg shadow-md`})}),t?.type===`binary`&&(0,L.jsxs)(`div`,{className:`text-center p-8`,children:[(0,L.jsx)(`p`,{className:`text-muted-foreground mb-4`,children:t.fileName}),(0,L.jsx)(`a`,{href:`/api/raw/${e}`,download:t.fileName,className:`inline-flex items-center gap-2 px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90`,children:`Download`})]})]})}var Rg={"bp-400":`min-[400px]:hidden`,"bp-480":`min-[480px]:hidden`,sm:`sm:hidden`,md:`md:hidden`,lg:`lg:hidden`};function zg({collapsedItems:e=[]}){let{authenticated:t,email:n,picture:r}=$n(),[i,a]=(0,m.useState)(!1),o=(0,m.useRef)(null),[s,c]=(0,m.useState)(null),[l,u]=(0,m.useState)(null);(0,m.useEffect)(()=>{fetch(`/api/content-link/privacy`).then(e=>e.json()).then(e=>{e.url&&c(e.url)}).catch(()=>{}),fetch(`/api/content-link/terms`).then(e=>e.json()).then(e=>{e.url&&u(e.url)}).catch(()=>{})},[]);let d=(0,m.useCallback)(()=>!!document.querySelector(`[data-radix-popper-content-wrapper]`),[]);if((0,m.useEffect)(()=>{if(!i)return;function e(e){let t=e.target;o.current?.contains(t)||d()||t.closest?.(`[data-radix-popper-content-wrapper]`)||t.closest?.(`[role="menu"]`)||a(!1)}return document.addEventListener(`pointerdown`,e,!0),document.addEventListener(`mousedown`,e,!0),()=>{document.removeEventListener(`pointerdown`,e,!0),document.removeEventListener(`mousedown`,e,!0)}},[i,d]),!t)return null;let f=n?n[0].toUpperCase():`?`;return(0,L.jsxs)(`div`,{className:`relative`,ref:o,children:[(0,L.jsx)(`button`,{onClick:()=>a(!i),className:`flex items-center gap-2 px-2 py-1 rounded-md hover:bg-zinc-700 transition-colors`,title:n??`Account`,children:r?(0,L.jsx)(`img`,{src:r,alt:``,className:`h-7 w-7 rounded-full`,referrerPolicy:`no-referrer`}):(0,L.jsx)(`div`,{className:`h-7 w-7 rounded-full bg-blue-600 flex items-center justify-center text-white text-xs font-semibold`,children:f})}),i&&(0,L.jsxs)(`div`,{className:`absolute right-0 top-full mt-1 w-56 bg-popover border border-border rounded-lg shadow-lg z-50 py-1`,children:[(0,L.jsxs)(`a`,{href:`https://myaccount.google.com/`,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 px-3 py-2 border-b border-border hover:bg-accent transition-colors`,children:[(0,L.jsx)(_l,{className:`h-4 w-4 text-foreground`}),(0,L.jsx)(`span`,{className:`text-sm text-foreground truncate`,children:n})]}),e.map((e,t)=>(0,L.jsx)(`div`,{className:Rg[e.breakpoint],children:typeof e.node==`function`?e.node(()=>a(!1)):e.node},t)),e.length>0&&(0,L.jsx)(`div`,{className:`border-b border-border`}),(0,L.jsxs)(`a`,{href:`/auth/logout`,className:`flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-accent transition-colors`,children:[(0,L.jsx)(nl,{className:`h-4 w-4`}),`Sign out`]}),(s??l)&&(0,L.jsxs)(`div`,{className:`border-t border-border mt-1 pt-1`,children:[s&&(0,L.jsxs)(`a`,{href:s,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent transition-colors`,children:[(0,L.jsx)(Yc,{className:`h-3 w-3`}),`Privacy`]}),l&&(0,L.jsxs)(`a`,{href:l,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent transition-colors`,children:[(0,L.jsx)(Yc,{className:`h-3 w-3`}),`Terms`]})]})]})]})}var Bg=8;function Vg(e){return e.filter(e=>{let t=String(e??``);return!(!t||!t.trim()||t.includes(`[object Object]`)||/^\$\{.*\}$/.test(t))})}function Hg(e){return e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function Ug({label:e,values:t,selected:n,onToggle:r,onRemove:i}){return(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground font-medium`,children:[e,`:`]}),t.map(e=>(0,L.jsx)(`button`,{onClick:()=>r(e),className:`text-xs px-2 py-0.5 rounded-full border transition-colors ${n.has(e)?`bg-primary text-primary-foreground border-primary`:`bg-muted text-muted-foreground border-border hover:bg-accent`}`,children:e},e)),(0,L.jsx)(`button`,{onClick:i,className:`text-muted-foreground hover:text-foreground ml-0.5`,title:`Remove ${e} filter`,children:(0,L.jsx)(vl,{className:`h-3 w-3`})})]})}function Wg({label:e,values:t,selected:n,onToggle:r,multi:i,onRemove:a}){let[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(``),u=(0,m.useRef)(null);(0,m.useEffect)(()=>{if(!o)return;let e=e=>{u.current&&!u.current.contains(e.target)&&(s(!1),l(``))};return document.addEventListener(`mousedown`,e,!0),()=>document.removeEventListener(`mousedown`,e,!0)},[o]);let d=c?t.filter(e=>e.toLowerCase().includes(c.toLowerCase())):t,f=n.size===0?`All`:n.size<=2?[...n].join(`, `):`${n.size} selected`;return(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5`,ref:u,children:[(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground font-medium`,children:[e,`:`]}),(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsxs)(`button`,{onClick:()=>s(!o),className:`text-xs px-2 py-0.5 rounded border transition-colors flex items-center gap-1 min-w-[100px] ${n.size>0?`bg-primary/10 text-primary border-primary`:`bg-muted text-muted-foreground border-border hover:bg-accent`}`,children:[(0,L.jsx)(`span`,{className:`truncate max-w-[200px]`,children:f}),(0,L.jsx)(Kc,{className:`h-3 w-3 shrink-0`})]}),o&&(0,L.jsxs)(`div`,{className:`absolute top-full left-0 mt-1 z-50 bg-background border border-border rounded shadow-lg w-64 max-h-48 flex flex-col`,children:[(0,L.jsx)(`div`,{className:`p-1.5 border-b border-border`,children:(0,L.jsx)(`input`,{type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:`Search...`,className:`text-xs w-full px-2 py-1 rounded border border-border bg-muted text-foreground placeholder:text-muted-foreground outline-none focus:border-primary`,autoFocus:!0})}),(0,L.jsxs)(`div`,{className:`overflow-y-auto flex-1`,children:[d.length===0&&(0,L.jsx)(`div`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:`No matches`}),d.map(e=>(0,L.jsxs)(`button`,{onClick:()=>{r(e),i||(s(!1),l(``))},className:`w-full text-left text-xs px-3 py-1.5 hover:bg-accent transition-colors flex items-center gap-2 ${n.has(e)?`bg-primary/10 text-primary`:`text-foreground`}`,children:[i&&(0,L.jsx)(`span`,{className:`w-3 h-3 rounded-sm border flex items-center justify-center shrink-0 ${n.has(e)?`bg-primary border-primary`:`border-border`}`,children:n.has(e)&&(0,L.jsx)(`span`,{className:`text-[8px] text-primary-foreground`,children:`✓`})}),(0,L.jsx)(`span`,{className:`truncate`,children:e})]},e))]})]})]}),n.size>0&&n.size<=5&&[...n].map(e=>(0,L.jsxs)(`button`,{onClick:()=>r(e),className:`text-xs px-1.5 py-0.5 rounded-full bg-primary/10 text-primary border border-primary/30 hover:bg-primary/20 flex items-center gap-0.5`,title:`Remove ${e}`,children:[(0,L.jsx)(`span`,{className:`truncate max-w-[120px]`,children:e}),(0,L.jsx)(vl,{className:`h-2.5 w-2.5 shrink-0`})]},e)),(0,L.jsx)(`button`,{onClick:a,className:`text-muted-foreground hover:text-foreground ml-0.5`,title:`Remove ${e} filter`,children:(0,L.jsx)(vl,{className:`h-3 w-3`})})]})}function Gg({label:e,value:t,onChange:n,inputType:r=`text`,onRemove:i}){return(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground font-medium`,children:[e,`:`]}),(0,L.jsx)(`input`,{type:r,value:t,onChange:e=>n(e.target.value),placeholder:`Filter by ${e.toLowerCase()}...`,className:`text-xs px-2 py-0.5 rounded border border-border bg-muted text-foreground placeholder:text-muted-foreground w-64 outline-none focus:border-primary`}),(0,L.jsx)(`button`,{onClick:i,className:`text-muted-foreground hover:text-foreground`,title:`Remove ${e} filter`,children:(0,L.jsx)(vl,{className:`h-3 w-3`})})]})}var Kg=4,qg=new Set([`file_path`,`chunk_text`,`chunk_index`,`total_chunks`,`content_hash`,`embedded_at`]);function Jg(e,t){let n=e.metadata??{},r=[],i=new Map(t.map(e=>[e.field,e]));for(let[e,t]of Object.entries(n)){if(qg.has(e))continue;let n=i.get(e);if(!n)continue;let a=Array.isArray(t)?t.map(String):[String(t)],o=n.uiHint!==`text`&&n.uiHint!==`number`?n.values.length:1/0;for(let t of a)!t||t===`undefined`||t===`null`||r.push({field:e,label:Hg(e),value:t,cardinality:o})}return r.sort((e,t)=>e.cardinality-t.cardinality),r}function Yg({result:e,facets:t,onNavigate:n,onChipClick:r}){let[i,a]=(0,m.useState)(!1),o=e.chunks[0]?.text??``,s=o.length>150?o.slice(0,150)+`…`:o,c=Jg(e,t),l=c.slice(0,Kg),u=c.length>Kg,d=(e,t)=>{let n=e.value.length>30?e.value.slice(0,28)+`…`:e.value;return(0,L.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),r(e.field,e.value)},className:`text-[10px] px-1.5 py-0.5 rounded bg-muted text-foreground border border-border hover:bg-primary/10 hover:border-primary/30 transition-colors cursor-pointer truncate max-w-[200px]`,title:`${e.label}: ${e.value} — click to filter`,children:[(0,L.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.label,`:`]}),` `,n]},`${e.field}-${t}`)};return(0,L.jsx)(`div`,{className:`border-b border-border last:border-0 px-4 py-2`,children:(0,L.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,L.jsx)(Xc,{className:`h-4 w-4 text-zinc-400 shrink-0 mt-1`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`button`,{onClick:()=>n(`/browse/${e.browsePath}`),className:`text-blue-500 hover:underline text-sm font-medium truncate`,children:e.fileName}),(0,L.jsxs)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:[(e.bestScore*100).toFixed(0),`%`]}),(0,L.jsxs)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:[e.chunks.length,` chunk`,e.chunks.length===1?``:`s`]}),e.mtime&&(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:new Date(e.mtime).toLocaleDateString()}),(0,L.jsx)(`button`,{onClick:()=>a(!i),className:`ml-auto text-muted-foreground hover:text-foreground shrink-0`,title:i?`Collapse chunks`:`Expand chunks`,children:i?(0,L.jsx)(Kc,{className:`h-4 w-4`}):(0,L.jsx)(qc,{className:`h-4 w-4`})})]}),(0,L.jsx)(`div`,{className:`text-xs text-muted-foreground mt-0.5 break-words leading-relaxed`,children:e.browsePath}),!i&&l.length>0&&(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 mt-1`,children:[l.map((e,t)=>d(e,t)),u&&(0,L.jsxs)(`button`,{onClick:()=>a(!0),className:`text-[10px] text-blue-500 hover:underline cursor-pointer`,children:[`+`,c.length-Kg,` more`]})]}),!i&&l.length===0&&(0,L.jsx)(`div`,{className:`text-sm text-foreground/70 mt-1 truncate`,children:s}),i&&(0,L.jsxs)(L.Fragment,{children:[c.length>0&&(0,L.jsx)(`div`,{className:`flex flex-wrap items-center gap-1 mt-1.5 mb-2`,children:c.map((e,t)=>d(e,t))}),(0,L.jsx)(`div`,{className:`max-h-48 overflow-y-auto border border-border rounded bg-muted/30 divide-y divide-border`,children:e.chunks.map((e,t)=>(0,L.jsxs)(`div`,{className:`px-3 py-2 text-sm text-foreground/80 leading-relaxed`,children:[(0,L.jsxs)(`span`,{className:`text-[10px] text-muted-foreground mr-2`,children:[`#`,e.index]}),e.text]},t))})]})]})]})})}function Xg({open:e,onClose:t}){let[n,r]=(0,m.useState)(``),[i,a]=(0,m.useState)([]),[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(null),[u,d]=(0,m.useState)([]),[f,p]=(0,m.useState)(!1),h=(0,m.useRef)(!1),[g,_]=(0,m.useState)({}),[v,y]=(0,m.useState)({}),[b,x]=(0,m.useState)(new Set),[S,C]=(0,m.useState)([]),[w,T]=(0,m.useState)(!1),[ee,E]=(0,m.useState)(!1),[D,O]=(0,m.useState)(``),k=(0,m.useRef)(null),A=(0,m.useRef)(null),j=Je(),te=(0,m.useRef)(void 0);(0,m.useEffect)(()=>{if(!ee)return;let e=e=>{k.current&&!k.current.contains(e.target)&&(E(!1),O(``))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[ee]);let ne=(0,m.useCallback)(async()=>{if(!h.current){h.current=!0,p(!0);try{let e=await Xn(),t=[],n=[];for(let r of e.facets){if(r.uiHint===`hidden`)continue;if(r.uiHint===`text`||r.uiHint===`number`){t.push({...r,values:[]});continue}let e=Vg(r.values),i=r.values.filter(t=>!e.includes(t));if(i.length>0){let e=i.map(e=>!e||!String(e).trim()?`empty`:String(e).includes(`[object Object]`)?`object-to-string`:/^\$\{.*\}$/.test(String(e))?`unresolved-template`:`unknown`);n.push({field:r.field,removed:i.map((t,n)=>`${JSON.stringify(t)} (${e[n]})`),reason:[...new Set(e)].join(`, `)})}e.length>0?t.push({...r,values:e}):n.push({field:r.field,removed:i.length>0?[`(all values filtered)`]:[`(no values)`],reason:i.length>0?`no valid values remain`:`empty values array`})}console.log(`[SearchModal] Loaded facets:`,t.length,`clean,`,n.length,`garbage entries`),d(t),C(n)}catch(e){console.error(`Failed to load facets:`,e),d([])}finally{p(!1)}}},[]);(0,m.useEffect)(()=>{e&&(setTimeout(()=>A.current?.focus(),50),ne())},[e,ne]);let re=(0,m.useCallback)(()=>{r(``),a([]),l(null),_({}),y({}),x(new Set),T(!1),A.current?.focus()},[]),M=(0,m.useCallback)(async e=>{if(!e.trim()){a([]);return}s(!0),l(null);try{let t=[];for(let[e,n]of Object.entries(g))n.size>0&&t.push({key:e,match:{any:[...n]}});for(let[e,n]of Object.entries(v))n.trim()&&t.push({key:e,match:{text:n.trim()}});a((await Yn(e,30,t.length>0?{must:t}:void 0)).results)}catch(e){let t=String(e);t.includes(`502`)||t.includes(`Watcher unreachable`)?l(`Search service is unavailable. Please try again later.`):t.includes(`501`)||t.includes(`not configured`)?l(`Search is not configured on this server.`):t.includes(`403`)?l(`You do not have permission to search.`):t.includes(`400`)?l(`Invalid search query. Please revise and try again.`):l(`Search failed. Please try again later.`)}finally{s(!1)}},[g,v]),N=(0,m.useCallback)(e=>{r(e),te.current&&clearTimeout(te.current),te.current=setTimeout(()=>void M(e),400)},[M]),ie=(0,m.useCallback)(e=>{t(),j(e)},[j,t]),ae=(0,m.useCallback)((e,t)=>{x(t=>new Set([...t,e]));let n=u.find(t=>t.field===e);n&&(n.uiHint===`text`||n.uiHint===`number`)?y(n=>({...n,[e]:t})):_(n=>{let r=n[e]??new Set,i=new Set(r);return i.add(t),{...n,[e]:i}})},[u]),oe=(0,m.useCallback)((e,t)=>{_(n=>{let r=n[e]??new Set,i=new Set(r);return i.has(t)?i.delete(t):i.add(t),{...n,[e]:i}})},[]),P=(0,m.useCallback)(e=>{x(t=>new Set([...t,e]))},[]),F=(0,m.useCallback)(e=>{x(t=>{let n=new Set(t);return n.delete(e),n}),_(t=>{let n={...t};return delete n[e],n}),y(t=>{let n={...t};return delete n[e],n})},[]);(0,m.useEffect)(()=>{n.trim()&&M(n)},[g,v]);let I=u.filter(e=>b.has(e.field)),se=u.filter(e=>!b.has(e.field)),ce=D?se.filter(e=>Hg(e.field).toLowerCase().includes(D.toLowerCase())):se;function le(e){let t=Hg(e.field),n=()=>F(e.field);if(e.uiHint===`text`||e.uiHint===`number`)return(0,L.jsx)(Gg,{label:t,value:v[e.field]??``,onChange:t=>y(n=>({...n,[e.field]:t})),inputType:e.uiHint===`number`?`number`:`text`,onRemove:n},e.field);let r=g[e.field]??new Set;return e.values.length<=Bg?(0,L.jsx)(Ug,{label:t,values:e.values,selected:r,onToggle:t=>oe(e.field,t),onRemove:n},e.field):(0,L.jsx)(Wg,{label:t,values:e.values,selected:r,onToggle:t=>oe(e.field,t),multi:e.uiHint===`multiselect`,onRemove:n},e.field)}return e?(0,L.jsxs)(`div`,{className:`fixed inset-0 z-[100] flex items-start justify-center pt-[5vh]`,onClick:t,children:[(0,L.jsx)(`div`,{className:`absolute inset-0 bg-black/50 backdrop-blur-sm`}),(0,L.jsxs)(`div`,{className:`relative bg-background border border-border rounded-lg shadow-2xl w-full max-w-4xl max-h-[85vh] flex flex-col`,onClick:e=>e.stopPropagation(),children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3 border-b border-border`,children:[(0,L.jsx)(hl,{className:`h-5 w-5 text-muted-foreground shrink-0`}),(0,L.jsx)(`input`,{ref:A,type:`text`,value:n,onChange:e=>N(e.target.value),onKeyDown:e=>{e.key===`Escape`&&t()},placeholder:`Search documents...`,className:`flex-1 bg-transparent outline-none text-foreground placeholder:text-muted-foreground`}),o&&(0,L.jsx)(`div`,{className:`h-4 w-4 border-2 border-primary border-t-transparent rounded-full animate-spin`}),(n||i.length>0)&&(0,L.jsx)(`button`,{onClick:re,className:`text-muted-foreground hover:text-foreground`,title:`Reset search`,children:(0,L.jsx)(ml,{className:`h-4 w-4`})}),(0,L.jsx)(`button`,{onClick:t,className:`text-muted-foreground hover:text-foreground`,title:`Close (Esc)`,children:(0,L.jsx)(vl,{className:`h-5 w-5`})})]}),(0,L.jsxs)(`div`,{className:`px-4 py-2 border-b border-border flex flex-col gap-1.5`,children:[I.map(le),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(`div`,{className:`relative`,ref:k,children:[(0,L.jsxs)(`button`,{onClick:()=>{ee||ne(),E(!ee)},className:`text-xs px-2 py-0.5 rounded border border-dashed border-border text-muted-foreground hover:text-foreground hover:border-foreground transition-colors flex items-center gap-1`,children:[(0,L.jsx)(ul,{className:`h-3 w-3`}),f?`Loading filters...`:`Add filter`]}),ee&&(0,L.jsxs)(`div`,{className:`absolute top-full left-0 mt-1 z-50 bg-background border border-border rounded shadow-lg w-56 max-h-48 flex flex-col`,children:[(0,L.jsx)(`div`,{className:`p-1.5 border-b border-border`,children:(0,L.jsx)(`input`,{type:`text`,value:D,onChange:e=>O(e.target.value),placeholder:`Search filters...`,className:`text-xs w-full px-2 py-1 rounded border border-border bg-muted text-foreground placeholder:text-muted-foreground outline-none focus:border-primary`,autoFocus:!0})}),(0,L.jsxs)(`div`,{className:`overflow-y-auto flex-1`,children:[f&&(0,L.jsxs)(`div`,{className:`px-3 py-2 text-xs text-muted-foreground flex items-center gap-2`,children:[(0,L.jsx)(`div`,{className:`h-3 w-3 border-2 border-primary border-t-transparent rounded-full animate-spin`}),`Loading...`]}),!f&&ce.length===0&&(0,L.jsx)(`div`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:u.length===0?`No filters available`:`All filters active`}),ce.map(e=>(0,L.jsxs)(`button`,{onClick:()=>{P(e.field),E(!1),O(``)},className:`w-full text-left text-xs px-3 py-1.5 hover:bg-accent transition-colors flex items-center justify-between`,children:[(0,L.jsx)(`span`,{className:`text-foreground`,children:Hg(e.field)}),(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.uiHint===`text`||e.uiHint===`number`?e.uiHint:`${e.values.length}`})]},e.field))]})]})]}),S.length>0&&(0,L.jsxs)(`button`,{onClick:()=>T(!w),className:`text-[10px] px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-600 border border-amber-500/30 hover:bg-amber-500/20 transition-colors`,title:`Show inference rule issues`,children:[S.length,` issue`,S.length===1?``:`s`]})]}),w&&S.length>0&&(0,L.jsxs)(`div`,{className:`mt-1 p-2 rounded border border-amber-500/30 bg-amber-500/5 text-xs max-h-32 overflow-y-auto`,children:[(0,L.jsx)(`div`,{className:`text-amber-600 font-medium mb-1`,children:`Filtered facet values (inference rule issues):`}),S.map(e=>(0,L.jsxs)(`div`,{className:`mb-1`,children:[(0,L.jsx)(`span`,{className:`text-foreground font-medium`,children:Hg(e.field)}),(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:`: `}),e.removed.map((e,t)=>(0,L.jsxs)(`span`,{className:`text-amber-700`,children:[t>0&&`, `,(0,L.jsx)(`code`,{className:`bg-amber-500/10 px-0.5 rounded`,children:e})]},t))]},e.field))]})]}),(0,L.jsxs)(`div`,{className:`overflow-y-auto flex-1`,children:[c&&(0,L.jsx)(`div`,{className:`px-4 py-3 text-sm text-red-500`,children:c}),!c&&i.length===0&&n.trim()&&!o&&(0,L.jsx)(`div`,{className:`px-4 py-8 text-center text-muted-foreground text-sm`,children:`No results found`}),!c&&!n.trim()&&!o&&(0,L.jsx)(`div`,{className:`px-4 py-8 text-center text-muted-foreground text-sm`,children:`Type a query to search across all documents`}),i.map(e=>(0,L.jsx)(Yg,{result:e,facets:u,onNavigate:ie,onChipClick:ae},e.browsePath))]}),i.length>0&&(0,L.jsxs)(`div`,{className:`px-4 py-2 border-t border-border text-xs text-muted-foreground`,children:[i.length,` result`,i.length===1?``:`s`]})]})]}):null}var Zg=`https://github.com/karmaniverous/jeeves-server`;function Qg({breadcrumbs:e=[],isInsider:t,searchEnabled:n,theme:r,onToggleTheme:i,keyAge:a,onRotateKey:o,downloadDropdown:s,linkControls:c,downloadMenuItem:l,linkMenuItem:u}){let d=t&&o,[f,p]=(0,m.useState)(null),[h,g]=(0,m.useState)(!1),_=(0,m.useCallback)(e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),g(!0))},[]);(0,m.useEffect)(()=>{if(n&&t)return window.addEventListener(`keydown`,_),()=>window.removeEventListener(`keydown`,_)},[n,t,_]),(0,m.useEffect)(()=>{fetch(`/api/readme-link`).then(e=>e.ok?e.json():null).then(e=>{e?.url&&p(e.url)}).catch(()=>{})},[]);let v=[],y=`flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-accent transition-colors w-full text-left cursor-pointer`;return u&&v.push({breakpoint:`bp-400`,node:u,hasNestedDropdown:!0}),l&&v.push({breakpoint:`bp-480`,node:l,hasNestedDropdown:!0}),d&&v.push({breakpoint:`sm`,node:(0,L.jsxs)(`button`,{onClick:o,className:y,children:[(0,L.jsx)($c,{className:`h-4 w-4 shrink-0`}),`Rotate key`,a?` (${a})`:``]})}),t&&v.push({breakpoint:`md`,node:(0,L.jsxs)(mn,{to:`/runner`,className:y,children:[(0,L.jsx)(zc,{className:`h-4 w-4 shrink-0`}),`Runner`]})}),f&&v.push({breakpoint:`md`,node:(0,L.jsxs)(`a`,{href:f,className:y,children:[(0,L.jsx)(Wc,{className:`h-4 w-4 shrink-0`}),`README`]})}),v.push({breakpoint:`md`,node:(0,L.jsxs)(`a`,{href:Zg,target:`_blank`,rel:`noopener noreferrer`,className:y,children:[(0,L.jsx)(Qc,{className:`h-4 w-4 shrink-0`}),`GitHub`]})}),v.push({breakpoint:`md`,node:(0,L.jsxs)(`button`,{onClick:i,className:y,children:[r===`dark`?(0,L.jsx)(gl,{className:`h-4 w-4 shrink-0`}):(0,L.jsx)(sl,{className:`h-4 w-4 shrink-0`}),r===`dark`?`Light mode`:`Dark mode`]})}),(0,L.jsxs)(`header`,{className:`bg-zinc-800 text-white px-4 py-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center min-w-0 flex-1`,children:[(0,L.jsx)(mn,{to:`/browse`,className:`text-3xl no-underline shrink-0 mr-1`,title:`Jeeves Server`,children:`🎩`}),(0,L.jsx)(`nav`,{className:`flex items-center gap-1 min-w-0 overflow-x-auto overflow-y-hidden scrollbar-thin`,children:e.map((t,n)=>(0,L.jsxs)(`span`,{className:`flex items-center gap-1 shrink-0`,children:[(0,L.jsx)(`span`,{className:`text-zinc-500 mx-0.5`,children:`/`}),n===e.length-1?(0,L.jsx)(`span`,{className:`text-zinc-300 truncate max-w-48`,children:t.label}):(0,L.jsx)(mn,{to:`/browse/${t.path}`,className:`text-blue-400 hover:underline truncate max-w-48`,children:t.label})]},t.path))})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[n&&t&&(0,L.jsx)(Ym,{variant:`ghost`,size:`icon`,className:`text-zinc-300 hover:text-white hover:bg-white/10 h-8 w-8`,title:`Search (Ctrl+K)`,onClick:()=>g(!0),children:(0,L.jsx)(hl,{className:`h-4 w-4`})}),c&&(0,L.jsx)(`div`,{className:`hidden min-[400px]:flex items-center`,children:c}),s&&(0,L.jsx)(`div`,{className:`hidden min-[480px]:flex items-center`,children:s}),d&&(0,L.jsxs)(`div`,{className:`hidden sm:flex items-center gap-1`,children:[(0,L.jsx)(Ym,{variant:`ghost`,size:`icon`,className:`text-zinc-300 hover:text-white hover:bg-white/10 h-8 w-8`,title:`Rotate key (invalidates all your shares)`,onClick:o,children:(0,L.jsx)($c,{className:`h-4 w-4`})}),a&&(0,L.jsx)(`span`,{className:`text-xs text-zinc-500`,children:a})]}),t&&(0,L.jsx)(mn,{to:`/runner`,title:`Runner Dashboard`,className:`hidden md:inline-flex`,children:(0,L.jsx)(Ym,{variant:`ghost`,size:`icon`,className:`text-zinc-300 hover:text-white hover:bg-white/10 h-8 w-8`,children:(0,L.jsx)(zc,{className:`h-4 w-4`})})}),f&&(0,L.jsx)(`a`,{href:f,title:`README`,className:`hidden md:inline-flex`,children:(0,L.jsx)(Ym,{variant:`ghost`,size:`icon`,className:`text-zinc-300 hover:text-white hover:bg-white/10 h-8 w-8`,children:(0,L.jsx)(Wc,{className:`h-4 w-4`})})}),(0,L.jsx)(`a`,{href:Zg,target:`_blank`,rel:`noopener noreferrer`,title:`GitHub`,className:`hidden md:inline-flex`,children:(0,L.jsx)(Ym,{variant:`ghost`,size:`icon`,className:`text-zinc-300 hover:text-white hover:bg-white/10 h-8 w-8`,children:(0,L.jsx)(Qc,{className:`h-4 w-4`})})}),(0,L.jsx)(Ym,{variant:`ghost`,size:`icon`,className:`text-zinc-300 hover:text-white hover:bg-white/10 h-8 w-8 hidden md:inline-flex`,title:`Toggle theme`,onClick:i,children:r===`dark`?(0,L.jsx)(gl,{className:`h-4 w-4`}):(0,L.jsx)(sl,{className:`h-4 w-4`})}),(0,L.jsx)(zg,{theme:r,onToggleTheme:i,collapsedItems:v})]})]}),n&&t&&(0,L.jsx)(Xg,{open:h,onClose:()=>g(!1)})]})}function $g({reqPath:e,file:t,fileRendered:n,viewTab:r,setViewTab:i,proseWidth:a,toggleProseWidth:o,isInsider:s,editing:c,setEditing:l,mobileTocOpen:u,setMobileTocOpen:d,loading:f}){if(!t&&!f)return null;let p=(n?Mg(n):!1)||(t?Mg(t):Ng(e)),m=p?r:`raw`;return(0,L.jsxs)(`div`,{className:`flex items-center gap-1 border-b border-border bg-background px-4 md:px-6`,children:[n?.headings&&n.headings.length>2&&(0,L.jsx)(`button`,{onClick:()=>d(!u),className:`lg:hidden p-1.5 mr-1 text-muted-foreground hover:text-foreground transition-colors`,title:`Table of contents`,children:u?(0,L.jsx)(vl,{className:`h-4 w-4`}):(0,L.jsx)(il,{className:`h-4 w-4`})}),p&&(0,L.jsx)(`button`,{onClick:()=>i(`rendered`),className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${m===`rendered`?`border-blue-500 text-blue-500`:`border-transparent text-muted-foreground hover:text-foreground`}`,children:`Rendered`}),(0,L.jsx)(`button`,{onClick:()=>i(`raw`),className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${m===`raw`?`border-blue-500 text-blue-500`:`border-transparent text-muted-foreground hover:text-foreground`}`,children:`Raw`}),t?.type===`markdown`&&m===`rendered`&&(0,L.jsx)(`div`,{className:`hidden md:flex items-center ml-2 border border-border rounded-md overflow-hidden`,children:[`narrow`,`medium`,`wide`].map(e=>(0,L.jsx)(`button`,{onClick:()=>o(e),className:`p-1.5 transition-colors ${a===e?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`}`,title:`${e.charAt(0).toUpperCase()+e.slice(1)} width`,children:e===`narrow`?(0,L.jsx)(al,{className:`h-3.5 w-3.5`}):e===`medium`?(0,L.jsx)(ol,{className:`h-3.5 w-3.5`}):(0,L.jsx)(rl,{className:`h-3.5 w-3.5`})},e))}),s&&m===`raw`&&t?.content!=null&&!c&&(0,L.jsxs)(`button`,{onClick:()=>l(!0),className:`ml-2 flex items-center gap-1 px-2 py-1 text-sm text-muted-foreground hover:text-foreground border border-border rounded transition-colors`,title:`Edit file`,children:[(0,L.jsx)(cl,{className:`h-3.5 w-3.5`}),` Edit`]})]})}function e_(e,t){let[n,r]=(0,m.useState)(null),[i,a]=(0,m.useState)(null),[o,s]=(0,m.useState)(null),[c,l]=(0,m.useState)(null),[u,d]=(0,m.useState)(!0),[f,p]=(0,m.useState)(null),[h,g]=(0,m.useState)(!1),[_,v]=(0,m.useState)(t.get(`tab`)===`raw`?`raw`:`rendered`),y=c??o,b=(0,m.useCallback)(async(e,t)=>{if(d(!0),p(null),r(null),a(null),s(null),l(null),g(!1),v(t.get(`tab`)===`raw`?`raw`:`rendered`),e)try{let t=await Un(e);`entries`in t?(a(t),d(!1)):(Gn(e).then(e=>{s(e),d(!1)}).catch(()=>{}),Wn(e).then(l).catch(()=>{}))}catch{Gn(e).then(e=>{s(e),d(!1)}).catch(e=>{p(e.message),d(!1)}),Wn(e).then(l).catch(()=>{})}else try{r(await Hn())}catch(e){p(e.message)}finally{d(!1)}},[]);return(0,m.useEffect)(()=>{b(e,t)},[b,e]),{drives:n,directory:i,fileRaw:o,fileRendered:c,file:y,loading:u,error:f,editing:h,setEditing:g,viewTab:_,setViewTab:v,handleSave:async t=>{await Jn(e,t),s(await Gn(e));try{l(await Wn(e))}catch{}g(!1)}}}function t_(){let e=localStorage.getItem(`jeeves-share-settings`);if(e)try{return JSON.parse(e)}catch{}return{expiry:localStorage.getItem(`jeeves-share-expiry`)??``,depth:0,dirs:!1}}function n_(){let[e,t]=(0,m.useState)(t_);return(0,m.useEffect)(()=>{localStorage.setItem(`jeeves-share-settings`,JSON.stringify(e))},[e]),{shareSettings:e,setShareSettings:t}}function r_(e=``){let t=(0,m.useRef)(null),n=(0,m.useRef)(null),[r,i]=(0,m.useState)(96),a=(0,m.useCallback)(()=>{t.current&&i(t.current.offsetHeight)},[]);return(0,m.useEffect)(()=>(a(),window.addEventListener(`resize`,a),()=>window.removeEventListener(`resize`,a)),[a]),(0,m.useEffect)(()=>{a()},[a,e]),{topBarRef:t,mainRef:n,topBarHeight:r}}function i_(e){let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<60)return`${String(n)}m ago`;let r=Math.floor(n/60);if(r<24)return`${String(r)}h ago`;let i=Math.floor(r/24);return`${String(i)}d ago`}function a_(){let e=Xe()[`*`]??``,[t,n]=Sn(),[r,i]=s();(0,m.useEffect)(()=>{let t=`Jeeves Server`,n=e.split(`/`).filter(Boolean),r=n.length?n[n.length-1]:``,i=r?decodeURIComponent(r):``;document.title=i?`${i} - ${t}`:t},[e]);let{drives:a,directory:o,fileRaw:c,fileRendered:l,file:u,loading:d,error:f,editing:p,setEditing:h,viewTab:g,setViewTab:_,handleSave:v}=e_(e,t),y=e=>{_(e),n(t=>{let n=new URLSearchParams(t);return e===`rendered`?n.delete(`tab`):n.set(`tab`,e),n},{replace:!0})},{shareSettings:b,setShareSettings:x}=n_(),[S,C]=(0,m.useState)(!1),[w,T]=(0,m.useState)(()=>localStorage.getItem(`jeeves-prose-width`)??`medium`),ee=e=>{T(e),localStorage.setItem(`jeeves-prose-width`,e)},{isInsider:E,searchEnabled:D,keyCreatedAt:O,rotateKey:k}=$n(),A=o?.breadcrumbs??u?.breadcrumbs??[],j=o?.isInsider??u?.isInsider??E,te=O?i_(O):null,[ne,re]=(0,m.useState)(!1),M=()=>re(!0),N=async()=>{re(!1),await k()},{topBarRef:ie,mainRef:ae,topBarHeight:oe}=r_(JSON.stringify([u,o,a]));return{reqPath:e,theme:r,toggleTheme:i,shareSettings:b,setShareSettings:x,mobileTocOpen:S,setMobileTocOpen:C,proseWidth:w,toggleProseWidth:ee,drives:a,directory:o,fileRaw:c,fileRendered:l,file:u,loading:d,error:f,editing:p,setEditing:h,viewTab:g,setViewTab:y,breadcrumbs:A,isInsider:j,searchEnabled:D,keyAge:te,rotateKeyDialogOpen:ne,setRotateKeyDialogOpen:re,handleRotateKey:M,confirmRotateKey:N,topBarRef:ie,mainRef:ae,topBarHeight:oe,handleSave:v}}function o_(){let{reqPath:e,theme:t,toggleTheme:n,shareSettings:r,setShareSettings:i,mobileTocOpen:a,setMobileTocOpen:o,proseWidth:s,toggleProseWidth:c,drives:l,directory:u,fileRaw:d,fileRendered:f,file:p,loading:m,error:h,editing:g,setEditing:_,viewTab:v,setViewTab:y,breadcrumbs:b,isInsider:x,searchEnabled:S,keyAge:C,rotateKeyDialogOpen:w,setRotateKeyDialogOpen:T,handleRotateKey:ee,confirmRotateKey:E,topBarRef:D,mainRef:O,topBarHeight:k,handleSave:A}=a_(),j=p||m&&!!e;return(0,L.jsxs)(`div`,{className:`min-h-screen bg-background text-foreground`,children:[(0,L.jsxs)(`div`,{ref:D,className:`fixed top-0 left-0 right-0 z-50`,children:[(0,L.jsx)(Qg,{breadcrumbs:b,isInsider:x,searchEnabled:S,theme:t,onToggleTheme:n,keyAge:g?void 0:C,onRotateKey:g?void 0:ee,downloadDropdown:g?void 0:p?(0,L.jsx)(th,{reqPath:e,file:p,isInsider:x,variant:`header`}):u?(0,L.jsx)(th,{reqPath:e,file:null,isDirectory:!0,isInsider:x,variant:`header`}):void 0,downloadMenuItem:g?void 0:p?(t=>(0,L.jsx)(th,{reqPath:e,file:p,isInsider:x,variant:`menuItem`,onStateChange:e=>{e===`done`&&setTimeout(t,800)}})):u?(t=>(0,L.jsx)(th,{reqPath:e,file:null,isDirectory:!0,isInsider:x,variant:`menuItem`,onStateChange:e=>{e===`done`&&setTimeout(t,800)}})):void 0,linkControls:g?void 0:x?(0,L.jsx)(ih,{path:`/${e}`,shareSettings:r,onShareSettingsChange:i,showEvent:!0,showRaw:!!p,variant:`header`,isDirectory:!p}):void 0,linkMenuItem:g?void 0:x?(t=>(0,L.jsx)(ih,{path:`/${e}`,shareSettings:r,onShareSettingsChange:i,showEvent:!0,showRaw:!!p,variant:`menuItem`,isDirectory:!p,onStateChange:e=>{e===`done`&&setTimeout(t,800)}})):void 0}),j&&(0,L.jsx)($g,{reqPath:e,file:p,fileRendered:f,viewTab:v,setViewTab:y,proseWidth:s,toggleProseWidth:c,isInsider:x,editing:g,setEditing:_,mobileTocOpen:a,setMobileTocOpen:o,loading:m})]}),(0,L.jsxs)(`main`,{ref:O,className:j?`px-0 pb-32 overflow-y-auto`:`p-4 pb-32 md:px-6 md:pt-6 overflow-y-auto`,style:{marginTop:`${k}px`,height:`calc(100vh - ${k}px)`},children:[m&&!e&&(0,L.jsx)(`div`,{className:`text-muted-foreground text-sm`,children:`Loading...`}),h&&(0,L.jsxs)(`div`,{className:`text-destructive text-sm`,children:[`Error: `,h]}),!m&&!h&&l&&(0,L.jsx)(ch,{drives:l,isInsider:x,shareSettings:r,onShareSettingsChange:i}),!m&&!h&&u&&(0,L.jsx)(sh,{entries:u.entries,basePath:e,isInsider:x,shareSettings:r,onShareSettingsChange:i}),!h&&j&&(0,L.jsx)(Lg,{reqPath:e,file:p,fileRaw:d,fileRendered:f,viewTab:v,editing:g,setEditing:_,proseWidth:s,topBarHeight:k,mainRef:O,mobileTocOpen:a,setMobileTocOpen:o,onSave:A,loading:m})]}),(0,L.jsx)(kc,{open:w,onOpenChange:T,title:`Rotate insider key?`,description:`This will invalidate ALL existing share links generated with your current key. This action cannot be undone.`,confirmLabel:`Rotate Key`,onConfirm:()=>void E()})]})}function s_(){let{loading:e,authenticated:t}=$n(),n=Je();return(0,m.useEffect)(()=>{!e&&t&&n(`/browse`,{replace:!0})},[e,t,n]),e?(0,L.jsx)(`div`,{className:`min-h-screen bg-background flex items-center justify-center`,children:(0,L.jsx)(`div`,{className:`text-muted-foreground text-sm`,children:`Loading...`})}):(0,L.jsx)(`div`,{className:`min-h-screen bg-background flex items-center justify-center`,children:(0,L.jsxs)(`div`,{className:`text-center space-y-6`,children:[(0,L.jsx)(`div`,{className:`text-6xl mb-2`,children:`🎩`}),(0,L.jsx)(`h1`,{className:`text-2xl font-semibold text-foreground`,children:`Jeeves`}),(0,L.jsx)(`p`,{className:`text-muted-foreground text-sm max-w-xs mx-auto`,children:`File browser and document server`}),(0,L.jsxs)(`a`,{href:`/auth/login?returnTo=/browse`,className:`inline-flex items-center gap-3 px-6 py-3 bg-white text-zinc-800 rounded-lg shadow-md hover:shadow-lg transition-shadow font-medium text-sm border border-zinc-200`,children:[(0,L.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`20`,height:`20`,className:`shrink-0`,children:[(0,L.jsx)(`path`,{fill:`#4285F4`,d:`M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z`}),(0,L.jsx)(`path`,{fill:`#34A853`,d:`M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z`}),(0,L.jsx)(`path`,{fill:`#FBBC05`,d:`M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z`}),(0,L.jsx)(`path`,{fill:`#EA4335`,d:`M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z`})]}),`Sign in with Google`]})]})})}var c_={ok:`bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400`,error:`bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400`,running:`bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400`,disabled:`bg-zinc-100 text-zinc-500 dark:bg-zinc-800 dark:text-zinc-400`,pending:`bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400`},l_=`bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300`;function u_({status:e}){let t=e??`pending`;return(0,L.jsx)(`span`,{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ${c_[t]??l_}`,children:t})}var d_={name:`w-[30%] px-3 py-2`,type:`w-[10%] px-3 py-2`,schedule:`w-[15%] px-3 py-2`,status:`w-[12%] px-3 py-2`,lastRun:`w-[25%] px-3 py-2`,action:`w-[8%] px-3 py-2`};function f_(e){if(!e)return`—`;try{return new Date(e).toLocaleString()}catch{return e}}function p_({column:e,sort:t}){return t.column===e?t.direction===`asc`?(0,L.jsx)(Uc,{className:`h-3 w-3`}):(0,L.jsx)(Bc,{className:`h-3 w-3`}):(0,L.jsx)(Hc,{className:`h-3 w-3 opacity-40`})}var m_=[{key:`name`,label:`Name`},{key:`type`,label:`Type`},{key:`schedule`,label:`Schedule`},{key:`status`,label:`Status`},{key:`lastRun`,label:`Last Run`}];function h_({sort:e,onSort:t}){return(0,L.jsx)(`div`,{className:`overflow-x-auto`,children:(0,L.jsx)(`table`,{className:`w-full text-sm`,children:(0,L.jsx)(`thead`,{children:(0,L.jsxs)(`tr`,{className:`border-b border-border text-left`,children:[m_.map(n=>(0,L.jsx)(`th`,{className:`${d_[n.key]} font-medium text-muted-foreground cursor-pointer select-none hover:text-foreground transition-colors`,onClick:()=>t(n.key),children:(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[n.label,(0,L.jsx)(p_,{column:n.key,sort:e})]})},n.key)),(0,L.jsx)(`th`,{className:`${d_.action} font-medium text-muted-foreground`})]})})})})}function g_({jobs:e,onRunNow:t}){let n=Je();return e.length===0?(0,L.jsx)(`div`,{className:`text-center py-8 text-muted-foreground`,children:`No jobs found`}):(0,L.jsx)(`div`,{className:`overflow-x-auto`,children:(0,L.jsx)(`table`,{className:`w-full text-sm`,children:(0,L.jsx)(`tbody`,{children:e.map(e=>(0,L.jsxs)(`tr`,{className:`border-b border-border hover:bg-muted/50 cursor-pointer transition-colors`,onClick:()=>n(`/runner/${e.id}`),children:[(0,L.jsx)(`td`,{className:`${d_.name} font-medium`,children:e.name}),(0,L.jsx)(`td`,{className:`${d_.type} text-muted-foreground`,children:e.type}),(0,L.jsx)(`td`,{className:`${d_.schedule} font-mono text-xs text-muted-foreground`,children:e.schedule}),(0,L.jsx)(`td`,{className:d_.status,children:(0,L.jsx)(u_,{status:e.enabled?e.status:`disabled`})}),(0,L.jsx)(`td`,{className:`${d_.lastRun} text-muted-foreground text-xs`,children:f_(e.lastRun)}),(0,L.jsx)(`td`,{className:d_.action,children:(0,L.jsx)(Ym,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,title:`Run Now`,onClick:n=>{n.stopPropagation(),t(e.id)},children:(0,L.jsx)(ll,{className:`h-3.5 w-3.5`})})})]},e.id))})})})}function __(e,t){return[...e].sort((e,n)=>{if(t.column){let r=v_(e,n,t.column);if(r!==0)return t.direction===`asc`?r:-r}let r=y_(e.lastRun,n.lastRun);return r===0?e.name.localeCompare(n.name):-r})}function v_(e,t,n){switch(n){case`name`:return e.name.localeCompare(t.name);case`type`:return e.type.localeCompare(t.type);case`schedule`:return e.schedule.localeCompare(t.schedule);case`status`:{let n=e.enabled?e.status??``:`disabled`,r=t.enabled?t.status??``:`disabled`;return n.localeCompare(r)}case`lastRun`:return y_(e.lastRun,t.lastRun);default:return 0}}function y_(e,t){return!e&&!t?0:e?t?e<t?-1:e>t?1:0:1:-1}function b_(e,t){return e.column===t?e.direction===`desc`?{column:t,direction:`asc`}:{column:null,direction:`desc`}:{column:t,direction:`desc`}}function x_({label:e,value:t,color:n}){return(0,L.jsxs)(`div`,{className:`flex flex-col items-center px-3 py-1`,children:[(0,L.jsx)(`span`,{className:`text-lg font-bold leading-tight ${n}`,children:t}),(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e})]})}function S_({stats:e}){return e?(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 px-2 py-1 bg-muted/50 rounded-lg`,children:[(0,L.jsx)(x_,{label:`Total`,value:e.totalJobs,color:`text-foreground`}),(0,L.jsx)(x_,{label:`Running`,value:e.running,color:`text-yellow-600 dark:text-yellow-400`}),(0,L.jsx)(x_,{label:`OK (1h)`,value:e.okLastHour,color:`text-green-600 dark:text-green-400`}),(0,L.jsx)(x_,{label:`Errors (1h)`,value:e.errorsLastHour,color:`text-red-600 dark:text-red-400`})]}):(0,L.jsx)(`div`,{className:`flex items-center gap-4 p-4 bg-muted/50 rounded-lg`,children:(0,L.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Loading stats...`})})}var C_=`/api/runner`;async function w_(e,t){let n=await fetch(Rn(`${C_}${e}`),{...t,credentials:`same-origin`});if(n.status===401)throw window.location.href=`/auth/login?returnTo=${encodeURIComponent(window.location.pathname)}`,Error(`Unauthorized`);if(!n.ok){let e=await n.text();throw Error(`Runner API error ${String(n.status)}: ${e}`)}return n.json()}function T_(e){return{id:e.id,name:e.name,type:e.type,schedule:e.schedule,enabled:e.enabled===1,overlapPolicy:e.overlap_policy,status:e.last_status,lastRun:e.last_run,description:e.description}}function E_(e){return{id:e.id,jobId:e.job_id,status:e.status,trigger:e.trigger,startedAt:e.started_at,finishedAt:e.finished_at,durationMs:e.duration_ms,exitCode:e.exit_code,stdoutTail:e.stdout_tail,stderrTail:e.stderr_tail}}async function D_(){return await w_(`/status`)}async function O_(){return(await w_(`/jobs`)).jobs.map(T_)}async function k_(e){return T_((await w_(`/jobs/${encodeURIComponent(e)}`)).job)}async function A_(e,t=20){return(await w_(`/jobs/${encodeURIComponent(e)}/runs?limit=${String(t)}`)).runs.map(E_)}async function j_(e){return w_(`/jobs/${encodeURIComponent(e)}/run`,{method:`POST`})}async function M_(e){return w_(`/jobs/${encodeURIComponent(e)}/enable`,{method:`POST`})}async function N_(e){return w_(`/jobs/${encodeURIComponent(e)}/disable`,{method:`POST`})}var P_=1e4;function F_(){let[e,t]=(0,m.useState)([]),[n,r]=(0,m.useState)(null),[i,a]=(0,m.useState)(null),[o,c]=(0,m.useState)(!0),[l,u]=(0,m.useState)(!0),[d,f]=(0,m.useState)({column:null,direction:`desc`}),p=(0,m.useRef)(null),[h,g]=s(),{isInsider:_,searchEnabled:v,keyCreatedAt:y,rotateKey:b}=$n(),x=y?`${Math.floor((Date.now()-new Date(y).getTime())/864e5)}d`:null,S=(0,m.useCallback)(async()=>{try{let[e,n]=await Promise.all([O_(),D_()]);t(e),r(n),a(null)}catch(e){a(e instanceof Error?e.message:`Failed to fetch runner data`)}finally{c(!1)}},[]);(0,m.useEffect)(()=>{S()},[S]),(0,m.useEffect)(()=>(l&&(p.current=setInterval(()=>void S(),P_)),()=>{p.current&&clearInterval(p.current)}),[l,S]);let C=(0,m.useCallback)(async e=>{try{await j_(e),await S()}catch{await S()}},[S]),w=(0,m.useCallback)(e=>{f(t=>b_(t,e))},[]),T=(0,m.useMemo)(()=>__(e,d),[e,d]);return(0,L.jsx)(`div`,{className:`h-screen overflow-hidden ${h===`dark`?`dark`:``}`,children:(0,L.jsxs)(`div`,{className:`h-full flex flex-col bg-background text-foreground`,children:[(0,L.jsx)(Qg,{breadcrumbs:[{label:`Runner`,path:`runner`}],isInsider:_,searchEnabled:v,theme:h,onToggleTheme:g,keyAge:x,onRotateKey:b}),(0,L.jsxs)(`div`,{className:`shrink-0 max-w-6xl mx-auto w-full px-4 pt-2 pb-1 flex items-center justify-between`,children:[!o&&(0,L.jsx)(S_,{stats:n}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,L.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:l,onChange:e=>u(e.target.checked),className:`rounded`}),`Auto-refresh`]}),(0,L.jsx)(Ym,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,title:`Refresh now`,onClick:()=>void S(),children:(0,L.jsx)(pl,{className:`h-3.5 w-3.5`})})]})]}),i&&(0,L.jsx)(`div`,{className:`shrink-0 max-w-6xl mx-auto w-full px-4 pt-2`,children:(0,L.jsx)(`div`,{className:`bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 text-red-700 dark:text-red-400 px-4 py-3 rounded-lg text-sm`,children:i})}),o?(0,L.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-muted-foreground`,children:`Loading...`}):(0,L.jsx)(`div`,{className:`flex-1 min-h-0 max-w-6xl mx-auto w-full px-4 pt-1 flex flex-col`,children:(0,L.jsxs)(`div`,{className:`flex-1 min-h-0 bg-card border border-border rounded-lg flex flex-col`,children:[(0,L.jsx)(`div`,{className:`shrink-0`,children:(0,L.jsx)(h_,{sort:d,onSort:w})}),(0,L.jsx)(`div`,{className:`flex-1 overflow-y-auto pb-32`,children:(0,L.jsx)(g_,{jobs:T,onRunNow:e=>void C(e)})})]})})]})})}function I_(e){if(e===null)return`—`;if(e<1e3)return`${String(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;let n=Math.floor(t/60),r=Math.round(t%60);return`${String(n)}m ${String(r)}s`}function L_(e){if(!e)return`—`;try{return new Date(e).toLocaleString()}catch{return e}}function R_({runs:e}){let[t,n]=(0,m.useState)(new Set),r=e=>{let t=String(e);n(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})};return e.length===0?(0,L.jsx)(`div`,{className:`text-center py-6 text-muted-foreground text-sm`,children:`No runs yet`}):(0,L.jsx)(`div`,{className:`overflow-x-auto`,children:(0,L.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,L.jsx)(`thead`,{children:(0,L.jsxs)(`tr`,{className:`border-b border-border text-left`,children:[(0,L.jsx)(`th`,{className:`px-3 py-2 w-8`}),(0,L.jsx)(`th`,{className:`px-3 py-2 font-medium text-muted-foreground`,children:`Status`}),(0,L.jsx)(`th`,{className:`px-3 py-2 font-medium text-muted-foreground`,children:`Trigger`}),(0,L.jsx)(`th`,{className:`px-3 py-2 font-medium text-muted-foreground`,children:`Started`}),(0,L.jsx)(`th`,{className:`px-3 py-2 font-medium text-muted-foreground`,children:`Duration`}),(0,L.jsx)(`th`,{className:`px-3 py-2 font-medium text-muted-foreground`,children:`Exit`})]})}),(0,L.jsx)(`tbody`,{children:e.map(e=>(0,L.jsx)(z_,{run:e,isExpanded:t.has(String(e.id)),onToggle:()=>r(e.id)},e.id))})]})})}function z_({run:e,isExpanded:t,onToggle:n}){let r=e.stdoutTail||e.stderrTail;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`tr`,{className:`border-b border-border transition-colors ${r?`cursor-pointer hover:bg-muted/50`:``}`,onClick:r?n:void 0,children:[(0,L.jsx)(`td`,{className:`px-3 py-2`,children:r&&(t?(0,L.jsx)(Kc,{className:`h-4 w-4 text-muted-foreground`}):(0,L.jsx)(qc,{className:`h-4 w-4 text-muted-foreground`}))}),(0,L.jsx)(`td`,{className:`px-3 py-2`,children:(0,L.jsx)(u_,{status:e.status})}),(0,L.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground`,children:e.trigger}),(0,L.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground text-xs`,children:L_(e.startedAt)}),(0,L.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground text-xs`,children:I_(e.durationMs)}),(0,L.jsx)(`td`,{className:`px-3 py-2 font-mono text-xs`,children:e.exitCode===null?`—`:String(e.exitCode)})]}),t&&r&&(0,L.jsx)(`tr`,{children:(0,L.jsxs)(`td`,{colSpan:6,className:`px-3 py-2 bg-muted/30`,children:[(0,L.jsx)(B_,{label:`stdout`,content:e.stdoutTail}),(0,L.jsx)(B_,{label:`stderr`,content:e.stderrTail})]})})]})}function B_({label:e,content:t}){return t?(0,L.jsxs)(`div`,{className:`mb-2 last:mb-0`,children:[(0,L.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground mb-1`,children:e}),(0,L.jsx)(`pre`,{className:`text-xs bg-zinc-900 text-zinc-200 p-2 rounded overflow-x-auto max-h-48 whitespace-pre-wrap`,children:t})]}):null}function V_(){let{jobId:e}=Xe(),[t,n]=(0,m.useState)(null),[r,i]=(0,m.useState)([]),[a,o]=(0,m.useState)(null),[c,l]=(0,m.useState)(!0),[u,d]=s(),{isInsider:f,searchEnabled:p,keyCreatedAt:h,rotateKey:g}=$n(),_=h?`${Math.floor((Date.now()-new Date(h).getTime())/864e5)}d`:null,v=(0,m.useCallback)(async()=>{if(e)try{let[t,r]=await Promise.all([k_(e),A_(e,50)]);n(t),i(r),o(null)}catch(e){o(e instanceof Error?e.message:`Failed to fetch job`)}finally{l(!1)}},[e]);(0,m.useEffect)(()=>{v()},[v]);let y=(0,m.useCallback)(async()=>{if(t)try{t.enabled?await N_(t.id):await M_(t.id),await v()}catch{await v()}},[t,v]),b=(0,m.useCallback)(async()=>{if(t)try{await j_(t.id),setTimeout(()=>void v(),500)}catch{await v()}},[t,v]),x=[{label:`Runner`,path:`runner`},{label:t?.name??e??``,path:`runner/${e}`}];return(0,L.jsx)(`div`,{className:`h-screen overflow-hidden ${u===`dark`?`dark`:``}`,children:(0,L.jsxs)(`div`,{className:`h-full flex flex-col bg-background text-foreground`,children:[(0,L.jsx)(Qg,{breadcrumbs:x,isInsider:f,searchEnabled:p,theme:u,onToggleTheme:d,keyAge:_,onRotateKey:g}),(0,L.jsxs)(`div`,{className:`flex-1 overflow-y-auto max-w-4xl mx-auto px-4 py-6 pb-32 space-y-6 w-full`,children:[(0,L.jsxs)(mn,{to:`/runner`,className:`inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors`,children:[(0,L.jsx)(Vc,{className:`h-4 w-4`}),`Back to jobs`]}),a&&(0,L.jsx)(`div`,{className:`bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 text-red-700 dark:text-red-400 px-4 py-3 rounded-lg text-sm`,children:a}),c?(0,L.jsx)(`div`,{className:`text-center py-12 text-muted-foreground`,children:`Loading...`}):t?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`bg-card border border-border rounded-lg p-4 space-y-4`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-xl font-semibold`,children:t.name}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-sm text-muted-foreground`,children:[(0,L.jsxs)(`span`,{children:[`Type: `,(0,L.jsx)(`span`,{className:`text-foreground`,children:t.type})]}),(0,L.jsxs)(`span`,{children:[`Schedule: `,(0,L.jsx)(`code`,{className:`text-xs bg-muted px-1 py-0.5 rounded`,children:t.schedule})]}),(0,L.jsxs)(`span`,{children:[`Overlap: `,(0,L.jsx)(`span`,{className:`text-foreground`,children:t.overlapPolicy})]})]})]}),(0,L.jsx)(u_,{status:t.enabled?t.status:`disabled`})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 pt-2 border-t border-border`,children:[(0,L.jsx)(Ym,{variant:`outline`,size:`sm`,onClick:()=>void y(),className:`gap-1.5`,children:t.enabled?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(dl,{className:`h-3.5 w-3.5`}),` Disable`]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(fl,{className:`h-3.5 w-3.5`}),` Enable`]})}),(0,L.jsxs)(Ym,{variant:`outline`,size:`sm`,onClick:()=>void b(),className:`gap-1.5`,children:[(0,L.jsx)(ll,{className:`h-3.5 w-3.5`}),`Run Now`]})]})]}),(0,L.jsxs)(`div`,{className:`bg-card border border-border rounded-lg overflow-hidden`,children:[(0,L.jsx)(`div`,{className:`px-4 py-3 border-b border-border`,children:(0,L.jsx)(`h2`,{className:`text-sm font-medium text-muted-foreground`,children:`Run History`})}),(0,L.jsx)(R_,{runs:r})]})]}):(0,L.jsx)(`div`,{className:`text-center py-12 text-muted-foreground`,children:`Job not found`})]})]})})}function H_(){return(0,L.jsx)(er,{children:(0,L.jsx)(dn,{children:(0,L.jsxs)(St,{children:[(0,L.jsx)(bt,{path:`/runner/:jobId`,element:(0,L.jsx)(V_,{})}),(0,L.jsx)(bt,{path:`/runner`,element:(0,L.jsx)(F_,{})}),(0,L.jsx)(bt,{path:`/browse/*`,element:(0,L.jsx)(o_,{})}),(0,L.jsx)(bt,{path:`/`,element:(0,L.jsx)(s_,{})})]})})})}(0,Nn.createRoot)(document.getElementById(`root`)).render((0,L.jsx)(m.StrictMode,{children:(0,L.jsx)(H_,{})}));export{G as n,Gc as t};