Ampel / ampel (push) Failing after 25s
Der Zugewinn gegenueber einer reinen Liste: Ein stiller Tag und eine durchgearbeitete
Nacht sehen in einer Liste gleich aus — man muss scrollen, um es zu merken. Die
Dichteleiste macht das Muster sichtbar, bevor man den ersten Eintrag liest.
48 Stufen ueber den gezeigten Zeitraum, Achsenbeschriftung an beiden Enden, und beim
Filtern zeigt sie nur die Treffer (dann in kraeftigerem Ton).
Bewusst eigenes SVG-freies Markup statt einer Diagramm-Bibliothek: Es sind Rechtecke
ueber einer Zeitachse. Recharts dafuer zu laden waere 95 kB fuer etwas, das in 30
Zeilen passt — genau der Reflex, der in P0 das Startbuendel aufgeblaeht hatte.
Eine Kleinigkeit mit Absicht: Ein einzelner Eintrag bekommt 12 % Mindesthoehe. Ohne
sie saehe ein ruhiger Tag aus wie gar keine Aktivitaet — genau die Verwechslung, die
die Leiste verhindern soll. Dafuer gibt es einen eigenen Test.
Verifiziert gegen die echte Box:
150 Eintraege vom 02.08. bis 28.08., 25 von 48 Stufen belegt, Hoehen gestaffelt
Filter "update" -> 30 von 150, Leiste zeigt nur noch die Treffer und wird
hervorgehoben, Adresse /chronik?q=update
59 Tests gruen (5 neue) · ESLint 0 Fehler · Einstieg 133 400 B gzip / Budget 140 000.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
52 lines
56 KiB
JavaScript
52 lines
56 KiB
JavaScript
import{c as It,r as a,j as E,at as be,W as In,au as An,$ as _n,av as Mn,aw as ht,z as Tn,n as Ln,T as Fn,b as jn}from"./index-l6kyKCL9.js";import{r as At}from"./index-GVsa8kqq.js";import{C as $n,a as Wn}from"./cloud-download-YEWUSwEY.js";import{R as Un}from"./refresh-cw-BV1qZMSR.js";import{S as Bn}from"./search-C1Zs6OOf.js";import{F as Vn}from"./file-text-nO0jfgun.js";/**
|
|
* @license lucide-react v0.460.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const zn=It("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
|
|
* @license lucide-react v0.460.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const Kn=It("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);var gt=1,Hn=.9,Yn=.8,Gn=.17,Me=.1,Te=.999,Xn=.9999,qn=.99,Zn=/[\\\/_+.#"@\[\(\{&]/,Jn=/[\\\/_+.#"@\[\(\{&]/g,Qn=/[\s-]/,_t=/[\s-]/g;function Ve(e,t,n,r,o,s,i){if(s===t.length)return o===e.length?gt:qn;var c=`${o},${s}`;if(i[c]!==void 0)return i[c];for(var u=r.charAt(s),d=n.indexOf(u,o),f=0,l,v,b,h;d>=0;)l=Ve(e,t,n,r,d+1,s+1,i),l>f&&(d===o?l*=gt:Zn.test(e.charAt(d-1))?(l*=Yn,b=e.slice(o,d-1).match(Jn),b&&o>0&&(l*=Math.pow(Te,b.length))):Qn.test(e.charAt(d-1))?(l*=Hn,h=e.slice(o,d-1).match(_t),h&&o>0&&(l*=Math.pow(Te,h.length))):(l*=Gn,o>0&&(l*=Math.pow(Te,d-o))),e.charAt(d)!==t.charAt(s)&&(l*=Xn)),(l<Me&&n.charAt(d-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(d-1)!==r.charAt(s))&&(v=Ve(e,t,n,r,d+1,s+2,i),v*Me>l&&(l=v*Me)),l>f&&(f=l),d=n.indexOf(u,d+1);return i[c]=f,f}function bt(e){return e.toLowerCase().replace(_t," ")}function er(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Ve(e,t,bt(e),bt(t),0,0,{})}var tr=Object.defineProperty,me=(e,t)=>tr(e,"name",{value:t,configurable:!0}),Mt=!!(typeof window<"u"&&window.document&&window.document.createElement);function Q(e,t,{checkForDefaultPrevented:n=!0}={}){return me(function(o){if(e==null||e(o),n===!1||!o||!o.defaultPrevented)return t==null?void 0:t(o)},"handleEvent")}me(Q,"composeEventHandlers");function nr(e){var t;if(!Mt)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}me(nr,"getOwnerWindow");function ze(e){if(!Mt)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}me(ze,"getOwnerDocument");function Tt(e,t=!1){const{activeElement:n}=ze(e);if(!(n!=null&&n.nodeName))return null;if(Lt(n)&&n.contentDocument)return Tt(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=ze(n).getElementById(r);if(o)return o}}return n}me(Tt,"getActiveElement");function Lt(e){return e.tagName==="IFRAME"}me(Lt,"isFrame");var rr=Object.defineProperty,nt=(e,t)=>rr(e,"name",{value:t,configurable:!0});function Ke(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}nt(Ke,"setRef");function ee(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ke(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Ke(e[o],null)}}}}nt(ee,"composeRefs");function pe(...e){return a.useCallback(ee(...e),e)}nt(pe,"useComposedRefs");var or=Object.defineProperty,j=(e,t)=>or(e,"name",{value:t,configurable:!0});function ar(e,t){const n=a.createContext(t);n.displayName=e+"Context";const r=j(s=>{const{children:i,...c}=s,u=a.useMemo(()=>c,Object.values(c));return E.jsx(n.Provider,{value:u,children:i})},"Provider");r.displayName=e+"Provider";function o(s,i={}){const{optional:c=!1}=i,u=a.useContext(n);if(u)return u;if(t!==void 0)return t;if(!c)throw new Error(`\`${s}\` must be used within \`${e}\``)}return j(o,"useContext"),[r,o]}j(ar,"createContext");function Ft(e,t=[]){let n=[];function r(s,i){const c=a.createContext(i);c.displayName=s+"Context";const u=n.length;n=[...n,i];const d=j(l=>{var w;const{scope:v,children:b,...h}=l,p=((w=v==null?void 0:v[e])==null?void 0:w[u])||c,g=a.useMemo(()=>h,Object.values(h));return E.jsx(p.Provider,{value:g,children:b})},"Provider");d.displayName=s+"Provider";function f(l,v,b={}){var w;const{optional:h=!1}=b,p=((w=v==null?void 0:v[e])==null?void 0:w[u])||c,g=a.useContext(p);if(g)return g;if(i!==void 0)return i;if(!h)throw new Error(`\`${l}\` must be used within \`${s}\``)}return j(f,"useContext"),[d,f]}j(r,"createContext");const o=j(()=>{const s=n.map(i=>a.createContext(i));return j(function(c){const u=(c==null?void 0:c[e])||s;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])},"useScope")},"createScope");return o.scopeName=e,[r,jt(o,...t)]}j(Ft,"createContextScope");function jt(...e){const t=e[0];if(e.length===1)return t;const n=j(()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return j(function(s){const i=r.reduce((c,{useScope:u,scopeName:d})=>{const l=u(s)[`__scope${d}`];return{...c,...l}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}j(jt,"composeContextScopes");var fe=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},ir=Object.defineProperty,sr=(e,t)=>ir(e,"name",{value:t,configurable:!0}),cr=be[" useId ".trim().toString()]||(()=>{}),ur=0;function V(e){const[t,n]=a.useState(cr());return fe(()=>{e||n(r=>r??String(ur++))},[e]),e||(t?`radix-${t}`:"")}sr(V,"useId");var lr=Object.defineProperty,dr=(e,t)=>lr(e,"name",{value:t,configurable:!0}),yt=be[" useEffectEvent ".trim().toString()],Et=be[" useInsertionEffect ".trim().toString()];function $t(e){if(typeof yt=="function")return yt(e);const t=a.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Et=="function"?Et(()=>{t.current=e}):fe(()=>{t.current=e}),a.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}dr($t,"useEffectEvent");var fr=Object.defineProperty,ye=(e,t)=>fr(e,"name",{value:t,configurable:!0}),vr=be[" useInsertionEffect ".trim().toString()]||fe;function Wt({prop:e,defaultProp:t,onChange:n=ye(()=>{},"onChange"),caller:r}){const[o,s,i]=Ut({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:o,d=a.useCallback(f=>{var l;if(c){const v=Bt(f)?f(e):f;v!==e&&((l=i.current)==null||l.call(i,v))}else s(f)},[c,e,s,i]);return[u,d]}ye(Wt,"useControllableState");function Ut({defaultProp:e,onChange:t}){const[n,r]=a.useState(e),o=a.useRef(n),s=a.useRef(t);return vr(()=>{s.current=t},[t]),a.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}ye(Ut,"useUncontrolledState");function Bt(e){return typeof e=="function"}ye(Bt,"isFunction");var wt=Symbol("RADIX:SYNC_STATE");function mr(e,t,n,r){const{prop:o,defaultProp:s,onChange:i,caller:c}=t,u=o!==void 0,d=$t(i),f=[{...n,state:s}];r&&f.push(r);const[l,v]=a.useReducer((g,w)=>{if(w.type===wt)return{...g,state:w.state};const S=e(g,w);return u&&!Object.is(S.state,g.state)&&d(S.state),S},...f),b=l.state,h=a.useRef(b);a.useEffect(()=>{h.current!==b&&(h.current=b,u||d(b))},[b,h,u]);const p=a.useMemo(()=>o!==void 0?{...l,state:o}:l,[l,o]);return a.useEffect(()=>{u&&!Object.is(o,l.state)&&v({type:wt,state:o})},[o,l.state,u]),[p,v]}ye(mr,"useControllableStateReducer");var pr=Object.defineProperty,W=(e,t)=>pr(e,"name",{value:t,configurable:!0});function rt(e){const t=a.forwardRef((n,r)=>{let{children:o,...s}=n,i=null,c=!1;const u=[];He(o)&&typeof Se=="function"&&(o=Se(o._payload)),a.Children.forEach(o,v=>{var b;if(Ht(v)){c=!0;const h=v;let p="child"in h.props?h.props.child:h.props.children;He(p)&&typeof Se=="function"&&(p=Se(p._payload)),i=gr(h,p),u.push((b=i==null?void 0:i.props)==null?void 0:b.children)}else u.push(v)}),i?i=a.cloneElement(i,void 0,u):!c&&a.Children.count(o)===1&&a.isValidElement(o)&&(i=o);const d=i?Kt(i):void 0,f=pe(r,d);if(!i){if(o||o===0)throw new Error(c?Er(e):yr(e));return o}const l=zt(s,i.props??{});return i.type!==a.Fragment&&(l.ref=r?f:d),a.cloneElement(i,l)});return t.displayName=`${e}.Slot`,t}W(rt,"createSlot");var Vt=Symbol.for("radix.slottable");function hr(e){const t=W(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=Vt,t}W(hr,"createSlottable");var gr=W((e,t)=>{if("child"in e.props){const n=e.props.child;return a.isValidElement(n)?a.cloneElement(n,void 0,e.props.children(n.props.children)):null}return a.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function zt(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}W(zt,"mergeProps");function Kt(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}W(Kt,"getElementRef");function Ht(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vt}W(Ht,"isSlottable");var br=Symbol.for("react.lazy");function He(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===br&&"_payload"in e&&Yt(e._payload)}W(He,"isLazyComponent");function Yt(e){return typeof e=="object"&&e!==null&&"then"in e}W(Yt,"isPromiseLike");var yr=W(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),Er=W(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Se=be[" use ".trim().toString()],wr=Object.defineProperty,Sr=(e,t)=>wr(e,"name",{value:t,configurable:!0}),Cr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$=Cr.reduce((e,t)=>{const n=rt(`Primitive.${t}`),r=a.forwardRef((o,s)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),E.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Gt(e,t){e&&At.flushSync(()=>e.dispatchEvent(t))}Sr(Gt,"dispatchDiscreteCustomEvent");var xr=Object.defineProperty,Pr=(e,t)=>xr(e,"name",{value:t,configurable:!0});function ve(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}Pr(ve,"useCallbackRef");var Rr=Object.defineProperty,_=(e,t)=>Rr(e,"name",{value:t,configurable:!0}),Ye="dismissableLayer.update",Or="dismissableLayer.pointerDownOutside",Dr="dismissableLayer.focusOutside",St,Xt=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),kr=a.forwardRef(_(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:c,onInteractOutside:u,onDismiss:d,...f}=t,l=a.useContext(Xt),[v,b]=a.useState(null),h=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=a.useState({}),g=pe(n,b),w=Array.from(l.layers),[S]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),x=S?w.indexOf(S):-1,O=v?w.indexOf(v):-1,R=l.layersWithOutsidePointerEventsDisabled.size>0,P=O>=x,N=a.useRef(!1),X=Zt(I=>{i==null||i(I),u==null||u(I),I.defaultPrevented||d==null||d()},{ownerDocument:h,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:N,dismissableSurfaces:l.dismissableSurfaces,shouldHandlePointerDownOutside:a.useCallback(I=>{if(!(I instanceof Node))return!1;const re=[...l.branches].some(K=>K.contains(I));return P&&!re},[l.branches,P])}),z=Jt(I=>{if(o&&N.current)return;const re=I.target;[...l.branches].some(J=>J.contains(re))||(c==null||c(I),u==null||u(I),I.defaultPrevented||d==null||d())},h),q=v?O===w.length-1:!1,F=ve(I=>{I.key==="Escape"&&(s==null||s(I),!I.defaultPrevented&&d&&(I.preventDefault(),d()))});return a.useEffect(()=>{if(q)return h.addEventListener("keydown",F,{capture:!0}),()=>h.removeEventListener("keydown",F,{capture:!0})},[h,q,F]),a.useEffect(()=>{if(v)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(St=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(v)),l.layers.add(v),Ge(),()=>{r&&(l.layersWithOutsidePointerEventsDisabled.delete(v),l.layersWithOutsidePointerEventsDisabled.size===0&&(h.body.style.pointerEvents=St))}},[v,h,r,l]),a.useEffect(()=>()=>{v&&(l.layers.delete(v),l.layersWithOutsidePointerEventsDisabled.delete(v),Ge())},[v,l]),a.useEffect(()=>{const I=_(()=>p({}),"handleUpdate");return document.addEventListener(Ye,I),()=>document.removeEventListener(Ye,I)},[]),E.jsx($.div,{...f,ref:g,style:{pointerEvents:R?P?"auto":"none":void 0,...t.style},onFocusCapture:Q(t.onFocusCapture,z.onFocusCapture),onBlurCapture:Q(t.onBlurCapture,z.onBlurCapture),onPointerDownCapture:Q(t.onPointerDownCapture,X.onPointerDownCapture)})},"DismissableLayer"));function qt(){const e=a.useContext(Xt),[t,n]=a.useState(null);return a.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}_(qt,"useDismissableLayerSurface");var Nr=_(()=>!0,"IS_TRUE");function Zt(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:i=Nr}=t,c=ve(e),u=a.useRef(!1),d=a.useRef(!1),f=a.useRef(new Map),l=a.useRef(()=>{});return a.useEffect(()=>{function v(){d.current=!1,o.current=!1,f.current.clear()}_(v,"resetOutsideInteraction");function b(){return Array.from(f.current.values()).some(Boolean)}_(b,"isOutsideInteractionIntercepted");function h(x){if(!d.current)return;const O=x.target;O instanceof Node&&[...s].some(P=>P.contains(O))||f.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{d.current&&l.current()},0)}_(h,"handleInteractionCapture");function p(x){d.current&&f.current.set(x.type,!1)}_(p,"handleInteractionBubble");const g=_(x=>{if(x.target&&!u.current){let O=function(){n.removeEventListener("click",l.current);const P=b();v(),P||ot(Or,c,R,{discrete:!0})};if(_(O,"handleAndDispatchPointerDownOutsideEvent"),!i(x.target)){n.removeEventListener("click",l.current),v(),u.current=!1;return}const R={originalEvent:x};d.current=!0,o.current=r&&x.button===0,f.current.clear(),!r||x.button!==0?O():(n.removeEventListener("click",l.current),l.current=O,n.addEventListener("click",l.current,{once:!0}))}else n.removeEventListener("click",l.current),v();u.current=!1},"handlePointerDown"),w=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const x of w)n.addEventListener(x,h,!0),n.addEventListener(x,p);const S=window.setTimeout(()=>{n.addEventListener("pointerdown",g)},0);return()=>{window.clearTimeout(S),n.removeEventListener("pointerdown",g),n.removeEventListener("click",l.current);for(const x of w)n.removeEventListener(x,h,!0),n.removeEventListener(x,p)}},[n,c,r,o,s,i]),{onPointerDownCapture:_(()=>u.current=!0,"onPointerDownCapture")}}_(Zt,"usePointerDownOutside");function Jt(e,t=globalThis==null?void 0:globalThis.document){const n=ve(e),r=a.useRef(!1);return a.useEffect(()=>{const o=_(s=>{s.target&&!r.current&&ot(Dr,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:_(()=>r.current=!0,"onFocusCapture"),onBlurCapture:_(()=>r.current=!1,"onBlurCapture")}}_(Jt,"useFocusOutside");function Ge(){const e=new CustomEvent(Ye);document.dispatchEvent(e)}_(Ge,"dispatchUpdate");function ot(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Gt(o,s):o.dispatchEvent(s)}_(ot,"handleAndDispatchCustomEvent");var Ir=Object.defineProperty,T=(e,t)=>Ir(e,"name",{value:t,configurable:!0}),Le="focusScope.autoFocusOnMount",Fe="focusScope.autoFocusOnUnmount",Ct={bubbles:!1,cancelable:!0},Ar=a.forwardRef(T(function(t,n){const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...c}=t,[u,d]=a.useState(null),f=ve(s),l=ve(i),v=a.useRef(null),b=pe(n,d),h=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(o){let g=function(O){if(h.paused||!u)return;const R=O.target;u.contains(R)?v.current=R:H(v.current,{select:!0})},w=function(O){if(h.paused||!u)return;const R=O.relatedTarget;R!==null&&(u.contains(R)||H(v.current,{select:!0}))},S=function(O){if(document.activeElement===document.body)for(const P of O)P.removedNodes.length>0&&H(u)};T(g,"handleFocusIn"),T(w,"handleFocusOut"),T(S,"handleMutations"),document.addEventListener("focusin",g),document.addEventListener("focusout",w);const x=new MutationObserver(S);return u&&x.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",w),x.disconnect()}}},[o,u,h.paused]),a.useEffect(()=>{if(u){xt.add(h);const g=document.activeElement;if(!u.contains(g)){const S=new CustomEvent(Le,Ct);u.addEventListener(Le,f),u.dispatchEvent(S),S.defaultPrevented||(Qt(on(at(u)),{select:!0}),document.activeElement===g&&H(u))}return()=>{u.removeEventListener(Le,f),setTimeout(()=>{const S=new CustomEvent(Fe,Ct);u.addEventListener(Fe,l),u.dispatchEvent(S),S.defaultPrevented||H(g??document.body,{select:!0}),u.removeEventListener(Fe,l),xt.remove(h)},0)}}},[u,f,l,h]);const p=a.useCallback(g=>{if(!r&&!o||h.paused)return;const w=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,S=document.activeElement;if(w&&S){const x=g.currentTarget,[O,R]=en(x);O&&R?!g.shiftKey&&S===R?(g.preventDefault(),r&&H(O,{select:!0})):g.shiftKey&&S===O&&(g.preventDefault(),r&&H(R,{select:!0})):S===x&&g.preventDefault()}},[r,o,h.paused]);return E.jsx($.div,{tabIndex:-1,...c,ref:b,onKeyDown:p})},"FocusScope"));function Qt(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(H(r,{select:t}),document.activeElement!==n)return}T(Qt,"focusFirst");function en(e){const t=at(e),n=Xe(t,e),r=Xe(t.reverse(),e);return[n,r]}T(en,"getTabbableEdges");function at(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:T(r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}T(at,"getTabbableCandidates");function Xe(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):tn(r,{upTo:t})))return r}T(Xe,"findVisible");function tn(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}T(tn,"isHidden");function nn(e){return e instanceof HTMLInputElement&&"select"in e}T(nn,"isSelectableInput");function H(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&nn(e)&&t&&e.select()}}T(H,"focus");var xt=rn();function rn(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=qe(e,t),e.unshift(t)},remove(t){var n;e=qe(e,t),(n=e[0])==null||n.resume()}}}T(rn,"createFocusScopesStack");function qe(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}T(qe,"arrayRemove");function on(e){return e.filter(t=>t.tagName!=="A")}T(on,"removeLinks");var _r=Object.defineProperty,Mr=(e,t)=>_r(e,"name",{value:t,configurable:!0}),Tr=a.forwardRef(Mr(function(t,n){var u;const{container:r,...o}=t,[s,i]=a.useState(!1);fe(()=>i(!0),[]);const c=r||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?At.createPortal(E.jsx($.div,{...o,ref:n}),c):null},"Portal")),Lr=Object.defineProperty,Y=(e,t)=>Lr(e,"name",{value:t,configurable:!0});function an(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}Y(an,"useStateMachine");var it=Y(e=>{const{present:t,children:n}=e,r=sn(t),o=typeof n=="function"?n({present:r.isPresent}):a.Children.only(n),s=cn(r.ref,un(o));return typeof n=="function"||r.isPresent?a.cloneElement(o,{ref:s}):null},"Presence");function sn(e){const[t,n]=a.useState(),r=a.useRef(null),o=a.useRef(e),s=a.useRef("none"),i=a.useRef(void 0),c=e?"mounted":"unmounted",[u,d]=an(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{u==="mounted"?(s.current=i.current??ce(r.current),i.current=void 0):s.current="none"},[u]),fe(()=>{const f=r.current,l=o.current;if(l!==e){const b=s.current,h=ce(f);e?(i.current=h,d("MOUNT")):h==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(l&&b!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),fe(()=>{if(t){let f;const l=t.ownerDocument.defaultView??window,v=Y(h=>{const g=ce(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&g&&(d("ANIMATION_END"),!o.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",f=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},"handleAnimationEnd"),b=Y(h=>{h.target===t&&(s.current=ce(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{l.clearTimeout(f),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:a.useCallback(f=>{if(f){const l=getComputedStyle(f);r.current=l,i.current=ce(l)}else r.current=null;n(f)},[])}}Y(sn,"usePresence");function Ze(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Y(Ze,"setRef");function cn(...e){const t=a.useRef(e);return t.current=e,a.useCallback(n=>{const r=t.current;let o=!1;const s=r.map(i=>{const c=Ze(i,n);return!o&&typeof c=="function"&&(o=!0),c});if(o)return()=>{for(let i=0;i<s.length;i++){const c=s[i];typeof c=="function"?c():Ze(r[i],null)}}},[])}Y(cn,"useStableComposedRefs");function ce(e){return(e==null?void 0:e.animationName)||"none"}Y(ce,"getAnimationName");function un(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Y(un,"getElementRef");var Fr=Object.defineProperty,st=(e,t)=>Fr(e,"name",{value:t,configurable:!0}),Ce=0,U=null;function jr(e){return ct(),e.children}st(jr,"FocusGuards");function ct(){a.useEffect(()=>{U||(U={start:Je(),end:Je()});const{start:e,end:t}=U;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Ce++,()=>{Ce===1&&(U==null||U.start.remove(),U==null||U.end.remove(),U=null),Ce=Math.max(0,Ce-1)}},[])}st(ct,"useFocusGuards");function Je(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}st(Je,"createFocusGuard");var B=function(){return B=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},B.apply(this,arguments)};function ln(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function $r(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var De="right-scroll-bar-position",ke="width-before-scroll-bar",Wr="with-scroll-bars-hidden",Ur="--removed-body-scroll-bar-size";function je(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Br(e,t){var n=a.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Vr=typeof window<"u"?a.useLayoutEffect:a.useEffect,Pt=new WeakMap;function zr(e,t){var n=Br(null,function(r){return e.forEach(function(o){return je(o,r)})});return Vr(function(){var r=Pt.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(c){s.has(c)||je(c,null)}),s.forEach(function(c){o.has(c)||je(c,i)})}Pt.set(n,e)},[e]),n}function Kr(e){return e}function Hr(e,t){t===void 0&&(t=Kr);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(c){return c!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var c=n;n=[],c.forEach(s),i=n}var u=function(){var f=i;i=[],f.forEach(s)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(f){i.push(f),d()},filter:function(f){return i=i.filter(f),n}}}};return o}function Yr(e){e===void 0&&(e={});var t=Hr(null);return t.options=B({async:!0,ssr:!1},e),t}var dn=function(e){var t=e.sideCar,n=ln(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return a.createElement(r,B({},n))};dn.isSideCarExport=!0;function Gr(e,t){return e.useMedium(t),dn}var fn=Yr(),$e=function(){},Ne=a.forwardRef(function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:$e,onWheelCapture:$e,onTouchMoveCapture:$e}),o=r[0],s=r[1],i=e.forwardProps,c=e.children,u=e.className,d=e.removeScrollBar,f=e.enabled,l=e.shards,v=e.sideCar,b=e.noRelative,h=e.noIsolation,p=e.inert,g=e.allowPinchZoom,w=e.as,S=w===void 0?"div":w,x=e.gapMode,O=ln(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=v,P=zr([n,t]),N=B(B({},O),o);return a.createElement(a.Fragment,null,f&&a.createElement(R,{sideCar:fn,removeScrollBar:d,shards:l,noRelative:b,noIsolation:h,inert:p,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:x}),i?a.cloneElement(a.Children.only(c),B(B({},N),{ref:P})):a.createElement(S,B({},N,{className:u,ref:P}),c))});Ne.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ne.classNames={fullWidth:ke,zeroRight:De};var Xr=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function qr(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Xr();return t&&e.setAttribute("nonce",t),e}function Zr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Jr(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Qr=function(){var e=0,t=null;return{add:function(n){e==0&&(t=qr())&&(Zr(t,n),Jr(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},eo=function(){var e=Qr();return function(t,n){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},vn=function(){var e=eo(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},to={left:0,top:0,right:0,gap:0},We=function(e){return parseInt(e||"",10)||0},no=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[We(n),We(r),We(o)]},ro=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return to;var t=no(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},oo=vn(),de="data-scroll-locked",ao=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
.`.concat(Wr,` {
|
|
overflow: hidden `).concat(r,`;
|
|
padding-right: `).concat(c,"px ").concat(r,`;
|
|
}
|
|
body[`).concat(de,`] {
|
|
overflow: hidden `).concat(r,`;
|
|
overscroll-behavior: contain;
|
|
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
padding-left: `.concat(o,`px;
|
|
padding-top: `).concat(s,`px;
|
|
padding-right: `).concat(i,`px;
|
|
margin-left:0;
|
|
margin-top:0;
|
|
margin-right: `).concat(c,"px ").concat(r,`;
|
|
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
}
|
|
|
|
.`).concat(De,` {
|
|
right: `).concat(c,"px ").concat(r,`;
|
|
}
|
|
|
|
.`).concat(ke,` {
|
|
margin-right: `).concat(c,"px ").concat(r,`;
|
|
}
|
|
|
|
.`).concat(De," .").concat(De,` {
|
|
right: 0 `).concat(r,`;
|
|
}
|
|
|
|
.`).concat(ke," .").concat(ke,` {
|
|
margin-right: 0 `).concat(r,`;
|
|
}
|
|
|
|
body[`).concat(de,`] {
|
|
`).concat(Ur,": ").concat(c,`px;
|
|
}
|
|
`)},Rt=function(){var e=parseInt(document.body.getAttribute(de)||"0",10);return isFinite(e)?e:0},io=function(){a.useEffect(function(){return document.body.setAttribute(de,(Rt()+1).toString()),function(){var e=Rt()-1;e<=0?document.body.removeAttribute(de):document.body.setAttribute(de,e.toString())}},[])},so=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;io();var s=a.useMemo(function(){return ro(o)},[o]);return a.createElement(oo,{styles:ao(s,!t,o,n?"":"!important")})},Qe=!1;if(typeof window<"u")try{var xe=Object.defineProperty({},"passive",{get:function(){return Qe=!0,!0}});window.addEventListener("test",xe,xe),window.removeEventListener("test",xe,xe)}catch{Qe=!1}var oe=Qe?{passive:!1}:!1,co=function(e){return e.tagName==="TEXTAREA"},mn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!co(e)&&n[t]==="visible")},uo=function(e){return mn(e,"overflowY")},lo=function(e){return mn(e,"overflowX")},Ot=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=pn(e,r);if(o){var s=hn(e,r),i=s[1],c=s[2];if(i>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fo=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},vo=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},pn=function(e,t){return e==="v"?uo(t):lo(t)},hn=function(e,t){return e==="v"?fo(t):vo(t)},mo=function(e,t){return e==="h"&&t==="rtl"?-1:1},po=function(e,t,n,r,o){var s=mo(e,window.getComputedStyle(t).direction),i=s*r,c=n.target,u=t.contains(c),d=!1,f=i>0,l=0,v=0;do{if(!c)break;var b=hn(e,c),h=b[0],p=b[1],g=b[2],w=p-g-s*h;(h||w)&&pn(e,c)&&(l+=w,v+=h);var S=c.parentNode;c=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(f&&Math.abs(l)<1||!f&&Math.abs(v)<1)&&(d=!0),d},Pe=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Dt=function(e){return[e.deltaX,e.deltaY]},kt=function(e){return e&&"current"in e?e.current:e},ho=function(e,t){return e[0]===t[0]&&e[1]===t[1]},go=function(e){return`
|
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
`)},bo=0,ae=[];function yo(e){var t=a.useRef([]),n=a.useRef([0,0]),r=a.useRef(),o=a.useState(bo++)[0],s=a.useState(vn)[0],i=a.useRef(e);a.useEffect(function(){i.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=$r([e.lockRef.current],(e.shards||[]).map(kt),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=a.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var w=Pe(p),S=n.current,x="deltaX"in p?p.deltaX:S[0]-w[0],O="deltaY"in p?p.deltaY:S[1]-w[1],R,P=p.target,N=Math.abs(x)>Math.abs(O)?"h":"v";if("touches"in p&&N==="h"&&P.type==="range")return!1;var X=window.getSelection(),z=X&&X.anchorNode,q=z?z===P||z.contains(P):!1;if(q)return!1;var F=Ot(N,P);if(!F)return!0;if(F?R=N:(R=N==="v"?"h":"v",F=Ot(N,P)),!F)return!1;if(!r.current&&"changedTouches"in p&&(x||O)&&(r.current=R),!R)return!0;var I=r.current||R;return po(I,g,p,I==="h"?x:O)},[]),u=a.useCallback(function(p){var g=p;if(!(!ae.length||ae[ae.length-1]!==s)){var w="deltaY"in g?Dt(g):Pe(g),S=t.current.filter(function(R){return R.name===g.type&&(R.target===g.target||g.target===R.shadowParent)&&ho(R.delta,w)})[0];if(S&&S.should){g.cancelable&&g.preventDefault();return}if(!S){var x=(i.current.shards||[]).map(kt).filter(Boolean).filter(function(R){return R.contains(g.target)}),O=x.length>0?c(g,x[0]):!i.current.noIsolation;O&&g.cancelable&&g.preventDefault()}}},[]),d=a.useCallback(function(p,g,w,S){var x={name:p,delta:g,target:w,should:S,shadowParent:Eo(w)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(O){return O!==x})},1)},[]),f=a.useCallback(function(p){n.current=Pe(p),r.current=void 0},[]),l=a.useCallback(function(p){d(p.type,Dt(p),p.target,c(p,e.lockRef.current))},[]),v=a.useCallback(function(p){d(p.type,Pe(p),p.target,c(p,e.lockRef.current))},[]);a.useEffect(function(){return ae.push(s),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:v}),document.addEventListener("wheel",u,oe),document.addEventListener("touchmove",u,oe),document.addEventListener("touchstart",f,oe),function(){ae=ae.filter(function(p){return p!==s}),document.removeEventListener("wheel",u,oe),document.removeEventListener("touchmove",u,oe),document.removeEventListener("touchstart",f,oe)}},[]);var b=e.removeScrollBar,h=e.inert;return a.createElement(a.Fragment,null,h?a.createElement(s,{styles:go(o)}):null,b?a.createElement(so,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Eo(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const wo=Gr(fn,yo);var gn=a.forwardRef(function(e,t){return a.createElement(Ne,B({},e,{ref:t,sideCar:wo}))});gn.classNames=Ne.classNames;var So=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ie=new WeakMap,Re=new WeakMap,Oe={},Ue=0,bn=function(e){return e&&(e.host||bn(e.parentNode))},Co=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=bn(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},xo=function(e,t,n,r){var o=Co(t,Array.isArray(e)?e:[e]);Oe[n]||(Oe[n]=new WeakMap);var s=Oe[n],i=[],c=new Set,u=new Set(o),d=function(l){!l||c.has(l)||(c.add(l),d(l.parentNode))};o.forEach(d);var f=function(l){!l||u.has(l)||Array.prototype.forEach.call(l.children,function(v){if(c.has(v))f(v);else try{var b=v.getAttribute(r),h=b!==null&&b!=="false",p=(ie.get(v)||0)+1,g=(s.get(v)||0)+1;ie.set(v,p),s.set(v,g),i.push(v),p===1&&h&&Re.set(v,!0),g===1&&v.setAttribute(n,"true"),h||v.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",v,w)}})};return f(t),c.clear(),Ue++,function(){i.forEach(function(l){var v=ie.get(l)-1,b=s.get(l)-1;ie.set(l,v),s.set(l,b),v||(Re.has(l)||l.removeAttribute(r),Re.delete(l)),b||l.removeAttribute(n)}),Ue--,Ue||(ie=new WeakMap,ie=new WeakMap,Re=new WeakMap,Oe={})}},Po=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=So(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),xo(r,o,n,"aria-hidden")):function(){return null}},Ro=Object.defineProperty,G=(e,t)=>Ro(e,"name",{value:t,configurable:!0}),ut="Dialog",[yn,da]=Ft(ut),[Oo,ne]=yn(ut),Do=G(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,c=a.useRef(null),u=a.useRef(null),[d,f]=Wt({prop:r,defaultProp:o??!1,onChange:s,caller:ut}),[l,v]=a.useState(0),[b,h]=a.useState(0);return E.jsx(Oo,{scope:t,triggerRef:c,contentRef:u,contentId:V(),titleId:V(),descriptionId:V(),titlePresent:l>0,descriptionPresent:b>0,setTitleCount:v,setDescriptionCount:h,open:d,onOpenChange:f,onOpenToggle:a.useCallback(()=>f(p=>!p),[f]),modal:i,children:n})},"Dialog"),En="DialogPortal",[ko,wn]=yn(En,{forceMount:void 0}),No=G(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=ne(En,t);return E.jsx(ko,{scope:t,forceMount:n,children:a.Children.map(r,i=>E.jsx(it,{present:n||s.open,children:E.jsx(Tr,{asChild:!0,container:o,children:i})}))})},"DialogPortal"),et="DialogOverlay",Io=a.forwardRef(G(function(t,n){const r=wn(et,t.__scopeDialog),{forceMount:o=r.forceMount,...s}=t,i=ne(et,t.__scopeDialog);return i.modal?E.jsx(it,{present:o||i.open,children:E.jsx(_o,{...s,ref:n})}):null},"DialogOverlay")),Ao=rt("DialogOverlay.RemoveScroll"),_o=a.forwardRef(G(function(t,n){const{__scopeDialog:r,...o}=t,s=ne(et,r),i=qt(),c=pe(n,i);return E.jsx(gn,{as:Ao,allowPinchZoom:!0,shards:[s.contentRef],children:E.jsx($.div,{"data-state":lt(s.open),...o,ref:c,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),ge="DialogContent",Mo=a.forwardRef(G(function(t,n){const r=wn(ge,t.__scopeDialog),{forceMount:o=r.forceMount,...s}=t,i=ne(ge,t.__scopeDialog);return E.jsx(it,{present:o||i.open,children:i.modal?E.jsx(To,{...s,ref:n}):E.jsx(Lo,{...s,ref:n})})},"DialogContent")),To=a.forwardRef(G(function(t,n){const r=ne(ge,t.__scopeDialog),o=a.useRef(null),s=pe(n,r.contentRef,o);return a.useEffect(()=>{const i=o.current;if(i)return Po(i)},[]),E.jsx(Sn,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Q(t.onCloseAutoFocus,i=>{var c;i.preventDefault(),(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Q(t.onPointerDownOutside,i=>{const c=i.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&i.preventDefault()}),onFocusOutside:Q(t.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),Lo=a.forwardRef(G(function(t,n){const r=ne(ge,t.__scopeDialog),o=a.useRef(!1),s=a.useRef(!1);return E.jsx(Sn,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var c,u;(c=t.onCloseAutoFocus)==null||c.call(t,i),i.defaultPrevented||(o.current||(u=r.triggerRef.current)==null||u.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var d,f;(d=t.onInteractOutside)==null||d.call(t,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=i.target;((f=r.triggerRef.current)==null?void 0:f.contains(c))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),Sn=a.forwardRef(G(function(t,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,...c}=t,u=ne(ge,r);return ct(),E.jsx(E.Fragment,{children:E.jsx(Ar,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:E.jsx(kr,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":lt(u.open),...c,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl"));function lt(e){return e?"open":"closed"}G(lt,"getState");var he='[cmdk-group=""]',Be='[cmdk-group-items=""]',Fo='[cmdk-group-heading=""]',Cn='[cmdk-item=""]',Nt=`${Cn}:not([aria-disabled="true"])`,tt="cmdk-item-select",ue="data-value",jo=(e,t,n)=>er(e,t,n),xn=a.createContext(void 0),Ee=()=>a.useContext(xn),Pn=a.createContext(void 0),dt=()=>a.useContext(Pn),Rn=a.createContext(void 0),On=a.forwardRef((e,t)=>{let n=le(()=>{var m,C;return{search:"",value:(C=(m=e.value)!=null?m:e.defaultValue)!=null?C:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=le(()=>new Set),o=le(()=>new Map),s=le(()=>new Map),i=le(()=>new Set),c=Dn(e),{label:u,children:d,value:f,onValueChange:l,filter:v,shouldFilter:b,loop:h,disablePointerSelection:p=!1,vimBindings:g=!0,...w}=e,S=V(),x=V(),O=V(),R=a.useRef(null),P=Xo();te(()=>{if(f!==void 0){let m=f.trim();n.current.value=m,N.emit()}},[f]),te(()=>{P(6,re)},[]);let N=a.useMemo(()=>({subscribe:m=>(i.current.add(m),()=>i.current.delete(m)),snapshot:()=>n.current,setState:(m,C,D)=>{var y,k,A,L;if(!Object.is(n.current[m],C)){if(n.current[m]=C,m==="search")I(),q(),P(1,F);else if(m==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let M=document.getElementById(O);M?M.focus():(y=document.getElementById(S))==null||y.focus()}if(P(7,()=>{var M;n.current.selectedItemId=(M=K())==null?void 0:M.id,N.emit()}),D||P(5,re),((k=c.current)==null?void 0:k.value)!==void 0){let M=C??"";(L=(A=c.current).onValueChange)==null||L.call(A,M);return}}N.emit()}},emit:()=>{i.current.forEach(m=>m())}}),[]),X=a.useMemo(()=>({value:(m,C,D)=>{var y;C!==((y=s.current.get(m))==null?void 0:y.value)&&(s.current.set(m,{value:C,keywords:D}),n.current.filtered.items.set(m,z(C,D)),P(2,()=>{q(),N.emit()}))},item:(m,C)=>(r.current.add(m),C&&(o.current.has(C)?o.current.get(C).add(m):o.current.set(C,new Set([m]))),P(3,()=>{I(),q(),n.current.value||F(),N.emit()}),()=>{s.current.delete(m),r.current.delete(m),n.current.filtered.items.delete(m);let D=K();P(4,()=>{I(),(D==null?void 0:D.getAttribute("id"))===m&&F(),N.emit()})}),group:m=>(o.current.has(m)||o.current.set(m,new Set),()=>{s.current.delete(m),o.current.delete(m)}),filter:()=>c.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:S,inputId:O,labelId:x,listInnerRef:R}),[]);function z(m,C){var D,y;let k=(y=(D=c.current)==null?void 0:D.filter)!=null?y:jo;return m?k(m,n.current.search,C):0}function q(){if(!n.current.search||c.current.shouldFilter===!1)return;let m=n.current.filtered.items,C=[];n.current.filtered.groups.forEach(y=>{let k=o.current.get(y),A=0;k.forEach(L=>{let M=m.get(L);A=Math.max(M,A)}),C.push([y,A])});let D=R.current;J().sort((y,k)=>{var A,L;let M=y.getAttribute("id"),we=k.getAttribute("id");return((A=m.get(we))!=null?A:0)-((L=m.get(M))!=null?L:0)}).forEach(y=>{let k=y.closest(Be);k?k.appendChild(y.parentElement===k?y:y.closest(`${Be} > *`)):D.appendChild(y.parentElement===D?y:y.closest(`${Be} > *`))}),C.sort((y,k)=>k[1]-y[1]).forEach(y=>{var k;let A=(k=R.current)==null?void 0:k.querySelector(`${he}[${ue}="${encodeURIComponent(y[0])}"]`);A==null||A.parentElement.appendChild(A)})}function F(){let m=J().find(D=>D.getAttribute("aria-disabled")!=="true"),C=m==null?void 0:m.getAttribute(ue);N.setState("value",C||void 0)}function I(){var m,C,D,y;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let k=0;for(let A of r.current){let L=(C=(m=s.current.get(A))==null?void 0:m.value)!=null?C:"",M=(y=(D=s.current.get(A))==null?void 0:D.keywords)!=null?y:[],we=z(L,M);n.current.filtered.items.set(A,we),we>0&&k++}for(let[A,L]of o.current)for(let M of L)if(n.current.filtered.items.get(M)>0){n.current.filtered.groups.add(A);break}n.current.filtered.count=k}function re(){var m,C,D;let y=K();y&&(((m=y.parentElement)==null?void 0:m.firstChild)===y&&((D=(C=y.closest(he))==null?void 0:C.querySelector(Fo))==null||D.scrollIntoView({block:"nearest"})),y.scrollIntoView({block:"nearest"}))}function K(){var m;return(m=R.current)==null?void 0:m.querySelector(`${Cn}[aria-selected="true"]`)}function J(){var m;return Array.from(((m=R.current)==null?void 0:m.querySelectorAll(Nt))||[])}function Ae(m){let C=J()[m];C&&N.setState("value",C.getAttribute(ue))}function _e(m){var C;let D=K(),y=J(),k=y.findIndex(L=>L===D),A=y[k+m];(C=c.current)!=null&&C.loop&&(A=k+m<0?y[y.length-1]:k+m===y.length?y[0]:y[k+m]),A&&N.setState("value",A.getAttribute(ue))}function ft(m){let C=K(),D=C==null?void 0:C.closest(he),y;for(;D&&!y;)D=m>0?Yo(D,he):Go(D,he),y=D==null?void 0:D.querySelector(Nt);y?N.setState("value",y.getAttribute(ue)):_e(m)}let vt=()=>Ae(J().length-1),mt=m=>{m.preventDefault(),m.metaKey?vt():m.altKey?ft(1):_e(1)},pt=m=>{m.preventDefault(),m.metaKey?Ae(0):m.altKey?ft(-1):_e(-1)};return a.createElement($.div,{ref:t,tabIndex:-1,...w,"cmdk-root":"",onKeyDown:m=>{var C;(C=w.onKeyDown)==null||C.call(w,m);let D=m.nativeEvent.isComposing||m.keyCode===229;if(!(m.defaultPrevented||D))switch(m.key){case"n":case"j":{g&&m.ctrlKey&&mt(m);break}case"ArrowDown":{mt(m);break}case"p":case"k":{g&&m.ctrlKey&&pt(m);break}case"ArrowUp":{pt(m);break}case"Home":{m.preventDefault(),Ae(0);break}case"End":{m.preventDefault(),vt();break}case"Enter":{m.preventDefault();let y=K();if(y){let k=new Event(tt);y.dispatchEvent(k)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:X.inputId,id:X.labelId,style:Zo},u),Ie(e,m=>a.createElement(Pn.Provider,{value:N},a.createElement(xn.Provider,{value:X},m))))}),$o=a.forwardRef((e,t)=>{var n,r;let o=V(),s=a.useRef(null),i=a.useContext(Rn),c=Ee(),u=Dn(e),d=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;te(()=>{if(!d)return c.item(o,i==null?void 0:i.id)},[d]);let f=kn(o,s,[e.value,e.children,s],e.keywords),l=dt(),v=Z(P=>P.value&&P.value===f.current),b=Z(P=>d||c.filter()===!1?!0:P.search?P.filtered.items.get(o)>0:!0);a.useEffect(()=>{let P=s.current;if(!(!P||e.disabled))return P.addEventListener(tt,h),()=>P.removeEventListener(tt,h)},[b,e.onSelect,e.disabled]);function h(){var P,N;p(),(N=(P=u.current).onSelect)==null||N.call(P,f.current)}function p(){l.setState("value",f.current,!0)}if(!b)return null;let{disabled:g,value:w,onSelect:S,forceMount:x,keywords:O,...R}=e;return a.createElement($.div,{ref:ee(s,t),...R,id:o,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!v,"data-disabled":!!g,"data-selected":!!v,onPointerMove:g||c.getDisablePointerSelection()?void 0:p,onClick:g?void 0:h},e.children)}),Wo=a.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,i=V(),c=a.useRef(null),u=a.useRef(null),d=V(),f=Ee(),l=Z(b=>o||f.filter()===!1?!0:b.search?b.filtered.groups.has(i):!0);te(()=>f.group(i),[]),kn(i,c,[e.value,e.heading,u]);let v=a.useMemo(()=>({id:i,forceMount:o}),[o]);return a.createElement($.div,{ref:ee(c,t),...s,"cmdk-group":"",role:"presentation",hidden:l?void 0:!0},n&&a.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),Ie(e,b=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},a.createElement(Rn.Provider,{value:v},b))))}),Uo=a.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=a.useRef(null),s=Z(i=>!i.search);return!n&&!s?null:a.createElement($.div,{ref:ee(o,t),...r,"cmdk-separator":"",role:"separator"})}),Bo=a.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,s=dt(),i=Z(d=>d.search),c=Z(d=>d.selectedItemId),u=Ee();return a.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),a.createElement($.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":c,id:u.inputId,type:"text",value:o?e.value:i,onChange:d=>{o||s.setState("search",d.target.value),n==null||n(d.target.value)}})}),Vo=a.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=a.useRef(null),i=a.useRef(null),c=Z(d=>d.selectedItemId),u=Ee();return a.useEffect(()=>{if(i.current&&s.current){let d=i.current,f=s.current,l,v=new ResizeObserver(()=>{l=requestAnimationFrame(()=>{let b=d.offsetHeight;f.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return v.observe(d),()=>{cancelAnimationFrame(l),v.unobserve(d)}}},[]),a.createElement($.div,{ref:ee(s,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:u.listId},Ie(e,d=>a.createElement("div",{ref:ee(i,u.listInnerRef),"cmdk-list-sizer":""},d)))}),zo=a.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:i,...c}=e;return a.createElement(Do,{open:n,onOpenChange:r},a.createElement(No,{container:i},a.createElement(Io,{"cmdk-overlay":"",className:o}),a.createElement(Mo,{"aria-label":e.label,"cmdk-dialog":"",className:s},a.createElement(On,{ref:t,...c}))))}),Ko=a.forwardRef((e,t)=>Z(n=>n.filtered.count===0)?a.createElement($.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Ho=a.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return a.createElement($.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Ie(e,i=>a.createElement("div",{"aria-hidden":!0},i)))}),se=Object.assign(On,{List:Vo,Item:$o,Input:Bo,Group:Wo,Separator:Uo,Dialog:zo,Empty:Ko,Loading:Ho});function Yo(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Go(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Dn(e){let t=a.useRef(e);return te(()=>{t.current=e}),t}var te=typeof window>"u"?a.useEffect:a.useLayoutEffect;function le(e){let t=a.useRef();return t.current===void 0&&(t.current=e()),t}function Z(e){let t=dt(),n=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,n,n)}function kn(e,t,n,r=[]){let o=a.useRef(),s=Ee();return te(()=>{var i;let c=(()=>{var d;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(d=f.current.textContent)==null?void 0:d.trim():o.current}})(),u=r.map(d=>d.trim());s.value(e,c,u),(i=t.current)==null||i.setAttribute(ue,c),o.current=c}),o}var Xo=()=>{let[e,t]=a.useState(),n=le(()=>new Map);return te(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function qo(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Ie({asChild:e,children:t},n){return e&&a.isValidElement(t)?a.cloneElement(qo(t),{ref:t.ref},n(t.props.children)):n(t)}var Zo={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Nn={gehe:"Gehe zu",tun:"Tun",finden:"Finden",lucy:"An Lucy"},Jo=An.map(e=>({id:`gehe:${e.id}`,gruppe:"gehe",label:e.label,hinweis:e.hint,icon:e.icon,ausfuehren:({navigate:t})=>t(e.pfad)})),Qo=[{id:"tun:wartung",gruppe:"tun",label:"System-Wartung öffnen",hinweis:"Dienste, Updates, Snapshot",icon:In,stichworte:"pflege dienste neustart update",ausfuehren:({schublade:e})=>e("wartung")},{id:"tun:logs",gruppe:"tun",label:"System-Logs öffnen",hinweis:"Diagnose je Dienst",icon:Kn,stichworte:"fehler journal diagnose",ausfuehren:({schublade:e})=>e("logs")},{id:"tun:updates",gruppe:"tun",label:"Nach Updates suchen",hinweis:"apt + Engine + Agent prüfen",icon:$n,stichworte:"aktualisieren apt engine",ausfuehren:async({api:e,melden:t})=>{await e("/api/maintenance/check-updates",{method:"POST"}),t("info","Update-Suche läuft — das Ergebnis erscheint in der Wartung.")}},{id:"tun:snapshot",gruppe:"tun",label:"Snapshot anlegen",hinweis:"Sicherung vor riskanten Schritten",icon:Wn,stichworte:"backup sicherung zeitmaschine",ausfuehren:async({api:e,melden:t})=>{await e("/api/system/backup",{method:"POST"}),t("erfolg","Snapshot angestoßen.")}},{id:"tun:engine-neustart",gruppe:"tun",label:"Motor neu starten",hinweis:"llama-swap — alle Modelle fallen kurz weg",icon:Un,stichworte:"engine llama swap modell neu starten",rueckfrage:"Der Motor (llama-swap) wird neu gestartet. Alle geladenen Modelle fallen dabei aus dem Speicher und müssen neu aufwärmen — das dauert je nach Modell über 20 Sekunden. Laufende Antworten brechen ab.",ausfuehren:async({api:e,melden:t})=>{const n=await e("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:"llama-swap"})});t(n.ok?"erfolg":"fehler",n.ok?"Motor neu gestartet.":`Neustart fehlgeschlagen: ${n.err||"Unbekannter Fehler"}`)}}],ea=e=>{const t=e.trim();return t?[{id:"finden:chronik",gruppe:"finden",label:`„${t}“ in der Chronik`,hinweis:"Was die Box getan hat",icon:Bn,ausfuehren:({navigate:n})=>n(`/chronik?q=${encodeURIComponent(t)}`)},{id:"finden:wissen",gruppe:"finden",label:`„${t}“ im Wissens-Vault`,hinweis:"Lucys Notizen",icon:Vn,ausfuehren:({navigate:n})=>n(`/wissen?suche=${encodeURIComponent(t)}`)}]:[]},ta=e=>{const t=e.trim();return t.length<8?[]:[{id:"lucy:idee",gruppe:"lucy",label:`Als Idee erfassen: „${t.length>60?t.slice(0,57)+"…":t}“`,hinweis:"Wird nur notiert — gebaut wird erst auf deinen Klick",icon:_n,ausfuehren:async({api:n,melden:r,navigate:o})=>{await n("/api/ideen",{method:"POST",body:JSON.stringify({titel:t.length>160?t.slice(0,157)+"…":t,notiz:t.length>160?t:"",welt:"ide",tiefe:"",ziel:"",art:"idee"})}),r("erfolg","Als Idee erfasst."),o("/ideen")}}]};function na(e){return[...Jo,...Qo,...ea(e),...ta(e)]}const ra=e=>[e.label,e.hinweis,e.stichworte,Nn[e.gruppe]].filter(Boolean).join(" "),oa=["gehe","tun","finden","lucy"];function fa(){const e=Mn(),t=ht(b=>b.palette),n=ht(b=>b.melden),r=Tn(),[o,s]=a.useState(""),[i,c]=a.useState(null),[u,d]=a.useState(!1),f=a.useCallback(()=>{t(!1),s(""),c(null)},[t]),l=a.useCallback(async b=>{d(!0);try{await b.ausfuehren({text:o,navigate:h=>r({to:h}),schublade:h=>r({to:".",search:p=>({...p,system:h})}),melden:n,api:Ln}),f()}catch(h){n("fehler",h instanceof Error?h.message:String(h)),c(null)}finally{d(!1)}},[o,r,n,f]),v=a.useMemo(()=>na(o),[o]);return E.jsx(se.Dialog,{open:e,onOpenChange:b=>b?t(!0):f(),label:"Befehlspalette",className:"fixed inset-0 z-50 flex items-start justify-center overscroll-contain bg-black/50 p-4 pt-[12vh]",onClick:f,shouldFilter:!i,children:E.jsx("div",{className:"w-full max-w-xl overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-2xl",onClick:b=>b.stopPropagation(),children:i?E.jsxs("div",{className:"space-y-4 p-5",children:[E.jsxs("div",{className:"flex items-center gap-2.5",children:[E.jsx(Fn,{className:"h-5 w-5 shrink-0 text-amber-400","aria-hidden":"true"}),E.jsx("h2",{className:"font-space text-sm font-bold tracking-tight",children:i.label})]}),E.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:i.rueckfrage}),E.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[E.jsx("button",{onClick:()=>c(null),className:"h-9 cursor-pointer rounded-lg border border-border/60 bg-background/20 px-4 text-xs font-semibold text-muted-foreground transition-colors hover:bg-accent",children:"Abbrechen"}),E.jsx("button",{autoFocus:!0,disabled:u,onClick:()=>l(i),className:"h-9 cursor-pointer rounded-lg bg-amber-500/90 px-4 text-xs font-bold text-black transition-colors hover:bg-amber-500 disabled:opacity-50",children:u?"Läuft …":"Ja, ausführen"})]})]}):E.jsxs(E.Fragment,{children:[E.jsx(se.Input,{autoFocus:!0,value:o,onValueChange:s,placeholder:"Springen, tun, finden — oder schreib eine Idee …",className:"w-full border-b border-border bg-transparent px-4 py-3 text-sm outline-none placeholder:text-muted-foreground"}),E.jsxs(se.List,{className:"max-h-[26rem] overflow-y-auto p-2 scrollbar-thin",children:[E.jsx(se.Empty,{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Nichts gefunden."}),oa.map(b=>{const h=v.filter(p=>p.gruppe===b);return h.length?E.jsx(se.Group,{heading:Nn[b],className:"px-1 py-1 text-[10px] font-bold uppercase tracking-widest text-muted-foreground/50",children:h.map(p=>E.jsxs(se.Item,{value:ra(p),onSelect:()=>p.rueckfrage?c(p):l(p),className:"flex cursor-pointer items-center gap-3 rounded-md px-3 py-2 text-sm text-foreground aria-selected:bg-accent aria-selected:text-accent-foreground",children:[E.jsx(p.icon,{className:jn("h-4 w-4 shrink-0",p.rueckfrage?"text-amber-400":"text-primary"),"aria-hidden":"true"}),E.jsx("span",{className:"truncate",children:p.label}),p.rueckfrage&&E.jsx("span",{className:"shrink-0 rounded bg-amber-500/15 px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wide text-amber-300",children:"fragt nach"}),p.hinweis&&E.jsx("span",{className:"ml-auto truncate pl-3 text-xs text-muted-foreground",children:p.hinweis})]},p.id))},b):null})]}),E.jsxs("div",{className:"flex items-center gap-3 border-t border-border/50 px-4 py-2 font-mono text-[10px] text-muted-foreground",children:[E.jsx("span",{className:"flex items-center gap-1",children:"↑↓ wählen"}),E.jsxs("span",{className:"flex items-center gap-1",children:[E.jsx(zn,{className:"h-3 w-3","aria-hidden":"true"})," ausführen"]}),E.jsx("span",{className:"ml-auto",children:"esc schließt"})]})]})})})}export{fa as CommandPalette};
|